From: Pavel Machek <pavel@ucw.cz>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Matthias Kaehlcke <mka@chromium.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux-pm mailing list <linux-pm@vger.kernel.org>,
kernel list <linux-kernel@vger.kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: cpufreq notifiers break suspend -- Re: suspend broken in next-20190704 on Thinkpad X60
Date: Mon, 8 Jul 2019 16:13:02 +0200 [thread overview]
Message-ID: <20190708141302.GA7436@amd> (raw)
In-Reply-To: <20190708092840.ynibtrntval6krc4@vireshk-i7>
[-- Attachment #1: Type: text/plain, Size: 2652 bytes --]
On Mon 2019-07-08 14:58:40, Viresh Kumar wrote:
> 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 ?
I tried to apply it on top of current next
(d58b5ab90ee7528126fd5833df7fc5bda8331ce8, 20190708) and linux-pm-next
(1e2a4c9019eb53f62790fadf86c14a54f4cf4888), but failed due to
whitespace (?!).
Yes, symptoms would be consistent with deadlock on resume.
And yes, the patch seems to fix problem for me.
Tested-by: Pavel Machek <pavel@ucw.cz>
Pavel
> -------------------------8<-------------------------
>
> 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);
> }
> EXPORT_SYMBOL(refresh_frequency_limits);
>
> @@ -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);
> refresh_frequency_limits(policy);
> + up_write(&policy->rwsem);
> }
>
> -------------------------8<-------------------------
>
> 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 :)
Can you test on some x86 ACPI? No dryers needed :-).
> @Rafael: You want me to send a new diff patch with Fixes tag this time
> if this works out fine ?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2019-07-08 14:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 19:20 suspend broken in next-20190704 on Thinkpad X60 Pavel Machek
2019-07-04 22:59 ` Rafael J. Wysocki
2019-07-05 18:50 ` Pavel Machek
2019-07-06 8:33 ` Rafael J. Wysocki
2019-07-06 15:16 ` Pavel Machek
2019-07-06 15:32 ` Pavel Machek
2019-07-06 19:01 ` Pavel Machek
2019-07-06 20:30 ` cpufreq notifiers break suspend -- " Pavel Machek
2019-07-08 3:05 ` Viresh Kumar
2019-07-08 8:28 ` Rafael J. Wysocki
2019-07-08 9:28 ` Viresh Kumar
2019-07-08 10:47 ` Rafael J. Wysocki
2019-07-08 14:13 ` Pavel Machek [this message]
2019-07-09 7:26 ` Viresh Kumar
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=20190708141302.GA7436@amd \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mka@chromium.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sfr@canb.auug.org.au \
--cc=ulf.hansson@linaro.org \
--cc=viresh.kumar@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.