]> Git Repo - linux.git/log
linux.git
14 years ago[CPUFREQ] powernow-k8: On load failure, remind the user to enable support in BIOS...
Marti Raudsepp [Wed, 20 Jan 2010 17:19:33 +0000 (19:19 +0200)]
[CPUFREQ] powernow-k8: On load failure, remind the user to enable support in BIOS setup

On Wed, 2010-01-20 at 16:56 +0100, Thomas Renninger wrote:
> But most often this happens if people upgrade their CPU and do not
> update their BIOS.
> Or the vendor does not recognise the new CPU even if the BIOS got
> updated.

Maybe some of those people just didn't realize it was disabled in BIOS?
If you tell users that it's a firmware bug then they'll probably just
give up.

> The itself message might be an enhancment, IMO it's not worth a patch.

Why do you think so? I spent an hour on hunting down the BIOS upgrade,
only to find that it didn't improve anything. It was a day later that I
realized that it might be a BIOS option; and the option was literally
the _last_ option in the whole BIOS setup. :)

This message would have saved the day.

> But do not revert the FW_BUG part!

Sure, you have a point here.

How about this patch?

14 years ago[CPUFREQ] powernow-k8: Limit Pstate transition latency check
Borislav Petkov [Thu, 8 Jul 2010 15:55:30 +0000 (17:55 +0200)]
[CPUFREQ] powernow-k8: Limit Pstate transition latency check

The Pstate transition latency check was added for broken F10h BIOSen
which wrongly contain a value of 0 for transition and bus master
latency. Fam11h and later, however, (will) have similar transition
latency so extend that behavior for them too.

Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
14 years ago[CPUFREQ] Fix PCC driver error path
Matthew Garrett [Thu, 15 Jul 2010 15:44:00 +0000 (11:44 -0400)]
[CPUFREQ] Fix PCC driver error path

The PCC cpufreq driver unmaps the mailbox address range if any CPUs fail to
initialise, but doesn't do anything to remove the registered CPUs from the
cpufreq core resulting in failures further down the line. We're better off
simply returning a failure - the cpufreq core will unregister us cleanly if
we end up with no successfully registered CPUs. Tidy up the failure path
and also add a sanity check to ensure that the firmware gives us a realistic
frequency - the core deals badly with that being set to 0.

Signed-off-by: Matthew Garrett <[email protected]>
Cc: Naga Chumbalkar <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
14 years ago[CPUFREQ] fix double freeing in error path of pcc-cpufreq
Daniel J Blueman [Fri, 23 Jul 2010 22:06:52 +0000 (23:06 +0100)]
[CPUFREQ] fix double freeing in error path of pcc-cpufreq

Prevent double freeing on error path.

Signed-off-by: Daniel J Blueman <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
14 years ago[CPUFREQ] pcc driver should check for pcch method before calling _OSC
Matthew Garrett [Tue, 20 Jul 2010 17:52:00 +0000 (13:52 -0400)]
[CPUFREQ] pcc driver should check for pcch method before calling _OSC

The pcc specification documents an _OSC method that's incompatible with the
one defined as part of the ACPI spec. This shouldn't be a problem as both
are supposed to be guarded with a UUID. Unfortunately approximately nobody
(including HP, who wrote this spec) properly check the UUID on entry to the
_OSC call. Right now this could result in surprising behaviour if the pcc
driver performs an _OSC call on a machine that doesn't implement the pcc
specification. Check whether the PCCH method exists first in order to reduce
this probability.

Signed-off-by: Matthew Garrett <[email protected]>
Cc: Naga Chumbalkar <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
14 years ago[CPUFREQ] fix memory leak in cpufreq_add_dev
Xiaotian Feng [Tue, 20 Jul 2010 12:11:02 +0000 (20:11 +0800)]
[CPUFREQ] fix memory leak in cpufreq_add_dev

We didn't free policy->related_cpus in error path err_unlock_policy.
This is catched by following kmemleak report:

unreferenced object 0xffff88022a0b96d0 (size 512):
  comm "modprobe", pid 886, jiffies 4294689177 (age 780.694s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff8111ebe5>] create_object+0x186/0x281
    [<ffffffff814fad4f>] kmemleak_alloc+0x60/0xa7
    [<ffffffff8111127a>] kmem_cache_alloc_node_notrace+0x120/0x142
    [<ffffffff81262e4f>] alloc_cpumask_var_node+0x2c/0xd7
    [<ffffffff81262f0b>] alloc_cpumask_var+0x11/0x13
    [<ffffffff81262f1c>] zalloc_cpumask_var+0xf/0x11
    [<ffffffff8140fac0>] cpufreq_add_dev+0x11f/0x547
    [<ffffffff81334bda>] sysdev_driver_register+0xc2/0x11d
    [<ffffffff8140e334>] cpufreq_register_driver+0xcb/0x1b8
    [<ffffffffa032e040>] 0xffffffffa032e040
    [<ffffffff810021ba>] do_one_initcall+0x5e/0x15c
    [<ffffffff81087f94>] sys_init_module+0xa6/0x1e6
    [<ffffffff81009bc2>] system_call_fastpath+0x16/0x1b
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Xiaotian Feng <[email protected]>
Cc: Thomas Renninger <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
14 years ago[CPUFREQ] revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second...
Andrej Gelenberg [Fri, 14 May 2010 22:15:58 +0000 (15:15 -0700)]
[CPUFREQ] revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)"

395913d0b1db37092ea3d9d69b832183b1dd84c5 ("[CPUFREQ] remove rwsem lock
from CPUFREQ_GOV_STOP call (second call site)") is not needed, because
there is no rwsem lock in cpufreq_ondemand and cpufreq_conservative
anymore.  Lock should not be released until the work done.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=1594

Signed-off-by: Andrej Gelenberg <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Venkatesh Pallipadi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Mathieu Desnoyers <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
14 years agoPARISC: led.c - fix potential stack overflow in led_proc_write()
Helge Deller [Mon, 2 Aug 2010 20:46:41 +0000 (22:46 +0200)]
PARISC: led.c - fix potential stack overflow in led_proc_write()

avoid potential stack overflow by correctly checking count parameter

Reported-by: Ilja <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
Acked-by: Kyle McMartin <[email protected]>
Cc: James E.J. Bottomley <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
14 years agoips driver: make it less chatty
Jesse Barnes [Wed, 28 Jul 2010 21:42:56 +0000 (14:42 -0700)]
ips driver: make it less chatty

We don't need a dev_warn when we exceed a thermal or power limit as
we'll handle it appropriately by clamping down on the CPU, GPU or both
as needed.

Signed-off-by: Jesse Barnes <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoedac, mc: Improve scrub rate handling
Borislav Petkov [Tue, 25 May 2010 16:21:07 +0000 (18:21 +0200)]
edac, mc: Improve scrub rate handling

Fortify the interface to not accept negative values, remove
memctrl_int_store() as a result. Also, sanitize bandwidth setting by
making the argument a simple u32 instead of strange u32 pointer being
passed around for no obvious reason. Then, fix error handling and teach
it to return proper error values. Finally, make code more readable,
simplify debug messages.

Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Arthur Jones <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Doug Thompson <[email protected]>
14 years agoamd64_edac: Correct scrub rate setting
Borislav Petkov [Fri, 21 May 2010 19:25:03 +0000 (21:25 +0200)]
amd64_edac: Correct scrub rate setting

Exit early when setting scrub rate on unknown/unsupported families.

Cc: <[email protected]> # 32.x 33.x 34.x
Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Doug Thompson <[email protected]>
14 years agoamd64_edac: Fix DCT base address selector
Borislav Petkov [Mon, 8 Mar 2010 17:29:35 +0000 (18:29 +0100)]
amd64_edac: Fix DCT base address selector

The correct check is to verify whether in high range we're below 4GB
and not to extract the DctSelBaseAddr again. See "2.8.5 Routing DRAM
Requests" in the F10h BKDG.

Cc: <[email protected]> # .32.x .33.x .34.x
Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Doug Thompson <[email protected]>
14 years agoamd64_edac: Remove polling mechanism
Borislav Petkov [Sat, 15 May 2010 11:51:57 +0000 (13:51 +0200)]
amd64_edac: Remove polling mechanism

Switch to reusing the mcheck core's machine check polling mechanism
instead of duplicating functionality by using the EDAC polling routine.

Correct formatting while at it.

Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Doug Thompson <[email protected]>
14 years agox86, mce: Notify about corrected events too
Borislav Petkov [Tue, 18 May 2010 11:59:05 +0000 (13:59 +0200)]
x86, mce: Notify about corrected events too

Notify all parties registered on the mce decoder chain about logged
correctable MCEs.

Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Doug Thompson <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
14 years agoamd64_edac: Remove unneeded defines
Borislav Petkov [Mon, 15 Mar 2010 18:39:18 +0000 (19:39 +0100)]
amd64_edac: Remove unneeded defines

All F2x110-related bit defines are used at only one place so replace
them with simple BIT() macros.

Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Doug Thompson <[email protected]>
14 years agoedac: Remove EDAC_DEBUG_VERBOSE
Borislav Petkov [Mon, 15 Mar 2010 18:17:57 +0000 (19:17 +0100)]
edac: Remove EDAC_DEBUG_VERBOSE

This option differs from EDAC_DEBUG only by printing the file and
line of where the debug statement is placed, which contains unneeded
information. So remove it.

Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Doug Thompson <[email protected]>
14 years agoamd64_edac: Sanitize syndrome extraction
Borislav Petkov [Tue, 9 Mar 2010 11:46:00 +0000 (12:46 +0100)]
amd64_edac: Sanitize syndrome extraction

Remove the two syndrome extraction macros and add a single function
which does the same thing but with proper typechecking. While at it,
make sure to cache ECC syndrome size and dump it in debug output.

Signed-off-by: Borislav Petkov <[email protected]>
14 years agointel_scu_ipc: fix size field for intel_scu_ipc_command
Hong Liu [Mon, 26 Jul 2010 09:06:31 +0000 (10:06 +0100)]
intel_scu_ipc: fix size field for intel_scu_ipc_command

Size for PMIC read/write command is byte, while it is DWORD for other
IPC commands.

Signed-off-by: Hong Liu <[email protected]>
Signed-off-by: ALan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agointel_scu_ipc: return -EIO for error condition in busy_loop
Hong Liu [Mon, 26 Jul 2010 09:06:12 +0000 (10:06 +0100)]
intel_scu_ipc: return -EIO for error condition in busy_loop

Signed-off-by: Hong Liu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agointel_scu_ipc: fix data packing of PMIC command on Moorestown
Hong Liu [Mon, 26 Jul 2010 09:05:52 +0000 (10:05 +0100)]
intel_scu_ipc: fix data packing of PMIC command on Moorestown

Data is 2-byte per entry for PMIC read-modify-update command.

Signed-off-by: Hong Liu <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoClean up command packing on MRST.
Andy Ross [Mon, 26 Jul 2010 09:05:03 +0000 (10:05 +0100)]
Clean up command packing on MRST.

Don't pass more bytes in the command length field than we filled.

Signed-off-by: Andy Ross <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agozero the stack buffer before giving random garbage to the SCU
Arjan van de Ven [Mon, 26 Jul 2010 09:04:37 +0000 (10:04 +0100)]
zero the stack buffer before giving random garbage to the SCU

some messages take 4 bytes, but only fill 3 bytes....
this patch makes sure that whatever we send to the SCU is zeroed first

Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoFix stack buffer size for IPC writev messages
Arjan van de Ven [Mon, 26 Jul 2010 09:04:24 +0000 (10:04 +0100)]
Fix stack buffer size for IPC writev messages

The stack buffer for IPC messages was 16 bytes, limiting messages to a
size of 4 (each message is 32 bit).
However, the touch screen driver is trying to send messages of size 5....

(AC: Set to 20 bytes having checked the max size allowed)

Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agointel_scu_ipc: Use the new cpu identification function
Alan Cox [Mon, 26 Jul 2010 09:03:58 +0000 (10:03 +0100)]
intel_scu_ipc: Use the new cpu identification function

This provides an architecture level board identify function to replace the
cpuid direct usage

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agointel_scu_ipc: tidy up unused bits
Sreedhara DS [Mon, 26 Jul 2010 09:03:30 +0000 (10:03 +0100)]
intel_scu_ipc: tidy up unused bits

Delete unused constants IPC_CMD_INDIRECT_RD and IPC_CMD_INDIRECT_WR
Remove multiple inclusion of header file "asm/mrst.h"

Signed-off-by: Sreedhara DS <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoRemove indirect read write api support.
Sreedhara DS [Mon, 26 Jul 2010 09:03:10 +0000 (10:03 +0100)]
Remove indirect read write api support.

The firmware of production devices does not support this interface so this
is dead code.

Signed-off-by: Sreedhara DS <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agointel_scu_ipc: Support Medfield processors
Sreedhara DS [Mon, 26 Jul 2010 09:02:46 +0000 (10:02 +0100)]
intel_scu_ipc: Support Medfield processors

Changes to work on bothMmoorestown and Medfield
New pci id added for Medfield
Return type of ipc_data_readl chnaged from u8 to u32

Signed-off-by: Sreedhara DS <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agointel_scu_ipc: detect CPU type automatically
Sreedhara DS [Mon, 26 Jul 2010 09:02:25 +0000 (10:02 +0100)]
intel_scu_ipc: detect CPU type automatically

Intel SCU message formats depend upon the processor type. Replace the
module option with automatic detection of the processor type.

Signed-off-by: Sreedhara DS <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agox86 plat: limit x86 platform driver menu to X86
Jan Engelhardt [Mon, 2 Aug 2010 22:40:10 +0000 (00:40 +0200)]
x86 plat: limit x86 platform driver menu to X86

My .config contains ACER_WMI=m. On SPARC. That does not make sense.
Restrict the x86 platform driver menu to x86.

Signed-off-by: Jan Engelhardt <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacpi ec_sys: Be more cautious about ec write access
Thomas Renninger [Thu, 29 Jul 2010 20:30:24 +0000 (22:30 +0200)]
acpi ec_sys: Be more cautious about ec write access

- Set Kconfig option default n
- Only allow root to read/write io file (sever bug!)
- Introduce write support module param -> default off
- Properly clean up if any debugfs files cannot be created

Signed-off-by: Thomas Renninger <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacpi ec: Fix possible double io port registration
Thomas Renninger [Thu, 29 Jul 2010 20:08:44 +0000 (22:08 +0200)]
acpi ec: Fix possible double io port registration

which will result in a harmless but ugly WARN message on
some machines.

Signed-off-by: Thomas Renninger <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agohp-wmi: acpi_drivers.h is already included through acpi.h two lines below
Thomas Renninger [Thu, 29 Jul 2010 10:28:00 +0000 (12:28 +0200)]
hp-wmi: acpi_drivers.h is already included through acpi.h two lines below

Signed-off-by: Thomas Renninger <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agohp-wmi: Fix mixing up of and/or directive
Thomas Renninger [Thu, 29 Jul 2010 10:27:59 +0000 (12:27 +0200)]
hp-wmi: Fix mixing up of and/or directive

This should have been an "and". Additionally checking for !obj
is even better.

Signed-off-by: Thomas Renninger <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agodell-laptop: make dell_laptop_i8042_filter() static
Axel Lin [Mon, 5 Jul 2010 09:21:10 +0000 (17:21 +0800)]
dell-laptop: make dell_laptop_i8042_filter() static

Make dell_laptop_i8042_filter() static as it's used only in dell-laptop.c

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoasus-laptop: fix asus_input_init error path
Axel Lin [Mon, 5 Jul 2010 07:29:00 +0000 (15:29 +0800)]
asus-laptop: fix asus_input_init error path

This patch includes below fixes:
1. return -ENOMEM instead of 0 if input_allocate_device fail.
2. fix wrong goto if sparse_keymap_setup fail.
3. fix wrong goto if input_register_device fail.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agomsi-wmi: make needlessly global symbols static
Axel Lin [Thu, 8 Jul 2010 01:50:30 +0000 (09:50 +0800)]
msi-wmi: make needlessly global symbols static

backlight is needlessly defined global.
This patch makes the symbol static.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Anisse Astier <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agotoshiba-acpi: Add support for Toshiba Illumination.
Pierre Ducroquet [Thu, 29 Jul 2010 09:56:59 +0000 (11:56 +0200)]
toshiba-acpi: Add support for Toshiba Illumination.

Add support for Toshiba Illumination. This is a set of LEDs installed on
some Toshiba laptops. It is controlled through ACPI, the commands has been
found through reverse engineering. It has been tested on a Toshiba Qosmio
G50-122.

Signed-off-by: Pierre Ducroquet <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agocompal-laptop: depends on POWER_SUPPLY
Randy Dunlap [Fri, 23 Jul 2010 16:41:34 +0000 (09:41 -0700)]
compal-laptop: depends on POWER_SUPPLY

compal-laptop uses power_supply interfaces so it should depend
on POWER_SUPPLY.

ERROR: "power_supply_register" [drivers/platform/x86/compal-laptop.ko] undefined!
ERROR: "power_supply_unregister" [drivers/platform/x86/compal-laptop.ko] undefined!

Signed-off-by: Randy Dunlap <[email protected]>
Cc: Cezary Jackiewicz <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agogpio: Add PMIC GPIO block support
Alek Du [Tue, 13 Jul 2010 09:56:25 +0000 (10:56 +0100)]
gpio: Add PMIC GPIO block support

Moorestown has PMIC chip which contains GPIO blocks. The PMIC chip is
connected to Langwell by SPI interface. So this GPIO driver will be regarded
as SPI GPIO expander though the actual GPIO access is through IPC and SRAM.
The SPI master contoller will probe this device driver by parsing SPIB table.

Cleaned up for new IPC, GPE removed and some printk and other tidying by
Alan Cox. Fixes for points noted by Matthew Garrett

Signed-off-by: Alek Du <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoACPI: Register EC io ports in /proc/ioports
Thomas Renninger [Fri, 16 Jul 2010 11:11:33 +0000 (13:11 +0200)]
ACPI: Register EC io ports in /proc/ioports

Formerly these have been exposed through /proc/..
Better register them where all IO ports should get registered
and scream loud if someone else claims to use them.

EC data and command port typically should show up like this
then:
...
  0060-0060 : keyboard
  0062-0062 : EC data
  0064-0064 : keyboard
  0066-0066 : EC command
  0070-0071 : rtc0
...

Signed-off-by: Thomas Renninger <[email protected]>
CC: Alexey Starikovskiy <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]
CC: Bjorn Helgaas <[email protected]>
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoACPI: Provide /sys/kernel/debug//ec/ec0/io for binary access to the EC
Thomas Renninger [Fri, 16 Jul 2010 11:11:32 +0000 (13:11 +0200)]
ACPI: Provide /sys/kernel/debug//ec/ec0/io for binary access to the EC

A userspace app to easily read/write the EC can be found here:
ftp://ftp.suse.com/pub/people/trenn/sources/ec/ec_access.c

Multiple ECs are not supported, but shouldn't be hard to add as soon
as the ec driver itself will support them.

Signed-off-by: Thomas Renninger <[email protected]>
CC: Alexey Starikovskiy <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoACPI: Provide /sys/kernel/debug/ec/...
Thomas Renninger [Fri, 16 Jul 2010 11:11:31 +0000 (13:11 +0200)]
ACPI: Provide /sys/kernel/debug/ec/...

This patch provides the same information through debugfs, which previously was
provided through /proc/acpi/embedded_controller/*/info

This is the gpe the EC is connected to and whether the global lock
gets used.
The io ports used are added to /proc/ioports in another patch.
Beside the fact that /proc/acpi is deprecated for quite some time,
this info is not needed for applications and thus can be moved
to debugfs instead of a public interface like /sys.

Signed-off-by: Thomas Renninger <[email protected]>
CC: Alexey Starikovskiy <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]
CC: Bjorn Helgaas <[email protected]>
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoDocumentation: Add new /sys/kernel/debug/ec/* files to ABI
Thomas Renninger [Fri, 16 Jul 2010 11:11:37 +0000 (13:11 +0200)]
Documentation: Add new /sys/kernel/debug/ec/* files to ABI

Signed-off-by: Thomas Renninger <[email protected]>
CC: Alexey Starikovskiy <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoX86 platform driver: Fix section mismatch in wmi.c
Thomas Renninger [Fri, 16 Jul 2010 11:11:36 +0000 (13:11 +0200)]
X86 platform driver: Fix section mismatch in wmi.c

The .add function must not be declared __init.

Signed-off-by: Thomas Renninger <[email protected]>
CC: Alexey Starikovskiy <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoX86 platform drivers: Remove EC dump from thinkpad_acpi
Thomas Renninger [Fri, 16 Jul 2010 11:11:35 +0000 (13:11 +0200)]
X86 platform drivers: Remove EC dump from thinkpad_acpi

There is a general interface for that now (provided by
other patches in this patch series):
/sys/kernel/debug/ec/*/io

Signed-off-by: Thomas Renninger <[email protected]>
CC: Alexey Starikovskiy <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Henrique de Moraes Holschuh <[email protected]>
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoACPI: Remove /proc/acpi/embedded_controller/..
Thomas Renninger [Fri, 16 Jul 2010 11:11:34 +0000 (13:11 +0200)]
ACPI: Remove /proc/acpi/embedded_controller/..

Other patches in this series add the same info to /sys/... and
/proc/ioports.

The info removed should never have been used in an application,
eventually someone read it manually.
/proc/acpi is deprecated for more than a year anyway...

Signed-off-by: Thomas Renninger <[email protected]>
CC: Alexey Starikovskiy <[email protected]>
CC: Len Brown <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
14 years agopanasonic-laptop: fix acpi_pcc_write_sset return value
Axel Lin [Wed, 7 Jul 2010 00:21:48 +0000 (08:21 +0800)]
panasonic-laptop: fix acpi_pcc_write_sset return value

In current implementation, acpi_pcc_write_sset return 1
if write is successful, 0 if write is failed.
But all the callers consider acpi_pcc_write_sset return 0
if write is successful and return negtive if write is failed.

This patch changes the implementation of acpi_pcc_write_sset to
return 0 if write is successful, -EIO if write is failed.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoeeepc-laptop: fix hotplug_disabled module_param permissions
Axel Lin [Tue, 20 Jul 2010 22:19:55 +0000 (15:19 -0700)]
eeepc-laptop: fix hotplug_disabled module_param permissions

The hotplug_disabled module parameter is determinated at the module load
time.  Change the value after the module is loaded does not make sense and
has no effect at all, thus set the permissions to 0444 instead of 0644.

Signed-off-by: Axel Lin <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Alan Jenkins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoasus-laptop: fix wapf, wlan_status and bluetooth_status module_param permissions
Axel Lin [Tue, 20 Jul 2010 22:19:55 +0000 (15:19 -0700)]
asus-laptop: fix wapf, wlan_status and bluetooth_status module_param permissions

The wapf module parameters defines the behavior of the Fn+Fx wlan key.
The wlan_status and bluetooth_status module parameters are for setting the
wlan/bluetooth status on boot.

All above module parameters are determinated only at the module load time.
 Change the value after the module is loaded does not make sense and has
no effect at all, thus set the permissions to 0444 instead of 0644.

Signed-off-by: Axel Lin <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Alan Jenkins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacer-wmi: remove non-used acer_quirks struct definition
Axel Lin [Tue, 20 Jul 2010 22:19:54 +0000 (15:19 -0700)]
acer-wmi: remove non-used acer_quirks struct definition

Remove non-used acer_quirks struct definition.

Signed-off-by: Axel Lin <[email protected]>
Cc: Carlos Corbacho <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Thomas Renninger <[email protected]>
Cc: Alan Jenkins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacer-wmi: fix memory leaks in wmab_execute error path
Axel Lin [Tue, 20 Jul 2010 22:19:53 +0000 (15:19 -0700)]
acer-wmi: fix memory leaks in wmab_execute error path

When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER, the caller
must kfree the returned buffer if AE_OK is returned.

Call Trace:
wmab_execute
  -> wmi_evaluate_method
    -> acpi_evaluate_object

Thus if callers of wmab_execute() pass ACPI_ALLOCATE_BUFFER, the return
buffer must be kfreed if wmab_execute return AE_OK.

