Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3044279pxb; Tue, 24 Aug 2021 13:47:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydRfOA7mImytzI+jSi4HlrEHfpn8iKqKbiLSKOY82fOja08PSsF/d5K5LwAx7lX0IBJ/wm X-Received: by 2002:a5d:9592:: with SMTP id a18mr31837194ioo.168.1629838033884; Tue, 24 Aug 2021 13:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629838033; cv=none; d=google.com; s=arc-20160816; b=tSKBimGHcCkYFcgkYbCqHp8T5f8oXPkQlr1ZT8aOXMUcRiJS+GSdpaSvsPER64kr0g uJhemvIvGonvExYcCoIQgBbMidUXSP9RKJVn242U2iKap7JmugrjOSoAmVoSYP358uR/ M5YxYNZgorQOmfIx3IoEGWpm7QIGc6fSnwGDhfwhhheuUmAuqFe/fU7zyD6rj6bNtAFd Pee56HT6QnrjHmCoUB8BvLFlti5U6mK+xZOC9sEWmkVSxn94XJ61f2awROlZuuWxK+QV XOoO/MMPsEG+6FsHzAPONFTOy+a02bEuMugFFAF+RftRjI+TMdOgr1898qiEQxCmPtRB l5/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=56d8UvtBVD7H4F7tzGAznZ/F8/SkJrioV0rsrcn830Q=; b=f6FZ/eFGKMYa9SLH9wr/IC34R3D27cM2dqhpKKJVw3woSbqibRLSrdAh7iMR6y8/OP Js9oFPZ+qUxLOugUR7Of5mcg6LPbKgzW1Ybl5VSGDfeXbh29VxSa2rEVpNSc+D9+z/zt J5hlbf70Qr1xuy1YDZU0FzNXE7iknXfT4qik1xGHw2KFOu6ZBkgpUxkGddVQs1hZ+l2O QaUhBV/II4XOmJkSU6Dm9V/4nbc/97PGSaBq69TMsJW7P4JjfGfX+2gln338LAeL+SV1 dWQpn1y4oPXXjnmu+L0i2oL4BiSaongINB0B0Ry5rwwx4J45E1t2js3w6IlHN8Y6NARK SN9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si18189937jal.12.2021.08.24.13.47.01; Tue, 24 Aug 2021 13:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235384AbhHXUrH (ORCPT + 99 others); Tue, 24 Aug 2021 16:47:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233289AbhHXUrG (ORCPT ); Tue, 24 Aug 2021 16:47:06 -0400 Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it [IPv6:2001:4b7a:2000:18::170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E101C061757 for ; Tue, 24 Aug 2021 13:46:21 -0700 (PDT) Received: from [10.0.20.3] (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 9010A1F4F5; Tue, 24 Aug 2021 22:46:17 +0200 (CEST) Subject: Re: [PATCH] clk: qcom: gcc-sdm660: Replace usage of parent_names To: Bjorn Andersson , Michael Turquette , Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , angelogioacchino.delregno@somainline.org References: <20210824150606.678666-1-bjorn.andersson@linaro.org> From: Marijn Suijten Message-ID: <386db1a6-a1cd-3c7d-a88e-dc83f8a1be96@somainline.org> Date: Tue, 24 Aug 2021 22:46:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210824150606.678666-1-bjorn.andersson@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, Thanks for this cleanup, that's needed and much appreciated! On 8/24/21 5:06 PM, Bjorn Andersson wrote: > Using parent_data and parent_hws, instead of parent_names, does protect > against some cases of incompletely defined clock trees. While it turns > out that the bug being chased this time was totally unrelated, this > patch converts the SDM660 GCC driver to avoid such issues. > > Signed-off-by: Bjorn Andersson Tested-by: Marijn Suijten On the Sony Xperia XA2 Ultra, bar the necessary change in the 14NM DSI PHY driver commented below. > [..] > - > -static struct clk_fixed_factor xo = { > - .mult = 1, > - .div = 1, > - .hw.init = &(struct clk_init_data){ > - .name = "xo", > - .parent_names = (const char *[]){ "xo_board" }, > - .num_parents = 1, > - .ops = &clk_fixed_factor_ops, > - }, > -}; Removing the global "xo" clock makes it so that our 14nm DSI PHY does not have a parent clock anymore, as the clock is called "xo_board" nowadays ("xo" in the position of fw_name is, as you know, only local to this driver because it is named that way in the clock-names property). We (SoMainline) suffer the same DSI PHY hardcoding issue on many other boards and are at this point investigating whether to provide &xo_board in DT like any other sane driver. Do you happen to know if work is already underway to tackle this? > static struct clk_alpha_pll gpll0_early = { > .offset = 0x0, > .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], > @@ -158,7 +35,9 @@ static struct clk_alpha_pll gpll0_early = { > .enable_mask = BIT(0), > .hw.init = &(struct clk_init_data){ > .name = "gpll0_early", > - .parent_names = (const char *[]){ "xo" }, > + .parent_data = &(const struct clk_parent_data){ > + .fw_name = "xo", > + }, I wish we could use .parent_names for a list of .fw_name's too > [..] > @@ -265,7 +270,7 @@ static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = { > .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, > .clkr.hw.init = &(struct clk_init_data){ > .name = "blsp1_qup1_i2c_apps_clk_src", > - .parent_names = gcc_parent_names_xo_gpll0_gpll0_early_div, > + .parent_data = gcc_parent_data_xo_gpll0_gpll0_early_div, > .num_parents = 3, How about using ARRAY_SIZE(gcc_parent_data_xo_gpll0_gpll0_early_div) now? Same for every other occurrence of this pattern. - Marijn