pandora-kernel.git
13 years agopowerpc: Re-enable preemption before cpu_die()
Signed-off-by: Darren Hart [Wed, 4 Aug 2010 18:28:33 +0000 (18:28 +0000)]
powerpc: Re-enable preemption before cpu_die()

start_secondary() is called shortly after _start and also via

cpu_idle()->cpu_die()->pseries_mach_cpu_die()

start_secondary() expects a preempt_count() of 0. pseries_mach_cpu_die() is
called via the cpu_idle() routine with preemption disabled, resulting in the
following repeating message during rapid cpu offline/online tests
with CONFIG_PREEMPT=y:

BUG: scheduling while atomic: swapper/0/0x00000002
Modules linked in: autofs4 binfmt_misc dm_mirror dm_region_hash dm_log [last unloaded: scsi_wait_scan]
Call Trace:
[c00000010e7079c0] [c0000000000133ec] .show_stack+0xd8/0x218 (unreliable)
[c00000010e707aa0] [c0000000006a47f0] .dump_stack+0x28/0x3c
[c00000010e707b20] [c00000000006e7a4] .__schedule_bug+0x7c/0x9c
[c00000010e707bb0] [c000000000699d9c] .schedule+0x104/0x800
[c00000010e707cd0] [c000000000015b24] .cpu_idle+0x1c4/0x1d8
[c00000010e707d70] [c0000000006aa1b4] .start_secondary+0x398/0x3d4
[c00000010e707e30] [c000000000008278] .start_secondary_resume+0x10/0x14

Move the cpu_die() call inside the existing preemption enabled block of
cpu_idle(). This is safe as the idle task is affined to a single CPU so the
debug_smp_processor_id() tests (from cpu_should_die()) won't trigger as we are
in a "migration disabled" region.

Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Acked-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Nathan Fontenot <nfont@austin.ibm.com>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/pci: Drop unnecessary null test
Julia Lawall [Tue, 3 Aug 2010 11:35:17 +0000 (11:35 +0000)]
powerpc/pci: Drop unnecessary null test

list_for_each_entry binds its first argument to a non-null value, and thus
any null test on the value of that argument is superfluous.

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

// <smpl>
@@
iterator I;
expression x,E,E1,E2;
statement S,S1,S2;
@@

