diff mbox series

[v2,4/5] drm/i915: Provide more information on DP AUX failures

Message ID 20191029173102.9451-1-matthew.d.roper@intel.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Matt Roper Oct. 29, 2019, 5:31 p.m. UTC
We're seeing some failures where an aux transaction still shows as
'busy' well after the timeout limit that the hardware is supposed to
enforce.  Improve the error message so that we can see exactly which aux
channel this error happened on and what the status bits were during this
case that isn't supposed to happen.

v2:
 - Make timeout a const variable so that the timeout & message will
   match if we decide to change it in the future.  (Lucas)
 - Don't bother testing intel_dp->aux.name for NULL.  (Lucas)

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Lucas De Marchi Oct. 29, 2019, 7:33 p.m. UTC | #1
On Tue, Oct 29, 2019 at 10:31:02AM -0700, Matt Roper wrote:
>We're seeing some failures where an aux transaction still shows as
>'busy' well after the timeout limit that the hardware is supposed to
>enforce.  Improve the error message so that we can see exactly which aux
>channel this error happened on and what the status bits were during this
>case that isn't supposed to happen.
>
>v2:
> - Make timeout a const variable so that the timeout & message will
>   match if we decide to change it in the future.  (Lucas)
> - Don't bother testing intel_dp->aux.name for NULL.  (Lucas)
>
>Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

>---
> drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>index 65bab46f7b43..a66f8c39b201 100644
>--- a/drivers/gpu/drm/i915/display/intel_dp.c
>+++ b/drivers/gpu/drm/i915/display/intel_dp.c
>@@ -1179,18 +1179,20 @@ intel_dp_aux_wait_done(struct intel_dp *intel_dp)
> {
> 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> 	i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
>+	const unsigned int timeout_ms = 10;
> 	u32 status;
> 	bool done;
>
> #define C (((status = intel_uncore_read_notrace(&i915->uncore, ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0)
> 	done = wait_event_timeout(i915->gmbus_wait_queue, C,
>-				  msecs_to_jiffies_timeout(10));
>+				  msecs_to_jiffies_timeout(timeout_ms));
>
> 	/* just trace the final value */
> 	trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
>
> 	if (!done)
>-		DRM_ERROR("dp aux hw did not signal timeout!\n");
>+		DRM_ERROR("%s did not complete or timeout within %ums (status 0x%08x)\n",
>+			  intel_dp->aux.name, timeout_ms, status);
> #undef C
>
> 	return status;
>-- 
>2.21.0
>
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 65bab46f7b43..a66f8c39b201 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1179,18 +1179,20 @@  intel_dp_aux_wait_done(struct intel_dp *intel_dp)
 {
 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
 	i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
+	const unsigned int timeout_ms = 10;
 	u32 status;
 	bool done;
 
 #define C (((status = intel_uncore_read_notrace(&i915->uncore, ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0)
 	done = wait_event_timeout(i915->gmbus_wait_queue, C,
-				  msecs_to_jiffies_timeout(10));
+				  msecs_to_jiffies_timeout(timeout_ms));
 
 	/* just trace the final value */
 	trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
 
 	if (!done)
-		DRM_ERROR("dp aux hw did not signal timeout!\n");
+		DRM_ERROR("%s did not complete or timeout within %ums (status 0x%08x)\n",
+			  intel_dp->aux.name, timeout_ms, status);
 #undef C
 
 	return status;