public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Gross <andy.gross@linaro.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	jilai wang <jilaiw@codeaurora.org>
Subject: Re: [Patch v2 2/8] firmware: qcom: scm: Convert SCM to platform driver
Date: Fri, 29 Apr 2016 14:25:54 -0500	[thread overview]
Message-ID: <20160429192554.GA6666@hector.attlocal.net> (raw)
In-Reply-To: <20160426012935.GE29990@codeaurora.org>

On Mon, Apr 25, 2016 at 06:29:35PM -0700, Stephen Boyd wrote:
> On 04/25, Andy Gross wrote:
> > This patch converts the Qualcomm SCM firmware driver into a platform
> > driver.
> > 
> > Signed-off-by: Andy Gross <andy.gross@linaro.org>
> > ---
> >  arch/arm64/Kconfig.platforms |   1 +
> >  drivers/firmware/qcom_scm.c  | 163 ++++++++++++++++++++++++++++++++++++++++---
> >  2 files changed, 155 insertions(+), 9 deletions(-)
> > 
> > diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> > index efa77c1..6f0876f 100644
> > --- a/arch/arm64/Kconfig.platforms
> > +++ b/arch/arm64/Kconfig.platforms
> > @@ -76,6 +76,7 @@ config ARCH_MVEBU
> >  config ARCH_QCOM
> >  	bool "Qualcomm Platforms"
> >  	select PINCTRL
> > +	select QCOM_SCM
> 
> So far we've left this selection up to the consumer drivers of
> the qcom_scm_*() APIs. Any reason why that's changing here? I
> don't see mention in the commit text.

We can leave it that way.
> 
> >  	help
> >  	  This enables support for the ARMv8 based Qualcomm chipsets.
> >  
> > +
> > +/**
> > + * qcom_scm_is_available() - Checks if SCM is available
> > + */
> > +bool qcom_scm_is_available(void)
> > +{
> > +	return !!__scm;
> > +}
> > +EXPORT_SYMBOL(qcom_scm_is_available);
> 
> What's the planned user of this? If we need it can we bury it
> inside the qcom_scm_*() functions?

Hmmmm doing a little searching, I don't see this being used anymore.  I'll drop
it for now.

> > +
> > +static int qcom_scm_probe(struct platform_device *pdev)
> > +{
> [...]
> > +
> > +	/* vote for max clk rate for highest performance */
> > +	rate = clk_round_rate(scm->core_clk, INT_MAX);
> > +	ret = clk_set_rate(scm->core_clk, rate);
> 
> You can just do clk_set_rate(scm->core_clk, INT_MAX) and it will
> round internally for you and do the right thing. 

I'll change this to do that.

> > +	if (ret)
> > +		return ret;
> > +
> > +	__scm = scm;
> > +	__scm->dev = &pdev->dev;
> > +
> > +	return 0;
> > +}
> > +
> > +static const struct of_device_id qcom_scm_dt_match[] = {
> > +	{ .compatible = "qcom,scm-apq8064",},
> > +	{ .compatible = "qcom,scm-apq8084",},
> > +	{ .compatible = "qcom,scm-msm8916",},
> > +	{ .compatible = "qcom,scm-msm8974",},
> > +	{},
> 
> Nitpick: drop , here because it's always going to be the last
> entry.

will fix.

> > +};
> > +
> > +MODULE_DEVICE_TABLE(of, qcom_scm_dt_match);
> > +
> > +static struct platform_driver qcom_scm_driver = {
> > +	.driver = {
> > +		.name	= "qcom_scm",
> > +		.of_match_table = qcom_scm_dt_match,
> > +	},
> > +	.probe = qcom_scm_probe,
> > +};
> > +
> > +builtin_platform_driver(qcom_scm_driver);
> > +
> > +static int __init qcom_scm_init(void)
> > +{
> > +	struct device_node *np;
> > +
> > +	np = of_find_node_by_name(NULL, "firmware");
> > +	if (!np)
> > +		return -ENODEV;
> > +
> > +	return of_platform_populate(np, qcom_scm_dt_match, NULL, NULL);
> > +
> 
> Weird newline and also we need an of_node_put() on the firmware
> node at the end of this function.

Ah thanks for catching that.


Regards,

Andy

  reply	other threads:[~2016-04-29 19:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 23:08 [Patch v2 0/8] Qualcomm SCM Rework Andy Gross
2016-04-25 23:08 ` [Patch v2 1/8] dt/bindings: firmware: Add Qualcomm SCM binding Andy Gross
2016-04-26  1:49   ` Stephen Boyd
2016-04-26  2:14     ` Andy Gross
2016-04-28 20:47       ` Rob Herring
2016-04-25 23:08 ` [Patch v2 2/8] firmware: qcom: scm: Convert SCM to platform driver Andy Gross
2016-04-26  1:29   ` Stephen Boyd
2016-04-29 19:25     ` Andy Gross [this message]
2016-04-25 23:08 ` [Patch v2 3/8] firmware: qcom: scm: Generalize shared error map Andy Gross
2016-04-26  1:29   ` Stephen Boyd
2016-04-25 23:08 ` [Patch v2 4/8] firmware: qcom: scm: Add memory allocation API Andy Gross
2016-04-26  1:50   ` Stephen Boyd
2016-04-25 23:08 ` [Patch v2 5/8] firmware: qcom: scm: Add support for ARM64 SoCs Andy Gross
2016-04-25 23:08 ` [Patch v2 6/8] firmware: qcom: scm: Use atomic SCM for cold boot Andy Gross
2016-04-26  1:44   ` Stephen Boyd
2016-04-25 23:08 ` [Patch v2 7/8] dts: qcom: apq8084: Add SCM firmware node Andy Gross
2016-04-25 23:08 ` [Patch v2 8/8] arm64: dts: msm8916: " Andy Gross

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=20160429192554.GA6666@hector.attlocal.net \
    --to=andy.gross@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jilaiw@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox