Aw: Re: [PATCH] net: mtk_sgmii: implement mtk_pcs_ops

Frank Wunderlich frank-w at public-files.de
Thu Oct 20 05:02:48 PDT 2022


> Gesendet: Donnerstag, 20. Oktober 2022 um 10:33 Uhr
> Von: "Russell King (Oracle)" <linux at armlinux.org.uk>
> An: "Frank Wunderlich" <frank-w at public-files.de>
> Cc: "Frank Wunderlich" <linux at fw-web.de>, linux-mediatek at lists.infradead.org, "Alexander Couzens" <lynxis at fe80.eu>, "Felix Fietkau" <nbd at nbd.name>, "John Crispin" <john at phrozen.org>, "Sean Wang" <sean.wang at mediatek.com>, "Mark Lee" <Mark-MC.Lee at mediatek.com>, "David S. Miller" <davem at davemloft.net>, "Eric Dumazet" <edumazet at google.com>, "Jakub Kicinski" <kuba at kernel.org>, "Paolo Abeni" <pabeni at redhat.com>, "Matthias Brugger" <matthias.bgg at gmail.com>, netdev at vger.kernel.org, linux-arm-kernel at lists.infradead.org, linux-kernel at vger.kernel.org
> Betreff: Re: [PATCH] net: mtk_sgmii: implement mtk_pcs_ops
>
> On Thu, Oct 20, 2022 at 07:54:49AM +0200, Frank Wunderlich wrote:
> > Am 18. Oktober 2022 18:39:01 MESZ schrieb "Russell King (Oracle)" <linux at armlinux.org.uk>:
> > >Hi,
> > >
> > >A couple of points:
> > >
> > >On Tue, Oct 18, 2022 at 05:35:06PM +0200, Frank Wunderlich wrote:
> >
> > >> +	regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &val);
> > >> +	state->an_complete = !!(val & SGMII_AN_COMPLETE);
> > >> +	state->link = !!(val & SGMII_LINK_STATYS);
> > >> +	state->pause = 0;
> > >
> > >Finally, something approaching a reasonable implementation for this!
> > >Two points however:
> > >1) There's no need to set state->pause if there is no way to get that
> > >   state.
> > >2) There should also be a setting for state->pause.
> >
> > Currently it looks like pause cannot be controlled in sgmii-mode so we disabled it here to not leave it undefined. Should i drop assignment here?
>
> Why do you think it would be undefined?
>
> static void phylink_mac_pcs_get_state(struct phylink *pl,
>                                       struct phylink_link_state *state)
> {
> ...
>         if  (state->an_enabled) {
> ...
>                 state->pause = MLO_PAUSE_NONE;
>         } else {
> ,,,
>                 state->pause = pl->link_config.pause;
> 	}
> ...
>         if (pl->pcs)
>                 pl->pcs->ops->pcs_get_state(pl->pcs, state);
>
> So, phylink will call your pcs_get_state() function having initialised
> it to something sensible.

ok, then i drop the pause setting for now

regards Frank



More information about the linux-arm-kernel mailing list