Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B25363A9DB2 for ; Wed, 14 Oct 2026 04:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791951894; cv=none; b=oe/Gggk+5D/JRcOtx0n7KHb5hncHLY9pTyYI7mo+Hm4WRW7Cvg/G9obRIhfIocSnXgnzQhHG/+4AqlywWBhiFofOHNkfuEmceMK3cxa4ECbKpFiT9zWYtXJyRR5tV38ZlMOTgGqNLkwRGV68WfFff+agZX2zblOhnXWmFojt+8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791951894; c=relaxed/simple; bh=uX2IrYZKuunh5Ay8wtG5R15VefK9qebescjFxGpBE28=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hfhWf2dAjkDklbVAX7ylMAWyjWHej4bVGcqKTESqusOwmnOJHXNREVLuBXonaTym3pKAYE+0jAxrzfWOe5H3eHGfkXw2IIBwkUD8ifQ9zOxEZBoYetyhiwEQlgdIAP+8S1vJDvMOTNsOXTFn6Con4R/5vwePQXro15rD0KDaoN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=mfBIXI1u; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=d/gg43Oy; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="mfBIXI1u"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="d/gg43Oy" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 69E2nkOY3000860 for ; Wed, 14 Oct 2026 04:24:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= R/YWOWusTmnn9Tx8/iLnPWjpANYDhhlrDY+RymDC9lQ=; b=mfBIXI1uLAOYHNpx M+pskrgQQbpJj/+60jNFLzZFxHw2r6RDPCnEYQak0C68FqNpjyua8eynX8SGcd1Y 2J1k4+K/t/BHMHnNSVt94VWd+zjp21ADu/+gT5GHSxkze+TVoAJ8ZcEJUegyUcj3 l02tjV+K80HtT6WpkHCz8hJA1pNAkGFI0embeDgtOOxCvfUQQ4c9lcW5zqnNjbim +IIDJbRdlgftjP27N4Ac7M+zpCtJs+D/UR8kPP45vYPVDrD5gR3xqxJhNmnwyIgi K4kI1TWbCLNx+Vt70sIiD4gGFEtC25wsPGiQD9gMthErtmViPMA3SxZL1fMU3msx O1ZOMA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h9sbet54a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 14 Oct 2026 04:24:51 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2df8d1e91c9so74354845ad.0 for ; Tue, 13 Oct 2026 21:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791951891; x=1792556691; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=R/YWOWusTmnn9Tx8/iLnPWjpANYDhhlrDY+RymDC9lQ=; b=d/gg43OyQJIyLQJ4aba4T5jNV4ea758iHy66fF/nH8LLj2KfCNUHNREkHxifmGvqKT VRNCeBb60ZbgI8uheCRTIVLFGbwQAiD7wIvL+z2wsQUKxFIQZCAx+Nzoo1HZATZBG/In /j4zZ2PyktfeXg7ojU4cxl7+cKNp2DjVZHb9rL1jewPuV60mK4SzbrTyxwuXkID4u9GN JWcTTAwL5N235gL+1OIEtc1wdB4OidvcqwtT98iIuhzvwPau2URpK+GbHS8MvUXpi4eP +nKo8am43xlIUmON7+2+yqh1CUdDxCiBpaNsJGaAuxp4rv+PX6ShGRqcY42alT/pXmxW RKJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791951891; x=1792556691; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=R/YWOWusTmnn9Tx8/iLnPWjpANYDhhlrDY+RymDC9lQ=; b=MKpRLnC9dWGqB6UmDP1taPH7Ud5+bJPQHmkrSvRamKgy/UBX4NlLMYjbPUurLF8gFM oRSTfZM7Y+tupfHMdfjKWSDxJV+JgIIGcGOJvtqWO6lm93wzprdnrQq/AqStmPPw4IYv DRaUNN8Ufr3TayXZdSpkll0jok/6m1VNSuRK8O7fgLhz69+S1F8K1KRqgfYw83zSXAvX 37JNesPyS6RR6BGfioXAMIiogZoCvUxUTDwu1wBGcs2wH2Ao6Advp/FmRPXwKERCT1io CKbUS4+YRT7pr2JP+Jfk+cJo4vDngsBMcac0PwSbxnh8/TpSjx3nj3s9RQWXeqZdcWaz zA5g== X-Forwarded-Encrypted: i=1; AKwUvBy+PDig8b5Su0o2qzijUHqiDacfeAfu5KP0ceuanJKCW7pjTo8EoJzzIEUVb+Fdc7JLH60H5dpTLDo=@vger.kernel.org X-Gm-Message-State: AFq9FYLVkVYqbAzvgx2amJI58U+3D6TmE7xLzlsZb4XIZnONf9N+QGHt 6dOWgKBaYSzbz0xnBr6uk0q0Vwva4zKfxe7EhNNwIheTvThsBvJezIv+AboYWwuZoeEe7Q+DDsv CLY4TecsvQTb4mATfZ4iuTLQx1VTN0c2MeoOTuxfsQTuTGIRqGKdhl3fMpilwi0M= X-Gm-Gg: AYBFou0io92XNRUKZ67o6buc8VGAKXEqJL36lgolfamaYPTRFssTO0j+qRG/JSMdV4G MqX+So3Fx9oh5S2edds7LYNWgrTF2p7N97pJGkqNzqtc7T6kyuEEFtUyj5hxo+Ry9LbEoqXhJ5y GLQnjVKE9IDSktmNEewXnEkMwL/sU/bEi3O3+SQ5AwzY4Um35tTCYZj/iAMN//dm23DdzAmFNLz wQzhmP1G+FAUfcZHIqqgFUhkfkWrYESzKGvhxYjwNIPrARajOP2N6iS+y71T3V3cHAfodT3NTjS KlViELpYWpZ54d3Btn61k3jGfTZzYVmRTxt9CotpAtbYPDmx1uw6Lnrrbh3ueJ2DG80x0RWwF// IBXDgem/sPSxd/MnIUBYF+4nOt8OBdu1sX49rzGftWJwqUhJP/0MiFhPDNoShH38Q/1avZk3W X-Received: by 2002:a17:90b:35cc:b0:3a5:147a:3b63 with SMTP id 98e67ed59e1d1-3ab3a33db36mr12329648a91.8.1791951891159; Tue, 13 Oct 2026 21:24:51 -0700 (PDT) X-Received: by 2002:a17:90b:35cc:b0:3a5:147a:3b63 with SMTP id 98e67ed59e1d1-3ab3a33db36mr12329579a91.8.1791951890405; Tue, 13 Oct 2026 21:24:50 -0700 (PDT) Received: from [10.133.33.242] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ac63279277sm860530a91.1.2026.10.13.21.24.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Oct 2026 21:24:49 -0700 (PDT) Message-ID: <252e86f2-9663-4ac7-a19e-6056b44e769b@oss.qualcomm.com> Date: Wed, 14 Oct 2026 12:24:38 +0800 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 04/11] cpufreq: Initialize kobj_type release callback in ondemand and conservative governors To: Ian Rogers , Greg Kroah-Hartman , "Rafael J . Wysocki" , Danilo Krummrich , Miguel Ojeda , Kees Cook , Nathan Chancellor Cc: Nick Desaulniers , Bill Wendling , Justin Stitt , Jonathan Corbet , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Nayna Jain , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Viresh Kumar , David Teigland , Alexander Aring , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Richard Weinberger , Zhihao Cheng , Felix Kuehling , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , driver-core@lists.linux.dev, llvm@lists.linux.dev, linux-hardening@vger.kernel.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, gfs2@lists.linux.dev, xen-devel@lists.xenproject.org, linux-s390@vger.kernel.org, linux-mtd@lists.infradead.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, zhongqiu.han@oss.qualcomm.com References: <20261013223946.1836757-1-irogers@google.com> <20261013223946.1836757-5-irogers@google.com> Content-Language: en-US From: Zhongqiu Han In-Reply-To: <20261013223946.1836757-5-irogers@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: hLwvXt9ju2zRswt3K6Zk6Kq7-HUJJuE9 X-Proofpoint-GUID: hLwvXt9ju2zRswt3K6Zk6Kq7-HUJJuE9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDE0MDAxNyBTYWx0ZWRfX6rHhv8Rgx0Rc XygMGGkJwo9J3+7cisE4hVfjo8NoX4PLxItKxNmQAKrbJsYCn3ZwaQHx7hAqUpCENLvDEtm6G8V tvnrPTqQA+YM5uWczJdZAqaRsX2WIEvgtoJSM0y24Y/mPZde6UZc8WuThsAKDjy8La9VHjpuxLw Bx2P9fSTsyyPPX1QmlQnjWQVQxhZ7DDxvtJ16VKmwmDu1hd49mlq8JkKDfYlqgBJ4sOGJsH90Nm EHO+ak13LGKSZ/sJuhtufxhXAqU9Y9/VFwe+9wNHveH28v7db/0oJQxuhCRLDBFW+I42qVDs/3M z0WeNnTmLpYfcer1KcFqx6ooUrPHMXGO3J28m1lD/MdkwVwbkwp56YRjr3BPBlhash3cnBi55/X E4+hGO7yJ991dGmou4fKLB2VvMWIFaJSCr/oED+8g/yGQtAP7simxAiXW2wP9xvpAKq4kQoNGWV e5kgQHINNG4hYhBHZKA== X-Proofpoint-Spam-Info: AW1haW4tMjYxMDE0MDAxNyBTYWx0ZWRfXxNGmv7x4cECr SMGGn+XWi41Ya8oeyjOL5AU70zai53+Sguyii48nLXdtcqqLEPC59uf4BZc+lr+GglAHKMsKG4K DPyxzfg6GLgCilOmE4RcRrMObY4zMJM= X-Authority-Analysis: v=2.4 cv=U7AHnuru c=1 sm=1 tr=0 ts=6acf0413 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=1XWaLZrsAAAA:8 a=Stt4M9KXtKJ5ZbChFzoA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-13_01,2026-10-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610140017 Hi Ian, Thanks a lot for the patch. On 10/14/2026 6:39 AM, Ian Rogers wrote: > Export cpufreq_dbs_data_release() and set .kobj_type.release in the > ondemand and conservative governors so their gov_attr_set kobjects have > a valid release callback, matching cpufreq_ governor_dbs. Commit a85ee6401a47 ("cpufreq: governor: Use kobject release() method to free dbs_data") has already addressed the missing release callback issue(it adds the missing cpufreq_dbs_data_release() function.), with its Fixes tag pointing to c4435630361d. Besides, "matching cpufreq_ governor_dbs." seems to be a typo? > > This prepares for annotating struct kobj_type::release with > __require_explicit_initialization. It would be better to use "cpufreq: governor:" as the subject prefix. > > Fixes: c4435630361d ("cpufreq: governor: New sysfs show/store callbacks for governor tunables") Since a85ee6401a47 ("cpufreq: governor: Use kobject release() method to free dbs_data") has already fixed the missing release callback issue, current cpufreq patch 4/11 seems to only move the release callback initialization to the static initializer in preparation for 11/11. The same callback is already set at runtime in cpufreq_dbs_governor_init(), so there is no functional change or bug fix here. Should we drop the Fixes tag? So, at least for cpufreq, the issue described in the cover letter doesn't seem to exist, right? "Patches 2-10 fix 10 struct kobj_type definitions where dynamically allocated kobjects, ksets, or enclosing structures were either leaked on kobject_put() or freed prematurely before kobject release" > Assisted-by: Antigravity:gemini-3.1-pro > Signed-off-by: Ian Rogers > --- > drivers/cpufreq/cpufreq_conservative.c | 5 ++++- > drivers/cpufreq/cpufreq_governor.c | 3 ++- > drivers/cpufreq/cpufreq_governor.h | 1 + > drivers/cpufreq/cpufreq_ondemand.c | 5 ++++- > 4 files changed, 11 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c > index 0b32ae28ec85..38c3bd5bf75a 100644 > --- a/drivers/cpufreq/cpufreq_conservative.c > +++ b/drivers/cpufreq/cpufreq_conservative.c > @@ -316,7 +316,10 @@ static void cs_limits(struct cpufreq_policy *policy) > > static struct dbs_governor cs_governor = { > .gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("conservative"), > - .kobj_type = { .default_groups = cs_groups }, > + .kobj_type = { > + .release = cpufreq_dbs_data_release, > + .default_groups = cs_groups, > + }, Nit: In that case, may I know can we also remove the following runtime assignment from cpufreq_dbs_governor_init() as below: gov->kobj_type.release = cpufreq_dbs_data_release; > .gov_dbs_update = cs_dbs_update, > .alloc = cs_alloc, > .free = cs_free, > diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c > index 710d93ec89b5..97b64985927d 100644 > --- a/drivers/cpufreq/cpufreq_governor.c > +++ b/drivers/cpufreq/cpufreq_governor.c > @@ -404,7 +404,7 @@ static void free_policy_dbs_info(struct policy_dbs_info *policy_dbs, > gov->free(policy_dbs); > } > > -static void cpufreq_dbs_data_release(struct kobject *kobj) > +void cpufreq_dbs_data_release(struct kobject *kobj) > { > struct dbs_data *dbs_data = to_dbs_data(to_gov_attr_set(kobj)); > struct dbs_governor *gov = dbs_data->gov; > @@ -412,6 +412,7 @@ static void cpufreq_dbs_data_release(struct kobject *kobj) > gov->exit(dbs_data); > kfree(dbs_data); > } > +EXPORT_SYMBOL_GPL(cpufreq_dbs_data_release); > > int cpufreq_dbs_governor_init(struct cpufreq_policy *policy) > { > diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h > index 73b8ed7cfaae..c03d067f42eb 100644 > --- a/drivers/cpufreq/cpufreq_governor.h > +++ b/drivers/cpufreq/cpufreq_governor.h > @@ -148,6 +148,7 @@ static inline struct dbs_governor *dbs_governor_of(struct cpufreq_policy *policy > } > > /* Governor callback routines */ > +void cpufreq_dbs_data_release(struct kobject *kobj); > int cpufreq_dbs_governor_init(struct cpufreq_policy *policy); > void cpufreq_dbs_governor_exit(struct cpufreq_policy *policy); > int cpufreq_dbs_governor_start(struct cpufreq_policy *policy); > diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c > index 9942dbb38dae..7386d043c665 100644 > --- a/drivers/cpufreq/cpufreq_ondemand.c > +++ b/drivers/cpufreq/cpufreq_ondemand.c > @@ -374,7 +374,10 @@ static struct od_ops od_ops = { > > static struct dbs_governor od_dbs_gov = { > .gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("ondemand"), > - .kobj_type = { .default_groups = od_groups }, > + .kobj_type = { > + .release = cpufreq_dbs_data_release, > + .default_groups = od_groups, > + }, > .gov_dbs_update = od_dbs_update, > .alloc = od_alloc, > .free = od_free, -- Thx and BRs, Zhongqiu Han