diff mbox series

[v2,3/4] Revert "PM: domains: Delete usage of driver_deferred_probe_check_state()"

Message ID 20220819221616.2107893-4-saravanak@google.com
State Accepted
Commit e20813dcdc05aa295ef586b518142d0fab4c5692
Headers show
Series Bring back driver_deferred_probe_check_state() for now | expand

Commit Message

Saravana Kannan Aug. 19, 2022, 10:16 p.m. UTC
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 <peng.fan@nxp.com>
Reported-by: Luca Weiss <luca.weiss@fairphone.com>
Reported-by: Doug Anderson <dianders@chromium.org>
Reported-by: Colin Foster <colin.foster@in-advantage.com>
Reported-by: Tony Lindgren <tony@atomide.com>
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 drivers/base/power/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Doug Anderson Aug. 22, 2022, 8:31 p.m. UTC | #1
Hi,

On Fri, Aug 19, 2022 at 3:16 PM Saravana Kannan <saravanak@google.com> wrote:
>
> 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 <peng.fan@nxp.com>
> Reported-by: Luca Weiss <luca.weiss@fairphone.com>
> Reported-by: Doug Anderson <dianders@chromium.org>
> Reported-by: Colin Foster <colin.foster@in-advantage.com>
> Reported-by: Tony Lindgren <tony@atomide.com>
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
>  drivers/base/power/domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Douglas Anderson <dianders@chromium.org>
Peng Fan Aug. 23, 2022, 9:02 a.m. UTC | #2
> Subject: [PATCH v2 3/4] Revert "PM: domains: Delete usage of
> driver_deferred_probe_check_state()"
> 
> 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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Fall%2FDU0PR04MB941735271F45C716342D0410886B9%40DU
> 0PR04MB9417.eurprd04.prod.outlook.com%2F&amp;data=05%7C01%7Cpe
> ng.fan%40nxp.com%7Ce5c97577ea9c4d34e28008da8230773f%7C686ea1d3
> bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637965441917494552%7CUnkno
> wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1
> haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=py122mCaQjLc7
> xFhApk61Zh9Hthol6tmprh5KDsOXqU%3D&amp;reserved=0
> [2] -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Fall%2FCM6REZS9Z8AC.2KCR9N3EFLNQR%40otso%2F&amp;dat
> a=05%7C01%7Cpeng.fan%40nxp.com%7Ce5c97577ea9c4d34e28008da8230
> 773f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637965441917
> 494552%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV
> 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdat
> a=DYZ3eCmUPryFcqhgtexUZT1gYuL1utBgHrw%2BIH6apdk%3D&amp;reserv
> ed=0
> [3] -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Fall%2FCAD%3DFV%3DXYVwaXZxqUKAuM5c7NiVjFz5C6m6gAH
> SJ7rBXBF94_Tg%40mail.gmail.com%2F&amp;data=05%7C01%7Cpeng.fan%4
> 0nxp.com%7Ce5c97577ea9c4d34e28008da8230773f%7C686ea1d3bc2b4c6fa
> 92cd99c5c301635%7C0%7C0%7C637965441917494552%7CUnknown%7CTW
> FpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJX
> VCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MesNMmK2dr%2BkEZQ9fE
> BzFWgZhx9PWRQSk3U7zqcRaZo%3D&amp;reserved=0
> [4] -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Fall%2FYvpd2pwUJGp7R%2BYE%40euler%2F&amp;data=05%7
> C01%7Cpeng.fan%40nxp.com%7Ce5c97577ea9c4d34e28008da8230773f%7C
> 686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637965441917494552%
> 7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLC
> JBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=31VDc
> KodaAH9dOYDnN%2BcJ1LhhAbyEQc8fYX743f8MY8%3D&amp;reserved=0
> [5] -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Flkml%2F20220601070707.3946847-2-
> saravanak%40google.com%2F&amp;data=05%7C01%7Cpeng.fan%40nxp.co
> m%7Ce5c97577ea9c4d34e28008da8230773f%7C686ea1d3bc2b4c6fa92cd99
> c5c301635%7C0%7C0%7C637965441917494552%7CUnknown%7CTWFpbGZs
> b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M
> n0%3D%7C3000%7C%7C%7C&amp;sdata=eE20zTJ7rKVTY1b0%2F4Pgp8sOx7
> zVTLnSIFsG%2FepL9Lo%3D&amp;reserved=0
> [6] -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Fall%2FCA%2BG9fYt_cc5SiNv1Vbse%3DHYY_%2Buc%2B9OYPZu
> J-
> x59bROSaLN6fw%40mail.gmail.com%2F&amp;data=05%7C01%7Cpeng.fan%
> 40nxp.com%7Ce5c97577ea9c4d34e28008da8230773f%7C686ea1d3bc2b4c6f
> a92cd99c5c301635%7C0%7C0%7C637965441917494552%7CUnknown%7CT
> WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL
> CJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=nYfyk%2FlEwmYsH%2F
> U028t8tnFjpnTZ7G8ffHgyLBZ4Czo%3D&amp;reserved=0
> 
> Fixes: 5a46079a9645 ("PM: domains: Delete usage of
> driver_deferred_probe_check_state()")
> Reported-by: Peng Fan <peng.fan@nxp.com>
> Reported-by: Luca Weiss <luca.weiss@fairphone.com>
> Reported-by: Doug Anderson <dianders@chromium.org>
> Reported-by: Colin Foster <colin.foster@in-advantage.com>
> Reported-by: Tony Lindgren <tony@atomide.com>
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Saravana Kannan <saravanak@google.com>

Tested-by: Peng Fan <peng.fan@nxp.com>
> ---
>  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);
> --
> 2.37.1.595.g718a3a8f04-goog
Martin Kepplinger Aug. 25, 2022, 6:57 a.m. UTC | #3
Am Freitag, dem 19.08.2022 um 15:16 -0700 schrieb Saravana Kannan:
> 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 <peng.fan@nxp.com>
> Reported-by: Luca Weiss <luca.weiss@fairphone.com>
> Reported-by: Doug Anderson <dianders@chromium.org>
> Reported-by: Colin Foster <colin.foster@in-advantage.com>
> Reported-by: Tony Lindgren <tony@atomide.com>
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
>  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);

Fixes imx8mq where ENODEV results in:
[    1.048019] imx8m-blk-ctrl 38320000.blk-ctrl: error -ENODEV: failed
to attach power domain "bus"


Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>

thanks for fixing this,

                                martin
diff mbox series

Patch

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);