lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 8 Jul 2019 14:58:40 +0530
From:   Viresh Kumar <>
To:     Pavel Machek <>,
        "Rafael J. Wysocki" <>
Cc:     Matthias Kaehlcke <>,
        Ulf Hansson <>,
        "Rafael J. Wysocki" <>,
        Linux-pm mailing list <>,
        kernel list <>,
        Stephen Rothwell <>
Subject: Re: cpufreq notifiers break suspend -- Re: suspend broken in
 next-20190704 on Thinkpad X60

On 08-07-19, 10:28, Rafael J. Wysocki wrote:
> Pavel has tested the latest version of the patch series AFAICS.
> The locking added by the commit in question to
> refresh_frequency_limits() requires an update of
> cpufreq_update_policy(), or it will deadlock in there because of the
> lock acquired by cpufreq_cpu_get() if I haven't missed anything.

Ah, looks quite straight forward.

@Pavel: Can you please try this diff ?


diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 9f68d0f306b8..4d6043ee7834 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1109,16 +1109,12 @@ void refresh_frequency_limits(struct cpufreq_policy *policy)
        struct cpufreq_policy new_policy;
-       down_write(&policy->rwsem);
        if (!policy_is_inactive(policy)) {
                new_policy = *policy;
                pr_debug("updating policy for CPU %u\n", policy->cpu);
                cpufreq_set_policy(policy, &new_policy);
-       up_write(&policy->rwsem);
@@ -1128,7 +1124,9 @@ static void handle_update(struct work_struct *work)
                container_of(work, struct cpufreq_policy, update);
        pr_debug("handle_update for cpu %u called\n", policy->cpu);
+       down_write(&policy->rwsem);
+       up_write(&policy->rwsem);

Though it makes me wonder why I didn't hit this thing. I was using the
cpu_cooling device the other day, which calls cpufreq_update_policy()
very frequently on heat-up. And I had a hair dryer blowing over my
board to heat it up. Lemme check that again :)

@Rafael: You want me to send a new diff patch with Fixes tag this time
if this works out fine ?


Powered by blists - more mailing lists