* [PATCH v2] PM: sleep: wakeirq: Update outdated documentation comments
@ 2026-02-06 9:23 Wang Jiayue
2026-02-11 20:14 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Wang Jiayue @ 2026-02-06 9:23 UTC (permalink / raw)
To: rafael, lenb, pavel, gregkh, dakr
Cc: linux-pm, linux-kernel, Wang Jiayue, Gui-Dong Han
The comments claiming that dev_pm_*wake_irq*() helpers must be called
with dev->power.lock held and only from rpm_suspend/resume paths are no
longer correct, since pm_runtime_force_suspend/resume() call them
lockless. Update the comments to reflect it.
Reported-by: Gui-Dong Han <hanguidong02@gmail.com>
Closes: https://lore.kernel.org/all/CAJZ5v0jN9fU9NdWqc-+F5hiSEP4JkR=_qcdGzzHtk1i5tvCDbQ@mail.gmail.com/
Fixes: c46a0d5ae4f9 ("PM: runtime: Extend support for wakeirq for force_suspend|resume")
Signed-off-by: Wang Jiayue <akaieurus@gmail.com>
---
v2:
* Rephrase the comments to also cover the
pm_runtime_force_suspend/resume() case, as suggested by Rafael J. Wysocki
v1:
* Initial fix just remove outdated comments
---
drivers/base/power/wakeirq.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index 8aa28c08b289..f5db37c4818e 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -270,8 +270,10 @@ EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq_reverse);
* otherwise try to disable already disabled wakeirq. The wake-up interrupt
* starts disabled with IRQ_NOAUTOEN set.
*
- * Should be only called from rpm_suspend() and rpm_resume() path.
- * Caller must hold &dev->power.lock to change wirq->status
+ * Should be called from rpm_suspend(), rpm_resume(),
+ * pm_runtime_force_suspend() or pm_runtime_force_resume().
+ * Caller must hold &dev->power.lock or disable runtime PM to change
+ * wirq->status.
*/
void dev_pm_enable_wake_irq_check(struct device *dev,
bool can_change_status)
@@ -303,7 +305,8 @@ void dev_pm_enable_wake_irq_check(struct device *dev,
* @cond_disable: if set, also check WAKE_IRQ_DEDICATED_REVERSE
*
* Disables wake-up interrupt conditionally based on status.
- * Should be only called from rpm_suspend() and rpm_resume() path.
+ * Should be called from rpm_suspend(), rpm_resume(),
+ * pm_runtime_force_suspend() or pm_runtime_force_resume().
*/
void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
{
@@ -329,7 +332,7 @@ void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
* enable wake IRQ after running ->runtime_suspend() which depends on
* WAKE_IRQ_DEDICATED_REVERSE.
*
- * Should be only called from rpm_suspend() path.
+ * Should be called from rpm_suspend() or pm_runtime_force_suspend().
*/
void dev_pm_enable_wake_irq_complete(struct device *dev)
{
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] PM: sleep: wakeirq: Update outdated documentation comments
2026-02-06 9:23 [PATCH v2] PM: sleep: wakeirq: Update outdated documentation comments Wang Jiayue
@ 2026-02-11 20:14 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2026-02-11 20:14 UTC (permalink / raw)
To: Wang Jiayue
Cc: rafael, lenb, pavel, gregkh, dakr, linux-pm, linux-kernel, Gui-Dong Han
On Fri, Feb 6, 2026 at 10:23 AM Wang Jiayue <akaieurus@gmail.com> wrote:
>
> The comments claiming that dev_pm_*wake_irq*() helpers must be called
> with dev->power.lock held and only from rpm_suspend/resume paths are no
> longer correct, since pm_runtime_force_suspend/resume() call them
> lockless. Update the comments to reflect it.
>
> Reported-by: Gui-Dong Han <hanguidong02@gmail.com>
> Closes: https://lore.kernel.org/all/CAJZ5v0jN9fU9NdWqc-+F5hiSEP4JkR=_qcdGzzHtk1i5tvCDbQ@mail.gmail.com/
> Fixes: c46a0d5ae4f9 ("PM: runtime: Extend support for wakeirq for force_suspend|resume")
> Signed-off-by: Wang Jiayue <akaieurus@gmail.com>
> ---
> v2:
> * Rephrase the comments to also cover the
> pm_runtime_force_suspend/resume() case, as suggested by Rafael J. Wysocki
> v1:
> * Initial fix just remove outdated comments
> ---
> drivers/base/power/wakeirq.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
> index 8aa28c08b289..f5db37c4818e 100644
> --- a/drivers/base/power/wakeirq.c
> +++ b/drivers/base/power/wakeirq.c
> @@ -270,8 +270,10 @@ EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq_reverse);
> * otherwise try to disable already disabled wakeirq. The wake-up interrupt
> * starts disabled with IRQ_NOAUTOEN set.
> *
> - * Should be only called from rpm_suspend() and rpm_resume() path.
> - * Caller must hold &dev->power.lock to change wirq->status
> + * Should be called from rpm_suspend(), rpm_resume(),
> + * pm_runtime_force_suspend() or pm_runtime_force_resume().
> + * Caller must hold &dev->power.lock or disable runtime PM to change
> + * wirq->status.
> */
> void dev_pm_enable_wake_irq_check(struct device *dev,
> bool can_change_status)
> @@ -303,7 +305,8 @@ void dev_pm_enable_wake_irq_check(struct device *dev,
> * @cond_disable: if set, also check WAKE_IRQ_DEDICATED_REVERSE
> *
> * Disables wake-up interrupt conditionally based on status.
> - * Should be only called from rpm_suspend() and rpm_resume() path.
> + * Should be called from rpm_suspend(), rpm_resume(),
> + * pm_runtime_force_suspend() or pm_runtime_force_resume().
> */
> void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
> {
> @@ -329,7 +332,7 @@ void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
> * enable wake IRQ after running ->runtime_suspend() which depends on
> * WAKE_IRQ_DEDICATED_REVERSE.
> *
> - * Should be only called from rpm_suspend() path.
> + * Should be called from rpm_suspend() or pm_runtime_force_suspend().
> */
> void dev_pm_enable_wake_irq_complete(struct device *dev)
> {
> --
Applied as 7.0-rc material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-11 20:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-06 9:23 [PATCH v2] PM: sleep: wakeirq: Update outdated documentation comments Wang Jiayue
2026-02-11 20:14 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®