All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Various retries for LSPCON
@ 2017-10-10 10:07 Shashank Sharma
  2017-10-10 10:07 ` [PATCH v3 1/3] drm: Add retries for lspcon mode detection Shashank Sharma
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Shashank Sharma @ 2017-10-10 10:07 UTC (permalink / raw)
  To: intel-gfx

This patch series adds various retries and delays
in DRM and I915 layer, to handle some of the read
failures while dealing with LSPCON devices.

LSPCON devices are sometimes slow to respond and
the vendores expect us to retry while probing the
device.

The typical scenarios are getting fixed / handled with
this patch series are look like this failure during LSPCON
suspend/resume:
[drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
[drm:lspcon_wait_mode [i915]] *ERROR* Error reading LSPCON mode
[drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
[drm:lspcon_change_mode.constprop.4 [i915]] *ERROR* Error reading LSPCON mode
[drm:lspcon_resume [i915]] *ERROR* LSPCON resume failed
Setting dangerous option reset - tainting kernel

Shashank Sharma (3):
  drm: Add retries for lspcon mode detection
  drm/i915: Don't give up waiting on INVALID_MODE
  drm/i915: Add retries for LSPCON detection

 drivers/gpu/drm/drm_dp_dual_mode_helper.c | 16 +++++++++++++---
 drivers/gpu/drm/i915/intel_lspcon.c       | 22 +++++++++++++++-------
 2 files changed, 28 insertions(+), 10 deletions(-)

-- 
2.7.4

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/3] drm: Add retries for lspcon mode detection
  2017-10-10 10:07 [PATCH v3 0/3] Various retries for LSPCON Shashank Sharma
@ 2017-10-10 10:07 ` Shashank Sharma
  2017-10-12 13:42   ` Imre Deak
  2017-10-10 10:07 ` [PATCH v3 2/3] drm/i915: Don't give up waiting on INVALID_MODE Shashank Sharma
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Shashank Sharma @ 2017-10-10 10:07 UTC (permalink / raw)
  To: intel-gfx

From the CI builds, its been observed that during a driver
reload/insert, dp dual mode read function sometimes fails to
read from LSPCON device over i2c-over-aux channel.

This patch:
- adds some delay and few retries, allowing a scope for these
  devices to settle down and respond.
- changes one error log's level from ERROR->DEBUG as we want
  to call it an error only after all the retries are exhausted.

