Skip to content

RFC ACPI/Power: Fix infinite loop of runtime resume and suspend caused by turning on power resource

Lan Tianyu linux-acpi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ACPI/Power: Add state_lock to mutex power resource's _ON, _OFF and _STAdrivers/acpi/power.c+15 -20 replies
2/3ACPI/POWER: Rework acpi_power_get_state()drivers/acpi/power.c+10 -150 replies
3/3ACPI/POWER: Call acpi_power_resume_dependent() directly in the acpi_power_on_unlocked()drivers/acpi/power.c+2 -131 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] ACPI/Power: Fix infinite loop of runtime resume and suspend caused by turning on power resource

Currently, clearing usb port(empty port) PM Qos NO_POWER_OFF flag twice will lead the usb port to fall into the infinite loop of runtime pm resume and suspend. This is caused by pm_request_resume() in the acpi_power_resume_dependent(). Detail is in the following link.
http://marc.info/?l=linux-acpi&m=138182749202885&w=2

This patchset is to fix the issue. Patch 1~2 adds new state_lock to mutex power resource's _ON, _OFF and _STA instead of resource_lock in order to avoid dead lock when call acpi_power_get_inferred_state() under resource_lock. Prepare for Patch 3.

Patch 3 is to make pm_request_resume() in the acpi_power_resume_dependent() able to run just after turning on power and check the right physical device runtime pm status.

Lan Tianyu (3):
ACPI/Power: Add state_lock to mutex power resource's _ON, _OFF and
_STA
ACPI/POWER: Rework acpi_power_get_state()
ACPI/POWER: Call acpi_power_resume_dependent() directly in the
acpi_power_on_unlocked()

 drivers/acpi/power.c | 43 ++++++++++++++++++++-----------------------
 1 file changed, 20 insertions(+), 23 deletions(-)
Signature · 1 line
1.8.2.1