dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
To: "paul.kocialkowski@linux.intel.com" <paul.kocialkowski@linux.intel.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Vetter, Daniel" <daniel.vetter@intel.com>,
	"airlied@linux.ie" <airlied@linux.ie>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Synchronize connectors states when switching from poll to irq
Date: Thu, 20 Jul 2017 01:04:12 +0000	[thread overview]
Message-ID: <1500513858.21694.13.camel@dk-H97M-D3H> (raw)
In-Reply-To: <20170626123229.27939-1-paul.kocialkowski@linux.intel.com>


On Mon, 2017-06-26 at 15:32 +0300, Paul Kocialkowski wrote:
> After detecting an IRQ storm, hotplug detection will switch from
> irq-based detection to poll-based detection. After a short delay or
> when resetting storm detection from debugfs, detection will switch
> back to being irq-based.
> 
> However, it may occur that polling does not have enough time to detect
> the current connector state when that second switch takes place. 

Some questions so that I understand this better. How short would this
have to be for detect to not complete? Is there a way I can easily test
this scenario?

> Thus,
> this sets the appropriate hotplug event bits for the concerned
> connectors and schedules the hotplug work, that will ensure the
> connectors states are in sync when switching back to irq.
> 

Not sure I understand this correctly, looks like you are setting the
event_bits even if there was no irq during the polling interval. Is that
right?


> Without this, no irq will be triggered and the hpd change will be lost.
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hotplug.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index f1200272a699..29f55480b0bb 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -218,9 +218,13 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
>  			struct intel_connector *intel_connector = to_intel_connector(connector);
>  
>  			if (intel_connector->encoder->hpd_pin == i) {
> -				if (connector->polled != intel_connector->polled)
> +				if (connector->polled != intel_connector->polled) {
>  					DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n",
>  							 connector->name);
> +
> +					dev_priv->hotplug.event_bits |= (1 << i);
> +				}
> +
>  				connector->polled = intel_connector->polled;
>  				if (!connector->polled)
>  					connector->polled = DRM_CONNECTOR_POLL_HPD;
> @@ -232,6 +236,8 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
>  		dev_priv->display.hpd_irq_setup(dev_priv);
>  	spin_unlock_irq(&dev_priv->irq_lock);
>  
> +	schedule_work(&dev_priv->hotplug.hotplug_work);

How does this work with DP connectors? From what I understand, the
event_bits are set for DP based on the return value from
intel_dp_hpd_pulse(). But, doesn't this patch set the bits
unconditionally?

> +
>  	intel_runtime_pm_put(dev_priv);
>  }
>  

  parent reply	other threads:[~2017-07-20  1:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 12:32 [PATCH] drm/i915: Synchronize connectors states when switching from poll to irq Paul Kocialkowski
2017-07-18 12:11 ` Paul Kocialkowski
2017-07-20  6:11   ` Manasi Navare
2017-07-20 14:41     ` Paul Kocialkowski
2017-07-20  1:04 ` Pandiyan, Dhinakaran [this message]
2017-07-20 14:35   ` Paul Kocialkowski

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=1500513858.21694.13.camel@dk-H97M-D3H \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.kocialkowski@linux.intel.com \
    /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