linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 1/2] thermal: intel: Prevent accidental clearing of HFI status
@ 2022-11-16  2:54 Srinivas Pandruvada
  2022-11-16  2:54 ` [PATCH RESEND 2/2] thermal: intel: Protect clearing of thermal status bits Srinivas Pandruvada
  2022-11-18 17:54 ` [PATCH RESEND 1/2] thermal: intel: Prevent accidental clearing of HFI status Rafael J. Wysocki
  0 siblings, 2 replies; 10+ messages in thread
From: Srinivas Pandruvada @ 2022-11-16  2:54 UTC (permalink / raw)
  To: rafael, daniel.lezcano, amitk, rui.zhang
  Cc: linux-pm, linux-kernel, Srinivas Pandruvada, Ricardo Neri

When there is a package thermal interrupt with PROCHOT log, it will be
processed and cleared. It is possible that there is an active HFI event
status, which is about to get processed or getting processed. While
clearing PROCHOT log bit, it will also clear HFI status bit. This means
that hardware is free to update HFI memory.

When clearing a package thermal interrupt, some processors will generate
a "general protection fault" when any of the read only bit is set to 1.
The driver maintains a mask of all read-write bits which can be set.
This mask doesn't include HFI status bit. This bit will also be cleared,
as it will be assumed read-only bit. So, add HFI status bit 26 to the
mask.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
---
Email address was wrong, so sending again.

 drivers/thermal/intel/therm_throt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/therm_throt.c b/drivers/thermal/intel/therm_throt.c
index 8352083b87c7..9e8ab31d756e 100644
--- a/drivers/thermal/intel/therm_throt.c
+++ b/drivers/thermal/intel/therm_throt.c
@@ -197,7 +197,7 @@ static const struct attribute_group thermal_attr_group = {
 #define THERM_STATUS_PROCHOT_LOG	BIT(1)
 
 #define THERM_STATUS_CLEAR_CORE_MASK (BIT(1) | BIT(3) | BIT(5) | BIT(7) | BIT(9) | BIT(11) | BIT(13) | BIT(15))
-#define THERM_STATUS_CLEAR_PKG_MASK  (BIT(1) | BIT(3) | BIT(5) | BIT(7) | BIT(9) | BIT(11))
+#define THERM_STATUS_CLEAR_PKG_MASK  (BIT(1) | BIT(3) | BIT(5) | BIT(7) | BIT(9) | BIT(11) | BIT(26))
 
 static void clear_therm_status_log(int level)
 {
-- 
2.31.1


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

end of thread, other threads:[~2022-11-23 19:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-16  2:54 [PATCH RESEND 1/2] thermal: intel: Prevent accidental clearing of HFI status Srinivas Pandruvada
2022-11-16  2:54 ` [PATCH RESEND 2/2] thermal: intel: Protect clearing of thermal status bits Srinivas Pandruvada
2022-11-18 17:57   ` Rafael J. Wysocki
2022-11-18 19:39     ` srinivas pandruvada
2022-11-18 19:49       ` Rafael J. Wysocki
2022-11-18 20:30         ` srinivas pandruvada
2022-11-18 17:54 ` [PATCH RESEND 1/2] thermal: intel: Prevent accidental clearing of HFI status Rafael J. Wysocki
2022-11-18 19:35   ` srinivas pandruvada
2022-11-18 19:49     ` Rafael J. Wysocki
2022-11-23 19:10       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).