I(x,...) { <...
- if (x != NULL || ...)
  S
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/powermac: Drop unnecessary null test
Julia Lawall [Tue, 3 Aug 2010 11:33:43 +0000 (11:33 +0000)]
powerpc/powermac: Drop unnecessary null test

for_each_node_by_name binds its first argument to a non-null value, and
thus any null test on the value of that argument is superfluous.

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

// <smpl>
@@
iterator I;
expression x,E;
@@

I(x,...) { <...
(
- (x != NULL) &&
  E
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/powermac: Drop unnecessary of_node_put
Julia Lawall [Tue, 3 Aug 2010 09:50:32 +0000 (09:50 +0000)]
powerpc/powermac: Drop unnecessary of_node_put

for_each_node_by_name only exits when its first argument is NULL, and a
subsequent call to of_node_put on that argument is unnecessary.

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

// <smpl>
@@
iterator name for_each_node_by_name;
expression np,E;
identifier l;
@@

for_each_node_by_name(np,...) {
  ... when != break;
      when != goto l;
}
... when != np = E
- of_node_put(np);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/kdump: Stop all other CPUs before running crash handlers
Anton Blanchard [Mon, 2 Aug 2010 20:39:41 +0000 (20:39 +0000)]
powerpc/kdump: Stop all other CPUs before running crash handlers

During kdump we run the crash handlers first then stop all other CPUs.
We really want to stop all CPUs as close to the fail as possible and also
have a very controlled environment for running the crash handlers, so it
makes sense to reverse the order.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/mm: Fix vsid_scrample typo
Anton Blanchard [Mon, 2 Aug 2010 20:35:18 +0000 (20:35 +0000)]
powerpc/mm: Fix vsid_scrample typo

The code is wrapped in an #if 0, but it's wrong so we may as well fix it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc: Use is_32bit_task() helper to test 32 bit binary
Denis Kirjanov [Thu, 29 Jul 2010 22:04:39 +0000 (22:04 +0000)]
powerpc: Use is_32bit_task() helper to test 32 bit binary

Use is_32bit_task() helper to test 32 bit binary.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc: Export memstart_addr and kernstart_addr on ppc64
Sonny Rao [Thu, 19 Aug 2010 18:08:09 +0000 (18:08 +0000)]
powerpc: Export memstart_addr and kernstart_addr on ppc64

Some modules (like eHCA) want to map all of kernel memory, for this to
work with a relocated kernel, we need to export kernstart_addr so
modules can use PHYSICAL_START and memstart_addr so they could use
MEMORY_START.  Note that the 32bit code already exports these symbols.

Signed-off-By: Sonny Rao <sonnyrao@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc: Make rwsem use "long" type
Benjamin Herrenschmidt [Tue, 24 Aug 2010 04:41:48 +0000 (14:41 +1000)]
powerpc: Make rwsem use "long" type

This makes the 64-bit kernel use 64-bit signed integers for the counter
(effectively supporting 32-bit of active count in the semaphore), thus
avoiding things like overflow of the mmap_sem if you use a really crazy
number of threads

Note: Ideally the type in the structure should be atomic_long_t rather
than "long". However, there's some nasty issues with that. It needs to
be initialized statically -and- lib/rwsem.c does things like

        sem->count = RWSEM_UNLOCKED_VALUE;

Now, if you mix in the fact that atomic_* types are actually structures
with one member and note typedefs of a scalar, it makes its really nasty.

So I stuck to what we did before using a long and casts for now.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agoMerge remote branch 'jwb/merge' into merge
Benjamin Herrenschmidt [Tue, 24 Aug 2010 04:36:45 +0000 (14:36 +1000)]
Merge remote branch 'jwb/merge' into merge

13 years agoARM: imx: fix build failure concerning otg/ulpi
Uwe Kleine-König [Fri, 13 Aug 2010 12:06:50 +0000 (14:06 +0200)]
ARM: imx: fix build failure concerning otg/ulpi

The build failure was introduced by

13dd0c9 (USB: otg/ulpi: extend the generic ulpi driver.)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: add product ID for Lenz LI-USB
Galen Seitz [Thu, 19 Aug 2010 18:15:20 +0000 (11:15 -0700)]
USB: ftdi_sio: add product ID for Lenz LI-USB

Add ftdi product ID for Lenz LI-USB, a model train interface.  This
was NOT tested against 2.6.35, but a similar patch was tested with the
CentOS 2.6.18-194.11.1.el5 kernel.  It wasn't clear to me what
ordering is being used in ftdi_sio.c, so I inserted the ID after another
model train entry(SPROG_II).

Signed-off-by: Galen Seitz <galens@seitzassoc.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: adutux: fix misuse of return value of copy_to_user()
Kulikov Vasiliy [Sat, 31 Jul 2010 17:40:07 +0000 (21:40 +0400)]
USB: adutux: fix misuse of return value of copy_to_user()

copy_to_user() returns number of not copied bytes, not error code.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: iowarrior: fix misuse of return value of copy_to_user()
Kulikov Vasiliy [Sat, 31 Jul 2010 17:39:46 +0000 (21:39 +0400)]
USB: iowarrior: fix misuse of return value of copy_to_user()

copy_to_user() returns number of not copied bytes, not error code.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: xHCI: update ring dequeue pointer when process missed tds
Andiry Xu [Mon, 9 Aug 2010 20:56:15 +0000 (13:56 -0700)]
USB: xHCI: update ring dequeue pointer when process missed tds

This patch fixes a isoc transfer bug reported by Sander Eikelenboom.
When ep->skip is set, endpoint ring dequeue pointer should be updated
when processed every missed td. Although ring dequeue pointer will also
be updated when ep->skip is clear, leave it intact during missed tds
processing may cause two issues:

1). If the very next valid transfer following missed tds is a short
transfer, its actual_length will be miscalculated;
2). If there are too many missed tds during transfer, new inserted tds
may found the transfer ring full and urb enqueue fails.

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: xhci: Remove buggy assignment in next_trb()
John Youn [Mon, 9 Aug 2010 20:56:11 +0000 (13:56 -0700)]
USB: xhci: Remove buggy assignment in next_trb()

The code to increment the TRB pointer has a slight ambiguity that could
lead to a bug on different compilers.  The ANSI C specification does not
specify the precedence of the assignment operator over the postfix
operator.  gcc 4.4 produced the correct code (increment the pointer and
assign the value), but a MIPS compiler that one of John's clients used
assigned the old (unincremented) value.

Remove the unnecessary assignment to make all compilers produce the
correct assembly.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: Add ID for Ionics PlugComputer
Martin Michlmayr [Tue, 10 Aug 2010 19:31:21 +0000 (20:31 +0100)]
USB: ftdi_sio: Add ID for Ionics PlugComputer

Add the ID for the Ionics PlugComputer (<http://ionicsplug.com/>).

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: io_ti.c: don't return 0 if writing the download record failed
Roel Kluin [Tue, 10 Aug 2010 21:29:19 +0000 (14:29 -0700)]
USB: serial: io_ti.c: don't return 0 if writing the download record failed

If the write download record failed we shouldn't return 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: otg: twl4030: fix wrong assumption of starting state
Felipe Balbi [Wed, 11 Aug 2010 10:02:32 +0000 (13:02 +0300)]
USB: otg: twl4030: fix wrong assumption of starting state

The reset state of twl4030-usb is not sleeping, it starts
up awaken and we need to disable it if we have booted
with a disconnected cable to avoid over consumption on
the default state.

To avoid problems later, we read the current state of the
transceiver from the PHY_PWR_CTRL register. The bootloader
can, anyways, put the device to sleep before us.

Tested on a custom OMAP board.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Return -ENOMEM on memory allocation failure
Julia Lawall [Wed, 11 Aug 2010 10:10:48 +0000 (12:10 +0200)]
USB: gadget: Return -ENOMEM on memory allocation failure

In this code, 0 is returned on memory allocation failure, even though other
failures return -ENOMEM or other similar values.

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

// <smpl>
@@
expression ret;
expression x,e1,e2,e3;
@@

ret = 0
... when != ret = e1
*x = \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
  return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: fix composite kernel-doc warnings
Randy Dunlap [Wed, 11 Aug 2010 19:07:13 +0000 (12:07 -0700)]
USB: gadget: fix composite kernel-doc warnings

Warning(include/linux/usb/composite.h:284): No description found for parameter 'disconnect'
Warning(drivers/usb/gadget/composite.c:744): No description found for parameter 'c'
Warning(drivers/usb/gadget/composite.c:744): Excess function parameter 'cdev' description in 'usb_string_ids_n'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ssu100: set tty_flags in ssu100_process_packet
Bill Pemberton [Fri, 13 Aug 2010 13:59:31 +0000 (09:59 -0400)]
USB: ssu100: set tty_flags in ssu100_process_packet

flag was never set in ssu100_process_packet.  Add logic to set it
before calling tty_insert_flip_*

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ssu100: add disconnect function for ssu100
Bill Pemberton [Thu, 5 Aug 2010 21:01:11 +0000 (17:01 -0400)]
USB: ssu100: add disconnect function for ssu100

Add a disconnect function to the functions of this device.  The
disconnect is a call to usb_serial_generic_disconnect() so it requires
that symbol to be exported from generic.c.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: export symbol usb_serial_generic_disconnect
Bill Pemberton [Thu, 5 Aug 2010 21:01:10 +0000 (17:01 -0400)]
USB: serial: export symbol usb_serial_generic_disconnect

This is needed by the ssu100 driver to use this function.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ssu100: rework logic for TIOCMIWAIT
Bill Pemberton [Thu, 5 Aug 2010 21:01:09 +0000 (17:01 -0400)]
USB: ssu100: rework logic for TIOCMIWAIT

Rework the logic for TIOCMIWAIT to use wait_event_interruptible.

This also adds support for TIOCGICOUNT.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ssu100: add register parameter to ssu100_setregister
Bill Pemberton [Thu, 5 Aug 2010 21:01:08 +0000 (17:01 -0400)]
USB: ssu100: add register parameter to ssu100_setregister

The function ssu100_setregister was hard coded to only set the MCR
register.  Add a register parameter so that other registers can be
set.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ssu100: remove duplicate #defines in ssu100
Bill Pemberton [Thu, 5 Aug 2010 21:01:07 +0000 (17:01 -0400)]
USB: ssu100: remove duplicate #defines in ssu100

The ssu100 uses a TI16C550C UART so the SERIAL_ defines in this code
are duplicates of those found in serial_reg.h.  Remove the defines in
ssu100.c and use the ones in the header file.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ssu100: refine process_packet in ssu100
Bill Pemberton [Thu, 5 Aug 2010 21:01:06 +0000 (17:01 -0400)]
USB: ssu100: refine process_packet in ssu100

The status information does not appear at the start of each incoming
packet so the check for len < 4 at the start of ssu100_process_packet
is wrong.  Remove it.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ssu100: add locking for port private data in ssu100
Bill Pemberton [Thu, 5 Aug 2010 21:01:05 +0000 (17:01 -0400)]
USB: ssu100: add locking for port private data in ssu100

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: r8a66597-udc: return -ENOMEM if kzalloc() fails
Axel Lin [Tue, 17 Aug 2010 01:41:29 +0000 (09:41 +0800)]
USB: r8a66597-udc: return -ENOMEM if kzalloc() fails

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: io_ti: check firmware version before updating
Greg Kroah-Hartman [Tue, 17 Aug 2010 22:15:37 +0000 (15:15 -0700)]
USB: io_ti: check firmware version before updating

If we can't read the firmware for a device from the disk, and yet the
device already has a valid firmware image in it, we don't want to
replace the firmware with something invalid.  So check the version
number to be less than the current one to verify this is the correct
thing to do.

Reported-by: Chris Beauchamp <chris@chillibean.tv>
Tested-by: Chris Beauchamp <chris@chillibean.tv>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: fix endianess of max packet size
Michael Wileczka [Wed, 18 Aug 2010 14:14:37 +0000 (07:14 -0700)]
USB: ftdi_sio: fix endianess of max packet size

The USB max packet size (always little-endian) was not being byte
swapped on big-endian systems.

Applicable since [USB: ftdi_sio: fix hi-speed device packet size calculation] approx 2.6.31

Signed-off-by: Michael Wileczka <mikewileczka@yahoo.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: CP210x Fix Break On/Off
Craig Shelley [Wed, 18 Aug 2010 21:13:39 +0000 (22:13 +0100)]
USB: CP210x Fix Break On/Off

The definitions for BREAK_ON and BREAK_OFF are inverted, causing break
requests to fail. This patch sets BREAK_ON and BREAK_OFF to the correct
values.

Signed-off-by: Craig Shelley <craig@microtron.org.uk>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: pl2303: New vendor and product id
Jef Driesen [Mon, 9 Aug 2010 13:55:32 +0000 (15:55 +0200)]
USB: pl2303: New vendor and product id

Add support for the Zeagle N2iTiON3 dive computer interface. Since
Zeagle devices are actually manufactured by Seiko, this patch will
support other Seiko based models as well.

Signed-off-by: Jef Driesen <jefdriesen@telenet.be>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: fix leak of usb serial module refrence count
Ming Lei [Sat, 7 Aug 2010 08:20:35 +0000 (16:20 +0800)]
USB: serial: fix leak of usb serial module refrence count

The patch with title below makes reference count of usb serial module
always more than one after driver is bound.

USB-BKL: Remove BKL use for usb serial driver probing

In fact, the patch above only replaces lock_kernel() with try_module_get()
, and does not use module_put() to do what unlock_kernel() did, so casue leak
of reference count of usb serial module and the module can not be unloaded
after serial driver is bound with device.

This patch fixes the issue, also simplifies such things:
-only call try_module_get() once in the entry of usb_serial_probe()
-only call module_put() once in the exit of usb_serial_probe

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: add device IDs for igotu to navman
Ross Burton [Fri, 6 Aug 2010 15:36:39 +0000 (16:36 +0100)]
USB: add device IDs for igotu to navman

I recently bought a i-gotU USB GPS, and whilst hunting around for linux
support discovered this post by you back in 2009:

http://kerneltrap.org/mailarchive/linux-usb/2009/3/12/5148644

>Try the navman driver instead.  You can either add the device id to the
> driver and rebuild it, or do this before you plug the device in:
>  modprobe navman
>  echo -n "0x0df7 0x0900" > /sys/bus/usb-serial/drivers/navman/new_id
>
> and then plug your device in and see if that works.

I can confirm that the navman driver works with the right device IDs on
my i-gotU GT-600, which has the same device IDs.  Attached is a patch
adding the IDs.

From: Ross Burton <ross@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: isp1760: use a write barrier to ensure proper ndelay timing
Michael Hennerich [Thu, 5 Aug 2010 21:53:57 +0000 (17:53 -0400)]
USB: isp1760: use a write barrier to ensure proper ndelay timing

The ISP1760 has some timing requirements where it has to delay a short
period after a write to a register has started.  However, this delay is
from the time the write hits the USB chip (the ISP1760), not from the
time where the processor started processing the write.  So on a quick
enough processor, it is sometimes possible for the write to not hit the
device before we start delaying, and we then violate the part's timing
requirements, so things stop working.

To avoid all this, insert a write barrier after the register write and
before the timing delay/register read so we can guarantee we only start
counting time after the write has hit the device.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: option: add Celot CT-650
Michael Tokarev [Fri, 6 Aug 2010 14:49:21 +0000 (18:49 +0400)]
USB: option: add Celot CT-650

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: uvc_v4l2: cleanup test for end of loop
Dan Carpenter [Thu, 12 Aug 2010 07:59:58 +0000 (09:59 +0200)]
USB: uvc_v4l2: cleanup test for end of loop

We're trying to test for the the end of the loop here.  "format" is
never NULL.  We don't know what "format->fcc" is because we're past the
end of the loop and I think "fmt->fmt.pix.pixelformat" comes from the
user so we don't know what that is either.  It works, but it's cleaner
to just test to see if (i == ARRAY_SIZE(uvc_formats).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoxfs: do not discard page cache data on EAGAIN
Christoph Hellwig [Tue, 24 Aug 2010 01:47:51 +0000 (11:47 +1000)]
xfs: do not discard page cache data on EAGAIN

If xfs_map_blocks returns EAGAIN because of lock contention we must redirty the
page and not disard the pagecache content and return an error from writepage.
We used to do this correctly, but the logic got lost during the recent
reshuffle of the writepage code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Mike Gao <ygao.linux@gmail.com>
Tested-by: Mike Gao <ygao.linux@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
13 years agoxfs: don't do memory allocation under the CIL context lock
Dave Chinner [Tue, 24 Aug 2010 01:45:53 +0000 (11:45 +1000)]
xfs: don't do memory allocation under the CIL context lock

Formatting items requires memory allocation when using delayed
logging. Currently that memory allocation is done while holding the
CIL context lock in read mode. This means that if memory allocation
takes some time (e.g. enters reclaim), we cannot push on the CIL
until the allocation(s) required by formatting complete. This can
stall CIL pushes for some time, and once a push is stalled so are
all new transaction commits.

Fix this splitting the item formatting into two steps. The first
step which does the allocation and memcpy() into the allocated
buffer is now done outside the CIL context lock, and only the CIL
insert is done inside the CIL context lock. This avoids the stall
issue.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoxfs: Reduce log force overhead for delayed logging
Dave Chinner [Tue, 24 Aug 2010 01:40:03 +0000 (11:40 +1000)]
xfs: Reduce log force overhead for delayed logging

Delayed logging adds some serialisation to the log force process to
ensure that it does not deference a bad commit context structure
when determining if a CIL push is necessary or not. It does this by
grabing the CIL context lock exclusively, then dropping it before
pushing the CIL if necessary. This causes serialisation of all log
forces and pushes regardless of whether a force is necessary or not.
As a result fsync heavy workloads (like dbench) can be significantly
slower with delayed logging than without.

To avoid this penalty, copy the current sequence from the context to
the CIL structure when they are swapped. This allows us to do
unlocked checks on the current sequence without having to worry
about dereferencing context structures that may have already been
freed. Hence we can remove the CIL context locking in the forcing
code and only call into the push code if the current context matches
the sequence we need to force.

By passing the sequence into the push code, we can check the
sequence again once we have the CIL lock held exclusive and abort if
the sequence has already been pushed. This avoids a lock round-trip
and unnecessary CIL pushes when we have racing push calls.

The result is that the regression in dbench performance goes away -
this change improves dbench performance on a ramdisk from ~2100MB/s
to ~2500MB/s. This compares favourably to not using delayed logging
which retuns ~2500MB/s for the same workload.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoxfs: dummy transactions should not dirty VFS state
Dave Chinner [Tue, 24 Aug 2010 01:46:31 +0000 (11:46 +1000)]
xfs: dummy transactions should not dirty VFS state

When we  need to cover the log, we issue dummy transactions to ensure
the current log tail is on disk. Unfortunately we currently use the
root inode in the dummy transaction, and the act of committing the
transaction dirties the inode at the VFS level.

As a result, the VFS writeback of the dirty inode will prevent the
filesystem from idling long enough for the log covering state
machine to complete. The state machine gets stuck in a loop issuing
new dummy transactions to cover the log and never makes progress.

To avoid this problem, the dummy transactions should not cause
externally visible state changes. To ensure this occurs, make sure
that dummy transactions log an unchanging field in the superblock as
it's state is never propagated outside the filesystem. This allows
the log covering state machine to complete successfully and the
filesystem now correctly enters a fully idle state about 90s after
the last modification was made.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoxfs: ensure f_ffree returned by statfs() is non-negative
Stuart Brodsky [Tue, 24 Aug 2010 01:46:05 +0000 (11:46 +1000)]
xfs: ensure f_ffree returned by statfs() is non-negative

Because of delayed updates to sb_icount field in the super block, it
is possible to allocate over maxicount number of inodes.  This
causes the arithmetic to calculate a negative number of free inodes
in user commands like df or stat -f.

Since maxicount is a somewhat arbitrary number, a slight over
allocation is not critical but user commands should be displayed as
0 or greater and never go negative.  To do this the value in the
stats buffer f_ffree is capped to never go negative.

[ Modified to use max_t as per Christoph's comment. ]

Signed-off-by: Stu Brodsky <sbrodsky@sgi.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
13 years agoxfs: handle negative wbc->nr_to_write during sync writeback
Dave Chinner [Tue, 24 Aug 2010 01:44:56 +0000 (11:44 +1000)]
xfs: handle negative wbc->nr_to_write during sync writeback

During data integrity (WB_SYNC_ALL) writeback, wbc->nr_to_write will
go negative on inodes with more than 1024 dirty pages due to
implementation details of write_cache_pages(). Currently XFS will
abort page clustering in writeback once nr_to_write drops below
zero, and so for data integrity writeback we will do very
inefficient page at a time allocation and IO submission for inodes
with large numbers of dirty pages.

Fix this by only aborting the page clustering code when
wbc->nr_to_write is negative and the sync mode is WB_SYNC_NONE.

Cc: <stable@kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agowriteback: write_cache_pages doesn't terminate at nr_to_write <= 0
Dave Chinner [Tue, 24 Aug 2010 01:44:34 +0000 (11:44 +1000)]
writeback: write_cache_pages doesn't terminate at nr_to_write <= 0

I noticed XFS writeback in 2.6.36-rc1 was much slower than it should have
been. Enabling writeback tracing showed:

    flush-253:16-8516  [007] 1342952.351608: wbc_writepage: bdi 253:16: towrt=1024 skip=0 mode=0 kupd=0 bgrd=1 reclm=0 cyclic=1 more=0 older=0x0 start=0x0 end=0x0
    flush-253:16-8516  [007] 1342952.351654: wbc_writepage: bdi 253:16: towrt=1023 skip=0 mode=0 kupd=0 bgrd=1 reclm=0 cyclic=1 more=0 older=0x0 start=0x0 end=0x0
    flush-253:16-8516  [000] 1342952.369520: wbc_writepage: bdi 253:16: towrt=0 skip=0 mode=0 kupd=0 bgrd=1 reclm=0 cyclic=1 more=0 older=0x0 start=0x0 end=0x0
    flush-253:16-8516  [000] 1342952.369542: wbc_writepage: bdi 253:16: towrt=-1 skip=0 mode=0 kupd=0 bgrd=1 reclm=0 cyclic=1 more=0 older=0x0 start=0x0 end=0x0
    flush-253:16-8516  [000] 1342952.369549: wbc_writepage: bdi 253:16: towrt=-2 skip=0 mode=0 kupd=0 bgrd=1 reclm=0 cyclic=1 more=0 older=0x0 start=0x0 end=0x0

Writeback is not terminating in background writeback if ->writepage is
returning with wbc->nr_to_write == 0, resulting in sub-optimal single page
writeback on XFS.

Fix the write_cache_pages loop to terminate correctly when this situation
occurs and so prevent this sub-optimal background writeback pattern. This
improves sustained sequential buffered write performance from around
250MB/s to 750MB/s for a 100GB file on an XFS filesystem on my 8p test VM.

Cc:<stable@kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoxfs: fix untrusted inode number lookup
Dave Chinner [Tue, 24 Aug 2010 01:42:30 +0000 (11:42 +1000)]
xfs: fix untrusted inode number lookup

Commit 7124fe0a5b619d65b739477b3b55a20bf805b06d ("xfs: validate untrusted inode
numbers during lookup") changes the inode lookup code to do btree lookups for
untrusted inode numbers. This change made an invalid assumption about the
alignment of inodes and hence incorrectly calculated the first inode in the
cluster. As a result, some inode numbers were being incorrectly considered
invalid when they were actually valid.

The issue was not picked up by the xfstests suite because it always runs fsr
and dump (the two utilities that utilise the bulkstat interface) on cache hot
inodes and hence the lookup code in the cold cache path was not sufficiently
exercised to uncover this intermittent problem.

Fix the issue by relaxing the btree lookup criteria and then checking if the
record returned contains the inode number we are lookup for. If it we get an
incorrect record, then the inode number is invalid.

Cc: <stable@kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoxfs: ensure we mark all inodes in a freed cluster XFS_ISTALE
Dave Chinner [Tue, 24 Aug 2010 01:42:41 +0000 (11:42 +1000)]
xfs: ensure we mark all inodes in a freed cluster XFS_ISTALE

Under heavy load parallel metadata loads (e.g. dbench), we can fail
to mark all the inodes in a cluster being freed as XFS_ISTALE as we
skip inodes we cannot get the XFS_ILOCK_EXCL or the flush lock on.
When this happens and the inode cluster buffer has already been
marked stale and freed, inode reclaim can try to write the inode out
as it is dirty and not marked stale. This can result in writing th
metadata to an freed extent, or in the case it has already
been overwritten trigger a magic number check failure and return an
EUCLEAN error such as:

Filesystem "ram0": inode 0x442ba1 background reclaim flush failed with 117

Fix this by ensuring that we hoover up all in memory inodes in the
cluster and mark them XFS_ISTALE when freeing the cluster.

Cc: <stable@kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoxfs: unlock items before allowing the CIL to commit
Dave Chinner [Tue, 24 Aug 2010 01:42:52 +0000 (11:42 +1000)]
xfs: unlock items before allowing the CIL to commit

When we commit a transaction using delayed logging, we need to
unlock the items in the transaciton before we unlock the CIL context
and allow it to be checkpointed. If we unlock them after we release
the CIl context lock, the CIL can checkpoint and complete before
we free the log items. This breaks stale buffer item unlock and
unpin processing as there is an implicit assumption that the unlock
will occur before the unpin.

Also, some log items need to store the LSN of the transaction commit
in the item (inodes and EFIs) and so can race with other transaction
completions if we don't prevent the CIL from checkpointing before
the unlock occurs.

Cc: <stable@kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Tue, 24 Aug 2010 01:30:30 +0000 (18:30 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (27 commits)
  netfilter: fix CONFIG_COMPAT support
  isdn/avm: fix build when PCMCIA is not enabled
  header: fix broken headers for user space
  e1000e: don't check for alternate MAC addr on parts that don't support it
  e1000e: disable ASPM L1 on 82573
  ll_temac: Fix poll implementation
  netxen: fix a race in netxen_nic_get_stats()
  qlnic: fix a race in qlcnic_get_stats()
  irda: fix a race in irlan_eth_xmit()
  net: sh_eth: remove unused variable
  netxen: update version 4.0.74
  netxen: fix inconsistent lock state
  vlan: Match underlying dev carrier on vlan add
  ibmveth: Fix opps during MTU change on an active device
  ehea: Fix synchronization between HW and SW send queue
  bnx2x: Update bnx2x version to 1.52.53-4
  bnx2x: Fix PHY locking problem
  rds: fix a leak of kernel memory
  netlink: fix compat recvmsg
  netfilter: fix userspace header warning
  ...

13 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platf...
Linus Torvalds [Tue, 24 Aug 2010 01:29:34 +0000 (18:29 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
  hp-wmi: Fix query interface
  ACPI_TOSHIBA needs LEDS support

13 years agoMerge branch 'for-upstream/pvhvm' of git://xenbits.xensource.com/people/ianc/linux-2.6
Linus Torvalds [Tue, 24 Aug 2010 01:29:18 +0000 (18:29 -0700)]
Merge branch 'for-upstream/pvhvm' of git://xenbits.xensource.com/people/ianc/linux-2.6

* 'for-upstream/pvhvm' of git://xenbits.xensource.com/people/ianc/linux-2.6:
  xen: pvhvm: make it clearer that XEN_UNPLUG_* define bits in a bitfield
  xen: pvhvm: rename xen_emul_unplug=ignore to =unnnecessary
  xen: pvhvm: allow user to request no emulated device unplug

13 years agoMerge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuil...
Linus Torvalds [Tue, 24 Aug 2010 01:28:24 +0000 (18:28 -0700)]
Merge branch 'rc-fixes' of git://git./linux/kernel/git/mmarek/kbuild-2.6

* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  setlocalversion: Ignote SCMs above the linux source tree
  makefile: not need to regenerate kernel.release file when make kernelrelease
  fixes for using make 3.82
  kconfig: fix segfault when detecting recursive dependency
  kconfig: fix savedefconfig with choice marked optional

13 years agoMerge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Tue, 24 Aug 2010 01:28:03 +0000 (18:28 -0700)]
Merge branch 'drm-core-next' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (33 commits)
  drm/radeon/kms: fix typo in radeon_compute_pll_gain
  drm/radeon/kms: try to detect tv vs monitor for underscan
  drm/radeon/kms: fix sideport detection on newer rs880 boards
  drm/radeon: fix passing wrong type to gem object create.
  drm/radeon/kms: set encoder type to DVI for HDMI on evergreen
  drm/radeon/kms: add back missing break in info ioctl
  drm/radeon/kms: don't enable MSIs on AGP boards
  drm/radeon/kms: fix agp mode setup on cards that use pcie bridges
  drm: move dereference below check
  drm: fix end of loop test
  drm/radeon/kms: rework radeon_dp_detect() logic
  drm/radeon/kms: add missing asic callback assignment for evergreen
  drm/radeon/kms/DCE3+: switch pads to ddc mode when going i2c
  drm/radeon/kms/pm: bail early if nothing's changing
  drm/radeon/kms/atom: clean up dig atom handling
  drm/radeon/kms: DCE3/4 transmitter fixes
  drm/radeon/kms: rework encoder handling
  drm/radeon/kms: DCE3/4 AdjustPixelPll updates
  drm/radeon: Fix stack data leak
  drm/radeon/kms: fix GTT/VRAM overlapping test
  ...

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier...
Linus Torvalds [Tue, 24 Aug 2010 01:27:40 +0000 (18:27 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/vapier/blackfin

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin:
  Blackfin: wire up new fanotify/prlimit64 syscalls
  ADI/ASoC: add MAINTAINERS entries
  Blackfin: fix hweight breakage

13 years ago68328serial: check return value of copy_*_user() instead of access_ok()
Kulikov Vasiliy [Sun, 1 Aug 2010 06:29:06 +0000 (10:29 +0400)]
68328serial: check return value of copy_*_user() instead of access_ok()

As copy_*_user() calls access_ok() it should not be called explicitly.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agosynclink: add mutex_unlock() on error path
Dan Carpenter [Wed, 11 Aug 2010 18:01:46 +0000 (20:01 +0200)]
synclink: add mutex_unlock() on error path

There is a path which still holds its mutex here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agorocket: add a mutex_unlock()
Dan Carpenter [Wed, 11 Aug 2010 18:00:09 +0000 (20:00 +0200)]
rocket: add a mutex_unlock()

This path needs a mutex_unlock().  This is stuff from the bkl to mutex
transition.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoip2: return -EFAULT on copy_to_user errors
Dan Carpenter [Thu, 12 Aug 2010 20:48:59 +0000 (13:48 -0700)]
ip2: return -EFAULT on copy_to_user errors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: "Michael H. Warfield" <mhw@wittsend.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoip2: remove unneeded NULL check
Dan Carpenter [Thu, 12 Aug 2010 20:48:57 +0000 (13:48 -0700)]
ip2: remove unneeded NULL check

We don't pass NULL tty pointers to the close function, and anyway we
already dereferenced it at this point.  This check can be removed.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: "Michael H. Warfield" <mhw@wittsend.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: print early console device address in hex
Luck, Tony [Thu, 12 Aug 2010 19:16:43 +0000 (12:16 -0700)]
serial: print early console device address in hex

Device addresses are usually printed in hex.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: sep: remove driver
Greg Kroah-Hartman [Mon, 23 Aug 2010 17:28:31 +0000 (10:28 -0700)]
Staging: sep: remove driver

It's currently stalled and the original submitter recommended that it
just be dropped at this point in time due.

Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: Don't write in not allocated packet_buff
Sven Eckelmann [Sat, 21 Aug 2010 12:18:10 +0000 (14:18 +0200)]
Staging: batman-adv: Don't write in not allocated packet_buff

Each net_device in a system will automatically managed as a possible
batman_if and holds different informations like a buffer with a prepared
originator messages. To reduce the memory usage, the packet_buff will
only be allocated when the interface is really added/enabled for
batman-adv.

The function to update the hw address information inside the packet_buff
just assumes that the packet_buff is always initialised and thus the
kernel will just oops when we try to change the hw address of a not
already fully enabled interface.

We must always check if the packet_buff is allocated before we try to
change information inside of it.

Reported-by: Tim Glaremin <Tim.Glaremin@web.de>
Reported-by: Kazuki Shimada <zukky@bb.banban.jp>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: Don't use net_dev after dev_put
Sven Eckelmann [Sat, 21 Aug 2010 12:18:09 +0000 (14:18 +0200)]
Staging: batman-adv: Don't use net_dev after dev_put

dev_put allows a device to be freed when all its references are dropped.
After that we are not allowed to access that information anymore. Access
to the data structure of a net_device must be surrounded a dev_hold
and ended using dev_put.

batman-adv adds a device to its own management structure in
hardif_add_interface and will release it in hardif_remove_interface.
Thus it must hold a reference all the time between those functions to
prevent any access to the already released net_device structure.

Reported-by: Tim Glaremin <Tim.Glaremin@web.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: Create batman_if only on register event
Sven Eckelmann [Sat, 21 Aug 2010 12:18:08 +0000 (14:18 +0200)]
Staging: batman-adv: Create batman_if only on register event

We try to get all events for all net_devices to be able to add special
sysfs folders for the batman-adv configuration. This also includes such
events like NETDEV_POST_INIT which has no valid kobject according to
v2.6.32-rc3-13-g7ffbe3f. This would create an oops in that situation.

It is enough to create the batman_if only on NETDEV_REGISTER events
because we will also receive those events for devices which already
existed when we registered the notifier call.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: fix own mac address detection
Marek Lindner [Mon, 9 Aug 2010 21:56:42 +0000 (23:56 +0200)]
Staging: batman-adv: fix own mac address detection

Earlier batman-adv versions would only create a batman_if struct after
a corresponding interface had been activated by a user. Now each
existing system interface has a batman_if struct and has to be checked
by verifying the IF_ACTIVE flag.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: always reply batman icmp packets with primary mac
Marek Lindner [Mon, 9 Aug 2010 21:56:41 +0000 (23:56 +0200)]
Staging: batman-adv: always reply batman icmp packets with primary mac

When receiving an batman icmp echo request or in case of a time-to-live
exceeded batman would reply with the mac address of the outgoing
interface which might be a secondary interface. Because secondary
interfaces are not globally known this might lead to confusion.
Now, replies are sent with the mac address of the primary interface.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: fix batman icmp originating from secondary interface
Marek Lindner [Mon, 9 Aug 2010 21:56:40 +0000 (23:56 +0200)]
Staging: batman-adv: fix batman icmp originating from secondary interface

If a batman icmp packet had to be routed over a secondary interface
at the first hop, the mac address of that secondary interface would
be written in the 'orig' field of the icmp packet. A node which is
more than one hop away is not aware of the mac address because
secondary interfaces are not flooded through the whole mesh and
therefore can't send a reply.
This patch always sends the mac address of the primary interface
in the 'orig' field of the icmp packet.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: unify orig_hash_lock spinlock handling to avoid deadlocks
Marek Lindner [Mon, 9 Aug 2010 21:56:39 +0000 (23:56 +0200)]
Staging: batman-adv: unify orig_hash_lock spinlock handling to avoid deadlocks

The orig_hash_lock spinlock always has to be locked with IRQs being
disabled to avoid deadlocks between code that is being executed in
IRQ context and code that is being executed in non-IRQ context.

Reported-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: batman-adv: Fix merge of linus tree
Sven Eckelmann [Mon, 9 Aug 2010 21:56:38 +0000 (23:56 +0200)]
Staging: batman-adv: Fix merge of linus tree

Greg Kroah-Hartman merged Linus 2.6.36 tree in
e9563355ac1175dd3440dc2ea5c28b27ed51a283 with his staging tree.
Different parts of the merge conflicts were resolved incorrectly and may
result in an abnormal behavior.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: spectra: removes unused functions
Javier Martinez Canillas [Sat, 17 Jul 2010 20:46:28 +0000 (16:46 -0400)]
Staging: spectra: removes unused functions

Fix compilation warning removing unused functions.

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: spectra: initializa lblk variable
Javier Martinez Canillas [Sat, 17 Jul 2010 20:45:27 +0000 (16:45 -0400)]
Staging: spectra: initializa lblk variable

Fix a compile warning by initializaing lblk. Since FTL_Get_Block_Index()
returns BAD_BLOCK if it doesn't find the logical block number, lblk
number is initizalized to BAD_BLOCK.

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: spectra: removes unused variable
Javier Martinez Canillas [Sat, 17 Jul 2010 20:42:19 +0000 (16:42 -0400)]
Staging: spectra: removes unused variable

Fix a compile warning by removing an unused variable int i.

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: spectra: remove duplicate GLOB_VERSION definition
Javier Martinez Canillas [Sat, 17 Jul 2010 20:39:54 +0000 (16:39 -0400)]
Staging: spectra: remove duplicate GLOB_VERSION definition

This is the first patch of a patchset that removes all compilations
warnings in staging/spectra.

These patches are a delta from a previous patchset and it assumes that
these three patches all already applied:

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: spectra: don't use locked_ioctl, fix build
Javier Martinez Canillas [Sat, 10 Jul 2010 04:07:35 +0000 (00:07 -0400)]
Staging: spectra: don't use locked_ioctl, fix build

Last patch has a style problem. Sending the correct one. Sorry for the noise

Since BKL was removed from block ioctl handling code, locked_ioctl doesn't
exist anymore.

Using ioctl instead and doing the locking manually.

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: use new REQ_FLUSH flag, fix build breakage
Javier Martinez Canillas [Sat, 10 Jul 2010 03:28:13 +0000 (23:28 -0400)]
Staging: use new REQ_FLUSH flag, fix build breakage

REQ_TYPE_LINUX_BLOCK and REQ_LB_OP_FLUSH doesn't exist anymore. Using
the new REQ_FLUSH flag instead

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: spectra: removes q->prepare_flush_fn, fix build breakage
Javier Martinez Canillas [Sat, 10 Jul 2010 03:25:12 +0000 (23:25 -0400)]
Staging: spectra: removes q->prepare_flush_fn, fix build breakage

This patch is the first one of a patchset that allows
stagin/spectra driver to compile in linux-next.

blk_queue_ordered doesn't receive a prepare flush function anymore

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agokobject_uevent: fix typo in comments
Xiaotian Feng [Fri, 13 Aug 2010 10:58:10 +0000 (18:58 +0800)]
kobject_uevent: fix typo in comments

s/ending/sending, s/kobject_uevent()/kobject_uevent_env() in the comments.

Signed-off-by: Xiaotian Feng <xtfeng@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agofirmware_class: fix typo in error path
Johannes Berg [Wed, 18 Aug 2010 15:15:18 +0000 (17:15 +0200)]
firmware_class: fix typo in error path

In the error path, _request_firmware sets
firmware_p to NULL rather than *firmware_p,
which leads to passing a freed firmware
struct to drivers when the firmware file
cannot be found. Fix this.

Broken by commit f8a4bd3456b988fc73b2c.

Reported-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agokobject: Break the kobject namespace defs into their own header
David Howells [Wed, 11 Aug 2010 14:01:02 +0000 (15:01 +0100)]
kobject: Break the kobject namespace defs into their own header

Break the kobject namespace defs into their own header to avoid a header file
inclusion ordering problem between linux/sysfs.h and linux/kobject.h.

This fixes the build breakage on older versions of gcc.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agonetfilter: fix CONFIG_COMPAT support
Florian Westphal [Mon, 23 Aug 2010 21:41:22 +0000 (14:41 -0700)]
netfilter: fix CONFIG_COMPAT support

commit f3c5c1bfd430858d3a05436f82c51e53104feb6b
(netfilter: xtables: make ip_tables reentrant) forgot to
also compute the jumpstack size in the compat handlers.

Result is that "iptables -I INPUT -j userchain" turns into -j DROP.

Reported by Sebastian Roesner on #netfilter, closes
http://bugzilla.netfilter.org/show_bug.cgi?id=669.

Note: arptables change is compile-tested only.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agohp-wmi: Fix query interface
Matthew Garrett [Mon, 23 Aug 2010 19:52:34 +0000 (15:52 -0400)]
hp-wmi: Fix query interface

The machines I have appear to provide their return value in the arguments
structure, not the output structure. Rework the driver to use that again
in order to get rfkill working again.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
13 years agoACPI_TOSHIBA needs LEDS support
Jonathan Corbet [Mon, 23 Aug 2010 17:32:36 +0000 (11:32 -0600)]
ACPI_TOSHIBA needs LEDS support

Don't ask how ACPI_TOSHIBA got enabled on in desktop system's .config -
I don't know.  But it has silently been there until I tried 2.6.36-rc2,
where it broke the build because I don't have LED support turned on.
Attached patch fixes things up.

(I had to change BACKLIGHT_CLASS_DEVICE to "depends" because otherwise
I get unsightly core dumps out of scripts/kconfig/conf).

jon

--
toshiba: make sure we pull in LED support

The Toshiba extras driver uses the LED module, so make sure we have it
configure in.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
13 years agoarch/mn10300/mm: eliminate NULL dereference
Julia Lawall [Mon, 23 Aug 2010 13:31:34 +0000 (14:31 +0100)]
arch/mn10300/mm: eliminate NULL dereference

dev_name always dereferences its argument, so it should not be called if
the argument is NULL.  The function indeed later tests the argument for
being NULL.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

  // <smpl>
  @@
  expression dev,E;
  @@

  *dev_name(dev)
  ... when != dev = E
  (
  *dev == NULL
  |
  *dev != NULL
  )
  // </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocifs: check for NULL session password
Jeff Layton [Mon, 23 Aug 2010 15:38:04 +0000 (11:38 -0400)]
cifs: check for NULL session password

It's possible for a cifsSesInfo struct to have a NULL password, so we
need to check for that prior to running strncmp on it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
13 years agomissing changes during ntlmv2/ntlmssp auth and sign
Shirish Pargaonkar [Mon, 23 Aug 2010 16:04:07 +0000 (11:04 -0500)]
missing changes during ntlmv2/ntlmssp auth and sign

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
13 years agoMerge branch 'misc' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Mon, 23 Aug 2010 17:36:04 +0000 (10:36 -0700)]
Merge branch 'misc' of git://git.kernel.dk/linux-2.6-block

* 'misc' of git://git.kernel.dk/linux-2.6-block:
  ipheth: add support for iPhone 4

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Mon, 23 Aug 2010 17:34:51 +0000 (10:34 -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:
  ASoC: i.MX ssi: use SSI_STCCR in synchronous mode
  ALSA: hda - Add support for Lenovo S10-3t
  ALSA: hda - Fix stream and channel-ids codec-bus wide
  ALSA: hda - Fix conflict of sticky PCM parameter in HDMI codecs
  ALSA: intel8x0: Mute External Amplifier by default for ThinkPad X31
  ALSA: hda - Fix build error with CONFIG_PROC_FS=n
  ALSA: hda - Add support for IDT 92HD89XX codecs

13 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Mon, 23 Aug 2010 13:09:52 +0000 (15:09 +0200)]
Merge branch 'fix/asoc' into for-linus

13 years agoASoC: i.MX ssi: use SSI_STCCR in synchronous mode
Sascha Hauer [Mon, 23 Aug 2010 06:54:02 +0000 (08:54 +0200)]
ASoC: i.MX ssi: use SSI_STCCR in synchronous mode

In synchronous mode the SSI_SRCCR values are ignored. Instead
SSI_STCCR must be used for both receiving and transmitting.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agopowerpc/47x: Add an isync before the tlbivax instruction
Dave Kleikamp [Wed, 18 Aug 2010 06:44:26 +0000 (06:44 +0000)]
powerpc/47x: Add an isync before the tlbivax instruction

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
13 years agopowerpc/4xx: Index interrupt stacks by physical cpu
Dave Kleikamp [Wed, 18 Aug 2010 06:44:25 +0000 (06:44 +0000)]
powerpc/4xx: Index interrupt stacks by physical cpu

The interrupt stacks need to be indexed by the physical cpu since the
critical, debug and machine check handlers use the contents of SPRN_PIR to
index the critirq_ctx, dbgirq_ctx, and mcheckirq_ctx arrays.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
13 years agopowerpc/47x: Remove redundant line from cputable.c
Dave Kleikamp [Wed, 18 Aug 2010 06:44:24 +0000 (06:44 +0000)]
powerpc/47x: Remove redundant line from cputable.c

There are two entries for .cpu_user_features in
arch/powerpc/kernel/cputable.c.  Remove the one that doesn't belong

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
13 years agopowerpc/47x: Make sure mcsr is cleared before enabling machine check interrupts
Dave Kleikamp [Wed, 18 Aug 2010 06:44:23 +0000 (06:44 +0000)]
powerpc/47x: Make sure mcsr is cleared before enabling machine check interrupts

Clear the machine check syndrom register before enabling machine check
interrupts.  The initial state of the tlb can lead to parity errors being
flagged early after a cold boot.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
13 years agopowerpc/4xx: Device tree update for the 460ex DWC SATA
Rupjyoti Sarmah [Fri, 4 Jun 2010 00:03:12 +0000 (00:03 +0000)]
powerpc/4xx: Device tree update for the 460ex DWC SATA

Device tree update for the Applied micro processor 460ex on-chip SATA

Signed-off-by: Rupjyoti Sarmah <rsarmah@amcc.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
13 years agoxen: pvhvm: make it clearer that XEN_UNPLUG_* define bits in a bitfield
Ian Campbell [Mon, 23 Aug 2010 11:01:35 +0000 (12:01 +0100)]
xen: pvhvm: make it clearer that XEN_UNPLUG_* define bits in a bitfield

by defining in terms of (1<<N).

XEN_UNPLUG_UNNECESSARY and XEN_UNPLUG_NEVER are only used within the
kernel and are not defined as a bit on the unplug IO port. Therefore
use a bit which is outside the potentially valid range of the 16 bit
IO port.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
13 years agoxen: pvhvm: rename xen_emul_unplug=ignore to =unnnecessary
Ian Campbell [Mon, 23 Aug 2010 10:59:29 +0000 (11:59 +0100)]
xen: pvhvm: rename xen_emul_unplug=ignore to =unnnecessary

It is not immediately clear what this option causes to become
ignored. The actual meaning is that it is not necessary to unplug the
emulated devices to safely use the PV ones, even if the platform does
not support the unplug protocol. (pressumably the user will only add
this option if they have ensured that their domain configuration is
safe).

I think xen_emul_unplug=unnecessary better captures this.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
13 years agoxen: pvhvm: allow user to request no emulated device unplug
Ian Campbell [Mon, 23 Aug 2010 10:59:28 +0000 (11:59 +0100)]
xen: pvhvm: allow user to request no emulated device unplug

this allows the user to disable pvhvm and revert to emulated devices
in case of a system misconfiguration (e.g. initramfs with only
emulated drivers in it).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
13 years agoipheth: add support for iPhone 4
Jens Axboe [Mon, 23 Aug 2010 10:39:29 +0000 (12:39 +0200)]
ipheth: add support for iPhone 4

This adds support for the iPhone 4 to the ipheth driver.

Acked-by: Diego Giagio <diego@giagio.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agomutex: Improve the scalability of optimistic spinning
Tim Chen [Wed, 18 Aug 2010 22:00:27 +0000 (15:00 -0700)]
mutex: Improve the scalability of optimistic spinning

There is a scalability issue for current implementation of optimistic
mutex spin in the kernel.  It is found on a 8 node 64 core Nehalem-EX
system (HT mode).

The intention of the optimistic mutex spin is to busy wait and spin on a
mutex if the owner of the mutex is running, in the hope that the mutex
will be released soon and be acquired, without the thread trying to
acquire mutex going to sleep. However, when we have a large number of
threads, contending for the mutex, we could have the mutex grabbed by
other thread, and then another ……, and we will keep spinning, wasting cpu
cycles and adding to the contention.  One possible fix is to quit
spinning and put the current thread on wait-list if mutex lock switch to
a new owner while we spin, indicating heavy contention (see the patch
included).

I did some testing on a 8 socket Nehalem-EX system with a total of 64
cores. Using Ingo's test-mutex program that creates/delete files with 256
threads (http://lkml.org/lkml/2006/1/8/50) , I see the following speed up
after putting in the mutex spin fix:

 ./mutex-test V 256 10
                 Ops/sec
 2.6.34          62864
 With fix        197200

Repeating the test with Aim7 fserver workload, again there is a speed up
with the fix:

                 Jobs/min
 2.6.34          91657
 With fix        149325

To look at the impact on the distribution of mutex acquisition time, I
collected the mutex acquisition time on Aim7 fserver workload with some
instrumentation.  The average acquisition time is reduced by 48% and
number of contentions reduced by 32%.

                 #contentions    Time to acquire mutex (cycles)
 2.6.34          72973           44765791
 With fix        49210           23067129

The histogram of mutex acquisition time is listed below.  The acquisition
time is in 2^bin cycles.  We see that without the fix, the acquisition
time is mostly around 2^26 cycles.  With the fix, we the distribution get
spread out a lot more towards the lower cycles, starting from 2^13.
However, there is an increase of the tail distribution with the fix at
2^28 and 2^29 cycles.  It seems a small price to pay for the reduced
average acquisition time and also getting the cpu to do useful work.

 Mutex acquisition time distribution (acq time = 2^bin cycles):
         2.6.34                  With Fix
 bin     #occurrence     %       #occurrence     %
 11      2               0.00%   120             0.24%
 12      10              0.01%   790             1.61%
 13      14              0.02%   2058            4.18%
 14      86              0.12%   3378            6.86%
 15      393             0.54%   4831            9.82%
 16      710             0.97%   4893            9.94%
 17      815             1.12%   4667            9.48%
 18      790             1.08%   5147            10.46%
 19      580             0.80%   6250            12.70%
 20      429             0.59%   6870            13.96%
 21      311             0.43%   1809            3.68%
 22      255             0.35%   2305            4.68%
 23      317             0.44%   916             1.86%
 24      610             0.84%   233             0.47%
 25      3128            4.29%   95              0.19%
 26      63902           87.69%  122             0.25%
 27      619             0.85%   286             0.58%
 28      0               0.00%   3536            7.19%
 29      0               0.00%   903             1.83%
 30      0               0.00%   0               0.00%

I've done similar experiments with 2.6.35 kernel on smaller boxes as
well.  One is on a dual-socket Westmere box (12 cores total, with HT).
Another experiment is on an old dual-socket Core 2 box (4 cores total, no
HT)

On the 12-core Westmere box, I see a 250% increase for Ingo's mutex-test
program with my mutex patch but no significant difference in aim7's
fserver workload.

On the 4-core Core 2 box, I see the difference with the patch for both
mutex-test and aim7 fserver are negligible.

So far, it seems like the patch has not caused regression on smaller
systems.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: <stable@kernel.org> # .35.x
LKML-Reference: <1282168827.9542.72.camel@schen9-DESK>
Signed-off-by: Ingo Molnar <mingo@elte.hu>