aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-06Merge tag 'edac_for_4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bpLinus Torvalds1-9/+7
Pull EDAC updates from Borislav Petkov: - Stratix10 SDRAM support to altera_edac (Thor Thayer) - the usual misc fixes all over the place [ Also, shared branch for socfpga_stratix10.dtsi file changes with the socfpga tree ] * tag 'edac_for_4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC, ghes: Make platform-based whitelisting x86-only EDAC, altera: Fix ARM64 build warning EDAC, skx: Fix skx_edac build error when ACPI_NFIT=m EDAC, ghes: Use BIT() macro EDAC, ghes: Add DDR4 and NVDIMM memory types EDAC, altera: Handle SDRAM Uncorrectable Errors on Stratix10 Documentation: dt: edac: Move Altera SOCFPGA EDAC file EDAC, altera: Add support for Stratix10 SDRAM EDAC Documentation: dt: socfpga: Add Stratix10 ECC Manager binding EDAC, ghes: Remove unused argument to ghes_edac_report_mem_error() arm64: dts: stratix10: add sdram ecc EDAC, i7core: Fix spelling mistake: "redundacy" -> "redundancy" EDAC, ghes: Add a null pointer check in ghes_edac_unregister() ghes, EDAC: Fix ghes_edac registration arm64: dts: stratix10: Change pad skew values for EMAC0 PHY driver ARM: dts: consistently use 'atmel' as at24 manufacturer in cyclone5 arm64: dts: stratix10: Add PL330 DMAC to Stratix10 dts arm64: dts: stratix10: enable i2c, add i2c periperals arm64: dts: stratix10: use clock bindings for the Stratix10 platform
2018-06-05Merge tag 'acpi-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds22-131/+403
Pull ACPI updates from Rafael Wysocki: "These update the ACPICA code in the kernel to the 20180508 upstream revision and make it support the RT patch, add CPPC v3 support to the ACPI CPPC library, add a WDAT-based watchdog quirk to prevent clashes with the RTC, add quirks to the ACPI AC and battery drivers, and update the ACPI SoC drivers. Specifics: - Update the ACPICA code in the kernel to the 20180508 upstream revision including: * iASL -tc option enhancement (Bob Moore). * Debugger improvements (Bob Moore). * Support for tables larger than 1 MB in acpidump/acpixtract (Bob Moore). * Minor fixes and cleanups (Colin Ian King, Toomas Soome). - Make the ACPICA code in the kernel support the RT patch (Sebastian Andrzej Siewior, Steven Rostedt). - Add a kmemleak annotation to the ACPICA code (Larry Finger). - Add CPPC v3 support to the ACPI CPPC library and fix two issues related to CPPC (Prashanth Prakash, Al Stone). - Add an ACPI WDAT-based watchdog quirk to prefer iTCO_wdt on systems where WDAT clashes with the RTC SRAM (Mika Westerberg). - Add some quirks to the ACPI AC and battery drivers (Carlo Caione, Hans de Goede). - Update the ACPI SoC drivers for Intel (LPSS) and AMD (APD) platforms (Akshu Agrawal, Hans de Goede). - Fix up some assorted minor issues (Al Stone, Laszlo Toth, Mathieu Malaterre)" * tag 'acpi-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits) ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaks ACPI / watchdog: Prefer iTCO_wdt always when WDAT table uses RTC SRAM mailbox: PCC: erroneous error message when parsing ACPI PCCT ACPICA: Update version to 20180508 ACPICA: acpidump/acpixtract: Support for tables larger than 1MB ACPI: APD: Add AMD misc clock handler support clk: x86: Add ST oscout platform clock ACPICA: Update version to 20180427 ACPICA: Debugger: Removed direct support for EC address space in "Test Objects" ACPICA: Debugger: Add Package support for "test objects" command ACPICA: Improve error messages for the namespace root node ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list ACPICA: vsnprintf: this statement may fall through ACPICA: Tables: Fix spelling mistake in comment ACPICA: iASL: Enhance the -tc option (create AML hex file in C) ACPI: Add missing prototype_for arch_post_acpi_subsys_init() ACPI / tables: improve comments regarding acpi_parse_entries_array() ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock ACPICA: provide abstraction for raw_spinlock_t ACPI / CPPC: Fix invalid PCC channel status errors ...
2018-06-05Merge tag 'pm-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds6-6/+45
Pull power management updates from Rafael Wysocki: "These include a significant update of the generic power domains (genpd) and Operating Performance Points (OPP) frameworks, mostly related to the introduction of power domain performance levels, cpufreq updates (new driver for Qualcomm Kryo processors, updates of the existing drivers, some core fixes, schedutil governor improvements), PCI power management fixes, ACPI workaround for EC-based wakeup events handling on resume from suspend-to-idle, and major updates of the turbostat and pm-graph utilities. Specifics: - Introduce power domain performance levels into the the generic power domains (genpd) and Operating Performance Points (OPP) frameworks (Viresh Kumar, Rajendra Nayak, Dan Carpenter). - Fix two issues in the runtime PM framework related to the initialization and removal of devices using device links (Ulf Hansson). - Clean up the initialization of drivers for devices in PM domains (Ulf Hansson, Geert Uytterhoeven). - Fix a cpufreq core issue related to the policy sysfs interface causing CPU online to fail for CPUs sharing one cpufreq policy in some situations (Tao Wang). - Make it possible to use platform-specific suspend/resume hooks in the cpufreq-dt driver and make the Armada 37xx DVFS use that feature (Viresh Kumar, Miquel Raynal). - Optimize policy transition notifications in cpufreq (Viresh Kumar). - Improve the iowait boost mechanism in the schedutil cpufreq governor (Patrick Bellasi). - Improve the handling of deferred frequency updates in the schedutil cpufreq governor (Joel Fernandes, Dietmar Eggemann, Rafael Wysocki, Viresh Kumar). - Add a new cpufreq driver for Qualcomm Kryo (Ilia Lin). - Fix and clean up some cpufreq drivers (Colin Ian King, Dmitry Osipenko, Doug Smythies, Luc Van Oostenryck, Simon Horman, Viresh Kumar). - Fix the handling of PCI devices with the DPM_SMART_SUSPEND flag set and update stale comments in the PCI core PM code (Rafael Wysocki). - Work around an issue related to the handling of EC-based wakeup events in the ACPI PM core during resume from suspend-to-idle if the EC has been put into the low-power mode (Rafael Wysocki). - Improve the handling of wakeup source objects in the PM core (Doug Berger, Mahendran Ganesh, Rafael Wysocki). - Update the driver core to prevent deferred probe from breaking suspend/resume ordering (Feng Kan). - Clean up the PM core somewhat (Bjorn Helgaas, Ulf Hansson, Rafael Wysocki). - Make the core suspend/resume code and cpufreq support the RT patch (Sebastian Andrzej Siewior, Thomas Gleixner). - Consolidate the PM QoS handling in cpuidle governors (Rafael Wysocki). - Fix a possible crash in the hibernation core (Tetsuo Handa). - Update the rockchip-io Adaptive Voltage Scaling (AVS) driver (David Wu). - Update the turbostat utility (fixes, cleanups, new CPU IDs, new command line options, built-in "Low Power Idle" counters support, new POLL and POLL% columns) and add an entry for it to MAINTAINERS (Len Brown, Artem Bityutskiy, Chen Yu, Laura Abbott, Matt Turner, Prarit Bhargava, Srinivas Pandruvada). - Update the pm-graph to version 5.1 (Todd Brandt). - Update the intel_pstate_tracer utility (Doug Smythies)" * tag 'pm-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (128 commits) tools/power turbostat: update version number tools/power turbostat: Add Node in output tools/power turbostat: add node information into turbostat calculations tools/power turbostat: remove num_ from cpu_topology struct tools/power turbostat: rename num_cores_per_pkg to num_cores_per_node tools/power turbostat: track thread ID in cpu_topology tools/power turbostat: Calculate additional node information for a package tools/power turbostat: Fix node and siblings lookup data tools/power turbostat: set max_num_cpus equal to the cpumask length tools/power turbostat: if --num_iterations, print for specific number of iterations tools/power turbostat: Add Cannon Lake support tools/power turbostat: delete duplicate #defines x86: msr-index.h: Correct SNB_C1/C3_AUTO_UNDEMOTE defines tools/power turbostat: Correct SNB_C1/C3_AUTO_UNDEMOTE defines tools/power turbostat: add POLL and POLL% column tools/power turbostat: Fix --hide Pk%pc10 tools/power turbostat: Build-in "Low Power Idle" counters support tools/power turbostat: Don't make man pages executable tools/power turbostat: remove blank lines tools/power turbostat: a small C-states dump readability immprovement ...
2018-06-04Merge branch 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsLinus Torvalds3-130/+31
Pull procfs updates from Al Viro: "Christoph's proc_create_... cleanups series" * 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (44 commits) xfs, proc: hide unused xfs procfs helpers isdn/gigaset: add back gigaset_procinfo assignment proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields tty: replace ->proc_fops with ->proc_show ide: replace ->proc_fops with ->proc_show ide: remove ide_driver_proc_write isdn: replace ->proc_fops with ->proc_show atm: switch to proc_create_seq_private atm: simplify procfs code bluetooth: switch to proc_create_seq_data netfilter/x_tables: switch to proc_create_seq_private netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data neigh: switch to proc_create_seq_data hostap: switch to proc_create_{seq,single}_data bonding: switch to proc_create_seq_data rtc/proc: switch to proc_create_single_data drbd: switch to proc_create_single resource: switch to proc_create_seq_data staging/rtl8192u: simplify procfs code jfs: simplify procfs code ...
2018-06-04Merge branches 'acpi-soc' and 'acpi-tables'Rafael J. Wysocki3-3/+59
* acpi-soc: ACPI: APD: Add AMD misc clock handler support clk: x86: Add ST oscout platform clock ACPI / LPSS: Only call pwm_add_table() for Bay Trail PWM if PMIC HRV is 2 * acpi-tables: ACPI / tables: improve comments regarding acpi_parse_entries_array()
2018-06-04Merge branches 'acpi-cppc', 'acpi-misc', 'acpi-battery' and 'acpi-ac'Rafael J. Wysocki4-78/+214
* acpi-cppc: mailbox: PCC: erroneous error message when parsing ACPI PCCT ACPI / CPPC: Fix invalid PCC channel status errors ACPI / CPPC: Document CPPC sysfs interface cpufreq / CPPC: Support for CPPC v3 ACPI / CPPC: Check for valid PCC subspace only if PCC is used ACPI / CPPC: Add support for CPPC v3 * acpi-misc: ACPI: Add missing prototype_for arch_post_acpi_subsys_init() ACPI: add missing newline to printk * acpi-battery: ACPI / battery: Add quirk to avoid checking for PMIC with native driver ACPI / battery: Ignore AC state in handle_discharging on systems where it is broken ACPI / battery: Add handling for devices which wrongly report discharging state ACPI / battery: Remove initializer for unused ident dmi_system_id ACPI / AC: Remove initializer for unused ident dmi_system_id * acpi-ac: ACPI / AC: Add quirk to avoid checking for PMIC with native driver
2018-06-04Merge branch 'acpica'Rafael J. Wysocki14-23/+85
* acpica: ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaks ACPICA: Update version to 20180508 ACPICA: acpidump/acpixtract: Support for tables larger than 1MB ACPICA: Update version to 20180427 ACPICA: Debugger: Removed direct support for EC address space in "Test Objects" ACPICA: Debugger: Add Package support for "test objects" command ACPICA: Improve error messages for the namespace root node ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list ACPICA: vsnprintf: this statement may fall through ACPICA: Tables: Fix spelling mistake in comment ACPICA: iASL: Enhance the -tc option (create AML hex file in C) ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock ACPICA: provide abstraction for raw_spinlock_t
2018-06-04Merge branches 'pm-pci', 'acpi-pm', 'pm-sleep' and 'pm-avs'Rafael J. Wysocki5-0/+42
* pm-pci: PCI / PM: Clean up outdated comments in pci_target_state() PCI / PM: Do not clear state_saved for devices that remain suspended * acpi-pm: ACPI: EC: Dispatch the EC GPE directly on s2idle wake ACPICA: Introduce acpi_dispatch_gpe() * pm-sleep: PM / hibernate: Fix oops at snapshot_write() PM / wakeup: Make s2idle_lock a RAW_SPINLOCK PM / s2idle: Make s2idle_wait_head swait based PM / wakeup: Make events_lock a RAW_SPINLOCK PM / suspend: Prevent might sleep splats * pm-avs: PM / AVS: rockchip-io: add io selectors and supplies for PX30
2018-06-04Merge branch 'pm-domains'Rafael J. Wysocki1-6/+3
* pm-domains: PM / domains: Improve wording of dev_pm_domain_attach() comment PM / Domains: Don't return -EEXIST at attach when PM domain exists spi: Respect all error codes from dev_pm_domain_attach() soundwire: Respect all error codes from dev_pm_domain_attach() mmc: sdio: Respect all error codes from dev_pm_domain_attach() i2c: Respect all error codes from dev_pm_domain_attach() driver core: Respect all error codes from dev_pm_domain_attach() amba: Respect all error codes from dev_pm_domain_attach() PM / Domains: Allow a better error handling of dev_pm_domain_attach() PM / Domains: Check for existing PM domain in dev_pm_domain_attach() PM / Domains: Drop redundant code in genpd while attaching devices PM / Domains: Drop comment in genpd about legacy Samsung DT binding PM / Domains: Fix error path during attach in genpd
2018-05-27ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaksLarry Finger1-0/+2
In kernel 4.17.0-rcX, kmemleak reports 9 leaks with tracebacks similar to the following: unreferenced object 0xffff880224a077e0 (size 72): comm "swapper/0", pid 1, jiffies 4294892358 (age 1022.636s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 0e 01 01 00 00 00 00 01 ................ 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000004f506615>] acpi_ut_create_internal_object_dbg+0x4d/0x10e [<000000006e7730e3>] acpi_ds_build_internal_object+0xed/0x1cd [<00000000272b7c73>] acpi_ds_build_internal_package_obj+0x245/0x3a2 [<000000000b64c50e>] acpi_ds_eval_data_object_operands+0x17b/0x21b [<00000000589647ac>] acpi_ds_exec_end_op+0x433/0x6c1 [<000000001d69bcbf>] acpi_ps_parse_loop+0x926/0x9be [<000000005d6fa97d>] acpi_ps_parse_aml+0x1a2/0x4af [<00000000c4bef823>] acpi_ps_execute_table+0xbb/0x119 [<00000000fd9632e4>] acpi_ns_execute_table+0x20c/0x260 [<00000000e6ae17ac>] acpi_ns_parse_table+0x7d/0x1b3 [<0000000008e1e148>] acpi_ns_load_table+0x8d/0x1c0 [<000000009fc8346f>] acpi_tb_load_namespace+0x176/0x278 [<0000000073f98b3b>] acpi_load_tables+0x6e/0xfd [<00000000d2ef13d2>] acpi_init+0x8c/0x340 [<000000007da19d8d>] do_one_initcall+0x46/0x1fa [<0000000024681a1d>] kernel_init_freeable+0x1a2/0x237 According to gdb, the offending code is object = acpi_ut_allocate_object_desc_dbg(module_name, line_number, component_id); As it is not possible to unload the ACPI code to test that this is a real leak and not a false positive, and that only these 9 appear no matter how long the system is up, a kmemleak_not_leak(object) call is inserted. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-25ACPI: EC: Dispatch the EC GPE directly on s2idle wakeRafael J. Wysocki3-0/+14
On platforms where the Low Power S0 Idle _DSM interface is used, on wakeup from suspend-to-idle, when it is known that the ACPI SCI has triggered while suspended, dispatch the EC GPE in order to catch all EC events that may have triggered the wakeup before carrying out the noirq phase of device resume. That is needed to handle power button wakeup on some platforms where the EC goes into a low-power mode during suspend-to-idle and while in that mode it will discard events after a timeout. If that timeout is shorter than the time it takes to complete the noirq resume of devices, looking for EC events after the latter is too late. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reported-by: Zhang Rui <rui.zhang@intel.com> Tested-by: Wendy Wang <wendy.wang@intel.com>
2018-05-25ACPICA: Introduce acpi_dispatch_gpe()Rafael J. Wysocki2-0/+28
Introduce acpi_dispatch_gpe() as a wrapper around acpi_ev_detect_gpe() for checking if the given GPE (as represented by a GPE device handle and a GPE number) is currently active and dispatching it (if that's the case) outside of interrupt context. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-24ACPI / watchdog: Prefer iTCO_wdt always when WDAT table uses RTC SRAMMika Westerberg1-27/+45
After we added quirk for Lenovo Z50-70 it turns out there are at least two more systems where WDAT table includes instructions accessing RTC SRAM. Instead of quirking each system separately, look for such instructions in the table and automatically prefer iTCO_wdt if found. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199033 Reported-by: Arnold Guy <aurnoldg@gmail.com> Reported-by: Alois Nespor <nespor@fssp.cz> Reported-by: Yury Pakin <zxwarior@gmail.com> Reported-by: Ihor Chyhin <ihorchyhin@ukr.net> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-18ACPICA: acpidump/acpixtract: Support for tables larger than 1MBBob Moore1-2/+2
acpidump: Expand the table offset field to 32 bits. acpixtract: Add support to handle the expanded field. Backwards compatibility is maintained. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-17ACPI: APD: Add AMD misc clock handler supportAkshu Agrawal1-0/+47
AMD SoC exposes clock for general purpose use. The clock registration is done in clk-st driver. The MMIO mapping are passed on to the clock driver for accessing the registers. The misc clock handler will create MMIO mappings to access the clock registers and enable the clock driver to expose the clock for use of drivers which will connect to it. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-16acpi/battery: simplify procfs codeChristoph Hellwig1-95/+26
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-16proc: introduce proc_create_single{,_data}Christoph Hellwig2-35/+5
Variants of proc_create{,_data} that directly take a seq_file show callback and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-05-15ACPICA: Debugger: Removed direct support for EC address space in "Test Objects"Bob Moore1-2/+1
None of the address spaces that require a communication protocol are supported by the "Test Objects" command. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15ACPICA: Debugger: Add Package support for "test objects" commandBob Moore1-2/+54
This was missing in the initial implementation of "test objects". Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15ACPICA: Improve error messages for the namespace root nodeBob Moore3-8/+14
Replace "\___" with actual descriptive text. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_listColin Ian King1-1/+1
There is a potenial infinite loop if acpi_rs_dump_byte_list is called with a Length greater than 255 since the current loop counter is just a u8 and will wrap to zero and never reach the desired value in Length. Fix this by making the loop counter the size type as Length. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15ACPICA: vsnprintf: this statement may fall throughToomas Soome1-0/+1
[rjw:] Add an explicit switch () statement fall-through marker. Signed-off-by: Toomas Soome <tsoome@me.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15ACPICA: Tables: Fix spelling mistake in commentColin Ian King1-1/+1
The spelling of "sucessfully" should be "successfully", fix this Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15ACPICA: iASL: Enhance the -tc option (create AML hex file in C)Bob Moore1-0/+2
This change improves the -tc option by: 1) Creates a unique symbol for the hex table, to simplify creation of multiple tables (DSDT/SSDT). 2) Adds a protection #ifdef, similar to a .h file. With assistance from: Sami Mujawar, sami.mujawar@arm.com Evan Lloyd, evan.lloyd@arm.com Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15Merge back earlier ACPICA material for v4.18.Rafael J. Wysocki4-7/+7
2018-05-14PM / Domains: Allow a better error handling of dev_pm_domain_attach()Ulf Hansson1-3/+3
The callers of dev_pm_domain_attach() currently checks the returned error code for -EPROBE_DEFER and needs to ignore other error codes. This is an unnecessary limitation, which also leads to a rather strange behaviour in the error path. Address this limitation, by changing the return codes from acpi_dev_pm_attach() and genpd_dev_pm_attach(). More precisely, let them return 0, when no PM domain is needed for the device and then return 1, in case the device was successfully attached to its PM domain. In this way, dev_pm_domain_attach(), gets a better understanding of what happens in the attach attempts and also allowing its caller to better act on real errors codes. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-14PM / Domains: Check for existing PM domain in dev_pm_domain_attach()Ulf Hansson1-3/+0
Instead of checking if an existing PM domain pointer has been assigned in genpd_dev_pm_attach() and acpi_dev_pm_attach(), move the check to the common path in dev_pm_domain_attach(), thus potentially avoid one unnecessary check. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-14ACPICA: Add deferred package support for the Load and loadTable operatorsBob Moore3-20/+74
Completes the support and fixes a regression introduced in version 20180209. The regression caused package objects that were loaded by the Load and loadTable operators. This created an error message like the following: [ 0.251922] ACPI Error: No pointer back to namespace node in package 00000000fd2a44cd (20180313/dsargs-303) Link: https://bugzilla.kernel.org/show_bug.cgi?id=199413 Fixes: 5a8361f7ecce (ACPICA: Integrate package handling with module-level code) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-12ACPI / tables: improve comments regarding acpi_parse_entries_array()Al Stone1-2/+7
I found the description of the table_size argument to the function acpi_parse_entries_array() unclear and ambiguous. This is a minor documentation change to improve that description so I don't misuse the argument again in the future, and it is hopefully clearer to other future users. Signed-off-by: Al Stone <ahs3@redhat.com> [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-12EDAC, ghes: Remove unused argument to ghes_edac_report_mem_error()Alexandru Gagniuc1-1/+1
The use of the @ghes argument was removed in a previous commit, but function signature was not updated to reflect this. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Acked-by: "Rafael J. Wysocki" <rafael@kernel.org> Cc: linux-acpi@vger.kernel.org Cc: linux-edac <linux-edac@vger.kernel.org> Link: http://lkml.kernel.org/r/20180430213358.8319-1-mr.nuke.me@gmail.com Signed-off-by: Borislav Petkov <bp@suse.de>
2018-05-10ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlockSteven Rostedt4-7/+7
We hit the following bug with -RT: |BUG: scheduling while atomic: swapper/7/0/0x00000002 |Pid: 0, comm: swapper/7 Not tainted 3.6.11-rt28.19.el6rt.x86_64.debug #1 |Call Trace: | rt_spin_lock+0x16/0x40 | __schedule_bug+0x67/0x90 | __schedule+0x793/0x7a0 | acpi_os_acquire_lock+0x1f/0x23 | acpi_write_bit_register+0x33/0xb0 | rt_spin_lock_slowlock+0xe5/0x2f0 | acpi_idle_enter_bm+0x8a/0x28e … As the acpi code disables interrupts in acpi_idle_enter_bm, and calls code that grabs the acpi lock, it causes issues as the lock is currently in RT a sleeping lock. The lock was converted from a raw to a sleeping lock due to some previous issues, and tests that showed it didn't seem to matter. Unfortunately, it did matter for one of our boxes. This patch converts the lock back to a raw lock. I've run this code on a few of my own machines, one being my laptop that uses the acpi quite extensively. I've been able to suspend and resume without issues. [ tglx: Made the change exclusive for acpi_gbl_hardware_lock ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1360765565.23152.5.camel@gandalf.local.home Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [bigeasy: shorten the backtrace, use the type acpi_raw_spinlock incl. accessor] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10ACPI / CPPC: Fix invalid PCC channel status errorsPrakash, Prashanth1-29/+19
Replace the faulty PCC status register polling code with a iopoll.h macro to fix incorrect reporting of PCC check errors ("PCC check channel failed"). There were potential codepaths where we could incorrectly return PCC channel status as busy even without checking the PCC status register once or not checking the status register before breaking out of the polling loop. For example, if the thread polling PCC status register was preempted and scheduled back after we have crossed the deadline then we can report that the channel is busy even without checking the status register. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10ACPI / AC: Add quirk to avoid checking for PMIC with native driverCarlo Caione1-10/+36
With commit af3ec837b84b (ACPI / AC: Add a blacklist with PMIC ACPI HIDs with a native charger driver) a blacklist was introduced to avoid using the ACPI drivers for AC when a native PMIC driver was already present. While this is in general a good idea (because of broken DSDT or proprietary and undocumented ACPI opregions for the ACPI AC devices) there are some Cherry Trail devices which use a separate charger controller despite the AXP288 having a builtin charger. The net effect of blacklisting the ACPI drivers is that on these devices the AC reporting is broken since the AXP288 PMIC charger bits are not actually used on this hardware. This commit adds an ac_do_not_check_pmic quirk for this and sets this on the 2 devices currently known to use a separate FG controller, the ECS EF20EA and the Lenovo Ideapad Miix 320. [hdegoede@redhat.com: Merge the quirk handling and the adding of the DMI table entry into 1 commit, add a second DMI entry for the Miix 320.] Signed-off-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10ACPI / battery: Add quirk to avoid checking for PMIC with native driverCarlo Caione1-8/+34
With commit dccfae6d4f4c (ACPI / battery: Add a blacklist with PMIC ACPI HIDs with a native battery driver) a blacklist was introduced to avoid using the ACPI drivers for the battery when a native PMIC driver was already present. While this is in general a good idea (because of broken DSDT or proprietary and undocumented ACPI opregions for the ACPI battery devices) there are some Cherry Trail devices which use a separate FG controller despite the AXP288 having a builtin FG. The net effect of blacklisting the ACPI drivers is that on these devices the battery reporting is broken since the AXP288 PMIC FG bits are not actually used on this hardware. This commit adds a battery_do_not_check_pmic quirk for this and sets this on the 2 devices currently known to use a separate FG controller, the ECS EF20EA and the Lenovo Ideapad Miix 320. [hdegoede@redhat.com: Merge the quirk handling and the adding of the DMI table entry into 1 commit, add a second DMI entry for the Miix 320.] Signed-off-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10ACPI / LPSS: Only call pwm_add_table() for Bay Trail PWM if PMIC HRV is 2Hans de Goede1-1/+5
The Point of View mobii wintab p800w Bay Trail tablet comes with a Crystal Cove PMIC, yet uses the LPSS PWM for backlight control, rather then the Crystal Cove's PWM, so we need to call pwm_add_table() to add a pwm_backlight mapping for the LPSS pwm despite there being an INT33FD ACPI device present. On all Bay Trail devices the _HRV object of the INT33FD ACPI device will normally return 2, to indicate the Bay Trail variant of the CRC PMIC is present, except on this tablet where _HRV is 0xffff. I guess this is a hack to make the windows Crystal Cove PWM driver not bind. Out of the 44 DSTDs with an INT33FD device in there which I have (from different model devices) only the pov mobii wintab p800w uses 0xffff for the HRV. The byt_pwm_setup code calls acpi_dev_present to check for the presence of a INT33FD ACPI device which indicates that a CRC PMIC is present and if the INT33FD ACPI device is present then byt_pwm_setup will not add a pwm_backlight mapping for the LPSS pwm, so that the CRC PWM will get used instead. acpi_dev_present has a hrv parameter, this commit make us pass 2 instead of -1, so that things still match on normal tablets, but on this special case with its _HRV of 0xffff, the check will now fail so that the pwm_backlight mapping for the LPSS pwm gets added fixing backlight brightness control on this device. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02ghes, EDAC: Fix ghes_edac registrationBorislav Petkov1-8/+6
Tony reported seeing "Internal error: Can't find EDAC structure" when injecting correctable errors due to the fact that ghes_edac would still load even if the whitelist won't hit. Drop the pr_err() in ghes_edac_report_mem_error() for now due to the hacky way how ghes_edac depends on ghes.c. While at it, make ghes_edac_register() return an error if it doesn't hit in the whitelist as it is the only sensible thing to do in that situation. Furthermore, move the call to it to happen last in ghes_probe() so that GHES initializing properly does not depend on ghes_edac init at all as latter is only reporting errors and not required for GHES's proper functioning. Reviewed-by: Toshi Kani <toshi.kani@hpe.com> Tested-by: Sughosh Ganu <sughosh.ganu@arm.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Tony Luck <tony.luck@intel.com> Link: https://lkml.kernel.org/r/20180420182015.zao3olss4tvvlxki@agluck-desk
2018-05-02ACPI / battery: Ignore AC state in handle_discharging on systems where it is brokenHans de Goede1-1/+21
On some devices the "AC" interface ACPI AML code uses the exact same broken logic which is causing the battery code to wrongly report discharging to determine the "AC" state. Specifically the ACPI AML code is checking the charging status bits of the charger-IC rather then the vbus present or power-good status bits. This makes our workaround for devices which wrongly report discharging when plugged into AC while the charge is above the start charging threshold not work on these devices. This commit adds a battery_ac_is_broken flag and when that is set it skips the power_supply_is_system_supplied() check in the workaround fixing this. This flag gets set by a DMI quirk selected by systems where we know the AC AML code is broken in this way *and* the rate_now value can be trusted. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02ACPI / battery: Add handling for devices which wrongly report discharging stateHans de Goede1-1/+14
On quite a few devices the battery code in the ACPI tables is buggy and first checks the charging status bits of the charger-IC, and if those report not charging it will report discharging, without looking at the presence of AC power or at the battery dis(charge) current from the fuel-gauge. This causes the wrong status to be reported for the battery in the following quite common scenario: 1) Plug in charger while battery is say half full, battery starts charging, charging state bits indicate: pre-charge or fast-charge, ACPI reported battery status is ok 2) When fully charged charging state bits indicate: end-of-charge, ACPI reported battery status is ok 3) unplug the charger, wait 1 minute, replug. Now the battery voltage is still above the start-charging threshold, so the charger will not start charging to avoid wrecking the battery by repeatedly recharging the last 1% capacity. The charger IC charging state bits now are all 0 (not-charging) and the broken ACPI code wrongly translate this to "discharging" and ends up setting the ACPI_BATTERY_STATE_DISCHARGING bit in its state field. Reporting this "not charging" state as discharging is confusing for users, making the user think his adapter/power-brick is broken or not properly plugged in. This commit adds a helper for handling the ACPI_BATTERY_STATE_DISCHARGING state. This helper checks if we're an AC and the current going out of the battery is 0 and in that case reports a status of "not charging" to userspace rather then "discharging". This replaces commit c68f0676ef7d ("ACPI / battery: Add quirk for Asus GL502VSK and UX305LA"), a previous fix for this which was reverted. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Daniel Drake <drake@endlessm.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02ACPI / battery: Remove initializer for unused ident dmi_system_idHans de Goede1-2/+2
The battery code does not use the dmi_system_id ident member, so there is no need to initialize it. This saves us storing the unused strings as as const data. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02ACPI / AC: Remove initializer for unused ident dmi_system_idHans de Goede1-1/+1
The ac.c code does not use the dmi_system_id ident member, so there is no need to initialize it. This saves us storing the unused "thinkpad e530" string as const data. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02ACPI: add missing newline to printkLaszlo Toth1-2/+2
...and restore reverse xmas tree while at it. Signed-off-by: Laszlo Toth <laszlth@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-26Merge tag 'acpi-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds4-14/+98
Pull ACPI fixes from Rafael Wysocki: "These are two watchdog-related fixes, fix for a backlight regression from the 4.16 cycle that unfortunately was propagated to -stable and a button module modification to prevent graphics driver modules from failing to load due to unmet dependencies if ACPI is disabled from the kernel command line. Specifics: - Change the ACPI subsystem initialization ordering to initialize the WDAT watchodg before reserving PNP motherboard resources so as to allow the watchdog to allocate its resources before the PNP code gets to them and prevents it from working correctly (Mika Westerberg). - Add a quirk for Lenovo Z50-70 to use the iTCO watchdog instead of the WDAT one which conflicts with the RTC on that platform (Mika Westerberg). - Avoid breaking backlight handling on Dell XPS 13 2013 model by allowing laptops to use the ACPI backlight by default even if they are Windows 8-ready in principle (Hans de Goede)" * tag 'acpi-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / video: Only default only_lcd to true on Win8-ready _desktops_ ACPI / button: make module loadable when booted in non-ACPI mode ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70 ACPI / scan: Initialize watchdog before PNP
2018-04-26Merge branches 'acpi-watchdog', 'acpi-button' and 'acpi-video'Rafael J. Wysocki3-13/+97
* acpi-watchdog: ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70 * acpi-button: ACPI / button: make module loadable when booted in non-ACPI mode * acpi-video: ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
2018-04-24ACPI / video: Only default only_lcd to true on Win8-ready _desktops_Hans de Goede1-2/+25
Commit 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready and newer machines) made only_lcd default to true on all machines where acpi_osi_is_win8() returns true, including laptops. The purpose of this is to avoid the bogus / non-working acpi backlight interface which many newer BIOS-es define on desktop machines. But this is causing a regression on some laptops, specifically on the Dell XPS 13 2013 model, which does not have the LCD flag set for its fully functional ACPI backlight interface. Rather then DMI quirking our way out of this, this commits changes the logic for setting only_lcd to true, to only do this on machines with a desktop (or server) dmi chassis-type. Note that we cannot simply only check the chassis-type and not register the backlight interface based on that as there are some laptops and tablets which have their chassis-type set to "3" aka desktop. Hopefully the combination of checking the LCD flag, but only on devices with a desktop(ish) chassis-type will avoid the needs for DMI quirks for this, or at least limit the amount of DMI quirks which we need to a minimum. Fixes: 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready and newer machines) Reported-and-tested-by: James Hogan <jhogan@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Cc: 4.15+ <stable@vger.kernel.org> # 4.15+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24ACPI / button: make module loadable when booted in non-ACPI modeArd Biesheuvel1-1/+23
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>
2018-04-24ACPI / CPPC: Check for valid PCC subspace only if PCC is usedPrashanth Prakash1-9/+21
Changes the behavior where we return error if there are no valid PCC subspace for a given performance domain. The ACPI spec does not mandate the use PCC, so it is possible to have platforms where a PCC subspace may not be present, so we need to check for a valid PCC subspace ID only if the register is a PCC register. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24ACPI / CPPC: Add support for CPPC v3Prashanth Prakash1-16/+65
CPPC V3 introduces two new entries to make it easier to convert between abstract processor performance and frequency. The two new entries are lowest frequency and nominal frequency. These are the frequencies corresponding to lowest and nominal abstract performance. Add support to read the new entries and populate them as part of the CPPC performance capabilities which can be used by cpufreq drivers Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70Mika Westerberg1-10/+49
WDAT table on Lenovo Z50-70 is using RTC SRAM (ports 0x70 and 0x71) to store state of the timer. This conflicts with Linux RTC driver (rtc-cmos.c) who fails to reserve those ports for itself preventing RTC from functioning. In addition the WDAT table seems not to be fully functional because it does not reset the system when the watchdog times out. On this system iTCO_wdt works just fine so we simply prefer to use it instead of WDAT. This makes RTC working again and also results working watchdog via iTCO_wdt. Reported-by: Peter Milley <pbmilley@gmail.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=199033 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-23ACPI / scan: Initialize watchdog before PNPMika Westerberg1-1/+1
At least on one Dell system the PNP motherboard resources device includes resources used by WDAT table. Since PNP gets initialized before WDAT it results following error and no watchdog: platform wdat_wdt: failed to claim resource 3: [io 0x046a-0x046c] ACPI: watchdog: Device creation failed: -16 Now, the PNP system driver is already accustomed with the situation that it cannot reserve all those motherboard resources because drivers using those might have reserved them already. In addition putting WDAT table resources under motherboard resources device makes sense in general. Fix this by initializing WDAT right before PNP. This allows WDAT to reserve all its resources and still keeps PNP system driver happy. Reported-by: Shubhrata.Priyadarsh@dell.com Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-23ACPI / PM: Blacklist Low Power S0 Idle _DSM for ThinkPad X1 Tablet(2016)Chen Yu1-0/+13
ThinkPad X1 Tablet(2016) is reported to have issues with the Low Power S0 Idle _DSM interface and since this machine model generally can do ACPI S3 just fine, and user would like to use S3 as default sleep model, add a blacklist entry to disable that interface for ThinkPad X1 Tablet(2016). Link: https://bugzilla.kernel.org/show_bug.cgi?id=199057 Reported-and-tested-by: Robin Lee <robinlee.sysu@gmail.com> Signed-off-by: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>