Re: [PATCH 6/6] w1: sgi: Add timeout to sgi_w1_wait() polling loop

From: Krzysztof Kozlowski

Date: Wed Dec 02 2026 - 05:46:31 EST


On 02/12/2026 10:36, Lee Jones wrote:
> sgi_w1_wait() busy-waits in an unbounded loop until MCR_DONE is set.
> If the hardware fails to assert MCR_DONE due to a fault or missing
> clock, the CPU hangs indefinitely.
>
> Replace the open-coded loop with readl_poll_timeout_atomic() using a
> 10 ms timeout, and return 1 (no device present / bus idle) on timeout.
>
> Fixes: 74ded38a8e18 ("w1: add 1-wire master driver for IP block found in SGI ASICs")
> Closes: https://sashiko.dev/#/bug/linux-e5c06baa-f504-46e1-80df-e43a94a75fa1
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>

Best regards,
Krzysztof