On Thu, 9 Jun 2005, Dag Nygren wrote:

> OK, here is a log with the patches and the USB_DEBUG stuff enabled.

Good, this clears up both mysteries.

The USB-2.0 stick doesn't work well with your computer's USB host
controller.

> Update:
>
> Just bought another USB 2.0 stick, a Sandisk 512 MB.
>
> This seems to work fine in the system.
> So the problem is not 1.1/2.0, but something else.

Yes, the problem is the stick itself, or the combination stick/controller.  
The log shows that the very first READ command (when the computer tries to
read the partition sector) failed and the stick got disconnected.  It's
not clear if this was caused by something the stick did or by something
the OHCI controller did, but either way it triggered the bug that came
later.

(David, this might be a good example of the sort of thing you want to 
track down.  Maybe Dag can help.)

Presumably the Sandisk stick responds to READs with no trouble.

> I also noticed that the oops doesn't happen every time??
> Guess that the address accessed is random and not always an illegal
> kernel address?

Yes.

The oops is caused by a bug in the SCSI code.  The patch below should fix
it.  Please try it out (be sure to remove the old patch first!) and let me
know if it prevents the old 2.0 stick from oopsing.  If it does, I'll send
it to the people on the SCSI development team.

Alan Stern



Index: usb-2.6/drivers/scsi/scsi_sysfs.c
===================================================================
--- usb-2.6.orig/drivers/scsi/scsi_sysfs.c
+++ usb-2.6/drivers/scsi/scsi_sysfs.c
@@ -653,17 +653,19 @@ void __scsi_remove_target(struct scsi_ta
 {
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
        unsigned long flags;
-       struct scsi_device *sdev, *tmp;
+       struct scsi_device *sdev;
 
        spin_lock_irqsave(shost->host_lock, flags);
        starget->reap_ref++;
-       list_for_each_entry_safe(sdev, tmp, &shost->__devices, siblings) {
+restart:
+       list_for_each_entry(sdev, &shost->__devices, siblings) {
                if (sdev->channel != starget->channel ||
                    sdev->id != starget->id)
                        continue;
                spin_unlock_irqrestore(shost->host_lock, flags);
                scsi_remove_device(sdev);
                spin_lock_irqsave(shost->host_lock, flags);
+               goto restart;
        }
        spin_unlock_irqrestore(shost->host_lock, flags);
        scsi_target_reap(starget);



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to