pandora-kernel.git
14 years agotcp: Use correct peer adr when copying MD5 keys
John Dykstra [Fri, 17 Jul 2009 09:23:22 +0000 (09:23 +0000)]
tcp: Use correct peer adr when copying MD5 keys

When the TCP connection handshake completes on the passive
side, a variety of state must be set up in the "child" sock,
including the key if MD5 authentication is being used.  Fix TCP
for both address families to label the key with the peer's
destination address, rather than the address from the listening
sock, which is usually the wildcard.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: Fix MD5 signature checking on IPv4 mapped sockets
John Dykstra [Thu, 16 Jul 2009 05:04:51 +0000 (05:04 +0000)]
tcp: Fix MD5 signature checking on IPv4 mapped sockets

Fix MD5 signature checking so that an IPv4 active open
to an IPv6 socket can succeed.  In particular, use the
correct address family's signature generation function
for the SYN/ACK.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoAdd mac driver for w90p910
Wan ZongShun [Thu, 16 Jul 2009 02:55:05 +0000 (02:55 +0000)]
Add mac driver for w90p910

Add mac driver support for evaluation board based on w90p910.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoALSA: ca0106 - Fix the max capture buffer size
Takashi Iwai [Mon, 20 Jul 2009 13:42:51 +0000 (15:42 +0200)]
ALSA: ca0106 - Fix the max capture buffer size

The capture buffer size with 64kB seems broken with CA0106.
At least, either the update timing or the DMA position is wrong,
and this screws up pulseaudio badly.

This patch restricts the max buffer size less than that to make life
a bit easier.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
14 years agoALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
Takashi Iwai [Mon, 20 Jul 2009 06:01:36 +0000 (08:01 +0200)]
ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs

The recent rewrite of the codec parser for STAC9872 caused a regression
for some Sony VAIO models that don't give proper pin default configs
by BIOS.  Even using model=vaio doesn't work because the pin definitions
are set after the pin overrides.

This patch fixes the pin definitions in patch_stac9872() to be put
in the right place before the pin overrides.  Also the patch adds the
new quirk entry for VAIO F/S to have the correct pin default configs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
14 years agoALSA: hda - Add quirk for Gateway T6834c laptop
Hao Song [Mon, 20 Jul 2009 07:01:16 +0000 (15:01 +0800)]
ALSA: hda - Add quirk for Gateway T6834c laptop

Gateway T6834c laptops need EAPD always on while the default behavior
for the STAC9205 reference board is to turn it off upon every HP plug.
By using the special "eapd" model, which is first introduced for Gateway
T1616 laptops for this same reason, this peculiarity can be properly
handled.

Signed-off-by: Hao Song <baritono.tux@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoHID: Move dereferences below a NULL test
Julia Lawall [Sun, 19 Jul 2009 15:26:13 +0000 (17:26 +0200)]
HID: Move dereferences below a NULL test

If the NULL test is necessary, then the dereferences 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,E1;
identifier i,fld;
statement S;
@@

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

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
14 years agoALSA: OSS sequencer should be initialized after snd_seq_system_client_init
Jaswinder Singh Rajput [Sun, 19 Jul 2009 16:28:34 +0000 (21:58 +0530)]
ALSA: OSS sequencer should be initialized after snd_seq_system_client_init

When build SND_SEQUENCER in kernel then OSS sequencer(alsa_seq_oss_init)
is initialized before System (snd_seq_system_client_init) which leads to
memory leak :

unreferenced object 0xf6b0e680 (size 256):
  comm "swapper", pid 1, jiffies 4294670753
  backtrace:
    [<c108ac5c>] create_object+0x135/0x204
    [<c108adfe>] kmemleak_alloc+0x26/0x4c
    [<c1087de2>] kmem_cache_alloc+0x72/0xff
    [<c126d2ac>] seq_create_client1+0x22/0x160
    [<c126e3b6>] snd_seq_create_kernel_client+0x72/0xef
    [<c1485a05>] snd_seq_oss_create_client+0x86/0x142
    [<c1485920>] alsa_seq_oss_init+0xf6/0x155
    [<c1001059>] do_one_initcall+0x4f/0x111
    [<c14655be>] kernel_init+0x115/0x166
    [<c10032af>] kernel_thread_helper+0x7/0x10
    [<ffffffff>] 0xffffffff
