summaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2014-01-12Merge branch 'acpi-dsm'Rafael J. Wysocki
* acpi-dsm: ACPI / extlog: replace open-coded _DSM code with helper functions ACPI / nouveau: replace open-coded _DSM code with helper functions nouveau / ACPI: fix memory leak in ACPI _DSM related code ACPI / i915: replace open-coded _DSM code with helper functions ACPI / i2c-hid: replace open-coded _DSM code with helper functions ACPI / TPM: detect PPI features by checking availability of _DSM functions ACPI / TPM: replace open-coded _DSM code with helper functions ACPI / TPM: match node name instead of full path when searching for TPM device PCI / pci-label: treat PCI label with index 0 as valid label ACPI / PCI: replace open-coded _DSM code with helper functions PCI / pci-label: release allocated ACPI object on error recovery path ACPI: introduce helper interfaces for _DSM method
2014-01-12Merge branch 'acpica'Rafael J. Wysocki
* acpica: (21 commits) ACPICA: Update version to 20131218. ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global. ACPICA: Linuxize: Cleanup spaces after special macro invocations. ACPICA: Interpreter: Add additional debug info for an error case. ACPICA: Update ACPI example code to make it an actual working program. ACPICA: Add an error message if the Debugger fails initialization. ACPICA: Conditionally define a local variable that is used for debug only. ACPICA: Parser: Updates/fixes for debug output. ACPICA: Enhance ACPI warning for memory/IO address conflicts. ACPICA: Update several debug statements - no functional change. ACPICA: Improve exception handling for GPE block installation. ACPICA: Add helper macros to extract bus/segment numbers from HEST table. ACPICA: Tables: Add full support for the PCCT table, update table definition. ACPICA: Tables: Add full support for the DBG2 table. ACPICA: Add option to favor 32-bit FADT addresses. ACPICA: Cleanup the option of forcing the use of the RSDT. ACPICA: Back port and refine validation of the XSDT root table. ACPICA: Linux Header: Remove unused OSL prototypes. ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change. ACPICA: Disassembler: Improve pathname support for emitted External() statements. ...
2014-01-12Merge branch 'acpi-hotplug'Rafael J. Wysocki
* acpi-hotplug: ACPI / scan: ACPI device object sysfs attribute for _STA evaluation ACPI / hotplug / driver core: Handle containers in a special way ACPI / hotplug: Add demand_offline hotplug profile flag ACPI / bind: Move acpi_get_child() to drivers/ide/ide-acpi.c ACPI / bind: Pass struct acpi_device pointer to acpi_bind_one() ACPI / bind: Rework struct acpi_bus_type ACPI / bind: Redefine acpi_preset_companion() ACPI / bind: Redefine acpi_get_child() PCI / ACPI: Use acpi_find_child_device() for child devices lookup ACPI / bind: Simplify child device lookups ACPI / scan: Use direct recurrence for device hierarchy walks ACPI: Introduce acpi_set_device_status() ACPI / hotplug: Drop unfinished global notification handling routines ACPI / hotplug: Rework generic code to handle suprise removals ACPI / hotplug: Move container-specific code out of the core ACPI / hotplug: Make ACPI PCI root hotplug use common hotplug code ACPI / hotplug: Introduce common hotplug function acpi_device_hotplug() ACPI / hotplug: Do not fail bus and device checks for disabled hotplug ACPI / scan: Add acpi_device objects for all device nodes in the namespace ACPI / scan: Define non-empty device removal handler
2014-01-12Merge branch 'acpi-cleanup'Rafael J. Wysocki
* acpi-cleanup: (22 commits) ACPI / tables: Return proper error codes from acpi_table_parse() and fix comment. ACPI / tables: Check if id is NULL in acpi_table_parse() ACPI / proc: Include appropriate header file in proc.c ACPI / EC: Remove unused functions and add prototype declaration in internal.h ACPI / dock: Include appropriate header file in dock.c ACPI / PCI: Include appropriate header file in pci_link.c ACPI / PCI: Include appropriate header file in pci_slot.c ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c ACPI / NVS: Include appropriate header file in nvs.c ACPI / OSL: Mark the function acpi_table_checksum() as static ACPI / processor: initialize a variable to silence compiler warning ACPI / processor: use ACPI_COMPANION() to get ACPI device ACPI: correct minor typos ACPI / sleep: Drop redundant acpi_disabled check ACPI / dock: Drop redundant acpi_disabled check ACPI / table: Replace '1' with specific error return values ACPI: remove trailing whitespace ACPI / IBFT: Fix incorrect <acpi/acpi.h> inclusion in iSCSI boot firmware module ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h> SFI / ACPI: Fix warnings reported during builds with W=1 ... Conflicts: drivers/acpi/nvs.c drivers/hwmon/asus_atk0110.c
2014-01-12Merge tag 'ras_for_3.14_p2' of ↵Ingo Molnar
git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras into x86/ras Pull RAS updates from Borislav Petkov: " SCI reporting for other error types not only correctable ones + APEI GHES cleanups + mce timer fix " Signed-off-by: Ingo Molnar <mingo@kernel.org>
2014-01-12Merge tag 'v3.13-rc8' into x86/ras, to pick up fixes.Ingo Molnar
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2014-01-11ACPI / scan: ACPI device object sysfs attribute for _STA evaluationSrinivas Pandruvada
This patch adds a "status" attribute for an ACPI device. This status attribute shows the value of the _STA object. The _STA object returns current status of an ACPI device: enabled, disabled, functioning, present. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> [rjw: Subject and changelog] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-11ACPI / sleep: remove panic in case hardware has changed after S4Oliver Neukum
Some BIOSes change hardware based on the state of a laptop's lid. If the lid is closed, the touchpad is disabled and the checksum changes. Windows 8 no longer aborts resume if the checksum has changed. Signed-off-by: Oliver Neukum <oneukum@suse.de> [rjw: Use pr_crit() for the message and don't break the string] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-11ACPI / scan: bail out early if failed to parse APIC ID for CPUJiang Liu
Enhance ACPI CPU hotplug driver to print clear error message and bail out early if BIOS returns wrong value in ACPI MADT table or _MAT method. Otherwise it will add the CPU device even if failed to get APIC ID and fails any operations against sysfs interface: /sys/devices/system/cpu/cpux/online Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-11ACPI / cpuidle: remove dev->state_count settingBartlomiej Zolnierkiewicz
dev->state_count is now always equal to drv->state_count and drv->state_count no longer can change during driver's lifetime so the default dev->state_count initialization in cpuidle_enable_device() (called from cpuidle_register_device()) can be used instead. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-11ACPI / cpuidle: fix max idle state handling with hotplug CPU supportBartlomiej Zolnierkiewicz
acpi_processor_hotplug() calls acpi_processor_setup_cpuidle_cx() without calling acpi_processor_setup_cpuidle_states() first so it is possible that dev->state_count becomes different from drv->state_count (in case of SMP system with unsupported C2/C3 states + enabled CPU hotplug and num_online_cpus() becoming > 1). The driver code assumes that cpuidle core will handle such cases but currently this is untrue (dev->state_count is used only for handling cpuidle state sysfs entries and drv->state_count is used for all other cases) and will not be fixed in the future as dev->state_count is planned to be removed. Fix the issue by checking for the max supported idle state in C2/C3 state's ->enter handler (acpi_idle_enter_simple() for C2/C3 and acpi_idle_enter_bm() for C3 + bm_check flag set) and setting the C1 state (instead of higher states) when needed. Also remove no longer needed max idle state checks from acpi_processor_setup_cpuidle_[states,cx](). Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-08ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global.Lv Zheng
This global is acting as an OSL global variable, implemented in the oswinxf.c and osunixxf.c. This patch cleans up the definition of this variable so that new utilities do not need to define it in order to link. Linux kernel behaviour is not affected as the changes only applies to the ACPICA userspace utilities which are not shipped in the kernel currently. 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-01-08ACPICA: Linuxize: Cleanup spaces after special macro invocations.Lv Zheng
This patch reflects the improvment of a cleanup step which is performed in the release process. There are still spaces in the "linuxized" ACPICA files after special macro invocations. This is because indent treats comments and pre-processor directives as spaces, thus we need to skip them. Before applying this patch, cleanup code will search from keyword back to end of line and wipe spaces between them. After applying this patch, cleanup code will search to the end of the macro invocations, skip "empty lines", "comments" and "pre-processor directives", then wipe the spaces between the new line and the first non-spaces characters. Following improvements are thus achieved in the release automation by this commit which are originally maintained manually: - acpi_status acpi_ev_remove_global_lock_handler(void); +acpi_status acpi_ev_remove_global_lock_handler(void); - acpi_status +acpi_status acpi_ev_match_gpe_method(acpi_handle obj_handle, - acpi_status acpi_subsystem_status(void); +acpi_status acpi_subsystem_status(void); - acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, +acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, - acpi_status +acpi_status acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout); - acpi_status +acpi_status acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b); - acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); Some empty lines are restored by this commit due to the change of the removal implementation. 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-01-08ACPICA: Interpreter: Add additional debug info for an error case.Bob Moore
Emit the name of the namespace node for the error case when there is no subobject attached to the node. 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-01-08ACPICA: Add an error message if the Debugger fails initialization.Bob Moore
Previously, only status was returned. Linux kernel behaviour is not affected as the changes only apply to the debugger which is currently not shipped in the 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-01-08ACPICA: Conditionally define a local variable that is used for debug only.Bob Moore
This patch improves the relationship between the opcode debugging information and CONFIG_ACPI_DEBUG enablement. 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-01-08ACPICA: Parser: Updates/fixes for debug output.Bob Moore
Major changes in this patch are made to improve the debug output mode of the compiler. Linux kernel behaviour is not affected as the change only applies to the compiler which is not shipped in 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-01-08ACPICA: Enhance ACPI warning for memory/IO address conflicts.Bob Moore
This change improves the warning message when a system address conflicts with an existing operation region. It now emits the region address range in addition to the input (system) address range. Reported-by: Prarit Bhargava <prarit@redhat.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-01-08ACPICA: Update several debug statements - no functional change.Bob Moore
Update the format and information emitted from several debug output statements. 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-01-08ACPICA: Improve exception handling for GPE block installation.Bob Moore
1) Return an actual status value from acpi_ev_get_gpe_xrupt_block. 2) Don't clobber the status when exiting acpi_ev_install_gpe_block. References: https://bugs.acpica.org/show_bug.cgi?id=1019 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-01-08ACPICA: Add option to favor 32-bit FADT addresses.Bob Moore
This change adds an option to favor 32-bit FADT addresses when there is a conflict between the 32-bit and 64-bit versions of the same address. The default behavior is to use the 64-bit version in accordance with the ACPI specification. This can now be overridden via the AcpiGbl_Use32BitFadtAddresses flag. Lv Zheng. Also, the "Convert FADT" and "Verify FADT" functions have been merged to simplify the code, make it easier to understand, and make it easier to maintain. Bob Moore. References: https://bugs.acpica.org/show_bug.cgi?id=885 References: https://bugs.acpica.org/show_bug.cgi?id=993 Original-by: Lv Zheng <lv.zheng@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-01-08ACPICA: Cleanup the option of forcing the use of the RSDT.Lv Zheng
This change adds a runtime option that will force ACPICA to use the RSDT instead of the XSDT. Although the ACPI spec requires that an XSDT be used instead of the RSDT, the XSDT has been found to be corrupt or ill-formed on some machines. This option is already in the Linux kernel. When it is back ported to ACPICA, code is re-written to follow ACPICA coding style. This patch is the generation of the integration. 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-01-08ACPICA: Back port and refine validation of the XSDT root table.Lv Zheng
Some platforms contain an XSDT that is ill-formed or otherwise invalid (such as containing some or all entries that are NULL pointers). This change adds a new function to validate the XSDT before actually using it. If the XSDT is found to be invalid, ACPICA will now fall back to using the RSDT instead. This feature is already in the Linux kernel. When it is back ported to ACPICA, code is refined to follow ACPICA coding style and this patch is the generation of the integration. Original-by: Zhao Yakui <yakui.zhao@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-01-08ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.Lv Zheng
This macro is no longer used by ACPICA and it is not public. Also update comments related to the use of ACPI_ALLOCATE_BUFFER and the use of acpi_os_free (kfree is equivalent and prefered in the kernel) to free the buffer. 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-01-08ACPICA: Disassembler: Improve pathname support for emitted External() ↵Bob Moore
statements. This change adds full pathname support for external names that have been resolved internally by the inclusion of additional ACPI tables (via the iASL -e option). Without this change, the disassembler can emit multiple externals for the same object, or it become confused when the Scope() operator is used on an external object. Linux kernel behaviour is not affected as the structure changes and the new invocations are only used by compiler and disassembler which are not shipped in the kernel currently. Reported-by: Michael Tsirkin <mst@redhat.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-01-08ACPICA: Debug output: Fix a couple of small output issues.Bob Moore
1) Fix utcache to use the proper return macros in order to maintain the function nesting level. 2) Enable the function nesting level for all ACPI applications instead of just acpiexec. Linux kernel behaviour is not affected by this patch as Linux doesn't use ACPICA object cache mechanism currently. 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-01-08ACPI / thermal: remove const from thermal_zone_device_ops declarationEmil Goode
The following commit introduced the requirement to not declare thermal_zone_device_ops structs as const in order to allow changing the .get_temp callback. commit 4e5e4705bf69ea450f58fc709ac5888f321a9299 Author: Eduardo Valentin <eduardo.valentin@ti.com> Date: Wed Jul 3 15:35:39 2013 -0400 thermal: introduce device tree parser Modify acpi_thermal_zone_ops to follow the new requirement. Signed-off-by: Emil Goode <emilgoode@gmail.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> [rjw: Changelog] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06Merge branches 'acpi-battery' and 'pm-cpufreq'Rafael J. Wysocki
* acpi-battery: ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS * pm-cpufreq: intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters.
2014-01-06ACPI / Battery: Add a _BIX quirk for NEC LZ750/LSLan Tianyu
The AML method _BIX of NEC LZ750/LS returns a broken package which skips the first member "Revision" (ACPI 5.0, Table 10-234). Add a quirk for this machine to skip member "Revision" during parsing the package returned by _BIX. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=67351 Reported-and-tested-by: Francisco Castro <fcr@adinet.com.uy> Cc: 3.8+ <stable@vger.kernel.org> " 3.8+ Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / tables: Return proper error codes from acpi_table_parse() and fix ↵tangchen
comment. The comment about return value of acpi_table_parse() is incorrect. This patch fix it. Since all callers only check if the function succeeded or not, this patch simplifies the semantics by returning -errno for all failure cases. This will also simply the comment. As suggested by Toshi Kani <toshi.kani@hp.com>, also change the stub in linux/acpi.h to return -ENODEV. Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / tables: Check if id is NULL in acpi_table_parse()tangchen
strncmp() does not check if the params are NULL. In acpi_table_parse(), if @id is NULL, the kernel will panic. Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / proc: Include appropriate header file in proc.cRashika
Include appropriate header file internal.h in proc.c because function acpi_sleep_proc_init() has its prototype declaration in internal.h. This eliminates the following warning in proc.c: drivers/acpi/proc.c:148:12: warning: no previous prototype for ‘acpi_sleep_proc_init’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / EC: Remove unused functions and add prototype declaration in internal.hRashika
Adds the prototype declarations of functions acpi_ec_add_query_handler() and acpi_ec_remove_query_handler() in header file internal.h and removes unused functions ec_burst_enable() and ec_burst_disable() in ec.c. This eliminates the following warnings in ec.c: drivers/acpi/ec.c:393:5: warning: no previous prototype for ‘ec_burst_enable’ [-Wmissing-prototypes] drivers/acpi/ec.c:402:5: warning: no previous prototype for ‘ec_burst_disable’ [-Wmissing-prototypes] drivers/acpi/ec.c:531:5: warning: no previous prototype for ‘acpi_ec_add_query_handler’ [-Wmissing-prototypes] drivers/acpi/ec.c:552:6: warning: no previous prototype for ‘acpi_ec_remove_query_handler’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / dock: Include appropriate header file in dock.cRashika
Includes appropriate header file internal.h in dock.c because function acpi_dock_init() has its prototype declaration in internal.h. This eliminates the following warning in dock.c: drivers/acpi/dock.c:899:13: warning: no previous prototype for ‘acpi_dock_init’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / PCI: Include appropriate header file in pci_link.cRashika
Includes appropriate header file internal.h in pci_link.c because function acpi_pci_link_init() has its prototype declaration in internal.h. This eliminates the following warning in pci_link.c: drivers/acpi/pci_link.c:874:13: warning: no previous prototype for ‘acpi_pci_link_init’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / PCI: Include appropriate header file in pci_slot.cRashika
Includes appropriate header file linux/pci-acpi.h in pci_slot.c because functions acpi_pci_slot_enumerate(), acpi_pci_slot_remove() and acpi_pci_slot_init() have their prototype declaratons in linux/pci-acpi.h. This eliminates the following warnings in pci_slot.c: drivers/acpi/pci_slot.c:162:6: warning: no previous prototype for ‘acpi_pci_slot_enumerate’ [-Wmissing-prototypes] drivers/acpi/pci_slot.c:174:6: warning: no previous prototype for ‘acpi_pci_slot_remove’ [-Wmissing-prototypes] drivers/acpi/pci_slot.c:215:13: warning: no previous prototype for ‘acpi_pci_slot_init’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.cRashika
Mark the function acpi_ec_add_debugfs() as static in ec_sys.c because it is not used outside this file. This eliminates the following warning in ec_sys.c: drivers/acpi/ec_sys.c:108:5: warning: no previous prototype for ‘acpi_ec_add_debugfs’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / NVS: Include appropriate header file in nvs.cRashika
Include header file internal.h in nvs.c because functions suspend_nvs_free(), suspend_nvs_alloc(), suspend_nvs_save() and suspend_nvs_restore() have their prototype declaration in internal.h. This eliminates the following warnings in nvs.c: drivers/acpi/nvs.c:128:6: warning: no previous prototype for ‘suspend_nvs_free’ [-Wmissing-prototypes] drivers/acpi/nvs.c:152:5: warning: no previous prototype for ‘suspend_nvs_alloc’ [-Wmissing-prototypes] drivers/acpi/nvs.c:169:5: warning: no previous prototype for ‘suspend_nvs_save’ [-Wmissing-prototypes] drivers/acpi/nvs.c:201:6: warning: no previous prototype for ‘suspend_nvs_restore’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-06ACPI / OSL: Mark the function acpi_table_checksum() as staticRashika
Marks the function acpi_table_checksum() as static in osl.c because it is not used outside this file. This eliminates the following warning in osl.c: drivers/acpi/osl.c:547:11: warning: no previous prototype for ‘acpi_table_checksum’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-05ACPI / extlog: replace open-coded _DSM code with helper functionsJiang Liu
Use helper functions to simplify _DSM related code in acpi_extlog driver. Also mark initialization data and functions with __init and __initdata to reduce memory footprint. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Tested-by: Chen, Gong <gong.chen@linux.intel.com> Reviewed-by: Chen, Gong <gong.chen@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-05ACPI: introduce helper interfaces for _DSM methodJiang Liu
There are several drivers making use of ACPI _DSM method to detect and invoke device specific methods. Currently every driver has implemented its private version to support ACPI _DSM method. So this patch introduces three helper functions to support ACPI _DSM method, which will be used to replace open-coded versions. It helps to simplify code and improve code readability. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-05ACPI / AC: change notification handler type to ACPI_ALL_NOTIFYAlexander Mezin
With kernel 3.13rc5 there are no AC adapter notifications on my laptop. Commit cc8ef5270734 "ACPI / AC: convert ACPI ac driver to platform bus" changed the driver to listen to device notifications only. However, AML code on my laptop notifies the driver with zero event. This patch changes the driver to listen to all events again. Fixes: cc8ef5270734 (ACPI / AC: convert ACPI ac driver to platform bus) References: https://bugzilla.kernel.org/show_bug.cgi?id=67821 Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-12-31Merge branches 'acpi-pci-pm' and 'acpi-pci-hotplug'Rafael J. Wysocki
* acpi-pci-pm: PCI / ACPI: Install wakeup notify handlers for all PCI devs with ACPI * acpi-pci-hotplug: ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug ACPI / PCI / hotplug: Avoid warning when _ADR not present
2013-12-31Merge branch 'acpi-pci-hotplug' into acpi-hotplugRafael J. Wysocki
Conflicts: include/acpi/acpi_bus.h
2013-12-31ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplugRafael J. Wysocki
The changes in the ACPI-based PCI hotplug (ACPIPHP) subsystem made during the 3.12 development cycle uncovered a problem with VGA switcheroo that on some systems, when the device-specific method (ATPX in the radeon case, _DSM in the nouveau case) is used to turn off the discrete graphics, the BIOS generates ACPI hotplug events for that device and those events cause ACPIPHP to attempt to remove the device from the system (they are events for a device that was present previously and is not present any more, so that's what should be done according to the spec). Then, the system stops functioning correctly. Since the hotplug events in question were simply silently ignored previously, the least intrusive way to address that problem is to make ACPIPHP ignore them again. For this purpose, introduce a new ACPI device flag, no_hotplug, and modify ACPIPHP to ignore hotplug events for PCI devices whose ACPI companions have that flag set. Next, make the radeon and nouveau switcheroo detection code set the no_hotplug flag for the discrete graphics' ACPI companion. Fixes: bbd34fcdd1b2 (ACPI / hotplug / PCI: Register all devices under the given bridge) References: https://bugzilla.kernel.org/show_bug.cgi?id=61891 References: https://bugzilla.kernel.org/show_bug.cgi?id=64891 Reported-and-tested-by: Mike Lothian <mike@fireburn.co.uk> Reported-and-tested-by: <madcatx@atlas.cz> Reported-and-tested-by: Joaquín Aramendía <samsagax@gmail.com> Cc: Alex Deucher <alexdeucher@gmail.com> Cc: Dave Airlie <airlied@linux.ie> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
2013-12-29Merge branch 'x86-urgent-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Peter Anvin: "There is a small EFI fix and a big power regression fix in this batch. My queue also had a fix for downing a CPU when there are insufficient number of IRQ vectors available, but I'm holding that one for now due to recent bug reports" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/efi: Don't select EFI from certain special ACPI drivers x86 idle: Repair large-server 50-watt idle-power regression
2013-12-29ACPI / hotplug / driver core: Handle containers in a special wayRafael J. Wysocki
ACPI container devices require special hotplug handling, at least on some systems, since generally user space needs to carry out system-specific cleanup before it makes sense to offline devices in the container. However, the current ACPI hotplug code for containers first attempts to offline devices in the container and only then it notifies user space of the container offline. Moreover, after commit 202317a573b2 (ACPI / scan: Add acpi_device objects for all device nodes in the namespace), ACPI device objects representing containers are present as long as the ACPI namespace nodes corresponding to them are present, which may be forever, even if the container devices are physically detached from the system (the return values of the corresponding _STA methods change in those cases, but generally the namespace nodes themselves are still there). Thus it is useful to introduce entities representing containers that will go away during container hot-unplug. The goal of this change is to address both the above issues. The idea is to create a "companion" container system device for each of the ACPI container device objects during the initial namespace scan or on a hotplug event making the container present. That system device will be unregistered on container removal. A new bus type for container devices is added for this purpose, because device offline and online operations need to be defined for them. The online operation is a trivial function that is always successful and the offline uses a callback pointed to by the container device's offline member. For ACPI containers that callback simply walks the list of ACPI device objects right below the container object (its children) and checks if all of their physical companion devices are offline. If that's not the case, it returns -EBUSY and the container system devivce cannot be put offline. Consequently, to put the container system device offline, it is necessary to put all of the physical devices depending on its ACPI companion object offline beforehand. Container system devices created for ACPI container objects are initially online. They are created by the container ACPI scan handler whose hotplug.demand_offline flag is set. That causes acpi_scan_hot_remove() to check if the companion container system device is offline before attempting to remove an ACPI container or any devices below it. If the check fails, a KOBJ_CHANGE uevent is emitted for the container system device in question and user space is expected to offline all devices below the container and the container itself in response to it. Then, user space can finalize the removal of the container with the help of its ACPI device object's eject attribute in sysfs. Tested-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-29ACPI / hotplug: Add demand_offline hotplug profile flagRafael J. Wysocki
Add a new ACPI hotplug profile flag, demand_offline, such that if set for the given ACPI device object's scan handler, it will cause acpi_scan_hot_remove() to check if that device object's physical companions are offline upfront and fail the hot removal if that is not the case. That flag will be useful to overcome a problem with containers on some system where they can only be hot-removed after some cleanup operations carried out by user space, which needs to be notified of the container hot-removal before the kernel attempts to offline devices in the container. In those cases the current implementation of acpi_scan_hot_remove() is not sufficient, because it first tries to offline the devices in the container and only if that is suffcessful it tries to offline the container itself. As a result, the container hot-removal notification is not delivered to user space at the right time. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-12-27Merge branches 'powercap' and 'acpi-lpss' with new device IDsRafael J. Wysocki
* powercap: powercap / RAPL: add support for ValleyView Soc * acpi-lpss: ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs
2013-12-21ACPI, APEI, GHES: Cleanup ghes memory error handlingChen, Gong
Cleanup the logic in ghes_handle_memory_failure(). While at it, add proper PFN validity check for UC error and cleanup the code logic to make it simpler and cleaner. Signed-off-by: Chen, Gong <gong.chen@linux.intel.com> Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1385363701-12387-2-git-send-email-gong.chen@linux.intel.com [ Boris: massage commit message. ] Signed-off-by: Borislav Petkov <bp@suse.de>