pandora-kernel.git
15 years agopalm_bk3710: those registers/bitfields don't exist
David Brownell [Thu, 23 Apr 2009 20:53:43 +0000 (22:53 +0200)]
palm_bk3710: those registers/bitfields don't exist

Bugfixes noted by checking the code against the controller
documentation (TI document number SPRUE21):

 - Remove declarations for eight non-existent registers (!);
   and remove accesses to two of them.

 - Remove access to various non-existent bitfields in some of
   the registers which *do* exist (those fields must-be-zero).

 - Provide comment to replace bogus reset logic (removed above,
   it relied on non-existent bitfields).  Resets require GPIO
   help; this driver doesn't currently know about that.

With some minor cleanup:  relocate a comment, avoid an extra
lookup of the PIO timings.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agomicroblaze: add parameter to microblaze_read()
Coly Li [Wed, 22 Apr 2009 19:05:31 +0000 (03:05 +0800)]
microblaze: add parameter to microblaze_read()

This patch modifies parameter of microblaze_read() from 'void' to 'struct
clocksource *cs', which fixes compile warning for incompatible parameter type.

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Use CFLAGS_KERNEL instead of CFLAGS
Michal Simek [Tue, 21 Apr 2009 12:12:18 +0000 (14:12 +0200)]
microblaze: Use CFLAGS_KERNEL instead of CFLAGS

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Add STATE_SAVE_ARG_SPACE for noMMU kernel too
Michal Simek [Tue, 21 Apr 2009 12:08:47 +0000 (14:08 +0200)]
microblaze: Add STATE_SAVE_ARG_SPACE for noMMU kernel too

For noMMU kernel this change nothing bring but this change
helps with MMU synchronization.

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Do not check use_dcache
Michal Simek [Tue, 21 Apr 2009 12:07:00 +0000 (14:07 +0200)]
microblaze: Do not check use_dcache

It is not necessary to check cpuinfo.use_dcache because
this checking is done in function which call that functions

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Do not use PVR configuration for broken MB version
Michal Simek [Tue, 21 Apr 2009 12:06:08 +0000 (14:06 +0200)]
microblaze: Do not use PVR configuration for broken MB version

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Fix USR1/2 pvr printing message
Michal Simek [Tue, 21 Apr 2009 12:04:39 +0000 (14:04 +0200)]
microblaze: Fix USR1/2 pvr printing message

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: iowrite upon timeout
Roel Kluin [Thu, 16 Apr 2009 20:49:17 +0000 (22:49 +0200)]
microblaze: iowrite upon timeout

retries reaches -1, so the iowrite occurrs upon timeout.

Acked-by: John Williams <john.williams@petalogix.com>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Correspond CONFIG...PCMP in Makefile/Kconfig
Michal Simek [Mon, 20 Apr 2009 07:56:24 +0000 (09:56 +0200)]
microblaze: Correspond CONFIG...PCMP in Makefile/Kconfig

Makefile contained different cpu config flag
than is in Kconfig.auto in platform folder

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Remove redundant variable
Michal Simek [Thu, 16 Apr 2009 09:32:21 +0000 (11:32 +0200)]
microblaze: Remove redundant variable

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Move start_thread to process.c
Michal Simek [Thu, 16 Apr 2009 09:30:16 +0000 (11:30 +0200)]
microblaze: Move start_thread to process.c

This change is due to upcomming MMU merge

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Add missing preadv and pwritev syscalls
Michal Simek [Thu, 16 Apr 2009 09:29:13 +0000 (11:29 +0200)]
microblaze: Add missing preadv and pwritev syscalls

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Add missing declaration for die and _exception func
Michal Simek [Thu, 16 Apr 2009 09:11:22 +0000 (11:11 +0200)]
microblaze: Add missing declaration for die and _exception func

This change remove sparse errors.

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Remove sparse error in traps.c
Michal Simek [Thu, 16 Apr 2009 09:10:07 +0000 (11:10 +0200)]
microblaze: Remove sparse error in traps.c

CHECK   arch/microblaze/kernel/traps.c
arch/microblaze/kernel/traps.c:37:47: warning: Using plain integer as NULL pointer
CC      arch/microblaze/kernel/traps.o

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Move task_pt_regs up
Michal Simek [Thu, 16 Apr 2009 09:05:26 +0000 (11:05 +0200)]
microblaze: Move task_pt_regs up

This change is important for easier merge with Microblaze MMU code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Rename kernel_mode to pt_mode in pt_regs
Michal Simek [Thu, 16 Apr 2009 08:58:47 +0000 (10:58 +0200)]
microblaze: Rename kernel_mode to pt_mode in pt_regs

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Remove uncache shadow condition
Michal Simek [Thu, 16 Apr 2009 08:46:37 +0000 (10:46 +0200)]
microblaze: Remove uncache shadow condition

Uncached shadow feature is not supported in current
kernel code that's why I removed it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Remove while(1) loop from show_regs function
Michal Simek [Thu, 16 Apr 2009 08:41:45 +0000 (10:41 +0200)]
microblaze: Remove while(1) loop from show_regs function

I removed it because of show_regs can't break die function.
If process/kernel failed, die (do_exit) function resolve it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years agomicroblaze: Remove unneded per cpu SYSCALL_SAVE variable
Michal Simek [Thu, 16 Apr 2009 08:36:54 +0000 (10:36 +0200)]
microblaze: Remove unneded per cpu SYSCALL_SAVE variable

Signed-off-by: Michal Simek <monstr@monstr.eu>
15 years ago[S390] update default configuration.
Martin Schwidefsky [Thu, 23 Apr 2009 11:58:11 +0000 (13:58 +0200)]
[S390] update default configuration.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] omit frame pointers on s390 when possible
Heiko Carstens [Thu, 23 Apr 2009 11:58:10 +0000 (13:58 +0200)]
[S390] omit frame pointers on s390 when possible

Always omit frame pointers on s390. They aren't too useful for the
kernel since we have already the kernel stack backchain which allows
us to walk the kernel stack.
So eleminate the extra code for frame pointers. Only allow the extra
code for the function tracer since the gcc compile options -pg and
-fomit-frame-pointer are incompatible.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] Use tape_generic_offline directly.
Frank Munzert [Thu, 23 Apr 2009 11:58:09 +0000 (13:58 +0200)]
[S390] Use tape_generic_offline directly.

tape_3590_offline and tape_34xx_offline are removed and tape_generic_offline
is called directly instead.

Signed-off-by: Frank Munzert <munzert@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] /proc/stat idle field for idle cpus
Martin Schwidefsky [Thu, 23 Apr 2009 11:58:08 +0000 (13:58 +0200)]
[S390] /proc/stat idle field for idle cpus

The cpu idle field in the output of /proc/stat is too small for cpus
that have been idle for more than a tick. Add the architecture hook
arch_idle_time that allows to add the not accounted idle time of a
sleeping cpu without waking the cpu.

The s390 implementation of arch_idle_time uses the already existing
s390_idle_data per_cpu variable to find the sleep time of a neighboring
idle cpu.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] appldata: avoid deadlock with appldata_mem
Gerald Schaefer [Thu, 23 Apr 2009 11:58:07 +0000 (13:58 +0200)]
[S390] appldata: avoid deadlock with appldata_mem

The appldata_ops callbacks are called with a spin_lock held. But the
appldata_mem callback then calls all_vm_events(), which calls
get_online_cpus(), which might sleep. This possible deadlock is fixed
by using a mutex instead of a spin_lock.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] ipl: fix compile breakage
Heiko Carstens [Thu, 23 Apr 2009 11:58:06 +0000 (13:58 +0200)]
[S390] ipl: fix compile breakage

Fix this for !CONFIG_SMP:

arch/s390/kernel/ipl.c: In function 'stop_run':
arch/s390/kernel/ipl.c:1461: error: implicit declaration of function 'signal_processor'

Reported-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years agoGFS2: Ensure that the inode goal block settings are updated
Steven Whitehouse [Thu, 23 Apr 2009 07:59:41 +0000 (08:59 +0100)]
GFS2: Ensure that the inode goal block settings are updated

GFS2 has a goal block associated with each inode indicating the
search start position for future block allocations (in fact there
are two, but thats for backward compatibility with GFS1 as they
are set to identical locations in GFS2).

In some circumstances, depending on the ordering of updates to
the inode it was possible for the goal block settings to not
be updated on disk. This patch ensures that the goal block will
always get updated, thus reducing the potential for searching
the same (already allocated) blocks again when looking for free
space during block allocation.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
15 years agoGFS2: Fix bug in block allocation
Steven Whitehouse [Thu, 23 Apr 2009 07:54:02 +0000 (08:54 +0100)]
GFS2: Fix bug in block allocation

The new bitfit algorithm was counting from the wrong end of
64 bit words in the bitfield. This fixes it by using __ffs64
instead of fls64

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
15 years agobitops: Add __ffs64 bitop
Steven Whitehouse [Thu, 23 Apr 2009 07:48:15 +0000 (08:48 +0100)]
bitops: Add __ffs64 bitop

Finds the first set bit in a 64 bit word. This is required in order
to fix a bug in GFS2, but I think it should be a generic function
in case of future users.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Reviewed-by: Willy Tarreau <w@1wt.eu>
15 years agox86: check boundary in setup_node_bootmem()
Yinghai Lu [Wed, 22 Apr 2009 21:19:27 +0000 (14:19 -0700)]
x86: check boundary in setup_node_bootmem()

Commit dc09855 ("x86/uv: fix init of memory-less nodes") causes a
two sockets system (where node-1 doesn't have RAM installed) to crash.

That commit makes node_possible include cpu nodes that do not have memory.
So check boundary in setup_node_bootmem().

[ Impact: fix boot crash on RAM-less NUMA node system ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Jack Steiner <steiner@sgi.com>
LKML-Reference: <49EF89DF.9090404@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agolocking: clarify kernel-taint warning message
Ingo Molnar [Thu, 23 Apr 2009 07:36:52 +0000 (09:36 +0200)]
locking: clarify kernel-taint warning message

Andi Kleen reported this message triggering on non-lockdep kernels:

   Disabling lockdep due to kernel taint

Clarify the message to say 'lock debugging' - debug_locks_off()
turns off all things lock debugging, not just lockdep.

[ Impact: change kernel warning message text ]

Reported-by: Andi Kleen <andi@firstfloor.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoext4: Fix potential inode allocation soft lockup in Orlov allocator
Theodore Ts'o [Thu, 23 Apr 2009 01:00:36 +0000 (21:00 -0400)]
ext4: Fix potential inode allocation soft lockup in Orlov allocator

If the Orlov allocator is having trouble finding an appropriate block
group, the fallback code could loop forever, causing a soft lockup
warning in find_group_orlov():

BUG: soft lockup - CPU#0 stuck for 61s! [cp:11728]
     ...
Pid: 11728, comm: cp Not tainted (2.6.30-rc1-dirty #77) Lenovo
EIP: 0060:[<c021650e>] EFLAGS: 00000246 CPU: 0
EIP is at ext4_get_group_desc+0x54/0x9d
    ...
Call Trace:
 [<c0218021>] find_group_orlov+0x2ee/0x334
 [<c0120a5f>] ? sched_clock+0x8/0xb
 [<c02188e3>] ext4_new_inode+0x2cf/0xb1a

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoext4: Make the extent validity check more paranoid
Theodore Ts'o [Thu, 23 Apr 2009 00:52:25 +0000 (20:52 -0400)]
ext4: Make the extent validity check more paranoid

Instead of just checking that the extent block number is greater or
equal than s_first_data_block, make sure it it is not pointing into
the block group descriptors, since that is clearly wrong.  This helps
prevent filesystem from getting very badly corrupted in case an extent
block is corrupted.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoACPI: delete obsolete "bus master activity" proc field
Len Brown [Wed, 22 Apr 2009 23:28:15 +0000 (19:28 -0400)]
ACPI: delete obsolete "bus master activity" proc field

Linux-2.6.29 deleted the legacy ACPI idle handler, leaving
the CPU_IDLE handler, which does not track bus master activity.

So delete the unused bm_activity field -- it is confusing to
print an always zero value.

This patch could break programs that parse
/proc/acpi/processor/*/power, since it deletes this
line from that file:

bus master activity:     00000000

http://bugzilla.kernel.org/show_bug.cgi?id=13145
is not fixed by this patch, but provoked this patch.

Signed-off-by: Len Brown <len.brown@intel.com>
15 years agom68knommu: update the default config for the ColdFire 5407C3 board
Greg Ungerer [Wed, 22 Apr 2009 23:23:32 +0000 (09:23 +1000)]
m68knommu: update the default config for the ColdFire 5407C3 board

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agoACPI: idle: mark_tsc_unstable() at init-time, not run-time
Len Brown [Tue, 21 Apr 2009 04:50:11 +0000 (00:50 -0400)]
ACPI: idle: mark_tsc_unstable() at init-time, not run-time

The c2 and c3 idle handlers check tsc_halts_in_c()
after every time they return from idle.  Um, when?:-)

Move this check to init-time to remove the unnecessary
run-time overhead, and also to have the check complete before
the first entry into the idle handler.

ff69f2bba67bd45514923aaedbf40fe351787c59
(acpi: fix of pmtimer overflow that make Cx states time incorrect)
replaced the hard-coded use of the PM-timer inside idle,
with ktime_get_readl(), which possibly uses the TSC --
so it is now especially prudent to detect a broken TSC
before entering idle.

http://bugzilla.kernel.org/show_bug.cgi?id=13087

Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoeCryptfs: Larger buffer for encrypted symlink targets
Tyler Hicks [Thu, 16 Apr 2009 23:35:37 +0000 (18:35 -0500)]
eCryptfs: Larger buffer for encrypted symlink targets

When using filename encryption with eCryptfs, the value of the symlink
in the lower filesystem is encrypted and stored as a Tag 70 packet.
This results in a longer symlink target than if the target value wasn't
encrypted.

Users were reporting these messages in their syslog:

[ 45.653441] ecryptfs_parse_tag_70_packet: max_packet_size is [56]; real
packet size is [51]
[ 45.653444] ecryptfs_decode_and_decrypt_filename: Could not parse tag
70 packet from filename; copying through filename as-is

This was due to bufsiz, one the arguments in readlink(), being used to
when allocating the buffer passed to the lower inode's readlink().
That symlink target may be very large, but when decoded and decrypted,
could end up being smaller than bufsize.

To fix this, the buffer passed to the lower inode's readlink() will
always be PATH_MAX in size when filename encryption is enabled.  Any
necessary truncation occurs after the decoding and decrypting.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agoeCryptfs: Lock lower directory inode mutex during lookup
Tyler Hicks [Wed, 22 Apr 2009 21:27:12 +0000 (16:27 -0500)]
eCryptfs: Lock lower directory inode mutex during lookup

This patch locks the lower directory inode's i_mutex before calling
lookup_one_len() to find the appropriate dentry in the lower filesystem.
This bug was found thanks to the warning set in commit 2f9092e1.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agom68k: Update defconfigs for 2.6.30-rc3
Geert Uytterhoeven [Sun, 29 Mar 2009 12:23:44 +0000 (14:23 +0200)]
m68k: Update defconfigs for 2.6.30-rc3

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
15 years agom68k,m68knommu: Wire up preadv and pwritev
Geert Uytterhoeven [Thu, 9 Apr 2009 20:23:51 +0000 (22:23 +0200)]
m68k,m68knommu: Wire up preadv and pwritev

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Greg Ungerer <gerg@uclinux.org>
15 years agoscsi: a4000 - Correct driver unregistration in case of failure
Geert Uytterhoeven [Thu, 9 Apr 2009 19:22:42 +0000 (21:22 +0200)]
scsi: a4000 - Correct driver unregistration in case of failure

commit 7a192ec334cab9fafe3a8665a65af398b0e24730 ("platform driver: fix
incorrect use of 'platform_bus_type' with 'struct device_driver') turned a
driver_UNregister into platform_driver_REGISTER. Correct this to
platform_driver_UNregister.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
15 years agomediabay: fix build for CONFIG_BLOCK=n
Bartlomiej Zolnierkiewicz [Wed, 22 Apr 2009 18:33:41 +0000 (20:33 +0200)]
mediabay: fix build for CONFIG_BLOCK=n

On Tuesday 14 April 2009 20:31:21 Subrata Modak wrote:
> Observed the following build error:
> ---
> CC      drivers/macintosh/mediabay.o
> In file included from drivers/macintosh/mediabay.c:21:
> include/linux/ide.h:605: error: field ‘request_sense_rq’ has incomplete
> type
> make[2]: *** [drivers/macintosh/mediabay.o] Error 1
> make[1]: *** [drivers/macintosh] Error 2
> make: *** [drivers] Error 2
> ---

mediabay shouldn't include <linux/ide.h> unconditionally so
remove the superfluous include from mediabay.c (<asm/mediabay.h>
will pull <linux/ide.h> in for CONFIG_BLK_DEV_IDE_PMAC=y).

Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: Stop disks on reboot for laptop which cuts power
Bruno Prémont [Wed, 22 Apr 2009 18:33:41 +0000 (20:33 +0200)]
ide: Stop disks on reboot for laptop which cuts power

My laptop (Acer Travelmate 660) always cuts the power when rebooting
which causes the disk to emergency-park it's head.

Add a dmi check to stop disk as for shutdown on this laptop.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: fix kernel crash on hppa regression
Helge Deller [Wed, 22 Apr 2009 18:33:40 +0000 (20:33 +0200)]
ide-cd: fix kernel crash on hppa regression

With 2.6.30-rc2 I face a kernel crash on the 32bit hppa architecture
due to ide-cd when udev creates the device nodes at startup:

Kernel Fault: Code=26 regs=8ed34c40 (Addr=00000024)
IASQ: 00000000 00000000 IAOQ: 1034b5ac 1034b5b0
 IIR: 4ab30048    ISR: 00000000  IOR: 00000024
 CPU:        0   CR30: 8ed34000 CR31: ffff55ff
 ORIG_R28: 00000000
 IAOQ[0]: ide_complete_rq+0x2c/0x70
 IAOQ[1]: ide_complete_rq+0x30/0x70
 RP(r2): cdrom_newpc_intr+0x178/0x46c
Backtrace:
 [<1035c608>] cdrom_newpc_intr+0x178/0x46c
 [<1034c494>] ide_intr+0x1b0/0x214
 [<1016d284>] handle_IRQ_event+0x70/0x150
 [<1016d4b0>] __do_IRQ+0x14c/0x1cc
 [<102f7864>] superio_interrupt+0x88/0xbc
 [<1016d284>] handle_IRQ_event+0x70/0x150
 [<1016d4b0>] __do_IRQ+0x14c/0x1cc
 [<10112efc>] do_cpu_irq_mask+0x9c/0xd0
 [<10116068>] intr_return+0x0/0x4

This crash seems to happen due to an uninitialized variable "rc".
The compiler even warns about that:
  CC      drivers/ide/ide-cd.o
/mnt/sda4/home/cvs/parisc/git-kernel/linus-linux-2.6/drivers/ide/ide-cd.c: In function `cdrom_newpc_intr':
/mnt/sda4/home/cvs/parisc/git-kernel/linus-linux-2.6/drivers/ide/ide-cd.c:612: warning: `rc' might be used uninitialized in this function

After applying the trivial patch below, which just initializes
the variable to zero, the kernel doesn't crash any longer:

Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events...
hda: command error: status=0x51 { DriveReady SeekComplete Error }
hda: command error: error=0x54 <3>{ AbortedCommand LastFailedSense=0x05 }
ide: failed opcode was: unknown
done.

Signed-off-by: Helge Deller <deller@gmx.de>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Cc: Linus <torvalds@linux-foundation.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agopalm_bk3710: UDMA performance fix
David Brownell [Wed, 22 Apr 2009 18:33:40 +0000 (20:33 +0200)]
palm_bk3710: UDMA performance fix

Fix UDMA throughput bug:  tCYC averages t2CYCTYP/2, but the code
previously assumed it was the same as t2CYCTYP.  (That is, it was
using just one clock edge, not both.)  Move the table's type
declaration so it's adjacent to the table, making it more clear
what those numbers mean.

On one system this change increased throughput by almost 4x: UDMA/66
sometimes topped 23 MB/sec (on a drive known to do much better).  On
another system it was around a 10% win (UDMA/66 up to 7+ MB/sec).

The difference might be caused by the ratio between memory and IDE
clocks.  In the system with large speedup, this was exactly 2 (as a
workaround for a rev 1.1 silicon bug).  The other system used a more
standard ratio of 1.63 (and rev 2.1 silicon) ... clock domain synch
might have some issues, they're not unheard-of.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agouv_time: add parameter to uv_read_rtc()
Coly Li [Wed, 22 Apr 2009 15:21:56 +0000 (23:21 +0800)]
uv_time: add parameter to uv_read_rtc()

uv_read_rtc() is referenced by read member of struct clocksource clocksource_uv.
In include/linux/clocksource.h, read of struct clocksource is declared as:
cycle_t (*read)(struct clocksource *cs)

This got introduced recently in:

   8e19608: clocksource: pass clocksource to read() callback

But arch/x86/kernel/uv_time.c was not properly converted by that pach.

This patch adds a dummy parameter (struct clocksource type) to uv_read_rtc() to
fix the incompatible reference in clocksource_uv, and add a NULL parameter in
all places where uv_read_rtc() gets called.

[ Impact: cleanup, address compiler warning ]

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Magnus Damm <damm@igel.co.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hugh@veritas.com>
LKML-Reference: <49EF3614.1050806@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Dimitri Sivanich <sivanich@sgi.com>
15 years agom68knommu: update the default config for the ColdFire 5307C3 board
Greg Ungerer [Wed, 22 Apr 2009 14:11:23 +0000 (00:11 +1000)]
m68knommu: update the default config for the ColdFire 5307C3 board

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agox86: hpet: fix periodic mode programming on AMD 81xx
Andreas Herrmann [Tue, 21 Apr 2009 18:00:37 +0000 (20:00 +0200)]
x86: hpet: fix periodic mode programming on AMD 81xx

(See http://bugzilla.kernel.org/show_bug.cgi?id=12961)

It partially reverts commit c23e253e67c9d8a91a0ffa33c1f571a17f0a2403
(x86: hpet: stop HPET_COUNTER when programming periodic mode)

HPET on AMD 81xx chipset needs a second write (with HPET_TN_SETVAL
cleared) to T0_CMP register to set the period in periodic mode.

With this patch HPET_COUNTER is still stopped but not reset when HPET
is programmed in periodic mode. This should help to avoid races when
HPET is programmed in periodic mode and fixes a boot time hang that
I've observed on a machine when using 1000HZ.

[ Impact: fix boot time hang on machines with AMD 81xx chipset ]

Reported-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Tested-by: Jeff Mahoney <jeffm@suse.com>
LKML-Reference: <20090421180037.GA2763@alberich.amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agom68knommu: update the default config for the ColdFire 5257EVB board
Greg Ungerer [Wed, 22 Apr 2009 13:30:48 +0000 (23:30 +1000)]
m68knommu: update the default config for the ColdFire 5257EVB board

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agom68knommu: update the default config for the ColdFire 5249EVB.
Greg Ungerer [Wed, 22 Apr 2009 13:16:21 +0000 (23:16 +1000)]
m68knommu: update the default config for the ColdFire 5249EVB.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agoKVM: Unregister cpufreq notifier on unload
Jan Kiszka [Fri, 17 Apr 2009 17:24:58 +0000 (19:24 +0200)]
KVM: Unregister cpufreq notifier on unload

Properly unregister cpufreq notifier on onload if it was registered
during init.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
15 years agoKVM: x86: release time_page on vcpu destruction
Joerg Roedel [Wed, 25 Feb 2009 15:08:31 +0000 (16:08 +0100)]
KVM: x86: release time_page on vcpu destruction

Not releasing the time_page causes a leak of that page or the compound
page it is situated in.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
15 years agoKVM: Fix overlapping check for memory slots
Jan Kiszka [Mon, 13 Apr 2009 09:59:32 +0000 (11:59 +0200)]
KVM: Fix overlapping check for memory slots

When checking for overlapping slots on registration of a new one, kvm
currently also considers zero-length (ie. deleted) slots and rejects
requests incorrectly. This finally denies user space from joining slots.
Fix the check by skipping deleted slots and advertise this via a
KVM_CAP_JOIN_MEMORY_REGIONS_WORKS.

Cc: stable@kernel.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
15 years agoKVM: MMU: disable global page optimization
Marcelo Tosatti [Sun, 5 Apr 2009 17:54:46 +0000 (14:54 -0300)]
KVM: MMU: disable global page optimization

Complexity to fix it not worthwhile the gains, as discussed
in http://article.gmane.org/gmane.comp.emulators.kvm.devel/28649.

Cc: stable@kernel.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
15 years agoKVM: ia64: fix locking order entering guest
Jes Sorensen [Thu, 9 Apr 2009 14:38:14 +0000 (16:38 +0200)]
KVM: ia64: fix locking order entering guest

Reorder locking as down_read() may return with local interrupts enabled,
which means we could go into vti_vcpu_run() with interrupts enabled.

This caused random crashes on the Altix as the timer interrupt tried
to read a memory mapped clock source, for which the TLB had not yet been
reinstated in the exit, before ipsr was retored.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
15 years agoKVM: MMU: Fix off-by-one calculating large page count
Avi Kivity [Sun, 29 Mar 2009 13:31:25 +0000 (16:31 +0300)]
KVM: MMU: Fix off-by-one calculating large page count

The large page initialization code concludes there are two large pages spanned
by a slot covering 1 (small) page starting at gfn 1.  This is incorrect, and
also results in incorrect write_count initialization in some cases (base = 1,
npages = 513 for example).

Cc: stable@kernel.org
Signed-off-by: Avi Kivity <avi@redhat.com>
15 years agosparc: Fix bus type probing for ESP and LE devices.
David S. Miller [Fri, 17 Apr 2009 11:14:15 +0000 (04:14 -0700)]
sparc: Fix bus type probing for ESP and LE devices.

If there is a dummy "espdma" or "ledma" parent device above ESP scsi
or LE ethernet device nodes, we have to match the bus as SBUS.

Otherwise the address and size cell counts are wrong and we don't
calculate the final physical device resource values correctly at all.

Commit 5280267c1dddb8d413595b87dc406624bb497946 ("sparc: Fix handling
of LANCE and ESP parent nodes in of_device.c") was meant to fix this
problem, but that only influences the inner loop of
build_device_resources().  We need this logic to also kick in at the
beginning of build_device_resources() as well, when we make the first
attempt to determine the device's immediate parent bus type for 'reg'
property element extraction.

Based almost entirely upon a patch by Friedrich Oslage.

Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge commit 'v2.6.30-rc3' into x86/urgent
Ingo Molnar [Wed, 22 Apr 2009 10:44:16 +0000 (12:44 +0200)]
Merge commit 'v2.6.30-rc3' into x86/urgent

Merge reason: hpet.c changed upstream, make sure we test against that

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agonetfilter: ctnetlink: fix gcc warning during compilation
Pablo Neira Ayuso [Wed, 22 Apr 2009 09:26:37 +0000 (02:26 -0700)]
netfilter: ctnetlink: fix gcc warning during compilation

This patch fixes a (bogus?) gcc warning during compilation:

net/netfilter/nf_conntrack_netlink.c:1234: warning: 'helpname' may be used uninitialized in this function
net/netfilter/nf_conntrack_netlink.c:991: warning: 'helpname' may be used uninitialized in this function

In fact, helpname is initialized by ctnetlink_parse_help() so
I cannot see a way to use it without being initialized.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoeCryptfs: Remove ecryptfs_unlink_sigs warnings
Tyler Hicks [Wed, 22 Apr 2009 09:08:46 +0000 (04:08 -0500)]
eCryptfs: Remove ecryptfs_unlink_sigs warnings

A feature was added to the eCryptfs umount helper to automatically
unlink the keys used for an eCryptfs mount from the kernel keyring upon
umount.  This patch keeps the unrecognized mount option warnings for
ecryptfs_unlink_sigs out of the logs.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agoeCryptfs: Fix data corruption when using ecryptfs_passthrough
Tyler Hicks [Mon, 13 Apr 2009 20:29:27 +0000 (15:29 -0500)]
eCryptfs: Fix data corruption when using ecryptfs_passthrough

ecryptfs_passthrough is a mount option that allows eCryptfs to allow
data to be written to non-eCryptfs files in the lower filesystem.  The
passthrough option was causing data corruption due to it not always
being treated as a non-eCryptfs file.

The first 8 bytes of an eCryptfs file contains the decrypted file size.
This value was being written to the non-eCryptfs files, too.  Also,
extra 0x00 characters were being written to make the file size a
multiple of PAGE_CACHE_SIZE.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agoeCryptfs: Print FNEK sig properly in /proc/mounts
Tyler Hicks [Mon, 16 Mar 2009 17:35:12 +0000 (12:35 -0500)]
eCryptfs: Print FNEK sig properly in /proc/mounts

The filename encryption key signature is not properly displayed in
/proc/mounts.  The "ecryptfs_sig=" mount option name is displayed for
all global authentication tokens, included those for filename keys.

This patch checks the global authentication token flags to determine if
the key is a FEKEK or FNEK and prints the appropriate mount option name
before the signature.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agoeCryptfs: NULL pointer dereference in ecryptfs_send_miscdev()
Tyler Hicks [Sun, 15 Mar 2009 19:17:01 +0000 (14:17 -0500)]
eCryptfs: NULL pointer dereference in ecryptfs_send_miscdev()

If data is NULL, msg_ctx->msg is set to NULL and then dereferenced
afterwards.  ecryptfs_send_raw_message() is the only place that
ecryptfs_send_miscdev() is called with data being NULL, but the only
caller of that function (ecryptfs_process_helo()) is never called.  In
short, there is currently no way to trigger the NULL pointer
dereference.

This patch removes the two unused functions and modifies
ecryptfs_send_miscdev() to remove the NULL dereferences.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agoeCryptfs: Copy lower inode attrs before dentry instantiation
Tyler Hicks [Thu, 12 Mar 2009 05:19:46 +0000 (00:19 -0500)]
eCryptfs: Copy lower inode attrs before dentry instantiation

Copies the lower inode attributes to the upper inode before passing the
upper inode to d_instantiate().  This is important for
security_d_instantiate().

The problem was discovered by a user seeing SELinux denials like so:

type=AVC msg=audit(1236812817.898:47): avc:  denied  { 0x100000 } for
pid=3584 comm="httpd" name="testdir" dev=ecryptfs ino=943872
scontext=root:system_r:httpd_t:s0
tcontext=root:object_r:httpd_sys_content_t:s0 tclass=file

Notice target class is file while testdir is really a directory,
confusing the permission translation (0x100000) due to the wrong i_mode.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agonet/netrom: Fix socket locking
Jean Delvare [Wed, 22 Apr 2009 07:49:51 +0000 (00:49 -0700)]
net/netrom: Fix socket locking

Patch "af_rose/x25: Sanity check the maximum user frame size"
(commit 83e0bbcbe2145f160fbaa109b0439dae7f4a38a9) from Alan Cox got
locking wrong. If we bail out due to user frame size being too large,
we must unlock the socket beforehand.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetlabel: Always remove the correct address selector
Paul Moore [Tue, 21 Apr 2009 10:04:22 +0000 (10:04 +0000)]
netlabel: Always remove the correct address selector

The NetLabel address selector mechanism has a problem where it can get
mistakenly remove the wrong selector when similar addresses are used.  The
problem is caused when multiple addresses are configured that have different
netmasks but the same address, e.g. 127.0.0.0/8 and 127.0.0.0/24.  This patch
fixes the problem.

Reported-by: Etienne Basset <etienne.basset@numericable.fr>
Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by: James Morris <jmorris@namei.org>
Tested-by: Etienne Basset <etienne.basset@numericable.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth.c: Fix upsmr setting in RMII mode
Heiko Schocher [Mon, 20 Apr 2009 22:36:43 +0000 (22:36 +0000)]
ucc_geth.c: Fix upsmr setting in RMII mode

If using the UCC on a MPC8360 in RMII mode, don;t set
UCC_GETH_UPSMR_RPM bit in the upsmr register.

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago8139too: fix HW initial flow
Jianjun kong [Mon, 20 Apr 2009 23:48:25 +0000 (23:48 +0000)]
8139too: fix HW initial flow

While ifconfig eth0 up kernel calls open() of 8139 driver(8139too.c).
In rtl8139_hw_start() of rtl8139_open(), 8139 driver enable RX before
setting up the DMA buffer address. In this interval where RX was
enabled and DMA buffer address is not yet set up, any incoming
broadcast packet would be send to a strange physical address:
0x003e8800 which is the default value of DMA buffer address.
Unfortunately, this address is used by Linux kernel. So kernel panics.
This patch fix it by setting up DMA buffer address before RX enabled
and everything is fine even under broadcast packets attack.

Signed-off-by: Jonathan Lin <jon.lin@vatics.com>
Signed-off-by: Amos Kong <jianjun@zeuux.org>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agom68knommu: add a defconfig for the ColdFire M5272C3 board
Greg Ungerer [Wed, 22 Apr 2009 07:26:49 +0000 (17:26 +1000)]
m68knommu: add a defconfig for the ColdFire M5272C3 board

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agom68knommu: update the defconfig for the ColdFire 5208evb board
Greg Ungerer [Wed, 22 Apr 2009 07:10:46 +0000 (17:10 +1000)]
m68knommu: update the defconfig for the ColdFire 5208evb board

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agoMerge commit 'alsa/master' into for-linus
Takashi Iwai [Wed, 22 Apr 2009 07:09:29 +0000 (09:09 +0200)]
Merge commit 'alsa/master' into for-linus

* commit 'alsa/master':
  [ALSA] intel8x0: another attempt to fix ac97_clock measure routine
  [ALSA] ac97_codec: increase timeout for analog subsections

15 years agoaf_iucv: Fix race when queuing incoming iucv messages
Hendrik Brueckner [Tue, 21 Apr 2009 06:04:24 +0000 (06:04 +0000)]
af_iucv: Fix race when queuing incoming iucv messages

AF_IUCV runs into a race when queuing incoming iucv messages
and receiving the resulting backlog.

If the Linux system is under pressure (high load or steal time),
the message queue grows up, but messages are not received and queued
onto the backlog queue. In that case, applications do not
receive any data with recvmsg() even if AF_IUCV puts incoming
messages onto the message queue.

The race can be avoided if the message queue spinlock in the
message_pending callback is spreaded across the entire callback
function.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaf_iucv: Test additional sk states in iucv_sock_shutdown
Hendrik Brueckner [Tue, 21 Apr 2009 06:04:23 +0000 (06:04 +0000)]
af_iucv: Test additional sk states in iucv_sock_shutdown

Add few more sk states in iucv_sock_shutdown().

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaf_iucv: Reject incoming msgs if RECV_SHUTDOWN is set
Hendrik Brueckner [Tue, 21 Apr 2009 06:04:22 +0000 (06:04 +0000)]
af_iucv: Reject incoming msgs if RECV_SHUTDOWN is set

Reject incoming iucv messages if the receive direction has been shut down.
It avoids that the queue of outstanding messages increases and exceeds the
message limit of the iucv communication path.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaf_iucv: fix oops in iucv_sock_recvmsg() for MSG_PEEK flag
Hendrik Brueckner [Tue, 21 Apr 2009 06:04:21 +0000 (06:04 +0000)]
af_iucv: fix oops in iucv_sock_recvmsg() for MSG_PEEK flag

If iucv_sock_recvmsg() is called with MSG_PEEK flag set, the skb is enqueued
twice. If the socket is then closed, the pointer to the skb is freed twice.

Remove the skb_queue_head() call for MSG_PEEK, because the skb_recv_datagram()
function already handles MSG_PEEK (does not dequeue the skb).

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaf_iucv: consider state IUCV_CLOSING when closing a socket
Ursula Braun [Tue, 21 Apr 2009 06:04:20 +0000 (06:04 +0000)]
af_iucv: consider state IUCV_CLOSING when closing a socket

Make sure a second invocation of iucv_sock_close() guarantees proper
freeing of an iucv path.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocfq-iosched: use the default seek distance when there aren't enough seek samples
Jeff Moyer [Tue, 21 Apr 2009 05:31:56 +0000 (07:31 +0200)]
cfq-iosched: use the default seek distance when there aren't enough seek samples

If the cfq io context doesn't have enough samples yet to provide a mean
seek distance, then use the default threshold we have for seeky IO instead
of defaulting to 0.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agocfq-iosched: make seek_mean converge more quickly
Jeff Moyer [Tue, 21 Apr 2009 05:25:04 +0000 (07:25 +0200)]
cfq-iosched: make seek_mean converge more quickly

Right now, depending on the first sector to which a process issues I/O,
the seek time may start out way out of whack. So make sure we start
with 0 sectors in seek, instead of the offset of the first request
issued.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoblock: make blk_abort_queue() ignore non-request based devices
Jens Axboe [Fri, 17 Apr 2009 06:36:50 +0000 (08:36 +0200)]
block: make blk_abort_queue() ignore non-request based devices

There's nothing to do for those devices, since the timeout handling is
based on requests.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoblock: include empty disks in /proc/diskstats
Tejun Heo [Fri, 17 Apr 2009 06:34:48 +0000 (08:34 +0200)]
block: include empty disks in /proc/diskstats

/proc/diskstats used to show stats for all disks whether they're
zero-sized or not and their non-zero partitions.  Commit
074a7aca7afa6f230104e8e65eba3420263714a5 accidentally changed the
behavior such that it doesn't print out zero sized disks.  This patch
implements DISK_PITER_INCL_EMPTY_PART0 flag to partition iterator and
uses it in diskstats_show() such that empty part0 is shown in
/proc/diskstats.

Reported and bisectd by Dianel Collins.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Daniel Collins <solemnwarning@solemnwarning.no-ip.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agobio: use bio_kmalloc() in copy/map functions
Tejun Heo [Wed, 15 Apr 2009 13:10:27 +0000 (22:10 +0900)]
bio: use bio_kmalloc() in copy/map functions

Impact: remove possible deadlock condition

There is no reason to use mempool backed allocation for map functions.
Also, because kern mapping is used inside LLDs (e.g. for EH), using
mempool backed allocation can lead to deadlock under extreme
conditions (mempool already consumed by the time a request reached EH
and requests are blocked on EH).

Switch copy/map functions to bio_kmalloc().

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agobio: fix bio_kmalloc()
Tejun Heo [Wed, 15 Apr 2009 17:50:51 +0000 (19:50 +0200)]
bio: fix bio_kmalloc()

Impact: fix bio_kmalloc() and its destruction path

bio_kmalloc() was broken in two ways.

* bvec_alloc_bs() first allocates bvec using kmalloc() and then
  ignores it and allocates again like non-kmalloc bvecs.

* bio_kmalloc_destructor() didn't check for and free bio integrity
  data.

This patch fixes the above problems.  kmalloc patch is separated out
from bio_alloc_bioset() and allocates the requested number of bvecs as
inline bvecs.

* bio_alloc_bioset() no longer takes NULL @bs.  None other than
  bio_kmalloc() used it and outside users can't know how it was
  allocated anyway.

* Define and use BIO_POOL_NONE so that pool index check in
  bvec_free_bs() triggers if inline or kmalloc allocated bvec gets
  there.

* Relocate destructors on top of each allocation function so that how
  they're used is more clear.

Jens Axboe suggested allocating bvecs inline.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoblock: fix queue bounce limit setting
Tejun Heo [Wed, 15 Apr 2009 13:10:25 +0000 (22:10 +0900)]
block: fix queue bounce limit setting

Impact: don't set GFP_DMA in q->bounce_gfp unnecessarily

All DMA address limits are expressed in terms of the last addressable
unit (byte or page) instead of one plus that.  However, when
determining bounce_gfp for 64bit machines in blk_queue_bounce_limit(),
it compares the specified limit against 0x100000000UL to determine
whether it's below 4G ending up falsely setting GFP_DMA in
q->bounce_gfp.

As DMA zone is very small on x86_64, this makes larger SG_IO transfers
very eager to trigger OOM killer.  Fix it.  While at it, rename the
parameter to @dma_mask for clarity and convert comment to proper
winged style.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoblock: fix SG_IO vector request data length handling
Tejun Heo [Wed, 15 Apr 2009 13:10:24 +0000 (22:10 +0900)]
block: fix SG_IO vector request data length handling

Impact: fix SG_IO behavior such that it matches the documentation

SG_IO howto says that if ->dxfer_len and sum of iovec disagress, the
shorter one wins.  However, the current implementation returns -EINVAL
for such cases.  Trim iovc if it's longer than ->dxfer_len.

This patch uses iov_*() helpers which take struct iovec * by casting
struct sg_iovec * to it.  sg_iovec is always identical to iovec and
this will be further cleaned up with later patches.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoscatterlist: make sure sg_miter_next() doesn't return 0 sized mappings
Tejun Heo [Wed, 15 Apr 2009 13:10:23 +0000 (22:10 +0900)]
scatterlist: make sure sg_miter_next() doesn't return 0 sized mappings

Impact: fix not-so-critical but annoying bug

sg_miter_next() returns 0 sized mapping if there is an zero sized sg
entry in the list or at the end of each iteration.  As the users
always check the ->length field, this bug shouldn't be critical other
than causing unnecessary iteration.

Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agopowerpc: Fix modular build of ide-pmac when mediabay is built in
Bartlomiej Zolnierkiewicz [Tue, 21 Apr 2009 09:04:37 +0000 (09:04 +0000)]
powerpc: Fix modular build of ide-pmac when mediabay is built in

Now that the powermac IDE host driver can be modular, we need to
export check_media_bay_by_base() and media_bay_set_ide_infos()
from drivers/macintosh/mediabay.c for it.

This fixes the following build error:

> CC [M]  drivers/ide/pmac.o
> drivers/ide/pmac.c: In function ‘pmac_ide_init_dev’:
> drivers/ide/pmac.c:955: error: implicit declaration of function
> ‘check_media_bay_by_base’
> drivers/ide/pmac.c: In function ‘pmac_ide_setup_device’:
> drivers/ide/pmac.c:1090: error: implicit declaration of function
> ‘media_bay_set_ide_infos’
> make[2]: *** [drivers/ide/pmac.o] Error 1
> make[1]: *** [drivers/ide] Error 2
> make: *** [drivers] Error 2

Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc/pasemi: Fix build error on UP
Geoff Levand [Fri, 17 Apr 2009 06:36:37 +0000 (06:36 +0000)]
powerpc/pasemi: Fix build error on UP

A non-SMP version of smp_send_stop() is now included in smp.h.
Remove the unneeded definition in the pasemi setup.c.

Fixes build errors like these when CONFIG_SMP=n:

  arch/powerpc/platforms/pasemi/setup.c:48: error: redefinition of ‘smp_send_stop’
  include/linux/smp.h:125: error: previous definition of 'smp_send_stop' was here

Reported-by: subrata@linux.vnet.ibm.com
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc: Make macintosh/mediabay driver depend on CONFIG_BLOCK
Alexander Beregalov [Fri, 17 Apr 2009 00:15:13 +0000 (00:15 +0000)]
powerpc: Make macintosh/mediabay driver depend on CONFIG_BLOCK

Fixes this build error:

In file included from drivers/macintosh/mediabay.c:21:
include/linux/ide.h:605: error: field 'request_sense_rq' has incomplete type

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agomaintainers: Fix PS3 patterns
Geoff Levand [Thu, 16 Apr 2009 09:05:40 +0000 (09:05 +0000)]
maintainers: Fix PS3 patterns

Correct the MAINTAINERS file patterns for PS3.  Removes some PS3
patterns that were under 'CELL BROADBAND ENGINE ARCHITECTURE', and
adds missing PS3 sound and RTC driver patterns.

CC: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc/ps3: Fix CONFIG_PS3_FLASH=n build warning
Geoff Levand [Thu, 16 Apr 2009 09:05:38 +0000 (09:05 +0000)]
powerpc/ps3: Fix CONFIG_PS3_FLASH=n build warning

Fix build warnings like these when CONFIG_PS3_FLASH=n:

  arch/powerpc/platforms/ps3/os-area.c: warning: 'update_flash_db' defined but not used

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc/32: Don't clobber personality flags on exec
Andreas Schwab [Thu, 16 Apr 2009 06:22:01 +0000 (06:22 +0000)]
powerpc/32: Don't clobber personality flags on exec

Now that ppc32 implements address randomization it also wants to inherit
personality flags like ADDR_NO_RANDOMIZE across exec, for things like
`setarch ppc -R' to work.  But the ppc32 version of SET_PERSONALITY
forcefully sets PER_LINUX, clearing all personality flags.  So be
careful about preserving the flags.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc: Fix crash on CPU hotplug
Michael Ellerman [Thu, 16 Apr 2009 04:47:32 +0000 (04:47 +0000)]
powerpc: Fix crash on CPU hotplug

early_init_mmu_secondary() is called at CPU hotplug time, so it
must be marked as __cpuinit, not __init.

Caused by 757c74d2 ("powerpc/mm: Introduce early_init_mmu() on 64-bit").

Tested-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agom68knommu: fix DMA support for ColdFire
Greg Ungerer [Fri, 17 Apr 2009 13:11:38 +0000 (23:11 +1000)]
m68knommu: fix DMA support for ColdFire

ColdFire CPU family members support DMA (all those with the FEC ethernet
core use it, the rest have dedicated DMA engines). The code support is
just missing a handful of routines for it to be usable by drivers.
Add the missing dma_ functions.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agom68knommu: remove unused kernel stats offsets
Greg Ungerer [Fri, 17 Apr 2009 12:56:50 +0000 (22:56 +1000)]
m68knommu: remove unused kernel stats offsets

The irq field of the kernel stats struct is not used by the assembly
support code, so remove it from the offsets.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agom68knommu: fix missing .data.cacheline_aligned section
Greg Ungerer [Fri, 17 Apr 2009 12:55:06 +0000 (22:55 +1000)]
m68knommu: fix missing .data.cacheline_aligned section

Add a .data.cacheline_aligned section to the data segment.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agom68knommu: Fixed GPIO pin initialization for CONFIG_M5271 FEC.
Richard Retanubun [Wed, 8 Apr 2009 01:51:27 +0000 (11:51 +1000)]
m68knommu: Fixed GPIO pin initialization for CONFIG_M5271 FEC.

This processor only have one FEC and its MDIO pins are
located at a different offset than the code used for
the current CONFIG_M527x.

Tesed on M5271EVB eval platform.
Without this patch the FEC driver will report no PHY attached
if the bootloader does not pre-initialize the PAR_FECI2C GPIO register.

Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
15 years agoLinux 2.6.30-rc3 v2.6.30-rc3
Linus Torvalds [Wed, 22 Apr 2009 03:07:00 +0000 (20:07 -0700)]
Linux 2.6.30-rc3

15 years agoMerge branch 'merge' of git://git.secretlab.ca/git/linux-2.6 into merge
Paul Mackerras [Wed, 22 Apr 2009 03:02:09 +0000 (13:02 +1000)]
Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6 into merge

15 years agodriver synchronization: make scsi_wait_scan more advanced
Arjan van de Ven [Tue, 21 Apr 2009 20:32:54 +0000 (13:32 -0700)]
driver synchronization: make scsi_wait_scan more advanced

There is currently only one way for userspace to say "wait for my storage
device to get ready for the modules I just loaded": to load the
scsi_wait_scan module. Expectations of userspace are that once this
module is loaded, all the (storage) devices for which the drivers
were loaded before the module load are present.

Now, there are some issues with the implementation, and the async
stuff got caught in the middle of this: The existing code only
waits for the scsy async probing to finish, but it did not take
into account at all that probing might not have begun yet.
(Russell ran into this problem on his computer and the fix works for him)

This patch fixes this more thoroughly than the previous "fix", which
had some bad side effects (namely, for kernel code that wanted to wait for
the scsi scan it would also do an async sync, which would deadlock if you did
it from async context already.. there's a report about that on lkml):
The patch makes the module first wait for all device driver probes, and then it
will wait for the scsi parallel scan to finish.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoTrivial: fix a typo in slow-work.h
Jonathan Corbet [Tue, 21 Apr 2009 22:30:32 +0000 (16:30 -0600)]
Trivial: fix a typo in slow-work.h

Fix a comment typo in slow-work.h

...a trivial mistake, but it will mess up kerneldoc if nothing else.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoPERCPU: Collect the DECLARE/DEFINE declarations together
David Howells [Tue, 21 Apr 2009 22:00:29 +0000 (23:00 +0100)]
PERCPU: Collect the DECLARE/DEFINE declarations together

Collect the DECLARE/DEFINE declarations together in linux/percpu-defs.h so
that they're in one place, and give them descriptive comments, particularly
the SHARED_ALIGNED variant.

It would be nice to collect these in linux/percpu.h, but that's not possible
without sorting out the severe #include recursion between the x86 arch headers
and the general headers (and possibly other arches too).

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>