unreferenced object 0xf688a580 (size 64):
  comm "swapper", pid 1, jiffies 4294670753
  backtrace:
    [<c108ac5c>] create_object+0x135/0x204
    [<c108adfe>] kmemleak_alloc+0x26/0x4c
    [<c1087de2>] kmem_cache_alloc+0x72/0xff
    [<c126f964>] snd_seq_pool_new+0x1c/0xb8
    [<c126d311>] seq_create_client1+0x87/0x160
    [<c126e3b6>] snd_seq_create_kernel_client+0x72/0xef
    [<c1485a05>] snd_seq_oss_create_client+0x86/0x142
    [<c1485920>] alsa_seq_oss_init+0xf6/0x155
    [<c1001059>] do_one_initcall+0x4f/0x111
    [<c14655be>] kernel_init+0x115/0x166
    [<c10032af>] kernel_thread_helper+0x7/0x10
    [<ffffffff>] 0xffffffff
unreferenced object 0xf6b0e480 (size 256):
  comm "swapper", pid 1, jiffies 4294670754
  backtrace:
    [<c108ac5c>] create_object+0x135/0x204
    [<c108adfe>] kmemleak_alloc+0x26/0x4c
    [<c1087de2>] kmem_cache_alloc+0x72/0xff
    [<c12725a0>] snd_seq_create_port+0x51/0x21c
    [<c126de50>] snd_seq_ioctl_create_port+0x57/0x13c
    [<c126d07a>] snd_seq_do_ioctl+0x4a/0x69
    [<c126d0de>] snd_seq_kernel_client_ctl+0x33/0x49
    [<c1485a74>] snd_seq_oss_create_client+0xf5/0x142
    [<c1485920>] alsa_seq_oss_init+0xf6/0x155
    [<c1001059>] do_one_initcall+0x4f/0x111
    [<c14655be>] kernel_init+0x115/0x166
    [<c10032af>] kernel_thread_helper+0x7/0x10
    [<ffffffff>] 0xffffffff

The correct order should be :

System (snd_seq_system_client_init) should be initialized before
OSS sequencer(alsa_seq_oss_init) which is equivalent to :

1. insmod sound/core/seq/snd-seq-device.ko
2. insmod sound/core/seq/snd-seq.ko
3. insmod sound/core/seq/snd-seq-midi-event.ko
4. insmod sound/core/seq/oss/snd-seq-oss.ko

Including sound/core/seq/oss/Makefile after other seq modules
fixes the ordering and memory leak.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoclocksource: Prevent NULL pointer dereference
Thomas Gleixner [Sun, 19 Jul 2009 15:09:12 +0000 (17:09 +0200)]
clocksource: Prevent NULL pointer dereference

Writing a zero length string to sys/.../current_clocksource will cause
a NULL pointer dereference if the clock events system is in one shot
(highres or nohz) mode.

Pointed-out-by: Dan Carpenter <error27@gmail.com>
LKML-Reference: <alpine.DEB.2.00.0907191545580.12306@bicker>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 years agoALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
Julia Lawall [Sat, 18 Jul 2009 15:26:14 +0000 (17:26 +0200)]
ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock

If spin_lock_irqsave is called twice in a row with the same second
argument, the interrupt state at the point of the second call overwrites
the value saved by the first call.  Indeed, the second call does not need
to save the interrupt state, so it is changed to a simple spin_lock.

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

// <smpl>
@@
expression lock1,lock2;
expression flags;
@@

*spin_lock_irqsave(lock1,flags)
... when != flags
*spin_lock_irqsave(lock2,flags)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda_codec: Check for invalid zero connections
Jaroslav Kysela [Sat, 18 Jul 2009 09:48:19 +0000 (11:48 +0200)]
ALSA: hda_codec: Check for invalid zero connections

To prevent "Too many connections" message and the error path for some HDMI
codecs (which makes onboard audio unusable), check for invalid zero
connections for CONNECT_LIST verb.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agovirtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch
Rakib Mullick [Fri, 17 Jul 2009 14:13:22 +0000 (20:13 +0600)]
virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch

The variable virtio_blk references the function virtblk_probe() (which
is in .devinit section) and also references the function
virtblk_remove() ( which is in .devexit section). So, virtio_blk
simultaneously refers .devinit and .devexit section. To avoid this
messup, we mark virtio_blk as __refdata.

