From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Xi Ruoyao <xry111@xry111.site>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux PM <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 2/6] cpufreq: intel_pstate: Do not update global.turbo_disabled after initialization
Date: Fri, 07 Jun 2024 08:18:29 -0700 [thread overview]
Message-ID: <4fe39e45c117a976b60dfb37234551391050b199.camel@linux.intel.com> (raw)
In-Reply-To: <CAJZ5v0gvY6FGwhzTKrmNnKc48ixWAgTeT3Sw2tOUfshDwq3NcA@mail.gmail.com>
On Fri, 2024-06-07 at 17:04 +0200, Rafael J. Wysocki wrote:
> On Wed, Jun 5, 2024 at 2:05 PM srinivas pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
> >
> > On Wed, 2024-06-05 at 13:21 +0800, Xi Ruoyao wrote:
> > > On Tue, 2024-06-04 at 09:56 -0700, srinivas pandruvada wrote:
> > > > > > With such a delay, I am not sure how this even worked
> > > > > > before.
> > >
> > > It didn't work out of box but it worked after manually writing 0
> > > to
> > > no_turbo after 20 seconds, see
> > > https://bugzilla.kernel.org/show_bug.cgi?id=218702.
> >
> > That make sense. So it never worked out of box. The
> > store_no_turbo()
> > has additional read for turbo flag before, which is removed now. I
> > think adding that back will will restore old behavior.
> >
> > diff --git a/drivers/cpufreq/intel_pstate.c
> > b/drivers/cpufreq/intel_pstate.c
> > index 4b986c044741..0d5330e5b96b 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -1301,6 +1301,8 @@ static ssize_t store_no_turbo(struct kobject
> > *a,
> > struct kobj_attribute *b,
> >
> > no_turbo = !!clamp_t(int, input, 0, 1);
> >
> > + global.turbo_disabled = turbo_is_disabled();
> > +
> > if (no_turbo == global.no_turbo)
> > goto unlock_driver;
> >
> >
> > Need to adjust the mutex around it also.
>
> Anyhow, it can be made work.
>
> global.turbo_disabled can be updated right before it is checked in
> store_no_turbo(), so if 0 is written to no_turbo (and global.no_turbo
> is 1), it will succeed if global.turbo_disabled changes from 1 to 0.
>
> Something like the attached (untested) patch.
Should work.
Xi,
Please test so that we can close this issue.
Thanks,
Srinivas
next prev parent reply other threads:[~2024-06-07 15:18 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 17:00 [PATCH v1 0/6] intel_pstate: Turbo disabled handling rework Rafael J. Wysocki
2024-03-25 17:01 ` [PATCH v1 1/6] cpufreq: intel_pstate: Fold intel_pstate_max_within_limits() into caller Rafael J. Wysocki
2024-04-01 20:06 ` srinivas pandruvada
2024-03-25 17:02 ` [PATCH v1 2/6] cpufreq: intel_pstate: Do not update global.turbo_disabled after initialization Rafael J. Wysocki
2024-06-02 3:21 ` Xi Ruoyao
2024-06-02 4:03 ` srinivas pandruvada
2024-06-02 4:25 ` Xi Ruoyao
2024-06-02 13:40 ` srinivas pandruvada
2024-06-02 16:07 ` Xi Ruoyao
2024-06-02 23:11 ` srinivas pandruvada
2024-06-03 13:12 ` Xi Ruoyao
2024-06-03 17:11 ` srinivas pandruvada
2024-06-03 17:44 ` Xi Ruoyao
2024-06-03 18:32 ` Rafael J. Wysocki
2024-06-03 18:47 ` srinivas pandruvada
2024-06-04 4:10 ` srinivas pandruvada
2024-06-04 4:31 ` srinivas pandruvada
2024-06-04 9:30 ` Xi Ruoyao
2024-06-04 10:29 ` srinivas pandruvada
2024-06-04 10:32 ` Xi Ruoyao
2024-06-04 16:41 ` srinivas pandruvada
2024-06-04 16:46 ` Rafael J. Wysocki
2024-06-04 16:56 ` srinivas pandruvada
2024-06-05 5:21 ` Xi Ruoyao
2024-06-05 12:05 ` srinivas pandruvada
2024-06-07 15:04 ` Rafael J. Wysocki
2024-06-07 15:18 ` srinivas pandruvada [this message]
2024-06-08 9:30 ` Xi Ruoyao
2024-03-25 17:03 ` [PATCH v1 3/6] cpufreq: intel_pstate: Rearrange show_no_turbo() and store_no_turbo() Rafael J. Wysocki
2024-03-25 17:04 ` [PATCH v1 4/6] cpufreq: intel_pstate: Read global.no_turbo under READ_ONCE() Rafael J. Wysocki
2024-03-25 17:05 ` [PATCH v1 5/6] cpufreq: intel_pstate: Replace three global.turbo_disabled checks Rafael J. Wysocki
2024-03-25 17:06 ` [PATCH v1 6/6] cpufreq: intel_pstate: Update the maximum CPU frequency consistently Rafael J. Wysocki
2024-03-27 18:08 ` srinivas pandruvada
2024-03-28 11:26 ` Rafael J. Wysocki
2024-03-28 19:02 ` [PATCH v1.1 " Rafael J. Wysocki
2024-04-02 8:46 ` [PATCH v1 0/6] intel_pstate: Turbo disabled handling rework srinivas pandruvada
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=4fe39e45c117a976b60dfb37234551391050b199.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=xry111@xry111.site \
/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