media: ipu6: Keep psys out of direct-complete on system suspend
Subsystems (2)
Quoted 32 lines · Chris Simpson
Since commit
a1fa010b3c9f("driver core: auxiliary bus: Dropauxiliary_dev_pm_ops"), the auxiliary bus has nodev_pm_ops. The psys auxiliary device has no driver in mainline, and its PM domain,ipu6_bus_pm_domain, has only runtime PM callbacks. Sodevice_pm_check_callbacks()now sets power.no_pm_callbacks for psys, anddevice_prepare()puts it in direct-complete.A runtime-suspended psys in direct-complete gets its runtime PM disabled in
device_suspend(). Runtime PM is enabled again only in psys's owndevice_resume(), which in practice runs after the PCI device's. Before, it came back indevice_resume_early().ipu6_resume(), the system resume callback of the PCI device, runtime-resumes psys before the firmware authentication. That now fails with-EACCESon every resume:auxiliary intel_ipu6.psys.40: Failed to get runtime PM
and
ipu6_resume()returns early, skippingipu6_buttress_authenticate(). In secure mode the firmware is then not re-authenticated after resume, which matters whenever the IPU has lost power. On s2idle on a Surface Pro 9 the cameras still work, and the error is logged on every resume.Add suspend and resume callbacks to
ipu6_bus_pm_domainthat forward to the driver. That is what the PM core does without them, so isys is unaffected, but psys has PM callbacks again and is not left in direct-complete. This restores the behaviour from before the auxiliary bus change.The fix is kept local rather than in the auxiliary bus or the PM core:
it is this driver that runtime-resumes a driverless child from its parent's ->resume().
Quoted 6 lines
Fixes a1fa010b3c9f ("driver core: auxiliary bus: Drop auxiliary_dev_pm_ops")Cc [email protected] # v7.1+Cc Rafael J. Wysocki <[email protected]>Signed-off-by Chris Simpson <[email protected]>Signed-off-by Sakari Ailus <[email protected]>
Patch committed.
Thanks,
Sakari Ailus
drivers/media/pci/intel/ipu6/ipu6-bus.c | 8 ++++++++ 1 file changed, 8 insertions(+)
---
drivers/media/pci/intel/ipu6/ipu6-bus.c +8 -0
@@ -63,8 +63,16 @@ out_err:return -EBUSY ; } +/* +* The driverless psys device needs system sleep callbacks, or it is put in +* direct-complete and its runtime PM is normally still disabled when +* ipu6_resume() tries to runtime-resume it. These only forward to the driver, +* as the PM core would do without them. +*/ static struct dev_pm_domain ipu6_bus_pm_domain = { .ops = { + .suspend = pm_generic_suspend, + .resume = pm_generic_resume, .runtime_suspend = bus_pm_runtime_suspend, .runtime_resume = bus_pm_runtime_resume, },