François Romieu [Mon, 4 Oct 2004 13:11:05 +0000 (09:11 -0400)]
[PATCH] via-velocity: removal of incomplete endianness handling
Removed cpu_to_le32 call on OWNED_BY_NIC. This will produce 0x01000000 on
big endian machines while rdesc0.owner still evaluates to 0x00000000 or
0x00000001. BTW, unless we reorder bit fields on big endian machines or
use u32's and cpu_to_le32'd bit mask macros, current code won't work on big
endian machines.
François Romieu [Mon, 4 Oct 2004 13:10:51 +0000 (09:10 -0400)]
[PATCH] via-velocity: early invocation of init_cam_filter()
In velocity_init_registers(), init_cam_filter() clears mCAMmask which
might have been set by set_multi() (not sure if this can ever occur).
Modified to invoke init_cam_filter() first. Also, clear_isr() is called
twice. Removed the first invocation.
In velocity_found1(), there was a unneeded assignment from vptr to
dev->priv. Removed.
François Romieu [Mon, 4 Oct 2004 13:10:39 +0000 (09:10 -0400)]
[PATCH] via-velocity: received ring wrong index and missing barriers
There were several receive ring related bugs.
In velocity_give_many_rx_descs(), index calculation was incorrect.
This and bugs in velocity_rx_srv() described in the following paragraph
caused packet loss, truncation and infinite error interrupt generation.
In velocity_rx_srv(), velocity_rx_refill() could be called without any
dirty slot. With proper timing, This can result in refilling yet
unreceived packets and pushing dirty pointer ahead of the current pointer.
And vptr->rd_curr which is used by velocity_rx_refill() was updated after
calling velocity_rx_refill() thus screwing receive descriptor ring.
Also, between checking owner and reading the packet, rmb() is missing.
In velocity_give_rx_desc(), there should be a wmb() between resetting the
first four bytes of rdesc0 and setting owner. As resetting the first four
bytes isn't necessary, I just removed the function and directly set owner.
Another rationale for removing the function:
The function doesn't handle synchronization. We should do wmb() before
calling the function. So, I think using bare assignment makes the fact
more explicit.
Neil Horman [Mon, 4 Oct 2004 12:48:22 +0000 (08:48 -0400)]
[PATCH] olympic driver: fix kernel oops on lobe fault
It fixes an oops that results when a lobe fault is detected. The oops
occurs because a lobe fault triggers an interrupt which is handled
in the current version of the driver by effectively shutting down the
card, and freeing its requisite irq. The former is fine, the latter
is not, as its illegal to free an irq from within an interrupt context.
I've fixed this bug by removing the call to free_irq from the interrupt
handler (specifically the chunk around line 964 fixes that). While I
was in there I noticed that there were several other conditions in
the interrupt handler that contained the same condition, so I made
the same fix there. I re-added.
I also modified the contents of olympic_freemem (the chunk around line
898 to correct a misuse of a pointer after it requisite memory has
been free in the case the the adapter is re-initalized after a fault
to prevent that oops. And then I clean up the interrupt handler to
simply use olympic_freemem from the close routine since the ring buffer
doesn't need to be freed until the driver is closed.
In addition to these changes I added a call to olympic init in
olympic_open and reset the spinlock so the adapter can be reset and
rejoin the ring without needing to rmmod/insmod the module. Lastly I
cleaned up the wait queue code so that the close routine didn't have
to wait 60 seconds to close the adapter if a fatal fault has closed
the adapter.
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>