[PATCH] i386/x86_64: FIX pci_enable_irq to set dev->irq to the irq number
In commit ace80ab796ae30d2c9ee8a84ab6f608a61f8b87b I removed the weird
logic that used the vector number as the irq number when MSI was
defined. However pci_enable_irq was using a different test in the
io_apic_assign_irqs path and I missed it :(
This patch removes the wrong code so no one hits this problem.
This code is only active when a specific set of boot command line
parameters is specified which likely explains why no one has notices
this earlier.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Trond Myklebust [Sun, 8 Oct 2006 18:33:24 +0000 (14:33 -0400)]
[PATCH] NFS: Fix typo in nfs_get_client()
NFS_CS_INITING > NFS_CS_READY, so instead of waiting for the structure to
get initialised, we currently immediately jump out of the loop without ever
sleeping.
[MIPS] Show actual CPU information in /proc/cpuinfo
Currently, /proc/cpuinfo contains several copies of the information for
whatever processor we happen to be scheduled on. This patch makes it contain
the proper information for each CPU, which is particularly useful on mixed
R12k/R10k IP27 machines.
Linus Torvalds [Sat, 7 Oct 2006 17:52:00 +0000 (10:52 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] PReP fixup after irq changes
[POWERPC] SPU fixup after irq changes
[POWERPC] Fix up after irq changes
[POWERPC] Fix iseries/smp.c for irq breakage
[POWERPC] Fix viocons for irq breakage
[POWERPC] Update iseries_defconfig
[POWERPC] Fix fsl_soc build breaks
[POWERPC] Minor fix for bootargs property
[POWERPC] Update MTFSF_L() comment
[POWERPC] Update pSeries defconfig for SATA
[POWERPC] Don't get PCI IRQ from OF for devices with no IRQ
[POWERPC] Fix zImage decompress location
[POWERPC] linux,tce-size property is 32 bits
[POWERPC] Add DTS for MPC8349E-mITX board
[POWERPC] Fix harmless typo
[PPC] Fix some irq breakage with ARCH=ppc
Al Viro [Sat, 7 Oct 2006 13:16:45 +0000 (14:16 +0100)]
[PATCH] m68k pt_regs fixes
m68k_handle_int() split in two functions: __m68k_handle_int() takes
pt_regs * and does set_irq_regs(); m68k_handle_int() doesn't get pt_regs
*.
Places where we used to call m68k_handle_int() recursively with the same
pt_regs have simply lost the second argument, the rest is switched to
__m68k_handle_int().
The rest of patch is just dropping pt_regs * where needed.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] swsusp: Make userland suspend work on SMP again
Unfortunately one of the recent changes in swsusp has broken the userland
suspend on SMP. Fix it.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Init list is called with a list parameter that is not equal to the
cachep->nodelists entry under NUMA if more than one node exists. This is
fully legitimatei. One may want to populate the list fields before
switching nodelist pointers.
Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Olaf Hering [Sat, 7 Oct 2006 12:08:26 +0000 (22:08 +1000)]
[POWERPC] Fix up after irq changes
Remove struct pt_regs * from all handlers.
Also remove the regs argument from get_irq() functions.
Compile tested with arch/powerpc/config/* and
arch/ppc/configs/prep_defconfig
Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Olof Johansson [Fri, 6 Oct 2006 02:16:48 +0000 (21:16 -0500)]
[POWERPC] Fix fsl_soc build breaks
Hrm, there's no way this ever built at time of merge. There's a missing } and
the wrong type on phy_irq.
Also, another const for get_property().
CC arch/powerpc/sysdev/fsl_soc.o
arch/powerpc/sysdev/fsl_soc.c: In function 'fs_enet_of_init':
arch/powerpc/sysdev/fsl_soc.c:625: error: assignment of read-only variable 'phy_irq'
arch/powerpc/sysdev/fsl_soc.c:625: warning: assignment makes integer from pointer without a cast
arch/powerpc/sysdev/fsl_soc.c:661: warning: assignment discards qualifiers from pointer target type
arch/powerpc/sysdev/fsl_soc.c:684: error: subscripted value is neither array nor pointer
arch/powerpc/sysdev/fsl_soc.c:687: error: subscripted value is neither array nor pointer
arch/powerpc/sysdev/fsl_soc.c:722: warning: ISO C90 forbids mixed declarations and code
arch/powerpc/sysdev/fsl_soc.c:728: error: invalid storage class for function 'cpm_uart_of_init'
arch/powerpc/sysdev/fsl_soc.c:798: error: initializer element is not constant
arch/powerpc/sysdev/fsl_soc.c:798: error: expected declaration or statement at end of input
make[1]: *** [arch/powerpc/sysdev/fsl_soc.o] Error 1
Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Olaf Hering [Fri, 6 Oct 2006 18:53:10 +0000 (20:53 +0200)]
[PATCH] fix mesh compile errors after irq changes
drivers/scsi/mesh.c:469: error: too many arguments to function 'mesh_interrupt'
drivers/scsi/mesh.c:507: error: too many arguments to function 'mesh_interrupt'
Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Linus Torvalds [Fri, 6 Oct 2006 18:35:08 +0000 (11:35 -0700)]
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa:
[ALSA] version 1.0.13
[ALSA] sound/pci/au88x0/au88x0.c: ioremap balanced with iounmap
[ALSA] Handle file operations during snd_card disconnects using static file->f_op
[ALSA] emu10k1: Fix outl() in snd_emu10k1_resume_regs()
[ALSA] Repair snd-usb-usx2y for usb 2.6.18
[ALSA] Fix bug in snd-usb-usx2y's usX2Y_pcms_lock_check()
[ALSA] Dereference after free in snd_hwdep_release()
[ALSA] Fix memory leak in sound/isa/es18xx.c
[ALSA] hda-intel - New pci id for Nvidia MCP61
[ALSA] Add new subdevice ids for hda-intel
[ALSA] WM9712 fixes for ac97_patch.c
[ALSA] hda/patch_si3054: new codec vendor IDs
Karsten Wiese [Fri, 6 Oct 2006 14:08:27 +0000 (16:08 +0200)]
[ALSA] Handle file operations during snd_card disconnects using static file->f_op
Alsa used to kmalloc one file->f_op per file per disconnecting snd_card.
This led to oopses sometimes when file->f_op was freed before __fput()
finished.
Patch adds a virtual device for disconnect: VDD.
VDD consists of:
LIST_HEAD(shutdown_files)
protected by DEFINE_SPINLOCK(shutdown_mutex)
static struct file_operations snd_shutdown_f_ops
and functions assigned to it
Additions to struct snd_monitor_file
to specify if instance is hidden by VDD or not.
A VDD's instance is
created in snd_card_disconnect() under the card->files_lock.
cleaned up in snd_card_file_remove() under the card->files_lock.
Arnaud Patard [Wed, 4 Oct 2006 16:21:05 +0000 (18:21 +0200)]
[ALSA] emu10k1: Fix outl() in snd_emu10k1_resume_regs()
The emu10k1 driver saves the A_IOCFG and HCFG register on suspend and restores
it on resumes. Unfortunately, this doesn't work as the arguments to outl() are
reversed.
Karsten Wiese [Wed, 4 Oct 2006 15:16:46 +0000 (17:16 +0200)]
[ALSA] Fix bug in snd-usb-usx2y's usX2Y_pcms_lock_check()
Fix bug in snd-usb-usx2y's usX2Y_pcms_lock_check()
substream can be NULL......
in mainline, bug was introduced by:
2006-06-22 [ALSA] Add O_APPEND flag support to PCM
Tobin Davis [Tue, 26 Sep 2006 13:30:10 +0000 (15:30 +0200)]
[ALSA] Add new subdevice ids for hda-intel
This patch adds a couple of device ids for Acer laptops. In both cases,
the owners got the driver working by adding 'model=acer' to their
modprobe.conf files.
Signed-off-by: Tobin Davis <tdavis@dsl-only.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Luke Zhang [Tue, 26 Sep 2006 13:28:41 +0000 (15:28 +0200)]
[ALSA] WM9712 fixes for ac97_patch.c
This patch by Luke Zhang fixes a couple of issues with the WM9712
support in ac97_patch.c
Changes:-
o Fix Out3 ZC switch invert.
o Extend capture volume control to 6 bits.
o Change Mic 1 volume mask to 5 bits (31).
o Add Mic 2 volume.
Signed-off-by: Luke Zhang <lzhang@intrinsyc.com> Signed-off-by: Liam Girdwood <liam.girdwood@wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
There are additional IDs for Si3054 codec based HDA modems. Most of
them were discovered on discuss@linmodems.org list - Thanks to MarvS
and all linmodems.org folks.
Jiri Kosina [Fri, 6 Oct 2006 09:11:56 +0000 (11:11 +0200)]
[PATCH] make kernels with CONFIG_X86_GENERIC and !CONFIG_SMP compilable
CONFIG_X86_GENERIC is not exclusively CONFIG_SMP, as mach-default/ could
be compiled also for UP archs. The patch fixes compilation error in
include/asm/mach-summit/mach_apic.h in case CONFIG_X86_GENERIC && !CONFIG_SMP
Linus Torvalds [Fri, 6 Oct 2006 16:13:53 +0000 (09:13 -0700)]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[S390] Use CONFIG_GENERIC_TIME and define TOD clock source.
[PATCH] sysrq: irq change build fix.
[S390] irq change build fixes.
[S390] cio: 0 is a valid chpid.
[S390] monwriter buffer limit.
[S390] ap bus poll thread priority.
Cc: David Howells <dhowells@redhat.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Paolo "Blaisorblade" Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
NeilBrown [Fri, 6 Oct 2006 07:44:05 +0000 (00:44 -0700)]
[PATCH] knfsd: tidy up up meaning of 'buffer size' in nfsd/sunrpc
There is some confusion about the meaning of 'bufsz' for a sunrpc server.
In some cases it is the largest message that can be sent or received. In
other cases it is the largest 'payload' that can be included in a NFS
message.
In either case, it is not possible for both the request and the reply to be
this large. One of the request or reply may only be one page long, which
fits nicely with NFS.
So we remove 'bufsz' and replace it with two numbers: 'max_payload' and
'max_mesg'. Max_payload is the size that the server requests. It is used
by the server to check the max size allowed on a particular connection:
depending on the protocol a lower limit might be used.
max_mesg is the largest single message that can be sent or received. It is
calculated as the max_payload, rounded up to a multiple of PAGE_SIZE, and
with PAGE_SIZE added to overhead. Only one of the request and reply may be
this size. The other must be at most one page.
Cc: Greg Banks <gnb@sgi.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
NeilBrown [Fri, 6 Oct 2006 07:44:04 +0000 (00:44 -0700)]
[PATCH] md: fix bug where new drives added to an md array sometimes don't sync properly
This fixes a bug introduced in 2.6.18.
If a drive is added to a raid1 using older tools (mdadm-1.x or raidtools)
then it will be included in the array without any resync happening.
It has been submitted for 2.6.18.1.
Signed-off-by: Neil Brown <neilb@suse.de> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Pierre Ossman [Fri, 6 Oct 2006 07:44:03 +0000 (00:44 -0700)]
[PATCH] mmc: multi sector write transfers
SD cards extend the protocol by allowing the host to query a card how many
blocks were successfully stored on the medium. This allows us to safely write
chunks of blocks at once.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jim Cromie [Fri, 6 Oct 2006 07:43:59 +0000 (00:43 -0700)]
[PATCH] MAINTAINERS: take over scx200-* and pc8736* drivers
Add MAINTAINERS entries for new scx200_hrt and pc8736x_gpio drivers, and
take over maintenance of scx200_gpio, authored by Christer Weinigel (which
I've hacked at), who no longer has the hardware.
Also take over hwmon/pc87360, authored by Jean Delvare, who's dropped
maintenance to dedicate more time to hwmon subsystem.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Christer Weinigel <christer@weinigel.se> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Add a way for a no_page() handler to request a retry of the faulting
instruction. It goes back to userland on page faults and just tries again
in get_user_pages(). I added a cond_resched() in the loop in that later
case.
The problem I have with signal and spufs is an actual bug affecting apps and I
don't see other ways of fixing it.
In addition, we are having issues with infiniband and 64k pages (related to
the way the hypervisor deals with some HV cards) that will require us to muck
around with the MMU from within the IB driver's no_page() (it's a pSeries
specific driver) and return to the caller the same way using NOPAGE_REFAULT.
And to add to this, the graphics folks have been following a new approach of
memory management that involves transparently swapping objects between video
ram and main meory. To do that, they need installing PTEs from a no_page()
handler as well and that also requires returning with NOPAGE_REFAULT.
(For the later, they are currently using io_remap_pfn_range to install one PTE
from no_page() which is a bit racy, we need to add a check for the PTE having
already been installed afer taking the lock, but that's ok, they are only at
the proof-of-concept stage. I'll send a patch adding a "clean" function to do
that, we can use that from spufs too and get rid of the sparsemem hacks we do
to create struct page for SPEs. Basically, that provides a generic solution
for being able to have no_page() map hardware devices, which is something that
I think sound driver folks have been asking for some time too).
All of these things depend on having the NOPAGE_REFAULT exit path from
no_page() handlers.
Signed-off-by: Benjamin Herrenchmidt <benh@kernel.crashing.org> Cc: Hugh Dickins <hugh@veritas.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Fri, 6 Oct 2006 07:43:49 +0000 (00:43 -0700)]
[PATCH] Fix WARN_ON / WARN_ON_ONCE regression
Tim and Ananiev report that the recent WARN_ON_ONCE changes cause increased
cache misses with the tbench workload. Apparently due to the access to the
newly-added static variable.
Rearrange the code so that we don't touch that variable unless the warning is
going to trigger.
Also rework the logic so that the static variable starts out at zero, so we
can move it into bss.
It would seem logical to mark the static variable as __read_mostly too. But
it would be wrong, because that would put it back into the vmlinux image, and
the kernel will never read from this variable in normal operation anyway.
Unless the compiler or hardware go and do some prefetching on us?
For some reason this patch shrinks softirq.o text by 40 bytes.
Cc: Tim Chen <tim.c.chen@intel.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: "Ananiev, Leonid I" <leonid.i.ananiev@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[S390] Use CONFIG_GENERIC_TIME and define TOD clock source.
Fix too slow clock by using CONFIG_GENERIC_TIME and adding a
clock source for the s390 time-of-day clock. As added benefit
we get rid of the s390 specific definition of do_gettimeofday
and do_settimeofday.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Geoff Levand [Thu, 5 Oct 2006 18:35:16 +0000 (11:35 -0700)]
[POWERPC] Minor fix for bootargs property
Avoid the use of an uninitialized stack variable when the powerpc device tree
bootargs property is either missing or incorrectly defined. This also makes
CONFIG_CMDLINE work properly under these conditions. This change adds a test
for the existence of the bootargs property.
early_init_dt_scan_chosen() tests for a zero length bootargs property in its
CONFIG_CMDLINE processing, but the current implementation of
of_get_flat_dt_prop() doesn't assign a value to the length when no property is
found. Since an automatic variable is used, a stale value from the stack will
be used in the test.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Anton Blanchard [Thu, 5 Oct 2006 16:54:07 +0000 (02:54 +1000)]
[POWERPC] Update MTFSF_L() comment
David Woodhouse points out that the comment accompanying the MTFSF_L
macro is misleading. We should make it clear that the L bit is ignored
on older CPUS, not the entire instruction.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
[POWERPC] Don't get PCI IRQ from OF for devices with no IRQ
This patch adds checking of the PCI_INTERRUPT_PIN register before
using standard OF parsing to retreive PCI interrupts. The reason is
that some PCI devices may have no PCI interrupt, though they may have
interrupts attached via other means. In this case, we shall not use
irq->pdev, but device-specific code can later retreive those interrupts
instead.
Without that patch, Maple and derivatives don't get the right interrupt
for the second IDE channel as the linux IDE code fallsback to the PCI
irq instead of trying to use the legacy ones for the on-board controller
(which has no PCI_INTERRUPT_PIN). Having no PCI IRQ assign to it (as it
doesn't request any) fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
The zImage wrapper has a "hack" that force the decompression to happen
above 20Mb for 64 bits kernels, to work around issues with some
firmwares on the field. However, the new wrapper has a bug which makes
that hack not work properly. This fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Nathan Lynch [Thu, 5 Oct 2006 03:28:00 +0000 (22:28 -0500)]
[POWERPC] linux,tce-size property is 32 bits
The "linux,tce-size" property is only 32 bits (see
prom_initialize_tce_table() in arch/powerpc/kernel/prom_init.c).
Treating it as an unsigned long in iommu_table_setparms() leads to
access beyond the end of the property's buffer, so we pass garbage to
the memset() in that function.
Linus Torvalds [Thu, 5 Oct 2006 23:32:01 +0000 (16:32 -0700)]
Merge git://git.infradead.org/~dhowells/irq-2.6
* git://git.infradead.org/~dhowells/irq-2.6:
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
IRQ: Typedef the IRQ handler function type
IRQ: Typedef the IRQ flow handler function type
Trying to build both drivers results in the following error:
LD drivers/scsi/built-in.o
drivers/scsi/qla4xxx/built-in.o: In function `qla4xxx_slave_configure':
drivers/scsi/qla4xxx/ql4_os.c:1433: multiple definition of `extended_error_logging'
drivers/scsi/qla2xxx/built-in.o:drivers/scsi/qla2xxx/qla_os.c:2166:
first defined here
make[2]: *** [drivers/scsi/built-in.o] Error 1
make[1]: *** [drivers/scsi] Error 2
make: *** [drivers] Error 2
The following patch simply adds a qla2_ (qla4_ respectively) prefix to
the variable name.
Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andi Kleen [Thu, 5 Oct 2006 16:47:22 +0000 (18:47 +0200)]
[PATCH] x86-64: Fix FPU corruption
This reverts an earlier patch that was found to cause FPU
state corruption. I think the corruption happens because
unlazy_fpu() can cause FPU exceptions and when it happens
after the current switch some processing would affect
the state in the wrong process.
Thanks to Douglas Crosher and Tom Hughes for testing.
Andi Kleen [Thu, 5 Oct 2006 16:47:22 +0000 (18:47 +0200)]
[PATCH] x86: Terminate the kernel stacks for the unwinder
Always make sure RIP/EIP is 0 in the registers stored on the top
of the stack of a kernel thread. This makes sure the unwinder code
won't try a fallback but knows the stack has ended.
AK: this patch is a bit mysterious. in theory they should be terminated
anyways, but it seems to fix at least one crash. Anyways double termination
probably doesn't hurt.
Jon Mason [Thu, 5 Oct 2006 16:47:21 +0000 (18:47 +0200)]
[PATCH] x86-64: Calgary IOMMU: Fix off by one when calculating register space location
The purpose of the code being modified is to determine the location
of the calgary chip address space. This is done by a magical formula
of FE0MB-8MB*OneBasedChassisNumber+1MB*(RioNodeId-ChassisBase) to
find the offset where BIOS puts it. In this formula,
OneBasedChassisNumber corresponds to the NUMA node, and rionodeid is
always 2 or 3 depending on which chip in the system it is. The
problem was that we had an off by one error that caused us to account
some busses to the wrong chip and thus give them the wrong address
space.
calgary_init's for loop does not correspond to the actual device being
checked, which makes its upperbound check for array overflow useless.
Changing this to a do-while loop is the correct way of doing this.
There should be no possibility of spinning forever in this loop, as
pci_get_device states that it will go through all iterations, then
return NULL (thus breaking the loop).
David Howells [Thu, 5 Oct 2006 13:55:46 +0000 (14:55 +0100)]
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.
The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).
Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.
Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.
I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.
This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().
Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.
(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.
(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.