firmware: SDEI: Allow sdei initialization without ACPI_APEI_GHES
[ Upstream commit 59529bbe642de4eb2191a541d9b4bae7eb73862e ] SDEI usually initialize with the ACPI table, but on platforms where ACPI is not used, the SDEI feature can still be used to handle specific firmware calls or other customized purposes. Therefore, it is not necessary for ARM_SDE_INTERFACE to depend on ACPI_APEI_GHES. In commitdc4e8c07e9
("ACPI: APEI: explicit init of HEST and GHES in acpi_init()"), to make APEI ready earlier, sdei_init was moved into acpi_ghes_init instead of being a standalone initcall, adding ACPI_APEI_GHES dependency to ARM_SDE_INTERFACE. This restricts the flexibility and usability of SDEI. This patch corrects the dependency in Kconfig and splits sdei_init() into two separate functions: sdei_init() and acpi_sdei_init(). sdei_init() will be called by arch_initcall and will only initialize the platform driver, while acpi_sdei_init() will initialize the device from acpi_ghes_init() when ACPI is ready. This allows the initialization of SDEI without ACPI_APEI_GHES enabled. Fixes:dc4e8c07e9
("ACPI: APEI: explicit init of HEST and GHES in apci_init()") Cc: Shuai Xue <xueshuai@linux.alibaba.com> Signed-off-by: Huang Yiwei <quic_hyiwei@quicinc.com> Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/20250507045757.2658795-1-quic_hyiwei@quicinc.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3215e000ef
commit
99d4011a0a
@@ -23,6 +23,7 @@ config ACPI_APEI_GHES
|
|||||||
select ACPI_HED
|
select ACPI_HED
|
||||||
select IRQ_WORK
|
select IRQ_WORK
|
||||||
select GENERIC_ALLOCATOR
|
select GENERIC_ALLOCATOR
|
||||||
|
select ARM_SDE_INTERFACE if ARM64
|
||||||
help
|
help
|
||||||
Generic Hardware Error Source provides a way to report
|
Generic Hardware Error Source provides a way to report
|
||||||
platform hardware errors (such as that from chipset). It
|
platform hardware errors (such as that from chipset). It
|
||||||
|
@@ -1523,7 +1523,7 @@ void __init acpi_ghes_init(void)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
sdei_init();
|
acpi_sdei_init();
|
||||||
|
|
||||||
if (acpi_disabled)
|
if (acpi_disabled)
|
||||||
return;
|
return;
|
||||||
|
@@ -40,7 +40,6 @@ config ARM_SCPI_POWER_DOMAIN
|
|||||||
config ARM_SDE_INTERFACE
|
config ARM_SDE_INTERFACE
|
||||||
bool "ARM Software Delegated Exception Interface (SDEI)"
|
bool "ARM Software Delegated Exception Interface (SDEI)"
|
||||||
depends on ARM64
|
depends on ARM64
|
||||||
depends on ACPI_APEI_GHES
|
|
||||||
help
|
help
|
||||||
The Software Delegated Exception Interface (SDEI) is an ARM
|
The Software Delegated Exception Interface (SDEI) is an ARM
|
||||||
standard for registering callbacks from the platform firmware
|
standard for registering callbacks from the platform firmware
|
||||||
|
@@ -1062,13 +1062,12 @@ static bool __init sdei_present_acpi(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init sdei_init(void)
|
void __init acpi_sdei_init(void)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = platform_driver_register(&sdei_driver);
|
if (!sdei_present_acpi())
|
||||||
if (ret || !sdei_present_acpi())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pdev = platform_device_register_simple(sdei_driver.driver.name,
|
pdev = platform_device_register_simple(sdei_driver.driver.name,
|
||||||
@@ -1081,6 +1080,12 @@ void __init sdei_init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int __init sdei_init(void)
|
||||||
|
{
|
||||||
|
return platform_driver_register(&sdei_driver);
|
||||||
|
}
|
||||||
|
arch_initcall(sdei_init);
|
||||||
|
|
||||||
int sdei_event_handler(struct pt_regs *regs,
|
int sdei_event_handler(struct pt_regs *regs,
|
||||||
struct sdei_registered_event *arg)
|
struct sdei_registered_event *arg)
|
||||||
{
|
{
|
||||||
|
@@ -46,12 +46,12 @@ int sdei_unregister_ghes(struct ghes *ghes);
|
|||||||
/* For use by arch code when CPU hotplug notifiers are not appropriate. */
|
/* For use by arch code when CPU hotplug notifiers are not appropriate. */
|
||||||
int sdei_mask_local_cpu(void);
|
int sdei_mask_local_cpu(void);
|
||||||
int sdei_unmask_local_cpu(void);
|
int sdei_unmask_local_cpu(void);
|
||||||
void __init sdei_init(void);
|
void __init acpi_sdei_init(void);
|
||||||
void sdei_handler_abort(void);
|
void sdei_handler_abort(void);
|
||||||
#else
|
#else
|
||||||
static inline int sdei_mask_local_cpu(void) { return 0; }
|
static inline int sdei_mask_local_cpu(void) { return 0; }
|
||||||
static inline int sdei_unmask_local_cpu(void) { return 0; }
|
static inline int sdei_unmask_local_cpu(void) { return 0; }
|
||||||
static inline void sdei_init(void) { }
|
static inline void acpi_sdei_init(void) { }
|
||||||
static inline void sdei_handler_abort(void) { }
|
static inline void sdei_handler_abort(void) { }
|
||||||
#endif /* CONFIG_ARM_SDE_INTERFACE */
|
#endif /* CONFIG_ARM_SDE_INTERFACE */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user