Skip to content

Commit 21e1944

Browse files
hkallweitdavem330
authored andcommitted
net: phy: fix issue with loading PHY driver w/o initramfs
It was reported that on a system with nfsboot and w/o initramfs network fails because trying to load the PHY driver returns -ENOENT. Reason was that due to missing initramfs the modprobe binary isn't available. So we have to ignore error code -ENOENT. Fixes: 13d0ab6 ("net: phy: check return code when requesting PHY driver module") Reported-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0da2b18 commit 21e1944

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/phy/phy_device.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,12 @@ static int phy_request_driver_module(struct phy_device *dev, int phy_id)
564564

565565
ret = request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT,
566566
MDIO_ID_ARGS(phy_id));
567-
/* we only check for failures in executing the usermode binary,
568-
* not whether a PHY driver module exists for the PHY ID
567+
/* We only check for failures in executing the usermode binary,
568+
* not whether a PHY driver module exists for the PHY ID.
569+
* Accept -ENOENT because this may occur in case no initramfs exists,
570+
* then modprobe isn't available.
569571
*/
570-
if (IS_ENABLED(CONFIG_MODULES) && ret < 0) {
572+
if (IS_ENABLED(CONFIG_MODULES) && ret < 0 && ret != -ENOENT) {
571573
phydev_err(dev, "error %d loading PHY driver module for ID 0x%08x\n",
572574
ret, phy_id);
573575
return ret;

0 commit comments

Comments
 (0)