[[email protected]: avoid multiple return points, remove unneeded cast, remove unneeded initialisation of `status']
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Carlos Corbacho <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Thomas Renninger <[email protected]>
Cc: Alan Jenkins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacer-wmi: fix memory leaks in WMID_set_capabilities and get_wmid_devices
Axel Lin [Tue, 20 Jul 2010 22:19:52 +0000 (15:19 -0700)]
acer-wmi: fix memory leaks in WMID_set_capabilities and get_wmid_devices

When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER, the caller
must kfree the returned buffer if AE_OK is returned.

The callers of wmi_query_block() pass ACPI_ALLOCATE_BUFFER, and thus must
check its return value before accessing or kfree() on the buffer.

This patch adds a missing kfree(out.pointer) before exit
WMID_set_capabilities() and get_wmid_devices().

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Carlos Corbacho <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agotoshiba_acpi: rename add_device() and remove_device() to create_toshiba_proc_entries...
Axel Lin [Tue, 20 Jul 2010 22:19:51 +0000 (15:19 -0700)]
toshiba_acpi: rename add_device() and remove_device() to create_toshiba_proc_entries() and remove_toshiba_proc_entries()

To improve readability rename add_device() to
create_toshiba_proc_entries() and rename remove_device() to
remove_toshiba_proc_entries().

Signed-off-by: Axel Lin <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Márton Németh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agohp-wmi: add return value checking for input_allocate_device()
Axel Lin [Tue, 20 Jul 2010 22:19:51 +0000 (15:19 -0700)]
hp-wmi: add return value checking for input_allocate_device()

Add error checking and return -ENOMEM if input_allocate_device() fail.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Thomas Renninger <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agotoshiba_acpi: make remove_device() and add_device() void
Axel Lin [Tue, 20 Jul 2010 22:19:50 +0000 (15:19 -0700)]
toshiba_acpi: make remove_device() and add_device() void

remove_device() and add_device() are not related to ACPI APIs, it does not
make sense to return acpi_status for both functions.

Current implementation of add_device() always AE_OK, thus the return value
checking for add_device() always return false for ACPI_FAILURE(status).
This patch makes add_device() to be void and remove the unnecessary return
value checking.

remove_proc_entry() won't fail, thus change remove_device() to be void.

Signed-off-by: Axel Lin <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Márton Németh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacerhdf: fix resource reclaim in error path
Axel Lin [Tue, 20 Jul 2010 22:19:49 +0000 (15:19 -0700)]
acerhdf: fix resource reclaim in error path

Fix resource reclaim in below cases:

1. acerhdf_register_platform() does not properly handle
   platform_device_alloc() failure and platform_device_add() failure This
   patch adds error handing for acerhdf_register_platform().

2. acerhdf_register_platform() return err with acerhdf_dev == NULL.
   as a result, acerhdf_unregister_platform() does not do resource reclaim
   in acerhdf_init() error path.  This patch adds error handing for
   acerhdf_register_platform(), thus correct the error handing path in
   acerhdf_init().  goto out_err instead of err_unreg if
   acerhdf_register_platform() fail.

3. platform_device_del() should only used in error handling.  Current
   implementation missed a platform_device_put() in acerhdf_exit.  This
   patch fixes it by using platform_device_unregister() instead of
   platform_device_del() in acerhdf_unregister_platform.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Peter Feuerer <[email protected]>
Cc: Matthew Garrett <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoasus-laptop: return proper error for store_ledd if write_acpi_int fail
Axel Lin [Tue, 20 Jul 2010 22:19:48 +0000 (15:19 -0700)]
asus-laptop: return proper error for store_ledd if write_acpi_int fail

In current implementation, store_ledd() does not return error if
write_acpi_int fail.  This patch fixes it by return -ENODEV if
write_acpi_int fail.

Signed-off-by: Axel Lin <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Alan Jenkins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoasus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULL
Axel Lin [Tue, 20 Jul 2010 22:19:47 +0000 (15:19 -0700)]
asus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULL

According to the comments of write_acpi_int_ret(), write_acpi_int_ret()
should return 0 if write is successful, -1 else.  Thus if handle is NULL,
the write does not happen, it should return -1.

Signed-off-by: Axel Lin <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Alan Jenkins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agomsi-laptop: make struct rfkill_ops const
Axel Lin [Tue, 20 Jul 2010 22:19:46 +0000 (15:19 -0700)]
msi-laptop: make struct rfkill_ops const

rfkill uses a const struct rfkill_ops pointer.

Signed-off-by: Axel Lin <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Lennart Poettering <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agofujitsu-laptop: make needlessly global symbols static
Axel Lin [Tue, 20 Jul 2010 22:19:45 +0000 (15:19 -0700)]
fujitsu-laptop: make needlessly global symbols static

The following symbols are needlessly defined global:

logolamp_led
kblamps_led

This patch makes the symbols static.

Signed-off-by: Axel Lin <[email protected]>
Cc: Matthew Garrett <[email protected]>
Acked-by: Jonathan Woithe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoclassmate-laptop: make needlessly global symbols static
Axel Lin [Tue, 20 Jul 2010 22:19:44 +0000 (15:19 -0700)]
classmate-laptop: make needlessly global symbols static

cmpc_accel_sensitivity_attr is needlessly defined global.
This patch makes the symbol static.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Thadeu Lima de Souza Cascardo <[email protected]>
Cc: Daniel Oliveira Nascimento <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacerhdf: make needlessly global symbols static
Axel Lin [Tue, 20 Jul 2010 22:19:43 +0000 (15:19 -0700)]
acerhdf: make needlessly global symbols static

The following symbols are needlessly defined global:

thz_dev
cl_dev
acerhdf_dev
acerhdf_dev_ops
acerhdf_cooling_ops

This patch makes the symbols static.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Acked-by: Peter Feuerer <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoasus_acpi: fix coding style to improve readability
Axel Lin [Tue, 20 Jul 2010 22:19:42 +0000 (15:19 -0700)]
asus_acpi: fix coding style to improve readability

In the case of no match ( hotk->model == END_MODEL ), the only posible
case to return 0 is to have a Samsung P30 detected.  This patch improves
readability by moving related code after if/else clause to be inside if
clause.

Signed-off-by: Axel Lin <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Karol Kozimor <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Len Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoasus_acpi: fix a memory leak in asus_hotk_get_info()
Axel Lin [Tue, 20 Jul 2010 22:19:41 +0000 (15:19 -0700)]
asus_acpi: fix a memory leak in asus_hotk_get_info()

In the case of no match ( hotk->model == END_MODEL ), model sholud be
kfreed before return AE_OK.

This patch includes below fixes:

1. adds a missing kfree(model) before return AE_OK.

2. asus_hotk_get_info should return int, thus return 0 instead of AE_OK.

Signed-off-by: Axel Lin <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Karol Kozimor <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Len Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agocompal-laptop/fujitsu-laptop/msi-laptop: make dmi_check_cb to return 1 instead of 0
Axel Lin [Tue, 20 Jul 2010 22:19:40 +0000 (15:19 -0700)]
compal-laptop/fujitsu-laptop/msi-laptop: make dmi_check_cb to return 1 instead of 0

dmi_check_system() walks the table running matching functions until
someone returns non zero or we hit the end.

This patch makes dmi_check_cb to return 1 so dmi_check_system() return
immediately when a match is found.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Jonathan Woithe <[email protected]>
Cc: Matthew Garrett <[email protected]>a
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agocompal-laptop: add JHL90, battery & hwmon interface
Roald Frederickx [Tue, 20 Jul 2010 22:19:39 +0000 (15:19 -0700)]
compal-laptop: add JHL90, battery & hwmon interface

The driver now supports the Compal JHL90 (which I use) and it has some
added features.  The biggest novelties are a battery interface
(power_supply) and a temperature and fan control interface (hmwon).  It
also adds a power-off feature to the backlight subsystem and it exports a
few files that can enable/disable wake_on_XXX events.

Much of the original code of the old features is still there, but I've
changed some names to keep the naming more coherent with the added
functionalities.  (Sorry for the huge patch)

Some technical stuff about the new driver:

First of all, I'm not sure if the extra features also work on the other
Compal boards.  Currently they only get enabled if the DMI data indicates
you are on a JHL90 board.

Secondly, I've noticed a quirk in my fan controller.  I have to re-send
the wanted pwm-level to the controller every so often.  If I don't do
this, the fanspeed will slowly rise until after a couple of minutes it's
at full speed.  (Note that every normal userland application will probably
update the pwm-level every so often anyway, based on temperature readings,
so this might not be an issue in practice) If this turns out to be a
problem with all the controllers, maybe we should implement a kernel timer
and have the driver re-send the pwm level every XX seconds to make this
transparent to userspace?  (However, I couldn't immediately find a way to
do this cleanly.)

Additional information can be found in the source comments.

[[email protected]: coding-style fixes]
[[email protected]: add missing semicolon]
Signed-off-by: Roald Frederickx <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agocompal-laptop: uses hwmon interfaces, depends on HWMON
Randy Dunlap [Tue, 20 Jul 2010 22:19:39 +0000 (15:19 -0700)]
compal-laptop: uses hwmon interfaces, depends on HWMON

compal-laptop uses hwmon interfaces, so it should depend on HWMON.

compal-laptop.c:(.devinit.text+0x4071f): undefined reference to `hwmon_device_register'
compal-laptop.c:(.devexit.text+0x6ec0): undefined reference to `hwmon_device_unregister'

Signed-off-by: Randy Dunlap <[email protected]>
Cc: Roald Frederickx <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agofujitsu-laptop: remove unnecessary input_free_device calls
Axel Lin [Tue, 20 Jul 2010 22:19:34 +0000 (15:19 -0700)]
fujitsu-laptop: remove unnecessary input_free_device calls

input_free_device() should only be used if input_register_device() was not
called yet or if it failed.  This patch removes unnecessary
input_free_device calls.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Jonathan Woithe <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Cc: Matthew Garrett <[email protected]>a
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacerhdf: add AO531 and many BIOS versions for 1410, 1810xx and packard bell netbooks
Peter Feuerer [Tue, 20 Jul 2010 22:19:33 +0000 (15:19 -0700)]
acerhdf: add AO531 and many BIOS versions for 1410, 1810xx and packard bell netbooks

Signed-off-by: Peter Feuerer <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Andreas Mohr <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacerhdf: driver didn't verify the pointers in which it got product information
Rahul Chaturvedi [Tue, 20 Jul 2010 22:19:33 +0000 (15:19 -0700)]
acerhdf: driver didn't verify the pointers in which it got product information

Driver didn't verify the pointers in which it got product information back
from DMI; on QEMU one of the pointers came back null, which made the
driver crash and subsequently caused a kernel panic.

Signed-off-by: Rahul Chaturvedi <[email protected]>
Signed-off-by: Peter Feuerer <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Andreas Mohr <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacerhdf: remove "chk_off" as it was only needed for T31 netbooks
Peter Feuerer [Tue, 20 Jul 2010 22:19:32 +0000 (15:19 -0700)]
acerhdf: remove "chk_off" as it was only needed for T31 netbooks

Remove "chk_off" as it was only needed for T31 netbooks.  But those
netbooks can also be handled just with "cmd_off" register (0x9e) for
reading the state back.

Signed-off-by: Peter Feuerer <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Andreas Mohr <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacerhdf: add new BIOS versions
Peter Feuerer [Tue, 20 Jul 2010 22:19:30 +0000 (15:19 -0700)]
acerhdf: add new BIOS versions

Add new BIOS versions for Acer 1410 and 1810xx and Packard Bell netbooks.

Fixed registers of Acer AOA150 BIOS version v0.3114: Old registers caused
Fan to spin up at every temperature check.

Signed-off-by: Peter Feuerer <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Andreas Mohr <[email protected]>
Cc: Len Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agohp-wmi: return -ENODEV if BIOS does not export any supported hp wmi guid
Thomas Renninger [Tue, 20 Jul 2010 22:19:29 +0000 (15:19 -0700)]
hp-wmi: return -ENODEV if BIOS does not export any supported hp wmi guid

Signed-off-by: Thomas Renninger <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Axel Lin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agotoshiba-acpi: Add an extra couple of keys
Matthew Garrett [Thu, 15 Jul 2010 18:23:42 +0000 (14:23 -0400)]
toshiba-acpi: Add an extra couple of keys

Thomas Bächler reports that his machine generates two keycodes for zooming
in and out. Add these to the default keymap.

Signed-off-by: Matthew Garrett <[email protected]>
Cc: Thomas Bächler <[email protected]>
14 years agosony-laptop: use platform_device_unregister in sony_pf_remove
Axel Lin [Thu, 1 Jul 2010 02:18:01 +0000 (10:18 +0800)]
sony-laptop: use platform_device_unregister in sony_pf_remove

platform_device_unregister calls platform_device_del and platform_device_put,
thus this change is logically equivalent to original code.

I made this change because the documents in platform.c shows that:
platform_device_del and platform_device_put must _only_ be externally called
in error cases.  All other usage is a bug.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agodell-wmi: fix a memory leak
Axel Lin [Wed, 30 Jun 2010 09:25:46 +0000 (17:25 +0800)]
dell-wmi: fix a memory leak

If dell_new_hk_type is true, dell_legacy_wmi_keymap will point to a memory
allocated in setup_new_hk_map().
In this case, the memory is not freed in current implementation.
This patch fixes the leak by kfree(dell_wmi_keymap) if dell_new_hk_type is true.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacer-wmi: make dmi_matched to return 1 instead of 0
Axel Lin [Wed, 30 Jun 2010 05:32:16 +0000 (13:32 +0800)]
acer-wmi: make dmi_matched to return 1 instead of 0

dmi_check_system() walks the table running matching functions until someone
returns non zero or we hit the end.

This patch makes dmi_matched to return 1 so dmi_check_system() return
immediately when a match is found.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacer-wmi: set permissions on interface file to S_IRUGO
Axel Lin [Wed, 30 Jun 2010 02:20:23 +0000 (10:20 +0800)]
acer-wmi: set permissions on interface file to S_IRUGO

The interface file is not writable, thus set permissions to S_IRUGO.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoasus-laptop: fix a memory leak in asus_laptop_get_info error path
Axel Lin [Tue, 29 Jun 2010 03:09:47 +0000 (11:09 +0800)]
asus-laptop: fix a memory leak in asus_laptop_get_info error path

The callers of write_acpi_int_ret() pass ACPI_ALLOCATE_BUFFER,
the caller must kfree the returned buffer if AE_OK is returned.

This patch adds a missing kfree(buffer.pointer) before return -ENOMEM
if kstrdup fail.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agowmi: fix a memory leak in wmi_notify_debug
Axel Lin [Mon, 28 Jun 2010 01:30:45 +0000 (09:30 +0800)]
wmi: fix a memory leak in wmi_notify_debug

When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER,
the caller must kfree the returned buffer if AE_OK is returned.

The callers of wmi_get_event_data() pass ACPI_ALLOCATE_BUFFER,
and thus must check its return value before accessing
or kfree() on the buffer.

This patch adds return value checking for wmi_get_event_data()
and adds a missing kfree(obj) in the end of wmi_notify_debug

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Thomas Renninger <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agodell-wmi: Add support for eject key on Dell Studio 1555
Islam Amer [Thu, 24 Jun 2010 17:39:47 +0000 (13:39 -0400)]
dell-wmi: Add support for eject key on Dell Studio 1555

Fixes pressing the eject key on Dell Studio 1555 does not work and produces
message :

dell-wmi: Unknown key 0 pressed

Signed-off-by: Islam Amer <[email protected]>
14 years agorar: Move the RAR driver into the right place as its now clean
Alan Cox [Fri, 18 Jun 2010 13:05:52 +0000 (14:05 +0100)]
rar: Move the RAR driver into the right place as its now clean

We exit staging rar! rar! rar!...

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
14 years agoacer-wmi/hp-wmi: use platform_device_unregister instead of platform_device_del in...
Axel Lin [Thu, 3 Jun 2010 07:18:03 +0000 (15:18 +0800)]
acer-wmi/hp-wmi: use platform_device_unregister instead of platform_device_del in module_exit

platform_device_unregister will also call platform_device_put() to drop reference count.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agowmi: fix memory leak in parse_wdg
Axel Lin [Thu, 3 Jun 2010 03:45:45 +0000 (11:45 +0800)]
wmi: fix memory leak in parse_wdg

This patch properly kfree out.pointer and gblock in error path.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agodell-laptop: Add another Dell laptop family to the DMI whitelist
Rezwanul Kabir [Wed, 23 Jun 2010 17:02:43 +0000 (12:02 -0500)]
dell-laptop: Add another Dell laptop family to the DMI whitelist

This is to support Precision M4500 and others.

Signed-off-by: Rezwanul Kabir <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoacer-wmi: fix resource reclaim in acer_wmi_init error path
Axel Lin [Tue, 22 Jun 2010 08:17:38 +0000 (16:17 +0800)]
acer-wmi: fix resource reclaim in acer_wmi_init error path

This patch fixes the resource reclaim in acer_wmi_init error path.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoX86: intel_ips, check for kzalloc properly
Jiri Slaby [Mon, 21 Jun 2010 15:40:15 +0000 (17:40 +0200)]
X86: intel_ips, check for kzalloc properly

Stanse found that there are two NULL checks missing in ips_monitor. So
check their value too and bail out appropriately if the allocation
failed.

While at it, add one more kfree to the fail path. It is not necessary
now, but may be needed in the future when a new allocation is added.
And for completeness.

Also remove unneeded initialization of the variables. They are all set
right after their declaration.

Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
Acked-by: Jesse Barnes <[email protected]>
14 years agohp-wmi: add error handling for hp_wmi_init
Axel Lin [Thu, 10 Jun 2010 08:06:40 +0000 (16:06 +0800)]
hp-wmi: add error handling for hp_wmi_init

Current implementation in hp_wmi_init does not check any error and always
return success.
This patch properly handles recource reclaim and return err in error path.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agointel_scu_ipc: add definitions for vRTC related command
Feng Tang [Tue, 1 Jun 2010 12:07:34 +0000 (13:07 +0100)]
intel_scu_ipc: add definitions for vRTC related command

Signed-off-by: Feng Tang <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoclassmate-laptop: should check for NULL as retval for rfkill_alloc
Thadeu Lima de Souza Cascardo [Wed, 9 Jun 2010 19:48:39 +0000 (16:48 -0300)]
classmate-laptop: should check for NULL as retval for rfkill_alloc

rfkill_alloc returns NULL when it fails if RFKILL is enabled. When RFKILL is
disabled, its return value of ERR_PTR(-ENODEV) is OK to use as all rfkill
functions will work with it, as they are simply empty stubs.

Reported-by: Alan Jenkins <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoIPS driver: add GPU busy and turbo checking
Jesse Barnes [Thu, 20 May 2010 21:27:23 +0000 (14:27 -0700)]
IPS driver: add GPU busy and turbo checking

Be sure to enable GPU turbo by default at load time and check GPU busy
and MCP exceeded status correctly.  Also fix up CPU power comparison and
work around buggy MCH temp reporting.

Signed-off-by: Jesse Barnes <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agox86 platform driver: intelligent power sharing driver
Jesse Barnes [Fri, 14 May 2010 22:41:14 +0000 (15:41 -0700)]
x86 platform driver: intelligent power sharing driver

Intel Core i3/5 platforms with integrated graphics support both CPU and
GPU turbo mode.  CPU turbo mode is opportunistic: the CPU will use any
available power to increase core frequencies if thermal headroom is
available.  The GPU side is more manual however; the graphics driver
must monitor GPU power and temperature and coordinate with a core
thermal driver to take advantage of available thermal and power headroom
in the package.

The intelligent power sharing (IPS) driver is intended to coordinate
this activity by monitoring MCP (multi-chip package) temperature and
power, allowing the CPU and/or GPU to increase their power consumption,
and thus performance, when possible.  The goal is to maximize
performance within a given platform's TDP (thermal design point).

Signed-off-by: Jesse Barnes <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agotimer: add on-stack deferrable timer interfaces
Jesse Barnes [Mon, 10 May 2010 21:26:20 +0000 (14:26 -0700)]
timer: add on-stack deferrable timer interfaces

In some cases (for instance with kernel threads) it may be desireable to
use on-stack deferrable timers to get their power saving benefits.  Add
interfaces to support this for the IPS driver.

Signed-off-by: Jesse Barnes <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoplatform/x86: msi-laptop depends on SERIO_I8042
Randy Dunlap [Sun, 23 May 2010 23:33:17 +0000 (16:33 -0700)]
platform/x86: msi-laptop depends on SERIO_I8042

msi-laptop uses i8042_*() interfaces, so it should depend on
SERIO_I8042.  E.g., when SERIO_I8042=m and MSI_LAPTOP=y:

msi-laptop.c:(.text+0x18a7fe): undefined reference to `i8042_install_filter'
msi-laptop.c:(.init.text+0xd69d): undefined reference to `i8042_remove_filter'
msi-laptop.c:(.exit.text+0x19c3): undefined reference to `i8042_remove_filter'

Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
Cc: Lennart Poettering <[email protected]>
14 years agoclassmate-laptop: depends on RFKILL or RFKILL=n
Thadeu Lima de Souza Cascardo [Wed, 26 May 2010 15:00:10 +0000 (12:00 -0300)]
classmate-laptop: depends on RFKILL or RFKILL=n

Randy Dunlap has reported that building classmate-laptop fails when
CONFIG_RFKILL=m and CONFIG_ACPI_CMPC=y. He suggested depending on
RFKILL, but, then, it will not be possible to select classmate-laptop
when RFKILL is off. There's no known problem with building and using
classmate-laptop with RFKILL off. So depend on RFKILL or RFKILL=n.

Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: [email protected]
Cc: Daniel Oliveira Nascimento <[email protected]>
14 years agodrivers/platform/x86: Eliminate a NULL pointer dereference
Julia Lawall [Thu, 27 May 2010 16:32:15 +0000 (18:32 +0200)]
drivers/platform/x86: Eliminate a NULL pointer dereference

Give different error messages if device_enum is NULL or if its type field
has the wrong value.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@

if ((E == NULL && ...) || ...)
{
  ... when != if (...) S1 else S2
      when != E = E1
* E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
14 years agoX86 platform: hp-wmi Better match the HP WMI query interface
Thomas Renninger [Fri, 21 May 2010 14:42:40 +0000 (16:42 +0200)]
X86 platform: hp-wmi Better match the HP WMI query interface

- Improve error handling, by explictly return zero for success, error otherwise
- WMI query command can have arbitrary input sized params
- WMI query command can have specific output sized params (0, 4, 128,..) byte

I like to go on here, but this is a rather intrusive change that should
be looked at first. I am sure the one or other thing can be done better or
there might be typo/bug somewhere.

This did not get any testing yet, only compile tested.

Next steps could be:
  - Eventually introduce hp_wmi_perform_{read,write}_query macros
  - Introduce new wireless query interface (0x1B)
  - more

Signed-off-by: Thomas Renninger <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
CC: [email protected]
CC: [email protected]
14 years agox86 platform drivers: hp-wmi fix buffer size depending on ACPI version
Thomas Renninger [Fri, 21 May 2010 14:41:43 +0000 (16:41 +0200)]
x86 platform drivers: hp-wmi fix buffer size depending on ACPI version

Depending on ACPI version (1.0 -> 32 bit) an integer could be
32 or 64 bit long. _WED internal concatenates two integers and
the return value will be 8 byte (2* 32 bit) or 16 byte (2* 64 bit)
long, depending on the ACPI version.

Also the data send with the WMI event is defined to be splitted into:
  - Event ID -> 4 bytes
  - Event Data -> 4 bytes

This gets messed up with new ACPI versions.
But it's a HP BIOS bug that may get fixed in the future
-> Support both, 16 and 8 byte _WED buffers.

Also the wrong assumption that from the event data sent, only the
first byte is relevant got cleaned up that it fits event_id/event_data
as described above.

Signed-off-by: Thomas Renninger <[email protected]>
CC: [email protected]
Signed-off-by: Matthew Garrett <[email protected]>
CC: [email protected]
CC: [email protected]
14 years agox86 platform drivers: hp-wmi Set placeholder for unimplemented events
Thomas Renninger [Fri, 21 May 2010 14:18:13 +0000 (16:18 +0200)]
x86 platform drivers: hp-wmi Set placeholder for unimplemented events

Rather than print unknown events when we know what caused them

Signed-off-by: Thomas Renninger <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
CC: [email protected]
CC: [email protected]
14 years agox86 platform drivers: hp-wmi Add media key 0x20e8
Thomas Renninger [Fri, 21 May 2010 14:18:12 +0000 (16:18 +0200)]
x86 platform drivers: hp-wmi Add media key 0x20e8

Signed-off-by: Thomas Renninger <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
CC: [email protected]
CC: [email protected]
This page took 0.115813 seconds and 4 git commands to generate.