Russell King [Fri, 2 Apr 2004 13:17:43 +0000 (14:17 +0100)]
[ARM] Update ARM makefiles
- Use -march=armv6 where available.
- CFLAGS_BOOT isn't needed - the decompressor uses CFLAGS, remove it.
- PROCESSOR is never used, remove it.
- LDFLAGS_BLOB is never used, remove it.
- Remove MACHINE macro.
- Correct comments for include/asm-arm/.arch target.
- Copy format of include/asm symlink rule.
- Arrange for configuration to be split before making
include/asm-arm/arch symlink.
- This means that asm-offsets.s no longer depends on
include/config/MARKER.
Andrew Morton [Wed, 31 Mar 2004 00:34:59 +0000 (16:34 -0800)]
[PATCH] ppc64: clean up virtual <-> absolute code
From: Anton Blanchard <anton@samba.org>
Rusty Russell <rusty@rustcorp.com.au>
The iSeries has an arch-specific mapping from physical <-> absolute
addresses. Fortunately this is only used in a few places. However, the
following arch-specific macros/functions are provided in addition to the
standard macros:
Reduce them to these, with slightly shorter names, and taking either pointers
or unsigned long (as per __va and __pa) rather than making the caller cast:
abs_to_phys()
phys_to_abs()
And helper macros:
virt_to_abs()
abs_to_virt()
As is standard, virtual addresses are returned as void *, physical and
absolute as unsigned long.
Note that the change the iSeries_setup is a little subtle: ea is set to
__va(pa) above, so "phys_to_abs(pa)" is the same as "virt_to_abs(ea)".
Also, REALADDR is renamed to ISERIES_HV_ADDR and used in a couple of places
where appropriate.
This backs out Maneesh's sysfs patch that was recently added to the
kernel.
In its defense, the original patch did solve some fixes that could be
duplicated on SMP machines, but the side affect of the patch caused lots
of problems. Basically it caused kobjects to get their references
incremented when files that are not present in the kobject are asked for
(udev can easily trigger this when it looks for files call "dev" in
directories that do not have that file). This can cause easy oopses
when the VFS later ages out those old dentries and the kobject has its
reference finally released (usually after the module that the kobject
lived in was removed.)
I will continue to work with Maneesh to try to solve the original bug,
but for now, this patch needs to be applied.
[PATCH] ppc64: Add a sync in context switch on SMP
For the same reason as ppc32, we need to ensure that all stores
done on a CPU has reached the coherency domain and are visible
to loads done by another CPU when context switching as the same
thread may be rescheduled almost right away there.
On ppc32, CONFIG_PREEMPT wasn't settable along with CONFIG_SMP
for historical reasons (smp_processor_id() races). Those races have
been fixes since then (well, should have been at least) so it's now
safe to allow both options.
This fixes a few issues with context switch on ppc32:
- Makes sure we properly flush out all stores to the coherency domain
when switching out, since the same thread could be switched back in
on another CPU right away, those stores must be visible to all other
CPUs.
- Remove dssall in the assembly calls and do it now once in switch_mm
(stop vmx streams). Assume the G5 doesn't need a sync after dssall.
- Remove bogus isync in the loop setting the userland segment registers
- Do not switch the userland segments when the mm stays the same
Add a warning if enable_kernel_{fp,altivec} is called with preempt
enabled since this is always an error, and make sure the alignement
exception handler properly disables preempt when doing FP operations.
Andrew Morton [Tue, 30 Mar 2004 02:41:57 +0000 (18:41 -0800)]
[PATCH] Make pdflush run at nice 0
Since pdflush was converted to be launched by the kthread infrastructure it
has inherited keventd's `nice -10' setting. That hurts interactivity when
pdflush is doing lots of work writing back through the dm-crypt layer.
Andrew Morton [Tue, 30 Mar 2004 02:41:44 +0000 (18:41 -0800)]
[PATCH] catch errors when completing bio pairs
From: Mike Christie <michaelc@cs.wisc.edu>
A couple of drivers can sometimes fail the first segments in a bio then
requeue the rest of the request. In this situation, if the last part of
the bio completes successfully bio_pair_end_* will miss that the beginging
of the bio had failed becuase they just return one when bi_size is not yet
zero. The attached patch moves the error value test before the bi_size to
catch the above case.
Andrew Morton [Tue, 30 Mar 2004 02:41:31 +0000 (18:41 -0800)]
[PATCH] Fix BLKPREP_KILL
From: Jens Axboe <axboe@suse.de>
Samuel Rydh wrote:
If a MODE_SENSE(6) command is sent to an IDE cd using the CDROM_SEND_PACKET
ioctl, then the kernel freezes solidly. To reproduce this, one can take the
SCSI cmd [1a 08 31 00 10 00] and a 16 byte data buffer.
After some bug hunting, I found out that the following is what happens:
- ide-cd recognizes that MODE_SENSE(6) isn't supported and tries
to abort the request from ide_cdrom_prep_pc by returning BLKPREP_KILL.
- in elv_next_request(), the kill request is handled by
the following code:
while (end_that_request_first(rq, 0, rq->nr_sectors))
;
end_that_request_last(rq);
The while loop never exits. The end_that_request_first() doesn't do anything
since rq->nr_sectors is 0; it just returns "not-done" after handling those 0
bytes (rq->bio->bi_size is 16).
Jaroslav Kysela [Mon, 29 Mar 2004 14:26:33 +0000 (16:26 +0200)]
ALSA CVS update - Clemens Ladisch <clemens@ladisch.de>
AC97 Codec Core
don't clobber other bits in SERIAL_CFG register with AD codecs when changing codec selection bits
Jaroslav Kysela [Mon, 29 Mar 2004 14:21:17 +0000 (16:21 +0200)]
ALSA CVS update - Jaroslav Kysela <perex@suse.cz>
PCM Midlevel
Fix in snd_pcm_timer_resolution_change() - it no longer oops when
32-bit value overflows.
Jaroslav Kysela [Mon, 29 Mar 2004 14:20:32 +0000 (16:20 +0200)]
ALSA CVS update - Jaroslav Kysela <perex@suse.cz>
Sound Core PDAudioCF driver
Adrian Bunk <bunk@fs.tum.de>
Fix warnings (SNDRV_GET_ID is not required since these files don't use get_id).
Jaroslav Kysela [Mon, 29 Mar 2004 14:17:10 +0000 (16:17 +0200)]
ALSA CVS update - Clemens Ladisch <clemens@ladisch.de>
USB generic driver
replace usage of interface index with calls to usb_ifnum_to_if (forgot this in 1.88)
Jaroslav Kysela [Mon, 29 Mar 2004 14:16:47 +0000 (16:16 +0200)]
ALSA CVS update - Clemens Ladisch <clemens@ladisch.de>
USB generic driver
remove calls to usb_driver_release_interface
(not needed when disconnect is called)
Harald Welte [Mon, 29 Mar 2004 12:26:56 +0000 (04:26 -0800)]
[NETFILTER]: Fix DELETE_LIST oopses.
We've now narrowed down the issue of kernel oopses in combination with
'LIST_DELETE' syslog messages happening in certain setups.
Apparently people who do not enable CONFIG_IP_NF_NAT_LOCAL and do
DNAT/REDIRECT and want to connect locally from the gateway via DNAT to
the DNAT'ed address experience the bug ;)
Patch courtesy of KOVACS Krisztian and Henrik Nordstrom
Jeff Garzik [Mon, 29 Mar 2004 08:17:18 +0000 (00:17 -0800)]
[PATCH] fix SATA simulation of 6-byte read/write
Here's one for -rc... either this bit is assumed on most modern drives,
or nobody uses the 6-byte commands for read/write (which is very
likely). Either way it definitely wants fixing.
Since we use the modern "LBA" method of addressing sectors, this bit
must be present in the Device register when issuing a read or write.
There are three code paths that need this bit, and only two of them
actually set it. This patch fixes the third (and apparently never used)
code path.
Russell King [Mon, 29 Mar 2004 20:48:20 +0000 (21:48 +0100)]
[ARM] Clean up coherent DMA allocator from previous changes.
- Since the coherent DMA allocator is not currently compatible with
HUGETLB, ensure that we fail at compile time should this option be
selected.
- Move struct device/dma mask handling into consistent_alloc().
- Complain if someone tries to allocate coherent memory larger than
their DMA mask will permit.
- Rename consistent_alloc() to __dma_alloc() to ensure that there
is no confusion that consistent_alloc() has gone.
- Ensure warnings and errors report the correct function name.
Russell King [Mon, 29 Mar 2004 12:16:20 +0000 (13:16 +0100)]
[ARM] Extend DMA API on ARM for DMA-able writecombining memory.
This is mainly for ARM framebuffer drivers, some of which are
presently either open-coding this functionality, or using some
internal ARM architecture function to get what they want.
Andrew Morton [Mon, 29 Mar 2004 06:52:25 +0000 (22:52 -0800)]
[PATCH] inode dirtying timestamp fix
It's a bit late in 2.6.5-rc for this, but it does fix a significant bug: for
the first five minutes after boot, prior to the jiffy wrap, /bin/sync doesn't
write all of the dirty data.
We currently record an inode's time-of-first-dirtying in the address_space.
This causes a few problems with dirty block special inodes: when the device
node for /dev/hda1 needs to be written back we bogusly inspect the timestamp
for the address_space, which belongs to a different inode.
So move the inode's dirtying time up into the inode itself.
This means that for block-special inodes, inode->dirtied_when represents the
time at which the inode itself was dirtied.
For regular files it represents the time at which the inode or its pages were
dirtied.
For blockdevs, the time-of-first-dirtying is recorded in the kernel-internal
blockdev inode. Only I_DIRTY_PAGES makes sense on these inodes.
The reason all this works is that when dirtying a page we always run
__mark_inode_dirty(page->mapping->host);
which refers to the kernel-internal blockdev inode.
Andrew Morton [Mon, 29 Mar 2004 06:51:01 +0000 (22:51 -0800)]
[PATCH] cciss: return -ENXIO on no-device-present
From: mike.miller@hp.com
If no device is attached we now return -ENXIO instead of some bogus
numbers. Prevents applications from trying to access non-existent disks.
Also adds HDIO_GETGEO_BIG IOCTL that fdisk uses.
Andrew Morton [Mon, 29 Mar 2004 06:50:46 +0000 (22:50 -0800)]
[PATCH] cciss: support MSA30 storage enclosures
From: <mike.miller@hp.com>
This change is required to support the new MSA30 storage enclosure. If you
do a SCSI inquiry to a SATA disk bad things happen. This patch prevents
the inquiry from going to SATA disks.
Andrew Morton [Mon, 29 Mar 2004 06:49:51 +0000 (22:49 -0800)]
[PATCH] Fix slab creation/destruction vs. CPU Hotplug
From: Rusty Russell <rusty@rustcorp.com.au>
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Hit a couple of (cpu hotplug) races in slab allocator during my tests.
Mostly it was because of continuous loading/unloading fs/minix/minix.ko
while simultaneously doing offline/online of CPUs. As part of its init and
exit routines, minix.ko create/destroys caches, which lead to several
oopses.
1. kmem_cache_create
In brief, kmem_cache_create does:
a) calls enable_cpucache to create per-cpu cache for all
online CPUs.
b) adds the cache to the global list of caches
These two are not done atomically and thats what causes problems.
For ex: lets say that at the time of step a) CPU1 is not online.
Hence no per-cpu cache is created for CPU1 (cachep->array[1] is NULL).
However CPU1 is not completely dead in the sense that CPU_DEAD
processing for it is not yet over. By the time CPU_DEAD processing
starts for CPU1, step b) is complete. So cpuup_callback finds this
cache and tries freeing it's per-cpu cache associated with CPU1.
In the process it dereferences a NULL pointer and dies.
2. kmem_cache_destroy
In brief, kmem_cache_destroy does:
a) deletes the cache from the global list of caches
b) Drain per-cpu cache (drain_cpu_caches), which
basically uses smp_call_function to run do_drain
on all online CPUs.
One possible race is let's say that CPU1 is coming up.
By the time CPU_UP_PREPARE is processed for CPU1, step a) is
complete. Hence cpuup_callback does not allocate any per-cpu cache
for the cache that is being destroyed.
However by the time step b) is run, CPU1 is completely online
(taking interrupts). It receives the IPI and tries draining
it per-cpu cache (which is NULL) and dies there.
I think we need to serialize kmem_cache_create/destroy against CPU hotplug
to prevent these problems. Patch below does that by taking CPU Hotplug sem
(which is OK since kmem_cache_create/destroy are not very frequently
used?).
Andrew Morton [Mon, 29 Mar 2004 06:49:35 +0000 (22:49 -0800)]
[PATCH] Fix posix scheduling violation for !SCHED_OTHER
From: Joe Korty <joe.korty@ccur.com>
The following fixes a problem where a SCHED_FIFO task would on occasion be
moved to the end of its runqueue when returned to from a preemption. Cause
was due to some SCHED_OTHER code in schedule() which was being run for tasks
of every policy.
rmmod'ing pmac_zilog currently oopses because uart_unregister_driver(),
which nullifies drv->tty_driver, is called before uart_remove_one_port(),
which uses said drv->tty_driver.
The comment at top of uart_unregister_driver() specifically says we have
to have removed all our ports via uart_remove_one_port() before.
[PATCH] ppc64: syscall error test incorrect for 64 bits results
The syscall return path on ppc64 checks if the error is between
-LAST_ERRNO and 0, if it is, does the usual inversion along with
setting a CR bit indicating to glibc that an error occured.
However, we had an interesting bug where we used a 32 bits logica
(unsigned) comparison, thus possibly doing false positives for
valid 64 bits unsigned values whose low 32 bits happen to be in
the error range.
[PATCH] Add BINFMT_MISC docs for Mono .NET-based binaries
Just as there is documentation for BINFMT_MISC and Java bytecodes
support, I thought it could be interesting to add documentation on how
to add BINFMT_MISC support for directly running .NET ".exe" binaries
using the Mono CLR.
This patch fixes more cases of possible preempt issue when testing
MSR for FP or VEC bits and then doing giveup_fpu or giveup_altivec
that I missed in my previous round of fixes (bk get helps before
grepping ;)
I also change the single step and program check exceptions to not
re-enable interrupts right away on C code entry, it was useless and
would cause interesting issues with preempt & xmon
Roman Zippel [Sun, 28 Mar 2004 23:35:09 +0000 (15:35 -0800)]
[PATCH] add missing <linux/config.h>
A few asm/types.h test a config variable without including
<linux/config.h> first, which can e.g. cause different sector_t
definitions. HFS fell victim to that and broke on ppc with CONFIG_LBD
enabled. I scanned all asm/types.h and added <linux/config.h> as
necessary.
Neil Brown [Sun, 28 Mar 2004 10:33:50 +0000 (02:33 -0800)]
[PATCH] Fix bugs introduced by recent improvements to readdir_plus
- make sure cd->buffer is always inside a page - previously if an
entry fit perfectly in the remainder of a page, cd->buffer would
end up pointing past the end of that page.
- make sure num_entry_words is always correct, even on the error
path.