mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] thermal: intel: hfi: Fix memory corruption on resume from hibernation
@ 2023-12-27  6:29 Ricardo Neri
  2023-12-27  6:29 ` [PATCH 1/4] thermal: intel: hfi: Refactor enabling code into helper functions Ricardo Neri
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ricardo Neri @ 2023-12-27  6:29 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Chen Yu, Len Brown, Srinivas Pandruvada, Stanislaw Gruszka,
	Zhang Rui, Zhao Liu, stable, linux-pm, linux-kernel,
	Ricardo Neri

Hi,

Memory corruption may occur if the location of the HFI memory buffer is not
restored when resuming from hibernation or suspend-to-memory.

During a normal boot, the kernel allocates a memory buffer and gives it to
the hardware for reporting updates in the HFI table. The same allocation
process is done by a restore kernel when resuming from suspend or
hibernation.

The location of the memory that the restore kernel allocates may differ
from that allocated by the image kernel. To prevent memory corruption (the
hardware keeps using the memory buffer from the restore kernel), it is
necessary to disable HFI before transferring control to the image kernel.
Once running, the image kernel must restore the location of the HFI memory
and enable HFI.

The patchset addresses the described bug on systems with one or more HFI
instances (i.e., packages) using CPU hotplug callbacks and a suspend
notifier.

I tested this patchset on Meteor Lake and Sapphire Rapids. The systems
completed 3500 (in two separate tests of 1500 and 2000 repeats) and
1000 hibernate-resume cycles, respectively. I tested it using Rafael's
testing branch as on 20th December 2023.

Thanks and BR,
Ricardo

Ricardo Neri (4):
  thermal: intel: hfi: Refactor enabling code into helper functions
  thermal: intel: hfi: Enable an HFI instance from its first online CPU
  thermal: intel: hfi: Disable an HFI instance when all its CPUs go
    offline
  thermal: intel: hfi: Add a suspend notifier

 drivers/thermal/intel/intel_hfi.c | 142 ++++++++++++++++++++++++------
 1 file changed, 116 insertions(+), 26 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2024-01-02  3:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27  6:29 [PATCH 0/4] thermal: intel: hfi: Fix memory corruption on resume from hibernation Ricardo Neri
2023-12-27  6:29 ` [PATCH 1/4] thermal: intel: hfi: Refactor enabling code into helper functions Ricardo Neri
2023-12-29 17:22   ` Rafael J. Wysocki
2024-01-01 23:12     ` Ricardo Neri
2023-12-27  6:29 ` [PATCH 2/4] thermal: intel: hfi: Enable an HFI instance from its first online CPU Ricardo Neri
2023-12-27  6:29 ` [PATCH 3/4] thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline Ricardo Neri
2023-12-27  6:29 ` [PATCH 4/4] thermal: intel: hfi: Add a suspend notifier Ricardo Neri
2023-12-29 17:27   ` Rafael J. Wysocki
2024-01-02  3:40     ` Ricardo Neri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®