Skip to contentSkip to conversation

OMAP4: HSMMC cmd line reset change

PATCH In review Madhusudhan Chikkature 3 participants 7 messages Sep 15, 2010 – Sep 22, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP4: HSMMC cmd line reset change

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.

---
 drivers/mmc/host/omap_hsmmc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/mmc/host/omap_hsmmc.c +0 -0
index 4526d27..750ba7d 100644
@@ -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();

Signature · 1 line
1.7.0.4
#1 lore raw

Hi Madhu,

Quoted 1 line · Madhusudhan Chikkature

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.

Quoted 15 lines

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.

---
 drivers/mmc/host/omap_hsmmc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/mmc/host/omap_hsmmc.c +0 -0
index 4526d27..750ba7d 100644

drivers/mmc/host/omap_hsmmc.c static inline void omap_hsmmc_reset_controller_fsm(struct · line 976

Quoted 1 line
drivers/mmc/host/omap_hsmmc.c +0 -0
@@ -976,12 +976,19 @@ static inline void omap_hsmmc_reset_controller_fsm(struct
 omap_hsmmc_host *host,

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

Quoted 18 lines
drivers/mmc/host/omap_hsmmc.c +7 -0
 						   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))
Quoted 3 lines

cpu_relax();

Signature · 1 line
1.7.0.4

Thanks, pushed to mmc-next.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#2 lore raw
In reply to Madhusudhan Chikkature
Quoted 36 lines · Madhusudhan Chikkature

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.

---
 drivers/mmc/host/omap_hsmmc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/mmc/host/omap_hsmmc.c +7 -0
index 4526d27..750ba7d 100644
@@ -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))
Quoted 1 line

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

#3 lore raw
Quoted 54 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Friday, September 17, 2010 10:48 AM
To: Madhusudhan Chikkature
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] OMAP4: HSMMC cmd line reset change

Quoted 7 lines · Madhusudhan Chikkature

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.

Review

Quoted 6 lines
---
 drivers/mmc/host/omap_hsmmc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/drivers/mmc/host/omap_hsmmc.c

drivers/mmc/host/omap_hsmmc.c static inline void

Quoted 4 lines

index 4526d27..750ba7d 100644

drivers/mmc/host/omap_hsmmc.c +0 -0
@@ -976,12 +976,19 @@ static inline void

omap_hsmmc_reset_controller_fsm(struct

Quoted 19 lines
drivers/mmc/host/omap_hsmmc.c +7 -0
 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))
Quoted 1 line

cpu_relax();

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

Quoted 3 lines

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

Quoted 6 lines

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

Regards,

Tony

#4 lore raw
Quoted 11 lines · Madhusudhan
Quoted 7 lines

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.

Quoted 2 lines

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

#5 lore raw
Quoted 24 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Tuesday, September 21, 2010 9:47 AM
To: Madhusudhan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] OMAP4: HSMMC cmd line reset change

Quoted 10 lines · Madhusudhan
Quoted 7 lines

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

Quoted 1 line

to the way in arch/mach-omap2/serial.c done for the uart case?

Quoted 8 lines

Yes setting some HSMMC_ERRATA_XYZ flag works too.

Quoted 2 lines

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

Quoted 3 lines

Regards,

Tony

#6 lore raw

Hi Madhu,

Quoted 3 lines · Madhusudhan

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,

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child