Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ patternProperties:
holds this entry's device ID, instead of by reg. Only valid on a
report whose PMP the host starts.

apple,irq-safe:
type: boolean
description:
The entry is the parent of IRQ-safe PMGR power states and is
switched with interrupts disabled. Setting the state takes a
spinlock and polls the acknowledgment atomically.

required:
- compatible
- reg
Expand Down
7 changes: 7 additions & 0 deletions drivers/pmdomain/apple/pmp-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,13 @@ static int apple_pmp_report_entry_probe(struct platform_device *pdev)

ent->genpd.power_on = apple_pmp_report_entry_power_on;
ent->genpd.power_off = apple_pmp_report_entry_power_off;
/*
* An entry that is the parent of PMGR power states (which are IRQ safe)
* must be IRQ safe too. Setting the state takes a spinlock and polls
* the acknowledgment atomically, so it may be called with IRQs off.
*/
if (of_property_read_bool(node, "apple,irq-safe"))
ent->genpd.flags |= GENPD_FLAG_IRQ_SAFE;

ret = pm_genpd_init(&ent->genpd, NULL, true);
if (ret) {
Expand Down