Re: [PATCH net-next v3] net: dsa: realtek: rtl8365mb: wait out the full chip reset time
From: Linus Walleij
Date: Wed Sep 09 2026 - 08:45:20 EST
On Wed, Sep 9, 2026 at 2:08 PM Stanislaw Pal <kuncy7@xxxxxxxxx> wrote:
> Realtek documentation gives the chip 1 second to reset, and the driver
> says so in a comment, but it only sleeps 100 ms and then polls the reset
> bit and continues as soon as that bit clears. The bit reports that the
> register block is back, not that the chip has finished its internal
> bring-up: Luiz notes that older parts such as the RTL8367R need
> noticeable extra time after it clears, so a driver that keys off the bit
> alone is relying on that margin being zero.
>
> Sleep out the documented second before touching anything, then read the
> bit once and fail with -ETIMEDOUT if the chip has not come out of reset.
>
> Probe therefore takes 1 s on every chip the driver supports, not only on
> the part this was found on.
>
> Signed-off-by: Stanislaw Pal <kuncy7@xxxxxxxxx>
(...)
> I have deliberately not carried Linus's Reviewed-by from v2, since this
> revision replaces the implementation he reviewed.
OK this works too, I was too quick in endorsing the hairy microoptimization.
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
Yours,
Linus Walleij