From patchwork Wed Jul 27 18:50:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 12930712 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 E08E1C19F2B for ; Wed, 27 Jul 2022 19:09:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236074AbiG0TJt (ORCPT ); Wed, 27 Jul 2022 15:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236668AbiG0TJP (ORCPT ); Wed, 27 Jul 2022 15:09: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 1C44161B33 for ; Wed, 27 Jul 2022 11:50:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id v19-20020a252f13000000b0067174f085e9so4059308ybv.1 for ; Wed, 27 Jul 2022 11:50:22 -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=6PMRC4+7ETZ6O5YvP3kBSLPeIUc34qIh1gO+2nFmWRo=; b=STPIcS3r2zaNxA7E/SkB84p7lfSdY7kdH/9tNvpaMzSSN00NwQMg3GYOWYlnYHebEw dMGQ1J91PpKVadenfIq5DclEZf4jsu47mwqHouONe7IY3flpoZWcwtOuipCkUgIuZhit d9tl/VwTZN/CWPNwrUx1oVGm8T+biHUfabWMcje4C0ng/f+uTVzgzBY+P6pNDRHyky9K kqzdmm5tt3M6Tp+rfLhRO5SQbGfAr/n/qnU0fenyBvchdXCGJUm/TymA34EiXmuTozO3 e3oiIP1EfCw1k4mCbjWkHYNKvdurnAKnXrpUFX1+Ch77LTzGUqubaU9RSw6tzBsHMZDr S5sw== 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=6PMRC4+7ETZ6O5YvP3kBSLPeIUc34qIh1gO+2nFmWRo=; b=afSM1z1A3uDHrqvi0g2DoNrxSgj8wnLwzjPrzjD7jGjs3ARpOVObgZbOz4fkIKlIUI v02d/xAlbIrebMMA9kEtnTxGrKT6fTw5HKc05ij8Y31iyWsRdVKIuD5rytE+V533jK31 hgbEG8xaZUi7Gn4DNlY5NUChB2pzilDuOB5jYGgJ/ByoLU6E30gnuH+OB7JEjqV06gAM NfSBBdhhhWsnnehTAliOX8n7m1Iz/YhmnIOuWqiyoYwKhQk4VctNxE4+BcWdsh2KuFOv UtRCRrqQ0u+qNrfjd0FYlOqEbtf92iIvRC+RVG9RunKzk75BPCJyK2tY69a1Z6kG6M7e LwjA== X-Gm-Message-State: AJIora/S91ZmZQGmA/TvXQRroi8B3+LWQff/N4JZXCOzrmmn49MetMS3 vVoaZE/su2ypgOelcF7RwcvAZ1COjunVXIg= X-Google-Smtp-Source: AGRyM1t0kGe85rVKFJazceKwp/HRO3A1D57nD2R5Pm6B9VnNjAno0gRxgXRubEdu4HVVOcO/HvgmF9kn46gj2PM= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:40ee:bae0:a4fd:c75b]) (user=saravanak job=sendgmr) by 2002:a25:d4a:0:b0:671:6d11:d14e with SMTP id 71-20020a250d4a000000b006716d11d14emr9175171ybn.479.1658947821364; Wed, 27 Jul 2022 11:50:21 -0700 (PDT) Date: Wed, 27 Jul 2022 11:50:09 -0700 In-Reply-To: <20220727185012.3255200-1-saravanak@google.com> Message-Id: <20220727185012.3255200-2-saravanak@google.com> Mime-Version: 1.0 References: <20220727185012.3255200-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [PATCH v1 1/3] Revert "driver core: Delete driver_deferred_probe_check_state()" From: Saravana Kannan To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Saravana Kannan , naresh.kamboju@linaro.org, kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This reverts commit 9cbffc7a59561be950ecc675d19a3d2b45202b2b. There are a few more issues to fix that have been reported in the thread for the original series [1]. We'll need to fix those before this will work. So, revert it for now. [1] - https://lore.kernel.org/lkml/20220601070707.3946847-1-saravanak@google.com/ Signed-off-by: Saravana Kannan Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren --- drivers/base/dd.c | 30 ++++++++++++++++++++++++++++++ include/linux/device/driver.h | 1 + 2 files changed, 31 insertions(+) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 70f79fc71539..a8916d1bfdcb 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -274,12 +274,42 @@ 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 7acaabde5396..2114d65b862f 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -242,6 +242,7 @@ 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); /** From patchwork Wed Jul 27 18:50:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 12930714 X-Patchwork-Delegate: kuba@kernel.org 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 27C0CC3F6B0 for ; Wed, 27 Jul 2022 19:09:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236172AbiG0TJx (ORCPT ); Wed, 27 Jul 2022 15:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236842AbiG0TJR (ORCPT ); Wed, 27 Jul 2022 15:09:17 -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 BE9AA6D572 for ; Wed, 27 Jul 2022 11:50:24 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-31f46b4759bso48114327b3.0 for ; Wed, 27 Jul 2022 11:50:24 -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=0gBJh1/DX5M6n5W65xmbWPerC4xN3qFPSKf5chwOdiw=; b=bg8ph5OtD7AxG1zxeIOzd4c3YvuKJJwgTI0Hgqzl0BLzrOKqjOjkJROWso5PVvlwaw SKFanteSKc7afiyOqABcwFH+hyZFpEQAOqasHcqh2f7L+Bdn+8xIYU+sBCOKIrfuO6vp FADBwkrq/HXNQGrAFEpCfdTvNxN8H4jPOptrzVphWdjRaTQHxjniaTf7OmRYFPnKFrO/ zUbzV2HK8KGT3gR4BAIFqQtcSk3OB5PIqZkQQLX3UNakY3l4kaXGHklmrW+5TWobbdBt SQhKYvoAqOFXhYx6Xbyj2YbePvXd9wsyZwbIquWXadlDeNtWsPMCAFj+S5VHWE/2enUi JMQQ== 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=0gBJh1/DX5M6n5W65xmbWPerC4xN3qFPSKf5chwOdiw=; b=oezHKQcmxYDL8UUnHfVpEhPzyr6ENrYzSCHejFGBVpGIMdfzCv451LEL0z9L0FGh3r YrzT8npGNlTenAqx6lkQx27IYipsfXzhdkzMxe8Xxw7D9mGm02+CMDxBkmKbeDXfyqPl RlRRhmaIkCQQUU7TiYIDk4wooE/u/6TQUcbTssQuC1+bw1qRQGYTViC8voM3fxnkr97T Qi3Z3O+g0dazU/aN1Oyeex3Drhnk+n1cL6aTzPYYUHcCmw5hvw6iX9quzIg+qxS6AvHa G/6Ng7Lf1rrPev2Tqu6o7k8OEoF4JgP3q6h9uNQ9WjGnjug2VsB/GopzVdqQD0eBfhQh NxJw== X-Gm-Message-State: AJIora+EkWgTU+WP2e9ECJa8cEFUTeOydXZuT/7UR9Wv8g3Xzgw6GEdW +8zL/+MdnA3JVwlfZNUZWWUGE4DVkRsLHaU= X-Google-Smtp-Source: AGRyM1vw9acn4WN7zKTrz4jHGTc3N/jAqDblTKq2t1lpN8G1rUtuPz0iWs9j4VcBcTn0CpXqkKAHxpdMjKm+bSs= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:40ee:bae0:a4fd:c75b]) (user=saravanak job=sendgmr) by 2002:a81:54c5:0:b0:31c:7731:e1ac with SMTP id i188-20020a8154c5000000b0031c7731e1acmr20280110ywb.190.1658947823995; Wed, 27 Jul 2022 11:50:23 -0700 (PDT) Date: Wed, 27 Jul 2022 11:50:10 -0700 In-Reply-To: <20220727185012.3255200-1-saravanak@google.com> Message-Id: <20220727185012.3255200-3-saravanak@google.com> Mime-Version: 1.0 References: <20220727185012.3255200-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [PATCH v1 2/3] Revert "net: mdio: Delete usage of driver_deferred_probe_check_state()" From: Saravana Kannan To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Saravana Kannan , naresh.kamboju@linaro.org, kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This reverts commit f8217275b57aa48d98cc42051c2aac34152718d6. There are a few more issues to fix that have been reported in the thread for the original series [1]. We'll need to fix those before this will work. So, revert it for now. [1] - https://lore.kernel.org/lkml/20220601070707.3946847-1-saravanak@google.com/ Signed-off-by: Saravana Kannan Reviewed-by: Tony Lindgren --- drivers/net/mdio/fwnode_mdio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mdio/fwnode_mdio.c b/drivers/net/mdio/fwnode_mdio.c index 3e79c2c51929..1c1584fca632 100644 --- a/drivers/net/mdio/fwnode_mdio.c +++ b/drivers/net/mdio/fwnode_mdio.c @@ -47,7 +47,9 @@ int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio, * just fall back to poll mode */ if (rc == -EPROBE_DEFER) - rc = -ENODEV; + rc = driver_deferred_probe_check_state(&phy->mdio.dev); + if (rc == -EPROBE_DEFER) + return rc; if (rc > 0) { phy->irq = rc; From patchwork Wed Jul 27 18:50:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 12930713 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 16F45C19F21 for ; Wed, 27 Jul 2022 19:09:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236130AbiG0TJv (ORCPT ); Wed, 27 Jul 2022 15:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236892AbiG0TJS (ORCPT ); Wed, 27 Jul 2022 15:09:18 -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 253E1691E2 for ; Wed, 27 Jul 2022 11:50:27 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id m5-20020a2598c5000000b0066faab590c5so13800925ybo.7 for ; Wed, 27 Jul 2022 11:50:27 -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=BEk69dNG70BOHgb0SXLFWzzFpDyu+7tq1YolDhZdyzE=; b=B7uDYX/Cr97zFSRCvB7/fn1gKg5skiOo3orS627VXpMcYo8QEZ7oIrvYBjLdXKLvyw oxhx2F1iCRsyE1gIZ2hQTPsAZ46+3sYZ0ox/pMmaN1heCLPhTeZtrSP1HwOFBi+LY5w+ O36Puictr1H9b2lkfo4jRR0Mo/xQr3nN7QsINYg+iKLGVrHaFtsRNdO2iKXWdHOJB+yI aOHHjRJdiN1hTtvuovOpKu1BWxPbokvLEXrXizIHGlzJb61Z0JET3FdTJLeRJ+YjUkgx ZtsTrJIP/RTGLKgls6kpdVgkFafVspj0h5Ad++NOeAflXkUYcUYlzfpi2vBLdxNvt1Jf 7KOQ== 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=BEk69dNG70BOHgb0SXLFWzzFpDyu+7tq1YolDhZdyzE=; b=N+T46Akz0jk7ypNTosySWiPw2CIJHev6X3iKkuULNC6ur1D3J0An7qkxMYEvQ7rZH2 59srEOlP3uQOxVxRMwKKS+OdCeyVxgaEBVyjPDepvFr6ppMQxVv8L2puBi9Nz6WvYzfd EFTGD29ncz8LfWQp3i9QjhkXoKehf52jrbYint0C4HUUML/cCGm5ZiRZu1Dm0fOOUrLn bwIqL1rg+5mo7V9i+fNNM4Yjef+QZj7TEsKCU6vXARaPrAj6PAu/wqpsK16TE+9t+ViG gk7688V3LH0O6dbLTD49jjYREE1PA5Usxk11viu2m9lWzeP8FCRwCgI6DGiYVEF9mNHc No3A== X-Gm-Message-State: AJIora+hkdMfNbsSCF5QwzokgimkG+uVrSYjT1lmOuqI7rDd12yTeyD6 AcSvn+F/gi6G2LhKeFVGJxu/d2QaLyVwYSg= X-Google-Smtp-Source: AGRyM1vBbGCvhJnuNcqNxmyfgvBqU63X92ObJ+fmmE6nsBM1EgRJPhCmvWH4pzIt7pOBmOkC8sjtqMGkHE01FH0= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:40ee:bae0:a4fd:c75b]) (user=saravanak job=sendgmr) by 2002:a5b:502:0:b0:66e:206d:15f6 with SMTP id o2-20020a5b0502000000b0066e206d15f6mr18796823ybp.160.1658947826888; Wed, 27 Jul 2022 11:50:26 -0700 (PDT) Date: Wed, 27 Jul 2022 11:50:11 -0700 In-Reply-To: <20220727185012.3255200-1-saravanak@google.com> Message-Id: <20220727185012.3255200-4-saravanak@google.com> Mime-Version: 1.0 References: <20220727185012.3255200-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [PATCH v1 3/3] Revert "PM: domains: Delete usage of driver_deferred_probe_check_state()" From: Saravana Kannan To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Saravana Kannan , naresh.kamboju@linaro.org, kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This reverts commit 5a46079a96451cfb15e4f5f01f73f7ba24ef851a. There are a few more issues to fix that have been reported in the thread for the original series [1]. We'll need to fix those before this will work. So, revert it for now. [1] - https://lore.kernel.org/lkml/20220601070707.3946847-1-saravanak@google.com/ Signed-off-by: Saravana Kannan Acked-by: Ulf Hansson Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren --- 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 3e86772d5fac..739e52cd4aba 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 -ENODEV; + return driver_deferred_probe_check_state(base_dev); } dev_dbg(dev, "adding to PM domain %s\n", pd->name);