We were warned by the following warning:

  LD      drivers/block/built-in.o
  WARNING: drivers/block/built-in.o(.data+0xc8dc): Section mismatch in
  reference from the variable virtio_blk to the function
  .devinit.text:virtblk_probe()
  The variable virtio_blk references
  the function __devinit virtblk_probe()
  If the reference is valid then annotate the
  variable with __init* or __refdata (see linux/init.h) or name the variable:
  *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

  WARNING: drivers/block/built-in.o(.data+0xc8e0): Section mismatch in
  reference from the variable virtio_blk to the function
  .devexit.text:virtblk_remove()
  The variable virtio_blk references
  the function __devexit virtblk_remove()
  If the reference is valid then annotate the
  variable with __exit* (see linux/init.h) or name the variable:
  *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
14 years agotimer: Avoid reading uninitialized data
Pavel Roskin [Sat, 18 Jul 2009 20:46:02 +0000 (16:46 -0400)]
timer: Avoid reading uninitialized data

timer->expires may be uninitialized, so check timer_pending() before
touching timer->expires to pacify kmemcheck.

Signed-off-by: Pavel Roskin <proski@gnu.org>
LKML-Reference: <20090718204602.5191.360.stgit@mj.roinet.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Sat, 18 Jul 2009 18:59:33 +0000 (11:59 -0700)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: Realview & Versatile: Fix i2c_board_info definitions
  [ARM] 5608/1: Updated U300 defconfig
  [ARM] 5606/1: Fix ep93xx watchdog driver headers
  [ARM] 5594/1: Correct U300 VIC init PM setting
  [ARM] 5595/1: ep93xx: missing header in dma-m2p.c
  [ARM] Kirkwood: Correct header define
  [ARM] pxa: fix ULPI_{DIR,NXT,STP} MFP defines
  backlight: fix pwm_bl.c to notify platform code when suspending
  [ARM] pxa: use kzalloc() in pxa_init_gpio_chip()
  [ARM] pxa: correct I2CPWR clock for pxa3xx
  pxamci: correct DMA flow control
  ARM: add support for the EET board, based on the i.MX31 pcm037 module
  pcm037: add MT9T031 camera support
  Armadillo 500 add NAND flash device support (resend).
  ARM MXC: Armadillo 500 add NOR flash device support (resend).
  mx31: remove duplicated #include

14 years agoARM: Realview & Versatile: Fix i2c_board_info definitions
Russell King [Sat, 18 Jul 2009 14:51:55 +0000 (15:51 +0100)]
ARM: Realview & Versatile: Fix i2c_board_info definitions

Fix i2c_board_info definitions - we were defining the 'type' field
of these structures twice since the first argument of I2C_BOARD_INFO
sets this field.  Move the second definition into I2C_BOARD_INFO().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Ben Dooks <ben-linux@fluff.org>
14 years agosched: fix nr_uninterruptible accounting of frozen tasks really
Thomas Gleixner [Fri, 17 Jul 2009 12:15:47 +0000 (14:15 +0200)]
sched: fix nr_uninterruptible accounting of frozen tasks really

commit e3c8ca8336 (sched: do not count frozen tasks toward load) broke
the nr_uninterruptible accounting on freeze/thaw. On freeze the task
is excluded from accounting with a check for (task->flags &
PF_FROZEN), but that flag is cleared before the task is thawed. So
while we prevent that the task with state TASK_UNINTERRUPTIBLE
is accounted to nr_uninterruptible on freeze we decrement
nr_uninterruptible on thaw.

Use a separate flag which is handled by the freezing task itself. Set
it before calling the scheduler with TASK_UNINTERRUPTIBLE state and
clear it after we return from frozen state.

Cc: <stable@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 years agosched: fix load average accounting vs. cpu hotplug
Thomas Gleixner [Fri, 17 Jul 2009 12:15:46 +0000 (14:15 +0200)]
sched: fix load average accounting vs. cpu hotplug

The new load average code clears rq->calc_load_active on
CPU_ONLINE. That's wrong as the new onlined CPU might have got a
scheduler tick already and accounted the delta to the stale value of
the time we offlined the CPU.

Clear the value when we cleanup the dead CPU instead.

Also move the update of the calc_load_update time for the newly online
CPU to CPU_UP_PREPARE to avoid that the CPU plays catch up with the
stale update time value.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 years agoperf_counter: Make call graph option consistent
Anton Blanchard [Thu, 16 Jul 2009 13:44:29 +0000 (15:44 +0200)]
perf_counter: Make call graph option consistent

perf record uses -g for logging call graph data but perf report
uses -c to print call graph data. Be consistent and use -g
everywhere for call graph data.

