Re: [PATCH v2] net: stmmac: Wait a bit for the reset to take effect

From: Paolo Abeni
Date: Tue Jan 16 2024 - 07:22:48 EST


On Mon, 2024-01-15 at 20:21 +0100, Bernd Edlinger wrote:
> otherwise the synopsys_id value may be read out wrong,
> because the GMAC_VERSION register might still be in reset
> state, for at least 1 us after the reset is de-asserted.
>
> Add a wait for 10 us before continuing to be on the safe side.
>
> > From what have you got that delay value?
>
> Just try and error, with very old linux versions and old gcc versions
> the synopsys_id was read out correctly most of the time (but not always),
> with recent linux versions and recnet gcc versions it was read out
> wrongly most of the time, but again not always.
> I don't have access to the VHDL code in question, so I cannot
> tell why it takes so long to get the correct values, I also do not
> have more than a few hardware samples, so I cannot tell how long
> this timeout must be in worst case.
> Experimentally I can tell that the register is read several times
> as zero immediately after the reset is de-asserted, also adding several
> no-ops is not enough, adding a printk is enough, also udelay(1) seems to
> be enough but I tried that not very often, and I have not access to many
> hardware samples to be 100% sure about the necessary delay.
> And since the udelay here is only executed once per device instance,
> it seems acceptable to delay the boot for 10 us.
>
> BTW: my hardware's synopsys id is 0x37.
>
> Signed-off-by: Bernd Edlinger <bernd.edlinger@xxxxxxxxxx>
>
> Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>

Please have a better look at the process documentation.

No empty lines are allowed in the tag area.

A fixes tag is requires, something alike:

Fixes: <blamed commit hash> ("<blamed commit title>")

A bisection is not strictly required, you just need to be reasonably
confident about the the culprit.

You need to include the relevant target tree into the subj prefix (in
this case 'net').

Please include in the recipients list the persons that provided
feedback on previous release (Serge is missing).

I'm unsure why/how Andrew landed in the recipients list!?!

Cheers,

Paolo