|
| 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 | + |
0 commit comments