PERFORCE change 209200 for review

Robert Watson rwatson at FreeBSD.org
Sat Apr 7 13:39:33 UTC 2012


http://p4web.freebsd.org/@@209200?ac=10

Change 209200 by rwatson at rwatson_svr_ctsrd_mipsbuild on 2012/04/07 13:39:22

	When performing an SD Card write, ignore the ASR bit described by
	the specification as "most recently received data contains errors";
	this bit is apparently always set if a block write is performed,
	and only useful when looking at the results of a block read.  With
	this change, many block writes using the SD Card slot on the
	Terasic DE-4 board often succeed.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_io.c#9 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_io.c#9 (text+ko) ====

@@ -301,8 +301,8 @@
 	/*
 	 * Handle I/O retries if an error is returned by the device.
 	 */
-	if (asr &
-	    (ALTERA_SDCARD_ASR_CMDTIMEOUT | ALTERA_SDCARD_ASR_CMDDATAERROR)) {
+	if ((asr & ALTERA_SDCARD_ASR_CMDTIMEOUT) || (bp->bio_cmd == BIO_READ
+	    && (asr & ALTERA_SDCARD_ASR_CMDDATAERROR))) {
 		rr1 = altera_sdcard_read_rr1(sc);
 		sc->as_retriesleft--;
 		if (sc->as_retriesleft != 0) {


More information about the p4-projects mailing list