public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Ensure proper HDA suspend/resume ordering with a device link
Date: Mon, 22 Oct 2018 19:22:30 +0300	[thread overview]
Message-ID: <20181022162230.GO9144@intel.com> (raw)
In-Reply-To: <20181018142558.23186-1-imre.deak@intel.com>

On Thu, Oct 18, 2018 at 05:25:58PM +0300, Imre Deak wrote:
> 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.

And we manage runtime pm explicitly too so don't need/want
DL_FLAG_PM_RUNTIME.

> 
> 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));
> +

I guess it's just the kzalloc() that could theoretically fail. Probably
not a practical concern.

Didn't read through the entire device_link code, but this seems to
agree with the docs.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  	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

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

  parent reply	other threads:[~2018-10-22 16:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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ä [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181022162230.GO9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox