Commit Graph

190935 Commits (7ab52521f2d850e922f33e5586a47e6c83ec6f11)

Author SHA1 Message Date
Lee, Chun-Yi 7ab52521f2 Clean up all objects used by scm model when driver initial fail or exit
Clean up i8042 filter, rfkill and cancel delayed work when msi-laptop driver initial fail or exit on MSI scm model.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
2010-05-20 09:46:12 -04:00
Greg Kroah-Hartman 1ac34072bd msi-laptop: fix up some coding style issues found by checkpatch
Cc: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 09:46:09 -04:00
Lee, Chun-Yi 339e75329a msi-laptop: Add i8042 filter to sync sw state with BIOS when function key pressed
There have some MSI netbook change devices state by EC when user press
wlan/bluetooth/wwan function keys. So, add a i8042 filter to sync sw
state with BIOS when function keys pressed.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 09:45:56 -04:00
Lee, Chun-Yi 3bb970214f msi-laptop: Set rfkill init state when msi-laptop intiial
Setup Wlan/Bluetooth/3G rfkill initial state to sync with the hardware
state from EC 0x2e address.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 09:30:20 -04:00
Lee, Chun-Yi 1f27e17bfa msi-laptop: Add MSI CR620 notebook dmi information to scm models table
Add new MSI notebook CR620 dmi information to scm models table.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 09:30:20 -04:00
Lee, Chun-Yi d0a4aa2b26 msi-laptop: Add N014 N051 dmi information to scm models table
Add new MSI netbook N014 and N051 dmi information to scm models table.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 09:30:20 -04:00
Julia Lawall 2c6719a3ef drivers/platform/x86: Use kmemdup
Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
2010-05-20 09:26:13 -04:00
Julia Lawall 6c75dd0f96 drivers/platform/x86: Use kzalloc
Use kzalloc rather than the combination of kmalloc and memset.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
 if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
2010-05-20 09:26:13 -04:00
Matthew Garrett 420f5f0c5a Merge branch 'for-upstream/platform-x86_tpacpi' of git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6 into x86-platform 2010-05-20 09:24:29 -04:00
Matthew Garrett a1e66dd051 Merge branch 'x86-platform-next' into x86-platform 2010-05-17 12:11:21 -04:00
Matthew Garrett 6c62673cf5 drivers/platform/x86: Clarify the MRST IPC driver description slightly
Make it clear that this driver is only needed for embedded hardware,
not PCs.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-05-17 12:08:33 -04:00
Randy Dunlap 89a7644be2 eeepc-wmi: depends on BACKLIGHT_CLASS_DEVICE
eeepc-wmi uses backlight*() interfaces so it should depend on
BACKLIGHT_CLASS_DEVICE.

eeepc-wmi.c:(.text+0x2d7f54): undefined reference to `backlight_force_update'
eeepc-wmi.c:(.text+0x2d8012): undefined reference to `backlight_device_register'
eeepc-wmi.c:(.devinit.text+0x1c31c): undefined reference to `backlight_device_unregister'
eeepc-wmi.c:(.devexit.text+0x2f8b): undefined reference to `backlight_device_unregister'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: stable@kernel.org
2010-05-17 12:08:23 -04:00
Sreedhara DS 9a58a33339 IPC driver for Intel Mobile Internet Device (MID) platforms
The IPC (inter processor communications) is used to provide the
communications between kernel and system control units on some embedded
Intel x86 platforms.

(Various bits of clean up and restructuring by Alan Cox)

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
2010-05-17 12:06:07 -04:00
Thadeu Lima de Souza Cascardo d5c051f108 classmate-laptop: Add RFKILL support.
The RFKILL device shares the same ACPI device used for backlight. So, it
required a new struct sharing both a backlight_device and a rfkill
device.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
2010-05-17 12:06:01 -04:00
Henrique de Moraes Holschuh 7d9745cf23 thinkpad-acpi: document backlight level writeback at driver init
Document this, it is no fun to try to second guess why this sort of
stuff is in place years after it was added...

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:57 -03:00
Henrique de Moraes Holschuh ef07a5abad thinkpad-acpi: clean up ACPI handles handling
1. Remove <handle>_path, as its only user was already removed in
   a previous commit

2. Move all handle initialization, as well as <handle>_parent and
   <handle>_paths to __init.* sections.  This reduces the driver's
   runtime footprint nicely.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:54 -03:00
