From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90538C4360F for ; Thu, 4 Apr 2019 09:16:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DB062054F for ; Thu, 4 Apr 2019 09:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369377; bh=hJ0SDZ/zHaHg7aB+g8TtLcNvxoAehqDbukiquxV+h24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=REIV5ScXEvjeAPc/ZRLYjXxa2Hua1xaGsreQJHRjcwydt/OrXWadFA/jBySITG567 Q2h0Bd4qXPQCWjlGAX3C6Z9Yzu0SN/Zf7/tP7ot/wQBuLWD0Kw6tqdImMOOHvfY34q 7QJatYRnN72ba70R2ORVkc+vvwvT+vj4mIy+NGL4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388024AbfDDJQP (ORCPT ); Thu, 4 Apr 2019 05:16:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:57404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388010AbfDDJQM (ORCPT ); Thu, 4 Apr 2019 05:16:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98CA520693; Thu, 4 Apr 2019 09:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369371; bh=hJ0SDZ/zHaHg7aB+g8TtLcNvxoAehqDbukiquxV+h24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mL1d6FeOnopQIoTgdDNhNv+3iu072zGthQD5lxz6DfRHV0UJ3sLgKtzH3NmQI+h9R ilNlTaNiMuRmDbXroeQDpglEPehVMbKdsFFj1Eucbs6Dc2zCfTKND6uSJOn5L5Mn2v t4tvO3AOzjvPfPl8rU3TEr4vOTWtVTf7NYpIx1QI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roger Quadros , Sekhar Nori , Felipe Balbi , Sasha Levin Subject: [PATCH 5.0 198/246] usb: dwc3: gadget: Fix OTG events when gadget driver isnt loaded Date: Thu, 4 Apr 2019 10:48:18 +0200 Message-Id: <20190404084626.120136698@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 169e3b68cadb5775daca009ced4faf01ffd97dcf ] On v3.10a in dual-role mode, if port is in device mode and gadget driver isn't loaded, the OTG event interrupts don't come through. It seems that if the core is configured to be OTG2.0 only, then we can't leave the DCFG.DEVSPD at Super-speed (default) if we expect OTG to work properly. It must be set to High-speed. Fix this issue by configuring DCFG.DEVSPD to the supported maximum speed at gadget init. Device tree still needs to provide correct supported maximum speed for this to work. This issue wasn't present on v2.40a but is seen on v3.10a. It doesn't cause any side effects on v2.40a. Signed-off-by: Roger Quadros Signed-off-by: Sekhar Nori Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 6c9b76bcc2e1..8d1dbe36db92 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -3339,6 +3339,8 @@ int dwc3_gadget_init(struct dwc3 *dwc) goto err4; } + dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed); + return 0; err4: -- 2.19.1