[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZIiRX5+sdYUkBVxu@corigine.com>
Date: Tue, 13 Jun 2023 17:55:11 +0200
From: Simon Horman <simon.horman@...igine.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
Alexander Couzens <lynxis@...0.eu>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Cc@....codeaurora.org:
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Daniel Golle <daniel@...rotopia.org>,
Daniel Machon <daniel.machon@...rochip.com>,
"David S. Miller" <davem@...emloft.net>,
DENG Qingfang <dqfext@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>,
Ioana Ciornei <ioana.ciornei@....com>,
Jakub Kicinski <kuba@...nel.org>,
Jose Abreu <Jose.Abreu@...opsys.com>,
Landen Chao <Landen.Chao@...iatek.com>,
Lars Povlsen <lars.povlsen@...rochip.com>,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Madalin Bucur <madalin.bucur@....com>,
Marcin Wojtas <mw@...ihalf.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Michal Simek <michal.simek@....com>, netdev@...r.kernel.org,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Paolo Abeni <pabeni@...hat.com>,
Radhey Shyam Pandey <radhey.shyam.pandey@...inx.com>,
Sean Anderson <sean.anderson@...o.com>,
Sean Wang <sean.wang@...iatek.com>,
Steen Hegelund <Steen.Hegelund@...rochip.com>,
Taras Chornyi <taras.chornyi@...ision.eu>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
UNGLinuxDriver@...rochip.com, Vladimir Oltean <olteanv@...il.com>
Subject: Re: [PATCH RFC net-next 01/15] net: phylink: add PCS negotiation mode
On Tue, Jun 13, 2023 at 03:37:32PM +0100, Russell King (Oracle) wrote:
...
> @@ -1149,12 +1159,20 @@ static int phylink_change_inband_advert(struct phylink *pl)
Hi Russell,
A bit further above in this function is the following condition:
if (!pl->pcs && pl->config->legacy_pre_march2020) {
...
return 0;
}
So it is anticipated that pl->pcs may be NULL,
but the function will continue unless
pl->config->legacy_pre_march2020 is true.
> __ETHTOOL_LINK_MODE_MASK_NBITS, pl->link_config.advertising,
> pl->link_config.pause);
>
> + /* Recompute the PCS neg mode */
> + pl->pcs_neg_mode = phylink_pcs_neg_mode(pl->cur_link_an_mode,
> + pl->link_config.interface,
> + pl->link_config.advertising);
nit: this indentation is incorrect.
> +
> + neg_mode = pl->cur_link_an_mode;
> + if (pl->pcs->neg_mode)
But Smatch flags that here pl->pcs is dereferenced unconditionally.
> + neg_mode = pl->pcs_neg_mode;
> +
> /* Modern PCS-based method; update the advert at the PCS, and
> * restart negotiation if the pcs_config() helper indicates that
> * the programmed advertisement has changed.
> */
> - ret = phylink_pcs_config(pl->pcs, pl->cur_link_an_mode,
> - &pl->link_config,
> + ret = phylink_pcs_config(pl->pcs, neg_mode, &pl->link_config,
> !!(pl->link_config.pause & MLO_PAUSE_AN));
> if (ret < 0)
> return ret;
Powered by blists - more mailing lists