mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
Fix wakeref handling of PXP suspend.
-----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmGeuT8ACgkQ+mJfZA7r E8ogZAgAizhmm8eFCRDMA2f+8CCLC6OTVsg5UFyWsLgrN/R8+Mx7xsvwMOsLp01+ 0afbQixuTDP0zlQ1EqNTBlgVw58PBaZ5ts+ns8k3ZDDvJh6/zknrWafPEvMHrVHK 0dTrJcGU6k021n/UFnCfHdXKg+Kt8w0O1XC8NacCrGrZNG1WxTlgU1wdJLgVh0PF T38QNPdrqq8zNwzW36ZVTToRCeaGzbiiGxRxWxO34S2YhlPbKsE/ZMj/jYri0afP W82U1yep/Qo0zWUwyWDlEQqixinaqMwblNGjlTztiNo95DweeJx0Zc2j2jstLYnZ XAq4YaEM9ngRbywMrlL9M7bnwJe6Sg== =IeEU -----END PGP SIGNATURE----- Merge tag 'drm-intel-fixes-2021-11-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes Fix wakeref handling of PXP suspend. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/YZ65bsPOK+6JLv0d@intel.com
This commit is contained in:
commit
fc026c8b92
@ -301,7 +301,7 @@ void intel_gt_suspend_prepare(struct intel_gt *gt)
|
||||
user_forcewake(gt, true);
|
||||
wait_for_suspend(gt);
|
||||
|
||||
intel_pxp_suspend(>->pxp, false);
|
||||
intel_pxp_suspend_prepare(>->pxp);
|
||||
}
|
||||
|
||||
static suspend_state_t pm_suspend_target(void)
|
||||
@ -326,6 +326,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
|
||||
GEM_BUG_ON(gt->awake);
|
||||
|
||||
intel_uc_suspend(>->uc);
|
||||
intel_pxp_suspend(>->pxp);
|
||||
|
||||
/*
|
||||
* On disabling the device, we want to turn off HW access to memory
|
||||
@ -353,7 +354,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
|
||||
|
||||
void intel_gt_runtime_suspend(struct intel_gt *gt)
|
||||
{
|
||||
intel_pxp_suspend(>->pxp, true);
|
||||
intel_pxp_runtime_suspend(>->pxp);
|
||||
intel_uc_runtime_suspend(>->uc);
|
||||
|
||||
GT_TRACE(gt, "\n");
|
||||
@ -371,7 +372,7 @@ int intel_gt_runtime_resume(struct intel_gt *gt)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
intel_pxp_resume(>->pxp);
|
||||
intel_pxp_runtime_resume(>->pxp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -7,26 +7,29 @@
|
||||
#include "intel_pxp_irq.h"
|
||||
#include "intel_pxp_pm.h"
|
||||
#include "intel_pxp_session.h"
|
||||
#include "i915_drv.h"
|
||||
|
||||
void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
|
||||
void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
|
||||
{
|
||||
if (!intel_pxp_is_enabled(pxp))
|
||||
return;
|
||||
|
||||
pxp->arb_is_valid = false;
|
||||
|
||||
/*
|
||||
* Contexts using protected objects keep a runtime PM reference, so we
|
||||
* can only runtime suspend when all of them have been either closed
|
||||
* or banned. Therefore, there is no need to invalidate in that
|
||||
* scenario.
|
||||
*/
|
||||
if (!runtime)
|
||||
intel_pxp_invalidate(pxp);
|
||||
intel_pxp_invalidate(pxp);
|
||||
}
|
||||
|
||||
intel_pxp_fini_hw(pxp);
|
||||
void intel_pxp_suspend(struct intel_pxp *pxp)
|
||||
{
|
||||
intel_wakeref_t wakeref;
|
||||
|
||||
pxp->hw_state_invalidated = false;
|
||||
if (!intel_pxp_is_enabled(pxp))
|
||||
return;
|
||||
|
||||
with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
|
||||
intel_pxp_fini_hw(pxp);
|
||||
pxp->hw_state_invalidated = false;
|
||||
}
|
||||
}
|
||||
|
||||
void intel_pxp_resume(struct intel_pxp *pxp)
|
||||
@ -44,3 +47,15 @@ void intel_pxp_resume(struct intel_pxp *pxp)
|
||||
|
||||
intel_pxp_init_hw(pxp);
|
||||
}
|
||||
|
||||
void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
|
||||
{
|
||||
if (!intel_pxp_is_enabled(pxp))
|
||||
return;
|
||||
|
||||
pxp->arb_is_valid = false;
|
||||
|
||||
intel_pxp_fini_hw(pxp);
|
||||
|
||||
pxp->hw_state_invalidated = false;
|
||||
}
|
||||
|
@ -9,16 +9,29 @@
|
||||
#include "intel_pxp_types.h"
|
||||
|
||||
#ifdef CONFIG_DRM_I915_PXP
|
||||
void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime);
|
||||
void intel_pxp_suspend_prepare(struct intel_pxp *pxp);
|
||||
void intel_pxp_suspend(struct intel_pxp *pxp);
|
||||
void intel_pxp_resume(struct intel_pxp *pxp);
|
||||
void intel_pxp_runtime_suspend(struct intel_pxp *pxp);
|
||||
#else
|
||||
static inline void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
|
||||
static inline void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void intel_pxp_suspend(struct intel_pxp *pxp)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void intel_pxp_resume(struct intel_pxp *pxp)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
static inline void intel_pxp_runtime_resume(struct intel_pxp *pxp)
|
||||
{
|
||||
intel_pxp_resume(pxp);
|
||||
}
|
||||
#endif /* __INTEL_PXP_PM_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user