Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2213632iof; Tue, 7 Jun 2022 23:24:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAwTItjyXV0L2Z3uaN51d5oc/I+t48VOGA6s7UC2ghq8sR67PdrAfsEZOb3SggJ65z3kPf X-Received: by 2002:a17:902:d88a:b0:156:1609:1e62 with SMTP id b10-20020a170902d88a00b0015616091e62mr32016377plz.143.1654669489335; Tue, 07 Jun 2022 23:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654669489; cv=none; d=google.com; s=arc-20160816; b=bEQ3iDXAoR7g/8AQdwqfWWMUBFuzBBSZ1G/wlNtFa3wv47ZqeYIwqYKsF+5ZNbMczP c9ccabzUxmkEwRR1cRScOcHM5sguwQwhKvEnnzmflX07iViAmBuQKD9HerTDI7F3MLnZ 3JnaTCwZ5hCnO6mskfpkdJY72WyPlyS2SSO3FaiR8NSmbf2xXZbMu8tuQ+VmF3iMkT88 QbTx15v3/nT9CQuoqB8YvJ4M+vqKGbtKhB4QRtad+riRqwBdVMPBrcT/zXgRf/l8bNa6 vnAsqBcZwzfuP23WluCu3MBF5pJ5wyB64mktZdc0jrDBDS0RcP+/CxDsttYFUNBViO6C 68DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S0q219vkHaP6TrWxCbdxDmaD/GCkEn+weulG/0OK+/8=; b=TB2eTU12AmS6LfSmPClZPqScNvDnzIzNaMxJ8fFkolLFPqLy9CX0V+4xBCeB/cdqBo jwbtTSPQjOXfZwVnLLf5YQ7pLS8j9fBsuChvxZrThikhGMWEJyxluw1sp4SkN5jVNwJf N21FeNW8zCTzGWOP4Oq9JLjMRRnpU8bSSNZWll5t6hpQcgF80zXfP55XC6QpmW8iSKBK Yru+p/yuNbOM7dRP4ooBnpcL1Ncd57DmpQ/RQ1Gn+oRx+tMUqV3sYyvzSThRhE7j1aDc D04xmp40r5NGj8sqNYM2+uo0Lv2DcOhHt72042veHiE+KRnTCF7jry7fMJsU4b2NuZm4 Q3sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K6zbQPew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y19-20020aa79af3000000b00518c3e572e3si24234267pfp.295.2022.06.07.23.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K6zbQPew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BF6C737F058; Tue, 7 Jun 2022 22:47:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446529AbiFHCPN (ORCPT + 99 others); Tue, 7 Jun 2022 22:15:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346973AbiFHBYP (ORCPT ); Tue, 7 Jun 2022 21:24:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A3A19EC11; Tue, 7 Jun 2022 12:26:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 62515B8237B; Tue, 7 Jun 2022 19:26:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9D83C385A2; Tue, 7 Jun 2022 19:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629982; bh=0uxE18e2AfanWQQDQShi5sm63VVmRKaaDhXCasV9Sko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K6zbQPewaYi0+QnD1xnfRzQ3x7ZgjeZooTygp4NrO84mTo93R5jThop7YqhD+EKHn mNPHpMT1DwvGngwQtNF8qGLqCeZqBblTdaG2TTEYHCFzD2quEjLDMxP5VFIjRQ6ez8 L/8FF/CZBmVRpJ95JS0jqyI4LGJF+NbfnC/7LCoA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Diogo Ivo , Thierry Reding Subject: [PATCH 5.18 848/879] clk: tegra: Add missing reset deassertion Date: Tue, 7 Jun 2022 19:06:06 +0200 Message-Id: <20220607165027.465901379@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Diogo Ivo commit 23a43cc437e747473d5f8f98b4fe189fb5c433b7 upstream. Commit 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks") removed deassertion of reset lines when enabling peripheral clocks. This breaks the initialization of the DFLL driver which relied on this behaviour. Fix this problem by adding explicit deassert/assert requests to the driver. Tested on Google Pixel C. Cc: stable@vger.kernel.org Fixes: 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks") Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding Signed-off-by: Greg Kroah-Hartman --- drivers/clk/tegra/clk-dfll.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/drivers/clk/tegra/clk-dfll.c +++ b/drivers/clk/tegra/clk-dfll.c @@ -271,6 +271,7 @@ struct tegra_dfll { struct clk *ref_clk; struct clk *i2c_clk; struct clk *dfll_clk; + struct reset_control *dfll_rst; struct reset_control *dvco_rst; unsigned long ref_rate; unsigned long i2c_clk_rate; @@ -1464,6 +1465,7 @@ static int dfll_init(struct tegra_dfll * return -EINVAL; } + reset_control_deassert(td->dfll_rst); reset_control_deassert(td->dvco_rst); ret = clk_prepare(td->ref_clk); @@ -1509,6 +1511,7 @@ di_err1: clk_unprepare(td->ref_clk); reset_control_assert(td->dvco_rst); + reset_control_assert(td->dfll_rst); return ret; } @@ -1530,6 +1533,7 @@ int tegra_dfll_suspend(struct device *de } reset_control_assert(td->dvco_rst); + reset_control_assert(td->dfll_rst); return 0; } @@ -1548,6 +1552,7 @@ int tegra_dfll_resume(struct device *dev { struct tegra_dfll *td = dev_get_drvdata(dev); + reset_control_deassert(td->dfll_rst); reset_control_deassert(td->dvco_rst); pm_runtime_get_sync(td->dev); @@ -1951,6 +1956,12 @@ int tegra_dfll_register(struct platform_ td->soc = soc; + td->dfll_rst = devm_reset_control_get_optional(td->dev, "dfll"); + if (IS_ERR(td->dfll_rst)) { + dev_err(td->dev, "couldn't get dfll reset\n"); + return PTR_ERR(td->dfll_rst); + } + td->dvco_rst = devm_reset_control_get(td->dev, "dvco"); if (IS_ERR(td->dvco_rst)) { dev_err(td->dev, "couldn't get dvco reset\n"); @@ -2087,6 +2098,7 @@ struct tegra_dfll_soc_data *tegra_dfll_u clk_unprepare(td->i2c_clk); reset_control_assert(td->dvco_rst); + reset_control_assert(td->dfll_rst); return td->soc; }