Module Name:    src
Committed By:   jakllsch
Date:           Thu Dec 20 22:56:38 UTC 2012

Modified Files:
        src/sys/dev/sdmmc: sdhc.c

Log Message:
If we get a SDMA boundary-crossing interrupt at the end of the final
segment, the transfer is not implicitly complete; we still need to wait
for the transfer complete interrupt so that we can issue new commands
successfully.

This fixes the problem my Ricoh R5C822 was having where all writes after
a larger (64KiB) write were failing because we attempted to issue CMD13
(to check the status of the aformentioned write) too soon afterwards.

I suspect this fix to apply to other Ricoh SDHCI controllers I've heard
people have had trouble with.  Sorry I didn't look at this sooner.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/sdmmc/sdhc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.36 src/sys/dev/sdmmc/sdhc.c:1.37
--- src/sys/dev/sdmmc/sdhc.c:1.36	Thu Dec 20 14:37:00 2012
+++ src/sys/dev/sdmmc/sdhc.c	Thu Dec 20 22:56:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.36 2012/12/20 14:37:00 jakllsch Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.37 2012/12/20 22:56:38 jakllsch Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.36 2012/12/20 14:37:00 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.37 2012/12/20 22:56:38 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -1299,7 +1299,7 @@ sdhc_transfer_data_dma(struct sdhc_host 
 		mutex_exit(&hp->host_mtx);
 
 		if ((seg == (cmd->c_dmamap->dm_nsegs-1)) && (posaddr == (segaddr + seglen))) {
-			break;
+			continue;
 		}
 		mutex_enter(&hp->host_mtx);
 		if ((posaddr >= segaddr) && (posaddr < (segaddr + seglen)))

Reply via email to