Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2026133imm; Thu, 24 May 2018 04:44:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpksNXrcs3skqVVyrkEUh/s3aI1dGNGTpMpg1Iq8703u1ju1n6DSWleoT5+B3QW0p+ZPqW6 X-Received: by 2002:a62:4589:: with SMTP id n9-v6mr6929062pfi.158.1527162271655; Thu, 24 May 2018 04:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527162271; cv=none; d=google.com; s=arc-20160816; b=zTsCvHDRhgBzaxveiwQtt0qbA5hG5+kBgf+ZoJAIXJ3kYMYI/urD+G3gCVloaaHW/J fnQvKyV68UTdpffv93dp3lVz3IfwKNZsuFE6iSaMZ+H26CwQbiibEia3x9yWbGAMDXlx e9CaihG6L/PiA2Crisowl+Glcmk/vH4OJOo/+mPKv3VSp5Sd/P2twgsVNErXiJoIPRDT xnxvrTyk5gibFeKffQlkmaIspwkwQLKBdTuu+Wkn4NUcnqGbXlY2pGMzr0zuwK8zZb0d +AQdihdY+17TKsmN3u9gifZ1ovXgB7VnZXnfFGkZwVTlfgWnx+5/llE9fg69dV2JBE3m ak/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=LysW+YbhwH/06qfDeCtRLOyKTOQERcjCUn2SvRyfPuY=; b=PkgE9yWLaGsxKO6ByO0+KrWF9TvM5kjrUsexcH6UtDaHB+RKU86/eNRGOzX9HaTvZx mIhn/yHBY8QvSCxkgNmbvUIS2y6H0vQ7ayL+XpCVg64QCqI9FXC8mLeFO1bNSzymB2Hg uiHx8omCYpUNSbf2/ONXWzIE2anoH5dYlMQoEX8aJFIOuDdXUPV8MsmZQrClomNuW/i4 BJmMz8XSGOnJJRwjwljaI0FtOvXBKay3saKsa+YII0O0Ni2mhqxCkpZajwvj/JA/W+Vv 3r/YnO8Y8dx7HlRw7IO62tbTmOo1XvaAV5hE0388DVEHIJLrgJul6nSFWNjNJbjYon3g 82Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jj3tlE5o; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7-v6si21552299pfa.170.2018.05.24.04.44.16; Thu, 24 May 2018 04:44:31 -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=Jj3tlE5o; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969204AbeEXLmV (ORCPT + 99 others); Thu, 24 May 2018 07:42:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:33746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967227AbeEXJs3 (ORCPT ); Thu, 24 May 2018 05:48:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 C4CA220894; Thu, 24 May 2018 09:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155309; bh=thuD7udWpaqv+OC9TwOWcCNOAEoNaWjKbVIAnj21asU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jj3tlE5o6WuEXeS0lGvsSRf8+8A4EiG/tgULyxMjb2OOam3o3UWVwoWGfAZZfJIWU FdOpY9SHhUmdD56MgTLw2QR1td75BsMg7b+V/l6RQw5dZ8E0XiGMEt9nh7fgwnC4J5 xBEJnKhOQPfD/5FBoyBHHEJARrqpi7mge9hDgKEw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Youn , Minas Harutyunyan , Grigor Tovmasyan , Felipe Balbi , Sasha Levin Subject: [PATCH 4.9 40/96] usb: dwc2: host: Fix transaction errors in host mode Date: Thu, 24 May 2018 11:38:23 +0200 Message-Id: <20180524093607.844790745@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Minas Harutyunyan [ Upstream commit 92a8dd26464e1f21f1d869ec53717bd2c1200d63 ] Added missing GUSBCFG programming in host mode, which fixes transaction errors issue on HiKey and Altera Cyclone V boards. These field even if was programmed in device mode (in function dwc2_hsotg_core_init_disconnected()) will be resetting to POR values after core soft reset applied. So, each time when switching to host mode required to set this field to correct value. Acked-by: John Youn Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc2/hcd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -2268,10 +2268,22 @@ static int dwc2_core_init(struct dwc2_hs */ static void dwc2_core_host_init(struct dwc2_hsotg *hsotg) { - u32 hcfg, hfir, otgctl; + u32 hcfg, hfir, otgctl, usbcfg; dev_dbg(hsotg->dev, "%s(%p)\n", __func__, hsotg); + /* Set HS/FS Timeout Calibration to 7 (max available value). + * The number of PHY clocks that the application programs in + * this field is added to the high/full speed interpacket timeout + * duration in the core to account for any additional delays + * introduced by the PHY. This can be required, because the delay + * introduced by the PHY in generating the linestate condition + * can vary from one PHY to another. + */ + usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); + usbcfg |= GUSBCFG_TOUTCAL(7); + dwc2_writel(usbcfg, hsotg->regs + GUSBCFG); + /* Restart the Phy Clock */ dwc2_writel(0, hsotg->regs + PCGCTL);