• L
    ACPI / sysfs: Fix an issue for LoadTable opcode · 307ecb0a
    Lv Zheng 提交于
    OEM tables can be installed via RSDT/XSDT, in this case, they have already
    been created under /sys/firmware/acpi/tables.
    
    For this kind of tables, normally LoadTable opcode will be executed to load
    them. If LoadTable opcode is executed after acpi_sysfs_init(),
    acpi_sysfs_table_handler() will be invoked, thus a redundant table file
    will be created under /sys/firmware/acpi/tables/dynamic. Then running
    "acpidump" on such platform results in an error, complaining blank empty
    table (see Link 1 below).
    
    The bug can be reproduced by customizing an OEM1 table, allowing it to be
    overridden via 'table_sigs' (drivers/acpi/tables.c), adding the following
    code to the customized DSDT to load it:
    
      Name (OEMH, Zero)
      Name (OEMF, One)
      If (LEqual (OEMF, One)) {
          Store (LoadTable ("OEM1", "Intel", "Test"), OEMH)
          Store (Zero, OEMF)
      }
    
    In order to make sure that the OEM1 table is installed after
    acpi_sysfs_init(), acpi_sysfs_init() can be moved before invoking
    acpi_load_tables(). Then the following command execution result can be
    seen:
     # acpidump > acpidump.txt
     Could not read table header: /sysfs/firmware/acpi/tables/dynamic/OEM12
     Could not get ACPI table at index 17, AE_BAD_HEADER
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=150841 # [1]
    Link: https://github.com/acpica/acpica/commit/ed6a5fbcReported-by: NJason Voelz <jason.voelz@intel.com>
    Reported-by: NFrancisco Leoner <francisco.j.lenoer.soto@intel.com>
    Signed-off-by: NLv Zheng <lv.zheng@intel.com>
    Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
    307ecb0a
sysfs.c 23.2 KB