Skip to contentSkip to conversation

net/fungible: Fix reference to __udivdi3 on 32b builds

PATCH Applied Dimitris Michailidis 2 participants 2 messages Apr 1, 2022 – Apr 2, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/fungible: Fix reference to __udivdi3 on 32b builds

32b builds with CONFIG_PHYS_ADDR_T_64BIT=y, such as i386 PAE, raise a linker error due to a 64b division:

ld: drivers/net/ethernet/fungible/funcore/fun_dev.o: in function `fun_dev_enable':
(.text+0xe1a): undefined reference to `__udivdi3'

The divisor in the offendinng expression is a power of 2. Change it to use an explicit right shift.

Fixes e1ffcc66818f ("net/fungible: Add service module for Fungible drivers")
---
 drivers/net/ethernet/fungible/funcore/fun_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/fungible/funcore/fun_dev.c +2 -2
index 5d7aef73df61..fb5120d90f26 100644
@@ -586,8 +586,8 @@ static int fun_get_dev_limits(struct fun_dev *fdev)
 	/* Calculate the max QID based on SQ/CQ/doorbell counts.
 	 * SQ/CQ doorbells alternate.
 	 */
-	num_dbs = (pci_resource_len(pdev, 0) - NVME_REG_DBS) /
-		  (fdev->db_stride * 4);
+	num_dbs = (pci_resource_len(pdev, 0) - NVME_REG_DBS) >>
+		  (2 + NVME_CAP_STRIDE(fdev->cap_reg));
 	fdev->max_qid = min3(cq_count, sq_count, num_dbs / 2) - 1;
 	fdev->kern_end_qid = fdev->max_qid + 1;
 	return 0;
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 1 Apr 2022 16:24:11 -0700 you wrote:

32b builds with CONFIG_PHYS_ADDR_T_64BIT=y, such as i386 PAE, raise a linker error due to a 64b division:

ld: drivers/net/ethernet/fungible/funcore/fun_dev.o: in function `fun_dev_enable':
(.text+0xe1a): undefined reference to `__udivdi3'

[...]

Here is the summary with links:
- [net] net/fungible: Fix reference to __udivdi3 on 32b builds

    https://git.kernel.org/netdev/net/c/31ac3bcee47b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html