diff options
author | Rong Zhang <i@rong.moe> | 2025-10-11 00:59:58 +0800 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2025-10-15 21:38:06 +0200 |
commit | e6416c2dfe23c9a6fec881fda22ebb9ae486cfc5 (patch) | |
tree | aeb13b615834aa775084d3a578ca25f4b6f0fcc8 /drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | |
parent | 83b0177a6c4889b3a6e865da5e21b2c9d97d0551 (diff) |
x86/CPU/AMD: Prevent reset reasons from being retained across reboot
The S5_RESET_STATUS register is parsed on boot and printed to kmsg.
However, this could sometimes be misleading and lead to users wasting a
lot of time on meaningless debugging for two reasons:
* Some bits are never cleared by hardware. It's the software's
responsibility to clear them as per the Processor Programming Reference
(see [1]).
* Some rare hardware-initiated platform resets do not update the
register at all.
In both cases, a previous reboot could leave its trace in the register,
resulting in users seeing unrelated reboot reasons while debugging random
reboots afterward.
Write the read value back to the register in order to clear all reason bits
since they are write-1-to-clear while the others must be preserved.
[1]: https://bugzilla.kernel.org/show_bug.cgi?id=206537#attach_303991
[ bp: Massage commit message. ]
Fixes: ab8131028710 ("x86/CPU/AMD: Print the reason for the last reset")
Signed-off-by: Rong Zhang <i@rong.moe>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/all/20250913144245.23237-1-i@rong.moe/
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/mes_userqueue.c')
0 files changed, 0 insertions, 0 deletions