Skip to contentSkip to conversation

pwm: th1520: Fix 32-bit build with COMPILE_TEST

PATCH Superseded FUJITA Tomonori 4 participants 5 messages Sep 29

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: th1520: Fix 32-bit build with COMPILE_TEST

From: FUJITA Tomonori <[email protected]>

Fix the following build error on 32-bit ARM with COMPILE_TEST:

ERROR: modpost: drivers/pwm/pwm_th1520.ko: symbol '__aeabi_uldivmod' undefined!

The driver divides u64 values when it converts between nanoseconds and clock cycles. On 32-bit ARM, these divisions are compiled to calls to __aeabi_uldivmod, which the kernel does not provide.

he TH1520 is a 64-bit RISC-V SoC, so the driver is only used on 64-bit kernels. There is no point in compile testing it on 32-bit. Limit COMPILE_TEST to 64BIT instead of changing the arithmetic to use the div64 helpers.

Fixes 3c180003dffb ("pwm: th1520: Fix missing Kconfig dependencies")
---
 drivers/pwm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/Kconfig +1 -1
index 729776086879..abecd95b0c3c 100644
@@ -772,7 +772,7 @@ config PWM_TEGRA
 
 config PWM_TH1520
 	tristate "TH1520 PWM support"
-	depends on ARCH_THEAD || COMPILE_TEST
+	depends on ARCH_THEAD || (COMPILE_TEST && 64BIT)
 	depends on RUST
 	depends on HAS_IOMEM && COMMON_CLK
 	select RUST_PWM_ABSTRACTIONS

base-commit: d266640c6c760c9bc215bf5a3ece122ca488b6f5

Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · FUJITA Tomonori

From: FUJITA Tomonori <[email protected]>

Fix the following build error on 32-bit ARM with COMPILE_TEST:

ERROR: modpost: drivers/pwm/pwm_th1520.ko: symbol '__aeabi_uldivmod' undefined!

The driver divides u64 values when it converts between nanoseconds and clock cycles. On 32-bit ARM, these divisions are compiled to calls to __aeabi_uldivmod, which the kernel does not provide.

Quoted 7 lines

he TH1520 is a 64-bit RISC-V SoC, so the driver is only used on 64-bit kernels. There is no point in compile testing it on 32-bit. Limit COMPILE_TEST to 64BIT instead of changing the arithmetic to use the div64 helpers.

Fixes 3c180003dffb ("pwm: th1520: Fix missing Kconfig dependencies")

Best regards,
Andreas Hindborg

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to FUJITA Tomonori
Quoted 10 lines · FUJITA Tomonori

From: FUJITA Tomonori <[email protected]>

Fix the following build error on 32-bit ARM with COMPILE_TEST:

ERROR: modpost: drivers/pwm/pwm_th1520.ko: symbol '__aeabi_uldivmod' undefined!

The driver divides u64 values when it converts between nanoseconds and clock cycles. On 32-bit ARM, these divisions are compiled to calls to __aeabi_uldivmod, which the kernel does not provide.

Quoted 7 lines

he TH1520 is a 64-bit RISC-V SoC, so the driver is only used on 64-bit kernels. There is no point in compile testing it on 32-bit. Limit COMPILE_TEST to 64BIT instead of changing the arithmetic to use the div64 helpers.

Fixes 3c180003dffb ("pwm: th1520: Fix missing Kconfig dependencies")
Quoted 3 lines
---
 drivers/pwm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#3 lore raw
In reply to FUJITA Tomonori
Quoted 2 lines · FUJITA Tomonori

he TH1520 is a 64-bit RISC-V SoC, so the driver is only used on

Cut word at the beginning.

Quoted 1 line
Fixes 3c180003dffb ("pwm: th1520: Fix missing Kconfig dependencies")

Should this have Cc: [email protected]?

Thanks!

Cheers,
Miguel

#4 lore raw
Quoted 5 lines · On Tue, 29 Sep 2026 13:54:05 +0200 Miguel Ojeda…
Quoted 2 lines · FUJITA Tomonori

he TH1520 is a 64-bit RISC-V SoC, so the driver is only used on

Cut word at the beginning.

Oops, thanks.

Quoted 3 lines
Quoted 1 line
Fixes 3c180003dffb ("pwm: th1520: Fix missing Kconfig dependencies")

Should this have Cc: [email protected]?

Yes, I'll add Cc: stable. The build error has been there since v6.19.

I also forgot to Cc the PWM maintainer and list, and missed the Reported-by and Closes tags. I'll send v2 tomorrow with these fixes and the Reviewed-by tags from Andreas and Gary.