Skip to contentSkip to conversation

PM: sleep: wakeirq: remove outdated comments

PATCH Superseded Wang Jiayue 2 participants 2 messages Feb 4

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: sleep: wakeirq: remove outdated comments

Remove the stale documentations. 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.

Fixes c46a0d5ae4f9 ("PM: runtime: Extend support for wakeirq for force_suspend|resume")
---
 drivers/base/power/wakeirq.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/base/power/wakeirq.c +0 -6
index 8aa28c08b289..4f57058f2148 100644
@@ -269,9 +269,6 @@ EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq_reverse);
  * starts in RPM_SUSPENDED state, and the first pm_runtime_get() would
  * 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
  */
 void dev_pm_enable_wake_irq_check(struct device *dev,
 				  bool can_change_status)
@@ -303,7 +300,6 @@ 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.
  */
 void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
 {
@@ -328,8 +324,6 @@ void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
  * Enable wake IRQ conditionally based on status, mainly used if want to
  * enable wake IRQ after running ->runtime_suspend() which depends on
  * WAKE_IRQ_DEDICATED_REVERSE.
- *
- * Should be only called from rpm_suspend() path.
  */
 void dev_pm_enable_wake_irq_complete(struct device *dev)
 {
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Wang Jiayue

Remove the stale documentations. 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.

Well, pm_runtime_force_suspend/resume() are kind of special.

Quoted 13 lines
Fixes c46a0d5ae4f9 ("PM: runtime: Extend support for wakeirq for force_suspend|resume")
---
 drivers/base/power/wakeirq.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/base/power/wakeirq.c +0 -0
index 8aa28c08b289..4f57058f2148 100644

drivers/base/power/wakeirq.c EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq_reverse); · line 273

Quoted 5 lines
drivers/base/power/wakeirq.c +0 -2
@@ -269,9 +269,6 @@ EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq_reverse);
  * starts in RPM_SUSPENDED state, and the first pm_runtime_get() would
  * 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.

I think that the removed line is still applicable to some extent.

It would be better to rephrase it to also cover the pm_runtime_force_suspend/resume() case.

This also applies to the other analogous changes below.

drivers/base/power/wakeirq.c EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq_reverse); · line 274

Quoted 1 line
drivers/base/power/wakeirq.c +0 -1
- * Caller must hold &dev->power.lock to change wirq->status

This one could also be rephrased to say that either the lock needs to be held or runtime PM needs to be disabled before calling this function.

Quoted 21 lines
drivers/base/power/wakeirq.c +0 -4
  */
 void dev_pm_enable_wake_irq_check(struct device *dev,
                                  bool can_change_status)
@@ -303,7 +300,6 @@ 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.
  */
 void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
 {
@@ -328,8 +324,6 @@ void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
  * Enable wake IRQ conditionally based on status, mainly used if want to
  * enable wake IRQ after running ->runtime_suspend() which depends on
  * WAKE_IRQ_DEDICATED_REVERSE.
- *
- * Should be only called from rpm_suspend() path.
  */
 void dev_pm_enable_wake_irq_complete(struct device *dev)
 {
--