V2: Addressed review comments from Jani (for loop for retry)
V3: Addressed review comments from Imre (break on partial read too)
V3: Addressed review comments from Ville/Imre (Add the retries
    exclusively for LSPCON, not for all dp_dual_mode devices)

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/drm_dp_dual_mode_helper.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
index 0ef9011..02a5092 100644
--- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
+++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
@@ -410,6 +410,7 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
 {
 	u8 data;
 	int ret = 0;
+	int retry;
 
 	if (!mode) {
 		DRM_ERROR("NULL input\n");
@@ -417,10 +418,19 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
 	}
 
 	/* Read Status: i2c over aux */
-	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_LSPCON_CURRENT_MODE,
-				    &data, sizeof(data));
+	for (retry = 0; retry < 6; retry++) {
+		if (retry)
+			usleep_range(500, 1000);
+
+		ret = drm_dp_dual_mode_read(adapter,
+					    DP_DUAL_MODE_LSPCON_CURRENT_MODE,
+					    &data, sizeof(data));
+		if (!ret)
+			break;
+	}
+
 	if (ret < 0) {
-		DRM_ERROR("LSPCON read(0x80, 0x41) failed\n");
+		DRM_DEBUG_KMS("LSPCON read(0x80, 0x41) failed\n");
 		return -EFAULT;
 	}
 
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 2/3] drm/i915: Don't give up waiting on INVALID_MODE
  2017-10-10 10:07 [PATCH v3 0/3] Various retries for LSPCON Shashank Sharma
  2017-10-10 10:07 ` [PATCH v3 1/3] drm: Add retries for lspcon mode detection Shashank Sharma
@ 2017-10-10 10:07 ` Shashank Sharma
  2017-10-10 10:07 ` [PATCH v3 3/3] drm/i915: Add retries for LSPCON detection Shashank Sharma
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Shashank Sharma @ 2017-10-10 10:07 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

Our current logic to read LSPCON's current mode, stops retries and
breaks wait-loop, if it gets LSPCON_MODE_INVALID as return from the
core function. This doesn't allow us to try reading the mode again.

This patch removes this condition and allows retries reading
the currnt mode until timeout.

This also fixes/prevents some of the noise in form of debug messages
while running IGT CI test cases.

V2: rebase, added r-b
V2: changed some debug message levels from debug->error and
    error->debug in lspcon_get_current_mode function.
V3: Rebase

Cc: Imre Deak <imre.deak@intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Mahesh Kumar <Mahesh1.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_lspcon.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
index beb9baa..7688254 100644
--- a/drivers/gpu/drm/i915/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -56,7 +56,7 @@ static enum drm_lspcon_mode lspcon_get_current_mode(struct intel_lspcon *lspcon)
 	struct i2c_adapter *adapter = &lspcon_to_intel_dp(lspcon)->aux.ddc;
 
 	if (drm_lspcon_get_mode(adapter, &current_mode)) {
-		DRM_ERROR("Error reading LSPCON mode\n");
+		DRM_DEBUG_KMS("Error reading LSPCON mode\n");
 		return DRM_LSPCON_MODE_INVALID;
 	}
 	return current_mode;
@@ -68,16 +68,15 @@ static enum drm_lspcon_mode lspcon_wait_mode(struct intel_lspcon *lspcon,
 	enum drm_lspcon_mode current_mode;
 
 	current_mode = lspcon_get_current_mode(lspcon);
-	if (current_mode == mode || current_mode == DRM_LSPCON_MODE_INVALID)
+	if (current_mode == mode)
 		goto out;
 
 	DRM_DEBUG_KMS("Waiting for LSPCON mode %s to settle\n",
 		      lspcon_mode_name(mode));
 
-	wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode ||
-		 current_mode == DRM_LSPCON_MODE_INVALID, 100);
+	wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, 100);
 	if (current_mode != mode)
-		DRM_DEBUG_KMS("LSPCON mode hasn't settled\n");
+		DRM_ERROR("LSPCON mode hasn't settled\n");
 
 out:
 	DRM_DEBUG_KMS("Current LSPCON mode %s\n",
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 3/3] drm/i915: Add retries for LSPCON detection
  2017-10-10 10:07 [PATCH v3 0/3] Various retries for LSPCON Shashank Sharma
  2017-10-10 10:07 ` [PATCH v3 1/3] drm: Add retries for lspcon mode detection Shashank Sharma
  2017-10-10 10:07 ` [PATCH v3 2/3] drm/i915: Don't give up waiting on INVALID_MODE Shashank Sharma
@ 2017-10-10 10:07 ` Shashank Sharma
  2017-10-12 13:47   ` Imre Deak
  2017-10-10 10:12 ` [PATCH v3 0/3] Various retries for LSPCON Saarinen, Jani
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Shashank Sharma @ 2017-10-10 10:07 UTC (permalink / raw)
  To: intel-gfx

We read the dp dual mode Adapter identifier to detect the
LSPCON device. It's been observed from the CI testing that in
few cases, this read can get delayed or fail. For such scenarios,
LSPCON vendors suggest to retry the read operation.

This patch adds retry in the probe function, while reading
LSPCON identifier.

V3: added this patch in the series

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/i915/intel_lspcon.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
index 7688254..dcbc786 100644
--- a/drivers/gpu/drm/i915/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -132,6 +132,7 @@ static bool lspcon_wake_native_aux_ch(struct intel_lspcon *lspcon)
 
 static bool lspcon_probe(struct intel_lspcon *lspcon)
 {
+	int retry;
 	enum drm_dp_dual_mode_type adaptor_type;
 	struct i2c_adapter *adapter = &lspcon_to_intel_dp(lspcon)->aux.ddc;
 	enum drm_lspcon_mode expected_mode;
@@ -140,10 +141,18 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
 			DRM_LSPCON_MODE_PCON : DRM_LSPCON_MODE_LS;
 
 	/* Lets probe the adaptor and check its type */
-	adaptor_type = drm_dp_dual_mode_detect(adapter);
+	for (retry = 0; retry < 6; retry++) {
+		if (retry)
+			usleep_range(500, 1000);
+
+		adaptor_type = drm_dp_dual_mode_detect(adapter);
+		if (adaptor_type == DRM_DP_DUAL_MODE_LSPCON)
+			break;
+	}
+
 	if (adaptor_type != DRM_DP_DUAL_MODE_LSPCON) {
 		DRM_DEBUG_KMS("No LSPCON detected, found %s\n",
-			drm_dp_get_dual_mode_type_name(adaptor_type));
+			       drm_dp_get_dual_mode_type_name(adaptor_type));
 		return false;
 	}
 
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/3] Various retries for LSPCON
  2017-10-10 10:07 [PATCH v3 0/3] Various retries for LSPCON Shashank Sharma
                   ` (2 preceding siblings ...)
  2017-10-10 10:07 ` [PATCH v3 3/3] drm/i915: Add retries for LSPCON detection Shashank Sharma
@ 2017-10-10 10:12 ` Saarinen, Jani
  2017-10-10 11:03   ` Sharma, Shashank
  2017-10-10 10:25 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-10-10 11:46 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 1 reply; 11+ messages in thread
From: Saarinen, Jani @ 2017-10-10 10:12 UTC (permalink / raw)
  To: Sharma, Shashank, intel-gfx

Hi, 

> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Shashank Sharma
> Sent: tiistai 10. lokakuuta 2017 13.08
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH v3 0/3] Various retries for LSPCON
> 
> This patch series adds various retries and delays in DRM and I915 layer, to
> handle some of the read failures while dealing with LSPCON devices.
Should we have reference to fdo bugs?
https://bugs.freedesktop.org/show_bug.cgi?id=102294
https://bugs.freedesktop.org/show_bug.cgi?id=102295
and what about this?
https://bugs.freedesktop.org/show_bug.cgi?id=102359

> 
> LSPCON devices are sometimes slow to respond and the vendores expect us
> to retry while probing the device.
> 
> The typical scenarios are getting fixed / handled with this patch series are
> look like this failure during LSPCON
> suspend/resume:
> [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
> [drm:lspcon_wait_mode [i915]] *ERROR* Error reading LSPCON mode
> [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
> [drm:lspcon_change_mode.constprop.4 [i915]] *ERROR* Error reading
> LSPCON mode [drm:lspcon_resume [i915]] *ERROR* LSPCON resume failed
> Setting dangerous option reset - tainting kernel
> 
> Shashank Sharma (3):
>   drm: Add retries for lspcon mode detection
>   drm/i915: Don't give up waiting on INVALID_MODE
>   drm/i915: Add retries for LSPCON detection
> 
>  drivers/gpu/drm/drm_dp_dual_mode_helper.c | 16 +++++++++++++---
>  drivers/gpu/drm/i915/intel_lspcon.c       | 22 +++++++++++++++-------
>  2 files changed, 28 insertions(+), 10 deletions(-)
> 
> --
> 2.7.4


Jani Saarinen
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* ✓ Fi.CI.BAT: success for Various retries for LSPCON
  2017-10-10 10:07 [PATCH v3 0/3] Various retries for LSPCON Shashank Sharma
                   ` (3 preceding siblings ...)
  2017-10-10 10:12 ` [PATCH v3 0/3] Various retries for LSPCON Saarinen, Jani
@ 2017-10-10 10:25 ` Patchwork
  2017-10-10 11:46 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2017-10-10 10:25 UTC (permalink / raw)
  To: Shashank Sharma; +Cc: intel-gfx

== Series Details ==

Series: Various retries for LSPCON
URL   : https://patchwork.freedesktop.org/series/31639/
State : success

== Summary ==

Series 31639v1 Various retries for LSPCON
https://patchwork.freedesktop.org/api/1.0/series/31639/revisions/1/mbox/

Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                dmesg-warn -> PASS       (fi-kbl-7567u) fdo#102294 +3
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-kbl-r) fdo#102846
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                dmesg-warn -> PASS       (fi-cfl-s) fdo#103169
Test drv_module_reload:
        Subgroup basic-reload:
                dmesg-warn -> PASS       (fi-cfl-s) fdo#103186
        Subgroup basic-reload-inject:
                incomplete -> PASS       (fi-cfl-s) fdo#103022

fdo#102294 https://bugs.freedesktop.org/show_bug.cgi?id=102294
fdo#102846 https://bugs.freedesktop.org/show_bug.cgi?id=102846
fdo#103169 https://bugs.freedesktop.org/show_bug.cgi?id=103169
fdo#103186 https://bugs.freedesktop.org/show_bug.cgi?id=103186
fdo#103022 https://bugs.freedesktop.org/show_bug.cgi?id=103022

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:456s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:470s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:395s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:565s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:284s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:516s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:522s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:533s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:514s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:557s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:621s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:428s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:598s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:442s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:417s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:459s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:507s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:471s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:504s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:572s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:486s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:593s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:665s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:478s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:652s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:534s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:518s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:475s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:576s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:431s

6a08510077ad5bdbac044038138f217e413cdca2 drm-tip: 2017y-10m-10d-07h-48m-31s UTC integration manifest
0803f1bdb9cc drm/i915: Add retries for LSPCON detection
919f3410bdf7 drm/i915: Don't give up waiting on INVALID_MODE
714ba04dd953 drm: Add retries for lspcon mode detection

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5967/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/3] Various retries for LSPCON
  2017-10-10 10:12 ` [PATCH v3 0/3] Various retries for LSPCON Saarinen, Jani
@ 2017-10-10 11:03   ` Sharma, Shashank
  2017-10-13  9:19     ` Jani Nikula
  0 siblings, 1 reply; 11+ messages in thread
From: Sharma, Shashank @ 2017-10-10 11:03 UTC (permalink / raw)
  To: Saarinen, Jani, intel-gfx

Regards

Shashank


On 10/10/2017 3:42 PM, Saarinen, Jani wrote:
> Hi,
>
>> -----Original Message-----
>> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf
>> Of Shashank Sharma
>> Sent: tiistai 10. lokakuuta 2017 13.08
>> To: intel-gfx@lists.freedesktop.org
>> Subject: [Intel-gfx] [PATCH v3 0/3] Various retries for LSPCON
>>
>> This patch series adds various retries and delays in DRM and I915 layer, to
>> handle some of the read failures while dealing with LSPCON devices.
> Should we have reference to fdo bugs?
> https://bugs.freedesktop.org/show_bug.cgi?id=102294
> https://bugs.freedesktop.org/show_bug.cgi?id=102295
Yes, sure seems like a good idea.
> and what about this?
> https://bugs.freedesktop.org/show_bug.cgi?id=102359
This seems like one probable candidate :)

- Shashank
>> LSPCON devices are sometimes slow to respond and the vendores expect us
>> to retry while probing the device.
>>
>> The typical scenarios are getting fixed / handled with this patch series are
>> look like this failure during LSPCON
>> suspend/resume:
>> [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
>> [drm:lspcon_wait_mode [i915]] *ERROR* Error reading LSPCON mode
>> [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
>> [drm:lspcon_change_mode.constprop.4 [i915]] *ERROR* Error reading
>> LSPCON mode [drm:lspcon_resume [i915]] *ERROR* LSPCON resume failed
>> Setting dangerous option reset - tainting kernel
>>
>> Shashank Sharma (3):
>>    drm: Add retries for lspcon mode detection
>>    drm/i915: Don't give up waiting on INVALID_MODE
>>    drm/i915: Add retries for LSPCON detection
>>
>>   drivers/gpu/drm/drm_dp_dual_mode_helper.c | 16 +++++++++++++---
>>   drivers/gpu/drm/i915/intel_lspcon.c       | 22 +++++++++++++++-------
>>   2 files changed, 28 insertions(+), 10 deletions(-)
>>
>> --
>> 2.7.4
>
> Jani Saarinen
> Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
>
>

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* ✓ Fi.CI.IGT: success for Various retries for LSPCON
  2017-10-10 10:07 [PATCH v3 0/3] Various retries for LSPCON Shashank Sharma
                   ` (4 preceding siblings ...)
  2017-10-10 10:25 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-10-10 11:46 ` Patchwork
  5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2017-10-10 11:46 UTC (permalink / raw)
  To: Shashank Sharma; +Cc: intel-gfx

== Series Details ==

Series: Various retries for LSPCON
URL   : https://patchwork.freedesktop.org/series/31639/
State : success

== Summary ==

shard-hsw        total:2552 pass:1412 dwarn:24  dfail:0   fail:13  skip:1103 time:9584s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5967/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] drm: Add retries for lspcon mode detection
  2017-10-10 10:07 ` [PATCH v3 1/3] drm: Add retries for lspcon mode detection Shashank Sharma
@ 2017-10-12 13:42   ` Imre Deak
  0 siblings, 0 replies; 11+ messages in thread
From: Imre Deak @ 2017-10-12 13:42 UTC (permalink / raw)
  To: Shashank Sharma; +Cc: intel-gfx

On Tue, Oct 10, 2017 at 03:37:42PM +0530, Shashank Sharma wrote:
> From the CI builds, its been observed that during a driver
> reload/insert, dp dual mode read function sometimes fails to
> read from LSPCON device over i2c-over-aux channel.
> 
> This patch:
> - adds some delay and few retries, allowing a scope for these
>   devices to settle down and respond.
> - changes one error log's level from ERROR->DEBUG as we want
>   to call it an error only after all the retries are exhausted.
> 
> V2: Addressed review comments from Jani (for loop for retry)
> V3: Addressed review comments from Imre (break on partial read too)
> V3: Addressed review comments from Ville/Imre (Add the retries
>     exclusively for LSPCON, not for all dp_dual_mode devices)
> 
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/drm_dp_dual_mode_helper.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> index 0ef9011..02a5092 100644
> --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> @@ -410,6 +410,7 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
>  {
>  	u8 data;
>  	int ret = 0;
> +	int retry;
>  
>  	if (!mode) {
>  		DRM_ERROR("NULL input\n");
> @@ -417,10 +418,19 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
>  	}
>  
>  	/* Read Status: i2c over aux */
> -	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_LSPCON_CURRENT_MODE,
> -				    &data, sizeof(data));
> +	for (retry = 0; retry < 6; retry++) {
> +		if (retry)
> +			usleep_range(500, 1000);
> +
> +		ret = drm_dp_dual_mode_read(adapter,
> +					    DP_DUAL_MODE_LSPCON_CURRENT_MODE,
> +					    &data, sizeof(data));
> +		if (!ret)
> +			break;
> +	}
> +
>  	if (ret < 0) {
> -		DRM_ERROR("LSPCON read(0x80, 0x41) failed\n");
> +		DRM_DEBUG_KMS("LSPCON read(0x80, 0x41) failed\n");
>  		return -EFAULT;
>  	}
>  
> -- 
> 2.7.4
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 3/3] drm/i915: Add retries for LSPCON detection
  2017-10-10 10:07 ` [PATCH v3 3/3] drm/i915: Add retries for LSPCON detection Shashank Sharma
@ 2017-10-12 13:47   ` Imre Deak
  0 siblings, 0 replies; 11+ messages in thread
From: Imre Deak @ 2017-10-12 13:47 UTC (permalink / raw)
  To: Shashank Sharma; +Cc: intel-gfx

On Tue, Oct 10, 2017 at 03:37:44PM +0530, Shashank Sharma wrote:
> We read the dp dual mode Adapter identifier to detect the
> LSPCON device. It's been observed from the CI testing that in
> few cases, this read can get delayed or fail. For such scenarios,
> LSPCON vendors suggest to retry the read operation.
> 
> This patch adds retry in the probe function, while reading
> LSPCON identifier.
> 
> V3: added this patch in the series
> 
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_lspcon.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
> index 7688254..dcbc786 100644
> --- a/drivers/gpu/drm/i915/intel_lspcon.c
> +++ b/drivers/gpu/drm/i915/intel_lspcon.c
> @@ -132,6 +132,7 @@ static bool lspcon_wake_native_aux_ch(struct intel_lspcon *lspcon)
>  
>  static bool lspcon_probe(struct intel_lspcon *lspcon)
>  {
> +	int retry;
>  	enum drm_dp_dual_mode_type adaptor_type;
>  	struct i2c_adapter *adapter = &lspcon_to_intel_dp(lspcon)->aux.ddc;
>  	enum drm_lspcon_mode expected_mode;
> @@ -140,10 +141,18 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
>  			DRM_LSPCON_MODE_PCON : DRM_LSPCON_MODE_LS;
>  
>  	/* Lets probe the adaptor and check its type */
> -	adaptor_type = drm_dp_dual_mode_detect(adapter);
> +	for (retry = 0; retry < 6; retry++) {
> +		if (retry)
> +			usleep_range(500, 1000);
> +
> +		adaptor_type = drm_dp_dual_mode_detect(adapter);
> +		if (adaptor_type == DRM_DP_DUAL_MODE_LSPCON)

I wondered if this should be (adaptor_type != DRM_DP_DUAL_MODE_UNKNOWN),
since the other cases are not known to cause a problem. But we'll probe
LSPCON only if VBT says so and if VBT is broken we'll anyway incur the
retry overhead here. So looks ok:

Reviewed-by: Imre Deak <imre.deak@intel.com>

> +			break;
> +	}
> +
>  	if (adaptor_type != DRM_DP_DUAL_MODE_LSPCON) {
>  		DRM_DEBUG_KMS("No LSPCON detected, found %s\n",
> -			drm_dp_get_dual_mode_type_name(adaptor_type));
> +			       drm_dp_get_dual_mode_type_name(adaptor_type));
>  		return false;
>  	}
>  
> -- 
> 2.7.4
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/3] Various retries for LSPCON
  2017-10-10 11:03   ` Sharma, Shashank
@ 2017-10-13  9:19     ` Jani Nikula
  0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2017-10-13  9:19 UTC (permalink / raw)
  To: Sharma, Shashank, Saarinen, Jani, intel-gfx

