From: Pierre Gondois <pierre.gondois@arm.com>
To: "zhenglifeng (A)" <zhenglifeng1@huawei.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: Allocate QoS freq_req objects with policy
Date: Tue, 31 Mar 2026 09:03:35 +0200 [thread overview]
Message-ID: <05799650-81cc-4761-9eed-dab4b9945186@arm.com> (raw)
In-Reply-To: <fbe74184-98dd-42f8-a851-8a8b5d001f1e@huawei.com>
On 3/31/26 08:44, zhenglifeng (A) wrote:
> On 3/31/2026 1:03 PM, Viresh Kumar wrote:
>> A recent change exposed a bug in the error path: if
>> freq_qos_add_request(boost_freq_req) fails, min_freq_req may remain a
>> valid pointer even though it was never successfully added. During policy
>> teardown, this leads to an unconditional call to
>> freq_qos_remove_request(), triggering a WARN.
>>
>> The current design allocates all three freq_req objects together, making
>> the lifetime rules unclear and error handling fragile.
>>
>> Simplify this by allocating the QoS freq_req objects at policy
>> allocation time. The policy itself is dynamically allocated, and two of
>> the three requests are always needed anyway. This ensures consistent
>> lifetime management and eliminates the inconsistent state in failure
>> paths.
>>
>> Reported-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
>> Fixes: 6e39ba4e5a82 ("cpufreq: Add boost_freq_req QoS request")
>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> This looks much neater. Thanks!
>
> Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Thanks for fixing the patch, removing the allocation makes
things much cleaner.
Tested-by: Pierre Gondois <pierre.gondois@arm.com>
next prev parent reply other threads:[~2026-03-31 7:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 5:03 [PATCH] cpufreq: Allocate QoS freq_req objects with policy Viresh Kumar
2026-03-31 6:44 ` zhenglifeng (A)
2026-03-31 7:03 ` Pierre Gondois [this message]
2026-03-31 7:10 ` Zhongqiu Han
2026-04-01 13:55 ` Rafael J. Wysocki
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=05799650-81cc-4761-9eed-dab4b9945186@arm.com \
--to=pierre.gondois@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=zhenglifeng1@huawei.com \
--cc=zhongqiu.han@oss.qualcomm.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