[PATCH 2/2]s3c24xx mci - Do not fill in resp buf if command timed out

Alex ling_kasim at yahoo.cn
Mon Dec 15 04:43:08 CET 2008


Hi All,
Here's a patch fixing the issue that resp buf would be filled with invalid data if command timed out in u-boot s3c24xx mci driver.

---
 cpu/arm920t/s3c24x0/mmc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: uboot-git-650149a53dbdd48bf6dfef90930c8ab182adb512/cpu/arm920t/s3c24x0/mmc.c
===================================================================
--- uboot-git-650149a53dbdd48bf6dfef90930c8ab182adb512.orig/cpu/arm920t/s3c24x0/mmc.c	2008-12-15 07:49:58.000000000 +0800
+++ uboot-git-650149a53dbdd48bf6dfef90930c8ab182adb512/cpu/arm920t/s3c24x0/mmc.c	2008-12-15 07:52:27.000000000 +0800
@@ -71,6 +71,7 @@
 
 	u_int32_t ccon, csta;
 	u_int32_t csta_rdy_bit = S3C2410_SDICMDSTAT_CMDSENT;
+	int is_timeout = 0;
 
 	memset(resp, 0, sizeof(resp));
 
@@ -102,6 +103,7 @@
 		if (csta & S3C2410_SDICMDSTAT_CMDTIMEOUT) {
 			printf("===============> MMC CMD Timeout\n");
 			sdi->SDICSTA |= S3C2410_SDICMDSTAT_CMDTIMEOUT;
+			is_timeout = 1;
 			break;
 		}
 	}
@@ -110,7 +112,7 @@
 
 	sdi->SDICSTA |= csta_rdy_bit;
 
-	if (flags & CMD_F_RESP) {
+	if (flags & CMD_F_RESP && !is_timeout) {
 		resp[0] = sdi->SDIRSP0;
 		resp[1] = sdi->SDIRSP1;
 		resp[2] = sdi->SDIRSP2;



      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_s3c24xx_mci_cmd_timeout.patch
Type: application/octet-stream
Size: 1057 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20081215/34a712da/attachment.obj 


More information about the openmoko-kernel mailing list