[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210104184341.szvnl24wnfnxg4k7@skbuf>
Date: Mon, 4 Jan 2021 18:43:42 +0000
From: Ioana Ciornei <ioana.ciornei@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: Geert Uytterhoeven <geert@...ux-m68k.org>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Russell King <linux@...linux.org.uk>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [RFC] net: phy: Fix reboot crash if CONFIG_IP_PNP is not
set
On Mon, Jan 04, 2021 at 06:31:05PM +0100, Andrew Lunn wrote:
> > The basic rules here should be, if the MDIO bus is registered, it is
> > usable. There are things like PHY statistics, HWMON temperature
> > sensors, etc, DSA switches, all which have a life cycle separate to
> > the interface being up.
>
> [Goes and looks at the code]
>
> Yes, this is runtime PM which is broken.
>
> sh_mdio_init() needs to wrap the mdp->mii_bus->read and
> mdp->mii_bus->write calls with calls to
>
> pm_runtime_get_sync(&mdp->pdev->dev);
>
> and
>
> pm_runtime_put_sync(&mdp->pdev->dev);
>
Agree. Thanks for actually looking into it.. I'm not really well versed
in runtime PM.
> The KSZ8041RNLI supports statistics, which ethtool --phy-stats can
> read, and these will also going to cause problems.
>
Not really, this driver connects to the PHY on .ndo_open(), thus any
try to actually dump the PHY statistics before an ifconfig up would get
an -EOPNOTSUPP since the dev->phydev is not yet populated.
This is exactly why I do not understand why some drivers insist on
calling of_phy_connect() and its variants on .ndo_open() and not while
probing the device - you can access the debug stats only if the
interface was started.
Powered by blists - more mailing lists