From patchwork Mon Nov 18 08:04:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13878242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5ACD2D43FEC for ; Mon, 18 Nov 2024 08:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Mb/SukjeBIj4d5e9s9YomHJ1uooI38vWAfwNmdnuOsA=; b=vcrVADFjIngL+6UJ2LESRsRd+m 4VHbinUMIIiORxaBT9oPaVHZjpCOge6MML62OmRH10mv2xGguQfj0dq8k1tjxcM8ZmVj4R2IOdF67 Oqxratnc0ehfPDac4BZd5PD+5IF7tsF78SNxGMRhS0Cmz0AI/jueqLqypGgKs55IKSmiyvYaSxyPI +l67BOH8Wz69sGqfZfck531Ip1So0fTHl8Z82HuMdNtcXBuUxbgZiPOVfGonpchrs9QBwXvxdJIli RITIl9iQuNbp+jPLjOjDnUAoJvqy3YQcYDRJbIumE1fQQdQQOCmh/OXSDKnJ4mFeWZkYCbd6z2zHf z9fkTv0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tCwnx-00000008ibO-3qkv; Mon, 18 Nov 2024 08:08:17 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tCwlC-00000008iAg-1eWQ; Mon, 18 Nov 2024 08:05:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 1A5EBA417BD; Mon, 18 Nov 2024 08:03:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1384EC4CECC; Mon, 18 Nov 2024 08:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731917125; bh=e1YpwgPease7P3QoEBiAarKX0rKC/e+5uSyT0oTexTI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vGoUTvxz9IGKU3BZk5iDZ7t1++zljRrGDajdtKpOzIPi2A/KGJNcGsZpFxB6fT+PS uPdnMRa76Tw8t4FFED9+4qgmOG099avagGVmWWWiww5Lg6tdPw5RqtfNzzUOf3oKlP JaQ8+mnlLYFHHLVrhLbnb27CvM9sUZ8szKBWPtS0okoRFD89DTrYUXwGIb/llH+6P9 xTpUP9fPyp/PXPbz4E1kAFbrSShbbklq2TxViiN8F8v9AA7tTaCcqh0EWKVZb1exnF mTL6kTqFcQC7Svl6PZWiKlIoXvEVQMh2A7gDhygvsfEIi0vez/Bv4aE455JoJi7V9A fpwV5LljfNUpg== From: Lorenzo Bianconi Date: Mon, 18 Nov 2024 09:04:54 +0100 Subject: [PATCH v4 2/6] PCI: mediatek-gen3: rely on clk_bulk_prepare_enable() in mtk_pcie_en7581_power_up() MIME-Version: 1.0 Message-Id: <20241118-pcie-en7581-fixes-v4-2-24bb61703ad7@kernel.org> References: <20241118-pcie-en7581-fixes-v4-0-24bb61703ad7@kernel.org> In-Reply-To: <20241118-pcie-en7581-fixes-v4-0-24bb61703ad7@kernel.org> To: Ryder Lee , Jianjun Wang , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Michael Turquette , Stephen Boyd Cc: linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Lorenzo Bianconi X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241118_000526_497762_C48FF769 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace clk_bulk_prepare() and clk_bulk_enable() with clk_bulk_prepare_enable() in mtk_pcie_en7581_power_up() routine. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Lorenzo Bianconi --- drivers/pci/controller/pcie-mediatek-gen3.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c index 4d1c797a32c236faf79428eb8a83708e9c4f21d8..3cfcb45d31508142d28d338ff213f70de9b4e608 100644 --- a/drivers/pci/controller/pcie-mediatek-gen3.c +++ b/drivers/pci/controller/pcie-mediatek-gen3.c @@ -948,12 +948,6 @@ static int mtk_pcie_en7581_power_up(struct mtk_gen3_pcie *pcie) pm_runtime_enable(dev); pm_runtime_get_sync(dev); - err = clk_bulk_prepare(pcie->num_clks, pcie->clks); - if (err) { - dev_err(dev, "failed to prepare clock\n"); - goto err_clk_prepare; - } - val = FIELD_PREP(PCIE_VAL_LN0_DOWNSTREAM, 0x47) | FIELD_PREP(PCIE_VAL_LN1_DOWNSTREAM, 0x47) | FIELD_PREP(PCIE_VAL_LN0_UPSTREAM, 0x41) | @@ -966,17 +960,15 @@ static int mtk_pcie_en7581_power_up(struct mtk_gen3_pcie *pcie) FIELD_PREP(PCIE_K_FINETUNE_MAX, 0xf); writel_relaxed(val, pcie->base + PCIE_PIPE4_PIE8_REG); - err = clk_bulk_enable(pcie->num_clks, pcie->clks); + err = clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); if (err) { dev_err(dev, "failed to prepare clock\n"); - goto err_clk_enable; + goto err_clk_prepare_enable; } return 0; -err_clk_enable: - clk_bulk_unprepare(pcie->num_clks, pcie->clks); -err_clk_prepare: +err_clk_prepare_enable: pm_runtime_put_sync(dev); pm_runtime_disable(dev); reset_control_assert(pcie->mac_reset);