linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references
@ 2025-09-01  8:57 Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 01/12] arm64: topology: Use scope-based cleanup helper Zihuan Zhang
                   ` (11 more replies)
  0 siblings, 12 replies; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

This patchset converts all remaining cpufreq users to rely on the
__free(put_cpufreq_policy) annotation for policy references, instead of
calling cpufreq_cpu_put() manually.

Motivation:
- Reduce the chance of reference counting mistakes
- Make the code more consistent with the latest kernel style
- behavior remains the same, but reference counting is now safer 
  and easier to maintain.

The changes are split into 12 patches as they touch different subsystems
and are maintained by different people. There is no functional change.

V3:
 - drop patch 'KVM: x86: Use __free(put_cpufreq_policy) for policy reference'
 - removed 5 patches which has been applied
 - Consolidate CPUFreq policy assignments and allocations into one line,
   suggested by Ben Horgan
 - Change cpu_has_cpufreq() return type to bool, following Rafael's suggestion
 - Change the title to 'Use scope-based cleanup helper'

V2:
 - Fix compile error in powernv-cpufreq.c
 - Split patch to separate logical changes

Zihuan Zhang (12):
  arm64: topology: Use scope-based cleanup helper
  ACPI: processor: thermal: Use scope-based cleanup helper
  cpufreq: intel_pstate: Use scope-based cleanup helper
  cpufreq: longhaul: Use scope-based cleanup helper
  cpufreq: powernv: Use scope-based cleanup helper
  PM / devfreq: Use scope-based cleanup helper
  drm/i915: Use scope-based cleanup helper
  cpufreq: powerpc: macintosh: Use scope-based cleanup helper
  powercap: dtpm_cpu: Use scope-based cleanup helper
  thermal: imx: Use scope-based cleanup helper
  thermal/drivers/ti-soc-thermal: Use scope-based cleanup helper
  PM: EM: Use scope-based cleanup helper

 arch/arm64/kernel/topology.c                  |  9 +++----
 drivers/acpi/processor_thermal.c              | 18 +++++--------
 drivers/cpufreq/intel_pstate.c                |  8 +++---
 drivers/cpufreq/longhaul.c                    |  3 +--
 drivers/cpufreq/powernv-cpufreq.c             | 11 ++++----
 drivers/devfreq/governor_passive.c            | 25 +++++++-----------
 drivers/gpu/drm/i915/gt/intel_llc.c           |  4 +--
 drivers/macintosh/windfarm_cpufreq_clamp.c    |  5 +---
 drivers/powercap/dtpm_cpu.c                   | 26 +++++--------------
 drivers/thermal/imx_thermal.c                 | 12 +++------
 .../ti-soc-thermal/ti-thermal-common.c        | 11 +++-----
 kernel/power/energy_model.c                   |  9 +++----
 12 files changed, 46 insertions(+), 95 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v3 01/12] arm64: topology: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 02/12] ACPI: processor: thermal: " Zihuan Zhang
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 arch/arm64/kernel/topology.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index 5d07ee85bdae..fa0980968f45 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -307,17 +307,16 @@ int arch_freq_get_on_cpu(int cpu)
 		 */
 		if (!housekeeping_cpu(cpu, HK_TYPE_TICK) ||
 		    time_is_before_jiffies(last_update + msecs_to_jiffies(AMU_SAMPLE_EXP_MS))) {
-			struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
+			struct cpufreq_policy *policy __free(put_cpufreq_policy) =
+				cpufreq_cpu_get(info->opp_cpu);
 			int ref_cpu;
 
 			if (!policy)
 				return -EINVAL;
 
 			if (!cpumask_intersects(policy->related_cpus,
-						housekeeping_cpumask(HK_TYPE_TICK))) {
-				cpufreq_cpu_put(policy);
+						housekeeping_cpumask(HK_TYPE_TICK)))
 				return -EOPNOTSUPP;
-			}
 
 			for_each_cpu_wrap(ref_cpu, policy->cpus, cpu + 1) {
 				if (ref_cpu == start_cpu) {
@@ -329,8 +328,6 @@ int arch_freq_get_on_cpu(int cpu)
 					break;
 			}
 
-			cpufreq_cpu_put(policy);
-
 			if (ref_cpu >= nr_cpu_ids)
 				/* No alternative to pull info from */
 				return -EAGAIN;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 02/12] ACPI: processor: thermal: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 01/12] arm64: topology: Use scope-based cleanup helper Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-03 11:07   ` Rafael J. Wysocki
  2025-09-01  8:57 ` [PATCH v3 03/12] cpufreq: intel_pstate: " Zihuan Zhang
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/acpi/processor_thermal.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index 1219adb11ab9..3c8b57df9619 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -62,19 +62,14 @@ static int phys_package_first_cpu(int cpu)
 	return 0;
 }
 
-static int cpu_has_cpufreq(unsigned int cpu)
+static bool cpu_has_cpufreq(unsigned int cpu)
 {
-	struct cpufreq_policy *policy;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
 
 	if (!acpi_processor_cpufreq_init)
 		return 0;
 
-	policy = cpufreq_cpu_get(cpu);
-	if (policy) {
-		cpufreq_cpu_put(policy);
-		return 1;
-	}
-	return 0;
+	return !!policy;
 }
 
 static int cpufreq_get_max_state(unsigned int cpu)
@@ -95,7 +90,6 @@ static int cpufreq_get_cur_state(unsigned int cpu)
 
 static int cpufreq_set_cur_state(unsigned int cpu, int state)
 {
-	struct cpufreq_policy *policy;
 	struct acpi_processor *pr;
 	unsigned long max_freq;
 	int i, ret;
@@ -111,6 +105,9 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
 	 * frequency.
 	 */
 	for_each_online_cpu(i) {
+		struct cpufreq_policy *policy __free(put_cpufreq_policy) =
+			cpufreq_cpu_get(i);
+
 		if (topology_physical_package_id(i) !=
 		    topology_physical_package_id(cpu))
 			continue;
@@ -120,15 +117,12 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
 		if (unlikely(!freq_qos_request_active(&pr->thermal_req)))
 			continue;
 
-		policy = cpufreq_cpu_get(i);
 		if (!policy)
 			return -EINVAL;
 
 		max_freq = (policy->cpuinfo.max_freq *
 			    (100 - reduction_step(i) * cpufreq_thermal_reduction_pctg)) / 100;
 
-		cpufreq_cpu_put(policy);
-
 		ret = freq_qos_update_request(&pr->thermal_req, max_freq);
 		if (ret < 0) {
 			pr_warn("Failed to update thermal freq constraint: CPU%d (%d)\n",
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 01/12] arm64: topology: Use scope-based cleanup helper Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 02/12] ACPI: processor: thermal: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-01 15:17   ` Rafael J. Wysocki
  2025-09-01  8:57 ` [PATCH v3 04/12] cpufreq: longhaul: " Zihuan Zhang
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/cpufreq/intel_pstate.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index f366d35c5840..4abc1ef2d2b0 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
 
 static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
 {
-	struct cpufreq_policy *policy __free(put_cpufreq_policy);
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
 
-	policy = cpufreq_cpu_get(cpudata->cpu);
 	if (!policy)
 		return false;
 
@@ -1698,19 +1697,18 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b,
 static void update_qos_request(enum freq_qos_req_type type)
 {
 	struct freq_qos_request *req;
-	struct cpufreq_policy *policy;
 	int i;
 
 	for_each_possible_cpu(i) {
 		struct cpudata *cpu = all_cpu_data[i];
 		unsigned int freq, perf_pct;
+		struct cpufreq_policy *policy __free(put_cpufreq_policy) =
+			cpufreq_cpu_get(i);
 
-		policy = cpufreq_cpu_get(i);
 		if (!policy)
 			continue;
 
 		req = policy->driver_data;
-		cpufreq_cpu_put(policy);
 
 		if (!req)
 			continue;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 04/12] cpufreq: longhaul: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (2 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 03/12] cpufreq: intel_pstate: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-02 15:58   ` Krzysztof Kozlowski
  2025-09-01  8:57 ` [PATCH v3 05/12] cpufreq: powernv: " Zihuan Zhang
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/cpufreq/longhaul.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index ba0e08c8486a..ae5596919671 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -950,7 +950,7 @@ static int __init longhaul_init(void)
 
 static void __exit longhaul_exit(void)
 {
-	struct cpufreq_policy *policy = cpufreq_cpu_get(0);
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
 	int i;
 
 	for (i = 0; i < numscales; i++) {
@@ -968,7 +968,6 @@ static void __exit longhaul_exit(void)
 		}
 	}
 
-	cpufreq_cpu_put(policy);
 	cpufreq_unregister_driver(&longhaul_driver);
 	kfree(longhaul_table);
 }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 05/12] cpufreq: powernv: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (3 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 04/12] cpufreq: longhaul: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 06/12] PM / devfreq: " Zihuan Zhang
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/cpufreq/powernv-cpufreq.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index 7d9a5f656de8..811fdbf398fa 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -892,15 +892,15 @@ static int powernv_cpufreq_reboot_notifier(struct notifier_block *nb,
 				unsigned long action, void *unused)
 {
 	int cpu;
-	struct cpufreq_policy *cpu_policy;
 
 	rebooting = true;
 	for_each_online_cpu(cpu) {
-		cpu_policy = cpufreq_cpu_get(cpu);
+		struct cpufreq_policy *cpu_policy __free(put_cpufreq_policy) =
+			cpufreq_cpu_get(cpu);
+
 		if (!cpu_policy)
 			continue;
 		powernv_cpufreq_target_index(cpu_policy, get_nominal_index());
-		cpufreq_cpu_put(cpu_policy);
 	}
 
 	return NOTIFY_DONE;
@@ -913,7 +913,6 @@ static struct notifier_block powernv_cpufreq_reboot_nb = {
 static void powernv_cpufreq_work_fn(struct work_struct *work)
 {
 	struct chip *chip = container_of(work, struct chip, throttle);
-	struct cpufreq_policy *policy;
 	unsigned int cpu;
 	cpumask_t mask;
 
@@ -928,14 +927,14 @@ static void powernv_cpufreq_work_fn(struct work_struct *work)
 	chip->restore = false;
 	for_each_cpu(cpu, &mask) {
 		int index;
+		struct cpufreq_policy *policy __free(put_cpufreq_policy) =
+			cpufreq_cpu_get(cpu);
 
-		policy = cpufreq_cpu_get(cpu);
 		if (!policy)
 			continue;
 		index = cpufreq_table_find_index_c(policy, policy->cur, false);
 		powernv_cpufreq_target_index(policy, index);
 		cpumask_andnot(&mask, &mask, policy->cpus);
-		cpufreq_cpu_put(policy);
 	}
 out:
 	cpus_read_unlock();
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 06/12] PM / devfreq: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (4 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 05/12] cpufreq: powernv: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 07/12] drm/i915: " Zihuan Zhang
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/devfreq/governor_passive.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c
index 953cf9a1e9f7..a035cf44bdb8 100644
--- a/drivers/devfreq/governor_passive.c
+++ b/drivers/devfreq/governor_passive.c
@@ -80,24 +80,23 @@ static int get_target_freq_with_cpufreq(struct devfreq *devfreq,
 	struct devfreq_passive_data *p_data =
 				(struct devfreq_passive_data *)devfreq->data;
 	struct devfreq_cpu_data *parent_cpu_data;
-	struct cpufreq_policy *policy;
 	unsigned long cpu, cpu_cur, cpu_min, cpu_max, cpu_percent;
 	unsigned long dev_min, dev_max;
 	unsigned long freq = 0;
 	int ret = 0;
 
 	for_each_online_cpu(cpu) {
-		policy = cpufreq_cpu_get(cpu);
+		struct cpufreq_policy *policy __free(put_cpufreq_policy) =
+			cpufreq_cpu_get(cpu);
+
 		if (!policy) {
 			ret = -EINVAL;
 			continue;
 		}
 
 		parent_cpu_data = get_parent_cpu_data(p_data, policy);
-		if (!parent_cpu_data) {
-			cpufreq_cpu_put(policy);
+		if (!parent_cpu_data)
 			continue;
-		}
 
 		/* Get target freq via required opps */
 		cpu_cur = parent_cpu_data->cur_freq * HZ_PER_KHZ;
@@ -106,7 +105,6 @@ static int get_target_freq_with_cpufreq(struct devfreq *devfreq,
 					devfreq->opp_table, &cpu_cur);
 		if (freq) {
 			*target_freq = max(freq, *target_freq);
-			cpufreq_cpu_put(policy);
 			continue;
 		}
 
@@ -121,7 +119,6 @@ static int get_target_freq_with_cpufreq(struct devfreq *devfreq,
 		freq = dev_min + mult_frac(dev_max - dev_min, cpu_percent, 100);
 
 		*target_freq = max(freq, *target_freq);
-		cpufreq_cpu_put(policy);
 	}
 
 	return ret;
@@ -256,7 +253,6 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq)
 	struct device *dev = devfreq->dev.parent;
 	struct opp_table *opp_table = NULL;
 	struct devfreq_cpu_data *parent_cpu_data;
-	struct cpufreq_policy *policy;
 	struct device *cpu_dev;
 	unsigned int cpu;
 	int ret;
@@ -273,23 +269,23 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq)
 	}
 
 	for_each_possible_cpu(cpu) {
-		policy = cpufreq_cpu_get(cpu);
+		struct cpufreq_policy *policy __free(put_cpufreq_policy) =
+			cpufreq_cpu_get(cpu);
+
 		if (!policy) {
 			ret = -EPROBE_DEFER;
 			goto err;
 		}
 
 		parent_cpu_data = get_parent_cpu_data(p_data, policy);
-		if (parent_cpu_data) {
-			cpufreq_cpu_put(policy);
+		if (parent_cpu_data)
 			continue;
-		}
 
 		parent_cpu_data = kzalloc(sizeof(*parent_cpu_data),
 						GFP_KERNEL);
 		if (!parent_cpu_data) {
 			ret = -ENOMEM;
-			goto err_put_policy;
+			goto err;
 		}
 
 		cpu_dev = get_cpu_device(cpu);
@@ -314,7 +310,6 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq)
 		parent_cpu_data->max_freq = policy->cpuinfo.max_freq;
 
 		list_add_tail(&parent_cpu_data->node, &p_data->cpu_data_list);
-		cpufreq_cpu_put(policy);
 	}
 
 	mutex_lock(&devfreq->lock);
@@ -327,8 +322,6 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq)
 
 err_free_cpu_data:
 	kfree(parent_cpu_data);
-err_put_policy:
-	cpufreq_cpu_put(policy);
 err:
 
 	return ret;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 07/12] drm/i915: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (5 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 06/12] PM / devfreq: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 08/12] cpufreq: powerpc: macintosh: " Zihuan Zhang
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/gpu/drm/i915/gt/intel_llc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_llc.c b/drivers/gpu/drm/i915/gt/intel_llc.c
index 1d19c073ba2e..f15e4c0fa54b 100644
--- a/drivers/gpu/drm/i915/gt/intel_llc.c
+++ b/drivers/gpu/drm/i915/gt/intel_llc.c
@@ -29,13 +29,11 @@ static struct intel_gt *llc_to_gt(struct intel_llc *llc)
 
 static unsigned int cpu_max_MHz(void)
 {
-	struct cpufreq_policy *policy;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
 	unsigned int max_khz;
 
-	policy = cpufreq_cpu_get(0);
 	if (policy) {
 		max_khz = policy->cpuinfo.max_freq;
-		cpufreq_cpu_put(policy);
 	} else {
 		/*
 		 * Default to measured freq if none found, PCU will ensure we
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 08/12] cpufreq: powerpc: macintosh: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (6 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 07/12] drm/i915: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-02 15:59   ` Krzysztof Kozlowski
  2025-09-01  8:57 ` [PATCH v3 09/12] powercap: dtpm_cpu: " Zihuan Zhang
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/macintosh/windfarm_cpufreq_clamp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c
index 28d18ef22bbb..08558756990b 100644
--- a/drivers/macintosh/windfarm_cpufreq_clamp.c
+++ b/drivers/macintosh/windfarm_cpufreq_clamp.c
@@ -62,12 +62,11 @@ static const struct wf_control_ops clamp_ops = {
 
 static int __init wf_cpufreq_clamp_init(void)
 {
-	struct cpufreq_policy *policy;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
 	struct wf_control *clamp;
 	struct device *dev;
 	int ret;
 
-	policy = cpufreq_cpu_get(0);
 	if (!policy) {
 		pr_warn("%s: cpufreq policy not found cpu0\n", __func__);
 		return -EPROBE_DEFER;
@@ -79,8 +78,6 @@ static int __init wf_cpufreq_clamp_init(void)
 	ret = freq_qos_add_request(&policy->constraints, &qos_req, FREQ_QOS_MAX,
 				   max_freq);
 
-	cpufreq_cpu_put(policy);
-
 	if (ret < 0) {
 		pr_err("%s: Failed to add freq constraint (%d)\n", __func__,
 		       ret);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 09/12] powercap: dtpm_cpu: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (7 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 08/12] cpufreq: powerpc: macintosh: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-03 11:43   ` Rafael J. Wysocki
  2025-09-01  8:57 ` [PATCH v3 10/12] thermal: imx: " Zihuan Zhang
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/powercap/dtpm_cpu.c | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c
index 99390ec1481f..5e18438782f8 100644
--- a/drivers/powercap/dtpm_cpu.c
+++ b/drivers/powercap/dtpm_cpu.c
@@ -144,19 +144,15 @@ static int update_pd_power_uw(struct dtpm *dtpm)
 static void pd_release(struct dtpm *dtpm)
 {
 	struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm);
-	struct cpufreq_policy *policy;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(dtpm_cpu->cpu);
 
 	if (freq_qos_request_active(&dtpm_cpu->qos_req))
 		freq_qos_remove_request(&dtpm_cpu->qos_req);
 
-	policy = cpufreq_cpu_get(dtpm_cpu->cpu);
-	if (policy) {
+	if (policy)
 		for_each_cpu(dtpm_cpu->cpu, policy->related_cpus)
 			per_cpu(dtpm_per_cpu, dtpm_cpu->cpu) = NULL;
 
-		cpufreq_cpu_put(policy);
-	}
-
 	kfree(dtpm_cpu);
 }
 
@@ -192,7 +188,7 @@ static int cpuhp_dtpm_cpu_online(unsigned int cpu)
 static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
 {
 	struct dtpm_cpu *dtpm_cpu;
-	struct cpufreq_policy *policy;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
 	struct em_perf_state *table;
 	struct em_perf_domain *pd;
 	char name[CPUFREQ_NAME_LEN];
@@ -202,21 +198,16 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
 	if (dtpm_cpu)
 		return 0;
 
-	policy = cpufreq_cpu_get(cpu);
 	if (!policy)
 		return 0;
 
 	pd = em_cpu_get(cpu);
-	if (!pd || em_is_artificial(pd)) {
-		ret = -EINVAL;
-		goto release_policy;
-	}
+	if (!pd || em_is_artificial(pd))
+		return -EINVAL;
 
 	dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL);
-	if (!dtpm_cpu) {
-		ret = -ENOMEM;
-		goto release_policy;
-	}
+	if (!dtpm_cpu)
+		return -ENOMEM;
 
 	dtpm_init(&dtpm_cpu->dtpm, &dtpm_ops);
 	dtpm_cpu->cpu = cpu;
@@ -239,7 +230,6 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
 	if (ret < 0)
 		goto out_dtpm_unregister;
 
-	cpufreq_cpu_put(policy);
 	return 0;
 
 out_dtpm_unregister:
@@ -251,8 +241,6 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
 		per_cpu(dtpm_per_cpu, cpu) = NULL;
 	kfree(dtpm_cpu);
 
-release_policy:
-	cpufreq_cpu_put(policy);
 	return ret;
 }
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 10/12] thermal: imx: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (8 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 09/12] powercap: dtpm_cpu: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 11/12] thermal/drivers/ti-soc-thermal: " Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 12/12] PM: EM: " Zihuan Zhang
  11 siblings, 0 replies; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/thermal/imx_thermal.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 38c993d1bcb3..8d5fd5ca39da 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -201,7 +201,6 @@ static struct thermal_soc_data thermal_imx7d_data = {
 
 struct imx_thermal_data {
 	struct device *dev;
-	struct cpufreq_policy *policy;
 	struct thermal_zone_device *tz;
 	struct thermal_cooling_device *cdev;
 	struct regmap *tempmon;
@@ -541,22 +540,20 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
 static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
 {
 	struct device_node *np;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
 	int ret = 0;
 
-	data->policy = cpufreq_cpu_get(0);
-	if (!data->policy) {
+	if (!policy) {
 		pr_debug("%s: CPUFreq policy not found\n", __func__);
 		return -EPROBE_DEFER;
 	}
 
-	np = of_get_cpu_node(data->policy->cpu, NULL);
+	np = of_get_cpu_node(policy->cpu, NULL);
 
 	if (!np || !of_property_present(np, "#cooling-cells")) {
 		data->cdev = cpufreq_cooling_register(data->policy);
-		if (IS_ERR(data->cdev)) {
+		if (IS_ERR(data->cdev))
 			ret = PTR_ERR(data->cdev);
-			cpufreq_cpu_put(data->policy);
-		}
 	}
 
 	of_node_put(np);
@@ -567,7 +564,6 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
 static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)
 {
 	cpufreq_cooling_unregister(data->cdev);
-	cpufreq_cpu_put(data->policy);
 }
 
 #else
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 11/12] thermal/drivers/ti-soc-thermal: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (9 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 10/12] thermal: imx: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-01  8:57 ` [PATCH v3 12/12] PM: EM: " Zihuan Zhang
  11 siblings, 0 replies; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0cf0826b805a..daea718291a6 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -27,7 +27,6 @@
 
 /* common data structures */
 struct ti_thermal_data {
-	struct cpufreq_policy *policy;
 	struct thermal_zone_device *ti_thermal;
 	struct thermal_zone_device *pcb_tz;
 	struct thermal_cooling_device *cool_dev;
@@ -218,6 +217,7 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
 {
 	struct ti_thermal_data *data;
 	struct device_node *np = bgp->dev->of_node;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
 
 	/*
 	 * We are assuming here that if one deploys the zone
@@ -234,8 +234,7 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
 	if (!data)
 		return -EINVAL;
 
-	data->policy = cpufreq_cpu_get(0);
-	if (!data->policy) {
+	if (!policy) {
 		pr_debug("%s: CPUFreq policy not found\n", __func__);
 		return -EPROBE_DEFER;
 	}
@@ -246,7 +245,6 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
 		int ret = PTR_ERR(data->cool_dev);
 		dev_err(bgp->dev, "Failed to register cpu cooling device %d\n",
 			ret);
-		cpufreq_cpu_put(data->policy);
 
 		return ret;
 	}
@@ -261,11 +259,8 @@ int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
 
 	data = ti_bandgap_get_sensor_data(bgp, id);
 
-	if (!IS_ERR_OR_NULL(data)) {
+	if (!IS_ERR_OR_NULL(data))
 		cpufreq_cooling_unregister(data->cool_dev);
-		if (data->policy)
-			cpufreq_cpu_put(data->policy);
-	}
 
 	return 0;
 }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v3 12/12] PM: EM: Use scope-based cleanup helper
  2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
                   ` (10 preceding siblings ...)
  2025-09-01  8:57 ` [PATCH v3 11/12] thermal/drivers/ti-soc-thermal: " Zihuan Zhang
@ 2025-09-01  8:57 ` Zihuan Zhang
  2025-09-02 15:57   ` Krzysztof Kozlowski
  11 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-01  8:57 UTC (permalink / raw)
  To: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel, Zihuan Zhang

Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 kernel/power/energy_model.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index ea7995a25780..852d48039ce2 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -451,7 +451,7 @@ static void
 em_cpufreq_update_efficiencies(struct device *dev, struct em_perf_state *table)
 {
 	struct em_perf_domain *pd = dev->em_pd;
-	struct cpufreq_policy *policy;
+	struct cpufreq_policy *policy __free(put_cpufreq_policy);
 	int found = 0;
 	int i, cpu;
 
@@ -479,8 +479,6 @@ em_cpufreq_update_efficiencies(struct device *dev, struct em_perf_state *table)
 			found++;
 	}
 
-	cpufreq_cpu_put(policy);
-
 	if (!found)
 		return;
 
@@ -787,21 +785,20 @@ static void em_check_capacity_update(void)
 
 	/* Check if CPUs capacity has changed than update EM */
 	for_each_possible_cpu(cpu) {
-		struct cpufreq_policy *policy;
+		struct cpufreq_policy *policy __free(put_cpufreq_policy) =
+			cpufreq_cpu_get(cpu);
 		struct em_perf_domain *pd;
 		struct device *dev;
 
 		if (cpumask_test_cpu(cpu, cpu_done_mask))
 			continue;
 
-		policy = cpufreq_cpu_get(cpu);
 		if (!policy) {
 			pr_debug("Accessing cpu%d policy failed\n", cpu);
 			schedule_delayed_work(&em_update_work,
 					      msecs_to_jiffies(1000));
 			break;
 		}
-		cpufreq_cpu_put(policy);
 
 		dev = get_cpu_device(cpu);
 		pd = em_pd_get(dev);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper
  2025-09-01  8:57 ` [PATCH v3 03/12] cpufreq: intel_pstate: " Zihuan Zhang
@ 2025-09-01 15:17   ` Rafael J. Wysocki
  2025-09-02 10:32     ` Zihuan Zhang
  0 siblings, 1 reply; 25+ messages in thread
From: Rafael J. Wysocki @ 2025-09-01 15:17 UTC (permalink / raw)
  To: Zihuan Zhang
  Cc: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy, Ben Horgan, zhenglifeng, Zhang Rui,
	Len Brown, Lukasz Luba, Pengutronix Kernel Team, Beata Michalska,
	Fabio Estevam, Pavel Machek, Sumit Gupta, Prasanna Kumar T S M,
	Sudeep Holla, Yicong Yang, linux-pm, linux-acpi, linuxppc-dev,
	linux-arm-kernel, intel-gfx, dri-devel, imx, linux-omap,
	linux-kernel

On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>
> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
> annotation for policy references. This reduces the risk of reference
> counting mistakes and aligns the code with the latest kernel style.
>
> No functional change intended.
>
> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
> ---
>  drivers/cpufreq/intel_pstate.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index f366d35c5840..4abc1ef2d2b0 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
>
>  static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
>  {
> -       struct cpufreq_policy *policy __free(put_cpufreq_policy);
> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
>
> -       policy = cpufreq_cpu_get(cpudata->cpu);
>         if (!policy)
>                 return false;

The structure of the code is intentional here and there's no reason to
change it.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper
  2025-09-01 15:17   ` Rafael J. Wysocki
@ 2025-09-02 10:32     ` Zihuan Zhang
  2025-09-02 11:47       ` Rafael J. Wysocki
  0 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-02 10:32 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Viresh Kumar, Catalin Marinas, Will Deacon, Borislav Petkov,
	Dave Hansen, Srinivas Pandruvada, Michael Ellerman,
	Krzysztof Kozlowski, Alim Akhtar, Thierry Reding, MyungJoo Ham,
	Kyungmin Park, Chanwoo Choi, Jani Nikula, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Simona Vetter, Daniel Lezcano,
	Sascha Hauer, Shawn Guo, Eduardo Valentin, Keerthy, Ben Horgan,
	zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel


在 2025/9/1 23:17, Rafael J. Wysocki 写道:
> On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
>> annotation for policy references. This reduces the risk of reference
>> counting mistakes and aligns the code with the latest kernel style.
>>
>> No functional change intended.
>>
>> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
>> ---
>>   drivers/cpufreq/intel_pstate.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
>> index f366d35c5840..4abc1ef2d2b0 100644
>> --- a/drivers/cpufreq/intel_pstate.c
>> +++ b/drivers/cpufreq/intel_pstate.c
>> @@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
>>
>>   static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
>>   {
>> -       struct cpufreq_policy *policy __free(put_cpufreq_policy);
>> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
>>
>> -       policy = cpufreq_cpu_get(cpudata->cpu);
>>          if (!policy)
>>                  return false;
> The structure of the code is intentional here and there's no reason to
> change it.


Got it. Thanks for clarifying.

So for this case the current structure is intentional -

should I also avoid similar changes in other drivers?



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper
  2025-09-02 10:32     ` Zihuan Zhang
@ 2025-09-02 11:47       ` Rafael J. Wysocki
  2025-09-03  0:51         ` Zihuan Zhang
  0 siblings, 1 reply; 25+ messages in thread
From: Rafael J. Wysocki @ 2025-09-02 11:47 UTC (permalink / raw)
  To: Zihuan Zhang
  Cc: Rafael J. Wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy, Ben Horgan, zhenglifeng, Zhang Rui,
	Len Brown, Lukasz Luba, Pengutronix Kernel Team, Beata Michalska,
	Fabio Estevam, Pavel Machek, Sumit Gupta, Prasanna Kumar T S M,
	Sudeep Holla, Yicong Yang, linux-pm, linux-acpi, linuxppc-dev,
	linux-arm-kernel, intel-gfx, dri-devel, imx, linux-omap,
	linux-kernel

On Tue, Sep 2, 2025 at 12:33 PM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>
>
> 在 2025/9/1 23:17, Rafael J. Wysocki 写道:
> > On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
> >> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
> >> annotation for policy references. This reduces the risk of reference
> >> counting mistakes and aligns the code with the latest kernel style.
> >>
> >> No functional change intended.
> >>
> >> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
> >> ---
> >>   drivers/cpufreq/intel_pstate.c | 8 +++-----
> >>   1 file changed, 3 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> >> index f366d35c5840..4abc1ef2d2b0 100644
> >> --- a/drivers/cpufreq/intel_pstate.c
> >> +++ b/drivers/cpufreq/intel_pstate.c
> >> @@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
> >>
> >>   static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
> >>   {
> >> -       struct cpufreq_policy *policy __free(put_cpufreq_policy);
> >> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
> >>
> >> -       policy = cpufreq_cpu_get(cpudata->cpu);
> >>          if (!policy)
> >>                  return false;
> > The structure of the code is intentional here and there's no reason to
> > change it.
>
>
> Got it. Thanks for clarifying.
>
> So for this case the current structure is intentional -

Note that I'm talking about this particular change only.  The other
change in the $subject patch is fine.

> should I also avoid similar changes in other drivers?

That depends on who maintains them, which is why I wanted you to split
the patch into smaller changes in the first place.

My personal view is that code formatting changes, which effectively is
what this particular one is, are pointless unless they make the code
much easier to follow.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 12/12] PM: EM: Use scope-based cleanup helper
  2025-09-01  8:57 ` [PATCH v3 12/12] PM: EM: " Zihuan Zhang
@ 2025-09-02 15:57   ` Krzysztof Kozlowski
  2025-09-03  2:12     ` Zihuan Zhang
  0 siblings, 1 reply; 25+ messages in thread
From: Krzysztof Kozlowski @ 2025-09-02 15:57 UTC (permalink / raw)
  To: Zihuan Zhang, Rafael J . wysocki, Viresh Kumar, Catalin Marinas,
	Will Deacon, Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Alim Akhtar, Thierry Reding, MyungJoo Ham,
	Kyungmin Park, Chanwoo Choi, Jani Nikula, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Simona Vetter, Daniel Lezcano,
	Sascha Hauer, Shawn Guo, Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel

On 01/09/2025 10:57, Zihuan Zhang wrote:
> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
> annotation for policy references. This reduces the risk of reference
> counting mistakes and aligns the code with the latest kernel style.
> 
> No functional change intended.
> 
> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
> ---
>  kernel/power/energy_model.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
> index ea7995a25780..852d48039ce2 100644
> --- a/kernel/power/energy_model.c
> +++ b/kernel/power/energy_model.c
> @@ -451,7 +451,7 @@ static void
>  em_cpufreq_update_efficiencies(struct device *dev, struct em_perf_state *table)
>  {
>  	struct em_perf_domain *pd = dev->em_pd;
> -	struct cpufreq_policy *policy;
> +	struct cpufreq_policy *policy __free(put_cpufreq_policy);

You are not improving the source code here. This is not how to use
__free() and you clearly do not understand the source code.

What's more, you did not use standard tools which would tell you this is
buggy and wrong.

Don't introduce cleanup.h if you do not understand how it works.
Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 04/12] cpufreq: longhaul: Use scope-based cleanup helper
  2025-09-01  8:57 ` [PATCH v3 04/12] cpufreq: longhaul: " Zihuan Zhang
@ 2025-09-02 15:58   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2025-09-02 15:58 UTC (permalink / raw)
  To: Zihuan Zhang, Rafael J . wysocki, Viresh Kumar, Catalin Marinas,
	Will Deacon, Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Alim Akhtar, Thierry Reding, MyungJoo Ham,
	Kyungmin Park, Chanwoo Choi, Jani Nikula, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Simona Vetter, Daniel Lezcano,
	Sascha Hauer, Shawn Guo, Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel

On 01/09/2025 10:57, Zihuan Zhang wrote:
>  static void __exit longhaul_exit(void)
>  {
> -	struct cpufreq_policy *policy = cpufreq_cpu_get(0);
> +	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
>  	int i;
>  
>  	for (i = 0; i < numscales; i++) {
> @@ -968,7 +968,6 @@ static void __exit longhaul_exit(void)
>  		}
>  	}
>  
> -	cpufreq_cpu_put(policy);

You are not improving any code here.


Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 08/12] cpufreq: powerpc: macintosh: Use scope-based cleanup helper
  2025-09-01  8:57 ` [PATCH v3 08/12] cpufreq: powerpc: macintosh: " Zihuan Zhang
@ 2025-09-02 15:59   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2025-09-02 15:59 UTC (permalink / raw)
  To: Zihuan Zhang, Rafael J . wysocki, Viresh Kumar, Catalin Marinas,
	Will Deacon, Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Alim Akhtar, Thierry Reding, MyungJoo Ham,
	Kyungmin Park, Chanwoo Choi, Jani Nikula, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Simona Vetter, Daniel Lezcano,
	Sascha Hauer, Shawn Guo, Eduardo Valentin, Keerthy
  Cc: Ben Horgan, zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel

On 01/09/2025 10:57, Zihuan Zhang wrote:
> +	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
>  	struct wf_control *clamp;
>  	struct device *dev;
>  	int ret;
>  
> -	policy = cpufreq_cpu_get(0);
>  	if (!policy) {
>  		pr_warn("%s: cpufreq policy not found cpu0\n", __func__);
>  		return -EPROBE_DEFER;
> @@ -79,8 +78,6 @@ static int __init wf_cpufreq_clamp_init(void)
>  	ret = freq_qos_add_request(&policy->constraints, &qos_req, FREQ_QOS_MAX,
>  				   max_freq);
>  
> -	cpufreq_cpu_put(policy);
> -
Not much improvement. Previously this was simple code, easy to grasp.
Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper
  2025-09-02 11:47       ` Rafael J. Wysocki
@ 2025-09-03  0:51         ` Zihuan Zhang
  2025-09-03 11:04           ` Rafael J. Wysocki
  0 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-03  0:51 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Viresh Kumar, Catalin Marinas, Will Deacon, Borislav Petkov,
	Dave Hansen, Srinivas Pandruvada, Michael Ellerman,
	Krzysztof Kozlowski, Alim Akhtar, Thierry Reding, MyungJoo Ham,
	Kyungmin Park, Chanwoo Choi, Jani Nikula, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Simona Vetter, Daniel Lezcano,
	Sascha Hauer, Shawn Guo, Eduardo Valentin, Keerthy, Ben Horgan,
	zhenglifeng, Zhang Rui, Len Brown, Lukasz Luba,
	Pengutronix Kernel Team, Beata Michalska, Fabio Estevam,
	Pavel Machek, Sumit Gupta, Prasanna Kumar T S M, Sudeep Holla,
	Yicong Yang, linux-pm, linux-acpi, linuxppc-dev, linux-arm-kernel,
	intel-gfx, dri-devel, imx, linux-omap, linux-kernel


在 2025/9/2 19:47, Rafael J. Wysocki 写道:
> On Tue, Sep 2, 2025 at 12:33 PM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>>
>> 在 2025/9/1 23:17, Rafael J. Wysocki 写道:
>>> On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>>>> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
>>>> annotation for policy references. This reduces the risk of reference
>>>> counting mistakes and aligns the code with the latest kernel style.
>>>>
>>>> No functional change intended.
>>>>
>>>> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
>>>> ---
>>>>    drivers/cpufreq/intel_pstate.c | 8 +++-----
>>>>    1 file changed, 3 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
>>>> index f366d35c5840..4abc1ef2d2b0 100644
>>>> --- a/drivers/cpufreq/intel_pstate.c
>>>> +++ b/drivers/cpufreq/intel_pstate.c
>>>> @@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
>>>>
>>>>    static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
>>>>    {
>>>> -       struct cpufreq_policy *policy __free(put_cpufreq_policy);
>>>> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
>>>>
>>>> -       policy = cpufreq_cpu_get(cpudata->cpu);
>>>>           if (!policy)
>>>>                   return false;
>>> The structure of the code is intentional here and there's no reason to
>>> change it.
>>
>> Got it. Thanks for clarifying.
>>
>> So for this case the current structure is intentional -
> Note that I'm talking about this particular change only.  The other
> change in the $subject patch is fine.
>
>> should I also avoid similar changes in other drivers?
> That depends on who maintains them, which is why I wanted you to split
> the patch into smaller changes in the first place.
>
> My personal view is that code formatting changes, which effectively is
> what this particular one is, are pointless unless they make the code
> much easier to follow.


UnderStood, Thanks!



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 12/12] PM: EM: Use scope-based cleanup helper
  2025-09-02 15:57   ` Krzysztof Kozlowski
@ 2025-09-03  2:12     ` Zihuan Zhang
  2025-09-03  6:11       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 25+ messages in thread
From: Zihuan Zhang @ 2025-09-03  2:12 UTC (permalink / raw)
  To: krzk
  Cc: airlied, alim.akhtar, beata.michalska, ben.horgan, bp,
	catalin.marinas, cw00.choi, daniel.lezcano, dave.hansen,
	dri-devel, edubezval, festevam, imx, intel-gfx, j-keerthy,
	jani.nikula, kernel, kyungmin.park, lenb, linux-acpi,
	linux-arm-kernel, linux-kernel, linux-omap, linux-pm,
	linuxppc-dev, lukasz.luba, mpe, myungjoo.ham, pavel, ptsm, rafael,
	rodrigo.vivi, rui.zhang, s.hauer, shawnguo, simona,
	srinivas.pandruvada, sudeep.holla, sumitg, thierry.reding,
	tursulin, viresh.kumar, will, yangyicong, zhangzihuan,
	zhenglifeng1

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=yes, Size: 851 bytes --]

> You are not improving the source code here. This is not how to use
>  __free() and you clearly do not understand the source code.

Sorry for the problem, policy should be assigned after cpumask_test_cpu().

I actually realized earlier that __free() only frees at the end of the variable’s lifetime. 
I had suggested using a braced macro in cpufreq.h to allow immediate release after use, 
but I understand the maintainer’s advice to “keep it simple” and will follow that.

> What's more, you did not use standard tools which would tell you this is
> buggy and wrong.

Could you please let me know which standard tools you recommend for detecting such issues? 

I’d like to use them to avoid similar mistakes in the future.

> Don't introduce cleanup.h if you do not understand how it works.

Should I drop this patch?


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 12/12] PM: EM: Use scope-based cleanup helper
  2025-09-03  2:12     ` Zihuan Zhang
@ 2025-09-03  6:11       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2025-09-03  6:11 UTC (permalink / raw)
  To: Zihuan Zhang
  Cc: airlied, alim.akhtar, beata.michalska, ben.horgan, bp,
	catalin.marinas, cw00.choi, daniel.lezcano, dave.hansen,
	dri-devel, edubezval, festevam, imx, intel-gfx, j-keerthy,
	jani.nikula, kernel, kyungmin.park, lenb, linux-acpi,
	linux-arm-kernel, linux-kernel, linux-omap, linux-pm,
	linuxppc-dev, lukasz.luba, mpe, myungjoo.ham, pavel, ptsm, rafael,
	rodrigo.vivi, rui.zhang, s.hauer, shawnguo, simona,
	srinivas.pandruvada, sudeep.holla, sumitg, thierry.reding,
	tursulin, viresh.kumar, will, yangyicong, zhenglifeng1

On 03/09/2025 04:12, Zihuan Zhang wrote:
>> You are not improving the source code here. This is not how to use
>>  __free() and you clearly do not understand the source code.
> 
> Sorry for the problem, policy should be assigned after cpumask_test_cpu().
> 
> I actually realized earlier that __free() only frees at the end of the variable’s lifetime. 
> I had suggested using a braced macro in cpufreq.h to allow immediate release after use, 
> but I understand the maintainer’s advice to “keep it simple” and will follow that.
> 
>> What's more, you did not use standard tools which would tell you this is
>> buggy and wrong.
> 
> Could you please let me know which standard tools you recommend for detecting such issues? 
> 
> I’d like to use them to avoid similar mistakes in the future.
All standard tools used for kernel development, sparse, smatch, clang,
coccinelle, see my talk from OSSE25.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper
  2025-09-03  0:51         ` Zihuan Zhang
@ 2025-09-03 11:04           ` Rafael J. Wysocki
  0 siblings, 0 replies; 25+ messages in thread
From: Rafael J. Wysocki @ 2025-09-03 11:04 UTC (permalink / raw)
  To: Zihuan Zhang
  Cc: Rafael J. Wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy, Ben Horgan, zhenglifeng, Zhang Rui,
	Len Brown, Lukasz Luba, Pengutronix Kernel Team, Beata Michalska,
	Fabio Estevam, Pavel Machek, Sumit Gupta, Prasanna Kumar T S M,
	Sudeep Holla, Yicong Yang, linux-pm, linux-acpi, linuxppc-dev,
	linux-arm-kernel, intel-gfx, dri-devel, imx, linux-omap,
	linux-kernel

On Wed, Sep 3, 2025 at 2:51 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>
>
> 在 2025/9/2 19:47, Rafael J. Wysocki 写道:
> > On Tue, Sep 2, 2025 at 12:33 PM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
> >>
> >> 在 2025/9/1 23:17, Rafael J. Wysocki 写道:
> >>> On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
> >>>> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
> >>>> annotation for policy references. This reduces the risk of reference
> >>>> counting mistakes and aligns the code with the latest kernel style.
> >>>>
> >>>> No functional change intended.
> >>>>
> >>>> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
> >>>> ---
> >>>>    drivers/cpufreq/intel_pstate.c | 8 +++-----
> >>>>    1 file changed, 3 insertions(+), 5 deletions(-)
> >>>>
> >>>> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> >>>> index f366d35c5840..4abc1ef2d2b0 100644
> >>>> --- a/drivers/cpufreq/intel_pstate.c
> >>>> +++ b/drivers/cpufreq/intel_pstate.c
> >>>> @@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
> >>>>
> >>>>    static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
> >>>>    {
> >>>> -       struct cpufreq_policy *policy __free(put_cpufreq_policy);
> >>>> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
> >>>>
> >>>> -       policy = cpufreq_cpu_get(cpudata->cpu);
> >>>>           if (!policy)
> >>>>                   return false;
> >>> The structure of the code is intentional here and there's no reason to
> >>> change it.
> >>
> >> Got it. Thanks for clarifying.
> >>
> >> So for this case the current structure is intentional -
> > Note that I'm talking about this particular change only.  The other
> > change in the $subject patch is fine.
> >
> >> should I also avoid similar changes in other drivers?
> > That depends on who maintains them, which is why I wanted you to split
> > the patch into smaller changes in the first place.
> >
> > My personal view is that code formatting changes, which effectively is
> > what this particular one is, are pointless unless they make the code
> > much easier to follow.
>
>
> UnderStood, Thanks!

Although I think that it would be cleaner to move the code executed in
each step of the for_each_possible_cpu() loop to a separate function.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 02/12] ACPI: processor: thermal: Use scope-based cleanup helper
  2025-09-01  8:57 ` [PATCH v3 02/12] ACPI: processor: thermal: " Zihuan Zhang
@ 2025-09-03 11:07   ` Rafael J. Wysocki
  0 siblings, 0 replies; 25+ messages in thread
From: Rafael J. Wysocki @ 2025-09-03 11:07 UTC (permalink / raw)
  To: Zihuan Zhang
  Cc: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy, Ben Horgan, zhenglifeng, Zhang Rui,
	Len Brown, Lukasz Luba, Pengutronix Kernel Team, Beata Michalska,
	Fabio Estevam, Pavel Machek, Sumit Gupta, Prasanna Kumar T S M,
	Sudeep Holla, Yicong Yang, linux-pm, linux-acpi, linuxppc-dev,
	linux-arm-kernel, intel-gfx, dri-devel, imx, linux-omap,
	linux-kernel

On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>
> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
> annotation for policy references. This reduces the risk of reference
> counting mistakes and aligns the code with the latest kernel style.
>
> No functional change intended.
>
> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
> ---
>  drivers/acpi/processor_thermal.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
> index 1219adb11ab9..3c8b57df9619 100644
> --- a/drivers/acpi/processor_thermal.c
> +++ b/drivers/acpi/processor_thermal.c
> @@ -62,19 +62,14 @@ static int phys_package_first_cpu(int cpu)
>         return 0;
>  }
>
> -static int cpu_has_cpufreq(unsigned int cpu)
> +static bool cpu_has_cpufreq(unsigned int cpu)
>  {
> -       struct cpufreq_policy *policy;
> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
>
>         if (!acpi_processor_cpufreq_init)
>                 return 0;
>
> -       policy = cpufreq_cpu_get(cpu);
> -       if (policy) {
> -               cpufreq_cpu_put(policy);
> -               return 1;
> -       }
> -       return 0;
> +       return !!policy;
>  }
>
>  static int cpufreq_get_max_state(unsigned int cpu)
> @@ -95,7 +90,6 @@ static int cpufreq_get_cur_state(unsigned int cpu)
>
>  static int cpufreq_set_cur_state(unsigned int cpu, int state)
>  {
> -       struct cpufreq_policy *policy;
>         struct acpi_processor *pr;
>         unsigned long max_freq;
>         int i, ret;
> @@ -111,6 +105,9 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
>          * frequency.
>          */
>         for_each_online_cpu(i) {

I would still prefer the code below to be moved to a separate function
that would be called in each step of the for_each_online_cpu() loop.

> +               struct cpufreq_policy *policy __free(put_cpufreq_policy) =
> +                       cpufreq_cpu_get(i);
> +
>                 if (topology_physical_package_id(i) !=
>                     topology_physical_package_id(cpu))
>                         continue;
> @@ -120,15 +117,12 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
>                 if (unlikely(!freq_qos_request_active(&pr->thermal_req)))
>                         continue;
>
> -               policy = cpufreq_cpu_get(i);
>                 if (!policy)
>                         return -EINVAL;
>
>                 max_freq = (policy->cpuinfo.max_freq *
>                             (100 - reduction_step(i) * cpufreq_thermal_reduction_pctg)) / 100;
>
> -               cpufreq_cpu_put(policy);
> -
>                 ret = freq_qos_update_request(&pr->thermal_req, max_freq);
>                 if (ret < 0) {
>                         pr_warn("Failed to update thermal freq constraint: CPU%d (%d)\n",
> --
> 2.25.1
>
>


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v3 09/12] powercap: dtpm_cpu: Use scope-based cleanup helper
  2025-09-01  8:57 ` [PATCH v3 09/12] powercap: dtpm_cpu: " Zihuan Zhang
@ 2025-09-03 11:43   ` Rafael J. Wysocki
  0 siblings, 0 replies; 25+ messages in thread
From: Rafael J. Wysocki @ 2025-09-03 11:43 UTC (permalink / raw)
  To: Zihuan Zhang
  Cc: Rafael J . wysocki, Viresh Kumar, Catalin Marinas, Will Deacon,
	Borislav Petkov, Dave Hansen, Srinivas Pandruvada,
	Michael Ellerman, Krzysztof Kozlowski, Alim Akhtar,
	Thierry Reding, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Jani Nikula, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Daniel Lezcano, Sascha Hauer, Shawn Guo,
	Eduardo Valentin, Keerthy, Ben Horgan, zhenglifeng, Zhang Rui,
	Len Brown, Lukasz Luba, Pengutronix Kernel Team, Beata Michalska,
	Fabio Estevam, Pavel Machek, Sumit Gupta, Prasanna Kumar T S M,
	Sudeep Holla, Yicong Yang, linux-pm, linux-acpi, linuxppc-dev,
	linux-arm-kernel, intel-gfx, dri-devel, imx, linux-omap,
	linux-kernel

On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>
> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
> annotation for policy references. This reduces the risk of reference
> counting mistakes and aligns the code with the latest kernel style.
>
> No functional change intended.
>
> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
> ---
>  drivers/powercap/dtpm_cpu.c | 26 +++++++-------------------
>  1 file changed, 7 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c
> index 99390ec1481f..5e18438782f8 100644
> --- a/drivers/powercap/dtpm_cpu.c
> +++ b/drivers/powercap/dtpm_cpu.c
> @@ -144,19 +144,15 @@ static int update_pd_power_uw(struct dtpm *dtpm)
>  static void pd_release(struct dtpm *dtpm)
>  {
>         struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm);
> -       struct cpufreq_policy *policy;
> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(dtpm_cpu->cpu);
>
>         if (freq_qos_request_active(&dtpm_cpu->qos_req))
>                 freq_qos_remove_request(&dtpm_cpu->qos_req);
>
> -       policy = cpufreq_cpu_get(dtpm_cpu->cpu);

Since policy is not needed earlier, you may as well declare it here.

> -       if (policy) {
> +       if (policy)
>                 for_each_cpu(dtpm_cpu->cpu, policy->related_cpus)
>                         per_cpu(dtpm_per_cpu, dtpm_cpu->cpu) = NULL;
>
> -               cpufreq_cpu_put(policy);
> -       }
> -
>         kfree(dtpm_cpu);
>  }
>
> @@ -192,7 +188,7 @@ static int cpuhp_dtpm_cpu_online(unsigned int cpu)
>  static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
>  {
>         struct dtpm_cpu *dtpm_cpu;
> -       struct cpufreq_policy *policy;
> +       struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
>         struct em_perf_state *table;
>         struct em_perf_domain *pd;
>         char name[CPUFREQ_NAME_LEN];
> @@ -202,21 +198,16 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
>         if (dtpm_cpu)
>                 return 0;
>
> -       policy = cpufreq_cpu_get(cpu);

Ditto.

>         if (!policy)
>                 return 0;
>
>         pd = em_cpu_get(cpu);
> -       if (!pd || em_is_artificial(pd)) {
> -               ret = -EINVAL;
> -               goto release_policy;
> -       }
> +       if (!pd || em_is_artificial(pd))
> +               return -EINVAL;
>
>         dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL);
> -       if (!dtpm_cpu) {
> -               ret = -ENOMEM;
> -               goto release_policy;
> -       }
> +       if (!dtpm_cpu)
> +               return -ENOMEM;
>
>         dtpm_init(&dtpm_cpu->dtpm, &dtpm_ops);
>         dtpm_cpu->cpu = cpu;
> @@ -239,7 +230,6 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
>         if (ret < 0)
>                 goto out_dtpm_unregister;
>
> -       cpufreq_cpu_put(policy);
>         return 0;
>
>  out_dtpm_unregister:
> @@ -251,8 +241,6 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
>                 per_cpu(dtpm_per_cpu, cpu) = NULL;
>         kfree(dtpm_cpu);
>
> -release_policy:
> -       cpufreq_cpu_put(policy);
>         return ret;
>  }
>
> --


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2025-09-03 12:47 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01  8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
2025-09-01  8:57 ` [PATCH v3 01/12] arm64: topology: Use scope-based cleanup helper Zihuan Zhang
2025-09-01  8:57 ` [PATCH v3 02/12] ACPI: processor: thermal: " Zihuan Zhang
2025-09-03 11:07   ` Rafael J. Wysocki
2025-09-01  8:57 ` [PATCH v3 03/12] cpufreq: intel_pstate: " Zihuan Zhang
2025-09-01 15:17   ` Rafael J. Wysocki
2025-09-02 10:32     ` Zihuan Zhang
2025-09-02 11:47       ` Rafael J. Wysocki
2025-09-03  0:51         ` Zihuan Zhang
2025-09-03 11:04           ` Rafael J. Wysocki
2025-09-01  8:57 ` [PATCH v3 04/12] cpufreq: longhaul: " Zihuan Zhang
2025-09-02 15:58   ` Krzysztof Kozlowski
2025-09-01  8:57 ` [PATCH v3 05/12] cpufreq: powernv: " Zihuan Zhang
2025-09-01  8:57 ` [PATCH v3 06/12] PM / devfreq: " Zihuan Zhang
2025-09-01  8:57 ` [PATCH v3 07/12] drm/i915: " Zihuan Zhang
2025-09-01  8:57 ` [PATCH v3 08/12] cpufreq: powerpc: macintosh: " Zihuan Zhang
2025-09-02 15:59   ` Krzysztof Kozlowski
2025-09-01  8:57 ` [PATCH v3 09/12] powercap: dtpm_cpu: " Zihuan Zhang
2025-09-03 11:43   ` Rafael J. Wysocki
2025-09-01  8:57 ` [PATCH v3 10/12] thermal: imx: " Zihuan Zhang
2025-09-01  8:57 ` [PATCH v3 11/12] thermal/drivers/ti-soc-thermal: " Zihuan Zhang
2025-09-01  8:57 ` [PATCH v3 12/12] PM: EM: " Zihuan Zhang
2025-09-02 15:57   ` Krzysztof Kozlowski
2025-09-03  2:12     ` Zihuan Zhang
2025-09-03  6:11       ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).