linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OMAP4: HSMMC cmd line reset change
@ 2010-09-15 23:58 Madhusudhan Chikkature
  2010-09-16 21:27 ` Chris Ball
  2010-09-17 15:48 ` Tony Lindgren
  0 siblings, 2 replies; 7+ messages in thread
From: Madhusudhan Chikkature @ 2010-09-15 23:58 UTC (permalink / raw)
  To: cjb; +Cc: linux-mmc, linux-omap, santosh.shilimkar

OMAP4: HSMMC cmd line reset change

The cmd line reset logic is changed in OMAP4 ES2. The new procedure
is to monitor a 0->1 transition and then 1->0 transition.The earlier
logic would fail on ES2 chips because the loop could exit even before
the reset is actually complete.

Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4526d27..750ba7d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -976,12 +976,19 @@ static inline void omap_hsmmc_reset_controller_fsm(struct
omap_hsmmc_host *host,
 						   unsigned long bit)
 {
 	unsigned long i = 0;
+	unsigned long j = 0;
 	unsigned long limit = (loops_per_jiffy *
 				msecs_to_jiffies(MMC_TIMEOUT_MS));

 	OMAP_HSMMC_WRITE(host->base, SYSCTL,
 			 OMAP_HSMMC_READ(host->base, SYSCTL) | bit);

+	if (cpu_is_omap44xx() && bit == SRC) {
+		while ((!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
+				&& (j++ < limit))
+			cpu_relax();
+	}
+
 	while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) &&
 		(i++ < limit))
 		cpu_relax();
-- 
1.7.0.4




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

* Re: [PATCH] OMAP4: HSMMC cmd line reset change
  2010-09-15 23:58 [PATCH] OMAP4: HSMMC cmd line reset change Madhusudhan Chikkature
@ 2010-09-16 21:27 ` Chris Ball
  2010-09-17 15:48 ` Tony Lindgren
  1 sibling, 0 replies; 7+ messages in thread
From: Chris Ball @ 2010-09-16 21:27 UTC (permalink / raw)
  To: Madhusudhan Chikkature; +Cc: linux-mmc, linux-omap, santosh.shilimkar

Hi Madhu,

On Thu, Sep 16, 2010 at 05:28:11AM +0530, Madhusudhan Chikkature wrote:
> OMAP4: HSMMC cmd line reset change

Please don't repeat the subject line like this -- "git am" will put it
into the patch twice.  You can either leave the subject line out of the
body of the mail altogether, or put "Subject: " in front of it.

> The cmd line reset logic is changed in OMAP4 ES2. The new procedure
> is to monitor a 0->1 transition and then 1->0 transition.The earlier
> logic would fail on ES2 chips because the loop could exit even before
> the reset is actually complete.
> 
> Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 4526d27..750ba7d 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -976,12 +976,19 @@ static inline void omap_hsmmc_reset_controller_fsm(struct
> omap_hsmmc_host *host,

(This was line-wrapped, I fixed it.)

>  						   unsigned long bit)
>  {
>  	unsigned long i = 0;
> +	unsigned long j = 0;
>  	unsigned long limit = (loops_per_jiffy *
>  				msecs_to_jiffies(MMC_TIMEOUT_MS));
> 
>  	OMAP_HSMMC_WRITE(host->base, SYSCTL,
>  			 OMAP_HSMMC_READ(host->base, SYSCTL) | bit);
> 
> +	if (cpu_is_omap44xx() && bit == SRC) {
> +		while ((!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
> +				&& (j++ < limit))
> +			cpu_relax();
> +	}
> +
>  	while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) &&
>  		(i++ < limit))
>  		cpu_relax();
> -- 
> 1.7.0.4

Thanks, pushed to mmc-next.

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] OMAP4: HSMMC cmd line reset change
  2010-09-15 23:58 [PATCH] OMAP4: HSMMC cmd line reset change Madhusudhan Chikkature
  2010-09-16 21:27 ` Chris Ball
@ 2010-09-17 15:48 ` Tony Lindgren
  2010-09-20 16:14   ` Madhusudhan
  1 sibling, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2010-09-17 15:48 UTC (permalink / raw)
  To: Madhusudhan Chikkature; +Cc: cjb, linux-mmc, linux-omap, santosh.shilimkar

* Madhusudhan Chikkature <madhu.cr@ti.com> [100915 16:50]:
> OMAP4: HSMMC cmd line reset change
> 
> The cmd line reset logic is changed in OMAP4 ES2. The new procedure
> is to monitor a 0->1 transition and then 1->0 transition.The earlier
> logic would fail on ES2 chips because the loop could exit even before
> the reset is actually complete.
> 
> Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 4526d27..750ba7d 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -976,12 +976,19 @@ static inline void omap_hsmmc_reset_controller_fsm(struct
> omap_hsmmc_host *host,
>  						   unsigned long bit)
>  {
>  	unsigned long i = 0;
> +	unsigned long j = 0;
>  	unsigned long limit = (loops_per_jiffy *
>  				msecs_to_jiffies(MMC_TIMEOUT_MS));
> 
>  	OMAP_HSMMC_WRITE(host->base, SYSCTL,
>  			 OMAP_HSMMC_READ(host->base, SYSCTL) | bit);
> 
> +	if (cpu_is_omap44xx() && bit == SRC) {
> +		while ((!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
> +				&& (j++ < limit))
> +			cpu_relax();
> +	}
> +
>  	while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) &&
>  		(i++ < limit))
>  		cpu_relax();

Please don't use cpu_is_omapxxxx tests in the drivers, drivers
should be generic.

Instead, just pass a feature flag in the platform_data for this
feature like HSMMC_REVERSE_RESET_LOGIC or similar.

Even better, look at the mmc silicon revision number and set this
flag automatically during the driver init if possible.

Regards,

Tony

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

* RE: [PATCH] OMAP4: HSMMC cmd line reset change
  2010-09-17 15:48 ` Tony Lindgren
@ 2010-09-20 16:14   ` Madhusudhan
  2010-09-21 14:47     ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Madhusudhan @ 2010-09-20 16:14 UTC (permalink / raw)
  To: 'Tony Lindgren'; +Cc: cjb, linux-mmc, linux-omap, santosh.shilimkar



> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com]
> Sent: Friday, September 17, 2010 10:48 AM
> To: Madhusudhan Chikkature
> Cc: cjb@laptop.org; linux-mmc@vger.kernel.org; linux-omap@vger.kernel.org;
> santosh.shilimkar@ti.com
> Subject: Re: [PATCH] OMAP4: HSMMC cmd line reset change
> 
> * Madhusudhan Chikkature <madhu.cr@ti.com> [100915 16:50]:
> > OMAP4: HSMMC cmd line reset change
> >
> > The cmd line reset logic is changed in OMAP4 ES2. The new procedure
> > is to monitor a 0->1 transition and then 1->0 transition.The earlier
> > logic would fail on ES2 chips because the loop could exit even before
> > the reset is actually complete.
> >
> > Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
> > ---
> >  drivers/mmc/host/omap_hsmmc.c |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mmc/host/omap_hsmmc.c
> b/drivers/mmc/host/omap_hsmmc.c
> > index 4526d27..750ba7d 100644
> > --- a/drivers/mmc/host/omap_hsmmc.c
> > +++ b/drivers/mmc/host/omap_hsmmc.c
> > @@ -976,12 +976,19 @@ static inline void
> omap_hsmmc_reset_controller_fsm(struct
> > omap_hsmmc_host *host,
> >  						   unsigned long bit)
> >  {
> >  	unsigned long i = 0;
> > +	unsigned long j = 0;
> >  	unsigned long limit = (loops_per_jiffy *
> >  				msecs_to_jiffies(MMC_TIMEOUT_MS));
> >
> >  	OMAP_HSMMC_WRITE(host->base, SYSCTL,
> >  			 OMAP_HSMMC_READ(host->base, SYSCTL) | bit);
> >
> > +	if (cpu_is_omap44xx() && bit == SRC) {
> > +		while ((!(OMAP_HSMMC_READ(host->base, SYSCTL) & bit))
> > +				&& (j++ < limit))
> > +			cpu_relax();
> > +	}
> > +
> >  	while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) &&
> >  		(i++ < limit))
> >  		cpu_relax();
> 
> Please don't use cpu_is_omapxxxx tests in the drivers, drivers
> should be generic.
> 
> Instead, just pass a feature flag in the platform_data for this
> feature like HSMMC_REVERSE_RESET_LOGIC or similar.
> 

This is not a feature. It is like an ERRATA fix. I am yet to receive an
errata number though. How about dealing with this like an errata fix similar
to the way in arch/mach-omap2/serial.c done for the uart case? 

The mmc ip revision will not help because it really does not change to
distinguish such issues.

Regards,
Madhu

> Even better, look at the mmc silicon revision number and set this
> flag automatically during the driver init if possible.
> 
> Regards,
> 
> Tony


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

* Re: [PATCH] OMAP4: HSMMC cmd line reset change
  2010-09-20 16:14   ` Madhusudhan
