Re: [PATCH] gpio: rockchip: Fix debounce arithmetic for GPIO v2

From
Bartosz Golaszewski <hidden>
Date
2026-10-28 09:30:53
Also in
linux-gpio, linux-rockchip, lkml, stable
Reply to
Cunhao Lu, 2026-10-23
On Fri, 23 Oct 2026 16:21:05 +0800, Cunhao Lu wrote:
The debounce interval calculations use unsigned long operands. On 32-bit
systems, the numerator used to calculate the maximum interval overflows
before division, while multiplying the requested interval by the clock
rate overflows before it is assigned to a u64. A zero debounce clock rate
also causes division by zero.

Use 64-bit arithmetic for both calculations and reject a zero clock rate
before division.

[...]
Applied, thanks!

[1/1] gpio: rockchip: Fix debounce arithmetic for GPIO v2
      https://git.kernel.org/brgl/c/13467fd6998f5da4f5b4f172f1af3d9c48d5de8f

Best regards,
-- 
Bartosz Golaszewski [off-list ref]
Thread (2 messages) 2 messages, 2 authors, last reply 9d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help