Re: ehci_hcd fails to read a single good block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Actually, ehci_hcd has nothing to do with this.  The problem in likely
in sd_mod or the scsi core.  Those are the modules that translate your
userspace request for a single block into a scsi request, which is
then processed by usb-storage and passed to the usb core (to be
further passed to the relevant HCD, which may or may not be ehci_hcd).
 Nobody from usb-storage down to the device and back modifies the
request in any way.

So, the problem is that sd_mod is turning your request for a single
block into a request for several blocks.

As for needing unplug and replug, likely the firmware in your device
is crashing when it encounters a bad block. So there is nothing which
can be done to recover aside from resetting the device with an
unplug/replug cycle.

Matt

On Sun, Mar 25, 2012 at 9:22 PM, Norman Diamond <n0diamond@xxxxxxxxxxx> wrote:
> dd if=/dev/sdb of=/dev/zero bs=512 count=1 skip=551563
> should succeed because block 551563 has no problem.  But it fails because ehci_hcd insists on reading blocks 551560 through 551567, and block 551562 does have a problem.
>
> Some years ago similar problems in linux-ide and libata were fixed.  ehci_hcd would also benefit from fixing.
>
> ehci_hcd has further problems.  After failing to read block 551562, it tries to reassign device addresses on the USB bus, fails repeatedly, and gives up.  Unplugging and replugging the USB cable fixes this, so that block numbers far enough away from bad blocks can be read again.  I think that unplugging should not be necessary.
>
> (Of course I should have been outputting to /dev/null instead of /dev/zero but that should not matter.)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Matthew Dharm
Maintainer, USB Mass Storage driver for Linux
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux