All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bus: ti-sysc: Fix warnings for unbind for serial
@ 2022-05-12  5:30 ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2022-05-12  5:30 UTC (permalink / raw)
  To: linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Grygorii Strashko,
	Keerthy, Kevin Hilman, Nishanth Menon, linux-kernel,
	linux-arm-kernel, Romain Naour

We can get "failed to disable" clock_unprepare warnings on unbind at least
for the serial console device if the unbind is done before the device has
been idled.

As some devices are using deferred idle, we must check the status for
pending idle work to idle the device.

Cc: Romain Naour <romain.naour@smile.fr>
Fixes: 76f0f772e469 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/bus/ti-sysc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -3395,7 +3395,9 @@ static int sysc_remove(struct platform_device *pdev)
 	struct sysc *ddata = platform_get_drvdata(pdev);
 	int error;
 
-	cancel_delayed_work_sync(&ddata->idle_work);
+	/* Device can still be enabled, see deferred idle quirk in probe */
+	if (cancel_delayed_work_sync(&ddata->idle_work))
+		ti_sysc_idle(&ddata->idle_work.work);
 
 	error = pm_runtime_resume_and_get(ddata->dev);
 	if (error < 0) {
-- 
2.36.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] bus: ti-sysc: Fix warnings for unbind for serial
@ 2022-05-12  5:30 ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2022-05-12  5:30 UTC (permalink / raw)
  To: linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Grygorii Strashko,
	Keerthy, Kevin Hilman, Nishanth Menon, linux-kernel,
	linux-arm-kernel, Romain Naour

We can get "failed to disable" clock_unprepare warnings on unbind at least
for the serial console device if the unbind is done before the device has
been idled.

As some devices are using deferred idle, we must check the status for
pending idle work to idle the device.

Cc: Romain Naour <romain.naour@smile.fr>
Fixes: 76f0f772e469 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/bus/ti-sysc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -3395,7 +3395,9 @@ static int sysc_remove(struct platform_device *pdev)
 	struct sysc *ddata = platform_get_drvdata(pdev);
 	int error;
 
-	cancel_delayed_work_sync(&ddata->idle_work);
+	/* Device can still be enabled, see deferred idle quirk in probe */
+	if (cancel_delayed_work_sync(&ddata->idle_work))
+		ti_sysc_idle(&ddata->idle_work.work);
 
 	error = pm_runtime_resume_and_get(ddata->dev);
 	if (error < 0) {
-- 
2.36.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bus: ti-sysc: Fix warnings for unbind for serial
  2022-05-12  5:30 ` Tony Lindgren
@ 2022-05-13  8:23   ` Romain Naour
  -1 siblings, 0 replies; 4+ messages in thread
From: Romain Naour @ 2022-05-13  8:23 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Grygorii Strashko,
	Keerthy, Kevin Hilman, Nishanth Menon, linux-kernel,
	linux-arm-kernel

Hello,

Le 12/05/2022 à 07:30, Tony Lindgren a écrit :
> We can get "failed to disable" clock_unprepare warnings on unbind at least
> for the serial console device if the unbind is done before the device has
> been idled.
> 
> As some devices are using deferred idle, we must check the status for
> pending idle work to idle the device.

I didn't noticed the "failed to disable" warning so far (kernel 5.10.106 from
ti-linux-kernel repository) but I applied this patch as suggested [1] while
investigating another issue "tty serial 8250 omap driver crash".

Reviewed-by: Romain Naour <romain.naour@smile.fr>

[1] https://marc.info/?l=linux-omap&m=164484408319083&w=2

Best regards,
Romain


> 
> Cc: Romain Naour <romain.naour@smile.fr>
> Fixes: 76f0f772e469 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init")
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/bus/ti-sysc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -3395,7 +3395,9 @@ static int sysc_remove(struct platform_device *pdev)
>  	struct sysc *ddata = platform_get_drvdata(pdev);
>  	int error;
>  
> -	cancel_delayed_work_sync(&ddata->idle_work);
> +	/* Device can still be enabled, see deferred idle quirk in probe */
> +	if (cancel_delayed_work_sync(&ddata->idle_work))
> +		ti_sysc_idle(&ddata->idle_work.work);
>  
>  	error = pm_runtime_resume_and_get(ddata->dev);
>  	if (error < 0) {


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bus: ti-sysc: Fix warnings for unbind for serial
@ 2022-05-13  8:23   ` Romain Naour
  0 siblings, 0 replies; 4+ messages in thread
From: Romain Naour @ 2022-05-13  8:23 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Grygorii Strashko,
	Keerthy, Kevin Hilman, Nishanth Menon, linux-kernel,
	linux-arm-kernel

Hello,

Le 12/05/2022 à 07:30, Tony Lindgren a écrit :
> We can get "failed to disable" clock_unprepare warnings on unbind at least
> for the serial console device if the unbind is done before the device has
> been idled.
> 
> As some devices are using deferred idle, we must check the status for
> pending idle work to idle the device.

I didn't noticed the "failed to disable" warning so far (kernel 5.10.106 from
ti-linux-kernel repository) but I applied this patch as suggested [1] while
investigating another issue "tty serial 8250 omap driver crash".

Reviewed-by: Romain Naour <romain.naour@smile.fr>

[1] https://marc.info/?l=linux-omap&m=164484408319083&w=2

Best regards,
Romain


> 
> Cc: Romain Naour <romain.naour@smile.fr>
> Fixes: 76f0f772e469 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init")
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/bus/ti-sysc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -3395,7 +3395,9 @@ static int sysc_remove(struct platform_device *pdev)
>  	struct sysc *ddata = platform_get_drvdata(pdev);
>  	int error;
>  
> -	cancel_delayed_work_sync(&ddata->idle_work);
> +	/* Device can still be enabled, see deferred idle quirk in probe */
> +	if (cancel_delayed_work_sync(&ddata->idle_work))
> +		ti_sysc_idle(&ddata->idle_work.work);
>  
>  	error = pm_runtime_resume_and_get(ddata->dev);
>  	if (error < 0) {


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-13  8:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12  5:30 [PATCH] bus: ti-sysc: Fix warnings for unbind for serial Tony Lindgren
2022-05-12  5:30 ` Tony Lindgren
2022-05-13  8:23 ` Romain Naour
2022-05-13  8:23   ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.