* [PATCH] serial: imx: Add missing .thaw_noirq hook
@ 2022-10-12 12:13 Shawn Guo
2022-10-12 15:49 ` Martin Kaiser
2022-10-12 16:20 ` Greg Kroah-Hartman
0 siblings, 2 replies; 4+ messages in thread
From: Shawn Guo @ 2022-10-12 12:13 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby
Cc: Martin Kaiser, Pengutronix Kernel Team, NXP Linux Team,
linux-serial, linux-arm-kernel, linux-kernel, Shawn Guo
The following warning is seen with non-console UART instance when
system hibernates.
[ 37.371969] ------------[ cut here ]------------
[ 37.376599] uart3_root_clk already disabled
[ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0
...
[ 37.506986] Call trace:
[ 37.509432] clk_core_disable+0xa4/0xb0
[ 37.513270] clk_disable+0x34/0x50
[ 37.516672] imx_uart_thaw+0x38/0x5c
[ 37.520250] platform_pm_thaw+0x30/0x6c
[ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4
[ 37.528972] device_resume+0x7c/0x160
[ 37.532633] dpm_resume+0xe8/0x230
[ 37.536036] hibernation_snapshot+0x288/0x430
[ 37.540397] hibernate+0x10c/0x2e0
[ 37.543798] state_store+0xc4/0xd0
[ 37.547203] kobj_attr_store+0x1c/0x30
[ 37.550953] sysfs_kf_write+0x48/0x60
[ 37.554619] kernfs_fop_write_iter+0x118/0x1ac
[ 37.559063] new_sync_write+0xe8/0x184
[ 37.562812] vfs_write+0x230/0x290
[ 37.566214] ksys_write+0x68/0xf4
[ 37.569529] __arm64_sys_write+0x20/0x2c
[ 37.573452] invoke_syscall.constprop.0+0x50/0xf0
[ 37.578156] do_el0_svc+0x11c/0x150
[ 37.581648] el0_svc+0x30/0x140
[ 37.584792] el0t_64_sync_handler+0xe8/0xf0
[ 37.588976] el0t_64_sync+0x1a0/0x1a4
[ 37.592639] ---[ end trace 56e22eec54676d75 ]---
On hibernating, pm core calls into related hooks in sequence like:
.freeze
.freeze_noirq
.thaw_noirq
.thaw
With .thaw_noirq hook being absent, the clock will be disabled in a
unbalanced call which results the warning above.
imx_uart_freeze()
clk_prepare_enable()
imx_uart_suspend_noirq()
clk_disable()
imx_uart_thaw
clk_disable_unprepare()
Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have
the call sequence corrected as below and thus fix the warning.
imx_uart_freeze()
clk_prepare_enable()
imx_uart_suspend_noirq()
clk_disable()
imx_uart_resume_noirq()
clk_enable()
imx_uart_thaw
clk_disable_unprepare()
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/tty/serial/imx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 590a25369531..e5163c2c4169 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2603,6 +2603,7 @@ static const struct dev_pm_ops imx_uart_pm_ops = {
.suspend_noirq = imx_uart_suspend_noirq,
.resume_noirq = imx_uart_resume_noirq,
.freeze_noirq = imx_uart_suspend_noirq,
+ .thaw_noirq = imx_uart_resume_noirq,
.restore_noirq = imx_uart_resume_noirq,
.suspend = imx_uart_suspend,
.resume = imx_uart_resume,
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: imx: Add missing .thaw_noirq hook
2022-10-12 12:13 [PATCH] serial: imx: Add missing .thaw_noirq hook Shawn Guo
@ 2022-10-12 15:49 ` Martin Kaiser
2022-10-12 16:20 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Martin Kaiser @ 2022-10-12 15:49 UTC (permalink / raw)
To: Shawn Guo
Cc: Greg Kroah-Hartman, Jiri Slaby, Pengutronix Kernel Team,
NXP Linux Team, linux-serial, linux-arm-kernel, linux-kernel
Thus wrote Shawn Guo (shawn.guo@linaro.org):
> The following warning is seen with non-console UART instance when
> system hibernates.
> [ 37.371969] ------------[ cut here ]------------
> [ 37.376599] uart3_root_clk already disabled
> [ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0
> ...
> [ 37.506986] Call trace:
> [ 37.509432] clk_core_disable+0xa4/0xb0
> [ 37.513270] clk_disable+0x34/0x50
> [ 37.516672] imx_uart_thaw+0x38/0x5c
> [ 37.520250] platform_pm_thaw+0x30/0x6c
> [ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4
> [ 37.528972] device_resume+0x7c/0x160
> [ 37.532633] dpm_resume+0xe8/0x230
> [ 37.536036] hibernation_snapshot+0x288/0x430
> [ 37.540397] hibernate+0x10c/0x2e0
> [ 37.543798] state_store+0xc4/0xd0
> [ 37.547203] kobj_attr_store+0x1c/0x30
> [ 37.550953] sysfs_kf_write+0x48/0x60
> [ 37.554619] kernfs_fop_write_iter+0x118/0x1ac
> [ 37.559063] new_sync_write+0xe8/0x184
> [ 37.562812] vfs_write+0x230/0x290
> [ 37.566214] ksys_write+0x68/0xf4
> [ 37.569529] __arm64_sys_write+0x20/0x2c
> [ 37.573452] invoke_syscall.constprop.0+0x50/0xf0
> [ 37.578156] do_el0_svc+0x11c/0x150
> [ 37.581648] el0_svc+0x30/0x140
> [ 37.584792] el0t_64_sync_handler+0xe8/0xf0
> [ 37.588976] el0t_64_sync+0x1a0/0x1a4
> [ 37.592639] ---[ end trace 56e22eec54676d75 ]---
> On hibernating, pm core calls into related hooks in sequence like:
> .freeze
> .freeze_noirq
> .thaw_noirq
> .thaw
> With .thaw_noirq hook being absent, the clock will be disabled in a
> unbalanced call which results the warning above.
> imx_uart_freeze()
> clk_prepare_enable()
> imx_uart_suspend_noirq()
> clk_disable()
> imx_uart_thaw
> clk_disable_unprepare()
> Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have
> the call sequence corrected as below and thus fix the warning.
> imx_uart_freeze()
> clk_prepare_enable()
> imx_uart_suspend_noirq()
> clk_disable()
> imx_uart_resume_noirq()
> clk_enable()
> imx_uart_thaw
> clk_disable_unprepare()
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/tty/serial/imx.c | 1 +
> 1 file changed, 1 insertion(+)
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 590a25369531..e5163c2c4169 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -2603,6 +2603,7 @@ static const struct dev_pm_ops imx_uart_pm_ops = {
> .suspend_noirq = imx_uart_suspend_noirq,
> .resume_noirq = imx_uart_resume_noirq,
> .freeze_noirq = imx_uart_suspend_noirq,
> + .thaw_noirq = imx_uart_resume_noirq,
> .restore_noirq = imx_uart_resume_noirq,
> .suspend = imx_uart_suspend,
> .resume = imx_uart_resume,
> --
> 2.25.1
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Thanks,
Martin
_______________________________________________
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] serial: imx: Add missing .thaw_noirq hook
2022-10-12 12:13 [PATCH] serial: imx: Add missing .thaw_noirq hook Shawn Guo
2022-10-12 15:49 ` Martin Kaiser
@ 2022-10-12 16:20 ` Greg Kroah-Hartman
2022-10-13 1:31 ` Shawn Guo
1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2022-10-12 16:20 UTC (permalink / raw)
To: Shawn Guo
Cc: Jiri Slaby, Martin Kaiser, Pengutronix Kernel Team,
NXP Linux Team, linux-serial, linux-arm-kernel, linux-kernel
On Wed, Oct 12, 2022 at 08:13:53PM +0800, Shawn Guo wrote:
> The following warning is seen with non-console UART instance when
> system hibernates.
>
> [ 37.371969] ------------[ cut here ]------------
> [ 37.376599] uart3_root_clk already disabled
> [ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0
> ...
> [ 37.506986] Call trace:
> [ 37.509432] clk_core_disable+0xa4/0xb0
> [ 37.513270] clk_disable+0x34/0x50
> [ 37.516672] imx_uart_thaw+0x38/0x5c
> [ 37.520250] platform_pm_thaw+0x30/0x6c
> [ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4
> [ 37.528972] device_resume+0x7c/0x160
> [ 37.532633] dpm_resume+0xe8/0x230
> [ 37.536036] hibernation_snapshot+0x288/0x430
> [ 37.540397] hibernate+0x10c/0x2e0
> [ 37.543798] state_store+0xc4/0xd0
> [ 37.547203] kobj_attr_store+0x1c/0x30
> [ 37.550953] sysfs_kf_write+0x48/0x60
> [ 37.554619] kernfs_fop_write_iter+0x118/0x1ac
> [ 37.559063] new_sync_write+0xe8/0x184
> [ 37.562812] vfs_write+0x230/0x290
> [ 37.566214] ksys_write+0x68/0xf4
> [ 37.569529] __arm64_sys_write+0x20/0x2c
> [ 37.573452] invoke_syscall.constprop.0+0x50/0xf0
> [ 37.578156] do_el0_svc+0x11c/0x150
> [ 37.581648] el0_svc+0x30/0x140
> [ 37.584792] el0t_64_sync_handler+0xe8/0xf0
> [ 37.588976] el0t_64_sync+0x1a0/0x1a4
> [ 37.592639] ---[ end trace 56e22eec54676d75 ]---
>
> On hibernating, pm core calls into related hooks in sequence like:
>
> .freeze
> .freeze_noirq
> .thaw_noirq
> .thaw
>
> With .thaw_noirq hook being absent, the clock will be disabled in a
> unbalanced call which results the warning above.
>
> imx_uart_freeze()
> clk_prepare_enable()
> imx_uart_suspend_noirq()
> clk_disable()
> imx_uart_thaw
> clk_disable_unprepare()
>
> Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have
> the call sequence corrected as below and thus fix the warning.
>
> imx_uart_freeze()
> clk_prepare_enable()
> imx_uart_suspend_noirq()
> clk_disable()
> imx_uart_resume_noirq()
> clk_enable()
> imx_uart_thaw
> clk_disable_unprepare()
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
What commit id does this fix, and does it need to go to older/stable
kernels?
thanks,
greg k-h
_______________________________________________
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] serial: imx: Add missing .thaw_noirq hook
2022-10-12 16:20 ` Greg Kroah-Hartman
@ 2022-10-13 1:31 ` Shawn Guo
0 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2022-10-13 1:31 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jiri Slaby, Martin Kaiser, Pengutronix Kernel Team,
NXP Linux Team, linux-serial, linux-arm-kernel, linux-kernel
On Wed, Oct 12, 2022 at 06:20:35PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Oct 12, 2022 at 08:13:53PM +0800, Shawn Guo wrote:
> > The following warning is seen with non-console UART instance when
> > system hibernates.
> >
> > [ 37.371969] ------------[ cut here ]------------
> > [ 37.376599] uart3_root_clk already disabled
> > [ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0
> > ...
> > [ 37.506986] Call trace:
> > [ 37.509432] clk_core_disable+0xa4/0xb0
> > [ 37.513270] clk_disable+0x34/0x50
> > [ 37.516672] imx_uart_thaw+0x38/0x5c
> > [ 37.520250] platform_pm_thaw+0x30/0x6c
> > [ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4
> > [ 37.528972] device_resume+0x7c/0x160
> > [ 37.532633] dpm_resume+0xe8/0x230
> > [ 37.536036] hibernation_snapshot+0x288/0x430
> > [ 37.540397] hibernate+0x10c/0x2e0
> > [ 37.543798] state_store+0xc4/0xd0
> > [ 37.547203] kobj_attr_store+0x1c/0x30
> > [ 37.550953] sysfs_kf_write+0x48/0x60
> > [ 37.554619] kernfs_fop_write_iter+0x118/0x1ac
> > [ 37.559063] new_sync_write+0xe8/0x184
> > [ 37.562812] vfs_write+0x230/0x290
> > [ 37.566214] ksys_write+0x68/0xf4
> > [ 37.569529] __arm64_sys_write+0x20/0x2c
> > [ 37.573452] invoke_syscall.constprop.0+0x50/0xf0
> > [ 37.578156] do_el0_svc+0x11c/0x150
> > [ 37.581648] el0_svc+0x30/0x140
> > [ 37.584792] el0t_64_sync_handler+0xe8/0xf0
> > [ 37.588976] el0t_64_sync+0x1a0/0x1a4
> > [ 37.592639] ---[ end trace 56e22eec54676d75 ]---
> >
> > On hibernating, pm core calls into related hooks in sequence like:
> >
> > .freeze
> > .freeze_noirq
> > .thaw_noirq
> > .thaw
> >
> > With .thaw_noirq hook being absent, the clock will be disabled in a
> > unbalanced call which results the warning above.
> >
> > imx_uart_freeze()
> > clk_prepare_enable()
> > imx_uart_suspend_noirq()
> > clk_disable()
> > imx_uart_thaw
> > clk_disable_unprepare()
> >
> > Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have
> > the call sequence corrected as below and thus fix the warning.
> >
> > imx_uart_freeze()
> > clk_prepare_enable()
> > imx_uart_suspend_noirq()
> > clk_disable()
> > imx_uart_resume_noirq()
> > clk_enable()
> > imx_uart_thaw
> > clk_disable_unprepare()
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>
> What commit id does this fix, and does it need to go to older/stable
> kernels?
The .thaw_noirq was missing from commit 94be6d74d040 ("serial: imx: add
hibernation support"), but it did not cause the warning until commit
09df0b3464e5 ("serial: imx: fix endless loop during suspend") changes
clock calls. So I should have added:
Fixes: 09df0b3464e5 ("serial: imx: fix endless loop during suspend")
Shawn
_______________________________________________
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-10-13 1:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 12:13 [PATCH] serial: imx: Add missing .thaw_noirq hook Shawn Guo
2022-10-12 15:49 ` Martin Kaiser
2022-10-12 16:20 ` Greg Kroah-Hartman
2022-10-13 1:31 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).