Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1187761
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.0 19/58] ACPI / init: Switch over platform to the ACPI mode later |
| Date | 2015-07-19 21:20 +0200 |
| Message-ID | <pO2hY-3q1-43@gated-at.bofh.it> (permalink) |
| References | <pO2hX-3q1-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
commit b064a8fa77dfead647564c46ac8fc5b13bd1ab73 upstream.
Commit 73f7d1ca3263 "ACPI / init: Run acpi_early_init() before
timekeeping_init()" moved the ACPI subsystem initialization,
including the ACPI mode enabling, to an earlier point in the
initialization sequence, to allow the timekeeping subsystem
use ACPI early. Unfortunately, that resulted in boot regressions
on some systems and the early ACPI initialization was moved toward
its original position in the kernel initialization code by commit
c4e1acbb35e4 "ACPI / init: Invoke early ACPI initialization later".
However, that turns out to be insufficient, as boot is still broken
on the Tyan S8812 mainboard.
To fix that issue, split the ACPI early initialization code into
two pieces so the majority of it still located in acpi_early_init()
and the part switching over the platform into the ACPI mode goes into
a new function, acpi_subsystem_init(), executed at the original early
ACPI initialization spot.
That fixes the Tyan S8812 boot problem, but still allows ACPI
tables to be loaded earlier which is useful to the EFI code in
efi_enter_virtual_mode().
Link: https://bugzilla.kernel.org/show_bug.cgi?id=97141
Fixes: 73f7d1ca3263 "ACPI / init: Run acpi_early_init() before timekeeping_init()"
Reported-and-tested-by: Marius Tolzmann <tolzmann@molgen.mpg.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/bus.c | 56 +++++++++++++++++++++++++++++++++++++--------------
include/linux/acpi.h | 2 +
init/main.c | 1
3 files changed, 44 insertions(+), 15 deletions(-)
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -467,6 +467,16 @@ static int __init acpi_bus_init_irq(void
return 0;
}
+/**
+ * acpi_early_init - Initialize ACPICA and populate the ACPI namespace.
+ *
+ * The ACPI tables are accessible after this, but the handling of events has not
+ * been initialized and the global lock is not available yet, so AML should not
+ * be executed at this point.
+ *
+ * Doing this before switching the EFI runtime services to virtual mode allows
+ * the EfiBootServices memory to be freed slightly earlier on boot.
+ */
void __init acpi_early_init(void)
{
acpi_status status;
@@ -530,26 +540,42 @@ void __init acpi_early_init(void)
acpi_gbl_FADT.sci_interrupt = acpi_sci_override_gsi;
}
#endif
+ return;
+
+ error0:
+ disable_acpi();
+}
+
+/**
+ * acpi_subsystem_init - Finalize the early initialization of ACPI.
+ *
+ * Switch over the platform to the ACPI mode (if possible), initialize the
+ * handling of ACPI events, install the interrupt and global lock handlers.
+ *
+ * Doing this too early is generally unsafe, but at the same time it needs to be
+ * done before all things that really depend on ACPI. The right spot appears to
+ * be before finalizing the EFI initialization.
+ */
+void __init acpi_subsystem_init(void)
+{
+ acpi_status status;
+
+ if (acpi_disabled)
+ return;
status = acpi_enable_subsystem(~ACPI_NO_ACPI_ENABLE);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Unable to enable ACPI\n");
- goto error0;
+ disable_acpi();
+ } else {
+ /*
+ * If the system is using ACPI then we can be reasonably
+ * confident that any regulators are managed by the firmware
+ * so tell the regulator core it has everything it needs to
+ * know.
+ */
+ regulator_has_full_constraints();
}
-
- /*
- * If the system is using ACPI then we can be reasonably
- * confident that any regulators are managed by the firmware
- * so tell the regulator core it has everything it needs to
- * know.
- */
- regulator_has_full_constraints();
-
- return;
-
- error0:
- disable_acpi();
- return;
}
static int __init acpi_bus_init(void)
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -428,6 +428,7 @@ extern acpi_status acpi_pci_osc_control_
#define ACPI_OST_SC_INSERT_NOT_SUPPORTED 0x82
extern void acpi_early_init(void);
+extern void acpi_subsystem_init(void);
extern int acpi_nvs_register(__u64 start, __u64 size);
@@ -477,6 +478,7 @@ static inline const char *acpi_dev_name(
}
static inline void acpi_early_init(void) { }
+static inline void acpi_subsystem_init(void) { }
static inline int early_acpi_boot_init(void)
{
--- a/init/main.c
+++ b/init/main.c
@@ -661,6 +661,7 @@ asmlinkage __visible void __init start_k
check_bugs();
+ acpi_subsystem_init();
sfi_init_late();
if (efi_enabled(EFI_RUNTIME_SERVICES)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.0 00/58] 4.0.9-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 36/58] regmap: Fix possible shift overflow in regmap_field_init() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 57/58] of/pci: Fix pci_address_to_pio() conversion of CPU address to I/O port Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 35/58] regmap: Fix regmap_bulk_read in BE mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 22/58] tools selftests: Fix clean target with make 3.81 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 09/58] sysfs: Create mountpoints with sysfs_create_mount_point Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 20/58] ACPI / PM: Add missing pm_generic_complete() invocation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 33/58] mm, thp: respect MPOL_PREFERRED policy with non-local node Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 24/58] ARC: add compiler barrier to LLSC based cmpxchg Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 44/58] scsi_transport_srp: Fix a race condition Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 19/58] ACPI / init: Switch over platform to the ACPI mode later Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 32/58] mm: kmemleak_alloc_percpu() should follow the gfp from per_alloc() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 31/58] mm: kmemleak: allow safe memory scanning during kmemleak disabling Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 18/58] ALSA: hda - Fix the dock headphone output on Fujitsu Lifebook E780 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 23/58] ARC: add smp barriers around atomics per Documentation/atomic_ops.txt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 07/58] mnt: Refactor the logic for mounting sysfs and proc in a user namespace Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 26/58] mei: txe: reduce suspend/resume time Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 15/58] ALSA: hda - Fix Dock Headphone on Thinkpad X250 seen as a Line Out Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 29/58] arm64: mm: Fix freeing of the wrong memmap entries with !SPARSEMEM_VMEMMAP Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 30/58] arm64: vdso: work-around broken ELF toolchains in Makefile Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 25/58] mei: me: wait for power gating exit confirmation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 27/58] arm64: Do not attempt to use init_mm in reset_context() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 28/58] arm64: entry: fix context tracking for el0_sp_pc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 21/58] iio: accel: kxcjk-1013: add the "KXCJ9000" ACPI id Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 17/58] ALSA: hda - Add headset support to Acer Aspire V5 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 08/58] mnt: Modify fs_fully_visible to deal with locked ro nodev and atime Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 16/58] ALSA: hda - set proper caps for newer AMD hda audio in KB/KV Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 58/58] Input: pixcir_i2c_ts - fix receive error Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:20 +0200 [PATCH 4.0 02/58] sysctl: Allow creating permanently empty directories that serve as mountpoints. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 39/58] livepatch: add module locking around kallsyms calls Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 55/58] PCI: Add pci_bus_addr_t Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 41/58] spi: orion: Fix maximum baud rates for Armada 370/XP Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 52/58] mtd: fix: avoid race condition when accessing mtd->usecount Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 14/58] ALSA: pcm: Fix pcm_class sysfs output Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 38/58] regulator: core: fix constraints output buffer Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 05/58] sysfs: Add support for permanently empty directories to serve as mount points. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 12/58] ipr: Increase default adapter init stage change timeout Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 37/58] regulator: max77686: fix gpio_enabled shift wrapping bug Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 47/58] IB/srp: Fix connection state tracking Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 56/58] PCI: pciehp: Wait for hotplug command completion where necessary Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 42/58] spi: pl022: Specify num-cs property as required in devicetree binding Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 43/58] scsi_transport_srp: Introduce srp_wait_for_queuecommand() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 48/58] IB/srp: Fix reconnection failure handling Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 45/58] IB/srp: Remove an extraneous scsi_host_put() from an error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 03/58] proc: Allow creating permanently empty directories that serve as mount points Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 13/58] Disable write buffering on Toshiba ToPIC95 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 46/58] IB/srp: Fix a connection setup race Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 54/58] PCI: Propagate the "ignore hotplug" setting to parent Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 04/58] kernfs: Add support for always empty directories. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 50/58] video: mxsfb: Make sure axi clock is enabled when accessing registers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 06/58] mnt: Update fs_fully_visible to test for permanently empty directories Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 01/58] fs: Add helper functions for permanently empty directories. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 49/58] genirq: devres: Fix testing return value of request_any_context_irq() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 10/58] gpio: crystalcove: set IRQCHIP_SKIP_SET_WAKE for the irqchip Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 [PATCH 4.0 51/58] leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-07-19 21:30 +0200 Re: [PATCH 4.0 00/58] 4.0.9-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-07-20 19:20 +0200
csiph-web