From: Dmitry Osipenko <digetx@gmail.com>
To: Jon Hunter <jonathanh@nvidia.com>,
Thierry Reding <thierry.reding@gmail.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH v2] cpuidle: tegra: Correctly handle result of arm_cpuidle_simple_enter()
Date: Wed, 8 Jul 2020 17:32:18 +0300 [thread overview]
Message-ID: <3bc2064e-e94d-984c-edab-50b4dc2fd2dd@gmail.com> (raw)
In-Reply-To: <4ffff3d8-2d41-3fb2-ed16-c9662d18d261@nvidia.com>
08.07.2020 15:34, Jon Hunter пишет:
>
> On 02/07/2020 01:13, Dmitry Osipenko wrote:
>> The enter() callback of CPUIDLE drivers returns index of the entered idle
>> state on success or a negative value on failure. The negative value could
>> any negative value, i.e. it doesn't necessarily needs to be a error code.
>> That's because CPUIDLE core only cares about the fact of failure and not
>> about the reason of the enter() failure.
>>
>> Like every other enter() callback, the arm_cpuidle_simple_enter() returns
>> the entered idle-index on success. Unlike some of other drivers, it never
>> fails. It happened that TEGRA_C1=index=err=0 in the code of cpuidle-tegra
>> driver, and thus, there is no problem for the cpuidle-tegra driver created
>> by the typo in the code which assumes that the arm_cpuidle_simple_enter()
>> returns a error code.
>>
>> The arm_cpuidle_simple_enter() also may return a -ENODEV error if CPU_IDLE
>> is disabled in a kernel's config, but all CPUIDLE drivers are disabled if
>> CPU_IDLE is disabled, including the cpuidle-tegra driver. So we can't ever
>> see the error code from arm_cpuidle_simple_enter() today.
>>
>> Of course the code may get some changes in the future and then the typo
>> may transform into a real bug, so let's correct the typo in the code by
>> making tegra_cpuidle_enter() to directly return the index returned by the
>> arm_cpuidle_simple_enter().
>
> Are you suggesting that arm_cpuidle_simple_enter() could be updated to
> actually return an error? Sorry it is not clear to me what you are implying.
Hello, Jon!
Yes, I'm saying that *potentially* arm_cpuidle_simple_enter() could be
updated to actually return error.
The implication is that the current code is wrong and it may strike back
in the future if we won't fix it. Is this more clear? :)
next prev parent reply other threads:[~2020-07-08 14:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 0:13 [PATCH v2] cpuidle: tegra: Correctly handle result of arm_cpuidle_simple_enter() Dmitry Osipenko
2020-07-08 12:34 ` Jon Hunter
2020-07-08 14:32 ` Dmitry Osipenko [this message]
2020-07-09 9:06 ` Jon Hunter
2020-07-09 9:48 ` Dmitry Osipenko
2020-07-09 9:51 ` Jon Hunter
2020-07-09 10:21 ` Dmitry Osipenko
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=3bc2064e-e94d-984c-edab-50b4dc2fd2dd@gmail.com \
--to=digetx@gmail.com \
--cc=daniel.lezcano@linaro.org \
--cc=jonathanh@nvidia.com \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=thierry.reding@gmail.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).