Message ID | 20230607135941.407054-5-maxime.chevallier@bootlin.com (mailing list archive) |
---|---|
State | Accepted |
Commit | fa19a5d9dcffddae2cb5774df98b09ca3f2ea783 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Followup fixes for the dwmac and altera lynx conversion | expand |
On Wed, Jun 07, 2023 at 03:59:40PM +0200, Maxime Chevallier wrote: > Set the .autoscan flag to false on the regmap-mdio bus, to avoid using a > random uninitialized value. We don't want autoscan in this case as the > mdio device is a PCS and not a PHY. Isn't this now covered by patch 1's memset of mrc?
Hello Russell, On Wed, 7 Jun 2023 13:26:41 +0100 "Russell King (Oracle)" <linux@armlinux.org.uk> wrote: > On Wed, Jun 07, 2023 at 03:59:40PM +0200, Maxime Chevallier wrote: > > Set the .autoscan flag to false on the regmap-mdio bus, to avoid using a > > random uninitialized value. We don't want autoscan in this case as the > > mdio device is a PCS and not a PHY. > > Isn't this now covered by patch 1's memset of mrc? > Yes it is, however I thought it could be fine keeping it set explicitely anyway, as we do have a PCS on that bus and we don't want any autoscan happening. Since these two drivers are the first users of mdio_regmap, my hope is that we could get these reference usages covering all fields. Should I drop this ? Maxime
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 215f9fb89c5b..2e15800e5310 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1288,6 +1288,7 @@ static int altera_tse_probe(struct platform_device *pdev) mrc.regmap = pcs_regmap; mrc.parent = &pdev->dev; mrc.valid_addr = 0x0; + mrc.autoscan = false; /* Rx IRQ */ priv->rx_irq = platform_get_irq_byname(pdev, "rx_irq");
Set the .autoscan flag to false on the regmap-mdio bus, to avoid using a random uninitialized value. We don't want autoscan in this case as the mdio device is a PCS and not a PHY. Fixes: db48abbaa18e ("net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx") Suggested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> --- V3->V4 : No changes V2->V3 : New patch drivers/net/ethernet/altera/altera_tse_main.c | 1 + 1 file changed, 1 insertion(+)