From patchwork Sun Dec 10 22:55:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 846748 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="r7DohGsQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yw1j048gvz9sDB for ; Mon, 11 Dec 2017 09:58:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751637AbdLJW6N (ORCPT ); Sun, 10 Dec 2017 17:58:13 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:37201 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbdLJW6M (ORCPT ); Sun, 10 Dec 2017 17:58:12 -0500 Received: by mail-lf0-f65.google.com with SMTP id a12so17176465lfe.4; Sun, 10 Dec 2017 14:58:11 -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=gbG12/FOy4HarlO07goXTpAh/Xfe9g0pHnUQtvsukGg=; b=r7DohGsQaHJIKyCfEC58pkc5t9pbESfd8jotWKnrXbYxk02jqpwb87jcih1COBF1Au +Hj3GjVeWBrXKV2vT6XK181LRu+2VH4OZhL/xTrqhpxYcEPZo6BG8z3kBFGCvMMnG664 te1ifeFcBamZ2LFaBpBJ+Gg1UIJAlaA+Yja07xKKxBgrG0o4accN5E11Gu8Pj78Gp368 e5jgvVYibgit7QXPGzMrka22GoUzAdXhdpb+8w1YC/wa6WQrMV4KGQGIXiCv6lfjYBFv Nq07fwsIwj6d/2OD/dg1e25RUDJ5Hpz5u+BOnOw97yfnqgzaeFLqKkDNz9VDuCbV/WAv j8ig== 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=gbG12/FOy4HarlO07goXTpAh/Xfe9g0pHnUQtvsukGg=; b=j/QYm4i3oEZot7I60vrB1S1jtkUJnvMBcEfZTVDPRnC+3im2+AV/XhmohiTdVzBuPh xvNwCSkiuU3on71or3btreVnIM6ETlnrDorey5MVsJHOd0xsNsKgM4FQKsbeu6tu4/KY /jIsh//m5VF8jDkJFYzj1w4SafgYEZzfjBfDIxm0mCllLcWV5EEpvSfIgCeN7+eptwsm bCGBo/wzhqPg0ILvmFtgyZTDcK+KbsolbfNgDm83kDRQ1T6nOWyqrbW2GhbhYm8AZZzJ p8JUG/idy/2hGB1/vIcNXKU7z/c3Pz7HcMwy49xtR5kZmsCm4xu26yDmj6pgPHY4bO67 kI1w== X-Gm-Message-State: AJaThX7T3gCxnILjbJqJGdQ4Wy6p1PrMvoJLHufYXWDJK0fXhQ3Kzfpx MDRylz2SXweMkYFgnSDbSRE= X-Google-Smtp-Source: AGs4zMaHluaGw65ux1hz9KzfC4j91xj4QSve4YzEsST0oD+rx/FEnG63vIXpm4YmlULqaCUWBECuAA== X-Received: by 10.25.44.136 with SMTP id s130mr15814687lfs.147.1512946690623; Sun, 10 Dec 2017 14:58:10 -0800 (PST) Received: from localhost.localdomain (ppp109-252-55-194.pppoe.spdop.ru. [109.252.55.194]) by smtp.gmail.com with ESMTPSA id d27sm2439034lfb.93.2017.12.10.14.58.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Dec 2017 14:58:09 -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 v1] usb: phy: tegra: Increase PHY clock stabilization timeout Date: Mon, 11 Dec 2017 01:55:35 +0300 Message-Id: <20171210225535.8532-1-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 --- drivers/usb/phy/phy-tegra-usb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index f668bfb708d3..7d5db625f800 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,9 @@ 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, 1, 5000); } static void utmi_phy_clk_disable(struct tegra_usb_phy *phy)