File tree Expand file tree Collapse file tree 7 files changed +18
-26
lines changed Expand file tree Collapse file tree 7 files changed +18
-26
lines changed Original file line number Diff line number Diff line change @@ -1457,33 +1457,35 @@ static struct platform_driver ghes_platform_driver = {
14571457 .remove = ghes_remove ,
14581458};
14591459
1460- static int __init ghes_init (void )
1460+ void __init ghes_init (void )
14611461{
14621462 int rc ;
14631463
1464+ sdei_init ();
1465+
14641466 if (acpi_disabled )
1465- return - ENODEV ;
1467+ return ;
14661468
14671469 switch (hest_disable ) {
14681470 case HEST_NOT_FOUND :
1469- return - ENODEV ;
1471+ return ;
14701472 case HEST_DISABLED :
14711473 pr_info (GHES_PFX "HEST is not enabled!\n" );
1472- return - EINVAL ;
1474+ return ;
14731475 default :
14741476 break ;
14751477 }
14761478
14771479 if (ghes_disable ) {
14781480 pr_info (GHES_PFX "GHES is not enabled!\n" );
1479- return - EINVAL ;
1481+ return ;
14801482 }
14811483
14821484 ghes_nmi_init_cxt ();
14831485
14841486 rc = platform_driver_register (& ghes_platform_driver );
14851487 if (rc )
1486- goto err ;
1488+ return ;
14871489
14881490 rc = apei_osc_setup ();
14891491 if (rc == 0 && osc_sb_apei_support_acked )
@@ -1494,9 +1496,4 @@ static int __init ghes_init(void)
14941496 pr_info (GHES_PFX "APEI firmware first mode is enabled by APEI bit.\n" );
14951497 else
14961498 pr_info (GHES_PFX "Failed to enable APEI firmware first mode.\n" );
1497-
1498- return 0 ;
1499- err :
1500- return rc ;
15011499}
1502- device_initcall (ghes_init );
Original file line number Diff line number Diff line change @@ -1331,6 +1331,8 @@ static int __init acpi_init(void)
13311331
13321332 pci_mmcfg_late_init ();
13331333 acpi_iort_init ();
1334+ acpi_hest_init ();
1335+ ghes_init ();
13341336 acpi_scan_init ();
13351337 acpi_ec_init ();
13361338 acpi_debugfs_init ();
Original file line number Diff line number Diff line change 2222#include <linux/slab.h>
2323#include <linux/dmi.h>
2424#include <linux/platform_data/x86/apple.h>
25- #include <acpi/apei.h> /* for acpi_hest_init() */
26-
2725#include "internal.h"
2826
2927#define ACPI_PCI_ROOT_CLASS "pci_bridge"
@@ -943,7 +941,6 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
943941
944942void __init acpi_pci_root_init (void )
945943{
946- acpi_hest_init ();
947944 if (acpi_pci_disabled )
948945 return ;
949946
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ config ARM_SCPI_POWER_DOMAIN
4040config ARM_SDE_INTERFACE
4141 bool "ARM Software Delegated Exception Interface (SDEI)"
4242 depends on ARM64
43+ depends on ACPI_APEI_GHES
4344 help
4445 The Software Delegated Exception Interface (SDEI) is an ARM
4546 standard for registering callbacks from the platform firmware
Original file line number Diff line number Diff line change @@ -1059,14 +1059,14 @@ static bool __init sdei_present_acpi(void)
10591059 return true;
10601060}
10611061
1062- static int __init sdei_init (void )
1062+ void __init sdei_init (void )
10631063{
10641064 struct platform_device * pdev ;
10651065 int ret ;
10661066
10671067 ret = platform_driver_register (& sdei_driver );
10681068 if (ret || !sdei_present_acpi ())
1069- return ret ;
1069+ return ;
10701070
10711071 pdev = platform_device_register_simple (sdei_driver .driver .name ,
10721072 0 , NULL , 0 );
@@ -1076,17 +1076,8 @@ static int __init sdei_init(void)
10761076 pr_info ("Failed to register ACPI:SDEI platform device %d\n" ,
10771077 ret );
10781078 }
1079-
1080- return ret ;
10811079}
10821080
1083- /*
1084- * On an ACPI system SDEI needs to be ready before HEST:GHES tries to register
1085- * its events. ACPI is initialised from a subsys_initcall(), GHES is initialised
1086- * by device_initcall(). We want to be called in the middle.
1087- */
1088- subsys_initcall_sync (sdei_init );
1089-
10901081int sdei_event_handler (struct pt_regs * regs ,
10911082 struct sdei_registered_event * arg )
10921083{
Original file line number Diff line number Diff line change @@ -27,14 +27,16 @@ extern int hest_disable;
2727extern int erst_disable ;
2828#ifdef CONFIG_ACPI_APEI_GHES
2929extern bool ghes_disable ;
30+ void __init ghes_init (void );
3031#else
3132#define ghes_disable 1
33+ static inline void ghes_init (void ) { }
3234#endif
3335
3436#ifdef CONFIG_ACPI_APEI
3537void __init acpi_hest_init (void );
3638#else
37- static inline void acpi_hest_init (void ) { return ; }
39+ static inline void acpi_hest_init (void ) { }
3840#endif
3941
4042int erst_write (const struct cper_record_header * record );
Original file line number Diff line number Diff line change @@ -46,9 +46,11 @@ int sdei_unregister_ghes(struct ghes *ghes);
4646/* For use by arch code when CPU hotplug notifiers are not appropriate. */
4747int sdei_mask_local_cpu (void );
4848int sdei_unmask_local_cpu (void );
49+ void __init sdei_init (void );
4950#else
5051static inline int sdei_mask_local_cpu (void ) { return 0 ; }
5152static inline int sdei_unmask_local_cpu (void ) { return 0 ; }
53+ static inline void sdei_init (void ) { }
5254#endif /* CONFIG_ARM_SDE_INTERFACE */
5355
5456
You can’t perform that action at this time.
0 commit comments