linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-pm@vger.kernel.org
Subject: [Bug 220013] [REGRESSION, BISECTED] acpi-cpufreq: Boost disablement not being restored after resume from suspend
Date: Wed, 16 Apr 2025 04:53:31 +0000	[thread overview]
Message-ID: <bug-220013-137361-4WZ6ZlBP5V@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-220013-137361@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=220013

--- Comment #3 from Nicholas Chin (nic.c3.14@gmail.com) ---
(In reply to Viresh Kumar from comment #2)
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index 924314cdeebc..d8599ae7922f 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -538,6 +538,7 @@ static int cpufreq_boost_down_prep(unsigned int cpu)
>          * Clear the boost-disable bit on the CPU_DOWN path so that
>          * this cpu cannot block the remaining ones from boosting.
>          */
> +       policy->boost_enabled = true;
>         return boost_set_msr(1);
>  }
> 
> Can you try this change please ?

The suggested change fails to compile with the following error:

drivers/cpufreq/acpi-cpufreq.c: In function ‘cpufreq_boost_down_prep’:          
drivers/cpufreq/acpi-cpufreq.c:541:9: error: ‘policy’ undeclared (first use in
this function)                                                                  
  541 |         policy->boost_enabled = true;                                   
      |         ^~~~~~                                                          
drivers/cpufreq/acpi-cpufreq.c:541:9: note: each undeclared identifier is
reported only once for each function it appears in
make[4]: *** [scripts/Makefile.build:203: drivers/cpufreq/acpi-cpufreq.o] Error
1
make[3]: *** [scripts/Makefile.build:461: drivers/cpufreq] Error 2
make[3]: *** Waiting for unfinished jobs....

since policy is not a global variable and is normally passed as a pointer to
the various functions in acpi-cpufreq.c.

It appears that cpufreq_boost_down_prep() is only called in
acpi_cpufreq_cpu_exit(), so I tried the following which should be functionally
the same as the previously suggested change:

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 924314cdeebc..36e2ff3188c9 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -931,6 +931,7 @@ static void acpi_cpufreq_cpu_exit(struct cpufreq_policy
*policy)

        pr_debug("%s\n", __func__);

+       policy->boost_enabled = true;
        cpufreq_boost_down_prep(policy->cpu);
        policy->fast_switch_possible = false;
        policy->driver_data = NULL;

With this change, boost disablement is restored after resume from suspend.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.

  parent reply	other threads:[~2025-04-16  4:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15  4:36 [Bug 220013] New: [REGRESSION, BISECTED] acpi-cpufreq: Boost disablement not being restored after resume from suspend bugzilla-daemon
2025-04-15  4:39 ` [Bug 220013] " bugzilla-daemon
2025-04-15  8:42 ` bugzilla-daemon
2025-04-15 10:27 ` bugzilla-daemon
2025-04-16  4:53 ` bugzilla-daemon [this message]
2025-04-16  5:35 ` bugzilla-daemon
2025-04-17  5:00 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-220013-137361-4WZ6ZlBP5V@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).