All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value
@ 2015-08-11  2:53 Yangbo Lu
  2015-08-11  8:11 ` Joakim Tjernlund
  2015-08-25 12:05 ` Ulf Hansson
  0 siblings, 2 replies; 7+ messages in thread
From: Yangbo Lu @ 2015-08-11  2:53 UTC (permalink / raw)
  To: linux-mmc, ulf.hansson, joakim.tjernlund; +Cc: Yangbo Lu

For eSDHC(version < 2.3), the pre divider only could divide base clock
by 2 at least. Add workaround for this to avoid unexpected issue.

Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
---
 drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 797be75..653f335 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -208,6 +208,12 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
 	if (clock == 0)
 		return;
 
+	/* Workaround to start pre_div at 2 for VNN < VENDOR_V_23 */
+	temp = esdhc_readw(host, SDHCI_HOST_VERSION);
+	temp = (temp & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
+	if (temp < VENDOR_V_23)
+		pre_div = 2;
+
 	/* Workaround to reduce the clock frequency for p1010 esdhc */
 	if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) {
 		if (clock > 20000000)
-- 
2.1.0.27.g96db324


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

* Re: [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value
  2015-08-11  2:53 [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value Yangbo Lu
@ 2015-08-11  8:11 ` Joakim Tjernlund
  2015-08-25 12:05 ` Ulf Hansson
  1 sibling, 0 replies; 7+ messages in thread
From: Joakim Tjernlund @ 2015-08-11  8:11 UTC (permalink / raw)
  To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
	yangbo.lu@freescale.com

On Tue, 2015-08-11 at 10:53 +0800, Yangbo Lu wrote:
> For eSDHC(version < 2.3), the pre divider only could divide base clock
> by 2 at least. Add workaround for this to avoid unexpected issue.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
> ---
Thanks a lot, here is my:

Acked-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>

>  drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index 797be75..653f335 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -208,6 +208,12 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
>  	if (clock == 0)
>  		return;
>  
> +	/* Workaround to start pre_div at 2 for VNN < VENDOR_V_23 */
> +	temp = esdhc_readw(host, SDHCI_HOST_VERSION);
> +	temp = (temp & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
> +	if (temp < VENDOR_V_23)
> +		pre_div = 2;
> +
>  	/* Workaround to reduce the clock frequency for p1010 esdhc */
>  	if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) {
>  		if (clock > 20000000)

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

* Re: [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value
  2015-08-11  2:53 [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value Yangbo Lu
  2015-08-11  8:11 ` Joakim Tjernlund
@ 2015-08-25 12:05 ` Ulf Hansson
  2015-08-25 12:21   ` Joakim Tjernlund
  1 sibling, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2015-08-25 12:05 UTC (permalink / raw)
  To: Yangbo Lu; +Cc: linux-mmc, Joakim Tjernlund

On 11 August 2015 at 04:53, Yangbo Lu <yangbo.lu@freescale.com> wrote:
> For eSDHC(version < 2.3), the pre divider only could divide base clock
> by 2 at least. Add workaround for this to avoid unexpected issue.
>
> Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index 797be75..653f335 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -208,6 +208,12 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
>         if (clock == 0)
>                 return;
>
> +       /* Workaround to start pre_div at 2 for VNN < VENDOR_V_23 */
> +       temp = esdhc_readw(host, SDHCI_HOST_VERSION);
> +       temp = (temp & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
> +       if (temp < VENDOR_V_23)
> +               pre_div = 2;
> +
>         /* Workaround to reduce the clock frequency for p1010 esdhc */
>         if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) {
>                 if (clock > 20000000)
> --
> 2.1.0.27.g96db324
>

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

* Re: [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value
  2015-08-25 12:05 ` Ulf Hansson
@ 2015-08-25 12:21   ` Joakim Tjernlund
  2015-08-25 13:56     ` Ulf Hansson
  0 siblings, 1 reply; 7+ messages in thread
From: Joakim Tjernlund @ 2015-08-25 12:21 UTC (permalink / raw)
  To: ulf.hansson@linaro.org, yangbo.lu@freescale.com; +Cc: linux-mmc@vger.kernel.org

On Tue, 2015-08-25 at 14:05 +0200, Ulf Hansson wrote:
> On 11 August 2015 at 04:53, Yangbo Lu <yangbo.lu@freescale.com> wrote:
> > For eSDHC(version < 2.3), the pre divider only could divide base clock
> > by 2 at least. Add workaround for this to avoid unexpected issue.
> > 
> > Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
> 
> Thanks, applied for next!

This should go to linus now for 4.2 as master is broken.

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

* Re: [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value
  2015-08-25 12:21   ` Joakim Tjernlund
@ 2015-08-25 13:56     ` Ulf Hansson
  2015-08-25 14:00       ` Joakim Tjernlund
  0 siblings, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2015-08-25 13:56 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: yangbo.lu@freescale.com, linux-mmc@vger.kernel.org

On 25 August 2015 at 14:21, Joakim Tjernlund
<joakim.tjernlund@transmode.se> wrote:
> On Tue, 2015-08-25 at 14:05 +0200, Ulf Hansson wrote:
>> On 11 August 2015 at 04:53, Yangbo Lu <yangbo.lu@freescale.com> wrote:
>> > For eSDHC(version < 2.3), the pre divider only could divide base clock
>> > by 2 at least. Add workaround for this to avoid unexpected issue.
>> >
>> > Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
>>
>> Thanks, applied for next!
>
> This should go to linus now for 4.2 as master is broken.

That wasn't obvious while reading the change log.

I don't intend to send any more PR with fixes for 4.2, but we could
apply a fixes tag if there is regression involved. Can you point me to
the commit it fixes?

Kind regards
Uffe

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

* Re: [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value
  2015-08-25 13:56     ` Ulf Hansson
@ 2015-08-25 14:00       ` Joakim Tjernlund
  2015-08-25 14:20         ` Ulf Hansson
  0 siblings, 1 reply; 7+ messages in thread
From: Joakim Tjernlund @ 2015-08-25 14:00 UTC (permalink / raw)
  To: ulf.hansson@linaro.org; +Cc: linux-mmc@vger.kernel.org, yangbo.lu@freescale.com

On Tue, 2015-08-25 at 15:56 +0200, Ulf Hansson wrote:
> On 25 August 2015 at 14:21, Joakim Tjernlund
> <joakim.tjernlund@transmode.se> wrote:
> > On Tue, 2015-08-25 at 14:05 +0200, Ulf Hansson wrote:
> > > On 11 August 2015 at 04:53, Yangbo Lu <yangbo.lu@freescale.com> wrote:
> > > > For eSDHC(version < 2.3), the pre divider only could divide base clock
> > > > by 2 at least. Add workaround for this to avoid unexpected issue.
> > > > 
> > > > Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
> > > 
> > > Thanks, applied for next!
> > 
> > This should go to linus now for 4.2 as master is broken.
> 
> That wasn't obvious while reading the change log.

hmm, it was visible in the mail thread I think.

> 
> I don't intend to send any more PR with fixes for 4.2, but we could
> apply a fixes tag if there is regression involved. Can you point me to
> the commit it fixes?

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/mmc/host?id=bd455029d01cb55dca6
2129282466ccea3698813

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

* Re: [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value
  2015-08-25 14:00       ` Joakim Tjernlund
@ 2015-08-25 14:20         ` Ulf Hansson
  0 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2015-08-25 14:20 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linux-mmc@vger.kernel.org, yangbo.lu@freescale.com

On 25 August 2015 at 16:00, Joakim Tjernlund
<joakim.tjernlund@transmode.se> wrote:
> On Tue, 2015-08-25 at 15:56 +0200, Ulf Hansson wrote:
>> On 25 August 2015 at 14:21, Joakim Tjernlund
>> <joakim.tjernlund@transmode.se> wrote:
>> > On Tue, 2015-08-25 at 14:05 +0200, Ulf Hansson wrote:
>> > > On 11 August 2015 at 04:53, Yangbo Lu <yangbo.lu@freescale.com> wrote:
>> > > > For eSDHC(version < 2.3), the pre divider only could divide base clock
>> > > > by 2 at least. Add workaround for this to avoid unexpected issue.
>> > > >
>> > > > Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
>> > >
>> > > Thanks, applied for next!
>> >
>> > This should go to linus now for 4.2 as master is broken.
>>
>> That wasn't obvious while reading the change log.
>
> hmm, it was visible in the mail thread I think.

Okay, perhaps I missed it.

>
>>
>> I don't intend to send any more PR with fixes for 4.2, but we could
>> apply a fixes tag if there is regression involved. Can you point me to
>> the commit it fixes?
>
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/mmc/host?id=bd455029d01cb55dca6
> 2129282466ccea3698813

Thanks! I updated the change log with the following line.

Fixes: bd455029d01c ("mmc: sdhci-of-esdhc: Pre divider starts at 1")

Kind regards
Uffe

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

end of thread, other threads:[~2015-08-25 14:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11  2:53 [PATCH v2] mmc: sdhci-of-esdhc: add workaround for pre divider initial value Yangbo Lu
2015-08-11  8:11 ` Joakim Tjernlund
2015-08-25 12:05 ` Ulf Hansson
2015-08-25 12:21   ` Joakim Tjernlund
2015-08-25 13:56     ` Ulf Hansson
2015-08-25 14:00       ` Joakim Tjernlund
2015-08-25 14:20         ` Ulf Hansson

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.