All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Pavan Kunapuli <pkunapuli@nvidia.com>
Cc: linux@arm.linux.org.uk, cjb@laptop.org,
	linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: sdhci: Defer probe if regulator_get fails
Date: Tue, 23 Oct 2012 10:23:58 -0600	[thread overview]
Message-ID: <5086C49E.8040809@wwwdotorg.org> (raw)
In-Reply-To: <1350976709-19248-3-git-send-email-pkunapuli@nvidia.com>

On 10/23/2012 01:18 AM, Pavan Kunapuli wrote:
> vmmc and vqmmc regulators control the voltage to
> the host and device. Defer the probe if either of
> them is not registered.
> 
> Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
> ---
>  drivers/mmc/host/sdhci.c |   25 ++++++++++++++++++++++---
>  1 files changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 7922adb..925c403 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2844,11 +2844,17 @@ int sdhci_add_host(struct sdhci_host *host)
>  	    !(host->mmc->caps & MMC_CAP_NONREMOVABLE))
>  		mmc->caps |= MMC_CAP_NEEDS_POLL;
>  
> -	/* If vqmmc regulator and no 1.8V signalling, then there's no UHS */
> +	/*
> +	 * If vqmmc regulator and no 1.8V signalling, then there's no UHS.
> +	 * vqmmc regulator should be present. If it's not present,
> +	 * assume the regulator driver registration is not yet done and
> +	 * defer the probe.
> +	 */
>  	host->vqmmc = regulator_get(mmc_dev(mmc), "vqmmc");
>  	if (IS_ERR(host->vqmmc)) {
> -		pr_info("%s: no vqmmc regulator found\n", mmc_hostname(mmc));
> +		pr_err("%s: no vqmmc regulator found\n", mmc_hostname(mmc));
>  		host->vqmmc = NULL;
> +		return -EPROBE_DEFER;
>  	}

Right now, the regulator is optional, and any failure to acquire the
regulator is just ignored.

Instead, I think the behaviour we want is:

Attempt to get regulator.
1) If no error -> OK
2) If deferred probe error -> return -EPROBE_DEFER
3) If any other error -> ignore it

Assuming that regulator_get() can explicitly detect and return the
difference between cases (1) and (2) above. If it can't, it seems like
it should be able to.

  parent reply	other threads:[~2012-10-23 16:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23  7:18 [PATCH 0/2] mmc: sdhci: Defer probe if regulators are not registered Pavan Kunapuli
2012-10-23  7:18 ` Pavan Kunapuli
2012-10-23  7:18 ` [PATCH 1/2] ARM: dt: tegra: Add sdhci regulators Pavan Kunapuli
2012-10-23  7:18   ` Pavan Kunapuli
2012-10-23 16:21   ` Stephen Warren
2012-10-23  7:18 ` [PATCH 2/2] mmc: sdhci: Defer probe if regulator_get fails Pavan Kunapuli
2012-10-23  7:18   ` Pavan Kunapuli
2012-10-23 10:10   ` Jaehoon Chung
2012-10-23 10:17     ` Pavan Kunapuli
2012-10-23 16:23   ` Stephen Warren [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-23  7:18 [PATCH 0/2] mmc: sdhci: Defer probe if regulators are not registered Pavan Kunapuli
2012-10-23  7:19 ` [PATCH 2/2] mmc: sdhci: Defer probe if regulator_get fails Pavan Kunapuli
2012-10-23  7:19   ` Pavan Kunapuli
2012-10-23  7:19   ` Pavan Kunapuli
2012-10-23  7:57   ` Lucas Stach
2012-10-23  7:57     ` Lucas Stach
2012-10-23  7:57     ` Lucas Stach
2012-10-23  8:16     ` Pavan Kunapuli
2012-10-23  8:16       ` Pavan Kunapuli
2012-10-23  8:16       ` Pavan Kunapuli
2012-10-23 16:29     ` Stephen Warren
2012-10-23 16:29       ` Stephen Warren
2012-10-23 16:29       ` Stephen Warren
2012-10-23 17:07       ` Mark Brown
2012-10-23 17:07         ` Mark Brown
     [not found]   ` <1350976740-19284-3-git-send-email-pkunapuli-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-10-23 13:21     ` Philip Rakity
2012-10-23 13:21       ` Philip Rakity
2012-10-23 13:21       ` Philip Rakity
     [not found]       ` <4F1DF342-A2C4-434A-B878-A11374089E6E-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-10-23 13:36         ` Russell King - ARM Linux
2012-10-23 13:36           ` Russell King - ARM Linux
2012-10-23 13:36           ` Russell King - ARM Linux

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=5086C49E.8040809@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=pkunapuli@nvidia.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.