mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 03:10:15 -04:00
zenpower3: add patch to fix amd_pci_dev_to_node_id() no longer
available since kernel 6.14 * also add use KV_FULL to detect the kernel to 0.2.0 Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
From 07dd08e27ecd4580040a9acf2c1d3b910cf23131 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Gon=C3=A7alo=20Negrier=20Duarte?=
|
||||
<gonegrier.duarte@gmail.com>
|
||||
Date: Tue, 29 Apr 2025 13:40:28 +0100
|
||||
Subject: [PATCH] zenpower3: use KV_FULL to detect kernel version.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 0dcb668..b24c7be 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,5 +1,5 @@
|
||||
VERSION := 0.2.0
|
||||
-TARGET := $(shell uname -r)
|
||||
+TARGET := ${KV_FULL}
|
||||
DKMS_ROOT_PATH := /usr/src/zenpower-$(VERSION)
|
||||
|
||||
KERNEL_MODULES := /lib/modules/$(TARGET)
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From c3f5b941864c978f39e91199abc8b8445924c8b3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Gon=C3=A7alo=20Negrier=20Duarte?=
|
||||
<gonegrier.duarte@gmail.com>
|
||||
Date: Tue, 29 Apr 2025 13:47:47 +0100
|
||||
Subject: [PATCH] Implement amd_pci_dev_to_node_id from Kernel 6.14
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
|
||||
---
|
||||
zenpower.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/zenpower.c b/zenpower.c
|
||||
index 6d47732..dedba5c 100644
|
||||
--- a/zenpower.c
|
||||
+++ b/zenpower.c
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <linux/hwmon.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
+#include <linux/version.h>
|
||||
#include <asm/amd_nb.h>
|
||||
|
||||
MODULE_DESCRIPTION("AMD ZEN family CPU Sensors Driver");
|
||||
@@ -150,6 +151,13 @@ static const struct tctl_offset tctl_offset_table[] = {
|
||||
static DEFINE_MUTEX(nb_smu_ind_mutex);
|
||||
static bool multicpu = false;
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)
|
||||
+static u16 amd_pci_dev_to_node_id(struct pci_dev *pdev)
|
||||
+{
|
||||
+ return PCI_SLOT(pdev->devfn) - AMD_NODE0_PCI_SLOT;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static umode_t zenpower_is_visible(const void *rdata,
|
||||
enum hwmon_sensor_types type,
|
||||
u32 attr, int channel)
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@@ -16,7 +16,7 @@ if [[ ${PV} == "9999" ]]; then
|
||||
# Mantain fork of zenpower3
|
||||
EGIT_REPO_URI="https://github.com/koweda/zenpower3"
|
||||
else
|
||||
SRC_URI="https://github.com/koweda/zenpower3/archive/v0.2.0.tar.gz -> ${P}.tar.gz"
|
||||
SRC_URI="https://github.com/koweda/zenpower3/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
S="${WORKDIR}/${P}"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
@@ -26,6 +26,11 @@ SLOT="0"
|
||||
|
||||
CONFIG_CHECK="HWMON PCI AMD_NB"
|
||||
|
||||
PATCHES="
|
||||
${FILESDIR}/${P}-use-symlink-to-detect-kernel-version.patch
|
||||
${FILESDIR}/${PN}-amd_pci_dev_to_node_id-kernel-6.14.patch
|
||||
"
|
||||
|
||||
src_compile() {
|
||||
MODULES_MAKEARGS+=(
|
||||
TARGET="${KV_FULL}"
|
||||
@@ -16,7 +16,7 @@ if [[ ${PV} == "9999" ]]; then
|
||||
# Mantain fork of zenpower3
|
||||
EGIT_REPO_URI="https://github.com/koweda/zenpower3"
|
||||
else
|
||||
SRC_URI="https://github.com/koweda/zenpower3/archive/v0.2.0.tar.gz -> ${P}.tar.gz"
|
||||
SRC_URI="https://github.com/koweda/zenpower3/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
S="${WORKDIR}/${P}"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
@@ -26,7 +26,10 @@ SLOT="0"
|
||||
|
||||
CONFIG_CHECK="HWMON PCI AMD_NB"
|
||||
|
||||
PATCHES="${FILESDIR}/${PN}-use-symlink-to-detect-kernel-version.patch"
|
||||
PATCHES="
|
||||
${FILESDIR}/${P}-use-symlink-to-detect-kernel-version.patch
|
||||
${FILESDIR}/${PN}-amd_pci_dev_to_node_id-kernel-6.14.patch
|
||||
"
|
||||
|
||||
src_compile() {
|
||||
MODULES_MAKEARGS+=(
|
||||
|
||||
Reference in New Issue
Block a user