Re: [patch] events/amd/power add support for fam16h model30h

From: Borislav Petkov
Date: Fri Jun 17 2016 - 14:19:16 EST


On Fri, Jun 17, 2016 at 01:38:44PM -0400, Vince Weaver wrote:
> F15hM02h
>
> fam15h_power-pci-00c4
> Adapter: PCI adapter
> power1: 105.64 W (crit = 115.17 W)
>
> fam15h_power-pci-00d4
> Adapter: PCI adapter
> power1: 105.59 W (crit = 115.17 W)

Is that a dual-socket machine?

Because I have only the fam15h_power-pci-00c4 adapter. And mine goes
between 20W and 40W in idle.

> The whole system only uses 167W total at idle (according to a
> wall-outlet power meter), so the two packages each drawing 105W seems
> a bit off.

Or is that an MCM box? I.e., a Multi-node CPU? Because:

Documentation/hwmon/fam15h_power:
"On multi-node processors the calculated value is for the entire package
and not for a single node. Thus the driver creates sysfs attributes only
for internal node0 of a multi-node processor."

And I remember Andreas did that should_load_on_this_node() thing.

If so, then 105W vs 167W should fit.

> I also have a F15hM13h system but it doesn't seem to support TDP
> measurement.

That's Trinity. That PCI device ID is not even in the kernel - I'm
guessing no one has even thought of enabling fam15_power on it. I don't
know even whether it supports the different PCI interfaces like TDP, TDP
limit, etc.

IOW, something like that might not really help.

Rui, you could take a look if you feel bored and if you have a TN system
somewhere lying around.

---
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index eb97a9241d17..b31ef2779aac 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -503,6 +503,7 @@ static int fam15h_power_probe(struct pci_dev *pdev,

static const struct pci_device_id fam15h_power_id_table[] = {
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_F4) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M60H_NB_F4) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M70H_NB_F4) },
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c58752fe16c4..f7385ed3d5f1 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -521,6 +521,7 @@
#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403
+#define PCI_DEVICE_ID_AMD_15H_M10H_F4 0x1404
#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F3 0x141d
#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F4 0x141e
#define PCI_DEVICE_ID_AMD_15H_M60H_NB_F3 0x1573


--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.