linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc: qcom: pil_info: avoid 64-bit division
@ 2021-01-03 13:56 Arnd Bergmann
  2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-01-03 13:56 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Ohad Ben-Cohen, Mathieu Poirier, Vinod Koul
  Cc: Arnd Bergmann, linux-arm-msm, linux-remoteproc, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
 drivers/remoteproc/qcom_pil_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] remoteproc: qcom: pil_info: avoid 64-bit division
  2021-01-03 13:56 [PATCH] remoteproc: qcom: pil_info: avoid 64-bit division Arnd Bergmann
@ 2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-05-26 19:03 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arm-msm

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Sun,  3 Jan 2021 14:56:12 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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'
> 
> [...]

Here is the summary with links:
  - remoteproc: qcom: pil_info: avoid 64-bit division
    https://git.kernel.org/qcom/c/7029e7830277

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-26 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 13:56 [PATCH] remoteproc: qcom: pil_info: avoid 64-bit division Arnd Bergmann
2021-05-26 19:03 ` patchwork-bot+linux-arm-msm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).