Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1248710lfc; Wed, 1 Jun 2022 13:02:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2Bv5DgMUNl4KpUegq8s+r65nmDqlAsrCnzU4+2jOFl+FWHQAG0fMeYymiS9JWucb3HeZa X-Received: by 2002:a17:902:d14a:b0:164:113:a430 with SMTP id t10-20020a170902d14a00b001640113a430mr1066138plt.13.1654113775569; Wed, 01 Jun 2022 13:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113775; cv=none; d=google.com; s=arc-20160816; b=nU/+RBwhNC55Gg3T99euanPfAYBTj/55vEanXPfCQ0Iiwypn1UX72O9qsMcRpnAqEU 8198fUOT2iefjwELraqSIRSPlDQw1pED5ExH6chbyOj+E1ekC6xmB+5W8/NvA69//tO0 4XdNzIGajaHg/guAHwAEGYNFdx4oySnav1k0H3sbLzhNity+BGhlmEH2MBsxYTe/VBZ6 A/03QDnt/jvYpqsUFti3f1xIYGDmTRCysilt/ff97mTQOwTuxTYjXXokvyCn820q8VwW PyWnkUEB80H77NLbE4VPQvT+bDK0VkKDfXq8rPynz53obVoyP8iKK56eyRV3fG+oA7wR Vqjg== 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:mime-version:message-id:date :dkim-signature; bh=Mk17D+aOzb7UCdNS2oz9IAwDr5MmRg+quCipw6fx4RQ=; b=oYthdUuZHgKRn0Ud8/EpeGAjCHbVwIUDpBPpjGdeDJOXmb6a3MzZc3EhIc08iPfAc0 uUklQxaBa/mxgqkQ6vHdVndxVRXhrC10DwVfpFtnyJkAfXLUmPvYKBVyaOXdj/Vt2uxb jV8sqOkDcwet+EFUR5gnaNMq9YQxgVeTQ4K7uo0PqBU9V02c5L4OnaZSL+QiIU+iLd1C T9WbPKdxUBqbruxHbQU7KVHDJ+rJYdq3cwmWxJxulkySUouF/BBek7DT7s/T6qvI7XaH JMUNkwHECuHXTh9EksqBGmJmsRxTN4oesaJKbxnhTeelxE94tL7tVARZQtTnR3Dmxb/9 iXzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hQa0Jnnm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c19-20020a170902849300b0015e84c97a93si3350602plo.111.2022.06.01.13.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:02:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hQa0Jnnm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 241E721E302; Wed, 1 Jun 2022 12:20:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344414AbiFAHI7 (ORCPT + 99 others); Wed, 1 Jun 2022 03:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344462AbiFAHHP (ORCPT ); Wed, 1 Jun 2022 03:07:15 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72FCE6FD36 for ; Wed, 1 Jun 2022 00:07:12 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d11-20020a170902cecb00b00163fe890197so679212plg.1 for ; Wed, 01 Jun 2022 00:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=Mk17D+aOzb7UCdNS2oz9IAwDr5MmRg+quCipw6fx4RQ=; b=hQa0JnnmV2cX05wxogayF7DAeIwm91UA5DD4Pd0261qK2nG5mlRfb8p0PwXRgLwmcG 6gimTBEfRJnzqCBPwGFDLXwY23Jge7qCK5EKBtDVk+4ZHueBZe2ScEh2abiJOXvqClXF aItT2KKmdUihJqxg6KlMJQ+n9hDQfaXwUgpDUXId5vW641rUWKofWrnrujEe72Sytvnk iXsC3g9D+PkO64XwFNhsJCy/xgMMwq44IzwR510vfqTBnn54+HA0yDiVcTK99umRrrcq KawtwQ3E7vKCwmO2izMB9zQh9evWd8zx74HbqExwInwGL34iXnuFQ1QqmbkBW7qSDv5A GPbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Mk17D+aOzb7UCdNS2oz9IAwDr5MmRg+quCipw6fx4RQ=; b=C0ZhekrfwOCUzSzy80dNoNfZlVwQvksrWaZ5v7sTV+Zf7xyAwXJz1JkASzfrTYm7mE 5YW2lL4X+fmGyqWO4+0+4orrtFtB/TPks3Mc+4ajFdzfF+pufE96TNA7JOgfxqKAtA4y 0av00PSgf+hq3dAdLiKSM3/j1VHBvlJCubv8rIFoNoVb/NcWvo0y3n9S7oiS6CKT9rxd hGtHgKB+eAuT8mbhUD6Y03DBOJAEfTCB65UKnP3LsTbNuxQXSaOlBCN6xucydNAmoSj2 gCAtitdX4vZYxgw6a1MrdY3LhoqewHGTCUkIXQcpXCLCD3XRBBCqe2vraWqi63JHPC6b 8YnA== X-Gm-Message-State: AOAM533Z8JnX+25SYDkoHeexoecj/rvy5p6Ll5sOi2/7/r19/5mnPJaz fSIq7EEUN0bf5AVAnVlouvobm6H66tns5KE= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:f3aa:cafe:c20a:e136]) (user=saravanak job=sendgmr) by 2002:a17:902:da8e:b0:164:537:d910 with SMTP id j14-20020a170902da8e00b001640537d910mr7067516plx.75.1654067231712; Wed, 01 Jun 2022 00:07:11 -0700 (PDT) Date: Wed, 1 Jun 2022 00:06:56 -0700 Message-Id: <20220601070707.3946847-1-saravanak@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog Subject: [PATCH v2 0/9] deferred_probe_timeout logic clean up 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 This series is based on linux-next + these 2 small patches applies on top: https://lore.kernel.org/lkml/20220526034609.480766-1-saravanak@google.com/ A lot of the deferred_probe_timeout logic is redundant with fw_devlink=on. Also, enabling deferred_probe_timeout by default breaks a few cases. This series tries to delete the redundant logic, simplify the frameworks that use driver_deferred_probe_check_state(), enable deferred_probe_timeout=10 by default, and fixes the nfsroot failure case. The overall idea of this series is to replace the global behavior of driver_deferred_probe_check_state() where all devices give up waiting on supplier at the same time with a more granular behavior: 1. Devices with all their suppliers successfully probed by late_initcall probe as usual and avoid unnecessary deferred probe attempts. 2. At or after late_initcall, in cases where boot would break because of fw_devlink=on being strict about the ordering, we a. Temporarily relax the enforcement to probe any unprobed devices that can probe successfully in the current state of the system. For example, when we boot with a NFS rootfs and no network device has probed. b. Go back to enforcing the ordering for any devices that haven't probed. 3. After deferred probe timeout expires, we permanently give up waiting on supplier devices without drivers. At this point, whatever devices can probe without some of their optional suppliers end up probing. In the case where module support is disabled, it's fairly straightforward and all device probes are completed before the initcalls are done. Patches 1 to 3 are fairly straightforward and can probably be applied right away. Patches 4 to 6 are for fixing the NFS rootfs issue and setting the default deferred_probe_timeout back to 10 seconds when modules are enabled. Patches 7 to 9 are further clean up of the deferred_probe_timeout logic so that no framework has to know/care about deferred_probe_timeout. Yoshihiro/Geert, If you can test this patch series and confirm that the NFS root case works, I'd really appreciate that. Thanks, Saravana v1 -> v2: Rewrote the NFS rootfs fix to be a lot less destructive on the fw_devlink ordering for devices that don't end up probing during the "best effort" attempt at probing all devices needed for a network rootfs Saravana Kannan (9): PM: domains: Delete usage of driver_deferred_probe_check_state() pinctrl: devicetree: Delete usage of driver_deferred_probe_check_state() net: mdio: Delete usage of driver_deferred_probe_check_state() driver core: Add wait_for_init_devices_probe helper function net: ipconfig: Relax fw_devlink if we need to mount a network rootfs Revert "driver core: Set default deferred_probe_timeout back to 0." driver core: Set fw_devlink.strict=1 by default iommu/of: Delete usage of driver_deferred_probe_check_state() driver core: Delete driver_deferred_probe_check_state() drivers/base/base.h | 1 + drivers/base/core.c | 102 ++++++++++++++++++++++++++++++--- drivers/base/dd.c | 54 ++++++----------- drivers/base/power/domain.c | 2 +- drivers/iommu/of_iommu.c | 2 +- drivers/net/mdio/fwnode_mdio.c | 4 +- drivers/pinctrl/devicetree.c | 2 +- include/linux/device/driver.h | 2 +- net/ipv4/ipconfig.c | 6 ++ 9 files changed, 126 insertions(+), 49 deletions(-) -- 2.36.1.255.ge46751e96f-goog