Skip to content

Commit

Permalink
Backport thermal driver fix for Broadwell-DE (sonic-net#12)
Browse files Browse the repository at this point in the history
This patch is a backport from linux 4.13
  • Loading branch information
Staphylo authored and lguohan committed May 4, 2018
1 parent 060e06f commit a21a592
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 595536e0b2475a9eac23709cd461143178c12e0e Mon Sep 17 00:00:00 2001
From: Ed Swierk <eswierk@skyportsystems.com>
Date: Wed, 19 Jul 2017 17:44:40 -0700
Subject: [PATCH] thermal: intel_pch_thermal: Fix enable check on Broadwell-DE

Using the TSDSS flag to determine whether the thermal sensor is
enabled is problematic. Broadwell-DE (Xeon D-1500) does not support
dynamic shutdown and the TSDSS flag always reads 0 (contrary to the
current datasheet). Even on hardware supporting dynamic shutdown, the
driver does nothing to configure it, and the dynamic shutdown state
should not prevent the driver from loading. The ETS flag itself
indicates whether the thermal sensor is enabled, so use it instead of
the TSDSS flag on all hardware platforms.

Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/thermal/intel_pch_thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/intel_pch_thermal.c b/drivers/thermal/intel_pch_thermal.c
index 9e8fb782b521..c60b1cfcc64e 100644
--- a/drivers/thermal/intel_pch_thermal.c
+++ b/drivers/thermal/intel_pch_thermal.c
@@ -125,7 +125,7 @@ static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
*nr_trips = 0;

/* Check if BIOS has already enabled thermal sensor */
- if (WPT_TSS_TSDSS & readb(ptd->hw_base + WPT_TSS)) {
+ if (WPT_TSEL_ETS & readb(ptd->hw_base + WPT_TSEL)) {
ptd->bios_enabled = true;
goto read_trips;
}
@@ -141,7 +141,7 @@ static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
}

writeb(tsel|WPT_TSEL_ETS, ptd->hw_base + WPT_TSEL);
- if (!(WPT_TSS_TSDSS & readb(ptd->hw_base + WPT_TSS))) {
+ if (!(WPT_TSEL_ETS & readb(ptd->hw_base + WPT_TSEL))) {
dev_err(&ptd->pdev->dev, "Sensor can't be enabled\n");
return -ENODEV;
}
--
2.17.0

1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ config-optoe.patch
0018-platform-x86-mlx-platform-fix-module-aliases.patch
0019-platform-x86-mlx-platform-Add-bus-detection-and-diff.patch
0020-i2c-busses-Add-capabilities-to-i2c-mlxcpld.patch
linux-4.13-thermal-intel_pch_thermal-Fix-enable-check-on.patch
#
# This series applies on GIT commit 1451b36b2b0d62178e42f648d8a18131af18f7d8
# Tkernel-sched-core-fix-cgroup-fork-race.patch
Expand Down

0 comments on commit a21a592

Please sign in to comment.