Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Sep 2003 13:39:08 -0700
From:      John-Mark Gurney <gurney_j@efn.org>
To:        Barney Wolff <barney@databus.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: usb flashkey disk copy error
Message-ID:  <20030907203908.GI39788@funkthat.com>
In-Reply-To: <20030907194830.GA6420@pit.databus.com>
References:  <20030907064510.GA702@libertysurf.fr> <20030907073246.GD39788@funkthat.com> <20030907174649.GA4378@pit.databus.com> <20030907175524.GG39788@funkthat.com> <20030907194830.GA6420@pit.databus.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Barney Wolff wrote this message on Sun, Sep 07, 2003 at 15:48 -0400:
> I can't do more detailed diagnosis right now, but could in a few days.

When you get a chance (or anyone else who has this problem), try the
attached patch, and add options BROKEN_OHCI to your kernel config file.
Please set hw.usb.ohci.debug=1, and send me the dmesg output of the
writes.  (When you copy the data to the media.)

Hmmm. I just thought of something.  Now is the data corrupt still correupt
on another system?  What I mean is did the data get written properly, but
just isn't being read back from the media correctly.  Unless you are
coping a file larger than memory size, the cmp just pulls it from memory,
not from the media.  The umount/mount forces a flush of the cache, and so
attempts to read from the media.

Thanks.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ohci.patch"

Index: ohci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/ohci.c,v
retrieving revision 1.132
diff -u -r1.132 ohci.c
--- ohci.c	2003/08/24 17:55:54	1.132
+++ ohci.c	2003/09/07 20:28:13
@@ -513,6 +513,14 @@
 
 	DPRINTFN(alen < 4096,("ohci_alloc_std_chain: start len=%d\n", alen));
 
+	if (ohcidebug && alen > 4096) {
+		printf("len: %d, pages: ", alen);
+		for (len = 0; len < alen; len += OHCI_PAGE_SIZE) {
+			printf("%s0x%x", len == 0 ? "" : ", ", DMAADDR(dma,
+			    len));
+		}
+	}
+
 	len = alen;
 	cur = sp;
 
@@ -546,9 +554,14 @@
 		 * We can describe the above using maxsegsz = 4k and nsegs = 2
 		 * in the future.
 		 */
+#if BROKEN_OHCI
+		if (len < OHCI_PAGE_SIZE - OHCI_PAGE_OFFSET(dataphys))
+#else
 		if (OHCI_PAGE(dataphys) == OHCI_PAGE(DMAADDR(dma, offset +
 		    len - 1)) || len - (OHCI_PAGE_SIZE -
-		    OHCI_PAGE_OFFSET(dataphys)) <= OHCI_PAGE_SIZE) {
+		    OHCI_PAGE_OFFSET(dataphys)) <= OHCI_PAGE_SIZE)
+#endif
+		{
 			/* we can handle it in this TD */
 			curlen = len;
 		} else {

--IS0zKkzwUGydFO0o--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030907203908.GI39788>