Skip to contentSkip to conversation

i2c: mlxbf: Allow build with COMPILE_TEST

PATCH Applied Andi Shyti 3 participants 5 messages May 5, 2025 – May 12, 2025 I2C subsystem host drivers

lore
Share & tools
lore

Andi Shyti

author maintainer
#0 lore raw

PATCH 1/1 i2c: mlxbf: Allow build with COMPILE_TEST

Extend the Kconfig dependency to include COMPILE_TEST so the Mellanox BlueField I2C driver can be built on non-ARM64 platforms for compile testing purposes.

Cc Khalil Blaiech <[email protected]>
Cc Asmaa Mnebhi <[email protected]>
---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
index adb2910525b1..9f216d5db91d 100644
@@ -855,7 +855,7 @@ config I2C_LS2X
 
 config I2C_MLXBF
         tristate "Mellanox BlueField I2C controller"
-        depends on MELLANOX_PLATFORM && ARM64
+        depends on (MELLANOX_PLATFORM && ARM64) || COMPILE_TEST
 	depends on ACPI
 	select I2C_SLAVE
         help
Signature · 1 line
2.49.0
#2 lore raw

Thanks Andi

-----Original Message-----
From: Andi Shyti <[email protected]>
Sent: Thursday, May 8, 2025 6:11 AM
To: linux-i2c <[email protected]>
Cc: Khalil Blaiech <[email protected]>; Asmaa Mnebhi <[email protected]>
Subject: Re: [PATCH] i2c: mlxbf: Allow build with COMPILE_TEST

Hi,

Quoted 7 lines · Andi Shyti

Extend the Kconfig dependency to include COMPILE_TEST so the Mellanox BlueField I2C driver can be built on non-ARM64 platforms for compile testing purposes.

Cc Khalil Blaiech <[email protected]>
Cc Asmaa Mnebhi <[email protected]>

merged into i2c/i2c-host.

Andi

#3 lore raw
In reply to Andi Shyti
Quoted 27 lines · Andi Shyti

Extend the Kconfig dependency to include COMPILE_TEST so the Mellanox BlueField I2C driver can be built on non-ARM64 platforms for compile testing purposes.

Cc Khalil Blaiech <[email protected]>
Cc Asmaa Mnebhi <[email protected]>
---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
index adb2910525b1..9f216d5db91d 100644
@@ -855,7 +855,7 @@ config I2C_LS2X
 
 config I2C_MLXBF
         tristate "Mellanox BlueField I2C controller"
-        depends on MELLANOX_PLATFORM && ARM64
+        depends on (MELLANOX_PLATFORM && ARM64) || COMPILE_TEST
 	depends on ACPI
 	select I2C_SLAVE
         help
Signature · 1 line
2.49.0

There are 64-bit divides in several places within this driver so this patch breaks the build on 32-bit platforms when compile testing now:

i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o: in function `mlxbf_i2c_calculate_freq_from_tyu':
i2c-mlxbf.c:(.text+0x3e): undefined reference to `__udivdi3'
i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o: in function `mlxbf_i2c_calculate_freq_from_yu':
i2c-mlxbf.c:(.text+0x8e): undefined reference to `__udivdi3'
i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o: in function `mlxbf_i2c_probe':
i2c-mlxbf.c:(.text+0x1749): undefined reference to `__udivdi3'
i386-linux-ld: i2c-mlxbf.c:(.text+0x1769): undefined reference to `__udivdi3'
i386-linux-ld: i2c-mlxbf.c:(.text+0x17c0): undefined reference to `__udivdi3'
i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o:i2c-mlxbf.c:(.text+0x17e6): more undefined references to `__udivdi3' follow

Cheers,
Nathan

author maintainer
#4 lore raw

Hi Nathan,

Quoted 32 lines · Nathan Chancellor
Quoted 27 lines · Andi Shyti

Extend the Kconfig dependency to include COMPILE_TEST so the Mellanox BlueField I2C driver can be built on non-ARM64 platforms for compile testing purposes.

Cc Khalil Blaiech <[email protected]>
Cc Asmaa Mnebhi <[email protected]>
---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
index adb2910525b1..9f216d5db91d 100644
@@ -855,7 +855,7 @@ config I2C_LS2X
 
 config I2C_MLXBF
         tristate "Mellanox BlueField I2C controller"
-        depends on MELLANOX_PLATFORM && ARM64
+        depends on (MELLANOX_PLATFORM && ARM64) || COMPILE_TEST
 	depends on ACPI
 	select I2C_SLAVE
         help
Signature · 1 line
2.49.0

There are 64-bit divides in several places within this driver so this patch breaks the build on 32-bit platforms when compile testing now:

Quoted 9 lines

i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o: in function `mlxbf_i2c_calculate_freq_from_tyu':
i2c-mlxbf.c:(.text+0x3e): undefined reference to `__udivdi3'
i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o: in function `mlxbf_i2c_calculate_freq_from_yu':
i2c-mlxbf.c:(.text+0x8e): undefined reference to `__udivdi3'
i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o: in function `mlxbf_i2c_probe':
i2c-mlxbf.c:(.text+0x1749): undefined reference to `__udivdi3'
i386-linux-ld: i2c-mlxbf.c:(.text+0x1769): undefined reference to `__udivdi3'
i386-linux-ld: i2c-mlxbf.c:(.text+0x17c0): undefined reference to `__udivdi3'
i386-linux-ld: drivers/i2c/busses/i2c-mlxbf.o:i2c-mlxbf.c:(.text+0x17e6): more undefined references to `__udivdi3' follow

arghh... you're right! Thanks for testing this! I reverted my patch for now.

Thanks,
Andi