Skip to content

Commit

Permalink
net: ipconfig: Relax fw_devlink if we need to mount a network rootfs
Browse files Browse the repository at this point in the history
If there are network devices that could probe without some of their
suppliers probing and those network devices are needed to mount a
network rootfs, then fw_devlink=on might break that usecase by blocking
the network devices from probing by the time IP auto config starts.

So, if no network devices are available when IP auto config is enabled
and we have a network rootfs, make sure fw_devlink doesn't block the
probing of any device that has a driver and then retry finding a network
device.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20220601070707.3946847-6-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Saravana Kannan authored and Greg Kroah-Hartman committed Jun 10, 2022
1 parent 2f8c3ae commit dd42903
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/ipv4/ipconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,7 @@ __be32 __init root_nfs_parse_addr(char *name)
static int __init wait_for_devices(void)
{
int i;
bool try_init_devs = true;

for (i = 0; i < DEVICE_WAIT_MAX; i++) {
struct net_device *dev;
Expand All @@ -1452,6 +1453,11 @@ static int __init wait_for_devices(void)
rtnl_unlock();
if (found)
return 0;
if (try_init_devs &&
(ROOT_DEV == Root_NFS || ROOT_DEV == Root_CIFS)) {
try_init_devs = false;
wait_for_init_devices_probe();
}
ssleep(1);
}
return -ENODEV;
Expand Down

0 comments on commit dd42903

Please sign in to comment.