diff --git a/powertop-ryzen1.patch b/powertop-ryzen1.patch new file mode 100644 index 0000000..a46ad1e --- /dev/null +++ b/powertop-ryzen1.patch @@ -0,0 +1,26 @@ +From 798eb463d419941fa014ada1f863d769650351c7 Mon Sep 17 00:00:00 2001 +From: simewu +Date: Mon, 27 Sep 2021 18:25:45 -0600 +Subject: [PATCH] Patch for compatibility with Ryzen processors + +--- + src/cpu/cpu.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp +index a92f111..c09cbc5 100644 +--- a/src/cpu/cpu.cpp ++++ b/src/cpu/cpu.cpp +@@ -576,6 +576,12 @@ void report_display_cpu_cstates(void) + } + } + } else { ++ /* ++ * Patch for compatibility with Ryzen processors ++ * See https://github.com/fenrus75/powertop/issues/64 ++ */ ++ if(idx2 >= core_tbl_size.cols * core_tbl_size.rows) break; ++ + tmp_str=string(_core->fill_cstate_name(line, buffer)); + core_data[idx2]=(tmp_str=="" ? " " : tmp_str); + idx2+=1; diff --git a/powertop-ryzen2.patch b/powertop-ryzen2.patch new file mode 100644 index 0000000..78c7e1f --- /dev/null +++ b/powertop-ryzen2.patch @@ -0,0 +1,39 @@ +From 5b5212d7d6e8e00925a18dc92adf0ee95249143a Mon Sep 17 00:00:00 2001 +From: Jorge Hermo Gonzalez +Date: Thu, 4 Nov 2021 10:33:10 +0100 +Subject: [PATCH] Patch for compability with Ryzen processors (v2) + +--- + src/cpu/cpu.cpp | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp +index c09cbc5..1c12765 100644 +--- a/src/cpu/cpu.cpp ++++ b/src/cpu/cpu.cpp +@@ -551,6 +551,12 @@ void report_display_cpu_cstates(void) + if (!_core->can_collapse()) { + buffer[0] = 0; + buffer2[0] = 0; ++ ++ /* ++ * Patch for compatibility with Ryzen processors ++ * See https://github.com/fenrus75/powertop/issues/64 ++ */ ++ if(idx2 >= core_tbl_size.cols * core_tbl_size.rows) break; + + if (line == LEVEL_HEADER) { + /* Here we need to check for which core type we +@@ -576,11 +582,7 @@ void report_display_cpu_cstates(void) + } + } + } else { +- /* +- * Patch for compatibility with Ryzen processors +- * See https://github.com/fenrus75/powertop/issues/64 +- */ +- if(idx2 >= core_tbl_size.cols * core_tbl_size.rows) break; ++ + + tmp_str=string(_core->fill_cstate_name(line, buffer)); + core_data[idx2]=(tmp_str=="" ? " " : tmp_str); diff --git a/powertop.changes b/powertop.changes index 5590d88..625da04 100644 --- a/powertop.changes +++ b/powertop.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Apr 20 08:14:19 UTC 2022 - Michael Vetter + +- boo#1198000: Add Ryzen compatability fixes: + * Add powertop-ryzen1.patch + * Add powertop-ryzen2.patch + ------------------------------------------------------------------- Thu Nov 11 09:41:32 UTC 2021 - Johannes Segitz diff --git a/powertop.spec b/powertop.spec index 266d281..eadadd5 100644 --- a/powertop.spec +++ b/powertop.spec @@ -1,7 +1,7 @@ # # spec file for package powertop # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,6 +25,9 @@ Group: System/Monitoring URL: https://01.org/powertop/ Source0: https://github.com/fenrus75/powertop/archive/v%{version}.tar.gz Source1: powertop.service +# PATCH-FIX-UPSTREAM mvetter@suse.com -- Fix powertop Ryzen issues (bsc#1198000) +Patch0: https://github.com/fenrus75/powertop/commit/798eb463d419941fa014ada1f863d769650351c7.patch#/powertop-ryzen1.patch +Patch1: https://github.com/fenrus75/powertop/commit/5b5212d7d6e8e00925a18dc92adf0ee95249143a.patch#/powertop-ryzen2.patch # they repeatedly forget to upload a release tarball and only have the one from # GitHub which doesnt contain configure thus adding: # autoconf, autoconf-archive, automake, libtool @@ -52,6 +55,8 @@ doing in terms of power savings. %prep %setup -q -n powertop-%{version} +%patch0 -p1 +%patch1 -p1 # Delete objects files left in tarball find . -name '*.o' -delete