safe/jmp/linux-2.6
13 years agortc: s3c: initialize driver data before using it
Maurus Cuelenaere [Fri, 4 Jun 2010 21:14:44 +0000 (14:14 -0700)]
rtc: s3c: initialize driver data before using it

s3c_rtc_setfreq() uses the platform driver data to derive struct rtc_device,
so make sure drvdata is set _before_ s3c_rtc_setfreq() is called.

Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Maurus Cuelenaere <mcuelenaere@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMinix: Clean up left over label
Andrew Hendry [Fri, 4 Jun 2010 12:51:24 +0000 (22:51 +1000)]
Minix: Clean up left over label

Remove a left over fail label.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agofix truncate inode time modification breakage
Nick Piggin [Thu, 3 Jun 2010 12:01:46 +0000 (22:01 +1000)]
fix truncate inode time modification breakage

mtime and ctime should be changed only if the file size has actually
changed. Patches changing ext2 and tmpfs from vmtruncate to new truncate
sequence has caused regressions where they always update timestamps.

There is some strange cases in POSIX where truncate(2) must not update
times unless the size has acutally changed, see 6e656be89.

This area is all still rather buggy in different ways in a lot of
filesystems and needs a cleanup and audit (ideally the vfs will provide
a simple attribute or call to direct all filesystems exactly which
attributes to change). But coming up with the best solution will take a
while and is not appropriate for rc anyway.

So fix recent regression for now.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agofix setattr error handling in sysfs, configfs
Nick Piggin [Mon, 31 May 2010 07:58:02 +0000 (17:58 +1000)]
fix setattr error handling in sysfs, configfs

sysfs and configfs setattr functions have error cases after the generic inode's
attributes have been changed. Fix consistency by changing the generic inode
attributes only when it is guaranteed to succeed.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agofcntl: return -EFAULT if copy_to_user fails
Dan Carpenter [Thu, 3 Jun 2010 10:35:42 +0000 (12:35 +0200)]
fcntl: return -EFAULT if copy_to_user fails

copy_to_user() returns the number of bytes remaining, but we want to
return -EFAULT.
ret = fcntl(fd, F_SETOWN_EX, NULL);
With the original code ret would be 8 here.

V2: Takuya Yoshikawa pointed out a similar issue in f_getown_ex()

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agowrong type for 'magic' argument in simple_fill_super()
Roberto Sassu [Thu, 3 Jun 2010 09:58:28 +0000 (11:58 +0200)]
wrong type for 'magic' argument in simple_fill_super()

It's used to superblock ->s_magic, which is unsigned long.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Reviewed-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
CC: stable@kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agofix the deadlock in qib_fs
Al Viro [Sat, 29 May 2010 01:32:44 +0000 (21:32 -0400)]
fix the deadlock in qib_fs

get_sb_single() calls fill_super with superblock locked; calling
deactivate_super() will deadlock immedately.  Moreover, if fill_super
callback returns an error, get_sb_single() will release the reference
to superblock itself just fine.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agomqueue doesn't need make_bad_inode()
Al Viro [Fri, 28 May 2010 23:06:15 +0000 (19:06 -0400)]
mqueue doesn't need make_bad_inode()

It never hashes them anyway and does final iput() immediately
afterwards.  With ->drop_inode() being generic_delete_inode()...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoStaging: sep: return -EFAULT on copy_to_user errors
Dan Carpenter [Fri, 4 Jun 2010 10:38:40 +0000 (12:38 +0200)]
Staging: sep: return -EFAULT on copy_to_user errors

copy_to_user() returns the number of bytes remaining but we want to
return a negative error code here.  These functions are used in the
ioctl handler and the error code gets returned to userspace.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: rc2860: return -EFAULT on copy_to_user errors
Dan Carpenter [Fri, 4 Jun 2010 10:39:51 +0000 (12:39 +0200)]
Staging: rc2860: return -EFAULT on copy_to_user errors

copy_to_user() returns the number of bytes remaining but we want to
return a negative error code.  This is in the ioctl handler and the
error code gets passed to userspace.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: Eliminate a NULL pointer dereference
Julia Lawall [Thu, 27 May 2010 12:37:19 +0000 (14:37 +0200)]
Staging: Eliminate a NULL pointer dereference

Eliminate a NULL or near NULL pointer dereference.

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 <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: Use GFP_ATOMIC when a lock is held
Julia Lawall [Sun, 30 May 2010 20:27:46 +0000 (22:27 +0200)]
staging: Use GFP_ATOMIC when a lock is held

In each case, the containing function is only called from one place, where
a spin lock is held.

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

// <smpl>
@gfp exists@
identifier fn;
position p;
@@

fn(...) {
... when != spin_unlock
    when any
  GFP_KERNEL@p
 ... when any
}

@locked@
identifier gfp.fn;
@@

spin_lock(...)
... when != spin_unlock
fn(...)

@depends on locked@
position gfp.p;
@@

- GFP_KERNEL@p
+ GFP_ATOMIC
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Cc: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi - correct parameter gainlkup for DAQCard-6024E in driver ni_mio_cs.c
Martin Homuth-Rosemann [Mon, 31 May 2010 20:33:04 +0000 (22:33 +0200)]
Staging: comedi - correct parameter gainlkup for DAQCard-6024E in driver ni_mio_cs.c

Correct at least one of the incorrect specs for a national instrument
data acquisition card DAQCard-6024E. This card has only four different
gain settings (+-10V, +-5V, +-0.5V, +-0.05V).

Signed-off-by: Martin Homuth-Rosemann <homuth-rosemann@gmx.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: fixing ni_labpc to mite dependancy
Alexander Kurz [Thu, 3 Jun 2010 11:50:24 +0000 (15:50 +0400)]
Staging: comedi: fixing ni_labpc to mite dependancy

the dependancy of ni_labpc on mite was missing,

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
index 0aa2b0d..79f5f2e 100644

13 years agoStaging: wlags49_h2, wlags49_h25: fixed Kconfig dependencies
Henk de Groot [Wed, 2 Jun 2010 19:30:00 +0000 (21:30 +0200)]
Staging: wlags49_h2, wlags49_h25: fixed Kconfig dependencies

Fixes Kconfig so the wlags49_h2 and wlags49_h25 drivers can be
selected from menuconfig without having to select another WLAN
driver first. Before it could only be selected when another driver
already selected WIRELESS_EXT. Also adds WEXT_PRIV on which
the driver also depends.

Align help text in Kconfig.

Signed-off-by: Henk de Groot <pe1dnn@amsat.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: phison: depends on ATA_BMDMA
Randy Dunlap [Wed, 26 May 2010 17:30:02 +0000 (10:30 -0700)]
Staging: phison: depends on ATA_BMDMA

phison uses interfaces and data that are built only when
ATA_BMDMA is enabled, so it should depend on that symbol.

drivers/staging/phison/phison.c:43: error: implicit declaration of function 'ATA_BMDMA_SHT'
drivers/staging/phison/phison.c:43: error: initializer element is not constant
drivers/staging/phison/phison.c:43: error: (near initialization for 'phison_sht.module')
drivers/staging/phison/phison.c:47: error: 'ata_bmdma_port_ops' undeclared here (not in a function)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: evan_ko@phison.com
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: iio-utils: fix memory overflow for dynamically allocateded memory to hold...
Barry Song [Tue, 25 May 2010 09:40:04 +0000 (17:40 +0800)]
Staging: iio-utils: fix memory overflow for dynamically allocateded memory to hold filename

Signed-off-by: Barry Song <21cnbao@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: adis16255: add proper section markings to hotplug funcs
Mike Frysinger [Mon, 24 May 2010 04:55:42 +0000 (00:55 -0400)]
Staging: adis16255: add proper section markings to hotplug funcs

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: adis16255: fix typo in Kconfig
Mike Frysinger [Mon, 24 May 2010 04:55:41 +0000 (00:55 -0400)]
Staging: adis16255: fix typo in Kconfig

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: Don't allocate icmp packet with GFP_KERNEL
Sven Eckelmann [Sat, 22 May 2010 15:48:47 +0000 (17:48 +0200)]
Staging: batman-adv: Don't allocate icmp packet with GFP_KERNEL

A new buffer for a packet is created when a icmp packet is received.
This happens in a context with disabled irq. Thus we are not allowed to
sleep or call function which might sleep. kmalloc must be called with
GFP_ATOMIC instead of GFP_KERNEL to ensure that it does not sleep.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: Don't call free_netdev twice
Sven Eckelmann [Sat, 22 May 2010 15:48:46 +0000 (17:48 +0200)]
Staging: batman-adv: Don't call free_netdev twice

Free_netdev is registered as destructor in interface_setup for every
soft_device. This destructor is automatically called from
unregister_netdev and we must not call it again for the freed
net_device.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: Call unregister_netdev on failures to get rtnl lock
Sven Eckelmann [Sat, 22 May 2010 15:48:45 +0000 (17:48 +0200)]
Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock

We must call unregister_netdev when we couldn't initialise the
batman-adv module and the soft_device was registered. There are two
version of the function which we can use:
 * unregister_netdevice - removes device
 * unregister_netdev - takes rtnl semaphore and remove device

We don't hold the semaphore in an error situation. So we must use
unregister_netdev.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: fix rogue packets on shutdown
Marek Lindner [Sat, 22 May 2010 15:48:44 +0000 (17:48 +0200)]
Staging: batman-adv: fix rogue packets on shutdown

On module shutdown batman-adv would purge the internal packet
queue by sending all remaining packets which could confuse
other nodes. Now, the packets are silently discarded.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: add MSM framebuffer driver
Stepan Moskovchenko [Wed, 19 May 2010 18:03:30 +0000 (11:03 -0700)]
Staging: add MSM framebuffer driver

Qualcomm development of the MSM SOC framebuffer driver has
diverged significantly from the driver used by Android. This
is a snapshot of our current driver, in all it's agony. We are
putting this in staging to help with the process of converging
the two drivers.

At this point, the driver has been tested only in dumb
framebuffer mode.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
[dwalker@codeaurora.org: added a small compile fix and TODO.]
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: fixing ni_tio to mite PCI dependancy
Alexander Kurz [Wed, 19 May 2010 20:32:42 +0000 (00:32 +0400)]
Staging: comedi: fixing ni_tio to mite PCI dependancy

On Wed, 19 May 2010, Randy Dunlap wrote:
> linux-next of 2010-0519:
> when CONFIG_PCI is not enabled:
>
> drivers/staging/comedi/drivers/mite.c: In function 'mite_init':
> drivers/staging/comedi/drivers/mite.c:89: error: implicit declaration of function 'pci_dev_get'
> drivers/staging/comedi/drivers/mite.c:89: warning: assignment makes pointer from integer without a cast
> make[5]: *** [drivers/staging/comedi/drivers/mite.o] Error 1

This patch fixes the problem.

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: fix 8255 and DAS08 Kconfig dependancies.
Alexander Kurz [Wed, 19 May 2010 19:13:19 +0000 (23:13 +0400)]
Staging: comedi: fix 8255 and DAS08 Kconfig dependancies.

Both drivers support directly or indirectly multiple bus types,
hence both are listed independent of bus types.

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: For COMEDI_BUFINFO, check access to command
Ian Abbott [Wed, 19 May 2010 17:09:50 +0000 (18:09 +0100)]
Staging: comedi: For COMEDI_BUFINFO, check access to command

Don't allow COMEDI_BUFINFO ioctl if some other file object has locked
the subdevice or has an active command.  If there is no active command,
just report back the last buffer position.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: COMEDI_BUFINFO with no async - report no bytes read or written
Ian Abbott [Wed, 19 May 2010 17:09:49 +0000 (18:09 +0100)]
Staging: comedi: COMEDI_BUFINFO with no async - report no bytes read or written

When the COMEDI_BUFINFO ioctl is used on a subdevice without
asynchronous streaming command support, set 'bytes_read = 0' and
'bytes_written = 0' in the buffer info returned back to the user.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: don't write to buffer if command finished
Ian Abbott [Wed, 19 May 2010 16:22:41 +0000 (17:22 +0100)]
Staging: comedi: don't write to buffer if command finished

For write(), any data copied to the data buffer after the previously
set up streaming acquisition command has finished won't be used, but a
non-empty write() does not currently return 0 (or -EPIPE on error) after
the command has finished until the data buffer has been filled up.
Change this behavior to return 0 (or -EPIPE) any time after the command
has finished, without bothering to fill up the buffer with more useless
data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: amplc_dio200: Protect counter subdevice with spinlock
Ian Abbott [Wed, 19 May 2010 15:59:40 +0000 (16:59 +0100)]
Staging: comedi: amplc_dio200: Protect counter subdevice with spinlock

The internal state of an 82C54 counter timer chip will get messed up if
several threads read, write, configure, or check the status of the chip
simultaneously.  Protect the register access sequences with a spin lock.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: adv_pci_dio: Support Advantech PCI-1735U
Ian Abbott [Wed, 19 May 2010 15:34:07 +0000 (16:34 +0100)]
Staging: comedi: adv_pci_dio: Support Advantech PCI-1735U

Add support for the Advantech PCI-1735U card, including support for a
counter subdevice (based on an 82C54 counter timer chip).

The counter subdevice needs more testing, as the only person I know who
tried it couldn't get it to work!

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: addi-data: don't overwrite name for request_irq()
Ian Abbott [Wed, 19 May 2010 14:11:58 +0000 (15:11 +0100)]
Staging: comedi: addi-data: don't overwrite name for request_irq()

The Addi-Data PCI drivers for Comedi use sprintf() in their comedi
"attach" routine to construct a string to pass as the name in the call
to request_irq().  All calls to "attach" routine share the same static
buffer for this name, but the contents will differ on each call
(including the comedi device number and the comedi board name).  This
changes the name displayed in /proc/interrupts for previous calls to
request_irq() using the same buffer.  Just use the board name instead;
it has slightly less information (no comedi device number) but at least
it doesn't change over the lifetime of the IRQ handler.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: comedi: Give the addi_apci_* drivers different driver names
Ian Abbott [Wed, 19 May 2010 14:11:57 +0000 (15:11 +0100)]
Staging: comedi: Give the addi_apci_* drivers different driver names

It is not currently possible for more than one of the addi_apci_*
drivers to register themselves with comedi at once because they all use
the same comedi driver name "addi_common".  Give them different names.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: mid: Intel MID touch screen driver
Sreedhara DS [Tue, 1 Jun 2010 11:50:06 +0000 (12:50 +0100)]
Staging: mid: Intel MID touch screen driver

Touchscreen driver used by intel mid devices. Some clean up by Alan Cox. This
driver is basically ready for upstreaming properly but is tied wrongly to the
SPI layer and needs firmware/SFI changes to fix that.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: Add framebuffer driver for XGI chipsets
apatard@mandriva.com [Wed, 19 May 2010 08:44:14 +0000 (10:44 +0200)]
staging: Add framebuffer driver for XGI chipsets

This driver handles XG20, XG21, XG40, XG42 chipsets from XGI. They're
also known as Z7,Z9,Z11 chipsets. It's based on the SiS fb driver but
has been heavily modified by XGI to support their newer chipsets.

Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: add support for various Titan PCI cards
Yegor Yefremov [Fri, 4 Jun 2010 07:58:18 +0000 (09:58 +0200)]
serial: add support for various Titan PCI cards

serial: add support for various Titan PCI cards

Models: 200I, 400I, 800I, 400EH, 800EH, 800EHB,
        100E, 200E, 400E, 800E, 200EI, 200EISI

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agovt_ioctl: return -EFAULT on copy_from_user errors
Dan Carpenter [Fri, 4 Jun 2010 10:20:46 +0000 (12:20 +0200)]
vt_ioctl: return -EFAULT on copy_from_user errors

copy_from_user() returns the number of bytes remaining but we want to
return a negative error code here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: altera_uart: Proper section for altera_uart_remove
Tobias Klauser [Mon, 31 May 2010 13:01:08 +0000 (15:01 +0200)]
serial: altera_uart: Proper section for altera_uart_remove

altera_uart_remove should be in .devexit.text

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: fix a little bug in scrup, vt.c
Frank Pan [Wed, 26 May 2010 07:37:43 +0000 (15:37 +0800)]
tty: fix a little bug in scrup, vt.c

The code uses vc->vc_cols instead of vc->vc_size_row by mistake, it
will cause half of the region which is going to clear remain
uncleared.
The issue happens in background consoles, so it's hard to observe.

Frank Pan

Signed-off-by: Frank Pan <frankpzh@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Simplify altera_uart_console_putc
Tobias Klauser [Tue, 25 May 2010 15:00:08 +0000 (17:00 +0200)]
altera_uart: Simplify altera_uart_console_putc

The check for the TRDY flag after writing the character is not needed.
Also do a cpu_relax() inside the loop.

Pass a struct uart_port to altera_uart_console_putc, so we do not need
to get it (and dereference pointers) for every character.

Cc: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Don't take spinlock in already protected functions
Tobias Klauser [Tue, 25 May 2010 14:59:55 +0000 (16:59 +0200)]
altera_uart: Don't take spinlock in already protected functions

