From: Yaxiong Tian <tianyaxiong@kylinos.cn>
To: Jie Zhan <zhanjie9@hisilicon.com>,
myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
cw00.choi@samsung.com, nm@ti.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 0/4] Fix some errors in the devfreq core layer when governor is NULL
Date: Fri, 27 Mar 2026 09:55:16 +0800 [thread overview]
Message-ID: <99dfd307-2ead-4f7c-a787-6a53ac40c36b@kylinos.cn> (raw)
In-Reply-To: <1774486650723160.85.seg@mailgw.kylinos.cn>
在 2026/3/25 18:06, Jie Zhan 写道:
>
> On 3/19/2026 5:14 PM, Yaxiong Tian wrote:
>> While doing some development work with devfreq_add_governor()/
>> devfreq_remove_governor(), I discovered several bugs caused when
>> devfreq->governor is NULL. Specifically:
>>
>> 1) A possible null pointer issue in devfreq_add_governor(), caused
>> by devfreq_remove_governor() setting devfreq->governor to NULL in
>> certain situations, while devfreq_add_governor() lacks corresponding
>> checks for devfreq->governor.
>>
>> 2) When operating on governor and available_governors under /sys,
>> there are also some unexpected errors.
>>
>> See the following patches for details.
> Hi Yaxiong,
>
> Sorry for catching this late.
>
> I happen to be working on the same issues recently on a local tree, though
> delayed for quite a while due to other business.
>
> It would be a totally different approach by reworking the locking logic,
> which, I supposed, can make the devfreq framework cleaner to maintain.
>
> I'll send it out shortly. Hopefully it can be a reference for us to
> discuss with.
>
> Thanks!
> Jie
Hi Jie
Thank you for your reply. I saw your PATCH in the public linked list, and I think your optimization work, such as the lock mechanism improvements, should be placed after my FIX. This will make it easier to backport the patches and fix lower-version kernels.
I see the patch is already in the devfreq-testing branch. I hope this work can be pushed forward as soon as possible to resolve the null pointer and other bugs.
Finally, if you have any further optimizations, remember to CC me on the patches. :)
>> Yaxiong Tian (4):
>> PM / devfreq: Fix possible null pointer issue in
>> devfreq_add_governor()
>> PM / devfreq: Fix available_governors_show() when no governor is set
>> PM / devfreq: Fix governor_store() failing when device has no current
>> governor
>> PM / devfreq: Optimize error return value of governor_show()
>>
>> drivers/devfreq/devfreq.c | 46 +++++++++++++++++++++------------------
>> 1 file changed, 25 insertions(+), 21 deletions(-)
>>
prev parent reply other threads:[~2026-03-27 1:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 9:14 [PATCH RESEND 0/4] Fix some errors in the devfreq core layer when governor is NULL Yaxiong Tian
2026-03-19 9:16 ` [PATCH RESEND 1/4] PM / devfreq: Fix possible null pointer issue in devfreq_add_governor() Yaxiong Tian
2026-03-31 7:04 ` Jie Zhan
2026-03-31 7:49 ` Yaxiong Tian
2026-03-31 8:49 ` Jie Zhan
2026-03-31 9:17 ` Yaxiong Tian
2026-03-31 9:28 ` Jie Zhan
2026-03-19 9:17 ` [PATCH RESEND 2/4] PM / devfreq: Fix available_governors_show() when no governor is set Yaxiong Tian
2026-03-31 7:08 ` Jie Zhan
2026-03-19 9:17 ` [PATCH RESEND 3/4] PM / devfreq: Fix governor_store() failing when device has no current governor Yaxiong Tian
2026-03-31 7:16 ` Jie Zhan
2026-03-31 8:02 ` Yaxiong Tian
2026-03-31 8:53 ` Jie Zhan
2026-03-31 9:30 ` Yaxiong Tian
2026-03-31 9:37 ` Jie Zhan
2026-03-31 9:54 ` Yaxiong Tian
2026-03-31 10:12 ` Yaxiong Tian
2026-03-19 9:17 ` [PATCH RESEND 4/4] PM / devfreq: Optimize error return value of governor_show() Yaxiong Tian
2026-03-31 7:21 ` Jie Zhan
2026-03-31 8:03 ` Yaxiong Tian
2026-03-25 10:06 ` [PATCH RESEND 0/4] Fix some errors in the devfreq core layer when governor is NULL Jie Zhan
[not found] ` <1774486650723160.85.seg@mailgw.kylinos.cn>
2026-03-27 1:55 ` Yaxiong Tian [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=99dfd307-2ead-4f7c-a787-6a53ac40c36b@kylinos.cn \
--to=tianyaxiong@kylinos.cn \
--cc=cw00.choi@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=nm@ti.com \
--cc=zhanjie9@hisilicon.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