On Mon, 14 May 2007 14:44:49 -0700, Kevin Lloyd <[EMAIL PROTECTED]> wrote:

> +             schedule_timeout_uninterruptible(delay_t*HZ);
> +             retval = sierra_ms_change_mode(us, SWIMS_SET_MODE_Modem);
> +             if (retval == -ETIMEDOUT || retval == -ETIME) {
> +                     US_DEBUGP("sierra_ms: Command timed out.\n");
> +                     retries--;

This is strange. The two values should not typically be mixed this way.

ETIMEOUT happens when we (host) sent the setup packet, device took it,
and then posted NAKs for all data-in that we did, so eventually (after 5s),
we unlinked the URB. This means that the device works, just doesn't
want to perform the command in time. The bus itself functions fine.

ETIME means that something has violated the bus protocol. It's like
-EBUS for MMIO on PCI. Usually it means that the firmware in the device
is completely dead. You can call this a timeout in some sense, but
in reality it's no different from EILSEQ. We just report a different
code for finer shades of debugging. It happens in less than a millisecond.

I think you just need to test for ETIMEDOUT for that message.

> +     int result;
> +     unsigned char *blankArray;
> +     blankArray = kmalloc(0, GFP_KERNEL);

> +     result = usb_stor_control_msg(us, us->send_ctrl_pipe,
> +                             SWIMS_USB_REQUEST_SetMode,
> +                             SWIMS_USB_REQUEST_TYPE_SetMode,
> +                             eSocMode,
> +                             SWIMS_USB_INDEX_SetMode,
> +                             blankArray,
> +                             0,
> +                             5*HZ);

The blankArray is completely unnecessary here. If something hits
a NULL despite the zero transfer size, it has to be fixed.

-- Pete

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to