All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manasi Navare <manasi.d.navare@intel.com>
To: Shashank Sharma <shashank.sharma@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] drm: Add retries for dp dual mode read
Date: Thu, 24 Aug 2017 08:47:06 -0700	[thread overview]
Message-ID: <20170824154705.GA442@intel.com> (raw)
In-Reply-To: <1503581023-19748-1-git-send-email-shashank.sharma@intel.com>

On Thu, Aug 24, 2017 at 06:53:43PM +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 dual mode devices (like LSPCON) over i2c-over-aux
> channel.
> 
> This patch:
> - adds some delay and few retries, allowing a scope for these
>   devices to settle down and respond.

How was this delay and number of retries determined? Is there a specific
delay or retry number mentioned in the spec for those LSPCON boards?
If not then how do we know that it is optimised for all LSPCON boards?

Manasi

> - 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)
> 
> 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 | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 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..8263660 100644
> --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> @@ -75,8 +75,16 @@ ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter,
>  		},
>  	};
>  	int ret;
> +	int retry;
> +
> +	for (retry = 0; retry < 6; retry++) {
> +		if (retry)
> +			usleep_range(500, 1000);
> +		ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs));
> +		if (ret >= 0)
> +			break;
> +	}
>  
> -	ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs));
>  	if (ret < 0)
>  		return ret;
>  	if (ret != ARRAY_SIZE(msgs))
> @@ -420,7 +428,7 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
>  	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_LSPCON_CURRENT_MODE,
>  				    &data, sizeof(data));
>  	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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-08-24 15:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 16:11 [PATCH 0/2] Add retries for dp dual mode reads Shashank Sharma
2017-08-22 16:11 ` [PATCH 1/2] drm: Add retries for dp dual mode read Shashank Sharma
2017-08-23 11:59   ` Jani Nikula
2017-08-23 12:42     ` [PATCH v2 " Shashank Sharma
2017-08-24 11:49       ` Imre Deak
2017-08-24 12:10         ` Sharma, Shashank
2017-08-24 12:19           ` Imre Deak
2017-08-24 12:20             ` Sharma, Shashank
2017-08-24 13:23             ` [PATCH v3 " Shashank Sharma
2017-08-24 14:08               ` Ville Syrjälä
2017-08-28  5:50                 ` Sharma, Shashank
2017-08-24 15:47               ` Manasi Navare [this message]
2017-08-22 16:11 ` [PATCH 2/2] drm/i915: Don't give up waiting on INVALID_MODE Shashank Sharma
2017-08-22 17:19 ` ✓ Fi.CI.BAT: success for Add retries for dp dual mode reads Patchwork
2017-08-23 12:58 ` ✓ Fi.CI.BAT: success for Add retries for dp dual mode reads (rev2) Patchwork
2017-08-24 14:30 ` ✗ Fi.CI.BAT: failure for Add retries for dp dual mode reads (rev3) Patchwork
2017-08-25  6:56 ` Patchwork
2017-08-25  9:27 ` Patchwork
2017-08-25 10:39 ` ✓ Fi.CI.BAT: success " Patchwork
2017-08-25 11:36 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20170824154705.GA442@intel.com \
    --to=manasi.d.navare@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shashank.sharma@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 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.