]> www.infradead.org Git - users/jedix/linux-maple.git/commit
firmware: exynos-acpm: use ktime APIs for timeout detection
authorAndré Draszik <andre.draszik@linaro.org>
Tue, 25 Mar 2025 09:46:07 +0000 (09:46 +0000)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 7 Apr 2025 06:21:56 +0000 (08:21 +0200)
commitd2098981eb7b7d20edd294a8431908f8a0d2f9c0
treeb496d06855ce6efecd5822a91cdaf3d19782e2e4
parent0af2f6be1b4281385b618cb86ad946eded089ac8
firmware: exynos-acpm: use ktime APIs for timeout detection

acpm_dequeue_by_polling() uses a loop counter and assumes that each
iteration of the loop takes 20us. It may take longer, though, because
usleep_range() may sleep a different amount.

Switch to using ktime_get() / ktime_before() to detect the timeout
condition more reliably.

This change also makes the code easier to follow and it allows us to
adjust the sleep if necessary, without having to adjust the loop
counter exit condition.

Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250325-acpm-atomic-v3-1-c66aae7df925@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/firmware/samsung/exynos-acpm.c