Don't take the port spinlock in uart functions where the serial core
already takes care of locking/unlocking them.

The code would actually lock up on architectures where spinlocks are
implemented (not the case on nios2 where this driver is primarily used
for now, thus this bug didn't trigger).

Also protect calling altera_uart_rx_chars/altera_uart_tx_chars in the
interrupt handler by the port spinlock.

Thanks to Ian Abbott for pointing these issues out.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoTTY/n_gsm: potential double lock
Dan Carpenter [Tue, 25 May 2010 09:37:17 +0000 (11:37 +0200)]
TTY/n_gsm: potential double lock

In gsm_dlci_data_kick() we call gsm_dlci_data_sweep() with the
"gsm->tx_lock" held so we can't lock it again inside
gsm_dlci_data_sweep().  I removed that lock from and added one to
gsmld_write_wakeup() instead.  The sweep function is only called from
those two places.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: bfin_5xx: fix typo in IER check
Sonic Zhang [Sun, 23 May 2010 08:40:14 +0000 (04:40 -0400)]
serial: bfin_5xx: fix typo in IER check

This most likely won't cause problems on systems as people don't typically
enable GPIO RTS/CTS if they don't actually use it.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: bfin_5xx: IRDA is not affected by anomaly 05000230
Graf Yang [Sun, 23 May 2010 08:40:13 +0000 (04:40 -0400)]
serial: bfin_5xx: IRDA is not affected by anomaly 05000230

Anomaly 05000230 (over sampling of the UART STOP bit) applies only when
the peripheral is operating in UART mode.  So drop the anomaly handling
when the UART is in IRDA mode.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial_cs: add and sort IDs for serial and modem cards
Alexander Kurz [Wed, 19 May 2010 20:40:08 +0000 (00:40 +0400)]
serial_cs: add and sort IDs for serial and modem cards

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agomsm_serial: fix serial on trout
Abhijeet Dharmapurikar [Thu, 20 May 2010 22:20:23 +0000 (15:20 -0700)]
msm_serial: fix serial on trout

Set the mnd counter based on uartclk. This fixes a problem
on 7x30 where the uartclk is 19.2Mhz rather than the usual
4.8Mhz.

Trout incorrectly reports uartclk to be running at 19.2Mhz
It is actually running at 4.8Mhz.  For trout force mnd
counter values as if uartclk was fed by tcxo/4.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
[dwalker@codeaurora.org: inlined, moved into header, added comments.]
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agofix setattr error handling in sysfs, configfs
Nick Piggin [Mon, 31 May 2010 07:58:02 +0000 (17:58 +1000)]
fix setattr error handling in sysfs, configfs

sysfs and configfs setattr functions have error cases after the generic inode's
attributes have been changed. Fix consistency by changing the generic inode
attributes only when it is guaranteed to succeed.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agokobject: free memory if netlink_kernel_create() fails
Dan Carpenter [Tue, 25 May 2010 09:51:10 +0000 (11:51 +0200)]
kobject: free memory if netlink_kernel_create() fails

There is a kfree(ue_sk) missing on the error path if
netlink_kernel_create() fails.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agolib/kobject_uevent.c: fix CONIG_NET=n warning
Andrew Morton [Fri, 21 May 2010 22:05:21 +0000 (15:05 -0700)]
lib/kobject_uevent.c: fix CONIG_NET=n warning

lib/kobject_uevent.c:87: warning: 'kobj_bcast_filter' defined but not used

Repairs "hotplug: netns aware uevent_helper"

Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: unbind all interfaces before rebinding them
Alan Stern [Fri, 4 Jun 2010 18:02:42 +0000 (14:02 -0400)]
USB: unbind all interfaces before rebinding them

This patch (as1387) fixes a bug introduced during the changeover to
the runtime PM framework.  When a driver doesn't support resume or
reset-resume, and consequently its interfaces need to be unbound and
rebound, we have to unbind all the interfaces before trying to rebind
any of them.  Otherwise the driver's probe method for one interface
could try to claim a different interface and fail, because that other
interface hasn't been unbound yet.

This fixes Bugzilla #15788.  The symptom is that some USB sound cards
don't work after hibernation.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: François Valenduc <francois.valenduc@tvcablenet.be>
Cc: stable <stable@kernel.org> [.34]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: digi_acceleport: Eliminate a NULL pointer dereference
Julia Lawall [Thu, 27 May 2010 12:32:09 +0000 (14:32 +0200)]
USB: serial: digi_acceleport: Eliminate a NULL pointer dereference

If port is NULL, then the call to dev_err will dereference a value that is
a small offset from NULL.

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 <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: fix ehci_hcd build failure when both generic-OF and xilinx is selected
Grant Likely [Wed, 2 Jun 2010 19:53:17 +0000 (13:53 -0600)]
usb: fix ehci_hcd build failure when both generic-OF and xilinx is selected

This patch fixes the driver to allow both CONFIG_USB_EHCI_HCD_PPC_OF and
CONFIG_USB_ECHI_HCD_XILINX to be selected.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: John Linn <john.linn@xilinx.com>
CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc-acm: fix resource reclaim in error path of acm_probe
Axel Lin [Mon, 31 May 2010 00:04:47 +0000 (08:04 +0800)]
USB: cdc-acm: fix resource reclaim in error path of acm_probe

This patch fixes resource reclaim in error path of acm_probe:

1. In the case of "out of memory (read urbs usb_alloc_urb)\n")", there
   is no need to call acm_read_buffers_free(acm) here.  Fix it by goto
   alloc_fail6 instead of alloc_fail7.
2. In the case of "out of memory (write urbs usb_alloc_urb)",
   usb_alloc_urb may fail in any iteration of the for loop.  Current
   implementation does not properly free allocated snd->urb.  Fix it by
   goto alloc_fail8 instead of alloc_fail7.
