On Fri, 27 Sep 2002, Yuri Per wrote:

> Failed usb_reset_device() means only that reset is not yet completed.

This is not so.  There are several possible error returns from
usb_reset_device() that can occur even before the reset has been
initiated.  Furthermore, it's possible that the reset, once started, will
never complete because the device is hung.

> If we will return success from bus_reset(), scsi layer will wait for 5
> seconds during which device will probably reconnect.
>
> --- a/drivers/usb/storage/scsiglue.c    Fri Sep 27 18:20:19 2002
> +++ b/drivers/usb/storage/scsiglue.c    Fri Sep 27 18:20:19 2002
> @@ -243,7 +243,7 @@
>      US_DEBUGP("usb_reset_device returns %d\n", result);
>      if (result < 0) {
>          scsi_lock(srb->host);
> -        return FAILED;
> +        return SUCCESS;
>      }
>
>      /* FIXME: This needs to lock out driver probing while it's working

Making this change would violate the instructions given at the start of
the usb_reset_device() function:

/*
 * WARNING - If a driver calls usb_reset_device, you should simulate a
 * disconnect() and probe() for other interfaces you doesn't claim. This
 * is left up to the driver writer right now. This insures other drivers
 * have a chance to re-setup their interface.
 *
 * Take a look at proc_resetdevice in devio.c for some sample code to
 * do this.
 */


Alan Stern



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to