François Romieu [Wed, 23 Feb 2005 13:19:19 +0000 (08:19 -0500)]
[PATCH] r8169: IRQ races during change of mtu
IRQ races during change of mtu
- NAPI poll must be enabled prior to IRQ activation or the IRQ handler
will not know what to do with an incoming packet;
- rtl8169_down() needs to try twice to sync with the IRQ handler when
it is not issued under !netif_running() protection.
Both changes make it safe to request a change of mtu on a live device.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Olof Johansson [Wed, 23 Feb 2005 05:56:33 +0000 (21:56 -0800)]
[PATCH] Fix possible futex mmap_sem deadlock
Some futex functions do get_user calls while holding mmap_sem for
reading. If get_user() faults, and another thread happens to be in mmap
(or somewhere else holding waiting on down_write for the same
semaphore), then do_page_fault will deadlock. Most architectures seem
to be exposed to this.
To avoid it, make sure the page is available. If not, release the
semaphore, fault it in and retry.
I also found another exposure by inspection, moving some of the code
around avoids the possible deadlock there.
Signed-off-by: Olof Johansson <olof@austin.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Garzik [Wed, 23 Feb 2005 09:47:10 +0000 (04:47 -0500)]
[libata] Add missing hooks, to avoid oops in advanced SATA drivers
Advanced SATA drivers should not (and cannot) use the basic
PCI IDE hooks for checking the Status and Error registers, as these
registers are either in non-standard locations, or simply don't
exist.
In the error handling path, libata was unconditionally calling some
PCI IDE hardware bitbanging functions, which would cause an oops
in the AHCI driver and any other advanced libata driver.
Dmitry Torokhov [Wed, 23 Feb 2005 00:41:49 +0000 (16:41 -0800)]
[PATCH] ALPS: do not activate on unsupported models
It feels like 2.6.11 is right around the corner. I would like to disable
ALPS suport for some devices we don't know how to handle properly yet to
cut down on number of complaints that we broke mouse support.
Input: ALPS - do not activate native mode for devices whose data
we can not handle yet.
Paul Mackerras [Wed, 23 Feb 2005 00:41:36 +0000 (16:41 -0800)]
[PATCH] ppc64: fix compilation for Maple board
A patch that I sent in earlier to allow the use of the data address
breakpoint on machines with a hypervisor happened to break things for those
configs, such as for the Maple board, where we don't compile in the
routines for calling the hypervisor. This patch fixes it.
Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] ppc32: Wrong vaddr in flush_hash_one_pte()
Reworking the ppc32 mm helps me find interesting bugs in the existing bug,
well, brown paper bag for me, I made this one a while ago.
The routine flush_hash_one_pte() used by ptep_test_and_clear_young()
wasn't properly recaclulating the vaddr from the pte pointer &
page->index. The result is that we probably never flushed things from
the hash, so that's at least the _second_ bug affecting
ptep_test_and_clear_young(), swap on ppc32 must have been really broken
:(
This fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Christoph Lameter's patch that change page allocators to use GFP_ZERO
broke ppc32 in a subtle way. Our allocator is designed to work before
mem_init_done, in which cases it uses a ppc specific early_get_page()
which doesn't return zeroed pages. However, he removed the call to
clear_page() unconditionally, thus causing the kernel initial page
tables to have random data in them.
They are initialized with set_pte, which means it's _mostly_ harmless,
except that set_pte on ppc32 preserves the _PAGE_HASHPTE bit, thus we
end up with random bits there, which can cause issues with further
manipulation of the kernel page tables and will slow down all hash
faults to them causing unnecessary searches.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Tom Rini [Tue, 22 Feb 2005 06:12:49 +0000 (22:12 -0800)]
[PATCH] Re-order <linux/fs.h> includes to fix userland breakage
The following moves all includes <linux/fs.h> (except <linux/ioctl.h>
and <linux/config.h> down to below the existing __KERNEL__ test. None
of these includes are needed by the user-visible portions of the header,
and in some cases can cause userland apps to break.
For example, LTP and sash with an empty <linux/autoconf.h> will fail
thusly:
cc -Wall -I../../include -g -Wall -I../../../../include -Wall setrlimit02.c -L../../../../lib -lltp -o setrlimit02
In file included from /usr/include/asm/atomic.h:6,
from /usr/include/linux/fs.h:20,
from setrlimit02.c:46:
/usr/include/asm/processor.h:68: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
/usr/include/asm/processor.h:68: error: requested alignment is not a constant
Build/run tested with a glibc rebuild as well.
Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[TCP]: Fix excessive stack usage resulting in OOPS with 4KSTACKS.
Various routines were putting a full struct tcp_sock on
the local stack. What they really wanted was a subset
of this information when doing TCP options processing
when we only have a mini-socket (for example in SYN-RECVD
and TIME_WAIT states).
Therefore pull out the needed information into a sub-struct
and use that in the TCP options processing routines.
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br> Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Blanchard [Mon, 21 Feb 2005 23:30:18 +0000 (15:30 -0800)]
[PATCH] ppc64: Fix 32bit largepage issue
The paca holds a shadow of the context struct, used for the real mode SLB
handler. When we open up a new segment we have to sync up the paca copy
otherwise we will instantiate small page SLB entries until the next context
switch (at which point we resync the paca copy).
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The BIC TCP cwnd problem as identified by Yee-Ting Li and Doug Leith
is that the computation is recalc_ssthresh is incorrect and
BICTCP_1_OVER_BETA/2 should be BICTCP_1_OVER_BETA*2.
My fix is to implement the code from BIC TCP 1.1 which uses a sysctl
to set the beta. There are a few variable name changes from the 1.1
code, and made the scaling factor a #define instead of hardcoded.
I validated this using netem and kprobes, for more details see
http://developer.osdl.org/shemminger/bic-beta-patch.pdf
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
ppc32's implementation of ptep_test_and_clear_young() has a logic error
which makes it fail to flush the hash table. Thus PAGE_ACCESSED is
almost never set again after beeing cleared (unless something else cause
that hash entry to be flushed).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Gary N. Spiess [Sun, 20 Feb 2005 16:18:44 +0000 (11:18 -0500)]
[PATCH] natsemi long cable fix
This is a minor modification to the previous patch submission that does
not assume the default contents of the DSPCFG register are zero.
When used with Revision D of the DP83815, the "Recommended Registers
Configuration" from page 78 of the DP83815 data sheet is not entirely
compatible with the driver's "short cable patch". When the DSPCFG
register is written with the value suggested in the document, then
do_cable_magic() can't read the DSP coefficient and determines that all
cables attached to the DP83815D are 'short', regardless of actual
length. Short cables (< 30m) cause do_cable_magic to enable additional
attenuation to reduce CRC and idle errors. If the extra attenuation is
unintentionally enabled for long cables (> 50m?), they will not operate
properly. The National Semiconductor driver, 'dp83815.c' from
http://www.national.com/appinfo/networks/files/linux_2_4.tar.gz was used
as a basis for this modification.
Linus Torvalds [Sun, 20 Feb 2005 04:51:20 +0000 (20:51 -0800)]
x86: when choosing PCI starting address, print out gap information
This makes for better messages on what is going on. It also
allows us (if we want to), to pick the PCI starting address
somewhere else in the gap. That may be a good idea (ie do a
Linus Torvalds [Sun, 20 Feb 2005 04:16:12 +0000 (20:16 -0800)]
Be more careful about looking for gaps in the e820 table.
We really don't care about anything beyond the 4GB mark,
so make the tests for that explicit (and add a comment),
and use regular "unsigned long" for the gap information.
Ben Dooks [Sun, 20 Feb 2005 15:55:31 +0000 (16:55 +0100)]
[ide] Kconfig for VR1000 machine driver selection
Fix the use of CONFIG_MACH_VR1000, which was missing an
trailing zero from the configuration variable, so never
being shown if only the VR1000 was selected
Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Linus Torvalds [Sun, 20 Feb 2005 01:43:19 +0000 (17:43 -0800)]
Use e820 memory map to determine PCI allocation area.
Don't use the VM numbers (max_low_pfn and friends), since they depend
on the partial kernel linear mapping and only partially on the actual
physical memory layout.
[PATCH] radeonfb: Workaround memory corruption accel problem
A conflict between X and radeonfb can cause system memory corruption
when switching console from X (note that this is not realted to the
recent radeonfb patches, the problem has been there forever as far as I
can tell).
This patch works around it in radeonfb by making sure the "offsets"
register that driver the memory mapping of the accel engine are always
properly set before every accel op. A better fix should be done in fbcon
ultimately.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Hirokazu Takata [Sat, 19 Feb 2005 07:48:10 +0000 (23:48 -0800)]
[PATCH] m32r: warning fix
/project/m32r-linux/kernel/linux-2.6.11-rc4-bk4/b/include/linux/nodemask.h: In function `__first_unset_node':
/project/m32r-linux/kernel/linux-2.6.11-rc4-bk4/b/include/linux/nodemask.h:246: warning: passing arg 1 of `find_next_zero_bit' discards qualifiers from pointer target type
John W. Linville [Fri, 18 Feb 2005 10:49:44 +0000 (05:49 -0500)]
[PATCH] libata: fix command queue leak when xlat_func fails
ata_scsi_translate allocates from the libata command queue by calling
ata_scsi_qc_new. If xlat_func returns non-zero, control jumps to
err_out which fails to free the allocated command. Fix is to add a
new API to free unused commands.
Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
[ARM PATCH] 2493/1: put IXP2000 slowport in 8-bit mode after boot
Patch from Lennert Buytenhek
This is an old patch from 2.6.9-rc3-ds2 that never made it upstream.
The IXP2000 slowport has two modes of operation, 8-bit and 32-bit.
The slowport itself is a byte-wide bus, and in 8-bit mode, it does the
more-or-less obvious thing: every word read causes four byte reads,
and those bytes are then combined into a word according to the xscale
core's current endian setting. So, what value you get depends on what
endianity your IXP2000 is running in.
In 32-bit mode, however, it is the slowport itself which combines
bytes into words, and for this it unconditionally uses little endian
mode. In this mode, word reads from the slowport will return the
same value no matter whether the xscale core is running in big or
little endian mode. This can be a plus in some cases. Byte (and
halfword) accesses in 32-bit mode have rather useless semantics
due to this, though.
The usefulness of 32-bit mode is limited to the initial boot. When
the IXP2000 resets, the slowport is always in 32-bit mode, so if you
flash the bootloader into flash (which is connected to the slowport)
using little-endian byte ordering, the xscale will always read the
instruction stream correctly, no matter whether it's running in big
or little endian mode.
After booting it makes no sense to use 32-bit mode anymore. Especially
since the slowport's word ordering in 32-bit mode is little endian,
and the IXP2000 is conventionally run in big endian, which gives all
kinds of fun issues when trying to access peripherals connected to
the slowport.
In fact, the current MTD map driver for IXP2000 already sets the
slowport to 8-bit mode because it cannot access the flash otherwise.
However, this means that if the MTD map driver is not compiled in for
some reason, the slowport will stay in 32-bit mode after the initial
boot, which will cause peripheral accesses to unexpectedly break!
Signed-off-by: Lennert Buytenhek Signed-off-by: Russell King
[ARM PATCH] 2487/1: minor IRQ routing tweaks for ENP-2611
Patch from Lennert Buytenhek
- The PCI2050B bridge is not wired to any interrupt pin.
- The SPI-3 option board slot is wired to PCI_B.
- Don't printk every time enp2611_map_pci_irq is called.
- Complain loudly if we encounter an unknown device.
Signed-off-by: Lennert Buytenhek Signed-off-by: Russell King
[ARM PATCH] 2485/1: fix enp2611 coexistence with other machine types
Patch from Lennert Buytenhek
If enp2611 support is compiled in, the kernel will unconditionally
perform enp2611-style PCI initialisation. Conditionalise this on
machine_is_enp2611().
Signed-off-by: Lennert Buytenhek Signed-off-by: Russell King
Pete Zaitcev [Thu, 17 Feb 2005 03:59:58 +0000 (19:59 -0800)]
[PATCH] ub: fix Add ioctls to ub patch
I am awfully sorry, but that patch contained a bug. The code dereferenced
cmd->back as if it were a pointer to a request even when it wasn't. It worked
by accident, because rq->flags overlapped with a zeroed memory in other case.
Here is a corrective patch.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Hirokazu Takata [Thu, 17 Feb 2005 02:08:06 +0000 (18:08 -0800)]
[PATCH] m32r: fix sys_clone()
This patch is required to fix sys_clone() for m32r.
* arch/m32r/kernel/process.c:
- Fix sys_clone; add arguments, parent_tidptr and child_tidptr.
- Cosmetics: Change indentation of function parameters for
sys_clone(), sys_vfork().
[PATCH] Fix buf in zeromap_pud_range() losing virtual address
This patch fixes a nasty bug that took us almost a week to track down on
ppc64, introduced by the 4L page table changes, and resulting in random
memory corruption. All archs that rely on a PTE page's struct page to
contain the mm & address (in mapping/index) will be affected.
zeromap_pud_range() is one of these page tables walking functions that
split the address into a base and an offset. It forgets to add back the
"base" when calling the lower level zeromap_pmd_range(), thus passing a
bogus virtual address. Most archs won't care, unless they do the above,
since the lower level can allocate a PTE page.
Kudo's to Michael Ellerman too who spent that week running tests after
tests to track it down, since the only way we managed to get it to show
up was after about 1 to 2h of LTP runs ...
(Note: We are in _urgent_ need to consolidate all those page table
walking functions, they all do things in a subtely different way, with
different checks (sometimes redudant) and inconsitent with each other,
even within a given set of them. Hopefully, Nick has some work in
progress there).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
While browsing the 4 level page table changes (looking for a bug), I
noticed that copy_page_range, unlike others, do not check for
wraparound, which I suppose could be a problem with 4G/4G architectures
or that sort of thing.
This patch fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
When using 4level-fixup.h, a PMD page may end up beeing freed before the
matching PGD entry is cleared due to the way the compatibility macros
work. This can cause nasty races on some architectures.
This patch fixes it by defining pud_clear() to be pgd_clear(). That
means we'll actually write 0 twice, a small price to pay here,
especially seeing how easy it is to convert to the new headers anyway
(hint hint, ppc & ppc64 patches as soon as 2.6.11 is out).
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David S. Miller [Wed, 16 Feb 2005 07:37:06 +0000 (23:37 -0800)]
[SPARC64]: Fix access_ok() and friends warnings.
The implementation is a nop on sparc64, we always return
true, but we have to add at least a (void) reference to
the arguments to avoid compiler/checker warnings.
Signed-off-by: David S. Miller <davem@davemloft.net>
David Brownell [Wed, 16 Feb 2005 06:27:17 +0000 (22:27 -0800)]
[PATCH] USB: ehci requeue revisit
This gets rid of a bug found in some IRQ handling logic, after tripping
a debug assertion. Basically, a recent patch called the wrong routine to
unlink a QH. Net result, it wasn't allowing for the case that some other
QH was already being unlinked. This patch uses the correct routine; the
names are confusingly similar, and the effect is often identical.
The consequence of using the wrong routine was that the driver could
lose one of the pending unlinks (probably wedging some activity) and
treat the other one as completed before it was safe to do so (which
probably wouldn't oops, but could cause other nasty corruption).
From: Brian Murphy <brian@murphy.dk> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 16 Feb 2005 06:26:53 +0000 (22:26 -0800)]
[PATCH] USB Hub driver: Add reset recovery-time delay
This patch is clearly needed for us to be in compliance with the USB spec.
It adds the mandated recovery-time delay following a port reset.
Regardless of anything else we do to alter the device initialization
sequence, this is necessary.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Robert Olsson [Wed, 16 Feb 2005 00:09:40 +0000 (16:09 -0800)]
[PKTGEN]: Bug fixes, bump to version 2.56.
- Fix printing of running list, do not stop at first
not-running device, instead scan them all.
- Do not free SKB before final access via show_results()
Signed-off-by: David S. Miller <davem@davemloft.net>
Implemented ACPI 3.0 support for implicit conversion within
the Match() operator. match_obj can now be of type
integer, buffer, or string instead of just type integer.
Package elements are implicitly converted to the type
of the match_obj. This change aligns the behavior of
Match() with the behavior of the other logical operators
(LLess(), etc.) It also requires an errata change to the
ACPI specification as this support was intended for ACPI
3.0, but was inadvertently omitted.
Fixed a problem with the internal implicit "to buffer"
conversion. Strings that are converted to buffers will
cause buffer truncation if the string is smaller than the
target buffer. Integers that are converted to buffers will
not cause buffer truncation, only zero extension (both as
per the ACPI spec.) The problem was introduced when code
was added to truncate the buffer, but this should not be
performed in all cases, only the string case.
Fixed a problem with the Buffer and Package operators
where the interpreter would get confused if two such
operators were used as operands to an ASL operator (such
as LLess(Buffer(1){0},Buffer(1){1}). The internal result
stack was not being popped after the execution of these
operators, resulting in an AE_NO_RETURN_VALUE exception.
Fixed a problem with constructs of the form
Store(Index(...),...). The reference object returned from
Index was inadvertently resolved to an actual value. This
problem was introduced in version 20050114 when the
behavior of Store() was modified to restrict the object
types that can be used as the source operand (to match
the ACPI specification.)