All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>,
	Taniya Das <quic_tdas@quicinc.com>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 7/7] clk: qcom: add the driver for the MSM8996 APCS clocks
Date: Wed, 25 Jan 2023 13:38:14 -0800	[thread overview]
Message-ID: <7055af43f4a8894ac34e53c5847fb3de.sboyd@kernel.org> (raw)
In-Reply-To: <20230118132254.2356209-8-dmitry.baryshkov@linaro.org>

Quoting Dmitry Baryshkov (2023-01-18 05:22:54)
> diff --git a/drivers/clk/qcom/apcs-msm8996.c b/drivers/clk/qcom/apcs-msm8996.c
> new file mode 100644
> index 000000000000..7e46ea8ed444
> --- /dev/null
> +++ b/drivers/clk/qcom/apcs-msm8996.c
> @@ -0,0 +1,76 @@
[...]
> +
> +static int qcom_apcs_msm8996_clk_probe(struct platform_device *pdev)
> +{
> +       struct device *dev = &pdev->dev;
> +       struct device *parent = dev->parent;
> +       struct regmap *regmap;
> +       struct clk_hw *hw;
> +       unsigned int val;
> +       int ret = -ENODEV;
> +
> +       regmap = dev_get_regmap(parent, NULL);
> +       if (!regmap) {
> +               dev_err(dev, "failed to get regmap: %d\n", ret);
> +               return ret;
> +       }
> +
> +       regmap_read(regmap, APCS_AUX_OFFSET, &val);
> +       regmap_update_bits(regmap, APCS_AUX_OFFSET, APCS_AUX_DIV_MASK,
> +                          FIELD_PREP(APCS_AUX_DIV_MASK, APCS_AUX_DIV_2));
> +
> +       /* Hardware mandated delay */

Delay for what? Setting the divider? What if the register value didn't
change at all? Can you skip the delay in that case?

> +       udelay(5);
> +
> +       /*
> +        * Register the clock as fixed rate instead of being a child of gpll0
> +        * to let the driver register probe as early as possible.

The function doesn't block or return EPROBE_DEFER if the clk is orphaned
when registered. Why is this necessary? Are you getting defered by the
fw_devlink logic thinking it needs to defer probe of this driver until
gpll0 provider probes? We should fix fw_devlink to not do that. Maybe if
the node is a clk provider (#clock-cells exists) then we don't wait for
clocks property to be provided, because the clk core already handles
that itself.

> +        */
> +       hw = devm_clk_hw_register_fixed_rate(dev, "sys_apcs_aux", NULL, 0, 300000000);

  reply	other threads:[~2023-01-25 21:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 13:22 [PATCH v4 0/7] clk: qcom: msm8996: add APCS clock driver Dmitry Baryshkov
2023-01-18 13:22 ` [PATCH v4 1/7] dt-bindings: mailbox: qcom: add SDX55 compatible Dmitry Baryshkov
2023-01-18 13:22 ` [PATCH v4 2/7] dt-bindings: mailbox: qcom: enable syscon compatible for msm8976 Dmitry Baryshkov
2023-01-18 13:22 ` [PATCH v4 3/7] dt-bindings: mailbox: qcom: correct the list of platforms using clocks Dmitry Baryshkov
2023-01-19 11:41   ` Krzysztof Kozlowski
2023-01-18 13:22 ` [PATCH v4 4/7] dt-bindings: mailbox: qcom: add missing platforms to conditional clauses Dmitry Baryshkov
2023-01-19 11:41   ` Krzysztof Kozlowski
2023-01-18 13:22 ` [PATCH v4 5/7] dt-bindings: mailbox: qcom: add #clock-cells to msm8996 example Dmitry Baryshkov
2023-01-18 13:22 ` [PATCH v4 6/7] mailbox: qcom-apcs-ipc: enable APCS clock device for MSM8996 Dmitry Baryshkov
2023-01-18 13:22 ` [PATCH v4 7/7] clk: qcom: add the driver for the MSM8996 APCS clocks Dmitry Baryshkov
2023-01-25 21:38   ` Stephen Boyd [this message]
2023-01-25 21:48     ` Konrad Dybcio
2023-01-25 21:56       ` Stephen Boyd
2023-01-25 22:05         ` Konrad Dybcio
2023-01-25 23:15           ` Stephen Boyd
2023-01-26 22:51     ` Dmitry Baryshkov
2023-01-27 21:24       ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7055af43f4a8894ac34e53c5847fb3de.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=quic_tdas@quicinc.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.