From: Joseph Lo <josephl@nvidia.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: linux-tegra@vger.kernel.org,
Daniel Lezcano <daniel.lezcano@linaro.org>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpuidle: dt: bail out if the idle-state DT node is not compatible
Date: Fri, 1 Feb 2019 09:42:41 +0800 [thread overview]
Message-ID: <fc49e8b2-cc32-3074-9aa7-04bbc561dfe6@nvidia.com> (raw)
In-Reply-To: <20190131103823.GA19907@e107155-lin>
On 1/31/19 6:38 PM, Sudeep Holla wrote:
> On Thu, Jan 31, 2019 at 10:27:49AM +0800, Joseph Lo wrote:
>> Currently, the DT of the idle states will be parsed first whether it's
>> compatible or not. This could cause a warning message that comes from if
>> the CPU doesn't support identical idle states. E.g. Tegra186 can run
>> with 2 Cortex-A57 and 2 Denver cores with different idle states on
>> different types of these cores.
>>
>> We fix it to check the compatible string before the parsing procedures.
>> So it can make sure it only goes through the idle states that the CPU
>> supported.
>>
>> Signed-off-by: Joseph Lo <josephl@nvidia.com>
>> ---
>> drivers/cpuidle/dt_idle_states.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
>> index 53342b7f1010..4a528908abb3 100644
>> --- a/drivers/cpuidle/dt_idle_states.c
>> +++ b/drivers/cpuidle/dt_idle_states.c
>> @@ -180,6 +180,11 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
>> if (!state_node)
>> break;
>>
>> + if (!of_device_is_compatible(state_node, matches->compatible)) {
>> + err = -EINVAL;
>> + break;
>> + }
>> +
>
> Does it make sense to use of_match_node to get the matching device id and
> just pass that to init_state_node instead of the complete array to find the
> match.
Yes, that would be even better.
Thanks,
Joseph
prev parent reply other threads:[~2019-02-01 1:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 2:27 [PATCH] cpuidle: dt: bail out if the idle-state DT node is not compatible Joseph Lo
2019-01-31 10:38 ` Sudeep Holla
2019-02-01 1:42 ` Joseph Lo [this message]
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=fc49e8b2-cc32-3074-9aa7-04bbc561dfe6@nvidia.com \
--to=josephl@nvidia.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sudeep.holla@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).