summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
AgeCommit message (Collapse)AuthorFilesLines
2014-04-02Merge tag 'pm+acpi-3.15-rc1-2' of ↵Linus Torvalds16-148/+272
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI and power management updates from Rafael Wysocki: "These are commits that were not quite ready when I sent the original pull request for 3.15-rc1 several days ago, but they have spent some time in linux-next since then and appear to be good to go. All of them are fixes and cleanups. Specifics: - Remaining changes from upstream ACPICA release 20140214 that introduce code to automatically serialize the execution of methods creating any named objects which really cannot be executed in parallel with each other anyway (previously ACPICA attempted to address that by aborting methods upon conflict detection, but that wasn't reliable enough and led to other issues). From Bob Moore and Lv Zheng. - intel_pstate fix to use del_timer_sync() instead of del_timer() in the exit path before freeing the timer structure from Dirk Brandewie (original patch from Thomas Gleixner). - cpufreq fix related to system resume from Viresh Kumar. - Serialization of frequency transitions in cpufreq that involve PRECHANGE and POSTCHANGE notifications to avoid ordering issues resulting from race conditions. From Srivatsa S Bhat and Viresh Kumar. - Revert of an ACPI processor driver change that was based on a specific interpretation of the ACPI spec which may not be correct (the relevant part of the spec appears to be incomplete). From Hanjun Guo. - Runtime PM core cleanups and documentation updates from Geert Uytterhoeven. - PNP core cleanup from Michael Opdenacker" * tag 'pm+acpi-3.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: Make cpufreq_notify_transition & cpufreq_notify_post_transition static cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end} cpufreq: Make sure frequency transitions are serialized intel_pstate: Use del_timer_sync in intel_pstate_cpu_stop cpufreq: resume drivers before enabling governors PM / Runtime: Spelling s/competing/completing/ PM / Runtime: s/foo_process_requests/foo_process_next_request/ PM / Runtime: GENERIC_SUBSYS_PM_OPS is gone PM / Runtime: Correct documented return values for generic PM callbacks PM / Runtime: Split line longer than 80 characters PM / Runtime: dev_pm_info.runtime_error is signed Revert "ACPI / processor: Make it possible to get APIC ID via GIC" ACPICA: Enable auto-serialization as a default kernel behavior. ACPICA: Ignore sync_level for methods that have been auto-serialized. ACPICA: Add additional named objects for the auto-serialize method scan. ACPICA: Add auto-serialization support for ill-behaved control methods. ACPICA: Remove global option to serialize all control methods. PNP: remove deprecated IRQF_DISABLED
2014-04-01Merge tag 'pci-v3.15-changes' of ↵Linus Torvalds1-8/+8
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI changes from Bjorn Helgaas: "Enumeration - Increment max correctly in pci_scan_bridge() (Andreas Noever) - Clarify the "scan anyway" comment in pci_scan_bridge() (Andreas Noever) - Assign CardBus bus number only during the second pass (Andreas Noever) - Use request_resource_conflict() instead of insert_ for bus numbers (Andreas Noever) - Make sure bus number resources stay within their parents bounds (Andreas Noever) - Remove pci_fixup_parent_subordinate_busnr() (Andreas Noever) - Check for child busses which use more bus numbers than allocated (Andreas Noever) - Don't scan random busses in pci_scan_bridge() (Andreas Noever) - x86: Drop pcibios_scan_root() check for bus already scanned (Bjorn Helgaas) - x86: Use pcibios_scan_root() instead of pci_scan_bus_with_sysdata() (Bjorn Helgaas) - x86: Use pcibios_scan_root() instead of pci_scan_bus_on_node() (Bjorn Helgaas) - x86: Merge pci_scan_bus_on_node() into pcibios_scan_root() (Bjorn Helgaas) - x86: Drop return value of pcibios_scan_root() (Bjorn Helgaas) NUMA - x86: Add x86_pci_root_bus_node() to look up NUMA node from PCI bus (Bjorn Helgaas) - x86: Use x86_pci_root_bus_node() instead of get_mp_bus_to_node() (Bjorn Helgaas) - x86: Remove mp_bus_to_node[], set_mp_bus_to_node(), get_mp_bus_to_node() (Bjorn Helgaas) - x86: Use NUMA_NO_NODE, not -1, for unknown node (Bjorn Helgaas) - x86: Remove acpi_get_pxm() usage (Bjorn Helgaas) - ia64: Use NUMA_NO_NODE, not MAX_NUMNODES, for unknown node (Bjorn Helgaas) - ia64: Remove acpi_get_pxm() usage (Bjorn Helgaas) - ACPI: Fix acpi_get_node() prototype (Bjorn Helgaas) Resource management - i2o: Fix and refactor PCI space allocation (Bjorn Helgaas) - Add resource_contains() (Bjorn Helgaas) - Add %pR support for IORESOURCE_UNSET (Bjorn Helgaas) - Mark resources as IORESOURCE_UNSET if we can't assign them (Bjorn Helgaas) - Don't clear IORESOURCE_UNSET when updating BAR (Bjorn Helgaas) - Check IORESOURCE_UNSET before updating BAR (Bjorn Helgaas) - Don't try to claim IORESOURCE_UNSET resources (Bjorn Helgaas) - Mark 64-bit resource as IORESOURCE_UNSET if we only support 32-bit (Bjorn Helgaas) - Don't enable decoding if BAR hasn't been assigned an address (Bjorn Helgaas) - Add "weak" generic pcibios_enable_device() implementation (Bjorn Helgaas) - alpha, microblaze, sh, sparc, tile: Use default pcibios_enable_device() (Bjorn Helgaas) - s390: Use generic pci_enable_resources() (Bjorn Helgaas) - Don't check resource_size() in pci_bus_alloc_resource() (Bjorn Helgaas) - Set type in __request_region() (Bjorn Helgaas) - Check all IORESOURCE_TYPE_BITS in pci_bus_alloc_from_region() (Bjorn Helgaas) - Change pci_bus_alloc_resource() type_mask to unsigned long (Bjorn Helgaas) - Log IDE resource quirk in dmesg (Bjorn Helgaas) - Revert "[PATCH] Insert GART region into resource map" (Bjorn Helgaas) PCI device hotplug - Make check_link_active() non-static (Rajat Jain) - Use link change notifications for hot-plug and removal (Rajat Jain) - Enable link state change notifications (Rajat Jain) - Don't disable the link permanently during removal (Rajat Jain) - Don't check adapter or latch status while disabling (Rajat Jain) - Disable link notification across slot reset (Rajat Jain) - Ensure very fast hotplug events are also processed (Rajat Jain) - Add hotplug_lock to serialize hotplug events (Rajat Jain) - Remove a non-existent card, regardless of "surprise" capability (Rajat Jain) - Don't turn slot off when hot-added device already exists (Yijing Wang) MSI - Keep pci_enable_msi() documentation (Alexander Gordeev) - ahci: Fix broken single MSI fallback (Alexander Gordeev) - ahci, vfio: Use pci_enable_msi_range() (Alexander Gordeev) - Check kmalloc() return value, fix leak of name (Greg Kroah-Hartman) - Fix leak of msi_attrs (Greg Kroah-Hartman) - Fix pci_msix_vec_count() htmldocs failure (Masanari Iida) Virtualization - Device-specific ACS support (Alex Williamson) Freescale i.MX6 - Wait for retraining (Marek Vasut) Marvell MVEBU - Use Device ID and revision from underlying endpoint (Andrew Lunn) - Fix incorrect size for PCI aperture resources (Jason Gunthorpe) - Call request_resource() on the apertures (Jason Gunthorpe) - Fix potential issue in range parsing (Jean-Jacques Hiblot) Renesas R-Car - Check platform_get_irq() return code (Ben Dooks) - Add error interrupt handling (Ben Dooks) - Fix bridge logic configuration accesses (Ben Dooks) - Register each instance independently (Magnus Damm) - Break out window size handling (Magnus Damm) - Make the Kconfig dependencies more generic (Magnus Damm) Synopsys DesignWare - Fix RC BAR to be single 64-bit non-prefetchable memory (Mohit Kumar) Miscellaneous - Remove unused SR-IOV VF Migration support (Bjorn Helgaas) - Enable INTx if BIOS left them disabled (Bjorn Helgaas) - Fix hex vs decimal typo in cpqhpc_probe() (Dan Carpenter) - Clean up par-arch object file list (Liviu Dudau) - Set IORESOURCE_ROM_SHADOW only for the default VGA device (Sander Eikelenboom) - ACPI, ARM, drm, powerpc, pcmcia, PCI: Use list_for_each_entry() for bus traversal (Yijing Wang) - Fix pci_bus_b() build failure (Paul Gortmaker)" * tag 'pci-v3.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (108 commits) Revert "[PATCH] Insert GART region into resource map" PCI: Log IDE resource quirk in dmesg PCI: Change pci_bus_alloc_resource() type_mask to unsigned long PCI: Check all IORESOURCE_TYPE_BITS in pci_bus_alloc_from_region() resources: Set type in __request_region() PCI: Don't check resource_size() in pci_bus_alloc_resource() s390/PCI: Use generic pci_enable_resources() tile PCI RC: Use default pcibios_enable_device() sparc/PCI: Use default pcibios_enable_device() (Leon only) sh/PCI: Use default pcibios_enable_device() microblaze/PCI: Use default pcibios_enable_device() alpha/PCI: Use default pcibios_enable_device() PCI: Add "weak" generic pcibios_enable_device() implementation PCI: Don't enable decoding if BAR hasn't been assigned an address PCI: Enable INTx in pci_reenable_device() only when MSI/MSI-X not enabled PCI: Mark 64-bit resource as IORESOURCE_UNSET if we only support 32-bit PCI: Don't try to claim IORESOURCE_UNSET resources PCI: Check IORESOURCE_UNSET before updating BAR PCI: Don't clear IORESOURCE_UNSET when updating BAR PCI: Mark resources as IORESOURCE_UNSET if we can't assign them ... Conflicts: arch/x86/include/asm/topology.h drivers/ata/ahci.c
2014-04-01Merge branches 'acpi-processor' and 'pnp'Rafael J. Wysocki1-27/+0
* acpi-processor: Revert "ACPI / processor: Make it possible to get APIC ID via GIC" * pnp: PNP: remove deprecated IRQF_DISABLED
2014-04-01Merge branch 'acpica'Rafael J. Wysocki15-121/+272
* acpica: ACPICA: Enable auto-serialization as a default kernel behavior. ACPICA: Ignore sync_level for methods that have been auto-serialized. ACPICA: Add additional named objects for the auto-serialize method scan. ACPICA: Add auto-serialization support for ill-behaved control methods. ACPICA: Remove global option to serialize all control methods.
2014-03-26Revert "ACPI / processor: Make it possible to get APIC ID via GIC"Hanjun Guo1-27/+0
Revert commit df86f5df79d8 (ACPI / processor: Make it possible to get APIC ID via GIC). APIC ID refers the hardware ID of the CPU, which means MPIDR on ARM/ARM64, but in ACPI 5.0, GIC ID feild in GIC structure have no explicit definition and may not refer to the MPIDR. Commit df86f5df79d8 assumed that gic->gic_id as MPIDR which may not be the case, so revert it until the explicit definition of GIC structure is ready. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> [rjw: Changelog] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-26ACPICA: Enable auto-serialization as a default kernel behavior.Lv Zheng2-7/+7
The previous commit "ACPICA: Add auto-serialization support for ill-behaved control methods" introduced the auto-serialization facility as a workaround that can be enabled by "acpi_auto_serialize": This feature marks control methods that create named objects as "serialized" to avoid unwanted AE_ALREADY_EXISTS control method evaluation failures. Enable method auto-serialization as the default kernel behavior. The new kernel parameter is also changed from "acpi_auto_serialize" to "acpi_no_auto_serialize" to reflect the default behavior. References: https://bugzilla.kernel.org/show_bug.cgi?id=52191 References: http://www.spinics.net/lists/linux-acpi/msg49496.html Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-26ACPICA: Ignore sync_level for methods that have been auto-serialized.Bob Moore2-6/+21
Cannot use a sync_level for methods that have been serialized at load-time or runtime because this may interfere with any existing use of sync_levels within the ASL code. So, we simply ignore the sync_level for these methods, thus preserving any existing sync_level priorities. Note, the use of sync_levels is actually rather rare within BIOS ASL code. References: http://www.spinics.net/lists/linux-acpi/msg49496.html Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Reported-by: Sabrina Dubroka <sd@queasysnail.net> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-26ACPICA: Add additional named objects for the auto-serialize method scan.Lv Zheng1-2/+4
This change adds some additional opcodes that are detected and will cause a method to be auto-serialized. These opcodes are the various CreateXField and the FieldUnit opcodes. Lv Zheng. References: https://bugzilla.kernel.org/show_bug.cgi?id=52191 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-26ACPICA: Add auto-serialization support for ill-behaved control methods.Bob Moore11-25/+243
This change adds support to automatically mark a control method as "serialized" if the method creates any named objects. This will positively prevent the method from being entered by more than one thread and thus preventing a possible abort when an attempt is made to create an object twice. Implemented by parsing all non-serialize control methods at table load time. This feature is disabled by default and this patch also adds a new Linux kernel parameter "acpi_auto_serialize" to allow this feature to be turned on for a specific boot. References: https://bugzilla.kernel.org/show_bug.cgi?id=52191 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-26ACPICA: Remove global option to serialize all control methods.Lv Zheng5-100/+16
According to the reports, the "acpi_serialize" mechanism is broken as: A. The parallel method calls can still happen when the interpreter lock is released under the following conditions: 1. External callbacks are invoked, for example, by the region handlers, the exception handlers, etc.; 2. Module level execution is performed when Load/LoadTable opcodes are executed, and 3. The _REG control methods are invoked to complete the region registrations. B. For the following situations, the interpreter lock need to be released even for a serialized method while currently, the lock-releasing operation is marked as a no-op by acpi_ex_relinquish/reacquire_interpreter() when this mechanism is enabled: 1. Wait opcode is executed, 2. Acquire opcode is executed, and 3. Sleep opcode is executed. This patch removes this mechanism and the internal acpi_ex_relinquish/reacquire_interpreter() APIs. Lv Zheng. References: https://bugzilla.kernel.org/show_bug.cgi?id=52191 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-21Merge branch 'acpi-processor'Rafael J. Wysocki1-21/+57
* acpi-processor: ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h ACPI / processor: Make it possible to get APIC ID via GIC ACPI / processor: Build idle_boot_override on x86 and ia64 ACPI / processor: Use ACPI_PROCESSOR_DEVICE_HID instead of "ACPI0007" ACPI / processor: Fix acpi_processor_eval_pdc() return value type
2014-03-20Merge branches 'pm-runtime' and 'pm-sleep'Rafael J. Wysocki1-3/+38
* pm-runtime: PM / Runtime: Update runtime_idle() documentation for return value meaning * pm-sleep: PM / sleep: Correct whitespace errors in <linux/pm.h> PM: Add missing "freeze" state PM / Hibernate: Spelling s/anonymouns/anonymous/ PM / Runtime: Add missing "it" in comment PM / suspend: Remove unnecessary !! PCI / PM: Resume runtime-suspended devices later during system suspend ACPI / PM: Resume runtime-suspended devices later during system suspend PM / sleep: Set pm_generic functions to NULL for !CONFIG_PM_SLEEP PM: fix typo in comment PM / hibernate: use name_to_dev_t to parse resume PM / wakeup: Include appropriate header file in kernel/power/wakelock.c PM / sleep: Move prototype declaration to header file kernel/power/power.h PM / sleep: Asynchronous threads for suspend_late PM / sleep: Asynchronous threads for suspend_noirq PM / sleep: Asynchronous threads for resume_early PM / sleep: Asynchronous threads for resume_noirq PM / sleep: Two flags for async suspend_noirq and suspend_late
2014-03-20Merge branches 'pm-qos', 'pm-domains' and 'pm-drivers'Rafael J. Wysocki3-5/+87
* pm-qos: PM / QoS: Add type to dev_pm_qos_add_ancestor_request() arguments ACPI / LPSS: Support for device latency tolerance PM QoS ACPI / scan: Add bind/unbind callbacks to struct acpi_scan_handler PM / QoS: Introcuce latency tolerance device PM QoS type PM / QoS: Add no_constraints_value field to struct pm_qos_constraints PM / QoS: Rename device resume latency QoS items * pm-domains: PM / domains: Turn latency warning into debug message * pm-drivers: PM: Add pm_runtime_suspend|resume_force functions PM / runtime: Fetch runtime PM callbacks using a macro
2014-03-20Merge branch 'acpica'Rafael J. Wysocki170-491/+770
* acpica: (29 commits) ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." ACPICA: Update version to 20140214. ACPICA: Prevent infinite loops when traversing corrupted lists. ACPICA: Debugger: Add missing objects; Traverse linked lists ACPICA: Add text: ACPICA policy for new _OSI strings. No functional change. ACPICA: Update for _PRP predefined name. ACPICA: Cleanup/improve global variable declarations. ACPICA: Comment update - no functional change. ACPICA: Do not abort _PRT repair on a single subpackage failure. ACPICA: Harden _PRT repair code; check for minimum package length. ACPICA: Restore code that repairs NULL package elements in return values. ACPICA: Properly handle NULL entries in _PRT return packages. ACPICA: Update conditional compilation flags for resource dump functions. ACPICA: Predefined names: Add support for the _PRP method. ACPICA: Headers: Deploy #pragma pack (push) and (pop). ACPICA: Add boot option to disable auto return object repair ACPICA: acpidump: Remove integer types translation protection. ACPICA: acpidump: Add sparse declarators support. ACPICA: Add "Windows 2013" string to _OSI support. ACPICA: Update version to 20140114. ...
2014-03-20Merge branches 'acpi-battery' and 'acpi-video'Rafael J. Wysocki5-6/+40
* acpi-battery: ACPI / AC: recheck adapter status upon battery status changes ACPI / battery: call ACPI notifier chain in acpi_battery_notify ACPI / battery: move some ACPI_BATTERY_* definitions to header * acpi-video: video / output: Drop display output class support fujitsu-laptop: Drop unneeded include acer-wmi: Stop selecting VIDEO_OUTPUT_CONTROL ACPI / gpu / drm: Stop selecting VIDEO_OUTPUT_CONTROL ACPI / video: fix ACPI_VIDEO dependencies
2014-03-20Merge branches 'acpi-cleanup', 'acpi-thermal', 'acpi-pci', 'acpi-lpss' and ↵Rafael J. Wysocki17-110/+129
'acpi-button' * acpi-cleanup: ACPI: Remove duplicate definitions of PREFIX ACPI / tables: Replace printk with pr_* * acpi-thermal: ACPI / thermal: make acpi_thermal_check asynchronous on resume * acpi-pci: ACPI / PCI: Do not call ISA-specific code if ISA is not supported * acpi-lpss: ACPI / LPSS: Add Intel BayTrail ACPI mode PWM * acpi-button: ACPI / button: Add ACPI Button event via netlink routine
2014-03-20ACPI / video: fix ACPI_VIDEO dependenciesJean Delvare1-1/+1
ACPI_VIDEO stopped depending on VIDEO_OUTPUT_CONTROL over 3 years ago (see commit 677bd810, "ACPI video: remove output switching control".) So it's about time to remove the Kconfig dependency between these two options. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-19ACPI / button: Add ACPI Button event via netlink routineLan Tianyu1-0/+4
Commit 1696d9d (ACPI: Remove the old /proc/acpi/event interface) removed ACPI Button event which originally was sent to userspace via /proc/acpi/event. This caused ACPI shutdown regression on gentoo in VirtualBox. Now ACPI events are sent to userspace via netlink, so add ACPI Button event back via netlink routine. References: https://bugzilla.kernel.org/show_bug.cgi?id=71721 Reported-and-tested-by: Richard Musil <richard.musil@gmail.com> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Cc: 3.11+ <stable@vger.kernel.org> # 3.11+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-19ACPI: Remove duplicate definitions of PREFIXHanjun Guo12-22/+1
We already have a macro for PREFIX of "ACPI: " in drivers/acpi/internal.h, so remove the duplicate ones in ACPI drivers when internal.h is included. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-19ACPI / AC: recheck adapter status upon battery status changesAlexander Mezin1-0/+25
On HP Pavilion dv6-6179er there are no notifications when AC adapter is plugged/unplugged. However, when AC status is read (acpi_ac_get_state), and if AC status has changed, AML code triggers the notification. This patch solves the problem by re-reading AC adapter status upon ACPI_BATTERY_NOTIFY_STATUS notification. Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com> Acked-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-19ACPI / battery: call ACPI notifier chain in acpi_battery_notifyAlexander Mezin1-0/+1
Allow other drivers to subscribe to battery status notifications. Just like AC driver does. Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com> Acked-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-19ACPI / battery: move some ACPI_BATTERY_* definitions to headerAlexander Mezin3-5/+13
ACPI_BATTERY_CLASS is used in multiple places. Also, I'll use ACPI_BATTERY_NOTIFY_STATUS inside AC driver in one of following patches. So, create a header file and move ACPI_BATTERY_CLASS and ACPI_BATTERY_NOTIFY_* definitions into it. Also, remove copy of ACPI_BATTERY_CLASS from sbs.c Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-18ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)."Robert Moore18-70/+1
This reverts commit aae576e5faefa8ba70647efa320d4747b6375f1e. Push and Pop are not portable "enough", and caused problems for some ACPICA customers. Signed-off-by: Robert Moore <Robert.Moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-18Merge branch 'acpi-config' into acpicaRafael J. Wysocki2-14/+14
Conflicts: include/acpi/platform/aclinux.h
2014-03-18ACPICA: Prevent infinite loops when traversing corrupted lists.Bob Moore3-4/+32
This change hardens the ACPICA code to detect circular linked object lists and prevent an infinite loop if such corruption exists. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-18ACPICA: Debugger: Add missing objects; Traverse linked listsBob Moore2-34/+199
This change adds support for two missing objects, the "extra" and "data" secondary objects, as well as adding support to traverse and display linked lists related to ACPICA objects. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-18ACPICA: Add text: ACPICA policy for new _OSI strings. No functional change.Bob Moore1-0/+25
Adds further information about why new _OSI strings should be adopted by all hosts as soon as possible. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-18ACPICA: Update for _PRP predefined name.Bob Moore1-1/+1
Allow objects of type "reference" in the second subpackage element. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-18ACPICA: Cleanup/improve global variable declarations.Lv Zheng2-201/+189
This change cleans up the entire global variable mechaninism including the related macros. Also reduces warnings from the "sparse" utility in the Linux environment. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-18ACPICA: Comment update - no functional change.Bob Moore6-37/+37
Change all instances of "sub-package" to "subpackage" for consistency. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-17Merge branch 'acpi-fan'Rafael J. Wysocki1-4/+9
* acpi-fan: ACPI / fan: do nothing in suspend and poweroff callback
2014-03-17Merge branch 'acpi-ost'Rafael J. Wysocki5-51/+37
* acpi-ost: ACPI: Drop acpi_evaluate_hotplug_ost() and ACPI_HOTPLUG_OST ACPI: use device name LNXSYBUS.xx for ACPI \_SB and \_TZ objects ACPI / processor: use acpi_evaluate_ost() to replace open-coded version ACPI / PAD / xen: use acpi_evaluate_ost() to replace open-coded version ACPI / PAD: use acpi_evaluate_ost() to replace open-coded version ACPI: rename acpi_evaluate_hotplug_ost() to acpi_evaluate_ost()
2014-03-17Merge branch 'acpi-config'Rafael J. Wysocki2-14/+14
* acpi-config: ACPI: Remove Kconfig symbol ACPI_PROCFS ACPI / APEI: Remove X86 redundant dependency for APEI GHES. ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE_ONLY
2014-03-17Merge branch 'acpi-hotplug'Rafael J. Wysocki6-365/+179
* acpi-hotplug: ACPI / hotplug: Rework deferred execution of acpi_device_hotplug() ACPI / dock: Update copyright notice ACPI / dock: Drop remove_dock_dependent_devices() ACPI / dock: Drop struct acpi_dock_ops and all code related to it ACPI / ATA: Add hotplug contexts to ACPI companions of SATA devices ACPI / dock: Add .uevent() callback to struct acpi_hotplug_context ACPI / dock: Use callback pointers from devices' ACPI hotplug contexts ACPI / dock: Use ACPI device object pointers instead of ACPI handles ACPI / hotplug: Add .fixup() callback to struct acpi_hotplug_context ACPI / hotplug / PCI: Do not clear event callback pointer for docks ACPI / dock: Associate dock platform devices with ACPI device objects ACPI / dock: Pass ACPI device pointer to acpi_device_is_battery() ACPI / dock: Dispatch dock notifications from the global notify handler
2014-03-17Merge branch 'acpi-pci-hotplug'Rafael J. Wysocki5-114/+164
* acpi-pci-hotplug: (23 commits) ACPI / hotplug / PCI: Use pci_device_is_present() ACPI / hotplug / PCI: Add ACPIPHP contexts to devices handled by PCIeHP ACPI / hotplug / PCI: Rename register_slot() to acpiphp_add_context() ACPI / hotplug / PCI: Execute _EJ0 under the ACPI scan lock ACPI / hotplug / PCI: Rework acpiphp_check_host_bridge() ACPI / hotplug / PCI: Hotplug notifications from acpi_bus_notify() ACPI / hotplug / PCI: Simplify acpi_install_hotplug_notify_handler() ACPI / hotplug / PCI: Rework the handling of eject requests ACPI / hotplug / PCI: Consolidate ACPIPHP with ACPI core hotplug ACPI / hotplug / PCI: Define hotplug context lock in the core ACPI / hotplug: Fix potential race in acpi_bus_notify() ACPICA: Introduce acpi_get_data_full() and rework acpi_get_data() ACPI / hotplug / PCI: Do not pass ACPI handle to hotplug_event() ACPI / hotplug / PCI: Use acpi_handle_debug() in hotplug_event() ACPI / hotplug / PCI: Simplify hotplug_event() ACPI / hotplug / PCI: Drop crit_sect locking ACPI / hotplug / PCI: Drop acpiphp_bus_add() ACPI / hotplug / PCI: Store acpi_device pointer in acpiphp_context ACPI / hotplug / PCI: Rework acpiphp_no_hotplug() ACPI / hotplug / PCI: Drop acpiphp_bus_trim() ...
2014-03-13ACPI / sleep: Add extra checks for HW Reduced ACPI mode sleep statesRafael J. Wysocki1-17/+15
If the HW Reduced ACPI mode bit is set in the FADT, ACPICA uses the optional sleep control and sleep status registers for making the system enter sleep states (including S5), so it is not possible to use system sleep states or power it off using ACPI if the HW Reduced ACPI mode bit is set and those registers are not available. For this reason, add a new function, acpi_sleep_state_supported(), checking if the HW Reduced ACPI mode bit is set and whether or not system sleep states are usable in that case in addition to checking the return value of acpi_get_sleep_type_data() and make the ACPI sleep setup routines use that function to check the availability of system sleep states. Among other things, this prevents the kernel from attempting to use ACPI for powering off HW Reduced ACPI systems without the sleep control and sleep status registers, because ACPI power off doesn't have a chance to work on them. That allows alternative power off mechanisms that may actually work to be used on those systems. The affected machines include Dell Venue 8 Pro, Asus T100TA, Haswell Desktop SDP and Ivy Bridge EP Demo depot. References: https://bugzilla.kernel.org/show_bug.cgi?id=70931 Reported-by: Adam Williamson <awilliam@redhat.com> Tested-by: Aubrey Li <aubrey.li@linux.intel.com> Cc: 3.4+ <stable@vger.kernel.org> # 3.4+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-09Revert "ACPI / sleep: pm_power_off needs more sanity checks to be installed"Rafael J. Wysocki1-6/+1
Revert commit 3130497f5bab ("ACPI / sleep: pm_power_off needs more sanity checks to be installed") that breaks power ACPI power off on a lot of systems, because it checks wrong registers. Fixes: 3130497f5bab ("ACPI / sleep: pm_power_off needs more sanity checks to be installed") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-03-08Merge branches 'acpi-resources', 'acpi-ec' and 'acpi-sleep'Rafael J. Wysocki3-1/+80
* acpi-resources: ACPI / resources: ignore invalid ACPI device resources * acpi-ec: ACPI / EC: Clear stale EC events on Samsung systems * acpi-sleep: ACPI / sleep: pm_power_off needs more sanity checks to be installed
2014-03-06ACPI / EC: Clear stale EC events on Samsung systemsKieran Clancy1-0/+64
A number of Samsung notebooks (530Uxx/535Uxx/540Uxx/550Pxx/900Xxx/etc) continue to log events during sleep (lid open/close, AC plug/unplug, battery level change), which accumulate in the EC until a buffer fills. After the buffer is full (tests suggest it holds 8 events), GPEs stop being triggered for new events. This state persists on wake or even on power cycle, and prevents new events from being registered until the EC is manually polled. This is the root cause of a number of bugs, including AC not being detected properly, lid close not triggering suspend, and low ambient light not triggering the keyboard backlight. The bug also seemed to be responsible for performance issues on at least one user's machine. Juan Manuel Cabo found the cause of bug and the workaround of polling the EC manually on wake. The loop which clears the stale events is based on an earlier patch by Lan Tianyu (see referenced attachment). This patch: - Adds a function acpi_ec_clear() which polls the EC for stale _Q events at most ACPI_EC_CLEAR_MAX (currently 100) times. A warning is logged if this limit is reached. - Adds a flag EC_FLAGS_CLEAR_ON_RESUME which is set to 1 if the DMI system vendor is Samsung. This check could be replaced by several more specific DMI vendor/product pairs, but it's likely that the bug affects more Samsung products than just the five series mentioned above. Further, it should not be harmful to run acpi_ec_clear() on systems without the bug; it will return immediately after finding no data waiting. - Runs acpi_ec_clear() on initialisation (boot), from acpi_ec_add() - Runs acpi_ec_clear() on wake, from acpi_ec_unblock_transactions() References: https://bugzilla.kernel.org/show_bug.cgi?id=44161 References: https://bugzilla.kernel.org/show_bug.cgi?id=45461 References: https://bugzilla.kernel.org/show_bug.cgi?id=57271 References: https://bugzilla.kernel.org/attachment.cgi?id=126801 Suggested-by: Juan Manuel Cabo <juanmanuel.cabo@gmail.com> Signed-off-by: Kieran Clancy <clancy.kieran@gmail.com> Reviewed-by: Lan Tianyu <tianyu.lan@intel.com> Reviewed-by: Dennis Jansen <dennis.jansen@web.de> Tested-by: Kieran Clancy <clancy.kieran@gmail.com> Tested-by: Juan Manuel Cabo <juanmanuel.cabo@gmail.com> Tested-by: Dennis Jansen <dennis.jansen@web.de> Tested-by: Maurizio D'Addona <mauritiusdadd@gmail.com> Tested-by: San Zamoyski <san@plusnet.pl> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-05ACPI / thermal: make acpi_thermal_check asynchronous on resumeAaron Lu1-4/+33
On resume we do not need to wait for acpi_thermal_check to finish. Instead, we can run it asynchronously and not block the whole system resume. Also, we make sure when we are suspending again, previously queued work for acpi_thermal_check is done. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-05ACPI / hotplug: Rework deferred execution of acpi_device_hotplug()Rafael J. Wysocki4-14/+11
Since the only function executed by acpi_hotplug_execute() is acpi_device_hotplug() and it only is called by the ACPI core, simplify its definition so that it only takes two arguments, the ACPI device object pointer and event code, rename it to acpi_hotplug_schedule() and move its header from acpi_bus.h to the ACPI core's internal header file internal.h. Modify the definition of acpi_device_hotplug() so that its first argument is an ACPI device object pointer and modify the definition of struct acpi_hp_work accordingly. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Toshi Kani <toshi.kani@hp.com>
2014-03-04ACPI / PM: Resume runtime-suspended devices later during system suspendRafael J. Wysocki1-3/+38
Runtime-suspended devices are resumed during system suspend by acpi_subsys_prepare() for two reasons: First, because they may need to be reprogrammed in order to change their wakeup settings and, second, because they may need to be operatonal for their children to be successfully suspended. That is a problem, though, if there are many runtime-suspended devices that need to be resumed this way during system suspend, because the .prepare() PM callbacks of devices are executed sequentially and the times taken by them accumulate, which may increase the total system suspend time quite a bit. For this reason, move the resume of runtime-suspended devices up to the next phase of device suspend (during system suspend), except for the ones that have power.ignore_children set. The exception is made, because the devices with power.ignore_children set may still be necessary for their children to be successfully suspended (during system suspend) and they won't be resumed automatically as a result of the runtime resume of their children. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-03ACPI / sleep: pm_power_off needs more sanity checks to be installedLi, Aubrey1-1/+6
Sleep control and status registers need santity checks as well before ACPI installs acpi_power_off to pm_power_off hook. The checking code in acpi_enter_sleep_state() is too late, we should not allow a not-working pm_power_off function to be hooked up. Signed-off-by: Aubrey Li <aubrey.li@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-02ACPI / tables: Replace printk with pr_*Hanjun Guo1-73/+55
This patch just does some cleanup to replace printk with pr_*, and introduces pr_fmt() to remove all PREFIXs in tables.c, no functional change. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-01ACPI / resources: ignore invalid ACPI device resourcesZhang Rui1-0/+10
ACPI table may export resource entry with 0 length. But the current code interprets this kind of resource in a wrong way. It will create a resource structure with res->end = acpi_resource->start + acpi_resource->len - 1; This patch fixes a problem on my machine that a platform device fails to be created because one of its ACPI IO resource entry (start = 0, end = 0, length = 0) is translated into a generic resource with start = 0, end = 0xffffffff. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-27ACPICA: Do not abort _PRT repair on a single subpackage failure.Bob Moore1-8/+9
Always examine all subpackages for reversed entries. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-27ACPICA: Harden _PRT repair code; check for minimum package length.Bob Moore1-1/+7
This change prevents a fault during the repair by checking up front if the _PRT subpackage contains the minimum number of elements (4). Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-27ACPICA: Restore code that repairs NULL package elements in return values.Lv Zheng1-4/+21
The original code was lost accidently, it was not generated along with the following commit of mechanism improvements and thus not get merged: Commit: d5a36100f62fa6db5541344e08b361b34e9114c5 Subject: ACPICA: Add mechanism for early object repairs on a per-name basis Adds the framework to allow object repairs very early in the return object analysis. Enables repairs like string->unicode, etc. This patch restores the implementation of the NULL element repair code for ACPI_RTYPE_NONE. In the original design, ACPI_RTYPE_NONE is defined to collect simple NULL object repairs. Lv Zheng. Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=67901 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Cc: 3.10+ <stable@vger.kernel.org> # 3.10+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-27ACPICA: Properly handle NULL entries in _PRT return packages.Lv Zheng1-3/+3
This change enables proper handling of NULL package entries in a _PRT return value, during construction of the PCI routing table. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-27ACPICA: Update conditional compilation flags for resource dump functions.Lv Zheng1-1/+1
Corrects ACPI_DISASSEMBLER to the compile conditions. The wrong condition was introduced by this commit: Commit: 3334861b1e9947631230b573eba27bcd778b93c8 Subject: ACPICA: Update the conditions to enable the utility resource dump strings. This was detected in the ACPICA upstream. Linux is not affected by the wrong commit as the disassembler is not shipped in the Linux. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>