Adrian Bunk [Tue, 5 Aug 2008 16:17:00 +0000 (18:17 +0200)]
remove unneeded #include <linux/ide.h>'s
This patch remove unneeded #include <linux/ide.h>'s.
It also adds a required #include <linux/interrupt.h> that was previously
implicitely pulled by ide.h
Signed-off-by: Adrian Bunk <bunk@kernel.org>
[bart: revert change to tests/lkdtm.c (spotted by Stephen Rothwell)] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
The guilty commit turned out to be 08da591e14cf87247ec09b17c350235157a92fc3
("ide: add ide_device_{get,put}() helpers"). ide_device_put() is called
before kref_put() in ide_cd_put() so IDE device is already gone by the time
ide_cd_release() is reached.
Fix it by calling ide_device_get() before kref_get() and ide_device_put()
after kref_put() in all affected device drivers.
v2:
Brown paper bag time. In v1 cd->drive was referenced after dropping last
reference on cd object (which could result in OOPS in ide_device_put() as
reported/debugged by Mariusz Kozlowski). Fix it by caching cd->drive in
the local variable (fix other device drivers too).
Nick Piggin [Sat, 2 Aug 2008 10:01:03 +0000 (12:01 +0200)]
mm: rename page trylock
Converting page lock to new locking bitops requires a change of page flag
operation naming, so we might as well convert it to something nicer
(!TestSetPageLocked_Lock => trylock_page, SetPageLocked => set_page_locked).
This also facilitates lockdeping of page lock.
Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: Remove all cpumask_t local variables in xcall dispatch.
sparc64: Kill error_mask from hypervisor_xcall_deliver().
sparc64: Build cpu list and mondo block at top-level xcall_deliver().
sparc64: Disable local interrupts around xcall_deliver_impl() invocation.
sparc64: Make all xcall_deliver's go through common helper function.
sparc64: Always allocate the send mondo blocks, even on non-sun4v.
sparc64: Make smp_cross_call_masked() take a cpumask_t pointer.
sparc64: Directly call xcall_deliver() in smp_start_sync_tick_client.
sparc64: Call xcall_deliver() directly in some cases.
sparc64: Use cpumask_t pointers and for_each_cpu_mask_nr() in xcall_deliver.
sparc64: Use xcall_deliver() consistently.
sparc64: Use function pointer for cross-call sending.
arch/sparc64/kernel/signal.c: removed duplicated #include
sparc64: Need to disable preemption around smp_tsb_sync().
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (29 commits)
sh: enable maple_keyb in dreamcast_defconfig.
SH2(A) cache update
nommu: Provide vmalloc_exec().
add addrespace definition for sh2a.
sh: Kill off ARCH_SUPPORTS_AOUT and remnants of a.out support.
sh: define GENERIC_HARDIRQS_NO__DO_IRQ.
sh: define GENERIC_LOCKBREAK.
sh: Save NUMA node data in vmcore for crash dumps.
sh: module_alloc() should be using vmalloc_exec().
sh: Fix up __bug_table handling in module loader.
sh: Add documentation and integrate into docbook build.
sh: Fix up broken kerneldoc comments.
maple: Kill useless private_data pointer.
maple: Clean up maple_driver_register/unregister routines.
input: Clean up maple keyboard driver
maple: allow removal and reinsertion of keyboard driver module
sh: /proc/asids depends on MMU.
arch/sh/boards/mach-se/7343/irq.c: removed duplicated #include
arch/sh/boards/board-ap325rxa.c: removed duplicated #include
sh/boards/Makefile typo fix
...
Linus Torvalds [Tue, 5 Aug 2008 00:25:06 +0000 (17:25 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: Remove use of CONFIG_PPC_MERGE
powerpc: Force printing of 'total_memory' to unsigned long long
powerpc: Fix compiler warning in arch/powerpc/mm/mem.c
powerpc: Move include files to arch/powerpc/include/asm
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
kconfig: drop the ""trying to assign nonexistent symbol" warning
kconfig: always write out .config
Paul Mundt [Mon, 4 Aug 2008 10:21:23 +0000 (11:21 +0100)]
mn10300: Fix up __bug_table handling in module loader.
Platforms that are using GENERIC_BUG must call in to
module_bug_finalize()/module_bug_cleanup() in order to scan modules with
their own __bug_table sections that are otherwise unaccounted.
Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Tue, 5 Aug 2008 00:21:38 +0000 (17:21 -0700)]
Merge branch 'audit.b56' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current
* 'audit.b56' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
Re: [PATCH] Fix the kernel panic of audit_filter_task when key field is set
__sched_setscheduler: don't do any policy checks when not "user"
The "user" parameter to __sched_setscheduler indicates whether the
change is being done on behalf of a user process or not. If not, we
shouldn't apply any permissions checks, so don't call
security_task_setscheduler().
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Tested-by: Steve Wise <swise@opengridcomputing.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andrew Morton [Mon, 4 Aug 2008 16:56:02 +0000 (17:56 +0100)]
alpha: Fix breakage in wdt_pci
drivers/watchdog/wdt_pci.c: In function 'wdtpci_ctr_mode':
drivers/watchdog/wdt_pci.c:120: error: implicit declaration of function 'udelay'
{standard input}: Assembler messages:
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Alan Cox [Mon, 4 Aug 2008 16:47:07 +0000 (17:47 +0100)]
vt: Deadlock workaround
2.6.26 corrected the mutex locking on tty resizing to fix the case where
you could get the tty/vt sizing out of sync. That turns out to have a
deadlock.
The actual fix is really major and I've got it lined up as part of the ops
changes for 2.6.28 so for 2.6.26/2.6.27 it is safer to reintroduce this
ages old minor bug.
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Willy Tarreau [Sat, 2 Aug 2008 16:25:16 +0000 (18:25 +0200)]
sound: ensure device number is valid in snd_seq_oss_synth_make_info
snd_seq_oss_synth_make_info() incorrectly reports information
to userspace without first checking for the validity of the
device number, leading to possible information leak (CVE-2008-3272).
* git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6:
Add DIP switch readout for HFC-4S IOB4ST
Fix remaining big endian issue of hfcmulti
mISDN cleanup user interface
mISDN fix main ISDN Makefile
addr = 0;
while (1)
{
/* map a page into memory each time*/
if ((addr = (char *) mmap(addr,page_size, PROT_READ |
PROT_WRITE,MAP_SHARED,fd,0)) == MAP_FAILED)
{
printf("cant do mmap on file\n");
exit(1);
}
if (0 == i)
addr1 = addr;
i++;
errno = 0;
/* lock the mapped memory pagewise*/
if ((ret = mlock((char *)addr, 1500)) == -1)
{
printf("errno value is %d\n", errno);
printf("cant lock maped region\n");
exit(1);
}
addr = addr + page_size;
}
}
======================================================
This testcase results in an mlock() failure with errno 14 that is EFAULT,
but it has nowhere been specified that mlock() will return EFAULT. When I
tested the same on older kernels like 2.6.18, I got the correct result i.e
errno 12 (ENOMEM).
I think in source code mlock(2), setting errno ENOMEM has been missed in
do_mlock() , on mlock_fixup() failure.
SUSv3 requires the following behavior frmo mlock(2).
[ENOMEM]
Some or all of the address range specified by the addr and
len arguments does not correspond to valid mapped pages
in the address space of the process.
[EAGAIN]
Some or all of the memory identified by the operation could not
be locked when the call was made.
This rule isn't so nice and slighly strange. but many people think
POSIX/SUS compliance is important.
Gerard Kam [Mon, 4 Aug 2008 20:41:12 +0000 (13:41 -0700)]
atmel_spi: fix hang due to missed interrupt
For some time my at91sam9260 board with JFFS2 on serial flash (m25p80)
would hang when accessing the serial flash and SPI bus. Slowing the SPI
clock down to 9 MHz reduced the occurrence of the hang from "always"
during boot to a nuisance level that allowed other SW development to
continue. Finally had to address this issue when an application stresses
the I/O to always cause a hang.
Hang seems to be caused by a missed SPI interrupt, so that the task ends
up waiting forever after calling spi_sync(). The fix has 2 parts. First
is to halt the DMA engine before the "current" PDC registers are loaded.
This ensures that the "next" registers are loaded before the DMA operation
takes off. The second part of the fix is a kludge that adds a
"completion" interrupt in case the ENDRX interrupt for the last segment of
the DMA chaining operation was missed.
The patch allows the SPI clock for the serial flash to be increased from 9
MHz to 15 MHz (or more?). No hangs or SPI overruns were encountered.
Haavard: while this patch does indeed improve things, I still see overruns
and CRC errors on my NGW100 board when running the DataFlash at 10 MHz.
However, I think some improvement is better than nothing, so I'm passing
this on for inclusion in 2.6.27.
Signed-off-by: Gerard Kam <gerardk5@verizon.net> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ben Dooks [Mon, 4 Aug 2008 20:41:10 +0000 (13:41 -0700)]
spi: S3C24XX: reset register status on resume.
Fix a bug in the spi_s3c24xx driver where it does not reset the registers
of the hardware when resuming from suspend (this block has been reset over
suspend).
Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The changes cause problems for at least the sparc build. Let's re-do
them when the exact issues are resolved.
Requested-by: Andrew Morton <akpm@linux-foundation.org> Requested-by: Steven Whitehouse <swhiteho@redhat.com> Cc: David Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David S. Miller [Mon, 4 Aug 2008 23:47:57 +0000 (16:47 -0700)]
sparc64: Kill error_mask from hypervisor_xcall_deliver().
It can eat up a lot of stack space when NR_CPUS is large.
We retain some of it's functionality by reporting at least one
of the cpu's which are seen in error state.
Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Mon, 4 Aug 2008 23:36:20 +0000 (16:36 -0700)]
Revert "[SCSI] extend the last_sector_bug flag to cover more sectors"
This reverts commit 2b142900784c6e38c8d39fa57d5f95ef08e735d8, since it
seems to break some other USB storage devices (at least a JMicron USB to
ATA bridge). As such, while it apparently fixes some cardreaders, it
would need to be made conditional on the exact reader it fixes in order
to avoid causing regressions.
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David S. Miller [Mon, 4 Aug 2008 06:56:28 +0000 (23:56 -0700)]
sparc64: Call xcall_deliver() directly in some cases.
For these cases the callers make sure:
1) The cpus indicated are online.
2) The current cpu is not in the list of indicated cpus.
Therefore we can pass a pointer to the mask directly.
One of the motivations in this transformation is to make use of
"&cpumask_of_cpu(cpu)" which evaluates to a pointer to constant
data in the kernel and thus takes up no stack space.
Hopefully someone in the future will change the interface of
arch_send_call_function_ipi() such that it passes a const cpumask_t
pointer so that this will optimize ever further.
Signed-off-by: David S. Miller <davem@davemloft.net>
zhangxiliang [Sat, 2 Aug 2008 02:56:37 +0000 (10:56 +0800)]
Re: [PATCH] Fix the kernel panic of audit_filter_task when key field is set
Sorry, I miss a blank between if and "(".
And I add "unlikely" to check "ctx" in audit_match_perm() and audit_match_filetype().
This is a new patch for it.
Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Paul Mundt [Mon, 4 Aug 2008 07:01:47 +0000 (16:01 +0900)]
nommu: Provide vmalloc_exec().
Now that SH has switched to vmalloc_exec() for PAGE_KERNEL_EXEC usage,
it's apparent that nommu has no vmalloc_exec() definition of its own.
Stub in the one from mm/vmalloc.c.
Takashi Yoshii [Mon, 4 Aug 2008 05:28:38 +0000 (14:28 +0900)]
add addrespace definition for sh2a.
Newfile: arch/sh/include/cpu-sh2a/cpu/addrspace.h
This file seems had be removed to use fallback (cpu-common/cpu/addrspace.h),
but, I'd like to add sh2a specific file here, because
1. the values defined there are not suitable for sh2a.
2. I don't think there is "common" definition for these values.
Values are chosen by consideration of followings...
P1 is 0. perhaps no question.
P2 is from hardware manual, which says no-cache area starts at 20000000.
It means that P? space size=20000000.
P3 is P2+size since asm/ptrace.h uses P3 as a end of P2.
P4 is P3+size since asm/fixup.h uses P4 as a end of P3.
Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 4 Aug 2008 05:18:53 +0000 (14:18 +0900)]
sh: Kill off ARCH_SUPPORTS_AOUT and remnants of a.out support.
SH never really supported a.out, so this was all just copied over blindly
from x86 way back when. As we don't reference linux/a.out.h anywhere in
the tree, these can now safely be killed off.
Kumar Gala [Fri, 1 Aug 2008 16:44:11 +0000 (02:44 +1000)]
powerpc: Remove use of CONFIG_PPC_MERGE
Now that arch/ppc is gone and CONFIG_PPC_MERGE is always set, remove
the dead code associated with !CONFIG_PPC_MERGE from arch/powerpc
and include/asm-powerpc.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Followed by a few documentation/comment fixups and a couple of places
where <asm-powepc/...> was being used explicitly. Of the latter only
one was outside the arch code and it is a driver only built for powerpc.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Adrian McMenamin [Wed, 30 Jul 2008 19:31:38 +0000 (12:31 -0700)]
maple: allow removal and reinsertion of keyboard driver module
Allow the removal (and subsequent reinsertion) of the maple_keyb (maple
keyboard) driver by adding a working removal function.
Also tidy long lines.
Signed-off-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Linus Torvalds [Sun, 3 Aug 2008 17:50:44 +0000 (10:50 -0700)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: remove write-only variables from ext4_ordered_write_end
ext4: unexport jbd2_journal_update_superblock
ext4: Cleanup whitespace and other miscellaneous style issues
ext4: improve ext4_fill_flex_info() a bit
ext4: Cleanup the block reservation code path
ext4: don't assume extents can't cross block groups when truncating
ext4: Fix lack of credits BUG() when deleting a badly fragmented inode
ext4: Fix ext4_ext_journal_restart()
ext4: fix ext4_da_write_begin error path
jbd2: don't abort if flushing file data failed
ext4: don't read inode block if the buffer has a write error
ext4: Don't allow lg prealloc list to be grow large.
ext4: Convert the usage of NR_CPUS to nr_cpu_ids.
ext4: Improve error handling in mballoc
ext4: lock block groups when initializing
ext4: sync up block and inode bitmap reading functions
ext4: Allow read/only mounts with corrupted block group checksums
ext4: Fix data corruption when writing to prealloc area
In file included from arch/arm/mach-pxa/pcm990-baseboard.c:25:
include/linux/ide.h:645: error: 'CONFIG_IDE_MAX_HWIFS' undeclared here (not in a function)
Fix it by removing unneeded header include.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Cc: Tim Bird <tim.bird@am.sony.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Russell King [Sat, 2 Aug 2008 21:33:18 +0000 (22:33 +0100)]
[ARM] Fix explicit asm(-arm)?/arch-foo references
No file should be explicitly referencing its own platform headers
by specifying an absolute include path. Fix these paths to use
standard <asm/arch/...> includes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Marc Zyngier [Sat, 2 Aug 2008 17:12:23 +0000 (19:12 +0200)]
Fix IHEX firmware generation/loading
Fix both the IHEX firmware generation (len field always null, and EOF
marker a byte too short) and loading (struct ihex_binrec needs to be
packed to reflect the on-disk structure).
Signed-off-by: Marc Zyngier <maz@misterjones.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* git://git.infradead.org/users/dwmw2/random-2.6:
[MTD] Fix !CONFIG_BLOCK compile for mtdsuper.c
firmware: silence __fw_modbuild and __fw_modinst 'Nothing to be done' messages
Miklos Szeredi [Fri, 1 Aug 2008 18:28:47 +0000 (20:28 +0200)]
mm: dont clear PG_uptodate on truncate/invalidate
Brian Wang reported that a FUSE filesystem exported through NFS could
return I/O errors on read. This was traced to splice_direct_to_actor()
returning a short or zero count when racing with page invalidation.
However this is not FUSE or NFSD specific, other filesystems (notably
NFS) also call invalidate_inode_pages2() to purge stale data from the
cache.
If this happens while such pages are sitting in a pipe buffer, then
splice(2) from the pipe can return zero, and read(2) from the pipe can
return ENODATA.
The zero return is especially bad, since it implies end-of-file or
disconnected pipe/socket, and is documented as such for splice. But
returning an error for read() is also nasty, when in fact there was no
error (data becoming stale is not an error).
The same problems can be triggered by "hole punching" with
madvise(MADV_REMOVE).
Fix this by not clearing the PG_uptodate flag on truncation and
invalidation.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Acked-by: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Karsten Keil [Sat, 2 Aug 2008 14:35:53 +0000 (16:35 +0200)]
Fix remaining big endian issue of hfcmulti
The driver was not so bad at big endian at all, only the optimised fifo
read/write functions need a fix, with this fix the driver works on
a pegasus PPC machine.
David Woodhouse [Fri, 1 Aug 2008 23:01:21 +0000 (00:01 +0100)]
[MTD] Fix !CONFIG_BLOCK compile for mtdsuper.c
As reported by Adrian Bunk, commit d5686b444ff3f72808d2b3fbd58672a86cdf38e7
(switch mtd and dm-table to lookup_bdev()) causes the following compile
error with CONFIG_BLOCK=n:
CC drivers/mtd/mtdsuper.o
drivers/mtd/mtdsuper.c: In function `get_sb_mtd':
drivers/mtd/mtdsuper.c:184: error: implicit declaration of function 'lookup_bdev'
drivers/mtd/mtdsuper.c:184: warning: assignment makes pointer from integer without a cast
drivers/mtd/mtdsuper.c:197: error: implicit declaration of function 'bdput'
make[3]: *** [drivers/mtd/mtdsuper.o] Error 1
Fix it by putting the block device lookup inside #ifdef CONFIG_BLOCK
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
David Woodhouse [Fri, 1 Aug 2008 22:58:36 +0000 (23:58 +0100)]
firmware: silence __fw_modbuild and __fw_modinst 'Nothing to be done' messages
People don't like them and think they're errors.
Leave the __fw_install one though; when 'make firmware_install' does
nothing, it's best to have a 'Nothing to be done for...' message rather
than just doing nothing.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Adrian Bunk [Fri, 1 Aug 2008 22:13:44 +0000 (01:13 +0300)]
sh: fix LIBGCC
Commit f15cbe6f1a4b4d9df59142fc8e4abb973302cf44
(sh: migrate to arch/sh/include/) moved KBUILD_CFLAGS
(which is used by LIBGCC) below LIBGCC, causing build
errors like the following:
<-- snip -->
...
LD .tmp_vmlinux1
arch/sh/kernel/built-in.o: In function `module_clk_recalc':
clock-sh4.c:(.text+0x80f0): undefined reference to `__udivsi3_i4i'
...
make[1]: *** [.tmp_vmlinux1] Error 1
<-- snip -->
Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>