From patchwork Fri Aug 19 22:16: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: 598865 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 971D7C32771 for ; Fri, 19 Aug 2022 22:16:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239794AbiHSWQb (ORCPT ); Fri, 19 Aug 2022 18:16:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239636AbiHSWQZ (ORCPT ); Fri, 19 Aug 2022 18:16:25 -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 20F7ABD28F for ; Fri, 19 Aug 2022 15:16:23 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id ng1-20020a17090b1a8100b001f4f9f69d48so5497300pjb.4 for ; Fri, 19 Aug 2022 15:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=BQSSVea5wmDrGG7Dc55xjQCbKa6Vwa11xoA5juoPq98=; b=m/w4VOnW+B6hFTGwigf+fYXoDEJW13olaVPFGBtgeL1hEtlqKKVCxTfQ9m5XcRiaIP 1rU1aOfA4hVzZN4ktFIgo02PwC457k0BiPqJAjQdBCLECZTjC3N0U+rJNb1RA5Xy5rB1 SRMGYHo9B4A05CZ4wmE6tAPMFVNFuEkTFRv9ORDih1ztXI17gefsQR8Hp4GMgh0/dFjI 45riHlDzcS/a1UF2P4EZRRNUrkaYCrC6DCKrVYRPbqbCEsuAoKVcYY5ez6bS/f6tgOoY DW8w+AJN+ksKbDtbDBbKnGOuwE6Vk9iibf6y0FMmZflAss8jby5psI/la1+FUIZ/hAMi gf/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=BQSSVea5wmDrGG7Dc55xjQCbKa6Vwa11xoA5juoPq98=; b=egZIzEeE90vVHi9odCwLhcfF0DUDFLvfCm+KrSvKH3AI6OdDv8QqV5FZ4mriwMbIW2 oik9jaAS3Wlbd0ATyHYLomkZG6Bzp5+qhg9a75NCTxrxXltJx5OA2+pYuX298uYk5m0Y XV4fTHM2ldI0FyImcsK/XTLzr6fVqW3f2wSEdqnvLOoiUpeLX0j1RuT7Vj123Q/wxsDB ER8mO/gv8y0/HeqfL2nNFcquVsgeZvcmMwNxCu3LMOdxICqaH4e7DAvC6sD+ZbaEKMI6 006Rj/U9htc0nJ2tBPzboItqANT5H38g+Cb58DxLqPw0gtqkvE/b+LlnNYaVOE+PqGeE efvg== X-Gm-Message-State: ACgBeo0e2nQXWQpwZ/gtwPLHT/+Hpm0RGfgYE4oCTaX61NhwgBYizahV 2y8ARvyMVVZH9KPD/J/9+INipJLoPPWBjSQ= X-Google-Smtp-Source: AA6agR7xwTgSkhZeDgc7JiOTwdyn5CbJ3ZccHxXmsRpvvOVKOPZZvDSX+KrQWlDF+37Zyf2SqjoLeOhqTbYapE0= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:f93e:7b61:ce3d:5b06]) (user=saravanak job=sendgmr) by 2002:a17:902:720c:b0:172:a1ff:8c21 with SMTP id ba12-20020a170902720c00b00172a1ff8c21mr9292292plb.159.1660947382648; Fri, 19 Aug 2022 15:16:22 -0700 (PDT) Date: Fri, 19 Aug 2022 15:16:11 -0700 In-Reply-To: <20220819221616.2107893-1-saravanak@google.com> Message-Id: <20220819221616.2107893-2-saravanak@google.com> Mime-Version: 1.0 References: <20220819221616.2107893-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v2 1/4] 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 , Joerg Roedel , Will Deacon , Robin Murphy , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Saravana Kannan Cc: Peng Fan , Luca Weiss , Doug Anderson , Colin Foster , Tony Lindgren , Alexander Stein , Naresh Kamboju , Geert Uytterhoeven , Jean-Philippe Brucker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux.dev, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/ Fixes: 9cbffc7a5956 ("driver core: Delete driver_deferred_probe_check_state()") Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren Signed-off-by: Saravana Kannan Tested-by: Douglas Anderson Tested-by: Peng Fan --- 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 Fri Aug 19 22:16:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 598717 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 36326C32773 for ; Fri, 19 Aug 2022 22:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbiHSWQe (ORCPT ); Fri, 19 Aug 2022 18:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232131AbiHSWQb (ORCPT ); Fri, 19 Aug 2022 18:16:31 -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 A6ED3C0B67 for ; Fri, 19 Aug 2022 15:16:26 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-3359a55dcb6so98091797b3.21 for ; Fri, 19 Aug 2022 15:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=UEHQVTWtY0L8HbB+rn9ayHruCFvSoeqhTJ8tjVlmltk=; b=G2nd61G3YUXzDJ7SOy7p3Qqr78Kti/oBcRHEJCvFPJ3XR67+EfeAz3oL+KH6MiVRbY tLUHabNGnrIIu/MfxR4qQjPz24fIMblKNFZui8waxypli1TuNkLNz+vRl9fxaPQ0Z2mZ kotKh+3b3CwBEck2dyzgBfVi+g1q/BV2925Smv0NJgFjQxyQE1jla7m1Qc6Nu/f/+dEa 628Q1guJzowvfMIdGpOI1HmNMERryzw6kIihBEIUyZFMUi0tR+z6oh4WLK5HxmENqGNM cZ0WdQebFYvYsjOqxNxer8SRsCzQkHMxVRG88otL5Sve16E+Z/V+pPWfso0/qJYZNTy7 SFXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=UEHQVTWtY0L8HbB+rn9ayHruCFvSoeqhTJ8tjVlmltk=; b=P7GWuqE6ncThKR0ZDw6izvJiaOXSFxaeRlzLDxos+iM1TKf10mP5rBXMroGoevHOv6 Qraheuv51vNv/RYOoDqDqmTV/C1U2yzbEEn1sQ7UNnnHF3MDDSajMa2yoh3TJhlheBcf MBxcP2tvkiP2QZQE4Rq8valj+029rIffFhhWd+Uj9f6XBlo/6/L0n/lgWw4Wl+oW+wgC 8GPcz3Ba7LHZEWkvQATbHpa6RPmiLLbPM/f8FcY1+gEiBB1psc1bHwxzaYlTCzmJaLOL 5viUK0mByt1r0soG3RiKhaSRAFtQ5h1s1k/405Nd7VJm6OGZHjZm2Wal6IIL8ERbgYfa rEuA== X-Gm-Message-State: ACgBeo3oPhfqzO90RU3rGFSeHwwQkt7CNiU7Nrj43JCWPQeor5jaDWn4 J4aG4ESNiOlipiGMtUjmuCV54WTwEYRvGf8= X-Google-Smtp-Source: AA6agR638n52xQqz9XIsj65fwvEuV9sSup7NrBB1J1/XruxyVUcUJ+K5sX7kFFdZ7d5G3+DvuVzyrAmwjsqUwv8= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:f93e:7b61:ce3d:5b06]) (user=saravanak job=sendgmr) by 2002:a81:83c5:0:b0:334:a89b:1e5d with SMTP id t188-20020a8183c5000000b00334a89b1e5dmr9134295ywf.178.1660947385806; Fri, 19 Aug 2022 15:16:25 -0700 (PDT) Date: Fri, 19 Aug 2022 15:16:12 -0700 In-Reply-To: <20220819221616.2107893-1-saravanak@google.com> Message-Id: <20220819221616.2107893-3-saravanak@google.com> Mime-Version: 1.0 References: <20220819221616.2107893-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v2 2/4] 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 , Joerg Roedel , Will Deacon , Robin Murphy , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Saravana Kannan Cc: Peng Fan , Luca Weiss , Doug Anderson , Colin Foster , Tony Lindgren , Alexander Stein , Naresh Kamboju , Geert Uytterhoeven , Jean-Philippe Brucker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux.dev, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.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/CAMuHMdWo_wRwV-i_iyTxVnEsf3Th9GBAG+wxUQMQGnw1t2ijTg@mail.gmail.com/ Fixes: f8217275b57a ("net: mdio: Delete usage of driver_deferred_probe_check_state()") Reviewed-by: Tony Lindgren Reported-by: Geert Uytterhoeven Signed-off-by: Saravana Kannan --- 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 Fri Aug 19 22:16:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 598864 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 EB6BDC32771 for ; Fri, 19 Aug 2022 22:16:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239270AbiHSWQo (ORCPT ); Fri, 19 Aug 2022 18:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239966AbiHSWQe (ORCPT ); Fri, 19 Aug 2022 18:16:34 -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 CEBE3D83F9 for ; Fri, 19 Aug 2022 15:16:29 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-334f49979a0so98515557b3.10 for ; Fri, 19 Aug 2022 15:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=23aDVj4LlbfPkoiXqxbD0E4C7v4CoYUgh/84jy41NX0=; b=RfDBUV4Eoi6hUFddi87J/g/A5JBzLloY2dSMy9AH8SPOKlZLXQ//QBrA4oxiIqSu4a SIOdoHuaxKNOVbAJ7rfbvgzZsRd+lMbYJfODtYvKx4yHXzvVcTpentmBP17iRir2X+Q8 FlckrSbhp4QISwdxhNXl36Ack8Ob/HkJo70k1gEcoGu4PVUev58lHdvwI4FChXgTC+y5 LTE5zMaLdxyeGDcqGVqt2VvayphFlXKnYAmdOu8lbSbVtxx9pUAZ8nNJz8tK4YyOkHI/ BohL+A06pQKGtVKh3c7R1TalLS7V2CuJgo894FA5LRde++POf9XldtYkSnPPXVrKJnl3 5KPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=23aDVj4LlbfPkoiXqxbD0E4C7v4CoYUgh/84jy41NX0=; b=tVMm9GYAPntf7Ic8PGNN8IOpxCJ3SwgqkTOXq6KxxJWXJm5C9YxiqalhjEYj5CNzp4 eM+/lmnOPdERVDYJSle1I9mVxe82+8Pd8nClw1AZOSgrEkRLATZwnbnpbbCRy5nDLzk8 Yyv9QiWNIkfChcj8X6lR9ywqAAZazKZqdm5k2iGHQReyDRb6gzXDj69qVidbnfp8nHZC yKlMB4KLzNiyNR/xmZAyqQQkdn8epQzeEkesB+p3Rf/3gk5BCHVbK7Cv6/Vr4Ld2y/UY 63VT7lNrDGwhoGt2tNtoLKf+NOSU+NAhmwydMMNiP9olEWP9F9CIx9QdvJdri8Yi1M1f Sxgw== X-Gm-Message-State: ACgBeo1bi3NkbTlLjRg7KIInSOONwetzyScZs9svMDmzlUeqez3iYpqk cJUSp/5qMkykomdoDXd7Mu6CKQuuCgrHUMc= X-Google-Smtp-Source: AA6agR6A+xqItbXSEK4uHJ0mFi1QE/So6yke4k7KdQfN6tbP1gpuJnanRFbNSnpcIO10ajqPyRqVifalVRrScOo= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:f93e:7b61:ce3d:5b06]) (user=saravanak job=sendgmr) by 2002:a25:bc52:0:b0:67e:e3c:1453 with SMTP id d18-20020a25bc52000000b0067e0e3c1453mr9778933ybk.121.1660947388574; Fri, 19 Aug 2022 15:16:28 -0700 (PDT) Date: Fri, 19 Aug 2022 15:16:13 -0700 In-Reply-To: <20220819221616.2107893-1-saravanak@google.com> Message-Id: <20220819221616.2107893-4-saravanak@google.com> Mime-Version: 1.0 References: <20220819221616.2107893-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v2 3/4] 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 , Joerg Roedel , Will Deacon , Robin Murphy , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Saravana Kannan Cc: Peng Fan , Luca Weiss , Doug Anderson , Colin Foster , Tony Lindgren , Alexander Stein , Naresh Kamboju , Geert Uytterhoeven , Jean-Philippe Brucker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux.dev, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This reverts commit 5a46079a96451cfb15e4f5f01f73f7ba24ef851a. Quite a few issues have been reported [1][2][3][4][5][6] on the original commit. While about half of them have been fixed, I'll need to fix the rest before driver_deferred_probe_check_state() can be deleted. So, revert the deletion for now. [1] - https://lore.kernel.org/all/DU0PR04MB941735271F45C716342D0410886B9@DU0PR04MB9417.eurprd04.prod.outlook.com/ [2] - https://lore.kernel.org/all/CM6REZS9Z8AC.2KCR9N3EFLNQR@otso/ [3] - https://lore.kernel.org/all/CAD=FV=XYVwaXZxqUKAuM5c7NiVjFz5C6m6gAHSJ7rBXBF94_Tg@mail.gmail.com/ [4] - https://lore.kernel.org/all/Yvpd2pwUJGp7R+YE@euler/ [5] - https://lore.kernel.org/lkml/20220601070707.3946847-2-saravanak@google.com/ [6] - https://lore.kernel.org/all/CA+G9fYt_cc5SiNv1Vbse=HYY_+uc+9OYPZuJ-x59bROSaLN6fw@mail.gmail.com/ Fixes: 5a46079a9645 ("PM: domains: Delete usage of driver_deferred_probe_check_state()") Reported-by: Peng Fan Reported-by: Luca Weiss Reported-by: Doug Anderson Reported-by: Colin Foster Reported-by: Tony Lindgren Reported-by: Alexander Stein Reported-by: Naresh Kamboju Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren Signed-off-by: Saravana Kannan Tested-by: Douglas Anderson Tested-by: Peng Fan Tested-by: Martin Kepplinger --- 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 5a2e0232862e..55a10e6d4e2a 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2733,7 +2733,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); From patchwork Fri Aug 19 22:16:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 598716 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 DCCEBC32773 for ; Fri, 19 Aug 2022 22:17:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240381AbiHSWRC (ORCPT ); Fri, 19 Aug 2022 18:17:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240176AbiHSWQe (ORCPT ); Fri, 19 Aug 2022 18:16:34 -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 AD640F2424 for ; Fri, 19 Aug 2022 15:16:31 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-334d894afd8so97428297b3.19 for ; Fri, 19 Aug 2022 15:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=H3YEiHHCZDHfvJiU4fCYVtnbVB8iHyjPM7ELjaj28Ew=; b=X1U73b0XniNLU7Z952Uoe4oLLlOQuH9fMoxIo3YE8wTvISBipZU3kbSsA/PpZc74b9 GKGrN3RRsS65zQ/iiGgHDkFgLoHu+HT15JxvGOx9hJ2PV56mfIi6fXTua6T4tCzBZCDs pidzBZcxXFnAUE6H041z//D5yM40NWB78f6EufBqHmtQf2Fy2jYoy7SMHxtXqD8J18Jl tglJU4xpK/iRl2mW5tY+0pgOj4nH9Bx5lesRwnijThCj0o6tZ7h84PrI8aDfHNjuuotw 33+iubcVMVmM0KnScNcfs0uK//EhpI5sVYu65TPan5KCq2k7mlKkYFPNxSojzIFEnPuE wSnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=H3YEiHHCZDHfvJiU4fCYVtnbVB8iHyjPM7ELjaj28Ew=; b=7sJgwYK6TFVRyx50FBhzEETqUXmTaBjCvJn9r6DjfQD/rTnAe03K7iK5S00WjRMuIX LAyVIQd46RRZEOv7y1dhnkClCMbhSHNXBt5AZtgL33gigvWWaHGCZMsxiFEoyvYYlWR1 DTQ96OAcB33mjAvOymgeUgjQXh2wrkmOlWavbOjx5JSEZSONejrS92KTMrt+bokbOTgL CeR707IPAF1liqk6WPfTMcGtVrckHlFrN1jaqKtP/qOe2zpznhwZ89+8cxj9PPfjEOr3 +lkMTFzuKHN+KZSYrcBK85kludT/o35XkbD9oLeUhU8L2KwCqko2z4AV4kN13PAfGfkR F/yQ== X-Gm-Message-State: ACgBeo09/7zKZS4epSOsE3z74nuhPrMkedj4/MysYMUohr5UMIYBRKG+ BO2cjLOC7jtxY/wSD2eNkY6tkbCfvwElsMI= X-Google-Smtp-Source: AA6agR6s7O9ks9P+6MMRLsKupYiohHddIyehPE2rdJmt/AJwJ41rH2q/2hZo31rpF1++hMgFEDboETrWBMyKu5U= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:f93e:7b61:ce3d:5b06]) (user=saravanak job=sendgmr) by 2002:a81:5744:0:b0:333:7505:5bca with SMTP id l65-20020a815744000000b0033375055bcamr9459605ywb.315.1660947391375; Fri, 19 Aug 2022 15:16:31 -0700 (PDT) Date: Fri, 19 Aug 2022 15:16:14 -0700 In-Reply-To: <20220819221616.2107893-1-saravanak@google.com> Message-Id: <20220819221616.2107893-5-saravanak@google.com> Mime-Version: 1.0 References: <20220819221616.2107893-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v2 4/4] Revert "iommu/of: 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 , Joerg Roedel , Will Deacon , Robin Murphy , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Saravana Kannan Cc: Peng Fan , Luca Weiss , Doug Anderson , Colin Foster , Tony Lindgren , Alexander Stein , Naresh Kamboju , Geert Uytterhoeven , Jean-Philippe Brucker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux.dev, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This reverts commit b09796d528bbf06e3e10a4a8f78038719da7ebc6. An issue was reported[1] on the original commit. I'll need to address that before I can delete the use of driver_deferred_probe_check_state(). So, bring it back for now. [1] - https://lore.kernel.org/lkml/4799738.LvFx2qVVIh@steina-w/ Fixes: b09796d528bb ("iommu/of: Delete usage of driver_deferred_probe_check_state()") Reported-by: Jean-Philippe Brucker Signed-off-by: Saravana Kannan Tested-by: Jean-Philippe Brucker --- 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 41f4eb005219..5696314ae69e 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 -ENODEV; + return driver_deferred_probe_check_state(dev); if (!try_module_get(ops->owner)) return -ENODEV;