Skip to content

Commit a21a592

Browse files
Staphylolguohan
authored andcommitted
Backport thermal driver fix for Broadwell-DE (#12)
This patch is a backport from linux 4.13
1 parent 060e06f commit a21a592

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From 595536e0b2475a9eac23709cd461143178c12e0e Mon Sep 17 00:00:00 2001
2+
From: Ed Swierk <[email protected]>
3+
Date: Wed, 19 Jul 2017 17:44:40 -0700
4+
Subject: [PATCH] thermal: intel_pch_thermal: Fix enable check on Broadwell-DE
5+
6+
Using the TSDSS flag to determine whether the thermal sensor is
7+
enabled is problematic. Broadwell-DE (Xeon D-1500) does not support
8+
dynamic shutdown and the TSDSS flag always reads 0 (contrary to the
9+
current datasheet). Even on hardware supporting dynamic shutdown, the
10+
driver does nothing to configure it, and the dynamic shutdown state
11+
should not prevent the driver from loading. The ETS flag itself
12+
indicates whether the thermal sensor is enabled, so use it instead of
13+
the TSDSS flag on all hardware platforms.
14+
15+
Signed-off-by: Ed Swierk <[email protected]>
16+
Reviewed-by: Srinivas Pandruvada <[email protected]>
17+
Signed-off-by: Zhang Rui <[email protected]>
18+
---
19+
drivers/thermal/intel_pch_thermal.c | 4 ++--
20+
1 file changed, 2 insertions(+), 2 deletions(-)
21+
22+
diff --git a/drivers/thermal/intel_pch_thermal.c b/drivers/thermal/intel_pch_thermal.c
23+
index 9e8fb782b521..c60b1cfcc64e 100644
24+
--- a/drivers/thermal/intel_pch_thermal.c
25+
+++ b/drivers/thermal/intel_pch_thermal.c
26+
@@ -125,7 +125,7 @@ static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
27+
*nr_trips = 0;
28+
29+
/* Check if BIOS has already enabled thermal sensor */
30+
- if (WPT_TSS_TSDSS & readb(ptd->hw_base + WPT_TSS)) {
31+
+ if (WPT_TSEL_ETS & readb(ptd->hw_base + WPT_TSEL)) {
32+
ptd->bios_enabled = true;
33+
goto read_trips;
34+
}
35+
@@ -141,7 +141,7 @@ static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
36+
}
37+
38+
writeb(tsel|WPT_TSEL_ETS, ptd->hw_base + WPT_TSEL);
39+
- if (!(WPT_TSS_TSDSS & readb(ptd->hw_base + WPT_TSS))) {
40+
+ if (!(WPT_TSEL_ETS & readb(ptd->hw_base + WPT_TSEL))) {
41+
dev_err(&ptd->pdev->dev, "Sensor can't be enabled\n");
42+
return -ENODEV;
43+
}
44+
--
45+
2.17.0
46+

patch/series

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ config-optoe.patch
4343
0018-platform-x86-mlx-platform-fix-module-aliases.patch
4444
0019-platform-x86-mlx-platform-Add-bus-detection-and-diff.patch
4545
0020-i2c-busses-Add-capabilities-to-i2c-mlxcpld.patch
46+
linux-4.13-thermal-intel_pch_thermal-Fix-enable-check-on.patch
4647
#
4748
# This series applies on GIT commit 1451b36b2b0d62178e42f648d8a18131af18f7d8
4849
# Tkernel-sched-core-fix-cgroup-fork-race.patch

0 commit comments

Comments
 (0)