Andrew Morton [Mon, 15 Mar 2004 23:29:37 +0000 (15:29 -0800)]
[PATCH] ppc64: fix for massive OF properties
From: Anton Blanchard <anton@samba.org>
We have some versions of firmware out there that have huge OF properties.
So huge that we end up overwriting our initrd.
Place a 1MB limit and warn bitterly if its over this. Also fix a use of
package-to-path where the variable was 64bytes but we would pass in a
length of 255.
Andrew Morton [Mon, 15 Mar 2004 23:28:51 +0000 (15:28 -0800)]
[PATCH] Cleanup ppc64 procfs code
From: Anton Blanchard <anton@samba.org>
Cleanup ppc64 procfs code:
- Use initcalls everywhere. This allowed us to remove the iseries proc
callback interface.
- Kill proc_pmc.c. Most of it wasnt used (and we are planning to export the
PMCs via sysfs). The few things left were iseries specific so they
got moved into iSeries_proc.c.
- Kill pmc.c. We dont use those statistics and the ones that are left
can be gained via PMCs.
- Create /proc/iSeries and /proc/ppc64 very early. This means we no
longer have to call proc_ppc64_init in all the drivers, we can
assume its there.
- Fix some error return cases in rtas-proc.c and rtas-flash
- Dont even try some pseries specific drivers on pmac.
Andrew Morton [Mon, 15 Mar 2004 23:27:40 +0000 (15:27 -0800)]
[PATCH] Add slow path lookup in xics_get_irq
From: Jake Moilanen <moilanen@austin.ibm.com>
In xics_get_irq(), for a real-to-virt irq lookup, go down the
slowpath by looking through the entire virt_irq_to_real_map array
if take a miss on the radix tree. This is possible, when an
interrupt is taken before the driver has called request_irq() (eg IDE).
Andrew Morton [Mon, 15 Mar 2004 23:26:41 +0000 (15:26 -0800)]
[PATCH] Fix xics IRQ affinity
From: Anton Blanchard <anton@samba.org>
- Merge some whitespace differences with the ameslab tree
- We check for CPU_MASK_ALL in xics to send irqs to all cpus.
In some cases CPU_MASK_ALL is smaller than the cpumask (eg
NR_CPUS == 32 and cpumask is a long), so we mask it here to
be consistent.
Andrew Morton [Mon, 15 Mar 2004 23:26:29 +0000 (15:26 -0800)]
[PATCH] Fix multiple EEH-related bugs
From: Linas Vepstas <linas@austin.ibm.com>
This patch fixes multiple EEH-related bugs:
- Fixes the eeh_check_failure() usage in an interrupt context.
This routine is now safe to use in an interrupt. The fix was to
build a cache of IO addresses and check that, instead of using
the pci routines.
- Merges in Olof Johansson's sizeof patch when checking for failure
- Adds EEH tests to array/string reads
- Fixes bugs with address resolution (some i/o addresses were handled
incorrectly, resulting in EEH errors slipping by undetected.)
- Adds EEH support to the PCI Hotplug system (so that devices that
get added/removed get properly registered with the EEH subsystem.)
- Fixes improper use of /proc filesystem.
- Adds some misc statistics.
While merging Linas' patch I also converted the proc usage to
seq_single, used per cpu variables for the stats and removed the
eeh-force-off option.
Andrew Morton [Mon, 15 Mar 2004 23:26:19 +0000 (15:26 -0800)]
[PATCH] Fix for hotplug of multifunction cards.
From: Linda Xie <lxiep@us.ibm.com>
The changes in this patch are for multifunction cards insertions/removals
and bug fixes:
1. fix up new nodes' linux_phandle field.
2. new nodes' phb, devfn(and so on) need to be fixed even the nodes don't
have "interrupts".
3. change of_remove_node to non-recurisve func. The recursions will be done
by the caller.
4. add a new function -- of_finish_dynamic_node_interrupts()
Andrew Morton [Mon, 15 Mar 2004 23:22:49 +0000 (15:22 -0800)]
[PATCH] iostats averaging fix
From: Rick Lindsley <ricklind@us.ibm.com>
Fix bug #2230.
I've corresponded with the submitter and he did find a real bug -- when we
were merging I/O requests we didn't always take the oldest request start
time, which would cause a couple of the calculations like wait time and
average queue size to be too small. He found it mathematically but having
done so, I think logic and inspection makes it easy to verify.
Andrew Morton [Mon, 15 Mar 2004 23:22:38 +0000 (15:22 -0800)]
[PATCH] blk: statically initialise the congestion waitqueue_heads
On a really small memory machine (or one with a monstrous kernel memory leak)
we can end up calling blk_congestion_wait() before the waitqueue_heads are set
up.
Andrew Morton [Mon, 15 Mar 2004 23:22:26 +0000 (15:22 -0800)]
[PATCH] kill INIT_THREAD_SIZE
From: Matt Mackall <mpm@selenic.com>
This piece of the THREAD_SIZE cleanup got dropped. If you make THREAD_SIZE
> 8k, the init thread overlaps the .init section and gets smashed. I've
gone ahead and killed INIT_THREAD_SIZE throughout as it wasn't doing much.
This also saves 4k when we use 4k stacks. Please apply. Couple more minor
pieces remaining.
Andrew Morton [Mon, 15 Mar 2004 23:22:03 +0000 (15:22 -0800)]
[PATCH] slab: fix display of object length in corruption detector
From: Manfred Spraul <manfred@colorfullife.com>
print_objinfo() dumps the first few characters of an interesting object for
debugging. It used the wrong object len (including debug padding, instead
of just the data area), which could cause an oops if DEBUG_PAGEALLOC is
enabled.
Andrew Morton [Mon, 15 Mar 2004 23:21:39 +0000 (15:21 -0800)]
[PATCH] do_write_mem() return value check
From: BlaisorBlade <blaisorblade_spam@yahoo.it>, and me
- remove unused `file *' arg from do_write_mem()
- Add checking for copy_from_user() failures in do_write_mem()
- Return correct value from kmem writes() when a fault is encountered. A
write()-style syscall's return values are:
0 when nothing was written and there was no error (someone tried to
write zero bytes)
>0: the number of bytes copied, whether or not there was an error.
Userspace detects errors by noting that the write() return value is less
than was requested.
Andrew Morton [Mon, 15 Mar 2004 23:21:05 +0000 (15:21 -0800)]
[PATCH] reiserfs: fix transaction sizes
From: Chris Mason <mason@suse.com>
Make sure reiserfs uses a reasonable number when restarting long unbounded
transactions (creating holes or deleting files).
Without this patch, the number of blocks requested grows with each
transaction restart, until it hits MAX_BATCH_COUNT and starts forcing
commits with every new transaction.
Andrew Morton [Mon, 15 Mar 2004 23:20:29 +0000 (15:20 -0800)]
[PATCH] reiserfs: fix null pointer deref
From: Chris Mason <mason@suse.com>
From: Jeff Mahoney <jeffm@suse.de>
fsstress manages to setup a sequence of events that allow an attempt to
perform direct-io on a tail. bh_result->b_page == NULL, which causes the
PageLocked and PageWriteback checks to perform a NULL deref, causing the
oops.
Andrew Morton [Mon, 15 Mar 2004 23:20:05 +0000 (15:20 -0800)]
[PATCH] fbdev: character drawing enhancement.
From: James Simmons <jsimmons@infradead.org>
This patch merges two of the drawing functions. The patch uses aligned
transfers when possible even on displays where the characters are not byte
align. Tested on my my laptop for 12 bit width fonts and 8 bit wide fonts.
It works very nicely.
Andrew Morton [Mon, 15 Mar 2004 23:19:52 +0000 (15:19 -0800)]
[PATCH] page_referenced() simplification
There's no point in calling mark_page_accessed() here. The page is never on
the LRU so all mark_page_accessed() will do is to set PG_referenced, which we
immediately clear again.
Andrew Morton [Mon, 15 Mar 2004 23:19:29 +0000 (15:19 -0800)]
[PATCH] flush_scheduled_work() deadlock fix
Because keventd is a resource which is shared between unrelated parts of the
kernel it is possible for one person's workqueue handler to accidentally call
another person's flush_scheduled_work(). thockin managed it by calling
mntput() from a workqueue handler. It deadlocks.
It's simple enough to fix: teach flush_scheduled_work() to go direct when it
discovers that the calling thread is the one which should be running the
work.
Note that this can cause recursion. The depth of that recursion is equal to
the number of currently-queued works which themselves want to call
flush_scheduled_work(). If this ever exceeds three I'll eat my hat.
Andrew Morton [Mon, 15 Mar 2004 23:19:18 +0000 (15:19 -0800)]
[PATCH] selinux: fix compute_av bug
From: Stephen Smalley <sds@epoch.ncsc.mil>
This patch fixes a bug in the SELinux compute_av code; the current code
yields the right access computation but can cause unnecessary (but
harmless) processing to occur when transition permission wasn't granted in
the first place by the TE configuration. Thanks to Chad Hanson of TCS for
reporting the bug.
Andrew Morton [Mon, 15 Mar 2004 23:19:07 +0000 (15:19 -0800)]
[PATCH] kbuild: fix modpost when used with O=
From: Sam Ravnborg <sam@ravnborg.org>
modpost or to be more specific sumversion.c was not behaving correct when
used with O= and MODULE_VERSION was used. Previously it failed to use
local .h when calculation the md-sum in case of a O= build.
The following patch introduces the following:
- A generic get_next_line()
- Check that the topmost part of the directory matches
- Using strrch when checking for file with suffix .o
- Use NOFAIL for allocations in sumversion
- Avoid memory leak in new_module
The generic get_next_line will pay off when Andreas implmentation of
storing symbol addresses in a seperate file is introduced.
ver_linux hasn't displayed binutils version right for some time. This patch
corrects that and preserves the old behaviour as well, as suggested by Rusty.
Andrew Morton [Mon, 15 Mar 2004 23:16:02 +0000 (15:16 -0800)]
[PATCH] ide-scsi error handling fixes
From: Willem Riede <wrlk@riede.org>
The patch revises the error handling in ide-scsi, fixing the scheduling
while locked issues, and make it work properly, at least for me...
Specific changes in this patch:
- introduce idescsi_expiry, a timeout routine for the ide subsystem,
which simply flags the fact that the command timed out, but postpones
any other action until either the command still finishes on its own
(unlikely?) or the scsi error handler kicks in;
- introduce idescsi_atapi_error and idescsi_atapi_abort, error routines
for the ide subsystem, which are modeled after those of ide-cd, but
take only minimal effort to recover, leaving the heavy lifting for
the scsi error handler;
- rewrite (and rename for clarity) idescsi_eh_abort and idescsi_eh_error,
the abort/error routines to be called by the scsi error handler --
this redesign should not have the scheduling while atomic problems
of the old implementation.
- move ide_cdrom_dump_status() from ide-cd.c to ide-lib.c as
ide_dump_atapi_status() and both ide-cd and ide-scsi call it.
- replaces BUG() by WARN_ON()/printk in the error handling code.
- sets TASK_UNINTERRUPTIBLE before schedule_timeout() and moves the host
unlock/lock around the while loop inside the loop in idescsi_eh_reset().
Andrew Morton [Mon, 15 Mar 2004 23:15:51 +0000 (15:15 -0800)]
[PATCH] selinux: Conditional policy extension and MLS detection support
From: Stephen Smalley <sds@epoch.ncsc.mil>
This patch extends the SELinux policy engine to support conditional policy
logic based on a set of policy booleans, allowing well-formed changes to
the policy to be defined within and mediated by the policy itself.
The conditional policy extensions were implemented and contributed by
Tresys Technology.
Userland packages that support these extensions are already available from
nsa.gov/selinux, and backward compatibility is provided for the prior
policy version.
The patch also includes a small change to enable detection of the optional
MLS policy model on a SELinux system and fixes to the conditional policy
extensions to allow the MLS policy to work correctly with them that were
implemented and contributed by Trusted Computer Solutions.
Andrew Morton [Mon, 15 Mar 2004 23:15:05 +0000 (15:15 -0800)]
[PATCH] Fix early parallel make failures
From: Sam Ravnborg <sam@ravnborg.org>
Ingo said:
Starting at around 2.6.4-rc2-mm1, I keep seeing 'scripts/fixdep: Text
file busy' messages when doing a -j10 bzImage build - which seems to
suggest that by the time fixdep is used by the build system it's not
built yet.
Sam said:
I was pretty sure it was something I had caused, so I gave it a spin. What
actually happened was that we tried to build the target 'silentoldconfig'
in parrallel with 'scripts'. Since 'silentoldconfig' started a new make
and then the config target needed 'scripts' we saw two parallel runs.
The way I decided to fix it was to split scripts/ in two parts. The first
part is now the very basic stuff - moved to scripts/basic/. The second
part is dependent on kernel config etc. and kept in scripts/
In the 2.7 timeframe i will redo this initial stuff - it's becoming too
messy for anyone to understand today.
Description:
Fix dependencies in early phases of kernel build. This solves a few
problems nively: modpost is no longer rebuild twicewhen reaching the
'target' state 'make -j10' now works nicely again
The patch is rather large due to the following file moves:
mkdir scripts/basic
mv scripts/fixdep.c scripts/basic
mv scripts/split-include.c scripts/basic
mv scripts/docproc.c scripts/basic
The g5 iommu code would fill the "iommu_table" member of whatever
device node was pointed to by pcidev->sysdata during boot. However,
the ppc64 kernel fills that with a pointer to the PHB node which is
later replaced "lazily" with a pointer to the real node when calling
pci_device_to_OF_node(). In this case, we were thus "losign" the
iommu_table pointer. Typical symptom: loss of the SATA when looking
at it's /proc entry.
This fixes it by forcing the update to the final sysdata pointer
when filling up the iommu_table pointers. The "lazy" thing is useless
on pmac anyway.
Keith Owens [Mon, 15 Mar 2004 15:31:37 +0000 (07:31 -0800)]
[PATCH] ia64: Decode salinfo oemdata for SN2 via PROM
SN2 platforms provide oemdata in salinfo records. The decode of that
oemdata is done via prom routines. This patch provides the interface
from user space through the kernel into the prom to do the oem decode.
David Mosberger [Mon, 15 Mar 2004 15:30:13 +0000 (07:30 -0800)]
ia64: Based on patch by Keith Owens: put stop bit to work around GCC problem.
Apparently GCC sometimes fails to insert a stop-bit when re-using p14
after the spinlock directives, even though the register is clearly marked
as "clobbered".
Use the proper (and cleaner) probing API instead of the old
scsi_module.c hack, don't use the typedefs I plan to kill in 2.7 and
mark everything static
Bjorn Helgaas [Mon, 15 Mar 2004 14:34:08 +0000 (06:34 -0800)]
[PATCH] ia64: update ia64/Kconfig
This Kconfig patch basically just makes ia64 look a little more like i386:
- moves system type above processor type
- moves PM & ACPI to a new top-level menu
- moves PCI/PCMCIA to a new top-level menu
Jens Axboe [Mon, 15 Mar 2004 13:24:51 +0000 (05:24 -0800)]
[PATCH] sys_swapon bad arg causing slab corruption
There's an error in sys_swapon() that can cause slab corruption if you
pass in a bad specialfile pointer. getname() then returns
ERR_PTR(-EFAULT), but sys_swapon() doesn't clear name before calling
putname() on it (thus freeing 0xfffffff2, corrupting slab). An ltp test
case repeatedly crashed in later tests due to thus, irk.
Paul Wagland [Mon, 15 Mar 2004 13:15:14 +0000 (05:15 -0800)]
[PATCH] Set module owner in megaraid driver
This bug was discussed on linux-scsi a few weeks back, but it appears to
have slipped through the cracks. This fix was originally proposed by
Christoph Hellwig, but I am reposting it, since I have the hardware :-)
Anyway, the problem that this fixes is that megaraid doesn't set the
moduler owner for the host_template, this means that the module can be
removed, even when it is in use.
Andrew Morton [Mon, 15 Mar 2004 13:02:26 +0000 (05:02 -0800)]
[PATCH] generic 32 bit emulation for System-V IPC
From: Arnd Bergmann <arnd@arndb.de>
Adds a generic implementation of 32 bit emulation for IPC system calls. The
code is based on the existing implementations for sparc64, ia64, mips, s390,
ppc and x86_64, which can subsequently be converted to use this.