Skip to content

Commit

Permalink
usb: gadget: epautoconf: do not change number of streams
Browse files Browse the repository at this point in the history
We should not change gadget driver's descriptors just
because we think it's right to do so.

There are several of reasons which would support this
statement but it suffices to say that this was probably
never tested because it updates bmAttributes without
asking the driver if it's ok to do so.

This means that e.g. on UASP gadget it would enable
stream support even for the command endpoint which must
not have stream support enabled.

In fact, this change is fixing the bug introduced by
commit a59d6b9 (usb: gadget: add streams support to
the gadget framework) which was caught when testing
UASP gadget with dwc3 driver.

Cc: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Dec 19, 2011
1 parent 248b122 commit 7422ba5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/usb/gadget/epautoconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ ep_matches (
num_req_streams = ep_comp->bmAttributes & 0x1f;
if (num_req_streams > ep->max_streams)
return 0;
/* Update the ep_comp descriptor if needed */
if (num_req_streams != ep->max_streams)
ep_comp->bmAttributes = ep->max_streams;
}

}
Expand Down

0 comments on commit 7422ba5

Please sign in to comment.