ACPI: HED: Always initialize before evged
PATCH v4 1/1 ACPI: HED: Always initialize before evged
When the module HED is built-in, the module HED init is behind EVGED as the driver are in the same initcall level, then the order is determined by Makefile order. That order violates expectations. Because RAS records can't be handled in the special time window that EVGED has initialized while HED not.
If the number of such RAS records is more than the APEI HEST error source number, the HEST resources could be occupied all, and then could affect subsequent RAS error reporting.
Change the initcall level of HED to subsys_init to fix the issue. If build HED as a module, the problem remains. To solve this problem completely, change the ACPI_HED from tristate to bool.
---
-v4: Fix register HED device twice issue found by Nathan, and change
patch name following Rafael's advice.
--- drivers/acpi/Kconfig | 2 +- drivers/acpi/hed.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/acpi/Kconfig +1 -1
@@ -452,7 +452,7 @@ config ACPI_SBS the modules will be called sbs and sbshc. config ACPI_HED - tristate "Hardware Error Device" + bool "Hardware Error Device" help This driver supports the Hardware Error Device (PNP0C33), which is used to report some hardware errors notified via
drivers/acpi/hed.c +6 -1
@@ -80,7 +80,12 @@ static struct acpi_driver acpi_hed_driver = { .remove = acpi_hed_remove, }, }; -module_acpi_driver (acpi_hed_driver); + +static int __init acpi_hed_driver_init (void ) +{ +return acpi_bus_register_driver (&acpi_hed_driver); +} +subsys_initcall (acpi_hed_driver_init);MODULE_AUTHOR ("Huang Ying" );MODULE_DESCRIPTION ("ACPI Hardware Error Device Driver" );
Signature · 1 line
2.33.0
Quoted 46 lines · Xiaofei Tan
When the module HED is built-in, the module HED init is behind EVGED as the driver are in the same initcall level, then the order is determined by
Makefileorder. That order violates expectations. Because RAS records can't be handled in the special time window that EVGED has initialized while HED not.If the number of such RAS records is more than the APEI HEST error source number, the HEST resources could be occupied all, and then could affect subsequent RAS error reporting.
Change the initcall level of HED to
subsys_initto fix the issue. If build HED as a module, the problem remains. To solve this problem completely, change theACPI_HEDfrom tristate to bool.Signed-off-by Xiaofei Tan <[email protected]>---
-v4: Fix register HED device twice issue found by Nathan, and change
patch name following Rafael's advice.--- drivers/acpi/Kconfig | 2 +- drivers/acpi/hed.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-)drivers/acpi/Kconfig +1
-1@@ -452,7 +452,7 @@ config ACPI_SBS the modules will be called sbs and sbshc. config ACPI_HED - tristate "Hardware Error Device" + bool "Hardware Error Device" help This driver supports the Hardware Error Device (PNP0C33), which is used to report some hardware errors notified viadrivers/acpi/hed.c +0
-1@@ -80,7 +80,12 @@ static struct acpi_driver acpi_hed_driver = { .remove = acpi_hed_remove, }, }; -module_acpi_driver (acpi_hed_driver);
drivers/acpi/hed.c static struct acpi_driver acpi_hed_driver = {
Quoted 10 lines
drivers/acpi/hed.c +6
-1+ +static int __init acpi_hed_driver_init (void ) +{ +return acpi_bus_register_driver (&acpi_hed_driver); +} +subsys_initcall (acpi_hed_driver_init);MODULE_AUTHOR ("Huang Ying" );MODULE_DESCRIPTION ("ACPI Hardware Error Device Driver" ); --
Applied as 6.15 material with changelog edits, thanks!