mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>, <viresh.kumar@linaro.org>
Cc: <matthias.bgg@gmail.com>,
	<angelogioacchino.delregno@collabora.com>,
	<hector.yuan@mediatek.com>, <lukasz.luba@arm.com>,
	<qperret@google.com>, <linux-pm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2] PM: EM: Fix wrong return value in mtk_cpufreq_get_cpu_power()
Date: Thu, 7 Nov 2024 19:14:30 +0800	[thread overview]
Message-ID: <8364b0cd-5171-7e76-d450-6593395dce61@huawei.com> (raw)
In-Reply-To: <CAJZ5v0jC9_03euACrmahnDRBgU=0O60p0rkChR2BVOxx0J2Pzw@mail.gmail.com>



On 2024/11/7 18:58, Rafael J. Wysocki wrote:
> On Thu, Nov 7, 2024 at 2:50 AM Jinjie Ruan <ruanjinjie@huawei.com> wrote:
>>
>>
>>
>> On 2024/11/4 19:36, Jinjie Ruan wrote:
>>> mtk_cpufreq_get_cpu_power() return 0 if the policy is NULL. Then in
>>> em_create_perf_table(), the later zero check for power is not invalid
>>> as power is uninitialized. As Lukasz suggested, it must return -EINVAL when
>>> the 'policy' is not found. So return -EINVAL to fix it.
>>>
>>> Cc: stable@vger.kernel.org
>>> Fixes: 4855e26bcf4d ("cpufreq: mediatek-hw: Add support for CPUFREQ HW")
>>> Suggested-by: Lukasz Luba <lukasz.luba@arm.com>
>>> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
>>
>> Hi, could this be merged.
> 
> It's for Viresh to take care of and please replace the "PM: EM:"
> prefix in the subject with the proper cpufreq driver one.

Thank you for your kind reminder.

> 
> Thanks!
> 
>>> ---
>>> v2:
>>> - Fix the driver instead of em_create_perf_table() as suggested.
>>> - Update the commit message.
>>> - Add Suggested-by.
>>> ---
>>>  drivers/cpufreq/mediatek-cpufreq-hw.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/cpufreq/mediatek-cpufreq-hw.c b/drivers/cpufreq/mediatek-cpufreq-hw.c
>>> index 8925e096d5b9..aeb5e6304542 100644
>>> --- a/drivers/cpufreq/mediatek-cpufreq-hw.c
>>> +++ b/drivers/cpufreq/mediatek-cpufreq-hw.c
>>> @@ -62,7 +62,7 @@ mtk_cpufreq_get_cpu_power(struct device *cpu_dev, unsigned long *uW,
>>>
>>>       policy = cpufreq_cpu_get_raw(cpu_dev->id);
>>>       if (!policy)
>>> -             return 0;
>>> +             return -EINVAL;
>>>
>>>       data = policy->driver_data;
>>>

      reply	other threads:[~2024-11-07 11:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 11:36 Jinjie Ruan
2024-11-04 12:58 ` Lukasz Luba
2024-11-07  1:50 ` Jinjie Ruan
2024-11-07 10:58   ` Rafael J. Wysocki
2024-11-07 11:14     ` Jinjie Ruan [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=8364b0cd-5171-7e76-d450-6593395dce61@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=hector.yuan@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=qperret@google.com \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.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

all inboxes | Powered by JetHome®