[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1009011334160.1617-100000@iolanthe.rowland.org>
Date: Wed, 1 Sep 2010 13:49:17 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Simon Arlott <simon@...e.lp0.eu>
cc: Greg KH <greg@...ah.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
USB list <linux-usb@...r.kernel.org>
Subject: Re: [PATCH] USB: output an error message when the pipe type doesn't
match the endpoint type
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists