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: 577671 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 ABC46C4332F for ; Thu, 26 May 2022 08:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346664AbiEZIQK (ORCPT ); Thu, 26 May 2022 04:16:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346001AbiEZIP6 (ORCPT ); Thu, 26 May 2022 04:15:58 -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 7B557B043C for ; Thu, 26 May 2022 01:15:57 -0700 (PDT) Received: by mail-pf1-x44a.google.com with SMTP id a76-20020a621a4f000000b00519021bd5a6so741072pfa.5 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=BrGcRqideAUeJpZge5xyVbpsfq09v2mA6AplWS/SCZU01ISHrvurQGTFv+2QAsTmoA jNCfbx8e9MXG5CJ24pxZaVDhTZDXq5M3N7cqlf851Od9OtNQdT4OrPnwoOMUuhh32uth 9ejCfT9oUuuvVsEucySL/ksicyv0584soE2k17HgbM3en6J+wj8hsvWbzsHL2ejPVtPP i5v5Sg79vjnF/BSw6wFThfI0XjoMd2GelqkKlHAzlZl8aPi2wcuoyIlgagWjUZHG2gq+ 1f/74k0EFN1P4oEZfJcSMml7niF+X86AnNg3CyfIZHp0tAIoBCt2eRZs+Wj585eDvsuE W1Kw== X-Gm-Message-State: AOAM53177pSwTRnLz3h8reM97axPZEpx6CbylWI84hQTBH+0UPRICF/o 5ykmtdoGqSwDwehiHIvry+Z6Bm+JFqoD2og= 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-pm@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: 576426 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 975B2C433EF for ; Thu, 26 May 2022 08:16:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346669AbiEZIQL (ORCPT ); Thu, 26 May 2022 04:16:11 -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 S1346632AbiEZIQJ (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 8C360B41D7 for ; Thu, 26 May 2022 01:16:00 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2f4dfd09d7fso8176837b3.0 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=zE88rI0QW1gaoYnmSSqH7pEy9xlfuKPMfs3JDjS9Aa0nL2GmXeWcrxtNEvlVz5l3xk f531TtmiuMzmGichPIWjyLlqmfnIFhihoNoOTGQKFDX1U+lczywVv3HPn+qgLzlPTITr MX4lBHAiIxcz5n1ET96klFltFHH0irSLgcFuABxOlKKe5uNMyJAT/2mnh/Vk/pOcDnwd YQBJAa0Exm9dk/cg9wJ++jtU8+RAyIvCxJ/oSV6um/9s8+D1UxYOCljxt2tyNUkkrFNx +JTbVQRinVmUWrh9+1+X6YPAbmm88IF1kLH72i7a+Sxqj7mrruZPcZkVPabYlG9JDi/E ezNg== X-Gm-Message-State: AOAM531Dq9YzDV7hl6SttHuNYi5dSSADne0aJur/eAM6OUsearYRQ3sb C914cN+ZnF3slKGSiIPos/ddkO5X2K7wUfI= 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-pm@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: 577669 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 C2138C43217 for ; Thu, 26 May 2022 08:16:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbiEZIQT (ORCPT ); Thu, 26 May 2022 04:16:19 -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 S1346644AbiEZIQJ (ORCPT ); Thu, 26 May 2022 04:16:09 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCA9AB8BD2 for ; Thu, 26 May 2022 01:16:02 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id bj12-20020a056a02018c00b003a9eebaad34so544408pgb.10 for ; Thu, 26 May 2022 01:16:02 -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=GxkT/jC1A/SjHTVJyICgTbQ8kZ09S5PnC/0kU2Od2iV2ZZWkqfPq/TtHb0PaNfcbDz Dwv7pj0eSIR1TAYyh3BQG5JFIEYcINegJyMatrpBsrVffstgOKxYRxBGb8taXr4oBwuL dsgpAcLJcHzqffsLKLhioVTnhlVxt/GptYGEphrXhTj+CvtrcyuWsJs/j0h18eyfnVMd FIFhezhpqGOzBX2RDJjp9btlLZF5qQHJKHFN7XF/PMFcGqc2YejMuQzeV0qTthitkbnv dP0cXpnKDsFU3fwUOLjMExuFNjXuPNovVJUN1N4MWr/s14QfPDY/K6e/0tnkSg1i7pbJ Z0cw== X-Gm-Message-State: AOAM531Sp2XcBpH8k0w7+OnlEa3U6+Q1f0O444qawCrUd8nkZYTRTnh5 qePx6Mc0TxrJdVV9pQ+St1B/GX1JVSp7iZQ= 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-pm@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: 577670 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 862E0C4332F for ; Thu, 26 May 2022 08:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346653AbiEZIQM (ORCPT ); Thu, 26 May 2022 04:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346661AbiEZIQK (ORCPT ); Thu, 26 May 2022 04:16:10 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46ACC03A7 for ; Thu, 26 May 2022 01:16:06 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id x4-20020a1709028ec400b0015e84d42eaaso745353plo.7 for ; Thu, 26 May 2022 01:16:06 -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=IR32ENjnRbfYyVv0VWMmI5aiA2h0Taj6AY/nPhVkS9JNXAfhkv24KiGnZliphrpjqK kKcfto2nx4AAAq8N1yaWkUBysypOlLM5OvCiOEKhCAP+xMOw8wyf2sX54G6T/FjGDgrz 1u9vi4k9QQvqEAYt3K5caO92v87MUqvKY9LlI3LifFIDTeqBrpooeF8wtUzHm+HF6wUN 8h6X4Eha+su51n1HiRjEokrNGLl3e/3mzaz7pi99JFyBNOUQ9oWDuXjk0o7WPRbPUGPo BvgqfuP0Vt+uSOjSHcanITB/Sb+jKsiWrrqD7X8kyzrQxIJtFdiaVdgUhuMZSEDRQMb0 uWWw== X-Gm-Message-State: AOAM531v67liu4LH8QuLJICfgmcA9mcAhMIv55hpXpi9XkoQQEhOzSOV /DqxTzDw2FgbmmDeFq9sHCSwP2H0TfJwkv4= 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-pm@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: 576425 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 CCFABC433F5 for ; Thu, 26 May 2022 08:16:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346671AbiEZIQR (ORCPT ); Thu, 26 May 2022 04:16:17 -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 S1344570AbiEZIQL (ORCPT ); Thu, 26 May 2022 04:16:11 -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 9FC8CC03B1 for ; Thu, 26 May 2022 01:16:08 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id e195-20020a25e7cc000000b0065343cb6c39so1012097ybh.6 for ; Thu, 26 May 2022 01:16:08 -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=BcOzC5nQxNs8UMhIVgWnhrOOIocwCjydIvPRxXUhApnpbEmeADhhsp365WcIewLLyn RWpquXcclIkSGlHXK8i2Cl5QhZPMQQGhvAtMEzY+y3/ycTY+XJYBoYPCUpjy/P8AE8gE wHvPijz7Zr37XDzSFqPofKPK4+hVzomqWsnEaCVueeW4kEjisW2gV1JrMt8/L5zNaEGf Y8+PDSaTJUgmMsgL+NzGKe6tl8Rxm+Zj0sbvmapz9t34mby6zhC/UjzkWmfOel5IFMQp Xyo4S9wEmKBZrWGAIwzFXU+f7HuRH11TyOj22VvbdaBAcH9I8/Wej8bc3jyBKbUJOPea ZLDg== X-Gm-Message-State: AOAM5337qN6aYYVw/jwMFVcLPQkFReKQh0GO2j0e6WVUbkzEEBc6G32n OPomQyTpd6BJBmtuly+FTtWnxHbHisA43Lw= 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-pm@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: 576424 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 667FEC4332F for ; Thu, 26 May 2022 08:16:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346726AbiEZIQn (ORCPT ); Thu, 26 May 2022 04:16:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343802AbiEZIQP (ORCPT ); Thu, 26 May 2022 04:16:15 -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 D9B1B473B3 for ; Thu, 26 May 2022 01:16:11 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id b13-20020a25340d000000b00655630fe653so971132yba.23 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=rUPmj9KJ/wh0ytmAaY1r06NnW6fTxmbJ1JCgKVqgIkLfyfi78LHl7xkHS+YrI7TdG8 EGjYAxScyTuZ4CdzhqE7+MaHxEEGjIuDxvcnDpGZWJ4LoSQHp3IyO1nD9N59d8SjPg+k 8ZbQDyxaw7Df4zbZJl8Y8iHcWNx5+G+/oUfsyd8jaIBjVKq3GVh6U7ERFKQfFjE9ksnT ijQrPJWVXvIlw+Sb7QoZytDTvkcuHhBRdb7900WKzdZc6Da/cPnoND/Iic96evfPKNAa L94QTpO56vAOP2kn1b5g/l6gSu1Xjr4zTIEt9idPxkNfOaPRyAE0Kq66fwVQmeq2A+bb hSnA== X-Gm-Message-State: AOAM532k/CFejftlCWCzbJrvskC1xQIGQE1jAMnYPfPg5f45UIEqSN0a 1V+QkgWFAbsr991KkYxK24Ijavg1I5/7SXA= 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-pm@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: 577667 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 D7FDEC433EF for ; Thu, 26 May 2022 08:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346632AbiEZIQ7 (ORCPT ); Thu, 26 May 2022 04:16:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346656AbiEZIQQ (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 AA6DF49F97 for ; Thu, 26 May 2022 01:16:14 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2fb7bf98f1aso7586197b3.5 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=ewLR4ICidKXoXuDkzyjlMRRd2LWqwe+ZnXG3oUxaos1qN1x0FnAAluU8YuztURPbpV A1j3sZuVg1sYw9Fcqx1aFWROsfaGBK0WK39ZxP+vnydSKcHygJYalPBsQteGOFGHJ5R0 Y1RnZxuLK8pLu2t2vfNyDqx3FMWxiVydRZYcbZ85XE4jNpV6wwTALOVhoak/Y1MlP9aN qzRdLcVlXfW22ttFNKoxSdBwhK/n+UTHwUNCmC+Dc3kt/N+XaAKhiY5ZZmg4I6ZnYezx XRWp7j58hnaInP1T8J10g4Bvol18VBbrgEKtKhlwIqI9mTNpUj2YGHp6hSRMvXcHNr/8 yexA== X-Gm-Message-State: AOAM532mOXubQ/ioGZq6zwidMsDYsEHX/sdat28sVWQzPP2Rnv9Oe60t kNlVKNzG7JNku4wRRwuWrCmOp2Kr9e9HHps= 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-pm@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: 576423 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 D75F8C433FE for ; Thu, 26 May 2022 08:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345414AbiEZIQy (ORCPT ); Thu, 26 May 2022 04:16:54 -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 S241460AbiEZIQg (ORCPT ); Thu, 26 May 2022 04:16:36 -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 826FB4C7B4 for ; Thu, 26 May 2022 01:16:17 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-3004ae6bfffso7198287b3.20 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=cTRT3fmME3eHRMBxT3hkQE0J1vT11y30VSeiHmx/kMUht4/E/zdHcntojlOD+8znse 6S28Q+Xs+b1vP3c27XD9G9mSMtuKXbPj3sNpO5UbGoTEYWvv4AZW62yyuVhiDy1D1QAy Cv8y04k6B//wVSbbUGGNB6cTu6MQ5oWSx/dGJPLr0ionMbdOgXHc+ubYRn9cRiU1TL+g n07CTBoYnTKmtDmQ9Q3fj7l0Gq5FY3bmwz5RZ1C5AewAlAMP5EjrnL7Bpo8Yz2j7S/qz OQDsUvxf23r8ZhQHQdykotWZHmA9aIQIFab5ApUlBC3kCvriVLa7HXWgA8ZQKPGiEBYs w3rw== X-Gm-Message-State: AOAM530f44NlwORfhhQ6zz6izkrHFQa1g0g+h+zf3SWtpO/K4tFs0+tv Jr+Qln4eZfTE2bRJuUah08zbLJqqRX8V7mM= 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-pm@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: 577668 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 C882DC433EF for ; Thu, 26 May 2022 08:16:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346677AbiEZIQt (ORCPT ); Thu, 26 May 2022 04:16:49 -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 S1346701AbiEZIQm (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 294BC4EDE1 for ; Thu, 26 May 2022 01:16:21 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id u7-20020a17090a400700b001e26127ac5eso29699pjc.0 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=niGeJreFvts5Rhyhi7IS4qb4Lh/to2BHzJzV1dBQoAr7BBLRiaBgt0N9LaooL9omq2 D2d66MecSQo2bVkUu+iOaNXNEcNYiOZ3UiHXL2hHiJWge6KHWfOKU0cReJ5wx5J5vA6+ gT7zW+lnDmCdQ9JsrvC6/dpOWPxpxFz81/M4SHYpUM9rHSbaPxOvM760wRIj/ul9RGFm z0qrBhEXkvzRekV2t9B+dKvcPQe1L2jaJOGz9KJMWeJN/fNLtaR2SRyWqnUlunvEu3lb c49Bg1OPcrNi3CbslnbqjJeB+zsKRdsmjwmt53HLcGEFQk7EOXTATkDvCpGDqSb1VLHT JLjw== X-Gm-Message-State: AOAM530Whwv0Z3licBpiqSHsqzeUUgJ4Gzt2K2CrF70+R3MQOCG9VO9d Zhg7BY9TQdzOHz3iPEsht3xkFBIlZSGVpz0= 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-pm@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); /**