android_kernel_xiaomi_sm7250/drivers/acpi
Jamie Iles 2d32e60198 ACPI: debug: don't allow debugging when ACPI is disabled
commit 0fada277147ffc6d694aa32162f51198d4f10d94 upstream.

If ACPI is disabled then loading the acpi_dbg module will result in the
following splat when lock debugging is enabled.

  DEBUG_LOCKS_WARN_ON(lock->magic != lock)
  WARNING: CPU: 0 PID: 1 at kernel/locking/mutex.c:938 __mutex_lock+0xa10/0x1290
  Kernel panic - not syncing: panic_on_warn set ...
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc8+ #103
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   dump_backtrace+0x0/0x4d8
   show_stack+0x34/0x48
   dump_stack+0x174/0x1f8
   panic+0x360/0x7a0
   __warn+0x244/0x2ec
   report_bug+0x240/0x398
   bug_handler+0x50/0xc0
   call_break_hook+0x160/0x1d8
   brk_handler+0x30/0xc0
   do_debug_exception+0x184/0x340
   el1_dbg+0x48/0xb0
   el1_sync_handler+0x170/0x1c8
   el1_sync+0x80/0x100
   __mutex_lock+0xa10/0x1290
   mutex_lock_nested+0x6c/0xc0
   acpi_register_debugger+0x40/0x88
   acpi_aml_init+0xc4/0x114
   do_one_initcall+0x24c/0xb10
   kernel_init_freeable+0x690/0x728
   kernel_init+0x20/0x1e8
   ret_from_fork+0x10/0x18

This is because acpi_debugger.lock has not been initialized as
acpi_debugger_init() is not called when ACPI is disabled.  Fail module
loading to avoid this and any subsequent problems that might arise by
trying to debug AML when ACPI is disabled.

Fixes: 8cfb0cdf07 ("ACPI / debugger: Add IO interface to access debugger functionalities")
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Jamie Iles <jamie@nuviainc.com>
Cc: 4.10+ <stable@vger.kernel.org> # 4.10+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-05 11:08:47 +01:00
..
acpica ACPICA: Do not increment operation_region reference counts for field units 2020-08-19 08:14:53 +02:00
apei x86/mm: split vmalloc_sync_all() 2020-03-25 08:06:13 +01:00
arm64
dptf
nfit nfit: Add Hyper-V NVDIMM DSM command set to white list 2020-05-27 17:37:39 +02:00
pmic
x86
ac.c
acpi_amba.c
acpi_apd.c
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c ACPI: debug: don't allow debugging when ACPI is disabled 2020-11-05 11:08:47 +01:00
acpi_extlog.c ACPI / extlog: Check for RDMSR failure 2020-11-05 11:08:47 +01:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS 2020-01-27 14:51:00 +01:00
acpi_memhotplug.c mm/memory_hotplug: make remove_memory() take the device_hotplug_lock 2020-01-29 16:43:24 +01:00
acpi_pad.c
acpi_platform.c
acpi_pnp.c
acpi_processor.c
acpi_tad.c
acpi_video.c
acpi_watchdog.c ACPI: watchdog: Allow disabling WDAT at boot 2020-03-20 11:55:52 +01:00
battery.c ACPI / battery: Deal better with neither design nor full capacity not being reported 2020-02-11 04:33:59 -08:00
bgrt.c
blacklist.c
bus.c ACPI: bus: Fix NULL pointer check in acpi_bus_get_private_data() 2019-12-17 20:35:05 +01:00
button.c ACPI: button: fix handling lid state changes when input device closed 2020-11-05 11:08:46 +01:00
cm_sbs.c
container.c
cppc_acpi.c ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe() 2020-06-22 09:05:02 +02:00
custom_method.c ACPI: custom_method: fix memory leaks 2019-10-05 13:09:53 +02:00
debugfs.c
device_pm.c ACPI: PM: Avoid using power resources if there are none for D0 2020-06-22 09:05:02 +02:00
device_sysfs.c
dock.c
ec_sys.c
ec.c ACPI: EC: Reference count query handlers under lock 2020-10-01 13:14:30 +02:00
event.c
evged.c ACPI: GED: use correct trigger type field in _Exx / _Lxx handling 2020-06-22 09:05:09 +02:00
fan.c
glue.c
hed.c
internal.h
ioapic.c
irq.c
Kconfig
Makefile
numa.c ACPI: Add out of bounds and numa_off protections to pxm_to_node() 2020-11-05 11:08:42 +01:00
nvs.c
osi.c
osl.c ACPI: OSL: only free map once in osl.c 2019-12-17 20:35:05 +01:00
pci_irq.c ACPI / PCI: fix acpi_pci_irq_enable() memory leak 2019-10-05 13:09:53 +02:00
pci_link.c
pci_mcfg.c
pci_root.c PCI/ACPI: Correct error message for ASPM disabling 2019-11-20 18:46:52 +01:00
pci_slot.c
power.c
pptt.c ACPI/PPTT: Add support for ACPI 6.3 thread flag 2019-10-17 13:45:34 -07:00
proc.c
processor_core.c
processor_driver.c
processor_idle.c
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c x86: ACPI: fix CPU hotplug deadlock 2020-04-23 10:30:20 +02:00
property.c
reboot.c
resource.c
sbs.c
sbshc.c ACPI / SBS: Fix rare oops when removing modules 2019-11-24 08:20:31 +01:00
sbshc.h
scan.c ACPI: PM: Avoid using power resources if there are none for D0 2020-06-22 09:05:02 +02:00
sleep.c
sleep.h
spcr.c
sysfs.c ACPI: sysfs: Fix pm_profile_attr type 2020-06-30 23:17:15 -04:00
tables.c
thermal.c
utils.c
video_detect.c ACPI: video: use ACPI backlight for HP 635 Notebook 2020-11-05 11:08:47 +01:00
wakeup.c