Subject: Re: [PATCH net-next v4 4/7] net: dsa: microchip: Use different registers for KSZ8463

From: Simon Horman <[email-masked]>
Date: Fri, 25 Jul 2025 08:29:56 +0100

On Fri, Jul 25, 2025 at 12:17:26AM +0000, [email-masked] wrote:
> > On Thu, Jul 24, 2025 at 02:28:56AM +0000, [email-masked] wrote:
> > > > On Wed, Jul 23, 2025 at 02:25:27AM +0000, [email-masked] wrote:
> > > > > > On Sun, Jul 20, 2025 at 11:17:03AM +0100, Simon Horman wrote:
> > > > > > > On Fri, Jul 18, 2025 at 06:21:03PM -0700, [email-masked]
> > wrote:

...

> > I feel that we are talking past each other.
> > Let's try to find a common understanding.
> 
> It is really about the register definition of this specific register.
> In KSZ8863 when presenting in 16-bit the value is 0x07ff, but in KSZ8463
> it is 0xff07.  It is the fault of the hardware to define such value.

If the behaviour of this register is different to others, then I guess a
special case is a reasonable approach. Although I would have thought there
is a better way.

I would suggest adding a comment to the code explaining that this is a
special case. And I would suggest revisiting this if more special cases are
needed.

> Note that in the new patch KSZ8463 SPI driver implements its own access
> functions, so native mode is used instead and there is no automatic
> swapping depending on the big-endian or little-endian format.  Still this
> code is needed to program the register correctly.

Thanks for taking time to respond to my questions.
I think we should let the matter rest here.