Skip to content

Commit c622881

Browse files
marcanjannau
authored andcommitted
soc: apple: apple-pmgr-pwrstate: Mark on-at-boot PDs as DEFER_OFF
We consider any domains that are found to be powered on at boot as potentially critical for probing consumer devices. This prevents badness like the boot-time display controller being powered down as soon as its IOMMU probes. Fixes a pile of PD probe order dependencies and races that have required ALWAYS_ON workaround hacks until now, including: - ANS2 (NVMe) breaking if left on at handoff. - DISP0/DCP (boot display) completely breaking. - PM domains failing to probe when their parent was inadvertently shut down before the child probed. - PCIe losing state/fuse info/etc when it powers down before the driver is ready. - Touch Bar (DFR) display controller losing bootloader-configured state before its driver can probe and save it. The downside is that any spuriously on domains will remain on if their drivers are missing. We consider missing drivers that never get loaded a downstream bug. For older kernels running on newer DTs with extra devices, this shouldn't cause any major problems other than perhaps slightly increased power consumption (and we can always fix it in the bootloader by powering down those PDs if they don't need to be left on, since the bootloader is updated together with the DTs). Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent a645ceb commit c622881

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/pmdomain/apple/pmgr-pwrstate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ static int apple_pmgr_ps_probe(struct platform_device *pdev)
242242
/* Turn it on so pm_genpd_init does not fail */
243243
active = apple_pmgr_ps_power_on(&ps->genpd) == 0;
244244
}
245+
} else if (active) {
246+
ps->genpd.flags |= GENPD_FLAG_DEFER_OFF;
245247
}
246248

247249
/* Turn on auto-PM if the domain is already on */

0 commit comments

Comments
 (0)