lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 Dec 2019 22:23:39 -0800
From:   Stephen Boyd <sboyd@...nel.org>
To:     Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Niklas Cassel <niklas.cassel@...aro.org>
Cc:     linux-arm-msm@...r.kernel.org, amit.kucheria@...aro.org,
        Niklas Cassel <niklas.cassel@...aro.org>,
        Michael Turquette <mturquette@...libre.com>,
        linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 7/7] clk: qcom: apcs-msm8916: use clk_parent_data to specify the parent

Quoting Niklas Cassel (2019-11-25 05:59:09)
> diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c
> index 46061b3d230e..bb91644edc00 100644
> --- a/drivers/clk/qcom/apcs-msm8916.c
> +++ b/drivers/clk/qcom/apcs-msm8916.c
> @@ -51,6 +51,19 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev)
>         struct clk_init_data init = { };
>         int ret = -ENODEV;
>  
> +       /*
> +        * This driver is defined by the devicetree binding
> +        * Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt,
> +        * however, this driver is registered as a platform device by
> +        * qcom-apcs-ipc-mailbox.c. Because of this, when this driver
> +        * uses dev_get_regmap() and devm_clk_get(), it has to send the parent
> +        * device as argument.
> +        * When registering with the clock framework, we cannot use this trick,
> +        * since the clock framework always looks at dev->of_node when it tries
> +        * to find parent clock names using clk_parent_data.
> +        */
> +       dev->of_node = parent->of_node;

This is odd. The clks could be registered with of_clk_hw_register() but
then we lose the device provider information. Maybe we should search up
one level to the parent node and if that has a DT node but the
clk controller device doesn't we should use that instead?

----8<-----
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index b68e200829f2..c8745c415c04 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3669,7 +3669,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
 	if (dev && pm_runtime_enabled(dev))
 		core->rpm_enabled = true;
 	core->dev = dev;
-	core->of_node = np;
+	core->of_node = np ? : dev_of_node(dev->parent);
 	if (dev && dev->driver)
 		core->owner = dev->driver->owner;
 	core->hw = hw;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