thermal: intel: Prevent accidental clearing of HFI status
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 16 Nov 2022 02:54:16 +0000 (18:54 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 23 Nov 2022 19:09:06 +0000 (20:09 +0100)
commit6fe1e64b60269aa58fa00568807738025ae3bd05
treededc0f013d347d755baa7c6946da0a00d342483b
parente77f069fd6cea822efd15ea79aa61aa6422d4f67
thermal: intel: Prevent accidental clearing of HFI status

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>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/therm_throt.c