From: Johan Hovold <johan@kernel.org>
To: Qingliang Li <qingliang.li@mediatek.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Johan Hovold <johan+linaro@kernel.org>,
Tony Lindgren <tony@atomide.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, Dhruva Gole <d-gole@ti.com>
Subject: Re: [PATCH v2] PM: sleep: wakeirq: fix wake irq warning in system suspend
Date: Mon, 4 Mar 2024 16:19:14 +0100 [thread overview]
Message-ID: <ZeXmcl4ngEm1RccW@hovoldconsulting.com> (raw)
In-Reply-To: <20240301092657.15528-1-qingliang.li@mediatek.com>
On Fri, Mar 01, 2024 at 05:26:57PM +0800, Qingliang Li wrote:
> When driver uses pm_runtime_force_suspend() as the system suspend callback
> function and registers the wake irq with reverse enable ordering, the wake
> irq will be re-enabled when entering system suspend, triggering an
> 'Unbalanced enable for IRQ xxx' warning. In this scenario, the call
> sequence during system suspend is as follows:
> suspend_devices_and_enter()
> -> dpm_suspend_start()
> -> dpm_run_callback()
> -> pm_runtime_force_suspend()
> -> dev_pm_enable_wake_irq_check()
> -> dev_pm_enable_wake_irq_complete()
>
> -> suspend_enter()
> -> dpm_suspend_noirq()
> -> device_wakeup_arm_wake_irqs()
> -> dev_pm_arm_wake_irq()
>
> To fix this issue, complete the setting of WAKE_IRQ_DEDICATED_ENABLED flag
> in dev_pm_enable_wake_irq_complete() to avoid redundant irq enablement.
>
> Reviewed-by: Dhruva Gole <d-gole@ti.com>
> Signed-off-by: Qingliang Li <qingliang.li@mediatek.com>
Thanks for the fix. Looks correct to me:
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
I think you should add back the Fixes tag from v1 and CC stable as well:
Fixes: 8527beb12087 ("PM: sleep: wakeirq: fix wake irq arming")
Cc: stable@vger.kernel.org # 5.16
Note that WAKE_IRQ_DEDICATED_REVERSE was added in 5.16 by commit
259714100d98 ("PM / wakeirq: support enabling wake-up irq after
runtime_suspend called") so no need to try to backport any further than
that.
Johan
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: Qingliang Li <qingliang.li@mediatek.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Johan Hovold <johan+linaro@kernel.org>,
Tony Lindgren <tony@atomide.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, Dhruva Gole <d-gole@ti.com>
Subject: Re: [PATCH v2] PM: sleep: wakeirq: fix wake irq warning in system suspend
Date: Mon, 4 Mar 2024 16:19:14 +0100 [thread overview]
Message-ID: <ZeXmcl4ngEm1RccW@hovoldconsulting.com> (raw)
In-Reply-To: <20240301092657.15528-1-qingliang.li@mediatek.com>
On Fri, Mar 01, 2024 at 05:26:57PM +0800, Qingliang Li wrote:
> When driver uses pm_runtime_force_suspend() as the system suspend callback
> function and registers the wake irq with reverse enable ordering, the wake
> irq will be re-enabled when entering system suspend, triggering an
> 'Unbalanced enable for IRQ xxx' warning. In this scenario, the call
> sequence during system suspend is as follows:
> suspend_devices_and_enter()
> -> dpm_suspend_start()
> -> dpm_run_callback()
> -> pm_runtime_force_suspend()
> -> dev_pm_enable_wake_irq_check()
> -> dev_pm_enable_wake_irq_complete()
>
> -> suspend_enter()
> -> dpm_suspend_noirq()
> -> device_wakeup_arm_wake_irqs()
> -> dev_pm_arm_wake_irq()
>
> To fix this issue, complete the setting of WAKE_IRQ_DEDICATED_ENABLED flag
> in dev_pm_enable_wake_irq_complete() to avoid redundant irq enablement.
>
> Reviewed-by: Dhruva Gole <d-gole@ti.com>
> Signed-off-by: Qingliang Li <qingliang.li@mediatek.com>
Thanks for the fix. Looks correct to me:
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
I think you should add back the Fixes tag from v1 and CC stable as well:
Fixes: 8527beb12087 ("PM: sleep: wakeirq: fix wake irq arming")
Cc: stable@vger.kernel.org # 5.16
Note that WAKE_IRQ_DEDICATED_REVERSE was added in 5.16 by commit
259714100d98 ("PM / wakeirq: support enabling wake-up irq after
runtime_suspend called") so no need to try to backport any further than
that.
Johan
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-04 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 9:26 [PATCH v2] PM: sleep: wakeirq: fix wake irq warning in system suspend Qingliang Li
2024-03-01 9:26 ` Qingliang Li
2024-03-04 15:19 ` Johan Hovold [this message]
2024-03-04 15:19 ` Johan Hovold
2024-03-05 11:41 ` Rafael J. Wysocki
2024-03-05 11:41 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZeXmcl4ngEm1RccW@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=d-gole@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan+linaro@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=pavel@ucw.cz \
--cc=qingliang.li@mediatek.com \
--cc=rafael@kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.