mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kurt Garloff <kurt@garloff.de>
To: Len Brown <len.brown@intel.com>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/1]: turbostat: Fix Pkg Power on Zen
Date: Mon, 1 Feb 2021 10:06:39 +0100	[thread overview]
Message-ID: <cc9628ac-d612-6c7d-6bc1-ac13da980659@garloff.de> (raw)
In-Reply-To: <c7074c16-5d64-e829-10f6-ef91f5f6222b@garloff.de>

commit 5d399d05df42ffcaa2b3836b580631c4024487a0
Author: Kurt Garloff <kurt@garloff.de>
Date:   Mon Feb 1 09:01:47 2021 +0000

    turbostat: Fix Pkg Power tracking on Zen
   
    AMD Zen processors use a different MSR (MSR_PKG_ENERGY_STAT) than intel
    (MSR_PKG_ENERGY_STATUS) to track package power; however we want to record
    it at the same offset in our package_data.
    offset_to_idx() however only recognized the intel MSR, erroring
    out with -13 on Zen.
   
    With this fix, it will support the Zen MSR.
    Tested successfully on Ryzen 3000 & 5000.
   
    Signed-off-by: Kurt Garloff <kurt@garloff.de>

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 389ea5209a83..cb830e73d899 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -325,6 +325,7 @@ int offset_to_idx(int offset)
     int idx;
 
     switch (offset) {
+    case MSR_PKG_ENERGY_STAT:
     case MSR_PKG_ENERGY_STATUS:
         idx = IDX_PKG_ENERGY;
         break;

-- 
Kurt Garloff <kurt@garloff.de>
Cologne, Germany


  reply	other threads:[~2021-02-01  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-26 12:13 Kurt Garloff
2021-02-01  9:01 ` Kurt Garloff
2021-02-01  9:06   ` Kurt Garloff [this message]
2021-03-15 21:54   ` Christian Kastner
2021-03-24 12:37     ` Salvatore Bonaccorso
2021-03-24 14:39       ` Doug Smythies

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=cc9628ac-d612-6c7d-6bc1-ac13da980659@garloff.de \
    --to=kurt@garloff.de \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®