[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79a9c7c2-9bd0-d5d1-6d5a-d505cdc564be@gmail.com>
Date: Sun, 16 Jan 2022 20:15:16 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Luiz Angelo Daros de Luca <luizluca@...il.com>,
netdev@...r.kernel.org
Cc: linus.walleij@...aro.org, andrew@...n.ch, vivien.didelot@...il.com,
olteanv@...il.com, alsi@...g-olufsen.dk, arinc.unal@...nc9.com,
frank-w@...lic-files.de
Subject: Re: [PATCH net-next v4 05/11] net: dsa: realtek: use phy_read in
ds->ops
On 1/4/2022 7:15 PM, Luiz Angelo Daros de Luca wrote:
> The ds->ops->phy_read will only be used if the ds->slave_mii_bus
> was not initialized. Calling realtek_smi_setup_mdio will create a
> ds->slave_mii_bus, making ds->ops->phy_read dormant.
>
> Using ds->ops->phy_read will allow switches connected through non-SMI
> interfaces (like mdio) to let ds allocate slave_mii_bus and reuse the
> same code.
>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@...il.com>
> Tested-by: Arınç ÜNAL <arinc.unal@...nc9.com>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Humm assigning dsa_switch_ops::phy_read will force DSA into tearing down
the MDIO bus in dsa_switch_teardown() instead of letting your driver do
it and since realtek-smi-core.c uses devm_mdiobus_unregister(), it is
not clear to me what is going to happen but it sounds like a double free
might happen?
It seems more prudent to me to leave existing code.
--
Florian
Powered by blists - more mailing lists