[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1EHy0t5nXOF/3Mw@shell.armlinux.org.uk>
Date: Thu, 20 Oct 2022 09:33:15 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Frank Wunderlich <frank-w@...lic-files.de>
Cc: Frank Wunderlich <linux@...web.de>,
linux-mediatek@...ts.infradead.org,
Alexander Couzens <lynxis@...0.eu>,
Felix Fietkau <nbd@....name>, John Crispin <john@...ozen.org>,
Sean Wang <sean.wang@...iatek.com>,
Mark Lee <Mark-MC.Lee@...iatek.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: 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@...linux.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.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists