All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] USB: tweak the new control-message helpers
@ 2020-12-04  8:51 Johan Hovold
  2020-12-04  8:51 ` [PATCH 1/3] USB: core: drop pipe-type check from " Johan Hovold
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Johan Hovold @ 2020-12-04  8:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, Himadri Pandya, Johan Hovold

The new control-message helpers include a pipe-type check which is
almost completely redundant.
    
Control messages are generally sent to the default pipe which always
exists and is of the correct type since its endpoint representation is
created by USB core as part of enumeration for all devices.

There is currently only one instance of a driver in the tree which use a
control endpoint other than endpoint 0 (and it does not use the new
helpers).

Drivers should be testing for the existence of their resources at probe
rather than at runtime, but to catch drivers failing to do so USB core
already does a sanity check on URB submission and triggers a WARN().
Having the same sanity check done in the helper only suppresses the
warning without allowing us to find and fix the drivers.

The first patch drops the sanity check from the helpers; the second
removes a redundant check for short transfers in usb_control_msg_send()
which is always treated as an error; the final patch switches to using
-EREMOTEIO for short reads which is the error code already used by the
host-controller drivers for this.

Johan


Johan Hovold (3):
  USB: core: drop pipe-type check from new control-message helpers
  USB: core: drop short-transfer check from usb_control_msg_send()
  USB: core: return -EREMOTEIO on short usb_control_msg_recv()

 drivers/usb/core/message.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-12-07 14:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  8:51 [PATCH 0/3] USB: tweak the new control-message helpers Johan Hovold
2020-12-04  8:51 ` [PATCH 1/3] USB: core: drop pipe-type check from " Johan Hovold
2020-12-04 15:14   ` Greg Kroah-Hartman
2020-12-04 15:50     ` Johan Hovold
2020-12-06 11:20       ` Greg Kroah-Hartman
2020-12-06 16:25         ` Alan Stern
2020-12-07  9:46         ` Johan Hovold
2020-12-07 14:24           ` Greg Kroah-Hartman
2020-12-04  8:51 ` [PATCH 2/3] USB: core: drop short-transfer check from usb_control_msg_send() Johan Hovold
2020-12-04 15:17   ` Greg Kroah-Hartman
2020-12-04  8:51 ` [PATCH 3/3] USB: core: return -EREMOTEIO on short usb_control_msg_recv() Johan Hovold

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.