[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7b3sU0w2daShkBH@shell.armlinux.org.uk>
Date: Thu, 20 Feb 2025 09:36:49 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Dimitri Fedrau <dima.fedrau@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Niklas Söderlund <niklas.soderlund+renesas@...natech.se>,
Gregor Herburger <gregor.herburger@...tq-group.com>,
Stefan Eichenberger <eichest@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: phy: marvell-88q2xxx: Prevent hwmon
access with asserted reset
On Thu, Feb 20, 2025 at 09:11:12AM +0100, Dimitri Fedrau wrote:
> If the PHYs reset is asserted it returns 0xffff for any read operation.
> This might happen if the user admins down the interface and wants to read
> the temperature. Prevent reading the temperature in this case and return
> with an network is down error. Write operations are ignored by the device
> when reset is asserted, still return a network is down error in this
> case to make the user aware of the operation gone wrong.
If we look at where mdio_device_reset() is called from:
1. mdio_device_register() -> mdiobus_register_device() asserts reset
before adding the device to the device layer (which will then
cause the driver to be searched for and bound.)
2. mdio_probe(), deasserts the reset signal before calling the MDIO
driver's ->probe method, which will be phy_probe().
3. after a probe failure to re-assert the reset signal.
4. after ->remove has been called.
That is the sum total. So, while the driver is bound to the device,
phydev->mdio.reset_state is guaranteed to be zero.
Therefore, is this patch fixing a real observed problem with the
current driver?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists