From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH v2 05/14] clk: qcom: apcs-msm8916: get parent clock names from DT Date: Thu, 25 Apr 2019 14:29:05 -0700 Message-ID: <155622774551.15276.4140891469702307355@swboyd.mtv.corp.google.com> References: <1548700381-22376-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <1548700381-22376-6-git-send-email-jorge.ramirez-ortiz@linaro.org> <155085910216.77512.12604271825136479370@swboyd.mtv.corp.google.com> <31e17283-c374-f16e-df95-09aaf1854435@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <31e17283-c374-f16e-df95-09aaf1854435@linaro.org> Sender: linux-kernel-owner@vger.kernel.org To: Jorge Ramirez , andy.gross@linaro.org, arnd@arndb.de, bjorn.andersson@linaro.org, david.brown@linaro.org, enric.balletbo@collabora.com, heiko@sntech.de, horms+renesas@verge.net.au, jagan@amarulasolutions.com, jassisinghbrar@gmail.com, mark.rutland@arm.com, mturquette@baylibre.com, olof@lixom.net, robh+dt@kernel.org, sibis@codeaurora.org, will.deacon@arm.com Cc: vkoul@kernel.org, niklas.cassel@linaro.org, georgi.djakov@linaro.org, amit.kucheria@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org, khasim.mohammed@linaro.org List-Id: linux-arm-msm@vger.kernel.org Quoting Jorge Ramirez (2019-04-22 04:44:50) > On 2/22/19 19:11, Stephen Boyd wrote: > > Quoting Jorge Ramirez-Ortiz (2019-01-28 10:32:52) > >> @@ -61,6 +65,25 @@ static int qcom_apcs_msm8916_clk_probe(struct platf= orm_device *pdev) > >> if (!a53cc) > >> return -ENOMEM; > >> =20 > >> + /* check if the parent names are present in the device tree */ > >=20 > > This looks odd. > >=20 > >> + ret =3D devm_clk_bulk_get(parent, ARRAY_SIZE(pclks), pclks); > >> + if (ret =3D=3D -EPROBE_DEFER) > >> + return ret; > >=20 > > Why can't we use of_clk_parent_fill() if we know this is always a DT > > platform? The parent clks may not be registered at the time of probe? >=20 > yes, and AFAICS the important thing at this point is that the clock is > registered hence the handling of defer. >=20 > I could use of_clk_parent_fill and then - if needed - call > devm_clk_bulk_get but I am not sure of the gains of doing it (wouldnt > this just make the code more confusing?) Yeah of_clk_parent_fill() isn't the best approach. But it at least keeps this driver from using clk consumer APIs? >=20 >=20 > > Maybe this series should wait for the parent registration stuff I'm > > working on so that this can be made simpler. >=20 > the need for the clock name is not intrinsic to this driver (the driver > itself doesnt use these names) but it just feeds these to the framework. >=20 > I was looking into your parent registration code and I am not sure how > can I use it in this particular driver other than simply removing the > names and hoping that things are handled properly at the lower > levels.... could you clarify please? >=20 I think so. I've forgotten the context of this patch, but the general idea would be to specify the parents with clock-names or DT index in the DT node for the clks registered here and not use of_clk_parent_fill() or do any sort of devm_clk_bulk_get() calls. Then the framework will take care of finding the parents for the clks and hooking things up properly for the parent-child relationship. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AE33C43218 for ; Thu, 25 Apr 2019 21:29:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 77B7720675 for ; Thu, 25 Apr 2019 21:29:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fy8XJgPp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="d7U0G8hs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77B7720675 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-ID:To:Subject:From: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mdgOPzet6e9CEVNbJfd2NcAlgxn7NDmoA2OMvUpf1LE=; b=fy8XJgPp44manr P6yAyn3zhrlTVx8DnBDq+vbidfn6Fonw8ncbVmYuNIvjodXNXHE5GgVI+PY2EfY68xcivYf+dJ7oM 5MYh47VcWOp+EvP4wA8L8m3+p13VV0QBD6K9XTqDMR9M8PRY9uTwWqCglGPCHEQmpTa9kYbFZHaQI E24fKuLeBLlppeQvrh/kFzD1VJpsqRNXbGPvAtgbzovjDrx16AttHi99PM53Hp6MLPAGxJPI6+XQl +/fKji3S7+VWv1bLdHlQx1YD0wfTmy+FtddLBg2VMqj6KoNGSRS3iGLc29posQKH0DyhcFThQZdBp GoMSw1ioqKw36h0tgBwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJlvZ-0006JK-Sy; Thu, 25 Apr 2019 21:29:09 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJlvW-0006It-Q9 for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2019 21:29:08 +0000 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97B6D20675; Thu, 25 Apr 2019 21:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556227746; bh=fXKxNIi5a/B3PpIuMmHIVsGGXiZch2q1OaB5IXDPSNk=; h=In-Reply-To:References:Cc:From:Subject:To:Date:From; b=d7U0G8hsoBgurdZXSYEozG88nOcjAM6GmHc6kdo0draNUpwZ3Sh1kyhKw3Ok9k3th CugbSicsafaalHPHFjkbB1iU+u22qXon6IreJaxb6OSms4P/WPolzUnPeVmjSHUZ88 y9qNxLQjqSSaYBBpRvcuFUfdIWCS9blUklzpC+Do= MIME-Version: 1.0 In-Reply-To: <31e17283-c374-f16e-df95-09aaf1854435@linaro.org> References: <1548700381-22376-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <1548700381-22376-6-git-send-email-jorge.ramirez-ortiz@linaro.org> <155085910216.77512.12604271825136479370@swboyd.mtv.corp.google.com> <31e17283-c374-f16e-df95-09aaf1854435@linaro.org> From: Stephen Boyd Subject: Re: [PATCH v2 05/14] clk: qcom: apcs-msm8916: get parent clock names from DT To: Jorge Ramirez , andy.gross@linaro.org, arnd@arndb.de, bjorn.andersson@linaro.org, david.brown@linaro.org, enric.balletbo@collabora.com, heiko@sntech.de, horms+renesas@verge.net.au, jagan@amarulasolutions.com, jassisinghbrar@gmail.com, mark.rutland@arm.com, mturquette@baylibre.com, olof@lixom.net, robh+dt@kernel.org, sibis@codeaurora.org, will.deacon@arm.com Message-ID: <155622774551.15276.4140891469702307355@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 Date: Thu, 25 Apr 2019 14:29:05 -0700 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190425_142906_884026_B2504E1A X-CRM114-Status: GOOD ( 18.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, khasim.mohammed@linaro.org, linux-kernel@vger.kernel.org, amit.kucheria@linaro.org, linux-clk@vger.kernel.org, vkoul@kernel.org, niklas.cassel@linaro.org, georgi.djakov@linaro.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Jorge Ramirez (2019-04-22 04:44:50) > On 2/22/19 19:11, Stephen Boyd wrote: > > Quoting Jorge Ramirez-Ortiz (2019-01-28 10:32:52) > >> @@ -61,6 +65,25 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) > >> if (!a53cc) > >> return -ENOMEM; > >> > >> + /* check if the parent names are present in the device tree */ > > > > This looks odd. > > > >> + ret = devm_clk_bulk_get(parent, ARRAY_SIZE(pclks), pclks); > >> + if (ret == -EPROBE_DEFER) > >> + return ret; > > > > Why can't we use of_clk_parent_fill() if we know this is always a DT > > platform? The parent clks may not be registered at the time of probe? > > yes, and AFAICS the important thing at this point is that the clock is > registered hence the handling of defer. > > I could use of_clk_parent_fill and then - if needed - call > devm_clk_bulk_get but I am not sure of the gains of doing it (wouldnt > this just make the code more confusing?) Yeah of_clk_parent_fill() isn't the best approach. But it at least keeps this driver from using clk consumer APIs? > > > > Maybe this series should wait for the parent registration stuff I'm > > working on so that this can be made simpler. > > the need for the clock name is not intrinsic to this driver (the driver > itself doesnt use these names) but it just feeds these to the framework. > > I was looking into your parent registration code and I am not sure how > can I use it in this particular driver other than simply removing the > names and hoping that things are handled properly at the lower > levels.... could you clarify please? > I think so. I've forgotten the context of this patch, but the general idea would be to specify the parents with clock-names or DT index in the DT node for the clks registered here and not use of_clk_parent_fill() or do any sort of devm_clk_bulk_get() calls. Then the framework will take care of finding the parents for the clks and hooking things up properly for the parent-child relationship. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel