Messages in this thread |  | | Date | Tue, 9 Dec 2025 11:40:21 +0800 | | Subject | Re: [PATCH v4] PM / devfreq: use _visible attribute to replace create/remove_sysfs_files() | | From | Jie Zhan <> |
| |
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@huawei.com> Other than a few minor things that Jonathan posted, Reviewed-by: Jie Zhan <zhanjie9@hisilicon.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(-) ...
|  |