public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Kumar, Shobhit" <shobhit.kumar@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, Daniel Vetter <daniel.vetter@intel.com>,
	bloften80@gmail.com
Subject: Re: [PATCH] drm/i915: Retry few time if gpiod_get fails during intel_dsi_init
Date: Tue, 19 Jan 2016 21:00:40 +0530	[thread overview]
Message-ID: <569E56A0.3030903@linux.intel.com> (raw)
In-Reply-To: <1453216500-12571-1-git-send-email-shobhit.kumar@intel.com>

On 01/19/2016 08:45 PM, Shobhit Kumar wrote:
> INTEL_SOC_PMIC is loading later than I915 failing the gpiod_get and
> pwm_get calls in i915. Add a retry to give time for the INTEL_SOC_PMIC
> to load. This was fine till now but broke in latest kernel. Maybe load
> time for the INTEL_SOC_PMIC has increased.
>
> Since the lookup tables for GPIO (panel enable) and PWM both are
> exported by same intel_soc_pmic driver, just retrying for the driver to
> load in intel_dsi_init is sufficient. By the time we come to
> setup_backlight, pwm would have been exported as well.

Maybe we should play with initcalls here but I was not sure how it will 
impact if I change it for PMIC driver. IIRC, this discussion came up 
from Daniel at the time of original patches also but somehow did not 
close decidedly and has come back as a regression.

Regards
Shobhit

>
> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_dsi.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 91cef35..e309ef6 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -1192,10 +1192,14 @@ void intel_dsi_init(struct drm_device *dev)
>   	 * Panel control.
>   	 */
>   	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
> +		int retry = 4;
> +		do {
>   		intel_dsi->gpio_panel =
>   			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
> +			msleep(50);
> +		} while (IS_ERR(intel_dsi->gpio_panel) && --retry);
>
> -		if (IS_ERR(intel_dsi->gpio_panel)) {
> +		if (!retry) {
>   			DRM_ERROR("Failed to own gpio for panel control\n");
>   			intel_dsi->gpio_panel = NULL;
>   		}
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-19 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 15:15 [PATCH] drm/i915: Retry few time if gpiod_get fails during intel_dsi_init Shobhit Kumar
2016-01-19 15:30 ` Kumar, Shobhit [this message]
2016-01-19 20:20   ` Daniel Vetter
2016-01-20  8:38     ` Kumar, Shobhit
2016-01-20  9:01       ` Daniel Vetter
2016-01-19 15:49 ` ✓ Fi.CI.BAT: success for " 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=569E56A0.3030903@linux.intel.com \
    --to=shobhit.kumar@linux.intel.com \
    --cc=bloften80@gmail.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox