linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Doug Smythies <dsmythies@telus.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux PM list <linux-pm@vger.kernel.org>
Subject: Re: [PATCH] tools/power/x86/turbostat: Fix TCC offset bit mask
Date: Fri, 12 Mar 2021 17:15:51 -0500	[thread overview]
Message-ID: <CAJvTdKkpbFqDRL9BP3Ri0Yeb0VMXv79dr+C=ym2+GWMRZEEYpw@mail.gmail.com> (raw)
In-Reply-To: <CAAYoRsVYejQRByDz78jbv5cMfd+ctT8N3YxfOBndW8FJiuk9MA@mail.gmail.com>

Doug,
The offset works for control.

However, it is erroneous to use it for reporting of the actual
temperature, like I did in turbostat.
Thus, I'm going to revert the patch that added it's use in turbostat
for the Temperature column.

thanks,
-Len

On Fri, Mar 12, 2021 at 1:26 AM Doug Smythies <dsmythies@telus.net> wrote:
>
> Hi Len,
>
>
> thank you for your reply.
>
> On Thu, Mar 11, 2021 at 3:19 PM Len Brown <lenb@kernel.org> wrote:
> >
> > Thanks for the close read, Doug.
> >
> > This field size actually varies from system to system,
> > but the reality is that the offset is never that big, and so the
> > smaller mask is sufficient.
>
> Disagree.
>
> I want to use an offset of 26.
>
> > Finally, this may all be moot, because there is discussion that using
> > the offset this way is simply erroneous.
>
> Disagree.
> It works great.
> As far as I know/recall I was the only person that responded to Rui's thread
> "thermal/intel: introduce tcc cooling driver" [1]
> And, I spent quite a bit of time doing so.
> However, I agree the response seems different between the two systems
> under test, Rui's and mine.
>
> [1] https://marc.info/?l=linux-pm&m=161070345329806&w=2
>
> >  stay tuned.
>
> O.K.
>
> ... Doug
> >
> > -Len
> >
> >
> > On Sat, Jan 16, 2021 at 12:07 PM Doug Smythies <doug.smythies@gmail.com> wrote:
> > >
> > > The TCC offset mask is incorrect, resulting in
> > > incorrect target temperature calculations, if
> > > the offset is big enough to exceed the mask size.
> > >
> > > Signed-off-by: Doug Smythies <dsmythies@telus.net>
> > > ---
> > >  tools/power/x86/turbostat/turbostat.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> > > index 389ea5209a83..d7acdd4d16c4 100644
> > > --- a/tools/power/x86/turbostat/turbostat.c
> > > +++ b/tools/power/x86/turbostat/turbostat.c
> > > @@ -4823,7 +4823,7 @@ int read_tcc_activation_temp()
> > >
> > >         target_c = (msr >> 16) & 0xFF;
> > >
> > > -       offset_c = (msr >> 24) & 0xF;
> > > +       offset_c = (msr >> 24) & 0x3F;
> > >
> > >         tcc = target_c - offset_c;
> > >
> > > --
> > > 2.25.1
> > >
> >
> >
> > --
> > Len Brown, Intel Open Source Technology Center



-- 
Len Brown, Intel Open Source Technology Center

  reply	other threads:[~2021-03-12 22:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-16 17:07 [PATCH] tools/power/x86/turbostat: Fix TCC offset bit mask Doug Smythies
2021-03-11 23:18 ` Len Brown
2021-03-12  6:26   ` Doug Smythies
2021-03-12 22:15     ` Len Brown [this message]
2021-03-13 15:16       ` Doug Smythies
2021-04-11 14:09         ` Zhang Rui

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='CAJvTdKkpbFqDRL9BP3Ri0Yeb0VMXv79dr+C=ym2+GWMRZEEYpw@mail.gmail.com' \
    --to=lenb@kernel.org \
    --cc=dsmythies@telus.net \
    --cc=linux-kernel@vger.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).