Re: Re: [PATCH net-next v2 1/2] mv88e6xxx: Refactor 6352's serdes functions

Andrew Lunn
2026-05-01T22:10:59Z

> I wanted to make those functions generic and not introduce new functions
> other than 6321_serdes_get_lane. However, those functions cannot be
> generalised the obvious way because they run with reg_lock already taken
> which would cause deadlock in mv88e6352_serdes_get_lane function.

Ah, the scratch register. None of the other serdes_get_lane()
functions need to read a register. O.K.

So we don't expect the scratch register to change at runtime do we?

Nope, the value in it is read during reset. After that, it does not
matter what happens to the pin, the value in the scratch register is
fixed. So maybe read it during mv88e6xxx_setup_port() and store the
value in struct mv88e6xxx_port?

Andrew