linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup
@ 2011-12-18  0:35 Grazvydas Ignotas
  2012-01-20 17:24 ` Grazvydas Ignotas
  2012-01-26 23:19 ` Tony Lindgren
  0 siblings, 2 replies; 6+ messages in thread
From: Grazvydas Ignotas @ 2011-12-18  0:35 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Tony Lindgren, Grazvydas Ignotas

hsmmc23_before_set_reg() can set MMCSDIO2ADPCLKISEL bit, which
enables internal clock for MMC2. Currently this function is also called
by code handling MMC3, and if .internal_clock is set in platform data
(by default it currently is), it will set MMCSDIO2ADPCLKISEL for MMC2
instead of MMC3 (MMC3 doesn't have such bit so nothing actually needs to
be done). This breaks 2nd SD slot on pandora.

Fix this by changing hsmmc23_before_set_reg() to only handle MMC2.
Note that this removes .remux() call for MMC3, but no board currently
needs it and it's also not called for MMC4 and MMC5.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
applies both on mainline and hsmmc branch.

 arch/arm/mach-omap2/hsmmc.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index f4a1020..d90ac08 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -171,7 +171,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
 	}
 }
 
-static void hsmmc23_before_set_reg(struct device *dev, int slot,
+static void hsmmc2_before_set_reg(struct device *dev, int slot,
 				   int power_on, int vdd)
 {
 	struct omap_mmc_platform_data *mmc = dev->platform_data;
@@ -378,14 +378,13 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
 			c->caps &= ~MMC_CAP_8_BIT_DATA;
 			c->caps |= MMC_CAP_4_BIT_DATA;
 		}
-		/* FALLTHROUGH */
-	case 3:
 		if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
 			/* off-chip level shifting, or none */
-			mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
+			mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
 			mmc->slots[0].after_set_reg = NULL;
 		}
 		break;
+	case 3:
 	case 4:
 	case 5:
 		mmc->slots[0].before_set_reg = NULL;
-- 
1.7.0.4


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

* Re: [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup
  2011-12-18  0:35 [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup Grazvydas Ignotas
@ 2012-01-20 17:24 ` Grazvydas Ignotas
  2012-01-20 17:43   ` Tony Lindgren
  2012-01-26 23:19 ` Tony Lindgren
  1 sibling, 1 reply; 6+ messages in thread
From: Grazvydas Ignotas @ 2012-01-20 17:24 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap

Hi Tony,

Would be nice to have this for -rc as this used to work several
releases back when hsmmc23_before_set_reg() was checking for a
regulator, which wasn't set for MMC3 so the function would return
early, not causing the problem it causes now.

On Sun, Dec 18, 2011 at 2:35 AM, Grazvydas Ignotas <notasas@gmail.com> wrote:
> hsmmc23_before_set_reg() can set MMCSDIO2ADPCLKISEL bit, which
> enables internal clock for MMC2. Currently this function is also called
> by code handling MMC3, and if .internal_clock is set in platform data
> (by default it currently is), it will set MMCSDIO2ADPCLKISEL for MMC2
> instead of MMC3 (MMC3 doesn't have such bit so nothing actually needs to
> be done). This breaks 2nd SD slot on pandora.
>
> Fix this by changing hsmmc23_before_set_reg() to only handle MMC2.
> Note that this removes .remux() call for MMC3, but no board currently
> needs it and it's also not called for MMC4 and MMC5.
>
> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> applies both on mainline and hsmmc branch.
>
>  arch/arm/mach-omap2/hsmmc.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index f4a1020..d90ac08 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -171,7 +171,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
>        }
>  }
>
> -static void hsmmc23_before_set_reg(struct device *dev, int slot,
> +static void hsmmc2_before_set_reg(struct device *dev, int slot,
>                                   int power_on, int vdd)
>  {
>        struct omap_mmc_platform_data *mmc = dev->platform_data;
> @@ -378,14 +378,13 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>                        c->caps &= ~MMC_CAP_8_BIT_DATA;
>                        c->caps |= MMC_CAP_4_BIT_DATA;
>                }
> -               /* FALLTHROUGH */
> -       case 3:
>                if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
>                        /* off-chip level shifting, or none */
> -                       mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
> +                       mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
>                        mmc->slots[0].after_set_reg = NULL;
>                }
>                break;
> +       case 3:
>        case 4:
>        case 5:
>                mmc->slots[0].before_set_reg = NULL;
> --
> 1.7.0.4
>



-- 
Gražvydas
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" 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] 6+ messages in thread

* Re: [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup
  2012-01-20 17:24 ` Grazvydas Ignotas
@ 2012-01-20 17:43   ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2012-01-20 17:43 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-arm-kernel, linux-omap

* Grazvydas Ignotas <notasas@gmail.com> [120120 08:51]:
> Hi Tony,
> 
> Would be nice to have this for -rc as this used to work several
> releases back when hsmmc23_before_set_reg() was checking for a
> regulator, which wasn't set for MMC3 so the function would return
> early, not causing the problem it causes now.

Yeah this looks like a fix. I'll take a look next week as I'll
be travelling.

Tony

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

* Re: [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup
  2011-12-18  0:35 [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup Grazvydas Ignotas
  2012-01-20 17:24 ` Grazvydas Ignotas
@ 2012-01-26 23:19 ` Tony Lindgren
  2012-01-26 23:37   ` Grazvydas Ignotas
  1 sibling, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2012-01-26 23:19 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap, linux-arm-kernel

* Grazvydas Ignotas <notasas@gmail.com> [111217 16:03]:
> hsmmc23_before_set_reg() can set MMCSDIO2ADPCLKISEL bit, which
> enables internal clock for MMC2. Currently this function is also called
> by code handling MMC3, and if .internal_clock is set in platform data
> (by default it currently is), it will set MMCSDIO2ADPCLKISEL for MMC2
> instead of MMC3 (MMC3 doesn't have such bit so nothing actually needs to
> be done). This breaks 2nd SD slot on pandora.
> 
> Fix this by changing hsmmc23_before_set_reg() to only handle MMC2.
> Note that this removes .remux() call for MMC3, but no board currently
> needs it and it's also not called for MMC4 and MMC5.
> 
> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> applies both on mainline and hsmmc branch.
> 
>  arch/arm/mach-omap2/hsmmc.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index f4a1020..d90ac08 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -171,7 +171,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
>  	}
>  }
>  
> -static void hsmmc23_before_set_reg(struct device *dev, int slot,
> +static void hsmmc2_before_set_reg(struct device *dev, int slot,
>  				   int power_on, int vdd)
>  {
>  	struct omap_mmc_platform_data *mmc = dev->platform_data;

This hunk above changing the function name seems to be a typo?

Regards,

Tony


> @@ -378,14 +378,13 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  			c->caps &= ~MMC_CAP_8_BIT_DATA;
>  			c->caps |= MMC_CAP_4_BIT_DATA;
>  		}
> -		/* FALLTHROUGH */
> -	case 3:
>  		if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
>  			/* off-chip level shifting, or none */
> -			mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
> +			mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
>  			mmc->slots[0].after_set_reg = NULL;
>  		}
>  		break;
> +	case 3:
>  	case 4:
>  	case 5:
>  		mmc->slots[0].before_set_reg = NULL;
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" 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] 6+ messages in thread

* Re: [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup
  2012-01-26 23:19 ` Tony Lindgren
@ 2012-01-26 23:37   ` Grazvydas Ignotas
  2012-01-26 23:53     ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Grazvydas Ignotas @ 2012-01-26 23:37 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, linux-arm-kernel

On Fri, Jan 27, 2012 at 1:19 AM, Tony Lindgren <tony@atomide.com> wrote:
> * Grazvydas Ignotas <notasas@gmail.com> [111217 16:03]:
>> hsmmc23_before_set_reg() can set MMCSDIO2ADPCLKISEL bit, which
>> enables internal clock for MMC2. Currently this function is also called
>> by code handling MMC3, and if .internal_clock is set in platform data
>> (by default it currently is), it will set MMCSDIO2ADPCLKISEL for MMC2
>> instead of MMC3 (MMC3 doesn't have such bit so nothing actually needs to
>> be done). This breaks 2nd SD slot on pandora.
>>
>> Fix this by changing hsmmc23_before_set_reg() to only handle MMC2.
>> Note that this removes .remux() call for MMC3, but no board currently
>> needs it and it's also not called for MMC4 and MMC5.
>>
>> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
>> ---
>> applies both on mainline and hsmmc branch.
>>
>>  arch/arm/mach-omap2/hsmmc.c |    7 +++----
>>  1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
>> index f4a1020..d90ac08 100644
>> --- a/arch/arm/mach-omap2/hsmmc.c
>> +++ b/arch/arm/mach-omap2/hsmmc.c
>> @@ -171,7 +171,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
>>       }
>>  }
>>
>> -static void hsmmc23_before_set_reg(struct device *dev, int slot,
>> +static void hsmmc2_before_set_reg(struct device *dev, int slot,
>>                                  int power_on, int vdd)
>>  {
>>       struct omap_mmc_platform_data *mmc = dev->platform_data;
>
> This hunk above changing the function name seems to be a typo?

No it's not, this function is changing MMC2 clock source and is no
longer called for MMC3 after this patch (the call for MMC3 was the
problem), so it loses hsmmc23 name.


>> @@ -378,14 +378,13 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>>                       c->caps &= ~MMC_CAP_8_BIT_DATA;
>>                       c->caps |= MMC_CAP_4_BIT_DATA;
>>               }
>> -             /* FALLTHROUGH */
>> -     case 3:
>>               if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
>>                       /* off-chip level shifting, or none */
>> -                     mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
>> +                     mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
>>                       mmc->slots[0].after_set_reg = NULL;
>>               }
>>               break;
>> +     case 3:
>>       case 4:
>>       case 5:
>>               mmc->slots[0].before_set_reg = NULL;
>> --
>> 1.7.0.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Gražvydas
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" 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] 6+ messages in thread

* Re: [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup
  2012-01-26 23:37   ` Grazvydas Ignotas
@ 2012-01-26 23:53     ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2012-01-26 23:53 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap, linux-arm-kernel

* Grazvydas Ignotas <notasas@gmail.com> [120126 15:06]:
> On Fri, Jan 27, 2012 at 1:19 AM, Tony Lindgren <tony@atomide.com> wrote:
> > * Grazvydas Ignotas <notasas@gmail.com> [111217 16:03]:
> >> hsmmc23_before_set_reg() can set MMCSDIO2ADPCLKISEL bit, which
> >> enables internal clock for MMC2. Currently this function is also called
> >> by code handling MMC3, and if .internal_clock is set in platform data
> >> (by default it currently is), it will set MMCSDIO2ADPCLKISEL for MMC2
> >> instead of MMC3 (MMC3 doesn't have such bit so nothing actually needs to
> >> be done). This breaks 2nd SD slot on pandora.
> >>
> >> Fix this by changing hsmmc23_before_set_reg() to only handle MMC2.
> >> Note that this removes .remux() call for MMC3, but no board currently
> >> needs it and it's also not called for MMC4 and MMC5.
> >>
> >> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> >> ---
> >> applies both on mainline and hsmmc branch.
> >>
> >>  arch/arm/mach-omap2/hsmmc.c |    7 +++----
> >>  1 files changed, 3 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> >> index f4a1020..d90ac08 100644
> >> --- a/arch/arm/mach-omap2/hsmmc.c
> >> +++ b/arch/arm/mach-omap2/hsmmc.c
> >> @@ -171,7 +171,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
> >>       }
> >>  }
> >>
> >> -static void hsmmc23_before_set_reg(struct device *dev, int slot,
> >> +static void hsmmc2_before_set_reg(struct device *dev, int slot,
> >>                                  int power_on, int vdd)
> >>  {
> >>       struct omap_mmc_platform_data *mmc = dev->platform_data;
> >
> > This hunk above changing the function name seems to be a typo?
> 
> No it's not, this function is changing MMC2 clock source and is no
> longer called for MMC3 after this patch (the call for MMC3 was the
> problem), so it loses hsmmc23 name.

OK thanks, applying into fixes.

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" 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] 6+ messages in thread

end of thread, other threads:[~2012-01-26 23:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-18  0:35 [PATCH] ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup Grazvydas Ignotas
2012-01-20 17:24 ` Grazvydas Ignotas
2012-01-20 17:43   ` Tony Lindgren
2012-01-26 23:19 ` Tony Lindgren
2012-01-26 23:37   ` Grazvydas Ignotas
2012-01-26 23:53     ` Tony Lindgren

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).