linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] omap: hsmmc: fix ocr mask usage
@ 2011-02-21  6:07 Anand Gadiyar
  2011-02-21 16:10 ` Kishore Kadiyala
  0 siblings, 1 reply; 3+ messages in thread
From: Anand Gadiyar @ 2011-02-21  6:07 UTC (permalink / raw)
  To: linux-mmc
  Cc: Anand Gadiyar, Kishore Kadiyala, Tony Lindgren,
	Madhusudhan Chikkature, Chris Ball

The OMAP HSMMC driver uses an ocr_mask to determine the
list of voltages supported by the card. It populates this
mask based on the list of voltages supported by the
regulator that supplies the voltage.

Commit 64be97822b (omap4 hsmmc: Update ocr mask for MMC2 for
regulator to use) passed a fixed ocr_mask from the OMAP4 SDP
board file to limit the voltage to 2.9-3.0 Volts, and updated
the driver to use this mask if provided, instead of using the
regulator's supported voltages.

However the commit is buggy - the ocr_mask is overridden
by the regulator's capabilities anyway. Fix this.

(The bug shows up when a system-wide suspend is attempted
on the OMAP4 SDP/Blaze platforms. The eMMC card comes up
at 3V, but drops to 1.65V after the system resumes).

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Kishore Kadiyala <kishore.kadiyala@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Chris Ball <cjb@laptop.org>
---
Tony, Chris,

This is only a partial fix. It fixes the obvious bug introduced
in the commit I noted above, however it is not the final
fix. I'm not convinced the way the regulators are handled
in this driver is correct - I'm still studying the code and
will come up with a proper fix later.

However, this does fix a real bug and I believe the bug is
obvious. Would be nice to get this into the -rc series if
we still can.

- Anand

 drivers/mmc/host/omap_hsmmc.c |    1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6/drivers/mmc/host/omap_hsmmc.c
===================================================================
--- linux-2.6.orig/drivers/mmc/host/omap_hsmmc.c
+++ linux-2.6/drivers/mmc/host/omap_hsmmc.c
@@ -413,7 +413,6 @@ static int omap_hsmmc_reg_get(struct oma
 				return -EINVAL;
 			}
 		}
-		mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg);
 
 		/* Allow an aux regulator */
 		reg = regulator_get(host->dev, "vmmc_aux");

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] omap: hsmmc: fix ocr mask usage
  2011-02-21  6:07 [PATCH] omap: hsmmc: fix ocr mask usage Anand Gadiyar
@ 2011-02-21 16:10 ` Kishore Kadiyala
  2011-05-26 10:45   ` T Krishnamoorthy, Balaji
  0 siblings, 1 reply; 3+ messages in thread
From: Kishore Kadiyala @ 2011-02-21 16:10 UTC (permalink / raw)
  To: Anand Gadiyar
  Cc: linux-mmc, Kishore Kadiyala, Tony Lindgren,
	Madhusudhan Chikkature, Chris Ball

On Mon, Feb 21, 2011 at 11:37 AM, Anand Gadiyar <gadiyar@ti.com> wrote:
> The OMAP HSMMC driver uses an ocr_mask to determine the
> list of voltages supported by the card. It populates this
> mask based on the list of voltages supported by the
> regulator that supplies the voltage.
>
> Commit 64be97822b (omap4 hsmmc: Update ocr mask for MMC2 for
> regulator to use) passed a fixed ocr_mask from the OMAP4 SDP
> board file to limit the voltage to 2.9-3.0 Volts, and updated
> the driver to use this mask if provided, instead of using the
> regulator's supported voltages.
>
> However the commit is buggy - the ocr_mask is overridden
> by the regulator's capabilities anyway. Fix this.
>
> (The bug shows up when a system-wide suspend is attempted
> on the OMAP4 SDP/Blaze platforms. The eMMC card comes up
> at 3V, but drops to 1.65V after the system resumes).
>
> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>

Tested this patch on OMAP4430SDP & OMAP4 Blaze.

Tested-by:  Kishore Kadiyala <kishore.kadiyala@ti.com>

> Cc: Kishore Kadiyala <kishore.kadiyala@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
> Cc: Chris Ball <cjb@laptop.org>
> ---
> Tony, Chris,
>
> This is only a partial fix. It fixes the obvious bug introduced
> in the commit I noted above, however it is not the final
> fix. I'm not convinced the way the regulators are handled
> in this driver is correct - I'm still studying the code and
> will come up with a proper fix later.
>
> However, this does fix a real bug and I believe the bug is
> obvious. Would be nice to get this into the -rc series if
> we still can.
>
> - Anand
>
>  drivers/mmc/host/omap_hsmmc.c |    1 -
>  1 file changed, 1 deletion(-)
>
> Index: linux-2.6/drivers/mmc/host/omap_hsmmc.c
> ===================================================================
> --- linux-2.6.orig/drivers/mmc/host/omap_hsmmc.c
> +++ linux-2.6/drivers/mmc/host/omap_hsmmc.c
> @@ -413,7 +413,6 @@ static int omap_hsmmc_reg_get(struct oma
>                                return -EINVAL;
>                        }
>                }
> -               mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg);
>
>                /* Allow an aux regulator */
>                reg = regulator_get(host->dev, "vmmc_aux");
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] omap: hsmmc: fix ocr mask usage
  2011-02-21 16:10 ` Kishore Kadiyala
@ 2011-05-26 10:45   ` T Krishnamoorthy, Balaji
  0 siblings, 0 replies; 3+ messages in thread
From: T Krishnamoorthy, Balaji @ 2011-05-26 10:45 UTC (permalink / raw)
  To: Chris Ball
  Cc: Anand Gadiyar, linux-mmc, Kishore Kadiyala, Tony Lindgren,
	Madhusudhan Chikkature

On Mon, Feb 21, 2011 at 9:40 PM, Kishore Kadiyala
<kishorek.kadiyala@gmail.com> wrote:
> On Mon, Feb 21, 2011 at 11:37 AM, Anand Gadiyar <gadiyar@ti.com> wrote:
>> The OMAP HSMMC driver uses an ocr_mask to determine the
>> list of voltages supported by the card. It populates this
>> mask based on the list of voltages supported by the
>> regulator that supplies the voltage.
>>
>> Commit 64be97822b (omap4 hsmmc: Update ocr mask for MMC2 for
>> regulator to use) passed a fixed ocr_mask from the OMAP4 SDP
>> board file to limit the voltage to 2.9-3.0 Volts, and updated
>> the driver to use this mask if provided, instead of using the
>> regulator's supported voltages.
>>
>> However the commit is buggy - the ocr_mask is overridden
>> by the regulator's capabilities anyway. Fix this.
>>
>> (The bug shows up when a system-wide suspend is attempted
>> on the OMAP4 SDP/Blaze platforms. The eMMC card comes up
>> at 3V, but drops to 1.65V after the system resumes).
>>
>> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
>
> Tested this patch on OMAP4430SDP & OMAP4 Blaze.
>
> Tested-by:  Kishore Kadiyala <kishore.kadiyala@ti.com>
>
Acked-by: Balaji T K <balajitk@ti.com>

Can you this patch be queued?

>> Cc: Kishore Kadiyala <kishore.kadiyala@ti.com>
>> Cc: Tony Lindgren <tony@atomide.com>
>> Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
>> Cc: Chris Ball <cjb@laptop.org>
>> ---
>> Tony, Chris,
>>
>> This is only a partial fix. It fixes the obvious bug introduced
>> in the commit I noted above, however it is not the final
>> fix. I'm not convinced the way the regulators are handled
>> in this driver is correct - I'm still studying the code and
>> will come up with a proper fix later.
>>
>> However, this does fix a real bug and I believe the bug is
>> obvious. Would be nice to get this into the -rc series if
>> we still can.
>>
>> - Anand
>>
>>  drivers/mmc/host/omap_hsmmc.c |    1 -
>>  1 file changed, 1 deletion(-)
>>
>> Index: linux-2.6/drivers/mmc/host/omap_hsmmc.c
>> ===================================================================
>> --- linux-2.6.orig/drivers/mmc/host/omap_hsmmc.c
>> +++ linux-2.6/drivers/mmc/host/omap_hsmmc.c
>> @@ -413,7 +413,6 @@ static int omap_hsmmc_reg_get(struct oma
>>                                return -EINVAL;
>>                        }
>>                }
>> -               mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg);
>>
>>                /* Allow an aux regulator */
>>                reg = regulator_get(host->dev, "vmmc_aux");
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-26 10:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-21  6:07 [PATCH] omap: hsmmc: fix ocr mask usage Anand Gadiyar
2011-02-21 16:10 ` Kishore Kadiyala
2011-05-26 10:45   ` T Krishnamoorthy, Balaji

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).