Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp197359imm; Thu, 30 Aug 2018 11:44:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbZeTivDZUpEI3w/ocKzdIJkRAKoCehXIqA2BOxfnNBASosoAqPCboU4RDX4oqvaJVEe9JS X-Received: by 2002:a63:e206:: with SMTP id q6-v6mr10499807pgh.223.1535654651969; Thu, 30 Aug 2018 11:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535654651; cv=none; d=google.com; s=arc-20160816; b=Xr6AK5js9rxolnLsddIQOsDi539rVCOPrdCEKAYr6RzYH3bAflPQDp5cYPqhBKrdFk e3/YKSZHiQpGVF/7kvhkSPOIhpMnqJpqErPFboQTjBCbnaEWrEocJQ65PH4G+V7Iydeg 7qNdjeW62Ndfy1NzPS/aKW61BQJL6Qua3ZCTjNtYQP36V15EVD5IO5r8jjQHzLPTLg4a A3ErtkJJrnQ7NRmOPFiPLDZXl9r05O9MvdTy6aM14oH290SjfyFWRa1IVOcjFCUn2Qa/ shgqpo38iqEUZYc8ORa57ImzuH2qp2NjLFV4xwl7I3puZrfqA10/Xk2JWiWQEniHcslY rXdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JE/W4XMIIuliXbbWxa88UW3vRFU5lzW3geZKbpUNeKE=; b=j67g22UKnO/qkVNTtY3JGrBxTvoWu2k0c27GrJHQGtkT1HwLL+YTeRf6P7qcn84wpX 3LL2s/sEP6ZLkmNzzJwSeR8e2Hew7rvAV0me0OzvABe+4aFAGqahrVMcmSPbI5reAfnK 8Y5RpjhK/XLYH5Kkg6m0m5vOX1lofw3YoY7f2X1bXyZqjZa1G1+XcWegOD9Ot2UnyY0+ V6s57rcrV+AQ+uN9fyTxxLMODgmUY0JUuEGZr4p+wLO/wvh/0TeK/wKNtO6jIRQyckzW zjeLaXzafg6pMgQ85kWRjxOZmEugkCvHlYi44zhxjXrlRwwc6/b+coO6hydc7Thmkr7W rhYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Dev13Dkj; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 188-v6si7619548pfg.154.2018.08.30.11.43.56; Thu, 30 Aug 2018 11:44:11 -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=@gmail.com header.s=20161025 header.b=Dev13Dkj; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbeH3WqY (ORCPT + 99 others); Thu, 30 Aug 2018 18:46:24 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:35397 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726889AbeH3WqX (ORCPT ); Thu, 30 Aug 2018 18:46:23 -0400 Received: by mail-lf1-f67.google.com with SMTP id q13-v6so8021523lfc.2; Thu, 30 Aug 2018 11:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JE/W4XMIIuliXbbWxa88UW3vRFU5lzW3geZKbpUNeKE=; b=Dev13Dkj+3ioU45hrkFEAzm6/maKKqSrpZGcRGBL9H5jePQwZ6hn7Xg/13ClvDfTtW jGKaslSaqtWvBVRXQOSYDSN/ClSlbeOmGHLU5VdAXDEjCeTXymPVTBC6IMJNFxMg4rGv HrMST7diesJFJTuyvqElLk9jsPazqFudlTGNm5C+gyoBN7RCr2785RSNDXsJqaIZOTW3 fXHe2why6S4z2z60yutF0ciqIcbPDVuyS3yGVSJtS8Pp3GU8k4NHjsIJRi9BvWRfjDrT 2gwGaBTmbTZBYA3SIag1G/l4ZVoATO3qPrr0D7h/rawukyQFakREZ8OXLuBT1VdvkPhW UQNQ== 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:in-reply-to :references; bh=JE/W4XMIIuliXbbWxa88UW3vRFU5lzW3geZKbpUNeKE=; b=TMPvKIAGWRi99kd3QfyhVWzslWjWydiGvwn2aCL+qwjnMJWwzS9oZeE+pG8oHeTE/p XlqdO6STwNaLaZwGBxJX5Jy0C5yy5hEDlZWrYvI3cn1gP4E73rs2CblwZ5G13lp/KmhO nl8VJtyiyuLnYfJwqsFpU262ZYcR5wt7/bch/97IceOg2DDvXXJxorxn0Jnwh0LT81OG IN4p8naSEXdUUkyFsJukKOhO+AcWV6egKprKTbkTRYEbAwkrlW3L8uXP9OmxsY6hfXxC hNN8QU1jam+ixm27FyKkFDssy7DuSjdiy+MzrI9eBN/ZTCVDrMq7priSrrmGFiT7IFRL vGZw== X-Gm-Message-State: APzg51A5xnI0gnAWdye03AJgHCN9fFLdv2atJu7oVTaBbI54llllwQZB shR35aGhRnZ/XHqvV2ez4Is= X-Received: by 2002:a19:2c8e:: with SMTP id s136-v6mr2320130lfs.78.1535654569965; Thu, 30 Aug 2018 11:42:49 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id m31-v6sm1446169lfi.17.2018.08.30.11.42.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 11:42:49 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Peter De Schrijver , Prashant Gaikwad , Michael Turquette , Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] clk: tegra20: Enable lock-status polling for PLLs Date: Thu, 30 Aug 2018 21:42:10 +0300 Message-Id: <20180830184210.5369-2-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180830184210.5369-1-digetx@gmail.com> References: <20180830184210.5369-1-digetx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently all PLL's on Tegra20 use a hardcoded delay despite of having a lock-status bit. The lock-status polling was disabled ~7 years ago because PLLE was failing to lock and was a suspicion that other PLLs might be faulty too. Other PLLs are okay, hence enable the lock-status polling for them. This reduces delay of any operation that require PLL to lock. Signed-off-by: Dmitry Osipenko --- Changelog: v2: Don't enable polling for PLLE as it known to not being able to lock. drivers/clk/tegra/clk-tegra20.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c index cc857d4d4a86..cfde3745a0db 100644 --- a/drivers/clk/tegra/clk-tegra20.c +++ b/drivers/clk/tegra/clk-tegra20.c @@ -298,7 +298,8 @@ static struct tegra_clk_pll_params pll_c_params = { .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, .lock_delay = 300, .freq_table = pll_c_freq_table, - .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE, + .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE | + TEGRA_PLL_USE_LOCK, }; static struct tegra_clk_pll_params pll_m_params = { @@ -314,7 +315,8 @@ static struct tegra_clk_pll_params pll_m_params = { .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, .lock_delay = 300, .freq_table = pll_m_freq_table, - .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE, + .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE | + TEGRA_PLL_USE_LOCK, }; static struct tegra_clk_pll_params pll_p_params = { @@ -331,7 +333,7 @@ static struct tegra_clk_pll_params pll_p_params = { .lock_delay = 300, .freq_table = pll_p_freq_table, .flags = TEGRA_PLL_FIXED | TEGRA_PLL_HAS_CPCON | - TEGRA_PLL_HAS_LOCK_ENABLE, + TEGRA_PLL_HAS_LOCK_ENABLE | TEGRA_PLL_USE_LOCK, .fixed_rate = 216000000, }; @@ -348,7 +350,8 @@ static struct tegra_clk_pll_params pll_a_params = { .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, .lock_delay = 300, .freq_table = pll_a_freq_table, - .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE, + .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE | + TEGRA_PLL_USE_LOCK, }; static struct tegra_clk_pll_params pll_d_params = { @@ -364,7 +367,8 @@ static struct tegra_clk_pll_params pll_d_params = { .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, .lock_delay = 1000, .freq_table = pll_d_freq_table, - .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE, + .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE | + TEGRA_PLL_USE_LOCK, }; static const struct pdiv_map pllu_p[] = { @@ -387,7 +391,8 @@ static struct tegra_clk_pll_params pll_u_params = { .lock_delay = 1000, .pdiv_tohw = pllu_p, .freq_table = pll_u_freq_table, - .flags = TEGRA_PLLU | TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE, + .flags = TEGRA_PLLU | TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE | + TEGRA_PLL_USE_LOCK, }; static struct tegra_clk_pll_params pll_x_params = { @@ -403,7 +408,8 @@ static struct tegra_clk_pll_params pll_x_params = { .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, .lock_delay = 300, .freq_table = pll_x_freq_table, - .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE, + .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_HAS_LOCK_ENABLE | + TEGRA_PLL_USE_LOCK, }; static struct tegra_clk_pll_params pll_e_params = { -- 2.18.0