Skip to content

Commit 7af6b11

Browse files
rodrigovivijnikula
authored andcommitted
drm/i915: Convert intel_runtime_pm_get_noresume towards raw wakeref
In the past, the noresume function was used by the GEM code to ensure wakelocks were held and bump its usage. This is no longer the case and this function was totally unused until it started to be used again by display with commit 77e619a ("drm/i915/display: convert inner wakeref get towards get_if_in_use") However, on the display code, most of the callers are using the raw wakeref, rather then the wakelock version. What caused a major regression caught by CI. Another option to this patch is to go with the original plan and use the get_if_in_use variant in the display code, what is enough to fulfil our needs. Then, an extra patch to delete the unused _noresume variant. v2: Keep grabbing wakelock but only assert for wakeref. (Imre) Cc: Imre Deak <[email protected]> Cc: Francois Dugast <[email protected]> Cc: Ville Syrjälä <[email protected]> Fixes: 77e619a ("drm/i915/display: convert inner wakeref get towards get_if_in_use") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10875 Signed-off-by: Rodrigo Vivi <[email protected]> Reviewed-by: Imre Deak <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5bc9de0 commit 7af6b11

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

drivers/gpu/drm/i915/display/intel_display_power.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,12 +640,6 @@ release_async_put_domains(struct i915_power_domains *power_domains,
640640
enum intel_display_power_domain domain;
641641
intel_wakeref_t wakeref;
642642

643-
/*
644-
* The caller must hold already raw wakeref, upgrade that to a proper
645-
* wakeref to make the state checker happy about the HW access during
646-
* power well disabling.
647-
*/
648-
assert_rpm_raw_wakeref_held(rpm);
649643
wakeref = intel_runtime_pm_get_noresume(rpm);
650644

651645
for_each_power_domain(domain, mask) {

drivers/gpu/drm/i915/intel_runtime_pm.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,11 @@ intel_wakeref_t intel_runtime_pm_get_if_active(struct intel_runtime_pm *rpm)
272272
* intel_runtime_pm_get_noresume - grab a runtime pm reference
273273
* @rpm: the intel_runtime_pm structure
274274
*
275-
* This function grabs a device-level runtime pm reference (mostly used for GEM
276-
* code to ensure the GTT or GT is on).
275+
* This function grabs a device-level runtime pm reference.
277276
*
278-
* It will _not_ power up the device but instead only check that it's powered
279-
* on. Therefore it is only valid to call this functions from contexts where
280-
* the device is known to be powered up and where trying to power it up would
281-
* result in hilarity and deadlocks. That pretty much means only the system
282-
* suspend/resume code where this is used to grab runtime pm references for
283-
* delayed setup down in work items.
277+
* It will _not_ resume the device but instead only get an extra wakeref.
278+
* Therefore it is only valid to call this functions from contexts where
279+
* the device is known to be active and with another wakeref previously hold.
284280
*
285281
* Any runtime pm reference obtained by this function must have a symmetric
286282
* call to intel_runtime_pm_put() to release the reference again.
@@ -289,7 +285,7 @@ intel_wakeref_t intel_runtime_pm_get_if_active(struct intel_runtime_pm *rpm)
289285
*/
290286
intel_wakeref_t intel_runtime_pm_get_noresume(struct intel_runtime_pm *rpm)
291287
{
292-
assert_rpm_wakelock_held(rpm);
288+
assert_rpm_raw_wakeref_held(rpm);
293289
pm_runtime_get_noresume(rpm->kdev);
294290

295291
intel_runtime_pm_acquire(rpm, true);

0 commit comments

Comments
 (0)