]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 May 2018 17:40:02 +0000 (10:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 May 2018 17:40:02 +0000 (10:40 -0700)
added patches:
acpi-button-make-module-loadable-when-booted-in-non-acpi-mode.patch

queue-4.14/acpi-button-make-module-loadable-when-booted-in-non-acpi-mode.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/acpi-button-make-module-loadable-when-booted-in-non-acpi-mode.patch b/queue-4.14/acpi-button-make-module-loadable-when-booted-in-non-acpi-mode.patch
new file mode 100644 (file)
index 0000000..368eaa4
--- /dev/null
@@ -0,0 +1,60 @@
+From ac1e55b1fdb27c1b07a0a6fe519f1291ff1e7d40 Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Date: Mon, 23 Apr 2018 11:16:56 +0200
+Subject: ACPI / button: make module loadable when booted in non-ACPI mode
+
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+
+commit ac1e55b1fdb27c1b07a0a6fe519f1291ff1e7d40 upstream.
+
+Modules such as nouveau.ko and i915.ko have a link time dependency on
+acpi_lid_open(), and due to its use of acpi_bus_register_driver(),
+the button.ko module that provides it is only loadable when booted in
+ACPI mode. However, the ACPI button driver can be built into the core
+kernel as well, in which case the dependency can always be satisfied,
+and the dependent modules can be loaded regardless of whether the
+system was booted in ACPI mode or not.
+
+So let's fix this asymmetry by making the ACPI button driver loadable
+as a module even if not booted in ACPI mode, so it can provide the
+acpi_lid_open() symbol in the same way as when built into the kernel.
+
+Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+[ rjw: Minor adjustments of comments, whitespace and names. ]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/button.c |   24 +++++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+--- a/drivers/acpi/button.c
++++ b/drivers/acpi/button.c
+@@ -595,4 +595,26 @@ module_param_call(lid_init_state,
+                 NULL, 0644);
+ MODULE_PARM_DESC(lid_init_state, "Behavior for reporting LID initial state");
+-module_acpi_driver(acpi_button_driver);
++static int acpi_button_register_driver(struct acpi_driver *driver)
++{
++      /*
++       * Modules such as nouveau.ko and i915.ko have a link time dependency
++       * on acpi_lid_open(), and would therefore not be loadable on ACPI
++       * capable kernels booted in non-ACPI mode if the return value of
++       * acpi_bus_register_driver() is returned from here with ACPI disabled
++       * when this driver is built as a module.
++       */
++      if (acpi_disabled)
++              return 0;
++
++      return acpi_bus_register_driver(driver);
++}
++
++static void acpi_button_unregister_driver(struct acpi_driver *driver)
++{
++      if (!acpi_disabled)
++              acpi_bus_unregister_driver(driver);
++}
++
++module_driver(acpi_button_driver, acpi_button_register_driver,
++             acpi_button_unregister_driver);
index f6ef6b82520ff9cb25c528d0ab6686c881aa16d1..89cb8b8f102381923493f740eea92f345916e2e4 100644 (file)
@@ -574,3 +574,4 @@ bluetooth-btusb-add-device-id-for-rtl8822be.patch
 kdb-make-mdr-command-repeat.patch
 xhci-show-what-usb-release-number-the-xhc-supports-from-protocol-capablity.patch
 crypto-talitos-fix-ipsec-cipher-in-length.patch
+acpi-button-make-module-loadable-when-booted-in-non-acpi-mode.patch