#ifndef IOOPS_H #define IOOPS_H #include extern int open_or_die(const char *file, int flags); extern int open_or_die_m(const char *file, int flags, mode_t mode); extern int dup_or_die(int oldfd); extern void dup2_or_die(int oldfd, int newfd); extern void create_or_die(const char *file, mode_t mode); extern int tun_open_or_die(const char *name, int type); extern void pipe_or_die(int pipefd[2], int flags); extern ssize_t read_or_die(int fd, void *buf, size_t count); extern ssize_t write_or_die(int fd, const void *buf, size_t count); extern int read_blob_or_die(const char *file, void *blob, size_t count); extern int write_blob_or_die(const char *file, const void *blob, size_t count); #endif /* IOOPS_H */ png' alt='cgit logo'/> index : net-next.git
net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/drivers/acpi/fan.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2016-10-04 13:51:40 -0700
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-10-10 02:20:43 +0200
commit84baf1725dc532d9746df2d216c1921154767109 (patch)
tree764c9d49ecfc2d33c5c195b91c2bdaff584ab830 /drivers/acpi/fan.c
parentc8d2bc9bc39ebea8437fd974fdbc21847bb897a3 (diff)
ACPI / fan: Fix error reading cur_state
On some platforms with ACPI4 variable speed fan, reading cur_state from cooling device returns "invalid value" error. This confuses user space applications. This issue occurs as the current driver doesn't take account of "FineGrainControl" from _FIF(Fan Information). When the "FineGrainControl" is set, _FSL(FSL Set Level) takes argument as a percent, which doesn't have to match from any control value from _FPS(Fan Performance States). It is also possible that the Fan is not actually running at the requested speed returning a lower speed. On some platforms the BIOS is setting fan speed to a level during boot, which will not have an exact match to _FPS control values. The current implementation will treat this level as invalid value. The simple change is to atleast return state corresponding to a maximum control value in the _FPS compared to the current level. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/fan.c')