From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966931AbbLQBH5 (ORCPT ); Wed, 16 Dec 2015 20:07:57 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:53359 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934372AbbLQAkm (ORCPT ); Wed, 16 Dec 2015 19:40:42 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Ben McCauley , Felipe Balbi , Luis Henriques , Kamal Mostafa Subject: [PATCH 3.13.y-ckt 16/78] usb: dwc3: gadget: let us set lower max_speed Date: Wed, 16 Dec 2015 16:39:00 -0800 Message-Id: <1450312802-4938-17-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450312802-4938-1-git-send-email-kamal@canonical.com> References: <1450312802-4938-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.13 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.13.11-ckt32 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Ben McCauley commit b9e51b2b1fda19143f48d182ed7a2943f21e1ae4 upstream. In some SoCs, dwc3 is implemented as a USB2.0 only core, meaning that it can't ever achieve SuperSpeed. Currect driver always sets gadget.max_speed to USB_SPEED_SUPER unconditionally. This can causes issues to some Host stacks where the host will issue a GetBOS() request and we will reply with a BOS containing Superspeed Capability Descriptor. At least Windows seems to be upset by this fact and prints a warning that we should connect $this device to another port. [ balbi@ti.com : rewrote entire commit, including source code comment to make a lot clearer what the problem is ] Signed-off-by: Ben McCauley Signed-off-by: Felipe Balbi [ luis: backported to 3.16: - used dev_vdbg() instead of dwc3_trace() ] Signed-off-by: Luis Henriques Signed-off-by: Kamal Mostafa --- drivers/usb/dwc3/gadget.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 217cc175..a38ad1b 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2604,12 +2604,33 @@ int dwc3_gadget_init(struct dwc3 *dwc) } dwc->gadget.ops = &dwc3_gadget_ops; - dwc->gadget.max_speed = USB_SPEED_SUPER; dwc->gadget.speed = USB_SPEED_UNKNOWN; dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; /* + * FIXME We might be setting max_speed to revision < DWC3_REVISION_220A) + dev_vdbg(dwc->dev, "Changing max_speed on rev %08x\n", + dwc->revision); + + dwc->gadget.max_speed = dwc->maximum_speed; + + /* * REVISIT: Here we should clear all pending IRQs to be * sure we're starting from a well known location. */ -- 1.9.1