mbox series

[0/3] PM / wakeirq: fix wake irq arming

Message ID 20230713145741.30390-1-johan+linaro@kernel.org
Headers show
Series PM / wakeirq: fix wake irq arming | expand

Message

Johan Hovold July 13, 2023, 2:57 p.m. UTC
When reviewing the Qualcomm serial-driver suspend implementation I
noticed the odd runtime PM state update which had snuck in. Turns out it
was added to work around a bug in PM core which prevented drivers not
implementing runtime PM from using dedicated wake irqs.

This series fixes the wake irq arming and drops the unused wake irq
enable helpers before dropping the bogus runtime PM state update in the
Qualcomm driver.

I suggest that Rafael takes all of these through his tree.

Johan


Johan Hovold (3):
  PM / wakeirq: fix wake irq arming
  PM / wakeirq: drop unused enable helpers
  serial: qcom-geni: drop bogus runtime pm state update

 drivers/base/power/power.h            |  1 +
 drivers/base/power/wakeirq.c          | 61 ++++-----------------------
 drivers/tty/serial/qcom_geni_serial.c |  7 ---
 include/linux/pm_wakeirq.h            | 10 -----
 4 files changed, 9 insertions(+), 70 deletions(-)

Comments

Tony Lindgren July 14, 2023, 7:19 a.m. UTC | #1
* Johan Hovold <johan+linaro@kernel.org> [230713 15:01]:
> Drop the wake-irq enable and disable helpers which have not been used
> since commit bed570307ed7 ("PM / wakeirq: Fix dedicated wakeirq for
> drivers not using autosuspend").
> 
> Note that these functions are essentially just leftovers from the first
> iteration of the wake-irq implementation where device drivers were
> supposed to call these functions themselves instead of PM core (as
> is also indicated by the bogus kernel doc comments).

Agreed no need for these any longer:

Reviewed-by: Tony Lindgren <tony@atomide.com>
Tony Lindgren July 14, 2023, 7:48 a.m. UTC | #2
* Johan Hovold <johan+linaro@kernel.org> [230713 15:01]:
> The decision whether to enable a wake irq during suspend can not be done
> based on the runtime PM state directly as a driver may use wake irqs
> without implementing runtime PM. Such drivers specifically leave the
> state set to the default 'suspended' and the wake irq is thus never
> enabled at suspend.
> 
> Add a new wake irq flag to track whether a dedicated wake irq has been
> enabled at runtime suspend and therefore must not be enabled at system
> suspend.
> 
> Note that pm_runtime_enabled() can not be used as runtime PM is always
> disabled during late suspend.

Works for me:

Reviewed-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Rafael J. Wysocki July 20, 2023, 5:49 p.m. UTC | #3
On Thu, Jul 13, 2023 at 5:01 PM Johan Hovold <johan+linaro@kernel.org> wrote:
>
> When reviewing the Qualcomm serial-driver suspend implementation I
> noticed the odd runtime PM state update which had snuck in. Turns out it
> was added to work around a bug in PM core which prevented drivers not
> implementing runtime PM from using dedicated wake irqs.
>
> This series fixes the wake irq arming and drops the unused wake irq
> enable helpers before dropping the bogus runtime PM state update in the
> Qualcomm driver.
>
> I suggest that Rafael takes all of these through his tree.
>
> Johan
>
>
> Johan Hovold (3):
>   PM / wakeirq: fix wake irq arming
>   PM / wakeirq: drop unused enable helpers
>   serial: qcom-geni: drop bogus runtime pm state update

All applied and I'm inclined to push them as fixed for 6.5-rc, thanks!
Greg KH Aug. 1, 2023, 5:48 a.m. UTC | #4
On Thu, Jul 13, 2023 at 04:57:38PM +0200, Johan Hovold wrote:
> When reviewing the Qualcomm serial-driver suspend implementation I
> noticed the odd runtime PM state update which had snuck in. Turns out it
> was added to work around a bug in PM core which prevented drivers not
> implementing runtime PM from using dedicated wake irqs.
> 
> This series fixes the wake irq arming and drops the unused wake irq
> enable helpers before dropping the bogus runtime PM state update in the
> Qualcomm driver.
> 
> I suggest that Rafael takes all of these through his tree.

I agree:

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>