From patchwork Mon Apr 12 08:40:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 419517 Delivered-To: patch@linaro.org Received: by 2002:a02:c4d2:0:0:0:0:0 with SMTP id h18csp1566352jaj; Mon, 12 Apr 2021 02:08:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+0qlJQ3ERbrSxyU+paG5eWFBqTz7aB97zZTsQc6eKQt6G0glarBD8mc/VOr+6k+NMTiS5 X-Received: by 2002:a17:90a:eb04:: with SMTP id j4mr15868827pjz.156.1618218487934; Mon, 12 Apr 2021 02:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618218487; cv=none; d=google.com; s=arc-20160816; b=h3TvGZchMNZwAOfrrS2Ym/XzGYsLAWTPEOGD8smiQg4bTISpnxNj+62emXrRks/4B/ NisFyusWxovbuIzbCJqE/88IguGOCIb1tkwSqDkOhrhGgJFLaXJJGWT1QlGgCGeTHLw/ 8Kghm7VAnx5sm/WFrzNFU4vn74XpTB3FpN/BaNY6TpXV98K/ZtV2XRb4TJoowU3EnTR5 ki0o58PaVhIS3aDzzeQeYXkbC5khtV0H9gd88ukl5CyQ0AQvT0X9hHfvFglngyTWXQAy F+c7eozInOkFMgjfc43S0YpMnWOmn4N0uH3uSdbjZoCAWsbpu1OzaVciyGS7oe1diw7w c5lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bXVVxITWam0e4Qq8lP0416tAo+9mrp0lhs1v/VbhYZ0=; b=n8YAm+HX3zopbX2qKlFYgIv/x8JLDSd5Rfz/1xh39X9f9qmCe/f3o6r1tlOJ/mwiGa RnB0zRekFuMKoHwOvSOuZPIpa7xSxzIOf0uIBMo819vU2pq5BXaRO9JIyAvD7RokOwov MBaGYgF6hU/bsVwa15ZF6z9C0rzYOyuf/AW5I3RixB/qyTrtPsdjbJl5nWGTdm2S9GZl xYhX1uk5vLXHd7b2P9VWDto1uFwe9HlR/X49FtBgc3JZcgriw0QLkEjbARS8fVDdi+/E nnD60Qo8LYAKRLoXmEukBJG7uIbff4Sh9s5V5q4sPTsHNVnN0xJ2nuIcmASU+ANnyYyk i6vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zlH+Ar7m; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si13297582pfr.154.2021.04.12.02.08.07; Mon, 12 Apr 2021 02:08:07 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zlH+Ar7m; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239742AbhDLJIS (ORCPT + 12 others); Mon, 12 Apr 2021 05:08:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238645AbhDLJGP (ORCPT ); Mon, 12 Apr 2021 05:06:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 63AE66102A; Mon, 12 Apr 2021 09:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618218189; bh=XzYqd4Wk2MNbI79pscmIUBZKL0rKAEqzneFBph07z/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zlH+Ar7miYCg5yA++iQa0EXGgP1BiIg+fkOBAVwI15UrTAOMr4tmgWJ012Lrd+6o5 Hplb6O+onKUW0tAgAi5Hu5Cs3bJ468M2MthHdSYaF7+ew1j3uLJik5m2gqtW1FKeAn /EjaZkinJHTQd0NvQrhNvBCwcjYT74YKuMKUu+SE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.11 105/210] remoteproc: qcom: pil_info: avoid 64-bit division Date: Mon, 12 Apr 2021 10:40:10 +0200 Message-Id: <20210412084019.511289921@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084016.009884719@linuxfoundation.org> References: <20210412084016.009884719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 7029e783027706b427bbfbdf8558252c1dac6fa0 ] On 32-bit machines with 64-bit resource_size_t, the driver causes a link failure because of the 64-bit division: arm-linux-gnueabi-ld: drivers/remoteproc/qcom_pil_info.o: in function `qcom_pil_info_store': qcom_pil_info.c:(.text+0x1ec): undefined reference to `__aeabi_uldivmod' Add a cast to an u32 to avoid this. If the resource exceeds 4GB, there are bigger problems. Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210103135628.3702427-1-arnd@kernel.org Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/remoteproc/qcom_pil_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/remoteproc/qcom_pil_info.c b/drivers/remoteproc/qcom_pil_info.c index 5521c4437ffa..7c007dd7b200 100644 --- a/drivers/remoteproc/qcom_pil_info.c +++ b/drivers/remoteproc/qcom_pil_info.c @@ -56,7 +56,7 @@ static int qcom_pil_info_init(void) memset_io(base, 0, resource_size(&imem)); _reloc.base = base; - _reloc.num_entries = resource_size(&imem) / PIL_RELOC_ENTRY_SIZE; + _reloc.num_entries = (u32)resource_size(&imem) / PIL_RELOC_ENTRY_SIZE; return 0; }