Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5865363ioo; Wed, 1 Jun 2022 14:26:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtF1X+tPFAZZMu+UY337HEoJ+p2TbZm5fxvre2Cf5ufAU4+DuCYeVNeYC0cr8skbFeaV4U X-Received: by 2002:a17:902:d2ce:b0:164:be8:33f9 with SMTP id n14-20020a170902d2ce00b001640be833f9mr1393301plc.8.1654118772980; Wed, 01 Jun 2022 14:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654118772; cv=none; d=google.com; s=arc-20160816; b=cjfEqUMe0yZ0R+dLoiDj4zCZTZ+rEV/GUmGCD1yMzXKZpGglhBI12QbiWukC7yoApa neFiZ8n7S/dQ9xtMP76lJYK4hdqgwnelNud1+FtltLcDFXV/6yspBzDPmB/SjdczCyzn /iv9JB0F/XUahnTTZ3AnJaZ1/07xYFt4cjeRsSQ6kNNOUXTfkbG6GrN7E+4PZNPfvGs/ QmEKXyPZD3T7Cwo09EQgyDyEVxQqBMUpVv7r0wnkNtFnbg9kTN4T6RVSk4HlrTBN7Zne 55vy12RHCOEmbetiA5dQleL8hLbE8514lhnzRaWCzOXA1FFnGhkYMm3c6KiH0DXIUluI zWiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=dQEtI1CAczIBuvDz3GZ7U2zzA60s6PfFxMj/9gjiRQI=; b=ZV4n5Cq6veDxIUK25Y23rCd4UR1P8iFr+9B+7VyKk15EOEdhP7IqUBDgEq7FtcrJG0 XWMNAtNIAGIF+eR2aPT09vRZ8h/bRqK6yPxwellcygjFyR8ZQtkRQSyT9aE2cyZNUoER J2obtgAjb6HgcWD3Fb5J4Cbawn6X6YKkcs3TRCjTUHvaaZ7hO+yuz4KnxpaaTVKNReiA Q10rSbmWQ9HwtbPJFsFRNV+zh5Mvjc/rRG0IO3wIGoWA61xGfsqLXBCwKwwE1qtmLuQL jEfVnxmMWnDEDE6hbA+0AbLZoRLOY9UgI546pL0ZTKajW9u8SRYsKCX/uSN0rrX7k1c1 HRzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dR7RpwH0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i4-20020a170902eb4400b0016178ad9a19si3826735pli.75.2022.06.01.14.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:26:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dR7RpwH0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 507BD23B15B; Wed, 1 Jun 2022 13:16:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350197AbiFAHII (ORCPT + 99 others); Wed, 1 Jun 2022 03:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350112AbiFAHHj (ORCPT ); Wed, 1 Jun 2022 03:07:39 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7C948CB2E for ; Wed, 1 Jun 2022 00:07:26 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2f8398e99dcso8473717b3.9 for ; Wed, 01 Jun 2022 00:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=dQEtI1CAczIBuvDz3GZ7U2zzA60s6PfFxMj/9gjiRQI=; b=dR7RpwH0OGQgdq5IkjUp0wI+kkXSRbNo+z8wKuVYmhF5jBwh9y6txlMuL3p9oOu2kZ wPPBUSqq/aYBuqa517o9bAD77BHGWgYWs4stcLD/c5P5I4GNJdZuDvwIt+YBFb31fdLB 6zUXWtjdhyChYQDoJ2zR1S2tqwWpzQnMhQv0CP3yR6ExhViYXE39N0bMEhjNOlxU33zZ EdAp5EoXLEUNyiLkQ+0mYMQCtOLO1Y/nznitQm8gq3O56AfLSY2rXnJOF6aeB3s/9Rue 1UCDaLkk9f2RRDPnMVqUDjfwwIppZ6DCFLXO7D9pTdLF04gvr1TYoFoAEKDgJaikerxa Zw+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=dQEtI1CAczIBuvDz3GZ7U2zzA60s6PfFxMj/9gjiRQI=; b=TBSK6vJYkAcBRzD32hscZZdNUpgvgqnBGchvGz3K39BZ3mSt9/8hBPSk65QOelx/ej rGouvyzJoiXa1Y+9f9lbg3SmGsWFarrI1tGiI2OTGPlAP3yLZUCCA9GGTLFOyyMe92Ui KXuEC8zs3A6BgHeGkUEhKKBskrRl/pyEXnN+2XSzUa7Hp3HjoCNBorPqhWXGGKhyr65g tA/QDpRM456L2roO+FeM0+ZFFID1pG3jt7tpMrDQrU/LCjiUv9bRpldH3G/zkkeoybE7 tGy6ZocZywwX8tj9zXl6MX1XYF7UEHCYvc/EUFE/lXwSK86q7+lzehnVIU+AtKyhaQkV 0tzw== X-Gm-Message-State: AOAM5312a6950xE3rjcF7nyP5Ct5x7fdY0nE3RrKNlLYWumsk+x6p5Dq g15Z1SJg8O5L6Zh0QYP7gUfGnyVuqJbiRzE= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:f3aa:cafe:c20a:e136]) (user=saravanak job=sendgmr) by 2002:a0d:cc89:0:b0:30b:14ee:6329 with SMTP id o131-20020a0dcc89000000b0030b14ee6329mr25787073ywd.38.1654067246121; Wed, 01 Jun 2022 00:07:26 -0700 (PDT) Date: Wed, 1 Jun 2022 00:07:01 -0700 In-Reply-To: <20220601070707.3946847-1-saravanak@google.com> Message-Id: <20220601070707.3946847-6-saravanak@google.com> Mime-Version: 1.0 References: <20220601070707.3946847-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog Subject: [PATCH v2 5/9] net: ipconfig: Relax fw_devlink if we need to mount a network rootfs From: Saravana Kannan To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Len Brown , Pavel Machek , Joerg Roedel , Will Deacon , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Linus Walleij , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux-foundation.org, netdev@vger.kernel.org, linux-gpio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Saravana Kannan --- net/ipv4/ipconfig.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 9d41d5d5cd1e..2342debd7066 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -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; @@ -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; -- 2.36.1.255.ge46751e96f-goog