]> git.sur5r.net Git - groeck-k10temp/commitdiff
Use API function to access SMN for family 17h testing
authorGuenter Roeck <linux@roeck-us.net>
Sat, 28 Apr 2018 19:54:19 +0000 (12:54 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 28 Apr 2018 19:55:52 +0000 (12:55 -0700)
SMN is also accessed by EDAC code and needs to be synchronized
to avoid race conditions.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
k10temp.c

index 746ca8225713b8697ce8d9efecb5a9375e9a0881..94c4a04d22c9adf6a8d9d389828e599eb90c6838 100644 (file)
--- a/k10temp.c
+++ b/k10temp.c
@@ -23,6 +23,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <asm/amd_nb.h>
 #include <asm/processor.h>
 #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)