summaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)AuthorFilesLines
2014-08-14Merge branch 'x86-apic-for-linus' of ↵Linus Torvalds1-1/+6
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86/apic updates from Thomas Gleixner: "This is a major overhaul to the x86 apic subsystem consisting of the following parts: - Remove obsolete APIC driver abstractions (David Rientjes) - Use the irqdomain facilities to dynamically allocate IRQs for IOAPICs. This is a prerequisite to enable IOAPIC hotplug support, and it also frees up wasted vectors (Jiang Liu) - Misc fixlets. Despite the hickup in Ingos previous pull request - caused by the missing fixup for the suspend/resume issue reported by Borislav - I strongly recommend that this update finds its way into 3.17. Some history for you: This is preparatory work for physical IOAPIC hotplug. The first attempt to support this was done by Yinghai and I shot it down because it just added another layer of obscurity and complexity to the already existing mess without tackling the underlying shortcomings of the current implementation. After quite some on- and offlist discussions, I requested that the design of this functionality must use generic infrastructure, i.e. irq domains, which provide all the mechanisms to dynamically map linux interrupt numbers to physical interrupts. Jiang picked up the idea and did a great job of consolidating the existing interfaces to manage the x86 (IOAPIC) interrupt system by utilizing irq domains. The testing in tip, Linux-next and inside of Intel on various machines did not unearth any oddities until Borislav exposed it to one of his oddball machines. The issue was resolved quickly, but unfortunately the fix fell through the cracks and did not hit the tip tree before Ingo sent the pull request. Not entirely Ingos fault, I also assumed that the fix was already merged when Ingo asked me whether he could send it. Nevertheless this work has a proper design, has undergone several rounds of review and the final fallout after applying it to tip and integrating it into Linux-next has been more than moderate. It's the ground work not only for IOAPIC hotplug, it will also allow us to move the lowlevel vector allocation into the irqdomain hierarchy, which will benefit other architectures as well. Patches are posted already, but they are on hold for two weeks, see below. I really appreciate the competence and responsiveness Jiang has shown in course of this endavour. So I'm sure that any fallout of this will be addressed in a timely manner. FYI, I'm vanishing for 2 weeks into my annual kids summer camp kitchen duty^Wvacation, while you folks are drooling at KS/LinuxCon :) But HPA will have a look at the hopefully zero fallout until I'm back" * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (53 commits) x86, irq, PCI: Keep IRQ assignment for PCI devices during suspend/hibernation x86/apic/vsmp: Make is_vsmp_box() static x86, apic: Remove enable_apic_mode callback x86, apic: Remove setup_portio_remap callback x86, apic: Remove multi_timer_check callback x86, apic: Replace noop_check_apicid_used x86, apic: Remove check_apicid_present callback x86, apic: Remove mps_oem_check callback x86, apic: Remove smp_callin_clear_local_apic callback x86, apic: Replace trampoline physical addresses with defaults x86, apic: Remove x86_32_numa_cpu_node callback x86: intel-mid: Use the new io_apic interfaces x86, vsmp: Remove is_vsmp_box() from apic_is_clustered_box() x86, irq: Clean up irqdomain transition code x86, irq, devicetree: Release IOAPIC pin when PCI device is disabled x86, irq, SFI: Release IOAPIC pin when PCI device is disabled x86, irq, mpparse: Release IOAPIC pin when PCI device is disabled x86, irq, ACPI: Release IOAPIC pin when PCI device is disabled x86, irq: Introduce helper functions to release IOAPIC pin x86, irq: Simplify the way to handle ISA IRQ ...
2014-08-08x86, irq, PCI: Keep IRQ assignment for PCI devices during suspend/hibernationJiang Liu1-0/+4
Now IOAPIC driver dynamically allocates IRQ numbers for IOAPIC pins. We need to keep IRQ assignment for PCI devices during suspend/hibernation, otherwise it may cause failure of suspend/hibernation due to: 1) Device driver calls pci_enable_device() to allocate an IRQ number and register interrupt handler on the returned IRQ. 2) Device driver's suspend callback calls pci_disable_device() and release assigned IRQ in turn. 3) Device driver's resume callback calls pci_enable_device() to allocate IRQ number again. A different IRQ number may be assigned by IOAPIC driver this time. 4) Now the hardware delivers interrupt to the new IRQ but interrupt handler is still registered against the old IRQ, so it breaks suspend/hibernation. To fix this issue, we keep IRQ assignment during suspend/hibernation. Flag pci_dev.dev.power.is_prepared is used to detect that pci_disable_device() is called during suspend/hibernation. Reported-and-Tested-by: Borislav Petkov <bp@suse.de> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Len Brown <lenb@kernel.org> Link: http://lkml.kernel.org/r/1407478071-29399-1-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2014-08-07Merge tag 'pm+acpi-3.17-rc1' of ↵Linus Torvalds45-641/+2204
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI and power management updates from Rafael Wysocki: "Again, ACPICA leads the pack (47 commits), followed by cpufreq (18 commits) and system suspend/hibernation (9 commits). From the new code perspective, the ACPICA update brings ACPI 5.1 to the table, including a new device configuration object called _DSD (Device Specific Data) that will hopefully help us to operate device properties like Device Trees do (at least to some extent) and changes related to supporting ACPI on ARM. Apart from that we have hibernation changes making it use radix trees to store memory bitmaps which should speed up some operations carried out by it quite significantly. We also have some power management changes related to suspend-to-idle (the "freeze" sleep state) support and more preliminary changes needed to support ACPI on ARM (outside of ACPICA). The rest is fixes and cleanups pretty much everywhere. Specifics: - ACPICA update to upstream version 20140724. That includes ACPI 5.1 material (support for the _CCA and _DSD predefined names, changes related to the DMAR and PCCT tables and ARM support among other things) and cleanups related to using ACPICA's header files. A major part of it is related to acpidump and the core code used by that utility. Changes from Bob Moore, David E Box, Lv Zheng, Sascha Wildner, Tomasz Nowicki, Hanjun Guo. - Radix trees for memory bitmaps used by the hibernation core from Joerg Roedel. - Support for waking up the system from suspend-to-idle (also known as the "freeze" sleep state) using ACPI-based PCI wakeup signaling (Rafael J Wysocki). - Fixes for issues related to ACPI button events (Rafael J Wysocki). - New device ID for an ACPI-enumerated device included into the Wildcat Point PCH from Jie Yang. - ACPI video updates related to backlight handling from Hans de Goede and Linus Torvalds. - Preliminary changes needed to support ACPI on ARM from Hanjun Guo and Graeme Gregory. - ACPI PNP core cleanups from Arjun Sreedharan and Zhang Rui. - Cleanups related to ACPI_COMPANION() and ACPI_HANDLE() macros (Rafael J Wysocki). - ACPI-based device hotplug cleanups from Wei Yongjun and Rafael J Wysocki. - Cleanups and improvements related to system suspend from Lan Tianyu, Randy Dunlap and Rafael J Wysocki. - ACPI battery cleanup from Wei Yongjun. - cpufreq core fixes from Viresh Kumar. - Elimination of a deadband effect from the cpufreq ondemand governor and intel_pstate driver cleanups from Stratos Karafotis. - 350MHz CPU support for the powernow-k6 cpufreq driver from Mikulas Patocka. - Fix for the imx6 cpufreq driver from Anson Huang. - cpuidle core and governor cleanups from Daniel Lezcano, Sandeep Tripathy and Mohammad Merajul Islam Molla. - Build fix for the big_little cpuidle driver from Sachin Kamat. - Configuration fix for the Operation Performance Points (OPP) framework from Mark Brown. - APM cleanup from Jean Delvare. - cpupower utility fixes and cleanups from Peter Senna Tschudin, Andrey Utkin, Himangi Saraogi, Rickard Strandqvist, Thomas Renninger" * tag 'pm+acpi-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (118 commits) ACPI / LPSS: add LPSS device for Wildcat Point PCH ACPI / PNP: Replace faulty is_hex_digit() by isxdigit() ACPICA: Update version to 20140724. ACPICA: ACPI 5.1: Update for PCCT table changes. ACPICA/ARM: ACPI 5.1: Update for GTDT table changes. ACPICA/ARM: ACPI 5.1: Update for MADT changes. ACPICA/ARM: ACPI 5.1: Update for FADT changes. ACPICA: ACPI 5.1: Support for the _CCA predifined name. ACPICA: ACPI 5.1: New notify value for System Affinity Update. ACPICA: ACPI 5.1: Support for the _DSD predefined name. ACPICA: Debug object: Add current value of Timer() to debug line prefix. ACPICA: acpihelp: Add UUID support, restructure some existing files. ACPICA: Utilities: Fix local printf issue. ACPICA: Tables: Update for DMAR table changes. ACPICA: Remove some extraneous printf arguments. ACPICA: Update for comments/formatting. No functional changes. ACPICA: Disassembler: Add support for the ToUUID opererator (macro). ACPICA: Remove a redundant cast to acpi_size for ACPI_OFFSET() macro. ACPICA: Work around an ancient GCC bug. ACPI / processor: Make it possible to get local x2apic id via _MAT ...
2014-08-06Merge branches 'acpi-video', 'acpi-battery', 'acpi-processor' and 'acpi-lpss'Rafael J. Wysocki4-1/+21
* acpi-video: ACPI / video: Add use_native_backlight quirk for HP EliteBook 2014 models * acpi-battery: ACPI / battery: remove duplicated include from battery.c * acpi-processor: ACPI / processor: Make it possible to get local x2apic id via _MAT * acpi-lpss: ACPI / LPSS: add LPSS device for Wildcat Point PCH
2014-08-06Merge branch 'acpi-pnp'Rafael J. Wysocki1-6/+2
* acpi-pnp: ACPI / PNP: Replace faulty is_hex_digit() by isxdigit() ACPI / PNP: Fix acpi_pnp_match()
2014-08-06Merge branch 'acpica'Rafael J. Wysocki12-58/+272
* acpica: ACPICA: Update version to 20140724. ACPICA: ACPI 5.1: Update for PCCT table changes. ACPICA/ARM: ACPI 5.1: Update for GTDT table changes. ACPICA/ARM: ACPI 5.1: Update for MADT changes. ACPICA/ARM: ACPI 5.1: Update for FADT changes. ACPICA: ACPI 5.1: Support for the _CCA predifined name. ACPICA: ACPI 5.1: New notify value for System Affinity Update. ACPICA: ACPI 5.1: Support for the _DSD predefined name. ACPICA: Debug object: Add current value of Timer() to debug line prefix. ACPICA: acpihelp: Add UUID support, restructure some existing files. ACPICA: Utilities: Fix local printf issue. ACPICA: Tables: Update for DMAR table changes. ACPICA: Remove some extraneous printf arguments. ACPICA: Update for comments/formatting. No functional changes. ACPICA: Disassembler: Add support for the ToUUID opererator (macro). ACPICA: Remove a redundant cast to acpi_size for ACPI_OFFSET() macro. ACPICA: Work around an ancient GCC bug.
2014-08-01ACPI / LPSS: add LPSS device for Wildcat Point PCHJie Yang1-0/+10
INT3438 is the ADSP device on Wildcat Point platform with 2 DW DMA engines built In. The DMA engines are used for DSP FW loading and audio data transferring. These DMA engine probing need the clock, without it, probing may failed and can't go forward. Add LPSS device "INT3438" for Wildcat Point PCH, to provide clock for its ADSP DMA engine probing. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-08-01ACPI / PNP: Replace faulty is_hex_digit() by isxdigit()Arjun Sreedharan1-6/+2
0 is ascii for NULL. Hex digit matching should be from '0'. Faulty version returns true for #,$,%,& etc. Signed-off-by: Arjun Sreedharan <arjun024@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-31ACPICA: ACPI 5.1: Support for the _CCA predifined name.Bob Moore1-0/+3
Full support for _CCA. 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-07-31ACPICA: ACPI 5.1: New notify value for System Affinity Update.Bob Moore1-2/+3
New value for the Notify() operator. 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-07-31ACPICA: ACPI 5.1: Support for the _DSD predefined name.David E. Box1-1/+12
Adds full support for _DSD. David Box. Signed-off-by: David E. Box <david.e.box@linux.intel.com> 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-07-31ACPICA: Debug object: Add current value of Timer() to debug line prefix.Bob Moore1-1/+10
Simplifies timing of things like control method execution. [zetalog: fixing 64-bit division link error] 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-07-31ACPICA: acpihelp: Add UUID support, restructure some existing files.Bob Moore6-28/+217
This adds a -u option to acpi_help to display all known ACPI UUIDs. Some existing files in the core code have been restructured. Three new files. [zetalog: changing drivers/acpi/acpica/Makefile accordingly] 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-07-31ACPICA: Utilities: Fix local printf issue.Lv Zheng1-0/+3
The bug can be reproduced by using a format that do not have the width.prec specified after a format that have the width.prec specified. The second formatted output will be wrong. The root cause is acpi_ut_vsnprintf() doesn't reset the specifiers to the default values. This patch fixes this issue. BZ 1094. Reported by Yizhe Wang, fixed by Lv Zheng. Since acpi_ut_vprintf() is only enabled for specific OSPM now, this patch doesn't affect Linux kernel. Link: https://bugs.acpica.org/show_bug.cgi?id=1094 Reported-and-tested-by: Yizhe Wang <yizhe.wang@intel.com> 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-07-31ACPICA: Remove some extraneous printf arguments.Sascha Wildner2-5/+4
Arguments that have no associated % format specifier. Apparently these are not caught by any current compilers. ACPICA BZ 1090. Sascha Wildner. Currently, this patch only affects applications under the toos/power/acpi folder. Link: https://bugs.acpica.org/show_bug.cgi?id=1090 Signed-off-by: Sascha Wildner <swildner@gmail.com> 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-07-31ACPICA: Update for comments/formatting. No functional changes.Bob Moore1-12/+10
Fix some issues detected by acpisrc utility. 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-07-31ACPICA: Disassembler: Add support for the ToUUID opererator (macro).Bob Moore1-6/+7
This change adds support to disassemble a UUID back to the original ToUUID operator. It will detect a UUID within a standard AML Buffer. Also, a description of the UUID is emitted for "known" UUIDs, defined as UUIDs that are defined in the ACPI specification. Since this is a change for disassembler which is not shipped in the Linux kernel, the Linux kernel is not affected. 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-07-31ACPICA: Work around an ancient GCC bug.Bob Moore1-3/+3
warning: cast from function call of type 'char *' to non-matching type 'long unsigned int' Since acpi_ut_format_number() hasn't been enabled for the Linux kernel, this patch doesn't affect the Linux kernel. 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-07-30Merge tag 'please-pull-apei' into x86/rasH. Peter Anvin11-181/+418
APEI is currently implemented so that it depends on x86 hardware. The primary dependency is that GHES uses the x86 NMI for hardware error notification and MCE for memory error handling. These patches remove that dependency. Other APEI features such as error reporting via external IRQ, error serialization, or error injection, do not require changes to use them on non-x86 architectures. The following patch set eliminates the APEI Kconfig x86 dependency by making these changes: - treat NMI notification as GHES architecture - HAVE_ACPI_APEI_NMI - group and wrap around #ifdef CONFIG_HAVE_ACPI_APEI_NMI code which is used only for NMI path - identify architectural boxes and abstract it accordingly (tlb flush and MCE) - rework ioremap for both IRQ and NMI context NMI code is kept in ghes.c file since NMI and IRQ context are tightly coupled. Note, these patches introduce no functional changes for x86. The NMI notification feature is hard selected for x86. Architectures that want to use this feature should also provide NMI code infrastructure.
2014-07-30ACPI / processor: Make it possible to get local x2apic id via _MATHanjun Guo1-0/+2
Logical processors with APIC ID values of 255 and greater are required to have a Processor Device object and must convey the processor's APIC information to OSPM using the Processor Local X2APIC structure, but not until ACPI 5.1, X2APIC structure was not supported in _MAT method. _MAT is needed for CPU hotplug and system with more than 255 CPUs will definitely need X2APIC structure, so add its support in map_mat_entry() to make it possible to get local x2apic id via _MAT based on ACPI 5.1. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-30ACPI / battery: remove duplicated include from battery.cWei Yongjun1-1/+0
Remove duplicated include. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-30ACPI / video: Add use_native_backlight quirk for HP EliteBook 2014 modelsHans de Goede1-0/+9
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1123565 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-30Merge back earlier acpi-pnp material.Rafael J. Wysocki1-2/+0
Conflicts: drivers/pnp/pnpacpi/core.c
2014-07-28Merge branches 'acpi-video' and 'acpi-hotplug'Rafael J. Wysocki3-86/+98
* acpi-video: ACPI: move models with win8 brightness problems from win8 blacklist to use_native_backlight ACPI / video: Fix backlight taking 2 steps on a brightness up/down keypress * acpi-hotplug: ACPI / hotplug / PCI: Fix sparse non static symbol warning ACPI / hotplug: Simplify acpi_set_hp_context() ACPI / hotplug / PCI: Eliminate acpiphp_dev_to_bridge()
2014-07-28Merge branches 'acpi-pnp' and 'acpi-pci'Rafael J. Wysocki1-2/+0
* acpi-pnp: ACPI / PNP: Use ACPI_COMPANION() instead of ACPI_HANDLE() ACPI / PNP: do ACPI binding directly * acpi-pci: ACPI / PCI: Use ACPI_COMPANION() instead of ACPI_HANDLE()
2014-07-28Merge branches 'acpi-pm', 'acpi-sleep' and 'acpi-button'Rafael J. Wysocki4-70/+110
* acpi-pm: ACPI / PM: Use ACPI_COMPANION() instead of ACPI_HANDLE() ACPI / PM: Always enable wakeup GPEs when enabling device wakeup ACPI / PM: Revork the handling of ACPI device wakeup notifications PM: Create PM workqueue if runtime PM is not configured too * acpi-sleep: ACPI / sleep: Do not save NVS for new machines to accelerate S3 * acpi-button: ACPI / button: Do not propagate wakeup-from-suspend events
2014-07-28Merge branch 'acpi-gpe'Rafael J. Wysocki1-13/+16
* acpi-gpe: ACPI / scan: No implicit wake notification for buttons
2014-07-28Merge branch 'acpi-config'Rafael J. Wysocki7-200/+222
* acpi-config: ACPI / processor: Introduce ARCH_MIGHT_HAVE_ACPI_PDC ACPI: Don't use acpi_lapic in ACPI core code ACPI: add config for BIOS table scan
2014-07-28Merge branch 'acpi-headers'Rafael J. Wysocki2-4/+1
* acpi-headers: ACPI: Add support to force header inclusion rules for <acpi/acpi.h>. ACPI / SFI: Fix wrong <acpi/acpi.h> inclusion in SFI/ACPI wrapper - table definitions. ACPICA: Linux: Allow ACPICA inclusion for CONFIG_ACPI=n builds. ACPICA: Linux: Add support to exclude <asm/acenv.h> inclusion. ACPICA: Linux: Add stub implementation of ACPICA 64-bit mathematics. ACPICA: Linux: Add stub support for Linux specific variables and functions.
2014-07-28Merge branch 'acpica'Rafael J. Wysocki20-205/+1466
* acpica: (30 commits) ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake. ACPICA: GPEs: Do not allow enable for GPEs that have no handler(s). ACPICA: Fix a regression for deletion of Alias() objects. ACPICA: Update version to 20140627 ACPICA: Tables: Merge DMAR table structure updates ACPICA: Hardware: back port of a recursive locking fix ACPICA: utprint/oslibcfs: cleanup - no functional change ACPICA: Executer: Fix trivial issues in acpi_get_serial_access_bytes() ACPICA: OSL: Update acpidump to reduce source code differences ACPICA: acpidump: Reduce freopen() invocations to improve portability ACPICA: acpidump: Replace file IOs with new APIs to improve portability ACPICA: acpidump: Remove exit() from generic layer to improve portability ACPICA: acpidump: Add memory/string OSL usage to improve portability ACPICA: Common: Enhance acpi_getopt() to improve portability ACPICA: Common: Enhance cm_get_file_size() to improve portability ACPICA: Application: Enhance ACPI_USAGE_xxx/ACPI_OPTION with acpi_os_printf() to improve portability ACPICA: Utilities: Introduce acpi_log_error() to improve portability ACPICA: Utilities: Add formatted printing APIs ACPICA: OSL: Add portable file IO to improve portability ACPICA: OSL: Clean up acpi_os_printf()/acpi_os_vprintf() stubs ...
2014-07-24ACPI / sleep: Do not save NVS for new machines to accelerate S3Lan Tianyu1-0/+5
NVS region is saved and restored unconditionally for machines without nvs_nosave quirk during S3. Tested some new machines and the operation is not necessary. Saving NVS region also affects S2RAM speed. The time of NVS saving and restoring depends on the size of NVS region and it consumes 7~10ms normally. This patch is to make machines produced from 2012 to now not saving NVS region to accelerate S3. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-24ACPI / scan: No implicit wake notification for buttonsRafael J. Wysocki1-13/+16
The ACPI device enumeration code in Linux assumes that buttons always are wakeup devices, so it calls acpi_setup_gpe_for_wake() for them which leads to undesirable side effects. Namely, that function sets up implicit device wake notification mechanism for a given GPE if there is no handler method in the ACPI namespace, which from the ACPICA's perspective means that there always is a way to handle that GPE if enabled. However, we don't handle wake notify events for buttons, so if there are no handler methods for their GPEs in the namespace, enabling a button GPE at run time leads to a GPE storm in some cases (the GPE triggers, ACPICA carries out the implicit wake notification for it which isn't handled, so the GPE triggers again and so on). To prevent that from happening use acpi_mark_gpe_for_wake() instead of acpi_setup_gpe_for_wake() for buttons which will cause ACPICA to only enable button GPEs if there are handler methods for the in the namespace. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-24Merge branch 'acpica' into acpi-gpeRafael J. Wysocki20-205/+1466
2014-07-24ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake.Rafael J. Wysocki1-0/+47
ACPICA commit c49dbfed2bc069d0038ea7e1294409bfde7c2c8c Some potential callers of acpi_setup_gpe_for_wake may know in advance that there won't be any notify handlers installed for device wake notifications from the given GPE (one example is a button GPE in Linux). For these cases, acpi_mark_gpe_for_wake should be used instead of acpi_setup_gpe_for_wake. This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to setup implicit wake notification for it (since there's no handler method). Rafael Wysocki. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-07-24ACPICA: GPEs: Do not allow enable for GPEs that have no handler(s).Rafael J. Wysocki1-3/+11
ACPICA commit 23b5a8542283af28c3a3a4e3f81096d6e2569faa There is no point in enabling a GPE that has no handler or GPE method. At worst, it can cause GPE floods. Rafael Wysocki. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-07-23ACPI: Add support to force header inclusion rules for <acpi/acpi.h>.Lv Zheng1-1/+1
As there is only CONFIG_ACPI=n processing in the <linux/acpi.h>, it is not safe to include <acpi/acpi.h> directly for source out of Linux ACPI subsystems. This patch adds error messaging to warn developers of such wrong inclusions. In order not to be bisected and reverted as a wrong commit, warning messages are carefully split into a seperate patch other than the wrong inclusion cleanups. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-23ACPI / PM: Use ACPI_COMPANION() instead of ACPI_HANDLE()Rafael J. Wysocki1-12/+9
The ACPI_HANDLE() macro evaluates ACPI_COMPANION() internally to return the handle of the device's ACPI companion, so it is much more straightforward and efficient to use ACPI_COMPANION() directly to obtain the device's ACPI companion object instead of using ACPI_HANDLE() and acpi_bus_get_device() on the returned handle for the same thing. Do that in three places in the ACPI device PM code. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-23ACPI / PM: Always enable wakeup GPEs when enabling device wakeupRafael J. Wysocki1-32/+17
Wakeup GPEs are currently only enabled when setting up devices for remote wakeup at run time. During system-wide transitions they are enabled by ACPICA at the very last stage of suspend (before asking the BIOS to take over). Of course, that only works for system sleep states supported by ACPI, so in particular it doesn't work for the "freeze" sleep state. For this reason, modify the ACPI core device PM code to enable wakeup GPEs for devices when setting them up for wakeup regardless of whether that is remote wakeup at runtime or system wakeup. That allows the same device wakeup setup routine to be used for both runtime PM and system-wide PM and makes it possible to reduce code size quite a bit. This make ACPI-based PCI Wake-on-LAN work with the "freeze" sleep state on my venerable Toshiba Portege R500 and should help other systems too. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-23ACPI / PM: Revork the handling of ACPI device wakeup notificationsRafael J. Wysocki2-23/+59
Since ACPI wakeup GPEs are going to be enabled during system suspend as well as for runtime wakeup by a subsequent patch and the same notify handlers will be used in both cases, rework the ACPI device wakeup notification framework so that the part specific to physical devices is always run asynchronously from the PM workqueue. This prevents runtime resume callbacks for those devices from being run during system suspend and resume which may not be appropriate, among other things. Also make ACPI device wakeup notification handling a bit more robust agaist subsequent removal of ACPI device objects, whould that ever happen, and create a wakeup source object for each ACPI device configured for wakeup so that wakeup notifications for those devices can wake up the system from the "freeze" sleep state. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-23ACPI / button: Do not propagate wakeup-from-suspend eventsRafael J. Wysocki1-4/+21
During system suspend mark ACPI buttons (other than the lid) as "suspended" and if in that state, report wakeup events on button events, but do not propagate those events up the stack. This prevents systems from being turned off after a button-triggered wakeup from the "freeze" sleep state. Link: https://bugzilla.kernel.org/show_bug.cgi?id=77611 Tested-on: Acer Aspire S5, Toshiba Portege R500 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-23acpi, apei, ghes: Factor out ioremap virtual memory for IRQ and NMI context.Tomasz Nowicki1-7/+11
GHES currently maps two pages with atomic_ioremap. From now on, NMI is architectural depended so there is no need to allocate an NMI page for platforms without NMI support. To make it possible to not use a second page, swap the existing page order so that the IRQ context page is first, and the optional NMI context page is second. Then, use HAVE_ACPI_APEI_NMI to decide how many pages are to be allocated. Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Tony Luck <tony.luck@intel.com>
2014-07-23acpi, apei, ghes: Make NMI error notification to be GHES architecture extension.Tomasz Nowicki2-53/+104
Currently APEI depends on x86 architecture. It is because of NMI hardware error notification of GHES which is currently supported by x86 only. However, many other APEI features can be still used perfectly by other architectures. This commit adds two symbols: 1. HAVE_ACPI_APEI for those archs which support APEI. 2. HAVE_ACPI_APEI_NMI which is used for NMI code isolation in ghes.c file. NMI related data and functions are grouped so they can be wrapped inside one #ifdef section. Appropriate function stubs are provided for !NMI case. Note there is no functional changes for x86 due to hard selected HAVE_ACPI_APEI and HAVE_ACPI_APEI_NMI symbols. Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Tony Luck <tony.luck@intel.com>
2014-07-23apei, mce: Factor out APEI architecture specific MCE calls.Tomasz Nowicki3-32/+16
This commit abstracts MCE calls and provides weak corresponding default implementation for those architectures which do not need arch specific actions. Each platform willing to do additional architectural actions should provides desired function definition. It allows us to avoid wrap code into #ifdef in generic code and prevent new platform from introducing dummy stub function too. Initially, there are two APEI arch-specific calls: - arch_apei_enable_cmcff() - arch_apei_report_mem_error() Both interact with MCE driver for X86 architecture. Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Tony Luck <tony.luck@intel.com>
2014-07-21ACPI / processor: Introduce ARCH_MIGHT_HAVE_ACPI_PDCHanjun Guo5-198/+215
The use of _PDC is deprecated in ACPI 3.0 in favor of _OSC, as ARM platform is supported only in ACPI 5.0 or higher version, _PDC will not be used in ARM platform, so make Make _PDC only for platforms with Intel CPUs. Introduce ARCH_MIGHT_HAVE_ACPI_PDC and move _PDC related code in ACPI processor driver into a single file processor_pdc.c, make x86 and ia64 select it when ACPI is enabled. This patch also use pr_* to replace printk to fix the checkpatch warning and factor acpi_processor_alloc_pdc() a little bit to avoid duplicate pr_err() code. Suggested-by: Robert Richter <rric@kernel.org> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-21ACPI: Don't use acpi_lapic in ACPI core codeGraeme Gregory1-1/+1
Now ARM64 support is being added to ACPI so architecture specific values can not be used in core ACPI code. Following on the patch "ACPI / processor: Check if LAPIC is present during initialization" which uses acpi_lapic in acpi_processor.c, on ARM64 platform, GIC is used instead of local APIC, so acpi_lapic is not a suitable value for ARM64. What is actually important at this point is if there is/are CPU entry/entries (Local APIC/SAPIC, GICC) in MADT, so introduce acpi_has_cpu_in_madt() to be arch specific and generic. Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-21ACPI: add config for BIOS table scanGraeme Gregory2-1/+6
With the addition of ARM64 that does not have a traditional BIOS to scan, add a config option which is selected on x86 (ia64 doesn't need it either, it is EFI/UEFI based system) to do the traditional BIOS scanning for tables. Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-21ACPI: move models with win8 brightness problems from win8 blacklist to ↵Hans de Goede2-68/+68
use_native_backlight When the windows8 related backlight problems became evident, 2 approaches were follow in parallel, one was to stop claiming to be windows 8 / 2012, the other was to tell acpi_video to stop registering a backlight driver. I've read all the threads and it seems that which approach ended up being applied to which model laptop was never really a concious decision (AFAIK): https://bugzilla.kernel.org/show_bug.cgi?id=51231 https://bugzilla.kernel.org/show_bug.cgi?id=60682 So lets move all the models which are only on the win8 blacklist because of brightness issues to the use_native_backlight list, which is the smaller hammer to use to solve the backlight issues. Making this change is esp. attractive now that 3.16 has video.use_native_brightness=1 by default. If that new default does not get reverted because of regressions, then we can drop all the models with a use_native_backlight quirk, greatly reducing the number of models we've a quirk for. Link: https://bugzilla.kernel.org/show_bug.cgi?id=51231 Link: https://bugzilla.kernel.org/show_bug.cgi?id=60682 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-21ACPI / video: Fix backlight taking 2 steps on a brightness up/down keypressLinus Torvalds1-17/+27
In various scenarious userspace will respond to brightness up/down keypresses by increasing/decreasing the backlight brightness itself. If the kernel then also changes the brightness this results in the brightness having changed 2 steps for a single keypress which is undesirable. See e.g. : https://bugs.launchpad.net/gnome-settings-daemon/+bug/527157 http://askubuntu.com/questions/173921/why-does-my-thinkpad-brightness-control-skip-steps This commit delays responding to brightness up/down keypresses by 100 ms and if userspace in that time responds by changing the backlight itself, cancels the kernels own handling of these keypresses, fixing the 2 steps issue. Link: http://marc.info/?l=linux-kernel&m=140535721100839&w=2 [hdegoede@redhat.com: Move the delayed_work struct into struct acpi_video_device instead of having it as a global] [hdegoede@redhat.com: Keep brightness_switch_enabled as a boolean and always delay the keypress handling] Tested-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-20ACPICA: Linux: Add stub support for Linux specific variables and functions.Lv Zheng1-3/+0
There are global variables and functions not upstreamed to the ACPICA code base. Such symbols still can be referenced by external users as they are listed in the acpixf.h. This patch uses ACPI_GLOBAL and ACPI_EXTERNAL_RETURN_STATUS mechanism to add stub support for such symbols. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-16ACPI / video: Add use_native_backlight quirk for HP ProBook 4540sHans de Goede1-0/+8
As reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1025690 This is yet another model which needs this quirk. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1025690 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>