From 49f19ce401edfff937c448dd74c22497da361889 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Thu, 5 Oct 2006 20:31:10 -0500 Subject: [PATCH 001/232] [PATCH] powerpc: irq change build breaks Fix up some of the buildbreaks from the irq handler changes. Signed-off-by: Olof Johansson Signed-off-by: Linus Torvalds --- arch/powerpc/platforms/85xx/mpc85xx_ads.c | 2 +- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 2 +- arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 2 +- arch/powerpc/platforms/cell/interrupt.c | 2 +- arch/powerpc/platforms/chrp/setup.c | 2 +- arch/powerpc/platforms/powermac/pic.c | 2 +- arch/powerpc/sysdev/qe_lib/qe_ic.c | 4 ++-- arch/powerpc/sysdev/tsi108_pci.c | 2 +- drivers/macintosh/via-cuda.c | 2 +- sound/oss/dmasound/dmasound_awacs.c | 4 ++-- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 28070e7ae507..8af7126fc6b9 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c @@ -72,7 +72,7 @@ static void cpm2_cascade(unsigned int irq, struct irq_desc *desc, int cascade_irq; while ((cascade_irq = cpm2_get_irq(regs)) >= 0) { - generic_handle_irq(cascade_irq, regs); + generic_handle_irq(cascade_irq); } desc->chip->eoi(irq); } diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index 193a5d7921b5..b92fc6976a47 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c @@ -138,7 +138,7 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct unsigned int cascade_irq = i8259_irq(regs); if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); + generic_handle_irq(cascade_irq); desc->chip->eoi(irq); } diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index b637e8157f7b..8218703babde 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c @@ -58,7 +58,7 @@ static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc, { unsigned int cascade_irq = i8259_irq(regs); if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); + generic_handle_irq(cascade_irq); desc->chip->eoi(irq); } #endif /* CONFIG_PCI */ diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index 434fb934dd20..f8768b096f02 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c @@ -121,7 +121,7 @@ static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc, irq_linear_revmap(iic_host, base | cascade); if (cirq != NO_IRQ) - generic_handle_irq(cirq, regs); + generic_handle_irq(cirq); } /* post-ack level interrupts */ ack = bits & ~IIC_ISR_EDGE_MASK; diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 488dbd9b51ae..35cd7a5f6834 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c @@ -340,7 +340,7 @@ static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc, { unsigned int cascade_irq = i8259_irq(regs); if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); + generic_handle_irq(cascade_irq); desc->chip->eoi(irq); } diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index e93a115961aa..5da677835c00 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c @@ -227,7 +227,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs) continue; irq += __ilog2(bits); spin_unlock_irqrestore(&pmac_pic_lock, flags); - __do_IRQ(irq, regs); + __do_IRQ(irq); spin_lock_irqsave(&pmac_pic_lock, flags); rc = IRQ_HANDLED; } diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index c229d07d4957..0dec010bcbb5 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c @@ -343,7 +343,7 @@ void fastcall qe_ic_cascade_low(unsigned int irq, struct irq_desc *desc, chip->mask_ack(irq); if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); + generic_handle_irq(cascade_irq); chip->unmask(irq); } @@ -359,7 +359,7 @@ void fastcall qe_ic_cascade_high(unsigned int irq, struct irq_desc *desc, chip->mask_ack(irq); if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); + generic_handle_irq(cascade_irq); chip->unmask(irq); } diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index c28f69bef8e2..14f4a1ab6d18 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c @@ -410,6 +410,6 @@ void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc, { unsigned int cascade_irq = get_pci_source(); if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq, regs); + generic_handle_irq(cascade_irq); desc->chip->eoi(irq); } diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index 64a07ccfe369..df66291b1322 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c @@ -437,7 +437,7 @@ cuda_poll(void) * disable_irq(), would that work on m68k ? --BenH */ local_irq_save(flags); - cuda_interrupt(0, NULL, NULL); + cuda_interrupt(0, NULL); local_irq_restore(flags); } diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index 3bd19c36fcd9..37773b1deea5 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -465,7 +465,7 @@ tas_dmasound_init(void) val = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio_headphone_detect, 0); pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio_headphone_detect, val | 0x80); /* Trigger it */ - headphone_intr(0,NULL,NULL); + headphone_intr(0, NULL); } } if (!gpio_headphone_irq) { @@ -1499,7 +1499,7 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when) write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol); msleep(150); tas_leave_sleep(); /* Stub for now */ - headphone_intr(0,NULL,NULL); + headphone_intr(0, NULL); break; case AWACS_DACA: msleep(10); /* Check this !!! */ From 3211be5c6a61946c75318069611699c90b10e0f8 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 6 Oct 2006 21:09:40 +1000 Subject: [PATCH 002/232] [PPC] Fix some irq breakage with ARCH=ppc Signed-off-by: Paul Mackerras --- arch/ppc/kernel/time.c | 2 +- include/asm-ppc/floppy.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 187388625a76..d4b2cf74da6a 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -142,7 +142,7 @@ void timer_interrupt(struct pt_regs * regs) while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) { jiffy_stamp += tb_ticks_per_jiffy; - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); update_process_times(user_mode(regs)); if (smp_processor_id()) diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h index d3963ca79ad8..ae316e6d2ca9 100644 --- a/include/asm-ppc/floppy.h +++ b/include/asm-ppc/floppy.h @@ -38,14 +38,14 @@ static int virtual_dma_mode; static int doing_vdma; static struct fd_dma_ops *fd_ops; -static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t floppy_hardint(int irq, void *dev_id) { unsigned char st; int lcount; char *lptr; if (!doing_vdma) - return floppy_interrupt(irq, dev_id, regs); + return floppy_interrupt(irq, dev_id); st = 1; @@ -69,7 +69,7 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) virtual_dma_residue += virtual_dma_count; virtual_dma_count=0; doing_vdma = 0; - floppy_interrupt(irq, dev_id, regs); + floppy_interrupt(irq, dev_id); return IRQ_HANDLED; } return IRQ_HANDLED; From 13a2eea1461f5d54cc5d58334fbde4bf4cc9cb23 Mon Sep 17 00:00:00 2001 From: Nick Piggin Date: Wed, 4 Oct 2006 17:25:44 +0200 Subject: [PATCH 003/232] [POWERPC] Fix harmless typo Fix a typo. Noticed by the unlikely profiler. Signed-off-by: Nick Piggin Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index ba0694071728..f88a2a675d90 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -75,7 +75,7 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, /* This allocator was derived from x86_64's bit string search */ /* Sanity check */ - if (unlikely(npages) == 0) { + if (unlikely(npages == 0)) { if (printk_ratelimit()) WARN_ON(1); return DMA_ERROR_CODE; From 74c37e8c9f626ed000388bebdc781a8e35ee4ab7 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Wed, 4 Oct 2006 11:03:44 -0500 Subject: [PATCH 004/232] [POWERPC] Add DTS for MPC8349E-mITX board Add the DTS for the Freescale MPC 8349E-mITX reference board. Contact Vitesse for the driver for the VSC 7385. Signed-off-by: Timur Tabi Signed-off-by: Paul Mackerras --- arch/powerpc/boot/dts/mpc8349emitx.dts | 246 +++++++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 arch/powerpc/boot/dts/mpc8349emitx.dts diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts new file mode 100644 index 000000000000..27807fc45888 --- /dev/null +++ b/arch/powerpc/boot/dts/mpc8349emitx.dts @@ -0,0 +1,246 @@ +/* + * MPC8349E-mITX Device Tree Source + * + * Copyright 2006 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +/ { + model = "MPC8349EMITX"; + compatible = "MPC834xMITX"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #cpus = <1>; + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,8349@0 { + device_type = "cpu"; + reg = <0>; + d-cache-line-size = <20>; + i-cache-line-size = <20>; + d-cache-size = <8000>; + i-cache-size = <8000>; + timebase-frequency = <0>; // from bootloader + bus-frequency = <0>; // from bootloader + clock-frequency = <0>; // from bootloader + 32-bit; + }; + }; + + memory { + device_type = "memory"; + reg = <00000000 10000000>; + }; + + soc8349@e0000000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + device_type = "soc"; + ranges = <0 e0000000 00100000>; + reg = ; + bus-frequency = <0>; // from bootloader + + wdt@200 { + device_type = "watchdog"; + compatible = "mpc83xx_wdt"; + reg = <200 100>; + }; + + i2c@3000 { + device_type = "i2c"; + compatible = "fsl-i2c"; + reg = <3000 100>; + interrupts = ; + interrupt-parent = <700>; + dfsrr; + }; + + i2c@3100 { + device_type = "i2c"; + compatible = "fsl-i2c"; + reg = <3100 100>; + interrupts = ; + interrupt-parent = <700>; + dfsrr; + }; + + spi@7000 { + device_type = "spi"; + compatible = "mpc83xx_spi"; + reg = <7000 1000>; + interrupts = <10 8>; + interrupt-parent = <700>; + mode = <0>; + }; + + usb@22000 { + device_type = "usb"; + compatible = "fsl-usb2-mph"; + reg = <22000 1000>; + #address-cells = <1>; + #size-cells = <0>; + interrupt-parent = <700>; + interrupts = <27 2>; + phy_type = "ulpi"; + port1; + }; + + usb@23000 { + device_type = "usb"; + compatible = "fsl-usb2-dr"; + reg = <23000 1000>; + #address-cells = <1>; + #size-cells = <0>; + interrupt-parent = <700>; + interrupts = <26 2>; + phy_type = "ulpi"; + }; + + mdio@24520 { + device_type = "mdio"; + compatible = "gianfar"; + reg = <24520 20>; + #address-cells = <1>; + #size-cells = <0>; + linux,phandle = <24520>; + + /* Vitesse 8201 */ + ethernet-phy@1c { + linux,phandle = <245201c>; + interrupt-parent = <700>; + interrupts = <12 2>; + reg = <1c>; + device_type = "ethernet-phy"; + }; + + /* Vitesse 7385 */ + ethernet-phy@1f { + linux,phandle = <245201f>; + interrupt-parent = <700>; + interrupts = <12 2>; + reg = <1f>; + device_type = "ethernet-phy"; + }; + }; + + ethernet@24000 { + device_type = "network"; + model = "TSEC"; + compatible = "gianfar"; + reg = <24000 1000>; + address = [ 00 00 00 00 00 00 ]; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <20 8 21 8 22 8>; + interrupt-parent = <700>; + phy-handle = <245201c>; + }; + + ethernet@25000 { + #address-cells = <1>; + #size-cells = <0>; + device_type = "network"; + model = "TSEC"; + compatible = "gianfar"; + reg = <25000 1000>; + address = [ 00 00 00 00 00 00 ]; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <23 8 24 8 25 8>; + interrupt-parent = <700>; + phy-handle = <245201f>; + }; + + serial@4500 { + device_type = "serial"; + compatible = "ns16550"; + reg = <4500 100>; + clock-frequency = <0>; // from bootloader + interrupts = <9 8>; + interrupt-parent = <700>; + }; + + serial@4600 { + device_type = "serial"; + compatible = "ns16550"; + reg = <4600 100>; + clock-frequency = <0>; // from bootloader + interrupts = ; + interrupt-parent = <700>; + }; + + pci@8500 { + interrupt-map-mask = ; + interrupt-map = < + /* IDSEL 0x10 - SATA */ + 8000 0 0 1 700 16 8 /* SATA_INTA */ + >; + interrupt-parent = <700>; + interrupts = <42 8>; + bus-range = <0 0>; + ranges = <42000000 0 80000000 80000000 0 10000000 + 02000000 0 90000000 90000000 0 10000000 + 01000000 0 00000000 e2000000 0 01000000>; + clock-frequency = <3f940aa>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <8500 100>; + compatible = "83xx"; + device_type = "pci"; + }; + + pci@8600 { + interrupt-map-mask = ; + interrupt-map = < + /* IDSEL 0x0E - MiniPCI Slot */ + 7000 0 0 1 700 15 8 /* PCI_INTA */ + + /* IDSEL 0x0F - PCI Slot */ + 7800 0 0 1 700 14 8 /* PCI_INTA */ + 7800 0 0 2 700 15 8 /* PCI_INTB */ + >; + interrupt-parent = <700>; + interrupts = <43 8>; + bus-range = <1 1>; + ranges = <42000000 0 a0000000 a0000000 0 10000000 + 02000000 0 b0000000 b0000000 0 10000000 + 01000000 0 00000000 e3000000 0 01000000>; + clock-frequency = <3f940aa>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <8600 100>; + compatible = "83xx"; + device_type = "pci"; + }; + + crypto@30000 { + device_type = "crypto"; + model = "SEC2"; + compatible = "talitos"; + reg = <30000 10000>; + interrupts = ; + interrupt-parent = <700>; + num-channels = <4>; + channel-fifo-len = <18>; + exec-units-mask = <0000007e>; + descriptor-types-mask = <01010ebf>; + }; + + pic@700 { + linux,phandle = <700>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + reg = <700 100>; + built-in; + device_type = "ipic"; + }; + }; +}; From 9938c474f39e416091db9993954996266a3f2edf Mon Sep 17 00:00:00 2001 From: Nathan Lynch Date: Wed, 4 Oct 2006 22:28:00 -0500 Subject: [PATCH 005/232] [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. [boot]0020 XICS Init i8259 legacy interrupt controller initialized [boot]0021 XICS Done PID hash table entries: 4096 (order: 12, 32768 bytes) cpu 0x0: Vector: 300 (Data Access) at [c0000000fe783850] pc: c000000000035e90: .memset+0x60/0xfc lr: c000000000044fa4: .iommu_table_setparms+0xb0/0x158 sp: c0000000fe783ad0 msr: 9000000000009032 dar: c000000100000000 dsisr: 42010000 current = 0xc00000000450e810 paca = 0xc000000000411580 pid = 1, comm = swapper enter ? for help [link register ] c000000000044fa4 .iommu_table_setparms+0xb0/0x158 [c0000000fe783ad0] c000000000044f4c .iommu_table_setparms+0x58/0x158 (unreliable) [c0000000fe783b70] c00000000004529c .iommu_bus_setup_pSeries+0x1c4/0x254 [c0000000fe783c00] c00000000002b8ac .do_bus_setup+0x3c/0xe4 [c0000000fe783c80] c00000000002c924 .pcibios_fixup_bus+0x64/0xd8 [c0000000fe783d00] c0000000001a2d5c .pci_scan_child_bus+0x6c/0x10c [c0000000fe783da0] c00000000002be28 .scan_phb+0x17c/0x1b4 [c0000000fe783e40] c0000000003cfa00 .pcibios_init+0x58/0x19c [c0000000fe783ec0] c0000000000094b4 .init+0x1e8/0x3d8 [c0000000fe783f90] c000000000026e54 .kernel_thread+0x4c/0x68 Signed-off-by: Nathan Lynch Acked-by: Olof Johansson Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index bbf2e34dc358..d24ba547e53f 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -267,7 +267,8 @@ static void iommu_table_setparms(struct pci_controller *phb, struct iommu_table *tbl) { struct device_node *node; - const unsigned long *basep, *sizep; + const unsigned long *basep; + const u32 *sizep; node = (struct device_node *)phb->arch_data; From c998de146061db17787c1a31a3db1989f1341fdf Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Thu, 5 Oct 2006 14:18:46 +1000 Subject: [PATCH 006/232] [POWERPC] Fix zImage decompress location 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 Signed-off-by: Paul Mackerras --- arch/powerpc/boot/of.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/powerpc/boot/of.c b/arch/powerpc/boot/of.c index fd99f789a37b..3a71845afc6c 100644 --- a/arch/powerpc/boot/of.c +++ b/arch/powerpc/boot/of.c @@ -176,12 +176,9 @@ static void *claim(unsigned long virt, unsigned long size, unsigned long align) static void *of_try_claim(u32 size) { unsigned long addr = 0; - static u8 first_time = 1; - if (first_time) { + if (claim_base == 0) claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB); - first_time = 0; - } for(; claim_base < RAM_END; claim_base += ONE_MB) { #ifdef DEBUG From 41550c5128150175197257b6ceab2cd50dea7b51 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Thu, 5 Oct 2006 16:40:41 +1000 Subject: [PATCH 007/232] [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 Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/prom_parse.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 603dff3ad62a..17fcb4842fe5 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c @@ -914,6 +914,17 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) u8 pin; int rc; + /* We need to first check if the PCI device has a PCI interrupt at all + * since we have cases where the device-node might expose non-PCI + * interrupts, but the device has no PCI interrupt to it + */ + rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); + if (rc != 0) + return rc; + /* No pin, exit */ + if (pin == 0) + return -ENODEV; + /* Check if we have a device node, if yes, fallback to standard OF * parsing */ @@ -925,12 +936,6 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) * interrupt spec. we assume #interrupt-cells is 1, which is standard * for PCI. If you do different, then don't use that routine. */ - rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); - if (rc != 0) - return rc; - /* No pin, exit */ - if (pin == 0) - return -ENODEV; /* Now we walk up the PCI tree */ lspec = pin; From 3afbf5d6ef791be61d18329ae5302bbf1cd83723 Mon Sep 17 00:00:00 2001 From: Brian King Date: Thu, 5 Oct 2006 10:52:04 -0500 Subject: [PATCH 008/232] [POWERPC] Update pSeries defconfig for SATA Since the ipr driver now supports SATA and depends on libata, enable libata to get built. Signed-off-by: Brian King Signed-off-by: Paul Mackerras --- arch/powerpc/configs/pseries_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index 44175fb7adec..9828663652e9 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig @@ -506,7 +506,7 @@ CONFIG_SCSI_SAS_ATTRS=m # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set -# CONFIG_ATA is not set +CONFIG_ATA=y # CONFIG_SCSI_HPTIOP is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set From 52aed7cd52ce8a1d576e26976c3950512e1af8b6 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Fri, 6 Oct 2006 02:54:07 +1000 Subject: [PATCH 009/232] [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 Signed-off-by: Paul Mackerras --- include/asm-powerpc/reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index 3a9fcc15811b..8fb96811b55d 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h @@ -503,7 +503,7 @@ /* * An mtfsf instruction with the L bit set. On CPUs that support this a - * full 64bits of FPSCR is restored and on other CPUs it is ignored. + * full 64bits of FPSCR is restored and on other CPUs the L bit is ignored. * * Until binutils gets the new form of mtfsf, hardwire the instruction. */ From c1ce464d29e5bbf5819b2d7527b7d3030a6d65f1 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Thu, 5 Oct 2006 11:35:16 -0700 Subject: [PATCH 010/232] [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 Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/prom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index eb913f80bfb1..865b9648d0d5 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -724,7 +724,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node, strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE)); #ifdef CONFIG_CMDLINE - if (l == 0 || (l == 1 && (*p) == 0)) + if (p == NULL || l == 0 || (l == 1 && (*p) == 0)) strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); #endif /* CONFIG_CMDLINE */ From d83682b3971d6707d6d668b3b62d416ab7dd1ab3 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Fri, 6 Oct 2006 16:38:22 +0200 Subject: [PATCH 011/232] [S390] ap bus poll thread priority. The ap bus is supposed to have a low priority. We must use 19 instead of -20, which is just the opposite. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- drivers/s390/crypto/ap_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index cd30f37fceae..c5ccd20b110c 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -1062,7 +1062,7 @@ static int ap_poll_thread(void *data) unsigned long flags; int requests; - set_user_nice(current, -20); + set_user_nice(current, 19); while (1) { if (need_resched()) { schedule(); From 2d103d5a80846e96e1cb1ba5e635e8c37d30ada8 Mon Sep 17 00:00:00 2001 From: Melissa Howland Date: Fri, 6 Oct 2006 16:38:26 +0200 Subject: [PATCH 012/232] [S390] monwriter buffer limit. Make max_bufs a global (per linux guest) limit. Signed-off-by: Melissa Howland Signed-off-by: Martin Schwidefsky --- drivers/s390/char/monwriter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c index 1e3939aeb8ab..4362ff260244 100644 --- a/drivers/s390/char/monwriter.c +++ b/drivers/s390/char/monwriter.c @@ -26,6 +26,7 @@ #define MONWRITE_MAX_DATALEN 4024 static int mon_max_bufs = 255; +static int mon_buf_count; struct mon_buf { struct list_head list; @@ -40,7 +41,6 @@ struct mon_private { size_t hdr_to_read; size_t data_to_read; struct mon_buf *current_buf; - int mon_buf_count; }; /* @@ -99,13 +99,13 @@ static int monwrite_new_hdr(struct mon_private *monpriv) rc = monwrite_diag(monhdr, monbuf->data, APPLDATA_STOP_REC); list_del(&monbuf->list); - monpriv->mon_buf_count--; + mon_buf_count--; kfree(monbuf->data); kfree(monbuf); monbuf = NULL; } } else { - if (monpriv->mon_buf_count >= mon_max_bufs) + if (mon_buf_count >= mon_max_bufs) return -ENOSPC; monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL); if (!monbuf) @@ -118,7 +118,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv) } monbuf->hdr = *monhdr; list_add_tail(&monbuf->list, &monpriv->list); - monpriv->mon_buf_count++; + mon_buf_count++; } monpriv->current_buf = monbuf; return 0; @@ -186,7 +186,7 @@ static int monwrite_close(struct inode *inode, struct file *filp) if (entry->hdr.mon_function != MONWRITE_GEN_EVENT) monwrite_diag(&entry->hdr, entry->data, APPLDATA_STOP_REC); - monpriv->mon_buf_count--; + mon_buf_count--; list_del(&entry->list); kfree(entry->data); kfree(entry); From 7e8ae7bfe8354b1f1b98c5cd29db8965ca1e6391 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Fri, 6 Oct 2006 16:38:29 +0200 Subject: [PATCH 013/232] [S390] cio: 0 is a valid chpid. In order to determine chpid validity, we need to check whether the corresponding path is specified in the pim. Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/chsc.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 3bb4e472d73d..07c7f19339d2 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -200,11 +200,13 @@ css_get_ssd_info(struct subchannel *sch) spin_unlock_irq(&sch->lock); free_page((unsigned long)page); if (!ret) { - int j, chpid; + int j, chpid, mask; /* Allocate channel path structures, if needed. */ for (j = 0; j < 8; j++) { + mask = 0x80 >> j; chpid = sch->ssd_info.chpid[j]; - if (chpid && (get_chp_status(chpid) < 0)) + if ((sch->schib.pmcw.pim & mask) && + (get_chp_status(chpid) < 0)) new_channel_path(chpid); } } @@ -222,13 +224,15 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) sch = to_subchannel(dev); chpid = data; - for (j = 0; j < 8; j++) - if (sch->schib.pmcw.chpid[j] == chpid->id) + for (j = 0; j < 8; j++) { + mask = 0x80 >> j; + if ((sch->schib.pmcw.pim & mask) && + (sch->schib.pmcw.chpid[j] == chpid->id)) break; + } if (j >= 8) return 0; - mask = 0x80 >> j; spin_lock_irq(&sch->lock); stsch(sch->schid, &schib); @@ -620,7 +624,7 @@ __chp_add_new_sch(struct subchannel_id schid) static int __chp_add(struct subchannel_id schid, void *data) { - int i; + int i, mask; struct channel_path *chp; struct subchannel *sch; @@ -630,8 +634,10 @@ __chp_add(struct subchannel_id schid, void *data) /* Check if the subchannel is now available. */ return __chp_add_new_sch(schid); spin_lock_irq(&sch->lock); - for (i=0; i<8; i++) - if (sch->schib.pmcw.chpid[i] == chp->id) { + for (i=0; i<8; i++) { + mask = 0x80 >> i; + if ((sch->schib.pmcw.pim & mask) && + (sch->schib.pmcw.chpid[i] == chp->id)) { if (stsch(sch->schid, &sch->schib) != 0) { /* Endgame. */ spin_unlock_irq(&sch->lock); @@ -639,6 +645,7 @@ __chp_add(struct subchannel_id schid, void *data) } break; } + } if (i==8) { spin_unlock_irq(&sch->lock); return 0; @@ -646,7 +653,7 @@ __chp_add(struct subchannel_id schid, void *data) sch->lpm = ((sch->schib.pmcw.pim & sch->schib.pmcw.pam & sch->schib.pmcw.pom) - | 0x80 >> i) & sch->opm; + | mask) & sch->opm; if (sch->driver && sch->driver->verify) sch->driver->verify(&sch->dev); From 5a489b9846f688db7e69aa7ccb23c53459a9c20e Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 6 Oct 2006 16:38:35 +0200 Subject: [PATCH 014/232] [S390] irq change build fixes. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/s390_ext.c | 9 ++++++--- arch/s390/kernel/smp.c | 2 +- arch/s390/kernel/time.c | 15 +++++++++------ arch/s390/kernel/traps.c | 2 +- arch/s390/kernel/vtime.c | 5 +++-- arch/s390/mm/fault.c | 2 +- drivers/s390/block/dasd_diag.c | 2 +- drivers/s390/char/ctrlchar.c | 2 +- drivers/s390/char/keyboard.c | 2 +- drivers/s390/char/sclp.c | 4 ++-- drivers/s390/cio/cio.c | 6 +++++- drivers/s390/net/iucv.c | 4 ++-- include/asm-s390/hardirq.h | 2 +- include/asm-s390/irq_regs.h | 1 + include/asm-s390/s390_ext.h | 2 +- 15 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 include/asm-s390/irq_regs.h diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c index c1b383537fec..c49ab8c784d2 100644 --- a/arch/s390/kernel/s390_ext.c +++ b/arch/s390/kernel/s390_ext.c @@ -16,6 +16,7 @@ #include #include +#include #include /* @@ -114,26 +115,28 @@ void do_extint(struct pt_regs *regs, unsigned short code) { ext_int_info_t *p; int index; + struct pt_regs *old_regs; irq_enter(); + old_regs = set_irq_regs(regs); asm volatile ("mc 0,0"); if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer) /** * Make sure that the i/o interrupt did not "overtake" * the last HZ timer interrupt. */ - account_ticks(regs); + account_ticks(); kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; index = ext_hash(code); for (p = ext_int_hash[index]; p; p = p->next) { if (likely(p->code == code)) { if (likely(p->handler)) - p->handler(regs, code); + p->handler(code); } } + set_irq_regs(old_regs); irq_exit(); } EXPORT_SYMBOL(register_external_interrupt); EXPORT_SYMBOL(unregister_external_interrupt); - diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index a8e6199755d4..62822245f9be 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -339,7 +339,7 @@ void machine_power_off_smp(void) * cpus are handled. */ -void do_ext_call_interrupt(struct pt_regs *regs, __u16 code) +void do_ext_call_interrupt(__u16 code) { unsigned long bits; diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 4bf66cc4a267..2c8c690688cb 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -34,6 +34,7 @@ #include #include #include +#include #include /* change this if you have some constant time drift */ @@ -150,9 +151,9 @@ EXPORT_SYMBOL(do_settimeofday); #ifdef CONFIG_PROFILING -#define s390_do_profile(regs) profile_tick(CPU_PROFILING, regs) +#define s390_do_profile() profile_tick(CPU_PROFILING) #else -#define s390_do_profile(regs) do { ; } while(0) +#define s390_do_profile() do { ; } while(0) #endif /* CONFIG_PROFILING */ @@ -160,7 +161,7 @@ EXPORT_SYMBOL(do_settimeofday); * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -void account_ticks(struct pt_regs *regs) +void account_ticks(void) { __u64 tmp; __u32 ticks; @@ -221,10 +222,10 @@ void account_ticks(struct pt_regs *regs) account_tick_vtime(current); #else while (ticks--) - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif - s390_do_profile(regs); + s390_do_profile(); } #ifdef CONFIG_NO_IDLE_HZ @@ -285,9 +286,11 @@ static inline void stop_hz_timer(void) */ static inline void start_hz_timer(void) { + BUG_ON(!in_interrupt()); + if (!cpu_isset(smp_processor_id(), nohz_cpu_mask)) return; - account_ticks(task_pt_regs(current)); + account_ticks(); cpu_clear(smp_processor_id(), nohz_cpu_mask); } diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 3eb4fab048b8..05bf3cc8530a 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -61,7 +61,7 @@ extern pgm_check_handler_t do_dat_exception; #ifdef CONFIG_PFAULT extern int pfault_init(void); extern void pfault_fini(void); -extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code); +extern void pfault_interrupt(__u16 error_code); static ext_int_info_t ext_int_pfault; #endif extern pgm_check_handler_t do_monitor_call; diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 2306cd83fca1..1d7d3938b2b1 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -22,6 +22,7 @@ #include #include +#include static ext_int_info_t ext_int_info_timer; DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); @@ -241,7 +242,7 @@ static void do_callbacks(struct list_head *cb_list, struct pt_regs *regs) /* * Handler for the virtual CPU timer. */ -static void do_cpu_timer_interrupt(struct pt_regs *regs, __u16 error_code) +static void do_cpu_timer_interrupt(__u16 error_code) { int cpu; __u64 next, delta; @@ -274,7 +275,7 @@ static void do_cpu_timer_interrupt(struct pt_regs *regs, __u16 error_code) list_move_tail(&event->entry, &cb_list); } spin_unlock(&vt_list->lock); - do_callbacks(&cb_list, regs); + do_callbacks(&cb_list, get_irq_regs()); /* next event is first in list */ spin_lock(&vt_list->lock); diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 9c3c19fe62fc..1c323bbfda91 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -451,7 +451,7 @@ void pfault_fini(void) } asmlinkage void -pfault_interrupt(struct pt_regs *regs, __u16 error_code) +pfault_interrupt(__u16 error_code) { struct task_struct *tsk; __u16 subcode; diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 222a8a71a5e8..53db58a68617 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -218,7 +218,7 @@ dasd_diag_term_IO(struct dasd_ccw_req * cqr) /* Handle external interruption. */ static void -dasd_ext_handler(struct pt_regs *regs, __u16 code) +dasd_ext_handler(__u16 code) { struct dasd_ccw_req *cqr, *next; struct dasd_device *device; diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c index d83eb6358bac..49e9628d9297 100644 --- a/drivers/s390/char/ctrlchar.c +++ b/drivers/s390/char/ctrlchar.c @@ -20,7 +20,7 @@ static int ctrlchar_sysrq_key; static void ctrlchar_handle_sysrq(void *tty) { - handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty); + handle_sysrq(ctrlchar_sysrq_key, (struct tty_struct *) tty); } static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL); diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index 3be06569180d..e3491a5f5219 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c @@ -304,7 +304,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode) if (kbd->sysrq) { if (kbd->sysrq == K(KT_LATIN, '-')) { kbd->sysrq = 0; - handle_sysrq(value, NULL, kbd->tty); + handle_sysrq(value, kbd->tty); return; } if (value == '-') { diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index 31e335751d6d..8a056df09d6b 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c @@ -324,7 +324,7 @@ __sclp_find_req(u32 sccb) * Prepare read event data request if necessary. Start processing of next * request on queue. */ static void -sclp_interrupt_handler(struct pt_regs *regs, __u16 code) +sclp_interrupt_handler(__u16 code) { struct sclp_req *req; u32 finished_sccb; @@ -743,7 +743,7 @@ EXPORT_SYMBOL(sclp_reactivate); /* Handler for external interruption used during initialization. Modify * request state to done. */ static void -sclp_check_handler(struct pt_regs *regs, __u16 code) +sclp_check_handler(__u16 code) { u32 finished_sccb; diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 2e2882daefbb..f18b1623cad7 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "airq.h" #include "cio.h" @@ -606,15 +607,17 @@ do_IRQ (struct pt_regs *regs) struct tpi_info *tpi_info; struct subchannel *sch; struct irb *irb; + struct pt_regs *old_regs; irq_enter (); + old_regs = set_irq_regs(regs); asm volatile ("mc 0,0"); if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer) /** * Make sure that the i/o interrupt did not "overtake" * the last HZ timer interrupt. */ - account_ticks(regs); + account_ticks(); /* * Get interrupt information from lowcore */ @@ -652,6 +655,7 @@ do_IRQ (struct pt_regs *regs) * out of the sie which costs more cycles than it saves. */ } while (!MACHINE_IS_VM && tpi (NULL) != 0); + set_irq_regs(old_regs); irq_exit (); } diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index 809dd8d7f47a..1476ce2b437c 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c @@ -116,7 +116,7 @@ static DEFINE_SPINLOCK(iucv_irq_queue_lock); *Internal function prototypes */ static void iucv_tasklet_handler(unsigned long); -static void iucv_irq_handler(struct pt_regs *, __u16); +static void iucv_irq_handler(__u16); static DECLARE_TASKLET(iucv_tasklet,iucv_tasklet_handler,0); @@ -2251,7 +2251,7 @@ iucv_sever(__u16 pathid, __u8 user_data[16]) * Places the interrupt buffer on a queue and schedules iucv_tasklet_handler(). */ static void -iucv_irq_handler(struct pt_regs *regs, __u16 code) +iucv_irq_handler(__u16 code) { iucv_irqdata *irqdata; diff --git a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h index e84b7ef54aac..c2f6a8782d31 100644 --- a/include/asm-s390/hardirq.h +++ b/include/asm-s390/hardirq.h @@ -32,6 +32,6 @@ typedef struct { #define HARDIRQ_BITS 8 -extern void account_ticks(struct pt_regs *); +extern void account_ticks(void); #endif /* __ASM_HARDIRQ_H */ diff --git a/include/asm-s390/irq_regs.h b/include/asm-s390/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-s390/irq_regs.h @@ -0,0 +1 @@ +#include diff --git a/include/asm-s390/s390_ext.h b/include/asm-s390/s390_ext.h index e9a2862b230d..df9b1017b703 100644 --- a/include/asm-s390/s390_ext.h +++ b/include/asm-s390/s390_ext.h @@ -10,7 +10,7 @@ * Martin Schwidefsky (schwidefsky@de.ibm.com) */ -typedef void (*ext_int_handler_t)(struct pt_regs *regs, __u16 code); +typedef void (*ext_int_handler_t)(__u16 code); /* * Warning: if you change ext_int_info_t you have to change the From 2033b0c330d50d3f1cccd207147a10ad7f4f47f8 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 6 Oct 2006 16:38:42 +0200 Subject: [PATCH 015/232] [PATCH] sysrq: irq change build fix. drivers/char/sysrq.c: In function `sysrq_handle_crashdump': drivers/char/sysrq.c:98: warning: implicit declaration of function `get_irq_regs' Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- drivers/char/sysrq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 4c0e08685705..5f49280779fb 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -38,6 +38,7 @@ #include #include +#include /* Whether we react on sysrq keys or just ignore them */ int sysrq_enabled = 1; From dc64bef5439c8e1fafea225054da4d8882c9d10c Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Fri, 6 Oct 2006 16:38:48 +0200 Subject: [PATCH 016/232] [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 --- arch/s390/Kconfig | 3 ++ arch/s390/defconfig | 1 + arch/s390/kernel/time.c | 88 ++++++++++------------------------------- 3 files changed, 24 insertions(+), 68 deletions(-) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 51c2dfe89c62..608193cfe43f 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -30,6 +30,9 @@ config GENERIC_CALIBRATE_DELAY bool default y +config GENERIC_TIME + def_bool y + config GENERIC_BUST_SPINLOCK bool diff --git a/arch/s390/defconfig b/arch/s390/defconfig index b6cad75fd1f4..a3257398ea8d 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig @@ -9,6 +9,7 @@ CONFIG_STACKTRACE_SUPPORT=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_TIME=y CONFIG_S390=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 2c8c690688cb..6cceed4df73e 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -82,74 +83,6 @@ void tod_to_timeval(__u64 todval, struct timespec *xtime) xtime->tv_nsec = ((todval * 1000) >> 12); } -static inline unsigned long do_gettimeoffset(void) -{ - __u64 now; - - now = (get_clock() - jiffies_timer_cc) >> 12; - now -= (__u64) jiffies * USECS_PER_JIFFY; - return (unsigned long) now; -} - -/* - * This version of gettimeofday has microsecond resolution. - */ -void do_gettimeofday(struct timeval *tv) -{ - unsigned long flags; - unsigned long seq; - unsigned long usec, sec; - - do { - seq = read_seqbegin_irqsave(&xtime_lock, flags); - - sec = xtime.tv_sec; - usec = xtime.tv_nsec / 1000 + do_gettimeoffset(); - } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); - - while (usec >= 1000000) { - usec -= 1000000; - sec++; - } - - tv->tv_sec = sec; - tv->tv_usec = usec; -} - -EXPORT_SYMBOL(do_gettimeofday); - -int do_settimeofday(struct timespec *tv) -{ - time_t wtm_sec, sec = tv->tv_sec; - long wtm_nsec, nsec = tv->tv_nsec; - - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) - return -EINVAL; - - write_seqlock_irq(&xtime_lock); - /* This is revolting. We need to set the xtime.tv_nsec - * correctly. However, the value in this location is - * is value at the last tick. - * Discover what correction gettimeofday - * would have done, and then undo it! - */ - nsec -= do_gettimeoffset() * 1000; - - wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); - wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); - - set_normalized_timespec(&xtime, sec, nsec); - set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); - - ntp_clear(); - write_sequnlock_irq(&xtime_lock); - clock_was_set(); - return 0; -} - -EXPORT_SYMBOL(do_settimeofday); - - #ifdef CONFIG_PROFILING #define s390_do_profile() profile_tick(CPU_PROFILING) #else @@ -340,6 +273,22 @@ void init_cpu_timer(void) extern void vtime_init(void); +static cycle_t read_tod_clock(void) +{ + return get_clock(); +} + +static struct clocksource clocksource_tod = { + .name = "tod", + .rating = 100, + .read = read_tod_clock, + .mask = -1ULL, + .mult = 1000, + .shift = 12, + .is_continuous = 1, +}; + + /* * Initialize the TOD clock and the CPU timer of * the boot cpu. @@ -384,6 +333,9 @@ void __init time_init(void) &ext_int_info_cc) != 0) panic("Couldn't request external interrupt 0x1004"); + if (clocksource_register(&clocksource_tod) != 0) + panic("Could not register TOD clock source"); + init_cpu_timer(); #ifdef CONFIG_NO_IDLE_HZ From d195412c35fe777811bd58ad43fba3aacc67e15c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 6 Oct 2006 00:43:48 -0700 Subject: [PATCH 017/232] [PATCH] i386: irqs build fix Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/i386/kernel/apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 7d500da0e63b..2fd4b7d927c2 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -1197,7 +1197,7 @@ inline void smp_local_timer_interrupt(void) { profile_tick(CPU_PROFILING); #ifdef CONFIG_SMP - update_process_times(user_mode_vm(irq_regs)); + update_process_times(user_mode_vm(get_irq_regs())); #endif /* From 4899b8b16b302299cc91289f7b5bac295e9ab387 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 6 Oct 2006 00:43:48 -0700 Subject: [PATCH 018/232] [PATCH] kauditd_thread warning fix Squash this warning: kernel/audit.c: In function 'kauditd_thread': kernel/audit.c:367: warning: no return statement in function returning non-void We might as test kthread_should_stop(), although it's not very pointful at present. The code which starts this thread looks racy - the kernel could start multiple threads. Cc: Al Viro Cc: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/audit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index f9889ee77825..98106f6078b0 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -340,7 +340,7 @@ static int kauditd_thread(void *dummy) { struct sk_buff *skb; - while (1) { + while (!kthread_should_stop()) { skb = skb_dequeue(&audit_skb_queue); wake_up(&audit_backlog_wait); if (skb) { @@ -369,6 +369,7 @@ static int kauditd_thread(void *dummy) remove_wait_queue(&kauditd_wait, &wait); } } + return 0; } int audit_send_list(void *_dest) From d69a892268c66c13fcb445a8274baa9d7befb7b5 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 6 Oct 2006 00:43:49 -0700 Subject: [PATCH 019/232] [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 Cc: Herbert Xu Cc: "Ananiev, Leonid I" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/bug.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index a5250895155e..1d9573cf4a0b 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -41,14 +41,14 @@ #endif #endif -#define WARN_ON_ONCE(condition) ({ \ - static int __warn_once = 1; \ - typeof(condition) __ret_warn_once = (condition);\ - \ - if (likely(__warn_once)) \ - if (WARN_ON(__ret_warn_once)) \ - __warn_once = 0; \ - unlikely(__ret_warn_once); \ +#define WARN_ON_ONCE(condition) ({ \ + static int __warned; \ + typeof(condition) __ret_warn_once = (condition); \ + \ + if (unlikely(__ret_warn_once)) \ + if (WARN_ON(!__warned)) \ + __warned = 1; \ + unlikely(__ret_warn_once); \ }) #ifdef CONFIG_SMP From efbc52f945696702a97a78b12812093f61880c2c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 6 Oct 2006 00:43:50 -0700 Subject: [PATCH 020/232] [PATCH] irq_reqs: export __irq_regs Modules might want this. Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- lib/irq_regs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/irq_regs.c b/lib/irq_regs.c index 101b1a4f9b14..753880a5440c 100644 --- a/lib/irq_regs.c +++ b/lib/irq_regs.c @@ -8,8 +8,10 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #ifndef ARCH_HAS_OWN_IRQ_REGS DEFINE_PER_CPU(struct pt_regs *, __irq_regs); +EXPORT_PER_CPU_SYMBOL(__irq_regs); #endif From da66b719d16f6ea3801b859c1ff35d5cd05c517d Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 6 Oct 2006 00:43:51 -0700 Subject: [PATCH 021/232] [PATCH] ohci: don't play with IRQ regs This is a more correct fix for the way the ohci hcd was referencing pt_regs in the unlink paths. Signed-off-by: David Brownell Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/usb/host/ohci-q.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index e08d1a2664e6..fe1fe2f97cb5 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c @@ -925,7 +925,7 @@ rescan_all: /* only take off EDs that the HC isn't using, accounting for * frame counter wraps and EDs with partially retired TDs */ - if (likely (get_irq_regs() && HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) { + if (likely (HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) { if (tick_before (tick, ed->tick)) { skip_ed: last = &ed->ed_next; From 1ca4cb2418c04914e4661c059cf5b7b9262c645a Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Fri, 6 Oct 2006 00:43:52 -0700 Subject: [PATCH 022/232] [PATCH] slab: reduce numa text size Reduce the NUMA text size of mm/slab.o a little on x86 by using a local variable to store the result of numa_node_id(). text data bss dec hex filename 16858 2584 16 19458 4c02 mm/slab.o (before) 16804 2584 16 19404 4bcc mm/slab.o (after) [akpm@osdl.org: use better names] [pbadari@us.ibm.com: fix that] Cc: Christoph Lameter Signed-off-by: Pekka Enberg Signed-off-by: Badari Pulavarty Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/slab.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index e9a63b5a7fb9..64fb0d770b06 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1106,15 +1106,18 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) int nodeid = slabp->nodeid; struct kmem_list3 *l3; struct array_cache *alien = NULL; + int node; + + node = numa_node_id(); /* * Make sure we are not freeing a object from another node to the array * cache on this cpu. */ - if (likely(slabp->nodeid == numa_node_id())) + if (likely(slabp->nodeid == node)) return 0; - l3 = cachep->nodelists[numa_node_id()]; + l3 = cachep->nodelists[node]; STATS_INC_NODEFREES(cachep); if (l3->alien && l3->alien[nodeid]) { alien = l3->alien[nodeid]; @@ -1352,6 +1355,7 @@ void __init kmem_cache_init(void) struct cache_names *names; int i; int order; + int node; for (i = 0; i < NUM_INIT_LISTS; i++) { kmem_list3_init(&initkmem_list3[i]); @@ -1386,12 +1390,14 @@ void __init kmem_cache_init(void) * 6) Resize the head arrays of the kmalloc caches to their final sizes. */ + node = numa_node_id(); + /* 1) create the cache_cache */ INIT_LIST_HEAD(&cache_chain); list_add(&cache_cache.next, &cache_chain); cache_cache.colour_off = cache_line_size(); cache_cache.array[smp_processor_id()] = &initarray_cache.cache; - cache_cache.nodelists[numa_node_id()] = &initkmem_list3[CACHE_CACHE]; + cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE]; cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, cache_line_size()); @@ -1496,19 +1502,18 @@ void __init kmem_cache_init(void) } /* 5) Replace the bootstrap kmem_list3's */ { - int node; - /* Replace the static kmem_list3 structures for the boot cpu */ - init_list(&cache_cache, &initkmem_list3[CACHE_CACHE], - numa_node_id()); + int nid; - for_each_online_node(node) { + /* Replace the static kmem_list3 structures for the boot cpu */ + init_list(&cache_cache, &initkmem_list3[CACHE_CACHE], node); + + for_each_online_node(nid) { init_list(malloc_sizes[INDEX_AC].cs_cachep, - &initkmem_list3[SIZE_AC + node], node); + &initkmem_list3[SIZE_AC + nid], nid); if (INDEX_AC != INDEX_L3) { init_list(malloc_sizes[INDEX_L3].cs_cachep, - &initkmem_list3[SIZE_L3 + node], - node); + &initkmem_list3[SIZE_L3 + nid], nid); } } } @@ -2918,6 +2923,9 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) int batchcount; struct kmem_list3 *l3; struct array_cache *ac; + int node; + + node = numa_node_id(); check_irq_off(); ac = cpu_cache_get(cachep); @@ -2931,7 +2939,7 @@ retry: */ batchcount = BATCHREFILL_LIMIT; } - l3 = cachep->nodelists[numa_node_id()]; + l3 = cachep->nodelists[node]; BUG_ON(ac->avail > 0 || !l3); spin_lock(&l3->list_lock); @@ -2961,7 +2969,7 @@ retry: STATS_SET_HIGH(cachep); ac->entry[ac->avail++] = slab_get_obj(cachep, slabp, - numa_node_id()); + node); } check_slabp(cachep, slabp); @@ -2980,7 +2988,7 @@ alloc_done: if (unlikely(!ac->avail)) { int x; - x = cache_grow(cachep, flags, numa_node_id()); + x = cache_grow(cachep, flags, node); /* cache_grow can reenable interrupts, then ac could change. */ ac = cpu_cache_get(cachep); From 7f7bbbe50b8a28f4dfaa4cea939ddb50198c4a99 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 6 Oct 2006 00:43:53 -0700 Subject: [PATCH 023/232] [PATCH] page fault retry with NOPAGE_REFAULT 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 Cc: Hugh Dickins Cc: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mm.h | 1 + mm/memory.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index b7966ab8cb6a..26146623be2f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -593,6 +593,7 @@ static inline int page_mapped(struct page *page) */ #define NOPAGE_SIGBUS (NULL) #define NOPAGE_OOM ((struct page *) (-1)) +#define NOPAGE_REFAULT ((struct page *) (-2)) /* Return to userspace, rerun */ /* * Error return values for the *_nopfn functions diff --git a/mm/memory.c b/mm/memory.c index 9cf3f341a28a..b5a4aadd961a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1086,6 +1086,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, default: BUG(); } + cond_resched(); } if (pages) { pages[i] = page; @@ -2169,11 +2170,13 @@ retry: * after the next truncate_count read. */ - /* no page was available -- either SIGBUS or OOM */ - if (new_page == NOPAGE_SIGBUS) + /* no page was available -- either SIGBUS, OOM or REFAULT */ + if (unlikely(new_page == NOPAGE_SIGBUS)) return VM_FAULT_SIGBUS; - if (new_page == NOPAGE_OOM) + else if (unlikely(new_page == NOPAGE_OOM)) return VM_FAULT_OOM; + else if (unlikely(new_page == NOPAGE_REFAULT)) + return VM_FAULT_MINOR; /* * Should we do an early C-O-W break? From 7236e978a3883406ca06ee79e0739743c7c92a85 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Fri, 6 Oct 2006 00:43:54 -0700 Subject: [PATCH 024/232] [PATCH] provide tickadj define Provide a tickadj compatibility define for archs still using it. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/timex.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/timex.h b/include/linux/timex.h index 049dfe4a11f2..db501dc23c29 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -293,6 +293,9 @@ extern void second_overflow(void); extern void update_ntp_one_tick(void); extern int do_adjtimex(struct timex *); +/* Don't use! Compatibility define for existing users. */ +#define tickadj (500/HZ ? : 1) + #endif /* KERNEL */ #endif /* LINUX_TIMEX_H */ From d6359fd783251238dbbf70b7c2fc745db25cf51f Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Fri, 6 Oct 2006 00:43:55 -0700 Subject: [PATCH 025/232] [PATCH] m68k: cleanup string functions - cleanup asm of string functions - deinline strncat()/strncmp() - provide non-inlined strcpy() Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/m68k/kernel/m68k_ksyms.c | 4 - arch/m68k/lib/string.c | 15 ++- include/asm-m68k/string.h | 202 +++++++++++++++------------------- 3 files changed, 104 insertions(+), 117 deletions(-) diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c index aff26a52167c..f9636e84e6a4 100644 --- a/arch/m68k/kernel/m68k_ksyms.c +++ b/arch/m68k/kernel/m68k_ksyms.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -53,9 +52,6 @@ EXPORT_SYMBOL(mach_beep); #endif EXPORT_SYMBOL(dump_fpu); EXPORT_SYMBOL(dump_thread); -EXPORT_SYMBOL(strnlen); -EXPORT_SYMBOL(strrchr); -EXPORT_SYMBOL(strstr); EXPORT_SYMBOL(kernel_thread); #ifdef CONFIG_VME EXPORT_SYMBOL(vme_brdtype); diff --git a/arch/m68k/lib/string.c b/arch/m68k/lib/string.c index b92b89e1ea0c..891e1347bc4e 100644 --- a/arch/m68k/lib/string.c +++ b/arch/m68k/lib/string.c @@ -1,6 +1,19 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + */ + +#define __IN_STRING_C -#include #include +#include + +char *strcpy(char *dest, const char *src) +{ + return __kernel_strcpy(dest, src); +} +EXPORT_SYMBOL(strcpy); void *memset(void *s, int c, size_t count) { diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h index 6c59215b285e..2eb7df1e0f5d 100644 --- a/include/asm-m68k/string.h +++ b/include/asm-m68k/string.h @@ -1,138 +1,114 @@ #ifndef _M68K_STRING_H_ #define _M68K_STRING_H_ -#include -#include +#include +#include -#define __HAVE_ARCH_STRCPY -static inline char * strcpy(char * dest,const char *src) +static inline size_t __kernel_strlen(const char *s) { - char *xdest = dest; + const char *sc; - __asm__ __volatile__ - ("1:\tmoveb %1@+,%0@+\n\t" - "jne 1b" - : "=a" (dest), "=a" (src) - : "0" (dest), "1" (src) : "memory"); - return xdest; + for (sc = s; *sc++; ) + ; + return sc - s - 1; } -#define __HAVE_ARCH_STRNCPY -static inline char * strncpy(char *dest, const char *src, size_t n) +static inline char *__kernel_strcpy(char *dest, const char *src) { - char *xdest = dest; + char *xdest = dest; - if (n == 0) - return xdest; + asm volatile ("\n" + "1: move.b (%1)+,(%0)+\n" + " jne 1b" + : "+a" (dest), "+a" (src) + : : "memory"); + return xdest; +} - __asm__ __volatile__ - ("1:\tmoveb %1@+,%0@+\n\t" - "jeq 2f\n\t" - "subql #1,%2\n\t" - "jne 1b\n\t" - "2:" - : "=a" (dest), "=a" (src), "=d" (n) - : "0" (dest), "1" (src), "2" (n) - : "memory"); - return xdest; +#ifndef __IN_STRING_C + +#define __HAVE_ARCH_STRLEN +#define strlen(s) (__builtin_constant_p(s) ? \ + __builtin_strlen(s) : \ + __kernel_strlen(s)) + +#define __HAVE_ARCH_STRNLEN +static inline size_t strnlen(const char *s, size_t count) +{ + const char *sc = s; + + asm volatile ("\n" + "1: subq.l #1,%1\n" + " jcs 2f\n" + " tst.b (%0)+\n" + " jne 1b\n" + " subq.l #1,%0\n" + "2:" + : "+a" (sc), "+d" (count)); + return sc - s; +} + +#define __HAVE_ARCH_STRCPY +#if __GNUC__ >= 4 +#define strcpy(d, s) (__builtin_constant_p(s) && \ + __builtin_strlen(s) <= 32 ? \ + __builtin_strcpy(d, s) : \ + __kernel_strcpy(d, s)) +#else +#define strcpy(d, s) __kernel_strcpy(d, s) +#endif + +#define __HAVE_ARCH_STRNCPY +static inline char *strncpy(char *dest, const char *src, size_t n) +{ + char *xdest = dest; + + asm volatile ("\n" + " jra 2f\n" + "1: move.b (%1),(%0)+\n" + " jeq 2f\n" + " addq.l #1,%1\n" + "2: subq.l #1,%2\n" + " jcc 1b\n" + : "+a" (dest), "+a" (src), "+d" (n) + : : "memory"); + return xdest; } #define __HAVE_ARCH_STRCAT -static inline char * strcat(char * dest, const char * src) -{ - char *tmp = dest; - - while (*dest) - dest++; - while ((*dest++ = *src++)) - ; - - return tmp; -} - -#define __HAVE_ARCH_STRNCAT -static inline char * strncat(char *dest, const char *src, size_t count) -{ - char *tmp = dest; - - if (count) { - while (*dest) - dest++; - while ((*dest++ = *src++)) { - if (--count == 0) { - *dest++='\0'; - break; - } - } - } - - return tmp; -} +#define strcat(d, s) ({ \ + char *__d = (d); \ + strcpy(__d + strlen(__d), (s)); \ +}) #define __HAVE_ARCH_STRCHR -static inline char * strchr(const char * s, int c) +static inline char *strchr(const char *s, int c) { - const char ch = c; + char sc, ch = c; - for(; *s != ch; ++s) - if (*s == '\0') - return( NULL ); - return( (char *) s); + for (; (sc = *s++) != ch; ) { + if (!sc) + return NULL; + } + return (char *)s - 1; } -/* strstr !! */ - -#define __HAVE_ARCH_STRLEN -static inline size_t strlen(const char * s) -{ - const char *sc; - for (sc = s; *sc != '\0'; ++sc) ; - return(sc - s); -} - -/* strnlen !! */ - #define __HAVE_ARCH_STRCMP -static inline int strcmp(const char * cs,const char * ct) +static inline int strcmp(const char *cs, const char *ct) { - char __res; + char res; - __asm__ - ("1:\tmoveb %0@+,%2\n\t" /* get *cs */ - "cmpb %1@+,%2\n\t" /* compare a byte */ - "jne 2f\n\t" /* not equal, break out */ - "tstb %2\n\t" /* at end of cs? */ - "jne 1b\n\t" /* no, keep going */ - "jra 3f\n\t" /* strings are equal */ - "2:\tsubb %1@-,%2\n\t" /* *cs - *ct */ - "3:" - : "=a" (cs), "=a" (ct), "=d" (__res) - : "0" (cs), "1" (ct)); - return __res; -} - -#define __HAVE_ARCH_STRNCMP -static inline int strncmp(const char * cs,const char * ct,size_t count) -{ - char __res; - - if (!count) - return 0; - __asm__ - ("1:\tmovb %0@+,%3\n\t" /* get *cs */ - "cmpb %1@+,%3\n\t" /* compare a byte */ - "jne 3f\n\t" /* not equal, break out */ - "tstb %3\n\t" /* at end of cs? */ - "jeq 4f\n\t" /* yes, all done */ - "subql #1,%2\n\t" /* no, adjust count */ - "jne 1b\n\t" /* more to do, keep going */ - "2:\tmoveq #0,%3\n\t" /* strings are equal */ - "jra 4f\n\t" - "3:\tsubb %1@-,%3\n\t" /* *cs - *ct */ - "4:" - : "=a" (cs), "=a" (ct), "=d" (count), "=d" (__res) - : "0" (cs), "1" (ct), "2" (count)); - return __res; + asm ("\n" + "1: move.b (%0)+,%2\n" /* get *cs */ + " cmp.b (%1)+,%2\n" /* compare a byte */ + " jne 2f\n" /* not equal, break out */ + " tst.b %2\n" /* at end of cs? */ + " jne 1b\n" /* no, keep going */ + " jra 3f\n" /* strings are equal */ + "2: sub.b -(%1),%2\n" /* *cs - *ct */ + "3:" + : "+a" (cs), "+a" (ct), "=d" (res)); + return res; } #define __HAVE_ARCH_MEMSET @@ -150,4 +126,6 @@ extern void *memmove(void *, const void *, __kernel_size_t); extern int memcmp(const void *, const void *, __kernel_size_t); #define memcmp(d, s, n) __builtin_memcmp(d, s, n) +#endif + #endif /* _M68K_STRING_H_ */ From 6c04c28a656c1717fbe617efc40edabca3a85ca3 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Fri, 6 Oct 2006 00:43:56 -0700 Subject: [PATCH 026/232] [PATCH] m68k: fix typo in __generic_copy_to_user Jump to the correct exit label after exception Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/m68k/lib/uaccess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/lib/uaccess.c b/arch/m68k/lib/uaccess.c index 1bc188c0d983..865f9fb9e686 100644 --- a/arch/m68k/lib/uaccess.c +++ b/arch/m68k/lib/uaccess.c @@ -84,7 +84,7 @@ unsigned long __generic_copy_to_user(void __user *to, const void *from, " .even\n" "20: lsl.l #2,%0\n" "50: add.l %5,%0\n" - " jra 7b\n" + " jra 8b\n" " .previous\n" "\n" " .section __ex_table,\"a\"\n" From 9ef308946fa8390136130a886b0d9a57867a747a Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Fri, 6 Oct 2006 00:43:56 -0700 Subject: [PATCH 027/232] [PATCH] m68k: small system.h cleanup avoid unnecessary xchg() use in set_mb() Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-m68k/system.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h index 131a0cb0f491..243dd13e6bfc 100644 --- a/include/asm-m68k/system.h +++ b/include/asm-m68k/system.h @@ -78,13 +78,13 @@ static inline int irqs_disabled(void) #define mb() barrier() #define rmb() barrier() #define wmb() barrier() -#define read_barrier_depends() do { } while(0) -#define set_mb(var, value) do { xchg(&var, value); } while (0) +#define read_barrier_depends() ((void)0) +#define set_mb(var, value) ({ (var) = (value); wmb(); }) #define smp_mb() barrier() #define smp_rmb() barrier() #define smp_wmb() barrier() -#define smp_read_barrier_depends() do { } while(0) +#define smp_read_barrier_depends() ((void)0) #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) From 5e7c4ea83efa9d6269bcbf17611f83aeef71c096 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Fri, 6 Oct 2006 00:43:57 -0700 Subject: [PATCH 028/232] [PATCH] m68k: fix NBPG define The recent header cleanup removed PAGE_SIZE from the exported information as it depends on the configuration. BTW This has possibly other consequences, as the core dump code is using PAGE_SIZE directly, which may need fixing as well. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-m68k/user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-m68k/user.h b/include/asm-m68k/user.h index e8d5a64c7e79..d7c0b109bd45 100644 --- a/include/asm-m68k/user.h +++ b/include/asm-m68k/user.h @@ -81,7 +81,7 @@ struct user{ unsigned long magic; /* To uniquely identify a core file */ char u_comm[32]; /* User command that was responsible */ }; -#define NBPG PAGE_SIZE +#define NBPG 4096 #define UPAGES 1 #define HOST_TEXT_START_ADDR (u.start_code) #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) From dc366708b3b022050f139347a44c65a102e4835d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 6 Oct 2006 00:43:58 -0700 Subject: [PATCH 029/232] [PATCH] m68k: dma_alloc_coherent() has gfp_t as the last argument annotate, fix the bogus argument of vmap() in it. Signed-off-by: Al Viro Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/m68k/kernel/dma.c | 4 ++-- include/asm-m68k/dma-mapping.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index fc449f8b2045..9d4e4b5b6bd8 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c @@ -15,7 +15,7 @@ #include void *dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *handle, int flag) + dma_addr_t *handle, gfp_t flag) { struct page *page, **map; pgprot_t pgprot; @@ -51,7 +51,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size, pgprot_val(pgprot) |= _PAGE_GLOBAL040 | _PAGE_NOCACHE_S; else pgprot_val(pgprot) |= _PAGE_NOCACHE030; - addr = vmap(map, size, flag, pgprot); + addr = vmap(map, size, VM_MAP, pgprot); kfree(map); return addr; diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h index cebbb03370ec..c1299c3beb50 100644 --- a/include/asm-m68k/dma-mapping.h +++ b/include/asm-m68k/dma-mapping.h @@ -26,7 +26,7 @@ static inline int dma_is_consistent(dma_addr_t dma_addr) } extern void *dma_alloc_coherent(struct device *, size_t, - dma_addr_t *, int); + dma_addr_t *, gfp_t); extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t); From a666ecfbf512dbd63a60f65d2ad6733a9a1b12ee Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Fri, 6 Oct 2006 00:43:58 -0700 Subject: [PATCH 030/232] [PATCH] Fix typo in "syntax error if percpu macros are incorrectly used" patch Trivial typo fix in the "syntax error if percpu macros are incorrectly used" patch. I misspelled "identifier" in all places. D'Oh! Thanks to Dirk Mueller to point this out. Signed-off-by: Jan Blunck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/percpu.h | 2 +- include/asm-s390/percpu.h | 4 ++-- include/asm-x86_64/percpu.h | 6 +++--- include/linux/percpu.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 6d45ee5472af..196376262240 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h @@ -15,7 +15,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; /* var is in discarded region: offset to particular copy we want */ #define per_cpu(var, cpu) (*({ \ - extern int simple_indentifier_##var(void); \ + extern int simple_identifier_##var(void); \ RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]); })) #define __get_cpu_var(var) per_cpu(var, smp_processor_id()) #define __raw_get_cpu_var(var) per_cpu(var, raw_smp_processor_id()) diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h index 495ad99c7635..9ea7f1023e57 100644 --- a/include/asm-s390/percpu.h +++ b/include/asm-s390/percpu.h @@ -16,7 +16,7 @@ #if defined(__s390x__) && defined(MODULE) #define __reloc_hide(var,offset) (*({ \ - extern int simple_indentifier_##var(void); \ + extern int simple_identifier_##var(void); \ unsigned long *__ptr; \ asm ( "larl %0,per_cpu__"#var"@GOTENT" \ : "=a" (__ptr) : "X" (per_cpu__##var) ); \ @@ -25,7 +25,7 @@ #else #define __reloc_hide(var, offset) (*({ \ - extern int simple_indentifier_##var(void); \ + extern int simple_identifier_##var(void); \ unsigned long __ptr; \ asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \ (typeof(&per_cpu__##var)) (__ptr + (offset)); })) diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 285756010c51..5ed0ef340842 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h @@ -32,13 +32,13 @@ /* var is in discarded region: offset to particular copy we want */ #define per_cpu(var, cpu) (*({ \ - extern int simple_indentifier_##var(void); \ + extern int simple_identifier_##var(void); \ RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)); })) #define __get_cpu_var(var) (*({ \ - extern int simple_indentifier_##var(void); \ + extern int simple_identifier_##var(void); \ RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); })) #define __raw_get_cpu_var(var) (*({ \ - extern int simple_indentifier_##var(void); \ + extern int simple_identifier_##var(void); \ RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); })) /* A macro to avoid #include hell... */ diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 46ec72fa2c84..600e3d387ffc 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -19,7 +19,7 @@ * we force a syntax error here if it isn't. */ #define get_cpu_var(var) (*({ \ - extern int simple_indentifier_##var(void); \ + extern int simple_identifier_##var(void); \ preempt_disable(); \ &__get_cpu_var(var); })) #define put_cpu_var(var) preempt_enable() From 1662d32cea96a8711bd61094ff090979478f0fd4 Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Fri, 6 Oct 2006 00:43:59 -0700 Subject: [PATCH 031/232] [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 Cc: Jean Delvare Cc: Christer Weinigel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- MAINTAINERS | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 84a018ee4556..50fb3ae5f313 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2261,6 +2261,17 @@ T: git kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git T: cvs cvs.parisc-linux.org:/var/cvs/linux-2.6 S: Maintained +PC87360 HARDWARE MONITORING DRIVER +P: Jim Cromie +M: jim.cromie@gmail.com +L: lm-sensors@lm-sensors.org +S: Maintained + +PC8736x GPIO DRIVER +P: Jim Cromie +M: jim.cromie@gmail.com +S: Maintained + PCI ERROR RECOVERY P: Linas Vepstas M: linas@austin.ibm.com @@ -2592,10 +2603,19 @@ L: lksctp-developers@lists.sourceforge.net S: Supported SCx200 CPU SUPPORT -P: Christer Weinigel -M: christer@weinigel.se -W: http://www.weinigel.se -S: Supported +P: Jim Cromie +M: jim.cromie@gmail.com +S: Odd Fixes + +SCx200 GPIO DRIVER +P: Jim Cromie +M: jim.cromie@gmail.com +S: Maintained + +SCx200 HRT CLOCKSOURCE DRIVER +P: Jim Cromie +M: jim.cromie@gmail.com +S: Maintained SECURITY CONTACT P: Security Officers From 3260259f0084e51ce21503b130473b78871e7077 Mon Sep 17 00:00:00 2001 From: Henne Date: Fri, 6 Oct 2006 00:44:01 -0700 Subject: [PATCH 032/232] [PATCH] sched: fix a kerneldoc error on is_init() Fix a kerneldoc warning and reorderd the description for is_init(). Signed-off-by: Henrik Kretzschmar Cc: "Randy.Dunlap" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sched.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 331f4502e92b..6735c1cf334c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1065,9 +1065,10 @@ static inline int pid_alive(struct task_struct *p) } /** - * is_init - check if a task structure is the first user space - * task the kernel created. - * @p: Task structure to be checked. + * is_init - check if a task structure is init + * @tsk: Task structure to be checked. + * + * Check if a task structure is the first user space task the kernel created. */ static inline int is_init(struct task_struct *tsk) { From 45e02b5b52e43aa7a674f64ca3470b9ee51fc9fd Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Fri, 6 Oct 2006 00:44:02 -0700 Subject: [PATCH 033/232] [PATCH] swarm: Actually initialize the IDE driver This is required for the SWARM GenBus IDE interface to be recognized. Signed-off-by: Maciej W. Rozycki Cc: Ralf Baechle Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/ide/mips/swarm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c index 66f6064f4640..09c9e7936b0d 100644 --- a/drivers/ide/mips/swarm.c +++ b/drivers/ide/mips/swarm.c @@ -4,6 +4,7 @@ * Author: Manish Lachwani, mlachwani@mvista.com * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved. * Author: Maciej W. Rozycki + * Copyright (c) 2006 Maciej W. Rozycki * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -127,6 +128,7 @@ static int __devinit swarm_ide_probe(struct device *dev) memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); hwif->irq = hwif->hw.irq; + probe_hwif_init(hwif); dev_set_drvdata(dev, hwif); return 0; From ec5a19dd935eb3793e1f6ed491e8035b3d7b1df9 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 6 Oct 2006 00:44:03 -0700 Subject: [PATCH 034/232] [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 Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mmc/mmc_block.c | 104 ++++++++++++++++++++++++++++++++--- include/linux/mmc/protocol.h | 1 + 2 files changed, 96 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index c1293f1bda87..f9027c8db792 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -154,6 +155,71 @@ static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req) return stat; } +static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) +{ + int err; + u32 blocks; + + struct mmc_request mrq; + struct mmc_command cmd; + struct mmc_data data; + unsigned int timeout_us; + + struct scatterlist sg; + + memset(&cmd, 0, sizeof(struct mmc_command)); + + cmd.opcode = MMC_APP_CMD; + cmd.arg = card->rca << 16; + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; + + err = mmc_wait_for_cmd(card->host, &cmd, 0); + if ((err != MMC_ERR_NONE) || !(cmd.resp[0] & R1_APP_CMD)) + return (u32)-1; + + memset(&cmd, 0, sizeof(struct mmc_command)); + + cmd.opcode = SD_APP_SEND_NUM_WR_BLKS; + cmd.arg = 0; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + + memset(&data, 0, sizeof(struct mmc_data)); + + data.timeout_ns = card->csd.tacc_ns * 100; + data.timeout_clks = card->csd.tacc_clks * 100; + + timeout_us = data.timeout_ns / 1000; + timeout_us += data.timeout_clks * 1000 / + (card->host->ios.clock / 1000); + + if (timeout_us > 100000) { + data.timeout_ns = 100000000; + data.timeout_clks = 0; + } + + data.blksz = 4; + data.blocks = 1; + data.flags = MMC_DATA_READ; + data.sg = &sg; + data.sg_len = 1; + + memset(&mrq, 0, sizeof(struct mmc_request)); + + mrq.cmd = &cmd; + mrq.data = &data; + + sg_init_one(&sg, &blocks, 4); + + mmc_wait_for_req(card->host, &mrq); + + if (cmd.error != MMC_ERR_NONE || data.error != MMC_ERR_NONE) + return (u32)-1; + + blocks = ntohl(blocks); + + return blocks; +} + static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) { struct mmc_blk_data *md = mq->data; @@ -184,10 +250,13 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) /* * If the host doesn't support multiple block writes, force - * block writes to single block. + * block writes to single block. SD cards are excepted from + * this rule as they support querying the number of + * successfully written sectors. */ if (rq_data_dir(req) != READ && - !(card->host->caps & MMC_CAP_MULTIWRITE)) + !(card->host->caps & MMC_CAP_MULTIWRITE) && + !mmc_card_sd(card)) brq.data.blocks = 1; if (brq.data.blocks > 1) { @@ -276,24 +345,41 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) return 1; cmd_err: - mmc_card_release_host(card); - ret = 1; - /* - * For writes and where the host claims to support proper - * error reporting, we first ok the successful blocks. + /* + * If this is an SD card and we're writing, we can first + * mark the known good sectors as ok. + * + * If the card is not SD, we can still ok written sectors + * if the controller can do proper error reporting. * * For reads we just fail the entire chunk as that should * be safe in all cases. */ - if (rq_data_dir(req) != READ && - (card->host->caps & MMC_CAP_MULTIWRITE)) { + if (rq_data_dir(req) != READ && mmc_card_sd(card)) { + u32 blocks; + unsigned int bytes; + + blocks = mmc_sd_num_wr_blocks(card); + if (blocks != (u32)-1) { + if (card->csd.write_partial) + bytes = blocks << md->block_bits; + else + bytes = blocks << 9; + spin_lock_irq(&md->lock); + ret = end_that_request_chunk(req, 1, bytes); + spin_unlock_irq(&md->lock); + } + } else if (rq_data_dir(req) != READ && + (card->host->caps & MMC_CAP_MULTIWRITE)) { spin_lock_irq(&md->lock); ret = end_that_request_chunk(req, 1, brq.data.bytes_xfered); spin_unlock_irq(&md->lock); } + mmc_card_release_host(card); + spin_lock_irq(&md->lock); while (ret) { ret = end_that_request_chunk(req, 0, diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h index 81c3f77f652c..08dec8d9e703 100644 --- a/include/linux/mmc/protocol.h +++ b/include/linux/mmc/protocol.h @@ -83,6 +83,7 @@ /* Application commands */ #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ +#define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */ #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ #define SD_APP_SEND_SCR 51 /* adtc R1 */ From 5842730de179405d80649231faa0b3f254477434 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 6 Oct 2006 00:44:04 -0700 Subject: [PATCH 035/232] [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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/md.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/md.c b/drivers/md/md.c index cb8281605be8..57fa64f93e5f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -3849,6 +3849,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev) } clear_bit(In_sync, &rdev->flags); rdev->desc_nr = -1; + rdev->saved_raid_disk = -1; err = bind_rdev_to_array(rdev, mddev); if (err) goto abort_export; From c6b0a9f87b82f25fa35206ec04b5160372eabab4 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 6 Oct 2006 00:44:05 -0700 Subject: [PATCH 036/232] [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 Cc: "J. Bruce Fields" Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/nfsd/nfssvc.c | 2 +- include/linux/sunrpc/svc.h | 3 ++- net/sunrpc/svc.c | 17 ++++++++++------- net/sunrpc/svcsock.c | 28 ++++++++++++++-------------- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 6fa6340a5fb8..013b38996e64 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -217,7 +217,7 @@ int nfsd_create_serv(void) atomic_set(&nfsd_busy, 0); nfsd_serv = svc_create_pooled(&nfsd_program, - NFSD_BUFSIZE - NFSSVC_MAXBLKSIZE + nfsd_max_blksize, + nfsd_max_blksize, nfsd_last_thread, nfsd, SIG_NOCLEAN, THIS_MODULE); if (nfsd_serv == NULL) diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index d6288e89fd9d..9c9a8ad92477 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -57,7 +57,8 @@ struct svc_serv { struct svc_stat * sv_stats; /* RPC statistics */ spinlock_t sv_lock; unsigned int sv_nrthreads; /* # of server threads */ - unsigned int sv_bufsz; /* datagram buffer size */ + unsigned int sv_max_payload; /* datagram payload size */ + unsigned int sv_max_mesg; /* max_payload + 1 page for overheads */ unsigned int sv_xdrsize; /* XDR buffer size */ struct list_head sv_permsocks; /* all permanent sockets */ diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index c2c8bb20d07f..2807fa0eab40 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -282,7 +282,10 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools, serv->sv_program = prog; serv->sv_nrthreads = 1; serv->sv_stats = prog->pg_stats; - serv->sv_bufsz = bufsize? bufsize : 4096; + if (bufsize > RPCSVC_MAXPAYLOAD) + bufsize = RPCSVC_MAXPAYLOAD; + serv->sv_max_payload = bufsize? bufsize : 4096; + serv->sv_max_mesg = roundup(serv->sv_max_payload + PAGE_SIZE, PAGE_SIZE); serv->sv_shutdown = shutdown; xdrsize = 0; while (prog) { @@ -414,9 +417,9 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size) int pages; int arghi; - if (size > RPCSVC_MAXPAYLOAD) - size = RPCSVC_MAXPAYLOAD; - pages = 2 + (size+ PAGE_SIZE -1) / PAGE_SIZE; + pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. + * We assume one is at most one page + */ arghi = 0; BUG_ON(pages > RPCSVC_MAXPAGES); while (pages) { @@ -463,7 +466,7 @@ __svc_create_thread(svc_thread_fn func, struct svc_serv *serv, if (!(rqstp->rq_argp = kmalloc(serv->sv_xdrsize, GFP_KERNEL)) || !(rqstp->rq_resp = kmalloc(serv->sv_xdrsize, GFP_KERNEL)) - || !svc_init_buffer(rqstp, serv->sv_bufsz)) + || !svc_init_buffer(rqstp, serv->sv_max_mesg)) goto out_thread; serv->sv_nrthreads++; @@ -938,8 +941,8 @@ u32 svc_max_payload(const struct svc_rqst *rqstp) if (rqstp->rq_sock->sk_sock->type == SOCK_DGRAM) max = RPCSVC_MAXPAYLOAD_UDP; - if (rqstp->rq_server->sv_bufsz < max) - max = rqstp->rq_server->sv_bufsz; + if (rqstp->rq_server->sv_max_payload < max) + max = rqstp->rq_server->sv_max_payload; return max; } EXPORT_SYMBOL_GPL(svc_max_payload); diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index b39e7e2b648f..61e307cca13d 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -192,13 +192,13 @@ svc_sock_enqueue(struct svc_sock *svsk) svsk->sk_pool = pool; set_bit(SOCK_NOSPACE, &svsk->sk_sock->flags); - if (((atomic_read(&svsk->sk_reserved) + serv->sv_bufsz)*2 + if (((atomic_read(&svsk->sk_reserved) + serv->sv_max_mesg)*2 > svc_sock_wspace(svsk)) && !test_bit(SK_CLOSE, &svsk->sk_flags) && !test_bit(SK_CONN, &svsk->sk_flags)) { /* Don't enqueue while not enough space for reply */ dprintk("svc: socket %p no space, %d*2 > %ld, not enqueued\n", - svsk->sk_sk, atomic_read(&svsk->sk_reserved)+serv->sv_bufsz, + svsk->sk_sk, atomic_read(&svsk->sk_reserved)+serv->sv_max_mesg, svc_sock_wspace(svsk)); svsk->sk_pool = NULL; clear_bit(SK_BUSY, &svsk->sk_flags); @@ -220,7 +220,7 @@ svc_sock_enqueue(struct svc_sock *svsk) rqstp, rqstp->rq_sock); rqstp->rq_sock = svsk; atomic_inc(&svsk->sk_inuse); - rqstp->rq_reserved = serv->sv_bufsz; + rqstp->rq_reserved = serv->sv_max_mesg; atomic_add(rqstp->rq_reserved, &svsk->sk_reserved); BUG_ON(svsk->sk_pool != pool); wake_up(&rqstp->rq_wait); @@ -639,8 +639,8 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) * which will access the socket. */ svc_sock_setbufsize(svsk->sk_sock, - (serv->sv_nrthreads+3) * serv->sv_bufsz, - (serv->sv_nrthreads+3) * serv->sv_bufsz); + (serv->sv_nrthreads+3) * serv->sv_max_mesg, + (serv->sv_nrthreads+3) * serv->sv_max_mesg); if ((rqstp->rq_deferred = svc_deferred_dequeue(svsk))) { svc_sock_received(svsk); @@ -749,8 +749,8 @@ svc_udp_init(struct svc_sock *svsk) * svc_udp_recvfrom will re-adjust if necessary */ svc_sock_setbufsize(svsk->sk_sock, - 3 * svsk->sk_server->sv_bufsz, - 3 * svsk->sk_server->sv_bufsz); + 3 * svsk->sk_server->sv_max_mesg, + 3 * svsk->sk_server->sv_max_mesg); set_bit(SK_DATA, &svsk->sk_flags); /* might have come in before data_ready set up */ set_bit(SK_CHNGBUF, &svsk->sk_flags); @@ -993,8 +993,8 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp) * as soon a a complete request arrives. */ svc_sock_setbufsize(svsk->sk_sock, - (serv->sv_nrthreads+3) * serv->sv_bufsz, - 3 * serv->sv_bufsz); + (serv->sv_nrthreads+3) * serv->sv_max_mesg, + 3 * serv->sv_max_mesg); clear_bit(SK_DATA, &svsk->sk_flags); @@ -1032,7 +1032,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp) } svsk->sk_reclen &= 0x7fffffff; dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen); - if (svsk->sk_reclen > serv->sv_bufsz) { + if (svsk->sk_reclen > serv->sv_max_mesg) { printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (large)\n", (unsigned long) svsk->sk_reclen); goto err_delete; @@ -1171,8 +1171,8 @@ svc_tcp_init(struct svc_sock *svsk) * svc_tcp_recvfrom will re-adjust if necessary */ svc_sock_setbufsize(svsk->sk_sock, - 3 * svsk->sk_server->sv_bufsz, - 3 * svsk->sk_server->sv_bufsz); + 3 * svsk->sk_server->sv_max_mesg, + 3 * svsk->sk_server->sv_max_mesg); set_bit(SK_CHNGBUF, &svsk->sk_flags); set_bit(SK_DATA, &svsk->sk_flags); @@ -1234,7 +1234,7 @@ svc_recv(struct svc_rqst *rqstp, long timeout) /* now allocate needed pages. If we get a failure, sleep briefly */ - pages = 2 + (serv->sv_bufsz + PAGE_SIZE -1) / PAGE_SIZE; + pages = (serv->sv_max_mesg + PAGE_SIZE) / PAGE_SIZE; for (i=0; i < pages ; i++) while (rqstp->rq_pages[i] == NULL) { struct page *p = alloc_page(GFP_KERNEL); @@ -1263,7 +1263,7 @@ svc_recv(struct svc_rqst *rqstp, long timeout) if ((svsk = svc_sock_dequeue(pool)) != NULL) { rqstp->rq_sock = svsk; atomic_inc(&svsk->sk_inuse); - rqstp->rq_reserved = serv->sv_bufsz; + rqstp->rq_reserved = serv->sv_max_mesg; atomic_add(rqstp->rq_reserved, &svsk->sk_reserved); } else { /* No data pending. Go to sleep */ From 96e1a87392293cf895ea99ab70758453897c7bbf Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Fri, 6 Oct 2006 00:44:06 -0700 Subject: [PATCH 037/232] [PATCH] um: irq changes break build Fixup broken UML build due to 7d12e780e003f93433d49ce78cfedf4b4c52adc5 "IRQ: Maintain regs pointer globally rather than passing to IRQ handlers". Cc: David Howells Cc: Jeff Dike Cc: Paolo "Blaisorblade" Giarrusso Signed-off-by: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/kernel/irq.c | 2 +- include/asm-um/irq_regs.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 include/asm-um/irq_regs.h diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index eee97bb81ba5..7c41dabe7a2c 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -356,7 +356,7 @@ void forward_interrupts(int pid) unsigned int do_IRQ(int irq, union uml_pt_regs *regs) { irq_enter(); - __do_IRQ(irq, (struct pt_regs *)regs); + __do_IRQ(irq); irq_exit(); return 1; } diff --git a/include/asm-um/irq_regs.h b/include/asm-um/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-um/irq_regs.h @@ -0,0 +1 @@ +#include From 8c1addbc752660e95bbf2128d66b8e5bb38d5fc7 Mon Sep 17 00:00:00 2001 From: Tony Luck Date: Fri, 6 Oct 2006 10:09:41 -0700 Subject: [PATCH 038/232] [IA64] Fix breakage from irq change A few missed spots in ia64-land from this gigantic commit: 7d12e780e003f93433d49ce78cfedf4b4c52adc5 Signed-off-by: Tony Luck --- arch/ia64/kernel/irq.c | 5 ++++- arch/ia64/kernel/irq_ia64.c | 7 +++++-- arch/ia64/sn/kernel/sn2/timer_interrupt.c | 2 +- drivers/serial/sn_console.c | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index 7852382de2fa..f07c0864b0b4 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c @@ -194,8 +194,11 @@ void fixup_irqs(void) */ for (irq=0; irq < NR_IRQS; irq++) { if (vectors_in_migration[irq]) { + struct pt_regs *old_regs = set_irq_regs(NULL); + vectors_in_migration[irq]=0; - __do_IRQ(irq, NULL); + __do_IRQ(irq); + set_irq_regs(old_regs); } } diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 7fd3ef9e064d..68339dd0c9e2 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c @@ -226,6 +226,8 @@ void ia64_process_pending_intr(void) */ while (vector != IA64_SPURIOUS_INT_VECTOR) { if (!IS_RESCHEDULE(vector)) { + struct pt_regs *old_regs = set_irq_regs(NULL); + ia64_setreg(_IA64_REG_CR_TPR, vector); ia64_srlz_d(); @@ -236,7 +238,8 @@ void ia64_process_pending_intr(void) * Probably could shared code. */ vectors_in_migration[local_vector_to_irq(vector)]=0; - __do_IRQ(local_vector_to_irq(vector), NULL); + __do_IRQ(local_vector_to_irq(vector)); + set_irq_regs(old_regs); /* * Disable interrupts and send EOI @@ -253,7 +256,7 @@ void ia64_process_pending_intr(void) #ifdef CONFIG_SMP -extern irqreturn_t handle_IPI (int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t handle_IPI (int irq, void *dev_id); static struct irqaction ipi_irqaction = { .handler = handle_IPI, diff --git a/arch/ia64/sn/kernel/sn2/timer_interrupt.c b/arch/ia64/sn/kernel/sn2/timer_interrupt.c index fa7f69945917..103d6ea8e94b 100644 --- a/arch/ia64/sn/kernel/sn2/timer_interrupt.c +++ b/arch/ia64/sn/kernel/sn2/timer_interrupt.c @@ -36,7 +36,7 @@ extern irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); #define SN_LB_INT_WAR_INTERVAL 100 -void sn_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +void sn_timer_interrupt(int irq, void *dev_id) { /* LED blinking */ if (!pda->hb_count--) { diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 709f93a6c18c..956b2cf08e1e 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c @@ -674,7 +674,7 @@ static void sn_sal_timer_poll(unsigned long data) if (!port->sc_port.irq) { spin_lock_irqsave(&port->sc_port.lock, flags); if (sn_process_input) - sn_receive_chars(port, NULL, flags); + sn_receive_chars(port, flags); sn_transmit_chars(port, TRANSMIT_RAW); spin_unlock_irqrestore(&port->sc_port.lock, flags); mod_timer(&port->sc_timer, From 86d91bab4806191a8126502d80d729c2a4765ebe Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 13:32:44 -0400 Subject: [PATCH 039/232] arch/i386/kernel/time: don't shadow 'irq' function arg Signed-off-by: Jeff Garzik --- arch/i386/kernel/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index 3f221f5eb47e..78af572fd17c 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -201,8 +201,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id) high bit of the PPI port B (0x61). Note that some PS/2s, notably the 55SX, work fine if this is removed. */ - irq = inb_p( 0x61 ); /* read the current state */ - outb_p( irq|0x80, 0x61 ); /* reset the IRQ */ + u8 irq_v = inb_p( 0x61 ); /* read the current state */ + outb_p( irq_v|0x80, 0x61 ); /* reset the IRQ */ } write_sequnlock(&xtime_lock); From 0cd61b68c340a4f901a06e8bb5e0dea4353161c0 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 6 Oct 2006 10:53:39 -0700 Subject: [PATCH 040/232] Initial blind fixup for arm for irq changes Untested, but this should fix up the bulk of the totally mechanical issues, and should make the actual detail fixing easier. Signed-off-by: Linus Torvalds --- arch/arm/common/locomo.c | 25 ++++++------- arch/arm/common/sa1111.c | 8 ++--- arch/arm/common/sharpsl_pm.c | 6 ++-- arch/arm/common/time-acorn.c | 4 +-- arch/arm/kernel/ecard.c | 8 ++--- arch/arm/kernel/irq.c | 3 +- arch/arm/kernel/time.c | 3 +- arch/arm/mach-aaec2000/core.c | 4 +-- arch/arm/mach-at91rm9200/at91rm9200_time.c | 4 +-- arch/arm/mach-at91rm9200/gpio.c | 4 +-- arch/arm/mach-clps711x/time.c | 4 +-- arch/arm/mach-clps7500/core.c | 4 +-- arch/arm/mach-ebsa110/core.c | 4 +-- arch/arm/mach-ep93xx/core.c | 10 +++--- arch/arm/mach-footbridge/dc21285-timer.c | 4 +-- arch/arm/mach-footbridge/dc21285.c | 12 +++---- arch/arm/mach-footbridge/isa-irq.c | 6 ++-- arch/arm/mach-footbridge/isa-timer.c | 4 +-- arch/arm/mach-h720x/common.c | 29 +++++++-------- arch/arm/mach-h720x/cpu-h7201.c | 4 +-- arch/arm/mach-h720x/cpu-h7202.c | 11 +++--- arch/arm/mach-imx/dma.c | 12 +++---- arch/arm/mach-imx/irq.c | 24 ++++++------- arch/arm/mach-imx/time.c | 4 +-- arch/arm/mach-integrator/core.c | 6 ++-- arch/arm/mach-integrator/integrator_cp.c | 6 ++-- arch/arm/mach-integrator/pci_v3.c | 3 +- arch/arm/mach-integrator/time.c | 3 +- arch/arm/mach-ixp2000/core.c | 12 +++---- arch/arm/mach-ixp2000/ixdp2x00.c | 4 +-- arch/arm/mach-ixp2000/ixdp2x01.c | 4 +-- arch/arm/mach-ixp23xx/core.c | 8 ++--- arch/arm/mach-ixp23xx/ixdp2351.c | 8 ++--- arch/arm/mach-ixp4xx/common.c | 4 +-- arch/arm/mach-ixp4xx/nas100d-power.c | 2 +- arch/arm/mach-ixp4xx/nslu2-power.c | 4 +-- arch/arm/mach-lh7a40x/arch-kev7a400.c | 5 ++- arch/arm/mach-lh7a40x/arch-lpd7a40x.c | 3 +- arch/arm/mach-lh7a40x/irq-kev7a400.c | 5 ++- arch/arm/mach-lh7a40x/irq-lpd7a40x.c | 3 +- arch/arm/mach-lh7a40x/time.c | 4 +-- arch/arm/mach-netx/generic.c | 5 ++- arch/arm/mach-netx/time.c | 4 +-- arch/arm/mach-omap1/board-osk.c | 2 +- arch/arm/mach-omap1/fpga.c | 5 ++- arch/arm/mach-omap1/pm.c | 3 +- arch/arm/mach-omap1/serial.c | 3 +- arch/arm/mach-omap1/time.c | 8 ++--- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/timer-gp.c | 5 ++- arch/arm/mach-pnx4008/dma.c | 10 +++--- arch/arm/mach-pnx4008/time.c | 5 ++- arch/arm/mach-pxa/corgi.c | 2 +- arch/arm/mach-pxa/dma.c | 8 ++--- arch/arm/mach-pxa/idp.c | 2 +- arch/arm/mach-pxa/irq.c | 11 +++--- arch/arm/mach-pxa/lpd270.c | 5 ++- arch/arm/mach-pxa/lubbock.c | 13 ++++--- arch/arm/mach-pxa/mainstone.c | 7 ++-- arch/arm/mach-pxa/poodle.c | 2 +- arch/arm/mach-pxa/spitz.c | 2 +- arch/arm/mach-pxa/ssp.c | 2 +- arch/arm/mach-pxa/time.c | 8 ++--- arch/arm/mach-pxa/tosa.c | 2 +- arch/arm/mach-pxa/trizeps4.c | 2 +- arch/arm/mach-realview/core.c | 6 ++-- arch/arm/mach-rpc/dma.c | 2 +- arch/arm/mach-s3c2410/bast-irq.c | 5 ++- arch/arm/mach-s3c2410/dma.c | 2 +- arch/arm/mach-s3c2410/irq.c | 41 +++++++++------------- arch/arm/mach-s3c2410/mach-amlm5900.c | 2 +- arch/arm/mach-s3c2410/s3c2440-irq.c | 7 ++-- arch/arm/mach-s3c2410/s3c244x-irq.c | 7 ++-- arch/arm/mach-s3c2410/time.c | 4 +-- arch/arm/mach-s3c2410/usb-simtec.c | 2 +- arch/arm/mach-sa1100/dma.c | 2 +- arch/arm/mach-sa1100/h3600.c | 6 ++-- arch/arm/mach-sa1100/irq.c | 5 ++- arch/arm/mach-sa1100/neponset.c | 8 ++--- arch/arm/mach-sa1100/ssp.c | 2 +- arch/arm/mach-sa1100/time.c | 8 ++--- arch/arm/mach-shark/core.c | 4 +-- arch/arm/mach-shark/irq.c | 2 +- arch/arm/mach-versatile/core.c | 10 +++--- arch/arm/oprofile/op_model_xscale.c | 4 +-- arch/arm/plat-iop/time.c | 4 +-- arch/arm/plat-omap/dma.c | 9 ++--- arch/arm/plat-omap/gpio.c | 5 ++- arch/arm/plat-omap/mcbsp.c | 4 +-- arch/arm/plat-omap/timer32k.c | 15 ++++---- include/asm-arm/arch-clps711x/time.h | 3 +- include/asm-arm/arch-imx/imx-dma.h | 8 ++--- include/asm-arm/arch-l7200/time.h | 3 +- include/asm-arm/arch-pnx4008/dma.h | 2 +- include/asm-arm/arch-pxa/dma.h | 2 +- include/asm-arm/arch-pxa/mmc.h | 2 +- include/asm-arm/hardware/sharpsl_pm.h | 6 ++-- include/asm-arm/irq_regs.h | 1 + include/asm-arm/mach/irq.h | 9 +++-- include/asm-arm/mach/time.h | 4 +-- 100 files changed, 281 insertions(+), 328 deletions(-) create mode 100644 include/asm-arm/irq_regs.h diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 181ef1ead5b8..80a72c75214f 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -163,8 +163,7 @@ static struct locomo_dev_info locomo_devices[] = { #define LOCOMO_IRQ_LT_START (IRQ_LOCOMO_LT) #define LOCOMO_IRQ_SPI_START (IRQ_LOCOMO_SPI_RFR) -static void locomo_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void locomo_handler(unsigned int irq, struct irqdesc *desc) { int req, i; struct irqdesc *d; @@ -182,7 +181,7 @@ static void locomo_handler(unsigned int irq, struct irqdesc *desc, d = irq_desc + irq; for (i = 0; i <= 3; i++, d++, irq++) { if (req & (0x0100 << i)) { - desc_handle_irq(irq, d, regs); + desc_handle_irq(irq, d); } } @@ -218,15 +217,14 @@ static struct irq_chip locomo_chip = { .unmask = locomo_unmask_irq, }; -static void locomo_key_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void locomo_key_handler(unsigned int irq, struct irqdesc *desc) { struct irqdesc *d; void __iomem *mapbase = get_irq_chipdata(irq); if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { d = irq_desc + LOCOMO_IRQ_KEY_START; - desc_handle_irq(LOCOMO_IRQ_KEY_START, d, regs); + desc_handle_irq(LOCOMO_IRQ_KEY_START, d); } } @@ -264,8 +262,7 @@ static struct irq_chip locomo_key_chip = { .unmask = locomo_key_unmask_irq, }; -static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc) { int req, i; struct irqdesc *d; @@ -280,7 +277,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc, d = irq_desc + LOCOMO_IRQ_GPIO_START; for (i = 0; i <= 15; i++, irq++, d++) { if (req & (0x0001 << i)) { - desc_handle_irq(irq, d, regs); + desc_handle_irq(irq, d); } } } @@ -328,15 +325,14 @@ static struct irq_chip locomo_gpio_chip = { .unmask = locomo_gpio_unmask_irq, }; -static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc) { struct irqdesc *d; void __iomem *mapbase = get_irq_chipdata(irq); if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { d = irq_desc + LOCOMO_IRQ_LT_START; - desc_handle_irq(LOCOMO_IRQ_LT_START, d, regs); + desc_handle_irq(LOCOMO_IRQ_LT_START, d); } } @@ -374,8 +370,7 @@ static struct irq_chip locomo_lt_chip = { .unmask = locomo_lt_unmask_irq, }; -static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc) { int req, i; struct irqdesc *d; @@ -388,7 +383,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc, for (i = 0; i <= 3; i++, irq++, d++) { if (req & (0x0001 << i)) { - desc_handle_irq(irq, d, regs); + desc_handle_irq(irq, d); } } } diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 30046ad41ced..d5f72010a6f3 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -147,7 +147,7 @@ void __init sa1111_adjust_zones(int node, unsigned long *size, unsigned long *ho * will call us again if there are more interrupts to process. */ static void -sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +sa1111_irq_handler(unsigned int irq, struct irqdesc *desc) { unsigned int stat0, stat1, i; void __iomem *base = get_irq_data(irq); @@ -162,17 +162,17 @@ sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) sa1111_writel(stat1, base + SA1111_INTSTATCLR1); if (stat0 == 0 && stat1 == 0) { - do_bad_IRQ(irq, desc, regs); + do_bad_IRQ(irq, desc); return; } for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1) if (stat0 & 1) - handle_edge_irq(i, irq_desc + i, regs); + handle_edge_irq(i, irq_desc + i); for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1) if (stat1 & 1) - handle_edge_irq(i, irq_desc + i, regs); + handle_edge_irq(i, irq_desc + i); /* For level-based interrupts */ desc->chip->unmask(irq); diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c index f412dedda684..605dedf96790 100644 --- a/arch/arm/common/sharpsl_pm.c +++ b/arch/arm/common/sharpsl_pm.c @@ -258,7 +258,7 @@ static void sharpsl_ac_timer(unsigned long data) } -irqreturn_t sharpsl_ac_isr(int irq, void *dev_id, struct pt_regs *fp) +irqreturn_t sharpsl_ac_isr(int irq, void *dev_id) { /* Delay the event slightly to debounce */ /* Must be a smaller delay than the chrg_full_isr below */ @@ -293,7 +293,7 @@ static void sharpsl_chrg_full_timer(unsigned long data) /* Charging Finished Interrupt (Not present on Corgi) */ /* Can trigger at the same time as an AC staus change so delay until after that has been processed */ -irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id, struct pt_regs *fp) +irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id) { if (sharpsl_pm.flags & SHARPSL_SUSPENDED) return IRQ_HANDLED; @@ -304,7 +304,7 @@ irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id, struct pt_regs *fp) return IRQ_HANDLED; } -irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id, struct pt_regs *fp) +irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id) { int is_fatal = 0; diff --git a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c index 3f60dd9aca80..34038eccbba9 100644 --- a/arch/arm/common/time-acorn.c +++ b/arch/arm/common/time-acorn.c @@ -67,10 +67,10 @@ void __init ioctime_init(void) } static irqreturn_t -ioc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +ioc_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); return IRQ_HANDLED; } diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index 3e14b1348c0b..b27513a0f11e 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c @@ -567,7 +567,7 @@ static void ecard_check_lockup(struct irqdesc *desc) } static void -ecard_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +ecard_irq_handler(unsigned int irq, struct irqdesc *desc) { ecard_t *ec; int called = 0; @@ -586,7 +586,7 @@ ecard_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) if (pending) { struct irqdesc *d = irq_desc + ec->irq; - desc_handle_irq(ec->irq, d, regs); + desc_handle_irq(ec->irq, d); called ++; } } @@ -609,7 +609,7 @@ static unsigned char first_set[] = }; static void -ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc) { const unsigned int statusmask = 15; unsigned int status; @@ -633,7 +633,7 @@ ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg * Serial cards should go in 0/1, ethernet/scsi in 2/3 * otherwise you will lose serial data at high speeds! */ - desc_handle_irq(ec->irq, d, regs); + desc_handle_irq(ec->irq, d); } else { printk(KERN_WARNING "card%d: interrupt from unclaimed " "card???\n", slot); diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 2e1bf830fe11..e999b11de2c6 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -122,7 +122,8 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) irq_enter(); - desc_handle_irq(irq, desc, regs); + set_irq_regs(regs); + desc_handle_irq(irq, desc); /* AT91 specific workaround */ irq_finish(irq); diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index b030320b17c7..b094e3e81981 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -324,8 +324,9 @@ EXPORT_SYMBOL(restore_time_delta); /* * Kernel system timer support. */ -void timer_tick(struct pt_regs *regs) +void timer_tick(void) { + struct pt_regs *regs = get_irq_regs(); profile_tick(CPU_PROFILING, regs); do_leds(); do_set_rtc(); diff --git a/arch/arm/mach-aaec2000/core.c b/arch/arm/mach-aaec2000/core.c index baa997c857dc..fe3d297d682d 100644 --- a/arch/arm/mach-aaec2000/core.c +++ b/arch/arm/mach-aaec2000/core.c @@ -127,12 +127,12 @@ static unsigned long aaec2000_gettimeoffset(void) /* We enter here with IRQs enabled */ static irqreturn_t -aaec2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +aaec2000_timer_interrupt(int irq, void *dev_id) { /* TODO: Check timer accuracy */ write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); TIMER1_CLEAR = 1; write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-at91rm9200/at91rm9200_time.c b/arch/arm/mach-at91rm9200/at91rm9200_time.c index a92a8622c78a..07c9cea8961d 100644 --- a/arch/arm/mach-at91rm9200/at91rm9200_time.c +++ b/arch/arm/mach-at91rm9200/at91rm9200_time.c @@ -65,13 +65,13 @@ static unsigned long at91rm9200_gettimeoffset(void) /* * IRQ handler for the timer. */ -static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) { if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */ write_seqlock(&xtime_lock); while (((read_CRTR() - last_crtr) & AT91_ST_ALMV) >= LATCH) { - timer_tick(regs); + timer_tick(); last_crtr = (last_crtr + LATCH) & AT91_ST_ALMV; } diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c index 58c9bf5e9520..7467d644f0a3 100644 --- a/arch/arm/mach-at91rm9200/gpio.c +++ b/arch/arm/mach-at91rm9200/gpio.c @@ -332,7 +332,7 @@ static struct irq_chip gpio_irqchip = { .set_wake = gpio_irq_set_wake, }; -static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs *regs) +static void gpio_irq_handler(unsigned irq, struct irqdesc *desc) { unsigned pin; struct irqdesc *gpio; @@ -363,7 +363,7 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs gpio_irq_mask(pin); } else - desc_handle_irq(pin, gpio, regs); + desc_handle_irq(pin, gpio); } pin++; gpio++; diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c index a071eac4a30a..428493dd4687 100644 --- a/arch/arm/mach-clps711x/time.c +++ b/arch/arm/mach-clps711x/time.c @@ -48,10 +48,10 @@ static unsigned long clps711x_gettimeoffset(void) * IRQ handler for the timer */ static irqreturn_t -p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +p720t_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); return IRQ_HANDLED; } diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c index 92eaebdd5606..fb10cf252588 100644 --- a/arch/arm/mach-clps7500/core.c +++ b/arch/arm/mach-clps7500/core.c @@ -292,11 +292,11 @@ extern void ioctime_init(void); extern unsigned long ioc_timer_gettimeoffset(void); static irqreturn_t -clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +clps7500_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); /* Why not using do_leds interface?? */ { diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c index 70dd12ef3c40..90103ab373a6 100644 --- a/arch/arm/mach-ebsa110/core.c +++ b/arch/arm/mach-ebsa110/core.c @@ -174,7 +174,7 @@ static unsigned long ebsa110_gettimeoffset(void) } static irqreturn_t -ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +ebsa110_timer_interrupt(int irq, void *dev_id) { u32 count; @@ -190,7 +190,7 @@ ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) __raw_writeb(count & 0xff, PIT_T1); __raw_writeb(count >> 8, PIT_T1); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index a87a784b9201..e3fd1ab6adcc 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -97,7 +97,7 @@ static unsigned int last_jiffy_time; #define TIMER4_TICKS_PER_JIFFY ((CLOCK_TICK_RATE + (HZ/2)) / HZ) -static int ep93xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static int ep93xx_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); @@ -106,7 +106,7 @@ static int ep93xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time) >= TIMER4_TICKS_PER_JIFFY) { last_jiffy_time += TIMER4_TICKS_PER_JIFFY; - timer_tick(regs); + timer_tick(); } write_sequnlock(&xtime_lock); @@ -245,7 +245,7 @@ EXPORT_SYMBOL(gpio_line_set); * EP93xx IRQ handling *************************************************************************/ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, - struct irqdesc *desc, struct pt_regs *regs) + struct irqdesc *desc) { unsigned char status; int i; @@ -254,7 +254,7 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, for (i = 0; i < 8; i++) { if (status & (1 << i)) { desc = irq_desc + IRQ_EP93XX_GPIO(0) + i; - desc_handle_irq(IRQ_EP93XX_GPIO(0) + i, desc, regs); + desc_handle_irq(IRQ_EP93XX_GPIO(0) + i, desc); } } @@ -262,7 +262,7 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, for (i = 0; i < 8; i++) { if (status & (1 << i)) { desc = irq_desc + IRQ_EP93XX_GPIO(8) + i; - desc_handle_irq(IRQ_EP93XX_GPIO(8) + i, desc, regs); + desc_handle_irq(IRQ_EP93XX_GPIO(8) + i, desc); } } } diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c index 2af610811ca4..fa6be870c6c2 100644 --- a/arch/arm/mach-footbridge/dc21285-timer.c +++ b/arch/arm/mach-footbridge/dc21285-timer.c @@ -28,13 +28,13 @@ static unsigned long timer1_gettimeoffset (void) } static irqreturn_t -timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) +timer1_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); *CSR_TIMER1_CLR = 0; - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index a1ae49df5c3b..fa5d4976f514 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c @@ -154,7 +154,7 @@ static void dc21285_enable_error(unsigned long __data) /* * Warn on PCI errors. */ -static irqreturn_t dc21285_abort_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dc21285_abort_irq(int irq, void *dev_id) { unsigned int cmd; unsigned int status; @@ -165,7 +165,7 @@ static irqreturn_t dc21285_abort_irq(int irq, void *dev_id, struct pt_regs *regs if (status & PCI_STATUS_REC_MASTER_ABORT) { printk(KERN_DEBUG "PCI: master abort, pc=0x%08lx\n", - instruction_pointer(regs)); + instruction_pointer(get_irq_regs())); cmd |= PCI_STATUS_REC_MASTER_ABORT << 16; } @@ -184,7 +184,7 @@ static irqreturn_t dc21285_abort_irq(int irq, void *dev_id, struct pt_regs *regs return IRQ_HANDLED; } -static irqreturn_t dc21285_serr_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dc21285_serr_irq(int irq, void *dev_id) { struct timer_list *timer = dev_id; unsigned int cntl; @@ -206,7 +206,7 @@ static irqreturn_t dc21285_serr_irq(int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -static irqreturn_t dc21285_discard_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dc21285_discard_irq(int irq, void *dev_id) { printk(KERN_DEBUG "PCI: discard timer expired\n"); *CSR_SA110_CNTL &= 0xffffde07; @@ -214,7 +214,7 @@ static irqreturn_t dc21285_discard_irq(int irq, void *dev_id, struct pt_regs *re return IRQ_HANDLED; } -static irqreturn_t dc21285_dparity_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dc21285_dparity_irq(int irq, void *dev_id) { unsigned int cmd; @@ -228,7 +228,7 @@ static irqreturn_t dc21285_dparity_irq(int irq, void *dev_id, struct pt_regs *re return IRQ_HANDLED; } -static irqreturn_t dc21285_parity_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dc21285_parity_irq(int irq, void *dev_id) { struct timer_list *timer = dev_id; unsigned int cmd; diff --git a/arch/arm/mach-footbridge/isa-irq.c b/arch/arm/mach-footbridge/isa-irq.c index 87448c2d6baa..888dedd501b9 100644 --- a/arch/arm/mach-footbridge/isa-irq.c +++ b/arch/arm/mach-footbridge/isa-irq.c @@ -85,17 +85,17 @@ static struct irqchip isa_hi_chip = { }; static void -isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +isa_irq_handler(unsigned int irq, struct irqdesc *desc) { unsigned int isa_irq = *(unsigned char *)PCIIACK_BASE; if (isa_irq < _ISA_IRQ(0) || isa_irq >= _ISA_IRQ(16)) { - do_bad_IRQ(isa_irq, desc, regs); + do_bad_IRQ(isa_irq, desc); return; } desc = irq_desc + isa_irq; - desc_handle_irq(isa_irq, desc, regs); + desc_handle_irq(isa_irq, desc); } static struct irqaction irq_cascade = { diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c index c4810a40c8e1..d884a3954fb4 100644 --- a/arch/arm/mach-footbridge/isa-timer.c +++ b/arch/arm/mach-footbridge/isa-timer.c @@ -62,10 +62,10 @@ static unsigned long isa_gettimeoffset(void) } static irqreturn_t -isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +isa_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); return IRQ_HANDLED; } diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c index c096b4569308..4719229a1a78 100644 --- a/arch/arm/mach-h720x/common.c +++ b/arch/arm/mach-h720x/common.c @@ -101,14 +101,14 @@ static void inline unmask_gpio_irq(u32 irq) static void h720x_gpio_handler(unsigned int mask, unsigned int irq, - struct irqdesc *desc, struct pt_regs *regs) + struct irqdesc *desc) { IRQDBG("%s irq: %d\n",__FUNCTION__,irq); desc = irq_desc + irq; while (mask) { if (mask & 1) { IRQDBG("handling irq %d\n", irq); - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); } irq++; desc++; @@ -117,63 +117,58 @@ h720x_gpio_handler(unsigned int mask, unsigned int irq, } static void -h720x_gpioa_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +h720x_gpioa_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = CPU_REG(GPIO_A_VIRT,GPIO_STAT); irq = IRQ_CHAINED_GPIOA(0); IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); - h720x_gpio_handler(mask, irq, desc, regs); + h720x_gpio_handler(mask, irq, desc); } static void -h720x_gpiob_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +h720x_gpiob_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = CPU_REG(GPIO_B_VIRT,GPIO_STAT); irq = IRQ_CHAINED_GPIOB(0); IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); - h720x_gpio_handler(mask, irq, desc, regs); + h720x_gpio_handler(mask, irq, desc); } static void -h720x_gpioc_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +h720x_gpioc_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = CPU_REG(GPIO_C_VIRT,GPIO_STAT); irq = IRQ_CHAINED_GPIOC(0); IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); - h720x_gpio_handler(mask, irq, desc, regs); + h720x_gpio_handler(mask, irq, desc); } static void -h720x_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +h720x_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = CPU_REG(GPIO_D_VIRT,GPIO_STAT); irq = IRQ_CHAINED_GPIOD(0); IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); - h720x_gpio_handler(mask, irq, desc, regs); + h720x_gpio_handler(mask, irq, desc); } #ifdef CONFIG_CPU_H7202 static void -h720x_gpioe_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +h720x_gpioe_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = CPU_REG(GPIO_E_VIRT,GPIO_STAT); irq = IRQ_CHAINED_GPIOE(0); IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq); - h720x_gpio_handler(mask, irq, desc, regs); + h720x_gpio_handler(mask, irq, desc); } #endif diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c index a9a8255a3a03..13f76bdb3d9d 100644 --- a/arch/arm/mach-h720x/cpu-h7201.c +++ b/arch/arm/mach-h720x/cpu-h7201.c @@ -27,12 +27,12 @@ * Timer interrupt handler */ static irqreturn_t -h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +h7201_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); CPU_REG (TIMER_VIRT, TIMER_TOPSTAT); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c index da678d163fd9..06fecaefd8dc 100644 --- a/arch/arm/mach-h720x/cpu-h7202.c +++ b/arch/arm/mach-h720x/cpu-h7202.c @@ -106,8 +106,7 @@ static struct platform_device *devices[] __initdata = { * we have to handle all timer interrupts in one place. */ static void -h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; @@ -115,7 +114,7 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc, if ( mask & TSTAT_T0INT ) { write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); if( mask == TSTAT_T0INT ) return; @@ -126,7 +125,7 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc, desc = irq_desc + irq; while (mask) { if (mask & 1) - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); irq++; desc++; mask >>= 1; @@ -137,9 +136,9 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc, * Timer interrupt handler */ static irqreturn_t -h7202_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +h7202_timer_interrupt(int irq, void *dev_id) { - h7202_timerx_demux_handler(0, NULL, regs); + h7202_timerx_demux_handler(0, NULL); return IRQ_HANDLED; } diff --git a/arch/arm/mach-imx/dma.c b/arch/arm/mach-imx/dma.c index 36578871ecc8..6d50d85a618c 100644 --- a/arch/arm/mach-imx/dma.c +++ b/arch/arm/mach-imx/dma.c @@ -279,8 +279,8 @@ imx_dma_setup_sg(imx_dmach_t dma_ch, */ int imx_dma_setup_handlers(imx_dmach_t dma_ch, - void (*irq_handler) (int, void *, struct pt_regs *), - void (*err_handler) (int, void *, struct pt_regs *, int), + void (*irq_handler) (int, void *), + void (*err_handler) (int, void *, int), void *data) { struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; @@ -461,7 +461,7 @@ imx_dma_request_by_prio(imx_dmach_t * pdma_ch, const char *name, return -ENODEV; } -static irqreturn_t dma_err_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dma_err_handler(int irq, void *dev_id) { int i, disr = DISR; struct imx_dma_channel *channel; @@ -500,7 +500,7 @@ static irqreturn_t dma_err_handler(int irq, void *dev_id, struct pt_regs *regs) /*imx_dma_channels[i].sg = NULL;*/ if (channel->name && channel->err_handler) { - channel->err_handler(i, channel->data, regs, errcode); + channel->err_handler(i, channel->data, errcode); continue; } @@ -517,7 +517,7 @@ static irqreturn_t dma_err_handler(int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dma_irq_handler(int irq, void *dev_id) { int i, disr = DISR; @@ -536,7 +536,7 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) } else { if (channel->irq_handler) channel->irq_handler(i, - channel->data, regs); + channel->data); } } else { /* diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c index 2688bd82c2a2..368b13b058ab 100644 --- a/arch/arm/mach-imx/irq.c +++ b/arch/arm/mach-imx/irq.c @@ -146,13 +146,13 @@ imx_gpio_unmask_irq(unsigned int irq) static void imx_gpio_handler(unsigned int mask, unsigned int irq, - struct irqdesc *desc, struct pt_regs *regs) + struct irqdesc *desc) { desc = irq_desc + irq; while (mask) { if (mask & 1) { DEBUG_IRQ("handling irq %d\n", irq); - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); } irq++; desc++; @@ -161,47 +161,43 @@ imx_gpio_handler(unsigned int mask, unsigned int irq, } static void -imx_gpioa_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +imx_gpioa_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = ISR(0); irq = IRQ_GPIOA(0); - imx_gpio_handler(mask, irq, desc, regs); + imx_gpio_handler(mask, irq, desc); } static void -imx_gpiob_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +imx_gpiob_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = ISR(1); irq = IRQ_GPIOB(0); - imx_gpio_handler(mask, irq, desc, regs); + imx_gpio_handler(mask, irq, desc); } static void -imx_gpioc_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +imx_gpioc_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = ISR(2); irq = IRQ_GPIOC(0); - imx_gpio_handler(mask, irq, desc, regs); + imx_gpio_handler(mask, irq, desc); } static void -imx_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +imx_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int mask, irq; mask = ISR(3); irq = IRQ_GPIOD(0); - imx_gpio_handler(mask, irq, desc, regs); + imx_gpio_handler(mask, irq, desc); } static struct irq_chip imx_internal_chip = { diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index 6ed7523c65bb..8ae4a2c5066f 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c @@ -56,7 +56,7 @@ static unsigned long imx_gettimeoffset(void) * IRQ handler for the timer */ static irqreturn_t -imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +imx_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); @@ -64,7 +64,7 @@ imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) if (IMX_TSTAT(TIMER_BASE)) IMX_TSTAT(TIMER_BASE) = 0; - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); return IRQ_HANDLED; diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 42021fdfa0c6..8d880cb9ba39 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -248,7 +248,7 @@ unsigned long integrator_gettimeoffset(void) * IRQ handler for the timer */ static irqreturn_t -integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +integrator_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); @@ -262,7 +262,7 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * primary CPU */ if (hard_smp_processor_id() == 0) { - timer_tick(regs); + timer_tick(); #ifdef CONFIG_SMP smp_send_timer(); #endif @@ -272,7 +272,7 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* * this is the ARM equivalent of the APIC timer interrupt */ - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif /* CONFIG_SMP */ write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 678b6ba2b463..771b65bffe69 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -202,12 +202,12 @@ static struct irq_chip sic_chip = { }; static void -sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +sic_handle_irq(unsigned int irq, struct irqdesc *desc) { unsigned long status = sic_readl(INTCP_VA_SIC_BASE + IRQ_STATUS); if (status == 0) { - do_bad_IRQ(irq, desc, regs); + do_bad_IRQ(irq, desc); return; } @@ -218,7 +218,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) irq += IRQ_SIC_START; desc = irq_desc + irq; - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); } while (status); } diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index 4418f6d7572d..fb8c6d97b22b 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c @@ -440,9 +440,10 @@ v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) return 1; } -static irqreturn_t v3_irq(int irq, void *devid, struct pt_regs *regs) +static irqreturn_t v3_irq(int irq, void *devid) { #ifdef CONFIG_DEBUG_LL + struct pt_regs *regs = get_irq_regs(); unsigned long pc = instruction_pointer(regs); unsigned long instr = *(unsigned long *)pc; char buf[128]; diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c index ee49cf790dab..5278f589fcee 100644 --- a/arch/arm/mach-integrator/time.c +++ b/arch/arm/mach-integrator/time.c @@ -96,8 +96,7 @@ static struct rtc_ops rtc_ops = { .set_alarm = integrator_rtc_set_alarm, }; -static irqreturn_t arm_rtc_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t arm_rtc_interrupt(int irq, void *dev_id) { writel(0, rtc_base + RTC_EOI); return IRQ_HANDLED; diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c index 7f91f689a041..22c98e9dad28 100644 --- a/arch/arm/mach-ixp2000/core.c +++ b/arch/arm/mach-ixp2000/core.c @@ -204,7 +204,7 @@ unsigned long ixp2000_gettimeoffset (void) return offset / ticks_per_usec; } -static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static int ixp2000_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); @@ -213,7 +213,7 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) while ((signed long)(next_jiffy_time - *missing_jiffy_timer_csr) >= ticks_per_jiffy) { - timer_tick(regs); + timer_tick(); next_jiffy_time -= ticks_per_jiffy; } @@ -308,7 +308,7 @@ EXPORT_SYMBOL(gpio_line_config); /************************************************************************* * IRQ handling IXP2000 *************************************************************************/ -static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc) { int i; unsigned long status = *IXP2000_GPIO_INST; @@ -316,7 +316,7 @@ static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, str for (i = 0; i <= 7; i++) { if (status & (1<= 0; i--) { if(status & (1 << i)) { desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i; - desc_handle_irq(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs); + desc_handle_irq(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc); } } } diff --git a/arch/arm/mach-ixp2000/ixdp2x00.c b/arch/arm/mach-ixp2000/ixdp2x00.c index 40eef8b36740..af48cb52dfc4 100644 --- a/arch/arm/mach-ixp2000/ixdp2x00.c +++ b/arch/arm/mach-ixp2000/ixdp2x00.c @@ -106,7 +106,7 @@ static void ixdp2x00_irq_unmask(unsigned int irq) ixp2000_release_slowport(&old_cfg); } -static void ixdp2x00_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +static void ixdp2x00_irq_handler(unsigned int irq, struct irqdesc *desc) { volatile u32 ex_interrupt = 0; static struct slowport_cfg old_cfg; @@ -132,7 +132,7 @@ static void ixdp2x00_irq_handler(unsigned int irq, struct irqdesc *desc, struct struct irqdesc *cpld_desc; int cpld_irq = IXP2000_BOARD_IRQ(0) + i; cpld_desc = irq_desc + cpld_irq; - desc_handle_irq(cpld_irq, cpld_desc, regs); + desc_handle_irq(cpld_irq, cpld_desc); } } diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c index 7f42366f60d1..9ccae9e63f70 100644 --- a/arch/arm/mach-ixp2000/ixdp2x01.c +++ b/arch/arm/mach-ixp2000/ixdp2x01.c @@ -63,7 +63,7 @@ static void ixdp2x01_irq_unmask(unsigned int irq) static u32 valid_irq_mask; -static void ixdp2x01_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +static void ixdp2x01_irq_handler(unsigned int irq, struct irqdesc *desc) { u32 ex_interrupt; int i; @@ -82,7 +82,7 @@ static void ixdp2x01_irq_handler(unsigned int irq, struct irqdesc *desc, struct struct irqdesc *cpld_desc; int cpld_irq = IXP2000_BOARD_IRQ(0) + i; cpld_desc = irq_desc + cpld_irq; - desc_handle_irq(cpld_irq, cpld_desc, regs); + desc_handle_irq(cpld_irq, cpld_desc); } } diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c index 566a07821c77..a704a1820048 100644 --- a/arch/arm/mach-ixp23xx/core.c +++ b/arch/arm/mach-ixp23xx/core.c @@ -251,7 +251,7 @@ static void ixp23xx_pci_irq_unmask(unsigned int irq) /* * TODO: Should this just be done at ASM level? */ -static void pci_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +static void pci_handler(unsigned int irq, struct irqdesc *desc) { u32 pci_interrupt; unsigned int irqno; @@ -271,7 +271,7 @@ static void pci_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs * } int_desc = irq_desc + irqno; - desc_handle_irq(irqno, int_desc, regs); + desc_handle_irq(irqno, int_desc); desc->chip->unmask(irq); } @@ -348,12 +348,12 @@ ixp23xx_gettimeoffset(void) } static irqreturn_t -ixp23xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +ixp23xx_timer_interrupt(int irq, void *dev_id) { /* Clear Pending Interrupt by writing '1' to it */ *IXP23XX_TIMER_STATUS = IXP23XX_TIMER1_INT_PEND; while ((signed long)(*IXP23XX_TIMER_CONT - next_jiffy_time) >= LATCH) { - timer_tick(regs); + timer_tick(); next_jiffy_time += LATCH; } diff --git a/arch/arm/mach-ixp23xx/ixdp2351.c b/arch/arm/mach-ixp23xx/ixdp2351.c index 37a32e6bcca2..b6ab0e8bb5e8 100644 --- a/arch/arm/mach-ixp23xx/ixdp2351.c +++ b/arch/arm/mach-ixp23xx/ixdp2351.c @@ -60,7 +60,7 @@ static void ixdp2351_inta_unmask(unsigned int irq) *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(irq); } -static void ixdp2351_inta_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +static void ixdp2351_inta_handler(unsigned int irq, struct irqdesc *desc) { u16 ex_interrupt = *IXDP2351_CPLD_INTA_STAT_REG & IXDP2351_INTA_IRQ_VALID; @@ -74,7 +74,7 @@ static void ixdp2351_inta_handler(unsigned int irq, struct irqdesc *desc, struct int cpld_irq = IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE + i); cpld_desc = irq_desc + cpld_irq; - desc_handle_irq(cpld_irq, cpld_desc, regs); + desc_handle_irq(cpld_irq, cpld_desc); } } @@ -97,7 +97,7 @@ static void ixdp2351_intb_unmask(unsigned int irq) *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(irq); } -static void ixdp2351_intb_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +static void ixdp2351_intb_handler(unsigned int irq, struct irqdesc *desc) { u16 ex_interrupt = *IXDP2351_CPLD_INTB_STAT_REG & IXDP2351_INTB_IRQ_VALID; @@ -111,7 +111,7 @@ static void ixdp2351_intb_handler(unsigned int irq, struct irqdesc *desc, struct int cpld_irq = IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE + i); cpld_desc = irq_desc + cpld_irq; - desc_handle_irq(cpld_irq, cpld_desc, regs); + desc_handle_irq(cpld_irq, cpld_desc); } } diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 35dd8b3824b0..c7513f6eb50c 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c @@ -256,7 +256,7 @@ static unsigned volatile last_jiffy_time; #define CLOCK_TICKS_PER_USEC ((CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC) -static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); @@ -267,7 +267,7 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs * Catch up with the real idea of time */ while ((signed long)(*IXP4XX_OSTS - last_jiffy_time) >= LATCH) { - timer_tick(regs); + timer_tick(); last_jiffy_time += LATCH; } diff --git a/arch/arm/mach-ixp4xx/nas100d-power.c b/arch/arm/mach-ixp4xx/nas100d-power.c index 81ffcae1f56e..29aa98d3a7fa 100644 --- a/arch/arm/mach-ixp4xx/nas100d-power.c +++ b/arch/arm/mach-ixp4xx/nas100d-power.c @@ -24,7 +24,7 @@ #include -static irqreturn_t nas100d_reset_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t nas100d_reset_handler(int irq, void *dev_id) { /* Signal init to do the ctrlaltdel action, this will bypass init if * it hasn't started and do a kernel_restart. diff --git a/arch/arm/mach-ixp4xx/nslu2-power.c b/arch/arm/mach-ixp4xx/nslu2-power.c index a29b3b2b61b6..acd71e9c38a7 100644 --- a/arch/arm/mach-ixp4xx/nslu2-power.c +++ b/arch/arm/mach-ixp4xx/nslu2-power.c @@ -25,7 +25,7 @@ #include -static irqreturn_t nslu2_power_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t nslu2_power_handler(int irq, void *dev_id) { /* Signal init to do the ctrlaltdel action, this will bypass init if * it hasn't started and do a kernel_restart. @@ -35,7 +35,7 @@ static irqreturn_t nslu2_power_handler(int irq, void *dev_id, struct pt_regs *re return IRQ_HANDLED; } -static irqreturn_t nslu2_reset_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t nslu2_reset_handler(int irq, void *dev_id) { /* This is the paper-clip reset, it shuts the machine down directly. */ diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c index 4f2ab48800a5..15fbcc911fe7 100644 --- a/arch/arm/mach-lh7a40x/arch-kev7a400.c +++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c @@ -71,14 +71,13 @@ static struct irq_chip kev7a400_cpld_chip = { }; -static void kev7a400_cpld_handler (unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void kev7a400_cpld_handler (unsigned int irq, struct irqdesc *desc) { u32 mask = CPLD_LATCHED_INTS; irq = IRQ_KEV7A400_CPLD; for (; mask; mask >>= 1, ++irq) { if (mask & 1) - desc[irq].handle (irq, desc, regs); + desc[irq].handle (irq, desc); } } diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c index a21b12f06c6b..8441e0a156cb 100644 --- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c +++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c @@ -207,8 +207,7 @@ static struct irq_chip lpd7a40x_cpld_chip = { .unmask = lh7a40x_unmask_cpld_irq, }; -static void lpd7a40x_cpld_handler (unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void lpd7a40x_cpld_handler (unsigned int irq, struct irqdesc *desc) { unsigned int mask = CPLD_INTERRUPTS; diff --git a/arch/arm/mach-lh7a40x/irq-kev7a400.c b/arch/arm/mach-lh7a40x/irq-kev7a400.c index f9b3fe9174a5..646071334b8f 100644 --- a/arch/arm/mach-lh7a40x/irq-kev7a400.c +++ b/arch/arm/mach-lh7a40x/irq-kev7a400.c @@ -51,14 +51,13 @@ irq_chip lh7a400_cpld_chip = { }; static void -lh7a400_cpld_handler (unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +lh7a400_cpld_handler (unsigned int irq, struct irqdesc *desc) { u32 mask = CPLD_LATCHED_INTS; irq = IRQ_KEV_7A400_CPLD; for (; mask; mask >>= 1, ++irq) { if (mask & 1) - desc[irq].handle (irq, desc, regs); + desc[irq].handle (irq, desc); } } diff --git a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c index d6055dde6468..b20376804bbb 100644 --- a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c +++ b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c @@ -57,8 +57,7 @@ static struct irq_chip lh7a40x_cpld_chip = { .unmask = lh7a40x_unmask_cpld_irq, }; -static void lh7a40x_cpld_handler (unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void lh7a40x_cpld_handler (unsigned int irq, struct irqdesc *desc) { unsigned int mask = CPLD_INTERRUPTS; diff --git a/arch/arm/mach-lh7a40x/time.c b/arch/arm/mach-lh7a40x/time.c index ad5652e01507..bef3c4b68d3b 100644 --- a/arch/arm/mach-lh7a40x/time.c +++ b/arch/arm/mach-lh7a40x/time.c @@ -39,12 +39,12 @@ #endif static irqreturn_t -lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +lh7a40x_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); TIMER_EOI = 0; - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c index af0b13534cfd..edbbbdc3b06b 100644 --- a/arch/arm/mach-netx/generic.c +++ b/arch/arm/mach-netx/generic.c @@ -69,8 +69,7 @@ static struct platform_device *devices[] __initdata = { #endif static void -netx_hif_demux_handler(unsigned int irq_unused, struct irqdesc *desc, - struct pt_regs *regs) +netx_hif_demux_handler(unsigned int irq_unused, struct irqdesc *desc) { unsigned int irq = NETX_IRQ_HIF_CHAINED(0); unsigned int stat; @@ -83,7 +82,7 @@ netx_hif_demux_handler(unsigned int irq_unused, struct irqdesc *desc, while (stat) { if (stat & 1) { DEBUG_IRQ("handling irq %d\n", irq); - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); } irq++; desc++; diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c index 6d72c81b7d9f..0993336c0b55 100644 --- a/arch/arm/mach-netx/time.c +++ b/arch/arm/mach-netx/time.c @@ -38,11 +38,11 @@ static unsigned long netx_gettimeoffset(void) * IRQ handler for the timer */ static irqreturn_t -netx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +netx_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); /* acknowledge interrupt */ diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 6b05647a6c01..3a622801d7b0 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c @@ -327,7 +327,7 @@ static struct spi_board_info __initdata mistral_boardinfo[] = { { #ifdef CONFIG_PM static irqreturn_t -osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs) +osk_mistral_wake_interrupt(int irq, void *ignored) { return IRQ_HANDLED; } diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c index efe9bfc6e55f..8e40208b10bb 100644 --- a/arch/arm/mach-omap1/fpga.c +++ b/arch/arm/mach-omap1/fpga.c @@ -84,8 +84,7 @@ static void fpga_mask_ack_irq(unsigned int irq) fpga_ack_irq(irq); } -void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc) { struct irqdesc *d; u32 stat; @@ -101,7 +100,7 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc, fpga_irq++, stat >>= 1) { if (stat & 1) { d = irq_desc + fpga_irq; - desc_handle_irq(fpga_irq, d, regs); + desc_handle_irq(fpga_irq, d); } } } diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index cd76185bab74..4834758d340c 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -682,8 +682,7 @@ static int omap_pm_finish(suspend_state_t state) } -static irqreturn_t omap_wakeup_interrupt(int irq, void * dev, - struct pt_regs * regs) +static irqreturn_t omap_wakeup_interrupt(int irq, void *dev) { return IRQ_HANDLED; } diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c index c4b790217a5b..4cc98a578e4b 100644 --- a/arch/arm/mach-omap1/serial.c +++ b/arch/arm/mach-omap1/serial.c @@ -204,8 +204,7 @@ void __init omap_serial_init(void) #ifdef CONFIG_OMAP_SERIAL_WAKE -static irqreturn_t omap_serial_wake_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap_serial_wake_interrupt(int irq, void *dev_id) { /* Need to do something with serial port right after wake-up? */ return IRQ_HANDLED; diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 4d91b9f51084..1b7e4a506c26 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c @@ -160,8 +160,7 @@ static unsigned long omap_mpu_timer_gettimeoffset(void) * Latency during the interrupt is calculated using timer1. * Both timer0 and timer1 are counting at 6MHz (P2 6.5MHz). */ -static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id) { unsigned long now, latency; @@ -169,7 +168,7 @@ static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id, now = 0 - omap_mpu_timer_read(0); latency = MPU_TICKS_PER_SEC / HZ - omap_mpu_timer_read(1); omap_mpu_timer_last = now - latency; - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); return IRQ_HANDLED; @@ -182,8 +181,7 @@ static struct irqaction omap_mpu_timer_irq = { }; static unsigned long omap_mpu_timer1_overflows; -static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id) { omap_mpu_timer1_overflows++; return IRQ_HANDLED; diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index c37b0e6d1248..03d6905ba490 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -203,7 +203,7 @@ static void __init apollon_led_init(void) omap_set_gpio_dataout(LED2_GPIO15, 0); } -static irqreturn_t apollon_sw_interrupt(int irq, void *ignored, struct pt_regs *regs) +static irqreturn_t apollon_sw_interrupt(int irq, void *ignored) { static unsigned int led0, led1, led2; diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index fe5fd6d42dea..973189cd9766 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c @@ -37,13 +37,12 @@ static inline void omap2_gp_timer_start(unsigned long load_val) omap_dm_timer_start(gptimer); } -static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); omap_dm_timer_write_status(gptimer, OMAP_TIMER_INT_OVERFLOW); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-pnx4008/dma.c b/arch/arm/mach-pnx4008/dma.c index ec01574f88ac..d6a279e4b524 100644 --- a/arch/arm/mach-pnx4008/dma.c +++ b/arch/arm/mach-pnx4008/dma.c @@ -32,7 +32,7 @@ static struct dma_channel { char *name; - void (*irq_handler) (int, int, void *, struct pt_regs *); + void (*irq_handler) (int, int, void *); void *data; struct pnx4008_dma_ll *ll; u32 ll_dma; @@ -150,8 +150,7 @@ static inline void pnx4008_dma_unlock(void) #define VALID_CHANNEL(c) (((c) >= 0) && ((c) < MAX_DMA_CHANNELS)) int pnx4008_request_channel(char *name, int ch, - void (*irq_handler) (int, int, void *, - struct pt_regs *), void *data) + void (*irq_handler) (int, int, void *), void *data) { int i, found = 0; @@ -1033,7 +1032,7 @@ int pnx4008_dma_ch_enabled(int ch) EXPORT_SYMBOL_GPL(pnx4008_dma_ch_enabled); -static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dma_irq_handler(int irq, void *dev_id) { int i; unsigned long dint = __raw_readl(DMAC_INT_STAT); @@ -1053,8 +1052,7 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) cause |= DMA_ERR_INT; if (tcint & i_bit) cause |= DMA_TC_INT; - channel->irq_handler(i, cause, channel->data, - regs); + channel->irq_handler(i, cause, channel->data); } else { /* * IRQ for an unregistered DMA channel diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c index b986065cd0f3..8621c206ac84 100644 --- a/arch/arm/mach-pnx4008/time.c +++ b/arch/arm/mach-pnx4008/time.c @@ -47,15 +47,14 @@ static unsigned long pnx4008_gettimeoffset(void) /*! * IRQ handler for the timer */ -static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id) { if (__raw_readl(HSTIM_INT) & MATCH0_INT) { write_seqlock(&xtime_lock); do { - timer_tick(regs); + timer_tick(); /* * this algorithm takes care of possible delay diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 337c01c4ac37..74f8378d7bbc 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c @@ -212,7 +212,7 @@ static struct platform_device corgits_device = { */ static struct pxamci_platform_data corgi_mci_platform_data; -static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(int, void *, struct pt_regs *), void *data) +static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(int, void *), void *data) { int err; diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/mach-pxa/dma.c index 7d8c85486c66..4440babe7b97 100644 --- a/arch/arm/mach-pxa/dma.c +++ b/arch/arm/mach-pxa/dma.c @@ -27,13 +27,13 @@ static struct dma_channel { char *name; - void (*irq_handler)(int, void *, struct pt_regs *); + void (*irq_handler)(int, void *); void *data; } dma_channels[PXA_DMA_CHANNELS]; int pxa_request_dma (char *name, pxa_dma_prio prio, - void (*irq_handler)(int, void *, struct pt_regs *), + void (*irq_handler)(int, void *), void *data) { unsigned long flags; @@ -87,7 +87,7 @@ void pxa_free_dma (int dma_ch) local_irq_restore(flags); } -static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dma_irq_handler(int irq, void *dev_id) { int i, dint = DINT; @@ -95,7 +95,7 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) if (dint & (1 << i)) { struct dma_channel *channel = &dma_channels[i]; if (channel->name && channel->irq_handler) { - channel->irq_handler(i, channel->data, regs); + channel->irq_handler(i, channel->data); } else { /* * IRQ for an unregistered DMA channel: diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index 3e4b0ab71c66..a4cb875b748d 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c @@ -125,7 +125,7 @@ static struct pxafb_mach_info sharp_lm8v31 = { .pxafb_lcd_power = &idp_lcd_power }; -static int idp_mci_init(struct device *dev, irqreturn_t (*idp_detect_int)(int, void *, struct pt_regs *), void *data) +static int idp_mci_init(struct device *dev, irqreturn_t (*idp_detect_int)(int, void *), void *data) { /* setup GPIO for PXA25x MMC controller */ pxa_gpio_mode(GPIO6_MMCCLK_MD); diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 12141e2a50cc..ab1a16025d51 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -143,8 +143,7 @@ static struct irq_chip pxa_low_gpio_chip = { * Demux handler for GPIO>=2 edge detect interrupts */ -static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc) { unsigned int mask; int loop; @@ -160,7 +159,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, mask >>= 2; do { if (mask & 1) - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); irq++; desc++; mask >>= 1; @@ -175,7 +174,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, desc = irq_desc + irq; do { if (mask & 1) - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); irq++; desc++; mask >>= 1; @@ -190,7 +189,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, desc = irq_desc + irq; do { if (mask & 1) - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); irq++; desc++; mask >>= 1; @@ -206,7 +205,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, desc = irq_desc + irq; do { if (mask & 1) - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); irq++; desc++; mask >>= 1; diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index eff2a91b2565..5749f6b72e12 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c @@ -75,8 +75,7 @@ static struct irq_chip lpd270_irq_chip = { .unmask = lpd270_unmask_irq, }; -static void lpd270_irq_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void lpd270_irq_handler(unsigned int irq, struct irqdesc *desc) { unsigned long pending; @@ -86,7 +85,7 @@ static void lpd270_irq_handler(unsigned int irq, struct irqdesc *desc, if (likely(pending)) { irq = LPD270_IRQ(0) + __ffs(pending); desc = irq_desc + irq; - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled; diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 157cf47cbe66..b1e77bd85a33 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -85,8 +85,7 @@ static struct irq_chip lubbock_irq_chip = { .unmask = lubbock_unmask_irq, }; -static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc) { unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; do { @@ -94,7 +93,7 @@ static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc, if (likely(pending)) { irq = LUBBOCK_IRQ(0) + __ffs(pending); desc = irq_desc + irq; - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); } pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; } while (pending); @@ -379,7 +378,7 @@ static struct pxafb_mach_info sharp_lm8v31 = { #define MMC_POLL_RATE msecs_to_jiffies(1000) static void lubbock_mmc_poll(unsigned long); -static irqreturn_t (*mmc_detect_int)(int, void *, struct pt_regs *); +static irqreturn_t (*mmc_detect_int)(int, void *); static struct timer_list mmc_timer = { .function = lubbock_mmc_poll, @@ -403,17 +402,17 @@ static void lubbock_mmc_poll(unsigned long data) } } -static irqreturn_t lubbock_detect_int(int irq, void *data, struct pt_regs *regs) +static irqreturn_t lubbock_detect_int(int irq, void *data) { /* IRQ is level triggered; disable, and poll for removal */ disable_irq(irq); mod_timer(&mmc_timer, jiffies + MMC_POLL_RATE); - return mmc_detect_int(irq, data, regs); + return mmc_detect_int(irq, data); } static int lubbock_mci_init(struct device *dev, - irqreturn_t (*detect_int)(int, void *, struct pt_regs *), + irqreturn_t (*detect_int)(int, void *), void *data) { /* setup GPIO for PXA25x MMC controller */ diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 7ba0447d6fa3..8c3019784915 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c @@ -71,8 +71,7 @@ static struct irq_chip mainstone_irq_chip = { .unmask = mainstone_unmask_irq, }; -static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc) { unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled; do { @@ -80,7 +79,7 @@ static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc, if (likely(pending)) { irq = MAINSTONE_IRQ(0) + __ffs(pending); desc = irq_desc + irq; - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); } pending = MST_INTSETCLR & mainstone_irq_enabled; } while (pending); @@ -314,7 +313,7 @@ static struct pxafb_mach_info mainstone_pxafb_info = { .pxafb_backlight_power = mainstone_backlight_power, }; -static int mainstone_mci_init(struct device *dev, irqreturn_t (*mstone_detect_int)(int, void *, struct pt_regs *), void *data) +static int mainstone_mci_init(struct device *dev, irqreturn_t (*mstone_detect_int)(int, void *), void *data) { int err; diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 5e8c098ca139..9052a971c8ac 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c @@ -197,7 +197,7 @@ static struct platform_device poodle_ts_device = { */ static struct pxamci_platform_data poodle_mci_platform_data; -static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(int, void *, struct pt_regs *), void *data) +static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(int, void *), void *data) { int err; diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 401cdb850fbc..911452dd0b45 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -291,7 +291,7 @@ static struct platform_device spitzts_device = { static struct pxamci_platform_data spitz_mci_platform_data; -static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(int, void *, struct pt_regs *), void *data) +static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(int, void *), void *data) { int err; diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c index 1fddfeaa630d..6cc202755fb4 100644 --- a/arch/arm/mach-pxa/ssp.c +++ b/arch/arm/mach-pxa/ssp.c @@ -65,7 +65,7 @@ static const struct ssp_info_ ssp_info[PXA_SSP_PORTS] = { static DEFINE_MUTEX(mutex); static int use_count[PXA_SSP_PORTS] = {0, 0, 0}; -static irqreturn_t ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ssp_interrupt(int irq, void *dev_id) { struct ssp_dev *dev = (struct ssp_dev*) dev_id; unsigned int status = SSSR_P(dev->port); diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index 5dbd191c57c4..3ac268fa419b 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c @@ -75,7 +75,7 @@ static int match_posponed; #endif static irqreturn_t -pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +pxa_timer_interrupt(int irq, void *dev_id) { int next_match; @@ -105,7 +105,7 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * exactly one tick period which should be a pretty rare event. */ do { - timer_tick(regs); + timer_tick(); OSSR = OSSR_M0; /* Clear match on timer 0 */ next_match = (OSMR0 += LATCH); } while( (signed long)(next_match - OSCR) <= 8 ); @@ -157,13 +157,13 @@ static void pxa_dyn_tick_reprogram(unsigned long ticks) } static irqreturn_t -pxa_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs) +pxa_dyn_tick_handler(int irq, void *dev_id) { if (match_posponed) { match_posponed = 0; OSMR0 = initial_match; if ( (signed long)(initial_match - OSCR) <= 8 ) - return pxa_timer_interrupt(irq, dev_id, regs); + return pxa_timer_interrupt(irq, dev_id); } return IRQ_NONE; } diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 249353616aba..17e46c1060bd 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -174,7 +174,7 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = { */ static struct pxamci_platform_data tosa_mci_platform_data; -static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int, void *, struct pt_regs *), void *data) +static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int, void *), void *data) { int err; diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index 910571e9a190..a2c05a840a2f 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c @@ -270,7 +270,7 @@ void board_pcmcia_power(int power) {;} #endif /* CONFIG_MACH_TRIZEPS4_CONXS */ EXPORT_SYMBOL(board_pcmcia_power); -static int trizeps4_mci_init(struct device *dev, irqreturn_t (*mci_detect_int)(int, void *, struct pt_regs *), void *data) +static int trizeps4_mci_init(struct device *dev, irqreturn_t (*mci_detect_int)(int, void *), void *data) { int err; /* setup GPIO for PXA27x MMC controller */ diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index da0286973823..68c67053f479 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c @@ -515,18 +515,18 @@ static unsigned long realview_gettimeoffset(void) /* * IRQ handler for the timer */ -static irqreturn_t realview_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t realview_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); // ...clear the interrupt writel(1, TIMER0_VA_BASE + TIMER_INTCLR); - timer_tick(regs); + timer_tick(); #if defined(CONFIG_SMP) && !defined(CONFIG_LOCAL_TIMERS) smp_send_timer(); - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif write_sequnlock(&xtime_lock); diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index ac511d41d4d7..596379a4cf82 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c @@ -83,7 +83,7 @@ static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma) sg->length |= flags; } -static irqreturn_t iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t iomd_dma_handle(int irq, void *dev_id) { dma_t *dma = (dma_t *)dev_id; unsigned long base = dma->dma_base; diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c2410/bast-irq.c index 440e9aa0211a..23d5beea5568 100644 --- a/arch/arm/mach-s3c2410/bast-irq.c +++ b/arch/arm/mach-s3c2410/bast-irq.c @@ -112,8 +112,7 @@ static struct irqchip bast_pc104_chip = { static void bast_irq_pc104_demux(unsigned int irq, - struct irqdesc *desc, - struct pt_regs *regs) + struct irqdesc *desc) { unsigned int stat; unsigned int irqno; @@ -133,7 +132,7 @@ bast_irq_pc104_demux(unsigned int irq, if (stat & 1) { irqno = bast_pc104_irqs[i]; desc = irq_desc + irqno; - desc_handle_irq(irqno, desc, regs); + desc_handle_irq(irqno, desc); } } } diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c index d264bbbd8bef..3d211dc2f2f9 100644 --- a/arch/arm/mach-s3c2410/dma.c +++ b/arch/arm/mach-s3c2410/dma.c @@ -595,7 +595,7 @@ s3c2410_dma_lastxfer(struct s3c2410_dma_chan *chan) #define dmadbg2(x...) static irqreturn_t -s3c2410_dma_irq(int irq, void *devpw, struct pt_regs *regs) +s3c2410_dma_irq(int irq, void *devpw) { struct s3c2410_dma_chan *chan = (struct s3c2410_dma_chan *)devpw; struct s3c2410_dma_buf *buf; diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c index 3e9f3462c61b..683b3491ba3c 100644 --- a/arch/arm/mach-s3c2410/irq.c +++ b/arch/arm/mach-s3c2410/irq.c @@ -480,8 +480,7 @@ static struct irqchip s3c_irq_adc = { /* irq demux for adc */ static void s3c_irq_demux_adc(unsigned int irq, - struct irqdesc *desc, - struct pt_regs *regs) + struct irqdesc *desc) { unsigned int subsrc, submsk; unsigned int offset = 9; @@ -500,17 +499,16 @@ static void s3c_irq_demux_adc(unsigned int irq, if (subsrc != 0) { if (subsrc & 1) { mydesc = irq_desc + IRQ_TC; - desc_handle_irq(IRQ_TC, mydesc, regs); + desc_handle_irq(IRQ_TC, mydesc); } if (subsrc & 2) { mydesc = irq_desc + IRQ_ADC; - desc_handle_irq(IRQ_ADC, mydesc, regs); + desc_handle_irq(IRQ_ADC, mydesc); } } } -static void s3c_irq_demux_uart(unsigned int start, - struct pt_regs *regs) +static void s3c_irq_demux_uart(unsigned int start) { unsigned int subsrc, submsk; unsigned int offset = start - IRQ_S3CUART_RX0; @@ -533,17 +531,17 @@ static void s3c_irq_demux_uart(unsigned int start, desc = irq_desc + start; if (subsrc & 1) - desc_handle_irq(start, desc, regs); + desc_handle_irq(start, desc); desc++; if (subsrc & 2) - desc_handle_irq(start+1, desc, regs); + desc_handle_irq(start+1, desc); desc++; if (subsrc & 4) - desc_handle_irq(start+2, desc, regs); + desc_handle_irq(start+2, desc); } } @@ -551,35 +549,31 @@ static void s3c_irq_demux_uart(unsigned int start, static void s3c_irq_demux_uart0(unsigned int irq, - struct irqdesc *desc, - struct pt_regs *regs) + struct irqdesc *desc) { irq = irq; - s3c_irq_demux_uart(IRQ_S3CUART_RX0, regs); + s3c_irq_demux_uart(IRQ_S3CUART_RX0); } static void s3c_irq_demux_uart1(unsigned int irq, - struct irqdesc *desc, - struct pt_regs *regs) + struct irqdesc *desc) { irq = irq; - s3c_irq_demux_uart(IRQ_S3CUART_RX1, regs); + s3c_irq_demux_uart(IRQ_S3CUART_RX1); } static void s3c_irq_demux_uart2(unsigned int irq, - struct irqdesc *desc, - struct pt_regs *regs) + struct irqdesc *desc) { irq = irq; - s3c_irq_demux_uart(IRQ_S3CUART_RX2, regs); + s3c_irq_demux_uart(IRQ_S3CUART_RX2); } static void s3c_irq_demux_extint8(unsigned int irq, - struct irqdesc *desc, - struct pt_regs *regs) + struct irqdesc *desc) { unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND); unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK); @@ -594,15 +588,14 @@ s3c_irq_demux_extint8(unsigned int irq, eintpnd &= ~(1<> 5) & 7); diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 7364478cec12..fa6dc71bd6ad 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -702,7 +702,7 @@ static u32 gpio_irq_mask[] = { GPIO2_SD_CON_SLT, }; -static void h3800_IRQ_demux(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +static void h3800_IRQ_demux(unsigned int irq, struct irqdesc *desc) { int i; @@ -719,14 +719,14 @@ static void h3800_IRQ_demux(unsigned int irq, struct irqdesc *desc, struct pt_re if (0) printk("%s KPIO 0x%08X\n", __FUNCTION__, irq); for (j = 0; j < H3800_KPIO_IRQ_COUNT; j++) if (irq & kpio_irq_mask[j]) - do_edge_IRQ(H3800_KPIO_IRQ_COUNT + j, irq_desc + H3800_KPIO_IRQ_COUNT + j, regs); + do_edge_IRQ(H3800_KPIO_IRQ_COUNT + j, irq_desc + H3800_KPIO_IRQ_COUNT + j); /* GPIO2 */ irq = H3800_ASIC2_GPIINTFLAG; if (0) printk("%s GPIO 0x%08X\n", __FUNCTION__, irq); for (j = 0; j < H3800_GPIO_IRQ_COUNT; j++) if (irq & gpio_irq_mask[j]) - do_edge_IRQ(H3800_GPIO_IRQ_COUNT + j, irq_desc + H3800_GPIO_IRQ_COUNT + j , regs); + do_edge_IRQ(H3800_GPIO_IRQ_COUNT + j, irq_desc + H3800_GPIO_IRQ_COUNT + j); } if (i >= MAX_ASIC_ISR_LOOPS) diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index b55b90a2e8fe..f4c6322ca33e 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c @@ -110,8 +110,7 @@ static struct irq_chip sa1100_low_gpio_chip = { * and call the handler. */ static void -sa1100_high_gpio_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +sa1100_high_gpio_handler(unsigned int irq, struct irqdesc *desc) { unsigned int mask; @@ -128,7 +127,7 @@ sa1100_high_gpio_handler(unsigned int irq, struct irqdesc *desc, mask >>= 11; do { if (mask & 1) - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); mask >>= 1; irq++; desc++; diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index af6d2775cf82..354d5e91da59 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c @@ -29,7 +29,7 @@ * is rather unfortunate. */ static void -neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +neponset_irq_handler(unsigned int irq, struct irqdesc *desc) { unsigned int irr; @@ -69,12 +69,12 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg if (irr & IRR_ETHERNET) { d = irq_desc + IRQ_NEPONSET_SMC9196; - desc_handle_irq(IRQ_NEPONSET_SMC9196, d, regs); + desc_handle_irq(IRQ_NEPONSET_SMC9196, d); } if (irr & IRR_USAR) { d = irq_desc + IRQ_NEPONSET_USAR; - desc_handle_irq(IRQ_NEPONSET_USAR, d, regs); + desc_handle_irq(IRQ_NEPONSET_USAR, d); } desc->chip->unmask(irq); @@ -82,7 +82,7 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg if (irr & IRR_SA1111) { d = irq_desc + IRQ_NEPONSET_SA1111; - desc_handle_irq(IRQ_NEPONSET_SA1111, d, regs); + desc_handle_irq(IRQ_NEPONSET_SA1111, d); } } } diff --git a/arch/arm/mach-sa1100/ssp.c b/arch/arm/mach-sa1100/ssp.c index 5eba5fbbb561..59703c6fb29b 100644 --- a/arch/arm/mach-sa1100/ssp.c +++ b/arch/arm/mach-sa1100/ssp.c @@ -25,7 +25,7 @@ #define TIMEOUT 100000 -static irqreturn_t ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ssp_interrupt(int irq, void *dev_id) { unsigned int status = Ser4SSSR; diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index 49ae716e16c2..4284bd6f7a1f 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c @@ -77,7 +77,7 @@ static int match_posponed; #endif static irqreturn_t -sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +sa1100_timer_interrupt(int irq, void *dev_id) { unsigned int next_match; @@ -99,7 +99,7 @@ sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * handlers. */ do { - timer_tick(regs); + timer_tick(); OSSR = OSSR_M0; /* Clear match on timer 0 */ next_match = (OSMR0 += LATCH); } while ((signed long)(next_match - OSCR) <= 0); @@ -151,13 +151,13 @@ static void sa1100_dyn_tick_reprogram(unsigned long ticks) } static irqreturn_t -sa1100_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs) +sa1100_dyn_tick_handler(int irq, void *dev_id) { if (match_posponed) { match_posponed = 0; OSMR0 = initial_match; if ((signed long)(initial_match - OSCR) <= 0) - return sa1100_timer_interrupt(irq, dev_id, regs); + return sa1100_timer_interrupt(irq, dev_id); } return IRQ_NONE; } diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index 1095df34fec0..0e480fae8ec5 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c @@ -80,10 +80,10 @@ static void __init shark_map_io(void) #define HZ_TIME ((1193180 + HZ/2) / HZ) static irqreturn_t -shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +shark_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); return IRQ_HANDLED; } diff --git a/arch/arm/mach-shark/irq.c b/arch/arm/mach-shark/irq.c index b227052296cf..297ecf130650 100644 --- a/arch/arm/mach-shark/irq.c +++ b/arch/arm/mach-shark/irq.c @@ -61,7 +61,7 @@ static void shark_enable_8259A_irq(unsigned int irq) static void shark_ack_8259A_irq(unsigned int irq){} -static irqreturn_t bogus_int(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t bogus_int(int irq, void *dev_id) { printk("Got interrupt %i!\n",irq); return IRQ_NONE; diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index f2bbef07b1e4..2aa150b57ba1 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -77,12 +77,12 @@ static struct irq_chip sic_chip = { }; static void -sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +sic_handle_irq(unsigned int irq, struct irqdesc *desc) { unsigned long status = readl(VA_SIC_BASE + SIC_IRQ_STATUS); if (status == 0) { - do_bad_IRQ(irq, desc, regs); + do_bad_IRQ(irq, desc); return; } @@ -93,7 +93,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) irq += IRQ_SIC_START; desc = irq_desc + irq; - desc_handle_irq(irq, desc, regs); + desc_handle_irq(irq, desc); } while (status); } @@ -851,14 +851,14 @@ static unsigned long versatile_gettimeoffset(void) /* * IRQ handler for the timer */ -static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); // ...clear the interrupt writel(1, TIMER0_VA_BASE + TIMER_INTCLR); - timer_tick(regs); + timer_tick(); write_sequnlock(&xtime_lock); diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c index 726ad2b3b435..7899d3ca75a3 100644 --- a/arch/arm/oprofile/op_model_xscale.c +++ b/arch/arm/oprofile/op_model_xscale.c @@ -341,7 +341,7 @@ static void inline __xsc2_check_ctrs(void) __asm__ __volatile__ ("mcr p14, 0, %0, c5, c1, 0" : : "r" (flag)); } -static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) +static irqreturn_t xscale_pmu_interrupt(int irq, void *arg) { int i; u32 pmnc; @@ -356,7 +356,7 @@ static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs continue; write_counter(i, -(u32)results[i].reset_counter); - oprofile_add_sample(regs, i); + oprofile_add_sample(get_irq_regs(), i); results[i].ovf--; } diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c index 06282dffbdc6..f530abdaa7a1 100644 --- a/arch/arm/plat-iop/time.c +++ b/arch/arm/plat-iop/time.c @@ -47,7 +47,7 @@ unsigned long iop3xx_gettimeoffset(void) } static irqreturn_t -iop3xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +iop3xx_timer_interrupt(int irq, void *dev_id) { write_seqlock(&xtime_lock); @@ -57,7 +57,7 @@ iop3xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) while ((signed long)(next_jiffy_time - *IOP3XX_TU_TCR1) >= ticks_per_jiffy) { - timer_tick(regs); + timer_tick(); next_jiffy_time -= ticks_per_jiffy; } diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 1bbb431843ce..bb045e5ddbd8 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -899,8 +899,7 @@ static int omap1_dma_handle_ch(int ch) return 1; } -static irqreturn_t omap1_dma_irq_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap1_dma_irq_handler(int irq, void *dev_id) { int ch = ((int) dev_id) - 1; int handled = 0; @@ -962,8 +961,7 @@ static int omap2_dma_handle_ch(int ch) } /* STATUS register count is from 1-32 while our is 0-31 */ -static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id) { u32 val; int i; @@ -1220,8 +1218,7 @@ static void set_b1_regs(void) omap_writew(fi, OMAP1610_DMA_LCD_SRC_FI_B1_L); } -static irqreturn_t lcd_dma_irq_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t lcd_dma_irq_handler(int irq, void *dev_id) { u16 w; diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index f55f99ae58ae..8162eed8b500 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -783,8 +783,7 @@ void omap_free_gpio(int gpio) * line's interrupt handler has been run, we may miss some nested * interrupts. */ -static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, - struct pt_regs *regs) +static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc) { void __iomem *isr_reg = NULL; u32 isr; @@ -882,7 +881,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, continue; } - desc_handle_irq(gpio_irq, d, regs); + desc_handle_irq(gpio_irq, d); if (unlikely((d->status & IRQ_PENDING) && !d->depth)) { irq_mask = 1 << diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index ade9a0fa6ef6..ec50008a2df6 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c @@ -96,7 +96,7 @@ static void omap_mcbsp_dump_reg(u8 id) DBG("***********************\n"); } -static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id) { struct omap_mcbsp * mcbsp_tx = (struct omap_mcbsp *)(dev_id); @@ -106,7 +106,7 @@ static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id, struct pt_re return IRQ_HANDLED; } -static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id) { struct omap_mcbsp * mcbsp_rx = (struct omap_mcbsp *)(dev_id); diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c index cf6df3378d37..265310601161 100644 --- a/arch/arm/plat-omap/timer32k.c +++ b/arch/arm/plat-omap/timer32k.c @@ -194,8 +194,7 @@ unsigned long long sched_clock(void) * issues with dynamic tick. In the dynamic tick case, we need to lock * with irqsave. */ -static inline irqreturn_t _omap_32k_timer_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static inline irqreturn_t _omap_32k_timer_interrupt(int irq, void *dev_id) { unsigned long now; @@ -205,7 +204,7 @@ static inline irqreturn_t _omap_32k_timer_interrupt(int irq, void *dev_id, while ((signed long)(now - omap_32k_last_tick) >= OMAP_32K_TICKS_PER_HZ) { omap_32k_last_tick += OMAP_32K_TICKS_PER_HZ; - timer_tick(regs); + timer_tick(); } /* Restart timer so we don't drift off due to modulo or dynamic tick. @@ -218,19 +217,17 @@ static inline irqreturn_t _omap_32k_timer_interrupt(int irq, void *dev_id, return IRQ_HANDLED; } -static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id) { - return _omap_32k_timer_interrupt(irq, dev_id, regs); + return _omap_32k_timer_interrupt(irq, dev_id); } -static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id) { unsigned long flags; write_seqlock_irqsave(&xtime_lock, flags); - _omap_32k_timer_interrupt(irq, dev_id, regs); + _omap_32k_timer_interrupt(irq, dev_id); write_sequnlock_irqrestore(&xtime_lock, flags); return IRQ_HANDLED; diff --git a/include/asm-arm/arch-clps711x/time.h b/include/asm-arm/arch-clps711x/time.h index 0e4a3901d3b3..5edaae1c61d3 100644 --- a/include/asm-arm/arch-clps711x/time.h +++ b/include/asm-arm/arch-clps711x/time.h @@ -26,8 +26,9 @@ extern void clps711x_setup_timer(void); * IRQ handler for the timer */ static irqreturn_t -p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +p720t_timer_interrupt(int irq, void *dev_id) { + struct pt_regs *regs = get_irq_regs(); do_leds(); do_timer(1); #ifndef CONFIG_SMP diff --git a/include/asm-arm/arch-imx/imx-dma.h b/include/asm-arm/arch-imx/imx-dma.h index 599f03e5a9ef..5b1066da4e1f 100644 --- a/include/asm-arm/arch-imx/imx-dma.h +++ b/include/asm-arm/arch-imx/imx-dma.h @@ -45,8 +45,8 @@ struct imx_dma_channel { const char *name; - void (*irq_handler) (int, void *, struct pt_regs *); - void (*err_handler) (int, void *, struct pt_regs *, int errcode); + void (*irq_handler) (int, void *); + void (*err_handler) (int, void *, int errcode); void *data; dmamode_t dma_mode; struct scatterlist *sg; @@ -77,8 +77,8 @@ imx_dma_setup_sg(imx_dmach_t dma_ch, int imx_dma_setup_handlers(imx_dmach_t dma_ch, - void (*irq_handler) (int, void *, struct pt_regs *), - void (*err_handler) (int, void *, struct pt_regs *, int), void *data); + void (*irq_handler) (int, void *), + void (*err_handler) (int, void *, int), void *data); void imx_dma_enable(imx_dmach_t dma_ch); diff --git a/include/asm-arm/arch-l7200/time.h b/include/asm-arm/arch-l7200/time.h index c69cb508735f..ea22f7fff9cd 100644 --- a/include/asm-arm/arch-l7200/time.h +++ b/include/asm-arm/arch-l7200/time.h @@ -43,8 +43,9 @@ * Handler for RTC timer interrupt */ static irqreturn_t -timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +timer_interrupt(int irq, void *dev_id) { + struct pt_regs *regs = get_irq_regs(); do_timer(1); #ifndef CONFIG_SMP update_process_times(user_mode(regs)); diff --git a/include/asm-arm/arch-pnx4008/dma.h b/include/asm-arm/arch-pnx4008/dma.h index 3aee1204795b..418f15283ff1 100644 --- a/include/asm-arm/arch-pnx4008/dma.h +++ b/include/asm-arm/arch-pnx4008/dma.h @@ -137,7 +137,7 @@ extern void pnx4008_free_ll_entry(struct pnx4008_dma_ll *, dma_addr_t); extern void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll *); extern int pnx4008_request_channel(char *, int, - void (*)(int, int, void *, struct pt_regs *), + void (*)(int, int, void *), void *); extern void pnx4008_free_channel(int); extern int pnx4008_config_dma(int, int, int); diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h index a008150abc59..bed042d71d68 100644 --- a/include/asm-arm/arch-pxa/dma.h +++ b/include/asm-arm/arch-pxa/dma.h @@ -56,7 +56,7 @@ for ( \ int pxa_request_dma (char *name, pxa_dma_prio prio, - void (*irq_handler)(int, void *, struct pt_regs *), + void (*irq_handler)(int, void *), void *data); void pxa_free_dma (int dma_ch); diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index 88c17dd02ed2..b704c4f05f4e 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h @@ -10,7 +10,7 @@ struct mmc_host; struct pxamci_platform_data { unsigned int ocr_mask; /* available voltages */ unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */ - int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); + int (*init)(struct device *, irqreturn_t (*)(int, void *), void *); int (*get_ro)(struct device *); void (*setpower)(struct device *, unsigned int); void (*exit)(struct device *, void *); diff --git a/include/asm-arm/hardware/sharpsl_pm.h b/include/asm-arm/hardware/sharpsl_pm.h index a836e76a14f7..2d00db22b981 100644 --- a/include/asm-arm/hardware/sharpsl_pm.h +++ b/include/asm-arm/hardware/sharpsl_pm.h @@ -100,7 +100,7 @@ extern struct sharpsl_pm_status sharpsl_pm; void sharpsl_battery_kick(void); void sharpsl_pm_led(int val); -irqreturn_t sharpsl_ac_isr(int irq, void *dev_id, struct pt_regs *fp); -irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id, struct pt_regs *fp); -irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id, struct pt_regs *fp); +irqreturn_t sharpsl_ac_isr(int irq, void *dev_id); +irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id); +irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id); diff --git a/include/asm-arm/irq_regs.h b/include/asm-arm/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-arm/irq_regs.h @@ -0,0 +1 @@ +#include diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index 131f33733d25..0e017ecf2096 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h @@ -30,10 +30,9 @@ extern int show_fiq_list(struct seq_file *, void *); /* * Obsolete inline function for calling irq descriptor handlers. */ -static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc) { - desc->handle_irq(irq, desc, regs); + desc->handle_irq(irq, desc); } void set_irq_flags(unsigned int irq, unsigned int flags); @@ -51,10 +50,10 @@ void set_irq_flags(unsigned int irq, unsigned int flags); #define irqdesc irq_desc #define irqchip irq_chip -#define do_bad_IRQ(irq,desc,regs) \ +#define do_bad_IRQ(irq,desc) \ do { \ spin_lock(&desc->lock); \ - handle_bad_irq(irq, desc, regs); \ + handle_bad_irq(irq, desc); \ spin_unlock(&desc->lock); \ } while(0) diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h index 1eb93f5c0d6c..5dc357013b79 100644 --- a/include/asm-arm/mach/time.h +++ b/include/asm-arm/mach/time.h @@ -57,7 +57,7 @@ struct dyn_tick_timer { int (*enable)(void); /* Enables dynamic tick */ int (*disable)(void); /* Disables dynamic tick */ void (*reprogram)(unsigned long); /* Reprograms the timer */ - int (*handler)(int, void *, struct pt_regs *); + int (*handler)(int, void *); }; void timer_dyn_reprogram(void); @@ -66,7 +66,7 @@ void timer_dyn_reprogram(void); #endif extern struct sys_timer *system_timer; -extern void timer_tick(struct pt_regs *); +extern void timer_tick(void); /* * Kernel time keeping support. From 815a965b0e6d925646e1f6012175830ef21e0d21 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Fri, 6 Oct 2006 11:11:56 +0200 Subject: [PATCH 041/232] [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 Signed-off-by: Jiri Kosina Acked-by: Keith Mannthey Signed-off-by: Linus Torvalds --- include/asm-i386/smp.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 6aa1206f6e2a..bd59c1508e71 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h @@ -46,8 +46,6 @@ extern u8 x86_cpu_to_apicid[]; #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] -extern u8 apicid_2_node[]; - #ifdef CONFIG_HOTPLUG_CPU extern void cpu_exit_clear(void); extern void cpu_uninit(void); @@ -101,6 +99,9 @@ extern unsigned int num_processors; #endif #ifndef __ASSEMBLY__ + +extern u8 apicid_2_node[]; + #ifdef CONFIG_X86_LOCAL_APIC static __inline int logical_smp_processor_id(void) { From 476d1205d182e12a74f4197ccc9092ea6a80e15b Mon Sep 17 00:00:00 2001 From: Sasha Khapyorsky Date: Tue, 26 Sep 2006 15:27:38 +0200 Subject: [PATCH 042/232] [ALSA] hda/patch_si3054: new codec vendor IDs 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. Signed-off-by: Sasha Khapyorsky Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/hda/patch_si3054.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c index 76ec3d75fa9e..cc87dff1eb56 100644 --- a/sound/pci/hda/patch_si3054.c +++ b/sound/pci/hda/patch_si3054.c @@ -297,8 +297,13 @@ static int patch_si3054(struct hda_codec *codec) struct hda_codec_preset snd_hda_preset_si3054[] = { { .id = 0x163c3055, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x163c3155, .name = "Si3054", .patch = patch_si3054 }, + { .id = 0x11c11040, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x11c13026, .name = "Si3054", .patch = patch_si3054 }, + { .id = 0x11c13055, .name = "Si3054", .patch = patch_si3054 }, + { .id = 0x11c13155, .name = "Si3054", .patch = patch_si3054 }, + { .id = 0x10573055, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x10573057, .name = "Si3054", .patch = patch_si3054 }, + { .id = 0x10573155, .name = "Si3054", .patch = patch_si3054 }, {} }; From 2aedbda6f9a51f0a2130c150676a5c99c81fa7a2 Mon Sep 17 00:00:00 2001 From: Luke Zhang Date: Tue, 26 Sep 2006 15:28:41 +0200 Subject: [PATCH 043/232] [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 Signed-off-by: Liam Girdwood Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/ac97/ac97_patch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index dc28b111a06d..15be6ba87c82 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c @@ -530,7 +530,7 @@ AC97_ENUM("ALC Headphone Mux", wm9711_enum[1]), AC97_SINGLE("ALC Headphone Volume", AC97_VIDEO, 7, 7, 1), AC97_SINGLE("Out3 Switch", AC97_AUX, 15, 1, 1), -AC97_SINGLE("Out3 ZC Switch", AC97_AUX, 7, 1, 1), +AC97_SINGLE("Out3 ZC Switch", AC97_AUX, 7, 1, 0), AC97_ENUM("Out3 Mux", wm9711_enum[2]), AC97_ENUM("Out3 LR Mux", wm9711_enum[3]), AC97_SINGLE("Out3 Volume", AC97_AUX, 0, 31, 1), @@ -575,13 +575,14 @@ AC97_SINGLE("Playback Attenuate (-6dB) Switch", AC97_MASTER_TONE, 6, 1, 0), AC97_SINGLE("ADC Switch", AC97_REC_GAIN, 15, 1, 1), AC97_ENUM("Capture Volume Steps", wm9711_enum[6]), -AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 1), +AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 63, 1), AC97_SINGLE("Capture ZC Switch", AC97_REC_GAIN, 7, 1, 0), AC97_SINGLE("Mic 1 to Phone Switch", AC97_MIC, 14, 1, 1), AC97_SINGLE("Mic 2 to Phone Switch", AC97_MIC, 13, 1, 1), AC97_ENUM("Mic Select Source", wm9711_enum[7]), -AC97_SINGLE("Mic 1 Volume", AC97_MIC, 8, 32, 1), +AC97_SINGLE("Mic 1 Volume", AC97_MIC, 8, 31, 1), +AC97_SINGLE("Mic 2 Volume", AC97_MIC, 0, 31, 1), AC97_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 7, 1, 0), AC97_SINGLE("Master ZC Switch", AC97_MASTER, 7, 1, 0), From 7a99795477ca758a4b29ef3595edde2e067af85a Mon Sep 17 00:00:00 2001 From: Tobin Davis Date: Tue, 26 Sep 2006 15:30:10 +0200 Subject: [PATCH 044/232] [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 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/hda/patch_realtek.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index d08d2e399c8f..84a3eb8aacc2 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5076,6 +5076,10 @@ static struct hda_board_config alc883_cfg_tbl[] = { { .modelname = "acer", .config = ALC883_ACER }, { .pci_subvendor = 0x1025, .pci_subdevice = 0/*0x0102*/, .config = ALC883_ACER }, + { .pci_subvendor = 0x1025, .pci_subdevice = 0x0102, + .config = ALC883_ACER }, + { .pci_subvendor = 0x1025, .pci_subdevice = 0x009f, + .config = ALC883_ACER }, { .modelname = "auto", .config = ALC883_AUTO }, {} }; From f3838ba9204cd8af83c4358379221af66d77714e Mon Sep 17 00:00:00 2001 From: Dan Cyr Date: Tue, 26 Sep 2006 15:32:35 +0200 Subject: [PATCH 045/232] [ALSA] hda-intel - New pci id for Nvidia MCP61 Added the new PCI id to support Nvidia MCP61 in snd-hda-intel driver. Signed-off-by: Dan Cyr Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index a76a778d0a1f..feeed12920b4 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1682,6 +1682,7 @@ static struct pci_device_id azx_ids[] = { { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ { 0x10de, 0x026c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 026c */ { 0x10de, 0x0371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 0371 */ + { 0x10de, 0x03f0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 03f0 */ { 0, } }; MODULE_DEVICE_TABLE(pci, azx_ids); From 92b93d31718a3ccbbcf911d2f570bb345c496d66 Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Thu, 28 Sep 2006 12:35:48 +0200 Subject: [PATCH 046/232] [ALSA] Fix memory leak in sound/isa/es18xx.c Fixed a memory leak in the error patch. Signed-off-by: Eric Sesterhenn Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/isa/es18xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 2398d2c55feb..725c115ff97d 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -2154,6 +2154,7 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard, } /* Control port initialization */ if (pnp_activate_dev(acard->devc) < 0) { + kfree(cfg); snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); return -EAGAIN; } From 104326f8df9925317cca64b84249d3eac5de7c74 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Fri, 29 Sep 2006 12:55:25 +0200 Subject: [PATCH 047/232] [ALSA] Dereference after free in snd_hwdep_release() snd_card_file_remove() may free hw->card so we can't dereference hw->card->module after that. Coverity ID 1420. Signed-off-by: Florin Malita Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/core/hwdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 9aa9d94891f0..46b47689362c 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -158,6 +158,7 @@ static int snd_hwdep_release(struct inode *inode, struct file * file) { int err = -ENXIO; struct snd_hwdep *hw = file->private_data; + struct module *mod = hw->card->module; mutex_lock(&hw->open_mutex); if (hw->ops.release) { err = hw->ops.release(hw, file); @@ -167,7 +168,7 @@ static int snd_hwdep_release(struct inode *inode, struct file * file) hw->used--; snd_card_file_remove(hw->card, file); mutex_unlock(&hw->open_mutex); - module_put(hw->card->module); + module_put(mod); return err; } From 9b08c2aa54948361da0e2d26b47e3bcb8f8911e8 Mon Sep 17 00:00:00 2001 From: Karsten Wiese Date: Wed, 4 Oct 2006 17:16:46 +0200 Subject: [PATCH 048/232] [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 Signed-off-by: Karsten Wiese Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/usb/usx2y/usx2yhwdeppcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 9acef9d90543..20708d2ffb6a 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -632,7 +632,7 @@ static int usX2Y_pcms_lock_check(struct snd_card *card) for (s = 0; s < 2; ++s) { struct snd_pcm_substream *substream; substream = pcm->streams[s].substream; - if (SUBSTREAM_BUSY(substream)) + if (substream && SUBSTREAM_BUSY(substream)) err = -EBUSY; } } From 635bbb355ebb735647ca49fb649a6a7edea9b3ed Mon Sep 17 00:00:00 2001 From: Karsten Wiese Date: Wed, 4 Oct 2006 17:17:32 +0200 Subject: [PATCH 049/232] [ALSA] Repair snd-usb-usx2y for usb 2.6.18 urb->start_frame rolls over beyond MAX_INT now. This is for stable kernel and stable alsa. Signed-off-by: Karsten Wiese Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/usb/usx2y/usbusx2yaudio.c | 18 ++++++------------ sound/usb/usx2y/usx2yhwdeppcm.c | 15 +++++---------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index e662281a751a..367f8a32a665 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -322,7 +322,7 @@ static void i_usX2Y_urb_complete(struct urb *urb) usX2Y_error_urb_status(usX2Y, subs, urb); return; } - if (likely((0xFFFF & urb->start_frame) == usX2Y->wait_iso_frame)) + if (likely(urb->start_frame == usX2Y->wait_iso_frame)) subs->completed_urb = urb; else { usX2Y_error_sequence(usX2Y, subs, urb); @@ -335,13 +335,9 @@ static void i_usX2Y_urb_complete(struct urb *urb) atomic_read(&capsubs->state) >= state_PREPARED && (playbacksubs->completed_urb || atomic_read(&playbacksubs->state) < state_PREPARED)) { - if (!usX2Y_usbframe_complete(capsubs, playbacksubs, urb->start_frame)) { - if (nr_of_packs() <= urb->start_frame && - urb->start_frame <= (2 * nr_of_packs() - 1)) // uhci and ohci - usX2Y->wait_iso_frame = urb->start_frame - nr_of_packs(); - else - usX2Y->wait_iso_frame += nr_of_packs(); - } else { + if (!usX2Y_usbframe_complete(capsubs, playbacksubs, urb->start_frame)) + usX2Y->wait_iso_frame += nr_of_packs(); + else { snd_printdd("\n"); usX2Y_clients_stop(usX2Y); } @@ -495,7 +491,6 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs) if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) goto start; } - usX2Y->wait_iso_frame = -1; start: usX2Y_subs_startup(subs); @@ -516,10 +511,9 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs) snd_printk (KERN_ERR "cannot submit datapipe for urb %d, err = %d\n", i, err); err = -EPIPE; goto cleanup; - } else { - if (0 > usX2Y->wait_iso_frame) + } else + if (i == 0) usX2Y->wait_iso_frame = urb->start_frame; - } urb->transfer_flags = 0; } else { atomic_set(&subs->state, state_STARTING1); diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 20708d2ffb6a..8f3e35e24e72 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -243,7 +243,7 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb *urb) usX2Y_error_urb_status(usX2Y, subs, urb); return; } - if (likely((0xFFFF & urb->start_frame) == usX2Y->wait_iso_frame)) + if (likely(urb->start_frame == usX2Y->wait_iso_frame)) subs->completed_urb = urb; else { usX2Y_error_sequence(usX2Y, subs, urb); @@ -256,13 +256,9 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb *urb) if (capsubs->completed_urb && atomic_read(&capsubs->state) >= state_PREPARED && (NULL == capsubs2 || capsubs2->completed_urb) && (playbacksubs->completed_urb || atomic_read(&playbacksubs->state) < state_PREPARED)) { - if (!usX2Y_usbpcm_usbframe_complete(capsubs, capsubs2, playbacksubs, urb->start_frame)) { - if (nr_of_packs() <= urb->start_frame && - urb->start_frame <= (2 * nr_of_packs() - 1)) // uhci and ohci - usX2Y->wait_iso_frame = urb->start_frame - nr_of_packs(); - else - usX2Y->wait_iso_frame += nr_of_packs(); - } else { + if (!usX2Y_usbpcm_usbframe_complete(capsubs, capsubs2, playbacksubs, urb->start_frame)) + usX2Y->wait_iso_frame += nr_of_packs(); + else { snd_printdd("\n"); usX2Y_clients_stop(usX2Y); } @@ -433,7 +429,6 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs) if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) goto start; } - usX2Y->wait_iso_frame = -1; start: usX2Y_usbpcm_subs_startup(subs); @@ -459,7 +454,7 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs) goto cleanup; } else { snd_printdd("%i\n", urb->start_frame); - if (0 > usX2Y->wait_iso_frame) + if (u == 0) usX2Y->wait_iso_frame = urb->start_frame; } urb->transfer_flags = 0; From 4130d59b1ac6e32c130bd59dbce5eb30fede0197 Mon Sep 17 00:00:00 2001 From: Arnaud Patard Date: Wed, 4 Oct 2006 18:21:05 +0200 Subject: [PATCH 050/232] [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. Signed-off-by: Arnaud Patard Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/emu10k1/emu10k1_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index be65d4db8e27..8058059c56e9 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -1461,8 +1461,8 @@ void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu) /* resore for spdif */ if (emu->audigy) - outl(emu->port + A_IOCFG, emu->saved_a_iocfg); - outl(emu->port + HCFG, emu->saved_hcfg); + outl(emu->saved_a_iocfg, emu->port + A_IOCFG); + outl(emu->saved_hcfg, emu->port + HCFG); val = emu->saved_ptr; for (reg = saved_regs; *reg != 0xff; reg++) From a9edfc60227a1dc5c741666ff252a6055b73b184 Mon Sep 17 00:00:00 2001 From: Karsten Wiese Date: Fri, 6 Oct 2006 16:08:27 +0200 Subject: [PATCH 051/232] [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. Signed-off-by: Karsten Wiese Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- include/sound/core.h | 4 +- sound/core/init.c | 92 +++++++++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/include/sound/core.h b/include/sound/core.h index b056ea925ecf..fa1ca0127bab 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -89,10 +89,10 @@ struct snd_device { struct snd_monitor_file { struct file *file; struct snd_monitor_file *next; + const struct file_operations *disconnected_f_op; + struct list_head shutdown_list; }; -struct snd_shutdown_f_ops; /* define it later in init.c */ - /* main structure for soundcard */ struct snd_card { diff --git a/sound/core/init.c b/sound/core/init.c index d7607a25acdf..3058d626a90a 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -33,10 +33,10 @@ #include #include -struct snd_shutdown_f_ops { - struct file_operations f_ops; - struct snd_shutdown_f_ops *next; -}; +static DEFINE_SPINLOCK(shutdown_lock); +static LIST_HEAD(shutdown_files); + +static struct file_operations snd_shutdown_f_ops; static unsigned int snd_cards_lock; /* locked for registering/using */ struct snd_card *snd_cards[SNDRV_CARDS]; @@ -198,6 +198,25 @@ static ssize_t snd_disconnect_write(struct file *file, const char __user *buf, return -ENODEV; } +static int snd_disconnect_release(struct inode *inode, struct file *file) +{ + struct snd_monitor_file *df = NULL, *_df; + + spin_lock(&shutdown_lock); + list_for_each_entry(_df, &shutdown_files, shutdown_list) { + if (_df->file == file) { + df = _df; + break; + } + } + spin_unlock(&shutdown_lock); + + if (likely(df)) + return df->disconnected_f_op->release(inode, file); + + panic("%s(%p, %p) failed!", __FUNCTION__, inode, file); +} + static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait) { return POLLERR | POLLNVAL; @@ -219,6 +238,22 @@ static int snd_disconnect_fasync(int fd, struct file *file, int on) return -ENODEV; } +static struct file_operations snd_shutdown_f_ops = +{ + .owner = THIS_MODULE, + .llseek = snd_disconnect_llseek, + .read = snd_disconnect_read, + .write = snd_disconnect_write, + .release = snd_disconnect_release, + .poll = snd_disconnect_poll, + .unlocked_ioctl = snd_disconnect_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = snd_disconnect_ioctl, +#endif + .mmap = snd_disconnect_mmap, + .fasync = snd_disconnect_fasync +}; + /** * snd_card_disconnect - disconnect all APIs from the file-operations (user space) * @card: soundcard structure @@ -234,9 +269,6 @@ int snd_card_disconnect(struct snd_card *card) { struct snd_monitor_file *mfile; struct file *file; - struct snd_shutdown_f_ops *s_f_ops; - struct file_operations *f_ops; - const struct file_operations *old_f_ops; int err; spin_lock(&card->files_lock); @@ -261,34 +293,14 @@ int snd_card_disconnect(struct snd_card *card) /* it's critical part, use endless loop */ /* we have no room to fail */ - s_f_ops = kmalloc(sizeof(struct snd_shutdown_f_ops), GFP_ATOMIC); - if (s_f_ops == NULL) - panic("Atomic allocation failed for snd_shutdown_f_ops!"); + mfile->disconnected_f_op = mfile->file->f_op; - f_ops = &s_f_ops->f_ops; + spin_lock(&shutdown_lock); + list_add(&mfile->shutdown_list, &shutdown_files); + spin_unlock(&shutdown_lock); - memset(f_ops, 0, sizeof(*f_ops)); - f_ops->owner = file->f_op->owner; - f_ops->release = file->f_op->release; - f_ops->llseek = snd_disconnect_llseek; - f_ops->read = snd_disconnect_read; - f_ops->write = snd_disconnect_write; - f_ops->poll = snd_disconnect_poll; - f_ops->unlocked_ioctl = snd_disconnect_ioctl; -#ifdef CONFIG_COMPAT - f_ops->compat_ioctl = snd_disconnect_ioctl; -#endif - f_ops->mmap = snd_disconnect_mmap; - f_ops->fasync = snd_disconnect_fasync; - - s_f_ops->next = card->s_f_ops; - card->s_f_ops = s_f_ops; - - f_ops = fops_get(f_ops); - - old_f_ops = file->f_op; - file->f_op = f_ops; /* must be atomic */ - fops_put(old_f_ops); + fops_get(&snd_shutdown_f_ops); + mfile->file->f_op = &snd_shutdown_f_ops; mfile = mfile->next; } @@ -326,8 +338,6 @@ EXPORT_SYMBOL(snd_card_disconnect); */ static int snd_card_do_free(struct snd_card *card) { - struct snd_shutdown_f_ops *s_f_ops; - #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) if (snd_mixer_oss_notify_callback) snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_FREE); @@ -351,11 +361,6 @@ static int snd_card_do_free(struct snd_card *card) snd_printk(KERN_WARNING "unable to free card info\n"); /* Not fatal error */ } - while (card->s_f_ops) { - s_f_ops = card->s_f_ops; - card->s_f_ops = s_f_ops->next; - kfree(s_f_ops); - } kfree(card); return 0; } @@ -670,6 +675,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file) if (mfile == NULL) return -ENOMEM; mfile->file = file; + mfile->disconnected_f_op = NULL; mfile->next = NULL; spin_lock(&card->files_lock); if (card->shutdown) { @@ -716,6 +722,12 @@ int snd_card_file_remove(struct snd_card *card, struct file *file) pfile = mfile; mfile = mfile->next; } + if (mfile && mfile->disconnected_f_op) { + fops_put(mfile->disconnected_f_op); + spin_lock(&shutdown_lock); + list_del(&mfile->shutdown_list); + spin_unlock(&shutdown_lock); + } if (card->files == NULL) last_close = 1; spin_unlock(&card->files_lock); From 8a238c7b6a2ec1852419e8fb8b8b0457c55c47e6 Mon Sep 17 00:00:00 2001 From: Amol Lad Date: Fri, 6 Oct 2006 16:45:19 +0200 Subject: [PATCH 052/232] [ALSA] sound/pci/au88x0/au88x0.c: ioremap balanced with iounmap Signed-off-by: Amol Lad Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/au88x0/au88x0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c index ef189d7f09d3..6ed5ad59f5b5 100644 --- a/sound/pci/au88x0/au88x0.c +++ b/sound/pci/au88x0/au88x0.c @@ -128,6 +128,7 @@ static int snd_vortex_dev_free(struct snd_device *device) // Take down PCI interface. synchronize_irq(vortex->irq); free_irq(vortex->irq, vortex); + iounmap(vortex->mmio); pci_release_regions(vortex->pci_dev); pci_disable_device(vortex->pci_dev); kfree(vortex); From 5a078351d2d0a7ae834087de3637eb42cfd209e3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 6 Oct 2006 20:28:26 +0200 Subject: [PATCH 053/232] [ALSA] version 1.0.13 Signed-off-by: Jaroslav Kysela --- include/sound/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sound/version.h b/include/sound/version.h index 2ee849d0e198..4ad86eb6440b 100644 --- a/include/sound/version.h +++ b/include/sound/version.h @@ -1,3 +1,3 @@ -/* include/version.h. Generated by configure. */ -#define CONFIG_SND_VERSION "1.0.12rc1" -#define CONFIG_SND_DATE " (Thu Jun 22 13:55:50 2006 UTC)" +/* include/version.h. Generated by alsa/ksync script. */ +#define CONFIG_SND_VERSION "1.0.13" +#define CONFIG_SND_DATE " (Fri Oct 06 18:28:19 2006 UTC)" From c31f28e778ab299a5035ea2bda64f245b8915d7c Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 14:56:04 -0400 Subject: [PATCH 054/232] drivers/net: eliminate irq handler impossible checks, needless casts - Eliminate check for irq handler 'dev_id==NULL' where the condition never occurs. - Eliminate needless casts to/from void* Signed-off-by: Jeff Garzik --- drivers/net/3c509.c | 7 +------ drivers/net/3c523.c | 7 ++----- drivers/net/3c527.c | 5 ----- drivers/net/8390.c | 8 +------- drivers/net/atp.c | 6 +----- drivers/net/de600.c | 6 ------ drivers/net/declance.c | 4 ++-- drivers/net/dgrs.c | 4 ++-- drivers/net/eepro.c | 8 +------- drivers/net/eexpress.c | 7 ------- drivers/net/irda/ali-ircc.c | 10 ++-------- drivers/net/irda/donauboe.c | 11 +---------- drivers/net/irda/irport.c | 8 ++------ drivers/net/irda/irport.h | 2 +- drivers/net/irda/nsc-ircc.c | 9 ++------- drivers/net/irda/w83977af_ir.c | 9 ++------- drivers/net/lance.c | 5 ----- drivers/net/pcmcia/axnet_cs.c | 8 +------- drivers/net/pcnet32.c | 7 ------- drivers/net/plip.c | 5 ----- drivers/net/saa9730.c | 2 +- drivers/net/sb1000.c | 8 +------- drivers/net/skfp/skfddi.c | 7 +------ drivers/net/sonic.c | 7 +------ drivers/net/sunhme.c | 4 ++-- drivers/net/sunlance.c | 2 +- drivers/net/sunqe.c | 2 +- drivers/net/tokenring/smctr.c | 7 ------- drivers/net/tokenring/tms380tr.c | 5 ----- drivers/net/tulip/de4x5.c | 6 +----- drivers/net/wan/cycx_main.c | 4 ++-- drivers/net/wan/sdla.c | 8 +------- drivers/net/wireless/orinoco.c | 2 +- drivers/net/wireless/wavelan_cs.c | 11 +---------- drivers/net/wireless/wl3501_cs.c | 15 ++++----------- drivers/net/yellowfin.c | 7 ------- drivers/net/znet.c | 5 ----- 37 files changed, 39 insertions(+), 199 deletions(-) diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 7ad0a54779c4..f791bf026e51 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -912,16 +912,11 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) static irqreturn_t el3_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct el3_private *lp; int ioaddr, status; int i = max_interrupt_work; - if (dev == NULL) { - printk ("el3_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - lp = netdev_priv(dev); spin_lock(&lp->lock); diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 1c97271112d0..91849469b4f4 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c @@ -902,14 +902,11 @@ static void *alloc_rfa(struct net_device *dev, void *ptr) static irqreturn_t elmc_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; unsigned short stat; struct priv *p; - if (dev == NULL) { - printk(KERN_ERR "elmc-interrupt: irq %d for unknown device.\n", irq); - return IRQ_NONE; - } else if (!netif_running(dev)) { + if (!netif_running(dev)) { /* The 3c523 has this habit of generating interrupts during the reset. I'm not sure if the ni52 has this same problem, but it's really annoying if we haven't finished initializing it. I was diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index d516c3225ca4..f4aca5386add 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c @@ -1324,11 +1324,6 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id) int rx_event = 0; int tx_event = 0; - if (dev == NULL) { - printk(KERN_WARNING "%s: irq %d for unknown device.\n", cardname, irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; lp = netdev_priv(dev); diff --git a/drivers/net/8390.c b/drivers/net/8390.c index fa3442cb1a49..3d1c599ac3cb 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c @@ -406,14 +406,8 @@ irqreturn_t ei_interrupt(int irq, void *dev_id) int interrupts, nr_serviced = 0; struct ei_device *ei_local; - if (dev == NULL) - { - printk ("net_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - e8390_base = dev->base_addr; - ei_local = (struct ei_device *) netdev_priv(dev); + ei_local = netdev_priv(dev); /* * Protect the irq test too. diff --git a/drivers/net/atp.c b/drivers/net/atp.c index 062f80e20874..2d306fcb7f36 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c @@ -598,17 +598,13 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev) Handle the network interface interrupts. */ static irqreturn_t atp_interrupt(int irq, void *dev_instance) { - struct net_device *dev = (struct net_device *)dev_instance; + struct net_device *dev = dev_instance; struct net_local *lp; long ioaddr; static int num_tx_since_rx; int boguscount = max_interrupt_work; int handled = 0; - if (dev == NULL) { - printk(KERN_ERR "ATP_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } ioaddr = dev->base_addr; lp = netdev_priv(dev); diff --git a/drivers/net/de600.c b/drivers/net/de600.c index d9b006c9e367..690bb40b353d 100644 --- a/drivers/net/de600.c +++ b/drivers/net/de600.c @@ -265,12 +265,6 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id) int retrig = 0; int boguscount = 0; - /* This might just as well be deleted now, no crummy drivers present :-) */ - if ((dev == NULL) || (DE600_IRQ != irq)) { - printk(KERN_ERR "%s: bogus interrupt %d\n", dev?dev->name:"DE-600", irq); - return IRQ_NONE; - } - spin_lock(&de600_lock); select_nic(); diff --git a/drivers/net/declance.c b/drivers/net/declance.c index e179aa1c1ba0..00e2a8a134d7 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c @@ -696,7 +696,7 @@ out: static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; printk("%s: DMA error\n", dev->name); return IRQ_HANDLED; @@ -704,7 +704,7 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) static irqreturn_t lance_interrupt(const int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct lance_private *lp = netdev_priv(dev); volatile struct lance_regs *ll = lp->ll; int csr0; diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c index 6b1234b09fb3..a79520295fd0 100644 --- a/drivers/net/dgrs.c +++ b/drivers/net/dgrs.c @@ -897,8 +897,8 @@ static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd) static irqreturn_t dgrs_intr(int irq, void *dev_id) { - struct net_device *dev0 = (struct net_device *) dev_id; - DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv; + struct net_device *dev0 = dev_id; + DGRS_PRIV *priv0 = dev0->priv; I596_CB *cbp; int cmd; int i; diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index aae454aaa1c6..fd6e97891e73 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c @@ -1198,17 +1198,11 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev) static irqreturn_t eepro_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; - /* (struct net_device *)(irq2dev_map[irq]);*/ + struct net_device *dev = dev_id; struct eepro_local *lp; int ioaddr, status, boguscount = 20; int handled = 0; - if (dev == NULL) { - printk (KERN_ERR "eepro_interrupt(): irq %d for unknown device.\\n", irq); - return IRQ_NONE; - } - lp = netdev_priv(dev); spin_lock(&lp->lock); diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index 05ca730fe81e..e14be020e562 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c @@ -796,13 +796,6 @@ static irqreturn_t eexp_irq(int irq, void *dev_info) unsigned short ioaddr,status,ack_cmd; unsigned short old_read_ptr, old_write_ptr; - if (dev==NULL) - { - printk(KERN_WARNING "eexpress: irq %d for unknown device\n", - irq); - return IRQ_NONE; - } - lp = netdev_priv(dev); ioaddr = dev->base_addr; diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index 971e2dee1e6b..cebf8c374bc5 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c @@ -662,19 +662,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info) */ static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct ali_ircc_cb *self; int ret; IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); - if (!dev) { - IRDA_WARNING("%s: irq %d for unknown device.\n", - ALI_IRCC_DRIVER_NAME, irq); - return IRQ_NONE; - } - - self = (struct ali_ircc_cb *) dev->priv; + self = dev->priv; spin_lock(&self->lock); diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 7a9128181e68..636d0630fe02 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c @@ -657,12 +657,6 @@ toshoboe_makemttpacket (struct toshoboe_cb *self, void *buf, int mtt) return xbofs; } -static int toshoboe_invalid_dev(int irq) -{ - printk (KERN_WARNING DRIVER_NAME ": irq %d for unknown device.\n", irq); - return 1; -} - #ifdef USE_PROBE /***********************************************************************/ /* Probe code */ @@ -711,12 +705,9 @@ stuff_byte (__u8 byte, __u8 * buf) static irqreturn_t toshoboe_probeinterrupt (int irq, void *dev_id) { - struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; + struct toshoboe_cb *self = dev_id; __u8 irqstat; - if (self == NULL && toshoboe_invalid_dev(irq)) - return IRQ_NONE; - irqstat = INB (OBOE_ISR); /* was it us */ diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c index 6ea78ececca7..654a68b490ae 100644 --- a/drivers/net/irda/irport.c +++ b/drivers/net/irda/irport.c @@ -766,18 +766,14 @@ static inline void irport_receive(struct irport_cb *self) */ static irqreturn_t irport_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct irport_cb *self; int boguscount = 0; int iobase; int iir, lsr; int handled = 0; - if (!dev) { - IRDA_WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq); - return IRQ_NONE; - } - self = (struct irport_cb *) dev->priv; + self = dev->priv; spin_lock(&self->lock); diff --git a/drivers/net/irda/irport.h b/drivers/net/irda/irport.h index 4393168347e3..3f46b84c6c85 100644 --- a/drivers/net/irda/irport.h +++ b/drivers/net/irda/irport.h @@ -74,7 +74,7 @@ struct irport_cb { /* For piggyback drivers */ void *priv; void (*change_speed)(void *priv, __u32 speed); - int (*interrupt)(int irq, void *dev_id); + irqreturn_t (*interrupt)(int irq, void *dev_id); }; #endif /* IRPORT_H */ diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index ea12e999814a..29b5ccd29d0b 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c @@ -2068,17 +2068,12 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase, */ static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct nsc_ircc_cb *self; __u8 bsr, eir; int iobase; - if (!dev) { - IRDA_WARNING("%s: irq %d for unknown device.\n", - driver_name, irq); - return IRQ_NONE; - } - self = (struct nsc_ircc_cb *) dev->priv; + self = dev->priv; spin_lock(&self->lock); diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index b4fb92a7baa8..4212657fa4f9 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c @@ -1113,17 +1113,12 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr) */ static irqreturn_t w83977af_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct w83977af_ir *self; __u8 set, icr, isr; int iobase; - if (!dev) { - printk(KERN_WARNING "%s: irq %d for unknown device.\n", - driver_name, irq); - return IRQ_NONE; - } - self = (struct w83977af_ir *) dev->priv; + self = dev->priv; iobase = self->io.fir_base; diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 7afac47e59ad..6efbd499d752 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c @@ -1019,11 +1019,6 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id) int csr0, ioaddr, boguscnt=10; int must_restart; - if (dev == NULL) { - printk ("lance_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; lp = dev->priv; diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index e5f366910914..5ddd5742f779 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -1201,14 +1201,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) struct ei_device *ei_local; int handled = 0; - if (dev == NULL) - { - printk ("net_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - e8390_base = dev->base_addr; - ei_local = (struct ei_device *) netdev_priv(dev); + ei_local = netdev_priv(dev); /* * Protect the irq test too. diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index c73e2f210774..36f9d988278f 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -2569,13 +2569,6 @@ pcnet32_interrupt(int irq, void *dev_id) u16 csr0; int boguscnt = max_interrupt_work; - if (!dev) { - if (pcnet32_debug & NETIF_MSG_INTR) - printk(KERN_DEBUG "%s(): irq %d for unknown device\n", - __FUNCTION__, irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; lp = dev->priv; diff --git a/drivers/net/plip.c b/drivers/net/plip.c index c0b333d2917a..71afb274498f 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -909,11 +909,6 @@ plip_interrupt(int irq, void *dev_id) struct plip_local *rcv; unsigned char c0; - if (dev == NULL) { - printk(KERN_DEBUG "plip_interrupt: irq %d for unknown device.\n", irq); - return; - } - nl = netdev_priv(dev); rcv = &nl->rcv_data; diff --git a/drivers/net/saa9730.c b/drivers/net/saa9730.c index c9efad8a917e..b269513cde45 100644 --- a/drivers/net/saa9730.c +++ b/drivers/net/saa9730.c @@ -747,7 +747,7 @@ static int lan_saa9730_rx(struct net_device *dev) static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct lan_saa9730_private *lp = netdev_priv(dev); if (lan_saa9730_debug > 5) diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c index dc30dee5537f..b9fa4fbb1398 100644 --- a/drivers/net/sb1000.c +++ b/drivers/net/sb1000.c @@ -1084,19 +1084,13 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id) char *name; unsigned char st; int ioaddr[2]; - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct sb1000_private *lp = netdev_priv(dev); const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; const int MaxRxErrorCount = 6; - if (dev == NULL) { - printk(KERN_ERR "sb1000_interrupt(): irq %d for unknown device.\n", - irq); - return IRQ_NONE; - } - ioaddr[0] = dev->base_addr; /* mem_start holds the second I/O address */ ioaddr[1] = dev->mem_start; diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 06ea2626c6f4..9733a11c6146 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c @@ -616,15 +616,10 @@ static int skfp_close(struct net_device *dev) irqreturn_t skfp_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct s_smc *smc; /* private board structure pointer */ skfddi_priv *bp; - if (dev == NULL) { - printk("%s: irq %d for unknown device\n", dev->name, irq); - return IRQ_NONE; - } - smc = netdev_priv(dev); bp = &smc->os; diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c index cfece9676aff..ed7aa0a5acca 100644 --- a/drivers/net/sonic.c +++ b/drivers/net/sonic.c @@ -295,15 +295,10 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) */ static irqreturn_t sonic_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct sonic_local *lp = netdev_priv(dev); int status; - if (dev == NULL) { - printk(KERN_ERR "sonic_interrupt: irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT)) return IRQ_NONE; diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 45d07faf7b96..9d7cd130c19d 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -2095,8 +2095,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; - struct happy_meal *hp = dev->priv; + struct net_device *dev = dev_id; + struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); HMD(("happy_meal_interrupt: status=%08x ", happy_status)); diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 9207e19cac34..5b00d79b5573 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c @@ -822,7 +822,7 @@ out: static irqreturn_t lance_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct lance_private *lp = netdev_priv(dev); int csr0; diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index 020e78170595..7874eb1ef043 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c @@ -468,7 +468,7 @@ static void qe_tx_reclaim(struct sunqe *qep); */ static irqreturn_t qec_interrupt(int irq, void *dev_id) { - struct sunqec *qecp = (struct sunqec *) dev_id; + struct sunqec *qecp = dev_id; u32 qec_status; int channel = 0; diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 9bd4cba87872..46dabdb12071 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c @@ -1990,15 +1990,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id) __u8 isb_type, isb_subtype; __u16 isb_index; - if(dev == NULL) - { - printk(KERN_CRIT "%s: irq %d for unknown device.\n", dev->name, irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; tp = netdev_priv(dev); - if(tp->status == NOT_INITIALIZED) return IRQ_NONE; diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index c0ab6e44eb1f..ea797ca2b988 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c @@ -751,11 +751,6 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id) unsigned short irq_type; int handled = 0; - if(dev == NULL) { - printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq); - return IRQ_NONE; - } - tp = netdev_priv(dev); irq_type = SIFREADW(SIFSTS); diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index e17f9779ead2..3f4b6408b755 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c @@ -1540,16 +1540,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) static irqreturn_t de4x5_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct de4x5_private *lp; s32 imr, omr, sts, limit; u_long iobase; unsigned int handled = 0; - if (dev == NULL) { - printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } lp = netdev_priv(dev); spin_lock(&lp->lock); iobase = dev->base_addr; diff --git a/drivers/net/wan/cycx_main.c b/drivers/net/wan/cycx_main.c index 12363e056b63..6e5f1c898517 100644 --- a/drivers/net/wan/cycx_main.c +++ b/drivers/net/wan/cycx_main.c @@ -303,9 +303,9 @@ out: return ret; */ static irqreturn_t cycx_isr(int irq, void *dev_id) { - struct cycx_device *card = (struct cycx_device *)dev_id; + struct cycx_device *card = dev_id; - if (!card || card->wandev.state == WAN_UNCONFIGURED) + if (card->wandev.state == WAN_UNCONFIGURED) goto out; if (card->in_isr) { diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index 5715d25271f1..6a485f0556f4 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c @@ -875,13 +875,7 @@ static irqreturn_t sdla_isr(int irq, void *dev_id) dev = dev_id; - if (dev == NULL) - { - printk(KERN_WARNING "sdla_isr(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - - flp = dev->priv; + flp = netdev_priv(dev); if (!flp->initialized) { diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 793da5f69344..b779c7dcc1a8 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c @@ -1954,7 +1954,7 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw) irqreturn_t orinoco_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct orinoco_private *priv = netdev_priv(dev); hermes_t *hw = &priv->hw; int count = MAX_IRQLOOPS_PER_IRQ; diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index cadfe132db84..aafb301041b1 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c @@ -4119,21 +4119,12 @@ static irqreturn_t wavelan_interrupt(int irq, void * dev_id) { - struct net_device * dev; + struct net_device * dev = dev_id; net_local * lp; kio_addr_t base; int status0; u_int tx_status; - if ((dev = dev_id) == NULL) - { -#ifdef DEBUG_INTERRUPT_ERROR - printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n", - irq); -#endif - return IRQ_NONE; - } - #ifdef DEBUG_INTERRUPT_TRACE printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name); #endif diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index a1430352169b..5b98a7876982 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -1155,25 +1155,18 @@ static inline void wl3501_ack_interrupt(struct wl3501_card *this) */ static irqreturn_t wl3501_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct wl3501_card *this; - int handled = 1; - if (!dev) - goto unknown; - this = dev->priv; + this = netdev_priv(dev); spin_lock(&this->lock); wl3501_ack_interrupt(this); wl3501_block_interrupt(this); wl3501_rx_interrupt(dev); wl3501_unblock_interrupt(this); spin_unlock(&this->lock); -out: - return IRQ_RETVAL(handled); -unknown: - handled = 0; - printk(KERN_ERR "%s: irq %d for unknown device.\n", __FUNCTION__, irq); - goto out; + + return IRQ_HANDLED; } static int wl3501_reset_board(struct wl3501_card *this) diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index ac600212d9a9..2412ce4917f2 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c @@ -896,13 +896,6 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance) int boguscnt = max_interrupt_work; unsigned int handled = 0; -#ifndef final_version /* Can never occur. */ - if (dev == NULL) { - printk (KERN_ERR "yellowfin_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } -#endif - yp = netdev_priv(dev); ioaddr = yp->base; diff --git a/drivers/net/znet.c b/drivers/net/znet.c index 2068a109a86c..b24b0727108c 100644 --- a/drivers/net/znet.c +++ b/drivers/net/znet.c @@ -610,11 +610,6 @@ static irqreturn_t znet_interrupt(int irq, void *dev_id) int boguscnt = 20; int handled = 0; - if (dev == NULL) { - printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq); - return IRQ_NONE; - } - spin_lock (&znet->lock); ioaddr = dev->base_addr; From c7bec5aba52392aa8d675b8722735caf4a8b7265 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 15:00:58 -0400 Subject: [PATCH 055/232] Various drivers' irq handlers: kill dead code, needless casts - Eliminate casts to/from void* - Eliminate checks for conditions that never occur. These typically fall into two classes: 1) Checking for 'dev_id == NULL', then it is never called with NULL as an argument. 2) Checking for invalid irq number, when the only caller (the system) guarantees the irq handler is called with the proper 'irq' number argument. Signed-off-by: Jeff Garzik --- drivers/atm/ambassador.c | 7 +------ drivers/atm/horizon.c | 9 --------- drivers/atm/lanai.c | 4 +--- drivers/block/DAC960.c | 14 +++++++------- drivers/cdrom/mcdx.c | 4 ---- drivers/char/rio/func.h | 2 +- drivers/char/rio/rio_linux.c | 4 ++-- drivers/char/rio/riointr.c | 2 +- drivers/char/riscom8.c | 7 +++---- drivers/char/specialix.c | 2 +- drivers/media/video/zoran_device.c | 2 +- drivers/pcmcia/at91_cf.c | 2 +- drivers/pcmcia/hd64465_ss.c | 7 +++---- drivers/scsi/NCR53c406a.c | 8 ++++---- drivers/scsi/aha152x.c | 7 +------ drivers/scsi/aic7xxx_old.c | 12 ++++++------ drivers/scsi/dc395x.c | 2 +- drivers/scsi/qlogicfas408.c | 6 +++--- drivers/scsi/tmscsim.c | 8 ++++---- drivers/scsi/ultrastor.c | 8 ++++---- drivers/serial/68360serial.c | 2 +- drivers/serial/jsm/jsm_neo.c | 2 +- drivers/serial/mpc52xx_uart.c | 10 +--------- drivers/serial/netx-serial.c | 2 +- drivers/serial/pxa.c | 2 +- drivers/sn/ioc3.c | 2 +- drivers/spi/pxa2xx_spi.c | 2 +- sound/isa/gus/gusmax.c | 2 +- sound/isa/gus/interwave.c | 2 +- sound/oss/es1371.c | 2 +- sound/oss/hal2.c | 2 +- sound/oss/i810_audio.c | 2 +- sound/oss/mpu401.c | 2 +- sound/oss/vwsnd.c | 2 +- sound/pci/korg1212/korg1212.c | 4 ---- 35 files changed, 59 insertions(+), 98 deletions(-) diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index 8ff5c4e50823..323592de047b 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c @@ -862,15 +862,10 @@ static inline void interrupts_off (amb_dev * dev) { /********** interrupt handling **********/ static irqreturn_t interrupt_handler(int irq, void *dev_id) { - amb_dev * dev = (amb_dev *) dev_id; + amb_dev * dev = dev_id; PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id); - if (!dev_id) { - PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); - return IRQ_NONE; - } - { u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt)); diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 33e9ee47392b..f59349206dd2 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -1389,15 +1389,6 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id) { PRINTD (DBG_FLOW, "interrupt_handler: %p", dev_id); - if (!dev_id) { - PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); - return IRQ_NONE; - } - if (irq != dev->irq) { - PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); - return IRQ_NONE; - } - // definitely for us irq_ok = 0; while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF) diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 8895f026bea7..267825501dfe 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1892,11 +1892,9 @@ static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason) static irqreturn_t lanai_int(int irq, void *devid) { - struct lanai_dev *lanai = (struct lanai_dev *) devid; + struct lanai_dev *lanai = devid; u32 reason; - (void) irq; /* unused variables */ - #ifdef USE_POWERDOWN /* * If we're powered down we shouldn't be generating any interrupts - diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 3e8ab84b9447..742d07403101 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -5254,7 +5254,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command) static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5295,7 +5295,7 @@ static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5337,7 +5337,7 @@ static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5379,7 +5379,7 @@ static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5417,7 +5417,7 @@ static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5455,7 +5455,7 @@ static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; unsigned long flags; @@ -5493,7 +5493,7 @@ static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; unsigned long flags; diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index 60e1978ec0ea..f574962f4288 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c @@ -850,10 +850,6 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id) struct s_drive_stuff *stuffp = dev_id; unsigned char b; - if (stuffp == NULL) { - xwarn("mcdx: no device for intr %d\n", irq); - return IRQ_NONE; - } #ifdef AK2 if (!stuffp->busy && stuffp->pending) stuffp->int_err = 1; diff --git a/drivers/char/rio/func.h b/drivers/char/rio/func.h index 6b039186856d..9e7283bd81a0 100644 --- a/drivers/char/rio/func.h +++ b/drivers/char/rio/func.h @@ -88,7 +88,7 @@ void RIOHostReset(unsigned int, struct DpRam __iomem *, unsigned int); /* riointr.c */ void RIOTxEnable(char *); -void RIOServiceHost(struct rio_info *, struct Host *, int); +void RIOServiceHost(struct rio_info *, struct Host *); int riotproc(struct rio_info *, struct ttystatics *, int, int); /* rioparam.c */ diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 3bea594600d4..c382df0f82f6 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c @@ -368,7 +368,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr) struct Host *HostP; func_enter(); - HostP = (struct Host *) ptr; /* &p->RIOHosts[(long)ptr]; */ + HostP = ptr; /* &p->RIOHosts[(long)ptr]; */ rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec); /* AAargh! The order in which to do these things is essential and @@ -402,7 +402,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr) return IRQ_HANDLED; } - RIOServiceHost(p, HostP, irq); + RIOServiceHost(p, HostP); rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type); diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c index 0bd09040a5c0..eeda40c5e189 100644 --- a/drivers/char/rio/riointr.c +++ b/drivers/char/rio/riointr.c @@ -181,7 +181,7 @@ static int RupIntr; static int RxIntr; static int TxIntr; -void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From) +void RIOServiceHost(struct rio_info *p, struct Host *HostP) { rio_spin_lock(&HostP->HostLock); if ((HostP->Flags & RUN_STATE) != RC_RUNNING) { diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index be68cfb0ae69..5ab32b38f45a 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c @@ -559,11 +559,10 @@ static irqreturn_t rc_interrupt(int irq, void * dev_id) int handled = 0; bp = IRQ_to_board[irq]; - - if (!bp || !(bp->flags & RC_BOARD_ACTIVE)) { + + if (!(bp->flags & RC_BOARD_ACTIVE)) return IRQ_NONE; - } - + while ((++loop < 16) && ((status = ~(rc_in(bp, RC_BSR))) & (RC_BSR_TOUT | RC_BSR_TINT | RC_BSR_MINT | RC_BSR_RINT))) { diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 6022495571ae..d0b88d0e87fd 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -912,7 +912,7 @@ static irqreturn_t sx_interrupt(int irq, void *dev_id) spin_lock_irqsave(&bp->lock, flags); dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1); - if (!bp || !(bp->flags & SX_BOARD_ACTIVE)) { + if (!(bp->flags & SX_BOARD_ACTIVE)) { dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq); spin_unlock_irqrestore(&bp->lock, flags); func_exit(); diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c index d9d5020a2224..168e431d7c71 100644 --- a/drivers/media/video/zoran_device.c +++ b/drivers/media/video/zoran_device.c @@ -1415,7 +1415,7 @@ zoran_irq (int irq, struct zoran *zr; unsigned long flags; - zr = (struct zoran *) dev_id; + zr = dev_id; count = 0; if (zr->testing) { diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 991e084db2d6..7f5df9a9f393 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -66,7 +66,7 @@ static int at91_cf_ss_init(struct pcmcia_socket *s) static irqreturn_t at91_cf_irq(int irq, void *_cf) { - struct at91_cf_socket *cf = (struct at91_cf_socket *) _cf; + struct at91_cf_socket *cf = _cf; if (irq == cf->board->det_pin) { unsigned present = at91_cf_present(cf); diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c index db3c26b5de14..caca0dc9d30f 100644 --- a/drivers/pcmcia/hd64465_ss.c +++ b/drivers/pcmcia/hd64465_ss.c @@ -650,7 +650,7 @@ static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) */ static int hs_irq_demux(int irq, void *dev) { - hs_socket_t *sp = (hs_socket_t *)dev; + hs_socket_t *sp = dev; u_int cscr; DPRINTK("hs_irq_demux(irq=%d)\n", irq); @@ -673,11 +673,10 @@ static int hs_irq_demux(int irq, void *dev) static irqreturn_t hs_interrupt(int irq, void *dev) { - hs_socket_t *sp = (hs_socket_t *)dev; + hs_socket_t *sp = dev; u_int events = 0; u_int cscr; - - + cscr = hs_in(sp, CSCR); DPRINTK("hs_interrupt, cscr=%04x\n", cscr); diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index 3896278594c7..d4613815f685 100644 --- a/drivers/scsi/NCR53c406a.c +++ b/drivers/scsi/NCR53c406a.c @@ -168,7 +168,7 @@ enum Phase { }; /* Static function prototypes */ -static void NCR53c406a_intr(int, void *); +static void NCR53c406a_intr(void *); static irqreturn_t do_NCR53c406a_intr(int, void *); static void chip_init(void); static void calc_port_addr(void); @@ -685,7 +685,7 @@ static void wait_intr(void) return; } - NCR53c406a_intr(0, NULL, NULL); + NCR53c406a_intr(NULL); } #endif @@ -767,12 +767,12 @@ static irqreturn_t do_NCR53c406a_intr(int unused, void *dev_id) struct Scsi_Host *dev = dev_id; spin_lock_irqsave(dev->host_lock, flags); - NCR53c406a_intr(0, dev_id); + NCR53c406a_intr(dev_id); spin_unlock_irqrestore(dev->host_lock, flags); return IRQ_HANDLED; } -static void NCR53c406a_intr(int unused, void *dev_id) +static void NCR53c406a_intr(void *dev_id) { DEB(unsigned char fifo_size; ) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index e04c2bc1932b..a0d1cee0be77 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -759,12 +759,7 @@ static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, Scsi_Cmnd *SCp) static irqreturn_t swintr(int irqno, void *dev_id) { - struct Scsi_Host *shpnt = (struct Scsi_Host *)dev_id; - - if (!shpnt) { - printk(KERN_ERR "aha152x: catched software interrupt %d for unknown controller.\n", irqno); - return IRQ_NONE; - } + struct Scsi_Host *shpnt = dev_id; HOSTDATA(shpnt)->swint++; diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index 7f0adf9c4c7e..bcd7fffab907 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c @@ -6345,12 +6345,12 @@ aic7xxx_handle_command_completion_intr(struct aic7xxx_host *p) * SCSI controller interrupt handler. *-F*************************************************************************/ static void -aic7xxx_isr(int irq, void *dev_id) +aic7xxx_isr(void *dev_id) { struct aic7xxx_host *p; unsigned char intstat; - p = (struct aic7xxx_host *)dev_id; + p = dev_id; /* * Just a few sanity checks. Make sure that we have an int pending. @@ -6489,7 +6489,7 @@ do_aic7xxx_isr(int irq, void *dev_id) p->flags |= AHC_IN_ISR; do { - aic7xxx_isr(irq, dev_id); + aic7xxx_isr(dev_id); } while ( (aic_inb(p, INTSTAT) & INT_PEND) ); aic7xxx_done_cmds_complete(p); aic7xxx_run_waiting_queues(p); @@ -10377,7 +10377,7 @@ static int __aic7xxx_bus_device_reset(struct scsi_cmnd *cmd) hscb = scb->hscb; - aic7xxx_isr(p->irq, (void *)p); + aic7xxx_isr(p); aic7xxx_done_cmds_complete(p); /* If the command was already complete or just completed, then we didn't * do a reset, return FAILED */ @@ -10608,7 +10608,7 @@ static int __aic7xxx_abort(struct scsi_cmnd *cmd) else return FAILED; - aic7xxx_isr(p->irq, (void *)p); + aic7xxx_isr(p); aic7xxx_done_cmds_complete(p); /* If the command was already complete or just completed, then we didn't * do a reset, return FAILED */ @@ -10863,7 +10863,7 @@ static int aic7xxx_reset(struct scsi_cmnd *cmd) while((aic_inb(p, INTSTAT) & INT_PEND) && !(p->flags & AHC_IN_ISR)) { - aic7xxx_isr(p->irq, p); + aic7xxx_isr(p); pause_sequencer(p); } aic7xxx_done_cmds_complete(p); diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 81e3ee51d897..23f5e418ab55 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -1815,7 +1815,7 @@ static void dc395x_handle_interrupt(struct AdapterCtlBlk *acb, static irqreturn_t dc395x_interrupt(int irq, void *dev_id) { - struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)dev_id; + struct AdapterCtlBlk *acb = dev_id; u16 scsi_status; u8 dma_status; irqreturn_t handled = IRQ_NONE; diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c index 1a7de3bd796f..e0725353c99c 100644 --- a/drivers/scsi/qlogicfas408.c +++ b/drivers/scsi/qlogicfas408.c @@ -405,10 +405,10 @@ static unsigned int ql_pcmd(Scsi_Cmnd * cmd) * Interrupt handler */ -static void ql_ihandl(int irq, void *dev_id) +static void ql_ihandl(void *dev_id) { Scsi_Cmnd *icmd; - struct Scsi_Host *host = (struct Scsi_Host *)dev_id; + struct Scsi_Host *host = dev_id; struct qlogicfas408_priv *priv = get_priv_by_host(host); int qbase = priv->qbase; REG0; @@ -438,7 +438,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id) struct Scsi_Host *host = dev_id; spin_lock_irqsave(host->host_lock, flags); - ql_ihandl(irq, dev_id); + ql_ihandl(dev_id); spin_unlock_irqrestore(host->host_lock, flags); return IRQ_HANDLED; } diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c index 0f0ac925d319..d03aa6ce8fe8 100644 --- a/drivers/scsi/tmscsim.c +++ b/drivers/scsi/tmscsim.c @@ -700,9 +700,9 @@ dc390_InvalidCmd(struct dc390_acb* pACB) static irqreturn_t __inline__ -DC390_Interrupt(int irq, void *dev_id) +DC390_Interrupt(void *dev_id) { - struct dc390_acb *pACB = (struct dc390_acb*)dev_id; + struct dc390_acb *pACB = dev_id; struct dc390_dcb *pDCB; struct dc390_srb *pSRB; u8 sstatus=0; @@ -811,12 +811,12 @@ DC390_Interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static irqreturn_t do_DC390_Interrupt( int irq, void *dev_id) +static irqreturn_t do_DC390_Interrupt(int irq, void *dev_id) { irqreturn_t ret; DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq)); /* Locking is done in DC390_Interrupt */ - ret = DC390_Interrupt(irq, dev_id); + ret = DC390_Interrupt(dev_id); DEBUG1(printk (".. IRQ returned\n")); return ret; } diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 107f0fc34949..56906aba5ee3 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -287,7 +287,7 @@ static const unsigned short ultrastor_ports_14f[] = { }; #endif -static void ultrastor_interrupt(int, void *); +static void ultrastor_interrupt(void *); static irqreturn_t do_ultrastor_interrupt(int, void *); static inline void build_sg_list(struct mscp *, struct scsi_cmnd *SCpnt); @@ -893,7 +893,7 @@ static int ultrastor_abort(struct scsi_cmnd *SCpnt) spin_lock_irqsave(host->host_lock, flags); /* FIXME: Ewww... need to think about passing host around properly */ - ultrastor_interrupt(0, NULL); + ultrastor_interrupt(NULL); spin_unlock_irqrestore(host->host_lock, flags); return SUCCESS; } @@ -1039,7 +1039,7 @@ int ultrastor_biosparam(struct scsi_device *sdev, struct block_device *bdev, return 0; } -static void ultrastor_interrupt(int irq, void *dev_id) +static void ultrastor_interrupt(void *dev_id) { unsigned int status; #if ULTRASTOR_MAX_CMDS > 1 @@ -1177,7 +1177,7 @@ static irqreturn_t do_ultrastor_interrupt(int irq, void *dev_id) struct Scsi_Host *dev = dev_id; spin_lock_irqsave(dev->host_lock, flags); - ultrastor_interrupt(irq, dev_id); + ultrastor_interrupt(dev_id); spin_unlock_irqrestore(dev->host_lock, flags); return IRQ_HANDLED; } diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 4e56ec803861..634ecca36a77 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -620,7 +620,7 @@ static void rs_360_interrupt(int vec, void *dev_id) volatile struct smc_regs *smcp; volatile struct scc_regs *sccp; - info = (ser_info_t *)dev_id; + info = dev_id; idx = PORT_NUM(info->state->smc_scc_num); if (info->state->smc_scc_num & NUM_IS_SCC) { diff --git a/drivers/serial/jsm/jsm_neo.c b/drivers/serial/jsm/jsm_neo.c index 8fa31e68989a..8be8da37f629 100644 --- a/drivers/serial/jsm/jsm_neo.c +++ b/drivers/serial/jsm/jsm_neo.c @@ -1116,7 +1116,7 @@ static void neo_param(struct jsm_channel *ch) */ static irqreturn_t neo_intr(int irq, void *voidbrd) { - struct jsm_board *brd = (struct jsm_board *) voidbrd; + struct jsm_board *brd = voidbrd; struct jsm_channel *ch; int port = 0; int type = 0; diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 039c2fd6d496..4f80c5b4a753 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -512,19 +512,11 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port) static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id) { - struct uart_port *port = (struct uart_port *) dev_id; + struct uart_port *port = dev_id; unsigned long pass = ISR_PASS_LIMIT; unsigned int keepgoing; unsigned short status; - if ( irq != port->irq ) { - printk( KERN_WARNING - "mpc52xx_uart_int : " \ - "Received wrong int %d. Waiting for %d\n", - irq, port->irq); - return IRQ_NONE; - } - spin_lock(&port->lock); /* While we have stuff to do, we continue */ diff --git a/drivers/serial/netx-serial.c b/drivers/serial/netx-serial.c index e92d7e1c22cf..062bad457b1a 100644 --- a/drivers/serial/netx-serial.c +++ b/drivers/serial/netx-serial.c @@ -247,7 +247,7 @@ static void netx_rxint(struct uart_port *port) static irqreturn_t netx_int(int irq, void *dev_id) { - struct uart_port *port = (struct uart_port *)dev_id; + struct uart_port *port = dev_id; unsigned long flags; unsigned char status; diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 846089f222d4..415fe9633a9b 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c @@ -232,7 +232,7 @@ static inline void check_modem_status(struct uart_pxa_port *up) */ static inline irqreturn_t serial_pxa_irq(int irq, void *dev_id) { - struct uart_pxa_port *up = (struct uart_pxa_port *)dev_id; + struct uart_pxa_port *up = dev_id; unsigned int iir, lsr; iir = serial_in(up, UART_IIR); diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c index 3d91b6b9287d..cd6b65333b71 100644 --- a/drivers/sn/ioc3.c +++ b/drivers/sn/ioc3.c @@ -401,7 +401,7 @@ static inline uint32_t get_pending_intrs(struct ioc3_driver_data *idd) static irqreturn_t ioc3_intr_io(int irq, void *arg) { unsigned long flags; - struct ioc3_driver_data *idd = (struct ioc3_driver_data *)arg; + struct ioc3_driver_data *idd = arg; int handled = 1, id; unsigned int pending; diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 77122edeb206..72025df5561d 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c @@ -669,7 +669,7 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data) static irqreturn_t ssp_int(int irq, void *dev_id) { - struct driver_data *drv_data = (struct driver_data *)dev_id; + struct driver_data *drv_data = dev_id; void *reg = drv_data->ioaddr; if (!drv_data->cur_msg) { diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index 52498c9d411e..c1c69e3cbfd0 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c @@ -107,7 +107,7 @@ static int __init snd_gusmax_detect(struct snd_gus_card * gus) static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id) { - struct snd_gusmax *maxcard = (struct snd_gusmax *) dev_id; + struct snd_gusmax *maxcard = dev_id; int loop, max = 5; int handled = 0; diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 5c474b831edc..f12cd09d1fcc 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c @@ -301,7 +301,7 @@ static int __devinit snd_interwave_detect(struct snd_interwave *iwcard, static irqreturn_t snd_interwave_interrupt(int irq, void *dev_id) { - struct snd_interwave *iwcard = (struct snd_interwave *) dev_id; + struct snd_interwave *iwcard = dev_id; int loop, max = 5; int handled = 0; diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index 2562f4769b90..ddf6b0a0bca5 100644 --- a/sound/oss/es1371.c +++ b/sound/oss/es1371.c @@ -1102,7 +1102,7 @@ static void es1371_handle_midi(struct es1371_state *s) static irqreturn_t es1371_interrupt(int irq, void *dev_id) { - struct es1371_state *s = (struct es1371_state *)dev_id; + struct es1371_state *s = dev_id; unsigned int intsrc, sctl; /* fastpath out, to ease interrupt sharing */ diff --git a/sound/oss/hal2.c b/sound/oss/hal2.c index 7807abac0625..784bdd707055 100644 --- a/sound/oss/hal2.c +++ b/sound/oss/hal2.c @@ -372,7 +372,7 @@ static void hal2_adc_interrupt(struct hal2_codec *adc) static irqreturn_t hal2_interrupt(int irq, void *dev_id) { - struct hal2_card *hal2 = (struct hal2_card*)dev_id; + struct hal2_card *hal2 = dev_id; irqreturn_t ret = IRQ_NONE; /* decide what caused this interrupt */ diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c index a48af879b466..240cc7939b69 100644 --- a/sound/oss/i810_audio.c +++ b/sound/oss/i810_audio.c @@ -1525,7 +1525,7 @@ static void i810_channel_interrupt(struct i810_card *card) static irqreturn_t i810_interrupt(int irq, void *dev_id) { - struct i810_card *card = (struct i810_card *)dev_id; + struct i810_card *card = dev_id; u32 status; spin_lock(&card->lock); diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c index 58d4a5d05a27..e96220541971 100644 --- a/sound/oss/mpu401.c +++ b/sound/oss/mpu401.c @@ -435,7 +435,7 @@ static void mpu401_input_loop(struct mpu_config *devc) static irqreturn_t mpuintr(int irq, void *dev_id) { struct mpu_config *devc; - int dev = (int) dev_id; + int dev = (int)(unsigned long) dev_id; int handled = 0; devc = &dev_conf[dev]; diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c index 0cd4d6ec9862..6dfb9f4b03ec 100644 --- a/sound/oss/vwsnd.c +++ b/sound/oss/vwsnd.c @@ -2235,7 +2235,7 @@ static void vwsnd_audio_write_intr(vwsnd_dev_t *devc, unsigned int status) static irqreturn_t vwsnd_audio_intr(int irq, void *dev_id) { - vwsnd_dev_t *devc = (vwsnd_dev_t *) dev_id; + vwsnd_dev_t *devc = dev_id; unsigned int status; DBGEV("(irq=%d, dev_id=0x%p)\n", irq, dev_id); diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 398aa10a06e8..fa8cd8cecc21 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -1124,9 +1124,6 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id) u32 doorbellValue; struct snd_korg1212 *korg1212 = dev_id; - if(irq != korg1212->irq) - return IRQ_NONE; - doorbellValue = readl(korg1212->inDoorbellPtr); if (!doorbellValue) @@ -1140,7 +1137,6 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id) korg1212->inIRQ++; - switch (doorbellValue) { case K1212_DB_DSPDownloadDone: K1212_DEBUG_PRINTK("K1212_DEBUG: IRQ DNLD count - %ld, %x, [%s].\n", From 8f4aff6cb178b0a580ee206e7cca63e2d31f4a4e Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 15:03:04 -0400 Subject: [PATCH 056/232] drivers/net/eepro: kill dead code The irq2dev_map has not been used for a long time. Signed-off-by: Jeff Garzik --- drivers/net/eepro.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index fd6e97891e73..a4eb0dc99ecf 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c @@ -994,16 +994,6 @@ static int eepro_open(struct net_device *dev) return -EAGAIN; } -#ifdef irq2dev_map - if (((irq2dev_map[dev->irq] != 0) - || (irq2dev_map[dev->irq] = dev) == 0) && - (irq2dev_map[dev->irq]!=dev)) { - /* printk("%s: IRQ map wrong\n", dev->name); */ - free_irq(dev->irq, dev); - return -EAGAIN; - } -#endif - /* Initialize the 82595. */ eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ @@ -1282,10 +1272,6 @@ static int eepro_close(struct net_device *dev) /* release the interrupt */ free_irq(dev->irq, dev); -#ifdef irq2dev_map - irq2dev_map[dev->irq] = 0; -#endif - /* Update the statistics here. What statistics? */ return 0; From d87dbede030d17770aa6a6170e70ab6f8044e5ae Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 15:04:35 -0400 Subject: [PATCH 057/232] drivers/isdn/act2000: kill irq2card_map Eliminate irq->card lookup table, by properly passing the card pointer via request_irq() like other drivers. Signed-off-by: Jeff Garzik --- drivers/isdn/act2000/act2000_isa.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 3014495b7ff7..3cac23739344 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -16,8 +16,6 @@ #include "act2000_isa.h" #include "capi.h" -static act2000_card *irq2card_map[16]; - /* * Reset Controller, then try to read the Card's signature. + Return: @@ -65,14 +63,9 @@ act2000_isa_detect(unsigned short portbase) static irqreturn_t act2000_isa_interrupt(int irq, void *dev_id) { - act2000_card *card = irq2card_map[irq]; + act2000_card *card = dev_id; u_char istatus; - if (!card) { - printk(KERN_WARNING - "act2000: Spurious interrupt!\n"); - return IRQ_NONE; - } istatus = (inb(ISA_PORT_ISR) & 0x07); if (istatus & ISA_ISR_OUT) { /* RX fifo has data */ @@ -139,17 +132,15 @@ int act2000_isa_config_irq(act2000_card * card, short irq) { if (card->flags & ACT2000_FLAGS_IVALID) { - free_irq(card->irq, NULL); - irq2card_map[card->irq] = NULL; + free_irq(card->irq, card); } card->flags &= ~ACT2000_FLAGS_IVALID; outb(ISA_COR_IRQOFF, ISA_PORT_COR); if (!irq) return 0; - if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) { + if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) { card->irq = irq; - irq2card_map[card->irq] = card; card->flags |= ACT2000_FLAGS_IVALID; printk(KERN_WARNING "act2000: Could not request irq %d\n",irq); @@ -188,10 +179,9 @@ act2000_isa_release(act2000_card * card) unsigned long flags; spin_lock_irqsave(&card->lock, flags); - if (card->flags & ACT2000_FLAGS_IVALID) { - free_irq(card->irq, NULL); - irq2card_map[card->irq] = NULL; - } + if (card->flags & ACT2000_FLAGS_IVALID) + free_irq(card->irq, card); + card->flags &= ~ACT2000_FLAGS_IVALID; if (card->flags & ACT2000_FLAGS_PVALID) release_region(card->port, ISA_REGION); From b7696ee3c050a76a6cebccdbadfc93896b336e44 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 6 Oct 2006 20:53:10 +0200 Subject: [PATCH 058/232] [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 Signed-off-by: Linus Torvalds --- drivers/scsi/mesh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index c773e35dace7..1fd3c7590d31 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c @@ -466,7 +466,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) dlog(ms, "intr b4 arb, intr/exc/err/fc=%.8x", MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count)); - mesh_interrupt(0, (void *)ms, NULL); + mesh_interrupt(0, (void *)ms); if (ms->phase != arbitrating) return; } @@ -504,7 +504,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) dlog(ms, "intr after disresel, intr/exc/err/fc=%.8x", MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count)); - mesh_interrupt(0, (void *)ms, NULL); + mesh_interrupt(0, (void *)ms); if (ms->phase != arbitrating) return; dlog(ms, "after intr after disresel, intr/exc/err/fc=%.8x", From e317c8ccaaf900abf39cc3240e4dc5ba82a3cc67 Mon Sep 17 00:00:00 2001 From: Frederik Deweerdt Date: Fri, 6 Oct 2006 18:58:24 +0000 Subject: [PATCH 059/232] [PATCH] ixp4xxdefconfig arm fixes With the following patch, the ixp4xxdefconfig builds correctly. I'll test some more configs if I get some time. Signed-off-by: Frederik Deweerdt Signed-off-by: Linus Torvalds --- arch/arm/kernel/time.c | 3 ++- kernel/irq/resend.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index b094e3e81981..c03cab5c4c79 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -327,7 +328,7 @@ EXPORT_SYMBOL(restore_time_delta); void timer_tick(void) { struct pt_regs *regs = get_irq_regs(); - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); do_leds(); do_set_rtc(); do_timer(1); diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c index 35f10f7ff94a..5bfeaed7e487 100644 --- a/kernel/irq/resend.c +++ b/kernel/irq/resend.c @@ -38,7 +38,7 @@ static void resend_irqs(unsigned long arg) clear_bit(irq, irqs_resend); desc = irq_desc + irq; local_irq_disable(); - desc->handle_irq(irq, desc, NULL); + desc->handle_irq(irq, desc); local_irq_enable(); } } From e630015504cdd4d166c371fec39b8ca258fcbc0e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 6 Oct 2006 13:11:15 -0700 Subject: [PATCH 060/232] ARM: fix up nested irq regs usage This should fix up the per-cpu irq register pointer if we have nested hardware interrupts. Signed-off-by: Linus Torvalds --- arch/arm/kernel/irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index e999b11de2c6..2c4ff1cbe334 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -111,6 +111,7 @@ static struct irq_desc bad_irq_desc = { */ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) { + struct pt_regs *old_regs = set_irq_regs(regs); struct irqdesc *desc = irq_desc + irq; /* @@ -122,13 +123,13 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) irq_enter(); - set_irq_regs(regs); desc_handle_irq(irq, desc); /* AT91 specific workaround */ irq_finish(irq); irq_exit(); + set_irq_regs(old_regs); } void set_irq_flags(unsigned int irq, unsigned int iflags) From d150ad7bd946f066c98a9725685109dcffae0cba Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 6 Oct 2006 13:28:09 -0700 Subject: [PATCH 061/232] [PATCH] x86_64 irq_regs fix smp_apic_timer_interrupt() needs to stack the pt_regs* for profile_tick. If any other of those APIC interrupt handlers want to run get_irq_regs() then their C entrypoint handlers will need the same treatment. Cc: Andi Kleen Cc: David Howells Signed-off-by: Andrew Morton Acked-by: Andrew Vasquez Signed-off-by: Linus Torvalds --- arch/x86_64/kernel/apic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index af4a1c71a80d..4d9d5ed942b2 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c @@ -913,8 +913,10 @@ void smp_local_timer_interrupt(void) * [ if a single-CPU system runs an SMP kernel then we call the local * interrupt as well. Thus we cannot inline the local irq ... ] */ -void smp_apic_timer_interrupt(void) +void smp_apic_timer_interrupt(struct pt_regs *regs) { + struct pt_regs *old_regs = set_irq_regs(regs); + /* * the NMI deadlock-detector uses this. */ @@ -934,6 +936,7 @@ void smp_apic_timer_interrupt(void) irq_enter(); smp_local_timer_interrupt(); irq_exit(); + set_irq_regs(old_regs); } /* From 2b00b254debd707571f20149dbd4b45264a120e5 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Thu, 5 Oct 2006 21:16:48 -0500 Subject: [PATCH 062/232] [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 Signed-off-by: Paul Mackerras --- arch/powerpc/sysdev/fsl_soc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 7d759f1c26b1..dbe92ae20333 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c @@ -567,7 +567,7 @@ static int __init fs_enet_of_init(void) struct resource r[4]; struct device_node *phy, *mdio; struct fs_platform_info fs_enet_data; - const unsigned int *id, *phy_addr, phy_irq; + const unsigned int *id, *phy_addr, *phy_irq; const void *mac_addr; const phandle *ph; const char *model; @@ -641,7 +641,7 @@ static int __init fs_enet_of_init(void) if (strstr(model, "FCC")) { int fcc_index = *id - 1; - unsigned char* mdio_bb_prop; + const unsigned char *mdio_bb_prop; fs_enet_data.dpram_offset = (u32)cpm_dpram_addr(0); fs_enet_data.rx_ring = 32; @@ -708,8 +708,9 @@ static int __init fs_enet_of_init(void) ret = platform_device_add_data(fs_enet_dev, &fs_enet_data, sizeof(struct fs_platform_info)); - if (ret) - goto unreg; + if (ret) + goto unreg; + } } return 0; From b75f3f751c17e01544bd6706e54efae35d66d446 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 6 Oct 2006 13:53:12 +1000 Subject: [PATCH 063/232] [POWERPC] Update iseries_defconfig This make sure that an iseries_defconfig does not inlude other platforms. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/configs/iseries_defconfig | 86 +++++++++++++++++++++----- 1 file changed, 69 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig index d58f82f836f8..b5005506c2f8 100644 --- a/arch/powerpc/configs/iseries_defconfig +++ b/arch/powerpc/configs/iseries_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc6 -# Sun Sep 10 10:22:57 2006 +# Linux kernel version: 2.6.19-rc1 +# Fri Oct 6 13:25:04 2006 # CONFIG_PPC64=y CONFIG_64BIT=y @@ -22,6 +22,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_PPC_OF=y # CONFIG_PPC_UDBG_16550 is not set # CONFIG_GENERIC_TBSYNC is not set +CONFIG_AUDIT_ARCH=y # CONFIG_DEFAULT_UIMAGE is not set # @@ -52,10 +53,11 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y +# CONFIG_IPC_NS is not set CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set -CONFIG_SYSCTL=y +# CONFIG_UTS_NS is not set CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_IKCONFIG=y @@ -64,7 +66,9 @@ CONFIG_IKCONFIG_PROC=y # CONFIG_RELAY is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y # CONFIG_EMBEDDED is not set +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set @@ -73,12 +77,12 @@ CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y -CONFIG_RT_MUTEXES=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_SLAB=y CONFIG_VM_EVENT_COUNTERS=y +CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set @@ -97,6 +101,7 @@ CONFIG_STOP_MACHINE=y # # Block layer # +CONFIG_BLOCK=y # CONFIG_BLK_DEV_IO_TRACE is not set # @@ -115,13 +120,18 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # # Platform support # -# CONFIG_PPC_MULTIPLATFORM is not set -CONFIG_PPC_ISERIES=y +CONFIG_PPC_MULTIPLATFORM=y # CONFIG_EMBEDDED6xx is not set # CONFIG_APUS is not set +# CONFIG_PPC_PSERIES is not set +CONFIG_PPC_ISERIES=y +# CONFIG_PPC_PMAC is not set +# CONFIG_PPC_MAPLE is not set +# CONFIG_PPC_PASEMI is not set # CONFIG_PPC_CELL is not set # CONFIG_PPC_CELL_NATIVE is not set -# CONFIG_UDBG_RTAS_CONSOLE is not set +# CONFIG_PPC_IBM_CELL_BLADE is not set +# CONFIG_U3_DART is not set # CONFIG_PPC_RTAS is not set # CONFIG_MMIO_NVRAM is not set CONFIG_IBMVIO=y @@ -147,12 +157,15 @@ CONFIG_BINFMT_ELF=y CONFIG_FORCE_MAX_ZONEORDER=13 CONFIG_IOMMU_VMERGE=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +# CONFIG_KEXEC is not set +# CONFIG_CRASH_DUMP is not set CONFIG_IRQ_ALL_CPUS=y CONFIG_LPARCFG=y # CONFIG_NUMA is not set CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set @@ -179,6 +192,7 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_PCI=y CONFIG_PCI_DOMAINS=y # CONFIG_PCIEPORTBUS is not set +# CONFIG_PCI_MULTITHREAD_PROBE is not set # CONFIG_PCI_DEBUG is not set # @@ -206,6 +220,7 @@ CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_XFRM=y CONFIG_XFRM_USER=m +CONFIG_XFRM_SUB_POLICY=y CONFIG_NET_KEY=m CONFIG_INET=y CONFIG_IP_MULTICAST=y @@ -224,10 +239,12 @@ CONFIG_INET_XFRM_TUNNEL=m CONFIG_INET_TUNNEL=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=m CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_BIC=y +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" # # IP: Virtual Server Configuration @@ -247,6 +264,7 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_XTABLES=m CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m CONFIG_NETFILTER_XT_TARGET_MARK=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_NOTRACK=m @@ -255,6 +273,7 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m # CONFIG_NETFILTER_XT_MATCH_DCCP is not set +CONFIG_NETFILTER_XT_MATCH_DSCP=m # CONFIG_NETFILTER_XT_MATCH_ESP is not set CONFIG_NETFILTER_XT_MATCH_HELPER=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m @@ -294,7 +313,6 @@ CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_DSCP=m # CONFIG_IP_NF_MATCH_AH is not set CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_OWNER=m @@ -319,7 +337,6 @@ CONFIG_IP_NF_NAT_AMANDA=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_TTL=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_RAW=m @@ -351,7 +368,6 @@ CONFIG_LLC=y # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set @@ -433,6 +449,7 @@ CONFIG_BLK_DEV_INITRD=y # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=y +CONFIG_SCSI_NETLINK=y CONFIG_SCSI_PROC_FS=y # @@ -454,12 +471,14 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set # -# SCSI Transport Attributes +# SCSI Transports # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set +CONFIG_SCSI_SAS_ATTRS=m +CONFIG_SCSI_SAS_LIBSAS=m +CONFIG_SCSI_SAS_LIBSAS_DEBUG=y # # SCSI low-level drivers @@ -472,10 +491,11 @@ CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_ARCMSR is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set -# CONFIG_ATA is not set # CONFIG_SCSI_HPTIOP is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -486,15 +506,21 @@ CONFIG_SCSI_FC_ATTRS=y CONFIG_SCSI_IBMVSCSI=m # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set # CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set +# +# Serial ATA (prod) and Parallel ATA (experimental) drivers +# +# CONFIG_ATA is not set + # # Multi-device support (RAID and LVM) # @@ -508,6 +534,7 @@ CONFIG_MD_RAID10=m CONFIG_MD_MULTIPATH=m CONFIG_MD_FAULTY=m CONFIG_BLK_DEV_DM=y +# CONFIG_DM_DEBUG is not set CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_MIRROR=m @@ -573,6 +600,7 @@ CONFIG_MII=y # CONFIG_HP100 is not set CONFIG_NET_PCI=y CONFIG_PCNET32=y +CONFIG_PCNET32_NAPI=y # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_B44 is not set @@ -610,6 +638,7 @@ CONFIG_E1000=m # CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # CONFIG_BNX2 is not set +# CONFIG_QLA3XXX is not set # # Ethernet (10000 Mbit) @@ -649,6 +678,7 @@ CONFIG_PPP_BSDCOMP=m # CONFIG_PPP_MPPE is not set CONFIG_PPPOE=m # CONFIG_SLIP is not set +CONFIG_SLHC=m # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=y @@ -671,6 +701,7 @@ CONFIG_NET_POLL_CONTROLLER=y # Input device support # CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set # # Userland interfaces @@ -774,12 +805,12 @@ CONFIG_MAX_RAW_DEVS=256 # # Misc devices # +# CONFIG_TIFM_CORE is not set # # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -893,6 +924,9 @@ CONFIG_XFS_FS=m CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y # CONFIG_XFS_RT is not set +CONFIG_GFS2_FS=m +CONFIG_GFS2_FS_LOCKING_NOLOCK=m +CONFIG_GFS2_FS_LOCKING_DLM=m # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -929,12 +963,14 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y CONFIG_SYSFS=y CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y -# CONFIG_CONFIGFS_FS is not set +CONFIG_CONFIGFS_FS=m # # Miscellaneous filesystems @@ -988,6 +1024,7 @@ CONFIG_CIFS_POSIX=y # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set +CONFIG_GENERIC_ACL=y # # Partition Types @@ -1039,6 +1076,12 @@ CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Distributed Lock Manager +# +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set + # # iSeries device drivers # @@ -1073,6 +1116,7 @@ CONFIG_PLIST=y # Kernel hacking # # CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y # CONFIG_UNUSED_SYMBOLS is not set CONFIG_DEBUG_KERNEL=y @@ -1091,6 +1135,7 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set # CONFIG_FORCED_INLINING is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y @@ -1109,6 +1154,10 @@ CONFIG_IRQSTACKS=y # Cryptographic options # CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=m CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m @@ -1118,9 +1167,12 @@ CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m From 27db2d0cb9b56210dc1e29bc89a7413f3ae67b91 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 6 Oct 2006 13:54:28 +1000 Subject: [PATCH 064/232] [POWERPC] Fix viocons for irq breakage Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/char/viocons.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index a362ee9c92dd..6d2e314860df 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -947,7 +947,7 @@ static void vioHandleData(struct HvLpEvent *event) */ continue; } else if (vio_sysrq_pressed) { - handle_sysrq(cevent->data[index], NULL, tty); + handle_sysrq(cevent->data[index], tty); vio_sysrq_pressed = 0; /* * continue because we don't want to add From 1224f373c974eacc46fe5e1073422c794d0b0d34 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 6 Oct 2006 13:55:26 +1000 Subject: [PATCH 065/232] [POWERPC] Fix iseries/smp.c for irq breakage Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/iseries/irq.c | 7 ++----- arch/powerpc/platforms/iseries/smp.c | 6 ++++-- arch/powerpc/platforms/iseries/smp.h | 6 ++++++ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 arch/powerpc/platforms/iseries/smp.h diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index e32446877e78..44c245672dd8 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c @@ -43,10 +43,7 @@ #include "irq.h" #include "pci.h" #include "call_pci.h" - -#if defined(CONFIG_SMP) -extern void iSeries_smp_message_recv(struct pt_regs *); -#endif +#include "smp.h" #ifdef CONFIG_PCI @@ -315,7 +312,7 @@ unsigned int iSeries_get_irq(struct pt_regs *regs) #ifdef CONFIG_SMP if (get_lppaca()->int_dword.fields.ipi_cnt) { get_lppaca()->int_dword.fields.ipi_cnt = 0; - iSeries_smp_message_recv(regs); + iSeries_smp_message_recv(); } #endif /* CONFIG_SMP */ if (hvlpevent_is_pending()) diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c index 2eb095edb472..aee5908df700 100644 --- a/arch/powerpc/platforms/iseries/smp.c +++ b/arch/powerpc/platforms/iseries/smp.c @@ -43,9 +43,11 @@ #include #include +#include "smp.h" + static unsigned long iSeries_smp_message[NR_CPUS]; -void iSeries_smp_message_recv(struct pt_regs *regs) +void iSeries_smp_message_recv(void) { int cpu = smp_processor_id(); int msg; @@ -55,7 +57,7 @@ void iSeries_smp_message_recv(struct pt_regs *regs) for (msg = 0; msg < 4; msg++) if (test_and_clear_bit(msg, &iSeries_smp_message[cpu])) - smp_message_recv(msg, regs); + smp_message_recv(msg); } static inline void smp_iSeries_do_message(int cpu, int msg) diff --git a/arch/powerpc/platforms/iseries/smp.h b/arch/powerpc/platforms/iseries/smp.h new file mode 100644 index 000000000000..d501f7de01e7 --- /dev/null +++ b/arch/powerpc/platforms/iseries/smp.h @@ -0,0 +1,6 @@ +#ifndef _PLATFORMS_ISERIES_SMP_H +#define _PLATFORMS_ISERIES_SMP_H + +extern void iSeries_smp_message_recv(void); + +#endif /* _PLATFORMS_ISERIES_SMP_H */ From be577a5220b25e0a6e3fbf96bbfc8b31d63e9ea9 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 6 Oct 2006 20:47:23 -0600 Subject: [PATCH 066/232] Build fixes for struct pt_regs removal Signed-off-by: Matthew Wilcox --- arch/parisc/kernel/irq.c | 6 +++--- arch/parisc/kernel/time.c | 2 +- drivers/input/keyboard/hil_kbd.c | 2 +- drivers/input/mouse/hil_ptr.c | 2 +- drivers/input/serio/gscps2.c | 4 ++-- drivers/input/serio/hil_mlc.c | 32 ++++++++++++++++---------------- drivers/net/lasi_82596.c | 2 +- drivers/parisc/dino.c | 2 +- drivers/parisc/eisa.c | 2 +- drivers/serial/mux.c | 2 +- include/asm-parisc/irq_regs.h | 1 + 11 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 include/asm-parisc/irq_regs.h diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 9bdd0197ceb7..2ece7c7939fe 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@ -35,8 +35,8 @@ #undef PARISC_IRQ_CR16_COUNTS -extern irqreturn_t timer_interrupt(int, void *, struct pt_regs *); -extern irqreturn_t ipi_interrupt(int, void *, struct pt_regs *); +extern irqreturn_t timer_interrupt(int, void *); +extern irqreturn_t ipi_interrupt(int, void *); #define EIEM_MASK(irq) (1UL<<(CPU_IRQ_MAX - irq)) @@ -375,7 +375,7 @@ void do_cpu_irq_mask(struct pt_regs *regs) goto set_out; } #endif - __do_IRQ(irq, regs); + __do_IRQ(irq); out: irq_exit(); diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 1d58ce0e37ad..b44839203e69 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -66,7 +66,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* gcc can optimize for "read-only" case with a local clocktick */ unsigned long cpt = clocktick; - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); /* Initialize next_tick to the expected tick time. */ next_tick = cpu_data[cpu].it_value; diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index c9b0b8978cd8..e774dd31e99b 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c @@ -328,7 +328,7 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) kbd->dev->id.vendor = PCI_VENDOR_ID_HP; kbd->dev->id.product = 0x0001; /* TODO: get from kbd->rsc */ kbd->dev->id.version = 0x0100; /* TODO: get from kbd->rsc */ - kbd->dev->dev = &serio->dev; + kbd->dev->cdev.dev = &serio->dev; for (i = 0; i < 128; i++) { set_bit(hil_kbd_set1[i], kbd->dev->keybit); diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c index 402b057e986e..4f2b503c1ac7 100644 --- a/drivers/input/mouse/hil_ptr.c +++ b/drivers/input/mouse/hil_ptr.c @@ -375,7 +375,7 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) ptr->dev->id.vendor = PCI_VENDOR_ID_HP; ptr->dev->id.product = 0x0001; /* TODO: get from ptr->rsc */ ptr->dev->id.version = 0x0100; /* TODO: get from ptr->rsc */ - ptr->dev->dev = &serio->dev; + ptr->dev->cdev.dev = &serio->dev; input_register_device(ptr->dev); printk(KERN_INFO "input: %s (%s), ID: %d\n", diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 081fdc3c7737..74f14e097789 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -166,7 +166,7 @@ static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data) /* make sure any received data is returned as fast as possible */ /* this is important e.g. when we set the LEDs on the keyboard */ - gscps2_interrupt(0, NULL, NULL); + gscps2_interrupt(0, NULL); return 1; } @@ -306,7 +306,7 @@ static int gscps2_open(struct serio *port) /* enable it */ gscps2_enable(ps2port, ENABLE); - gscps2_interrupt(0, NULL, NULL); + gscps2_interrupt(0, NULL); return 0; } diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index bbbe15e21904..bdfde046b741 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c @@ -162,10 +162,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) { if (did != (p & HIL_PKT_ADDR_MASK) >> 8) { if (drv == NULL || drv->interrupt == NULL) goto skip; - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); - drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); - drv->interrupt(serio, HIL_CMD_POL + cnt, 0, NULL); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, HIL_ERR_INT >> 16, 0); + drv->interrupt(serio, HIL_PKT_CMD >> 8, 0); + drv->interrupt(serio, HIL_CMD_POL + cnt, 0); skip: did = (p & HIL_PKT_ADDR_MASK) >> 8; serio = did ? mlc->serio[mlc->di_map[did-1]] : NULL; @@ -174,10 +174,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) { } cnt++; i++; if (drv == NULL || drv->interrupt == NULL) continue; - drv->interrupt(serio, (p >> 24), 0, NULL); - drv->interrupt(serio, (p >> 16) & 0xff, 0, NULL); - drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0, NULL); - drv->interrupt(serio, p & 0xff, 0, NULL); + drv->interrupt(serio, (p >> 24), 0); + drv->interrupt(serio, (p >> 16) & 0xff, 0); + drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0); + drv->interrupt(serio, p & 0xff, 0); } } @@ -780,16 +780,16 @@ static int hil_mlc_serio_write(struct serio *serio, unsigned char c) { while ((last != idx) && (*last == 0)) last--; while (idx != last) { - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, *idx, 0, NULL); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, HIL_ERR_INT >> 16, 0); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, *idx, 0); idx++; } - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); - drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); - drv->interrupt(serio, *idx, 0, NULL); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, HIL_ERR_INT >> 16, 0); + drv->interrupt(serio, HIL_PKT_CMD >> 8, 0); + drv->interrupt(serio, *idx, 0); mlc->serio_oidx[map->didx] = 0; mlc->serio_opacket[map->didx] = 0; diff --git a/drivers/net/lasi_82596.c b/drivers/net/lasi_82596.c index 8cbd940f0ac2..f4d815bca643 100644 --- a/drivers/net/lasi_82596.c +++ b/drivers/net/lasi_82596.c @@ -1252,7 +1252,7 @@ static int __devinit i82596_probe(struct net_device *dev, static void i596_poll_controller(struct net_device *dev) { disable_irq(dev->irq); - i596_interrupt(dev->irq, dev, NULL); + i596_interrupt(dev->irq, dev); enable_irq(dev->irq); } #endif diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index a0a8fd8d2124..03c763c2d0e0 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -389,7 +389,7 @@ ilr_again: int irq = dino_dev->global_irq[local_irq]; DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n", __FUNCTION__, irq, intr_dev, mask); - __do_IRQ(irq, regs); + __do_IRQ(irq); mask &= ~(1 << local_irq); } while (mask); diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 094562e044f3..e97cecbc4d18 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -234,7 +234,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) } spin_unlock_irqrestore(&eisa_irq_lock, flags); - __do_IRQ(irq, regs); + __do_IRQ(irq); spin_lock_irqsave(&eisa_irq_lock, flags); /* unmask */ diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c index aa819d3f8ee5..8ad1b8c5ec5d 100644 --- a/drivers/serial/mux.c +++ b/drivers/serial/mux.c @@ -230,7 +230,7 @@ static void mux_read(struct uart_port *port) continue; } - if (uart_handle_sysrq_char(port, data & 0xffu, NULL)) + if (uart_handle_sysrq_char(port, data & 0xffu)) continue; tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL); diff --git a/include/asm-parisc/irq_regs.h b/include/asm-parisc/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-parisc/irq_regs.h @@ -0,0 +1 @@ +#include From e11e30a063b515e95fb590f1558b5fea21273c63 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Sat, 7 Oct 2006 05:11:07 -0600 Subject: [PATCH 067/232] [PARISC] Use set_irq_regs Actually set the irq_regs pointer. Signed-off-by: Matthew Wilcox --- arch/parisc/kernel/irq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 2ece7c7939fe..b39c5b9aff46 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@ -347,12 +347,14 @@ static inline int eirr_to_irq(unsigned long eirr) /* ONLY called from entry.S:intr_extint() */ void do_cpu_irq_mask(struct pt_regs *regs) { + struct pt_regs *old_regs; unsigned long eirr_val; int irq, cpu = smp_processor_id(); #ifdef CONFIG_SMP cpumask_t dest; #endif + old_regs = set_irq_regs(regs); local_irq_disable(); irq_enter(); @@ -379,6 +381,7 @@ void do_cpu_irq_mask(struct pt_regs *regs) out: irq_exit(); + set_irq_regs(old_regs); return; set_out: From ba0e427f215b1c58881a737f46d30ae03b83178c Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Wed, 4 Oct 2006 22:57:28 -0600 Subject: [PATCH 068/232] [PA-RISC] Fix boot breakage Conditionals were the wrong way around. Turns out I was booting the wrong kernel when testing the original fix. Signed-off-by: Matthew Wilcox --- arch/parisc/kernel/drivers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 2b257e4f17df..d6c486e9501c 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c @@ -424,7 +424,7 @@ struct parisc_device * create_tree_node(char id, struct device *parent) /* make the generic dma mask a pointer to the parisc one */ dev->dev.dma_mask = &dev->dma_mask; dev->dev.coherent_dma_mask = dev->dma_mask; - if (!device_register(&dev->dev)) { + if (device_register(&dev->dev)) { kfree(dev); return NULL; } @@ -853,9 +853,9 @@ static void print_parisc_device(struct parisc_device *dev) */ void init_parisc_bus(void) { - if (!bus_register(&parisc_bus_type)) + if (bus_register(&parisc_bus_type)) panic("Could not register PA-RISC bus type\n"); - if (!device_register(&root)) + if (device_register(&root)) panic("Could not register PA-RISC root device\n"); get_device(&root); } From 09690b18b7b9696bb719b246e77c7af9952da12c Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 5 Oct 2006 23:45:45 -0400 Subject: [PATCH 069/232] [PARISC] Make firmware calls irqsafe-ish... There's no reason why we shouldn't be using _irqsave instead of _irq for any of these calls. fwiw, this fixes the "start_kernel(): bug: interrupts were enabled early" message displayed on bootup recently. Signed-off-by: Kyle McMartin Signed-off-by: Matthew Wilcox --- arch/parisc/kernel/firmware.c | 250 +++++++++++++++++++++------------- arch/parisc/kernel/time.c | 8 +- 2 files changed, 159 insertions(+), 99 deletions(-) diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index c2531ae032cf..9158b707c0dd 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -160,13 +160,14 @@ void __init set_firmware_width(void) { #ifdef __LP64__ int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); convert_to_wide(pdc_result); if(pdc_result[0] != NARROW_FIRMWARE) parisc_narrow_firmware = 0; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); #endif } @@ -196,10 +197,11 @@ void pdc_emergency_unlock(void) int pdc_add_valid(unsigned long address) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_ADD_VALID, PDC_ADD_VALID_VERIFY, address); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -216,15 +218,16 @@ EXPORT_SYMBOL(pdc_add_valid); int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); memcpy(&pdc_result, chassis_info, sizeof(*chassis_info)); memcpy(&pdc_result2, led_info, len); retval = mem_pdc_call(PDC_CHASSIS, PDC_RETURN_CHASSIS_INFO, __pa(pdc_result), __pa(pdc_result2), len); memcpy(chassis_info, pdc_result, sizeof(*chassis_info)); memcpy(led_info, pdc_result2, len); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -239,13 +242,14 @@ int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_inf int pdc_pat_chassis_send_log(unsigned long state, unsigned long data) { int retval = 0; + unsigned long flags; if (!is_pdc_pat()) return -1; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_CHASSIS_LOG, PDC_PAT_CHASSIS_WRITE_LOG, __pa(&state), __pa(&data)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -258,10 +262,11 @@ int pdc_pat_chassis_send_log(unsigned long state, unsigned long data) int pdc_chassis_disp(unsigned long disp) { int retval = 0; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_DISP, disp); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -273,11 +278,12 @@ int pdc_chassis_disp(unsigned long disp) int pdc_chassis_warn(unsigned long *warn) { int retval = 0; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_WARN, __pa(pdc_result)); *warn = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -292,15 +298,16 @@ int pdc_chassis_warn(unsigned long *warn) int __init pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result)); convert_to_wide(pdc_result); pdc_coproc_info->ccr_functional = pdc_result[0]; pdc_coproc_info->ccr_present = pdc_result[1]; pdc_coproc_info->revision = pdc_result[17]; pdc_coproc_info->model = pdc_result[18]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -320,14 +327,15 @@ int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index, void *iodc_data, unsigned int iodc_data_size) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_IODC, PDC_IODC_READ, __pa(pdc_result), hpa, index, __pa(pdc_result2), iodc_data_size); convert_to_wide(pdc_result); *actcnt = pdc_result[0]; memcpy(iodc_data, pdc_result2, iodc_data_size); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -346,14 +354,15 @@ int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info, struct pdc_module_path *mod_path, long mod_index) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_MODULE, __pa(pdc_result), __pa(pdc_result2), mod_index); convert_to_wide(pdc_result); memcpy(pdc_mod_info, pdc_result, sizeof(*pdc_mod_info)); memcpy(mod_path, pdc_result2, sizeof(*mod_path)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); pdc_mod_info->mod_addr = f_extend(pdc_mod_info->mod_addr); return retval; @@ -372,13 +381,14 @@ int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info, long mod_index, long addr_index) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_ADDRESS, __pa(pdc_result), mod_index, addr_index); convert_to_wide(pdc_result); memcpy(pdc_addr_info, pdc_result, sizeof(*pdc_addr_info)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); pdc_addr_info->mod_addr = f_extend(pdc_addr_info->mod_addr); return retval; @@ -393,12 +403,13 @@ int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info, int pdc_model_info(struct pdc_model *model) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_INFO, __pa(pdc_result), 0); convert_to_wide(pdc_result); memcpy(model, pdc_result, sizeof(*model)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -414,8 +425,9 @@ int pdc_model_info(struct pdc_model *model) int pdc_model_sysmodel(char *name) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_SYSMODEL, __pa(pdc_result), OS_ID_HPUX, __pa(name)); convert_to_wide(pdc_result); @@ -425,7 +437,7 @@ int pdc_model_sysmodel(char *name) } else { name[0] = 0; } - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -443,12 +455,13 @@ int pdc_model_sysmodel(char *name) int pdc_model_versions(unsigned long *versions, int id) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_VERSIONS, __pa(pdc_result), id); convert_to_wide(pdc_result); *versions = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -463,13 +476,14 @@ int pdc_model_versions(unsigned long *versions, int id) int pdc_model_cpuid(unsigned long *cpu_id) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); pdc_result[0] = 0; /* preset zero (call may not be implemented!) */ retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CPU_ID, __pa(pdc_result), 0); convert_to_wide(pdc_result); *cpu_id = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -484,13 +498,14 @@ int pdc_model_cpuid(unsigned long *cpu_id) int pdc_model_capabilities(unsigned long *capabilities) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); pdc_result[0] = 0; /* preset zero (call may not be implemented!) */ retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); convert_to_wide(pdc_result); *capabilities = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -504,12 +519,13 @@ int pdc_model_capabilities(unsigned long *capabilities) int pdc_cache_info(struct pdc_cache_info *cache_info) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_INFO, __pa(pdc_result), 0); convert_to_wide(pdc_result); memcpy(cache_info, pdc_result, sizeof(*cache_info)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -523,13 +539,14 @@ int pdc_cache_info(struct pdc_cache_info *cache_info) int pdc_spaceid_bits(unsigned long *space_bits) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); pdc_result[0] = 0; retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_RET_SPID, __pa(pdc_result), 0); convert_to_wide(pdc_result); *space_bits = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -544,11 +561,12 @@ int pdc_spaceid_bits(unsigned long *space_bits) int pdc_btlb_info(struct pdc_btlb_info *btlb) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0); memcpy(btlb, pdc_result, sizeof(*btlb)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); if(retval < 0) { btlb->max_size = 0; @@ -572,13 +590,14 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address, struct pdc_module_path *mod_path) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); memcpy(pdc_result2, mod_path, sizeof(*mod_path)); retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result), __pa(pdc_result2)); memcpy(address, pdc_result, sizeof(*address)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -594,8 +613,9 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address, int pdc_lan_station_id(char *lan_addr, unsigned long hpa) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_LAN_STATION_ID, PDC_LAN_STATION_ID_READ, __pa(pdc_result), hpa); if (retval < 0) { @@ -604,7 +624,7 @@ int pdc_lan_station_id(char *lan_addr, unsigned long hpa) } else { memcpy(lan_addr, pdc_result, PDC_LAN_STATION_ID_SIZE); } - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -623,13 +643,14 @@ EXPORT_SYMBOL(pdc_lan_station_id); int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_READ, staddr, __pa(pdc_result), count); convert_to_wide(pdc_result); memcpy(memaddr, pdc_result, count); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -648,13 +669,14 @@ EXPORT_SYMBOL(pdc_stable_read); int pdc_stable_write(unsigned long staddr, void *memaddr, unsigned long count) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); memcpy(pdc_result, memaddr, count); convert_to_wide(pdc_result); retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_WRITE, staddr, __pa(pdc_result), count); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -672,11 +694,12 @@ EXPORT_SYMBOL(pdc_stable_write); int pdc_stable_get_size(unsigned long *size) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_RETURN_SIZE, __pa(pdc_result)); *size = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -691,10 +714,11 @@ EXPORT_SYMBOL(pdc_stable_get_size); int pdc_stable_verify_contents(void) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_VERIFY_CONTENTS); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -709,10 +733,11 @@ EXPORT_SYMBOL(pdc_stable_verify_contents); int pdc_stable_initialize(void) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_INITIALIZE); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -735,8 +760,9 @@ EXPORT_SYMBOL(pdc_stable_initialize); int pdc_get_initiator(struct hardware_path *hwpath, struct pdc_initiator *initiator) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); /* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */ #define IS_SPROCKETS() (strlen(boot_cpu_data.pdc.sys_model_name) == 14 && \ @@ -776,7 +802,8 @@ int pdc_get_initiator(struct hardware_path *hwpath, struct pdc_initiator *initia } out: - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); + return (retval >= PDC_OK); } EXPORT_SYMBOL(pdc_get_initiator); @@ -794,13 +821,14 @@ EXPORT_SYMBOL(pdc_get_initiator); int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL_SIZE, __pa(pdc_result), hpa); convert_to_wide(pdc_result); *num_entries = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -817,14 +845,15 @@ int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa) int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl) { int retval; + unsigned long flags; BUG_ON((unsigned long)tbl & 0x7); - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); pdc_result[0] = num_entries; retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL, __pa(pdc_result), hpa, __pa(tbl)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -842,12 +871,15 @@ int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl) unsigned int pdc_pci_config_read(void *hpa, unsigned long cfg_addr) { int retval; - spin_lock_irq(&pdc_lock); + unsigned long flags; + + spin_lock_irqsave(&pdc_lock, flags); pdc_result[0] = 0; pdc_result[1] = 0; retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_READ_CONFIG, __pa(pdc_result), hpa, cfg_addr&~3UL, 4UL); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); + return retval ? ~0 : (unsigned int) pdc_result[0]; } @@ -863,12 +895,15 @@ unsigned int pdc_pci_config_read(void *hpa, unsigned long cfg_addr) void pdc_pci_config_write(void *hpa, unsigned long cfg_addr, unsigned int val) { int retval; - spin_lock_irq(&pdc_lock); + unsigned long flags; + + spin_lock_irqsave(&pdc_lock, flags); pdc_result[0] = 0; retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_WRITE_CONFIG, __pa(pdc_result), hpa, cfg_addr&~3UL, 4UL, (unsigned long) val); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); + return retval; } #endif /* UNTESTED CODE */ @@ -882,12 +917,13 @@ void pdc_pci_config_write(void *hpa, unsigned long cfg_addr, unsigned int val) int pdc_tod_read(struct pdc_tod *tod) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_TOD, PDC_TOD_READ, __pa(pdc_result), 0); convert_to_wide(pdc_result); memcpy(tod, pdc_result, sizeof(*tod)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -903,10 +939,11 @@ EXPORT_SYMBOL(pdc_tod_read); int pdc_tod_set(unsigned long sec, unsigned long usec) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_TOD, PDC_TOD_WRITE, sec, usec); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -917,13 +954,14 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, struct pdc_memory_table *tbl, unsigned long entries) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_MEM, PDC_MEM_TABLE, __pa(pdc_result), __pa(pdc_result2), entries); convert_to_wide(pdc_result); memcpy(r_addr, pdc_result, sizeof(*r_addr)); memcpy(tbl, pdc_result2, entries * sizeof(*tbl)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -936,11 +974,12 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, int pdc_do_firm_test_reset(unsigned long ftc_bitmap) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_FIRM_TEST_RESET, PDC_FIRM_TEST_MAGIC, ftc_bitmap); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -953,10 +992,11 @@ int pdc_do_firm_test_reset(unsigned long ftc_bitmap) int pdc_do_reset(void) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_RESET); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -970,16 +1010,17 @@ int pdc_do_reset(void) int __init pdc_soft_power_info(unsigned long *power_reg) { int retval; + unsigned long flags; *power_reg = (unsigned long) (-1); - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_SOFT_POWER, PDC_SOFT_POWER_INFO, __pa(pdc_result), 0); if (retval == PDC_OK) { convert_to_wide(pdc_result); *power_reg = f_extend(pdc_result[0]); } - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -998,9 +1039,12 @@ int __init pdc_soft_power_info(unsigned long *power_reg) int pdc_soft_power_button(int sw_control) { int retval; - spin_lock_irq(&pdc_lock); + unsigned long flags; + + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_SOFT_POWER, PDC_SOFT_POWER_ENABLE, __pa(pdc_result), sw_control); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); + return retval; } @@ -1011,9 +1055,11 @@ int pdc_soft_power_button(int sw_control) */ void pdc_io_reset(void) { - spin_lock_irq(&pdc_lock); + unsigned long flags; + + spin_lock_irqsave(&pdc_lock, flags); mem_pdc_call(PDC_IO, PDC_IO_RESET, 0); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); } /* @@ -1027,9 +1073,11 @@ void pdc_io_reset(void) */ void pdc_io_reset_devices(void) { - spin_lock_irq(&pdc_lock); + unsigned long flags; + + spin_lock_irqsave(&pdc_lock, flags); mem_pdc_call(PDC_IO, PDC_IO_RESET_DEVICES, 0); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); } @@ -1146,10 +1194,11 @@ int pdc_sti_call(unsigned long func, unsigned long flags, unsigned long glob_cfg) { int retval; + unsigned long irqflags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, irqflags); retval = real32_call(func, flags, inptr, outputr, glob_cfg); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, irqflags); return retval; } @@ -1166,11 +1215,12 @@ EXPORT_SYMBOL(pdc_sti_call); int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_GET_NUMBER, __pa(pdc_result)); memcpy(cell_info, pdc_result, sizeof(*cell_info)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -1190,16 +1240,17 @@ int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long unsigned long view_type, void *mem_addr) { int retval; + unsigned long flags; static struct pdc_pat_cell_mod_maddr_block result __attribute__ ((aligned (8))); - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_MODULE, __pa(pdc_result), ploc, mod, view_type, __pa(&result)); if(!retval) { *actcnt = pdc_result[0]; memcpy(mem_addr, &result, *actcnt); } - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -1214,12 +1265,13 @@ int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_CPU, PDC_PAT_CPU_GET_NUMBER, __pa(&pdc_result), hpa); memcpy(cpu_info, pdc_result, sizeof(*cpu_info)); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -1235,12 +1287,13 @@ int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa) int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE, __pa(pdc_result), cell_num); *num_entries = pdc_result[0]; - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -1255,11 +1308,12 @@ int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num) int pdc_pat_get_irt(void *r_addr, unsigned long cell_num) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE, __pa(r_addr), cell_num); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -1276,13 +1330,14 @@ int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr, unsigned long count, unsigned long offset) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_PD, PDC_PAT_PD_GET_ADDR_MAP, __pa(pdc_result), __pa(pdc_result2), count, offset); *actual_len = pdc_result[0]; memcpy(mem_addr, pdc_result2, *actual_len); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -1297,7 +1352,9 @@ int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr, int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr) { int retval; - spin_lock_irq(&pdc_lock); + unsigned long flags; + + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ, __pa(pdc_result), pci_addr, pci_size); switch(pci_size) { @@ -1305,7 +1362,7 @@ int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr) case 2: *(u16 *)mem_addr = (u16) pdc_result[0]; case 4: *(u32 *)mem_addr = (u32) pdc_result[0]; } - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } @@ -1321,11 +1378,12 @@ int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr) int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val) { int retval; + unsigned long flags; - spin_lock_irq(&pdc_lock); + spin_lock_irqsave(&pdc_lock, flags); retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_WRITE, pci_addr, pci_size, val); - spin_unlock_irq(&pdc_lock); + spin_unlock_irqrestore(&pdc_lock, flags); return retval; } diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index b44839203e69..8c9b8a7ef244 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -319,13 +319,15 @@ void __init time_init(void) start_cpu_itimer(); /* get CPU 0 started */ - if(pdc_tod_read(&tod_data) == 0) { - write_seqlock_irq(&xtime_lock); + if (pdc_tod_read(&tod_data) == 0) { + unsigned long flags; + + write_seqlock_irqsave(&xtime_lock, flags); xtime.tv_sec = tod_data.tod_sec; xtime.tv_nsec = tod_data.tod_usec * 1000; set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); - write_sequnlock_irq(&xtime_lock); + write_sequnlock_irqrestore(&xtime_lock, flags); } else { printk(KERN_ERR "Error reading tod clock\n"); xtime.tv_sec = 0; From bbd6330ea1154fc13a351263160d4f9cca2ff5d9 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 6 Oct 2006 23:45:09 -0400 Subject: [PATCH 070/232] [PARISC] pdc_init no longer exists Just a stale prototype Signed-off-by: Matthew Wilcox --- include/asm-parisc/pdc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h index c9b2e35326ee..423c2b84b4a0 100644 --- a/include/asm-parisc/pdc.h +++ b/include/asm-parisc/pdc.h @@ -774,8 +774,6 @@ int pdc_sti_call(unsigned long func, unsigned long flags, unsigned long inptr, unsigned long outputr, unsigned long glob_cfg); -extern void pdc_init(void); - static inline char * os_id_to_string(u16 os_id) { switch(os_id) { case OS_ID_NONE: return "No OS"; From c7753f18711782738936f224aaa421468e87f6ed Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Sat, 7 Oct 2006 06:01:11 -0600 Subject: [PATCH 071/232] [PARISC] More pt_regs removal Remove pt_regs from ipi_interrupt and timer_interrupt. Inline smp_do_timer() into its only caller, and unify the SMP and non-SMP paths. Fixes a profiling bug. Signed-off-by: Matthew Wilcox --- arch/parisc/kernel/smp.c | 15 +-------------- arch/parisc/kernel/time.c | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index faad338f310e..4a23a97b06cd 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -154,7 +154,7 @@ halt_processor(void) irqreturn_t -ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) +ipi_interrupt(int irq, void *dev_id) { int this_cpu = smp_processor_id(); struct cpuinfo_parisc *p = &cpu_data[this_cpu]; @@ -414,19 +414,6 @@ smp_flush_tlb_all(void) on_each_cpu(flush_tlb_all_local, NULL, 1, 1); } - -void -smp_do_timer(struct pt_regs *regs) -{ - int cpu = smp_processor_id(); - struct cpuinfo_parisc *data = &cpu_data[cpu]; - - if (!--data->prof_counter) { - data->prof_counter = data->prof_multiplier; - update_process_times(user_mode(regs)); - } -} - /* * Called by secondaries to update state and initialize CPU registers. */ diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 8c9b8a7ef244..bad7d1eb62b9 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -34,10 +34,6 @@ static unsigned long clocktick __read_mostly; /* timer cycles per tick */ -#ifdef CONFIG_SMP -extern void smp_do_timer(struct pt_regs *regs); -#endif - /* * We keep time on PA-RISC Linux by using the Interval Timer which is * a pair of registers; one is read-only and one is write-only; both @@ -55,13 +51,14 @@ extern void smp_do_timer(struct pt_regs *regs); * held off for an arbitrarily long period of time by interrupts being * disabled, so we may miss one or more ticks. */ -irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t timer_interrupt(int irq, void *dev_id) { unsigned long now; unsigned long next_tick; unsigned long cycles_elapsed, ticks_elapsed; unsigned long cycles_remainder; unsigned int cpu = smp_processor_id(); + struct cpuinfo_parisc *cpuinfo = &cpu_data[cpu]; /* gcc can optimize for "read-only" case with a local clocktick */ unsigned long cpt = clocktick; @@ -69,7 +66,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) profile_tick(CPU_PROFILING); /* Initialize next_tick to the expected tick time. */ - next_tick = cpu_data[cpu].it_value; + next_tick = cpuinfo->it_value; /* Get current interval timer. * CR16 reads as 64 bits in CPU wide mode. @@ -120,7 +117,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) */ next_tick = now + cycles_remainder; - cpu_data[cpu].it_value = next_tick; + cpuinfo->it_value = next_tick; /* Skip one clocktick on purpose if we are likely to miss next_tick. * We want to avoid the new next_tick being less than CR16. @@ -131,18 +128,19 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) next_tick += cpt; /* Program the IT when to deliver the next interrupt. */ - /* Only bottom 32-bits of next_tick are written to cr16. */ + /* Only bottom 32-bits of next_tick are written to cr16. */ mtctl(next_tick, 16); /* Done mucking with unreliable delivery of interrupts. * Go do system house keeping. */ -#ifdef CONFIG_SMP - smp_do_timer(regs); -#else - update_process_times(user_mode(regs)); -#endif + + if (!--cpuinfo->prof_counter) { + cpuinfo->prof_counter = cpuinfo->prof_multiplier; + update_process_times(user_mode(get_irq_regs())); + } + if (cpu == 0) { write_seqlock(&xtime_lock); do_timer(ticks_elapsed); From 35a84c2f56e0f77ea2c5a4327b17104705f4c8c7 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Sat, 7 Oct 2006 22:08:26 +1000 Subject: [PATCH 072/232] [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 Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/ibmebus.c | 2 +- arch/powerpc/kernel/irq.c | 2 +- arch/powerpc/kernel/time.c | 2 +- arch/powerpc/platforms/82xx/mpc82xx_ads.c | 5 ++--- arch/powerpc/platforms/85xx/mpc85xx_ads.c | 5 ++--- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 7 ++++--- arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 5 ++--- arch/powerpc/platforms/cell/interrupt.c | 5 ++--- arch/powerpc/platforms/chrp/setup.c | 7 +++---- arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | 5 ++--- arch/powerpc/platforms/iseries/irq.c | 10 +++++----- arch/powerpc/platforms/iseries/irq.h | 2 +- arch/powerpc/platforms/iseries/lpevents.c | 4 ++-- arch/powerpc/platforms/iseries/mf.c | 4 ++-- arch/powerpc/platforms/iseries/viopath.c | 2 +- arch/powerpc/platforms/powermac/pic.c | 12 ++++++------ arch/powerpc/platforms/powermac/pic.h | 4 ++-- arch/powerpc/platforms/powermac/smp.c | 8 ++++---- arch/powerpc/platforms/pseries/setup.c | 2 +- arch/powerpc/platforms/pseries/xics.c | 4 ++-- arch/powerpc/sysdev/cpm2_pic.c | 2 +- arch/powerpc/sysdev/cpm2_pic.h | 2 +- arch/powerpc/sysdev/i8259.c | 2 +- arch/powerpc/sysdev/ipic.c | 2 +- arch/powerpc/sysdev/mpic.c | 6 +++--- arch/powerpc/sysdev/qe_lib/qe_ic.c | 14 ++++++-------- arch/powerpc/sysdev/tsi108_pci.c | 3 +-- arch/ppc/platforms/85xx/mpc8560_ads.c | 6 +++--- arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 6 +++--- arch/ppc/platforms/85xx/stx_gp3.c | 6 +++--- arch/ppc/platforms/85xx/tqm85xx.c | 6 +++--- arch/ppc/syslib/i8259.c | 2 +- include/asm-powerpc/i8259.h | 4 ++-- include/asm-powerpc/ibmebus.h | 2 +- include/asm-powerpc/ipic.h | 4 ++-- include/asm-powerpc/iseries/hv_lp_event.h | 2 +- include/asm-powerpc/iseries/it_lp_queue.h | 2 +- include/asm-powerpc/machdep.h | 2 +- include/asm-powerpc/mpic.h | 4 ++-- include/asm-ppc/machdep.h | 2 +- 40 files changed, 84 insertions(+), 92 deletions(-) diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 124dbcba94a8..da9fe254eb94 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c @@ -319,7 +319,7 @@ EXPORT_SYMBOL(ibmebus_unregister_driver); int ibmebus_request_irq(struct ibmebus_dev *dev, u32 ist, - irqreturn_t (*handler)(int, void*, struct pt_regs *), + irqreturn_t (*handler)(int, void*), unsigned long irq_flags, const char * devname, void *dev_id) { diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 5deaab3090b4..829ac18b566c 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -217,7 +217,7 @@ void do_IRQ(struct pt_regs *regs) * The value -2 is for buggy hardware and means that this IRQ * has already been handled. -- Tom */ - irq = ppc_md.get_irq(regs); + irq = ppc_md.get_irq(); if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) { #ifdef CONFIG_IRQSTACKS diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index d210d0a5006b..5b59bc18dfe7 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -706,7 +706,7 @@ void timer_interrupt(struct pt_regs * regs) #ifdef CONFIG_PPC_ISERIES if (hvlpevent_is_pending()) - process_hvlpevents(regs); + process_hvlpevents(); #endif #ifdef CONFIG_PPC64 diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c index 4276f087f26e..0cea42a8053d 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c +++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c @@ -384,8 +384,7 @@ struct hw_interrupt_type m82xx_pci_ic = { }; static void -m82xx_pci_irq_demux(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +m82xx_pci_irq_demux(unsigned int irq, struct irq_desc *desc) { unsigned long stat, mask, pend; int bit; @@ -398,7 +397,7 @@ m82xx_pci_irq_demux(unsigned int irq, struct irq_desc *desc, break; for (bit = 0; pend != 0; ++bit, pend <<= 1) { if (pend & 0x80000000) - __do_IRQ(pci_int_base + bit, regs); + __do_IRQ(pci_int_base + bit); } } } diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 8af7126fc6b9..d3e669d69c73 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c @@ -66,12 +66,11 @@ mpc85xx_pcibios_fixup(void) #ifdef CONFIG_CPM2 -static void cpm2_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) { int cascade_irq; - while ((cascade_irq = cpm2_get_irq(regs)) >= 0) { + while ((cascade_irq = cpm2_get_irq()) >= 0) { generic_handle_irq(cascade_irq); } desc->chip->eoi(irq); diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index b92fc6976a47..953cd5dd3f54 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c @@ -132,10 +132,9 @@ mpc85xx_cds_pcibios_fixup(void) #ifdef CONFIG_PPC_I8259 #warning The i8259 PIC support is currently broken -static void mpc85xx_8259_cascade(unsigned int irq, struct - irq_desc *desc, struct pt_regs *regs) +static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc) { - unsigned int cascade_irq = i8259_irq(regs); + unsigned int cascade_irq = i8259_irq(); if (cascade_irq != NO_IRQ) generic_handle_irq(cascade_irq); @@ -150,8 +149,10 @@ void __init mpc85xx_cds_pic_init(void) struct mpic *mpic; struct resource r; struct device_node *np = NULL; +#ifdef CONFIG_PPC_I8259 struct device_node *cascade_node = NULL; int cascade_irq; +#endif np = of_find_node_by_type(np, "open-pic"); diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index 8218703babde..1a1c226ad4d9 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c @@ -53,10 +53,9 @@ unsigned long pci_dram_offset = 0; #ifdef CONFIG_PCI -static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc) { - unsigned int cascade_irq = i8259_irq(regs); + unsigned int cascade_irq = i8259_irq(); if (cascade_irq != NO_IRQ) generic_handle_irq(cascade_irq); desc->chip->eoi(irq); diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index f8768b096f02..a914c12b4060 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c @@ -98,8 +98,7 @@ static void iic_ioexc_eoi(unsigned int irq) { } -static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc) { struct cbe_iic_regs __iomem *node_iic = (void __iomem *)desc->handler_data; unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC; @@ -140,7 +139,7 @@ static struct irq_chip iic_ioexc_chip = { }; /* Get an IRQ number from the pending state register of the IIC */ -static unsigned int iic_get_irq(struct pt_regs *regs) +static unsigned int iic_get_irq(void) { struct cbe_iic_pending_bits pending; struct iic *iic; diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 35cd7a5f6834..cae3d13229b9 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c @@ -70,7 +70,7 @@ unsigned long event_scan_interval; * has to include (to get irqreturn_t), which * causes all sorts of problems. -- paulus */ -extern irqreturn_t xmon_irq(int, void *, struct pt_regs *); +extern irqreturn_t xmon_irq(int, void *); extern unsigned long loops_per_jiffy; @@ -335,10 +335,9 @@ chrp_event_scan(unsigned long unused) jiffies + event_scan_interval); } -static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc) { - unsigned int cascade_irq = i8259_irq(regs); + unsigned int cascade_irq = i8259_irq(); if (cascade_irq != NO_IRQ) generic_handle_irq(cascade_irq); desc->chip->eoi(irq); diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c index cb6f084844f2..bdb475c65cba 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c @@ -61,8 +61,7 @@ pci_dram_offset = MPC7448_HPC2_PCI_MEM_OFFSET; extern int tsi108_setup_pci(struct device_node *dev); extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); extern void tsi108_pci_int_init(void); -extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs); +extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc); int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn) { @@ -200,7 +199,7 @@ static void __init mpc7448_hpc2_init_IRQ(void) tsi_pic = of_find_node_by_type(NULL, "open-pic"); if (tsi_pic) { unsigned int size; - void *prop = get_property(tsi_pic, "reg", &size); + const void *prop = get_property(tsi_pic, "reg", &size); mpic_paddr = of_translate_address(tsi_pic, prop); } diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index 44c245672dd8..5225abfafd9b 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c @@ -85,7 +85,7 @@ static DEFINE_SPINLOCK(pending_irqs_lock); static int num_pending_irqs; static int pending_irqs[NR_IRQS]; -static void int_received(struct pci_event *event, struct pt_regs *regs) +static void int_received(struct pci_event *event) { int irq; @@ -143,11 +143,11 @@ static void int_received(struct pci_event *event, struct pt_regs *regs) } } -static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs) +static void pci_event_handler(struct HvLpEvent *event) { if (event && (event->xType == HvLpEvent_Type_PciIo)) { if (hvlpevent_is_int(event)) - int_received((struct pci_event *)event, regs); + int_received((struct pci_event *)event); else printk(KERN_ERR "pci_event_handler: unexpected ack received\n"); @@ -305,7 +305,7 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus, /* * Get the next pending IRQ. */ -unsigned int iSeries_get_irq(struct pt_regs *regs) +unsigned int iSeries_get_irq(void) { int irq = NO_IRQ_IGNORE; @@ -316,7 +316,7 @@ unsigned int iSeries_get_irq(struct pt_regs *regs) } #endif /* CONFIG_SMP */ if (hvlpevent_is_pending()) - process_hvlpevents(regs); + process_hvlpevents(); #ifdef CONFIG_PCI if (num_pending_irqs) { diff --git a/arch/powerpc/platforms/iseries/irq.h b/arch/powerpc/platforms/iseries/irq.h index 1ee8985140e5..69f1b437fc7b 100644 --- a/arch/powerpc/platforms/iseries/irq.h +++ b/arch/powerpc/platforms/iseries/irq.h @@ -4,6 +4,6 @@ extern void iSeries_init_IRQ(void); extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, u32); extern void iSeries_activate_IRQs(void); -extern unsigned int iSeries_get_irq(struct pt_regs *); +extern unsigned int iSeries_get_irq(void); #endif /* _ISERIES_IRQ_H */ diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c index 98c1c2440aad..e3e929e1b460 100644 --- a/arch/powerpc/platforms/iseries/lpevents.c +++ b/arch/powerpc/platforms/iseries/lpevents.c @@ -116,7 +116,7 @@ static void hvlpevent_clear_valid(struct HvLpEvent * event) hvlpevent_invalidate(event); } -void process_hvlpevents(struct pt_regs *regs) +void process_hvlpevents(void) { struct HvLpEvent * event; @@ -144,7 +144,7 @@ void process_hvlpevents(struct pt_regs *regs) __get_cpu_var(hvlpevent_counts)[event->xType]++; if (event->xType < HvLpEvent_Type_NumTypes && lpEventHandler[event->xType]) - lpEventHandler[event->xType](event, regs); + lpEventHandler[event->xType](event); else printk(KERN_INFO "Unexpected Lp Event type=%d\n", event->xType ); diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 1983b640bac1..b5737d68d6c4 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c @@ -513,7 +513,7 @@ static void handle_ack(struct io_mf_lp_event *event) * parse it enough to know if it is an interrupt or an * acknowledge. */ -static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs) +static void hv_handler(struct HvLpEvent *event) { if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) { if (hvlpevent_is_ack(event)) @@ -847,7 +847,7 @@ static int mf_get_boot_rtc(struct rtc_time *tm) /* We need to poll here as we are not yet taking interrupts */ while (rtc_data.busy) { if (hvlpevent_is_pending()) - process_hvlpevents(NULL); + process_hvlpevents(); } return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm); } diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index 9baa4ee82592..04e07e5da0c1 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c @@ -378,7 +378,7 @@ void vio_set_hostlp(void) } EXPORT_SYMBOL(vio_set_hostlp); -static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) +static void vio_handleEvent(struct HvLpEvent *event) { HvLpIndex remoteLp; int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK) diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 5da677835c00..39db12890214 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c @@ -42,7 +42,7 @@ * has to include (to get irqreturn_t), which * causes all sorts of problems. -- paulus */ -extern irqreturn_t xmon_irq(int, void *, struct pt_regs *); +extern irqreturn_t xmon_irq(int, void *); #ifdef CONFIG_PPC32 struct pmac_irq_hw { @@ -210,7 +210,7 @@ static struct irq_chip pmac_pic = { .retrigger = pmac_retrigger, }; -static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs) +static irqreturn_t gatwick_action(int cpl, void *dev_id) { unsigned long flags; int irq, bits; @@ -235,18 +235,18 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs) return rc; } -static unsigned int pmac_pic_get_irq(struct pt_regs *regs) +static unsigned int pmac_pic_get_irq(void) { int irq; unsigned long bits = 0; unsigned long flags; #ifdef CONFIG_SMP - void psurge_smp_message_recv(struct pt_regs *); + void psurge_smp_message_recv(void); /* IPI's are a hack on the powersurge -- Cort */ if ( smp_processor_id() != 0 ) { - psurge_smp_message_recv(regs); + psurge_smp_message_recv(); return NO_IRQ_IGNORE; /* ignore, already handled */ } #endif /* CONFIG_SMP */ @@ -444,7 +444,7 @@ static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc) { struct mpic *mpic = desc->handler_data; - unsigned int cascade_irq = mpic_get_one_irq(mpic, get_irq_regs()); + unsigned int cascade_irq = mpic_get_one_irq(mpic); if (cascade_irq != NO_IRQ) generic_handle_irq(cascade_irq); desc->chip->eoi(irq); diff --git a/arch/powerpc/platforms/powermac/pic.h b/arch/powerpc/platforms/powermac/pic.h index 664103dfeef9..c44c89f5e532 100644 --- a/arch/powerpc/platforms/powermac/pic.h +++ b/arch/powerpc/platforms/powermac/pic.h @@ -5,7 +5,7 @@ extern struct hw_interrupt_type pmac_pic; -void pmac_pic_init(void); -int pmac_get_irq(struct pt_regs *regs); +extern void pmac_pic_init(void); +extern int pmac_get_irq(void); #endif /* __PPC_PLATFORMS_PMAC_PIC_H */ diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 1949b657b092..574cd205b302 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c @@ -160,7 +160,7 @@ static inline void psurge_clr_ipi(int cpu) */ static unsigned long psurge_smp_message[NR_CPUS]; -void psurge_smp_message_recv(struct pt_regs *regs) +void psurge_smp_message_recv(void) { int cpu = smp_processor_id(); int msg; @@ -174,12 +174,12 @@ void psurge_smp_message_recv(struct pt_regs *regs) /* make sure there is a message there */ for (msg = 0; msg < 4; msg++) if (test_and_clear_bit(msg, &psurge_smp_message[cpu])) - smp_message_recv(msg, regs); + smp_message_recv(msg); } -irqreturn_t psurge_primary_intr(int irq, void *d, struct pt_regs *regs) +irqreturn_t psurge_primary_intr(int irq, void *d) { - psurge_smp_message_recv(regs); + psurge_smp_message_recv(); return IRQ_HANDLED; } diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index ad9aec2c6fee..89a8119f988d 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -123,7 +123,7 @@ static void __init fwnmi_init(void) void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc) { - unsigned int cascade_irq = i8259_irq(get_irq_regs()); + unsigned int cascade_irq = i8259_irq(); if (cascade_irq != NO_IRQ) generic_handle_irq(cascade_irq); desc->chip->eoi(irq); diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index f6bd2f285153..d071abe78ab1 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c @@ -308,14 +308,14 @@ static inline unsigned int xics_remap_irq(unsigned int vec) return NO_IRQ; } -static unsigned int xics_get_irq_direct(struct pt_regs *regs) +static unsigned int xics_get_irq_direct(void) { unsigned int cpu = smp_processor_id(); return xics_remap_irq(direct_xirr_info_get(cpu)); } -static unsigned int xics_get_irq_lpar(struct pt_regs *regs) +static unsigned int xics_get_irq_lpar(void) { unsigned int cpu = smp_processor_id(); diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c index 28b018994746..767ee6651adc 100644 --- a/arch/powerpc/sysdev/cpm2_pic.c +++ b/arch/powerpc/sysdev/cpm2_pic.c @@ -147,7 +147,7 @@ static struct irq_chip cpm2_pic = { .end = cpm2_end_irq, }; -unsigned int cpm2_get_irq(struct pt_regs *regs) +unsigned int cpm2_get_irq(void) { int irq; unsigned long bits; diff --git a/arch/powerpc/sysdev/cpm2_pic.h b/arch/powerpc/sysdev/cpm2_pic.h index 3c513e5a688e..2840616529e4 100644 --- a/arch/powerpc/sysdev/cpm2_pic.h +++ b/arch/powerpc/sysdev/cpm2_pic.h @@ -3,7 +3,7 @@ extern intctl_cpm2_t *cpm2_intctl; -extern unsigned int cpm2_get_irq(struct pt_regs *regs); +extern unsigned int cpm2_get_irq(void); extern void cpm2_pic_init(struct device_node*); diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c index 26a6a3becd66..0450265d73bb 100644 --- a/arch/powerpc/sysdev/i8259.c +++ b/arch/powerpc/sysdev/i8259.c @@ -34,7 +34,7 @@ static struct irq_host *i8259_host; * which is called. It should be noted that polling is broken on some * IBM and Motorola PReP boxes so we must use the int-ack feature on them. */ -unsigned int i8259_irq(struct pt_regs *regs) +unsigned int i8259_irq(void) { int irq; int lock = 0; diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 6ebdae8e6f69..bc4d4a7f9657 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c @@ -709,7 +709,7 @@ void ipic_clear_mcp_status(u32 mask) } /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ -unsigned int ipic_get_irq(struct pt_regs *regs) +unsigned int ipic_get_irq(void) { int irq; diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 195215560fd7..ba4833f57d47 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -1217,7 +1217,7 @@ void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask) mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0])); } -unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs) +unsigned int mpic_get_one_irq(struct mpic *mpic) { u32 src; @@ -1230,13 +1230,13 @@ unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs) return irq_linear_revmap(mpic->irqhost, src); } -unsigned int mpic_get_irq(struct pt_regs *regs) +unsigned int mpic_get_irq(void) { struct mpic *mpic = mpic_primary; BUG_ON(mpic == NULL); - return mpic_get_one_irq(mpic, regs); + return mpic_get_one_irq(mpic); } diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 0dec010bcbb5..6995f51b9488 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c @@ -300,7 +300,7 @@ static struct irq_host_ops qe_ic_host_ops = { }; /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ -unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic, struct pt_regs *regs) +unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) { int irq; @@ -316,7 +316,7 @@ unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic, struct pt_regs *regs) } /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ -unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic, struct pt_regs *regs) +unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) { int irq; @@ -333,13 +333,12 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic, struct pt_regs *regs) /* FIXME: We mask all the QE Low interrupts while handling. We should * let other interrupt come in, but BAD interrupts are generated */ -void fastcall qe_ic_cascade_low(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +void fastcall qe_ic_cascade_low(unsigned int irq, struct irq_desc *desc) { struct qe_ic *qe_ic = desc->handler_data; struct irq_chip *chip = irq_desc[irq].chip; - unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic, regs); + unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); chip->mask_ack(irq); if (cascade_irq != NO_IRQ) @@ -349,13 +348,12 @@ void fastcall qe_ic_cascade_low(unsigned int irq, struct irq_desc *desc, /* FIXME: We mask all the QE High interrupts while handling. We should * let other interrupt come in, but BAD interrupts are generated */ -void fastcall qe_ic_cascade_high(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +void fastcall qe_ic_cascade_high(unsigned int irq, struct irq_desc *desc) { struct qe_ic *qe_ic = desc->handler_data; struct irq_chip *chip = irq_desc[irq].chip; - unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic, regs); + unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); chip->mask_ack(irq); if (cascade_irq != NO_IRQ) diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index 14f4a1ab6d18..322f86e93de5 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c @@ -405,8 +405,7 @@ void __init tsi108_pci_int_init(void) init_pci_source(); } -void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc, - struct pt_regs *regs) +void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc) { unsigned int cascade_irq = get_pci_source(); if (cascade_irq != NO_IRQ) diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c index 94badafe4ef1..14ecec7bbed7 100644 --- a/arch/ppc/platforms/85xx/mpc8560_ads.c +++ b/arch/ppc/platforms/85xx/mpc8560_ads.c @@ -211,10 +211,10 @@ mpc8560ads_setup_arch(void) #endif } -static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cpm2_cascade(int irq, void *dev_id) { - while ((irq = cpm2_get_irq(regs)) >= 0) - __do_IRQ(irq, regs); + while ((irq = cpm2_get_irq()) >= 0) + __do_IRQ(irq); return IRQ_HANDLED; } diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c index 75204588a3e7..5ce0f69c1db6 100644 --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c @@ -127,10 +127,10 @@ mpc85xx_cds_show_cpuinfo(struct seq_file *m) } #ifdef CONFIG_CPM2 -static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cpm2_cascade(int irq, void *dev_id) { - while((irq = cpm2_get_irq(regs)) >= 0) - __do_IRQ(irq, regs); + while((irq = cpm2_get_irq()) >= 0) + __do_IRQ(irq); return IRQ_HANDLED; } diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c index 495aa79bb3a1..4bb18ab27672 100644 --- a/arch/ppc/platforms/85xx/stx_gp3.c +++ b/arch/ppc/platforms/85xx/stx_gp3.c @@ -156,10 +156,10 @@ gp3_setup_arch(void) printk ("bi_immr_base = %8.8lx\n", binfo->bi_immr_base); } -static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cpm2_cascade(int irq, void *dev_id) { - while ((irq = cpm2_get_irq(regs)) >= 0) - __do_IRQ(irq, regs); + while ((irq = cpm2_get_irq()) >= 0) + __do_IRQ(irq); return IRQ_HANDLED; } diff --git a/arch/ppc/platforms/85xx/tqm85xx.c b/arch/ppc/platforms/85xx/tqm85xx.c index 189ed4175f9f..dd45f2e18449 100644 --- a/arch/ppc/platforms/85xx/tqm85xx.c +++ b/arch/ppc/platforms/85xx/tqm85xx.c @@ -181,10 +181,10 @@ tqm85xx_setup_arch(void) } #ifdef CONFIG_MPC8560 -static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cpm2_cascade(int irq, void *dev_id) { - while ((irq = cpm2_get_irq(regs)) >= 0) - __do_IRQ(irq, regs); + while ((irq = cpm2_get_irq()) >= 0) + __do_IRQ(irq); return IRQ_HANDLED; } diff --git a/arch/ppc/syslib/i8259.c b/arch/ppc/syslib/i8259.c index eb35353af837..a43dda5a8334 100644 --- a/arch/ppc/syslib/i8259.c +++ b/arch/ppc/syslib/i8259.c @@ -28,7 +28,7 @@ static int i8259_pic_irq_offset; * which is called. It should be noted that polling is broken on some * IBM and Motorola PReP boxes so we must use the int-ack feature on them. */ -int i8259_irq(struct pt_regs *regs) +int i8259_irq(void) { int irq; diff --git a/include/asm-powerpc/i8259.h b/include/asm-powerpc/i8259.h index c80e113052cd..78489fb8d140 100644 --- a/include/asm-powerpc/i8259.h +++ b/include/asm-powerpc/i8259.h @@ -6,10 +6,10 @@ #ifdef CONFIG_PPC_MERGE extern void i8259_init(struct device_node *node, unsigned long intack_addr); -extern unsigned int i8259_irq(struct pt_regs *regs); +extern unsigned int i8259_irq(void); #else extern void i8259_init(unsigned long intack_addr, int offset); -extern int i8259_irq(struct pt_regs *regs); +extern int i8259_irq(void); #endif #endif /* __KERNEL__ */ diff --git a/include/asm-powerpc/ibmebus.h b/include/asm-powerpc/ibmebus.h index 7ab195a27888..9d25f2063b03 100644 --- a/include/asm-powerpc/ibmebus.h +++ b/include/asm-powerpc/ibmebus.h @@ -65,7 +65,7 @@ void ibmebus_unregister_driver(struct ibmebus_driver *drv); int ibmebus_request_irq(struct ibmebus_dev *dev, u32 ist, - irqreturn_t (*handler)(int, void*, struct pt_regs *), + irqreturn_t (*handler)(int, void*), unsigned long irq_flags, const char * devname, void *dev_id); void ibmebus_free_irq(struct ibmebus_dev *dev, u32 ist, void *dev_id); diff --git a/include/asm-powerpc/ipic.h b/include/asm-powerpc/ipic.h index 1ce09a35906e..9fbb03415860 100644 --- a/include/asm-powerpc/ipic.h +++ b/include/asm-powerpc/ipic.h @@ -79,12 +79,12 @@ extern void ipic_clear_mcp_status(u32 mask); #ifdef CONFIG_PPC_MERGE extern void ipic_init(struct device_node *node, unsigned int flags); -extern unsigned int ipic_get_irq(struct pt_regs *regs); +extern unsigned int ipic_get_irq(void); #else extern void ipic_init(phys_addr_t phys_addr, unsigned int flags, unsigned int irq_offset, unsigned char *senses, unsigned int senses_count); -extern int ipic_get_irq(struct pt_regs *regs); +extern int ipic_get_irq(void); #endif #endif /* __ASM_IPIC_H__ */ diff --git a/include/asm-powerpc/iseries/hv_lp_event.h b/include/asm-powerpc/iseries/hv_lp_event.h index 4065a4de4935..6ce2ce1e2690 100644 --- a/include/asm-powerpc/iseries/hv_lp_event.h +++ b/include/asm-powerpc/iseries/hv_lp_event.h @@ -50,7 +50,7 @@ struct HvLpEvent { u64 xCorrelationToken; /* Unique value for source/type x10-x17 */ }; -typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *); +typedef void (*LpEventHandler)(struct HvLpEvent *); /* Register a handler for an event type - returns 0 on success */ extern int HvLpEvent_registerHandler(HvLpEvent_Type eventType, diff --git a/include/asm-powerpc/iseries/it_lp_queue.h b/include/asm-powerpc/iseries/it_lp_queue.h index 3f6814769295..428278838821 100644 --- a/include/asm-powerpc/iseries/it_lp_queue.h +++ b/include/asm-powerpc/iseries/it_lp_queue.h @@ -72,7 +72,7 @@ struct hvlpevent_queue { extern struct hvlpevent_queue hvlpevent_queue; extern int hvlpevent_is_pending(void); -extern void process_hvlpevents(struct pt_regs *); +extern void process_hvlpevents(void); extern void setup_hvlpevent_queue(void); #endif /* _ASM_POWERPC_ISERIES_IT_LP_QUEUE_H */ diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index c17c13742401..dac90dc341cb 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h @@ -97,7 +97,7 @@ struct machdep_calls { void (*show_percpuinfo)(struct seq_file *m, int i); void (*init_IRQ)(void); - unsigned int (*get_irq)(struct pt_regs *); + unsigned int (*get_irq)(void); #ifdef CONFIG_KEXEC void (*kexec_cpu_down)(int crash_shutdown, int secondary); #endif diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index a9f9604b9eff..ef0a5458d2b2 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h @@ -409,9 +409,9 @@ extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask); void smp_mpic_message_pass(int target, int msg); /* Fetch interrupt from a given mpic */ -extern unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); +extern unsigned int mpic_get_one_irq(struct mpic *mpic); /* This one gets to the primary mpic */ -extern unsigned int mpic_get_irq(struct pt_regs *regs); +extern unsigned int mpic_get_irq(void); /* Set the EPIC clock ratio */ void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index da7746738aee..293a444a1d77 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h @@ -43,7 +43,7 @@ struct machdep_calls { /* Optional, may be NULL. */ unsigned int (*irq_canonicalize)(unsigned int irq); void (*init_IRQ)(void); - int (*get_irq)(struct pt_regs *); + int (*get_irq)(void); /* A general init function, called by ppc_init in init/main.c. May be NULL. DEPRECATED ! */ From f5a924581a4e7b9bc29a49ee1397dcaaacd5f25f Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 6 Oct 2006 22:52:16 +0200 Subject: [PATCH 073/232] [POWERPC] SPU fixup after irq changes Remove struct pt_regs * from remaining spu irq functions. Signed-off-by: Olaf Hering Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/cell/spu_base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index ac5f12662dbb..ccfd0c4db874 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -147,7 +147,7 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr) } static irqreturn_t -spu_irq_class_0(int irq, void *data, struct pt_regs *regs) +spu_irq_class_0(int irq, void *data) { struct spu *spu; @@ -186,7 +186,7 @@ spu_irq_class_0_bottom(struct spu *spu) EXPORT_SYMBOL_GPL(spu_irq_class_0_bottom); static irqreturn_t -spu_irq_class_1(int irq, void *data, struct pt_regs *regs) +spu_irq_class_1(int irq, void *data) { struct spu *spu; unsigned long stat, mask, dar, dsisr; @@ -224,7 +224,7 @@ spu_irq_class_1(int irq, void *data, struct pt_regs *regs) EXPORT_SYMBOL_GPL(spu_irq_class_1_bottom); static irqreturn_t -spu_irq_class_2(int irq, void *data, struct pt_regs *regs) +spu_irq_class_2(int irq, void *data) { struct spu *spu; unsigned long stat; From 40a5f7ca07f8e1d77acdba5ae0c11c15cb7520c1 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 6 Oct 2006 23:06:48 +0200 Subject: [PATCH 074/232] [POWERPC] PReP fixup after irq changes Compile fixes for PReP in ARCH=ppc. Signed-off-by: Olaf Hering Signed-off-by: Paul Mackerras --- arch/ppc/syslib/open_pic.c | 14 +++++++------- include/asm-ppc/open_pic.h | 6 +++--- include/asm-ppc/smp.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c index aa0b95788705..18ec94733293 100644 --- a/arch/ppc/syslib/open_pic.c +++ b/arch/ppc/syslib/open_pic.c @@ -45,7 +45,7 @@ static u_int NumSources; static int open_pic_irq_offset; static volatile OpenPIC_Source __iomem *ISR[NR_IRQS]; static int openpic_cascade_irq = -1; -static int (*openpic_cascade_fn)(struct pt_regs *); +static int (*openpic_cascade_fn)(void); /* Global Operations */ static void openpic_disable_8259_pass_through(void); @@ -54,7 +54,7 @@ static void openpic_set_spurious(u_int vector); #ifdef CONFIG_SMP /* Interprocessor Interrupts */ static void openpic_initipi(u_int ipi, u_int pri, u_int vector); -static irqreturn_t openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *); +static irqreturn_t openpic_ipi_action(int cpl, void *dev_id); #endif /* Timer Interrupts */ @@ -700,7 +700,7 @@ static struct irqaction openpic_cascade_irqaction = { void __init openpic_hookup_cascade(u_int irq, char *name, - int (*cascade_fn)(struct pt_regs *)) + int (*cascade_fn)(void)) { openpic_cascade_irq = irq; openpic_cascade_fn = cascade_fn; @@ -857,16 +857,16 @@ static void openpic_end_ipi(unsigned int irq_nr) { } -static irqreturn_t openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *regs) +static irqreturn_t openpic_ipi_action(int cpl, void *dev_id) { - smp_message_recv(cpl-OPENPIC_VEC_IPI-open_pic_irq_offset, regs); + smp_message_recv(cpl-OPENPIC_VEC_IPI-open_pic_irq_offset); return IRQ_HANDLED; } #endif /* CONFIG_SMP */ int -openpic_get_irq(struct pt_regs *regs) +openpic_get_irq(void) { int irq = openpic_irq(); @@ -876,7 +876,7 @@ openpic_get_irq(struct pt_regs *regs) * This should move to irq.c eventually. -- paulus */ if (irq == openpic_cascade_irq && openpic_cascade_fn != NULL) { - int cirq = openpic_cascade_fn(regs); + int cirq = openpic_cascade_fn(); /* Allow for the cascade being shared with other devices */ if (cirq != -1) { diff --git a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h index a4fe962d9f73..778d5726212c 100644 --- a/include/asm-ppc/open_pic.h +++ b/include/asm-ppc/open_pic.h @@ -48,12 +48,12 @@ extern void openpic_init(int linux_irq_offset); extern void openpic_init_nmi_irq(u_int irq); extern void openpic_set_irq_priority(u_int irq, u_int pri); extern void openpic_hookup_cascade(u_int irq, char *name, - int (*cascade_fn)(struct pt_regs *)); + int (*cascade_fn)(void)); extern u_int openpic_irq(void); extern void openpic_eoi(void); extern void openpic_request_IPIs(void); extern void do_openpic_setup_cpu(void); -extern int openpic_get_irq(struct pt_regs *regs); +extern int openpic_get_irq(void); extern void openpic_reset_processor_phys(u_int cpumask); extern void openpic_setup_ISU(int isu_num, unsigned long addr); extern void openpic_cause_IPI(u_int ipi, cpumask_t cpumask); @@ -93,6 +93,6 @@ extern void openpic2_init(int linux_irq_offset); extern void openpic2_init_nmi_irq(u_int irq); extern u_int openpic2_irq(void); extern void openpic2_eoi(void); -extern int openpic2_get_irq(struct pt_regs *regs); +extern int openpic2_get_irq(void); extern void openpic2_setup_ISU(int isu_num, unsigned long addr); #endif /* _PPC_KERNEL_OPEN_PIC_H */ diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index 0b7fa89589df..e75791ea33a6 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h @@ -39,7 +39,7 @@ extern struct smp_ops_t *smp_ops; extern void smp_send_tlb_invalidate(int); extern void smp_send_xmon_break(int cpu); struct pt_regs; -extern void smp_message_recv(int, struct pt_regs *); +extern void smp_message_recv(int); extern int __cpu_disable(void); extern void __cpu_die(unsigned int cpu); From dcbd4ec4c258f88d4cfd3c309c8a56faff061340 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 6 Oct 2006 22:19:44 -0700 Subject: [PATCH 075/232] [PATCH] slab: remove wrongly placed BUG_ON 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/slab.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/slab.c b/mm/slab.c index 64fb0d770b06..266449d604bd 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1328,7 +1328,6 @@ static void init_list(struct kmem_cache *cachep, struct kmem_list3 *list, { struct kmem_list3 *ptr; - BUG_ON(cachep->nodelists[nodeid] != list); ptr = kmalloc_node(sizeof(struct kmem_list3), GFP_KERNEL, nodeid); BUG_ON(!ptr); From 5c339d4541995df2fd3ca31a84c042e7afe9b3c1 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 6 Oct 2006 22:19:44 -0700 Subject: [PATCH 076/232] [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 Acked-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/power/user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/user.c b/kernel/power/user.c index 72825c853cd7..93b5dd283dea 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -145,10 +145,10 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, error = freeze_processes(); if (error) { thaw_processes(); + enable_nonboot_cpus(); error = -EBUSY; } } - enable_nonboot_cpus(); up(&pm_sem); if (!error) data->frozen = 1; From 00079e04fe478cd3c59ae2106ef2fbe779e67024 Mon Sep 17 00:00:00 2001 From: Eric Eric Sesterhenn Date: Fri, 6 Oct 2006 22:19:45 -0700 Subject: [PATCH 077/232] [PATCH] reiserfs: null pointer dereferencing in reiserfs_read_bitmap_block null pointer dereferencing in reiserfs_read_bitmap_block. Signed-off-by: Alexander Zarochentsev Cc: Jeff Mahoney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/reiserfs/bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index 1bfae42117ca..e3d466a228d4 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c @@ -1304,8 +1304,8 @@ struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, bh = sb_bread(sb, block); if (bh == NULL) - reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%lu) " - "reading failed", __FUNCTION__, bh->b_blocknr); + reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) " + "reading failed", __FUNCTION__, block); else { if (buffer_locked(bh)) { PROC_INFO_INC(sb, scan_bitmap.wait); From 2850bc273776cbb1b510c5828e9e456dffb50a32 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 7 Oct 2006 14:16:45 +0100 Subject: [PATCH 078/232] [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 Signed-off-by: Linus Torvalds --- arch/m68k/amiga/amiints.c | 40 ++++++++++++++++----------------- arch/m68k/amiga/cia.c | 4 ++-- arch/m68k/amiga/config.c | 5 ++--- arch/m68k/apollo/config.c | 14 ++++++------ arch/m68k/apollo/dn_ints.c | 2 +- arch/m68k/atari/config.c | 2 +- arch/m68k/atari/stdma.c | 11 +++++---- arch/m68k/atari/time.c | 2 +- arch/m68k/bvme6000/config.c | 12 +++++----- arch/m68k/hp300/time.c | 8 +++---- arch/m68k/hp300/time.h | 2 +- arch/m68k/kernel/entry.S | 4 ++-- arch/m68k/kernel/ints.c | 20 ++++++++++++----- arch/m68k/kernel/setup.c | 2 +- arch/m68k/kernel/time.c | 7 +++--- arch/m68k/mac/baboon.c | 6 ++--- arch/m68k/mac/config.c | 4 ++-- arch/m68k/mac/iop.c | 22 +++++++++--------- arch/m68k/mac/macints.c | 16 +++++++------ arch/m68k/mac/oss.c | 16 ++++++------- arch/m68k/mac/psc.c | 6 ++--- arch/m68k/mac/via.c | 24 ++++++++++---------- arch/m68k/mvme147/config.c | 10 ++++----- arch/m68k/mvme16x/config.c | 12 +++++----- arch/m68k/q40/config.c | 2 +- arch/m68k/q40/q40ints.c | 16 ++++++------- arch/m68k/sun3/config.c | 2 +- arch/m68k/sun3/sun3ints.c | 11 ++++----- arch/m68k/sun3x/time.c | 2 +- arch/m68k/sun3x/time.h | 2 +- drivers/char/vme_scc.c | 2 +- drivers/macintosh/adb-iop.c | 2 +- drivers/macintosh/via-macii.c | 2 +- drivers/macintosh/via-maciisi.c | 2 +- drivers/macintosh/via-pmu68k.c | 6 ++--- drivers/net/7990.c | 2 +- drivers/parport/parport_mfc3.c | 2 +- include/asm-m68k/atari_stdma.h | 3 +-- include/asm-m68k/floppy.h | 10 ++++----- include/asm-m68k/ide.h | 2 +- include/asm-m68k/irq.h | 11 ++++----- include/asm-m68k/mac_iop.h | 6 ++--- include/asm-m68k/machdep.h | 2 +- include/asm-m68k/sun3xflop.h | 7 +++--- 44 files changed, 176 insertions(+), 169 deletions(-) diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index 96c79d840cff..28d95cfe8ac0 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c @@ -47,10 +47,10 @@ static void amiga_enable_irq(unsigned int irq); static void amiga_disable_irq(unsigned int irq); -static irqreturn_t ami_int1(int irq, void *dev_id, struct pt_regs *fp); -static irqreturn_t ami_int3(int irq, void *dev_id, struct pt_regs *fp); -static irqreturn_t ami_int4(int irq, void *dev_id, struct pt_regs *fp); -static irqreturn_t ami_int5(int irq, void *dev_id, struct pt_regs *fp); +static irqreturn_t ami_int1(int irq, void *dev_id); +static irqreturn_t ami_int3(int irq, void *dev_id); +static irqreturn_t ami_int4(int irq, void *dev_id); +static irqreturn_t ami_int5(int irq, void *dev_id); static struct irq_controller amiga_irq_controller = { .name = "amiga", @@ -113,98 +113,98 @@ static void amiga_disable_irq(unsigned int irq) * The builtin Amiga hardware interrupt handlers. */ -static irqreturn_t ami_int1(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t ami_int1(int irq, void *dev_id) { unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial transmit buffer empty, interrupt */ if (ints & IF_TBE) { amiga_custom.intreq = IF_TBE; - m68k_handle_int(IRQ_AMIGA_TBE, fp); + m68k_handle_int(IRQ_AMIGA_TBE); } /* if floppy disk transfer complete, interrupt */ if (ints & IF_DSKBLK) { amiga_custom.intreq = IF_DSKBLK; - m68k_handle_int(IRQ_AMIGA_DSKBLK, fp); + m68k_handle_int(IRQ_AMIGA_DSKBLK); } /* if software interrupt set, interrupt */ if (ints & IF_SOFT) { amiga_custom.intreq = IF_SOFT; - m68k_handle_int(IRQ_AMIGA_SOFT, fp); + m68k_handle_int(IRQ_AMIGA_SOFT); } return IRQ_HANDLED; } -static irqreturn_t ami_int3(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t ami_int3(int irq, void *dev_id) { unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if a blitter interrupt */ if (ints & IF_BLIT) { amiga_custom.intreq = IF_BLIT; - m68k_handle_int(IRQ_AMIGA_BLIT, fp); + m68k_handle_int(IRQ_AMIGA_BLIT); } /* if a copper interrupt */ if (ints & IF_COPER) { amiga_custom.intreq = IF_COPER; - m68k_handle_int(IRQ_AMIGA_COPPER, fp); + m68k_handle_int(IRQ_AMIGA_COPPER); } /* if a vertical blank interrupt */ if (ints & IF_VERTB) { amiga_custom.intreq = IF_VERTB; - m68k_handle_int(IRQ_AMIGA_VERTB, fp); + m68k_handle_int(IRQ_AMIGA_VERTB); } return IRQ_HANDLED; } -static irqreturn_t ami_int4(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t ami_int4(int irq, void *dev_id) { unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if audio 0 interrupt */ if (ints & IF_AUD0) { amiga_custom.intreq = IF_AUD0; - m68k_handle_int(IRQ_AMIGA_AUD0, fp); + m68k_handle_int(IRQ_AMIGA_AUD0); } /* if audio 1 interrupt */ if (ints & IF_AUD1) { amiga_custom.intreq = IF_AUD1; - m68k_handle_int(IRQ_AMIGA_AUD1, fp); + m68k_handle_int(IRQ_AMIGA_AUD1); } /* if audio 2 interrupt */ if (ints & IF_AUD2) { amiga_custom.intreq = IF_AUD2; - m68k_handle_int(IRQ_AMIGA_AUD2, fp); + m68k_handle_int(IRQ_AMIGA_AUD2); } /* if audio 3 interrupt */ if (ints & IF_AUD3) { amiga_custom.intreq = IF_AUD3; - m68k_handle_int(IRQ_AMIGA_AUD3, fp); + m68k_handle_int(IRQ_AMIGA_AUD3); } return IRQ_HANDLED; } -static irqreturn_t ami_int5(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t ami_int5(int irq, void *dev_id) { unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial receive buffer full interrupt */ if (ints & IF_RBF) { /* acknowledge of IF_RBF must be done by the serial interrupt */ - m68k_handle_int(IRQ_AMIGA_RBF, fp); + m68k_handle_int(IRQ_AMIGA_RBF); } /* if a disk sync interrupt */ if (ints & IF_DSKSYN) { amiga_custom.intreq = IF_DSKSYN; - m68k_handle_int(IRQ_AMIGA_DSKSYN, fp); + m68k_handle_int(IRQ_AMIGA_DSKSYN); } return IRQ_HANDLED; } diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c index dbad30054721..7a20058eb380 100644 --- a/arch/m68k/amiga/cia.c +++ b/arch/m68k/amiga/cia.c @@ -82,7 +82,7 @@ unsigned char cia_able_irq(struct ciabase *base, unsigned char mask) return old; } -static irqreturn_t cia_handler(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t cia_handler(int irq, void *dev_id) { struct ciabase *base = (struct ciabase *)dev_id; int mach_irq; @@ -93,7 +93,7 @@ static irqreturn_t cia_handler(int irq, void *dev_id, struct pt_regs *fp) amiga_custom.intreq = base->int_mask; for (; ints; mach_irq++, ints >>= 1) { if (ints & 1) - m68k_handle_int(mach_irq, fp); + m68k_handle_int(mach_irq); } return IRQ_HANDLED; } diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 092e50d2cb13..6f63d62bd7d6 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -83,7 +83,7 @@ static char amiga_model_name[13] = "Amiga "; extern char m68k_debug_device[]; -static void amiga_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); +static void amiga_sched_init(irqreturn_t (*handler)(int, void *)); /* amiga specific irq functions */ extern void amiga_init_IRQ (void); static void amiga_get_model(char *model); @@ -487,8 +487,7 @@ void __init config_amiga(void) static unsigned short jiffy_ticks; -static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *, - struct pt_regs *)) +static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *)) { static struct resource sched_res = { .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff, diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 6f4581575fb4..b2eea00796ac 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -25,7 +25,7 @@ u_long cpuctrl_physaddr; u_long timer_physaddr; u_long apollo_model; -extern void dn_sched_init(irqreturn_t (*handler)(int,void *,struct pt_regs *)); +extern void dn_sched_init(irqreturn_t (*handler)(int,void *)); extern void dn_init_IRQ(void); extern unsigned long dn_gettimeoffset(void); extern int dn_dummy_hwclk(int, struct rtc_time *); @@ -38,7 +38,7 @@ extern irqreturn_t dn_process_int(int irq, struct pt_regs *fp); #ifdef CONFIG_HEARTBEAT static void dn_heartbeat(int on); #endif -static irqreturn_t dn_timer_int(int irq,void *, struct pt_regs *); +static irqreturn_t dn_timer_int(int irq,void *); static void dn_get_model(char *model); static const char *apollo_models[] = { [APOLLO_DN3000-APOLLO_DN3000] = "DN3000 (Otter)", @@ -174,13 +174,13 @@ void config_apollo(void) { } -irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) +irqreturn_t dn_timer_int(int irq, void *dev_id) { - irqreturn_t (*timer_handler)(int, void *, struct pt_regs *) = dev_id; + irqreturn_t (*timer_handler)(int, void *) = dev_id; volatile unsigned char x; - timer_handler(irq, dev_id, fp); + timer_handler(irq, dev_id); x=*(volatile unsigned char *)(timer+3); x=*(volatile unsigned char *)(timer+5); @@ -188,8 +188,8 @@ irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) return IRQ_HANDLED; } -void dn_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) { - +void dn_sched_init(irqreturn_t (*timer_routine)(int, void *)) +{ /* program timer 1 */ *(volatile unsigned char *)(timer+3)=0x01; *(volatile unsigned char *)(timer+1)=0x40; diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c index 9fe07803797b..4274af125998 100644 --- a/arch/m68k/apollo/dn_ints.c +++ b/arch/m68k/apollo/dn_ints.c @@ -6,7 +6,7 @@ void dn_process_int(unsigned int irq, struct pt_regs *fp) { - m68k_handle_int(irq, fp); + __m68k_handle_int(irq, fp); *(volatile unsigned char *)(pica)=0x20; *(volatile unsigned char *)(picb)=0x20; diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index b2079252a954..76760eebbbc5 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -62,7 +62,7 @@ static void atari_heartbeat( int on ); #endif /* atari specific timer functions (in time.c) */ -extern void atari_sched_init(irqreturn_t (*)(int, void *, struct pt_regs *)); +extern void atari_sched_init(irqreturn_t (*)(int, void *)); extern unsigned long atari_gettimeoffset (void); extern int atari_mste_hwclk (int, struct rtc_time *); extern int atari_tt_hwclk (int, struct rtc_time *); diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c index 288f5e6a124e..5283c73d3f77 100644 --- a/arch/m68k/atari/stdma.c +++ b/arch/m68k/atari/stdma.c @@ -44,7 +44,7 @@ static int stdma_locked; /* the semaphore */ /* int func to be called */ -static irqreturn_t (*stdma_isr)(int, void *, struct pt_regs *); +static irqreturn_t (*stdma_isr)(int, void *); static void *stdma_isr_data; /* data passed to isr */ static DECLARE_WAIT_QUEUE_HEAD(stdma_wait); /* wait queue for ST-DMA */ @@ -53,7 +53,7 @@ static DECLARE_WAIT_QUEUE_HEAD(stdma_wait); /* wait queue for ST-DMA */ /***************************** Prototypes *****************************/ -static irqreturn_t stdma_int (int irq, void *dummy, struct pt_regs *fp); +static irqreturn_t stdma_int (int irq, void *dummy); /************************* End of Prototypes **************************/ @@ -75,8 +75,7 @@ static irqreturn_t stdma_int (int irq, void *dummy, struct pt_regs *fp); * */ -void stdma_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *), - void *data) +void stdma_lock(irqreturn_t (*handler)(int, void *), void *data) { unsigned long flags; @@ -188,9 +187,9 @@ void __init stdma_init(void) * */ -static irqreturn_t stdma_int(int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t stdma_int(int irq, void *dummy) { if (stdma_isr) - (*stdma_isr)(irq, stdma_isr_data, fp); + (*stdma_isr)(irq, stdma_isr_data); return IRQ_HANDLED; } diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index e79bbc94216d..b8fe71cfc62c 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c @@ -20,7 +20,7 @@ #include void __init -atari_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) +atari_sched_init(irqreturn_t (*timer_routine)(int, void *)) { /* set Timer C data Register */ mfp.tim_dt_c = INT_TICKS; diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index d1e916ae55a8..df64efc940c9 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c @@ -38,7 +38,7 @@ static void bvme6000_get_model(char *model); static int bvme6000_get_hardware_list(char *buffer); -extern void bvme6000_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); +extern void bvme6000_sched_init(irqreturn_t (*handler)(int, void *)); extern unsigned long bvme6000_gettimeoffset (void); extern int bvme6000_hwclk (int, struct rtc_time *); extern int bvme6000_set_clock_mmss (unsigned long); @@ -52,7 +52,7 @@ static unsigned char bin2bcd (unsigned char b); /* Save tick handler routine pointer, will point to do_timer() in * kernel/sched.c, called via bvme6000_process_int() */ -static irqreturn_t (*tick_handler)(int, void *, struct pt_regs *); +static irqreturn_t (*tick_handler)(int, void *); int bvme6000_parse_bootinfo(const struct bi_record *bi) @@ -154,7 +154,7 @@ void __init config_bvme6000(void) } -irqreturn_t bvme6000_abort_int (int irq, void *dev_id, struct pt_regs *fp) +irqreturn_t bvme6000_abort_int (int irq, void *dev_id) { unsigned long *new = (unsigned long *)vectors; unsigned long *old = (unsigned long *)0xf8000000; @@ -171,14 +171,14 @@ irqreturn_t bvme6000_abort_int (int irq, void *dev_id, struct pt_regs *fp) } -static irqreturn_t bvme6000_timer_int (int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t bvme6000_timer_int (int irq, void *dev_id) { volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; unsigned char msr = rtc->msr & 0xc0; rtc->msr = msr | 0x20; /* Ack the interrupt */ - return tick_handler(irq, dev_id, fp); + return tick_handler(irq, dev_id); } /* @@ -190,7 +190,7 @@ static irqreturn_t bvme6000_timer_int (int irq, void *dev_id, struct pt_regs *fp * so divide by 8 to get the microsecond result. */ -void bvme6000_sched_init (irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) +void bvme6000_sched_init (irqreturn_t (*timer_routine)(int, void *)) { volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; unsigned char msr = rtc->msr & 0xc0; diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index 7df05662b277..086058fd8383 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c @@ -36,15 +36,15 @@ #define INTVAL ((10000 / 4) - 1) -static irqreturn_t hp300_tick(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t hp300_tick(int irq, void *dev_id) { unsigned long tmp; - irqreturn_t (*vector)(int, void *, struct pt_regs *) = dev_id; + irqreturn_t (*vector)(int, void *) = dev_id; in_8(CLOCKBASE + CLKSR); asm volatile ("movpw %1@(5),%0" : "=d" (tmp) : "a" (CLOCKBASE)); /* Turn off the network and SCSI leds */ blinken_leds(0, 0xe0); - return vector(irq, NULL, regs); + return vector(irq, NULL); } unsigned long hp300_gettimeoffset(void) @@ -63,7 +63,7 @@ unsigned long hp300_gettimeoffset(void) return (USECS_PER_JIFFY * ticks) / INTVAL; } -void __init hp300_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *)) +void __init hp300_sched_init(irqreturn_t (*vector)(int, void *)) { out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ out_8(CLOCKBASE + CLKCR1, 0x1); /* reset */ diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h index 8ef9987b49ab..ca66a039d6f2 100644 --- a/arch/m68k/hp300/time.h +++ b/arch/m68k/hp300/time.h @@ -1,4 +1,4 @@ -extern void hp300_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *)); +extern void hp300_sched_init(irqreturn_t (*vector)(int, void *)); extern unsigned long hp300_gettimeoffset (void); diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 9083c8b7659f..34bf7bd126d2 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -205,7 +205,7 @@ ENTRY(auto_inthandler) movel %sp,%sp@- movel %d0,%sp@- | put vector # on stack auto_irqhandler_fixup = . + 2 - jsr m68k_handle_int | process the IRQ + jsr __m68k_handle_int | process the IRQ addql #8,%sp | pop parameters off stack ret_from_interrupt: @@ -239,7 +239,7 @@ user_irqvec_fixup = . + 2 movel %sp,%sp@- movel %d0,%sp@- | put vector # on stack user_irqhandler_fixup = . + 2 - jsr m68k_handle_int | process the IRQ + jsr __m68k_handle_int | process the IRQ addql #8,%sp | pop parameters off stack subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index b33e37fb7b0e..6fa893fc5fd6 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef CONFIG_Q40 #include @@ -104,7 +105,7 @@ void __init init_IRQ(void) * @handler: called from auto vector interrupts * * setup the handler to be called from auto vector interrupts instead of the - * standard m68k_handle_int(), it will be called with irq numbers in the range + * standard __m68k_handle_int(), it will be called with irq numbers in the range * from IRQ_AUTO_1 - IRQ_AUTO_7. */ void __init m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *)) @@ -123,7 +124,7 @@ void __init m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_re * setup user vector interrupts, this includes activating the specified range * of interrupts, only then these interrupts can be requested (note: this is * different from auto vector interrupts). An optional handler can be installed - * to be called instead of the default m68k_handle_int(), it will be called + * to be called instead of the default __m68k_handle_int(), it will be called * with irq numbers starting from IRQ_USER. */ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, @@ -215,7 +216,7 @@ int setup_irq(unsigned int irq, struct irq_node *node) } int request_irq(unsigned int irq, - irqreturn_t (*handler) (int, void *, struct pt_regs *), + irqreturn_t (*handler) (int, void *), unsigned long flags, const char *devname, void *dev_id) { struct irq_node *node; @@ -379,18 +380,25 @@ unsigned int irq_canonicalize(unsigned int irq) EXPORT_SYMBOL(irq_canonicalize); -asmlinkage void m68k_handle_int(unsigned int irq, struct pt_regs *regs) +asmlinkage void m68k_handle_int(unsigned int irq) { struct irq_node *node; - kstat_cpu(0).irqs[irq]++; node = irq_list[irq]; do { - node->handler(irq, node->dev_id, regs); + node->handler(irq, node->dev_id); node = node->next; } while (node); } +asmlinkage void __m68k_handle_int(unsigned int irq, struct pt_regs *regs) +{ + struct pt_regs *old_regs; + old_regs = set_irq_regs(regs); + m68k_handle_int(irq); + set_irq_regs(old_regs); +} + asmlinkage void handle_badint(struct pt_regs *regs) { kstat_cpu(0).irqs[0]++; diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index f2d7ee0ee18c..869c4861346e 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -64,7 +64,7 @@ static char m68k_command_line[CL_SIZE]; char m68k_debug_device[6] = ""; -void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)) __initdata = NULL; +void (*mach_sched_init) (irqreturn_t (*handler)(int, void *)) __initdata = NULL; /* machine dependent irq functions */ void (*mach_init_IRQ) (void) __initdata = NULL; void (*mach_get_model) (char *model); diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 28b2fefa4513..2a599c3ed787 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -37,13 +38,13 @@ static inline int set_rtc_mmss(unsigned long nowtime) * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs) +static irqreturn_t timer_interrupt(int irq, void *dummy) { do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); #ifdef CONFIG_HEARTBEAT /* use power LED as a heartbeat instead -- much more useful diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index 6eaa881793d1..a1c7ec706741 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -25,7 +25,7 @@ int baboon_present,baboon_active; volatile struct baboon *baboon; -irqreturn_t baboon_irq(int, void *, struct pt_regs *); +irqreturn_t baboon_irq(int, void *); #if 0 extern int macide_ack_intr(struct ata_channel *); @@ -64,7 +64,7 @@ void __init baboon_register_interrupts(void) * Baboon interrupt handler. This works a lot like a VIA. */ -irqreturn_t baboon_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t baboon_irq(int irq, void *dev_id) { int irq_bit,i; unsigned char events; @@ -81,7 +81,7 @@ irqreturn_t baboon_irq(int irq, void *dev_id, struct pt_regs *regs) for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) { if (events & irq_bit/* & baboon_active*/) { baboon_active &= ~irq_bit; - m68k_handle_int(IRQ_BABOON_0 + i, regs); + m68k_handle_int(IRQ_BABOON_0 + i); baboon_active |= irq_bit; baboon->mb_ifr &= ~irq_bit; } diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 85dda1095b1f..029bae65c5d1 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -72,7 +72,7 @@ extern int show_mac_interrupts(struct seq_file *, void *); extern void iop_preinit(void); extern void iop_init(void); extern void via_init(void); -extern void via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *)); +extern void via_init_clock(irqreturn_t (*func)(int, void *)); extern void via_flush_cache(void); extern void oss_init(void); extern void psc_init(void); @@ -88,7 +88,7 @@ extern void mac_debugging_long(int, long); static void mac_get_model(char *str); -static void mac_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *)) +static void mac_sched_init(irqreturn_t (*vector)(int, void *)) { via_init_clock(vector); } diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index bc657b1057a7..0cea21f58192 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -132,7 +132,7 @@ static int iop_get_proc_info(char *, char **, off_t, int); struct listener { const char *devname; - void (*handler)(struct iop_msg *, struct pt_regs *); + void (*handler)(struct iop_msg *); }; /* @@ -152,7 +152,7 @@ static struct iop_msg iop_msg_pool[NUM_IOP_MSGS]; static struct iop_msg *iop_send_queue[NUM_IOPS][NUM_IOP_CHAN]; static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN]; -irqreturn_t iop_ism_irq(int, void *, struct pt_regs *); +irqreturn_t iop_ism_irq(int, void *); extern void oss_irq_enable(int); @@ -342,7 +342,7 @@ void __init iop_register_interrupts(void) */ int iop_listen(uint iop_num, uint chan, - void (*handler)(struct iop_msg *, struct pt_regs *), + void (*handler)(struct iop_msg *), const char *devname) { if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return -EINVAL; @@ -407,7 +407,7 @@ static void iop_do_send(struct iop_msg *msg) * has gone into the IOP_MSG_COMPLETE state. */ -static void iop_handle_send(uint iop_num, uint chan, struct pt_regs *regs) +static void iop_handle_send(uint iop_num, uint chan) { volatile struct mac_iop *iop = iop_base[iop_num]; struct iop_msg *msg,*msg2; @@ -426,7 +426,7 @@ static void iop_handle_send(uint iop_num, uint chan, struct pt_regs *regs) for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) { msg->reply[i] = iop_readb(iop, offset); } - if (msg->handler) (*msg->handler)(msg, regs); + if (msg->handler) (*msg->handler)(msg); msg2 = msg; msg = msg->next; iop_free_msg(msg2); @@ -440,7 +440,7 @@ static void iop_handle_send(uint iop_num, uint chan, struct pt_regs *regs) * gone into the IOP_MSG_NEW state. */ -static void iop_handle_recv(uint iop_num, uint chan, struct pt_regs *regs) +static void iop_handle_recv(uint iop_num, uint chan) { volatile struct mac_iop *iop = iop_base[iop_num]; int i,offset; @@ -468,7 +468,7 @@ static void iop_handle_recv(uint iop_num, uint chan, struct pt_regs *regs) /* the message ourselves to avoid possible stalls. */ if (msg->handler) { - (*msg->handler)(msg, regs); + (*msg->handler)(msg); } else { #ifdef DEBUG_IOP printk("iop_handle_recv: unclaimed message on iop %d channel %d\n", iop_num, chan); @@ -492,7 +492,7 @@ static void iop_handle_recv(uint iop_num, uint chan, struct pt_regs *regs) int iop_send_message(uint iop_num, uint chan, void *privdata, uint msg_len, __u8 *msg_data, - void (*handler)(struct iop_msg *, struct pt_regs *)) + void (*handler)(struct iop_msg *)) { struct iop_msg *msg, *q; @@ -584,7 +584,7 @@ __u8 *iop_compare_code(uint iop_num, __u8 *code_start, * Handle an ISM IOP interrupt */ -irqreturn_t iop_ism_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t iop_ism_irq(int irq, void *dev_id) { uint iop_num = (uint) dev_id; volatile struct mac_iop *iop = iop_base[iop_num]; @@ -608,7 +608,7 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id, struct pt_regs *regs) printk(" %02X", state); #endif if (state == IOP_MSG_COMPLETE) { - iop_handle_send(iop_num, i, regs); + iop_handle_send(iop_num, i); } } #ifdef DEBUG_IOP @@ -628,7 +628,7 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id, struct pt_regs *regs) printk(" %02X", state); #endif if (state == IOP_MSG_NEW) { - iop_handle_recv(iop_num, i, regs); + iop_handle_recv(iop_num, i); } } #ifdef DEBUG_IOP diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 694b14bb0de1..f6fcd754d8f6 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -133,6 +133,7 @@ #include #include #include +#include #define DEBUG_SPURIOUS #define SHUTUP_SONIC @@ -208,8 +209,8 @@ static void scc_irq_disable(unsigned int); * console_loglevel determines NMI handler function */ -irqreturn_t mac_nmi_handler(int, void *, struct pt_regs *); -irqreturn_t mac_debug_handler(int, void *, struct pt_regs *); +irqreturn_t mac_nmi_handler(int, void *); +irqreturn_t mac_debug_handler(int, void *); /* #define DEBUG_MACINTS */ @@ -393,7 +394,7 @@ int mac_irq_pending(unsigned int irq) static int num_debug[8]; -irqreturn_t mac_debug_handler(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t mac_debug_handler(int irq, void *dev_id) { if (num_debug[irq] < 10) { printk("DEBUG: Unexpected IRQ %d\n", irq); @@ -405,7 +406,7 @@ irqreturn_t mac_debug_handler(int irq, void *dev_id, struct pt_regs *regs) static int in_nmi; static volatile int nmi_hold; -irqreturn_t mac_nmi_handler(int irq, void *dev_id, struct pt_regs *fp) +irqreturn_t mac_nmi_handler(int irq, void *dev_id) { int i; /* @@ -432,6 +433,7 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id, struct pt_regs *fp) if (console_loglevel >= 8) { #if 0 + struct pt_regs *fp = get_irq_regs(); show_state(); printk("PC: %08lx\nSR: %04x SP: %p\n", fp->pc, fp->sr, fp); printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", @@ -479,7 +481,7 @@ static void scc_irq_disable(unsigned int irq) * here is cleaner than hacking it into drivers/char/macserial.c. */ -void mac_scc_dispatch(int irq, void *dev_id, struct pt_regs *regs) +void mac_scc_dispatch(int irq, void *dev_id) { volatile unsigned char *scc = (unsigned char *) mac_bi_data.sccbase + 2; unsigned char reg; @@ -504,7 +506,7 @@ void mac_scc_dispatch(int irq, void *dev_id, struct pt_regs *regs) /* pretty much kill the system. */ if (reg & 0x38) - m68k_handle_int(IRQ_SCCA, regs); + m68k_handle_int(IRQ_SCCA); if (reg & 0x07) - m68k_handle_int(IRQ_SCCB, regs); + m68k_handle_int(IRQ_SCCB); } diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 63e04365191f..63690819565a 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -30,11 +30,11 @@ int oss_present; volatile struct mac_oss *oss; -irqreturn_t oss_irq(int, void *, struct pt_regs *); -irqreturn_t oss_nubus_irq(int, void *, struct pt_regs *); +irqreturn_t oss_irq(int, void *); +irqreturn_t oss_nubus_irq(int, void *); -extern irqreturn_t via1_irq(int, void *, struct pt_regs *); -extern irqreturn_t mac_scc_dispatch(int, void *, struct pt_regs *); +extern irqreturn_t via1_irq(int, void *); +extern irqreturn_t mac_scc_dispatch(int, void *); /* * Initialize the OSS @@ -92,7 +92,7 @@ void __init oss_nubus_init(void) * and SCSI; everything else is routed to its own autovector IRQ. */ -irqreturn_t oss_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t oss_irq(int irq, void *dev_id) { int events; @@ -113,7 +113,7 @@ irqreturn_t oss_irq(int irq, void *dev_id, struct pt_regs *regs) oss->irq_pending &= ~OSS_IP_SOUND; } else if (events & OSS_IP_SCSI) { oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED; - m68k_handle_int(IRQ_MAC_SCSI, regs); + m68k_handle_int(IRQ_MAC_SCSI); oss->irq_pending &= ~OSS_IP_SCSI; oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI; } else { @@ -128,7 +128,7 @@ irqreturn_t oss_irq(int irq, void *dev_id, struct pt_regs *regs) * Unlike the VIA/RBV this is on its own autovector interrupt level. */ -irqreturn_t oss_nubus_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t oss_nubus_irq(int irq, void *dev_id) { int events, irq_bit, i; @@ -146,7 +146,7 @@ irqreturn_t oss_nubus_irq(int irq, void *dev_id, struct pt_regs *regs) for (i = 0, irq_bit = 1 ; i < 6 ; i++, irq_bit <<= 1) { if (events & irq_bit) { oss->irq_level[i] = OSS_IRQLEV_DISABLED; - m68k_handle_int(NUBUS_SOURCE_BASE + i, regs); + m68k_handle_int(NUBUS_SOURCE_BASE + i); oss->irq_pending &= ~irq_bit; oss->irq_level[i] = OSS_IRQLEV_NUBUS; } diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index e26218091755..15378a5878c9 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c @@ -30,7 +30,7 @@ int psc_present; volatile __u8 *psc; -irqreturn_t psc_irq(int, void *, struct pt_regs *); +irqreturn_t psc_irq(int, void *); /* * Debugging dump, used in various places to see what's going on. @@ -127,7 +127,7 @@ void __init psc_register_interrupts(void) * PSC interrupt handler. It's a lot like the VIA interrupt handler. */ -irqreturn_t psc_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t psc_irq(int irq, void *dev_id) { int pIFR = pIFRbase + ((int) dev_id); int pIER = pIERbase + ((int) dev_id); @@ -149,7 +149,7 @@ irqreturn_t psc_irq(int irq, void *dev_id, struct pt_regs *regs) for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) { if (events & irq_bit) { psc_write_byte(pIER, irq_bit); - m68k_handle_int(base_irq + i, regs); + m68k_handle_int(base_irq + i); psc_write_byte(pIFR, irq_bit); psc_write_byte(pIER, irq_bit | 0x80); } diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index c4aa345d544e..9b6c80c4bbe2 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -63,14 +63,14 @@ static int gIER,gIFR,gBufA,gBufB; static int nubus_active; void via_debug_dump(void); -irqreturn_t via1_irq(int, void *, struct pt_regs *); -irqreturn_t via2_irq(int, void *, struct pt_regs *); -irqreturn_t via_nubus_irq(int, void *, struct pt_regs *); +irqreturn_t via1_irq(int, void *); +irqreturn_t via2_irq(int, void *); +irqreturn_t via_nubus_irq(int, void *); void via_irq_enable(int irq); void via_irq_disable(int irq); void via_irq_clear(int irq); -extern irqreturn_t mac_scc_dispatch(int, void *, struct pt_regs *); +extern irqreturn_t mac_scc_dispatch(int, void *); extern int oss_present; /* @@ -235,7 +235,7 @@ void __init via_init(void) * Start the 100 Hz clock */ -void __init via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *)) +void __init via_init_clock(irqreturn_t (*func)(int, void *)) { via1[vACR] |= 0x40; via1[vT1LL] = MAC_CLOCK_LOW; @@ -412,7 +412,7 @@ void __init via_nubus_init(void) * the machspec interrupt number after clearing the interrupt. */ -irqreturn_t via1_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t via1_irq(int irq, void *dev_id) { int irq_bit, i; unsigned char events, mask; @@ -424,7 +424,7 @@ irqreturn_t via1_irq(int irq, void *dev_id, struct pt_regs *regs) for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) if (events & irq_bit) { via1[vIER] = irq_bit; - m68k_handle_int(VIA1_SOURCE_BASE + i, regs); + m68k_handle_int(VIA1_SOURCE_BASE + i); via1[vIFR] = irq_bit; via1[vIER] = irq_bit | 0x80; } @@ -439,14 +439,14 @@ irqreturn_t via1_irq(int irq, void *dev_id, struct pt_regs *regs) /* No, it won't be set. that's why we're doing this. */ via_irq_disable(IRQ_MAC_NUBUS); via_irq_clear(IRQ_MAC_NUBUS); - m68k_handle_int(IRQ_MAC_NUBUS, regs); + m68k_handle_int(IRQ_MAC_NUBUS); via_irq_enable(IRQ_MAC_NUBUS); } #endif return IRQ_HANDLED; } -irqreturn_t via2_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t via2_irq(int irq, void *dev_id) { int irq_bit, i; unsigned char events, mask; @@ -459,7 +459,7 @@ irqreturn_t via2_irq(int irq, void *dev_id, struct pt_regs *regs) if (events & irq_bit) { via2[gIER] = irq_bit; via2[gIFR] = irq_bit | rbv_clear; - m68k_handle_int(VIA2_SOURCE_BASE + i, regs); + m68k_handle_int(VIA2_SOURCE_BASE + i); via2[gIER] = irq_bit | 0x80; } return IRQ_HANDLED; @@ -470,7 +470,7 @@ irqreturn_t via2_irq(int irq, void *dev_id, struct pt_regs *regs) * VIA2 dispatcher as a fast interrupt handler. */ -irqreturn_t via_nubus_irq(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t via_nubus_irq(int irq, void *dev_id) { int irq_bit, i; unsigned char events; @@ -481,7 +481,7 @@ irqreturn_t via_nubus_irq(int irq, void *dev_id, struct pt_regs *regs) for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) { if (events & irq_bit) { via_irq_disable(NUBUS_SOURCE_BASE + i); - m68k_handle_int(NUBUS_SOURCE_BASE + i, regs); + m68k_handle_int(NUBUS_SOURCE_BASE + i); via_irq_enable(NUBUS_SOURCE_BASE + i); } } diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 0cd0e5bddcee..c864d6415180 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c @@ -38,7 +38,7 @@ static void mvme147_get_model(char *model); static int mvme147_get_hardware_list(char *buffer); -extern void mvme147_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); +extern void mvme147_sched_init(irqreturn_t (*handler)(int, void *)); extern unsigned long mvme147_gettimeoffset (void); extern int mvme147_hwclk (int, struct rtc_time *); extern int mvme147_set_clock_mmss (unsigned long); @@ -51,7 +51,7 @@ static int bcd2int (unsigned char b); /* Save tick handler routine pointer, will point to do_timer() in * kernel/sched.c, called via mvme147_process_int() */ -irqreturn_t (*tick_handler)(int, void *, struct pt_regs *); +irqreturn_t (*tick_handler)(int, void *); int mvme147_parse_bootinfo(const struct bi_record *bi) @@ -114,15 +114,15 @@ void __init config_mvme147(void) /* Using pcc tick timer 1 */ -static irqreturn_t mvme147_timer_int (int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t mvme147_timer_int (int irq, void *dev_id) { m147_pcc->t1_int_cntrl = PCC_TIMER_INT_CLR; m147_pcc->t1_int_cntrl = PCC_INT_ENAB|PCC_LEVEL_TIMER1; - return tick_handler(irq, dev_id, fp); + return tick_handler(irq, dev_id); } -void mvme147_sched_init (irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) +void mvme147_sched_init (irqreturn_t (*timer_routine)(int, void *)) { tick_handler = timer_routine; request_irq (PCC_IRQ_TIMER1, mvme147_timer_int, diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index ce2727ed1bc0..2c91cee17093 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -42,7 +42,7 @@ static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; static void mvme16x_get_model(char *model); static int mvme16x_get_hardware_list(char *buffer); -extern void mvme16x_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); +extern void mvme16x_sched_init(irqreturn_t (*handler)(int, void *)); extern unsigned long mvme16x_gettimeoffset (void); extern int mvme16x_hwclk (int, struct rtc_time *); extern int mvme16x_set_clock_mmss (unsigned long); @@ -54,7 +54,7 @@ int bcd2int (unsigned char b); /* Save tick handler routine pointer, will point to do_timer() in * kernel/sched.c, called via mvme16x_process_int() */ -static irqreturn_t (*tick_handler)(int, void *, struct pt_regs *); +static irqreturn_t (*tick_handler)(int, void *); unsigned short mvme16x_config; @@ -190,7 +190,7 @@ void __init config_mvme16x(void) } } -static irqreturn_t mvme16x_abort_int (int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t mvme16x_abort_int (int irq, void *dev_id) { p_bdid p = &mvme_bdid; unsigned long *new = (unsigned long *)vectors; @@ -218,13 +218,13 @@ static irqreturn_t mvme16x_abort_int (int irq, void *dev_id, struct pt_regs *fp) return IRQ_HANDLED; } -static irqreturn_t mvme16x_timer_int (int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t mvme16x_timer_int (int irq, void *dev_id) { *(volatile unsigned char *)0xfff4201b |= 8; - return tick_handler(irq, dev_id, fp); + return tick_handler(irq, dev_id); } -void mvme16x_sched_init (irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) +void mvme16x_sched_init (irqreturn_t (*timer_routine)(int, void *)) { p_bdid p = &mvme_bdid; int irq; diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 9a1827876408..5123f693948f 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -39,7 +39,7 @@ extern irqreturn_t q40_process_int (int level, struct pt_regs *regs); extern void q40_init_IRQ (void); static void q40_get_model(char *model); static int q40_get_hardware_list(char *buffer); -extern void q40_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); +extern void q40_sched_init(irqreturn_t (*handler)(int, void *)); extern unsigned long q40_gettimeoffset (void); extern int q40_hwclk (int, struct rtc_time *); diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 472f41c4158b..4a4ee4dfa6f1 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c @@ -125,9 +125,9 @@ void q40_mksound(unsigned int hz, unsigned int ticks) sound_ticks = ticks << 1; } -static irqreturn_t (*q40_timer_routine)(int, void *, struct pt_regs *); +static irqreturn_t (*q40_timer_routine)(int, void *); -static irqreturn_t q40_timer_int (int irq, void * dev, struct pt_regs * regs) +static irqreturn_t q40_timer_int (int irq, void * dev) { ql_ticks = ql_ticks ? 0 : 1; if (sound_ticks) { @@ -138,11 +138,11 @@ static irqreturn_t q40_timer_int (int irq, void * dev, struct pt_regs * regs) } if (!ql_ticks) - q40_timer_routine(irq, dev, regs); + q40_timer_routine(irq, dev); return IRQ_HANDLED; } -void q40_sched_init (irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) +void q40_sched_init (irqreturn_t (*timer_routine)(int, void *)) { int timer_irq; @@ -218,11 +218,11 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) switch (irq) { case 4: case 6: - m68k_handle_int(Q40_IRQ_SAMPLE, fp); + __m68k_handle_int(Q40_IRQ_SAMPLE, fp); return; } if (mir & Q40_IRQ_FRAME_MASK) { - m68k_handle_int(Q40_IRQ_FRAME, fp); + __m68k_handle_int(Q40_IRQ_FRAME, fp); master_outb(-1, FRAME_CLEAR_REG); } if ((mir & Q40_IRQ_SER_MASK) || (mir & Q40_IRQ_EXT_MASK)) { @@ -257,7 +257,7 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) goto iirq; } q40_state[irq] |= IRQ_INPROGRESS; - m68k_handle_int(irq, fp); + __m68k_handle_int(irq, fp); q40_state[irq] &= ~IRQ_INPROGRESS; /* naively enable everything, if that fails than */ @@ -288,7 +288,7 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) mir = master_inb(IIRQ_REG); /* should test whether keyboard irq is really enabled, doing it in defhand */ if (mir & Q40_IRQ_KEYB_MASK) - m68k_handle_int(Q40_IRQ_KEYBOARD, fp); + __m68k_handle_int(Q40_IRQ_KEYBOARD, fp); return; } diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index d09d03b3d956..db930f9070ef 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -162,7 +162,7 @@ void __init config_sun3(void) sun3_bootmem_alloc(memory_start, memory_end); } -void __init sun3_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) +void __init sun3_sched_init(irqreturn_t (*timer_routine)(int, void *)) { sun3_disable_interrupts(); intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_DISABLE|INTERSIL_24H_MODE); diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index dc4ea7e074a6..baf74e8de8b5 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -15,6 +15,7 @@ #include #include #include +#include #include extern void sun3_leds (unsigned char); @@ -48,7 +49,7 @@ void sun3_disable_irq(unsigned int irq) *sun3_intreg &= ~(1 << irq); } -static irqreturn_t sun3_int7(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t sun3_int7(int irq, void *dev_id) { *sun3_intreg |= (1 << irq); if (!(kstat_cpu(0).irqs[irq] % 2000)) @@ -56,7 +57,7 @@ static irqreturn_t sun3_int7(int irq, void *dev_id, struct pt_regs *fp) return IRQ_HANDLED; } -static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t sun3_int5(int irq, void *dev_id) { #ifdef CONFIG_SUN3 intersil_clear(); @@ -67,14 +68,14 @@ static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp) #endif do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(fp)); + update_process_times(user_mode(get_irq_regs())); #endif if (!(kstat_cpu(0).irqs[irq] % 20)) sun3_leds(led_pattern[(kstat_cpu(0).irqs[irq] % 160) / 20]); return IRQ_HANDLED; } -static irqreturn_t sun3_vec255(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t sun3_vec255(int irq, void *dev_id) { // intersil_clear(); return IRQ_HANDLED; @@ -84,7 +85,7 @@ static void sun3_inthandle(unsigned int irq, struct pt_regs *fp) { *sun3_intreg &= ~(1 << irq); - m68k_handle_int(irq, fp); + __m68k_handle_int(irq, fp); } static struct irq_controller sun3_irq_controller = { diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c index 6f4204fbecd7..33eb1ecc888a 100644 --- a/arch/m68k/sun3x/time.c +++ b/arch/m68k/sun3x/time.c @@ -90,7 +90,7 @@ static void sun3x_timer_tick(int irq, void *dev_id, struct pt_regs *regs) } #endif -void __init sun3x_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *)) +void __init sun3x_sched_init(irqreturn_t (*vector)(int, void *)) { sun3_disable_interrupts(); diff --git a/arch/m68k/sun3x/time.h b/arch/m68k/sun3x/time.h index e7e43b4ec4a1..e39079c781d8 100644 --- a/arch/m68k/sun3x/time.h +++ b/arch/m68k/sun3x/time.h @@ -3,7 +3,7 @@ extern int sun3x_hwclk(int set, struct rtc_time *t); unsigned long sun3x_gettimeoffset (void); -void sun3x_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *)); +void sun3x_sched_init(irqreturn_t (*vector)(int, void *)); struct mostek_dt { volatile unsigned char csr; diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index 0cdbaa70cf9f..d0b94dd1af6d 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c @@ -593,7 +593,7 @@ static void scc_enable_tx_interrupts(void *ptr) local_irq_save(flags); SCCmod(INT_AND_DMA_REG, 0xff, IDR_TX_INT_ENAB); /* restart the transmitter */ - scc_tx_int (0, port, 0); + scc_tx_int (0, port); local_irq_restore(flags); } diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c index 1ffee7aaff20..17ef5d3c01b4 100644 --- a/drivers/macintosh/adb-iop.c +++ b/drivers/macintosh/adb-iop.c @@ -266,7 +266,7 @@ int adb_iop_autopoll(int devs) void adb_iop_poll(void) { if (adb_iop_state == idle) adb_iop_start(); - iop_ism_irq(0, (void *) ADB_IOP, NULL); + iop_ism_irq(0, (void *) ADB_IOP); } int adb_iop_reset_bus(void) diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index ad4bd579f610..5d88d5b0ad99 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c @@ -295,7 +295,7 @@ static void macii_poll(void) unsigned long flags; local_irq_save(flags); - if (via[IFR] & SR_INT) macii_interrupt(0, NULL, NULL); + if (via[IFR] & SR_INT) macii_interrupt(0, NULL); local_irq_restore(flags); } diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c index 789ee52086fe..1f0aa5dc9aa5 100644 --- a/drivers/macintosh/via-maciisi.c +++ b/drivers/macintosh/via-maciisi.c @@ -421,7 +421,7 @@ maciisi_poll(void) local_irq_save(flags); if (via[IFR] & SR_INT) { - maciisi_interrupt(0, NULL, NULL); + maciisi_interrupt(0, NULL); } else /* avoid calling this function too quickly in a loop */ udelay(ADB_DELAY); diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index 98ec915d0409..d9986f3a3fbf 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c @@ -221,7 +221,7 @@ pmu_init(void) } if (pmu_state == idle) { adb_int_pending = 1; - pmu_interrupt(0, NULL, NULL); + pmu_interrupt(0, NULL); } pmu_poll(); udelay(10); @@ -562,11 +562,11 @@ pmu_poll(void) local_irq_save(flags); if (via1[IFR] & SR_INT) { via1[IFR] = SR_INT; - pmu_interrupt(IRQ_MAC_ADB_SR, NULL, NULL); + pmu_interrupt(IRQ_MAC_ADB_SR, NULL); } if (via1[IFR] & CB1_INT) { via1[IFR] = CB1_INT; - pmu_interrupt(IRQ_MAC_ADB_CL, NULL, NULL); + pmu_interrupt(IRQ_MAC_ADB_CL, NULL); } local_irq_restore(flags); } diff --git a/drivers/net/7990.c b/drivers/net/7990.c index 8e996b4a34ea..7733697f7776 100644 --- a/drivers/net/7990.c +++ b/drivers/net/7990.c @@ -674,7 +674,7 @@ void lance_poll(struct net_device *dev) WRITERAP(lp, LE_CSR0); WRITERDP(lp, LE_C0_STRT); spin_unlock (&lp->devlock); - lance_interrupt(dev->irq, dev, NULL); + lance_interrupt(dev->irq, dev); } #endif diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c index 6541cde4df00..e5b0a544de40 100644 --- a/drivers/parport/parport_mfc3.c +++ b/drivers/parport/parport_mfc3.c @@ -219,7 +219,7 @@ static irqreturn_t mfc3_interrupt(int irq, void *dev_id) if (this_port[i] != NULL) if (pia(this_port[i])->crb & 128) { /* Board caused interrupt */ dummy = pia(this_port[i])->pprb; /* clear irq bit */ - parport_generic_irq(irq, this_port[i], regs); + parport_generic_irq(irq, this_port[i]); } return IRQ_HANDLED; } diff --git a/include/asm-m68k/atari_stdma.h b/include/asm-m68k/atari_stdma.h index b4eadf852738..a6986af7915e 100644 --- a/include/asm-m68k/atari_stdma.h +++ b/include/asm-m68k/atari_stdma.h @@ -8,8 +8,7 @@ /***************************** Prototypes *****************************/ -void stdma_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *), - void *data); +void stdma_lock(irqreturn_t (*handler)(int, void *), void *data); void stdma_release( void ); int stdma_others_waiting( void ); int stdma_islocked( void ); diff --git a/include/asm-m68k/floppy.h b/include/asm-m68k/floppy.h index 57f4fdda65ab..45dc908932a3 100644 --- a/include/asm-m68k/floppy.h +++ b/include/asm-m68k/floppy.h @@ -17,8 +17,7 @@ #include -asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id, - struct pt_regs *regs); +asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id); /* constants... */ @@ -184,8 +183,7 @@ static void fd_disable_dma(void) /* this is the only truly Q40 specific function */ -asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id, - struct pt_regs *regs) +asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id) { register unsigned char st; @@ -198,7 +196,7 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id, static int dma_wait=0; #endif if(!doing_pdma) { - floppy_interrupt(irq, dev_id, regs); + floppy_interrupt(irq, dev_id); return IRQ_HANDLED; } @@ -246,7 +244,7 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id, dma_wait=0; #endif doing_pdma = 0; - floppy_interrupt(irq, dev_id, regs); + floppy_interrupt(irq, dev_id); return IRQ_HANDLED; } #ifdef TRACE_FLPY_INT diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index 365f76fb8013..896683a7a1f3 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -123,7 +123,7 @@ static __inline__ void ide_release_lock (void) } static __inline__ void -ide_get_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *), void *data) +ide_get_lock(irqreturn_t (*handler)(int, void *), void *data) { if (MACH_IS_ATARI) { if (falconide_intr_lock == 0) { diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 3257f9881002..4901cb105e2f 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h @@ -83,7 +83,7 @@ struct pt_regs; * interrupt source (if it supports chaining). */ typedef struct irq_node { - int (*handler)(int, void *, struct pt_regs *); + int (*handler)(int, void *); void *dev_id; struct irq_node *next; unsigned long flags; @@ -93,12 +93,12 @@ typedef struct irq_node { /* * This structure has only 4 elements for speed reasons */ -typedef struct irq_handler { - int (*handler)(int, void *, struct pt_regs *); +struct irq_handler { + int (*handler)(int, void *); unsigned long flags; void *dev_id; const char *devname; -} irq_handler_t; +}; struct irq_controller { const char *name; @@ -122,6 +122,7 @@ extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, void (*handler)(unsigned int, struct pt_regs *)); extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int); -asmlinkage void m68k_handle_int(unsigned int, struct pt_regs *); +asmlinkage void m68k_handle_int(unsigned int); +asmlinkage void __m68k_handle_int(unsigned int, struct pt_regs *); #endif /* _M68K_IRQ_H_ */ diff --git a/include/asm-m68k/mac_iop.h b/include/asm-m68k/mac_iop.h index b0d2e3473537..a2c7e6fcca38 100644 --- a/include/asm-m68k/mac_iop.h +++ b/include/asm-m68k/mac_iop.h @@ -143,17 +143,17 @@ struct iop_msg { int status; /* status of this message */ __u8 message[IOP_MSG_LEN]; /* the message being sent/received */ __u8 reply[IOP_MSG_LEN]; /* the reply to the message */ - void (*handler)(struct iop_msg *, struct pt_regs *); + void (*handler)(struct iop_msg *); /* function to call when reply recvd */ }; extern int iop_scc_present,iop_ism_present; extern int iop_listen(uint, uint, - void (*handler)(struct iop_msg *, struct pt_regs *), + void (*handler)(struct iop_msg *), const char *); extern int iop_send_message(uint, uint, void *, uint, __u8 *, - void (*)(struct iop_msg *, struct pt_regs *)); + void (*)(struct iop_msg *)); extern void iop_complete_message(struct iop_msg *); extern void iop_upload_code(uint, __u8 *, uint, __u16); extern void iop_download_code(uint, __u8 *, uint, __u16); diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index df898f27e434..862afa4c35d8 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h @@ -10,7 +10,7 @@ struct rtc_time; struct rtc_pll_info; struct buffer_head; -extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)); +extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *)); /* machine dependent irq functions */ extern void (*mach_init_IRQ) (void); extern void (*mach_get_model) (char *model); diff --git a/include/asm-m68k/sun3xflop.h b/include/asm-m68k/sun3xflop.h index ca8cc4113843..32c45f84ac60 100644 --- a/include/asm-m68k/sun3xflop.h +++ b/include/asm-m68k/sun3xflop.h @@ -111,8 +111,7 @@ static void sun3x_82072_fd_outb(unsigned char value, int port) } -asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id, - struct pt_regs * regs) +asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id) { register unsigned char st; @@ -125,7 +124,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id, static int dma_wait=0; #endif if(!doing_pdma) { - floppy_interrupt(irq, dev_id, regs); + floppy_interrupt(irq, dev_id); return IRQ_HANDLED; } @@ -189,7 +188,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id, dma_wait=0; #endif - floppy_interrupt(irq, dev_id, regs); + floppy_interrupt(irq, dev_id); return IRQ_HANDLED; } From 8774cb815f2492a95b90a927f93a2de555753b32 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 7 Oct 2006 14:17:31 +0100 Subject: [PATCH 079/232] [PATCH] minimal alpha pt_regs fixes Signed-off-by: Al Viro Acked-by: Jeff Garzik Signed-off-by: Linus Torvalds --- arch/alpha/kernel/irq.c | 5 ++++- arch/alpha/kernel/proto.h | 2 +- arch/alpha/kernel/smp.c | 6 +++++- arch/alpha/kernel/time.c | 6 +++--- include/asm-alpha/irq_regs.h | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 include/asm-alpha/irq_regs.h diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index 729c475d2269..dba4e70926f5 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -129,6 +129,7 @@ unlock: void handle_irq(int irq, struct pt_regs * regs) { + struct pt_regs *old_regs; /* * We ack quickly, we don't want the irq controller * thinking we're snobs just because some other CPU has @@ -149,6 +150,7 @@ handle_irq(int irq, struct pt_regs * regs) return; } + old_regs = set_irq_regs(regs); irq_enter(); /* * __do_IRQ() must be called with IPL_MAX. Note that we do not @@ -157,6 +159,7 @@ handle_irq(int irq, struct pt_regs * regs) * at IPL 0. */ local_irq_disable(); - __do_IRQ(irq, regs); + __do_IRQ(irq); irq_exit(); + set_irq_regs(old_regs); } diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 21f71287b6f5..408bda25b0b1 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -133,7 +133,7 @@ extern void smp_percpu_timer_interrupt(struct pt_regs *); /* extern void reset_for_srm(void); */ /* time.c */ -extern irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs); +extern irqreturn_t timer_interrupt(int irq, void *dev); extern void common_init_rtc(void); extern unsigned long est_cycle_freq; diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 4dc273e537fd..596780e2c7da 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -515,12 +515,15 @@ smp_cpus_done(unsigned int max_cpus) void smp_percpu_timer_interrupt(struct pt_regs *regs) { + struct pt_regs *old_regs; int cpu = smp_processor_id(); unsigned long user = user_mode(regs); struct cpuinfo_alpha *data = &cpu_data[cpu]; + old_regs = set_irq_regs(regs); + /* Record kernel PC. */ - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); if (!--data->prof_counter) { /* We need to make like a normal interrupt -- otherwise @@ -534,6 +537,7 @@ smp_percpu_timer_interrupt(struct pt_regs *regs) irq_exit(); } + set_irq_regs(old_regs); } int __init diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 581ddcc22fc5..cf0666523989 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -104,7 +104,7 @@ unsigned long long sched_clock(void) * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs) +irqreturn_t timer_interrupt(int irq, void *dev) { unsigned long delta; __u32 now; @@ -112,7 +112,7 @@ irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs) #ifndef CONFIG_SMP /* Not SMP, do kernel PC profiling here. */ - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); #endif write_seqlock(&xtime_lock); @@ -132,7 +132,7 @@ irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs) while (nticks > 0) { do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif nticks--; } diff --git a/include/asm-alpha/irq_regs.h b/include/asm-alpha/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-alpha/irq_regs.h @@ -0,0 +1 @@ +#include From 9c8e7f5cc965d30006c917ab19221e06fcc5a4f9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 7 Oct 2006 16:29:18 +0100 Subject: [PATCH 080/232] [PATCH] m32r pt_regs fixes ... and now with irq_regs.h not forgotten... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/m32r/kernel/irq.c | 5 ++++- arch/m32r/kernel/smp.c | 13 ++++++++----- arch/m32r/kernel/time.c | 10 +++++----- drivers/net/smc91x.c | 2 +- drivers/pcmcia/m32r_pcc.c | 2 +- drivers/serial/m32r_sio.c | 2 +- include/asm-m32r/irq_regs.h | 1 + 7 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 include/asm-m32r/irq_regs.h diff --git a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c index 3841861df6a2..f8d8650383e0 100644 --- a/arch/m32r/kernel/irq.c +++ b/arch/m32r/kernel/irq.c @@ -77,13 +77,16 @@ skip: */ asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs) { + struct pt_regs *old_regs; + old_regs = set_irq_regs(regs); irq_enter(); #ifdef CONFIG_DEBUG_STACKOVERFLOW /* FIXME M32R */ #endif - __do_IRQ(irq, regs); + __do_IRQ(irq); irq_exit(); + set_irq_regs(old_regs); return 1; } diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c index 8b1f6eb76870..722e21f556dc 100644 --- a/arch/m32r/kernel/smp.c +++ b/arch/m32r/kernel/smp.c @@ -101,7 +101,7 @@ void smp_call_function_interrupt(void); void smp_send_timer(void); void smp_ipi_timer_interrupt(struct pt_regs *); -void smp_local_timer_interrupt(struct pt_regs *); +void smp_local_timer_interrupt(void); void send_IPI_allbutself(int, int); static void send_IPI_mask(cpumask_t, int, int); @@ -734,9 +734,12 @@ void smp_send_timer(void) *==========================================================================*/ void smp_ipi_timer_interrupt(struct pt_regs *regs) { + struct pt_regs *old_regs; + old_regs = set_irq_regs(regs); irq_enter(); - smp_local_timer_interrupt(regs); + smp_local_timer_interrupt(); irq_exit(); + set_irq_regs(old_regs); } /*==========================================================================* @@ -762,9 +765,9 @@ void smp_ipi_timer_interrupt(struct pt_regs *regs) * ---------- --- -------------------------------------------------------- * 2003-06-24 hy use per_cpu structure. *==========================================================================*/ -void smp_local_timer_interrupt(struct pt_regs *regs) +void smp_local_timer_interrupt(void) { - int user = user_mode(regs); + int user = user_mode(get_irq_regs()); int cpu_id = smp_processor_id(); /* @@ -774,7 +777,7 @@ void smp_local_timer_interrupt(struct pt_regs *regs) * useful with a profiling multiplier != 1 */ - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); if (--per_cpu(prof_counter, cpu_id) <= 0) { /* diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c index d8af155db984..a09038282c78 100644 --- a/arch/m32r/kernel/time.c +++ b/arch/m32r/kernel/time.c @@ -35,7 +35,7 @@ #ifdef CONFIG_SMP extern void send_IPI_allbutself(int, int); -extern void smp_local_timer_interrupt(struct pt_regs *); +extern void smp_local_timer_interrupt(void); #endif #define TICK_SIZE (tick_nsec / 1000) @@ -188,15 +188,15 @@ static long last_rtc_update = 0; * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t timer_interrupt(int irq, void *dev_id) { #ifndef CONFIG_SMP - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); #endif do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif /* * If we have an externally synchronized Linux clock, then update @@ -221,7 +221,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) a hack, so don't look closely for now.. */ #ifdef CONFIG_SMP - smp_local_timer_interrupt(regs); + smp_local_timer_interrupt(); smp_send_timer(); #endif diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 506807fa5268..95b6478f55c6 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c @@ -1400,7 +1400,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) static void smc_poll_controller(struct net_device *dev) { disable_irq(dev->irq); - smc_interrupt(dev->irq, dev, NULL); + smc_interrupt(dev->irq, dev); enable_irq(dev->irq); } #endif diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c index 0964fd76bfe3..bbf025874d0c 100644 --- a/drivers/pcmcia/m32r_pcc.c +++ b/drivers/pcmcia/m32r_pcc.c @@ -395,7 +395,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev) static void pcc_interrupt_wrapper(u_long data) { - pcc_interrupt(0, NULL, NULL); + pcc_interrupt(0, NULL); init_timer(&poll_timer); poll_timer.expires = jiffies + poll_interval; add_timer(&poll_timer); diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index c85ac1a77608..7656a35f5e2f 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c @@ -590,7 +590,7 @@ static void m32r_sio_timeout(unsigned long data) sts = sio_in(up, SIOSTS); if (sts & 0x5) { spin_lock(&up->port.lock); - m32r_sio_handle_port(up, sts, NULL); + m32r_sio_handle_port(up, sts); spin_unlock(&up->port.lock); } diff --git a/include/asm-m32r/irq_regs.h b/include/asm-m32r/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-m32r/irq_regs.h @@ -0,0 +1 @@ +#include From 59d6ab86a6b1097d5e5eae5d820f8e2661009324 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 6 Oct 2006 17:36:20 +0100 Subject: [PATCH 081/232] [MIPS] Update Malta config. Signed-off-by: Ralf Baechle --- arch/mips/Kconfig | 24 ++++---- arch/mips/configs/malta_defconfig | 98 +++++++++++++++++++++++-------- 2 files changed, 87 insertions(+), 35 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 8a49884bd5ec..731b942a824b 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1465,6 +1465,18 @@ config MIPS_MT_DISABLED the option of an MT-enabled processor this option will be the only option in this menu. +config MIPS_MT_SMP + bool "Use 1 TC on each available VPE for SMP" + depends on SYS_SUPPORTS_MULTITHREADING + select CPU_MIPSR2_IRQ_VI + select CPU_MIPSR2_SRS + select MIPS_MT + select SMP + select SYS_SUPPORTS_SMP + help + This is a kernel model which is also known a VSMP or lately + has been marketesed into SMVP. + config MIPS_MT_SMTC bool "SMTC: Use all TCs on all VPEs for SMP" depends on CPU_MIPS32_R2 @@ -1479,18 +1491,6 @@ config MIPS_MT_SMTC This is a kernel model which is known a SMTC or lately has been marketesed into SMVP. -config MIPS_MT_SMP - bool "Use 1 TC on each available VPE for SMP" - depends on SYS_SUPPORTS_MULTITHREADING - select CPU_MIPSR2_IRQ_VI - select CPU_MIPSR2_SRS - select MIPS_MT - select SMP - select SYS_SUPPORTS_SMP - help - This is a kernel model which is also known a VSMP or lately - has been marketesed into SMVP. - config MIPS_VPE_LOADER bool "VPE loader support." depends on SYS_SUPPORTS_MULTITHREADING diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig index aeefe2873e38..101e80347dce 100644 --- a/arch/mips/configs/malta_defconfig +++ b/arch/mips/configs/malta_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc1 -# Thu Jul 6 10:04:13 2006 +# Linux kernel version: 2.6.19-rc1 +# Fri Oct 6 17:34:55 2006 # CONFIG_MIPS=y @@ -25,8 +25,6 @@ CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MIPS_EV64120 is not set -# CONFIG_MIPS_IVR is not set -# CONFIG_MIPS_ITE8172 is not set # CONFIG_MACH_JAZZ is not set # CONFIG_LASAT is not set # CONFIG_MIPS_ATLAS is not set @@ -67,6 +65,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_TIME=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMA_NONCOHERENT=y @@ -134,19 +133,19 @@ CONFIG_MIPS_CPU_SCACHE=y CONFIG_CPU_HAS_PREFETCH=y # CONFIG_MIPS_MT_DISABLED is not set # CONFIG_MIPS_MT_SMTC is not set -# CONFIG_MIPS_MT_SMP is not set -CONFIG_MIPS_VPE_LOADER=y +CONFIG_MIPS_MT_SMP=y +# CONFIG_MIPS_VPE_LOADER is not set CONFIG_MIPS_MT=y CONFIG_SYS_SUPPORTS_MULTITHREADING=y CONFIG_MIPS_MT_FPAFF=y -CONFIG_MIPS_VPE_LOADER_TOM=y -CONFIG_MIPS_VPE_APSP_API=y -CONFIG_MIPS_APSP_KSPD=y # CONFIG_64BIT_PHYS_ADDR is not set CONFIG_CPU_HAS_LLSC=y +CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_MIPSR2_SRS=y CONFIG_CPU_HAS_SYNC=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_IRQ_PER_CPU=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y @@ -158,6 +157,9 @@ CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 # CONFIG_HZ_48 is not set CONFIG_HZ_100=y # CONFIG_HZ_128 is not set @@ -170,6 +172,7 @@ CONFIG_HZ=100 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set +CONFIG_PREEMPT_BKL=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" @@ -178,7 +181,7 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # Code maturity level options # CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 # @@ -188,15 +191,20 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y +# CONFIG_IPC_NS is not set # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y +# CONFIG_TASKSTATS is not set +# CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set +# CONFIG_CPUSETS is not set CONFIG_RELAY=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y CONFIG_EMBEDDED=y +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_HOTPLUG=y @@ -204,12 +212,12 @@ CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y -CONFIG_RT_MUTEXES=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_SLAB=y CONFIG_VM_EVENT_COUNTERS=y +CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set @@ -223,10 +231,12 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y # # Block layer # +CONFIG_BLOCK=y # CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set # CONFIG_LSF is not set @@ -249,6 +259,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_HW_HAS_PCI=y CONFIG_PCI=y +# CONFIG_PCI_MULTITHREAD_PROBE is not set CONFIG_MMU=y # @@ -282,6 +293,7 @@ CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_XFRM=y CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y @@ -313,10 +325,12 @@ CONFIG_INET_XFRM_TUNNEL=m CONFIG_INET_TUNNEL=m CONFIG_INET_XFRM_MODE_TRANSPORT=m CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=y CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_BIC=y +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" # # IP: Virtual Server Configuration @@ -358,11 +372,16 @@ CONFIG_IPV6_ROUTE_INFO=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set CONFIG_INET6_XFRM_TUNNEL=m CONFIG_INET6_TUNNEL=m CONFIG_INET6_XFRM_MODE_TRANSPORT=m CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_SUBTREES is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set CONFIG_NETWORK_SECMARK=y CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set @@ -377,6 +396,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m CONFIG_NETFILTER_XTABLES=m CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set CONFIG_NETFILTER_XT_TARGET_MARK=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_NOTRACK=m @@ -387,6 +407,7 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m CONFIG_NETFILTER_XT_MATCH_DCCP=m +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HELPER=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m @@ -429,7 +450,6 @@ CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_OWNER=m @@ -457,7 +477,6 @@ CONFIG_IP_NF_NAT_SIP=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_TTL=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_RAW=m @@ -536,13 +555,12 @@ CONFIG_LLC=m # CONFIG_LLC2 is not set # CONFIG_IPX is not set CONFIG_ATALK=m -CONFIG_DEV_APPLETALK=y +CONFIG_DEV_APPLETALK=m CONFIG_IPDDP=m CONFIG_IPDDP_ENCAP=y CONFIG_IPDDP_DECAP=y # CONFIG_X25 is not set # CONFIG_LAPB is not set -CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set @@ -604,6 +622,7 @@ CONFIG_IEEE80211_CRYPT_CCMP=m CONFIG_IEEE80211_SOFTMAC=m # CONFIG_IEEE80211_SOFTMAC_DEBUG is not set CONFIG_WIRELESS_EXT=y +CONFIG_FIB_RULES=y # # Device Drivers @@ -652,6 +671,7 @@ CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 # CONFIG_BLK_DEV_INITRD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 @@ -662,6 +682,7 @@ CONFIG_ATA_OVER_ETH=m # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y +CONFIG_IDE_MAX_HWIFS=4 CONFIG_BLK_DEV_IDE=y # @@ -699,6 +720,7 @@ CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_JMICRON is not set # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_IT821X is not set @@ -721,6 +743,7 @@ CONFIG_IDEDMA_AUTO=y # CONFIG_RAID_ATTRS=m CONFIG_SCSI=m +CONFIG_SCSI_NETLINK=y CONFIG_SCSI_PROC_FS=y # @@ -742,12 +765,13 @@ CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y # -# SCSI Transport Attributes +# SCSI Transports # CONFIG_SCSI_SPI_ATTRS=m CONFIG_SCSI_FC_ATTRS=m CONFIG_SCSI_ISCSI_ATTRS=m CONFIG_SCSI_SAS_ATTRS=m +# CONFIG_SCSI_SAS_LIBSAS is not set # # SCSI low-level drivers @@ -765,27 +789,34 @@ CONFIG_AIC7XXX_DEBUG_MASK=0 CONFIG_AIC7XXX_REG_PRETTY_PRINT=y # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set # CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ARCMSR is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set -# CONFIG_SCSI_SATA is not set # CONFIG_SCSI_HPTIOP is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set # CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set +# +# Serial ATA (prod) and Parallel ATA (experimental) drivers +# +# CONFIG_ATA is not set + # # Multi-device support (RAID and LVM) # @@ -800,6 +831,7 @@ CONFIG_MD_RAID5_RESHAPE=y CONFIG_MD_MULTIPATH=m CONFIG_MD_FAULTY=m CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_MIRROR=m @@ -854,6 +886,7 @@ CONFIG_LXT_PHY=m CONFIG_CICADA_PHY=m CONFIG_VITESSE_PHY=m CONFIG_SMSC_PHY=m +# CONFIG_FIXED_PHY is not set # # Ethernet (10 or 100Mbit) @@ -873,6 +906,7 @@ CONFIG_MII=y # CONFIG_HP100 is not set CONFIG_NET_PCI=y CONFIG_PCNET32=y +# CONFIG_PCNET32_NAPI is not set # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_B44 is not set @@ -909,6 +943,7 @@ CONFIG_PCNET32=y # CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # CONFIG_BNX2 is not set +# CONFIG_QLA3XXX is not set # # Ethernet (10000 Mbit) @@ -956,6 +991,7 @@ CONFIG_PCNET32=y # Input device support # CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set # # Userland interfaces @@ -1070,12 +1106,12 @@ CONFIG_RTC=y # # Misc devices # +# CONFIG_TIFM_CORE is not set # # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -1093,6 +1129,7 @@ CONFIG_VIDEO_V4L2=y # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -1191,6 +1228,7 @@ CONFIG_XFS_QUOTA=y CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y # CONFIG_XFS_RT is not set +# CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set CONFIG_MINIX_FS=m CONFIG_ROMFS_FS=m @@ -1230,8 +1268,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y CONFIG_SYSFS=y CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # CONFIG_CONFIGFS_FS is not set @@ -1279,7 +1319,6 @@ CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set -# CONFIG_CIFS_DEBUG2 is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -1335,6 +1374,11 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m +# +# Distributed Lock Manager +# +# CONFIG_DLM is not set + # # Profiling support # @@ -1345,10 +1389,11 @@ CONFIG_NLS_UTF8=m # CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_MUST_CHECK=y # CONFIG_MAGIC_SYSRQ is not set # CONFIG_UNUSED_SYMBOLS is not set # CONFIG_DEBUG_KERNEL is not set -CONFIG_LOG_BUF_SHIFT=14 +CONFIG_LOG_BUF_SHIFT=15 # CONFIG_DEBUG_FS is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" @@ -1363,6 +1408,10 @@ CONFIG_CMDLINE="" # Cryptographic options # CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=m CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m @@ -1372,9 +1421,12 @@ CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m From 5c90d528b21cb9506713f92730f33246b80ecc25 Mon Sep 17 00:00:00 2001 From: Scott Ashcroft Date: Fri, 6 Oct 2006 16:54:54 +0100 Subject: [PATCH 082/232] [MIPS] Cobalt: Time runs too quickly A kernel built with HZ==250 runs about 4 four times too quickly on a Cobalt RaQ2. Signed-off-by: Scott Ashcroft Signed-off-by: Ralf Baechle --- arch/mips/cobalt/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c index 0b347cffc768..bf9dc72b9720 100644 --- a/arch/mips/cobalt/setup.c +++ b/arch/mips/cobalt/setup.c @@ -50,8 +50,8 @@ const char *get_system_type(void) void __init plat_timer_setup(struct irqaction *irq) { - /* Load timer value for 1KHz (TCLK is 50MHz) */ - GALILEO_OUTL(50*1000*1000 / 1000, GT_TC0_OFS); + /* Load timer value for HZ (TCLK is 50MHz) */ + GALILEO_OUTL(50*1000*1000 / HZ, GT_TC0_OFS); /* Enable timer */ GALILEO_OUTL(GALILEO_ENTC0 | GALILEO_SELTC0, GT_TC_CONTROL_OFS); From 31aa36658a123263a9a69896e348b9600e050679 Mon Sep 17 00:00:00 2001 From: Karl-Johan Karlsson Date: Sun, 8 Oct 2006 01:15:02 +0200 Subject: [PATCH 083/232] [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. Signed-off-by: Karl-Johan Karlsson Signed-off-by: Ralf Baechle --- arch/mips/kernel/proc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index d8beef107902..46ee5a68ab13 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c @@ -89,9 +89,9 @@ static const char *cpu_name[] = { static int show_cpuinfo(struct seq_file *m, void *v) { - unsigned int version = current_cpu_data.processor_id; - unsigned int fp_vers = current_cpu_data.fpu_id; unsigned long n = (unsigned long) v - 1; + unsigned int version = cpu_data[n].processor_id; + unsigned int fp_vers = cpu_data[n].fpu_id; char fmt [64]; #ifdef CONFIG_SMP @@ -108,8 +108,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "processor\t\t: %ld\n", n); sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n", cpu_has_fpu ? " FPU V%d.%d" : ""); - seq_printf(m, fmt, cpu_name[current_cpu_data.cputype <= CPU_LAST ? - current_cpu_data.cputype : CPU_UNKNOWN], + seq_printf(m, fmt, cpu_name[cpu_data[n].cputype <= CPU_LAST ? + cpu_data[n].cputype : CPU_UNKNOWN], (version >> 4) & 0x0f, version & 0x0f, (fp_vers >> 4) & 0x0f, fp_vers & 0x0f); seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n", @@ -118,7 +118,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no"); seq_printf(m, "microsecond timers\t: %s\n", cpu_has_counter ? "yes" : "no"); - seq_printf(m, "tlb_entries\t\t: %d\n", current_cpu_data.tlbsize); + seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize); seq_printf(m, "extra interrupt vector\t: %s\n", cpu_has_divec ? "yes" : "no"); seq_printf(m, "hardware watchpoint\t: %s\n", From 937a801576f954bd030d7c4a5a94571710d87c0b Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 7 Oct 2006 19:44:33 +0100 Subject: [PATCH 084/232] [MIPS] Complete fixes after removal of pt_regs argument to int handlers. Signed-off-by: Ralf Baechle --- arch/mips/au1000/common/dma.c | 2 +- arch/mips/au1000/common/irq.c | 52 ++++----- arch/mips/au1000/common/time.c | 13 ++- arch/mips/au1000/common/usbdev.c | 9 +- arch/mips/au1000/pb1200/irqmap.c | 5 +- arch/mips/basler/excite/excite_dbg_io.c | 2 +- arch/mips/basler/excite/excite_iodev.c | 14 +-- arch/mips/basler/excite/excite_irq.c | 18 +-- arch/mips/cobalt/irq.c | 49 +++----- arch/mips/ddb5xxx/ddb5477/irq.c | 19 ++-- arch/mips/dec/int-handler.S | 4 +- arch/mips/emma2rh/common/irq.c | 12 +- arch/mips/emma2rh/markeins/irq.c | 14 +-- arch/mips/gt64120/common/time.c | 5 +- arch/mips/gt64120/ev64120/irq.c | 14 +-- arch/mips/gt64120/momenco_ocelot/irq.c | 22 ++-- arch/mips/gt64120/wrppmc/irq.c | 10 +- arch/mips/jazz/irq.c | 30 ++--- arch/mips/jmr3927/rbhma3100/irq.c | 106 +++++++++--------- arch/mips/kernel/asm-offsets.c | 3 +- arch/mips/kernel/entry.S | 1 - arch/mips/kernel/genex.S | 15 ++- arch/mips/kernel/irq-msc01.c | 4 +- arch/mips/kernel/irq-mv6434x.c | 6 +- arch/mips/kernel/irq.c | 6 +- arch/mips/kernel/rtlx.c | 6 +- arch/mips/kernel/smp-mt.c | 16 +-- arch/mips/kernel/smtc.c | 26 ++--- arch/mips/kernel/time.c | 11 +- arch/mips/lasat/interrupt.c | 6 +- arch/mips/mips-boards/atlas/atlas_int.c | 12 +- arch/mips/mips-boards/generic/time.c | 22 ++-- arch/mips/mips-boards/malta/malta_int.c | 26 +++-- arch/mips/mips-boards/sead/sead_int.c | 4 +- arch/mips/mips-boards/sim/sim_int.c | 11 +- arch/mips/mips-boards/sim/sim_time.c | 14 +-- arch/mips/momentum/jaguar_atx/irq.c | 20 ++-- arch/mips/momentum/ocelot_3/irq.c | 22 ++-- arch/mips/momentum/ocelot_c/cpci-irq.c | 4 +- arch/mips/momentum/ocelot_c/irq.c | 22 ++-- arch/mips/momentum/ocelot_c/uart-irq.c | 4 +- arch/mips/momentum/ocelot_g/gt-irq.c | 4 +- arch/mips/momentum/ocelot_g/irq.c | 24 ++-- arch/mips/oprofile/op_impl.h | 4 +- arch/mips/oprofile/op_model_mipsxx.c | 7 +- arch/mips/pci/pci-ip32.c | 2 +- arch/mips/philips/pnx8550/common/int.c | 32 +++--- arch/mips/pmc-sierra/yosemite/irq.c | 54 ++------- arch/mips/pmc-sierra/yosemite/smp.c | 2 +- arch/mips/qemu/q-irq.c | 6 +- arch/mips/sgi-ip22/ip22-berr.c | 4 +- arch/mips/sgi-ip22/ip22-eisa.c | 5 +- arch/mips/sgi-ip22/ip22-int.c | 32 +++--- arch/mips/sgi-ip22/ip22-time.c | 6 +- arch/mips/sgi-ip27/ip27-irq.c | 26 ++--- arch/mips/sgi-ip27/ip27-timer.c | 4 +- arch/mips/sgi-ip32/crime.c | 6 +- arch/mips/sgi-ip32/ip32-irq.c | 48 ++++---- arch/mips/sibyte/bcm1480/irq.c | 27 +++-- arch/mips/sibyte/bcm1480/smp.c | 2 +- arch/mips/sibyte/bcm1480/time.c | 8 +- arch/mips/sibyte/sb1250/irq.c | 28 +++-- arch/mips/sibyte/sb1250/smp.c | 2 +- arch/mips/sibyte/sb1250/time.c | 6 +- arch/mips/sni/irq.c | 34 +++--- arch/mips/tx4927/common/tx4927_irq.c | 14 +-- .../toshiba_rbtx4927/toshiba_rbtx4927_setup.c | 6 +- arch/mips/tx4938/common/irq.c | 46 ++------ arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c | 3 +- arch/mips/vr41xx/common/icu.c | 2 +- arch/mips/vr41xx/common/irq.c | 32 +++--- include/asm-mips/irq.h | 8 +- include/asm-mips/irq_regs.h | 22 +++- include/asm-mips/jmr3927/irq.h | 4 - include/asm-mips/mach-au1x00/au1000_dma.h | 3 +- include/asm-mips/marvell.h | 2 +- include/asm-mips/msc01_ic.h | 2 +- include/asm-mips/thread_info.h | 1 + include/asm-mips/time.h | 4 +- 79 files changed, 559 insertions(+), 624 deletions(-) diff --git a/arch/mips/au1000/common/dma.c b/arch/mips/au1000/common/dma.c index fb7c47c1585d..c3019b9c91b1 100644 --- a/arch/mips/au1000/common/dma.c +++ b/arch/mips/au1000/common/dma.c @@ -160,7 +160,7 @@ void dump_au1000_dma_channel(unsigned int dmanr) * Requests the DMA done IRQ if irqhandler != NULL. */ int request_au1000_dma(int dev_id, const char *dev_str, - irqreturn_t (*irqhandler)(int, void *, struct pt_regs *), + irqreturn_t (*irqhandler)(int, void *), unsigned long irqflags, void *irq_dev_id) { diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c index 316722ee8cf5..b32597e05a69 100644 --- a/arch/mips/au1000/common/irq.c +++ b/arch/mips/au1000/common/irq.c @@ -67,7 +67,7 @@ extern void set_debug_traps(void); extern irq_cpustat_t irq_stat [NR_CPUS]; -extern void mips_timer_interrupt(struct pt_regs *regs); +extern void mips_timer_interrupt(void); static void setup_local_irq(unsigned int irq, int type, int int_req); static unsigned int startup_irq(unsigned int irq); @@ -81,10 +81,6 @@ inline void local_disable_irq(unsigned int irq_nr); void (*board_init_irq)(void); -#ifdef CONFIG_PM -extern irqreturn_t counter0_irq(int irq, void *dev_id, struct pt_regs *regs); -#endif - static DEFINE_SPINLOCK(irq_lock); @@ -292,7 +288,7 @@ static struct irq_chip level_irq_type = { }; #ifdef CONFIG_PM -void startup_match20_interrupt(irqreturn_t (*handler)(int, void *, struct pt_regs *)) +void startup_match20_interrupt(irqreturn_t (*handler)(int, void *)) { struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT]; @@ -501,14 +497,15 @@ void __init arch_init_irq(void) * intcX_reqX_irqdispatch(). */ -void intc0_req0_irqdispatch(struct pt_regs *regs) +static void intc0_req0_irqdispatch(void) { int irq = 0; static unsigned long intc0_req0 = 0; intc0_req0 |= au_readl(IC0_REQ0INT); - if (!intc0_req0) return; + if (!intc0_req0) + return; #ifdef AU1000_USB_DEV_REQ_INT /* * Because of the tight timing of SETUP token to reply @@ -517,28 +514,29 @@ void intc0_req0_irqdispatch(struct pt_regs *regs) */ if ((intc0_req0 & (1< 0) { do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif time_elapsed -= MATCH20_INC; last_match20 += MATCH20_INC; @@ -158,7 +159,7 @@ irqreturn_t counter0_irq(int irq, void *dev_id, struct pt_regs *regs) jiffie_drift -= 999; do_timer(1); /* increment jiffies by one */ #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif } diff --git a/arch/mips/au1000/common/usbdev.c b/arch/mips/au1000/common/usbdev.c index 63bcb3a95dc7..70dc82e536cd 100644 --- a/arch/mips/au1000/common/usbdev.c +++ b/arch/mips/au1000/common/usbdev.c @@ -1031,8 +1031,7 @@ process_ep_receive (struct usb_dev* dev, endpoint_t *ep) /* This ISR handles the receive complete and suspend events */ -static void -req_sus_intr (int irq, void *dev_id, struct pt_regs *regs) +static void req_sus_intr (int irq, void *dev_id) { struct usb_dev *dev = (struct usb_dev *) dev_id; u32 status; @@ -1050,8 +1049,7 @@ req_sus_intr (int irq, void *dev_id, struct pt_regs *regs) /* This ISR handles the DMA done events on EP0 */ -static void -dma_done_ep0_intr(int irq, void *dev_id, struct pt_regs *regs) +static void dma_done_ep0_intr(int irq, void *dev_id) { struct usb_dev *dev = (struct usb_dev *) dev_id; usbdev_pkt_t* pkt; @@ -1094,8 +1092,7 @@ dma_done_ep0_intr(int irq, void *dev_id, struct pt_regs *regs) } /* This ISR handles the DMA done events on endpoints 2,3,4,5 */ -static void -dma_done_ep_intr(int irq, void *dev_id, struct pt_regs *regs) +static void dma_done_ep_intr(int irq, void *dev_id) { struct usb_dev *dev = (struct usb_dev *) dev_id; int i; diff --git a/arch/mips/au1000/pb1200/irqmap.c b/arch/mips/au1000/pb1200/irqmap.c index f66779f0d4cd..91983ba407c4 100644 --- a/arch/mips/au1000/pb1200/irqmap.c +++ b/arch/mips/au1000/pb1200/irqmap.c @@ -65,7 +65,7 @@ int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); */ static volatile int pb1200_cascade_en=0; -irqreturn_t pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t pb1200_cascade_handler( int irq, void *dev_id) { unsigned short bisr = bcsr->int_status; int extirq_nr = 0; @@ -76,8 +76,9 @@ irqreturn_t pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs) { extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr); /* Ack and dispatch IRQ */ - do_IRQ(extirq_nr,regs); + do_IRQ(extirq_nr); } + return IRQ_RETVAL(1); } diff --git a/arch/mips/basler/excite/excite_dbg_io.c b/arch/mips/basler/excite/excite_dbg_io.c index c04505afa47f..d289e3a868cf 100644 --- a/arch/mips/basler/excite/excite_dbg_io.c +++ b/arch/mips/basler/excite/excite_dbg_io.c @@ -112,7 +112,7 @@ int putDebugChar(int data) } /* KGDB interrupt handler */ -asmlinkage void excite_kgdb_inthdl(struct pt_regs *regs) +asmlinkage void excite_kgdb_inthdl(void) { if (unlikely( ((titan_readl(UAIIR) & 0x7) == 4) diff --git a/arch/mips/basler/excite/excite_iodev.c b/arch/mips/basler/excite/excite_iodev.c index 10bbb8cfb964..6af0b21ebc32 100644 --- a/arch/mips/basler/excite/excite_iodev.c +++ b/arch/mips/basler/excite/excite_iodev.c @@ -38,7 +38,7 @@ static int iodev_open(struct inode *, struct file *); static int iodev_release(struct inode *, struct file *); static ssize_t iodev_read(struct file *, char __user *, size_t s, loff_t *); static unsigned int iodev_poll(struct file *, struct poll_table_struct *); -static irqreturn_t iodev_irqhdl(int, void *, struct pt_regs *); +static irqreturn_t iodev_irqhdl(int, void *); @@ -108,16 +108,12 @@ static int __exit iodev_remove(struct device *dev) return misc_deregister(&miscdev); } - - static int iodev_open(struct inode *i, struct file *f) { return request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED, iodev_name, &miscdev); } - - static int iodev_release(struct inode *i, struct file *f) { free_irq(iodev_irq, &miscdev); @@ -148,17 +144,13 @@ static unsigned int iodev_poll(struct file *f, struct poll_table_struct *p) return POLLOUT | POLLWRNORM; } - - - -static irqreturn_t iodev_irqhdl(int irq, void *ctxt, struct pt_regs *regs) +static irqreturn_t iodev_irqhdl(int irq, void *ctxt) { wake_up(&wq); + return IRQ_HANDLED; } - - static int __init iodev_init_module(void) { return driver_register(&iodev_driver); diff --git a/arch/mips/basler/excite/excite_irq.c b/arch/mips/basler/excite/excite_irq.c index 511ad8730f54..2e2061a286c5 100644 --- a/arch/mips/basler/excite/excite_irq.c +++ b/arch/mips/basler/excite/excite_irq.c @@ -56,7 +56,7 @@ void __init arch_init_irq(void) #endif } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { const u32 interrupts = read_c0_cause() >> 8, @@ -67,7 +67,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) /* process timer interrupt */ if (pending & (1 << TIMER_IRQ)) { - do_IRQ(TIMER_IRQ, regs); + do_IRQ(TIMER_IRQ); return; } @@ -80,7 +80,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) #else if (pending & (1 << USB_IRQ)) { #endif - do_IRQ(USB_IRQ, regs); + do_IRQ(USB_IRQ); return; } @@ -91,9 +91,9 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) if ((pending & (1 << TITAN_IRQ)) && msgint) { ocd_writel(msgint, INTP0Clear0 + (TITAN_MSGINT / 0x20 * 0x10)); #if defined(CONFIG_KGDB) - excite_kgdb_inthdl(regs); + excite_kgdb_inthdl(); #endif - do_IRQ(TITAN_IRQ, regs); + do_IRQ(TITAN_IRQ); return; } @@ -102,7 +102,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) msgintmask = ocd_readl(INTP0Mask0 + (FPGA0_MSGINT / 0x20 * 0x10)); msgint = msgintflags & msgintmask & (0x1 << (FPGA0_MSGINT % 0x20)); if ((pending & (1 << FPGA0_IRQ)) && msgint) { - do_IRQ(FPGA0_IRQ, regs); + do_IRQ(FPGA0_IRQ); return; } @@ -111,7 +111,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) msgintmask = ocd_readl(INTP0Mask0 + (FPGA1_MSGINT / 0x20 * 0x10)); msgint = msgintflags & msgintmask & (0x1 << (FPGA1_MSGINT % 0x20)); if ((pending & (1 << FPGA1_IRQ)) && msgint) { - do_IRQ(FPGA1_IRQ, regs); + do_IRQ(FPGA1_IRQ); return; } @@ -120,10 +120,10 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) msgintmask = ocd_readl(INTP0Mask0 + (PHY_MSGINT / 0x20 * 0x10)); msgint = msgintflags & msgintmask & (0x1 << (PHY_MSGINT % 0x20)); if ((pending & (1 << PHY_IRQ)) && msgint) { - do_IRQ(PHY_IRQ, regs); + do_IRQ(PHY_IRQ); return; } /* Process spurious interrupts */ - spurious_interrupt(regs); + spurious_interrupt(); } diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c index 0b75f4fb7195..1117fab19733 100644 --- a/arch/mips/cobalt/irq.c +++ b/arch/mips/cobalt/irq.c @@ -42,7 +42,7 @@ * 15 - IDE1 */ -static inline void galileo_irq(struct pt_regs *regs) +static inline void galileo_irq(void) { unsigned int mask, pending, devfn; @@ -52,7 +52,7 @@ static inline void galileo_irq(struct pt_regs *regs) if (pending & GALILEO_INTR_T0EXP) { GALILEO_OUTL(~GALILEO_INTR_T0EXP, GT_INTRCAUSE_OFS); - do_IRQ(COBALT_GALILEO_IRQ, regs); + do_IRQ(COBALT_GALILEO_IRQ); } else if (pending & GALILEO_INTR_RETRY_CTR) { @@ -68,44 +68,31 @@ static inline void galileo_irq(struct pt_regs *regs) } } -static inline void via_pic_irq(struct pt_regs *regs) +static inline void via_pic_irq(void) { int irq; irq = i8259_irq(); if (irq >= 0) - do_IRQ(irq, regs); + do_IRQ(irq); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { - unsigned pending; + unsigned pending = read_c0_status() & read_c0_cause(); - pending = read_c0_status() & read_c0_cause(); - - if (pending & CAUSEF_IP2) /* COBALT_GALILEO_IRQ (18) */ - - galileo_irq(regs); - - else if (pending & CAUSEF_IP6) /* COBALT_VIA_IRQ (22) */ - - via_pic_irq(regs); - - else if (pending & CAUSEF_IP3) /* COBALT_ETH0_IRQ (19) */ - - do_IRQ(COBALT_CPU_IRQ + 3, regs); - - else if (pending & CAUSEF_IP4) /* COBALT_ETH1_IRQ (20) */ - - do_IRQ(COBALT_CPU_IRQ + 4, regs); - - else if (pending & CAUSEF_IP5) /* COBALT_SERIAL_IRQ (21) */ - - do_IRQ(COBALT_CPU_IRQ + 5, regs); - - else if (pending & CAUSEF_IP7) /* IRQ 23 */ - - do_IRQ(COBALT_CPU_IRQ + 7, regs); + if (pending & CAUSEF_IP2) /* COBALT_GALILEO_IRQ (18) */ + galileo_irq(); + else if (pending & CAUSEF_IP6) /* COBALT_VIA_IRQ (22) */ + via_pic_irq(); + else if (pending & CAUSEF_IP3) /* COBALT_ETH0_IRQ (19) */ + do_IRQ(COBALT_CPU_IRQ + 3); + else if (pending & CAUSEF_IP4) /* COBALT_ETH1_IRQ (20) */ + do_IRQ(COBALT_CPU_IRQ + 4); + else if (pending & CAUSEF_IP5) /* COBALT_SERIAL_IRQ (21) */ + do_IRQ(COBALT_CPU_IRQ + 5); + else if (pending & CAUSEF_IP7) /* IRQ 23 */ + do_IRQ(COBALT_CPU_IRQ + 7); } static struct irqaction irq_via = { diff --git a/arch/mips/ddb5xxx/ddb5477/irq.c b/arch/mips/ddb5xxx/ddb5477/irq.c index 513fc6722d84..a8bd2e66705c 100644 --- a/arch/mips/ddb5xxx/ddb5477/irq.c +++ b/arch/mips/ddb5xxx/ddb5477/irq.c @@ -153,8 +153,7 @@ u8 i8259_interrupt_ack(void) * the first level int-handler will jump here if it is a vrc5477 irq */ #define NUM_5477_IRQS 32 -static void -vrc5477_irq_dispatch(struct pt_regs *regs) +static void vrc5477_irq_dispatch(void) { u32 intStatus; u32 bitmask; @@ -178,7 +177,7 @@ vrc5477_irq_dispatch(struct pt_regs *regs) /* check for i8259 interrupts */ if (intStatus & (1 << VRC5477_I8259_CASCADE)) { int i8259_irq = i8259_interrupt_ack(); - do_IRQ(I8259_IRQ_BASE + i8259_irq, regs); + do_IRQ(I8259_IRQ_BASE + i8259_irq); return; } } @@ -186,7 +185,7 @@ vrc5477_irq_dispatch(struct pt_regs *regs) for (i=0, bitmask=1; i<= NUM_5477_IRQS; bitmask <<=1, i++) { /* do we need to "and" with the int mask? */ if (intStatus & bitmask) { - do_IRQ(VRC5477_IRQ_BASE + i, regs); + do_IRQ(VRC5477_IRQ_BASE + i); return; } } @@ -194,18 +193,18 @@ vrc5477_irq_dispatch(struct pt_regs *regs) #define VR5477INTS (STATUSF_IP2|STATUSF_IP3|STATUSF_IP4|STATUSF_IP5|STATUSF_IP6) -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status(); if (pending & STATUSF_IP7) - do_IRQ(CPU_IRQ_BASE + 7, regs); + do_IRQ(CPU_IRQ_BASE + 7); else if (pending & VR5477INTS) - vrc5477_irq_dispatch(regs); + vrc5477_irq_dispatch(); else if (pending & STATUSF_IP0) - do_IRQ(CPU_IRQ_BASE, regs); + do_IRQ(CPU_IRQ_BASE); else if (pending & STATUSF_IP1) - do_IRQ(CPU_IRQ_BASE + 1, regs); + do_IRQ(CPU_IRQ_BASE + 1); else - spurious_interrupt(regs); + spurious_interrupt(); } diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S index 455a65b91cb0..55d60d5e0e86 100644 --- a/arch/mips/dec/int-handler.S +++ b/arch/mips/dec/int-handler.S @@ -264,8 +264,10 @@ srlv t3,t1,t2 handle_it: + LONG_L s0, TI_REGS($28) + LONG_S sp, TI_REGS($28) jal do_IRQ - move a1,sp + LONG_S s0, TI_REGS($28) j ret_from_irq nop diff --git a/arch/mips/emma2rh/common/irq.c b/arch/mips/emma2rh/common/irq.c index 3af57693c84c..c191b3e9d9d9 100644 --- a/arch/mips/emma2rh/common/irq.c +++ b/arch/mips/emma2rh/common/irq.c @@ -39,7 +39,7 @@ /* * the first level int-handler will jump here if it is a emma2rh irq */ -asmlinkage void emma2rh_irq_dispatch(struct pt_regs *regs) +void emma2rh_irq_dispatch(void) { u32 intStatus; u32 bitmask; @@ -56,7 +56,7 @@ asmlinkage void emma2rh_irq_dispatch(struct pt_regs *regs) & emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { if (swIntStatus & bitmask) { - do_IRQ(EMMA2RH_SW_IRQ_BASE + i, regs); + do_IRQ(EMMA2RH_SW_IRQ_BASE + i); return; } } @@ -65,7 +65,7 @@ asmlinkage void emma2rh_irq_dispatch(struct pt_regs *regs) for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { if (intStatus & bitmask) { - do_IRQ(EMMA2RH_IRQ_BASE + i, regs); + do_IRQ(EMMA2RH_IRQ_BASE + i); return; } } @@ -81,7 +81,7 @@ asmlinkage void emma2rh_irq_dispatch(struct pt_regs *regs) & emma2rh_in32(EMMA2RH_GPIO_INT_MASK); for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { if (gpioIntStatus & bitmask) { - do_IRQ(EMMA2RH_GPIO_IRQ_BASE + i, regs); + do_IRQ(EMMA2RH_GPIO_IRQ_BASE + i); return; } } @@ -90,7 +90,7 @@ asmlinkage void emma2rh_irq_dispatch(struct pt_regs *regs) for (i = 32, bitmask = 1; i < 64; i++, bitmask <<= 1) { if (intStatus & bitmask) { - do_IRQ(EMMA2RH_IRQ_BASE + i, regs); + do_IRQ(EMMA2RH_IRQ_BASE + i); return; } } @@ -100,7 +100,7 @@ asmlinkage void emma2rh_irq_dispatch(struct pt_regs *regs) for (i = 64, bitmask = 1; i < 96; i++, bitmask <<= 1) { if (intStatus & bitmask) { - do_IRQ(EMMA2RH_IRQ_BASE + i, regs); + do_IRQ(EMMA2RH_IRQ_BASE + i); return; } } diff --git a/arch/mips/emma2rh/markeins/irq.c b/arch/mips/emma2rh/markeins/irq.c index 2a736be42c8c..c93369cb4115 100644 --- a/arch/mips/emma2rh/markeins/irq.c +++ b/arch/mips/emma2rh/markeins/irq.c @@ -57,7 +57,7 @@ extern void emma2rh_sw_irq_init(u32 base); extern void emma2rh_gpio_irq_init(u32 base); extern void emma2rh_irq_init(u32 base); -extern asmlinkage void emma2rh_irq_dispatch(struct pt_regs *regs); +extern void emma2rh_irq_dispatch(void); static struct irqaction irq_cascade = { .handler = no_action, @@ -114,20 +114,20 @@ void __init arch_init_irq(void) setup_irq(CPU_IRQ_BASE + CPU_EMMA2RH_CASCADE, &irq_cascade); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & STATUSF_IP7) - do_IRQ(CPU_IRQ_BASE + 7, regs); + do_IRQ(CPU_IRQ_BASE + 7); else if (pending & STATUSF_IP2) - emma2rh_irq_dispatch(regs); + emma2rh_irq_dispatch(); else if (pending & STATUSF_IP1) - do_IRQ(CPU_IRQ_BASE + 1, regs); + do_IRQ(CPU_IRQ_BASE + 1); else if (pending & STATUSF_IP0) - do_IRQ(CPU_IRQ_BASE + 0, regs); + do_IRQ(CPU_IRQ_BASE + 0); else - spurious_interrupt(regs); + spurious_interrupt(); } diff --git a/arch/mips/gt64120/common/time.c b/arch/mips/gt64120/common/time.c index 7feca49350d1..b203169f19ce 100644 --- a/arch/mips/gt64120/common/time.c +++ b/arch/mips/gt64120/common/time.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -19,7 +20,7 @@ * differently than other MIPS interrupts. */ -static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs) +static void gt64120_irq(int irq, void *dev_id) { unsigned int irq_src, int_high_src, irq_src_mask, int_high_src_mask; int handled = 0; @@ -36,7 +37,7 @@ static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs) irq_src &= ~0x00000800; do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif } diff --git a/arch/mips/gt64120/ev64120/irq.c b/arch/mips/gt64120/ev64120/irq.c index 5d939ac58f3f..ed4d82b9a24a 100644 --- a/arch/mips/gt64120/ev64120/irq.c +++ b/arch/mips/gt64120/ev64120/irq.c @@ -46,22 +46,22 @@ #include #include -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & STATUSF_IP4) /* int2 hardware line (timer) */ - do_IRQ(4, regs); + do_IRQ(4); else if (pending & STATUSF_IP2) /* int0 hardware line */ - do_IRQ(GT_INTA, regs); + do_IRQ(GT_INTA); else if (pending & STATUSF_IP5) /* int3 hardware line */ - do_IRQ(GT_INTD, regs); + do_IRQ(GT_INTD); else if (pending & STATUSF_IP6) /* int4 hardware line */ - do_IRQ(6, regs); + do_IRQ(6); else if (pending & STATUSF_IP7) /* compare int */ - do_IRQ(7, regs); + do_IRQ(7); else - spurious_interrupt(regs); + spurious_interrupt(); } static void disable_ev64120_irq(unsigned int irq_nr) diff --git a/arch/mips/gt64120/momenco_ocelot/irq.c b/arch/mips/gt64120/momenco_ocelot/irq.c index 885f67f32ea3..d9294401ccb0 100644 --- a/arch/mips/gt64120/momenco_ocelot/irq.c +++ b/arch/mips/gt64120/momenco_ocelot/irq.c @@ -48,22 +48,22 @@ #include #include -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & STATUSF_IP2) /* int0 hardware line */ - do_IRQ(2, regs); + do_IRQ(2); else if (pending & STATUSF_IP3) /* int1 hardware line */ - do_IRQ(3, regs); + do_IRQ(3); else if (pending & STATUSF_IP4) /* int2 hardware line */ - do_IRQ(4, regs); + do_IRQ(4); else if (pending & STATUSF_IP5) /* int3 hardware line */ - do_IRQ(5, regs); + do_IRQ(5); else if (pending & STATUSF_IP6) /* int4 hardware line */ - do_IRQ(6, regs); + do_IRQ(6); else if (pending & STATUSF_IP7) /* cpu timer */ - do_IRQ(7, regs); + do_IRQ(7); else { /* * Now look at the extended interrupts @@ -71,13 +71,13 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16; if (pending & STATUSF_IP8) /* int6 hardware line */ - do_IRQ(8, regs); + do_IRQ(8); else if (pending & STATUSF_IP9) /* int7 hardware line */ - do_IRQ(9, regs); + do_IRQ(9); else if (pending & STATUSF_IP10) /* int8 hardware line */ - do_IRQ(10, regs); + do_IRQ(10); else if (pending & STATUSF_IP11) /* int9 hardware line */ - do_IRQ(11, regs); + do_IRQ(11); } } diff --git a/arch/mips/gt64120/wrppmc/irq.c b/arch/mips/gt64120/wrppmc/irq.c index 8d75a43ce877..eedfc24e1eae 100644 --- a/arch/mips/gt64120/wrppmc/irq.c +++ b/arch/mips/gt64120/wrppmc/irq.c @@ -30,18 +30,18 @@ #include #include -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & STATUSF_IP7) - do_IRQ(WRPPMC_MIPS_TIMER_IRQ, regs); /* CPU Compare/Count internal timer */ + do_IRQ(WRPPMC_MIPS_TIMER_IRQ); /* CPU Compare/Count internal timer */ else if (pending & STATUSF_IP6) - do_IRQ(WRPPMC_UART16550_IRQ, regs); /* UART 16550 port */ + do_IRQ(WRPPMC_UART16550_IRQ); /* UART 16550 port */ else if (pending & STATUSF_IP3) - do_IRQ(WRPPMC_PCI_INTA_IRQ, regs); /* PCI INT_A */ + do_IRQ(WRPPMC_PCI_INTA_IRQ); /* PCI INT_A */ else - spurious_interrupt(regs); + spurious_interrupt(); } /** diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c index eef05093deb4..d5bd6b3a0933 100644 --- a/arch/mips/jazz/irq.c +++ b/arch/mips/jazz/irq.c @@ -94,26 +94,26 @@ void __init arch_init_irq(void) change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1); } -static void loc_call(unsigned int irq, struct pt_regs *regs, unsigned int mask) +static void loc_call(unsigned int irq, unsigned int mask) { r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) & mask); - do_IRQ(irq, regs); + do_IRQ(irq); r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) | mask); } -static void ll_local_dev(struct pt_regs *regs) +static void ll_local_dev(void) { switch (r4030_read_reg32(JAZZ_IO_IRQ_SOURCE)) { case 0: panic("Unimplemented loc_no_irq handler"); break; case 4: - loc_call(JAZZ_PARALLEL_IRQ, regs, JAZZ_IE_PARALLEL); + loc_call(JAZZ_PARALLEL_IRQ, JAZZ_IE_PARALLEL); break; case 8: - loc_call(JAZZ_PARALLEL_IRQ, regs, JAZZ_IE_FLOPPY); + loc_call(JAZZ_PARALLEL_IRQ, JAZZ_IE_FLOPPY); break; case 12: panic("Unimplemented loc_sound handler"); @@ -122,27 +122,27 @@ static void ll_local_dev(struct pt_regs *regs) panic("Unimplemented loc_video handler"); break; case 20: - loc_call(JAZZ_ETHERNET_IRQ, regs, JAZZ_IE_ETHERNET); + loc_call(JAZZ_ETHERNET_IRQ, JAZZ_IE_ETHERNET); break; case 24: - loc_call(JAZZ_SCSI_IRQ, regs, JAZZ_IE_SCSI); + loc_call(JAZZ_SCSI_IRQ, JAZZ_IE_SCSI); break; case 28: - loc_call(JAZZ_KEYBOARD_IRQ, regs, JAZZ_IE_KEYBOARD); + loc_call(JAZZ_KEYBOARD_IRQ, JAZZ_IE_KEYBOARD); break; case 32: - loc_call(JAZZ_MOUSE_IRQ, regs, JAZZ_IE_MOUSE); + loc_call(JAZZ_MOUSE_IRQ, JAZZ_IE_MOUSE); break; case 36: - loc_call(JAZZ_SERIAL1_IRQ, regs, JAZZ_IE_SERIAL1); + loc_call(JAZZ_SERIAL1_IRQ, JAZZ_IE_SERIAL1); break; case 40: - loc_call(JAZZ_SERIAL2_IRQ, regs, JAZZ_IE_SERIAL2); + loc_call(JAZZ_SERIAL2_IRQ, JAZZ_IE_SERIAL2); break; } } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; @@ -150,13 +150,13 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) write_c0_compare(0); else if (pending & IE_IRQ4) { r4030_read_reg32(JAZZ_TIMER_REGISTER); - do_IRQ(JAZZ_TIMER_IRQ, regs); + do_IRQ(JAZZ_TIMER_IRQ); } else if (pending & IE_IRQ3) panic("Unimplemented ISA NMI handler"); else if (pending & IE_IRQ2) - do_IRQ(r4030_read_reg32(JAZZ_EISA_IRQ_ACK), regs); + do_IRQ(r4030_read_reg32(JAZZ_EISA_IRQ_ACK)); else if (pending & IE_IRQ1) { - ll_local_dev(regs); + ll_local_dev(); } else if (unlikely(pending & IE_IRQ0)) panic("Unimplemented local_dma handler"); else if (pending & IE_SW1) { diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c index 722174481467..39a0243bed9a 100644 --- a/arch/mips/jmr3927/rbhma3100/irq.c +++ b/arch/mips/jmr3927/rbhma3100/irq.c @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -239,45 +240,80 @@ struct tb_irq_space jmr3927_ioc_irqspace = { .space_id = 0, can_share : 1 }; + struct tb_irq_space jmr3927_irc_irqspace = { - .next = NULL, - .start_irqno = JMR3927_IRQ_IRC, - nr_irqs : JMR3927_NR_IRQ_IRC, - .mask_func = mask_irq_irc, - .unmask_func = unmask_irq_irc, - .name = "on-chip", - .space_id = 0, - can_share : 0 + .next = NULL, + .start_irqno = JMR3927_IRQ_IRC, + .nr_irqs = JMR3927_NR_IRQ_IRC, + .mask_func = mask_irq_irc, + .unmask_func = unmask_irq_irc, + .name = "on-chip", + .space_id = 0, + .can_share = 0 }; -void jmr3927_spurious(struct pt_regs *regs) + +#ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND +static int tx_branch_likely_bug_count = 0; +static int have_tx_branch_likely_bug = 0; + +static void tx_branch_likely_bug_fixup(void) +{ + struct pt_regs *regs = get_irq_regs(); + + /* TX39/49-BUG: Under this condition, the insn in delay slot + of the branch likely insn is executed (not nullified) even + the branch condition is false. */ + if (!have_tx_branch_likely_bug) + return; + if ((regs->cp0_epc & 0xfff) == 0xffc && + KSEGX(regs->cp0_epc) != KSEG0 && + KSEGX(regs->cp0_epc) != KSEG1) { + unsigned int insn = *(unsigned int*)(regs->cp0_epc - 4); + /* beql,bnel,blezl,bgtzl */ + /* bltzl,bgezl,blezall,bgezall */ + /* bczfl, bcztl */ + if ((insn & 0xf0000000) == 0x50000000 || + (insn & 0xfc0e0000) == 0x04020000 || + (insn & 0xf3fe0000) == 0x41020000) { + regs->cp0_epc -= 4; + tx_branch_likely_bug_count++; + printk(KERN_INFO + "fix branch-likery bug in %s (insn %08x)\n", + current->comm, insn); + } + } +} +#endif + +static void jmr3927_spurious(void) { #ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND - tx_branch_likely_bug_fixup(regs); + tx_branch_likely_bug_fixup(); #endif printk(KERN_WARNING "spurious interrupt (cause 0x%lx, pc 0x%lx, ra 0x%lx).\n", regs->cp0_cause, regs->cp0_epc, regs->regs[31]); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { int irq; #ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND - tx_branch_likely_bug_fixup(regs); + tx_branch_likely_bug_fixup(); #endif if ((regs->cp0_cause & CAUSEF_IP7) == 0) { #if 0 - jmr3927_spurious(regs); + jmr3927_spurious(); #endif return; } irq = (regs->cp0_cause >> CAUSEB_IP2) & 0x0f; - do_IRQ(irq + JMR3927_IRQ_IRC, regs); + do_IRQ(irq + JMR3927_IRQ_IRC); } -static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id) { unsigned char istat = jmr3927_ioc_reg_in(JMR3927_IOC_INTS2_ADDR); int i; @@ -285,7 +321,7 @@ static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs * for (i = 0; i < JMR3927_NR_IRQ_IOC; i++) { if (istat & (1 << i)) { irq = JMR3927_IRQ_IOC + i; - do_IRQ(irq, regs); + do_IRQ(irq); } } return IRQ_HANDLED; @@ -295,7 +331,7 @@ static struct irqaction ioc_action = { jmr3927_ioc_interrupt, 0, CPU_MASK_NONE, "IOC", NULL, NULL, }; -static irqreturn_t jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t jmr3927_isac_interrupt(int irq, void *dev_id) { unsigned char istat = jmr3927_isac_reg_in(JMR3927_ISAC_INTS2_ADDR); int i; @@ -303,7 +339,7 @@ static irqreturn_t jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs for (i = 0; i < JMR3927_NR_IRQ_ISAC; i++) { if (istat & (1 << i)) { irq = JMR3927_IRQ_ISAC + i; - do_IRQ(irq, regs); + do_IRQ(irq); } } return IRQ_HANDLED; @@ -314,7 +350,7 @@ static struct irqaction isac_action = { }; -static irqreturn_t jmr3927_isaerr_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t jmr3927_isaerr_interrupt(int irq, void *dev_id) { printk(KERN_WARNING "ISA error interrupt (irq 0x%x).\n", irq); @@ -324,7 +360,7 @@ static struct irqaction isaerr_action = { jmr3927_isaerr_interrupt, 0, CPU_MASK_NONE, "ISA error", NULL, NULL, }; -static irqreturn_t jmr3927_pcierr_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id) { printk(KERN_WARNING "PCI error interrupt (irq 0x%x).\n", irq); printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n", @@ -439,33 +475,3 @@ void jmr3927_irq_init(u32 irq_base) jmr3927_irq_base = irq_base; } - -#ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND -static int tx_branch_likely_bug_count = 0; -static int have_tx_branch_likely_bug = 0; -void tx_branch_likely_bug_fixup(struct pt_regs *regs) -{ - /* TX39/49-BUG: Under this condition, the insn in delay slot - of the branch likely insn is executed (not nullified) even - the branch condition is false. */ - if (!have_tx_branch_likely_bug) - return; - if ((regs->cp0_epc & 0xfff) == 0xffc && - KSEGX(regs->cp0_epc) != KSEG0 && - KSEGX(regs->cp0_epc) != KSEG1) { - unsigned int insn = *(unsigned int*)(regs->cp0_epc - 4); - /* beql,bnel,blezl,bgtzl */ - /* bltzl,bgezl,blezall,bgezall */ - /* bczfl, bcztl */ - if ((insn & 0xf0000000) == 0x50000000 || - (insn & 0xfc0e0000) == 0x04020000 || - (insn & 0xf3fe0000) == 0x41020000) { - regs->cp0_epc -= 4; - tx_branch_likely_bug_count++; - printk(KERN_INFO - "fix branch-likery bug in %s (insn %08x)\n", - current->comm, insn); - } - } -} -#endif diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index ec28077d5ee2..e9ce5b3721af 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c @@ -93,11 +93,12 @@ void output_thread_info_defines(void) offset("#define TI_TASK ", struct thread_info, task); offset("#define TI_EXEC_DOMAIN ", struct thread_info, exec_domain); offset("#define TI_FLAGS ", struct thread_info, flags); + offset("#define TI_TP_VALUE ", struct thread_info, tp_value); offset("#define TI_CPU ", struct thread_info, cpu); offset("#define TI_PRE_COUNT ", struct thread_info, preempt_count); offset("#define TI_ADDR_LIMIT ", struct thread_info, addr_limit); offset("#define TI_RESTART_BLOCK ", struct thread_info, restart_block); - offset("#define TI_TP_VALUE ", struct thread_info, tp_value); + offset("#define TI_REGS ", struct thread_info, regs); constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER); constant("#define _THREAD_SIZE ", THREAD_SIZE); constant("#define _THREAD_MASK ", THREAD_MASK); diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index 766655f35250..e93e43e1f42d 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S @@ -79,7 +79,6 @@ FEXPORT(syscall_exit) FEXPORT(restore_all) # restore full frame #ifdef CONFIG_MIPS_MT_SMTC /* Detect and execute deferred IPI "interrupts" */ - move a0,sp jal deferred_smtc_ipi /* Re-arm any temporarily masked interrupts not explicitly "acked" */ mfc0 v0, CP0_TCSTATUS diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index af6ef2fd8300..50ed77297728 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -131,9 +131,11 @@ NESTED(handle_int, PT_SIZE, sp) CLI TRACE_IRQS_OFF - PTR_LA ra, ret_from_irq - move a0, sp - j plat_irq_dispatch + LONG_L s0, TI_REGS($28) + LONG_S sp, TI_REGS($28) + jal plat_irq_dispatch + LONG_S s0, TI_REGS($28) + j ret_from_irq END(handle_int) __INIT @@ -219,9 +221,12 @@ NESTED(except_vec_vi_handler, 0, sp) #endif /* CONFIG_MIPS_MT_SMTC */ CLI TRACE_IRQS_OFF - move a0, sp + + LONG_L s0, TI_REGS($28) + LONG_S sp, TI_REGS($28) + jalr v0 + LONG_S s0, TI_REGS($28) PTR_LA ra, ret_from_irq - jr v0 END(except_vec_vi_handler) /* diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c index 63dfeb41796b..71e8e45f3687 100644 --- a/arch/mips/kernel/irq-msc01.c +++ b/arch/mips/kernel/irq-msc01.c @@ -115,14 +115,14 @@ static void end_msc_irq(unsigned int irq) /* * Interrupt handler for interrupts coming from SOC-it. */ -void ll_msc_irq(struct pt_regs *regs) +void ll_msc_irq(void) { unsigned int irq; /* read the interrupt vector register */ MSCIC_READ(MSC01_IC_VEC, irq); if (irq < 64) - do_IRQ(irq + irq_base, regs); + do_IRQ(irq + irq_base); else { /* Ignore spurious interrupt */ } diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c index b117e64da64d..39c94fd8d8ba 100644 --- a/arch/mips/kernel/irq-mv6434x.c +++ b/arch/mips/kernel/irq-mv6434x.c @@ -113,7 +113,7 @@ static void end_mv64340_irq(unsigned int irq) * Interrupt handler for interrupts coming from the Marvell chip. * It could be built in ethernet ports etc... */ -void ll_mv64340_irq(struct pt_regs *regs) +void ll_mv64340_irq(void) { unsigned int irq_src_low, irq_src_high; unsigned int irq_mask_low, irq_mask_high; @@ -129,9 +129,9 @@ void ll_mv64340_irq(struct pt_regs *regs) irq_src_high &= irq_mask_high; if (irq_src_low) - do_IRQ(ls1bit32(irq_src_low) + irq_base, regs); + do_IRQ(ls1bit32(irq_src_low) + irq_base); else - do_IRQ(ls1bit32(irq_src_high) + irq_base + 32, regs); + do_IRQ(ls1bit32(irq_src_high) + irq_base + 32); } #define shutdown_mv64340_irq disable_mv64340_irq diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index a00b0e7ab9b1..dd24434392b6 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -53,9 +53,8 @@ unsigned long irq_hwmask[NR_IRQS]; * SMP cross-CPU interrupts have their own specific * handlers). */ -asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs) +asmlinkage unsigned int do_IRQ(unsigned int irq) { - struct pt_regs *old_regs = set_irq_regs(regs); irq_enter(); __DO_IRQ_SMTC_HOOK(); @@ -63,7 +62,6 @@ asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs) irq_exit(); - set_irq_regs(old_regs); return 1; } @@ -112,7 +110,7 @@ skip: return 0; } -asmlinkage void spurious_interrupt(struct pt_regs *regs) +asmlinkage void spurious_interrupt(void) { atomic_inc(&irq_err_count); } diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index cdab1b2cd134..8c8c8324f775 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c @@ -61,16 +61,16 @@ static int sp_stopping = 0; extern void *vpe_get_shared(int index); -static void rtlx_dispatch(struct pt_regs *regs) +static void rtlx_dispatch(void) { - do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ, regs); + do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ); } /* Interrupt handler may be called before rtlx_init has otherwise had a chance to run. */ -static irqreturn_t rtlx_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t rtlx_interrupt(int irq, void *dev_id) { int i; diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c index 766253c44f3f..3b5f3b632622 100644 --- a/arch/mips/kernel/smp-mt.c +++ b/arch/mips/kernel/smp-mt.c @@ -106,22 +106,22 @@ void __init sanitize_tlb_entries(void) clear_c0_mvpcontrol(MVPCONTROL_VPC); } -static void ipi_resched_dispatch (struct pt_regs *regs) +static void ipi_resched_dispatch(void) { - do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ, regs); + do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ); } -static void ipi_call_dispatch (struct pt_regs *regs) +static void ipi_call_dispatch(void) { - do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ, regs); + do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ); } -irqreturn_t ipi_resched_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) { return IRQ_HANDLED; } -irqreturn_t ipi_call_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ipi_call_interrupt(int irq, void *dev_id) { smp_call_function_interrupt(); @@ -250,8 +250,8 @@ void __init plat_prepare_cpus(unsigned int max_cpus) { /* set up ipi interrupts */ if (cpu_has_vint) { - set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch); - set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch); + set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch); + set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch); } cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ; diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 604bcc5cb7c8..cc1f7474f7d7 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c @@ -82,7 +82,7 @@ struct smtc_ipi_q freeIPIq; /* Forward declarations */ -void ipi_decode(struct pt_regs *, struct smtc_ipi *); +void ipi_decode(struct smtc_ipi *); void post_direct_ipi(int cpu, struct smtc_ipi *pipi); void setup_cross_vpe_interrupts(void); void init_smtc_stats(void); @@ -820,19 +820,19 @@ void post_direct_ipi(int cpu, struct smtc_ipi *pipi) write_tc_c0_tcrestart(__smtc_ipi_vector); } -void ipi_resched_interrupt(struct pt_regs *regs) +static void ipi_resched_interrupt(void) { /* Return from interrupt should be enough to cause scheduler check */ } -void ipi_call_interrupt(struct pt_regs *regs) +static void ipi_call_interrupt(void) { /* Invoke generic function invocation code in smp.c */ smp_call_function_interrupt(); } -void ipi_decode(struct pt_regs *regs, struct smtc_ipi *pipi) +void ipi_decode(struct smtc_ipi *pipi) { void *arg_copy = pipi->arg; int type_copy = pipi->type; @@ -846,15 +846,15 @@ void ipi_decode(struct pt_regs *regs, struct smtc_ipi *pipi) #ifdef SMTC_IDLE_HOOK_DEBUG clock_hang_reported[dest_copy] = 0; #endif /* SMTC_IDLE_HOOK_DEBUG */ - local_timer_interrupt(0, NULL, regs); + local_timer_interrupt(0, NULL); break; case LINUX_SMP_IPI: switch ((int)arg_copy) { case SMP_RESCHEDULE_YOURSELF: - ipi_resched_interrupt(regs); + ipi_resched_interrupt(); break; case SMP_CALL_FUNCTION: - ipi_call_interrupt(regs); + ipi_call_interrupt(); break; default: printk("Impossible SMTC IPI Argument 0x%x\n", @@ -868,7 +868,7 @@ void ipi_decode(struct pt_regs *regs, struct smtc_ipi *pipi) } } -void deferred_smtc_ipi(struct pt_regs *regs) +void deferred_smtc_ipi(void) { struct smtc_ipi *pipi; unsigned long flags; @@ -883,7 +883,7 @@ void deferred_smtc_ipi(struct pt_regs *regs) while((pipi = smtc_ipi_dq(&IPIQ[q])) != NULL) { /* ipi_decode() should be called with interrupts off */ local_irq_save(flags); - ipi_decode(regs, pipi); + ipi_decode(pipi); local_irq_restore(flags); } } @@ -917,7 +917,7 @@ void smtc_timer_broadcast(int vpe) static int cpu_ipi_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_IRQ; -static irqreturn_t ipi_interrupt(int irq, void *dev_idm, struct pt_regs *regs) +static irqreturn_t ipi_interrupt(int irq, void *dev_idm) { int my_vpe = cpu_data[smp_processor_id()].vpe_id; int my_tc = cpu_data[smp_processor_id()].tc_id; @@ -978,7 +978,7 @@ static irqreturn_t ipi_interrupt(int irq, void *dev_idm, struct pt_regs *regs) * with interrupts off */ local_irq_save(flags); - ipi_decode(regs, pipi); + ipi_decode(pipi); local_irq_restore(flags); } } @@ -987,9 +987,9 @@ static irqreturn_t ipi_interrupt(int irq, void *dev_idm, struct pt_regs *regs) return IRQ_HANDLED; } -static void ipi_irq_dispatch(struct pt_regs *regs) +static void ipi_irq_dispatch(void) { - do_IRQ(cpu_ipi_irq, regs); + do_IRQ(cpu_ipi_irq); } static struct irqaction irq_ipi; diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index d349eb9e4ffb..debe86c2f691 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -324,8 +324,7 @@ static long last_rtc_update; */ void local_timer_interrupt(int irq, void *dev_id) { - if (current->pid) - profile_tick(CPU_PROFILING); + profile_tick(CPU_PROFILING); update_process_times(user_mode(get_irq_regs())); } @@ -434,9 +433,8 @@ int (*perf_irq)(void) = null_perf_irq; EXPORT_SYMBOL(null_perf_irq); EXPORT_SYMBOL(perf_irq); -asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs) +asmlinkage void ll_timer_interrupt(int irq) { - struct pt_regs *old_regs = set_irq_regs(regs); int r2 = cpu_has_mips_r2; irq_enter(); @@ -458,12 +456,10 @@ asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs) out: irq_exit(); - set_irq_regs(old_regs); } -asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs) +asmlinkage void ll_local_timer_interrupt(int irq) { - struct pt_regs *old_regs = set_irq_regs(regs); irq_enter(); if (smp_processor_id() != 0) kstat_this_cpu.irqs[irq]++; @@ -472,7 +468,6 @@ asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs) local_timer_interrupt(irq, NULL); irq_exit(); - set_irq_regs(old_regs); } /* diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c index 456be8fc961a..a144a002dcc4 100644 --- a/arch/mips/lasat/interrupt.c +++ b/arch/mips/lasat/interrupt.c @@ -108,14 +108,14 @@ static unsigned long get_int_status_200(void) return int_status; } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned long int_status; unsigned int cause = read_c0_cause(); int irq; if (cause & CAUSEF_IP7) { /* R4000 count / compare IRQ */ - ll_timer_interrupt(7, regs); + ll_timer_interrupt(7); return; } @@ -125,7 +125,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) if (int_status) { irq = ls1bit32(int_status); - do_IRQ(irq, regs); + do_IRQ(irq); } } diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c index a020a3cb4f4b..be624b8c3b0e 100644 --- a/arch/mips/mips-boards/atlas/atlas_int.c +++ b/arch/mips/mips-boards/atlas/atlas_int.c @@ -101,7 +101,7 @@ static inline int ls1bit32(unsigned int x) return b; } -static inline void atlas_hw0_irqdispatch(struct pt_regs *regs) +static inline void atlas_hw0_irqdispatch(void) { unsigned long int_status; int irq; @@ -116,7 +116,7 @@ static inline void atlas_hw0_irqdispatch(struct pt_regs *regs) DEBUG_INT("atlas_hw0_irqdispatch: irq=%d\n", irq); - do_IRQ(irq, regs); + do_IRQ(irq); } static inline int clz(unsigned long x) @@ -188,7 +188,7 @@ static inline unsigned int irq_ffs(unsigned int pending) * then we just return, if multiple IRQs are pending then we will just take * another exception, big deal. */ -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; int irq; @@ -196,11 +196,11 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) irq = irq_ffs(pending); if (irq == MIPSCPU_INT_ATLAS) - atlas_hw0_irqdispatch(regs); + atlas_hw0_irqdispatch(); else if (irq >= 0) - do_IRQ(MIPSCPU_INT_BASE + irq, regs); + do_IRQ(MIPSCPU_INT_BASE + irq); else - spurious_interrupt(regs); + spurious_interrupt(); } static inline void init_atlas_irqs (int base) diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c index 8d15861fce61..d379000162f3 100644 --- a/arch/mips/mips-boards/generic/time.c +++ b/arch/mips/mips-boards/generic/time.c @@ -82,19 +82,19 @@ static inline void scroll_display_message(void) } } -static void mips_timer_dispatch (struct pt_regs *regs) +static void mips_timer_dispatch(void) { - do_IRQ (mips_cpu_timer_irq, regs); + do_IRQ(mips_cpu_timer_irq); } /* * Redeclare until I get around mopping the timer code insanity on MIPS. */ -extern int null_perf_irq(struct pt_regs *regs); +extern int null_perf_irq(void); -extern int (*perf_irq)(struct pt_regs *regs); +extern int (*perf_irq)(void); -irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t mips_timer_interrupt(int irq, void *dev_id) { int cpu = smp_processor_id(); @@ -119,7 +119,7 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * perf counter overflow, or both. */ if (read_c0_cause() & (1 << 26)) - perf_irq(regs); + perf_irq(); if (read_c0_cause() & (1 << 30)) { /* If timer interrupt, make it de-assert */ @@ -139,13 +139,13 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * the tick on VPE 0 to run the full timer_interrupt(). */ if (cpu_data[cpu].vpe_id == 0) { - timer_interrupt(irq, NULL, regs); + timer_interrupt(irq, NULL); smtc_timer_broadcast(cpu_data[cpu].vpe_id); scroll_display_message(); } else { write_c0_compare(read_c0_count() + (mips_hpt_frequency/HZ)); - local_timer_interrupt(irq, dev_id, regs); + local_timer_interrupt(irq, dev_id); smtc_timer_broadcast(cpu_data[cpu].vpe_id); } } @@ -159,12 +159,12 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * timer int. */ if (!r2 || (read_c0_cause() & (1 << 26))) - if (perf_irq(regs)) + if (perf_irq()) goto out; /* we keep interrupt disabled all the time */ if (!r2 || (read_c0_cause() & (1 << 30))) - timer_interrupt(irq, NULL, regs); + timer_interrupt(irq, NULL); scroll_display_message(); } else { @@ -180,7 +180,7 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* * Other CPUs should do profiling and process accounting */ - local_timer_interrupt(irq, dev_id, regs); + local_timer_interrupt(irq, dev_id); } out: #endif /* CONFIG_MIPS_MT_SMTC */ diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c index 7cc0ba4f553a..ed221dc7f6ac 100644 --- a/arch/mips/mips-boards/malta/malta_int.c +++ b/arch/mips/mips-boards/malta/malta_int.c @@ -114,7 +114,7 @@ static inline int get_int(void) return irq; } -static void malta_hw0_irqdispatch(struct pt_regs *regs) +static void malta_hw0_irqdispatch(void) { int irq; @@ -123,17 +123,21 @@ static void malta_hw0_irqdispatch(struct pt_regs *regs) return; /* interrupt has already been cleared */ } - do_IRQ(MALTA_INT_BASE+irq, regs); + do_IRQ(MALTA_INT_BASE + irq); } -void corehi_irqdispatch(struct pt_regs *regs) +static void corehi_irqdispatch(void) { + unsigned int intedge, intsteer, pcicmd, pcibadaddr; + unsigned int pcimstat, intisr, inten, intpol; unsigned int intrcause,datalo,datahi; - unsigned int pcimstat, intisr, inten, intpol, intedge, intsteer, pcicmd, pcibadaddr; + struct pt_regs *regs; printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n"); - printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\nbadVaddr : %08lx\n" -, regs->cp0_epc, regs->cp0_status, regs->cp0_cause, regs->cp0_badvaddr); + printk("epc : %08lx\nStatus: %08lx\n" + "Cause : %08lx\nbadVaddr : %08lx\n", + regs->cp0_epc, regs->cp0_status, + regs->cp0_cause, regs->cp0_badvaddr); /* Read all the registers and then print them as there is a problem with interspersed printk's upsetting the Bonito controller. @@ -146,7 +150,7 @@ void corehi_irqdispatch(struct pt_regs *regs) case MIPS_REVISION_CORID_CORE_FPGA3: case MIPS_REVISION_CORID_CORE_24K: case MIPS_REVISION_CORID_CORE_EMUL_MSC: - ll_msc_irq(regs); + ll_msc_irq(); break; case MIPS_REVISION_CORID_QED_RM5261: case MIPS_REVISION_CORID_CORE_LV: @@ -255,7 +259,7 @@ static inline unsigned int irq_ffs(unsigned int pending) * another exception, big deal. */ -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; int irq; @@ -263,11 +267,11 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) irq = irq_ffs(pending); if (irq == MIPSCPU_INT_I8259A) - malta_hw0_irqdispatch(regs); + malta_hw0_irqdispatch(); else if (irq > 0) - do_IRQ(MIPSCPU_INT_BASE + irq, regs); + do_IRQ(MIPSCPU_INT_BASE + irq); else - spurious_interrupt(regs); + spurious_interrupt(); } static struct irqaction i8259irq = { diff --git a/arch/mips/mips-boards/sead/sead_int.c b/arch/mips/mips-boards/sead/sead_int.c index 9168d934c661..f445fcddfdfd 100644 --- a/arch/mips/mips-boards/sead/sead_int.c +++ b/arch/mips/mips-boards/sead/sead_int.c @@ -98,7 +98,7 @@ static inline unsigned int irq_ffs(unsigned int pending) * then we just return, if multiple IRQs are pending then we will just take * another exception, big deal. */ -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; int irq; @@ -106,7 +106,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) irq = irq_ffs(pending); if (irq >= 0) - do_IRQ(MIPSCPU_INT_BASE + irq, regs); + do_IRQ(MIPSCPU_INT_BASE + irq); else spurious_interrupt(regs); } diff --git a/arch/mips/mips-boards/sim/sim_int.c b/arch/mips/mips-boards/sim/sim_int.c index 2c15c8efec4e..2ce449dce6f2 100644 --- a/arch/mips/mips-boards/sim/sim_int.c +++ b/arch/mips/mips-boards/sim/sim_int.c @@ -71,12 +71,7 @@ static inline unsigned int irq_ffs(unsigned int pending) #endif } -static inline void sim_hw0_irqdispatch(struct pt_regs *regs) -{ - do_IRQ(2, regs); -} - -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; int irq; @@ -84,9 +79,9 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) irq = irq_ffs(pending); if (irq > 0) - do_IRQ(MIPSCPU_INT_BASE + irq, regs); + do_IRQ(MIPSCPU_INT_BASE + irq); else - spurious_interrupt(regs); + spurious_interrupt(); } void __init arch_init_irq(void) diff --git a/arch/mips/mips-boards/sim/sim_time.c b/arch/mips/mips-boards/sim/sim_time.c index 230929ecd57f..acd83a379559 100644 --- a/arch/mips/mips-boards/sim/sim_time.c +++ b/arch/mips/mips-boards/sim/sim_time.c @@ -33,7 +33,7 @@ unsigned long cpu_khz; -irqreturn_t sim_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t sim_timer_interrupt(int irq, void *dev_id) { #ifdef CONFIG_SMP int cpu = smp_processor_id(); @@ -44,7 +44,7 @@ irqreturn_t sim_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) */ #ifndef CONFIG_MIPS_MT_SMTC if (cpu == 0) { - timer_interrupt(irq, dev_id, regs); + timer_interrupt(irq, dev_id); } else { /* Everyone else needs to reset the timer int here as @@ -84,7 +84,7 @@ irqreturn_t sim_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) irq_enable_hazard(); evpe(vpflags); - if(cpu_data[cpu].vpe_id == 0) timer_interrupt(irq, dev_id, regs); + if(cpu_data[cpu].vpe_id == 0) timer_interrupt(irq, dev_id); else write_c0_compare (read_c0_count() + ( mips_hpt_frequency/HZ)); smtc_timer_broadcast(cpu_data[cpu].vpe_id); @@ -93,10 +93,10 @@ irqreturn_t sim_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* * every CPU should do profiling and process accounting */ - local_timer_interrupt (irq, dev_id, regs); + local_timer_interrupt (irq, dev_id); return IRQ_HANDLED; #else - return timer_interrupt (irq, dev_id, regs); + return timer_interrupt (irq, dev_id); #endif } @@ -177,9 +177,9 @@ void __init sim_time_init(void) static int mips_cpu_timer_irq; -static void mips_timer_dispatch (struct pt_regs *regs) +static void mips_timer_dispatch(void) { - do_IRQ (mips_cpu_timer_irq, regs); + do_IRQ(mips_cpu_timer_irq); } diff --git a/arch/mips/momentum/jaguar_atx/irq.c b/arch/mips/momentum/jaguar_atx/irq.c index f9067469a656..2efb25aa1aed 100644 --- a/arch/mips/momentum/jaguar_atx/irq.c +++ b/arch/mips/momentum/jaguar_atx/irq.c @@ -40,33 +40,33 @@ #include #include -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status(); if (pending & STATUSF_IP0) - do_IRQ(0, regs); + do_IRQ(0); else if (pending & STATUSF_IP1) - do_IRQ(1, regs); + do_IRQ(1); else if (pending & STATUSF_IP2) - do_IRQ(2, regs); + do_IRQ(2); else if (pending & STATUSF_IP3) - do_IRQ(3, regs); + do_IRQ(3); else if (pending & STATUSF_IP4) - do_IRQ(4, regs); + do_IRQ(4); else if (pending & STATUSF_IP5) - do_IRQ(5, regs); + do_IRQ(5); else if (pending & STATUSF_IP6) - do_IRQ(6, regs); + do_IRQ(6); else if (pending & STATUSF_IP7) - ll_timer_interrupt(7, regs); + ll_timer_interrupt(7); else { /* * Now look at the extended interrupts */ pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16; if (pending & STATUSF_IP8) - ll_mv64340_irq(regs); + ll_mv64340_irq(); } } diff --git a/arch/mips/momentum/ocelot_3/irq.c b/arch/mips/momentum/ocelot_3/irq.c index 793782a9c195..cea0e5deb80e 100644 --- a/arch/mips/momentum/ocelot_3/irq.c +++ b/arch/mips/momentum/ocelot_3/irq.c @@ -75,26 +75,26 @@ void __init arch_init_irq(void) } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status(); if (pending & STATUSF_IP0) - do_IRQ(0, regs); + do_IRQ(0); else if (pending & STATUSF_IP1) - do_IRQ(1, regs); + do_IRQ(1); else if (pending & STATUSF_IP2) - do_IRQ(2, regs); + do_IRQ(2); else if (pending & STATUSF_IP3) - do_IRQ(3, regs); + do_IRQ(3); else if (pending & STATUSF_IP4) - do_IRQ(4, regs); + do_IRQ(4); else if (pending & STATUSF_IP5) - do_IRQ(5, regs); + do_IRQ(5); else if (pending & STATUSF_IP6) - do_IRQ(6, regs); + do_IRQ(6); else if (pending & STATUSF_IP7) - do_IRQ(7, regs); + do_IRQ(7); else { /* * Now look at the extended interrupts @@ -102,8 +102,8 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16; if (pending & STATUSF_IP8) - ll_mv64340_irq(regs); + ll_mv64340_irq(); else - spurious_interrupt(regs); + spurious_interrupt(); } } diff --git a/arch/mips/momentum/ocelot_c/cpci-irq.c b/arch/mips/momentum/ocelot_c/cpci-irq.c index a5dc230520df..2fb14bb08e67 100644 --- a/arch/mips/momentum/ocelot_c/cpci-irq.c +++ b/arch/mips/momentum/ocelot_c/cpci-irq.c @@ -112,7 +112,7 @@ static void end_cpci_irq(unsigned int irq) * Interrupt handler for interrupts coming from the FPGA chip. * It could be built in ethernet ports etc... */ -void ll_cpci_irq(struct pt_regs *regs) +void ll_cpci_irq(void) { unsigned int irq_src, irq_mask; @@ -123,7 +123,7 @@ void ll_cpci_irq(struct pt_regs *regs) /* mask for just the interrupts we want */ irq_src &= ~irq_mask; - do_IRQ(ls1bit8(irq_src) + CPCI_IRQ_BASE, regs); + do_IRQ(ls1bit8(irq_src) + CPCI_IRQ_BASE); } #define shutdown_cpci_irq disable_cpci_irq diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c index 9d44ae1e156b..4be7b26e30ef 100644 --- a/arch/mips/momentum/ocelot_c/irq.c +++ b/arch/mips/momentum/ocelot_c/irq.c @@ -59,31 +59,31 @@ static struct irqaction cascade_mv64340 = { no_action, IRQF_DISABLED, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL }; -extern void ll_uart_irq(struct pt_regs *regs); -extern void ll_cpci_irq(struct pt_regs *regs); +extern void ll_uart_irq(void); +extern void ll_cpci_irq(void); -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status(); if (pending & STATUSF_IP0) - do_IRQ(0, regs); + do_IRQ(0); else if (pending & STATUSF_IP1) - do_IRQ(1, regs); + do_IRQ(1); else if (pending & STATUSF_IP2) - do_IRQ(2, regs); + do_IRQ(2); else if (pending & STATUSF_IP3) - ll_uart_irq(regs); + ll_uart_irq(); else if (pending & STATUSF_IP4) - do_IRQ(4, regs); + do_IRQ(4); else if (pending & STATUSF_IP5) - ll_cpci_irq(regs); + ll_cpci_irq(); else if (pending & STATUSF_IP6) ll_mv64340_irq(regs); else if (pending & STATUSF_IP7) - do_IRQ(7, regs); + do_IRQ(7); else - spurious_interrupt(regs); + spurious_interrupt(); } void __init arch_init_irq(void) diff --git a/arch/mips/momentum/ocelot_c/uart-irq.c b/arch/mips/momentum/ocelot_c/uart-irq.c index 9f33d8f1d826..f8efe2370ffd 100644 --- a/arch/mips/momentum/ocelot_c/uart-irq.c +++ b/arch/mips/momentum/ocelot_c/uart-irq.c @@ -105,7 +105,7 @@ static void end_uart_irq(unsigned int irq) /* * Interrupt handler for interrupts coming from the FPGA chip. */ -void ll_uart_irq(struct pt_regs *regs) +void ll_uart_irq(void) { unsigned int irq_src, irq_mask; @@ -116,7 +116,7 @@ void ll_uart_irq(struct pt_regs *regs) /* mask for just the interrupts we want */ irq_src &= ~irq_mask; - do_IRQ(ls1bit8(irq_src) + 74, regs); + do_IRQ(ls1bit8(irq_src) + 74); } #define shutdown_uart_irq disable_uart_irq diff --git a/arch/mips/momentum/ocelot_g/gt-irq.c b/arch/mips/momentum/ocelot_g/gt-irq.c index 6cd87cf0195a..b8cffa80548f 100644 --- a/arch/mips/momentum/ocelot_g/gt-irq.c +++ b/arch/mips/momentum/ocelot_g/gt-irq.c @@ -108,7 +108,7 @@ int disable_galileo_irq(int int_cause, int bit_num) * we keep this particular structure in the function. */ -static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs) +static irqreturn_t gt64240_p0int_irq(int irq, void *dev) { uint32_t irq_src, irq_src_mask; int handled; @@ -135,7 +135,7 @@ static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs) /* handle the timer call */ do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif } diff --git a/arch/mips/momentum/ocelot_g/irq.c b/arch/mips/momentum/ocelot_g/irq.c index 7a4a419804f1..da46524e87cb 100644 --- a/arch/mips/momentum/ocelot_g/irq.c +++ b/arch/mips/momentum/ocelot_g/irq.c @@ -48,22 +48,22 @@ #include #include -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status(); if (pending & STATUSF_IP2) - do_IRQ(2, regs); + do_IRQ(2); else if (pending & STATUSF_IP3) - do_IRQ(3, regs); + do_IRQ(3); else if (pending & STATUSF_IP4) - do_IRQ(4, regs); + do_IRQ(4); else if (pending & STATUSF_IP5) - do_IRQ(5, regs); + do_IRQ(5); else if (pending & STATUSF_IP6) - do_IRQ(6, regs); + do_IRQ(6); else if (pending & STATUSF_IP7) - do_IRQ(7, regs); + do_IRQ(7); else { /* * Now look at the extended interrupts @@ -71,15 +71,15 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16; if (pending & STATUSF_IP8) - do_IRQ(8, regs); + do_IRQ(8); else if (pending & STATUSF_IP9) - do_IRQ(9, regs); + do_IRQ(9); else if (pending & STATUSF_IP10) - do_IRQ(10, regs); + do_IRQ(10); else if (pending & STATUSF_IP11) - do_IRQ(11, regs); + do_IRQ(11); else - spurious_interrupt(regs); + spurious_interrupt(); } } diff --git a/arch/mips/oprofile/op_impl.h b/arch/mips/oprofile/op_impl.h index 5cfce7d87a4d..354e54496406 100644 --- a/arch/mips/oprofile/op_impl.h +++ b/arch/mips/oprofile/op_impl.h @@ -12,8 +12,8 @@ struct pt_regs; -extern int null_perf_irq(struct pt_regs *regs); -extern int (*perf_irq)(struct pt_regs *regs); +extern int null_perf_irq(void); +extern int (*perf_irq)(void); /* Per-counter configuration as set via oprofilefs. */ struct op_counter_config { diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c index a175d673540f..dd0aec9c3ce1 100644 --- a/arch/mips/oprofile/op_model_mipsxx.c +++ b/arch/mips/oprofile/op_model_mipsxx.c @@ -3,12 +3,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2004, 2005 by Ralf Baechle + * Copyright (C) 2004, 05, 06 by Ralf Baechle * Copyright (C) 2005 by MIPS Technologies, Inc. */ #include #include #include +#include #include "op_impl.h" @@ -170,7 +171,7 @@ static void mipsxx_cpu_stop(void *args) } } -static int mipsxx_perfcount_handler(struct pt_regs *regs) +static int mipsxx_perfcount_handler(void) { unsigned int counters = op_model_mipsxx_ops.num_counters; unsigned int control; @@ -184,7 +185,7 @@ static int mipsxx_perfcount_handler(struct pt_regs *regs) counter = r_c0_perfcntr ## n(); \ if ((control & M_PERFCTL_INTERRUPT_ENABLE) && \ (counter & M_COUNTER_OVERFLOW)) { \ - oprofile_add_sample(regs, n); \ + oprofile_add_sample(get_irq_regs(), n); \ w_c0_perfcntr ## n(reg.counter[n]); \ handled = 1; \ } diff --git a/arch/mips/pci/pci-ip32.c b/arch/mips/pci/pci-ip32.c index 17c7932cf0ae..618ea7dbc474 100644 --- a/arch/mips/pci/pci-ip32.c +++ b/arch/mips/pci/pci-ip32.c @@ -22,7 +22,7 @@ * registered on the bridge error irq. It's conceivable that some of these * conditions warrant a panic. Anybody care to say which ones? */ -static irqreturn_t macepci_error(int irq, void *dev, struct pt_regs *regs) +static irqreturn_t macepci_error(int irq, void *dev) { char s; unsigned int flags = mace->pci.error; diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c index 3c93512be1ec..710611615ca2 100644 --- a/arch/mips/philips/pnx8550/common/int.c +++ b/arch/mips/philips/pnx8550/common/int.c @@ -23,6 +23,7 @@ * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * */ +#include #include #include #include @@ -52,7 +53,7 @@ static char gic_prio[PNX8550_INT_GIC_TOTINT] = { 1 // 70 }; -static void hw0_irqdispatch(int irq, struct pt_regs *regs) +static void hw0_irqdispatch(int irq) { /* find out which interrupt */ irq = PNX8550_GIC_VECTOR_0 >> 3; @@ -61,42 +62,39 @@ static void hw0_irqdispatch(int irq, struct pt_regs *regs) printk("hw0_irqdispatch: irq 0, spurious interrupt?\n"); return; } - do_IRQ(PNX8550_INT_GIC_MIN + irq, regs); + do_IRQ(PNX8550_INT_GIC_MIN + irq); } -static void timer_irqdispatch(int irq, struct pt_regs *regs) +static void timer_irqdispatch(int irq) { irq = (0x01c0 & read_c0_config7()) >> 6; - if (irq == 0) { + if (unlikely(irq == 0)) { printk("timer_irqdispatch: irq 0, spurious interrupt?\n"); return; } - if (irq & 0x1) { - do_IRQ(PNX8550_INT_TIMER1, regs); - } - if (irq & 0x2) { - do_IRQ(PNX8550_INT_TIMER2, regs); - } - if (irq & 0x4) { - do_IRQ(PNX8550_INT_TIMER3, regs); - } + if (irq & 0x1) + do_IRQ(PNX8550_INT_TIMER1); + if (irq & 0x2) + do_IRQ(PNX8550_INT_TIMER2); + if (irq & 0x4) + do_IRQ(PNX8550_INT_TIMER3); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & STATUSF_IP2) - hw0_irqdispatch(2, regs); + hw0_irqdispatch(2); else if (pending & STATUSF_IP7) { if (read_c0_config7() & 0x01c0) - timer_irqdispatch(7, regs); + timer_irqdispatch(7); } - spurious_interrupt(regs); + spurious_interrupt(); } static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask) diff --git a/arch/mips/pmc-sierra/yosemite/irq.c b/arch/mips/pmc-sierra/yosemite/irq.c index b91d0aa3b7ed..adb048527e76 100644 --- a/arch/mips/pmc-sierra/yosemite/irq.c +++ b/arch/mips/pmc-sierra/yosemite/irq.c @@ -56,15 +56,13 @@ #define HYPERTRANSPORT_INTC 0x7a /* INTC# */ #define HYPERTRANSPORT_INTD 0x7b /* INTD# */ -extern void jaguar_mailbox_irq(struct pt_regs *); - /* * Handle hypertransport & SMP interrupts. The interrupt lines are scarce. * For interprocessor interrupts, the best thing to do is to use the INTMSG * register. We use the same external interrupt line, i.e. INTB3 and monitor * another status bit */ -asmlinkage void ll_ht_smp_irq_handler(int irq, struct pt_regs *regs) +static void ll_ht_smp_irq_handler(int irq) { u32 status = OCD_READ(RM9000x2_OCD_INTP0STATUS4); @@ -107,50 +105,35 @@ asmlinkage void ll_ht_smp_irq_handler(int irq, struct pt_regs *regs) } #endif /* CONFIG_HT_LEVEL_TRIGGER */ - do_IRQ(irq, regs); + do_IRQ(irq); } -asmlinkage void do_extended_irq(struct pt_regs *regs) -{ - unsigned int intcontrol = read_c0_intcontrol(); - unsigned int cause = read_c0_cause(); - unsigned int status = read_c0_status(); - unsigned int pending_sr, pending_ic; - - pending_sr = status & cause & 0xff00; - pending_ic = (cause >> 8) & intcontrol & 0xff00; - - if (pending_ic & (1 << 13)) - do_IRQ(13, regs); - -} - -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int cause = read_c0_cause(); unsigned int status = read_c0_status(); unsigned int pending = cause & status; if (pending & STATUSF_IP7) { - do_IRQ(7, regs); + do_IRQ(7); } else if (pending & STATUSF_IP2) { #ifdef CONFIG_HYPERTRANSPORT - ll_ht_smp_irq_handler(2, regs); + ll_ht_smp_irq_handler(2); #else - do_IRQ(2, regs); + do_IRQ(2); #endif } else if (pending & STATUSF_IP3) { - do_IRQ(3, regs); + do_IRQ(3); } else if (pending & STATUSF_IP4) { - do_IRQ(4, regs); + do_IRQ(4); } else if (pending & STATUSF_IP5) { #ifdef CONFIG_SMP - titan_mailbox_irq(regs); + titan_mailbox_irq(); #else - do_IRQ(5, regs); + do_IRQ(5); #endif } else if (pending & STATUSF_IP6) { - do_IRQ(4, regs); + do_IRQ(4); } } @@ -178,18 +161,3 @@ void __init arch_init_irq(void) register_gdb_console(); #endif } - -#ifdef CONFIG_KGDB -/* - * The 16550 DUART has two ports, but is allocated one IRQ - * for the serial console. Hence, a generic framework for - * serial IRQ routing in place. Currently, just calls the - * do_IRQ fuction. But, going in the future, need to check - * DUART registers for channel A and B, then decide the - * appropriate action - */ -asmlinkage void yosemite_kgdb_irq(int irq, struct pt_regs *regs) -{ - do_IRQ(irq, regs); -} -#endif diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c index c197311e15d3..65fa3a23ea5e 100644 --- a/arch/mips/pmc-sierra/yosemite/smp.c +++ b/arch/mips/pmc-sierra/yosemite/smp.c @@ -110,7 +110,7 @@ void prom_smp_finish(void) { } -asmlinkage void titan_mailbox_irq(struct pt_regs *regs) +asmlinkage void titan_mailbox_irq(void) { int cpu = smp_processor_id(); unsigned long status; diff --git a/arch/mips/qemu/q-irq.c b/arch/mips/qemu/q-irq.c index 3352374c4c7d..f5ea2fe10f14 100644 --- a/arch/mips/qemu/q-irq.c +++ b/arch/mips/qemu/q-irq.c @@ -9,19 +9,19 @@ extern asmlinkage void qemu_handle_int(void); -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & 0x8000) { - ll_timer_interrupt(Q_COUNT_COMPARE_IRQ, regs); + ll_timer_interrupt(Q_COUNT_COMPARE_IRQ); return; } if (pending & 0x0400) { int irq = i8259_irq(); if (likely(irq >= 0)) - do_IRQ(irq, regs); + do_IRQ(irq); return; } diff --git a/arch/mips/sgi-ip22/ip22-berr.c b/arch/mips/sgi-ip22/ip22-berr.c index a28dc7800072..de6a0cc32fea 100644 --- a/arch/mips/sgi-ip22/ip22-berr.c +++ b/arch/mips/sgi-ip22/ip22-berr.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -85,9 +86,10 @@ static void print_buserr(void) * and then clear the interrupt when this happens. */ -void ip22_be_interrupt(int irq, struct pt_regs *regs) +void ip22_be_interrupt(int irq) { const int field = 2 * sizeof(unsigned long); + const struct pt_regs *regs = get_irq_regs(); save_and_clear_buserr(); print_buserr(); diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c index ee0514a29922..0d18ed47c47a 100644 --- a/arch/mips/sgi-ip22/ip22-eisa.c +++ b/arch/mips/sgi-ip22/ip22-eisa.c @@ -70,7 +70,7 @@ static char __init *decode_eisa_sig(unsigned long addr) return sig_str; } -static irqreturn_t ip22_eisa_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ip22_eisa_intr(int irq, void *dev_id) { u8 eisa_irq; u8 dma1, dma2; @@ -80,7 +80,7 @@ static irqreturn_t ip22_eisa_intr(int irq, void *dev_id, struct pt_regs *regs) dma2 = inb(EISA_DMA2_STATUS); if (eisa_irq < EISA_MAX_IRQ) { - do_IRQ(eisa_irq, regs); + do_IRQ(eisa_irq); return IRQ_HANDLED; } @@ -89,6 +89,7 @@ static irqreturn_t ip22_eisa_intr(int irq, void *dev_id, struct pt_regs *regs) outb(0x20, EISA_INT2_CTRL); outb(0x20, EISA_INT1_CTRL); + return IRQ_NONE; } diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c index f66026e5d64b..af518898eaa1 100644 --- a/arch/mips/sgi-ip22/ip22-int.c +++ b/arch/mips/sgi-ip22/ip22-int.c @@ -222,7 +222,7 @@ static struct irq_chip ip22_local3_irq_type = { .end = end_local3_irq, }; -static void indy_local0_irqdispatch(struct pt_regs *regs) +static void indy_local0_irqdispatch(void) { u8 mask = sgint->istat0 & sgint->imask0; u8 mask2; @@ -236,11 +236,10 @@ static void indy_local0_irqdispatch(struct pt_regs *regs) /* if irq == 0, then the interrupt has already been cleared */ if (irq) - do_IRQ(irq, regs); - return; + do_IRQ(irq); } -static void indy_local1_irqdispatch(struct pt_regs *regs) +static void indy_local1_irqdispatch(void) { u8 mask = sgint->istat1 & sgint->imask1; u8 mask2; @@ -254,19 +253,18 @@ static void indy_local1_irqdispatch(struct pt_regs *regs) /* if irq == 0, then the interrupt has already been cleared */ if (irq) - do_IRQ(irq, regs); - return; + do_IRQ(irq); } -extern void ip22_be_interrupt(int irq, struct pt_regs *regs); +extern void ip22_be_interrupt(int irq); -static void indy_buserror_irq(struct pt_regs *regs) +static void indy_buserror_irq(void) { int irq = SGI_BUSERR_IRQ; irq_enter(); kstat_this_cpu.irqs[irq]++; - ip22_be_interrupt(irq, regs); + ip22_be_interrupt(irq); irq_exit(); } @@ -305,8 +303,8 @@ static struct irqaction map1_cascade = { #define SGI_INTERRUPTS SGINT_LOCAL3 #endif -extern void indy_r4k_timer_interrupt(struct pt_regs *regs); -extern void indy_8254timer_irq(struct pt_regs *regs); +extern void indy_r4k_timer_interrupt(void); +extern void indy_8254timer_irq(void); /* * IRQs on the INDY look basically (barring software IRQs which we don't use @@ -336,7 +334,7 @@ extern void indy_8254timer_irq(struct pt_regs *regs); * another exception, big deal. */ -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause(); @@ -344,15 +342,15 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) * First we check for r4k counter/timer IRQ. */ if (pending & CAUSEF_IP7) - indy_r4k_timer_interrupt(regs); + indy_r4k_timer_interrupt(); else if (pending & CAUSEF_IP2) - indy_local0_irqdispatch(regs); + indy_local0_irqdispatch(); else if (pending & CAUSEF_IP3) - indy_local1_irqdispatch(regs); + indy_local1_irqdispatch(); else if (pending & CAUSEF_IP6) - indy_buserror_irq(regs); + indy_buserror_irq(); else if (pending & (CAUSEF_IP4 | CAUSEF_IP5)) - indy_8254timer_irq(regs); + indy_8254timer_irq(); } extern void mips_cpu_irq_init(unsigned int irq_base); diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c index 3462b0d98def..205554734099 100644 --- a/arch/mips/sgi-ip22/ip22-time.c +++ b/arch/mips/sgi-ip22/ip22-time.c @@ -175,7 +175,7 @@ static __init void indy_time_init(void) } /* Generic SGI handler for (spurious) 8254 interrupts */ -void indy_8254timer_irq(struct pt_regs *regs) +void indy_8254timer_irq(void) { int irq = SGI_8254_0_IRQ; ULONG cnt; @@ -189,16 +189,14 @@ void indy_8254timer_irq(struct pt_regs *regs) irq_exit(); } -void indy_r4k_timer_interrupt(struct pt_regs *regs) +void indy_r4k_timer_interrupt(void) { - struct pt_regs *old_regs = set_irq_regs(regs); int irq = SGI_TIMER_IRQ; irq_enter(); kstat_this_cpu.irqs[irq]++; timer_interrupt(irq, NULL); irq_exit(); - set_irq_regs(old_regs); } void __init plat_timer_setup(struct irqaction *irq) diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index 24a85372284f..f41587a206e2 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c @@ -129,7 +129,7 @@ static int ms1bit(unsigned long x) * Kanoj 05.13.00 */ -static void ip27_do_irq_mask0(struct pt_regs *regs) +static void ip27_do_irq_mask0(void) { int irq, swlevel; hubreg_t pend0, mask0; @@ -164,13 +164,13 @@ static void ip27_do_irq_mask0(struct pt_regs *regs) struct slice_data *si = cpu_data[cpu].data; irq = si->level_to_irq[swlevel]; - do_IRQ(irq, regs); + do_IRQ(irq); } LOCAL_HUB_L(PI_INT_PEND0); } -static void ip27_do_irq_mask1(struct pt_regs *regs) +static void ip27_do_irq_mask1(void) { int irq, swlevel; hubreg_t pend1, mask1; @@ -190,17 +190,17 @@ static void ip27_do_irq_mask1(struct pt_regs *regs) /* "map" swlevel to irq */ irq = si->level_to_irq[swlevel]; LOCAL_HUB_CLR_INTR(swlevel); - do_IRQ(irq, regs); + do_IRQ(irq); LOCAL_HUB_L(PI_INT_PEND1); } -static void ip27_prof_timer(struct pt_regs *regs) +static void ip27_prof_timer(void) { panic("CPU %d got a profiling interrupt", smp_processor_id()); } -static void ip27_hub_error(struct pt_regs *regs) +static void ip27_hub_error(void) { panic("CPU %d got a hub error interrupt", smp_processor_id()); } @@ -418,22 +418,22 @@ int __devinit request_bridge_irq(struct bridge_controller *bc) return irq; } -extern void ip27_rt_timer_interrupt(struct pt_regs *regs); +extern void ip27_rt_timer_interrupt(void); -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned long pending = read_c0_cause() & read_c0_status(); if (pending & CAUSEF_IP4) - ip27_rt_timer_interrupt(regs); + ip27_rt_timer_interrupt(); else if (pending & CAUSEF_IP2) /* PI_INT_PEND_0 or CC_PEND_{A|B} */ - ip27_do_irq_mask0(regs); + ip27_do_irq_mask0(); else if (pending & CAUSEF_IP3) /* PI_INT_PEND_1 */ - ip27_do_irq_mask1(regs); + ip27_do_irq_mask1(); else if (pending & CAUSEF_IP5) - ip27_prof_timer(regs); + ip27_prof_timer(); else if (pending & CAUSEF_IP6) - ip27_hub_error(regs); + ip27_hub_error(); } void __init arch_init_irq(void) diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index 257ce118e380..4e870fc4469b 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c @@ -89,7 +89,7 @@ static int set_rtc_mmss(unsigned long nowtime) static unsigned int rt_timer_irq; -void ip27_rt_timer_interrupt(struct pt_regs *regs) +void ip27_rt_timer_interrupt(void) { int cpu = smp_processor_id(); int cpuA = cputoslice(cpu) == 0; @@ -111,7 +111,7 @@ again: if (cpu == 0) do_timer(1); - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); /* * If we have an externally synchronized Linux clock, then update diff --git a/arch/mips/sgi-ip32/crime.c b/arch/mips/sgi-ip32/crime.c index 41b5eca1148c..f1f2c45a6c80 100644 --- a/arch/mips/sgi-ip32/crime.c +++ b/arch/mips/sgi-ip32/crime.c @@ -40,8 +40,7 @@ void __init crime_init(void) id, rev, field, (unsigned long) CRIME_BASE); } -irqreturn_t -crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t crime_memerr_intr(unsigned int irq, void *dev_id) { unsigned long stat, addr; int fatal = 0; @@ -92,8 +91,7 @@ crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -irqreturn_t -crime_cpuerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t crime_cpuerr_intr(unsigned int irq, void *dev_id) { unsigned long stat = crime->cpu_error_stat & CRIME_CPU_ERROR_MASK; unsigned long addr = crime->cpu_error_addr & CRIME_CPU_ERROR_ADDR_MASK; diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c index c64a820373de..c9acadd0846b 100644 --- a/arch/mips/sgi-ip32/ip32-irq.c +++ b/arch/mips/sgi-ip32/ip32-irq.c @@ -120,10 +120,8 @@ static void inline flush_mace_bus(void) static DEFINE_SPINLOCK(ip32_irq_lock); /* Some initial interrupts to set up */ -extern irqreturn_t crime_memerr_intr (int irq, void *dev_id, - struct pt_regs *regs); -extern irqreturn_t crime_cpuerr_intr (int irq, void *dev_id, - struct pt_regs *regs); +extern irqreturn_t crime_memerr_intr(int irq, void *dev_id); +extern irqreturn_t crime_cpuerr_intr(int irq, void *dev_id); struct irqaction memerr_irq = { crime_memerr_intr, IRQF_DISABLED, CPU_MASK_NONE, "CRIME memory error", NULL, NULL }; @@ -479,7 +477,7 @@ static struct irq_chip ip32_mace_interrupt = { .end = end_mace_irq, }; -static void ip32_unknown_interrupt(struct pt_regs *regs) +static void ip32_unknown_interrupt(void) { printk ("Unknown interrupt occurred!\n"); printk ("cp0_status: %08x\n", read_c0_status()); @@ -492,7 +490,7 @@ static void ip32_unknown_interrupt(struct pt_regs *regs) printk ("MACE PCI control register: %08x\n", mace->pci.control); printk("Register dump:\n"); - show_regs(regs); + show_regs(get_irq_regs()); printk("Please mail this report to linux-mips@linux-mips.org\n"); printk("Spinning..."); @@ -501,7 +499,7 @@ static void ip32_unknown_interrupt(struct pt_regs *regs) /* CRIME 1.1 appears to deliver all interrupts to this one pin. */ /* change this to loop over all edge-triggered irqs, exception masked out ones */ -static void ip32_irq0(struct pt_regs *regs) +static void ip32_irq0(void) { uint64_t crime_int; int irq = 0; @@ -516,50 +514,50 @@ static void ip32_irq0(struct pt_regs *regs) } irq++; DBG("*irq %u*\n", irq); - do_IRQ(irq, regs); + do_IRQ(irq); } -static void ip32_irq1(struct pt_regs *regs) +static void ip32_irq1(void) { - ip32_unknown_interrupt(regs); + ip32_unknown_interrupt(); } -static void ip32_irq2(struct pt_regs *regs) +static void ip32_irq2(void) { - ip32_unknown_interrupt(regs); + ip32_unknown_interrupt(); } -static void ip32_irq3(struct pt_regs *regs) +static void ip32_irq3(void) { - ip32_unknown_interrupt(regs); + ip32_unknown_interrupt(); } -static void ip32_irq4(struct pt_regs *regs) +static void ip32_irq4(void) { - ip32_unknown_interrupt(regs); + ip32_unknown_interrupt(); } -static void ip32_irq5(struct pt_regs *regs) +static void ip32_irq5(void) { - ll_timer_interrupt(IP32_R4K_TIMER_IRQ, regs); + ll_timer_interrupt(IP32_R4K_TIMER_IRQ); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause(); if (likely(pending & IE_IRQ0)) - ip32_irq0(regs); + ip32_irq0(); else if (unlikely(pending & IE_IRQ1)) - ip32_irq1(regs); + ip32_irq1(); else if (unlikely(pending & IE_IRQ2)) - ip32_irq2(regs); + ip32_irq2(); else if (unlikely(pending & IE_IRQ3)) - ip32_irq3(regs); + ip32_irq3(); else if (unlikely(pending & IE_IRQ4)) - ip32_irq4(regs); + ip32_irq4(); else if (likely(pending & IE_IRQ5)) - ip32_irq5(regs); + ip32_irq5(); } void __init arch_init_irq(void) diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index a46b75b23ecb..0c00f676b8b3 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -284,8 +285,7 @@ void __init init_bcm1480_irqs(void) } -static irqreturn_t bcm1480_dummy_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t bcm1480_dummy_handler(int irq, void *dev_id) { return IRQ_NONE; } @@ -453,7 +453,7 @@ void __init arch_init_irq(void) #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg))) #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg))) -void bcm1480_kgdb_interrupt(struct pt_regs *regs) +static void bcm1480_kgdb_interrupt(void) { /* * Clear break-change status (allow some time for the remote @@ -464,16 +464,15 @@ void bcm1480_kgdb_interrupt(struct pt_regs *regs) mdelay(500); duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT | M_DUART_RX_EN | M_DUART_TX_EN); - set_async_breakpoint(®s->cp0_epc); + set_async_breakpoint(&get_irq_regs()->cp0_epc); } #endif /* CONFIG_KGDB */ -extern void bcm1480_timer_interrupt(struct pt_regs *regs); -extern void bcm1480_mailbox_interrupt(struct pt_regs *regs); -extern void bcm1480_kgdb_interrupt(struct pt_regs *regs); +extern void bcm1480_timer_interrupt(void); +extern void bcm1480_mailbox_interrupt(void); -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending; @@ -486,21 +485,21 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) #ifdef CONFIG_SIBYTE_BCM1480_PROF if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */ - sbprof_cpu_intr(exception_epc(regs)); + sbprof_cpu_intr(); else #endif if (pending & CAUSEF_IP4) - bcm1480_timer_interrupt(regs); + bcm1480_timer_interrupt(); #ifdef CONFIG_SMP else if (pending & CAUSEF_IP3) - bcm1480_mailbox_interrupt(regs); + bcm1480_mailbox_interrupt(); #endif #ifdef CONFIG_KGDB else if (pending & CAUSEF_IP6) - bcm1480_kgdb_interrupt(regs); /* KGDB (uart 1) */ + bcm1480_kgdb_interrupt(); /* KGDB (uart 1) */ #endif else if (pending & CAUSEF_IP2) { @@ -521,9 +520,9 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) if (mask_h) { if (mask_h ^ 1) - do_IRQ(fls64(mask_h) - 1, regs); + do_IRQ(fls64(mask_h) - 1); else - do_IRQ(63 + fls64(mask_l), regs); + do_IRQ(63 + fls64(mask_l)); } } } diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c index 584a4b33faac..6eac36d1b8c8 100644 --- a/arch/mips/sibyte/bcm1480/smp.c +++ b/arch/mips/sibyte/bcm1480/smp.c @@ -88,7 +88,7 @@ void core_send_ipi(int cpu, unsigned int action) __raw_writeq((((u64)action)<< 48), mailbox_0_set_regs[cpu]); } -void bcm1480_mailbox_interrupt(struct pt_regs *regs) +void bcm1480_mailbox_interrupt(void) { int cpu = smp_processor_id(); unsigned int action; diff --git a/arch/mips/sibyte/bcm1480/time.c b/arch/mips/sibyte/bcm1480/time.c index 7e088f6c4a86..f228f711dc34 100644 --- a/arch/mips/sibyte/bcm1480/time.c +++ b/arch/mips/sibyte/bcm1480/time.c @@ -100,10 +100,10 @@ void bcm1480_time_init(void) #include -void bcm1480_timer_interrupt(struct pt_regs *regs) +void bcm1480_timer_interrupt(void) { int cpu = smp_processor_id(); - int irq = K_BCM1480_INT_TIMER_0+cpu; + int irq = K_BCM1480_INT_TIMER_0 + cpu; /* Reset the timer */ __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS, @@ -113,13 +113,13 @@ void bcm1480_timer_interrupt(struct pt_regs *regs) /* * CPU 0 handles the global timer interrupt job */ - ll_timer_interrupt(irq, regs); + ll_timer_interrupt(irq); } else { /* * other CPUs should just do profiling and process accounting */ - ll_local_timer_interrupt(irq, regs); + ll_local_timer_interrupt(irq); } } diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index f9bd9f074517..f6d2e19592ea 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c @@ -254,8 +254,7 @@ void __init init_sb1250_irqs(void) } -static irqreturn_t sb1250_dummy_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t sb1250_dummy_handler(int irq, void *dev_id) { return IRQ_NONE; } @@ -403,7 +402,7 @@ void __init arch_init_irq(void) #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg))) #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg))) -static void sb1250_kgdb_interrupt(struct pt_regs *regs) +static void sb1250_kgdb_interrupt(void) { /* * Clear break-change status (allow some time for the remote @@ -414,16 +413,15 @@ static void sb1250_kgdb_interrupt(struct pt_regs *regs) mdelay(500); duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT | M_DUART_RX_EN | M_DUART_TX_EN); - set_async_breakpoint(®s->cp0_epc); + set_async_breakpoint(&get_irq_regs()->cp0_epc); } #endif /* CONFIG_KGDB */ -extern void sb1250_timer_interrupt(struct pt_regs *regs); -extern void sb1250_mailbox_interrupt(struct pt_regs *regs); -extern void sb1250_kgdb_interrupt(struct pt_regs *regs); +extern void sb1250_timer_interrupt(void); +extern void sb1250_mailbox_interrupt(void); -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending; @@ -446,21 +444,21 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) #ifdef CONFIG_SIBYTE_SB1250_PROF if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */ - sbprof_cpu_intr(exception_epc(regs)); + sbprof_cpu_intr(); else #endif if (pending & CAUSEF_IP4) - sb1250_timer_interrupt(regs); + sb1250_timer_interrupt(); #ifdef CONFIG_SMP else if (pending & CAUSEF_IP3) - sb1250_mailbox_interrupt(regs); + sb1250_mailbox_interrupt(); #endif #ifdef CONFIG_KGDB else if (pending & CAUSEF_IP6) /* KGDB (uart 1) */ - sb1250_kgdb_interrupt(regs); + sb1250_kgdb_interrupt(); #endif else if (pending & CAUSEF_IP2) { @@ -475,9 +473,9 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) mask = __raw_readq(IOADDR(A_IMR_REGISTER(smp_processor_id(), R_IMR_INTERRUPT_STATUS_BASE))); if (mask) - do_IRQ(fls64(mask) - 1, regs); + do_IRQ(fls64(mask) - 1); else - spurious_interrupt(regs); + spurious_interrupt(); } else - spurious_interrupt(regs); + spurious_interrupt(); } diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c index f859db02d3c9..c38e1f34460d 100644 --- a/arch/mips/sibyte/sb1250/smp.c +++ b/arch/mips/sibyte/sb1250/smp.c @@ -76,7 +76,7 @@ void core_send_ipi(int cpu, unsigned int action) __raw_writeq((((u64)action) << 48), mailbox_set_regs[cpu]); } -void sb1250_mailbox_interrupt(struct pt_regs *regs) +void sb1250_mailbox_interrupt(void) { int cpu = smp_processor_id(); unsigned int action; diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c index 4b669dc86ef4..0d17aec03dd7 100644 --- a/arch/mips/sibyte/sb1250/time.c +++ b/arch/mips/sibyte/sb1250/time.c @@ -125,7 +125,7 @@ void sb1250_time_init(void) */ } -void sb1250_timer_interrupt(struct pt_regs *regs) +void sb1250_timer_interrupt(void) { int cpu = smp_processor_id(); int irq = K_INT_TIMER_0 + cpu; @@ -138,13 +138,13 @@ void sb1250_timer_interrupt(struct pt_regs *regs) /* * CPU 0 handles the global timer interrupt job */ - ll_timer_interrupt(irq, regs); + ll_timer_interrupt(irq); } else { /* * other CPUs should just do profiling and process accounting */ - ll_local_timer_interrupt(irq, regs); + ll_local_timer_interrupt(irq); } } diff --git a/arch/mips/sni/irq.c b/arch/mips/sni/irq.c index cda165f42b6a..48fb74a7aaec 100644 --- a/arch/mips/sni/irq.c +++ b/arch/mips/sni/irq.c @@ -69,20 +69,20 @@ static struct irq_chip pciasic_irq_type = { * hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug * button interrupts. Later ... */ -static void pciasic_hwint0(struct pt_regs *regs) +static void pciasic_hwint0(void) { panic("Received int0 but no handler yet ..."); } /* This interrupt was used for the com1 console on the first prototypes. */ -static void pciasic_hwint2(struct pt_regs *regs) +static void pciasic_hwint2(void) { /* I think this shouldn't happen on production machines. */ panic("hwint2 and no handler yet"); } /* hwint5 is the r4k count / compare interrupt */ -static void pciasic_hwint5(struct pt_regs *regs) +static void pciasic_hwint5(void) { panic("hwint5 and no handler yet"); } @@ -103,7 +103,7 @@ static unsigned int ls1bit8(unsigned int x) * * The EISA_INT bit in CSITPEND is high active, all others are low active. */ -static void pciasic_hwint1(struct pt_regs *regs) +static void pciasic_hwint1(void) { u8 pend = *(volatile char *)PCIMT_CSITPEND; unsigned long flags; @@ -119,13 +119,13 @@ static void pciasic_hwint1(struct pt_regs *regs) if (unlikely(irq < 0)) return; - do_IRQ(irq, regs); + do_IRQ(irq); } if (!(pend & IT_SCSI)) { flags = read_c0_status(); clear_c0_status(ST0_IM); - do_IRQ(PCIMT_IRQ_SCSI, regs); + do_IRQ(PCIMT_IRQ_SCSI); write_c0_status(flags); } } @@ -133,7 +133,7 @@ static void pciasic_hwint1(struct pt_regs *regs) /* * hwint 3 should deal with the PCI A - D interrupts, */ -static void pciasic_hwint3(struct pt_regs *regs) +static void pciasic_hwint3(void) { u8 pend = *(volatile char *)PCIMT_CSITPEND; int irq; @@ -141,21 +141,21 @@ static void pciasic_hwint3(struct pt_regs *regs) pend &= (IT_INTA | IT_INTB | IT_INTC | IT_INTD); clear_c0_status(IE_IRQ3); irq = PCIMT_IRQ_INT2 + ls1bit8(pend); - do_IRQ(irq, regs); + do_IRQ(irq); set_c0_status(IE_IRQ3); } /* * hwint 4 is used for only the onboard PCnet 32. */ -static void pciasic_hwint4(struct pt_regs *regs) +static void pciasic_hwint4(void) { clear_c0_status(IE_IRQ4); - do_IRQ(PCIMT_IRQ_ETHERNET, regs); + do_IRQ(PCIMT_IRQ_ETHERNET); set_c0_status(IE_IRQ4); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); static unsigned char led_cache; @@ -163,17 +163,17 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) *(volatile unsigned char *) PCIMT_CSLED = ++led_cache; if (pending & 0x0800) - pciasic_hwint1(regs); + pciasic_hwint1(); else if (pending & 0x4000) - pciasic_hwint4(regs); + pciasic_hwint4(); else if (pending & 0x2000) - pciasic_hwint3(regs); + pciasic_hwint3(); else if (pending & 0x1000) - pciasic_hwint2(regs); + pciasic_hwint2(); else if (pending & 0x8000) - pciasic_hwint5(regs); + pciasic_hwint5(); else if (pending & 0x0400) - pciasic_hwint0(regs); + pciasic_hwint0(); } void __init init_pciasic(void) diff --git a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c index cd176f6a06c8..8266a88a3f88 100644 --- a/arch/mips/tx4927/common/tx4927_irq.c +++ b/arch/mips/tx4927/common/tx4927_irq.c @@ -576,24 +576,24 @@ static int tx4927_irq_nested(void) return (sw_irq); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & STATUSF_IP7) /* cpu timer */ - do_IRQ(TX4927_IRQ_CPU_TIMER, regs); + do_IRQ(TX4927_IRQ_CPU_TIMER); else if (pending & STATUSF_IP2) { /* tx4927 pic */ unsigned int irq = tx4927_irq_nested(); if (unlikely(irq == 0)) { - spurious_interrupt(regs); + spurious_interrupt(); return; } - do_IRQ(irq, regs); + do_IRQ(irq); } else if (pending & STATUSF_IP0) /* user line 0 */ - do_IRQ(TX4927_IRQ_USER0, regs); + do_IRQ(TX4927_IRQ_USER0); else if (pending & STATUSF_IP1) /* user line 1 */ - do_IRQ(TX4927_IRQ_USER1, regs); + do_IRQ(TX4927_IRQ_USER1); else - spurious_interrupt(regs); + spurious_interrupt(); } diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index f0d70c476005..bea19098ac28 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -160,8 +161,7 @@ int tx4927_pci66 = 0; /* 0:auto */ char *toshiba_name = ""; #ifdef CONFIG_PCI -static void tx4927_pcierr_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static void tx4927_pcierr_interrupt(int irq, void *dev_id) { #ifdef CONFIG_BLK_DEV_IDEPCI /* ignore MasterAbort for ide probing... */ @@ -185,7 +185,7 @@ static void tx4927_pcierr_interrupt(int irq, void *dev_id, (unsigned long) tx4927_ccfgptr->ccfg, (unsigned long) (tx4927_ccfgptr->tear >> 32), (unsigned long) tx4927_ccfgptr->tear); - show_regs(regs); + show_regs(get_irq_regs()); } void __init toshiba_rbtx4927_pci_irq_init(void) diff --git a/arch/mips/tx4938/common/irq.c b/arch/mips/tx4938/common/irq.c index cbfb34221b59..b6024749b8f4 100644 --- a/arch/mips/tx4938/common/irq.c +++ b/arch/mips/tx4938/common/irq.c @@ -104,8 +104,6 @@ tx4938_irq_cp0_init(void) irq_desc[i].depth = 1; irq_desc[i].chip = &tx4938_irq_cp0_type; } - - return; } static unsigned int @@ -113,7 +111,7 @@ tx4938_irq_cp0_startup(unsigned int irq) { tx4938_irq_cp0_enable(irq); - return (0); + return 0; } static void @@ -144,16 +142,12 @@ tx4938_irq_cp0_disable(unsigned int irq) clear_c0_status(tx4938_irq_cp0_mask(irq)); spin_unlock_irqrestore(&tx4938_cp0_lock, flags); - - return; } static void tx4938_irq_cp0_mask_and_ack(unsigned int irq) { tx4938_irq_cp0_disable(irq); - - return; } static void @@ -162,8 +156,6 @@ tx4938_irq_cp0_end(unsigned int irq) if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { tx4938_irq_cp0_enable(irq); } - - return; } /**********************************************************************************/ @@ -227,7 +219,7 @@ tx4938_irq_pic_addr(int irq) } } - return (0); + return 0; } u32 @@ -278,7 +270,7 @@ tx4938_irq_pic_mask(int irq) return (0x00000007); } } - return (0x00000000); + return 0x00000000; } static void @@ -292,8 +284,6 @@ tx4938_irq_pic_modify(unsigned pic_reg, unsigned clr_bits, unsigned set_bits) TX4938_WR(pic_reg, val); mmiowb(); TX4938_RD(pic_reg); - - return; } static void __init @@ -317,8 +307,6 @@ tx4938_irq_pic_init(void) TX4938_WR(0xff1ff600, TX4938_RD(0xff1ff600) | 0x1); /* irq enable */ spin_unlock_irqrestore(&tx4938_pic_lock, flags); - - return; } static unsigned int @@ -326,15 +314,13 @@ tx4938_irq_pic_startup(unsigned int irq) { tx4938_irq_pic_enable(irq); - return (0); + return 0; } static void tx4938_irq_pic_shutdown(unsigned int irq) { tx4938_irq_pic_disable(irq); - - return; } static void @@ -348,8 +334,6 @@ tx4938_irq_pic_enable(unsigned int irq) tx4938_irq_pic_mask(irq)); spin_unlock_irqrestore(&tx4938_pic_lock, flags); - - return; } static void @@ -363,16 +347,12 @@ tx4938_irq_pic_disable(unsigned int irq) tx4938_irq_pic_mask(irq), 0); spin_unlock_irqrestore(&tx4938_pic_lock, flags); - - return; } static void tx4938_irq_pic_mask_and_ack(unsigned int irq) { tx4938_irq_pic_disable(irq); - - return; } static void @@ -381,8 +361,6 @@ tx4938_irq_pic_end(unsigned int irq) if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { tx4938_irq_pic_enable(irq); } - - return; } /**********************************************************************************/ @@ -394,8 +372,6 @@ tx4938_irq_init(void) { tx4938_irq_cp0_init(); tx4938_irq_pic_init(); - - return; } int @@ -417,23 +393,23 @@ tx4938_irq_nested(void) } wbflush(); - return (sw_irq); + return sw_irq; } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status(); if (pending & STATUSF_IP7) - do_IRQ(TX4938_IRQ_CPU_TIMER, regs); + do_IRQ(TX4938_IRQ_CPU_TIMER); else if (pending & STATUSF_IP2) { int irq = tx4938_irq_nested(); if (irq) - do_IRQ(irq, regs); + do_IRQ(irq); else - spurious_interrupt(regs); + spurious_interrupt(); } else if (pending & STATUSF_IP1) - do_IRQ(TX4938_IRQ_USER1, regs); + do_IRQ(TX4938_IRQ_USER1); else if (pending & STATUSF_IP0) - do_IRQ(TX4938_IRQ_USER0, regs); + do_IRQ(TX4938_IRQ_USER0); } diff --git a/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c b/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c index fae3136f462d..b926e6a75c29 100644 --- a/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c +++ b/arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c @@ -35,7 +35,8 @@ void __init txx9_spi_init(unsigned long base, int (*cs_func)(int chipid, int on) } static DECLARE_WAIT_QUEUE_HEAD(txx9_spi_wait); -static void txx9_spi_interrupt(int irq, void *dev_id, struct pt_regs *regs) + +static void txx9_spi_interrupt(int irq, void *dev_id) { /* disable rx intr */ tx4938_spiptr->cr0 &= ~TXx9_SPCR0_RBSIE; diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c index 7a5c31d58378..c215c0d39fae 100644 --- a/arch/mips/vr41xx/common/icu.c +++ b/arch/mips/vr41xx/common/icu.c @@ -635,7 +635,7 @@ int vr41xx_set_intassign(unsigned int irq, unsigned char intassign) EXPORT_SYMBOL(vr41xx_set_intassign); -static int icu_get_irq(unsigned int irq, struct pt_regs *regs) +static int icu_get_irq(unsigned int irq) { uint16_t pend1, pend2; uint16_t mask1, mask2; diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c index 4733c5344467..397ba94cd7ec 100644 --- a/arch/mips/vr41xx/common/irq.c +++ b/arch/mips/vr41xx/common/irq.c @@ -25,7 +25,7 @@ #include typedef struct irq_cascade { - int (*get_irq)(unsigned int, struct pt_regs *); + int (*get_irq)(unsigned int); } irq_cascade_t; static irq_cascade_t irq_cascade[NR_IRQS] __cacheline_aligned; @@ -36,7 +36,7 @@ static struct irqaction cascade_irqaction = { .name = "cascade", }; -int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)) +int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int)) { int retval = 0; @@ -59,7 +59,7 @@ int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *) EXPORT_SYMBOL_GPL(cascade_irq); -static void irq_dispatch(unsigned int irq, struct pt_regs *regs) +static void irq_dispatch(unsigned int irq) { irq_cascade_t *cascade; struct irq_desc *desc; @@ -74,39 +74,39 @@ static void irq_dispatch(unsigned int irq, struct pt_regs *regs) unsigned int source_irq = irq; desc = irq_desc + source_irq; desc->chip->ack(source_irq); - irq = cascade->get_irq(irq, regs); + irq = cascade->get_irq(irq); if (irq < 0) atomic_inc(&irq_err_count); else - irq_dispatch(irq, regs); + irq_dispatch(irq); desc->chip->end(source_irq); } else - do_IRQ(irq, regs); + do_IRQ(irq); } -asmlinkage void plat_irq_dispatch(struct pt_regs *regs) +asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; if (pending & CAUSEF_IP7) - do_IRQ(7, regs); + do_IRQ(7); else if (pending & 0x7800) { if (pending & CAUSEF_IP3) - irq_dispatch(3, regs); + irq_dispatch(3); else if (pending & CAUSEF_IP4) - irq_dispatch(4, regs); + irq_dispatch(4); else if (pending & CAUSEF_IP5) - irq_dispatch(5, regs); + irq_dispatch(5); else if (pending & CAUSEF_IP6) - irq_dispatch(6, regs); + irq_dispatch(6); } else if (pending & CAUSEF_IP2) - irq_dispatch(2, regs); + irq_dispatch(2); else if (pending & CAUSEF_IP0) - do_IRQ(0, regs); + do_IRQ(0); else if (pending & CAUSEF_IP1) - do_IRQ(1, regs); + do_IRQ(1); else - spurious_interrupt(regs); + spurious_interrupt(); } void __init arch_init_irq(void) diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index d35c61776a02..1a9804c65369 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h @@ -26,7 +26,7 @@ static inline int irq_canonicalize(int irq) struct pt_regs; -extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); +extern asmlinkage unsigned int do_IRQ(unsigned int irq); #ifdef CONFIG_MIPS_MT_SMTC /* @@ -55,18 +55,18 @@ do { \ * Ideally there should be away to get this into kernel/irq/handle.c to * avoid the overhead of a call for just a tiny function ... */ -#define do_IRQ(irq, regs) \ +#define do_IRQ(irq) \ do { \ irq_enter(); \ __DO_IRQ_SMTC_HOOK(); \ - __do_IRQ((irq), (regs)); \ + __do_IRQ((irq)); \ irq_exit(); \ } while (0) #endif extern void arch_init_irq(void); -extern void spurious_interrupt(struct pt_regs *regs); +extern void spurious_interrupt(void); #ifdef CONFIG_MIPS_MT_SMTC struct irqaction; diff --git a/include/asm-mips/irq_regs.h b/include/asm-mips/irq_regs.h index 3dd9c0b70270..33bd2a06de57 100644 --- a/include/asm-mips/irq_regs.h +++ b/include/asm-mips/irq_regs.h @@ -1 +1,21 @@ -#include +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) + */ +#ifndef __ASM_IRQ_REGS_H +#define __ASM_IRQ_REGS_H + +#define ARCH_HAS_OWN_IRQ_REGS + +#include + +static inline struct pt_regs *get_irq_regs(void) +{ + return current_thread_info()->regs; +} + +#endif /* __ASM_IRQ_REGS_H */ diff --git a/include/asm-mips/jmr3927/irq.h b/include/asm-mips/jmr3927/irq.h index fe551f33a74f..e3e7ed38da6c 100644 --- a/include/asm-mips/jmr3927/irq.h +++ b/include/asm-mips/jmr3927/irq.h @@ -45,10 +45,6 @@ extern int toshibaboards_setup_irq(int irq, struct irqaction * new); -#ifdef CONFIG_TX_BRANCH_LIKELY_BUG_WORKAROUND -extern void tx_branch_likely_bug_fixup(struct pt_regs *regs); -#endif - extern int (*toshibaboards_gen_iack)(void); #endif /* !__ASSEMBLY__ */ diff --git a/include/asm-mips/mach-au1x00/au1000_dma.h b/include/asm-mips/mach-au1x00/au1000_dma.h index 810f2fa33444..0493cb0d6175 100644 --- a/include/asm-mips/mach-au1x00/au1000_dma.h +++ b/include/asm-mips/mach-au1x00/au1000_dma.h @@ -123,8 +123,7 @@ struct dma_chan { extern struct dma_chan au1000_dma_table[]; extern int request_au1000_dma(int dev_id, const char *dev_str, - irqreturn_t (*irqhandler)(int, void *, - struct pt_regs *), + irqreturn_t (*irqhandler)(int, void *), unsigned long irqflags, void *irq_dev_id); extern void free_au1000_dma(unsigned int dmanr); diff --git a/include/asm-mips/marvell.h b/include/asm-mips/marvell.h index 6bb2125bb053..df94955b098a 100644 --- a/include/asm-mips/marvell.h +++ b/include/asm-mips/marvell.h @@ -53,6 +53,6 @@ struct mv_pci_controller { unsigned long config_vreg; }; -extern void ll_mv64340_irq(struct pt_regs *regs); +extern void ll_mv64340_irq(void); #endif /* __ASM_MIPS_MARVELL_H */ diff --git a/include/asm-mips/msc01_ic.h b/include/asm-mips/msc01_ic.h index 64f17208d602..aa7ad9a71762 100644 --- a/include/asm-mips/msc01_ic.h +++ b/include/asm-mips/msc01_ic.h @@ -145,7 +145,7 @@ typedef struct msc_irqmap { #define MSC01_IRQ_EDGE 1 extern void __init init_msc_irqs(unsigned int base, msc_irqmap_t *imp, int nirq); -extern void ll_msc_irq(struct pt_regs *regs); +extern void ll_msc_irq(void); #endif /* __ASM_MIPS_BOARDS_MSC01_IC_H */ diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index ae8ada5b42a9..e475c45ea263 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h @@ -34,6 +34,7 @@ struct thread_info { 0-0xFFFFFFFF for kernel-thread */ struct restart_block restart_block; + struct pt_regs *regs; }; /* diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index 30f21df39253..28512ba2266e 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h @@ -72,13 +72,13 @@ extern irqreturn_t timer_interrupt(int irq, void *dev_id); /* * the corresponding low-level timer interrupt routine. */ -extern asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs); +extern asmlinkage void ll_timer_interrupt(int irq); /* * profiling and process accouting is done separately in local_timer_interrupt */ extern void local_timer_interrupt(int irq, void *dev_id); -extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs); +extern asmlinkage void ll_local_timer_interrupt(int irq); /* * board specific routines required by time_init(). From f1d08f71974dcf68ce4510a2dfaeb798b05df2c0 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 7 Oct 2006 13:41:51 +0900 Subject: [PATCH 085/232] [MIPS] Fix DECserial build error by IRQ hander change Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- drivers/tc/zs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c index 7c0fe1dc96a9..792becdfe6f8 100644 --- a/drivers/tc/zs.c +++ b/drivers/tc/zs.c @@ -389,7 +389,7 @@ static void receive_chars(struct dec_serial *info) if (ch == 0) continue; if (time_before(jiffies, break_pressed + HZ * 5)) { - handle_sysrq(ch, regs, NULL); + handle_sysrq(ch, NULL); break_pressed = 0; continue; } From b7a7179dcae6cecfaaa8384f8c088fb7823c6c90 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Fri, 6 Oct 2006 19:49:52 +0200 Subject: [PATCH 086/232] ieee1394: nodemgr: fix startup of knodemgrd Revert a thinko in commit d2f119fe319528da8c76a1107459d6f478cbf28c: When knodemgrd starts, it needs to sleep until host->generation was incremented above its initial value of 0. My wrong logic caused it to start sending requests when the bus wasn't completely ready. Seen as "AT dma reset ctx=0, aborting transmission" messages in 2.6.19-rc1. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 3e7974c57443..8e7b83f84485 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -1614,7 +1614,7 @@ static int nodemgr_host_thread(void *__hi) { struct host_info *hi = (struct host_info *)__hi; struct hpsb_host *host = hi->host; - unsigned int g, generation = get_hpsb_generation(host) - 1; + unsigned int g, generation = 0; int i, reset_cycles = 0; /* Setup our device-model entries */ From ca4aa09635516258f158a7bc1594a794e4c34864 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sun, 8 Oct 2006 14:33:24 -0400 Subject: [PATCH 087/232] [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. Signed-off-by: Trond Myklebust Signed-off-by: Linus Torvalds --- fs/nfs/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 6e4e48c5092a..d2533e214255 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -330,7 +330,7 @@ found_client: for (;;) { set_current_state(TASK_INTERRUPTIBLE); if (signal_pending(current) || - clp->cl_cons_state > NFS_CS_READY) + clp->cl_cons_state != NFS_CS_INITING) break; schedule(); } From 7da5d406792eedb5341a8c20296470b2e67743e7 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sun, 8 Oct 2006 07:41:19 -0600 Subject: [PATCH 088/232] [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 Signed-off-by: Linus Torvalds --- arch/i386/pci/irq.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index 47f02af74be3..dbc4aae91959 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c @@ -1141,10 +1141,6 @@ static int pirq_enable_irq(struct pci_dev *dev) } dev = temp_dev; if (irq >= 0) { -#ifdef CONFIG_PCI_MSI - if (!platform_legacy_irq(irq)) - irq = IO_APIC_VECTOR(irq); -#endif printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", pci_name(dev), 'A' + pin, irq); dev->irq = irq; From b940d22d58c41b2ae491dca9232850f6f38f3653 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sun, 8 Oct 2006 07:43:46 -0600 Subject: [PATCH 089/232] [PATCH] i386/x86_64: Remove global IO_APIC_VECTOR Which vector an irq is assigned to now varies dynamically and is not needed outside of io_apic.c. So remove the possibility of accessing the information outside of io_apic.c and remove the silly macro that makes looking for users of irq_vector difficult. The fact this compiles ensures there aren't any more pieces of the old CONFIG_PCI_MSI weirdness that I failed to remove. Signed-off-by: Eric W. Biederman Signed-off-by: Linus Torvalds --- arch/i386/kernel/io_apic.c | 12 ++++++------ arch/x86_64/kernel/io_apic.c | 8 ++++---- include/asm-i386/hw_irq.h | 3 --- include/asm-x86_64/hw_irq.h | 2 -- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index b7287fb499f3..cd082c36ca03 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -1184,8 +1184,8 @@ static int __assign_irq_vector(int irq) BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); - if (IO_APIC_VECTOR(irq) > 0) - return IO_APIC_VECTOR(irq); + if (irq_vector[irq] > 0) + return irq_vector[irq]; current_vector += 8; if (current_vector == SYSCALL_VECTOR) @@ -1199,7 +1199,7 @@ static int __assign_irq_vector(int irq) } vector = current_vector; - IO_APIC_VECTOR(irq) = vector; + irq_vector[irq] = vector; return vector; } @@ -1967,7 +1967,7 @@ static void ack_ioapic_quirk_irq(unsigned int irq) * operation to prevent an edge-triggered interrupt escaping meanwhile. * The idea is from Manfred Spraul. --macro */ - i = IO_APIC_VECTOR(irq); + i = irq_vector[irq]; v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1)); @@ -1984,7 +1984,7 @@ static void ack_ioapic_quirk_irq(unsigned int irq) static int ioapic_retrigger_irq(unsigned int irq) { - send_IPI_self(IO_APIC_VECTOR(irq)); + send_IPI_self(irq_vector[irq]); return 1; } @@ -2020,7 +2020,7 @@ static inline void init_IO_APIC_traps(void) */ for (irq = 0; irq < NR_IRQS ; irq++) { int tmp = irq; - if (IO_APIC_IRQ(tmp) && !IO_APIC_VECTOR(tmp)) { + if (IO_APIC_IRQ(tmp) && !irq_vector[tmp]) { /* * Hmm.. We don't have an entry for this, * so default to an old-fashioned 8259 diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 91728d9d3472..9c3b9b19d699 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c @@ -587,8 +587,8 @@ static int __assign_irq_vector(int irq, cpumask_t mask) BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); - if (IO_APIC_VECTOR(irq) > 0) - old_vector = IO_APIC_VECTOR(irq); + if (irq_vector[irq] > 0) + old_vector = irq_vector[irq]; if ((old_vector > 0) && cpu_isset(old_vector >> 8, mask)) { return old_vector; } @@ -620,7 +620,7 @@ next: } per_cpu(vector_irq, cpu)[vector] = irq; vector |= cpu << 8; - IO_APIC_VECTOR(irq) = vector; + irq_vector[irq] = vector; return vector; } return -ENOSPC; @@ -1289,7 +1289,7 @@ static inline void init_IO_APIC_traps(void) */ for (irq = 0; irq < NR_IRQS ; irq++) { int tmp = irq; - if (IO_APIC_IRQ(tmp) && !IO_APIC_VECTOR(tmp)) { + if (IO_APIC_IRQ(tmp) && !irq_vector[tmp]) { /* * Hmm.. We don't have an entry for this, * so default to an old-fashioned 8259 diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 8806c7e002a7..0bedbdf5e907 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h @@ -26,9 +26,6 @@ * Interrupt entry/exit code at both C and assembly level */ -extern u8 irq_vector[NR_IRQ_VECTORS]; -#define IO_APIC_VECTOR(irq) (irq_vector[irq]) - extern void (*interrupt[NR_IRQS])(void); #ifdef CONFIG_SMP diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index 53d0d9fd10d6..792dd52fcd70 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h @@ -74,10 +74,8 @@ #ifndef __ASSEMBLY__ -extern unsigned int irq_vector[NR_IRQ_VECTORS]; typedef int vector_irq_t[NR_VECTORS]; DECLARE_PER_CPU(vector_irq_t, vector_irq); -#define IO_APIC_VECTOR(irq) (irq_vector[irq]) /* * Various low-level irq details needed by irq.c, process.c, From c7111c1318ee8890f385813f232fdb32643e2653 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sun, 8 Oct 2006 07:47:55 -0600 Subject: [PATCH 090/232] [PATCH] x86_64 irq: Allocate a vector across all cpus for genapic_flat. The problem we can't take advantage of lowest priority delivery mode if the vectors are allocated for only one cpu at a time. Nor can we work around hardware that assumes lowest priority delivery mode is always used with several cpus. So this patch introduces the concept of a vector_allocation_domain. A set of cpus that will receive an irq on the same vector. Currently the code for implementing this is placed in the genapic structure so we can vary this depending on how we are using the io_apics. This allows us to restore the previous behaviour of genapic_flat without removing the benefits of having separate vector allocation for large machines. This should also fix the problem report where a hyperthreaded cpu was receving the irq on the wrong hyperthread when in logical delivery mode because the previous behaviour is restored. This patch properly records our allocation of the first 16 irqs to the first 16 available vectors on all cpus. This should be fine but it may run into problems with multiple interrupts at the same interrupt level. Except for some badly maintained comments in the code and the behaviour of the interrupt allocator I have no real understanding of that problem. Signed-off-by: Eric W. Biederman Acked-by: Muli Ben-Yehuda Signed-off-by: Linus Torvalds --- arch/x86_64/kernel/genapic_cluster.c | 8 ++ arch/x86_64/kernel/genapic_flat.c | 24 +++++ arch/x86_64/kernel/io_apic.c | 133 +++++++++++++++++---------- include/asm-x86_64/genapic.h | 1 + include/asm-x86_64/mach_apic.h | 1 + 5 files changed, 118 insertions(+), 49 deletions(-) diff --git a/arch/x86_64/kernel/genapic_cluster.c b/arch/x86_64/kernel/genapic_cluster.c index cdb90e671b88..73d76308b955 100644 --- a/arch/x86_64/kernel/genapic_cluster.c +++ b/arch/x86_64/kernel/genapic_cluster.c @@ -63,6 +63,13 @@ static cpumask_t cluster_target_cpus(void) return cpumask_of_cpu(0); } +static cpumask_t cluster_vector_allocation_domain(int cpu) +{ + cpumask_t domain = CPU_MASK_NONE; + cpu_set(cpu, domain); + return domain; +} + static void cluster_send_IPI_mask(cpumask_t mask, int vector) { send_IPI_mask_sequence(mask, vector); @@ -119,6 +126,7 @@ struct genapic apic_cluster = { .int_delivery_mode = dest_Fixed, .int_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = cluster_target_cpus, + .vector_allocation_domain = cluster_vector_allocation_domain, .apic_id_registered = cluster_apic_id_registered, .init_apic_ldr = cluster_init_apic_ldr, .send_IPI_all = cluster_send_IPI_all, diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86_64/kernel/genapic_flat.c index 50ad153eaac4..0dfc223c1839 100644 --- a/arch/x86_64/kernel/genapic_flat.c +++ b/arch/x86_64/kernel/genapic_flat.c @@ -22,6 +22,20 @@ static cpumask_t flat_target_cpus(void) return cpu_online_map; } +static cpumask_t flat_vector_allocation_domain(int cpu) +{ + /* Careful. Some cpus do not strictly honor the set of cpus + * specified in the interrupt destination when using lowest + * priority interrupt delivery mode. + * + * In particular there was a hyperthreading cpu observed to + * deliver interrupts to the wrong hyperthread when only one + * hyperthread was specified in the interrupt desitination. + */ + cpumask_t domain = { { [0] = APIC_ALL_CPUS, } }; + return domain; +} + /* * Set up the logical destination ID. * @@ -121,6 +135,7 @@ struct genapic apic_flat = { .int_delivery_mode = dest_LowestPrio, .int_dest_mode = (APIC_DEST_LOGICAL != 0), .target_cpus = flat_target_cpus, + .vector_allocation_domain = flat_vector_allocation_domain, .apic_id_registered = flat_apic_id_registered, .init_apic_ldr = flat_init_apic_ldr, .send_IPI_all = flat_send_IPI_all, @@ -141,6 +156,14 @@ static cpumask_t physflat_target_cpus(void) return cpumask_of_cpu(0); } +static cpumask_t physflat_vector_allocation_domain(int cpu) +{ + cpumask_t domain = CPU_MASK_NONE; + cpu_set(cpu, domain); + return domain; +} + + static void physflat_send_IPI_mask(cpumask_t cpumask, int vector) { send_IPI_mask_sequence(cpumask, vector); @@ -179,6 +202,7 @@ struct genapic apic_physflat = { .int_delivery_mode = dest_Fixed, .int_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = physflat_target_cpus, + .vector_allocation_domain = physflat_vector_allocation_domain, .apic_id_registered = flat_apic_id_registered, .init_apic_ldr = flat_init_apic_ldr,/*not needed, but shouldn't hurt*/ .send_IPI_all = physflat_send_IPI_all, diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 9c3b9b19d699..771bcf77daf2 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c @@ -47,7 +47,7 @@ #include #include -static int assign_irq_vector(int irq, cpumask_t mask); +static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result); #define __apicdebuginit __init @@ -174,12 +174,10 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) cpus_and(mask, tmp, CPU_MASK_ALL); - vector = assign_irq_vector(irq, mask); + vector = assign_irq_vector(irq, mask, &tmp); if (vector < 0) return; - cpus_clear(tmp); - cpu_set(vector >> 8, tmp); dest = cpu_mask_to_apicid(tmp); /* @@ -188,7 +186,7 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) dest = SET_APIC_LOGICAL_ID(dest); spin_lock_irqsave(&ioapic_lock, flags); - __target_IO_APIC_irq(irq, dest, vector & 0xff); + __target_IO_APIC_irq(irq, dest, vector); set_native_irq_info(irq, mask); spin_unlock_irqrestore(&ioapic_lock, flags); } @@ -563,9 +561,45 @@ static inline int IO_APIC_irq_trigger(int irq) } /* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */ -unsigned int irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_EXTERNAL_VECTOR, 0 }; +static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { + [0] = FIRST_EXTERNAL_VECTOR + 0, + [1] = FIRST_EXTERNAL_VECTOR + 1, + [2] = FIRST_EXTERNAL_VECTOR + 2, + [3] = FIRST_EXTERNAL_VECTOR + 3, + [4] = FIRST_EXTERNAL_VECTOR + 4, + [5] = FIRST_EXTERNAL_VECTOR + 5, + [6] = FIRST_EXTERNAL_VECTOR + 6, + [7] = FIRST_EXTERNAL_VECTOR + 7, + [8] = FIRST_EXTERNAL_VECTOR + 8, + [9] = FIRST_EXTERNAL_VECTOR + 9, + [10] = FIRST_EXTERNAL_VECTOR + 10, + [11] = FIRST_EXTERNAL_VECTOR + 11, + [12] = FIRST_EXTERNAL_VECTOR + 12, + [13] = FIRST_EXTERNAL_VECTOR + 13, + [14] = FIRST_EXTERNAL_VECTOR + 14, + [15] = FIRST_EXTERNAL_VECTOR + 15, +}; -static int __assign_irq_vector(int irq, cpumask_t mask) +static cpumask_t irq_domain[NR_IRQ_VECTORS] __read_mostly = { + [0] = CPU_MASK_ALL, + [1] = CPU_MASK_ALL, + [2] = CPU_MASK_ALL, + [3] = CPU_MASK_ALL, + [4] = CPU_MASK_ALL, + [5] = CPU_MASK_ALL, + [6] = CPU_MASK_ALL, + [7] = CPU_MASK_ALL, + [8] = CPU_MASK_ALL, + [9] = CPU_MASK_ALL, + [10] = CPU_MASK_ALL, + [11] = CPU_MASK_ALL, + [12] = CPU_MASK_ALL, + [13] = CPU_MASK_ALL, + [14] = CPU_MASK_ALL, + [15] = CPU_MASK_ALL, +}; + +static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result) { /* * NOTE! The local APIC isn't very good at handling @@ -589,14 +623,22 @@ static int __assign_irq_vector(int irq, cpumask_t mask) if (irq_vector[irq] > 0) old_vector = irq_vector[irq]; - if ((old_vector > 0) && cpu_isset(old_vector >> 8, mask)) { - return old_vector; + if (old_vector > 0) { + cpus_and(*result, irq_domain[irq], mask); + if (!cpus_empty(*result)) + return old_vector; } for_each_cpu_mask(cpu, mask) { + cpumask_t domain; + int first, new_cpu; int vector, offset; - vector = pos[cpu].vector; - offset = pos[cpu].offset; + + domain = vector_allocation_domain(cpu); + first = first_cpu(domain); + + vector = pos[first].vector; + offset = pos[first].offset; next: vector += 8; if (vector >= FIRST_SYSTEM_VECTOR) { @@ -604,35 +646,40 @@ next: offset = (offset + 1) % 8; vector = FIRST_DEVICE_VECTOR + offset; } - if (unlikely(pos[cpu].vector == vector)) + if (unlikely(pos[first].vector == vector)) continue; if (vector == IA32_SYSCALL_VECTOR) goto next; - if (per_cpu(vector_irq, cpu)[vector] != -1) - goto next; + for_each_cpu_mask(new_cpu, domain) + if (per_cpu(vector_irq, cpu)[vector] != -1) + goto next; /* Found one! */ - pos[cpu].vector = vector; - pos[cpu].offset = offset; - if (old_vector >= 0) { - int old_cpu = old_vector >> 8; - old_vector &= 0xff; - per_cpu(vector_irq, old_cpu)[old_vector] = -1; + for_each_cpu_mask(new_cpu, domain) { + pos[cpu].vector = vector; + pos[cpu].offset = offset; } - per_cpu(vector_irq, cpu)[vector] = irq; - vector |= cpu << 8; + if (old_vector >= 0) { + int old_cpu; + for_each_cpu_mask(old_cpu, domain) + per_cpu(vector_irq, old_cpu)[old_vector] = -1; + } + for_each_cpu_mask(new_cpu, domain) + per_cpu(vector_irq, new_cpu)[vector] = irq; irq_vector[irq] = vector; + irq_domain[irq] = domain; + cpus_and(*result, domain, mask); return vector; } return -ENOSPC; } -static int assign_irq_vector(int irq, cpumask_t mask) +static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result) { int vector; unsigned long flags; spin_lock_irqsave(&vector_lock, flags); - vector = __assign_irq_vector(irq, mask); + vector = __assign_irq_vector(irq, mask, result); spin_unlock_irqrestore(&vector_lock, flags); return vector; } @@ -704,14 +751,12 @@ static void __init setup_IO_APIC_irqs(void) if (IO_APIC_IRQ(irq)) { cpumask_t mask; - vector = assign_irq_vector(irq, TARGET_CPUS); + vector = assign_irq_vector(irq, TARGET_CPUS, &mask); if (vector < 0) continue; - cpus_clear(mask); - cpu_set(vector >> 8, mask); entry.dest.logical.logical_dest = cpu_mask_to_apicid(mask); - entry.vector = vector & 0xff; + entry.vector = vector; ioapic_register_intr(irq, vector, IOAPIC_AUTO); if (!apic && (irq < 16)) @@ -1430,12 +1475,13 @@ static inline void check_timer(void) { int apic1, pin1, apic2, pin2; int vector; + cpumask_t mask; /* * get/set the timer IRQ vector: */ disable_8259A_irq(0); - vector = assign_irq_vector(0, TARGET_CPUS); + vector = assign_irq_vector(0, TARGET_CPUS, &mask); /* * Subtle, code in do_timer_interrupt() expects an AEOI @@ -1667,6 +1713,7 @@ int create_irq(void) int new; int vector = 0; unsigned long flags; + cpumask_t mask; irq = -ENOSPC; spin_lock_irqsave(&vector_lock, flags); @@ -1675,7 +1722,7 @@ int create_irq(void) continue; if (irq_vector[new] != 0) continue; - vector = __assign_irq_vector(new, TARGET_CPUS); + vector = __assign_irq_vector(new, TARGET_CPUS, &mask); if (likely(vector > 0)) irq = new; break; @@ -1707,13 +1754,10 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms { int vector; unsigned dest; + cpumask_t tmp; - vector = assign_irq_vector(irq, TARGET_CPUS); + vector = assign_irq_vector(irq, TARGET_CPUS, &tmp); if (vector >= 0) { - cpumask_t tmp; - - cpus_clear(tmp); - cpu_set(vector >> 8, tmp); dest = cpu_mask_to_apicid(tmp); msg->address_hi = MSI_ADDR_BASE_HI; @@ -1752,12 +1796,10 @@ static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask) cpus_and(mask, tmp, CPU_MASK_ALL); - vector = assign_irq_vector(irq, mask); + vector = assign_irq_vector(irq, mask, &tmp); if (vector < 0) return; - cpus_clear(tmp); - cpu_set(vector >> 8, tmp); dest = cpu_mask_to_apicid(tmp); read_msi_msg(irq, &msg); @@ -1844,12 +1886,10 @@ static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) cpus_and(mask, tmp, CPU_MASK_ALL); - vector = assign_irq_vector(irq, mask); + vector = assign_irq_vector(irq, mask, &tmp); if (vector < 0) return; - cpus_clear(tmp); - cpu_set(vector >> 8, tmp); dest = cpu_mask_to_apicid(tmp); target_ht_irq(irq, dest, vector & 0xff); @@ -1871,15 +1911,13 @@ static struct hw_interrupt_type ht_irq_chip = { int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) { int vector; + cpumask_t tmp; - vector = assign_irq_vector(irq, TARGET_CPUS); + vector = assign_irq_vector(irq, TARGET_CPUS, &tmp); if (vector >= 0) { u32 low, high; unsigned dest; - cpumask_t tmp; - cpus_clear(tmp); - cpu_set(vector >> 8, tmp); dest = cpu_mask_to_apicid(tmp); high = HT_IRQ_HIGH_DEST_ID(dest); @@ -1945,13 +1983,10 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int p add_pin_to_irq(irq, ioapic, pin); - vector = assign_irq_vector(irq, TARGET_CPUS); + vector = assign_irq_vector(irq, TARGET_CPUS, &mask); if (vector < 0) return vector; - cpus_clear(mask); - cpu_set(vector >> 8, mask); - /* * Generate a PCI IRQ routing entry and program the IOAPIC accordingly. * Note that we mask (disable) IRQs now -- these get enabled when the diff --git a/include/asm-x86_64/genapic.h b/include/asm-x86_64/genapic.h index 81e714665344..a0e9a4b93484 100644 --- a/include/asm-x86_64/genapic.h +++ b/include/asm-x86_64/genapic.h @@ -18,6 +18,7 @@ struct genapic { u32 int_dest_mode; int (*apic_id_registered)(void); cpumask_t (*target_cpus)(void); + cpumask_t (*vector_allocation_domain)(int cpu); void (*init_apic_ldr)(void); /* ipi */ void (*send_IPI_mask)(cpumask_t mask, int vector); diff --git a/include/asm-x86_64/mach_apic.h b/include/asm-x86_64/mach_apic.h index d33422450c00..7b7115a0c1c9 100644 --- a/include/asm-x86_64/mach_apic.h +++ b/include/asm-x86_64/mach_apic.h @@ -17,6 +17,7 @@ #define INT_DELIVERY_MODE (genapic->int_delivery_mode) #define INT_DEST_MODE (genapic->int_dest_mode) #define TARGET_CPUS (genapic->target_cpus()) +#define vector_allocation_domain (genapic->vector_allocation_domain) #define apic_id_registered (genapic->apic_id_registered) #define init_apic_ldr (genapic->init_apic_ldr) #define send_IPI_mask (genapic->send_IPI_mask) From 0d84438d98777b0f9425d39121c42f47a06878ca Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:30:44 +0100 Subject: [PATCH 091/232] [PATCH] sparc32 pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/sparc/kernel/irq.c | 23 +++++++++++++++-------- arch/sparc/kernel/pcic.c | 4 ++-- arch/sparc/kernel/sun4c_irq.c | 2 +- arch/sparc/kernel/sun4d_irq.c | 12 ++++++++---- arch/sparc/kernel/sun4d_smp.c | 6 +++++- arch/sparc/kernel/sun4m_irq.c | 2 +- arch/sparc/kernel/sun4m_smp.c | 7 ++++++- arch/sparc/kernel/tick14.c | 2 +- arch/sparc/kernel/time.c | 7 ++++--- drivers/parport/parport_sunbpp.c | 2 +- include/asm-sparc/floppy.h | 2 +- include/asm-sparc/irq.h | 6 +++--- include/asm-sparc/irq_regs.h | 1 + 13 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 include/asm-sparc/irq_regs.h diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c index 72f0201051a0..ae4dfc89ca52 100644 --- a/arch/sparc/kernel/irq.c +++ b/arch/sparc/kernel/irq.c @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef CONFIG_SMP #define SMP_NOP2 "nop; nop;\n\t" @@ -133,8 +134,8 @@ static void irq_panic(void) prom_halt(); } -void (*sparc_init_timers)(irqreturn_t (*)(int, void *,struct pt_regs *)) = - (void (*)(irqreturn_t (*)(int, void *,struct pt_regs *))) irq_panic; +void (*sparc_init_timers)(irqreturn_t (*)(int, void *)) = + (void (*)(irqreturn_t (*)(int, void *))) irq_panic; /* * Dave Redman (djhr@tadpole.co.uk) @@ -319,12 +320,14 @@ void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs) void handler_irq(int irq, struct pt_regs * regs) { + struct pt_regs *old_regs; struct irqaction * action; int cpu = smp_processor_id(); #ifdef CONFIG_SMP extern void smp4m_irq_rotate(int cpu); #endif + old_regs = set_irq_regs(regs); irq_enter(); disable_pil_irq(irq); #ifdef CONFIG_SMP @@ -338,27 +341,31 @@ void handler_irq(int irq, struct pt_regs * regs) do { if (!action || !action->handler) unexpected_irq(irq, NULL, regs); - action->handler(irq, action->dev_id, regs); + action->handler(irq, action->dev_id); action = action->next; } while (action); sparc_irq[irq].flags &= ~SPARC_IRQ_INPROGRESS; enable_pil_irq(irq); irq_exit(); + set_irq_regs(old_regs); } #ifdef CONFIG_BLK_DEV_FD -extern void floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs); +extern void floppy_interrupt(int irq, void *dev_id) void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) { + struct pt_regs *old_regs; int cpu = smp_processor_id(); + old_regs = set_irq_regs(regs); disable_pil_irq(irq); irq_enter(); kstat_cpu(cpu).irqs[irq]++; - floppy_interrupt(irq, dev_id, regs); + floppy_interrupt(irq, dev_id); irq_exit(); enable_pil_irq(irq); + set_irq_regs(old_regs); // XXX Eek, it's totally changed with preempt_count() and such // if (softirq_pending(cpu)) // do_softirq(); @@ -369,7 +376,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) * thus no sharing possible. */ int request_fast_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *), unsigned long irqflags, const char *devname) { struct irqaction *action; @@ -468,7 +475,7 @@ out: } int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *), unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction * action, **actionp; @@ -478,7 +485,7 @@ int request_irq(unsigned int irq, if (sparc_cpu_model == sun4d) { extern int sun4d_request_irq(unsigned int, - irqreturn_t (*)(int, void *, struct pt_regs *), + irqreturn_t (*)(int, void *), unsigned long, const char *, void *); return sun4d_request_irq(irq, handler, irqflags, devname, dev_id); } diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index edb6cc665f56..b4e50ae323bf 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -708,13 +708,13 @@ static void pcic_clear_clock_irq(void) pcic_timer_dummy = readl(pcic0.pcic_regs+PCI_SYS_LIMIT); } -static irqreturn_t pcic_timer_handler (int irq, void *h, struct pt_regs *regs) +static irqreturn_t pcic_timer_handler (int irq, void *h) { write_seqlock(&xtime_lock); /* Dummy, to show that we remember */ pcic_clear_clock_irq(); do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif write_sequnlock(&xtime_lock); return IRQ_HANDLED; diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c index 4be2c86ea540..2eaa0d085e19 100644 --- a/arch/sparc/kernel/sun4c_irq.c +++ b/arch/sparc/kernel/sun4c_irq.c @@ -154,7 +154,7 @@ static void sun4c_load_profile_irq(int cpu, unsigned int limit) /* Errm.. not sure how to do this.. */ } -static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *)) +static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *)) { int irq; diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index 74eed9775ac0..836d1562787a 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c @@ -38,6 +38,7 @@ #include #include #include +#include /* If you trust current SCSI layer to handle different SCSI IRQs, enable this. I don't trust it... -jj */ /* #define DISTRIBUTE_IRQS */ @@ -198,6 +199,7 @@ extern void unexpected_irq(int, void *, struct pt_regs *); void sun4d_handler_irq(int irq, struct pt_regs * regs) { + struct pt_regs *old_regs; struct irqaction * action; int cpu = smp_processor_id(); /* SBUS IRQ level (1 - 7) */ @@ -208,6 +210,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs) cc_set_iclr(1 << irq); + old_regs = set_irq_regs(regs); irq_enter(); kstat_cpu(cpu).irqs[irq]++; if (!sbusl) { @@ -215,7 +218,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs) if (!action) unexpected_irq(irq, NULL, regs); do { - action->handler(irq, action->dev_id, regs); + action->handler(irq, action->dev_id); action = action->next; } while (action); } else { @@ -242,7 +245,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs) if (!action) unexpected_irq(irq, NULL, regs); do { - action->handler(irq, action->dev_id, regs); + action->handler(irq, action->dev_id); action = action->next; } while (action); release_sbi(SBI2DEVID(sbino), slot); @@ -250,6 +253,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs) } } irq_exit(); + set_irq_regs(old_regs); } unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq) @@ -272,7 +276,7 @@ unsigned int sun4d_sbint_to_irq(struct sbus_dev *sdev, unsigned int sbint) } int sun4d_request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *), unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction *action, *tmp = NULL, **actionp; @@ -466,7 +470,7 @@ static void sun4d_load_profile_irq(int cpu, unsigned int limit) bw_set_prof_limit(cpu, limit); } -static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *)) +static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *)) { int irq; int cpu; diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index 3ff4edd32815..c80ea61e8ba0 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -369,10 +370,12 @@ void smp4d_message_pass(int target, int msg, unsigned long data, int wait) void smp4d_percpu_timer_interrupt(struct pt_regs *regs) { + struct pt_regs *old_regs; int cpu = hard_smp4d_processor_id(); static int cpu_tick[NR_CPUS]; static char led_mask[] = { 0xe, 0xd, 0xb, 0x7, 0xb, 0xd }; + old_regs = set_irq_regs(regs); bw_get_prof_limit(cpu); bw_clear_intr_mask(0, 1); /* INTR_TABLE[0] & 1 is Profile IRQ */ @@ -384,7 +387,7 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs) show_leds(cpu); } - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); if(!--prof_counter(cpu)) { int user = user_mode(regs); @@ -395,6 +398,7 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs) prof_counter(cpu) = prof_multiplier(cpu); } + set_irq_regs(old_regs); } extern unsigned int lvl14_resolution; diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 7cefa301efea..28bcf8e2c5b3 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c @@ -228,7 +228,7 @@ static void sun4m_load_profile_irq(int cpu, unsigned int limit) sun4m_timers->cpu_timers[cpu].l14_timer_limit = limit; } -static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *)) +static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *)) { int reg_count, irq, cpu; struct linux_prom_registers cnt_regs[PROMREG_MAX]; diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 7d4a649138f6..e2d9c018bd56 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -353,11 +354,14 @@ void smp4m_cross_call_irq(void) void smp4m_percpu_timer_interrupt(struct pt_regs *regs) { + struct pt_regs *old_regs; int cpu = smp_processor_id(); + old_regs = set_irq_regs(regs); + clear_profile_irq(cpu); - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); if(!--prof_counter(cpu)) { int user = user_mode(regs); @@ -368,6 +372,7 @@ void smp4m_percpu_timer_interrupt(struct pt_regs *regs) prof_counter(cpu) = prof_multiplier(cpu); } + set_irq_regs(old_regs); } extern unsigned int lvl14_resolution; diff --git a/arch/sparc/kernel/tick14.c b/arch/sparc/kernel/tick14.c index d3b4daac705f..7107d2f0625d 100644 --- a/arch/sparc/kernel/tick14.c +++ b/arch/sparc/kernel/tick14.c @@ -55,7 +55,7 @@ void install_obp_ticker(void) linux_lvl14[3] = obp_lvl14[3]; } -void claim_ticker14(irqreturn_t (*handler)(int, void *, struct pt_regs *), +void claim_ticker14(irqreturn_t (*handler)(int, void *), int irq_nr, unsigned int timeout ) { int cpu = smp_processor_id(); diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index e10dc831944d..7dcd1a16c6e4 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c @@ -42,6 +42,7 @@ #include #include #include +#include DEFINE_SPINLOCK(rtc_lock); enum sparc_clock_type sp_clock_typ; @@ -104,13 +105,13 @@ __volatile__ unsigned int *master_l10_limit; #define TICK_SIZE (tick_nsec / 1000) -irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) +irqreturn_t timer_interrupt(int irq, void *dev_id) { /* last time the cmos clock got updated */ static long last_rtc_update; #ifndef CONFIG_SMP - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); #endif /* Protect counter clear so that do_gettimeoffset works */ @@ -128,7 +129,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c index d758c90c86af..9793533276ec 100644 --- a/drivers/parport/parport_sunbpp.c +++ b/drivers/parport/parport_sunbpp.c @@ -48,7 +48,7 @@ static irqreturn_t parport_sunbpp_interrupt(int irq, void *dev_id) { - parport_generic_irq(irq, (struct parport *) dev_id, regs); + parport_generic_irq(irq, (struct parport *) dev_id); return IRQ_HANDLED; } diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h index c53b332c850a..9073c84218ce 100644 --- a/include/asm-sparc/floppy.h +++ b/include/asm-sparc/floppy.h @@ -262,7 +262,7 @@ static __inline__ void sun_fd_enable_dma(void) } /* Our low-level entry point in arch/sparc/kernel/entry.S */ -irqreturn_t floppy_hardint(int irq, void *unused, struct pt_regs *regs); +irqreturn_t floppy_hardint(int irq, void *unused); static int sun_fd_request_irq(void) { diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h index 3141ddfea97d..70867330f422 100644 --- a/include/asm-sparc/irq.h +++ b/include/asm-sparc/irq.h @@ -76,8 +76,8 @@ static inline void load_profile_irq(int cpu, int limit) BTFIXUP_CALL(load_profile_irq)(cpu, limit); } -extern void (*sparc_init_timers)(irqreturn_t (*lvl10_irq)(int, void *, struct pt_regs *)); -extern void claim_ticker14(irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), +extern void (*sparc_init_timers)(irqreturn_t (*lvl10_irq)(int, void *)); +extern void claim_ticker14(irqreturn_t (*irq_handler)(int, void *), int irq, unsigned int timeout); @@ -91,7 +91,7 @@ BTFIXUPDEF_CALL(void, set_irq_udt, int) #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) #endif -extern int request_fast_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, __const__ char *devname); +extern int request_fast_irq(unsigned int irq, irqreturn_t (*handler)(int, void *), unsigned long flags, __const__ char *devname); /* On the sun4m, just like the timers, we have both per-cpu and master * interrupt registers. diff --git a/include/asm-sparc/irq_regs.h b/include/asm-sparc/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-sparc/irq_regs.h @@ -0,0 +1 @@ +#include From 6d24c8dc2e656b02807aa0506405727d34c0376c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 08:23:28 -0400 Subject: [PATCH 092/232] [PATCH] sparc64 pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/sparc64/kernel/ebus.c | 2 +- arch/sparc64/kernel/irq.c | 5 ++++- arch/sparc64/kernel/pci_psycho.c | 6 +++--- arch/sparc64/kernel/pci_sabre.c | 6 +++--- arch/sparc64/kernel/pci_schizo.c | 8 ++++---- arch/sparc64/kernel/power.c | 2 +- arch/sparc64/kernel/sbus.c | 6 +++--- arch/sparc64/kernel/smp.c | 6 +++++- include/asm-sparc64/floppy.h | 8 ++++---- include/asm-sparc64/irq_regs.h | 1 + 10 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 include/asm-sparc64/irq_regs.h diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index 8a9b470e1b65..2df25c2b4071 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c @@ -79,7 +79,7 @@ static void __ebus_dma_reset(struct ebus_dma_info *p, int no_drain) } } -static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ebus_dma_irq(int irq, void *dev_id) { struct ebus_dma_info *p = dev_id; unsigned long flags; diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index 4e64724cb9ae..ce05deb1bc92 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c @@ -547,9 +547,11 @@ void timer_irq(int irq, struct pt_regs *regs) void handler_irq(int irq, struct pt_regs *regs) { struct ino_bucket *bucket; + struct pt_regs *old_regs; clear_softint(1 << irq); + old_regs = set_irq_regs(regs); irq_enter(); /* Sliiiick... */ @@ -558,12 +560,13 @@ void handler_irq(int irq, struct pt_regs *regs) struct ino_bucket *next = __bucket(bucket->irq_chain); bucket->irq_chain = 0; - __do_IRQ(bucket->virt_irq, regs); + __do_IRQ(bucket->virt_irq); bucket = next; } irq_exit(); + set_irq_regs(old_regs); } struct sun5_timer { diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index 1ec0aab68c08..fda5db223d96 100644 --- a/arch/sparc64/kernel/pci_psycho.c +++ b/arch/sparc64/kernel/pci_psycho.c @@ -533,7 +533,7 @@ static void psycho_check_iommu_error(struct pci_controller_info *p, #define PSYCHO_UEAFSR_RESV2 0x00000000007fffffUL /* Reserved */ #define PSYCHO_UE_AFAR 0x0038UL -static irqreturn_t psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t psycho_ue_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->pbm_A.controller_regs + PSYCHO_UE_AFSR; @@ -610,7 +610,7 @@ static irqreturn_t psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs) #define PSYCHO_CEAFSR_RESV2 0x00000000007fffffUL /* Reserved */ #define PSYCHO_CE_AFAR 0x0040UL -static irqreturn_t psycho_ce_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t psycho_ce_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->pbm_A.controller_regs + PSYCHO_CE_AFSR; @@ -735,7 +735,7 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm, int is_pbm return ret; } -static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) { struct pci_pbm_info *pbm = dev_id; struct pci_controller_info *p = pbm->parent; diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index 45891850b90d..6ec569828c29 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c @@ -574,7 +574,7 @@ static void sabre_check_iommu_error(struct pci_controller_info *p, spin_unlock_irqrestore(&iommu->lock, flags); } -static irqreturn_t sabre_ue_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sabre_ue_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->pbm_A.controller_regs + SABRE_UE_AFSR; @@ -634,7 +634,7 @@ static irqreturn_t sabre_ue_intr(int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -static irqreturn_t sabre_ce_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sabre_ce_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->pbm_A.controller_regs + SABRE_CE_AFSR; @@ -726,7 +726,7 @@ static irqreturn_t sabre_pcierr_intr_other(struct pci_controller_info *p) return ret; } -static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg, afar_reg; diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c index 75ade83ecc65..66911b126aed 100644 --- a/arch/sparc64/kernel/pci_schizo.c +++ b/arch/sparc64/kernel/pci_schizo.c @@ -515,7 +515,7 @@ static void schizo_check_iommu_error(struct pci_controller_info *p, #define SCHIZO_UEAFSR_MTAG 0x000000000000e000UL /* Safari */ #define SCHIZO_UEAFSR_ECCSYND 0x00000000000001ffUL /* Safari */ -static irqreturn_t schizo_ue_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_ue_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->pbm_B.controller_regs + SCHIZO_UE_AFSR; @@ -603,7 +603,7 @@ static irqreturn_t schizo_ue_intr(int irq, void *dev_id, struct pt_regs *regs) #define SCHIZO_CEAFSR_MTAG 0x000000000000e000UL #define SCHIZO_CEAFSR_ECCSYND 0x00000000000001ffUL -static irqreturn_t schizo_ce_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_ce_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->pbm_B.controller_regs + SCHIZO_CE_AFSR; @@ -778,7 +778,7 @@ static irqreturn_t schizo_pcierr_intr_other(struct pci_pbm_info *pbm) return ret; } -static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id) { struct pci_pbm_info *pbm = dev_id; struct pci_controller_info *p = pbm->parent; @@ -933,7 +933,7 @@ static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id, struct pt_regs *reg /* We only expect UNMAP errors here. The rest of the Safari errors * are marked fatal and thus cause a system reset. */ -static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id) { struct pci_controller_info *p = dev_id; u64 errlog; diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c index 0b9c70627ce4..699b24b890df 100644 --- a/arch/sparc64/kernel/power.c +++ b/arch/sparc64/kernel/power.c @@ -35,7 +35,7 @@ static void __iomem *power_reg; static DECLARE_WAIT_QUEUE_HEAD(powerd_wait); static int button_pressed; -static irqreturn_t power_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t power_handler(int irq, void *dev_id) { if (button_pressed == 0) { button_pressed = 1; diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c index c49a57795743..01d6d869ea2b 100644 --- a/arch/sparc64/kernel/sbus.c +++ b/arch/sparc64/kernel/sbus.c @@ -839,7 +839,7 @@ unsigned int sbus_build_irq(void *buscookie, unsigned int ino) #define SYSIO_UEAFSR_SIZE 0x00001c0000000000UL /* Bad transfer size 2^SIZE */ #define SYSIO_UEAFSR_MID 0x000003e000000000UL /* UPA MID causing the fault */ #define SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */ -static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sysio_ue_handler(int irq, void *dev_id) { struct sbus_bus *sbus = dev_id; struct sbus_iommu *iommu = sbus->iommu; @@ -911,7 +911,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs) #define SYSIO_CEAFSR_SIZE 0x00001c0000000000UL /* Bad transfer size 2^SIZE */ #define SYSIO_CEAFSR_MID 0x000003e000000000UL /* UPA MID causing the fault */ #define SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */ -static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sysio_ce_handler(int irq, void *dev_id) { struct sbus_bus *sbus = dev_id; struct sbus_iommu *iommu = sbus->iommu; @@ -988,7 +988,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs) #define SYSIO_SBAFSR_SIZE 0x00001c0000000000UL /* Size of transfer */ #define SYSIO_SBAFSR_MID 0x000003e000000000UL /* MID causing the error */ #define SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved */ -static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id) { struct sbus_bus *sbus = dev_id; struct sbus_iommu *iommu = sbus->iommu; diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index f62bf3a2de1a..cc09d8266414 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -1187,6 +1188,7 @@ void smp_percpu_timer_interrupt(struct pt_regs *regs) unsigned long compare, tick, pstate; int cpu = smp_processor_id(); int user = user_mode(regs); + struct pt_regs *old_regs; /* * Check for level 14 softint. @@ -1203,8 +1205,9 @@ void smp_percpu_timer_interrupt(struct pt_regs *regs) clear_softint(tick_mask); } + old_regs = set_irq_regs(regs); do { - profile_tick(CPU_PROFILING, regs); + profile_tick(CPU_PROFILING); if (!--prof_counter(cpu)) { irq_enter(); @@ -1236,6 +1239,7 @@ void smp_percpu_timer_interrupt(struct pt_regs *regs) : /* no outputs */ : "r" (pstate)); } while (time_after_eq(tick, compare)); + set_irq_regs(old_regs); } static void __init smp_setup_percpu_timer(void) diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index abf150038019..dbe033e494db 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -208,7 +208,7 @@ static void sun_fd_enable_dma(void) pdma_areasize = pdma_size; } -irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs) +irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie) { if (likely(doing_pdma)) { void __iomem *stat = (void __iomem *) fdc_status; @@ -255,7 +255,7 @@ irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs) } main_interrupt: - return floppy_interrupt(irq, dev_cookie, regs); + return floppy_interrupt(irq, dev_cookie); } static int sun_fd_request_irq(void) @@ -311,7 +311,7 @@ struct sun_pci_dma_op { static struct sun_pci_dma_op sun_pci_dma_current = { -1U, 0, 0, NULL}; static struct sun_pci_dma_op sun_pci_dma_pending = { -1U, 0, 0, NULL}; -extern irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t floppy_interrupt(int irq, void *dev_id); static unsigned char sun_pci_fd_inb(unsigned long port) { @@ -446,7 +446,7 @@ static int sun_pci_fd_eject(int drive) void sun_pci_fd_dma_callback(struct ebus_dma_info *p, int event, void *cookie) { - floppy_interrupt(0, NULL, NULL); + floppy_interrupt(0, NULL); } /* diff --git a/include/asm-sparc64/irq_regs.h b/include/asm-sparc64/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-sparc64/irq_regs.h @@ -0,0 +1 @@ +#include From 7a39f52202a70ff6834e37053e2ee55c7d351621 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:32:15 +0100 Subject: [PATCH 093/232] [PATCH] sparc32 rwlock fix read_trylock() is broken on sparc32 (doesn't build and didn't work right, actually). Proposed fix: - make "writer holds lock" distinguishable from "reader tries to grab lock" - have __raw_read_trylock() try to acquire the mutex (in LSB of lock), terminating spin if we see that there's writer holding it. Then do the rest as we do in read_lock(). Thanks to Ingo for discussion... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/sparc/kernel/sparc_ksyms.c | 4 +++- arch/sparc/lib/locks.S | 20 ++++++++++++++++++++ include/asm-sparc/spinlock.h | 28 +++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 4d441a554d35..33dadd9f2871 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c @@ -87,6 +87,7 @@ extern void ___set_bit(void); extern void ___clear_bit(void); extern void ___change_bit(void); extern void ___rw_read_enter(void); +extern void ___rw_read_try(void); extern void ___rw_read_exit(void); extern void ___rw_write_enter(void); @@ -104,8 +105,9 @@ extern unsigned _Urem(unsigned, unsigned); EXPORT_SYMBOL(sparc_cpu_model); EXPORT_SYMBOL(kernel_thread); #ifdef CONFIG_SMP -// XXX find what uses (or used) these. +// XXX find what uses (or used) these. AV: see asm/spinlock.h EXPORT_SYMBOL(___rw_read_enter); +EXPORT_SYMBOL(___rw_read_try); EXPORT_SYMBOL(___rw_read_exit); EXPORT_SYMBOL(___rw_write_enter); #endif diff --git a/arch/sparc/lib/locks.S b/arch/sparc/lib/locks.S index 95fa48424967..b1df55cb2215 100644 --- a/arch/sparc/lib/locks.S +++ b/arch/sparc/lib/locks.S @@ -25,6 +25,15 @@ ___rw_read_enter_spin_on_wlock: ldstub [%g1 + 3], %g2 b ___rw_read_enter_spin_on_wlock ldub [%g1 + 3], %g2 +___rw_read_try_spin_on_wlock: + andcc %g2, 0xff, %g0 + be,a ___rw_read_try + ldstub [%g1 + 3], %g2 + xnorcc %g2, 0x0, %o0 /* if g2 is ~0, set o0 to 0 and bugger off */ + bne,a ___rw_read_enter_spin_on_wlock + ld [%g1], %g2 + retl + mov %g4, %o7 ___rw_read_exit_spin_on_wlock: orcc %g2, 0x0, %g0 be,a ___rw_read_exit @@ -60,6 +69,17 @@ ___rw_read_exit: retl mov %g4, %o7 + .globl ___rw_read_try +___rw_read_try: + orcc %g2, 0x0, %g0 + bne ___rw_read_try_spin_on_wlock + ld [%g1], %g2 + add %g2, 1, %g2 + st %g2, [%g1] + set 1, %o1 + retl + mov %g4, %o7 + .globl ___rw_write_enter ___rw_write_enter: orcc %g2, 0x0, %g0 diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h index 557d08959d2f..de2249b267c6 100644 --- a/include/asm-sparc/spinlock.h +++ b/include/asm-sparc/spinlock.h @@ -129,6 +129,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) : /* no outputs */ : "r" (lp) : "g2", "g4", "memory", "cc"); + *(volatile __u32 *)&lp->lock = ~0U; } static inline int __raw_write_trylock(raw_rwlock_t *rw) @@ -144,15 +145,40 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) val = rw->lock & ~0xff; if (val) ((volatile u8*)&rw->lock)[3] = 0; + else + *(volatile u32*)&rw->lock = ~0U; } return (val == 0); } +static inline int __read_trylock(raw_rwlock_t *rw) +{ + register raw_rwlock_t *lp asm("g1"); + register int res asm("o0"); + lp = rw; + __asm__ __volatile__( + "mov %%o7, %%g4\n\t" + "call ___rw_read_try\n\t" + " ldstub [%%g1 + 3], %%g2\n" + : "=r" (res) + : "r" (lp) + : "g2", "g4", "memory", "cc"); + return res; +} + +#define __raw_read_trylock(lock) \ +({ unsigned long flags; \ + int res; \ + local_irq_save(flags); \ + res = __read_trylock(lock); \ + local_irq_restore(flags); \ + res; \ +}) + #define __raw_write_unlock(rw) do { (rw)->lock = 0; } while(0) #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) -#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) #define _raw_spin_relax(lock) cpu_relax() #define _raw_read_relax(lock) cpu_relax() From 8dab42a96781a1100a6b5cc6a66953fc51c30bc1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:33:33 +0100 Subject: [PATCH 094/232] [PATCH] m68k pt_regs fixes, part 2 Fallout from previous patch: - actually add include/asm-m68k/irq_regs.h - missed the prototype of sun3_sched_init() NB: git diff without argumentgs sucks when you've added some files... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/m68k/sun3/config.c | 2 +- include/asm-m68k/irq_regs.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 include/asm-m68k/irq_regs.h diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index db930f9070ef..43e4aa3f404a 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -35,7 +35,7 @@ extern char _text, _end; char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; extern unsigned long sun3_gettimeoffset(void); -extern void sun3_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); +extern void sun3_sched_init(irqreturn_t (*handler)(int, void *)); extern void sun3_get_model (char* model); extern void idprom_init (void); extern int sun3_hwclk(int set, struct rtc_time *t); diff --git a/include/asm-m68k/irq_regs.h b/include/asm-m68k/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-m68k/irq_regs.h @@ -0,0 +1 @@ +#include From 7ca56053b29633ef08b14e5ca16c663363edac36 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:36:08 +0100 Subject: [PATCH 095/232] [PATCH] alpha pt_regs cleanups: device_interrupt callers of ->device_interrupt() do set_irq_regs() now; pt_regs argument removed, remaining uses of regs in instances of ->device_interrupt() are switched to get_irq_regs() and will be gone in the next patch. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/alpha/kernel/irq_alpha.c | 5 ++++- arch/alpha/kernel/irq_i8259.c | 4 ++-- arch/alpha/kernel/irq_impl.h | 6 +++--- arch/alpha/kernel/irq_pyxis.c | 6 +++--- arch/alpha/kernel/irq_srm.c | 4 ++-- arch/alpha/kernel/sys_alcor.c | 6 +++--- arch/alpha/kernel/sys_cabriolet.c | 16 ++++++++-------- arch/alpha/kernel/sys_dp264.c | 14 +++++++------- arch/alpha/kernel/sys_eb64p.c | 6 +++--- arch/alpha/kernel/sys_eiger.c | 16 ++++++++-------- arch/alpha/kernel/sys_jensen.c | 6 +++--- arch/alpha/kernel/sys_marvel.c | 4 ++-- arch/alpha/kernel/sys_miata.c | 4 ++-- arch/alpha/kernel/sys_mikasa.c | 6 +++--- arch/alpha/kernel/sys_noritake.c | 10 +++++----- arch/alpha/kernel/sys_rawhide.c | 4 ++-- arch/alpha/kernel/sys_rx164.c | 6 +++--- arch/alpha/kernel/sys_sable.c | 4 ++-- arch/alpha/kernel/sys_takara.c | 16 ++++++++-------- arch/alpha/kernel/sys_titan.c | 11 +++++++---- arch/alpha/kernel/sys_wildfire.c | 4 ++-- include/asm-alpha/machvec.h | 2 +- 22 files changed, 83 insertions(+), 77 deletions(-) diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c index ddf5cf8dcb0b..d14cc423aa48 100644 --- a/arch/alpha/kernel/irq_alpha.c +++ b/arch/alpha/kernel/irq_alpha.c @@ -39,6 +39,7 @@ asmlinkage void do_entInt(unsigned long type, unsigned long vector, unsigned long la_ptr, struct pt_regs *regs) { + struct pt_regs *old_regs; switch (type) { case 0: #ifdef CONFIG_SMP @@ -72,7 +73,9 @@ do_entInt(unsigned long type, unsigned long vector, alpha_mv.machine_check(vector, la_ptr, regs); return; case 3: - alpha_mv.device_interrupt(vector, regs); + old_regs = set_irq_regs(regs); + alpha_mv.device_interrupt(vector); + set_irq_regs(old_regs); return; case 4: perf_irq(la_ptr, regs); diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c index ebbadbc0c36a..6c70f8b97b72 100644 --- a/arch/alpha/kernel/irq_i8259.c +++ b/arch/alpha/kernel/irq_i8259.c @@ -137,7 +137,7 @@ init_i8259a_irqs(void) #if defined(IACK_SC) void -isa_device_interrupt(unsigned long vector, struct pt_regs *regs) +isa_device_interrupt(unsigned long vector) { /* * Generate a PCI interrupt acknowledge cycle. The PIC will @@ -147,7 +147,7 @@ isa_device_interrupt(unsigned long vector, struct pt_regs *regs) */ int j = *(vuip) IACK_SC; j &= 0xff; - handle_irq(j, regs); + handle_irq(j, get_irq_regs()); } #endif diff --git a/arch/alpha/kernel/irq_impl.h b/arch/alpha/kernel/irq_impl.h index f201d8ffc0d9..5d84dbdcdb89 100644 --- a/arch/alpha/kernel/irq_impl.h +++ b/arch/alpha/kernel/irq_impl.h @@ -15,10 +15,10 @@ #define RTC_IRQ 8 -extern void isa_device_interrupt(unsigned long, struct pt_regs *); +extern void isa_device_interrupt(unsigned long); extern void isa_no_iack_sc_device_interrupt(unsigned long, struct pt_regs *); -extern void srm_device_interrupt(unsigned long, struct pt_regs *); -extern void pyxis_device_interrupt(unsigned long, struct pt_regs *); +extern void srm_device_interrupt(unsigned long); +extern void pyxis_device_interrupt(unsigned long); extern struct irqaction timer_irqaction; extern struct irqaction isa_cascade_irqaction; diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c index 3b581415bab0..686dc22111b2 100644 --- a/arch/alpha/kernel/irq_pyxis.c +++ b/arch/alpha/kernel/irq_pyxis.c @@ -81,7 +81,7 @@ static struct hw_interrupt_type pyxis_irq_type = { }; void -pyxis_device_interrupt(unsigned long vector, struct pt_regs *regs) +pyxis_device_interrupt(unsigned long vector) { unsigned long pld; unsigned int i; @@ -98,9 +98,9 @@ pyxis_device_interrupt(unsigned long vector, struct pt_regs *regs) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i == 7) - isa_device_interrupt(vector, regs); + isa_device_interrupt(vector); else - handle_irq(16+i, regs); + handle_irq(16+i, get_irq_regs()); } } diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c index 8e4d121f84cc..2e9f6d421a8e 100644 --- a/arch/alpha/kernel/irq_srm.c +++ b/arch/alpha/kernel/irq_srm.c @@ -72,8 +72,8 @@ init_srm_irqs(long max, unsigned long ignore_mask) } void -srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +srm_device_interrupt(unsigned long vector) { int irq = (vector - 0x800) >> 4; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c index d6926b7b1e99..2d412c876549 100644 --- a/arch/alpha/kernel/sys_alcor.c +++ b/arch/alpha/kernel/sys_alcor.c @@ -100,7 +100,7 @@ static struct hw_interrupt_type alcor_irq_type = { }; static void -alcor_device_interrupt(unsigned long vector, struct pt_regs *regs) +alcor_device_interrupt(unsigned long vector) { unsigned long pld; unsigned int i; @@ -116,9 +116,9 @@ alcor_device_interrupt(unsigned long vector, struct pt_regs *regs) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i == 31) { - isa_device_interrupt(vector, regs); + isa_device_interrupt(vector); } else { - handle_irq(16 + i, regs); + handle_irq(16 + i, get_irq_regs()); } } } diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c index 25a215067da8..e75f0cea6fcc 100644 --- a/arch/alpha/kernel/sys_cabriolet.c +++ b/arch/alpha/kernel/sys_cabriolet.c @@ -82,7 +82,7 @@ static struct hw_interrupt_type cabriolet_irq_type = { }; static void -cabriolet_device_interrupt(unsigned long v, struct pt_regs *r) +cabriolet_device_interrupt(unsigned long v) { unsigned long pld; unsigned int i; @@ -98,15 +98,15 @@ cabriolet_device_interrupt(unsigned long v, struct pt_regs *r) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i == 4) { - isa_device_interrupt(v, r); + isa_device_interrupt(v); } else { - handle_irq(16 + i, r); + handle_irq(16 + i, get_irq_regs()); } } } static void __init -common_init_irq(void (*srm_dev_int)(unsigned long v, struct pt_regs *r)) +common_init_irq(void (*srm_dev_int)(unsigned long v)) { init_i8259a_irqs(); @@ -154,18 +154,18 @@ cabriolet_init_irq(void) too invasive though. */ static void -pc164_srm_device_interrupt(unsigned long v, struct pt_regs *r) +pc164_srm_device_interrupt(unsigned long v) { __min_ipl = getipl(); - srm_device_interrupt(v, r); + srm_device_interrupt(v); __min_ipl = 0; } static void -pc164_device_interrupt(unsigned long v, struct pt_regs *r) +pc164_device_interrupt(unsigned long v) { __min_ipl = getipl(); - cabriolet_device_interrupt(v, r); + cabriolet_device_interrupt(v); __min_ipl = 0; } diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index dd6103b867e7..57dce0098a1b 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c @@ -217,7 +217,7 @@ static struct hw_interrupt_type clipper_irq_type = { }; static void -dp264_device_interrupt(unsigned long vector, struct pt_regs * regs) +dp264_device_interrupt(unsigned long vector) { #if 1 printk("dp264_device_interrupt: NOT IMPLEMENTED YET!! \n"); @@ -236,9 +236,9 @@ dp264_device_interrupt(unsigned long vector, struct pt_regs * regs) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i == 55) - isa_device_interrupt(vector, regs); + isa_device_interrupt(vector); else - handle_irq(16 + i, 16 + i, regs); + handle_irq(16 + i, get_irq_regs()); #if 0 TSUNAMI_cchip->dir0.csr = 1UL << i; mb(); tmp = TSUNAMI_cchip->dir0.csr; @@ -248,7 +248,7 @@ dp264_device_interrupt(unsigned long vector, struct pt_regs * regs) } static void -dp264_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +dp264_srm_device_interrupt(unsigned long vector) { int irq; @@ -268,11 +268,11 @@ dp264_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) if (irq >= 32) irq -= 16; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void -clipper_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +clipper_srm_device_interrupt(unsigned long vector) { int irq; @@ -290,7 +290,7 @@ clipper_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) * * Eg IRQ 24 is DRIR bit 8, etc, etc */ - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c index ed108b66ec09..90d27256d7d6 100644 --- a/arch/alpha/kernel/sys_eb64p.c +++ b/arch/alpha/kernel/sys_eb64p.c @@ -80,7 +80,7 @@ static struct hw_interrupt_type eb64p_irq_type = { }; static void -eb64p_device_interrupt(unsigned long vector, struct pt_regs *regs) +eb64p_device_interrupt(unsigned long vector) { unsigned long pld; unsigned int i; @@ -97,9 +97,9 @@ eb64p_device_interrupt(unsigned long vector, struct pt_regs *regs) pld &= pld - 1; /* clear least bit set */ if (i == 5) { - isa_device_interrupt(vector, regs); + isa_device_interrupt(vector); } else { - handle_irq(16 + i, regs); + handle_irq(16 + i, get_irq_regs()); } } } diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c index 64a785baf53a..f38cded2df97 100644 --- a/arch/alpha/kernel/sys_eiger.c +++ b/arch/alpha/kernel/sys_eiger.c @@ -91,7 +91,7 @@ static struct hw_interrupt_type eiger_irq_type = { }; static void -eiger_device_interrupt(unsigned long vector, struct pt_regs * regs) +eiger_device_interrupt(unsigned long vector) { unsigned intstatus; @@ -118,20 +118,20 @@ eiger_device_interrupt(unsigned long vector, struct pt_regs * regs) * despatch an interrupt if it's set. */ - if (intstatus & 8) handle_irq(16+3, regs); - if (intstatus & 4) handle_irq(16+2, regs); - if (intstatus & 2) handle_irq(16+1, regs); - if (intstatus & 1) handle_irq(16+0, regs); + if (intstatus & 8) handle_irq(16+3, get_irq_regs()); + if (intstatus & 4) handle_irq(16+2, get_irq_regs()); + if (intstatus & 2) handle_irq(16+1, get_irq_regs()); + if (intstatus & 1) handle_irq(16+0, get_irq_regs()); } else { - isa_device_interrupt(vector, regs); + isa_device_interrupt(vector); } } static void -eiger_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +eiger_srm_device_interrupt(unsigned long vector) { int irq = (vector - 0x800) >> 4; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c index 4ac2b328b8de..fc316369f4d4 100644 --- a/arch/alpha/kernel/sys_jensen.c +++ b/arch/alpha/kernel/sys_jensen.c @@ -129,7 +129,7 @@ static struct hw_interrupt_type jensen_local_irq_type = { }; static void -jensen_device_interrupt(unsigned long vector, struct pt_regs * regs) +jensen_device_interrupt(unsigned long vector) { int irq; @@ -189,7 +189,7 @@ jensen_device_interrupt(unsigned long vector, struct pt_regs * regs) if (cc - last_msg > ((JENSEN_CYCLES_PER_SEC) * 3) || irq != last_irq) { printk(KERN_CRIT " irq %d count %d cc %u @ %lx\n", - irq, count, cc-last_cc, regs->pc); + irq, count, cc-last_cc, get_irq_regs()->pc); count = 0; last_msg = cc; last_irq = irq; @@ -198,7 +198,7 @@ jensen_device_interrupt(unsigned long vector, struct pt_regs * regs) } #endif - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 36d215954376..4ea5615be43a 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c @@ -38,7 +38,7 @@ * Interrupt handling. */ static void -io7_device_interrupt(unsigned long vector, struct pt_regs * regs) +io7_device_interrupt(unsigned long vector) { unsigned int pid; unsigned int irq; @@ -64,7 +64,7 @@ io7_device_interrupt(unsigned long vector, struct pt_regs * regs) irq &= MARVEL_IRQ_VEC_IRQ_MASK; /* not too many bits */ irq |= pid << MARVEL_IRQ_VEC_PE_SHIFT; /* merge the pid */ - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static volatile unsigned long * diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index 61ac56f8eeea..fbbd95212a96 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c @@ -33,7 +33,7 @@ static void -miata_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +miata_srm_device_interrupt(unsigned long vector) { int irq; @@ -56,7 +56,7 @@ miata_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) if (irq >= 16) irq = irq + 8; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c index cc4c58111366..5429ba0e08f1 100644 --- a/arch/alpha/kernel/sys_mikasa.c +++ b/arch/alpha/kernel/sys_mikasa.c @@ -79,7 +79,7 @@ static struct hw_interrupt_type mikasa_irq_type = { }; static void -mikasa_device_interrupt(unsigned long vector, struct pt_regs *regs) +mikasa_device_interrupt(unsigned long vector) { unsigned long pld; unsigned int i; @@ -97,9 +97,9 @@ mikasa_device_interrupt(unsigned long vector, struct pt_regs *regs) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i < 16) { - isa_device_interrupt(vector, regs); + isa_device_interrupt(vector); } else { - handle_irq(i, regs); + handle_irq(i, get_irq_regs()); } } } diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c index 2d3cff7e8c5f..b9a843447b89 100644 --- a/arch/alpha/kernel/sys_noritake.c +++ b/arch/alpha/kernel/sys_noritake.c @@ -77,7 +77,7 @@ static struct hw_interrupt_type noritake_irq_type = { }; static void -noritake_device_interrupt(unsigned long vector, struct pt_regs *regs) +noritake_device_interrupt(unsigned long vector) { unsigned long pld; unsigned int i; @@ -96,15 +96,15 @@ noritake_device_interrupt(unsigned long vector, struct pt_regs *regs) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i < 16) { - isa_device_interrupt(vector, regs); + isa_device_interrupt(vector); } else { - handle_irq(i, regs); + handle_irq(i, get_irq_regs()); } } } static void -noritake_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +noritake_srm_device_interrupt(unsigned long vector) { int irq; @@ -122,7 +122,7 @@ noritake_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) if (irq >= 16) irq = irq + 1; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c index 949607e3d6fb..bef65162bfab 100644 --- a/arch/alpha/kernel/sys_rawhide.c +++ b/arch/alpha/kernel/sys_rawhide.c @@ -134,7 +134,7 @@ static struct hw_interrupt_type rawhide_irq_type = { }; static void -rawhide_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +rawhide_srm_device_interrupt(unsigned long vector) { int irq; @@ -158,7 +158,7 @@ rawhide_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) /* Adjust by which hose it is from. */ irq -= ((irq + 16) >> 2) & 0x38; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c index 6ae506052635..fa8eef8dd8c6 100644 --- a/arch/alpha/kernel/sys_rx164.c +++ b/arch/alpha/kernel/sys_rx164.c @@ -83,7 +83,7 @@ static struct hw_interrupt_type rx164_irq_type = { }; static void -rx164_device_interrupt(unsigned long vector, struct pt_regs *regs) +rx164_device_interrupt(unsigned long vector) { unsigned long pld; volatile unsigned int *dirr; @@ -102,9 +102,9 @@ rx164_device_interrupt(unsigned long vector, struct pt_regs *regs) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i == 20) { - isa_no_iack_sc_device_interrupt(vector, regs); + isa_no_iack_sc_device_interrupt(vector, get_irq_regs()); } else { - handle_irq(16+i, regs); + handle_irq(16+i, get_irq_regs()); } } } diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c index a7a14647b50e..791379101e7c 100644 --- a/arch/alpha/kernel/sys_sable.c +++ b/arch/alpha/kernel/sys_sable.c @@ -512,7 +512,7 @@ static struct hw_interrupt_type sable_lynx_irq_type = { }; static void -sable_lynx_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +sable_lynx_srm_device_interrupt(unsigned long vector) { /* Note that the vector reported by the SRM PALcode corresponds to the interrupt mask bits, but we have to manage via the @@ -526,7 +526,7 @@ sable_lynx_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) printk("%s: vector 0x%lx bit 0x%x irq 0x%x\n", __FUNCTION__, vector, bit, irq); #endif - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c index 2c75cd1fd81a..ce2d3b081dc8 100644 --- a/arch/alpha/kernel/sys_takara.c +++ b/arch/alpha/kernel/sys_takara.c @@ -85,7 +85,7 @@ static struct hw_interrupt_type takara_irq_type = { }; static void -takara_device_interrupt(unsigned long vector, struct pt_regs *regs) +takara_device_interrupt(unsigned long vector) { unsigned intstatus; @@ -112,20 +112,20 @@ takara_device_interrupt(unsigned long vector, struct pt_regs *regs) * despatch an interrupt if it's set. */ - if (intstatus & 8) handle_irq(16+3, regs); - if (intstatus & 4) handle_irq(16+2, regs); - if (intstatus & 2) handle_irq(16+1, regs); - if (intstatus & 1) handle_irq(16+0, regs); + if (intstatus & 8) handle_irq(16+3, get_irq_regs()); + if (intstatus & 4) handle_irq(16+2, get_irq_regs()); + if (intstatus & 2) handle_irq(16+1, get_irq_regs()); + if (intstatus & 1) handle_irq(16+0, get_irq_regs()); } else { - isa_device_interrupt (vector, regs); + isa_device_interrupt (vector); } } static void -takara_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +takara_srm_device_interrupt(unsigned long vector) { int irq = (vector - 0x800) >> 4; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } static void __init diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 302aab38d95f..1473aa0e6982 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c @@ -167,18 +167,18 @@ titan_set_irq_affinity(unsigned int irq, cpumask_t affinity) } static void -titan_device_interrupt(unsigned long vector, struct pt_regs * regs) +titan_device_interrupt(unsigned long vector) { printk("titan_device_interrupt: NOT IMPLEMENTED YET!! \n"); } static void -titan_srm_device_interrupt(unsigned long vector, struct pt_regs * regs) +titan_srm_device_interrupt(unsigned long vector) { int irq; irq = (vector - 0x800) >> 4; - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); } @@ -245,6 +245,7 @@ titan_legacy_init_irq(void) void titan_dispatch_irqs(u64 mask, struct pt_regs *regs) { + struct pt_regs *old_regs; unsigned long vector; /* @@ -252,6 +253,7 @@ titan_dispatch_irqs(u64 mask, struct pt_regs *regs) */ mask &= titan_cpu_irq_affinity[smp_processor_id()]; + old_regs = set_irq_regs(regs); /* * Dispatch all requested interrupts */ @@ -263,8 +265,9 @@ titan_dispatch_irqs(u64 mask, struct pt_regs *regs) vector = 0x900 + (vector << 4); /* convert to SRM vector */ /* dispatch it */ - alpha_mv.device_interrupt(vector, regs); + alpha_mv.device_interrupt(vector); } + set_irq_regs(old_regs); } diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c index 22c5798fe083..ddf5edd0cecd 100644 --- a/arch/alpha/kernel/sys_wildfire.c +++ b/arch/alpha/kernel/sys_wildfire.c @@ -234,7 +234,7 @@ wildfire_init_irq(void) } static void -wildfire_device_interrupt(unsigned long vector, struct pt_regs * regs) +wildfire_device_interrupt(unsigned long vector) { int irq; @@ -246,7 +246,7 @@ wildfire_device_interrupt(unsigned long vector, struct pt_regs * regs) * bits 5-0: irq in PCA */ - handle_irq(irq, regs); + handle_irq(irq, get_irq_regs()); return; } diff --git a/include/asm-alpha/machvec.h b/include/asm-alpha/machvec.h index aced22f91752..7ae744240f80 100644 --- a/include/asm-alpha/machvec.h +++ b/include/asm-alpha/machvec.h @@ -79,7 +79,7 @@ struct alpha_machine_vector void (*update_irq_hw)(unsigned long, unsigned long, int); void (*ack_irq)(unsigned long); - void (*device_interrupt)(unsigned long vector, struct pt_regs *regs); + void (*device_interrupt)(unsigned long vector); void (*machine_check)(u64 vector, u64 la, struct pt_regs *regs); void (*smp_callin)(void); From 3dbb8c62897f96bbf5d4e4fe649e5d3791fc33c5 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:37:32 +0100 Subject: [PATCH 096/232] [PATCH] alpha pt_regs cleanups: handle_irq() isa_no_iack_sc_device_interrupt() always gets get_irq_regs() as argument; kill that argument. All but two callers of handle_irq() pass get_irq_regs() as argument; convert the remaining two, kill set_irq_regs() inside handle_irq(). Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/alpha/kernel/irq.c | 5 +---- arch/alpha/kernel/irq_alpha.c | 6 ++++-- arch/alpha/kernel/irq_i8259.c | 6 +++--- arch/alpha/kernel/irq_impl.h | 4 ++-- arch/alpha/kernel/irq_pyxis.c | 2 +- arch/alpha/kernel/irq_srm.c | 2 +- arch/alpha/kernel/sys_alcor.c | 2 +- arch/alpha/kernel/sys_cabriolet.c | 2 +- arch/alpha/kernel/sys_dp264.c | 6 +++--- arch/alpha/kernel/sys_eb64p.c | 2 +- arch/alpha/kernel/sys_eiger.c | 10 +++++----- arch/alpha/kernel/sys_jensen.c | 2 +- arch/alpha/kernel/sys_marvel.c | 2 +- arch/alpha/kernel/sys_miata.c | 2 +- arch/alpha/kernel/sys_mikasa.c | 2 +- arch/alpha/kernel/sys_noritake.c | 4 ++-- arch/alpha/kernel/sys_rawhide.c | 2 +- arch/alpha/kernel/sys_rx164.c | 4 ++-- arch/alpha/kernel/sys_sable.c | 2 +- arch/alpha/kernel/sys_takara.c | 10 +++++----- arch/alpha/kernel/sys_titan.c | 2 +- arch/alpha/kernel/sys_wildfire.c | 2 +- 22 files changed, 40 insertions(+), 41 deletions(-) diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index dba4e70926f5..facf82a5499a 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -127,9 +127,8 @@ unlock: #define MAX_ILLEGAL_IRQS 16 void -handle_irq(int irq, struct pt_regs * regs) +handle_irq(int irq) { - struct pt_regs *old_regs; /* * We ack quickly, we don't want the irq controller * thinking we're snobs just because some other CPU has @@ -150,7 +149,6 @@ handle_irq(int irq, struct pt_regs * regs) return; } - old_regs = set_irq_regs(regs); irq_enter(); /* * __do_IRQ() must be called with IPL_MAX. Note that we do not @@ -161,5 +159,4 @@ handle_irq(int irq, struct pt_regs * regs) local_irq_disable(); __do_IRQ(irq); irq_exit(); - set_irq_regs(old_regs); } diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c index d14cc423aa48..51d66b7f99e3 100644 --- a/arch/alpha/kernel/irq_alpha.c +++ b/arch/alpha/kernel/irq_alpha.c @@ -52,6 +52,7 @@ do_entInt(unsigned long type, unsigned long vector, #endif break; case 1: + old_regs = set_irq_regs(regs); #ifdef CONFIG_SMP { long cpu; @@ -62,12 +63,13 @@ do_entInt(unsigned long type, unsigned long vector, if (cpu != boot_cpuid) { kstat_cpu(cpu).irqs[RTC_IRQ]++; } else { - handle_irq(RTC_IRQ, regs); + handle_irq(RTC_IRQ); } } #else - handle_irq(RTC_IRQ, regs); + handle_irq(RTC_IRQ); #endif + set_irq_regs(old_regs); return; case 2: alpha_mv.machine_check(vector, la_ptr, regs); diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c index 6c70f8b97b72..9405bee9894e 100644 --- a/arch/alpha/kernel/irq_i8259.c +++ b/arch/alpha/kernel/irq_i8259.c @@ -147,13 +147,13 @@ isa_device_interrupt(unsigned long vector) */ int j = *(vuip) IACK_SC; j &= 0xff; - handle_irq(j, get_irq_regs()); + handle_irq(j); } #endif #if defined(CONFIG_ALPHA_GENERIC) || !defined(IACK_SC) void -isa_no_iack_sc_device_interrupt(unsigned long vector, struct pt_regs *regs) +isa_no_iack_sc_device_interrupt(unsigned long vector) { unsigned long pic; @@ -176,7 +176,7 @@ isa_no_iack_sc_device_interrupt(unsigned long vector, struct pt_regs *regs) while (pic) { int j = ffz(~pic); pic &= pic - 1; - handle_irq(j, regs); + handle_irq(j); } } #endif diff --git a/arch/alpha/kernel/irq_impl.h b/arch/alpha/kernel/irq_impl.h index 5d84dbdcdb89..cc9a8a7aa279 100644 --- a/arch/alpha/kernel/irq_impl.h +++ b/arch/alpha/kernel/irq_impl.h @@ -16,7 +16,7 @@ #define RTC_IRQ 8 extern void isa_device_interrupt(unsigned long); -extern void isa_no_iack_sc_device_interrupt(unsigned long, struct pt_regs *); +extern void isa_no_iack_sc_device_interrupt(unsigned long); extern void srm_device_interrupt(unsigned long); extern void pyxis_device_interrupt(unsigned long); @@ -39,4 +39,4 @@ extern void i8259a_end_irq(unsigned int); extern struct hw_interrupt_type i8259a_irq_type; extern void init_i8259a_irqs(void); -extern void handle_irq(int irq, struct pt_regs * regs); +extern void handle_irq(int irq); diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c index 686dc22111b2..d53edbccbfe5 100644 --- a/arch/alpha/kernel/irq_pyxis.c +++ b/arch/alpha/kernel/irq_pyxis.c @@ -100,7 +100,7 @@ pyxis_device_interrupt(unsigned long vector) if (i == 7) isa_device_interrupt(vector); else - handle_irq(16+i, get_irq_regs()); + handle_irq(16+i); } } diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c index 2e9f6d421a8e..32212014fbe9 100644 --- a/arch/alpha/kernel/irq_srm.c +++ b/arch/alpha/kernel/irq_srm.c @@ -75,5 +75,5 @@ void srm_device_interrupt(unsigned long vector) { int irq = (vector - 0x800) >> 4; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c index 2d412c876549..49bedfbbd31b 100644 --- a/arch/alpha/kernel/sys_alcor.c +++ b/arch/alpha/kernel/sys_alcor.c @@ -118,7 +118,7 @@ alcor_device_interrupt(unsigned long vector) if (i == 31) { isa_device_interrupt(vector); } else { - handle_irq(16 + i, get_irq_regs()); + handle_irq(16 + i); } } } diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c index e75f0cea6fcc..ace475c124f6 100644 --- a/arch/alpha/kernel/sys_cabriolet.c +++ b/arch/alpha/kernel/sys_cabriolet.c @@ -100,7 +100,7 @@ cabriolet_device_interrupt(unsigned long v) if (i == 4) { isa_device_interrupt(v); } else { - handle_irq(16 + i, get_irq_regs()); + handle_irq(16 + i); } } } diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index 57dce0098a1b..85d2f933dd07 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c @@ -238,7 +238,7 @@ dp264_device_interrupt(unsigned long vector) if (i == 55) isa_device_interrupt(vector); else - handle_irq(16 + i, get_irq_regs()); + handle_irq(16 + i); #if 0 TSUNAMI_cchip->dir0.csr = 1UL << i; mb(); tmp = TSUNAMI_cchip->dir0.csr; @@ -268,7 +268,7 @@ dp264_srm_device_interrupt(unsigned long vector) if (irq >= 32) irq -= 16; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void @@ -290,7 +290,7 @@ clipper_srm_device_interrupt(unsigned long vector) * * Eg IRQ 24 is DRIR bit 8, etc, etc */ - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c index 90d27256d7d6..9c5a306dc0ee 100644 --- a/arch/alpha/kernel/sys_eb64p.c +++ b/arch/alpha/kernel/sys_eb64p.c @@ -99,7 +99,7 @@ eb64p_device_interrupt(unsigned long vector) if (i == 5) { isa_device_interrupt(vector); } else { - handle_irq(16 + i, get_irq_regs()); + handle_irq(16 + i); } } } diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c index f38cded2df97..7ef3b6fb3700 100644 --- a/arch/alpha/kernel/sys_eiger.c +++ b/arch/alpha/kernel/sys_eiger.c @@ -118,10 +118,10 @@ eiger_device_interrupt(unsigned long vector) * despatch an interrupt if it's set. */ - if (intstatus & 8) handle_irq(16+3, get_irq_regs()); - if (intstatus & 4) handle_irq(16+2, get_irq_regs()); - if (intstatus & 2) handle_irq(16+1, get_irq_regs()); - if (intstatus & 1) handle_irq(16+0, get_irq_regs()); + if (intstatus & 8) handle_irq(16+3); + if (intstatus & 4) handle_irq(16+2); + if (intstatus & 2) handle_irq(16+1); + if (intstatus & 1) handle_irq(16+0); } else { isa_device_interrupt(vector); } @@ -131,7 +131,7 @@ static void eiger_srm_device_interrupt(unsigned long vector) { int irq = (vector - 0x800) >> 4; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c index fc316369f4d4..a7b89022938e 100644 --- a/arch/alpha/kernel/sys_jensen.c +++ b/arch/alpha/kernel/sys_jensen.c @@ -198,7 +198,7 @@ jensen_device_interrupt(unsigned long vector) } #endif - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 4ea5615be43a..e349f03b830e 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c @@ -64,7 +64,7 @@ io7_device_interrupt(unsigned long vector) irq &= MARVEL_IRQ_VEC_IRQ_MASK; /* not too many bits */ irq |= pid << MARVEL_IRQ_VEC_PE_SHIFT; /* merge the pid */ - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static volatile unsigned long * diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index fbbd95212a96..b8b817feb1ee 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c @@ -56,7 +56,7 @@ miata_srm_device_interrupt(unsigned long vector) if (irq >= 16) irq = irq + 8; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c index 5429ba0e08f1..ba98048d61a8 100644 --- a/arch/alpha/kernel/sys_mikasa.c +++ b/arch/alpha/kernel/sys_mikasa.c @@ -99,7 +99,7 @@ mikasa_device_interrupt(unsigned long vector) if (i < 16) { isa_device_interrupt(vector); } else { - handle_irq(i, get_irq_regs()); + handle_irq(i); } } } diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c index b9a843447b89..679836205f04 100644 --- a/arch/alpha/kernel/sys_noritake.c +++ b/arch/alpha/kernel/sys_noritake.c @@ -98,7 +98,7 @@ noritake_device_interrupt(unsigned long vector) if (i < 16) { isa_device_interrupt(vector); } else { - handle_irq(i, get_irq_regs()); + handle_irq(i); } } } @@ -122,7 +122,7 @@ noritake_srm_device_interrupt(unsigned long vector) if (irq >= 16) irq = irq + 1; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c index bef65162bfab..581d08c70b92 100644 --- a/arch/alpha/kernel/sys_rawhide.c +++ b/arch/alpha/kernel/sys_rawhide.c @@ -158,7 +158,7 @@ rawhide_srm_device_interrupt(unsigned long vector) /* Adjust by which hose it is from. */ irq -= ((irq + 16) >> 2) & 0x38; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c index fa8eef8dd8c6..ce1faa6f1df1 100644 --- a/arch/alpha/kernel/sys_rx164.c +++ b/arch/alpha/kernel/sys_rx164.c @@ -102,9 +102,9 @@ rx164_device_interrupt(unsigned long vector) i = ffz(~pld); pld &= pld - 1; /* clear least bit set */ if (i == 20) { - isa_no_iack_sc_device_interrupt(vector, get_irq_regs()); + isa_no_iack_sc_device_interrupt(vector); } else { - handle_irq(16+i, get_irq_regs()); + handle_irq(16+i); } } } diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c index 791379101e7c..906019cfa681 100644 --- a/arch/alpha/kernel/sys_sable.c +++ b/arch/alpha/kernel/sys_sable.c @@ -526,7 +526,7 @@ sable_lynx_srm_device_interrupt(unsigned long vector) printk("%s: vector 0x%lx bit 0x%x irq 0x%x\n", __FUNCTION__, vector, bit, irq); #endif - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c index ce2d3b081dc8..9bd9a31450c6 100644 --- a/arch/alpha/kernel/sys_takara.c +++ b/arch/alpha/kernel/sys_takara.c @@ -112,10 +112,10 @@ takara_device_interrupt(unsigned long vector) * despatch an interrupt if it's set. */ - if (intstatus & 8) handle_irq(16+3, get_irq_regs()); - if (intstatus & 4) handle_irq(16+2, get_irq_regs()); - if (intstatus & 2) handle_irq(16+1, get_irq_regs()); - if (intstatus & 1) handle_irq(16+0, get_irq_regs()); + if (intstatus & 8) handle_irq(16+3); + if (intstatus & 4) handle_irq(16+2); + if (intstatus & 2) handle_irq(16+1); + if (intstatus & 1) handle_irq(16+0); } else { isa_device_interrupt (vector); } @@ -125,7 +125,7 @@ static void takara_srm_device_interrupt(unsigned long vector) { int irq = (vector - 0x800) >> 4; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } static void __init diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 1473aa0e6982..e8e8ec9c0f4e 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c @@ -178,7 +178,7 @@ titan_srm_device_interrupt(unsigned long vector) int irq; irq = (vector - 0x800) >> 4; - handle_irq(irq, get_irq_regs()); + handle_irq(irq); } diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c index ddf5edd0cecd..42c3eede4d09 100644 --- a/arch/alpha/kernel/sys_wildfire.c +++ b/arch/alpha/kernel/sys_wildfire.c @@ -246,7 +246,7 @@ wildfire_device_interrupt(unsigned long vector) * bits 5-0: irq in PCA */ - handle_irq(irq, get_irq_regs()); + handle_irq(irq); return; } From 4fa1970a23bf8fc68e86b65a87c32556e20a6be6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:44:38 +0100 Subject: [PATCH 097/232] [PATCH] alpha pt_regs cleanups: machine_check() do set_irq_regs() in caller, kill pt_regs argument. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/alpha/kernel/core_apecs.c | 5 ++--- arch/alpha/kernel/core_cia.c | 5 ++--- arch/alpha/kernel/core_lca.c | 6 +++--- arch/alpha/kernel/core_mcpcia.c | 5 ++--- arch/alpha/kernel/core_polaris.c | 5 ++--- arch/alpha/kernel/core_t2.c | 5 ++--- arch/alpha/kernel/core_tsunami.c | 5 ++--- arch/alpha/kernel/core_wildfire.c | 5 ++--- arch/alpha/kernel/err_ev6.c | 5 +++-- arch/alpha/kernel/err_ev7.c | 2 +- arch/alpha/kernel/err_impl.h | 10 +++++----- arch/alpha/kernel/err_marvel.c | 4 ++-- arch/alpha/kernel/err_titan.c | 14 +++++++------- arch/alpha/kernel/irq_alpha.c | 11 ++++++----- arch/alpha/kernel/proto.h | 23 +++++++++++------------ arch/alpha/kernel/sys_jensen.c | 2 +- arch/alpha/kernel/sys_mikasa.c | 5 ++--- arch/alpha/kernel/sys_nautilus.c | 7 +++---- arch/alpha/kernel/sys_noritake.c | 5 ++--- include/asm-alpha/machvec.h | 3 +-- 20 files changed, 61 insertions(+), 71 deletions(-) diff --git a/arch/alpha/kernel/core_apecs.c b/arch/alpha/kernel/core_apecs.c index a27ba12ba35e..ca46b2c24457 100644 --- a/arch/alpha/kernel/core_apecs.c +++ b/arch/alpha/kernel/core_apecs.c @@ -387,8 +387,7 @@ apecs_pci_clr_err(void) } void -apecs_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +apecs_machine_check(unsigned long vector, unsigned long la_ptr) { struct el_common *mchk_header; struct el_apecs_procdata *mchk_procdata; @@ -412,7 +411,7 @@ apecs_machine_check(unsigned long vector, unsigned long la_ptr, wrmces(0x7); /* reset machine check pending flag */ mb(); - process_mcheck_info(vector, la_ptr, regs, "APECS", + process_mcheck_info(vector, la_ptr, "APECS", (mcheck_expected(0) && (mchk_sysdata->epic_dcsr & 0x0c00UL))); } diff --git a/arch/alpha/kernel/core_cia.c b/arch/alpha/kernel/core_cia.c index fd563064363c..1d6ee6c985f9 100644 --- a/arch/alpha/kernel/core_cia.c +++ b/arch/alpha/kernel/core_cia.c @@ -1192,8 +1192,7 @@ cia_decode_mchk(unsigned long la_ptr) } void -cia_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +cia_machine_check(unsigned long vector, unsigned long la_ptr) { int expected; @@ -1208,5 +1207,5 @@ cia_machine_check(unsigned long vector, unsigned long la_ptr, expected = mcheck_expected(0); if (!expected && vector == 0x660) expected = cia_decode_mchk(la_ptr); - process_mcheck_info(vector, la_ptr, regs, "CIA", expected); + process_mcheck_info(vector, la_ptr, "CIA", expected); } diff --git a/arch/alpha/kernel/core_lca.c b/arch/alpha/kernel/core_lca.c index 6a5a9145c676..4843f6ec9f3a 100644 --- a/arch/alpha/kernel/core_lca.c +++ b/arch/alpha/kernel/core_lca.c @@ -19,6 +19,7 @@ #include #include +#include #include #include "proto.h" @@ -386,8 +387,7 @@ ioc_error(__u32 stat0, __u32 stat1) } void -lca_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs *regs) +lca_machine_check(unsigned long vector, unsigned long la_ptr) { const char * reason; union el_lca el; @@ -397,7 +397,7 @@ lca_machine_check(unsigned long vector, unsigned long la_ptr, wrmces(rdmces()); /* reset machine check pending flag */ printk(KERN_CRIT "LCA machine check: vector=%#lx pc=%#lx code=%#x\n", - vector, regs->pc, (unsigned int) el.c->code); + vector, get_irq_regs()->pc, (unsigned int) el.c->code); /* * The first quadword after the common header always seems to diff --git a/arch/alpha/kernel/core_mcpcia.c b/arch/alpha/kernel/core_mcpcia.c index 28849c894153..8d019071190a 100644 --- a/arch/alpha/kernel/core_mcpcia.c +++ b/arch/alpha/kernel/core_mcpcia.c @@ -572,8 +572,7 @@ mcpcia_print_system_area(unsigned long la_ptr) } void -mcpcia_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +mcpcia_machine_check(unsigned long vector, unsigned long la_ptr) { struct el_common *mchk_header; struct el_MCPCIA_uncorrected_frame_mcheck *mchk_logout; @@ -610,7 +609,7 @@ mcpcia_machine_check(unsigned long vector, unsigned long la_ptr, wrmces(0x7); mb(); - process_mcheck_info(vector, la_ptr, regs, "MCPCIA", expected != 0); + process_mcheck_info(vector, la_ptr, "MCPCIA", expected != 0); if (!expected && vector != 0x620 && vector != 0x630) { mcpcia_print_uncorrectable(mchk_logout); mcpcia_print_system_area(la_ptr); diff --git a/arch/alpha/kernel/core_polaris.c b/arch/alpha/kernel/core_polaris.c index 277674a500ff..c5a271d37abd 100644 --- a/arch/alpha/kernel/core_polaris.c +++ b/arch/alpha/kernel/core_polaris.c @@ -187,8 +187,7 @@ polaris_pci_clr_err(void) } void -polaris_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +polaris_machine_check(unsigned long vector, unsigned long la_ptr) { /* Clear the error before any reporting. */ mb(); @@ -198,6 +197,6 @@ polaris_machine_check(unsigned long vector, unsigned long la_ptr, wrmces(0x7); mb(); - process_mcheck_info(vector, la_ptr, regs, "POLARIS", + process_mcheck_info(vector, la_ptr, "POLARIS", mcheck_expected(0)); } diff --git a/arch/alpha/kernel/core_t2.c b/arch/alpha/kernel/core_t2.c index ecce09e3626a..f5ca5255eb06 100644 --- a/arch/alpha/kernel/core_t2.c +++ b/arch/alpha/kernel/core_t2.c @@ -551,8 +551,7 @@ t2_clear_errors(int cpu) * Hence all the taken/expected/any_expected/last_taken stuff... */ void -t2_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +t2_machine_check(unsigned long vector, unsigned long la_ptr) { int cpu = smp_processor_id(); #ifdef CONFIG_VERBOSE_MCHECK @@ -618,5 +617,5 @@ t2_machine_check(unsigned long vector, unsigned long la_ptr, } #endif - process_mcheck_info(vector, la_ptr, regs, "T2", mcheck_expected(cpu)); + process_mcheck_info(vector, la_ptr, "T2", mcheck_expected(cpu)); } diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c index 8aa305bd6a2c..ce623c6e55e1 100644 --- a/arch/alpha/kernel/core_tsunami.c +++ b/arch/alpha/kernel/core_tsunami.c @@ -443,8 +443,7 @@ tsunami_pci_clr_err(void) } void -tsunami_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +tsunami_machine_check(unsigned long vector, unsigned long la_ptr) { /* Clear error before any reporting. */ mb(); @@ -454,6 +453,6 @@ tsunami_machine_check(unsigned long vector, unsigned long la_ptr, wrmces(0x7); mb(); - process_mcheck_info(vector, la_ptr, regs, "TSUNAMI", + process_mcheck_info(vector, la_ptr, "TSUNAMI", mcheck_expected(smp_processor_id())); } diff --git a/arch/alpha/kernel/core_wildfire.c b/arch/alpha/kernel/core_wildfire.c index 2b767a1bad96..7e072443d7fd 100644 --- a/arch/alpha/kernel/core_wildfire.c +++ b/arch/alpha/kernel/core_wildfire.c @@ -322,8 +322,7 @@ wildfire_init_arch(void) } void -wildfire_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +wildfire_machine_check(unsigned long vector, unsigned long la_ptr) { mb(); mb(); /* magic */ @@ -332,7 +331,7 @@ wildfire_machine_check(unsigned long vector, unsigned long la_ptr, wrmces(0x7); mb(); - process_mcheck_info(vector, la_ptr, regs, "WILDFIRE", + process_mcheck_info(vector, la_ptr, "WILDFIRE", mcheck_expected(smp_processor_id())); } diff --git a/arch/alpha/kernel/err_ev6.c b/arch/alpha/kernel/err_ev6.c index 64f59f2fcf5c..69b5f4ea7355 100644 --- a/arch/alpha/kernel/err_ev6.c +++ b/arch/alpha/kernel/err_ev6.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -229,7 +230,7 @@ ev6_process_logout_frame(struct el_common *mchk_header, int print) } void -ev6_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) +ev6_machine_check(u64 vector, u64 la_ptr) { struct el_common *mchk_header = (struct el_common *)la_ptr; @@ -260,7 +261,7 @@ ev6_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) (unsigned int)vector, (int)smp_processor_id()); ev6_process_logout_frame(mchk_header, 1); - dik_show_regs(regs, NULL); + dik_show_regs(get_irq_regs(), NULL); err_print_prefix = saved_err_prefix; } diff --git a/arch/alpha/kernel/err_ev7.c b/arch/alpha/kernel/err_ev7.c index fed6b3d1b803..95463ab1cf35 100644 --- a/arch/alpha/kernel/err_ev7.c +++ b/arch/alpha/kernel/err_ev7.c @@ -118,7 +118,7 @@ ev7_collect_logout_frame_subpackets(struct el_subpacket *el_ptr, } void -ev7_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) +ev7_machine_check(u64 vector, u64 la_ptr) { struct el_subpacket *el_ptr = (struct el_subpacket *)la_ptr; char *saved_err_prefix = err_print_prefix; diff --git a/arch/alpha/kernel/err_impl.h b/arch/alpha/kernel/err_impl.h index 64e9b73809fa..3c12258158e6 100644 --- a/arch/alpha/kernel/err_impl.h +++ b/arch/alpha/kernel/err_impl.h @@ -60,26 +60,26 @@ extern struct ev7_lf_subpackets * ev7_collect_logout_frame_subpackets(struct el_subpacket *, struct ev7_lf_subpackets *); extern void ev7_register_error_handlers(void); -extern void ev7_machine_check(u64, u64, struct pt_regs *); +extern void ev7_machine_check(u64, u64); /* * err_ev6.c */ extern void ev6_register_error_handlers(void); extern int ev6_process_logout_frame(struct el_common *, int); -extern void ev6_machine_check(u64, u64, struct pt_regs *); +extern void ev6_machine_check(u64, u64); /* * err_marvel.c */ -extern void marvel_machine_check(u64, u64, struct pt_regs *); +extern void marvel_machine_check(u64, u64); extern void marvel_register_error_handlers(void); /* * err_titan.c */ extern int titan_process_logout_frame(struct el_common *, int); -extern void titan_machine_check(u64, u64, struct pt_regs *); +extern void titan_machine_check(u64, u64); extern void titan_register_error_handlers(void); extern int privateer_process_logout_frame(struct el_common *, int); -extern void privateer_machine_check(u64, u64, struct pt_regs *); +extern void privateer_machine_check(u64, u64); diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c index 70b38b1d2af3..f2956ac8dccc 100644 --- a/arch/alpha/kernel/err_marvel.c +++ b/arch/alpha/kernel/err_marvel.c @@ -1042,7 +1042,7 @@ marvel_process_logout_frame(struct ev7_lf_subpackets *lf_subpackets, int print) } void -marvel_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) +marvel_machine_check(u64 vector, u64 la_ptr) { struct el_subpacket *el_ptr = (struct el_subpacket *)la_ptr; int (*process_frame)(struct ev7_lf_subpackets *, int) = NULL; @@ -1077,7 +1077,7 @@ marvel_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) default: /* Don't know it - pass it up. */ - ev7_machine_check(vector, la_ptr, regs); + ev7_machine_check(vector, la_ptr); return; } diff --git a/arch/alpha/kernel/err_titan.c b/arch/alpha/kernel/err_titan.c index 7e6720d45f02..2e6e62933327 100644 --- a/arch/alpha/kernel/err_titan.c +++ b/arch/alpha/kernel/err_titan.c @@ -379,7 +379,7 @@ titan_process_logout_frame(struct el_common *mchk_header, int print) } void -titan_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) +titan_machine_check(u64 vector, u64 la_ptr) { struct el_common *mchk_header = (struct el_common *)la_ptr; struct el_TITAN_sysdata_mcheck *tmchk = @@ -408,7 +408,7 @@ titan_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) * Only handle system errors here */ if ((vector != SCB_Q_SYSMCHK) && (vector != SCB_Q_SYSERR)) { - ev6_machine_check(vector, la_ptr, regs); + ev6_machine_check(vector, la_ptr); return; } @@ -442,7 +442,7 @@ titan_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) #ifdef CONFIG_VERBOSE_MCHECK titan_process_logout_frame(mchk_header, alpha_verbose_mcheck); if (alpha_verbose_mcheck) - dik_show_regs(regs, NULL); + dik_show_regs(get_irq_regs(), NULL); #endif /* CONFIG_VERBOSE_MCHECK */ err_print_prefix = saved_err_prefix; @@ -452,7 +452,7 @@ titan_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) * machine checks to interrupts */ irqmask = tmchk->c_dirx & TITAN_MCHECK_INTERRUPT_MASK; - titan_dispatch_irqs(irqmask, regs); + titan_dispatch_irqs(irqmask, get_irq_regs()); } @@ -701,7 +701,7 @@ privateer_process_logout_frame(struct el_common *mchk_header, int print) } void -privateer_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) +privateer_machine_check(u64 vector, u64 la_ptr) { struct el_common *mchk_header = (struct el_common *)la_ptr; struct el_TITAN_sysdata_mcheck *tmchk = @@ -723,7 +723,7 @@ privateer_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) * Only handle system events here. */ if (vector != SCB_Q_SYSEVENT) - return titan_machine_check(vector, la_ptr, regs); + return titan_machine_check(vector, la_ptr); /* * Report the event - System Events should be reported even if no @@ -746,7 +746,7 @@ privateer_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) /* * Dispatch the interrupt(s). */ - titan_dispatch_irqs(irqmask, regs); + titan_dispatch_irqs(irqmask, get_irq_regs()); /* * Release the logout frame. diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c index 51d66b7f99e3..6dd126b8be85 100644 --- a/arch/alpha/kernel/irq_alpha.c +++ b/arch/alpha/kernel/irq_alpha.c @@ -72,7 +72,9 @@ do_entInt(unsigned long type, unsigned long vector, set_irq_regs(old_regs); return; case 2: - alpha_mv.machine_check(vector, la_ptr, regs); + old_regs = set_irq_regs(regs); + alpha_mv.machine_check(vector, la_ptr); + set_irq_regs(old_regs); return; case 3: old_regs = set_irq_regs(regs); @@ -125,8 +127,7 @@ struct mcheck_info __mcheck_info; void process_mcheck_info(unsigned long vector, unsigned long la_ptr, - struct pt_regs *regs, const char *machine, - int expected) + const char *machine, int expected) { struct el_common *mchk_header; const char *reason; @@ -153,7 +154,7 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr, mchk_header = (struct el_common *)la_ptr; printk(KERN_CRIT "%s machine check: vector=0x%lx pc=0x%lx code=0x%x\n", - machine, vector, regs->pc, mchk_header->code); + machine, vector, get_irq_regs()->pc, mchk_header->code); switch (mchk_header->code) { /* Machine check reasons. Defined according to PALcode sources. */ @@ -194,7 +195,7 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr, printk(KERN_CRIT "machine check type: %s%s\n", reason, mchk_header->retry ? " (retryable)" : ""); - dik_show_regs(regs, NULL); + dik_show_regs(get_irq_regs(), NULL); #ifdef CONFIG_VERBOSE_MCHECK if (alpha_verbose_mcheck > 1) { diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 408bda25b0b1..3fff88734190 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -20,7 +20,7 @@ struct pci_controller; extern struct pci_ops apecs_pci_ops; extern void apecs_init_arch(void); extern void apecs_pci_clr_err(void); -extern void apecs_machine_check(u64, u64, struct pt_regs *); +extern void apecs_machine_check(u64, u64); extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_cia.c */ @@ -29,7 +29,7 @@ extern void cia_init_pci(void); extern void cia_init_arch(void); extern void pyxis_init_arch(void); extern void cia_kill_arch(int); -extern void cia_machine_check(u64, u64, struct pt_regs *); +extern void cia_machine_check(u64, u64); extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_irongate.c */ @@ -42,14 +42,14 @@ extern void irongate_machine_check(u64, u64, struct pt_regs *); /* core_lca.c */ extern struct pci_ops lca_pci_ops; extern void lca_init_arch(void); -extern void lca_machine_check(u64, u64, struct pt_regs *); +extern void lca_machine_check(u64, u64); extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_marvel.c */ extern struct pci_ops marvel_pci_ops; extern void marvel_init_arch(void); extern void marvel_kill_arch(int); -extern void marvel_machine_check(u64, u64, struct pt_regs *); +extern void marvel_machine_check(u64, u64); extern void marvel_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); extern int marvel_pa_to_nid(unsigned long); extern int marvel_cpuid_to_nid(int); @@ -64,7 +64,7 @@ void io7_clear_errors(struct io7 *io7); extern struct pci_ops mcpcia_pci_ops; extern void mcpcia_init_arch(void); extern void mcpcia_init_hoses(void); -extern void mcpcia_machine_check(u64, u64, struct pt_regs *); +extern void mcpcia_machine_check(u64, u64); extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_polaris.c */ @@ -72,21 +72,21 @@ extern struct pci_ops polaris_pci_ops; extern int polaris_read_config_dword(struct pci_dev *, int, u32 *); extern int polaris_write_config_dword(struct pci_dev *, int, u32); extern void polaris_init_arch(void); -extern void polaris_machine_check(u64, u64, struct pt_regs *); +extern void polaris_machine_check(u64, u64); #define polaris_pci_tbi ((void *)0) /* core_t2.c */ extern struct pci_ops t2_pci_ops; extern void t2_init_arch(void); extern void t2_kill_arch(int); -extern void t2_machine_check(u64, u64, struct pt_regs *); +extern void t2_machine_check(u64, u64); extern void t2_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_titan.c */ extern struct pci_ops titan_pci_ops; extern void titan_init_arch(void); extern void titan_kill_arch(int); -extern void titan_machine_check(u64, u64, struct pt_regs *); +extern void titan_machine_check(u64, u64); extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); extern struct _alpha_agp_info *titan_agp_info(void); @@ -94,14 +94,14 @@ extern struct _alpha_agp_info *titan_agp_info(void); extern struct pci_ops tsunami_pci_ops; extern void tsunami_init_arch(void); extern void tsunami_kill_arch(int); -extern void tsunami_machine_check(u64, u64, struct pt_regs *); +extern void tsunami_machine_check(u64, u64); extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); /* core_wildfire.c */ extern struct pci_ops wildfire_pci_ops; extern void wildfire_init_arch(void); extern void wildfire_kill_arch(int); -extern void wildfire_machine_check(u64, u64, struct pt_regs *); +extern void wildfire_machine_check(u64, u64); extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); extern int wildfire_pa_to_nid(unsigned long); extern int wildfire_cpuid_to_nid(int); @@ -214,5 +214,4 @@ extern struct mcheck_info #endif extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr, - struct pt_regs *regs, const char *machine, - int expected); + const char *machine, int expected); diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c index a7b89022938e..2c3de97de46c 100644 --- a/arch/alpha/kernel/sys_jensen.c +++ b/arch/alpha/kernel/sys_jensen.c @@ -244,7 +244,7 @@ jensen_init_arch(void) } static void -jensen_machine_check (u64 vector, u64 la, struct pt_regs *regs) +jensen_machine_check (u64 vector, u64 la) { printk(KERN_CRIT "Machine check\n"); } diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c index ba98048d61a8..8d3e9429c5ee 100644 --- a/arch/alpha/kernel/sys_mikasa.c +++ b/arch/alpha/kernel/sys_mikasa.c @@ -182,8 +182,7 @@ mikasa_map_irq(struct pci_dev *dev, u8 slot, u8 pin) #if defined(CONFIG_ALPHA_GENERIC) || !defined(CONFIG_ALPHA_PRIMO) static void -mikasa_apecs_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +mikasa_apecs_machine_check(unsigned long vector, unsigned long la_ptr) { #define MCHK_NO_DEVSEL 0x205U #define MCHK_NO_TABT 0x204U @@ -202,7 +201,7 @@ mikasa_apecs_machine_check(unsigned long vector, unsigned long la_ptr, mb(); code = mchk_header->code; - process_mcheck_info(vector, la_ptr, regs, "MIKASA APECS", + process_mcheck_info(vector, la_ptr, "MIKASA APECS", (mcheck_expected(0) && (code == MCHK_NO_DEVSEL || code == MCHK_NO_TABT))); diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c index c0d696efec5b..93744bab73fb 100644 --- a/arch/alpha/kernel/sys_nautilus.c +++ b/arch/alpha/kernel/sys_nautilus.c @@ -124,8 +124,7 @@ naut_sys_machine_check(unsigned long vector, unsigned long la_ptr, in the system. They are analysed separately but all starts here. */ void -nautilus_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs *regs) +nautilus_machine_check(unsigned long vector, unsigned long la_ptr) { char *mchk_class; @@ -165,7 +164,7 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr, else if (vector == SCB_Q_SYSMCHK) mchk_class = "Fatal"; else { - ev6_machine_check(vector, la_ptr, regs); + ev6_machine_check(vector, la_ptr); return; } @@ -173,7 +172,7 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr, "[%s System Machine Check (NMI)]\n", vector, mchk_class); - naut_sys_machine_check(vector, la_ptr, regs); + naut_sys_machine_check(vector, la_ptr, get_irq_regs()); /* Tell the PALcode to clear the machine check */ draina(); diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c index 679836205f04..de6ba3432e8a 100644 --- a/arch/alpha/kernel/sys_noritake.c +++ b/arch/alpha/kernel/sys_noritake.c @@ -264,8 +264,7 @@ noritake_swizzle(struct pci_dev *dev, u8 *pinp) #if defined(CONFIG_ALPHA_GENERIC) || !defined(CONFIG_ALPHA_PRIMO) static void -noritake_apecs_machine_check(unsigned long vector, unsigned long la_ptr, - struct pt_regs * regs) +noritake_apecs_machine_check(unsigned long vector, unsigned long la_ptr) { #define MCHK_NO_DEVSEL 0x205U #define MCHK_NO_TABT 0x204U @@ -284,7 +283,7 @@ noritake_apecs_machine_check(unsigned long vector, unsigned long la_ptr, mb(); code = mchk_header->code; - process_mcheck_info(vector, la_ptr, regs, "NORITAKE APECS", + process_mcheck_info(vector, la_ptr, "NORITAKE APECS", (mcheck_expected(0) && (code == MCHK_NO_DEVSEL || code == MCHK_NO_TABT))); diff --git a/include/asm-alpha/machvec.h b/include/asm-alpha/machvec.h index 7ae744240f80..a86c083cdf7f 100644 --- a/include/asm-alpha/machvec.h +++ b/include/asm-alpha/machvec.h @@ -15,7 +15,6 @@ struct task_struct; struct mm_struct; -struct pt_regs; struct vm_area_struct; struct linux_hose_info; struct pci_dev; @@ -80,7 +79,7 @@ struct alpha_machine_vector void (*update_irq_hw)(unsigned long, unsigned long, int); void (*ack_irq)(unsigned long); void (*device_interrupt)(unsigned long vector); - void (*machine_check)(u64 vector, u64 la, struct pt_regs *regs); + void (*machine_check)(u64 vector, u64 la); void (*smp_callin)(void); void (*init_arch)(void); From 2f116cbf369ec3148cef9821f6c7f2b8fb78a071 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:45:28 +0100 Subject: [PATCH 098/232] [PATCH] alpha pt_regs cleanups: collapse set_irq_regs() in titan_dispatch_irqs() titan_dispatch_irqs() always gets get_irq_regs() as argument; kill the argument and collapse set_irq_regs() in body. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/alpha/kernel/err_titan.c | 4 ++-- arch/alpha/kernel/proto.h | 2 +- arch/alpha/kernel/sys_titan.c | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/alpha/kernel/err_titan.c b/arch/alpha/kernel/err_titan.c index 2e6e62933327..febe71c6869f 100644 --- a/arch/alpha/kernel/err_titan.c +++ b/arch/alpha/kernel/err_titan.c @@ -452,7 +452,7 @@ titan_machine_check(u64 vector, u64 la_ptr) * machine checks to interrupts */ irqmask = tmchk->c_dirx & TITAN_MCHECK_INTERRUPT_MASK; - titan_dispatch_irqs(irqmask, get_irq_regs()); + titan_dispatch_irqs(irqmask); } @@ -746,7 +746,7 @@ privateer_machine_check(u64 vector, u64 la_ptr) /* * Dispatch the interrupt(s). */ - titan_dispatch_irqs(irqmask, get_irq_regs()); + titan_dispatch_irqs(irqmask); /* * Release the logout frame. diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 3fff88734190..daccd4b6d28a 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -177,7 +177,7 @@ extern void dik_show_regs(struct pt_regs *regs, unsigned long *r9_15); extern void die_if_kernel(char *, struct pt_regs *, long, unsigned long *); /* sys_titan.c */ -extern void titan_dispatch_irqs(u64, struct pt_regs *); +extern void titan_dispatch_irqs(u64); /* ../mm/init.c */ extern void switch_to_system_map(void); diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index e8e8ec9c0f4e..161d6915dc49 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c @@ -243,9 +243,8 @@ titan_legacy_init_irq(void) } void -titan_dispatch_irqs(u64 mask, struct pt_regs *regs) +titan_dispatch_irqs(u64 mask) { - struct pt_regs *old_regs; unsigned long vector; /* @@ -253,7 +252,6 @@ titan_dispatch_irqs(u64 mask, struct pt_regs *regs) */ mask &= titan_cpu_irq_affinity[smp_processor_id()]; - old_regs = set_irq_regs(regs); /* * Dispatch all requested interrupts */ @@ -267,7 +265,6 @@ titan_dispatch_irqs(u64 mask, struct pt_regs *regs) /* dispatch it */ alpha_mv.device_interrupt(vector); } - set_irq_regs(old_regs); } From 5dcded1b0b4f1537bb6dff453fb805517756c94b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:59:19 +0100 Subject: [PATCH 099/232] [PATCH] missed ia64 pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/ia64/hp/sim/simeth.c | 4 ++-- arch/ia64/hp/sim/simserial.c | 10 +++++----- arch/ia64/sn/kernel/xpc_main.c | 7 ++----- include/asm-ia64/sn/xpc.h | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c index e1a1b11473e2..be769ef326a2 100644 --- a/arch/ia64/hp/sim/simeth.c +++ b/arch/ia64/hp/sim/simeth.c @@ -54,7 +54,7 @@ static int simeth_close(struct net_device *dev); static int simeth_tx(struct sk_buff *skb, struct net_device *dev); static int simeth_rx(struct net_device *dev); static struct net_device_stats *simeth_get_stats(struct net_device *dev); -static irqreturn_t simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs); +static irqreturn_t simeth_interrupt(int irq, void *dev_id); static void set_multicast_list(struct net_device *dev); static int simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr); @@ -497,7 +497,7 @@ simeth_rx(struct net_device *dev) * Interrupt handler (Yes, we can do it too !!!) */ static irqreturn_t -simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs) +simeth_interrupt(int irq, void *dev_id) { struct net_device *dev = dev_id; diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index 246eb3d3757a..77819acaea9d 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c @@ -130,7 +130,7 @@ static void rs_start(struct tty_struct *tty) #endif } -static void receive_chars(struct tty_struct *tty, struct pt_regs *regs) +static void receive_chars(struct tty_struct *tty) { unsigned char ch; static unsigned char seen_esc = 0; @@ -152,7 +152,7 @@ static void receive_chars(struct tty_struct *tty, struct pt_regs *regs) ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR); while (!ch); - handle_sysrq(ch, regs, NULL); + handle_sysrq(ch, NULL); } #endif seen_esc = 0; @@ -170,7 +170,7 @@ static void receive_chars(struct tty_struct *tty, struct pt_regs *regs) /* * This is the serial driver's interrupt routine for a single port */ -static irqreturn_t rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t rs_interrupt_single(int irq, void *dev_id) { struct async_struct * info; @@ -187,7 +187,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id, struct pt_regs * r * pretty simple in our case, because we only get interrupts * on inbound traffic */ - receive_chars(info->tty, regs); + receive_chars(info->tty); return IRQ_HANDLED; } @@ -714,7 +714,7 @@ startup(struct async_struct *info) { unsigned long flags; int retval=0; - irqreturn_t (*handler)(int, void *, struct pt_regs *); + irqreturn_t (*handler)(int, void *); struct serial_state *state= info->state; unsigned long page; diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c index 4d026f9dd98b..fa96dfc0e1aa 100644 --- a/arch/ia64/sn/kernel/xpc_main.c +++ b/arch/ia64/sn/kernel/xpc_main.c @@ -222,7 +222,7 @@ xpc_timeout_partition_disengage_request(unsigned long data) * Notify the heartbeat check thread that an IRQ has been received. */ static irqreturn_t -xpc_act_IRQ_handler(int irq, void *dev_id, struct pt_regs *regs) +xpc_act_IRQ_handler(int irq, void *dev_id) { atomic_inc(&xpc_act_IRQ_rcvd); wake_up_interruptible(&xpc_act_IRQ_wq); @@ -607,12 +607,9 @@ xpc_activate_partition(struct xpc_partition *part) * irq - Interrupt ReQuest number. NOT USED. * * dev_id - partid of IPI's potential sender. - * - * regs - processor's context before the processor entered - * interrupt code. NOT USED. */ irqreturn_t -xpc_notify_IRQ_handler(int irq, void *dev_id, struct pt_regs *regs) +xpc_notify_IRQ_handler(int irq, void *dev_id) { partid_t partid = (partid_t) (u64) dev_id; struct xpc_partition *part = &xpc_partitions[partid]; diff --git a/include/asm-ia64/sn/xpc.h b/include/asm-ia64/sn/xpc.h index 35e1386f37ab..1d45e1518fb3 100644 --- a/include/asm-ia64/sn/xpc.h +++ b/include/asm-ia64/sn/xpc.h @@ -669,7 +669,7 @@ extern struct device *xpc_part; extern struct device *xpc_chan; extern int xpc_disengage_request_timelimit; extern int xpc_disengage_request_timedout; -extern irqreturn_t xpc_notify_IRQ_handler(int, void *, struct pt_regs *); +extern irqreturn_t xpc_notify_IRQ_handler(int, void *); extern void xpc_dropped_IPI_check(struct xpc_partition *); extern void xpc_activate_partition(struct xpc_partition *); extern void xpc_activate_kthreads(struct xpc_channel *, int); From 28431146993e0ab3a2a592af8541543fe0cc2c8e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:00:12 +0100 Subject: [PATCH 100/232] [PATCH] misc arm pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/dm9000.c | 2 +- drivers/usb/gadget/dummy_hcd.c | 2 +- include/asm-arm/hw_irq.h | 2 +- sound/oss/vidc.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 3641f3b4a2cc..615d2b14efa7 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c @@ -346,7 +346,7 @@ static void dm9000_timeout(struct net_device *dev) static void dm9000_poll_controller(struct net_device *dev) { disable_irq(dev->irq); - dm9000_interrupt(dev->irq,dev,NULL); + dm9000_interrupt(dev->irq,dev); enable_irq(dev->irq); } #endif diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 4d2946e540cf..f1f32d7be5f9 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -1551,7 +1551,7 @@ return_urb: ep->already_seen = ep->setup_stage = 0; spin_unlock (&dum->lock); - usb_hcd_giveback_urb (dummy_to_hcd(dum), urb, NULL); + usb_hcd_giveback_urb (dummy_to_hcd(dum), urb); spin_lock (&dum->lock); goto restart; diff --git a/include/asm-arm/hw_irq.h b/include/asm-arm/hw_irq.h index ea856971989a..98d594a973d6 100644 --- a/include/asm-arm/hw_irq.h +++ b/include/asm-arm/hw_irq.h @@ -12,7 +12,7 @@ if (!(action->flags & IRQF_TIMER) && system_timer->dyn_tick) { \ write_seqlock(&xtime_lock); \ if (system_timer->dyn_tick->state & DYN_TICK_ENABLED) \ - system_timer->dyn_tick->handler(irq, 0, regs); \ + system_timer->dyn_tick->handler(irq, NULL); \ write_sequnlock(&xtime_lock); \ } #endif diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c index 8932d89408ef..bb4a0969f461 100644 --- a/sound/oss/vidc.c +++ b/sound/oss/vidc.c @@ -372,7 +372,7 @@ static void vidc_audio_trigger(int dev, int enable_bits) adev->flags |= DMA_ACTIVE; dma_interrupt = vidc_audio_dma_interrupt; - vidc_sound_dma_irq(0, NULL, NULL); + vidc_sound_dma_irq(0, NULL); iomd_writeb(DMA_CR_E | 0x10, IOMD_SD0CR); local_irq_restore(flags); From 9da3b1ad7b074effd56729f9fc01cc5abf6503cc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:00:44 +0100 Subject: [PATCH 101/232] [PATCH] misc ppc pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/macintosh/macio-adb.c | 2 +- drivers/net/mv643xx_eth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 57ccc19cbdbf..797cef72258f 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c @@ -270,6 +270,6 @@ static void macio_adb_poll(void) local_irq_save(flags); if (in_8(&adb->intr.r) != 0) - macio_adb_interrupt(0, NULL, NULL); + macio_adb_interrupt(0, NULL); local_irq_restore(flags); } diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index d26a819a9735..2ffa3a59e704 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -1251,7 +1251,7 @@ static void mv643xx_netpoll(struct net_device *netdev) /* wait for previous write to complete */ mv_read(MV643XX_ETH_INTERRUPT_MASK_REG(port_num)); - mv643xx_eth_int_handler(netdev->irq, netdev, NULL); + mv643xx_eth_int_handler(netdev->irq, netdev); mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), ETH_INT_UNMASK_ALL); } From 97432886617825d412bcedadf5e5b308f931caad Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:01:14 +0100 Subject: [PATCH 102/232] [PATCH] missing include in pdaudiocf_irq Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- sound/pcmcia/pdaudiocf/pdaudiocf_irq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c index 732263e4a437..5bd69206ba65 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c @@ -22,6 +22,7 @@ #include #include "pdaudiocf.h" #include +#include /* * From a8f47c45aee6efa5ef7ec209b90681b091bd3d2c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:04:15 +0100 Subject: [PATCH 103/232] [PATCH] missing include of scatterlist.h Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/linux/tifm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/tifm.h b/include/linux/tifm.h index 203dd5e11ecb..dfb8052eee5e 100644 --- a/include/linux/tifm.h +++ b/include/linux/tifm.h @@ -17,6 +17,7 @@ #include #include #include +#include /* Host registers (relative to pci base address): */ enum { From 9288d1a3c7ed0abaa7976844e5d42bbd4fa0eae3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:05:14 +0100 Subject: [PATCH 104/232] [PATCH] missing forward declaration of pt_regs (asm-m68k/signal.h) Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-m68k/signal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h index de1ba6ead3b4..3db8a81942f1 100644 --- a/include/asm-m68k/signal.h +++ b/include/asm-m68k/signal.h @@ -198,6 +198,7 @@ static inline int sigfindinword(unsigned long word) return word ^ 31; } +struct pt_regs; extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); #endif /* __KERNEL__ */ From cb1055fb1b79775d398038ad8dcd2c7581f141d8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:08:45 +0100 Subject: [PATCH 105/232] [PATCH] linux/io.h needs types.h Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/linux/io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/io.h b/include/linux/io.h index aa3f5af670b5..2ad96c3f0e4e 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -18,6 +18,7 @@ #ifndef _LINUX_IO_H #define _LINUX_IO_H +#include #include #include From 0bae89ec8b1519dae67036637942f5b5bbaa9424 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sun, 8 Oct 2006 14:33:24 -0400 Subject: [PATCH 106/232] [PATCH] NFS: Fix typo in nfs_get_client() Commit ca4aa09635516258f158a7bc1594a794e4c34864 fixed waiting for the structure to get initialised, but it is also possible to break out of the loop while still in TASK_INTERRUPTIBLE. Replace the whole thing by wait_event_interruptible, which is much more readable, and doesn't suffer from these problems. Signed-off-by: Trond Myklebust Signed-off-by: Linus Torvalds --- fs/nfs/client.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index d2533e214255..013cdbc3b000 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -322,25 +322,11 @@ found_client: if (new) nfs_free_client(new); - if (clp->cl_cons_state == NFS_CS_INITING) { - DECLARE_WAITQUEUE(myself, current); - - add_wait_queue(&nfs_client_active_wq, &myself); - - for (;;) { - set_current_state(TASK_INTERRUPTIBLE); - if (signal_pending(current) || - clp->cl_cons_state != NFS_CS_INITING) - break; - schedule(); - } - - remove_wait_queue(&nfs_client_active_wq, &myself); - - if (signal_pending(current)) { - nfs_put_client(clp); - return ERR_PTR(-ERESTARTSYS); - } + error = wait_event_interruptible(&nfs_client_active_wq, + clp->cl_cons_state != NFS_CS_INITING); + if (error < 0) { + nfs_put_client(clp); + return ERR_PTR(-ERESTARTSYS); } if (clp->cl_cons_state < NFS_CS_READY) { From e24bb60e11e3fe9858b71874a4ac59333adbc4fc Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 8 Oct 2006 15:38:22 -0700 Subject: [PATCH 107/232] Revert "[POWERPC] Don't get PCI IRQ from OF for devices with no IRQ" This reverts commit 41550c5128150175197257b6ceab2cd50dea7b51. Quoth Ben Herrenschmidt: "Please revert this one for now. It seems to break G5s :( Looks like PCI cells inside Apple IO ASICs don't have a PCI_INTERRUPT_LINE set. I need to figure out a better fix." Signed-off-by: Linus Torvalds --- arch/powerpc/kernel/prom_parse.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 17fcb4842fe5..603dff3ad62a 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c @@ -914,17 +914,6 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) u8 pin; int rc; - /* We need to first check if the PCI device has a PCI interrupt at all - * since we have cases where the device-node might expose non-PCI - * interrupts, but the device has no PCI interrupt to it - */ - rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); - if (rc != 0) - return rc; - /* No pin, exit */ - if (pin == 0) - return -ENODEV; - /* Check if we have a device node, if yes, fallback to standard OF * parsing */ @@ -936,6 +925,12 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) * interrupt spec. we assume #interrupt-cells is 1, which is standard * for PCI. If you do different, then don't use that routine. */ + rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); + if (rc != 0) + return rc; + /* No pin, exit */ + if (pin == 0) + return -ENODEV; /* Now we walk up the PCI tree */ lspec = pin; From b104189c203a47219e51ab179e50fd0c73ccea3b Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 00:15:27 +0100 Subject: [PATCH 108/232] handle_sysrq lost its pt_regs * argument Signed-off-by: Ralf Baechle --- arch/ppc/4xx_io/serial_sicc.c | 2 +- arch/um/drivers/mconsole_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c index 87fe9a89dba7..080a20531f8b 100644 --- a/arch/ppc/4xx_io/serial_sicc.c +++ b/arch/ppc/4xx_io/serial_sicc.c @@ -441,7 +441,7 @@ siccuart_rx_chars(struct SICC_info *info, struct pt_regs *regs) #ifdef SUPPORT_SYSRQ if (info->sysrq) { if (ch && time_before(jiffies, info->sysrq)) { - handle_sysrq(ch, regs, NULL); + handle_sysrq(ch, NULL); info->sysrq = 0; goto ignore_char; } diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index a67dcbd78de4..8568abff66b4 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -675,7 +675,7 @@ static void sysrq_proc(void *arg) { char *op = arg; - handle_sysrq(*op, ¤t->thread.regs, NULL); + handle_sysrq(*op, NULL); } void mconsole_sysrq(struct mc_request *req) From d62801e961e148313910ec430e230e488fadc196 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 8 Oct 2006 17:38:18 +0100 Subject: [PATCH 109/232] [MIPS] DEC: pt_regs fixes for dec_intr_halt. Signed-off-by: Ralf Baechle --- arch/mips/dec/reset.c | 2 +- arch/mips/dec/setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/dec/reset.c b/arch/mips/dec/reset.c index f78c6da47921..8c95ea19efbe 100644 --- a/arch/mips/dec/reset.c +++ b/arch/mips/dec/reset.c @@ -35,7 +35,7 @@ void ATTRIB_NORET dec_machine_power_off(void) back_to_prom(); } -irqreturn_t dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t dec_intr_halt(int irq, void *dev_id) { dec_machine_halt(); } diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c index d43241c2f541..6b7481e97bec 100644 --- a/arch/mips/dec/setup.c +++ b/arch/mips/dec/setup.c @@ -46,7 +46,7 @@ extern void dec_machine_restart(char *command); extern void dec_machine_halt(void); extern void dec_machine_power_off(void); -extern irqreturn_t dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t dec_intr_halt(int irq, void *dev_id); unsigned long dec_kn_slot_base, dec_kn_slot_size; From 2cf69e765a99baacf0121f3312ec84ff1031961d Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 8 Oct 2006 19:19:11 +0100 Subject: [PATCH 110/232] [MIPS] Jazz: Fix I/O port resources. struct resource members were shuffeled a while ago. Signed-off-by: Ralf Baechle --- arch/mips/jazz/setup.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c index 487a9ea1ef00..3a7869fbaf32 100644 --- a/arch/mips/jazz/setup.c +++ b/arch/mips/jazz/setup.c @@ -45,10 +45,27 @@ void __init plat_time_init(struct irqaction *irq) } static struct resource jazz_io_resources[] = { - { "dma1", 0x00, 0x1f, IORESOURCE_BUSY }, - { "timer", 0x40, 0x5f, IORESOURCE_BUSY }, - { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY }, - { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY }, + { + .start = 0x00, + .end = 0x1f, + .name = "dma1", + .flags = IORESOURCE_BUSY + }, { + .start = 0x40, + .end = 0x5f, + .name = "timer", + .end = IORESOURCE_BUSY + }, { + .start = 0x80, + .end = 0x8f, + .name = "dma page reg", + .flags = IORESOURCE_BUSY + }, { + .start = 0xc0, + .end = 0xdf, + .name = "dma2", + .flags = IORESOURCE_BUSY + } }; void __init plat_mem_setup(void) From 3bdcdd681b64fa92934039ff0d217414720a4b1e Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 8 Oct 2006 19:28:44 +0100 Subject: [PATCH 111/232] [MIPS] Jazz: Remove warning. After 7 years probably somebody test this ;) Signed-off-by: Ralf Baechle --- arch/mips/jazz/setup.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c index 3a7869fbaf32..50cecfca7f87 100644 --- a/arch/mips/jazz/setup.c +++ b/arch/mips/jazz/setup.c @@ -98,8 +98,6 @@ void __init plat_mem_setup(void) _machine_halt = jazz_machine_halt; pm_power_off = jazz_machine_power_off; -#warning "Somebody should check if screen_info is ok for Jazz." - screen_info = (struct screen_info) { 0, 0, /* orig-x, orig-y */ 0, /* unused */ From 06e80113c765119e73394a5878c137f2d09a4dcd Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 8 Oct 2006 19:35:00 +0100 Subject: [PATCH 112/232] [MIPS] Jazz: build fix - include Signed-off-by: Ralf Baechle --- arch/mips/jazz/setup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c index 50cecfca7f87..a3354c1f3d70 100644 --- a/arch/mips/jazz/setup.c +++ b/arch/mips/jazz/setup.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include From de4f742b96f286ac20c04dd9c53897a05b412843 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 8 Oct 2006 20:50:12 +0100 Subject: [PATCH 113/232] [MIPS] Jazz defconfig file. Signed-off-by: Ralf Baechle --- arch/mips/configs/jazz_defconfig | 1404 ++++++++++++++++++++++++++++++ 1 file changed, 1404 insertions(+) create mode 100644 arch/mips/configs/jazz_defconfig diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig new file mode 100644 index 000000000000..382083ebea0a --- /dev/null +++ b/arch/mips/configs/jazz_defconfig @@ -0,0 +1,1404 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.19-rc1 +# Sun Oct 8 19:03:07 2006 +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_MTX1 is not set +# CONFIG_MIPS_BOSPORUS is not set +# CONFIG_MIPS_PB1000 is not set +# CONFIG_MIPS_PB1100 is not set +# CONFIG_MIPS_PB1500 is not set +# CONFIG_MIPS_PB1550 is not set +# CONFIG_MIPS_PB1200 is not set +# CONFIG_MIPS_DB1000 is not set +# CONFIG_MIPS_DB1100 is not set +# CONFIG_MIPS_DB1500 is not set +# CONFIG_MIPS_DB1550 is not set +# CONFIG_MIPS_DB1200 is not set +# CONFIG_MIPS_MIRAGE is not set +# CONFIG_BASLER_EXCITE is not set +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MIPS_EV64120 is not set +CONFIG_MACH_JAZZ=y +# CONFIG_LASAT is not set +# CONFIG_MIPS_ATLAS is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SEAD is not set +# CONFIG_WR_PPMC is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_MOMENCO_JAGUAR_ATX is not set +# CONFIG_MOMENCO_OCELOT is not set +# CONFIG_MOMENCO_OCELOT_3 is not set +# CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_G is not set +# CONFIG_MIPS_XXS1500 is not set +# CONFIG_PNX8550_V2PCI is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_DDB5477 is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_QEMU is not set +# CONFIG_MARKEINS is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_PTSWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SNI_RM200_PCI is not set +# CONFIG_TOSHIBA_JMR3927 is not set +# CONFIG_TOSHIBA_RBTX4927 is not set +# CONFIG_TOSHIBA_RBTX4938 is not set +# CONFIG_ACER_PICA_61 is not set +# CONFIG_MIPS_MAGNUM_4000 is not set +CONFIG_OLIVETTI_M700=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_TIME=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_ARC=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_NEED_PCI_MAP_STATE=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_I8259=y +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_ARC32=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 +CONFIG_ARC_MEMORY=y +CONFIG_ARC_PROMLIB=y + +# +# CPU selection +# +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPS32_R2 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set +# CONFIG_CPU_R3000 is not set +# CONFIG_CPU_TX39XX is not set +# CONFIG_CPU_VR41XX is not set +# CONFIG_CPU_R4300 is not set +CONFIG_CPU_R4X00=y +# CONFIG_CPU_TX49XX is not set +# CONFIG_CPU_R5000 is not set +# CONFIG_CPU_R5432 is not set +# CONFIG_CPU_R6000 is not set +# CONFIG_CPU_NEVADA is not set +# CONFIG_CPU_R8000 is not set +# CONFIG_CPU_R10000 is not set +# CONFIG_CPU_RM7000 is not set +# CONFIG_CPU_RM9000 is not set +# CONFIG_CPU_SB1 is not set +CONFIG_SYS_HAS_CPU_R4X00=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y + +# +# Kernel type +# +CONFIG_32BIT=y +# CONFIG_64BIT is not set +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_8KB is not set +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_MIPS_MT_SMP is not set +# CONFIG_MIPS_MT_SMTC is not set +# CONFIG_MIPS_VPE_LOADER is not set +# CONFIG_64BIT_PHYS_ADDR is not set +CONFIG_CPU_HAS_LLSC=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_RESOURCES_64BIT is not set +# CONFIG_HZ_48 is not set +CONFIG_HZ_100=y +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +# CONFIG_HZ_1000 is not set +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_100HZ=y +CONFIG_HZ=100 +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +# CONFIG_PREEMPT is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_IPC_NS is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +# CONFIG_TASKSTATS is not set +# CONFIG_UTS_NS is not set +# CONFIG_AUDIT is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_RELAY=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +# CONFIG_SYSCTL_SYSCALL is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_SLAB=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_RT_MUTEXES=y +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 +# CONFIG_SLOB is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + +# +# Block layer +# +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_AS=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="anticipatory" + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_ISA=y +CONFIG_MMU=y +CONFIG_I8253=y + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PCI Hotplug Support +# + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_TRAD_SIGNALS=y + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +# CONFIG_NETDEBUG is not set +CONFIG_PACKET=m +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_NET_KEY=m +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +CONFIG_IPV6_ROUTER_PREF=y +CONFIG_IPV6_ROUTE_INFO=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_SUBTREES is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_NETWORK_SECMARK=y +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_SECMARK=m +# CONFIG_NETFILTER_XT_TARGET_CONNSECMARK is not set +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CONNTRACK_SECMARK=y +CONFIG_IP_NF_CONNTRACK_EVENTS=y +CONFIG_IP_NF_CONNTRACK_NETLINK=m +CONFIG_IP_NF_CT_PROTO_SCTP=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +# CONFIG_IP_NF_NETBIOS_NS is not set +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +CONFIG_IP_NF_PPTP=m +CONFIG_IP_NF_H323=m +CONFIG_IP_NF_SIP=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_NAT_SNMP_BASIC=m +CONFIG_IP_NF_NAT_IRC=m +CONFIG_IP_NF_NAT_FTP=m +CONFIG_IP_NF_NAT_TFTP=m +CONFIG_IP_NF_NAT_AMANDA=m +CONFIG_IP_NF_NAT_PPTP=m +CONFIG_IP_NF_NAT_H323=m +CONFIG_IP_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration (EXPERIMENTAL) +# +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_RAW=m + +# +# DECnet: Netfilter Configuration +# +CONFIG_DECNET_NF_GRABULATOR=m + +# +# Bridge: Netfilter Configuration +# +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set + +# +# TIPC Configuration (EXPERIMENTAL) +# +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +CONFIG_BRIDGE=m +# CONFIG_VLAN_8021Q is not set +CONFIG_DECNET=m +# CONFIG_DECNET_ROUTER is not set +CONFIG_LLC=m +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CLK_JIFFIES=y +# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set +# CONFIG_NET_SCH_CLK_CPU is not set + +# +# Queueing/Scheduling +# +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m + +# +# Classification +# +CONFIG_NET_CLS=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +# CONFIG_CLS_U32_PERF is not set +# CONFIG_CLS_U32_MARK is not set +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_CLS_ACT is not set +CONFIG_NET_CLS_POLICE=y +# CONFIG_NET_CLS_IND is not set +CONFIG_NET_ESTIMATOR=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +CONFIG_HAMRADIO=y + +# +# Packet Radio protocols +# +CONFIG_AX25=m +CONFIG_AX25_DAMA_SLAVE=y +CONFIG_NETROM=m +CONFIG_ROSE=m + +# +# AX.25 network device drivers +# +CONFIG_MKISS=m +CONFIG_6PACK=m +CONFIG_BPQETHER=m +# CONFIG_BAYCOM_SER_FDX is not set +# CONFIG_BAYCOM_SER_HDX is not set +# CONFIG_BAYCOM_PAR is not set +# CONFIG_BAYCOM_EPP is not set +# CONFIG_YAM is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +CONFIG_IEEE80211=m +# CONFIG_IEEE80211_DEBUG is not set +CONFIG_IEEE80211_CRYPT_WEP=m +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_WIRELESS_EXT=y + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_SYS_HYPERVISOR is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +CONFIG_CONNECTOR=m + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +# CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_PC_SUPERIO is not set +# CONFIG_PARPORT_GSC is not set +# CONFIG_PARPORT_AX88796 is not set +CONFIG_PARPORT_1284=y + +# +# Plug and Play support +# +# CONFIG_PNP is not set + +# +# Block devices +# +CONFIG_BLK_DEV_FD=m +CONFIG_PARIDE=m +CONFIG_PARIDE_PARPORT=m + +# +# Parallel IDE high-level drivers +# +CONFIG_PARIDE_PD=m +CONFIG_PARIDE_PCD=m +CONFIG_PARIDE_PF=m +CONFIG_PARIDE_PT=m +CONFIG_PARIDE_PG=m + +# +# Parallel IDE protocol modules +# +CONFIG_PARIDE_ATEN=m +CONFIG_PARIDE_BPCK=m +CONFIG_PARIDE_BPCK6=m +CONFIG_PARIDE_COMM=m +CONFIG_PARIDE_DSTR=m +CONFIG_PARIDE_FIT2=m +CONFIG_PARIDE_FIT3=m +CONFIG_PARIDE_EPAT=m +# CONFIG_PARIDE_EPATC8 is not set +CONFIG_PARIDE_EPIA=m +CONFIG_PARIDE_FRIQ=m +CONFIG_PARIDE_FRPW=m +CONFIG_PARIDE_KBIC=m +CONFIG_PARIDE_KTTI=m +CONFIG_PARIDE_ON20=m +CONFIG_PARIDE_ON26=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_RAID_ATTRS=m +CONFIG_SCSI=y +CONFIG_SCSI_NETLINK=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_CHR_DEV_ST=m +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +CONFIG_BLK_DEV_SR_VENDOR=y +# CONFIG_CHR_DEV_SG is not set +# CONFIG_CHR_DEV_SCH is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCSI_FC_ATTRS=y +CONFIG_SCSI_ISCSI_ATTRS=m +CONFIG_SCSI_SAS_ATTRS=m +# CONFIG_SCSI_SAS_LIBSAS is not set + +# +# SCSI low-level drivers +# +CONFIG_ISCSI_TCP=m +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set +CONFIG_SCSI_PPA=m +CONFIG_SCSI_IMM=m +# CONFIG_SCSI_IZIP_EPP16 is not set +# CONFIG_SCSI_IZIP_SLOW_CTR is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_DEBUG is not set +CONFIG_JAZZ_ESP=y + +# +# Serial ATA (prod) and Parallel ATA (experimental) drivers +# +# CONFIG_ATA is not set + +# +# Old CD-ROM drivers (not SCSI, not IDE) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Multi-device support (RAID and LVM) +# +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID456=m +CONFIG_MD_RAID5_RESHAPE=y +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_CRYPT is not set +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +CONFIG_DUMMY=m +CONFIG_BONDING=m +CONFIG_EQUALIZER=m +CONFIG_TUN=m + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# PHY device support +# +CONFIG_PHYLIB=m + +# +# MII PHY device drivers +# +CONFIG_MARVELL_PHY=m +CONFIG_DAVICOM_PHY=m +CONFIG_QSEMI_PHY=m +CONFIG_LXT_PHY=m +CONFIG_CICADA_PHY=m +CONFIG_VITESSE_PHY=m +CONFIG_SMSC_PHY=m +# CONFIG_FIXED_PHY is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +CONFIG_MIPS_JAZZ_SONIC=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_DM9000 is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set +# CONFIG_HP100 is not set +CONFIG_NET_ISA=y +# CONFIG_E2100 is not set +# CONFIG_EWRK3 is not set +# CONFIG_EEXPRESS is not set +# CONFIG_EEXPRESS_PRO is not set +# CONFIG_HPLAN_PLUS is not set +# CONFIG_HPLAN is not set +# CONFIG_LP486E is not set +# CONFIG_ETH16I is not set +CONFIG_NE2000=m +# CONFIG_SEEQ8005 is not set +CONFIG_NET_PCI=y +# CONFIG_AC3200 is not set +# CONFIG_APRICOT is not set +# CONFIG_CS89x0 is not set +# CONFIG_LAN_SAA9730 is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +CONFIG_PLIP=m +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_INPORT is not set +# CONFIG_MOUSE_LOGIBM is not set +# CONFIG_MOUSE_PC110PAD is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=y +CONFIG_SERIO_PARKBD=m +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=m +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +# CONFIG_SERIAL_8250_MANY_PORTS is not set +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_8250_DETECT_IRQ=y +CONFIG_SERIAL_8250_RSA=y + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=m +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_PRINTER=m +# CONFIG_LP_CONSOLE is not set +CONFIG_PPDEV=m +CONFIG_TIPAR=m + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_HW_RANDOM is not set +CONFIG_RTC=m +# CONFIG_GEN_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_RAW_DRIVER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set +# CONFIG_TELCLOCK is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# SPI support +# +# CONFIG_SPI is not set +# CONFIG_SPI_MASTER is not set + +# +# Dallas's 1-wire bus +# +CONFIG_W1=m +CONFIG_W1_CON=y + +# +# 1-wire Bus Masters +# + +# +# 1-wire Slaves +# +# CONFIG_W1_SLAVE_THERM is not set +# CONFIG_W1_SLAVE_SMEM is not set +# CONFIG_W1_SLAVE_DS2433 is not set + +# +# Hardware Monitoring support +# +# CONFIG_HWMON is not set +# CONFIG_HWMON_VID is not set + +# +# Misc devices +# +# CONFIG_TIFM_CORE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB is not set + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +# CONFIG_MDA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_USB_ARCH_HAS_EHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# LED devices +# +# CONFIG_NEW_LEDS is not set + +# +# LED drivers +# + +# +# LED Triggers +# + +# +# InfiniBand support +# + +# +# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) +# + +# +# Real Time Clock +# +# CONFIG_RTC_CLASS is not set + +# +# DMA Engine support +# +# CONFIG_DMA_ENGINE is not set + +# +# DMA Clients +# + +# +# DMA Devices +# + +# +# File systems +# +CONFIG_EXT2_FS=m +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_RT is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +CONFIG_MINIX_FS=m +CONFIG_ROMFS_FS=m +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y +# CONFIG_CONFIGFS_FS is not set + +# +# Miscellaneous filesystems +# +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_AFFS_FS=m +# CONFIG_ECRYPT_FS is not set +CONFIG_HFS_FS=m +# CONFIG_HFSPLUS_FS is not set +CONFIG_BEFS_FS=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BFS_FS=m +CONFIG_EFS_FS=m +CONFIG_CRAMFS=m +CONFIG_VXFS_FS=m +CONFIG_HPFS_FS=m +CONFIG_QNX4FS_FS=m +CONFIG_SYSV_FS=m +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +# CONFIG_NFSD_V4 is not set +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_SMB_FS=m +# CONFIG_SMB_NLS_DEFAULT is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_EXPERIMENTAL is not set +CONFIG_NCP_FS=m +CONFIG_NCPFS_PACKET_SIGNING=y +CONFIG_NCPFS_IOCTL_LOCKING=y +CONFIG_NCPFS_STRONG=y +CONFIG_NCPFS_NFS_NS=y +CONFIG_NCPFS_OS2_NS=y +CONFIG_NCPFS_SMALLDOS=y +CONFIG_NCPFS_NLS=y +CONFIG_NCPFS_EXTRAS=y +CONFIG_CODA_FS=m +CONFIG_CODA_FS_OLD_API=y +CONFIG_AFS_FS=m +CONFIG_RXRPC=m +# CONFIG_9P_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +CONFIG_NLS=m +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Distributed Lock Manager +# + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +# CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_MUST_CHECK=y +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_KERNEL is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_DEBUG_FS is not set +CONFIG_CROSSCOMPILE=y +CONFIG_CMDLINE="" + +# +# Security options +# +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=m +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +# CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# + +# +# Library routines +# +CONFIG_CRC_CCITT=m +CONFIG_CRC16=m +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_PLIST=y From d864b96bb08f88d000cf8f78b5bac93fe631d0f5 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 8 Oct 2006 21:32:40 +0100 Subject: [PATCH 114/232] [MIPS] Ocelot C: Build fix - ll_mv64340_irq takes no more regs argument. Signed-off-by: Ralf Baechle --- arch/mips/momentum/ocelot_c/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c index 4be7b26e30ef..ea65223a6d2c 100644 --- a/arch/mips/momentum/ocelot_c/irq.c +++ b/arch/mips/momentum/ocelot_c/irq.c @@ -79,7 +79,7 @@ asmlinkage void plat_irq_dispatch(void) else if (pending & STATUSF_IP5) ll_cpci_irq(); else if (pending & STATUSF_IP6) - ll_mv64340_irq(regs); + ll_mv64340_irq(); else if (pending & STATUSF_IP7) do_IRQ(7); else From 65542070de7d6cd307657a71ab1712a6c58c0889 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 8 Oct 2006 23:56:13 +0100 Subject: [PATCH 115/232] [MIPS] Fix return type of gt64120_irq. Signed-off-by: Ralf Baechle --- arch/mips/gt64120/common/time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/mips/gt64120/common/time.c b/arch/mips/gt64120/common/time.c index b203169f19ce..efafabdd5bbf 100644 --- a/arch/mips/gt64120/common/time.c +++ b/arch/mips/gt64120/common/time.c @@ -20,7 +20,7 @@ * differently than other MIPS interrupts. */ -static void gt64120_irq(int irq, void *dev_id) +static irqreturn_t gt64120_irq(int irq, void *dev_id) { unsigned int irq_src, int_high_src, irq_src_mask, int_high_src_mask; int handled = 0; @@ -43,6 +43,8 @@ static void gt64120_irq(int irq, void *dev_id) GT_WRITE(GT_INTRCAUSE_OFS, 0); GT_WRITE(GT_HINTRCAUSE_OFS, 0); + + return IRQ_HANDLED; } /* From 6dab2f4564b3dc8747452e256fb779f320ff5650 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 00:00:31 +0100 Subject: [PATCH 116/232] [MIPS] DEC: pt_regs fixes for buserror handlers Signed-off-by: Ralf Baechle --- arch/mips/dec/ecc-berr.c | 5 ++++- arch/mips/dec/kn01-berr.c | 4 ++-- arch/mips/dec/kn02xa-berr.c | 6 ++++-- include/asm-mips/dec/ecc.h | 3 +-- include/asm-mips/dec/kn01.h | 3 +-- include/asm-mips/dec/kn02xa.h | 3 +-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c index cc24c5ed0c05..3e374d05978f 100644 --- a/arch/mips/dec/ecc-berr.c +++ b/arch/mips/dec/ecc-berr.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -200,8 +201,10 @@ int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup) return dec_ecc_be_backend(regs, is_fixup, 0); } -irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id) { + struct pt_regs *regs = get_irq_regs(); + int action = dec_ecc_be_backend(regs, 0, 1); if (action == MIPS_BE_DISCARD) diff --git a/arch/mips/dec/kn01-berr.c b/arch/mips/dec/kn01-berr.c index b9271db9bc76..f19b4617a0a6 100644 --- a/arch/mips/dec/kn01-berr.c +++ b/arch/mips/dec/kn01-berr.c @@ -150,10 +150,10 @@ int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup) return dec_kn01_be_backend(regs, is_fixup, 0); } -irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id) { volatile u16 *csr = (void *)CKSEG1ADDR(KN01_SLOT_BASE + KN01_CSR); + struct pt_regs *regs = get_irq_regs(); int action; if (!(*csr & KN01_CSR_MEMERR)) diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c index 6cd3f94f79fe..7a053aadcd3a 100644 --- a/arch/mips/dec/kn02xa-berr.c +++ b/arch/mips/dec/kn02xa-berr.c @@ -21,6 +21,8 @@ #include #include +#include +#include #include #include @@ -104,9 +106,9 @@ int dec_kn02xa_be_handler(struct pt_regs *regs, int is_fixup) return dec_kn02xa_be_backend(regs, is_fixup, 0); } -irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id) { + struct pt_regs *regs = get_irq_regs(); int action = dec_kn02xa_be_backend(regs, 0, 1); if (action == MIPS_BE_DISCARD) diff --git a/include/asm-mips/dec/ecc.h b/include/asm-mips/dec/ecc.h index 19495a490e72..707ffdbc9add 100644 --- a/include/asm-mips/dec/ecc.h +++ b/include/asm-mips/dec/ecc.h @@ -49,8 +49,7 @@ struct pt_regs; extern void dec_ecc_be_init(void); extern int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup); -extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, - struct pt_regs *regs); +extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id); #endif #endif /* __ASM_MIPS_DEC_ECC_H */ diff --git a/include/asm-mips/dec/kn01.h b/include/asm-mips/dec/kn01.h index eb522aa1e226..28fa717ac423 100644 --- a/include/asm-mips/dec/kn01.h +++ b/include/asm-mips/dec/kn01.h @@ -84,8 +84,7 @@ extern spinlock_t kn01_lock; extern void dec_kn01_be_init(void); extern int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup); -extern irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id, - struct pt_regs *regs); +extern irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id); #endif #endif /* __ASM_MIPS_DEC_KN01_H */ diff --git a/include/asm-mips/dec/kn02xa.h b/include/asm-mips/dec/kn02xa.h index a25f3d7da7f7..b56b4577f6ef 100644 --- a/include/asm-mips/dec/kn02xa.h +++ b/include/asm-mips/dec/kn02xa.h @@ -78,8 +78,7 @@ struct pt_regs; extern void dec_kn02xa_be_init(void); extern int dec_kn02xa_be_handler(struct pt_regs *regs, int is_fixup); -extern irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id, - struct pt_regs *regs); +extern irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id); #endif #endif /* __ASM_MIPS_DEC_KN02XA_H */ From 27f768192fe2d96936cef5d4713e228daee07ae2 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 00:03:05 +0100 Subject: [PATCH 117/232] [MIPS] Cleanup unnecessary inclusions. Signed-off-by: Ralf Baechle --- arch/mips/au1000/common/time.c | 1 - arch/mips/cobalt/irq.c | 1 - arch/mips/dec/reset.c | 1 - arch/mips/gt64120/common/time.c | 1 - arch/mips/gt64120/ev64120/setup.c | 1 - arch/mips/gt64120/momenco_ocelot/setup.c | 1 - arch/mips/jazz/setup.c | 1 - arch/mips/kernel/irq-msc01.c | 9 +++++---- arch/mips/kernel/irq-mv6434x.c | 3 +-- arch/mips/mips-boards/generic/time.c | 1 - arch/mips/mips-boards/sim/sim_time.c | 1 - arch/mips/momentum/jaguar_atx/setup.c | 1 - arch/mips/momentum/ocelot_3/setup.c | 1 - arch/mips/momentum/ocelot_c/cpci-irq.c | 1 - arch/mips/momentum/ocelot_c/setup.c | 1 - arch/mips/momentum/ocelot_c/uart-irq.c | 1 - arch/mips/momentum/ocelot_g/gt-irq.c | 1 - arch/mips/momentum/ocelot_g/setup.c | 1 - arch/mips/pmc-sierra/yosemite/setup.c | 1 - arch/mips/sgi-ip27/ip27-irq.c | 1 - arch/mips/sgi-ip32/crime.c | 1 - arch/mips/sibyte/bcm1480/irq.c | 1 - arch/mips/sibyte/bcm1480/time.c | 1 - arch/mips/sibyte/sb1250/irq.c | 1 - arch/mips/sibyte/sb1250/time.c | 1 - arch/mips/sni/setup.c | 1 - arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c | 1 - .../tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c | 1 - arch/mips/tx4938/toshiba_rbtx4938/irq.c | 1 - 29 files changed, 6 insertions(+), 33 deletions(-) diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index 1989d56139c8..dd9c364b4746 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c @@ -41,7 +41,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c index 1117fab19733..82e569d5b02c 100644 --- a/arch/mips/cobalt/irq.c +++ b/arch/mips/cobalt/irq.c @@ -16,7 +16,6 @@ #include #include #include -#include #include diff --git a/arch/mips/dec/reset.c b/arch/mips/dec/reset.c index 8c95ea19efbe..56397227adb0 100644 --- a/arch/mips/dec/reset.c +++ b/arch/mips/dec/reset.c @@ -8,7 +8,6 @@ #include #include -#include typedef void ATTRIB_NORET (* noret_func_t)(void); diff --git a/arch/mips/gt64120/common/time.c b/arch/mips/gt64120/common/time.c index efafabdd5bbf..c83ae6acd601 100644 --- a/arch/mips/gt64120/common/time.c +++ b/arch/mips/gt64120/common/time.c @@ -11,7 +11,6 @@ #include #include #include -#include #include /* diff --git a/arch/mips/gt64120/ev64120/setup.c b/arch/mips/gt64120/ev64120/setup.c index 4236da31ecc6..91c2d3f41617 100644 --- a/arch/mips/gt64120/ev64120/setup.c +++ b/arch/mips/gt64120/ev64120/setup.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c index 9804642ecf89..0e5bbee2d5b7 100644 --- a/arch/mips/gt64120/momenco_ocelot/setup.c +++ b/arch/mips/gt64120/momenco_ocelot/setup.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c index a3354c1f3d70..6dc4135d6e11 100644 --- a/arch/mips/jazz/setup.c +++ b/arch/mips/jazz/setup.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c index 71e8e45f3687..650a80ca3741 100644 --- a/arch/mips/kernel/irq-msc01.c +++ b/arch/mips/kernel/irq-msc01.c @@ -1,16 +1,17 @@ /* - * Copyright (c) 2004 MIPS Inc - * Author: chris@mips.com - * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. + * + * Copyright (c) 2004 MIPS Inc + * Author: chris@mips.com + * + * Copyright (C) 2004, 06 Ralf Baechle */ #include #include #include -#include #include #include #include diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c index 39c94fd8d8ba..37d106202b83 100644 --- a/arch/mips/kernel/irq-mv6434x.c +++ b/arch/mips/kernel/irq-mv6434x.c @@ -1,7 +1,7 @@ /* * Copyright 2002 Momentum Computer * Author: mdharm@momenco.com - * Copyright (C) 2004 Ralf Baechle + * Copyright (C) 2004, 06 Ralf Baechle * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c index d379000162f3..6f8a9fe7c1e3 100644 --- a/arch/mips/mips-boards/generic/time.c +++ b/arch/mips/mips-boards/generic/time.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/mips-boards/sim/sim_time.c b/arch/mips/mips-boards/sim/sim_time.c index acd83a379559..c566b9bd0427 100644 --- a/arch/mips/mips-boards/sim/sim_time.c +++ b/arch/mips/mips-boards/sim/sim_time.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c index e6fe2992227d..5a510142b978 100644 --- a/arch/mips/momentum/jaguar_atx/setup.c +++ b/arch/mips/momentum/jaguar_atx/setup.c @@ -62,7 +62,6 @@ #include #include #include -#include #include #include diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c index 435d0787329e..7d74f8c54129 100644 --- a/arch/mips/momentum/ocelot_3/setup.c +++ b/arch/mips/momentum/ocelot_3/setup.c @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_c/cpci-irq.c b/arch/mips/momentum/ocelot_c/cpci-irq.c index 2fb14bb08e67..47e3fa32b075 100644 --- a/arch/mips/momentum/ocelot_c/cpci-irq.c +++ b/arch/mips/momentum/ocelot_c/cpci-irq.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c index 36f570ecc6fb..9c0c462af650 100644 --- a/arch/mips/momentum/ocelot_c/setup.c +++ b/arch/mips/momentum/ocelot_c/setup.c @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_c/uart-irq.c b/arch/mips/momentum/ocelot_c/uart-irq.c index f8efe2370ffd..510257dc205a 100644 --- a/arch/mips/momentum/ocelot_c/uart-irq.c +++ b/arch/mips/momentum/ocelot_c/uart-irq.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_g/gt-irq.c b/arch/mips/momentum/ocelot_g/gt-irq.c index b8cffa80548f..7b5cc6648f7e 100644 --- a/arch/mips/momentum/ocelot_g/gt-irq.c +++ b/arch/mips/momentum/ocelot_g/gt-irq.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_g/setup.c b/arch/mips/momentum/ocelot_g/setup.c index c580b1de33bc..56ec47039c16 100644 --- a/arch/mips/momentum/ocelot_g/setup.c +++ b/arch/mips/momentum/ocelot_g/setup.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c index 0a6ee8e5eec2..1b9b0d396d3e 100644 --- a/arch/mips/pmc-sierra/yosemite/setup.c +++ b/arch/mips/pmc-sierra/yosemite/setup.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index f41587a206e2..f01ba1f90770 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/sgi-ip32/crime.c b/arch/mips/sgi-ip32/crime.c index f1f2c45a6c80..bff508704d03 100644 --- a/arch/mips/sgi-ip32/crime.c +++ b/arch/mips/sgi-ip32/crime.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index 0c00f676b8b3..8b1f41484923 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/arch/mips/sibyte/bcm1480/time.c b/arch/mips/sibyte/bcm1480/time.c index f228f711dc34..bf12af46132e 100644 --- a/arch/mips/sibyte/bcm1480/time.c +++ b/arch/mips/sibyte/bcm1480/time.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index f6d2e19592ea..d5d26770daf6 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c index 0d17aec03dd7..0ccf1796dd78 100644 --- a/arch/mips/sibyte/sb1250/time.c +++ b/arch/mips/sibyte/sb1250/time.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index 4e98feb15410..afeb7f13e5b5 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c index b0f021f2a6c4..3e24413d4c09 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c @@ -127,7 +127,6 @@ JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthB #include #include #include -#include #include #include #include diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index bea19098ac28..735cb8778f4c 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c index 83f2750825a4..bbb3390e98f7 100644 --- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c +++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c @@ -81,7 +81,6 @@ IRQ Device #include #include #include -#include #include #include #include From 7bea96fd22a8fd19f90817405b4abe032317a0e3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 22:49:34 +0100 Subject: [PATCH 118/232] [PATCH] uml pt_regs fixes Real fix for UML pt_regs stuff. Note set_irq_regs() logics in there... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/um/drivers/line.c | 7 +++---- arch/um/drivers/mconsole_kern.c | 8 ++++---- arch/um/drivers/net_kern.c | 2 +- arch/um/drivers/port_kern.c | 4 ++-- arch/um/drivers/ubd_kern.c | 2 +- arch/um/drivers/xterm_kern.c | 2 +- arch/um/include/irq_kern.h | 5 ++--- arch/um/kernel/irq.c | 15 ++++++++------- arch/um/kernel/sigio.c | 2 +- arch/um/kernel/time.c | 2 +- 10 files changed, 24 insertions(+), 25 deletions(-) diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index cfd9f01fd464..426633e5d6e3 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -20,7 +20,7 @@ #define LINE_BUFSIZE 4096 -static irqreturn_t line_interrupt(int irq, void *data, struct pt_regs *unused) +static irqreturn_t line_interrupt(int irq, void *data) { struct chan *chan = data; struct line *line = chan->line; @@ -364,8 +364,7 @@ void line_unthrottle(struct tty_struct *tty) reactivate_chan(&line->chan_list, line->driver->read_irq); } -static irqreturn_t line_write_interrupt(int irq, void *data, - struct pt_regs *unused) +static irqreturn_t line_write_interrupt(int irq, void *data) { struct chan *chan = data; struct line *line = chan->line; @@ -712,7 +711,7 @@ struct winch { struct tty_struct *tty; }; -static irqreturn_t winch_interrupt(int irq, void *data, struct pt_regs *unused) +static irqreturn_t winch_interrupt(int irq, void *data) { struct winch *winch = data; struct tty_struct *tty; diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index a67dcbd78de4..d08bd036ccb8 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -74,8 +74,7 @@ static void mc_work_proc(void *unused) static DECLARE_WORK(mconsole_work, mc_work_proc, NULL); -static irqreturn_t mconsole_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t mconsole_interrupt(int irq, void *dev_id) { /* long to avoid size mismatch warnings from gcc */ long fd; @@ -674,8 +673,9 @@ static void with_console(struct mc_request *req, void (*proc)(void *), static void sysrq_proc(void *arg) { char *op = arg; - - handle_sysrq(*op, ¤t->thread.regs, NULL); + struct pt_regs *old_regs = set_irq_regs(¤t->thread.regs); + handle_sysrq(*op, NULL); + set_irq_regs(old_regs); } void mconsole_sysrq(struct mc_request *req) diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index c1c5604752fb..ec9eb8bd9432 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c @@ -77,7 +77,7 @@ static void uml_dev_close(void* dev) dev_close( (struct net_device *) dev); } -irqreturn_t uml_net_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t uml_net_interrupt(int irq, void *dev_id) { struct net_device *dev = dev_id; struct uml_net_private *lp = dev->priv; diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index 73755f37a8a8..ce9f3733f73e 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c @@ -47,7 +47,7 @@ struct connection { struct port_list *port; }; -static irqreturn_t pipe_interrupt(int irq, void *data, struct pt_regs *regs) +static irqreturn_t pipe_interrupt(int irq, void *data) { struct connection *conn = data; int fd; @@ -152,7 +152,7 @@ void port_work_proc(void *unused) DECLARE_WORK(port_work, port_work_proc, NULL); -static irqreturn_t port_interrupt(int irq, void *data, struct pt_regs *regs) +static irqreturn_t port_interrupt(int irq, void *data) { struct port_list *port = data; diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index f0b0668458b7..bc458f57921b 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -524,7 +524,7 @@ static void ubd_handler(void) do_ubd_request(ubd_queue); } -static irqreturn_t ubd_intr(int irq, void *dev, struct pt_regs *unused) +static irqreturn_t ubd_intr(int irq, void *dev) { ubd_handler(); return(IRQ_HANDLED); diff --git a/arch/um/drivers/xterm_kern.c b/arch/um/drivers/xterm_kern.c index 6036ec85895a..a4ce7058e10e 100644 --- a/arch/um/drivers/xterm_kern.c +++ b/arch/um/drivers/xterm_kern.c @@ -21,7 +21,7 @@ struct xterm_wait { int new_fd; }; -static irqreturn_t xterm_interrupt(int irq, void *data, struct pt_regs *regs) +static irqreturn_t xterm_interrupt(int irq, void *data) { struct xterm_wait *xterm = data; int fd; diff --git a/arch/um/include/irq_kern.h b/arch/um/include/irq_kern.h index c222d56b1494..81beb1841299 100644 --- a/arch/um/include/irq_kern.h +++ b/arch/um/include/irq_kern.h @@ -10,12 +10,11 @@ #include "asm/ptrace.h" extern int um_request_irq(unsigned int irq, int fd, int type, - irqreturn_t (*handler)(int, void *, - struct pt_regs *), + irqreturn_t (*handler)(int, void *), unsigned long irqflags, const char * devname, void *dev_id); extern int init_aio_irq(int irq, char *name, - irqreturn_t (*handler)(int, void *, struct pt_regs *)); + irqreturn_t (*handler)(int, void *)); #endif diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 7c41dabe7a2c..3c01c2bc979a 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -355,14 +355,16 @@ void forward_interrupts(int pid) */ unsigned int do_IRQ(int irq, union uml_pt_regs *regs) { - irq_enter(); - __do_IRQ(irq); - irq_exit(); - return 1; + struct pt_regs *old_regs = set_irq_regs((struct pt_regs *)regs); + irq_enter(); + __do_IRQ(irq); + irq_exit(); + set_irq_regs(old_regs); + return 1; } int um_request_irq(unsigned int irq, int fd, int type, - irqreturn_t (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *), unsigned long irqflags, const char * devname, void *dev_id) { @@ -423,8 +425,7 @@ void __init init_IRQ(void) } } -int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *, - struct pt_regs *)) +int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *)) { int fds[2], err; diff --git a/arch/um/kernel/sigio.c b/arch/um/kernel/sigio.c index 0ad755ceb212..2b0ab438301c 100644 --- a/arch/um/kernel/sigio.c +++ b/arch/um/kernel/sigio.c @@ -17,7 +17,7 @@ /* Protected by sigio_lock() called from write_sigio_workaround */ static int sigio_irq_fd = -1; -static irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused) +static irqreturn_t sigio_interrupt(int irq, void *data) { char c; diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index a92965f8f9cd..2e354b3ca060 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -86,7 +86,7 @@ static inline unsigned long long get_time(void) return nsecs; } -irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs) +irqreturn_t um_timer(int irq, void *dev) { unsigned long long nsecs; unsigned long flags; From 832504933757ba7913bf64cd574326e014215b41 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 8 Oct 2006 17:28:25 -0700 Subject: [PATCH 119/232] Fix extraneous '&' in recent NFS client cleanup We should pass "wait_event_interruptible()" the wait-queue itself, not the pointer to it. The magic macro will pointerize it internally. Signed-off-by: Linus Torvalds --- fs/nfs/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 013cdbc3b000..34c3996bd0f5 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -322,7 +322,7 @@ found_client: if (new) nfs_free_client(new); - error = wait_event_interruptible(&nfs_client_active_wq, + error = wait_event_interruptible(nfs_client_active_wq, clp->cl_cons_state != NFS_CS_INITING); if (error < 0) { nfs_put_client(clp); From 1622605cf6e15bfdc55a3dc78b792018edded435 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 02:09:49 +0100 Subject: [PATCH 120/232] [PATCH] arm: it's OK to pass pointer to volatile as iounmap() argument... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/arm/mm/ioremap.c | 6 +++--- include/asm-arm/io.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 591fc3187c7f..465440592791 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -361,14 +361,14 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags) } EXPORT_SYMBOL(__ioremap); -void __iounmap(void __iomem *addr) +void __iounmap(volatile void __iomem *addr) { #ifndef CONFIG_SMP struct vm_struct **p, *tmp; #endif unsigned int section_mapping = 0; - addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr); + addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long)addr); #ifndef CONFIG_SMP /* @@ -395,6 +395,6 @@ void __iounmap(void __iomem *addr) #endif if (!section_mapping) - vunmap(addr); + vunmap((void __force *)addr); } EXPORT_SYMBOL(__iounmap); diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 8076a85c3675..34aaaac4f617 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -63,7 +63,7 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); */ extern void __iomem * __ioremap_pfn(unsigned long, unsigned long, size_t, unsigned long); extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); -extern void __iounmap(void __iomem *addr); +extern void __iounmap(volatile void __iomem *addr); /* * Bad read/write accesses... From 58ba81dba77eab43633ea47d82e96245ae3ff666 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 02:11:47 +0100 Subject: [PATCH 121/232] [PATCH] m68k/kernel/dma.c assumes !MMU_SUN3 Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/m68k/kernel/Makefile | 3 ++- include/asm-m68k/dma-mapping.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index dae609797dc0..1c9ecaa473d5 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile @@ -9,10 +9,11 @@ else endif extra-y += vmlinux.lds -obj-y := entry.o process.o traps.o ints.o dma.o signal.o ptrace.o \ +obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o obj-$(CONFIG_PCI) += bios32.o obj-$(CONFIG_MODULES) += module.o +obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo EXTRA_AFLAGS := -traditional diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h index c1299c3beb50..d90d841d3dfd 100644 --- a/include/asm-m68k/dma-mapping.h +++ b/include/asm-m68k/dma-mapping.h @@ -5,6 +5,7 @@ struct scatterlist; +#ifndef CONFIG_MMU_SUN3 static inline int dma_supported(struct device *dev, u64 mask) { return 1; @@ -88,4 +89,8 @@ static inline int dma_mapping_error(dma_addr_t handle) return 0; } +#else +#include +#endif + #endif /* _M68K_DMA_MAPPING_H */ From 40220c1a192f51695f806d75b1f9970f0f17a6e8 Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 9 Oct 2006 12:19:47 +0100 Subject: [PATCH 122/232] IRQ: Use the new typedef for interrupt handler function pointers Use the new typedef for interrupt handler function pointers rather than actually spelling out the full thing each time. This was scripted with the following small shell script: #!/bin/sh egrep -nHrl -e 'irqreturn_t[ ]*[(][*]' $* | while read i do echo $i perl -pi -e 's/irqreturn_t\s*[(]\s*[*]\s*([_a-zA-Z0-9]*)\s*[)]\s*[(]\s*int\s*,\s*void\s*[*]\s*[)]/irq_handler_t \1/g' $i || exit $? done Signed-Off-By: David Howells --- arch/arm/mach-pxa/corgi.c | 2 +- arch/arm/mach-pxa/idp.c | 2 +- arch/arm/mach-pxa/lubbock.c | 4 ++-- arch/arm/mach-pxa/mainstone.c | 2 +- arch/arm/mach-pxa/poodle.c | 2 +- arch/arm/mach-pxa/spitz.c | 2 +- arch/arm/mach-pxa/tosa.c | 2 +- arch/arm/mach-pxa/trizeps4.c | 2 +- arch/ia64/hp/sim/simserial.c | 2 +- arch/m68k/amiga/config.c | 4 ++-- arch/m68k/apollo/config.c | 6 +++--- arch/m68k/atari/config.c | 2 +- arch/m68k/atari/stdma.c | 4 ++-- arch/m68k/atari/time.c | 2 +- arch/m68k/bvme6000/config.c | 6 +++--- arch/m68k/hp300/time.c | 4 ++-- arch/m68k/hp300/time.h | 2 +- arch/m68k/kernel/ints.c | 2 +- arch/m68k/kernel/setup.c | 2 +- arch/m68k/mac/config.c | 4 ++-- arch/m68k/mac/via.c | 2 +- arch/m68k/mvme147/config.c | 6 +++--- arch/m68k/mvme16x/config.c | 6 +++--- arch/m68k/q40/config.c | 2 +- arch/m68k/q40/q40ints.c | 4 ++-- arch/m68k/sun3/config.c | 4 ++-- arch/m68k/sun3x/time.c | 2 +- arch/m68k/sun3x/time.h | 2 +- arch/mips/au1000/common/dma.c | 2 +- arch/mips/au1000/common/irq.c | 2 +- arch/mips/au1000/common/time.c | 2 +- arch/powerpc/kernel/ibmebus.c | 2 +- arch/sparc/kernel/irq.c | 10 +++++----- arch/sparc/kernel/sun4c_irq.c | 2 +- arch/sparc/kernel/sun4d_irq.c | 4 ++-- arch/sparc/kernel/sun4m_irq.c | 2 +- arch/sparc/kernel/tick14.c | 2 +- arch/um/include/irq_kern.h | 4 ++-- arch/um/kernel/irq.c | 4 ++-- include/asm-arm/arch-pxa/mmc.h | 2 +- include/asm-m68k/atari_stdma.h | 2 +- include/asm-m68k/ide.h | 2 +- include/asm-m68k/machdep.h | 2 +- include/asm-mips/mach-au1x00/au1000_dma.h | 2 +- include/asm-powerpc/ibmebus.h | 2 +- include/asm-sparc/irq.h | 6 +++--- 46 files changed, 70 insertions(+), 70 deletions(-) diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 74f8378d7bbc..a1a900d16665 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c @@ -212,7 +212,7 @@ static struct platform_device corgits_device = { */ static struct pxamci_platform_data corgi_mci_platform_data; -static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(int, void *), void *data) +static int corgi_mci_init(struct device *dev, irq_handler_t corgi_detect_int, void *data) { int err; diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index a4cb875b748d..64df44043a65 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c @@ -125,7 +125,7 @@ static struct pxafb_mach_info sharp_lm8v31 = { .pxafb_lcd_power = &idp_lcd_power }; -static int idp_mci_init(struct device *dev, irqreturn_t (*idp_detect_int)(int, void *), void *data) +static int idp_mci_init(struct device *dev, irq_handler_t idp_detect_int, void *data) { /* setup GPIO for PXA25x MMC controller */ pxa_gpio_mode(GPIO6_MMCCLK_MD); diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index b1e77bd85a33..ee80d62119d3 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -378,7 +378,7 @@ static struct pxafb_mach_info sharp_lm8v31 = { #define MMC_POLL_RATE msecs_to_jiffies(1000) static void lubbock_mmc_poll(unsigned long); -static irqreturn_t (*mmc_detect_int)(int, void *); +static irq_handler_t mmc_detect_int; static struct timer_list mmc_timer = { .function = lubbock_mmc_poll, @@ -412,7 +412,7 @@ static irqreturn_t lubbock_detect_int(int irq, void *data) } static int lubbock_mci_init(struct device *dev, - irqreturn_t (*detect_int)(int, void *), + irq_handler_t detect_int, void *data) { /* setup GPIO for PXA25x MMC controller */ diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 8c3019784915..49c34d94a9fe 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c @@ -313,7 +313,7 @@ static struct pxafb_mach_info mainstone_pxafb_info = { .pxafb_backlight_power = mainstone_backlight_power, }; -static int mainstone_mci_init(struct device *dev, irqreturn_t (*mstone_detect_int)(int, void *), void *data) +static int mainstone_mci_init(struct device *dev, irq_handler_t mstone_detect_int, void *data) { int err; diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 9052a971c8ac..34fb80b37023 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c @@ -197,7 +197,7 @@ static struct platform_device poodle_ts_device = { */ static struct pxamci_platform_data poodle_mci_platform_data; -static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(int, void *), void *data) +static int poodle_mci_init(struct device *dev, irq_handler_t poodle_detect_int, void *data) { int err; diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 911452dd0b45..3cbac63bed3c 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -291,7 +291,7 @@ static struct platform_device spitzts_device = { static struct pxamci_platform_data spitz_mci_platform_data; -static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(int, void *), void *data) +static int spitz_mci_init(struct device *dev, irq_handler_t spitz_detect_int, void *data) { int err; diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 17e46c1060bd..7915a5a22865 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -174,7 +174,7 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = { */ static struct pxamci_platform_data tosa_mci_platform_data; -static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int, void *), void *data) +static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void *data) { int err; diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index a2c05a840a2f..c1827d021ba8 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c @@ -270,7 +270,7 @@ void board_pcmcia_power(int power) {;} #endif /* CONFIG_MACH_TRIZEPS4_CONXS */ EXPORT_SYMBOL(board_pcmcia_power); -static int trizeps4_mci_init(struct device *dev, irqreturn_t (*mci_detect_int)(int, void *), void *data) +static int trizeps4_mci_init(struct device *dev, irq_handler_t mci_detect_int, void *data) { int err; /* setup GPIO for PXA27x MMC controller */ diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index 77819acaea9d..5095778be53c 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c @@ -714,7 +714,7 @@ startup(struct async_struct *info) { unsigned long flags; int retval=0; - irqreturn_t (*handler)(int, void *); + irq_handler_t handler; struct serial_state *state= info->state; unsigned long page; diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 6f63d62bd7d6..3204f412cad8 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -83,7 +83,7 @@ static char amiga_model_name[13] = "Amiga "; extern char m68k_debug_device[]; -static void amiga_sched_init(irqreturn_t (*handler)(int, void *)); +static void amiga_sched_init(irq_handler_t handler); /* amiga specific irq functions */ extern void amiga_init_IRQ (void); static void amiga_get_model(char *model); @@ -487,7 +487,7 @@ void __init config_amiga(void) static unsigned short jiffy_ticks; -static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *)) +static void __init amiga_sched_init(irq_handler_t timer_routine) { static struct resource sched_res = { .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff, diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index b2eea00796ac..cb8e7609df4c 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -25,7 +25,7 @@ u_long cpuctrl_physaddr; u_long timer_physaddr; u_long apollo_model; -extern void dn_sched_init(irqreturn_t (*handler)(int,void *)); +extern void dn_sched_init(irq_handler_t handler); extern void dn_init_IRQ(void); extern unsigned long dn_gettimeoffset(void); extern int dn_dummy_hwclk(int, struct rtc_time *); @@ -176,7 +176,7 @@ void config_apollo(void) { irqreturn_t dn_timer_int(int irq, void *dev_id) { - irqreturn_t (*timer_handler)(int, void *) = dev_id; + irq_handler_t timer_handler = dev_id; volatile unsigned char x; @@ -188,7 +188,7 @@ irqreturn_t dn_timer_int(int irq, void *dev_id) return IRQ_HANDLED; } -void dn_sched_init(irqreturn_t (*timer_routine)(int, void *)) +void dn_sched_init(irq_handler_t timer_routine) { /* program timer 1 */ *(volatile unsigned char *)(timer+3)=0x01; diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 76760eebbbc5..ca5cd4344e3d 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -62,7 +62,7 @@ static void atari_heartbeat( int on ); #endif /* atari specific timer functions (in time.c) */ -extern void atari_sched_init(irqreturn_t (*)(int, void *)); +extern void atari_sched_init(irq_handler_t ); extern unsigned long atari_gettimeoffset (void); extern int atari_mste_hwclk (int, struct rtc_time *); extern int atari_tt_hwclk (int, struct rtc_time *); diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c index 5283c73d3f77..d64b5804e980 100644 --- a/arch/m68k/atari/stdma.c +++ b/arch/m68k/atari/stdma.c @@ -44,7 +44,7 @@ static int stdma_locked; /* the semaphore */ /* int func to be called */ -static irqreturn_t (*stdma_isr)(int, void *); +static irq_handler_t stdma_isr; static void *stdma_isr_data; /* data passed to isr */ static DECLARE_WAIT_QUEUE_HEAD(stdma_wait); /* wait queue for ST-DMA */ @@ -75,7 +75,7 @@ static irqreturn_t stdma_int (int irq, void *dummy); * */ -void stdma_lock(irqreturn_t (*handler)(int, void *), void *data) +void stdma_lock(irq_handler_t handler, void *data) { unsigned long flags; diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index b8fe71cfc62c..c44df4a4a331 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c @@ -20,7 +20,7 @@ #include void __init -atari_sched_init(irqreturn_t (*timer_routine)(int, void *)) +atari_sched_init(irq_handler_t timer_routine) { /* set Timer C data Register */ mfp.tim_dt_c = INT_TICKS; diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index df64efc940c9..896ae3d3d919 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c @@ -38,7 +38,7 @@ static void bvme6000_get_model(char *model); static int bvme6000_get_hardware_list(char *buffer); -extern void bvme6000_sched_init(irqreturn_t (*handler)(int, void *)); +extern void bvme6000_sched_init(irq_handler_t handler); extern unsigned long bvme6000_gettimeoffset (void); extern int bvme6000_hwclk (int, struct rtc_time *); extern int bvme6000_set_clock_mmss (unsigned long); @@ -52,7 +52,7 @@ static unsigned char bin2bcd (unsigned char b); /* Save tick handler routine pointer, will point to do_timer() in * kernel/sched.c, called via bvme6000_process_int() */ -static irqreturn_t (*tick_handler)(int, void *); +static irq_handler_t tick_handler; int bvme6000_parse_bootinfo(const struct bi_record *bi) @@ -190,7 +190,7 @@ static irqreturn_t bvme6000_timer_int (int irq, void *dev_id) * so divide by 8 to get the microsecond result. */ -void bvme6000_sched_init (irqreturn_t (*timer_routine)(int, void *)) +void bvme6000_sched_init (irq_handler_t timer_routine) { volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; unsigned char msr = rtc->msr & 0xc0; diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index 086058fd8383..dd7c8a2583d3 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c @@ -39,7 +39,7 @@ static irqreturn_t hp300_tick(int irq, void *dev_id) { unsigned long tmp; - irqreturn_t (*vector)(int, void *) = dev_id; + irq_handler_t vector = dev_id; in_8(CLOCKBASE + CLKSR); asm volatile ("movpw %1@(5),%0" : "=d" (tmp) : "a" (CLOCKBASE)); /* Turn off the network and SCSI leds */ @@ -63,7 +63,7 @@ unsigned long hp300_gettimeoffset(void) return (USECS_PER_JIFFY * ticks) / INTVAL; } -void __init hp300_sched_init(irqreturn_t (*vector)(int, void *)) +void __init hp300_sched_init(irq_handler_t vector) { out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ out_8(CLOCKBASE + CLKCR1, 0x1); /* reset */ diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h index ca66a039d6f2..f5b3d098b0f5 100644 --- a/arch/m68k/hp300/time.h +++ b/arch/m68k/hp300/time.h @@ -1,4 +1,4 @@ -extern void hp300_sched_init(irqreturn_t (*vector)(int, void *)); +extern void hp300_sched_init(irq_handler_t vector); extern unsigned long hp300_gettimeoffset (void); diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index 6fa893fc5fd6..849c9488c7f8 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c @@ -216,7 +216,7 @@ int setup_irq(unsigned int irq, struct irq_node *node) } int request_irq(unsigned int irq, - irqreturn_t (*handler) (int, void *), + irq_handler_t handler, unsigned long flags, const char *devname, void *dev_id) { struct irq_node *node; diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index 869c4861346e..42d5b85f3350 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -64,7 +64,7 @@ static char m68k_command_line[CL_SIZE]; char m68k_debug_device[6] = ""; -void (*mach_sched_init) (irqreturn_t (*handler)(int, void *)) __initdata = NULL; +void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL; /* machine dependent irq functions */ void (*mach_init_IRQ) (void) __initdata = NULL; void (*mach_get_model) (char *model); diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 029bae65c5d1..562b38d00180 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -72,7 +72,7 @@ extern int show_mac_interrupts(struct seq_file *, void *); extern void iop_preinit(void); extern void iop_init(void); extern void via_init(void); -extern void via_init_clock(irqreturn_t (*func)(int, void *)); +extern void via_init_clock(irq_handler_t func); extern void via_flush_cache(void); extern void oss_init(void); extern void psc_init(void); @@ -88,7 +88,7 @@ extern void mac_debugging_long(int, long); static void mac_get_model(char *str); -static void mac_sched_init(irqreturn_t (*vector)(int, void *)) +static void mac_sched_init(irq_handler_t vector) { via_init_clock(vector); } diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 9b6c80c4bbe2..e27735be2924 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -235,7 +235,7 @@ void __init via_init(void) * Start the 100 Hz clock */ -void __init via_init_clock(irqreturn_t (*func)(int, void *)) +void __init via_init_clock(irq_handler_t func) { via1[vACR] |= 0x40; via1[vT1LL] = MAC_CLOCK_LOW; diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index c864d6415180..4a7df9c3f85a 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c @@ -38,7 +38,7 @@ static void mvme147_get_model(char *model); static int mvme147_get_hardware_list(char *buffer); -extern void mvme147_sched_init(irqreturn_t (*handler)(int, void *)); +extern void mvme147_sched_init(irq_handler_t handler); extern unsigned long mvme147_gettimeoffset (void); extern int mvme147_hwclk (int, struct rtc_time *); extern int mvme147_set_clock_mmss (unsigned long); @@ -51,7 +51,7 @@ static int bcd2int (unsigned char b); /* Save tick handler routine pointer, will point to do_timer() in * kernel/sched.c, called via mvme147_process_int() */ -irqreturn_t (*tick_handler)(int, void *); +irq_handler_t tick_handler; int mvme147_parse_bootinfo(const struct bi_record *bi) @@ -122,7 +122,7 @@ static irqreturn_t mvme147_timer_int (int irq, void *dev_id) } -void mvme147_sched_init (irqreturn_t (*timer_routine)(int, void *)) +void mvme147_sched_init (irq_handler_t timer_routine) { tick_handler = timer_routine; request_irq (PCC_IRQ_TIMER1, mvme147_timer_int, diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index 2c91cee17093..c829ebb6b1af 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -42,7 +42,7 @@ static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; static void mvme16x_get_model(char *model); static int mvme16x_get_hardware_list(char *buffer); -extern void mvme16x_sched_init(irqreturn_t (*handler)(int, void *)); +extern void mvme16x_sched_init(irq_handler_t handler); extern unsigned long mvme16x_gettimeoffset (void); extern int mvme16x_hwclk (int, struct rtc_time *); extern int mvme16x_set_clock_mmss (unsigned long); @@ -54,7 +54,7 @@ int bcd2int (unsigned char b); /* Save tick handler routine pointer, will point to do_timer() in * kernel/sched.c, called via mvme16x_process_int() */ -static irqreturn_t (*tick_handler)(int, void *); +static irq_handler_t tick_handler; unsigned short mvme16x_config; @@ -224,7 +224,7 @@ static irqreturn_t mvme16x_timer_int (int irq, void *dev_id) return tick_handler(irq, dev_id); } -void mvme16x_sched_init (irqreturn_t (*timer_routine)(int, void *)) +void mvme16x_sched_init (irq_handler_t timer_routine) { p_bdid p = &mvme_bdid; int irq; diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 5123f693948f..92f873cc7060 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -39,7 +39,7 @@ extern irqreturn_t q40_process_int (int level, struct pt_regs *regs); extern void q40_init_IRQ (void); static void q40_get_model(char *model); static int q40_get_hardware_list(char *buffer); -extern void q40_sched_init(irqreturn_t (*handler)(int, void *)); +extern void q40_sched_init(irq_handler_t handler); extern unsigned long q40_gettimeoffset (void); extern int q40_hwclk (int, struct rtc_time *); diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 4a4ee4dfa6f1..31cc07d8cec4 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c @@ -125,7 +125,7 @@ void q40_mksound(unsigned int hz, unsigned int ticks) sound_ticks = ticks << 1; } -static irqreturn_t (*q40_timer_routine)(int, void *); +static irq_handler_t q40_timer_routine; static irqreturn_t q40_timer_int (int irq, void * dev) { @@ -142,7 +142,7 @@ static irqreturn_t q40_timer_int (int irq, void * dev) return IRQ_HANDLED; } -void q40_sched_init (irqreturn_t (*timer_routine)(int, void *)) +void q40_sched_init (irq_handler_t timer_routine) { int timer_irq; diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 43e4aa3f404a..4851b8437a87 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -35,7 +35,7 @@ extern char _text, _end; char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; extern unsigned long sun3_gettimeoffset(void); -extern void sun3_sched_init(irqreturn_t (*handler)(int, void *)); +extern void sun3_sched_init(irq_handler_t handler); extern void sun3_get_model (char* model); extern void idprom_init (void); extern int sun3_hwclk(int set, struct rtc_time *t); @@ -162,7 +162,7 @@ void __init config_sun3(void) sun3_bootmem_alloc(memory_start, memory_end); } -void __init sun3_sched_init(irqreturn_t (*timer_routine)(int, void *)) +void __init sun3_sched_init(irq_handler_t timer_routine) { sun3_disable_interrupts(); intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_DISABLE|INTERSIL_24H_MODE); diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c index 33eb1ecc888a..f5eaafb00d21 100644 --- a/arch/m68k/sun3x/time.c +++ b/arch/m68k/sun3x/time.c @@ -90,7 +90,7 @@ static void sun3x_timer_tick(int irq, void *dev_id, struct pt_regs *regs) } #endif -void __init sun3x_sched_init(irqreturn_t (*vector)(int, void *)) +void __init sun3x_sched_init(irq_handler_t vector) { sun3_disable_interrupts(); diff --git a/arch/m68k/sun3x/time.h b/arch/m68k/sun3x/time.h index e39079c781d8..6909e1297534 100644 --- a/arch/m68k/sun3x/time.h +++ b/arch/m68k/sun3x/time.h @@ -3,7 +3,7 @@ extern int sun3x_hwclk(int set, struct rtc_time *t); unsigned long sun3x_gettimeoffset (void); -void sun3x_sched_init(irqreturn_t (*vector)(int, void *)); +void sun3x_sched_init(irq_handler_t vector); struct mostek_dt { volatile unsigned char csr; diff --git a/arch/mips/au1000/common/dma.c b/arch/mips/au1000/common/dma.c index c3019b9c91b1..c78260d4e837 100644 --- a/arch/mips/au1000/common/dma.c +++ b/arch/mips/au1000/common/dma.c @@ -160,7 +160,7 @@ void dump_au1000_dma_channel(unsigned int dmanr) * Requests the DMA done IRQ if irqhandler != NULL. */ int request_au1000_dma(int dev_id, const char *dev_str, - irqreturn_t (*irqhandler)(int, void *), + irq_handler_t irqhandler, unsigned long irqflags, void *irq_dev_id) { diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c index b32597e05a69..2abe132bb07d 100644 --- a/arch/mips/au1000/common/irq.c +++ b/arch/mips/au1000/common/irq.c @@ -288,7 +288,7 @@ static struct irq_chip level_irq_type = { }; #ifdef CONFIG_PM -void startup_match20_interrupt(irqreturn_t (*handler)(int, void *)) +void startup_match20_interrupt(irq_handler_t handler) { struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT]; diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index dd9c364b4746..94f09194d63d 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c @@ -61,7 +61,7 @@ static unsigned int timerhi = 0, timerlo = 0; #error "unsupported HZ value! Must be in [100,1000]" #endif #define MATCH20_INC (328*100/HZ) /* magic number 328 is for HZ=100... */ -extern void startup_match20_interrupt(irqreturn_t (*handler)(int, void *)); +extern void startup_match20_interrupt(irq_handler_t handler); static unsigned long last_pc0, last_match20; #endif diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index da9fe254eb94..39db7a3affe1 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c @@ -319,7 +319,7 @@ EXPORT_SYMBOL(ibmebus_unregister_driver); int ibmebus_request_irq(struct ibmebus_dev *dev, u32 ist, - irqreturn_t (*handler)(int, void*), + irq_handler_t handler, unsigned long irq_flags, const char * devname, void *dev_id) { diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c index ae4dfc89ca52..b3b6680a2a30 100644 --- a/arch/sparc/kernel/irq.c +++ b/arch/sparc/kernel/irq.c @@ -134,8 +134,8 @@ static void irq_panic(void) prom_halt(); } -void (*sparc_init_timers)(irqreturn_t (*)(int, void *)) = - (void (*)(irqreturn_t (*)(int, void *))) irq_panic; +void (*sparc_init_timers)(irq_handler_t ) = + (void (*)(irq_handler_t )) irq_panic; /* * Dave Redman (djhr@tadpole.co.uk) @@ -376,7 +376,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs) * thus no sharing possible. */ int request_fast_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *), + irq_handler_t handler, unsigned long irqflags, const char *devname) { struct irqaction *action; @@ -475,7 +475,7 @@ out: } int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *), + irq_handler_t handler, unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction * action, **actionp; @@ -485,7 +485,7 @@ int request_irq(unsigned int irq, if (sparc_cpu_model == sun4d) { extern int sun4d_request_irq(unsigned int, - irqreturn_t (*)(int, void *), + irq_handler_t , unsigned long, const char *, void *); return sun4d_request_irq(irq, handler, irqflags, devname, dev_id); } diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c index 2eaa0d085e19..009e891a4329 100644 --- a/arch/sparc/kernel/sun4c_irq.c +++ b/arch/sparc/kernel/sun4c_irq.c @@ -154,7 +154,7 @@ static void sun4c_load_profile_irq(int cpu, unsigned int limit) /* Errm.. not sure how to do this.. */ } -static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *)) +static void __init sun4c_init_timers(irq_handler_t counter_fn) { int irq; diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index 836d1562787a..d4f9da8170c5 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c @@ -276,7 +276,7 @@ unsigned int sun4d_sbint_to_irq(struct sbus_dev *sdev, unsigned int sbint) } int sun4d_request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *), + irq_handler_t handler, unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction *action, *tmp = NULL, **actionp; @@ -470,7 +470,7 @@ static void sun4d_load_profile_irq(int cpu, unsigned int limit) bw_set_prof_limit(cpu, limit); } -static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *)) +static void __init sun4d_init_timers(irq_handler_t counter_fn) { int irq; int cpu; diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 28bcf8e2c5b3..a654c16f4027 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c @@ -228,7 +228,7 @@ static void sun4m_load_profile_irq(int cpu, unsigned int limit) sun4m_timers->cpu_timers[cpu].l14_timer_limit = limit; } -static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *)) +static void __init sun4m_init_timers(irq_handler_t counter_fn) { int reg_count, irq, cpu; struct linux_prom_registers cnt_regs[PROMREG_MAX]; diff --git a/arch/sparc/kernel/tick14.c b/arch/sparc/kernel/tick14.c index 7107d2f0625d..f1a7bd19e04f 100644 --- a/arch/sparc/kernel/tick14.c +++ b/arch/sparc/kernel/tick14.c @@ -55,7 +55,7 @@ void install_obp_ticker(void) linux_lvl14[3] = obp_lvl14[3]; } -void claim_ticker14(irqreturn_t (*handler)(int, void *), +void claim_ticker14(irq_handler_t handler, int irq_nr, unsigned int timeout ) { int cpu = smp_processor_id(); diff --git a/arch/um/include/irq_kern.h b/arch/um/include/irq_kern.h index 81beb1841299..4f775597fd5f 100644 --- a/arch/um/include/irq_kern.h +++ b/arch/um/include/irq_kern.h @@ -10,11 +10,11 @@ #include "asm/ptrace.h" extern int um_request_irq(unsigned int irq, int fd, int type, - irqreturn_t (*handler)(int, void *), + irq_handler_t handler, unsigned long irqflags, const char * devname, void *dev_id); extern int init_aio_irq(int irq, char *name, - irqreturn_t (*handler)(int, void *)); + irq_handler_t handler); #endif diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 3c01c2bc979a..ef259569fd8c 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -364,7 +364,7 @@ unsigned int do_IRQ(int irq, union uml_pt_regs *regs) } int um_request_irq(unsigned int irq, int fd, int type, - irqreturn_t (*handler)(int, void *), + irq_handler_t handler, unsigned long irqflags, const char * devname, void *dev_id) { @@ -425,7 +425,7 @@ void __init init_IRQ(void) } } -int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *)) +int init_aio_irq(int irq, char *name, irq_handler_t handler) { int fds[2], err; diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index b704c4f05f4e..a38a28c4bbd8 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h @@ -10,7 +10,7 @@ struct mmc_host; struct pxamci_platform_data { unsigned int ocr_mask; /* available voltages */ unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */ - int (*init)(struct device *, irqreturn_t (*)(int, void *), void *); + int (*init)(struct device *, irq_handler_t , void *); int (*get_ro)(struct device *); void (*setpower)(struct device *, unsigned int); void (*exit)(struct device *, void *); diff --git a/include/asm-m68k/atari_stdma.h b/include/asm-m68k/atari_stdma.h index a6986af7915e..8e389b7fa70c 100644 --- a/include/asm-m68k/atari_stdma.h +++ b/include/asm-m68k/atari_stdma.h @@ -8,7 +8,7 @@ /***************************** Prototypes *****************************/ -void stdma_lock(irqreturn_t (*handler)(int, void *), void *data); +void stdma_lock(irq_handler_t handler, void *data); void stdma_release( void ); int stdma_others_waiting( void ); int stdma_islocked( void ); diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index 896683a7a1f3..f9ffb2cbbae8 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -123,7 +123,7 @@ static __inline__ void ide_release_lock (void) } static __inline__ void -ide_get_lock(irqreturn_t (*handler)(int, void *), void *data) +ide_get_lock(irq_handler_t handler, void *data) { if (MACH_IS_ATARI) { if (falconide_intr_lock == 0) { diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index 862afa4c35d8..26d2b91209c5 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h @@ -10,7 +10,7 @@ struct rtc_time; struct rtc_pll_info; struct buffer_head; -extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *)); +extern void (*mach_sched_init) (irq_handler_t handler); /* machine dependent irq functions */ extern void (*mach_init_IRQ) (void); extern void (*mach_get_model) (char *model); diff --git a/include/asm-mips/mach-au1x00/au1000_dma.h b/include/asm-mips/mach-au1x00/au1000_dma.h index 0493cb0d6175..9f29520e8fb0 100644 --- a/include/asm-mips/mach-au1x00/au1000_dma.h +++ b/include/asm-mips/mach-au1x00/au1000_dma.h @@ -123,7 +123,7 @@ struct dma_chan { extern struct dma_chan au1000_dma_table[]; extern int request_au1000_dma(int dev_id, const char *dev_str, - irqreturn_t (*irqhandler)(int, void *), + irq_handler_t irqhandler, unsigned long irqflags, void *irq_dev_id); extern void free_au1000_dma(unsigned int dmanr); diff --git a/include/asm-powerpc/ibmebus.h b/include/asm-powerpc/ibmebus.h index 9d25f2063b03..3493429b70f5 100644 --- a/include/asm-powerpc/ibmebus.h +++ b/include/asm-powerpc/ibmebus.h @@ -65,7 +65,7 @@ void ibmebus_unregister_driver(struct ibmebus_driver *drv); int ibmebus_request_irq(struct ibmebus_dev *dev, u32 ist, - irqreturn_t (*handler)(int, void*), + irq_handler_t handler, unsigned long irq_flags, const char * devname, void *dev_id); void ibmebus_free_irq(struct ibmebus_dev *dev, u32 ist, void *dev_id); diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h index 70867330f422..ff520ea97473 100644 --- a/include/asm-sparc/irq.h +++ b/include/asm-sparc/irq.h @@ -76,8 +76,8 @@ static inline void load_profile_irq(int cpu, int limit) BTFIXUP_CALL(load_profile_irq)(cpu, limit); } -extern void (*sparc_init_timers)(irqreturn_t (*lvl10_irq)(int, void *)); -extern void claim_ticker14(irqreturn_t (*irq_handler)(int, void *), +extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); +extern void claim_ticker14(irq_handler_t irq_handler, int irq, unsigned int timeout); @@ -91,7 +91,7 @@ BTFIXUPDEF_CALL(void, set_irq_udt, int) #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) #endif -extern int request_fast_irq(unsigned int irq, irqreturn_t (*handler)(int, void *), unsigned long flags, __const__ char *devname); +extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname); /* On the sun4m, just like the timers, we have both per-cpu and master * interrupt registers. From 63540ba3691600759c6732f800dcf0fe8075960b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 11:51:14 +0100 Subject: [PATCH 123/232] [PATCH] sparc64 irq pt_regs fallout Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/sparc64/kernel/irq.c | 7 +++++-- arch/sparc64/kernel/time.c | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index ce05deb1bc92..d64b1ea848de 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c @@ -522,12 +522,13 @@ void ack_bad_irq(unsigned int virt_irq) } #ifndef CONFIG_SMP -extern irqreturn_t timer_interrupt(int, void *, struct pt_regs *); +extern irqreturn_t timer_interrupt(int, void *); void timer_irq(int irq, struct pt_regs *regs) { unsigned long clr_mask = 1 << irq; unsigned long tick_mask = tick_ops->softint_mask; + struct pt_regs *old_regs; if (get_softint() & tick_mask) { irq = 0; @@ -535,12 +536,14 @@ void timer_irq(int irq, struct pt_regs *regs) } clear_softint(clr_mask); + old_regs = set_irq_regs(regs); irq_enter(); kstat_this_cpu.irqs[0]++; - timer_interrupt(irq, NULL, regs); + timer_interrupt(irq, NULL); irq_exit(); + set_irq_regs(old_regs); } #endif diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 00f6fc4aaaff..061e1b1fa583 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c @@ -45,6 +45,7 @@ #include #include #include +#include DEFINE_SPINLOCK(mostek_lock); DEFINE_SPINLOCK(rtc_lock); @@ -452,7 +453,7 @@ static inline void timer_check_rtc(void) } } -irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) +irqreturn_t timer_interrupt(int irq, void *dev_id) { unsigned long ticks, compare, pstate; @@ -460,8 +461,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) do { #ifndef CONFIG_SMP - profile_tick(CPU_PROFILING, regs); - update_process_times(user_mode(regs)); + profile_tick(CPU_PROFILING); + update_process_times(user_mode(get_irq_regs())); #endif do_timer(1); From 041a6baec5a9260ad8b71c43a7ea1de95dfa974c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 12:46:52 +0100 Subject: [PATCH 124/232] [PATCH] fallout from alpha pt_regs patches missed irq handler in sys_titan and forgotten prototype update. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/alpha/kernel/proto.h | 2 +- arch/alpha/kernel/sys_titan.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index daccd4b6d28a..95912ecc65e1 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -36,7 +36,7 @@ extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); extern struct pci_ops irongate_pci_ops; extern int irongate_pci_clr_err(void); extern void irongate_init_arch(void); -extern void irongate_machine_check(u64, u64, struct pt_regs *); +extern void irongate_machine_check(u64, u64); #define irongate_pci_tbi ((void *)0) /* core_lca.c */ diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 161d6915dc49..29ab7db81c30 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c @@ -204,7 +204,7 @@ static struct hw_interrupt_type titan_irq_type = { }; static irqreturn_t -titan_intr_nop(int irq, void *dev_id, struct pt_regs *regs) +titan_intr_nop(int irq, void *dev_id) { /* * This is a NOP interrupt handler for the purposes of From a23b7cb998f18101f9b0f505d81e6c68a7830a05 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 12:47:31 +0100 Subject: [PATCH 125/232] [PATCH] more ia64 irq handlers Cast to (void *) in request_irq() argument is stupid and only hides problems... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/ia64/sn/kernel/huberror.c | 4 ++-- arch/ia64/sn/pci/pcibr/pcibr_provider.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/ia64/sn/kernel/huberror.c b/arch/ia64/sn/kernel/huberror.c index 96fb81e6321f..abca6bd7962f 100644 --- a/arch/ia64/sn/kernel/huberror.c +++ b/arch/ia64/sn/kernel/huberror.c @@ -22,7 +22,7 @@ void hubiio_crb_error_handler(struct hubdev_info *hubdev_info); extern void bte_crb_error_handler(cnodeid_t, int, int, ioerror_t *, int); -static irqreturn_t hub_eint_handler(int irq, void *arg, struct pt_regs *ep) +static irqreturn_t hub_eint_handler(int irq, void *arg) { struct hubdev_info *hubdev_info; struct ia64_sal_retval ret_stuff; @@ -178,7 +178,7 @@ void hubiio_crb_error_handler(struct hubdev_info *hubdev_info) */ void hub_error_init(struct hubdev_info *hubdev_info) { - if (request_irq(SGI_II_ERROR, (void *)hub_eint_handler, IRQF_SHARED, + if (request_irq(SGI_II_ERROR, hub_eint_handler, IRQF_SHARED, "SN_hub_error", (void *)hubdev_info)) printk("hub_error_init: Failed to request_irq for 0x%p\n", hubdev_info); diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c index 838c93c9a16a..27dd7df0f446 100644 --- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c +++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c @@ -95,7 +95,7 @@ u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus) * bridge sends an error interrupt. */ static irqreturn_t -pcibr_error_intr_handler(int irq, void *arg, struct pt_regs *regs) +pcibr_error_intr_handler(int irq, void *arg) { struct pcibus_info *soft = (struct pcibus_info *)arg; @@ -138,7 +138,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont /* * register the bridge's error interrupt handler */ - if (request_irq(SGI_PCIASIC_ERROR, (void *)pcibr_error_intr_handler, + if (request_irq(SGI_PCIASIC_ERROR, pcibr_error_intr_handler, IRQF_SHARED, "PCIBR error", (void *)(soft))) { printk(KERN_WARNING "pcibr cannot allocate interrupt for error handler\n"); From f3d2ab41b5e2dfb2fc8679b786476327cea2f249 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 16:22:09 +0100 Subject: [PATCH 126/232] [PATCH] extern doesn't make sense on a definition of function... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/powerpc/kernel/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 829ac18b566c..5e37bf14ef2d 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -572,8 +572,8 @@ unsigned int irq_create_mapping(struct irq_host *host, } EXPORT_SYMBOL_GPL(irq_create_mapping); -extern unsigned int irq_create_of_mapping(struct device_node *controller, - u32 *intspec, unsigned int intsize) +unsigned int irq_create_of_mapping(struct device_node *controller, + u32 *intspec, unsigned int intsize) { struct irq_host *host; irq_hw_number_t hwirq; From 7c84ace9bcd90e38ebf88b304a8ed4fed7ff3574 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 16:23:09 +0100 Subject: [PATCH 127/232] [PATCH] trivial iomem annotations (arch/powerpc/platfroms/parsemi/pci.c) Signed-off-by: Al Viro Acked-by: Olof Johansson Signed-off-by: Linus Torvalds --- arch/powerpc/platforms/pasemi/pci.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c index 4679c5230413..39020c1fa13d 100644 --- a/arch/powerpc/platforms/pasemi/pci.c +++ b/arch/powerpc/platforms/pasemi/pci.c @@ -35,17 +35,17 @@ #define CONFIG_OFFSET_VALID(off) ((off) < 4096) -static unsigned long pa_pxp_cfg_addr(struct pci_controller *hose, +static void volatile __iomem *pa_pxp_cfg_addr(struct pci_controller *hose, u8 bus, u8 devfn, int offset) { - return ((unsigned long)hose->cfg_data) + PA_PXP_CFA(bus, devfn, offset); + return hose->cfg_data + PA_PXP_CFA(bus, devfn, offset); } static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { struct pci_controller *hose; - unsigned long addr; + void volatile __iomem *addr; hose = pci_bus_to_host(bus); if (!hose) @@ -62,13 +62,13 @@ static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, */ switch (len) { case 1: - *val = in_8((u8 *)addr); + *val = in_8(addr); break; case 2: - *val = in_le16((u16 *)addr); + *val = in_le16(addr); break; default: - *val = in_le32((u32 *)addr); + *val = in_le32(addr); break; } @@ -79,7 +79,7 @@ static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { struct pci_controller *hose; - unsigned long addr; + void volatile __iomem *addr; hose = pci_bus_to_host(bus); if (!hose) @@ -96,16 +96,16 @@ static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn, */ switch (len) { case 1: - out_8((u8 *)addr, val); - (void) in_8((u8 *)addr); + out_8(addr, val); + (void) in_8(addr); break; case 2: - out_le16((u16 *)addr, val); - (void) in_le16((u16 *)addr); + out_le16(addr, val); + (void) in_le16(addr); break; default: - out_le32((u32 *)addr, val); - (void) in_le32((u32 *)addr); + out_le32(addr, val); + (void) in_le32(addr); break; } return PCIBIOS_SUCCESSFUL; From 8dc42f9e037e5fb7b01c1334b7752b9355f5293a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 16:26:47 +0100 Subject: [PATCH 128/232] [PATCH] mv64630_pic NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/ppc/syslib/mv64360_pic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/ppc/syslib/mv64360_pic.c b/arch/ppc/syslib/mv64360_pic.c index 3f6d162f87cf..5104386601ed 100644 --- a/arch/ppc/syslib/mv64360_pic.c +++ b/arch/ppc/syslib/mv64360_pic.c @@ -380,7 +380,7 @@ mv64360_register_hdlrs(void) /* Clear old errors and register CPU interface error intr handler */ mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0); if ((rc = request_irq(MV64x60_IRQ_CPU_ERR + mv64360_irq_base, - mv64360_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, 0))) + mv64360_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, NULL))) printk(KERN_WARNING "Can't register cpu error handler: %d", rc); mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0); @@ -389,7 +389,7 @@ mv64360_register_hdlrs(void) /* Clear old errors and register internal SRAM error intr handler */ mv64x60_write(&bh, MV64360_SRAM_ERR_CAUSE, 0); if ((rc = request_irq(MV64360_IRQ_SRAM_PAR_ERR + mv64360_irq_base, - mv64360_sram_error_int_handler,IRQF_DISABLED,SRAM_INTR_STR, 0))) + mv64360_sram_error_int_handler,IRQF_DISABLED,SRAM_INTR_STR, NULL))) printk(KERN_WARNING "Can't register SRAM error handler: %d",rc); /* Clear old errors and register PCI 0 error intr handler */ From 5c09d96b34ac9b95ab4606e51ddb34ed0f19faf1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:24:49 +0100 Subject: [PATCH 129/232] [PATCH] wrong order of arguments in copy_to_user() in ncpfs Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/ncpfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index a89ac84a8241..589d1eac55c1 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c @@ -726,7 +726,7 @@ outrel: struct compat_ncp_privatedata_ioctl user32; user32.len = user.len; user32.data = (unsigned long) user.data; - if (copy_to_user(&user32, argp, sizeof(user32))) + if (copy_to_user(argp, &user32, sizeof(user32))) return -EFAULT; } else #endif From 38d6fd26ea7f291141039fe340a581dc6f770fc0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:27:30 +0100 Subject: [PATCH 130/232] [PATCH] dlm gfp_t annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/dlm/lowcomms.c | 6 +++--- fs/dlm/lowcomms.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 23f5ce12080b..7bcea7c5addb 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -174,7 +174,7 @@ static int nodeid_to_addr(int nodeid, struct sockaddr *retaddr) return 0; } -static struct nodeinfo *nodeid2nodeinfo(int nodeid, int alloc) +static struct nodeinfo *nodeid2nodeinfo(int nodeid, gfp_t alloc) { struct nodeinfo *ni; int r; @@ -726,7 +726,7 @@ static int init_sock(void) } -static struct writequeue_entry *new_writequeue_entry(int allocation) +static struct writequeue_entry *new_writequeue_entry(gfp_t allocation) { struct writequeue_entry *entry; @@ -748,7 +748,7 @@ static struct writequeue_entry *new_writequeue_entry(int allocation) return entry; } -void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc) +void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc) { struct writequeue_entry *e; int offset = 0; diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h index 6c04bb09cfa8..2d045e0daae1 100644 --- a/fs/dlm/lowcomms.h +++ b/fs/dlm/lowcomms.h @@ -19,7 +19,7 @@ void dlm_lowcomms_exit(void); int dlm_lowcomms_start(void); void dlm_lowcomms_stop(void); int dlm_lowcomms_close(int nodeid); -void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc); +void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc); void dlm_lowcomms_commit_buffer(void *mh); #endif /* __LOWCOMMS_DOT_H__ */ From c8adf94a4806b4ae49a3057d434471a0b01096e3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:26:58 +0100 Subject: [PATCH 131/232] [PATCH] hppfs: readdir callback missed in prototype change Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/hppfs/hppfs_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c index dcb6d2e988b8..642675fc394a 100644 --- a/fs/hppfs/hppfs_kern.c +++ b/fs/hppfs/hppfs_kern.c @@ -572,7 +572,7 @@ struct hppfs_dirent { }; static int hppfs_filldir(void *d, const char *name, int size, - loff_t offset, ino_t inode, unsigned int type) + loff_t offset, u64 inode, unsigned int type) { struct hppfs_dirent *dirent = d; From 5a42b81f03b756116f982e72838bc358bc4e460f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:28:03 +0100 Subject: [PATCH 132/232] [PATCH] s390 traps.c __user annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/s390/kernel/traps.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 05bf3cc8530a..66375a5e3d12 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -474,7 +474,7 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) signal = math_emu_b3(opcode, regs); } else if (opcode[0] == 0xed) { get_user(*((__u32 *) (opcode+2)), - (__u32 *)(location+1)); + (__u32 __user *)(location+1)); signal = math_emu_ed(opcode, regs); } else if (*((__u16 *) opcode) == 0xb299) { get_user(*((__u16 *) (opcode+2)), location+1); @@ -499,7 +499,7 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) info.si_signo = signal; info.si_errno = 0; info.si_code = SEGV_MAPERR; - info.si_addr = (void *) location; + info.si_addr = (void __user *) location; do_trap(interruption_code, signal, "user address fault", regs, &info); } else @@ -520,10 +520,10 @@ asmlinkage void specification_exception(struct pt_regs * regs, long interruption_code) { __u8 opcode[6]; - __u16 *location = NULL; + __u16 __user *location = NULL; int signal = 0; - location = (__u16 *) get_check_address(regs); + location = (__u16 __user *) get_check_address(regs); /* * We got all needed information from the lowcore and can @@ -632,7 +632,7 @@ asmlinkage void data_exception(struct pt_regs * regs, long interruption_code) break; case 0xed: get_user(*((__u32 *) (opcode+2)), - (__u32 *)(location+1)); + (__u32 __user *)(location+1)); signal = math_emu_ed(opcode, regs); break; case 0xb2: From 97c4965d970587a1cc4264c1cffbf0ea9c1e35e8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:29:03 +0100 Subject: [PATCH 133/232] [PATCH] mos7840 annotations __user annotations, NULL noise removal, %p use for pointers Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/usb/serial/mos7840.c | 46 +++++++++++++----------------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 2306d493e55b..021be39fe16e 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -1087,7 +1087,7 @@ static int mos7840_open(struct usb_serial_port *port, struct file *filp) mos7840_port->icount.tx = 0; mos7840_port->icount.rx = 0; - dbg("\n\nusb_serial serial:%x mos7840_port:%x\n usb_serial_port port:%x\n\n", (unsigned int)serial, (unsigned int)mos7840_port, (unsigned int)port); + dbg("\n\nusb_serial serial:%p mos7840_port:%p\n usb_serial_port port:%p\n\n", serial, mos7840_port, port); return 0; @@ -1420,7 +1420,6 @@ static int mos7840_write(struct usb_serial_port *port, int i; int bytes_sent = 0; int transfer_size; - int from_user = 0; struct moschip_port *mos7840_port; struct usb_serial *serial; @@ -1511,15 +1510,7 @@ static int mos7840_write(struct usb_serial_port *port, } transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE); - if (from_user) { - if (copy_from_user - (urb->transfer_buffer, current_position, transfer_size)) { - bytes_sent = -EFAULT; - goto exit; - } - } else { - memcpy(urb->transfer_buffer, current_position, transfer_size); - } + memcpy(urb->transfer_buffer, current_position, transfer_size); /* fill urb with data and submit */ usb_fill_bulk_urb(urb, @@ -2225,7 +2216,7 @@ static void mos7840_set_termios(struct usb_serial_port *port, *****************************************************************************/ static int mos7840_get_lsr_info(struct moschip_port *mos7840_port, - unsigned int *value) + unsigned int __user *value) { int count; unsigned int result = 0; @@ -2248,7 +2239,7 @@ static int mos7840_get_lsr_info(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port, - unsigned int *value) + unsigned int __user *value) { unsigned int result = 0; struct tty_struct *tty = mos7840_port->port->tty; @@ -2271,7 +2262,7 @@ static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_set_modem_info(struct moschip_port *mos7840_port, - unsigned int cmd, unsigned int *value) + unsigned int cmd, unsigned int __user *value) { unsigned int mcr; unsigned int arg; @@ -2341,7 +2332,7 @@ static int mos7840_set_modem_info(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_get_modem_info(struct moschip_port *mos7840_port, - unsigned int *value) + unsigned int __user *value) { unsigned int result = 0; __u16 msr; @@ -2370,7 +2361,7 @@ static int mos7840_get_modem_info(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_get_serial_info(struct moschip_port *mos7840_port, - struct serial_struct *retinfo) + struct serial_struct __user *retinfo) { struct serial_struct tmp; @@ -2405,6 +2396,7 @@ static int mos7840_get_serial_info(struct moschip_port *mos7840_port, static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; struct moschip_port *mos7840_port; struct tty_struct *tty; @@ -2433,16 +2425,13 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, case TIOCINQ: dbg("%s (%d) TIOCINQ", __FUNCTION__, port->number); - return mos7840_get_bytes_avail(mos7840_port, - (unsigned int *)arg); - break; + return mos7840_get_bytes_avail(mos7840_port, argp); case TIOCOUTQ: dbg("%s (%d) TIOCOUTQ", __FUNCTION__, port->number); return put_user(tty->driver->chars_in_buffer ? tty->driver->chars_in_buffer(tty) : 0, (int __user *)arg); - break; case TCFLSH: retval = tty_check_change(tty); @@ -2472,13 +2461,13 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, case TCGETS: if (kernel_termios_to_user_termios - ((struct termios __user *)arg, tty->termios)) + ((struct termios __user *)argp, tty->termios)) return -EFAULT; return 0; case TIOCSERGETLSR: dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__, port->number); - return mos7840_get_lsr_info(mos7840_port, (unsigned int *)arg); + return mos7840_get_lsr_info(mos7840_port, argp); return 0; case TIOCMBIS: @@ -2487,19 +2476,16 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); mosret = - mos7840_set_modem_info(mos7840_port, cmd, - (unsigned int *)arg); + mos7840_set_modem_info(mos7840_port, cmd, argp); return mosret; case TIOCMGET: dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number); - return mos7840_get_modem_info(mos7840_port, - (unsigned int *)arg); + return mos7840_get_modem_info(mos7840_port, argp); case TIOCGSERIAL: dbg("%s (%d) TIOCGSERIAL", __FUNCTION__, port->number); - return mos7840_get_serial_info(mos7840_port, - (struct serial_struct *)arg); + return mos7840_get_serial_info(mos7840_port, argp); case TIOCSSERIAL: dbg("%s (%d) TIOCSSERIAL", __FUNCTION__, port->number); @@ -2549,7 +2535,7 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, port->number, icount.rx, icount.tx); - if (copy_to_user((void *)arg, &icount, sizeof(icount))) + if (copy_to_user(argp, &icount, sizeof(icount))) return -EFAULT; return 0; @@ -2817,7 +2803,7 @@ static int mos7840_startup(struct usb_serial *serial) /* setting configuration feature to one */ usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), - (__u8) 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 5 * HZ); + (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5 * HZ); return 0; } From e069d79d23739977800c3b8495853b735f77ef30 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:29:43 +0100 Subject: [PATCH 134/232] [PATCH] tifm __iomem annotations, NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/misc/tifm_7xx1.c | 13 +++++++------ drivers/misc/tifm_core.c | 2 +- drivers/mmc/tifm_sd.c | 14 +++++++------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index b1748669e05b..1ba8754e9383 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c @@ -48,7 +48,7 @@ static void tifm_7xx1_remove_media(void *adapter) printk(KERN_INFO DRIVER_NAME ": demand removing card from socket %d\n", cnt); sock = fm->sockets[cnt]; - fm->sockets[cnt] = 0; + fm->sockets[cnt] = NULL; fm->remove_mask &= ~(1 << cnt); writel(0x0e00, sock->addr + SOCK_CONTROL); @@ -118,7 +118,7 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static tifm_media_id tifm_7xx1_toggle_sock_power(char *sock_addr, int is_x2) +static tifm_media_id tifm_7xx1_toggle_sock_power(char __iomem *sock_addr, int is_x2) { unsigned int s_state; int cnt; @@ -163,7 +163,8 @@ static tifm_media_id tifm_7xx1_toggle_sock_power(char *sock_addr, int is_x2) return (readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7; } -inline static char *tifm_7xx1_sock_addr(char *base_addr, unsigned int sock_num) +inline static char __iomem * +tifm_7xx1_sock_addr(char __iomem *base_addr, unsigned int sock_num) { return base_addr + ((sock_num + 1) << 10); } @@ -176,7 +177,7 @@ static void tifm_7xx1_insert_media(void *adapter) char *card_name = "xx"; int cnt, ok_to_register; unsigned int insert_mask; - struct tifm_dev *new_sock = 0; + struct tifm_dev *new_sock = NULL; if (!class_device_get(&fm->cdev)) return; @@ -230,7 +231,7 @@ static void tifm_7xx1_insert_media(void *adapter) if (!ok_to_register || device_register(&new_sock->dev)) { spin_lock_irqsave(&fm->lock, flags); - fm->sockets[cnt] = 0; + fm->sockets[cnt] = NULL; spin_unlock_irqrestore(&fm->lock, flags); tifm_free_device(&new_sock->dev); @@ -390,7 +391,7 @@ static void tifm_7xx1_remove(struct pci_dev *dev) tifm_remove_adapter(fm); - pci_set_drvdata(dev, 0); + pci_set_drvdata(dev, NULL); iounmap(fm->addr); pci_intx(dev, 0); diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c index cca5f8522469..ee326136d03b 100644 --- a/drivers/misc/tifm_core.c +++ b/drivers/misc/tifm_core.c @@ -157,7 +157,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id) dev->wq = create_singlethread_workqueue(dev->wq_name); if (!dev->wq) { kfree(dev); - return 0; + return NULL; } dev->dev.parent = fm->dev; dev->dev.bus = &tifm_bus_type; diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c index 6d23dc08d169..2bacff60913d 100644 --- a/drivers/mmc/tifm_sd.c +++ b/drivers/mmc/tifm_sd.c @@ -501,13 +501,13 @@ static void tifm_sd_end_cmd(void *data) struct tifm_dev *sock = host->dev; struct mmc_host *mmc = tifm_get_drvdata(sock); struct mmc_request *mrq; - struct mmc_data *r_data = 0; + struct mmc_data *r_data = NULL; unsigned long flags; spin_lock_irqsave(&sock->lock, flags); mrq = host->req; - host->req = 0; + host->req = NULL; host->state = IDLE; if (!mrq) { @@ -546,7 +546,7 @@ static void tifm_sd_request_nodma(struct mmc_host *mmc, struct mmc_request *mrq) struct tifm_dev *sock = host->dev; unsigned long flags; struct mmc_data *r_data = mrq->cmd->data; - char *t_buffer = 0; + char *t_buffer = NULL; if (r_data) { t_buffer = kmap(r_data->sg->page); @@ -613,13 +613,13 @@ static void tifm_sd_end_cmd_nodma(void *data) struct tifm_dev *sock = host->dev; struct mmc_host *mmc = tifm_get_drvdata(sock); struct mmc_request *mrq; - struct mmc_data *r_data = 0; + struct mmc_data *r_data = NULL; unsigned long flags; spin_lock_irqsave(&sock->lock, flags); mrq = host->req; - host->req = 0; + host->req = NULL; host->state = IDLE; if (!mrq) { @@ -644,7 +644,7 @@ static void tifm_sd_end_cmd_nodma(void *data) r_data->bytes_xfered += r_data->blksz - readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; } - host->buffer = 0; + host->buffer = NULL; host->buffer_pos = 0; host->buffer_size = 0; } @@ -895,7 +895,7 @@ static void tifm_sd_remove(struct tifm_dev *sock) sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); writel(0, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); - tifm_set_drvdata(sock, 0); + tifm_set_drvdata(sock, NULL); mmc_free_host(mmc); } From 659564c8adfe1765476beee8d55cd18986946892 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 9 Oct 2006 16:10:48 -0400 Subject: [PATCH 135/232] [PATCH] Introduce vfs_listxattr This patch moves code out of fs/xattr.c:listxattr into a new function - vfs_listxattr. The code for vfs_listxattr was originally submitted by Bill Nottingham to Unionfs. Sorry about that. The reason for this submission is to make the listxattr code in fs/xattr.c a little cleaner (as well as to clean up some code in Unionfs.) Currently, Unionfs has vfs_listxattr defined in its code. I think that's very ugly, and I'd like to see it (re)moved. The logical place to put it, is along side of all the other vfs_*xattr functions. Overall, I think this patch is benefitial for both kernel.org kernel and Unionfs. Signed-off-by: Josef "Jeff" Sipek Acked-by: Al Viro Signed-off-by: Linus Torvalds --- fs/xattr.c | 33 +++++++++++++++++++++------------ include/linux/xattr.h | 1 + 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/fs/xattr.c b/fs/xattr.c index c32f15b5f60f..395635100f77 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -135,6 +135,26 @@ vfs_getxattr(struct dentry *dentry, char *name, void *value, size_t size) } EXPORT_SYMBOL_GPL(vfs_getxattr); +ssize_t +vfs_listxattr(struct dentry *d, char *list, size_t size) +{ + ssize_t error; + + error = security_inode_listxattr(d); + if (error) + return error; + error = -EOPNOTSUPP; + if (d->d_inode->i_op && d->d_inode->i_op->listxattr) { + error = d->d_inode->i_op->listxattr(d, list, size); + } else { + error = security_inode_listsecurity(d->d_inode, list, size); + if (size && error > size) + error = -ERANGE; + } + return error; +} +EXPORT_SYMBOL_GPL(vfs_listxattr); + int vfs_removexattr(struct dentry *dentry, char *name) { @@ -346,17 +366,7 @@ listxattr(struct dentry *d, char __user *list, size_t size) return -ENOMEM; } - error = security_inode_listxattr(d); - if (error) - goto out; - error = -EOPNOTSUPP; - if (d->d_inode->i_op && d->d_inode->i_op->listxattr) { - error = d->d_inode->i_op->listxattr(d, klist, size); - } else { - error = security_inode_listsecurity(d->d_inode, klist, size); - if (size && error > size) - error = -ERANGE; - } + error = vfs_listxattr(d, klist, size); if (error > 0) { if (size && copy_to_user(list, klist, error)) error = -EFAULT; @@ -365,7 +375,6 @@ listxattr(struct dentry *d, char __user *list, size_t size) than XATTR_LIST_MAX bytes. Not possible. */ error = -E2BIG; } -out: kfree(klist); return error; } diff --git a/include/linux/xattr.h b/include/linux/xattr.h index cda8a96e2fa0..0e7f1e20ea45 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -41,6 +41,7 @@ struct xattr_handler { }; ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); +ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); int vfs_setxattr(struct dentry *, char *, void *, size_t, int); int vfs_removexattr(struct dentry *, char *); From d3696cf7370583b272ff2f09524c9d37a83c71b2 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sun, 8 Oct 2006 23:41:59 -0600 Subject: [PATCH 136/232] [PATCH] x86_64 irq: Scream but don't die if we receive an unexpected irq Due to code bugs or misbehaving hardware it is possible that we can receive an interrupt that we have not mapped into a linux irq. Calling BUG when that happens is very rude, and if the problem is mild enough prevents anything else from getting done. So instead of calling BUG just scream loudly about the problem and continue running. We don't have enough knowledge to know which interrupt triggered this behavior so we don't acknowledge it. This will likely prevent a recurrence of the problem by jamming up the works with an unacknowledged interrupt. If the interrupt was something important it is quite possible that nothing productive will happen past this point. But it is now at least possible to keep working if the kernel can survive without the interrupt we dropped on the floor. Solutions like irqpoll should generally make dropped irqs non-fatal. Signed-off-by: Eric W. Biederman Signed-off-by: Linus Torvalds --- arch/x86_64/kernel/irq.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c index b8a407fcd5d5..dff68eb2b787 100644 --- a/arch/x86_64/kernel/irq.c +++ b/arch/x86_64/kernel/irq.c @@ -114,16 +114,16 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs) irq_enter(); irq = __get_cpu_var(vector_irq)[vector]; - if (unlikely(irq >= NR_IRQS)) { - printk(KERN_EMERG "%s: cannot handle IRQ %d\n", - __FUNCTION__, irq); - BUG(); - } - #ifdef CONFIG_DEBUG_STACKOVERFLOW stack_overflow_check(regs); #endif - generic_handle_irq(irq); + + if (likely(irq < NR_IRQS)) + generic_handle_irq(irq); + else + printk(KERN_EMERG "%s: %d.%d No irq handler for vector\n", + __func__, smp_processor_id(), vector); + irq_exit(); set_irq_regs(old_regs); From 6aabd6af4aaf6d794f67226934ad731eb1765e5d Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:02:25 +0200 Subject: [PATCH 137/232] [PATCH] m68k: syscall updates Add some missing system calls (recent udev needs them) Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- arch/m68k/kernel/entry.S | 5 +++++ include/asm-m68k/unistd.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 34bf7bd126d2..03375414eb56 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -706,4 +706,9 @@ sys_call_table: .long sys_add_key .long sys_request_key /* 280 */ .long sys_keyctl + .long sys_ioprio_set + .long sys_ioprio_get + .long sys_inotify_init + .long sys_inotify_add_watch /* 285 */ + .long sys_inotify_rm_watch diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index 3ab716f0fc18..682bd2fb591d 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h @@ -284,10 +284,15 @@ #define __NR_add_key 279 #define __NR_request_key 280 #define __NR_keyctl 281 +#define __NR_ioprio_set 282 +#define __NR_ioprio_get 283 +#define __NR_inotify_init 284 +#define __NR_inotify_add_watch 285 +#define __NR_inotify_rm_watch 286 #ifdef __KERNEL__ -#define NR_syscalls 282 +#define NR_syscalls 287 #include /* user-visible error numbers are in the range -1 - -MAX_ERRNO: see From 6fb8296aa1681e74b2aa3c59169d9014e6a0dfc3 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:02:31 +0200 Subject: [PATCH 138/232] [PATCH] m68k: more syscall updates Add missing syscalls Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- arch/m68k/kernel/entry.S | 24 ++++++++++++++++++++++++ include/asm-m68k/unistd.h | 26 +++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 03375414eb56..222ce4244564 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -711,4 +711,28 @@ sys_call_table: .long sys_inotify_init .long sys_inotify_add_watch /* 285 */ .long sys_inotify_rm_watch + .long sys_migrate_pages + .long sys_openat + .long sys_mkdirat + .long sys_mknodat /* 290 */ + .long sys_fchownat + .long sys_futimesat + .long sys_fstatat64 + .long sys_unlinkat + .long sys_renameat /* 295 */ + .long sys_linkat + .long sys_symlinkat + .long sys_readlinkat + .long sys_fchmodat + .long sys_faccessat /* 300 */ + .long sys_ni_syscall /* Reserved for pselect6 */ + .long sys_ni_syscall /* Reserved for ppoll */ + .long sys_unshare + .long sys_set_robust_list + .long sys_get_robust_list /* 305 */ + .long sys_splice + .long sys_sync_file_range + .long sys_tee + .long sys_vmsplice + .long sys_move_pages /* 310 */ diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index 682bd2fb591d..ad4348058c66 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h @@ -289,10 +289,34 @@ #define __NR_inotify_init 284 #define __NR_inotify_add_watch 285 #define __NR_inotify_rm_watch 286 +#define __NR_migrate_pages 287 +#define __NR_openat 288 +#define __NR_mkdirat 289 +#define __NR_mknodat 290 +#define __NR_fchownat 291 +#define __NR_futimesat 292 +#define __NR_fstatat64 293 +#define __NR_unlinkat 294 +#define __NR_renameat 295 +#define __NR_linkat 296 +#define __NR_symlinkat 297 +#define __NR_readlinkat 298 +#define __NR_fchmodat 299 +#define __NR_faccessat 300 +#define __NR_pselect6 301 +#define __NR_ppoll 302 +#define __NR_unshare 303 +#define __NR_set_robust_list 304 +#define __NR_get_robust_list 305 +#define __NR_splice 306 +#define __NR_sync_file_range 307 +#define __NR_tee 308 +#define __NR_vmsplice 309 +#define __NR_move_pages 310 #ifdef __KERNEL__ -#define NR_syscalls 287 +#define NR_syscalls 311 #include /* user-visible error numbers are in the range -1 - -MAX_ERRNO: see From da96d0b58adddf3bdeaa9644ac74f0dcc9039407 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:22:37 +0200 Subject: [PATCH 139/232] [PATCH] m68k/HP300: Enable HIL configuration options Enable HIL configuration options on HP300 Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- drivers/input/keyboard/Kconfig | 4 ++-- drivers/input/misc/Kconfig | 2 +- drivers/input/mouse/Kconfig | 2 +- drivers/input/serio/Kconfig | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 679bde34d247..81a333f73010 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -166,7 +166,7 @@ config KEYBOARD_AMIGA config KEYBOARD_HIL_OLD tristate "HP HIL keyboard support (simple driver)" - depends on GSC + depends on GSC || HP300 default y help The "Human Interface Loop" is a older, 8-channel USB-like @@ -183,7 +183,7 @@ config KEYBOARD_HIL_OLD config KEYBOARD_HIL tristate "HP HIL keyboard support" - depends on GSC + depends on GSC || HP300 default y select HP_SDC select HIL_MLC diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index a6dfc7455733..ba0e88c64e1e 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -73,7 +73,7 @@ config INPUT_UINPUT config HP_SDC_RTC tristate "HP SDC Real Time Clock" - depends on GSC + depends on GSC || HP300 select HP_SDC help Say Y here if you want to support the built-in real time clock diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index f15ccf781688..35d998c3e578 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -119,7 +119,7 @@ config MOUSE_VSXXXAA config MOUSE_HIL tristate "HIL pointers (mice etc)." - depends on GSC + depends on GSC || HP300 select HP_SDC select HIL_MLC help diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index 8cdbfeca5903..adef447f23ea 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig @@ -112,7 +112,7 @@ config SERIO_GSCPS2 config HP_SDC tristate "HP System Device Controller i8042 Support" - depends on GSC && SERIO + depends on (GSC || HP300) && SERIO default y ---help--- This option enables support for the "System Device From 69961c375288bdab7604e0bb1c8d22999bb8a347 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:23:31 +0200 Subject: [PATCH 140/232] [PATCH] m68k/Atari: Interrupt updates Misc Atari fixes: - initialize correct number of atari irqs - silence vbl interrupt until it's used by atafb - use mdelay() to read clock if necessary Signed-off-by: Roman Zippel Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- arch/m68k/atari/ataints.c | 9 +++++++-- arch/m68k/atari/time.c | 9 +++++++-- arch/m68k/kernel/ints.c | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index ece13cbf9950..7f812641790c 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c @@ -332,6 +332,9 @@ static void atari_shutdown_irq(unsigned int irq) atari_disable_irq(irq); atari_turnoff_irq(irq); m68k_irq_shutdown(irq); + + if (irq == IRQ_AUTO_4) + vectors[VEC_INT4] = falcon_hblhandler; } static struct irq_controller atari_irq_controller = { @@ -356,7 +359,7 @@ static struct irq_controller atari_irq_controller = { void __init atari_init_IRQ(void) { - m68k_setup_user_interrupt(VEC_USER, 192, NULL); + m68k_setup_user_interrupt(VEC_USER, NUM_ATARI_SOURCES - IRQ_USER, NULL); m68k_setup_irq_controller(&atari_irq_controller, 1, NUM_ATARI_SOURCES - 1); /* Initialize the MFP(s) */ @@ -403,8 +406,10 @@ void __init atari_init_IRQ(void) * gets overruns) */ - if (!MACH_IS_HADES) + if (!MACH_IS_HADES) { vectors[VEC_INT2] = falcon_hblhandler; + vectors[VEC_INT4] = falcon_hblhandler; + } } if (ATARIHW_PRESENT(PCM_8BIT) && ATARIHW_PRESENT(MICROWIRE)) { diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index c44df4a4a331..e0d3c8bfb408 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -212,8 +213,12 @@ int atari_tt_hwclk( int op, struct rtc_time *t ) * additionally the RTC_SET bit is set to prevent an update cycle. */ - while( RTC_READ(RTC_FREQ_SELECT) & RTC_UIP ) - schedule_timeout_interruptible(HWCLK_POLL_INTERVAL); + while( RTC_READ(RTC_FREQ_SELECT) & RTC_UIP ) { + if (in_atomic() || irqs_disabled()) + mdelay(1); + else + schedule_timeout_interruptible(HWCLK_POLL_INTERVAL); + } local_irq_save(flags); RTC_WRITE( RTC_CONTROL, ctrl | RTC_SET ); diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index 849c9488c7f8..84aceca6c05c 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c @@ -132,6 +132,7 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, { int i; + BUG_ON(IRQ_USER + cnt >= NR_IRQS); m68k_first_user_vec = vec; for (i = 0; i < cnt; i++) irq_controller[IRQ_USER + i] = &user_irq_controller; From 2ed0ce5b57950a620155433c62a5a02a067f1376 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:23:56 +0200 Subject: [PATCH 141/232] [PATCH] m68k/Apollo: Remove obsolete arch/m68k/apollo/dma.c Remove unused arch/m68k/apollo/dma.c, which was obsoleted by the move to the generic DMA API. Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- arch/m68k/apollo/dma.c | 50 ------------------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 arch/m68k/apollo/dma.c diff --git a/arch/m68k/apollo/dma.c b/arch/m68k/apollo/dma.c deleted file mode 100644 index aed8be177ef1..000000000000 --- a/arch/m68k/apollo/dma.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/* note only works for 16 Bit 1 page DMA's */ - -static unsigned short next_free_xlat_entry=0; - -unsigned short dma_map_page(unsigned long phys_addr,int count,int type) { - - unsigned long page_aligned_addr=phys_addr & (~((1<<12)-1)); - unsigned short start_map_addr=page_aligned_addr >> 10; - unsigned short free_xlat_entry, *xlat_map_entry; - int i; - - free_xlat_entry=next_free_xlat_entry; - for(i=0,xlat_map_entry=addr_xlat_map+(free_xlat_entry<<2);i<8;i++,xlat_map_entry++) { -#if 0 - printk("phys_addr: %x, page_aligned_addr: %x, start_map_addr: %x\n",phys_addr,page_aligned_addr,start_map_addr+i); -#endif - out_be16(xlat_map_entry, start_map_addr+i); - } - - next_free_xlat_entry+=2; - if(next_free_xlat_entry>125) - next_free_xlat_entry=0; - -#if 0 - printk("next_free_xlat_entry: %d\n",next_free_xlat_entry); -#endif - - return free_xlat_entry<<10; -} - -void dma_unmap_page(unsigned short dma_addr) { - - return ; - -} - From ea62aa1b6f6d31b53a34a6f5271ed85735ccc0bc Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:27:42 +0200 Subject: [PATCH 142/232] [PATCH] m68k/MVME167: SERIAL167 is no longer broken - SERIAL167 is no longer broken - Removed some unused variables from the driver to fix compiler warnings Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- arch/m68k/Kconfig | 2 +- drivers/char/serial167.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 805b81fedf80..7bc14461a6ac 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -600,7 +600,7 @@ config MVME147_SCC config SERIAL167 bool "CD2401 support for MVME166/7 serial ports" - depends on MVME16x && BROKEN + depends on MVME16x help This is the driver for the serial ports on the Motorola MVME166, 167, and 172 boards. Everyone using one of these boards should say diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 6f13f98e3171..defc0dbdedb3 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -1422,7 +1422,6 @@ cy_tiocmget(struct tty_struct *tty, struct file *file) volatile unsigned char *base_addr = (u_char *)BASE_ADDR; unsigned long flags; unsigned char status; - unsigned int result; channel = info->line; @@ -1446,7 +1445,6 @@ cy_tiocmset(struct tty_struct *tty, struct file *file, int channel; volatile unsigned char *base_addr = (u_char *)BASE_ADDR; unsigned long flags; - unsigned int arg; channel = info->line; From 81e859ac1eef300c1b2ff49a2f2da8ee4ce1e844 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:27:42 +0200 Subject: [PATCH 143/232] [PATCH] m68k/MVME167: SERIAL167 tty flip buffer updates Compile fixes related to changed tty flip buffer handling. Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- drivers/char/serial167.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index defc0dbdedb3..461bfe0234c9 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -427,8 +428,9 @@ cd2401_rxerr_interrupt(int irq, void *dev_id) overflowing, we still loose the next incoming character. */ - tty_insert_flip_char(tty, data, TTY_NORMAL); - } + if (tty_buffer_request_room(tty, 1) != 0){ + tty_insert_flip_char(tty, data, TTY_FRAME); + } /* These two conditions may imply */ /* a normal read should be done. */ /* else if(data & CyTIMEOUT) */ @@ -437,14 +439,14 @@ cd2401_rxerr_interrupt(int irq, void *dev_id) tty_insert_flip_char(tty, 0, TTY_NORMAL); } }else{ - tty_insert_flip_char(tty, data, TTY_NORMAL); + tty_insert_flip_char(tty, data, TTY_NORMAL); } }else{ /* there was a software buffer overrun and nothing could be done about it!!! */ } } - schedule_delayed_work(&tty->flip.work, 1); + tty_schedule_flip(tty); /* end of service */ base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; return IRQ_HANDLED; @@ -635,6 +637,7 @@ cd2401_rx_interrupt(int irq, void *dev_id) char data; int char_count; int save_cnt; + int len; /* determine the channel and change to that context */ channel = (u_short ) (base_addr[CyLICR] >> 2); @@ -667,14 +670,15 @@ cd2401_rx_interrupt(int irq, void *dev_id) info->mon.char_max = char_count; info->mon.char_last = char_count; #endif - while(char_count--){ + len = tty_buffer_request_room(tty, char_count); + while(len--){ data = base_addr[CyRDR]; tty_insert_flip_char(tty, data, TTY_NORMAL); #ifdef CYCLOM_16Y_HACK udelay(10L); #endif } - schedule_delayed_work(&tty->flip.work, 1); + tty_schedule_flip(tty); } /* end of service */ base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS; From 441ee341ad63572f39cb8074e31806b5b1471d0b Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 2 Jun 2006 11:48:11 +0100 Subject: [PATCH 144/232] [MIPS] Fix RM9000 wait instruction detection. Only revisions < 4.0 don't have a functional wait instruction. From Thomas Koeller (Thomas.Koeller@baslerweb.com). Signed-off-by: Ralf Baechle --- arch/mips/kernel/cpu-probe.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 9fbf8430c849..8485af340ee1 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -135,7 +135,6 @@ static inline void check_wait(void) case CPU_R5000: case CPU_NEVADA: case CPU_RM7000: - case CPU_RM9000: case CPU_4KC: case CPU_4KEC: case CPU_4KSC: @@ -164,6 +163,14 @@ static inline void check_wait(void) } else printk(" unavailable.\n"); break; + case CPU_RM9000: + if ((c->processor_id & 0x00ff) >= 0x40) { + cpu_wait = r4k_wait; + printk(" available.\n"); + } else { + printk(" unavailable.\n"); + } + break; default: printk(" unavailable.\n"); break; From f431baa55abf8adeed0c718b51deacbc151f58f1 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Mon, 9 Oct 2006 01:24:23 +0900 Subject: [PATCH 145/232] [MIPS] ret_from_irq adjustment Make sure that RA on top of interrupt stack is an address of ret_from_irq, so that dump_stack etc. can trace info interrupted context. Also this patch fixes except_vec_vi_handler and __smtc_ipi_vector which seems broken. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/dec/int-handler.S | 11 ++++------- arch/mips/kernel/entry.S | 14 +++++++++----- arch/mips/kernel/genex.S | 8 +++----- arch/mips/kernel/smtc-asm.S | 9 +++------ 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S index 55d60d5e0e86..31dd47d1002d 100644 --- a/arch/mips/dec/int-handler.S +++ b/arch/mips/dec/int-handler.S @@ -266,10 +266,8 @@ handle_it: LONG_L s0, TI_REGS($28) LONG_S sp, TI_REGS($28) - jal do_IRQ - LONG_S s0, TI_REGS($28) - - j ret_from_irq + PTR_LA ra, ret_from_irq + j do_IRQ nop #ifdef CONFIG_32BIT @@ -279,9 +277,8 @@ fpu: #endif spurious: - jal spurious_interrupt - nop - j ret_from_irq + PTR_LA ra, _ret_from_irq + j spurious_interrupt nop END(plat_irq_dispatch) diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index e93e43e1f42d..417c08ac76eb 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S @@ -20,10 +20,7 @@ #include #endif -#ifdef CONFIG_PREEMPT - .macro preempt_stop - .endm -#else +#ifndef CONFIG_PREEMPT .macro preempt_stop local_irq_disable .endm @@ -32,9 +29,16 @@ .text .align 5 +FEXPORT(ret_from_irq) + LONG_S s0, TI_REGS($28) +#ifdef CONFIG_PREEMPT +FEXPORT(ret_from_exception) +#else + b _ret_from_irq FEXPORT(ret_from_exception) preempt_stop -FEXPORT(ret_from_irq) +#endif +FEXPORT(_ret_from_irq) LONG_L t0, PT_STATUS(sp) # returning to kernel mode? andi t0, t0, KU_USER beqz t0, resume_kernel diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 50ed77297728..5baca16993d0 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -133,9 +133,8 @@ NESTED(handle_int, PT_SIZE, sp) LONG_L s0, TI_REGS($28) LONG_S sp, TI_REGS($28) - jal plat_irq_dispatch - LONG_S s0, TI_REGS($28) - j ret_from_irq + PTR_LA ra, ret_from_irq + j plat_irq_dispatch END(handle_int) __INIT @@ -224,9 +223,8 @@ NESTED(except_vec_vi_handler, 0, sp) LONG_L s0, TI_REGS($28) LONG_S sp, TI_REGS($28) - jalr v0 - LONG_S s0, TI_REGS($28) PTR_LA ra, ret_from_irq + jr v0 END(except_vec_vi_handler) /* diff --git a/arch/mips/kernel/smtc-asm.S b/arch/mips/kernel/smtc-asm.S index 76cb31d57482..1cb9441f1474 100644 --- a/arch/mips/kernel/smtc-asm.S +++ b/arch/mips/kernel/smtc-asm.S @@ -97,15 +97,12 @@ FEXPORT(__smtc_ipi_vector) SAVE_ALL CLI TRACE_IRQS_OFF - move a0,sp /* Function to be invoked passed stack pad slot 5 */ lw t0,PT_PADSLOT5(sp) /* Argument from sender passed in stack pad slot 4 */ - lw a1,PT_PADSLOT4(sp) - jalr t0 - nop - j ret_from_irq - nop + lw a0,PT_PADSLOT4(sp) + PTR_LA ra, _ret_from_irq + jr t0 /* * Called from idle loop to provoke processing of queued IPIs From 18965513fdc3af976f000f231ee216500d707c11 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 23:20:46 +0100 Subject: [PATCH 146/232] [MIPS] qtronix: remove driver. Another leftover of removing support for the ITE8172. Signed-off-by: Ralf Baechle --- drivers/char/qtronix.c | 605 ----------------------------------------- 1 file changed, 605 deletions(-) delete mode 100644 drivers/char/qtronix.c diff --git a/drivers/char/qtronix.c b/drivers/char/qtronix.c deleted file mode 100644 index 5c9477741a30..000000000000 --- a/drivers/char/qtronix.c +++ /dev/null @@ -1,605 +0,0 @@ -/* - * - * BRIEF MODULE DESCRIPTION - * Qtronix 990P infrared keyboard driver. - * - * - * Copyright 2001 MontaVista Software Inc. - * Author: MontaVista Software, Inc. - * ppopov@mvista.com or source@mvista.com - * - * - * The bottom portion of this driver was take from - * pc_keyb.c Please see that file for copyrights. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NOTE: - * - * This driver has only been tested with the Consumer IR - * port of the ITE 8172 system controller. - * - * You do not need this driver if you are using the ps/2 or - * USB adapter that the keyboard ships with. You only need - * this driver if your board has a IR port and the keyboard - * data is being sent directly to the IR. In that case, - * you also need some low-level IR support. See it8172_cir.c. - * - */ - -#ifdef CONFIG_QTRONIX_KEYBOARD - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define leading1 0 -#define leading2 0xF - -#define KBD_CIR_PORT 0 -#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in */ - -static int data_index; -struct cir_port *cir; -static unsigned char kbdbytes[5]; -static unsigned char cir_data[32]; /* we only need 16 chars */ - -static void kbd_int_handler(int irq, void *dev_id); -static int handle_data(unsigned char *p_data); -static inline void handle_mouse_event(unsigned char scancode); -static inline void handle_keyboard_event(unsigned char scancode, int down); -static int __init psaux_init(void); - -static struct aux_queue *queue; /* Mouse data buffer. */ -static int aux_count = 0; - -/* - * Keys accessed through the 'Fn' key - * The Fn key does not produce a key-up sequence. So, the first - * time the user presses it, it will be key-down event. The key - * stays down until the user presses it again. - */ -#define NUM_FN_KEYS 56 -static unsigned char fn_keys[NUM_FN_KEYS] = { - 0,0,0,0,0,0,0,0, /* 0 7 */ - 8,9,10,93,0,0,0,0, /* 8 15 */ - 0,0,0,0,0,0,0,5, /* 16 23 */ - 6,7,91,0,0,0,0,0, /* 24 31 */ - 0,0,0,0,0,2,3,4, /* 32 39 */ - 92,0,0,0,0,0,0,0, /* 40 47 */ - 0,0,0,0,11,0,94,95 /* 48 55 */ - -}; - -void __init init_qtronix_990P_kbd(void) -{ - int retval; - - cir = (struct cir_port *)kmalloc(sizeof(struct cir_port), GFP_KERNEL); - if (!cir) { - printk("Unable to initialize Qtronix keyboard\n"); - return; - } - - /* - * revisit - * this should be programmable, somehow by the, by the user. - */ - cir->port = KBD_CIR_PORT; - cir->baud_rate = 0x1d; - cir->rdwos = 0; - cir->rxdcr = 0x3; - cir->hcfs = 0; - cir->fifo_tl = 0; - cir->cfq = 0x1d; - cir_port_init(cir); - - retval = request_irq(IT8172_CIR0_IRQ, kbd_int_handler, - (unsigned long )(IRQF_DISABLED|IRQF_SHARED), - (const char *)"Qtronix IR Keyboard", (void *)cir); - - if (retval) { - printk("unable to allocate cir %d irq %d\n", - cir->port, IT8172_CIR0_IRQ); - } -#ifdef CONFIG_PSMOUSE - psaux_init(); -#endif -} - -static inline unsigned char BitReverse(unsigned short key) -{ - unsigned char rkey = 0; - rkey |= (key & 0x1) << 7; - rkey |= (key & 0x2) << 5; - rkey |= (key & 0x4) << 3; - rkey |= (key & 0x8) << 1; - rkey |= (key & 0x10) >> 1; - rkey |= (key & 0x20) >> 3; - rkey |= (key & 0x40) >> 5; - rkey |= (key & 0x80) >> 7; - return rkey; - -} - - -static inline u_int8_t UpperByte(u_int8_t data) -{ - return (data >> 4); -} - - -static inline u_int8_t LowerByte(u_int8_t data) -{ - return (data & 0xF); -} - - -int CheckSumOk(u_int8_t byte1, u_int8_t byte2, - u_int8_t byte3, u_int8_t byte4, u_int8_t byte5) -{ - u_int8_t CheckSum; - - CheckSum = (byte1 & 0x0F) + byte2 + byte3 + byte4 + byte5; - if ( LowerByte(UpperByte(CheckSum) + LowerByte(CheckSum)) != UpperByte(byte1) ) - return 0; - else - return 1; -} - - -static void kbd_int_handler(int irq, void *dev_id) -{ - struct cir_port *cir; - int j; - unsigned char int_status; - - cir = (struct cir_port *)dev_id; - int_status = get_int_status(cir); - if (int_status & 0x4) { - clear_fifo(cir); - return; - } - - while (cir_get_rx_count(cir)) { - - cir_data[data_index] = cir_read_data(cir); - - if (data_index == 0) {/* expecting first byte */ - if (cir_data[data_index] != leading1) { - //printk("!leading byte %x\n", cir_data[data_index]); - set_rx_active(cir); - clear_fifo(cir); - continue; - } - } - if (data_index == 1) { - if ((cir_data[data_index] & 0xf) != leading2) { - set_rx_active(cir); - data_index = 0; /* start over */ - clear_fifo(cir); - continue; - } - } - - if ( (cir_data[data_index] == 0xff)) { /* last byte */ - //printk("data_index %d\n", data_index); - set_rx_active(cir); -#if 0 - for (j=0; j<=data_index; j++) { - printk("rx_data %d: %x\n", j, cir_data[j]); - } -#endif - data_index = 0; - handle_data(cir_data); - return; - } - else if (data_index>16) { - set_rx_active(cir); -#if 0 - printk("warning: data_index %d\n", data_index); - for (j=0; j<=data_index; j++) { - printk("rx_data %d: %x\n", j, cir_data[j]); - } -#endif - data_index = 0; - clear_fifo(cir); - return; - } - data_index++; - } -} - - -#define NUM_KBD_BYTES 5 -static int handle_data(unsigned char *p_data) -{ - u_int32_t bit_bucket; - u_int32_t i, j; - u_int32_t got_bits, next_byte; - int down = 0; - - /* Reorganize the bit stream */ - for (i=0; i<16; i++) - p_data[i] = BitReverse(~p_data[i]); - - /* - * We've already previously checked that p_data[0] - * is equal to leading1 and that (p_data[1] & 0xf) - * is equal to leading2. These twelve bits are the - * leader code. We can now throw them away (the 12 - * bits) and continue parsing the stream. - */ - bit_bucket = p_data[1] << 12; - got_bits = 4; - next_byte = 2; - - /* - * Process four bits at a time - */ - for (i=0; i> 1); - got_bits -= 4; - bit_bucket = bit_bucket << 4; - } - else if ((bit_bucket & 0xC000) == 0x8000) { - /* Convert 10b to 0 */ - kbdbytes[i] = kbdbytes[i] >> 1; - got_bits -= 2; - bit_bucket = bit_bucket << 2; - } - else { - /* bad serial stream */ - return 1; - } - - if (next_byte > 16) { - //printk("error: too many bytes\n"); - return 1; - } - } - } - - - if (!CheckSumOk(kbdbytes[0], kbdbytes[1], - kbdbytes[2], kbdbytes[3], kbdbytes[4])) { - //printk("checksum failed\n"); - return 1; - } - - if (kbdbytes[1] & 0x08) { - //printk("m: %x %x %x\n", kbdbytes[1], kbdbytes[2], kbdbytes[3]); - handle_mouse_event(kbdbytes[1]); - handle_mouse_event(kbdbytes[2]); - handle_mouse_event(kbdbytes[3]); - } - else { - if (kbdbytes[2] == 0) down = 1; -#if 0 - if (down) - printk("down %d\n", kbdbytes[3]); - else - printk("up %d\n", kbdbytes[3]); -#endif - handle_keyboard_event(kbdbytes[3], down); - } - return 0; -} - - -DEFINE_SPINLOCK(kbd_controller_lock); -static unsigned char handle_kbd_event(void); - - -int kbd_setkeycode(unsigned int scancode, unsigned int keycode) -{ - printk("kbd_setkeycode scancode %x keycode %x\n", scancode, keycode); - return 0; -} - -int kbd_getkeycode(unsigned int scancode) -{ - return scancode; -} - - -int kbd_translate(unsigned char scancode, unsigned char *keycode, - char raw_mode) -{ - static int prev_scancode = 0; - - if (scancode == 0x00 || scancode == 0xff) { - prev_scancode = 0; - return 0; - } - - /* todo */ - if (!prev_scancode && scancode == 160) { /* Fn key down */ - //printk("Fn key down\n"); - prev_scancode = 160; - return 0; - } - else if (prev_scancode && scancode == 160) { /* Fn key up */ - //printk("Fn key up\n"); - prev_scancode = 0; - return 0; - } - - /* todo */ - if (prev_scancode == 160) { - if (scancode <= NUM_FN_KEYS) { - *keycode = fn_keys[scancode]; - //printk("fn keycode %d\n", *keycode); - } - else - return 0; - } - else if (scancode <= 127) { - *keycode = scancode; - } - else - return 0; - - - return 1; -} - -char kbd_unexpected_up(unsigned char keycode) -{ - //printk("kbd_unexpected_up\n"); - return 0; -} - -static unsigned char kbd_exists = 1; - -static inline void handle_keyboard_event(unsigned char scancode, int down) -{ - kbd_exists = 1; - handle_scancode(scancode, down); - tasklet_schedule(&keyboard_tasklet); -} - - -void kbd_leds(unsigned char leds) -{ -} - -/* dummy */ -void kbd_init_hw(void) -{ -} - - - -static inline void handle_mouse_event(unsigned char scancode) -{ - if(scancode == AUX_RECONNECT){ - queue->head = queue->tail = 0; /* Flush input queue */ - // __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } - - if (aux_count) { - int head = queue->head; - - queue->buf[head] = scancode; - head = (head + 1) & (AUX_BUF_SIZE-1); - if (head != queue->tail) { - queue->head = head; - kill_fasync(&queue->fasync, SIGIO, POLL_IN); - wake_up_interruptible(&queue->proc_list); - } - } -} - -static unsigned char get_from_queue(void) -{ - unsigned char result; - unsigned long flags; - - spin_lock_irqsave(&kbd_controller_lock, flags); - result = queue->buf[queue->tail]; - queue->tail = (queue->tail + 1) & (AUX_BUF_SIZE-1); - spin_unlock_irqrestore(&kbd_controller_lock, flags); - return result; -} - - -static inline int queue_empty(void) -{ - return queue->head == queue->tail; -} - -static int fasync_aux(int fd, struct file *filp, int on) -{ - int retval; - - //printk("fasync_aux\n"); - retval = fasync_helper(fd, filp, on, &queue->fasync); - if (retval < 0) - return retval; - return 0; -} - - -/* - * Random magic cookie for the aux device - */ -#define AUX_DEV ((void *)queue) - -static int release_aux(struct inode * inode, struct file * file) -{ - fasync_aux(-1, file, 0); - aux_count--; - return 0; -} - -static int open_aux(struct inode * inode, struct file * file) -{ - if (aux_count++) { - return 0; - } - queue->head = queue->tail = 0; /* Flush input queue */ - return 0; -} - -/* - * Put bytes from input queue to buffer. - */ - -static ssize_t read_aux(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - DECLARE_WAITQUEUE(wait, current); - ssize_t i = count; - unsigned char c; - - if (queue_empty()) { - if (file->f_flags & O_NONBLOCK) - return -EAGAIN; - add_wait_queue(&queue->proc_list, &wait); -repeat: - set_current_state(TASK_INTERRUPTIBLE); - if (queue_empty() && !signal_pending(current)) { - schedule(); - goto repeat; - } - current->state = TASK_RUNNING; - remove_wait_queue(&queue->proc_list, &wait); - } - while (i > 0 && !queue_empty()) { - c = get_from_queue(); - put_user(c, buffer++); - i--; - } - if (count-i) { - struct inode *inode = file->f_dentry->d_inode; - inode->i_atime = current_fs_time(inode->i_sb); - return count-i; - } - if (signal_pending(current)) - return -ERESTARTSYS; - return 0; -} - -/* - * Write to the aux device. - */ - -static ssize_t write_aux(struct file * file, const char * buffer, - size_t count, loff_t *ppos) -{ - /* - * The ITE boards this was tested on did not have the - * transmit wires connected. - */ - return count; -} - -static unsigned int aux_poll(struct file *file, poll_table * wait) -{ - poll_wait(file, &queue->proc_list, wait); - if (!queue_empty()) - return POLLIN | POLLRDNORM; - return 0; -} - -struct file_operations psaux_fops = { - .read = read_aux, - .write = write_aux, - .poll = aux_poll, - .open = open_aux, - .release = release_aux, - .fasync = fasync_aux, -}; - -/* - * Initialize driver. - */ -static struct miscdevice psaux_mouse = { - PSMOUSE_MINOR, "psaux", &psaux_fops -}; - -static int __init psaux_init(void) -{ - int retval; - - retval = misc_register(&psaux_mouse); - if(retval < 0) - return retval; - - queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL); - if (!queue) { - misc_deregister(&psaux_mouse); - return -ENOMEM; - } - - memset(queue, 0, sizeof(*queue)); - queue->head = queue->tail = 0; - init_waitqueue_head(&queue->proc_list); - - return 0; -} -module_init(init_qtronix_990P_kbd); -#endif From 0e8f8f54c1537d22eb0168622a5f6aef4040da6a Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 8 Jul 2006 01:07:40 +0200 Subject: [PATCH 147/232] [MIPS] NUMA: Register all nodes before cpus or sysfs will barf. Signed-off-by: Ralf Baechle --- arch/mips/kernel/smp.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 221895802dca..1af3612a1ce8 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -467,14 +467,18 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); static int __init topology_init(void) { - int cpu; - int ret; + int i, ret; - for_each_present_cpu(cpu) { - ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu); +#ifdef CONFIG_NUMA + for_each_online_node(i) + register_one_node(i); +#endif /* CONFIG_NUMA */ + + for_each_present_cpu(i) { + ret = register_cpu(&per_cpu(cpu_devices, i), i); if (ret) printk(KERN_WARNING "topology_init: register_cpu %d " - "failed (%d)\n", cpu, ret); + "failed (%d)\n", i, ret); } return 0; From 12a0a703b3f07e5b01c81fe4f5d2a221c9318f16 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 23:20:47 +0100 Subject: [PATCH 148/232] [RTC] Consistently use of tabs for formatting. --- drivers/char/rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index abee7a339462..66a7385bc34a 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -35,13 +35,13 @@ * 1.09a Pete Zaitcev: Sun SPARC * 1.09b Jeff Garzik: Modularize, init cleanup * 1.09c Jeff Garzik: SMP cleanup - * 1.10 Paul Barton-Davis: add support for async I/O + * 1.10 Paul Barton-Davis: add support for async I/O * 1.10a Andrea Arcangeli: Alpha updates * 1.10b Andrew Morton: SMP lock fix * 1.10c Cesar Barros: SMP locking fixes and cleanup * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness. - * 1.11 Takashi Iwai: Kernel access functions + * 1.11 Takashi Iwai: Kernel access functions * rtc_register/rtc_unregister/rtc_control * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer From 0118c3ca9e7518b06a10e9d7f4bd15957df45783 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 5 Jun 2006 11:54:41 +0100 Subject: [PATCH 149/232] [MIPS] Malta: Fix build for non-MIPS32/64 configuration. Signed-off-by: Ralf Baechle --- arch/mips/mips-boards/malta/malta_int.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c index ed221dc7f6ac..6244d0e2c7de 100644 --- a/arch/mips/mips-boards/malta/malta_int.c +++ b/arch/mips/mips-boards/malta/malta_int.c @@ -212,23 +212,23 @@ static inline unsigned int irq_ffs(unsigned int pending) unsigned int a0 = 7; unsigned int t0; - t0 = s0 & 0xf000; + t0 = pending & 0xf000; t0 = t0 < 1; t0 = t0 << 2; a0 = a0 - t0; - s0 = s0 << t0; + pending = pending << t0; - t0 = s0 & 0xc000; + t0 = pending & 0xc000; t0 = t0 < 1; t0 = t0 << 1; a0 = a0 - t0; - s0 = s0 << t0; + pending = pending << t0; - t0 = s0 & 0x8000; + t0 = pending & 0x8000; t0 = t0 < 1; //t0 = t0 << 2; a0 = a0 - t0; - //s0 = s0 << t0; + //pending = pending << t0; return a0; #endif From 5536b2351425136e629bd9fc18135c6e21e125c2 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 16:34:41 +0100 Subject: [PATCH 150/232] [MIPS] Alchemy: nuke usbdev; it's useless as is ... Signed-off-by: Ralf Baechle --- arch/mips/Kconfig | 5 - arch/mips/au1000/common/Makefile | 1 - arch/mips/au1000/common/usbdev.c | 1552 ------------------ arch/mips/au1000/db1x00/board_setup.c | 5 - arch/mips/au1000/mtx-1/board_setup.c | 8 +- arch/mips/au1000/pb1000/board_setup.c | 10 +- arch/mips/au1000/pb1100/board_setup.c | 6 +- arch/mips/au1000/pb1500/board_setup.c | 9 +- arch/mips/configs/pb1100_defconfig | 1 - arch/mips/configs/pb1500_defconfig | 1 - include/asm-mips/mach-au1x00/au1000_usbdev.h | 73 - 11 files changed, 9 insertions(+), 1662 deletions(-) delete mode 100644 arch/mips/au1000/common/usbdev.c delete mode 100644 include/asm-mips/mach-au1x00/au1000_usbdev.h diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 731b942a824b..14af6cce2fa2 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1010,11 +1010,6 @@ endchoice config ARC32 bool -config AU1X00_USB_DEVICE - bool - depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000 - default n - config BOOT_ELF32 bool diff --git a/arch/mips/au1000/common/Makefile b/arch/mips/au1000/common/Makefile index bf682f50b859..4c35525edb4f 100644 --- a/arch/mips/au1000/common/Makefile +++ b/arch/mips/au1000/common/Makefile @@ -10,6 +10,5 @@ obj-y += prom.o irq.o puts.o time.o reset.o \ au1xxx_irqmap.o clocks.o platform.o power.o setup.o \ sleeper.o cputable.o dma.o dbdma.o gpio.o -obj-$(CONFIG_AU1X00_USB_DEVICE) += usbdev.o obj-$(CONFIG_KGDB) += dbg_io.o obj-$(CONFIG_PCI) += pci.o diff --git a/arch/mips/au1000/common/usbdev.c b/arch/mips/au1000/common/usbdev.c deleted file mode 100644 index 70dc82e536cd..000000000000 --- a/arch/mips/au1000/common/usbdev.c +++ /dev/null @@ -1,1552 +0,0 @@ -/* - * BRIEF MODULE DESCRIPTION - * Au1000 USB Device-Side (device layer) - * - * Copyright 2001-2002 MontaVista Software Inc. - * Author: MontaVista Software, Inc. - * stevel@mvista.com or source@mvista.com - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define DEBUG -#include - -#include -#include -#include -#include -#include -#include -#include - -#ifdef DEBUG -#undef VDEBUG -#ifdef VDEBUG -#define vdbg(fmt, arg...) printk(KERN_DEBUG __FILE__ ": " fmt "\n" , ## arg) -#else -#define vdbg(fmt, arg...) do {} while (0) -#endif -#else -#define vdbg(fmt, arg...) do {} while (0) -#endif - -#define ALLOC_FLAGS (in_interrupt () ? GFP_ATOMIC : GFP_KERNEL) - -#define EP_FIFO_DEPTH 8 - -typedef enum { - SETUP_STAGE = 0, - DATA_STAGE, - STATUS_STAGE -} ep0_stage_t; - -typedef struct { - int read_fifo; - int write_fifo; - int ctrl_stat; - int read_fifo_status; - int write_fifo_status; -} endpoint_reg_t; - -typedef struct { - usbdev_pkt_t *head; - usbdev_pkt_t *tail; - int count; -} pkt_list_t; - -typedef struct { - int active; - struct usb_endpoint_descriptor *desc; - endpoint_reg_t *reg; - /* Only one of these are used, unless this is the control ep */ - pkt_list_t inlist; - pkt_list_t outlist; - unsigned int indma, outdma; /* DMA channel numbers for IN, OUT */ - /* following are extracted from endpoint descriptor for easy access */ - int max_pkt_size; - int type; - int direction; - /* WE assign endpoint addresses! */ - int address; - spinlock_t lock; -} endpoint_t; - - -static struct usb_dev { - endpoint_t ep[6]; - ep0_stage_t ep0_stage; - - struct usb_device_descriptor * dev_desc; - struct usb_interface_descriptor* if_desc; - struct usb_config_descriptor * conf_desc; - u8 * full_conf_desc; - struct usb_string_descriptor * str_desc[6]; - - /* callback to function layer */ - void (*func_cb)(usbdev_cb_type_t type, unsigned long arg, - void *cb_data); - void* cb_data; - - usbdev_state_t state; // device state - int suspended; // suspended flag - int address; // device address - int interface; - int num_ep; - u8 alternate_setting; - u8 configuration; // configuration value - int remote_wakeup_en; -} usbdev; - - -static endpoint_reg_t ep_reg[] = { - // FIFO's 0 and 1 are EP0 default control - {USBD_EP0RD, USBD_EP0WR, USBD_EP0CS, USBD_EP0RDSTAT, USBD_EP0WRSTAT }, - {0}, - // FIFO 2 is EP2, IN - { -1, USBD_EP2WR, USBD_EP2CS, -1, USBD_EP2WRSTAT }, - // FIFO 3 is EP3, IN - { -1, USBD_EP3WR, USBD_EP3CS, -1, USBD_EP3WRSTAT }, - // FIFO 4 is EP4, OUT - {USBD_EP4RD, -1, USBD_EP4CS, USBD_EP4RDSTAT, -1 }, - // FIFO 5 is EP5, OUT - {USBD_EP5RD, -1, USBD_EP5CS, USBD_EP5RDSTAT, -1 } -}; - -static struct { - unsigned int id; - const char *str; -} ep_dma_id[] = { - { DMA_ID_USBDEV_EP0_TX, "USBDev EP0 IN" }, - { DMA_ID_USBDEV_EP0_RX, "USBDev EP0 OUT" }, - { DMA_ID_USBDEV_EP2_TX, "USBDev EP2 IN" }, - { DMA_ID_USBDEV_EP3_TX, "USBDev EP3 IN" }, - { DMA_ID_USBDEV_EP4_RX, "USBDev EP4 OUT" }, - { DMA_ID_USBDEV_EP5_RX, "USBDev EP5 OUT" } -}; - -#define DIR_OUT 0 -#define DIR_IN (1<<3) - -#define CONTROL_EP USB_ENDPOINT_XFER_CONTROL -#define BULK_EP USB_ENDPOINT_XFER_BULK - -static inline endpoint_t * -epaddr_to_ep(struct usb_dev* dev, int ep_addr) -{ - if (ep_addr >= 0 && ep_addr < 2) - return &dev->ep[0]; - if (ep_addr < 6) - return &dev->ep[ep_addr]; - return NULL; -} - -static const char* std_req_name[] = { - "GET_STATUS", - "CLEAR_FEATURE", - "RESERVED", - "SET_FEATURE", - "RESERVED", - "SET_ADDRESS", - "GET_DESCRIPTOR", - "SET_DESCRIPTOR", - "GET_CONFIGURATION", - "SET_CONFIGURATION", - "GET_INTERFACE", - "SET_INTERFACE", - "SYNCH_FRAME" -}; - -static inline const char* -get_std_req_name(int req) -{ - return (req >= 0 && req <= 12) ? std_req_name[req] : "UNKNOWN"; -} - -#if 0 -static void -dump_setup(struct usb_ctrlrequest* s) -{ - dbg("%s: requesttype=%d", __FUNCTION__, s->requesttype); - dbg("%s: request=%d %s", __FUNCTION__, s->request, - get_std_req_name(s->request)); - dbg("%s: value=0x%04x", __FUNCTION__, s->wValue); - dbg("%s: index=%d", __FUNCTION__, s->index); - dbg("%s: length=%d", __FUNCTION__, s->length); -} -#endif - -static inline usbdev_pkt_t * -alloc_packet(endpoint_t * ep, int data_size, void* data) -{ - usbdev_pkt_t* pkt = kmalloc(sizeof(usbdev_pkt_t) + data_size, - ALLOC_FLAGS); - if (!pkt) - return NULL; - pkt->ep_addr = ep->address; - pkt->size = data_size; - pkt->status = 0; - pkt->next = NULL; - if (data) - memcpy(pkt->payload, data, data_size); - - return pkt; -} - - -/* - * Link a packet to the tail of the enpoint's packet list. - * EP spinlock must be held when calling. - */ -static void -link_tail(endpoint_t * ep, pkt_list_t * list, usbdev_pkt_t * pkt) -{ - if (!list->tail) { - list->head = list->tail = pkt; - list->count = 1; - } else { - list->tail->next = pkt; - list->tail = pkt; - list->count++; - } -} - -/* - * Unlink and return a packet from the head of the given packet - * list. It is the responsibility of the caller to free the packet. - * EP spinlock must be held when calling. - */ -static usbdev_pkt_t * -unlink_head(pkt_list_t * list) -{ - usbdev_pkt_t *pkt; - - pkt = list->head; - if (!pkt || !list->count) { - return NULL; - } - - list->head = pkt->next; - if (!list->head) { - list->head = list->tail = NULL; - list->count = 0; - } else - list->count--; - - return pkt; -} - -/* - * Create and attach a new packet to the tail of the enpoint's - * packet list. EP spinlock must be held when calling. - */ -static usbdev_pkt_t * -add_packet(endpoint_t * ep, pkt_list_t * list, int size) -{ - usbdev_pkt_t *pkt = alloc_packet(ep, size, NULL); - if (!pkt) - return NULL; - - link_tail(ep, list, pkt); - return pkt; -} - - -/* - * Unlink and free a packet from the head of the enpoint's - * packet list. EP spinlock must be held when calling. - */ -static inline void -free_packet(pkt_list_t * list) -{ - kfree(unlink_head(list)); -} - -/* EP spinlock must be held when calling. */ -static inline void -flush_pkt_list(pkt_list_t * list) -{ - while (list->count) - free_packet(list); -} - -/* EP spinlock must be held when calling */ -static inline void -flush_write_fifo(endpoint_t * ep) -{ - if (ep->reg->write_fifo_status >= 0) { - au_writel(USBDEV_FSTAT_FLUSH | USBDEV_FSTAT_UF | - USBDEV_FSTAT_OF, - ep->reg->write_fifo_status); - //udelay(100); - //au_writel(USBDEV_FSTAT_UF | USBDEV_FSTAT_OF, - // ep->reg->write_fifo_status); - } -} - -/* EP spinlock must be held when calling */ -static inline void -flush_read_fifo(endpoint_t * ep) -{ - if (ep->reg->read_fifo_status >= 0) { - au_writel(USBDEV_FSTAT_FLUSH | USBDEV_FSTAT_UF | - USBDEV_FSTAT_OF, - ep->reg->read_fifo_status); - //udelay(100); - //au_writel(USBDEV_FSTAT_UF | USBDEV_FSTAT_OF, - // ep->reg->read_fifo_status); - } -} - - -/* EP spinlock must be held when calling. */ -static void -endpoint_flush(endpoint_t * ep) -{ - // First, flush all packets - flush_pkt_list(&ep->inlist); - flush_pkt_list(&ep->outlist); - - // Now flush the endpoint's h/w FIFO(s) - flush_write_fifo(ep); - flush_read_fifo(ep); -} - -/* EP spinlock must be held when calling. */ -static void -endpoint_stall(endpoint_t * ep) -{ - u32 cs; - - warn("%s", __FUNCTION__); - - cs = au_readl(ep->reg->ctrl_stat) | USBDEV_CS_STALL; - au_writel(cs, ep->reg->ctrl_stat); -} - -/* EP spinlock must be held when calling. */ -static void -endpoint_unstall(endpoint_t * ep) -{ - u32 cs; - - warn("%s", __FUNCTION__); - - cs = au_readl(ep->reg->ctrl_stat) & ~USBDEV_CS_STALL; - au_writel(cs, ep->reg->ctrl_stat); -} - -static void -endpoint_reset_datatoggle(endpoint_t * ep) -{ - // FIXME: is this possible? -} - - -/* EP spinlock must be held when calling. */ -static int -endpoint_fifo_read(endpoint_t * ep) -{ - int read_count = 0; - u8 *bufptr; - usbdev_pkt_t *pkt = ep->outlist.tail; - - if (!pkt) - return -EINVAL; - - bufptr = &pkt->payload[pkt->size]; - while (au_readl(ep->reg->read_fifo_status) & USBDEV_FSTAT_FCNT_MASK) { - *bufptr++ = au_readl(ep->reg->read_fifo) & 0xff; - read_count++; - pkt->size++; - } - - return read_count; -} - -#if 0 -/* EP spinlock must be held when calling. */ -static int -endpoint_fifo_write(endpoint_t * ep, int index) -{ - int write_count = 0; - u8 *bufptr; - usbdev_pkt_t *pkt = ep->inlist.head; - - if (!pkt) - return -EINVAL; - - bufptr = &pkt->payload[index]; - while ((au_readl(ep->reg->write_fifo_status) & - USBDEV_FSTAT_FCNT_MASK) < EP_FIFO_DEPTH) { - if (bufptr < pkt->payload + pkt->size) { - au_writel(*bufptr++, ep->reg->write_fifo); - write_count++; - } else { - break; - } - } - - return write_count; -} -#endif - -/* - * This routine is called to restart transmission of a packet. - * The endpoint's TSIZE must be set to the new packet's size, - * and DMA to the write FIFO needs to be restarted. - * EP spinlock must be held when calling. - */ -static void -kickstart_send_packet(endpoint_t * ep) -{ - u32 cs; - usbdev_pkt_t *pkt = ep->inlist.head; - - vdbg("%s: ep%d, pkt=%p", __FUNCTION__, ep->address, pkt); - - if (!pkt) { - err("%s: head=NULL! list->count=%d", __FUNCTION__, - ep->inlist.count); - return; - } - - dma_cache_wback_inv((unsigned long)pkt->payload, pkt->size); - - /* - * make sure FIFO is empty - */ - flush_write_fifo(ep); - - cs = au_readl(ep->reg->ctrl_stat) & USBDEV_CS_STALL; - cs |= (pkt->size << USBDEV_CS_TSIZE_BIT); - au_writel(cs, ep->reg->ctrl_stat); - - if (get_dma_active_buffer(ep->indma) == 1) { - set_dma_count1(ep->indma, pkt->size); - set_dma_addr1(ep->indma, virt_to_phys(pkt->payload)); - enable_dma_buffer1(ep->indma); // reenable - } else { - set_dma_count0(ep->indma, pkt->size); - set_dma_addr0(ep->indma, virt_to_phys(pkt->payload)); - enable_dma_buffer0(ep->indma); // reenable - } - if (dma_halted(ep->indma)) - start_dma(ep->indma); -} - - -/* - * This routine is called when a packet in the inlist has been - * completed. Frees the completed packet and starts sending the - * next. EP spinlock must be held when calling. - */ -static usbdev_pkt_t * -send_packet_complete(endpoint_t * ep) -{ - usbdev_pkt_t *pkt = unlink_head(&ep->inlist); - - if (pkt) { - pkt->status = - (au_readl(ep->reg->ctrl_stat) & USBDEV_CS_NAK) ? - PKT_STATUS_NAK : PKT_STATUS_ACK; - - vdbg("%s: ep%d, %s pkt=%p, list count=%d", __FUNCTION__, - ep->address, (pkt->status & PKT_STATUS_NAK) ? - "NAK" : "ACK", pkt, ep->inlist.count); - } - - /* - * The write fifo should already be drained if things are - * working right, but flush it anyway just in case. - */ - flush_write_fifo(ep); - - // begin transmitting next packet in the inlist - if (ep->inlist.count) { - kickstart_send_packet(ep); - } - - return pkt; -} - -/* - * Add a new packet to the tail of the given ep's packet - * inlist. The transmit complete interrupt frees packets from - * the head of this list. EP spinlock must be held when calling. - */ -static int -send_packet(struct usb_dev* dev, usbdev_pkt_t *pkt, int async) -{ - pkt_list_t *list; - endpoint_t* ep; - - if (!pkt || !(ep = epaddr_to_ep(dev, pkt->ep_addr))) - return -EINVAL; - - if (!pkt->size) - return 0; - - list = &ep->inlist; - - if (!async && list->count) { - halt_dma(ep->indma); - flush_pkt_list(list); - } - - link_tail(ep, list, pkt); - - vdbg("%s: ep%d, pkt=%p, size=%d, list count=%d", __FUNCTION__, - ep->address, pkt, pkt->size, list->count); - - if (list->count == 1) { - /* - * if the packet count is one, it means the list was empty, - * and no more data will go out this ep until we kick-start - * it again. - */ - kickstart_send_packet(ep); - } - - return pkt->size; -} - -/* - * This routine is called to restart reception of a packet. - * EP spinlock must be held when calling. - */ -static void -kickstart_receive_packet(endpoint_t * ep) -{ - usbdev_pkt_t *pkt; - - // get and link a new packet for next reception - if (!(pkt = add_packet(ep, &ep->outlist, ep->max_pkt_size))) { - err("%s: could not alloc new packet", __FUNCTION__); - return; - } - - if (get_dma_active_buffer(ep->outdma) == 1) { - clear_dma_done1(ep->outdma); - set_dma_count1(ep->outdma, ep->max_pkt_size); - set_dma_count0(ep->outdma, 0); - set_dma_addr1(ep->outdma, virt_to_phys(pkt->payload)); - enable_dma_buffer1(ep->outdma); // reenable - } else { - clear_dma_done0(ep->outdma); - set_dma_count0(ep->outdma, ep->max_pkt_size); - set_dma_count1(ep->outdma, 0); - set_dma_addr0(ep->outdma, virt_to_phys(pkt->payload)); - enable_dma_buffer0(ep->outdma); // reenable - } - if (dma_halted(ep->outdma)) - start_dma(ep->outdma); -} - - -/* - * This routine is called when a packet in the outlist has been - * completed (received) and we need to prepare for a new packet - * to be received. Halts DMA and computes the packet size from the - * remaining DMA counter. Then prepares a new packet for reception - * and restarts DMA. FIXME: what if another packet comes in - * on top of the completed packet? Counter would be wrong. - * EP spinlock must be held when calling. - */ -static usbdev_pkt_t * -receive_packet_complete(endpoint_t * ep) -{ - usbdev_pkt_t *pkt = ep->outlist.tail; - u32 cs; - - halt_dma(ep->outdma); - - cs = au_readl(ep->reg->ctrl_stat); - - if (!pkt) - return NULL; - - pkt->size = ep->max_pkt_size - get_dma_residue(ep->outdma); - if (pkt->size) - dma_cache_inv((unsigned long)pkt->payload, pkt->size); - /* - * need to pull out any remaining bytes in the FIFO. - */ - endpoint_fifo_read(ep); - /* - * should be drained now, but flush anyway just in case. - */ - flush_read_fifo(ep); - - pkt->status = (cs & USBDEV_CS_NAK) ? PKT_STATUS_NAK : PKT_STATUS_ACK; - if (ep->address == 0 && (cs & USBDEV_CS_SU)) - pkt->status |= PKT_STATUS_SU; - - vdbg("%s: ep%d, %s pkt=%p, size=%d", __FUNCTION__, - ep->address, (pkt->status & PKT_STATUS_NAK) ? - "NAK" : "ACK", pkt, pkt->size); - - kickstart_receive_packet(ep); - - return pkt; -} - - -/* - **************************************************************************** - * Here starts the standard device request handlers. They are - * all called by do_setup() via a table of function pointers. - **************************************************************************** - */ - -static ep0_stage_t -do_get_status(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - switch (setup->bRequestType) { - case 0x80: // Device - // FIXME: send device status - break; - case 0x81: // Interface - // FIXME: send interface status - break; - case 0x82: // End Point - // FIXME: send endpoint status - break; - default: - // Invalid Command - endpoint_stall(&dev->ep[0]); // Stall End Point 0 - break; - } - - return STATUS_STAGE; -} - -static ep0_stage_t -do_clear_feature(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - switch (setup->bRequestType) { - case 0x00: // Device - if ((le16_to_cpu(setup->wValue) & 0xff) == 1) - dev->remote_wakeup_en = 0; - else - endpoint_stall(&dev->ep[0]); - break; - case 0x02: // End Point - if ((le16_to_cpu(setup->wValue) & 0xff) == 0) { - endpoint_t *ep = - epaddr_to_ep(dev, - le16_to_cpu(setup->wIndex) & 0xff); - - endpoint_unstall(ep); - endpoint_reset_datatoggle(ep); - } else - endpoint_stall(&dev->ep[0]); - break; - } - - return SETUP_STAGE; -} - -static ep0_stage_t -do_reserved(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - // Invalid request, stall End Point 0 - endpoint_stall(&dev->ep[0]); - return SETUP_STAGE; -} - -static ep0_stage_t -do_set_feature(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - switch (setup->bRequestType) { - case 0x00: // Device - if ((le16_to_cpu(setup->wValue) & 0xff) == 1) - dev->remote_wakeup_en = 1; - else - endpoint_stall(&dev->ep[0]); - break; - case 0x02: // End Point - if ((le16_to_cpu(setup->wValue) & 0xff) == 0) { - endpoint_t *ep = - epaddr_to_ep(dev, - le16_to_cpu(setup->wIndex) & 0xff); - - endpoint_stall(ep); - } else - endpoint_stall(&dev->ep[0]); - break; - } - - return SETUP_STAGE; -} - -static ep0_stage_t -do_set_address(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - int new_state = dev->state; - int new_addr = le16_to_cpu(setup->wValue); - - dbg("%s: our address=%d", __FUNCTION__, new_addr); - - if (new_addr > 127) { - // usb spec doesn't tell us what to do, so just go to - // default state - new_state = DEFAULT; - dev->address = 0; - } else if (dev->address != new_addr) { - dev->address = new_addr; - new_state = ADDRESS; - } - - if (dev->state != new_state) { - dev->state = new_state; - /* inform function layer of usbdev state change */ - dev->func_cb(CB_NEW_STATE, dev->state, dev->cb_data); - } - - return SETUP_STAGE; -} - -static ep0_stage_t -do_get_descriptor(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - int strnum, desc_len = le16_to_cpu(setup->wLength); - - switch (le16_to_cpu(setup->wValue) >> 8) { - case USB_DT_DEVICE: - // send device descriptor! - desc_len = desc_len > dev->dev_desc->bLength ? - dev->dev_desc->bLength : desc_len; - dbg("sending device desc, size=%d", desc_len); - send_packet(dev, alloc_packet(&dev->ep[0], desc_len, - dev->dev_desc), 0); - break; - case USB_DT_CONFIG: - // If the config descr index in low-byte of - // setup->wValue is valid, send config descr, - // otherwise stall ep0. - if ((le16_to_cpu(setup->wValue) & 0xff) == 0) { - // send config descriptor! - if (desc_len <= USB_DT_CONFIG_SIZE) { - dbg("sending partial config desc, size=%d", - desc_len); - send_packet(dev, - alloc_packet(&dev->ep[0], - desc_len, - dev->conf_desc), - 0); - } else { - int len = le16_to_cpu(dev->conf_desc->wTotalLength); - dbg("sending whole config desc," - " size=%d, our size=%d", desc_len, len); - desc_len = desc_len > len ? len : desc_len; - send_packet(dev, - alloc_packet(&dev->ep[0], - desc_len, - dev->full_conf_desc), - 0); - } - } else - endpoint_stall(&dev->ep[0]); - break; - case USB_DT_STRING: - // If the string descr index in low-byte of setup->wValue - // is valid, send string descr, otherwise stall ep0. - strnum = le16_to_cpu(setup->wValue) & 0xff; - if (strnum >= 0 && strnum < 6) { - struct usb_string_descriptor *desc = - dev->str_desc[strnum]; - desc_len = desc_len > desc->bLength ? - desc->bLength : desc_len; - dbg("sending string desc %d", strnum); - send_packet(dev, - alloc_packet(&dev->ep[0], desc_len, - desc), 0); - } else - endpoint_stall(&dev->ep[0]); - break; - default: - // Invalid request - err("invalid get desc=%d, stalled", - le16_to_cpu(setup->wValue) >> 8); - endpoint_stall(&dev->ep[0]); // Stall endpoint 0 - break; - } - - return STATUS_STAGE; -} - -static ep0_stage_t -do_set_descriptor(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - // TODO: implement - // there will be an OUT data stage (the descriptor to set) - return DATA_STAGE; -} - -static ep0_stage_t -do_get_configuration(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - // send dev->configuration - dbg("sending config"); - send_packet(dev, alloc_packet(&dev->ep[0], 1, &dev->configuration), - 0); - return STATUS_STAGE; -} - -static ep0_stage_t -do_set_configuration(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - // set active config to low-byte of setup->wValue - dev->configuration = le16_to_cpu(setup->wValue) & 0xff; - dbg("set config, config=%d", dev->configuration); - if (!dev->configuration && dev->state > DEFAULT) { - dev->state = ADDRESS; - /* inform function layer of usbdev state change */ - dev->func_cb(CB_NEW_STATE, dev->state, dev->cb_data); - } else if (dev->configuration == 1) { - dev->state = CONFIGURED; - /* inform function layer of usbdev state change */ - dev->func_cb(CB_NEW_STATE, dev->state, dev->cb_data); - } else { - // FIXME: "respond with request error" - how? - } - - return SETUP_STAGE; -} - -static ep0_stage_t -do_get_interface(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - // interface must be zero. - if ((le16_to_cpu(setup->wIndex) & 0xff) || dev->state == ADDRESS) { - // FIXME: respond with "request error". how? - } else if (dev->state == CONFIGURED) { - // send dev->alternate_setting - dbg("sending alt setting"); - send_packet(dev, alloc_packet(&dev->ep[0], 1, - &dev->alternate_setting), 0); - } - - return STATUS_STAGE; - -} - -static ep0_stage_t -do_set_interface(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - if (dev->state == ADDRESS) { - // FIXME: respond with "request error". how? - } else if (dev->state == CONFIGURED) { - dev->interface = le16_to_cpu(setup->wIndex) & 0xff; - dev->alternate_setting = - le16_to_cpu(setup->wValue) & 0xff; - // interface and alternate_setting must be zero - if (dev->interface || dev->alternate_setting) { - // FIXME: respond with "request error". how? - } - } - - return SETUP_STAGE; -} - -static ep0_stage_t -do_synch_frame(struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - // TODO - return SETUP_STAGE; -} - -typedef ep0_stage_t (*req_method_t)(struct usb_dev* dev, - struct usb_ctrlrequest* setup); - - -/* Table of the standard device request handlers */ -static const req_method_t req_method[] = { - do_get_status, - do_clear_feature, - do_reserved, - do_set_feature, - do_reserved, - do_set_address, - do_get_descriptor, - do_set_descriptor, - do_get_configuration, - do_set_configuration, - do_get_interface, - do_set_interface, - do_synch_frame -}; - - -// SETUP packet request dispatcher -static void -do_setup (struct usb_dev* dev, struct usb_ctrlrequest* setup) -{ - req_method_t m; - - dbg("%s: req %d %s", __FUNCTION__, setup->bRequestType, - get_std_req_name(setup->bRequestType)); - - if ((setup->bRequestType & USB_TYPE_MASK) != USB_TYPE_STANDARD || - (setup->bRequestType & USB_RECIP_MASK) != USB_RECIP_DEVICE) { - err("%s: invalid requesttype 0x%02x", __FUNCTION__, - setup->bRequestType); - return; - } - - if ((setup->bRequestType & 0x80) == USB_DIR_OUT && setup->wLength) - dbg("%s: OUT phase! length=%d", __FUNCTION__, setup->wLength); - - if (setup->bRequestType < sizeof(req_method)/sizeof(req_method_t)) - m = req_method[setup->bRequestType]; - else - m = do_reserved; - - dev->ep0_stage = (*m)(dev, setup); -} - -/* - * A SETUP, DATA0, or DATA1 packet has been received - * on the default control endpoint's fifo. - */ -static void -process_ep0_receive (struct usb_dev* dev) -{ - endpoint_t *ep0 = &dev->ep[0]; - usbdev_pkt_t *pkt; - - spin_lock(&ep0->lock); - - // complete packet and prepare a new packet - pkt = receive_packet_complete(ep0); - if (!pkt) { - // FIXME: should put a warn/err here. - spin_unlock(&ep0->lock); - return; - } - - // unlink immediately from endpoint. - unlink_head(&ep0->outlist); - - // override current stage if h/w says it's a setup packet - if (pkt->status & PKT_STATUS_SU) - dev->ep0_stage = SETUP_STAGE; - - switch (dev->ep0_stage) { - case SETUP_STAGE: - vdbg("SU bit is %s in setup stage", - (pkt->status & PKT_STATUS_SU) ? "set" : "not set"); - - if (pkt->size == sizeof(struct usb_ctrlrequest)) { -#ifdef VDEBUG - if (pkt->status & PKT_STATUS_ACK) - vdbg("received SETUP"); - else - vdbg("received NAK SETUP"); -#endif - do_setup(dev, (struct usb_ctrlrequest*)pkt->payload); - } else - err("%s: wrong size SETUP received", __FUNCTION__); - break; - case DATA_STAGE: - /* - * this setup has an OUT data stage. Of the standard - * device requests, only set_descriptor has this stage, - * so this packet is that descriptor. TODO: drop it for - * now, set_descriptor not implemented. - * - * Need to place a byte in the write FIFO here, to prepare - * to send a zero-length DATA ack packet to the host in the - * STATUS stage. - */ - au_writel(0, ep0->reg->write_fifo); - dbg("received OUT stage DATAx on EP0, size=%d", pkt->size); - dev->ep0_stage = SETUP_STAGE; - break; - case STATUS_STAGE: - // this setup had an IN data stage, and host is ACK'ing - // the packet we sent during that stage. - if (pkt->size != 0) - warn("received non-zero ACK on EP0??"); -#ifdef VDEBUG - else - vdbg("received ACK on EP0"); -#endif - dev->ep0_stage = SETUP_STAGE; - break; - } - - spin_unlock(&ep0->lock); - // we're done processing the packet, free it - kfree(pkt); -} - - -/* - * A DATA0/1 packet has been received on one of the OUT endpoints (4 or 5) - */ -static void -process_ep_receive (struct usb_dev* dev, endpoint_t *ep) -{ - usbdev_pkt_t *pkt; - - spin_lock(&ep->lock); - pkt = receive_packet_complete(ep); - spin_unlock(&ep->lock); - - dev->func_cb(CB_PKT_COMPLETE, (unsigned long)pkt, dev->cb_data); -} - - - -/* This ISR handles the receive complete and suspend events */ -static void req_sus_intr (int irq, void *dev_id) -{ - struct usb_dev *dev = (struct usb_dev *) dev_id; - u32 status; - - status = au_readl(USBD_INTSTAT); - au_writel(status, USBD_INTSTAT); // ack'em - - if (status & (1<<0)) - process_ep0_receive(dev); - if (status & (1<<4)) - process_ep_receive(dev, &dev->ep[4]); - if (status & (1<<5)) - process_ep_receive(dev, &dev->ep[5]); -} - - -/* This ISR handles the DMA done events on EP0 */ -static void dma_done_ep0_intr(int irq, void *dev_id) -{ - struct usb_dev *dev = (struct usb_dev *) dev_id; - usbdev_pkt_t* pkt; - endpoint_t *ep0 = &dev->ep[0]; - u32 cs0, buff_done; - - spin_lock(&ep0->lock); - cs0 = au_readl(ep0->reg->ctrl_stat); - - // first check packet transmit done - if ((buff_done = get_dma_buffer_done(ep0->indma)) != 0) { - // transmitted a DATAx packet during DATA stage - // on control endpoint 0 - // clear DMA done bit - if (buff_done & DMA_D0) - clear_dma_done0(ep0->indma); - if (buff_done & DMA_D1) - clear_dma_done1(ep0->indma); - - pkt = send_packet_complete(ep0); - kfree(pkt); - } - - /* - * Now check packet receive done. Shouldn't get these, - * the receive packet complete intr should happen - * before the DMA done intr occurs. - */ - if ((buff_done = get_dma_buffer_done(ep0->outdma)) != 0) { - // clear DMA done bit - if (buff_done & DMA_D0) - clear_dma_done0(ep0->outdma); - if (buff_done & DMA_D1) - clear_dma_done1(ep0->outdma); - - //process_ep0_receive(dev); - } - - spin_unlock(&ep0->lock); -} - -/* This ISR handles the DMA done events on endpoints 2,3,4,5 */ -static void dma_done_ep_intr(int irq, void *dev_id) -{ - struct usb_dev *dev = (struct usb_dev *) dev_id; - int i; - - for (i = 2; i < 6; i++) { - u32 buff_done; - usbdev_pkt_t* pkt; - endpoint_t *ep = &dev->ep[i]; - - if (!ep->active) continue; - - spin_lock(&ep->lock); - - if (ep->direction == USB_DIR_IN) { - buff_done = get_dma_buffer_done(ep->indma); - if (buff_done != 0) { - // transmitted a DATAx pkt on the IN ep - // clear DMA done bit - if (buff_done & DMA_D0) - clear_dma_done0(ep->indma); - if (buff_done & DMA_D1) - clear_dma_done1(ep->indma); - - pkt = send_packet_complete(ep); - - spin_unlock(&ep->lock); - dev->func_cb(CB_PKT_COMPLETE, - (unsigned long)pkt, - dev->cb_data); - spin_lock(&ep->lock); - } - } else { - /* - * Check packet receive done (OUT ep). Shouldn't get - * these, the rx packet complete intr should happen - * before the DMA done intr occurs. - */ - buff_done = get_dma_buffer_done(ep->outdma); - if (buff_done != 0) { - // received a DATAx pkt on the OUT ep - // clear DMA done bit - if (buff_done & DMA_D0) - clear_dma_done0(ep->outdma); - if (buff_done & DMA_D1) - clear_dma_done1(ep->outdma); - - //process_ep_receive(dev, ep); - } - } - - spin_unlock(&ep->lock); - } -} - - -/*************************************************************************** - * Here begins the external interface functions - *************************************************************************** - */ - -/* - * allocate a new packet - */ -int -usbdev_alloc_packet(int ep_addr, int data_size, usbdev_pkt_t** pkt) -{ - endpoint_t * ep = epaddr_to_ep(&usbdev, ep_addr); - usbdev_pkt_t* lpkt = NULL; - - if (!ep || !ep->active || ep->address < 2) - return -ENODEV; - if (data_size > ep->max_pkt_size) - return -EINVAL; - - lpkt = *pkt = alloc_packet(ep, data_size, NULL); - if (!lpkt) - return -ENOMEM; - return 0; -} - - -/* - * packet send - */ -int -usbdev_send_packet(int ep_addr, usbdev_pkt_t * pkt) -{ - unsigned long flags; - int count; - endpoint_t * ep; - - if (!pkt || !(ep = epaddr_to_ep(&usbdev, pkt->ep_addr)) || - !ep->active || ep->address < 2) - return -ENODEV; - if (ep->direction != USB_DIR_IN) - return -EINVAL; - - spin_lock_irqsave(&ep->lock, flags); - count = send_packet(&usbdev, pkt, 1); - spin_unlock_irqrestore(&ep->lock, flags); - - return count; -} - -/* - * packet receive - */ -int -usbdev_receive_packet(int ep_addr, usbdev_pkt_t** pkt) -{ - unsigned long flags; - usbdev_pkt_t* lpkt = NULL; - endpoint_t *ep = epaddr_to_ep(&usbdev, ep_addr); - - if (!ep || !ep->active || ep->address < 2) - return -ENODEV; - if (ep->direction != USB_DIR_OUT) - return -EINVAL; - - spin_lock_irqsave(&ep->lock, flags); - if (ep->outlist.count > 1) - lpkt = unlink_head(&ep->outlist); - spin_unlock_irqrestore(&ep->lock, flags); - - if (!lpkt) { - /* no packet available */ - *pkt = NULL; - return -ENODATA; - } - - *pkt = lpkt; - - return lpkt->size; -} - - -/* - * return total queued byte count on the endpoint. - */ -int -usbdev_get_byte_count(int ep_addr) -{ - unsigned long flags; - pkt_list_t *list; - usbdev_pkt_t *scan; - int count = 0; - endpoint_t * ep = epaddr_to_ep(&usbdev, ep_addr); - - if (!ep || !ep->active || ep->address < 2) - return -ENODEV; - - if (ep->direction == USB_DIR_IN) { - list = &ep->inlist; - - spin_lock_irqsave(&ep->lock, flags); - for (scan = list->head; scan; scan = scan->next) - count += scan->size; - spin_unlock_irqrestore(&ep->lock, flags); - } else { - list = &ep->outlist; - - spin_lock_irqsave(&ep->lock, flags); - if (list->count > 1) { - for (scan = list->head; scan != list->tail; - scan = scan->next) - count += scan->size; - } - spin_unlock_irqrestore(&ep->lock, flags); - } - - return count; -} - - -void -usbdev_exit(void) -{ - endpoint_t *ep; - int i; - - au_writel(0, USBD_INTEN); // disable usb dev ints - au_writel(0, USBD_ENABLE); // disable usb dev - - free_irq(AU1000_USB_DEV_REQ_INT, &usbdev); - free_irq(AU1000_USB_DEV_SUS_INT, &usbdev); - - // free all control endpoint resources - ep = &usbdev.ep[0]; - free_au1000_dma(ep->indma); - free_au1000_dma(ep->outdma); - endpoint_flush(ep); - - // free ep resources - for (i = 2; i < 6; i++) { - ep = &usbdev.ep[i]; - if (!ep->active) continue; - - if (ep->direction == USB_DIR_IN) { - free_au1000_dma(ep->indma); - } else { - free_au1000_dma(ep->outdma); - } - endpoint_flush(ep); - } - - kfree(usbdev.full_conf_desc); -} - -int -usbdev_init(struct usb_device_descriptor* dev_desc, - struct usb_config_descriptor* config_desc, - struct usb_interface_descriptor* if_desc, - struct usb_endpoint_descriptor* ep_desc, - struct usb_string_descriptor* str_desc[], - void (*cb)(usbdev_cb_type_t, unsigned long, void *), - void* cb_data) -{ - endpoint_t *ep0; - int i, ret=0; - u8* fcd; - - if (dev_desc->bNumConfigurations > 1 || - config_desc->bNumInterfaces > 1 || - if_desc->bNumEndpoints > 4) { - err("Only one config, one i/f, and no more " - "than 4 ep's allowed"); - ret = -EINVAL; - goto out; - } - - if (!cb) { - err("Function-layer callback required"); - ret = -EINVAL; - goto out; - } - - if (dev_desc->bMaxPacketSize0 != USBDEV_EP0_MAX_PACKET_SIZE) { - warn("EP0 Max Packet size must be %d", - USBDEV_EP0_MAX_PACKET_SIZE); - dev_desc->bMaxPacketSize0 = USBDEV_EP0_MAX_PACKET_SIZE; - } - - memset(&usbdev, 0, sizeof(struct usb_dev)); - - usbdev.state = DEFAULT; - usbdev.dev_desc = dev_desc; - usbdev.if_desc = if_desc; - usbdev.conf_desc = config_desc; - for (i=0; i<6; i++) - usbdev.str_desc[i] = str_desc[i]; - usbdev.func_cb = cb; - usbdev.cb_data = cb_data; - - /* Initialize default control endpoint */ - ep0 = &usbdev.ep[0]; - ep0->active = 1; - ep0->type = CONTROL_EP; - ep0->max_pkt_size = USBDEV_EP0_MAX_PACKET_SIZE; - spin_lock_init(&ep0->lock); - ep0->desc = NULL; // ep0 has no descriptor - ep0->address = 0; - ep0->direction = 0; - ep0->reg = &ep_reg[0]; - - /* Initialize the other requested endpoints */ - for (i = 0; i < if_desc->bNumEndpoints; i++) { - struct usb_endpoint_descriptor* epd = &ep_desc[i]; - endpoint_t *ep; - - if ((epd->bEndpointAddress & 0x80) == USB_DIR_IN) { - ep = &usbdev.ep[2]; - ep->address = 2; - if (ep->active) { - ep = &usbdev.ep[3]; - ep->address = 3; - if (ep->active) { - err("too many IN ep's requested"); - ret = -ENODEV; - goto out; - } - } - } else { - ep = &usbdev.ep[4]; - ep->address = 4; - if (ep->active) { - ep = &usbdev.ep[5]; - ep->address = 5; - if (ep->active) { - err("too many OUT ep's requested"); - ret = -ENODEV; - goto out; - } - } - } - - ep->active = 1; - epd->bEndpointAddress &= ~0x0f; - epd->bEndpointAddress |= (u8)ep->address; - ep->direction = epd->bEndpointAddress & 0x80; - ep->type = epd->bmAttributes & 0x03; - ep->max_pkt_size = le16_to_cpu(epd->wMaxPacketSize); - spin_lock_init(&ep->lock); - ep->desc = epd; - ep->reg = &ep_reg[ep->address]; - } - - /* - * initialize the full config descriptor - */ - usbdev.full_conf_desc = fcd = kmalloc(le16_to_cpu(config_desc->wTotalLength), - ALLOC_FLAGS); - if (!fcd) { - err("failed to alloc full config descriptor"); - ret = -ENOMEM; - goto out; - } - - memcpy(fcd, config_desc, USB_DT_CONFIG_SIZE); - fcd += USB_DT_CONFIG_SIZE; - memcpy(fcd, if_desc, USB_DT_INTERFACE_SIZE); - fcd += USB_DT_INTERFACE_SIZE; - for (i = 0; i < if_desc->bNumEndpoints; i++) { - memcpy(fcd, &ep_desc[i], USB_DT_ENDPOINT_SIZE); - fcd += USB_DT_ENDPOINT_SIZE; - } - - /* Now we're ready to enable the controller */ - au_writel(0x0002, USBD_ENABLE); - udelay(100); - au_writel(0x0003, USBD_ENABLE); - udelay(100); - - /* build and send config table based on ep descriptors */ - for (i = 0; i < 6; i++) { - endpoint_t *ep; - if (i == 1) - continue; // skip dummy ep - ep = &usbdev.ep[i]; - if (ep->active) { - au_writel((ep->address << 4) | 0x04, USBD_CONFIG); - au_writel(((ep->max_pkt_size & 0x380) >> 7) | - (ep->direction >> 4) | (ep->type << 4), - USBD_CONFIG); - au_writel((ep->max_pkt_size & 0x7f) << 1, USBD_CONFIG); - au_writel(0x00, USBD_CONFIG); - au_writel(ep->address, USBD_CONFIG); - } else { - u8 dir = (i==2 || i==3) ? DIR_IN : DIR_OUT; - au_writel((i << 4) | 0x04, USBD_CONFIG); - au_writel(((16 & 0x380) >> 7) | dir | - (BULK_EP << 4), USBD_CONFIG); - au_writel((16 & 0x7f) << 1, USBD_CONFIG); - au_writel(0x00, USBD_CONFIG); - au_writel(i, USBD_CONFIG); - } - } - - /* - * Enable Receive FIFO Complete interrupts only. Transmit - * complete is being handled by the DMA done interrupts. - */ - au_writel(0x31, USBD_INTEN); - - /* - * Controller is now enabled, request DMA and IRQ - * resources. - */ - - /* request the USB device transfer complete interrupt */ - if (request_irq(AU1000_USB_DEV_REQ_INT, req_sus_intr, IRQF_DISABLED, - "USBdev req", &usbdev)) { - err("Can't get device request intr"); - ret = -ENXIO; - goto out; - } - /* request the USB device suspend interrupt */ - if (request_irq(AU1000_USB_DEV_SUS_INT, req_sus_intr, IRQF_DISABLED, - "USBdev sus", &usbdev)) { - err("Can't get device suspend intr"); - ret = -ENXIO; - goto out; - } - - /* Request EP0 DMA and IRQ */ - if ((ep0->indma = request_au1000_dma(ep_dma_id[0].id, - ep_dma_id[0].str, - dma_done_ep0_intr, - IRQF_DISABLED, - &usbdev)) < 0) { - err("Can't get %s DMA", ep_dma_id[0].str); - ret = -ENXIO; - goto out; - } - if ((ep0->outdma = request_au1000_dma(ep_dma_id[1].id, - ep_dma_id[1].str, - NULL, 0, NULL)) < 0) { - err("Can't get %s DMA", ep_dma_id[1].str); - ret = -ENXIO; - goto out; - } - - // Flush the ep0 buffers and FIFOs - endpoint_flush(ep0); - // start packet reception on ep0 - kickstart_receive_packet(ep0); - - /* Request DMA and IRQ for the other endpoints */ - for (i = 2; i < 6; i++) { - endpoint_t *ep = &usbdev.ep[i]; - if (!ep->active) - continue; - - // Flush the endpoint buffers and FIFOs - endpoint_flush(ep); - - if (ep->direction == USB_DIR_IN) { - ep->indma = - request_au1000_dma(ep_dma_id[ep->address].id, - ep_dma_id[ep->address].str, - dma_done_ep_intr, - IRQF_DISABLED, - &usbdev); - if (ep->indma < 0) { - err("Can't get %s DMA", - ep_dma_id[ep->address].str); - ret = -ENXIO; - goto out; - } - } else { - ep->outdma = - request_au1000_dma(ep_dma_id[ep->address].id, - ep_dma_id[ep->address].str, - NULL, 0, NULL); - if (ep->outdma < 0) { - err("Can't get %s DMA", - ep_dma_id[ep->address].str); - ret = -ENXIO; - goto out; - } - - // start packet reception on OUT endpoint - kickstart_receive_packet(ep); - } - } - - out: - if (ret) - usbdev_exit(); - return ret; -} - -EXPORT_SYMBOL(usbdev_init); -EXPORT_SYMBOL(usbdev_exit); -EXPORT_SYMBOL(usbdev_alloc_packet); -EXPORT_SYMBOL(usbdev_receive_packet); -EXPORT_SYMBOL(usbdev_send_packet); -EXPORT_SYMBOL(usbdev_get_byte_count); diff --git a/arch/mips/au1000/db1x00/board_setup.c b/arch/mips/au1000/db1x00/board_setup.c index 7a79293f8527..8b08edb977be 100644 --- a/arch/mips/au1000/db1x00/board_setup.c +++ b/arch/mips/au1000/db1x00/board_setup.c @@ -58,11 +58,6 @@ void __init board_setup(void) pin_func = 0; /* not valid for 1550 */ -#ifdef CONFIG_AU1X00_USB_DEVICE - // 2nd USB port is USB device - pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000); - au_writel(pin_func, SYS_PINFUNC); -#endif #if defined(CONFIG_IRDA) && (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100)) /* set IRFIRSEL instead of GPIO15 */ diff --git a/arch/mips/au1000/mtx-1/board_setup.c b/arch/mips/au1000/mtx-1/board_setup.c index e917e54fc683..13f9bf5f91a6 100644 --- a/arch/mips/au1000/mtx-1/board_setup.c +++ b/arch/mips/au1000/mtx-1/board_setup.c @@ -51,15 +51,11 @@ void board_reset (void) void __init board_setup(void) { -#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) -#ifdef CONFIG_AU1X00_USB_DEVICE - // 2nd USB port is USB device - au_writel(au_readl(SYS_PINFUNC) & (u32)(~0x8000), SYS_PINFUNC); -#endif +#ifdef CONFIG_USB_OHCI // enable USB power switch au_writel( au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR ); au_writel( 0x100000, GPIO2_OUTPUT ); -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) +#endif // defined (CONFIG_USB_OHCI) #ifdef CONFIG_PCI #if defined(__MIPSEB__) diff --git a/arch/mips/au1000/pb1000/board_setup.c b/arch/mips/au1000/pb1000/board_setup.c index 1cf18e16ab54..824cfafaff92 100644 --- a/arch/mips/au1000/pb1000/board_setup.c +++ b/arch/mips/au1000/pb1000/board_setup.c @@ -54,7 +54,7 @@ void __init board_setup(void) au_writel(0, SYS_PINSTATERD); udelay(100); -#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) +#ifdef CONFIG_USB_OHCI /* zero and disable FREQ2 */ sys_freqctrl = au_readl(SYS_FREQCTRL0); sys_freqctrl &= ~0xFFF00000; @@ -104,23 +104,19 @@ void __init board_setup(void) */ #ifdef CONFIG_USB_OHCI sys_clksrc |= ((4<<12) | (0<<11) | (0<<10)); -#endif -#ifdef CONFIG_AU1X00_USB_DEVICE - sys_clksrc |= ((4<<7) | (0<<6) | (0<<5)); #endif au_writel(sys_clksrc, SYS_CLKSRC); // configure pins GPIO[14:9] as GPIO pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8080); -#ifndef CONFIG_AU1X00_USB_DEVICE // 2nd USB port is USB host pin_func |= 0x8000; -#endif + au_writel(pin_func, SYS_PINFUNC); au_writel(0x2800, SYS_TRIOUTCLR); au_writel(0x0030, SYS_OUTPUTCLR); -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) +#endif // defined (CONFIG_USB_OHCI) // make gpio 15 an input (for interrupt line) pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x100); diff --git a/arch/mips/au1000/pb1100/board_setup.c b/arch/mips/au1000/pb1100/board_setup.c index db27b9331ff3..2d1533f116c0 100644 --- a/arch/mips/au1000/pb1100/board_setup.c +++ b/arch/mips/au1000/pb1100/board_setup.c @@ -55,7 +55,7 @@ void __init board_setup(void) au_writel(0, SYS_PININPUTEN); udelay(100); -#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) +#ifdef CONFIG_USB_OHCI // configure pins GPIO[14:9] as GPIO pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x80); @@ -92,12 +92,10 @@ void __init board_setup(void) // get USB Functionality pin state (device vs host drive pins) pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000); -#ifndef CONFIG_AU1X00_USB_DEVICE // 2nd USB port is USB host pin_func |= 0x8000; -#endif au_writel(pin_func, SYS_PINFUNC); -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) +#endif // defined (CONFIG_USB_OHCI) /* Enable sys bus clock divider when IDLE state or no bus activity. */ au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL); diff --git a/arch/mips/au1000/pb1500/board_setup.c b/arch/mips/au1000/pb1500/board_setup.c index 1a9a293de6ab..0ffdb4fd575b 100644 --- a/arch/mips/au1000/pb1500/board_setup.c +++ b/arch/mips/au1000/pb1500/board_setup.c @@ -56,7 +56,7 @@ void __init board_setup(void) au_writel(0, SYS_PINSTATERD); udelay(100); -#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) +#ifdef CONFIG_USB_OHCI /* GPIO201 is input for PCMCIA card detect */ /* GPIO203 is input for PCMCIA interrupt request */ @@ -87,20 +87,15 @@ void __init board_setup(void) */ #ifdef CONFIG_USB_OHCI sys_clksrc |= ((4<<12) | (0<<11) | (0<<10)); -#endif -#ifdef CONFIG_AU1X00_USB_DEVICE - sys_clksrc |= ((4<<7) | (0<<6) | (0<<5)); #endif au_writel(sys_clksrc, SYS_CLKSRC); pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000); -#ifndef CONFIG_AU1X00_USB_DEVICE // 2nd USB port is USB host pin_func |= 0x8000; -#endif au_writel(pin_func, SYS_PINFUNC); -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) +#endif // defined (CONFIG_USB_OHCI) diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig index 741f8258075c..9e672f63a0aa 100644 --- a/arch/mips/configs/pb1100_defconfig +++ b/arch/mips/configs/pb1100_defconfig @@ -76,7 +76,6 @@ CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y CONFIG_SOC_AU1100=y CONFIG_SOC_AU1X00=y CONFIG_SWAP_IO_SPACE=y -# CONFIG_AU1X00_USB_DEVICE is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig index 8576340714da..d0c0f4af1bff 100644 --- a/arch/mips/configs/pb1500_defconfig +++ b/arch/mips/configs/pb1500_defconfig @@ -75,7 +75,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y CONFIG_SOC_AU1500=y CONFIG_SOC_AU1X00=y -# CONFIG_AU1X00_USB_DEVICE is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # diff --git a/include/asm-mips/mach-au1x00/au1000_usbdev.h b/include/asm-mips/mach-au1x00/au1000_usbdev.h deleted file mode 100644 index 05bc74bed0b1..000000000000 --- a/include/asm-mips/mach-au1x00/au1000_usbdev.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * BRIEF MODULE DESCRIPTION - * Au1000 USB Device-Side Driver - * - * Copyright 2001 MontaVista Software Inc. - * Author: MontaVista Software, Inc. - * stevel@mvista.com or source@mvista.com - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#define USBDEV_REV 0x0110 // BCD -#define USBDEV_EP0_MAX_PACKET_SIZE 64 - -typedef enum { - ATTACHED = 0, - POWERED, - DEFAULT, - ADDRESS, - CONFIGURED -} usbdev_state_t; - -typedef enum { - CB_NEW_STATE = 0, - CB_PKT_COMPLETE -} usbdev_cb_type_t; - - -typedef struct usbdev_pkt { - int ep_addr; // ep addr this packet routed to - int size; // size of payload in bytes - unsigned status; // packet status - struct usbdev_pkt* next; // function layer can't touch this - u8 payload[0]; // the payload -} usbdev_pkt_t; - -#define PKT_STATUS_ACK (1<<0) -#define PKT_STATUS_NAK (1<<1) -#define PKT_STATUS_SU (1<<2) - -extern int usbdev_init(struct usb_device_descriptor* dev_desc, - struct usb_config_descriptor* config_desc, - struct usb_interface_descriptor* if_desc, - struct usb_endpoint_descriptor* ep_desc, - struct usb_string_descriptor* str_desc[], - void (*cb)(usbdev_cb_type_t, unsigned long, void *), - void* cb_data); - -extern void usbdev_exit(void); - -extern int usbdev_alloc_packet (int ep_addr, int data_size, - usbdev_pkt_t** pkt); -extern int usbdev_send_packet (int ep_addr, usbdev_pkt_t* pkt); -extern int usbdev_receive_packet(int ep_addr, usbdev_pkt_t** pkt); -extern int usbdev_get_byte_count(int ep_addr); From f5c70dd7f384db4c524c35288d9be3ed61ac41a9 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Sun, 20 Aug 2006 22:55:52 +0900 Subject: [PATCH 151/232] [MIPS] Fix build errors related to wbflush.h on tx4927/tx4938. TX49 CPUs have a SYNC instruction so that CONFIG_CPU_HAS_WB is no longer needed. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/tx4927/common/tx4927_setup.c | 10 ---------- .../toshiba_rbtx4927/toshiba_rbtx4927_irq.c | 1 + arch/mips/tx4938/common/irq.c | 1 + arch/mips/tx4938/common/setup.c | 19 ------------------- arch/mips/tx4938/toshiba_rbtx4938/irq.c | 1 + 5 files changed, 3 insertions(+), 29 deletions(-) diff --git a/arch/mips/tx4927/common/tx4927_setup.c b/arch/mips/tx4927/common/tx4927_setup.c index 3ace4037343e..4658b2ae4833 100644 --- a/arch/mips/tx4927/common/tx4927_setup.c +++ b/arch/mips/tx4927/common/tx4927_setup.c @@ -53,19 +53,9 @@ void __init tx4927_time_init(void); void dump_cp0(char *key); -void (*__wbflush) (void); - -static void tx4927_write_buffer_flush(void) -{ - __asm__ __volatile__ - ("sync\n\t" "nop\n\t" "loop: bc0f loop\n\t" "nop\n\t"); -} - - void __init plat_mem_setup(void) { board_time_init = tx4927_time_init; - __wbflush = tx4927_write_buffer_flush; #ifdef CONFIG_TOSHIBA_RBTX4927 { diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c index 3e24413d4c09..0c3c3f668230 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c @@ -129,6 +129,7 @@ JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthB #include #include #include +#include #include #include #ifdef CONFIG_RTC_DS1742 diff --git a/arch/mips/tx4938/common/irq.c b/arch/mips/tx4938/common/irq.c index b6024749b8f4..77fe2454f5b9 100644 --- a/arch/mips/tx4938/common/irq.c +++ b/arch/mips/tx4938/common/irq.c @@ -30,6 +30,7 @@ #include #include #include +#include #include /**********************************************************************************/ diff --git a/arch/mips/tx4938/common/setup.c b/arch/mips/tx4938/common/setup.c index 71859c4fee84..f415a1f18fba 100644 --- a/arch/mips/tx4938/common/setup.c +++ b/arch/mips/tx4938/common/setup.c @@ -41,29 +41,10 @@ void __init tx4938_setup(void); void __init tx4938_time_init(void); void dump_cp0(char *key); -void (*__wbflush) (void); - -static void -tx4938_write_buffer_flush(void) -{ - mmiowb(); - - __asm__ __volatile__( - ".set push\n\t" - ".set noreorder\n\t" - "lw $0,%0\n\t" - "nop\n\t" - ".set pop" - : /* no output */ - : "m" (*(int *)KSEG1) - : "memory"); -} - void __init plat_mem_setup(void) { board_time_init = tx4938_time_init; - __wbflush = tx4938_write_buffer_flush; toshiba_rbtx4938_setup(); } diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c index bbb3390e98f7..102e473c10a2 100644 --- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c +++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c @@ -83,6 +83,7 @@ IRQ Device #include #include #include +#include #include #include From e04582b7bc70b40c57287cdc24f81964ee88f565 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Mon, 9 Oct 2006 00:10:01 +0900 Subject: [PATCH 152/232] [MIPS] Make sure cpu_has_fpu is used only in atomic context Make sure cpu_has_fpu (which uses smp_processor_id()) is used only in atomic context. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/kernel/proc.c | 2 +- arch/mips/kernel/process.c | 2 +- arch/mips/kernel/ptrace.c | 18 ++++++++++-------- arch/mips/kernel/ptrace32.c | 3 ++- arch/mips/kernel/traps.c | 16 +++++++++------- arch/mips/math-emu/cp1emu.c | 7 +++---- include/asm-mips/fpu.h | 6 ++++-- 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index 46ee5a68ab13..4ed37ba19731 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c @@ -107,7 +107,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "processor\t\t: %ld\n", n); sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n", - cpu_has_fpu ? " FPU V%d.%d" : ""); + cpu_data[n].options & MIPS_CPU_FPU ? " FPU V%d.%d" : ""); seq_printf(m, fmt, cpu_name[cpu_data[n].cputype <= CPU_LAST ? cpu_data[n].cputype : CPU_UNKNOWN], (version >> 4) & 0x0f, version & 0x0f, diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 045d987bc683..9f307eb1a31e 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -115,7 +115,7 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) status |= KU_USER; regs->cp0_status = status; clear_used_math(); - lose_fpu(); + clear_fpu_owner(); if (cpu_has_dsp) __init_dsp(); regs->cp0_epc = pc; diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 362d1728e531..258d74fd0b63 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -106,6 +106,7 @@ int ptrace_setregs (struct task_struct *child, __s64 __user *data) int ptrace_getfpregs (struct task_struct *child, __u32 __user *data) { int i; + unsigned int tmp; if (!access_ok(VERIFY_WRITE, data, 33 * 8)) return -EIO; @@ -121,10 +122,10 @@ int ptrace_getfpregs (struct task_struct *child, __u32 __user *data) __put_user (child->thread.fpu.fcr31, data + 64); + preempt_disable(); if (cpu_has_fpu) { - unsigned int flags, tmp; + unsigned int flags; - preempt_disable(); if (cpu_has_mipsmt) { unsigned int vpflags = dvpe(); flags = read_c0_status(); @@ -138,11 +139,11 @@ int ptrace_getfpregs (struct task_struct *child, __u32 __user *data) __asm__ __volatile__("cfc1\t%0,$0" : "=r" (tmp)); write_c0_status(flags); } - preempt_enable(); - __put_user (tmp, data + 65); } else { - __put_user ((__u32) 0, data + 65); + tmp = 0; } + preempt_enable(); + __put_user (tmp, data + 65); return 0; } @@ -245,16 +246,17 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) unsigned int mtflags; #endif /* CONFIG_MIPS_MT_SMTC */ - if (!cpu_has_fpu) + preempt_disable(); + if (!cpu_has_fpu) { + preempt_enable(); break; + } #ifdef CONFIG_MIPS_MT_SMTC /* Read-modify-write of Status must be atomic */ local_irq_save(irqflags); mtflags = dmt(); #endif /* CONFIG_MIPS_MT_SMTC */ - - preempt_disable(); if (cpu_has_mipsmt) { unsigned int vpflags = dvpe(); flags = read_c0_status(); diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index f40ecd8be05f..d9a39c169450 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c @@ -175,7 +175,9 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) unsigned int mtflags; #endif /* CONFIG_MIPS_MT_SMTC */ + preempt_disable(); if (!cpu_has_fpu) { + preempt_enable(); tmp = 0; break; } @@ -186,7 +188,6 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) mtflags = dmt(); #endif /* CONFIG_MIPS_MT_SMTC */ - preempt_disable(); if (cpu_has_mipsmt) { unsigned int vpflags = dvpe(); flags = read_c0_status(); diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index b7292a56d4cd..cce8313ec27d 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -66,7 +66,7 @@ extern asmlinkage void handle_mcheck(void); extern asmlinkage void handle_reserved(void); extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, - struct mips_fpu_struct *ctx); + struct mips_fpu_struct *ctx, int has_fpu); void (*board_be_init)(void); int (*board_be_handler)(struct pt_regs *regs, int is_fixup); @@ -641,7 +641,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) preempt_enable(); /* Run the emulator */ - sig = fpu_emulator_cop1Handler (regs, ¤t->thread.fpu); + sig = fpu_emulator_cop1Handler (regs, ¤t->thread.fpu, 1); preempt_disable(); @@ -791,11 +791,13 @@ asmlinkage void do_cpu(struct pt_regs *regs) set_used_math(); } - preempt_enable(); - - if (!cpu_has_fpu) { - int sig = fpu_emulator_cop1Handler(regs, - ¤t->thread.fpu); + if (cpu_has_fpu) { + preempt_enable(); + } else { + int sig; + preempt_enable(); + sig = fpu_emulator_cop1Handler(regs, + ¤t->thread.fpu, 0); if (sig) force_sig(sig, current); #ifdef CONFIG_MIPS_MT_FPAFF diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index 3f0d5d26d506..80531b35cd61 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c @@ -38,8 +38,6 @@ #include #include -#include -#include #include #include #include @@ -1233,7 +1231,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, return 0; } -int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx) +int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx, + int has_fpu) { unsigned long oldepc, prevepc; mips_instruction insn; @@ -1263,7 +1262,7 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx) ieee754_csr.rm = mips_rm[ieee754_csr.rm]; } - if (cpu_has_fpu) + if (has_fpu) break; if (sig) break; diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h index 58c561a9ec6b..efef843b93f0 100644 --- a/include/asm-mips/fpu.h +++ b/include/asm-mips/fpu.h @@ -134,9 +134,11 @@ static inline void restore_fp(struct task_struct *tsk) static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) { - if (cpu_has_fpu) { - if ((tsk == current) && __is_fpu_owner()) + if (tsk == current) { + preempt_disable(); + if (is_fpu_owner()) _save_fp(current); + preempt_enable(); } return tsk->thread.fpu.fpr; From b0ac3f50b8f2cd992ffd36d22c82eabdf075e9c4 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 9 Oct 2006 19:13:51 -0400 Subject: [PATCH 153/232] [HEADERS] Put linux/config.h out of its misery. Signed-off-by: Dave Jones --- arch/powerpc/platforms/82xx/mpc82xx.c | 1 - arch/powerpc/platforms/82xx/mpc82xx_ads.c | 2 -- arch/powerpc/platforms/82xx/pq2ads.h | 2 -- arch/powerpc/sysdev/qe_lib/qe_io.c | 1 - include/linux/config.h | 9 --------- 5 files changed, 15 deletions(-) delete mode 100644 include/linux/config.h diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c index 89d702de4863..0f5b30dc60da 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx.c +++ b/arch/powerpc/platforms/82xx/mpc82xx.c @@ -11,7 +11,6 @@ * option) any later version. */ -#include #include #include #include diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c index 0cea42a8053d..bb9acbb98176 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c +++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c @@ -12,8 +12,6 @@ * option) any later version. */ - -#include #include #include #include diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h index a7348213508f..fb2f92bcd770 100644 --- a/arch/powerpc/platforms/82xx/pq2ads.h +++ b/arch/powerpc/platforms/82xx/pq2ads.h @@ -22,8 +22,6 @@ #ifndef __MACH_ADS8260_DEFS #define __MACH_ADS8260_DEFS -#include - #include /* For our show_cpuinfo hooks. */ diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c index aea435970389..0afe6bfe3714 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_io.c +++ b/arch/powerpc/sysdev/qe_lib/qe_io.c @@ -14,7 +14,6 @@ * option) any later version. */ -#include #include #include #include diff --git a/include/linux/config.h b/include/linux/config.h deleted file mode 100644 index 479ffb0a22d8..000000000000 --- a/include/linux/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _LINUX_CONFIG_H -#define _LINUX_CONFIG_H -/* This file is no longer in use and kept only for backward compatibility. - * autoconf.h is now included via -imacros on the commandline - */ -#warning Including config.h is deprecated. -#include - -#endif From 99ae1c83b5107cd91e45d4d3c7bf096cdff0cf06 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 4 Oct 2006 17:31:00 -0700 Subject: [PATCH 154/232] [SPARC64]: Update MAINTAINERS entry. ultralinux@vger is deprecated, folks should use sparclinux@vger for both sparc ports. Eddie, Anton, and Jakub haven't been active in sparc64 maintainence for years, so best to remove them as reports do nothing more than fill up their mailboxes :) Signed-off-by: David S. Miller --- MAINTAINERS | 7 ------- 1 file changed, 7 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 50fb3ae5f313..931e6e40c08b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2780,14 +2780,7 @@ S: Maintained UltraSPARC (sparc64): P: David S. Miller M: davem@davemloft.net -P: Eddie C. Dost -M: ecd@brainaid.de -P: Jakub Jelinek -M: jj@sunsite.ms.mff.cuni.cz -P: Anton Blanchard -M: anton@samba.org L: sparclinux@vger.kernel.org -L: ultralinux@vger.kernel.org T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git S: Maintained From 4b75eb2bd30707c1af76145fd3a4ec2d890e1870 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 5 Oct 2006 02:07:32 -0700 Subject: [PATCH 155/232] [SPARC64]: Fix of_device bus_id settings. They have to be unique system-wide, so use "NAME@NODE" as the string pattern of the non-root nodes. Thanks to Andrew Morton for fixing the error value checking in bus_add_device() which made this problem finally noticable. Signed-off-by: David S. Miller --- arch/sparc64/kernel/of_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index 7f9204535770..d822c7c18e1f 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c @@ -841,7 +841,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp, if (!parent) strcpy(op->dev.bus_id, "root"); else - strcpy(op->dev.bus_id, dp->path_component_name); + sprintf(op->dev.bus_id, "%s@%08x", dp->name, dp->node); if (of_device_register(op)) { printk("%s: Could not register of device.\n", From 79bf06248b69b937f3a917281b4a8520a66c7582 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 5 Oct 2006 02:08:59 -0700 Subject: [PATCH 156/232] [SPARC64]: Update defconfig. Signed-off-by: David S. Miller --- arch/sparc64/defconfig | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index f54ab375464b..dcae559879ae 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18 -# Mon Oct 2 14:24:40 2006 +# Linux kernel version: 2.6.19-rc1 +# Thu Oct 5 02:08:41 2006 # CONFIG_SPARC=y CONFIG_SPARC64=y @@ -197,6 +197,7 @@ CONFIG_INET_XFRM_TUNNEL=y CONFIG_INET_TUNNEL=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=y CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set @@ -214,6 +215,7 @@ CONFIG_INET6_XFRM_TUNNEL=m CONFIG_INET6_TUNNEL=m CONFIG_INET6_XFRM_MODE_TRANSPORT=m CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set CONFIG_IPV6_TUNNEL=m # CONFIG_IPV6_SUBTREES is not set @@ -373,6 +375,7 @@ CONFIG_BLK_DEV_ALI15X3=y # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_JMICRON is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_IT821X is not set @@ -449,10 +452,10 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_STEX is not set # CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLOGICPTI is not set # CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set @@ -478,6 +481,7 @@ CONFIG_MD_RAID456=m CONFIG_MD_MULTIPATH=m # CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_MIRROR=m @@ -840,12 +844,12 @@ CONFIG_HWMON=y # # Misc devices # +# CONFIG_TIFM_CORE is not set # # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -858,6 +862,7 @@ CONFIG_VIDEO_V4L2=y # # CONFIG_FIRMWARE_EDID is not set CONFIG_FB=y +CONFIG_FB_DDC=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y @@ -1236,6 +1241,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -1279,6 +1285,7 @@ CONFIG_RAMFS=y # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set @@ -1354,6 +1361,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Distributed Lock Manager +# + # # Instrumentation Support # From 078830eaa8abccd1e95d3effce5b29273bb5ed09 Mon Sep 17 00:00:00 2001 From: Martin Habets Date: Mon, 9 Oct 2006 18:10:16 -0700 Subject: [PATCH 157/232] [SPARC32]: Fix prom.c build warning Fix these 2.6.19-rc1 build warnings: CC arch/sparc/kernel/prom.o arch/sparc/kernel/prom.c: In function `of_set_property': arch/sparc/kernel/prom.c:246: warning: passing arg 2 of `prom_setprop' discards qualifiers from pointer target type arch/sparc/kernel/prom.c: In function `build_one_prop': arch/sparc/kernel/prom.c:446: warning: unused variable `len' arch/sparc/kernel/prom.c:480: warning: ignoring return value of `prom_getproperty', declared with attribute warn_unused_result Signed-off-by: Martin Habets Signed-off-by: David S. Miller --- arch/sparc/kernel/prom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c index 4ca9e5fc97f4..2cc302b6bec0 100644 --- a/arch/sparc/kernel/prom.c +++ b/arch/sparc/kernel/prom.c @@ -243,7 +243,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len void *old_val = prop->value; int ret; - ret = prom_setprop(dp->node, name, val, len); + ret = prom_setprop(dp->node, (char *) name, val, len); err = -EINVAL; if (ret >= 0) { prop->value = new_val; @@ -477,7 +477,10 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s p->length = 0; } else { p->value = prom_early_alloc(p->length + 1); - prom_getproperty(node, p->name, p->value, p->length); + len = prom_getproperty(node, p->name, p->value, + p->length); + if (len <= 0) + p->length = 0; ((unsigned char *)p->value)[p->length] = '\0'; } } From f583ffce1aac783fd16d5d75cd69ac5ebb8f4933 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 10 Oct 2006 11:47:07 +1000 Subject: [PATCH 158/232] [POWERPC] Fix xmon IRQ handler for pt_regs removal Signed-off-by: Paul Mackerras --- arch/powerpc/xmon/xmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 5a854f36383c..f56ffef4defa 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef CONFIG_PPC64 #include @@ -521,13 +522,12 @@ int xmon(struct pt_regs *excp) } EXPORT_SYMBOL(xmon); -irqreturn_t -xmon_irq(int irq, void *d, struct pt_regs *regs) +irqreturn_t xmon_irq(int irq, void *d) { unsigned long flags; local_irq_save(flags); printf("Keyboard interrupt\n"); - xmon(regs); + xmon(get_irq_regs()); local_irq_restore(flags); return IRQ_HANDLED; } From dcf9065122660f4e3df02a47a75dc702d5531244 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Sat, 30 Sep 2006 11:54:09 +1000 Subject: [PATCH 159/232] [POWERPC] Fix boot wrapper invocation if CROSS_COMPILE contains spaces My CROSS_COMPILE is "ccache /opt/compilers/blah", which confuses the boot wrapper script. Quote CROSS_COMPILE and CROSS32_COMPILE so they can safely contain spaces. Signed-off-by: Michael Ellerman Signed-off-by: Paul Mackerras --- arch/powerpc/boot/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 003520b56303..bfd17b145803 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -105,10 +105,10 @@ wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff) # Bits for building various flavours of zImage ifneq ($(CROSS32_COMPILE),) -CROSSWRAP := -C $(CROSS32_COMPILE) +CROSSWRAP := -C "$(CROSS32_COMPILE)" else ifneq ($(CROSS_COMPILE),) -CROSSWRAP := -C $(CROSS_COMPILE) +CROSSWRAP := -C "$(CROSS_COMPILE)" endif endif From 020533ef24309803789ab8b325b1a6463388decf Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Sat, 7 Oct 2006 15:33:53 -0700 Subject: [PATCH 160/232] [POWERPC] cell: fix default zImage build target Change CONFIG_PPC_CELL to CONFIG_PPC_IBM_CELL_BLADE in the powerpc boot makefile. CONFIG_PPC_CELL is used to build the generic cell processor support, and is not an indication of platform. Signed-off-by: Geoff Levand Signed-off-by: Paul Mackerras --- arch/powerpc/boot/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index bfd17b145803..37ddfcab0003 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -151,12 +151,12 @@ $(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits) $(obj)/uImage: vmlinux $(wrapperbits) $(call cmd,wrap,uboot) -image-$(CONFIG_PPC_PSERIES) += zImage.pseries -image-$(CONFIG_PPC_MAPLE) += zImage.pseries -image-$(CONFIG_PPC_CELL) += zImage.pseries -image-$(CONFIG_PPC_CHRP) += zImage.chrp -image-$(CONFIG_PPC_PMAC) += zImage.pmac -image-$(CONFIG_DEFAULT_UIMAGE) += uImage +image-$(CONFIG_PPC_PSERIES) += zImage.pseries +image-$(CONFIG_PPC_MAPLE) += zImage.pseries +image-$(CONFIG_PPC_IBM_CELL_BLADE) += zImage.pseries +image-$(CONFIG_PPC_CHRP) += zImage.chrp +image-$(CONFIG_PPC_PMAC) += zImage.pmac +image-$(CONFIG_DEFAULT_UIMAGE) += uImage # For 32-bit powermacs, build the COFF and miboot images # as well as the ELF images. From c10af8c38da7a0bc9010d6609237c1ab6d2da12c Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 9 Oct 2006 13:25:15 +1000 Subject: [PATCH 161/232] [POWERPC] Make U4 PCIe work on maple The Maple support code was missing code for U4/CPC945 PCIe. This adds it, enabling it to work on tigerwood boards, and possibly also js21 using SLOF. Also disable an obsolete firmware workaround. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/maple/pci.c | 176 +++++++++++++++++++++++++++-- 1 file changed, 169 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index 1b827618e05f..8debae3aa3c9 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c @@ -8,7 +8,7 @@ * 2 of the License, or (at your option) any later version. */ -#define DEBUG +#undef DEBUG #include #include @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -33,7 +34,7 @@ #define DBG(x...) #endif -static struct pci_controller *u3_agp, *u3_ht; +static struct pci_controller *u3_agp, *u3_ht, *u4_pcie; static int __init fixup_one_level_bus_range(struct device_node *node, int higher) { @@ -287,6 +288,114 @@ static struct pci_ops u3_ht_pci_ops = u3_ht_write_config }; +static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off) +{ + return (1 << PCI_SLOT(devfn)) | + (PCI_FUNC(devfn) << 8) | + ((off >> 8) << 28) | + (off & 0xfcu); +} + +static unsigned int u4_pcie_cfa1(unsigned int bus, unsigned int devfn, + unsigned int off) +{ + return (bus << 16) | + (devfn << 8) | + ((off >> 8) << 28) | + (off & 0xfcu) | 1u; +} + +static volatile void __iomem *u4_pcie_cfg_access(struct pci_controller* hose, + u8 bus, u8 dev_fn, int offset) +{ + unsigned int caddr; + + if (bus == hose->first_busno) + caddr = u4_pcie_cfa0(dev_fn, offset); + else + caddr = u4_pcie_cfa1(bus, dev_fn, offset); + + /* Uninorth will return garbage if we don't read back the value ! */ + do { + out_le32(hose->cfg_addr, caddr); + } while (in_le32(hose->cfg_addr) != caddr); + + offset &= 0x03; + return hose->cfg_data + offset; +} + +static int u4_pcie_read_config(struct pci_bus *bus, unsigned int devfn, + int offset, int len, u32 *val) +{ + struct pci_controller *hose; + volatile void __iomem *addr; + + hose = pci_bus_to_host(bus); + if (hose == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; + if (offset >= 0x1000) + return PCIBIOS_BAD_REGISTER_NUMBER; + addr = u4_pcie_cfg_access(hose, bus->number, devfn, offset); + if (!addr) + return PCIBIOS_DEVICE_NOT_FOUND; + /* + * Note: the caller has already checked that offset is + * suitably aligned and that len is 1, 2 or 4. + */ + switch (len) { + case 1: + *val = in_8(addr); + break; + case 2: + *val = in_le16(addr); + break; + default: + *val = in_le32(addr); + break; + } + return PCIBIOS_SUCCESSFUL; +} +static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn, + int offset, int len, u32 val) +{ + struct pci_controller *hose; + volatile void __iomem *addr; + + hose = pci_bus_to_host(bus); + if (hose == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; + if (offset >= 0x1000) + return PCIBIOS_BAD_REGISTER_NUMBER; + addr = u4_pcie_cfg_access(hose, bus->number, devfn, offset); + if (!addr) + return PCIBIOS_DEVICE_NOT_FOUND; + /* + * Note: the caller has already checked that offset is + * suitably aligned and that len is 1, 2 or 4. + */ + switch (len) { + case 1: + out_8(addr, val); + (void) in_8(addr); + break; + case 2: + out_le16(addr, val); + (void) in_le16(addr); + break; + default: + out_le32(addr, val); + (void) in_le32(addr); + break; + } + return PCIBIOS_SUCCESSFUL; +} + +static struct pci_ops u4_pcie_pci_ops = +{ + u4_pcie_read_config, + u4_pcie_write_config +}; + static void __init setup_u3_agp(struct pci_controller* hose) { /* On G5, we move AGP up to high bus number so we don't need @@ -307,6 +416,26 @@ static void __init setup_u3_agp(struct pci_controller* hose) u3_agp = hose; } +static void __init setup_u4_pcie(struct pci_controller* hose) +{ + /* We currently only implement the "non-atomic" config space, to + * be optimised later. + */ + hose->ops = &u4_pcie_pci_ops; + hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000); + hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000); + + /* The bus contains a bridge from root -> device, we need to + * make it visible on bus 0 so that we pick the right type + * of config cycles. If we didn't, we would have to force all + * config cycles to be type 1. So we override the "bus-range" + * property here + */ + hose->first_busno = 0x00; + hose->last_busno = 0xff; + u4_pcie = hose; +} + static void __init setup_u3_ht(struct pci_controller* hose) { hose->ops = &u3_ht_pci_ops; @@ -354,6 +483,10 @@ static int __init add_bridge(struct device_node *dev) setup_u3_ht(hose); disp_name = "U3-HT"; primary = 1; + } else if (device_is_compatible(dev, "u4-pcie")) { + setup_u4_pcie(hose); + disp_name = "U4-PCIE"; + primary = 0; } printk(KERN_INFO "Found %s PCI host bridge. Firmware bus number: %d->%d\n", disp_name, hose->first_busno, hose->last_busno); @@ -361,7 +494,6 @@ static int __init add_bridge(struct device_node *dev) /* Interpret the "ranges" property */ /* This also maps the I/O region and sets isa_io/mem_base */ pci_process_bridge_OF_ranges(hose, dev, primary); - pci_setup_phb_io(hose, primary); /* Fixup "bus-range" OF property */ fixup_bus_range(dev); @@ -376,8 +508,17 @@ void __init maple_pcibios_fixup(void) DBG(" -> maple_pcibios_fixup\n"); - for_each_pci_dev(dev) - pci_read_irq_line(dev); + for_each_pci_dev(dev) { + /* Fixup IRQ for PCIe host */ + if (u4_pcie != NULL && dev->bus->number == 0 && + pci_bus_to_host(dev->bus) == u4_pcie) { + printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n"); + dev->irq = irq_create_mapping(NULL, 1); + if (dev->irq != NO_IRQ) + set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); + } else + pci_read_irq_line(dev); + } DBG(" <- maple_pcibios_fixup\n"); } @@ -388,8 +529,10 @@ static void __init maple_fixup_phb_resources(void) list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { unsigned long offset = (unsigned long)hose->io_base_virt - pci_io_base; + hose->io_resource.start += offset; hose->io_resource.end += offset; + printk(KERN_INFO "PCI Host %d, io start: %llx; io end: %llx\n", hose->global_number, (unsigned long long)hose->io_resource.start, @@ -431,6 +574,19 @@ void __init maple_pci_init(void) if (ht && add_bridge(ht) != 0) of_node_put(ht); + /* + * We need to call pci_setup_phb_io for the HT bridge first + * so it gets the I/O port numbers starting at 0, and we + * need to call it for the AGP bridge after that so it gets + * small positive I/O port numbers. + */ + if (u3_ht) + pci_setup_phb_io(u3_ht, 1); + if (u3_agp) + pci_setup_phb_io(u3_agp, 0); + if (u4_pcie) + pci_setup_phb_io(u4_pcie, 0); + /* Fixup the IO resources on our host bridges as the common code * does it only for childs of the host bridges */ @@ -465,8 +621,11 @@ int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel) return defirq; np = pci_device_to_OF_node(pdev); - if (np == NULL) + if (np == NULL) { + printk("Failed to locate OF node for IDE %s\n", + pci_name(pdev)); return defirq; + } irq = irq_of_parse_and_map(np, channel & 0x1); if (irq == NO_IRQ) { printk("Failed to map onboard IDE interrupt for channel %d\n", @@ -479,6 +638,9 @@ int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel) /* XXX: To remove once all firmwares are ok */ static void fixup_maple_ide(struct pci_dev* dev) { + if (!machine_is(maple)) + return; + #if 0 /* Enable this to enable IDE port 0 */ { u8 v; @@ -495,7 +657,7 @@ static void fixup_maple_ide(struct pci_dev* dev) dev->resource[4].start = 0xcc00; dev->resource[4].end = 0xcc10; #endif -#if 1 /* Enable this to fixup IDE sense/polarity of irqs in IO-APICs */ +#if 0 /* Enable this to fixup IDE sense/polarity of irqs in IO-APICs */ { struct pci_dev *apicdev; u32 v; From 1e1b20a119ac45a290bbc6261f69a2a6a2cc064a Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 9 Oct 2006 13:27:28 +1000 Subject: [PATCH 162/232] [POWERPC] Fix Maple secondary IDE interrupt The IDE driver will pick up the PCI IRQ for both channels on Maple despite the fact that it's in legacy mode. This works around it by "hiding" the PCI IRQ of the AMD8111 IDE controller when it's configured in legacy mode on the Maple platform, thus causing the driver to call pci_get_legacy_ide_irq() which will return the correct interrupts for both channels. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/maple/pci.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index 8debae3aa3c9..63b4d1bff359 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c @@ -516,8 +516,21 @@ void __init maple_pcibios_fixup(void) dev->irq = irq_create_mapping(NULL, 1); if (dev->irq != NO_IRQ) set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW); - } else - pci_read_irq_line(dev); + continue; + } + + /* Hide AMD8111 IDE interrupt when in legacy mode so + * the driver calls pci_get_legacy_ide_irq() + */ + if (dev->vendor == PCI_VENDOR_ID_AMD && + dev->device == PCI_DEVICE_ID_AMD_8111_IDE && + (dev->class & 5) != 5) { + dev->irq = NO_IRQ; + continue; + } + + /* For all others, map the interrupt from the device-tree */ + pci_read_irq_line(dev); } DBG(" <- maple_pcibios_fixup\n"); From 8de242e60a441f177dd51b323894b17d3d63e9f2 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 9 Oct 2006 13:28:59 +1000 Subject: [PATCH 163/232] [POWERPC] Update maple defconfig This updates the Maple defconfig to 4 CPUs (along with current defaults) to support the "tigerwood" 970MP evaluation board. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/powerpc/configs/maple_defconfig | 56 +++++++++++++++++++++------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig index 62ba66091a13..ae96a5b2f00d 100644 --- a/arch/powerpc/configs/maple_defconfig +++ b/arch/powerpc/configs/maple_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.18-rc6 -# Sun Sep 10 10:24:55 2006 +# Linux kernel version: 2.6.18 +# Mon Oct 9 11:59:34 2006 # CONFIG_PPC64=y CONFIG_64BIT=y @@ -22,6 +22,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_PPC_OF=y CONFIG_PPC_UDBG_16550=y CONFIG_GENERIC_TBSYNC=y +CONFIG_AUDIT_ARCH=y # CONFIG_DEFAULT_UIMAGE is not set # @@ -34,7 +35,7 @@ CONFIG_PPC_FPU=y CONFIG_PPC_STD_MMU=y CONFIG_VIRT_CPU_ACCOUNTING=y CONFIG_SMP=y -CONFIG_NR_CPUS=2 +CONFIG_NR_CPUS=4 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # @@ -51,10 +52,11 @@ CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y +# CONFIG_IPC_NS is not set CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set -CONFIG_SYSCTL=y +# CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y @@ -62,7 +64,9 @@ CONFIG_IKCONFIG_PROC=y # CONFIG_RELAY is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y # CONFIG_EMBEDDED is not set +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_EXTRA_PASS is not set @@ -71,12 +75,12 @@ CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y -CONFIG_RT_MUTEXES=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_SLAB=y CONFIG_VM_EVENT_COUNTERS=y +CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set @@ -95,6 +99,7 @@ CONFIG_STOP_MACHINE=y # # Block layer # +CONFIG_BLOCK=y # CONFIG_BLK_DEV_IO_TRACE is not set # @@ -114,16 +119,16 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" # Platform support # CONFIG_PPC_MULTIPLATFORM=y -# CONFIG_PPC_ISERIES is not set # CONFIG_EMBEDDED6xx is not set # CONFIG_APUS is not set # CONFIG_PPC_PSERIES is not set +# CONFIG_PPC_ISERIES is not set # CONFIG_PPC_PMAC is not set CONFIG_PPC_MAPLE=y +# CONFIG_PPC_PASEMI is not set # CONFIG_PPC_CELL is not set # CONFIG_PPC_CELL_NATIVE is not set # CONFIG_PPC_IBM_CELL_BLADE is not set -# CONFIG_UDBG_RTAS_CONSOLE is not set CONFIG_U3_DART=y # CONFIG_PPC_RTAS is not set # CONFIG_MMIO_NVRAM is not set @@ -157,6 +162,7 @@ CONFIG_IRQ_ALL_CPUS=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set @@ -184,6 +190,7 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_PCI=y CONFIG_PCI_DOMAINS=y # CONFIG_PCIEPORTBUS is not set +# CONFIG_PCI_MULTITHREAD_PROBE is not set # CONFIG_PCI_DEBUG is not set # @@ -211,6 +218,7 @@ CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_XFRM=y CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set # CONFIG_NET_KEY is not set CONFIG_INET=y CONFIG_IP_MULTICAST=y @@ -232,10 +240,12 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_TUNNEL is not set CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=y CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_BIC=y +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" # CONFIG_IPV6 is not set # CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set @@ -265,7 +275,6 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set @@ -377,6 +386,7 @@ CONFIG_BLK_DEV_AMD74XX=y # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_JMICRON is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_IT821X is not set @@ -399,6 +409,12 @@ CONFIG_IDEDMA_AUTO=y # # CONFIG_RAID_ATTRS is not set # CONFIG_SCSI is not set +# CONFIG_SCSI_NETLINK is not set + +# +# Serial ATA (prod) and Parallel ATA (experimental) drivers +# +# CONFIG_ATA is not set # # Multi-device support (RAID and LVM) @@ -498,7 +514,7 @@ CONFIG_E1000=y # CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=y # CONFIG_BNX2 is not set -# CONFIG_MV643XX_ETH is not set +# CONFIG_QLA3XXX is not set # # Ethernet (10000 Mbit) @@ -545,6 +561,7 @@ CONFIG_TIGON3=y # Input device support # CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set # # Userland interfaces @@ -704,6 +721,7 @@ CONFIG_I2C_AMD8111=y # # Misc devices # +# CONFIG_TIFM_CORE is not set # # Multimedia devices @@ -779,7 +797,6 @@ CONFIG_USB_UHCI_HCD=y # # may also be needed; see USB_STORAGE Help for more information # -# CONFIG_USB_STORAGE is not set # CONFIG_USB_LIBUSUAL is not set # @@ -802,6 +819,7 @@ CONFIG_USB_HIDINPUT=y # CONFIG_USB_ATI_REMOTE2 is not set # CONFIG_USB_KEYSPAN_REMOTE is not set # CONFIG_USB_APPLETOUCH is not set +# CONFIG_USB_TRANCEVIBRATOR is not set # # USB Imaging devices @@ -828,6 +846,7 @@ CONFIG_USB_MON=y CONFIG_USB_SERIAL=y # CONFIG_USB_SERIAL_CONSOLE is not set CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_AIRCABLE is not set # CONFIG_USB_SERIAL_AIRPRIME is not set # CONFIG_USB_SERIAL_ARK3116 is not set # CONFIG_USB_SERIAL_BELKIN is not set @@ -862,6 +881,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y # CONFIG_USB_SERIAL_KLSI is not set # CONFIG_USB_SERIAL_KOBIL_SCT is not set # CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set # CONFIG_USB_SERIAL_NAVMAN is not set # CONFIG_USB_SERIAL_PL2303 is not set # CONFIG_USB_SERIAL_HP4X is not set @@ -879,6 +899,7 @@ CONFIG_USB_EZUSB=y # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set @@ -886,9 +907,9 @@ CONFIG_USB_EZUSB=y # CONFIG_USB_LED is not set # CONFIG_USB_CYPRESS_CY7C63 is not set # CONFIG_USB_CYTHERM is not set -# CONFIG_USB_PHIDGETKIT is not set -# CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_PHIDGET is not set # CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set # CONFIG_USB_APPLEDISPLAY is not set # CONFIG_USB_SISUSBVGA is not set # CONFIG_USB_LD is not set @@ -995,8 +1016,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y CONFIG_SYSFS=y CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -1129,6 +1152,7 @@ CONFIG_PLIST=y # Kernel hacking # # CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y # CONFIG_UNUSED_SYMBOLS is not set CONFIG_DEBUG_KERNEL=y @@ -1148,6 +1172,7 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set # CONFIG_FORCED_INLINING is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y @@ -1169,6 +1194,9 @@ CONFIG_BOOTX_TEXT=y # Cryptographic options # CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_MANAGER=m # CONFIG_CRYPTO_HMAC is not set # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set @@ -1178,6 +1206,8 @@ CONFIG_CRYPTO_MD5=y # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_WP512 is not set # CONFIG_CRYPTO_TGR192 is not set +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=m CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set From 39e3eb7265b8698e5f607a317af13c9478274736 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 12:48:42 +0100 Subject: [PATCH 164/232] [POWERPC] ARCH=ppc pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Paul Mackerras --- arch/ppc/4xx_io/serial_sicc.c | 8 ++++---- arch/ppc/8260_io/enet.c | 4 ++-- arch/ppc/8260_io/fcc_enet.c | 6 +++--- arch/ppc/8xx_io/commproc.c | 19 +++++++++---------- arch/ppc/8xx_io/cs4218_tdm.c | 4 ++-- arch/ppc/8xx_io/enet.c | 4 ++-- arch/ppc/8xx_io/fec.c | 7 +++---- arch/ppc/kernel/smp.c | 4 ++-- arch/ppc/platforms/apus_setup.c | 2 +- arch/ppc/platforms/hdpu.c | 22 ++++++++++------------ arch/ppc/platforms/radstone_ppc7d.c | 10 +++++----- arch/ppc/platforms/sbc82xx.c | 4 ++-- arch/ppc/syslib/cpc700.h | 2 +- arch/ppc/syslib/cpc700_pic.c | 2 +- arch/ppc/syslib/cpm2_pic.c | 2 +- arch/ppc/syslib/cpm2_pic.h | 2 +- arch/ppc/syslib/gt64260_pic.c | 9 +++------ arch/ppc/syslib/ibm440gx_common.c | 2 +- arch/ppc/syslib/ipic.c | 2 +- arch/ppc/syslib/m82xx_pci.c | 4 ++-- arch/ppc/syslib/m8xx_setup.c | 2 +- arch/ppc/syslib/m8xx_wdt.c | 4 ++-- arch/ppc/syslib/mpc52xx_pic.c | 2 +- arch/ppc/syslib/mv64360_pic.c | 18 +++++++----------- arch/ppc/syslib/open_pic2.c | 2 +- arch/ppc/syslib/ppc403_pic.c | 2 +- arch/ppc/syslib/ppc4xx_pic.c | 8 ++++---- arch/ppc/syslib/ppc85xx_rio.c | 9 +++------ arch/ppc/syslib/ppc8xx_pic.c | 4 ++-- arch/ppc/syslib/xilinx_pic.c | 2 +- include/asm-ppc/commproc.h | 3 +-- include/asm-ppc/gt64260.h | 2 +- include/asm-ppc/mpc52xx.h | 2 +- include/asm-ppc/mv64x60.h | 4 ++-- 34 files changed, 84 insertions(+), 99 deletions(-) diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c index 080a20531f8b..e35483961b90 100644 --- a/arch/ppc/4xx_io/serial_sicc.c +++ b/arch/ppc/4xx_io/serial_sicc.c @@ -414,7 +414,7 @@ static void siccuart_event(struct SICC_info *info, int event) } static void -siccuart_rx_chars(struct SICC_info *info, struct pt_regs *regs) +siccuart_rx_chars(struct SICC_info *info) { struct tty_struct *tty = info->tty; unsigned int status, ch, rsr, flg, ignored = 0; @@ -553,15 +553,15 @@ static void siccuart_tx_chars(struct SICC_info *info) } -static irqreturn_t siccuart_int_rx(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t siccuart_int_rx(int irq, void *dev_id) { struct SICC_info *info = dev_id; - siccuart_rx_chars(info, regs); + siccuart_rx_chars(info) return IRQ_HANDLED; } -static irqreturn_t siccuart_int_tx(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t siccuart_int_tx(int irq, void *dev_id) { struct SICC_info *info = dev_id; siccuart_tx_chars(info); diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c index ac6d55fe2235..a6056c29cf00 100644 --- a/arch/ppc/8260_io/enet.c +++ b/arch/ppc/8260_io/enet.c @@ -122,7 +122,7 @@ struct scc_enet_private { static int scc_enet_open(struct net_device *dev); static int scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); static int scc_enet_rx(struct net_device *dev); -static irqreturn_t scc_enet_interrupt(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t scc_enet_interrupt(int irq, void *dev_id); static int scc_enet_close(struct net_device *dev); static struct net_device_stats *scc_enet_get_stats(struct net_device *dev); static void set_multicast_list(struct net_device *dev); @@ -273,7 +273,7 @@ scc_enet_timeout(struct net_device *dev) * This is called from the CPM handler, not the MPC core interrupt. */ static irqreturn_t -scc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) +scc_enet_interrupt(int irq, void * dev_id) { struct net_device *dev = dev_id; volatile struct scc_enet_private *cep; diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c index e347fe88316d..2e1943e27819 100644 --- a/arch/ppc/8260_io/fcc_enet.c +++ b/arch/ppc/8260_io/fcc_enet.c @@ -140,7 +140,7 @@ typedef struct { static int fcc_enet_open(struct net_device *dev); static int fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); static int fcc_enet_rx(struct net_device *dev); -static irqreturn_t fcc_enet_interrupt(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t fcc_enet_interrupt(int irq, void *dev_id); static int fcc_enet_close(struct net_device *dev); static struct net_device_stats *fcc_enet_get_stats(struct net_device *dev); /* static void set_multicast_list(struct net_device *dev); */ @@ -524,7 +524,7 @@ fcc_enet_timeout(struct net_device *dev) /* The interrupt handler. */ static irqreturn_t -fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) +fcc_enet_interrupt(int irq, void * dev_id) { struct net_device *dev = dev_id; volatile struct fcc_enet_private *cep; @@ -1563,7 +1563,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) #ifdef PHY_INTERRUPT /* This interrupt occurs when the PHY detects a link change. */ static irqreturn_t -mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) +mii_link_interrupt(int irq, void * dev_id) { struct net_device *dev = dev_id; struct fcc_enet_private *fep = dev->priv; diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 9b3ace26280c..3b23bcb35b7a 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c @@ -47,12 +47,12 @@ cpm8xx_t *cpmp; /* Pointer to comm processor space */ /* CPM interrupt vector functions. */ struct cpm_action { - void (*handler)(void *, struct pt_regs * regs); + void (*handler)(void *); void *dev_id; }; static struct cpm_action cpm_vecs[CPMVEC_NR]; -static irqreturn_t cpm_interrupt(int irq, void * dev, struct pt_regs * regs); -static irqreturn_t cpm_error_interrupt(int irq, void *dev, struct pt_regs * regs); +static irqreturn_t cpm_interrupt(int irq, void * dev); +static irqreturn_t cpm_error_interrupt(int irq, void *dev); static void alloc_host_memory(void); /* Define a table of names to identify CPM interrupt handlers in * /proc/interrupts. @@ -205,7 +205,7 @@ cpm_interrupt_init(void) * Get the CPM interrupt vector. */ int -cpm_get_irq(struct pt_regs *regs) +cpm_get_irq(void) { int cpm_vec; @@ -222,7 +222,7 @@ cpm_get_irq(struct pt_regs *regs) /* CPM interrupt controller cascade interrupt. */ static irqreturn_t -cpm_interrupt(int irq, void * dev, struct pt_regs * regs) +cpm_interrupt(int irq, void * dev) { /* This interrupt handler never actually gets called. It is * installed only to unmask the CPM cascade interrupt in the SIU @@ -237,7 +237,7 @@ cpm_interrupt(int irq, void * dev, struct pt_regs * regs) * tests in the interrupt handler. */ static irqreturn_t -cpm_error_interrupt(int irq, void *dev, struct pt_regs *regs) +cpm_error_interrupt(int irq, void *dev) { return IRQ_HANDLED; } @@ -246,11 +246,11 @@ cpm_error_interrupt(int irq, void *dev, struct pt_regs *regs) * request_irq() to the handler prototype required by cpm_install_handler(). */ static irqreturn_t -cpm_handler_helper(int irq, void *dev_id, struct pt_regs *regs) +cpm_handler_helper(int irq, void *dev_id) { int cpm_vec = irq - CPM_IRQ_OFFSET; - (*cpm_vecs[cpm_vec].handler)(dev_id, regs); + (*cpm_vecs[cpm_vec].handler)(dev_id); return IRQ_HANDLED; } @@ -267,8 +267,7 @@ cpm_handler_helper(int irq, void *dev_id, struct pt_regs *regs) * request_irq() or cpm_install_handler(). */ void -cpm_install_handler(int cpm_vec, void (*handler)(void *, struct pt_regs *regs), - void *dev_id) +cpm_install_handler(int cpm_vec, void (*handler)(void *), void *dev_id) { int err; diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index f5f300fc213d..959d31c26cbb 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c @@ -331,7 +331,7 @@ static int CS_SetFormat(int format); static int CS_SetVolume(int volume); static void cs4218_tdm_tx_intr(void *devid); static void cs4218_tdm_rx_intr(void *devid); -static void cs4218_intr(void *devid, struct pt_regs *regs); +static void cs4218_intr(void *devid); static int cs_get_volume(uint reg); static int cs_volume_setter(int volume, int mute); static int cs_get_gain(uint reg); @@ -2646,7 +2646,7 @@ int __init tdm8xx_sound_init(void) * full duplex operation. */ static void -cs4218_intr(void *dev_id, struct pt_regs *regs) +cs4218_intr(void *dev_id) { volatile smc_t *sp; volatile cpm8xx_t *cp; diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c index a695375c3e4c..b23c45bc151a 100644 --- a/arch/ppc/8xx_io/enet.c +++ b/arch/ppc/8xx_io/enet.c @@ -149,7 +149,7 @@ struct scc_enet_private { static int scc_enet_open(struct net_device *dev); static int scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); static int scc_enet_rx(struct net_device *dev); -static void scc_enet_interrupt(void *dev_id, struct pt_regs *regs); +static void scc_enet_interrupt(void *dev_id); static int scc_enet_close(struct net_device *dev); static struct net_device_stats *scc_enet_get_stats(struct net_device *dev); static void set_multicast_list(struct net_device *dev); @@ -305,7 +305,7 @@ scc_enet_timeout(struct net_device *dev) * This is called from the CPM handler, not the MPC core interrupt. */ static void -scc_enet_interrupt(void *dev_id, struct pt_regs *regs) +scc_enet_interrupt(void *dev_id) { struct net_device *dev = dev_id; volatile struct scc_enet_private *cep; diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c index 8b6295bbb564..2f9fa9e3d331 100644 --- a/arch/ppc/8xx_io/fec.c +++ b/arch/ppc/8xx_io/fec.c @@ -198,8 +198,7 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); #ifdef CONFIG_USE_MDIO static void fec_enet_mii(struct net_device *dev); #endif /* CONFIG_USE_MDIO */ -static irqreturn_t fec_enet_interrupt(int irq, void * dev_id, - struct pt_regs * regs); +static irqreturn_t fec_enet_interrupt(int irq, void * dev_id); #ifdef CONFIG_FEC_PACKETHOOK static void fec_enet_tx(struct net_device *dev, __u32 regval); static void fec_enet_rx(struct net_device *dev, __u32 regval); @@ -472,7 +471,7 @@ fec_timeout(struct net_device *dev) * This is called from the MPC core interrupt. */ static irqreturn_t -fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) +fec_enet_interrupt(int irq, void * dev_id) { struct net_device *dev = dev_id; volatile fec_t *fecp; @@ -1408,7 +1407,7 @@ static #ifdef CONFIG_RPXCLASSIC void mii_link_interrupt(void *dev_id) #else -irqreturn_t mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) +irqreturn_t mii_link_interrupt(int irq, void * dev_id) #endif { #ifdef CONFIG_USE_MDIO diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c index ca57e896a36c..96a55972b986 100644 --- a/arch/ppc/kernel/smp.c +++ b/arch/ppc/kernel/smp.c @@ -84,7 +84,7 @@ smp_message_pass(int target, int msg) /* * Common functions */ -void smp_message_recv(int msg, struct pt_regs *regs) +void smp_message_recv(int msg) { atomic_inc(&ipi_recv); @@ -100,7 +100,7 @@ void smp_message_recv(int msg, struct pt_regs *regs) break; #ifdef CONFIG_XMON case PPC_MSG_XMON_BREAK: - xmon(regs); + xmon(get_irq_regs()); break; #endif /* CONFIG_XMON */ default: diff --git a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c index 1d034ead2c9a..063274d2c503 100644 --- a/arch/ppc/platforms/apus_setup.c +++ b/arch/ppc/platforms/apus_setup.c @@ -492,7 +492,7 @@ apus_halt(void) static unsigned char last_ipl[8]; -int apus_get_irq(struct pt_regs* regs) +int apus_get_irq(void) { unsigned char ipl_emu, mask; unsigned int level; diff --git a/arch/ppc/platforms/hdpu.c b/arch/ppc/platforms/hdpu.c index e0f112a1fd0b..d809e17aa536 100644 --- a/arch/ppc/platforms/hdpu.c +++ b/arch/ppc/platforms/hdpu.c @@ -659,8 +659,7 @@ static void __init hdpu_map_io(void) char hdpu_smp0[] = "SMP Cpu #0"; char hdpu_smp1[] = "SMP Cpu #1"; -static irqreturn_t hdpu_smp_cpu0_int_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t hdpu_smp_cpu0_int_handler(int irq, void *dev_id) { volatile unsigned int doorbell; @@ -670,22 +669,21 @@ static irqreturn_t hdpu_smp_cpu0_int_handler(int irq, void *dev_id, mv64x60_write(&bh, MV64360_CPU0_DOORBELL_CLR, doorbell); if (doorbell & 1) { - smp_message_recv(0, regs); + smp_message_recv(0); } if (doorbell & 2) { - smp_message_recv(1, regs); + smp_message_recv(1); } if (doorbell & 4) { - smp_message_recv(2, regs); + smp_message_recv(2); } if (doorbell & 8) { - smp_message_recv(3, regs); + smp_message_recv(3); } return IRQ_HANDLED; } -static irqreturn_t hdpu_smp_cpu1_int_handler(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t hdpu_smp_cpu1_int_handler(int irq, void *dev_id) { volatile unsigned int doorbell; @@ -695,16 +693,16 @@ static irqreturn_t hdpu_smp_cpu1_int_handler(int irq, void *dev_id, mv64x60_write(&bh, MV64360_CPU1_DOORBELL_CLR, doorbell); if (doorbell & 1) { - smp_message_recv(0, regs); + smp_message_recv(0); } if (doorbell & 2) { - smp_message_recv(1, regs); + smp_message_recv(1); } if (doorbell & 4) { - smp_message_recv(2, regs); + smp_message_recv(2); } if (doorbell & 8) { - smp_message_recv(3, regs); + smp_message_recv(3); } return IRQ_HANDLED; } diff --git a/arch/ppc/platforms/radstone_ppc7d.c b/arch/ppc/platforms/radstone_ppc7d.c index 3bb530af0297..13d70ab50bf1 100644 --- a/arch/ppc/platforms/radstone_ppc7d.c +++ b/arch/ppc/platforms/radstone_ppc7d.c @@ -451,11 +451,11 @@ static void __init ppc7d_calibrate_decr(void) * Interrupt stuff *****************************************************************************/ -static irqreturn_t ppc7d_i8259_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ppc7d_i8259_intr(int irq, void *dev_id) { u32 temp = mv64x60_read(&bh, MV64x60_GPP_INTR_CAUSE); if (temp & (1 << 28)) { - i8259_irq(regs); + i8259_irq(); mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, temp & (~(1 << 28))); return IRQ_HANDLED; } @@ -536,13 +536,13 @@ static u32 ppc7d_irq_canonicalize(u32 irq) return irq; } -static int ppc7d_get_irq(struct pt_regs *regs) +static int ppc7d_get_irq(void) { int irq; - irq = mv64360_get_irq(regs); + irq = mv64360_get_irq(); if (irq == (mv64360_irq_base + MV64x60_IRQ_GPP28)) - irq = i8259_irq(regs); + irq = i8259_irq(); return irq; } diff --git a/arch/ppc/platforms/sbc82xx.c b/arch/ppc/platforms/sbc82xx.c index 60b769c7f3fc..cc0935ccab7a 100644 --- a/arch/ppc/platforms/sbc82xx.c +++ b/arch/ppc/platforms/sbc82xx.c @@ -121,7 +121,7 @@ struct hw_interrupt_type sbc82xx_i8259_ic = { .end = sbc82xx_i8259_end_irq, }; -static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id) { spin_lock(&sbc82xx_i8259_lock); @@ -139,7 +139,7 @@ static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id, struct pt_regs *re return IRQ_HANDLED; } } - __do_IRQ(NR_SIU_INTS + irq, regs); + __do_IRQ(NR_SIU_INTS + irq); return IRQ_HANDLED; } diff --git a/arch/ppc/syslib/cpc700.h b/arch/ppc/syslib/cpc700.h index 0a8a5d84390f..987e9aa0dd45 100644 --- a/arch/ppc/syslib/cpc700.h +++ b/arch/ppc/syslib/cpc700.h @@ -91,6 +91,6 @@ extern struct hw_interrupt_type cpc700_pic; extern unsigned int cpc700_irq_assigns[32][2]; extern void __init cpc700_init_IRQ(void); -extern int cpc700_get_irq(struct pt_regs *); +extern int cpc700_get_irq(void); #endif /* __PPC_SYSLIB_CPC700_H__ */ diff --git a/arch/ppc/syslib/cpc700_pic.c b/arch/ppc/syslib/cpc700_pic.c index 172aa215fdb0..d48e8f45c050 100644 --- a/arch/ppc/syslib/cpc700_pic.c +++ b/arch/ppc/syslib/cpc700_pic.c @@ -158,7 +158,7 @@ cpc700_init_IRQ(void) * Find the highest IRQ that generating an interrupt, if any. */ int -cpc700_get_irq(struct pt_regs *regs) +cpc700_get_irq(void) { int irq = 0; u_int irq_status, irq_test = 1; diff --git a/arch/ppc/syslib/cpm2_pic.c b/arch/ppc/syslib/cpm2_pic.c index c0fee0beb815..fb2d5842641a 100644 --- a/arch/ppc/syslib/cpm2_pic.c +++ b/arch/ppc/syslib/cpm2_pic.c @@ -123,7 +123,7 @@ static struct hw_interrupt_type cpm2_pic = { .end = cpm2_end_irq, }; -int cpm2_get_irq(struct pt_regs *regs) +int cpm2_get_irq(void) { int irq; unsigned long bits; diff --git a/arch/ppc/syslib/cpm2_pic.h b/arch/ppc/syslib/cpm2_pic.h index 97cab8f13a1a..467339337a78 100644 --- a/arch/ppc/syslib/cpm2_pic.h +++ b/arch/ppc/syslib/cpm2_pic.h @@ -1,7 +1,7 @@ #ifndef _PPC_KERNEL_CPM2_H #define _PPC_KERNEL_CPM2_H -extern int cpm2_get_irq(struct pt_regs *regs); +extern int cpm2_get_irq(void); extern void cpm2_init_IRQ(void); diff --git a/arch/ppc/syslib/gt64260_pic.c b/arch/ppc/syslib/gt64260_pic.c index 7fd550a7d586..e84d432c0657 100644 --- a/arch/ppc/syslib/gt64260_pic.c +++ b/arch/ppc/syslib/gt64260_pic.c @@ -110,9 +110,6 @@ gt64260_init_irq(void) * This function returns the lowest interrupt number of all interrupts that * are currently asserted. * - * Input Variable(s): - * struct pt_regs* not used - * * Output Variable(s): * None. * @@ -120,7 +117,7 @@ gt64260_init_irq(void) * int or -2 (bogus interrupt) */ int -gt64260_get_irq(struct pt_regs *regs) +gt64260_get_irq(void) { int irq; int irq_gpp; @@ -229,7 +226,7 @@ gt64260_mask_irq(unsigned int irq) } static irqreturn_t -gt64260_cpu_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) +gt64260_cpu_error_int_handler(int irq, void *dev_id) { printk(KERN_ERR "gt64260_cpu_error_int_handler: %s 0x%08x\n", "Error on CPU interface - Cause regiser", @@ -250,7 +247,7 @@ gt64260_cpu_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) } static irqreturn_t -gt64260_pci_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) +gt64260_pci_error_int_handler(int irq, void *dev_id) { u32 val; unsigned int pci_bus = (unsigned int)dev_id; diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c index 4b77e6c8c87f..6ad52f4a26e1 100644 --- a/arch/ppc/syslib/ibm440gx_common.c +++ b/arch/ppc/syslib/ibm440gx_common.c @@ -119,7 +119,7 @@ static inline u32 l2c_diag(u32 addr) return mfdcr(DCRN_L2C0_DATA); } -static irqreturn_t l2c_error_handler(int irq, void* dev, struct pt_regs* regs) +static irqreturn_t l2c_error_handler(int irq, void* dev) { u32 sr = mfdcr(DCRN_L2C0_SR); if (sr & L2C_SR_CPE){ diff --git a/arch/ppc/syslib/ipic.c b/arch/ppc/syslib/ipic.c index 46801f5ec03f..10659c24b1be 100644 --- a/arch/ppc/syslib/ipic.c +++ b/arch/ppc/syslib/ipic.c @@ -601,7 +601,7 @@ void ipic_clear_mcp_status(u32 mask) } /* Return an interrupt vector or -1 if no interrupt is pending. */ -int ipic_get_irq(struct pt_regs *regs) +int ipic_get_irq(void) { int irq; diff --git a/arch/ppc/syslib/m82xx_pci.c b/arch/ppc/syslib/m82xx_pci.c index d3fa264e179e..e3b586b1ede9 100644 --- a/arch/ppc/syslib/m82xx_pci.c +++ b/arch/ppc/syslib/m82xx_pci.c @@ -117,7 +117,7 @@ struct hw_interrupt_type pq2pci_ic = { }; static irqreturn_t -pq2pci_irq_demux(int irq, void *dev_id, struct pt_regs *regs) +pq2pci_irq_demux(int irq, void *dev_id) { unsigned long stat, mask, pend; int bit; @@ -130,7 +130,7 @@ pq2pci_irq_demux(int irq, void *dev_id, struct pt_regs *regs) break; for (bit = 0; pend != 0; ++bit, pend <<= 1) { if (pend & 0x80000000) - __do_IRQ(NR_CPM_INTS + bit, regs); + __do_IRQ(NR_CPM_INTS + bit); } } diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c index 54303a7b4e69..d8d299bd1a12 100644 --- a/arch/ppc/syslib/m8xx_setup.c +++ b/arch/ppc/syslib/m8xx_setup.c @@ -169,7 +169,7 @@ abort(void) } /* A place holder for time base interrupts, if they are ever enabled. */ -irqreturn_t timebase_interrupt(int irq, void * dev, struct pt_regs * regs) +irqreturn_t timebase_interrupt(int irq, void * dev) { printk ("timebase_interrupt()\n"); diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c index ac11d7bab443..fffac8cbeb51 100644 --- a/arch/ppc/syslib/m8xx_wdt.c +++ b/arch/ppc/syslib/m8xx_wdt.c @@ -21,7 +21,7 @@ static int wdt_timeout; int m8xx_has_internal_rtc = 0; -static irqreturn_t m8xx_wdt_interrupt(int, void *, struct pt_regs *); +static irqreturn_t m8xx_wdt_interrupt(int, void *); static struct irqaction m8xx_wdt_irqaction = { .handler = m8xx_wdt_interrupt, .name = "watchdog", @@ -35,7 +35,7 @@ void m8xx_wdt_reset(void) out_be16(&imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */ } -static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) +static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev) { volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; diff --git a/arch/ppc/syslib/mpc52xx_pic.c b/arch/ppc/syslib/mpc52xx_pic.c index 6425b5cee7db..af35a316544a 100644 --- a/arch/ppc/syslib/mpc52xx_pic.c +++ b/arch/ppc/syslib/mpc52xx_pic.c @@ -220,7 +220,7 @@ mpc52xx_init_irq(void) } int -mpc52xx_get_irq(struct pt_regs *regs) +mpc52xx_get_irq(void) { u32 status; int irq = -1; diff --git a/arch/ppc/syslib/mv64360_pic.c b/arch/ppc/syslib/mv64360_pic.c index 5104386601ed..4b7a3338e122 100644 --- a/arch/ppc/syslib/mv64360_pic.c +++ b/arch/ppc/syslib/mv64360_pic.c @@ -55,10 +55,9 @@ static void mv64360_unmask_irq(unsigned int); static void mv64360_mask_irq(unsigned int); -static irqreturn_t mv64360_cpu_error_int_handler(int, void *, struct pt_regs *); -static irqreturn_t mv64360_sram_error_int_handler(int, void *, - struct pt_regs *); -static irqreturn_t mv64360_pci_error_int_handler(int, void *, struct pt_regs *); +static irqreturn_t mv64360_cpu_error_int_handler(int, void *); +static irqreturn_t mv64360_sram_error_int_handler(int, void *); +static irqreturn_t mv64360_pci_error_int_handler(int, void *); /* ========================== local declarations =========================== */ @@ -131,9 +130,6 @@ mv64360_init_irq(void) * This function returns the lowest interrupt number of all interrupts that * are currently asserted. * - * Input Variable(s): - * struct pt_regs* not used - * * Output Variable(s): * None. * @@ -142,7 +138,7 @@ mv64360_init_irq(void) * */ int -mv64360_get_irq(struct pt_regs *regs) +mv64360_get_irq(void) { int irq; int irq_gpp; @@ -283,7 +279,7 @@ mv64360_mask_irq(unsigned int irq) } static irqreturn_t -mv64360_cpu_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) +mv64360_cpu_error_int_handler(int irq, void *dev_id) { printk(KERN_ERR "mv64360_cpu_error_int_handler: %s 0x%08x\n", "Error on CPU interface - Cause regiser", @@ -304,7 +300,7 @@ mv64360_cpu_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) } static irqreturn_t -mv64360_sram_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) +mv64360_sram_error_int_handler(int irq, void *dev_id) { printk(KERN_ERR "mv64360_sram_error_int_handler: %s 0x%08x\n", "Error in internal SRAM - Cause register", @@ -325,7 +321,7 @@ mv64360_sram_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) } static irqreturn_t -mv64360_pci_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) +mv64360_pci_error_int_handler(int irq, void *dev_id) { u32 val; unsigned int pci_bus = (unsigned int)dev_id; diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c index e1ff971539ea..d585207f9f77 100644 --- a/arch/ppc/syslib/open_pic2.c +++ b/arch/ppc/syslib/open_pic2.c @@ -529,7 +529,7 @@ static void openpic2_end_irq(unsigned int irq_nr) } int -openpic2_get_irq(struct pt_regs *regs) +openpic2_get_irq(void) { int irq = openpic2_irq(); diff --git a/arch/ppc/syslib/ppc403_pic.c b/arch/ppc/syslib/ppc403_pic.c index 1584c8b1229f..607ebd111d44 100644 --- a/arch/ppc/syslib/ppc403_pic.c +++ b/arch/ppc/syslib/ppc403_pic.c @@ -42,7 +42,7 @@ static struct hw_interrupt_type ppc403_aic = { }; int -ppc403_pic_get_irq(struct pt_regs *regs) +ppc403_pic_get_irq(void) { int irq; unsigned long bits; diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c index 745685df5984..ee0da4b4b993 100644 --- a/arch/ppc/syslib/ppc4xx_pic.c +++ b/arch/ppc/syslib/ppc4xx_pic.c @@ -96,7 +96,7 @@ UIC_HANDLERS(1); UIC_HANDLERS(2); UIC_HANDLERS(3); -static int ppc4xx_pic_get_irq(struct pt_regs *regs) +static int ppc4xx_pic_get_irq(void) { u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0)); if (uic0 & UIC0_UIC1NC) @@ -125,7 +125,7 @@ UIC_HANDLERS(0); UIC_HANDLERS(1); UIC_HANDLERS(2); -static int ppc4xx_pic_get_irq(struct pt_regs *regs) +static int ppc4xx_pic_get_irq(void) { u32 uicb = mfdcr(DCRN_UIC_MSR(UICB)); if (uicb & UICB_UIC0NC) @@ -158,7 +158,7 @@ static void __init ppc4xx_pic_impl_init(void) UIC_HANDLERS(0); UIC_HANDLERS(1); -static int ppc4xx_pic_get_irq(struct pt_regs *regs) +static int ppc4xx_pic_get_irq(void) { u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0)); if (uic0 & UIC0_UIC1NC) @@ -179,7 +179,7 @@ static void __init ppc4xx_pic_impl_init(void) #define ACK_UIC0_PARENT UIC_HANDLERS(0); -static int ppc4xx_pic_get_irq(struct pt_regs *regs) +static int ppc4xx_pic_get_irq(void) { u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0)); return uic0 ? 32 - ffs(uic0) : -1; diff --git a/arch/ppc/syslib/ppc85xx_rio.c b/arch/ppc/syslib/ppc85xx_rio.c index d9b471b4d695..05b0e9415085 100644 --- a/arch/ppc/syslib/ppc85xx_rio.c +++ b/arch/ppc/syslib/ppc85xx_rio.c @@ -349,13 +349,12 @@ EXPORT_SYMBOL_GPL(rio_hw_add_outb_message); * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler * @irq: Linux interrupt number * @dev_instance: Pointer to interrupt-specific data - * @regs: Register context * * Handles outbound message interrupts. Executes a register outbound * mailbox event handler and acks the interrupt occurence. */ static irqreturn_t -mpc85xx_rio_tx_handler(int irq, void *dev_instance, struct pt_regs *regs) +mpc85xx_rio_tx_handler(int irq, void *dev_instance) { int osr; struct rio_mport *port = (struct rio_mport *)dev_instance; @@ -517,13 +516,12 @@ void rio_close_outb_mbox(struct rio_mport *mport, int mbox) * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler * @irq: Linux interrupt number * @dev_instance: Pointer to interrupt-specific data - * @regs: Register context * * Handles inbound message interrupts. Executes a registered inbound * mailbox event handler and acks the interrupt occurence. */ static irqreturn_t -mpc85xx_rio_rx_handler(int irq, void *dev_instance, struct pt_regs *regs) +mpc85xx_rio_rx_handler(int irq, void *dev_instance) { int isr; struct rio_mport *port = (struct rio_mport *)dev_instance; @@ -736,13 +734,12 @@ EXPORT_SYMBOL_GPL(rio_hw_get_inb_message); * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler * @irq: Linux interrupt number * @dev_instance: Pointer to interrupt-specific data - * @regs: Register context * * Handles doorbell interrupts. Parses a list of registered * doorbell event handlers and executes a matching event handler. */ static irqreturn_t -mpc85xx_rio_dbell_handler(int irq, void *dev_instance, struct pt_regs *regs) +mpc85xx_rio_dbell_handler(int irq, void *dev_instance) { int dsr; struct rio_mport *port = (struct rio_mport *)dev_instance; diff --git a/arch/ppc/syslib/ppc8xx_pic.c b/arch/ppc/syslib/ppc8xx_pic.c index d6c25fe25011..e8619c750732 100644 --- a/arch/ppc/syslib/ppc8xx_pic.c +++ b/arch/ppc/syslib/ppc8xx_pic.c @@ -10,7 +10,7 @@ #include #include "ppc8xx_pic.h" -extern int cpm_get_irq(struct pt_regs *regs); +extern int cpm_get_irq(void); /* The 8xx internal interrupt controller. It is usually * the only interrupt controller. Some boards, like the MBX and @@ -96,7 +96,7 @@ m8xx_get_irq(struct pt_regs *regs) * get back SIU_LEVEL7. In this case, return -1 */ if (irq == CPM_INTERRUPT) - irq = CPM_IRQ_OFFSET + cpm_get_irq(regs); + irq = CPM_IRQ_OFFSET + cpm_get_irq(); #if defined(CONFIG_PCI) else if (irq == ISA_BRIDGE_INT) { int isa_irq; diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c index 39a93dc6375b..6fd4cdbada72 100644 --- a/arch/ppc/syslib/xilinx_pic.c +++ b/arch/ppc/syslib/xilinx_pic.c @@ -86,7 +86,7 @@ static struct hw_interrupt_type xilinx_intc = { }; int -xilinx_pic_get_irq(struct pt_regs *regs) +xilinx_pic_get_irq(void) { int irq; diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h index 3247bea5fc2b..7b06b4e6bf30 100644 --- a/include/asm-ppc/commproc.h +++ b/include/asm-ppc/commproc.h @@ -690,8 +690,7 @@ typedef struct risc_timer_pram { #define CICR_IEN ((uint)0x00000080) /* Int. enable */ #define CICR_SPS ((uint)0x00000001) /* SCC Spread */ -extern void cpm_install_handler(int vec, - void (*handler)(void *, struct pt_regs *regs), void *dev_id); +extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id); extern void cpm_free_handler(int vec); #endif /* __CPM_8XX__ */ diff --git a/include/asm-ppc/gt64260.h b/include/asm-ppc/gt64260.h index cd0ef644943d..9e63b3cfffca 100644 --- a/include/asm-ppc/gt64260.h +++ b/include/asm-ppc/gt64260.h @@ -315,7 +315,7 @@ int gt64260_get_base(u32 *base); int gt64260_pci_exclude_device(u8 bus, u8 devfn); void gt64260_init_irq(void); -int gt64260_get_irq(struct pt_regs *regs); +int gt64260_get_irq(void); void gt64260_mpsc_progress(char *s, unsigned short hex); diff --git a/include/asm-ppc/mpc52xx.h b/include/asm-ppc/mpc52xx.h index 7e9842805a28..64c8874618dc 100644 --- a/include/asm-ppc/mpc52xx.h +++ b/include/asm-ppc/mpc52xx.h @@ -415,7 +415,7 @@ struct mpc52xx_cdm { #ifndef __ASSEMBLY__ extern void mpc52xx_init_irq(void); -extern int mpc52xx_get_irq(struct pt_regs *regs); +extern int mpc52xx_get_irq(void); extern unsigned long mpc52xx_find_end_of_memory(void); extern void mpc52xx_set_bat(void); diff --git a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h index 663edbee3e91..db3776f18198 100644 --- a/include/asm-ppc/mv64x60.h +++ b/include/asm-ppc/mv64x60.h @@ -336,9 +336,9 @@ int mv64x60_pci_exclude_device(u8 bus, u8 devfn); void gt64260_init_irq(void); -int gt64260_get_irq(struct pt_regs *regs); +int gt64260_get_irq(void); void mv64360_init_irq(void); -int mv64360_get_irq(struct pt_regs *regs); +int mv64360_get_irq(void); u32 mv64x60_mask(u32 val, u32 num_bits); u32 mv64x60_shift_left(u32 val, u32 num_bits); From ebf7a227dd1d810203a19642655d2fa293f395dd Mon Sep 17 00:00:00 2001 From: Nick Piggin Date: Tue, 10 Oct 2006 04:36:54 +0200 Subject: [PATCH 165/232] [PATCH] mm: bug in set_page_dirty_buffers This was triggered, but not the fault of, the dirty page accounting patches. Suitable for -stable as well, after it goes upstream. Unable to handle kernel NULL pointer dereference at virtual address 0000004c EIP is at _spin_lock+0x12/0x66 Call Trace: [<401766e7>] __set_page_dirty_buffers+0x15/0xc0 [<401401e7>] set_page_dirty+0x2c/0x51 [<40140db2>] set_page_dirty_balance+0xb/0x3b [<40145d29>] __do_fault+0x1d8/0x279 [<40147059>] __handle_mm_fault+0x125/0x951 [<401133f1>] do_page_fault+0x440/0x59f [<4034d0c1>] error_code+0x39/0x40 [<08048a33>] 0x8048a33 Signed-off-by: Nick Piggin Signed-off-by: Linus Torvalds --- fs/buffer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 16cfbcd254f1..eeb8ac1aa856 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -701,7 +701,10 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode); */ int __set_page_dirty_buffers(struct page *page) { - struct address_space * const mapping = page->mapping; + struct address_space * const mapping = page_mapping(page); + + if (unlikely(!mapping)) + return !TestSetPageDirty(page); spin_lock(&mapping->private_lock); if (page_has_buffers(page)) { From d6a29252ad120457cd544d44b2fbea46a00734a7 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 10 Oct 2006 13:51:00 +1000 Subject: [PATCH 166/232] [POWERPC] Fix secondary CPU startup on old "powersurge" SMP powermacs On the old "powersurge" SMP powermacs, the second CPU is started up by sending it an IPI, which has the side effect of stopping the timebase clock (so the secondary CPU's timebase can be synchronized with the primary's). The routine that did this used udelay, which will hang forever when the timebase is stopped, since udelay now spins until the timebase reaches a certain value. The end result is that the kernel would hang when bringing up the second CPU. This fixes it by using a simple loop which just does a fixed number of iterations to generate the delay. These old systems were all clocked at around 200 MHz or so, so a fixed number of iterations is acceptable. Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/powermac/smp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 574cd205b302..eeb2ae5ffc58 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c @@ -328,6 +328,7 @@ static void __init smp_psurge_kick_cpu(int nr) { unsigned long start = __pa(__secondary_start_pmac_0) + nr * 8; unsigned long a; + int i; /* may need to flush here if secondary bats aren't setup */ for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32) @@ -340,7 +341,11 @@ static void __init smp_psurge_kick_cpu(int nr) mb(); psurge_set_ipi(nr); - udelay(10); + /* + * We can't use udelay here because the timebase is now frozen. + */ + for (i = 0; i < 2000; ++i) + barrier(); psurge_clr_ipi(nr); if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354); From 9f2545c11869868fd3cde7098d99e690891e442c Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 10 Oct 2006 11:45:45 +1000 Subject: [PATCH 167/232] [POWERPC] Fix i2c-powermac platform device usage i2c-powermac was written & merged right after Russell King's changes adding platform_driver... which I missed. Thus it still used struct device, causing crashes when hitting sleep/wakeup callbacks (it happened to work by luck so far, until early/late callbacks got added). This causes crashes on sleep/wakeup on PowerBooks with 2.6.19. The patch fixes it by using a proper platform_driver. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- drivers/i2c/busses/i2c-powermac.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index a508cb962d24..648d55533d87 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c @@ -182,9 +182,9 @@ static const struct i2c_algorithm i2c_powermac_algorithm = { }; -static int i2c_powermac_remove(struct device *dev) +static int i2c_powermac_remove(struct platform_device *dev) { - struct i2c_adapter *adapter = dev_get_drvdata(dev); + struct i2c_adapter *adapter = platform_get_drvdata(dev); struct pmac_i2c_bus *bus = i2c_get_adapdata(adapter); int rc; @@ -195,16 +195,16 @@ static int i2c_powermac_remove(struct device *dev) if (rc) printk("i2c-powermac.c: Failed to remove bus %s !\n", adapter->name); - dev_set_drvdata(dev, NULL); + platform_set_drvdata(dev, NULL); kfree(adapter); return 0; } -static int i2c_powermac_probe(struct device *dev) +static int __devexit i2c_powermac_probe(struct platform_device *dev) { - struct pmac_i2c_bus *bus = dev->platform_data; + struct pmac_i2c_bus *bus = dev->dev.platform_data; struct device_node *parent = NULL; struct i2c_adapter *adapter; char name[32]; @@ -246,11 +246,11 @@ static int i2c_powermac_probe(struct device *dev) printk(KERN_ERR "i2c-powermac: can't allocate inteface !\n"); return -ENOMEM; } - dev_set_drvdata(dev, adapter); + platform_set_drvdata(dev, adapter); strcpy(adapter->name, name); adapter->algo = &i2c_powermac_algorithm; i2c_set_adapdata(adapter, bus); - adapter->dev.parent = dev; + adapter->dev.parent = &dev->dev; pmac_i2c_attach_adapter(bus, adapter); rc = i2c_add_adapter(adapter); if (rc) { @@ -265,23 +265,25 @@ static int i2c_powermac_probe(struct device *dev) } -static struct device_driver i2c_powermac_driver = { - .name = "i2c-powermac", - .bus = &platform_bus_type, +static struct platform_driver i2c_powermac_driver = { .probe = i2c_powermac_probe, - .remove = i2c_powermac_remove, + .remove = __devexit_p(i2c_powermac_remove), + .driver = { + .name = "i2c-powermac", + .bus = &platform_bus_type, + }, }; static int __init i2c_powermac_init(void) { - driver_register(&i2c_powermac_driver); + platform_driver_register(&i2c_powermac_driver); return 0; } static void __exit i2c_powermac_cleanup(void) { - driver_unregister(&i2c_powermac_driver); + platform_driver_unregister(&i2c_powermac_driver); } module_init(i2c_powermac_init); From 10270613fb4d5a44c335cfa13e9626bf5743c01d Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 10 Oct 2006 11:47:31 +1000 Subject: [PATCH 168/232] [POWERPC] Fix windfarm platform device usage The windfarm code uses a struct device_driver instead of platform_driver, which can cause crashes if any of the callbacks are called (like on module removal). This fixes it. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- drivers/macintosh/windfarm_pm112.c | 18 ++++++++++-------- drivers/macintosh/windfarm_pm81.c | 24 ++++++++++-------------- drivers/macintosh/windfarm_pm91.c | 24 ++++++++++-------------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index ef66bf2778ec..fa4b13f89369 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c @@ -650,24 +650,26 @@ static struct notifier_block pm112_events = { .notifier_call = pm112_wf_notify, }; -static int wf_pm112_probe(struct device *dev) +static int wf_pm112_probe(struct platform_device *dev) { wf_register_client(&pm112_events); return 0; } -static int wf_pm112_remove(struct device *dev) +static int __devexit wf_pm112_remove(struct platform_device *dev) { wf_unregister_client(&pm112_events); /* should release all sensors and controls */ return 0; } -static struct device_driver wf_pm112_driver = { - .name = "windfarm", - .bus = &platform_bus_type, +static struct platform_driver wf_pm112_driver = { .probe = wf_pm112_probe, - .remove = wf_pm112_remove, + .remove = __devexit_p(wf_pm112_remove), + .driver = { + .name = "windfarm", + .bus = &platform_bus_type, + }, }; static int __init wf_pm112_init(void) @@ -683,13 +685,13 @@ static int __init wf_pm112_init(void) ++nr_cores; printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); - driver_register(&wf_pm112_driver); + platform_driver_register(&wf_pm112_driver); return 0; } static void __exit wf_pm112_exit(void) { - driver_unregister(&wf_pm112_driver); + platform_driver_unregister(&wf_pm112_driver); } module_init(wf_pm112_init); diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c index 2ff546e4c92f..2a944851b8e1 100644 --- a/drivers/macintosh/windfarm_pm81.c +++ b/drivers/macintosh/windfarm_pm81.c @@ -131,8 +131,6 @@ static int wf_smu_mach_model; /* machine model id */ -static struct device *wf_smu_dev; - /* Controls & sensors */ static struct wf_sensor *sensor_cpu_power; static struct wf_sensor *sensor_cpu_temp; @@ -717,16 +715,14 @@ static int wf_init_pm(void) return 0; } -static int wf_smu_probe(struct device *ddev) +static int wf_smu_probe(struct platform_device *ddev) { - wf_smu_dev = ddev; - wf_register_client(&wf_smu_events); return 0; } -static int wf_smu_remove(struct device *ddev) +static int __devexit wf_smu_remove(struct platform_device *ddev) { wf_unregister_client(&wf_smu_events); @@ -766,16 +762,16 @@ static int wf_smu_remove(struct device *ddev) if (wf_smu_cpu_fans) kfree(wf_smu_cpu_fans); - wf_smu_dev = NULL; - return 0; } -static struct device_driver wf_smu_driver = { - .name = "windfarm", - .bus = &platform_bus_type, +static struct platform_driver wf_smu_driver = { .probe = wf_smu_probe, - .remove = wf_smu_remove, + .remove = __devexit_p(wf_smu_remove), + .driver = { + .name = "windfarm", + .bus = &platform_bus_type, + }, }; @@ -794,7 +790,7 @@ static int __init wf_smu_init(void) request_module("windfarm_lm75_sensor"); #endif /* MODULE */ - driver_register(&wf_smu_driver); + platform_driver_register(&wf_smu_driver); } return rc; @@ -803,7 +799,7 @@ static int __init wf_smu_init(void) static void __exit wf_smu_exit(void) { - driver_unregister(&wf_smu_driver); + platform_driver_unregister(&wf_smu_driver); } diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c index 59e9ffe37c39..9961a67b4f85 100644 --- a/drivers/macintosh/windfarm_pm91.c +++ b/drivers/macintosh/windfarm_pm91.c @@ -63,8 +63,6 @@ */ #undef HACKED_OVERTEMP -static struct device *wf_smu_dev; - /* Controls & sensors */ static struct wf_sensor *sensor_cpu_power; static struct wf_sensor *sensor_cpu_temp; @@ -641,16 +639,14 @@ static int wf_init_pm(void) return 0; } -static int wf_smu_probe(struct device *ddev) +static int wf_smu_probe(struct platform_device *ddev) { - wf_smu_dev = ddev; - wf_register_client(&wf_smu_events); return 0; } -static int wf_smu_remove(struct device *ddev) +static int __devexit wf_smu_remove(struct platform_device *ddev) { wf_unregister_client(&wf_smu_events); @@ -698,16 +694,16 @@ static int wf_smu_remove(struct device *ddev) if (wf_smu_cpu_fans) kfree(wf_smu_cpu_fans); - wf_smu_dev = NULL; - return 0; } -static struct device_driver wf_smu_driver = { - .name = "windfarm", - .bus = &platform_bus_type, +static struct platform_driver wf_smu_driver = { .probe = wf_smu_probe, - .remove = wf_smu_remove, + .remove = __devexit_p(wf_smu_remove), + .driver = { + .name = "windfarm", + .bus = &platform_bus_type, + }, }; @@ -725,7 +721,7 @@ static int __init wf_smu_init(void) request_module("windfarm_lm75_sensor"); #endif /* MODULE */ - driver_register(&wf_smu_driver); + platform_driver_register(&wf_smu_driver); } return rc; @@ -734,7 +730,7 @@ static int __init wf_smu_init(void) static void __exit wf_smu_exit(void) { - driver_unregister(&wf_smu_driver); + platform_driver_unregister(&wf_smu_driver); } From e52e6080ca10e0a8ce2a35c86965945cdfa8ed7e Mon Sep 17 00:00:00 2001 From: Tom Tucker Date: Tue, 3 Oct 2006 09:46:41 -0500 Subject: [PATCH 169/232] RDMA/amso1100: Add spinlocks to serialize ib_post_send/ib_post_recv The AMSO driver was not thread-safe in the post WR code and had code that would sleep if the WR post FIFO was full. Since these functions can be called on interrupt level I changed the sleep to a udelay. Signed-off-by: Tom Tucker Signed-off-by: Roland Dreier --- drivers/infiniband/hw/amso1100/c2_qp.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c index 12261132b077..5bcf697aa335 100644 --- a/drivers/infiniband/hw/amso1100/c2_qp.c +++ b/drivers/infiniband/hw/amso1100/c2_qp.c @@ -35,6 +35,8 @@ * */ +#include + #include "c2.h" #include "c2_vq.h" #include "c2_status.h" @@ -705,10 +707,8 @@ static inline void c2_activity(struct c2_dev *c2dev, u32 mq_index, u16 shared) * cannot get on the bus and the card and system hang in a * deadlock -- thus the need for this code. [TOT] */ - while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(0); - } + while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) + udelay(10); __raw_writel(C2_HINT_MAKE(mq_index, shared), c2dev->regs + PCI_BAR0_ADAPTER_HINT); @@ -766,6 +766,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, struct c2_dev *c2dev = to_c2dev(ibqp->device); struct c2_qp *qp = to_c2qp(ibqp); union c2wr wr; + unsigned long lock_flags; int err = 0; u32 flags; @@ -881,8 +882,10 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, /* * Post the puppy! */ + spin_lock_irqsave(&qp->lock, lock_flags); err = qp_wr_post(&qp->sq_mq, &wr, qp, msg_size); if (err) { + spin_unlock_irqrestore(&qp->lock, lock_flags); break; } @@ -890,6 +893,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, * Enqueue mq index to activity FIFO. */ c2_activity(c2dev, qp->sq_mq.index, qp->sq_mq.hint_count); + spin_unlock_irqrestore(&qp->lock, lock_flags); ib_wr = ib_wr->next; } @@ -905,6 +909,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, struct c2_dev *c2dev = to_c2dev(ibqp->device); struct c2_qp *qp = to_c2qp(ibqp); union c2wr wr; + unsigned long lock_flags; int err = 0; if (qp->state > IB_QPS_RTS) @@ -945,8 +950,10 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, break; } + spin_lock_irqsave(&qp->lock, lock_flags); err = qp_wr_post(&qp->rq_mq, &wr, qp, qp->rq_mq.msg_size); if (err) { + spin_unlock_irqrestore(&qp->lock, lock_flags); break; } @@ -954,6 +961,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, * Enqueue mq index to activity FIFO */ c2_activity(c2dev, qp->rq_mq.index, qp->rq_mq.hint_count); + spin_unlock_irqrestore(&qp->lock, lock_flags); ib_wr = ib_wr->next; } From 9b0af401aae336975e620fccdd294bb763424f3f Mon Sep 17 00:00:00 2001 From: Ishai Rabinovitz Date: Tue, 10 Oct 2006 09:51:14 -0700 Subject: [PATCH 170/232] IB/srp: Remove redundant memset() scsi_host_alloc() already allocates with kzalloc(), so the struct Scsi_Host is zeroed out, including the private data portion. Remove the redundant memset that zeros this out again in the SRP initiator. Signed-off-by: Ishai Rabinovitz Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/srp/ib_srp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 44b9e5be6687..f1b7a0f2beed 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1708,7 +1708,6 @@ static ssize_t srp_create_target(struct class_device *class_dev, target_host->max_lun = SRP_MAX_LUN; target = host_to_target(target_host); - memset(target, 0, sizeof *target); target->io_class = SRP_REV16A_IB_IO_CLASS; target->scsi_host = target_host; From 01cb9bcbd34b7ba768a7f05375faf43becdb8a60 Mon Sep 17 00:00:00 2001 From: Ishai Rabinovitz Date: Wed, 4 Oct 2006 15:28:56 +0200 Subject: [PATCH 171/232] IB/srp: Enable multiple connections to the same target Enable multiple concurrent connections to the same SRP target: 1) Use port GUID instead of node GUID in the initiator port identifier. This allows connections to be made from multiple HCA ports at the same time. 2) Let the user specify the identifier extention when adding the device. This allows userspace to make multiple connections even from the same port, if it wants too. Without this, only one connection can be made from any given HCA, even if it has multiple ports, because we don't use multi-channel mode, so targets will only allow one connection from a given initiator port ID. Signed-off-by: Ishai Rabinovitz Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/srp/ib_srp.c | 26 +++++++++++++++++--------- drivers/infiniband/ulp/srp/ib_srp.h | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index f1b7a0f2beed..4b09147f438f 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -343,29 +343,32 @@ static int srp_send_req(struct srp_target_port *target) */ if (target->io_class == SRP_REV10_IB_IO_CLASS) { memcpy(req->priv.initiator_port_id, - target->srp_host->initiator_port_id + 8, 8); + &target->path.sgid.global.interface_id, 8); memcpy(req->priv.initiator_port_id + 8, - target->srp_host->initiator_port_id, 8); + &target->initiator_ext, 8); memcpy(req->priv.target_port_id, &target->ioc_guid, 8); memcpy(req->priv.target_port_id + 8, &target->id_ext, 8); } else { memcpy(req->priv.initiator_port_id, - target->srp_host->initiator_port_id, 16); + &target->initiator_ext, 8); + memcpy(req->priv.initiator_port_id + 8, + &target->path.sgid.global.interface_id, 8); memcpy(req->priv.target_port_id, &target->id_ext, 8); memcpy(req->priv.target_port_id + 8, &target->ioc_guid, 8); } /* * Topspin/Cisco SRP targets will reject our login unless we - * zero out the first 8 bytes of our initiator port ID. The - * second 8 bytes must be our local node GUID, but we always - * use that anyway. + * zero out the first 8 bytes of our initiator port ID and set + * the second 8 bytes to the local node GUID. */ if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) { printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " "activated for target GUID %016llx\n", (unsigned long long) be64_to_cpu(target->ioc_guid)); memset(req->priv.initiator_port_id, 0, 8); + memcpy(req->priv.initiator_port_id + 8, + &target->srp_host->dev->dev->node_guid, 8); } status = ib_send_cm_req(target->cm_id, &req->param); @@ -1553,6 +1556,7 @@ enum { SRP_OPT_MAX_SECT = 1 << 5, SRP_OPT_MAX_CMD_PER_LUN = 1 << 6, SRP_OPT_IO_CLASS = 1 << 7, + SRP_OPT_INITIATOR_EXT = 1 << 8, SRP_OPT_ALL = (SRP_OPT_ID_EXT | SRP_OPT_IOC_GUID | SRP_OPT_DGID | @@ -1569,6 +1573,7 @@ static match_table_t srp_opt_tokens = { { SRP_OPT_MAX_SECT, "max_sect=%d" }, { SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" }, { SRP_OPT_IO_CLASS, "io_class=%x" }, + { SRP_OPT_INITIATOR_EXT, "initiator_ext=%s" }, { SRP_OPT_ERR, NULL } }; @@ -1668,6 +1673,12 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) target->io_class = token; break; + case SRP_OPT_INITIATOR_EXT: + p = match_strdup(args); + target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); + kfree(p); + break; + default: printk(KERN_WARNING PFX "unknown parameter or missing value " "'%s' in target creation request\n", p); @@ -1814,9 +1825,6 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port) host->dev = device; host->port = port; - host->initiator_port_id[7] = port; - memcpy(host->initiator_port_id + 8, &device->dev->node_guid, 8); - host->class_dev.class = &srp_class; host->class_dev.dev = device->dev->dma_device; snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d", diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h index 5b581fb8eb0d..d4e35ef51374 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.h +++ b/drivers/infiniband/ulp/srp/ib_srp.h @@ -91,7 +91,6 @@ struct srp_device { }; struct srp_host { - u8 initiator_port_id[16]; struct srp_device *dev; u8 port; struct class_device class_dev; @@ -122,6 +121,7 @@ struct srp_target_port { __be64 id_ext; __be64 ioc_guid; __be64 service_id; + __be64 initiator_ext; u16 io_class; struct srp_host *srp_host; struct Scsi_Host *scsi_host; From a8bf4e7717142b0688a726dd07501a6a7783792a Mon Sep 17 00:00:00 2001 From: Jack Morgenstein Date: Wed, 4 Oct 2006 13:56:34 +0200 Subject: [PATCH 172/232] IB/mthca: Query port fix Fill in "max_vl_num" (encoded according to VLCap field in the PortInfo MAD) and "init_type_reply" values in the ib_query_port() verb. Signed-off-by: Jack Morgenstein Signed-off-by: Roland Dreier --- drivers/infiniband/hw/mthca/mthca_provider.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index 981fe2eebdfa..fc67f780581b 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -179,6 +179,8 @@ static int mthca_query_port(struct ib_device *ibdev, props->max_mtu = out_mad->data[41] & 0xf; props->active_mtu = out_mad->data[36] >> 4; props->subnet_timeout = out_mad->data[51] & 0x1f; + props->max_vl_num = out_mad->data[37] >> 4; + props->init_type_reply = out_mad->data[41] >> 4; out: kfree(in_mad); From 8575329d4f8596519d86830f622d2c30601f3ef3 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 4 Oct 2006 11:29:59 -0700 Subject: [PATCH 173/232] IB/cm: Fix timewait crash after module unload If the ib_cm module is unloaded while id's are still in timewait, the CM will destroy the work queue used to process timewait. Once the id's exit timewait, their timers will fire, leading to a crash trying to access the destroyed work queue. We need to track id's that are in timewait, and cancel their deferred work on module unload. Signed-off-by: Sean Hefty Signed-off-by: Roland Dreier --- drivers/infiniband/core/cm.c | 54 ++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index f35fcc4c0638..470c482f2887 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -75,6 +75,7 @@ static struct ib_cm { struct rb_root remote_sidr_table; struct idr local_id_table; __be32 random_id_operand; + struct list_head timewait_list; struct workqueue_struct *wq; } cm; @@ -112,6 +113,7 @@ struct cm_work { struct cm_timewait_info { struct cm_work work; /* Must be first. */ + struct list_head list; struct rb_node remote_qp_node; struct rb_node remote_id_node; __be64 remote_ca_guid; @@ -647,13 +649,6 @@ static inline int cm_convert_to_ms(int iba_time) static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info) { - unsigned long flags; - - if (!timewait_info->inserted_remote_id && - !timewait_info->inserted_remote_qp) - return; - - spin_lock_irqsave(&cm.lock, flags); if (timewait_info->inserted_remote_id) { rb_erase(&timewait_info->remote_id_node, &cm.remote_id_table); timewait_info->inserted_remote_id = 0; @@ -663,7 +658,6 @@ static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info) rb_erase(&timewait_info->remote_qp_node, &cm.remote_qp_table); timewait_info->inserted_remote_qp = 0; } - spin_unlock_irqrestore(&cm.lock, flags); } static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) @@ -684,8 +678,12 @@ static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) static void cm_enter_timewait(struct cm_id_private *cm_id_priv) { int wait_time; + unsigned long flags; + spin_lock_irqsave(&cm.lock, flags); cm_cleanup_timewait(cm_id_priv->timewait_info); + list_add_tail(&cm_id_priv->timewait_info->list, &cm.timewait_list); + spin_unlock_irqrestore(&cm.lock, flags); /* * The cm_id could be destroyed by the user before we exit timewait. @@ -701,9 +699,13 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv) static void cm_reset_to_idle(struct cm_id_private *cm_id_priv) { + unsigned long flags; + cm_id_priv->id.state = IB_CM_IDLE; if (cm_id_priv->timewait_info) { + spin_lock_irqsave(&cm.lock, flags); cm_cleanup_timewait(cm_id_priv->timewait_info); + spin_unlock_irqrestore(&cm.lock, flags); kfree(cm_id_priv->timewait_info); cm_id_priv->timewait_info = NULL; } @@ -1307,6 +1309,7 @@ static struct cm_id_private * cm_match_req(struct cm_work *work, if (timewait_info) { cur_cm_id_priv = cm_get_id(timewait_info->work.local_id, timewait_info->work.remote_id); + cm_cleanup_timewait(cm_id_priv->timewait_info); spin_unlock_irqrestore(&cm.lock, flags); if (cur_cm_id_priv) { cm_dup_req_handler(work, cur_cm_id_priv); @@ -1315,7 +1318,8 @@ static struct cm_id_private * cm_match_req(struct cm_work *work, cm_issue_rej(work->port, work->mad_recv_wc, IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ, NULL, 0); - goto error; + listen_cm_id_priv = NULL; + goto out; } /* Find matching listen request. */ @@ -1323,21 +1327,20 @@ static struct cm_id_private * cm_match_req(struct cm_work *work, req_msg->service_id, req_msg->private_data); if (!listen_cm_id_priv) { + cm_cleanup_timewait(cm_id_priv->timewait_info); spin_unlock_irqrestore(&cm.lock, flags); cm_issue_rej(work->port, work->mad_recv_wc, IB_CM_REJ_INVALID_SERVICE_ID, CM_MSG_RESPONSE_REQ, NULL, 0); - goto error; + goto out; } atomic_inc(&listen_cm_id_priv->refcount); atomic_inc(&cm_id_priv->refcount); cm_id_priv->id.state = IB_CM_REQ_RCVD; atomic_inc(&cm_id_priv->work_count); spin_unlock_irqrestore(&cm.lock, flags); +out: return listen_cm_id_priv; - -error: cm_cleanup_timewait(cm_id_priv->timewait_info); - return NULL; } static int cm_req_handler(struct cm_work *work) @@ -2601,28 +2604,29 @@ static int cm_timewait_handler(struct cm_work *work) { struct cm_timewait_info *timewait_info; struct cm_id_private *cm_id_priv; - unsigned long flags; int ret; timewait_info = (struct cm_timewait_info *)work; - cm_cleanup_timewait(timewait_info); + spin_lock_irq(&cm.lock); + list_del(&timewait_info->list); + spin_unlock_irq(&cm.lock); cm_id_priv = cm_acquire_id(timewait_info->work.local_id, timewait_info->work.remote_id); if (!cm_id_priv) return -EINVAL; - spin_lock_irqsave(&cm_id_priv->lock, flags); + spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_TIMEWAIT || cm_id_priv->remote_qpn != timewait_info->remote_qpn) { - spin_unlock_irqrestore(&cm_id_priv->lock, flags); + spin_unlock_irq(&cm_id_priv->lock); goto out; } cm_id_priv->id.state = IB_CM_IDLE; ret = atomic_inc_and_test(&cm_id_priv->work_count); if (!ret) list_add_tail(&work->list, &cm_id_priv->work_list); - spin_unlock_irqrestore(&cm_id_priv->lock, flags); + spin_unlock_irq(&cm_id_priv->lock); if (ret) cm_process_work(cm_id_priv, work); @@ -3374,6 +3378,7 @@ static int __init ib_cm_init(void) idr_init(&cm.local_id_table); get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand); idr_pre_get(&cm.local_id_table, GFP_KERNEL); + INIT_LIST_HEAD(&cm.timewait_list); cm.wq = create_workqueue("ib_cm"); if (!cm.wq) @@ -3391,7 +3396,20 @@ error: static void __exit ib_cm_cleanup(void) { + struct cm_timewait_info *timewait_info, *tmp; + + spin_lock_irq(&cm.lock); + list_for_each_entry(timewait_info, &cm.timewait_list, list) + cancel_delayed_work(&timewait_info->work.work); + spin_unlock_irq(&cm.lock); + destroy_workqueue(cm.wq); + + list_for_each_entry_safe(timewait_info, tmp, &cm.timewait_list, list) { + list_del(&timewait_info->list); + kfree(timewait_info); + } + ib_unregister_client(&cm_client); idr_destroy(&cm.local_id_table); } From 82a9c16a10521a0ceadbd27a549f6e8d5e70e0ab Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 4 Oct 2006 11:37:25 -0700 Subject: [PATCH 174/232] IB/cm: Send DREP in response to unmatched DREQ Currently a DREP is only sent in response to a DREQ if a connection has been found matching the DREQ, and it is in the proper state. Once a DREP is sent, the local connection moves into timewait. Duplicate DREQs received while in this state result in re-sending the DREP. However, it's likely that the local connection will enter and exit timewait before the remote side times out a lost DREP and resends a DREQ. To handle this, we send a DREP in response to a DREQ, even if a local connection is not found. This avoids maintaining disconnected id's in timewait states for excessively long times, just to handle a lost DREP. Signed-off-by: Sean Hefty Signed-off-by: Roland Dreier --- drivers/infiniband/core/cm.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 470c482f2887..25b1018a476c 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1902,6 +1902,32 @@ out: spin_unlock_irqrestore(&cm_id_priv->lock, flags); } EXPORT_SYMBOL(ib_send_cm_drep); +static int cm_issue_drep(struct cm_port *port, + struct ib_mad_recv_wc *mad_recv_wc) +{ + struct ib_mad_send_buf *msg = NULL; + struct cm_dreq_msg *dreq_msg; + struct cm_drep_msg *drep_msg; + int ret; + + ret = cm_alloc_response_msg(port, mad_recv_wc, &msg); + if (ret) + return ret; + + dreq_msg = (struct cm_dreq_msg *) mad_recv_wc->recv_buf.mad; + drep_msg = (struct cm_drep_msg *) msg->mad; + + cm_format_mad_hdr(&drep_msg->hdr, CM_DREP_ATTR_ID, dreq_msg->hdr.tid); + drep_msg->remote_comm_id = dreq_msg->local_comm_id; + drep_msg->local_comm_id = dreq_msg->remote_comm_id; + + ret = ib_post_send_mad(msg, NULL); + if (ret) + cm_free_msg(msg); + + return ret; +} + static int cm_dreq_handler(struct cm_work *work) { struct cm_id_private *cm_id_priv; @@ -1913,8 +1939,10 @@ static int cm_dreq_handler(struct cm_work *work) dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad; cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, dreq_msg->local_comm_id); - if (!cm_id_priv) + if (!cm_id_priv) { + cm_issue_drep(work->port, work->mad_recv_wc); return -EINVAL; + } work->cm_event.private_data = &dreq_msg->private_data; From 1031bfb93adf641436b2192170525b76e2eb25bd Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Tue, 10 Oct 2006 12:50:38 -0700 Subject: [PATCH 175/232] RDMA/amso1100: Fix build with debugging off Since pr_debug() has changed from a macro to an inline function when DEBUG is not defined, its arguments now need to be defined even when debugging is off. Therefore to_event_str() and to_qp_state_str() need to be moved out of #ifdef DEBUG. The compiler will throw the definitions away if DEBUG is not defined, but it needs to be able to see that the functions exist. Signed-off-by: Roland Dreier --- drivers/infiniband/hw/amso1100/c2_ae.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/infiniband/hw/amso1100/c2_ae.c b/drivers/infiniband/hw/amso1100/c2_ae.c index 3aae4978e1cb..a31439bd3b67 100644 --- a/drivers/infiniband/hw/amso1100/c2_ae.c +++ b/drivers/infiniband/hw/amso1100/c2_ae.c @@ -66,7 +66,6 @@ static int c2_convert_cm_status(u32 c2_status) } } -#ifdef DEBUG static const char* to_event_str(int event) { static const char* event_str[] = { @@ -144,7 +143,6 @@ static const char *to_qp_state_str(int state) return ""; }; } -#endif void c2_ae_event(struct c2_dev *c2dev, u32 mq_index) { From 73fbe8be73512b8a3ffa3d20c9d7f531af99679c Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Tue, 10 Oct 2006 12:50:38 -0700 Subject: [PATCH 176/232] IPoIB: Check for DMA mapping error for TX packets Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index f426a69d9a43..8bf5e9ec7c95 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -355,6 +355,11 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, tx_req->skb = skb; addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len, DMA_TO_DEVICE); + if (unlikely(dma_mapping_error(addr))) { + ++priv->stats.tx_errors; + dev_kfree_skb_any(skb); + return; + } pci_unmap_addr_set(tx_req, mapping, addr); if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), From 2cbe19d48af198f0070470a2d836828de24fe163 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Mon, 9 Oct 2006 18:06:32 +0200 Subject: [PATCH 177/232] IB/mthca: Fix off-by-one in mthca SRQ creation All HCAs (not just mem-free) need a spare SRQ entry, so bump srq->max by 1 in all cases. Noted by Jack Morgenstein Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- drivers/infiniband/hw/mthca/mthca_srq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index 0f316c87bf64..92a72f521528 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c @@ -201,6 +201,8 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, if (mthca_is_memfree(dev)) srq->max = roundup_pow_of_two(srq->max + 1); + else + srq->max = srq->max + 1; ds = max(64UL, roundup_pow_of_two(sizeof (struct mthca_next_seg) + @@ -277,7 +279,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, srq->first_free = 0; srq->last_free = srq->max - 1; - attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; + attr->max_wr = srq->max - 1; attr->max_sge = srq->max_gs; return 0; @@ -413,7 +415,7 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr) srq_attr->srq_limit = be16_to_cpu(tavor_ctx->limit_watermark); } - srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; + srq_attr->max_wr = srq->max - 1; srq_attr->max_sge = srq->max_gs; out: From 1e0dbafd30b2e1cd17fd141f4cfd633078524e8c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:07 +0100 Subject: [PATCH 178/232] [PATCH] advansys __iomem annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/advansys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 83695416b2c9..587eac920790 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -3881,7 +3881,7 @@ typedef struct asc_board { /* * The following fields are used only for Wide Boards. */ - void *ioremap_addr; /* I/O Memory remap address. */ + void __iomem *ioremap_addr; /* I/O Memory remap address. */ ushort ioport; /* I/O Port address. */ ADV_CARR_T *orig_carrp; /* ADV_CARR_T memory block. */ adv_req_t *orig_reqp; /* adv_req_t memory block. */ From 90cbad65911b5952a03111423347a6ab38236e0b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:17 +0100 Subject: [PATCH 179/232] [PATCH] more fs/compat.c __user annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/compat.c b/fs/compat.c index 4d3fbcb2ddb1..50624d4a70c6 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -1316,7 +1316,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32, unsigned int nr_segs, unsigned int flags) { unsigned i; - struct iovec *iov; + struct iovec __user *iov; if (nr_segs > UIO_MAXIOV) return -EINVAL; iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec)); From 6aae8738473b7447284fe370d4e6816c02b4511b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:27 +0100 Subject: [PATCH 180/232] [PATCH] drivers/s390 misc sparse annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/s390/scsi/zfcp_erp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 862a411a4aa0..c88babce9bca 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -1987,7 +1987,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) sbale = &(adapter->response_queue.buffer[i]->element[0]); sbale->length = 0; sbale->flags = SBAL_FLAGS_LAST_ENTRY; - sbale->addr = 0; + sbale->addr = NULL; } ZFCP_LOG_TRACE("calling do_QDIO on adapter %s (flags=0x%x, " From 1acc04cd4c0b54ada85d0dd5d7c5efc3441261bf Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:37 +0100 Subject: [PATCH 181/232] [PATCH] dccp __user annotations Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- include/linux/dccp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/dccp.h b/include/linux/dccp.h index d6f4ec467a4b..53553c99cad6 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h @@ -191,7 +191,7 @@ enum { /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ struct dccp_so_feat { __u8 dccpsf_feat; - __u8 *dccpsf_val; + __u8 __user *dccpsf_val; __u8 dccpsf_len; }; From 48343273e846d2612b7977f2503fd97503996fa0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:47 +0100 Subject: [PATCH 182/232] [PATCH] __iomem annotations in sunzilog Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- drivers/serial/sunzilog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index b11f6dea2704..73dd2eedaaad 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -1057,7 +1057,7 @@ static void sunzilog_free_tables(void) static void sunzilog_putchar(struct uart_port *port, int ch) { - struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); + struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port); int loops = ZS_PUT_CHAR_MAX_DELAY; /* This is a timed polling loop so do not switch the explicit From aa7677d40072a97a861390f0ed1a8c25ce312201 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:57 +0100 Subject: [PATCH 183/232] [PATCH] NULL noise removal: advansys Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 587eac920790..2b344356a29e 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -3951,7 +3951,7 @@ typedef struct _PCI_CONFIG_SPACE_ /* Number of boards detected in system. */ STATIC int asc_board_count = 0; -STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { 0 }; +STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { NULL }; /* Overrun buffer used by all narrow boards. */ STATIC uchar overrun_buf[ASC_OVERRUN_BSIZE] = { 0 }; @@ -6621,7 +6621,7 @@ adv_build_req(asc_board_t *boardp, struct scsi_cmnd *scp, dma_map_single(dev, scp->request_buffer, scp->request_bufflen, scp->sc_data_direction); } else { - scsiqp->vdata_addr = 0; + scsiqp->vdata_addr = NULL; scp->SCp.dma_handle = 0; } scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle); From 98ae6ccd8e15aeac1c624615c044deecf46a359a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:07 +0100 Subject: [PATCH 184/232] [PATCH] fix misannotations in loop.c Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/block/loop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index d6bb8da955a2..19a09a187270 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -295,7 +295,7 @@ fail: * and do_lo_send_write(). */ static int __do_lo_send_write(struct file *file, - u8 __user *buf, const int len, loff_t pos) + u8 *buf, const int len, loff_t pos) { ssize_t bw; mm_segment_t old_fs = get_fs(); @@ -324,7 +324,7 @@ static int do_lo_send_direct_write(struct loop_device *lo, struct bio_vec *bvec, int bsize, loff_t pos, struct page *page) { ssize_t bw = __do_lo_send_write(lo->lo_backing_file, - (u8 __user *)kmap(bvec->bv_page) + bvec->bv_offset, + kmap(bvec->bv_page) + bvec->bv_offset, bvec->bv_len, pos); kunmap(bvec->bv_page); cond_resched(); @@ -351,7 +351,7 @@ static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec, bvec->bv_offset, bvec->bv_len, pos >> 9); if (likely(!ret)) return __do_lo_send_write(lo->lo_backing_file, - (u8 __user *)page_address(page), bvec->bv_len, + page_address(page), bvec->bv_len, pos); printk(KERN_ERR "loop: Transfer error at byte offset %llu, " "length %i.\n", (unsigned long long)pos, bvec->bv_len); From 04b1add1ab9121898b7d63570aad2a9c7ee9cfa3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:17 +0100 Subject: [PATCH 185/232] [PATCH] misc sata __iomem annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/ata/sata_sil.c | 2 +- drivers/ata/sata_svw.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index ae5edb80ea9a..ca8d99312472 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c @@ -349,7 +349,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg) static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) { - void *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg); + void __iomem *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg); if (mmio) writel(val, mmio); } diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c index 84025a2fd5be..db32d15b7fa1 100644 --- a/drivers/ata/sata_svw.c +++ b/drivers/ata/sata_svw.c @@ -177,7 +177,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc) struct ata_port *ap = qc->ap; unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); u8 dmactl; - void *mmio = (void *) ap->ioaddr.bmdma_addr; + void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr; /* load PRD table addr. */ mb(); /* make sure PRD table writes are visible to controller */ writel(ap->prd_dma, mmio + ATA_DMA_TABLE_OFS); @@ -205,7 +205,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc) static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; - void *mmio = (void *) ap->ioaddr.bmdma_addr; + void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr; u8 dmactl; /* start host DMA transaction */ From cb04e6b61985d7fafcb9529e5fcff4689f0961d3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:27 +0100 Subject: [PATCH 186/232] [PATCH] hwdep_compat missed __user annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- sound/core/hwdep_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/hwdep_compat.c b/sound/core/hwdep_compat.c index 938f77580966..3827c0ceec8f 100644 --- a/sound/core/hwdep_compat.c +++ b/sound/core/hwdep_compat.c @@ -33,7 +33,7 @@ struct snd_hwdep_dsp_image32 { static int snd_hwdep_dsp_load_compat(struct snd_hwdep *hw, struct snd_hwdep_dsp_image32 __user *src) { - struct snd_hwdep_dsp_image *dst; + struct snd_hwdep_dsp_image __user *dst; compat_caddr_t ptr; u32 val; From c714de5dcf41cee869c4a74e8783c6d9be459ef6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:37 +0100 Subject: [PATCH 187/232] [PATCH] devio __user annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/usb/core/devio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 2c9c9462d899..724822cac2b1 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1216,7 +1216,7 @@ static int proc_submiturb_compat(struct dev_state *ps, void __user *arg) { struct usbdevfs_urb uurb; - if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg)) + if (get_urb32(&uurb,(struct usbdevfs_urb32 __user *)arg)) return -EFAULT; return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg); @@ -1251,7 +1251,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg) } free_async(as); - if (put_user((u32)(u64)addr, (u32 __user *)arg)) + if (put_user(ptr_to_compat(addr), (u32 __user *)arg)) return -EFAULT; return 0; } @@ -1520,7 +1520,7 @@ static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd case USBDEVFS_IOCTL32: snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__); - ret = proc_ioctl_compat(ps, (compat_uptr_t)(long)p); + ret = proc_ioctl_compat(ps, ptr_to_compat(p)); break; #endif From 47b16539e1072afd2c964b97be4a95b5cf2ff801 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:47 +0100 Subject: [PATCH 188/232] [PATCH] drivers/dma trivial annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/dma/ioatdma.c | 4 ++-- drivers/dma/ioatdma.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c index f3bf1e230bca..0358419a0e48 100644 --- a/drivers/dma/ioatdma.c +++ b/drivers/dma/ioatdma.c @@ -80,7 +80,7 @@ static int enumerate_dma_channels(struct ioat_device *device) static struct ioat_desc_sw *ioat_dma_alloc_descriptor( struct ioat_dma_chan *ioat_chan, - int flags) + gfp_t flags) { struct ioat_dma_descriptor *desc; struct ioat_desc_sw *desc_sw; @@ -686,7 +686,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev, { int err; unsigned long mmio_start, mmio_len; - void *reg_base; + void __iomem *reg_base; struct ioat_device *device; err = pci_enable_device(pdev); diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h index a5d3b3644160..62b26a9be4c9 100644 --- a/drivers/dma/ioatdma.h +++ b/drivers/dma/ioatdma.h @@ -44,7 +44,7 @@ extern struct list_head dma_client_list; struct ioat_device { struct pci_dev *pdev; - void *reg_base; + void __iomem *reg_base; struct pci_pool *dma_pool; struct pci_pool *completion_pool; @@ -73,7 +73,7 @@ struct ioat_device { struct ioat_dma_chan { - void *reg_base; + void __iomem *reg_base; dma_cookie_t completed_cookie; unsigned long last_completion; From 28c4dadd3a7221f5b9cd5c7d03c499788b193353 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:57 +0100 Subject: [PATCH 189/232] [PATCH] tipc __user annotations Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- net/tipc/socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 32d778448a00..acfb852e7c98 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -941,7 +941,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock, int sz_to_copy; int sz_copied = 0; int needed; - char *crs = m->msg_iov->iov_base; + char __user *crs = m->msg_iov->iov_base; unsigned char *buf_crs; u32 err; int res; @@ -1496,7 +1496,7 @@ static int setsockopt(struct socket *sock, return -ENOPROTOOPT; if (ol < sizeof(value)) return -EINVAL; - if ((res = get_user(value, (u32 *)ov))) + if ((res = get_user(value, (u32 __user *)ov))) return res; if (down_interruptible(&tsock->sem)) @@ -1541,7 +1541,7 @@ static int setsockopt(struct socket *sock, */ static int getsockopt(struct socket *sock, - int lvl, int opt, char __user *ov, int *ol) + int lvl, int opt, char __user *ov, int __user *ol) { struct tipc_sock *tsock = tipc_sk(sock->sk); int len; From ba46df984b8e8114c3cf19c51670fab084bd4196 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:46:07 +0100 Subject: [PATCH 190/232] [PATCH] __user annotations: futex Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/linux/compat.h | 2 +- include/linux/syscalls.h | 2 +- kernel/futex.c | 15 ++++++++------- kernel/futex_compat.c | 12 ++++++------ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/linux/compat.h b/include/linux/compat.h index ef5cd192784c..f4ebf96f5308 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -163,7 +163,7 @@ asmlinkage long compat_sys_set_robust_list(struct compat_robust_list_head __user *head, compat_size_t len); asmlinkage long -compat_sys_get_robust_list(int pid, compat_uptr_t *head_ptr, +compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, compat_size_t __user *len_ptr); long compat_sys_semctl(int first, int second, int third, void __user *uptr); diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 3efcfc7e9c6c..b0ace3fd7eb9 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -593,7 +593,7 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, unsigned int flags); asmlinkage long sys_get_robust_list(int pid, - struct robust_list_head __user **head_ptr, + struct robust_list_head __user * __user *head_ptr, size_t __user *len_ptr); asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, size_t len); diff --git a/kernel/futex.c b/kernel/futex.c index 4aaf91951a43..b364e0026191 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1612,10 +1612,10 @@ sys_set_robust_list(struct robust_list_head __user *head, * @len_ptr: pointer to a length field, the kernel fills in the header size */ asmlinkage long -sys_get_robust_list(int pid, struct robust_list_head __user **head_ptr, +sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr, size_t __user *len_ptr) { - struct robust_list_head *head; + struct robust_list_head __user *head; unsigned long ret; if (!pid) @@ -1694,14 +1694,15 @@ retry: * Fetch a robust-list pointer. Bit 0 signals PI futexes: */ static inline int fetch_robust_entry(struct robust_list __user **entry, - struct robust_list __user **head, int *pi) + struct robust_list __user * __user *head, + int *pi) { unsigned long uentry; - if (get_user(uentry, (unsigned long *)head)) + if (get_user(uentry, (unsigned long __user *)head)) return -EFAULT; - *entry = (void *)(uentry & ~1UL); + *entry = (void __user *)(uentry & ~1UL); *pi = uentry & 1; return 0; @@ -1739,7 +1740,7 @@ void exit_robust_list(struct task_struct *curr) return; if (pending) - handle_futex_death((void *)pending + futex_offset, curr, pip); + handle_futex_death((void __user *)pending + futex_offset, curr, pip); while (entry != &head->list) { /* @@ -1747,7 +1748,7 @@ void exit_robust_list(struct task_struct *curr) * don't process it twice: */ if (entry != pending) - if (handle_futex_death((void *)entry + futex_offset, + if (handle_futex_death((void __user *)entry + futex_offset, curr, pi)) return; /* diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index c5cca3f65cb7..50f24eea6cd0 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c @@ -18,7 +18,7 @@ */ static inline int fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry, - compat_uptr_t *head, int *pi) + compat_uptr_t __user *head, int *pi) { if (get_user(*uentry, head)) return -EFAULT; @@ -62,7 +62,7 @@ void compat_exit_robust_list(struct task_struct *curr) &head->list_op_pending, &pip)) return; if (upending) - handle_futex_death((void *)pending + futex_offset, curr, pip); + handle_futex_death((void __user *)pending + futex_offset, curr, pip); while (compat_ptr(uentry) != &head->list) { /* @@ -70,7 +70,7 @@ void compat_exit_robust_list(struct task_struct *curr) * dont process it twice: */ if (entry != pending) - if (handle_futex_death((void *)entry + futex_offset, + if (handle_futex_death((void __user *)entry + futex_offset, curr, pi)) return; @@ -78,7 +78,7 @@ void compat_exit_robust_list(struct task_struct *curr) * Fetch the next entry in the list: */ if (fetch_robust_entry(&uentry, &entry, - (compat_uptr_t *)&entry->next, &pi)) + (compat_uptr_t __user *)&entry->next, &pi)) return; /* * Avoid excessively long or circular lists: @@ -103,10 +103,10 @@ compat_sys_set_robust_list(struct compat_robust_list_head __user *head, } asmlinkage long -compat_sys_get_robust_list(int pid, compat_uptr_t *head_ptr, +compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, compat_size_t __user *len_ptr) { - struct compat_robust_list_head *head; + struct compat_robust_list_head __user *head; unsigned long ret; if (!pid) From cfa7fd72ca03ac2324e8e469bd4b9ecc6f53394c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:46:17 +0100 Subject: [PATCH 191/232] [PATCH] ia64/hp NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/ia64/hp/sim/simeth.c | 2 +- arch/ia64/hp/sim/simscsi.c | 2 +- arch/ia64/hp/sim/simserial.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c index be769ef326a2..424e9257c9a0 100644 --- a/arch/ia64/hp/sim/simeth.c +++ b/arch/ia64/hp/sim/simeth.c @@ -87,7 +87,7 @@ static int simeth_debug; /* set to 1 to get debug information */ */ static struct notifier_block simeth_dev_notifier = { simeth_device_event, - 0 + NULL }; diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c index 8f0a16a79a67..bb87682bbb1b 100644 --- a/arch/ia64/hp/sim/simscsi.c +++ b/arch/ia64/hp/sim/simscsi.c @@ -103,7 +103,7 @@ simscsi_interrupt (unsigned long val) while ((sc = queue[rd].sc) != 0) { atomic_dec(&num_reqs); - queue[rd].sc = 0; + queue[rd].sc = NULL; if (DBG) printk("simscsi_interrupt: done with %ld\n", sc->serial_number); (*sc->scsi_done)(sc); diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index 5095778be53c..caab986af70c 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c @@ -92,7 +92,7 @@ static struct serial_uart_config uart_config[] = { { "ST16650V2", 32, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, { "TI16750", 64, UART_CLEAR_FIFO | UART_USE_FIFO}, - { 0, 0} + { NULL, 0} }; struct tty_driver *hp_simserial_driver; @@ -555,7 +555,7 @@ static void shutdown(struct async_struct * info) if (info->xmit.buf) { free_page((unsigned long) info->xmit.buf); - info->xmit.buf = 0; + info->xmit.buf = NULL; } if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags); @@ -628,7 +628,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); info->event = 0; - info->tty = 0; + info->tty = NULL; if (info->blocked_open) { if (info->close_delay) schedule_timeout_interruptible(info->close_delay); @@ -668,7 +668,7 @@ static void rs_hangup(struct tty_struct *tty) info->event = 0; state->count = 0; info->flags &= ~ASYNC_NORMAL_ACTIVE; - info->tty = 0; + info->tty = NULL; wake_up_interruptible(&info->open_wait); } @@ -769,7 +769,7 @@ startup(struct async_struct *info) /* * Insert serial port into IRQ chain. */ - info->prev_port = 0; + info->prev_port = NULL; info->next_port = IRQ_ports[state->irq]; if (info->next_port) info->next_port->prev_port = info; From a9f627c9df2b6a242cdc25d46f87191941cd0844 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:46:27 +0100 Subject: [PATCH 192/232] [PATCH] ia64/sn __iomem annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/ia64/sn/pci/pcibr/pcibr_ate.c | 2 +- arch/ia64/sn/pci/tioce_provider.c | 42 ++++++++++++++-------------- include/asm-ia64/sn/pcibr_provider.h | 2 +- include/asm-ia64/sn/tioca_provider.h | 4 +-- include/asm-ia64/sn/tioce_provider.h | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c index 5eb1e1e078b4..935029fc400d 100644 --- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c +++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c @@ -126,7 +126,7 @@ int pcibr_ate_alloc(struct pcibus_info *pcibus_info, int count) * Setup an Address Translation Entry as specified. Use either the Bridge * internal maps or the external map RAM, as appropriate. */ -static inline u64 *pcibr_ate_addr(struct pcibus_info *pcibus_info, +static inline u64 __iomem *pcibr_ate_addr(struct pcibus_info *pcibus_info, int ate_index) { if (ate_index < pcibus_info->pbi_int_ate_size) { diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c index 0e81f68aaf8e..46e16dcf5971 100644 --- a/arch/ia64/sn/pci/tioce_provider.c +++ b/arch/ia64/sn/pci/tioce_provider.c @@ -53,7 +53,7 @@ */ static void inline -tioce_mmr_war_pre(struct tioce_kernel *kern, void *mmr_addr) +tioce_mmr_war_pre(struct tioce_kernel *kern, void __iomem *mmr_addr) { u64 mmr_base; u64 mmr_offset; @@ -62,7 +62,7 @@ tioce_mmr_war_pre(struct tioce_kernel *kern, void *mmr_addr) return; mmr_base = kern->ce_common->ce_pcibus.bs_base; - mmr_offset = (u64)mmr_addr - mmr_base; + mmr_offset = (unsigned long)mmr_addr - mmr_base; if (mmr_offset < 0x45000) { u64 mmr_war_offset; @@ -79,7 +79,7 @@ tioce_mmr_war_pre(struct tioce_kernel *kern, void *mmr_addr) } static void inline -tioce_mmr_war_post(struct tioce_kernel *kern, void *mmr_addr) +tioce_mmr_war_post(struct tioce_kernel *kern, void __iomem *mmr_addr) { u64 mmr_base; u64 mmr_offset; @@ -88,7 +88,7 @@ tioce_mmr_war_post(struct tioce_kernel *kern, void *mmr_addr) return; mmr_base = kern->ce_common->ce_pcibus.bs_base; - mmr_offset = (u64)mmr_addr - mmr_base; + mmr_offset = (unsigned long)mmr_addr - mmr_base; if (mmr_offset < 0x45000) { if (mmr_offset == 0x100) @@ -223,7 +223,7 @@ tioce_dma_d64(unsigned long ct_addr, int dma_flags) * @pci_dev. */ static inline void -pcidev_to_tioce(struct pci_dev *pdev, struct tioce **base, +pcidev_to_tioce(struct pci_dev *pdev, struct tioce __iomem **base, struct tioce_kernel **kernel, int *port) { struct pcidev_info *pcidev_info; @@ -235,7 +235,7 @@ pcidev_to_tioce(struct pci_dev *pdev, struct tioce **base, ce_kernel = (struct tioce_kernel *)ce_common->ce_kernel_private; if (base) - *base = (struct tioce *)ce_common->ce_pcibus.bs_base; + *base = (struct tioce __iomem *)ce_common->ce_pcibus.bs_base; if (kernel) *kernel = ce_kernel; @@ -275,13 +275,13 @@ tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port, u64 pagesize; int msi_capable, msi_wanted; u64 *ate_shadow; - u64 *ate_reg; + u64 __iomem *ate_reg; u64 addr; - struct tioce *ce_mmr; + struct tioce __iomem *ce_mmr; u64 bus_base; struct tioce_dmamap *map; - ce_mmr = (struct tioce *)ce_kern->ce_common->ce_pcibus.bs_base; + ce_mmr = (struct tioce __iomem *)ce_kern->ce_common->ce_pcibus.bs_base; switch (type) { case TIOCE_ATE_M32: @@ -386,7 +386,7 @@ tioce_dma_d32(struct pci_dev *pdev, u64 ct_addr, int dma_flags) { int dma_ok; int port; - struct tioce *ce_mmr; + struct tioce __iomem *ce_mmr; struct tioce_kernel *ce_kern; u64 ct_upper; u64 ct_lower; @@ -461,7 +461,7 @@ tioce_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir) int i; int port; struct tioce_kernel *ce_kern; - struct tioce *ce_mmr; + struct tioce __iomem *ce_mmr; unsigned long flags; bus_addr = tioce_dma_barrier(bus_addr, 0); @@ -700,9 +700,9 @@ static void tioce_reserve_m32(struct tioce_kernel *ce_kern, u64 base, u64 limit) { int ate_index, last_ate, ps; - struct tioce *ce_mmr; + struct tioce __iomem *ce_mmr; - ce_mmr = (struct tioce *)ce_kern->ce_common->ce_pcibus.bs_base; + ce_mmr = (struct tioce __iomem *)ce_kern->ce_common->ce_pcibus.bs_base; ps = ce_kern->ce_ate3240_pagesize; ate_index = ATE_PAGE(base, ps); last_ate = ate_index + ATE_NPAGES(base, limit-base+1, ps) - 1; @@ -736,7 +736,7 @@ tioce_kern_init(struct tioce_common *tioce_common) int dev; u32 tmp; unsigned int seg, bus; - struct tioce *tioce_mmr; + struct tioce __iomem *tioce_mmr; struct tioce_kernel *tioce_kern; tioce_kern = kzalloc(sizeof(struct tioce_kernel), GFP_KERNEL); @@ -767,7 +767,7 @@ tioce_kern_init(struct tioce_common *tioce_common) * the ate's. */ - tioce_mmr = (struct tioce *)tioce_common->ce_pcibus.bs_base; + tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base; tioce_mmr_clri(tioce_kern, &tioce_mmr->ce_ure_page_map, CE_URE_PAGESIZE_MASK); tioce_mmr_seti(tioce_kern, &tioce_mmr->ce_ure_page_map, @@ -858,7 +858,7 @@ tioce_force_interrupt(struct sn_irq_info *sn_irq_info) struct pcidev_info *pcidev_info; struct tioce_common *ce_common; struct tioce_kernel *ce_kern; - struct tioce *ce_mmr; + struct tioce __iomem *ce_mmr; u64 force_int_val; if (!sn_irq_info->irq_bridge) @@ -872,7 +872,7 @@ tioce_force_interrupt(struct sn_irq_info *sn_irq_info) return; ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info; - ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base; + ce_mmr = (struct tioce __iomem *)ce_common->ce_pcibus.bs_base; ce_kern = (struct tioce_kernel *)ce_common->ce_kernel_private; /* @@ -953,7 +953,7 @@ tioce_target_interrupt(struct sn_irq_info *sn_irq_info) struct pcidev_info *pcidev_info; struct tioce_common *ce_common; struct tioce_kernel *ce_kern; - struct tioce *ce_mmr; + struct tioce __iomem *ce_mmr; int bit; u64 vector; @@ -962,7 +962,7 @@ tioce_target_interrupt(struct sn_irq_info *sn_irq_info) return; ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info; - ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base; + ce_mmr = (struct tioce __iomem *)ce_common->ce_pcibus.bs_base; ce_kern = (struct tioce_kernel *)ce_common->ce_kernel_private; bit = sn_irq_info->irq_int_bit; @@ -994,7 +994,7 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont cnodeid_t my_cnode, mem_cnode; struct tioce_common *tioce_common; struct tioce_kernel *tioce_kern; - struct tioce *tioce_mmr; + struct tioce __iomem *tioce_mmr; /* * Allocate kernel bus soft and copy from prom. @@ -1018,7 +1018,7 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont * interrupt handler. */ - tioce_mmr = (struct tioce *)tioce_common->ce_pcibus.bs_base; + tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base; tioce_mmr_seti(tioce_kern, &tioce_mmr->ce_adm_int_status_alias, ~0ULL); tioce_mmr_seti(tioce_kern, &tioce_mmr->ce_adm_error_summary_alias, ~0ULL); diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h index e3b0c3fe5eed..da3eade0cae2 100644 --- a/include/asm-ia64/sn/pcibr_provider.h +++ b/include/asm-ia64/sn/pcibr_provider.h @@ -135,7 +135,7 @@ extern void pcireg_intr_addr_addr_set(struct pcibus_info *, int, u64 extern void pcireg_force_intr_set(struct pcibus_info *, int); extern u64 pcireg_wrb_flush_get(struct pcibus_info *, int); extern void pcireg_int_ate_set(struct pcibus_info *, int, u64); -extern u64 * pcireg_int_ate_addr(struct pcibus_info *, int); +extern u64 __iomem * pcireg_int_ate_addr(struct pcibus_info *, int); extern void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info); extern void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info); extern int pcibr_ate_alloc(struct pcibus_info *, int); diff --git a/include/asm-ia64/sn/tioca_provider.h b/include/asm-ia64/sn/tioca_provider.h index 65cdd73c2a57..9a820ac61be3 100644 --- a/include/asm-ia64/sn/tioca_provider.h +++ b/include/asm-ia64/sn/tioca_provider.h @@ -162,11 +162,11 @@ static inline void tioca_tlbflush(struct tioca_kernel *tioca_kernel) { volatile u64 tmp; - volatile struct tioca *ca_base; + volatile struct tioca __iomem *ca_base; struct tioca_common *tioca_common; tioca_common = tioca_kernel->ca_common; - ca_base = (struct tioca *)tioca_common->ca_common.bs_base; + ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base; /* * Explicit flushes not needed if GART is in cached mode diff --git a/include/asm-ia64/sn/tioce_provider.h b/include/asm-ia64/sn/tioce_provider.h index 6d62b13f7ae7..32c32f30b099 100644 --- a/include/asm-ia64/sn/tioce_provider.h +++ b/include/asm-ia64/sn/tioce_provider.h @@ -53,7 +53,7 @@ struct tioce_dmamap { u64 ct_start; /* coretalk start address */ u64 pci_start; /* bus start address */ - u64 *ate_hw; /* hw ptr of first ate in map */ + u64 __iomem *ate_hw;/* hw ptr of first ate in map */ u64 *ate_shadow; /* shadow ptr of firat ate */ u16 ate_count; /* # ate's in the map */ }; From afc12d30a74415a49a6ce36d89f82641b46c499b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:46:37 +0100 Subject: [PATCH 193/232] [PATCH] mtd: remove several bogus casts to void * in iounmap() argument Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/mtd/maps/physmap.c | 2 +- drivers/mtd/nand/cs553x_nand.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index bc7cc71788bc..d1717763f719 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -62,7 +62,7 @@ static int physmap_flash_remove(struct platform_device *dev) } if (info->map.virt != NULL) - iounmap((void *)info->map.virt); + iounmap(info->map.virt); if (info->res != NULL) { release_resource(info->res); diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c index e0a1d386e581..94924d52a9b9 100644 --- a/drivers/mtd/nand/cs553x_nand.c +++ b/drivers/mtd/nand/cs553x_nand.c @@ -249,7 +249,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) goto out; out_ior: - iounmap((void *)this->IO_ADDR_R); + iounmap(this->IO_ADDR_R); out_mtd: kfree(new_mtd); out: From fb136e97840872638cb08588c4c9b9fff7f7c456 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:46:47 +0100 Subject: [PATCH 194/232] [PATCH] fix misannotation in ioc4.h Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/linux/ioc4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h index de73a3289cc2..51e2b9fb6372 100644 --- a/include/linux/ioc4.h +++ b/include/linux/ioc4.h @@ -157,7 +157,7 @@ struct ioc4_driver_data { unsigned long idd_bar0; struct pci_dev *idd_pdev; const struct pci_device_id *idd_pci_id; - struct __iomem ioc4_misc_regs *idd_misc_regs; + struct ioc4_misc_regs __iomem *idd_misc_regs; unsigned long count_period; void *idd_serial_data; unsigned int idd_variant; From ba2397efe10ba728c7ff22b179e218c292227c13 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:46:57 +0100 Subject: [PATCH 195/232] [PATCH] make kernel/relay.c __user-clean Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- kernel/relay.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/kernel/relay.c b/kernel/relay.c index 1d63ecddfa70..f04bbdb56ac2 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -887,7 +887,7 @@ static int subbuf_read_actor(size_t read_start, from = buf->start + read_start; ret = avail; - if (copy_to_user(desc->arg.data, from, avail)) { + if (copy_to_user(desc->arg.buf, from, avail)) { desc->error = -EFAULT; ret = 0; } @@ -946,24 +946,17 @@ typedef int (*subbuf_actor_t) (size_t read_start, */ static inline ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos, - size_t count, subbuf_actor_t subbuf_actor, read_actor_t actor, - void *target) + read_descriptor_t *desc) { struct rchan_buf *buf = filp->private_data; size_t read_start, avail; - read_descriptor_t desc; int ret; - if (!count) + if (!desc->count) return 0; - desc.written = 0; - desc.count = count; - desc.arg.data = target; - desc.error = 0; - mutex_lock(&filp->f_dentry->d_inode->i_mutex); do { if (!relay_file_read_avail(buf, *ppos)) @@ -974,19 +967,19 @@ static inline ssize_t relay_file_read_subbufs(struct file *filp, if (!avail) break; - avail = min(desc.count, avail); - ret = subbuf_actor(read_start, buf, avail, &desc, actor); - if (desc.error < 0) + avail = min(desc->count, avail); + ret = subbuf_actor(read_start, buf, avail, desc, actor); + if (desc->error < 0) break; if (ret) { relay_file_read_consume(buf, read_start, ret); *ppos = relay_file_read_end_pos(buf, read_start, ret); } - } while (desc.count && ret); + } while (desc->count && ret); mutex_unlock(&filp->f_dentry->d_inode->i_mutex); - return desc.written; + return desc->written; } static ssize_t relay_file_read(struct file *filp, @@ -994,8 +987,13 @@ static ssize_t relay_file_read(struct file *filp, size_t count, loff_t *ppos) { - return relay_file_read_subbufs(filp, ppos, count, subbuf_read_actor, - NULL, buffer); + read_descriptor_t desc; + desc.written = 0; + desc.count = count; + desc.arg.buf = buffer; + desc.error = 0; + return relay_file_read_subbufs(filp, ppos, subbuf_read_actor, + NULL, &desc); } static ssize_t relay_file_sendfile(struct file *filp, @@ -1004,8 +1002,13 @@ static ssize_t relay_file_sendfile(struct file *filp, read_actor_t actor, void *target) { - return relay_file_read_subbufs(filp, ppos, count, subbuf_send_actor, - actor, target); + read_descriptor_t desc; + desc.written = 0; + desc.count = count; + desc.arg.data = target; + desc.error = 0; + return relay_file_read_subbufs(filp, ppos, subbuf_send_actor, + actor, &desc); } struct file_operations relay_file_operations = { From e4cad1b5a4851c90c1bcf460062074a2fa10815b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:07 +0100 Subject: [PATCH 196/232] [PATCH] passing pointer to setup_timer() should be via unsigned long Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/mmc/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 6d024342b2fd..9a7d39b7cdbf 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -1329,7 +1329,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) tasklet_init(&host->finish_tasklet, sdhci_tasklet_finish, (unsigned long)host); - setup_timer(&host->timer, sdhci_timeout_timer, (long)host); + setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host); ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED, host->slot_descr, host); From 4370df9782a8456039cf85d2b833c2c2097f3ded Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:17 +0100 Subject: [PATCH 197/232] [PATCH] acpi NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/acpi/cm_sbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c index a01ce6700bfe..4a9b7bf6f44e 100644 --- a/drivers/acpi/cm_sbs.c +++ b/drivers/acpi/cm_sbs.c @@ -67,7 +67,7 @@ void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param) lock_ac_dir_cnt--; if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) { remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); - acpi_ac_dir = 0; + acpi_ac_dir = NULL; } mutex_unlock(&cm_sbs_mutex); } @@ -99,7 +99,7 @@ void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param) if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param && acpi_battery_dir) { remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); - acpi_battery_dir = 0; + acpi_battery_dir = NULL; } mutex_unlock(&cm_sbs_mutex); return; From 29756fa3287ff702535e459e7ca8c6038f6e9ae3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:27 +0100 Subject: [PATCH 198/232] [PATCH] trivial iomem annotations: istallion Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/char/istallion.c | 58 +++++++++++++++++++-------------------- include/linux/istallion.h | 4 +-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index d6e031542c6b..ffdf9df1a67a 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c @@ -686,37 +686,37 @@ static stlibrd_t *stli_allocbrd(void); static void stli_ecpinit(stlibrd_t *brdp); static void stli_ecpenable(stlibrd_t *brdp); static void stli_ecpdisable(stlibrd_t *brdp); -static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecpreset(stlibrd_t *brdp); static void stli_ecpintr(stlibrd_t *brdp); static void stli_ecpeiinit(stlibrd_t *brdp); static void stli_ecpeienable(stlibrd_t *brdp); static void stli_ecpeidisable(stlibrd_t *brdp); -static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecpeireset(stlibrd_t *brdp); static void stli_ecpmcenable(stlibrd_t *brdp); static void stli_ecpmcdisable(stlibrd_t *brdp); -static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecpmcreset(stlibrd_t *brdp); static void stli_ecppciinit(stlibrd_t *brdp); -static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecppcireset(stlibrd_t *brdp); static void stli_onbinit(stlibrd_t *brdp); static void stli_onbenable(stlibrd_t *brdp); static void stli_onbdisable(stlibrd_t *brdp); -static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_onbreset(stlibrd_t *brdp); static void stli_onbeinit(stlibrd_t *brdp); static void stli_onbeenable(stlibrd_t *brdp); static void stli_onbedisable(stlibrd_t *brdp); -static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_onbereset(stlibrd_t *brdp); static void stli_bbyinit(stlibrd_t *brdp); -static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_bbyreset(stlibrd_t *brdp); static void stli_stalinit(stlibrd_t *brdp); -static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_stalreset(stlibrd_t *brdp); static stliport_t *stli_getport(int brdnr, int panelnr, int portnr); @@ -1566,7 +1566,7 @@ static void stli_flushchars(struct tty_struct *tty) len = MIN(len, cooksize); count = 0; - shbuf = (char *) EBRDGETMEMPTR(brdp, portp->txoffset); + shbuf = EBRDGETMEMPTR(brdp, portp->txoffset); buf = stli_txcookbuf; while (len > 0) { @@ -2948,9 +2948,9 @@ static void stli_ecpdisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3022,9 +3022,9 @@ static void stli_ecpeidisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3074,9 +3074,9 @@ static void stli_ecpmcdisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3119,9 +3119,9 @@ static void stli_ecppciinit(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3185,9 +3185,9 @@ static void stli_onbdisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; if (offset > brdp->memsize) { printk(KERN_ERR "STALLION: shared memory pointer=%x out of " @@ -3250,9 +3250,9 @@ static void stli_onbedisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3300,9 +3300,9 @@ static void stli_bbyinit(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; BUG_ON(offset > brdp->memsize); @@ -3337,7 +3337,7 @@ static void stli_stalinit(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { BUG_ON(offset > brdp->memsize); return brdp->membase + (offset % STAL_PAGESIZE); @@ -3876,7 +3876,7 @@ static int stli_eisamemprobe(stlibrd_t *brdp) continue; if (brdp->brdtype == BRD_ECPE) { - ecpsigp = (cdkecpsig_t __iomem *) stli_ecpeigetmemptr(brdp, + ecpsigp = stli_ecpeigetmemptr(brdp, CDK_SIGADDR, __LINE__); memcpy_fromio(&ecpsig, ecpsigp, sizeof(cdkecpsig_t)); if (ecpsig.magic == cpu_to_le32(ECP_MAGIC)) @@ -4184,7 +4184,7 @@ static int stli_initbrds(void) static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp) { unsigned long flags; - void *memptr; + void __iomem *memptr; stlibrd_t *brdp; int brdnr, size, n; void *p; @@ -4214,7 +4214,7 @@ static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, lof while (size > 0) { spin_lock_irqsave(&brd_lock, flags); EBRDENABLE(brdp); - memptr = (void *) EBRDGETMEMPTR(brdp, off); + memptr = EBRDGETMEMPTR(brdp, off); n = MIN(size, (brdp->pagesize - (((unsigned long) off) % brdp->pagesize))); n = MIN(n, PAGE_SIZE); memcpy_fromio(p, memptr, n); @@ -4247,7 +4247,7 @@ out: static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp) { unsigned long flags; - void *memptr; + void __iomem *memptr; stlibrd_t *brdp; char __user *chbuf; int brdnr, size, n; @@ -4287,7 +4287,7 @@ static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t cou } spin_lock_irqsave(&brd_lock, flags); EBRDENABLE(brdp); - memptr = (void *) EBRDGETMEMPTR(brdp, off); + memptr = EBRDGETMEMPTR(brdp, off); memcpy_toio(memptr, p, n); EBRDDISABLE(brdp); spin_unlock_irqrestore(&brd_lock, flags); diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 1f996621bc9c..b55e2a035605 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h @@ -100,7 +100,7 @@ typedef struct stlibrd { unsigned int iobase; int iosize; unsigned long memaddr; - void *membase; + void __iomem *membase; int memsize; int pagesize; int hostoffset; @@ -113,7 +113,7 @@ typedef struct stlibrd { void (*enable)(struct stlibrd *brdp); void (*reenable)(struct stlibrd *brdp); void (*disable)(struct stlibrd *brdp); - char *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); + void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); void (*intr)(struct stlibrd *brdp); void (*reset)(struct stlibrd *brdp); stliport_t *ports[STL_MAXPORTS]; From 86f93336543314ffc46787845b631029cf11d6f8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:37 +0100 Subject: [PATCH 199/232] [PATCH] ptrace32 trivial __user annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/x86_64/ia32/ptrace32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index d18198ed636b..3a7561d4703e 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c @@ -205,9 +205,9 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val) static long ptrace32_siginfo(unsigned request, u32 pid, u32 addr, u32 data) { int ret; - compat_siginfo_t *si32 = (compat_siginfo_t *)compat_ptr(data); + compat_siginfo_t __user *si32 = compat_ptr(data); siginfo_t ssi; - siginfo_t *si = compat_alloc_user_space(sizeof(siginfo_t)); + siginfo_t __user *si = compat_alloc_user_space(sizeof(siginfo_t)); if (request == PTRACE_SETSIGINFO) { memset(&ssi, 0, sizeof(siginfo_t)); ret = copy_siginfo_from_user32(&ssi, si32); From fa1f5ea860af34d74c1475eddde3364e71fac15d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:47 +0100 Subject: [PATCH 200/232] [PATCH] gfp annotations: scsi_error Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/scsi_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 3d355d054612..aff1b0cfd4b2 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -495,7 +495,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, memcpy(scmd->cmnd, cmnd, cmnd_size); if (copy_sense) { - int gfp_mask = GFP_ATOMIC; + gfp_t gfp_mask = GFP_ATOMIC; if (shost->hostt->unchecked_isa_dma) gfp_mask |= __GFP_DMA; From 20241ad409fbc42d9e7f92f5fdb4783b7f1b36eb Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:57 +0100 Subject: [PATCH 201/232] [PATCH] gfp annotations: radix_tree_root struct radix_tree_root has unused upper bits of ->gfp_mask reused for tags bitmap. Annotated. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- lib/radix-tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 637d55608de5..aa9bfd0bdbd1 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -160,13 +160,13 @@ static inline int tag_get(struct radix_tree_node *node, unsigned int tag, static inline void root_tag_set(struct radix_tree_root *root, unsigned int tag) { - root->gfp_mask |= (1 << (tag + __GFP_BITS_SHIFT)); + root->gfp_mask |= (__force gfp_t)(1 << (tag + __GFP_BITS_SHIFT)); } static inline void root_tag_clear(struct radix_tree_root *root, unsigned int tag) { - root->gfp_mask &= ~(1 << (tag + __GFP_BITS_SHIFT)); + root->gfp_mask &= (__force gfp_t)~(1 << (tag + __GFP_BITS_SHIFT)); } static inline void root_tag_clear_all(struct radix_tree_root *root) @@ -176,7 +176,7 @@ static inline void root_tag_clear_all(struct radix_tree_root *root) static inline int root_tag_get(struct radix_tree_root *root, unsigned int tag) { - return root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT)); + return (__force unsigned)root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT)); } /* From 03dc55064117508ad474f3eede3a77bf9fbb636f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:07 +0100 Subject: [PATCH 202/232] [PATCH] trivial iomem annotations: sata_promise Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/ata/sata_promise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index d636ede064aa..8bcdfa64667c 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c @@ -360,7 +360,7 @@ static void pdc_sata_phy_reset(struct ata_port *ap) static void pdc_pata_cbl_detect(struct ata_port *ap) { u8 tmp; - void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; + void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; tmp = readb(mmio); From a6ded1b0605376e18a17cb01977819bcf2677cdc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:17 +0100 Subject: [PATCH 203/232] [PATCH] openprom NULL noise removal Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- drivers/sbus/char/openprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 2f698763ba5d..81ba2d71cee2 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -630,7 +630,7 @@ static int openprom_ioctl(struct inode * inode, struct file * file, case OPROMPATH2NODE: if ((file->f_mode & FMODE_READ) == 0) return -EPERM; - return openprom_sunos_ioctl(inode, file, cmd, arg, 0); + return openprom_sunos_ioctl(inode, file, cmd, arg, NULL); case OPIOCGET: case OPIOCNEXTPROP: From ba674cfcbdb93cb560a4ae4d2c8b53cfbddc2d22 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:27 +0100 Subject: [PATCH 204/232] [PATCH] __user annotations: loop.c Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 19a09a187270..beab6d2643cb 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1187,7 +1187,7 @@ struct compat_loop_info { * - noinlined to reduce stack space usage in main part of driver */ static noinline int -loop_info64_from_compat(const struct compat_loop_info *arg, +loop_info64_from_compat(const struct compat_loop_info __user *arg, struct loop_info64 *info64) { struct compat_loop_info info; From 663d1ba2f1f66db43ab95350f965c1d9f2e3e5bc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:37 +0100 Subject: [PATCH 205/232] [PATCH] em28xx NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/media/video/em28xx/em28xx-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 20df657b70c8..2a461dde480c 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -174,7 +174,7 @@ static void em28xx_config_i2c(struct em28xx *dev) route.input = INPUT(dev->ctl_input)->vmux; route.output = 0; - em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, 0); + em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL); em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL); From e6c6e640b8b258dc7f60533e81f050d15fc0a9af Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:47 +0100 Subject: [PATCH 206/232] [PATCH] fs/inode.c NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/inode.c b/fs/inode.c index bf6bec4e54ff..d9a21d122926 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -162,7 +162,7 @@ static struct inode *alloc_inode(struct super_block *sb) bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; mapping->backing_dev_info = bdi; } - inode->i_private = 0; + inode->i_private = NULL; inode->i_mapping = mapping; } return inode; From 1af9892811ad3bf2abb31566bfb2ec0b5070a66a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:57 +0100 Subject: [PATCH 207/232] [PATCH] cpuset ANSI prototype Signed-off-by: Al Viro Acked-by: Paul Jackson Signed-off-by: Linus Torvalds --- kernel/cpuset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 9d850ae13b1b..6313c38c930e 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -2137,7 +2137,7 @@ static int cpuset_handle_cpuhp(struct notifier_block *nb, * See also the previous routine cpuset_handle_cpuhp(). */ -void cpuset_track_online_nodes() +void cpuset_track_online_nodes(void) { common_cpu_mem_hotplug_unplug(); } From 5e7ddac75deaa2887e2b03441f9bed67ea8648d8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:07 +0100 Subject: [PATCH 208/232] [PATCH] ptrdiff_t is %t, not %z Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- net/ipv4/ipvs/ip_vs_ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c index e433cb0ff894..6d398f10aa91 100644 --- a/net/ipv4/ipvs/ip_vs_ftp.c +++ b/net/ipv4/ipvs/ip_vs_ftp.c @@ -274,7 +274,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, while (data <= data_limit - 6) { if (strnicmp(data, "PASV\r\n", 6) == 0) { /* Passive mode on */ - IP_VS_DBG(7, "got PASV at %zd of %zd\n", + IP_VS_DBG(7, "got PASV at %td of %td\n", data - data_start, data_limit - data_start); cp->app_data = &ip_vs_ftp_pasv; From 86b95c12139785a0f4c17cb7b4cb865e7084cd34 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:17 +0100 Subject: [PATCH 209/232] [PATCH] strndup() would better take size_t, not int Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- net/irda/irias_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index a154b1d71c0f..56292ab7d652 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c @@ -43,7 +43,7 @@ struct ias_value irias_missing = { IAS_MISSING, 0, 0, 0, {0}}; * * Faster, check boundary... Jean II */ -static char *strndup(char *str, int max) +static char *strndup(char *str, size_t max) { char *new_str; int len; From cfbdbab0634cafae2c43371396e5443cf4d5d7bc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:27 +0100 Subject: [PATCH 210/232] [PATCH] net/sunrpc/auth_gss/svcauth_gss.c endianness regression Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- net/sunrpc/auth_gss/svcauth_gss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 447d9aef4605..1f0f079ffa65 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1146,10 +1146,11 @@ out: return ret; } -u32 * +static __be32 * svcauth_gss_prepare_to_wrap(struct xdr_buf *resbuf, struct gss_svc_data *gsd) { - u32 *p, verf_len; + __be32 *p; + u32 verf_len; p = gsd->verf_start; gsd->verf_start = NULL; From 59bd59842617565b27acb0b55388363211123b9c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:37 +0100 Subject: [PATCH 211/232] [PATCH] missed const in prototype Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- arch/um/drivers/pcap_user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/drivers/pcap_user.h b/arch/um/drivers/pcap_user.h index 58f9f6a1420f..96b80b565eeb 100644 --- a/arch/um/drivers/pcap_user.h +++ b/arch/um/drivers/pcap_user.h @@ -15,7 +15,7 @@ struct pcap_data { void *dev; }; -extern struct net_user_info pcap_user_info; +extern const struct net_user_info pcap_user_info; extern int pcap_user_read(int fd, void *buf, int len, struct pcap_data *pri); From 3c5c6658d2f1385cf06cdc00db9f7f124a35fb25 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:47 +0100 Subject: [PATCH 212/232] [PATCH] use %zu for size_t Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/dc395x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 23f5e418ab55..e95b367d09ed 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -1219,7 +1219,7 @@ static void dump_register_info(struct AdapterCtlBlk *acb, srb, srb->cmd, srb->cmd->pid, srb->cmd->cmnd[0], srb->cmd->device->id, srb->cmd->device->lun); - printk(" sglist=%p cnt=%i idx=%i len=%Zd\n", + printk(" sglist=%p cnt=%i idx=%i len=%zu\n", srb->segment_x, srb->sg_count, srb->sg_index, srb->total_xfer_length); printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n", From 70f38912935fd4aa3fea1ddf87ed1cee63109cc5 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:57 +0100 Subject: [PATCH 213/232] [PATCH] use %p for pointers Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- drivers/sbus/char/uctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index ddc0681ac759..b30372f17f1c 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -400,7 +400,7 @@ static int __init ts102_uctrl_init(void) } driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK; - printk("uctrl: 0x%x (irq %d)\n", driver->regs, driver->irq); + printk("uctrl: 0x%p (irq %d)\n", driver->regs, driver->irq); uctrl_get_event_status(); uctrl_get_external_status(); return 0; From 56052d525a05ba9e53d4f11be2d5deee64924514 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Thu, 1 Dec 2005 17:10:40 -0500 Subject: [PATCH 214/232] [PATCH] cdrom: add endianness annotations Signed-off-by: Alexey Dobriyan Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/cdrom/cdrom.c | 6 +++--- include/linux/cdrom.h | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 2a0c50d84fc5..7ea0f48f8fa6 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -703,7 +703,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) { struct packet_command cgc; char buffer[16]; - __u16 *feature_code; + __be16 *feature_code; int ret; init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); @@ -716,7 +716,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) if ((ret = cdi->ops->generic_packet(cdi, &cgc))) return ret; - feature_code = (__u16 *) &buffer[sizeof(struct feature_header)]; + feature_code = (__be16 *) &buffer[sizeof(struct feature_header)]; if (be16_to_cpu(*feature_code) == CDF_HWDM) return 0; @@ -2963,7 +2963,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, how much data is available for transfer. buffer[1] is unfortunately ambigious and the only reliable way seem to be to simply skip over the block descriptor... */ - offset = 8 + be16_to_cpu(*(unsigned short *)(buffer+6)); + offset = 8 + be16_to_cpu(*(__be16 *)(buffer+6)); if (offset + 16 > sizeof(buffer)) return -E2BIG; diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 3c9b0bc05123..bbbe7b4da0bb 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -749,7 +749,7 @@ struct request_sense { #define MRW_MODE_PC 0x03 struct mrw_feature_desc { - __u16 feature_code; + __be16 feature_code; #if defined(__BIG_ENDIAN_BITFIELD) __u8 reserved1 : 2; __u8 feature_version : 4; @@ -776,7 +776,7 @@ struct mrw_feature_desc { /* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */ struct rwrt_feature_desc { - __u16 feature_code; + __be16 feature_code; #if defined(__BIG_ENDIAN_BITFIELD) __u8 reserved1 : 2; __u8 feature_version : 4; @@ -803,7 +803,7 @@ struct rwrt_feature_desc { }; typedef struct { - __u16 disc_information_length; + __be16 disc_information_length; #if defined(__BIG_ENDIAN_BITFIELD) __u8 reserved1 : 3; __u8 erasable : 1; @@ -849,7 +849,7 @@ typedef struct { } disc_information; typedef struct { - __u16 track_information_length; + __be16 track_information_length; __u8 track_lsb; __u8 session_lsb; __u8 reserved1; @@ -880,12 +880,12 @@ typedef struct { __u8 lra_v : 1; __u8 reserved3 : 6; #endif - __u32 track_start; - __u32 next_writable; - __u32 free_blocks; - __u32 fixed_packet_size; - __u32 track_size; - __u32 last_rec_address; + __be32 track_start; + __be32 next_writable; + __be32 free_blocks; + __be32 fixed_packet_size; + __be32 track_size; + __be32 last_rec_address; } track_information; struct feature_header { @@ -896,12 +896,12 @@ struct feature_header { }; struct mode_page_header { - __u16 mode_data_length; + __be16 mode_data_length; __u8 medium_type; __u8 reserved1; __u8 reserved2; __u8 reserved3; - __u16 desc_length; + __be16 desc_length; }; #ifdef __KERNEL__ @@ -1106,7 +1106,7 @@ typedef struct { #endif __u8 session_format; __u8 reserved6; - __u32 packet_size; + __be32 packet_size; __u16 audio_pause; __u8 mcn[16]; __u8 isrc[16]; @@ -1151,7 +1151,7 @@ typedef struct { } rpc_state_t; struct event_header { - __u16 data_len; + __be16 data_len; #if defined(__BIG_ENDIAN_BITFIELD) __u8 nea : 1; __u8 reserved1 : 4; From d08f74e58cad8f1844f6e01636a76dd52d41bb0f Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 23 Dec 2005 01:12:25 +0300 Subject: [PATCH 215/232] [PATCH] serpent: fix endian warnings Signed-off-by: Alexey Dobriyan Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- crypto/serpent.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto/serpent.c b/crypto/serpent.c index 465d091cd3ec..2b0a19a44ec5 100644 --- a/crypto/serpent.c +++ b/crypto/serpent.c @@ -364,10 +364,10 @@ static void serpent_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct serpent_ctx *ctx = crypto_tfm_ctx(tfm); const u32 - *k = ctx->expkey, - *s = (const u32 *)src; - u32 *d = (u32 *)dst, - r0, r1, r2, r3, r4; + *k = ctx->expkey; + const __le32 *s = (const __le32 *)src; + __le32 *d = (__le32 *)dst; + u32 r0, r1, r2, r3, r4; /* * Note: The conversions between u8* and u32* might cause trouble @@ -423,10 +423,10 @@ static void serpent_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct serpent_ctx *ctx = crypto_tfm_ctx(tfm); const u32 - *k = ((struct serpent_ctx *)ctx)->expkey, - *s = (const u32 *)src; - u32 *d = (u32 *)dst, - r0, r1, r2, r3, r4; + *k = ((struct serpent_ctx *)ctx)->expkey; + const __le32 *s = (const __le32 *)src; + __le32 *d = (__le32 *)dst; + u32 r0, r1, r2, r3, r4; r0 = le32_to_cpu(s[0]); r1 = le32_to_cpu(s[1]); From 7359bbfd85751de23079cc26cd248635aebe840b Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 23 Dec 2005 01:18:25 +0300 Subject: [PATCH 216/232] [PATCH] chelsio: add endian annotations Signed-off-by: Alexey Dobriyan Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/chelsio/cpl5_cmd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/chelsio/cpl5_cmd.h b/drivers/net/chelsio/cpl5_cmd.h index 27925e487bcf..5b357d9e88d6 100644 --- a/drivers/net/chelsio/cpl5_cmd.h +++ b/drivers/net/chelsio/cpl5_cmd.h @@ -108,7 +108,7 @@ struct cpl_tx_pkt_lso { u8 iff:4; #endif u16 vlan; - u32 len; + __be32 len; u32 rsvd2; u8 rsvd3; @@ -119,7 +119,7 @@ struct cpl_tx_pkt_lso { u8 ip_hdr_words:4; u8 tcp_hdr_words:4; #endif - u16 eth_type_mss; + __be16 eth_type_mss; }; struct cpl_rx_pkt { @@ -138,7 +138,7 @@ struct cpl_rx_pkt { u8 iff:4; #endif u16 csum; - u16 vlan; + __be16 vlan; u16 len; }; From 88c124d847d0fc60531e45323752665b01fc14f0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 23 Dec 2005 20:56:46 -0500 Subject: [PATCH 217/232] [PATCH] befs: remove bogus typedef Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/befs/befs_fs_types.h | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/befs/befs_fs_types.h b/fs/befs/befs_fs_types.h index 63ef1e18fb84..d124b4c51179 100644 --- a/fs/befs/befs_fs_types.h +++ b/fs/befs/befs_fs_types.h @@ -81,7 +81,6 @@ enum inode_flags { typedef u64 befs_off_t; typedef u64 befs_time_t; -typedef void befs_binode_etc; /* Block runs */ typedef struct { From af10b0084dff530fb7232a0f8bbc4499e9c58574 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 01:13:13 -0500 Subject: [PATCH 218/232] [PATCH] befs: prepare to sanitizing headers pulled includes of endian.h from fs/befs/*.c to befs.h Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/befs/befs.h | 2 ++ fs/befs/btree.c | 1 - fs/befs/datastream.c | 1 - fs/befs/debug.c | 1 - fs/befs/endian.h | 1 - fs/befs/inode.c | 1 - fs/befs/linuxvfs.c | 1 - fs/befs/super.c | 1 - 8 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/befs/befs.h b/fs/befs/befs.h index 057a2c3d73b7..c400bb6a6b71 100644 --- a/fs/befs/befs.h +++ b/fs/befs/befs.h @@ -151,4 +151,6 @@ befs_brun_size(struct super_block *sb, befs_block_run run) return BEFS_SB(sb)->block_size * run.len; } +#include "endian.h" + #endif /* _LINUX_BEFS_H */ diff --git a/fs/befs/btree.c b/fs/befs/btree.c index 76e219799409..12e0fd60033e 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c @@ -30,7 +30,6 @@ #include "befs.h" #include "btree.h" #include "datastream.h" -#include "endian.h" /* * The btree functions in this file are built on top of the diff --git a/fs/befs/datastream.c b/fs/befs/datastream.c index b7d6b920f65f..67335e2853f6 100644 --- a/fs/befs/datastream.c +++ b/fs/befs/datastream.c @@ -18,7 +18,6 @@ #include "befs.h" #include "datastream.h" #include "io.h" -#include "endian.h" const befs_inode_addr BAD_IADDR = { 0, 0, 0 }; diff --git a/fs/befs/debug.c b/fs/befs/debug.c index 875cc0aa318c..3afd0882fdb9 100644 --- a/fs/befs/debug.c +++ b/fs/befs/debug.c @@ -21,7 +21,6 @@ #endif /* __KERNEL__ */ #include "befs.h" -#include "endian.h" #define ERRBUFSIZE 1024 diff --git a/fs/befs/endian.h b/fs/befs/endian.h index 9ecaea4e3325..d77a26e7bd97 100644 --- a/fs/befs/endian.h +++ b/fs/befs/endian.h @@ -10,7 +10,6 @@ #define LINUX_BEFS_ENDIAN #include -#include "befs.h" static inline u64 fs64_to_cpu(const struct super_block *sb, u64 n) diff --git a/fs/befs/inode.c b/fs/befs/inode.c index d41c9247ae8a..94c17f9a9576 100644 --- a/fs/befs/inode.c +++ b/fs/befs/inode.c @@ -8,7 +8,6 @@ #include "befs.h" #include "inode.h" -#include "endian.h" /* Validates the correctness of the befs inode diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 57020c7a7e65..07f7144f0e2e 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -22,7 +22,6 @@ #include "datastream.h" #include "super.h" #include "io.h" -#include "endian.h" MODULE_DESCRIPTION("BeOS File System (BeFS) driver"); MODULE_AUTHOR("Will Dyson"); diff --git a/fs/befs/super.c b/fs/befs/super.c index 4557acbac528..8c3401ff6d6a 100644 --- a/fs/befs/super.c +++ b/fs/befs/super.c @@ -11,7 +11,6 @@ #include "befs.h" #include "super.h" -#include "endian.h" /** * load_befs_sb -- Read from disk and properly byteswap all the fields From 1151895f8076584e061092afffb110b90cb38a68 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 01:32:03 -0500 Subject: [PATCH 219/232] [PATCH] befs: introduce on-disk endian types Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/befs/befs_fs_types.h | 4 ++++ fs/befs/endian.h | 36 ++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/fs/befs/befs_fs_types.h b/fs/befs/befs_fs_types.h index d124b4c51179..128066b1c4b0 100644 --- a/fs/befs/befs_fs_types.h +++ b/fs/befs/befs_fs_types.h @@ -79,6 +79,10 @@ enum inode_flags { * On-Disk datastructures of BeFS */ +typedef u64 __bitwise fs64; +typedef u32 __bitwise fs32; +typedef u16 __bitwise fs16; + typedef u64 befs_off_t; typedef u64 befs_time_t; diff --git a/fs/befs/endian.h b/fs/befs/endian.h index d77a26e7bd97..979c543e6c58 100644 --- a/fs/befs/endian.h +++ b/fs/befs/endian.h @@ -12,57 +12,57 @@ #include static inline u64 -fs64_to_cpu(const struct super_block *sb, u64 n) +fs64_to_cpu(const struct super_block *sb, fs64 n) { if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) - return le64_to_cpu(n); + return le64_to_cpu((__force __le64)n); else - return be64_to_cpu(n); + return be64_to_cpu((__force __be64)n); } -static inline u64 +static inline fs64 cpu_to_fs64(const struct super_block *sb, u64 n) { if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) - return cpu_to_le64(n); + return (__force fs64)cpu_to_le64(n); else - return cpu_to_be64(n); + return (__force fs64)cpu_to_be64(n); } static inline u32 -fs32_to_cpu(const struct super_block *sb, u32 n) +fs32_to_cpu(const struct super_block *sb, fs32 n) { if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) - return le32_to_cpu(n); + return le32_to_cpu((__force __le32)n); else - return be32_to_cpu(n); + return be32_to_cpu((__force __be32)n); } -static inline u32 +static inline fs32 cpu_to_fs32(const struct super_block *sb, u32 n) { if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) - return cpu_to_le32(n); + return (__force fs32)cpu_to_le32(n); else - return cpu_to_be32(n); + return (__force fs32)cpu_to_be32(n); } static inline u16 -fs16_to_cpu(const struct super_block *sb, u16 n) +fs16_to_cpu(const struct super_block *sb, fs16 n) { if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) - return le16_to_cpu(n); + return le16_to_cpu((__force __le16)n); else - return be16_to_cpu(n); + return be16_to_cpu((__force __be16)n); } -static inline u16 +static inline fs16 cpu_to_fs16(const struct super_block *sb, u16 n) { if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) - return cpu_to_le16(n); + return (__force fs16)cpu_to_le16(n); else - return cpu_to_be16(n); + return (__force fs16)cpu_to_be16(n); } /* Composite types below here */ From e5201c58cd81066ecd0210bcc6c02e71200040a3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 03:09:03 -0500 Subject: [PATCH 220/232] [PATCH] befs: missing fs32_to_cpu() in debug.c inode->mode is disk-endian Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/befs/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/befs/debug.c b/fs/befs/debug.c index 3afd0882fdb9..bb68370f6494 100644 --- a/fs/befs/debug.c +++ b/fs/befs/debug.c @@ -124,7 +124,7 @@ befs_dump_inode(const struct super_block *sb, befs_inode * inode) befs_debug(sb, " type %08x", fs32_to_cpu(sb, inode->type)); befs_debug(sb, " inode_size %u", fs32_to_cpu(sb, inode->inode_size)); - if (S_ISLNK(inode->mode)) { + if (S_ISLNK(fs32_to_cpu(sb, inode->mode))) { befs_debug(sb, " Symbolic link [%s]", inode->data.symlink); } else { int i; From a9721f3152bc2be6702807705902e06abdd6e3bb Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 14:28:55 -0500 Subject: [PATCH 221/232] [PATCH] befs: endianness annotations split the data structures that exist in host- and disk-endian variants, annotate the fields of disk-endian ones, propagate changes. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/befs/befs.h | 4 +- fs/befs/befs_fs_types.h | 107 ++++++++++++++++++++++++++-------------- fs/befs/btree.c | 28 +++++------ fs/befs/datastream.c | 10 ++-- fs/befs/debug.c | 9 ++-- fs/befs/endian.h | 20 ++++---- 6 files changed, 106 insertions(+), 72 deletions(-) diff --git a/fs/befs/befs.h b/fs/befs/befs.h index c400bb6a6b71..d9a40abda6b7 100644 --- a/fs/befs/befs.h +++ b/fs/befs/befs.h @@ -94,7 +94,7 @@ void befs_debug(const struct super_block *sb, const char *fmt, ...); void befs_dump_super_block(const struct super_block *sb, befs_super_block *); void befs_dump_inode(const struct super_block *sb, befs_inode *); -void befs_dump_index_entry(const struct super_block *sb, befs_btree_super *); +void befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super *); void befs_dump_index_node(const struct super_block *sb, befs_btree_nodehead *); /****************************/ @@ -136,7 +136,7 @@ blockno2iaddr(struct super_block *sb, befs_blocknr_t blockno) static inline unsigned int befs_iaddrs_per_block(struct super_block *sb) { - return BEFS_SB(sb)->block_size / sizeof (befs_inode_addr); + return BEFS_SB(sb)->block_size / sizeof (befs_disk_inode_addr); } static inline int diff --git a/fs/befs/befs_fs_types.h b/fs/befs/befs_fs_types.h index 128066b1c4b0..e2595c2c403a 100644 --- a/fs/befs/befs_fs_types.h +++ b/fs/befs/befs_fs_types.h @@ -84,15 +84,22 @@ typedef u32 __bitwise fs32; typedef u16 __bitwise fs16; typedef u64 befs_off_t; -typedef u64 befs_time_t; +typedef fs64 befs_time_t; /* Block runs */ +typedef struct { + fs32 allocation_group; + fs16 start; + fs16 len; +} PACKED befs_disk_block_run; + typedef struct { u32 allocation_group; u16 start; u16 len; } PACKED befs_block_run; +typedef befs_disk_block_run befs_disk_inode_addr; typedef befs_block_run befs_inode_addr; /* @@ -100,31 +107,31 @@ typedef befs_block_run befs_inode_addr; */ typedef struct { char name[B_OS_NAME_LENGTH]; - u32 magic1; - u32 fs_byte_order; + fs32 magic1; + fs32 fs_byte_order; - u32 block_size; - u32 block_shift; + fs32 block_size; + fs32 block_shift; - befs_off_t num_blocks; - befs_off_t used_blocks; + fs64 num_blocks; + fs64 used_blocks; - u32 inode_size; + fs32 inode_size; - u32 magic2; - u32 blocks_per_ag; - u32 ag_shift; - u32 num_ags; + fs32 magic2; + fs32 blocks_per_ag; + fs32 ag_shift; + fs32 num_ags; - u32 flags; + fs32 flags; - befs_block_run log_blocks; - befs_off_t log_start; - befs_off_t log_end; + befs_disk_block_run log_blocks; + fs64 log_start; + fs64 log_end; - u32 magic3; - befs_inode_addr root_dir; - befs_inode_addr indices; + fs32 magic3; + befs_disk_inode_addr root_dir; + befs_disk_inode_addr indices; } PACKED befs_super_block; @@ -132,6 +139,16 @@ typedef struct { * Note: the indirect and dbl_indir block_runs may * be longer than one block! */ +typedef struct { + befs_disk_block_run direct[BEFS_NUM_DIRECT_BLOCKS]; + fs64 max_direct_range; + befs_disk_block_run indirect; + fs64 max_indirect_range; + befs_disk_block_run double_indirect; + fs64 max_double_indirect_range; + fs64 size; +} PACKED befs_disk_data_stream; + typedef struct { befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS]; befs_off_t max_direct_range; @@ -144,35 +161,35 @@ typedef struct { /* Attribute */ typedef struct { - u32 type; - u16 name_size; - u16 data_size; + fs32 type; + fs16 name_size; + fs16 data_size; char name[1]; } PACKED befs_small_data; /* Inode structure */ typedef struct { - u32 magic1; - befs_inode_addr inode_num; - u32 uid; - u32 gid; - u32 mode; - u32 flags; + fs32 magic1; + befs_disk_inode_addr inode_num; + fs32 uid; + fs32 gid; + fs32 mode; + fs32 flags; befs_time_t create_time; befs_time_t last_modified_time; - befs_inode_addr parent; - befs_inode_addr attributes; - u32 type; + befs_disk_inode_addr parent; + befs_disk_inode_addr attributes; + fs32 type; - u32 inode_size; - u32 etc; /* not use */ + fs32 inode_size; + fs32 etc; /* not use */ union { - befs_data_stream datastream; + befs_disk_data_stream datastream; char symlink[BEFS_SYMLINK_LEN]; } data; - u32 pad[4]; /* not use */ + fs32 pad[4]; /* not use */ befs_small_data small_data[1]; } PACKED befs_inode; @@ -192,6 +209,16 @@ enum btree_types { BTREE_DOUBLE_TYPE = 6 }; +typedef struct { + fs32 magic; + fs32 node_size; + fs32 max_depth; + fs32 data_type; + fs64 root_node_ptr; + fs64 free_node_ptr; + fs64 max_size; +} PACKED befs_disk_btree_super; + typedef struct { u32 magic; u32 node_size; @@ -205,12 +232,20 @@ typedef struct { /* * Header stucture of each btree node */ +typedef struct { + fs64 left; + fs64 right; + fs64 overflow; + fs16 all_key_count; + fs16 all_key_length; +} PACKED befs_btree_nodehead; + typedef struct { befs_off_t left; befs_off_t right; befs_off_t overflow; u16 all_key_count; u16 all_key_length; -} PACKED befs_btree_nodehead; +} PACKED befs_host_btree_nodehead; #endif /* _LINUX_BEFS_FS_TYPES */ diff --git a/fs/befs/btree.c b/fs/befs/btree.c index 12e0fd60033e..81b042ee24e6 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c @@ -79,7 +79,7 @@ * In memory structure of each btree node */ typedef struct { - befs_btree_nodehead head; /* head of node converted to cpu byteorder */ + befs_host_btree_nodehead head; /* head of node converted to cpu byteorder */ struct buffer_head *bh; befs_btree_nodehead *od_node; /* on disk node */ } befs_btree_node; @@ -101,9 +101,9 @@ static int befs_bt_read_node(struct super_block *sb, befs_data_stream * ds, static int befs_leafnode(befs_btree_node * node); -static u16 *befs_bt_keylen_index(befs_btree_node * node); +static fs16 *befs_bt_keylen_index(befs_btree_node * node); -static befs_off_t *befs_bt_valarray(befs_btree_node * node); +static fs64 *befs_bt_valarray(befs_btree_node * node); static char *befs_bt_keydata(befs_btree_node * node); @@ -135,7 +135,7 @@ befs_bt_read_super(struct super_block *sb, befs_data_stream * ds, befs_btree_super * sup) { struct buffer_head *bh = NULL; - befs_btree_super *od_sup = NULL; + befs_disk_btree_super *od_sup = NULL; befs_debug(sb, "---> befs_btree_read_super()"); @@ -145,7 +145,7 @@ befs_bt_read_super(struct super_block *sb, befs_data_stream * ds, befs_error(sb, "Couldn't read index header."); goto error; } - od_sup = (befs_btree_super *) bh->b_data; + od_sup = (befs_disk_btree_super *) bh->b_data; befs_dump_index_entry(sb, od_sup); sup->magic = fs32_to_cpu(sb, od_sup->magic); @@ -341,7 +341,7 @@ befs_find_key(struct super_block *sb, befs_btree_node * node, u16 keylen; int findkey_len; char *thiskey; - befs_off_t *valarray; + fs64 *valarray; befs_debug(sb, "---> befs_find_key() %s", findkey); @@ -421,7 +421,7 @@ befs_btree_read(struct super_block *sb, befs_data_stream * ds, befs_btree_super bt_super; befs_off_t node_off = 0; int cur_key; - befs_off_t *valarray; + fs64 *valarray; char *keystart; u16 keylen; int res; @@ -571,7 +571,7 @@ befs_btree_seekleaf(struct super_block *sb, befs_data_stream * ds, this_node->head.overflow); *node_off = this_node->head.overflow; } else { - befs_off_t *valarray = befs_bt_valarray(this_node); + fs64 *valarray = befs_bt_valarray(this_node); *node_off = fs64_to_cpu(sb, valarray[0]); } if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) { @@ -621,7 +621,7 @@ befs_leafnode(befs_btree_node * node) * * Except that rounding up to 8 works, and rounding up to 4 doesn't. */ -static u16 * +static fs16 * befs_bt_keylen_index(befs_btree_node * node) { const int keylen_align = 8; @@ -632,7 +632,7 @@ befs_bt_keylen_index(befs_btree_node * node) if (tmp) off += keylen_align - tmp; - return (u16 *) ((void *) node->od_node + off); + return (fs16 *) ((void *) node->od_node + off); } /** @@ -642,13 +642,13 @@ befs_bt_keylen_index(befs_btree_node * node) * Returns a pointer to the start of the value array * of the node pointed to by the node header */ -static befs_off_t * +static fs64 * befs_bt_valarray(befs_btree_node * node) { void *keylen_index_start = (void *) befs_bt_keylen_index(node); - size_t keylen_index_size = node->head.all_key_count * sizeof (u16); + size_t keylen_index_size = node->head.all_key_count * sizeof (fs16); - return (befs_off_t *) (keylen_index_start + keylen_index_size); + return (fs64 *) (keylen_index_start + keylen_index_size); } /** @@ -680,7 +680,7 @@ befs_bt_get_key(struct super_block *sb, befs_btree_node * node, { int prev_key_end; char *keystart; - u16 *keylen_index; + fs16 *keylen_index; if (index < 0 || index > node->head.all_key_count) { *keylen = 0; diff --git a/fs/befs/datastream.c b/fs/befs/datastream.c index 67335e2853f6..aacb4da6298a 100644 --- a/fs/befs/datastream.c +++ b/fs/befs/datastream.c @@ -311,7 +311,7 @@ befs_find_brun_indirect(struct super_block *sb, befs_blocknr_t indir_start_blk; befs_blocknr_t search_blk; struct buffer_head *indirblock; - befs_block_run *array; + befs_disk_block_run *array; befs_block_run indirect = data->indirect; befs_blocknr_t indirblockno = iaddr2blockno(sb, &indirect); @@ -333,7 +333,7 @@ befs_find_brun_indirect(struct super_block *sb, return BEFS_ERR; } - array = (befs_block_run *) indirblock->b_data; + array = (befs_disk_block_run *) indirblock->b_data; for (j = 0; j < arraylen; ++j) { int len = fs16_to_cpu(sb, array[j].len); @@ -426,7 +426,7 @@ befs_find_brun_dblindirect(struct super_block *sb, struct buffer_head *dbl_indir_block; struct buffer_head *indir_block; befs_block_run indir_run; - befs_inode_addr *iaddr_array = NULL; + befs_disk_inode_addr *iaddr_array = NULL; befs_sb_info *befs_sb = BEFS_SB(sb); befs_blocknr_t indir_start_blk = @@ -481,7 +481,7 @@ befs_find_brun_dblindirect(struct super_block *sb, dbl_block_indx = dblindir_indx - (dbl_which_block * befs_iaddrs_per_block(sb)); - iaddr_array = (befs_inode_addr *) dbl_indir_block->b_data; + iaddr_array = (befs_disk_inode_addr *) dbl_indir_block->b_data; indir_run = fsrun_to_cpu(sb, iaddr_array[dbl_block_indx]); brelse(dbl_indir_block); iaddr_array = NULL; @@ -506,7 +506,7 @@ befs_find_brun_dblindirect(struct super_block *sb, } block_indx = indir_indx - (which_block * befs_iaddrs_per_block(sb)); - iaddr_array = (befs_inode_addr *) indir_block->b_data; + iaddr_array = (befs_disk_inode_addr *) indir_block->b_data; *run = fsrun_to_cpu(sb, iaddr_array[block_indx]); brelse(indir_block); iaddr_array = NULL; diff --git a/fs/befs/debug.c b/fs/befs/debug.c index bb68370f6494..e831a8f30849 100644 --- a/fs/befs/debug.c +++ b/fs/befs/debug.c @@ -230,21 +230,20 @@ befs_dump_small_data(const struct super_block *sb, befs_small_data * sd) /* unused */ void -befs_dump_run(const struct super_block *sb, befs_block_run run) +befs_dump_run(const struct super_block *sb, befs_disk_block_run run) { #ifdef CONFIG_BEFS_DEBUG - run = fsrun_to_cpu(sb, run); + befs_block_run n = fsrun_to_cpu(sb, run); - befs_debug(sb, "[%u, %hu, %hu]", - run.allocation_group, run.start, run.len); + befs_debug(sb, "[%u, %hu, %hu]", n.allocation_group, n.start, n.len); #endif //CONFIG_BEFS_DEBUG } #endif /* 0 */ void -befs_dump_index_entry(const struct super_block *sb, befs_btree_super * super) +befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super * super) { #ifdef CONFIG_BEFS_DEBUG diff --git a/fs/befs/endian.h b/fs/befs/endian.h index 979c543e6c58..e254a20869f4 100644 --- a/fs/befs/endian.h +++ b/fs/befs/endian.h @@ -68,26 +68,26 @@ cpu_to_fs16(const struct super_block *sb, u16 n) /* Composite types below here */ static inline befs_block_run -fsrun_to_cpu(const struct super_block *sb, befs_block_run n) +fsrun_to_cpu(const struct super_block *sb, befs_disk_block_run n) { befs_block_run run; if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) { - run.allocation_group = le32_to_cpu(n.allocation_group); - run.start = le16_to_cpu(n.start); - run.len = le16_to_cpu(n.len); + run.allocation_group = le32_to_cpu((__force __le32)n.allocation_group); + run.start = le16_to_cpu((__force __le16)n.start); + run.len = le16_to_cpu((__force __le16)n.len); } else { - run.allocation_group = be32_to_cpu(n.allocation_group); - run.start = be16_to_cpu(n.start); - run.len = be16_to_cpu(n.len); + run.allocation_group = be32_to_cpu((__force __be32)n.allocation_group); + run.start = be16_to_cpu((__force __be16)n.start); + run.len = be16_to_cpu((__force __be16)n.len); } return run; } -static inline befs_block_run +static inline befs_disk_block_run cpu_to_fsrun(const struct super_block *sb, befs_block_run n) { - befs_block_run run; + befs_disk_block_run run; if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) { run.allocation_group = cpu_to_le32(n.allocation_group); @@ -102,7 +102,7 @@ cpu_to_fsrun(const struct super_block *sb, befs_block_run n) } static inline befs_data_stream -fsds_to_cpu(const struct super_block *sb, befs_data_stream n) +fsds_to_cpu(const struct super_block *sb, befs_disk_data_stream n) { befs_data_stream data; int i; From 31b1f85b71b0b69afba89a60989097cd805f13c3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 14:31:04 -0500 Subject: [PATCH 222/232] [PATCH] fs/fat endianness annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/fat/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 045738032a83..4613cb202170 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -384,7 +384,7 @@ static int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) le16_to_cpu(de->cdate)) + secs; inode->i_ctime.tv_nsec = csecs * 10000000; inode->i_atime.tv_sec = - date_dos2unix(le16_to_cpu(0), le16_to_cpu(de->adate)); + date_dos2unix(0, le16_to_cpu(de->adate)); inode->i_atime.tv_nsec = 0; } else inode->i_ctime = inode->i_atime = inode->i_mtime; From 2ef1031282cd401b47a5f7f7477fe9ae69aff058 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 14:31:53 -0500 Subject: [PATCH 223/232] [PATCH] hpfs endianness annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/hpfs/inode.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index bcf6ee36e065..7faef8544f32 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -60,14 +60,14 @@ void hpfs_read_inode(struct inode *i) if (hpfs_sb(i->i_sb)->sb_eas) { if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) { if (ea_size == 2) { - i->i_uid = le16_to_cpu(*(u16*)ea); + i->i_uid = le16_to_cpu(*(__le16*)ea); hpfs_inode->i_ea_uid = 1; } kfree(ea); } if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) { if (ea_size == 2) { - i->i_gid = le16_to_cpu(*(u16*)ea); + i->i_gid = le16_to_cpu(*(__le16*)ea); hpfs_inode->i_ea_gid = 1; } kfree(ea); @@ -87,7 +87,7 @@ void hpfs_read_inode(struct inode *i) int rdev = 0; umode_t mode = hpfs_sb(sb)->sb_mode; if (ea_size == 2) { - mode = le16_to_cpu(*(u16*)ea); + mode = le16_to_cpu(*(__le16*)ea); hpfs_inode->i_ea_mode = 1; } kfree(ea); @@ -95,7 +95,7 @@ void hpfs_read_inode(struct inode *i) if (S_ISBLK(mode) || S_ISCHR(mode)) { if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) { if (ea_size == 4) - rdev = le32_to_cpu(*(u32*)ea); + rdev = le32_to_cpu(*(__le32*)ea); kfree(ea); } } @@ -148,7 +148,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode) we'd better not overwrite them hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino); } else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) { - u32 ea; + __le32 ea; if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) { ea = cpu_to_le32(i->i_uid); hpfs_set_ea(i, fnode, "UID", (char*)&ea, 2); @@ -165,6 +165,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode) && i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333)) | (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) { ea = cpu_to_le32(i->i_mode); + /* sick, but legal */ hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2); hpfs_inode->i_ea_mode = 1; } From 6ca1584173d0320f47464092eb180a17259cc3f9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 14:32:38 -0500 Subject: [PATCH 224/232] [PATCH] smbfs endianness annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/linux/smb_fs.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index 367d6c3e8ed4..13b3af547864 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h @@ -43,17 +43,17 @@ static inline struct smb_inode_info *SMB_I(struct inode *inode) /* macro names are short for word, double-word, long value (?) */ #define WVAL(buf,pos) \ - (le16_to_cpu(get_unaligned((u16 *)((u8 *)(buf) + (pos))))) + (le16_to_cpu(get_unaligned((__le16 *)((u8 *)(buf) + (pos))))) #define DVAL(buf,pos) \ - (le32_to_cpu(get_unaligned((u32 *)((u8 *)(buf) + (pos))))) + (le32_to_cpu(get_unaligned((__le32 *)((u8 *)(buf) + (pos))))) #define LVAL(buf,pos) \ - (le64_to_cpu(get_unaligned((u64 *)((u8 *)(buf) + (pos))))) + (le64_to_cpu(get_unaligned((__le64 *)((u8 *)(buf) + (pos))))) #define WSET(buf,pos,val) \ - put_unaligned(cpu_to_le16((u16)(val)), (u16 *)((u8 *)(buf) + (pos))) + put_unaligned(cpu_to_le16((u16)(val)), (__le16 *)((u8 *)(buf) + (pos))) #define DSET(buf,pos,val) \ - put_unaligned(cpu_to_le32((u32)(val)), (u32 *)((u8 *)(buf) + (pos))) + put_unaligned(cpu_to_le32((u32)(val)), (__le32 *)((u8 *)(buf) + (pos))) #define LSET(buf,pos,val) \ - put_unaligned(cpu_to_le64((u64)(val)), (u64 *)((u8 *)(buf) + (pos))) + put_unaligned(cpu_to_le64((u64)(val)), (__le64 *)((u8 *)(buf) + (pos))) /* where to find the base of the SMB packet proper */ #define smb_base(buf) ((u8 *)(((u8 *)(buf))+4)) From d02d48d8650bf3e2011f25373dbcf87f3c19f16b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 14:33:09 -0500 Subject: [PATCH 225/232] [PATCH] isofs endianness annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/isofs/joliet.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c index 81a90e170ac3..fb8fe7a9ddc6 100644 --- a/fs/isofs/joliet.c +++ b/fs/isofs/joliet.c @@ -14,9 +14,9 @@ * Convert Unicode 16 to UTF-8 or ASCII. */ static int -uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls) +uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls) { - wchar_t *ip, ch; + __be16 *ip, ch; unsigned char *op; ip = uni; @@ -24,8 +24,8 @@ uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls) while ((ch = get_unaligned(ip)) && len) { int llen; - ch = be16_to_cpu(ch); - if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0) + llen = nls->uni2char(be16_to_cpu(ch), op, NLS_MAX_CHARSET_SIZE); + if (llen > 0) op += llen; else *op++ = '?'; @@ -82,7 +82,7 @@ get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, st len = wcsntombs_be(outname, de->name, de->name_len[0] >> 1, PAGE_SIZE); } else { - len = uni16_to_x8(outname, (u16 *) de->name, + len = uni16_to_x8(outname, (__be16 *) de->name, de->name_len[0] >> 1, nls); } if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) { From d136fe7243081a45a141bb297a7b7a627ab60fa9 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 28 Dec 2005 22:27:10 +0300 Subject: [PATCH 226/232] [PATCH] Finish annotations of struct vlan_ethhdr Signed-off-by: Alexey Dobriyan Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- include/linux/if_vlan.h | 2 +- net/8021q/vlan_dev.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index ab2740832742..35cb38573583 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -44,7 +44,7 @@ struct vlan_ethhdr { unsigned char h_source[ETH_ALEN]; /* source ether addr */ __be16 h_vlan_proto; /* Should always be 0x8100 */ __be16 h_vlan_TCI; /* Encapsulates priority and VLAN ID */ - unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */ + __be16 h_vlan_encapsulated_proto; /* packet type ID field (or len) */ }; #include diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index da9cfe927158..60a508eb1945 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -62,7 +62,7 @@ int vlan_dev_rebuild_header(struct sk_buff *skb) default: printk(VLAN_DBG "%s: unable to resolve type %X addresses.\n", - dev->name, (int)veth->h_vlan_encapsulated_proto); + dev->name, ntohs(veth->h_vlan_encapsulated_proto)); memcpy(veth->h_source, dev->dev_addr, ETH_ALEN); break; From 3524de1c7953e7a22c43b9214ffc3680af6f8edb Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 24 Dec 2005 14:39:13 -0500 Subject: [PATCH 227/232] [PATCH] fs/partitions endianness annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/partitions/msdos.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 4f8df71e49d3..8c7af1777819 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c @@ -32,13 +32,11 @@ #include #define SYS_IND(p) (get_unaligned(&p->sys_ind)) -#define NR_SECTS(p) ({ __typeof__(p->nr_sects) __a = \ - get_unaligned(&p->nr_sects); \ +#define NR_SECTS(p) ({ __le32 __a = get_unaligned(&p->nr_sects); \ le32_to_cpu(__a); \ }) -#define START_SECT(p) ({ __typeof__(p->start_sect) __a = \ - get_unaligned(&p->start_sect); \ +#define START_SECT(p) ({ __le32 __a = get_unaligned(&p->start_sect); \ le32_to_cpu(__a); \ }) From 44aa5359be589f9cbe9cf0d5c97e22b27a04c7d3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 13 Aug 2006 01:54:30 -0400 Subject: [PATCH 228/232] [PATCH] ufs endianness annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/ufs/util.c | 14 ++++++-------- include/linux/ufs_fs.h | 10 +++++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/fs/ufs/util.c b/fs/ufs/util.c index 22f820a9b15c..17437574f79c 100644 --- a/fs/ufs/util.c +++ b/fs/ufs/util.c @@ -184,14 +184,13 @@ void _ubh_memcpyubh_(struct ufs_sb_private_info * uspi, dev_t ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi) { - __fs32 fs32; + __u32 fs32; dev_t dev; if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) - fs32 = ufsi->i_u1.i_data[1]; + fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[1]); else - fs32 = ufsi->i_u1.i_data[0]; - fs32 = fs32_to_cpu(sb, fs32); + fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[0]); switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { case UFS_ST_SUNx86: case UFS_ST_SUN: @@ -212,7 +211,7 @@ ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi) void ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev) { - __fs32 fs32; + __u32 fs32; switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { case UFS_ST_SUNx86: @@ -227,11 +226,10 @@ ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev fs32 = old_encode_dev(dev); break; } - fs32 = cpu_to_fs32(sb, fs32); if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) - ufsi->i_u1.i_data[1] = fs32; + ufsi->i_u1.i_data[1] = cpu_to_fs32(sb, fs32); else - ufsi->i_u1.i_data[0] = fs32; + ufsi->i_u1.i_data[0] = cpu_to_fs32(sb, fs32); } /** diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index fc62887c5206..61eef508b041 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -351,6 +351,14 @@ struct ufs2_csum_total { __fs64 cs_spare[3]; /* future expansion */ }; +struct ufs_csum_core { + __u64 cs_ndir; /* number of directories */ + __u64 cs_nbfree; /* number of free blocks */ + __u64 cs_nifree; /* number of free inodes */ + __u64 cs_nffree; /* number of free frags */ + __u64 cs_numclusters; /* number of free clusters */ +}; + /* * File system flags */ @@ -715,7 +723,7 @@ struct ufs_cg_private_info { struct ufs_sb_private_info { struct ufs_buffer_head s_ubh; /* buffer containing super block */ - struct ufs2_csum_total cs_total; + struct ufs_csum_core cs_total; __u32 s_sblkno; /* offset of super-blocks in filesys */ __u32 s_cblkno; /* offset of cg-block in filesys */ __u32 s_iblkno; /* offset of inode-blocks in filesys */ From 107c3a73e0ee037322efa00fa3cb45b3b7eb6069 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 13 Aug 2006 15:38:04 -0400 Subject: [PATCH 229/232] [PATCH] endianness annotations in s2io Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/s2io.h | 322 ++++++++++++++++++++++----------------------- 1 file changed, 161 insertions(+), 161 deletions(-) diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 72f52dc98f53..12b719f4d00f 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h @@ -116,179 +116,179 @@ typedef struct { /* The statistics block of Xena */ typedef struct stat_block { /* Tx MAC statistics counters. */ - u32 tmac_data_octets; - u32 tmac_frms; - u64 tmac_drop_frms; - u32 tmac_bcst_frms; - u32 tmac_mcst_frms; - u64 tmac_pause_ctrl_frms; - u32 tmac_ucst_frms; - u32 tmac_ttl_octets; - u32 tmac_any_err_frms; - u32 tmac_nucst_frms; - u64 tmac_ttl_less_fb_octets; - u64 tmac_vld_ip_octets; - u32 tmac_drop_ip; - u32 tmac_vld_ip; - u32 tmac_rst_tcp; - u32 tmac_icmp; - u64 tmac_tcp; - u32 reserved_0; - u32 tmac_udp; + __le32 tmac_data_octets; + __le32 tmac_frms; + __le64 tmac_drop_frms; + __le32 tmac_bcst_frms; + __le32 tmac_mcst_frms; + __le64 tmac_pause_ctrl_frms; + __le32 tmac_ucst_frms; + __le32 tmac_ttl_octets; + __le32 tmac_any_err_frms; + __le32 tmac_nucst_frms; + __le64 tmac_ttl_less_fb_octets; + __le64 tmac_vld_ip_octets; + __le32 tmac_drop_ip; + __le32 tmac_vld_ip; + __le32 tmac_rst_tcp; + __le32 tmac_icmp; + __le64 tmac_tcp; + __le32 reserved_0; + __le32 tmac_udp; /* Rx MAC Statistics counters. */ - u32 rmac_data_octets; - u32 rmac_vld_frms; - u64 rmac_fcs_err_frms; - u64 rmac_drop_frms; - u32 rmac_vld_bcst_frms; - u32 rmac_vld_mcst_frms; - u32 rmac_out_rng_len_err_frms; - u32 rmac_in_rng_len_err_frms; - u64 rmac_long_frms; - u64 rmac_pause_ctrl_frms; - u64 rmac_unsup_ctrl_frms; - u32 rmac_accepted_ucst_frms; - u32 rmac_ttl_octets; - u32 rmac_discarded_frms; - u32 rmac_accepted_nucst_frms; - u32 reserved_1; - u32 rmac_drop_events; - u64 rmac_ttl_less_fb_octets; - u64 rmac_ttl_frms; - u64 reserved_2; - u32 rmac_usized_frms; - u32 reserved_3; - u32 rmac_frag_frms; - u32 rmac_osized_frms; - u32 reserved_4; - u32 rmac_jabber_frms; - u64 rmac_ttl_64_frms; - u64 rmac_ttl_65_127_frms; - u64 reserved_5; - u64 rmac_ttl_128_255_frms; - u64 rmac_ttl_256_511_frms; - u64 reserved_6; - u64 rmac_ttl_512_1023_frms; - u64 rmac_ttl_1024_1518_frms; - u32 rmac_ip; - u32 reserved_7; - u64 rmac_ip_octets; - u32 rmac_drop_ip; - u32 rmac_hdr_err_ip; - u32 reserved_8; - u32 rmac_icmp; - u64 rmac_tcp; - u32 rmac_err_drp_udp; - u32 rmac_udp; - u64 rmac_xgmii_err_sym; - u64 rmac_frms_q0; - u64 rmac_frms_q1; - u64 rmac_frms_q2; - u64 rmac_frms_q3; - u64 rmac_frms_q4; - u64 rmac_frms_q5; - u64 rmac_frms_q6; - u64 rmac_frms_q7; - u16 rmac_full_q3; - u16 rmac_full_q2; - u16 rmac_full_q1; - u16 rmac_full_q0; - u16 rmac_full_q7; - u16 rmac_full_q6; - u16 rmac_full_q5; - u16 rmac_full_q4; - u32 reserved_9; - u32 rmac_pause_cnt; - u64 rmac_xgmii_data_err_cnt; - u64 rmac_xgmii_ctrl_err_cnt; - u32 rmac_err_tcp; - u32 rmac_accepted_ip; + __le32 rmac_data_octets; + __le32 rmac_vld_frms; + __le64 rmac_fcs_err_frms; + __le64 rmac_drop_frms; + __le32 rmac_vld_bcst_frms; + __le32 rmac_vld_mcst_frms; + __le32 rmac_out_rng_len_err_frms; + __le32 rmac_in_rng_len_err_frms; + __le64 rmac_long_frms; + __le64 rmac_pause_ctrl_frms; + __le64 rmac_unsup_ctrl_frms; + __le32 rmac_accepted_ucst_frms; + __le32 rmac_ttl_octets; + __le32 rmac_discarded_frms; + __le32 rmac_accepted_nucst_frms; + __le32 reserved_1; + __le32 rmac_drop_events; + __le64 rmac_ttl_less_fb_octets; + __le64 rmac_ttl_frms; + __le64 reserved_2; + __le32 rmac_usized_frms; + __le32 reserved_3; + __le32 rmac_frag_frms; + __le32 rmac_osized_frms; + __le32 reserved_4; + __le32 rmac_jabber_frms; + __le64 rmac_ttl_64_frms; + __le64 rmac_ttl_65_127_frms; + __le64 reserved_5; + __le64 rmac_ttl_128_255_frms; + __le64 rmac_ttl_256_511_frms; + __le64 reserved_6; + __le64 rmac_ttl_512_1023_frms; + __le64 rmac_ttl_1024_1518_frms; + __le32 rmac_ip; + __le32 reserved_7; + __le64 rmac_ip_octets; + __le32 rmac_drop_ip; + __le32 rmac_hdr_err_ip; + __le32 reserved_8; + __le32 rmac_icmp; + __le64 rmac_tcp; + __le32 rmac_err_drp_udp; + __le32 rmac_udp; + __le64 rmac_xgmii_err_sym; + __le64 rmac_frms_q0; + __le64 rmac_frms_q1; + __le64 rmac_frms_q2; + __le64 rmac_frms_q3; + __le64 rmac_frms_q4; + __le64 rmac_frms_q5; + __le64 rmac_frms_q6; + __le64 rmac_frms_q7; + __le16 rmac_full_q3; + __le16 rmac_full_q2; + __le16 rmac_full_q1; + __le16 rmac_full_q0; + __le16 rmac_full_q7; + __le16 rmac_full_q6; + __le16 rmac_full_q5; + __le16 rmac_full_q4; + __le32 reserved_9; + __le32 rmac_pause_cnt; + __le64 rmac_xgmii_data_err_cnt; + __le64 rmac_xgmii_ctrl_err_cnt; + __le32 rmac_err_tcp; + __le32 rmac_accepted_ip; /* PCI/PCI-X Read transaction statistics. */ - u32 new_rd_req_cnt; - u32 rd_req_cnt; - u32 rd_rtry_cnt; - u32 new_rd_req_rtry_cnt; + __le32 new_rd_req_cnt; + __le32 rd_req_cnt; + __le32 rd_rtry_cnt; + __le32 new_rd_req_rtry_cnt; /* PCI/PCI-X Write/Read transaction statistics. */ - u32 wr_req_cnt; - u32 wr_rtry_rd_ack_cnt; - u32 new_wr_req_rtry_cnt; - u32 new_wr_req_cnt; - u32 wr_disc_cnt; - u32 wr_rtry_cnt; + __le32 wr_req_cnt; + __le32 wr_rtry_rd_ack_cnt; + __le32 new_wr_req_rtry_cnt; + __le32 new_wr_req_cnt; + __le32 wr_disc_cnt; + __le32 wr_rtry_cnt; /* PCI/PCI-X Write / DMA Transaction statistics. */ - u32 txp_wr_cnt; - u32 rd_rtry_wr_ack_cnt; - u32 txd_wr_cnt; - u32 txd_rd_cnt; - u32 rxd_wr_cnt; - u32 rxd_rd_cnt; - u32 rxf_wr_cnt; - u32 txf_rd_cnt; + __le32 txp_wr_cnt; + __le32 rd_rtry_wr_ack_cnt; + __le32 txd_wr_cnt; + __le32 txd_rd_cnt; + __le32 rxd_wr_cnt; + __le32 rxd_rd_cnt; + __le32 rxf_wr_cnt; + __le32 txf_rd_cnt; /* Tx MAC statistics overflow counters. */ - u32 tmac_data_octets_oflow; - u32 tmac_frms_oflow; - u32 tmac_bcst_frms_oflow; - u32 tmac_mcst_frms_oflow; - u32 tmac_ucst_frms_oflow; - u32 tmac_ttl_octets_oflow; - u32 tmac_any_err_frms_oflow; - u32 tmac_nucst_frms_oflow; - u64 tmac_vlan_frms; - u32 tmac_drop_ip_oflow; - u32 tmac_vld_ip_oflow; - u32 tmac_rst_tcp_oflow; - u32 tmac_icmp_oflow; - u32 tpa_unknown_protocol; - u32 tmac_udp_oflow; - u32 reserved_10; - u32 tpa_parse_failure; + __le32 tmac_data_octets_oflow; + __le32 tmac_frms_oflow; + __le32 tmac_bcst_frms_oflow; + __le32 tmac_mcst_frms_oflow; + __le32 tmac_ucst_frms_oflow; + __le32 tmac_ttl_octets_oflow; + __le32 tmac_any_err_frms_oflow; + __le32 tmac_nucst_frms_oflow; + __le64 tmac_vlan_frms; + __le32 tmac_drop_ip_oflow; + __le32 tmac_vld_ip_oflow; + __le32 tmac_rst_tcp_oflow; + __le32 tmac_icmp_oflow; + __le32 tpa_unknown_protocol; + __le32 tmac_udp_oflow; + __le32 reserved_10; + __le32 tpa_parse_failure; /* Rx MAC Statistics overflow counters. */ - u32 rmac_data_octets_oflow; - u32 rmac_vld_frms_oflow; - u32 rmac_vld_bcst_frms_oflow; - u32 rmac_vld_mcst_frms_oflow; - u32 rmac_accepted_ucst_frms_oflow; - u32 rmac_ttl_octets_oflow; - u32 rmac_discarded_frms_oflow; - u32 rmac_accepted_nucst_frms_oflow; - u32 rmac_usized_frms_oflow; - u32 rmac_drop_events_oflow; - u32 rmac_frag_frms_oflow; - u32 rmac_osized_frms_oflow; - u32 rmac_ip_oflow; - u32 rmac_jabber_frms_oflow; - u32 rmac_icmp_oflow; - u32 rmac_drop_ip_oflow; - u32 rmac_err_drp_udp_oflow; - u32 rmac_udp_oflow; - u32 reserved_11; - u32 rmac_pause_cnt_oflow; - u64 rmac_ttl_1519_4095_frms; - u64 rmac_ttl_4096_8191_frms; - u64 rmac_ttl_8192_max_frms; - u64 rmac_ttl_gt_max_frms; - u64 rmac_osized_alt_frms; - u64 rmac_jabber_alt_frms; - u64 rmac_gt_max_alt_frms; - u64 rmac_vlan_frms; - u32 rmac_len_discard; - u32 rmac_fcs_discard; - u32 rmac_pf_discard; - u32 rmac_da_discard; - u32 rmac_red_discard; - u32 rmac_rts_discard; - u32 reserved_12; - u32 rmac_ingm_full_discard; - u32 reserved_13; - u32 rmac_accepted_ip_oflow; - u32 reserved_14; - u32 link_fault_cnt; + __le32 rmac_data_octets_oflow; + __le32 rmac_vld_frms_oflow; + __le32 rmac_vld_bcst_frms_oflow; + __le32 rmac_vld_mcst_frms_oflow; + __le32 rmac_accepted_ucst_frms_oflow; + __le32 rmac_ttl_octets_oflow; + __le32 rmac_discarded_frms_oflow; + __le32 rmac_accepted_nucst_frms_oflow; + __le32 rmac_usized_frms_oflow; + __le32 rmac_drop_events_oflow; + __le32 rmac_frag_frms_oflow; + __le32 rmac_osized_frms_oflow; + __le32 rmac_ip_oflow; + __le32 rmac_jabber_frms_oflow; + __le32 rmac_icmp_oflow; + __le32 rmac_drop_ip_oflow; + __le32 rmac_err_drp_udp_oflow; + __le32 rmac_udp_oflow; + __le32 reserved_11; + __le32 rmac_pause_cnt_oflow; + __le64 rmac_ttl_1519_4095_frms; + __le64 rmac_ttl_4096_8191_frms; + __le64 rmac_ttl_8192_max_frms; + __le64 rmac_ttl_gt_max_frms; + __le64 rmac_osized_alt_frms; + __le64 rmac_jabber_alt_frms; + __le64 rmac_gt_max_alt_frms; + __le64 rmac_vlan_frms; + __le32 rmac_len_discard; + __le32 rmac_fcs_discard; + __le32 rmac_pf_discard; + __le32 rmac_da_discard; + __le32 rmac_red_discard; + __le32 rmac_rts_discard; + __le32 reserved_12; + __le32 rmac_ingm_full_discard; + __le32 reserved_13; + __le32 rmac_accepted_ip_oflow; + __le32 reserved_14; + __le32 link_fault_cnt; u8 buffer[20]; swStat_t sw_stat; xpakStat_t xpak_stat; From 15e541feb340bc2a4caaf707ee5ad71a47fdd068 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 10 Oct 2006 01:40:55 -0400 Subject: [PATCH 230/232] [PATCH] irda: donauboe fixes, cleanups - fix: toshoboe_invalid_dev() was recently removed, but not all callers were updated, causing the obvious linker error. Remove caller, because the check (like the one removed) isn't used. - fix: propagate request_irq() return value - cleanup: remove void* casts - cleanup: remove impossible ASSERTs Signed-off-by: Jeff Garzik Signed-off-by: Linus Torvalds --- drivers/net/irda/donauboe.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 636d0630fe02..16620bd97fbf 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c @@ -1154,13 +1154,10 @@ dumpbufs(skb->data,skb->len,'>'); static irqreturn_t toshoboe_interrupt (int irq, void *dev_id) { - struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; + struct toshoboe_cb *self = dev_id; __u8 irqstat; struct sk_buff *skb = NULL; - if (self == NULL && toshoboe_invalid_dev(irq)) - return IRQ_NONE; - irqstat = INB (OBOE_ISR); /* was it us */ @@ -1348,13 +1345,11 @@ toshoboe_net_open (struct net_device *dev) { struct toshoboe_cb *self; unsigned long flags; + int rc; IRDA_DEBUG (4, "%s()\n", __FUNCTION__); - IRDA_ASSERT (dev != NULL, return -1; ); - self = (struct toshoboe_cb *) dev->priv; - - IRDA_ASSERT (self != NULL, return 0; ); + self = netdev_priv(dev); if (self->async) return -EBUSY; @@ -1362,11 +1357,10 @@ toshoboe_net_open (struct net_device *dev) if (self->stopped) return 0; - if (request_irq (self->io.irq, toshoboe_interrupt, - IRQF_SHARED | IRQF_DISABLED, dev->name, (void *) self)) - { - return -EAGAIN; - } + rc = request_irq (self->io.irq, toshoboe_interrupt, + IRQF_SHARED | IRQF_DISABLED, dev->name, self); + if (rc) + return rc; spin_lock_irqsave(&self->spinlock, flags); toshoboe_startchip (self); From 0968cf51b6f2ca8a951de4b976370189cf43bbdd Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 10 Oct 2006 02:58:14 -0400 Subject: [PATCH 231/232] [PATCH] firmware/dcdbas: fix bug in error cleanup The error path path mistakenly called sysfs_create_group() rather than sysfs_remove_group(). They take the same arguments, so it's easy to cut-n-paste such a bug. Signed-off-by: Jeff Garzik Signed-off-by: Linus Torvalds --- drivers/firmware/dcdbas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c index 339f405ff708..8bcb58cd4ac0 100644 --- a/drivers/firmware/dcdbas.c +++ b/drivers/firmware/dcdbas.c @@ -559,7 +559,7 @@ static int __devinit dcdbas_probe(struct platform_device *dev) while (--i >= 0) sysfs_remove_bin_file(&dev->dev.kobj, dcdbas_bin_attrs[i]); - sysfs_create_group(&dev->dev.kobj, &dcdbas_attr_group); + sysfs_remove_group(&dev->dev.kobj, &dcdbas_attr_group); return error; } } From 53a5fbdc2dff55161a206ed1a1385a8fa8055c34 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 10 Oct 2006 17:14:44 -0700 Subject: [PATCH 232/232] ACPI: Allow setting SCI_EN bit in PM1_CONTROL register MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed by at least the Mac Mini's, which (incorrectly) come back from suspend with SCI_EN clear. Thanks to Frédéric Riss for hunting this down. Acked-by: Frédéric Riss Cc: Pavel Machek Cc: Len Brown Cc: Arjan van de Ven Signed-off-by: Linus Torvalds --- drivers/acpi/hardware/hwregs.c | 2 -- include/acpi/aclocal.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index 3143f36fcec9..fa58c1edce1e 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c @@ -665,8 +665,6 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) /* * Perform a read first to preserve certain bits (per ACPI spec) - * - * Note: This includes SCI_EN, we never want to change this bit */ status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_CONTROL, diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index a4d0e73d5aca..063c4b54290f 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -708,7 +708,7 @@ struct acpi_bit_register_info { * must be preserved. */ #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ -#define ACPI_PM1_CONTROL_PRESERVED_BITS 0x0201 /* Bit 9, Bit 0 (SCI_EN) */ +#define ACPI_PM1_CONTROL_PRESERVED_BITS 0x0200 /* Bit 9 (whatever) */ /* * Register IDs