Re: [PATCH net-next v3 2/6] net: phy: microchip_t1s: replace read-modify-write code with phy_modify_mmd

From: Ramón Nordin Rodriguez
Date: Fri May 26 2023 - 03:10:24 EST


On Fri, May 26, 2023 at 05:48:25AM +0000, Parthiban.Veerasooran@xxxxxxxxxxxxx wrote:
> Hi Ramon,
> > Nitpick, I think this block comment can be reduced to:
> > /* The following block deviates from AN1699 which states that a values
> > * should be written back, even if unmodified.
> > * Which is not necessary, so it's safe to use phy_modify_mmd here.*/
> >
> > The comment I added was intended to describe why I was doing weird
> > things, but now I think it's more interesting to describe why we're
> > deviating from the AN.
> >
> > Or the block comment could be dropped all togheter, I'm guessing no one
> > is going to consult the AN if things 'just work'
> >
> By consolidating all your comments in the other emails as well on this
> 2nd patch, do you agree for my below proposal?
>
> We will remove all block comments and simply put AN1699 reference as we
> did for lan865x_revb0_config_init with a small addition on top of
> phy_modify_mmd for loop? so the comment will look like below,
>
> /* Reference to AN1699
> *
> https://ww1.microchip.com/downloads/aemDocuments/documents/AIS/ProductDocuments/SupportingCollateral/AN-LAN8670-1-2-config-60001699.pdf
> * AN1699 says Read, Modify, Write, but the Write is not required if
> the register already has the required value. So it is safe to use
> phy_modify_mmd here.
> */
>
> So in future, if someone wants to know about this configuration they can
> simply refer the AN1699.
>
> What do you think?
>

I'm not sure about the link, resources have a tendency to move.
Otherwise LGTM

> Best Regards,
> Parthiban V