linux-2.6
14 years agokconfig: initialize the screen before using curses(3) functions
Arnaud Lacombe [Mon, 6 Jul 2009 04:07:28 +0000 (00:07 -0400)] 
kconfig: initialize the screen before using curses(3) functions

This is needed on non ncurses based implementation to get a properly
initialized `stdscr' in main().

Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
14 years agokconfig: variable argument lists needs `stdarg.h'
Arnaud Lacombe [Mon, 6 Jul 2009 04:07:14 +0000 (00:07 -0400)] 
kconfig: variable argument lists needs `stdarg.h'

Fix build on non GNU based platforms.

Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
14 years agokbuild, deb-pkg: fix install scripts for posix sh
maximilian attems [Sun, 5 Jul 2009 18:17:34 +0000 (20:17 +0200)] 
kbuild, deb-pkg: fix install scripts for posix sh

bash versus dash and posh disagree on expanding $@ within double quotes:
export x="$@"
see http://bugs.debian.org/381091 for details
just use the arglist with $*.

dpkg: error processing linux-image-2.6.31-rc1_2.6.31-rc1-18_i386.deb (--install):
 subprocess pre-installation script returned error exit status 2
export: 6: 2.6.31-rc1-18: bad variable name
fixes http://bugzilla.kernel.org/show_bug.cgi?id=13567

seen on Ubuntu as there dash is the default sh,
versus bash on Debian.

Reported-by: Pauli <suokkos@gmail.com>
Cc: Frans Pop <elendil@planet.nl>
Signed-off-by: maximilian attems <max@stro.at>
Acked-By: Andres Salomon <dilinger@collabora.co.uk>
14 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/fyu/linux-2.6
Linus Torvalds [Fri, 17 Jul 2009 18:15:00 +0000 (11:15 -0700)] 
Merge branch 'release' of git://git./linux/kernel/git/fyu/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/fyu/linux-2.6:
  Revert "Neither asm/types.h nor linux/types.h is required for arch/ia64/include/asm/fpu.h"
  Add dma_debug_init() for ia64
  Fix ia64 compilation IS_ERR and PTE_ERR errors.

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Fri, 17 Jul 2009 17:51:55 +0000 (10:51 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  x86/pci: insert ioapic resource before assigning unassigned resources

14 years agoUpdate Andreas Koensgen's email address
Ralf Baechle [Fri, 17 Jul 2009 04:47:19 +0000 (04:47 +0000)] 
Update Andreas Koensgen's email address

The kernel has used a stale email address of Andreas for a few years.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMAINTAINERS entry for STRIP driver
Ralf Baechle [Fri, 17 Jul 2009 04:42:28 +0000 (04:42 +0000)] 
MAINTAINERS entry for STRIP driver

The web server does no longer exist, it's not on archive.org nor does there
seem to be any mirror.

 MAINTAINERS |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 17 Jul 2009 15:53:56 +0000 (08:53 -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: riptide -  proper handling of pci_register_driver for joystick
  sound: usb-audio: add workaround for Blue Microphones devices
  ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking
  ASoC: Fix NULL pointer dereference in __pxa2xx_pcm_hw_free

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Fri, 17 Jul 2009 15:53:41 +0000 (08:53 -0700)] 
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  virtio_net: Sync header with qemu
  virtio-pci: correctly unregister root device on error
  virtio_blk: ioctl return value fix
  virtio_blk: don't bounce highmem requests
  lguest: restrict CPUID to avoid perf counter wrmsr
  lguest: remove unnecessary forward struct declaration
  lguest: fix journey

14 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 17 Jul 2009 15:53:14 +0000 (08:53 -0700)] 
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing/function: Fix the return value of ftrace_trace_onoff_callback()

14 years agotty_port: Fix return on interrupted use
Alan Cox [Fri, 17 Jul 2009 15:17:26 +0000 (16:17 +0100)] 
tty_port: Fix return on interrupted use

Whoops.. fortunately not many people use this yet.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoRevert "Neither asm/types.h nor linux/types.h is required for arch/ia64/include/asm...
Aurelien Jarno [Fri, 17 Jul 2009 13:35:05 +0000 (06:35 -0700)] 
Revert "Neither asm/types.h nor linux/types.h is required for arch/ia64/include/asm/fpu.h"

asm/fpu.h uses the __IA64_UL macro which is declared in asm/types.h, so
this include is really required. Without it, GNU libc fails to build.

This reverts commit 2678c07b07ac2076675e5d57653bdf02e9af1950.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
14 years agoAdd dma_debug_init() for ia64
fujita [Fri, 10 Jul 2009 04:25:05 +0000 (21:25 -0700)] 
Add dma_debug_init() for ia64

The commit 9916219579d078c80377dd3988c2cc213536d868 was supposed to
add CONFIG_DMA_API_DEBUG support to IA64 however I forgot to add
dma_debug_init().

Signed-off-by: fujita <fujita@tulip.osrg.net>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
14 years agoFix ia64 compilation IS_ERR and PTE_ERR errors.
Fenghua Yu [Fri, 10 Jul 2009 04:23:39 +0000 (21:23 -0700)] 
Fix ia64 compilation IS_ERR and PTE_ERR errors.

When building ia64 kernel with CONFIG_XEN_SYS_HYPERVISOR, compiler reports
errors:

drivers/xen/sys-hypervisor.c: In function ‘uuid_show’:
drivers/xen/sys-hypervisor.c:125: error: implicit declaration of function ‘IS_ERR’
drivers/xen/sys-hypervisor.c:126: error: implicit declaration of function ‘PTR_ERR’

This patch fixes the errors.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
14 years ago[ARM] 5608/1: Updated U300 defconfig
Linus Walleij [Thu, 16 Jul 2009 21:40:26 +0000 (22:40 +0100)] 
[ARM] 5608/1: Updated U300 defconfig

Removed the LBD support that isn't of any use right now at least,
then remove remnants of the TCM config flags that somehow crept
in by mistake (not yet merged patch for 2.6.32) and then the usual
defconfig noise from updated menus.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years ago[ARM] 5606/1: Fix ep93xx watchdog driver headers
Ryan Mallon [Wed, 15 Jul 2009 20:33:22 +0000 (21:33 +0100)] 
[ARM] 5606/1: Fix ep93xx watchdog driver headers

Fix a number of build errors in the ep93xx watchdog driver due
to missing io.h

Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agovirtio_net: Sync header with qemu
Alex Williamson [Tue, 7 Jul 2009 14:47:10 +0000 (08:47 -0600)] 
virtio_net: Sync header with qemu

Qemu added support for a few extra RX modes that Linux doesn't
currently make use of.  Sync the headers to maintain consistency.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agovirtio-pci: correctly unregister root device on error
Mark McLoughlin [Tue, 7 Jul 2009 07:26:45 +0000 (08:26 +0100)] 
virtio-pci: correctly unregister root device on error

If pci_register_driver() fails we're incorrectly unregistering the root
device with device_unregister() rather than root_device_unregister().

Reported-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agovirtio_blk: ioctl return value fix
Christoph Hellwig [Sat, 20 Jun 2009 19:29:41 +0000 (21:29 +0200)] 
virtio_blk: ioctl return value fix

Block driver ioctl methods must return ENOTTY and not -ENOIOCTLCMD if
they expect the block layer to handle generic ioctls.

This triggered a BLKROSET failure in xfsqa #200.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agovirtio_blk: don't bounce highmem requests
Christoph Hellwig [Sat, 18 Jul 2009 03:47:45 +0000 (21:47 -0600)] 
virtio_blk: don't bounce highmem requests

By default a block driver bounces highmem requests, but virtio-blk is
perfectly fine with any request that fit into it's 64 bit addressing scheme,
mapped in the kernel virtual space or not.

Besides improving performance on highmem systems this also makes the
reproducible oops in __bounce_end_io go away (but hiding the real cause).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agolguest: restrict CPUID to avoid perf counter wrmsr
Rusty Russell [Sat, 18 Jul 2009 03:47:44 +0000 (21:47 -0600)] 
lguest: restrict CPUID to avoid perf counter wrmsr

Avoid the following:
[    0.012093] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x2f/0x40()

Rather than chase each new cpuid-detected feature, just lie about the highest
valid CPUID so this code is never run.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agolguest: remove unnecessary forward struct declaration
Davide Libenzi [Sat, 18 Jul 2009 03:47:44 +0000 (21:47 -0600)] 
lguest: remove unnecessary forward struct declaration

While fixing lg.h to drop the fwd declaration, I noticed
there's another one ;)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agolguest: fix journey
Matias Zabaljauregui [Thu, 18 Jun 2009 14:44:06 +0000 (11:44 -0300)] 
lguest: fix journey

fix: "make Guest" was complaining about duplicated G:032

Signed-off-by: Matias Zabaljauregui <zabaljauregui@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agoblock: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
Xiaotian Feng [Fri, 17 Jul 2009 07:26:26 +0000 (15:26 +0800)] 
block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel

In blk-sysfs.c, queue_var_store uses unsigned long to store data,
but queue_var_show uses unsigned int to show data.  This causes,

# echo 70000000000 > /sys/block/<dev>/queue/read_ahead_kb
# cat /sys/block/<dev>/queue/read_ahead_kb => get wrong value

Fix it by using unsigned long.

While at it, convert queue_rq_affinity_show() such that it uses bool
variable instead of explicit != 0 testing.

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
14 years agoataflop: adjust NULL test
Julia Lawall [Mon, 13 Jul 2009 20:43:41 +0000 (22:43 +0200)] 
ataflop: adjust NULL test

dtp is derefenced on the lines above the test !dtp, and so it cannot be
NULL at this point.

A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r@
expression x,E,E1;
identifier f,l;
position p1,p2;
@@

*x@p1->f = E1;
... when != x = E
    when != goto l;
(
*x@p2 == NULL
|
*x@p2 != NULL
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Tejun Heo <tj@kernel.org>
14 years agoblock: fix failfast merge testing in elv_rq_merge_ok()
Tejun Heo [Thu, 16 Jul 2009 06:26:55 +0000 (15:26 +0900)] 
block: fix failfast merge testing in elv_rq_merge_ok()

Commit ab0fd1debe730ec9998678a0c53caefbd121ed10 tries to prevent merge
of requests with different failfast settings.  In elv_rq_merge_ok(),
it compares new bio's failfast flags against the merge target
request's.  However, the flag testing accessors for bio and blk don't
return boolean but the tested bit value directly and FAILFAST on bio
and blk don't match, so directly comparing them with == results in
false negative unnecessary preventing merge of readahead requests.

This patch convert the results to boolean by negating them before
comparison.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jeff Garzik <jeff@garzik.org>
14 years agotracing/function: Fix the return value of ftrace_trace_onoff_callback()
Xiao Guangrong [Wed, 15 Jul 2009 04:29:06 +0000 (12:29 +0800)] 
tracing/function: Fix the return value of ftrace_trace_onoff_callback()

ftrace_trace_onoff_callback() will return an error even if we do the
right operation, for example:

 # echo _spin_*:traceon:10 > set_ftrace_filter
 -bash: echo: write error: Invalid argument
 # cat set_ftrace_filter
 #### all functions enabled ####
 _spin_trylock_bh:traceon:count=10
 _spin_unlock_irq:traceon:count=10
 _spin_unlock_bh:traceon:count=10
 _spin_lock_irq:traceon:count=10
 _spin_unlock:traceon:count=10
 _spin_trylock:traceon:count=10
 _spin_unlock_irqrestore:traceon:count=10
 _spin_lock_irqsave:traceon:count=10
 _spin_lock_bh:traceon:count=10
 _spin_lock:traceon:count=10

We want to set _spin_*:traceon:10 to set_ftrace_filter, it complains
with "Invalid argument", but the operation is successful.

This is because ftrace_process_regex() returns the number of functions that
matched the pattern. If the number is not 0, this value is returned
by ftrace_regex_write() whereas we want to return the number of bytes
virtually written.
Also the file offset pointer is not updated in this case.

If the number of matched functions is lower than the number of bytes written
by the user, this results to a reprocessing of the string given by the user with
a lower size, leading to a malformed ftrace regex and then a -EINVAL returned.

So, this patch fixes it by returning 0 if no error occured.
The fix also applies on 2.6.30

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: stable@kernel.org
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
14 years agocdc-eem: bad crc checking
Vincent CUISSARD [Thu, 16 Jul 2009 06:08:58 +0000 (06:08 +0000)] 
cdc-eem: bad crc checking

When the driver received an EEM packet with CRC option enabled, driver must
compute and check the CRC of the Ethernet data. Previous version computes CRC
on Ethernet data plus the original CRC value. Skbuff is correctly trimed but
the old length is used when CRC is computed.

Signed-off-by: Vincent CUISSARD <vincent.cuissard@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Remove DPRINTK messages in DCB mode
Lucy Liu [Thu, 16 Jul 2009 13:43:31 +0000 (13:43 +0000)] 
ixgbe: Remove DPRINTK messages in DCB mode

Remove debug DPRINTK in DCB mode netlink interface.

Signed-off-by: Lucy Liu <lucy.liu@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: clear mac address data block in DCB mode
Lucy Liu [Thu, 16 Jul 2009 13:43:10 +0000 (13:43 +0000)] 
ixgbe: clear mac address data block in DCB mode

This change clears the address data block memory space, which is needed for
the 82598 which does not have a SAN MAC.

Signed-off-by: Lucy Liu <lucy.liu@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: revert shutdown changes
Stephen Hemminger [Thu, 16 Jul 2009 13:20:57 +0000 (13:20 +0000)] 
sky2: revert shutdown changes

The commit changes to shutdown path broke startup on some systems.

revert commit c0bad0f2e4366d5bbfe0c4a7a80bca8f4b05272b

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: sock_copy() fixes
Eric Dumazet [Wed, 15 Jul 2009 23:13:10 +0000 (23:13 +0000)] 
net: sock_copy() fixes

Commit e912b1142be8f1e2c71c71001dc992c6e5eb2ec1
(net: sk_prot_alloc() should not blindly overwrite memory)
took care of not zeroing whole new socket at allocation time.

sock_copy() is another spot where we should be very careful.
We should not set refcnt to a non null value, until
we are sure other fields are correctly setup, or
a lockless reader could catch this socket by mistake,
while not fully (re)initialized.

This patch puts sk_node & sk_refcnt to the very beginning
of struct sock to ease sock_copy() & sk_prot_alloc() job.

We add appropriate smp_wmb() before sk_refcnt initializations
to match our RCU requirements (changes to sock keys should
be committed to memory before sk_refcnt setting)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoE100: work around the driver using streaming DMA mapping for RX descriptors.
Krzysztof Halasa [Tue, 14 Jul 2009 11:01:54 +0000 (11:01 +0000)] 
E100: work around the driver using streaming DMA mapping for RX descriptors.

E100 places it's RX packet descriptors inside skb->data and uses them
with bidirectional streaming DMA mapping. Unfortunately it fails to
transfer skb->data ownership to the device after it reads the
descriptor's status, breaking on non-coherent (e.g., ARM) platforms.

This have to be converted to use coherent memory for the descriptors.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: clean muticast addresses when device changes type
Moni Shoua [Wed, 15 Jul 2009 04:56:31 +0000 (04:56 +0000)] 
bonding: clean muticast addresses when device changes type

Bonding device forbids slave device of different types under the same
master.

However, it is possible for a bonding master to change type during its
lifetime.  This can be either from ARPHRD_ETHER to ARPHRD_INFINIBAND
or the other way arround.  The change of type requires device level
multicast address cleanup because device level multicast addresses
depend on the device type.

The patch adds a call to dev_close() before the bonding master changes
type and dev_open() just after that.

In the example below I enslaved an IPoIB device (ib0) under
bond0. Since each bonding master starts as device of type ARPHRD_ETHER
by default, a change of type occurs when ib0 is enslaved.

This is how /proc/net/dev_mcast looks like without the patch

5    bond0           1     0     00ffffffff12601bffff000000000001ff96ca05
5    bond0           1     0     01005e000116
5    bond0           1     0     01005e7ffffd
5    bond0           1     0     01005e000001
5    bond0           1     0     333300000001
6    ib0             1     0     00ffffffff12601bffff000000000001ff96ca05
6    ib0             1     0     333300000001
6    ib0             1     0     01005e000001
6    ib0             1     0     01005e7ffffd
6    ib0             1     0     01005e000116
6    ib0             1     0     00ffffffff12401bffff00000000000000000001
6    ib0             1     0     00ffffffff12601bffff00000000000000000001

and this is how it looks like after the patch.

5    bond0           1     0     00ffffffff12601bffff000000000001ff96ca05
5    bond0           1     0     00ffffffff12601bffff00000000000000000001
5    bond0           1     0     00ffffffff12401bffff0000000000000ffffffd
5    bond0           1     0     00ffffffff12401bffff00000000000000000116
5    bond0           1     0     00ffffffff12401bffff00000000000000000001
6    ib0             1     0     00ffffffff12601bffff000000000001ff96ca05
6    ib0             1     0     00ffffffff12401bffff00000000000000000116
6    ib0             1     0     00ffffffff12401bffff0000000000000ffffffd
6    ib0             2     0     00ffffffff12401bffff00000000000000000001
6    ib0             2     0     00ffffffff12601bffff00000000000000000001

Signed-off-by: Moni Shoua <monis@voltaire.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoatl1c: misplaced parenthesis
roel kluin [Sun, 12 Jul 2009 12:57:38 +0000 (12:57 +0000)] 
atl1c: misplaced parenthesis

Fix misplaced parenthesis

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoatl1c: add missing parentheses
roel kluin [Sun, 12 Jul 2009 11:40:34 +0000 (11:40 +0000)] 
atl1c: add missing parentheses

Parentheses are required or the comparison occurs before the bitand.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
David S. Miller [Fri, 17 Jul 2009 00:34:50 +0000 (17:34 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-2.6

14 years agoBlackfin: define HARDIRQ_BITS again for now
Mike Frysinger [Thu, 16 Jul 2009 17:53:37 +0000 (13:53 -0400)] 
Blackfin: define HARDIRQ_BITS again for now

The default values of HARDIRQ_BITS and PREEMPT_BITS in common code leads to
build failure:

In file included from include/linux/interrupt.h:12,
                from include/linux/kernel_stat.h:8,
                from arch/blackfin/kernel/asm-offsets.c:32:
include/linux/hardirq.h:66:2: error: #error PREEMPT_ACTIVE is too low!

So until that gets resolved, just declare our own default value again.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 16 Jul 2009 17:18:29 +0000 (10:18 -0700)] 
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/peterz/linux-2.6-sched

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-sched:
  sched: Fix bug in SCHED_IDLE interaction with group scheduling
  sched: Fix rt_rq->pushable_tasks initialization in init_rt_rq()
  sched: Reset sched stats on fork()
  sched_rt: Fix overload bug on rt group scheduling
  sched: Documentation/sched-rt-group: Fix style issues & bump version

14 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 16 Jul 2009 17:07:37 +0000 (10:07 -0700)] 
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  timer stats: fix quick check optimization

14 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Thu, 16 Jul 2009 17:05:34 +0000 (10:05 -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: Fix another bug in move of altivec code to vector.S
  powerpc: Fix booke user_disable_single_step()

14 years agon_tty: Fix echo race
Alan Cox [Thu, 16 Jul 2009 15:07:03 +0000 (16:07 +0100)] 
n_tty: Fix echo race

If a tty in N_TTY mode with echo enabled manages to get itself into a state
where
- echo characters are pending
- FASYNC is enabled
- tty_write_wakeup is called from either
- a device write path (pty)
- an IRQ (serial)

then it either deadlocks or explodes taking a mutex in the IRQ path.

On the serial side it is almost impossible to reproduce because you have to
go from a full serial port to a near empty one with echo characters
pending. The pty case happens to have become possible to trigger using
emacs and ptys, the pty changes having created a scenario which shows up
this bug.

The code path is

n_tty:process_echoes() (takes mutex)
tty_io:tty_put_char()
pty:pty_write  (or serial paths)
tty_wakeup     (from pty_write or serial IRQ)
n_tty_write_wakeup()
process_echoes()
*KABOOM*

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agotty: nozomi, fix tty refcounting bug
Jiri Slaby [Thu, 16 Jul 2009 15:06:18 +0000 (16:06 +0100)] 
tty: nozomi, fix tty refcounting bug

Don't forget to drop a tty refererence on fail paths in
receive_data().

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agovt: drop bootmem/slab memory distinction
Johannes Weiner [Thu, 16 Jul 2009 15:06:09 +0000 (16:06 +0100)] 
vt: drop bootmem/slab memory distinction

Bootmem is not used for the vt screen buffer anymore as slab is now
available at the time the console is initialized.

Get rid of the now superfluous distinction between slab and bootmem,
it's always slab.

This also fixes a kmalloc leak which Catalin described thusly:

Commit a5f4f52e ("vt: use kzalloc() instead of the bootmem allocator")
replaced the alloc_bootmem() with kzalloc() but didn't set vc_kmalloced to
1 and the memory block is later leaked.  The corresponding kmemleak trace:

unreferenced object 0xdf828000 (size 8192):
  comm "swapper", pid 0, jiffies 4294937296
  backtrace:
    [<c006d473>] __save_stack_trace+0x17/0x1c
    [<c000d869>] log_early+0x55/0x84
    [<c01cfa4b>] kmemleak_alloc+0x33/0x3c
    [<c006c013>] __kmalloc+0xd7/0xe4
    [<c00108c7>] con_init+0xbf/0x1b8
    [<c0010149>] console_init+0x11/0x20
    [<c0008797>] start_kernel+0x137/0x1e4

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agodrivers/serial/bfin_sport_uart.c: remove wrong and unneeded memset
Andrew Morton [Thu, 16 Jul 2009 15:05:53 +0000 (16:05 +0100)] 
drivers/serial/bfin_sport_uart.c: remove wrong and unneeded memset

dcb314@hotmail.com notes that this memset has its args reversed.

It's unneeded anyway, so remove it.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13587

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoserial: don't add msm_serial's probe function to the driver struct
Uwe Kleine-König [Thu, 16 Jul 2009 15:05:43 +0000 (16:05 +0100)] 
serial: don't add msm_serial's probe function to the driver struct

msm_serial_driver is registered using platform_driver_probe which takes
care for the probe function itself.  So don't pass it in the driver
struct, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agotty: fix close/hangup race
Alan Cox [Thu, 16 Jul 2009 15:05:08 +0000 (16:05 +0100)] 
tty: fix close/hangup race

We can get a situation where a hangup occurs during or after a close. In
that case the ldisc gets disposed of by the close and the hangup then
explodes.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoAdd '-fno-delete-null-pointer-checks' to gcc CFLAGS
Eugene Teo [Wed, 15 Jul 2009 06:59:10 +0000 (14:59 +0800)] 
Add '-fno-delete-null-pointer-checks' to gcc CFLAGS

Turning on this flag could prevent the compiler from optimising away
some "useless" checks for null pointers.  Such bugs can sometimes become
exploitable at compile time because of the -O2 optimisation.

See http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Optimize-Options.html

An example that clearly shows this 'problem' is commit 6bf67672.

 static void __devexit agnx_pci_remove(struct pci_dev *pdev)
 {
     struct ieee80211_hw *dev = pci_get_drvdata(pdev);
-    struct agnx_priv *priv = dev->priv;
+    struct agnx_priv *priv;
     AGNX_TRACE;

     if (!dev)
         return;
+    priv = dev->priv;

By reverting this patch, and compile it with and without
-fno-delete-null-pointer-checks flag, we can see that the check for dev
is compiled away.

    call    printk  #
-   testq   %r12, %r12  # dev
-   je  .L94    #,
    movq    %r12, %rdi  # dev,

Clearly the 'fix' is to stop using dev before it is tested, but building
with -fno-delete-null-pointer-checks flag at least makes it harder to
abuse.

Signed-off-by: Eugene Teo <eugeneteo@kernel.sg>
Acked-by: Eric Paris <eparis@redhat.com>
Acked-by: Wang Cong <amwang@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoRevert "ppp: Fix throttling bugs"
Linus Torvalds [Thu, 16 Jul 2009 16:14:23 +0000 (09:14 -0700)] 
Revert "ppp: Fix throttling bugs"

This reverts commit a6540f731d506d9e82444cf0020e716613d4c46c, as
requested by Alan:

  "... as it was wrong, the pty code is now fixed and the fact this
   isn't reverted is breaking pptp setups."

Requested-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'fix/usb-audio' into for-linus
Takashi Iwai [Thu, 16 Jul 2009 14:35:50 +0000 (16:35 +0200)] 
Merge branch 'fix/usb-audio' into for-linus

* fix/usb-audio:
  sound: usb-audio: add workaround for Blue Microphones devices

14 years agoMerge branch 'fix/misc' into for-linus
Takashi Iwai [Thu, 16 Jul 2009 14:35:48 +0000 (16:35 +0200)] 
Merge branch 'fix/misc' into for-linus

* fix/misc:
  ALSA: riptide -  proper handling of pci_register_driver for joystick

14 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Thu, 16 Jul 2009 14:35:47 +0000 (16:35 +0200)] 
Merge branch 'fix/hda' into for-linus

* fix/hda:
  ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking

14 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Thu, 16 Jul 2009 14:35:46 +0000 (16:35 +0200)] 
Merge branch 'fix/asoc' into for-linus

* fix/asoc:
  ASoC: Fix NULL pointer dereference in __pxa2xx_pcm_hw_free

14 years agonetfilter: nf_conntrack: nf_conntrack_alloc() fixes
Eric Dumazet [Thu, 16 Jul 2009 12:03:40 +0000 (14:03 +0200)] 
netfilter: nf_conntrack: nf_conntrack_alloc() fixes

When a slab cache uses SLAB_DESTROY_BY_RCU, we must be careful when allocating
objects, since slab allocator could give a freed object still used by lockless
readers.

In particular, nf_conntrack RCU lookups rely on ct->tuplehash[xxx].hnnode.next
being always valid (ie containing a valid 'nulls' value, or a valid pointer to next
object in hash chain.)

kmem_cache_zalloc() setups object with NULL values, but a NULL value is not valid
for ct->tuplehash[xxx].hnnode.next.

Fix is to call kmem_cache_alloc() and do the zeroing ourself.

As spotted by Patrick, we also need to make sure lookup keys are committed to
memory before setting refcount to 1, or a lockless reader could get a reference
on the old version of the object. Its key re-check could then pass the barrier.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: xt_osf: fix nf_log_packet() arguments
Patrick McHardy [Thu, 16 Jul 2009 12:01:54 +0000 (14:01 +0200)] 
netfilter: xt_osf: fix nf_log_packet() arguments

The first argument is the address family, the second one the hook
number.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoarch/blackfin: Add kmalloc NULL tests
Julia Lawall [Tue, 14 Jul 2009 03:15:19 +0000 (03:15 +0000)] 
arch/blackfin: Add kmalloc NULL tests

Check that the result of kmalloc is not NULL before passing it to other
functions.

In the first two cases, the new code returns -ENOMEM, which seems
compatible with what is done for similar functions for other architectures.

In the last two cases, the new code fails silently, ie just returns,
because the function has void return type.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@

x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
    when != x != NULL
    when != (x || ...)
(
kfree(x)
|
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: add CPLB entries for Core B on-chip L1 SRAM regions
Graf Yang [Fri, 10 Jul 2009 11:34:51 +0000 (11:34 +0000)] 
Blackfin: add CPLB entries for Core B on-chip L1 SRAM regions

The Blackfin SMP port was missing CPLB entries for Core B on-chip L1 SRAM
regions.  Any code that attempted to use these would wrongly crash due to
a CPLB miss.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: work around anomaly 05000189
Robin Getz [Thu, 9 Jul 2009 15:11:52 +0000 (15:11 +0000)] 
Blackfin: work around anomaly 05000189

Similar to anomaly 05000281 but not as bad, we cannot return to the
instruction causing a fault otherwise we'll trigger a second false
exception.  The system can still recover, but it isn't correct.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: drop per-cpu loops_per_jiffy tracking
Michael Hennerich [Thu, 9 Jul 2009 09:58:52 +0000 (09:58 +0000)] 
Blackfin: drop per-cpu loops_per_jiffy tracking

On Blackfin SMP, a per-cpu loops_per_jiffy is pointless since both cores
always run at the same CCLK.  In addition, the current implementation has
flaws since the main consumer for loops_per_jiffy (asm/delay.h) uses the
global kernel loops_per_jiffy and not the per_cpu one.  So punt all of the
per-cpu handling and go back to the global shared one.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix bugs in GPIO resume code
Michael Hennerich [Wed, 8 Jul 2009 12:04:43 +0000 (12:04 +0000)] 
Blackfin: fix bugs in GPIO resume code

Change the bfin_gpio_pm_hibernate_restore() function to:
1) AND restored DATA with DIR (not OR) to get correct final state
2) Restore DATA before setting DIR to avoid glitches

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: bf537-stamp: fix irq decl for AD7142
Barry Song [Tue, 7 Jul 2009 07:41:50 +0000 (07:41 +0000)] 
Blackfin: bf537-stamp: fix irq decl for AD7142

The AD7142 add-on card hooks the IRQ line up to PG5, not PF5.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix handling of IPEND in interrupt context save
Robin Getz [Tue, 7 Jul 2009 02:47:14 +0000 (02:47 +0000)] 
Blackfin: fix handling of IPEND in interrupt context save

The interrupt context save logic incorrectly stored the address of the
IPEND register rather than its value due to a missing dereference.  While
we're here, also enable this code for all kernel debugging scenarios and
not just when KGDB is enabled.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: drop duplicate runtime checking of anomaly 05000448
Robin Getz [Mon, 6 Jul 2009 14:29:08 +0000 (14:29 +0000)] 
Blackfin: drop duplicate runtime checking of anomaly 05000448

We already catch this anomaly at compile time, and the runtime version is
such that it ends up checking on all parts rather than just the ones that
might actually have it.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix incomplete renaming of the bfin-twi-lcd driver
Michael Hennerich [Thu, 2 Jul 2009 11:00:38 +0000 (11:00 +0000)] 
Blackfin: fix incomplete renaming of the bfin-twi-lcd driver

The sed used to rename the bfin-twi-lcd only replaced the first instance
rather than all which led to the resources not being enabled when the
driver was built as a module.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix wrong CTS inversion
Sonic Zhang [Wed, 1 Jul 2009 07:43:23 +0000 (07:43 +0000)] 
Blackfin: fix wrong CTS inversion

The Blackfin serial headers were inverting the CTS value leading to wrong
handling of the CTS line which broke CTS/RTS handling completely.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: update handling of anomaly 364 (wrong rev id in BF527-0.1)
Graf Yang [Wed, 1 Jul 2009 04:08:01 +0000 (04:08 +0000)] 
Blackfin: update handling of anomaly 364 (wrong rev id in BF527-0.1)

This anomaly only applies to the BF527-0.1, not the BF526-0.1, and not any
other revision of the BF527.  So make sure we don't go returning 0xffff
for other cases.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix early_dma_memcpy() handling of busy channels
Mike Frysinger [Mon, 29 Jun 2009 22:45:50 +0000 (22:45 +0000)] 
Blackfin: fix early_dma_memcpy() handling of busy channels

The early logic to locate a free DMA channel and then set it up was broken
in a few ways that only manifested itself when we needed to set up more
than 2 on chip SRAM regions (most board defaults setup 1 or 2).  First, we
checked the wrong status register (the destination gets updated, not the
source) and second, we did the ssync before rather than after resetting a
DMA config register.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: handle BF561 Core B memory regions better when SMP=n
Mike Frysinger [Mon, 29 Jun 2009 18:20:10 +0000 (14:20 -0400)] 
Blackfin: handle BF561 Core B memory regions better when SMP=n

Rather than assume Core B is always run with caches turned on, let people
load into any of the on-chip memory regions.  It is their business how the
SRAM/Cache regions are utilized, so don't prevent them from being able to
load into them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix miscompilation in lshrdi3
Jie Zhang [Sun, 28 Jun 2009 13:19:36 +0000 (13:19 +0000)] 
Blackfin: fix miscompilation in lshrdi3

The code used in the Blackfin lshrdi3 utilizes gcc constructs.  However,
the structures declared don't line up with the code gcc generates, so
under certain optimizations, we get bad code and things crap out in fun
random ways.  So rather than trying to maintain different gcc definitions
ourselves, just use the ones available in gcclib.h.

URL: http://blackfin.uclinux.org/gf/tracker/5286
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix silent crash when no uClinux MTD filesystem exists
Robin Getz [Fri, 26 Jun 2009 12:23:51 +0000 (12:23 +0000)] 
Blackfin: fix silent crash when no uClinux MTD filesystem exists

Since we need to relocate the attached filesystem with the uClinux MTD map
(to handle some anomalies), we need to know its real filesize.  If we boot
a kernel without a filesystem actually attached, we end up blindly reading
and copying garbage (since there is no magic value to detect validity).
Often times this results in an early crash and no output.  So add a few
basic sanity checks before operating on things to catch the majority of
cases.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: restore exception banner when dumping crash info
Mike Frysinger [Tue, 23 Jun 2009 11:21:34 +0000 (11:21 +0000)] 
Blackfin: restore exception banner when dumping crash info

Previous unification code put the exception banner behind the "is oops"
logic when it should have been printed all the time.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: work around anomaly 05000281
Robin Getz [Mon, 22 Jun 2009 20:23:48 +0000 (20:23 +0000)] 
Blackfin: work around anomaly 05000281

Add missing anomaly workaround for anomaly 05000281 - we can't return to
instructions which cause hardware errors otherwise we trigger the error
again which means we go into an infinite loop of handling, returning, and
retriggering.  This work around confuses gdb when the error occurs as the
PC will seemed to have moved, so a better long term fix will need to be
figured out, but for now this is better than an infinite crash loop.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: update anomaly lists to match latest sheets/usage
Graf Yang [Wed, 1 Jul 2009 07:05:40 +0000 (07:05 +0000)] 
Blackfin: update anomaly lists to match latest sheets/usage

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: drop dead flash_probe call
Mike Frysinger [Sat, 20 Jun 2009 19:36:09 +0000 (15:36 -0400)] 
Blackfin: drop dead flash_probe call

There are no CONFIG_{BLK,CHR}_DEV_FLASH Kconfig options, and there is no
flash_probe() function, so not really sure what this code is all about.
Seems to be dead code that stretches way back to the start of the Blackfin
port.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: cleanup code a bit with comments and defines
Robin Getz [Wed, 17 Jun 2009 15:18:18 +0000 (15:18 +0000)] 
Blackfin: cleanup code a bit with comments and defines

Improve the assembly with a few explanatory comments and use symbolic
defines rather than numeric values for bit positions.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoMerge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Steve French [Thu, 16 Jul 2009 04:21:39 +0000 (04:21 +0000)] 
Merge branch 'master' of /linux/kernel/git/torvalds/linux-2.6

14 years agonet/can: add module alias to can protocol drivers
Lothar Waßmann [Tue, 14 Jul 2009 23:12:25 +0000 (23:12 +0000)] 
net/can: add module alias to can protocol drivers

Add appropriate MODULE_ALIAS() to facilitate autoloading of can protocol drivers

Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/can bugfix: use after free bug in can protocol drivers
Lothar Waßmann [Tue, 14 Jul 2009 23:10:21 +0000 (23:10 +0000)] 
net/can bugfix: use after free bug in can protocol drivers

Fix a use after free bug in can protocol drivers

The release functions of the can protocol drivers lack a call to
sock_orphan() which leads to referencing freed memory under certain
circumstances.

This patch fixes a bug reported here:
https://lists.berlios.de/pipermail/socketcan-users/2009-July/000985.html

Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Wed, 15 Jul 2009 17:29:09 +0000 (10:29 -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:
  ahci: add device ID for 82801JI sata controller
  drivers/ata: Move a dereference below a NULL test
  libata: implement and use HORKAGE_NOSETXFER, take#2
  libata: fix follow-up SRST failure path

14 years agoALSA: riptide - proper handling of pci_register_driver for joystick
Jaswinder Singh Rajput [Wed, 15 Jul 2009 11:15:40 +0000 (16:45 +0530)] 
ALSA: riptide -  proper handling of pci_register_driver for joystick

We need to check returning error for pci_register_driver(&joystick_driver)

On failure, we should unregister formerly registered audio drivers

This also fixed the compiler warning :

  CC [M]  sound/pci/riptide/riptide.o
 sound/pci/riptide/riptide.c: In function ‘alsa_card_riptide_init’:
 sound/pci/riptide/riptide.c:2200: warning: ignoring return value of ‘__pci_register_driver’, declared with attribute warn_unused_result

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agosound: usb-audio: add workaround for Blue Microphones devices
Clemens Ladisch [Mon, 13 Jul 2009 11:21:58 +0000 (13:21 +0200)] 
sound: usb-audio: add workaround for Blue Microphones devices

Blue Microphones USB devices have an alternate setting that sends two
channels of data to the computer.  Unfortunately, the descriptors of
that altsetting have a wrong channel setting, which means that any
recorded data from such a device has twice the sample rate from what
would be expected.

This patch adds a workaround to ignore that altsetting.  Since these
devices have only one actual channel, no data is lost.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoUBI: fix bug in image sequence number handling
Holger Brunck [Mon, 13 Jul 2009 14:47:57 +0000 (16:47 +0200)] 
UBI: fix bug in image sequence number handling

This patch fixes a bug in the image seq. number handling in the
scanning level. The assignment of the image_seq was incorrect.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
14 years agoUBI: gluebi: initialize ubi_num field
Artem Bityutskiy [Fri, 10 Jul 2009 13:59:36 +0000 (16:59 +0300)] 
UBI: gluebi: initialize ubi_num field

Do not forget to initialize 'gluebi->ubi_num' because otherwise
it will stay 0 even for ubi1 device, and gluebi will open
wrong UBI device when 'gluebi_get_device()' is called.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
14 years agopowerpc: Fix another bug in move of altivec code to vector.S
Andreas Schwab [Fri, 10 Jul 2009 11:17:36 +0000 (11:17 +0000)] 
powerpc: Fix another bug in move of altivec code to vector.S

When moving load_up_altivec to vector.S a typo in a comment caused a
thinko setting the wrong variable.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Fix booke user_disable_single_step()
Dave Kleikamp [Wed, 8 Jul 2009 13:46:18 +0000 (13:46 +0000)] 
powerpc: Fix booke user_disable_single_step()

On booke processors, gdb is seeing spurious SIGTRAPs when setting a
watchpoint.

user_disable_single_step() simply quits when the DAC is non-zero.  It should
be clearing the DBCR0_IC and DBCR0_BT bits from the dbcr0 register and
TIF_SINGLESTEP from the thread flag.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agodrm: Move a dereference below a NULL test
Julia Lawall [Sat, 11 Jul 2009 07:50:09 +0000 (09:50 +0200)] 
drm: Move a dereference below a NULL test

If the NULL test is necessary, then the dereference should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dave Airlie <airlied@linux.ie>
14 years agofb/intelfb: conflict with DRM_I915 and hide by default
Jesse Barnes [Fri, 3 Jul 2009 18:24:46 +0000 (11:24 -0700)] 
fb/intelfb: conflict with DRM_I915 and hide by default

Users get confused by this driver.  It's really a special purpose
embedded driver, and causes a lot of problems if enabled.  So hide it
under EMBEDDED by default, and make sure it doesn't get enabled with
the i915 DRM driver.

Dave, I'm hoping you can feed this to Linus through your tree.  It's
appropriate for 2.6.31 I think.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
14 years agodrm/ttm: fix misplaced parentheses
Roel Kluin [Wed, 15 Jul 2009 06:00:37 +0000 (16:00 +1000)] 
drm/ttm: fix misplaced parentheses

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
14 years agodrm/via: Fix vblank IRQ on VIA hardware.
Simon Farnsworth [Fri, 10 Jul 2009 10:25:16 +0000 (11:25 +0100)] 
drm/via: Fix vblank IRQ on VIA hardware.

via_enable_vblank wasn't setting the VBlank enable bit - instead, it
was masking out the rest of the register.

At the same time, fix via_disable_vblank to clear the VBlank enable
bit.

Signed-off-by: Dave Airlie <airlied@linux.ie>
14 years agodrm: drm_gem, check kzalloc retval
Jiri Slaby [Mon, 13 Jul 2009 21:20:21 +0000 (23:20 +0200)] 
drm: drm_gem, check kzalloc retval

Check kzalloc retval against NULL in drm_gem_object_alloc and bail out
appropriately.

While at it merge the fail paths and jump to them by gotos at the end
of the function.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
14 years agodrm: drm_debugfs, check kmalloc retval
Jiri Slaby [Mon, 13 Jul 2009 21:20:20 +0000 (23:20 +0200)] 
drm: drm_debugfs, check kmalloc retval

Check kmalloc return value in drm_debugfs_create_files and bail out
appropriately if the pointer is NULL.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
14 years agodrm/radeon: add some missing pci ids
Alex Deucher [Wed, 1 Jul 2009 17:03:52 +0000 (13:03 -0400)] 
drm/radeon: add some missing pci ids

Also, fix ordering for a couple others

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
14 years agoahci: add device ID for 82801JI sata controller
Mark Goodwin [Fri, 26 Jun 2009 15:44:11 +0000 (10:44 -0500)] 
ahci: add device ID for 82801JI sata controller

Add device ID for Intel 82801JI SATA AHCI controller.

Signed-off-by: David Milburn <dmilburn@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agodrivers/ata: Move a dereference below a NULL test
Julia Lawall [Sat, 11 Jul 2009 07:49:48 +0000 (09:49 +0200)] 
drivers/ata: Move a dereference below a NULL test

If the NULL test is necessary, then the dereference should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agolibata: implement and use HORKAGE_NOSETXFER, take#2
Tejun Heo [Thu, 9 Jul 2009 00:27:50 +0000 (09:27 +0900)] 
libata: implement and use HORKAGE_NOSETXFER, take#2

PIONEER DVD-RW DVRTD08 times out SETXFER if no media is present.  The
device is SATA and simply skipping SETXFER works around the problem.
Implement ATA_HORKAGE_NOSETXFER and apply it to the device.

Reported by Moritz Rigler in the following thread.

  http://thread.gmane.org/gmane.linux.ide/36790

and by Lars in bko#9540.

Updated to whine and ignore NOSETXFER if PATA component is detected as
suggested by Alan Cox.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Moritz Rigler <linux-ide@momail.e4ward.com>
Reported-by: Lars <lars21ce@gmx.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agolibata: fix follow-up SRST failure path
Tejun Heo [Wed, 8 Jul 2009 03:16:37 +0000 (12:16 +0900)] 
libata: fix follow-up SRST failure path

ata_eh_reset() was missing error return handling after follow-up SRST
allowing EH to continue the normal probing path after reset failure.
This was discovered while testing new WD 2TB drives which take longer
than 10 secs to spin up and cause the first follow-up SRST to time
out.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agoz2ram: Small cleanup for z2ram.c
Zhaolei [Tue, 14 Jul 2009 09:59:05 +0000 (17:59 +0800)] 
z2ram: Small cleanup for z2ram.c

We should use Z2MINOR_COUNT as range argument in blk_unregister_region()

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
14 years agoMerge branch 'i2c-for-2631-rc3' of git://aeryn.fluff.org.uk/bjdooks/linux
Linus Torvalds [Wed, 15 Jul 2009 01:40:15 +0000 (18:40 -0700)] 
Merge branch 'i2c-for-2631-rc3' of git://aeryn.fluff.org.uk/bjdooks/linux

* 'i2c-for-2631-rc3' of git://aeryn.fluff.org.uk/bjdooks/linux:
  i2c: Use resource_size
  i2c-davinci: behave with i2cdetect
  i2c-davinci: convert clock usage after clkdev conversion

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
Linus Torvalds [Wed, 15 Jul 2009 01:37:24 +0000 (18:37 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/teigland/dlm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
  dlm: free socket in error exit path
  dlm: fix plock use-after-free
  dlm: Fix uninitialised variable warning in lock.c

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Wed, 15 Jul 2009 01:37:09 +0000 (18:37 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  mlx4_core: Add new ConnectX EN PCI ID 0x6764
  mlx4_core: Handle multi-physical function devices