drm/i915/pxp: Pxp hw init should be in resume_complete
authorAlan Previn <alan.previn.teres.alexis@intel.com>
Wed, 25 Jan 2023 08:26:37 +0000 (00:26 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 27 Jan 2023 20:23:39 +0000 (15:23 -0500)
commit24efe424f096953d355cc366cdd471ba8cdaf035
tree89e31e001b3899d969c1227557a9f129bd53c7ae
parent9b469093d321f23adf13d966797f55242278c3b5
drm/i915/pxp: Pxp hw init should be in resume_complete

During suspend flow, i915 currently achors' on the pm_suspend_prepare
callback as the location where we quiesce the entire GPU and perform
all necessary cleanup in order to go into suspend. PXP is also called
during this time to perform the arbitration session teardown (with
the assurance no additional GEM IOCTLs will come after that could
restart the session).

However, if other devices or drivers fail their suspend_prepare, the
system will not go into suspend and i915 will be expected to resume
operation. In this case, we need to re-initialize the PXP hardware
and this really should be done within the pm_resume_complete callback
which is the correct opposing function in the resume sequence to
match pm_suspend_prepare of the suspend sequence.

Because this callback is the last thing at the end of resuming
we expect little to no impact to the rest of the i915 resume sequence
with this change.

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125082637.118970-7-alan.previn.teres.alexis@intel.com
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
drivers/gpu/drm/i915/pxp/intel_pxp_pm.h