Henrique de Moraes Holschuh 2cbb5c8f55 thinkpad-acpi: don't depend on led_path for led firmware type (v2)
Don't depend on the contents of led_path to know which LED interface
the firmware wants.

This removes the only user of *_path for the thinkpad-acpi ACPI
handlers, which will simplify future code.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:50 -03:00
Henrique de Moraes Holschuh 72f1992121 thinkpad-acpi: explain errors from acpi_install_notify_handler
Log more human-friendly errors instead of numeric values when
setup_acpi_notify() fails to install a notification handler.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:48 -03:00
Henrique de Moraes Holschuh 263f4a30e4 thinkpad-acpi: acpi_evalf fixes
Use acpi_format_exception() in acpi_evalf() instead of logging numeric
errors.

Also, when ACPICA returns an error, we should not be touching the return
object, as it is invalid.  In debug mode, acpi_evalf() callers would
printk the returned crap (but fortunately, not use it).

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:45 -03:00
Henrique de Moraes Holschuh 437e470c4c thinkpad-acpi: detect EC node using its HID (v2)
Use the EC HID (PNP0C09) to locate its main node, instead of a static
list.

Suggested-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matthew Garrett <mjg@redhat.com>
2010-05-16 19:45:43 -03:00
Henrique de Moraes Holschuh 38e11cdec9 thinkpad-acpi: disclose usertask for ALSA callbacks
Disclose the user task doing ALSA access when requested by
the debug bitmask.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:40 -03:00
Henrique de Moraes Holschuh 69df49eb31 thinkpad-acpi: update HKEY and hotkey subdriver documentation (v2)
Update the hotkey driver documentation to match the behaviour
of the fixed NVRAM polling code.

This also documents some HKEY events such as the alarms,
which is very important information.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:38 -03:00
Henrique de Moraes Holschuh 2899902281 thinkpad-acpi: fix brightness hotkey poll handling
Handle multiple brightness hotkey presses between two polling cycles.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:36 -03:00
Henrique de Moraes Holschuh 77775838bb thinkpad-acpi: let other subdrivers know backlight level range
Extract the backlight level range size detection from the brightness
subdriver, and allow the other subdrivers access to that information.

This also allows us to relocate some code to a more convenient place.
The moved code was largerly unmodified, except for the return type of
tpacpi_check_std_acpi_brightness_support(), which now is correctly
marked as returning "unsigned int", and and two cosmetic fixes to make
checkpatch.pl happy.

Fixes for the NVRAM polling mode for the brightness hotkeys will need
this.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:33 -03:00
Henrique de Moraes Holschuh 7a43f78898 thinkpad-acpi: move greeting messages out of the first subdriver (v2)
Move the driver initial greetings out of the first subdriver, as we do a
lot of other initialization before that point, and the initial greetings
should go as soon as the driver decides that it should load.

These greetings are not cosmetic, they make my life easier when users
report bugs.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:31 -03:00
Henrique de Moraes Holschuh 5d756db99a thinkpad-acpi: fix volume/mute hotkey poll handling
The hotkey polling code is supposed to generate hotkey messages as
close to the way the IBM event-based volume hotkey firmware does as
possible, i.e:

* Pressing MUTE issues a mute hotkey event, even if already mute;

* Pressing Volume up/down issues a volume up/down hotkey event,
  even if already at maximum or minumum volume;

* The act of unmuting issues a volume up/down event, depending on
  which hotkey was used to unmute.

Fix the code to do just that (mute handling was incorrect), and handle
multiple hotkey presses between two polling cycles.

The new code uses the volume_toggle bit in NVRAM only to detect
repeated presses of the mute key and multiple presses of the volume
keys trying to go past the end of the volume scale.  This will work
around a bug in recent Lenovo firmware (e.g. T400), which causes the
firmware to not update the volume_toggle bit in certain situations.

Reported-by: Yang Zhe <yangzhe1990@gmail.com>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:28 -03:00
Henrique de Moraes Holschuh a318930d06 thinkpad-acpi: X100e quick fixes
The X100e needs some quick fixes to work semi-right with this driver.
There are much better ways to do this, but we can start with a quick
update and do it properly later.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:26 -03:00
Henrique de Moraes Holschuh e28393c0c4 thinkpad-acpi: constrain IBM-era support to IBM boxes
Lenovo is playing around with its ACPI BIOS, and will end up reusing
method names.  Their memory is not nearly as long as thinkpad-acpi's...

