Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2027289ybd; Sun, 23 Jun 2019 22:46:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqydF1oherqMKPjkHbzp0ylaww8z6BX/NlacKNx+7ewfn0rkLRdodue0Jo596OUwH7kUEQzt X-Received: by 2002:a17:902:b94a:: with SMTP id h10mr34946379pls.125.1561355188833; Sun, 23 Jun 2019 22:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561355188; cv=none; d=google.com; s=arc-20160816; b=LI/doFzPDhrJd/zE17t6d/AQBUuJN7NCN55KfDUtzy4XqFFKOLFZu/SYyHEqGtb2xe WicIBLulcheGV1L2gWMzdUd8UymxWFI9OII1setFT+n8jbDaiLBLg0CTm8KtFoAw9IKQ EGVIDfk+e+kxNJ141EdQpSe8/0xwZsG0jbVMLGpoy8YwmIeAGI2go2+Q0GB/0n4wfnZ3 K7ERUmLU1nhd2dbHqlF6iQ6JDG8nCTFp44W+1/TBCJfDfg81ZPIR9PSOlJtNN7HoaH9Z Rw2dlbHYlCzigptsf5+ObZNV6QFd/r/iPtmkHwF6iORUbO32aXBcsAYNi+G75irxvZnv YXCg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0FhIk15uGNj0ORdR3opswTIMsZqm9E3pnivPAXapQOU=; b=azrgpGkPKUI7urTCmuCDbefWZIVAtnNo1PW+MJZ6z+HWxjL41uh1WZ7BXLmUZHAHBG WRT0hGWAS+iiDfhjTw3FbA/1whywuJtvkBb9/9P86+uS0DmEG4BkmQdQgD4e5l4K7v+2 k7xVP6AeSnbwluCUEw1tACrWQCdaA2Uiq31/6mO9CvUTOM+lbL9lYMtdam/fBPpxvFEn oBfIve8ANLLlAD7cWSi7Rn+j8nKVcJX1UAjZwVxSBkcOZT2NFh2J/HPdVLjB87b0aep1 /ShytI1Ox9ywLDtxVGFJK0PW6SZ5TMc+QMmeflweTIk0zEL3ZbKRMT9Unky3zIbF0ITt YAsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=AJakDklB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si9506426ple.161.2019.06.23.22.46.13; Sun, 23 Jun 2019 22:46:28 -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=@synopsys.com header.s=mail header.b=AJakDklB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726992AbfFXFlw (ORCPT + 99 others); Mon, 24 Jun 2019 01:41:52 -0400 Received: from dc8-smtprelay2.synopsys.com ([198.182.47.102]:41698 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726223AbfFXFlw (ORCPT ); Mon, 24 Jun 2019 01:41:52 -0400 Received: from mailhost.synopsys.com (unknown [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id D9084C01C4; Mon, 24 Jun 2019 05:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1561354911; bh=E1ERrISIW+x8N6/XjWkPCVdmvp0aiB6uJtVc4k+4tXo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AJakDklB8qWucLSsOgZ7kcmOZ6Sd0wVHNpfzhJg27zkf+9MeY50eFDFnlhPkeRUCM NsAHHH62qGvuMQA3TCQHdQ6F2WNUdq6O7en9wPPCFVRbuMp2Bv7lKP4VoddNKynS9o qDS05iIumGYXIsOvKTqq4kZK+pZcqyNkYoF1x2hxyILh9iNAfEvXRcL6javwhFxR3K LirNPYlsPwJc9TeWw/NgXFb7ZiEIZniIZftaqb97JQZ59uvXfi7/Wpqgz2igr3MNrx 6nAL523LjnSJrMhc4jCg1Tqb1B9GbbkURgkDznKe0UNnz+ciIXjYGp3seVWsGzHye1 4X8dgja8PUrxw== Received: from [10.116.70.206] (unknown [10.116.70.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPSA id EB20DA0231; Mon, 24 Jun 2019 05:41:47 +0000 (UTC) Subject: Re: [PATCH] usb: dwc2: use a longer AHB idle timeout in dwc2_core_reset() To: Martin Blumenstingl , "linux-usb@vger.kernel.org" , "felipe.balbi@linux.intel.com" Cc: "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , linux-stable References: <20190620175022.29348-1-martin.blumenstingl@googlemail.com> From: Minas Harutyunyan Message-ID: Date: Mon, 24 Jun 2019 09:41:46 +0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190620175022.29348-1-martin.blumenstingl@googlemail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/20/2019 9:51 PM, Martin Blumenstingl wrote: > 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+ > Signed-off-by: Martin Blumenstingl > --- Acked-by: Minas Harutyunyan > drivers/usb/dwc2/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c > index 8b499d643461..8e41d70fd298 100644 > --- a/drivers/usb/dwc2/core.c > +++ b/drivers/usb/dwc2/core.c > @@ -531,7 +531,7 @@ int dwc2_core_reset(struct dwc2_hsotg *hsotg, bool skip_wait) > } > > /* 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; >