]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86/amd/pmf: Switch to platform_get_resource() and devm_ioremap_resource()
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Mon, 4 Nov 2024 05:48:29 +0000 (11:18 +0530)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 4 Nov 2024 13:13:45 +0000 (15:13 +0200)
commitba6ad33d5c870d8b1d22388292c872ba4af98ea1
tree4b14f2bdeb6c5abb555113d357d161efbcb7599e
parentac4976a4f8709dc88ba3a4475e41b5682b2fe1d7
platform/x86/amd/pmf: Switch to platform_get_resource() and devm_ioremap_resource()

Use platform_get_resource() to fetch the memory resource instead of
acpi_walk_resources() and devm_ioremap_resource() for mapping the
resources.

PS: We cannot use resource_size() here because it adds an extra byte to
round off the size. In the case of PMF ResourceTemplate(), this rounding
is already handled within the _CRS. Using resource_size() would increase
the resource size by 1, causing a mismatch with the length field and
leading to issues. Therefore, simply use end-start of the ACPI resource to
obtain the actual length.

Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20241104054829.620858-4-Shyam-sundar.S-k@amd.com
[ij: added a cast to resource_size_t printing]
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/amd/pmf/Kconfig
drivers/platform/x86/amd/pmf/acpi.c
drivers/platform/x86/amd/pmf/pmf.h
drivers/platform/x86/amd/pmf/tee-if.c