Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp844821ybi; Fri, 12 Jul 2019 05:35:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKvNp80cTAXICxY4Cu5m4d4w/0Ik1EEridVk2c4ynS6LWXbUc6t+wLRv0r2UeugzlMPR2J X-Received: by 2002:a17:902:42d:: with SMTP id 42mr10767445ple.228.1562934950814; Fri, 12 Jul 2019 05:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934950; cv=none; d=google.com; s=arc-20160816; b=0PxUHqBirBjoDDEJS0dRaTA+rAyCBcjtxgLghSj5LQTZ5PVOe4wgmCn3ETtAPu/9vm 5LNAk+HUPRwNEiNqu9tGCye70sGeJzC6W8MV5ktLwZzgTaNq6kKk2oi0SvGS7RtLPwDb +DWSfHzPBy/7FHlGKPUqV2ur56/NrLOHnM+Dpvsw4bHSG78pNQAWoH2gN6nbx1Z2kjtf djnSE8vFu43Hg3G67PFiE0vMOHjM305OX0kacvWxm56phbLNakZPPEkaIQIcm4eAkJTg iFzh5PZf0+6lKXHZy+xf9cHVPbgSLtK4jJqZ2FdpswPk/cfR7M5VoxtHmaQockO5x2R0 /CKw== 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=TEUoPJawq2l7XDS6Wf2oZfzqhWibZhBaDo3PbQMc1AQOh0kWgzvsK49IZdt/ThA3GL O4GwcXML5bM4JH9tDjGGm6lQxK3HcnJjbNxy8Ejlow1EH4r5n9eoDece29VpI+DaL+aE 1vC+2QFe2uLGhKiZCVtQs7BnZpUcWHhTlfARr4hzZ90Wn/DEv7LP/+jgDP92+0WNCp/l iZmGVxsqQ//WTsj6V99JKB2DAkAGs7Cbfq/fgeh3CZqBNe6N21I1BCiX8aMnEwIYP5L5 gaaSKDgRx7YHz/n+Ylu5g9vf7/qy6sd8ZJJX70j3RTZ/afU4G00u6AF6H8H+YWXcycUX QQRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="wzo4FOA/"; 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 x189si3693247pgd.533.2019.07.12.05.35.35; Fri, 12 Jul 2019 05:35:50 -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="wzo4FOA/"; 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 S1729100AbfGLMdP (ORCPT + 99 others); Fri, 12 Jul 2019 08:33:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:52078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729204AbfGLMdJ (ORCPT ); Fri, 12 Jul 2019 08:33:09 -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 64E3A2084B; Fri, 12 Jul 2019 12:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934788; bh=mOI4f+8M6MD8y67Qh6fR5ZdRMmZi5fzudA5PS0kp1Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wzo4FOA/tTvcZkNNoZOj9rKIFd090nFrfKkJEXTlBAn0DqMfav0w9vEhqzb7hwNDC o4RCPST4bgjMAdpQBtUXf94IrgI0x6+BLN/EVy9yqy2BoUlZS2Sf8SDBayX8KIUIUp fId2tRwfZlzlIDuh4E7NKTsOuG0+QSa9PmXcVCoI= 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.2 30/61] usb: dwc2: use a longer AHB idle timeout in dwc2_core_reset() Date: Fri, 12 Jul 2019 14:19:43 +0200 Message-Id: <20190712121622.233001704@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121620.632595223@linuxfoundation.org> References: <20190712121620.632595223@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;