[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3f1d0292-3ac9-48ff-a87e-00fafe638ad3@hisilicon.com>
Date: Tue, 9 Dec 2025 11:40:21 +0800
From: Jie Zhan <zhanjie9@...ilicon.com>
To: Pengjie Zhang <zhangpengjie2@...wei.com>, <myungjoo.ham@...sung.com>,
<kyungmin.park@...sung.com>, <cw00.choi@...sung.com>
CC: <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<zhenglifeng1@...wei.com>, <lihuisong@...wei.com>, <yubowen8@...wei.com>,
<linhongye@...artners.com>, <linuxarm@...wei.com>,
<jonathan.cameron@...wei.com>, <wangzhi12@...wei.com>
Subject: Re: [PATCH v4] PM / devfreq: use _visible attribute to replace
create/remove_sysfs_files()
On 12/5/2025 4:37 PM, Pengjie Zhang wrote:
> Previously, non-generic attributes (polling_interval, timer) used separate
> create/delete logic, leading to race conditions during concurrent access in
> creation/deletion. Multi-threaded operations also caused inconsistencies
> between governor capabilities and attribute states.
>
> 1.Use is_visible + sysfs_update_group() to unify management of these
> attributes, eliminating creation/deletion races.
> 2.Add locks and validation to these attributes, ensuring consistency
> between current governor capabilities and attribute operations in
> multi-threaded environments.
>
> Signed-off-by: Pengjie Zhang <zhangpengjie2@...wei.com>
Other than a few minor things that Jonathan posted,
Reviewed-by: Jie Zhan <zhanjie9@...ilicon.com>
Thanks!
> ---
> changes in v4:
> -Remove the DEFINE_SYSFS_GROUP_VISIBLE macro and directly set the is_visible function.
> -Remove unnecessary ret variables
> Link to v3:https://lore.kernel.org/lkml/20251107031706.1698396-1-zhangpengjie2@huawei.com/
>
> changes in v3:
> - Use guard() to simplify lock acquisition and destruction.
> - Eliminate redundant checks for df.
> Link to v2:https://lore.kernel.org/lkml/20251028022458.2824872-1-zhangpengjie2@huawei.com/
>
> Changes in v2:
> - Fix one problem reported by the kernel test robot.
> - Redirect all error paths in timer_store() to out to ensure locks are not
> left unReleased.
> Link to v1:https://lore.kernel.org/lkml/20251025135238.3576861-1-zhangpengjie2@huawei.com/
>
> drivers/devfreq/devfreq.c | 99 +++++++++++++++++++++++----------------
> 1 file changed, 58 insertions(+), 41 deletions(-)
...
Powered by blists - more mailing lists