GitHub/mt8127/android_kernel_alcatel_ttab.git
16 years agosm501: gpio dynamic registration for PCI devices
Arnaud Patard [Fri, 25 Jul 2008 08:46:00 +0000 (01:46 -0700)]
sm501: gpio dynamic registration for PCI devices

The SM501 PCI card requires a dyanmic gpio allocation as the number of
cards is not known at compile time.  Fixup the platform data and
registration to deal with this.

Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501: add gpiolib support
Ben Dooks [Fri, 25 Jul 2008 08:45:59 +0000 (01:45 -0700)]
sm501: add gpiolib support

Add support for exporting the GPIOs on the SM501 via gpiolib.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Arnaud Patard <apatard@mandriva.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501: add power control callback
Ben Dooks [Fri, 25 Jul 2008 08:45:58 +0000 (01:45 -0700)]
sm501: add power control callback

Add callback to get or set the power control if the device has the sleep
connected to some form of GPIO.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoprintk ratelimiting rewrite
Dave Young [Fri, 25 Jul 2008 08:45:58 +0000 (01:45 -0700)]
printk ratelimiting rewrite

All ratelimit user use same jiffies and burst params, so some messages
(callbacks) will be lost.

For example:
a call printk_ratelimit(5 * HZ, 1)
b call printk_ratelimit(5 * HZ, 1) before the 5*HZ timeout of a, then b will
will be supressed.

- rewrite __ratelimit, and use a ratelimit_state as parameter.  Thanks for
  hints from andrew.

- Add WARN_ON_RATELIMIT, update rcupreempt.h

- remove __printk_ratelimit

- use __ratelimit in net_ratelimit

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agokallsyms: unify 32- and 64-bit code
Vegard Nossum [Fri, 25 Jul 2008 08:45:56 +0000 (01:45 -0700)]
kallsyms: unify 32- and 64-bit code

Use the %p format string which already accounts for the padding you need
with a pointer type on a particular architecture.

Also replace the macro with a static inline function to match the rest of
the file.

Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agolist debugging: use WARN() instead of BUG()
Dave Jones [Fri, 25 Jul 2008 08:45:55 +0000 (01:45 -0700)]
list debugging: use WARN() instead of BUG()

Arjan noted that the list_head debugging is BUG'ing when it detects
corruption.  By causing the box to panic immediately, we're possibly
losing some bug reports.  Changing this to a WARN() should mean we at the
least start seeing reports collected at kerneloops.org

Signed-off-by: Dave Jones <davej@redhat.com>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoExample use of WARN()
Arjan van de Ven [Fri, 25 Jul 2008 08:45:55 +0000 (01:45 -0700)]
Example use of WARN()

Now that WARN() exists, we can fold some of the printk's into it.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agokernel/irq/manage.c: replace a printk + WARN_ON() to a WARN()
Arjan van de Ven [Fri, 25 Jul 2008 08:45:54 +0000 (01:45 -0700)]
kernel/irq/manage.c: replace a printk + WARN_ON() to a WARN()

Replace a printk+WARN_ON() by a WARN(); this increases the chance of the
string making it into the bugreport (ie: it goes inside the
---[ cut here ]--- section)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoAdd a WARN() macro; this is WARN_ON() + printk arguments
Arjan van de Ven [Fri, 25 Jul 2008 08:45:53 +0000 (01:45 -0700)]
Add a WARN() macro; this is WARN_ON() + printk arguments

Add a WARN() macro that acts like WARN_ON(), with the added feature that it
takes a printk like argument that is printed as part of the warning message.

[akpm@linux-foundation.org: fix printk arguments]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRename WARN() to WARNING() to clear the namespace
Arjan van de Ven [Fri, 25 Jul 2008 08:45:52 +0000 (01:45 -0700)]
Rename WARN() to WARNING() to clear the namespace

We want to use WARN() as a variant of WARN_ON(), however a few drivers are
using WARN() internally.  This patch renames these to WARNING() to avoid the
namespace clash.  A few cases were defining but not using the thing, for those
cases I just deleted the definition.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Greg KH <greg@kroah.com>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodrivers/misc/hpilo.c needs CONFIG_PCI
Andrew Morton [Fri, 25 Jul 2008 08:45:52 +0000 (01:45 -0700)]
drivers/misc/hpilo.c needs CONFIG_PCI

m68k allmodconfig:

drivers/misc/hpilo.c: In function 'ilo_ccb_close':
drivers/misc/hpilo.c:225: error: implicit declaration of function 'pci_free_consistent'
drivers/misc/hpilo.c: In function 'ilo_ccb_open':
drivers/misc/hpilo.c:244: error: implicit declaration of function 'pci_alloc_consistent'
drivers/misc/hpilo.c:245: warning: assignment makes pointer from integer without a cast

Cc: David Altobelli <david.altobelli@hp.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodocumentation: update CodingStyle tips for Emacs users
Johannes Weiner [Fri, 25 Jul 2008 08:45:51 +0000 (01:45 -0700)]
documentation: update CodingStyle tips for Emacs users

Describe a setup that integrates better with Emacs' cc-mode and also fixes
up the alignment of continuation lines to really only use tabs.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinit/version.c: define version_string only if CONFIG_KALLSYMS is not defined
Daniel Guilak [Fri, 25 Jul 2008 08:45:50 +0000 (01:45 -0700)]
init/version.c: define version_string only if CONFIG_KALLSYMS is not defined

int Version_* is only used with ksymoops, which is only needed (according
to README and Documentation/Changes) if CONFIG_KALLSYMS is NOT defined.
Therefore this patch defines version_string only if CONFIG_KALLSYMS is not
defined.

Signed-off-by: Daniel Guilak <daniel@danielguilak.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinit/version.c: silence sparse warning by declaring the version string
Daniel Guilak [Fri, 25 Jul 2008 08:45:49 +0000 (01:45 -0700)]
init/version.c: silence sparse warning by declaring the version string

Signed-off-by: Daniel Guilak <daniel@danielguilak.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinit.h: remove obsolete content
Robert P. J. Day [Fri, 25 Jul 2008 08:45:49 +0000 (01:45 -0700)]
init.h: remove obsolete content

Remove apparently obsolete content from init.h referring to gcc 2.9x
and to "no_module_init".

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoparport: fix platform driver hotplug/coldplug
Kay Sievers [Fri, 25 Jul 2008 08:45:48 +0000 (01:45 -0700)]
parport: fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf (platform: prefix MODALIAS
with "platform:"), the platform modalias is prefixed with "platform:".
Add MODULE_ALIAS() to the hotpluggable parport platform drivers, to
re-enable auto loading.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomfd: fix platform driver hotplug/coldplug
Kay Sievers [Fri, 25 Jul 2008 08:45:47 +0000 (01:45 -0700)]
mfd: fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf (platform: prefix MODALIAS
with "platform:"), the platform modalias is prefixed with "platform:".
Add MODULE_ALIAS() to the MFD platform drivers, to re-enable auto loading.

[dbrownell@users.sourceforge.net: one was missing]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodrivers/power: fix platform driver hotplug/coldplug
Kay Sievers [Fri, 25 Jul 2008 08:45:46 +0000 (01:45 -0700)]
drivers/power: fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf ("platform: prefix MODALIAS
with "platform:"), the platform modalias is prefixed with "platform:".
Add MODULE_ALIAS() to the hotpluggable "power" drivers drivers, to
re-enable auto loading.

[dbrownell@users.sourceforge.net: one was missing]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinflate: refactor inflate malloc code
Thomas Petazzoni [Fri, 25 Jul 2008 08:45:44 +0000 (01:45 -0700)]
inflate: refactor inflate malloc code

Inflate requires some dynamic memory allocation very early in the boot
process and this is provided with a set of four functions:
malloc/free/gzip_mark/gzip_release.

The old inflate code used a mark/release strategy rather than implement
free.  This new version instead keeps a count on the number of outstanding
allocations and when it hits zero, it resets the malloc arena.

This allows removing all the mark and release implementations and unifying
all the malloc/free implementations.

The architecture-dependent code must define two addresses:
 - free_mem_ptr, the address of the beginning of the area in which
   allocations should be made
 - free_mem_end_ptr, the address of the end of the area in which
   allocations should be made. If set to 0, then no check is made on
   the number of allocations, it just grows as much as needed

The architecture-dependent code can also provide an arch_decomp_wdog()
function call.  This function will be called several times during the
decompression process, and allow to notify the watchdog that the system is
still running.  If an architecture provides such a call, then it must
define ARCH_HAS_DECOMP_WDOG so that the generic inflate code calls
arch_decomp_wdog().

Work initially done by Matt Mackall, updated to a recent version of the
kernel and improved by me.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoexec: remove some includes
Hugh Dickins [Fri, 25 Jul 2008 08:45:43 +0000 (01:45 -0700)]
exec: remove some includes

fs/exec.c used to need mman.h pagemap.h swap.h and rmap.h when it did
mm-ish stuff in install_arg_page(); but no need for them after 2.6.22.

[akpm@linux-foundation.org: unbreak arm]
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agopdflush: use time_after() instead of open-coding it
OGAWA Hirofumi [Fri, 25 Jul 2008 08:45:42 +0000 (01:45 -0700)]
pdflush: use time_after() instead of open-coding it

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoclean up duplicated alloc/free_thread_info
FUJITA Tomonori [Fri, 25 Jul 2008 08:45:40 +0000 (01:45 -0700)]
clean up duplicated alloc/free_thread_info

We duplicate alloc/free_thread_info defines on many platforms (the
majority uses __get_free_pages/free_pages).  This patch defines common
defines and removes these duplicated defines.
__HAVE_ARCH_THREAD_INFO_ALLOCATOR is introduced for platforms that do
something different.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomisc: add HP WMI laptop extras driver
Matthew Garrett [Fri, 25 Jul 2008 08:45:39 +0000 (01:45 -0700)]
misc: add HP WMI laptop extras driver

This driver adds support for reading and configuring certain information
on modern HP laptops with WMI BIOS interfaces.  It supports enabling and
disabling the ambient light sensor, querying attached displays and hard
drive temperature, sending events on docking and querying the state of the
dock and toggling the state of the wifi, bluetooth and wwan hardware via
rfkill.  It also makes the little "(i)" button work on machines that send
that via WMI rather than via the keyboard controller.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocall_usermodehelper(): increase reliability
KOSAKI Motohiro [Fri, 25 Jul 2008 08:45:38 +0000 (01:45 -0700)]
call_usermodehelper(): increase reliability

Presently call_usermodehelper_setup() uses GFP_ATOMIC.  but it can return
NULL _very_ easily.

GFP_ATOMIC is needed only when we can't sleep.  and, GFP_KERNEL is robust
and better.

thus, I add gfp_mask argument to call_usermodehelper_setup().

So, its callers pass the gfp_t as below:

call_usermodehelper() and call_usermodehelper_keys():
depend on 'wait' argument.
call_usermodehelper_pipe():
always GFP_KERNEL because always run under process context.
orderly_poweroff():
pass to GFP_ATOMIC because may run under interrupt context.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: "Paul Menage" <menage@google.com>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoremove some more tipar bits
Adrian Bunk [Fri, 25 Jul 2008 08:45:37 +0000 (01:45 -0700)]
remove some more tipar bits

Some bits were missed when the tipar driver was removed.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoasm-generic/int-ll64.h: always provide __{s,u}64
Adrian Bunk [Fri, 25 Jul 2008 08:45:36 +0000 (01:45 -0700)]
asm-generic/int-ll64.h: always provide __{s,u}64

Several compilers offer "long long" without claiming to support C99.

Considering how frequent __s64/__u64 are used our userspace headers are
anyway unusable without __s64/__u64 available.

Always offer __s64/__u64 to non-gcc non-C99 compilers - if they provide
"long long" that makes the headers compiling and if they don't they are
anyway screwed.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agobuild-kernel-profileo-only-when-requested-cleanups
Andrew Morton [Fri, 25 Jul 2008 08:45:35 +0000 (01:45 -0700)]
build-kernel-profileo-only-when-requested-cleanups

Cc: Adrian Bunk <bunk@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agobuild kernel/profile.o only when requested
Adrian Bunk [Fri, 25 Jul 2008 08:45:35 +0000 (01:45 -0700)]
build kernel/profile.o only when requested

Build kernel/profile.o only if CONFIG_PROFILING is enabled.

This makes CONFIG_PROFILING=n kernels smaller.

As a bonus, some profile_tick() calls and one branch from schedule() are
now eliminated with CONFIG_PROFILING=n (but I doubt these are
measurable effects).

This patch changes the effects of CONFIG_PROFILING=n, but I don't think
having more than two choices would be the better choice.

This patch also adds the name of the first parameter to the prototypes
of profile_{hits,tick}() since I anyway had to add them for the dummy
functions.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agolist_for_each_rcu must die: networking
Paul E. McKenney [Fri, 25 Jul 2008 08:45:34 +0000 (01:45 -0700)]
list_for_each_rcu must die: networking

All uses of list_for_each_rcu() can be profitably replaced by the
easier-to-use list_for_each_entry_rcu().  This patch makes this change for
networking, in preparation for removing the list_for_each_rcu() API
entirely.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agokallsyms: fix potential overflow in binary search
Vegard Nossum [Fri, 25 Jul 2008 08:45:34 +0000 (01:45 -0700)]
kallsyms: fix potential overflow in binary search

This will probably never trigger... but it won't hurt to be careful.

http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Joshua Bloch <jjb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agointroduce HAVE_EFFICIENT_UNALIGNED_ACCESS Kconfig symbol
Johannes Berg [Fri, 25 Jul 2008 08:45:33 +0000 (01:45 -0700)]
introduce HAVE_EFFICIENT_UNALIGNED_ACCESS Kconfig symbol

In many cases, especially in networking, it can be beneficial to know at
compile time whether the architecture can do unaligned accesses efficiently.
This patch introduces a new Kconfig symbol

HAVE_EFFICIENT_UNALIGNED_ACCESS

for that purpose and adds it to the powerpc and x86 architectures.  Also add
some documentation about alignment and networking, and especially one intended
use of this symbol.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Ingo Molnar <mingo@elte.hu> [x86 architecture part]
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agolists: remove a redundant conditional definition of list_add()
Robert P. J. Day [Fri, 25 Jul 2008 08:45:32 +0000 (01:45 -0700)]
lists: remove a redundant conditional definition of list_add()

Remove the conditional surrounding the definition of list_add() from list.h
since, if you define CONFIG_DEBUG_LIST, the definition you will subsequently
pick up from lib/list_debug.c will be absolutely identical, at which point you
can remove that redundant definition from list_debug.c as well.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agolib: allow memparse() to accept a NULL and ignorable second parm
Robert P. J. Day [Fri, 25 Jul 2008 08:45:31 +0000 (01:45 -0700)]
lib: allow memparse() to accept a NULL and ignorable second parm

Extend memparse() to allow the caller to use a NULL second parameter, which
would represent no interest in returning the address of the end of the parsed
string.

In numerous cases, callers invoke memparse() to parse a possibly-suffixed
string (such as "64K" or "2G" or whatever) and define a character pointer to
accept the end pointer being returned by memparse() even though they have no
interest in it and promptly throw it away.

This (backward-compatible) enhancement allows callers to use NULL in the cases
where they just don't care about getting back that end pointer.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinit/: delete hard-coded setting and testing of BUILD_CRAMDISK
Robert P. J. Day [Fri, 25 Jul 2008 08:45:30 +0000 (01:45 -0700)]
init/: delete hard-coded setting and testing of BUILD_CRAMDISK

There seems to be little point in explicitly setting, then testing the macro
BUILD_CRAMDISK within the context of a single source file.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRemove apparently unused fd1772.h header file.
Robert P. J. Day [Fri, 25 Jul 2008 08:45:29 +0000 (01:45 -0700)]
Remove apparently unused fd1772.h header file.

This header file has been unused for quite some time, and the
corresponding source files appear to have been removed back in commit
99eb8a550dbccc0e1f6c7e866fe421810e0585f6 ("Remove the arm26 port")

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Ian Molton <spyro@f2s.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinit/do_mounts.c should #include <linux/initrd.h>
Adrian Bunk [Fri, 25 Jul 2008 08:45:29 +0000 (01:45 -0700)]
init/do_mounts.c should #include <linux/initrd.h>

Every file should include the headers containing the externs for its
global code (in this case for rd_doload).

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofix checkstack.pl arch detection
Eric Sandeen [Fri, 25 Jul 2008 08:45:28 +0000 (01:45 -0700)]
fix checkstack.pl arch detection

uname -m was leaving a newline in $arch, and not passing the tests.

Also, printing the unknown arch on failure is probably helpful.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofind dynamic stack allocations in checkstack.pl
Eric Sandeen [Fri, 25 Jul 2008 08:45:27 +0000 (01:45 -0700)]
find dynamic stack allocations in checkstack.pl

Currently, checkstack.pl only looks for fixed subtractions from the stack
pointer.  However, things like this:

void function(int size)
{
        char stackbuster[size << 2];
...

are certainly worth pointing out, I think.

This could perhaps be done more cleanly, and the following patch only
adds "dynamic" REs for x86 and x86_64, but it works:

0x00b0 crypto_cbc_decrypt_inplace [cbc]:                Dynamic (%rax)
0x00ad crypto_pcbc_decrypt_inplace [pcbc]:              Dynamic (%rax)
0x02f6 crypto_pcbc_encrypt_inplace [pcbc]:              Dynamic (%rax)
0x036c _crypto_xcbc_digest_setkey [xcbc]:               Dynamic (%rax)
...

(Inspired by Keith Owens' old stack-check script)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agolzo: use get/put_unaligned_* helpers
Harvey Harrison [Fri, 25 Jul 2008 08:45:27 +0000 (01:45 -0700)]
lzo: use get/put_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinclude: use get/put_unaligned_* helpers
Harvey Harrison [Fri, 25 Jul 2008 08:45:26 +0000 (01:45 -0700)]
include: use get/put_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofs: ldm.[ch] use get_unaligned_* helpers
Harvey Harrison [Fri, 25 Jul 2008 08:45:25 +0000 (01:45 -0700)]
fs: ldm.[ch] use get_unaligned_* helpers

Replace the private BE16/BE32/BE64 macros with direct calls to
get_unaligned_be16/32/64.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agolocking: add typecheck on irqsave and friends for correct flags
Steven Rostedt [Fri, 25 Jul 2008 08:45:25 +0000 (01:45 -0700)]
locking: add typecheck on irqsave and friends for correct flags

There haave been several areas in the kernel where an int has been used for
flags in local_irq_save() and friends instead of a long.  This can cause some
hard to debug problems on some architectures.

This patch adds a typecheck inside the irqsave and restore functions to flag
these cases.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: build fix]
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosplit the typecheck macros out of include/linux/kernel.h
Andrew Morton [Fri, 25 Jul 2008 08:45:24 +0000 (01:45 -0700)]
split the typecheck macros out of include/linux/kernel.h

Needed to fix up a recursive include snafu in
locking-add-typecheck-on-irqsave-and-friends-for-correct-flags.patch

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoflag parameters: fix compile error of sys_epoll_create1
Wang Chen [Fri, 25 Jul 2008 08:45:23 +0000 (01:45 -0700)]
flag parameters: fix compile error of sys_epoll_create1

GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      vmlinux
arch/x86/kernel/built-in.o: In function `sys_call_table':
(.rodata+0x8a4): undefined reference to `sys_epoll_create1'
make: *** [vmlinux] Error 1

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomfd: don't use memzero
Andrew Morton [Fri, 25 Jul 2008 08:45:22 +0000 (01:45 -0700)]
mfd: don't use memzero

For it doesn't exist on i386.

Cc: Ian Molton <spyro@f2s.com>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoendian: Always evaluate arguments.
David Miller [Fri, 25 Jul 2008 06:38:31 +0000 (23:38 -0700)]
endian: Always evaluate arguments.

Changeset 7fa897b91a3ea0f16c2873b869d7a0eef05acff4 ("ide: trivial sparse
annotations") created an IDE bootup regression on big-endian systems.

In drivers/ide/ide-iops.c, function ide_fixstring() we now have the
loop:

for (p = end ; p != s;)
be16_to_cpus((u16 *)(p -= 2));

which will never terminate on big-endian because in such
a configuration be16_to_cpus() evaluates to "do { } while (0)"

Therefore, always evaluate the arguments to nop endian transformation
operations.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agochar/xilinx_hwicap/xilinx_hwicap.c: Removed duplicated include
Huang Weiyi [Fri, 25 Jul 2008 15:30:15 +0000 (23:30 +0800)]
char/xilinx_hwicap/xilinx_hwicap.c: Removed duplicated include

Removed duplicated include file <linux/version.h> in
char/xilinx_hwicap/xilinx_hwicap.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoUndo duplicate "m68k: drivers/input/serio/hp_sdc.c needs <linux/semaphore.h>"
Linus Torvalds [Fri, 25 Jul 2008 16:19:36 +0000 (09:19 -0700)]
Undo duplicate "m68k: drivers/input/serio/hp_sdc.c needs <linux/semaphore.h>"

Both commits 0f17e4c796e89d1f69f13b653aba60e6ccfb8ae0 ("Add missing
semaphore.h includes") and 4933d07531711e399d8d578036aa9fc1be2f9b20
("m68k: drivers/input/serio/hp_sdc.c needs <linux/semaphore.h>") added a

We only really need one ;)

Reported-by: Huang Weiyi <weiyi.huang@gmail.com>
Requested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Fri, 25 Jul 2008 02:11:49 +0000 (19:11 -0700)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  virtio: Add transport feature handling stub for virtio_ring.
  virtio: Rename set_features to finalize_features
  virtio: Formally reserve bits 28-31 to be 'transport' features.
  s390: use virtio_console for KVM on s390
  virtio: console as a config option
  virtio_console: use virtqueue notification for hvc_console
  hvc_console: rework setup to replace irq functions with callbacks
  virtio_blk: check for hardsector size from host
  virtio: Use bus_type probe and remove methods
  virtio: don't always force a notification when ring is full
  virtio: clarify that ABI is usable by any implementations
  virtio: Recycle unused recv buffer pages for large skbs in net driver
  virtio net: Allow receiving SG packets
  virtio net: Add ethtool ops for SG/GSO
  virtio: fix virtio_net xmit of freed skb bug

16 years agoLabel kthread_create() with printf attribute tag.
Rusty Russell [Fri, 25 Jul 2008 02:11:09 +0000 (12:11 +1000)]
Label kthread_create() with printf attribute tag.

Obvious misc patch been in my queue (& linux-next) for over a cycle.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agovirtio: Add transport feature handling stub for virtio_ring.
Rusty Russell [Fri, 25 Jul 2008 17:06:13 +0000 (12:06 -0500)]
virtio: Add transport feature handling stub for virtio_ring.

To prepare for virtio_ring transport feature bits, hook in a call in
all the users to manipulate them.  This currently just clears all the
bits, since it doesn't understand any features.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio: Rename set_features to finalize_features
Rusty Russell [Fri, 25 Jul 2008 17:06:07 +0000 (12:06 -0500)]
virtio: Rename set_features to finalize_features

Rather than explicitly handing the features to the lower-level, we just
hand the virtio_device and have it set the features.  This make it clear
that it has the chance to manipulate the features of the device at this
point (and that all feature negotiation is already done).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio: Formally reserve bits 28-31 to be 'transport' features.
Rusty Russell [Fri, 25 Jul 2008 17:06:07 +0000 (12:06 -0500)]
virtio: Formally reserve bits 28-31 to be 'transport' features.

We assign feature bits as required, but it makes sense to reserve some
for the particular transport, rather than the particular device.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agos390: use virtio_console for KVM on s390
Christian Borntraeger [Fri, 20 Jun 2008 13:24:18 +0000 (15:24 +0200)]
s390: use virtio_console for KVM on s390

This patch enables virtio_console as the default console on kvm for
s390. We currently use the same notify hack as lguest for early
console output. I will try to address this for lguest and s390 later.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio: console as a config option
Christian Borntraeger [Fri, 25 Jul 2008 17:06:06 +0000 (12:06 -0500)]
virtio: console as a config option

I also added a small Kconfig change that allows the user to specify the
virtio console in menuconfig.

(Fixes to export symbols from Stephen Rothwell <sfr@canb.auug.org.au>)
(Fixes for CONFIG_VIRTIO_CONSOLE=y vs CONFIG_VIRTIO=m from Christian himself)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
16 years agovirtio_console: use virtqueue notification for hvc_console
Christian Borntraeger [Fri, 20 Jun 2008 13:24:15 +0000 (15:24 +0200)]
virtio_console: use virtqueue notification for hvc_console

This patch exploits the new notifier callbacks of the hvc_console. We can
use the virtio callbacks instead of the polling code.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agohvc_console: rework setup to replace irq functions with callbacks
Christian Borntraeger [Fri, 20 Jun 2008 13:24:08 +0000 (15:24 +0200)]
hvc_console: rework setup to replace irq functions with callbacks

This patch tries to change hvc_console to not use request_irq/free_irq if
the backend does not use irqs. This allows virtio_console to use hvc_console
without having a linker reference to request_irq/free_irq.

In addition, together with patch 2/3 it improves the performance for virtio
console input. (an earlier version of this patch was tested by Yajin on lguest)

The irq specific code is moved to hvc_irq.c and selected by the drivers that
use irqs (System p, System i, XEN).

I replaced "int irq" with the opaque "int data". The request_irq and
free_irq calls are replaced with notifier_add and notifier_del. I have also
changed the code a bit to call the notifier_add and notifier_del inside the
spinlock area as the callbacks are found via hp->ops.

Changes since last version:
o remove ifdef
o reintroduce "irq_requested" as "notified"
o cleanups, sparse..

I did not move the timer based polling into a separate polling scheme. I
played with several variants, but it seems we need to sleep/schedule in
a thread even for irq based consoles, as there are throttleing and buffer
size constraints.

I also kept hvc_struct defined in hvc_console.h so that hvc_irq.c can access
the irq_requested element.

Feedback is appreciated. virtio_console is currently the only available console
for kvm on s390. I plan to push this change as soon as all affected parties
agree on it. I would love to get test results from System p, Xen etc.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio_blk: check for hardsector size from host
Christian Borntraeger [Thu, 29 May 2008 09:08:26 +0000 (11:08 +0200)]
virtio_blk: check for hardsector size from host

Currently virtio_blk assumes a 512 byte hard sector size. This can cause
trouble / performance issues if the backing has a different block size
(like a file on an ext3 file system formatted with 4k block size or a dasd).

Lets add a feature flag that tells the guest to use a different hard sector
size than 512 byte.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio: Use bus_type probe and remove methods
Mark McLoughlin [Fri, 13 Jun 2008 12:46:40 +0000 (13:46 +0100)]
virtio: Use bus_type probe and remove methods

Hook up to the probe() and remove() methods in bus_type
rather than device_driver. The latter has been preferred
since 2.6.16.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio: don't always force a notification when ring is full
Rusty Russell [Fri, 25 Jul 2008 17:06:04 +0000 (12:06 -0500)]
virtio: don't always force a notification when ring is full

We force notification when the ring is full, even if the host has
indicated it doesn't want to know.  This seemed like a good idea at
the time: if we fill the transmit ring, we should tell the host
immediately.

Unfortunately this logic also applies to the receiving ring, which is
refilled constantly.  We should introduce real notification thesholds
to replace this logic.  Meanwhile, removing the logic altogether breaks
the heuristics which KVM uses, so we use a hack: only notify if there are
outgoing parts of the new buffer.

Here are the number of exits with lguest's crappy network implementation:
Before:
network xmit 7859051 recv 236420
After:
network xmit 7858610 recv 118136

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio: clarify that ABI is usable by any implementations
Rusty Russell [Fri, 25 Jul 2008 17:06:03 +0000 (12:06 -0500)]
virtio: clarify that ABI is usable by any implementations

We want others to implement and use virtio, so it makes sense to BSD
license the non-__KERNEL__ parts of the headers to make this crystal
clear.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Mark McLoughlin <markmc@redhat.com>
Acked-by: Ryan Harper <ryanh@us.ibm.com>
Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
Acked-by: Anthony Liguori <aliguori@us.ibm.com>
16 years agovirtio: Recycle unused recv buffer pages for large skbs in net driver
Rusty Russell [Fri, 25 Jul 2008 17:06:01 +0000 (12:06 -0500)]
virtio: Recycle unused recv buffer pages for large skbs in net driver

If we hack the virtio_net driver to always allocate full-sized (64k+)
skbuffs, the driver slows down (lguest numbers):

  Time to receive 1GB (small buffers): 10.85 seconds
  Time to receive 1GB (64k+ buffers): 24.75 seconds

Of course, large buffers use up more space in the ring, so we increase
that from 128 to 2048:

  Time to receive 1GB (64k+ buffers, 2k ring): 16.61 seconds

If we recycle pages rather than using alloc_page/free_page:

  Time to receive 1GB (64k+ buffers, 2k ring, recycle pages): 10.81 seconds

This demonstrates that with efficient allocation, we don't need to
have a separate "small buffer" queue.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio net: Allow receiving SG packets
Herbert Xu [Fri, 18 Apr 2008 03:24:27 +0000 (11:24 +0800)]
virtio net: Allow receiving SG packets

Finally this patch lets virtio_net receive GSO packets in addition
to sending them.  This can definitely be optimised for the non-GSO
case.  For comparison the Xen approach stores one page in each skb
and uses subsequent skb's pages to construct an SG skb instead of
preallocating the maximum amount of pages per skb.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (added feature bits)
16 years agovirtio net: Add ethtool ops for SG/GSO
Herbert Xu [Fri, 18 Apr 2008 03:21:42 +0000 (11:21 +0800)]
virtio net: Add ethtool ops for SG/GSO

This patch adds some basic ethtool operations to virtio_net so
I could test SG without GSO (which was really useful because TSO
turned out to be buggy :)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (remove MTU setting)
16 years agovirtio: fix virtio_net xmit of freed skb bug
Mark McLoughlin [Tue, 27 May 2008 11:06:26 +0000 (12:06 +0100)]
virtio: fix virtio_net xmit of freed skb bug

On Mon, 2008-05-26 at 17:42 +1000, Rusty Russell wrote:
> If we fail to transmit a packet, we assume the queue is full and put
> the skb into last_xmit_skb.  However, if more space frees up before we
> xmit it, we loop, and the result can be transmitting the same skb twice.
>
> Fix is simple: set skb to NULL if we've used it in some way, and check
> before sending.
...
> diff -r 564237b31993 drivers/net/virtio_net.c
> --- a/drivers/net/virtio_net.c Mon May 19 12:22:00 2008 +1000
> +++ b/drivers/net/virtio_net.c Mon May 19 12:24:58 2008 +1000
> @@ -287,21 +287,25 @@ again:
>   free_old_xmit_skbs(vi);
>
>   /* If we has a buffer left over from last time, send it now. */
> - if (vi->last_xmit_skb) {
> + if (unlikely(vi->last_xmit_skb)) {
>   if (xmit_skb(vi, vi->last_xmit_skb) != 0) {
>   /* Drop this skb: we only queue one. */
>   vi->dev->stats.tx_dropped++;
>   kfree_skb(skb);
> + skb = NULL;
>   goto stop_queue;
>   }
>   vi->last_xmit_skb = NULL;

With this, may drop an skb and then later in the function discover that
we could have sent it after all. Poor wee skb :)

How about the incremental patch below?

Cheers,
Mark.

Subject: [PATCH] virtio_net: Delay dropping tx skbs

Currently we drop the skb in start_xmit() if we have a
queued buffer and fail to transmit it.

However, if we delay dropping it until we've stopped the
queue and enabled the tx notification callback, then there
is a chance space might become available for it.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agofix fs/nfs/nfsroot.c compilation
Adrian Bunk [Thu, 24 Jul 2008 23:55:49 +0000 (02:55 +0300)]
fix fs/nfs/nfsroot.c compilation

This fixes the following compile error caused by commit
f9247273cb69ba101877e946d2d83044409cc8c5 ("UFS: add const to parser
token table"):

    CC      fs/nfs/nfsroot.o
  /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/nfs/nfsroot.c:130: error: tokens causes a section type conflict
  make[3]: *** [fs/nfs/nfsroot.o] Error 1

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86/oprofile/nmi_int: add Nehalem to list of ppro cores
Linus Torvalds [Fri, 25 Jul 2008 00:29:00 +0000 (17:29 -0700)]
x86/oprofile/nmi_int: add Nehalem to list of ppro cores

..otherwise oprofile will fall back on that poor timer interrupt.

Also replace the unreadable chain of if-statements with a "switch()"
statement instead. It generates better code, and is a lot clearer.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86-64: Clean up 'save/restore_i387()' usage
Linus Torvalds [Thu, 24 Jul 2008 22:43:44 +0000 (15:43 -0700)]
x86-64: Clean up 'save/restore_i387()' usage

Suresh Siddha wants to fix a possible FPU leakage in error conditions,
but the fact that save/restore_i387() are inlines in a header file makes
that harder to do than necessary.  So start off with an obvious cleanup.

This just moves the x86-64 version of save/restore_i387() out of the
header file, and moves it to the only file that it is actually used in:
arch/x86/kernel/signal_64.c.  So exposing it in a header file was wrong
to begin with.

[ Side note: I'd like to fix up some of the games we play with the
  32-bit version of these functions too, but that's a separate
  matter.  The 32-bit versions are shared - under different names
  at that! - by both the native x86-32 code and the x86-64 32-bit
  compatibility code ]

Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Thu, 24 Jul 2008 21:55:09 +0000 (14:55 -0700)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (76 commits)
  ide: use proper printk() KERN_* levels in ide-probe.c
  ide: fix for EATA SCSI HBA in ATA emulating mode
  ide: remove stale comments from drivers/ide/Makefile
  ide: enable local IRQs in all handlers for TASKFILE_NO_DATA data phase
  ide-scsi: remove kmalloced struct request
  ht6560b: remove old history
  ht6560b: update email address
  ide-cd: fix oops when using growisofs
  gayle: release resources on ide_host_add() failure
  palm_bk3710: add UltraDMA/100 support
  ide: trivial sparse annotations
  ide: ide-tape.c sparse annotations and unaligned access removal
  ide: drop 'name' parameter from ->init_chipset method
  ide: prefix messages from IDE PCI host drivers by driver name
  it821x: remove DECLARE_ITE_DEV() macro
  it8213: remove DECLARE_ITE_DEV() macro
  ide: include PCI device name in messages from IDE PCI host drivers
  ide: remove <asm/ide.h> for some archs
  ide-generic: remove ide_default_{io_base,irq}() inlines (take 3)
  ide-generic: is no longer needed on ppc32
  ...

16 years agoMerge branch 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak...
Linus Torvalds [Thu, 24 Jul 2008 20:57:37 +0000 (13:57 -0700)]
Merge branch 'release-2.6.27' of git://git./linux/kernel/git/ak/linux-acpi-2.6

* 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6:
  acpi: fix crash in core ACPI code, triggered by CONFIG_ACPI_PCI_SLOT=y
  ACPI: thinkpad-acpi: don't misdetect in get_thinkpad_model_data() on -ENOMEM
  ACPI: thinkpad-acpi: bump up version to 0.21
  ACPI: thinkpad-acpi: add bluetooth and WWAN rfkill support
  ACPI: thinkpad-acpi: WLSW overrides other rfkill switches
  ACPI: thinkpad-acpi: prepare for bluetooth and wwan rfkill support
  ACPI: thinkpad-acpi: consolidate wlsw notification function
  ACPI: thinkpad-acpi: minor refactor on radio switch init
  Revert "ACPI: don't walk tables if ACPI was disabled"
  Revert "dock: bay: Don't call acpi_walk_namespace() when ACPI is disabled."
  Revert "Fix FADT parsing"
  ACPI : Set FAN device to correct state in boot phase
  ACPI: Ignore _BQC object when registering backlight device
  ACPI: stop complaints about interrupt link End Tags and blank IRQ descriptors

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Thu, 24 Jul 2008 20:57:13 +0000 (13:57 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: fixup sparse endianness warnings in proc.c
  PCI PM: make more PCI PM core functionality available to drivers
  PCI/DMAR: don't assume presence of RMRRs
  PCI hotplug: fix error path in pci_slot's register_slot

16 years agoide: use proper printk() KERN_* levels in ide-probe.c
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:36 +0000 (22:53 +0200)]
ide: use proper printk() KERN_* levels in ide-probe.c

While at it:

- fixup printk() messages in save_match() and hwif_init().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix for EATA SCSI HBA in ATA emulating mode
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:36 +0000 (22:53 +0200)]
ide: fix for EATA SCSI HBA in ATA emulating mode

IDE probing code used to skip devices attached to EATA SCSI HBA
in ATA emulating mode but because of warm-plug support port I/O
resources are no longer freed if no devices are detected on a port
and the decision about the driver to use is left up to the user.

Remove no longer valid EATA SCSI HBA quirk from do_identify().

Noticed-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove stale comments from drivers/ide/Makefile
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:36 +0000 (22:53 +0200)]
ide: remove stale comments from drivers/ide/Makefile

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: enable local IRQs in all handlers for TASKFILE_NO_DATA data phase
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:36 +0000 (22:53 +0200)]
ide: enable local IRQs in all handlers for TASKFILE_NO_DATA data phase

It is already done by task_no_data_intr() and there is no reason
not to do it in other TASKFILE_NO_DATA data phase handlers.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-scsi: remove kmalloced struct request
FUJITA Tomonori [Thu, 24 Jul 2008 20:53:35 +0000 (22:53 +0200)]
ide-scsi: remove kmalloced struct request

This converts ide-scsi to use blk_get/put_request instead of
kmalloc/kfree.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoht6560b: remove old history
Jan Evert van Grootheest [Thu, 24 Jul 2008 20:53:35 +0000 (22:53 +0200)]
ht6560b: remove old history

Remove the ancient version history. Git does a better job.

From: Jan Evert van Grootheest <j.e.van.grootheest@caiway.nl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoht6560b: update email address
Jan Evert van Grootheest [Thu, 24 Jul 2008 20:53:35 +0000 (22:53 +0200)]
ht6560b: update email address

Update email address.

From: Jan Evert van Grootheest <j.e.van.grootheest@caiway.nl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix oops when using growisofs
Jens Axboe [Thu, 24 Jul 2008 20:53:35 +0000 (22:53 +0200)]
ide-cd: fix oops when using growisofs

cdrom_read_capacity() will blindly return the capacity from the device
without sanity-checking it.  This later causes code in fs/buffer.c to
oops.

Fix this by checking that the device is telling us sensible things.

From: Jens Axboe <jens.axboe@oracle.com>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Jan Kara <jack@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: <stable@kernel.org>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[bart: print device name instead of driver name]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
[harvey: blocklen is a big-endian value]
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agogayle: release resources on ide_host_add() failure
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:34 +0000 (22:53 +0200)]
gayle: release resources on ide_host_add() failure

"gayle: reserve memory resources at once" patch temporary removed
freeing of resources on failure (to ease convertion to ide_host_add()
interface).  This patch fixes it.

Thanks to Geert for noticing the issue.

Noticed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopalm_bk3710: add UltraDMA/100 support
Sergei Shtylyov [Thu, 24 Jul 2008 20:53:34 +0000 (22:53 +0200)]
palm_bk3710: add UltraDMA/100 support

This controller supports UltraDMA up to mode 5 but it should be clocked with
at least twice the data strobe frequency, so enable mode 5 for 100+ MHz IDECLK.

While at it, start passing the correct device to clk_get() -- it worked anyway
but WTF? :-/

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: trivial sparse annotations
Harvey Harrison [Thu, 24 Jul 2008 20:53:34 +0000 (22:53 +0200)]
ide: trivial sparse annotations

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: ide-tape.c sparse annotations and unaligned access removal
Harvey Harrison [Thu, 24 Jul 2008 20:53:33 +0000 (22:53 +0200)]
ide: ide-tape.c sparse annotations and unaligned access removal

If this is actually unaligned the access of speed/max_speed above
is already broken and needs a get_unaligned.  Otherwise it is
aligned and they can be removed.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: drop 'name' parameter from ->init_chipset method
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:33 +0000 (22:53 +0200)]
ide: drop 'name' parameter from ->init_chipset method

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: prefix messages from IDE PCI host drivers by driver name
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:32 +0000 (22:53 +0200)]
ide: prefix messages from IDE PCI host drivers by driver name

Prefix messages from IDE PCI host drivers by driver name instead of marketed
chipset name (it is still possible to exactly identify the particular chipset
basing on driver messages).

As a bonus this provides nice code savings for some drivers:

   text    data     bss     dec     hex filename
   3826     112       8    3946     f6a drivers/ide/pci/amd74xx.o.before
   2786     112       8    2906     b5a drivers/ide/pci/amd74xx.o.after
    764     108       0     872     368 drivers/ide/pci/cs5520.o.before
    680     108       0     788     314 drivers/ide/pci/cs5520.o.after
   1680     112       4    1796     704 drivers/ide/pci/generic.o.before
   1155     112       4    1271     4f7 drivers/ide/pci/generic.o.after
   7128     792       0    7920    1ef0 drivers/ide/pci/hpt366.o.before
   6984     792       0    7776    1e60 drivers/ide/pci/hpt366.o.after
   2800     148       0    2948     b84 drivers/ide/pci/pdc202xx_new.o.before
   2523     148       0    2671     a6f drivers/ide/pci/pdc202xx_new.o.after
   2831     148       0    2979     ba3 drivers/ide/pci/pdc202xx_old.o.before
   2683     148       0    2831     b0f drivers/ide/pci/pdc202xx_old.o.after
   3776     112       4    3892     f34 drivers/ide/pci/piix.o.before
   2804     112       4    2920     b68 drivers/ide/pci/piix.o.after
   4693     116       0    4809    12c9 drivers/ide/pci/siimage.o.before
   4600     116       0    4716    126c drivers/ide/pci/siimage.o.after

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoit821x: remove DECLARE_ITE_DEV() macro
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:32 +0000 (22:53 +0200)]
it821x: remove DECLARE_ITE_DEV() macro

