From: Jani Nikula <jani.nikula@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 1/5] drm/i915: take display port power domain in DP HPD handler
Date: Mon, 18 Aug 2014 16:35:48 +0300 [thread overview]
Message-ID: <8738ctor7v.fsf@intel.com> (raw)
In-Reply-To: <1408362166-9543-1-git-send-email-imre.deak@intel.com>
Series pushed to -fixes, thanks for the patches and review.
BR,
Jani.
On Mon, 18 Aug 2014, Imre Deak <imre.deak@intel.com> wrote:
> Ville noticed that we can call ibx_digital_port_connected() which accesses
> the HW without holding any power well/runtime pm reference. Fix this by
> holding a display port power domain reference around the whole hpd_pulse
> handler.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index ee3942f..a520188 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4037,15 +4037,21 @@ bool
> intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> {
> struct intel_dp *intel_dp = &intel_dig_port->dp;
> + struct intel_encoder *intel_encoder = &intel_dig_port->base;
> struct drm_device *dev = intel_dig_port->base.base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> - int ret;
> + enum intel_display_power_domain power_domain;
> + bool ret = true;
> +
> if (intel_dig_port->base.type != INTEL_OUTPUT_EDP)
> intel_dig_port->base.type = INTEL_OUTPUT_DISPLAYPORT;
>
> DRM_DEBUG_KMS("got hpd irq on port %d - %s\n", intel_dig_port->port,
> long_hpd ? "long" : "short");
>
> + power_domain = intel_display_port_power_domain(intel_encoder);
> + intel_display_power_get(dev_priv, power_domain);
> +
> if (long_hpd) {
> if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
> goto mst_fail;
> @@ -4061,8 +4067,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
>
> } else {
> if (intel_dp->is_mst) {
> - ret = intel_dp_check_mst_status(intel_dp);
> - if (ret == -EINVAL)
> + if (intel_dp_check_mst_status(intel_dp) == -EINVAL)
> goto mst_fail;
> }
>
> @@ -4076,7 +4081,8 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> drm_modeset_unlock(&dev->mode_config.connection_mutex);
> }
> }
> - return false;
> + ret = false;
> + goto put_power;
> mst_fail:
> /* if we were in MST mode, and device is not there get out of MST mode */
> if (intel_dp->is_mst) {
> @@ -4084,7 +4090,10 @@ mst_fail:
> intel_dp->is_mst = false;
> drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);
> }
> - return true;
> +put_power:
> + intel_display_power_put(dev_priv, power_domain);
> +
> + return ret;
> }
>
> /* Return which DP Port should be selected for Transcoder DP control */
> --
> 1.8.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2014-08-18 13:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-18 11:42 [PATCH v3 1/5] drm/i915: take display port power domain in DP HPD handler Imre Deak
2014-08-18 11:42 ` [PATCH v3 2/5] drm/i915: fix HPD IRQ reenable work cancelation Imre Deak
2014-08-18 12:25 ` Jani Nikula
2014-08-18 12:37 ` [PATCH v4 " Imre Deak
2014-08-18 11:42 ` [PATCH v3 3/5] drm/i915: cancel hotplug and dig_port work during suspend and unload Imre Deak
2014-08-18 11:42 ` [PATCH v3 4/5] drm/i915: make sure VDD is turned off during system suspend Imre Deak
2014-08-18 11:42 ` [PATCH v3 5/5] drm/i915: don't try to retrain a DP link on an inactive CRTC Imre Deak
2014-08-18 13:35 ` Jani Nikula [this message]
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=8738ctor7v.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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