diff mbox

[4/9] drm/i915/dp: Avoid more dpcd transactions after resume failure

Message ID 20170912235730.3492-4-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dhinakaran Pandiyan Sept. 12, 2017, 11:57 p.m. UTC
drm_dp_mst_topology_mgr_resume() fails if there are dpcd failures, so
there's no need to try that again in _check_mst_status()

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Ville Syrjala Sept. 13, 2017, 1:24 p.m. UTC | #1
On Tue, Sep 12, 2017 at 04:57:25PM -0700, Dhinakaran Pandiyan wrote:
> drm_dp_mst_topology_mgr_resume() fails if there are dpcd failures, so
> there's no need to try that again in _check_mst_status()

That commit message somehow doesn't seem to match this patch. You're not
removing anything from _check_mst_status() here.

> 
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 98e7b96ca826..b3d95cb7546b 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -6224,12 +6224,16 @@ void intel_dp_mst_resume(struct drm_device *dev)
>  	for (i = 0; i < I915_MAX_PORTS; i++) {
>  		struct intel_digital_port *intel_dig_port = dev_priv->hotplug.irq_port[i];
>  		int ret;
> +		struct intel_dp *intel_dp = &intel_dig_port->dp;
>  
> -		if (!intel_dig_port || !intel_dig_port->dp.can_mst)
> +		if (!intel_dig_port || !intel_dp->can_mst)
>  			continue;
>  
> -		ret = drm_dp_mst_topology_mgr_resume(&intel_dig_port->dp.mst_mgr);
> -		if (ret)
> -			intel_dp_check_mst_status(&intel_dig_port->dp);
> +		ret = drm_dp_mst_topology_mgr_resume(&intel_dp->mst_mgr);
> +		if (ret) {
> +			intel_dp->is_mst = false;
> +			drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);
> +			drm_kms_helper_hotplug_event(dev);
> +		}
>  	}
>  }
> -- 
> 2.11.0
Dhinakaran Pandiyan Sept. 13, 2017, 8:21 p.m. UTC | #2
On Wed, 2017-09-13 at 16:24 +0300, Ville Syrjälä wrote:
> On Tue, Sep 12, 2017 at 04:57:25PM -0700, Dhinakaran Pandiyan wrote:

> > drm_dp_mst_topology_mgr_resume() fails if there are dpcd failures, so

> > there's no need to try that again in _check_mst_status()

> 

> That commit message somehow doesn't seem to match this patch. You're not

> removing anything from _check_mst_status() here.

> 

You are right, I meant to write "there's no need to call
_check_mst_status to try dpcd reads again"

Is that good?


> > 

> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

> > ---

> >  drivers/gpu/drm/i915/intel_dp.c | 12 ++++++++----

> >  1 file changed, 8 insertions(+), 4 deletions(-)

> > 

> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c

> > index 98e7b96ca826..b3d95cb7546b 100644

> > --- a/drivers/gpu/drm/i915/intel_dp.c

> > +++ b/drivers/gpu/drm/i915/intel_dp.c

> > @@ -6224,12 +6224,16 @@ void intel_dp_mst_resume(struct drm_device *dev)

> >  	for (i = 0; i < I915_MAX_PORTS; i++) {

> >  		struct intel_digital_port *intel_dig_port = dev_priv->hotplug.irq_port[i];

> >  		int ret;

> > +		struct intel_dp *intel_dp = &intel_dig_port->dp;

> >  

> > -		if (!intel_dig_port || !intel_dig_port->dp.can_mst)

> > +		if (!intel_dig_port || !intel_dp->can_mst)

> >  			continue;

> >  

> > -		ret = drm_dp_mst_topology_mgr_resume(&intel_dig_port->dp.mst_mgr);

> > -		if (ret)

> > -			intel_dp_check_mst_status(&intel_dig_port->dp);

> > +		ret = drm_dp_mst_topology_mgr_resume(&intel_dp->mst_mgr);

> > +		if (ret) {

> > +			intel_dp->is_mst = false;

> > +			drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);

> > +			drm_kms_helper_hotplug_event(dev);

> > +		}

> >  	}

> >  }

> > -- 

> > 2.11.0

>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 98e7b96ca826..b3d95cb7546b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -6224,12 +6224,16 @@  void intel_dp_mst_resume(struct drm_device *dev)
 	for (i = 0; i < I915_MAX_PORTS; i++) {
 		struct intel_digital_port *intel_dig_port = dev_priv->hotplug.irq_port[i];
 		int ret;
+		struct intel_dp *intel_dp = &intel_dig_port->dp;
 
-		if (!intel_dig_port || !intel_dig_port->dp.can_mst)
+		if (!intel_dig_port || !intel_dp->can_mst)
 			continue;
 
-		ret = drm_dp_mst_topology_mgr_resume(&intel_dig_port->dp.mst_mgr);
-		if (ret)
-			intel_dp_check_mst_status(&intel_dig_port->dp);
+		ret = drm_dp_mst_topology_mgr_resume(&intel_dp->mst_mgr);
+		if (ret) {
+			intel_dp->is_mst = false;
+			drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);
+			drm_kms_helper_hotplug_event(dev);
+		}
 	}
 }