Dave Jiang [Sun, 3 Oct 2004 23:28:36 +0000 (00:28 +0100)]
[ARM PATCH] 2117/1: Fix ATU config on IQ80331 to prevent master aborts, replace 2099/1
Patch from Dave Jiang
Latest IQ80331 redboot changed value of ATU registers and is causing master aborts on the plugged in card. Changing value back to previous sane state for Linux.
Signed-off-by: Dave Jiang (dave.jiang@gmail.com)
Patch in replacement of 2099/1 due to formatting problems.
Russell King [Sun, 3 Oct 2004 21:46:58 +0000 (22:46 +0100)]
[ARM] Check access permissions for whole of signal stack frame.
We really need to check that we have access to the whole of the
signal frame when we allocate it, rather than "most of it" when
we have iWMMXt extensions selected.
Russell King [Sun, 3 Oct 2004 21:36:58 +0000 (22:36 +0100)]
[ARM] Fix consistent.c for DMA allocations.
- Use ISA_DMA_THRESHOLD as the mask for GFP_DMA allocations.
- Don't allow DMA allocations which are for a "smaller" mask than
ISA_DMA_THRESHOLD.
- Ensure that "handle" is initialised to our error value when
returning an error.
Roland Dreier [Sun, 3 Oct 2004 04:04:37 +0000 (21:04 -0700)]
[PATCH] ppc64: fix cross-compilation
After the "ppc64 monster cleanup," I get
powerpc-750-linux-gnu-strip: vmlinux: File format not recognized
from my ppc32 strip command when cross-compiling a ppc64 kernel, since
vmlinux is a 64-bit ELF file. This patch fixes my build (and the
resulting kernel boots fine).
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Davide Libenzi [Sun, 3 Oct 2004 02:51:43 +0000 (19:51 -0700)]
[PATCH] Avoid unnecessary copy for EPOLL_CTL_DEL
Ulrich Drepper points out that EPOLL_CTL_DEL doesn't need to copy any of
the hash events.
Also, we should specify in the man pages that a NULL is allowed in
EPOLL_CTL_DEL. Currently it does not say that.
Also, starting from when epoll uses rbtrees instead of hashes, the
'size' hint passed to epoll_create(2) is no more used. But since an API
change has clearly to be excluded, I guess it'll stay as is.
NTFS: Fix another stupid bug in fs/ntfs/attrib.c::ntfs_external_attr_find()
where we forgot to unmap the extent mft record when we had finished
enumerating an attribute which caused a bug check to trigger when the
VFS calls ->clear_inode.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Ed L. Cashin [Sun, 3 Oct 2004 02:19:23 +0000 (19:19 -0700)]
[PATCH] fix block layer ioctl bug
If the blockdev doesn't implement BLKFLSBUF and returns -ENOTTY we should
still go ahead and perform the VFS-level sync. We need to test for both
ENOTTY and EINVAL because some SCSI drivers incorrectly return EINVAL.
Signed-off-by: Ed L Cashin <ecashin@coraid.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Miscellaneous upgrade for recent m32r kernel changes.
* arch/m32r/kernel/entry.S:
Add system calls; taken from asm-i386/unistd.h.
- [PATCH][2/6] perfctr-2.7.3 for 2.6.7-rc1-mm1: i386 (05/31/2004)
- [PATCH] Make key management use syscalls not prctls (09/06/2004)
* arch/m32r/kernel/io_m32102.c: Remove.
This file is no longer used. Please remove this file.
* arch/m32r/kernel/irq.c:
- Fix the unnecessary entropy call in the irq handler.
* arch/m32r/kernel/signal.c:
- Merge common signal handling fault handling in generic code;
use force_sigsegv() instead of force_sig().
* arch/m32r/kernel/smp.c:
- Just add brackets.
* include/asm-m32r/hardirq.h:
- factor out common <asm/hardirq.h> code
Now that we are correctly kicking off kswapd early (before the synch
reclaim watermark), it is really doing asynchronous pageout. This has
exposed a latent problem where allocators running at the same time will
make kswapd think it is getting into trouble, and cause too much swapping
and suboptimal behaviour.
This patch changes the kswapd scanning algorithm to use the same metrics
for measuring pageout success as the synchronous reclaim path - namely, how
much work is required to free SWAP_CLUSTER_MAX pages.
This should make things less fragile all round, and has the added benefit
that kswapd will continue running so long as memory is low and it is
managing to free pages, rather than going through the full priority loop,
then giving up. Should result in much better behaviour all round,
especially when there are concurrent allocators.
akpm: the patch was confirmed to fix up the excessive swapout which Ray Bryant
<raybry@sgi.com> has been reporting.
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Stefan Seyfried [Sun, 3 Oct 2004 02:15:12 +0000 (19:15 -0700)]
[PATCH] swsusp: fix highmem
From: Pavel Machek <pavel@ucw.cz>
This actually calls highmem_resume(), so swsusp has chance to work on
highmem machines. It also adds comments about code flow, which is quite
interesting at that point.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ingo Molnar [Sun, 3 Oct 2004 02:14:36 +0000 (19:14 -0700)]
[PATCH] random driver preempt robustness
A certain codepath in the random driver relied on vt_ioctl() being under
the BKL and implicitly disabling preemption. The code wasn't buggy
upstream but it's slighly unrobust so I think we want the fix upstream too,
independently of the remove-bkl patch.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This patch modifies the return value of kprobes exceptions notify handler.
The kprobes exception notifier returns NOTIFY_STOP on handling
notification. This patch helps other debuggers to co-exists with the
Kprobes. Other debuggers registered for exceptions notification must
return NOTIFY_STOP on handling the notification.
Signed-off-by: Prasanna S Panchamukhi <prasanna@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
NTFS: Fix stupid bug in fs/ntfs/attrib.c::ntfs_attr_reinit_search_ctx() where
we did not clear ctx->al_entry but it was still set due to changes in
ntfs_attr_lookup() and ntfs_external_attr_find() in particular.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Some recent G5s have a problem with PCI/HT probing. They crash (machine
check) during the probe of some slot numbers, it seems to be related to
some functions beeing disabled by the firmware inside the K2 ASIC.
This patch limits the config space accesses to devices that are present
in the OF device-tree. This fixes the problem and shouldn't "add" any
limitation. If you plug a "random" PCI card with no OF driver, the
firmware will still build a node for it with the default set of
properties created from the config space.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Linus Torvalds [Sat, 2 Oct 2004 08:54:05 +0000 (01:54 -0700)]
Fix close() vs posix lock race
A threaded app that posix-locks and closes the same file
in two threads concurrently may result in a posix lock
that was never visible to the closer, and that thus needs
cleanup on the final fput.
Alan Cox [Sat, 2 Oct 2004 08:46:35 +0000 (01:46 -0700)]
[PATCH] Update termios to use per tty semaphore
This makes the agreed change of termios locking to be semaphore based
sleep locking. This is needed for USB in particular as it has to use
messaging to issue terminal mode changes.
This code passes Torvalds test grades 0, 1 and 2 (it looks ok, it
compiles and it booted). It does mean that a driver cannot take an
atomic peek at termios data during an interrupt. Nobody seems to be
doing this although some of the driver receive paths for line
disciplines will eventually want to (n_tty currently doesn't do this
locked on the receive path). Since the ldisc is given a chance to copy
any essential bits on the ->set_termios path this seems not to be a
problem.
Alexander Viro [Sat, 2 Oct 2004 03:59:55 +0000 (20:59 -0700)]
[PATCH] Race with iput and umount
Jeff Mahoney notes:
"generic_shutdown_super() will happily call the ->put_super fs method,
destroying data structures still in use by the iput (->delete_inode)
in progress.
The unlink path will call the ->unlink fs method, release the path
(thus dropping the reference to the vfsmount, and then call iput.
Since the vfsmount reference is dropped back to 1, a umount will
succeed, causing the superblock to be cleaned up."
Arrgh... Here's the trivial fix: do the final "iput()" a bit earlier in
the unlink path.
Note: all places that go to exit1: or exit: will have NULL inode, so we
are not leaking anything here and it is OK do that iput() early; indeed,
the goal of that kludge was to postpone the final iput() past the
unlocking the parent for the sake of contention if a wunch of bankers is
doing parallel unlink() on files in the same directory and normally it
would happen on dput() after vfs_unlink())
A bug in function piix_config_drive_xfer_rate() allows a call of
hwif->ide_dma_on(drive) without prior call of piix_config_drive_for_dma().
This results in harddisk configured for UDMA (default?) whereas the highest
DMA mode supported by PIIX3 is MWORD2.
This bug is supposed to be present in any 2.6.x kernel release and any
2.4.x kernel release since 2.4.21.
bart: this should also fix the same bug for PIIXa and PIIXb
Chris Wright [Fri, 1 Oct 2004 09:34:43 +0000 (02:34 -0700)]
[PATCH] make can_do_mlock useful for mlock/mlockall
Move the simple can_do_mlock() check before the full rlimits based
restriction checks for mlock() and mlockall(). As it is, the check
adds nothing. This has a side-effect of eliminating an unnecessary call
to can_do_mlock() on the munlockall() path.
Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Chris Wright [Fri, 1 Oct 2004 09:34:18 +0000 (02:34 -0700)]
[PATCH] mlockall(MCL_FUTURE) unlocks currently locked mappings
Calling mlockall(MCL_FUTURE) will erroneously unlock any currently locked
mappings. Fix this up, and while we're at it, remove the essentially
unused error variable.
Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Catalin Marinas [Fri, 1 Oct 2004 13:37:59 +0000 (14:37 +0100)]
[ARM PATCH] 2106/1: Remove the "write" assumption for Jazelle in the early_abort handler
Patch from Catalin Marinas
On ARM926EJ-S, the "always assume write" for Jazelle data aborts
causes Java code exit with segmentation fault every time it tries
to access a read-only page. This patch puts some restrictions on what
can be done in the Jazelle state but it allows it to run.
Russell King [Fri, 1 Oct 2004 15:52:48 +0000 (16:52 +0100)]
[PCMCIA] replace schedule_timeout() with msleep()
From: <janitor@sternwelten.at>
Remove unnecessary cs_to_timeout() macro. Use msleep() instead of
schedule_timeout() to guarantee the task delays for the desired
time.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Maximilian Attems <janitor@sternwelten.at> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Russell King <rmk@arm.linux.org.uk>
David Gibson [Fri, 1 Oct 2004 01:08:23 +0000 (18:08 -0700)]
[PATCH] ppc64: change bad choice of VSID_MULTIPLIER
We recently changed the VSID allocation on PPC64 to use a new scheme
based on a multiplicative hash. It turns out our choice of multiplier
(the largest 28-bit prime) wasn't so great: with large contiguous
mappings, we can get very poor hash scattering. In particular earlier
machines (without 16M pages) which had a reasonable about of RAM (>2G
or so) wouldn't boot, because the linear mapping overflowed some hash
buckets.
This patch changes the multiplier to something which seems to work
better (it is, rather arbitrarily, the median of the primes between
2^27 and 2^28). Some more theory should almost certainly go into the
choice of this constant, to avoid more pathological cases. But for
now, this choice fixes a serious bug, and seems to do at least as well
at scattering as the old choice on a handful of simple testcases.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This is the latest/Updated OS_MCA handler which try to do recovery
from multibit-ECC/poisoned memory-read error on user-land.
(Thank you very much for comments, Keith and Grant!)
I'd still appreciate it if anyone having good test environment
could apply my patch and could report how it works.
(especially reports on non-Tiger/non-Intel platform are welcome.)
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Tony Luck <tony.luck@intel.com>