All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Simon Arlott <simon@fire.lp0.eu>
Cc: Greg KH <greg@kroah.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	USB list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] USB: output an error message when the pipe type doesn't match the endpoint type
Date: Wed, 1 Sep 2010 13:49:17 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1009011334160.1617-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <4C7E87DD.3080508@simon.arlott.org.uk>

On Wed, 1 Sep 2010, Simon Arlott wrote:

> > This is okay with me.  If you're serious about not changing the
> > behavior merely because debugging is enabled, you could move this test
> > out of the debug-only region and possibly change the dev_err to
> > dev_dbg.  However doing so might break some devices that are currently
> > working.
> 
> I'd expect that to break potentially many devices, although only cxacru
> stopped working for me. The USB API isn't really suitable for adding
> this type of check because it allows the drivers to get away with too
> much already.

Unlike device hardware, drivers can always be changed.  If adding a 
check will help spot errors, it's probably worthwhile.

> usb_clear_halt() takes a pipe when it really wants the endpoint, the
> pipe type is ignored.

What's wrong with that?  Besides, in the end we shouldn't be using
pipes at all; we should always use pointers to struct
usb_host_endpoint.

> usb_bulk_msg() auto-detects the type between interrupt and bulk, as
> does usb_interrupt_msg() because the latter just calls the former.
> 
> (I think -EINVAL might be a better return code. The pipe isn't broken,
> it doesn't exist.)

Within the kernel, the meanings of the -Exxx error codes are fairly
arbitrary.  But since this code can be passed to userspace you are
right.

Alan Stern


  reply	other threads:[~2010-09-01 17:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 21:50 [PATCH] USB: output an error message when the pipe type doesn't match the endpoint type Simon Arlott
2010-08-31  6:41 ` Clemens Ladisch
2010-08-31 11:31   ` Simon Arlott
2010-08-31 13:52   ` Alan Stern
2010-08-31 14:04     ` Xiaofan Chen
2010-08-31 14:16 ` Alan Stern
2010-09-01 17:05   ` Simon Arlott
2010-09-01 17:49     ` Alan Stern [this message]
2010-09-02 11:56       ` Simon Arlott
2010-09-02 14:22         ` Alan Stern
2010-09-02 17:11           ` Simon Arlott
2010-09-02 19:20             ` Alan Stern

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=Pine.LNX.4.44L0.1009011334160.1617-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=simon@fire.lp0.eu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.