All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: intel_pch_thermal: Fix enable check on Broadwell-DE
@ 2017-07-20  0:44 Ed Swierk
  2017-08-14 23:39 ` Pandruvada, Srinivas
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Swierk @ 2017-07-20  0:44 UTC (permalink / raw)
  To: linux-pm, linux-kernel, tushar.n.dave; +Cc: Ed Swierk

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>
---
 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 2b49e8d..9889c90 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;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] thermal: intel_pch_thermal: Fix enable check on Broadwell-DE
  2017-07-20  0:44 [PATCH] thermal: intel_pch_thermal: Fix enable check on Broadwell-DE Ed Swierk
@ 2017-08-14 23:39 ` Pandruvada, Srinivas
  0 siblings, 0 replies; 2+ messages in thread
From: Pandruvada, Srinivas @ 2017-08-14 23:39 UTC (permalink / raw)
  To: linux-kernel, eswierk, linux-pm

On Wed, 2017-07-19 at 17:44 -0700, Ed Swierk wrote:
> 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>

> ---
>  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 2b49e8d..9889c90 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;
>  	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-14 23:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-20  0:44 [PATCH] thermal: intel_pch_thermal: Fix enable check on Broadwell-DE Ed Swierk
2017-08-14 23:39 ` Pandruvada, Srinivas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.