From patchwork Sun Dec 17 17:02:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 849660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="It9ZLVz6"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z09YL0Scvz9t2Z for ; Mon, 18 Dec 2017 04:06:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752663AbdLQRF7 (ORCPT ); Sun, 17 Dec 2017 12:05:59 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:37947 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbdLQRF6 (ORCPT ); Sun, 17 Dec 2017 12:05:58 -0500 Received: by mail-lf0-f66.google.com with SMTP id u127so11234845lff.5; Sun, 17 Dec 2017 09:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6UPSMWUHXGg95q9fbYbznpBAPYTxQNtT6lRSaPyBMcE=; b=It9ZLVz6jNvZZ8UPa3XVlz+QA8hhcJWKvb7iCX7+ZfJW6LPgG1qZyRY5ba356OHnVA /C7cE74bcKjGaB9Yz9/lHEmZdOgVT5trqdgG86AuZ2yowiiN81kmDSyyJxZjwwIYiy3s /aJw0CGsl3q6opjRk4urdydswHzO6eJQ7Zy9rQv8b2Rai3CaemEuLNVM3Snjg06kHftk LwXy7qc7E6Fb7BlUulImcCL9XcvAuVVhN2imJ4YZGWHCxyo3klr2c5ZScuE73FCH0DAq Za5Tovc6koQPV+JvUZhkry4jHOPsEsEZ2mHKcfjcAzSXWFdAIFgNIPl4mlGdLS6crKWA EERw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6UPSMWUHXGg95q9fbYbznpBAPYTxQNtT6lRSaPyBMcE=; b=j+RTjQYO5VI3iabSgDXC1w+s5UKZcw0Yx2b7BNKGpsZqCxSFUJ/JEZYnVZmxY+s1aG Kq/jGy+ISokNwkdmT4pr9WWJ61SVxTRXmfe+j0hD8PyjHiUphsfZJ2QTCI2X/wYZJZ/u 8M6jdmxYLDrt/MRKsBFGgV/62dPDsbRSfptQw88Fhz3sIKSwCR87Nu/Q2EC6xgGYGEdq MaN8mw5alEe0kjHFFU+o8e1X1IbnFUWSr9i1uoHLPV1Fxz3udMbFP94Rd+Xx600h0xA2 f6Pqov8EA8wO3aRB+HXthnmsbgr9NalcP3fgwo5gMVDGF2iQWPDEL1fECsJEcXZyo47P NksA== X-Gm-Message-State: AKGB3mJduDGk8/D8Y+5mv5k1SCPaZHXwpPVYfLZ3t5yUcAc5VQlV12qD KZwfoBybQyKWw5nzBvcQCic= X-Google-Smtp-Source: ACJfBovJbFAOR15+iDqT2CiWc0IdTffZyiYsow7t+V4n+rWn8Fb7rZXO1Uq08WoHbtYc8zhx+9UnYw== X-Received: by 10.46.64.76 with SMTP id n73mr9685236lja.33.1513530356324; Sun, 17 Dec 2017 09:05:56 -0800 (PST) Received: from localhost.localdomain (ppp109-252-55-194.pppoe.spdop.ru. [109.252.55.194]) by smtp.gmail.com with ESMTPSA id h26sm2352525lfb.27.2017.12.17.09.05.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Dec 2017 09:05:55 -0800 (PST) From: Dmitry Osipenko To: Felipe Balbi , Jonathan Hunter , Thierry Reding Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] usb: phy: tegra: Increase PHY clock stabilization timeout Date: Sun, 17 Dec 2017 20:02:39 +0300 Message-Id: <11fbb780b9478b3b379b6e01c7eb5462cfbedf64.1513530136.git.digetx@gmail.com> X-Mailer: git-send-email 2.15.1 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org This fixes "utmi_phy_clk_enable: timeout waiting for phy to stabilize" error message. Signed-off-by: Dmitry Osipenko --- Change log: v2: Increased delay for the poll retry from 1us to 2000ms, thanks to Thierry Reding for the suggestion. drivers/usb/phy/phy-tegra-usb.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index f668bfb708d3..0e8d23e51732 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -305,14 +305,10 @@ static int utmip_pad_power_off(struct tegra_usb_phy *phy) static int utmi_wait_register(void __iomem *reg, u32 mask, u32 result) { - unsigned long timeout = 2000; - do { - if ((readl(reg) & mask) == result) - return 0; - udelay(1); - timeout--; - } while (timeout); - return -1; + u32 tmp; + + return readl_poll_timeout(reg, tmp, (tmp & mask) == result, + 2000, 6000); } static void utmi_phy_clk_disable(struct tegra_usb_phy *phy)