Secure most of the old IBM codepaths against running in a non-IBM box.
This would happen on the Lenovo X100e in video_init(), for example.  We
would misdetect it as an ancient model 570 firmware.

Also, refuse to load the driver if we cannot identify the vendor.  No
ACPI ThinkPad in existence lacks this information, AFAIK.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2010-05-16 19:45:23 -03:00
Henrique de Moraes Holschuh b65b348954 Merge mainline (v2.6.34-rc7) 2010-05-16 19:40:56 -03:00
Linus Torvalds e40152ee1e Linus 2.6.34 2010-05-16 14:17:36 -07:00
Linus Torvalds b5dbc85871 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  rtnetlink: make SR-IOV VF interface symmetric
  sctp: delete active ICMP proto unreachable timer when free transport
  tcp: fix MD5 (RFC2385) support
2010-05-16 11:11:53 -07:00
Linus Torvalds d34e14f690 Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  MIPS: Oprofile: Fix Loongson irq handler
  MIPS: N32: Use compat version for sys_ppoll.
  MIPS FPU emulator: allow Cause bits of FCSR to be writeable by ctc1
2010-05-16 11:11:31 -07:00
Chris Wright c02db8c629 rtnetlink: make SR-IOV VF interface symmetric
Now we have a set of nested attributes:

  IFLA_VFINFO_LIST (NESTED)
    IFLA_VF_INFO (NESTED)
      IFLA_VF_MAC
      IFLA_VF_VLAN
      IFLA_VF_TX_RATE

This allows a single set to operate on multiple attributes if desired.
Among other things, it means a dump can be replayed to set state.

The current interface has yet to be released, so this seems like
something to consider for 2.6.34.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-16 01:05:45 -07:00
Wei Yongjun 55fa0cfd7c sctp: delete active ICMP proto unreachable timer when free transport
transport may be free before ICMP proto unreachable timer expire, so
we should delete active ICMP proto unreachable timer when transport
is going away.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-16 00:46:22 -07:00
Eric Dumazet 35790c0421 tcp: fix MD5 (RFC2385) support
TCP MD5 support uses percpu data for temporary storage. It currently
disables preemption so that same storage cannot be reclaimed by another
thread on same cpu.

We also have to make sure a softirq handler wont try to use also same
context. Various bug reports demonstrated corruptions.

Fix is to disable preemption and BH.

Reported-by: Bhaskar Dutta <bhaskie@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-16 00:34:04 -07:00
Wu Zhangjin 4e73238d16 MIPS: Oprofile: Fix Loongson irq handler
The interrupt enable bit for the performance counters is in the Control
    Register $24, not in the counter register.
    loongson2_perfcount_handler(), we need to use
    
    Reported-by: Xu Hengyang <hengyang@mail.ustc.edu.cn>
    Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1198/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
2010-05-15 21:59:54 +01:00
Chandrakala Chavva 46afb8296c MIPS: N32: Use compat version for sys_ppoll.
The sys_ppoll() takes struct 'struct timespec'. This is different for the
    N32 and N64 ABIs. Use the compat version to do the proper conversions.
    
    Signed-off-by: David Daney <ddaney@caviumnetworks.com>
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1210/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
2010-05-15 21:59:53 +01:00
Shane McDonald 95e8f634d7 MIPS FPU emulator: allow Cause bits of FCSR to be writeable by ctc1
In the FPU emulator code of the MIPS, the Cause bits of the FCSR register
    are not currently writeable by the ctc1 instruction.  In odd corner cases,
    this can cause problems.  For example, a case existed where a divide-by-zero
    exception was generated by the FPU, and the signal handler attempted to
    restore the FPU registers to their state before the exception occurred.  In
    this particular setup, writing the old value to the FCSR register would
    cause another divide-by-zero exception to occur immediately.  The solution
    is to change the ctc1 instruction emulator code to allow the Cause bits of
    the FCSR register to be writeable.  This is the behaviour of the hardware
    that the code is emulating.
    
    This problem was found by Shane McDonald, but the credit for the fix goes
    to Kevin Kissell.  In Kevin's words:
    
    I submit that the bug is indeed in that ctc_op:  case of the emulator.  The
    Cause bits (17:12) are supposed to be writable by that instruction, but the
    CTC1 emulation won't let them be updated by the instruction.  I think that
    actually if you just completely removed lines 387-388 [...] things would
    work a good deal better.  At least, it would be a more accurate emulation of
    the architecturally defined FPU.  If I wanted to be really, really pedantic
    (which I sometimes do), I'd also protect the reserved bits that aren't
    necessarily writable.
    
    Signed-off-by: Shane McDonald <mcdonald.shane@gmail.com>
    To: anemo@mba.ocn.ne.jp
    To: kevink@paralogos.com
    To: sshtylyov@mvista.com
    Patchwork: http://patchwork.linux-mips.org/patch/1205/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
