Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5643287img; Wed, 27 Mar 2019 12:18:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxzGVeYSBhuOrZXoN5oeI9j0SMHpkzjVznNqaKVIq/yKhqnsQMU4UYYPy4FPuLwernle2p X-Received: by 2002:a17:902:9001:: with SMTP id a1mr8562766plp.96.1553714284273; Wed, 27 Mar 2019 12:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714284; cv=none; d=google.com; s=arc-20160816; b=bi/L9fgkcpbfryt8RvzyJD3sZa1h1qtiHwd7c0fCOlFgMd1WLjVKlDYHKNXAAcIa96 f7BEIiZELf+BUSibEuqI9ib9cTh5MNCitjQcjSQ7nm0FbarrY596NgowJX+qPb8fuvJQ xxdQ8sVZiFhHc55/Wy5pT/aBSdS3kQnUGq40HdLD3sXAY170eGC/dVVI5GnQc/bCntgr ZutkNReNdCPwqC3d/o3jBkZGgExzyRMPv9g8pgKXdI5dtrhhHdcfbT8CxhDk6UUtOgWR YmOdZOq+EzGDaT1QJE0I+0b9lCF20iGDn+ec5eH4darFpj7dO+E72daimr61Ev06SvbO MUEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=En94klnghY8Jg5fZZCK8c2m6Qm3gEJJatyyLoMmdLu8=; b=hS1VD3gI7qJB48lrouzuwTbWQQ+btkXbKbBUrxYOhTvHAalJGw48PN8bpQplkv+1kq 8gjFk64jtr02J+EW2gGRSRGipcfrbyk5wE5p0vF9Tuv7iuwnmbpao0Eu9l9xDJd9aK9R WmuyRsvuhRqlmC2RlfNwx+s46KANAgCzY1uHbWjA9z6bfAnZMLqI9UuwR4c/zYIhJWVX HwcETNekrqGsPpEUW+vCDU9zX/uZD7/Zd+qB62xrXTvKcor7DmEjlLF7UFMPKDAbYz68 Lr829Or+tkY3Lx60HFl8LkVa7p0yTHbZoizRGxqpd3BAojKouuE9JWipKRCySxIUXDZF Cv+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="aKR53w/S"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si18928525pga.584.2019.03.27.12.17.49; Wed, 27 Mar 2019 12:18:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="aKR53w/S"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388526AbfC0TRO (ORCPT + 99 others); Wed, 27 Mar 2019 15:17:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:50652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388429AbfC0SIw (ORCPT ); Wed, 27 Mar 2019 14:08:52 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F5CB2183E; Wed, 27 Mar 2019 18:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710132; bh=aPY0rBGrMUzlRsHQR5wqW6K7ZTdvr/YLHu9e0LxRRck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aKR53w/Sx6v1J6O1DwUPsV+m3O0Gye5V/1XgroKL0tOubCzqFKJn5eLUecyOD5+oz 33bCTPfSipyzVz5QCj2LW2HJ/SEJy2sp/IEo37P+I8lurLmJY16jyX3qApn3GY9amW XAvMHW8YBFFF6R9F2/NsXDhNW/XVpo17Ua3X0PqA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Roger Quadros , Sekhar Nori , Felipe Balbi , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 210/262] usb: dwc3: gadget: Fix OTG events when gadget driver isn't loaded Date: Wed, 27 Mar 2019 14:01:05 -0400 Message-Id: <20190327180158.10245-210-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roger Quadros [ 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