Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214406 > unrolled thread

[PATCH v3 00/15] omap_hsmmc: regulator usage cleanup and fixes

Started byKishon Vijay Abraham I <kishon@ti.com>
First post2015-08-27 11:20 +0200
Last post2015-08-27 15:30 +0200
Articles 20 on this page of 30 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 00/15] omap_hsmmc: regulator usage cleanup and fixes Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 09/15] mmc: host: omap_hsmmc: add separate function to set pbias Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
      Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled  to find pbias status Ulf Hansson <ulf.hansson@linaro.org> - 2015-08-27 14:50 +0200
        Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled  to find pbias status Ulf Hansson <ulf.hansson@linaro.org> - 2015-08-27 14:50 +0200
        Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled  to find pbias status Ulf Hansson <ulf.hansson@linaro.org> - 2015-08-27 14:50 +0200
          Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled  to find pbias status Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 14:50 +0200
    [PATCH v3 01/15] mmc: host: omap_hsmmc: use devm_regulator_get_optional() for vmmc Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 11/15] mmc: host: omap_hsmmc: don't use ->set_power to set initial regulator state Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 03/15] mmc: host: omap_hsmmc: cleanup omap_hsmmc_reg_get() Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 06/15] mmc: host: omap_hsmmc: remove unnecessary pbias set_voltage Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 08/15] mmc: host: omap_hsmmc: add separate functions for enable/disable supply Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 12/15] mmc: host: omap_hsmmc: enable/disable vmmc_aux regulator based on previous state Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 14/15] mmc: host: omap_hsmmc: use ios->vdd for setting vmmc voltage Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 05/15] mmc: host: omap_hsmmc: use mmc_host's vmmc and vqmmc Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
      Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Olof Johansson <olof@lixom.net> - 2015-08-28 20:10 +0200
        Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Tony Lindgren <tony@atomide.com> - 2015-08-28 21:10 +0200
          Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-31 07:50 +0200
            Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Tony Lindgren <tony@atomide.com> - 2015-08-31 23:00 +0200
              Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Tony Lindgren <tony@atomide.com> - 2015-08-31 23:20 +0200
                Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Grygorii Strashko <grygorii.strashko@ti.com> - 2015-09-01 16:40 +0200
                  Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Grygorii Strashko <grygorii.strashko@ti.com> - 2015-09-01 17:00 +0200
                    Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Tony Lindgren <tony@atomide.com> - 2015-09-01 17:10 +0200
                  Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors  from omap_hsmmc_reg_get Tony Lindgren <tony@atomide.com> - 2015-09-01 17:00 +0200
    [PATCH v3 04/15] mmc: host: omap_hsmmc: use the ocrmask provided by the vmmc regulator Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 07/15] mmc: host: omap_hsmmc: return error if any of the regulator APIs fail Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    [PATCH v3 10/15] mmc: host: omap_hsmmc: avoid pbias regulator enable on power off Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 11:20 +0200
    Re: [PATCH v3 00/15] omap_hsmmc: regulator usage cleanup and fixes Ulf Hansson <ulf.hansson@linaro.org> - 2015-08-27 15:10 +0200
      Re: [PATCH v3 00/15] omap_hsmmc: regulator usage cleanup and fixes Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-27 15:30 +0200

Page 1 of 2  [1] 2  Next page →


#1214406 — [PATCH v3 00/15] omap_hsmmc: regulator usage cleanup and fixes

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 00/15] omap_hsmmc: regulator usage cleanup and fixes
Message-ID<q21vH-8z-3@gated-at.bofh.it>
This patch series does the following
*) Uses devm_regulator_get_optional() for vmmc and then removes the
   CONFIG_REGULATOR check altogether.
*) return on -EPROBE_DEFER and any other fatal errors
*) enable/disable vmmc_aux regulator based on prior state

Changes from v2:
*) rebased to mmc -next branch
*) dropped using "mmc_of_parse_voltage" to get ocr_avail patch.

Changes from v1:
*) return on -EPROBE_DEFER and other fatal errors. (Don't return only
   if the return value is -ENODEV)
*) Remove the beagle x15 dts patch. It can be part of a different
   series.
*) Avoid using regulator_is_enabled for vqmmc since if the regulator
   is shared and the other users are not using regulator_is_enabled
   then there can be unbalanced regulator_enable/regulator_disable

I've pushed this patch series to
git://git.ti.com/linux-phy/linux-phy.git mmc_for-next

Please note the branch also has the pbias fixes [1].
[1] -> https://lkml.org/lkml/2015/7/27/358

This series is in preparation for implementing the voltage switch
sequence so that UHS cards can be supported.

Did basic read/write test in J6, J6 Eco, Beagle-x15, AM437x EVM,
Beaglebone black, OMAP5 uEVM, OMAP4 PANDA and OMAP3gle xm.

Kishon Vijay Abraham I (15):
  mmc: host: omap_hsmmc: use devm_regulator_get_optional() for vmmc
  mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get
  mmc: host: omap_hsmmc: cleanup omap_hsmmc_reg_get()
  mmc: host: omap_hsmmc: use the ocrmask provided by the vmmc regulator
  mmc: host: omap_hsmmc: use mmc_host's vmmc and vqmmc
  mmc: host: omap_hsmmc: remove unnecessary pbias set_voltage
  mmc: host: omap_hsmmc: return error if any of the regulator APIs fail
  mmc: host: omap_hsmmc: add separate functions for enable/disable
    supply
  mmc: host: omap_hsmmc: add separate function to set pbias
  mmc: host: omap_hsmmc: avoid pbias regulator enable on power off
  mmc: host: omap_hsmmc: don't use ->set_power to set initial regulator
    state
  mmc: host: omap_hsmmc: enable/disable vmmc_aux regulator based on
    previous state
  mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status
  mmc: host: omap_hsmmc: use ios->vdd for setting vmmc voltage
  mmc: host: omap_hsmmc: remove CONFIG_REGULATOR check

 drivers/mmc/host/omap_hsmmc.c |  326 +++++++++++++++++++++++++++--------------
 1 file changed, 212 insertions(+), 114 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1214407 — [PATCH v3 09/15] mmc: host: omap_hsmmc: add separate function to set pbias

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 09/15] mmc: host: omap_hsmmc: add separate function to set pbias
Message-ID<q21vI-8z-11@gated-at.bofh.it>
In reply to#1214406
No functional change. Cleanup omap_hsmmc_set_power by adding separate
functions to set pbias and invoke it from omap_hsmmc_set_power.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |   78 +++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 30 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 3fa78d4..810d612 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -305,6 +305,48 @@ err_set_ocr:
 	return ret;
 }
 
+static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
+				int vdd)
+{
+	int ret;
+
+	if (!host->pbias)
+		return 0;
+
+	if (power_on) {
+		if (vdd <= VDD_165_195)
+			ret = regulator_set_voltage(host->pbias, VDD_1V8,
+						    VDD_1V8);
+		else
+			ret = regulator_set_voltage(host->pbias, VDD_3V0,
+						    VDD_3V0);
+		if (ret < 0) {
+			dev_err(host->dev, "pbias set voltage fail\n");
+			return ret;
+		}
+
+		if (host->pbias_enabled == 0) {
+			ret = regulator_enable(host->pbias);
+			if (ret) {
+				dev_err(host->dev, "pbias reg enable fail\n");
+				return ret;
+			}
+			host->pbias_enabled = 1;
+		}
+	} else {
+		if (host->pbias_enabled == 1) {
+			ret = regulator_disable(host->pbias);
+			if (ret) {
+				dev_err(host->dev, "pbias reg disable fail\n");
+				return ret;
+			}
+			host->pbias_enabled = 0;
+		}
+	}
+
+	return 0;
+}
+
 static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 {
 	struct omap_hsmmc_host *host =
@@ -325,16 +367,9 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 	if (mmc_pdata(host)->before_set_reg)
 		mmc_pdata(host)->before_set_reg(dev, power_on, vdd);
 
-	if (host->pbias) {
-		if (host->pbias_enabled == 1) {
-			ret = regulator_disable(host->pbias);
-			if (ret) {
-				dev_err(dev, "pbias reg disable failed\n");
-				return ret;
-			}
-			host->pbias_enabled = 0;
-		}
-	}
+	ret = omap_hsmmc_set_pbias(host, false, 0);
+	if (ret)
+		return ret;
 
 	/*
 	 * Assume Vcc regulator is used only to power the card ... OMAP
@@ -359,26 +394,9 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 			return ret;
 	}
 
-	if (host->pbias) {
-		if (vdd <= VDD_165_195)
-			ret = regulator_set_voltage(host->pbias, VDD_1V8,
-								VDD_1V8);
-		else
-			ret = regulator_set_voltage(host->pbias, VDD_3V0,
-								VDD_3V0);
-		if (ret < 0)
-			goto err_set_voltage;
-
-		if (host->pbias_enabled == 0) {
-			ret = regulator_enable(host->pbias);
-			if (ret) {
-				dev_err(dev, "pbias reg enable failed\n");
-				goto err_set_voltage;
-			} else {
-				host->pbias_enabled = 1;
-			}
-		}
-	}
+	ret = omap_hsmmc_set_pbias(host, true, vdd);
+	if (ret)
+		goto err_set_voltage;
 
 	if (mmc_pdata(host)->after_set_reg)
 		mmc_pdata(host)->after_set_reg(dev, power_on, vdd);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214408 — [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status
Message-ID<q21vI-8z-13@gated-at.bofh.it>
In reply to#1214406
Use regulator_is_enabled of pbias regulator to find pbias regulator
status instead of maintaining a custom bookkeeping
pbias_enabled variable.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 5a5946a..4cd7a58 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -182,7 +182,6 @@ struct omap_hsmmc_host {
 	struct	clk		*fclk;
 	struct	clk		*dbclk;
 	struct	regulator	*pbias;
-	bool			pbias_enabled;
 	void	__iomem		*base;
 	int			vqmmc_enabled;
 	resource_size_t		mapbase;
@@ -330,22 +329,20 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
 			return ret;
 		}
 
-		if (host->pbias_enabled == 0) {
+		if (!regulator_is_enabled(host->pbias)) {
 			ret = regulator_enable(host->pbias);
 			if (ret) {
 				dev_err(host->dev, "pbias reg enable fail\n");
 				return ret;
 			}
-			host->pbias_enabled = 1;
 		}
 	} else {
-		if (host->pbias_enabled == 1) {
+		if (regulator_is_enabled(host->pbias)) {
 			ret = regulator_disable(host->pbias);
 			if (ret) {
 				dev_err(host->dev, "pbias reg disable fail\n");
 				return ret;
 			}
-			host->pbias_enabled = 0;
 		}
 	}
 
@@ -2081,7 +2078,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	host->base	= base + pdata->reg_offset;
 	host->power_mode = MMC_POWER_OFF;
 	host->next_data.cookie = 1;
-	host->pbias_enabled = 0;
 	host->vqmmc_enabled = 0;
 
 	ret = omap_hsmmc_gpio_init(mmc, host, pdata);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214529 — Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status

FromUlf Hansson <ulf.hansson@linaro.org>
Date2015-08-27 14:50 +0200
SubjectRe: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status
Message-ID<q24MW-4IH-13@gated-at.bofh.it>
In reply to#1214408
On 27 August 2015 at 11:14, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> Use regulator_is_enabled of pbias regulator to find pbias regulator
> status instead of maintaining a custom bookkeeping
> pbias_enabled variable.

Doesn't this cause a problem for the scenario when the initial state
of the regulator is enabled?

Both in the sense that you will increase the enable count for it
(potentially it may then become disabled when you need it enabled) but
also from a enable/disable imbalance point of view.

Kind regards
Uffe

>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Tested-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |    8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 5a5946a..4cd7a58 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -182,7 +182,6 @@ struct omap_hsmmc_host {
>         struct  clk             *fclk;
>         struct  clk             *dbclk;
>         struct  regulator       *pbias;
> -       bool                    pbias_enabled;
>         void    __iomem         *base;
>         int                     vqmmc_enabled;
>         resource_size_t         mapbase;
> @@ -330,22 +329,20 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
>                         return ret;
>                 }
>
> -               if (host->pbias_enabled == 0) {
> +               if (!regulator_is_enabled(host->pbias)) {
>                         ret = regulator_enable(host->pbias);
>                         if (ret) {
>                                 dev_err(host->dev, "pbias reg enable fail\n");
>                                 return ret;
>                         }
> -                       host->pbias_enabled = 1;
>                 }
>         } else {
> -               if (host->pbias_enabled == 1) {
> +               if (regulator_is_enabled(host->pbias)) {
>                         ret = regulator_disable(host->pbias);
>                         if (ret) {
>                                 dev_err(host->dev, "pbias reg disable fail\n");
>                                 return ret;
>                         }
> -                       host->pbias_enabled = 0;
>                 }
>         }
>
> @@ -2081,7 +2078,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>         host->base      = base + pdata->reg_offset;
>         host->power_mode = MMC_POWER_OFF;
>         host->next_data.cookie = 1;
> -       host->pbias_enabled = 0;
>         host->vqmmc_enabled = 0;
>
>         ret = omap_hsmmc_gpio_init(mmc, host, pdata);
> --
> 1.7.9.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214530 — Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status

FromUlf Hansson <ulf.hansson@linaro.org>
Date2015-08-27 14:50 +0200
SubjectRe: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status
Message-ID<q24MW-4IH-21@gated-at.bofh.it>
In reply to#1214529
On 27 August 2015 at 14:47, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> Hi Uffe,
>
> On Thursday 27 August 2015 06:12 PM, Ulf Hansson wrote:
>> On 27 August 2015 at 14:41, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>> On 27 August 2015 at 11:14, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>>>> Use regulator_is_enabled of pbias regulator to find pbias regulator
>>>> status instead of maintaining a custom bookkeeping
>>>> pbias_enabled variable.
>>>
>>> Doesn't this cause a problem for the scenario when the initial state
>>> of the regulator is enabled?
>
> Patch 11 of this series "mmc: host: omap_hsmmc: don't use ->set_power to
> set initial regulator state" disables the pbias regulator if the initial
> state of the regulator is enabled.
>

Got it, thanks!

[...]

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214531 — Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status

FromUlf Hansson <ulf.hansson@linaro.org>
Date2015-08-27 14:50 +0200
SubjectRe: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status
Message-ID<q24MW-4IH-11@gated-at.bofh.it>
In reply to#1214529
On 27 August 2015 at 14:41, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 27 August 2015 at 11:14, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>> Use regulator_is_enabled of pbias regulator to find pbias regulator
>> status instead of maintaining a custom bookkeeping
>> pbias_enabled variable.
>
> Doesn't this cause a problem for the scenario when the initial state
> of the regulator is enabled?
>
> Both in the sense that you will increase the enable count for it

/s/will/won't

> (potentially it may then become disabled when you need it enabled) but
> also from a enable/disable imbalance point of view.
>
> Kind regards
> Uffe
>
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> Tested-by: Tony Lindgren <tony@atomide.com>
>> ---
>>  drivers/mmc/host/omap_hsmmc.c |    8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> index 5a5946a..4cd7a58 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -182,7 +182,6 @@ struct omap_hsmmc_host {
>>         struct  clk             *fclk;
>>         struct  clk             *dbclk;
>>         struct  regulator       *pbias;
>> -       bool                    pbias_enabled;
>>         void    __iomem         *base;
>>         int                     vqmmc_enabled;
>>         resource_size_t         mapbase;
>> @@ -330,22 +329,20 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
>>                         return ret;
>>                 }
>>
>> -               if (host->pbias_enabled == 0) {
>> +               if (!regulator_is_enabled(host->pbias)) {
>>                         ret = regulator_enable(host->pbias);
>>                         if (ret) {
>>                                 dev_err(host->dev, "pbias reg enable fail\n");
>>                                 return ret;
>>                         }
>> -                       host->pbias_enabled = 1;
>>                 }
>>         } else {
>> -               if (host->pbias_enabled == 1) {
>> +               if (regulator_is_enabled(host->pbias)) {
>>                         ret = regulator_disable(host->pbias);
>>                         if (ret) {
>>                                 dev_err(host->dev, "pbias reg disable fail\n");
>>                                 return ret;
>>                         }
>> -                       host->pbias_enabled = 0;
>>                 }
>>         }
>>
>> @@ -2081,7 +2078,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>>         host->base      = base + pdata->reg_offset;
>>         host->power_mode = MMC_POWER_OFF;
>>         host->next_data.cookie = 1;
>> -       host->pbias_enabled = 0;
>>         host->vqmmc_enabled = 0;
>>
>>         ret = omap_hsmmc_gpio_init(mmc, host, pdata);
>> --
>> 1.7.9.5
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214543 — Re: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 14:50 +0200
SubjectRe: [PATCH v3 13/15] mmc: host: omap_hsmmc: use regulator_is_enabled to find pbias status
Message-ID<q24MW-4IH-23@gated-at.bofh.it>
In reply to#1214531
Hi Uffe,

On Thursday 27 August 2015 06:12 PM, Ulf Hansson wrote:
> On 27 August 2015 at 14:41, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 27 August 2015 at 11:14, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>>> Use regulator_is_enabled of pbias regulator to find pbias regulator
>>> status instead of maintaining a custom bookkeeping
>>> pbias_enabled variable.
>>
>> Doesn't this cause a problem for the scenario when the initial state
>> of the regulator is enabled?

Patch 11 of this series "mmc: host: omap_hsmmc: don't use ->set_power to
set initial regulator state" disables the pbias regulator if the initial
state of the regulator is enabled.

Thanks
Kishon
>>
>> Both in the sense that you will increase the enable count for it
> 
> /s/will/won't
> 
>> (potentially it may then become disabled when you need it enabled) but
>> also from a enable/disable imbalance point of view.
>>
>> Kind regards
>> Uffe
>>
>>>
>>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>>> Tested-by: Tony Lindgren <tony@atomide.com>
>>> ---
>>>  drivers/mmc/host/omap_hsmmc.c |    8 ++------
>>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>>> index 5a5946a..4cd7a58 100644
>>> --- a/drivers/mmc/host/omap_hsmmc.c
>>> +++ b/drivers/mmc/host/omap_hsmmc.c
>>> @@ -182,7 +182,6 @@ struct omap_hsmmc_host {
>>>         struct  clk             *fclk;
>>>         struct  clk             *dbclk;
>>>         struct  regulator       *pbias;
>>> -       bool                    pbias_enabled;
>>>         void    __iomem         *base;
>>>         int                     vqmmc_enabled;
>>>         resource_size_t         mapbase;
>>> @@ -330,22 +329,20 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
>>>                         return ret;
>>>                 }
>>>
>>> -               if (host->pbias_enabled == 0) {
>>> +               if (!regulator_is_enabled(host->pbias)) {
>>>                         ret = regulator_enable(host->pbias);
>>>                         if (ret) {
>>>                                 dev_err(host->dev, "pbias reg enable fail\n");
>>>                                 return ret;
>>>                         }
>>> -                       host->pbias_enabled = 1;
>>>                 }
>>>         } else {
>>> -               if (host->pbias_enabled == 1) {
>>> +               if (regulator_is_enabled(host->pbias)) {
>>>                         ret = regulator_disable(host->pbias);
>>>                         if (ret) {
>>>                                 dev_err(host->dev, "pbias reg disable fail\n");
>>>                                 return ret;
>>>                         }
>>> -                       host->pbias_enabled = 0;
>>>                 }
>>>         }
>>>
>>> @@ -2081,7 +2078,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>>>         host->base      = base + pdata->reg_offset;
>>>         host->power_mode = MMC_POWER_OFF;
>>>         host->next_data.cookie = 1;
>>> -       host->pbias_enabled = 0;
>>>         host->vqmmc_enabled = 0;
>>>
>>>         ret = omap_hsmmc_gpio_init(mmc, host, pdata);
>>> --
>>> 1.7.9.5
>>>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214410 — [PATCH v3 01/15] mmc: host: omap_hsmmc: use devm_regulator_get_optional() for vmmc

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 01/15] mmc: host: omap_hsmmc: use devm_regulator_get_optional() for vmmc
Message-ID<q21vI-8z-15@gated-at.bofh.it>
In reply to#1214406
Since vmmc can be optional for some platforms, use
devm_regulator_get_optional() for vmmc. Now return error only
if the return value of devm_regulator_get_optional() is not the
same as -ENODEV, since with -EPROBE_DEFER, the regulator can be
obtained later and all other errors are fatal.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 19ae7e6..9b335af 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -345,15 +345,19 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
 	struct regulator *reg;
 	int ocr_value = 0;
+	int ret;
 
 	if (mmc_pdata(host)->set_power)
 		return 0;
 
-	reg = devm_regulator_get(host->dev, "vmmc");
+	reg = devm_regulator_get_optional(host->dev, "vmmc");
 	if (IS_ERR(reg)) {
-		dev_err(host->dev, "unable to get vmmc regulator %ld\n",
+		ret = PTR_ERR(reg);
+		if (ret != -ENODEV)
+			return ret;
+		host->vcc = NULL;
+		dev_dbg(host->dev, "unable to get vmmc regulator %ld\n",
 			PTR_ERR(reg));
-		return PTR_ERR(reg);
 	} else {
 		host->vcc = reg;
 		ocr_value = mmc_regulator_get_ocrmask(reg);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214411 — [PATCH v3 11/15] mmc: host: omap_hsmmc: don't use ->set_power to set initial regulator state

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 11/15] mmc: host: omap_hsmmc: don't use ->set_power to set initial regulator state
Message-ID<q21vI-8z-17@gated-at.bofh.it>
In reply to#1214406
If the regulator is enabled on boot (checked using regulator_is_enabled),
invoke regulator_enable() so that the usecount reflects the correct
state of the regulator and then disable the regulator so that the
initial state of the regulator is disabled. Avoid using ->set_power,
since set_power also takes care of setting the voltages which is not
needed at this point.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |   66 ++++++++++++++++++++++++++++++++++-------
 1 file changed, 56 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index eec6975..cd4bd6d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -409,6 +409,59 @@ err_set_voltage:
 	return ret;
 }
 
+static int omap_hsmmc_disable_boot_regulator(struct regulator *reg)
+{
+	int ret;
+
+	if (!reg)
+		return 0;
+
+	if (regulator_is_enabled(reg)) {
+		ret = regulator_enable(reg);
+		if (ret)
+			return ret;
+
+		ret = regulator_disable(reg);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+
+static int omap_hsmmc_disable_boot_regulators(struct omap_hsmmc_host *host)
+{
+	struct mmc_host *mmc = host->mmc;
+	int ret;
+
+	/*
+	 * disable regulators enabled during boot and get the usecount
+	 * right so that regulators can be enabled/disabled by checking
+	 * the return value of regulator_is_enabled
+	 */
+	ret = omap_hsmmc_disable_boot_regulator(mmc->supply.vmmc);
+	if (ret) {
+		dev_err(host->dev, "fail to disable boot enabled vmmc reg\n");
+		return ret;
+	}
+
+	ret = omap_hsmmc_disable_boot_regulator(mmc->supply.vqmmc);
+	if (ret) {
+		dev_err(host->dev,
+			"fail to disable boot enabled vmmc_aux reg\n");
+		return ret;
+	}
+
+	ret = omap_hsmmc_disable_boot_regulator(host->pbias);
+	if (ret) {
+		dev_err(host->dev,
+			"failed to disable boot enabled pbias reg\n");
+		return ret;
+	}
+
+	return 0;
+}
+
 static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
 	int ocr_value = 0;
