Re: [PATCH] USB: output an error message when the pipe type doesn't match the endpoint type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux