aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/fam15h_power.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index f77eb971ce95..4f695d8fcafa 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -90,7 +90,15 @@ static ssize_t show_power(struct device *dev,
90 pci_bus_read_config_dword(f4->bus, PCI_DEVFN(PCI_SLOT(f4->devfn), 5), 90 pci_bus_read_config_dword(f4->bus, PCI_DEVFN(PCI_SLOT(f4->devfn), 5),
91 REG_TDP_LIMIT3, &val); 91 REG_TDP_LIMIT3, &val);
92 92
93 tdp_limit = val >> 16; 93 /*
94 * On Carrizo and later platforms, ApmTdpLimit bit field
95 * is extended to 16:31 from 16:28.
96 */
97 if (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model >= 0x60)
98 tdp_limit = val >> 16;
99 else
100 tdp_limit = (val >> 16) & 0x1fff;
101
94 curr_pwr_watts = ((u64)(tdp_limit + 102 curr_pwr_watts = ((u64)(tdp_limit +
95 data->base_tdp)) << running_avg_range; 103 data->base_tdp)) << running_avg_range;
96 curr_pwr_watts -= running_avg_capture; 104 curr_pwr_watts -= running_avg_capture;