CC: [email protected] TO: Otavio Salvador <[email protected]>
tree: https://github.com/Freescale/linux-fslc pr/78 head: 35b10ca99cd3cb57e545010466bbd588987c96f6 commit: e0830af07163ede89890953f277bb96cc7e8cfa2 [3208/3687] MLK-11051 net: phy: mdio_bus: don't call .phy_suspendi() when netdev is NULL :::::: branch date: 8 months ago :::::: commit date: 8 months ago config: x86_64-randconfig-s022-20210122 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.3-208-g46a52ca4-dirty # https://github.com/Freescale/linux-fslc/commit/e0830af07163ede89890953f277bb96cc7e8cfa2 git remote add freescale-fslc https://github.com/Freescale/linux-fslc git fetch --no-tags freescale-fslc pr/78 git checkout e0830af07163ede89890953f277bb96cc7e8cfa2 # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> "sparse warnings: (new ones prefixed by >>)" >> drivers/net/phy/phy_device.c:279:1: sparse: sparse: unused label 'out' vim +/out +279 drivers/net/phy/phy_device.c f62220d3a9ccb879 Andy Fleming 2008-04-18 232 bc87922ff59d364a Andrew Lunn 2016-01-06 233 #ifdef CONFIG_PM bc87922ff59d364a Andrew Lunn 2016-01-06 234 static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) bc87922ff59d364a Andrew Lunn 2016-01-06 235 { bc87922ff59d364a Andrew Lunn 2016-01-06 236 struct device_driver *drv = phydev->mdio.dev.driver; bc87922ff59d364a Andrew Lunn 2016-01-06 237 struct phy_driver *phydrv = to_phy_driver(drv); bc87922ff59d364a Andrew Lunn 2016-01-06 238 struct net_device *netdev = phydev->attached_dev; bc87922ff59d364a Andrew Lunn 2016-01-06 239 bc87922ff59d364a Andrew Lunn 2016-01-06 240 if (!drv || !phydrv->suspend) bc87922ff59d364a Andrew Lunn 2016-01-06 241 return false; bc87922ff59d364a Andrew Lunn 2016-01-06 242 e0830af07163ede8 Fugang Duan 2019-09-09 243 /* netdev is NULL has three cases: e0830af07163ede8 Fugang Duan 2019-09-09 244 * - phy is not found e0830af07163ede8 Fugang Duan 2019-09-09 245 * - phy is found, match to general phy driver e0830af07163ede8 Fugang Duan 2019-09-09 246 * - phy is found, match to specifical phy driver e0830af07163ede8 Fugang Duan 2019-09-09 247 * e0830af07163ede8 Fugang Duan 2019-09-09 248 * Case 1: phy is not found, cannot communicate by MDIO bus. e0830af07163ede8 Fugang Duan 2019-09-09 249 * Case 2: phy is found: e0830af07163ede8 Fugang Duan 2019-09-09 250 * if phy dev driver probe/bind err, netdev is not __open__ e0830af07163ede8 Fugang Duan 2019-09-09 251 * status, mdio bus is unregistered. e0830af07163ede8 Fugang Duan 2019-09-09 252 * if phy is detached, phy had entered suspended status. e0830af07163ede8 Fugang Duan 2019-09-09 253 * Case 3: phy is found, phy is detached, phy had entered suspended e0830af07163ede8 Fugang Duan 2019-09-09 254 * status. e0830af07163ede8 Fugang Duan 2019-09-09 255 * e0830af07163ede8 Fugang Duan 2019-09-09 256 * So, in here, it shouldn't set phy to suspend by calling mdio bus. bc87922ff59d364a Andrew Lunn 2016-01-06 257 */ bc87922ff59d364a Andrew Lunn 2016-01-06 258 if (!netdev) e0830af07163ede8 Fugang Duan 2019-09-09 259 return false; bc87922ff59d364a Andrew Lunn 2016-01-06 260 93f41e67dc8ff0fd Heiner Kallweit 2018-09-24 261 if (netdev->wol_enabled) 93f41e67dc8ff0fd Heiner Kallweit 2018-09-24 262 return false; 93f41e67dc8ff0fd Heiner Kallweit 2018-09-24 263 93f41e67dc8ff0fd Heiner Kallweit 2018-09-24 264 /* As long as not all affected network drivers support the 93f41e67dc8ff0fd Heiner Kallweit 2018-09-24 265 * wol_enabled flag, let's check for hints that WoL is enabled. 93f41e67dc8ff0fd Heiner Kallweit 2018-09-24 266 * Don't suspend PHY if the attached netdev parent may wake up. bc87922ff59d364a Andrew Lunn 2016-01-06 267 * The parent may point to a PCI device, as in tg3 driver. bc87922ff59d364a Andrew Lunn 2016-01-06 268 */ bc87922ff59d364a Andrew Lunn 2016-01-06 269 if (netdev->dev.parent && device_may_wakeup(netdev->dev.parent)) bc87922ff59d364a Andrew Lunn 2016-01-06 270 return false; bc87922ff59d364a Andrew Lunn 2016-01-06 271 bc87922ff59d364a Andrew Lunn 2016-01-06 272 /* Also don't suspend PHY if the netdev itself may wakeup. This bc87922ff59d364a Andrew Lunn 2016-01-06 273 * is the case for devices w/o underlaying pwr. mgmt. aware bus, bc87922ff59d364a Andrew Lunn 2016-01-06 274 * e.g. SoC devices. bc87922ff59d364a Andrew Lunn 2016-01-06 275 */ bc87922ff59d364a Andrew Lunn 2016-01-06 276 if (device_may_wakeup(&netdev->dev)) bc87922ff59d364a Andrew Lunn 2016-01-06 277 return false; bc87922ff59d364a Andrew Lunn 2016-01-06 278 6b22fba4c15b7312 Florian Fainelli 2020-02-20 @279 out: 6b22fba4c15b7312 Florian Fainelli 2020-02-20 280 return !phydev->suspended; bc87922ff59d364a Andrew Lunn 2016-01-06 281 } bc87922ff59d364a Andrew Lunn 2016-01-06 282 :::::: The code at line 279 was first introduced by commit :::::: 6b22fba4c15b731211dc6ce21b9721a13a5c384e net: phy: Avoid multiple suspends :::::: TO: Florian Fainelli <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
