aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sysfs.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-07-03Merge branch 'akpm' (updates from Andrew Morton)Linus Torvalds1-2/+1
Merge first patch-bomb from Andrew Morton: - various misc bits - I'm been patchmonkeying ocfs2 for a while, as Joel and Mark have been distracted. There has been quite a bit of activity. - About half the MM queue - Some backlight bits - Various lib/ updates - checkpatch updates - zillions more little rtc patches - ptrace - signals - exec - procfs - rapidio - nbd - aoe - pps - memstick - tools/testing/selftests updates * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (445 commits) tools/testing/selftests: don't assume the x bit is set on scripts selftests: add .gitignore for kcmp selftests: fix clean target in kcmp Makefile selftests: add .gitignore for vm selftests: add hugetlbfstest self-test: fix make clean selftests: exit 1 on failure kernel/resource.c: remove the unneeded assignment in function __find_resource aio: fix wrong comment in aio_complete() drivers/w1/slaves/w1_ds2408.c: add magic sequence to disable P0 test mode drivers/memstick/host/r592.c: convert to module_pci_driver drivers/memstick/host/jmb38x_ms: convert to module_pci_driver pps-gpio: add device-tree binding and support drivers/pps/clients/pps-gpio.c: convert to module_platform_driver drivers/pps/clients/pps-gpio.c: convert to devm_* helpers drivers/parport/share.c: use kzalloc Documentation/accounting/getdelays.c: avoid strncpy in accounting tool aoe: update internal version number to v83 aoe: update copyright date aoe: perform I/O completions in parallel ...
2013-07-03clean up scary strncpy(dst, src, strlen(src)) usesKees Cook1-2/+1
Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either the NULL should always be copied (using strlcpy), or it should not be copied (using something like memcpy). Readable code should not depend on the weird behavior of strncpy when it hits the length limit. Better to avoid the anti-pattern entirely. [akpm@linux-foundation.org: revert getdelays.c part due to missing bsd/string.h] Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [staging] Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [acpi] Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Ursula Braun <ursula.braun@de.ibm.com> Cc: Frank Blaschka <blaschka@linux.vnet.ibm.com> Cc: Richard Weinberger <richard@nod.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-12ACPI / hotplug: Use device offline/online for graceful hot-removalRafael J. Wysocki1-0/+31
Modify the generic ACPI hotplug code to be able to check if devices scheduled for hot-removal may be gracefully removed from the system using the device offline/online mechanism introduced previously. Namely, make acpi_scan_hot_remove() handling device hot-removal call device_offline() for all physical companions of the ACPI device nodes involved in the operation and check the results. If any of the device_offline() calls fails, the function will not progress to the removal phase (which cannot be aborted), unless its (new) force argument is set (in case of a failing offline it will put the devices offlined by it back online). In support of 'forced' device hot-removal, add a new sysfs attribute 'force_remove' that will reside under /sys/firmware/acpi/hotplug/. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Toshi Kani <toshi.kani@hp.com>
2013-03-19ACPI / hotplug: Make acpi_hotplug_profile_ktype staticRafael J. Wysocki1-1/+1
The acpi_hotplug_profile_ktype object should be static, so make that be the case. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-03-04ACPI / hotplug: Introduce user space interface for hotplug profilesRafael J. Wysocki1-0/+66
Introduce user space interface for manipulating hotplug profiles associated with ACPI scan handlers. The interface consists of sysfs directories under /sys/firmware/acpi/hotplug/, one for each hotplug profile, containing an attribute allowing user space to manipulate the enabled field of the corresponding profile. Namely, switching the enabled attribute from '0' to '1' will cause the common hotplug notify handler to be installed for all ACPI namespace objects representing devices matching the scan handler associated with the given hotplug profile (and analogously for the converse switch). Drivers willing to use the new user space interface should add their ACPI scan handlers with the help of new funtion acpi_scan_add_handler_with_hotplug(). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Tested-by: Toshi Kani <toshi.kani@hp.com>
2013-01-26ACPI sysfs: remove unnecessary newline from exceptionColin Ian King1-1/+1
ACPI_EXCEPTION() already appends a newline, so there is no need for the invalid GPE message to include one too. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-11-15ACPICA: Fix AcpiSrc caused divergences.Lv Zheng1-2/+2
There are definitions that can been converted into new styles by the recent AcpiSrc while they remain the old styles in the Linux. This patch fixes those definitions that will be converted by the AcpiSrc. This patch will not affect the generated vmlinux binary. This will decrease 97 lines of 20120913 divergence.diff. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-07-26ACPI: replace strlen("string") with sizeof("string") -1Len Brown1-2/+2
...both give the number of chars in the string without the '\0', as strncmp() wants, but sizeof() is compile-time. Reported-by: Alan Stern <stern@rowland.harvard.edu> Cc: Pavel Vasilyev <pavel@pavlinux.ru> Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-05ACPI sysfs.c strlen fixPavel Vasilyev1-2/+2
Current code is ignoring the last character of "enable" and "disable" in comparisons. https://bugzilla.kernel.org/show_bug.cgi?id=33732 Signed-off-by: Len Brown <len.brown@intel.com>
2011-11-06ACPI: Export FADT pm_profile integer value to userspaceThomas Renninger1-1/+13
There are a lot userspace approaches to detect the usage of the platform (laptop, workstation, server, ...) and adjust kernel tunables accordingly (io/process scheduler, power management, ...). These approaches need constant maintaining and are ugly to implement (detect PCMCIA controller -> laptop, does not work on recent systems anymore, ...) On ACPI systems there is an easy and reliable way (if implemented in BIOS and most recent platforms have this value set). -> export it to userspace. Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
2011-07-16ACPI: constify ops structsVasiliy Kulikov1-2/+2
Structs battery_file, acpi_dock_ops, file_operations, thermal_cooling_device_ops, thermal_zone_device_ops, kernel_param_ops are not changed in runtime. It is safe to make them const. register_hotplug_dock_device() was altered to take const "ops" argument to respect acpi_dock_ops' const notion. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
2011-05-29ACPI: Cleanup custom_method debug stuffThomas Renninger1-0/+8
- Move param aml_debug_output to other params into sysfs.c - Split acpi_debugfs_init to prepare custom_method to be an own .config option and driver. Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: rui.zhang@intel.com Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-12ACPICA: Global event handlerLin Ming1-2/+17
The global event handler is called whenever a general purpose or fixed ACPI event occurs. Also update Linux OSL to collect events counter with global event handler. Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2010-09-28ACPI: fix build warnings resulting from merge window conflictZhang Rui1-6/+14
drivers/acpi/sysfs.c:154: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)' Introduced by commit 1c8fce27e275fd7c6b75bc6455745f02d3903ee6 ("ACPI: introduce drivers/acpi/sysfs.c") interacting with commit 9bbb9e5a33109b2832e2e63dcc7a132924ab374b ("param: use ops in struct kernel_param, rather than get and set fns directly"). Use module_param_cb instead of the obsoleted module_param_call to fix a build warning. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15ACPI: introduce drivers/acpi/sysfs.cZhang Rui1-0/+685
Introduce drivers/acpi/sysfs.c. code for ACPI sysfs I/F, including #ifdef ACPI_DEBUG /sys/module/acpi/parameters/debug_layer /sys/module/acpi/parameters/debug_level /sys/module/acpi/parameters/trace_method_name /sys/module/acpi/parameters/trace_debug_layer /sys/module/acpi/parameters/trace_debug_level /sys/module/acpi/parameters/trace_state #endif /sys/module/acpi/parameters/acpica_version /sys/firmware/acpi/tables/ /sys/firmware/acpi/interrupts/ is moved to this file. No function change in this patch. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>