[PATCH v4 2/2] pwm: th1520: Fix 32-bit build with COMPILE_TEST
Alice Ryhl
aliceryhl at google.com
Wed Nov 18 15:23:45 PST 2026
On Thu, Nov 19, 2026 at 07:48:26AM +0900, FUJITA Tomonori wrote:
> From: FUJITA Tomonori <fujita.tomonori at gmail.com>
>
> 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.
>
> Use div64_u64() and div64_u64_round_up() for these divisions, in the
> same way as C drivers use div64_u64() and DIV64_U64_ROUND_UP(). The
> results do not change.
>
> Fixes: 3c180003dffb ("pwm: th1520: Fix missing Kconfig dependencies")
> Reported-by: Andreas Hindborg <a.hindborg at kernel.org>
> Closes: https://rust-for-linux.zulipchat.com/#narrow/channel/291565-Help/topic/64bit.20division.20in.20.60pwm_th1520.2Ers.60/near/626825599
> Suggested-by: Uwe Kleine-König <ukleinek at kernel.org>
> Acked-by: Uwe Kleine-König <u.kleine-koenig at baylibre.com>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori at gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl at google.com>
Alice
More information about the linux-riscv
mailing list