3. In the case of device_create_file(&intf->dev,&dev_attr_iCountryCodeRelDate)
   fail, acm->country_codes is kfreed. As a result, device_remove_file
   for dev_attr_wCountryCodes will not be executed in acm_disconnect.
   Fix it by calling device_remove_file for dev_attr_wCountryCodes
   before goto skip_countries.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: fix DTR/RTS line modes
Daniel Mack [Thu, 3 Jun 2010 11:55:02 +0000 (13:55 +0200)]
USB: ftdi_sio: fix DTR/RTS line modes

Call set_mctrl() and clear_mctrl() according to the flow control mode
selected. This makes serial communication for FT232 connected devices
work when CRTSCTS is not set.

This fixes a regression introduced by 4175f3e31 ("tty_port: If we are
opened non blocking we still need to raise the carrier"). This patch
calls the low-level driver's dtr_rts() function which consequently sets
TIOCM_DTR | TIOCM_RTS. A later call to set_termios() without CRTSCTS in
cflags, however, does not reset these bits, and so data is not actually
sent out on the serial wire.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: s3c-hsotg: Ensure FIFOs are fully flushed after layout
Ben Dooks [Tue, 25 May 2010 04:36:52 +0000 (05:36 +0100)]
USB: s3c-hsotg: Ensure FIFOs are fully flushed after layout

According to the design guide, if the FIFO layout is changed, then the
FIFOs must be flushed to ensure all FIFO pointers are correct.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: s3c-hsotg: SoftDisconnect minimum 3ms
Ben Dooks [Tue, 25 May 2010 04:36:51 +0000 (05:36 +0100)]
USB: s3c-hsotg: SoftDisconnect minimum 3ms

The shortest period SoftDisconnect can be asserted for is 3 milliseconds
according to the V210 datasheet, so ensure that we add an msleep() to
the registration code to enforce this.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: s3c-hsotg: Ensure TX FIFO addresses setup when initialising FIFOs
Ben Dooks [Tue, 25 May 2010 04:36:50 +0000 (05:36 +0100)]
USB: s3c-hsotg: Ensure TX FIFO addresses setup when initialising FIFOs

Some versions of the S3C HS OtG block startup with overlapping TX FIFO
information, so change the fifo_init code to ensure that known values
are set into the FIFO registers at initialisation/reset time.

This also ensures that the FIFO RAM pointers are in a known state
before use.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: s3c_hsotg: define USB_GADGET_DUALSPEED in Kconfig
Maurus Cuelenaere [Tue, 25 May 2010 04:36:49 +0000 (05:36 +0100)]
USB: s3c_hsotg: define USB_GADGET_DUALSPEED in Kconfig

The s3c_hsotg driver sets usb_gadget->is_dualspeed to 1, yet it doesn't define
USB_GADGET_DUALSPEED in Kconfig. This triggers a NULL pointer dereference in
the composite driver (which is fixed in another patch).

Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: s3c: Enable soft disconnect during initialization
Thomas Abraham [Mon, 24 May 2010 08:48:56 +0000 (17:48 +0900)]
USB: s3c: Enable soft disconnect during initialization

Enable soft disconnect bit the OTG core during initialization. Without this,
the host sees that a gadget is connected and tries to enumerate. The
soft disconnect should be enabled until the USB gadget driver is
registered with this otg driver.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: xhci: Print NEC firmware version.
Sarah Sharp [Mon, 24 May 2010 20:25:28 +0000 (13:25 -0700)]
USB: xhci: Print NEC firmware version.

The NEC xHCI host controller firmware version can be found by putting a
vendor-specific command on the command ring and extracting the BCD
encoded-version out of the vendor-specific event TRB.

The firmware version debug line in dmesg will look like:

xhci_hcd 0000:05:00.0: NEC firmware version 30.21

(NEC merged with Renesas Technologies and became Renesas Electronics on
April 1, 2010.  I have their OK to merge this vendor-specific code.)

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Satoshi Otani <satoshi.otani.xm@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: xhci: Wait for host to start running.
Sarah Sharp [Mon, 24 May 2010 20:25:21 +0000 (13:25 -0700)]
USB: xhci: Wait for host to start running.

When the run bit is set in the xHCI command register, it may take a few
microseconds for the host to start running.  We cannot ring any doorbells
until the host is actually running, so wait until the status register says
the host is running.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Shinya Saito <shinya.saito.sx@renesas.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: xhci: Wait for controller to be ready after reset.
Sarah Sharp [Mon, 24 May 2010 20:25:15 +0000 (13:25 -0700)]
USB: xhci: Wait for controller to be ready after reset.

After software resets an xHCI host controller, it must wait for the
"Controller Not Ready" (CNR) bit in the status register to be cleared.
Software is not supposed to ring any doorbells or write to any registers
except the status register until this bit is cleared.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: isp1362: fix inw warning on Blackfin systems
Mike Frysinger [Fri, 21 May 2010 08:37:42 +0000 (04:37 -0400)]
USB: isp1362: fix inw warning on Blackfin systems

The Blackfin code is incorrectly casting the argument to inw() to a pointer.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: mos7840: fix null-pointer dereference
Johan Hovold [Wed, 19 May 2010 20:13:17 +0000 (22:13 +0200)]
USB: mos7840: fix null-pointer dereference

Fix null-pointer dereference on error path.

Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Fri, 4 Jun 2010 20:04:39 +0000 (13:04 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: Eliminate us to pm ticks conversion in common path
  ACPI: Fix the incorrect calculation about C-state idle time
  ACPI: update feature-removal.txt to reflect deleted acpi=ht option
  ACPI / EC / PM: Fix names of functions that block/unblock EC transactions
  ACPI / EC / PM: Fix race between EC transactions and system suspend

13 years agoMerge branch 'acpi-idle' into release
Len Brown [Fri, 4 Jun 2010 19:23:02 +0000 (15:23 -0400)]
Merge branch 'acpi-idle' into release

13 years agoMerge branch 'sfi-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb...
Linus Torvalds [Fri, 4 Jun 2010 19:22:43 +0000 (12:22 -0700)]
Merge branch 'sfi-release' of git://git./linux/kernel/git/lenb/linux-sfi-2.6

* 'sfi-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-sfi-2.6:
  SFI: do not return freed pointer

13 years agoACPI: Eliminate us to pm ticks conversion in common path
Venkatesh Pallipadi [Wed, 2 Jun 2010 17:01:09 +0000 (10:01 -0700)]
ACPI: Eliminate us to pm ticks conversion in common path

acpi_enter_[simple|bm] routines does us to pm tick conversion on every
idle wakeup and the value is only used in /proc/acpi display. We can
store the time in us and convert it into pm ticks before printing instead and
avoid the conversion in the common path.

Signed-off-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Len Brown <len.brown@intel.com>
13 years agoACPI: Fix the incorrect calculation about C-state idle time
Zhao Yakui [Wed, 2 Jun 2010 03:04:09 +0000 (11:04 +0800)]
ACPI: Fix the incorrect calculation about C-state idle time

The C-state idle time is not calculated correctly, which will return the wrong
residency time in C-state. It will have the following effects:
   1.  The system can't choose the deeper C-state when it is idle next time.
Of course the system power is increased. E.g. On one server machine about 40W
idle power is increased.
   2.  The powertop shows that it will stay in C0 running state about 95% time
although the system is idle at most time.

2.6.35-rc1 regression caused-by: 2da513f582a96c053aacc2c92873978d2ea7abff
(ACPI: Minor cleanup eliminating redundant PMTIMER_TICKS to NS conversion)

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reported-by: Yu Zhidong <zhidong.yu@intel.com>
Tested-by: Yu Zhidong <zhidong.yu@intel.com>
Acked-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Len Brown <len.brown@intel.com>
13 years agoMerge branch 'master' into for-linus
Alex Elder [Fri, 4 Jun 2010 18:22:30 +0000 (13:22 -0500)]
Merge branch 'master' into for-linus

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 4 Jun 2010 16:48:03 +0000 (09:48 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda-intel - fix wallclk variable update and condition
  ALSA: asihpi - Fix uninitialized variable
  ALSA: hda: Use LPIB for ASUS M2V
  usb/gadget: Replace the old USB audio FU definitions in f_audio.c
  ASoC: MX31ads sound support should depend on MACH_MX31ADS_WM1133_EV1
  ASoC: Add missing Kconfig entry for Phytec boards
  ALSA: usb-audio: export UAC2 clock selectors as mixer controls
  ALSA: usb-audio: clean up find_audio_control_unit()
  ALSA: usb-audio: add UAC2 sepecific Feature Unit controls
  ALSA: usb-audio: unify constants from specification
  ALSA: usb-audio: parse clock topology of UAC2 devices
  ALSA: usb-audio: fix selector unit string index accessor
  include/linux/usb/audio-v2.h: add more UAC2 details
  ALSA: usb-audio: support partially write-protected UAC2 controls
  ALSA: usb-audio: UAC2: clean up parsing of bmaControls
  ALSA: hda: Use LPIB for another mainboard
  ALSA: hda: Use mb31 quirk for an iMac model
  ALSA: hda: Use LPIB for an ASUS device

13 years agoblock: make blk_init_free_list and elevator_init idempotent
Mike Snitzer [Tue, 25 May 2010 17:15:15 +0000 (13:15 -0400)]
block: make blk_init_free_list and elevator_init idempotent

blk_init_allocated_queue_node may fail and the caller _could_ retry.
Accommodate the unlikely event that blk_init_allocated_queue_node is
called on an already initialized (possibly partially) request_queue.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoblock: avoid unconditionally freeing previously allocated request_queue
Mike Snitzer [Thu, 3 Jun 2010 17:34:52 +0000 (11:34 -0600)]
block: avoid unconditionally freeing previously allocated request_queue

On blk_init_allocated_queue_node failure, only free the request_queue if
it is wasn't previously allocated outside the block layer
(e.g. blk_init_queue_node was blk_init_allocated_queue_node caller).

This addresses an interface bug introduced by the following commit:
01effb0 block: allow initialization of previously allocated
request_queue

Otherwise the request_queue may be free'd out from underneath a caller
that is managing the request_queue directly (e.g. caller uses
blk_alloc_queue + blk_init_allocated_queue_node).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoInput: wacom - add Cintiq 21UX2 and Intuos4 WL
Ping Cheng [Fri, 4 Jun 2010 05:10:21 +0000 (22:10 -0700)]
Input: wacom - add Cintiq 21UX2 and Intuos4 WL

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Thu, 3 Jun 2010 22:48:15 +0000 (15:48 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: implement on-demand HPA unlocking
  libata: use the enlarged capacity after late HPA unlock
  SCSI: implement sd_unlock_native_capacity()
  libata-sff: trivial corrections to Kconfig help text
  sata_nv: don't diddle with nIEN on mcp55
  sata_via: magic vt6421 fix for transmission problems w/ WD drives

13 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 3 Jun 2010 22:47:51 +0000 (15:47 -0700)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched, trace: Fix sched_switch() prev_state argument
  sched: Fix wake_affine() vs RT tasks
  sched: Make sure timers have migrated before killing the migration_thread

13 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 3 Jun 2010 22:47:22 +0000 (15:47 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./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, smpboot: Fix cores per node printing on boot
  x86/amd-iommu: Fall back to GART if initialization fails
  x86/amd-iommu: Fix crash when request_mem_region fails
  x86/mm: Remove unused DBG() macro
  arch/x86/kernel: Add missing spin_unlock

13 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Thu, 3 Jun 2010 22:46:37 +0000 (15:46 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/macio: Fix probing of macio devices by using the right of match table
  agp/uninorth: Fix oops caused by flushing too much
  powerpc/pasemi: Update MAINTAINERS file
  powerpc/cell: Fix integer constant warning
  powerpc/kprobes: Remove resume_execution() in kprobes
  powerpc/macio: Don't dereference pointer before null check

13 years agoMerge branch 'for-linus/bugfixes' of git://xenbits.xensource.com/people/ianc/linux-2.6
Linus Torvalds [Thu, 3 Jun 2010 22:46:09 +0000 (15:46 -0700)]
Merge branch 'for-linus/bugfixes' of git://xenbits.xensource.com/people/ianc/linux-2.6

* 'for-linus/bugfixes' of git://xenbits.xensource.com/people/ianc/linux-2.6:
  xen: avoid allocation causing potential swap activity on the resume path
  xen: ensure timer tick is resumed even on CPU driving the resume

13 years agoMerge branch 'perf-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 3 Jun 2010 22:45:26 +0000 (15:45 -0700)]
Merge branch 'perf-fixes-for-linus-2' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf: Fix crash in swevents
  perf buildid-list: Fix --with-hits event processing
  perf scripts python: Give field dict to unhandled callback
  perf hist: fix objdump output parsing
  perf-record: Check correct pid when forking
  perf: Do the comm inheritance per thread in event__process_task
  perf: Use event__process_task from perf sched
  perf: Process comm events by tid
  blktrace: Fix new kernel-doc warnings
  perf_events: Fix unincremented buffer base on partial copy
  perf_events: Fix event scheduling issues introduced by transactional API
  perf_events, trace: Fix perf_trace_destroy(), mutex went missing
  perf_events, trace: Fix probe unregister race
  perf_events: Fix races in group composition
  perf_events: Fix races and clean up perf_event and perf_mmap_data interaction

13 years agoMerge branch 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
Linus Torvalds [Thu, 3 Jun 2010 22:45:03 +0000 (15:45 -0700)]
Merge branch 'virtio' of git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  virtio: console: Fix crash when port is unplugged and blocked for write
  virtio: console: Fix crash when hot-unplugging a port and read is blocked
  virtio-blk: fix minimum number of S/G elements

13 years agoMerge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Thu, 3 Jun 2010 22:44:43 +0000 (15:44 -0700)]
Merge branch 'i2c-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: Remove all i2c_set_clientdata(client, NULL) in drivers
  i2c/busses: Move two drivers to embedded section
  i2c: Rename i2c_check_addr to i2c_check_addr_busy
  i2c: Document reserved I2C addresses
  i2c: Check for address validity on client registration
  i2c: Share the I2C device presence detection code
  Documentation/i2c: Checkpatch cleanup

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Thu, 3 Jun 2010 22:42:21 +0000 (15:42 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: crypto4xx - Fix build breakage
  n2_crypto: Plumb fallback ahash requests properly.
  n2_crypto: Fix MAU kmem_cache name.
  n2_crypto: Fix build after of_device/of_platform_driver changes.

13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 3 Jun 2010 19:30:58 +0000 (12:30 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agoperf: Fix crash in swevents
Peter Zijlstra [Thu, 3 Jun 2010 09:21:20 +0000 (11:21 +0200)]
perf: Fix crash in swevents

Frederic reported that because swevents handling doesn't disable IRQs
anymore, we can get a recursion of perf_adjust_period(), once from
overflow handling and once from the tick.

If both call ->disable, we get a double hlist_del_rcu() and trigger
a LIST_POISON2 dereference.

Since we don't actually need to stop/start a swevent to re-programm
the hardware (lack of hardware to program), simply nop out these
callbacks for the swevent pmu.

Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1275557609.27810.35218.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Thu, 3 Jun 2010 14:20:28 +0000 (07:20 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  cifs: fix page refcount leak

13 years agoMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Thu, 3 Jun 2010 14:19:45 +0000 (07:19 -0700)]
Merge branch 'drm-linus' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (41 commits)
  drm/radeon/kms: make sure display hw is disabled when suspending
  drm/vmwgfx: Allow userspace to change default layout. Bump minor.
  drm/vmwgfx: Fix framebuffer modesetting
  drm/vmwgfx: Fix vga save / restore with display topology.
  vgaarb: use MIT license
  vgaarb: convert pr_devel() to pr_debug()
  drm: fix typos in Linux DRM Developer's Guide
  drm/radeon/kms/pm: voltage fixes
  drm/radeon/kms/pm: radeon_set_power_state fixes
  drm/radeon/kms/pm: patch default power state with default clocks/voltages on r6xx+
  drm/radeon/kms/pm: enable SetVoltage on r7xx/evergreen
  drm/radeon/kms/pm: add support for SetVoltage cmd table (V2)
  drm/radeon/kms/evergreen: add initial CS parser
  drm/kms: disable/enable poll around switcheroo on/off
  drm/nouveau: fixup confusion over which handle the DSM is hanging off.
  drm/nouveau: attempt to get bios from ACPI v3
  drm/nv50: cast IGP memory location to u64 before shifting
  drm/ttm: Fix ttm_page_alloc.c
  drm/ttm: Fix cached TTM page allocation.
  drm/vmwgfx: Remove some leftover debug messages.
  ...

13 years agoMerge branch 'merge' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Thu, 3 Jun 2010 14:17:31 +0000 (07:17 -0700)]
Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6

* 'merge' of git://git.secretlab.ca/git/linux-2.6:
  of/powerpc: fix fsl_msi device node pointer
  of/watchdog: gef_wdt.c: fix build breakage
  of/edac: fix build breakage in drivers
  of/net: fs_enet/mii-bitbang.c: fix build breakage
  of/usb: fsl_qe_udc.c: fix build breakage
  of/crypto: crypto4xx_core.c: fix build breakage
  of/dma: fix build breakage in ppc4xx adma driver
  of/mtd: nand: fix build breakage in drivers
  of/video: fix build breakage in FB drivers
  of/pcmcia: m8xx_pcmcia.c: Fix build failures
  of/rtc: rtc-mpc5121.c: Fix build failures
  of/dma: mpc512x_dma.c: Fix build failures
  of/mtd/nand: mpc5121_nfc.c: Fix build failures
  of/spi: mpc512x_psc_spi.c: Fix build failures
  watchdog: Fix build failure with OF changes
  of/spi: Fix build failure on spi_ppc4xx.c
  of/usb: fix build error due to of_node pointer move
  of/powerpc: fix 85xx RapidIO device node pointer

13 years agovirtio: console: Fix crash when port is unplugged and blocked for write
Amit Shah [Thu, 27 May 2010 07:54:40 +0000 (13:24 +0530)]
virtio: console: Fix crash when port is unplugged and blocked for write

When a program that has a virtio port opened and blocked for a write
operation, a port hot-unplug event will later led to a crash when
SIGTERM was sent to the program. Fix that.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agovirtio: console: Fix crash when hot-unplugging a port and read is blocked
Amit Shah [Thu, 27 May 2010 07:54:39 +0000 (13:24 +0530)]
virtio: console: Fix crash when hot-unplugging a port and read is blocked

When removing a port we don't check if a program was blocked for read.
This leads to a crash when SIGTERM is sent to the program after
hot-unplugging the port.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agovirtio-blk: fix minimum number of S/G elements
Christoph Hellwig [Tue, 25 May 2010 12:17:54 +0000 (14:17 +0200)]
virtio-blk: fix minimum number of S/G elements

We need at least one S/G element to operate properly, as does the block
layer which increments it to one anyway.  We hit this due to a qemu
bug which advertises a sg_elements of 0 under some circumstances.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (tweaked logic)
13 years agopipe: change /proc/sys/fs/pipe-max-pages to byte sized interface
Jens Axboe [Thu, 3 Jun 2010 12:54:39 +0000 (14:54 +0200)]
pipe: change /proc/sys/fs/pipe-max-pages to byte sized interface

This changes the interface to be based on bytes instead. The API
matches that of F_SETPIPE_SZ in that it rounds up the passed in
size so that the resulting page array is a power-of-2 in size.

The proc file is renamed to /proc/sys/fs/pipe-max-size to
reflect this change.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agopipe: change the privilege required for growing a pipe beyond system max
Jens Axboe [Thu, 3 Jun 2010 10:45:28 +0000 (12:45 +0200)]
pipe: change the privilege required for growing a pipe beyond system max

Change it to CAP_SYS_RESOURCE, as that more accurately models what
we want to control.

Suggested-by: Michael Kerrisk <mtk.manpages@googlemail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agopipe: adjust minimum pipe size to 1 page
Jens Axboe [Thu, 3 Jun 2010 10:44:30 +0000 (12:44 +0200)]
pipe: adjust minimum pipe size to 1 page

We don't need to pages to guarantee the POSIX requirement
that upto a page size write must be atomic to an empty
pipe.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoixgbe: return IXGBE_ERR_RAR_INDEX when out of range
Jeff Kirsher [Wed, 2 Jun 2010 12:44:05 +0000 (12:44 +0000)]
ixgbe: return IXGBE_ERR_RAR_INDEX when out of range

Based on original patch from Shirley Ma <xma@us.ibm.com>
Return IXGBE_ERR_RAR_INDEX when RAR index is out of range, instead of
returning IXGBE_SUCCESS.

CC: Shirley Ma <xma@us.ibm.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoact_pedit: access skb->data safely
Changli Gao [Wed, 2 Jun 2010 04:55:02 +0000 (04:55 +0000)]
act_pedit: access skb->data safely

access skb->data safely

we should use skb_header_pointer() and skb_store_bits() to access skb->data to
handle small or non-linear skbs.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
 net/sched/act_pedit.c |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Store port number in net_device::dev_id
Ben Hutchings [Wed, 2 Jun 2010 10:39:56 +0000 (10:39 +0000)]
sfc: Store port number in net_device::dev_id

This exposes the port number to userland through sysfs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoepic100: Test __BIG_ENDIAN instead of (non-existent) CONFIG_BIG_ENDIAN
Roland Dreier [Wed, 2 Jun 2010 10:36:53 +0000 (10:36 +0000)]
epic100: Test __BIG_ENDIAN instead of (non-existent) CONFIG_BIG_ENDIAN

Probably no one has used this driver on big-endian systems, since it was
setting up descriptor swapping if CONFIG_BIG_ENDIAN is set, which it
never is, since that symbol is not mentioned anywhere else in the kernel
source.  Switch this test to a check for __BIG_ENDIAN so it has a chance
at working.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotehuti: return -EFAULT on copy_to_user errors
Dan Carpenter [Thu, 3 Jun 2010 00:05:35 +0000 (00:05 +0000)]
tehuti: return -EFAULT on copy_to_user errors

copy_to_user() returns the number of bytes remaining but we want to
return a negative error code here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoisdn/kcapi: return -EFAULT on copy_from_user errors
Dan Carpenter [Wed, 2 Jun 2010 23:56:13 +0000 (23:56 +0000)]
isdn/kcapi: return -EFAULT on copy_from_user errors

copy_from_user() returns the number of bytes remaining but we should
return -EFAULT here.  The error code gets returned to the user.  Both
old_capi_manufacturer() and capi20_manufacturer() had other places
that already returned -EFAULT so this won't break anything.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>