platform/x86/amd: pmc: Move out of BIOS SMN pair for STB init
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Sun, 9 Apr 2023 18:53:46 +0000 (00:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:15 +0000 (23:03 +0900)
commit1495945f7c939020e7395cf43bb932aa6eb98638
tree37d4b4af7a3bdffa98f2ce3a2367c76b81de605f
parent1603a098b4747a1dc95b147a1bf91727ef5403b2
platform/x86/amd: pmc: Move out of BIOS SMN pair for STB init

[ Upstream commit 8d99129eef8f42377b41c1bacee9f8ce806e9f44 ]

The current SMN index used for the driver probe seems to be meant
for the BIOS pair and there are potential concurrency problems that can
occur with an inopportune SMI.

It is been advised to use SMN_INDEX_0 instead of SMN_INDEX_6, which is
what amd_nb.c provides and this function has protections to ensure that
only one caller can use it at a time.

Fixes: 426c0ff27b83 ("platform/x86: amd-pmc: Add support for AMD Smart Trace Buffer")
Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20230409185348.556161-7-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/amd/pmc.c