On Mon, Aug 25, 2008 at 11:52:48AM -0300, Pedro Bulach Gapski wrote:
> Package: linux-image-2.6.25-2-686
> Version: 2.6.25-7
> 
> 
> I run debian testing on my eee pc 701. The box has one sd slot, and I have a
> transcend 16Gb sd card on it. When the card was new and empty, the system
> would boot with no problems with the card inside the slot. However, after I
> started writing to it, when I boot the system, it halts after udev starts
> with a read error on the card, and a hard boot is required. If I boot
> without the card in, everything goes fine.
> 
> My first guess was a bad sd card. I reformated it, used badblocks -w on it,
> and no problems were found. After the card was formated (and empty), the
> system would boot without problems.
> 
> However, as soon as I started writing to it, when I reboot I get the same
> read errors again.
> 
> If, however, I plug the card after system boot, I can use it without
> problems. I just tried to read it all to make sure:
> 
> gapski at revo:~$ dd bs=1024  if=/dev/sdb of=/dev/null
> 15694336+0 records in
> 15694336+0 records out
> 16071000064 bytes (16 GB) copied, 967.822 s, 16.6 MB/s
> 
> A later post on the debian eeepc mailing list seems to identify the
> issue and point to a patch:
> http://lists.alioth.debian.org/pipermail/debian-eeepc-devel/2008-August/000829.html
> 
> Can this patch be included into debian kernels?

The upstream commit points to the attached patch. Could you test it
against the Lenny kernel if it fixes your problem?

Cheers,
        Moritz
From: Alan Stern <st...@rowland.harvard.edu>
Date: Tue, 5 Aug 2008 17:05:17 +0000 (-0400)
Subject: Fix USB storage hang on command abort
X-Git-Tag: v2.6.27-rc2~38
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=580da34847488b404218d1d7f53b156f245f5555

Fix USB storage hang on command abort

Okay, I found the cause of the hang.  It is a simple bug in the USB
scatter-gather library, caused by changes added in response to the S-G
chaining modification.

This patch (as1125) fixes a bug in the USB scatter-gather library.
Early exit from the S-G initialization loop does not reset the count of
outstanding URBs.

Signed-off-by: Alan Stern <st...@rowland.harvard.edu>
Cc: Matthew Dharm <mdharm-...@one-eyed-alien.net>
Cc: David Brownell <davi...@pacbell.net>
Cc: Alan Jenkins <alan-jenk...@tuffmail.co.uk>
Cc: James Bottomley <james.bottom...@hansenpartnership.com>
Cc: Greg KH <g...@kroah.com>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
---

diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 2fcc06e..586d6f1 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -389,7 +389,6 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev,
 	if (io->entries <= 0)
 		return io->entries;
 
-	io->count = io->entries;
 	io->urbs = kmalloc(io->entries * sizeof *io->urbs, mem_flags);
 	if (!io->urbs)
 		goto nomem;
@@ -458,6 +457,7 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev,
 	io->urbs[--i]->transfer_flags &= ~URB_NO_INTERRUPT;
 
 	/* transaction state */
+	io->count = io->entries;
 	io->status = 0;
 	io->bytes = 0;
 	init_completion(&io->complete);

Reply via email to