linux-2.6
16 years agoMerge branch 'linux-2.6' into for-2.6.24
Paul Mackerras [Wed, 3 Oct 2007 05:33:17 +0000 (15:33 +1000)] 
Merge branch 'linux-2.6' into for-2.6.24

16 years ago[POWERPC] Fix panic in RTAS code
Tony Breeds [Wed, 3 Oct 2007 01:19:09 +0000 (11:19 +1000)] 
[POWERPC] Fix panic in RTAS code

Some older pSeries machines were panicking in pSeries_log_error
because it was getting called before it was ready.  This is a result
of commit "[POWERPC] pseries: Fix jumbled no_logging flag."
(79c0108d1b9db4864ab77b2a95dfa04f2dcf264c).

This fixes it by explicitly enabling RTAS error logging when it has
been initialized, and also makes the code clearer by renaming the
"no_more_logging" variable to "logging_enabled".

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Use alloc_maybe_bootmem() in pcibios_alloc_controller
Linas Vepstas [Tue, 2 Oct 2007 21:40:12 +0000 (07:40 +1000)] 
[POWERPC] Use alloc_maybe_bootmem() in pcibios_alloc_controller

Use alloc_maybe_bootmem() which wraps the if (mem_init_done)
malloc clause.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Celleb: update for PCI
Ishizaki Kou [Tue, 2 Oct 2007 08:26:53 +0000 (18:26 +1000)] 
[POWERPC] Celleb: update for PCI

This adds support for the PCI bus on Celleb with new "I/O routines
for PowerPC."  External PCI on Celleb must do explicit synchronization
with devices (Bus has no automatic synchronization feature).

Signed-off-by: Kou Ishizaki <Kou.Ishizaki@toshiba.co.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Celleb: Serial I/O update
Ishizaki Kou [Tue, 2 Oct 2007 08:25:16 +0000 (18:25 +1000)] 
[POWERPC] Celleb: Serial I/O update

This is an update for Serial I/O on Celleb.
  - Detection algorithm has been changed

Signed-off-by: Kou Ishizaki <Kou.Ishizaki@toshiba.co.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Celleb: New HTAB Guest OS Interface on Beat
Ishizaki Kou [Tue, 2 Oct 2007 08:23:46 +0000 (18:23 +1000)] 
[POWERPC] Celleb: New HTAB Guest OS Interface on Beat

This changes the Celleb code to work with new Guest OS Interface
to tweak HTAB on Beat. It detects old and new Guest OS Interfaces
automatically.

Signed-off-by: Kou Ishizaki <Kou.Ishizaki@toshiba.co.jp>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Celleb: Support for Power/Reset buttons
Ishizaki Kou [Tue, 2 Oct 2007 08:21:21 +0000 (18:21 +1000)] 
[POWERPC] Celleb: Support for Power/Reset buttons

This supports Power/Reset buttons on Beat on Celleb.

On Beat, we have an event from Beat if Power button or Reset button
is pressed. This patch catches the event and convert it to a signal
to INIT process by calling ctrl_alt_del() function.

/sbin/inittab have no entry to turn the machine power off so we have
to detect if power button is pressed or not internally in our driver.
This idea is taken from PS3's event handling subsystem.

Signed-off-by: Kou Ishizaki <Kou.Ishizaki@toshiba.co.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Celleb: Move pause, kexec_cpu_down to beat.c
Ishizaki Kou [Tue, 2 Oct 2007 08:18:46 +0000 (18:18 +1000)] 
[POWERPC] Celleb: Move pause, kexec_cpu_down to beat.c

This is an update for "Beat on Celleb"
  - Move beat_pause(), beat_kexec_cpu_down() from setup.c to beat.c

Signed-off-by: <Kou.Ishizaki@toshiba.co.jp>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] ibmebus: More descriptive error return code in ibmebus_store_probe()
Joachim Fenkes [Wed, 26 Sep 2007 09:46:34 +0000 (19:46 +1000)] 
[POWERPC] ibmebus: More descriptive error return code in ibmebus_store_probe()

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Update axon_msi to use dcr_host_t.base
Michael Ellerman [Mon, 17 Sep 2007 06:05:02 +0000 (16:05 +1000)] 
[POWERPC] Update axon_msi to use dcr_host_t.base

Now that dcr_host_t contains the base address, we can use that in the
axon_msi code, rather than storing it separately.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Update mpic to use dcr_host_t.base
Michael Ellerman [Mon, 17 Sep 2007 06:05:01 +0000 (16:05 +1000)] 
[POWERPC] Update mpic to use dcr_host_t.base

Now that dcr_host_t contains the base address, we can use that in the mpic
code, rather than storing it separately.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Store the base address in dcr_host_t
Michael Ellerman [Mon, 17 Sep 2007 06:05:00 +0000 (16:05 +1000)] 
[POWERPC] Store the base address in dcr_host_t

In its current form, dcr_map() doesn't remember the base address you passed
it, which means you need to store it somewhere else.  Rather than adding the
base to another struct it seems simpler to store it in the dcr_host_t.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Select proper defconfig for crosscompiles
Adrian Bunk [Tue, 2 Oct 2007 20:30:09 +0000 (13:30 -0700)] 
[POWERPC] Select proper defconfig for crosscompiles

The trick for finding the right defconfig is neat, but you forgot to
provide an i686_defconfig.  ;-)

More seriously, cross compiling the defconfig is often useful, e.g. for
testing the compilation of patches that touch multiple architectures,
and this patch therefore chooses g5_defconfig if $(CROSS_COMPILE) is
non-empty.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Sky Cpu and Nexus: use seq_file/single_open on proc interface
Cyrill Gorcunov [Tue, 2 Oct 2007 20:30:09 +0000 (13:30 -0700)] 
[POWERPC] Sky Cpu and Nexus: use seq_file/single_open on proc interface

This patch changes proc interface to be used with single_file/seq_open
calls.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Sky Cpu: use C99 style for struct init
Cyrill Gorcunov [Tue, 2 Oct 2007 20:30:08 +0000 (13:30 -0700)] 
[POWERPC] Sky Cpu: use C99 style for struct init

This changes structure item init format to C99, and removes useless
structure items init.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Brian Waite <waite@skycomputers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Sky Cpu and Nexus: check for create_proc_entry ret code
Cyrill Gorcunov [Tue, 2 Oct 2007 20:30:07 +0000 (13:30 -0700)] 
[POWERPC] Sky Cpu and Nexus: check for create_proc_entry ret code

Adds checking of create_proc_entry call to prevent possible NULL
pointer usage.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Brian Waite <waite@skycomputers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Sky Cpu and Nexus: check for platform_get_resource retcode
Cyrill Gorcunov [Tue, 2 Oct 2007 20:30:06 +0000 (13:30 -0700)] 
[POWERPC] Sky Cpu and Nexus: check for platform_get_resource retcode

Add adds checking for platform_get_resource() return code to prevent
possible NULL pointer usage.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Brian Waite <waite@skycomputers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Sky Cpu and Nexus: include io.h
Cyrill Gorcunov [Tue, 2 Oct 2007 20:30:06 +0000 (13:30 -0700)] 
[POWERPC] Sky Cpu and Nexus: include io.h

Add #include <asm/io.h> directive to properly declare ioremap() and
writel().

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Brian Waite <waite@skycomputers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Sky Cpu and Nexus: code style improvement
Cyrill Gorcunov [Tue, 2 Oct 2007 20:30:05 +0000 (13:30 -0700)] 
[POWERPC] Sky Cpu and Nexus: code style improvement

Remove useless spaces and adds some empty lines to make code more
readable.  Also marker for printk is added.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Brian Waite <waite@skycomputers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] powerpc vDSO: install unstripped copies on disk
Roland McGrath [Tue, 2 Oct 2007 20:30:04 +0000 (13:30 -0700)] 
[POWERPC] powerpc vDSO: install unstripped copies on disk

This keeps an unstripped copy of the vDSO images built before they are
stripped and embedded in the kernel.  The unstripped copies get installed in
$(MODLIB)/vdso/ by "make install".  These files can be useful when they
contain source-level debugging information.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Include pagemap.h in asm/powerpc/tlb.h
Mathieu Desnoyers [Tue, 2 Oct 2007 20:30:04 +0000 (13:30 -0700)] 
[POWERPC] Include pagemap.h in asm/powerpc/tlb.h

Fixes this powerpc build error in 2.6.22-rc6-mm1 for powerpc 64 with
CONFIG_SWAP=n :

In file included from include2/asm/tlb.h:60,
                 from /home/compudj/git/linux-2.6-lttng/arch/powerpc/mm/init_64.
c:56:
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_flush_mmu':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:76: error: implicit declaration of function 'release_pages'
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_remove_page':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:105: error: implicit declaration of function 'page_cache_release'
make[2]: *** [arch/powerpc/mm/init_64.o] Error 1

release_pages is declared in linux/pagemap.h, but cannot be included in
linux/swap.h because of a sparc related comment:

/* only sparc can not include linux/pagemap.h in this file
 * so leave page_cache_release and release_pages undeclared... */
#define free_page_and_swap_cache(page) \
        page_cache_release(page)
#define free_pages_and_swap_cache(pages, nr) \
        release_pages((pages), (nr), 0);

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] ppc64: support CONFIG_DEBUG_PREEMPT
Hugh Dickins [Tue, 31 Oct 2006 18:44:54 +0000 (05:44 +1100)] 
[POWERPC] ppc64: support CONFIG_DEBUG_PREEMPT

Add CONFIG_DEBUG_PREEMPT support to ppc64: it was useful for testing
get_paca() preemption.  Cheat a little, just use debug_smp_processor_id()
in the debug version of get_paca(): it contains all the right checks and
reporting, though get_paca() doesn't really use smp_processor_id().

Use local_paca for what might have been called __raw_get_paca().
Silence harmless warnings from io.h and lparcfg.c with local_paca -
it is okay for iseries_lparcfg_data to be referencing shared_proc
with preemption enabled: all cpus should show the same value for
shared_proc.

Why do other architectures need TRACE_IRQFLAGS_SUPPORT for DEBUG_PREEMPT?
I don't know, ppc64 appears to get along fine without it.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Limit range of __init_ref_ok somewhat
Stephen Rothwell [Tue, 2 Oct 2007 03:37:53 +0000 (13:37 +1000)] 
[POWERPC] Limit range of __init_ref_ok somewhat

This patch introduces zalloc_maybe_bootmem and uses it so that we don't
have to mark a whole (largish) routine as __init_ref_ok.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] MAINTAINERS shouldn't reference linuxppc-embedded
Mark A. Greer [Tue, 2 Oct 2007 00:24:08 +0000 (10:24 +1000)] 
[POWERPC] MAINTAINERS shouldn't reference linuxppc-embedded

Powerpc patches should be posted to linuxppc-dev@ozlabs.org, so modify
MAINTAINERS to no longer reference linuxppc-embedded@ozlabs.org.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Make instruction dumping work in real mode
Scott Wood [Thu, 27 Sep 2007 18:38:55 +0000 (04:38 +1000)] 
[POWERPC] Make instruction dumping work in real mode

On non-book-E, exceptions execute in real mode.  If a fault happens
that leads to a register dump, the kernel currently prints XXXXXXXX
because it doesn't realize that PC is a physical address.

This patch checks whether instruction address translation is turned
on, and if not converts PC into a virtual address.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix pci domain detection
Arnd Bergmann [Wed, 26 Sep 2007 14:02:05 +0000 (00:02 +1000)] 
[POWERPC] Fix pci domain detection

The /proc/bus/pci/* files list PCI domain numbers only for
devices that claim to be on a multi-domain system. The check
for this is broken on powerpc, because the buid value is
truncated to 32 bits.

There is at least one machine (IBM QS21) that only uses
the high-order bits of the buid, so the return value
of pci_proc_domain() ends up being always zero, which
makes /proc/bus/pci useless.

Change the logic to always return '1' for a nonzero
buid value.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add CHECK_FULL_REGS in several places in ptrace code
Roland McGrath [Mon, 24 Sep 2007 23:50:52 +0000 (09:50 +1000)] 
[POWERPC] Add CHECK_FULL_REGS in several places in ptrace code

This restores the CHECK_FULL_REGS sanity check to every place that can
access the nonvolatile GPRs for ptrace.  This is already done for
native-bitwidth PTRACE_PEEKUSR, but was omitted for many other cases
(32-bit ptrace, PTRACE_GETREGS, etc.); I think there may have been more
uniform checks before that were lost in the recent cleanup of GETREGS et al.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] bootwrapper: Add PlanetCore firmware support
Scott Wood [Mon, 24 Sep 2007 20:09:49 +0000 (06:09 +1000)] 
[POWERPC] bootwrapper: Add PlanetCore firmware support

This is a library that board code can use to extract information from the
PlanetCore configuration keys.  PlanetCore is used on various boards from
Embedded Planet.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] bootwrapper: Factor out dt_set_mac_address()
Scott Wood [Mon, 24 Sep 2007 20:09:11 +0000 (06:09 +1000)] 
[POWERPC] bootwrapper: Factor out dt_set_mac_address()

This allows callers to set addresses one at a time when that would be more
convenient.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] boot: Simplify gunzip_finish
Milton Miller [Fri, 21 Sep 2007 23:03:52 +0000 (09:03 +1000)] 
[POWERPC] boot: Simplify gunzip_finish

Call gunzip_partial to calculate the remaining length and copy the
data to the user buffer.  This makes it shorter and reduces
duplication.

Signed-off-by: Milton Miller <miltonm@bga.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] boot: Record header bytes in gunzip_start
Milton Miller [Fri, 21 Sep 2007 23:03:34 +0000 (09:03 +1000)] 
[POWERPC] boot: Record header bytes in gunzip_start

Record the number of header bytes skipped in the total bytes read field.

This is needed for the initramfs parsing code to find the end of the zip file.

Signed-off-by: Milton Miller <miltonm@bga.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Make vio_bus_type static
Stephen Rothwell [Fri, 21 Sep 2007 04:32:05 +0000 (14:32 +1000)] 
[POWERPC] Make vio_bus_type static

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Simplify vio_bus_init a little for legacy iSeries
Stephen Rothwell [Fri, 21 Sep 2007 04:31:02 +0000 (14:31 +1000)] 
[POWERPC] Simplify vio_bus_init a little for legacy iSeries

iSeries_vio_dev was already statically initialised and we can remove
one set of #ifdef CONFIG_PPC_ISERIES guards.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Remove debug printk from vio_bus_init
Stephen Rothwell [Fri, 21 Sep 2007 04:29:28 +0000 (14:29 +1000)] 
[POWERPC] Remove debug printk from vio_bus_init

As it just adds noise to the boot messages.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Implement generic time of day clocksource for powerpc
Tony Breeds [Fri, 21 Sep 2007 21:35:52 +0000 (07:35 +1000)] 
[POWERPC] Implement generic time of day clocksource for powerpc

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Implement {read,update}_persistent_clock
Tony Breeds [Fri, 21 Sep 2007 03:26:02 +0000 (13:26 +1000)] 
[POWERPC] Implement {read,update}_persistent_clock

With these functions implemented we cooperate better with the generic
timekeeping code.  This obsoletes the need for the timer sysdev as a bonus.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add memory regions to the kcore list for 32-bit machines
Ed Swarthout [Fri, 21 Sep 2007 02:53:02 +0000 (12:53 +1000)] 
[POWERPC] Add memory regions to the kcore list for 32-bit machines

The entries are only 32-bit, so restrict the virtual address to stay
below 0xffff_ffff.  With KERNELBASE set to 0xc000_0000, this in effect
restricts access to the first 1GB of real memory.

Make setup_kcore conditional on CONFIG_PROC_KCORE for both 32/64.

Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Disable power management for arch/ppc
Paul Mackerras [Fri, 21 Sep 2007 01:52:36 +0000 (11:52 +1000)] 
[POWERPC] Disable power management for arch/ppc

Currently the prep_defconfig in arch/ppc won't build due to swsusp
being broken.  This patch avoids the problem by essentially disabling
all power management on those platforms left in arch/ppc.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Create and use CONFIG_WORD_SIZE
Stephen Rothwell [Fri, 21 Sep 2007 00:16:20 +0000 (10:16 +1000)] 
[POWERPC] Create and use CONFIG_WORD_SIZE

Linus made this suggestion for the x86 merge and this starts the process
for powerpc.  We assume that CONFIG_PPC64 implies CONFIG_PPC_MERGE and
CONFIG_PPC_STD_MMU_32 implies CONFIG_PPC_STD_MMU.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Separate out legacy machine check exception parsers
Olof Johansson [Thu, 20 Sep 2007 19:11:20 +0000 (05:11 +1000)] 
[POWERPC] Separate out legacy machine check exception parsers

Move out the old-style exception parsers to a separate function, and
don't call it on platforms that have a platform-specific handler.

It would make sense to move out the generic versions into their platforms
instead, but that can be done gradually down the road.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] clk.h interface for platforms
Domen Puncer [Thu, 20 Sep 2007 14:00:11 +0000 (00:00 +1000)] 
[POWERPC] clk.h interface for platforms

This provides an implementation of the <linux/clk.h> interface for
arch/powerpc using a set of function pointers in clk_functions.
Platforms that want to support this interface should fill
clk_functions and select CONFIG_PPC_CLOCK in Kconfig.

Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Inline u3msi_compose_msi_msg()
Michael Ellerman [Thu, 20 Sep 2007 06:36:51 +0000 (16:36 +1000)] 
[POWERPC] Inline u3msi_compose_msi_msg()

In the MPIC U3 MSI code, we call u3msi_compose_msi_msg() once for each MSI.
This is overkill, as the address is per pci device, not per MSI. So setup
the address once, and just set the data per MSI.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Simplify rtas_change_msi() error semantics
Michael Ellerman [Thu, 20 Sep 2007 06:36:50 +0000 (16:36 +1000)] 
[POWERPC] Simplify rtas_change_msi() error semantics

Currently rtas_change_msi() returns either the error code from RTAS, or if
the RTAS call succeeded the number of irqs that were configured by RTAS.
This makes checking the return value more complicated than it needs to be.

Instead, have rtas_change_msi() check that the number of irqs configured by
RTAS is equal to what we requested - and return an error otherwise. This makes
the return semantics match the usual 0 for success, something else for error.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Simplify error logic in rtas_setup_msi_irqs()
Michael Ellerman [Thu, 20 Sep 2007 06:36:48 +0000 (16:36 +1000)] 
[POWERPC] Simplify error logic in rtas_setup_msi_irqs()

rtas_setup_msi_irqs() doesn't need to call teardown() itself, the
generic code will do this for us as long as we return a non-zero
value.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Simplify error logic in u3msi_setup_msi_irqs()
Michael Ellerman [Thu, 20 Sep 2007 06:36:47 +0000 (16:36 +1000)] 
[POWERPC] Simplify error logic in u3msi_setup_msi_irqs()

u3msi_setup_msi_irqs() doesn't need to call teardown() itself,
the generic code will do this for us as long as we return a non
zero value.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Make sure to of_node_get() the result of pci_device_to_OF_node()
Michael Ellerman [Mon, 17 Sep 2007 06:03:45 +0000 (16:03 +1000)] 
[POWERPC] Make sure to of_node_get() the result of pci_device_to_OF_node()

pci_device_to_OF_node() returns the device node attached to a PCI device,
but doesn't actually grab a reference - we need to do it ourselves.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Move embedded6xx into multiplatform
Arnd Bergmann [Wed, 29 Aug 2007 23:11:24 +0000 (09:11 +1000)] 
[POWERPC] Move embedded6xx into multiplatform

The various embedded 6xx systems can easily coexist in one kernel
together with the other 6xx based systems, so there is no strict
reason to keep them separate.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoMerge branch 'sas-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6
Linus Torvalds [Tue, 2 Oct 2007 17:41:06 +0000 (10:41 -0700)] 
Merge branch 'sas-fixes' of /linux/kernel/git/jgarzik/misc-2.6

* 'sas-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  aic94xx: fix DMA data direction for SMP requests

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Tue, 2 Oct 2007 17:40:40 +0000 (10:40 -0700)] 
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  dm9601: Fix receive MTU
  mv643xx_eth: Do not modify struct netdev tx_queue_len
  qla3xxx: bugfix: Fix VLAN rx completion handling.
  qla3xxx: bugfix: Add memory barrier before accessing rx completion.

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Tue, 2 Oct 2007 17:40:20 +0000 (10:40 -0700)] 
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  ata_piix: add another TECRA M3 entry to broken suspend list

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
Linus Torvalds [Tue, 2 Oct 2007 17:38:13 +0000 (10:38 -0700)] 
Merge git://git./linux/kernel/git/mingo/linux-2.6-sched

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  sched: fix profile=sleep

16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Tue, 2 Oct 2007 17:35:28 +0000 (10:35 -0700)] 
Merge branch 'master' of /linux/kernel/git/davem/sparc-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Fix missing load-twin usage in Niagara-1 memcpy.
  [SPARC64]: Fix put_user() calls in binfmt_aout32.c
  [SPARC]: Fix EBUS use of uninitialized variable.

16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Tue, 2 Oct 2007 17:34:49 +0000 (10:34 -0700)] 
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [IEEE80211]: avoid integer underflow for runt rx frames
  [TCP]: secure_tcp_sequence_number() should not use a too fast clock
  [SFQ]: Remove artificial limitation for queue limit.

16 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Linus Torvalds [Tue, 2 Oct 2007 17:33:49 +0000 (10:33 -0700)] 
Merge branch 'merge' of git://git./linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] Fix xics set_affinity code

16 years agoaic94xx: fix DMA data direction for SMP requests
Jeff Garzik [Tue, 2 Oct 2007 17:16:10 +0000 (13:16 -0400)] 
aic94xx: fix DMA data direction for SMP requests

DMA-mapped SMP (scsi management protocol) requests going /to/ the device
need the PCI DMA data direction to indicate such.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agodm9601: Fix receive MTU
Peter Korsgaard [Mon, 1 Oct 2007 11:36:07 +0000 (13:36 +0200)] 
dm9601: Fix receive MTU

dm9601 didn't take the ethernet header into account when calculating
RX MTU, causing packets bigger than 1486 to fail.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agomv643xx_eth: Do not modify struct netdev tx_queue_len
Dale Farnsworth [Mon, 1 Oct 2007 23:02:18 +0000 (16:02 -0700)] 
mv643xx_eth: Do not modify struct netdev tx_queue_len

This driver erroneously zeros dev->tx_queue_len, since
mp->tx_ring_size has not yet been initialized.  Actually,
the driver shouldn't modify tx_queue_len at all and should
leave the value set by alloc_etherdev(), currently 1000.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoqla3xxx: bugfix: Fix VLAN rx completion handling.
Ron Mercer [Mon, 1 Oct 2007 18:43:23 +0000 (11:43 -0700)] 
qla3xxx: bugfix: Fix VLAN rx completion handling.

Fix 4032 chip undocumented "feature" where bit-8 is set
if the inbound completion is for a VLAN.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoqla3xxx: bugfix: Add memory barrier before accessing rx completion.
Ron Mercer [Mon, 1 Oct 2007 18:43:22 +0000 (11:43 -0700)] 
qla3xxx: bugfix: Add memory barrier before accessing rx completion.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoata_piix: add another TECRA M3 entry to broken suspend list
Tejun Heo [Sun, 30 Sep 2007 08:11:20 +0000 (01:11 -0700)] 
ata_piix: add another TECRA M3 entry to broken suspend list

There's a different version of DMI table for TECRA M3 where it has
proper vendor and product name entry.  Add the entry to the broken
suspend list.

Angus Turnbull reported and provided initial patch.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Angus Turnbull <angus@twinhelix.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosched: fix profile=sleep
Ingo Molnar [Tue, 2 Oct 2007 12:13:08 +0000 (14:13 +0200)] 
sched: fix profile=sleep

fix sleep profiling - we lost this chunk in the CFS merge.

Found-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years ago[POWERPC] pseries: device node status can be "ok" or "okay"
Linas Vepstas [Thu, 9 Aug 2007 23:27:00 +0000 (09:27 +1000)] 
[POWERPC] pseries: device node status can be "ok" or "okay"

It seems that some versions of firmware will report a device
node status as the string "okay". As we are not expecting this
string, the device node will be ignored by the EEH subsystem.
Which means EEH will not be enabled.

When EEH is not enabled, PCI errors will be converted into
Machine Check exceptions, and we'll have a very unhappy system.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[SPARC64]: Fix missing load-twin usage in Niagara-1 memcpy.
David S. Miller [Tue, 2 Oct 2007 08:03:09 +0000 (01:03 -0700)] 
[SPARC64]: Fix missing load-twin usage in Niagara-1 memcpy.

For the case where the source is not aligned modulo 8
we don't use load-twins to suck the data in and this
kills performance since normal loads allocate in the
L1 cache (unlike load-twin) and thus big memcpys swipe
the entire L1 D-cache.

We need to allocate a register window to implement this
properly, but that actually simplifies a lot of things
as a nice side-effect.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IEEE80211]: avoid integer underflow for runt rx frames
John W. Linville [Tue, 2 Oct 2007 04:03:54 +0000 (21:03 -0700)] 
[IEEE80211]: avoid integer underflow for runt rx frames

Reported by Chris Evans <scarybeasts@gmail.com>:

> The summary is that an evil 80211 frame can crash out a victim's
> machine. It only applies to drivers using the 80211 wireless code, and
> only then to certain drivers (and even then depends on a card's
> firmware not dropping a dubious packet). I must confess I'm not
> keeping track of Linux wireless support, and the different protocol
> stacks etc.
>
> Details are as follows:
>
> ieee80211_rx() does not explicitly check that "skb->len >= hdrlen".
> There are other skb->len checks, but not enough to prevent a subtle
> off-by-two error if the frame has the IEEE80211_STYPE_QOS_DATA flag
> set.
>
> This leads to integer underflow and crash here:
>
> if (frag != 0)
>    flen -= hdrlen;
>
> (flen is subsequently used as a memcpy length parameter).

How about this?

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: secure_tcp_sequence_number() should not use a too fast clock
Eric Dumazet [Mon, 1 Oct 2007 20:58:36 +0000 (13:58 -0700)] 
[TCP]: secure_tcp_sequence_number() should not use a too fast clock

TCP V4 sequence numbers are 32bits, and RFC 793 assumed a 250 KHz clock.
In order to follow network speed increase, we can use a faster clock, but
we should limit this clock so that the delay between two rollovers is
greater than MSL (TCP Maximum Segment Lifetime : 2 minutes)

Choosing a 64 nsec clock should be OK, since the rollovers occur every
274 seconds.

Problem spotted by Denys Fedoryshchenko

[ This bug was introduced by f85958151900f9d30fa5ff941b0ce71eaa45a7de ]

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SFQ]: Remove artificial limitation for queue limit.
Alexey Kuznetsov [Mon, 1 Oct 2007 00:51:33 +0000 (17:51 -0700)] 
[SFQ]: Remove artificial limitation for queue limit.

This is followup to Patrick's patch. A little optimization to enqueue
routine allows to remove artificial limitation on queue length.

Plus, testing showed that hash function used by SFQ is too bad or even worse.
It does not even sweep the whole range of hash values.
Switched to Jenkins' hash.

Signed-off-by: Alexey Kuznetsov <kaber@ms2.inr.ac.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoLinux 2.6.23-rc9 v2.6.23-rc9
Linus Torvalds [Tue, 2 Oct 2007 03:24:52 +0000 (20:24 -0700)] 
Linux 2.6.23-rc9

No, I didn't want to do this, but we had more stuff go in after -rc8
than we had in the previous -rc. Gaah.

16 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Tue, 2 Oct 2007 03:15:45 +0000 (20:15 -0700)] 
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] vmlinux.lds.S: Handle note sections
  [MIPS] Fix value of O_TRUNC

16 years agox86_64: increase VDSO_TEXT_OFFSET for ancient binutils
Andi Kleen [Mon, 1 Oct 2007 08:20:08 +0000 (01:20 -0700)] 
x86_64: increase VDSO_TEXT_OFFSET for ancient binutils

For some reason old binutils genertate larger headers so increase the text
offset of the vdso to avoid linker errors.

Roland McGrath explains:
  "There are extra symbols in the '.dynsym' section that are responsible
   for the size difference (They also cause corresponding inflation in
   '.gnu.version')

   Older ld's wrongly generated these unneeded symbols in .dynsym.  This
   was fixed not all that long ago (2006); binutils-2.17.50.0.6 might be
   the first fixed version, but I have not verified for sure where the
   cutoff was.

   The unneeded symbols et al from old ld add almost 700 bytes excess.
   This limits fairly tightly the amount by which the actual text and
   data in the vDSO can grow in the future without pushing the whole
   file over 4kb.  If it does grow later on, we should consider changing
   the layout with a config option or something to pack it better
   without that padding, when building the kernel with newer binutils."

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Roland McGrath <roland@redhat.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[POWERPC] Fix xics set_affinity code
Anton Blanchard [Sun, 30 Sep 2007 21:45:55 +0000 (07:45 +1000)] 
[POWERPC] Fix xics set_affinity code

On a POWER6 machine running 2.6.23-rc8 I sometimes see the following error:

xics_set_affinity: No online cpus in the mask 00000000,00000000,00000000,00000001 for irq 20

In a desperate attempt to get a changelog entry in 2.6.23, I took a look
into it.

It turns out we are passing a real and not a virtual irq into
get_irq_server.  This works for the case where hwirq < NR_IRQS and we
set virq = hwirq.  In my case however hwirq = 590082 and we try and
access irq_desc[590082], slightly past the end at 512 entries.

Lucky we ship lots of memory with our machines.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoFix possible splice() mmap_sem deadlock
Linus Torvalds [Mon, 1 Oct 2007 20:17:28 +0000 (13:17 -0700)] 
Fix possible splice() mmap_sem deadlock

Nick Piggin points out that splice isn't being good about the mmap
semaphore: while two readers can nest inside each others, it does leave
a possible deadlock if a writer (ie a new mmap()) comes in during that
nesting.

Original "just move the locking" patch by Nick, replaced by one by me
based on an optimistic pagefault_disable().  And then Jens tested and
updated that patch.

Reported-by: Nick Piggin <npiggin@suse.de>
Tested-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'fixes-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git/linvill...
Linus Torvalds [Mon, 1 Oct 2007 20:11:48 +0000 (13:11 -0700)] 
Merge branch 'fixes-jgarzik' of git://git./linux/kernel/git/linville/wireless-2.6

* 'fixes-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6:
  [PATCH] libertas: build problems when partially modular

16 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Mon, 1 Oct 2007 20:08:22 +0000 (13:08 -0700)] 
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] Resolve PCI section warnings

16 years agoMerge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Mon, 1 Oct 2007 15:02:57 +0000 (08:02 -0700)] 
Merge branch 'master' of ssh:///linux/kernel/git/mchehab/v4l-dvb

* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (6052): ivtv: fix udma yuv bug

16 years agoMerge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
Linus Torvalds [Mon, 1 Oct 2007 14:59:39 +0000 (07:59 -0700)] 
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
  Revert "[XFS] Avoid replaying inode buffer initialisation log items if ..

[ Fixed it and added some commit messages by hand to that branch   - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRevert "[XFS] Avoid replaying inode buffer initialisation log items if on-disk versio...
Tim Shimmin [Mon, 1 Oct 2007 06:39:37 +0000 (16:39 +1000)] 
Revert "[XFS] Avoid replaying inode buffer initialisation log items if on-disk version is newer."

This reverts commit b394e43e995d08821588a22561c6a71a63b4ff27.

Lachlan McIlroy says:
    It tried to fix an issue where log replay is replaying an inode cluster
    initialisation transaction that should not be replayed because the inode
    cluster on disk is more up to date.  Since we don't log file sizes (we
    rely on inode flushing to get them to disk) then we can't just replay
    all the transations in the log and expect the inode to be completely
    restored.  We lose file size updates.  Unfortunately this fix is causing
    more (serious) problems than it is fixing.

SGI-PV: 969656
SGI-Modid: xfs-linux-melb:xfs-kern:29804a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
16 years agorobust futex thread exit race
Martin Schwidefsky [Mon, 1 Oct 2007 08:20:13 +0000 (01:20 -0700)] 
robust futex thread exit race

Calling handle_futex_death in exit_robust_list for the different robust
mutexes of a thread basically frees the mutex.  Another thread might grab
the lock immediately which updates the next pointer of the mutex.
fetch_robust_entry over the next pointer might therefore branch into the
robust mutex list of a different thread.  This can cause two problems: 1)
some mutexes held by the dead thread are not getting freed and 2) some
mutexs held by a different thread are freed.

The next point need to be read before calling handle_futex_death.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoVT ioctl race fix
Samuel Ortiz [Mon, 1 Oct 2007 08:20:12 +0000 (01:20 -0700)] 
VT ioctl race fix

When calling the RELDISP VT ioctl, we are reading vt_newvt while the
console workqueue could be messing with it (through change_console()).  We
fix this race by taking the console semaphore before reading vt_newvt.

Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Acked-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix SMP poweroff hangs
Mark Lord [Mon, 1 Oct 2007 08:20:10 +0000 (01:20 -0700)] 
Fix SMP poweroff hangs

We need to disable all CPUs other than the boot CPU (usually 0) before
attempting to power-off modern SMP machines.  This fixes the
hang-on-poweroff issue on my MythTV SMP box, and also on Thomas Gleixner's
new toybox.

Signed-off-by: Mark Lord <mlord@pobox.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
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 agohugetlb: fix clear_user_highpage arguments
Ralf Baechle [Mon, 1 Oct 2007 08:20:10 +0000 (01:20 -0700)] 
hugetlb: fix clear_user_highpage arguments

The virtual address space argument of clear_user_highpage is supposed to be
the virtual address where the page being cleared will eventually be mapped.
 This allows architectures with virtually indexed caches a few clever
tricks.  That sort of trick falls over in painful ways if the virtual
address argument is wrong.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoAdd /dev/oldmem to devices.txt documentation
Dave Jones [Mon, 1 Oct 2007 08:20:09 +0000 (01:20 -0700)] 
Add /dev/oldmem to devices.txt documentation

Signed-off-by: Dave Jones <davej@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <device@lanana.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[MIPS] vmlinux.lds.S: Handle note sections
Maciej W. Rozycki [Mon, 1 Oct 2007 12:24:04 +0000 (13:24 +0100)] 
[MIPS] vmlinux.lds.S: Handle note sections

Store any note sections after the exception tables like the other
architectures do.  This is required for .note.gnu.build-id emitted from
binutils 2.18 onwards if nothing else.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Fix value of O_TRUNC
Ralf Baechle [Sat, 29 Sep 2007 23:45:08 +0000 (00:45 +0100)] 
[MIPS] Fix value of O_TRUNC

A "cleanup" almost two years ago deleted the old definition from
<asm/fcntl.h>, so asm-generic/fcntl.h defaulted it to the the same
value as FASYNC ...   which happened to be the wrong thing.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[PATCH] libertas: build problems when partially modular
Randy Dunlap [Mon, 1 Oct 2007 00:35:39 +0000 (20:35 -0400)] 
[PATCH] libertas: build problems when partially modular

Fix missing symbols in libertas USB driver when it is modular and rest
of libertas is built-in.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years ago[SPARC64]: Fix put_user() calls in binfmt_aout32.c
David S. Miller [Mon, 1 Oct 2007 00:00:34 +0000 (17:00 -0700)] 
[SPARC64]: Fix put_user() calls in binfmt_aout32.c

argv and envp are pointers to u32's in userspace, so don't
try to put_user() a NULL to them.

Aparently gcc-4.2.x now warns about this, and since we use
-Werror for arch/sparc64 code, this breaks the build.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ARM] Resolve PCI section warnings
Russell King [Sun, 30 Sep 2007 16:36:22 +0000 (17:36 +0100)] 
[ARM] Resolve PCI section warnings

Fix the following (valid) section warnings:

WARNING: vmlinux.o(.text+0xf7b5c): Section mismatch: reference to .init.text:pcibios_fixup_bus (between 'pci_scan_child_bus' and 'pci_scan_bridge')
WARNING: vmlinux.o(.text+0xfc5f4): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_map_rom' and 'pci_unmap_rom')
WARNING: vmlinux.o(.text+0xfc824): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_update_resource' and 'pci_claim_resource')
WARNING: vmlinux.o(.text+0xfd6d8): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_setup_cardbus' and 'find_free_bus_resource')
WARNING: vmlinux.o(.text+0xfd730): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_setup_cardbus' and 'find_free_bus_resource')
WARNING: vmlinux.o(.text+0xfd788): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_setup_cardbus' and 'find_free_bus_resource')
WARNING: vmlinux.o(.text+0xfd7e0): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_setup_cardbus' and 'find_free_bus_resource')
WARNING: vmlinux.o(.text+0xfe024): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_bus_assign_resources' and 'sys_pciconfig_read')
WARNING: vmlinux.o(.text+0xfe0f4): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_bus_assign_resources' and 'sys_pciconfig_read')
WARNING: vmlinux.o(.text+0xfe17c): Section mismatch: reference to .init.text:pcibios_resource_to_bus (between 'pci_bus_assign_resources' and 'sys_pciconfig_read')

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years agoV4L/DVB (6052): ivtv: fix udma yuv bug
Ian Armstrong [Sat, 18 Aug 2007 18:58:51 +0000 (15:58 -0300)] 
V4L/DVB (6052): ivtv: fix udma yuv bug

Using udma yuv causes the driver becomes locked into that mode. This prevents
use of the mpeg decoder & non-udma yuv output. This patch clears the
operating mode when the device is closed.

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@infradead.org>
16 years agofix console change race exposed by CFS
Jan Lübbe [Sat, 29 Sep 2007 16:47:51 +0000 (18:47 +0200)] 
fix console change race exposed by CFS

The new behaviour of CFS exposes a race which occurs if a switch is
requested when vt_mode.mode is VT_PROCESS.

The process with vc->vt_pid is signaled before vc->vt_newvt is set.
This causes the switch to fail when triggered by the monitoing process
because the target is still -1.

[ If the signal sending fails, the subsequent "reset_vc(vc)" will then
  reset vt_newvt to -1, so this works for that case too.   - Linus ]

Signed-off-by: Jan Lübbe <jluebbe@lasnet.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Sat, 29 Sep 2007 16:25:55 +0000 (09:25 -0700)] 
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  mv643xx_eth: Check ETH_INT_CAUSE_STATE bit

16 years agoi386: remove bogus comment about memory barrier
Nick Piggin [Sat, 29 Sep 2007 13:28:48 +0000 (15:28 +0200)] 
i386: remove bogus comment about memory barrier

The comment being removed by this patch is incorrect and misleading.

In the following situation:

1. load  ...
2. store 1 -> X
3. wmb
4. rmb
5. load  a <- Y
6. store ...

4 will only ensure ordering of 1 with 5.
3 will only ensure ordering of 2 with 6.

Further, a CPU with strictly in-order stores will still only provide that
2 and 6 are ordered (effectively, it is the same as a weakly ordered CPU
with wmb after every store).

In all cases, 5 may still be executed before 2 is visible to other CPUs!

The additional piece of the puzzle that mb() provides is the store/load
ordering, which fundamentally cannot be achieved with any combination of
rmb()s and wmb()s.

This can be an unexpected result if one expected any sort of global ordering
guarantee to barriers (eg. that the barriers themselves are sequentially
consistent with other types of barriers).  However sfence or lfence barriers
need only provide an ordering partial ordering of memory operations -- Consider
that wmb may be implemented as nothing more than inserting a special barrier
entry in the store queue, or, in the case of x86, it can be a noop as the store
queue is in order. And an rmb may be implemented as a directive to prevent
subsequent loads only so long as their are no previous outstanding loads (while
there could be stores still in store queues).

I can actually see the occasional load/store being reordered around lfence on
my core2. That doesn't prove my above assertions, but it does show the comment
is wrong (unless my program is -- can send it out by request).

So:
   mb() and smp_mb() always have and always will require a full mfence
   or lock prefixed instruction on x86.  And we should remove this comment.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Paul McKenney <paulmck@us.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomv643xx_eth: Check ETH_INT_CAUSE_STATE bit
Dale Farnsworth [Fri, 28 Sep 2007 13:30:43 +0000 (06:30 -0700)] 
mv643xx_eth: Check ETH_INT_CAUSE_STATE bit

Commit 468d09f8946d40228c56de26fe4874b2f98067ed masked the "state"
interrupt (bit 20 of the cause register). This results in Radstone's
PPC7D repeatedly re-entering the interrupt routine, locking up the
board. The following patch returns the required handling for this
interrupt.

Signed-off-by: Martyn Welch <martyn.welch@radstone.co.uk>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoFix bogus PCI quirk for e100
Benjamin Herrenschmidt [Fri, 28 Sep 2007 23:06:21 +0000 (09:06 +1000)] 
Fix bogus PCI quirk for e100

Linas reported me that some machines were crashing at boot in
quirk_e100_interrupt. It appears that this quirk is doing an ioremap
directly on a PCI BAR value, which isn't legal and will cause all sorts
of bad things to happen on architectures where PCI BARs don't directly
match processor bus addresses.

This fixes it by using the proper PCI resources instead which is possible
since the quirk has been moved by a previous commit to happen late enough
for that.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 28 Sep 2007 22:44:44 +0000 (15:44 -0700)] 
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [TCP]: Fix MD5 signature handling on big-endian.
  [NET]: Zero length write() on socket should not simply return 0.

16 years agoInput: xpad - fix dependancy on LEDS class
Dmitry Torokhov [Thu, 27 Sep 2007 04:09:29 +0000 (00:09 -0400)] 
Input: xpad - fix dependancy on LEDS class

Input: xpad - fix dependancy on LEDS class

The driver can not be built-in when LEDS class is a module.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoNFS: Fix an Oops in encode_lookup()
Trond Myklebust [Fri, 28 Sep 2007 16:27:41 +0000 (12:27 -0400)] 
NFS: Fix an Oops in encode_lookup()

It doesn't look as if the NFS file name limit is being initialised correctly
in the struct nfs_server. Make sure that we limit whatever is being set in
nfs_probe_fsinfo() and nfs_init_server().

Also ensure that readdirplus and nfs4_path_walk respect our file name
limits.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-2.6.23' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc
Linus Torvalds [Fri, 28 Sep 2007 22:33:03 +0000 (15:33 -0700)] 
Merge branch 'for-2.6.23' of /linux/kernel/git/galak/powerpc

* 'for-2.6.23' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc:
  [POWERPC] mpc8349emitx.dts: Setup USB-DR for peripheral mode.
  [POWERPC] Fix mpc834x USB-MPH configuration.
  [POWERPC] Fix cpm_uart driver for cpm1 machines
  [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem
  [POWERPC] Fix copy'n'paste typo in commproc.c

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Fri, 28 Sep 2007 22:32:29 +0000 (15:32 -0700)] 
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  e1000: Add device IDs of blade version of the 82571 quad port
  sky2: fix transmit state on resume
  sky2: FE+ vlan workaround
  sky2: sky2 FE+ receive status workaround

16 years ago[TCP]: Fix MD5 signature handling on big-endian.
David S. Miller [Fri, 28 Sep 2007 22:18:35 +0000 (15:18 -0700)] 
[TCP]: Fix MD5 signature handling on big-endian.

Based upon a report and initial patch by Peter Lieven.

tcp4_md5sig_key and tcp6_md5sig_key need to start with
the exact same members as tcp_md5sig_key.  Because they
are both cast to that type by tcp_v{4,6}_md5_do_lookup().

Unfortunately tcp{4,6}_md5sig_key use a u16 for the key
length instead of a u8, which is what tcp_md5sig_key
uses.  This just so happens to work by accident on
little-endian, but on big-endian it doesn't.

Instead of casting, just place tcp_md5sig_key as the first member of
the address-family specific structures, adjust the access sites, and
kill off the ugly casts.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Fri, 28 Sep 2007 19:02:25 +0000 (12:02 -0700)] 
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Fix fallocate on o32 binary compat ABI
  [MIPS] Fix CONFIG_BUILD_ELF64 kernels with symbols in CKSEG0.
  [MIPS] IP32: Fix initialization of UART base addresses.

16 years ago[MIPS] Fix fallocate on o32 binary compat ABI
Kyle McMartin [Fri, 28 Sep 2007 17:15:20 +0000 (13:15 -0400)] 
[MIPS] Fix fallocate on o32 binary compat ABI

MIPS was mistakenly forgetting to use the fallocate compat wrapper, which
I noticed while cleaning up all the duplicate fallocate wrappers.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>