From patchwork Thu Jan 10 15:04:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 155185 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1994689jaa; Thu, 10 Jan 2019 07:04:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN5HOKtsBAZbskc+0r26cSy4qX3vHtnDXSPO6fMdEMaiglruBd+MxJnmQiaNeUDfV0/m9l6G X-Received: by 2002:a17:902:e002:: with SMTP id ca2mr10867357plb.103.1547132681745; Thu, 10 Jan 2019 07:04:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547132681; cv=none; d=google.com; s=arc-20160816; b=m7SysT6TgH+qBnWM+fPWqLpqi1pDdgodsG9GfEkvQ1s2J8pW9SJ7WNtX8fTOGO2SY8 lvV5Xb2MvnW+CB+MF6DByjAG+JXBHOGhg1/oGhlzNNkHTLpsMdQPQ6781jzto0fmoP9S faKrda4c8qC3jkdjxnVcJ+FM6EFsQvGQOBvkdAK/7oznogkDr1kIUU82HhVqsCTehBIB nZ7oQwvw9pyBwnj9PiEnVBMiiIcQhaV/45/iiLrYaYKsgMNgySaL3bOthq8kVtCwNqvI 4/+XK0MEhxG0QQaN8y+lYLQhfU+K6hQ2YcEqsvExGNecdW5wpaKpf3R9F/U56gK5qj7a Or8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=YArC5gKWV2hIL05o4TVGQAvf2LVQ1PnZV+WNmMXBlBU=; b=oU5wenxiU6ex9hrWR2zPUgJAhIYgjJtcj7f7u7dsnIIfDGhUGjHx3SZqbKYtAdp2yP wrC62iIKh5o39Lo3gP5GxuquM/UMB9jkGFV1WkNDN+iy3PkzPn8r4JtepL2YXwfm4kKa LtoLG09Xk7Q6H5zE+Ks+G+DY5yZivGfWRdEksDM+rEtw4p+MoRm9z0n5ICBcBD03Q8E0 VOPc2a89L7ttOXKJg3ICNG+ti4GpFMCKkgEgMoQ+5d8etbXxqO2yisxQVdeCQqzhnQ+X qiHM+oizkrmMN5syO9fK6hEUlTAbk4QSBIqEb4RPTrfui+62NVPKFFO7AZoBSKx55T7x xSOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vZDNXzRe; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i69si34528009pgd.71.2019.01.10.07.04.41; Thu, 10 Jan 2019 07:04:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=@ti.com header.s=ti-com-17Q1 header.b=vZDNXzRe; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729361AbfAJPEk (ORCPT + 7 others); Thu, 10 Jan 2019 10:04:40 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:51832 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbfAJPEj (ORCPT ); Thu, 10 Jan 2019 10:04:39 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0AF4bOm108823; Thu, 10 Jan 2019 09:04:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547132677; bh=YArC5gKWV2hIL05o4TVGQAvf2LVQ1PnZV+WNmMXBlBU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vZDNXzRe9IaEtbl8eRtzWG8gKwnV9X35qDbtbbHd7AcPuDQWauEmcGO02BnZrC+/e QKLJ9KXe/v7qssqnMJXqqyTKxkihcoNCnzcx2bWonRjJ82dFxoEGWirTkTklGEOZY6 AGWznPKKjzlJcpB2jK+RC2US0SkCoVrfl943Oe6g= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0AF4a3C051649 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 10 Jan 2019 09:04:37 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 10 Jan 2019 09:04:36 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 10 Jan 2019 09:04:36 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0AF4VPg006681; Thu, 10 Jan 2019 09:04:34 -0600 From: Roger Quadros To: CC: , , , , , , Roger Quadros Subject: [PATCH v2 1/3] usb: dwc3: gadget: Fix OTG events when gadget driver isn't loaded Date: Thu, 10 Jan 2019 17:04:28 +0200 Message-ID: <1547132670-5908-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547132670-5908-1-git-send-email-rogerq@ti.com> References: <1547132670-5908-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 07bd31b..a9cf4dd4 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -3337,6 +3337,8 @@ int dwc3_gadget_init(struct dwc3 *dwc) goto err4; } + dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed); + return 0; err4: