From ccc080c77cd47fde5eb097058fae930b956096eb Mon Sep 17 00:00:00 2001 From: Ajay Kumar Gupta Date: Tue, 13 Dec 2011 10:32:42 +0530 Subject: [PATCH 1/3] usb: musb: fix reset issue with full speed device TXMAXP register is not getting programmed correctly for a full speed device as can_bulk_split() have been removed by "0662481: usb: musb: disable double buffering when it's broken" patch. Adding back the case for can_bulk_split() to fix the reset message seen with a full speed stick. Signed-off-by: Ajay Kumar Gupta Signed-off-by: Felipe Balbi --- drivers/usb/musb/musb_host.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 60ddba8066ea..79cb0af779fa 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -774,6 +774,10 @@ static void musb_ep_program(struct musb *musb, u8 epnum, if (musb->double_buffer_not_ok) musb_writew(epio, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); + else if (can_bulk_split(musb, qh->type)) + musb_writew(epio, MUSB_TXMAXP, packet_sz + | ((hw_ep->max_packet_sz_tx / + packet_sz) - 1) << 11); else musb_writew(epio, MUSB_TXMAXP, qh->maxpacket | From 248b122b131202de95aaa3670e48465619bdff14 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Wed, 14 Dec 2011 21:59:30 +0200 Subject: [PATCH 2/3] usb: dwc3: core: fix cached revision on our structure All our revision macros are defined with the entire 32-bits which we read from GSNPSID register, so we must cache all 32-bits properly rather than masking the top 16-bits. This will fix all revision checks we have on current driver. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 717ebc9ff941..600d82348511 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -264,7 +264,7 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc) ret = -ENODEV; goto err0; } - dwc->revision = reg & DWC3_GSNPSREV_MASK; + dwc->revision = reg; dwc3_core_soft_reset(dwc); From 7422ba5343b8c1dbe1a517d0fcc15e7d671ca960 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Mon, 19 Dec 2011 13:45:01 +0200 Subject: [PATCH 3/3] usb: gadget: epautoconf: do not change number of streams 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 Signed-off-by: Felipe Balbi --- drivers/usb/gadget/epautoconf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index 596a0b464e61..4dff83d2f265 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -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; } }