@ 2010-09-21 14:47     ` Tony Lindgren
  2010-09-22 17:13       ` Madhusudhan
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2010-09-21 14:47 UTC (permalink / raw)
  To: Madhusudhan; +Cc: cjb, linux-mmc, linux-omap, santosh.shilimkar

* Madhusudhan <madhu.cr@ti.com> [100920 09:06]:
> > 
> > Please don't use cpu_is_omapxxxx tests in the drivers, drivers
> > should be generic.
> > 
> > Instead, just pass a feature flag in the platform_data for this
> > feature like HSMMC_REVERSE_RESET_LOGIC or similar.
> > 
> 
> This is not a feature. It is like an ERRATA fix. I am yet to receive an
> errata number though. How about dealing with this like an errata fix similar
> to the way in arch/mach-omap2/serial.c done for the uart case? 

Yes setting some HSMMC_ERRATA_XYZ flag works too.
 
> The mmc ip revision will not help because it really does not change to
> distinguish such issues.

OK. Then I guess your only option is to pass the errata flag in
the platform_data.

Regards,

Tony

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

* RE: [PATCH] OMAP4: HSMMC cmd line reset change
  2010-09-21 14:47     ` Tony Lindgren
@ 2010-09-22 17:13       ` Madhusudhan
  2010-09-22 17:25         ` Chris Ball
  0 siblings, 1 reply; 7+ messages in thread
From: Madhusudhan @ 2010-09-22 17:13 UTC (permalink / raw)
  To: 'Tony Lindgren'; +Cc: cjb, linux-mmc, linux-omap, santosh.shilimkar



> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com]
> Sent: Tuesday, September 21, 2010 9:47 AM
> To: Madhusudhan
> Cc: cjb@laptop.org; linux-mmc@vger.kernel.org; linux-omap@vger.kernel.org;
> santosh.shilimkar@ti.com
> Subject: Re: [PATCH] OMAP4: HSMMC cmd line reset change
> 
> * Madhusudhan <madhu.cr@ti.com> [100920 09:06]:
> > >
> > > Please don't use cpu_is_omapxxxx tests in the drivers, drivers
> > > should be generic.
> > >
> > > Instead, just pass a feature flag in the platform_data for this
> > > feature like HSMMC_REVERSE_RESET_LOGIC or similar.
> > >
> >
> > This is not a feature. It is like an ERRATA fix. I am yet to receive an
> > errata number though. How about dealing with this like an errata fix
> similar
> > to the way in arch/mach-omap2/serial.c done for the uart case?
> 
> Yes setting some HSMMC_ERRATA_XYZ flag works too.
> 
> > The mmc ip revision will not help because it really does not change to
> > distinguish such issues.
> 
> OK. Then I guess your only option is to pass the errata flag in
> the platform_data.
> 
Chris,

Can you please drop this patch? Sorry, I spoke bit too early on this patch.
I need to sort out some stuff internally (seems like it will not be released
as an errata). I will post a revised version a bit later.

Regards,
Madhu

> Regards,
> 
> Tony


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

* Re: [PATCH] OMAP4: HSMMC cmd line reset change
  2010-09-22 17:13       ` Madhusudhan
@ 2010-09-22 17:25         ` Chris Ball
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Ball @ 2010-09-22 17:25 UTC (permalink / raw)
  To: Madhusudhan
  Cc: 'Tony Lindgren', linux-mmc, linux-omap, santosh.shilimkar

Hi Madhu,

On Wed, Sep 22, 2010 at 12:13:51PM -0500, Madhusudhan wrote:
> Can you please drop this patch? Sorry, I spoke bit too early on this patch.
> I need to sort out some stuff internally (seems like it will not be released
> as an errata). I will post a revised version a bit later.

No problem, I dropped this after seeing Tony's comments.  I'll keep
an eye out for a new patch with his ACK.

Thanks,

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

end of thread, other threads:[~2010-09-22 17:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-15 23:58 [PATCH] OMAP4: HSMMC cmd line reset change Madhusudhan Chikkature
2010-09-16 21:27 ` Chris Ball
2010-09-17 15:48 ` Tony Lindgren
2010-09-20 16:14   ` Madhusudhan
2010-09-21 14:47     ` Tony Lindgren
2010-09-22 17:13       ` Madhusudhan
2010-09-22 17:25         ` Chris Ball

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