RE: [PATCH net-next v3 07/13] net: ethernet: oa_tc6: Add read_mms/write_mms register access functions

From: Regus, Ciprian

Date: Tue Jun 09 2026 - 08:19:49 EST


> > +/**
> > + * oa_tc6_read_register_mms - function for reading a MAC-PHY register
> in a
> > + * memory map other than 0.
>
> Is MMS 0 somehow special? Does it not work if passed to this function?

For addressing registers in MMS 0, we can just use the already existing oa_tc6_read_register
and oa_tc6_write_register functions. So, I meant to say that for transfers to memory maps
other than 0, this function can be used instead. Passing 0 in the mms parameter would
result in the same behavior as if the user called oa_tc6_read_register() with the upper 16 bits
of the addr masked (so there is nothing special about this case).

I agree the documentation is poorly worded and I'll change it to something like this in v4:

/**
* oa_tc6_read_register_mms - function for reading a MAC-PHY register in a specified
* memory map.

>
> I'm not suggesting all the current calls are replaced with this, just
> that the documentation might be inaccurate?
>
> > + * @tc6: oa_tc6 struct.
> > + * @mms: Memory map selector for the register.
> > + * @address: register address of the MAC-PHY to be read.
> > + * @value: value read from the @address register address of the MAC-
> PHY.
> > + *
> > + * Return: 0 on success otherwise failed.
>
> Isn't the "otherwise" actually an error code?

This function can return the same set of error codes as oa_tc6_read_register/ oa_tc6_write_register.
Those can be -EPROTO, -EINVAL or any error code returned by the spi_sync(). Since the other register
access functions have the same documentation for the return values, I kept it the same here.
I'll change it to "0 on success or a negative error code on failure".

>
> Andrew