Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1992380imm; Thu, 24 May 2018 04:10:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp6IWt8KIMRww/Pz+GhIYOaaM1gkt9cGzRxxlkDgRVxLGxtFCD3RPSXkeAeZj+DbFyuZf/C X-Received: by 2002:a17:902:a512:: with SMTP id s18-v6mr6845247plq.223.1527160202820; Thu, 24 May 2018 04:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160202; cv=none; d=google.com; s=arc-20160816; b=VFBBAAENBgsACU75pkVy4d1M0XxiPteLwxSgnmjukPXYKlHfcbbksa0S40MVssUdUk BChXtUMHYcK+ahRZMDlfXHGhhxDAb/CDC7bRA+R/gB7+0SmdLZEDH4YRB3jY2trp6m5L C1KYt+Ej1kV7sUZYNEFnQoCaMPjOC49Enh1rpcVhcu6yZF/UkXr/mDGxuiMfH+33DdF4 yAShYXH24xx8bXTzXSqTX16co2t2Wm7A5jZwxjrOnVhgYzu83SsHbSYwQ7C2755f3nOs HG1kT2mdwZ2vKVJ6RTiMnsnt/4KFGF19OJ9OMpPVNUxN3alGq58/cliBd5a0w28CXHQk BNAg== 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=AfiO4GzDqXJHXQS9sB5pv5H2IHOlCG52FAA5lTpBj0E=; b=xkddbr7x2j3KRkZZuXkaILOPiYYtzff3GxXioeD/ru/FPSN/MB3CTisw15lMLcWYt1 o7FRe7J/Sp5U54TNJPKYc3U+IWWQfjV5rZcKruQV2xC1JMz485uj1ijSPe+B3Qgu68PT JVTJ6OaiH+Kxr6CFaSSCSsQAkUU86Son5lwfDKm27uZQU3CCzQXLOv/Pu2jN9t7v7BtY rfRsAZ+khCQY6zb3NHPqiaKEXjylBkuHmDJ9y3cQj/ze/eJw11fUgjnBzMxU3nUSOhV8 +UGQUXacjWn1lOlccS+LKlVkiB0sMARpH5stAxhVa5NfUiDmS+BlYmdo52SuGQAWDJw8 rtOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tvRfD40U; 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 r59-v6si20790073plb.187.2018.05.24.04.09.25; Thu, 24 May 2018 04:10:02 -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=tvRfD40U; 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 S1032970AbeEXLIk (ORCPT + 99 others); Thu, 24 May 2018 07:08:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:34746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967312AbeEXJyi (ORCPT ); Thu, 24 May 2018 05:54:38 -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 CB8B12089F; Thu, 24 May 2018 09:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155677; bh=dxNr8jehXeLQwop3XAQmUbUpGMFJB3DkFMbD3TpLOH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tvRfD40UQCoCRNcLEUn/AKnSGMe+nQKfgJtG6j30mKyxzc/2KHEgwKh/mHjQBuNJq 1pe4HmdRBG5HbYawStDqdwnSR3G5fIma9Eaq1yENIB206QHpma+OXM/kLOMDgVtvLc /Uu/GwgbCuBEjC7D1Phwug30ETC8enGDBUuaxV/0= 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.14 075/165] usb: dwc2: host: Fix transaction errors in host mode Date: Thu, 24 May 2018 11:38:01 +0200 Message-Id: <20180524093625.057778686@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-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 @@ -2329,10 +2329,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);