@@ -456,17 +509,10 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 	/* For eMMC do not power off when not in sleep state */
 	if (mmc_pdata(host)->no_regulator_off_init)
 		return 0;
-	/*
-	 * To disable boot_on regulator, enable regulator
-	 * to increase usecount and then disable it.
-	 */
-	if ((mmc->supply.vmmc && regulator_is_enabled(mmc->supply.vmmc) > 0) ||
-	    (mmc->supply.vqmmc && regulator_is_enabled(mmc->supply.vqmmc))) {
-		int vdd = ffs(mmc_pdata(host)->ocr_mask) - 1;
 
-		omap_hsmmc_set_power(host->dev, 1, vdd);
-		omap_hsmmc_set_power(host->dev, 0, 0);
-	}
+	ret = omap_hsmmc_disable_boot_regulators(host);
+	if (ret)
+		return ret;
 
 	return 0;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214412 — [PATCH v3 03/15] mmc: host: omap_hsmmc: cleanup omap_hsmmc_reg_get()

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 03/15] mmc: host: omap_hsmmc: cleanup omap_hsmmc_reg_get()
Message-ID<q21vI-8z-23@gated-at.bofh.it>
In reply to#1214406
No functional change. Instead of using a local regulator variable
in omap_hsmmc_reg_get() for holding the return value of
devm_regulator_get_optional() and then assigning to omap_hsmmc_host
regulator members: vcc, vcc_aux and pbias, directly use the
omap_hsmmc_host regulator members.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |   38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 2eafd6f..3fde2f9 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -343,24 +343,22 @@ error_set_power:
 
 static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
-	struct regulator *reg;
 	int ocr_value = 0;
 	int ret;
 
 	if (mmc_pdata(host)->set_power)
 		return 0;
 
-	reg = devm_regulator_get_optional(host->dev, "vmmc");
-	if (IS_ERR(reg)) {
-		ret = PTR_ERR(reg);
+	host->vcc = devm_regulator_get_optional(host->dev, "vmmc");
+	if (IS_ERR(host->vcc)) {
+		ret = PTR_ERR(host->vcc);
 		if (ret != -ENODEV)
 			return ret;
-		host->vcc = NULL;
 		dev_dbg(host->dev, "unable to get vmmc regulator %ld\n",
-			PTR_ERR(reg));
+			PTR_ERR(host->vcc));
+		host->vcc = NULL;
 	} else {
-		host->vcc = reg;
-		ocr_value = mmc_regulator_get_ocrmask(reg);
+		ocr_value = mmc_regulator_get_ocrmask(host->vcc);
 		if (!mmc_pdata(host)->ocr_mask) {
 			mmc_pdata(host)->ocr_mask = ocr_value;
 		} else {
@@ -374,28 +372,24 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 	}
 
 	/* Allow an aux regulator */
-	reg = devm_regulator_get_optional(host->dev, "vmmc_aux");
-	if (IS_ERR(reg)) {
-		ret = PTR_ERR(reg);
+	host->vcc_aux = devm_regulator_get_optional(host->dev, "vmmc_aux");
+	if (IS_ERR(host->vcc_aux)) {
+		ret = PTR_ERR(host->vcc_aux);
 		if (ret != -ENODEV)
 			return ret;
-		host->vcc_aux = NULL;
 		dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n",
-			PTR_ERR(reg));
-	} else {
-		host->vcc_aux = reg;
+			PTR_ERR(host->vcc_aux));
+		host->vcc_aux = NULL;
 	}
 
-	reg = devm_regulator_get_optional(host->dev, "pbias");
-	if (IS_ERR(reg)) {
-		ret = PTR_ERR(reg);
+	host->pbias = devm_regulator_get_optional(host->dev, "pbias");
+	if (IS_ERR(host->pbias)) {
+		ret = PTR_ERR(host->pbias);
 		if (ret != -ENODEV)
 			return ret;
-		host->pbias = NULL;
 		dev_dbg(host->dev, "unable to get pbias regulator %ld\n",
-			PTR_ERR(reg));
-	} else {
-		host->pbias = reg;
+			PTR_ERR(host->pbias));
+		host->pbias = NULL;
 	}
 
 	/* For eMMC do not power off when not in sleep state */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214413 — [PATCH v3 06/15] mmc: host: omap_hsmmc: remove unnecessary pbias set_voltage

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 06/15] mmc: host: omap_hsmmc: remove unnecessary pbias set_voltage
Message-ID<q21vI-8z-19@gated-at.bofh.it>
In reply to#1214406
Remove the unnecessary pbias regulator_set_voltage done after
pbias regulator_disable in omap_hsmmc_set_power.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 58e4ffd..c4c284e 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -272,7 +272,6 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 			if (!ret)
 				host->pbias_enabled = 0;
 		}
-		regulator_set_voltage(host->pbias, VDD_3V0, VDD_3V0);
 	}
 
 	/*
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214415 — [PATCH v3 08/15] mmc: host: omap_hsmmc: add separate functions for enable/disable supply

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 08/15] mmc: host: omap_hsmmc: add separate functions for enable/disable supply
Message-ID<q21vI-8z-29@gated-at.bofh.it>
In reply to#1214406
No functional change. Cleanup omap_hsmmc_set_power by adding separate
functions for enable/disable supply and invoke it from
omap_hsmmc_set_power.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |  101 +++++++++++++++++++++++++++--------------
 1 file changed, 66 insertions(+), 35 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 284ab00..3fa78d4 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -246,6 +246,65 @@ static int omap_hsmmc_get_cover_state(struct device *dev)
 
 #ifdef CONFIG_REGULATOR
 
+static int omap_hsmmc_enable_supply(struct mmc_host *mmc, int vdd)
+{
+	int ret;
+
+	if (mmc->supply.vmmc) {
+		ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+		if (ret)
+			return ret;
+	}
+
+	/* Enable interface voltage rail, if needed */
+	if (mmc->supply.vqmmc) {
+		ret = regulator_enable(mmc->supply.vqmmc);
+		if (ret) {
+			dev_err(mmc_dev(mmc), "vmmc_aux reg enable failed\n");
+			goto err_vqmmc;
+		}
+	}
+
+	return 0;
+
+err_vqmmc:
+	if (mmc->supply.vmmc)
+		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+
+	return ret;
+}
+
+static int omap_hsmmc_disable_supply(struct mmc_host *mmc)
+{
+	int ret;
+	int status;
+
+	if (mmc->supply.vqmmc) {
+		ret = regulator_disable(mmc->supply.vqmmc);
+		if (ret) {
+			dev_err(mmc_dev(mmc), "vmmc_aux reg disable failed\n");
+			return ret;
+		}
+	}
+
+	if (mmc->supply.vmmc) {
+		ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+		if (ret)
+			goto err_set_ocr;
+	}
+
+	return 0;
+
+err_set_ocr:
+	if (mmc->supply.vqmmc) {
+		status = regulator_enable(mmc->supply.vqmmc);
+		if (status)
+			dev_err(mmc_dev(mmc), "vmmc_aux re-enable failed\n");
+	}
+
+	return ret;
+}
+
 static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 {
 	struct omap_hsmmc_host *host =
@@ -291,36 +350,13 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 	 * chips/cards need an interface voltage rail too.
 	 */
 	if (power_on) {
-		if (mmc->supply.vmmc) {
-			ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
-			if (ret)
-				return ret;
-		}
-
-		/* Enable interface voltage rail, if needed */
-		if (mmc->supply.vqmmc) {
-			ret = regulator_enable(mmc->supply.vqmmc);
-			if (ret) {
-				dev_err(dev, "vmmc_aux reg enable failed\n");
-				goto err_set_vqmmc;
-			}
-		}
+		ret = omap_hsmmc_enable_supply(mmc, vdd);
+		if (ret)
+			return ret;
 	} else {
-		/* Shut down the rail */
-		if (mmc->supply.vqmmc) {
-			ret = regulator_disable(mmc->supply.vqmmc);
-			if (ret) {
-				dev_err(dev, "vmmc_aux reg disable failed\n");
-				return ret;
-			}
-		}
-
-		if (mmc->supply.vmmc) {
-			/* Then proceed to shut down the local regulator */
-			ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
-			if (ret)
-				return ret;
-		}
+		ret = omap_hsmmc_disable_supply(mmc);
+		if (ret)
+			return ret;
 	}
 
 	if (host->pbias) {
@@ -350,12 +386,7 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 	return 0;
 
 err_set_voltage:
-	if (mmc->supply.vqmmc)
-		regulator_disable(mmc->supply.vqmmc);
-
-err_set_vqmmc:
-	if (mmc->supply.vmmc)
-		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+	omap_hsmmc_disable_supply(mmc);
 
 	return ret;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214416 — [PATCH v3 12/15] mmc: host: omap_hsmmc: enable/disable vmmc_aux regulator based on previous state

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 12/15] mmc: host: omap_hsmmc: enable/disable vmmc_aux regulator based on previous state
Message-ID<q21vJ-8z-31@gated-at.bofh.it>
In reply to#1214406
enable vmmc_aux regulator only if it is in disabled state and disable
vmmc_aux regulator only if it is in enabled state.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index cd4bd6d..5a5946a 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -184,6 +184,7 @@ struct omap_hsmmc_host {
 	struct	regulator	*pbias;
 	bool			pbias_enabled;
 	void	__iomem		*base;
+	int			vqmmc_enabled;
 	resource_size_t		mapbase;
 	spinlock_t		irq_lock; /* Prevent races with irq handler */
 	unsigned int		dma_len;
@@ -249,6 +250,7 @@ static int omap_hsmmc_get_cover_state(struct device *dev)
 static int omap_hsmmc_enable_supply(struct mmc_host *mmc, int vdd)
 {
 	int ret;
+	struct omap_hsmmc_host *host = mmc_priv(mmc);
 
 	if (mmc->supply.vmmc) {
 		ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
@@ -257,12 +259,13 @@ static int omap_hsmmc_enable_supply(struct mmc_host *mmc, int vdd)
 	}
 
 	/* Enable interface voltage rail, if needed */
-	if (mmc->supply.vqmmc) {
+	if (mmc->supply.vqmmc && !host->vqmmc_enabled) {
 		ret = regulator_enable(mmc->supply.vqmmc);
 		if (ret) {
 			dev_err(mmc_dev(mmc), "vmmc_aux reg enable failed\n");
 			goto err_vqmmc;
 		}
+		host->vqmmc_enabled = 1;
 	}
 
 	return 0;
@@ -278,13 +281,15 @@ static int omap_hsmmc_disable_supply(struct mmc_host *mmc)
 {
 	int ret;
 	int status;
+	struct omap_hsmmc_host *host = mmc_priv(mmc);
 
-	if (mmc->supply.vqmmc) {
+	if (mmc->supply.vqmmc && host->vqmmc_enabled) {
 		ret = regulator_disable(mmc->supply.vqmmc);
 		if (ret) {
 			dev_err(mmc_dev(mmc), "vmmc_aux reg disable failed\n");
 			return ret;
 		}
+		host->vqmmc_enabled = 0;
 	}
 
 	if (mmc->supply.vmmc) {
@@ -2077,6 +2082,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	host->power_mode = MMC_POWER_OFF;
 	host->next_data.cookie = 1;
 	host->pbias_enabled = 0;
+	host->vqmmc_enabled = 0;
 
 	ret = omap_hsmmc_gpio_init(mmc, host, pdata);
 	if (ret)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214417 — [PATCH v3 14/15] mmc: host: omap_hsmmc: use ios->vdd for setting vmmc voltage

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 14/15] mmc: host: omap_hsmmc: use ios->vdd for setting vmmc voltage
Message-ID<q21vJ-8z-33@gated-at.bofh.it>
In reply to#1214406
vdd voltage is set in mmc core to ios->vdd and vmmc should actually
be set to this voltage. Modify omap_hsmmc_enable_supply
to not take vdd as argument since now it's directly set to
the voltage in ios->vdd.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4cd7a58..58683b3 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -246,13 +246,14 @@ static int omap_hsmmc_get_cover_state(struct device *dev)
 
 #ifdef CONFIG_REGULATOR
 
-static int omap_hsmmc_enable_supply(struct mmc_host *mmc, int vdd)
+static int omap_hsmmc_enable_supply(struct mmc_host *mmc)
 {
 	int ret;
 	struct omap_hsmmc_host *host = mmc_priv(mmc);
+	struct mmc_ios *ios = &mmc->ios;
 
 	if (mmc->supply.vmmc) {
-		ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+		ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
 		if (ret)
 			return ret;
 	}
@@ -387,7 +388,7 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 	 * chips/cards need an interface voltage rail too.
 	 */
 	if (power_on) {
-		ret = omap_hsmmc_enable_supply(mmc, vdd);
+		ret = omap_hsmmc_enable_supply(mmc);
 		if (ret)
 			return ret;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214418 — [PATCH v3 05/15] mmc: host: omap_hsmmc: use mmc_host's vmmc and vqmmc

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 05/15] mmc: host: omap_hsmmc: use mmc_host's vmmc and vqmmc
Message-ID<q21vJ-8z-41@gated-at.bofh.it>
In reply to#1214406
No functional change. Instead of using omap_hsmmc_host's vcc and vcc_aux
members, use vmmc and vqmmc present in mmc_host which is present
for the same purpose.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |   63 ++++++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 35 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 30f363d..58e4ffd 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -181,15 +181,6 @@ struct omap_hsmmc_host {
 	struct	mmc_data	*data;
 	struct	clk		*fclk;
 	struct	clk		*dbclk;
-	/*
-	 * vcc == configured supply
-	 * vcc_aux == optional
-	 *   -	MMC1, supply for DAT4..DAT7
-	 *   -	MMC2/MMC2, external level shifter voltage supply, for
-	 *	chip (SDIO, eMMC, etc) or transceiver (MMC2 only)
-	 */
-	struct	regulator	*vcc;
-	struct	regulator	*vcc_aux;
 	struct	regulator	*pbias;
 	bool			pbias_enabled;
 	void	__iomem		*base;
@@ -259,6 +250,7 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 {
 	struct omap_hsmmc_host *host =
 		platform_get_drvdata(to_platform_device(dev));
+	struct mmc_host *mmc = host->mmc;
 	int ret = 0;
 
 	if (mmc_pdata(host)->set_power)
@@ -268,7 +260,7 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 	 * If we don't see a Vcc regulator, assume it's a fixed
 	 * voltage always-on regulator.
 	 */
-	if (!host->vcc)
+	if (!mmc->supply.vmmc)
 		return 0;
 
 	if (mmc_pdata(host)->before_set_reg)
@@ -297,23 +289,23 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
 	 * chips/cards need an interface voltage rail too.
 	 */
 	if (power_on) {
-		if (host->vcc)
-			ret = mmc_regulator_set_ocr(host->mmc, host->vcc, vdd);
+		if (mmc->supply.vmmc)
+			ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
 		/* Enable interface voltage rail, if needed */
-		if (ret == 0 && host->vcc_aux) {
-			ret = regulator_enable(host->vcc_aux);
-			if (ret < 0 && host->vcc)
-				ret = mmc_regulator_set_ocr(host->mmc,
-							host->vcc, 0);
+		if (ret == 0 && mmc->supply.vqmmc) {
+			ret = regulator_enable(mmc->supply.vqmmc);
+			if (ret < 0 && mmc->supply.vmmc)
+				ret = mmc_regulator_set_ocr(mmc,
+							    mmc->supply.vmmc,
+							    0);
 		}
 	} else {
 		/* Shut down the rail */
-		if (host->vcc_aux)
-			ret = regulator_disable(host->vcc_aux);
-		if (host->vcc) {
+		if (mmc->supply.vqmmc)
+			ret = regulator_disable(mmc->supply.vqmmc);
+		if (mmc->supply.vmmc) {
 			/* Then proceed to shut down the local regulator */
-			ret = mmc_regulator_set_ocr(host->mmc,
-						host->vcc, 0);
+			ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
 		}
 	}
 
@@ -345,33 +337,34 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
 	int ocr_value = 0;
 	int ret;
+	struct mmc_host *mmc = host->mmc;
 
 	if (mmc_pdata(host)->set_power)
 		return 0;
 
-	host->vcc = devm_regulator_get_optional(host->dev, "vmmc");
-	if (IS_ERR(host->vcc)) {
-		ret = PTR_ERR(host->vcc);
+	mmc->supply.vmmc = devm_regulator_get_optional(host->dev, "vmmc");
+	if (IS_ERR(mmc->supply.vmmc)) {
+		ret = PTR_ERR(mmc->supply.vmmc);
 		if (ret != -ENODEV)
 			return ret;
 		dev_dbg(host->dev, "unable to get vmmc regulator %ld\n",
-			PTR_ERR(host->vcc));
-		host->vcc = NULL;
+			PTR_ERR(mmc->supply.vmmc));
+		mmc->supply.vmmc = NULL;
 	} else {
-		ocr_value = mmc_regulator_get_ocrmask(host->vcc);
+		ocr_value = mmc_regulator_get_ocrmask(mmc->supply.vmmc);
 		if (ocr_value > 0)
 			mmc_pdata(host)->ocr_mask = ocr_value;
 	}
 
 	/* Allow an aux regulator */
-	host->vcc_aux = devm_regulator_get_optional(host->dev, "vmmc_aux");
-	if (IS_ERR(host->vcc_aux)) {
-		ret = PTR_ERR(host->vcc_aux);
+	mmc->supply.vqmmc = devm_regulator_get_optional(host->dev, "vmmc_aux");
+	if (IS_ERR(mmc->supply.vqmmc)) {
+		ret = PTR_ERR(mmc->supply.vqmmc);
 		if (ret != -ENODEV)
 			return ret;
 		dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n",
-			PTR_ERR(host->vcc_aux));
-		host->vcc_aux = NULL;
+			PTR_ERR(mmc->supply.vqmmc));
+		mmc->supply.vqmmc = NULL;
 	}
 
 	host->pbias = devm_regulator_get_optional(host->dev, "pbias");
@@ -391,8 +384,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 	 * To disable boot_on regulator, enable regulator
 	 * to increase usecount and then disable it.
 	 */
-	if ((host->vcc && regulator_is_enabled(host->vcc) > 0) ||
-	    (host->vcc_aux && regulator_is_enabled(host->vcc_aux))) {
+	if ((mmc->supply.vmmc && regulator_is_enabled(mmc->supply.vmmc) > 0) ||
+	    (mmc->supply.vqmmc && regulator_is_enabled(mmc->supply.vqmmc))) {
 		int vdd = ffs(mmc_pdata(host)->ocr_mask) - 1;
 
 		omap_hsmmc_set_power(host->dev, 1, vdd);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1214419 — [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-27 11:20 +0200
Subject[PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get
Message-ID<q21vJ-8z-35@gated-at.bofh.it>
In reply to#1214406
Now return error only if the return value of
devm_regulator_get_optional() is not the same as -ENODEV, since with
-EPROBE_DEFER, the regulator can be obtained later and all other
errors are fatal.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/omap_hsmmc.c |   22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 9b335af..2eafd6f 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -375,10 +375,28 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 
 	/* Allow an aux regulator */
 	reg = devm_regulator_get_optional(host->dev, "vmmc_aux");
-	host->vcc_aux = IS_ERR(reg) ? NULL : reg;
+	if (IS_ERR(reg)) {
+		ret = PTR_ERR(reg);
+		if (ret != -ENODEV)
+			return ret;
+		host->vcc_aux = NULL;
+		dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n",
+			PTR_ERR(reg));
+	} else {
+		host->vcc_aux = reg;
+	}
 
 	reg = devm_regulator_get_optional(host->dev, "pbias");
-	host->pbias = IS_ERR(reg) ? NULL : reg;
+	if (IS_ERR(reg)) {
+		ret = PTR_ERR(reg);
+		if (ret != -ENODEV)
+			return ret;
+		host->pbias = NULL;
+		dev_dbg(host->dev, "unable to get pbias regulator %ld\n",
+			PTR_ERR(reg));
+	} else {
+		host->pbias = reg;
+	}
 
 	/* For eMMC do not power off when not in sleep state */
 	if (mmc_pdata(host)->no_regulator_off_init)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1215491 — Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get

FromOlof Johansson <olof@lixom.net>
Date2015-08-28 20:10 +0200
SubjectRe: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get
Message-ID<q2wga-2sD-7@gated-at.bofh.it>
In reply to#1214419
Hi,

On Thu, Aug 27, 2015 at 2:13 AM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> Now return error only if the return value of
> devm_regulator_get_optional() is not the same as -ENODEV, since with
> -EPROBE_DEFER, the regulator can be obtained later and all other
> errors are fatal.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Tested-by: Tony Lindgren <tony@atomide.com>

I bisected boot failures on Panda ES with multi_v7_defconfig down to
this commit on last night's -next build:

http://arm-soc.lixom.net/bootlogs/next/next-20150828/pandaes-arm-multi_v7_defconfig.html

-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1215521 — Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get

FromTony Lindgren <tony@atomide.com>
Date2015-08-28 21:10 +0200
SubjectRe: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get
Message-ID<q2xce-3NW-23@gated-at.bofh.it>
In reply to#1215491
* Olof Johansson <olof@lixom.net> [150828 11:11]:
> Hi,
> 
> On Thu, Aug 27, 2015 at 2:13 AM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> > Now return error only if the return value of
> > devm_regulator_get_optional() is not the same as -ENODEV, since with
> > -EPROBE_DEFER, the regulator can be obtained later and all other
> > errors are fatal.
> >
> > Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> > Tested-by: Tony Lindgren <tony@atomide.com>
> 
> I bisected boot failures on Panda ES with multi_v7_defconfig down to
> this commit on last night's -next build:
> 
> http://arm-soc.lixom.net/bootlogs/next/next-20150828/pandaes-arm-multi_v7_defconfig.html

MMC is working for me at least on Duovero. Interesting that you also
have all kind of errors there, I guess this is some older revision
of the board.

Anyways, Kishon, care to look into what might be causing this?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1216026 — Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get

FromKishon Vijay Abraham I <kishon@ti.com>
Date2015-08-31 07:50 +0200
SubjectRe: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get
Message-ID<q3q8G-712-5@gated-at.bofh.it>
In reply to#1215521
Hi,

On Saturday 29 August 2015 12:33 AM, Tony Lindgren wrote:
> * Olof Johansson <olof@lixom.net> [150828 11:11]:
>> Hi,
>>
>> On Thu, Aug 27, 2015 at 2:13 AM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>>> Now return error only if the return value of
>>> devm_regulator_get_optional() is not the same as -ENODEV, since with
>>> -EPROBE_DEFER, the regulator can be obtained later and all other
>>> errors are fatal.
>>>
>>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>>> Tested-by: Tony Lindgren <tony@atomide.com>
>>
>> I bisected boot failures on Panda ES with multi_v7_defconfig down to
>> this commit on last night's -next build:
>>
>> http://arm-soc.lixom.net/bootlogs/next/next-20150828/pandaes-arm-multi_v7_defconfig.html
> 
> MMC is working for me at least on Duovero. Interesting that you also
> have all kind of errors there, I guess this is some older revision
> of the board.
> 
> Anyways, Kishon, care to look into what might be causing this?

I think this might be because my pbias fix [1] patch wasn't merged yet.
I'll try to get that resolved asap.

Thanks
Kishon

[1] -> http://lkml.iu.edu/hypermail/linux/kernel/1507.3/01594.html
> 
> Regards,
> 
> Tony
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1216444 — Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get

FromTony Lindgren <tony@atomide.com>
Date2015-08-31 23:00 +0200
SubjectRe: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get
Message-ID<q3Elk-27P-7@gated-at.bofh.it>
In reply to#1216026
* Kishon Vijay Abraham I <kishon@ti.com> [150830 22:47]:
> Hi,
> 
> On Saturday 29 August 2015 12:33 AM, Tony Lindgren wrote:
> > * Olof Johansson <olof@lixom.net> [150828 11:11]:
> >> Hi,
> >>
> >> On Thu, Aug 27, 2015 at 2:13 AM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> >>> Now return error only if the return value of
> >>> devm_regulator_get_optional() is not the same as -ENODEV, since with
> >>> -EPROBE_DEFER, the regulator can be obtained later and all other
> >>> errors are fatal.
> >>>
> >>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> >>> Tested-by: Tony Lindgren <tony@atomide.com>
> >>
> >> I bisected boot failures on Panda ES with multi_v7_defconfig down to
> >> this commit on last night's -next build:
> >>
> >> http://arm-soc.lixom.net/bootlogs/next/next-20150828/pandaes-arm-multi_v7_defconfig.html
> > 
> > MMC is working for me at least on Duovero. Interesting that you also
> > have all kind of errors there, I guess this is some older revision
> > of the board.
> > 
> > Anyways, Kishon, care to look into what might be causing this?
> 
> I think this might be because my pbias fix [1] patch wasn't merged yet.
> I'll try to get that resolved asap.

Kishon, as there seems to be an ongoing discussion with the regulator regmap
stuff for pbias, I suggest you provide a fix for the hsmmc driver instead for
now or revert some patches to remove the dependency and get things working.

And I must have tested next-20150827 instead of next-20150828. Or
else it does not happen on every boot. In any case, I'm now getting
the following on next-20150831 most of the time:

[    9.493133] omap_hsmmc 4809c000.mmc: using lookup tables for GPIO lookup
[    9.500274] omap_hsmmc 4809c000.mmc: lookup for GPIO wp failed
[    9.506378] ------------[ cut here ]------------
[    9.508941] WARNING: CPU: 0 PID: 6 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x224/0x350()
[    9.520568] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4PER2 (Read): Data Access in User mode during Functional access
[    9.524810] Modules linked in: rtc_twl twl4030_wdt
[    9.534820] CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 4.2.0-next-20150831-00002-gf55bad8 #1113
[    9.544830] Hardware name: Generic OMAP4 (Flattened Device Tree)
[    9.544830] Workqueue: deferwq deferred_probe_work_func
[    9.554809] [<c001770c>] (unwind_backtrace) from [<c0013a58>] (show_stack+0x10/0x14)
[    9.564819] [<c0013a58>] (show_stack) from [<c034efb4>] (dump_stack+0x84/0x9c)
[    9.574829] [<c034efb4>] (dump_stack) from [<c003e994>] (warn_slowpath_common+0x78/0xb4)
[    9.574951] [<c003e994>] (warn_slowpath_common) from [<c003ea00>] (warn_slowpath_fmt+0x30/0x40)
[    9.584686] [<c003ea00>] (warn_slowpath_fmt) from [<c037cc7c>] (l3_interrupt_handler+0x224/0x350)
[    9.594818] [<c037cc7c>] (l3_interrupt_handler) from [<c009e7b4>] (handle_irq_event_percpu+0x44/0x1f0)
[    9.604827] [<c009e7b4>] (handle_irq_event_percpu) from [<c009e9a0>] (handle_irq_event+0x40/0x64)
[    9.614807] [<c009e9a0>] (handle_irq_event) from [<c00a1a4c>] (handle_fasteoi_irq+0xcc/0x1c4)
[    9.625396] [<c00a1a4c>] (handle_fasteoi_irq) from [<c009de58>] (generic_handle_irq+0x28/0x3c)
[    9.638732] [<c009de58>] (generic_handle_irq) from [<c009e140>] (__handle_domain_irq+0x64/0xe0)
[    9.647827] [<c009e140>] (__handle_domain_irq) from [<c0009514>] (gic_handle_irq+0x40/0x8c)
[    9.654693] [<c0009514>] (gic_handle_irq) from [<c064ccb8>] (__irq_svc+0x58/0x78)
[    9.664367] Exception stack(0xee0cfd80 to 0xee0cfdc8)
[    9.665130] fd80: ee1ec010 c082f174 000000d0 00000000 ee6b0800 ee6ae850 ee1ec000 ee1ec010
[    9.674835] fda0: 00000000 ee6b0cc0 000000ee fa09c000 00000003 ee0cfdd0 c04cd748 c04df4e0
[    9.684814] fdc0: 20000113 ffffffff
[    9.684814] [<c064ccb8>] (__irq_svc) from [<c04df4e0>] (devm_clk_get+0x8/0x70)
[    9.694824] [<c04df4e0>] (devm_clk_get) from [<c04cd748>] (omap_hsmmc_probe+0x2e8/0x9f0)
[    9.704833] [<c04cd748>] (omap_hsmmc_probe) from [<c03e97f4>] (platform_drv_probe+0x44/0xac)
[    9.714691] [<c03e97f4>] (platform_drv_probe) from [<c03e7ea8>] (driver_probe_device+0x1f4/0x2f0)
[    9.724548] [<c03e7ea8>] (driver_probe_device) from [<c03e63b4>] (bus_for_each_drv+0x64/0x98)
[    9.733459] [<c03e63b4>] (bus_for_each_drv) from [<c03e7c28>] (__device_attach+0xb0/0x118)
[    9.734832] [<c03e7c28>] (__device_attach) from [<c03e71d0>] (bus_probe_device+0x88/0x90)
[    9.744812] [<c03e71d0>] (bus_probe_device) from [<c03e75f8>] (deferred_probe_work_func+0x60/0x90)
[    9.760040] [<c03e75f8>] (deferred_probe_work_func) from [<c00589f8>] (process_one_work+0x1a4/0x558)
[    9.769470] [<c00589f8>] (process_one_work) from [<c0058de8>] (worker_thread+0x3c/0x514)
[    9.774688] [<c0058de8>] (worker_thread) from [<c005eb88>] (kthread+0xd4/0xf0)
[    9.785614] [<c005eb88>] (kthread) from [<c000f710>] (ret_from_fork+0x14/0x24)
[    9.785614] ---[ end trace 402743bd8cfdde2f ]---
 
> [1] -> http://lkml.iu.edu/hypermail/linux/kernel/1507.3/01594.html

With patch 1/2 of the above applied, I'm getting this instead:

[    2.930938] ------------[ cut here ]------------
[    2.935852] WARNING: CPU: 0 PID: 6 at drivers/regulator/core.c:2105 _regulator_disable+0x13c/0x1d4()
[    2.945465] unbalanced disables for pbias_mmc_omap4
[    2.945465] Modules linked in:
[    2.950592] CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 4.2.0-next-20150831-00003-gc5112ac-dirty #1114
[    2.963684] Hardware name: Generic OMAP4 (Flattened Device Tree)
[    2.970031] Workqueue: deferwq deferred_probe_work_func
[    2.975585] [<c001770c>] (unwind_backtrace) from [<c0013a58>] (show_stack+0x10/0x14)
[    2.983764] [<c0013a58>] (show_stack) from [<c034efb4>] (dump_stack+0x84/0x9c)
[    2.983764] [<c034efb4>] (dump_stack) from [<c003e994>] (warn_slowpath_common+0x78/0xb4)
[    2.999877] [<c003e994>] (warn_slowpath_common) from [<c003ea00>] (warn_slowpath_fmt+0x30/0x40)
[    3.009063] [<c003ea00>] (warn_slowpath_fmt) from [<c03ad830>] (_regulator_disable+0x13c/0x1d4)
[    3.018218] [<c03ad830>] (_regulator_disable) from [<c03ad8f8>] (regulator_disable+0x30/0x6c)
[    3.027221] [<c03ad8f8>] (regulator_disable) from [<c04cdfe8>] (omap_hsmmc_set_power+0x158/0x1e8)
[    3.027252] [<c04cdfe8>] (omap_hsmmc_set_power) from [<c04ce210>] (omap_hsmmc_set_ios+0x198/0x318)
[    3.046020] [<c04ce210>] (omap_hsmmc_set_ios) from [<c04b7da4>] (mmc_power_up.part.10+0x30/0xf8)
[    3.055267] [<c04b7da4>] (mmc_power_up.part.10) from [<c04b8cb0>] (mmc_start_host+0x40/0x7c)
[    3.064178] [<c04b8cb0>] (mmc_start_host) from [<c04b9dc4>] (mmc_add_host+0x5c/0x84)
[    3.072326] [<c04b9dc4>] (mmc_add_host) from [<c04cda50>] (omap_hsmmc_probe+0x5b0/0x9f0)
[    3.080871] [<c04cda50>] (omap_hsmmc_probe) from [<c03e9834>] (platform_drv_probe+0x44/0xac)
[    3.089752] [<c03e9834>] (platform_drv_probe) from [<c03e7ee8>] (driver_probe_device+0x1f4/0x2f0)
[    3.099090] [<c03e7ee8>] (driver_probe_device) from [<c03e63f4>] (bus_for_each_drv+0x64/0x98)
[    3.108093] [<c03e63f4>] (bus_for_each_drv) from [<c03e7c68>] (__device_attach+0xb0/0x118)
[    3.116790] [<c03e7c68>] (__device_attach) from [<c03e7210>] (bus_probe_device+0x88/0x90)
[    3.125427] [<c03e7210>] (bus_probe_device) from [<c03e7638>] (deferred_probe_work_func+0x60/0x90)
[    3.125427] [<c03e7638>] (deferred_probe_work_func) from [<c00589f8>] (process_one_work+0x1a4/0x558)
[    3.144470] [<c00589f8>] (process_one_work) from [<c0058de8>] (worker_thread+0x3c/0x514)
[    3.152984] [<c0058de8>] (worker_thread) from [<c005eb88>] (kthread+0xd4/0xf0)
[    3.160614] [<c005eb88>] (kthread) from [<c000f710>] (ret_from_fork+0x14/0x24)
[    3.160644] ---[ end trace 2869621ad5ef511c ]---

Regards,

Tony

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web