Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1190427pxm; Wed, 23 Feb 2022 20:45:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGODEuaTG5kubnGHuczgr4En9d83epbyrV4+Kc8tC2jO6bVCRgZGrQpyfBZ5RfAutQpJXz X-Received: by 2002:a17:906:358e:b0:6cf:61dd:5a1f with SMTP id o14-20020a170906358e00b006cf61dd5a1fmr809046ejb.416.1645677931651; Wed, 23 Feb 2022 20:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645677931; cv=none; d=google.com; s=arc-20160816; b=QC/PlggX6QkkIPWXIsRSuEJiiW4sxsbDaqougRkfBmZ5vw3AInm3aTUcoUWWf7giGR B6Ig0USF8Wwx3Pa2DkuKkWWYuShtChasdxlFSlXXK69SY/GfMnqUAVnXebadeBS51Otg oGss4BljllO3pjzs3sM9P4ybb/tcByjpy0iPzoNDbuBPpA5eStw2+xccbxbEeduaNC+d d3ykpTlXAVlQTDo82Zdd1rN3Ma+xlruDhLISBzqFLcshgFBgbVgvNw0X6DeX/osroRbe ymGqsCsEAPv2PbPZ/e8TVoouONyjcHsdpi+P0SHpoNdIX2cpxtccToj/doCnSKhkinyM JG1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PiZRCkT93sFuayBwB1xNP2rtK4QBBQDElK070sJbl20=; b=z7JCokZpgeSGBo3b48PonEa1TUpzPbzMIzpRz8zJHK4eHTL2gSPX+ytCmkRMhIduzA T7UI7uceLv+UTFWron/CHIcpW/lgEF+k2gzUWXRUKpamSX77N2mpnukl1WGJ4IkrZ7ET hBa8DnjILfeKcGclwZSjMNUV64VRHA5yX7/O/Oe46RvNVGxZsnYl5qS91/ije0qINFXI gorWQ0oPel00zYpGBwaTCS99N/nG+cqtTQbywsyCRN4oyLz6Nqr7XF62bl820AaqeEt6 wNBMnq2iq4Y4FK8UmZfqgIWdH4x6DSWCA5kkPjQoU6fQLjikfUXpnME8/j4ZdRBv/D28 rQ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kWLCOEII; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 2si898526ejl.123.2022.02.23.20.45.08; Wed, 23 Feb 2022 20:45:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kWLCOEII; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229755AbiBXDtV (ORCPT + 99 others); Wed, 23 Feb 2022 22:49:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbiBXDtT (ORCPT ); Wed, 23 Feb 2022 22:49:19 -0500 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F8A19E003 for ; Wed, 23 Feb 2022 19:48:48 -0800 (PST) Received: by mail-oo1-xc32.google.com with SMTP id 189-20020a4a03c6000000b003179d7b30d8so1712595ooi.2 for ; Wed, 23 Feb 2022 19:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PiZRCkT93sFuayBwB1xNP2rtK4QBBQDElK070sJbl20=; b=kWLCOEIIoARj8rSjwrhQdP1BxIimAbTDawAsKCgZVaS/Psc+uZ1JyikdmjP6ymoEV4 1VPNmeAn5EcxSHRuwb5VspBLmXjCjdULzq9moCqW58e041uA1FiwBkUlk59NYVUUuFDP /b1+ITJj0wb9UD8MMq8DWkbl8YyqKbxMcpLFy8DQB60wztZEvRE+K0RgBMfR5bVAhADH f29fbfQL55ro9aoh05VZ/rs55XvfPBYcr+2VwTKYSup38YDXebAd4dvCrEhvbI9+tWeZ JIl+kbYVahux6z9LBYafKUdecvM09H1ylJRMtZ5S/SYjyvvjOGSE+E5nfsvbWW8CxJaF eGwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PiZRCkT93sFuayBwB1xNP2rtK4QBBQDElK070sJbl20=; b=TADaZZlqhVeP8ads2uxYAdyB0bIfc9UioTDMT2ip9m3Db2lWU7mPlYSsxEn7V79cEQ 9hTygY63oxNnTxPy+c6Zt9VOHx5IZBdRGZIXRrvEOpb8loRHlje6Sk9JoPoxJyJD8s4G xVs0R9zt6BcnmRV6UNU5dRL8ZpqPSmxyD80D05iGstjnGK8HdhkRuL6CqOsKU82NdcNY VOXsfdUvLLkr5JhsBCdEkkz8Qs9bQQhS2Bt9dB7VI6K/B4wicPqhdREy5bIciHwVJ37T GvAurNO+izH//7aDVYqBPJzelt9MJJol21gbf/0Y+NhMo+hVrzwI3s/KrFigko2YbuHk rvuA== X-Gm-Message-State: AOAM533isene+OmrptZs+2DwDddqUJjsq2p5Ok62u7q3RZWn3/8BamCk ZtMGcpBkpDRCcrV9GKaLutxqEA== X-Received: by 2002:a05:6870:3652:b0:d3:4ada:37cb with SMTP id v18-20020a056870365200b000d34ada37cbmr5516789oak.328.1645674527359; Wed, 23 Feb 2022 19:48:47 -0800 (PST) Received: from builder.lan ([2600:1700:a0:3dc8:3697:f6ff:fe85:aac9]) by smtp.gmail.com with ESMTPSA id gn26sm853445oab.24.2022.02.23.19.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 19:48:46 -0800 (PST) Date: Wed, 23 Feb 2022 21:48:45 -0600 From: Bjorn Andersson To: Ansuel Smith Cc: Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Philipp Zabel , Taniya Das , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 05/16] clk: qcom: gcc-ipq806x: convert parent_names to parent_data Message-ID: References: <20220217235703.26641-1-ansuelsmth@gmail.com> <20220217235703.26641-6-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220217235703.26641-6-ansuelsmth@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 On Thu 17 Feb 17:56 CST 2022, Ansuel Smith wrote: > Convert parent_names to parent_data to modernize the driver. > Where possible use parent_hws directly. > Really nice to see this kind of cleanup. Unfortunately I have two comments below. > Signed-off-by: Ansuel Smith > --- > drivers/clk/qcom/gcc-ipq806x.c | 286 ++++++++++++++++++++------------- > 1 file changed, 173 insertions(+), 113 deletions(-) > > diff --git a/drivers/clk/qcom/gcc-ipq806x.c b/drivers/clk/qcom/gcc-ipq806x.c > index 34cddf461dba..828383c30322 100644 > --- a/drivers/clk/qcom/gcc-ipq806x.c > +++ b/drivers/clk/qcom/gcc-ipq806x.c > @@ -25,6 +25,10 @@ > #include "clk-hfpll.h" > #include "reset.h" > > +static const struct clk_parent_data gcc_pxo[] = { > + { .fw_name = "pxo" }, I expect that this will break booting these boards with existing dtb, because there's not yet a clocks <&pxo_board> in the gcc node. If you also add .name = "pxo" here that it should still fall back to map to the board clock registered in gcc_ipq806x_probe() and once we have passed 1-2 kernel releases we can clean out the old mapping. > +}; > + > static struct clk_pll pll0 = { > .l_reg = 0x30c4, > .m_reg = 0x30c8, > @@ -35,7 +39,7 @@ static struct clk_pll pll0 = { > .status_bit = 16, > .clkr.hw.init = &(struct clk_init_data){ > .name = "pll0", > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .ops = &clk_pll_ops, > }, > @@ -46,7 +50,9 @@ static struct clk_regmap pll0_vote = { > .enable_mask = BIT(0), > .hw.init = &(struct clk_init_data){ > .name = "pll0_vote", > - .parent_names = (const char *[]){ "pll0" }, > + .parent_hws = (const struct clk_hw*[]){ > + &pll0.clkr.hw, > + }, > .num_parents = 1, > .ops = &clk_pll_vote_ops, > }, > @@ -62,7 +68,7 @@ static struct clk_pll pll3 = { > .status_bit = 16, > .clkr.hw.init = &(struct clk_init_data){ > .name = "pll3", > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .ops = &clk_pll_ops, > }, > @@ -89,7 +95,7 @@ static struct clk_pll pll8 = { > .status_bit = 16, > .clkr.hw.init = &(struct clk_init_data){ > .name = "pll8", > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .ops = &clk_pll_ops, > }, > @@ -100,7 +106,9 @@ static struct clk_regmap pll8_vote = { > .enable_mask = BIT(8), > .hw.init = &(struct clk_init_data){ > .name = "pll8_vote", > - .parent_names = (const char *[]){ "pll8" }, > + .parent_hws = (const struct clk_hw*[]){ > + &pll8.clkr.hw, > + }, > .num_parents = 1, > .ops = &clk_pll_vote_ops, > }, > @@ -123,7 +131,7 @@ static struct hfpll_data hfpll0_data = { > static struct clk_hfpll hfpll0 = { > .d = &hfpll0_data, > .clkr.hw.init = &(struct clk_init_data){ > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .name = "hfpll0", > .ops = &clk_ops_hfpll, > @@ -149,7 +157,7 @@ static struct hfpll_data hfpll1_data = { > static struct clk_hfpll hfpll1 = { > .d = &hfpll1_data, > .clkr.hw.init = &(struct clk_init_data){ > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .name = "hfpll1", > .ops = &clk_ops_hfpll, > @@ -175,7 +183,7 @@ static struct hfpll_data hfpll_l2_data = { > static struct clk_hfpll hfpll_l2 = { > .d = &hfpll_l2_data, > .clkr.hw.init = &(struct clk_init_data){ > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .name = "hfpll_l2", > .ops = &clk_ops_hfpll, > @@ -194,7 +202,7 @@ static struct clk_pll pll14 = { > .status_bit = 16, > .clkr.hw.init = &(struct clk_init_data){ > .name = "pll14", > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .ops = &clk_pll_ops, > }, > @@ -205,7 +213,9 @@ static struct clk_regmap pll14_vote = { > .enable_mask = BIT(14), > .hw.init = &(struct clk_init_data){ > .name = "pll14_vote", > - .parent_names = (const char *[]){ "pll14" }, > + .parent_hws = (const struct clk_hw*[]){ > + &pll14.clkr.hw, > + }, > .num_parents = 1, > .ops = &clk_pll_vote_ops, > }, > @@ -238,7 +248,7 @@ static struct clk_pll pll18 = { > .freq_tbl = pll18_freq_tbl, > .clkr.hw.init = &(struct clk_init_data){ > .name = "pll18", > - .parent_names = (const char *[]){ "pxo" }, > + .parent_data = gcc_pxo, > .num_parents = 1, > .ops = &clk_pll_ops, > }, > @@ -259,9 +269,9 @@ static const struct parent_map gcc_pxo_pll8_map[] = { > { P_PLL8, 3 } > }; > > -static const char * const gcc_pxo_pll8[] = { > - "pxo", > - "pll8_vote", > +static const struct clk_parent_data gcc_pxo_pll8[] = { > + { .fw_name = "pxo" }, > + { .hw = &pll8_vote.hw }, > }; > > static const struct parent_map gcc_pxo_pll8_cxo_map[] = { > @@ -270,10 +280,10 @@ static const struct parent_map gcc_pxo_pll8_cxo_map[] = { > { P_CXO, 5 } > }; > > -static const char * const gcc_pxo_pll8_cxo[] = { > - "pxo", > - "pll8_vote", > - "cxo", > +static const struct clk_parent_data gcc_pxo_pll8_cxo[] = { > + { .fw_name = "pxo" }, > + { .hw = &pll8_vote.hw }, > + { .fw_name = "cxo" }, As with "pxo", I think you need a .name = "cxo" here as well. Regards, Bjorn