cpufreq: ACPI: Replace udelay() with usleep_range()
PATCH v2 1/1 cpufreq: ACPI: Replace udelay() with usleep_range()
Replace udelay() with usleep_range() in check_freqs() to allow CPU scheduling during frequency polling. This change improves system responsiveness and avoides busy-waiting.
---
v2:
- Tighten sleep range to usleep_range(10, 15) to limit worst-case loop duration to 1.5ms, addressing reviewer concern about increased latency.
- Cleanup commit message
drivers/cpufreq/acpi-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/acpi-cpufreq.c +1 -1
@@ -395,7 +395,7 @@ static unsigned int check_freqs(struct cpufreq_policy *policy, cur_freq =extract_freq (policy,get_cur_val (mask, data));if (cur_freq == freq)return 1 ; -udelay (10 ); +usleep_range (10 ,15 ); }return 0 ; }
Signature · 1 line
2.34.1
Quoted 20 lines · Kaushlendra Kumar
Replace
udelay()withusleep_range()incheck_freqs()to allow CPU scheduling during frequency polling. This change improves system responsiveness and avoides busy-waiting.Signed-off-by Kaushlendra Kumar <[email protected]>---
v2:
- Tighten sleep range tousleep_range(10, 15)to limit worst-case loop duration to 1.5ms, addressing reviewer concern about increased latency.
- Cleanup commit messagedrivers/cpufreq/acpi-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/acpi-cpufreq.c +0
-0
drivers/cpufreq/acpi-cpufreq.c static unsigned int check_freqs(struct cpufreq_policy *policy,
Quoted 9 lines
drivers/cpufreq/acpi-cpufreq.c +1
-2@@ -395,7 +395,7 @@ static unsigned int check_freqs(struct cpufreq_policy *policy, cur_freq =extract_freq (policy,get_cur_val (mask, data));if (cur_freq == freq)return 1 ; -udelay (10 ); +usleep_range (10 ,15 ); }return 0 ; } --
Applied as 6.19 material, thanks!