[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230525110429.66ba241b@pc-7.home>
Date: Thu, 25 May 2023 11:04:29 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: Andrew Lunn <andrew@...n.ch>, Mark Brown <broonie@...nel.org>,
davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, alexis.lothore@...tlin.com,
thomas.petazzoni@...tlin.com, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Ioana Ciornei <ioana.ciornei@....com>,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Jose Abreu <joabreu@...opsys.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>
Subject: Re: [PATCH net-next 1/4] net: mdio: Introduce a regmap-based mdio
driver
Hello Vlad, Andrew,
On Wed, 24 May 2023 20:41:45 +0300
Vladimir Oltean <vladimir.oltean@....com> wrote:
> On Wed, May 24, 2023 at 07:30:51PM +0200, Andrew Lunn wrote:
> > > + mii->name = DRV_NAME;
> > > + strscpy(mii->id, config->name, MII_BUS_ID_SIZE);
> > > + mii->parent = config->parent;
> > > + mii->read = mdio_regmap_read_c22;
> > > + mii->write = mdio_regmap_write_c22;
> >
> > Since there is only one valid address on the bus, you can set
> > mii->phy_mask to make the scanning of the bus a little faster.
Good point, I'll add that.
> Sorry, I didn't reach this thread yet, I don't have the full context.
> Just wanted to add: if the caller knows that there's only a PCS and
> not a PHY on this bus, you don't want auto-scanning at all, since
> that will create an unconnected phy_device. It would be good if the
> caller provided the phy_mask.
As there can only be one mdiodevice on that bus, and we are already
passing the address of the only available device in struct
mdio_rgmap_config.valid_addr, I guess we can simply add a flag to
indicate if autoscan needs to be enabled or not, and set phy_mask to
either unmask the only valid address, or plain ~0UL if we don't want
autoscan at all.
Thanks both of you for the reviews,
Maxime
Powered by blists - more mailing lists