mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* MMC: CRC Errors with 2GB cards
@ 2007-10-19 16:17 Roopesh
  2007-10-27 12:00 ` Pierre Ossman
  0 siblings, 1 reply; 5+ messages in thread
From: Roopesh @ 2007-10-19 16:17 UTC (permalink / raw)
  To: linux-kernel

 Hi, 

 I am seeing a lot of CRC errors happening with CMD25 on a couple 
 of Transcend 2GB cards (specifiation version 1.1).  However, if 
 I apply the following patch, I see no errors being reported


--- linux-2.6.22/drivers/mmc/card/block.c	2007-09-27 14:59:44.000000000 +0530
+++ linux-tao/drivers/mmc/card/block.c	2007-10-19 20:53:52.000000000 +0530
@@ -298,6 +298,7 @@
 		}
 
 		if (rq_data_dir(req) != READ) {
+			/* Wait for the card to to be in transfer state*/
 			do {
 				int err;
 
@@ -310,8 +311,8 @@
 					       req->rq_disk->disk_name, err);
 					goto cmd_err;
 				}
-			} while (!(cmd.resp[0] & R1_READY_FOR_DATA));
-
+			} while (!(R1_CURRENT_STATE(cmd.resp[0]) == 4)); 
+			
 #if 0
 			if (cmd.resp[0] & ~0x00000900)
 				printk(KERN_ERR "%s: status = %08x\n",


 I noticed that at times the card is not actually in transfer 
 state when it recieves the second consecutive 
 MULTIPLE_BLOCK_WRITE cmd.  As per the simplified specification 
 available, all class 4 commands including CMD25 can be issued 
 only in tra state, though its also specified that READY_FOR_DATA 
 indicates whether the card can accept new data.

 I am just wondering if I have set of broken cards.  Any pointers 
 in this regard?

 Thanks and Regards,
 Roopesh.

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

* Re: MMC: CRC Errors with 2GB cards
  2007-10-19 16:17 MMC: CRC Errors with 2GB cards Roopesh
@ 2007-10-27 12:00 ` Pierre Ossman
  2007-10-29  9:50   ` Roopesh
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Ossman @ 2007-10-27 12:00 UTC (permalink / raw)
  To: Roopesh; +Cc: linux-kernel, Andrew Morton

Hi Roopesh,

I'm terribly sorry I haven't replied sooner. I put your message on my todo list, figuring I could get to it within a day or two, but as you noticed, that didn't quite happen. :/

On Fri, 19 Oct 2007 12:17:00 -0400
Roopesh <roopesh@cyberspace.org> wrote:

>  Hi, 
> 
>  I am seeing a lot of CRC errors happening with CMD25 on a couple 
>  of Transcend 2GB cards (specifiation version 1.1).  However, if 
>  I apply the following patch, I see no errors being reported
> 

Ok, so the card is mishandling the state bits a bit. We should be able to work around that.

> @@ -310,8 +311,8 @@
>  					       req->rq_disk->disk_name, err);
>  					goto cmd_err;
>  				}
> -			} while (!(cmd.resp[0] & R1_READY_FOR_DATA));
> -
> +			} while (!(R1_CURRENT_STATE(cmd.resp[0]) == 4)); 
> +			
>  #if 0

This might trade us one problem for another. Could you try the following:

} while (!(cmd.resp[0] & R1_READY_FOR_DATA) || (R1_CURRENT_STATE(cmd.resp[0]) == 7));

This should also work for cards that mishandle the state field, and if the card jumps to
some odd state for some reason.

> 
>  I am just wondering if I have set of broken cards.  Any pointers 
>  in this regard?
> 

You do. But don't be too alarmed, that is unfortunately the norm. :/

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

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

* Re: MMC: CRC Errors with 2GB cards
  2007-10-27 12:00 ` Pierre Ossman
@ 2007-10-29  9:50   ` Roopesh
  2007-10-31 19:55     ` Pierre Ossman
  0 siblings, 1 reply; 5+ messages in thread
From: Roopesh @ 2007-10-29  9:50 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Roopesh, linux-kernel, Andrew Morton

 Hi Pierrie, 

 Thanks for writing back. 

:     > -			} while (!(cmd.resp[0] & R1_READY_FOR_DATA));
:     > -
:     > +			} while (!(R1_CURRENT_STATE(cmd.resp[0]) == 4)); 
:     > +			
:     >  #if 0
:     
:     This might trade us one problem for another. Could you try the following:
:     
:     } while (!(cmd.resp[0] & R1_READY_FOR_DATA) || (R1_CURRENT_STATE(cmd.resp[0]) == 7));
:
:     
:     This should also work for cards that mishandle the state field, and if the card jumps to
:     some odd state for some reason.
:     
:     > 
:     >  I am just wondering if I have set of broken cards.  Any pointers 
:     >  in this regard?
:     > 
:     
:     You do. But don't be too alarmed, that is unfortunately the norm. :/
:     

 I have purchased 4 Transcend cards, and all of them behave the 
 same way.  Just wondering why others dont have this problem, and 
 why such a fix hasn't made it to main tree yet.

 I have tried the fix, and it works fine.  Thanks.

 Roopesh.

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

* Re: MMC: CRC Errors with 2GB cards
  2007-10-29  9:50   ` Roopesh
@ 2007-10-31 19:55     ` Pierre Ossman
  2007-11-01 10:39       ` Roopesh
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Ossman @ 2007-10-31 19:55 UTC (permalink / raw)
  To: Roopesh; +Cc: linux-kernel, Andrew Morton

On Mon, 29 Oct 2007 05:50:15 -0400
Roopesh <roopesh@cyberspace.org> wrote:

> 
>  I have purchased 4 Transcend cards, and all of them behave the 
>  same way.  Just wondering why others dont have this problem, and 
>  why such a fix hasn't made it to main tree yet.
> 

Odd. I have a whole bunch of transcend cards, and I've never gotten this problem. Perhaps yours are rather recent?

>  I have tried the fix, and it works fine.  Thanks.
> 

Great. I'll queue it up for -mm for some more testing, after which it will get merged.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

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

* Re: MMC: CRC Errors with 2GB cards
  2007-10-31 19:55     ` Pierre Ossman
@ 2007-11-01 10:39       ` Roopesh
  0 siblings, 0 replies; 5+ messages in thread
From: Roopesh @ 2007-11-01 10:39 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Roopesh, linux-kernel, Andrew Morton

:---------- Original Message ----------
:From:  Pierre Ossman [drzeus-list@drzeus.cx]
:Sent:  Wed, Oct 31, 2007 at 03:55:58PM EDT
:
:     Odd. I have a whole bunch of transcend cards, and I've
:     never gotten this problem. Perhaps yours are rather recent?
:     

  Though these cards were purchased only in last month, the 
  manufactring date (in cid) is shown to be 3-2007. Here are the 
  entire CID fields:

  manfid:28, product_name:SDC  , serial=5332, oemid=21334, 
  month-year=3-2007, hw-fw_rev=1-0

  / # cat /sys/bus/mmc/devices/mmc0\:b368/cid
  1c5356534443202010000014d400737d

  Thanks and Regards,
  Roopesh Keeppattu.

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

end of thread, other threads:[~2007-11-01 10:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-19 16:17 MMC: CRC Errors with 2GB cards Roopesh
2007-10-27 12:00 ` Pierre Ossman
2007-10-29  9:50   ` Roopesh
2007-10-31 19:55     ` Pierre Ossman
2007-11-01 10:39       ` Roopesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome