]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoStaging: pcc-acpi: update to latest version
Greg Kroah-Hartman [Wed, 22 Oct 2008 05:21:51 +0000 (22:21 -0700)]
Staging: pcc-acpi: update to latest version

Import the changes from the upstream driver into this version to keep
things up to date.

Cc: Yokota Hiroshi <yokota@netlab.cs.tsukuba.ac.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: Clean up sxg driver
J.R. Mauro [Tue, 14 Oct 2008 22:00:15 +0000 (18:00 -0400)]
Staging: Clean up sxg driver

Lindent the rest of the files in drivers/staging/sxg

Signed off by: J.R. Mauro <jrm8005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: remove remaining uses of __FUNCTION__
Harvey Harrison [Mon, 20 Oct 2008 22:45:25 +0000 (15:45 -0700)]
Staging: remove remaining uses of __FUNCTION__

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: add poch driver
Vijay Kumar [Sun, 19 Oct 2008 03:28:46 +0000 (08:58 +0530)]
Staging: add poch driver

This is the first cut at a driver for the Redrapids Pocket Change
CardBus devices.

Receiving data seems to work properly, but overflows happen on transmit.
Still needs more hardware debugging to work properly.

(cleaned up to use proper driver core api functions by Greg)

From: Vijay Kumar <vijaykumar@bravegnu.org>
Cc: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: Ken Sienski <sienski@redrapids.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: fix build error if wireless networking is not enabled
Greg Kroah-Hartman [Mon, 20 Oct 2008 21:32:33 +0000 (14:32 -0700)]
Staging: wlan-ng: fix build error if wireless networking is not enabled

Thanks to Ingo for pointing this out.

Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: remove annoying "end of function" markers
Pekka Enberg [Fri, 17 Oct 2008 17:57:08 +0000 (20:57 +0300)]
Staging: echo: remove annoying "end of function" markers

This patch removes the very noisy "end of function" markers that are
very annoying when reading the driver code.

Cc: David Rowe <david@rowetel.com>
Cc: Steve Underwood <steveu@coppice.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: remove __cplusplus macro magic
Pekka Enberg [Fri, 17 Oct 2008 17:56:00 +0000 (20:56 +0300)]
Staging: echo: remove __cplusplus macro magic

The kernel is written in C, so remove the __cplusplus macro magic from the
driver.

Cc: David Rowe <david@rowetel.com>
Cc: Steve Underwood <steveu@coppice.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: remove dead code
Pekka Enberg [Fri, 17 Oct 2008 17:55:32 +0000 (20:55 +0300)]
Staging: echo: remove dead code

This patch removes dead code that is wrapped in #ifndef __KERNEL__.

Cc: David Rowe <david@rowetel.com>
Cc: Steve Underwood <steveu@coppice.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: fix kmalloc()/kfree() uses
Pekka Enberg [Fri, 17 Oct 2008 17:55:03 +0000 (20:55 +0300)]
Staging: echo: fix kmalloc()/kfree() uses

This patch removes the malloc()/free() macro wrappers and converts
call-sites to use kcalloc() and kzalloc() where appropriate. I also
fixed up out-of-memory error handling in couple of places where it was
broken.

Cc: David Rowe <david@rowetel.com>
Cc: Steve Underwood <steveu@coppice.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: Replace __BLACKFIN__ASM__ with __bfin__
Tzafrir Cohen [Sun, 12 Oct 2008 06:13:21 +0000 (08:13 +0200)]
Staging: echo: Replace __BLACKFIN__ASM__ with __bfin__

Signed-off-by: Tzafrir Cohen <tzafrir@cohens.org.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: Changed preffix from echo_can_ to oslec_
Tzafrir Cohen [Sun, 12 Oct 2008 05:17:26 +0000 (07:17 +0200)]
Staging: echo: Changed preffix from echo_can_ to oslec_

Signed-off-by: Tzafrir Cohen <tzafrir@cohens.org.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: Replace echo_can_state_t with struct echo_can_state
Tzafrir Cohen [Sun, 12 Oct 2008 05:00:24 +0000 (07:00 +0200)]
Staging: echo: Replace echo_can_state_t with struct echo_can_state

Signed-off-by: Tzafrir Cohen <tzafrir@cohens.org.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: Export interface functions. Add module headers.
Tzafrir Cohen [Sun, 12 Oct 2008 04:55:40 +0000 (06:55 +0200)]
Staging: echo: Export interface functions. Add module headers.

Signed-off-by: Tzafrir Cohen <tzafrir@cohens.org.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: echo: A separate oslec.h for external interface
Tzafrir Cohen [Sun, 12 Oct 2008 04:03:14 +0000 (06:03 +0200)]
Staging: echo: A separate oslec.h for external interface

Split out the external interface to a separate file called oslec.h .

Give the struct a name while we're at it.

Signed-off-by: Tzafrir Cohen <tzafrir@cohens.org.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: replace __FUNCTION__ with __func__
Harvey Harrison [Fri, 17 Oct 2008 21:46:10 +0000 (14:46 -0700)]
Staging: sxg: replace __FUNCTION__ with __func__

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove some typedefs
Pekka Enberg [Mon, 20 Oct 2008 21:03:41 +0000 (00:03 +0300)]
Staging: w35und: remove some typedefs

This patch removes some obfuscating typedefs from the driver code.

Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: SLICOSS: remove unused #include <version.h>
Huang Weiyi [Sat, 18 Oct 2008 04:41:57 +0000 (12:41 +0800)]
Staging: SLICOSS: remove unused #include <version.h>

The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
  drivers/staging/slicoss/slicoss.c

This patch removes the said #include <version.h>.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: go7007: remove unused #include <version.h>
Huang Weiyi [Sat, 18 Oct 2008 04:41:55 +0000 (12:41 +0800)]
Staging: go7007: remove unused #include <version.h>

The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
  drivers/staging/go7007/go7007-driver.c
  drivers/staging/go7007/go7007-fw.c
  drivers/staging/go7007/go7007-i2c.c
  drivers/staging/go7007/go7007-usb.c
  drivers/staging/go7007/snd-go7007.c
  drivers/staging/go7007/wis-ov7640.c
  drivers/staging/go7007/wis-saa7113.c
  drivers/staging/go7007/wis-saa7115.c
  drivers/staging/go7007/wis-sony-tuner.c
  drivers/staging/go7007/wis-tw2804.c
  drivers/staging/go7007/wis-tw9903.c
  drivers/staging/go7007/wis-uda1342.c

This patch removes the said #include <version.h>.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agostaging: wlan-ng: prism2: remove more duplicated #include
Huang Weiyi [Sat, 18 Oct 2008 03:53:07 +0000 (11:53 +0800)]
staging: wlan-ng: prism2: remove more duplicated #include

Removed duplicated #include "version.h" in
drivers/staging/wlan-ng/p80211wep.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: prism2: remove duplicated #include
Huang Weiyi [Sat, 18 Oct 2008 03:53:05 +0000 (11:53 +0800)]
Staging: wlan-ng: prism2: remove duplicated #include

Removed duplicated #include "wlan_compat.h" in
drivers/staging/wlan-ng/prism2mib.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: et131x: remove duplicated #include's
Huang Weiyi [Sat, 18 Oct 2008 03:52:13 +0000 (11:52 +0800)]
Staging: et131x: remove duplicated #include's

Removed duplicated #include's in file(s) below,
 - drivers/staging/et131x/et1310_phy.c
      et1310_jagcore.h
      linux/delay.h
 - drivers/staging/et131x/et131x_debug.c
      et1310_jagcore.h
 - drivers/staging/et131x/et131x_initpci.c
      et1310_jagcore.h

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: SLICOSS: remove duplicated #include's
Huang Weiyi [Sat, 18 Oct 2008 03:52:11 +0000 (11:52 +0800)]
Staging: SLICOSS: remove duplicated #include's

Removed duplicated #include's in drivers/staging/slicoss/slicoss.c.
  linux/delay.h
  linux/etherdevice.h
  linux/init.h
  linux/netdevice.h
  linux/pci.h
  linux/skbuff.h
  linux/slab.h
  linux/string.h

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: Fixes for me4000 pci data collection driver
Lior Dotan [Fri, 17 Oct 2008 09:30:07 +0000 (11:30 +0200)]
Staging: Fixes for me4000 pci data collection driver

Following Andrew Morton's review for this patch I made a patch that
fixes most of the remarks.
I've converted the sleep_on_timeout to wait_event_timeout but I
probably not in the right way.
Also I don't know what's the problem with the calls for get_user() so
I left them untouched.

Signed-off-by: Lior Dotan <liodot@gmail.com>
Cc: Andrew Morton <akpm@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agostaging: balance parenthesis in wlan-ng headers
Mariusz Kozlowski [Sat, 18 Oct 2008 13:46:39 +0000 (15:46 +0200)]
staging: balance parenthesis in wlan-ng headers

Balance parenthesis in HFA384x_CMD_QOS_GET macro.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agostaging: fix potential build error in slicoss driver
Mariusz Kozlowski [Sat, 18 Oct 2008 13:43:27 +0000 (15:43 +0200)]
staging: fix potential build error in slicoss driver

This hides under DEBUG_REGISTER_TRACE so probably
not visible to many people.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: Fix leak in drivers/staging/at76_usb.c
Diego Calleja [Sat, 18 Oct 2008 14:53:37 +0000 (16:53 +0200)]
Staging: Fix leak in drivers/staging/at76_usb.c

Fix leak in at76_usb as reported in:
http://bugzilla.kernel.org/show_bug.cgi?id=11778

Reported-by: Daniel Marjamäki <danielm77@spray.se>
Signed-off-by: Diego Calleja <diegocg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: document 4k stack problem for winbond driver
Greg Kroah-Hartman [Mon, 20 Oct 2008 20:45:15 +0000 (13:45 -0700)]
Staging: document 4k stack problem for winbond driver

As noticed by Arjan

Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agolinux-next: build failure
Stephen Rothwell [Mon, 20 Oct 2008 11:59:18 +0000 (22:59 +1100)]
linux-next: build failure

sxghif.h has code that explicitly will not build fo other architecures.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: W35UND should depend on USB
Geert Uytterhoeven [Sat, 18 Oct 2008 20:55:41 +0000 (22:55 +0200)]
Staging: W35UND should depend on USB

W35UND should depend on USB

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: add pcc-acpi driver
Hiroshi Miura [Wed, 22 Oct 2008 16:56:28 +0000 (09:56 -0700)]
Staging: add pcc-acpi driver

Adds the pcc-acpi driver to the staging tree.

From: Hiroshi Miura <miura@da-cha.org>
Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoMerge branch 'oprofile/x86-oprofile-for-tip' into oprofile/for-linus
Robert Richter [Wed, 22 Oct 2008 10:12:06 +0000 (12:12 +0200)]
Merge branch 'oprofile/x86-oprofile-for-tip' into oprofile/for-linus

15 years agopowerpc: Support for relocatable kdump kernel
Mohan Kumar M [Tue, 21 Oct 2008 17:38:10 +0000 (17:38 +0000)]
powerpc: Support for relocatable kdump kernel

This adds relocatable kernel support for kdump. With this one can
use the same regular kernel to capture the kdump. A signature (0xfeed1234)
is passed in r6 from panic code to the next kernel through kexec_sequence
and purgatory code. The signature is used to differentiate between
kdump kernel and non-kdump kernels.

The purgatory code compares the signature and sets the __kdump_flag in
head_64.S.  During the boot up, kernel code checks __kdump_flag and if it
is set, the kernel will behave as relocatable kdump kernel. This kernel
will boot at the address where it was loaded by kexec-tools ie. at the
address reserved through crashkernel boot parameter.

CONFIG_CRASH_DUMP depends on CONFIG_RELOCATABLE option to build kdump
kernel as relocatable. So the same kernel can be used as production and
kdump kernel.

This patch incorporates the changes suggested by Paul Mackerras to avoid
GOT use and to avoid two copies of the code.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agopowerpc: Don't use a 16G page if beyond mem= limits
Jon Tollefson [Tue, 21 Oct 2008 15:27:36 +0000 (15:27 +0000)]
powerpc: Don't use a 16G page if beyond mem= limits

If mem= is used on the boot command line to limit memory then the memory block where a 16G page resides may not be available.

Thanks to Michael Ellerman for finding the problem.

Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agopowerpc: Add del_node() for early boot code to prune inapplicable devices.
Mike Ditto [Tue, 21 Oct 2008 11:32:29 +0000 (11:32 +0000)]
powerpc: Add del_node() for early boot code to prune inapplicable devices.

Some platforms have variants that can share most of a flat device tree but need
a few devices selectively pruned at boot time.  This adds del_node() to ops.h
to allow access to the existing fdt_del_node().

Signed-off-by: Mike Ditto <mditto@consentry.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agopowerpc: Further compile fixup for STRICT_MM_TYPECHECKS
David Gibson [Mon, 20 Oct 2008 17:55:29 +0000 (17:55 +0000)]
powerpc: Further compile fixup for STRICT_MM_TYPECHECKS

A patch of mine was recently committed to fix up STRICT_MM_TYPECHECKS
behaviour on powerpc (f5ea64dcbad89875d130596df14c9b25d994a737).
However, something which breaks it again seems to have slipped in
afterwards.  So, here's another small fix.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agopowerpc: Remove empty #else from signal_64.c
Michael Neuling [Wed, 15 Oct 2008 18:21:07 +0000 (18:21 +0000)]
powerpc: Remove empty #else from signal_64.c

Remove empty/bogus #else from signal_64.c

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agopowerpc: Move memory size print into common show_cpuinfo for 32-bit
Becky Bruce [Wed, 15 Oct 2008 08:25:28 +0000 (08:25 +0000)]
powerpc: Move memory size print into common show_cpuinfo for 32-bit

Most of the platforms were printing the size of the memory
in their show_cpuinfo implementations. This moves that to
the common show_cpuinfo, so that all 32-bit platforms will
now print the size of memory.  I also update the code
to deal with the fact that total_memory is now a phys_addr_t.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agohvc_console: Remove __devexit annotation of hvc_remove()
Hendrik Brueckner [Mon, 13 Oct 2008 23:12:52 +0000 (23:12 +0000)]
hvc_console: Remove __devexit annotation of hvc_remove()

Removed __devexit annotation of hvc_remove() to avoid a section mismatch
if the backend initialization fails and hvc_remove() must be used to
clean up allocated hvc structs (called in section __init or __devinit).

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agohvc_console: Add support for tty window resizing
Hendrik Brueckner [Tue, 14 Oct 2008 05:02:09 +0000 (05:02 +0000)]
hvc_console: Add support for tty window resizing

The patch provides the hvc_resize() function to update the terminal
window dimensions (struct winsize) for a specified hvc console.
The function stores the new window size and schedules a function
that finally updates the tty winsize and signals the change to
user space (SIGWINCH).
Because the winsize update must acquire a mutex and might sleep,
the function is scheduled instead of being called from hvc_poll()
or khvcd.

This patch uses the tty_do_resize() routine from the tty layer.
A pending resize work is canceled in hvc_close() and hvc_hangup().

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agohvc_console: Fix loop if put_char() returns 0
Hendrik Brueckner [Mon, 13 Oct 2008 23:12:50 +0000 (23:12 +0000)]
hvc_console: Fix loop if put_char() returns 0

If put_char() routine of a hvc console backend returns 0, then the
hvc console starts looping in the following scenarios:

1. hvc_console_print()
If put_char() returns 0 then the while loop may loop forever.
I have added the missing check for 0 to throw away console messages.

2. khvcd may loop:
The thread calls hvc_poll() --> hvc_push()... if there are still
buffered data then the HVC_POLL_WRITE bit is set and causes the
khvcd thread to loop (if yield() returns immediately).

However, instead of looping, the khvcd thread could sleep for
MIN_TIMEOUT (doing the same as for get_chars()).
The MIN_TIMEOUT is set if hvc_push() was not able to write
data to the backend. If data has been written, the timeout is
set to 0 to immediately re-schedule hvc_poll().

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> (virtio_console)
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agohvc_console: Add tty driver flag TTY_DRIVER_RESET_TERMIOS
Hendrik Brueckner [Mon, 13 Oct 2008 23:12:49 +0000 (23:12 +0000)]
hvc_console: Add tty driver flag TTY_DRIVER_RESET_TERMIOS

After a tty hangup() or close() operation, processes might not reset the
termio settings to a sane state. In order to reset the termios to its
default settings the tty driver flag TTY_DRIVER_RESET_TERMIOS has been added.

TTY driver flag description from include/linux/tty_driver.h:
TTY_DRIVER_RESET_TERMIOS --- requests the tty layer to reset the
  termios setting when the last process has closed the device.
  Used for PTY's, in particular.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agohvc_console: Add a hangup notifier for backends
Hendrik Brueckner [Mon, 13 Oct 2008 23:12:48 +0000 (23:12 +0000)]
hvc_console: Add a hangup notifier for backends

I have added a hangup notifier that can be used by hvc console
backends to handle a tty hangup. The default irq hangup notifier
calls the notifier_del_irq() for compatibility.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
15 years agomfd: check for platform_get_irq() return value in sm501
Roel Kluin [Tue, 21 Oct 2008 23:39:55 +0000 (01:39 +0200)]
mfd: check for platform_get_irq() return value in sm501

sm501_devdata->irq is unsigned, while platform_get_irq() returns a
signed int.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
15 years agomfd: use pci_ioremap_bar() in sm501
Arjan van de Ven [Sun, 28 Sep 2008 23:14:52 +0000 (16:14 -0700)]
mfd: use pci_ioremap_bar() in sm501

Use the newly introduced pci_ioremap_bar() function in drivers/mfd.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
15 years agomfd: Don't store volatile bits in WM8350 register cache
Mark Brown [Mon, 20 Oct 2008 21:58:50 +0000 (23:58 +0200)]
mfd: Don't store volatile bits in WM8350 register cache

This makes the contents of the cache clearer and fixes incorrect
initialisation of the cache for partially volatile registers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
15 years agomfd: don't export wm3850 static functions
Stephen Rothwell [Mon, 20 Oct 2008 21:55:30 +0000 (23:55 +0200)]
mfd: don't export wm3850 static functions

October 10th linux-next build (powerpc allyesconfig) failed like this:

drivers/mfd/wm8350-core.c:1131: error: __ksymtab_wm8350_create_cache causes a section type conflict

Caused by commit 89b4012befb1abca5e86d232bc0e2a797b0d9825 ("mfd: Core
support for the WM8350 AudioPlus PMIC"). wm8350_create_cache is not used
elsewhere, so remove the EXPORT_SYMBOL.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
15 years agomfd: twl4030-gpio driver
David Brownell [Mon, 20 Oct 2008 21:51:46 +0000 (23:51 +0200)]
mfd: twl4030-gpio driver

This adds basic support for the GPIOs in the twl4030 power management
chip.  That includes two open drain LED drivers, and the use of GPIO-0
(and GPIO-1) as MMC/SD card detect switches which can control whether
the VMMC1 (and VMMC2) regulators are active.

This version of the code has a debounce call that will probably be
replaced before long, when a more generic interface exists.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
15 years agomfd: rtc-twl4030 driver
David Brownell [Mon, 20 Oct 2008 21:50:05 +0000 (23:50 +0200)]
mfd: rtc-twl4030 driver

This adds a driver for the RTC inside the TWL4030 multi-function device.
It's a fairly basic RTC, with a wake-capable alarm.

Note that many of the pre-release Overo boards now in circulation can't
effectively use this RTC, because of a wiring error that puts its TWL
chip into "secure" mode.  (As in "secure yourself against tampering".)
This isn't an issue on other OMAP3 boards now supported in mainline,
such as Beagle and Labrador.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
15 years agomfd: twl4030 IRQ handling update
David Brownell [Mon, 20 Oct 2008 21:46:28 +0000 (23:46 +0200)]
mfd: twl4030 IRQ handling update

- Move it into a separate file; clean and streamline it
 - Restructure the init code for reuse during secondary dispatch
 - Support both levels (primary, secondary) of IRQ dispatch
 - Use a workqueue for irq mask/unmask and trigger configuration

Code for two subchips currently share that secondary handler code.
One is the power subchip; its IRQs are now handled by this core,
courtesy of this patch.  The other is the GPIO module, which will
be supported through a later patch.

There are also minor changes to the header file, mostly related
to GPIO support; nothing yet in mainline cares about those.  A
few references to OMAP-specific symbols are disabled; when they
can all be removed, the TWL4030 support ceases being OMAP-specific.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
15 years agostop_machine: fix error code handling on multiple cpus
Heiko Carstens [Wed, 22 Oct 2008 15:00:26 +0000 (10:00 -0500)]
stop_machine: fix error code handling on multiple cpus

Using |= for updating a value which might be updated on several cpus
concurrently will not always work since we need to make sure that the
update happens atomically.
To fix this just use a write if the called function returns an error
code on a cpu. We end up writing the error code of an arbitrary cpu
if multiple ones fail but that should be sufficient.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agostop_machine: use workqueues instead of kernel threads
Heiko Carstens [Mon, 13 Oct 2008 21:50:10 +0000 (23:50 +0200)]
stop_machine: use workqueues instead of kernel threads

Convert stop_machine to a workqueue based approach. Instead of using kernel
threads for stop_machine we now use a an rt workqueue to synchronize all
cpus.
This has the advantage that all needed per cpu threads are already created
when stop_machine gets called. And therefore a call to stop_machine won't
fail anymore. This is needed for s390 which needs a mechanism to synchronize
all cpus without allocating any memory.
As Rusty pointed out free_module() needs a non-failing stop_machine interface
as well.

As a side effect the stop_machine code gets simplified.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoworkqueue: introduce create_rt_workqueue
Heiko Carstens [Mon, 13 Oct 2008 21:50:09 +0000 (23:50 +0200)]
workqueue: introduce create_rt_workqueue

create_rt_workqueue will create a real time prioritized workqueue.
This is needed for the conversion of stop_machine to a workqueue based
implementation.
This patch adds yet another parameter to __create_workqueue_key to tell
it that we want an rt workqueue.
However it looks like we rather should have something like "int type"
instead of singlethread, freezable and rt.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
15 years agoCall init_workqueues before pre smp initcalls.
Heiko Carstens [Mon, 13 Oct 2008 21:50:08 +0000 (23:50 +0200)]
Call init_workqueues before pre smp initcalls.

This allows to create workqueues from within the context of
a pre smp initcall (aka early_initcall).

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoMake panic= and panic_on_oops into core_params
Rusty Russell [Wed, 22 Oct 2008 15:00:24 +0000 (10:00 -0500)]
Make panic= and panic_on_oops into core_params

This allows them to be examined and set after boot, plus means they
actually give errors if they are misused (eg. panic=yes).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoMake initcall_debug a core_param
Rusty Russell [Wed, 22 Oct 2008 15:00:23 +0000 (10:00 -0500)]
Make initcall_debug a core_param

This is the one I really wanted: now it effects module loading, it
makes sense to be able to flip it after boot.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
15 years agocore_param() for genuinely core kernel parameters
Rusty Russell [Wed, 22 Oct 2008 15:00:23 +0000 (10:00 -0500)]
core_param() for genuinely core kernel parameters

There are a lot of one-liner uses of __setup() in the kernel: they're
cumbersome and not queryable (definitely not settable) via /sys.  Yet
it's ugly to simplify them to module_param(), because by default that
inserts a prefix of the module name (usually filename).

So, introduce a "core_param".  The parameter gets no prefix, but
appears in /sys/module/kernel/parameters/ (if non-zero perms arg).  I
thought about using the name "core", but that's more common than
"kernel".  And if you create a module called "kernel", you will die
a horrible death.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoparam: Fix duplicate module prefixes
Rusty Russell [Wed, 22 Oct 2008 15:00:22 +0000 (10:00 -0500)]
param: Fix duplicate module prefixes

Instead of insisting each new module_param sysfs entry is unique,
handle the case where it already exists (for builtin modules).

The current code assumes that all identical prefixes are together in
the section: true for normal uses, but not necessarily so if someone
overrides MODULE_PARAM_PREFIX.  More importantly, it's not true with
the new "core_param()" code which uses "kernel" as a prefix.

This simplifies the caller for the builtin case, at a slight loss of
efficiency (we do the lookup every time to see if the directory
exists).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
15 years agomodule: check kernel param length at compile time, not runtime
Rusty Russell [Wed, 22 Oct 2008 15:00:22 +0000 (10:00 -0500)]
module: check kernel param length at compile time, not runtime

The kparam code tries to handle over-length parameter prefixes at
runtime.  Not only would I bet this has never been tested, it's not
clear that truncating names is a good idea either.

So let's check at compile time.  We need to move the #define to
moduleparam.h to do this, though.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoRemove stop_machine during module load v2
Andi Kleen [Sat, 30 Aug 2008 08:09:00 +0000 (10:09 +0200)]
Remove stop_machine during module load v2

Remove stop_machine during module load v2

module loading currently does a stop_machine on each module load to insert
the module into the global module lists.  Especially on larger systems this
can be quite expensive.

It does that to handle concurrent lock lessmodule list readers
like kallsyms.

I don't think stop_machine() is actually needed to insert something
into a list though. There are no concurrent writers because the
module mutex is taken. And the RCU list functions know how to insert
a node into a list with the right memory ordering so that concurrent
readers don't go off into the wood.

So remove the stop_machine for the module list insert and just
do a list_add_rcu() instead.

Module removal will still do a stop_machine of course, it needs
that for other reasons.

v2: Revised readers based on Paul's comments. All readers that only
    rely on disabled preemption need to be changed to list_for_each_rcu().
    Done that. The others are ok because they have the modules mutex.
    Also added a possible missing preempt disable for print_modules().

[cc Paul McKenney for review. It's not RCU, but quite similar.]

Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agomodule: simplify load_module.
Rusty Russell [Wed, 22 Oct 2008 15:00:13 +0000 (10:00 -0500)]
module: simplify load_module.

Linus' recent catch of stack overflow in load_module lead me to look
at the code.  A couple of helpers to get a section address and get
objects from a section can help clean things up a little.

(And in case you're wondering, the stack size also dropped from 328 to
284 bytes).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years ago[ARM] clps711x: add sparsemem definitions
Russell King [Tue, 21 Oct 2008 22:29:56 +0000 (23:29 +0100)]
[ARM] clps711x: add sparsemem definitions

Fix the edb7211_defconfig build errors.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years ago[ARM] 5315/1: Fix section mismatch warning (sa1111)
Kristoffer Ericson [Tue, 21 Oct 2008 18:47:22 +0000 (19:47 +0100)]
[ARM] 5315/1: Fix section mismatch warning (sa1111)

This patch fixes the section mismatch warning from
sa1111.o at buildtime.

  CC      arch/arm/common/sa1111.o
  LD      arch/arm/common/built-in.o
  LD      vmlinux.o
  MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x87f4): Section mismatch in reference from the function sa1111_probe() to the function .devinit.text:sa1110_mb_enable()
The function sa1111_probe() references
the function __devinit sa1110_mb_enable().
This is often because sa1111_probe lacks a __devinit
annotation or the annotation of sa1110_mb_enable is wrong.

Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agoide: remove useless subdirs from drivers/ide/
Bartlomiej Zolnierkiewicz [Tue, 21 Oct 2008 18:57:23 +0000 (20:57 +0200)]
ide: remove useless subdirs from drivers/ide/

Suggested-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoNOHZ: fix thinko in the timer restart code path
Thomas Gleixner [Tue, 21 Oct 2008 18:17:35 +0000 (20:17 +0200)]
NOHZ: fix thinko in the timer restart code path

commit fb02fbc14d17837b4b7b02dbb36142c16a7bf208 (NOHZ: restart tick
device from irq_enter())

solves the problem of stale jiffies when long running softirqs happen
in a long idle sleep period, but it has a major thinko in it:

When the interrupt which came in _is_ the timer interrupt which should
expire ts->sched_timer then we cancel and rearm the timer _before_ it
gets expired in hrtimer_interrupt() to the next period. That means the
call back function is not called. This game can go on for ever :(

Prevent this by making sure to only rearm the timer when the expiry
time is more than one tick_period away. Otherwise keep it running as
it is either already expired or will expiry at the right point to
update jiffies.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Venkatesch Pallipadi <venkatesh.pallipadi@intel.com>
15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
David Woodhouse [Tue, 21 Oct 2008 18:42:20 +0000 (19:42 +0100)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6

Conflicts:

drivers/pci/dmar.c

15 years agodm: tidy local_init
Kiyoshi Ueda [Tue, 21 Oct 2008 16:45:08 +0000 (17:45 +0100)]
dm: tidy local_init

This patch tidies local_init() in preparation for request-based dm.
No functional change.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: remove unused flush_all
Kiyoshi Ueda [Tue, 21 Oct 2008 16:45:07 +0000 (17:45 +0100)]
dm: remove unused flush_all

This patch removes the DM_WQ_FLUSH_ALL state that is unnecessary.

The dm_queue_flush(md, DM_WQ_FLUSH_ALL, NULL) in dm_suspend()
is never invoked because:
  - 'goto flush_and_out' is the same as 'goto out' because
    the 'goto flush_and_out' is called only when '!noflush'
  - If r is non-zero, then the code above will invoke 'goto out'
    and skip this code.

No functional change.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm raid1: separate region_hash interface part1
Heinz Mauelshagen [Tue, 21 Oct 2008 16:45:06 +0000 (17:45 +0100)]
dm raid1: separate region_hash interface part1

Separate the region hash code from raid1 so it can be shared by forthcoming
targets.  Use BUG_ON() for failed async dm_io() calls.

Signed-off-by: Heinz Mauelshagen <hjm@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: mark split bio as cloned
Martin K. Petersen [Tue, 21 Oct 2008 16:45:04 +0000 (17:45 +0100)]
dm: mark split bio as cloned

When a bio gets split, mark its fragments with the BIO_CLONED flag.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: remove waitqueue
Milan Broz [Tue, 21 Oct 2008 16:45:03 +0000 (17:45 +0100)]
dm crypt: remove waitqueue

Remove waitqueue no longer needed with the async crypto interface.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: fix async split
Milan Broz [Tue, 21 Oct 2008 16:45:02 +0000 (17:45 +0100)]
dm crypt: fix async split

When writing io, dm-crypt has to allocate a new cloned bio
and encrypt the data into newly-allocated pages attached to this bio.
In rare cases, because of hw restrictions (e.g. physical segment limit)
or memory pressure, sometimes more than one cloned bio has to be used,
each processing a different fragment of the original.

Currently there is one waitqueue which waits for one fragment to finish
and continues processing the next fragment.

But when using asynchronous crypto this doesn't work, because several
fragments may be processed asynchronously or in parallel and there is
only one crypt context that cannot be shared between the bio fragments.
The result may be corruption of the data contained in the encrypted bio.

The patch fixes this by allocating new dm_crypt_io structs (with new
crypto contexts) and running them independently.

The fragments contains a pointer to the base dm_crypt_io struct to
handle reference counting, so the base one is properly deallocated
after all the fragments are finished.

In a low memory situation, this only uses one additional object from the
mempool.  If the mempool is empty, the next allocation simple waits for
previous fragments to complete.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm crypt: tidy sector
Milan Broz [Tue, 21 Oct 2008 16:45:00 +0000 (17:45 +0100)]
dm crypt: tidy sector

Prepare local sector variable (offset) for later patch.
Do not update io->sector for still-running I/O.

No functional change.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: remove dm header from targets
Mikulas Patocka [Tue, 21 Oct 2008 16:44:59 +0000 (17:44 +0100)]
dm: remove dm header from targets

Change #include "dm.h" to #include <linux/device-mapper.h> in all targets.
Targets should not need direct access to internal DM structures.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: publish array_too_big
Mikulas Patocka [Tue, 21 Oct 2008 16:44:57 +0000 (17:44 +0100)]
dm: publish array_too_big

Move array_too_big to include/linux/device-mapper.h because it is
used by targets.

Remove the test from dm-raid1 as the number of mirror legs is limited
such that it can never fail.  (Even for stripes it seems rather
unlikely.)

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm exception store: fix misordered writes
Mikulas Patocka [Tue, 21 Oct 2008 16:44:56 +0000 (17:44 +0100)]
dm exception store: fix misordered writes

We must zero the next chunk on disk *before* writing out the current chunk, not
after.  Otherwise if the machine crashes at the wrong time, the "end of metadata"
marker may be missing.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
15 years agodm exception store: refactor zero_area
Alasdair G Kergon [Tue, 21 Oct 2008 16:44:55 +0000 (17:44 +0100)]
dm exception store: refactor zero_area

Use a separate buffer for writing zeroes to the on-disk snapshot
exception store, make the updating of ps->current_area explicit and
refactor the code in preparation for the fix in the next patch.

No functional change.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@kernel.org
15 years agodm snapshot: drop unused last_percent
Mikulas Patocka [Tue, 21 Oct 2008 16:44:53 +0000 (17:44 +0100)]
dm snapshot: drop unused last_percent

The last_percent field is unused - remove it.
(It dates from when events were triggered as each X% filled up.)

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm snapshot: fix primary_pe race
Mikulas Patocka [Tue, 21 Oct 2008 16:44:51 +0000 (17:44 +0100)]
dm snapshot: fix primary_pe race

Fix a race condition with primary_pe ref_count handling.

put_pending_exception runs under dm_snapshot->lock, it does atomic_dec_and_test
on primary_pe->ref_count, and later does atomic_read primary_pe->ref_count.

__origin_write does atomic_dec_and_test on primary_pe->ref_count without holding
dm_snapshot->lock.

This opens the following race condition:
Assume two CPUs, CPU1 is executing put_pending_exception (and holding
dm_snapshot->lock). CPU2 is executing __origin_write in parallel.
primary_pe->ref_count == 2.

CPU1:
if (primary_pe && atomic_dec_and_test(&primary_pe->ref_count))
origin_bios = bio_list_get(&primary_pe->origin_bios);
... decrements primary_pe->ref_count to 1. Doesn't load origin_bios

CPU2:
if (first && atomic_dec_and_test(&primary_pe->ref_count)) {
flush_bios(bio_list_get(&primary_pe->origin_bios));
free_pending_exception(primary_pe);
/* If we got here, pe_queue is necessarily empty. */
return r;
}
... decrements primary_pe->ref_count to 0, submits pending bios, frees
primary_pe.

CPU1:
if (!primary_pe || primary_pe != pe)
free_pending_exception(pe);
... this has no effect.
if (primary_pe && !atomic_read(&primary_pe->ref_count))
free_pending_exception(primary_pe);
... sees ref_count == 0 (written by CPU 2), does double free !!

This bug can happen only if someone is simultaneously writing to both the
origin and the snapshot.

If someone is writing only to the origin, __origin_write will submit kcopyd
request after it decrements primary_pe->ref_count (so it can't happen that the
finished copy races with primary_pe->ref_count decrementation).

If someone is writing only to the snapshot, __origin_write isn't invoked at all
and the race can't happen.

The race happens when someone writes to the snapshot --- this creates
pending_exception with primary_pe == NULL and starts copying. Then, someone
writes to the same chunk in the snapshot, and __origin_write races with
termination of already submitted request in pending_complete (that calls
put_pending_exception).

This race may be reason for bugs:
  http://bugzilla.kernel.org/show_bug.cgi?id=11636
  https://bugzilla.redhat.com/show_bug.cgi?id=465825

The patch fixes the code to make sure that:
1. If atomic_dec_and_test(&primary_pe->ref_count) returns false, the process
must no longer dereference primary_pe (because someone else may free it under
us).
2. If atomic_dec_and_test(&primary_pe->ref_count) returns true, the process
is responsible for freeing primary_pe.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
15 years agodm kcopyd: avoid queue shuffle
Kazuo Ito [Tue, 21 Oct 2008 16:44:50 +0000 (17:44 +0100)]
dm kcopyd: avoid queue shuffle

Write throughput to LVM snapshot origin volume is an order
of magnitude slower than those to LV without snapshots or
snapshot target volumes, especially in the case of sequential
writes with O_SYNC on.

The following patch originally written by Kevin Jamieson and
Jan Blunck and slightly modified for the current RCs by myself
tries to improve the performance by modifying the behaviour
of kcopyd, so that it pushes back an I/O job to the head of
the job queue instead of the tail as process_jobs() currently
does when it has to wait for free pages. This way, write
requests aren't shuffled to cause extra seeks.

I tested the patch against 2.6.27-rc5 and got the following results.
The test is a dd command writing to snapshot origin followed by fsync
to the file just created/updated.  A couple of filesystem benchmarks
gave me similar results in case of sequential writes, while random
writes didn't suffer much.

dd if=/dev/zero of=<somewhere on snapshot origin> bs=4096 count=...
   [conv=notrunc when updating]

1) linux 2.6.27-rc5 without the patch, write to snapshot origin,
average throughput (MB/s)
                     10M     100M    1000M
create,dd         511.46   610.72    11.81
create,dd+fsync     7.10     6.77     8.13
update,dd         431.63   917.41    12.75
update,dd+fsync     7.79     7.43     8.12

compared with write throughput to LV without any snapshots,
all dd+fsync and 1000 MiB writes perform very poorly.

                     10M     100M    1000M
create,dd         555.03   608.98   123.29
create,dd+fsync   114.27    72.78    76.65
update,dd         152.34  1267.27   124.04
update,dd+fsync   130.56    77.81    77.84

2) linux 2.6.27-rc5 with the patch, write to snapshot origin,
average throughput (MB/s)

                     10M     100M    1000M
create,dd         537.06   589.44    46.21
create,dd+fsync    31.63    29.19    29.23
update,dd         487.59   897.65    37.76
update,dd+fsync    34.12    30.07    26.85

Although still not on par with plain LV performance -
cannot be avoided because it's copy on write anyway -
this simple patch successfully improves throughtput
of dd+fsync while not affecting the rest.

Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Kazuo Ito <ito.kazuo@oss.ntt.co.jp>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
15 years agoV4L/DVB (9336): cx88: always de-alloc frontends on fault condition
Darron Broad [Tue, 21 Oct 2008 14:47:50 +0000 (11:47 -0300)]
V4L/DVB (9336): cx88: always de-alloc frontends on fault condition

De-alloc frontends on fault condition.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9335): videobuf: split unregister bus creating self-contained frontend de...
Darron Broad [Tue, 21 Oct 2008 14:28:46 +0000 (11:28 -0300)]
V4L/DVB (9335): videobuf: split unregister bus creating self-contained frontend de-allocator

This creates a self contained frontend de-allocator
for the instances where an adapter has not been
registered yet frontend de-allocation may
be required.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9334): cx88: dvb_remove debug output
Darron Broad [Tue, 21 Oct 2008 14:18:47 +0000 (11:18 -0300)]
V4L/DVB (9334): cx88: dvb_remove debug output

Add debug output for dvb_remove enter.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9333): cx88: Not all boards that requires cx88-mpeg has frontends
Mauro Carvalho Chehab [Tue, 21 Oct 2008 13:43:10 +0000 (10:43 -0300)]
V4L/DVB (9333): cx88: Not all boards that requires cx88-mpeg has frontends

The multifrontend changes on cx88 assumed that all boards that use cx88-mpeg
supports DVB. This is not true. There also a few analog-only boards based on
Blackboard design that also uses cx88-mpeg. For those boards, there's no need
to allocate dvb frontends.

This patch fixes videobuf allocation for those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9332): cx88: initial fix for analogue only compilation
Darron Broad [Tue, 21 Oct 2008 13:42:00 +0000 (10:42 -0300)]
V4L/DVB (9332): cx88: initial fix for analogue only compilation

Initial fix for when analogue only is selected
for compilation (ie, !CX88_DVB)

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9331): Remove unused inode parameter from video_ioctl2
Mauro Carvalho Chehab [Tue, 21 Oct 2008 14:58:39 +0000 (11:58 -0300)]
V4L/DVB (9331): Remove unused inode parameter from video_ioctl2

inode is never used on video_ioctl2. Remove it and rename the function to
__video_ioctl2. This allows its usage directly as a callback at
fops.unlocked_ioctl.

Since we still need a callback with inode to be used with fops.ioctl,
this patch adds video_ioctl2() that is just a call to __video_ioctl2().

Also, this patch adds some comments about video_ioctl2 and __video_ioctl2
usage at v4l2-ioctl.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl()
Mauro Carvalho Chehab [Tue, 21 Oct 2008 14:27:20 +0000 (11:27 -0300)]
V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl()

The inode parameter at v4l_compat_translate_ioctl() were just passed over several
places just to keep compatible with fops.ioctl. However, it weren't used anywere.

This patch gets hid of this unused parameter.

Cc: Laurent Pinchart <laurent.pinchart@skynet.be>
Cc: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9328): ivtvfb: FB_BLANK_POWERDOWN turns off video output
Ian Armstrong [Sun, 19 Oct 2008 21:58:26 +0000 (18:58 -0300)]
V4L/DVB (9328): ivtvfb: FB_BLANK_POWERDOWN turns off video output

When using FBIOBLANK, FB_BLANK_POWERDOWN will now switch off the video output.
Since some televisions turn themselves off after a while with no signal, this
is the closest we can get to power-saving.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9327): v4l: use video_device.num instead of minor in video%d
Hans Verkuil [Sun, 19 Oct 2008 21:54:26 +0000 (18:54 -0300)]
V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d

The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
independent of the minor number. So instead of using the minor field
of the video_device struct one has to use the num field: this always
contains the kernel number of the device node.

I forgot about this when I did the v4l2 core change, so this patch
converts all drivers that use it in one go. Luckily the change is
trivial.

Cc: michael@mihu.de
Cc: mchehab@infradead.org
Cc: corbet@lwn.net
Cc: luca.risolia@studio.unibo.it
Cc: isely@pobox.com
Cc: pe1rxq@amsat.org
Cc: royale@zerezo.com
Cc: mkrufky@linuxtv.org
Cc: stoth@linuxtv.org
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9326): ivtv: avoid green flashing when loading ivtv
Martin Dauskardt [Sat, 18 Oct 2008 17:59:09 +0000 (14:59 -0300)]
V4L/DVB (9326): ivtv: avoid green flashing when loading ivtv

When loading ivtv the TV-out of the PVR-350 will flash green since the
saa712x is activated before the MPEG decoder has been initialized.

Deactivate the saa712x until the MPEG decoder has been initialized.

Signed-off-by: Martin Dauskardt <martin.dauskardt@gmx.de>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9325): ivtv: switch to unlocked_ioctl.
Hans Verkuil [Sat, 18 Oct 2008 16:42:24 +0000 (13:42 -0300)]
V4L/DVB (9325): ivtv: switch to unlocked_ioctl.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9324): v4l2: add video_ioctl2_unlocked for unlocked_ioctl support.
Hans Verkuil [Sat, 18 Oct 2008 16:39:53 +0000 (13:39 -0300)]
V4L/DVB (9324): v4l2: add video_ioctl2_unlocked for unlocked_ioctl support.

Based on an older patch from Sakari Ailus.

Cc: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9323): v4l2-int-if: Add enum_framesizes and enum_frameintervals ioctls.
Sakari Ailus [Sat, 18 Oct 2008 15:29:15 +0000 (12:29 -0300)]
V4L/DVB (9323): v4l2-int-if: Add enum_framesizes and enum_frameintervals ioctls.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9322): v4l2-int-if: Export more interfaces to modules
Sakari Ailus [Sat, 18 Oct 2008 15:28:36 +0000 (12:28 -0300)]
V4L/DVB (9322): v4l2-int-if: Export more interfaces to modules

Export v4l2_int_device_try_attach_all. This allows initiating the
initialisation of int if device after the drivers have been registered.

Also allow drivers to call ioctls if v4l2-int-if was compiled as
module.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9321): v4l2-int-if: Define new power state changes
Sakari Ailus [Sat, 18 Oct 2008 15:27:50 +0000 (12:27 -0300)]
V4L/DVB (9321): v4l2-int-if: Define new power state changes

Use enum v4l2_power instead of int as second argument to
vidioc_int_s_power. The new functionality is that standby state is also
recognised.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9320): v4l2: Add 10-bit RAW Bayer formats
Sergio Aguirre [Sat, 18 Oct 2008 15:26:47 +0000 (12:26 -0300)]
V4L/DVB (9320): v4l2: Add 10-bit RAW Bayer formats

Add 10-bit raw bayer format expanded to 16 bits. Adds also definition
for 10-bit raw bayer format dpcm-compressed to 8 bits.

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9319): v4l2-int-if: Add cropcap, g_crop and s_crop commands.
Sameer Venkatraman [Sat, 18 Oct 2008 15:25:28 +0000 (12:25 -0300)]
V4L/DVB (9319): v4l2-int-if: Add cropcap, g_crop and s_crop commands.

Signed-off-by: Sameer Venkatraman <sameerv@ti.com>
Signed-off-by: Mohit Jalori <mjalori@ti.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9318): v4l2-int-if: Add command to get slave private data.
Sakari Ailus [Sat, 18 Oct 2008 15:23:45 +0000 (12:23 -0300)]
V4L/DVB (9318): v4l2-int-if: Add command to get slave private data.

vidioc_int_g_priv is used to get master's slave-related private data
structure. The structure can contain for example master's configuration
specific to slave.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9316): s5h1411: Power down s5h1411 when not in use
Devin Heitmueller [Mon, 20 Oct 2008 13:33:22 +0000 (10:33 -0300)]
V4L/DVB (9316): s5h1411: Power down s5h1411 when not in use

Power down the s5h1411 demodulator when not in use (on the Pinnacle 801e, this
brings idle power from 123ma down to 84ma).

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Acked-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9315): s5h1411: Skip reconfiguring demod modulation if already at the desire...
Devin Heitmueller [Mon, 20 Oct 2008 13:19:07 +0000 (10:19 -0300)]
V4L/DVB (9315): s5h1411: Skip reconfiguring demod modulation if already at the desired modulation

If we are already at the desired modulation, there is no need to reconfigure
the demod (at a tuning time cost)

Note that this change revealed that although the datasheet says the demod
starts out in VSB-8 mode, the first tuning was failing consistently unless
we went through the work of setting the registers.  So add a field to denote
this case so we always do the enable_frontend call, even if the first tuning
request is for VSB-8.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agoV4L/DVB (9314): s5h1411: Perform s5h1411 soft reset after tuning
Devin Heitmueller [Mon, 20 Oct 2008 13:17:08 +0000 (10:17 -0300)]
V4L/DVB (9314): s5h1411: Perform s5h1411 soft reset after tuning

If you instruct the tuner to change frequencies, it can take up to 2500ms to
get a demod lock.  By performing a soft reset after the tuning call (which
is consistent with how the Pinnacle 801e Windows driver behaves), you get
a demod lock inside of 300ms

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>