linux/drivers/acpi
Lv Zheng 419b1d21b3 ACPI / osi: Fix an issue that acpi_osi=!* cannot disable ACPICA internal strings
commit 30c9bb0d76 upstream.

The order of the _OSI related functionalities is as follows:

  acpi_blacklisted()
    acpi_dmi_osi_linux()
      acpi_osi_setup()
    acpi_osi_setup()
      acpi_update_interfaces() if "!*"
      <<<<<<<<<<<<<<<<<<<<<<<<
  parse_args()
    __setup("acpi_osi=")
      acpi_osi_setup_linux()
        acpi_update_interfaces() if "!*"
        <<<<<<<<<<<<<<<<<<<<<<<<
  acpi_early_init()
    acpi_initialize_subsystem()
      acpi_ut_initialize_interfaces()
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  acpi_bus_init()
    acpi_os_initialize1()
      acpi_install_interface_handler(acpi_osi_handler)
      acpi_osi_setup_late()
        acpi_update_interfaces() for "!"
        >>>>>>>>>>>>>>>>>>>>>>>>
  acpi_osi_handler()

Since acpi_osi_setup_linux() can override acpi_dmi_osi_linux(), the command
line setting can override the DMI detection. That's why acpi_blacklisted()
is put before __setup("acpi_osi=").

Then we can notice the following wrong invocation order. There are
acpi_update_interfaces() (marked by <<<<) calls invoked before
acpi_ut_initialize_interfaces() (marked by ^^^^). This makes it impossible
to use acpi_osi=!* correctly from OSI DMI table or from the command line.
The use of acpi_osi=!* is meant to disable both ACPICA
(acpi_gbl_supported_interfaces) and Linux specific strings
(osi_setup_entries) while the ACPICA part should have stopped working
because of the order issue.

This patch fixes this issue by moving acpi_update_interfaces() to where
it is invoked for acpi_osi=! (marked by >>>>) as this is ensured to be
invoked after acpi_ut_initialize_interfaces() (marked by ^^^^). Linux
specific strings are still handled in the original place in order to make
the following command line working: acpi_osi=!* acpi_osi="Module Device".

Note that since acpi_osi=!* is meant to further disable linux specific
string comparing to the acpi_osi=!, there is no such use case in our bug
fixing work and hence there is no one using acpi_osi=!* either from the
command line or from the DMI quirks, this issue is just a theoretical
issue.

Fixes: 741d81280a (ACPI: Add facility to remove all _OSI strings)
Tested-by: Lukas Wunner <lukas@wunner.de>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-01 12:15:50 -07:00
..
acpica ACPICA: Dispatcher: Update thread ID for recursive method calls 2016-05-11 11:21:20 +02:00
apei
pmic
ac.c
acpi_apd.c
acpi_cmos_rtc.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpss.c
acpi_memhotplug.c
acpi_pad.c
acpi_platform.c device property: ACPI: Make use of the new DMA Attribute APIs 2015-11-07 01:29:22 +01:00
acpi_pnp.c
acpi_processor.c ACPI / processor: Request native thermal interrupt handling via _OSC 2016-05-11 11:21:26 +02:00
acpi_video.c ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830 2016-03-03 15:07:24 -08:00
battery.c
battery.h
bgrt.c
blacklist.c
bus.c ACPI / processor: Request native thermal interrupt handling via _OSC 2016-05-11 11:21:26 +02:00
button.c
cm_sbs.c
container.c
cppc_acpi.c Merge branches 'pm-cpufreq' and 'acpi-cppc' 2015-11-20 01:22:10 +01:00
custom_method.c
debugfs.c
device_pm.c
device_sysfs.c ACPI / property: avoid leaking format string into kobject name 2016-01-08 01:01:41 +01:00
dock.c
ec_sys.c
ec.c ACPI-EC: Drop unnecessary check made before calling acpi_ec_delete_query() 2015-11-16 23:29:44 +01:00
event.c
fan.c
glue.c Merge branch 'acpi-pci' 2015-11-07 01:30:10 +01:00
gsi.c
hed.c
int340x_thermal.c
internal.h ACPI / processor: Request native thermal interrupt handling via _OSC 2016-05-11 11:21:26 +02:00
ioapic.c
Kconfig Merge branches 'acpica', 'acpi-video' and 'device-properties' 2015-12-04 14:01:17 +01:00
Makefile
nfit.c nfit: fix multi-interface dimm handling, acpi6.1 compatibility 2016-03-03 15:07:24 -08:00
nfit.h nfit: Adjust for different _FIT and NFIT headers 2015-11-30 14:51:46 -08:00
numa.c
nvs.c
osl.c ACPI / osi: Fix an issue that acpi_osi=!* cannot disable ACPICA internal strings 2016-06-01 12:15:50 -07:00
pci_irq.c Revert "PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()" 2016-04-20 15:42:16 +09:00
pci_link.c
pci_root.c x86/PCI/ACPI: Fix regression caused by commit 4d6b4e69a2 2015-12-02 02:30:15 +01:00
pci_slot.c
power.c
proc.c
processor_core.c
processor_driver.c ACPI / processor: Fix thermal cooling device regression 2015-12-21 03:41:49 +01:00
processor_idle.c
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c
property.c
reboot.c
resource.c PCI: ACPI: IA64: fix IO port generic range check 2016-04-12 09:08:37 -07:00
sbs.c
sbshc.c Revert "ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook" 2015-11-16 23:26:45 +01:00
sbshc.h
scan.c Merge branch 'acpi-pci' 2015-11-07 01:30:10 +01:00
sleep.c ACPI / PM: Runtime resume devices when waking from hibernate 2016-04-12 09:09:03 -07:00
sleep.h
sysfs.c ACPI / sysfs: correctly check failing memory allocation 2015-10-26 04:57:27 +01:00
tables.c
thermal.c
utils.c
video_detect.c ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist" 2016-03-03 15:07:24 -08:00
wakeup.c