While at it:

* it821x_chipsets[] -> it821x_chipset.

* Fix it821x_chipset's name field (as it is used for IT8211/8212).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoit8213: remove DECLARE_ITE_DEV() macro
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:32 +0000 (22:53 +0200)]
it8213: remove DECLARE_ITE_DEV() macro

While at it:

* it8213_chipsets[] -> it8213_chipset.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: include PCI device name in messages from IDE PCI host drivers
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:31 +0000 (22:53 +0200)]
ide: include PCI device name in messages from IDE PCI host drivers

While at it:

* Apply small fixes to messages (s/dma/DMA/, remove trailing '.', etc).

* Fix printk() call in ide_setup_pci_baseregs() to use KERN_INFO.

* Move printk() call from ide_pci_clear_simplex() to the caller.

* Cleanup do_ide_setup_pci_device() a bit.

* amd74xx.c: remove superfluous PCI device revision information.

* hpt366.c: fix two printk() calls in ->init_chipset to use KERN_INFO.

* pdc202xx_new.c: fix printk() call in ->init_chipset to use KERN_INFO.

* pdc202xx_old.c: fix driver message in pdc202xx_init_one().

* via82cxxx.c: fix driver warning message in via_init_one().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove <asm/ide.h> for some archs
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:31 +0000 (22:53 +0200)]
ide: remove <asm/ide.h> for some archs

* Remove <linux/irq.h> include from <asm-ia64.h> (<linux/ide.h> includes
  <linux/interrupt.h> which is enough).

* Remove <asm/ide.h> for alpha/blackfin/h8300/ia64/m32r/sh/x86/xtensa
  (this leaves us with arm/frv/m68k/mips/mn10300/parisc/powerpc/sparc[64]).

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: remove ide_default_{io_base,irq}() inlines (take 3)
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:31 +0000 (22:53 +0200)]
ide-generic: remove ide_default_{io_base,irq}() inlines (take 3)

Replace ide_default_{io_base,irq}() inlines by legacy_{bases,irqs}[].

v2:
Add missing zero-ing of hws[] (caught during testing by Borislav Petkov).

v3:
Fix zero-oing of hws[] for _real_ this time.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: is no longer needed on ppc32
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:30 +0000 (22:53 +0200)]
ide-generic: is no longer needed on ppc32

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: remove broken PPC_PREP support
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:30 +0000 (22:53 +0200)]
ide-generic: remove broken PPC_PREP support

PPC_PREP has been depending on BROKEN for some time now.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: define MAX_HWIFS in <linux/ide.h>
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:30 +0000 (22:53 +0200)]
ide: define MAX_HWIFS in <linux/ide.h>

* Now that ide_hwif_t instances are allocated dynamically
  the difference between MAX_HWIFS == 2 and MAX_HWIFS == 10
  is ~100 bytes (x86-32) so use MAX_HWIFS == 10 on all archs
  except these ones that use MAX_HWIFS == 1.

* Define MAX_HWIFS in <linux/ide.h> instead of <asm/ide.h>.

[ Please note that avr32/cris/v850 have no <asm/ide.h>
  and alpha/ia64/sh always define CONFIG_IDE_MAX_HWIFS. ]

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove <asm-cris/ide.h>
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:29 +0000 (22:53 +0200)]
ide: remove <asm-cris/ide.h>

Remove <asm-cris/arch-v{10,32}/ide.h> and <asm-cris/ide.h>.

This has been a broken code for some time now and needs rewrite
to match IDE core code / host driver model anyway.

Cc: Jesper Nilsson <Jesper.Nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: remove "no_pci_devices()" quirk from ide_default_io_base()
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:28 +0000 (22:53 +0200)]
ide-generic: remove "no_pci_devices()" quirk from ide_default_io_base()

Since the decision to probe for ISA ide2-6 is now left to the user
"no_pci_devices()" quirk is no longer needed and may be removed.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: minor fix for mips
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:28 +0000 (22:53 +0200)]
ide-generic: minor fix for mips

Move ide_probe_legacy() call to ide_generic_init() so it fails
early if necessary and returns the proper error value (nowadays
ide_default_io_base() is used only by ide-generic).

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: fix ide_default_io_base() for m32r
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:27 +0000 (22:53 +0200)]
ide-generic: fix ide_default_io_base() for m32r

Fix ide_default_io_base() to match ide_default_irq().

Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix <asm-xtensa/ide.h>
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:27 +0000 (22:53 +0200)]
ide: fix <asm-xtensa/ide.h>

* Add missing <asm-generic/ide_iops.h> include.

While at it:

* Remove needless ide_default_{irq,io_base}() inlines.

Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agorapide: add module_exit()
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:27 +0000 (22:53 +0200)]
rapide: add module_exit()

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoicside: add module_exit()
Bartlomiej Zolnierkiewicz [Thu, 24 Jul 2008 20:53:27 +0000 (22:53 +0200)]
icside: add module_exit()

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>