From patchwork Thu May 26 08:15:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B1F9C433F5 for ; Thu, 26 May 2022 08:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346654AbiEZIQK (ORCPT ); Thu, 26 May 2022 04:16:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244409AbiEZIP6 (ORCPT ); Thu, 26 May 2022 04:15:58 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78DC4AE250 for ; Thu, 26 May 2022 01:15:57 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id i19-20020aa79093000000b0050d44b83506so715776pfa.22 for ; Thu, 26 May 2022 01:15:57 -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=1IM3Fvbt8ArJUmTPEiiyr+pPYoVHFzyhPnAJGlSaBT4=; b=hAnSk3S9Qg0dtqCUypketAd2iTMRbAyagepCTA0NOJrVOCYo/te3z7FpVSX+BIFv7w HFcBaSe8ey43rsPOJ4EjkpljhrSmzZ1XVfIWV1DDuCsC0XNnyEb5qUDG+IdRWB1l+ul8 1+Z/Ua4o1ESvV/9Kg1g2lrH9ViDRc2EvuOCNnW0G2m+ijHjBO1KC5Ck9UQlUnR4EKgjD We+nltaFfzSRtA+CLFGxgY+57TX8DeoDR4srqJYZz+sXUodRK7yMpUhoEFX98DiW0heG FyUxGgvp4/hgqLihCcZx8cKb4bTu089o4kruA0ivqPzW49fGKGvzAR3Epx0sWNWjAIVq 1iDg== 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=1IM3Fvbt8ArJUmTPEiiyr+pPYoVHFzyhPnAJGlSaBT4=; b=G0lEM/BNgwyv7LKIzrVHpswnsh+PnAr2qWeDrcB2YGmRUVgiesOzox2cnmAgwaw+cO 7bDkZIfsTpfC30pbhTTgtt3fZ4g2k93LEhF1wM5r0eNDdqblLF7wOv/4JzwhDaWtWcA/ bEeXsLGMhibTplXg4ZKOpqHnzFNBm5QfBBIxFyDnnSjBlSQBaH2g95yYv3kTCLLkvnpz nrcgx8XO9wp+atmBpZJOAtPGlwb2/FyWBeamiWmAkY14rxu4EpChM9C+OWSIYQDQiNuQ IKbTSFF4/3kFuvnb4C2KzxKHXrE80z5vf3xF2IqOJFUR4LichVZIgi5AQ1M1ANkkauxz m/wA== X-Gm-Message-State: AOAM533kSh87Kl6UCK7ZE6CUuOJ0fnYrewMDEIqMTSYqq1+3pbav9hSP 4c6cCo7KbbLLdZVMLNDAeLZUo/Ny4NCNGYM= X-Google-Smtp-Source: ABdhPJymfPGXL/xfcU37VydiB6tPwHU4G2U1fbHUW+y/HyW7OlytTUy4MZTLFHGyXEorOunFh2vZDJQB7oQgrz0= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a17:902:ecd1:b0:163:6120:563c with SMTP id a17-20020a170902ecd100b001636120563cmr5819104plh.90.1653552956872; Thu, 26 May 2022 01:15:56 -0700 (PDT) Date: Thu, 26 May 2022 01:15:40 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-2-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 1/9] PM: domains: Delete usage of driver_deferred_probe_check_state() 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now that fw_devlink=on by default and fw_devlink supports "power-domains" property, the execution will never get to the point where driver_deferred_probe_check_state() is called before the supplier has probed successfully or before deferred probe timeout has expired. So, delete the call and replace it with -ENODEV. Signed-off-by: Saravana Kannan --- drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 739e52cd4aba..3e86772d5fac 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2730,7 +2730,7 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev, mutex_unlock(&gpd_list_lock); dev_dbg(dev, "%s() failed to find PM domain: %ld\n", __func__, PTR_ERR(pd)); - return driver_deferred_probe_check_state(base_dev); + return -ENODEV; } dev_dbg(dev, "adding to PM domain %s\n", pd->name); From patchwork Thu May 26 08:15:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6A2FC433FE for ; Thu, 26 May 2022 08:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346676AbiEZIQL (ORCPT ); Thu, 26 May 2022 04:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346643AbiEZIQJ (ORCPT ); Thu, 26 May 2022 04:16:09 -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 8CAC4B82CA for ; Thu, 26 May 2022 01:16:00 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2f8398e99dcso7515437b3.9 for ; Thu, 26 May 2022 01:16:00 -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=dlvkAQYsuGB8Wv9lxWmQ5ia/pAj0723lrMJL/F7FmGY=; b=PY2a/ZfTWLOTKMXKyETU+koM0WgQW4QxqX3sYrgc5F8Fync7J+e5f3GBKiPIqpwgPZ SkDAVoB1jl7cjlSJwUihxgqBvVZnvCxi9I4QUaG5WqMu1pOMKtmDRTxpQFAeblPdDleX mxDvzcfuqk3TE1tsWfuNrUDu6y3Z2uQsLnSOUjywddi7iE0G0uqUtlpP3c2Gm0KnZoNS dnyI/ZOgNUHpkp0mB2EIPEiSrxIsj2RY5G5poVzBbXn9Rg97rrWC6Adibg/wQrj3n2xT kI+LY0Yk8J7Hl0wWscTOZw/YR4+r0mDtAk/VmmToHBZWaKhAHd+W02rgl8RuAea8avYR u8FQ== 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=dlvkAQYsuGB8Wv9lxWmQ5ia/pAj0723lrMJL/F7FmGY=; b=LxOf4ii8tglVfA9mQNr8R35OfrZI1qZqIRoi7JR/n3b7J9cijiqUQXD4+fDEfrXLCV kTn1yI18TIup9+9rJAmvV8eRbo96LXA/L78mRFwuq6zCifLU6mafwKzIp9n8RnciRPno RrgQ7FLo2ZDtJXzc3/n8yJNOmHN0vy4bBfGT5YZpSPycGC6dFxGblnt6O/pBFrzx3VVN 9M8owC5tZO1j83LLTDmX/jyBKaSXwrw1esUkvqEzMTk9vpRQJt4rkQBf0UJ0gbd08qCZ MMJUh3ZCd0lb7oX1lgP+iWAVFoa8ODgMZLBKg1WEgVMQFKgyDQfRSYfPCZyh4IFKr8ED zWKg== X-Gm-Message-State: AOAM533qTg5EkcqOLvxFHYwQvAizOyzzg+fySCyeblGEyCZ8Srk2FVjg ZRR2WcfX1mDCgCwnJcNeLKKqqvdcAcMFFVY= X-Google-Smtp-Source: ABdhPJxNRFl0/Al5aF4+hw2juEzzxnRNoJ08VAGxc9iz3rkpIotBWNb9jqq9kR5GKz6VAnObadTZe+xq9PgYyao= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a81:4757:0:b0:2ff:d34d:4d59 with SMTP id u84-20020a814757000000b002ffd34d4d59mr20437021ywa.511.1653552959732; Thu, 26 May 2022 01:15:59 -0700 (PDT) Date: Thu, 26 May 2022 01:15:41 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-3-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 2/9] pinctrl: devicetree: Delete usage of driver_deferred_probe_check_state() 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now that fw_devlink=on by default and fw_devlink supports "pinctrl-[0-8]" property, the execution will never get to the point where driver_deferred_probe_check_state() is called before the supplier has probed successfully or before deferred probe timeout has expired. So, delete the call and replace it with -ENODEV. Signed-off-by: Saravana Kannan --- drivers/pinctrl/devicetree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index 3fb238714718..ef898ee8ca6b 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -129,7 +129,7 @@ static int dt_to_map_one_config(struct pinctrl *p, np_pctldev = of_get_next_parent(np_pctldev); if (!np_pctldev || of_node_is_root(np_pctldev)) { of_node_put(np_pctldev); - ret = driver_deferred_probe_check_state(p->dev); + ret = -ENODEV; /* keep deferring if modules are enabled */ if (IS_ENABLED(CONFIG_MODULES) && !allow_default && ret < 0) ret = -EPROBE_DEFER; From patchwork Thu May 26 08:15:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576254 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C52CC433FE for ; Thu, 26 May 2022 08:16:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346644AbiEZIQU (ORCPT ); Thu, 26 May 2022 04:16:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346645AbiEZIQJ (ORCPT ); Thu, 26 May 2022 04:16:09 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23A19BA54B for ; Thu, 26 May 2022 01:16:03 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id i9-20020a632209000000b003facc62e253so544353pgi.11 for ; Thu, 26 May 2022 01:16:03 -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=DUCLIv3fIFZkN4IwkAbrdxyKeVczdAPuMH/CpPcV4SU=; b=CyzwtSa5kL7asxlJAQxy6KynJEIdFhvGau0g94npATBUb08mCN7xWPYiqWSpgyW7pp AeKTLb8s+1yIbjcvPRGqkRXa/d5TFin/hQLWeMaJAETlo6oYW5f14ntDOqjhIvmFKH7Y to71h+gy1/+mvnPHDbGWIsuAvvkUo1tnVwOwiNBYAz/Th1IFA4cu6ZOpIDrj4HrVUFgZ 8TxgahJGhhjYVYLYmfpUFt435KgFpIWHwyX3O6yL6OwYx2jNmvoxtX57zkKnPlBhHjOv 6ap3F7Gzmj4ck2T+A1f3T4XMo/l1Sr7ClNm8Ko3J8AHf9Vnb1FGRV7j+BHxzraC/ZahT 26MA== 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=DUCLIv3fIFZkN4IwkAbrdxyKeVczdAPuMH/CpPcV4SU=; b=YoA7S9R5NRtLu/doF1KpmFPHqfjzhtHRyweiM3DZypDC9EQQXuvWz8OJmsiZR0GtH7 I17mh4E85qulVuemOU2+OfL/T8L0yh+hiIwSBaVXUNGNS/nZ5MOZwKI+NLEl9rraD6Z/ YNihCFLdVI6yO4SOKWABXpgy/Q78VsO4qAI4mnnn9niMTEicFQsVWk4l6migOEbzCMNu OvumTOj3BtqiAcSnqiJlHHP3kSVWhlpLVIspH0cuuAkPYtyY0onQgubgSleySZtMFxg7 3/rA9UGcM1DLc6qTNniYWX08TQ7qFjHD/wvPSb51BxY74IEHk2cGB3BnExTEH68SHigh YUbw== X-Gm-Message-State: AOAM5312pc6XVWLwQLH8vlqT1l3sJMc5oIojG2xEMVzQDZIKdtsOqLsa +/HJV/onSI5ngkEkrrVITgrI0aoigslsG/s= X-Google-Smtp-Source: ABdhPJw2pOLycSo0Dk2hnHYGrYjnmnj9FmTbJXx5Eil6VtjWJt3Y4OCof/7QvyjmXMAMae1GQK5aRzIjQ2vExSg= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a63:343:0:b0:3f6:52e5:edbe with SMTP id 64-20020a630343000000b003f652e5edbemr29501334pgd.272.1653552962496; Thu, 26 May 2022 01:16:02 -0700 (PDT) Date: Thu, 26 May 2022 01:15:42 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-4-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 3/9] net: mdio: Delete usage of driver_deferred_probe_check_state() 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now that fw_devlink=on by default and fw_devlink supports interrupt properties, the execution will never get to the point where driver_deferred_probe_check_state() is called before the supplier has probed successfully or before deferred probe timeout has expired. So, delete the call and replace it with -ENODEV. Signed-off-by: Saravana Kannan --- drivers/net/mdio/fwnode_mdio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/mdio/fwnode_mdio.c b/drivers/net/mdio/fwnode_mdio.c index 1c1584fca632..3e79c2c51929 100644 --- a/drivers/net/mdio/fwnode_mdio.c +++ b/drivers/net/mdio/fwnode_mdio.c @@ -47,9 +47,7 @@ int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio, * just fall back to poll mode */ if (rc == -EPROBE_DEFER) - rc = driver_deferred_probe_check_state(&phy->mdio.dev); - if (rc == -EPROBE_DEFER) - return rc; + rc = -ENODEV; if (rc > 0) { phy->irq = rc; From patchwork Thu May 26 08:15:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1CDFC43217 for ; Thu, 26 May 2022 08:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235701AbiEZIQM (ORCPT ); Thu, 26 May 2022 04:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346656AbiEZIQK (ORCPT ); Thu, 26 May 2022 04:16:10 -0400 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7514B8BD1 for ; Thu, 26 May 2022 01:16:05 -0700 (PDT) Received: by mail-pf1-x44a.google.com with SMTP id a76-20020a621a4f000000b00519021bd5a6so741072pfa.5 for ; Thu, 26 May 2022 01:16:05 -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=BAxCptwO7y2xVPn5yxfUXuZaiLDAgG5VdQuxNau2t/A=; b=SSAklAtF5M2MvdVlYodbyAxTphyyK02Oj42SVcd3FTLXmUoOWmKohwP0jyuy7Dywnn z+Rwg5B5m390JADA/tH9Kd5hrRor7L7xc2HarYOOY1eeh0X5ooFq6gop9u+FKPEH68sX PSmyWhcvNVI+KSAsfLsiJwAoZy4hoOLroAWm7/PcoZRZ5RRn7c5QPkSzY4al45bC9y1m rxt4J+H9awRoebh/t2rs9NdCgcDLPVKf5pbTahtHh4OEILiQvhD1Izdrf/nBW5LrZ6Hr cCTqNUjkmGwlDPIsIOZy6KsBLIleiDr0kGVZMU24uQyWpnq1xNF84jdZo+Qvww3Nq5FM 6uTA== 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=BAxCptwO7y2xVPn5yxfUXuZaiLDAgG5VdQuxNau2t/A=; b=jjrs1EpL6UfOcTBC2tmTNGP1kaBH2raSll163SiFvUetyXwXGO72HWkEhiKAj/KWgB dD7W+Di80B6J+a4RrCsk6px7AMhQMnQ6k2U+UQ9M+U3+d1hm2hJZE7kyo1V1n7YTO4R9 ShkKTC6WUUm2qBiYyqHRZlGnYdtrtXUDTmvpaerg9gHuvYZj+TEOmTfP7IyA9Px9FGx0 UwAvpfZ3NNPAYbNjwBaVRAmfFBH0uufbhGCo5CrwLz8iO5ZpgiZOYTfpSdmK5uCbaQAE bBM7BQY+P73MnKm0cR+VvwIRWvoRUmh7iMyCNgCPG9SvIhxl8qKOkOhNd1Bvo+YYzv4V Z0RQ== X-Gm-Message-State: AOAM5325G4jJSR1tqu5vTvqMk8/AIx5rp6KSCSNVJWxnCO+lzJ0Q+HWt vbfQ6CG+tsk8N0OZSlVmCOxJj6j/K6FcEeU= X-Google-Smtp-Source: ABdhPJz4snZQEDVmZXj6RODHXR7rp3pbTlyyKgm6WM3ongSTDnEvvxBi0qJKrzgY36D1YxzBeGXt+A93QwpkuHs= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a17:902:b58f:b0:15e:b2f4:b75 with SMTP id a15-20020a170902b58f00b0015eb2f40b75mr37115965pls.25.1653552965291; Thu, 26 May 2022 01:16:05 -0700 (PDT) Date: Thu, 26 May 2022 01:15:43 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-5-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 4/9] Revert "driver core: Set default deferred_probe_timeout back to 0." 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This reverts commit 11f7e7ef553b6b93ac1aa74a3c2011b9cc8aeb61. Let's take another shot at getting deferred_probe_timeout=10 to work. Signed-off-by: Saravana Kannan --- drivers/base/dd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 11b0fb6414d3..f963d9010d7f 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -256,7 +256,12 @@ static int deferred_devs_show(struct seq_file *s, void *data) } DEFINE_SHOW_ATTRIBUTE(deferred_devs); +#ifdef CONFIG_MODULES +int driver_deferred_probe_timeout = 10; +#else int driver_deferred_probe_timeout; +#endif + EXPORT_SYMBOL_GPL(driver_deferred_probe_timeout); static int __init deferred_probe_timeout_setup(char *str) From patchwork Thu May 26 08:15:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44592C433EF for ; Thu, 26 May 2022 08:16:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346716AbiEZIQn (ORCPT ); Thu, 26 May 2022 04:16:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346632AbiEZIQL (ORCPT ); Thu, 26 May 2022 04:16:11 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E947E018 for ; Thu, 26 May 2022 01:16:09 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id i12-20020a25d10c000000b0064fec988b24so1015242ybg.7 for ; Thu, 26 May 2022 01:16:09 -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=5GHBoFboCsQPgW0xnX8626mjCMc2pUtGqVQ4b897WKc=; b=IrILs6/SrbLE4LxEZxNKCm/JFj6eee7zIC+Pzx0k28blExnst8p510N+Mrt6f7Ati/ fhCLg+kIuoSBGxRzYVVkBrn63L8QzTnZkJYc+jKZnJm5JNaCL1XmmvYBctVPcR+qBS4Q 4wGC14+pYhcdcXPlJ8KKsOY776WVCqrKd5R2mTvBd9JNSJx0gAZsEcqFNfNjwN61LpwP wY12x1+QnyJW06iCpgYiPtLxT3ic3L0/CM/Hl9WavuWnDT7UzG67QuvgYRK2zzxRr467 x76TkjjCfbOV/OiKelBwG+ZZI+ODSVX9nCHAb3bfLDYI4sagD3QOzDplraPR35J1ch4q W9tw== 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=5GHBoFboCsQPgW0xnX8626mjCMc2pUtGqVQ4b897WKc=; b=Z2MoPA+mGXeIyheoRRMSZV6TQR56t5643vtZk8v4WNVuz7CA3UCl6oGPlpHO7pUYf3 rH/c0x0jZgjBYgJRW1BIYTyuynq9ay6YfGRQVtdJ1rXzT7f7itZESWoEcqYdCfqzFPGC e8uPNnpnnz7ZL+pnOOrSLTvaeYWuFDIFsJ3SqKRwpXWuITlY2rIRJhizW/SWi4g0tIaF cXXLMnbgSXZzkCStSudD9WGCs0Y2L+ZN9BasQ9CksBaJSIBTo4sLkOfJp9npFxh4s05X XHbhCievjOJ8usgyGztD+hWSOPCnRJu23HKeJRNTXOqj/vqqE2MW/+d81B/W/09Gqm10 ePZQ== X-Gm-Message-State: AOAM5309qXWEqqMoIn1qXSm4QcZs5hMRPT8p0zBPim8Ysd1ZlYpUDPT1 kzIeVZrlBFvjjuvgeKMsjvXOb86sUPAKvFg= X-Google-Smtp-Source: ABdhPJwfT06c9prMUark3SgFprxU4855waPyfG4Z17nnwU6nQsbeq/CDsaY7uVT4Uffa6yH95LJ8lA+usCDNGiw= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a25:8e08:0:b0:64d:b20e:bf73 with SMTP id p8-20020a258e08000000b0064db20ebf73mr34625441ybl.558.1653552968266; Thu, 26 May 2022 01:16:08 -0700 (PDT) Date: Thu, 26 May 2022 01:15:44 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-6-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 5/9] driver core: Set fw_devlink.strict=1 by default 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now that deferred_probe_timeout is non-zero by default, fw_devlink will never permanently block the probing of devices. It'll try its best to probe the devices in the right order and then finally let devices probe even if their suppliers don't have any drivers. Signed-off-by: Saravana Kannan --- drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 7cd789c4985d..7672f23231c1 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1581,7 +1581,7 @@ static int __init fw_devlink_setup(char *arg) } early_param("fw_devlink", fw_devlink_setup); -static bool fw_devlink_strict; +static bool fw_devlink_strict = true; static int __init fw_devlink_strict_setup(char *arg) { return strtobool(arg, &fw_devlink_strict); From patchwork Thu May 26 08:15:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51A96C433F5 for ; Thu, 26 May 2022 08:16:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343802AbiEZIQo (ORCPT ); Thu, 26 May 2022 04:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240278AbiEZIQP (ORCPT ); Thu, 26 May 2022 04:16:15 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D998040E4C for ; Thu, 26 May 2022 01:16:11 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id l72-20020a25254b000000b00651f60988dfso998689ybl.11 for ; Thu, 26 May 2022 01:16:11 -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=kqnLyT5BScBmxPie/jUOGEmzvdpZW3OfuWkwvvKbmIQ=; b=O8dwYlRm5myWtMCUjluMS06m9OQufbVTaL0SA/1SSpLb6Q1H1ZeyGd0a6SHjz/l2AC gRRr/WCLHTFyURFv63GZWekkODW7A8O4IB2yzQJWM+/K0NtEVu9a5tsIpy3YI44fV34Q uTpUGoCbwChTFA2pkNGTMrYZa0xzpaUUIVE8dYXjTIu+gHcpLFh+pcu5hZYghuiUoJm2 ZKupDPbYJUcArPC1Umnaoqe/6Zgos/v0q8iU1hCEpHdc6TOgYFCUzgVDj2Q/pbkNtaXd 2RxGcLTqBsnDUI0hj8KfYCR16HfmSlIsdyhfQgPBL+wYl36dau32BugaaSnT2tbIlwGz BC+g== 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=kqnLyT5BScBmxPie/jUOGEmzvdpZW3OfuWkwvvKbmIQ=; b=RZV/W4YJ2sA6hc/WW/JAnkyvohc4YwGT5LgFeKnDifaNEPSJeceMlhrUNEUjLMmvJ+ HDs5PPr2Vy9pNOQ2laqsKjv22MdUNc7AARP3iJOjE0JX4C3tP7yGyzA6SvNY6LGpe5q1 MgNJdpzwNNr/B1NubQKj3Z1s29FKQ9BvQPvs1keLFsyBfb/ZUeM4AspgZMtBR115DCsi GpmBuK1sxx9/ii3/s6CAp/TjSjjVy7sIXMZpqBODu6PACtCvs4g9JFDBV39Hg+OuaNb2 1iU4+xS/+VUeFBCpFvyEG4t94c8SL5/fOb/IOpgFHpEXSsXqjzs7JfKNqhwmn9mV33bQ SWkQ== X-Gm-Message-State: AOAM531vFhkuuSVrzYFGBznUfgBp0P+uflqH6k9Uup57B+KsDTyheebQ pZDSfZhQK0fa/YU93tR1bzGSDpIb2XYyaOk= X-Google-Smtp-Source: ABdhPJz3E2nD3dyR5epKdpx7T0AcqAuln5UJYq6/LusJXLA9qDXoEEc3OI/BRFh9Q4xJz3OuN7NXxtEIzJwaSYI= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a81:4fd4:0:b0:2ff:2c4c:a687 with SMTP id d203-20020a814fd4000000b002ff2c4ca687mr37158577ywb.500.1653552971096; Thu, 26 May 2022 01:16:11 -0700 (PDT) Date: Thu, 26 May 2022 01:15:45 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-7-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 6/9] iommu/of: Delete usage of driver_deferred_probe_check_state() 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now that fw_devlink=on and fw_devlink.strict=1 by default and fw_devlink supports iommu DT properties, the execution will never get to the point where driver_deferred_probe_check_state() is called before the supplier has probed successfully or before deferred probe timeout has expired. So, delete the call and replace it with -ENODEV. Signed-off-by: Saravana Kannan --- drivers/iommu/of_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 5696314ae69e..41f4eb005219 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -40,7 +40,7 @@ static int of_iommu_xlate(struct device *dev, * a proper probe-ordering dependency mechanism in future. */ if (!ops) - return driver_deferred_probe_check_state(dev); + return -ENODEV; if (!try_module_get(ops->owner)) return -ENODEV; From patchwork Thu May 26 08:15:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0F2AC433FE for ; Thu, 26 May 2022 08:16:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346773AbiEZIQp (ORCPT ); Thu, 26 May 2022 04:16:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346600AbiEZIQQ (ORCPT ); Thu, 26 May 2022 04:16:16 -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 A971849CAE for ; Thu, 26 May 2022 01:16:14 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2f8398e99dcso7515437b3.9 for ; Thu, 26 May 2022 01:16:14 -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=LHvrfQT4UXFPIW7HvFCMhDyzwcScgNhuNK8AAkQqhh0=; b=ckTLEE9Ka8zRBQWZF8bw1bzPyohHSB7lFDGLGx8zTrvE1U6jlLS2u8eGVyiyeggEvU f2EkV92DxtJdRwumDctwEA2IQx70gREKkuzwEB+3OV15TZsv4nnJNeHpcR3jy+FuEHO1 E+wXrf/OpSIAmM7QLQFDf1+Hl/jJe7k56R5tSxkJdxRlRw2RMnjPZSIzlQ613IfRTFOa Zx8mX+wckPdc1dHZYVMnSMTwB7wl2UW03yvyEnDwGVANY6EkvB+fRXiLFfl04V8Uv38Y DXO0NJt9s3+k0LJaHseJ6m+c87C0hU/eJug6HuK1f5WfFNhgvCbmyh04c4hNdwY8HvkX PXvg== 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=LHvrfQT4UXFPIW7HvFCMhDyzwcScgNhuNK8AAkQqhh0=; b=3nDs6QaFVyIXdUqye3PtYwrBtqOWCDfc/2D+QtCMr3UA2aRjxG2MSl7M0Cvq7JNy3M 9u6X/s74GIg/mVqJP4m7gg5zHq9z/PdhpvR0qjbHlKi0IQ/nYj4ei5W/aKBwaw5nIcBe ojtGBroCBy7DjprvqzJZEgIkQTWo+UB1ofEzC0QF75tnCtAR16rMH3+5RdG2NHksdpX2 zM9/gNj+jc0nAj48s13OjWJ6yuo63IqfKd5WLPuyZ8aYI3tGUTb1oQCIL+1fNuHvi8lR XoGqpI7uROywoygRMGfoKKezl91dkKbCGn9GUrXjsrlW999QsD8OlSEb9rVMr9YULjyb eAWg== X-Gm-Message-State: AOAM531WmmhfHVYprCip5daOIptBMfj9PplRqO/Uj+vvqJDPmrtE45nw /pV2pyftYNkR/xeFQL1NcCNfu2DE72Y5B1o= X-Google-Smtp-Source: ABdhPJw4+9jAT07QlqTfVdN89DFF1UyFTJg5uRAxow4srxchUBWqQAUPj+CYeVjLPhmM3eADjwvBI1mMP+o/3L0= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a25:928b:0:b0:64a:f505:427f with SMTP id y11-20020a25928b000000b0064af505427fmr33415597ybl.146.1653552974289; Thu, 26 May 2022 01:16:14 -0700 (PDT) Date: Thu, 26 May 2022 01:15:46 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-8-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 7/9] driver core: Add fw_devlink_unblock_may_probe() helper function 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern , Len Brown Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This function can be used during the kernel boot sequence to forcefully override fw_devlink=on and unblock the probing of all devices that have a driver. It's mainly meant to be called from late_initcall() or late_initcall_sync() where a device needs to probe before the kernel can mount rootfs. Signed-off-by: Saravana Kannan --- drivers/base/base.h | 1 + drivers/base/core.c | 58 ++++++++++++++++++++++++++++++++++++++++++ drivers/base/dd.c | 2 +- include/linux/fwnode.h | 2 ++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/drivers/base/base.h b/drivers/base/base.h index ab71403d102f..b3a43a164dcd 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -160,6 +160,7 @@ extern int devres_release_all(struct device *dev); extern void device_block_probing(void); extern void device_unblock_probing(void); extern void deferred_probe_extend_timeout(void); +extern void driver_deferred_probe_trigger(void); /* /sys/devices directory */ extern struct kset *devices_kset; diff --git a/drivers/base/core.c b/drivers/base/core.c index 7672f23231c1..7ff7fbb00643 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1655,6 +1655,64 @@ void fw_devlink_drivers_done(void) device_links_write_unlock(); } +static int fw_devlink_may_probe(struct device *dev, void *data) +{ + struct device_link *link = to_devlink(dev); + + if (!link->supplier->can_match && link->consumer->can_match) + fw_devlink_relax_link(link); + + return 0; +} + +/** + * fw_devlink_unblock_may_probe - Force unblock any device that has a driver + * + * This function is more of a sledge hammer than a scalpel. Use this very + * sparingly. + * + * Some devices might need to be probed and bound successfully before the kernel + * boot sequence can finish and move on to init/userspace. For example, a + * network interface might need to be bound to be able to mount a NFS rootfs. + * + * With fw_devlink=on by default, some of these devices might be blocked from + * probing because they are waiting on a optional supplier that doesn't have a + * driver. While fw_devlink will eventually identify such devices and unblock + * the probing automatically, it might be too late by the time it unblocks the + * probing of devices. For example, the IP4 autoconfig might timeout before + * fw_devlink unblocks probing of the network interface. This function is + * available to unblock the probing of such devices. + * + * Since there's no easy way to know which unprobed device needs to probe for + * boot to succeed, this function makes sure fw_devlink doesn't block any device + * that has a driver at the point in time this function is called. + * + * It does this by relaxing (fw_devlink=permissive behavior) all the device + * links created by fw_devlink where the consumer has a driver and the supplier + * doesn't have a driver. + * + * It's extremely unlikely that a proper use of this function will be outside of + * an initcall. So, until a case is made for that, this function is + * intentionally marked with __init. + */ +void __init fw_devlink_unblock_may_probe(void) +{ + struct device_link *link, *ln; + + if (!fw_devlink_flags || fw_devlink_is_permissive()) + return; + + /* Wait for current probes to finish to limit impact. */ + wait_for_device_probe(); + + device_links_write_lock(); + class_for_each_device(&devlink_class, NULL, NULL, + fw_devlink_may_probe); + device_links_write_unlock(); + + driver_deferred_probe_trigger(); +} + static void fw_devlink_unblock_consumers(struct device *dev) { struct device_link *link; diff --git a/drivers/base/dd.c b/drivers/base/dd.c index f963d9010d7f..af8138d44e6c 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -172,7 +172,7 @@ static bool driver_deferred_probe_enable; * changes in the midst of a probe, then deferred processing should be triggered * again. */ -static void driver_deferred_probe_trigger(void) +void driver_deferred_probe_trigger(void) { if (!driver_deferred_probe_enable) return; diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 9a81c4410b9f..0770edda7068 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -13,6 +13,7 @@ #include #include #include +#include struct fwnode_operations; struct device; @@ -199,5 +200,6 @@ extern bool fw_devlink_is_strict(void); int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup); void fwnode_links_purge(struct fwnode_handle *fwnode); void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode); +void __init fw_devlink_unblock_may_probe(void); #endif From patchwork Thu May 26 08:15:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C5F4C4332F for ; Thu, 26 May 2022 08:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345368AbiEZIQw (ORCPT ); Thu, 26 May 2022 04:16:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346687AbiEZIQg (ORCPT ); Thu, 26 May 2022 04:16:36 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83FA04C7BB for ; Thu, 26 May 2022 01:16:17 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-2fed274f3fbso7281627b3.17 for ; Thu, 26 May 2022 01:16:17 -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=6dgEjD+4R2dKDRgscs/xv70YgyhfXrRwkUylnVTphfk=; b=XL1eUaOAcssMtqvMAb2JLoXAqGRiBPWRpPBJh6rTDvytgReAH+LjXHDFnDZXS9f9I2 35g3JMRGxQZlCvxOhWMcOSoY7fmD/fBdQK3AfpTe4+KDVzo3ISAmWs2bpcJGBQMEHxn2 XOrBvHACbTqtONiyNPB/vydyMzterA8qUwVfxsEqd+Vz+8qcEbmdk9FVpwyv4JToLFBL EPR58mdlFaKlltO8fCr0xZCvNvm+F4UFw5xJYUT6ue5rms9F3TPGMAGF7HdiGvNufzye R8r2YJjaY8RuLAuVFWX7SLMYTTkhhepWRDKwQDGC55z4gixqwa9JauWCwnOhgDgX/TTb SoiA== 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=6dgEjD+4R2dKDRgscs/xv70YgyhfXrRwkUylnVTphfk=; b=i6ymNG0txeD66k0R4/XzqEnHlx5LF222RMIsVaBosi+/1FDDPSTWprdv1kEUVqRuvd 8mmtyCbGwtn0qnF6q8YWP5hvUM0D3O6xc5IAulSJggjzXuYJFmXNWv+PLTo7uNas6HyJ m8EKcPmtbvLktreew1IbyIsiCAiBWdvaC3p7or3zYV7d80xwO6P/PGcI9MWKOhPe2f41 KFlO40/WW8/eDO/NERAzRYa6BrbIx8KfcwWAHJRZFxHT1xU+nSL6tsA46dlojOZ0PRrU TM8wVrs41p6kYXtOituy9MDvy843jQeKCr3blTKFuaWcCos2BfmYpVK+3+Ox2NK5j5ib nyEQ== X-Gm-Message-State: AOAM533WFQg1fwqVt3QNCwzQDt1jup6kMdn6eF9/2C/JKcUuz6ViLz37 OG2TIs9VsACUGIcevYoCjbUFo5cjKLoMGZA= X-Google-Smtp-Source: ABdhPJx5hTzSS2LFu7RkqlQ7KLRzxV0Py+PZHVG9x+dcAcINC/1HXYTnTXlf9OdhjLu3DXMEHDG7SkiPohYReIE= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a25:fb12:0:b0:64d:d6fb:406a with SMTP id j18-20020a25fb12000000b0064dd6fb406amr34790013ybe.433.1653552977155; Thu, 26 May 2022 01:16:17 -0700 (PDT) Date: Thu, 26 May 2022 01:15:47 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-9-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 8/9] net: ipconfig: Force fw_devlink to unblock any devices that might probe 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org If there are network devices that could probe without some of their suppliers probing and those network devices are needed for IP auto config to work, then fw_devlink=on might break that usecase by blocking the network devices from probing by the time IP auto config starts. So, when IP auto config is enabled, make sure fw_devlink doesn't block the probing of any device that has a driver by the time we get to IP auto config. Signed-off-by: Saravana Kannan --- net/ipv4/ipconfig.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 9d41d5d5cd1e..aa7b8ba68ca6 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1435,6 +1435,8 @@ static int __init wait_for_devices(void) { int i; + fw_devlink_unblock_may_probe(); + for (i = 0; i < DEVICE_WAIT_MAX; i++) { struct net_device *dev; int found = 0; From patchwork Thu May 26 08:15:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 576252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECAE9C433F5 for ; Thu, 26 May 2022 08:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239711AbiEZIQr (ORCPT ); Thu, 26 May 2022 04:16:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346702AbiEZIQm (ORCPT ); Thu, 26 May 2022 04:16:42 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815624FC7B for ; Thu, 26 May 2022 01:16:21 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id o8-20020a17090a9f8800b001dc9f554c7fso779038pjp.4 for ; Thu, 26 May 2022 01:16:21 -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=2cafqgyvMaG8pnmb2DwUPLH+NwqexHFaoGplVLqjY6c=; b=Qhvec8EM5waM3couwB4Dum8OsNReKnA1EIAEV8LpsepiAu+NTnpIDd6zPzvaScyoHi joLxHL0NnhEkyS300O8xI9N1fgEmoiNW+tHhgRg+C3VgA1m7nuIAVZgpAAN0SCoZaXb3 HEB/SDIh21LxIk12AKALJ8PaTt3HoxW0TucqgFk8I+2nWe8sV+SOqE/1qyqqfeteZr3g EufhH6H9hKX80HxUrjS4SaCSZY+0yU4qfhVpbOF9hKztCUUvRR36MTpKRlzF3fXGT8kL xXPgN+vDeTbaZIcJj1bpAuXYJV78EUX8wvpAl/KOGx8ob/jDmnzqVjFH+adTvCIPzWq4 hKpQ== 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=2cafqgyvMaG8pnmb2DwUPLH+NwqexHFaoGplVLqjY6c=; b=pIRKdZ7blYILTZiKOcIeEtsD86TUf+kgmpkn8AzPATwlpUIyAL8Q87F0T/zp8iKsvs heNoMZsw1z5uobnHuny95s4ehKRhTW6OFD3sbLoq1T/mfdS3+d9OQLNPEEpMzDbtFFiq lIQcvCQ+ItOGhc72HbIbCRczoTc42AKHfSO27uVyfQdQfJhu+aEI079oDQkKPKZxf8hV A+eNR6NuwauNyU+E3P+UPqYx9/j/6Xu0gx9Utko95ssz8BsRVEfCDEf0NM4IdxScd7Ij YX0OeGupV+vaswI3reVDbzu29hzEpTOmQN5qikREZdrYYlv+Tne0tTum1ygd77KhD6lM sDkg== X-Gm-Message-State: AOAM533g2N2MZ9EsIgn7Lb6U/nTtLJDFAb97vYjjp0j8nF0OrS9J8/up WzpkTbFgK1JdZ26hhrE8PgQF8M1L/RjU9/g= X-Google-Smtp-Source: ABdhPJyinReesiUqDbMmyw2id5J+MedifDe6OonBttcETpmdQGcuAvMkhqslxCFm255z4G73O9ROU101o9oWZy4= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ff1f:a3b7:b6de:d30f]) (user=saravanak job=sendgmr) by 2002:a17:902:7004:b0:161:f216:4f3f with SMTP id y4-20020a170902700400b00161f2164f3fmr30173525plk.98.1653552980455; Thu, 26 May 2022 01:16:20 -0700 (PDT) Date: Thu, 26 May 2022 01:15:48 -0700 In-Reply-To: <20220526081550.1089805-1-saravanak@google.com> Message-Id: <20220526081550.1089805-10-saravanak@google.com> Mime-Version: 1.0 References: <20220526081550.1089805-1-saravanak@google.com> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [RFC PATCH v1 9/9] driver core: Delete driver_deferred_probe_check_state() 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 , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Hideaki YOSHIFUJI , David Ahern Cc: Saravana Kannan , Mark Brown , Rob Herring , Geert Uytterhoeven , Yoshihiro Shimoda , John Stultz , Nathan Chancellor , Sebastian Andrzej Siewior , 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, linux-acpi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The function is no longer used. So delete it. Signed-off-by: Saravana Kannan --- drivers/base/dd.c | 30 ------------------------------ include/linux/device/driver.h | 1 - 2 files changed, 31 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index af8138d44e6c..789b0871dc45 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -274,42 +274,12 @@ static int __init deferred_probe_timeout_setup(char *str) } __setup("deferred_probe_timeout=", deferred_probe_timeout_setup); -/** - * driver_deferred_probe_check_state() - Check deferred probe state - * @dev: device to check - * - * Return: - * * -ENODEV if initcalls have completed and modules are disabled. - * * -ETIMEDOUT if the deferred probe timeout was set and has expired - * and modules are enabled. - * * -EPROBE_DEFER in other cases. - * - * Drivers or subsystems can opt-in to calling this function instead of directly - * returning -EPROBE_DEFER. - */ -int driver_deferred_probe_check_state(struct device *dev) -{ - if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) { - dev_warn(dev, "ignoring dependency for device, assuming no driver\n"); - return -ENODEV; - } - - if (!driver_deferred_probe_timeout && initcalls_done) { - dev_warn(dev, "deferred probe timeout, ignoring dependency\n"); - return -ETIMEDOUT; - } - - return -EPROBE_DEFER; -} -EXPORT_SYMBOL_GPL(driver_deferred_probe_check_state); - static void deferred_probe_timeout_work_func(struct work_struct *work) { struct device_private *p; fw_devlink_drivers_done(); - driver_deferred_probe_timeout = 0; driver_deferred_probe_trigger(); flush_work(&deferred_probe_work); diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h index 700453017e1c..7c245d269feb 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -241,7 +241,6 @@ driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev) extern int driver_deferred_probe_timeout; void driver_deferred_probe_add(struct device *dev); -int driver_deferred_probe_check_state(struct device *dev); void driver_init(void); /**