2010-05-15 21:59:53 +01:00
Linus Torvalds 18e41da89d Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: check for read permission on src file in the clone ioctl
2010-05-15 12:55:31 -07:00
kirjanov@gmail.com 43aa7ac736 lib/btree: fix possible NULL pointer dereference
mempool_alloc() can return null in atomic case.

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Cc: Joern Engel <joern@logfs.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-15 12:48:10 -07:00
Nicolas Ferre bdef2fe88b mmc: at91_mci: modify cache flush routines
As we were using an internal dma flushing routine, this patch changes to
the DMA API flush_kernel_dcache_page().  Driver is able to compile now.

[akpm@linux-foundation.org: flush_kernel_dcache_page() comes before kunmap_atomic()]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-15 12:48:10 -07:00
Dan Rosenberg 5dc6416414 Btrfs: check for read permission on src file in the clone ioctl
The existing code would have allowed you to clone a file that was
only open for writing

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2010-05-15 12:05:50 -04:00
Linus Torvalds 3f8bf8f0fd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  JFS: Free sbi memory in error path
  fs/sysv: dereferencing ERR_PTR()
  Fix double-free in logfs
  Fix the regression created by "set S_DEAD on unlink()..." commit
2010-05-15 09:03:15 -07:00
Linus Torvalds c28f3f8660 Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf record: Add a fallback to the reference relocation symbol
2010-05-15 09:03:02 -07:00
Jan Blunck 684bdc7ff9 JFS: Free sbi memory in error path
I spotted the missing kfree() while removing the BKL.

[akpm@linux-foundation.org: avoid multiple returns so it doesn't happen again]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-05-15 07:16:34 -04:00
Dan Carpenter 404e781249 fs/sysv: dereferencing ERR_PTR()
I moved the dir_put_page() inside the if condition so we don't dereference
"page", if it's an ERR_PTR().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-05-15 07:16:33 -04:00
Al Viro 265624495f Fix double-free in logfs
iput() is needed *until* we'd done successful d_alloc_root()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-05-15 07:16:33 -04:00
Al Viro d83c49f3e3 Fix the regression created by "set S_DEAD on unlink()..." commit
1) i_flags simply doesn't work for mount/unlink race prevention;
we may have many links to file and rm on one of those obviously
shouldn't prevent bind on top of another later on.  To fix it
right way we need to mark _dentry_ as unsuitable for mounting
upon; new flag (DCACHE_CANT_MOUNT) is protected by d_flags and
i_mutex on the inode in question.  Set it (with dont_mount(dentry))
in unlink/rmdir/etc., check (with cant_mount(dentry)) in places
in namespace.c that used to check for S_DEAD.  Setting S_DEAD
is still needed in places where we used to set it (for directories
getting killed), since we rely on it for readdir/rmdir race
prevention.

2) rename()/mount() protection has another bogosity - we unhash
the target before we'd checked that it's not a mountpoint.  Fixed.

3) ancient bogosity in pivot_root() - we locked i_mutex on the
right directory, but checked S_DEAD on the different (and wrong)
one.  Noticed and fixed.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-05-15 07:16:33 -04:00
Linus Torvalds bfcf1ae2b2 Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: 6126/1: ARM mpcore_wdt: fix build failure and other fixes
  ARM: 6125/1: ARM TWD: move TWD registers to common header
  ARM: 6110/1: Fix Thumb-2 kernel builds when UACCESS_WITH_MEMCPY is enabled
  ARM: 6112/1: Use the Inner Shareable I-cache and BTB ops on ARMv7 SMP
  ARM: 6111/1: Implement read/write for ownership in the ARMv6 DMA cache ops
  ARM: 6106/1: Implement copy_to_user_page() for noMMU
  ARM: 6105/1: Fix the __arm_ioremap_caller() definition in nommu.c
2010-05-14 21:28:42 -07:00
Linus Torvalds ecbb458a48 Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, mrst: Don't blindly access extended config space
2010-05-14 21:28:23 -07:00