mailbox: imx: fix suspend failure
PATCH v2 1/1 mailbox: imx: fix suspend failure
imx_mu_isr() always calls pm_system_wakeup() even when it should not, making the system unable to enter sleep.
Suspend fails as follows:
armadillo:~# echo mem > /sys/power/state [ 2614.602432] PM: suspend entry (deep) [ 2614.610640] Filesystems sync: 0.004 seconds [ 2614.618016] Freezing user space processes ... (elapsed 0.001 seconds) done. [ 2614.626555] OOM killer disabled. [ 2614.629792] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 2614.638456] printk: Suspending console(s) (use no_console_suspend to debug) [ 2614.649504] PM: Some devices failed to suspend, or early wake event detected [ 2614.730103] PM: resume devices took 0.080 seconds [ 2614.741924] OOM killer enabled. [ 2614.745073] Restarting tasks ... done. [ 2614.754532] PM: suspend exit ash: write error: Resource busy armadillo:~#
Upstream commit 892cb524ae8a is correct, so this seems to be a mistake during cherry-pick.
--- drivers/mailbox/imx-mailbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mailbox/imx-mailbox.c +4 -4
@@ -331,8 +331,6 @@ static int imx_mu_startup(struct mbox_chan *chan)break ; } - priv->suspend = true; -return 0 ; }
@@ -550,8 +548,6 @@ static int imx_mu_probe(struct platform_device *pdev)clk_disable_unprepare (priv->clk); - priv->suspend = false; -return 0 ; disable_runtime_pm:
@@ -614,6 +610,8 @@ static int __maybe_unused imx_mu_suspend_noirq(struct device *dev)if (!priv->clk) priv->xcr =imx_mu_read (priv, priv->dcfg->xCR); + priv->suspend = true; +return 0 ; }
@@ -632,6 +630,8 @@ static int __maybe_unused imx_mu_resume_noirq(struct device *dev)if (!imx_mu_read (priv, priv->dcfg->xCR) && !priv->clk)imx_mu_write (priv, priv->xcr, priv->dcfg->xCR); + priv->suspend = false; +return 0 ; }
Signature · 1 line
2.30.2
(Added Ccs again - Robin Gong and Jassi Brar both bounced last time so didn't add them back)
Daisuke Mizobuchi wrote on Fri, Apr 12, 2024 at 02:56:48PM +0900:
Quoted 19 lines
imx_mu_isr()always callspm_system_wakeup()even when it should not, making the system unable to enter sleep.Suspend fails as follows:
armadillo:~# echo mem > /sys/power/state [ 2614.602432] PM: suspend entry (deep) [ 2614.610640] Filesystems sync: 0.004 seconds [ 2614.618016] Freezing user space processes ... (elapsed 0.001 seconds) done. [ 2614.626555] OOM killer disabled. [ 2614.629792] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 2614.638456] printk: Suspending console(s) (use no_console_suspend to debug) [ 2614.649504] PM: Some devices failed to suspend, or early wake event detected [ 2614.730103] PM: resume devices took 0.080 seconds [ 2614.741924] OOM killer enabled. [ 2614.745073] Restarting tasks ... done. [ 2614.754532] PM: suspend exit ash: write error: Resource busy armadillo:~#
Quoted 7 lines
Upstream commit
892cb524ae8ais correct, so this seems to be a mistake during cherry-pick.Cc <[email protected]>Fixes a16f5ae8ade1 ("mailbox: imx: fix wakeup failure from freeze mode")Signed-off-by Daisuke Mizobuchi <[email protected]>Reviewed-by Dominique Martinet <[email protected]>
Ok.
Thanks,
Dominique
Quoted 44 lines
--- drivers/mailbox/imx-mailbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/mailbox/imx-mailbox.c +4
-4@@ -331,8 +331,6 @@ static int imx_mu_startup(struct mbox_chan *chan)break ; } - priv->suspend = true; -return 0 ; }@@ -550,8 +548,6 @@ static int imx_mu_probe(struct platform_device *pdev)clk_disable_unprepare (priv->clk); - priv->suspend = false; -return 0 ; disable_runtime_pm:@@ -614,6 +610,8 @@ static int __maybe_unused imx_mu_suspend_noirq(struct device *dev)if (!priv->clk) priv->xcr =imx_mu_read (priv, priv->dcfg->xCR); + priv->suspend = true; +return 0 ; }@@ -632,6 +630,8 @@ static int __maybe_unused imx_mu_resume_noirq(struct device *dev)if (!imx_mu_read (priv, priv->dcfg->xCR) && !priv->clk)imx_mu_write (priv, priv->xcr, priv->dcfg->xCR); + priv->suspend = false; +return 0 ; }
Quoted 81 lines
Subject: Re: [PATCH v2 5.10.y 1/1] mailbox: imx: fix suspend failure
(Added Ccs again - Robin Gong and Jassi Brar both bounced last time so didn't add them back)
Daisuke Mizobuchi wrote on Fri, Apr 12, 2024 at 02:56:48PM +0900:
Quoted 7 lines
imx_mu_isr()always callspm_system_wakeup()even when it should not, making the system unable to enter sleep.Suspend fails as follows:
armadillo:~# echo mem > /sys/power/state [ 2614.602432] PM: suspend entry (deep) [ 2614.610640] Filesystems sync: 0.004 seconds [ 2614.618016] Freezing user space processes ... (elapsed 0.001 seconds)done.
Quoted 2 lines
[ 2614.626555] OOM killer disabled. [ 2614.629792] Freezing remaining freezable tasks ... (elapsed 0.001seconds) done.
Quoted 9 lines
[ 2614.638456] printk: Suspending console(s) (use no_console_suspend to debug) [ 2614.649504] PM: Some devices failed to suspend, or early wake event detected [ 2614.730103] PM: resume devices took 0.080 seconds [ 2614.741924] OOM killer enabled. [ 2614.745073] Restarting tasks ... done. [ 2614.754532] PM: suspend exit ash: write error: Resource busy armadillo:~#Quoted 8 lines
Upstream commit
892cb524ae8ais correct, so this seems to be a mistake during cherry-pick.Cc <[email protected]>Fixes a16f5ae8ade1 ("mailbox: imx: fix wakeup failure from freezemode")
Signed-off-by Daisuke Mizobuchi <[email protected]>Reviewed-by Dominique Martinet <dominique.martinet@atmark-techno.com>
Ok.
Thanks,
Dominiquedrivers/mailbox/imx-mailbox.c static int __maybe_unused
Quoted 29 lines
--- drivers/mailbox/imx-mailbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/mailbox/imx-mailbox.cindexc5663398c6b7..28f5450e4130100644drivers/mailbox/imx-mailbox.c +0
-4@@ -331,8 +331,6 @@ static int imx_mu_startup(struct mbox_chan *chan)break ; } - priv->suspend = true; -return 0 ; }@@ -550,8 +548,6 @@ static int imx_mu_probe(struct platform_device *pdev)clk_disable_unprepare (priv->clk); - priv->suspend = false; -return 0 ;
disable_runtime_pm:drivers/mailbox/imx-mailbox.c +0
-0@@ -614,6 +610,8 @@ static int __maybe_unused
imx_mu_suspend_noirq(struct device *dev)drivers/mailbox/imx-mailbox.c static int __maybe_unused
Quoted 9 lines
drivers/mailbox/imx-mailbox.c +2
-0if (!priv->clk) priv->xcr =imx_mu_read (priv, priv->dcfg->xCR); + priv->suspend = true; +return 0 ; }@@ -632,6 +630,8 @@ static int __maybe_unused
imx_mu_resume_noirq(struct device *dev)
Quoted 9 lines
drivers/mailbox/imx-mailbox.c static int __maybe_unused imx_mu_resume_noirq(struct device *dev) · line 637
Quoted 8 lines
drivers/mailbox/imx-mailbox.c +2
-0if (!imx_mu_read (priv, priv->dcfg->xCR) && !priv->clk)imx_mu_write (priv, priv->xcr, priv->dcfg->xCR); + priv->suspend = false; +return 0 ; }
LGTM: Reviewed-by: Peng Fan <[email protected]>