From 2c52dee776e51290ded93a9342ac72b93b21b1d3 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sat, 28 Apr 2018 12:54:19 -0700 Subject: [PATCH] Use API function to access SMN for family 17h SMN is also accessed by EDAC code and needs to be synchronized to avoid race conditions. Signed-off-by: Guenter Roeck --- k10temp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/k10temp.c b/k10temp.c index 746ca82..94c4a04 100644 --- a/k10temp.c +++ b/k10temp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "compat.h" @@ -142,8 +143,8 @@ static void read_tempreg_nb_f15(struct pci_dev *pdev, u32 *regval) static void read_tempreg_nb_f17(struct pci_dev *pdev, u32 *regval) { - amd_nb_index_read(pdev, PCI_DEVFN(0, 0), 0x60, - F17H_M01H_REPORTED_TEMP_CTRL_OFFSET, regval); + amd_smn_read(amd_pci_dev_to_node_id(pdev), + F17H_M01H_REPORTED_TEMP_CTRL_OFFSET, regval); } unsigned int get_raw_temp(struct k10temp_data *data) -- 2.39.5