Zwane Mwaikambo [Sat, 4 Sep 2004 09:18:26 +0000 (02:18 -0700)]
[PATCH] out-of-line locks / generic
This patch achieves out of line spinlocks by creating kernel/spinlock.c
and using the _raw_* inline locking functions.
Now, as much as this is supposed to be arch agnostic, there was still a
fair amount of rummaging about in archs, mostly for the cases where the
arch already has out of line locks and i wanted to avoid the extra call,
saving that extra call also makes lock profiling easier. PPC32/64 was
an example of such an arch and i have added the necessary profile_pc()
function as an example.
Size differences are with CONFIG_PREEMPT enabled since we wanted to
determine how much could be saved by moving that lot out of line too.
attached is a patch that polls the media setting for non GigE nForce
nics:
Without polling, media changes are not autodetected. This is fatal,
because the nic initialization is asynchroneous, thus "modprobe;ifup"
resulted in a dead network connection. The attached patch fixes that
problem.
It's a repost of a patch I sent around three weeks ago: you objected
that I rely on the nic irq instead of a software timer. I've documented
why this is ok.
Andrew Morton [Fri, 3 Sep 2004 18:14:54 +0000 (14:14 -0400)]
[PATCH] airo build fix
drivers/net/wireless/airo.c: In function `issuecommand':
drivers/net/wireless/airo.c:3812: warning: implicit declaration of function `kernel_locked'
*** Warning: "kernel_locked" [drivers/net/wireless/airo.ko] undefined!
Dave Jones [Fri, 3 Sep 2004 18:13:11 +0000 (14:13 -0400)]
[PATCH] 3c527 possible oops.
If the alloc_skb() fails, we dereference it in the skb_reserve() call.
Move the skb_reserve() call to after the NULL check.
Also clean up some CodingStyle violations whilst in the vicinity.
[PATCH] fix sched_domains hotplug bootstrap ordering vs. cpu_online_map issue
cpu_online_map is not set up at the time of sched domain initialization
when hotplug cpu paths are used for SMP booting.
At this phase of bootstrapping, cpu_possible_map can be used by the
various architectures using cpu hotplugging for SMP bootstrap, but the
manipulations of cpu_online_map done on behalf of NUMA architectures,
done indirectly via node_to_cpumask(), can't, because cpu_online_map
starts depopulated and hasn't yet been populated.
On true NUMA architectures this is a distinct cpumask_t from
cpu_online_map and so the unpatched code works on NUMA; on non-NUMA
architectures the definition of node_to_cpumask() this way breaks and
would require an invasive sweeping of users of node_to_cpumask() to
change it to e.g. cpu_possible_map, as cpu_possible_map is not suitable
for use at runtime as a substitute for cpu_online_map.
Signed-off-by: William Irwin <wli@holomorphy.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
a user can do echo 32000 > /proc/sys/vm/nr_hugepapges; at which point most
boxes will get spew about allocation failure. This of course isn't a real
bug so the patch below quiets that.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] radio/radio-maestro: replace schedule_timeout() with msleep()
Replaced sleep_125ms() with msleep(125), udelay2() with udelay(2),
udelay4() with udelay(4) and udelay16() with udelay(16) and removed the
replaced functions' definitions.
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: Linus Torvalds <torvalds@osdl.org>
[PATCH] Sort the CREDITS file properly (and add Jesper)
Many entries in the CREDITS file are not properly sorted in alphabetical
order, despite the note in the file that it is supposed to be sorted like
that.
This patch attempts to sort the CREDITS file properly. No existing entries
were changed, merely moved around in the file. There where a few tricky
names that I was unsure how to sort (names with characters such as ü, ö,
and people with many names where it was unclear to me what name to sort by
etc), in those cases I've usually left the names where they were unless it
was glaringly obvious they were in the wrong spot.
I've also taken the liberty to add my own name to the file - I have
contributed several tiny/small fixes/cleanups etc over the years.
bad_page() only prints out 8 hexadecimal digits of page->flags regardless
of sizeof(page_flags_t). This leads to confusing and/or incomplete bug
reports. The following patch uses a field width argument to replace the
hardcoded %08lx so that bad_page() may print the whole of page->flags.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Disable colour conversion in the CPiA Video Camera driver
Since in-kernel colorspace conversion is not allowed, this patch disables it
in the CPiA video camera driver by default. Users should fix the applications
in case they don't work without conversion reenabled by setting the new
'colorspace_conv' module parameter to 1. This is a temporary solution, so
within a few months deprecated code will be entirely removed.
Alan Cox [Fri, 3 Sep 2004 03:28:40 +0000 (20:28 -0700)]
[PATCH] fix the barrier IDE detection logic
This fixes the logic so we always check for the cache. It also defaults to
safer behaviour for the non cache flush case now we have the right bits in
the right places. I've also played a bit with timings - the worst case
timings I can get for the flush are about 7 seconds (which I'd expect as
the engineering worst cases will include retries)
Probably what should happen is that the barrier logic is enabled providing
the wcache is disabled. I've not meddled with this as I don't know what
the intended semantics and rules are for disabling barrier on a live disk
(eg when a user uses hdparm to turn on the write cache). In the current
code as with Jens original that cannot occur.
I've also fixed the new printk's as per a private request from Matt Domsch.
Alan Cox [Fri, 3 Sep 2004 03:28:28 +0000 (20:28 -0700)]
[PATCH] Root reservations for strict overcommit
This was on my TODO list for a while and it turns out someone already fixed
the armwaving overcommit mode for the same problem. It is easy to get into
a situation where you have no overcommit and nothing can be done because
there is no memory to clean up the stable but non-useful state of the
machine.
The fix is trivial and duplicated from the armwaving overcommit code path.
The last 3% of the memory can be claimed by root processes only. It isn't
a cure but it does seem to solve the real world problems - at least
providing you have enough memory for 3% to be useful 8).
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Adrian Bunk [Fri, 3 Sep 2004 03:28:16 +0000 (20:28 -0700)]
[PATCH] pcxx.c build fix
CC drivers/char/pcxx.o
drivers/char/pcxx.c: In function `pcxe_cleanup':
drivers/char/pcxx.c:209: warning: unused variable `e2'
drivers/char/pcxx.c: At top level:
drivers/char/pcxx.c:229: `pcxe_init' undeclared here (not in a function)
drivers/char/pcxx.c:230: warning: type defaults to `int' in declaration of `module_cleanup'
drivers/char/pcxx.c:230: warning: parameter names (without types) in function declaration
drivers/char/pcxx.c:230: warning: data definition has no type or storage class
drivers/char/pcxx.c:1016: redefinition of `__initcall_pcxe_init'
drivers/char/pcxx.c:229: `__initcall_pcxe_init' previously defined here
drivers/char/pcxx.c:1016: `pcxe_init' undeclared here (not in a function)
drivers/char/pcxx.c:1017: `pcxe_exit' undeclared here (not in a function)
drivers/char/pcxx.c: In function `pcxe_tiocmget':
drivers/char/pcxx.c:2009: `mstat' undeclared (first use in this function)
drivers/char/pcxx.c:2009: (Each undeclared identifier is reported only once
drivers/char/pcxx.c:2009: for each function it appears in.)
drivers/char/pcxx.c: In function `pcxe_tiocmset':
drivers/char/pcxx.c:2072: warning: control reaches end of non-void function
drivers/char/pcxx.c: At top level:
drivers/char/pcxx.c:1044: warning: `pcxe_init' defined but not used
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>
This patch has some minor cleanups for the v4l i2c modules: Don't ignore
the i2c_add_driver return value and mark the init+exit functions with
__init + __exit.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] read_ldt() neglects to check clear_user() return value
akpm: It's a bit debatable. The user passed in a buffer of a particular size,
and we successfully sopied the LDT info into it, but we got a fault when
clearing out the rest of the user's buffer. Is that worth a -EFAULT?
Bálint Márton [Fri, 3 Sep 2004 03:26:28 +0000 (20:26 -0700)]
[PATCH] urandom initialisation fix
The urandom driver returns the same thing after every boot.
The urandom pool is only cleared, and not initialized, and because there is
nothing in the primary pool, the reseeding is not successful. The solution
is also the same, initialize not just the primary and secondary, but also
the urandom pool.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Fri, 3 Sep 2004 03:26:16 +0000 (20:26 -0700)]
[PATCH] fix proc_symlink() warning with CONFIG_PROC_FS=n
The last parameter of proc_symlink is usually a "const char *", but the
stub in <linux/proc_fs.h> for CONFIG_PROC_FS=n omits the const and makes
its last parameter a "char *". This causes a warning about discarding
qualifiers for any code that passes something const for that last
parameter.
This patch fixes that up and also, for neatness's sake, makes the stub for
create_proc_read_entry() match the usual prototype more exactly (use
read_proc_t rather than the underlying function pointer type).
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Add IXDP2x01 board support to CS89x0 driver
The following patch modifies the CS89x0 driver to work on Intel's IXDP2401
and IXDP2801 (Intel ARm/XScale based) platforms:
- The main change requried is that the IXDP2x01 boards have the
chip connected through a CPLD so all registers appear at
dword-aligned addresses. A macro in the header adjusts the register
offsets appropriately.
- The boards do not have ISA, so we need to explicitly check for
IXDP2X01 in Kconfig.
- There is what I believe is a bug in the driver as it currently
only asks for the signature if ioaddr & 1 is set but then
reads and checks against the expected signature even when
!(ioaddr & 1). This causes the driver to not load on the IXDP2x01
since our ioaddr does not have bit 1 set.
- #ifdef out some bits of code that assume the chip is really
sitting on an ISA bus.
The main IXDP2x01 support will be coming in through rmk's tree at
a later date when all the drivers are merged upstream.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Fix argument checking in sched_setaffinity
This patch fixes the argument length checking in sched_setaffinity.
Previously it would error out when the length passed was smaller than
sizeof(cpumask_t). And any bits beyond cpumask_s would be silently
ignored.
First this assumes that the user application knows the size of cpumask_t,
which should be kernel internal. When you increase cpumask_t old
applications break and there is no good way for the application to find out
the cpumask_t size the kernel uses.
This patch changes it to do similar checking to the NUMA API calls:
- Any length is ok as long as all online CPUs are covered (this could
still cause application breakage with more CPUs, but there is no good way
around it)
- When the user passes more than cpumask_t bytes the excess bytes are
checked to be zero.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Add support for NUMA discovery on AMD dual core to x86-64
Following the CPUID extensions and APIC-ID setup presented by Richard
Brunner at Kernel Summit.
Without this the kernel's node discovery would assign the wrong nodes on
dual core systems and cause performance degradation.
Only handles power of two cored CPUs, others will be ignored.
/proc/cpuinfo has a new field cpu cores: <number of CPU cores> and also
show the other core as HT sibling (this is needed to make old CPU based
license managers to count one CPU package as only one physical CPU)
FIXME this currently misses the disable code for SMT idle. That's because
2.6.9rc1-bk6 removed the arch hooks need for that. Needs to be readded
later.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Haren Myneni [Fri, 3 Sep 2004 03:25:05 +0000 (20:25 -0700)]
[PATCH] ppc64: implement page_is_ram
This patch contains - Removes __initdata from lmb definition (struct lmb
lmb;) and modified the existing page_is_ram function.
Also changed the current argument from physical address to pfn to make it
compatible across architectures. Please review them and send me your
comments/suggestions. If you are OK with any one patch, please include it
in the mainline kernel.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Fri, 3 Sep 2004 03:24:41 +0000 (20:24 -0700)]
[PATCH] ppc64: allocate NUMA node data node locally
Instead of statically allocating the NUMA node structures, do it at runtime
with node local memory where possible. With NR_CPUS=128 we had over 800kB
of memory allocated before this patch, now we allocate only as many nodes
as the machine requires.
We have to do some fancy footwork in do_init_bootmem since we use both the
LMB allocator and the bootmem allocator at the same time. The problem has
always been there although I only recently found a test case that hit it.
Wrap that logic in careful_allocation which uses the LMB allocator then
falls back to the bootmem allocator if required.
Now alloc_bootmem on a node with no memory doesnt panic, we dont need the
hack in paging_init so remove it.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Fri, 3 Sep 2004 03:24:30 +0000 (20:24 -0700)]
[PATCH] ppc64: quieten NUMA boot messages
On some machines we would print hundreds of lines of NUMA debug output.
The following patch cleans it up so we only print a summary of cpus and
memory vs nodes: