public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Ensure proper HDA suspend/resume ordering with a device link
@ 2018-10-18 14:25 Imre Deak
  2018-10-18 14:53 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Imre Deak @ 2018-10-18 14:25 UTC (permalink / raw)
  To: intel-gfx; +Cc: Takashi Iwai

In order to ensure that our system suspend and resume callbacks are
called in the correct order wrt. those of the HDA driver add a device
link to the HDA driver during audio component binding time. With i915 as
the supplier and HDA as the consumer the PM framework will guarantee
the HDA->i915 suspend (and shutdown) and i915->HDA resume order.

Atm, the lack of this ordering is not a problem, since all the i915
suspend/resume steps that need to be ordered wrt. the HDA driver's
suspend/resume steps are separated out to the i915
suspend_late/resume_early hooks. That will change in a follow-up
patchset where we'll need this ordering guarantee for steps that are in
the i915 suspend/resume hooks (and which can't be moved to
suspend_late/resume_early for other reasons). So this patch is a
preparation for that follow-up patchset.

The change also allows us to move towards removing the i915
suspend_late/resume_early hooks alltogether.

Since we only need to ensure the ordering during suspend/resume and not
during driver probing create the link with DL_FLAG_STATELESS. Since the
probe time ordering has to be optional we use the component framework
for that.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_audio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 769f3f586661..391b88701610 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -921,6 +921,8 @@ static int i915_audio_component_bind(struct device *i915_kdev,
 	dev_priv->audio_component = acomp;
 	drm_modeset_unlock_all(&dev_priv->drm);
 
+	WARN_ON(!device_link_add(hda_kdev, i915_kdev, DL_FLAG_STATELESS));
+
 	return 0;
 }
 
@@ -930,6 +932,8 @@ static void i915_audio_component_unbind(struct device *i915_kdev,
 	struct i915_audio_component *acomp = data;
 	struct drm_i915_private *dev_priv = kdev_to_i915(i915_kdev);
 
+	device_link_remove(hda_kdev, i915_kdev);
+
 	drm_modeset_lock_all(&dev_priv->drm);
 	acomp->base.ops = NULL;
 	acomp->base.dev = NULL;
-- 
2.13.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-10-25 12:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-18 14:25 [PATCH] drm/i915: Ensure proper HDA suspend/resume ordering with a device link Imre Deak
2018-10-18 14:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-10-18 15:00 ` [PATCH] " Takashi Iwai
2018-10-18 20:53 ` ✗ Fi.CI.IGT: failure for " Patchwork
2018-10-20  5:59 ` [PATCH] " Lukas Wunner
2018-10-22 10:24   ` Imre Deak
2018-10-22 16:22 ` Ville Syrjälä
2018-10-23 11:32   ` Imre Deak
2018-10-23 14:43 ` [PATCH v2] " Imre Deak
2018-10-23 15:25 ` ✗ Fi.CI.BAT: failure for drm/i915: Ensure proper HDA suspend/resume ordering with a device link (rev2) Patchwork
2018-10-23 18:41 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-24 10:25 ` Patchwork
2018-10-24 11:23 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-25 12:45   ` Imre Deak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox