From: <ilialin@codeaurora.org>
To: 'Sudeep Holla' <sudeep.holla@arm.com>
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, vireshk@kernel.org, nm@ti.com,
sboyd@kernel.org, robh@kernel.org, mark.rutland@arm.com,
rjw@rjwysocki.net
Subject: RE: [PATCH v12 1/2] cpufreq: Add Kryo CPU scaling driver
Date: Thu, 24 May 2018 17:10:32 +0300 [thread overview]
Message-ID: <000701d3f368$fd31e410$f795ac30$@codeaurora.org> (raw)
In-Reply-To: <b4e221af-57f7-fd11-942d-6bc6f6b55a73@arm.com>
Thank you for the explanation. However, could you suggest, which condition should I check then? Device tree?
> -----Original Message-----
> From: Sudeep Holla <sudeep.holla@arm.com>
> Sent: Thursday, May 24, 2018 17:01
> To: ilialin@codeaurora.org; vireshk@kernel.org; nm@ti.com;
> sboyd@kernel.org; robh@kernel.org; mark.rutland@arm.com;
> rjw@rjwysocki.net
> Cc: Sudeep Holla <sudeep.holla@arm.com>; linux-pm@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v12 1/2] cpufreq: Add Kryo CPU scaling driver
>
>
>
> On 24/05/18 14:03, ilialin@codeaurora.org wrote:
> >
> >
>
> [...]
>
> >>> +
> >>> + ret = PTR_ERR_OR_ZERO(platform_device_register_simple(
> >>> + "qcom-cpufreq-kryo", -1, NULL, 0));
> >>
> >>
> >> You simply can't do this unconditionally here. This will blow up on
> >> platforms where this driver is not supposed to work. The probe will
> >> be called on non- QCOM or non-Kryo QCOM platforms and I reckon it
> >> will crash trying to execute something in qcom_smem_get.
> >
> > What do you mean by 'unconditionally'?
>
> Why should you even add/register a device "qcom-cpufreq-kryo" on other
> platforms. Drivers can get registered, but only devices that are present or
> required by the platform need to be registered.
>
> > The driver depends on the smem and nvmem drivers, which depend on
> ARCH_QCOM:
> > + depends on QCOM_QFPROM
> > + depends on QCOM_SMEM
> >
>
> Sure, but we have something called single image for all ARM64 platforms.
> May be QCOM still used to tweeking config to build binary for your particular
> mobile platform but the distro kernel need single binary to work on all
> platforms. We have moved far away from platform specific builds long back
> now IIRC.
>
> > And if SMEM read in the probe returns something other than Kryo, it will
> exit.
> >
>
> Check what this driver does ?
>
> msm_id = qcom_smem_get(QCOM_SMEM_HOST_ANY,
> MSM_ID_SMEM, &len);
> msm_id++;
> switch ((enum _msm_id)*msm_id)
>
> I think it *will and should* crash here ? You need to check the return value
> for sure. But since qcom_smem_get return -EPROBE_DEFER, we keep
> retrying even on non QCOM platforms which is something I would like to
> avoid.
>
> Therefore that's not the main concern. Why do I have to see "qcom-cpufreq-
> kryo" device registered on my non QCOM platform ?
>
> --
> Regards,
> Sudeep
WARNING: multiple messages have this Message-ID (diff)
From: <ilialin@codeaurora.org>
To: "'Sudeep Holla'" <sudeep.holla@arm.com>
Cc: <linux-pm@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <vireshk@kernel.org>, <nm@ti.com>,
<sboyd@kernel.org>, <robh@kernel.org>, <mark.rutland@arm.com>,
<rjw@rjwysocki.net>
Subject: RE: [PATCH v12 1/2] cpufreq: Add Kryo CPU scaling driver
Date: Thu, 24 May 2018 17:10:32 +0300 [thread overview]
Message-ID: <000701d3f368$fd31e410$f795ac30$@codeaurora.org> (raw)
In-Reply-To: <b4e221af-57f7-fd11-942d-6bc6f6b55a73@arm.com>
Thank you for the explanation. However, could you suggest, which condition should I check then? Device tree?
> -----Original Message-----
> From: Sudeep Holla <sudeep.holla@arm.com>
> Sent: Thursday, May 24, 2018 17:01
> To: ilialin@codeaurora.org; vireshk@kernel.org; nm@ti.com;
> sboyd@kernel.org; robh@kernel.org; mark.rutland@arm.com;
> rjw@rjwysocki.net
> Cc: Sudeep Holla <sudeep.holla@arm.com>; linux-pm@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v12 1/2] cpufreq: Add Kryo CPU scaling driver
>
>
>
> On 24/05/18 14:03, ilialin@codeaurora.org wrote:
> >
> >
>
> [...]
>
> >>> +
> >>> + ret = PTR_ERR_OR_ZERO(platform_device_register_simple(
> >>> + "qcom-cpufreq-kryo", -1, NULL, 0));
> >>
> >>
> >> You simply can't do this unconditionally here. This will blow up on
> >> platforms where this driver is not supposed to work. The probe will
> >> be called on non- QCOM or non-Kryo QCOM platforms and I reckon it
> >> will crash trying to execute something in qcom_smem_get.
> >
> > What do you mean by 'unconditionally'?
>
> Why should you even add/register a device "qcom-cpufreq-kryo" on other
> platforms. Drivers can get registered, but only devices that are present or
> required by the platform need to be registered.
>
> > The driver depends on the smem and nvmem drivers, which depend on
> ARCH_QCOM:
> > + depends on QCOM_QFPROM
> > + depends on QCOM_SMEM
> >
>
> Sure, but we have something called single image for all ARM64 platforms.
> May be QCOM still used to tweeking config to build binary for your particular
> mobile platform but the distro kernel need single binary to work on all
> platforms. We have moved far away from platform specific builds long back
> now IIRC.
>
> > And if SMEM read in the probe returns something other than Kryo, it will
> exit.
> >
>
> Check what this driver does ?
>
> msm_id = qcom_smem_get(QCOM_SMEM_HOST_ANY,
> MSM_ID_SMEM, &len);
> msm_id++;
> switch ((enum _msm_id)*msm_id)
>
> I think it *will and should* crash here ? You need to check the return value
> for sure. But since qcom_smem_get return -EPROBE_DEFER, we keep
> retrying even on non QCOM platforms which is something I would like to
> avoid.
>
> Therefore that's not the main concern. Why do I have to see "qcom-cpufreq-
> kryo" device registered on my non QCOM platform ?
>
> --
> Regards,
> Sudeep
next prev parent reply other threads:[~2018-05-24 14:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-24 8:57 [PATCH v12 0/2] Kryo CPU scaling driver Ilia Lin
2018-05-24 8:57 ` [PATCH v12 1/2] cpufreq: Add " Ilia Lin
2018-05-24 12:51 ` Sudeep Holla
2018-05-24 13:03 ` ilialin
2018-05-24 13:03 ` ilialin
2018-05-24 14:01 ` Sudeep Holla
2018-05-24 14:10 ` ilialin [this message]
2018-05-24 14:10 ` ilialin
2018-05-24 14:47 ` Sudeep Holla
2018-05-24 14:52 ` ilialin
2018-05-24 14:52 ` ilialin
2018-05-24 15:02 ` Sudeep Holla
2018-05-24 8:57 ` [PATCH v12 2/2] dt-bindings: cpufreq: Document operating-points-v2-kryo-cpu Ilia Lin
2018-05-24 9:02 ` [PATCH v12 0/2] Kryo CPU scaling driver Viresh Kumar
2018-05-24 11:20 ` Amit Kucheria
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='000701d3f368$fd31e410$f795ac30$@codeaurora.org' \
--to=ilialin@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=nm@ti.com \
--cc=rjw@rjwysocki.net \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=vireshk@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.