On Tue, 10 Oct 2017, "Sharma, Shashank" <shashank.sharma@intel.com> wrote:
> Regards
>
> Shashank
>
>
> On 10/10/2017 3:42 PM, Saarinen, Jani wrote:
>> Hi,
>>
>>> -----Original Message-----
>>> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf
>>> Of Shashank Sharma
>>> Sent: tiistai 10. lokakuuta 2017 13.08
>>> To: intel-gfx@lists.freedesktop.org
>>> Subject: [Intel-gfx] [PATCH v3 0/3] Various retries for LSPCON
>>>
>>> This patch series adds various retries and delays in DRM and I915 layer, to
>>> handle some of the read failures while dealing with LSPCON devices.
>> Should we have reference to fdo bugs?
>> https://bugs.freedesktop.org/show_bug.cgi?id=102294
>> https://bugs.freedesktop.org/show_bug.cgi?id=102295
> Yes, sure seems like a good idea.
>> and what about this?
>> https://bugs.freedesktop.org/show_bug.cgi?id=102359
> This seems like one probable candidate :)

Pushed the series, thanks for the patches and review. Added a bunch of
likely Bugzilla links to all commits, didn't bother with mapping commits
and bugs. Probably the whole series is needed for most of them anyway.

BR,
Jani.


>
> - Shashank
>>> LSPCON devices are sometimes slow to respond and the vendores expect us
>>> to retry while probing the device.
>>>
>>> The typical scenarios are getting fixed / handled with this patch series are
>>> look like this failure during LSPCON
>>> suspend/resume:
>>> [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
>>> [drm:lspcon_wait_mode [i915]] *ERROR* Error reading LSPCON mode
>>> [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
>>> [drm:lspcon_change_mode.constprop.4 [i915]] *ERROR* Error reading
>>> LSPCON mode [drm:lspcon_resume [i915]] *ERROR* LSPCON resume failed
>>> Setting dangerous option reset - tainting kernel
>>>
>>> Shashank Sharma (3):
>>>    drm: Add retries for lspcon mode detection
>>>    drm/i915: Don't give up waiting on INVALID_MODE
>>>    drm/i915: Add retries for LSPCON detection
>>>
>>>   drivers/gpu/drm/drm_dp_dual_mode_helper.c | 16 +++++++++++++---
>>>   drivers/gpu/drm/i915/intel_lspcon.c       | 22 +++++++++++++++-------
>>>   2 files changed, 28 insertions(+), 10 deletions(-)
>>>
>>> --
>>> 2.7.4
>>
>> Jani Saarinen
>> Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
>>
>>
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-10-13  9:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 10:07 [PATCH v3 0/3] Various retries for LSPCON Shashank Sharma
2017-10-10 10:07 ` [PATCH v3 1/3] drm: Add retries for lspcon mode detection Shashank Sharma
2017-10-12 13:42   ` Imre Deak
2017-10-10 10:07 ` [PATCH v3 2/3] drm/i915: Don't give up waiting on INVALID_MODE Shashank Sharma
2017-10-10 10:07 ` [PATCH v3 3/3] drm/i915: Add retries for LSPCON detection Shashank Sharma
2017-10-12 13:47   ` Imre Deak
2017-10-10 10:12 ` [PATCH v3 0/3] Various retries for LSPCON Saarinen, Jani
2017-10-10 11:03   ` Sharma, Shashank
2017-10-13  9:19     ` Jani Nikula
2017-10-10 10:25 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-10 11:46 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.