From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: imre.deak@intel.com
Cc: intel-gfx@lists.freedesktop.org, "Pandiyan,
Dhinakaran" <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH 1/2] drm: add retries for lspcon status check
Date: Wed, 16 Aug 2017 21:18:58 +0530 [thread overview]
Message-ID: <d6d4b078-0fd2-9790-bef8-e17823bd8b14@intel.com> (raw)
In-Reply-To: <20170816140542.zrgoevlgrwzynbyy@ideak-desk.fi.intel.com>
Thanks for the review, Imre.
My comments, inline.
Regards
Shashank
On 8/16/2017 7:35 PM, Imre Deak wrote:
> On Fri, Aug 11, 2017 at 06:58:26PM +0530, Shashank Sharma wrote:
>> It's an observation during some CI tests that few LSPCON chips
>> respond slow while system is under load, and need some delay
>> while reading current mode status using i2c-over-aux channel.
>>
>> This patch:
>> - Adds few retries and delays before declaring a read
>> failure from LSPCON hardware.
>> - Changes the debug level of the print from ERROR->DEBUG
>> whereas another patch in I915 will add an ERROR message
>> from the caller when we have timed out all our limits.
> Hm yea, I was wondering if this is the same issue we saw earlier due to
> HPD not being asserted. But looking at the logs it's not the case. After
> HPD is asserted it really takes this much time (~36ms) for the adaptor
> to respond. This is against the DP 1.4 spec which specifies a 20ms
> maximum wake up time, but what can you do.
>
>> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
>> Cc: 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/drm_dp_dual_mode_helper.c | 14 +++++++++++---
>> 1 file changed, 11 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 80e62f6..c63eac8 100644
>> --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
>> +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
>> @@ -409,6 +409,7 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
>> enum drm_lspcon_mode *mode)
>> {
>> u8 data;
>> + u8 retry = 5;
> Nitpick: no reason for a specific type so just int?
Actually, was trying to save 3 bytes, as I knew max value for retry
would be 5 < 255, but might be too much optimization ?
>> int ret = 0;
>>
>> if (!mode) {
>> @@ -417,10 +418,17 @@ 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));
>> + do {
> Nitpick: a for loop whenever possible is generally clearer.
Sorry, I dint understand this comment, little more help required :) ?
- Shashank
>
> With the above optionally changed:
> Reviewed-by: Imre Deak <imre.deak@intel.com>
>
>> + ret = drm_dp_dual_mode_read(adapter,
>> + DP_DUAL_MODE_LSPCON_CURRENT_MODE,
>> + &data, sizeof(data));
>> + if (!ret || !retry--)
>> + break;
>> + usleep_range(500, 1000);
>> + } while (1);
>> +
>> 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
next prev parent reply other threads:[~2017-08-16 15:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 13:28 [PATCH 1/2] drm: add retries for lspcon status check Shashank Sharma
2017-08-11 13:28 ` [PATCH 2/2] drm/i915: Don't give up waiting on INVALID_MODE Shashank Sharma
2017-08-15 0:21 ` Pandiyan, Dhinakaran
2017-08-16 14:08 ` Imre Deak
2017-08-16 15:50 ` Sharma, Shashank
2017-08-16 14:06 ` Imre Deak
2017-08-11 13:47 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm: add retries for lspcon status check Patchwork
2017-08-14 22:46 ` [PATCH 1/2] " Pandiyan, Dhinakaran
2017-08-16 14:05 ` Imre Deak
2017-08-16 15:48 ` Sharma, Shashank [this message]
2017-08-16 16:12 ` Imre Deak
2017-08-16 16:21 ` Sharma, Shashank
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=d6d4b078-0fd2-9790-bef8-e17823bd8b14@intel.com \
--to=shashank.sharma@intel.com \
--cc=dhinakaran.pandiyan@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 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.