Also update the help text to reflect the current default -
fractal,0.5

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090716104817.803604373@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Add perf record option to log addresses
Anton Blanchard [Thu, 16 Jul 2009 13:44:29 +0000 (15:44 +0200)]
perf_counter: Add perf record option to log addresses

Add the -d or --data option to log event addresses (eg page
faults).

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090716104817.697698033@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Log vfork as a fork event
Anton Blanchard [Thu, 16 Jul 2009 13:44:29 +0000 (15:44 +0200)]
perf_counter: Log vfork as a fork event

Right now we don't output vfork events. Even though we should
always see an exec after a vfork, we may get perfcounter
samples between the vfork and exec. These samples can lead to
some confusion when parsing perfcounter data.

To keep things consistent we should always log a fork event. It
will result in a little more log data, but is less confusing to
trace parsing tools.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090716104817.589309391@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Synthesize VDSO mmap event
Anton Blanchard [Thu, 16 Jul 2009 13:44:29 +0000 (15:44 +0200)]
perf_counter: Synthesize VDSO mmap event

perf record synthesizes mmap events for the running process.
Right now it just catches file mappings, but we can check for
the vdso symbol and add that too.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090716104817.517264409@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Make sure we dont leak kernel memory to userspace
Anton Blanchard [Thu, 16 Jul 2009 13:15:52 +0000 (15:15 +0200)]
perf_counter: Make sure we dont leak kernel memory to userspace

There are a few places we are leaking tiny amounts of kernel
memory to userspace. This happens when writing out strings
because we always align the end to 64 bits.

To avoid this we should always use an appropriately sized
temporary buffer and ensure it is zeroed.

Since d_path assembles the string from the end of the buffer
backwards, we need to add 64 bits after the buffer to allow for
alignment.

We also need to copy arch_vma_name to the temporary buffer,
because if we use it directly we may end up copying to
userspace a number of bytes after the end of the string
constant.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090716104817.273972048@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Account for vruntime wrapping
Fabio Checconi [Thu, 16 Jul 2009 10:32:27 +0000 (12:32 +0200)]
sched: Account for vruntime wrapping

I spotted two sites that didn't take vruntime wrap-around into
account. Fix these by creating a comparison helper that does do
so.

Signed-off-by: Fabio Checconi <fabio@gandalf.sssup.it>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Sat, 18 Jul 2009 04:19:50 +0000 (21:19 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm: Move a dereference below a NULL test
  fb/intelfb: conflict with DRM_I915 and hide by default
  drm/ttm: fix misplaced parentheses
  drm/via: Fix vblank IRQ on VIA hardware.
  drm: drm_gem, check kzalloc retval
  drm: drm_debugfs, check kmalloc retval
  drm/radeon: add some missing pci ids

14 years agoMerge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Steve French [Sat, 18 Jul 2009 03:13:38 +0000 (03:13 +0000)]
Merge branch 'master' of /linux/kernel/git/torvalds/linux-2.6

14 years agovmlinux.lds.h: restructure BSS linker script macros
Tim Abbott [Sun, 12 Jul 2009 22:23:33 +0000 (18:23 -0400)]
vmlinux.lds.h: restructure BSS linker script macros

The BSS section macros in vmlinux.lds.h currently place the .sbss
input section outside the bounds of [__bss_start, __bss_end].  On all
architectures except for microblaze that handle both .sbss and
__bss_start/__bss_end, this is wrong: the .sbss input section is
within the range [__bss_start, __bss_end].  Relatedly, the example
code at the top of the file actually has __bss_start/__bss_end defined
twice; I believe the right fix here is to define them in the
BSS_SECTION macro but not in the BSS macro.

Another problem with the current macros is that several
architectures have an ALIGN(4) or some other small number just before
__bss_stop in their linker scripts.  The BSS_SECTION macro currently
hardcodes this to 4; while it should really be an argument.  It also
ignores its sbss_align argument; fix that.

mn10300 is the only user at present of any of the macros touched by
this patch.  It looks like mn10300 actually was incorrectly converted
to use the new BSS() macro (the alignment of 4 prior to conversion was
a __bss_stop alignment, but the argument to the BSS macro is a start
alignment).  So fix this as well.

I'd like acks from Sam and David on this one.  Also CCing Paul, since
he has a patch from me which will need to be updated to use
BSS_SECTION(0, PAGE_SIZE, 4) once this gets merged.

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
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>