Kevin Hilman [Fri, 6 Aug 2004 15:20:34 +0000 (16:20 +0100)]
[ARM PATCH] 1986/1: bootpImage/ARM: add ability to run from non-zero address
Patch from Kevin Hilman
The following patch allows the bootpImage to be loaded and executed
from a non-zero address. On OMAP platforms for example, the physical
address for SDRAM is 0x10000000 and not zero.
Alexander Viro [Thu, 5 Aug 2004 13:37:01 +0000 (06:37 -0700)]
[PATCH] ppc64: Fix rtas file mess
This does the seq_file conversion + annotation + cleanup + race fixes
for arch/ppc64/kernel/rtas-proc.c.
How the fuck did that file manage to get anywhere near the tree, anyway?
Take a look at guy's "implementation" of sprintf(buf, "%04d", num), for
example:
<vomit>
/* construct the sensor number like 0003 */
/* fill with zeros */
n = sprintf(tmp, "%d", s.token);
len = strlen(tmp);
while (strlen(tmp) < 4)
n += sprintf (tmp+n, "0");
/* invert the string */
while (tmp[i]) {
if (i<len)
tmp2[4-len+i] = tmp[i];
else
tmp2[3-i] = tmp[i];
i++;
}
tmp2[4] = '\0';
</vomit>
Linus Torvalds [Thu, 5 Aug 2004 13:30:40 +0000 (06:30 -0700)]
Fix shrink_dcache_anon() LRU list accesses.
It would potentially remove dentries from the LRU list
without re-initializing the d_lru fields, causing later
accesses to that dentry to do bad things to the LRU list.
Tom Rini [Thu, 5 Aug 2004 11:18:41 +0000 (04:18 -0700)]
[PATCH] ppc32: Fix 'mktree' on 64bit hosts
The following patch changes some 'unsigned long's into 'uint32_t's in
mktree (a program that runs on the host to frob the kernel image for
some firmwares). Without it, the program is not correct when run
on/compiled on a 64bit host.
Signed-off-by: Dan Zink <dan.zink@hp.com> Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland McGrath [Thu, 5 Aug 2004 10:43:51 +0000 (03:43 -0700)]
[PATCH] fix /proc printing of TASK_DEAD state
I just stumbled across this patch that's been sitting in my tree for ages.
I thought I'd sent this in before. It's a trivial fix for the printing
of task state in /proc and sysrq dumps and such, so that TASK_DEAD shows
up correctly. This state is pretty much only ever there to be seen when
there are exit/reaping bugs, but it's not like that hasn't come up.
Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Catalin Marinas [Thu, 5 Aug 2004 22:03:23 +0000 (23:03 +0100)]
[ARM PATCH] 1965/1: gas only generates the c and f field bits for the "msr [cs]psr, rN" instruction
Patch from Catalin Marinas
Gas translates the "msr [cs]psr, rN" instruction to "msr [cs]psr_cf, rN". This may cause problems on the ARMv6 architecture where the A and E bits can leak into the SVC mode from the USR mode via the exception handlers. The reverse can happen when returning to user mode. The patch adds _cxsf to all the msr instruction without the field specifier.
Jens Axboe [Thu, 5 Aug 2004 05:13:29 +0000 (22:13 -0700)]
[PATCH] multipath readahead fix
For requests marked read-ahead, it can legitimately fail without it being a
path problem. So don't fail a path just because this happens (can be the
atomic request allocation going nuts, for instance), or all paths will
quickly go away.
Heiko Carstens [Thu, 5 Aug 2004 05:05:56 +0000 (22:05 -0700)]
[PATCH] md multipathing fixes
I tried to get multipathing failover running and failed. It seems to be
that there are two bugs in multipath.c :
- If a path/request fails mp_bh->path doesn't get updated to the new
path. Thus multipath_end_request will access a NULL pointer if a
redirected request returns.
- After fixing this I experienced several other errors. First of all in
bio->bi_flags the BIO_UPTODATE flag is not set when redirecting a
request.
Causing the md driver to think that every redirected request failed
when it returns. Since that alone didn't fix the problems, I simply
copied the master_bio again and it looks like everything seems to work.
Alex Williamson [Wed, 4 Aug 2004 18:26:09 +0000 (18:26 +0000)]
Using CONFIG_IA64_HP_ZX1 on an sx1000 system setup w/ multiple NUMA
nodes (configured for cell local memory) currently crashes because
MAX_NUMNODES defaults to 1. The patch below sets up things to make this
work.
Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Tony Luck [Wed, 4 Aug 2004 18:10:14 +0000 (18:10 +0000)]
Provide comand line keyword "nomca" to turn off mca processing in kernel.
Initial patch by Jesse Barnes, fixed by Ken Chen, rescued from
obscurity by Sourav Sen.
Jesse Barnes [Tue, 3 Aug 2004 23:46:56 +0000 (23:46 +0000)]
sgi_io_init.c:
Mark per_hub_init as __init and remove an unnecessary extern declaration of it
in sgi_io_init.c. This has the effect of killing a warning in the compile of
that file.
Signed-off-by: Jesse Barnes <jbarnes@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Bjorn Helgaas [Tue, 3 Aug 2004 23:27:28 +0000 (23:27 +0000)]
sba_iommu.c:
REO/Grande defect AR2305 can cause TLB fetch timeouts if entries
are purged while in use. Round up IOVA allocations to power-of-two
boundaries to prevent this. This is originally due to Alex Williamson.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Some G5 recent powermacs start with the fan control unit (FCU) disabled,
by the firmware, causing the thermal control driver to break. We have to
enable it before starting the feedback loops that set the fan speeds.
This patch adds the code to start the FCU.
Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] ppc32: Fix problem with spurrious edge interrupts on old
On old powermacs, it's possible that we get a stale edge interrupt when
doing request_irq(), that typically happens with the DBDMA controller
interrupts when the device was used by the firmware for booting.
I just tracked down a nasty memory corruption problem where that was
causing the bmac driver to try to process packets before the driver
internal data structures were properly initialized.
While I agree that the driver should (and will) be made more robust to
such things, Paulus and I decided that it makes little sense to keep
track of an "old" edge interrupt that happens before a driver does
request_irq. (On those powermacs, those are only the DBDMA interrupts
anyway, and none of the DBDMA users will care).
This patch implements a "startup" handler for the old Apple PIC that
will "ack" pending edge interrupts before unmasking, thus preventing
those stale interrupts to be delivered.
It also "fixes" the ppc32 irq core to call the startup() callback when
available instead of just calling enable().
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jens Axboe [Mon, 2 Aug 2004 16:29:20 +0000 (09:29 -0700)]
[PATCH] bio_copy_user() cleanups and fixes
blk_rq_map_user() is a bit of a hack currently, since it drops back to
kmalloc() if bio_map_user() fails. This is unfortunate since it means we
do no real segment or size checking (and the request segment counts contain
crap, already found one bug in a scsi lld). It's also pretty nasty for >
PAGE_SIZE requests, as we attempt to do higher order page allocations.
Even worse still, ide-cd will drop back to PIO for non-sg/bio requests.
All in all, very suboptimal.
This patch adds bio_copy_user() which simply sets up a bio with kernel
pages and copies data as needed for reads and writes. It also changes
bio_map_user() to return an error pointer like bio_copy_user(), so we can
return something sane to the user instead of always -ENOMEM.
Kumar Gala [Mon, 2 Aug 2004 12:53:21 +0000 (05:53 -0700)]
[PATCH] ppc32: fix e500 SPE saving of context
Fix the fact that we were not the signal processing engine status and
control register (SPEFSCR) on giveup_spe. Causes problems when the kernel
tries to read or modify the SPEFSCR.
Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Small change to bictcp based on the BIC 1.1 patches for web100.
Keep track of last time congestion was computed, and recompute
if cwnd changes or every 1/32 of a second.
Also changes the initialization location for the parameters.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Mon, 2 Aug 2004 10:04:02 +0000 (03:04 -0700)]
[IPSEC]: Move xfrm[46]_tunnel_check_size into xfrm[46]_output.c
This patch moves xfrm[46]_tunnel_check_size() into xfrm[46]_output.c
where it can be made static since it's only used there.
While moving the icmp.h inclusions over I also discovered that the
tunnel files are missing an inclusion of net/protocol.h. So I've
added them as well.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
Ralph Loader [Mon, 2 Aug 2004 09:56:51 +0000 (02:56 -0700)]
[IPV6]: Trivial fix for ipv6_addr_hash()
ipv6_addr_hash doesn't do what it's comment says. The comment was
probably what was intended, not that it'll make much difference in
practice.
Signed-off-by: Ralph Loader <suckfish@ihug.co.nz> Signed-off-by: Yoshifuji Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@redhat.com>
Hirofumi Ogawa [Mon, 2 Aug 2004 07:01:50 +0000 (00:01 -0700)]
[PATCH] FAT: kill nls default
Previously, fatfs was using NLS_DEFAULT if users didn't specify the
codepage or iocharset option. This became cause of trouble (filename
access).
This patch removes the complicated default config in kernel.
Instead of it, by default, fatfs uses builtin nls ("default"), also reports
it and mounts as read-only. This default will limit the access more or
less. Note: If peoples want to write on this default, it still can switch
by remount.
Therefore, basically users will need to specify mount options always.
("codepage" for msdos, and "codepage" and "iocharset" for vfat) However, it
can be done simply by script or shell alias or something else in userland.
Michael Kerrisk [Mon, 2 Aug 2004 03:31:12 +0000 (20:31 -0700)]
[PATCH] Off-by-one error for SIGXCPU / RLIMIT_CPU checking
There is a lonstanding off-by-one error that results from an incorrect
comparison when checking whether a process has consumed CPU time in
excess of its RLIMIT_CPU limits.
This means, for example, that if we use setrlimit() to set the soft CPU
limit (rlim_cur) to 5 seconds and the hard limit (rlim_max) to 10 seconds,
then the process only receives a SIGXCPU signal after consuming 6 seconds
of CPU time, and, if it continues consuming CPU after handling that
signal, only receives SIGKILL after consuming 11 seconds of CPU time.
Jens Axboe [Mon, 2 Aug 2004 03:16:52 +0000 (20:16 -0700)]
[PATCH] fix cdrom cdda rip single frame dma fall back
There's a stupid error in the fall back logic, it fails to increment the
user pointer so the wave file is corrupt. We should also clear
last_sense just to be sure.
Steve Dickson [Mon, 2 Aug 2004 03:15:19 +0000 (20:15 -0700)]
[PATCH] nsf4 oops fixes
Here are some oops I found in error paths in the mounting pathes while
debugging something else... I sent it out a while ago, but it didn't seem
to get any traction....
The nfs_fill_super() fix is obvious and in nfs4_fill_super(), the
server->client ptr needs to be set before the cl_idmap check, since
rpc_shutdown_client() needs it when the check fails.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Adrian Bunk [Mon, 2 Aug 2004 03:14:55 +0000 (20:14 -0700)]
[PATCH] Canonically reference files in Documentation/ code comments part
Below is a patch by Hans Ulrich Niedermann
<linux-kernel@n-dimensional.de> to change all references in comments to
files in Documentation/ to start with Documentation/
Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Bjorn Helgaas [Mon, 2 Aug 2004 03:14:28 +0000 (20:14 -0700)]
[PATCH] HPET copyrights, cleanup
This patch
- adds copyright and license info
- changes sense of mmap config option (setting option enables mmap
instead of disabling it, to avoid the double negative)
- removes an #ifdef CONFIG_IA64 now that acpi_register_gsi()
is generic.
Arnd Bergmann [Mon, 2 Aug 2004 03:14:04 +0000 (20:14 -0700)]
[PATCH] DVB: "errno" undefined
Actually, the problem has its origin in my removal of all in-kernel
syscalls (except execve, which is non-trivial) earlier this year. This
change was blindly reverted by the maintainer, while at the same time the
local errno variable was removed. See also
http://linux.bkbits.net:8080/linux-2.5/hist/drivers/media/dvb/frontends/tda=
1004x.c
This patch is the one that was already merged earlier. I'm now also
removing the definitions for the kernel syscalls on i386 to make it harder
to reintroduce them again. This was already done for ppc64, the others
should probably follow.
Bjorn Helgaas [Mon, 2 Aug 2004 03:12:56 +0000 (20:12 -0700)]
[PATCH] rename CONFIG_PCI_USE_VECTOR to CONFIG_PCI_MSI
The "vector" terminology is architecture-dependent. The PCI MSI interface
actually deals with Linux IRQ numbers (i.e., things you can pass to
request_irq()), and we shouldn't confuse things by calling them "vectors" just
because we're using MSI rather than an IOSAPIC.
Roland Dreier [Mon, 2 Aug 2004 03:12:44 +0000 (20:12 -0700)]
[PATCH] MSI: MSI/MSI-X API updates
Second half of MSI rewrite: fix the API and update documentation. Split
enabling MSI and MSI-X to separate pci_enable_msi()/pci_disable_msi() and
pci_enable_msix()/pci_disable_msix() functions. free_irq() no longer has
the side effect of freeing interrupt vectors (so a device driver can do
multiple request_irq()/free_irq() cycles on the same MSI/MSI_X vector).
From: Tom L. Nguyen <tom.l.nguyen@intel.com> Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Mon, 2 Aug 2004 03:12:32 +0000 (20:12 -0700)]
[PATCH] MSI: stop using dev->bus->ops directly in msi.c
First half of the MSI rewrite: pure cleanup. Use proper
pci_read_config_xxx() and pci_write_config_xxx() functions instead of
accessing raw dev->bus->ops.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jesse Barnes [Mon, 2 Aug 2004 03:12:21 +0000 (20:12 -0700)]
[PATCH] quieten down per-zone memory stats
On a system with a lot of nodes, 4 lines of output per node is a lot to
have to sit through as the system comes up, especially if you're on the
other end of a slow serial link. The information is valuable though, so
keep it around for the system logger. This patch makes the printks for the
memory stats use KERN_DEBUG instead of the default loglevel.
Kumar Gala [Mon, 2 Aug 2004 03:11:45 +0000 (20:11 -0700)]
[PATCH] ppc32: support for MPC8555 CPU and board
The following patch adds completes the CPU support for the MPC8555 PowerPC.
Additionally, it adds support for the MPC8555 CDS reference board. This
is another PowerPC in the Freescale MPC85xx family.
* Add support for MPC8555 CPU and reference board
Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Kumar Gala [Mon, 2 Aug 2004 03:11:33 +0000 (20:11 -0700)]
[PATCH] ppc32: Support for MPC8560 CPU and boards
The following patch adds completes the CPU support for the MPC8560 PowerPC.
Additionally, it adds support for the MPC8560 ADS reference board and
fixes up some build issues with the SBC8560 board.
Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Gibson [Mon, 2 Aug 2004 03:11:20 +0000 (20:11 -0700)]
[PATCH] ppc64: remove #include processor.h from div64.S
This patch removes a redundant #include of processor.h from
arch/ppc64/boot/div64.S. I came across this because, at least with the
binutils versions I have currently installed, the 32-bit assembler used for
the bootstrap code objects to the // comments that recently went into
processor.h.
Signed-off-by: David Gibson <dwg@au.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mackerras [Mon, 2 Aug 2004 03:11:09 +0000 (20:11 -0700)]
[PATCH] ppc64: improve SLB reload
Rewrite/cleanup of the SLB management code. This removes nearly all the
SLB related code from arch/ppc64/kernel/stab.c and puts a rewritten version
in arch/ppc64/mm, where it better belongs. The main SLB miss path is in
assembler and the other routines have been cleaned up and streamlined.
Notable changes:
- Ugly bitfields no longer used for generating SLB entries.
- slb_allocate() (the main SLB miss routine) is now in assembler, and all
the data it uses is stored in the PACA.
- The mm context is now copied into the PACA at context switch time, to
avoid looking up the thread struct on SLB miss.
- An SLB miss will now never (directly) result in a call to
do_page_fault. If we get a miss on a totally bogus address the handler
will now put in an SLB referencing VSID 0. This will never have any
pages, so we'll get the (fatal) page fault shortly afterwards. This
simplifies the SLB entry and exit paths.
- The round-robin pointer in the PACA now references the last-used
instead of next-to-use SLB slot, which simplifies the asm for updating it
slightly.
- Unify do_slb_bolted with the general SLB miss path. There is now one
SLB miss handler, in assembler, and called with only the low-level
exception prolog (EXCEPTION_PROLOG_[PI]SERIES rather than
EXCEPTION_PROLOG_COMMON) and minimal extra save/restore logic.
- Streamlines the exception entry/exit path of the SLB miss handler to
shave a few cycles off. The most significant change is that the RI bit
is left off throughout the whole handler, which avoids an extra mtmsrd to
turn it back off on the exit path.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Mon, 2 Aug 2004 03:10:45 +0000 (20:10 -0700)]
[PATCH] ppc64: fix hotplug irq migration code
In migrate_irqs_away we werent converting a virtual irq to a real one. We
ended up passing the wrong irq numbers to the hypervisor and migration of
affinitised irqs on cpu hot unplug didnt work.
Also clarify the rtas_stop_self printk.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Gibson [Mon, 2 Aug 2004 03:10:34 +0000 (20:10 -0700)]
[PATCH] ppc64: fix RAS irq handlers
Both arch/ppc64/kernel/ras.c and arch/ppc64/kernel/rtasd.c have a spinlock
variable declared static called "log_lock". Since the code in these files
interact quit a lot, having two different locks with identical names is
manifestly confusing. This patch renames both locks to something a little
clearer. In the case of ras.c it also renames the buffer protected by the
lock to a more usefullly greppable name.
Signed-off-by: David Gibson <dwg@au.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mackerras [Mon, 2 Aug 2004 03:10:22 +0000 (20:10 -0700)]
[PATCH] ppc64: ISA device tree node refcount fix
Moves a misplaced of_node_put(). In the existing code, the node in
question is used just after its refcount is decremented.
Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
John Rose [Mon, 2 Aug 2004 03:10:10 +0000 (20:10 -0700)]
[PATCH] ppc64: struct pci_controller cleanup
The patch below removes the unused member "pci_io_offset" from struct
pci_controller. If there are no problems, please apply.
Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Dave Hansen [Mon, 2 Aug 2004 03:09:59 +0000 (20:09 -0700)]
[PATCH] ppc64: fix off-by-one in mem_init()
lmb_end_of_DRAM() returns the address of the end of RAM, not the starting
address of the last page. We've been accessing mem_map[] out of bounds for
quite a while. But, it's just a read, so it's probably never caused a real
problem.
But, during my port of CONFIG_NONLINEAR to ppc64, I have a check to make
sure that all __va() calls are given with valid physical addresses. This
code tripped that check.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
BSD accounting cross-platform compatibility is a new feature of 2.6.8 and
thus not crucial, but it'd be nice not to have kernels writing wrong file
formats out in the wild.
The endianness detection logic I wanted to suppose for userspace turned out
to be bogus. So just do it the simple way and store endianness info
together with the version number.
Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Mon, 2 Aug 2004 03:09:24 +0000 (20:09 -0700)]
[PATCH] sched: use for_each_cpu
The per cpu schedule counters need to be summed up over all possible cpus.
When testing hotplug cpu remove I saw the sum of the online cpu count for
nr_uninterruptible go negative which made the load average go nuts.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The latest versions of Motorola erratas for the MPC745x CPUs (and 744x)
adds a couple of nasty ones for which we really want workarounds in the
kernel. One is to disable the BTIC branch target cache on some revs
(too bad for performances...) and the other one is to force cacheable
memory pages to always be marked as SMP coherent even on UP systems (I
didn't measure significant perfs impact with this one).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Herbert Xu [Sat, 31 Jul 2004 16:39:29 +0000 (09:39 -0700)]
[PF_KEY]: spirange should be in host byte order.
I'm looking through the xfrm_alloc_spi stuff and noticed that the
netlink alloc_spi function takes the range in host order while the
PFKEY alloc_spi function takes them in network order.
First I thought that I stuffed up since I was the one who changed
the code in the netlink interface to take them in host order :)
But reading RFC 2367 seems to indicate otherwise. It says that all
fields are host order unless specified otherwise. And the spirange
fields are not specified to be network order at all.
Looking at the existing PFKEY users:
User Space
----------
Openswan - Doesn't use PFKEY for this.
Racoon - Puts zeros in there so it doesn't care. However its test-pfkey
program stores things in host order.
ISAKMPD - Stores things in host order.
So the conclusion is that we can and should change our PFKEY
implementation to use host order for these fields.
This patch does exactly that.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Sat, 31 Jul 2004 16:33:16 +0000 (09:33 -0700)]
[IPSEC]: xfrm_alloc_spi always succeeds on non-trivial range
xfrm_alloc_spi will always succeed if minspi < maxspi, even if
minspi + 1 == maxspi. If the range is already occupied this
will obviously lead to breakage.
Of course this is very unlikely to occur in reality due to the
size of the range. Although with IPCOMP it might actually happen
on a very large server.
The fix is obivous.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Sat, 31 Jul 2004 16:30:00 +0000 (09:30 -0700)]
[IPSEC]: Remove redundant check in xfrm_state_add()
This is the patch referred to in the netlink_get_spi thread.
I was actually wrong about the reason for this patch though. Firstly
it's the SPI check that is redundant and not the find_acq() call.
And it's redundant because of the find_acq() patch, not because
of the fact that this is in xfrm_state_add().
Now that find_acq() only returns SAs with SPIs, we don't need to
check this in xfrm_state_add() anymore.
We do still need the call though to clean up leftover larval states.
Another side-effect of the change is that we can move the existence
check above find_acq() since find_acq() will never return any SAs
matching the SPI we're trying to add (It doesn't need to because if
an SA with a matching SPI existed, it would've been returned by
state_lookup() already).
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
Herbert Xu [Sat, 31 Jul 2004 16:28:27 +0000 (09:28 -0700)]
[IPSEC]: Fix SPI generation by netlink_get_spi()
The issue is that two successive calls to netlink_get_spi is returning
the same SA. Since netlink_get_spi is meant to be a creation operation
this is incorrect.
The netlink_get_spi operation is modelled off the PFKEY SADB_GETSPI
command which is specified in RFC 2367. The purpose of SADB_GETSPI
is to create a new larval SA that can then be filled in by SADB_UPDATE.
Its semantics does not allow two SADB_GETSPI calls to return the same
SA, even if there is no SADB_UPDATE call in between.
The reason the second netlink_get_spi is returning the same SA is
because in find_acq(), the code is looking at all larval states as
opposed to only larval states with an SPI of zero.
Since the only other caller of find_acq() -- xfrm_state_add() intentionally
ignores all return values with a non-zero SPI, it is safe to not look at
SAs with non-zero SPIs at all in find_acq().
The following patch does exactly that.
In fact, the find_acq() call in xfrm_state_add() is a remnant from
the days when we had xfrm_state_replace() instead of xfrm_state_add()
and xfrm_state_update(). It can now be safely removed.
I'll post a separate patch for that.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@redhat.com>
The problem is that after a successful connection between the Windows
Bluetooth stack and the Linux Bluez stack, no packets from the device
ever reach the PC running Windows XP Service Pack 2. That is, a ping
from the PC never receives a response, and a ping from BlueZ never
reaches the PC. Linux packet statistics show that the PC packets are
received, but all return traffic seems to be routed over the loopback
interface.
Immediately after creating the BNEP connection with BlueZ, the Windows
Bluetooth stack sends a BNEP_FILTER_NET_TYPE_SET_MSG with an effective
length of zero. BlueZ interprets this message to mean that no filter
ranges should be allowed. The code zeros the first entry in the filter
list, which is than interpreted as meaning that no ranges of acceptable
packets are available. This interpretation is wrong and leads to all
packets being rejected by BNEP.
The Bluetooth BNEP specification clearly states the following:
The length (in octets) of this message is 4+4*N, where N is the number
of disjoint ranges of Networking protocol types that form the complete
set. Note that N=0 (empty set) denotes a reset to default filters (if
any) supported by the remote device.
Alan Cox [Sat, 31 Jul 2004 11:34:32 +0000 (04:34 -0700)]
[PATCH] PATCH: Fix HPT366 crash and support HPT372N
On a board containing the HPT372N IDE controller the 2.6.x series kernels will
misbehave. If the HPT372N is set up with the newer PCI identifier it is
ignored. If it is set up with the HPT372 identifier then the kernel crashes
on boot.
This patch is a forward port of my 2.4 driver fixes that have been in 2.4
for a year but somehow escaped 2.6. Ronny Buchmann caught a couple
of merge details I missed and those are fixed in this diff too.
As well as adding 372N support this also fixes the unknown revision case
to avoid crashes should any future 37x variants with weird class_rev's appear
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>