David S. Miller [Sun, 27 Feb 2005 03:10:03 +0000 (19:10 -0800)]
[IPV4]: Fix lost routes in fn_hash netlink dumps.
Spotted by itkes@fat.imed.msu.ru, the fn_hash_dump_bucket() main
loop does not increment 'i' properly, and thus routes will not
be listed, when the test 'i < s_i' passes.
The bug was added when the code was converted over to
hlist_for_each_entry() by your's truly.
Signed-off-by: David S. Miller <davem@davemloft.net>
Aurelien Jarno [Fri, 25 Feb 2005 12:28:59 +0000 (04:28 -0800)]
[PATCH] USB: Fix usbfs regression
I have just tested kernel version 2.6.11-rc5 and noticed it is not
possible to do an USB transfer by submitting an URB to an output
endpoint. This breaks newest versions of libusb and thus SANE, gphoto2,
and a lot of software.
The bug was introduced in version 2.6.11-rc1 and is due to a wrong
comparison.
David Gibson [Fri, 25 Feb 2005 00:48:33 +0000 (16:48 -0800)]
[PATCH] ppc64: hugepage hash flushing bugfix
This fixes a potentially bad (although very rarely triggered) bug in the
ppc64 hugepage code.
hpte_update() did not correctly calculate the address for hugepages, so
pte_clear() (which we use for hugepage ptes as well as normal ones)
would not correctly flush the hash page table entry. Under the right
circumstances this could potentially lead to duplicate hash entries,
which is very bad.
davem's upcoming patch to pass the virtual address directly to set_pte()
and its ilk will obsolete this, but this is bad enough it should
probably be fixed in the meantime.
Signed-off-by: David Gibson <dwg@au1.ibm.com> Acked-by: William Irwin <wli@holomorphy.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[ide] fix build for built-in hpt366 and modular ide-disk
* always call __ide_do_rw_disk() in ide_do_rw_disk()
* modify ide_hwif_t->rw_disk hook accordingly
* update and cleanup hpt372n_rw_disk()
(the only user of ide_hwif_t->rw_disk hook)
* make __ide_do_rw_disk() static + fix comment
Harald Welte [Wed, 23 Feb 2005 11:50:04 +0000 (03:50 -0800)]
[NETFILTER]: ipt_hashlimit rule load time race condition
This is the best we've got: We cannot release and re-grab lock,
since checkentry() is called before ip_tables.c grabs ipt_mutex.
We also cannot grab the hashtable spinlock, since htable_create will
call vmalloc, and that can sleep. And we cannot just re-search
the list of htable's in htable_create(), since then we would
create duplicate proc files.
Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Do it in addrconf_ifdown. This fixes OOPSes on shutdown
with 2.6.10
Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 23 Feb 2005 11:38:18 +0000 (03:38 -0800)]
[NETFILTER]: Prevent NAT from seeing fragments
The path for loopback is:
LOCAL_OUT: conntrack defrags
POST_ROUTING: conntrack refrags
PRE_ROUTING: skip conntrack defrag because skb->nfct != NULL
PRE_ROUTING: NAT gets hit by fragments
Always defrag on loopback if NAT is compiled in.
Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
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