Accepting request 972196 from Base:System

- boo#1198000: Add Ryzen compatability fixes:
  * Add powertop-ryzen1.patch 
  * Add powertop-ryzen2.patch

OBS-URL: https://build.opensuse.org/request/show/972196
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/powertop?expand=0&rev=57
This commit is contained in:
Dominique Leuenberger 2022-04-22 19:55:06 +00:00 committed by Git OBS Bridge
commit 0f3915b908
4 changed files with 78 additions and 1 deletions

26
powertop-ryzen1.patch Normal file
View File

@ -0,0 +1,26 @@
From 798eb463d419941fa014ada1f863d769650351c7 Mon Sep 17 00:00:00 2001
From: simewu <simeonwuthier@gmail.com>
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=="" ? "&nbsp;" : tmp_str);
idx2+=1;

39
powertop-ryzen2.patch Normal file
View File

@ -0,0 +1,39 @@
From 5b5212d7d6e8e00925a18dc92adf0ee95249143a Mon Sep 17 00:00:00 2001
From: Jorge Hermo Gonzalez <jorge.hermo.gonzalez@udc.es>
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=="" ? "&nbsp;" : tmp_str);

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Apr 20 08:14:19 UTC 2022 - Michael Vetter <mvetter@suse.com>
- boo#1198000: Add Ryzen compatability fixes:
* Add powertop-ryzen1.patch
* Add powertop-ryzen2.patch
-------------------------------------------------------------------
Thu Nov 11 09:41:32 UTC 2021 - Johannes Segitz <jsegitz@suse.com>

View File

@ -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