Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp840261ybi; Fri, 12 Jul 2019 05:31:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/WUkKX04FRCY6RuViizXARYHcPy8cMu/ut/VTgVWvvg/4O9DnJ2Ud+KqJc/crJMnAoIkM X-Received: by 2002:a17:902:324:: with SMTP id 33mr10970578pld.340.1562934700764; Fri, 12 Jul 2019 05:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934700; cv=none; d=google.com; s=arc-20160816; b=qrZmXe1smkI7qyuW1ACMR2qpcskx4HASiuikayp/qqq6FAVInN+ETDsySFKXqQOBX8 dsDOI3AeSuc3umjEAT7/uy3JjqkXY8PCVjahJSpAdMufe1d1PGbNa2Iy44mqrr9VQoRJ 3Mt6xoARESo2utOpkqMw2w8DbNJ24LFbbIorLr6tJTzm3X6jjtjE8sE8ZGr9mqcxtGy0 J8l6mswKEHyPUCbTEQ3Nn0kEK+d9CJ0lOHI2kZju1jHUrjEorV8Wyf4ycgzeuq6ImlmH 27j5qf+R+8AWoVlxaAryf1UpZWK0M3n0Dh3ltYDjPJLeuYVIEsgDcruhK8iR64v6ollV Syqw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5VpA1fZCdSk2haX4Ug2xNuX65n+N5+UgTjAdr1MO0tQ=; b=Zb41ggLWS4ozuzcsUruvBVJwqBAgY5DqZAhrakwaDshyf4T5djmbjHSVu+25JRm+TQ F2OWyR/arpRWajhLcpLVoRPSgulaxJe7lPFJb17ARRWZzqw+PE0Rq2OU6qj7dkmnR34f wEUJkMJodr8fLpQ+rtlJRvjkfoUmUqkcC4quleR9Vgo99+bI9+AKsb2pB0OMYX81BUIC bjJF7IX6kaTvF616s5c2LIdQH+/yjrIZfs7Mf4GxR+rC6yeVaOaoRSDgPa43t36PwCwT n1v/fJtDl2RG5hNQJv7kTaeUOVVhk6Q4xTWTtjgn3XLqAej0ypNQmAu6RLWSEX0ws5al Nv3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DFkh71nv; 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 6si8197525pgb.201.2019.07.12.05.31.25; Fri, 12 Jul 2019 05:31:40 -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=DFkh71nv; 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 S1729112AbfGLMaa (ORCPT + 99 others); Fri, 12 Jul 2019 08:30:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728686AbfGLMaY (ORCPT ); Fri, 12 Jul 2019 08:30:24 -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 A3BEC216C4; Fri, 12 Jul 2019 12:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934624; bh=mOI4f+8M6MD8y67Qh6fR5ZdRMmZi5fzudA5PS0kp1Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DFkh71nvoc+f4yJs0TDfUxIz01mgSDSoDYQMjgY4WVrKVPaS/qaukYCtkFkF8tEfS 2RgDum19A+eAzlCUcL6ETGBBc9u0b3tpopLbnNvPUqbHI8R03jrp6s/r3YWNYj0EdU FAb+KqQQh+J49SoNFgPYuVFbMfb4ISgCRswx7/tY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Minas Harutyunyan , Martin Blumenstingl , Felipe Balbi Subject: [PATCH 5.1 114/138] usb: dwc2: use a longer AHB idle timeout in dwc2_core_reset() Date: Fri, 12 Jul 2019 14:19:38 +0200 Message-Id: <20190712121633.125684870@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Martin Blumenstingl commit dfc4fdebc5d62ac4e2fe5428e59b273675515fb2 upstream. Use a 10000us AHB idle timeout in dwc2_core_reset() and make it consistent with the other "wait for AHB master IDLE state" ocurrences. This fixes a problem for me where dwc2 would not want to initialize when updating to 4.19 on a MIPS Lantiq VRX200 SoC. dwc2 worked fine with 4.14. Testing on my board shows that it takes 180us until AHB master IDLE state is signalled. The very old vendor driver for this SoC (ifxhcd) used a 1 second timeout. Use the same timeout that is used everywhere when polling for GRSTCTL_AHBIDLE instead of using a timeout that "works for one board" (180us in my case) to have consistent behavior across the dwc2 driver. Cc: linux-stable # 4.19+ Acked-by: Minas Harutyunyan Signed-off-by: Martin Blumenstingl Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc2/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -531,7 +531,7 @@ int dwc2_core_reset(struct dwc2_hsotg *h } /* Wait for AHB master IDLE state */ - if (dwc2_hsotg_wait_bit_set(hsotg, GRSTCTL, GRSTCTL_AHBIDLE, 50)) { + if (dwc2_hsotg_wait_bit_set(hsotg, GRSTCTL, GRSTCTL_AHBIDLE, 10000)) { dev_warn(hsotg->dev, "%s: HANG! AHB Idle timeout GRSTCTL GRSTCTL_AHBIDLE\n", __func__); return -EBUSY;