public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Kevin Lloyd <klloyd@sierrawireless.com>
Cc: gregkh@suse.de, mdharm-usb@one-eyed-alien.net,
	usb-storage@lists.one-eyed-alien.net,
	linux-kernel@vger.kernel.org,
	linux-usb-users@lists.sourceforge.net
Subject: Re: [PATCH] usb-storage: Add support for unusual device by Sierra Wireless
Date: Mon, 14 May 2007 15:19:43 -0700	[thread overview]
Message-ID: <20070514151943.fb035b4d.zaitcev@redhat.com> (raw)
In-Reply-To: <4648D851.2030500@sierrawireless.com>

On Mon, 14 May 2007 14:44:49 -0700, Kevin Lloyd <klloyd@sierrawireless.com> 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

  reply	other threads:[~2007-05-14 22:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14 21:44 [PATCH] usb-storage: Add support for unusual device by Sierra Wireless Kevin Lloyd
2007-05-14 22:19 ` Pete Zaitcev [this message]
2007-05-14 22:59 ` Daniel Drake
2007-05-14 23:10   ` Kevin Lloyd
2007-05-14 23:27     ` Daniel Drake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070514151943.fb035b4d.zaitcev@redhat.com \
    --to=zaitcev@redhat.com \
    --cc=gregkh@suse.de \
    --cc=klloyd@sierrawireless.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-users@lists.sourceforge.net \
    --cc=mdharm-usb@one-eyed-alien.net \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox