diff -Nru a/Makefile b/Makefile --- a/Makefile Sat Apr 19 19:39:07 2003 +++ b/Makefile Tue Apr 22 04:28:40 2003 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 68 -EXTRAVERSION = +EXTRAVERSION = -bk3 # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig --- a/arch/alpha/Kconfig Tue Apr 15 12:43:41 2003 +++ b/arch/alpha/Kconfig Sun Apr 20 12:56:50 2003 @@ -291,7 +291,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -514,7 +514,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -688,7 +688,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -710,7 +710,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -862,7 +862,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -912,7 +912,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c --- a/arch/alpha/kernel/core_irongate.c Tue Feb 18 05:29:57 2003 +++ b/arch/alpha/kernel/core_irongate.c Sun Apr 20 09:14:40 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c --- a/arch/alpha/kernel/irq.c Sat Mar 8 14:50:43 2003 +++ b/arch/alpha/kernel/irq.c Mon Apr 21 10:00:46 2003 @@ -45,7 +45,10 @@ * Special irq handlers. */ -void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } +irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) +{ + return IRQ_NONE; +} /* * Generic no controller code @@ -414,7 +417,7 @@ } int -request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), +request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) { int retval; diff -Nru a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h --- a/arch/alpha/kernel/proto.h Tue Apr 15 10:38:00 2003 +++ b/arch/alpha/kernel/proto.h Mon Apr 21 10:00:46 2003 @@ -1,4 +1,5 @@ #include +#include /* Prototypes of functions used across modules here in this directory. */ @@ -128,7 +129,7 @@ /* extern void reset_for_srm(void); */ /* time.c */ -extern void timer_interrupt(int irq, void *dev, struct pt_regs * regs); +extern irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs); extern void common_init_rtc(void); extern unsigned long est_cycle_freq; diff -Nru a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c --- a/arch/alpha/kernel/setup.c Tue Apr 15 10:58:12 2003 +++ b/arch/alpha/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -32,11 +32,7 @@ #include #include #include - -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif - +#include #ifdef CONFIG_MAGIC_SYSRQ #include #include diff -Nru a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c --- a/arch/alpha/kernel/time.c Thu Apr 3 14:49:57 2003 +++ b/arch/alpha/kernel/time.c Mon Apr 21 10:00:46 2003 @@ -94,7 +94,7 @@ * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -void timer_interrupt(int irq, void *dev, struct pt_regs * regs) +irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs) { unsigned long delta; __u32 now; @@ -139,6 +139,7 @@ } write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } void diff -Nru a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c --- a/arch/alpha/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/alpha/mm/init.c Sat Apr 19 23:22:41 2003 @@ -66,19 +66,9 @@ pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - pte_t *pte; - long timeout = 10; - - retry: - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); - else if (--timeout >= 0) { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - goto retry; - } - return pte; } diff -Nru a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c --- a/arch/alpha/mm/numa.c Tue Feb 18 05:31:01 2003 +++ b/arch/alpha/mm/numa.c Sun Apr 20 09:14:40 2003 @@ -12,9 +12,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif +#include #include #include diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig Tue Apr 15 07:31:47 2003 +++ b/arch/arm/Kconfig Sun Apr 20 12:56:50 2003 @@ -445,7 +445,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -459,7 +459,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -717,7 +717,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -739,7 +739,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -770,7 +770,7 @@ page on the WWW at and the Battery Powered Linux mini-HOWTO, available from - . + . Note that, even if you say N here, Linux on the x86 architecture will issue the hlt instruction if nothing is to be done, thereby @@ -809,7 +809,7 @@ In order to use APM, you will need supporting software. For location and more information, read and the Battery Powered Linux mini-HOWTO, available from - . + . This driver does not spin down disk drives (see the hdparm(8) manpage ("man 8 hdparm") for that), and it doesn't turn off @@ -1063,7 +1063,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S --- a/arch/arm/boot/compressed/head-xscale.S Tue Apr 15 08:12:47 2003 +++ b/arch/arm/boot/compressed/head-xscale.S Mon Apr 21 04:10:46 2003 @@ -35,7 +35,7 @@ mcr p15, 0, r0, c1, c0, 0 #ifdef CONFIG_ARCH_IQ80321 - orr pc, pc, #0xa0000000 + orr pc, pc, #PHYS_OFFSET @ jump to physical memory if we are not there. nop mov r7, #MACH_TYPE_IQ80321 #endif diff -Nru a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c --- a/arch/arm/kernel/process.c Tue Mar 4 16:50:09 2003 +++ b/arch/arm/kernel/process.c Mon Apr 21 15:43:40 2003 @@ -2,7 +2,7 @@ * linux/arch/arm/kernel/process.c * * Copyright (C) 1996-2000 Russell King - Converted to ARM. - * Origional Copyright (C) 1995 Linus Torvalds + * Original Copyright (C) 1995 Linus Torvalds * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff -Nru a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c --- a/arch/arm/kernel/setup.c Tue Mar 4 16:48:44 2003 +++ b/arch/arm/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c --- a/arch/arm/mach-clps711x/fortunet.c Sun Nov 17 07:31:08 2002 +++ b/arch/arm/mach-clps711x/fortunet.c Sun Apr 20 09:14:40 2003 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/arm/mach-iop3xx/iop321-pci.c b/arch/arm/mach-iop3xx/iop321-pci.c --- a/arch/arm/mach-iop3xx/iop321-pci.c Tue Apr 15 08:12:47 2003 +++ b/arch/arm/mach-iop3xx/iop321-pci.c Mon Apr 21 04:16:16 2003 @@ -212,13 +212,13 @@ switch (nr) { case 0: - res[0].start = IOP321_PCI_LOWER_IO + 0x6e000000; - res[0].end = IOP321_PCI_LOWER_IO + 0x6e00ffff; + res[0].start = IOP321_PCI_IO_BASE + 0x6e000000; + res[0].end = IOP321_PCI_IO_BASE + IOP321_PCI_IO_SIZE-1 + 0x6e000000; res[0].name = "PCI IO Primary"; res[0].flags = IORESOURCE_IO; - res[1].start = IOP321_PCI_LOWER_MEM; - res[1].end = IOP321_PCI_LOWER_MEM + IOP321_PCI_WINDOW_SIZE; + res[1].start = IOP321_PCI_MEM_BASE; + res[1].end = IOP321_PCI_MEM_BASE + IOP321_PCI_MEM_SIZE; res[1].name = "PCI Memory Primary"; res[1].flags = IORESOURCE_MEM; break; diff -Nru a/arch/arm/mach-iop3xx/iq80310-time.c b/arch/arm/mach-iop3xx/iq80310-time.c --- a/arch/arm/mach-iop3xx/iq80310-time.c Tue Apr 1 03:16:51 2003 +++ b/arch/arm/mach-iop3xx/iq80310-time.c Mon Apr 21 15:43:40 2003 @@ -101,7 +101,7 @@ * * Since the timer interrupt is cascaded through the CPLD and * the 80312 and the demux code calls do_IRQ, the irq count is - * going to be atleast 2 when we get here and this will cause the + * going to be at least 2 when we get here and this will cause the * kernel to increment the system tick counter even if we're * idle. This causes it to look like there's always 100% system * time, which is not the case. To get around it, we just decrement diff -Nru a/arch/arm/mach-iop3xx/mm-321.c b/arch/arm/mach-iop3xx/mm-321.c --- a/arch/arm/mach-iop3xx/mm-321.c Tue Apr 15 08:12:47 2003 +++ b/arch/arm/mach-iop3xx/mm-321.c Mon Apr 21 15:43:40 2003 @@ -1,7 +1,7 @@ /* * linux/arch/arm/mach-iop3xx/mm.c * - * Low level memory intialization for IOP321 based systems + * Low level memory initialization for IOP321 based systems * * Author: Rory Bolt * Copyright (C) 2002 Rory Bolt @@ -31,7 +31,7 @@ /* virtual physical length type */ /* mem mapped registers */ - { 0xfff00000, 0xffffe000, 0x00002000, MT_DEVICE }, + { IOP321_VIRT_MEM_BASE, IOP321_PHY_MEM_BASE, 0x00002000, MT_DEVICE }, /* PCI IO space */ { 0xfe000000, 0x90000000, 0x00020000, MT_DEVICE } @@ -52,7 +52,7 @@ /* virtual physical length type */ /* on-board devices */ - { 0xfe800000, 0xfe800000, 0x00100000, MT_DEVICE } + { 0xfe800000, IQ80321_UART1, 0x00100000, MT_DEVICE } }; void __init iq80321_map_io(void) diff -Nru a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c --- a/arch/arm/mach-pxa/generic.c Wed Feb 19 05:30:25 2003 +++ b/arch/arm/mach-pxa/generic.c Mon Apr 21 15:43:40 2003 @@ -13,7 +13,7 @@ * * Since this file should be linked before any other machine specific file, * the __initcall() here will be executed first. This serves as default - * initialization stuff for PXA machines which can be overriden later if + * initialization stuff for PXA machines which can be overridden later if * need be. */ #include diff -Nru a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S --- a/arch/arm/mach-pxa/sleep.S Tue Jul 16 13:04:42 2002 +++ b/arch/arm/mach-pxa/sleep.S Mon Apr 21 15:43:40 2003 @@ -95,7 +95,7 @@ * This is to allow sleep_save_sp to be accessed with a relative load * while we can't rely on any MMU translation. We could have put * sleep_save_sp in the .text section as well, but some setups might - * insist on it to be truely read-only. + * insist on it to be truly read-only. */ .data diff -Nru a/arch/arm/mach-sa1100/sleep.S b/arch/arm/mach-sa1100/sleep.S --- a/arch/arm/mach-sa1100/sleep.S Wed Jul 10 09:01:31 2002 +++ b/arch/arm/mach-sa1100/sleep.S Mon Apr 21 15:43:40 2003 @@ -171,7 +171,7 @@ * This is to allow sleep_save_sp to be accessed with a relative load * while we can't rely on any MMU translation. We could have put * sleep_save_sp in the .text section as well, but some setups might - * insist on it to be truely read-only. + * insist on it to be truly read-only. */ .data diff -Nru a/arch/arm/mm/discontig.c b/arch/arm/mm/discontig.c --- a/arch/arm/mm/discontig.c Mon Nov 11 05:21:09 2002 +++ b/arch/arm/mm/discontig.c Mon Apr 21 15:43:41 2003 @@ -20,7 +20,7 @@ #endif /* - * Our node_data structure for discontigous memory. + * Our node_data structure for discontiguous memory. */ static bootmem_data_t node_bootmem_data[NR_NODES]; diff -Nru a/arch/arm/mm/init.c b/arch/arm/mm/init.c --- a/arch/arm/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/arm/mm/init.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/cris/Kconfig b/arch/cris/Kconfig --- a/arch/cris/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/cris/Kconfig Sun Apr 20 12:56:50 2003 @@ -40,7 +40,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -615,7 +615,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -667,7 +667,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/cris/drivers/Kconfig b/arch/cris/drivers/Kconfig --- a/arch/cris/drivers/Kconfig Sun Feb 9 17:29:49 2003 +++ b/arch/cris/drivers/Kconfig Sun Apr 20 12:56:50 2003 @@ -30,7 +30,7 @@ If your Linux machine will be connected to an Ethernet and you have an Ethernet network interface card (NIC) installed in your computer, say Y here and read the Ethernet-HOWTO, available from - . You will then also have + . You will then also have to say Y to the driver for your particular NIC. Note that the answer to this question won't directly affect the @@ -392,7 +392,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -485,7 +485,7 @@ topics, is contained in . For detailed information about hard drives, consult the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . + . To fine-tune ATA/IDE drive/interface parameters for improved performance, look for the hdparm package at diff -Nru a/arch/h8300/Kconfig b/arch/h8300/Kconfig --- a/arch/h8300/Kconfig Thu Apr 17 12:30:45 2003 +++ b/arch/h8300/Kconfig Sun Apr 20 12:56:51 2003 @@ -181,7 +181,7 @@ telephone line with a modem either via UUCP (UUCP is a protocol to forward mail and news between unix hosts over telephone lines; read the UUCP-HOWTO, available from - ) or dialing up a shell + ) or dialing up a shell account or a BBS, even using term (term is a program which gives you almost full Internet connectivity if you have a regular dial up shell account on some Internet connected Unix computer. Read @@ -201,7 +201,7 @@ Make sure to read the NET-3-HOWTO. Eventually, you will have to read Olaf Kirch's excellent and free book "Network Administrator's - Guide", to be found in . If + Guide", to be found in . If unsure, say Y. endmenu diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig --- a/arch/i386/Kconfig Fri Apr 4 07:22:18 2003 +++ b/arch/i386/Kconfig Mon Apr 21 16:31:29 2003 @@ -183,7 +183,7 @@ optimizations. config MPENTIUMIII - bool "Pentium-III/Celeron(Coppermine)" + bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon" help Select this for Intel chips based on the Pentium-III and Celeron-Coppermine core. This option enables use of some @@ -191,7 +191,7 @@ extensions. config MPENTIUM4 - bool "Pentium-4/Celeron(P4-based)" + bool "Pentium-4/Celeron(P4-based)/Xeon" help Select this for Intel Pentium 4 chips. This includes both the Pentium 4 and P4-based Celeron chips. This option @@ -409,7 +409,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -790,7 +790,7 @@ page on the WWW at and the Battery Powered Linux mini-HOWTO, available from - . + . Note that, even if you say N here, Linux on the x86 architecture will issue the hlt instruction if nothing is to be done, thereby @@ -847,7 +847,7 @@ In order to use APM, you will need supporting software. For location and more information, read and the Battery Powered Linux mini-HOWTO, available from - . + . This driver does not spin down disk drives (see the hdparm(8) manpage ("man 8 hdparm") for that), and it doesn't turn off @@ -1000,7 +1000,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -1203,7 +1203,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -1225,7 +1225,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -1341,7 +1341,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -1412,7 +1412,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c --- a/arch/i386/kernel/i8259.c Mon Mar 3 13:11:24 2003 +++ b/arch/i386/kernel/i8259.c Sun Apr 20 14:14:28 2003 @@ -325,15 +325,16 @@ * =PC9800NOTE= In NEC PC-9800, we use irq8 instead of irq13! */ -static void math_error_irq(int cpl, void *dev_id, struct pt_regs *regs) +static irqreturn_t math_error_irq(int cpl, void *dev_id, struct pt_regs *regs) { extern void math_error(void *); #ifndef CONFIG_X86_PC9800 outb(0,0xF0); #endif if (ignore_fpu_irq || !boot_cpu_data.hard_math) - return; + return IRQ_NONE; math_error((void *)regs->eip); + return IRQ_HANDLED; } /* diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c --- a/arch/i386/kernel/io_apic.c Mon Apr 14 16:09:21 2003 +++ b/arch/i386/kernel/io_apic.c Sun Apr 20 16:00:22 2003 @@ -1117,7 +1117,7 @@ if (current_vector == SYSCALL_VECTOR) goto next; - if (current_vector > FIRST_SYSTEM_VECTOR) { + if (current_vector >= FIRST_SYSTEM_VECTOR) { offset = (offset + 1) & 7; current_vector = FIRST_DEVICE_VECTOR + offset; } diff -Nru a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c --- a/arch/i386/kernel/irq.c Thu Mar 20 03:11:45 2003 +++ b/arch/i386/kernel/irq.c Mon Apr 21 23:05:36 2003 @@ -74,7 +74,8 @@ * Special irq handlers. */ -void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } +irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) +{ return IRQ_NONE; } /* * Generic no controller code @@ -205,18 +206,31 @@ int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action) { int status = 1; /* Force the "do bottom halves" bit */ + int retval = 0; if (!(action->flags & SA_INTERRUPT)) local_irq_enable(); do { status |= action->flags; - action->handler(irq, action->dev_id, regs); + retval |= action->handler(irq, action->dev_id, regs); action = action->next; } while (action); if (status & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); local_irq_disable(); + if (retval != 1) { + static int count = 100; + if (count) { + count--; + printk(retval + ? "irq event %d: bogus retval mask %x\n" + : "irq %d: nobody cared!\n", + irq, + retval); + dump_stack(); + } + } return status; } @@ -447,7 +461,7 @@ */ int request_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) diff -Nru a/arch/i386/kernel/module.c b/arch/i386/kernel/module.c --- a/arch/i386/kernel/module.c Mon Jan 13 09:46:25 2003 +++ b/arch/i386/kernel/module.c Mon Apr 21 12:07:27 2003 @@ -104,9 +104,22 @@ return -ENOEXEC; } +extern void apply_alternatives(void *start, void *end); + int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { + Elf_Shdr *s; + char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; + + /* look for .altinstructions to patch */ + for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { + void *seg; + if (strcmp(".altinstructions", secstrings + s->sh_name)) + continue; + seg = (void *)s->sh_addr; + apply_alternatives(seg, seg + s->sh_size); + } return 0; } diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c Thu Apr 17 12:05:47 2003 +++ b/arch/i386/kernel/setup.c Mon Apr 21 14:58:20 2003 @@ -29,9 +29,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include @@ -796,6 +794,63 @@ if (low_mem_size > pci_mem_start) pci_mem_start = low_mem_size; } + +/* Replace instructions with better alternatives for this CPU type. + + This runs before SMP is initialized to avoid SMP problems with + self modifying code. This implies that assymetric systems where + APs have less capabilities than the boot processor are not handled. + + In this case boot with "noreplacement". */ +void __init apply_alternatives(void *start, void *end) +{ + struct alt_instr *a; + int diff, i, k; + + for (a = start; a < end; + a = (void *)ALIGN((unsigned long)(a + 1) + a->instrlen, 4)) { + if (!boot_cpu_has(a->cpuid)) + continue; + BUG_ON(a->replacementlen > a->instrlen); + memcpy(a->instr, a->replacement, a->replacementlen); + diff = a->instrlen - a->replacementlen; + for (i = a->replacementlen; diff > 0; diff -= k, i += k) { + static const char *nops[] = { + 0, + "\x90", +#if CONFIG_MK7 || CONFIG_MK8 + "\x66\x90", + "\x66\x66\x90", + "\x66\x66\x66\x90", +#else + "\x89\xf6", + "\x8d\x76\x00", + "\x8d\x74\x26\x00", +#endif + }; + k = min_t(int, diff, ARRAY_SIZE(nops)); + memcpy(a->instr + i, nops[k], k); + } + } +} + +static int no_replacement __initdata = 0; + +void __init alternative_instructions(void) +{ + extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; + if (no_replacement) + return; + apply_alternatives(__alt_instructions, __alt_instructions_end); +} + +static int __init noreplacement_setup(char *s) +{ + no_replacement = 1; + return 0; +} + +__setup("noreplacement", noreplacement_setup); void __init setup_arch(char **cmdline_p) { diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c --- a/arch/i386/kernel/time.c Mon Apr 7 16:40:21 2003 +++ b/arch/i386/kernel/time.c Sun Apr 20 14:47:44 2003 @@ -124,15 +124,28 @@ * made, and then undo it! */ tv->tv_usec -= timer->get_offset(); - tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ); + tv->tv_usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ); while (tv->tv_usec < 0) { - tv->tv_usec += 1000000; + tv->tv_usec += USEC_PER_SEC; tv->tv_sec--; } + tv->tv_usec *= NSEC_PER_USEC; + + wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec; + wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_usec; + + if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) { + wall_to_monotonic.tv_nsec -= NSEC_PER_SEC; + wall_to_monotonic.tv_sec++; + } + if (wall_to_monotonic.tv_nsec < 0) { + wall_to_monotonic.tv_nsec += NSEC_PER_SEC; + wall_to_monotonic.tv_sec--; + } xtime.tv_sec = tv->tv_sec; - xtime.tv_nsec = (tv->tv_usec * 1000); + xtime.tv_nsec = tv->tv_usec; time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; @@ -228,46 +241,11 @@ } /* - * Lost tick detection and compensation - */ -static inline void detect_lost_tick(void) -{ - /* read time since last interrupt */ - unsigned long delta = timer->get_offset(); - static unsigned long dbg_print; - - /* check if delta is greater then two ticks */ - if(delta >= 2*(1000000/HZ)){ - - /* - * only print debug info first 5 times - */ - /* - * AKPM: disable this for now; it's nice, but irritating. - */ - if (0 && dbg_print < 5) { - printk(KERN_WARNING "\nWarning! Detected %lu " - "micro-second gap between interrupts.\n", - delta); - printk(KERN_WARNING " Compensating for %lu lost " - "ticks.\n", - delta/(1000000/HZ)-1); - dump_stack(); - dbg_print++; - } - /* calculate number of missed ticks */ - delta = delta/(1000000/HZ)-1; - jiffies += delta; - } - -} - -/* * This is the same as the above, except we _also_ save the current * Time Stamp Counter value at the time of the timer interrupt, so that * we later on can estimate the time of day more exactly. */ -void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* * Here we are in the timer irq handler. We just have irqs locally @@ -278,13 +256,12 @@ */ write_seqlock(&xtime_lock); - detect_lost_tick(); timer->mark_offset(); do_timer_interrupt(irq, NULL, regs); write_sequnlock(&xtime_lock); - + return IRQ_HANDLED; } /* not static: needed by APM */ @@ -322,7 +299,9 @@ { xtime.tv_sec = get_cmos_time(); - xtime.tv_nsec = 0; + wall_to_monotonic.tv_sec = -xtime.tv_sec + INITIAL_JIFFIES / HZ; + xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); + wall_to_monotonic.tv_nsec = 0; timer = select_timer(); diff -Nru a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c --- a/arch/i386/kernel/timers/timer_cyclone.c Mon Mar 31 08:03:54 2003 +++ b/arch/i386/kernel/timers/timer_cyclone.c Sat Apr 19 23:22:28 2003 @@ -18,6 +18,7 @@ #include extern spinlock_t i8253_lock; +extern unsigned long jiffies; extern unsigned long calibrate_tsc(void); /* Number of usecs that the last interrupt was delayed */ @@ -46,6 +47,8 @@ static void mark_offset_cyclone(void) { + unsigned long lost, delay; + unsigned long delta = last_cyclone_low; int count; unsigned long long this_offset, last_offset; @@ -62,6 +65,15 @@ count |= inb(0x40) << 8; spin_unlock(&i8253_lock); + /* lost tick compensation */ + delta = last_cyclone_low - delta; + delta /=(CYCLONE_TIMER_FREQ/1000000); + delta += delay_at_last_interrupt; + lost = delta/(1000000/HZ); + delay = delta%(1000000/HZ); + if(lost >= 2) + jiffies += lost-1; + /* update the monotonic base value */ this_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low; monotonic_base += (this_offset - last_offset) & CYCLONE_TIMER_MASK; @@ -70,6 +82,12 @@ /* calculate delay_at_last_interrupt */ count = ((LATCH-1) - count) * TICK_SIZE; delay_at_last_interrupt = (count + LATCH/2) / LATCH; + + /* catch corner case where tick rollover + * occured between cyclone and pit reads + */ + if(abs(delay - delay_at_last_interrupt) > 900) + jiffies++; } static unsigned long get_offset_cyclone(void) diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c --- a/arch/i386/kernel/timers/timer_pit.c Mon Apr 7 16:40:44 2003 +++ b/arch/i386/kernel/timers/timer_pit.c Sat Apr 19 23:22:27 2003 @@ -54,7 +54,7 @@ } -/* This function must be called with interrupts disabled +/* This function must be called with xtime_lock held. * It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs * * However, the pc-audio speaker driver changes the divisor so that @@ -93,7 +93,7 @@ static unsigned long jiffies_p = 0; /* - * cache volatile jiffies temporarily; we have IRQs turned off. + * cache volatile jiffies temporarily; we have xtime_lock. */ unsigned long jiffies_t; @@ -119,8 +119,6 @@ count = LATCH - 1; } - spin_unlock_irqrestore(&i8253_lock, flags); - /* * avoiding timer inconsistencies (they are rare, but they happen)... * there are two kinds of problems that must be avoided here: @@ -130,7 +128,6 @@ * (see c't 95/10 page 335 for Neptun bug.) */ - if( jiffies_t == jiffies_p ) { if( count > count_p ) { /* the nutcase */ @@ -140,6 +137,8 @@ jiffies_p = jiffies_t; count_p = count; + + spin_unlock_irqrestore(&i8253_lock, flags); count = ((LATCH-1) - count) * TICK_SIZE; count = (count + LATCH/2) / LATCH; diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c --- a/arch/i386/kernel/timers/timer_tsc.c Thu Apr 17 12:40:54 2003 +++ b/arch/i386/kernel/timers/timer_tsc.c Sat Apr 19 23:22:28 2003 @@ -21,6 +21,7 @@ int tsc_disable __initdata = 0; extern spinlock_t i8253_lock; +extern unsigned long jiffies; static int use_tsc; /* Number of usecs that the last interrupt was delayed */ @@ -117,6 +118,8 @@ static void mark_offset_tsc(void) { + unsigned long lost,delay; + unsigned long delta = last_tsc_low; int count; int countmp; static int count1 = 0; @@ -161,6 +164,23 @@ } } + /* lost tick compensation */ + delta = last_tsc_low - delta; + { + register unsigned long eax, edx; + eax = delta; + __asm__("mull %2" + :"=a" (eax), "=d" (edx) + :"rm" (fast_gettimeoffset_quotient), + "0" (eax)); + delta = edx; + } + delta += delay_at_last_interrupt; + lost = delta/(1000000/HZ); + delay = delta%(1000000/HZ); + if(lost >= 2) + jiffies += lost-1; + /* update the monotonic base value */ this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; monotonic_base += cycles_2_ns(this_offset - last_offset); @@ -169,6 +189,12 @@ /* calculate delay_at_last_interrupt */ count = ((LATCH-1) - count) * TICK_SIZE; delay_at_last_interrupt = (count + LATCH/2) / LATCH; + + /* catch corner case where tick rollover + * occured between tsc and pit reads + */ + if(abs(delay - delay_at_last_interrupt) > 900) + jiffies++; } static void delay_tsc(unsigned long loops) diff -Nru a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c --- a/arch/i386/kernel/vm86.c Thu Apr 3 07:48:45 2003 +++ b/arch/i386/kernel/vm86.c Sun Apr 20 14:14:28 2003 @@ -695,7 +695,8 @@ | (1 << SIGUSR1) | (1 << SIGUSR2) | (1 << SIGIO) | (1 << SIGURG) \ | (1 << SIGUNUSED) ) -static void irq_handler(int intno, void *dev_id, struct pt_regs * regs) { +static irqreturn_t irq_handler(int intno, void *dev_id, struct pt_regs * regs) +{ int irq_bit; unsigned long flags; @@ -709,6 +710,7 @@ /* else user will poll for IRQs */ out: spin_unlock_irqrestore(&irqbits_lock, flags); + return IRQ_NONE; } static inline void free_vm86_irq(int irqnumber) @@ -742,7 +744,10 @@ bit = irqbits & (1 << irqnumber); irqbits &= ~bit; spin_unlock_irqrestore(&irqbits_lock, flags); - return bit; + if (!bit) + return 0; + enable_irq(irqnumber); + return 1; } diff -Nru a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c --- a/arch/i386/mm/discontig.c Tue Mar 4 23:41:55 2003 +++ b/arch/i386/mm/discontig.c Sun Apr 20 09:14:40 2003 @@ -27,9 +27,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include diff -Nru a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c --- a/arch/i386/mm/hugetlbpage.c Mon Feb 24 23:13:11 2003 +++ b/arch/i386/mm/hugetlbpage.c Sat Apr 19 23:22:35 2003 @@ -129,37 +129,45 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, struct page **pages, struct vm_area_struct **vmas, - unsigned long *st, int *length, int i) + unsigned long *position, int *length, int i) { - pte_t *ptep, pte; - unsigned long start = *st; - unsigned long pstart; - int len = *length; - struct page *page; + unsigned long vpfn, vaddr = *position; + int remainder = *length; + + WARN_ON(!is_vm_hugetlb_page(vma)); - do { - pstart = start; - ptep = huge_pte_offset(mm, start); - pte = *ptep; + vpfn = vaddr/PAGE_SIZE; + while (vaddr < vma->vm_end && remainder) { -back1: - page = pte_page(pte); if (pages) { - page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT); + pte_t *pte; + struct page *page; + + pte = huge_pte_offset(mm, vaddr); + + /* hugetlb should be locked, and hence, prefaulted */ + WARN_ON(!pte || pte_none(*pte)); + + page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)]; + + WARN_ON(!PageCompound(page)); + get_page(page); pages[i] = page; } + if (vmas) vmas[i] = vma; - i++; - len--; - start += PAGE_SIZE; - if (((start & HPAGE_MASK) == pstart) && len && - (start < vma->vm_end)) - goto back1; - } while (len && start < vma->vm_end); - *length = len; - *st = start; + + vaddr += PAGE_SIZE; + ++vpfn; + --remainder; + ++i; + } + + *length = remainder; + *position = vaddr; + return i; } @@ -474,9 +482,7 @@ int is_hugepage_mem_enough(size_t size) { - if (size > (htlbpagemem << HPAGE_SHIFT)) - return 0; - return 1; + return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpagemem; } /* diff -Nru a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c --- a/arch/i386/mm/pgtable.c Thu Mar 6 08:19:03 2003 +++ b/arch/i386/mm/pgtable.c Sat Apr 19 23:22:41 2003 @@ -131,39 +131,23 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - int count = 0; - pte_t *pte; - - do { - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte) + clear_page(pte); return pte; } struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - int count = 0; struct page *pte; - - do { + #if CONFIG_HIGHPTE - pte = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, 0); + pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0); #else - pte = alloc_pages(GFP_KERNEL, 0); + pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); #endif - if (pte) - clear_highpage(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + if (pte) + clear_highpage(pte); return pte; } diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c --- a/arch/i386/pci/irq.c Fri Mar 7 19:36:28 2003 +++ b/arch/i386/pci/irq.c Sun Apr 20 14:14:28 2003 @@ -560,8 +560,9 @@ return NULL; } -static void pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs) { + return IRQ_NONE; } static int pcibios_lookup_irq(struct pci_dev *dev, int assign) diff -Nru a/arch/i386/vmlinux.lds.S b/arch/i386/vmlinux.lds.S --- a/arch/i386/vmlinux.lds.S Wed Apr 2 00:42:56 2003 +++ b/arch/i386/vmlinux.lds.S Sun Apr 20 12:24:22 2003 @@ -81,6 +81,10 @@ __con_initcall_start = .; .con_initcall.init : { *(.con_initcall.init) } __con_initcall_end = .; + . = ALIGN(4); + __alt_instructions = .; + .altinstructions : { *(.altinstructions) } + __alt_instructions_end = .; . = ALIGN(4096); __initramfs_start = .; .init.ramfs : { *(.init.ramfs) } diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig Tue Apr 8 12:03:12 2003 +++ b/arch/ia64/Kconfig Sun Apr 20 12:56:50 2003 @@ -280,7 +280,7 @@ page on the WWW at and the Battery Powered Linux mini-HOWTO, available from - . + . Note that, even if you say N here, Linux on the x86 architecture will issue the hlt instruction if nothing is to be done, thereby @@ -425,7 +425,7 @@ See also the , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -497,7 +497,7 @@ systems. Saying Y here will enable your kernel to run ELF binaries. Information about ELF is contained in the ELF HOWTO available from - . + . config BINFMT_MISC tristate "Kernel support for MISC binaries" @@ -535,7 +535,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -684,7 +684,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -762,7 +762,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c --- a/arch/ia64/ia32/sys_ia32.c Wed Apr 9 11:51:34 2003 +++ b/arch/ia64/ia32/sys_ia32.c Sat Apr 19 23:22:56 2003 @@ -3040,7 +3040,6 @@ #define ca32_svc u.u32_svc #define ca32_client u.u32_client #define ca32_export u.u32_export -#define ca32_authd u.u32_authd #define ca32_debug u.u32_debug }; diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c --- a/arch/ia64/kernel/setup.c Wed Feb 12 00:11:32 2003 +++ b/arch/ia64/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -41,10 +42,6 @@ #include #include #include - -#ifdef CONFIG_BLK_DEV_RAM -# include -#endif #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE) # error "struct cpuinfo_ia64 too big!" diff -Nru a/arch/m68k/Kconfig b/arch/m68k/Kconfig --- a/arch/m68k/Kconfig Thu Feb 27 08:02:04 2003 +++ b/arch/m68k/Kconfig Sun Apr 20 12:56:50 2003 @@ -65,7 +65,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -106,7 +106,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -413,7 +413,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -435,7 +435,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -592,7 +592,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -741,7 +741,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -776,7 +776,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -809,7 +809,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -1084,7 +1084,7 @@ This is the NCR 5380 SCSI controller included on most of the 68030 based Macintoshes. If you have one of these say Y and read the SCSI-HOWTO, available from - . + . config SCSI_MAC_ESP tristate "Macintosh NCR53c9[46] SCSI" @@ -1093,7 +1093,7 @@ This is the NCR 53c9x SCSI controller found on most of the 68040 based Macintoshes. If you have one of these say Y and read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1201,7 +1201,7 @@ Say Y here if you have dumb serial boards other than the four standard COM 1/2/3/4 ports. This may happen if you have an AST FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available - from ), or other custom + from ), or other custom serial port hardware which acts similar to standard serial port hardware. If you only use the standard COM 1/2/3/4 ports, you can say N here to save some memory. You can also say Y if you have an diff -Nru a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c --- a/arch/m68k/kernel/setup.c Fri Jan 3 07:55:43 2003 +++ b/arch/m68k/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -39,10 +40,6 @@ #ifdef CONFIG_SUN3X #include extern void sun_serial_setup(void); -#endif - -#ifdef CONFIG_BLK_DEV_INITRD -#include #endif unsigned long m68k_machtype; diff -Nru a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig --- a/arch/m68knommu/Kconfig Wed Mar 5 15:33:01 2003 +++ b/arch/m68knommu/Kconfig Sun Apr 20 12:56:50 2003 @@ -563,7 +563,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -635,7 +635,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig --- a/arch/mips/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/mips/Kconfig Sun Apr 20 12:56:50 2003 @@ -35,7 +35,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -363,7 +363,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -740,7 +740,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -762,7 +762,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -931,7 +931,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -1083,7 +1083,7 @@ Although PS/2 mice are not technically bus mice, they are explained in detail in the Busmouse-HOWTO, available from - . + . When using a PS/2 mouse, you can get problems if you want to use the mouse both on the Linux console and under X. Using the "-R" option @@ -1102,7 +1102,7 @@ MouseSystem or Microsoft mouse (made by Logitech) that plugs into a COM port (rectangular with 9 or 25 pins). These people say N here. If you have something else, read the Busmouse-HOWTO, available from - . This HOWTO contains + . This HOWTO contains information about all non-serial mice, not just bus mice. If you have a laptop, you either have to check the documentation or @@ -1139,7 +1139,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c --- a/arch/mips/gt64120/momenco_ocelot/setup.c Fri May 3 05:28:15 2002 +++ b/arch/mips/gt64120/momenco_ocelot/setup.c Sun Apr 20 09:14:40 2003 @@ -60,7 +60,7 @@ #include #include #include -#include +#include #include #include "ocelot_pld.h" diff -Nru a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c --- a/arch/mips/kernel/setup.c Tue Feb 25 02:42:13 2003 +++ b/arch/mips/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/mips64/Kconfig b/arch/mips64/Kconfig --- a/arch/mips64/Kconfig Sat Mar 8 21:41:49 2003 +++ b/arch/mips64/Kconfig Sun Apr 20 12:56:50 2003 @@ -113,7 +113,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -145,7 +145,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -350,7 +350,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -392,7 +392,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -520,7 +520,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -594,7 +594,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/mips64/mm/init.c b/arch/mips64/mm/init.c --- a/arch/mips64/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/mips64/mm/init.c Sun Apr 20 09:14:40 2003 @@ -21,9 +21,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif +#include #include #include diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig --- a/arch/parisc/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/parisc/Kconfig Sun Apr 20 12:56:50 2003 @@ -136,7 +136,7 @@ See also the , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -184,7 +184,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -206,7 +206,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -309,7 +309,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c --- a/arch/parisc/kernel/setup.c Sun Jan 5 03:16:46 2003 +++ b/arch/parisc/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -29,7 +29,7 @@ #include #include -#include /* for initrd_start and initrd_end */ +#include #include #include #include diff -Nru a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c --- a/arch/parisc/kernel/sys_parisc32.c Tue Apr 15 22:48:20 2003 +++ b/arch/parisc/kernel/sys_parisc32.c Sat Apr 19 23:22:56 2003 @@ -1131,7 +1131,7 @@ struct nfsctl_export32 { char ex_client[NFSCLNT_IDMAX+1]; char ex_path[NFS_MAXPATHLEN+1]; - __kernel_dev_t ex_dev; + __kernel_old_dev_t ex_dev; compat_ino_t ex_ino; int ex_flags; __kernel_uid_t ex_anon_uid; diff -Nru a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c --- a/arch/parisc/mm/init.c Sun Mar 2 18:13:32 2003 +++ b/arch/parisc/mm/init.c Sun Apr 20 09:14:40 2003 @@ -15,7 +15,7 @@ #include #include #include /* for hppa_dma_ops and pcxl_dma_ops */ -#include /* for initrd_start and initrd_end */ +#include #include #include diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig --- a/arch/ppc/Kconfig Wed Mar 26 22:00:59 2003 +++ b/arch/ppc/Kconfig Sun Apr 20 12:56:50 2003 @@ -808,7 +808,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -1444,7 +1444,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c --- a/arch/ppc/kernel/setup.c Fri Feb 14 01:58:30 2003 +++ b/arch/ppc/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c --- a/arch/ppc/mm/init.c Sat Mar 15 03:34:49 2003 +++ b/arch/ppc/mm/init.c Sun Apr 20 09:14:40 2003 @@ -28,9 +28,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include /* for initrd_* */ -#endif +#include #include #include diff -Nru a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c --- a/arch/ppc/mm/pgtable.c Sat Jan 4 00:44:11 2003 +++ b/arch/ppc/mm/pgtable.c Sat Apr 19 23:22:41 2003 @@ -76,15 +76,11 @@ extern void *early_get_page(void); int timeout = 0; - if (mem_init_done) { - while ((pte = (pte_t *) __get_free_page(GFP_KERNEL)) == NULL - && ++timeout < 10) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ); - } - } else - pte = (pte_t *) early_get_page(); - if (pte != NULL) + if (mem_init_done) + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + else + pte = (pte_t *)early_get_page(); + if (pte) clear_page(pte); return pte; } @@ -92,20 +88,16 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { struct page *pte; - int timeout = 0; + #ifdef CONFIG_HIGHPTE - int flags = GFP_KERNEL | __GFP_HIGHMEM; + int flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT; #else - int flags = GFP_KERNEL; + int flags = GFP_KERNEL | __GFP_REPEAT; #endif - while ((pte = alloc_pages(flags, 0)) == NULL) { - if (++timeout >= 10) - return NULL; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ); - } - clear_highpage(pte); + pte = alloc_pages(flags, 0); + if (pte) + clear_highpage(pte); return pte; } diff -Nru a/arch/ppc/platforms/4xx/oak_setup.c b/arch/ppc/platforms/4xx/oak_setup.c --- a/arch/ppc/platforms/4xx/oak_setup.c Mon Jan 6 03:43:48 2003 +++ b/arch/ppc/platforms/4xx/oak_setup.c Sun Apr 20 09:14:41 2003 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/ppc/platforms/adir_setup.c b/arch/ppc/platforms/adir_setup.c --- a/arch/ppc/platforms/adir_setup.c Sat Jan 4 03:26:31 2003 +++ b/arch/ppc/platforms/adir_setup.c Sun Apr 20 09:14:40 2003 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c --- a/arch/ppc/platforms/apus_setup.c Sun Sep 15 21:52:01 2002 +++ b/arch/ppc/platforms/apus_setup.c Sun Apr 20 09:14:40 2003 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include /* Needs INITSERIAL call in head.S! */ diff -Nru a/arch/ppc/platforms/ev64260_setup.c b/arch/ppc/platforms/ev64260_setup.c --- a/arch/ppc/platforms/ev64260_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/ev64260_setup.c Sun Apr 20 09:14:40 2003 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/gemini_setup.c b/arch/ppc/platforms/gemini_setup.c --- a/arch/ppc/platforms/gemini_setup.c Mon Dec 30 04:29:15 2002 +++ b/arch/ppc/platforms/gemini_setup.c Sun Apr 20 09:14:40 2003 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/k2_setup.c b/arch/ppc/platforms/k2_setup.c --- a/arch/ppc/platforms/k2_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/k2_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/lopec_setup.c b/arch/ppc/platforms/lopec_setup.c --- a/arch/ppc/platforms/lopec_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/lopec_setup.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/ppc/platforms/mcpn765_setup.c b/arch/ppc/platforms/mcpn765_setup.c --- a/arch/ppc/platforms/mcpn765_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/mcpn765_setup.c Sun Apr 20 09:14:40 2003 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/menf1_setup.c b/arch/ppc/platforms/menf1_setup.c --- a/arch/ppc/platforms/menf1_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/menf1_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/mvme5100_setup.c b/arch/ppc/platforms/mvme5100_setup.c --- a/arch/ppc/platforms/mvme5100_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/mvme5100_setup.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pal4_setup.c b/arch/ppc/platforms/pal4_setup.c --- a/arch/ppc/platforms/pal4_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/pal4_setup.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pcore_setup.c b/arch/ppc/platforms/pcore_setup.c --- a/arch/ppc/platforms/pcore_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/pcore_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c --- a/arch/ppc/platforms/pmac_setup.c Wed Mar 26 22:00:59 2003 +++ b/arch/ppc/platforms/pmac_setup.c Sun Apr 20 09:14:40 2003 @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/powerpmc250.c b/arch/ppc/platforms/powerpmc250.c --- a/arch/ppc/platforms/powerpmc250.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/powerpmc250.c Sun Apr 20 09:14:40 2003 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pplus_setup.c b/arch/ppc/platforms/pplus_setup.c --- a/arch/ppc/platforms/pplus_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/pplus_setup.c Sun Apr 20 09:14:40 2003 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c --- a/arch/ppc/platforms/prep_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/prep_setup.c Sun Apr 20 09:14:40 2003 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/prpmc750_setup.c b/arch/ppc/platforms/prpmc750_setup.c --- a/arch/ppc/platforms/prpmc750_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/prpmc750_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/prpmc800_setup.c b/arch/ppc/platforms/prpmc800_setup.c --- a/arch/ppc/platforms/prpmc800_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/prpmc800_setup.c Sun Apr 20 09:14:40 2003 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/sandpoint_setup.c b/arch/ppc/platforms/sandpoint_setup.c --- a/arch/ppc/platforms/sandpoint_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/sandpoint_setup.c Sun Apr 20 09:14:41 2003 @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/spruce_setup.c b/arch/ppc/platforms/spruce_setup.c --- a/arch/ppc/platforms/spruce_setup.c Thu Mar 27 02:17:35 2003 +++ b/arch/ppc/platforms/spruce_setup.c Sun Apr 20 09:14:41 2003 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/zx4500_setup.c b/arch/ppc/platforms/zx4500_setup.c --- a/arch/ppc/platforms/zx4500_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/zx4500_setup.c Sun Apr 20 09:14:41 2003 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c --- a/arch/ppc/syslib/m8260_setup.c Sat Mar 22 17:18:48 2003 +++ b/arch/ppc/syslib/m8260_setup.c Sun Apr 20 09:14:41 2003 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c --- a/arch/ppc/syslib/m8xx_setup.c Tue Nov 5 13:53:07 2002 +++ b/arch/ppc/syslib/m8xx_setup.c Sun Apr 20 09:14:41 2003 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c --- a/arch/ppc/syslib/ppc4xx_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/syslib/ppc4xx_setup.c Sun Apr 20 09:14:41 2003 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig --- a/arch/ppc64/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/ppc64/Kconfig Sun Apr 20 12:56:50 2003 @@ -195,7 +195,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -387,7 +387,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/ppc64/kernel/chrp_setup.c b/arch/ppc64/kernel/chrp_setup.c --- a/arch/ppc64/kernel/chrp_setup.c Mon Mar 24 16:01:56 2003 +++ b/arch/ppc64/kernel/chrp_setup.c Sun Apr 20 09:14:41 2003 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c --- a/arch/ppc64/kernel/iSeries_setup.c Mon Mar 24 16:01:56 2003 +++ b/arch/ppc64/kernel/iSeries_setup.c Sun Apr 20 09:14:41 2003 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c --- a/arch/ppc64/kernel/setup.c Sun Dec 15 17:35:20 2002 +++ b/arch/ppc64/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c --- a/arch/ppc64/kernel/sys_ppc32.c Tue Apr 15 22:48:20 2003 +++ b/arch/ppc64/kernel/sys_ppc32.c Sat Apr 19 23:22:56 2003 @@ -910,7 +910,6 @@ #define ca32_export u.u32_export #define ca32_getfd u.u32_getfd #define ca32_getfs u.u32_getfs -#define ca32_authd u.u32_authd }; union nfsctl_res32 { diff -Nru a/arch/s390/Kconfig b/arch/s390/Kconfig --- a/arch/s390/Kconfig Mon Apr 14 12:11:54 2003 +++ b/arch/s390/Kconfig Sun Apr 20 12:56:51 2003 @@ -60,7 +60,7 @@ See also the , and the SMP-HOWTO available at - . + . Even if you don't know what to do here, say Y. @@ -226,7 +226,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -248,7 +248,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. diff -Nru a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c --- a/arch/s390/kernel/setup.c Mon Apr 14 12:11:56 2003 +++ b/arch/s390/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -29,9 +29,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include diff -Nru a/arch/sh/Kconfig b/arch/sh/Kconfig --- a/arch/sh/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/sh/Kconfig Sun Apr 20 12:56:51 2003 @@ -483,7 +483,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -608,7 +608,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -630,7 +630,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -748,7 +748,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -980,7 +980,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -1049,7 +1049,7 @@ Although PS/2 mice are not technically bus mice, they are explained in detail in the Busmouse-HOWTO, available from - . + . When using a PS/2 mouse, you can get problems if you want to use the mouse both on the Linux console and under X. Using the "-R" option @@ -1157,7 +1157,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c --- a/arch/sh/kernel/setup.c Sat Oct 12 07:52:54 2002 +++ b/arch/sh/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -25,9 +25,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig --- a/arch/sparc/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/sparc/Kconfig Sun Apr 20 12:56:50 2003 @@ -106,7 +106,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -160,7 +160,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -314,7 +314,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -336,7 +336,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -372,7 +372,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -636,7 +636,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -671,7 +671,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -693,7 +693,7 @@ tape drives (ADR-x0) that supports the standard SCSI-2 commands for tapes (QIC-157) and can be driven by the standard driver st. For more information, you may have a look at the SCSI-HOWTO - and + and in the kernel source. More info on the OnStream driver may be found on @@ -712,7 +712,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -925,7 +925,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c --- a/arch/sparc/kernel/irq.c Mon Mar 31 14:29:49 2003 +++ b/arch/sparc/kernel/irq.c Sun Apr 20 23:43:42 2003 @@ -74,8 +74,8 @@ prom_halt(); } -void (*sparc_init_timers)(void (*)(int, void *,struct pt_regs *)) = - (void (*)(void (*)(int, void *,struct pt_regs *))) irq_panic; +void (*sparc_init_timers)(irqreturn_t (*)(int, void *,struct pt_regs *)) = + (void (*)(irqreturn_t (*)(int, void *,struct pt_regs *))) irq_panic; /* * Dave Redman (djhr@tadpole.co.uk) @@ -461,7 +461,7 @@ * thus no sharing possible. */ int request_fast_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char *devname) { struct irqaction *action; @@ -549,7 +549,7 @@ } int request_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction * action, *tmp = NULL; @@ -558,7 +558,7 @@ if (sparc_cpu_model == sun4d) { extern int sun4d_request_irq(unsigned int, - void (*)(int, void *, struct pt_regs *), + irqreturn_t (*)(int, void *, struct pt_regs *), unsigned long, const char *, void *); return sun4d_request_irq(irq, handler, irqflags, devname, dev_id); } diff -Nru a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c --- a/arch/sparc/kernel/pcic.c Sun Mar 16 14:16:33 2003 +++ b/arch/sparc/kernel/pcic.c Sun Apr 20 23:43:42 2003 @@ -736,12 +736,13 @@ pcic_timer_dummy = readl(pcic0.pcic_regs+PCI_SYS_LIMIT); } -static void pcic_timer_handler (int irq, void *h, struct pt_regs *regs) +static irqreturn_t pcic_timer_handler (int irq, void *h, struct pt_regs *regs) { write_seqlock(&xtime_lock); /* Dummy, to show that we remember */ pcic_clear_clock_irq(); do_timer(regs); write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } #define USECS_PER_JIFFY 10000 /* We have 100HZ "standard" timer for sparc */ diff -Nru a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c --- a/arch/sparc/kernel/setup.c Mon Mar 31 14:29:49 2003 +++ b/arch/sparc/kernel/setup.c Sun Apr 20 23:39:15 2003 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff -Nru a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c --- a/arch/sparc/kernel/sun4c_irq.c Fri Jan 3 00:21:36 2003 +++ b/arch/sparc/kernel/sun4c_irq.c Sun Apr 20 23:43:42 2003 @@ -155,7 +155,7 @@ /* Errm.. not sure how to do this.. */ } -static void __init sun4c_init_timers(void (*counter_fn)(int, void *, struct pt_regs *)) +static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *)) { int irq; diff -Nru a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c --- a/arch/sparc/kernel/sun4d_irq.c Fri Jan 3 00:21:36 2003 +++ b/arch/sparc/kernel/sun4d_irq.c Sun Apr 20 23:43:42 2003 @@ -262,7 +262,7 @@ } int sun4d_request_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction *action, *tmp = NULL, **actionp; @@ -445,7 +445,7 @@ bw_set_prof_limit(cpu, limit); } -static void __init sun4d_init_timers(void (*counter_fn)(int, void *, struct pt_regs *)) +static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *)) { int irq; extern struct prom_cpuinfo linux_cpus[NR_CPUS]; diff -Nru a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c --- a/arch/sparc/kernel/sun4m_irq.c Fri Jan 3 00:21:36 2003 +++ b/arch/sparc/kernel/sun4m_irq.c Sun Apr 20 23:43:42 2003 @@ -235,7 +235,7 @@ return buff; } -static void __init sun4m_init_timers(void (*counter_fn)(int, void *, struct pt_regs *)) +static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *)) { int reg_count, irq, cpu; struct linux_prom_registers cnt_regs[PROMREG_MAX]; diff -Nru a/arch/sparc/kernel/tick14.c b/arch/sparc/kernel/tick14.c --- a/arch/sparc/kernel/tick14.c Mon Dec 2 00:41:11 2002 +++ b/arch/sparc/kernel/tick14.c Sun Apr 20 23:43:42 2003 @@ -56,7 +56,7 @@ linux_lvl14[3] = obp_lvl14[3]; } -void claim_ticker14(void (*handler)(int, void *, struct pt_regs *), +void claim_ticker14(irqreturn_t (*handler)(int, void *, struct pt_regs *), int irq_nr, unsigned int timeout ) { int cpu = smp_processor_id(); diff -Nru a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c --- a/arch/sparc/kernel/time.c Mon Feb 24 23:13:09 2003 +++ b/arch/sparc/kernel/time.c Sun Apr 20 23:43:42 2003 @@ -120,7 +120,7 @@ #define TICK_SIZE (tick_nsec / 1000) -void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) +irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) { /* last time the cmos clock got updated */ static long last_rtc_update; @@ -156,6 +156,8 @@ last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ } write_sequnlock(&xtime_lock); + + return IRQ_HANDLED; } /* Kick start a stopped clock (procedure from the Sun NVRAM/hostid FAQ). */ diff -Nru a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c --- a/arch/sparc/mm/init.c Mon Feb 10 02:46:32 2003 +++ b/arch/sparc/mm/init.c Sun Apr 20 09:14:41 2003 @@ -18,9 +18,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif +#include #include #include #include diff -Nru a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c --- a/arch/sparc/mm/sun4c.c Sun Apr 13 22:32:09 2003 +++ b/arch/sparc/mm/sun4c.c Sun Apr 20 23:41:13 2003 @@ -1901,7 +1901,7 @@ if ((pte = sun4c_pte_alloc_one_fast(mm, address)) != NULL) return pte; - pte = (pte_t *)__get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) memset(pte, 0, PAGE_SIZE); return pte; diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig --- a/arch/sparc64/Kconfig Wed Mar 26 02:27:26 2003 +++ b/arch/sparc64/Kconfig Sun Apr 20 12:56:50 2003 @@ -114,7 +114,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -281,7 +281,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -314,7 +314,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -426,7 +426,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -448,7 +448,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -496,7 +496,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -804,7 +804,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -839,7 +839,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -861,7 +861,7 @@ tape drives (ADR-x0) that supports the standard SCSI-2 commands for tapes (QIC-157) and can be driven by the standard driver st. For more information, you may have a look at the SCSI-HOWTO - and + and in the kernel source. More info on the OnStream driver may be found on @@ -880,7 +880,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -1060,7 +1060,7 @@ configuration options. You should read at a minimum before contacting the maintainer with any questions. The SCSI-HOWTO, - available from , can also + available from , can also be of great help. If you want to compile this driver as a module ( = code which can be @@ -1406,7 +1406,7 @@ Please read the file . You should also read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1586,7 +1586,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c --- a/arch/sparc64/kernel/ebus.c Mon Nov 18 12:27:30 2002 +++ b/arch/sparc64/kernel/ebus.c Sun Apr 20 23:43:42 2003 @@ -73,7 +73,7 @@ } } -static void ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs) { struct ebus_dma_info *p = dev_id; unsigned long flags; @@ -87,12 +87,16 @@ if (csr & EBDMA_CSR_ERR_PEND) { printk(KERN_CRIT "ebus_dma(%s): DMA error!\n", p->name); p->callback(p, EBUS_DMA_EVENT_ERROR, p->client_cookie); + return IRQ_HANDLED; } else if (csr & EBDMA_CSR_INT_PEND) { p->callback(p, (csr & EBDMA_CSR_TC) ? EBUS_DMA_EVENT_DMA : EBUS_DMA_EVENT_DEVICE, p->client_cookie); + return IRQ_HANDLED; } + + return IRQ_NONE; } int ebus_dma_register(struct ebus_dma_info *p) diff -Nru a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c --- a/arch/sparc64/kernel/irq.c Mon Mar 31 14:29:49 2003 +++ b/arch/sparc64/kernel/irq.c Sun Apr 20 23:43:42 2003 @@ -294,7 +294,7 @@ __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); } -int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), +int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char *name, void *dev_id) { struct irqaction *action, *tmp = NULL; @@ -831,7 +831,7 @@ #define SPARC_NOP (0x01000000) static void install_fast_irq(unsigned int cpu_irq, - void (*handler)(int, void *, struct pt_regs *)) + irqreturn_t (*handler)(int, void *, struct pt_regs *)) { extern unsigned long sparc64_ttable_tl0; unsigned long ttent = (unsigned long) &sparc64_ttable_tl0; @@ -847,7 +847,7 @@ } int request_fast_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char *name, void *dev_id) { struct irqaction *action; diff -Nru a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c --- a/arch/sparc64/kernel/pci_psycho.c Mon Nov 18 12:11:19 2002 +++ b/arch/sparc64/kernel/pci_psycho.c Sun Apr 20 23:43:42 2003 @@ -713,7 +713,7 @@ #define PSYCHO_UEAFSR_RESV2 0x00000000007fffff /* Reserved */ #define PSYCHO_UE_AFAR 0x0038UL -static void psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->controller_regs + PSYCHO_UE_AFSR; @@ -730,7 +730,7 @@ (PSYCHO_UEAFSR_PPIO | PSYCHO_UEAFSR_PDRD | PSYCHO_UEAFSR_PDWR | PSYCHO_UEAFSR_SPIO | PSYCHO_UEAFSR_SDRD | PSYCHO_UEAFSR_SDWR); if (!error_bits) - return; + return IRQ_NONE; psycho_write(afsr_reg, error_bits); /* Log the error. */ @@ -769,6 +769,8 @@ /* Interrogate IOMMU for error status. */ psycho_check_iommu_error(p, afsr, afar, UE_ERR); + + return IRQ_HANDLED; } /* Correctable Errors. */ @@ -788,7 +790,7 @@ #define PSYCHO_CEAFSR_RESV2 0x00000000007fffff /* Reserved */ #define PSYCHO_CE_AFAR 0x0040UL -static void psycho_ce_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t psycho_ce_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->controller_regs + PSYCHO_CE_AFSR; @@ -805,7 +807,7 @@ (PSYCHO_CEAFSR_PPIO | PSYCHO_CEAFSR_PDRD | PSYCHO_CEAFSR_PDWR | PSYCHO_CEAFSR_SPIO | PSYCHO_CEAFSR_SDRD | PSYCHO_CEAFSR_SDWR); if (!error_bits) - return; + return IRQ_NONE; psycho_write(afsr_reg, error_bits); /* Log the error. */ @@ -847,6 +849,8 @@ if (!reported) printk("(none)"); printk("]\n"); + + return IRQ_HANDLED; } /* PCI Errors. They are signalled by the PCI bus module since they @@ -871,7 +875,7 @@ #define PSYCHO_PCI_AFAR_A 0x2018UL #define PSYCHO_PCI_AFAR_B 0x4018UL -static void psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_pbm_info *pbm = dev_id; struct pci_controller_info *p = pbm->parent; @@ -899,7 +903,7 @@ PSYCHO_PCIAFSR_SMA | PSYCHO_PCIAFSR_STA | PSYCHO_PCIAFSR_SRTRY | PSYCHO_PCIAFSR_SPERR); if (!error_bits) - return; + return IRQ_NONE; psycho_write(afsr_reg, error_bits); /* Log the error. */ @@ -968,6 +972,8 @@ if (error_bits & (PSYCHO_PCIAFSR_PPERR | PSYCHO_PCIAFSR_SPERR)) pci_scan_for_parity_error(p, pbm, pbm->pci_bus); + + return IRQ_HANDLED; } /* XXX What about PowerFail/PowerManagement??? -DaveM */ diff -Nru a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c --- a/arch/sparc64/kernel/pci_sabre.c Mon Nov 18 12:11:19 2002 +++ b/arch/sparc64/kernel/pci_sabre.c Sun Apr 20 23:43:42 2003 @@ -744,7 +744,7 @@ spin_unlock_irqrestore(&iommu->lock, flags); } -static void sabre_ue_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sabre_ue_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->controller_regs + SABRE_UE_AFSR; @@ -762,7 +762,7 @@ SABRE_UEAFSR_SDRD | SABRE_UEAFSR_SDWR | SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE); if (!error_bits) - return; + return IRQ_NONE; sabre_write(afsr_reg, error_bits); /* Log the error. */ @@ -800,9 +800,11 @@ /* Interrogate IOMMU for error status. */ sabre_check_iommu_error(p, afsr, afar); + + return IRQ_HANDLED; } -static void sabre_ce_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sabre_ce_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->controller_regs + SABRE_CE_AFSR; @@ -819,7 +821,7 @@ (SABRE_CEAFSR_PDRD | SABRE_CEAFSR_PDWR | SABRE_CEAFSR_SDRD | SABRE_CEAFSR_SDWR); if (!error_bits) - return; + return IRQ_NONE; sabre_write(afsr_reg, error_bits); /* Log the error. */ @@ -854,9 +856,11 @@ if (!reported) printk("(none)"); printk("]\n"); + + return IRQ_HANDLED; } -static void sabre_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg, afar_reg; @@ -877,7 +881,7 @@ SABRE_PIOAFSR_SMA | SABRE_PIOAFSR_STA | SABRE_PIOAFSR_SRTRY | SABRE_PIOAFSR_SPERR); if (!error_bits) - return; + return IRQ_NONE; sabre_write(afsr_reg, error_bits); /* Log the error. */ @@ -947,6 +951,8 @@ pci_scan_for_parity_error(p, &p->pbm_A, p->pbm_A.pci_bus); pci_scan_for_parity_error(p, &p->pbm_B, p->pbm_B.pci_bus); } + + return IRQ_HANDLED; } /* XXX What about PowerFail/PowerManagement??? -DaveM */ diff -Nru a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c --- a/arch/sparc64/kernel/pci_schizo.c Mon Nov 18 12:11:19 2002 +++ b/arch/sparc64/kernel/pci_schizo.c Sun Apr 20 23:43:43 2003 @@ -672,7 +672,7 @@ #define SCHIZO_UEAFSR_MTAG 0x000000000000e000UL #define SCHIZO_UEAFSR_ECCSYND 0x00000000000001ffUL -static void schizo_ue_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_ue_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->controller_regs + SCHIZO_UE_AFSR; @@ -697,7 +697,7 @@ (SCHIZO_UEAFSR_PPIO | SCHIZO_UEAFSR_PDRD | SCHIZO_UEAFSR_PDWR | SCHIZO_UEAFSR_SPIO | SCHIZO_UEAFSR_SDMA); if (!error_bits) - return; + return IRQ_NONE; schizo_write(afsr_reg, error_bits); /* Log the error. */ @@ -740,6 +740,8 @@ schizo_check_iommu_error(p, UE_ERR); schizo_clear_other_err_intr(irq); + + return IRQ_HANDLED; } #define SCHIZO_CE_AFSR 0x10040UL @@ -760,7 +762,7 @@ #define SCHIZO_CEAFSR_MTAG 0x000000000000e000UL #define SCHIZO_CEAFSR_ECCSYND 0x00000000000001ffUL -static void schizo_ce_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_ce_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; unsigned long afsr_reg = p->controller_regs + SCHIZO_CE_AFSR; @@ -785,7 +787,7 @@ (SCHIZO_CEAFSR_PPIO | SCHIZO_CEAFSR_PDRD | SCHIZO_CEAFSR_PDWR | SCHIZO_CEAFSR_SPIO | SCHIZO_CEAFSR_SDMA); if (!error_bits) - return; + return IRQ_NONE; schizo_write(afsr_reg, error_bits); /* Log the error. */ @@ -829,6 +831,8 @@ printk("]\n"); schizo_clear_other_err_intr(irq); + + return IRQ_HANDLED; } #define SCHIZO_PCI_AFSR 0x2010UL @@ -852,7 +856,7 @@ #define SCHIZO_PCIAFSR_MEM 0x0000000020000000UL #define SCHIZO_PCIAFSR_IO 0x0000000010000000UL -static void schizo_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_pbm_info *pbm = dev_id; struct pci_controller_info *p = pbm->parent; @@ -886,7 +890,7 @@ SCHIZO_PCIAFSR_SRTRY | SCHIZO_PCIAFSR_SPERR | SCHIZO_PCIAFSR_STTO | SCHIZO_PCIAFSR_SUNUS); if (!error_bits) - return; + return IRQ_NONE; schizo_write(afsr_reg, error_bits); /* Log the error. */ @@ -974,6 +978,8 @@ pci_scan_for_parity_error(p, pbm, pbm->pci_bus); schizo_clear_other_err_intr(irq); + + return IRQ_HANDLED; } #define SCHIZO_SAFARI_ERRLOG 0x10018UL @@ -1002,7 +1008,7 @@ /* We only expect UNMAP errors here. The rest of the Safari errors * are marked fatal and thus cause a system reset. */ -static void schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *regs) { struct pci_controller_info *p = dev_id; u64 errlog; @@ -1016,7 +1022,7 @@ p->index, errlog); schizo_clear_other_err_intr(irq); - return; + return IRQ_HANDLED; } printk("SCHIZO%d: Safari interrupt, UNMAPPED error, interrogating IOMMUs.\n", @@ -1024,6 +1030,7 @@ schizo_check_iommu_error(p, SAFARI_ERR); schizo_clear_other_err_intr(irq); + return IRQ_HANDLED; } /* Nearly identical to PSYCHO equivalents... */ diff -Nru a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c --- a/arch/sparc64/kernel/power.c Tue Feb 11 14:57:50 2003 +++ b/arch/sparc64/kernel/power.c Sun Apr 20 23:43:43 2003 @@ -26,12 +26,15 @@ static DECLARE_WAIT_QUEUE_HEAD(powerd_wait); static int button_pressed; -static void power_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t power_handler(int irq, void *dev_id, struct pt_regs *regs) { if (button_pressed == 0) { wake_up(&powerd_wait); button_pressed = 1; } + + /* FIXME: Check registers for status... */ + return IRQ_HANDLED; } #endif /* CONFIG_PCI */ diff -Nru a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c --- a/arch/sparc64/kernel/sbus.c Tue Feb 25 09:56:15 2003 +++ b/arch/sparc64/kernel/sbus.c Sun Apr 20 23:43:43 2003 @@ -813,7 +813,7 @@ #define SYSIO_UEAFSR_SIZE 0x00001c0000000000 /* Bad transfer size is 2**SIZE */ #define SYSIO_UEAFSR_MID 0x000003e000000000 /* UPA MID causing the fault */ #define SYSIO_UEAFSR_RESV2 0x0000001fffffffff /* Reserved */ -static void sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs) { struct sbus_bus *sbus = dev_id; struct sbus_iommu *iommu = sbus->iommu; @@ -867,6 +867,8 @@ if (!reported) printk("(none)"); printk("]\n"); + + return IRQ_HANDLED; } #define SYSIO_CE_AFSR 0x0040UL @@ -883,7 +885,7 @@ #define SYSIO_CEAFSR_SIZE 0x00001c0000000000 /* Bad transfer size is 2**SIZE */ #define SYSIO_CEAFSR_MID 0x000003e000000000 /* UPA MID causing the fault */ #define SYSIO_CEAFSR_RESV2 0x0000001fffffffff /* Reserved */ -static void sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs) { struct sbus_bus *sbus = dev_id; struct sbus_iommu *iommu = sbus->iommu; @@ -942,6 +944,8 @@ if (!reported) printk("(none)"); printk("]\n"); + + return IRQ_HANDLED; } #define SYSIO_SBUS_AFSR 0x2010UL @@ -958,7 +962,7 @@ #define SYSIO_SBAFSR_SIZE 0x00001c0000000000 /* Size of transfer */ #define SYSIO_SBAFSR_MID 0x000003e000000000 /* MID causing the error */ #define SYSIO_SBAFSR_RESV3 0x0000001fffffffff /* Reserved */ -static void 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 pt_regs *regs) { struct sbus_bus *sbus = dev_id; struct sbus_iommu *iommu = sbus->iommu; @@ -1013,6 +1017,8 @@ printk("]\n"); /* XXX check iommu/strbuf for further error status XXX */ + + return IRQ_HANDLED; } #define ECC_CONTROL 0x0020UL diff -Nru a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c --- a/arch/sparc64/kernel/setup.c Wed Mar 26 00:49:46 2003 +++ b/arch/sparc64/kernel/setup.c Sun Apr 20 23:39:15 2003 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c --- a/arch/sparc64/kernel/sys_sparc32.c Tue Apr 15 22:48:21 2003 +++ b/arch/sparc64/kernel/sys_sparc32.c Sat Apr 19 23:22:56 2003 @@ -2133,7 +2133,6 @@ #define ca32_export u.u32_export #define ca32_getfd u.u32_getfd #define ca32_getfs u.u32_getfs -#define ca32_authd u.u32_authd }; union nfsctl_res32 { diff -Nru a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c --- a/arch/sparc64/kernel/time.c Wed Mar 26 00:49:46 2003 +++ b/arch/sparc64/kernel/time.c Sun Apr 20 23:43:43 2003 @@ -477,7 +477,7 @@ } } -static void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) { unsigned long ticks, pstate; @@ -509,6 +509,8 @@ timer_check_rtc(); write_sequnlock(&xtime_lock); + + return IRQ_HANDLED; } #ifdef CONFIG_SMP @@ -925,7 +927,7 @@ } /* This is gets the master TICK_INT timer going. */ -static unsigned long sparc64_init_timers(void (*cfunc)(int, void *, struct pt_regs *)) +static unsigned long sparc64_init_timers(irqreturn_t (*cfunc)(int, void *, struct pt_regs *)) { unsigned long pstate, clock; int node, err; diff -Nru a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c --- a/arch/sparc64/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/sparc64/mm/init.c Sun Apr 20 18:28:00 2003 @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -1173,7 +1173,7 @@ } color = VPTE_COLOR(address); - page = alloc_pages(GFP_KERNEL, DC_ALIAS_SHIFT); + page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, DC_ALIAS_SHIFT); if (page) { unsigned long *to_free; unsigned long paddr; diff -Nru a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c --- a/arch/um/drivers/ubd_kern.c Sat Mar 22 09:04:18 2003 +++ b/arch/um/drivers/ubd_kern.c Sat Apr 19 14:17:05 2003 @@ -106,8 +106,6 @@ __u64 size; struct openflags boot_openflags; struct openflags openflags; - devfs_handle_t real; - devfs_handle_t fake; struct cow cow; }; @@ -127,8 +125,6 @@ .size = -1, \ .boot_openflags = OPEN_FLAGS, \ .openflags = OPEN_FLAGS, \ - .real = NULL, \ - .fake = NULL, \ .cow = DEFAULT_COW, \ } @@ -484,41 +480,30 @@ return(err); } -static int ubd_new_disk(int major, u64 size, char *name, int unit, - struct gendisk **disk_out, devfs_handle_t dir_handle, - devfs_handle_t *handle_out) +static int ubd_new_disk(int major, u64 size, int unit, + struct gendisk **disk_out) + { - char devfs_name[sizeof("ubd/nnnnnn\0")]; struct gendisk *disk; - int minor = unit << UBD_SHIFT; disk = alloc_disk(1 << UBD_SHIFT); - if(disk == NULL) - return(-ENOMEM); + if (!disk) + return -ENOMEM; disk->major = major; - disk->first_minor = minor; + disk->first_minor = unit << UBD_SHIFT; disk->fops = &ubd_blops; set_capacity(disk, size / 512); - /* needs to be ubd -> /dev/ubd/discX/disc */ sprintf(disk->disk_name, "ubd"); - *disk_out = disk; + sprintf(disk->devfs_name, "ubd/disc%d", unit); - /* /dev/ubd/N style names */ - sprintf(devfs_name, "ubd/%d", unit); - *handle_out = devfs_register(NULL, devfs_name, - 0, major, minor, - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP | - S_IWGRP, &ubd_blops, NULL); disk->private_data = &ubd_dev[unit]; disk->queue = &ubd_queue; add_disk(disk); - return(0); -} -/* Initialized in an initcall, and unchanged thereafter */ -devfs_handle_t ubd_dir_handle; -devfs_handle_t ubd_fake_dir_handle; + *disk_out = disk; + return 0; +} static int ubd_add(int n) { @@ -538,15 +523,13 @@ if(err) return(err); - err = ubd_new_disk(MAJOR_NR, dev->size, "ubd", n, &ubd_gendisk[n], - ubd_dir_handle, &dev->real); + err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]); if(err) return(err); if(fake_major) - ubd_new_disk(fake_major, dev->size, "ubd%d", n, - &fake_gendisk[n], ubd_fake_dir_handle, - &dev->fake); + ubd_new_disk(fake_major, dev->size, n, + &fake_gendisk[n]); /* perhaps this should also be under the "if (fake_major)" above */ /* using the fake_disk->disk_name and also the fakehd_set name */ @@ -645,15 +628,11 @@ del_gendisk(ubd_gendisk[n]); put_disk(ubd_gendisk[n]); ubd_gendisk[n] = NULL; - if(dev->real != NULL) - devfs_unregister(dev->real); if(fake_gendisk[n] != NULL){ del_gendisk(fake_gendisk[n]); put_disk(fake_gendisk[n]); fake_gendisk[n] = NULL; - if(dev->fake != NULL) - devfs_unregister(dev->fake); } *dev = ((struct ubd) DEFAULT_UBD); @@ -682,7 +661,7 @@ { int i; - ubd_dir_handle = devfs_mk_dir("ubd"); + devfs_mk_dir("ubd"); if (register_blkdev(MAJOR_NR, "ubd")) return -1; @@ -693,7 +672,7 @@ char name[sizeof("ubd_nnn\0")]; snprintf(name, sizeof(name), "ubd_%d", fake_major); - ubd_fake_dir_handle = devfs_mk_dir(name); + devfs_mk_dir(name); if (register_blkdev(fake_major, "ubd")) return -1; } diff -Nru a/arch/um/kernel/initrd_kern.c b/arch/um/kernel/initrd_kern.c --- a/arch/um/kernel/initrd_kern.c Mon Oct 14 06:53:49 2002 +++ b/arch/um/kernel/initrd_kern.c Sun Apr 20 09:14:41 2003 @@ -5,7 +5,7 @@ #include "linux/init.h" #include "linux/bootmem.h" -#include "linux/blk.h" +#include "linux/initrd.h" #include "asm/types.h" #include "user_util.h" #include "kern_util.h" diff -Nru a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c --- a/arch/um/kernel/mem.c Thu Mar 6 08:19:07 2003 +++ b/arch/um/kernel/mem.c Sat Apr 19 23:22:41 2003 @@ -810,35 +810,21 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - int count = 0; pte_t *pte; - do { - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte) + clear_page(pte); return pte; } struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - int count = 0; struct page *pte; - do { - pte = alloc_pages(GFP_KERNEL, 0); - if (pte) - clear_highpage(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); + if (pte) + clear_highpage(pte); return pte; } diff -Nru a/arch/v850/Kconfig b/arch/v850/Kconfig --- a/arch/v850/Kconfig Thu Apr 3 15:01:04 2003 +++ b/arch/v850/Kconfig Sun Apr 20 12:56:51 2003 @@ -341,7 +341,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c --- a/arch/x86_64/ia32/sys_ia32.c Tue Apr 15 22:48:21 2003 +++ b/arch/x86_64/ia32/sys_ia32.c Sat Apr 19 23:22:56 2003 @@ -1708,7 +1708,6 @@ #define ca32_export u.u32_export #define ca32_getfd u.u32_getfd #define ca32_getfs u.u32_getfs -#define ca32_authd u.u32_authd }; union nfsctl_res32 { diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c --- a/arch/x86_64/kernel/setup.c Fri Mar 28 09:55:32 2003 +++ b/arch/x86_64/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -28,9 +28,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c --- a/drivers/acpi/osl.c Thu Apr 3 05:01:25 2003 +++ b/drivers/acpi/osl.c Sun Apr 20 14:14:28 2003 @@ -234,10 +234,12 @@ return AE_OK; } -static void +static irqreturn_t acpi_irq(int irq, void *dev_id, struct pt_regs *regs) { (*acpi_irq_handler)(acpi_irq_context); + /* FIXME!! We really should check that the irq was really ours! */ + return IRQ_HANDLED; } acpi_status diff -Nru a/drivers/block/DAC960.c b/drivers/block/DAC960.c --- a/drivers/block/DAC960.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/DAC960.c Sun Apr 20 22:09:23 2003 @@ -1069,6 +1069,7 @@ if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask)) return DAC960_Failure(Controller, "DMA mask out of range"); + Controller->BounceBufferLimit = DAC690_V1_PciDmaMask; if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { CommandMailboxesSize = 0; @@ -1271,6 +1272,7 @@ if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask)) return DAC960_Failure(Controller, "DMA mask out of range"); + Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; /* This is a temporary dma mapping, used only in the scope of this function */ CommandMailbox = @@ -2386,6 +2388,7 @@ */ RequestQueue = &Controller->RequestQueue; blk_init_queue(RequestQueue, DAC960_RequestFunction, &Controller->queue_lock); + blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit); RequestQueue->queuedata = Controller; blk_queue_max_hw_segments(RequestQueue, Controller->DriverScatterGatherLimit); @@ -2583,7 +2586,7 @@ const struct pci_device_id *entry) { struct DAC960_privdata *privdata = (struct DAC960_privdata *)entry->driver_data; - void (*InterruptHandler)(int, void *, Registers_T *) = privdata->InterruptHandler; + irqreturn_t (*InterruptHandler)(int, void *, Registers_T *) = privdata->InterruptHandler; unsigned int MemoryWindowSize = privdata->MemoryWindowSize; DAC960_Controller_T *Controller = NULL; unsigned char DeviceFunction = PCI_Device->devfn; @@ -5109,7 +5112,7 @@ Controllers. */ -static void DAC960_BA_InterruptHandler(int IRQ_Channel, +static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, Registers_T *InterruptRegisters) { @@ -5117,6 +5120,7 @@ void *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; ProcessorFlags_T ProcessorFlags; + /* Acquire exclusive access to Controller. */ @@ -5151,6 +5155,7 @@ Release exclusive access to Controller. */ DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + return IRQ_HANDLED; } @@ -5159,7 +5164,7 @@ Controllers. */ -static void DAC960_LP_InterruptHandler(int IRQ_Channel, +static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, Registers_T *InterruptRegisters) { @@ -5201,6 +5206,7 @@ Release exclusive access to Controller. */ DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + return IRQ_HANDLED; } @@ -5209,7 +5215,7 @@ Controllers. */ -static void DAC960_LA_InterruptHandler(int IRQ_Channel, +static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, Registers_T *InterruptRegisters) { @@ -5247,6 +5253,7 @@ Release exclusive access to Controller. */ DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + return IRQ_HANDLED; } @@ -5255,7 +5262,7 @@ Controllers. */ -static void DAC960_PG_InterruptHandler(int IRQ_Channel, +static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, Registers_T *InterruptRegisters) { @@ -5293,6 +5300,7 @@ Release exclusive access to Controller. */ DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + return IRQ_HANDLED; } @@ -5301,7 +5309,7 @@ Controllers. */ -static void DAC960_PD_InterruptHandler(int IRQ_Channel, +static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, Registers_T *InterruptRegisters) { @@ -5335,6 +5343,7 @@ Release exclusive access to Controller. */ DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + return IRQ_HANDLED; } @@ -5347,7 +5356,7 @@ an arbitrary buffer. */ -static void DAC960_P_InterruptHandler(int IRQ_Channel, +static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, Registers_T *InterruptRegisters) { @@ -5416,6 +5425,7 @@ Release exclusive access to Controller. */ DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags); + return IRQ_HANDLED; } diff -Nru a/drivers/block/DAC960.h b/drivers/block/DAC960.h --- a/drivers/block/DAC960.h Mon Feb 3 23:46:58 2003 +++ b/drivers/block/DAC960.h Sun Apr 20 22:10:31 2003 @@ -62,11 +62,6 @@ /* Define the pci dma mask supported by DAC960 V1 and V2 Firmware Controlers - - For now set the V2 mask to only 32 bits. The controller IS capable - of doing 64 bit dma. But I have yet to find out whether this needs to - be explicitely enabled in the controller, or of the controller adapts - automatically. */ #define DAC690_V1_PciDmaMask 0xffffffff @@ -2234,7 +2229,7 @@ struct DAC960_privdata { DAC960_HardwareType_T HardwareType; DAC960_FirmwareType_T FirmwareType; - void (*InterruptHandler)(int, void *, Registers_T *); + irqreturn_t (*InterruptHandler)(int, void *, Registers_T *); unsigned int MemoryWindowSize; }; @@ -2370,6 +2365,7 @@ unsigned short ControllerScatterGatherLimit; unsigned short DriverScatterGatherLimit; unsigned int ControllerUsageCount; + u64 BounceBufferLimit; unsigned int CombinedStatusBufferLength; unsigned int InitialStatusLength; unsigned int CurrentStatusLength; @@ -4237,12 +4233,12 @@ static void DAC960_V1_QueueReadWriteCommand(DAC960_Command_T *); static void DAC960_V2_QueueReadWriteCommand(DAC960_Command_T *); static void DAC960_RequestFunction(RequestQueue_T *); -static void DAC960_BA_InterruptHandler(int, void *, Registers_T *); -static void DAC960_LP_InterruptHandler(int, void *, Registers_T *); -static void DAC960_LA_InterruptHandler(int, void *, Registers_T *); -static void DAC960_PG_InterruptHandler(int, void *, Registers_T *); -static void DAC960_PD_InterruptHandler(int, void *, Registers_T *); -static void DAC960_P_InterruptHandler(int, void *, Registers_T *); +static irqreturn_t DAC960_BA_InterruptHandler(int, void *, Registers_T *); +static irqreturn_t DAC960_LP_InterruptHandler(int, void *, Registers_T *); +static irqreturn_t DAC960_LA_InterruptHandler(int, void *, Registers_T *); +static irqreturn_t DAC960_PG_InterruptHandler(int, void *, Registers_T *); +static irqreturn_t DAC960_PD_InterruptHandler(int, void *, Registers_T *); +static irqreturn_t DAC960_P_InterruptHandler(int, void *, Registers_T *); static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *); static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *); static void DAC960_MonitoringTimerFunction(unsigned long); diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/cciss.c Sun Apr 20 22:32:59 2003 @@ -599,9 +599,12 @@ luninfo.num_opens = drv->usage_count; luninfo.num_parts = 0; /* count partitions 1 to 15 with sizes > 0 */ - for(i=1; i part[i].nr_sects != 0) - luninfo.num_parts++; + for(i=1; i part[i]) + continue; + if (disk->part[i]->nr_sects != 0) + luninfo.num_parts++; + } if (copy_to_user((void *) arg, &luninfo, sizeof(LogvolInfo_struct))) return -EFAULT; @@ -1962,7 +1965,7 @@ start_io(h); } -static void do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs) { ctlr_info_t *h = dev_id; CommandList_struct *c; @@ -1972,7 +1975,7 @@ /* Is this interrupt for us? */ if ( h->access.intr_pending(h) == 0) - return; + return IRQ_NONE; /* * If there are completed commands in the completion queue, @@ -2020,6 +2023,7 @@ */ spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); blk_start_queue(&h->queue); + return IRQ_HANDLED; } /* * We cannot read the structure directly, for portablity we must use diff -Nru a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c --- a/drivers/block/cpqarray.c Fri Apr 18 08:58:55 2003 +++ b/drivers/block/cpqarray.c Sun Apr 20 22:06:44 2003 @@ -144,7 +144,7 @@ static inline void complete_buffers(struct bio *bio, int ok); static inline void complete_command(cmdlist_t *cmd, int timeout); -static void do_ida_intr(int irq, void *dev_id, struct pt_regs * regs); +static irqreturn_t do_ida_intr(int irq, void *dev_id, struct pt_regs * regs); static void ida_timer(unsigned long tdata); static int ida_revalidate(struct gendisk *disk); static int revalidate_allvol(kdev_t dev); @@ -929,7 +929,7 @@ * Find the command on the completion queue, remove it, tell the OS and * try to queue up more IO */ -static void do_ida_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_ida_intr(int irq, void *dev_id, struct pt_regs *regs) { ctlr_info_t *h = dev_id; cmdlist_t *c; @@ -940,7 +940,7 @@ istat = h->access.intr_pending(h); /* Is this interrupt for us? */ if (istat == 0) - return; + return IRQ_NONE; /* * If there are completed commands in the completion queue, @@ -991,6 +991,7 @@ */ do_ida_request(&h->queue); spin_unlock_irqrestore(IDA_LOCK(h->ctlr), flags); + return IRQ_HANDLED; } /* diff -Nru a/drivers/block/floppy.c b/drivers/block/floppy.c --- a/drivers/block/floppy.c Thu Apr 3 14:36:23 2003 +++ b/drivers/block/floppy.c Sun Apr 20 14:50:45 2003 @@ -217,7 +217,7 @@ static spinlock_t floppy_lock = SPIN_LOCK_UNLOCKED; static unsigned short virtual_dma_port=0x3f0; -void floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs); +irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs); static int set_dor(int fdc, char mask, char data); static void register_devfs_entries (int drive) __init; @@ -1743,7 +1743,7 @@ } /* interrupt handler. Note that this can be called externally on the Sparc */ -void floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs) +irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs) { void (*handler)(void) = do_floppy; int do_print; @@ -1764,7 +1764,7 @@ printk("floppy interrupt on bizarre fdc %d\n",fdc); printk("handler=%p\n", handler); is_alive("bizarre fdc"); - return; + return IRQ_NONE; } FDCS->reset = 0; @@ -1797,6 +1797,9 @@ } else FDCS->reset = 1; is_alive("normal interrupt end"); + + /* FIXME! Was it really for us? */ + return IRQ_HANDLED; } static void recalibrate_floppy(void) @@ -2263,10 +2266,9 @@ bad_flp_intr, generic_done }; -static int do_format(kdev_t device, struct format_descr *tmp_format_req) +static int do_format(int drive, struct format_descr *tmp_format_req) { int ret; - int drive=DRIVE(device); LOCK_FDC(drive,1); set_floppy(drive); @@ -2293,7 +2295,7 @@ * ============================= */ -static inline void end_request(struct request *req, int uptodate) +static void floppy_end_request(struct request *req, int uptodate) { if (end_that_request_first(req, uptodate, current_count_sectors)) return; @@ -2334,7 +2336,7 @@ /* unlock chained buffers */ spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 1); + floppy_end_request(req, 1); spin_unlock_irqrestore(q->queue_lock, flags); } else { if (rq_data_dir(req) == WRITE) { @@ -2348,7 +2350,7 @@ DRWE->last_error_generation = DRS->generation; } spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 0); + floppy_end_request(req, 0); spin_unlock_irqrestore(q->queue_lock, flags); } } @@ -3556,7 +3558,7 @@ case FDFMTTRK: if (UDRS->fd_ref != 1) return -EBUSY; - return do_format(device, &inparam.f); + return do_format(drive, &inparam.f); case FDFMTEND: case FDFLUSH: LOCK_FDC(drive,1); @@ -3965,21 +3967,19 @@ static void __init register_devfs_entries (int drive) { - int base_minor, i; + int base_minor = (drive < 4) ? drive : (124 + drive); - base_minor = (drive < 4) ? drive : (124 + drive); - if (UDP->cmos < NUMBER(default_drive_params)) { - i = 0; - do { - char name[16]; - - sprintf(name, "floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, FLOPPY_MAJOR, - base_minor + (table_sup[UDP->cmos][i] << 2), - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP, - &floppy_fops, NULL); - } while (table_sup[UDP->cmos][i++]); - } + if (UDP->cmos < NUMBER(default_drive_params)) { + int i = 0; + do { + int minor = base_minor + (table_sup[UDP->cmos][i] << 2); + + devfs_mk_bdev(MKDEV(FLOPPY_MAJOR, minor), + S_IFBLK|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP, + "floppy/%d%s", + drive, table[table_sup[UDP->cmos][i]]); + } while (table_sup[UDP->cmos][i++]); + } } /* diff -Nru a/drivers/block/floppy98.c b/drivers/block/floppy98.c --- a/drivers/block/floppy98.c Thu Apr 3 14:42:27 2003 +++ b/drivers/block/floppy98.c Sun Apr 20 11:05:30 2003 @@ -2318,10 +2318,9 @@ bad_flp_intr, generic_done }; -static int do_format(kdev_t device, struct format_descr *tmp_format_req) +static int do_format(int drive, struct format_descr *tmp_format_req) { int ret; - int drive=DRIVE(device); LOCK_FDC(drive,1); set_floppy(drive); @@ -2348,7 +2347,7 @@ * ============================= */ -static inline void end_request(struct request *req, int uptodate) +static void floppy_end_request(struct request *req, int uptodate) { if (end_that_request_first(req, uptodate, current_count_sectors)) return; @@ -2389,7 +2388,7 @@ /* unlock chained buffers */ spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 1); + floppy_end_request(req, 1); spin_unlock_irqrestore(q->queue_lock, flags); } else { if (rq_data_dir(req) == WRITE) { @@ -2403,7 +2402,7 @@ DRWE->last_error_generation = DRS->generation; } spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 0); + floppy_end_request(req, 0); spin_unlock_irqrestore(q->queue_lock, flags); } } @@ -3635,7 +3634,7 @@ case FDFMTTRK: if (UDRS->fd_ref != 1) return -EBUSY; - return do_format(device, &inparam.f); + return do_format(drive, &inparam.f); case FDFMTEND: case FDFLUSH: LOCK_FDC(drive,1); @@ -4084,21 +4083,19 @@ static void __init register_devfs_entries (int drive) { - int base_minor, i; + int base_minor = (drive < 4) ? drive : (124 + drive); - base_minor = (drive < 4) ? drive : (124 + drive); - if (UDP->cmos < NUMBER(default_drive_params)) { - i = 0; - do { - char name[16]; - - sprintf(name, "floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, FLOPPY_MAJOR, - base_minor + (table_sup[UDP->cmos][i] << 2), - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP, - &floppy_fops, NULL); - } while (table_sup[UDP->cmos][i++]); - } + if (UDP->cmos < NUMBER(default_drive_params)) { + int i = 0; + do { + int minor = base_minor + (table_sup[UDP->cmos][i] << 2); + + devfs_mk_bdev(MKDEV(FLOPPY_MAJOR, minor), + S_IFBLK|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP, + "floppy/%d%s", + drive, table[table_sup[UDP->cmos][i]]); + } while (table_sup[UDP->cmos][i++]); + } } /* diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c --- a/drivers/block/genhd.c Fri Apr 4 17:15:46 2003 +++ b/drivers/block/genhd.c Sat Apr 19 23:22:58 2003 @@ -365,11 +365,13 @@ (unsigned long long)get_capacity(sgp) >> 1, disk_name(sgp, 0, buf)); for (n = 0; n < sgp->minors - 1; n++) { - if (sgp->part[n].nr_sects == 0) + if (!sgp->part[n]) + continue; + if (sgp->part[n]->nr_sects == 0) continue; seq_printf(part, "%4d %4d %10llu %s\n", sgp->major, n + 1 + sgp->first_minor, - (unsigned long long)sgp->part[n].nr_sects >> 1 , + (unsigned long long)sgp->part[n]->nr_sects >> 1 , disk_name(sgp, n + 1, buf)); } @@ -542,6 +544,92 @@ static decl_subsys(block, &ktype_block, &block_hotplug_ops); +/* + * aggregate disk stat collector. Uses the same stats that the sysfs + * entries do, above, but makes them available through one seq_file. + * Watching a few disks may be efficient through sysfs, but watching + * all of them will be more efficient through this interface. + * + * The output looks suspiciously like /proc/partitions with a bunch of + * extra fields. + */ + +/* iterator */ +static void *diskstats_start(struct seq_file *part, loff_t *pos) +{ + loff_t k = *pos; + struct list_head *p; + + down_read(&block_subsys.rwsem); + list_for_each(p, &block_subsys.kset.list) + if (!k--) + return list_entry(p, struct gendisk, kobj.entry); + return NULL; +} + +static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos) +{ + struct list_head *p = ((struct gendisk *)v)->kobj.entry.next; + ++*pos; + return p==&block_subsys.kset.list ? NULL : + list_entry(p, struct gendisk, kobj.entry); +} + +static void diskstats_stop(struct seq_file *part, void *v) +{ + up_read(&block_subsys.rwsem); +} + +static int diskstats_show(struct seq_file *s, void *v) +{ + struct gendisk *gp = v; + char buf[64]; + int n = 0; + + /* + if (&sgp->kobj.entry == block_subsys.kset.list.next) + seq_puts(s, "major minor name" + " rio rmerge rsect ruse wio wmerge " + "wsect wuse running use aveq" + "\n\n"); + */ + + disk_round_stats(gp); + seq_printf(s, "%4d %4d %s %u %u %llu %u %u %u %llu %u %u %u %u\n", + gp->major, n + gp->first_minor, disk_name(gp, n, buf), + disk_stat_read(gp, reads), disk_stat_read(gp, read_merges), + (unsigned long long)disk_stat_read(gp, read_sectors), + jiffies_to_msec(disk_stat_read(gp, read_ticks)), + disk_stat_read(gp, writes), disk_stat_read(gp, write_merges), + (unsigned long long)disk_stat_read(gp, write_sectors), + jiffies_to_msec(disk_stat_read(gp, write_ticks)), + disk_stat_read(gp, in_flight), + jiffies_to_msec(disk_stat_read(gp, io_ticks)), + jiffies_to_msec(disk_stat_read(gp, time_in_queue))); + + /* now show all non-0 size partitions of it */ + for (n = 0; n < gp->minors - 1; n++) { + struct hd_struct *hd = gp->part[n]; + + if (hd && hd->nr_sects) + seq_printf(s, "%4d %4d %s %u %u %u %u\n", + gp->major, n + gp->first_minor + 1, + disk_name(gp, n + 1, buf), + hd->reads, hd->read_sectors, + hd->writes, hd->write_sectors); + } + + return 0; +} + +struct seq_operations diskstats_op = { + start: diskstats_start, + next: diskstats_next, + stop: diskstats_stop, + show: diskstats_show +}; + + struct gendisk *alloc_disk(int minors) { struct gendisk *disk = kmalloc(sizeof(struct gendisk), GFP_KERNEL); @@ -552,7 +640,7 @@ return NULL; } if (minors > 1) { - int size = (minors - 1) * sizeof(struct hd_struct); + int size = (minors - 1) * sizeof(struct hd_struct *); disk->part = kmalloc(size, GFP_KERNEL); if (!disk->part) { kfree(disk); @@ -604,8 +692,8 @@ struct gendisk *disk = bdev->bd_disk; if (bdev->bd_contains != bdev) { int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); - struct hd_struct *p = &disk->part[part-1]; - p->policy = flag; + struct hd_struct *p = disk->part[part-1]; + if (p) p->policy = flag; } else disk->policy = flag; } @@ -615,7 +703,7 @@ int i; disk->policy = flag; for (i = 0; i < disk->minors - 1; i++) - disk->part[i].policy = flag; + if (disk->part[i]) disk->part[i]->policy = flag; } int bdev_read_only(struct block_device *bdev) @@ -626,8 +714,9 @@ disk = bdev->bd_disk; if (bdev->bd_contains != bdev) { int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); - struct hd_struct *p = &disk->part[part-1]; - return p->policy; + struct hd_struct *p = disk->part[part-1]; + if (p) return p->policy; + return 0; } else return disk->policy; } diff -Nru a/drivers/block/ioctl.c b/drivers/block/ioctl.c --- a/drivers/block/ioctl.c Sun Jan 12 06:10:40 2003 +++ b/drivers/block/ioctl.c Sat Apr 19 23:22:49 2003 @@ -41,11 +41,14 @@ return -EINVAL; } /* partition number in use? */ - if (disk->part[part - 1].nr_sects != 0) + if (disk->part[part - 1]) return -EBUSY; /* overlap? */ for (i = 0; i < disk->minors - 1; i++) { - struct hd_struct *s = &disk->part[i]; + struct hd_struct *s = disk->part[i]; + + if (!s) + continue; if (!(start+length <= s->start_sect || start >= s->start_sect + s->nr_sects)) return -EBUSY; @@ -54,7 +57,9 @@ add_partition(disk, part, start, length); return 0; case BLKPG_DEL_PARTITION: - if (disk->part[part - 1].nr_sects == 0) + if (!disk->part[part-1]) + return -ENXIO; + if (disk->part[part - 1]->nr_sects == 0) return -ENXIO; /* partition in use? Incomplete check for now. */ bdevp = bdget(MKDEV(disk->major, disk->first_minor) + part); diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c --- a/drivers/block/ll_rw_blk.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/ll_rw_blk.c Sun Apr 20 14:50:47 2003 @@ -1078,10 +1078,14 @@ * blk_run_queue - run a single device queue * @q The queue to run */ -void __blk_run_queue(request_queue_t *q) +void blk_run_queue(struct request_queue *q) { + unsigned long flags; + + spin_lock_irqsave(q->queue_lock, flags); blk_remove_plug(q); q->request_fn(q); + spin_unlock_irqrestore(q->queue_lock, flags); } /** @@ -1841,7 +1845,7 @@ if (bdev == bdev->bd_contains) return; - p = &disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1]; + p = disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1]; switch (bio->bi_rw) { case READ: p->read_sectors += bio_sectors(bio); @@ -2267,5 +2271,5 @@ EXPORT_SYMBOL(blk_start_queue); EXPORT_SYMBOL(blk_stop_queue); EXPORT_SYMBOL(__blk_stop_queue); -EXPORT_SYMBOL(__blk_run_queue); +EXPORT_SYMBOL(blk_run_queue); EXPORT_SYMBOL(blk_run_queues); diff -Nru a/drivers/block/loop.c b/drivers/block/loop.c --- a/drivers/block/loop.c Fri Apr 18 17:08:13 2003 +++ b/drivers/block/loop.c Sat Apr 19 14:18:27 2003 @@ -1143,7 +1143,6 @@ } for (i = 0; i < max_loop; i++) { - char name[16]; struct loop_device *lo = &loop_dev[i]; struct gendisk *disk = disks[i]; memset(lo, 0, sizeof(*lo)); @@ -1156,14 +1155,10 @@ disk->first_minor = i; disk->fops = &lo_fops; sprintf(disk->disk_name, "loop%d", i); + sprintf(disk->devfs_name, "loop/%d", i); disk->private_data = lo; disk->queue = &lo->lo_queue; add_disk(disk); - sprintf(name, "loop/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, - disk->fops, NULL); } printk(KERN_INFO "loop: loaded (max %d devices)\n", max_loop); return 0; @@ -1184,7 +1179,6 @@ for (i = 0; i < max_loop; i++) { del_gendisk(disks[i]); put_disk(disks[i]); - devfs_remove("loop/%d", i); } devfs_remove("loop"); if (unregister_blkdev(LOOP_MAJOR, "loop")) diff -Nru a/drivers/block/nbd.c b/drivers/block/nbd.c --- a/drivers/block/nbd.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/nbd.c Sat Apr 19 14:18:27 2003 @@ -568,7 +568,6 @@ devfs_mk_dir("nbd"); for (i = 0; i < MAX_NBD; i++) { struct gendisk *disk = nbd_dev[i].disk; - char name[16]; nbd_dev[i].refcnt = 0; nbd_dev[i].file = NULL; nbd_dev[i].magic = LO_MAGIC; @@ -585,13 +584,9 @@ disk->private_data = &nbd_dev[i]; disk->queue = &nbd_queue; sprintf(disk->disk_name, "nbd%d", i); + sprintf(disk->devfs_name, "nbd/%d", i); set_capacity(disk, 0x3ffffe); add_disk(disk); - sprintf(name, "nbd/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); } return 0; @@ -607,7 +602,6 @@ for (i = 0; i < MAX_NBD; i++) { del_gendisk(nbd_dev[i].disk); put_disk(nbd_dev[i].disk); - devfs_remove("nbd/%d", i); } devfs_remove("nbd"); blk_cleanup_queue(&nbd_queue); diff -Nru a/drivers/block/rd.c b/drivers/block/rd.c --- a/drivers/block/rd.c Sat Mar 22 07:38:05 2003 +++ b/drivers/block/rd.c Sun Apr 20 09:50:20 2003 @@ -50,9 +50,13 @@ #include #include #include +#include +#include +#include +#include #include /* for invalidate_bdev() */ #include -#include +#include #include #include @@ -370,11 +374,9 @@ } del_gendisk(rd_disks[i]); put_disk(rd_disks[i]); - devfs_remove("rd/%d", i); } #ifdef CONFIG_BLK_DEV_INITRD put_disk(initrd_disk); - devfs_remove("rd/initrd"); #endif devfs_remove("rd"); unregister_blkdev(RAMDISK_MAJOR, "ramdisk" ); @@ -402,7 +404,9 @@ initrd_disk->first_minor = INITRD_MINOR; initrd_disk->fops = &rd_bd_op; sprintf(initrd_disk->disk_name, "initrd"); + sprintf(initrd_disk->devfs_name, "rd/initrd"); #endif + for (i = 0; i < NUM_RAMDISKS; i++) { rd_disks[i] = alloc_disk(1); if (!rd_disks[i]) @@ -420,30 +424,22 @@ for (i = 0; i < NUM_RAMDISKS; i++) { struct gendisk *disk = rd_disks[i]; - char name[16]; + /* rd_size is given in kB */ disk->major = RAMDISK_MAJOR; disk->first_minor = i; disk->fops = &rd_bd_op; disk->queue = &rd_queue; sprintf(disk->disk_name, "ram%d", i); + sprintf(disk->devfs_name, "rd/%d", i); set_capacity(disk, rd_size * 2); - sprintf(name, "rd/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); - } - - for (i = 0; i < NUM_RAMDISKS; i++) add_disk(rd_disks[i]); + } #ifdef CONFIG_BLK_DEV_INITRD /* We ought to separate initrd operations here */ set_capacity(initrd_disk, (initrd_end-initrd_start+511)>>9); add_disk(initrd_disk); - devfs_register(NULL, "rd/initrd", DEVFS_FL_DEFAULT, RAMDISK_MAJOR, - INITRD_MINOR, S_IFBLK | S_IRUSR, &rd_bd_op, NULL); #endif /* rd_size is given in kB */ diff -Nru a/drivers/block/swim3.c b/drivers/block/swim3.c --- a/drivers/block/swim3.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/swim3.c Sat Apr 19 14:18:27 2003 @@ -971,15 +971,13 @@ .revalidate_disk= floppy_revalidate, }; -static devfs_handle_t floppy_devfs_handle; - int swim3_init(void) { struct device_node *swim; int err = -ENOMEM; int i; - floppy_devfs_handle = devfs_mk_dir("floppy"); + devfs_mk_dir("floppy"); swim = find_devices("floppy"); while (swim && (floppy_count < MAX_FLOPPIES)) @@ -1017,6 +1015,7 @@ disk->private_data = &floppy_states[i]; disk->queue = &swim3_queue; sprintf(disk->disk_name, "fd%d", i); + sprintf(disk->devfs_name, "floppy/%d", i); set_capacity(disk, 2880); add_disk(disk); } @@ -1033,8 +1032,6 @@ { struct device_node *mediabay; struct floppy_state *fs = &floppy_states[floppy_count]; - char floppy_name[16]; - devfs_handle_t floppy_handle; if (swim->n_addrs < 2) { @@ -1095,12 +1092,6 @@ printk(KERN_INFO "fd%d: SWIM3 floppy controller %s\n", floppy_count, mediabay ? "in media bay" : ""); - - sprintf(floppy_name, "floppy/%d", floppy_count); - floppy_handle = devfs_register(NULL, floppy_name, - DEVFS_FL_DEFAULT, FLOPPY_MAJOR, floppy_count, - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP, - &floppy_fops, NULL); floppy_count++; diff -Nru a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c --- a/drivers/cdrom/aztcd.c Mon Apr 7 06:36:31 2003 +++ b/drivers/cdrom/aztcd.c Sat Apr 19 14:18:27 2003 @@ -180,7 +180,6 @@ #include #include #include -#include #include @@ -1922,12 +1921,9 @@ azt_disk->first_minor = 0; azt_disk->fops = &azt_fops; sprintf(azt_disk->disk_name, "aztcd"); + sprintf(azt_disk->devfs_name, "aztcd"); azt_disk->queue = &azt_queue; add_disk(azt_disk); - devfs_register(NULL, "aztcd", DEVFS_FL_DEFAULT, - azt_disk->major, azt_disk->first_minor, - S_IFBLK | S_IRUGO | S_IWUGO, azt_disk->fops, NULL); - azt_invalidate_buffers(); aztPresent = 1; aztCloseDoor(); @@ -1946,7 +1942,6 @@ static void __exit aztcd_exit(void) { - devfs_remove("aztcd"); del_gendisk(azt_disk); put_disk(azt_disk); if ((unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL)) { diff -Nru a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c --- a/drivers/cdrom/gscd.c Mon Apr 7 06:36:31 2003 +++ b/drivers/cdrom/gscd.c Sat Apr 19 14:18:27 2003 @@ -63,7 +63,6 @@ #include #include #include -#include #include #include @@ -883,7 +882,6 @@ { CLEAR_TIMER; - devfs_remove("gscd"); del_gendisk(gscd_disk); put_disk(gscd_disk); if ((unregister_blkdev(MAJOR_NR, "gscd") == -EINVAL)) { @@ -958,14 +956,12 @@ gscd_disk->first_minor = 0; gscd_disk->fops = &gscd_fops; sprintf(gscd_disk->disk_name, "gscd"); + sprintf(gscd_disk->devfs_name, "gscd"); if (register_blkdev(MAJOR_NR, "gscd")) { ret = -EIO; goto err_out2; } - - devfs_register(NULL, "gscd", DEVFS_FL_DEFAULT, MAJOR_NR, 0, - S_IFBLK | S_IRUGO | S_IWUGO, &gscd_fops, NULL); blk_init_queue(&gscd_queue, do_gscd_request, &gscd_lock); diff -Nru a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c --- a/drivers/cdrom/optcd.c Mon Apr 7 06:36:32 2003 +++ b/drivers/cdrom/optcd.c Sat Apr 19 14:18:27 2003 @@ -71,7 +71,6 @@ #include #include #include -#include #include #include @@ -2033,6 +2032,8 @@ optcd_disk->first_minor = 0; optcd_disk->fops = &opt_fops; sprintf(optcd_disk->disk_name, "optcd"); + sprintf(optcd_disk->devfs_name, "optcd"); + if (!request_region(optcd_port, 4, "optcd")) { printk(KERN_ERR "optcd: conflict, I/O port 0x%x already used\n", optcd_port); @@ -2065,8 +2066,8 @@ put_disk(optcd_disk); return -EIO; } - devfs_register (NULL, "optcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0, - S_IFBLK | S_IRUGO | S_IWUGO, &opt_fops, NULL); + + blk_init_queue(&opt_queue, do_optcd_request, &optcd_lock); blk_queue_hardsect_size(&opt_queue, 2048); optcd_disk->queue = &opt_queue; @@ -2079,7 +2080,6 @@ static void __exit optcd_exit(void) { - devfs_remove("optcd"); del_gendisk(optcd_disk); put_disk(optcd_disk); if (unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL) { diff -Nru a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c --- a/drivers/cdrom/sjcd.c Mon Apr 7 06:36:32 2003 +++ b/drivers/cdrom/sjcd.c Sat Apr 19 14:18:27 2003 @@ -70,7 +70,6 @@ #include #include #include -#include #include #include @@ -1692,6 +1691,7 @@ sjcd_disk->first_minor = 0, sjcd_disk->fops = &sjcd_fops, sprintf(sjcd_disk->disk_name, "sjcd"); + sprintf(sjcd_disk->devfs_name, "sjcd"); if (check_region(sjcd_base, 4)) { printk @@ -1778,8 +1778,6 @@ } printk(KERN_INFO "SJCD: Status: port=0x%x.\n", sjcd_base); - devfs_register(NULL, "sjcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0, - S_IFBLK | S_IRUGO | S_IWUGO, &sjcd_fops, NULL); sjcd_disk->queue = &sjcd_queue; add_disk(sjcd_disk); @@ -1798,7 +1796,6 @@ static void __exit sjcd_exit(void) { - devfs_remove("sjcd"); del_gendisk(sjcd_disk); put_disk(sjcd_disk); release_region(sjcd_base, 4); diff -Nru a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c --- a/drivers/cdrom/sonycd535.c Mon Apr 7 06:36:32 2003 +++ b/drivers/cdrom/sonycd535.c Sat Apr 19 14:18:27 2003 @@ -125,7 +125,6 @@ #include #include #include -#include #define REALLY_SLOW_IO #include @@ -1579,6 +1578,7 @@ cdu_disk->first_minor = 0; cdu_disk->fops = &cdu_fops; sprintf(cdu_disk->disk_name, "cdu"); + sprintf(cdu_disk->devfs_name, "cdu535"); if (!request_region(sony535_cd_base_io, 4, CDU535_HANDLE)) { printk(KERN_WARNING"sonycd535: Unable to request region 0x%x\n", @@ -1587,10 +1587,6 @@ } cdu_disk->queue = &sonycd535_queue; add_disk(cdu_disk); - devfs_register (NULL, CDU535_HANDLE, DEVFS_FL_DEFAULT, - cdu_disk->major, cdu_disk->first_minor, - S_IFBLK | S_IRUGO | S_IWUGO, - cdu_disk->fops, NULL); return 0; out7: @@ -1666,7 +1662,6 @@ kfree(sony_buffer); kfree(last_sony_subcode); kfree(sony_toc); - devfs_remove(CDU535_HANDLE); del_gendisk(cdu_disk); put_disk(cdu_disk); blk_cleanup_queue(&sonycd535_queue); diff -Nru a/drivers/char/Kconfig b/drivers/char/Kconfig --- a/drivers/char/Kconfig Tue Mar 18 08:57:58 2003 +++ b/drivers/char/Kconfig Sun Apr 20 12:56:51 2003 @@ -487,7 +487,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the diff -Nru a/drivers/char/applicom.c b/drivers/char/applicom.c --- a/drivers/char/applicom.c Thu Apr 3 15:03:46 2003 +++ b/drivers/char/applicom.c Mon Apr 21 00:54:32 2003 @@ -108,7 +108,7 @@ static ssize_t ac_write (struct file *, const char *, size_t, loff_t *); static int ac_ioctl(struct inode *, struct file *, unsigned int, unsigned long); -static void ac_interrupt(int, void *, struct pt_regs *); +static irqreturn_t ac_interrupt(int, void *, struct pt_regs *); static struct file_operations ac_fops = { .owner = THIS_MODULE, @@ -606,11 +606,12 @@ } } -static void ac_interrupt(int vec, void *dev_instance, struct pt_regs *regs) +static irqreturn_t ac_interrupt(int vec, void *dev_instance, struct pt_regs *regs) { unsigned int i; unsigned int FlagInt; unsigned int LoopCount; + int handled = 0; // printk("Applicom interrupt on IRQ %d occurred\n", vec); @@ -632,6 +633,7 @@ continue; } + handled = 1; FlagInt = 1; writeb(0, apbs[i].RamIO + RAM_IT_TO_PC); @@ -675,6 +677,7 @@ else LoopCount++; } while(LoopCount < 2); + return IRQ_RETVAL(handled); } diff -Nru a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h --- a/drivers/char/drm/drmP.h Wed Apr 9 21:45:21 2003 +++ b/drivers/char/drm/drmP.h Sun Apr 20 14:14:28 2003 @@ -837,7 +837,7 @@ unsigned int cmd, unsigned long arg ); extern int DRM(irq_install)( drm_device_t *dev, int irq ); extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern void DRM(dma_service)( int irq, void *device, +extern irqreturn_t DRM(dma_service)( int irq, void *device, struct pt_regs *regs ); extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); diff -Nru a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c --- a/drivers/char/drm/i830_dma.c Wed Apr 9 21:45:21 2003 +++ b/drivers/char/drm/i830_dma.c Sun Apr 20 14:12:17 2003 @@ -52,14 +52,6 @@ #define up_write up #endif -#ifndef LockPage -#define LockPage(page) set_bit(PG_locked, &(page)->flags) -#endif -#ifndef UnlockPage -#define UnlockPage(page) unlock_page(page) -#endif - - static inline void i830_print_status_page(drm_device_t *dev) { drm_device_dma_t *dma = dev->dma; @@ -176,10 +168,10 @@ buf->bus_address); dev_priv->mmap_buffer = NULL; filp->f_op = old_fops; - if ((unsigned long)buf_priv->virtual > -1024UL) { + if (IS_ERR(buf_priv->virtual)) { /* Real error */ DRM_ERROR("mmap error\n"); - retcode = (signed int)buf_priv->virtual; + retcode = PTR_ERR(buf_priv->virtual); buf_priv->virtual = 0; } up_write( ¤t->mm->mmap_sem ); @@ -454,7 +446,7 @@ memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE); DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page); - I830_WRITE(0x02080, virt_to_bus((void *)dev_priv->hw_status_page)); + I830_WRITE(0x02080, dev_priv->dma_status_page); DRM_DEBUG("Enabled hardware status page\n"); /* Now we need to init our freelist */ diff -Nru a/drivers/char/drm/mga_irq.c b/drivers/char/drm/mga_irq.c --- a/drivers/char/drm/mga_irq.c Wed Dec 18 09:56:28 2002 +++ b/drivers/char/drm/mga_irq.c Mon Apr 21 00:57:06 2003 @@ -36,7 +36,7 @@ #include "mga_drm.h" #include "mga_drv.h" -void mga_dma_service( DRM_IRQ_ARGS ) +irqreturn_t mga_dma_service( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_mga_private_t *dev_priv = @@ -51,7 +51,9 @@ atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); DRM(vbl_send_signals)( dev ); + return IRQ_HANDLED; } + return IRQ_NONE; } int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence) diff -Nru a/drivers/char/drm/r128_irq.c b/drivers/char/drm/r128_irq.c --- a/drivers/char/drm/r128_irq.c Wed Dec 18 09:56:28 2002 +++ b/drivers/char/drm/r128_irq.c Mon Apr 21 00:58:08 2003 @@ -36,7 +36,7 @@ #include "r128_drm.h" #include "r128_drv.h" -void r128_dma_service( DRM_IRQ_ARGS ) +irqreturn_t r128_dma_service( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_r128_private_t *dev_priv = @@ -51,7 +51,9 @@ atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); DRM(vbl_send_signals)( dev ); + return IRQ_HANDLED; } + return IRQ_NONE; } int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence) diff -Nru a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c --- a/drivers/char/drm/radeon_irq.c Sat Mar 29 22:34:33 2003 +++ b/drivers/char/drm/radeon_irq.c Sun Apr 20 14:14:28 2003 @@ -54,7 +54,7 @@ * tied to dma at all, this is just a hangover from dri prehistory. */ -void DRM(dma_service)( DRM_IRQ_ARGS ) +irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_radeon_private_t *dev_priv = @@ -67,7 +67,7 @@ stat = RADEON_READ(RADEON_GEN_INT_STATUS) & (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT); if (!stat) - return; + return IRQ_NONE; /* SW interrupt */ if (stat & RADEON_SW_INT_TEST) { @@ -83,6 +83,7 @@ /* Acknowledge interrupts we handle */ RADEON_WRITE(RADEON_GEN_INT_STATUS, stat); + return IRQ_HANDLED; } static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv) diff -Nru a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c --- a/drivers/char/ftape/lowlevel/fdc-io.c Fri Feb 7 07:59:17 2003 +++ b/drivers/char/ftape/lowlevel/fdc-io.c Mon Apr 21 00:55:07 2003 @@ -1298,18 +1298,21 @@ TRACE_EXIT 0; } -static void ftape_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ftape_interrupt(int irq, void *dev_id, struct pt_regs *regs) { void (*handler) (void) = *fdc.hook; + int handled = 0; TRACE_FUN(ft_t_any); *fdc.hook = NULL; if (handler) { + handled = 1; handler(); } else { TRACE(ft_t_bug, "Unexpected ftape interrupt"); } TRACE_EXIT; + return IRQ_RETVAL(handled); } int fdc_grab_irq_and_dma(void) diff -Nru a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c --- a/drivers/char/ipmi/ipmi_devintf.c Thu Apr 17 12:39:33 2003 +++ b/drivers/char/ipmi/ipmi_devintf.c Fri Apr 18 11:01:14 2003 @@ -437,10 +437,7 @@ static int ipmi_major = 0; MODULE_PARM(ipmi_major, "i"); -static devfs_handle_t devfs_handle; - #define MAX_DEVICES 10 -static devfs_handle_t handles[MAX_DEVICES]; static void ipmi_new_smi(int if_num) { @@ -451,10 +448,9 @@ snprintf(name, sizeof(name), "ipmidev/%d", if_num); - handles[if_num] = devfs_register(NULL, name, DEVFS_FL_NONE, - ipmi_major, if_num, - S_IFCHR | S_IRUSR | S_IWUSR, - &ipmi_fops, NULL); + devfs_register(NULL, name, 0, ipmi_major, if_num, + S_IFCHR | S_IRUSR | S_IWUSR, + &ipmi_fops, NULL); } static void ipmi_smi_gone(int if_num) @@ -462,7 +458,7 @@ if (if_num > MAX_DEVICES) return; - devfs_unregister(handles[if_num]); + devfs_remove("ipmidev/%d", if_num); } static struct ipmi_smi_watcher smi_watcher = @@ -488,7 +484,7 @@ ipmi_major = rv; } - devfs_handle = devfs_mk_dir(DEVICE_NAME); + devfs_mk_dir(DEVICE_NAME); rv = ipmi_smi_watcher_register(&smi_watcher); if (rv) { @@ -507,7 +503,7 @@ static __exit void cleanup_ipmi(void) { ipmi_smi_watcher_unregister(&smi_watcher); - devfs_unregister(devfs_handle); + devfs_remove(DEVICE_NAME); unregister_chrdev(ipmi_major, DEVICE_NAME); } module_exit(cleanup_ipmi); diff -Nru a/drivers/char/ipmi/ipmi_kcs_intf.c b/drivers/char/ipmi/ipmi_kcs_intf.c --- a/drivers/char/ipmi/ipmi_kcs_intf.c Mon Apr 7 16:44:29 2003 +++ b/drivers/char/ipmi/ipmi_kcs_intf.c Mon Apr 21 00:44:13 2003 @@ -629,6 +629,7 @@ atomic_set(&kcs_info->req_events, 1); } +#if 0 static int new_user(void *send_info) { if (!try_module_get(THIS_MODULE)) @@ -640,6 +641,7 @@ { module_put(THIS_MODULE); } +#endif static int initialized = 0; @@ -740,7 +742,7 @@ spin_unlock_irqrestore(&(kcs_info->kcs_lock), flags); } -static void kcs_irq_handler(int irq, void *data, struct pt_regs *regs) +static irqreturn_t kcs_irq_handler(int irq, void *data, struct pt_regs *regs) { struct kcs_info *kcs_info = (struct kcs_info *) data; unsigned long flags; @@ -759,6 +761,7 @@ kcs_event_handler(kcs_info, 0); out: spin_unlock_irqrestore(&(kcs_info->kcs_lock), flags); + return IRQ_HANDLED; } static struct ipmi_smi_handlers handlers = diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c --- a/drivers/char/keyboard.c Wed Feb 12 01:49:20 2003 +++ b/drivers/char/keyboard.c Sat Apr 19 23:22:30 2003 @@ -601,7 +601,7 @@ return; if ((kbd->kbdmode == VC_RAW || kbd->kbdmode == VC_MEDIUMRAW) && - value != K_SAK) + value != KVAL(K_SAK)) return; /* SAK is allowed even in raw mode */ fn_handler[value](vc, regs); } diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c --- a/drivers/char/misc.c Fri Apr 18 08:56:44 2003 +++ b/drivers/char/misc.c Sat Apr 19 02:56:45 2003 @@ -167,7 +167,6 @@ int misc_register(struct miscdevice * misc) { struct miscdevice *c; - char buf[256]; if (misc->next || misc->prev) return -EBUSY; @@ -197,14 +196,21 @@ misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); - /* yuck, yet another stupid special-casing. We should rather - add ->devfs_name to avoid this mess. */ - snprintf(buf, sizeof(buf), strchr(misc->name, '/') ? - "%s" : "misc/%s", misc->name); - misc->devfs_handle = devfs_register(NULL, buf, 0, - MISC_MAJOR, misc->minor, - S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, - misc->fops, NULL); + /* + * please use it if you want to do fancy things with your + * name... + */ + if (misc->devfs_name[0] == '\0') { + /* yuck, yet another stupid special-casing. + whos actually using this? Please switch over + to ->devfs_name ASAP */ + snprintf(misc->devfs_name, sizeof(misc->devfs_name), + strchr(misc->name, '/') ? + "%s" : "misc/%s", misc->name); + } + + devfs_register(NULL, misc->devfs_name, 0, MISC_MAJOR, misc->minor, + S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, misc->fops, NULL); /* * Add it to the front, so that later devices can "override" @@ -238,7 +244,7 @@ misc->next->prev = misc->prev; misc->next = NULL; misc->prev = NULL; - devfs_unregister (misc->devfs_handle); + devfs_remove(misc->devfs_name); if (i < DYNAMIC_MINORS && i>0) { misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); } diff -Nru a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c --- a/drivers/char/mwave/tp3780i.c Sun Nov 17 11:34:12 2002 +++ b/drivers/char/mwave/tp3780i.c Mon Apr 21 00:55:57 2003 @@ -96,13 +96,14 @@ } -static void UartInterrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t UartInterrupt(int irq, void *dev_id, struct pt_regs *regs) { PRINTK_3(TRACE_TP3780I, "tp3780i::UartInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id); + return IRQ_HANDLED; } -static void DspInterrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t DspInterrupt(int irq, void *dev_id, struct pt_regs *regs) { pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd; DSP_3780I_CONFIG_SETTINGS *pSettings = &pDrvData->rBDData.rDspSettings; @@ -150,6 +151,7 @@ "tp3780i::DspInterrupt, return false from dsp3780i_GetIPCSource\n"); } PRINTK_1(TRACE_TP3780I, "tp3780i::DspInterrupt exit\n"); + return IRQ_HANDLED; } diff -Nru a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c --- a/drivers/char/n_hdlc.c Tue Feb 25 02:08:20 2003 +++ b/drivers/char/n_hdlc.c Mon Apr 21 12:15:08 2003 @@ -9,7 +9,7 @@ * Al Longyear , Paul Mackerras * * Original release 01/11/99 - * $Id: n_hdlc.c,v 4.2 2002/10/10 14:52:41 paulkf Exp $ + * $Id: n_hdlc.c,v 4.6 2003/04/21 19:14:07 paulkf Exp $ * * This code is released under the GNU General Public License (GPL) * @@ -78,7 +78,7 @@ */ #define HDLC_MAGIC 0x239e -#define HDLC_VERSION "$Revision: 4.2 $" +#define HDLC_VERSION "$Revision: 4.6 $" #include #include @@ -171,9 +171,9 @@ /* * HDLC buffer list manipulation functions */ -void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list); -void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf); -N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list); +static void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list); +static void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf); +static N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list); /* Local functions */ @@ -299,7 +299,6 @@ n_hdlc->tty = n_hdlc->backup_tty; } else { n_hdlc_release (n_hdlc); - MOD_DEC_USE_COUNT; } } @@ -339,8 +338,6 @@ tty->disc_data = n_hdlc; n_hdlc->tty = tty; - MOD_INC_USE_COUNT; - #if defined(TTY_NO_WRITE_SPLIT) /* change tty_io write() to not split large writes into 8K chunks */ set_bit(TTY_NO_WRITE_SPLIT,&tty->flags); @@ -903,7 +900,7 @@ * Arguments: list pointer to buffer list * Return Value: None */ -void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list) +static void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list) { memset(list,0,sizeof(N_HDLC_BUF_LIST)); spin_lock_init(&list->spinlock); @@ -920,7 +917,7 @@ * * Return Value: None */ -void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf) +static void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf) { unsigned long flags; spin_lock_irqsave(&list->spinlock,flags); @@ -950,7 +947,7 @@ * * pointer to HDLC buffer if available, otherwise NULL */ -N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list) +static N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list) { unsigned long flags; N_HDLC_BUF *buf; @@ -971,7 +968,25 @@ static int __init n_hdlc_init(void) { - static struct tty_ldisc n_hdlc_ldisc; + static struct tty_ldisc n_hdlc_ldisc = { + TTY_LDISC_MAGIC, /* magic */ + "hdlc", /* name */ + 0, /* num */ + 0, /* flags */ + n_hdlc_tty_open, /* open */ + n_hdlc_tty_close, /* close */ + 0, /* flush_buffer */ + 0, /* chars_in_buffer */ + n_hdlc_tty_read, /* read */ + n_hdlc_tty_write, /* write */ + n_hdlc_tty_ioctl, /* ioctl */ + 0, /* set_termios */ + n_hdlc_tty_poll, /* poll */ + n_hdlc_tty_receive, /* receive_buf */ + n_hdlc_tty_room, /* receive_room */ + n_hdlc_tty_wakeup, /* write_wakeup */ + THIS_MODULE /* owner */ + }; int status; /* range check maxframe arg */ @@ -982,21 +997,6 @@ printk("HDLC line discipline: version %s, maxframe=%u\n", szVersion, maxframe); - - /* Register the tty discipline */ - - memset(&n_hdlc_ldisc, 0, sizeof (n_hdlc_ldisc)); - n_hdlc_ldisc.magic = TTY_LDISC_MAGIC; - n_hdlc_ldisc.name = "hdlc"; - n_hdlc_ldisc.open = n_hdlc_tty_open; - n_hdlc_ldisc.close = n_hdlc_tty_close; - n_hdlc_ldisc.read = n_hdlc_tty_read; - n_hdlc_ldisc.write = n_hdlc_tty_write; - n_hdlc_ldisc.ioctl = n_hdlc_tty_ioctl; - n_hdlc_ldisc.poll = n_hdlc_tty_poll; - n_hdlc_ldisc.receive_room = n_hdlc_tty_room; - n_hdlc_ldisc.receive_buf = n_hdlc_tty_receive; - n_hdlc_ldisc.write_wakeup = n_hdlc_tty_wakeup; status = tty_register_ldisc(N_HDLC, &n_hdlc_ldisc); if (!status) diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c --- a/drivers/char/pcmcia/synclink_cs.c Mon Mar 17 07:43:03 2003 +++ b/drivers/char/pcmcia/synclink_cs.c Mon Apr 21 10:54:07 2003 @@ -1,7 +1,7 @@ /* * linux/drivers/char/pcmcia/synclink_cs.c * - * $Id: synclink_cs.c,v 4.4 2002/10/10 14:53:37 paulkf Exp $ + * $Id: synclink_cs.c,v 4.6 2003/04/21 17:46:55 paulkf Exp $ * * Device driver for Microgate SyncLink PC Card * multiprotocol serial adapter. @@ -442,9 +442,9 @@ /* * ioctl handlers */ -static int set_modem_info(MGSLPC_INFO *info, unsigned int cmd, - unsigned int *value); -static int get_modem_info(MGSLPC_INFO *info, unsigned int *value); +static int tiocmget(struct tty_struct *tty, struct file *file); +static int tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear); static int get_stats(MGSLPC_INFO *info, struct mgsl_icount *user_icount); static int get_params(MGSLPC_INFO *info, MGSL_PARAMS *user_params); static int set_params(MGSLPC_INFO *info, MGSL_PARAMS *new_params); @@ -496,7 +496,7 @@ MODULE_LICENSE("GPL"); static char *driver_name = "SyncLink PC Card driver"; -static char *driver_version = "$Revision: 4.4 $"; +static char *driver_version = "$Revision: 4.6 $"; static struct tty_driver serial_driver, callout_driver; static int serial_refcount; @@ -2326,94 +2326,56 @@ return rc; } -/* Return state of the serial control/status signals - * - * Arguments: info pointer to device instance data - * value pointer to int to hold returned info - * - * Return Value: 0 if success, otherwise error code +/* return the state of the serial control and status signals */ -static int get_modem_info(MGSLPC_INFO * info, unsigned int *value) +static int tiocmget(struct tty_struct *tty, struct file *file) { + MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned int result; unsigned long flags; - int err; - + spin_lock_irqsave(&info->lock,flags); get_signals(info); spin_unlock_irqrestore(&info->lock,flags); - result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS:0) | - ((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR:0) | - ((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR:0) | - ((info->serial_signals & SerialSignal_RI) ? TIOCM_RNG:0) | - ((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR:0) | - ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0); + result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS:0) + + ((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR:0) + + ((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR:0) + + ((info->serial_signals & SerialSignal_RI) ? TIOCM_RNG:0) + + ((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR:0) + + ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0); if (debug_level >= DEBUG_LEVEL_INFO) - printk("mgslpc_get_modem_info %s value=%08X\n", info->device_name, result); - - PUT_USER(err,result,value); - return err ? -EFAULT : 0; + printk("%s(%d):%s tiocmget() value=%08X\n", + __FILE__,__LINE__, info->device_name, result ); + return result; } -/* Set the state of the modem control signals (DTR/RTS) - * - * Arguments: - * - * info pointer to device instance data - * cmd signal command: TIOCMBIS = set bit TIOCMBIC = clear bit - * TIOCMSET = set/clear signal values - * value bit mask for command - * - * Return Value: 0 if success, otherwise error code +/* set modem control signals (DTR/RTS) */ -static int set_modem_info(MGSLPC_INFO * info, unsigned int cmd, - unsigned int *value) +static int tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear) { - int error; - unsigned int arg; + MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned long flags; - + if (debug_level >= DEBUG_LEVEL_INFO) - printk("mgslpc_set_modem_info %s\n", info->device_name); - - GET_USER(error,arg,value); - if (error) - return error; - - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - info->serial_signals |= SerialSignal_RTS; - if (arg & TIOCM_DTR) - info->serial_signals |= SerialSignal_DTR; - break; - case TIOCMBIC: - if (arg & TIOCM_RTS) - info->serial_signals &= ~SerialSignal_RTS; - if (arg & TIOCM_DTR) - info->serial_signals &= ~SerialSignal_DTR; - break; - case TIOCMSET: - if (arg & TIOCM_RTS) - info->serial_signals |= SerialSignal_RTS; - else - info->serial_signals &= ~SerialSignal_RTS; - - if (arg & TIOCM_DTR) - info->serial_signals |= SerialSignal_DTR; - else - info->serial_signals &= ~SerialSignal_DTR; - break; - default: - return -EINVAL; - } - + printk("%s(%d):%s tiocmset(%x,%x)\n", + __FILE__,__LINE__,info->device_name, set, clear); + + if (set & TIOCM_RTS) + info->serial_signals |= SerialSignal_RTS; + if (set & TIOCM_DTR) + info->serial_signals |= SerialSignal_DTR; + if (clear & TIOCM_RTS) + info->serial_signals &= ~SerialSignal_RTS; + if (clear & TIOCM_DTR) + info->serial_signals &= ~SerialSignal_DTR; + spin_lock_irqsave(&info->lock,flags); set_signals(info); spin_unlock_irqrestore(&info->lock,flags); - + return 0; } @@ -2482,12 +2444,6 @@ unsigned long flags; switch (cmd) { - case TIOCMGET: - return get_modem_info(info, (unsigned int *) arg); - case TIOCMBIS: - case TIOCMBIC: - case TIOCMSET: - return set_modem_info(info, cmd, (unsigned int *) arg); case MGSL_IOCGPARAMS: return get_params(info,(MGSL_PARAMS *)arg); case MGSL_IOCSPARAMS: @@ -2687,7 +2643,6 @@ if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgslpc_close(%s) exit, count=%d\n", __FILE__,__LINE__, tty->driver.name, info->count); - MOD_DEC_USE_COUNT; } /* Wait until the transmitter is empty. @@ -2939,8 +2894,6 @@ printk("%s(%d):mgslpc_open(%s), old ref count = %d\n", __FILE__,__LINE__,tty->driver.name, info->count); - MOD_INC_USE_COUNT; - /* If port is closing, signal caller to try again */ if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){ if (info->flags & ASYNC_CLOSING) @@ -2995,7 +2948,6 @@ cleanup: if (retval) { - MOD_DEC_USE_COUNT; if(info->count) info->count--; } @@ -3247,6 +3199,7 @@ memset(&serial_driver, 0, sizeof(struct tty_driver)); serial_driver.magic = TTY_DRIVER_MAGIC; + serial_driver.owner = THIS_MODULE; serial_driver.driver_name = "synclink_cs"; serial_driver.name = "ttySLP"; serial_driver.major = ttymajor; @@ -3282,6 +3235,8 @@ serial_driver.stop = tx_pause; serial_driver.start = tx_release; serial_driver.hangup = mgslpc_hangup; + serial_driver.tiocmget = tiocmget; + serial_driver.tiocmset = tiocmset; /* * The callout device is just like normal device except for @@ -4386,7 +4341,7 @@ { MGSLPC_INFO *info = d->priv; int err; - long flags; + unsigned long flags; if (debug_level >= DEBUG_LEVEL_INFO) printk("mgslpc_sppp_open(%s)\n",info->netname); @@ -4398,7 +4353,6 @@ return -EBUSY; } info->netcount=1; - MOD_INC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); /* claim resources and init adapter */ @@ -4421,7 +4375,6 @@ open_fail: spin_lock_irqsave(&info->netlock, flags); info->netcount=0; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); return err; } @@ -4429,7 +4382,7 @@ void mgslpc_sppp_tx_timeout(struct net_device *dev) { MGSLPC_INFO *info = dev->priv; - long flags; + unsigned long flags; if (debug_level >= DEBUG_LEVEL_INFO) printk("mgslpc_sppp_tx_timeout(%s)\n",info->netname); @@ -4491,7 +4444,6 @@ spin_lock_irqsave(&info->netlock, flags); info->netcount=0; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); return 0; } diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c --- a/drivers/char/rtc.c Tue Mar 18 08:58:24 2003 +++ b/drivers/char/rtc.c Mon Apr 21 10:36:31 2003 @@ -180,7 +180,7 @@ * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) */ -static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* * Can be an alarm interrupt, update complete interrupt, @@ -207,6 +207,8 @@ wake_up_interruptible(&rtc_wait); kill_fasync (&rtc_async_queue, SIGIO, POLL_IN); + + return IRQ_HANDLED; } #endif diff -Nru a/drivers/char/sonypi.c b/drivers/char/sonypi.c --- a/drivers/char/sonypi.c Tue Apr 1 13:08:01 2003 +++ b/drivers/char/sonypi.c Mon Apr 21 00:53:24 2003 @@ -305,7 +305,7 @@ } /* Interrupt handler: some event is available */ -void sonypi_irq(int irq, void *dev_id, struct pt_regs *regs) { +static irqreturn_t sonypi_irq(int irq, void *dev_id, struct pt_regs *regs) { u8 v1, v2, event = 0; int i, j; @@ -334,7 +334,7 @@ if (verbose) printk(KERN_WARNING "sonypi: unknown event port1=0x%02x,port2=0x%02x\n",v1,v2); - return; + return IRQ_NONE; found: #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) @@ -354,6 +354,7 @@ } #endif /* CONFIG_INPUT || CONFIG_INPUT_MODULE */ sonypi_pushq(event); + return IRQ_HANDLED; } /* External camera command (exported to the motion eye v4l driver) */ diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c --- a/drivers/char/synclink.c Tue Feb 25 09:44:33 2003 +++ b/drivers/char/synclink.c Mon Apr 21 10:54:07 2003 @@ -1,7 +1,7 @@ /* * linux/drivers/char/synclink.c * - * $Id: synclink.c,v 4.4 2002/10/10 14:53:36 paulkf Exp $ + * $Id: synclink.c,v 4.6 2003/04/21 17:46:54 paulkf Exp $ * * Device driver for Microgate SyncLink ISA and PCI * high speed multiprotocol serial adapters. @@ -854,9 +854,9 @@ /* * ioctl call handlers */ -static int set_modem_info(struct mgsl_struct * info, unsigned int cmd, - unsigned int *value); -static int get_modem_info(struct mgsl_struct * info, unsigned int *value); +static int tiocmget(struct tty_struct *tty, struct file *file); +static int tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear); static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount *user_icount); static int mgsl_get_params(struct mgsl_struct * info, MGSL_PARAMS *user_params); @@ -917,7 +917,7 @@ MODULE_PARM(txholdbufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i"); static char *driver_name = "SyncLink serial driver"; -static char *driver_version = "$Revision: 4.4 $"; +static char *driver_version = "$Revision: 4.6 $"; static int synclink_init_one (struct pci_dev *dev, const struct pci_device_id *ent); @@ -2921,110 +2921,58 @@ return rc; } -/* get_modem_info() - * - * Read the state of the serial control and - * status signals and return to caller. - * - * Arguments: info pointer to device instance data - * value pointer to int to hold returned info - * - * Return Value: 0 if success, otherwise error code +/* return the state of the serial control and status signals */ -static int get_modem_info(struct mgsl_struct * info, unsigned int *value) +static int tiocmget(struct tty_struct *tty, struct file *file) { - unsigned int result = 0; + struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data; + unsigned int result; unsigned long flags; - int err; - + spin_lock_irqsave(&info->irq_spinlock,flags); usc_get_serial_signals(info); spin_unlock_irqrestore(&info->irq_spinlock,flags); - if (info->serial_signals & SerialSignal_RTS) - result |= TIOCM_RTS; - if (info->serial_signals & SerialSignal_DTR) - result |= TIOCM_DTR; - if (info->serial_signals & SerialSignal_DCD) - result |= TIOCM_CAR; - if (info->serial_signals & SerialSignal_RI) - result |= TIOCM_RNG; - if (info->serial_signals & SerialSignal_DSR) - result |= TIOCM_DSR; - if (info->serial_signals & SerialSignal_CTS) - result |= TIOCM_CTS; + result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS:0) + + ((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR:0) + + ((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR:0) + + ((info->serial_signals & SerialSignal_RI) ? TIOCM_RNG:0) + + ((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR:0) + + ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0); if (debug_level >= DEBUG_LEVEL_INFO) - printk("%s(%d):mgsl_get_modem_info %s value=%08X\n", + printk("%s(%d):%s tiocmget() value=%08X\n", __FILE__,__LINE__, info->device_name, result ); - - PUT_USER(err,result,value); - return err; -} /* end of get_modem_info() */ + return result; +} -/* set_modem_info() - * - * Set the state of the modem control signals (DTR/RTS) - * - * Arguments: - * - * info pointer to device instance data - * cmd signal command: TIOCMBIS = set bit TIOCMBIC = clear bit - * TIOCMSET = set/clear signal values - * value bit mask for command - * - * Return Value: 0 if success, otherwise error code +/* set modem control signals (DTR/RTS) */ -static int set_modem_info(struct mgsl_struct * info, unsigned int cmd, - unsigned int *value) +static int tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear) { - int error; - unsigned int arg; + struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data; unsigned long flags; - + if (debug_level >= DEBUG_LEVEL_INFO) - printk("%s(%d):mgsl_set_modem_info %s\n", __FILE__,__LINE__, - info->device_name ); - - GET_USER(error,arg,value); - if (error) - return error; - - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - info->serial_signals |= SerialSignal_RTS; - if (arg & TIOCM_DTR) - info->serial_signals |= SerialSignal_DTR; - break; - case TIOCMBIC: - if (arg & TIOCM_RTS) - info->serial_signals &= ~SerialSignal_RTS; - if (arg & TIOCM_DTR) - info->serial_signals &= ~SerialSignal_DTR; - break; - case TIOCMSET: - if (arg & TIOCM_RTS) - info->serial_signals |= SerialSignal_RTS; - else - info->serial_signals &= ~SerialSignal_RTS; - - if (arg & TIOCM_DTR) - info->serial_signals |= SerialSignal_DTR; - else - info->serial_signals &= ~SerialSignal_DTR; - break; - default: - return -EINVAL; - } - + printk("%s(%d):%s tiocmset(%x,%x)\n", + __FILE__,__LINE__,info->device_name, set, clear); + + if (set & TIOCM_RTS) + info->serial_signals |= SerialSignal_RTS; + if (set & TIOCM_DTR) + info->serial_signals |= SerialSignal_DTR; + if (clear & TIOCM_RTS) + info->serial_signals &= ~SerialSignal_RTS; + if (clear & TIOCM_DTR) + info->serial_signals &= ~SerialSignal_DTR; + spin_lock_irqsave(&info->irq_spinlock,flags); usc_set_serial_signals(info); spin_unlock_irqrestore(&info->irq_spinlock,flags); - + return 0; - -} /* end of set_modem_info() */ +} /* mgsl_break() Set or clear transmit break condition * @@ -3093,12 +3041,6 @@ unsigned long flags; switch (cmd) { - case TIOCMGET: - return get_modem_info(info, (unsigned int *) arg); - case TIOCMBIS: - case TIOCMBIC: - case TIOCMSET: - return set_modem_info(info, cmd, (unsigned int *) arg); case MGSL_IOCGPARAMS: return mgsl_get_params(info,(MGSL_PARAMS *)arg); case MGSL_IOCSPARAMS: @@ -3323,7 +3265,6 @@ if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgsl_close(%s) exit, count=%d\n", __FILE__,__LINE__, tty->driver.name, info->count); - MOD_DEC_USE_COUNT; } /* end of mgsl_close() */ @@ -3615,8 +3556,6 @@ printk("%s(%d):mgsl_open(%s), old ref count = %d\n", __FILE__,__LINE__,tty->driver.name, info->count); - MOD_INC_USE_COUNT; - /* If port is closing, signal caller to try again */ if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){ if (info->flags & ASYNC_CLOSING) @@ -3683,7 +3622,6 @@ cleanup: if (retval) { - MOD_DEC_USE_COUNT; if(info->count) info->count--; } @@ -4571,6 +4509,7 @@ memset(&serial_driver, 0, sizeof(struct tty_driver)); serial_driver.magic = TTY_DRIVER_MAGIC; + serial_driver.owner = THIS_MODULE; serial_driver.driver_name = "synclink"; serial_driver.name = "ttySL"; serial_driver.major = ttymajor; @@ -4606,6 +4545,8 @@ serial_driver.stop = mgsl_stop; serial_driver.start = mgsl_start; serial_driver.hangup = mgsl_hangup; + serial_driver.tiocmget = tiocmget; + serial_driver.tiocmset = tiocmset; /* * The callout device is just like normal device except for @@ -8003,7 +7944,6 @@ return -EBUSY; } info->netcount=1; - MOD_INC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); /* claim resources and init adapter */ @@ -8026,7 +7966,6 @@ open_fail: spin_lock_irqsave(&info->netlock, flags); info->netcount=0; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); return err; } @@ -8092,7 +8031,6 @@ spin_lock_irqsave(&info->netlock, flags); info->netcount=0; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); return 0; } diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c --- a/drivers/char/synclinkmp.c Tue Feb 25 02:18:16 2003 +++ b/drivers/char/synclinkmp.c Mon Apr 21 10:54:07 2003 @@ -1,5 +1,5 @@ /* - * $Id: synclinkmp.c,v 4.6 2002/10/10 14:50:47 paulkf Exp $ + * $Id: synclinkmp.c,v 4.8 2003/04/21 17:46:55 paulkf Exp $ * * Device driver for Microgate SyncLink Multiport * high speed multiprotocol serial adapter. @@ -503,7 +503,7 @@ MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICES) "i"); static char *driver_name = "SyncLink MultiPort driver"; -static char *driver_version = "$Revision: 4.6 $"; +static char *driver_version = "$Revision: 4.8 $"; static int synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent); static void synclinkmp_remove_one(struct pci_dev *dev); @@ -592,8 +592,9 @@ static int map_status(int signals); static int modem_input_wait(SLMP_INFO *info,int arg); static int wait_mgsl_event(SLMP_INFO *info, int *mask_ptr); -static int get_modem_info(SLMP_INFO *info, unsigned int *value); -static int set_modem_info(SLMP_INFO *info, unsigned int cmd,unsigned int *value); +static int tiocmget(struct tty_struct *tty, struct file *file); +static int tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear); static void set_break(struct tty_struct *tty, int break_state); static void add_device(SLMP_INFO *info); @@ -770,8 +771,6 @@ printk("%s(%d):%s open(), old ref count = %d\n", __FILE__,__LINE__,tty->driver.name, info->count); - MOD_INC_USE_COUNT; - /* If port is closing, signal caller to try again */ if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){ if (info->flags & ASYNC_CLOSING) @@ -826,7 +825,6 @@ cleanup: if (retval) { - MOD_DEC_USE_COUNT; if(info->count) info->count--; } @@ -925,7 +923,6 @@ if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s close() exit, count=%d\n", __FILE__,__LINE__, tty->driver.name, info->count); - MOD_DEC_USE_COUNT; } /* Called by tty_hangup() when a hangup is signaled. @@ -1387,12 +1384,6 @@ } switch (cmd) { - case TIOCMGET: - return get_modem_info(info, (unsigned int *) arg); - case TIOCMBIS: - case TIOCMBIC: - case TIOCMSET: - return set_modem_info(info, cmd, (unsigned int *) arg); case MGSL_IOCGPARAMS: return get_params(info,(MGSL_PARAMS *)arg); case MGSL_IOCSPARAMS: @@ -1717,7 +1708,7 @@ { SLMP_INFO *info = d->priv; int err; - long flags; + unsigned long flags; if (debug_level >= DEBUG_LEVEL_INFO) printk("sppp_cb_open(%s)\n",info->netname); @@ -1729,7 +1720,6 @@ return -EBUSY; } info->netcount=1; - MOD_INC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); /* claim resources and init adapter */ @@ -1752,7 +1742,6 @@ open_fail: spin_lock_irqsave(&info->netlock, flags); info->netcount=0; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); return err; } @@ -1760,7 +1749,7 @@ static void sppp_cb_tx_timeout(struct net_device *dev) { SLMP_INFO *info = dev->priv; - long flags; + unsigned long flags; if (debug_level >= DEBUG_LEVEL_INFO) printk("sppp_tx_timeout(%s)\n",info->netname); @@ -1818,7 +1807,6 @@ spin_lock_irqsave(&info->netlock, flags); info->netcount=0; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&info->netlock, flags); return 0; } @@ -3146,11 +3134,11 @@ /* return the state of the serial control and status signals */ -static int get_modem_info(SLMP_INFO * info, unsigned int *value) +static int tiocmget(struct tty_struct *tty, struct file *file) { + SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; unsigned int result; unsigned long flags; - int err; spin_lock_irqsave(&info->lock,flags); get_signals(info); @@ -3164,61 +3152,31 @@ ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0); if (debug_level >= DEBUG_LEVEL_INFO) - printk("%s(%d):%s synclinkmp_get_modem_info() value=%08X\n", + printk("%s(%d):%s tiocmget() value=%08X\n", __FILE__,__LINE__, info->device_name, result ); - - PUT_USER(err,result,value); - return err; + return result; } /* set modem control signals (DTR/RTS) - * - * cmd signal command: TIOCMBIS = set bit TIOCMBIC = clear bit - * TIOCMSET = set/clear signal values - * value bit mask for command */ -static int set_modem_info(SLMP_INFO * info, unsigned int cmd, - unsigned int *value) +static int tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear) { - int error; - unsigned int arg; + SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; unsigned long flags; if (debug_level >= DEBUG_LEVEL_INFO) - printk("%s(%d):%s synclinkmp_set_modem_info()\n", - __FILE__,__LINE__,info->device_name ); - - GET_USER(error,arg,value); - if (error) - return error; - - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - info->serial_signals |= SerialSignal_RTS; - if (arg & TIOCM_DTR) - info->serial_signals |= SerialSignal_DTR; - break; - case TIOCMBIC: - if (arg & TIOCM_RTS) - info->serial_signals &= ~SerialSignal_RTS; - if (arg & TIOCM_DTR) - info->serial_signals &= ~SerialSignal_DTR; - break; - case TIOCMSET: - if (arg & TIOCM_RTS) - info->serial_signals |= SerialSignal_RTS; - else - info->serial_signals &= ~SerialSignal_RTS; + printk("%s(%d):%s tiocmset(%x,%x)\n", + __FILE__,__LINE__,info->device_name, set, clear); - if (arg & TIOCM_DTR) - info->serial_signals |= SerialSignal_DTR; - else - info->serial_signals &= ~SerialSignal_DTR; - break; - default: - return -EINVAL; - } + if (set & TIOCM_RTS) + info->serial_signals |= SerialSignal_RTS; + if (set & TIOCM_DTR) + info->serial_signals |= SerialSignal_DTR; + if (clear & TIOCM_RTS) + info->serial_signals &= ~SerialSignal_RTS; + if (clear & TIOCM_DTR) + info->serial_signals &= ~SerialSignal_DTR; spin_lock_irqsave(&info->lock,flags); set_signals(info); @@ -3875,6 +3833,7 @@ memset(&serial_driver, 0, sizeof(struct tty_driver)); serial_driver.magic = TTY_DRIVER_MAGIC; + serial_driver.owner = THIS_MODULE; serial_driver.driver_name = "synclinkmp"; serial_driver.name = "ttySLM"; serial_driver.major = ttymajor; @@ -3910,6 +3869,8 @@ serial_driver.stop = tx_hold; serial_driver.start = tx_release; serial_driver.hangup = hangup; + serial_driver.tiocmget = tiocmget; + serial_driver.tiocmset = tiocmset; /* * The callout device is just like normal device except for diff -Nru a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c --- a/drivers/char/watchdog/eurotechwdt.c Mon Jan 13 20:46:05 2003 +++ b/drivers/char/watchdog/eurotechwdt.c Mon Apr 21 00:47:19 2003 @@ -187,7 +187,7 @@ * Kernel methods. */ -void eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) { printk(KERN_CRIT "timeout WDT timeout\n"); @@ -197,6 +197,7 @@ printk(KERN_CRIT "Initiating system reboot.\n"); machine_restart(NULL); #endif + return IRQ_HANDLED; } diff -Nru a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c --- a/drivers/char/watchdog/wdt.c Mon Feb 24 10:09:47 2003 +++ b/drivers/char/watchdog/wdt.c Mon Apr 21 00:46:56 2003 @@ -178,7 +178,7 @@ * a failure condition occurring. */ -void wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* * Read the status register see what is up and @@ -210,7 +210,8 @@ #endif #else printk(KERN_CRIT "Reset in 5ms.\n"); -#endif +#endif + return IRQ_HANDLED; } diff -Nru a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c --- a/drivers/char/watchdog/wdt_pci.c Thu Mar 6 09:21:14 2003 +++ b/drivers/char/watchdog/wdt_pci.c Mon Apr 21 00:45:41 2003 @@ -161,7 +161,7 @@ * a failure condition occurring. */ -static void wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* * Read the status register see what is up and @@ -193,7 +193,8 @@ #endif #else printk(KERN_CRIT "Reset in 5ms.\n"); -#endif +#endif + return IRQ_HANDLED; } diff -Nru a/drivers/fc4/soc.c b/drivers/fc4/soc.c --- a/drivers/fc4/soc.c Mon Dec 30 20:26:12 2002 +++ b/drivers/fc4/soc.c Sun Apr 20 23:51:43 2003 @@ -335,7 +335,7 @@ } } -static void soc_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t soc_intr(int irq, void *dev_id, struct pt_regs *regs) { u32 cmd; unsigned long flags; @@ -349,6 +349,8 @@ if (cmd & SOC_CMD_REQ_QALL) soc_request (s, cmd); } spin_unlock_irqrestore(&s->lock, flags); + + return IRQ_HANDLED; } #define TOKEN(proto, port, token) (((proto)<<12)|(token)|(port)) diff -Nru a/drivers/fc4/socal.c b/drivers/fc4/socal.c --- a/drivers/fc4/socal.c Mon Dec 30 20:26:12 2002 +++ b/drivers/fc4/socal.c Sun Apr 20 23:51:43 2003 @@ -405,7 +405,7 @@ } } -static void socal_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t socal_intr(int irq, void *dev_id, struct pt_regs *regs) { u32 cmd; unsigned long flags; @@ -429,6 +429,8 @@ socal_request (s, cmd); } spin_unlock_irqrestore(&s->lock, flags); + + return IRQ_HANDLED; } #define TOKEN(proto, port, token) (((proto)<<12)|(token)|(port)) diff -Nru a/drivers/hotplug/cpci_hotplug_core.c b/drivers/hotplug/cpci_hotplug_core.c --- a/drivers/hotplug/cpci_hotplug_core.c Tue Feb 11 14:57:50 2003 +++ b/drivers/hotplug/cpci_hotplug_core.c Mon Apr 21 02:40:59 2003 @@ -446,7 +446,7 @@ } /* This is the interrupt mode interrupt handler */ -void +irqreturn_t cpci_hp_intr(int irq, void *data, struct pt_regs *regs) { dbg("entered cpci_hp_intr"); @@ -455,7 +455,7 @@ if((controller->irq_flags & SA_SHIRQ) && !controller->ops->check_irq(controller->dev_id)) { dbg("exited cpci_hp_intr, not our interrupt"); - return; + return IRQ_NONE; } /* Disable ENUM interrupt */ @@ -465,6 +465,7 @@ dbg("Signal event_semaphore"); up(&event_semaphore); dbg("exited cpci_hp_intr"); + return IRQ_HANDLED; } /* diff -Nru a/drivers/hotplug/cpqphp.h b/drivers/hotplug/cpqphp.h --- a/drivers/hotplug/cpqphp.h Mon Feb 24 08:18:12 2003 +++ b/drivers/hotplug/cpqphp.h Mon Apr 21 02:40:59 2003 @@ -29,6 +29,7 @@ #define _CPQPHP_H #include "pci_hotplug.h" +#include #include /* for read? and write? functions */ @@ -408,7 +409,7 @@ /* controller functions */ extern void cpqhp_pushbutton_thread (unsigned long event_pointer); -extern void cpqhp_ctrl_intr (int IRQ, struct controller *ctrl_input, struct pt_regs *regs); +extern irqreturn_t cpqhp_ctrl_intr (int IRQ, void *data, struct pt_regs *regs); extern int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start); extern int cpqhp_event_start_thread (void); extern void cpqhp_event_stop_thread (void); diff -Nru a/drivers/hotplug/cpqphp_core.c b/drivers/hotplug/cpqphp_core.c --- a/drivers/hotplug/cpqphp_core.c Mon Feb 24 08:18:12 2003 +++ b/drivers/hotplug/cpqphp_core.c Mon Apr 21 02:40:59 2003 @@ -1148,8 +1148,7 @@ /* set up the interrupt */ dbg("HPC interrupt = %d \n", ctrl->interrupt); - if (request_irq(ctrl->interrupt, - (void (*)(int, void *, struct pt_regs *)) &cpqhp_ctrl_intr, + if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, SA_SHIRQ, MY_NAME, ctrl)) { err("Can't get irq %d for the hotplug pci controller\n", ctrl->interrupt); rc = -ENODEV; diff -Nru a/drivers/hotplug/cpqphp_ctrl.c b/drivers/hotplug/cpqphp_ctrl.c --- a/drivers/hotplug/cpqphp_ctrl.c Tue Feb 11 14:57:50 2003 +++ b/drivers/hotplug/cpqphp_ctrl.c Mon Apr 21 02:40:59 2003 @@ -916,8 +916,9 @@ } -void cpqhp_ctrl_intr(int IRQ, struct controller * ctrl, struct pt_regs *regs) +irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data, struct pt_regs *regs) { + struct controller *ctrl = data; u8 schedule_flag = 0; u16 misc; u32 Diff; @@ -929,7 +930,7 @@ // Check to see if it was our interrupt //********************************* if (!(misc & 0x000C)) { - return; + return IRQ_NONE; } if (misc & 0x0004) { @@ -974,7 +975,7 @@ up(&event_semaphore); dbg("Signal event_semaphore\n"); } - + return IRQ_HANDLED; } diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig --- a/drivers/ide/Kconfig Sun Mar 23 08:45:07 2003 +++ b/drivers/ide/Kconfig Sun Apr 20 12:56:52 2003 @@ -22,7 +22,7 @@ topics, is contained in . For detailed information about hard drives, consult the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . + . To fine-tune ATA/IDE drive/interface parameters for improved performance, look for the hdparm package at @@ -1017,7 +1017,7 @@ If you are unsure, then just choose the Enhanced IDE/MFM/RLL driver instead of this one. For more detailed information, read the Disk-HOWTO, available from - . + . config IDEDMA_AUTO bool diff -Nru a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c --- a/drivers/ide/ide-cd.c Fri Apr 18 08:58:55 2003 +++ b/drivers/ide/ide-cd.c Sat Apr 19 14:18:27 2003 @@ -3366,7 +3366,8 @@ DRIVER(drive)->busy++; g->minors = 1; g->minor_shift = 0; - strcpy(g->devfs_name, drive->devfs_name); + snprintf(g->devfs_name, sizeof(g->devfs_name), + "%s/cd", drive->devfs_name); g->driverfs_dev = &drive->gendev; g->flags = GENHD_FL_CD; if (ide_cdrom_setup(drive)) { diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c --- a/drivers/ide/ide-io.c Fri Apr 18 08:58:55 2003 +++ b/drivers/ide/ide-io.c Sun Apr 20 14:14:28 2003 @@ -1112,7 +1112,7 @@ * on the hwgroup and the process begins again. */ -void ide_intr (int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs) { unsigned long flags; ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id; @@ -1126,7 +1126,7 @@ if (!ide_ack_intr(hwif)) { spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_NONE; } if ((handler = hwgroup->handler) == NULL || @@ -1165,7 +1165,7 @@ #endif /* CONFIG_BLK_DEV_IDEPCI */ } spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_HANDLED; } drive = hwgroup->drive; if (!drive) { @@ -1176,7 +1176,7 @@ * [Note - this can occur if the drive is hot unplugged] */ spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_HANDLED; } if (!drive_is_ready(drive)) { /* @@ -1187,7 +1187,7 @@ * enough advance overhead that the latter isn't a problem. */ spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_HANDLED; } if (!hwgroup->busy) { hwgroup->busy = 1; /* paranoia */ @@ -1222,6 +1222,7 @@ } } spin_unlock_irqrestore(&ide_lock, flags); + return IRQ_HANDLED; } EXPORT_SYMBOL(ide_intr); diff -Nru a/drivers/ide/legacy/hd98.c b/drivers/ide/legacy/hd98.c --- a/drivers/ide/legacy/hd98.c Mon Apr 7 06:36:32 2003 +++ b/drivers/ide/legacy/hd98.c Sun Apr 20 11:08:34 2003 @@ -655,11 +655,8 @@ unsigned int cmd, unsigned long arg) { struct hd_geometry *loc = (struct hd_geometry *) arg; - int dev; + int dev = DEVICE_NR(inode->i_rdev); - if ((!inode) || kdev_none(inode->i_rdev)) - return -EINVAL; - dev = DEVICE_NR(inode->i_rdev); if (dev >= NR_HD) return -EINVAL; switch (cmd) { diff -Nru a/drivers/ieee1394/csr.c b/drivers/ieee1394/csr.c --- a/drivers/ieee1394/csr.c Sat Apr 19 07:55:06 2003 +++ b/drivers/ieee1394/csr.c Mon Apr 21 08:37:12 2003 @@ -448,7 +448,7 @@ /* bandwidth available algorithm adapted from IEEE 1394a-2000 spec */ if (arg > 0x1fff) { *store = cpu_to_be32(old); /* change nothing */ - break; + break; } data &= 0x1fff; if (arg >= data) { diff -Nru a/drivers/ieee1394/dv1394-private.h b/drivers/ieee1394/dv1394-private.h --- a/drivers/ieee1394/dv1394-private.h Sat Apr 19 07:53:53 2003 +++ b/drivers/ieee1394/dv1394-private.h Mon Apr 21 08:37:12 2003 @@ -455,6 +455,10 @@ */ spinlock_t spinlock; + /* flag to prevent spurious interrupts (which OHCI seems to + generate a lot :) from accessing the struct */ + int dma_running; + /* 3) the sleeping semaphore 'sem' - this is used from process context only, to serialize various operations on the video_card. Even though only one @@ -568,7 +572,7 @@ static int do_dv1394_init(struct video_card *video, struct dv1394_init *init); static int do_dv1394_init_default(struct video_card *video); -static int do_dv1394_shutdown(struct video_card *video, int free_user_buf); +static void do_dv1394_shutdown(struct video_card *video, int free_user_buf); /* NTSC empty packet rate accurate to within 0.01%, diff -Nru a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c --- a/drivers/ieee1394/dv1394.c Sat Apr 19 07:53:55 2003 +++ b/drivers/ieee1394/dv1394.c Mon Apr 21 08:37:12 2003 @@ -689,7 +689,7 @@ wmb(); #endif - + video->dma_running = 1; /* set the 'run' bit */ reg_write(video->ohci, video->ohci_IsoXmitContextControlSet, 0x8000); @@ -811,7 +811,9 @@ reg_write(video->ohci, video->ohci_IsoRcvCommandPtr, video->frames[0]->descriptor_pool_dma | 1); /* Z=1 */ wmb(); - + + video->dma_running = 1; + /* run */ reg_write(video->ohci, video->ohci_IsoRcvContextControlSet, 0x8000); flush_pci_write(video->ohci); @@ -912,16 +914,16 @@ u64 chan_mask; int retval = -EINVAL; - debug_printk( "dv1394: initialising %d\n", video->id ); + debug_printk("dv1394: initialising %d\n", video->id); if(init->api_version != DV1394_API_VERSION) - goto err; + return -EINVAL; /* first sanitize all the parameters */ if( (init->n_frames < 2) || (init->n_frames > DV1394_MAX_FRAMES) ) - goto err; + return -EINVAL; if( (init->format != DV1394_NTSC) && (init->format != DV1394_PAL) ) - goto err; + return -EINVAL; if( (init->syt_offset == 0) || (init->syt_offset > 50) ) /* default SYT offset is 3 cycles */ @@ -942,15 +944,15 @@ if(new_buf_size % PAGE_SIZE) new_buf_size += PAGE_SIZE - (new_buf_size % PAGE_SIZE); /* don't allow the user to allocate the DMA buffer more than once */ - if(video->dv_buf.kvirt && video->dv_buf_size != new_buf_size) - goto err; - + if(video->dv_buf.kvirt && video->dv_buf_size != new_buf_size) { + printk("dv1394: re-sizing the DMA buffer is not allowed\n"); + return -EINVAL; + } + /* shutdown the card if it's currently active */ /* (the card should not be reset if the parameters are screwy) */ - if( video_card_initialized(video) ) - do_dv1394_shutdown(video, 0); - + do_dv1394_shutdown(video, 0); /* try to claim the ISO channel */ spin_lock_irqsave(&video->ohci->IR_channel_lock, flags); @@ -967,7 +969,6 @@ /* initialize misc. fields of video */ video->n_frames = init->n_frames; video->pal_or_ntsc = init->format; - video->cip_accum = 0; video->continuity_counter = 0; @@ -983,7 +984,6 @@ video->current_packet = -1; video->first_frame = 0; - if(video->pal_or_ntsc == DV1394_NTSC) { video->cip_n = init->cip_n != 0 ? init->cip_n : CIP_N_NTSC; video->cip_d = init->cip_d != 0 ? init->cip_d : CIP_D_NTSC; @@ -996,14 +996,8 @@ video->syt_offset = init->syt_offset; - /* find and claim DMA contexts on the OHCI card */ - /* XXX this should be the last step of initialization, since the interrupt - handler uses ohci_i*_ctx to indicate whether or not it is safe to touch - frames. I'm not making this change quite yet, since it would be better - to clean up the init/shutdown process first.*/ - if(video->ohci_it_ctx == -1) { ohci1394_init_iso_tasklet(&video->it_tasklet, OHCI_ISO_TRANSMIT, it_tasklet_func, (unsigned long) video); @@ -1011,14 +1005,12 @@ if (ohci1394_register_iso_tasklet(video->ohci, &video->it_tasklet) < 0) { printk(KERN_ERR "dv1394: could not find an available IT DMA context\n"); retval = -EBUSY; - goto err_ctx; - } - else { - video->ohci_it_ctx = video->it_tasklet.context; - debug_printk("dv1394: claimed IT DMA context %d\n", video->ohci_it_ctx); + goto err; } + + video->ohci_it_ctx = video->it_tasklet.context; + debug_printk("dv1394: claimed IT DMA context %d\n", video->ohci_it_ctx); } - if(video->ohci_ir_ctx == -1) { ohci1394_init_iso_tasklet(&video->ir_tasklet, OHCI_ISO_RECEIVE, @@ -1027,14 +1019,11 @@ if (ohci1394_register_iso_tasklet(video->ohci, &video->ir_tasklet) < 0) { printk(KERN_ERR "dv1394: could not find an available IR DMA context\n"); retval = -EBUSY; - goto err_ctx; - } - else { - video->ohci_ir_ctx = video->ir_tasklet.context; - debug_printk("dv1394: claimed IR DMA context %d\n", video->ohci_ir_ctx); + goto err; } + video->ohci_ir_ctx = video->ir_tasklet.context; + debug_printk("dv1394: claimed IR DMA context %d\n", video->ohci_ir_ctx); } - /* allocate struct frames */ for(i = 0; i < init->n_frames; i++) { @@ -1043,7 +1032,7 @@ if(!video->frames[i]) { printk(KERN_ERR "dv1394: Cannot allocate frame structs\n"); retval = -ENOMEM; - goto err_frames; + goto err; } } @@ -1051,7 +1040,7 @@ /* allocate the ringbuffer */ retval = dma_region_alloc(&video->dv_buf, new_buf_size, video->ohci->dev, PCI_DMA_TODEVICE); if(retval) - goto err_frames; + goto err; video->dv_buf_size = new_buf_size; @@ -1073,7 +1062,7 @@ retval = dma_region_alloc(&video->packet_buf, video->packet_buf_size, video->ohci->dev, PCI_DMA_FROMDEVICE); if(retval) - goto err_dv_buf; + goto err; debug_printk("dv1394: Allocated %d packets in buffer, total %u pages (%u DMA pages), %lu bytes\n", video->n_frames*MAX_PACKETS, video->packet_buf.n_pages, @@ -1103,30 +1092,8 @@ return 0; - err_dv_buf: - dma_region_free(&video->dv_buf); - - err_frames: - for(i = 0; i < DV1394_MAX_FRAMES; i++) { - if(video->frames[i]) - frame_delete(video->frames[i]); - } - video->n_frames = 0; - - err_ctx: - if(video->ohci_it_ctx != -1) { - ohci1394_unregister_iso_tasklet(video->ohci, &video->it_tasklet); - video->ohci_it_ctx = -1; - } - if(video->ohci_ir_ctx != -1) { - ohci1394_unregister_iso_tasklet(video->ohci, &video->ir_tasklet); - video->ohci_ir_ctx = -1; - } - - spin_lock_irqsave(&video->ohci->IR_channel_lock, flags); - video->ohci->ISO_channel_usage &= ~chan_mask; - spin_unlock_irqrestore(&video->ohci->IR_channel_lock, flags); - err: +err: + do_dv1394_shutdown(video, 1); return retval; } @@ -1154,10 +1121,15 @@ { unsigned long flags; int i; - + /* no interrupts */ spin_lock_irqsave(&video->spinlock, flags); + video->dma_running = 0; + + if( (video->ohci_it_ctx == -1) && (video->ohci_ir_ctx == -1) ) + goto out; + /* stop DMA if in progress */ if( (video->active_frame != -1) || (reg_read(video->ohci, video->ohci_IsoXmitContextControlClear) & (1 << 10)) || @@ -1197,24 +1169,22 @@ } else debug_printk("dv1394: stop_dma: already stopped.\n"); - + +out: spin_unlock_irqrestore(&video->spinlock, flags); } -static int do_dv1394_shutdown(struct video_card *video, int free_dv_buf) +static void do_dv1394_shutdown(struct video_card *video, int free_dv_buf) { int i; - unsigned long flags; debug_printk("dv1394: shutdown...\n"); /* stop DMA if in progress */ stop_dma(video); - spin_lock_irqsave(&video->spinlock, flags); - /* release the DMA contexts */ if(video->ohci_it_ctx != -1) { video->ohci_IsoXmitContextControlSet = 0; @@ -1245,8 +1215,6 @@ video->ohci_ir_ctx = -1; } - spin_unlock_irqrestore(&video->spinlock, flags); - /* release the ISO channel */ if(video->channel != -1) { u64 chan_mask; @@ -1282,9 +1250,7 @@ dma_region_free(&video->packet_buf); video->packet_buf_size = 0; - debug_printk("dv1394: shutdown complete\n"); - - return 0; + debug_printk("dv1394: shutdown OK\n"); } /* @@ -1770,7 +1736,8 @@ } case DV1394_IOC_SHUTDOWN: - ret = do_dv1394_shutdown(video, 0); + do_dv1394_shutdown(video, 0); + ret = 0; break; @@ -2140,6 +2107,9 @@ spin_lock(&video->spinlock); + if(!video->dma_running) + goto out; + irq_printk("ContextControl = %08x, CommandPtr = %08x\n", reg_read(video->ohci, video->ohci_IsoXmitContextControlSet), reg_read(video->ohci, video->ohci_IsoXmitCommandPtr) @@ -2266,14 +2236,15 @@ } /* for(each frame) */ } - spin_unlock(&video->spinlock); - if(wake) { kill_fasync(&video->fasync, SIGIO, POLL_OUT); /* wake readers/writers/ioctl'ers */ wake_up_interruptible(&video->waitq); } + +out: + spin_unlock(&video->spinlock); } static void ir_tasklet_func(unsigned long data) @@ -2283,8 +2254,11 @@ spin_lock(&video->spinlock); - if( (video->ohci_ir_ctx != -1) - && (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) ) + if(!video->dma_running) + goto out; + + if( (video->ohci_ir_ctx != -1) && + (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) ) { int sof=0; /* start-of-frame flag */ @@ -2424,14 +2398,15 @@ } /* receive interrupt */ - spin_unlock(&video->spinlock); - if(wake) { kill_fasync(&video->fasync, SIGIO, POLL_IN); /* wake readers/writers/ioctl'ers */ wake_up_interruptible(&video->waitq); } + +out: + spin_unlock(&video->spinlock); } static struct file_operations dv1394_fops= @@ -2554,6 +2529,7 @@ clear_bit(0, &video->open); spin_lock_init(&video->spinlock); + video->dma_running = 0; init_MUTEX(&video->sem); init_waitqueue_head(&video->waitq); video->fasync = NULL; @@ -2565,7 +2541,7 @@ #ifdef CONFIG_DEVFS_FS if (dv1394_devfs_add_entry(video) < 0) - goto err_free; + goto err_free; #endif debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id); @@ -2718,6 +2694,9 @@ spin_lock_irqsave(&video->spinlock, flags); + if(!video->dma_running) + goto out; + /* check IT context */ if(video->ohci_it_ctx != -1) { u32 ctx; @@ -2790,7 +2769,8 @@ reg_read(video->ohci, video->ohci_IsoRcvCommandPtr)); } } - + +out: spin_unlock_irqrestore(&video->spinlock, flags); /* wake readers/writers/ioctl'ers */ diff -Nru a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c --- a/drivers/ieee1394/eth1394.c Sat Apr 19 07:53:54 2003 +++ b/drivers/ieee1394/eth1394.c Mon Apr 21 08:37:01 2003 @@ -78,7 +78,7 @@ printk(KERN_ERR fmt, ## args) static char version[] __devinitdata = - "$Rev: 886 $ Ben Collins "; + "$Rev: 895 $ Ben Collins "; /* Our ieee1394 highlevel driver */ #define ETHER1394_DRIVER_NAME "ether1394" @@ -340,6 +340,7 @@ priv = (struct eth1394_priv *)dev->priv; priv->host = host; + spin_lock_init(&priv->lock); hi = hpsb_create_hostinfo(hl, host, sizeof(*hi)); diff -Nru a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c --- a/drivers/ieee1394/highlevel.c Sat Apr 19 08:22:57 2003 +++ b/drivers/ieee1394/highlevel.c Mon Apr 21 08:37:12 2003 @@ -38,7 +38,7 @@ static LIST_HEAD(hl_drivers); -static DECLARE_MUTEX(hl_drivers_lock); +static rwlock_t hl_drivers_lock = RW_LOCK_UNLOCKED; static LIST_HEAD(addr_space); static rwlock_t addr_space_lock = RW_LOCK_UNLOCKED; @@ -48,20 +48,22 @@ static struct hpsb_address_serve dummy_zero_addr, dummy_max_addr; -/* Internal usage. Must be called with hl_drivers_lock held */ static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host) { - struct hl_host_info *hi; + struct hl_host_info *hi = NULL; struct list_head *lh; + read_lock(&hl->host_info_lock); list_for_each (lh, &hl->host_info_list) { hi = list_entry(lh, struct hl_host_info, list); if (hi->host == host) - return hi; + break; + hi = NULL; } + read_unlock(&hl->host_info_lock); - return NULL; + return hi; } @@ -69,16 +71,12 @@ * hpsb_create_hostinfo. */ void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host) { - struct hl_host_info *hi; - void *data = NULL; + struct hl_host_info *hi = hl_get_hostinfo(hl, host); - read_lock(&hl_drivers_lock); - hi = hl_get_hostinfo(hl, host); if (hi) - data = hi->data; - read_unlock(&hl_drivers_lock); + return hi->data; - return data; + return NULL; } @@ -88,10 +86,9 @@ { struct hl_host_info *hi; void *data; + unsigned long flags; - read_lock(&hl_drivers_lock); hi = hl_get_hostinfo(hl, host); - read_unlock(&hl_drivers_lock); if (hi) { HPSB_ERR("%s called hpsb_create_hostinfo when hostinfo already exists", hl->name); @@ -112,9 +109,9 @@ hi->host = host; - write_lock_irq(&hl_drivers_lock); + write_lock_irqsave(&hl->host_info_lock, flags); list_add_tail(&hi->list, &hl->host_info_list); - write_unlock_irq(&hl_drivers_lock); + write_unlock_irqrestore(&hl->host_info_lock, flags); return data; } @@ -124,23 +121,20 @@ void *data) { struct hl_host_info *hi; - int ret = -EINVAL; - write_lock_irq(&hl_drivers_lock); hi = hl_get_hostinfo(hl, host); if (hi) { if (!hi->size && !hi->data) { hi->data = data; - ret = 0; + return 0; } else HPSB_ERR("%s called hpsb_set_hostinfo when hostinfo already has data", hl->name); } else HPSB_ERR("%s called hpsb_set_hostinfo when no hostinfo exists", hl->name); - write_unlock_irq(&hl_drivers_lock); - return ret; + return -EINVAL; } @@ -148,13 +142,14 @@ { struct hl_host_info *hi; - write_lock_irq(&hl_drivers_lock); hi = hl_get_hostinfo(hl, host); if (hi) { + unsigned long flags; + write_lock_irqsave(&hl->host_info_lock, flags); list_del(&hi->list); + write_unlock_irqrestore(&hl->host_info_lock, flags); kfree(hi); } - write_unlock_irq(&hl_drivers_lock); return; } @@ -164,11 +159,9 @@ { struct hl_host_info *hi; - write_lock(&hl_drivers_lock); hi = hl_get_hostinfo(hl, host); if (hi) hi->key = key; - write_unlock(&hl_drivers_lock); return; } @@ -177,15 +170,12 @@ unsigned long hpsb_get_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host) { struct hl_host_info *hi; - unsigned long key = 0; - read_lock(&hl_drivers_lock); hi = hl_get_hostinfo(hl, host); if (hi) - key = hi->key; - read_unlock(&hl_drivers_lock); + return hi->key; - return key; + return 0; } @@ -195,7 +185,7 @@ struct hl_host_info *hi; void *data = NULL; - read_lock(&hl_drivers_lock); + read_lock(&hl->host_info_lock); list_for_each (lh, &hl->host_info_list) { hi = list_entry(lh, struct hl_host_info, list); if (hi->key == key) { @@ -203,7 +193,7 @@ break; } } - read_unlock(&hl_drivers_lock); + read_unlock(&hl->host_info_lock); return data; } @@ -214,6 +204,7 @@ { struct hpsb_highlevel *hl; struct list_head *lh; + unsigned long flags; hl = (struct hpsb_highlevel *)kmalloc(sizeof(struct hpsb_highlevel), GFP_KERNEL); @@ -225,12 +216,14 @@ INIT_LIST_HEAD(&hl->addr_list); INIT_LIST_HEAD(&hl->host_info_list); + rwlock_init(&hl->host_info_lock); + hl->name = name; hl->op = ops; - down(&hl_drivers_lock); + write_lock_irqsave(&hl_drivers_lock, flags); list_add_tail(&hl->hl_list, &hl_drivers); - up(&hl_drivers_lock); + write_unlock_irqrestore(&hl_drivers_lock, flags); if (hl->op->add_host) { down(&hpsb_hosts_lock); @@ -248,22 +241,23 @@ { struct list_head *lh, *next; struct hpsb_address_serve *as; + unsigned long flags; if (hl == NULL) { return; } - write_lock_irq(&addr_space_lock); + write_lock_irqsave(&addr_space_lock, flags); list_for_each_safe (lh, next, &hl->addr_list) { as = list_entry(lh, struct hpsb_address_serve, addr_list); list_del(&as->as_list); kfree(as); } - write_unlock_irq(&addr_space_lock); + write_unlock_irqrestore(&addr_space_lock, flags); - down(&hl_drivers_lock); + write_lock_irqsave(&hl_drivers_lock, flags); list_del(&hl->hl_list); - up(&hl_drivers_lock); + write_unlock_irqrestore(&hl_drivers_lock, flags); if (hl->op->remove_host) { down(&hpsb_hosts_lock); @@ -307,8 +301,10 @@ write_lock_irqsave(&addr_space_lock, flags); entry = addr_space.next; - while (list_entry(entry, struct hpsb_address_serve, as_list)->end <= start) { - if (list_entry(entry->next, struct hpsb_address_serve, as_list)->start >= end) { + while (list_entry(entry, struct hpsb_address_serve, as_list)->end + <= start) { + if (list_entry(entry->next, struct hpsb_address_serve, as_list) + ->start >= end) { list_add(&as->as_list, entry); list_add_tail(&as->addr_list, &hl->addr_list); retval = 1; @@ -387,14 +383,13 @@ struct list_head *entry; struct hpsb_highlevel *hl; - down(&hl_drivers_lock); + read_lock(&hl_drivers_lock); list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); - if (hl->op->add_host) hl->op->add_host(host, hl); } - up(&hl_drivers_lock); + read_unlock(&hl_drivers_lock); } void highlevel_remove_host(struct hpsb_host *host) @@ -402,7 +397,7 @@ struct list_head *entry; struct hpsb_highlevel *hl; - down(&hl_drivers_lock); + read_lock(&hl_drivers_lock); list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); @@ -411,7 +406,7 @@ hpsb_destroy_hostinfo(hl, host); } } - up(&hl_drivers_lock); + read_unlock(&hl_drivers_lock); } void highlevel_host_reset(struct hpsb_host *host) @@ -419,14 +414,14 @@ struct list_head *entry; struct hpsb_highlevel *hl; - down(&hl_drivers_lock); + read_lock(&hl_drivers_lock); list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); if (hl->op->host_reset) hl->op->host_reset(host); } - up(&hl_drivers_lock); + read_unlock(&hl_drivers_lock); } void highlevel_iso_receive(struct hpsb_host *host, void *data, @@ -436,14 +431,17 @@ struct hpsb_highlevel *hl; int channel = (((quadlet_t *)data)[0] >> 8) & 0x3f; - down(&hl_drivers_lock); - list_for_each(entry, &hl_drivers) { - hl = list_entry(entry, struct hpsb_highlevel, hl_list); + read_lock(&hl_drivers_lock); + entry = hl_drivers.next; - if (hl->op->iso_receive) + while (entry != &hl_drivers) { + hl = list_entry(entry, struct hpsb_highlevel, hl_list); + if (hl->op->iso_receive) { hl->op->iso_receive(host, channel, data, length); + } + entry = entry->next; } - up(&hl_drivers_lock); + read_unlock(&hl_drivers_lock); } void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction, @@ -453,13 +451,18 @@ struct hpsb_highlevel *hl; int cts = ((quadlet_t *)data)[0] >> 4; - down(&hl_drivers_lock); - list_for_each(entry, &hl_drivers) { + read_lock(&hl_drivers_lock); + entry = hl_drivers.next; + + while (entry != &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); - if (hl->op->fcp_request) - hl->op->fcp_request(host, nodeid, direction, cts, data, length); + if (hl->op->fcp_request) { + hl->op->fcp_request(host, nodeid, direction, cts, data, + length); + } + entry = entry->next; } - up(&hl_drivers_lock); + read_unlock(&hl_drivers_lock); } int highlevel_read(struct hpsb_host *host, int nodeid, void *data, diff -Nru a/drivers/ieee1394/highlevel.h b/drivers/ieee1394/highlevel.h --- a/drivers/ieee1394/highlevel.h Sat Apr 19 08:21:40 2003 +++ b/drivers/ieee1394/highlevel.h Mon Apr 21 08:37:12 2003 @@ -14,6 +14,7 @@ /* Used by the highlevel drivers to store data per host */ struct list_head host_info_list; + rwlock_t host_info_lock; }; @@ -154,7 +155,7 @@ * iso_receive op. */ int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, - unsigned int channel); + unsigned int channel); void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, unsigned int channel); @@ -175,6 +176,5 @@ /* Set the hostinfo pointer to something useful. Usually follows a call to * hpsb_create_hostinfo, where the size is 0. */ int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, void *data); - #endif /* IEEE1394_HIGHLEVEL_H */ diff -Nru a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c --- a/drivers/ieee1394/ieee1394_core.c Sat Apr 19 10:11:13 2003 +++ b/drivers/ieee1394/ieee1394_core.c Mon Apr 21 08:37:12 2003 @@ -1295,7 +1295,6 @@ /** nodemgr.c **/ EXPORT_SYMBOL(hpsb_guid_get_entry); EXPORT_SYMBOL(hpsb_nodeid_get_entry); -EXPORT_SYMBOL(hpsb_check_nodeid); EXPORT_SYMBOL(hpsb_node_fill_packet); EXPORT_SYMBOL(hpsb_node_read); EXPORT_SYMBOL(hpsb_node_write); diff -Nru a/drivers/ieee1394/ieee1394_types.h b/drivers/ieee1394/ieee1394_types.h --- a/drivers/ieee1394/ieee1394_types.h Wed Mar 5 08:03:24 2003 +++ b/drivers/ieee1394/ieee1394_types.h Mon Apr 21 08:37:12 2003 @@ -79,13 +79,13 @@ struct semaphore count; }; -#define HPSB_TPOOL_INIT(_tp) \ -do { \ +#define HPSB_TPOOL_INIT(_tp) \ +do { \ CLEAR_BITMAP((_tp)->pool, 64); \ - spin_lock_init(&(_tp)->lock); \ - (_tp)->next = 0; \ + spin_lock_init(&(_tp)->lock); \ + (_tp)->next = 0; \ (_tp)->allocations = 0; \ - sema_init(&(_tp)->count, 63); \ + sema_init(&(_tp)->count, 63); \ } while(0) diff -Nru a/drivers/ieee1394/iso.c b/drivers/ieee1394/iso.c --- a/drivers/ieee1394/iso.c Mon Mar 10 12:07:49 2003 +++ b/drivers/ieee1394/iso.c Mon Apr 21 08:37:12 2003 @@ -47,8 +47,11 @@ int dma_direction; /* make sure driver supports the ISO API */ - if(!host->driver->isoctl) + if(!host->driver->isoctl) { + printk(KERN_INFO "ieee1394: host driver '%s' does not support the rawiso API\n", + host->driver->name); return NULL; + } /* sanitize parameters */ diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c --- a/drivers/ieee1394/nodemgr.c Sat Apr 19 10:11:14 2003 +++ b/drivers/ieee1394/nodemgr.c Mon Apr 21 08:37:12 2003 @@ -1616,18 +1616,6 @@ return ne; } -struct node_entry *hpsb_check_nodeid(struct hpsb_host *host, nodeid_t nodeid) -{ - struct node_entry *ne; - - if (down_trylock(&nodemgr_serialize)) - return NULL; - ne = find_entry_by_nodeid(host, nodeid); - up(&nodemgr_serialize); - - return ne; -} - /* The following four convenience functions use a struct node_entry * for addressing a node on the bus. They are intended for use by any * process context, not just the nodemgr thread, so we need to be a diff -Nru a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h --- a/drivers/ieee1394/nodemgr.h Fri Mar 14 13:49:28 2003 +++ b/drivers/ieee1394/nodemgr.h Mon Apr 21 08:37:12 2003 @@ -163,10 +163,6 @@ * fool-proof by itself, since the nodeid can change. */ struct node_entry *hpsb_nodeid_get_entry(struct hpsb_host *host, nodeid_t nodeid); -/* Same as above except that it will not block waiting for the nodemgr - * serialize semaphore. */ -struct node_entry *hpsb_check_nodeid(struct hpsb_host *host, nodeid_t nodeid); - /* * If the entry refers to a local host, this function will return the pointer * to the hpsb_host structure. It will return NULL otherwise. Once you have diff -Nru a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c --- a/drivers/ieee1394/ohci1394.c Thu Apr 17 13:10:55 2003 +++ b/drivers/ieee1394/ohci1394.c Mon Apr 21 09:49:08 2003 @@ -165,7 +165,7 @@ printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args) static char version[] __devinitdata = - "$Rev: 866 $ Ben Collins "; + "$Rev: 897 $ Ben Collins "; /* Module Parameters */ static int phys_dma = 1; @@ -2214,7 +2214,7 @@ } -static void ohci_irq_handler(int irq, void *dev_id, +static irqreturn_t ohci_irq_handler(int irq, void *dev_id, struct pt_regs *regs_are_unused) { quadlet_t event, node_id; @@ -2231,7 +2231,8 @@ reg_write(ohci, OHCI1394_IntEventClear, event & ~OHCI1394_busReset); spin_unlock_irqrestore(&ohci->event_lock, flags); - if (!event) return; + if (!event) + return IRQ_NONE; DBGMSG(ohci->id, "IntEvent: %08x", event); @@ -2462,7 +2463,7 @@ PRINT(KERN_ERR, ohci->id, "Unhandled interrupt(s) 0x%08x", event); - return; + return IRQ_HANDLED; } /* Put the buffer back into the dma context */ diff -Nru a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c --- a/drivers/ieee1394/pcilynx.c Fri Apr 11 17:00:00 2003 +++ b/drivers/ieee1394/pcilynx.c Mon Apr 21 09:49:08 2003 @@ -1163,7 +1163,7 @@ ********************************************************/ -static void lynx_irq_handler(int irq, void *dev_id, +static irqreturn_t lynx_irq_handler(int irq, void *dev_id, struct pt_regs *regs_are_unused) { struct ti_lynx *lynx = (struct ti_lynx *)dev_id; @@ -1174,7 +1174,8 @@ linkint = reg_read(lynx, LINK_INT_STATUS); intmask = reg_read(lynx, PCI_INT_STATUS); - if (!(intmask & PCI_INT_INT_PEND)) return; + if (!(intmask & PCI_INT_INT_PEND)) + return IRQ_HANDLED; PRINTD(KERN_DEBUG, lynx->id, "interrupt: 0x%08x / 0x%08x", intmask, linkint); @@ -1390,6 +1391,8 @@ run_pcl(lynx, lynx->rcv_pcl_start, CHANNEL_ASYNC_RCV); } + + return IRQ_HANDLED; } @@ -1893,7 +1896,7 @@ .name = PCILYNX_DRIVER_NAME, .id_table = pci_table, .probe = add_card, - .remove = __devexit_p(remove_card), + .remove = remove_card, }; static struct hpsb_host_driver lynx_driver = { diff -Nru a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c --- a/drivers/ieee1394/sbp2.c Fri Apr 18 15:36:55 2003 +++ b/drivers/ieee1394/sbp2.c Mon Apr 21 09:30:57 2003 @@ -298,7 +298,7 @@ #include "sbp2.h" static char version[] __devinitdata = - "$Rev: 884 $ James Goodwin "; + "$Rev: 896 $ James Goodwin "; /* * Module load parameter definitions @@ -3040,10 +3040,10 @@ SPRINTF("Driver version : %s\n", version); SPRINTF("\nModule options :\n"); - SPRINTF(" max_speed : %s\n", hpsb_speedto_str[max_speed]); - SPRINTF(" max_sectors : %d\n", max_sectors); - SPRINTF(" serialize_io : %s\n", serialize_io ? "yes" : "no"); - SPRINTF(" exclusive_login : %s\n", exclusive_login ? "yes" : "no"); + SPRINTF(" max_speed : %s\n", hpsb_speedto_str[max_speed]); + SPRINTF(" max_sectors : %d\n", max_sectors); + SPRINTF(" serialize_io : %s\n", serialize_io ? "yes" : "no"); + SPRINTF(" exclusive_login : %s\n", exclusive_login ? "yes" : "no"); SPRINTF("\nAttached devices : %s\n", !list_empty(&host->my_devices) ? "" : "none"); diff -Nru a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c --- a/drivers/ieee1394/video1394.c Sat Apr 19 08:21:40 2003 +++ b/drivers/ieee1394/video1394.c Mon Apr 21 08:37:12 2003 @@ -67,14 +67,6 @@ #define vmalloc_32(x) vmalloc(x) #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,3)) -#define remap_page_range_1394(vma, start, addr, size, prot) \ - remap_page_range(start, addr, size, prot) -#else -#define remap_page_range_1394(vma, start, addr, size, prot) \ - remap_page_range(vma, start, addr, size, prot) -#endif - struct it_dma_prg { struct dma_cmd begin; quadlet_t data[4]; @@ -496,11 +488,7 @@ if (d->ir_prg[i][d->nb_cmd-1].status & cpu_to_le32(0xFFFF0000)) { reset_ir_status(d, i); d->buffer_status[i] = VIDEO1394_BUFFER_READY; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18) - get_fast_time(&d->buffer_time[i]); -#else do_gettimeofday(&d->buffer_time[i]); -#endif } } diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c --- a/drivers/input/evdev.c Sat Mar 22 09:03:17 2003 +++ b/drivers/input/evdev.c Sat Apr 19 02:34:45 2003 @@ -27,7 +27,6 @@ char name[16]; struct input_handle handle; wait_queue_head_t wait; - devfs_handle_t devfs; struct list_head list; }; @@ -76,6 +75,13 @@ return input_flush_device(&list->evdev->handle, file); } +static void evdev_free(struct evdev *evdev) +{ + devfs_remove("input/event%d", evdev->minor); + evdev_table[evdev->minor] = NULL; + kfree(evdev); +} + static int evdev_release(struct inode * inode, struct file * file) { struct evdev_list *list = file->private_data; @@ -84,17 +90,13 @@ list_del(&list->node); if (!--list->evdev->open) { - if (list->evdev->exist) { + if (list->evdev->exist) input_close_device(&list->evdev->handle); - } else { - input_unregister_minor(list->evdev->devfs); - evdev_table[list->evdev->minor] = NULL; - kfree(list->evdev); - } + else + evdev_free(list->evdev); } kfree(list); - return 0; } @@ -397,7 +399,7 @@ sprintf(evdev->name, "event%d", minor); evdev_table[minor] = evdev; - evdev->devfs = input_register_minor("input/event%d", minor, EVDEV_MINOR_BASE); + input_register_minor("input/event%d", minor, EVDEV_MINOR_BASE); return &evdev->handle; } @@ -411,11 +413,8 @@ if (evdev->open) { input_close_device(handle); wake_up_interruptible(&evdev->wait); - } else { - input_unregister_minor(evdev->devfs); - evdev_table[evdev->minor] = NULL; - kfree(evdev); - } + } else + evdev_free(evdev); } static struct input_device_id evdev_ids[] = { diff -Nru a/drivers/input/input.c b/drivers/input/input.c --- a/drivers/input/input.c Mon Apr 14 04:16:02 2003 +++ b/drivers/input/input.c Sat Apr 19 03:09:24 2003 @@ -32,7 +32,6 @@ EXPORT_SYMBOL(input_register_handler); EXPORT_SYMBOL(input_unregister_handler); EXPORT_SYMBOL(input_register_minor); -EXPORT_SYMBOL(input_unregister_minor); EXPORT_SYMBOL(input_open_device); EXPORT_SYMBOL(input_close_device); EXPORT_SYMBOL(input_accept_process); @@ -47,7 +46,6 @@ static LIST_HEAD(input_handler_list); static struct input_handler *input_table[8]; -static devfs_handle_t input_devfs_handle; #ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_bus_input_dir; @@ -542,20 +540,13 @@ .open = input_open_file, }; -devfs_handle_t input_register_minor(char *name, int minor, int minor_base) +void input_register_minor(char *name, int minor, int minor_base) { char devfs_name[16]; - sprintf(devfs_name, name, minor); - - return devfs_register(NULL, devfs_name, 0, - INPUT_MAJOR, minor + minor_base, - S_IFCHR|S_IRUGO|S_IWUSR, - &input_fops, NULL); -} -void input_unregister_minor(devfs_handle_t handle) -{ - devfs_unregister(handle); + sprintf(devfs_name, name, minor); + devfs_register(NULL, devfs_name, 0, INPUT_MAJOR, minor_base + minor, + S_IFCHR|S_IRUGO|S_IWUSR, &input_fops, NULL); } #ifdef CONFIG_PROC_FS @@ -699,8 +690,7 @@ return -EBUSY; } - input_devfs_handle = devfs_mk_dir("input"); - + devfs_mk_dir("input"); return 0; } @@ -711,7 +701,7 @@ remove_proc_entry("handlers", proc_bus_input_dir); remove_proc_entry("input", proc_bus); #endif - devfs_unregister(input_devfs_handle); + devfs_remove("input"); if (unregister_chrdev(INPUT_MAJOR, "input")) printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR); devclass_unregister(&input_devclass); diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c --- a/drivers/input/joydev.c Wed Feb 12 02:02:06 2003 +++ b/drivers/input/joydev.c Sat Apr 19 03:09:50 2003 @@ -45,7 +45,6 @@ char name[16]; struct input_handle handle; wait_queue_head_t wait; - devfs_handle_t devfs; struct list_head list; struct js_corr corr[ABS_MAX]; struct JS_DATA_SAVE_TYPE glue; @@ -141,6 +140,13 @@ return retval < 0 ? retval : 0; } +static void joydev_free(struct joydev *joydev) +{ + devfs_remove("js%d", joydev->minor); + joydev_table[joydev->minor] = NULL; + kfree(joydev); +} + static int joydev_release(struct inode * inode, struct file * file) { struct joydev_list *list = file->private_data; @@ -150,17 +156,13 @@ list_del(&list->node); if (!--list->joydev->open) { - if (list->joydev->exist) { + if (list->joydev->exist) input_close_device(&list->joydev->handle); - } else { - input_unregister_minor(list->joydev->devfs); - joydev_table[list->joydev->minor] = NULL; - kfree(list->joydev); - } + else + joydev_free(list->joydev); } kfree(list); - return 0; } @@ -442,7 +444,7 @@ } joydev_table[minor] = joydev; - joydev->devfs = input_register_minor("js%d", minor, JOYDEV_MINOR_BASE); + input_register_minor("js%d", minor, JOYDEV_MINOR_BASE); return &joydev->handle; } @@ -453,13 +455,10 @@ joydev->exist = 0; - if (joydev->open) { + if (joydev->open) input_close_device(handle); - } else { - input_unregister_minor(joydev->devfs); - joydev_table[joydev->minor] = NULL; - kfree(joydev); - } + else + joydev_free(joydev); } static struct input_device_id joydev_ids[] = { diff -Nru a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c --- a/drivers/input/joystick/iforce/iforce-serio.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/joystick/iforce/iforce-serio.c Mon Apr 21 04:18:18 2003 @@ -78,40 +78,38 @@ iforce_serial_xmit((struct iforce *)serio->private); } -static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t iforce_serio_irq(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct iforce* iforce = serio->private; if (!iforce->pkt) { - if (data != 0x2b) { - return; - } - iforce->pkt = 1; - return; + if (data == 0x2b) + iforce->pkt = 1; + goto out; } if (!iforce->id) { - if (data > 3 && data != 0xff) { + if (data > 3 && data != 0xff) iforce->pkt = 0; - return; - } - iforce->id = data; - return; + else + iforce->id = data; + goto out; } if (!iforce->len) { if (data > IFORCE_MAX_LENGTH) { iforce->pkt = 0; iforce->id = 0; - return; + } else { + iforce->len = data; } - iforce->len = data; - return; + goto out; } if (iforce->idx < iforce->len) { iforce->csum += iforce->data[iforce->idx++] = data; - return; + goto out; } if (iforce->idx == iforce->len) { @@ -122,6 +120,8 @@ iforce->idx = 0; iforce->csum = 0; } +out: + return IRQ_HANDLED; } static void iforce_serio_connect(struct serio *serio, struct serio_dev *dev) diff -Nru a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c --- a/drivers/input/joystick/magellan.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/joystick/magellan.c Mon Apr 21 04:15:10 2003 @@ -113,7 +113,8 @@ input_sync(dev); } -static void magellan_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t magellan_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct magellan* magellan = serio->private; @@ -123,7 +124,8 @@ } else { if (magellan->idx < MAGELLAN_MAX_LENGTH) magellan->data[magellan->idx++] = data; - } + } + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c --- a/drivers/input/joystick/spaceball.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/joystick/spaceball.c Mon Apr 21 04:15:52 2003 @@ -149,7 +149,8 @@ * can occur in the axis values. */ -static void spaceball_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t spaceball_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct spaceball *spaceball = serio->private; @@ -158,11 +159,11 @@ spaceball_process_packet(spaceball, regs); spaceball->idx = 0; spaceball->escape = 0; - return; + break; case '^': if (!spaceball->escape) { spaceball->escape = 1; - return; + break; } spaceball->escape = 0; case 'M': @@ -177,8 +178,9 @@ spaceball->escape = 0; if (spaceball->idx < SPACEBALL_MAX_LENGTH) spaceball->data[spaceball->idx++] = data; - return; + break; } + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c --- a/drivers/input/joystick/spaceorb.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/joystick/spaceorb.c Mon Apr 21 04:16:10 2003 @@ -130,7 +130,8 @@ input_sync(dev); } -static void spaceorb_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t spaceorb_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct spaceorb* spaceorb = serio->private; @@ -140,6 +141,7 @@ } if (spaceorb->idx < SPACEORB_MAX_LENGTH) spaceorb->data[spaceorb->idx++] = data & 0x7f; + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c --- a/drivers/input/joystick/stinger.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/joystick/stinger.c Mon Apr 21 04:14:00 2003 @@ -98,7 +98,8 @@ * packet processing routine. */ -static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t stinger_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct stinger* stinger = serio->private; @@ -112,7 +113,7 @@ stinger->idx = 0; } - return; + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c --- a/drivers/input/joystick/warrior.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/joystick/warrior.c Mon Apr 21 04:13:41 2003 @@ -99,7 +99,8 @@ * packet processing routine. */ -static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t warrior_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct warrior* warrior = serio->private; @@ -117,6 +118,7 @@ warrior->idx = 0; warrior->len = 0; } + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c --- a/drivers/input/keyboard/atkbd.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/keyboard/atkbd.c Mon Apr 21 04:17:32 2003 @@ -132,7 +132,8 @@ * the keyboard into events. */ -static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, + unsigned int flags, struct pt_regs *regs) { struct atkbd *atkbd = serio->private; int code = data; @@ -145,7 +146,7 @@ printk("atkbd.c: frame/parity error: %02x\n", flags); serio_write(serio, ATKBD_CMD_RESEND); atkbd->resend = 1; - return; + goto out; } if (!flags) @@ -154,34 +155,35 @@ switch (code) { case ATKBD_RET_ACK: atkbd->ack = 1; - return; + goto out; case ATKBD_RET_NAK: atkbd->ack = -1; - return; + goto out; } if (atkbd->cmdcnt) { atkbd->cmdbuf[--atkbd->cmdcnt] = code; - return; + goto out; } switch (atkbd->keycode[code]) { case ATKBD_KEY_BAT: serio_rescan(atkbd->serio); - return; + goto out; case ATKBD_KEY_EMUL0: atkbd->emul = 1; - return; + goto out; case ATKBD_KEY_EMUL1: atkbd->emul = 2; - return; + goto out; case ATKBD_KEY_RELEASE: atkbd->release = 1; - return; + goto out; } if (atkbd->emul) { - if (--atkbd->emul) return; + if (--atkbd->emul) + goto out; code |= 0x100; } @@ -197,8 +199,10 @@ input_report_key(&atkbd->dev, atkbd->keycode[code], !atkbd->release); input_sync(&atkbd->dev); } - + atkbd->release = 0; +out: + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c --- a/drivers/input/keyboard/newtonkbd.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/keyboard/newtonkbd.c Mon Apr 21 04:13:24 2003 @@ -62,7 +62,8 @@ char phys[32]; }; -void nkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +irqreturn_t nkbd_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct nkbd *nkbd = serio->private; @@ -75,6 +76,7 @@ else if (data == 0xe7) /* end of init sequence */ printk(KERN_INFO "input: %s on %s\n", nkbd_name, serio->phys); + return IRQ_HANDLED; } diff -Nru a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c --- a/drivers/input/keyboard/sunkbd.c Wed Feb 12 02:08:58 2003 +++ b/drivers/input/keyboard/sunkbd.c Mon Apr 21 04:14:52 2003 @@ -89,18 +89,19 @@ * is received. */ -static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t sunkbd_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct sunkbd* sunkbd = serio->private; if (sunkbd->reset <= -1) { /* If cp[i] is 0xff, sunkbd->reset will stay -1. */ sunkbd->reset = data; /* The keyboard sends 0xff 0xff 0xID on powerup */ - return; + goto out; } if (sunkbd->layout == -1) { sunkbd->layout = data; - return; + goto out; } switch (data) { @@ -108,14 +109,14 @@ case SUNKBD_RET_RESET: schedule_work(&sunkbd->tq); sunkbd->reset = -1; - return; + break; case SUNKBD_RET_LAYOUT: sunkbd->layout = -1; - return; + break; case SUNKBD_RET_ALLUP: /* All keys released */ - return; + break; default: if (sunkbd->keycode[data & SUNKBD_KEY]) { @@ -127,6 +128,8 @@ data & SUNKBD_KEY, data & SUNKBD_RELEASE ? "released" : "pressed"); } } +out: + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c --- a/drivers/input/keyboard/xtkbd.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/keyboard/xtkbd.c Mon Apr 21 04:13:02 2003 @@ -63,14 +63,15 @@ char phys[32]; }; -void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +irqreturn_t xtkbd_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct xtkbd *xtkbd = serio->private; switch (data) { case XTKBD_EMUL0: case XTKBD_EMUL1: - return; + break; default: if (xtkbd->keycode[data & XTKBD_KEY]) { @@ -81,7 +82,8 @@ printk(KERN_WARNING "xtkbd.c: Unknown key (scancode %#x) %s.\n", data & XTKBD_KEY, data & XTKBD_RELEASE ? "released" : "pressed"); } - } + } + return IRQ_HANDLED; } void xtkbd_connect(struct serio *serio, struct serio_dev *dev) diff -Nru a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c --- a/drivers/input/mouse/inport.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/mouse/inport.c Mon Apr 21 04:04:38 2003 @@ -85,7 +85,7 @@ static int inport_irq = INPORT_IRQ; static int inport_used = 0; -static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int inport_open(struct input_dev *dev) { @@ -124,7 +124,7 @@ }, }; -static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned char buttons; @@ -150,6 +150,7 @@ outb(INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT); input_sync(&inport_dev); + return IRQ_HANDLED; } #ifndef MODULE diff -Nru a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c --- a/drivers/input/mouse/logibm.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/mouse/logibm.c Mon Apr 21 04:05:02 2003 @@ -75,7 +75,7 @@ static int logibm_irq = LOGIBM_IRQ; static int logibm_used = 0; -static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int logibm_open(struct input_dev *dev) { @@ -114,7 +114,7 @@ }, }; -static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs) { char dx, dy; unsigned char buttons; @@ -139,6 +139,7 @@ input_sync(&logibm_dev); outb(LOGIBM_ENABLE_IRQ, LOGIBM_CONTROL_PORT); + return IRQ_HANDLED; } #ifndef MODULE diff -Nru a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c --- a/drivers/input/mouse/pc110pad.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/mouse/pc110pad.c Mon Apr 21 04:05:31 2003 @@ -60,7 +60,7 @@ static char *pc110pad_name = "IBM PC110 TouchPad"; static char *pc110pad_phys = "isa15e0/input0"; -static void pc110pad_interrupt(int irq, void *ptr, struct pt_regs *regs) +static irqreturn_t pc110pad_interrupt(int irq, void *ptr, struct pt_regs *regs) { int value = inb_p(pc110pad_io); int handshake = inb_p(pc110pad_io + 2); @@ -83,6 +83,7 @@ input_sync(&pc110pad_dev); pc110pad_count = 0; + return IRQ_HANDLED; } static void pc110pad_close(struct input_dev *dev) diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c --- a/drivers/input/mouse/psmouse.c Thu Apr 17 12:52:40 2003 +++ b/drivers/input/mouse/psmouse.c Mon Apr 21 04:12:09 2003 @@ -167,7 +167,8 @@ * packets or passing them to the command routine as command output. */ -static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t psmouse_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct psmouse *psmouse = serio->private; @@ -186,12 +187,12 @@ break; } psmouse->acking = 0; - return; + goto out; } if (psmouse->cmdcnt) { psmouse->cmdbuf[--psmouse->cmdcnt] = data; - return; + goto out; } if (psmouse->pktcnt && time_after(jiffies, psmouse->last + HZ/2)) { @@ -205,13 +206,15 @@ if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) { psmouse_process_packet(psmouse, regs); psmouse->pktcnt = 0; - return; + goto out; } if (psmouse->pktcnt == 1 && psmouse->packet[0] == PSMOUSE_RET_BAT) { serio_rescan(serio); - return; - } + goto out; + } +out: + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c --- a/drivers/input/mouse/sermouse.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/mouse/sermouse.c Mon Apr 21 04:12:31 2003 @@ -204,7 +204,8 @@ * packets or passing them to the command routine as command output. */ -static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t sermouse_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct sermouse *sermouse = serio->private; @@ -215,6 +216,7 @@ sermouse_process_ms(sermouse, data, regs); else sermouse_process_msc(sermouse, data, regs); + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c --- a/drivers/input/mousedev.c Sat Mar 22 09:03:17 2003 +++ b/drivers/input/mousedev.c Sat Apr 19 02:45:50 2003 @@ -46,7 +46,6 @@ wait_queue_head_t wait; struct list_head list; struct input_handle handle; - devfs_handle_t devfs; }; struct mousedev_list { @@ -171,45 +170,52 @@ return retval < 0 ? retval : 0; } +static void mousedev_free(struct mousedev *mousedev) +{ + devfs_remove("input/mouse%d", mousedev->minor); + mousedev_table[mousedev->minor] = NULL; + kfree(mousedev); +} + +static int mixdev_release(void) +{ + struct input_handle *handle; + + list_for_each_entry(handle, &mousedev_handler.h_list, h_node) { + struct mousedev *mousedev = handle->private; + + if (!mousedev->open) { + if (mousedev->exist) + input_close_device(&mousedev->handle); + else + mousedev_free(mousedev); + } + } + + return 0; +} + static int mousedev_release(struct inode * inode, struct file * file) { struct mousedev_list *list = file->private_data; - struct input_handle *handle; - struct mousedev *mousedev; mousedev_fasync(-1, file, 0); list_del(&list->node); if (!--list->mousedev->open) { - if (list->mousedev->minor == MOUSEDEV_MIX) { - list_for_each_entry(handle, &mousedev_handler.h_list, h_node) { - mousedev = handle->private; - if (!mousedev->open) { - if (mousedev->exist) { - input_close_device(&mousedev->handle); - } else { - input_unregister_minor(mousedev->devfs); - mousedev_table[mousedev->minor] = NULL; - kfree(mousedev); - } - } - } - } else { - if (!mousedev_mix.open) { - if (list->mousedev->exist) { - input_close_device(&list->mousedev->handle); - } else { - input_unregister_minor(list->mousedev->devfs); - mousedev_table[list->mousedev->minor] = NULL; - kfree(list->mousedev); - } - } + if (list->mousedev->minor == MOUSEDEV_MIX) + return mixdev_release(); + + if (!mousedev_mix.open) { + if (list->mousedev->exist) + input_close_device(&list->mousedev->handle); + else + mousedev_free(list->mousedev); } } kfree(list); - return 0; } @@ -425,7 +431,7 @@ input_open_device(&mousedev->handle); mousedev_table[minor] = mousedev; - mousedev->devfs = input_register_minor("input/mouse%d", minor, MOUSEDEV_MINOR_BASE); + input_register_minor("input/mouse%d", minor, MOUSEDEV_MINOR_BASE); return &mousedev->handle; } @@ -441,9 +447,7 @@ } else { if (mousedev_mix.open) input_close_device(handle); - input_unregister_minor(mousedev->devfs); - mousedev_table[mousedev->minor] = NULL; - kfree(mousedev); + mousedev_free(mousedev); } } @@ -507,7 +511,7 @@ mousedev_table[MOUSEDEV_MIX] = &mousedev_mix; mousedev_mix.exist = 1; mousedev_mix.minor = MOUSEDEV_MIX; - mousedev_mix.devfs = input_register_minor("input/mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE); + input_register_minor("input/mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE); #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX if (!(mousedev_mix.misc = !misc_register(&psaux_mouse))) @@ -525,7 +529,7 @@ if (mousedev_mix.misc) misc_deregister(&psaux_mouse); #endif - input_unregister_minor(mousedev_mix.devfs); + devfs_remove("input/mice"); input_unregister_handler(&mousedev_handler); interface_unregister(&mousedev_intf); } diff -Nru a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c --- a/drivers/input/serio/ct82c710.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/serio/ct82c710.c Mon Apr 21 04:04:07 2003 @@ -64,7 +64,7 @@ static int ct82c710_data; static int ct82c710_status; -static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs); +static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs); /* * Wait for device to send output char and flush any input char. @@ -154,9 +154,9 @@ * is waiting in the 82C710. */ -static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs) +static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs) { - serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0, regs); + return serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0, regs); } /* diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c --- a/drivers/input/serio/i8042.c Thu Apr 17 12:33:06 2003 +++ b/drivers/input/serio/i8042.c Sun Apr 20 14:14:28 2003 @@ -74,7 +74,7 @@ 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110 }; -static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* * The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to @@ -332,7 +332,7 @@ * to the upper layers. */ -static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned long flags; unsigned char str, data; @@ -415,6 +415,8 @@ serio_interrupt(&i8042_kbd_port, data, dfl, regs); } + /* FIXME - was it really ours? */ + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c --- a/drivers/input/serio/serio.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/serio/serio.c Mon Apr 21 04:04:03 2003 @@ -135,13 +135,20 @@ wake_up(&serio_wait); } -void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) -{ - if (serio->dev && serio->dev->interrupt) - serio->dev->interrupt(serio, data, flags, regs); - else - if (!flags) +irqreturn_t serio_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) +{ + irqreturn_t ret = IRQ_NONE; + + if (serio->dev && serio->dev->interrupt) { + ret = serio->dev->interrupt(serio, data, flags, regs); + } else { + if (!flags) { serio_rescan(serio); + ret = IRQ_HANDLED; + } + } + return ret; } void serio_register_port(struct serio *serio) diff -Nru a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c --- a/drivers/input/touchscreen/gunze.c Wed Feb 12 01:41:01 2003 +++ b/drivers/input/touchscreen/gunze.c Mon Apr 21 04:11:22 2003 @@ -78,7 +78,8 @@ input_sync(dev); } -static void gunze_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs) +static irqreturn_t gunze_interrupt(struct serio *serio, + unsigned char data, unsigned int flags, struct pt_regs *regs) { struct gunze* gunze = serio->private; @@ -88,7 +89,8 @@ } else { if (gunze->idx < GUNZE_MAX_LENGTH) gunze->data[gunze->idx++] = data; - } + } + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/tsdev.c b/drivers/input/tsdev.c --- a/drivers/input/tsdev.c Sat Mar 22 09:03:17 2003 +++ b/drivers/input/tsdev.c Sat Apr 19 02:48:08 2003 @@ -57,7 +57,6 @@ wait_queue_head_t wait; struct list_head list; struct input_handle handle; - devfs_handle_t devfs; }; /* From Compaq's Touch Screen Specification version 0.2 (draft) */ @@ -115,6 +114,13 @@ return 0; } +static void tsdev_free(struct tsdev *tsdev) +{ + devfs_remove("input/ts%d", tsdev->minor); + tsdev_table[tsdev->minor] = NULL; + kfree(tsdev); +} + static int tsdev_release(struct inode *inode, struct file *file) { struct tsdev_list *list = file->private_data; @@ -123,13 +129,10 @@ list_del(&list->node); if (!--list->tsdev->open) { - if (list->tsdev->exist) { + if (list->tsdev->exist) input_close_device(&list->tsdev->handle); - } else { - input_unregister_minor(list->tsdev->devfs); - tsdev_table[list->tsdev->minor] = NULL; - kfree(list->tsdev); - } + else + tsdev_free(list->tsdev); } kfree(list); return 0; @@ -325,8 +328,7 @@ tsdev->handle.private = tsdev; tsdev_table[minor] = tsdev; - tsdev->devfs = - input_register_minor("input/ts%d", minor, TSDEV_MINOR_BASE); + input_register_minor("input/ts%d", minor, TSDEV_MINOR_BASE); return &tsdev->handle; @@ -341,11 +343,8 @@ if (tsdev->open) { input_close_device(handle); wake_up_interruptible(&tsdev->wait); - } else { - input_unregister_minor(tsdev->devfs); - tsdev_table[tsdev->minor] = NULL; - kfree(tsdev); - } + } else + tsdev_free(tsdev); } static struct input_device_id tsdev_ids[] = { diff -Nru a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c --- a/drivers/isdn/act2000/act2000_isa.c Mon Sep 2 12:15:36 2002 +++ b/drivers/isdn/act2000/act2000_isa.c Mon Apr 21 03:58:37 2003 @@ -69,7 +69,7 @@ return ret; } -static void +static irqreturn_t act2000_isa_interrupt(int irq, void *dev_id, struct pt_regs *regs) { act2000_card *card = irq2card_map[irq]; @@ -78,7 +78,7 @@ if (!card) { printk(KERN_WARNING "act2000: Spurious interrupt!\n"); - return; + return IRQ_NONE; } istatus = (inb(ISA_PORT_ISR) & 0x07); if (istatus & ISA_ISR_OUT) { @@ -95,6 +95,7 @@ } if (istatus) printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", irq, istatus); + return IRQ_HANDLED; } static void diff -Nru a/drivers/isdn/eicon/eicon.h b/drivers/isdn/eicon/eicon.h --- a/drivers/isdn/eicon/eicon.h Fri Feb 7 00:20:34 2003 +++ b/drivers/isdn/eicon/eicon.h Mon Apr 21 03:58:37 2003 @@ -14,6 +14,8 @@ #ifndef eicon_h #define eicon_h +#include + #define EICON_IOCTL_SETMMIO 0 #define EICON_IOCTL_GETMMIO 1 #define EICON_IOCTL_SETIRQ 2 @@ -364,7 +366,7 @@ extern int eicon_addcard(int, int, int, char *, int); extern void eicon_io_transmit(eicon_card *card); -extern void eicon_irq(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t eicon_irq(int irq, void *dev_id, struct pt_regs *regs); extern void eicon_io_rcv_dispatch(eicon_card *ccard); extern void eicon_io_ack_dispatch(eicon_card *ccard); #ifdef CONFIG_MCA diff -Nru a/drivers/isdn/eicon/eicon_idi.c b/drivers/isdn/eicon/eicon_idi.c --- a/drivers/isdn/eicon/eicon_idi.c Tue Feb 25 02:43:59 2003 +++ b/drivers/isdn/eicon/eicon_idi.c Mon Apr 21 03:58:37 2003 @@ -3097,7 +3097,7 @@ { int l = 0; int ret = 0; - int timeout; + unsigned long timeout; int i; struct sk_buff *skb; struct sk_buff *skb2; diff -Nru a/drivers/isdn/eicon/eicon_io.c b/drivers/isdn/eicon/eicon_io.c --- a/drivers/isdn/eicon/eicon_io.c Sun Oct 6 18:00:18 2002 +++ b/drivers/isdn/eicon/eicon_io.c Mon Apr 21 03:58:37 2003 @@ -501,7 +501,7 @@ /* * IRQ handler */ -void +irqreturn_t eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { eicon_card *ccard = (eicon_card *)dev_id; eicon_isa_card *isa_card; @@ -521,7 +521,7 @@ if (!ccard) { eicon_log(ccard, 1, "eicon_irq: spurious interrupt %d\n", irq); - return; + return IRQ_NONE; } if (ccard->type == EICON_CTYPE_QUADRO) { @@ -554,7 +554,7 @@ break; default: eicon_log(ccard, 1, "eicon_irq: unsupported card-type!\n"); - return; + return IRQ_NONE; } if (*irqprobe) { @@ -577,7 +577,7 @@ (*irqprobe)++; break; } - return; + return IRQ_HANDLED; } switch(ccard->type) { @@ -588,7 +588,7 @@ case EICON_CTYPE_S2M: if (!(readb(isa_card->intack))) { /* card did not interrupt */ eicon_log(ccard, 1, "eicon: IRQ: card reports no interrupt!\n"); - return; + return IRQ_NONE; } break; } @@ -744,6 +744,6 @@ break; } - return; + return IRQ_HANDLED; } #endif diff -Nru a/drivers/isdn/eicon/linio.c b/drivers/isdn/eicon/linio.c --- a/drivers/isdn/eicon/linio.c Sat Nov 23 11:44:40 2002 +++ b/drivers/isdn/eicon/linio.c Mon Apr 21 03:58:37 2003 @@ -36,7 +36,7 @@ void UxPause(long int ms) { - int timeout = jiffies + ((ms * HZ) / 1000); + unsigned long timeout = jiffies + ((ms * HZ) / 1000); while (time_before(jiffies, timeout)); } @@ -577,7 +577,7 @@ return; } -void Divasintr(int arg, void *unused, struct pt_regs *unused_regs) +irqreturn_t Divasintr(int arg, void *unused, struct pt_regs *unused_regs) { int i; card_t *card = NULL; @@ -602,7 +602,7 @@ } } - return; + return IRQ_HANDLED; } @@ -680,7 +680,7 @@ return flags; } -void UxCardUnlock(ux_diva_card_t *card, long ipl) +void UxCardUnlock(ux_diva_card_t *card, unsigned long ipl) { spin_unlock_irqrestore(&diva_lock, ipl); } diff -Nru a/drivers/isdn/eicon/uxio.h b/drivers/isdn/eicon/uxio.h --- a/drivers/isdn/eicon/uxio.h Sat Nov 23 11:44:40 2002 +++ b/drivers/isdn/eicon/uxio.h Mon Apr 21 03:58:37 2003 @@ -59,7 +59,7 @@ */ long UxCardLock(ux_diva_card_t *card); -void UxCardUnlock(ux_diva_card_t *card, long ipl); +void UxCardUnlock(ux_diva_card_t *card, unsigned long ipl); /* * Set the mapping address for PCI cards diff -Nru a/drivers/isdn/hardware/avm/avmcard.h b/drivers/isdn/hardware/avm/avmcard.h --- a/drivers/isdn/hardware/avm/avmcard.h Sat May 25 22:34:17 2002 +++ b/drivers/isdn/hardware/avm/avmcard.h Mon Apr 21 03:58:37 2003 @@ -12,6 +12,7 @@ #include #include +#include #define AVMB1_PORTLEN 0x1f #define AVM_MAXVERSION 8 @@ -555,7 +556,7 @@ void b1_release_appl(struct capi_ctr *ctrl, u16 appl); u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); void b1_parse_version(avmctrl_info *card); -void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs); +irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs); int b1ctl_read_proc(char *page, char **start, off_t off, int count, int *eof, struct capi_ctr *ctrl); @@ -568,7 +569,7 @@ int b1pciv4_detect(avmcard *card); int t1pci_detect(avmcard *card); void b1dma_reset(avmcard *card); -void b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs); +irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs); int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data); void b1dma_reset_ctr(struct capi_ctr *ctrl); diff -Nru a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c --- a/drivers/isdn/hardware/avm/b1.c Sun May 26 09:49:48 2002 +++ b/drivers/isdn/hardware/avm/b1.c Mon Apr 21 03:58:37 2003 @@ -491,7 +491,7 @@ /* ------------------------------------------------------------- */ -void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs) { avmcard *card = devptr; avmctrl_info *cinfo = &card->ctrlinfo[0]; @@ -506,7 +506,7 @@ unsigned WindowSize; if (!b1_rx_full(card->port)) - return; + return IRQ_NONE; b1cmd = b1_get_byte(card->port); @@ -619,12 +619,13 @@ case 0xff: printk(KERN_ERR "%s: card removed ?\n", card->name); - return; + return IRQ_NONE; default: printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n", card->name, b1cmd); - return; + return IRQ_HANDLED; } + return IRQ_HANDLED; } /* ------------------------------------------------------------- */ diff -Nru a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c --- a/drivers/isdn/hardware/avm/b1dma.c Sun May 26 09:49:48 2002 +++ b/drivers/isdn/hardware/avm/b1dma.c Mon Apr 21 03:58:37 2003 @@ -618,11 +618,12 @@ spin_unlock(&card->lock); } -void b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs) { avmcard *card = devptr; b1dma_handle_interrupt(card); + return IRQ_HANDLED; } /* ------------------------------------------------------------- */ diff -Nru a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c --- a/drivers/isdn/hardware/avm/c4.c Thu Aug 15 15:01:13 2002 +++ b/drivers/isdn/hardware/avm/c4.c Mon Apr 21 03:58:37 2003 @@ -659,7 +659,7 @@ /* ------------------------------------------------------------- */ -static void c4_handle_interrupt(avmcard *card) +static irqreturn_t c4_handle_interrupt(avmcard *card) { u32 status = c4inmeml(card->mbase+DOORBELL); @@ -667,7 +667,7 @@ int i; c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c); if (card->nlogcontr == 0) - return; + return IRQ_HANDLED; printk(KERN_ERR "%s: unexpected reset\n", card->name); for (i=0; i < card->nr_controllers; i++) { avmctrl_info *cinfo = &card->ctrlinfo[i]; @@ -676,12 +676,12 @@ capi_ctr_reseted(&cinfo->capi_ctrl); } card->nlogcontr = 0; - return; + return IRQ_HANDLED; } status &= (DBELL_UP_HOST | DBELL_DOWN_HOST); if (!status) - return; + return IRQ_HANDLED; c4outmeml(card->mbase+DOORBELL, status); if ((status & DBELL_UP_HOST) != 0) { @@ -702,13 +702,14 @@ c4_dispatch_tx(card); } } + return IRQ_HANDLED; } -static void c4_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +static irqreturn_t c4_interrupt(int interrupt, void *devptr, struct pt_regs *regs) { avmcard *card = devptr; - c4_handle_interrupt(card); + return c4_handle_interrupt(card); } /* ------------------------------------------------------------- */ diff -Nru a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c --- a/drivers/isdn/hardware/avm/t1isa.c Sun May 26 09:49:48 2002 +++ b/drivers/isdn/hardware/avm/t1isa.c Mon Apr 21 03:58:37 2003 @@ -124,7 +124,7 @@ return 0; } -static void t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +static irqreturn_t t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs) { avmcard *card = devptr; avmctrl_info *cinfo = &card->ctrlinfo[0]; @@ -252,13 +252,14 @@ case 0xff: printk(KERN_ERR "%s: card reseted ?\n", card->name); - return; + return IRQ_HANDLED; default: printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n", card->name, b1cmd); - return; + return IRQ_NONE; } } + return IRQ_HANDLED; } /* ------------------------------------------------------------- */ diff -Nru a/drivers/isdn/hisax/avm_a1.c b/drivers/isdn/hisax/avm_a1.c --- a/drivers/isdn/hisax/avm_a1.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/avm_a1.c Mon Apr 21 03:58:37 2003 @@ -113,14 +113,16 @@ .write_fifo = hscx_write_fifo, }; -static void +static irqreturn_t avm_a1_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; u8 val, sval; + int handled = 0; spin_lock(&cs->lock); while (((sval = bytein(cs->hw.avm.cfg_reg)) & 0xf) != 0x7) { + handled = 1; if (!(sval & AVM_A1_STAT_TIMER)) { byteout(cs->hw.avm.cfg_reg, 0x1E); sval = bytein(cs->hw.avm.cfg_reg); @@ -144,6 +146,7 @@ hscx_write(cs, 0, HSCX_MASK, 0x0); hscx_write(cs, 1, HSCX_MASK, 0x0); spin_unlock(&cs->lock); + return IRQ_RETVAL(handled); } static void diff -Nru a/drivers/isdn/hisax/avm_a1p.c b/drivers/isdn/hisax/avm_a1p.c --- a/drivers/isdn/hisax/avm_a1p.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/avm_a1p.c Mon Apr 21 03:58:37 2003 @@ -159,7 +159,7 @@ .write_fifo = hscx_write_fifo, }; -static void +static irqreturn_t avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -187,6 +187,7 @@ hscx_write(cs, 0, HSCX_MASK, 0x0); hscx_write(cs, 1, HSCX_MASK, 0x0); spin_unlock(&cs->lock); + return IRQ_HANDLED; } static void diff -Nru a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c --- a/drivers/isdn/hisax/bkm_a4t.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/bkm_a4t.c Mon Apr 21 03:58:37 2003 @@ -137,18 +137,20 @@ .write_fifo = jade_write_fifo, }; -static void +static irqreturn_t bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; u8 val = 0; I20_REGISTER_FILE *pI20_Regs; + int handled = 0; spin_lock(&cs->lock); pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base); /* ISDN interrupt pending? */ if (pI20_Regs->i20IntStatus & intISDN) { + handled = 1; /* Reset the ISDN interrupt */ pI20_Regs->i20IntStatus = intISDN; /* Disable ISDN interrupt */ @@ -172,6 +174,7 @@ pI20_Regs->i20IntCtrl |= intISDN; } spin_unlock(&cs->lock); + return IRQ_RETVAL(handled); } static void diff -Nru a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c --- a/drivers/isdn/hisax/diva.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/diva.c Mon Apr 21 03:58:37 2003 @@ -319,7 +319,7 @@ .read_fifo = ipacx_bc_read_fifo, }; -static void +static irqreturn_t diva_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -331,9 +331,10 @@ } if (!cnt) printk(KERN_WARNING "Diva: IRQ LOOP\n"); + return IRQ_HANDLED; } -static void +static irqreturn_t diva_ipac_pci_irq(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -341,22 +342,24 @@ val = readb(cs->hw.diva.pci_cfg); if (!(val & PITA_INT0_STATUS)) - return; /* other shared IRQ */ + return IRQ_NONE; /* other shared IRQ */ writeb(PITA_INT0_STATUS, cs->hw.diva.pci_cfg); /* Reset pending INT0 */ - ipac_irq(intno, dev_id, regs); + return ipac_irq(intno, dev_id, regs); } -static void +static irqreturn_t diva_ipacx_pci_irq(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; u8 val; val = readb(cs->hw.diva.pci_cfg); - if (!(val &PITA_INT0_STATUS)) return; // other shared IRQ + if (!(val &PITA_INT0_STATUS)) + return IRQ_NONE; // other shared IRQ interrupt_ipacx(cs); // handler for chip writeb(PITA_INT0_STATUS, cs->hw.diva.pci_cfg); // Reset PLX interrupt + return IRQ_HANDLED; } static void diff -Nru a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c --- a/drivers/isdn/hisax/elsa.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/elsa.c Mon Apr 21 03:58:37 2003 @@ -307,7 +307,7 @@ return (v & ELSA_TIMER_RUN); } -static void +static irqreturn_t elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -317,7 +317,7 @@ /* The card tends to generate interrupts while being removed causing us to just crash the kernel. bad. */ printk(KERN_WARNING "Elsa: card not available!\n"); - return; + return IRQ_NONE; } #if ARCOFI_USE if (cs->hw.elsa.MFlag) { @@ -351,9 +351,10 @@ #endif if (cs->hw.elsa.trig) byteout(cs->hw.elsa.trig, 0x00); + return IRQ_HANDLED; } -static void +static irqreturn_t elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -361,13 +362,13 @@ if (!cs) { printk(KERN_WARNING "Elsa: Spurious interrupt!\n"); - return; + return IRQ_NONE; } if (cs->subtyp == ELSA_QS1000PCI || cs->subtyp == ELSA_QS3000PCI) { val = bytein(cs->hw.elsa.cfg + 0x4c); /* PCI IRQ */ if (!test_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags) && !(val & ELSA_PCI_IRQ_MASK)) - return; + return IRQ_NONE; } #if ARCOFI_USE if (cs->hw.elsa.MFlag) { @@ -380,7 +381,7 @@ } } #endif - ipac_irq(intno, dev_id, regs); + return ipac_irq(intno, dev_id, regs); } static void diff -Nru a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c --- a/drivers/isdn/hisax/enternow_pci.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/enternow_pci.c Mon Apr 21 03:58:37 2003 @@ -208,7 +208,7 @@ return 0; } -static void +static irqreturn_t enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -253,6 +253,7 @@ write_tiger(cs); } spin_unlock(&cs->lock); + return IRQ_HANDLED; } static struct card_ops enpci_ops = { diff -Nru a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c --- a/drivers/isdn/hisax/hfc_pci.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/hfc_pci.c Mon Apr 21 03:58:37 2003 @@ -869,7 +869,7 @@ /*********************/ /* Interrupt handler */ /*********************/ -static void +static irqreturn_t hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -880,17 +880,17 @@ if (!cs) { printk(KERN_WARNING "HFC-PCI: Spurious interrupt!\n"); - return; + return IRQ_NONE; } if (!(cs->hw.hfcpci.int_m2 & 0x08)) - return; /* not initialised */ + return IRQ_NONE; /* not initialised */ if (HFCPCI_ANYINT & (stat = Read_hfc(cs, HFCPCI_STATUS))) { val = Read_hfc(cs, HFCPCI_INT_S1); if (cs->debug & L1_DEB_ISAC) debugl1(cs, "HFC-PCI: stat(%02x) s1(%02x)", stat, val); } else - return; + return IRQ_NONE; if (cs->debug & L1_DEB_ISAC) debugl1(cs, "HFC-PCI irq %x", val); @@ -964,6 +964,7 @@ } else val = 0; } + return IRQ_HANDLED; } /********************************************************************/ diff -Nru a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c --- a/drivers/isdn/hisax/hfc_sx.c Sat Apr 19 13:06:54 2003 +++ b/drivers/isdn/hisax/hfc_sx.c Mon Apr 21 03:58:37 2003 @@ -661,7 +661,7 @@ /*********************/ /* Interrupt handler */ /*********************/ -static void +static irqreturn_t hfcsx_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -672,17 +672,17 @@ if (!cs) { printk(KERN_WARNING "HFC-SX: Spurious interrupt!\n"); - return; + return IRQ_NONE; } if (!(cs->hw.hfcsx.int_m2 & 0x08)) - return; /* not initialised */ + return IRQ_NONE; /* not initialised */ if (HFCSX_ANYINT & (stat = Read_hfc(cs, HFCSX_STATUS))) { val = Read_hfc(cs, HFCSX_INT_S1); if (cs->debug & L1_DEB_ISAC) debugl1(cs, "HFC-SX: stat(%02x) s1(%02x)", stat, val); } else - return; + return IRQ_NONE; if (cs->debug & L1_DEB_ISAC) debugl1(cs, "HFC-SX irq %x", val); @@ -756,6 +756,7 @@ } else val = 0; } + return IRQ_HANDLED; } /********************************************************************/ diff -Nru a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c --- a/drivers/isdn/hisax/hfcscard.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/hfcscard.c Mon Apr 21 03:58:37 2003 @@ -32,7 +32,7 @@ cs->bc_hw_ops->write_reg(cs, data, reg, val); } -static void +static irqreturn_t hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -40,7 +40,7 @@ if (!cs) { printk(KERN_WARNING "HFCS: Spurious interrupt!\n"); - return; + return IRQ_NONE; } if ((HFCD_ANYINT | HFCD_BUSY_NBUSY) & (stat = hfcs_read_reg(cs, HFCD_DATA, HFCD_STAT))) { @@ -52,6 +52,7 @@ if (cs->debug & L1_DEB_ISAC) debugl1(cs, "HFCS: irq_no_irq stat(%02x)", stat); } + return IRQ_HANDLED; } static void diff -Nru a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h --- a/drivers/isdn/hisax/hisax.h Thu Mar 6 23:20:18 2003 +++ b/drivers/isdn/hisax/hisax.h Mon Apr 21 03:58:37 2003 @@ -28,6 +28,7 @@ #include #include #include +#include #define ERROR_STATISTIC @@ -886,7 +887,7 @@ void (*release) (struct IsdnCardState *); void (*aux_ind) (struct IsdnCardState *, void *); void (*led_handler)(struct IsdnCardState *); - void (*irq_func) (int, void *, struct pt_regs *); + irqreturn_t (*irq_func) (int, void *, struct pt_regs *); }; /* Card specific drivers provide methods to access the diff -Nru a/drivers/isdn/hisax/hisax_fcclassic.c b/drivers/isdn/hisax/hisax_fcclassic.c --- a/drivers/isdn/hisax/hisax_fcclassic.c Sat Feb 22 08:50:25 2003 +++ b/drivers/isdn/hisax/hisax_fcclassic.c Mon Apr 21 03:58:37 2003 @@ -120,7 +120,7 @@ // ---------------------------------------------------------------------- -static void +static irqreturn_t fcclassic_irq(int intno, void *dev, struct pt_regs *regs) { struct fritz_adapter *adapter = dev; @@ -139,6 +139,7 @@ isac_irq(&adapter->isac); } } + return IRQ_HANDLED; } // ---------------------------------------------------------------------- diff -Nru a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c --- a/drivers/isdn/hisax/hisax_fcpcipnp.c Tue Mar 25 09:31:31 2003 +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c Mon Apr 21 03:58:37 2003 @@ -629,7 +629,7 @@ // ---------------------------------------------------------------------- -static void fcpci2_irq(int intno, void *dev, struct pt_regs *regs) +static irqreturn_t fcpci2_irq(int intno, void *dev, struct pt_regs *regs) { struct fritz_adapter *adapter = dev; unsigned char val; @@ -637,16 +637,17 @@ val = inb(adapter->io + AVM_STATUS0); if (!(val & AVM_STATUS0_IRQ_MASK)) /* hopefully a shared IRQ reqest */ - return; + return IRQ_NONE; DBG(2, "STATUS0 %#x", val); if (val & AVM_STATUS0_IRQ_ISAC) isacsx_irq(&adapter->isac); if (val & AVM_STATUS0_IRQ_HDLC) hdlc_irq(adapter); + return IRQ_HANDLED; } -static void fcpci_irq(int intno, void *dev, struct pt_regs *regs) +static irqreturn_t fcpci_irq(int intno, void *dev, struct pt_regs *regs) { struct fritz_adapter *adapter = dev; unsigned char sval; @@ -654,13 +655,14 @@ sval = inb(adapter->io + 2); if ((sval & AVM_STATUS0_IRQ_MASK) == AVM_STATUS0_IRQ_MASK) /* possibly a shared IRQ reqest */ - return; + return IRQ_NONE; DBG(2, "sval %#x", sval); if (!(sval & AVM_STATUS0_IRQ_ISAC)) isac_irq(&adapter->isac); if (!(sval & AVM_STATUS0_IRQ_HDLC)) hdlc_irq(adapter); + return IRQ_HANDLED; } // ---------------------------------------------------------------------- diff -Nru a/drivers/isdn/hisax/hisax_hfcpci.c b/drivers/isdn/hisax/hisax_hfcpci.c --- a/drivers/isdn/hisax/hisax_hfcpci.c Sun Jan 12 12:14:10 2003 +++ b/drivers/isdn/hisax/hisax_hfcpci.c Mon Apr 21 03:58:37 2003 @@ -1321,7 +1321,7 @@ // ---------------------------------------------------------------------- // IRQ handler -static void +static irqreturn_t hfcpci_irq(int intno, void *dev, struct pt_regs *regs) { struct hfcpci_adapter *adapter = dev; @@ -1329,11 +1329,11 @@ u8 val, stat; if (!(adapter->int_m2 & 0x08)) - return; /* not initialised */ // XX + return IRQ_NONE; /* not initialised */ // XX stat = hfcpci_readb(adapter, HFCPCI_STATUS); if (!(stat & HFCPCI_ANYINT)) - return; + return IRQ_NONE; spin_lock(&adapter->hw_lock); while (loop-- > 0) { @@ -1369,6 +1369,7 @@ hfcpci_timer_irq(adapter); } spin_unlock(&adapter->hw_lock); + return IRQ_HANDLED; } // ---------------------------------------------------------------------- diff -Nru a/drivers/isdn/hisax/hscx.h b/drivers/isdn/hisax/hscx.h --- a/drivers/isdn/hisax/hscx.h Sun Jan 12 16:12:37 2003 +++ b/drivers/isdn/hisax/hscx.h Mon Apr 21 03:58:37 2003 @@ -10,6 +10,8 @@ * */ +#include + /* All Registers original Siemens Spec */ #define HSCX_ISTA 0x20 @@ -37,7 +39,7 @@ extern void modehscx(struct BCState *bcs, int mode, int bc); extern void inithscxisac(struct IsdnCardState *cs); extern void hscx_int_main(struct IsdnCardState *cs, u8 val); -extern void hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs); +extern irqreturn_t hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs); extern int hscxisac_setup(struct IsdnCardState *cs, struct dc_hw_ops *isac_ops, struct bc_hw_ops *hscx_ops); diff -Nru a/drivers/isdn/hisax/hscx_irq.c b/drivers/isdn/hisax/hscx_irq.c --- a/drivers/isdn/hisax/hscx_irq.c Sat Jan 11 11:37:52 2003 +++ b/drivers/isdn/hisax/hscx_irq.c Mon Apr 21 03:58:37 2003 @@ -185,7 +185,7 @@ cs->dc_hw_ops->write_reg(cs, addr, val); } -void +irqreturn_t hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -221,5 +221,6 @@ hscx_write(&cs->bcs[0], HSCX_MASK, 0x0); hscx_write(&cs->bcs[1], HSCX_MASK, 0x0); spin_unlock(&cs->lock); + return IRQ_HANDLED; } diff -Nru a/drivers/isdn/hisax/ipac.c b/drivers/isdn/hisax/ipac.c --- a/drivers/isdn/hisax/ipac.c Sun Jan 12 16:12:37 2003 +++ b/drivers/isdn/hisax/ipac.c Mon Apr 21 03:58:37 2003 @@ -47,7 +47,7 @@ inithscxisac(cs); } -void +irqreturn_t ipac_irq(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -90,6 +90,7 @@ ipac_write(cs, IPAC_MASK, 0xFF); ipac_write(cs, IPAC_MASK, 0xC0); spin_unlock(&cs->lock); + return IRQ_HANDLED; } int @@ -102,4 +103,5 @@ cs->bc_hw_ops = ipac_bc_ops; val = ipac_read(cs, IPAC_ID); printk(KERN_INFO "HiSax: IPAC version %#x\n", val); + return 0; } diff -Nru a/drivers/isdn/hisax/ipac.h b/drivers/isdn/hisax/ipac.h --- a/drivers/isdn/hisax/ipac.h Sun Jan 12 16:12:37 2003 +++ b/drivers/isdn/hisax/ipac.h Mon Apr 21 03:58:37 2003 @@ -10,6 +10,8 @@ * */ +#include + /* All Registers original Siemens Spec */ #define IPAC_CONF 0xC0 @@ -29,7 +31,7 @@ #define IPAC_TIMR2 0xCC void ipac_init(struct IsdnCardState *cs); -void ipac_irq(int intno, void *dev_id, struct pt_regs *regs); +irqreturn_t ipac_irq(int intno, void *dev_id, struct pt_regs *regs); int ipac_setup(struct IsdnCardState *cs, struct dc_hw_ops *ipac_dc_ops, struct bc_hw_ops *ipac_bc_ops); diff -Nru a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c --- a/drivers/isdn/hisax/niccy.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/niccy.c Mon Apr 21 03:58:37 2003 @@ -151,7 +151,7 @@ .write_fifo = hscx_write_fifo, }; -static void +static irqreturn_t niccy_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -160,10 +160,10 @@ int ival; ival = inl(cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG); if (!(ival & PCI_IRQ_ASSERT)) /* IRQ not for us (shared) */ - return; + return IRQ_NONE; outl(ival, cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG); } - hscxisac_irq(intno, dev_id, regs); + return hscxisac_irq(intno, dev_id, regs); } void diff -Nru a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c --- a/drivers/isdn/hisax/nj_s.c Thu Mar 6 22:52:04 2003 +++ b/drivers/isdn/hisax/nj_s.c Mon Apr 21 03:58:37 2003 @@ -17,7 +17,7 @@ const char *NETjet_S_revision = "$Revision: 2.7.6.6 $"; -static void +static irqreturn_t nj_s_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -70,6 +70,7 @@ } */ spin_unlock(&cs->lock); + return IRQ_HANDLED; } static int diff -Nru a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c --- a/drivers/isdn/hisax/nj_u.c Thu Mar 6 22:52:05 2003 +++ b/drivers/isdn/hisax/nj_u.c Mon Apr 21 03:58:37 2003 @@ -17,7 +17,7 @@ const char *NETjet_U_revision = "$Revision: 2.8.6.6 $"; -static void +static irqreturn_t nj_u_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -70,6 +70,7 @@ } */ spin_unlock(&cs->lock); + return IRQ_HANDLED; } static int diff -Nru a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c --- a/drivers/isdn/hisax/saphir.c Thu Mar 6 22:52:05 2003 +++ b/drivers/isdn/hisax/saphir.c Mon Apr 21 03:58:37 2003 @@ -132,13 +132,15 @@ .write_fifo = hscx_write_fifo, }; -static void +static irqreturn_t saphir_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; + irqreturn_t ret; - hscxisac_irq(intno, dev_id, regs); + ret = hscxisac_irq(intno, dev_id, regs); mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ); + return ret; } static void diff -Nru a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c --- a/drivers/isdn/hisax/sedlbauer.c Thu Mar 6 22:52:05 2003 +++ b/drivers/isdn/hisax/sedlbauer.c Mon Apr 21 03:58:37 2003 @@ -283,7 +283,7 @@ .write_reg = isar_write, }; -static void +static irqreturn_t sedlbauer_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -292,12 +292,12 @@ /* The card tends to generate interrupts while being removed causing us to just crash the kernel. bad. */ printk(KERN_WARNING "Sedlbauer: card not available!\n"); - return; + return IRQ_NONE; } - hscxisac_irq(intno, dev_id, regs); + return hscxisac_irq(intno, dev_id, regs); } -static void +static irqreturn_t sedlbauer_isar_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -334,6 +334,7 @@ isac_write(cs, ISAC_MASK, 0x0); isar_write(cs, 0, ISAR_IRQBIT, ISAR_IRQMSK); spin_unlock(&cs->lock); + return IRQ_HANDLED; } static int diff -Nru a/drivers/isdn/hisax/sportster.c b/drivers/isdn/hisax/sportster.c --- a/drivers/isdn/hisax/sportster.c Thu Mar 6 22:52:05 2003 +++ b/drivers/isdn/hisax/sportster.c Mon Apr 21 03:58:37 2003 @@ -111,13 +111,14 @@ .write_fifo = hscx_write_fifo, }; -static void +static irqreturn_t sportster_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; hscxisac_irq(intno, dev_id, regs); bytein(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ +1); + return IRQ_HANDLED; } static void diff -Nru a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c --- a/drivers/isdn/hisax/teleint.c Thu Mar 6 22:52:05 2003 +++ b/drivers/isdn/hisax/teleint.c Mon Apr 21 03:58:37 2003 @@ -178,7 +178,7 @@ .write_reg = WriteHFC, }; -static void +static irqreturn_t teleint_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -198,6 +198,7 @@ writereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0xFF); writereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0x0); spin_unlock(&cs->lock); + return IRQ_HANDLED; } static void diff -Nru a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c --- a/drivers/isdn/hisax/telespci.c Thu Mar 6 22:52:05 2003 +++ b/drivers/isdn/hisax/telespci.c Mon Apr 21 03:58:37 2003 @@ -199,7 +199,7 @@ .write_fifo = hscx_write_fifo, }; -static void +static irqreturn_t telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs) { #define MAXCOUNT 20 @@ -223,6 +223,7 @@ hscx_write(cs, 0, HSCX_MASK, 0x0); hscx_write(cs, 1, HSCX_MASK, 0x0); spin_unlock(&cs->lock); + return IRQ_HANDLED; } static struct card_ops telespci_ops = { diff -Nru a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c --- a/drivers/isdn/hisax/w6692.c Thu Mar 6 22:52:05 2003 +++ b/drivers/isdn/hisax/w6692.c Mon Apr 21 03:58:37 2003 @@ -287,7 +287,7 @@ } } -static void +static irqreturn_t w6692_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -395,6 +395,7 @@ w6692_write_reg(cs, W_IMASK, 0xff); } spin_unlock(&cs->lock); + return IRQ_HANDLED; } static void diff -Nru a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c --- a/drivers/isdn/hysdn/boardergo.c Tue Oct 1 09:01:14 2002 +++ b/drivers/isdn/hysdn/boardergo.c Mon Apr 21 03:58:37 2003 @@ -32,7 +32,7 @@ /***************************************************/ /* The cards interrupt handler. Called from system */ /***************************************************/ -static void +static irqreturn_t ergo_interrupt(int intno, void *dev_id, struct pt_regs *regs) { hysdn_card *card = dev_id; /* parameter from irq */ @@ -41,16 +41,16 @@ uchar volatile b; if (!card) - return; /* error -> spurious interrupt */ + return IRQ_NONE; /* error -> spurious interrupt */ if (!card->irq_enabled) - return; /* other device interrupting or irq switched off */ + return IRQ_NONE; /* other device interrupting or irq switched off */ save_flags(flags); cli(); /* no further irqs allowed */ if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) { restore_flags(flags); /* restore old state */ - return; /* no interrupt requested by E1 */ + return IRQ_NONE; /* no interrupt requested by E1 */ } /* clear any pending ints on the board */ dpr = card->dpram; @@ -62,6 +62,7 @@ if (!card->hw_lock) schedule_work(&card->irq_queue); restore_flags(flags); + return IRQ_HANDLED; } /* ergo_interrupt */ /******************************************************************************/ diff -Nru a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c --- a/drivers/isdn/pcbit/layer2.c Tue Oct 1 09:08:02 2002 +++ b/drivers/isdn/pcbit/layer2.c Mon Apr 21 03:58:37 2003 @@ -524,7 +524,7 @@ } } -void +irqreturn_t pcbit_irq_handler(int interrupt, void *devptr, struct pt_regs *regs) { struct pcbit_dev *dev; @@ -536,11 +536,11 @@ if (!dev) { printk(KERN_WARNING "pcbit_irq_handler: wrong device\n"); - return; + return IRQ_NONE; } if (dev->interrupt) { printk(KERN_DEBUG "pcbit: reentering interrupt hander\n"); - return; + return IRQ_HANDLED; } dev->interrupt = 1; @@ -549,7 +549,7 @@ if (dev->l2_state == L2_STARTING || dev->l2_state == L2_ERROR) { pcbit_l2_active_conf(dev, info); dev->interrupt = 0; - return; + return IRQ_HANDLED; } if (info & 0x40U) { /* E bit set */ #ifdef DEBUG @@ -557,11 +557,11 @@ #endif pcbit_l2_error(dev); dev->interrupt = 0; - return; + return IRQ_HANDLED; } if (dev->l2_state != L2_RUNNING && dev->l2_state != L2_LOADING) { dev->interrupt = 0; - return; + return IRQ_HANDLED; } ack_seq = (info >> 3) & 0x07U; read_seq = (info & 0x07U); @@ -582,6 +582,7 @@ info |= dev->send_seq; writeb(info, dev->sh_mem + BANK4); + return IRQ_HANDLED; } diff -Nru a/drivers/isdn/pcbit/layer2.h b/drivers/isdn/pcbit/layer2.h --- a/drivers/isdn/pcbit/layer2.h Mon Feb 4 23:49:25 2002 +++ b/drivers/isdn/pcbit/layer2.h Mon Apr 21 03:58:37 2003 @@ -17,6 +17,8 @@ #ifndef LAYER2_H #define LAYER2_H +#include + #include #define BANK1 0x0000U /* PC -> Board */ @@ -122,7 +124,7 @@ extern int pcbit_l2_write(struct pcbit_dev * dev, ulong msg, ushort refnum, struct sk_buff *skb, unsigned short hdr_len); -extern void pcbit_irq_handler(int interrupt, void *, struct pt_regs *regs); +extern irqreturn_t pcbit_irq_handler(int interrupt, void *, struct pt_regs *regs); extern struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS]; diff -Nru a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c --- a/drivers/isdn/sc/init.c Sun Nov 17 12:37:02 2002 +++ b/drivers/isdn/sc/init.c Mon Apr 21 03:58:37 2003 @@ -36,7 +36,7 @@ static int sup_irq[] = { 11, 10, 9, 5, 12, 14, 7, 3, 4, 6 }; #define MAX_IRQS 10 -extern void interrupt_handler(int, void *, struct pt_regs *); +extern irqreturn_t interrupt_handler(int, void *, struct pt_regs *); extern int sndpkt(int, int, int, struct sk_buff *); extern int command(isdn_ctrl *); extern int indicate_status(int, int, ulong, char*); diff -Nru a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c --- a/drivers/isdn/sc/interrupt.c Mon Sep 2 12:15:36 2002 +++ b/drivers/isdn/sc/interrupt.c Mon Apr 21 03:58:37 2003 @@ -19,6 +19,7 @@ #include "hardware.h" #include "message.h" #include "card.h" +#include extern int indicate_status(int, int, ulong, char *); extern void check_phystat(unsigned long); @@ -44,7 +45,8 @@ /* * */ -void interrupt_handler(int interrupt, void * cardptr, struct pt_regs *regs ) { +irqreturn_t interrupt_handler(int interrupt, void *cardptr, struct pt_regs *regs) +{ RspMessage rcvmsg; int channel; @@ -54,7 +56,7 @@ if(!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); - return; + return IRQ_NONE; } pr_debug("%s: Entered Interrupt handler\n", adapter[card]->devicename); @@ -242,4 +244,5 @@ } /* while */ pr_debug("%s: Exiting Interrupt Handler\n", adapter[card]->devicename); + return IRQ_HANDLED; } diff -Nru a/drivers/isdn/tpam/tpam.h b/drivers/isdn/tpam/tpam.h --- a/drivers/isdn/tpam/tpam.h Tue Oct 1 07:57:26 2002 +++ b/drivers/isdn/tpam/tpam.h Mon Apr 21 03:58:37 2003 @@ -17,6 +17,7 @@ #include #include #include +#include /* Maximum number of channels for this board */ #define TPAM_NBCHANNEL 30 @@ -197,7 +198,7 @@ /* Function prototypes from tpam_queues.c */ extern void tpam_enqueue(tpam_card *, struct sk_buff *); extern void tpam_enqueue_data(tpam_channel *, struct sk_buff *); -extern void tpam_irq(int, void *, struct pt_regs *); +extern irqreturn_t tpam_irq(int, void *, struct pt_regs *); extern void tpam_recv_tq(tpam_card *); extern void tpam_send_tq(tpam_card *); diff -Nru a/drivers/isdn/tpam/tpam_commands.c b/drivers/isdn/tpam/tpam_commands.c --- a/drivers/isdn/tpam/tpam_commands.c Tue Feb 25 10:27:26 2003 +++ b/drivers/isdn/tpam/tpam_commands.c Mon Apr 21 03:58:37 2003 @@ -173,7 +173,8 @@ * Return: 0 if OK, <0 on errors. */ static int tpam_command_ioctl_dsprun(tpam_card *card) { - u32 signature = 0, timeout, i; + u32 signature = 0, i; + unsigned long timeout; isdn_ctrl ctrl; struct sk_buff *skb; diff -Nru a/drivers/isdn/tpam/tpam_queues.c b/drivers/isdn/tpam/tpam_queues.c --- a/drivers/isdn/tpam/tpam_queues.c Tue Oct 1 08:15:11 2002 +++ b/drivers/isdn/tpam/tpam_queues.c Mon Apr 21 03:58:37 2003 @@ -74,7 +74,8 @@ * dev_id: the registered board to the irq * regs: not used. */ -void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) { +irqreturn_t tpam_irq(int irq, void *dev_id, struct pt_regs *regs) +{ tpam_card *card = (tpam_card *)dev_id; u32 ackupload, uploadptr; u32 waiting_too_long; @@ -115,7 +116,7 @@ printk(KERN_ERR "TurboPAM(tpam_irq): " "alloc_skb failed\n"); spin_unlock(&card->lock); - return; + return IRQ_HANDLED; } /* build the skb_header */ @@ -147,7 +148,7 @@ spin_unlock(&card->lock); printk(KERN_ERR "TurboPAM(tpam_irq): " "waiting too long...\n"); - return; + return IRQ_HANDLED; } } while (hpic & 0x00000002); @@ -169,7 +170,7 @@ skb_queue_tail(&card->recvq, skb); schedule_work(&card->recv_tq); } - return; + return IRQ_HANDLED; } else { /* it is a ack from the board */ @@ -185,10 +186,8 @@ /* schedule the send queue for execution */ schedule_work(&card->send_tq); - return; } - - /* not reached */ + return IRQ_HANDLED; } /* diff -Nru a/drivers/md/Kconfig b/drivers/md/Kconfig --- a/drivers/md/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/md/Kconfig Sun Apr 20 12:56:52 2003 @@ -25,7 +25,7 @@ More information about Software RAID on Linux is contained in the Software RAID mini-HOWTO, available from - . There you will also learn + . There you will also learn where to get the supporting user space utilities raidtools. If unsure, say N. @@ -57,7 +57,7 @@ Information about Software RAID on Linux is contained in the Software-RAID mini-HOWTO, available from - . There you will also + . There you will also learn where to get the supporting user space utilities raidtools. If you want to compile this as a module ( = code which can be @@ -81,7 +81,7 @@ Information about Software RAID on Linux is contained in the Software-RAID mini-HOWTO, available from - . There you will also + . There you will also learn where to get the supporting user space utilities raidtools. If you want to use such a RAID-1 set, say Y. This code is also @@ -106,7 +106,7 @@ Information about Software RAID on Linux is contained in the Software-RAID mini-HOWTO, available from - . There you will also + . There you will also learn where to get the supporting user space utilities raidtools. If you want to use such a RAID-4/RAID-5 set, say Y. This code is diff -Nru a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c --- a/drivers/md/dm-ioctl.c Sat Apr 5 23:55:25 2003 +++ b/drivers/md/dm-ioctl.c Sat Apr 19 14:26:30 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -174,16 +175,10 @@ static int register_with_devfs(struct hash_cell *hc) { struct gendisk *disk = dm_disk(hc->md); - char *name = kmalloc(DM_NAME_LEN + strlen(DM_DIR) + 1, GFP_KERNEL); - if (!name) { - return -ENOMEM; - } - sprintf(name, DM_DIR "/%s", hc->name); - devfs_register(NULL, name, 0, disk->major, disk->first_minor, + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor), S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, - &dm_blk_dops, NULL); - kfree(name); + DM_DIR "/%s", hc->name); return 0; } diff -Nru a/drivers/md/dm.c b/drivers/md/dm.c --- a/drivers/md/dm.c Sat Mar 8 14:50:22 2003 +++ b/drivers/md/dm.c Sat Apr 19 23:22:55 2003 @@ -15,7 +15,7 @@ #include static const char *_name = DM_NAME; -#define MAX_DEVICES (1 << KDEV_MINOR_BITS) +#define MAX_DEVICES 1024 static int major = 0; static int _major = 0; diff -Nru a/drivers/md/md.c b/drivers/md/md.c --- a/drivers/md/md.c Thu Apr 3 17:21:40 2003 +++ b/drivers/md/md.c Sat Apr 19 14:26:30 2003 @@ -3486,11 +3486,11 @@ devfs_mk_dir("md"); blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE, md_probe, NULL, NULL); + for (minor=0; minor < MAX_MD_DEVS; ++minor) { - char name[16]; - sprintf(name, "md/%d", minor); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, MAJOR_NR, minor, - S_IFBLK | S_IRUSR | S_IWUSR, &md_fops, NULL); + devfs_mk_bdev(MKDEV(MAJOR_NR, minor), + S_IFBLK|S_IRUSR|S_IWUSR, + "md/%d", minor); } register_reboot_notifier(&md_notifier); diff -Nru a/drivers/md/raid1.c b/drivers/md/raid1.c --- a/drivers/md/raid1.c Sat Apr 12 23:14:24 2003 +++ b/drivers/md/raid1.c Sun Apr 20 09:24:36 2003 @@ -258,7 +258,7 @@ r1_bio->sector + (r1_bio->master_bio->bi_size >> 9); } -static int end_request(struct bio *bio, unsigned int bytes_done, int error) +static int raid1_end_request(struct bio *bio, unsigned int bytes_done, int error) { int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); @@ -496,7 +496,7 @@ read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset; read_bio->bi_bdev = mirror->rdev->bdev; - read_bio->bi_end_io = end_request; + read_bio->bi_end_io = raid1_end_request; read_bio->bi_rw = r1_bio->cmd; read_bio->bi_private = r1_bio; @@ -531,7 +531,7 @@ mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset; mbio->bi_bdev = conf->mirrors[i].rdev->bdev; - mbio->bi_end_io = end_request; + mbio->bi_end_io = raid1_end_request; mbio->bi_rw = r1_bio->cmd; mbio->bi_private = r1_bio; @@ -551,11 +551,11 @@ /* * We have to be a bit careful about the semaphore above, thats * why we start the requests separately. Since generic_make_request() - * can sleep, this is the safer solution. Imagine, end_request + * can sleep, this is the safer solution. Imagine, raid1_end_request * decreasing the semaphore before we could have set it up ... * We could play tricks with the semaphore (presetting it and * correcting at the end if sum_bios is not 'n' but we have to - * do end_request by hand if all requests finish until we had a + * do raid1_end_request by hand if all requests finish until we had a * chance to set up the semaphore correctly ... lots of races). */ diff -Nru a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c --- a/drivers/media/common/saa7146_core.c Mon Apr 7 13:16:30 2003 +++ b/drivers/media/common/saa7146_core.c Mon Apr 21 01:03:35 2003 @@ -192,7 +192,7 @@ /********************************************************************************/ /* interrupt handler */ -static void interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) { struct saa7146_dev *dev = (struct saa7146_dev*)dev_id; u32 isr = 0; @@ -203,7 +203,7 @@ /* is this our interrupt? */ if ( 0 == isr ) { /* nope, some other device */ - return; + return IRQ_NONE; } saa7146_write(dev, ISR, isr); @@ -254,6 +254,7 @@ ERR(("disabling interrupt source(s)!\n")); IER_DISABLE(dev,isr); } + return IRQ_HANDLED; } /*********************************************************************************/ diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c --- a/drivers/media/dvb/dvb-core/dvbdev.c Thu Apr 17 09:17:57 2003 +++ b/drivers/media/dvb/dvb-core/dvbdev.c Sat Apr 19 01:48:24 2003 @@ -45,7 +45,6 @@ static int dvbdev_debug = 0; #define dprintk if (dvbdev_debug) printk -static devfs_handle_t dvb_devfs_handle; static LIST_HEAD(dvb_adapter_list); static DECLARE_MUTEX(dvbdev_register_lock); @@ -221,10 +220,8 @@ list_add_tail (&dvbdev->list_head, &adap->device_list); sprintf(name, "dvb/adapter%d%s%d", adap->num, dnames[type], id); - dvbdev->devfs_handle = devfs_register(NULL, name, 0, DVB_MAJOR, - nums2minor(adap->num, type, id), - S_IFCHR | S_IRUSR | S_IWUSR, - dvbdev->fops, dvbdev); + devfs_register(NULL, name, 0, DVB_MAJOR, nums2minor(adap->num, type, id), + S_IFCHR | S_IRUSR | S_IWUSR, dvbdev->fops, dvbdev); dprintk("DVB: register adapter%d/%s @ minor: %i (0x%02x)\n", adap->num, name, nums2minor(adap->num, type, id), @@ -236,12 +233,12 @@ void dvb_unregister_device(struct dvb_device *dvbdev) { - if (!dvbdev) - return; - - devfs_unregister(dvbdev->devfs_handle); - list_del (&dvbdev->list_head); - kfree (dvbdev); + if (dvbdev) { + devfs_remove("dvb/adapter%d%s%d", dvbdev->adapter->num, + dnames[dvbdev->type], dvbdev->id); + list_del(&dvbdev->list_head); + kfree(dvbdev); + } } @@ -289,11 +286,12 @@ INIT_LIST_HEAD (&adap->device_list); /* fixme: is this correct? */ + /* No */ try_module_get(THIS_MODULE); printk ("DVB: registering new adapter (%s).\n", name); - adap->devfs_handle = devfs_mk_dir("dvb/adapter%d", num); + devfs_mk_dir("dvb/adapter%d", num); adap->num = num; adap->name = name; @@ -307,13 +305,14 @@ int dvb_unregister_adapter(struct dvb_adapter *adap) { - devfs_unregister (adap->devfs_handle); if (down_interruptible (&dvbdev_register_lock)) return -ERESTARTSYS; + devfs_remove("dvb/adapter%d", adap->num); list_del (&adap->list_head); up (&dvbdev_register_lock); kfree (adap); /* fixme: is this correct? */ + /* No. */ module_put(THIS_MODULE); return 0; } @@ -322,7 +321,7 @@ static int __init init_dvbdev(void) { - dvb_devfs_handle = devfs_mk_dir ("dvb"); + devfs_mk_dir("dvb"); #ifndef CONFIG_DVB_DEVFS_ONLY if(register_chrdev(DVB_MAJOR,"DVB", &dvb_device_fops)) { printk("video_dev: unable to get major %d\n", DVB_MAJOR); @@ -339,7 +338,7 @@ #ifndef CONFIG_DVB_DEVFS_ONLY unregister_chrdev(DVB_MAJOR, "DVB"); #endif - devfs_unregister(dvb_devfs_handle); + devfs_remove("dvb"); } module_init(init_dvbdev); diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h --- a/drivers/media/dvb/dvb-core/dvbdev.h Mon Apr 7 13:17:58 2003 +++ b/drivers/media/dvb/dvb-core/dvbdev.h Fri Apr 18 11:10:40 2003 @@ -45,7 +45,6 @@ struct dvb_adapter { int num; - devfs_handle_t devfs_handle; struct list_head list_head; struct list_head device_list; const char *name; @@ -55,7 +54,6 @@ struct dvb_device { struct list_head list_head; struct file_operations *fops; - devfs_handle_t devfs_handle; struct dvb_adapter *adapter; int type; u32 id; diff -Nru a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c --- a/drivers/media/video/stradis.c Thu Jan 16 16:55:35 2003 +++ b/drivers/media/video/stradis.c Mon Apr 21 01:04:20 2003 @@ -442,11 +442,12 @@ } } -static void saa7146_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t saa7146_irq(int irq, void *dev_id, struct pt_regs *regs) { struct saa7146 *saa = (struct saa7146 *) dev_id; u32 stat, astat; int count; + int handled = 0; count = 0; while (1) { @@ -454,7 +455,8 @@ stat = saaread(SAA7146_ISR); astat = stat & saaread(SAA7146_IER); if (!astat) - return; + break; + handled = 1; saawrite(astat, SAA7146_ISR); if (astat & SAA7146_PSR_DEBI_S) { do_irq_send_data(saa); @@ -611,6 +613,7 @@ "stradis%d: IRQ loop cleared\n", saa->nr); } } + return IRQ_RETVAL(handled); } static int ibm_send_command(struct saa7146 *saa, diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c --- a/drivers/media/video/videodev.c Thu Dec 5 18:56:38 2002 +++ b/drivers/media/video/videodev.c Sat Apr 19 03:13:38 2003 @@ -375,7 +375,6 @@ int base; int end; char *name_base; - char name[16]; switch(type) { @@ -426,19 +425,19 @@ vfd->minor=i; up(&videodev_lock); - sprintf (name, "v4l/%s%d", name_base, i - base); - vfd->devfs_handle = - devfs_register (NULL, name, DEVFS_FL_DEFAULT, - VIDEO_MAJOR, vfd->minor, - S_IFCHR | S_IRUSR | S_IWUSR, - &video_fops, - NULL); + sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base); + devfs_register(NULL, vfd->devfs_name, 0, VIDEO_MAJOR, vfd->minor, + S_IFCHR | S_IRUSR | S_IWUSR, &video_fops, NULL); init_MUTEX(&vfd->lock); #ifdef CONFIG_VIDEO_PROC_FS - sprintf (name, "%s%d", name_base, i - base); - videodev_proc_create_dev (vfd, name); +{ + char name[16]; + sprintf(name, "%s%d", name_base, i - base); + videodev_proc_create_dev(vfd, name); +} #endif + return 0; } @@ -460,7 +459,7 @@ videodev_proc_destroy_dev (vfd); #endif - devfs_unregister (vfd->devfs_handle); + devfs_remove(vfd->devfs_name); video_device[vfd->minor]=NULL; up(&videodev_lock); } diff -Nru a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c --- a/drivers/message/fusion/mptbase.c Fri Feb 21 06:26:38 2003 +++ b/drivers/message/fusion/mptbase.c Sun Apr 20 23:54:11 2003 @@ -179,7 +179,7 @@ /* * Forward protos... */ -static void mpt_interrupt(int irq, void *bus_id, struct pt_regs *r); +static irqreturn_t mpt_interrupt(int irq, void *bus_id, struct pt_regs *r); static int mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply); static int mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag); @@ -312,7 +312,7 @@ * dispatches (calls) a protocol-specific callback routine to handle * the protocol-specific details of the MPT request completion. */ -static void +static irqreturn_t mpt_interrupt(int irq, void *bus_id, struct pt_regs *r) { MPT_ADAPTER *ioc; @@ -338,7 +338,7 @@ if (!iocCmp) { printk(KERN_WARNING "mpt_interrupt: Invalid ioc!\n"); - return; + return IRQ_NONE; } } @@ -353,7 +353,7 @@ while (1) { if ((pa = CHIPREG_READ32(&ioc->chip->ReplyFifo)) == 0xFFFFFFFF) - return; + return IRQ_HANDLED; cb_idx = 0; freeme = 0; @@ -501,10 +501,12 @@ dirqprintk((MYIOC_s_INFO_FMT "ISR processed %d replies.", ioc->name, count)); dirqprintk((" Giving this ISR a break!\n")); - return; + return IRQ_HANDLED; } } /* drain reply FIFO */ + + return IRQ_HANDLED; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff -Nru a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c --- a/drivers/mtd/mtdblock.c Tue Apr 8 12:33:09 2003 +++ b/drivers/mtd/mtdblock.c Sat Apr 19 14:18:27 2003 @@ -528,25 +528,20 @@ if (!mtd || mtd->type == MTD_ABSENT) return; -#ifdef CONFIG_DEVFS_FS - sprintf(name, DEVICE_NAME"/%d", mtd->index); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - MTD_BLOCK_MAJOR, mtd->index, - S_IFBLK | S_IRUGO | S_IWUGO, - &mtd_fops, NULL); -#endif - disk = alloc_disk(1); if (disk) { disk->major = MAJOR_NR; disk->first_minor = mtd->index; disk->fops = &mtd_fops; + sprintf(disk->disk_name, "mtdblock%d", mtd->index); + sprintf(disk->devfs_name, "mtdblock/%d", mtd->index); mtddisk[mtd->index] = disk; set_capacity(disk, mtd->size / 512); disk->private_data = &mtdblks[mtd->index]; disk->queue = &mtd_queue; + add_disk(disk); } } @@ -555,8 +550,6 @@ { if (!mtd || mtd->type == MTD_ABSENT) return; - - devfs_remove(DEVICE_NAME"/%d", mtd->index); if (mtddisk[mtd->index]) { del_gendisk(mtddisk[mtd->index]); diff -Nru a/drivers/net/3c501.c b/drivers/net/3c501.c --- a/drivers/net/3c501.c Thu Mar 6 15:14:17 2003 +++ b/drivers/net/3c501.c Sun Apr 20 22:41:08 2003 @@ -510,7 +510,7 @@ * TCP window. */ -static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t el_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct net_local *lp; @@ -558,7 +558,7 @@ } lp->loading=2; /* Force a reload */ spin_unlock(&lp->lock); - return; + goto out; } if (el_debug > 6) @@ -606,7 +606,7 @@ outb(AX_XMIT, AX_CMD); lp->stats.collisions++; spin_unlock(&lp->lock); - return; + goto out; } else { @@ -675,7 +675,8 @@ inb(RX_STATUS); /* Be certain that interrupts are cleared. */ inb(TX_STATUS); spin_unlock(&lp->lock); - return; +out: + return IRQ_HANDLED; } diff -Nru a/drivers/net/3c501.h b/drivers/net/3c501.h --- a/drivers/net/3c501.h Wed Oct 9 10:48:40 2002 +++ b/drivers/net/3c501.h Sun Apr 20 22:41:08 2003 @@ -8,7 +8,7 @@ static int el_open(struct net_device *dev); static void el_timeout(struct net_device *dev); static int el_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t el_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void el_receive(struct net_device *dev); static void el_reset(struct net_device *dev); static int el1_close(struct net_device *dev); diff -Nru a/drivers/net/3c505.c b/drivers/net/3c505.c --- a/drivers/net/3c505.c Tue Apr 8 07:47:08 2003 +++ b/drivers/net/3c505.c Sun Apr 20 23:00:41 2003 @@ -259,7 +259,7 @@ static inline int get_status(unsigned int base_addr) { - int timeout = jiffies + 10*HZ/100; + unsigned long timeout = jiffies + 10*HZ/100; register int stat1; do { stat1 = inb_status(base_addr); @@ -283,7 +283,7 @@ inline static void adapter_reset(struct net_device *dev) { - int timeout; + unsigned long timeout; elp_device *adapter = dev->priv; unsigned char orig_hcr = adapter->hcr_val; @@ -343,7 +343,7 @@ /* Primitive functions used by send_pcb() */ static inline unsigned int send_pcb_slow(unsigned int base_addr, unsigned char byte) { - unsigned int timeout; + unsigned long timeout; outb_command(byte, base_addr); for (timeout = jiffies + 5*HZ/100; time_before(jiffies, timeout);) { if (inb_status(base_addr) & HCRE) @@ -402,7 +402,7 @@ static int send_pcb(struct net_device *dev, pcb_struct * pcb) { int i; - int timeout; + unsigned long timeout; elp_device *adapter = dev->priv; unsigned long flags; @@ -488,7 +488,7 @@ int i, j; int total_length; int stat; - int timeout; + unsigned long timeout; unsigned long flags; elp_device *adapter = dev->priv; @@ -662,14 +662,14 @@ * ******************************************************/ -static void elp_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr) +static irqreturn_t elp_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr) { int len; int dlen; int icount = 0; struct net_device *dev; elp_device *adapter; - int timeout; + unsigned long timeout; dev = dev_id; adapter = (elp_device *) dev->priv; @@ -855,6 +855,7 @@ * indicate no longer in interrupt routine */ spin_unlock(&adapter->lock); + return IRQ_HANDLED; } @@ -947,7 +948,7 @@ if (!send_pcb(dev, &adapter->tx_pcb)) printk("%s: couldn't send memory configuration command\n", dev->name); else { - int timeout = jiffies + TIMEOUT; + unsigned long timeout = jiffies + TIMEOUT; while (adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] == 0 && time_before(jiffies, timeout)); if (time_after_eq(jiffies, timeout)) TIMEOUT_MSG(__LINE__); @@ -966,7 +967,7 @@ if (!send_pcb(dev, &adapter->tx_pcb)) printk("%s: couldn't send 82586 configure command\n", dev->name); else { - int timeout = jiffies + TIMEOUT; + unsigned long timeout = jiffies + TIMEOUT; while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout)); if (time_after_eq(jiffies, timeout)) TIMEOUT_MSG(__LINE__); @@ -1150,7 +1151,7 @@ if (!send_pcb(dev, &adapter->tx_pcb)) printk("%s: couldn't send get statistics command\n", dev->name); else { - int timeout = jiffies + TIMEOUT; + unsigned long timeout = jiffies + TIMEOUT; while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && time_before(jiffies, timeout)); if (time_after_eq(jiffies, timeout)) { TIMEOUT_MSG(__LINE__); @@ -1317,7 +1318,7 @@ if (!send_pcb(dev, &adapter->tx_pcb)) printk("%s: couldn't send set_multicast command\n", dev->name); else { - int timeout = jiffies + TIMEOUT; + unsigned long timeout = jiffies + TIMEOUT; while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && time_before(jiffies, timeout)); if (time_after_eq(jiffies, timeout)) { TIMEOUT_MSG(__LINE__); @@ -1344,7 +1345,7 @@ printk("%s: couldn't send 82586 configure command\n", dev->name); } else { - int timeout = jiffies + TIMEOUT; + unsigned long timeout = jiffies + TIMEOUT; spin_unlock_irqrestore(&adapter->lock, flags); while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout)); if (time_after_eq(jiffies, timeout)) @@ -1396,10 +1397,8 @@ static int __init elp_sense(struct net_device *dev) { - int timeout; int addr = dev->base_addr; const char *name = dev->name; - unsigned long flags; byte orig_HSR; if (!request_region(addr, ELP_IO_EXTENT, "3c505")) @@ -1506,7 +1505,8 @@ int __init elplus_probe(struct net_device *dev) { elp_device *adapter; - int i, tries, tries1, timeout, okay; + int i, tries, tries1, okay; + unsigned long timeout; unsigned long cookie = 0; SET_MODULE_OWNER(dev); diff -Nru a/drivers/net/3c505.h b/drivers/net/3c505.h --- a/drivers/net/3c505.h Tue Feb 5 09:40:01 2002 +++ b/drivers/net/3c505.h Sun Apr 20 23:00:41 2003 @@ -279,7 +279,7 @@ unsigned int length; struct sk_buff *skb; void *target; - long int start_time; + unsigned long start_time; } current_dma; /* flags */ diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c --- a/drivers/net/3c507.c Fri Jan 10 11:59:15 2003 +++ b/drivers/net/3c507.c Sun Apr 20 22:41:08 2003 @@ -291,7 +291,7 @@ static int el16_probe1(struct net_device *dev, int ioaddr); static int el16_open(struct net_device *dev); static int el16_send_packet(struct sk_buff *skb, struct net_device *dev); -static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t el16_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void el16_rx(struct net_device *dev); static int el16_close(struct net_device *dev); static struct net_device_stats *el16_get_stats(struct net_device *dev); @@ -516,7 +516,7 @@ /* The typical workload of the driver: Handle the network interface interrupts. */ -static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t el16_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct net_local *lp; @@ -526,7 +526,7 @@ if (dev == NULL) { printk ("net_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } ioaddr = dev->base_addr; @@ -616,6 +616,7 @@ /* Enable the 82586's interrupt input. */ outb(0x84, ioaddr + MISC_CTRL); spin_unlock(&lp->lock); + return IRQ_HANDLED; } static int el16_close(struct net_device *dev) diff -Nru a/drivers/net/3c509.c b/drivers/net/3c509.c --- a/drivers/net/3c509.c Wed Mar 19 15:35:44 2003 +++ b/drivers/net/3c509.c Sun Apr 20 22:41:08 2003 @@ -192,7 +192,7 @@ static ushort read_eeprom(int ioaddr, int index); static int el3_open(struct net_device *dev); static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void el3_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void update_stats(struct net_device *dev); static struct net_device_stats *el3_get_stats(struct net_device *dev); static int el3_rx(struct net_device *dev); @@ -882,7 +882,7 @@ } /* The EL3 interrupt handler. */ -static void +static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; @@ -892,7 +892,7 @@ if (dev == NULL) { printk ("el3_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } lp = (struct el3_private *)dev->priv; @@ -967,7 +967,7 @@ inw(ioaddr + EL3_STATUS)); } spin_unlock(&lp->lock); - return; + return IRQ_HANDLED; } diff -Nru a/drivers/net/3c515.c b/drivers/net/3c515.c --- a/drivers/net/3c515.c Tue Feb 25 11:50:51 2003 +++ b/drivers/net/3c515.c Sun Apr 20 22:41:08 2003 @@ -1,4 +1,3 @@ - /* Written 1997-1998 by Donald Becker. @@ -387,7 +386,7 @@ static int corkscrew_rx(struct net_device *dev); static void corkscrew_timeout(struct net_device *dev); static int boomerang_rx(struct net_device *dev); -static void corkscrew_interrupt(int irq, void *dev_id, +static irqreturn_t corkscrew_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int corkscrew_close(struct net_device *dev); static void update_stats(int addr, struct net_device *dev); @@ -1150,7 +1149,7 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void corkscrew_interrupt(int irq, void *dev_id, +static irqreturn_t corkscrew_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* Use the now-standard shared IRQ implementation. */ @@ -1289,6 +1288,7 @@ if (corkscrew_debug > 4) printk("%s: exiting interrupt, status %4.4x.\n", dev->name, status); + return IRQ_HANDLED; } static int corkscrew_rx(struct net_device *dev) diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c --- a/drivers/net/3c59x.c Tue Apr 8 04:25:37 2003 +++ b/drivers/net/3c59x.c Sun Apr 20 22:41:08 2003 @@ -885,8 +885,8 @@ static int boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev); static int vortex_rx(struct net_device *dev); static int boomerang_rx(struct net_device *dev); -static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs); -static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int vortex_close(struct net_device *dev); static void dump_tx_ring(struct net_device *dev); static void update_stats(long ioaddr, struct net_device *dev); @@ -2208,14 +2208,16 @@ * full_bus_master_tx == 0 && full_bus_master_rx == 0 */ -static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct vortex_private *vp = (struct vortex_private *)dev->priv; long ioaddr; int status; int work_done = max_interrupt_work; - + int handled = 0; + ioaddr = dev->base_addr; spin_lock(&vp->lock); @@ -2226,6 +2228,7 @@ if ((status & IntLatch) == 0) goto handler_exit; /* No interrupt: shared IRQs cause this */ + handled = 1; if (status & IntReq) { status |= vp->deferred; @@ -2302,6 +2305,7 @@ dev->name, status); handler_exit: spin_unlock(&vp->lock); + return IRQ_RETVAL(handled); } /* @@ -2309,13 +2313,15 @@ * full_bus_master_tx == 1 && full_bus_master_rx == 1 */ -static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct vortex_private *vp = (struct vortex_private *)dev->priv; long ioaddr; int status; int work_done = max_interrupt_work; + int handled; ioaddr = dev->base_addr; @@ -2330,14 +2336,18 @@ if (vortex_debug > 6) printk(KERN_DEBUG "boomerang_interrupt. status=0x%4x\n", status); - if ((status & IntLatch) == 0) + if ((status & IntLatch) == 0) { + handled = 0; goto handler_exit; /* No interrupt: shared IRQs can cause this */ + } if (status == 0xffff) { /* h/w no longer present (hotplug)? */ if (vortex_debug > 1) printk(KERN_DEBUG "boomerang_interrupt(1): status = 0xffff\n"); + handled = 0; goto handler_exit; } + handled = 1; if (status & IntReq) { status |= vp->deferred; @@ -2432,6 +2442,7 @@ dev->name, status); handler_exit: spin_unlock(&vp->lock); + return IRQ_RETVAL(handled); } static int vortex_rx(struct net_device *dev) diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c --- a/drivers/net/8139cp.c Mon Apr 7 00:03:41 2003 +++ b/drivers/net/8139cp.c Sun Apr 20 22:09:47 2003 @@ -658,7 +658,8 @@ cp->rx_tail = rx_tail; } -static void cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t +cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = dev_instance; struct cp_private *cp = dev->priv; @@ -666,7 +667,7 @@ status = cpr16(IntrStatus); if (!status || (status == 0xFFFF)) - return; + return IRQ_NONE; if (netif_msg_intr(cp)) printk(KERN_DEBUG "%s: intr, status %04x cmd %02x cpcmd %04x\n", @@ -693,6 +694,7 @@ } spin_unlock(&cp->lock); + return IRQ_HANDLED; } static void cp_tx (struct cp_private *cp) diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Sun Feb 16 12:44:16 2003 +++ b/drivers/net/8139too.c Sun Apr 20 22:09:47 2003 @@ -615,7 +615,7 @@ static void rtl8139_init_ring (struct net_device *dev); static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev); -static void rtl8139_interrupt (int irq, void *dev_instance, +static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance, struct pt_regs *regs); static int rtl8139_close (struct net_device *dev); static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); @@ -2029,7 +2029,7 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void rtl8139_interrupt (int irq, void *dev_instance, +static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_instance; @@ -2038,6 +2038,7 @@ void *ioaddr = tp->mmio_addr; int ackstat, status; int link_changed = 0; /* avoid bogus "uninit" warning */ + int handled = 0; spin_lock (&tp->lock); @@ -2053,6 +2054,8 @@ RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0) break; + handled = 1; + /* Acknowledge all of the current interrupt sources ASAP, but an first get an additional status bit from CSCR. */ if (status & RxUnderrun) @@ -2097,6 +2100,7 @@ DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", dev->name, RTL_R16 (IntrStatus)); + return IRQ_RETVAL(handled); } diff -Nru a/drivers/net/82596.c b/drivers/net/82596.c --- a/drivers/net/82596.c Wed Feb 5 08:51:16 2003 +++ b/drivers/net/82596.c Sun Apr 20 22:09:47 2003 @@ -357,7 +357,7 @@ static int i596_open(struct net_device *dev); static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void i596_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int i596_close(struct net_device *dev); static struct net_device_stats *i596_get_stats(struct net_device *dev); static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd); @@ -1018,8 +1018,6 @@ netif_start_queue(dev); - MOD_INC_USE_COUNT; - /* Initialize the 82596 memory */ if (init_i596_mem(dev)) { res = -EAGAIN; @@ -1218,6 +1216,7 @@ DEB(DEB_PROBE,printk(KERN_INFO "%s", version)); /* The 82596-specific entries in the device structure. */ + SET_MODULE_OWNER(dev); dev->open = i596_open; dev->stop = i596_close; dev->hard_start_xmit = i596_start_xmit; @@ -1247,24 +1246,25 @@ return 0; } -static void i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct i596_private *lp; short ioaddr; unsigned short status, ack_cmd = 0; + int handled = 0; #ifdef ENABLE_BVME6000_NET if (MACH_IS_BVME6000) { if (*(char *) BVME_LOCAL_IRQ_STAT & BVME_ETHERR) { i596_error(irq, dev_id, regs); - return; + return IRQ_HANDLED; } } #endif if (dev == NULL) { printk(KERN_ERR "i596_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } ioaddr = dev->base_addr; @@ -1283,6 +1283,7 @@ if ((status & 0x8000) || (status & 0x2000)) { struct i596_cmd *ptr; + handled = 1; if ((status & 0x8000)) DEB(DEB_INTS,printk(KERN_DEBUG "%s: i596 interrupt completed command.\n", dev->name)); if ((status & 0x2000)) @@ -1405,7 +1406,7 @@ DEB(DEB_INTS,printk(KERN_DEBUG "%s: exiting interrupt.\n", dev->name)); spin_unlock (&lp->lock); - return; + return IRQ_RETVAL(handled); } static int i596_close(struct net_device *dev) @@ -1450,7 +1451,6 @@ free_irq(dev->irq, dev); remove_rx_bufs(dev); - MOD_DEC_USE_COUNT; return 0; } diff -Nru a/drivers/net/8390.c b/drivers/net/8390.c --- a/drivers/net/8390.c Tue Feb 25 02:44:22 2003 +++ b/drivers/net/8390.c Sun Apr 20 21:26:41 2003 @@ -421,7 +421,7 @@ * needed. */ -void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs) +irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; long e8390_base; @@ -431,7 +431,7 @@ if (dev == NULL) { printk ("net_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } e8390_base = dev->base_addr; @@ -454,7 +454,7 @@ inb_p(e8390_base + EN0_IMR)); #endif spin_unlock(&ei_local->page_lock); - return; + return IRQ_NONE; } /* Change to page 0 and read the intr status reg. */ @@ -520,7 +520,7 @@ } } spin_unlock(&ei_local->page_lock); - return; + return IRQ_HANDLED; } /** diff -Nru a/drivers/net/8390.h b/drivers/net/8390.h --- a/drivers/net/8390.h Tue Oct 15 07:03:22 2002 +++ b/drivers/net/8390.h Sun Apr 20 21:26:41 2003 @@ -43,7 +43,7 @@ extern void NS8390_init(struct net_device *dev, int startp); extern int ei_open(struct net_device *dev); extern int ei_close(struct net_device *dev); -extern void ei_interrupt(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* You have one of these per-board */ struct ei_device { diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig Sun Mar 30 01:45:41 2003 +++ b/drivers/net/Kconfig Sun Apr 20 12:56:51 2003 @@ -12,7 +12,7 @@ telephone line with a modem either via UUCP (UUCP is a protocol to forward mail and news between unix hosts over telephone lines; read the UUCP-HOWTO, available from - ) or dialing up a shell + ) or dialing up a shell account or a BBS, even using term (term is a program which gives you almost full Internet connectivity if you have a regular dial up shell account on some Internet connected Unix computer. Read @@ -32,7 +32,7 @@ Make sure to read the NET-3-HOWTO. Eventually, you will have to read Olaf Kirch's excellent and free book "Network Administrator's - Guide", to be found in . If + Guide", to be found in . If unsure, say Y. if NETDEVICES @@ -51,7 +51,7 @@ thing often comes in handy, the default is Y. It won't enlarge your kernel either. What a deal. Read about it in the Network Administrator's Guide, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -98,7 +98,7 @@ Say Y if you want this and read . You may also want to read section 6.2 of the NET-3-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -206,7 +206,7 @@ If your Linux machine will be connected to an Ethernet and you have an Ethernet network interface card (NIC) installed in your computer, say Y here and read the Ethernet-HOWTO, available from - . You will then also have + . You will then also have to say Y to the driver for your particular NIC. Note that the answer to this question won't directly affect the @@ -357,7 +357,7 @@ If you want to include a driver to support Nubus or LC-PDS Ethernet cards using an NS8390 chipset or its equivalent, say Y and read the Ethernet-HOWTO, available from - . + . config MAC89x0 tristate "Macintosh CS89x0 based ethernet cards" @@ -366,7 +366,7 @@ Support for CS89x0 chipset based Ethernet cards. If you have a Nubus or LC-PDS network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -382,7 +382,7 @@ the onboard Ethernet in many Quadras as well as some LC-PDS, a few Nubus and all known Comm Slot Ethernet cards. If you have one of these say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -397,7 +397,7 @@ Support for the onboard AMD 79C940 MACE Ethernet controller used in the 660AV and 840AV Macintosh. If you have one of these Macintoshes say Y and read the Ethernet-HOWTO, available from - . + . config MVME147_NET tristate "MVME147 (Lance) Ethernet support" @@ -516,7 +516,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . config STNIC tristate "National DP83902AV support" @@ -595,7 +595,7 @@ help If you have a network (Ethernet) card belonging to this class, say Y and read the Ethernet-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -608,7 +608,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Also, consider buying a + . Also, consider buying a new card, since the 3c501 is slow, broken, and obsolete: you will have problems. Some people suggest to ping ("man ping") a nearby machine every minute ("man cron") when using this card. @@ -625,7 +625,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -640,7 +640,7 @@ Information about this network (Ethernet) card can be found in . If you have a card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -654,7 +654,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -668,7 +668,7 @@ ---help--- If you have a network (Ethernet) card belonging to the 3Com EtherLinkIII series, say Y and read the Ethernet-HOWTO, available - from . + from . If your card is not working you may need to use the DOS setup disk to disable Plug & Play mode, and to select the default @@ -686,7 +686,7 @@ help If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet network card, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -700,7 +700,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -714,7 +714,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -736,7 +736,7 @@ "Hurricane" (3c555/3cSOHO) PCI If you have such a card, say Y and read the Ethernet-HOWTO, - available from . More + available from . More specific information is in and in the comments at the beginning of . @@ -758,7 +758,7 @@ If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -772,7 +772,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Some LinkSys cards are + . Some LinkSys cards are of this type. If you want to compile this driver as a module ( = code which can be @@ -786,7 +786,7 @@ help If you have a network (Ethernet) card belonging to this class, say Y and read the Ethernet-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -799,7 +799,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -813,7 +813,7 @@ help If you have a network (Ethernet) card of this type and are running an MCA based system (PS/2), say Y and read the Ethernet-HOWTO, - available from . + available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -827,7 +827,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . Important: There have been many reports that, with some motherboards mixing an SMC Ultra and an Adaptec AHA154x SCSI card (or compatible, @@ -848,7 +848,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -865,7 +865,7 @@ another SMC9192/9194 based chipset. Say Y if you want it compiled into the kernel, and read the file and the Ethernet-HOWTO, - available from . + available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -879,7 +879,7 @@ help If you have a network (Ethernet) card belonging to this class, such as the NI5010, NI5210 or NI6210, say Y and read the Ethernet-HOWTO, - available from . + available from . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -892,7 +892,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Note that this is still + . Note that this is still experimental code. This driver is also available as a module ( = code which can be @@ -907,7 +907,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -921,7 +921,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -937,7 +937,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -952,7 +952,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - as well as + as well as . If you want to compile this as a module ( = code which can be @@ -968,7 +968,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -984,7 +984,7 @@ bus system (that's the way the cards talks to the other components of your computer) is ISA (as opposed to EISA, VLB or PCI), say Y. Make sure you know the name of your card. Read the Ethernet-HOWTO, - available from . + available from . If unsure, say Y. @@ -999,7 +999,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1015,7 +1015,7 @@ cards. If this is for you, say Y and read in the kernel source as well as the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1029,7 +1029,7 @@ ---help--- If you have an EtherExpress16 network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . Note that the Intel + . Note that the Intel EtherExpress16 card used to be regarded as a very poor choice because the driver was very unreliable. We now have a new driver that should do better. @@ -1048,7 +1048,7 @@ driver supports intel i82595{FX,TX} based boards. Note however that the EtherExpress PRO/100 Ethernet card has its own separate driver. Please read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1062,7 +1062,7 @@ ---help--- If you have a Fujitsu FMV-181/182/183/184 network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . + . If you use an FMV-183 or FMV-184 and it is not working, you may need to disable Plug & Play mode of the card. @@ -1079,7 +1079,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1093,7 +1093,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1115,7 +1115,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1129,7 +1129,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Many Ethernet cards + . Many Ethernet cards without a specific driver are compatible with NE2000. If you have a PCI NE2000 card however, say N here and Y to "PCI @@ -1152,7 +1152,7 @@ (Ethernet) card, and this is the Linux driver for it. Note that the IBM Thinkpad 300 is compatible with the Z-Note and is also supported by this driver. Read the Ethernet-HOWTO, available from - . + . config SEEQ8005 tristate "SEEQ8005 support (EXPERIMENTAL)" @@ -1160,7 +1160,7 @@ help This is a driver for the SEEQ 8005 network (Ethernet) card. If this is for you, read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1174,7 +1174,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . config NET_CBUS bool "NEC PC-9800 C-bus cards" @@ -1248,7 +1248,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1278,7 +1278,7 @@ help This is another class of network cards which attach directly to the bus. If you have one of those, say Y and read the Ethernet-HOWTO, - available from . + available from . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -1292,7 +1292,7 @@ help If you have a PCnet32 or PCnetPCI based network (Ethernet) card, answer Y here and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1306,7 +1306,7 @@ help If you have an AMD 8111-based PCI lance ethernet card, answer Y here and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1346,7 +1346,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1360,7 +1360,7 @@ help If you have a network (Ethernet) controller of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1374,7 +1374,7 @@ help If you have a network (Ethernet) controller of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1389,7 +1389,7 @@ Support for CS89x0 chipset based Ethernet cards. If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - as well as + as well as . If you want to compile this as a module ( = code which can be @@ -1406,7 +1406,7 @@ PCI/EISA Ethernet switch cards. These include the SE-4 and the SE-6 models. If you have a network card of this type, say Y and read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . This driver is also available as a module ( = code which can be @@ -1421,7 +1421,7 @@ help If you have an Intel EtherExpress PRO/100 PCI network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1523,7 +1523,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1557,7 +1557,7 @@ with ISA NE2000 cards (they have their own driver, "NE2000/NE1000 support" below). If you have a PCI NE2000 network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . + . This driver also works for the following NE2000 clone cards: RealTek RTL-8029 Winbond 89C940 Compex RL2000 KTI ET32P2 @@ -1576,7 +1576,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Note that this driver + . Note that this driver will NOT WORK for NE3200 cards as they are completely different. This driver is also available as a module ( = code which can be @@ -1591,7 +1591,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1606,7 +1606,7 @@ This is a driver for the Fast Ethernet PCI network cards based on the RTL8139C+ chips. If you have one of those, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1621,7 +1621,7 @@ the RTL8139 chips. If you have one of those, say Y and read as well as the Ethernet-HOWTO, available from - . + . If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1675,7 +1675,7 @@ the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in SiS 630 and SiS 540 chipsets. If you have one of those, say Y and read the Ethernet-HOWTO, available at - . Please read + . Please read and comments at the beginning of for more information. @@ -1721,7 +1721,7 @@ If you have a PCI Ethernet network card based on the ThunderLAN chip which is supported by this driver, say Y and read the Ethernet-HOWTO, available from - . + . Devices currently supported by this driver are Compaq Netelligent, Compaq NetFlex and Olicom cards. Please read the file @@ -1777,7 +1777,7 @@ Cute little network (Ethernet) devices which attach to the parallel port ("pocket adapters"), commonly used with laptops. If you have one of those, say Y and read the Ethernet-HOWTO, available from - . + . If you want to plug a network (or some other) card into the PCMCIA (or PC-card) slot of your laptop instead (PCMCIA is the standard for @@ -1799,7 +1799,7 @@ ---help--- This is a network (Ethernet) device which attaches to your parallel port. Read as well as the Ethernet-HOWTO, - available from , if you + available from , if you want to use this. If you intend to use this driver, you should have said N to the "Parallel printer support", because the two drivers don't like each other. @@ -1816,7 +1816,7 @@ This is a network (Ethernet) device which attaches to your parallel port. Read as well as the Ethernet-HOWTO, available from - , if you want to use + , if you want to use this. It is possible to have several devices share a single parallel port and it is safe to compile the corresponding drivers into the kernel. @@ -1834,7 +1834,7 @@ This is a network (Ethernet) device which attaches to your parallel port. Read as well as the Ethernet-HOWTO, available from - , if you want to use + , if you want to use this. It is possible to have several devices share a single parallel port and it is safe to compile the corresponding drivers into the kernel. @@ -2010,7 +2010,7 @@ help If you have a Gigabit Ethernet card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -2201,7 +2201,7 @@ If you want to use PLIP, say Y and read the PLIP mini-HOWTO as well as the NET-3-HOWTO, both available from - . Note that the PLIP + . Note that the PLIP protocol has been changed and this PLIP driver won't work together with the PLIP support in Linux versions 1.0.x. This option enlarges your kernel by about 8 KB. @@ -2225,7 +2225,7 @@ To use PPP, you need an additional program called pppd as described in the PPP-HOWTO, available at - . Make sure that you have + . Make sure that you have the version of pppd recommended in . The PPP option enlarges your kernel by about 16 KB. @@ -2377,7 +2377,7 @@ allows you to use SLIP over a regular dial up shell connection. If you plan to use SLiRP, make sure to say Y to CSLIP, below. The NET-3-HOWTO, available from - , explains how to + , explains how to configure SLIP. Note that you don't need this option if you just want to run term (term is a program which gives you almost full Internet connectivity if you have a regular dial up shell account on @@ -2403,7 +2403,7 @@ ) which allows you to use SLIP over a regular dial up shell connection, you definitely want to say Y here. The NET-3-HOWTO, available from - , explains how to configure + , explains how to configure CSLIP. This won't enlarge your kernel. config SLIP_SMART diff -Nru a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c --- a/drivers/net/amd8111e.c Wed Feb 12 22:25:17 2003 +++ b/drivers/net/amd8111e.c Sun Apr 20 22:41:09 2003 @@ -780,16 +780,18 @@ /* This is device interrupt function. It handles transmit, receive and link change interrupts. */ -static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device * dev = (struct net_device *) dev_id; struct amd8111e_priv *lp = dev->priv; void * mmio = lp->mmio; unsigned int intr0; + int handled = 0; if(dev == NULL) - return; + return IRQ_NONE; spin_lock (&lp->lock); /* disabling interrupt */ @@ -802,7 +804,8 @@ if (!(intr0 & INTR)) goto err_no_interrupt; - + + handled = 1; /* Current driver processes 3 interrupts : RINT,TINT,LCINT */ writel(intr0, mmio + INT0); @@ -823,7 +826,7 @@ err_no_interrupt: writel( VAL0 | INTREN,mmio + CMD0); spin_unlock(&lp->lock); - return; + return IRQ_RETVAL(handled); } /* diff -Nru a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig --- a/drivers/net/arcnet/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/net/arcnet/Kconfig Sun Apr 20 12:56:51 2003 @@ -18,7 +18,7 @@ support" below. You might also want to have a look at the Ethernet-HOWTO, available - from (even though ARCnet + from (even though ARCnet is not really Ethernet). This driver is also available as a module ( = code which can be diff -Nru a/drivers/net/at1700.c b/drivers/net/at1700.c --- a/drivers/net/at1700.c Fri Mar 14 19:54:58 2003 +++ b/drivers/net/at1700.c Sun Apr 20 22:41:09 2003 @@ -202,7 +202,7 @@ static int read_eeprom(long ioaddr, int location); static int net_open(struct net_device *dev); static int net_send_packet(struct sk_buff *skb, struct net_device *dev); -static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void net_rx(struct net_device *dev); static int net_close(struct net_device *dev); static struct net_device_stats *net_get_stats(struct net_device *dev); @@ -696,16 +696,17 @@ /* The typical workload of the driver: Handle the network interface interrupts. */ -static void +static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct net_local *lp; int ioaddr, status; + int handled = 0; if (dev == NULL) { printk ("at1700_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } ioaddr = dev->base_addr; @@ -726,6 +727,7 @@ Tx interrupt. Thus we flag on rx_started, so that we prevent the interrupt routine (net_interrupt) to dive into net_rx again. */ + handled = 1; lp->rx_started = 1; outb(0x00, ioaddr + RX_INTR); /* Disable RX intr. */ net_rx(dev); @@ -733,6 +735,7 @@ lp->rx_started = 0; } if (status & 0x00ff) { + handled = 1; if (status & 0x02) { /* More than 16 collisions occurred */ if (net_debug > 4) @@ -760,7 +763,7 @@ } spin_unlock (&lp->lock); - return; + return IRQ_RETVAL(handled); } /* We have a good packet(s), get it/them out of the buffers. */ @@ -914,9 +917,11 @@ memset(mc_filter, 0, sizeof(mc_filter)); for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; - i++, mclist = mclist->next) - set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26, - mc_filter); + i++, mclist = mclist->next) { + unsigned int bit = + ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26; + mc_filter[bit >> 3] |= (1 << bit); + } outb(0x02, ioaddr + RX_MODE); /* Use normal mode. */ } diff -Nru a/drivers/net/atp.c b/drivers/net/atp.c --- a/drivers/net/atp.c Mon Feb 24 10:34:22 2003 +++ b/drivers/net/atp.c Sun Apr 20 23:39:11 2003 @@ -203,7 +203,7 @@ static void write_packet(long ioaddr, int length, unsigned char *packet, int pad, int mode); static void trigger_send(long ioaddr, int length); static int atp_send_packet(struct sk_buff *skb, struct net_device *dev); -static void atp_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t atp_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void net_rx(struct net_device *dev); static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode); static int net_close(struct net_device *dev); @@ -560,7 +560,7 @@ struct net_local *lp = (struct net_local *)dev->priv; long ioaddr = dev->base_addr; int length; - long flags; + unsigned long flags; length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; @@ -596,17 +596,19 @@ /* The typical workload of the driver: Handle the network interface interrupts. */ -static void atp_interrupt(int irq, void *dev_instance, struct pt_regs * regs) +static irqreturn_t +atp_interrupt(int irq, void *dev_instance, struct pt_regs * regs) { struct net_device *dev = (struct net_device *)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; + return IRQ_NONE; } ioaddr = dev->base_addr; lp = (struct net_local *)dev->priv; @@ -626,6 +628,7 @@ if (net_debug > 5) printk("loop status %02x..", status); if (status & (ISR_RxOK<<3)) { + handled = 1; write_reg(ioaddr, ISR, ISR_RxOK); /* Clear the Rx interrupt. */ do { int read_status = read_nibble(ioaddr, CMR1); @@ -648,6 +651,7 @@ break; } while (--boguscount > 0); } else if (status & ((ISR_TxErr + ISR_TxOK)<<3)) { + handled = 1; if (net_debug > 6) printk("handling Tx done.."); /* Clear the Tx interrupt. We should check for too many failures and reinitialize the adapter. */ @@ -712,7 +716,7 @@ spin_unlock(&lp->lock); if (net_debug > 5) printk("exiting interrupt.\n"); - return; + return IRQ_RETVAL(handled); } #ifdef TIMED_CHECKER diff -Nru a/drivers/net/b44.c b/drivers/net/b44.c --- a/drivers/net/b44.c Wed Nov 27 11:00:48 2002 +++ b/drivers/net/b44.c Sun Apr 20 22:09:47 2003 @@ -799,12 +799,13 @@ return (done ? 0 : 1); } -static void b44_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct b44 *bp = dev->priv; unsigned long flags; u32 istat, imask; + int handled = 0; spin_lock_irqsave(&bp->lock, flags); @@ -816,6 +817,7 @@ */ istat &= imask; if (istat) { + handled = 1; if (netif_rx_schedule_prep(dev)) { /* NOTE: These writes are posted by the readback of * the ISTAT register below. @@ -832,6 +834,7 @@ br32(B44_ISTAT); } spin_unlock_irqrestore(&bp->lock, flags); + return IRQ_RETVAL(handled); } static void b44_tx_timeout(struct net_device *dev) diff -Nru a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c --- a/drivers/net/cs89x0.c Tue Feb 25 02:08:40 2003 +++ b/drivers/net/cs89x0.c Sun Apr 20 22:09:47 2003 @@ -218,7 +218,7 @@ static int cs89x0_probe1(struct net_device *dev, int ioaddr); static int net_open(struct net_device *dev); static int net_send_packet(struct sk_buff *skb, struct net_device *dev); -static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void set_multicast_list(struct net_device *dev); static void net_timeout(struct net_device *dev); static void net_rx(struct net_device *dev); @@ -1401,12 +1401,13 @@ /* The typical workload of the driver: Handle the network interface interrupts. */ -static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; struct net_local *lp; int ioaddr, status; - + int handled = 0; + ioaddr = dev->base_addr; lp = (struct net_local *)dev->priv; @@ -1419,6 +1420,7 @@ vista, baby! */ while ((status = readword(dev, ISQ_PORT))) { if (net_debug > 4)printk("%s: event=%04x\n", dev->name, status); + handled = 1; switch(status & ISQ_EVENT_MASK) { case ISQ_RECEIVER_EVENT: /* Got a packet(s). */ @@ -1485,6 +1487,7 @@ break; } } + return IRQ_RETVAL(handled); } static void diff -Nru a/drivers/net/de600.c b/drivers/net/de600.c --- a/drivers/net/de600.c Fri Jan 10 12:04:48 2003 +++ b/drivers/net/de600.c Sun Apr 20 23:39:11 2003 @@ -258,7 +258,7 @@ * Handle the network interface interrupts. */ -static void de600_interrupt(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t de600_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; u8 irq_status; @@ -268,7 +268,7 @@ /* 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; + return IRQ_NONE; } spin_lock(&de600_lock); @@ -303,7 +303,7 @@ if (retrig) trigger_interrupt(dev); spin_unlock(&de600_lock); - return; + return IRQ_HANDLED; } static int de600_tx_intr(struct net_device *dev, int irq_status) diff -Nru a/drivers/net/de600.h b/drivers/net/de600.h --- a/drivers/net/de600.h Sun Oct 6 16:39:24 2002 +++ b/drivers/net/de600.h Sun Apr 20 23:39:11 2003 @@ -125,7 +125,7 @@ static int de600_start_xmit(struct sk_buff *skb, struct net_device *dev); /* Dispatch from interrupts. */ -static void de600_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t de600_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int de600_tx_intr(struct net_device *dev, int irq_status); static void de600_rx_intr(struct net_device *dev); diff -Nru a/drivers/net/de620.c b/drivers/net/de620.c --- a/drivers/net/de620.c Fri Jan 10 12:04:27 2003 +++ b/drivers/net/de620.c Sun Apr 20 23:39:11 2003 @@ -221,7 +221,7 @@ static int de620_start_xmit(struct sk_buff *, struct net_device *); /* Dispatch from interrupts. */ -static void de620_interrupt(int, void *, struct pt_regs *); +static irqreturn_t de620_interrupt(int, void *, struct pt_regs *); static int de620_rx_intr(struct net_device *); /* Initialization */ @@ -591,7 +591,8 @@ * Handle the network interface interrupts. * */ -static void de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs) +static irqreturn_t +de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; byte irq_status; @@ -617,6 +618,7 @@ netif_wake_queue(dev); spin_unlock(&de620_lock); + return IRQ_HANDLED; } /************************************** diff -Nru a/drivers/net/depca.c b/drivers/net/depca.c --- a/drivers/net/depca.c Fri Feb 14 11:37:27 2003 +++ b/drivers/net/depca.c Sun Apr 20 23:00:41 2003 @@ -430,7 +430,7 @@ */ static int depca_open(struct net_device *dev); static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void depca_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t depca_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int depca_close(struct net_device *dev); static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static void depca_tx_timeout(struct net_device *dev); @@ -894,7 +894,7 @@ /* ** The DEPCA interrupt handler. */ -static void depca_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t depca_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct depca_private *lp; @@ -903,7 +903,7 @@ if (dev == NULL) { printk("depca_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } lp = (struct depca_private *) dev->priv; @@ -938,6 +938,7 @@ outb(nicsr, DEPCA_NICSR); spin_unlock(&lp->lock); + return IRQ_HANDLED; } /* Called with lp->lock held */ diff -Nru a/drivers/net/dgrs.c b/drivers/net/dgrs.c --- a/drivers/net/dgrs.c Tue Mar 4 22:44:07 2003 +++ b/drivers/net/dgrs.c Sun Apr 20 21:26:41 2003 @@ -888,7 +888,7 @@ * dev, priv will always refer to the 0th device in Multi-NIC mode. */ -static void dgrs_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dgrs_intr(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev0 = (struct net_device *) dev_id; DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv; @@ -971,6 +971,8 @@ ack_intr: if (priv0->plxreg) OUTL(dev0->base_addr + PLX_LCL2PCI_DOORBELL, 1); + + return IRQ_HANDLED; } /* diff -Nru a/drivers/net/dl2k.c b/drivers/net/dl2k.c --- a/drivers/net/dl2k.c Wed Dec 11 05:42:59 2002 +++ b/drivers/net/dl2k.c Sun Apr 20 22:09:47 2003 @@ -98,7 +98,7 @@ static void rio_tx_timeout (struct net_device *dev); static void alloc_list (struct net_device *dev); static int start_xmit (struct sk_buff *skb, struct net_device *dev); -static void rio_interrupt (int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t rio_interrupt (int irq, void *dev_instance, struct pt_regs *regs); static void rio_free_tx (struct net_device *dev, int irq); static void tx_error (struct net_device *dev, int tx_status); static int receive_packet (struct net_device *dev); @@ -699,7 +699,7 @@ return 0; } -static void +static irqreturn_t rio_interrupt (int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; @@ -707,6 +707,7 @@ unsigned int_status; long ioaddr; int cnt = max_intrloop; + int handled = 0; ioaddr = dev->base_addr; np = dev->priv; @@ -716,6 +717,7 @@ int_status &= DEFAULT_INTR; if (int_status == 0 || --cnt < 0) break; + handled = 1; /* Processing received packets */ if (int_status & RxDMAComplete) receive_packet (dev); @@ -736,6 +738,7 @@ } if (np->cur_tx != np->old_tx) writel (100, ioaddr + CountDown); + return IRQ_RETVAL(handled); } static void @@ -744,7 +747,7 @@ struct netdev_private *np = (struct netdev_private *) dev->priv; int entry = np->old_tx % TX_RING_SIZE; int tx_use = 0; - long flag = 0; + unsigned long flag = 0; if (irq) spin_lock(&np->tx_lock); diff -Nru a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c --- a/drivers/net/e100/e100_main.c Mon Apr 7 00:03:41 2003 +++ b/drivers/net/e100/e100_main.c Sun Apr 20 14:14:29 2003 @@ -190,7 +190,7 @@ static int e100_set_mac(struct net_device *, void *); struct net_device_stats *e100_get_stats(struct net_device *); -static void e100intr(int, void *, struct pt_regs *); +static irqreturn_t e100intr(int, void *, struct pt_regs *); static void e100_print_brd_conf(struct e100_private *); static void e100_set_multi(struct net_device *); void e100_set_speed_duplex(struct e100_private *); @@ -1837,7 +1837,7 @@ * the RX & TX queues & starts the RU if it has stopped due * to no resources. */ -void +irqreturn_t e100intr(int irq, void *dev_inst, struct pt_regs *regs) { struct net_device *dev; @@ -1850,7 +1850,7 @@ intr_status = readw(&bdp->scb->scb_status); /* If not my interrupt, just return */ if (!(intr_status & SCB_STATUS_ACK_MASK) || (intr_status == 0xffff)) { - return; + return IRQ_NONE; } /* disable and ack intr */ @@ -1859,7 +1859,7 @@ /* the device is closed, don't continue or else bad things may happen. */ if (!netif_running(dev)) { e100_set_intr_mask(bdp); - return; + return IRQ_NONE; } /* SWI intr (triggered by watchdog) is signal to allocate new skb buffers */ @@ -1877,6 +1877,7 @@ e100_tx_srv(bdp); e100_set_intr_mask(bdp); + return IRQ_HANDLED; } /** diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c --- a/drivers/net/e1000/e1000_main.c Tue Apr 1 10:26:01 2003 +++ b/drivers/net/e1000/e1000_main.c Sun Apr 20 22:41:09 2003 @@ -154,7 +154,7 @@ static void e1000_update_stats(struct e1000_adapter *adapter); static inline void e1000_irq_disable(struct e1000_adapter *adapter); static inline void e1000_irq_enable(struct e1000_adapter *adapter); -static void e1000_intr(int irq, void *data, struct pt_regs *regs); +static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs); #ifdef CONFIG_E1000_NAPI static int e1000_clean(struct net_device *netdev, int *budget); static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter, @@ -1981,7 +1981,7 @@ * @pt_regs: CPU registers structure **/ -static void +static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs) { struct net_device *netdev = data; @@ -1992,7 +1992,7 @@ #endif if(!icr) - return; /* Not our interrupt */ + return IRQ_NONE; /* Not our interrupt */ if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { adapter->hw.get_link_status = 1; @@ -2016,6 +2016,7 @@ !e1000_clean_tx_irq(adapter)) break; #endif + return IRQ_HANDLED; } #ifdef CONFIG_E1000_NAPI diff -Nru a/drivers/net/eepro.c b/drivers/net/eepro.c --- a/drivers/net/eepro.c Fri Jan 10 12:05:04 2003 +++ b/drivers/net/eepro.c Sun Apr 20 23:39:11 2003 @@ -307,7 +307,7 @@ static int eepro_probe1(struct net_device *dev, short ioaddr); static int eepro_open(struct net_device *dev); static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev); -static void eepro_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t eepro_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void eepro_rx(struct net_device *dev); static void eepro_transmit_interrupt(struct net_device *dev); static int eepro_close(struct net_device *dev); @@ -1104,8 +1104,6 @@ /* enabling rx */ eepro_en_rx(ioaddr); - MOD_INC_USE_COUNT; - return 0; } @@ -1178,17 +1176,18 @@ /* The typical workload of the driver: Handle the network interface interrupts. */ -static void +static irqreturn_t eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = (struct net_device *)dev_id; /* (struct net_device *)(irq2dev_map[irq]);*/ 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; + return IRQ_NONE; } lp = (struct eepro_local *)dev->priv; @@ -1202,6 +1201,7 @@ while (((status = inb(ioaddr + STATUS_REG)) & (RX_INT|TX_INT)) && (boguscount--)) { + handled = 1; if (status & RX_INT) { if (net_debug > 4) printk(KERN_DEBUG "%s: packet received interrupt.\n", dev->name); @@ -1233,7 +1233,7 @@ printk(KERN_DEBUG "%s: exiting eepro_interrupt routine.\n", dev->name); spin_unlock(&lp->lock); - return; + return IRQ_RETVAL(handled); } static int eepro_close(struct net_device *dev) @@ -1274,8 +1274,6 @@ #endif /* Update the statistics here. What statistics? */ - - MOD_DEC_USE_COUNT; return 0; } diff -Nru a/drivers/net/eepro100.c b/drivers/net/eepro100.c --- a/drivers/net/eepro100.c Sat Mar 8 18:51:49 2003 +++ b/drivers/net/eepro100.c Sun Apr 20 21:26:41 2003 @@ -541,7 +541,7 @@ static void speedo_refill_rx_buffers(struct net_device *dev, int force); static int speedo_rx(struct net_device *dev); static void speedo_tx_buffer_gc(struct net_device *dev); -static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int speedo_close(struct net_device *dev); static struct net_device_stats *speedo_get_stats(struct net_device *dev); static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); @@ -1560,12 +1560,13 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_instance; struct speedo_private *sp; long ioaddr, boguscnt = max_interrupt_work; unsigned short status; + unsigned int handled = 0; ioaddr = dev->base_addr; sp = (struct speedo_private *)dev->priv; @@ -1576,7 +1577,7 @@ printk(KERN_ERR"%s: SMP simultaneous entry of an interrupt handler.\n", dev->name); sp->in_interrupt = 0; /* Avoid halting machine. */ - return; + return IRQ_NONE; } #endif @@ -1593,6 +1594,7 @@ if ((status & 0xfc00) == 0) break; + handled = 1; if ((status & 0x5000) || /* Packet received, or Rx error. */ @@ -1654,7 +1656,7 @@ dev->name, inw(ioaddr + SCBStatus)); clear_bit(0, (void*)&sp->in_interrupt); - return; + return IRQ_RETVAL(handled); } static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry) diff -Nru a/drivers/net/eexpress.c b/drivers/net/eexpress.c --- a/drivers/net/eexpress.c Fri Feb 14 11:36:46 2003 +++ b/drivers/net/eexpress.c Sun Apr 20 23:39:11 2003 @@ -252,7 +252,7 @@ static struct net_device_stats *eexp_stats(struct net_device *dev); static int eexp_xmit(struct sk_buff *buf, struct net_device *dev); -static void eexp_irq(int irq, void *dev_addr, struct pt_regs *regs); +static irqreturn_t eexp_irq(int irq, void *dev_addr, struct pt_regs *regs); static void eexp_set_multicast(struct net_device *dev); /* @@ -761,7 +761,7 @@ } } -static void eexp_irq(int irq, void *dev_info, struct pt_regs *regs) +static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) { struct net_device *dev = dev_info; struct net_local *lp; @@ -772,7 +772,7 @@ { printk(KERN_WARNING "eexpress: irq %d for unknown device\n", irq); - return; + return IRQ_NONE; } lp = (struct net_local *)dev->priv; @@ -860,7 +860,7 @@ outw(old_write_ptr, ioaddr+WRITE_PTR); spin_unlock(&lp->lock); - return; + return IRQ_HANDLED; } /* diff -Nru a/drivers/net/epic100.c b/drivers/net/epic100.c --- a/drivers/net/epic100.c Fri Jan 10 12:05:04 2003 +++ b/drivers/net/epic100.c Sun Apr 20 21:58:27 2003 @@ -360,7 +360,7 @@ static void epic_init_ring(struct net_device *dev); static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev); static int epic_rx(struct net_device *dev); -static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int epic_close(struct net_device *dev); static struct net_device_stats *epic_get_stats(struct net_device *dev); @@ -973,7 +973,7 @@ struct epic_private *ep = dev->priv; int entry, free_count; u32 ctrl_word; - long flags; + unsigned long flags; if (skb->len < ETH_ZLEN) { skb = skb_padto(skb, ETH_ZLEN); @@ -1028,12 +1028,13 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = dev_instance; struct epic_private *ep = dev->priv; long ioaddr = dev->base_addr; int status, boguscnt = max_interrupt_work; + unsigned int handled = 0; do { status = inl(ioaddr + INTSTAT); @@ -1047,6 +1048,7 @@ if ((status & IntrSummary) == 0) break; + handled = 1; if (status & (RxDone | RxStarted | RxEarlyWarn | RxOverflow)) epic_rx(dev); @@ -1156,7 +1158,7 @@ printk(KERN_DEBUG "%s: exiting interrupt, intr_status=%#4.4x.\n", dev->name, status); - return; + return IRQ_RETVAL(handled); } static int epic_rx(struct net_device *dev) @@ -1343,9 +1345,11 @@ memset(mc_filter, 0, sizeof(mc_filter)); for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; - i++, mclist = mclist->next) - set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f, - mc_filter); + i++, mclist = mclist->next) { + unsigned int bit_nr = + ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; + mc_filter[bit_nr >> 3] |= (1 << bit_nr); + } } /* ToDo: perhaps we need to stop the Tx and Rx process here? */ if (memcmp(mc_filter, ep->mc_filter, sizeof(mc_filter))) { diff -Nru a/drivers/net/fealnx.c b/drivers/net/fealnx.c --- a/drivers/net/fealnx.c Thu Feb 6 07:33:47 2003 +++ b/drivers/net/fealnx.c Sun Apr 20 21:58:27 2003 @@ -438,7 +438,7 @@ static void tx_timeout(struct net_device *dev); static void init_ring(struct net_device *dev); static int start_tx(struct sk_buff *skb, struct net_device *dev); -static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs); static int netdev_rx(struct net_device *dev); static void set_rx_mode(struct net_device *dev); static struct net_device_stats *get_stats(struct net_device *dev); @@ -1412,12 +1412,13 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = (struct net_device *) dev_instance; struct netdev_private *np = dev->priv; long ioaddr, boguscnt = max_interrupt_work; unsigned int num_tx = 0; + int handled = 0; writel(0, dev->base_addr + IMR); @@ -1437,6 +1438,8 @@ if (!(intr_status & np->imrvalue)) break; + handled = 1; + // 90/1/16 delete, // // if (intr_status & FBE) @@ -1559,7 +1562,7 @@ writel(np->imrvalue, ioaddr + IMR); - return; + return IRQ_RETVAL(handled); } @@ -1739,8 +1742,9 @@ memset(mc_filter, 0, sizeof(mc_filter)); for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next) { - set_bit((ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F, - mc_filter); + unsigned int bit; + bit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F; + mc_filter[bit >> 5] |= (1 << bit); } rx_mode = AB | AM; } diff -Nru a/drivers/net/hamachi.c b/drivers/net/hamachi.c --- a/drivers/net/hamachi.c Mon Feb 24 09:56:05 2003 +++ b/drivers/net/hamachi.c Sun Apr 20 22:09:47 2003 @@ -558,7 +558,7 @@ static void hamachi_tx_timeout(struct net_device *dev); static void hamachi_init_ring(struct net_device *dev); static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static inline int hamachi_rx(struct net_device *dev); static inline int hamachi_tx(struct net_device *dev); static void hamachi_error(struct net_device *dev, int intr_status); @@ -1367,16 +1367,17 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) +static irqreturn_t hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; struct hamachi_private *hmp; long ioaddr, boguscnt = max_interrupt_work; + int handled = 0; #ifndef final_version /* Can never occur. */ if (dev == NULL) { printk (KERN_ERR "hamachi_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } #endif @@ -1394,6 +1395,8 @@ if (intr_status == 0) break; + handled = 1; + if (intr_status & IntrRxDone) hamachi_rx(dev); @@ -1466,6 +1469,7 @@ #endif spin_unlock(&hmp->lock); + return IRQ_RETVAL(handled); } /* This routine is logically part of the interrupt handler, but separated diff -Nru a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig --- a/drivers/net/hamradio/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/net/hamradio/Kconfig Sun Apr 20 12:56:51 2003 @@ -60,7 +60,7 @@ Currently, this driver supports Ottawa PI/PI2, Paccomm/Gracilis PackeTwin, and S5SCC/DMA boards. They are detected automatically. If you have one of these cards, say Y here and read the AX25-HOWTO, - available from . + available from . This driver can operate multiple boards simultaneously. If you compile it as a module (by saying M instead of Y), it will be called @@ -88,7 +88,7 @@ in order to communicate with other computers. If you want to use this, read and the AX25-HOWTO, available from - . Also make sure to say Y + . Also make sure to say Y to "Amateur Radio AX.25 Level 2" support. If you want to compile this as a module ( = code which can be diff -Nru a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c --- a/drivers/net/hamradio/dmascc.c Mon Mar 31 15:55:38 2003 +++ b/drivers/net/hamradio/dmascc.c Mon Apr 21 02:16:43 2003 @@ -674,7 +674,7 @@ if (reg) outb_p(reg, priv->scc_cmd); return inb_p(priv->scc_cmd); default: - spin_lock_irqsave(&priv->register_lock, flags); + spin_lock_irqsave(priv->register_lock, flags); outb_p(0, priv->card_base + PI_DREQ_MASK); if (reg) outb_p(reg, priv->scc_cmd); rc = inb_p(priv->scc_cmd); diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c --- a/drivers/net/hp100.c Tue Feb 25 02:08:45 2003 +++ b/drivers/net/hp100.c Sun Apr 20 22:41:09 2003 @@ -320,7 +320,7 @@ static void hp100_update_stats(struct net_device *dev); static void hp100_clear_stats(struct hp100_private *lp, int ioaddr); static void hp100_set_multicast_list(struct net_device *dev); -static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void hp100_start_interface(struct net_device *dev); static void hp100_stop_interface(struct net_device *dev); static void hp100_load_eeprom(struct net_device *dev, u_short ioaddr); @@ -2271,7 +2271,7 @@ * hardware interrupt handling */ -static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_id; struct hp100_private *lp = (struct hp100_private *) dev->priv; @@ -2280,7 +2280,7 @@ u_int val; if (dev == NULL) - return; + return IRQ_NONE; ioaddr = dev->base_addr; spin_lock(&lp->lock); @@ -2302,7 +2302,7 @@ if (val == 0) { /* might be a shared interrupt */ spin_unlock(&lp->lock); hp100_ints_on(); - return; + return IRQ_NONE; } /* We're only interested in those interrupts we really enabled. */ /* val &= hp100_inw( IRQ_MASK ); */ @@ -2394,6 +2394,7 @@ spin_unlock(&lp->lock); hp100_ints_on(); + return IRQ_HANDLED; } /* diff -Nru a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c --- a/drivers/net/irda/donauboe.c Fri Jan 3 12:53:07 2003 +++ b/drivers/net/irda/donauboe.c Mon Apr 21 02:55:03 2003 @@ -1193,7 +1193,7 @@ } /*interrupt handler */ -STATIC void +STATIC irqreturn_t toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs) { struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; @@ -1201,13 +1201,13 @@ struct sk_buff *skb = NULL; if (self == NULL && toshoboe_invalid_dev(irq)) - return; + return IRQ_NONE; irqstat = INB (OBOE_ISR); /* was it us */ if (!(irqstat & OBOE_INT_MASK)) - return; + return IRQ_NONE; /* Ack all the interrupts */ OUTB (irqstat, OBOE_ISR); @@ -1381,6 +1381,7 @@ IRDA_DEBUG (1, "%s.sip:%x(%x)%x\n", __FUNCTION__ ,self->int_sip,irqstat,self->txpending); } + return IRQ_HANDLED; } STATIC int diff -Nru a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c --- a/drivers/net/irda/irport.c Sat Apr 19 13:09:27 2003 +++ b/drivers/net/irda/irport.c Mon Apr 21 02:53:21 2003 @@ -720,17 +720,18 @@ * * Interrupt handler */ -void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t irport_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_id; struct irport_cb *self; int boguscount = 0; int iobase; int iir, lsr; + int handled = 0; if (!dev) { WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq); - return; + return IRQ_NONE; } self = (struct irport_cb *) dev->priv; @@ -740,6 +741,8 @@ iir = inb(iobase+UART_IIR) & UART_IIR_ID; while (iir) { + handled = 1; + /* Clear interrupt */ lsr = inb(iobase+UART_LSR); @@ -771,6 +774,7 @@ iir = inb(iobase + UART_IIR) & UART_IIR_ID; } spin_unlock(&self->lock); + return IRQ_RETVAL(handled); } static int irport_net_init(struct net_device *dev) diff -Nru a/drivers/net/irda/smc-ircc.c b/drivers/net/irda/smc-ircc.c --- a/drivers/net/irda/smc-ircc.c Mon Jan 27 12:55:06 2003 +++ b/drivers/net/irda/smc-ircc.c Mon Apr 21 02:54:19 2003 @@ -86,7 +86,7 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev); static void ircc_dma_xmit(struct ircc_cb *self, int iobase, int bofs); static void ircc_change_speed(void *priv, u32 speed); -static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int ircc_net_open(struct net_device *dev); static int ircc_net_close(struct net_device *dev); static int ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data); @@ -979,7 +979,7 @@ * An interrupt from the chip has arrived. Time to do some work * */ -static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_id; struct irport_cb *irport; @@ -989,7 +989,7 @@ if (dev == NULL) { printk(KERN_WARNING "%s: irq %d for unknown device.\n", driver_name, irq); - return; + return IRQ_NONE; } irport = (struct irport_cb *) dev->priv; ASSERT(irport != NULL, return;); @@ -1000,7 +1000,7 @@ if (self->io->speed < 576000) { /* Will spinlock itself - Jean II */ irport_interrupt(irq, dev_id, regs); - return; + return IRQ_HANDLED; } iobase = self->io->fir_base; @@ -1028,6 +1028,7 @@ outb(IRCC_IER_ACTIVE_FRAME|IRCC_IER_EOM, iobase+IRCC_IER); spin_unlock(&self->irport->lock); + return IRQ_HANDLED; } #if 0 /* unused */ diff -Nru a/drivers/net/lance.c b/drivers/net/lance.c --- a/drivers/net/lance.c Fri Jan 10 12:05:04 2003 +++ b/drivers/net/lance.c Sun Apr 20 22:41:09 2003 @@ -278,7 +278,7 @@ static void lance_init_ring(struct net_device *dev, int mode); static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lance_rx(struct net_device *dev); -static void lance_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int lance_close(struct net_device *dev); static struct net_device_stats *lance_get_stats(struct net_device *dev); static void set_multicast_list(struct net_device *dev); @@ -945,7 +945,7 @@ } /* The LANCE interrupt handler. */ -static void +static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; @@ -955,7 +955,7 @@ if (dev == NULL) { printk ("lance_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } ioaddr = dev->base_addr; @@ -1066,6 +1066,7 @@ inw(dev->base_addr + LANCE_DATA)); spin_unlock (&lp->devlock); + return IRQ_HANDLED; } static int diff -Nru a/drivers/net/lp486e.c b/drivers/net/lp486e.c --- a/drivers/net/lp486e.c Mon Apr 7 11:14:53 2003 +++ b/drivers/net/lp486e.c Sun Apr 20 23:39:11 2003 @@ -377,7 +377,7 @@ static int i596_open(struct net_device *dev); static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void i596_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int i596_close(struct net_device *dev); static struct net_device_stats *i596_get_stats(struct net_device *dev); static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd); @@ -1160,7 +1160,7 @@ spin_unlock_irqrestore(&lp->cmd_lock, flags); } -static void +static irqreturn_t i596_interrupt (int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_instance; struct i596_private *lp; @@ -1229,7 +1229,7 @@ CA(); out: - return; + return IRQ_HANDLED; } static int i596_close(struct net_device *dev) { diff -Nru a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c --- a/drivers/net/myri_sbus.c Thu Jan 16 11:15:45 2003 +++ b/drivers/net/myri_sbus.c Mon Apr 21 00:01:24 2003 @@ -533,7 +533,7 @@ } } -static void myri_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t myri_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_id; struct myri_eth *mp = (struct myri_eth *) dev->priv; @@ -567,6 +567,8 @@ DIRQ(("\n")); spin_unlock_irqrestore(&mp->irq_lock, flags); + + return IRQ_HANDLED; } static int myri_open(struct net_device *dev) diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c --- a/drivers/net/natsemi.c Tue Feb 18 10:31:36 2003 +++ b/drivers/net/natsemi.c Sun Apr 20 21:58:27 2003 @@ -696,7 +696,7 @@ static void reinit_ring(struct net_device *dev); static void init_registers(struct net_device *dev); static int start_tx(struct sk_buff *skb, struct net_device *dev); -static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs); static void netdev_error(struct net_device *dev, int intr_status); static void netdev_rx(struct net_device *dev); static void netdev_tx_done(struct net_device *dev); @@ -1680,15 +1680,16 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; int boguscnt = max_interrupt_work; + unsigned int handled = 0; if (np->hands_off) - return; + return IRQ_NONE; do { /* Reading automatically acknowledges all int sources. */ u32 intr_status = readl(ioaddr + IntrStatus); @@ -1701,6 +1702,7 @@ if (intr_status == 0) break; + handled = 1; if (intr_status & (IntrRxDone | IntrRxIntr | RxStatusFIFOOver | @@ -1731,6 +1733,8 @@ if (netif_msg_intr(np)) printk(KERN_DEBUG "%s: exiting interrupt.\n", dev->name); + + return IRQ_RETVAL(handled); } /* This routine is logically part of the interrupt handler, but separated diff -Nru a/drivers/net/ni5010.c b/drivers/net/ni5010.c --- a/drivers/net/ni5010.c Fri Jan 10 12:05:11 2003 +++ b/drivers/net/ni5010.c Sun Apr 20 23:00:41 2003 @@ -104,7 +104,7 @@ static int ni5010_probe1(struct net_device *dev, int ioaddr); static int ni5010_open(struct net_device *dev); static int ni5010_send_packet(struct sk_buff *skb, struct net_device *dev); -static void ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void ni5010_rx(struct net_device *dev); static void ni5010_timeout(struct net_device *dev); static int ni5010_close(struct net_device *dev); @@ -451,7 +451,7 @@ * The typical workload of the driver: * Handle the network interface interrupts. */ -static void ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct ni5010_local *lp; @@ -479,7 +479,7 @@ if (!xmit_was_error) reset_receiver(dev); - return; + return IRQ_HANDLED; } diff -Nru a/drivers/net/ni52.c b/drivers/net/ni52.c --- a/drivers/net/ni52.c Fri Jan 10 12:05:11 2003 +++ b/drivers/net/ni52.c Sun Apr 20 23:00:41 2003 @@ -193,7 +193,7 @@ #define NI52_ADDR2 0x01 static int ni52_probe1(struct net_device *dev,int ioaddr); -static void ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr); +static irqreturn_t ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr); static int ni52_open(struct net_device *dev); static int ni52_close(struct net_device *dev); static int ni52_send_packet(struct sk_buff *,struct net_device *); @@ -821,7 +821,7 @@ * Interrupt Handler ... */ -static void ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr) +static irqreturn_t ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr) { struct net_device *dev = dev_id; unsigned short stat; @@ -830,7 +830,7 @@ if (!dev) { printk ("ni5210-interrupt: irq %d for unknown device.\n",irq); - return; + return IRQ_NONE; } p = (struct priv *) dev->priv; @@ -889,6 +889,7 @@ if(debuglevel > 1) printk("i"); + return IRQ_HANDLED; } /******************************************************* diff -Nru a/drivers/net/ni65.c b/drivers/net/ni65.c --- a/drivers/net/ni65.c Fri Jan 10 12:05:11 2003 +++ b/drivers/net/ni65.c Sun Apr 20 23:00:41 2003 @@ -248,7 +248,7 @@ }; static int ni65_probe1(struct net_device *dev,int); -static void ni65_interrupt(int irq, void * dev_id, struct pt_regs *regs); +static irqreturn_t ni65_interrupt(int irq, void * dev_id, struct pt_regs *regs); static void ni65_recv_intr(struct net_device *dev,int); static void ni65_xmit_intr(struct net_device *dev,int); static int ni65_open(struct net_device *dev); @@ -307,7 +307,6 @@ if(ni65_lance_reinit(dev)) { netif_start_queue(dev); - MOD_INC_USE_COUNT; return 0; } else @@ -341,7 +340,6 @@ } #endif free_irq(dev->irq,dev); - MOD_DEC_USE_COUNT; return 0; } @@ -512,7 +510,7 @@ } dev->base_addr = ioaddr; - + SET_MODULE_OWNER(dev); dev->open = ni65_open; dev->stop = ni65_close; dev->hard_start_xmit = ni65_send_packet; @@ -839,7 +837,7 @@ /* * interrupt handler */ -static void ni65_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t ni65_interrupt(int irq, void * dev_id, struct pt_regs * regs) { int csr0 = 0; struct net_device *dev = dev_id; @@ -940,7 +938,7 @@ else writedatareg(CSR0_INEA); - return; + return IRQ_HANDLED; } /* diff -Nru a/drivers/net/ns83820.c b/drivers/net/ns83820.c --- a/drivers/net/ns83820.c Thu Feb 13 23:40:57 2003 +++ b/drivers/net/ns83820.c Sun Apr 20 21:58:27 2003 @@ -549,7 +549,7 @@ static inline int rx_refill(struct ns83820 *dev, int gfp) { unsigned i; - long flags = 0; + unsigned long flags = 0; if (unlikely(nr_rx_empty(dev) <= 2)) return 0; @@ -763,7 +763,7 @@ static void ns83820_cleanup_rx(struct ns83820 *dev) { unsigned i; - long flags; + unsigned long flags; dprintk("ns83820_cleanup_rx(%p)\n", dev); @@ -820,7 +820,7 @@ struct rx_info *info = &dev->rx_info; unsigned next_rx; u32 cmdsts, *desc; - long flags; + unsigned long flags; int nr = 0; dprintk("rx_irq(%p)\n", dev); @@ -1234,7 +1234,7 @@ } static void ns83820_do_isr(struct ns83820 *dev, u32 isr); -static void ns83820_irq(int foo, void *data, struct pt_regs *regs) +static irqreturn_t ns83820_irq(int foo, void *data, struct pt_regs *regs) { struct ns83820 *dev = data; u32 isr; @@ -1245,6 +1245,7 @@ isr = readl(dev->base + ISR); dprintk("irq: %08x\n", isr); ns83820_do_isr(dev, isr); + return IRQ_HANDLED; } static void ns83820_do_isr(struct ns83820 *dev, u32 isr) @@ -1396,7 +1397,7 @@ { struct ns83820 *dev = (struct ns83820 *)_dev; u32 tx_done_idx, *desc; - long flags; + unsigned long flags; local_irq_save(flags); diff -Nru a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c --- a/drivers/net/pcmcia/3c574_cs.c Mon Apr 7 11:33:22 2003 +++ b/drivers/net/pcmcia/3c574_cs.c Sat Apr 19 23:19:00 2003 @@ -940,11 +940,9 @@ outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD); } - dev_kfree_skb (skb); pop_tx_status(dev); - - spin_unlock(&lp->window_lock); - + spin_unlock_irqrestore(&lp->window_lock, flags); + dev_kfree_skb(skb); return 0; } diff -Nru a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c --- a/drivers/net/pcmcia/3c589_cs.c Sun Feb 2 13:40:35 2003 +++ b/drivers/net/pcmcia/3c589_cs.c Sun Apr 20 23:39:11 2003 @@ -249,6 +249,7 @@ link->conf.Present = PRESENT_OPTION; /* The EL3-specific entries in the device structure. */ + SET_MODULE_OWNER(dev); dev->hard_start_xmit = &el3_start_xmit; dev->set_config = &el3_config; dev->get_stats = &el3_get_stats; @@ -740,7 +741,6 @@ return -ENODEV; link->open++; - MOD_INC_USE_COUNT; netif_start_queue(dev); tc589_reset(dev); @@ -1147,8 +1147,6 @@ del_timer_sync(&lp->media); if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - - MOD_DEC_USE_COUNT; return 0; } diff -Nru a/drivers/net/pcmcia/Kconfig b/drivers/net/pcmcia/Kconfig --- a/drivers/net/pcmcia/Kconfig Tue Feb 25 18:56:15 2003 +++ b/drivers/net/pcmcia/Kconfig Sun Apr 20 12:56:51 2003 @@ -17,7 +17,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). You also want to check out the PCMCIA-HOWTO, - available from . + available from . If unsure, say N. diff -Nru a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c --- a/drivers/net/pcmcia/axnet_cs.c Tue Feb 25 02:45:03 2003 +++ b/drivers/net/pcmcia/axnet_cs.c Sun Apr 20 23:39:11 2003 @@ -98,7 +98,7 @@ static int axnet_open(struct net_device *dev); static int axnet_close(struct net_device *dev); static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); static void ei_watchdog(u_long arg); static void axnet_reset_8390(struct net_device *dev); @@ -122,7 +122,7 @@ static void AX88190_init(struct net_device *dev, int startp); static int ax_open(struct net_device *dev); static int ax_close(struct net_device *dev); -static void ax_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ax_interrupt(int irq, void *dev_id, struct pt_regs *regs); /*====================================================================*/ @@ -687,7 +687,6 @@ return -ENODEV; link->open++; - MOD_INC_USE_COUNT; request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev); @@ -719,8 +718,6 @@ if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - MOD_DEC_USE_COUNT; - return 0; } /* axnet_close */ @@ -757,11 +754,11 @@ /*====================================================================*/ -static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs) { axnet_dev_t *info = dev_id; info->stale = 0; - ax_interrupt(irq, dev_id, regs); + return ax_interrupt(irq, dev_id, regs); } static void ei_watchdog(u_long arg) @@ -1345,17 +1342,18 @@ * needed. */ -static void ax_interrupt(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t ax_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; long e8390_base; int interrupts, nr_serviced = 0, i; struct ei_device *ei_local; - + int handled = 0; + if (dev == NULL) { printk ("net_interrupt(): irq %d for unknown device.\n", irq); - return; + return IRQ_NONE; } e8390_base = dev->base_addr; @@ -1378,7 +1376,7 @@ inb_p(e8390_base + EN0_IMR)); #endif spin_unlock(&ei_local->page_lock); - return; + return IRQ_NONE; } if (ei_debug > 3) @@ -1399,6 +1397,8 @@ interrupts = 0; break; } + handled = 1; + /* AX88190 bug fix. */ outb_p(interrupts, e8390_base + EN0_ISR); for (i = 0; i < 10; i++) { @@ -1430,6 +1430,7 @@ if (interrupts && ei_debug) { + handled = 1; if (nr_serviced >= MAX_SERVICE) { /* 0xFF is valid for a card removal */ @@ -1448,7 +1449,7 @@ outb_p(ENISR_ALL, e8390_base + EN0_IMR); spin_unlock(&ei_local->page_lock); - return; + return IRQ_RETVAL(handled); } /** @@ -1842,6 +1843,8 @@ if (ei_debug > 1) printk(version_8390); + SET_MODULE_OWNER(dev); + if (dev->priv == NULL) { struct ei_device *ei_local; diff -Nru a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c --- a/drivers/net/pcmcia/fmvj18x_cs.c Fri Jan 10 12:05:11 2003 +++ b/drivers/net/pcmcia/fmvj18x_cs.c Sun Apr 20 23:39:11 2003 @@ -314,6 +314,7 @@ link->conf.IntType = INT_MEMORY_AND_IO; /* The FMVJ18x specific entries in the device structure. */ + SET_MODULE_OWNER(dev); dev->hard_start_xmit = &fjn_start_xmit; dev->set_config = &fjn_config; dev->get_stats = &fjn_get_stats; @@ -1287,8 +1288,6 @@ lp->open_time = jiffies; netif_start_queue(dev); - MOD_INC_USE_COUNT; - return 0; } /* fjn_open */ @@ -1323,7 +1322,6 @@ link->open--; if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - MOD_DEC_USE_COUNT; return 0; } /* fjn_close */ @@ -1369,9 +1367,11 @@ memset(mc_filter, 0, sizeof(mc_filter)); for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; - i++, mclist = mclist->next) - set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f, - mc_filter); + i++, mclist = mclist->next) { + unsigned int bit = + ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; + mc_filter[bit >> 3] |= (1 << bit); + } } save_flags(flags); diff -Nru a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c --- a/drivers/net/pcmcia/nmclan_cs.c Sun Feb 2 13:40:35 2003 +++ b/drivers/net/pcmcia/nmclan_cs.c Sun Apr 20 23:39:11 2003 @@ -515,6 +515,7 @@ lp->tx_free_frames=AM2150_MAX_TX_FRAMES; + SET_MODULE_OWNER(dev); dev->hard_start_xmit = &mace_start_xmit; dev->set_config = &mace_config; dev->get_stats = &mace_get_stats; @@ -974,7 +975,6 @@ return -ENODEV; link->open++; - MOD_INC_USE_COUNT; MACEBANK(0); @@ -1003,8 +1003,6 @@ netif_stop_queue(dev); if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - - MOD_DEC_USE_COUNT; return 0; } /* mace_close */ diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c --- a/drivers/net/pcmcia/pcnet_cs.c Wed Mar 19 02:23:25 2003 +++ b/drivers/net/pcmcia/pcnet_cs.c Sun Apr 20 23:39:11 2003 @@ -117,7 +117,7 @@ static int pcnet_close(struct net_device *dev); static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int do_ioctl_light(struct net_device *dev, struct ifreq *rq, int cmd); -static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); static void ei_watchdog(u_long arg); static void pcnet_reset_8390(struct net_device *dev); static int set_config(struct net_device *dev, struct ifmap *map); @@ -315,6 +315,7 @@ link->conf.IntType = INT_MEMORY_AND_IO; ethdev_init(dev); + SET_MODULE_OWNER(dev); dev->init = &pcnet_init; dev->open = &pcnet_open; dev->stop = &pcnet_close; @@ -1030,7 +1031,6 @@ return -ENODEV; link->open++; - MOD_INC_USE_COUNT; set_misc_reg(dev); request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev); @@ -1064,8 +1064,6 @@ if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - MOD_DEC_USE_COUNT; - return 0; } /* pcnet_close */ @@ -1121,11 +1119,13 @@ /*====================================================================*/ -static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs) { pcnet_dev_t *info = dev_id; info->stale = 0; ei_interrupt(irq, dev_id, regs); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } static void ei_watchdog(u_long arg) diff -Nru a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c --- a/drivers/net/pcmcia/smc91c92_cs.c Mon Nov 25 08:14:08 2002 +++ b/drivers/net/pcmcia/smc91c92_cs.c Sun Apr 20 23:39:11 2003 @@ -376,6 +376,7 @@ link->conf.IntType = INT_MEMORY_AND_IO; /* The SMC91c92-specific entries in the device structure. */ + SET_MODULE_OWNER(dev); dev->hard_start_xmit = &smc_start_xmit; dev->get_stats = &smc_get_stats; dev->set_config = &s9k_config; @@ -1301,7 +1302,6 @@ return -ENODEV; } link->open++; - MOD_INC_USE_COUNT; netif_start_queue(dev); smc->saved_skb = 0; @@ -1346,8 +1346,6 @@ del_timer(&smc->media); if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - - MOD_DEC_USE_COUNT; return 0; } /* smc_close */ diff -Nru a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c --- a/drivers/net/pcmcia/xirc2ps_cs.c Tue Feb 11 05:51:13 2003 +++ b/drivers/net/pcmcia/xirc2ps_cs.c Sun Apr 20 23:39:12 2003 @@ -646,6 +646,7 @@ link->irq.Instance = dev; /* Fill in card specific entries */ + SET_MODULE_OWNER(dev); dev->hard_start_xmit = &do_start_xmit; dev->set_config = &do_config; dev->get_stats = &do_get_stats; @@ -1714,7 +1715,6 @@ /* okay */ link->open++; - MOD_INC_USE_COUNT; netif_start_queue(dev); do_reset(dev,1); @@ -2065,8 +2065,6 @@ link->open--; if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - - MOD_DEC_USE_COUNT; return 0; } diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c --- a/drivers/net/pcnet32.c Mon Mar 31 15:55:37 2003 +++ b/drivers/net/pcnet32.c Sun Apr 20 21:26:42 2003 @@ -331,7 +331,7 @@ static int pcnet32_start_xmit(struct sk_buff *, struct net_device *); static int pcnet32_rx(struct net_device *); static void pcnet32_tx_timeout (struct net_device *dev); -static void pcnet32_interrupt(int, void *, struct pt_regs *); +static irqreturn_t pcnet32_interrupt(int, void *, struct pt_regs *); static int pcnet32_close(struct net_device *); static struct net_device_stats *pcnet32_get_stats(struct net_device *); static void pcnet32_set_multicast_list(struct net_device *); @@ -717,6 +717,7 @@ spin_lock_init(&lp->lock); + SET_MODULE_OWNER(dev); dev->priv = lp; lp->name = chipname; lp->shared_irq = shared; @@ -945,8 +946,6 @@ lp->a.read_csr(ioaddr, 0)); - MOD_INC_USE_COUNT; - return 0; /* Always succeed */ } @@ -1148,7 +1147,7 @@ } /* The PCNET32 interrupt handler. */ -static void +static irqreturn_t pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; @@ -1161,7 +1160,7 @@ if (!dev) { printk (KERN_DEBUG "%s(): irq %d for unknown device\n", __FUNCTION__, irq); - return; + return IRQ_NONE; } ioaddr = dev->base_addr; @@ -1293,6 +1292,8 @@ dev->name, lp->a.read_csr (ioaddr, 0)); spin_unlock(&lp->lock); + + return IRQ_HANDLED; } static int @@ -1440,8 +1441,6 @@ lp->tx_dma_addr[i] = 0; } - MOD_DEC_USE_COUNT; - return 0; } diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c --- a/drivers/net/r8169.c Thu Mar 27 13:19:18 2003 +++ b/drivers/net/r8169.c Sun Apr 20 22:09:47 2003 @@ -295,7 +295,7 @@ static int rtl8169_open(struct net_device *dev); static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void rtl8169_interrupt(int irq, void *dev_instance, +static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static void rtl8169_init_ring(struct net_device *dev); static void rtl8169_hw_start(struct net_device *dev); @@ -958,7 +958,7 @@ } /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void +static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_instance; @@ -966,6 +966,7 @@ int boguscnt = max_interrupt_work; void *ioaddr = tp->mmio_addr; int status = 0; + int handled = 0; do { status = RTL_R16(IntrStatus); @@ -974,6 +975,7 @@ if (status == 0xFFFF) break; + handled = 1; /* if (status & RxUnderrun) link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; @@ -1006,6 +1008,7 @@ /* Clear all interrupt sources. */ RTL_W16(IntrStatus, 0xffff); } + return IRQ_RETVAL(handled); } static int diff -Nru a/drivers/net/rclanmtl.c b/drivers/net/rclanmtl.c --- a/drivers/net/rclanmtl.c Mon Feb 4 23:41:18 2002 +++ b/drivers/net/rclanmtl.c Sun Apr 20 21:26:42 2003 @@ -301,13 +301,13 @@ PPAB pPab; U32 pciBaseAddr = dev->base_addr; PDPA pDpa = dev->priv; - PU8 p_msgbuf = pDpa->PLanApiPA; - PU8 p_phymsgbuf = (PU8) virt_to_bus ((void *) p_msgbuf); + PU8 p_msgbuf = pDpa->msgbuf; + PU8 p_phymsgbuf = (PU8) pDpa->msgbuf_dma; dprintk - ("InitI2O: Adapter:0x%04ux ATU:0x%08ulx msgbuf:0x%08ulx phymsgbuf:0x%08ulx\n" + ("InitI2O: Adapter:0x%04ux ATU:0x%08ulx msgbuf:%p phymsgbuf:0x%08ulx\n" "TransmitCallbackFunction:0x%08ulx ReceiveCallbackFunction:0x%08ulx\n", - pDpa->id, pciBaseAddr, (u32) p_msgbuf, (u32) p_phymsgbuf, + pDpa->id, pciBaseAddr, p_msgbuf, (u32) p_phymsgbuf, (u32) TransmitCallbackFunction, (u32) ReceiveCallbackFunction); /* Check if this interface already initialized - if so, shut it down */ @@ -445,7 +445,7 @@ return RC_RTN_FREE_Q_EMPTY; } - /* calc virual address of msg - virual already mapped to physical */ + /* calc virtual address of msg - virtual already mapped to physical */ pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset); size = FillI2OMsgSGLFromTCB (pMsg + 4, pTransCtrlBlock); @@ -502,7 +502,7 @@ dprintk ("RCPostRecvBuffers(): Inbound Free Q empty!\n"); return RC_RTN_FREE_Q_EMPTY; } - /* calc virual address of msg - virual already mapped to physical */ + /* calc virtual address of msg - virtual already mapped to physical */ pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset); size = FillI2OMsgSGLFromTCB (pMsg + 4, pTransCtrlBlock); @@ -538,7 +538,7 @@ ** Process I2O outbound message queue until empty. ** ========================================================================= */ -void +irqreturn_t RCProcI2OMsgQ (struct net_device *dev) { U32 phyAddrMsg; @@ -549,7 +549,7 @@ unsigned char debug_msg[20]; if (pPab == NULL) - return; + return IRQ_NONE; phyAddrMsg = pPab->p_atu->OutQueue; @@ -642,6 +642,8 @@ /* any more msgs? */ phyAddrMsg = pPab->p_atu->OutQueue; } + + return IRQ_HANDLED; } /* @@ -677,7 +679,7 @@ return RC_RTN_FREE_Q_EMPTY; } - /* calc virual address of msg - virual already mapped to physical */ + /* calc virtual address of msg - virtual already mapped to physical */ pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset); /*dprintk("Get82558Stats - pMsg = 0x%08ulx, InQ msgOffset = 0x%08ulx\n", pMsg, msgOffset);*/ @@ -751,7 +753,7 @@ return RC_RTN_FREE_Q_EMPTY; } - /* calc virual address of msg - virual already mapped to physical */ + /* calc virtual address of msg - virtual already mapped to physical */ pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset); /*dprintk("Get82558LinkStatus - pMsg = 0x%08ulx, InQ msgOffset = 0x%08ulx\n", pMsg, msgOffset);*/ /*dprintk("Get82558LinkStatus - pMsg = 0x%08X, InQ msgOffset = 0x%08X\n", pMsg, msgOffset);*/ @@ -1452,7 +1454,7 @@ pMsg[7] = 0; pMsg[8] = 1; /* return 1 byte */ - /* virual pointer to return buffer - clear first two dwords */ + /* virtual pointer to return buffer - clear first two dwords */ p32 = (volatile PU32) pPab->pLinOutMsgBlock; p32[0] = 0; p32[1] = 0; @@ -1693,7 +1695,7 @@ return RC_RTN_FREE_Q_EMPTY; } - /* calc virual address of msg - virual already mapped to physical */ + /* calc virtual address of msg - virtual already mapped to physical */ pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset); dprintk @@ -1711,7 +1713,7 @@ /* phys address to return status - area right after PAB */ pMsg[7] = pPab->outMsgBlockPhyAddr; - /* virual pointer to return buffer - clear first two dwords */ + /* virtual pointer to return buffer - clear first two dwords */ p32 = (PU32) pPab->pLinOutMsgBlock; p32[0] = 0; @@ -1779,7 +1781,7 @@ return RC_RTN_FREE_Q_EMPTY; } - /* calc virual address of msg - virual already mapped to physical */ + /* calc virtual address of msg - virtual already mapped to physical */ pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset); pMsg[0] = NINE_WORD_MSG_SIZE | SGL_OFFSET_0; @@ -1793,7 +1795,7 @@ pMsg[7] = 0; pMsg[8] = 88; /* return 88 bytes */ - /* virual pointer to return buffer - clear first two dwords */ + /* virtual pointer to return buffer - clear first two dwords */ p32 = (volatile PU32) pPab->pLinOutMsgBlock; p32[0] = 0; p32[1] = 0; @@ -1862,7 +1864,7 @@ return RC_RTN_FREE_Q_EMPTY; } - /* calc virual address of msg - virual already mapped to physical */ + /* calc virtual address of msg - virtual already mapped to physical */ pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset); dprintk @@ -1885,7 +1887,7 @@ ** ========================================================================= ** FillI2OMsgFromTCB() ** -** inputs pMsgU32 - virual pointer (mapped to physical) of message frame +** inputs pMsgU32 - virtual pointer (mapped to physical) of message frame ** pXmitCntrlBlock - pointer to caller buffer control block. ** ** fills in LAN SGL after Transaction Control Word or Bucket Count. diff -Nru a/drivers/net/rclanmtl.h b/drivers/net/rclanmtl.h --- a/drivers/net/rclanmtl.h Mon Feb 4 23:41:18 2002 +++ b/drivers/net/rclanmtl.h Sun Apr 20 21:26:42 2003 @@ -182,6 +182,7 @@ U32 pci_addr; /* the pci address of the adapter */ U32 pci_addr_len; + struct pci_dev *pci_dev; struct timer_list timer; /* timer */ struct net_device_stats stats; /* the statistics structure */ unsigned long numOutRcvBuffers; /* number of outstanding receive buffers */ @@ -189,7 +190,7 @@ unsigned char reboot; unsigned char nexus; PU8 msgbuf; /* Pointer to Lan Api Private Area */ - PU8 PLanApiPA; /* Pointer to Lan Api Private Area (aligned) */ + dma_addr_t msgbuf_dma; PPAB pPab; /* Pointer to the PCI Adapter Block */ } *PDPA; @@ -421,7 +422,7 @@ ** callback functions, TransmitCallbackFunction or ReceiveCallbackFunction, ** if a TX or RX transaction has completed. */ -void RCProcI2OMsgQ (struct net_device *dev); +irqreturn_t RCProcI2OMsgQ (struct net_device *dev); /* ** Disable and Enable I2O interrupts. I2O interrupts are enabled at Init time diff -Nru a/drivers/net/rcpci45.c b/drivers/net/rcpci45.c --- a/drivers/net/rcpci45.c Mon Mar 31 15:55:37 2003 +++ b/drivers/net/rcpci45.c Sun Apr 20 21:26:42 2003 @@ -29,6 +29,8 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ** +** Francois Romieu, Apr 2003: Converted to pci DMA mapping API. +** ** Pete Popov, Oct 2001: Fixed a few bugs to make the driver functional ** again. Note that this card is not supported or manufactured by ** RedCreek anymore. @@ -47,8 +49,6 @@ ** ***************************************************************************/ -#error Please convert me to Documentation/DMA-mapping.txt - #include #include #include @@ -66,7 +66,7 @@ #include static char version[] __initdata = - "RedCreek Communications PCI linux driver version 2.20\n"; + "RedCreek Communications PCI linux driver version 2.21\n"; #define RC_LINUX_MODULE #include "rclanmtl.h" @@ -95,13 +95,19 @@ */ #define MSG_BUF_SIZE 16384 +/* 2003/04/20: I don't know about the hardware ability but the driver won't + * play safe with 64 bit addressing and DAC without NETIF_F_HIGHDMA doesn't + * really make sense anyway. Let's play safe - romieu. + */ +#define RCPCI45_DMA_MASK ((u64) 0xffffffff) + static U32 DriverControlWord; static void rc_timer (unsigned long); static int RCopen (struct net_device *); static int RC_xmit_packet (struct sk_buff *, struct net_device *); -static void RCinterrupt (int, void *, struct pt_regs *); +static irqreturn_t RCinterrupt (int, void *, struct pt_regs *); static int RCclose (struct net_device *dev); static struct net_device_stats *RCget_stats (struct net_device *); static int RCioctl (struct net_device *, struct ifreq *, int); @@ -136,8 +142,8 @@ free_irq (dev->irq, dev); iounmap ((void *) dev->base_addr); pci_release_regions (pdev); - if (pDpa->msgbuf) - kfree (pDpa->msgbuf); + pci_free_consistent (pdev, MSG_BUF_SIZE, pDpa->msgbuf, + pDpa->msgbuf_dma); if (pDpa->pPab) kfree (pDpa->pPab); kfree (dev); @@ -172,6 +178,7 @@ error = -ENOMEM; goto err_out; } + SET_MODULE_OWNER(dev); error = pci_enable_device (pdev); if (error) { @@ -180,7 +187,6 @@ card_idx); goto err_out; } - error = -ENOMEM; pci_start = pci_resource_start (pdev, 0); pci_len = pci_resource_len (pdev, 0); printk("pci_start %lx pci_len %lx\n", pci_start, pci_len); @@ -189,6 +195,7 @@ pDpa = dev->priv; pDpa->id = card_idx; + pDpa->pci_dev = pdev; pDpa->pci_addr = pci_start; if (!pci_start || !(pci_resource_flags (pdev, 0) & IORESOURCE_MEM)) { @@ -200,24 +207,21 @@ /* * pDpa->msgbuf is where the card will dma the I2O - * messages. Thus, we need contiguous physical pages of - * memory. - */ - pDpa->msgbuf = kmalloc (MSG_BUF_SIZE, GFP_DMA | GFP_KERNEL); + * messages. Thus, we need contiguous physical pages of memory. + * 2003/04/20: pci_alloc_consistent() provides well over the needed + * alignment on a 256 bytes boundary for the LAN API private area. + * Thus it isn't needed anymore to align it by hand. + */ + pDpa->msgbuf = pci_alloc_consistent (pdev, MSG_BUF_SIZE, + &pDpa->msgbuf_dma); if (!pDpa->msgbuf) { printk (KERN_ERR "(rcpci45 driver:) \ Could not allocate %d byte memory for the \ private msgbuf!\n", MSG_BUF_SIZE); + error = -ENOMEM; goto err_out_free_dev; } - /* - * Save the starting address of the LAN API private area. We'll - * pass that to RCInitI2OMsgLayer(). - * - */ - pDpa->PLanApiPA = (void *) (((long) pDpa->msgbuf + 0xff) & ~0xff); - /* The adapter is accessible through memory-access read/write, not * I/O read/write. Thus, we need to map it to some virtual address * area in order to access the registers as normal memory. @@ -226,12 +230,20 @@ if (error) goto err_out_free_msgbuf; + error = pci_set_dma_mask (pdev, RCPCI45_DMA_MASK); + if (error) { + printk (KERN_ERR + "(rcpci45 driver:) pci_set_dma_mask failed!\n"); + goto err_out_free_region; + } + vaddr = (ulong *) ioremap (pci_start, pci_len); if (!vaddr) { printk (KERN_ERR "(rcpci45 driver:) \ Unable to remap address range from %lu to %lu\n", pci_start, pci_start + pci_len); + error = -EIO; goto err_out_free_region; } @@ -249,13 +261,14 @@ err_out_free_region: pci_release_regions (pdev); err_out_free_msgbuf: - kfree (pDpa->msgbuf); + pci_free_consistent (pdev, MSG_BUF_SIZE, pDpa->msgbuf, + pDpa->msgbuf_dma); err_out_free_dev: unregister_netdev (dev); kfree (dev); err_out: card_idx--; - return -ENODEV; + return error; } static struct pci_driver rcpci45_driver = { @@ -283,7 +296,6 @@ int requested = 0; int error; - MOD_INC_USE_COUNT; if (pDpa->nexus) { /* This is not the first time RCopen is called. Thus, * the interface was previously opened and later closed @@ -365,7 +377,6 @@ err_out_free_irq: free_irq (dev->irq, dev); err_out: - MOD_DEC_USE_COUNT; return error; } @@ -402,7 +413,8 @@ ptcb->b.context = (U32) skb; ptcb->b.scount = 1; ptcb->b.size = skb->len; - ptcb->b.addr = virt_to_bus ((void *) skb->data); + ptcb->b.addr = pci_map_single(pDpa->pci_dev, skb->data, skb->len, + PCI_DMA_TODEVICE); if ((status = RCI2OSendPacket (dev, (U32) NULL, (PRCTCB) ptcb)) != RC_RTN_NO_ERROR) { @@ -451,6 +463,8 @@ while (PcktCount--) { skb = (struct sk_buff *) (BufferContext[0]); BufferContext++; + pci_unmap_single(pDpa->pci_dev, BufferContext[1], skb->len, + PCI_DMA_TODEVICE); dev_kfree_skb_irq (skb); } netif_wake_queue (dev); @@ -621,7 +635,7 @@ * RCProcI2OMsgQ(), which in turn process the message and * calls one of our callback functions. */ -static void +static irqreturn_t RCinterrupt (int irq, void *dev_id, struct pt_regs *regs) { @@ -634,7 +648,7 @@ printk (KERN_DEBUG "%s: shutdown, service irq\n", dev->name); - RCProcI2OMsgQ (dev); + return RCProcI2OMsgQ (dev); } #define REBOOT_REINIT_RETRY_LIMIT 4 @@ -706,6 +720,7 @@ RCDisableI2OInterrupts (dev); dev->flags &= ~IFF_UP; MOD_DEC_USE_COUNT; + /* FIXME: kill MOD_DEC_USE_COUNT, use dev_put */ } else { printk (KERN_INFO "%s: rescheduling timer...\n", dev->name); @@ -731,7 +746,6 @@ printk (KERN_INFO "%s skipping reset -- adapter already in reboot mode\n", dev->name); dev->flags &= ~IFF_UP; pDpa->shutdown = 1; - MOD_DEC_USE_COUNT; return 0; } @@ -749,7 +763,6 @@ (PFNCALLBACK) RCreset_callback); dev->flags &= ~IFF_UP; - MOD_DEC_USE_COUNT; return 0; } @@ -984,8 +997,9 @@ PU32 p; psingleB pB; struct sk_buff *skb; + PDPA pDpa = dev->priv; RC_RETURN status; - U32 res; + U32 res = 0; if (!numBuffers) return 0; @@ -1001,7 +1015,7 @@ if (!p) { printk (KERN_WARNING "%s unable to allocate TCB\n", dev->name); - return 0; + goto out; } p[0] = 0; /* Buffer Count */ @@ -1013,18 +1027,14 @@ printk (KERN_WARNING "%s: unable to allocate enough skbs!\n", dev->name); - if (*p != 0) { /* did we allocate any buffers */ - break; - } else { - kfree (p); /* Free the TCB */ - return 0; - } + goto err_out_unmap; } skb_reserve (skb, 2); /* Align IP on 16 byte boundaries */ pB->context = (U32) skb; pB->scount = 1; /* segment count */ pB->size = MAX_ETHER_SIZE; - pB->addr = virt_to_bus ((void *) skb->data); + pB->addr = pci_map_single(pDpa->pci_dev, skb->data, + MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE); p[0]++; pB++; } @@ -1032,16 +1042,21 @@ if ((status = RCPostRecvBuffers (dev, (PRCTCB) p)) != RC_RTN_NO_ERROR) { printk (KERN_WARNING "%s: Post buffer failed, error 0x%x\n", dev->name, status); - /* point to the first buffer */ - pB = (psingleB) ((U32) p + sizeof (U32)); - while (p[0]) { - skb = (struct sk_buff *) pB->context; - dev_kfree_skb (skb); - p[0]--; - pB++; - } + goto err_out_unmap; } +out_free: res = p[0]; kfree (p); +out: return (res); /* return the number of posted buffers */ + +err_out_unmap: + for (; p[0] > 0; p[0]--) { + --pB; + skb = (struct sk_buff *) pB->context; + pci_unmap_single(pDpa->pci_dev, pB->addr, MAX_ETHER_SIZE, + PCI_DMA_FROMDEVICE); + dev_kfree_skb (skb); + } + goto out_free; } diff -Nru a/drivers/net/sis900.c b/drivers/net/sis900.c --- a/drivers/net/sis900.c Tue Mar 4 22:44:07 2003 +++ b/drivers/net/sis900.c Sun Apr 20 21:26:42 2003 @@ -195,11 +195,11 @@ static int sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev); static int sis900_rx(struct net_device *net_dev); static void sis900_finish_xmit (struct net_device *net_dev); -static void sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int sis900_close(struct net_device *net_dev); static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd); static struct net_device_stats *sis900_get_stats(struct net_device *net_dev); -static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision); +static u16 sis900_mcast_bitnr(u8 *addr, u8 revision); static void set_rx_mode(struct net_device *net_dev); static void sis900_reset(struct net_device *net_dev); static void sis630_set_eq(struct net_device *net_dev, u8 revision); @@ -1534,13 +1534,14 @@ * and cleans up after the Tx thread */ -static void sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *net_dev = dev_instance; struct sis900_private *sis_priv = net_dev->priv; int boguscnt = max_interrupt_work; long ioaddr = net_dev->base_addr; u32 status; + unsigned int handled = 0; spin_lock (&sis_priv->lock); @@ -1550,6 +1551,7 @@ if ((status & (HIBERR|TxURN|TxERR|TxIDLE|RxORN|RxERR|RxOK)) == 0) /* nothing intresting happened */ break; + handled = 1; /* why dow't we break after Tx/Rx case ?? keyword: full-duplex */ if (status & (RxORN | RxERR | RxOK)) @@ -1580,7 +1582,7 @@ net_dev->name, inl(ioaddr + isr)); spin_unlock (&sis_priv->lock); - return; + return IRQ_RETVAL(handled); } /** @@ -2031,7 +2033,7 @@ } /** - * sis900_compute_hashtable_index: - compute hashtable index + * sis900_mcast_bitnr: - compute hashtable index * @addr: multicast address * @revision: revision id of chip * @@ -2041,7 +2043,7 @@ * multicast hash table. */ -static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision) +static inline u16 sis900_mcast_bitnr(u8 *addr, u8 revision) { u32 crc = ether_crc(6, addr); @@ -2095,9 +2097,11 @@ struct dev_mc_list *mclist; rx_mode = RFAAB; for (i = 0, mclist = net_dev->mc_list; mclist && i < net_dev->mc_count; - i++, mclist = mclist->next) - set_bit(sis900_compute_hashtable_index(mclist->dmi_addr, revision), - mc_filter); + i++, mclist = mclist->next) { + unsigned int bit_nr = + sis900_mcast_bitnr(mclist->dmi_addr, revision); + mc_filter[bit_nr >> 4] |= (1 << bit_nr); + } } /* update Multicast Hash Table in Receive Filter */ diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c --- a/drivers/net/sk98lin/skge.c Sun Mar 2 23:26:07 2003 +++ b/drivers/net/sk98lin/skge.c Sun Apr 20 23:39:12 2003 @@ -322,8 +322,8 @@ static void SetupRing(SK_AC*, void*, uintptr_t, RXD**, RXD**, RXD**, int*, SK_BOOL); -static void SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs); -static void SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs); +static irqreturn_t SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs); +static irqreturn_t SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs); static int SkGeOpen(struct net_device *dev); static int SkGeClose(struct net_device *dev); static int SkGeXmit(struct sk_buff *skb, struct net_device *dev); @@ -470,6 +470,7 @@ pNet->Up = 0; dev->irq = pdev->irq; + SET_MODULE_OWNER(dev); dev->open = &SkGeOpen; dev->stop = &SkGeClose; dev->hard_start_xmit = &SkGeXmit; @@ -1236,7 +1237,7 @@ * Returns: N/A * */ -static void SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs) +static irqreturn_t SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs) { struct net_device *dev = (struct net_device *)dev_id; @@ -1252,7 +1253,7 @@ */ SK_IN32(pAC->IoBase, B0_SP_ISRC, &IntSrc); if (IntSrc == 0) { - return; + return IRQ_NONE; } while (((IntSrc & IRQ_MASK) & ~SPECIAL_IRQS) != 0) { @@ -1380,7 +1381,7 @@ /* IRQ is processed - Enable IRQs again*/ SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK); - return; + return IRQ_HANDLED; } /* SkGeIsr */ @@ -1397,7 +1398,7 @@ * Returns: N/A * */ -static void SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs) +static irqreturn_t SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs) { struct net_device *dev = (struct net_device *)dev_id; DEV_NET *pNet; @@ -1412,7 +1413,7 @@ */ SK_IN32(pAC->IoBase, B0_SP_ISRC, &IntSrc); if (IntSrc == 0) { - return; + return IRQ_NONE; } while (((IntSrc & IRQ_MASK) & ~SPECIAL_IRQS) != 0) { @@ -1498,7 +1499,7 @@ /* IRQ is processed - Enable IRQs again*/ SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK); - return; + return IRQ_HANDLED; } /* SkGeIsrOnePort */ @@ -1604,8 +1605,6 @@ pAC->MaxPorts++; pNet->Up = 1; - MOD_INC_USE_COUNT; - SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, ("SkGeOpen suceeded\n")); @@ -1705,7 +1704,6 @@ pAC->MaxPorts--; pNet->Up = 0; - MOD_DEC_USE_COUNT; return (0); } /* SkGeClose */ diff -Nru a/drivers/net/smc9194.c b/drivers/net/smc9194.c --- a/drivers/net/smc9194.c Thu Jan 16 11:15:45 2003 +++ b/drivers/net/smc9194.c Sun Apr 20 22:41:09 2003 @@ -234,7 +234,7 @@ /* . Handles the actual interrupt */ -static void smc_interrupt(int irq, void *, struct pt_regs *regs); +static irqreturn_t smc_interrupt(int irq, void *, struct pt_regs *regs); /* . This is a separate procedure to handle the receipt of a packet, to . leave the interrupt code looking slightly cleaner @@ -1133,7 +1133,7 @@ . ---------------------------------------------------------------------*/ -static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t smc_interrupt(int irq, void * dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; int ioaddr = dev->base_addr; @@ -1146,7 +1146,7 @@ /* state registers */ word saved_bank; word saved_pointer; - + int handled = 0; PRINTK3((CARDNAME": SMC interrupt started \n")); @@ -1171,6 +1171,8 @@ if (!status ) break; + handled = 1; + PRINTK3((KERN_WARNING CARDNAME ": Handling interrupt status %x \n", status )); @@ -1242,7 +1244,7 @@ SMC_SELECT_BANK( saved_bank ); PRINTK3((CARDNAME ": Interrupt done\n")); - return; + return IRQ_RETVAL(handled); } /*------------------------------------------------------------- diff -Nru a/drivers/net/starfire.c b/drivers/net/starfire.c --- a/drivers/net/starfire.c Fri Feb 14 11:34:00 2003 +++ b/drivers/net/starfire.c Sun Apr 20 21:58:27 2003 @@ -789,7 +789,7 @@ static void tx_timeout(struct net_device *dev); static void init_ring(struct net_device *dev); static int start_tx(struct sk_buff *skb, struct net_device *dev); -static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs); static void netdev_error(struct net_device *dev, int intr_status); static int __netdev_rx(struct net_device *dev, int *quota); static void refill_rx_ring(struct net_device *dev); @@ -1491,7 +1491,7 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; struct netdev_private *np; @@ -1499,6 +1499,7 @@ int boguscnt = max_interrupt_work; int consumer; int tx_status; + int handled = 0; ioaddr = dev->base_addr; np = dev->priv; @@ -1513,6 +1514,8 @@ if (intr_status == 0 || intr_status == (u32) -1) break; + handled = 1; + if (intr_status & (IntrRxDone | IntrRxEmpty)) netdev_rx(dev, ioaddr); @@ -1591,6 +1594,7 @@ if (debug > 4) printk(KERN_DEBUG "%s: exiting interrupt, status=%#8.8x.\n", dev->name, (int) readl(ioaddr + IntrStatus)); + return IRQ_RETVAL(handled); } diff -Nru a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c --- a/drivers/net/sunbmac.c Thu Feb 13 22:25:30 2003 +++ b/drivers/net/sunbmac.c Mon Apr 21 00:00:25 2003 @@ -874,7 +874,7 @@ printk(KERN_NOTICE "%s: Memory squeeze, deferring packet.\n", bp->dev->name); } -static void bigmac_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t bigmac_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct bigmac *bp = (struct bigmac *) dev_id; u32 qec_status, bmac_status; @@ -895,6 +895,8 @@ if (bmac_status & CREG_STAT_RXIRQ) bigmac_rx(bp); + + return IRQ_HANDLED; } static int bigmac_open(struct net_device *dev) diff -Nru a/drivers/net/sundance.c b/drivers/net/sundance.c --- a/drivers/net/sundance.c Thu Jan 16 11:15:45 2003 +++ b/drivers/net/sundance.c Sun Apr 20 21:58:27 2003 @@ -495,7 +495,7 @@ static void init_ring(struct net_device *dev); static int start_tx(struct sk_buff *skb, struct net_device *dev); static int reset_tx (struct net_device *dev); -static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs); static void rx_poll(unsigned long data); static void tx_poll(unsigned long data); static void refill_rx (struct net_device *dev); @@ -951,7 +951,7 @@ { struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; - long flag; + unsigned long flag; netif_stop_queue(dev); tasklet_disable(&np->tx_tasklet); @@ -1152,7 +1152,7 @@ /* The interrupt handler cleans up after the Tx thread, and schedule a Rx thread work */ -static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = (struct net_device *)dev_instance; struct netdev_private *np; @@ -1161,6 +1161,7 @@ int hw_frame_id; int tx_cnt; int tx_status; + int handled = 0; ioaddr = dev->base_addr; np = dev->priv; @@ -1176,6 +1177,8 @@ if (!(intr_status & DEFAULT_INTR)) break; + handled = 1; + if (intr_status & (IntrRxDMADone)) { writew(DEFAULT_INTR & ~(IntrRxDone|IntrRxDMADone), ioaddr + IntrEnable); @@ -1284,7 +1287,7 @@ printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n", dev->name, readw(ioaddr + IntrStatus)); writel(5000, ioaddr + DownCounter); - + return IRQ_RETVAL(handled); } static void rx_poll(unsigned long data) diff -Nru a/drivers/net/sungem.c b/drivers/net/sungem.c --- a/drivers/net/sungem.c Mon Apr 7 00:03:41 2003 +++ b/drivers/net/sungem.c Mon Apr 21 00:00:25 2003 @@ -773,7 +773,7 @@ gp->dev->name); } -static void gem_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t gem_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct gem *gp = dev->priv; @@ -792,6 +792,8 @@ out: spin_unlock(&gp->lock); + + return IRQ_HANDLED; } static void gem_tx_timeout(struct net_device *dev) diff -Nru a/drivers/net/sunhme.c b/drivers/net/sunhme.c --- a/drivers/net/sunhme.c Mon Apr 7 00:03:41 2003 +++ b/drivers/net/sunhme.c Mon Apr 21 00:00:25 2003 @@ -2101,7 +2101,7 @@ RXD((">")); } -static void happy_meal_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t happy_meal_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_id; struct happy_meal *hp = dev->priv; @@ -2135,10 +2135,12 @@ HMD(("done\n")); out: spin_unlock(&hp->happy_lock); + + return IRQ_HANDLED; } #ifdef CONFIG_SBUS -static void quattro_sbus_interrupt(int irq, void *cookie, struct pt_regs *ptregs) +static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie, struct pt_regs *ptregs) { struct quattro *qp = (struct quattro *) cookie; int i; @@ -2183,6 +2185,8 @@ spin_unlock(&hp->happy_lock); } HMD(("done\n")); + + return IRQ_HANDLED; } #endif diff -Nru a/drivers/net/sunlance.c b/drivers/net/sunlance.c --- a/drivers/net/sunlance.c Tue Feb 25 09:56:42 2003 +++ b/drivers/net/sunlance.c Mon Apr 21 00:00:25 2003 @@ -812,7 +812,7 @@ spin_unlock(&lp->lock); } -static void lance_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; struct lance_private *lp = (struct lance_private *)dev->priv; @@ -871,6 +871,8 @@ } sbus_writew(LE_C0_INEA, lp->lregs + RDP); + + return IRQ_HANDLED; } /* Build a fake network packet and send it to ourselves. */ diff -Nru a/drivers/net/sunqe.c b/drivers/net/sunqe.c --- a/drivers/net/sunqe.c Thu Feb 13 22:14:03 2003 +++ b/drivers/net/sunqe.c Mon Apr 21 00:00:25 2003 @@ -456,7 +456,7 @@ * so we just run through each qe and check to see who is signaling * and thus needs to be serviced. */ -static void qec_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t qec_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct sunqec *qecp = (struct sunqec *) dev_id; u32 qec_status; @@ -495,6 +495,8 @@ qec_status >>= 4; channel++; } + + return IRQ_HANDLED; } static int qe_open(struct net_device *dev) diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c --- a/drivers/net/tg3.c Mon Apr 7 00:03:41 2003 +++ b/drivers/net/tg3.c Sun Apr 20 23:59:45 2003 @@ -2148,7 +2148,7 @@ return work_exists; } -static void tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct tg3 *tp = dev->priv; @@ -2187,6 +2187,8 @@ } spin_unlock_irqrestore(&tp->lock, flags); + + return IRQ_HANDLED; } static void tg3_init_rings(struct tg3 *); diff -Nru a/drivers/net/tlan.c b/drivers/net/tlan.c --- a/drivers/net/tlan.c Mon Feb 24 12:31:17 2003 +++ b/drivers/net/tlan.c Sun Apr 20 21:26:42 2003 @@ -288,7 +288,7 @@ static int TLan_Init( struct net_device * ); static int TLan_Open( struct net_device *dev ); static int TLan_StartTx( struct sk_buff *, struct net_device *); -static void TLan_HandleInterrupt( int, void *, struct pt_regs *); +static irqreturn_t TLan_HandleInterrupt( int, void *, struct pt_regs *); static int TLan_Close( struct net_device *); static struct net_device_stats *TLan_GetStats( struct net_device *); static void TLan_SetMulticastList( struct net_device *); @@ -1106,7 +1106,7 @@ * **************************************************************/ -static void TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 ack; struct net_device *dev; @@ -1134,6 +1134,7 @@ spin_unlock(&priv->lock); + return IRQ_HANDLED; } /* TLan_HandleInterrupts */ diff -Nru a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig --- a/drivers/net/tokenring/Kconfig Mon Feb 24 10:24:37 2003 +++ b/drivers/net/tokenring/Kconfig Sun Apr 20 12:56:51 2003 @@ -16,7 +16,7 @@ connected to such a Token Ring network and want to use your Token Ring card under Linux, say Y here and to the driver for your particular card below and read the Token-Ring mini-HOWTO, available - from . Most people can + from . Most people can say N here. config IBMTR @@ -25,7 +25,7 @@ ---help--- This is support for all IBM Token Ring cards that don't use DMA. If you have such a beast, say Y and read the Token-Ring mini-HOWTO, - available from . + available from . Warning: this driver will almost definitely fail if more than one active Token Ring card is present. @@ -44,7 +44,7 @@ Wake On Lan, and PCI 100/16/4 adapters. If you have such an adapter, say Y and read the Token-Ring - mini-HOWTO, available from . + mini-HOWTO, available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -62,7 +62,7 @@ This is support for IBM Lanstreamer PCI Token Ring Cards. If you have such an adapter, say Y and read the Token-Ring - mini-HOWTO, available from . + mini-HOWTO, available from . This driver is also available as a modules ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -78,7 +78,7 @@ should use the tms380 driver instead. If you have such an adapter, say Y and read the Token-Ring - mini-HOWTO, available from . + mini-HOWTO, available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -104,7 +104,7 @@ If you have such an adapter and would like to use it, say Y and read the Token-Ring mini-HOWTO, available from - . + . Also read the file or check . @@ -194,7 +194,7 @@ If you have such an adapter and would like to use it, say Y or M and read the Token-Ring mini-HOWTO, available from - and the file + and the file . This driver is also available as a module ( = code which can be diff -Nru a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig --- a/drivers/net/tulip/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/net/tulip/Kconfig Sun Apr 20 12:56:51 2003 @@ -21,7 +21,7 @@ (smc9332dst), you can also try the driver for "Generic DECchip" cards, above. However, most people with a network card of this type will say Y here.) Do read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . @@ -42,7 +42,7 @@ (smc9332dst), you can also try the driver for "Generic DECchip" cards, above. However, most people with a network card of this type will say Y here.) Do read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . @@ -80,7 +80,7 @@ These include the DE425, DE434, DE435, DE450 and DE500 models. If you have a network card of this type, say Y and read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . diff -Nru a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c --- a/drivers/net/tulip/de2104x.c Wed Dec 4 16:40:55 2002 +++ b/drivers/net/tulip/de2104x.c Sun Apr 20 22:41:09 2003 @@ -492,7 +492,7 @@ de->rx_tail = rx_tail; } -static void de_interrupt (int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t de_interrupt (int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = dev_instance; struct de_private *de = dev->priv; @@ -500,7 +500,7 @@ status = dr32(MacStatus); if ((!(status & (IntrOK|IntrErr))) || (status == 0xFFFF)) - return; + return IRQ_NONE; if (netif_msg_intr(de)) printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n", @@ -532,6 +532,8 @@ printk(KERN_ERR "%s: PCI bus error, status=%08x, PCI status=%04x\n", dev->name, status, pci_status); } + + return IRQ_HANDLED; } static void de_tx (struct de_private *de) diff -Nru a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c --- a/drivers/net/tulip/de4x5.c Fri Mar 28 20:39:53 2003 +++ b/drivers/net/tulip/de4x5.c Sun Apr 20 22:41:09 2003 @@ -909,7 +909,7 @@ */ static int de4x5_open(struct net_device *dev); static int de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev); -static void de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int de4x5_close(struct net_device *dev); static struct net_device_stats *de4x5_get_stats(struct net_device *dev); static void de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len); @@ -1349,6 +1349,7 @@ } /* The DE4X5-specific entries in the device structure. */ + SET_MODULE_OWNER(dev); dev->open = &de4x5_open; dev->hard_start_xmit = &de4x5_queue_pkt; dev->stop = &de4x5_close; @@ -1433,8 +1434,6 @@ printk("\tsigr: 0x%08x\n", inl(DE4X5_SIGR)); } - MOD_INC_USE_COUNT; - return status; } @@ -1617,17 +1616,18 @@ ** is high and descriptor status bits cannot be set before the associated ** interrupt is asserted and this routine entered. */ -static void +static irqreturn_t de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)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; + return IRQ_NONE; } lp = (struct de4x5_private *)dev->priv; spin_lock(&lp->lock); @@ -1645,6 +1645,7 @@ outl(sts, DE4X5_STS); /* Reset the board interrupts */ if (!(sts & lp->irq_mask)) break;/* All done */ + handled = 1; if (sts & (STS_RI | STS_RU)) /* Rx interrupt (packet[s] arrived) */ de4x5_rx(dev); @@ -1665,7 +1666,7 @@ printk("%s: Fatal bus error occurred, sts=%#8x, device stopped.\n", dev->name, sts); spin_unlock(&lp->lock); - return; + return IRQ_HANDLED; } } @@ -1681,7 +1682,7 @@ ENABLE_IRQs; spin_unlock(&lp->lock); - return; + return IRQ_RETVAL(handled); } static int @@ -1923,8 +1924,6 @@ /* Free any socket buffers */ de4x5_free_rx_buffs(dev); de4x5_free_tx_buffs(dev); - - MOD_DEC_USE_COUNT; /* Put the adapter to sleep to save power */ yawn(dev, SLEEP); diff -Nru a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c --- a/drivers/net/tulip/dmfe.c Fri Mar 28 21:04:10 2003 +++ b/drivers/net/tulip/dmfe.c Sun Apr 20 23:00:42 2003 @@ -298,7 +298,7 @@ static void dmfe_set_filter_mode(struct DEVICE *); static int dmfe_do_ioctl(struct DEVICE *, struct ifreq *, int); static u16 read_srom_word(long ,int); -static void dmfe_interrupt(int , void *, struct pt_regs *); +static irqreturn_t dmfe_interrupt(int , void *, struct pt_regs *); static void dmfe_descriptor_init(struct dmfe_board_info *, unsigned long); static void allocate_rx_buffer(struct dmfe_board_info *); static void update_cr6(u32, unsigned long); @@ -668,13 +668,13 @@ if ( db->tx_queue_cnt < TX_FREE_DESC_CNT ) netif_wake_queue(dev); - /* free this SKB */ - dev_kfree_skb(skb); - /* Restore CR7 to enable interrupt */ spin_unlock_irqrestore(&db->lock, flags); outl(db->cr7_data, dev->base_addr + DCR7); + /* free this SKB */ + dev_kfree_skb(skb); + return 0; } @@ -726,7 +726,7 @@ * receive the packet to upper layer, free the transmitted packet */ -static void dmfe_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t dmfe_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct DEVICE *dev = dev_id; struct dmfe_board_info *db = (struct dmfe_board_info *) dev->priv; @@ -737,7 +737,7 @@ if (!dev) { DMFE_DBUG(1, "dmfe_interrupt() without DEVICE arg", 0); - return; + return IRQ_NONE; } spin_lock_irqsave(&db->lock, flags); @@ -747,7 +747,7 @@ outl(db->cr5_data, ioaddr + DCR5); if ( !(db->cr5_data & 0xc1) ) { spin_unlock_irqrestore(&db->lock, flags); - return; + return IRQ_HANDLED; } /* Disable all interrupt in CR7 to solve the interrupt edge problem */ @@ -760,7 +760,7 @@ db->reset_fatal++; db->wait_reset = 1; /* Need to RESET */ spin_unlock_irqrestore(&db->lock, flags); - return; + return IRQ_HANDLED; } /* Received the coming packet */ @@ -786,6 +786,7 @@ outl(db->cr7_data, ioaddr + DCR7); spin_unlock_irqrestore(&db->lock, flags); + return IRQ_HANDLED; } diff -Nru a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c --- a/drivers/net/tulip/interrupt.c Mon Feb 24 10:16:42 2003 +++ b/drivers/net/tulip/interrupt.c Sun Apr 20 22:41:09 2003 @@ -291,7 +291,7 @@ #endif } -static inline void phy_interrupt (struct net_device *dev) +static inline unsigned int phy_interrupt (struct net_device *dev) { #ifdef __hppa__ int csr12 = inl(dev->base_addr + CSR12) & 0xff; @@ -307,13 +307,17 @@ spin_unlock(&tp->lock); /* clear irq ack bit */ outl(csr12 & ~0x02, dev->base_addr + CSR12); + + return 1; } #endif + + return 0; } /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_instance; struct tulip_private *tp = (struct tulip_private *)dev->priv; @@ -328,15 +332,16 @@ int maxtx = TX_RING_SIZE; int maxoi = TX_RING_SIZE; unsigned int work_count = tulip_max_interrupt_work; + unsigned int handled = 0; /* Let's see whether the interrupt really is for us */ csr5 = inl(ioaddr + CSR5); - if (tp->flags & HAS_PHY_IRQ) - phy_interrupt (dev); + if (tp->flags & HAS_PHY_IRQ) + handled = phy_interrupt (dev); if ((csr5 & (NormalIntr|AbnormalIntr)) == 0) - return; + return IRQ_RETVAL(handled); tp->nir++; @@ -578,4 +583,5 @@ printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n", dev->name, inl(ioaddr + CSR5)); + return IRQ_HANDLED; } diff -Nru a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h --- a/drivers/net/tulip/tulip.h Wed Sep 18 19:56:43 2002 +++ b/drivers/net/tulip/tulip.h Sun Apr 20 22:41:09 2003 @@ -423,7 +423,7 @@ /* interrupt.c */ extern unsigned int tulip_max_interrupt_work; extern int tulip_rx_copybreak; -void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs); int tulip_refill_rx(struct net_device *dev); /* media.c */ diff -Nru a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c --- a/drivers/net/tulip/winbond-840.c Thu Mar 20 10:48:31 2003 +++ b/drivers/net/tulip/winbond-840.c Sun Apr 20 23:00:42 2003 @@ -385,7 +385,7 @@ static int alloc_ringdesc(struct net_device *dev); static void free_ringdesc(struct netdev_private *np); static int start_tx(struct sk_buff *skb, struct net_device *dev); -static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs); static void netdev_error(struct net_device *dev, int intr_status); static int netdev_rx(struct net_device *dev); static u32 __set_rx_mode(struct net_device *dev); @@ -1165,15 +1165,16 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) +static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = (struct net_device *)dev_instance; struct netdev_private *np = dev->priv; long ioaddr = dev->base_addr; int work_limit = max_interrupt_work; + int handled = 0; if (!netif_device_present(dev)) - return; + return IRQ_NONE; do { u32 intr_status = readl(ioaddr + IntrStatus); @@ -1187,6 +1188,8 @@ if ((intr_status & (NormalIntr|AbnormalIntr)) == 0) break; + handled = 1; + if (intr_status & (IntrRxDone | RxNoBuf)) netdev_rx(dev); if (intr_status & RxNoBuf) @@ -1222,6 +1225,7 @@ if (debug > 3) printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n", dev->name, (int)readl(ioaddr + IntrStatus)); + return IRQ_RETVAL(handled); } /* This routine is logically part of the interrupt handler, but separated diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c --- a/drivers/net/tulip/xircom_cb.c Mon Feb 24 10:34:56 2003 +++ b/drivers/net/tulip/xircom_cb.c Sun Apr 20 23:39:12 2003 @@ -111,7 +111,7 @@ /* Function prototypes */ static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id); static void xircom_remove(struct pci_dev *pdev); -static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev); static int xircom_open(struct net_device *dev); static int xircom_close(struct net_device *dev); @@ -344,7 +344,7 @@ leave("xircom_remove"); } -static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_instance; struct xircom_private *card = (struct xircom_private *) dev->priv; @@ -388,6 +388,7 @@ spin_unlock(&card->lock); leave("xircom_interrupt"); + return IRQ_HANDLED; } static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) diff -Nru a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c --- a/drivers/net/tulip/xircom_tulip_cb.c Mon Feb 24 10:35:04 2003 +++ b/drivers/net/tulip/xircom_tulip_cb.c Sun Apr 20 23:39:12 2003 @@ -340,7 +340,7 @@ static void xircom_init_ring(struct net_device *dev); static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev); static int xircom_rx(struct net_device *dev); -static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int xircom_close(struct net_device *dev); static struct net_device_stats *xircom_get_stats(struct net_device *dev); static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); @@ -355,7 +355,7 @@ const int strict_bits = TxThresh10 | TxStoreForw | TxThreshMask | EnableTxRx | FullDuplexBit; int csr5, csr5_22_20, csr5_19_17, currcsr6, attempts = 200; - long flags; + unsigned long flags; save_flags(flags); cli(); /* mask out the reserved bits that always read 0 on the Xircom cards */ @@ -1054,12 +1054,13 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = dev_instance; struct xircom_private *tp = dev->priv; long ioaddr = dev->base_addr; int csr5, work_budget = max_interrupt_work; + int handled = 0; spin_lock (&tp->lock); @@ -1078,6 +1079,8 @@ if ((csr5 & (NormalIntr|AbnormalIntr)) == 0) break; + handled = 1; + if (csr5 & (RxIntr | RxNoBuf)) work_budget -= xircom_rx(dev); @@ -1185,6 +1188,7 @@ dev->name, inl(ioaddr + CSR5)); spin_unlock (&tp->lock); + return IRQ_RETVAL(handled); } @@ -1461,7 +1465,7 @@ struct xircom_private *tp = dev->priv; u16 *data = (u16 *)&rq->ifr_data; int phy = tp->phys[0] & 0x1f; - long flags; + unsigned long flags; switch(cmd) { case SIOCETHTOOL: diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c Mon Apr 7 00:03:41 2003 +++ b/drivers/net/typhoon.c Sun Apr 20 22:41:09 2003 @@ -1790,7 +1790,7 @@ return (done ? 0 : 1); } -static void +static irqreturn_t typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = (struct net_device *) dev_instance; @@ -1799,7 +1799,7 @@ intr_status = readl(ioaddr + TYPHOON_REG_INTR_STATUS); if(!intr_status) - return; + return IRQ_NONE; writel(intr_status, ioaddr + TYPHOON_REG_INTR_STATUS); @@ -1811,6 +1811,7 @@ printk(KERN_ERR "%s: Error, poll already scheduled\n", dev->name); } + return IRQ_HANDLED; } static void diff -Nru a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c --- a/drivers/net/via-rhine.c Sat Mar 1 04:53:03 2003 +++ b/drivers/net/via-rhine.c Sun Apr 20 21:58:28 2003 @@ -530,7 +530,7 @@ static void via_rhine_timer(unsigned long data); static void via_rhine_tx_timeout(struct net_device *dev); static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev); -static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static void via_rhine_tx(struct net_device *dev); static void via_rhine_rx(struct net_device *dev); static void via_rhine_error(struct net_device *dev, int intr_status); @@ -1330,16 +1330,19 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) +static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; long ioaddr; u32 intr_status; int boguscnt = max_interrupt_work; + int handled = 0; ioaddr = dev->base_addr; while ((intr_status = get_intr_status(dev))) { + handled = 1; + /* Acknowledge all of the current interrupt sources ASAP. */ if (intr_status & IntrTxDescRace) writeb(0x08, ioaddr + IntrStatus2); @@ -1385,6 +1388,7 @@ if (debug > 3) printk(KERN_DEBUG "%s: exiting interrupt, status=%8.8x.\n", dev->name, readw(ioaddr + IntrStatus)); + return IRQ_RETVAL(handled); } /* This routine is logically part of the interrupt handler, but isolated diff -Nru a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig --- a/drivers/net/wireless/Kconfig Tue Feb 25 18:56:15 2003 +++ b/drivers/net/wireless/Kconfig Sun Apr 20 12:56:51 2003 @@ -88,7 +88,7 @@ If you want to use an ISA WaveLAN card under Linux, say Y and read the Ethernet-HOWTO, available from - . Some more specific + . Some more specific information is contained in and in the source code . @@ -240,7 +240,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). You also want to check out the PCMCIA-HOWTO, - available from . + available from . You will also very likely also need the Wireless Tools in order to configure your card and that /etc/pcmcia/wireless.opts works: @@ -266,7 +266,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). You also want to check out the PCMCIA-HOWTO, - available from . + available from . # yes, this works even when no drivers are selected config NET_WIRELESS diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c --- a/drivers/net/wireless/airo.c Fri Mar 21 14:14:01 2003 +++ b/drivers/net/wireless/airo.c Sun Apr 20 23:39:12 2003 @@ -947,7 +947,7 @@ static int transmit_802_3_packet(struct airo_info*, int len, char *pPacket); static int transmit_802_11_packet(struct airo_info*, int len, char *pPacket); -static void airo_interrupt( int irq, void* dev_id, struct pt_regs +static irqreturn_t airo_interrupt( int irq, void* dev_id, struct pt_regs *regs); static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); #ifdef WIRELESS_EXT @@ -1837,20 +1837,23 @@ } } -static void airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs) { +static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; u16 status; u16 fid; struct airo_info *apriv = dev->priv; u16 savedInterrupts = 0; + int handled = 0; if (!netif_device_present(dev)) - return; + return IRQ_NONE; for (;;) { status = IN4500( apriv, EVSTAT ); if ( !(status & STATUS_INTS) || status == 0xffff ) break; + handled = 1; + if ( status & EV_AWAKE ) { OUT4500( apriv, EVACK, EV_AWAKE ); OUT4500( apriv, EVACK, EV_AWAKE ); @@ -2133,7 +2136,7 @@ OUT4500( apriv, EVINTEN, savedInterrupts ); /* done.. */ - return; + return IRQ_RETVAL(handled); } /* @@ -2494,7 +2497,7 @@ u16 next; int words; int i; - long flags; + unsigned long flags; spin_lock_irqsave(&ai->aux_lock, flags); page = IN4500(ai, SWS0+whichbap); diff -Nru a/drivers/net/wireless/arlan.c b/drivers/net/wireless/arlan.c --- a/drivers/net/wireless/arlan.c Tue Feb 25 02:08:46 2003 +++ b/drivers/net/wireless/arlan.c Sun Apr 20 23:39:12 2003 @@ -113,7 +113,7 @@ static int arlan_probe_here(struct net_device *dev, int ioaddr); static int arlan_open(struct net_device *dev); static int arlan_tx(struct sk_buff *skb, struct net_device *dev); -static void arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int arlan_close(struct net_device *dev); static struct net_device_stats * arlan_statistics (struct net_device *dev); @@ -1840,7 +1840,7 @@ return; } -static void arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct arlan_private *priv = (struct arlan_private *) dev->priv; @@ -1859,7 +1859,7 @@ priv->irq_test_done = 1; ARLAN_DEBUG_EXIT("arlan_interrupt"); - return; + return IRQ_HANDLED; } diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Tue Feb 18 17:22:50 2003 +++ b/drivers/net/wireless/arlan.h Sun Apr 20 23:39:12 2003 @@ -376,7 +376,7 @@ volatile int txNew; volatile int txOffset; volatile char ReTransmitRequested; - volatile long long tx_done_delayed; + volatile unsigned long tx_done_delayed; volatile long long registrationLastSeen; volatile char under_command; volatile char under_toggle; diff -Nru a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c --- a/drivers/net/wireless/netwave_cs.c Sun Feb 2 13:40:35 2003 +++ b/drivers/net/wireless/netwave_cs.c Sun Apr 20 23:39:12 2003 @@ -495,6 +495,7 @@ spin_lock_init(&priv->spinlock); /* Netwave specific entries in the device structure */ + SET_MODULE_OWNER(dev); dev->hard_start_xmit = &netwave_start_xmit; dev->set_config = &netwave_config; dev->get_stats = &netwave_get_stats; @@ -1727,7 +1728,6 @@ return -ENODEV; link->open++; - MOD_INC_USE_COUNT; netif_start_queue(dev); netwave_reset(dev); @@ -1746,7 +1746,6 @@ if (link->state & DEV_STALE_CONFIG) mod_timer(&link->release, jiffies + HZ/20); - MOD_DEC_USE_COUNT; return 0; } diff -Nru a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c --- a/drivers/net/wireless/orinoco.c Mon Feb 24 12:16:14 2003 +++ b/drivers/net/wireless/orinoco.c Sun Apr 20 23:39:12 2003 @@ -1337,7 +1337,7 @@ /* * Interrupt handler */ -void orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct orinoco_private *priv = (struct orinoco_private *) dev_id; hermes_t *hw = &priv->hw; @@ -1353,7 +1353,7 @@ if (orinoco_lock(priv, &flags) != 0) { /* If hw is unavailable */ - return; + return IRQ_NONE; } evstat = hermes_read_regn(hw, EVSTAT); @@ -1403,6 +1403,8 @@ }; orinoco_unlock(priv, &flags); + + return IRQ_HANDLED; } static void __orinoco_ev_tick(struct orinoco_private *priv, hermes_t *hw) diff -Nru a/drivers/net/wireless/orinoco.h b/drivers/net/wireless/orinoco.h --- a/drivers/net/wireless/orinoco.h Fri Feb 7 00:20:34 2003 +++ b/drivers/net/wireless/orinoco.h Sun Apr 20 23:39:12 2003 @@ -114,7 +114,7 @@ extern int orinoco_proc_dev_init(struct net_device *dev); extern void orinoco_proc_dev_cleanup(struct net_device *dev); -extern void orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs); +extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs); /********************************************************************/ /* Locking and synchronization functions */ diff -Nru a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c --- a/drivers/net/wireless/ray_cs.c Sun Mar 23 03:27:36 2003 +++ b/drivers/net/wireless/ray_cs.c Sun Apr 20 23:39:12 2003 @@ -423,6 +423,7 @@ dev->set_multicast_list = &set_multicast_list; DEBUG(2,"ray_cs ray_attach calling ether_setup.)\n"); + SET_MODULE_OWNER(dev); ether_setup(dev); dev->init = &ray_dev_init; dev->open = &ray_open; @@ -1724,14 +1725,11 @@ dev_link_t *link; ray_dev_t *local = (ray_dev_t *)dev->priv; - MOD_INC_USE_COUNT; - DEBUG(1, "ray_open('%s')\n", dev->name); for (link = dev_list; link; link = link->next) if (link->priv == dev) break; if (!DEV_OK(link)) { - MOD_DEC_USE_COUNT; return -ENODEV; } @@ -1780,8 +1778,6 @@ * and set local->card_status to CARD_AWAITING_PARAM, so that while the * card is closed we can chage its configuration. * Probably also need a COR reset to get sane state - Jean II */ - - MOD_DEC_USE_COUNT; return 0; } /* end ray_dev_close */ diff -Nru a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c --- a/drivers/net/wireless/wavelan.c Fri Jan 10 12:06:02 2003 +++ b/drivers/net/wireless/wavelan.c Sun Apr 20 23:39:12 2003 @@ -3858,7 +3858,7 @@ * This function is the interrupt handler for the WaveLAN card. This * routine will be called whenever: */ -static void wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs) { device *dev; unsigned long ioaddr; @@ -3934,7 +3934,7 @@ dev->name, hasr); #endif spin_unlock (&lp->spinlock); - return; + return IRQ_NONE; } /* Read interrupt data. */ @@ -4004,6 +4004,7 @@ #ifdef DEBUG_INTERRUPT_TRACE printk(KERN_DEBUG "%s: <-wavelan_interrupt()\n", dev->name); #endif + return IRQ_HANDLED; } /*------------------------------------------------------------------*/ diff -Nru a/drivers/net/wireless/wavelan.p.h b/drivers/net/wireless/wavelan.p.h --- a/drivers/net/wireless/wavelan.p.h Fri Oct 18 16:11:24 2002 +++ b/drivers/net/wireless/wavelan.p.h Sun Apr 20 23:39:13 2003 @@ -650,7 +650,7 @@ wv_check_ioaddr(u_long, /* ioaddr */ u_char *); /* mac address (read) */ /* ---------------------- INTERRUPT HANDLING ---------------------- */ -static void +static irqreturn_t wavelan_interrupt(int, /* interrupt handler */ void *, struct pt_regs *); diff -Nru a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c --- a/drivers/net/wireless/wavelan_cs.c Mon Sep 23 22:49:28 2002 +++ b/drivers/net/wireless/wavelan_cs.c Sun Apr 20 23:39:13 2003 @@ -5020,7 +5020,6 @@ /* Mark the device as used */ link->open++; - MOD_INC_USE_COUNT; #ifdef WAVELAN_ROAMING if(do_roaming) @@ -5065,7 +5064,6 @@ #endif /* WAVELAN_ROAMING */ link->open--; - MOD_DEC_USE_COUNT; /* If the card is still present */ if(netif_running(dev)) @@ -5186,6 +5184,7 @@ ether_setup(dev); /* wavelan NET3 callbacks */ + SET_MODULE_OWNER(dev); dev->open = &wavelan_open; dev->stop = &wavelan_close; dev->hard_start_xmit = &wavelan_packet_xmit; diff -Nru a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c --- a/drivers/net/yellowfin.c Fri Jan 10 12:06:02 2003 +++ b/drivers/net/yellowfin.c Sun Apr 20 21:58:28 2003 @@ -406,7 +406,7 @@ static void yellowfin_tx_timeout(struct net_device *dev); static void yellowfin_init_ring(struct net_device *dev); static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev); -static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int yellowfin_rx(struct net_device *dev); static void yellowfin_error(struct net_device *dev, int intr_status); static int yellowfin_close(struct net_device *dev); @@ -942,17 +942,18 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = dev_instance; struct yellowfin_private *yp; long ioaddr; 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; + return IRQ_NONE; } #endif @@ -970,6 +971,7 @@ if (intr_status == 0) break; + handled = 1; if (intr_status & (IntrRxDone | IntrEarlyRx)) { yellowfin_rx(dev); @@ -1091,7 +1093,7 @@ dev->name, inw(ioaddr + IntrStatus)); spin_unlock (&yp->lock); - return; + return IRQ_RETVAL(handled); } /* This routine is logically part of the interrupt handler, but separated @@ -1371,18 +1373,20 @@ memset(hash_table, 0, sizeof(hash_table)); for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next) { + unsigned int bit; + /* Due to a bug in the early chip versions, multiple filter slots must be set for each address. */ if (yp->drv_flags & HasMulticastBug) { - set_bit((ether_crc_le(3, mclist->dmi_addr) >> 3) & 0x3f, - hash_table); - set_bit((ether_crc_le(4, mclist->dmi_addr) >> 3) & 0x3f, - hash_table); - set_bit((ether_crc_le(5, mclist->dmi_addr) >> 3) & 0x3f, - hash_table); + bit = (ether_crc_le(3, mclist->dmi_addr) >> 3) & 0x3f; + hash_table[bit >> 4] |= (1 << bit); + bit = (ether_crc_le(4, mclist->dmi_addr) >> 3) & 0x3f; + hash_table[bit >> 4] |= (1 << bit); + bit = (ether_crc_le(5, mclist->dmi_addr) >> 3) & 0x3f; + hash_table[bit >> 4] |= (1 << bit); } - set_bit((ether_crc_le(6, mclist->dmi_addr) >> 3) & 0x3f, - hash_table); + bit = (ether_crc_le(6, mclist->dmi_addr) >> 3) & 0x3f; + hash_table[bit >> 4] |= (1 << bit); } /* Copy the hash table to the chip. */ for (i = 0; i < 4; i++) diff -Nru a/drivers/net/znet.c b/drivers/net/znet.c --- a/drivers/net/znet.c Mon Mar 31 15:55:38 2003 +++ b/drivers/net/znet.c Sun Apr 20 23:39:13 2003 @@ -159,7 +159,7 @@ static int znet_open(struct net_device *dev); static int znet_send_packet(struct sk_buff *skb, struct net_device *dev); -static void znet_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t znet_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void znet_rx(struct net_device *dev); static int znet_close(struct net_device *dev); static struct net_device_stats *net_get_stats(struct net_device *dev); @@ -604,16 +604,17 @@ } /* The ZNET interrupt handler. */ -static void znet_interrupt(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t znet_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct net_device *dev = dev_id; struct znet_private *znet = dev->priv; int ioaddr; int boguscnt = 20; + int handled = 0; if (dev == NULL) { printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq); - return; + return IRQ_NONE; } spin_lock (&znet->lock); @@ -637,6 +638,8 @@ if ((status & SR0_INTERRUPT) == 0) break; + handled = 1; + if ((status & SR0_EVENT_MASK) == SR0_TRANSMIT_DONE || (status & SR0_EVENT_MASK) == SR0_RETRANSMIT_DONE || (status & SR0_EVENT_MASK) == SR0_TRANSMIT_NO_CRC_DONE) { @@ -682,7 +685,7 @@ spin_unlock (&znet->lock); - return; + return IRQ_RETVAL(handled); } static void znet_rx(struct net_device *dev) diff -Nru a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c --- a/drivers/parport/parport_pc.c Sun Mar 23 14:28:44 2003 +++ b/drivers/parport/parport_pc.c Sun Apr 20 14:14:29 2003 @@ -262,9 +262,11 @@ * of these are in parport_pc.h. */ -static void parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { parport_generic_irq(irq, (struct parport *) dev_id, regs); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } void parport_pc_write_data(struct parport *p, unsigned char d) diff -Nru a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c --- a/drivers/parport/parport_serial.c Thu Nov 21 10:00:10 2002 +++ b/drivers/parport/parport_serial.c Mon Apr 21 02:00:08 2003 @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -150,12 +151,12 @@ static int __devinit siig10x_init_fn(struct pci_dev *dev, struct pci_board_no_ids *board, int enable) { - return pci_siig10x_fn(dev, NULL, enable); + return pci_siig10x_fn(dev, enable); } static int __devinit siig20x_init_fn(struct pci_dev *dev, struct pci_board_no_ids *board, int enable) { - return pci_siig20x_fn(dev, NULL, enable); + return pci_siig20x_fn(dev, enable); } static struct pci_board_no_ids pci_boards[] __devinitdata = { diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c --- a/drivers/pci/bus.c Mon Mar 3 13:26:41 2003 +++ b/drivers/pci/bus.c Sat Apr 19 23:22:31 2003 @@ -75,7 +75,8 @@ * Add newly discovered PCI devices (which are on the bus->devices * list) to the global PCI device list, add the sysfs and procfs * entries. Where a bridge is found, add the discovered bus to - * the parents list of child buses, and recurse. + * the parents list of child buses, and recurse (breadth-first + * to be compatible with 2.4) * * Call hotplug for each new devices. */ @@ -97,6 +98,12 @@ pci_proc_attach_device(dev); #endif pci_create_sysfs_dev_files(dev); + + } + + list_for_each_entry(dev, &bus->devices, bus_list) { + + BUG_ON(list_empty(&dev->global_list)); /* * If there is an unattached subordinate bus, attach diff -Nru a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig --- a/drivers/pcmcia/Kconfig Sun Mar 30 00:13:46 2003 +++ b/drivers/pcmcia/Kconfig Sun Apr 20 12:56:51 2003 @@ -21,7 +21,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). diff -Nru a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c --- a/drivers/pcmcia/i82092.c Fri Mar 28 15:51:04 2003 +++ b/drivers/pcmcia/i82092.c Mon Apr 21 02:40:59 2003 @@ -219,6 +219,7 @@ return val; } +#if 0 static unsigned short indirect_read16(int socket, unsigned short reg) { unsigned short int port; @@ -235,6 +236,7 @@ spin_unlock_irqrestore(&port_lock,flags); return tmp; } +#endif static void indirect_write(int socket, unsigned short reg, unsigned char value) { @@ -334,11 +336,12 @@ static DECLARE_WORK(i82092aa_task, i82092aa_bh, NULL); -static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs) +static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs) { int i; int loopcount = 0; - + int handled = 0; + unsigned int events, active=0; /* enter("i82092aa_interrupt");*/ @@ -362,6 +365,7 @@ if ((csc==0) || /* no events on this socket */ (sockets[i].handler==NULL)) /* no way to handle events */ continue; + handled = 1; events = 0; if (csc & I365_CSC_DETECT) { @@ -390,7 +394,7 @@ break; } - + return IRQ_RETVAL(handled); /* leave("i82092aa_interrupt");*/ } diff -Nru a/drivers/pcmcia/i82092aa.h b/drivers/pcmcia/i82092aa.h --- a/drivers/pcmcia/i82092aa.h Mon Mar 17 07:38:32 2003 +++ b/drivers/pcmcia/i82092aa.h Mon Apr 21 02:40:59 2003 @@ -1,6 +1,8 @@ #ifndef _INCLUDE_GUARD_i82092aa_H_ #define _INCLUDE_GUARD_i82092aa_H_ +#include + /* $Id: i82092aa.h,v 1.1.1.1 2001/09/19 14:53:15 dwmw2 Exp $ */ /* Debuging defines */ @@ -21,7 +23,7 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id); static void i82092aa_pci_remove(struct pci_dev *dev); static int card_present(int socketno); -static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs); +static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs); diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c --- a/drivers/pcmcia/i82365.c Fri Mar 28 15:51:04 2003 +++ b/drivers/pcmcia/i82365.c Mon Apr 21 02:40:59 2003 @@ -78,7 +78,7 @@ #define DEBUG(n, args...) do { } while (0) #endif -static void i365_count_irq(int, void *, struct pt_regs *); +static irqreturn_t i365_count_irq(int, void *, struct pt_regs *); static inline int _check_irq(int irq, int flags) { if (request_irq(irq, i365_count_irq, flags, "x", i365_count_irq) != 0) @@ -535,11 +535,12 @@ static volatile u_int irq_hits; static u_short irq_sock; -static void i365_count_irq(int irq, void *dev, struct pt_regs *regs) +static irqreturn_t i365_count_irq(int irq, void *dev, struct pt_regs *regs) { i365_get(irq_sock, I365_CSC); irq_hits++; DEBUG(2, "-> hit on irq %d\n", irq); + return IRQ_HANDLED; } static u_int __init test_irq(u_short sock, int irq) @@ -627,11 +628,6 @@ return ns/cycle_time; } -static int to_ns(int cycles) -{ - return cycle_time*cycles; -} - /*====================================================================*/ #ifdef CONFIG_ISA @@ -939,7 +935,7 @@ static unsigned long last_detect_jiffies; -static void pcic_interrupt(int irq, void *dev, +static irqreturn_t pcic_interrupt(int irq, void *dev, struct pt_regs *regs) { int i, j, csc; @@ -947,7 +943,8 @@ #ifdef CONFIG_ISA u_long flags = 0; #endif - + int handled = 0; + DEBUG(4, "i82365: pcic_interrupt(%d)\n", irq); for (j = 0; j < 20; j++) { @@ -956,6 +953,7 @@ if ((socket[i].cs_irq != irq) && (socket[i].cap.pci_irq != irq)) continue; + handled = 1; ISA_LOCK(i, flags); csc = i365_get(i, I365_CSC); if ((csc == 0) || (!socket[i].handler) || @@ -1002,6 +1000,7 @@ printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n"); DEBUG(4, "i82365: interrupt done\n"); + return IRQ_RETVAL(handled); } /* pcic_interrupt */ static void pcic_interrupt_wrapper(u_long data) diff -Nru a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c --- a/drivers/pcmcia/rsrc_mgr.c Wed Mar 26 08:49:33 2003 +++ b/drivers/pcmcia/rsrc_mgr.c Sun Apr 20 14:14:29 2003 @@ -599,7 +599,7 @@ #ifdef CONFIG_PCMCIA_PROBE -static void fake_irq(int i, void *d, struct pt_regs *r) { } +static irqreturn_t fake_irq(int i, void *d, struct pt_regs *r) { return IRQ_NONE; } static inline int check_irq(int irq) { if (request_irq(irq, fake_irq, 0, "bogus", NULL) != 0) diff -Nru a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c --- a/drivers/pcmcia/tcic.c Fri Mar 28 15:51:05 2003 +++ b/drivers/pcmcia/tcic.c Mon Apr 21 02:40:59 2003 @@ -111,7 +111,7 @@ /*====================================================================*/ -static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs); +static irqreturn_t tcic_interrupt(int irq, void *dev, struct pt_regs *regs); static void tcic_timer(u_long data); static struct pccard_operations tcic_operations; @@ -229,9 +229,10 @@ static volatile u_int irq_hits; -static void __init tcic_irq_count(int irq, void *dev, struct pt_regs *regs) +static irqreturn_t __init tcic_irq_count(int irq, void *dev, struct pt_regs *regs) { irq_hits++; + return IRQ_HANDLED; } static u_int __init try_irq(int irq) @@ -565,7 +566,7 @@ static DECLARE_WORK(tcic_task, tcic_bh, NULL); -static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs) +static irqreturn_t tcic_interrupt(int irq, void *dev, struct pt_regs *regs) { int i, quick = 0; u_char latch, sstat; @@ -575,7 +576,7 @@ if (active) { printk(KERN_NOTICE "tcic: reentered interrupt handler!\n"); - return; + return IRQ_NONE; } else active = 1; @@ -620,7 +621,7 @@ active = 0; DEBUG(2, "tcic: interrupt done\n"); - + return IRQ_HANDLED; } /* tcic_interrupt */ static void tcic_timer(u_long data) diff -Nru a/drivers/pcmcia/yenta.c b/drivers/pcmcia/yenta.c --- a/drivers/pcmcia/yenta.c Mon Mar 17 07:43:04 2003 +++ b/drivers/pcmcia/yenta.c Sun Apr 20 14:14:29 2003 @@ -429,7 +429,7 @@ socket->handler(socket->info, events); } -static void yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned int events; pci_socket_t *socket = (pci_socket_t *) dev_id; @@ -440,7 +440,9 @@ socket->events |= events; spin_unlock(&socket->event_lock); schedule_work(&socket->tq_task); + return IRQ_HANDLED; } + return IRQ_NONE; } static void yenta_interrupt_wrapper(unsigned long data) diff -Nru a/drivers/pnp/resource.c b/drivers/pnp/resource.c --- a/drivers/pnp/resource.c Thu Mar 6 13:50:22 2003 +++ b/drivers/pnp/resource.c Sun Apr 20 14:14:29 2003 @@ -420,8 +420,9 @@ return NULL; } -static void pnp_test_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t pnp_test_handler(int irq, void *dev_id, struct pt_regs *regs) { + return IRQ_NONE; } int pnp_check_irq(struct pnp_dev * dev, int idx) diff -Nru a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c --- a/drivers/s390/block/dasd.c Fri Apr 18 08:58:55 2003 +++ b/drivers/s390/block/dasd.c Sat Apr 19 14:17:47 2003 @@ -141,38 +141,15 @@ static inline int dasd_state_new_to_known(struct dasd_device *device) { - umode_t devfs_perm; - kdev_t kdev; - char buf[20]; - - kdev = dasd_get_kdev(device); - if (kdev_none(kdev)) - return -ENODEV; - /* * As long as the device is not in state DASD_STATE_NEW we want to * keep the reference count > 0. */ dasd_get_device(device); -#ifdef CONFIG_DEVFS_FS - /* Add a proc directory and the dasd device entry to devfs. */ sprintf(device->gdp->devfs_name, "dasd/%04x", _ccw_device_get_device_number(device->cdev)); -#endif - if (device->ro_flag) - devfs_perm = S_IFBLK | S_IRUSR; - else - devfs_perm = S_IFBLK | S_IRUSR | S_IWUSR; - - snprintf(buf, sizeof(buf), "dasd/%04x/device", - _ccw_device_get_device_number(device->cdev)); - device->devfs_entry = devfs_register(NULL, buf, 0, - major(kdev), - minor(kdev) << DASD_PARTN_BITS, - devfs_perm, - &dasd_device_operations, NULL); device->state = DASD_STATE_KNOWN; return 0; } @@ -183,10 +160,6 @@ static inline void dasd_state_known_to_new(struct dasd_device * device) { - /* Remove device entry and devfs directory. */ - devfs_unregister(device->devfs_entry); - devfs_unregister(device->gdp->de); - /* Forget the discipline information. */ device->discipline = NULL; device->state = DASD_STATE_NEW; diff -Nru a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c --- a/drivers/s390/block/dasd_devmap.c Mon Apr 14 12:11:53 2003 +++ b/drivers/s390/block/dasd_devmap.c Sun Apr 20 06:55:08 2003 @@ -406,27 +406,6 @@ } /* - * Return kdev for a dasd device. - */ -kdev_t -dasd_get_kdev(struct dasd_device *device) -{ - struct dasd_devmap *devmap; - int major, minor; - int devno; - - devno = _ccw_device_get_device_number(device->cdev); - devmap = dasd_devmap_from_devno(devno); - if (devmap == NULL) - return NODEV; - major = dasd_gendisk_index_major(devmap->devindex); - if (major < 0) - return NODEV; - minor = devmap->devindex % DASD_PER_MAJOR; - return mk_kdev(major, minor); -} - -/* * Create a dasd device structure for cdev. */ struct dasd_device * diff -Nru a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h --- a/drivers/s390/block/dasd_int.h Mon Apr 14 12:11:54 2003 +++ b/drivers/s390/block/dasd_int.h Sun Apr 20 06:54:52 2003 @@ -264,7 +264,6 @@ struct dasd_device { /* Block device stuff. */ struct gendisk *gdp; - devfs_handle_t devfs_entry; request_queue_t *request_queue; spinlock_t request_queue_lock; unsigned long blocks; /* size of volume in blocks */ @@ -471,7 +470,6 @@ struct dasd_device *dasd_create_device(struct ccw_device *); void dasd_delete_device(struct dasd_device *); -kdev_t dasd_get_kdev(struct dasd_device *); struct dasd_device *dasd_device_from_devindex(int); int dasd_parse(void); diff -Nru a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c --- a/drivers/s390/block/xpram.c Sat Mar 22 07:38:05 2003 +++ b/drivers/s390/block/xpram.c Sat Apr 19 14:18:27 2003 @@ -449,7 +449,6 @@ offset = 0; for (i = 0; i < xpram_devs; i++) { struct gendisk *disk = xpram_disks[i]; - char name[16]; xpram_devices[i].size = xpram_sizes[i] / 4; xpram_devices[i].offset = offset; @@ -460,13 +459,9 @@ disk->private_data = &xpram_devices[i]; disk->queue = &xpram_queue; sprintf(disk->disk_name, "slram%d", i); + sprintf(disk->disk_name, "slram/%d", i); set_capacity(disk, xpram_sizes[i] << 1); add_disk(disk); - sprintf(name, "slram/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); } return 0; @@ -485,7 +480,6 @@ for (i = 0; i < xpram_devs; i++) { del_gendisk(xpram_disks[i]); put_disk(xpram_disks[i]); - devfs_remove("slram/%d", i); } unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME); devfs_remove("slram"); diff -Nru a/drivers/s390/char/tubfs.c b/drivers/s390/char/tubfs.c --- a/drivers/s390/char/tubfs.c Mon Mar 31 15:55:36 2003 +++ b/drivers/s390/char/tubfs.c Fri Apr 18 11:14:59 2003 @@ -34,10 +34,6 @@ }; #ifdef CONFIG_DEVFS_FS -static devfs_handle_t fs3270_devfs_dir; -static devfs_handle_t fs3270_devfs_tub; -extern struct file_operations tty_fops; - void fs3270_devfs_register(tub_t *tubp) { char name[16]; @@ -48,7 +44,7 @@ S_IFCHR | S_IRUSR | S_IWUSR, &fs3270_fops, NULL); sprintf(name, "tty%.4x", tubp->devno); tty_register_devfs_name(&tty3270_driver, 0, tubp->minor, - fs3270_devfs_dir, name); + NULL, name); } void fs3270_devfs_unregister(tub_t *tubp) @@ -72,13 +68,11 @@ IBM_FS3270_MAJOR, rc); return -1; } -#ifdef CONFIG_DEVFS_FS - fs3270_devfs_dir = devfs_mk_dir("3270"); - fs3270_devfs_tub = devfs_register(NULL, "3270/tub", 0, + devfs_mk_dir("3270"); + devfs_register(NULL, "3270/tub", 0, IBM_FS3270_MAJOR, 0, S_IFCHR | S_IRUGO | S_IWUGO, &fs3270_fops, NULL); -#endif fs3270_major = IBM_FS3270_MAJOR; return 0; } @@ -90,10 +84,8 @@ fs3270_fini(void) { if (fs3270_major != -1) { -#ifdef CONFIG_DEVFS_FS - devfs_unregister(fs3270_devfs_tub); - devfs_unregister(fs3270_devfs_dir); -#endif + devfs_remove("3270"); + devfs_remove("3270/tub"); unregister_chrdev(fs3270_major, "fs3270"); fs3270_major = -1; } diff -Nru a/drivers/s390/char/tubio.h b/drivers/s390/char/tubio.h --- a/drivers/s390/char/tubio.h Mon Mar 31 15:55:36 2003 +++ b/drivers/s390/char/tubio.h Fri Apr 18 11:49:07 2003 @@ -338,7 +338,6 @@ extern enum tubwhat tty3270_proc_what; extern struct tty_driver tty3270_driver; #ifdef CONFIG_DEVFS_FS -extern devfs_handle_t fs3270_devfs_dir; extern void fs3270_devfs_register(tub_t *); extern void fs3270_devfs_unregister(tub_t *); #endif diff -Nru a/drivers/sbus/char/aurora.c b/drivers/sbus/char/aurora.c --- a/drivers/sbus/char/aurora.c Thu Apr 3 04:51:47 2003 +++ b/drivers/sbus/char/aurora.c Sun Apr 20 23:48:19 2003 @@ -265,7 +265,7 @@ return 0; } -static void aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs); +static irqreturn_t aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs); /* Main probing routine, also sets irq. */ static int aurora_probe(void) @@ -701,7 +701,7 @@ } /* The main interrupt processing routine */ -static void aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs) { unsigned char status; unsigned char ack,chip/*,chip_id*/; @@ -719,7 +719,7 @@ /* old bp = IRQ_to_board[irq&0x0f];*/ if (!bp || !(bp->flags & AURORA_BOARD_ACTIVE)) - return; + return IRQ_NONE; /* The while() below takes care of this. status = sbus_readb(&bp->r[0]->r[CD180_SRSR]); @@ -727,7 +727,7 @@ printk("mumu: %02x\n", status); #endif if (!(status&SRSR_ANYINT)) - return; * Nobody has anything to say, so exit * + return IRQ_NONE; * Nobody has anything to say, so exit * */ while ((loop++ < 48) && (status = sbus_readb(&bp->r[0]->r[CD180_SRSR]) & SRSR_ANYINT)){ @@ -875,6 +875,8 @@ } } #endif + + return IRQ_HANDLED; } #ifdef AURORA_INT_DEBUG diff -Nru a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c --- a/drivers/sbus/char/bbc_i2c.c Mon Nov 18 14:21:09 2002 +++ b/drivers/sbus/char/bbc_i2c.c Sun Apr 20 23:48:19 2003 @@ -331,7 +331,7 @@ EXPORT_SYMBOL(bbc_i2c_write_buf); EXPORT_SYMBOL(bbc_i2c_read_buf); -static void bbc_i2c_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t bbc_i2c_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct bbc_i2c_bus *bp = dev_id; @@ -341,6 +341,8 @@ if (bp->waiting && !(readb(bp->i2c_control_regs + 0x0) & I2C_PCF_PIN)) wake_up(&bp->wq); + + return IRQ_HANDLED; } static void __init reset_one_i2c(struct bbc_i2c_bus *bp) diff -Nru a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c --- a/drivers/sbus/char/cpwatchdog.c Mon Nov 4 13:05:02 2002 +++ b/drivers/sbus/char/cpwatchdog.c Sun Apr 20 23:48:19 2003 @@ -201,7 +201,7 @@ #ifdef WD_DEBUG static void wd_dumpregs(void); #endif -static void wd_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t wd_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void wd_toggleintr(struct wd_timer* pTimer, int enable); static void wd_pingtimer(struct wd_timer* pTimer); static void wd_starttimer(struct wd_timer* pTimer); @@ -444,7 +444,7 @@ #endif /* ifdef WD_DEBUG */ } -static void wd_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t wd_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* Only WD0 will interrupt-- others are NMI and we won't * see them here.... @@ -456,7 +456,7 @@ wd_dev.watchdog[WD0_ID].runstatus |= WD_STAT_SVCD; } spin_unlock_irq(&wd_dev.lock); - return; + return IRQ_HANDLED; } static struct file_operations wd_fops = { diff -Nru a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c --- a/drivers/sbus/char/uctrl.c Fri Oct 11 03:02:14 2002 +++ b/drivers/sbus/char/uctrl.c Sun Apr 20 23:48:19 2003 @@ -217,10 +217,11 @@ return 0; } -void uctrl_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t uctrl_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct uctrl_driver *driver = (struct uctrl_driver *)dev_id; printk("in uctrl_interrupt\n"); + return IRQ_HANDLED; } static struct file_operations uctrl_fops = { diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig --- a/drivers/scsi/Kconfig Tue Mar 4 22:34:46 2003 +++ b/drivers/scsi/Kconfig Sun Apr 20 12:56:51 2003 @@ -8,7 +8,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -26,7 +26,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -48,7 +48,7 @@ tape drives (ADR-x0) that supports the standard SCSI-2 commands for tapes (QIC-157) and can be driven by the standard driver st. For more information, you may have a look at the SCSI-HOWTO - and + and in the kernel source. More info on the OnStream driver may be found on @@ -67,7 +67,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -238,7 +238,7 @@ must be manually specified in this case. It is explained in section 3.3 of the SCSI-HOWTO, available from - . You might also want to + . You might also want to read the file . This driver is also available as a module ( = code which can be @@ -252,7 +252,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.4 of the SCSI-HOWTO, available from - . Note that Trantor was + . Note that Trantor was purchased by Adaptec, and some former Trantor products are being sold under the Adaptec name. If it doesn't work out of the box, you may have to change some settings in . @@ -268,7 +268,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.5 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -316,7 +316,7 @@ configuration options. You should read at a minimum before contacting the maintainer with any questions. The SCSI-HOWTO, - available from , can also + available from , can also be of great help. If you want to compile this driver as a module ( = code which can be @@ -377,7 +377,7 @@ This is support for the AM53/79C974 SCSI host adapters. Please read for details. Also, the SCSI-HOWTO, available from - , is for you. + , is for you. Note that there is another driver for AM53C974 based adapters: "Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support", above. You @@ -406,7 +406,7 @@ ---help--- This is support for BusLogic MultiMaster and FlashPoint SCSI Host Adapters. Consult the SCSI-HOWTO, available from - , and the files + , and the files and for more information. If this driver does not work correctly without modification, please contact @@ -451,7 +451,7 @@ help This is support for DTC 3180/3280 SCSI Host Adapters. Please read the SCSI-HOWTO, available from - , and the file + , and the file . This driver is also available as a module ( = code which can be @@ -470,7 +470,7 @@ You want to read the start of and the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -518,7 +518,7 @@ host adapters could also use this driver but are discouraged from doing so, since this driver only supports hard disks and lacks numerous features. You might want to have a look at the SCSI-HOWTO, - available from . + available from . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -534,7 +534,7 @@ other adapters based on the Future Domain chipsets (Quantum ISA-200S, ISA-250MG; Adaptec AHA-2920A; and at least one IBM board). It is explained in section 3.7 of the SCSI-HOWTO, available from - . + . NOTE: Newer Adaptec AHA-2920C boards use the Adaptec AIC-7850 chip and should use the aic7xxx driver ("Adaptec AIC7xxx chipset SCSI @@ -589,7 +589,7 @@ generic 5380 support. It is explained in section 3.8 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -605,7 +605,7 @@ This is a driver for the old NCR 53c80 series of SCSI controllers on boards using memory mapped I/O. It is explained in section 3.8 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -719,7 +719,7 @@ help This is support for the Initio 91XXU(W) SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -732,7 +732,7 @@ help This is support for the Initio INI-A100U2W SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -758,7 +758,7 @@ For more information about this driver and how to use it you should read the file . You should also read the SCSI-HOWTO, which is available from - . If you use this driver, + . If you use this driver, you will still be able to use the parallel port for other tasks, such as a printer; it is safe to compile both drivers into the kernel. @@ -787,7 +787,7 @@ For more information about this driver and how to use it you should read the file . You should also read the SCSI-HOWTO, which is available from - . If you use this driver, + . If you use this driver, you will still be able to use the parallel port for other tasks, such as a printer; it is safe to compile both drivers into the kernel. @@ -833,7 +833,7 @@ This is support for the NCR53c406a SCSI host adapter. For user configurable parameters, check out in the kernel source. Also read the SCSI-HOWTO, available from - . + . If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -883,7 +883,7 @@ This is a driver for the 53c7 and 8xx NCR family of SCSI controllers, not to be confused with the NCR 5380 controllers. It is explained in section 3.8 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . Please read for the available boot time @@ -1220,7 +1220,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.10 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -1235,7 +1235,7 @@ help This is support for the PCI2000I EIDE interface card which acts as a SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . This driver is also available as a module called pci2000 ( = code which can be inserted in and removed from the running kernel @@ -1248,7 +1248,7 @@ help This is support for the PCI2220i EIDE interface card which acts as a SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . This driver is also available as a module called pci2220i ( = code which can be inserted in and removed from the running kernel @@ -1261,7 +1261,7 @@ help This is support for the PSI240i EIDE interface card which acts as a SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . This driver is also available as a module called psi240i ( = code which can be inserted in and removed from the running kernel @@ -1283,7 +1283,7 @@ Information about this driver is contained in . You should also read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1303,7 +1303,7 @@ Please read the file . You should also read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1346,7 +1346,7 @@ ---help--- These are 8-bit SCSI controllers; the ST-01 is also supported by this driver. It is explained in section 3.9 of the SCSI-HOWTO, - available from . If it + available from . If it doesn't work out of the box, you may have to change some settings in . @@ -1433,7 +1433,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.11 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . Note that Trantor was purchased by Adaptec, and some former Trantor products are being sold under the @@ -1453,7 +1453,7 @@ information about this hardware. If the driver doesn't work out of the box, you may have to change some settings in . Read the SCSI-HOWTO, available from - . Note that there is also + . Note that there is also another driver for the same hardware: "UltraStor SCSI support", below. You should say Y to both only if you want 24F support as well. @@ -1502,7 +1502,7 @@ This is support for the UltraStor 14F, 24F and 34F SCSI-2 host adapter family. This driver is explained in section 3.12 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -1520,7 +1520,7 @@ help This is support for the Workbit NinjaSCSI-32Bi/UDE PCI/Cardbus SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c Wed Apr 9 07:55:37 2003 +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c Sun Apr 20 14:14:29 2003 @@ -3863,7 +3863,7 @@ /* * SCSI controller interrupt handler. */ -void +irqreturn_t ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs) { struct ahc_softc *ahc; @@ -3883,6 +3883,8 @@ ahc_schedule_completeq(ahc, acmd); } ahc_unlock(ahc, &flags); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } void diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h Tue Mar 25 16:32:23 2003 +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h Sun Apr 20 14:14:29 2003 @@ -1224,7 +1224,7 @@ int ahc_platform_abort_scbs(struct ahc_softc *ahc, int target, char channel, int lun, u_int tag, role_t role, uint32_t status); -void ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs); +irqreturn_t ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs); void ahc_platform_flushwork(struct ahc_softc *ahc); int ahc_softc_comp(struct ahc_softc *, struct ahc_softc *); void ahc_done(struct ahc_softc*, struct scb*); diff -Nru a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c --- a/drivers/scsi/aic7xxx_old.c Wed Feb 26 19:03:00 2003 +++ b/drivers/scsi/aic7xxx_old.c Sun Apr 20 23:56:10 2003 @@ -6484,7 +6484,7 @@ * above. Please, children, do not try this at home, and if you ever see * anything like it, please inform the Gross Hack Police immediately *-F*************************************************************************/ -static void +static irqreturn_t do_aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs) { unsigned long cpu_flags; @@ -6492,7 +6492,7 @@ p = (struct aic7xxx_host *)dev_id; if(!p) - return; + return IRQ_NONE; spin_lock_irqsave(p->host->host_lock, cpu_flags); p->flags |= AHC_IN_ISR; do @@ -6503,6 +6503,8 @@ aic7xxx_run_waiting_queues(p); p->flags &= ~AHC_IN_ISR; spin_unlock_irqrestore(p->host->host_lock, cpu_flags); + + return IRQ_HANDLED; } /*+F************************************************************************* diff -Nru a/drivers/scsi/esp.c b/drivers/scsi/esp.c --- a/drivers/scsi/esp.c Mon Feb 24 10:10:00 2003 +++ b/drivers/scsi/esp.c Sun Apr 20 23:54:46 2003 @@ -186,7 +186,7 @@ static int esps_running = 0; /* Forward declarations. */ -static void esp_intr(int irq, void *dev_id, struct pt_regs *pregs); +static irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs); /* Debugging routines */ struct esp_cmdstrings { @@ -4321,7 +4321,7 @@ } /* Service only the ESP described by dev_id. */ -static void esp_intr(int irq, void *dev_id, struct pt_regs *pregs) +static irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs) { struct esp *esp = dev_id; unsigned long flags; @@ -4337,6 +4337,8 @@ ESP_INTSON(esp->dregs); } spin_unlock_irqrestore(esp->ehost->host_lock, flags); + + return IRQ_HANDLED; } static int esp_slave_alloc(Scsi_Device *SDptr) diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c --- a/drivers/scsi/qla1280.c Wed Feb 12 14:02:45 2003 +++ b/drivers/scsi/qla1280.c Sun Apr 20 14:14:29 2003 @@ -1736,11 +1736,12 @@ * qla1280_intr_handler * Handles the H/W interrupt **************************************************************************/ -void +irqreturn_t qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs) { struct scsi_qla_host *ha; struct device_reg *reg; + int handled = 0; u16 data; ENTER_INTR ("qla1280_intr_handler"); @@ -1757,6 +1758,7 @@ /* Check for pending interrupts. */ if (data & RISC_INT) { qla1280_isr(ha, &ha->done_q_first, &ha->done_q_last); + handled = 1; } else { /* spurious interrupts can happen legally */ dprintk(1, "scsi(%ld): Spurious interrupt - ignoring\n", @@ -1772,6 +1774,7 @@ WRT_REG_WORD(®->ictrl, (ISP_EN_INT | ISP_EN_RISC)); LEAVE_INTR("qla1280_intr_handler"); + return IRQ_RETVAL(handled); } /************************************************************************** diff -Nru a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h --- a/drivers/scsi/qla1280.h Tue Dec 10 12:28:34 2002 +++ b/drivers/scsi/qla1280.h Sun Apr 20 14:14:29 2003 @@ -1316,7 +1316,7 @@ int qla1280_biosparam(struct scsi_device *, struct block_device *, sector_t, int[]); static int qla1280_slave_configure(Scsi_Device *); -void qla1280_intr_handler(int, void *, struct pt_regs *); +irqreturn_t qla1280_intr_handler(int, void *, struct pt_regs *); void qla1280_setup(char *s, int *dummy); /* diff -Nru a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c --- a/drivers/scsi/qlogicfc.c Thu Mar 27 09:33:25 2003 +++ b/drivers/scsi/qlogicfc.c Sun Apr 20 23:55:02 2003 @@ -660,7 +660,7 @@ static int isp2x00_mbox_command(struct Scsi_Host *, u_short[]); static int isp2x00_return_status(Scsi_Cmnd *, struct Status_Entry *); static void isp2x00_intr_handler(int, void *, struct pt_regs *); -static void do_isp2x00_intr_handler(int, void *, struct pt_regs *); +static irqreturn_t do_isp2x00_intr_handler(int, void *, struct pt_regs *); static int isp2x00_make_portdb(struct Scsi_Host *); #if ISP2x00_FABRIC @@ -1421,7 +1421,7 @@ #define ASYNC_EVENT_INTERRUPT 0x01 -void do_isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t do_isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *host = dev_id; unsigned long flags; @@ -1429,6 +1429,8 @@ spin_lock_irqsave(host->host_lock, flags); isp2x00_intr_handler(irq, dev_id, regs); spin_unlock_irqrestore(host->host_lock, flags); + + return IRQ_HANDLED; } void isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs) diff -Nru a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c --- a/drivers/scsi/qlogicisp.c Wed Feb 12 14:03:35 2003 +++ b/drivers/scsi/qlogicisp.c Sun Apr 20 23:55:22 2003 @@ -606,7 +606,7 @@ static int isp1020_mbox_command(struct Scsi_Host *, u_short []); static int isp1020_return_status(struct Status_Entry *); static void isp1020_intr_handler(int, void *, struct pt_regs *); -static void do_isp1020_intr_handler(int, void *, struct pt_regs *); +static irqreturn_t do_isp1020_intr_handler(int, void *, struct pt_regs *); #if USE_NVRAM_DEFAULTS static int isp1020_get_defaults(struct Scsi_Host *); @@ -965,7 +965,7 @@ #define ASYNC_EVENT_INTERRUPT 0x01 -void do_isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t do_isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *host = dev_id; unsigned long flags; @@ -973,6 +973,8 @@ spin_lock_irqsave(host->host_lock, flags); isp1020_intr_handler(irq, dev_id, regs); spin_unlock_irqrestore(host->host_lock, flags); + + return IRQ_HANDLED; } void isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs) diff -Nru a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c --- a/drivers/scsi/qlogicpti.c Tue Feb 25 09:57:01 2003 +++ b/drivers/scsi/qlogicpti.c Sun Apr 20 23:55:42 2003 @@ -644,7 +644,7 @@ return 0; } -static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs); static void __init qpti_chain_add(struct qlogicpti *qpti) { @@ -1441,7 +1441,7 @@ return done_queue; } -static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs) { struct qlogicpti *qpti = dev_id; unsigned long flags; @@ -1463,6 +1463,8 @@ spin_unlock(qpti->qhost->host_lock); } local_irq_restore(flags); + + return IRQ_HANDLED; } static int qlogicpti_abort(Scsi_Cmnd *Cmnd) diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c --- a/drivers/scsi/scsi_error.c Mon Mar 24 04:15:10 2003 +++ b/drivers/scsi/scsi_error.c Sun Apr 20 09:19:56 2003 @@ -1401,7 +1401,6 @@ static void scsi_restart_operations(struct Scsi_Host *shost) { struct scsi_device *sdev; - unsigned long flags; /* * If the door was locked, we need to insert a door lock request @@ -1430,11 +1429,8 @@ * now that error recovery is done, we will need to ensure that these * requests are started. */ - list_for_each_entry(sdev, &shost->my_devices, siblings) { - spin_lock_irqsave(sdev->request_queue->queue_lock, flags); - __blk_run_queue(sdev->request_queue); - spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); - } + list_for_each_entry(sdev, &shost->my_devices, siblings) + blk_run_queue(sdev->request_queue); } /** diff -Nru a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c --- a/drivers/scsi/scsi_lib.c Mon Apr 14 16:09:21 2003 +++ b/drivers/scsi/scsi_lib.c Sun Apr 20 09:19:56 2003 @@ -328,7 +328,7 @@ /* * Called for single_lun devices on IO completion. Clear starget_sdev_user, - * and call __blk_run_queue for all the scsi_devices on the target - + * and call blk_run_queue for all the scsi_devices on the target - * including current_sdev first. * * Called with *no* scsi locks held. @@ -336,7 +336,7 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev) { struct scsi_device *sdev; - unsigned long flags, flags2; + unsigned long flags; spin_lock_irqsave(current_sdev->host->host_lock, flags); WARN_ON(!current_sdev->sdev_target->starget_sdev_user); @@ -344,14 +344,12 @@ spin_unlock_irqrestore(current_sdev->host->host_lock, flags); /* - * Call __blk_run_queue for all LUNs on the target, starting with + * Call blk_run_queue for all LUNs on the target, starting with * current_sdev. We race with others (to set starget_sdev_user), * but in most cases, we will be first. Ideally, each LU on the * target would get some limited time or requests on the target. */ - spin_lock_irqsave(current_sdev->request_queue->queue_lock, flags2); - __blk_run_queue(current_sdev->request_queue); - spin_unlock_irqrestore(current_sdev->request_queue->queue_lock, flags2); + blk_run_queue(current_sdev->request_queue); spin_lock_irqsave(current_sdev->host->host_lock, flags); if (current_sdev->sdev_target->starget_sdev_user) { @@ -366,11 +364,8 @@ spin_unlock_irqrestore(current_sdev->host->host_lock, flags); list_for_each_entry(sdev, ¤t_sdev->same_target_siblings, - same_target_siblings) { - spin_lock_irqsave(sdev->request_queue->queue_lock, flags2); - __blk_run_queue(sdev->request_queue); - spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags2); - } + same_target_siblings) + blk_run_queue(sdev->request_queue); } /* @@ -452,7 +447,7 @@ (shost->host_busy >= shost->can_queue))) { /* * As long as shost is accepting commands and we have - * starved queues, call __blk_run_queue. scsi_request_fn + * starved queues, call blk_run_queue. scsi_request_fn * drops the queue_lock and can add us back to the * starved_list. * @@ -465,9 +460,7 @@ list_del_init(&sdev->starved_entry); spin_unlock_irqrestore(shost->host_lock, flags); - spin_lock_irqsave(sdev->request_queue->queue_lock, flags); - __blk_run_queue(sdev->request_queue); - spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); + blk_run_queue(sdev->request_queue); spin_lock_irqsave(shost->host_lock, flags); if (unlikely(!list_empty(&sdev->starved_entry))) @@ -480,9 +473,7 @@ } spin_unlock_irqrestore(shost->host_lock, flags); - spin_lock_irqsave(q->queue_lock, flags); - __blk_run_queue(q); - spin_unlock_irqrestore(q->queue_lock, flags); + blk_run_queue(q); } /* diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c --- a/drivers/scsi/scsi_scan.c Fri Apr 18 08:58:55 2003 +++ b/drivers/scsi/scsi_scan.c Sat Apr 19 14:18:27 2003 @@ -1733,7 +1733,6 @@ if (sdev->attached) return -EINVAL; - devfs_remove(sdev->devfs_name); scsi_device_unregister(sdev); scsi_free_sdev(sdev); diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c --- a/drivers/scsi/sr.c Fri Apr 18 08:58:55 2003 +++ b/drivers/scsi/sr.c Sat Apr 19 14:18:27 2003 @@ -569,7 +569,8 @@ get_capabilities(cd); sr_vendor_init(cd); - strcpy(disk->devfs_name, sdev->devfs_name); + snprintf(disk->devfs_name, sizeof(disk->devfs_name), + "%s/cd", sdev->devfs_name); disk->driverfs_dev = &sdev->sdev_driverfs_dev; register_cdrom(&cd->cdi); set_capacity(disk, cd->capacity); diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c --- a/drivers/scsi/sym53c8xx_2/sym_glue.c Thu Feb 20 04:16:32 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c Mon Apr 21 10:36:31 2003 @@ -1009,7 +1009,7 @@ /* * Linux entry point of the interrupt handler. */ -static void sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs) { unsigned long flags; hcb_p np = (hcb_p) dev_id; @@ -1029,6 +1029,8 @@ SYM_UNLOCK_HCB(np, flags); if (DEBUG_FLAGS & DEBUG_TINY) printf_debug ("]\n"); + + return IRQ_HANDLED; } /* diff -Nru a/drivers/serial/8250.c b/drivers/serial/8250.c --- a/drivers/serial/8250.c Sat Mar 15 17:15:06 2003 +++ b/drivers/serial/8250.c Sun Apr 20 14:14:29 2003 @@ -984,7 +984,7 @@ * This means we need to loop through all ports. checking that they * don't have an interrupt pending. */ -static void serial8250_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t serial8250_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct irq_info *i = dev_id; struct list_head *l, *end = NULL; @@ -1024,6 +1024,8 @@ spin_unlock(&i->lock); DEBUG_INTR("end.\n"); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } /* diff -Nru a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c --- a/drivers/serial/8250_pci.c Fri Mar 28 02:04:20 2003 +++ b/drivers/serial/8250_pci.c Mon Apr 21 01:55:47 2003 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff -Nru a/drivers/serial/Kconfig b/drivers/serial/Kconfig --- a/drivers/serial/Kconfig Tue Mar 18 09:05:10 2003 +++ b/drivers/serial/Kconfig Sun Apr 20 12:56:51 2003 @@ -97,7 +97,7 @@ Say Y here if you have dumb serial boards other than the four standard COM 1/2/3/4 ports. This may happen if you have an AST FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available - from ), or other custom + from ), or other custom serial port hardware which acts similar to standard serial port hardware. If you only use the standard COM 1/2/3/4 ports, you can say N here to save some memory. You can also say Y if you have an diff -Nru a/drivers/serial/core.c b/drivers/serial/core.c --- a/drivers/serial/core.c Wed Apr 16 15:35:04 2003 +++ b/drivers/serial/core.c Sat Apr 19 23:22:29 2003 @@ -782,8 +782,12 @@ /* * Claim and map the new regions */ - if (port->type != PORT_UNKNOWN) + if (port->type != PORT_UNKNOWN) { retval = port->ops->request_port(port); + } else { + /* Always success - Jean II */ + retval = 0; + } /* * If we fail to request resources for the diff -Nru a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c --- a/drivers/serial/sunsab.c Mon Jan 13 23:08:13 2003 +++ b/drivers/serial/sunsab.c Sun Apr 20 23:44:53 2003 @@ -290,7 +290,7 @@ wake_up_interruptible(&up->port.info->delta_msr_wait); } -static void sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct uart_sunsab_port *up = dev_id; union sab82532_irq_status status; @@ -339,6 +339,8 @@ } spin_unlock_irqrestore(&up->port.lock, flags); + + return IRQ_HANDLED; } /* port->lock is not held. */ diff -Nru a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c --- a/drivers/serial/sunsu.c Sun Mar 2 18:12:49 2003 +++ b/drivers/serial/sunsu.c Sun Apr 20 23:44:53 2003 @@ -458,7 +458,7 @@ wake_up_interruptible(&up->port.info->delta_msr_wait); } -static void sunsu_serial_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct uart_sunsu_port *up = dev_id; unsigned long flags; @@ -476,6 +476,8 @@ } while (!(serial_in(up, UART_IIR) & UART_IIR_NO_INT)); spin_unlock_irqrestore(&up->port.lock, flags); + + return IRQ_HANDLED; } /* Separate interrupt handling path for keyboard/mouse ports. */ @@ -548,7 +550,7 @@ } while (serial_in(up, UART_LSR) & UART_LSR_DR); } -static void sunsu_kbd_ms_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sunsu_kbd_ms_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct uart_sunsu_port *up = dev_id; @@ -559,6 +561,8 @@ receive_kbd_ms_chars(up, regs, (status & UART_LSR_BI) != 0); } + + return IRQ_HANDLED; } static unsigned int sunsu_tx_empty(struct uart_port *port) diff -Nru a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c --- a/drivers/serial/sunzilog.c Tue Feb 25 09:45:15 2003 +++ b/drivers/serial/sunzilog.c Sun Apr 20 23:44:53 2003 @@ -539,7 +539,7 @@ ZS_WSYNC(channel); } -static void sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct uart_sunzilog_port *up = dev_id; @@ -587,6 +587,8 @@ up = up->next; } + + return IRQ_HANDLED; } /* A convenient way to quickly get R0 status. The caller must _not_ hold the diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c --- a/drivers/usb/class/usblp.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/class/usblp.c Sat Apr 19 02:08:38 2003 @@ -130,7 +130,6 @@ struct usblp { struct usb_device *dev; /* USB device */ - devfs_handle_t devfs; /* devfs device */ struct semaphore sem; /* locks this struct, especially "dev" */ char *writebuf; /* write transfer_buffer */ char *readbuf; /* read transfer_buffer */ @@ -163,7 +162,6 @@ dbg("usblp=0x%p", usblp); dbg("dev=0x%p", usblp->dev); - dbg("devfs=0x%p", usblp->devfs); dbg("buf=0x%p", usblp->buf); dbg("readcount=%d", usblp->readcount); dbg("ifnum=%d", usblp->ifnum); @@ -382,7 +380,7 @@ static void usblp_cleanup (struct usblp *usblp) { - devfs_unregister (usblp->devfs); + devfs_remove ("usb/lp%d", usblp->minor); usb_deregister_dev (1, usblp->minor); info("usblp%d: removed", usblp->minor); @@ -908,8 +906,7 @@ /* If we have devfs, create with perms=660. */ sprintf(name, "usb/lp%d", usblp->minor); - usblp->devfs = devfs_register(NULL, name, - DEVFS_FL_DEFAULT, USB_MAJOR, + devfs_register(NULL, name, 0, USB_MAJOR, usblp->minor, S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, &usblp_fops, NULL); diff -Nru a/drivers/usb/core/file.c b/drivers/usb/core/file.c --- a/drivers/usb/core/file.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/core/file.c Fri Apr 18 11:15:45 2003 @@ -28,8 +28,6 @@ #endif #include -static devfs_handle_t usb_devfs_handle; /* /dev/usb dir. */ - #define MAX_USB_MINORS 256 static struct file_operations *usb_minors[MAX_USB_MINORS]; static spinlock_t minor_lock = SPIN_LOCK_UNLOCKED; @@ -75,14 +73,13 @@ return -EBUSY; } - usb_devfs_handle = devfs_mk_dir("usb"); - + devfs_mk_dir("usb"); return 0; } void usb_major_cleanup(void) { - devfs_unregister(usb_devfs_handle); + devfs_remove("usb"); unregister_chrdev(USB_MAJOR, "usb"); } diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c --- a/drivers/usb/core/hcd.c Mon Apr 14 14:01:44 2003 +++ b/drivers/usb/core/hcd.c Sun Apr 20 14:14:29 2003 @@ -1436,17 +1436,18 @@ * to handle interrupts. The PCI glue layer does so automatically; only * bus glue for non-PCI system busses will need to use this. */ -void usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r) +irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r) { struct usb_hcd *hcd = __hcd; int start = hcd->state; if (unlikely (hcd->state == USB_STATE_HALT)) /* irq sharing? */ - return; + return IRQ_NONE; hcd->driver->irq (hcd, r); if (hcd->state != start && hcd->state == USB_STATE_HALT) usb_hc_died (hcd); + return IRQ_HANDLED; } EXPORT_SYMBOL (usb_hcd_irq); diff -Nru a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h --- a/drivers/usb/core/hcd.h Mon Apr 14 13:59:07 2003 +++ b/drivers/usb/core/hcd.h Sun Apr 20 14:14:29 2003 @@ -239,7 +239,7 @@ /* generic bus glue, needed for host controllers that don't use PCI */ extern struct usb_operations usb_hcd_operations; -extern void usb_hcd_irq (int irq, void *__hcd, struct pt_regs *r); +extern irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs *r); extern void usb_hc_died (struct usb_hcd *hcd); /* -------------------------------------------------------------------------- */ diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c --- a/drivers/usb/image/scanner.c Sat Apr 12 04:48:13 2003 +++ b/drivers/usb/image/scanner.c Fri Apr 18 11:54:05 2003 @@ -397,6 +397,7 @@ */ +#include #include /* @@ -843,7 +844,7 @@ kfree(scn->obuf); dbg("%s: De-allocating minor:%d", __FUNCTION__, scn->scn_minor); - devfs_unregister(scn->devfs); + devfs_remove("usb/scanner%d", scn->scn_minor - SCN_BASE_MNR); usb_deregister_dev(1, scn->scn_minor); usb_free_urb(scn->scn_irq); usb_put_dev(scn->scn_dev); @@ -1105,13 +1106,11 @@ sprintf(name, "usb/scanner%d", scn->scn_minor - SCN_BASE_MNR); - scn->devfs = devfs_register(NULL, name, + devfs_register(NULL, name, DEVFS_FL_DEFAULT, USB_MAJOR, scn->scn_minor, S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, &usb_scanner_fops, NULL); - if (scn->devfs == NULL) - dbg("scanner%d: device node registration failed", scn_minor); info ("USB scanner device (0x%04x/0x%04x) now attached to %s", dev->descriptor.idVendor, dev->descriptor.idProduct, name); diff -Nru a/drivers/usb/image/scanner.h b/drivers/usb/image/scanner.h --- a/drivers/usb/image/scanner.h Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/image/scanner.h Fri Apr 18 11:53:22 2003 @@ -40,7 +40,6 @@ #include #include #include -#include // #define DEBUG @@ -336,7 +335,6 @@ struct scn_usb_data { struct usb_device *scn_dev; - devfs_handle_t devfs; /* devfs device */ struct urb *scn_irq; unsigned int ifnum; /* Interface number of the USB device */ int scn_minor; /* Scanner minor - used in disconnect() */ diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c --- a/drivers/usb/input/hiddev.c Sat Mar 22 09:04:18 2003 +++ b/drivers/usb/input/hiddev.c Fri Apr 18 11:17:15 2003 @@ -50,7 +50,6 @@ int open; int minor; wait_queue_head_t wait; - devfs_handle_t devfs; struct hid_device *hid; struct hiddev_list *list; }; @@ -66,7 +65,6 @@ }; static struct hiddev *hiddev_table[HIDDEV_MINORS]; -static devfs_handle_t hiddev_devfs_handle; /* forward reference to make our lives easier */ extern struct usb_driver hiddev_driver; @@ -229,7 +227,7 @@ */ static void hiddev_cleanup(struct hiddev *hiddev) { - devfs_unregister(hiddev->devfs); + devfs_remove("usb/hid/hiddev%d", hiddev->minor); usb_deregister_dev(1, hiddev->minor); hiddev_table[hiddev->minor] = NULL; kfree(hiddev); @@ -716,8 +714,8 @@ hiddev->exist = 1; sprintf(devfs_name, "usb/hid/hiddev%d", minor); - hiddev->devfs = devfs_register(NULL, devfs_name, - DEVFS_FL_DEFAULT, USB_MAJOR, minor + HIDDEV_MINOR_BASE, + devfs_register(NULL, devfs_name, 0, + USB_MAJOR, minor + HIDDEV_MINOR_BASE, S_IFCHR | S_IRUGO | S_IWUSR, &hiddev_fops, NULL); hid->minor = minor; hid->hiddev = hiddev; @@ -774,7 +772,7 @@ int __init hiddev_init(void) { - hiddev_devfs_handle = devfs_mk_dir("usb/hid"); + devfs_mk_dir("usb/hid"); usb_register(&hiddev_driver); return 0; } diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c --- a/drivers/usb/misc/auerswald.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/misc/auerswald.c Fri Apr 18 11:50:24 2003 @@ -242,7 +242,6 @@ struct semaphore mutex; /* protection in user context */ char name[20]; /* name of the /dev/usb entry */ unsigned int dtindex; /* index in the device table */ - devfs_handle_t devfs; /* devfs device node */ struct usb_device * usbdev; /* USB device handle */ int open_count; /* count the number of open character channels */ char dev_desc[AUSI_DLEN];/* for storing a textual description */ @@ -1972,7 +1971,7 @@ up (&dev_table_mutex); /* initialize the devfs node for this device and register it */ - cp->devfs = devfs_register(NULL, cp->name, 0, USB_MAJOR, + devfs_register(NULL, cp->name, 0, USB_MAJOR, AUER_MINOR_BASE + dtindex, S_IFCHR | S_IRUGO | S_IWUGO, &auerswald_fops, NULL); @@ -2092,7 +2091,7 @@ /* remove our devfs node */ /* Nobody can see this device any more */ - devfs_unregister (cp->devfs); + devfs_remove(cp->name); /* give back our USB minor number */ usb_deregister_dev (1, cp->dtindex); diff -Nru a/drivers/usb/misc/brlvger.c b/drivers/usb/misc/brlvger.c --- a/drivers/usb/misc/brlvger.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/misc/brlvger.c Fri Apr 18 11:52:06 2003 @@ -156,7 +156,6 @@ struct usb_device *dev; /* USB device handle */ struct usb_endpoint_descriptor *in_interrupt; struct urb *intr_urb; - devfs_handle_t devfs; int subminor; /* which minor dev #? */ @@ -374,16 +373,11 @@ dbg("Display length: %d", priv->plength); sprintf(devfs_name, "usb/brlvger%d", priv->subminor); - priv->devfs = devfs_register(NULL, devfs_name, + devfs_register(NULL, devfs_name, DEVFS_FL_DEFAULT, USB_MAJOR, BRLVGER_MINOR+priv->subminor, S_IFCHR |S_IRUSR|S_IWUSR |S_IRGRP|S_IWGRP, &brlvger_fops, NULL); - if (!priv->devfs) { -#ifdef CONFIG_DEVFS_FS - err("devfs node registration failed"); -#endif - } display_table[i] = priv; @@ -420,7 +414,7 @@ if(priv){ info("Display %d disconnecting", priv->subminor); - devfs_unregister(priv->devfs); + devfs_remove("usb/brlvger%d", priv->subminor); usb_deregister_dev(1, priv->subminor); down(&disconnect_sem); diff -Nru a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c --- a/drivers/usb/misc/rio500.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/misc/rio500.c Fri Apr 18 11:51:05 2003 @@ -65,7 +65,6 @@ struct rio_usb_data { struct usb_device *rio_dev; /* init: probe_rio */ - devfs_handle_t devfs; /* devfs device */ unsigned int ifnum; /* Interface number of the USB device */ int isopen; /* nz if open */ int present; /* Device is present on the bus */ @@ -476,13 +475,11 @@ } dbg("probe_rio: ibuf address:%p", rio->ibuf); - rio->devfs = devfs_register(NULL, "usb/rio500", + devfs_register(NULL, "usb/rio500", DEVFS_FL_DEFAULT, USB_MAJOR, RIO_MINOR, S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, &usb_rio_fops, NULL); - if (rio->devfs == NULL) - dbg("probe_rio: device node registration failed"); init_MUTEX(&(rio->lock)); @@ -496,7 +493,7 @@ usb_set_intfdata (intf, NULL); if (rio) { - devfs_unregister(rio->devfs); + devfs_remove("usb/rio500"); usb_deregister_dev(1, rio->minor); down(&(rio->lock)); diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c --- a/drivers/usb/usb-skeleton.c Mon Mar 24 13:03:56 2003 +++ b/drivers/usb/usb-skeleton.c Fri Apr 18 11:49:59 2003 @@ -98,7 +98,6 @@ struct usb_skel { struct usb_device * udev; /* save off the usb device pointer */ struct usb_interface * interface; /* the interface for this device */ - devfs_handle_t devfs; /* devfs device node */ unsigned char minor; /* the starting minor number for this device */ unsigned char num_ports; /* the number of ports this device has */ char num_interrupt_in; /* number of interrupt in endpoints we have */ @@ -610,7 +609,7 @@ /* initialize the devfs node for this device and register it */ sprintf(name, "usb/skel%d", dev->minor); - dev->devfs = devfs_register(NULL, name, + devfs = devfs_register(NULL, name, DEVFS_FL_DEFAULT, USB_MAJOR, dev->minor, S_IFCHR | S_IRUSR | S_IWUSR | @@ -674,7 +673,7 @@ minor = dev->minor; /* remove our devfs node */ - devfs_unregister (dev->devfs); + devfs_remove("usb/skel%d", dev->minor); /* give back our dynamic minor */ usb_deregister_dev (1, minor); diff -Nru a/drivers/video/amifb.c b/drivers/video/amifb.c --- a/drivers/video/amifb.c Fri Mar 21 14:13:56 2003 +++ b/drivers/video/amifb.c Mon Apr 21 01:14:23 2003 @@ -1143,7 +1143,7 @@ */ static int flash_cursor(void); -static void amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp); +static irqreturn_t amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp); static u_long chipalloc(u_long size); static void chipfree(void); @@ -2504,7 +2504,7 @@ * VBlank Display Interrupt */ -static void amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp) { if (do_vmode_pan || do_vmode_full) ami_update_display(); @@ -2534,6 +2534,7 @@ ami_reinit_copper(); do_vmode_full = 0; } + return IRQ_HANDLED; } /* --------------------------- Hardware routines --------------------------- */ diff -Nru a/drivers/video/atafb.c b/drivers/video/atafb.c --- a/drivers/video/atafb.c Tue Nov 19 12:03:56 2002 +++ b/drivers/video/atafb.c Mon Apr 21 01:14:50 2003 @@ -1522,7 +1522,7 @@ } -static void falcon_vbl_switcher( int irq, void *dummy, struct pt_regs *fp ) +static irqreturn_t falcon_vbl_switcher( int irq, void *dummy, struct pt_regs *fp ) { struct falcon_hw *hw = &f_new_mode; @@ -1579,6 +1579,7 @@ videl.xoffset = current_par.hw.falcon.xoffset; shifter_f030.off_next = current_par.hw.falcon.line_offset; } + return IRQ_HANDLED; } diff -Nru a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c --- a/drivers/video/aty/mach64_gx.c Sun Feb 9 15:55:58 2003 +++ b/drivers/video/aty/mach64_gx.c Sat Apr 19 23:22:36 2003 @@ -119,7 +119,7 @@ } static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { /* * FIXME: use real calculations instead of using fixed values from the old @@ -338,7 +338,7 @@ */ static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { u32 MHz100; /* in 0.01 MHz */ u32 program_bits; @@ -494,7 +494,7 @@ */ static int aty_var_to_pll_1703(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u32 vclk_per, u8 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits; @@ -610,7 +610,7 @@ */ static int aty_var_to_pll_8398(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u32 vclk_per, u8 bpp, union aty_pll *pll) { u32 tempA, tempB, fOut, longMHz100, diff, preDiff; @@ -734,7 +734,7 @@ */ static int aty_var_to_pll_408(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits; diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c --- a/drivers/video/console/fbcon.c Thu Apr 10 08:47:57 2003 +++ b/drivers/video/console/fbcon.c Mon Apr 21 01:18:58 2003 @@ -138,7 +138,6 @@ #define DEFAULT_CURSOR_BLINK_RATE (20) static int vbl_cursor_cnt; -static int cursor_blink_rate; #define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1) @@ -185,7 +184,7 @@ */ static int vbl_detected; -static void fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp) { vbl_detected++; } @@ -202,7 +201,9 @@ info->fbops->fb_cursor(info, &info->cursor); } -static void fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp) +#if (defined(__arm__) && defined(IRQ_VSYNCPULSE)) || defined(CONFIG_ATARI) || defined(CONFIG_MAC) +static int cursor_blink_rate; +static irqreturn_t fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp) { struct fb_info *info = dev_id; @@ -210,7 +211,9 @@ schedule_work(&info->queue); vbl_cursor_cnt = cursor_blink_rate; } + return IRQ_HANDLED; } +#endif static void cursor_timer_handler(unsigned long dev_addr); @@ -527,8 +530,9 @@ struct fb_info *info; struct vc_data *vc; static int done = 0; - int irqres = 1; + int irqres; + irqres = 1; /* * If num_registered_fb is zero, this is a call for the dummy part. * The frame buffer devices weren't initialized yet. diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c --- a/drivers/video/fbmem.c Sat Apr 12 17:33:14 2003 +++ b/drivers/video/fbmem.c Sun Apr 20 02:39:53 2003 @@ -25,6 +25,7 @@ #include #include #include +#include #include #ifdef CONFIG_KMOD #include @@ -655,7 +656,7 @@ } /* Return if no suitable logo was found */ - fb_logo.logo = find_logo(info->var.bits_per_pixel); + fb_logo.logo = fb_find_logo(info->var.bits_per_pixel); if (!fb_logo.logo || fb_logo.logo->height > info->var.yres) { fb_logo.logo = NULL; diff -Nru a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c --- a/drivers/video/logo/logo.c Thu Apr 10 07:16:31 2003 +++ b/drivers/video/logo/logo.c Sun Apr 20 02:43:30 2003 @@ -33,7 +33,7 @@ extern const struct linux_logo logo_superh_clut224; -const struct linux_logo * __init find_logo(int depth) +const struct linux_logo *fb_find_logo(int depth) { const struct linux_logo *logo = 0; diff -Nru a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c --- a/drivers/video/pvr2fb.c Tue Feb 25 10:47:18 2003 +++ b/drivers/video/pvr2fb.c Mon Apr 21 01:15:11 2003 @@ -246,7 +246,7 @@ static void pvr2_update_display(void); static void pvr2_init_display(void); static void pvr2_do_blank(void); -static void pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp); +static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp); static int pvr2_init_cable(void); static int pvr2_get_param(const struct pvr2_params *p, const char *s, int val, int size); @@ -939,7 +939,7 @@ is_blanked = do_blank > 0 ? do_blank : 0; } -static void pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp) { if (do_vmode_pan || do_vmode_full) pvr2_update_display(); @@ -958,6 +958,7 @@ if (do_vmode_full) { do_vmode_full = 0; } + return IRQ_HANDLED; } /* diff -Nru a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c --- a/drivers/video/sa1100fb.c Thu Mar 6 08:48:29 2003 +++ b/drivers/video/sa1100fb.c Mon Apr 21 01:15:30 2003 @@ -1395,7 +1395,7 @@ /* * sa1100fb_handle_irq: Handle 'LCD DONE' interrupts. */ -static void sa1100fb_handle_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sa1100fb_handle_irq(int irq, void *dev_id, struct pt_regs *regs) { struct sa1100fb_info *fbi = dev_id; unsigned int lcsr = LCSR; @@ -1406,6 +1406,7 @@ } LCSR = lcsr; + return IRQ_HANDLED; } /* diff -Nru a/fs/Kconfig b/fs/Kconfig --- a/fs/Kconfig Fri Mar 21 10:23:06 2003 +++ b/fs/Kconfig Sun Apr 20 12:56:52 2003 @@ -26,7 +26,7 @@ by about 44 KB. The Ext2fs-Undeletion mini-HOWTO, available from - , gives information about + , gives information about how to retrieve deleted files on ext2fs file systems. To change the behavior of ext2 file systems, you can use the tune2fs @@ -386,7 +386,7 @@ in order to use quota support (you can download sources from ). For further details, read the Quota mini-HOWTO, available from - . Probably the quota + . Probably the quota support is only useful for multi user systems. If unsure, say N. config QFMT_V1 @@ -469,7 +469,7 @@ driver. If you have a CD-ROM drive and want to do more with it than just listen to audio CDs and watch its LEDs, say Y (and read and the CD-ROM-HOWTO, - available from ), thereby + available from ), thereby enlarging your kernel by about 27 KB; otherwise say N. If you want to compile this as a module ( = code which can be @@ -576,7 +576,7 @@ they are compressed; to access compressed MSDOS partitions under Linux, you can either use the DOS emulator DOSEMU, described in the DOSEMU-HOWTO, available from - , or try dmsdosfs in + , or try dmsdosfs in . If you intend to use dosemu with a non-compressed MSDOS partition, say Y here) and MSDOS floppies. This means that file access becomes @@ -1233,7 +1233,7 @@ programs nfsd and mountd (but does not need to have NFS file system support enabled in its kernel). NFS is explained in the Network Administrator's Guide, available from - , on its man page: "man + , on its man page: "man nfs", and in the NFS-HOWTO. A superior but less widely used alternative to NFS is provided by @@ -1298,7 +1298,7 @@ as well. Please read the NFS-HOWTO, available from - . + . The NFS server is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1398,7 +1398,7 @@ works only if the Windows machines use TCP/IP as the underlying transport protocol, and not NetBEUI. For details, read and the SMB-HOWTO, - available from . + available from . Note: if you just want your box to act as an SMB *server* and make files and printing services available to Windows clients (which need @@ -1475,7 +1475,7 @@ to mount NetWare file server volumes and to access them just like any other Unix directory. For details, please read the file in the kernel source and - the IPX-HOWTO from . + the IPX-HOWTO from . You do not have to say Y here if you want your Linux box to act as a file *server* for Novell NetWare clients. diff -Nru a/fs/aio.c b/fs/aio.c --- a/fs/aio.c Sat Mar 22 09:10:34 2003 +++ b/fs/aio.c Sat Apr 19 23:22:38 2003 @@ -148,7 +148,7 @@ dprintk("mmap address: 0x%08lx\n", info->mmap_base); info->nr_pages = get_user_pages(current, ctx->mm, - info->mmap_base, info->mmap_size, + info->mmap_base, nr_pages, 1, 0, info->ring_pages, NULL); up_write(&ctx->mm->mmap_sem); diff -Nru a/fs/block_dev.c b/fs/block_dev.c --- a/fs/block_dev.c Mon Mar 24 10:17:16 2003 +++ b/fs/block_dev.c Sat Apr 19 23:22:49 2003 @@ -559,10 +559,10 @@ bdev->bd_contains = whole; down(&whole->bd_sem); whole->bd_part_count++; - p = disk->part + part - 1; + p = disk->part[part - 1]; bdev->bd_inode->i_data.backing_dev_info = whole->bd_inode->i_data.backing_dev_info; - if (!(disk->flags & GENHD_FL_UP) || !p->nr_sects) { + if (!(disk->flags & GENHD_FL_UP) || !p || !p->nr_sects) { whole->bd_part_count--; up(&whole->bd_sem); ret = -ENXIO; diff -Nru a/fs/buffer.c b/fs/buffer.c --- a/fs/buffer.c Sat Apr 12 16:21:06 2003 +++ b/fs/buffer.c Sat Apr 19 23:22:40 2003 @@ -776,6 +776,85 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode); /* + * Add a page to the dirty page list. + * + * It is a sad fact of life that this function is called from several places + * deeply under spinlocking. It may not sleep. + * + * If the page has buffers, the uptodate buffers are set dirty, to preserve + * dirty-state coherency between the page and the buffers. It the page does + * not have buffers then when they are later attached they will all be set + * dirty. + * + * The buffers are dirtied before the page is dirtied. There's a small race + * window in which a writepage caller may see the page cleanness but not the + * buffer dirtiness. That's fine. If this code were to set the page dirty + * before the buffers, a concurrent writepage caller could clear the page dirty + * bit, see a bunch of clean buffers and we'd end up with dirty buffers/clean + * page on the dirty page list. + * + * There is also a small window where the page is dirty, and not on dirty_pages. + * Also a possibility that by the time the page is added to dirty_pages, it has + * been set clean. The page lists are somewhat approximate in this regard. + * It's better to have clean pages accidentally attached to dirty_pages than to + * leave dirty pages attached to clean_pages. + * + * We use private_lock to lock against try_to_free_buffers while using the + * page's buffer list. Also use this to protect against clean buffers being + * added to the page after it was set dirty. + * + * FIXME: may need to call ->reservepage here as well. That's rather up to the + * address_space though. + * + * For now, we treat swapper_space specially. It doesn't use the normal + * block a_ops. + */ +int __set_page_dirty_buffers(struct page *page) +{ + struct address_space * const mapping = page->mapping; + int ret = 0; + + if (mapping == NULL) { + SetPageDirty(page); + goto out; + } + + if (!PageUptodate(page)) + buffer_error(); + + spin_lock(&mapping->private_lock); + if (page_has_buffers(page)) { + struct buffer_head *head = page_buffers(page); + struct buffer_head *bh = head; + + do { + if (buffer_uptodate(bh)) + set_buffer_dirty(bh); + else + buffer_error(); + bh = bh->b_this_page; + } while (bh != head); + } + spin_unlock(&mapping->private_lock); + + if (!TestSetPageDirty(page)) { + spin_lock(&mapping->page_lock); + if (page->mapping) { /* Race with truncate? */ + if (!mapping->backing_dev_info->memory_backed) + inc_page_state(nr_dirty); + list_del(&page->list); + list_add(&page->list, &mapping->dirty_pages); + } + spin_unlock(&mapping->page_lock); + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + } + +out: + return ret; +} +EXPORT_SYMBOL(__set_page_dirty_buffers); + +/* * Write out and wait upon a list of buffers. * * We have conflicting pressures: we want to make sure that all @@ -916,7 +995,7 @@ head = NULL; offset = PAGE_SIZE; while ((offset -= size) >= 0) { - bh = alloc_buffer_head(); + bh = alloc_buffer_head(GFP_NOFS); if (!bh) goto no_grow; @@ -2267,7 +2346,7 @@ if (buffer_uptodate(&map_bh)) continue; /* reiserfs does this */ if (block_start < from || block_end > to) { - struct buffer_head *bh = alloc_buffer_head(); + struct buffer_head *bh = alloc_buffer_head(GFP_NOFS); if (!bh) { ret = -ENOMEM; @@ -2826,9 +2905,9 @@ buffer_heads_over_limit = (tot > max_buffer_heads); } -struct buffer_head *alloc_buffer_head(void) +struct buffer_head *alloc_buffer_head(int gfp_flags) { - struct buffer_head *ret = kmem_cache_alloc(bh_cachep, GFP_NOFS); + struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); if (ret) { preempt_disable(); __get_cpu_var(bh_accounting).nr++; diff -Nru a/fs/dcache.c b/fs/dcache.c --- a/fs/dcache.c Wed Apr 9 11:44:15 2003 +++ b/fs/dcache.c Sat Apr 19 23:22:23 2003 @@ -155,12 +155,11 @@ if (d_unhashed(dentry)) goto kill_it; if (list_empty(&dentry->d_lru)) { - dentry->d_vfs_flags &= ~DCACHE_REFERENCED; + dentry->d_vfs_flags |= DCACHE_REFERENCED; list_add(&dentry->d_lru, &dentry_unused); dentry_stat.nr_unused++; } spin_unlock(&dentry->d_lock); - dentry->d_vfs_flags |= DCACHE_REFERENCED; spin_unlock(&dcache_lock); return; @@ -250,7 +249,6 @@ static inline struct dentry * __dget_locked(struct dentry *dentry) { atomic_inc(&dentry->d_count); - dentry->d_vfs_flags |= DCACHE_REFERENCED; if (atomic_read(&dentry->d_count) == 1) { dentry_stat.nr_unused--; list_del_init(&dentry->d_lru); @@ -379,17 +377,16 @@ dentry = list_entry(tmp, struct dentry, d_lru); spin_lock(&dentry->d_lock); + /* leave inuse dentries */ + if (atomic_read(&dentry->d_count)) { + spin_unlock(&dentry->d_lock); + continue; + } /* If the dentry was recently referenced, don't free it. */ if (dentry->d_vfs_flags & DCACHE_REFERENCED) { dentry->d_vfs_flags &= ~DCACHE_REFERENCED; - - /* don't add non zero d_count dentries - * back to d_lru list - */ - if (!atomic_read(&dentry->d_count)) { - list_add(&dentry->d_lru, &dentry_unused); - dentry_stat.nr_unused++; - } + list_add(&dentry->d_lru, &dentry_unused); + dentry_stat.nr_unused++; spin_unlock(&dentry->d_lock); continue; } @@ -538,13 +535,18 @@ struct list_head *tmp = next; struct dentry *dentry = list_entry(tmp, struct dentry, d_child); next = tmp->next; - list_del_init(&dentry->d_lru); - /* don't add non zero d_count dentries - * back to d_lru list + if (!list_empty(&dentry->d_lru)) { + dentry_stat.nr_unused--; + list_del_init(&dentry->d_lru); + } + /* + * move only zero ref count dentries to the end + * of the unused list for prune_dcache */ if (!atomic_read(&dentry->d_count)) { list_add(&dentry->d_lru, dentry_unused.prev); + dentry_stat.nr_unused++; found++; } /* @@ -609,13 +611,18 @@ spin_lock(&dcache_lock); hlist_for_each(lp, head) { struct dentry *this = hlist_entry(lp, struct dentry, d_hash); - list_del(&this->d_lru); + if (!list_empty(&this->d_lru)) { + dentry_stat.nr_unused--; + list_del(&this->d_lru); + } - /* don't add non zero d_count dentries - * back to d_lru list + /* + * move only zero ref count dentries to the end + * of the unused list for prune_dcache */ if (!atomic_read(&this->d_count)) { list_add_tail(&this->d_lru, &dentry_unused); + dentry_stat.nr_unused++; found++; } } @@ -1017,7 +1024,6 @@ if (likely(move_count == dentry->d_move_count)) { if (!d_unhashed(dentry)) { atomic_inc(&dentry->d_count); - dentry->d_vfs_flags |= DCACHE_REFERENCED; found = dentry; } } diff -Nru a/fs/devfs/base.c b/fs/devfs/base.c --- a/fs/devfs/base.c Fri Apr 18 08:59:17 2003 +++ b/fs/devfs/base.c Sat Apr 19 14:26:30 2003 @@ -763,7 +763,6 @@ struct bdev_type { - struct block_device_operations *ops; dev_t dev; }; @@ -1442,7 +1441,6 @@ * this to whatever you like, and change it once the file is opened (the next * file opened will not see this change). * - * Returns a handle which may later be used in a call to devfs_unregister(). * On failure %NULL is returned. */ @@ -1457,6 +1455,8 @@ /* we don't accept any flags anymore. prototype will change soon. */ WARN_ON(flags); + WARN_ON(dir); + WARN_ON(!S_ISCHR(mode)); if (name == NULL) { @@ -1491,7 +1491,6 @@ } else if (S_ISBLK (mode)) { de->u.bdev.dev = dev; de->u.cdev.autogen = devnum != 0; - de->u.bdev.ops = ops; } else { PRINTK ("(%s): illegal mode: %x\n", name, mode); devfs_put (de); @@ -1517,6 +1516,52 @@ } /* End Function devfs_register */ +int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) +{ + struct devfs_entry *dir = NULL, *de; + char buf[64]; + va_list args; + int error, n; + + if (!S_ISBLK(mode)) { + printk(KERN_WARNING "%s: invalide mode (%u) for %s\n", + __FUNCTION__, mode, buf); + return -EINVAL; + } + + va_start(args, fmt); + n = vsnprintf(buf, 64, fmt, args); + if (n >= 64 || !buf[0]) { + printk(KERN_WARNING "%s: invalid format string\n", + __FUNCTION__); + return -EINVAL; + } + + de = _devfs_prepare_leaf(&dir, buf, mode); + if (!de) { + printk(KERN_WARNING "%s: could not prepare leaf for %s\n", + __FUNCTION__, buf); + return -ENOMEM; /* could be more accurate... */ + } + + de->u.bdev.dev = dev; + + error = _devfs_append_entry(dir, de, NULL); + if (error) { + printk(KERN_WARNING "%s: could not append to parent for %s\n", + __FUNCTION__, buf); + goto out; + } + + devfsd_notify(de, DEVFSD_NOTIFY_REGISTERED); + out: + devfs_put(dir); + return error; +} + +EXPORT_SYMBOL(devfs_mk_bdev); + + /** * _devfs_unhook - Unhook a device entry from its parents list * @de: The entry to unhook. @@ -1578,24 +1623,6 @@ } } /* End Function _devfs_unregister */ - -/** - * devfs_unregister - Unregister a device entry. - * @de: A handle previously created by devfs_register() or returned from - * devfs_get_handle(). If this is %NULL the routine does nothing. - */ - -void devfs_unregister (devfs_handle_t de) -{ - VERIFY_ENTRY (de); - if ( (de == NULL) || (de->parent == NULL) ) return; - DPRINTK (DEBUG_UNREGISTER, "(%s): de: %p refcount: %d\n", - de->name, de, atomic_read (&de->refcount) ); - write_lock (&de->parent->u.dir.lock); - _devfs_unregister (de->parent, de); - devfs_put (de); -} /* End Function devfs_unregister */ - static int devfs_do_symlink (devfs_handle_t dir, const char *name, const char *link, devfs_handle_t *handle) { @@ -1678,7 +1705,6 @@ * Use of this function is optional. The devfs_register() function * will automatically create intermediate directories as needed. This function * is provided for efficiency reasons, as it provides a handle to a directory. - * Returns a handle which may later be used in a call to devfs_unregister(). * On failure %NULL is returned. */ @@ -1730,7 +1756,10 @@ n = vsnprintf(buf, 64, fmt, args); if (n < 64 && buf[0]) { devfs_handle_t de = _devfs_find_entry(NULL, buf, 0); - devfs_unregister(de); + + write_lock(&de->parent->u.dir.lock); + _devfs_unregister(de->parent, de); + devfs_put(de); devfs_put(de); } } @@ -1863,7 +1892,6 @@ EXPORT_SYMBOL(devfs_put); EXPORT_SYMBOL(devfs_register); -EXPORT_SYMBOL(devfs_unregister); EXPORT_SYMBOL(devfs_mk_symlink); EXPORT_SYMBOL(devfs_mk_dir); EXPORT_SYMBOL(devfs_remove); diff -Nru a/fs/devfs/util.c b/fs/devfs/util.c --- a/fs/devfs/util.c Fri Apr 18 08:58:55 2003 +++ b/fs/devfs/util.c Sat Apr 19 14:26:30 2003 @@ -74,8 +74,6 @@ #include #include "internal.h" -#define PRINTK(format, args...) \ - {printk (KERN_ERR "%s" format, __FUNCTION__ , ## args);} int devfs_register_tape(const char *name) { @@ -255,162 +253,4 @@ } } up(&device_list_mutex); -} - -struct unique_numspace -{ - spinlock_t init_lock; - unsigned char sem_initialised; - unsigned int num_free; /* Num free in bits */ - unsigned int length; /* Array length in bytes */ - unsigned long *bits; - struct semaphore semaphore; -}; - -#define UNIQUE_NUMBERSPACE_INITIALISER {SPIN_LOCK_UNLOCKED, 0, 0, 0, NULL} - - -/** - * devfs_alloc_unique_number - Allocate a unique (positive) number. - * @space: The number space to allocate from. - * - * Returns the allocated unique number, else a negative error code. - * This routine is thread safe and may block. - */ - -int devfs_alloc_unique_number (struct unique_numspace *space) -{ - int number; - unsigned int length; - - /* Get around stupid lack of semaphore initialiser */ - spin_lock (&space->init_lock); - if (!space->sem_initialised) - { - sema_init (&space->semaphore, 1); - space->sem_initialised = 1; - } - spin_unlock (&space->init_lock); - down (&space->semaphore); - if (space->num_free < 1) - { - void *bits; - - if (space->length < 16) length = 16; - else length = space->length << 1; - if ( ( bits = vmalloc (length) ) == NULL ) - { - up (&space->semaphore); - return -ENOMEM; - } - if (space->bits != NULL) - { - memcpy (bits, space->bits, space->length); - vfree (space->bits); - } - space->num_free = (length - space->length) << 3; - space->bits = bits; - memset (bits + space->length, 0, length - space->length); - space->length = length; - } - number = find_first_zero_bit (space->bits, space->length << 3); - --space->num_free; - __set_bit (number, space->bits); - up (&space->semaphore); - return number; -} /* End Function devfs_alloc_unique_number */ -EXPORT_SYMBOL(devfs_alloc_unique_number); - - -/** - * devfs_dealloc_unique_number - Deallocate a unique (positive) number. - * @space: The number space to deallocate from. - * @number: The number to deallocate. - * - * This routine is thread safe and may block. - */ - -void devfs_dealloc_unique_number (struct unique_numspace *space, int number) -{ - int was_set; - - if (number < 0) return; - down (&space->semaphore); - was_set = __test_and_clear_bit (number, space->bits); - if (was_set) ++space->num_free; - up (&space->semaphore); - if (!was_set) PRINTK ("(): number %d was already free\n", number); -} /* End Function devfs_dealloc_unique_number */ -EXPORT_SYMBOL(devfs_dealloc_unique_number); - -static struct unique_numspace disc_numspace = UNIQUE_NUMBERSPACE_INITIALISER; -static struct unique_numspace cdrom_numspace = UNIQUE_NUMBERSPACE_INITIALISER; - -void devfs_create_partitions(struct gendisk *disk) -{ - char dirname[64], diskname[64], symlink[16]; - - if (!disk->devfs_name) - sprintf(disk->devfs_name, "%s/disc%d", disk->disk_name, - disk->first_minor >> disk->minor_shift); - - devfs_mk_dir(disk->devfs_name); - disk->number = devfs_alloc_unique_number(&disc_numspace); - - sprintf(diskname, "%s/disc", disk->devfs_name); - devfs_register(NULL, diskname, 0, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); - - sprintf(symlink, "discs/disc%d", disk->number); - sprintf(dirname, "../%s", disk->devfs_name); - devfs_mk_symlink(symlink, dirname); - -} - -void devfs_create_cdrom(struct gendisk *disk) -{ - char dirname[64], cdname[64], symlink[16]; - - if (!disk->devfs_name) - strcat(disk->devfs_name, disk->disk_name); - - devfs_mk_dir(disk->devfs_name); - disk->number = devfs_alloc_unique_number(&cdrom_numspace); - - sprintf(cdname, "%s/cd", disk->devfs_name); - devfs_register(NULL, cdname, 0, - disk->major, disk->first_minor, - S_IFBLK | S_IRUGO | S_IWUGO, - disk->fops, NULL); - - sprintf(symlink, "cdroms/cdrom%d", disk->number); - sprintf(dirname, "../%s", disk->devfs_name); - devfs_mk_symlink(symlink, dirname); -} - -void devfs_register_partition(struct gendisk *dev, int part) -{ - char devname[64]; - - sprintf(devname, "%s/part%d", dev->devfs_name, part); - devfs_register(NULL, devname, 0, - dev->major, dev->first_minor + part, - S_IFBLK | S_IRUSR | S_IWUSR, - dev->fops, NULL); -} - -void devfs_remove_partitions(struct gendisk *disk) -{ - devfs_remove("discs/disc%d", disk->number); - devfs_remove(disk->devfs_name); - devfs_dealloc_unique_number(&disc_numspace, disk->number); -} - -void devfs_remove_cdrom(struct gendisk *disk) -{ - devfs_remove("cdroms/cdrom%d", disk->number); - devfs_remove(disk->devfs_name); - devfs_dealloc_unique_number(&cdrom_numspace, disk->number); } diff -Nru a/fs/dquot.c b/fs/dquot.c --- a/fs/dquot.c Sat Apr 12 00:30:08 2003 +++ b/fs/dquot.c Sat Apr 19 23:22:37 2003 @@ -345,50 +345,6 @@ return 0; } -static struct super_block *get_super_to_sync(int type) -{ - struct list_head *head; - int cnt, dirty; - -restart: - spin_lock(&sb_lock); - list_for_each(head, &super_blocks) { - struct super_block *sb = list_entry(head, struct super_block, s_list); - - for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++) - if ((type == cnt || type == -1) && sb_has_quota_enabled(sb, cnt) - && info_any_dquot_dirty(&sb_dqopt(sb)->info[cnt])) - dirty = 1; - if (!dirty) - continue; - sb->s_count++; - spin_unlock(&sb_lock); - down_read(&sb->s_umount); - if (!sb->s_root) { - drop_super(sb); - goto restart; - } - return sb; - } - spin_unlock(&sb_lock); - return NULL; -} - -void sync_dquots(struct super_block *sb, int type) -{ - if (sb) { - if (sb->s_qcop->quota_sync) - sb->s_qcop->quota_sync(sb, type); - } - else { - while ((sb = get_super_to_sync(type))) { - if (sb->s_qcop->quota_sync) - sb->s_qcop->quota_sync(sb, type); - drop_super(sb); - } - } -} - /* Free unused dquots from cache */ static void prune_dqcache(int count) { diff -Nru a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c --- a/fs/exportfs/expfs.c Wed Apr 2 22:51:32 2003 +++ b/fs/exportfs/expfs.c Sat Apr 19 23:22:23 2003 @@ -91,7 +91,6 @@ if (dentry != result && acceptable(context, dentry)) { dput(result); - dentry->d_vfs_flags |= DCACHE_REFERENCED; return dentry; } spin_lock(&dcache_lock); @@ -271,7 +270,6 @@ if (dentry != result && acceptable(context, dentry)) { dput(result); - dentry->d_vfs_flags |= DCACHE_REFERENCED; return dentry; } spin_lock(&dcache_lock); @@ -434,7 +432,6 @@ iput(inode); return ERR_PTR(-ENOMEM); } - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/fat/inode.c b/fs/fat/inode.c --- a/fs/fat/inode.c Wed Apr 2 22:51:32 2003 +++ b/fs/fat/inode.c Sat Apr 19 23:22:23 2003 @@ -608,7 +608,6 @@ return ERR_PTR(-ENOMEM); } result->d_op = sb->s_root->d_op; - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/jbd/journal.c b/fs/jbd/journal.c --- a/fs/jbd/journal.c Wed Apr 2 22:51:44 2003 +++ b/fs/jbd/journal.c Sat Apr 19 23:22:40 2003 @@ -457,14 +457,8 @@ /* * Right, time to make up the new buffer_head. */ - do { - new_bh = alloc_buffer_head(); - if (!new_bh) { - printk (KERN_NOTICE "%s: ENOMEM at alloc_buffer_head, " - "trying again.\n", __FUNCTION__); - yield(); - } - } while (!new_bh); + new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL); + /* keep subsequent assertions sane */ new_bh->b_state = 0; init_buffer(new_bh, NULL, NULL); @@ -1613,28 +1607,7 @@ */ void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry) { - void *p; - static unsigned long last_warning; - - while (1) { - p = kmalloc(size, flags); - if (p) - return p; - if (!retry) - return NULL; - /* Log every retry for debugging. Also log them to the - * syslog, but do rate-limiting on the non-debugging - * messages. */ - jbd_debug(1, "ENOMEM in %s, retrying.\n", where); - - if (time_after(jiffies, last_warning + 5*HZ)) { - printk(KERN_NOTICE - "ENOMEM in %s, retrying.\n", where); - last_warning = jiffies; - } - - yield(); - } + return kmalloc(size, flags | (retry ? __GFP_NOFAIL : 0)); } /* diff -Nru a/fs/partitions/Makefile b/fs/partitions/Makefile --- a/fs/partitions/Makefile Thu Mar 6 15:43:48 2003 +++ b/fs/partitions/Makefile Sat Apr 19 14:18:27 2003 @@ -4,6 +4,7 @@ obj-y := check.o +obj-$(CONFIG_DEVFS_FS) += devfs.o obj-$(CONFIG_ACORN_PARTITION) += acorn.o obj-$(CONFIG_AMIGA_PARTITION) += amiga.o obj-$(CONFIG_ATARI_PARTITION) += atari.o diff -Nru a/fs/partitions/check.c b/fs/partitions/check.c --- a/fs/partitions/check.c Fri Apr 18 08:58:55 2003 +++ b/fs/partitions/check.c Sun Apr 20 14:52:10 2003 @@ -19,8 +19,10 @@ #include #include #include +#include #include "check.h" +#include "devfs.h" #include "acorn.h" #include "amiga.h" @@ -94,25 +96,24 @@ char *disk_name(struct gendisk *hd, int part, char *buf) { - if (!part) { #ifdef CONFIG_DEVFS_FS - if (hd->devfs_name) - sprintf(buf, "%s/%s", hd->devfs_name, - (hd->flags & GENHD_FL_CD) ? "cd" : "disc"); - else -#endif - sprintf(buf, "%s", hd->disk_name); - } else { -#ifdef CONFIG_DEVFS_FS - if (hd->devfs_name) + if (hd->devfs_name[0] != '\0') { + if (part) sprintf(buf, "%s/part%d", hd->devfs_name, part); + else if (hd->minors != 1) + sprintf(buf, "%s/disc", hd->devfs_name); else -#endif - if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) - sprintf(buf, "%sp%d", hd->disk_name, part); - else - sprintf(buf, "%s%d", hd->disk_name, part); + sprintf(buf, "%s", hd->devfs_name); + return buf; } +#endif + + if (!part) + sprintf(buf, "%s", hd->disk_name); + else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) + sprintf(buf, "%sp%d", hd->disk_name, part); + else + sprintf(buf, "%s%d", hd->disk_name, part); return buf; } @@ -128,7 +129,7 @@ return NULL; #ifdef CONFIG_DEVFS_FS - if (hd->devfs_name) { + if (hd->devfs_name[0] != '\0') { printk(KERN_INFO " /dev/%s:", hd->devfs_name); sprintf(state->name, "p"); } @@ -182,7 +183,7 @@ static ssize_t part_dev_read(struct hd_struct * p, char *page) { struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj); - int part = p - disk->part + 1; + int part = p->partno; dev_t base = MKDEV(disk->major, disk->first_minor); return sprintf(page, "%04x\n", (unsigned)(base + part)); } @@ -234,7 +235,9 @@ void delete_partition(struct gendisk *disk, int part) { - struct hd_struct *p = disk->part + part - 1; + struct hd_struct *p = disk->part[part-1]; + if (!p) + return; if (!p->nr_sects) return; p->start_sect = 0; @@ -242,15 +245,28 @@ p->reads = p->writes = p->read_sectors = p->write_sectors = 0; devfs_remove("%s/part%d", disk->devfs_name, part); kobject_unregister(&p->kobj); + disk->part[part-1] = NULL; + kfree(p); } void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len) { - struct hd_struct *p = disk->part + part - 1; + struct hd_struct *p; + p = kmalloc(sizeof(*p), GFP_KERNEL); + if (!p) + return; + + memset(p, 0, sizeof(*p)); p->start_sect = start; p->nr_sects = len; - devfs_register_partition(disk, part); + p->partno = part; + disk->part[part-1] = p; + + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor + part), + S_IFBLK|S_IRUSR|S_IWUSR, + "%s/part%d", disk->devfs_name, part); + snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part); p->kobj.parent = &disk->kobj; p->kobj.ktype = &ktype_part; @@ -284,12 +300,12 @@ return; disk_sysfs_symlinks(disk); - if (disk->flags & GENHD_FL_CD) - devfs_create_cdrom(disk); - /* No minors to use for partitions */ - if (disk->minors == 1) + if (disk->minors == 1) { + if (disk->devfs_name[0] != '\0') + devfs_add_disk(disk); return; + } /* No such device (e.g., media were just removed) */ if (!get_capacity(disk)) @@ -299,7 +315,7 @@ if (blkdev_get(bdev, FMODE_READ, 0, BDEV_RAW) < 0) return; state = check_partition(disk, bdev); - devfs_create_partitions(disk); + devfs_add_partitioned(disk); if (state) { for (j = 1; j < state->limit; j++) { sector_t size = state->parts[j].size; @@ -392,10 +408,9 @@ unlink_gendisk(disk); disk_stat_set_all(disk, 0); disk->stamp = disk->stamp_idle = 0; - if (disk->flags & GENHD_FL_CD) - devfs_remove_cdrom(disk); - else - devfs_remove_partitions(disk); + + devfs_remove_disk(disk); + if (disk->driverfs_dev) { sysfs_remove_link(&disk->kobj, "device"); sysfs_remove_link(&disk->driverfs_dev->kobj, "block"); diff -Nru a/fs/partitions/check.h b/fs/partitions/check.h --- a/fs/partitions/check.h Tue Oct 8 11:36:39 2002 +++ b/fs/partitions/check.h Sat Apr 19 23:22:17 2003 @@ -29,3 +29,8 @@ } extern int warn_no_part; + +extern void parse_bsd(struct parsed_partitions *state, + struct block_device *bdev, u32 offset, u32 size, + int origin, char *flavour, int max_partitions); + diff -Nru a/fs/partitions/devfs.c b/fs/partitions/devfs.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/fs/partitions/devfs.c Sat Apr 19 17:57:36 2003 @@ -0,0 +1,134 @@ +/* + * This tries to keep block devices away from devfs as much as possible. + */ +#include +#include +#include +#include +#include +#include + + +struct unique_numspace { + u32 num_free; /* Num free in bits */ + u32 length; /* Array length in bytes */ + unsigned long *bits; + struct semaphore mutex; +}; + +static DECLARE_MUTEX(numspace_mutex); + +static int expand_numspace(struct unique_numspace *s) +{ + u32 length; + void *bits; + + if (s->length < 16) + length = 16; + else + length = s->length << 1; + + bits = vmalloc(length); + if (!bits) + return -ENOMEM; + if (s->bits) { + memcpy(bits, s->bits, s->length); + vfree(s->bits); + } + + s->num_free = (length - s->length) << 3; + s->bits = bits; + memset(bits + s->length, 0, length - s->length); + s->length = length; + + return 0; +} + +static int alloc_unique_number(struct unique_numspace *s) +{ + int rval = 0; + + down(&numspace_mutex); + if (s->num_free < 1) + rval = expand_numspace(s); + if (!rval) { + rval = find_first_zero_bit(s->bits, s->length << 3); + --s->num_free; + __set_bit(rval, s->bits); + } + up(&numspace_mutex); + + return rval; +} + +static void dealloc_unique_number(struct unique_numspace *s, int number) +{ + int old_val; + + if (number >= 0) { + down(&numspace_mutex); + old_val = __test_and_clear_bit(number, s->bits); + if (old_val) + ++s->num_free; + up(&numspace_mutex); + } +} + +static struct unique_numspace disc_numspace; +static struct unique_numspace cdrom_numspace; + +void devfs_add_partitioned(struct gendisk *disk) +{ + char dirname[64], symlink[16]; + + if (disk->devfs_name[0] != '\0') + sprintf(disk->devfs_name, "%s/disc%d", disk->disk_name, + disk->first_minor >> disk->minor_shift); + + devfs_mk_dir(disk->devfs_name); + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor), + S_IFBLK|S_IRUSR|S_IWUSR, + "%s/disc", disk->devfs_name); + + disk->number = alloc_unique_number(&disc_numspace); + + sprintf(symlink, "discs/disc%d", disk->number); + sprintf(dirname, "../%s", disk->devfs_name); + devfs_mk_symlink(symlink, dirname); + +} + +void devfs_add_disk(struct gendisk *disk) +{ + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor), + (disk->flags & GENHD_FL_CD) ? + S_IFBLK|S_IRUGO|S_IWUGO : + S_IFBLK|S_IRUSR|S_IWUSR, + "%s", disk->devfs_name); + + if (disk->flags & GENHD_FL_CD) { + char dirname[64], symlink[16]; + + disk->number = alloc_unique_number(&cdrom_numspace); + + sprintf(symlink, "cdroms/cdrom%d", disk->number); + sprintf(dirname, "../%s", disk->devfs_name); + devfs_mk_symlink(symlink, dirname); + } +} + +void devfs_remove_disk(struct gendisk *disk) +{ + if (disk->minors != 1) { + devfs_remove("discs/disc%d", disk->number); + dealloc_unique_number(&disc_numspace, disk->number); + devfs_remove("%s/disc", disk->devfs_name); + } + if (disk->flags & GENHD_FL_CD) { + devfs_remove("cdroms/cdrom%d", disk->number); + dealloc_unique_number(&cdrom_numspace, disk->number); + } + devfs_remove(disk->devfs_name); +} + + diff -Nru a/fs/partitions/devfs.h b/fs/partitions/devfs.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/fs/partitions/devfs.h Sat Apr 19 13:56:14 2003 @@ -0,0 +1,10 @@ + +#ifdef CONFIG_DEVFS_FS +void devfs_add_disk(struct gendisk *dev); +void devfs_add_partitioned(struct gendisk *dev); +void devfs_remove_disk(struct gendisk *dev); +#else +# define devfs_add_disk(disk) do { } while (0) +# define devfs_add_partitioned(disk) do { } while (0) +# define devfs_remove_disk(disk) do { } while (0) +#endif diff -Nru a/fs/partitions/msdos.c b/fs/partitions/msdos.c --- a/fs/partitions/msdos.c Thu Feb 13 10:15:06 2003 +++ b/fs/partitions/msdos.c Sat Apr 19 23:22:17 2003 @@ -214,12 +214,12 @@ #endif } -#ifdef CONFIG_BSD_DISKLABEL +#if defined(CONFIG_BSD_DISKLABEL) || defined(CONFIG_NEC98_PARTITION) /* * Create devices for BSD partitions listed in a disklabel, under a * dos-like partition. See parse_extended() for more information. */ -static void +void parse_bsd(struct parsed_partitions *state, struct block_device *bdev, u32 offset, u32 size, int origin, char *flavour, int max_partitions) diff -Nru a/fs/partitions/nec98.c b/fs/partitions/nec98.c --- a/fs/partitions/nec98.c Thu Mar 6 15:43:48 2003 +++ b/fs/partitions/nec98.c Sat Apr 19 23:22:17 2003 @@ -66,13 +66,6 @@ return valid; } -#ifdef CONFIG_BSD_DISKLABEL -extern void parse_bsd(struct parsed_partitions *state, - struct block_device *bdev, - u32 offset, u32 size, int origin, char *flavour, - int max_partitions); -#endif - int nec98_partition(struct parsed_partitions *state, struct block_device *bdev) { unsigned int nr; diff -Nru a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c --- a/fs/proc/proc_misc.c Tue Apr 8 07:50:00 2003 +++ b/fs/proc/proc_misc.c Sat Apr 19 23:22:58 2003 @@ -333,6 +333,18 @@ .release = seq_release, }; +extern struct seq_operations diskstats_op; +static int diskstats_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &diskstats_op); +} +static struct file_operations proc_diskstats_operations = { + open: diskstats_open, + read: seq_read, + llseek: seq_lseek, + release: seq_release, +}; + #ifdef CONFIG_MODULES extern struct seq_operations modules_op; static int modules_open(struct inode *inode, struct file *file) @@ -644,6 +656,7 @@ create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); + create_seq_entry("diskstats", 0, &proc_diskstats_operations); #ifdef CONFIG_MODULES create_seq_entry("modules", 0, &proc_modules_operations); #endif diff -Nru a/fs/quota.c b/fs/quota.c --- a/fs/quota.c Sat Mar 22 12:36:49 2003 +++ b/fs/quota.c Sat Apr 19 23:22:37 2003 @@ -19,8 +19,10 @@ { if (type >= MAXQUOTAS) return -EINVAL; + if (!sb && cmd != Q_SYNC) + return -ENODEV; /* Is operation supported? */ - if (!sb->s_qcop) + if (sb && !sb->s_qcop) return -ENOSYS; switch (cmd) { @@ -51,7 +53,7 @@ return -ENOSYS; break; case Q_SYNC: - if (!sb->s_qcop->quota_sync) + if (sb && !sb->s_qcop->quota_sync) return -ENOSYS; break; case Q_XQUOTAON: @@ -102,6 +104,50 @@ return security_quotactl (cmd, type, id, sb); } +static struct super_block *get_super_to_sync(int type) +{ + struct list_head *head; + int cnt, dirty; + +restart: + spin_lock(&sb_lock); + list_for_each(head, &super_blocks) { + struct super_block *sb = list_entry(head, struct super_block, s_list); + + for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++) + if ((type == cnt || type == -1) && sb_has_quota_enabled(sb, cnt) + && info_any_dquot_dirty(&sb_dqopt(sb)->info[cnt])) + dirty = 1; + if (!dirty) + continue; + sb->s_count++; + spin_unlock(&sb_lock); + down_read(&sb->s_umount); + if (!sb->s_root) { + drop_super(sb); + goto restart; + } + return sb; + } + spin_unlock(&sb_lock); + return NULL; +} + +void sync_dquots(struct super_block *sb, int type) +{ + if (sb) { + if (sb->s_qcop->quota_sync) + sb->s_qcop->quota_sync(sb, type); + } + else { + while ((sb = get_super_to_sync(type))) { + if (sb->s_qcop->quota_sync) + sb->s_qcop->quota_sync(sb, type); + drop_super(sb); + } + } +} + /* Copy parameters and call proper function */ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, caddr_t addr) { @@ -167,7 +213,8 @@ return sb->s_qcop->set_dqblk(sb, type, id, &idq); } case Q_SYNC: - return sb->s_qcop->quota_sync(sb, type); + sync_dquots(sb, type); + return 0; case Q_XQUOTAON: case Q_XQUOTAOFF: @@ -222,27 +269,30 @@ struct super_block *sb = NULL; struct block_device *bdev; char *tmp; - int ret = -ENODEV; + int ret; cmds = cmd >> SUBCMDSHIFT; type = cmd & SUBCMDMASK; - tmp = getname(special); - if (IS_ERR(tmp)) - return PTR_ERR(tmp); - bdev = lookup_bdev(tmp); - putname(tmp); - if (IS_ERR(bdev)) - return PTR_ERR(bdev); - sb = get_super(bdev); - bdput(bdev); + if (cmds != Q_SYNC || special) { + tmp = getname(special); + if (IS_ERR(tmp)) + return PTR_ERR(tmp); + bdev = lookup_bdev(tmp); + putname(tmp); + if (IS_ERR(bdev)) + return PTR_ERR(bdev); + sb = get_super(bdev); + bdput(bdev); + if (!sb) + return -ENODEV; + } - if (sb) { - ret = check_quotactl_valid(sb, type, cmds, id); - if (ret >= 0) - ret = do_quotactl(sb, type, cmds, id, addr); + ret = check_quotactl_valid(sb, type, cmds, id); + if (ret >= 0) + ret = do_quotactl(sb, type, cmds, id, addr); + if (sb) drop_super(sb); - } return ret; } diff -Nru a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c --- a/fs/reiserfs/inode.c Wed Apr 2 22:51:32 2003 +++ b/fs/reiserfs/inode.c Sat Apr 19 23:22:23 2003 @@ -1260,7 +1260,6 @@ iput(inode); return ERR_PTR(-ENOMEM); } - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/smbfs/proc.c b/fs/smbfs/proc.c --- a/fs/smbfs/proc.c Wed Apr 2 22:51:32 2003 +++ b/fs/smbfs/proc.c Sat Apr 19 23:22:56 2003 @@ -2085,7 +2085,6 @@ void smb_decode_unix_basic(struct smb_fattr *fattr, char *p) { /* FIXME: verify nls support. all is sent as utf8? */ - __u64 devmajor, devminor; fattr->f_unix = 1; fattr->f_mode = 0; @@ -2112,9 +2111,10 @@ fattr->f_mode |= smb_filetype_to_mode(WVAL(p, 56)); if (S_ISBLK(fattr->f_mode) || S_ISCHR(fattr->f_mode)) { - devmajor = LVAL(p, 60); - devminor = LVAL(p, 68); - fattr->f_rdev = ((devmajor & 0xFF) << 8) | (devminor & 0xFF); + __u64 major = LVAL(p, 60); + __u64 minor = LVAL(p, 68); + + fattr->f_rdev = MKDEV(major & 0xffffffff, minor & 0xffffffff); } fattr->f_mode |= LVAL(p, 84); } @@ -3008,7 +3008,7 @@ */ int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, - int major, int minor) + unsigned int major, unsigned int minor) { struct smb_sb_info *server = server_from_dentry(d); u64 nttime; diff -Nru a/fs/smbfs/proto.h b/fs/smbfs/proto.h --- a/fs/smbfs/proto.h Tue Dec 31 17:21:17 2002 +++ b/fs/smbfs/proto.h Sat Apr 19 23:22:56 2003 @@ -27,7 +27,7 @@ extern void smb_decode_unix_basic(struct smb_fattr *fattr, char *p); extern int smb_proc_getattr(struct dentry *dir, struct smb_fattr *fattr); extern int smb_proc_setattr(struct dentry *dir, struct smb_fattr *fattr); -extern int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, int major, int minor); +extern int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, unsigned int major, unsigned int minor); extern int smb_proc_settime(struct dentry *dentry, struct smb_fattr *fattr); extern int smb_proc_dskattr(struct super_block *sb, struct statfs *attr); extern int smb_proc_read_link(struct smb_sb_info *server, struct dentry *d, char *buffer, int len); diff -Nru a/fs/xfs/linux/xfs_super.c b/fs/xfs/linux/xfs_super.c --- a/fs/xfs/linux/xfs_super.c Mon Apr 7 12:05:43 2003 +++ b/fs/xfs/linux/xfs_super.c Sat Apr 19 23:22:23 2003 @@ -741,7 +741,6 @@ iput(inode); return ERR_PTR(-ENOMEM); } - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c --- a/fs/xfs/pagebuf/page_buf.c Wed Mar 26 10:29:29 2003 +++ b/fs/xfs/pagebuf/page_buf.c Sat Apr 19 23:22:50 2003 @@ -554,7 +554,8 @@ } else if (flags & PBF_MAPPED) { if (as_list_len > 64) purge_addresses(); - pb->pb_addr = vmap(pb->pb_pages, page_count); + pb->pb_addr = vmap(pb->pb_pages, page_count, + VM_MAP, PAGE_KERNEL); if (pb->pb_addr == NULL) return -ENOMEM; pb->pb_addr += pb->pb_offset; diff -Nru a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h --- a/include/asm-alpha/pgalloc.h Mon Dec 30 07:03:59 2002 +++ b/include/asm-alpha/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -40,7 +40,7 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long address) { - pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL); + pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (ret) clear_page(ret); return ret; diff -Nru a/include/asm-arm/arch-adifcc/time.h b/include/asm-arm/arch-adifcc/time.h --- a/include/asm-arm/arch-adifcc/time.h Tue Feb 5 16:06:21 2002 +++ b/include/asm-arm/arch-adifcc/time.h Mon Apr 21 15:43:41 2003 @@ -4,6 +4,6 @@ */ /* - * No on board timer, implemenation @ arch/arm/kernel/xscale-time.c + * No on board timer, implementation @ arch/arm/kernel/xscale-time.c */ diff -Nru a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h --- a/include/asm-arm/arch-clps711x/memory.h Wed Nov 20 16:04:02 2002 +++ b/include/asm-arm/arch-clps711x/memory.h Mon Apr 21 15:43:41 2003 @@ -95,7 +95,7 @@ * Because of the wide memory address space between physical RAM banks on the * SA1100, it's much more convenient to use Linux's NUMA support to implement * our memory map representation. Assuming all memory nodes have equal access - * characteristics, we then have generic discontigous memory support. + * characteristics, we then have generic discontiguous memory support. * * Of course, all this isn't mandatory for SA1100 implementations with only * one used memory bank. For those, simply undefine CONFIG_DISCONTIGMEM. diff -Nru a/include/asm-arm/arch-epxa10db/ether00.h b/include/asm-arm/arch-epxa10db/ether00.h --- a/include/asm-arm/arch-epxa10db/ether00.h Tue Feb 5 16:06:21 2002 +++ b/include/asm-arm/arch-epxa10db/ether00.h Mon Apr 21 15:43:41 2003 @@ -55,7 +55,7 @@ #define ETHER_ARC_SIZE (21) /* -* Regsiter definitions and masks +* Register definitions and masks */ #define ETHER_DMA_CTL(base) (ETHER00_TYPE (base + 0x100)) #define ETHER_DMA_CTL_DMBURST_OFST (2) diff -Nru a/include/asm-arm/arch-epxa10db/pld_conf00.h b/include/asm-arm/arch-epxa10db/pld_conf00.h --- a/include/asm-arm/arch-epxa10db/pld_conf00.h Tue Feb 5 12:29:49 2002 +++ b/include/asm-arm/arch-epxa10db/pld_conf00.h Mon Apr 21 15:43:41 2003 @@ -8,7 +8,7 @@ /* * * This file contains the register definitions for the Excalibur - * Interrupnt controller INT_CTRL00. + * Interrupt controller INT_CTRL00. * * Copyright (C) 2001 Altera Corporation * diff -Nru a/include/asm-arm/arch-integrator/bits.h b/include/asm-arm/arch-integrator/bits.h --- a/include/asm-arm/arch-integrator/bits.h Tue Feb 5 10:02:16 2002 +++ b/include/asm-arm/arch-integrator/bits.h Mon Apr 21 15:43:41 2003 @@ -16,7 +16,7 @@ /* DO NOT EDIT!! - this file automatically generated * from .s file by awk -f s2h.awk */ -/* Bit field defintions +/* Bit field definitions * Copyright (C) ARM Limited 1998. All rights reserved. */ diff -Nru a/include/asm-arm/arch-iop3xx/iop310.h b/include/asm-arm/arch-iop3xx/iop310.h --- a/include/asm-arm/arch-iop3xx/iop310.h Tue Apr 1 03:15:31 2003 +++ b/include/asm-arm/arch-iop3xx/iop310.h Mon Apr 21 15:43:42 2003 @@ -1,7 +1,7 @@ /* * linux/include/asm/arch-iop3xx/iop310.h * - * Intel IOP310 Compainion Chip definitions + * Intel IOP310 Companion Chip definitions * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff -Nru a/include/asm-arm/arch-iop3xx/iop321.h b/include/asm-arm/arch-iop3xx/iop321.h --- a/include/asm-arm/arch-iop3xx/iop321.h Tue Apr 15 08:12:47 2003 +++ b/include/asm-arm/arch-iop3xx/iop321.h Mon Apr 21 04:16:16 2003 @@ -17,12 +17,10 @@ /* * IOP321 I/O and Mem space regions for PCI autoconfiguration */ -#define IOP321_PCI_LOWER_IO 0x90000000 -#define IOP321_PCI_UPPER_IO 0x9000ffff -#define IOP321_PCI_LOWER_MEM 0x80000000 -#define IOP321_PCI_UPPER_MEM 0x83ffffff - -#define IOP321_PCI_WINDOW_SIZE 64 * 0x100000 +#define IOP321_PCI_IO_BASE 0x90000000 +#define IOP321_PCI_IO_SIZE 0x00010000 +#define IOP321_PCI_MEM_BASE 0x40000000 +#define IOP321_PCI_MEM_SIZE 0x40000000 /* * IOP321 chipset registers diff -Nru a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h --- a/include/asm-arm/arch-pxa/pxa-regs.h Mon Feb 17 07:29:52 2003 +++ b/include/asm-arm/arch-pxa/pxa-regs.h Mon Apr 21 15:43:42 2003 @@ -690,9 +690,9 @@ #define ICSR0 __REG(0x40800014) /* ICP Status Register 0 */ #define ICSR1 __REG(0x40800018) /* ICP Status Register 1 */ -#define ICCR0_AME (1 << 7) /* Adress match enable */ +#define ICCR0_AME (1 << 7) /* Address match enable */ #define ICCR0_TIE (1 << 6) /* Transmit FIFO interrupt enable */ -#define ICCR0_RIE (1 << 5) /* Recieve FIFO interrupt enable */ +#define ICCR0_RIE (1 << 5) /* Receive FIFO interrupt enable */ #define ICCR0_RXE (1 << 4) /* Receive enable */ #define ICCR0_TXE (1 << 3) /* Transmit enable */ #define ICCR0_TUS (1 << 2) /* Transmit FIFO underrun select */ diff -Nru a/include/asm-arm/arch-sa1100/graphicsclient.h b/include/asm-arm/arch-sa1100/graphicsclient.h --- a/include/asm-arm/arch-sa1100/graphicsclient.h Tue Feb 19 15:02:20 2002 +++ b/include/asm-arm/arch-sa1100/graphicsclient.h Mon Apr 21 15:43:42 2003 @@ -63,7 +63,7 @@ #define _ADS_UARTC 0x10140000 /* UART C */ #define _ADS_UARTD 0x10160000 /* UART D */ -/* UART controll lines GPIOs */ +/* UART control lines GPIOs */ #define GPIO_GC_UART0_RTS GPIO_GPIO15 #define GPIO_GC_UART1_RTS GPIO_GPIO17 #define GPIO_GC_UART2_RTS GPIO_GPIO19 @@ -71,7 +71,7 @@ #define GPIO_GC_UART1_CTS GPIO_GPIO16 #define GPIO_GC_UART2_CTS GPIO_GPIO17 -/* UART controll lines IRQs */ +/* UART control lines IRQs */ #define IRQ_GC_UART0_CTS IRQ_GPIO14 #define IRQ_GC_UART1_CTS IRQ_GPIO16 #define IRQ_GC_UART2_CTS IRQ_GPIO17 diff -Nru a/include/asm-arm/arch-sa1100/h3600_gpio.h b/include/asm-arm/arch-sa1100/h3600_gpio.h --- a/include/asm-arm/arch-sa1100/h3600_gpio.h Tue Feb 5 16:06:21 2002 +++ b/include/asm-arm/arch-sa1100/h3600_gpio.h Mon Apr 21 15:43:42 2003 @@ -480,7 +480,7 @@ #define _H3800_ASIC1_GPIO_State 0x40 /* R See masks below (default 0) */ #define _H3800_ASIC1_GPIO_Reset 0x42 /* R/W See masks below (default 0x04) */ #define _H3800_ASIC1_GPIO_SleepMask 0x44 /* R/W 0:don't mask, 1:mask trigger in sleep mode */ -#define _H3800_ASIC1_GPIO_SleepDir 0x46 /* R/W direction 0:input, 1:ouput in sleep mode */ +#define _H3800_ASIC1_GPIO_SleepDir 0x46 /* R/W direction 0:input, 1:output in sleep mode */ #define _H3800_ASIC1_GPIO_SleepOut 0x48 /* R/W level 0:low, 1:high in sleep mode */ #define _H3800_ASIC1_GPIO_Status 0x4A /* R Pin status */ #define _H3800_ASIC1_GPIO_BattFaultDir 0x4C /* R/W direction 0:input, 1:output in batt_fault */ diff -Nru a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h --- a/include/asm-arm/arch-sa1100/memory.h Wed Nov 20 16:04:05 2002 +++ b/include/asm-arm/arch-sa1100/memory.h Mon Apr 21 15:43:42 2003 @@ -60,7 +60,7 @@ * Because of the wide memory address space between physical RAM banks on the * SA1100, it's much convenient to use Linux's NUMA support to implement our * memory map representation. Assuming all memory nodes have equal access - * characteristics, we then have generic discontigous memory support. + * characteristics, we then have generic discontiguous memory support. * * Of course, all this isn't mandatory for SA1100 implementations with only * one used memory bank. For those, simply undefine CONFIG_DISCONTIGMEM. diff -Nru a/include/asm-arm/arch-sa1100/uncompress.h b/include/asm-arm/arch-sa1100/uncompress.h --- a/include/asm-arm/arch-sa1100/uncompress.h Mon Feb 4 23:52:37 2002 +++ b/include/asm-arm/arch-sa1100/uncompress.h Mon Apr 21 15:43:43 2003 @@ -32,7 +32,7 @@ } while (0); for (; *s; s++) { - /* wait for space in the UART's transmiter */ + /* wait for space in the UART's transmitter */ while (!(UART(UTSR1) & UTSR1_TNF)); /* send the character out. */ diff -Nru a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h --- a/include/asm-arm/dma-mapping.h Mon Jan 13 08:30:03 2003 +++ b/include/asm-arm/dma-mapping.h Mon Apr 21 15:43:43 2003 @@ -182,7 +182,7 @@ * @dir: DMA transfer direction * * Map a set of buffers described by scatterlist in streaming - * mode for DMA. This is the scather-gather version of the + * mode for DMA. This is the scatter-gather version of the * above pci_map_single interface. Here the scatter gather list * elements are each tagged with the appropriate dma address * and length. They are obtained via sg_dma_{address,length}(SG). diff -Nru a/include/asm-arm/proc-armo/pgalloc.h b/include/asm-arm/proc-armo/pgalloc.h --- a/include/asm-arm/proc-armo/pgalloc.h Sun Mar 10 04:04:31 2002 +++ b/include/asm-arm/proc-armo/pgalloc.h Mon Apr 21 15:43:43 2003 @@ -37,7 +37,7 @@ /* * We use the old 2.5.5-rmk1 hack for this. - * This is not truely correct, but should be functional. + * This is not truly correct, but should be functional. */ #define pte_alloc_one(mm,addr) ((struct page *)pte_alloc_one_kernel(mm,addr)) #define pte_free(pte) pte_free_kernel((pte_t *)pte) diff -Nru a/include/asm-arm/proc-armv/pgalloc.h b/include/asm-arm/proc-armv/pgalloc.h --- a/include/asm-arm/proc-armv/pgalloc.h Sun Nov 17 11:16:37 2002 +++ b/include/asm-arm/proc-armv/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -27,17 +27,9 @@ static inline pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { - int count = 0; pte_t *pte; - do { - pte = (pte_t *)__get_free_page(GFP_KERNEL); - if (!pte) { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); - + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) { clear_page(pte); clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE); @@ -51,16 +43,8 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) { struct page *pte; - int count = 0; - - do { - pte = alloc_pages(GFP_KERNEL, 0); - if (!pte) { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); if (pte) { void *page = page_address(pte); clear_page(page); diff -Nru a/include/asm-arm/sizes.h b/include/asm-arm/sizes.h --- a/include/asm-arm/sizes.h Mon Feb 4 23:55:11 2002 +++ b/include/asm-arm/sizes.h Mon Apr 21 15:43:43 2003 @@ -16,7 +16,7 @@ /* DO NOT EDIT!! - this file automatically generated * from .s file by awk -f s2h.awk */ -/* Size defintions +/* Size definitions * Copyright (C) ARM Limited 1998. All rights reserved. */ diff -Nru a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h --- a/include/asm-cris/pgalloc.h Tue Feb 5 07:24:38 2002 +++ b/include/asm-cris/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -62,7 +62,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; diff -Nru a/include/asm-i386/arch_hooks.h b/include/asm-i386/arch_hooks.h --- a/include/asm-i386/arch_hooks.h Sun Mar 10 19:00:12 2002 +++ b/include/asm-i386/arch_hooks.h Sun Apr 20 14:14:29 2003 @@ -1,6 +1,8 @@ #ifndef _ASM_ARCH_HOOKS_H #define _ASM_ARCH_HOOKS_H +#include + /* * linux/include/asm/arch_hooks.h * @@ -12,7 +14,7 @@ extern void init_ISA_irqs(void); extern void apic_intr_init(void); extern void smp_intr_init(void); -extern void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* these are the defined hooks */ extern void intr_init_hook(void); diff -Nru a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h --- a/include/asm-i386/bugs.h Sun Dec 22 04:16:24 2002 +++ b/include/asm-i386/bugs.h Sun Apr 20 12:24:22 2003 @@ -200,6 +200,8 @@ #endif } +extern void alternative_instructions(void); + static void __init check_bugs(void) { identify_cpu(&boot_cpu_data); @@ -212,4 +214,5 @@ check_hlt(); check_popad(); system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); + alternative_instructions(); } diff -Nru a/include/asm-i386/div64.h b/include/asm-i386/div64.h --- a/include/asm-i386/div64.h Tue Feb 5 09:39:44 2002 +++ b/include/asm-i386/div64.h Sat Apr 19 23:22:26 2003 @@ -14,4 +14,22 @@ __mod; \ }) +/* + * (long)X = ((long long)divs) / (long)div + * (long)rem = ((long long)divs) % (long)div + * + * Warning, this will do an exception if X overflows. + */ +#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c) + +extern inline long +div_ll_X_l_rem(long long divs, long div, long *rem) +{ + long dum2; + __asm__("divl %2":"=a"(dum2), "=d"(*rem) + : "rm"(div), "A"(divs)); + + return dum2; + +} #endif diff -Nru a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h --- a/include/asm-i386/floppy.h Mon Mar 31 15:55:40 2003 +++ b/include/asm-i386/floppy.h Sun Apr 20 14:14:29 2003 @@ -51,7 +51,7 @@ static int virtual_dma_mode; static int doing_pdma; -static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) { register unsigned char st; @@ -63,10 +63,8 @@ static int bytes=0; static int dma_wait=0; #endif - if(!doing_pdma) { - floppy_interrupt(irq, dev_id, regs); - return; - } + if (!doing_pdma) + return floppy_interrupt(irq, dev_id, regs); #ifdef TRACE_FLPY_INT if(!calls) @@ -130,7 +128,7 @@ calls++; #endif if(st == 0x20) - return; + return IRQ_HANDLED; if(!(st & 0x20)) { virtual_dma_residue += virtual_dma_count; virtual_dma_count=0; @@ -143,12 +141,13 @@ #endif doing_pdma = 0; floppy_interrupt(irq, dev_id, regs); - return; + return IRQ_HANDLED; } #ifdef TRACE_FLPY_INT if(!virtual_dma_count) dma_wait++; #endif + return IRQ_HANDLED; } static void fd_disable_dma(void) diff -Nru a/include/asm-i386/system.h b/include/asm-i386/system.h --- a/include/asm-i386/system.h Mon Apr 14 16:07:57 2003 +++ b/include/asm-i386/system.h Sun Apr 20 12:24:22 2003 @@ -4,6 +4,7 @@ #include #include #include +#include #include /* for LOCK_PREFIX */ #ifdef __KERNEL__ @@ -276,6 +277,37 @@ /* Compiling for a 386 proper. Is it worth implementing via cli/sti? */ #endif +struct alt_instr { + u8 *instr; /* original instruction */ + u8 cpuid; /* cpuid bit set for replacement */ + u8 instrlen; /* length of original instruction */ + u8 replacementlen; /* length of new instruction, <= instrlen */ + u8 replacement[0]; /* new instruction */ +}; + +/* + * Alternative instructions for different CPU types or capabilities. + * + * This allows to use optimized instructions even on generic binary + * kernels. + * + * length of oldinstr must be longer or equal the length of newinstr + * It can be padded with nops as needed. + * + * For non barrier like inlines please define new variants + * without volatile and memory clobber. + */ +#define alternative(oldinstr, newinstr, feature) \ + asm volatile ("661:\n\t" oldinstr "\n662:\n" \ + ".section .altinstructions,\"a\"\n" \ + " .align 4\n" \ + " .long 661b\n" /* label */ \ + " .byte %c0\n" /* feature bit */ \ + " .byte 662b-661b\n" /* sourcelen */ \ + " .byte 664f-663f\n" /* replacementlen */ \ + "663:\n\t" newinstr "\n664:\n" /* replacement */ \ + ".previous" :: "i" (feature) : "memory") + /* * Force strict CPU ordering. * And yes, this is required on UP too when we're talking @@ -294,13 +326,15 @@ * nop for these. */ -#ifdef CONFIG_X86_SSE2 -#define mb() asm volatile("mfence" ::: "memory") -#define rmb() asm volatile("lfence" ::: "memory") -#else -#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory") -#define rmb() mb() -#endif + +/* + * Actually only lfence would be needed for mb() because all stores done + * by the kernel should be already ordered. But keep a full barrier for now. + */ + +#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2) +#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2) + /** * read_barrier_depends - Flush all pending reads that subsequents reads * depend on. @@ -356,7 +390,9 @@ #define read_barrier_depends() do { } while(0) #ifdef CONFIG_X86_OOSTORE -#define wmb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory") +/* Actually there are no OOO store capable CPUs for now that do SSE, + but make it already an possibility. */ +#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM) #else #define wmb() __asm__ __volatile__ ("": : :"memory") #endif diff -Nru a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h --- a/include/asm-ia64/pgalloc.h Tue Aug 27 13:04:10 2002 +++ b/include/asm-ia64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -93,7 +93,7 @@ static inline pmd_t* pmd_alloc_one (struct mm_struct *mm, unsigned long addr) { - pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL); + pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (likely(pmd != NULL)) clear_page(pmd); @@ -125,7 +125,7 @@ static inline struct page * pte_alloc_one (struct mm_struct *mm, unsigned long addr) { - struct page *pte = alloc_pages(GFP_KERNEL, 0); + struct page *pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); if (likely(pte != NULL)) clear_page(page_address(pte)); @@ -135,7 +135,7 @@ static inline pte_t * pte_alloc_one_kernel (struct mm_struct *mm, unsigned long addr) { - pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (likely(pte != NULL)) clear_page(pte); diff -Nru a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h --- a/include/asm-m68k/motorola_pgalloc.h Wed Jan 8 12:37:27 2003 +++ b/include/asm-m68k/motorola_pgalloc.h Sat Apr 19 23:22:41 2003 @@ -11,7 +11,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) { clear_page(pte); __flush_page_to_ram(pte); @@ -30,7 +30,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - struct page *page = alloc_pages(GFP_KERNEL, 0); + struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); pte_t *pte; if(!page) diff -Nru a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h --- a/include/asm-m68k/sun3_pgalloc.h Wed Jan 8 12:37:27 2003 +++ b/include/asm-m68k/sun3_pgalloc.h Sat Apr 19 23:22:43 2003 @@ -18,7 +18,7 @@ extern const char bad_pmd_string[]; -#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) +#define lpmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) static inline void pte_free_kernel(pte_t * pte) @@ -39,7 +39,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - unsigned long page = __get_free_page(GFP_KERNEL); + unsigned long page = __get_free_page(GFP_KERNEL|__GFP_REPEAT); if (!page) return NULL; @@ -51,7 +51,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - struct page *page = alloc_pages(GFP_KERNEL, 0); + struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); if (page == NULL) return NULL; diff -Nru a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h --- a/include/asm-mips/pgalloc.h Tue Feb 5 07:24:35 2002 +++ b/include/asm-mips/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -132,7 +132,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *) __get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; diff -Nru a/include/asm-mips64/pgalloc.h b/include/asm-mips64/pgalloc.h --- a/include/asm-mips64/pgalloc.h Tue Feb 5 07:24:35 2002 +++ b/include/asm-mips64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -93,7 +93,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; @@ -141,7 +141,7 @@ { pmd_t *pmd; - pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, 1); + pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT, 1); if (pmd) pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); return pmd; diff -Nru a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h --- a/include/asm-parisc/pgalloc.h Mon Jul 22 02:42:24 2002 +++ b/include/asm-parisc/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -35,7 +35,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) { - pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL); + pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pmd) clear_page(pmd); return pmd; @@ -73,7 +73,7 @@ static inline struct page * pte_alloc_one(struct mm_struct *mm, unsigned long address) { - struct page *page = alloc_page(GFP_KERNEL); + struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT); if (likely(page != NULL)) clear_page(page_address(page)); return page; @@ -82,7 +82,7 @@ static inline pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { - pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (likely(pte != NULL)) clear_page(pte); return pte; diff -Nru a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h --- a/include/asm-ppc64/pgalloc.h Fri Sep 13 03:36:28 2002 +++ b/include/asm-ppc64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -31,19 +31,11 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long addr) { - int count = 0; pmd_t *pmd; - do { - pmd = (pmd_t *)__get_free_page(GFP_KERNEL); - if (pmd) - clear_page(pmd); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pmd && (count++ < 10)); - + pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pmd) + clear_page(pmd); return pmd; } @@ -62,19 +54,11 @@ static inline pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { - int count = 0; pte_t *pte; - do { - pte = (pte_t *)__get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); - + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte) + clear_page(pte); return pte; } diff -Nru a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h --- a/include/asm-s390/pgalloc.h Mon Apr 14 12:11:58 2003 +++ b/include/asm-s390/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -120,20 +120,13 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long vmaddr) { pte_t *pte; - int count; int i; - count = 0; - do { - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte != NULL) { - for (i=0; i < PTRS_PER_PTE; i++) - pte_clear(pte+i); - } else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte != NULL) { + for (i=0; i < PTRS_PER_PTE; i++) + pte_clear(pte+i); + } return pte; } diff -Nru a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h --- a/include/asm-sh/pgalloc.h Fri May 3 04:27:09 2002 +++ b/include/asm-sh/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -35,7 +35,7 @@ static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; diff -Nru a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h --- a/include/asm-sparc/irq.h Tue Nov 26 20:27:25 2002 +++ b/include/asm-sparc/irq.h Sun Apr 20 23:43:43 2003 @@ -10,6 +10,7 @@ #include #include #include /* For NR_CPUS */ +#include #include /* For SUN4M_NCPUS */ #include @@ -47,8 +48,8 @@ #define clear_profile_irq(cpu) BTFIXUP_CALL(clear_profile_irq)(cpu) #define load_profile_irq(cpu,limit) BTFIXUP_CALL(load_profile_irq)(cpu,limit) -extern void (*sparc_init_timers)(void (*lvl10_irq)(int, void *, struct pt_regs *)); -extern void claim_ticker14(void (*irq_handler)(int, void *, struct pt_regs *), +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 *), int irq, unsigned int timeout); @@ -62,7 +63,7 @@ #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) #endif -extern int request_fast_irq(unsigned int irq, void (*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 *, struct pt_regs *), unsigned long flags, __const__ char *devname); /* On the sun4m, just like the timers, we have both per-cpu and master * interrupt registers. diff -Nru a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h --- a/include/asm-sparc/signal.h Wed Apr 9 15:00:18 2003 +++ b/include/asm-sparc/signal.h Sun Apr 20 22:05:10 2003 @@ -118,10 +118,10 @@ }; /* Sigvec flags */ -#define SV_SSTACK 1u /* This signal handler should use sig-stack */ -#define SV_INTR 2u /* Sig return should not restart system call */ -#define SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */ -#define SV_IGNCHILD 8u /* Do not send SIGCHLD */ +#define _SV_SSTACK 1u /* This signal handler should use sig-stack */ +#define _SV_INTR 2u /* Sig return should not restart system call */ +#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */ +#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */ /* * sa_flags values: SA_STACK is not currently supported, but will allow the @@ -132,11 +132,11 @@ * SA_RESTART flag to get restarting signals (which were the default long ago) * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. */ -#define SA_NOCLDSTOP SV_IGNCHILD -#define SA_STACK SV_SSTACK -#define SA_ONSTACK SV_SSTACK -#define SA_RESTART SV_INTR -#define SA_ONESHOT SV_RESET +#define SA_NOCLDSTOP _SV_IGNCHILD +#define SA_STACK _SV_SSTACK +#define SA_ONSTACK _SV_SSTACK +#define SA_RESTART _SV_INTR +#define SA_ONESHOT _SV_RESET #define SA_INTERRUPT 0x10u #define SA_NOMASK 0x20u #define SA_SHIRQ 0x40u diff -Nru a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h --- a/include/asm-sparc64/irq.h Wed Mar 12 03:53:15 2003 +++ b/include/asm-sparc64/irq.h Sun Apr 20 23:43:43 2003 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -128,7 +129,7 @@ #endif extern int request_fast_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, __const__ char *devname, void *dev_id); diff -Nru a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h --- a/include/asm-sparc64/pgalloc.h Mon Aug 26 17:10:23 2002 +++ b/include/asm-sparc64/pgalloc.h Sun Apr 20 18:28:00 2003 @@ -71,7 +71,7 @@ struct page *page; preempt_enable(); - page = alloc_page(GFP_KERNEL); + page = alloc_page(GFP_KERNEL|__GFP_REPEAT); if (page) { ret = (struct page *)page_address(page); clear_page(ret); @@ -110,7 +110,7 @@ preempt_enable(); } else { preempt_enable(); - ret = (unsigned long *) __get_free_page(GFP_KERNEL); + ret = (unsigned long *) __get_free_page(GFP_KERNEL|__GFP_REPEAT); if(ret) memset(ret, 0, PAGE_SIZE); } @@ -159,7 +159,7 @@ pmd = pmd_alloc_one_fast(mm, address); if (!pmd) { - pmd = (pmd_t *)__get_free_page(GFP_KERNEL); + pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pmd) memset(pmd, 0, PAGE_SIZE); } diff -Nru a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h --- a/include/asm-sparc64/signal.h Wed Apr 9 15:00:18 2003 +++ b/include/asm-sparc64/signal.h Sun Apr 20 22:05:10 2003 @@ -123,10 +123,10 @@ }; /* Sigvec flags */ -#define SV_SSTACK 1u /* This signal handler should use sig-stack */ -#define SV_INTR 2u /* Sig return should not restart system call */ -#define SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */ -#define SV_IGNCHILD 8u /* Do not send SIGCHLD */ +#define _SV_SSTACK 1u /* This signal handler should use sig-stack */ +#define _SV_INTR 2u /* Sig return should not restart system call */ +#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */ +#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */ /* * sa_flags values: SA_STACK is not currently supported, but will allow the @@ -137,11 +137,11 @@ * SA_RESTART flag to get restarting signals (which were the default long ago) * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. */ -#define SA_NOCLDSTOP SV_IGNCHILD -#define SA_STACK SV_SSTACK -#define SA_ONSTACK SV_SSTACK -#define SA_RESTART SV_INTR -#define SA_ONESHOT SV_RESET +#define SA_NOCLDSTOP _SV_IGNCHILD +#define SA_STACK _SV_SSTACK +#define SA_ONSTACK _SV_SSTACK +#define SA_RESTART _SV_INTR +#define SA_ONESHOT _SV_RESET #define SA_INTERRUPT 0x10u #define SA_NOMASK 0x20u #define SA_SHIRQ 0x40u diff -Nru a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h --- a/include/asm-sparc64/timer.h Wed Mar 26 00:49:46 2003 +++ b/include/asm-sparc64/timer.h Sun Apr 20 23:43:43 2003 @@ -7,6 +7,8 @@ #ifndef _SPARC64_TIMER_H #define _SPARC64_TIMER_H +#include + /* How timers work: * * On uniprocessors we just use counter zero for the system wide @@ -63,6 +65,7 @@ #ifdef CONFIG_SMP extern unsigned long timer_tick_offset; +struct pt_regs; extern void timer_tick_interrupt(struct pt_regs *); #endif diff -Nru a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h --- a/include/asm-x86_64/pgalloc.h Tue Jan 28 08:48:34 2003 +++ b/include/asm-x86_64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -31,12 +31,12 @@ static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr) { - return (pmd_t *) get_zeroed_page(GFP_KERNEL); + return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); } static inline pgd_t *pgd_alloc (struct mm_struct *mm) { - return (pgd_t *)get_zeroed_page(GFP_KERNEL); + return (pgd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); } static inline void pgd_free (pgd_t *pgd) @@ -48,12 +48,12 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - return (pte_t *) get_zeroed_page(GFP_KERNEL); + return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); } static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - void *p = (void *)get_zeroed_page(GFP_KERNEL); + void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); if (!p) return NULL; return virt_to_page(p); diff -Nru a/include/linux/8250_pci.h b/include/linux/8250_pci.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/linux/8250_pci.h Mon Apr 21 02:00:20 2003 @@ -0,0 +1,2 @@ +int pci_siig10x_fn(struct pci_dev *dev, int enable); +int pci_siig20x_fn(struct pci_dev *dev, int enable); diff -Nru a/include/linux/blk.h b/include/linux/blk.h --- a/include/linux/blk.h Mon Oct 28 11:57:56 2002 +++ b/include/linux/blk.h Sun Apr 20 09:15:03 2003 @@ -12,24 +12,6 @@ extern void add_disk_randomness(struct gendisk *disk); extern void rand_initialize_disk(struct gendisk *disk); -#ifdef CONFIG_BLK_DEV_RAM - -extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */ -extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */ -extern int rd_image_start; /* starting block # of image */ - -#ifdef CONFIG_BLK_DEV_INITRD - -#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */ - -extern unsigned long initrd_start,initrd_end; -extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < memory_start */ -void initrd_init(void); - -#endif /* CONFIG_BLK_DEV_INITRD */ - -#endif - /* * end_request() and friends. Must be called with the request queue spinlock * acquired. All functions called within end_request() _must_be_ atomic. diff -Nru a/include/linux/blkdev.h b/include/linux/blkdev.h --- a/include/linux/blkdev.h Mon Apr 7 06:36:32 2003 +++ b/include/linux/blkdev.h Sun Apr 20 09:20:10 2003 @@ -341,7 +341,7 @@ extern void blk_start_queue(request_queue_t *q); extern void blk_stop_queue(request_queue_t *q); extern void __blk_stop_queue(request_queue_t *q); -extern void __blk_run_queue(request_queue_t *q); +extern void blk_run_queue(request_queue_t *q); static inline request_queue_t *bdev_get_queue(struct block_device *bdev) { diff -Nru a/include/linux/buffer_head.h b/include/linux/buffer_head.h --- a/include/linux/buffer_head.h Thu Mar 27 21:15:06 2003 +++ b/include/linux/buffer_head.h Sat Apr 19 23:22:40 2003 @@ -172,7 +172,7 @@ void __brelse(struct buffer_head *); void __bforget(struct buffer_head *); struct buffer_head *__bread(struct block_device *, sector_t block, int size); -struct buffer_head *alloc_buffer_head(void); +struct buffer_head *alloc_buffer_head(int gfp_flags); void free_buffer_head(struct buffer_head * bh); void FASTCALL(unlock_buffer(struct buffer_head *bh)); void ll_rw_block(int, int, struct buffer_head * bh[]); diff -Nru a/include/linux/dcache.h b/include/linux/dcache.h --- a/include/linux/dcache.h Wed Apr 2 22:51:32 2003 +++ b/include/linux/dcache.h Sat Apr 19 23:22:23 2003 @@ -270,7 +270,6 @@ if (!atomic_read(&dentry->d_count)) BUG(); atomic_inc(&dentry->d_count); - dentry->d_vfs_flags |= DCACHE_REFERENCED; } return dentry; } diff -Nru a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h --- a/include/linux/devfs_fs_kernel.h Fri Apr 18 08:59:17 2003 +++ b/include/linux/devfs_fs_kernel.h Sat Apr 19 14:18:27 2003 @@ -25,7 +25,8 @@ unsigned int flags, unsigned int major, unsigned int minor, umode_t mode, void *ops, void *info); -extern void devfs_unregister (devfs_handle_t de); +extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) + __attribute__((format (printf, 3, 4))); extern int devfs_mk_symlink (const char *name, const char *link); extern devfs_handle_t devfs_mk_dir(const char *fmt, ...) __attribute__((format (printf, 1, 2))); @@ -33,10 +34,6 @@ __attribute__((format (printf, 1, 2))); extern int devfs_register_tape(const char *name); extern void devfs_unregister_tape(int num); -extern void devfs_create_partitions(struct gendisk *dev); -extern void devfs_create_cdrom(struct gendisk *dev); -extern void devfs_remove_partitions(struct gendisk *dev); -extern void devfs_remove_cdrom(struct gendisk *dev); extern void devfs_register_partition(struct gendisk *dev, int part); extern void mount_devfs_fs(void); #else /* CONFIG_DEVFS_FS */ @@ -50,9 +47,9 @@ { return NULL; } -static inline void devfs_unregister (devfs_handle_t de) +static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) { - return; + return 0; } static inline int devfs_mk_symlink (const char *name, const char *link) { @@ -70,18 +67,6 @@ return -1; } static inline void devfs_unregister_tape(int num) -{ -} -static inline void devfs_create_partitions(struct gendisk *dev) -{ -} -static inline void devfs_create_cdrom(struct gendisk *dev) -{ -} -static inline void devfs_remove_partitions(struct gendisk *dev) -{ -} -static inline void devfs_remove_cdrom(struct gendisk *dev) { } static inline void devfs_register_partition(struct gendisk *dev, int part) diff -Nru a/include/linux/eeprom.h b/include/linux/eeprom.h --- a/include/linux/eeprom.h Mon Feb 4 23:45:39 2002 +++ b/include/linux/eeprom.h Sun Apr 20 21:58:28 2003 @@ -59,7 +59,7 @@ /* foo. put this in a .c file */ static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol) { - long flags; + unsigned long flags; u32 data; spin_lock_irqsave(ee->lock, flags); diff -Nru a/include/linux/genhd.h b/include/linux/genhd.h --- a/include/linux/genhd.h Fri Apr 18 08:58:55 2003 +++ b/include/linux/genhd.h Sat Apr 19 23:22:49 2003 @@ -64,7 +64,7 @@ sector_t nr_sects; struct kobject kobj; unsigned reads, read_sectors, writes, write_sectors; - int policy; + int policy, partno; }; #define GENHD_FL_REMOVABLE 1 @@ -89,7 +89,7 @@ int minor_shift; /* number of times minor is shifted to get real minor */ char disk_name[16]; /* name of major driver */ - struct hd_struct *part; /* [indexed by minor] */ + struct hd_struct **part; /* [indexed by minor] */ struct block_device_operations *fops; struct request_queue *queue; void *private_data; diff -Nru a/include/linux/gfp.h b/include/linux/gfp.h --- a/include/linux/gfp.h Sun Mar 2 18:14:26 2003 +++ b/include/linux/gfp.h Sat Apr 19 23:22:40 2003 @@ -11,13 +11,26 @@ #define __GFP_DMA 0x01 #define __GFP_HIGHMEM 0x02 -/* Action modifiers - doesn't change the zoning */ +/* + * Action modifiers - doesn't change the zoning + * + * __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt + * _might_ fail. This depends upon the particular VM implementation. + * + * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller + * cannot handle allocation failures. + * + * __GFP_NORETRY: The VM implementation must not retry indefinitely. + */ #define __GFP_WAIT 0x10 /* Can wait and reschedule? */ #define __GFP_HIGH 0x20 /* Should access emergency pools? */ #define __GFP_IO 0x40 /* Can start physical IO? */ #define __GFP_FS 0x80 /* Can call down to low-level FS? */ #define __GFP_COLD 0x100 /* Cache-cold page required */ #define __GFP_NOWARN 0x200 /* Suppress page allocation failure warning */ +#define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */ +#define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */ +#define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */ #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) diff -Nru a/include/linux/ide.h b/include/linux/ide.h --- a/include/linux/ide.h Fri Apr 18 08:58:55 2003 +++ b/include/linux/ide.h Sun Apr 20 14:14:29 2003 @@ -1568,7 +1568,7 @@ extern int ide_spin_wait_hwgroup(ide_drive_t *); extern void ide_timer_expiry(unsigned long); -extern void ide_intr(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t ide_intr(int irq, void *dev_id, struct pt_regs *regs); extern void do_ide_request(request_queue_t *); extern void ide_init_subdrivers(void); diff -Nru a/include/linux/initrd.h b/include/linux/initrd.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/linux/initrd.h Sun Apr 20 13:15:58 2003 @@ -0,0 +1,16 @@ + +#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */ + +/* 1 = load ramdisk, 0 = don't load */ +extern int rd_doload; + +/* 1 = prompt for ramdisk, 0 = don't prompt */ +extern int rd_prompt; + +/* starting block # of image */ +extern int rd_image_start; + +/* 1 if it is not an error if initrd_start < memory_start */ +extern int initrd_below_start_ok; + +extern unsigned long initrd_start, initrd_end; diff -Nru a/include/linux/input.h b/include/linux/input.h --- a/include/linux/input.h Wed Feb 12 01:41:01 2003 +++ b/include/linux/input.h Sat Apr 19 02:49:04 2003 @@ -895,8 +895,8 @@ int input_accept_process(struct input_handle *handle, struct file *file); int input_flush_device(struct input_handle* handle, struct file* file); -devfs_handle_t input_register_minor(char *name, int minor, int minor_base); -void input_unregister_minor(devfs_handle_t handle); +/* will go away once devfs_register gets sanitized */ +void input_register_minor(char *name, int minor, int minor_base); void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); diff -Nru a/include/linux/interrupt.h b/include/linux/interrupt.h --- a/include/linux/interrupt.h Mon Apr 14 12:11:44 2003 +++ b/include/linux/interrupt.h Mon Apr 21 13:10:42 2003 @@ -11,8 +11,28 @@ #include #include +/* + * For 2.4.x compatibility, 2.4.x can use + * + * typedef void irqreturn_t; + * #define IRQ_NONE + * #define IRQ_HANDLED + * #define IRQ_RETVAL(x) + * + * To mix old-style and new-style irq handler returns. + * + * IRQ_NONE means we didn't handle it. + * IRQ_HANDLED means that we did have a valid interrupt and handled it. + * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled) + */ +typedef int irqreturn_t; + +#define IRQ_NONE (0) +#define IRQ_HANDLED (1) +#define IRQ_RETVAL(x) ((x) != 0) + struct irqaction { - void (*handler)(int, void *, struct pt_regs *); + irqreturn_t (*handler)(int, void *, struct pt_regs *); unsigned long flags; unsigned long mask; const char *name; @@ -20,8 +40,9 @@ struct irqaction *next; }; +extern irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs); extern int request_irq(unsigned int, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long, const char *, void *); extern void free_irq(unsigned int, void *); diff -Nru a/include/linux/irq.h b/include/linux/irq.h --- a/include/linux/irq.h Mon May 27 05:07:35 2002 +++ b/include/linux/irq.h Sun Apr 20 14:14:29 2003 @@ -72,7 +72,6 @@ extern int setup_irq(unsigned int , struct irqaction * ); extern hw_irq_controller no_irq_type; /* needed in every arch ? */ -extern void no_action(int cpl, void *dev_id, struct pt_regs *regs); #endif diff -Nru a/include/linux/linux_logo.h b/include/linux/linux_logo.h --- a/include/linux/linux_logo.h Tue Mar 25 17:25:37 2003 +++ b/include/linux/linux_logo.h Sun Apr 20 02:43:12 2003 @@ -32,6 +32,6 @@ const unsigned char *data; }; -extern const struct linux_logo * __init find_logo(int depth); +extern const struct linux_logo *fb_find_logo(int depth); #endif /* _LINUX_LINUX_LOGO_H */ diff -Nru a/include/linux/miscdevice.h b/include/linux/miscdevice.h --- a/include/linux/miscdevice.h Tue Jan 14 09:53:18 2003 +++ b/include/linux/miscdevice.h Sat Apr 19 02:57:03 2003 @@ -44,7 +44,7 @@ const char *name; struct file_operations *fops; struct miscdevice * next, * prev; - devfs_handle_t devfs_handle; + char devfs_name[64]; }; extern int misc_register(struct miscdevice * misc); diff -Nru a/include/linux/mm.h b/include/linux/mm.h --- a/include/linux/mm.h Sat Apr 12 16:21:11 2003 +++ b/include/linux/mm.h Sat Apr 19 23:22:50 2003 @@ -594,28 +594,10 @@ extern unsigned int nr_used_zone_pages(void); -#ifdef CONFIG_MMU extern struct page * vmalloc_to_page(void *addr); extern struct page * follow_page(struct mm_struct *mm, unsigned long address, int write); extern int remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long to, unsigned long size, pgprot_t prot); -#else -static inline struct page * vmalloc_to_page(void *addr) -{ - return NULL; -} -static inline struct page * follow_page(struct mm_struct *mm, - unsigned long address, int write) -{ - return NULL; -} -static inline int remap_page_range(struct vm_area_struct *vma, - unsigned long from, unsigned long to, - unsigned long size, pgprot_t prot) -{ - return -EPERM; -} -#endif /* CONFIG_MMU */ #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff -Nru a/include/linux/net.h b/include/linux/net.h --- a/include/linux/net.h Sun Apr 6 06:03:54 2003 +++ b/include/linux/net.h Sat Apr 19 16:21:17 2003 @@ -127,14 +127,17 @@ int offset, size_t size, int flags); }; +struct module; + struct net_proto_family { - int family; - int (*create)(struct socket *sock, int protocol); + int family; + int (*create)(struct socket *sock, int protocol); /* These are counters for the number of different methods of each we support */ - short authentication; - short encryption; - short encrypt_net; + short authentication; + short encryption; + short encrypt_net; + struct module *owner; }; struct iovec; diff -Nru a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h --- a/include/linux/nfsd/syscall.h Wed Apr 16 14:09:42 2003 +++ b/include/linux/nfsd/syscall.h Sat Apr 19 23:22:56 2003 @@ -59,7 +59,7 @@ struct nfsctl_export { char ex_client[NFSCLNT_IDMAX+1]; char ex_path[NFS_MAXPATHLEN+1]; - __kernel_dev_t ex_dev; + __kernel_old_dev_t ex_dev; __kernel_ino_t ex_ino; int ex_flags; __kernel_uid_t ex_anon_uid; @@ -104,7 +104,6 @@ #define ca_export u.u_export #define ca_getfd u.u_getfd #define ca_getfs u.u_getfs -#define ca_authd u.u_authd }; union nfsctl_res { diff -Nru a/include/linux/sched.h b/include/linux/sched.h --- a/include/linux/sched.h Wed Apr 16 15:34:52 2003 +++ b/include/linux/sched.h Sat Apr 19 23:22:46 2003 @@ -465,6 +465,7 @@ #define PF_FROZEN 0x00010000 /* frozen for system suspend */ #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ #define PF_KSWAPD 0x00040000 /* I am kswapd */ +#define PF_SWAPOFF 0x00080000 /* I am in swapoff */ #if CONFIG_SMP extern void set_cpus_allowed(task_t *p, unsigned long new_mask); diff -Nru a/include/linux/serio.h b/include/linux/serio.h --- a/include/linux/serio.h Wed Feb 12 02:08:18 2003 +++ b/include/linux/serio.h Mon Apr 21 04:06:57 2003 @@ -10,6 +10,7 @@ */ #include +#include #define SPIOCSTYPE _IOW('q', 0x01, unsigned long) @@ -50,7 +51,8 @@ char *name; void (*write_wakeup)(struct serio *); - void (*interrupt)(struct serio *, unsigned char, unsigned int, struct pt_regs *); + irqreturn_t (*interrupt)(struct serio *, unsigned char, + unsigned int, struct pt_regs *); void (*connect)(struct serio *, struct serio_dev *dev); void (*disconnect)(struct serio *); void (*cleanup)(struct serio *); @@ -61,7 +63,7 @@ int serio_open(struct serio *serio, struct serio_dev *dev); void serio_close(struct serio *serio); void serio_rescan(struct serio *serio); -void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs); +irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs); void serio_register_port(struct serio *serio); void serio_unregister_port(struct serio *serio); diff -Nru a/include/linux/slab.h b/include/linux/slab.h --- a/include/linux/slab.h Sat Mar 8 14:50:35 2003 +++ b/include/linux/slab.h Sat Apr 19 23:22:40 2003 @@ -22,7 +22,7 @@ #define SLAB_KERNEL GFP_KERNEL #define SLAB_DMA GFP_DMA -#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN) +#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|__GFP_NORETRY) #define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */ /* flags to pass to kmem_cache_create(). diff -Nru a/include/linux/time.h b/include/linux/time.h --- a/include/linux/time.h Tue Apr 8 09:16:49 2003 +++ b/include/linux/time.h Sat Apr 19 23:22:26 2003 @@ -26,6 +26,16 @@ #include #include +#include +#include +#ifndef div_long_long_rem + +#define div_long_long_rem(dividend,divisor,remainder) ({ \ + u64 result = dividend; \ + *remainder = do_div(result,divisor); \ + result; }) + +#endif /* * Have the 32 bit jiffies value wrap 5 minutes after boot @@ -59,25 +69,52 @@ #ifndef NSEC_PER_USEC #define NSEC_PER_USEC (1000L) #endif +/* + * We want to do realistic conversions of time so we need to use the same + * values the update wall clock code uses as the jiffie size. This value + * is: TICK_NSEC(TICK_USEC) (both of which are defined in timex.h). This + * is a constant and is in nanoseconds. We will used scaled math and + * with a scales defined here as SEC_JIFFIE_SC, USEC_JIFFIE_SC and + * NSEC_JIFFIE_SC. Note that these defines contain nothing but + * constants and so are computed at compile time. SHIFT_HZ (computed in + * timex.h) adjusts the scaling for different HZ values. + */ +#define SEC_JIFFIE_SC (30 - SHIFT_HZ) +#define NSEC_JIFFIE_SC (SEC_JIFFIE_SC + 30) +#define USEC_JIFFIE_SC (SEC_JIFFIE_SC + 20) +#define SEC_CONVERSION ((unsigned long)(((u64)NSEC_PER_SEC << SEC_JIFFIE_SC) /\ + (u64)TICK_NSEC(TICK_USEC))) +#define NSEC_CONVERSION ((unsigned long)(((u64)1 << NSEC_JIFFIE_SC) / \ + (u64)TICK_NSEC(TICK_USEC))) +#define USEC_CONVERSION \ + ((unsigned long)(((u64)NSEC_PER_USEC << USEC_JIFFIE_SC)/ \ + (u64)TICK_NSEC(TICK_USEC))) +#define MAX_SEC_IN_JIFFIES \ + (u32)((u64)((u64)MAX_JIFFY_OFFSET * TICK_NSEC(TICK_USEC)) / NSEC_PER_SEC) static __inline__ unsigned long timespec_to_jiffies(struct timespec *value) { unsigned long sec = value->tv_sec; - long nsec = value->tv_nsec; + long nsec = value->tv_nsec + TICK_NSEC(TICK_USEC) - 1; - if (sec >= (MAX_JIFFY_OFFSET / HZ)) + if (sec >= MAX_SEC_IN_JIFFIES) return MAX_JIFFY_OFFSET; - nsec += 1000000000L / HZ - 1; - nsec /= 1000000000L / HZ; - return HZ * sec + nsec; + return (((u64)sec * SEC_CONVERSION) + + (((u64)nsec * NSEC_CONVERSION) >> + (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; + } static __inline__ void jiffies_to_timespec(unsigned long jiffies, struct timespec *value) { - value->tv_nsec = (jiffies % HZ) * (1000000000L / HZ); - value->tv_sec = jiffies / HZ; + /* + * Convert jiffies to nanoseconds and seperate with + * one divide. + */ + u64 nsec = (u64)jiffies * TICK_NSEC(TICK_USEC); + value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_nsec); } /* Same for "timeval" */ @@ -85,20 +122,25 @@ timeval_to_jiffies(struct timeval *value) { unsigned long sec = value->tv_sec; - long usec = value->tv_usec; + long usec = value->tv_usec + USEC_PER_SEC / HZ - 1; - if (sec >= (MAX_JIFFY_OFFSET / HZ)) + if (sec >= MAX_SEC_IN_JIFFIES) return MAX_JIFFY_OFFSET; - usec += 1000000L / HZ - 1; - usec /= 1000000L / HZ; - return HZ * sec + usec; + return (((u64)sec * SEC_CONVERSION) + + (((u64)usec * USEC_CONVERSION) >> + (USEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; } static __inline__ void jiffies_to_timeval(unsigned long jiffies, struct timeval *value) { - value->tv_usec = (jiffies % HZ) * (1000000L / HZ); - value->tv_sec = jiffies / HZ; + /* + * Convert jiffies to nanoseconds and seperate with + * one divide. + */ + u64 nsec = (u64)jiffies * TICK_NSEC(TICK_USEC); + value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); + value->tv_usec /= NSEC_PER_USEC; } static __inline__ int timespec_equal(struct timespec *a, struct timespec *b) @@ -140,6 +182,7 @@ } extern struct timespec xtime; +extern struct timespec wall_to_monotonic; extern seqlock_t xtime_lock; static inline unsigned long get_seconds(void) @@ -200,6 +243,9 @@ #define CLOCK_MONOTONIC_HR 5 #define MAX_CLOCKS 6 +#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC | \ + CLOCK_REALTIME_HR | CLOCK_MONOTONIC_HR) +#define CLOCKS_MONO (CLOCK_MONOTONIC & CLOCK_MONOTONIC_HR) /* * The various flags for setting POSIX.1b interval timers. diff -Nru a/include/linux/timex.h b/include/linux/timex.h --- a/include/linux/timex.h Sun Sep 8 11:24:21 2002 +++ b/include/linux/timex.h Sat Apr 19 23:22:26 2003 @@ -51,7 +51,6 @@ #ifndef _LINUX_TIMEX_H #define _LINUX_TIMEX_H -#include #include /* @@ -177,6 +176,7 @@ /* a value TUSEC for TICK_USEC (can be set bij adjtimex) */ #define TICK_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8)) +#include /* * syscall interface - used (mainly by NTP daemon) * to discipline kernel clock oscillator diff -Nru a/include/linux/videodev.h b/include/linux/videodev.h --- a/include/linux/videodev.h Wed Dec 11 16:02:48 2002 +++ b/include/linux/videodev.h Sat Apr 19 03:11:22 2003 @@ -39,7 +39,7 @@ /* for videodev.c intenal usage -- don't touch */ int users; struct semaphore lock; - devfs_handle_t devfs_handle; + char devfs_name[64]; /* devfs */ }; #define VIDEO_MAJOR 81 diff -Nru a/include/linux/vmalloc.h b/include/linux/vmalloc.h --- a/include/linux/vmalloc.h Thu Nov 7 23:47:15 2002 +++ b/include/linux/vmalloc.h Sat Apr 19 23:22:50 2003 @@ -27,7 +27,8 @@ extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot); extern void vfree(void *addr); -extern void *vmap(struct page **pages, unsigned int count); +extern void *vmap(struct page **pages, unsigned int count, + unsigned long flags, pgprot_t prot); extern void vunmap(void *addr); /* diff -Nru a/include/net/pkt_cls.h b/include/net/pkt_cls.h --- a/include/net/pkt_cls.h Tue Feb 5 09:39:48 2002 +++ b/include/net/pkt_cls.h Sun Apr 20 00:25:21 2003 @@ -39,6 +39,8 @@ int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *); }; +struct module; + struct tcf_proto_ops { struct tcf_proto_ops *next; @@ -56,6 +58,8 @@ /* rtnetlink specific */ int (*dump)(struct tcf_proto*, unsigned long, struct sk_buff *skb, struct tcmsg*); + + struct module *owner; }; /* Main classifier routine: scans classifier chain attached diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h --- a/include/net/pkt_sched.h Thu May 23 09:59:37 2002 +++ b/include/net/pkt_sched.h Sun Apr 20 00:57:16 2003 @@ -49,6 +49,8 @@ int (*dump)(struct Qdisc *, unsigned long, struct sk_buff *skb, struct tcmsg*); }; +struct module; + struct Qdisc_ops { struct Qdisc_ops *next; @@ -67,6 +69,8 @@ int (*change)(struct Qdisc *, struct rtattr *arg); int (*dump)(struct Qdisc *, struct sk_buff *); + + struct module *owner; }; extern rwlock_t qdisc_tree_lock; diff -Nru a/include/sound/ad1848.h b/include/sound/ad1848.h --- a/include/sound/ad1848.h Mon Jan 27 10:41:40 2003 +++ b/include/sound/ad1848.h Mon Apr 21 00:32:53 2003 @@ -23,6 +23,7 @@ */ #include "pcm.h" +#include /* IO ports */ @@ -163,7 +164,7 @@ int snd_ad1848_pcm(ad1848_t * chip, int device, snd_pcm_t **rpcm); const snd_pcm_ops_t *snd_ad1848_get_pcm_ops(int direction); int snd_ad1848_mixer(ad1848_t * chip); -void snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* exported mixer stuffs */ enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE }; diff -Nru a/include/sound/cs4231.h b/include/sound/cs4231.h --- a/include/sound/cs4231.h Sun Nov 10 12:04:50 2002 +++ b/include/sound/cs4231.h Mon Apr 21 00:32:53 2003 @@ -316,7 +316,7 @@ void snd_cs4231_mce_up(cs4231_t *chip); void snd_cs4231_mce_down(cs4231_t *chip); -void snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs); const char *snd_cs4231_chip_id(cs4231_t *chip); diff -Nru a/include/sound/emu10k1.h b/include/sound/emu10k1.h --- a/include/sound/emu10k1.h Thu Apr 10 03:28:10 2003 +++ b/include/sound/emu10k1.h Mon Apr 21 10:36:31 2003 @@ -30,6 +30,7 @@ #include #include #include +#include #include #ifndef PCI_VENDOR_ID_CREATIVE @@ -1014,7 +1015,7 @@ int snd_emu10k1_mixer(emu10k1_t * emu); int snd_emu10k1_fx8010_new(emu10k1_t *emu, int device, snd_hwdep_t ** rhwdep); -void snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* initialization */ void snd_emu10k1_voice_init(emu10k1_t * emu, int voice); diff -Nru a/include/sound/es1688.h b/include/sound/es1688.h --- a/include/sound/es1688.h Wed Feb 13 11:32:01 2002 +++ b/include/sound/es1688.h Mon Apr 21 00:32:53 2003 @@ -24,6 +24,7 @@ #include "control.h" #include "pcm.h" +#include #define ES1688_HW_AUTO 0x0000 #define ES1688_HW_688 0x0001 @@ -109,7 +110,7 @@ void snd_es1688_mixer_write(es1688_t *chip, unsigned char reg, unsigned char data); unsigned char snd_es1688_mixer_read(es1688_t *chip, unsigned char reg); -void snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs); int snd_es1688_create(snd_card_t * card, unsigned long port, diff -Nru a/include/sound/gus.h b/include/sound/gus.h --- a/include/sound/gus.h Mon Jan 27 09:30:50 2003 +++ b/include/sound/gus.h Mon Apr 21 00:32:53 2003 @@ -561,7 +561,7 @@ }; #if 0 -extern void snd_gf1_lfo_effect_interrupt(snd_gus_card_t * gus, snd_gf1_voice_t * voice); +extern irqreturn_t snd_gf1_lfo_effect_interrupt(snd_gus_card_t * gus, snd_gf1_voice_t * voice); #endif extern void snd_gf1_lfo_init(snd_gus_card_t * gus); extern void snd_gf1_lfo_done(snd_gus_card_t * gus); @@ -666,7 +666,7 @@ /* gus_irq.c */ -void snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs); #ifdef CONFIG_SND_DEBUG void snd_gus_irq_profile_init(snd_gus_card_t *gus); #endif diff -Nru a/include/sound/initval.h b/include/sound/initval.h --- a/include/sound/initval.h Thu Apr 10 03:28:10 2003 +++ b/include/sound/initval.h Mon Apr 21 00:32:53 2003 @@ -100,8 +100,9 @@ #ifdef SNDRV_LEGACY_FIND_FREE_IRQ #include -static void snd_legacy_empty_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_legacy_empty_irq_handler(int irq, void *dev_id, struct pt_regs *regs) { + return IRQ_HANDLED; } static int snd_legacy_find_free_irq(int *irq_table) diff -Nru a/include/sound/mpu401.h b/include/sound/mpu401.h --- a/include/sound/mpu401.h Thu Mar 20 08:41:11 2003 +++ b/include/sound/mpu401.h Mon Apr 21 10:36:31 2003 @@ -22,7 +22,9 @@ * */ +#include #include "rawmidi.h" +#include #define MPU401_HW_MPU401 1 /* native MPU401 */ #define MPU401_HW_SB 2 /* SoundBlaster MPU-401 UART */ @@ -102,7 +104,7 @@ */ -void snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); int snd_mpu401_uart_new(snd_card_t * card, int device, diff -Nru a/include/sound/sb.h b/include/sound/sb.h --- a/include/sound/sb.h Mon Jan 27 10:41:40 2003 +++ b/include/sound/sb.h Mon Apr 21 00:32:53 2003 @@ -24,6 +24,7 @@ #include "pcm.h" #include "rawmidi.h" +#include #include enum sb_hw_type { @@ -99,7 +100,7 @@ snd_rawmidi_t *rmidi; snd_rawmidi_substream_t *midi_substream_input; snd_rawmidi_substream_t *midi_substream_output; - void (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs); + irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs); spinlock_t reg_lock; spinlock_t open_lock; @@ -282,7 +283,7 @@ int snd_sbdsp_create(snd_card_t *card, unsigned long port, int irq, - void (*irq_handler)(int, void *, struct pt_regs *), + irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), int dma8, int dma16, unsigned short hardware, sb_t **r_chip); @@ -308,7 +309,7 @@ const snd_pcm_ops_t *snd_sb16dsp_get_pcm_ops(int direction); int snd_sb16dsp_configure(sb_t *chip); /* sb16.c */ -void snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); int snd_sb16_playback_open(snd_pcm_substream_t *substream); int snd_sb16_capture_open(snd_pcm_substream_t *substream); int snd_sb16_playback_close(snd_pcm_substream_t *substream); diff -Nru a/init/Kconfig b/init/Kconfig --- a/init/Kconfig Mon Mar 10 22:34:13 2003 +++ b/init/Kconfig Sun Apr 20 12:56:52 2003 @@ -56,12 +56,12 @@ and some programs won't run unless you say Y here. In particular, if you want to run the DOS emulator dosemu under Linux (read the DOSEMU-HOWTO, available from - ), you'll need to say Y + ), you'll need to say Y here. You can find documentation about IPC with "info ipc" and also in section 6.4 of the Linux Programmer's Guide, available from - . + . config BSD_PROCESS_ACCT bool "BSD Process Accounting" diff -Nru a/init/do_mounts_rd.c b/init/do_mounts_rd.c --- a/init/do_mounts_rd.c Thu Mar 6 16:27:25 2003 +++ b/init/do_mounts_rd.c Sun Apr 20 09:14:41 2003 @@ -4,6 +4,7 @@ #include #include #include +#include #include "do_mounts.h" diff -Nru a/init/main.c b/init/main.c --- a/init/main.c Fri Apr 4 09:01:32 2003 +++ b/init/main.c Sun Apr 20 09:14:41 2003 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff -Nru a/ipc/shm.c b/ipc/shm.c --- a/ipc/shm.c Wed Dec 18 05:36:54 2002 +++ b/ipc/shm.c Sat Apr 19 23:22:48 2003 @@ -361,27 +361,35 @@ } } -static void shm_get_stat (unsigned long *rss, unsigned long *swp) +static void shm_get_stat(unsigned long *rss, unsigned long *swp) { - struct shmem_inode_info *info; int i; *rss = 0; *swp = 0; - for(i = 0; i <= shm_ids.max_id; i++) { - struct shmid_kernel* shp; - struct inode * inode; + for (i = 0; i <= shm_ids.max_id; i++) { + struct shmid_kernel *shp; + struct inode *inode; shp = shm_get(i); - if(shp == NULL) + if(!shp) continue; + inode = shp->shm_file->f_dentry->d_inode; - info = SHMEM_I(inode); - spin_lock (&info->lock); - *rss += inode->i_mapping->nrpages; - *swp += info->swapped; - spin_unlock (&info->lock); + + if (is_file_hugepages(shp->shm_file)) { + struct address_space *mapping = inode->i_mapping; + spin_lock(&mapping->page_lock); + *rss += (HPAGE_SIZE/PAGE_SIZE)*mapping->nrpages; + spin_unlock(&mapping->page_lock); + } else { + struct shmem_inode_info *info = SHMEM_I(inode); + spin_lock(&info->lock); + *rss += inode->i_mapping->nrpages; + *swp += info->swapped; + spin_unlock(&info->lock); + } } } @@ -737,21 +745,66 @@ * detach and kill segment if marked destroyed. * The work is done in shm_close. */ -asmlinkage long sys_shmdt (char *shmaddr) +asmlinkage long sys_shmdt(char *shmaddr) { struct mm_struct *mm = current->mm; - struct vm_area_struct *shmd, *shmdnext; + struct vm_area_struct *vma, *next; + unsigned long addr = (unsigned long)shmaddr; + loff_t size = 0; int retval = -EINVAL; down_write(&mm->mmap_sem); - for (shmd = mm->mmap; shmd; shmd = shmdnext) { - shmdnext = shmd->vm_next; - if ((shmd->vm_ops == &shm_vm_ops || (shmd->vm_flags & VM_HUGETLB)) - && shmd->vm_start - (shmd->vm_pgoff << PAGE_SHIFT) == (ulong) shmaddr) { - do_munmap(mm, shmd->vm_start, shmd->vm_end - shmd->vm_start); + + /* + * If it had been mremap()'d, the starting address would not + * match the usual checks anyway. So assume all vma's are + * above the starting address given. + */ + vma = find_vma(mm, addr); + + while (vma) { + next = vma->vm_next; + + /* + * Check if the starting address would match, i.e. it's + * a fragment created by mprotect() and/or munmap(), or it + * otherwise it starts at this address with no hassles. + */ + if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) && + (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) { + + + size = vma->vm_file->f_dentry->d_inode->i_size; + do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); + /* + * We discovered the size of the shm segment, so + * break out of here and fall through to the next + * loop that uses the size information to stop + * searching for matching vma's. + */ retval = 0; + vma = next; + break; } + vma = next; + } + + /* + * We need look no further than the maximum address a fragment + * could possibly have landed at. Also cast things to loff_t to + * prevent overflows and make comparisions vs. equal-width types. + */ + while (vma && (loff_t)(vma->vm_end - addr) <= size) { + next = vma->vm_next; + + /* finding a matching vma now does not alter retval */ + if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) && + (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) + + do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); + vma = next; } + up_write(&mm->mmap_sem); return retval; } diff -Nru a/kernel/posix-timers.c b/kernel/posix-timers.c --- a/kernel/posix-timers.c Tue Apr 15 16:11:01 2003 +++ b/kernel/posix-timers.c Sat Apr 19 23:22:26 2003 @@ -33,7 +33,12 @@ result; }) #endif +#define CLOCK_REALTIME_RES TICK_NSEC(TICK_USEC) // In nano seconds. +static inline u64 mpy_l_X_l_ll(unsigned long mpy1,unsigned long mpy2) +{ + return (u64)mpy1 * mpy2; +} /* * Management arrays for POSIX timers. Timers are kept in slab memory * Timer ids are allocated by an external routine that keeps track of the @@ -48,7 +53,7 @@ * The idr_get_new *may* call slab for more memory so it must not be * called under a spin lock. Likewise idr_remore may release memory * (but it may be ok to do this under a lock...). - * idr_find is just a memory look up and is quite fast. A zero return + * idr_find is just a memory look up and is quite fast. A -1 return * indicates that the requested id does not exist. */ @@ -82,6 +87,7 @@ * For some reason mips/mips64 define the SIGEV constants plus 128. * Here we define a mask to get rid of the common bits. The * optimizer should make this costless to all but mips. + * Note that no common bits (the non-mips case) will give 0xffffffff. */ #define MIPS_SIGEV ~(SIGEV_NONE & \ SIGEV_SIGNAL & \ @@ -93,7 +99,7 @@ * The timer ID is turned into a timer address by idr_find(). * Verifying a valid ID consists of: * - * a) checking that idr_find() returns other than zero. + * a) checking that idr_find() returns other than -1. * b) checking that the timer id matches the one in the timer itself. * c) that the timer owner is in the callers thread group. */ @@ -162,6 +168,8 @@ void register_posix_clock(int clock_id, struct k_clock *new_clock); static int do_posix_gettime(struct k_clock *clock, struct timespec *tp); +static u64 do_posix_clock_monotonic_gettime_parts( + struct timespec *tp, struct timespec *mo); int do_posix_clock_monotonic_gettime(struct timespec *tp); int do_posix_clock_monotonic_settime(struct timespec *tp); static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); @@ -172,8 +180,8 @@ */ static __init int init_posix_timers(void) { - struct k_clock clock_realtime = {.res = NSEC_PER_SEC / HZ }; - struct k_clock clock_monotonic = {.res = NSEC_PER_SEC / HZ, + struct k_clock clock_realtime = {.res = CLOCK_REALTIME_RES }; + struct k_clock clock_monotonic = {.res = CLOCK_REALTIME_RES, .clock_get = do_posix_clock_monotonic_gettime, .clock_set = do_posix_clock_monotonic_settime }; @@ -192,7 +200,7 @@ static void tstojiffie(struct timespec *tp, int res, u64 *jiff) { - unsigned long sec = tp->tv_sec; + long sec = tp->tv_sec; long nsec = tp->tv_nsec + res - 1; if (nsec > NSEC_PER_SEC) { @@ -201,35 +209,14 @@ } /* - * A note on jiffy overflow: It is possible for the system to - * have been up long enough for the jiffies quanity to overflow. - * In order for correct timer evaluations we require that the - * specified time be somewhere between now and now + (max - * unsigned int/2). Times beyond this will be truncated back to - * this value. This is done in the absolute adjustment code, - * below. Here it is enough to just discard the high order - * bits. - */ - *jiff = (u64)sec * HZ; - /* - * Do the res thing. (Don't forget the add in the declaration of nsec) - */ - nsec -= nsec % res; - /* - * Split to jiffie and sub jiffie - */ - *jiff += nsec / (NSEC_PER_SEC / HZ); -} - -static void tstotimer(struct itimerspec *time, struct k_itimer *timer) -{ - u64 result; - int res = posix_clocks[timer->it_clock].res; - - tstojiffie(&time->it_value, res, &result); - timer->it_timer.expires = (unsigned long)result; - tstojiffie(&time->it_interval, res, &result); - timer->it_incr = (unsigned long)result; + * The scaling constants are defined in + * The difference between there and here is that we do the + * res rounding and compute a 64-bit result (well so does that + * but it then throws away the high bits). + */ + *jiff = (mpy_l_X_l_ll(sec, SEC_CONVERSION) + + (mpy_l_X_l_ll(nsec, NSEC_CONVERSION) >> + (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; } static void schedule_next_timer(struct k_itimer *timr) @@ -690,57 +677,81 @@ * If it is relative time, we need to add the current (CLOCK_MONOTONIC) * time to it to get the proper time for the timer. */ -static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, int abs) +static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, + int abs, u64 *exp) { struct timespec now; - struct timespec oc; - do_posix_clock_monotonic_gettime(&now); - - if (!abs || (posix_clocks[CLOCK_MONOTONIC].clock_get != - clock->clock_get)) { - if (abs) - do_posix_gettime(clock, &oc); - else - oc.tv_nsec = oc.tv_sec = 0; - - tp->tv_sec += now.tv_sec - oc.tv_sec; - tp->tv_nsec += now.tv_nsec - oc.tv_nsec; + struct timespec oc = *tp; + struct timespec wall_to_mono; + u64 jiffies_64_f; + int rtn =0; + if (abs) { + /* + * The mask pick up the 4 basic clocks + */ + if (!(clock - &posix_clocks[0]) & ~CLOCKS_MASK) { + jiffies_64_f = do_posix_clock_monotonic_gettime_parts( + &now, &wall_to_mono); + /* + * If we are doing a MONOTONIC clock + */ + if((clock - &posix_clocks[0]) & CLOCKS_MONO){ + now.tv_sec += wall_to_mono.tv_sec; + now.tv_nsec += wall_to_mono.tv_nsec; + } + } else { + /* + * Not one of the basic clocks + */ + do_posix_gettime(clock, &now); + jiffies_64_f = get_jiffies_64(); + } + /* + * Take away now to get delta + */ + oc.tv_sec -= now.tv_sec; + oc.tv_nsec -= now.tv_nsec; /* * Normalize... */ - if ((tp->tv_nsec - NSEC_PER_SEC) >= 0) { - tp->tv_nsec -= NSEC_PER_SEC; - tp->tv_sec++; + while ((oc.tv_nsec - NSEC_PER_SEC) >= 0) { + oc.tv_nsec -= NSEC_PER_SEC; + oc.tv_sec++; } - if ((tp->tv_nsec) < 0) { - tp->tv_nsec += NSEC_PER_SEC; - tp->tv_sec--; + while ((oc.tv_nsec) < 0) { + oc.tv_nsec += NSEC_PER_SEC; + oc.tv_sec--; } + }else{ + jiffies_64_f = get_jiffies_64(); } /* - * Check if the requested time is prior to now (if so set now) or - * is more than the timer code can handle (if so we error out). - * The (unsigned) catches the case of prior to "now" with the same - * test. Only on failure do we sort out what happened, and then - * we use the (unsigned) to error out negative seconds. + * Check if the requested time is prior to now (if so set now) + */ + if (oc.tv_sec < 0) + oc.tv_sec = oc.tv_nsec = 0; + tstojiffie(&oc, clock->res, exp); + + /* + * Check if the requested time is more than the timer code + * can handle (if so we error out but return the value too). */ - if ((unsigned) (tp->tv_sec - now.tv_sec) > (MAX_JIFFY_OFFSET / HZ)) { - if ((unsigned) tp->tv_sec < now.tv_sec) { - tp->tv_sec = now.tv_sec; - tp->tv_nsec = now.tv_nsec; - } else + if (*exp > ((u64)MAX_JIFFY_OFFSET)) /* * This is a considered response, not exactly in * line with the standard (in fact it is silent on - * possible overflows). We assume such a large + * possible overflows). We assume such a large * value is ALMOST always a programming error and * try not to compound it by setting a really dumb * value. */ - return -EINVAL; - } - return 0; + rtn = -EINVAL; + /* + * return the actual jiffies expire time, full 64 bits + */ + *exp += jiffies_64_f; + return rtn; } /* Set a POSIX.1b interval timer. */ @@ -750,6 +761,7 @@ struct itimerspec *new_setting, struct itimerspec *old_setting) { struct k_clock *clock = &posix_clocks[timr->it_clock]; + u64 expire_64; if (old_setting) do_timer_gettime(timr, old_setting); @@ -788,14 +800,15 @@ return 0; } - if ((flags & TIMER_ABSTIME) && - (clock->clock_get != do_posix_clock_monotonic_gettime)) - // FIXME: what is this? - ; if (adjust_abs_time(clock, - &new_setting->it_value, flags & TIMER_ABSTIME)) + &new_setting->it_value, flags & TIMER_ABSTIME, + &expire_64)) { return -EINVAL; - tstotimer(new_setting, timr); + } + timr->it_timer.expires = (unsigned long)expire_64; + tstojiffie(&new_setting->it_interval, clock->res, &expire_64); + timr->it_incr = (unsigned long)expire_64; + /* * For some reason the timer does not fire immediately if expires is @@ -964,30 +977,46 @@ * Note also that the while loop assures that the sub_jiff_offset * will be less than a jiffie, thus no need to normalize the result. * Well, not really, if called with ints off :( - * - * HELP, this code should make an attempt at resolution beyond the - * jiffie. Trouble is this is "arch" dependent... */ -int do_posix_clock_monotonic_gettime(struct timespec *tp) +static u64 do_posix_clock_monotonic_gettime_parts( + struct timespec *tp, struct timespec *mo) { - long sub_sec; - u64 jiffies_64_f; - -#if (BITS_PER_LONG > 32) - jiffies_64_f = jiffies_64; -#else + u64 jiff; + struct timeval tpv; unsigned int seq; do { seq = read_seqbegin(&xtime_lock); - jiffies_64_f = jiffies_64; + do_gettimeofday(&tpv); + *mo = wall_to_monotonic; + jiff = jiffies_64; - } while (read_seqretry(&xtime_lock, seq)); -#endif - tp->tv_sec = div_long_long_rem(jiffies_64_f, HZ, &sub_sec); - tp->tv_nsec = sub_sec * (NSEC_PER_SEC / HZ); + } while(read_seqretry(&xtime_lock, seq)); + + /* + * Love to get this before it is converted to usec. + * It would save a div AND a mpy. + */ + tp->tv_sec = tpv.tv_sec; + tp->tv_nsec = tpv.tv_usec * NSEC_PER_USEC; + return jiff; +} + +int do_posix_clock_monotonic_gettime(struct timespec *tp) +{ + struct timespec wall_to_mono; + + do_posix_clock_monotonic_gettime_parts(tp, &wall_to_mono); + + tp->tv_sec += wall_to_mono.tv_sec; + tp->tv_nsec += wall_to_mono.tv_nsec; + + if ((tp->tv_nsec - NSEC_PER_SEC) > 0) { + tp->tv_nsec -= NSEC_PER_SEC; + tp->tv_sec++; + } return 0; } @@ -1138,7 +1167,7 @@ struct timespec t; struct timer_list new_timer; DECLARE_WAITQUEUE(abs_wqueue, current); - u64 rq_time = 0; + u64 rq_time = (u64)0; s64 left; int abs; struct restart_block *restart_block = @@ -1163,7 +1192,7 @@ if (!rq_time) return -EINTR; left = rq_time - get_jiffies_64(); - if (left <= 0LL) + if (left <= (s64)0) return 0; /* Already passed */ } @@ -1174,14 +1203,14 @@ do { t = *tsave; if (abs || !rq_time) { - adjust_abs_time(&posix_clocks[which_clock], &t, abs); - tstojiffie(&t, posix_clocks[which_clock].res, &rq_time); + adjust_abs_time(&posix_clocks[which_clock], &t, abs, + &rq_time); } left = rq_time - get_jiffies_64(); - if (left >= MAX_JIFFY_OFFSET) - left = MAX_JIFFY_OFFSET; - if (left < 0) + if (left >= (s64)MAX_JIFFY_OFFSET) + left = (s64)MAX_JIFFY_OFFSET; + if (left < (s64)0) break; new_timer.expires = jiffies + left; @@ -1192,13 +1221,12 @@ del_timer_sync(&new_timer); left = rq_time - get_jiffies_64(); - } while (left > 0 && !test_thread_flag(TIF_SIGPENDING)); + } while (left > (s64)0 && !test_thread_flag(TIF_SIGPENDING)); if (abs_wqueue.task_list.next) finish_wait(&nanosleep_abs_wqueue, &abs_wqueue); - if (left > 0) { - unsigned long rmd; + if (left > (s64)0) { /* * Always restart abs calls from scratch to pick up any @@ -1207,9 +1235,10 @@ if (abs) return -ERESTARTNOHAND; - tsave->tv_sec = div_long_long_rem(left, HZ, &rmd); - tsave->tv_nsec = rmd * (NSEC_PER_SEC / HZ); - + left *= TICK_NSEC(TICK_USEC); + tsave->tv_sec = div_long_long_rem(left, + NSEC_PER_SEC, + &tsave->tv_nsec); restart_block->fn = clock_nanosleep_restart; restart_block->arg0 = which_clock; restart_block->arg1 = (unsigned long)tsave; diff -Nru a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c Wed Apr 9 01:55:28 2003 +++ b/kernel/sched.c Mon Apr 21 12:41:21 2003 @@ -1091,7 +1091,7 @@ #define IDLE_REBALANCE_TICK (HZ/1000 ?: 1) #define BUSY_REBALANCE_TICK (HZ/5 ?: 1) #define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5) -#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 100) +#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 2) #ifdef CONFIG_NUMA static void balance_node(runqueue_t *this_rq, int idle, int this_cpu) @@ -1666,7 +1666,7 @@ */ int task_prio(task_t *p) { - return p->prio - MAX_USER_RT_PRIO; + return p->prio - MAX_RT_PRIO; } /** diff -Nru a/kernel/timer.c b/kernel/timer.c --- a/kernel/timer.c Fri Apr 11 15:29:11 2003 +++ b/kernel/timer.c Sat Apr 19 23:22:24 2003 @@ -441,8 +441,16 @@ unsigned long tick_usec = TICK_USEC; /* ACTHZ period (usec) */ unsigned long tick_nsec = TICK_NSEC(TICK_USEC); /* USER_HZ period (nsec) */ -/* The current time */ +/* + * The current time + * wall_to_monotonic is what we need to add to xtime (or xtime corrected + * for sub jiffie times) to get to monotonic time. Monotonic is pegged at zero + * at zero at system boot time, so wall_to_monotonic will be negative, + * however, we will ALWAYS keep the tv_nsec part positive so we can use + * the usual normalization. + */ struct timespec xtime __attribute__ ((aligned (16))); +struct timespec wall_to_monotonic __attribute__ ((aligned (16))); /* Don't completely fail for HZ > 500. */ int tickadj = 500/HZ ? : 1; /* microsecs */ @@ -508,6 +516,7 @@ case TIME_INS: if (xtime.tv_sec % 86400 == 0) { xtime.tv_sec--; + wall_to_monotonic.tv_sec++; time_state = TIME_OOP; clock_was_set(); printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n"); @@ -517,6 +526,7 @@ case TIME_DEL: if ((xtime.tv_sec + 1) % 86400 == 0) { xtime.tv_sec++; + wall_to_monotonic.tv_sec--; time_state = TIME_WAIT; clock_was_set(); printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n"); diff -Nru a/mm/filemap.c b/mm/filemap.c --- a/mm/filemap.c Sat Apr 12 16:21:01 2003 +++ b/mm/filemap.c Sat Apr 19 23:22:33 2003 @@ -31,12 +31,11 @@ * This is needed for the following functions: * - try_to_release_page * - block_invalidatepage - * - page_has_buffers * - generic_osync_inode * - * FIXME: remove all knowledge of the buffer layer from this file + * FIXME: remove all knowledge of the buffer layer from the core VM */ -#include +#include /* for generic_osync_inode */ #include #include diff -Nru a/mm/mmap.c b/mm/mmap.c --- a/mm/mmap.c Thu Mar 27 21:16:31 2003 +++ b/mm/mmap.c Mon Apr 21 09:02:10 2003 @@ -355,6 +355,24 @@ } /* + * If the vma has a ->close operation then the driver probably needs to release + * per-vma resources, so we don't attempt to merge those. + */ +#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED) + +static inline int is_mergeable_vma(struct vm_area_struct *vma, + struct file *file, unsigned long vm_flags) +{ + if (vma->vm_ops && vma->vm_ops->close) + return 0; + if (vma->vm_file != file) + return 0; + if (vma->vm_flags != vm_flags) + return 0; + return 1; +} + +/* * Return true if we can merge this (vm_flags,file,vm_pgoff,size) * in front of (at a lower virtual address and file offset than) the vma. * @@ -366,9 +384,7 @@ can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags, struct file *file, unsigned long vm_pgoff, unsigned long size) { - if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND)) - return 0; - if (vma->vm_file == file && vma->vm_flags == vm_flags) { + if (is_mergeable_vma(vma, file, vm_flags)) { if (!file) return 1; /* anon mapping */ if (vma->vm_pgoff == vm_pgoff + size) @@ -385,9 +401,7 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags, struct file *file, unsigned long vm_pgoff) { - if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND)) - return 0; - if (vma->vm_file == file && vma->vm_flags == vm_flags) { + if (is_mergeable_vma(vma, file, vm_flags)) { unsigned long vma_size; if (!file) @@ -412,6 +426,13 @@ { spinlock_t * lock = &mm->page_table_lock; + /* + * We later require that vma->vm_flags == vm_flags, so this tests + * vma->vm_flags & VM_SPECIAL, too. + */ + if (vm_flags & VM_SPECIAL) + return 0; + if (!prev) { prev = rb_entry(rb_parent, struct vm_area_struct, vm_rb); goto merge_next; @@ -421,6 +442,7 @@ * Can it merge with the predecessor? */ if (prev->vm_end == addr && + is_mergeable_vma(prev, file, vm_flags) && can_vma_merge_after(prev, vm_flags, file, pgoff)) { struct vm_area_struct *next; struct inode *inode = file ? file->f_dentry->d_inode : NULL; diff -Nru a/mm/oom_kill.c b/mm/oom_kill.c --- a/mm/oom_kill.c Thu Mar 20 10:43:25 2003 +++ b/mm/oom_kill.c Sat Apr 19 23:22:46 2003 @@ -129,6 +129,8 @@ chosen = p; maxpoints = points; } + if (p->flags & PF_SWAPOFF) + return p; } while_each_thread(g, p); return chosen; diff -Nru a/mm/page-writeback.c b/mm/page-writeback.c --- a/mm/page-writeback.c Mon Apr 14 19:46:02 2003 +++ b/mm/page-writeback.c Sat Apr 19 23:22:32 2003 @@ -462,88 +462,6 @@ EXPORT_SYMBOL(write_one_page); /* - * Add a page to the dirty page list. - * - * It is a sad fact of life that this function is called from several places - * deeply under spinlocking. It may not sleep. - * - * If the page has buffers, the uptodate buffers are set dirty, to preserve - * dirty-state coherency between the page and the buffers. It the page does - * not have buffers then when they are later attached they will all be set - * dirty. - * - * The buffers are dirtied before the page is dirtied. There's a small race - * window in which a writepage caller may see the page cleanness but not the - * buffer dirtiness. That's fine. If this code were to set the page dirty - * before the buffers, a concurrent writepage caller could clear the page dirty - * bit, see a bunch of clean buffers and we'd end up with dirty buffers/clean - * page on the dirty page list. - * - * There is also a small window where the page is dirty, and not on dirty_pages. - * Also a possibility that by the time the page is added to dirty_pages, it has - * been set clean. The page lists are somewhat approximate in this regard. - * It's better to have clean pages accidentally attached to dirty_pages than to - * leave dirty pages attached to clean_pages. - * - * We use private_lock to lock against try_to_free_buffers while using the - * page's buffer list. Also use this to protect against clean buffers being - * added to the page after it was set dirty. - * - * FIXME: may need to call ->reservepage here as well. That's rather up to the - * address_space though. - * - * For now, we treat swapper_space specially. It doesn't use the normal - * block a_ops. - * - * FIXME: this should move over to fs/buffer.c - buffer_heads have no business in mm/ - */ -#include -int __set_page_dirty_buffers(struct page *page) -{ - struct address_space * const mapping = page->mapping; - int ret = 0; - - if (mapping == NULL) { - SetPageDirty(page); - goto out; - } - - if (!PageUptodate(page)) - buffer_error(); - - spin_lock(&mapping->private_lock); - if (page_has_buffers(page)) { - struct buffer_head *head = page_buffers(page); - struct buffer_head *bh = head; - - do { - if (buffer_uptodate(bh)) - set_buffer_dirty(bh); - else - buffer_error(); - bh = bh->b_this_page; - } while (bh != head); - } - spin_unlock(&mapping->private_lock); - - if (!TestSetPageDirty(page)) { - spin_lock(&mapping->page_lock); - if (page->mapping) { /* Race with truncate? */ - if (!mapping->backing_dev_info->memory_backed) - inc_page_state(nr_dirty); - list_del(&page->list); - list_add(&page->list, &mapping->dirty_pages); - } - spin_unlock(&mapping->page_lock); - __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); - } - -out: - return ret; -} -EXPORT_SYMBOL(__set_page_dirty_buffers); - -/* * For address_spaces which do not use buffers. Just set the page's dirty bit * and move it to the dirty_pages list. Also perform space reservation if * required. diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c --- a/mm/page_alloc.c Mon Apr 14 19:46:02 2003 +++ b/mm/page_alloc.c Sat Apr 19 23:22:40 2003 @@ -536,6 +536,7 @@ struct page *page; int i; int cold; + int do_retry; if (wait) might_sleep(); @@ -626,10 +627,21 @@ } /* - * Don't let big-order allocations loop. Yield for kswapd, try again. + * Don't let big-order allocations loop unless the caller explicitly + * requests that. Wait for some write requests to complete then retry. + * + * In this implementation, __GFP_REPEAT means __GFP_NOFAIL, but that + * may not be true in other implementations. */ - if (order <= 3) { - yield(); + do_retry = 0; + if (!(gfp_mask & __GFP_NORETRY)) { + if ((order <= 3) || (gfp_mask & __GFP_REPEAT)) + do_retry = 1; + if (gfp_mask & __GFP_NOFAIL) + do_retry = 1; + } + if (do_retry) { + blk_congestion_wait(WRITE, HZ/50); goto rebalance; } diff -Nru a/mm/swap.c b/mm/swap.c --- a/mm/swap.c Tue Mar 18 01:44:12 2003 +++ b/mm/swap.c Sat Apr 19 23:22:33 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include /* for try_to_release_page() */ #include /* How many pages do we try to swap or page in/out together? */ diff -Nru a/mm/swap_state.c b/mm/swap_state.c --- a/mm/swap_state.c Tue Apr 8 03:16:30 2003 +++ b/mm/swap_state.c Sat Apr 19 23:22:33 2003 @@ -13,7 +13,6 @@ #include #include #include -#include /* block_sync_page() */ #include @@ -187,7 +186,7 @@ BUG_ON(!PageLocked(page)); BUG_ON(PageWriteback(page)); - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); entry.val = page->index; @@ -236,7 +235,7 @@ BUG_ON(!PageLocked(page)); BUG_ON(PageWriteback(page)); - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); entry.val = page->index; diff -Nru a/mm/swapfile.c b/mm/swapfile.c --- a/mm/swapfile.c Sat Apr 12 16:21:01 2003 +++ b/mm/swapfile.c Sat Apr 19 23:22:46 2003 @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -300,7 +300,7 @@ struct swap_info_struct * p; swp_entry_t entry; - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); BUG_ON(!PageLocked(page)); if (!PageSwapCache(page)) @@ -355,7 +355,7 @@ if (page) { int one_user; - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); page_cache_get(page); one_user = (page_count(page) == 2); /* Only cache user (+us), or swap space full? Free it! */ @@ -590,6 +590,11 @@ * to swapoff for a while, then reappear - but that is rare. */ while ((i = find_next_to_unuse(si, i))) { + if (signal_pending(current)) { + retval = -EINTR; + break; + } + /* * Get a page for the entry, using the existing swap * cache page if there is one. Otherwise, get a clean @@ -759,8 +764,7 @@ /* * Make sure that we aren't completely killing - * interactive performance. Interruptible check on - * signal_pending() would be nice, but changes the spec? + * interactive performance. */ cond_resched(); } @@ -1029,12 +1033,18 @@ } prev = type; } - err = -EINVAL; if (type < 0) { + err = -EINVAL; + swap_list_unlock(); + goto out_dput; + } + if (vm_enough_memory(p->pages)) + vm_unacct_memory(p->pages); + else { + err = -ENOMEM; swap_list_unlock(); goto out_dput; } - if (prev < 0) { swap_list.head = p->next; } else { @@ -1048,7 +1058,9 @@ total_swap_pages -= p->pages; p->flags &= ~SWP_WRITEOK; swap_list_unlock(); + current->flags |= PF_SWAPOFF; err = try_to_unuse(type); + current->flags &= ~PF_SWAPOFF; if (err) { /* re-insert swap space back into swap_list */ swap_list_lock(); diff -Nru a/mm/vmalloc.c b/mm/vmalloc.c --- a/mm/vmalloc.c Thu Oct 31 07:28:17 2002 +++ b/mm/vmalloc.c Sat Apr 19 23:22:50 2003 @@ -308,7 +308,7 @@ * * @addr: memory base address * - * Free the virtually continguos memory area starting at @addr, as + * Free the virtually contiguous memory area starting at @addr, as * obtained from vmalloc(), vmalloc_32() or __vmalloc(). * * May not be called in interrupt context. @@ -324,7 +324,7 @@ * * @addr: memory base address * - * Free the virtually continguos memory area starting at @addr, + * Free the virtually contiguous memory area starting at @addr, * which was created from the page array passed to vmap(). * * May not be called in interrupt context. @@ -336,25 +336,28 @@ } /** - * vmap - map an array of pages into virtually continguos space + * vmap - map an array of pages into virtually contiguous space * * @pages: array of page pointers * @count: number of pages to map + * @flags: vm_area->flags + * @prot: page protection for the mapping * - * Maps @count pages from @pages into continguos kernel virtual + * Maps @count pages from @pages into contiguous kernel virtual * space. */ -void *vmap(struct page **pages, unsigned int count) +void *vmap(struct page **pages, unsigned int count, + unsigned long flags, pgprot_t prot) { struct vm_struct *area; if (count > num_physpages) return NULL; - area = get_vm_area((count << PAGE_SHIFT), VM_MAP); + area = get_vm_area((count << PAGE_SHIFT), flags); if (!area) return NULL; - if (map_vm_area(area, PAGE_KERNEL, &pages)) { + if (map_vm_area(area, prot, &pages)) { vunmap(area->addr); return NULL; } @@ -363,14 +366,14 @@ } /** - * __vmalloc - allocate virtually continguos memory + * __vmalloc - allocate virtually contiguous memory * * @size: allocation size * @gfp_mask: flags for the page level allocator * @prot: protection mask for the allocated pages * * Allocate enough pages to cover @size from the page level - * allocator with @gfp_mask flags. Map them into continguos + * allocator with @gfp_mask flags. Map them into contiguous * kernel virtual space, using a pagetable protection of @prot. */ void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot) @@ -418,12 +421,12 @@ } /** - * vmalloc - allocate virtually continguos memory + * vmalloc - allocate virtually contiguous memory * * @size: allocation size * * Allocate enough pages to cover @size from the page level - * allocator and map them into continguos kernel virtual space. + * allocator and map them into contiguous kernel virtual space. * * For tight cotrol over page level allocator and protection flags * use __vmalloc() instead. @@ -434,12 +437,12 @@ } /** - * vmalloc_32 - allocate virtually continguos memory (32bit addressable) + * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) * * @size: allocation size * * Allocate enough 32bit PA addressable pages to cover @size from the - * page level allocator and map them into continguos kernel virtual space. + * page level allocator and map them into contiguous kernel virtual space. */ void *vmalloc_32(unsigned long size) { diff -Nru a/mm/vmscan.c b/mm/vmscan.c --- a/mm/vmscan.c Tue Apr 8 03:16:30 2003 +++ b/mm/vmscan.c Sat Apr 19 23:22:51 2003 @@ -22,7 +22,8 @@ #include #include #include -#include /* for try_to_release_page() */ +#include /* for try_to_release_page(), + buffer_heads_over_limit */ #include #include #include @@ -134,11 +135,9 @@ * If the vm encounted mapped pages on the LRU it increase the pressure on * slab to avoid swapping. * - * FIXME: do not do for zone highmem - * * We do weird things to avoid (scanned*seeks*entries) overflowing 32 bits. */ -static int shrink_slab(long scanned, unsigned int gfp_mask) +static int shrink_slab(long scanned, unsigned int gfp_mask) { struct shrinker *shrinker; long pages; @@ -804,8 +803,7 @@ * excessive rotation of the inactive list, which is _supposed_ to be an LRU, * yes? */ -int -try_to_free_pages(struct zone *classzone, +int try_to_free_pages(struct zone *classzone, unsigned int gfp_mask, unsigned int order) { int priority; @@ -835,9 +833,10 @@ /* Take a nap, wait for some writeback to complete */ blk_congestion_wait(WRITE, HZ/10); - shrink_slab(total_scanned, gfp_mask); + if (classzone - classzone->zone_pgdat->node_zones < ZONE_HIGHMEM) + shrink_slab(total_scanned, gfp_mask); } - if (gfp_mask & __GFP_FS) + if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY)) out_of_memory(); return 0; } @@ -895,7 +894,8 @@ max_scan = SWAP_CLUSTER_MAX; to_free -= shrink_zone(zone, max_scan, GFP_KERNEL, to_reclaim, &nr_mapped, ps, priority); - shrink_slab(max_scan + nr_mapped, GFP_KERNEL); + if (i < ZONE_HIGHMEM) + shrink_slab(max_scan + nr_mapped, GFP_KERNEL); if (zone->all_unreclaimable) continue; if (zone->pages_scanned > zone->present_pages * 2) diff -Nru a/net/Kconfig b/net/Kconfig --- a/net/Kconfig Fri Apr 4 10:01:38 2003 +++ b/net/Kconfig Sun Apr 20 12:56:51 2003 @@ -18,7 +18,7 @@ For a general introduction to Linux networking, it is highly recommended to read the NET-HOWTO, available from - . + . menu "Networking options" depends on NET @@ -162,7 +162,7 @@ For an excellent introduction to Linux networking, please read the NET-3-HOWTO, available from - . + . This option is also necessary if you want to use the full power of term (term is a program which gives you almost full Internet @@ -294,7 +294,7 @@ Novell client ncpfs (available from ) or from within the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, - available from ). In order + available from ). In order to do the former, you'll also have to say Y to "NCP file system support", below. @@ -307,7 +307,7 @@ or mars_nwe from . For more information, read the IPX-HOWTO available from - . + . General information about how to connect Linux, Windows machines and Macs is on the WWW at . @@ -339,7 +339,7 @@ General information about how to connect Linux, Windows machines and Macs is on the WWW at . The NET-3-HOWTO, available from - , contains valuable + , contains valuable information as well. This driver is also available as a module ( = code which can be diff -Nru a/net/ax25/Kconfig b/net/ax25/Kconfig --- a/net/ax25/Kconfig Sun Feb 9 17:29:49 2003 +++ b/net/ax25/Kconfig Sun Apr 20 12:56:51 2003 @@ -13,7 +13,7 @@ help If you want to connect your Linux box to an amateur radio, answer Y here. You want to read and - the AX25-HOWTO, available from . + the AX25-HOWTO, available from . Note that the answer to this question won't directly affect the kernel: saying N will just cause the configurator to skip all @@ -42,7 +42,7 @@ Information about where to get supporting software for Linux amateur radio as well as information about how to configure an AX.25 port is contained in the AX25-HOWTO, available from - . You might also want to + . You might also want to check out the file in the kernel source. More information about digital amateur radio in general is on the WWW at @@ -76,7 +76,7 @@ A comprehensive listing of all the software for Linux amateur radio users as well as information about how to configure an AX.25 port is contained in the AX25-HOWTO, available from - . You also might want to + . You also might want to check out the file . More information about digital amateur radio in general is on the WWW at . @@ -97,7 +97,7 @@ A comprehensive listing of all the software for Linux amateur radio users as well as information about how to configure an AX.25 port is contained in the AX25-HOWTO, available from - . You also might want to + . You also might want to check out the file . More information about digital amateur radio in general is on the WWW at . diff -Nru a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c --- a/net/ipv6/xfrm6_input.c Mon Apr 14 11:25:51 2003 +++ b/net/ipv6/xfrm6_input.c Sat Apr 19 20:41:29 2003 @@ -136,7 +136,7 @@ unsigned char *tmp_hdr = NULL; int hdr_len = 0; u16 nh_offset = 0; - u8 nexthdr = 0; + int nexthdr = 0; nh_offset = ((unsigned char*)&skb->nh.ipv6h->nexthdr) - skb->nh.raw; hdr_len = sizeof(struct ipv6hdr); diff -Nru a/net/ipx/Kconfig b/net/ipx/Kconfig --- a/net/ipx/Kconfig Tue Oct 29 17:16:55 2002 +++ b/net/ipx/Kconfig Sun Apr 20 12:56:51 2003 @@ -12,7 +12,7 @@ same address). The way this is done is to create a virtual internal "network" inside your box and to assign an IPX address to this network. Say Y here if you want to do this; read the IPX-HOWTO at - for details. + for details. The full internal IPX network enables you to allocate sockets on different virtual nodes of the internal network. This is done by diff -Nru a/net/irda/Kconfig b/net/irda/Kconfig --- a/net/irda/Kconfig Sun Feb 9 17:29:49 2003 +++ b/net/irda/Kconfig Sun Apr 20 12:56:51 2003 @@ -16,7 +16,7 @@ some user-space utilities like irattach. For more information, see the file . You also want to read the IR-HOWTO, available at - . + . If you want to exchange bits of data (vCal, vCard) with a PDA, you will need to install some OBEX application, such as OpenObex : diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c Tue Feb 5 07:24:36 2002 +++ b/net/sched/cls_api.c Sun Apr 20 00:25:22 2003 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -223,8 +224,9 @@ tp->q = q; tp->classify = tp_ops->classify; tp->classid = parent; - err = tp_ops->init(tp); - if (err) { + err = -EBUSY; + if (!try_module_get(tp_ops->owner) || + (err = tp_ops->init(tp)) != 0) { kfree(tp); goto errout; } @@ -248,6 +250,7 @@ write_unlock(&qdisc_tree_lock); tp->ops->destroy(tp); + module_put(tp->ops->owner); kfree(tp); err = 0; goto errout; diff -Nru a/net/sched/cls_fw.c b/net/sched/cls_fw.c --- a/net/sched/cls_fw.c Tue Feb 5 07:24:36 2002 +++ b/net/sched/cls_fw.c Sun Apr 20 00:25:22 2003 @@ -117,7 +117,6 @@ static int fw_init(struct tcf_proto *tp) { - MOD_INC_USE_COUNT; return 0; } @@ -127,10 +126,8 @@ struct fw_filter *f; int h; - if (head == NULL) { - MOD_DEC_USE_COUNT; + if (head == NULL) return; - } for (h=0; h<256; h++) { while ((f=head->ht[h]) != NULL) { @@ -146,7 +143,6 @@ } } kfree(head); - MOD_DEC_USE_COUNT; } static int fw_delete(struct tcf_proto *tp, unsigned long arg) @@ -351,18 +347,18 @@ } struct tcf_proto_ops cls_fw_ops = { - NULL, - "fw", - fw_classify, - fw_init, - fw_destroy, - - fw_get, - fw_put, - fw_change, - fw_delete, - fw_walk, - fw_dump + .next = NULL, + .kind = "fw", + .classify = fw_classify, + .init = fw_init, + .destroy = fw_destroy, + .get = fw_get, + .put = fw_put, + .change = fw_change, + .delete = fw_delete, + .walk = fw_walk, + .dump = fw_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/cls_route.c b/net/sched/cls_route.c --- a/net/sched/cls_route.c Fri Oct 11 16:07:31 2002 +++ b/net/sched/cls_route.c Sun Apr 20 00:25:22 2003 @@ -272,7 +272,6 @@ static int route4_init(struct tcf_proto *tp) { - MOD_INC_USE_COUNT; return 0; } @@ -281,10 +280,8 @@ struct route4_head *head = xchg(&tp->root, NULL); int h1, h2; - if (head == NULL) { - MOD_DEC_USE_COUNT; + if (head == NULL) return; - } for (h1=0; h1<=256; h1++) { struct route4_bucket *b; @@ -309,7 +306,6 @@ } } kfree(head); - MOD_DEC_USE_COUNT; } static int route4_delete(struct tcf_proto *tp, unsigned long arg) @@ -607,18 +603,18 @@ } struct tcf_proto_ops cls_route4_ops = { - NULL, - "route", - route4_classify, - route4_init, - route4_destroy, - - route4_get, - route4_put, - route4_change, - route4_delete, - route4_walk, - route4_dump + .next = NULL, + .kind = "route", + .classify = route4_classify, + .init = route4_init, + .destroy = route4_destroy, + .get = route4_get, + .put = route4_put, + .change = route4_change, + .delete = route4_delete, + .walk = route4_walk, + .dump = route4_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h --- a/net/sched/cls_rsvp.h Mon Apr 14 15:42:04 2003 +++ b/net/sched/cls_rsvp.h Sun Apr 20 00:25:22 2003 @@ -242,14 +242,12 @@ { struct rsvp_head *data; - MOD_INC_USE_COUNT; data = kmalloc(sizeof(struct rsvp_head), GFP_KERNEL); if (data) { memset(data, 0, sizeof(struct rsvp_head)); tp->root = data; return 0; } - MOD_DEC_USE_COUNT; return -ENOBUFS; } @@ -289,7 +287,6 @@ } } kfree(data); - MOD_DEC_USE_COUNT; } static int rsvp_delete(struct tcf_proto *tp, unsigned long arg) @@ -668,18 +665,18 @@ } struct tcf_proto_ops RSVP_OPS = { - NULL, - RSVP_ID, - rsvp_classify, - rsvp_init, - rsvp_destroy, - - rsvp_get, - rsvp_put, - rsvp_change, - rsvp_delete, - rsvp_walk, - rsvp_dump + .next = NULL, + .kind = RSVP_ID, + .classify = rsvp_classify, + .init = rsvp_init, + .destroy = rsvp_destroy, + .get = rsvp_get, + .put = rsvp_put, + .change = rsvp_change, + .delete = rsvp_delete, + .walk = rsvp_walk, + .dump = rsvp_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c --- a/net/sched/cls_tcindex.c Tue Feb 5 07:24:36 2002 +++ b/net/sched/cls_tcindex.c Sun Apr 20 00:25:22 2003 @@ -144,12 +144,10 @@ struct tcindex_data *p; DPRINTK("tcindex_init(tp %p)\n",tp); - MOD_INC_USE_COUNT; p = kmalloc(sizeof(struct tcindex_data),GFP_KERNEL); - if (!p) { - MOD_DEC_USE_COUNT; + if (!p) return -ENOMEM; - } + tp->root = p; p->perfect = NULL; p->h = NULL; @@ -417,7 +415,6 @@ kfree(p->h); kfree(p); tp->root = NULL; - MOD_DEC_USE_COUNT; } @@ -480,18 +477,18 @@ } struct tcf_proto_ops cls_tcindex_ops = { - NULL, - "tcindex", - tcindex_classify, - tcindex_init, - tcindex_destroy, - - tcindex_get, - tcindex_put, - tcindex_change, - tcindex_delete, - tcindex_walk, - tcindex_dump + .next = NULL, + .kind = "tcindex", + .classify = tcindex_classify, + .init = tcindex_init, + .destroy = tcindex_destroy, + .get = tcindex_get, + .put = tcindex_put, + .change = tcindex_change, + .delete = tcindex_delete, + .walk = tcindex_walk, + .dump = tcindex_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/cls_u32.c b/net/sched/cls_u32.c --- a/net/sched/cls_u32.c Mon Apr 14 15:42:04 2003 +++ b/net/sched/cls_u32.c Sun Apr 20 00:25:22 2003 @@ -257,17 +257,14 @@ struct tc_u_hnode *root_ht; struct tc_u_common *tp_c; - MOD_INC_USE_COUNT; - for (tp_c = u32_list; tp_c; tp_c = tp_c->next) if (tp_c->q == tp->q) break; root_ht = kmalloc(sizeof(*root_ht), GFP_KERNEL); - if (root_ht == NULL) { - MOD_DEC_USE_COUNT; + if (root_ht == NULL) return -ENOBUFS; - } + memset(root_ht, 0, sizeof(*root_ht)); root_ht->divisor = 0; root_ht->refcnt++; @@ -277,7 +274,6 @@ tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL); if (tp_c == NULL) { kfree(root_ht); - MOD_DEC_USE_COUNT; return -ENOBUFS; } memset(tp_c, 0, sizeof(*tp_c)); @@ -402,7 +398,6 @@ kfree(tp_c); } - MOD_DEC_USE_COUNT; tp->data = NULL; } @@ -690,18 +685,18 @@ } struct tcf_proto_ops cls_u32_ops = { - NULL, - "u32", - u32_classify, - u32_init, - u32_destroy, - - u32_get, - u32_put, - u32_change, - u32_delete, - u32_walk, - u32_dump + .next = NULL, + .kind = "u32", + .classify = u32_classify, + .init = u32_init, + .destroy = u32_destroy, + .get = u32_get, + .put = u32_put, + .change = u32_change, + .delete = u32_delete, + .walk = u32_walk, + .dump = u32_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c Wed Nov 6 17:27:58 2002 +++ b/net/sched/sch_api.c Sun Apr 20 00:57:16 2003 @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -447,6 +448,10 @@ else sch->handle = handle; + err = -EBUSY; + if (!try_module_get(ops->owner)) + goto err_out; + if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) { write_lock(&qdisc_tree_lock); sch->next = dev->qdisc_list; @@ -458,6 +463,7 @@ #endif return sch; } + module_put(ops->owner); err_out: *errp = err; diff -Nru a/net/sched/sch_atm.c b/net/sched/sch_atm.c --- a/net/sched/sch_atm.c Thu Mar 20 00:45:11 2003 +++ b/net/sched/sch_atm.c Sun Apr 20 00:57:16 2003 @@ -575,7 +575,6 @@ p->link.ref = 1; p->link.next = NULL; tasklet_init(&p->task,sch_atm_dequeue,(unsigned long) sch); - MOD_INC_USE_COUNT; return 0; } @@ -612,7 +611,6 @@ } } tasklet_kill(&p->task); - MOD_DEC_USE_COUNT; } @@ -663,41 +661,35 @@ return 0; } -static struct Qdisc_class_ops atm_class_ops = -{ - .graft = atm_tc_graft, - .leaf = atm_tc_leaf, - .get = atm_tc_get, - .put = atm_tc_put, - .change = atm_tc_change, - .delete = atm_tc_delete, - .walk = atm_tc_walk, - - .tcf_chain = atm_tc_find_tcf, - .bind_tcf = atm_tc_bind_filter, - .unbind_tcf = atm_tc_put, - - .dump = atm_tc_dump_class, +static struct Qdisc_class_ops atm_class_ops = { + .graft = atm_tc_graft, + .leaf = atm_tc_leaf, + .get = atm_tc_get, + .put = atm_tc_put, + .change = atm_tc_change, + .delete = atm_tc_delete, + .walk = atm_tc_walk, + .tcf_chain = atm_tc_find_tcf, + .bind_tcf = atm_tc_bind_filter, + .unbind_tcf = atm_tc_put, + .dump = atm_tc_dump_class, }; -struct Qdisc_ops atm_qdisc_ops = -{ - .next = NULL, - .cl_ops = &atm_class_ops, - .id = "atm", - .priv_size = sizeof(struct atm_qdisc_data), - - .enqueue = atm_tc_enqueue, - .dequeue = atm_tc_dequeue, - .requeue = atm_tc_requeue, - .drop = atm_tc_drop, - - .init = atm_tc_init, - .reset = atm_tc_reset, - .destroy = atm_tc_destroy, - .change = NULL, - - .dump = atm_tc_dump +struct Qdisc_ops atm_qdisc_ops = { + .next = NULL, + .cl_ops = &atm_class_ops, + .id = "atm", + .priv_size = sizeof(struct atm_qdisc_data), + .enqueue = atm_tc_enqueue, + .dequeue = atm_tc_dequeue, + .requeue = atm_tc_requeue, + .drop = atm_tc_drop, + .init = atm_tc_init, + .reset = atm_tc_reset, + .destroy = atm_tc_destroy, + .change = NULL, + .dump = atm_tc_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c Sat Feb 15 13:11:57 2003 +++ b/net/sched/sch_cbq.c Sun Apr 20 00:57:16 2003 @@ -1411,11 +1411,8 @@ r = RTA_DATA(tb[TCA_CBQ_RATE-1]); - MOD_INC_USE_COUNT; - if ((q->link.R_tab = qdisc_get_rtab(r, tb[TCA_CBQ_RTAB-1])) == NULL) { - MOD_DEC_USE_COUNT; + if ((q->link.R_tab = qdisc_get_rtab(r, tb[TCA_CBQ_RTAB-1])) == NULL) return -EINVAL; - } q->link.refcnt = 1; q->link.sibling = &q->link; @@ -1749,7 +1746,6 @@ } qdisc_put_rtab(q->link.R_tab); - MOD_DEC_USE_COUNT; } static void cbq_put(struct Qdisc *sch, unsigned long arg) @@ -2064,41 +2060,35 @@ } } -static struct Qdisc_class_ops cbq_class_ops = -{ - .graft = cbq_graft, - .leaf = cbq_leaf, - .get = cbq_get, - .put = cbq_put, - .change = cbq_change_class, - .delete = cbq_delete, - .walk = cbq_walk, - - .tcf_chain = cbq_find_tcf, - .bind_tcf = cbq_bind_filter, - .unbind_tcf = cbq_unbind_filter, - - .dump = cbq_dump_class, +static struct Qdisc_class_ops cbq_class_ops = { + .graft = cbq_graft, + .leaf = cbq_leaf, + .get = cbq_get, + .put = cbq_put, + .change = cbq_change_class, + .delete = cbq_delete, + .walk = cbq_walk, + .tcf_chain = cbq_find_tcf, + .bind_tcf = cbq_bind_filter, + .unbind_tcf = cbq_unbind_filter, + .dump = cbq_dump_class, }; -struct Qdisc_ops cbq_qdisc_ops = -{ - .next = NULL, - .cl_ops = &cbq_class_ops, - .id = "cbq", - .priv_size = sizeof(struct cbq_sched_data), - - .enqueue = cbq_enqueue, - .dequeue = cbq_dequeue, - .requeue = cbq_requeue, - .drop = cbq_drop, - - .init = cbq_init, - .reset = cbq_reset, - .destroy = cbq_destroy, - .change = NULL, - - .dump = cbq_dump, +struct Qdisc_ops cbq_qdisc_ops = { + .next = NULL, + .cl_ops = &cbq_class_ops, + .id = "cbq", + .priv_size = sizeof(struct cbq_sched_data), + .enqueue = cbq_enqueue, + .dequeue = cbq_dequeue, + .requeue = cbq_requeue, + .drop = cbq_drop, + .init = cbq_init, + .reset = cbq_reset, + .destroy = cbq_destroy, + .change = NULL, + .dump = cbq_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_csz.c b/net/sched/sch_csz.c --- a/net/sched/sch_csz.c Thu Apr 10 22:56:20 2003 +++ b/net/sched/sch_csz.c Sun Apr 20 00:57:16 2003 @@ -756,8 +756,6 @@ q->filter_list = tp->next; tp->ops->destroy(tp); } - - MOD_DEC_USE_COUNT; } static int csz_init(struct Qdisc *sch, struct rtattr *opt) @@ -799,7 +797,6 @@ q->wd_timer.data = (unsigned long)sch; q->wd_timer.function = csz_watchdog; #endif - MOD_INC_USE_COUNT; return 0; } @@ -1018,42 +1015,35 @@ return &q->filter_list; } -struct Qdisc_class_ops csz_class_ops = -{ - .graft = csz_graft, - .leaf = csz_leaf, - - .get = csz_get, - .put = csz_put, - .change = csz_change, - .delete = csz_delete, - .walk = csz_walk, - - .tcf_chain = csz_find_tcf, - .bind_tcf = csz_bind, - .unbind_tcf = csz_put, - - .dump = csz_dump_class, +struct Qdisc_class_ops csz_class_ops = { + .graft = csz_graft, + .leaf = csz_leaf, + .get = csz_get, + .put = csz_put, + .change = csz_change, + .delete = csz_delete, + .walk = csz_walk, + .tcf_chain = csz_find_tcf, + .bind_tcf = csz_bind, + .unbind_tcf = csz_put, + .dump = csz_dump_class, }; -struct Qdisc_ops csz_qdisc_ops = -{ - .next = NULL, - .cl_ops = &csz_class_ops, - .id = "csz", - .priv_size = sizeof(struct csz_sched_data), - - .enqueue = csz_enqueue, - .dequeue = csz_dequeue, - .requeue = NULL, - .drop = NULL, - - .init = csz_init, - .reset = csz_reset, - .destroy = csz_destroy, - .change = NULL, - - .dump = csz_dump, +struct Qdisc_ops csz_qdisc_ops = { + .next = NULL, + .cl_ops = &csz_class_ops, + .id = "csz", + .priv_size = sizeof(struct csz_sched_data), + .enqueue = csz_enqueue, + .dequeue = csz_dequeue, + .requeue = NULL, + .drop = NULL, + .init = csz_init, + .reset = csz_reset, + .destroy = csz_destroy, + .change = NULL, + .dump = csz_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c --- a/net/sched/sch_dsmark.c Wed Apr 9 22:08:17 2003 +++ b/net/sched/sch_dsmark.c Sun Apr 20 00:57:16 2003 @@ -353,7 +353,6 @@ if (!(p->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops))) p->q = &noop_qdisc; DPRINTK("dsmark_init: qdisc %p\n",&p->q); - MOD_INC_USE_COUNT; return 0; } @@ -382,7 +381,6 @@ qdisc_destroy(p->q); p->q = &noop_qdisc; kfree(p->mask); - MOD_DEC_USE_COUNT; } @@ -433,41 +431,35 @@ return -1; } -static struct Qdisc_class_ops dsmark_class_ops = -{ - .graft = dsmark_graft, - .leaf = dsmark_leaf, - .get = dsmark_get, - .put = dsmark_put, - .change = dsmark_change, - .delete = dsmark_delete, - .walk = dsmark_walk, - - .tcf_chain = dsmark_find_tcf, - .bind_tcf = dsmark_bind_filter, - .unbind_tcf = dsmark_put, - - .dump = dsmark_dump_class, +static struct Qdisc_class_ops dsmark_class_ops = { + .graft = dsmark_graft, + .leaf = dsmark_leaf, + .get = dsmark_get, + .put = dsmark_put, + .change = dsmark_change, + .delete = dsmark_delete, + .walk = dsmark_walk, + .tcf_chain = dsmark_find_tcf, + .bind_tcf = dsmark_bind_filter, + .unbind_tcf = dsmark_put, + .dump = dsmark_dump_class, }; -struct Qdisc_ops dsmark_qdisc_ops = -{ - .next = NULL, - .cl_ops = &dsmark_class_ops, - .id = "dsmark", - .priv_size = sizeof(struct dsmark_qdisc_data), - - .enqueue = dsmark_enqueue, - .dequeue = dsmark_dequeue, - .requeue = dsmark_requeue, - .drop = dsmark_drop, - - .init = dsmark_init, - .reset = dsmark_reset, - .destroy = dsmark_destroy, - .change = NULL, - - .dump = dsmark_dump +struct Qdisc_ops dsmark_qdisc_ops = { + .next = NULL, + .cl_ops = &dsmark_class_ops, + .id = "dsmark", + .priv_size = sizeof(struct dsmark_qdisc_data), + .enqueue = dsmark_enqueue, + .dequeue = dsmark_dequeue, + .requeue = dsmark_requeue, + .drop = dsmark_drop, + .init = dsmark_init, + .reset = dsmark_reset, + .destroy = dsmark_destroy, + .change = NULL, + .dump = dsmark_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c --- a/net/sched/sch_fifo.c Mon Oct 7 07:44:51 2002 +++ b/net/sched/sch_fifo.c Sun Apr 20 00:57:16 2003 @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -168,42 +169,36 @@ return -1; } -struct Qdisc_ops pfifo_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "pfifo", - .priv_size = sizeof(struct fifo_sched_data), - - .enqueue = pfifo_enqueue, - .dequeue = pfifo_dequeue, - .requeue = pfifo_requeue, - .drop = fifo_drop, - - .init = fifo_init, - .reset = fifo_reset, - .destroy = NULL, - .change = fifo_init, - - .dump = fifo_dump, +struct Qdisc_ops pfifo_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "pfifo", + .priv_size = sizeof(struct fifo_sched_data), + .enqueue = pfifo_enqueue, + .dequeue = pfifo_dequeue, + .requeue = pfifo_requeue, + .drop = fifo_drop, + .init = fifo_init, + .reset = fifo_reset, + .destroy = NULL, + .change = fifo_init, + .dump = fifo_dump, + .owner = THIS_MODULE, }; -struct Qdisc_ops bfifo_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "bfifo", - .priv_size = sizeof(struct fifo_sched_data), - - .enqueue = bfifo_enqueue, - .dequeue = bfifo_dequeue, - .requeue = bfifo_requeue, - .drop = fifo_drop, - - .init = fifo_init, - .reset = fifo_reset, - .destroy = NULL, - .change = fifo_init, - - .dump = fifo_dump, +struct Qdisc_ops bfifo_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "bfifo", + .priv_size = sizeof(struct fifo_sched_data), + .enqueue = bfifo_enqueue, + .dequeue = bfifo_dequeue, + .requeue = bfifo_requeue, + .drop = fifo_drop, + .init = fifo_init, + .reset = fifo_reset, + .destroy = NULL, + .change = fifo_init, + .dump = fifo_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c Mon Oct 7 07:44:51 2002 +++ b/net/sched/sch_generic.c Sun Apr 20 00:57:16 2003 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -222,45 +223,40 @@ return NET_XMIT_CN; } -struct Qdisc_ops noop_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "noop", - .priv_size = 0, - - .enqueue = noop_enqueue, - .dequeue = noop_dequeue, - .requeue = noop_requeue, +struct Qdisc_ops noop_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "noop", + .priv_size = 0, + .enqueue = noop_enqueue, + .dequeue = noop_dequeue, + .requeue = noop_requeue, + .owner = THIS_MODULE, }; -struct Qdisc noop_qdisc = -{ - .enqueue = noop_enqueue, - .dequeue = noop_dequeue, - .flags = TCQ_F_BUILTIN, - .ops = &noop_qdisc_ops, +struct Qdisc noop_qdisc = { + .enqueue = noop_enqueue, + .dequeue = noop_dequeue, + .flags = TCQ_F_BUILTIN, + .ops = &noop_qdisc_ops, }; - -struct Qdisc_ops noqueue_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "noqueue", - .priv_size = 0, - - .enqueue = noop_enqueue, - .dequeue = noop_dequeue, - .requeue = noop_requeue, +struct Qdisc_ops noqueue_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "noqueue", + .priv_size = 0, + .enqueue = noop_enqueue, + .dequeue = noop_dequeue, + .requeue = noop_requeue, + .owner = THIS_MODULE, }; -struct Qdisc noqueue_qdisc = -{ - .enqueue = NULL, - .dequeue = noop_dequeue, - .flags = TCQ_F_BUILTIN, - .ops = &noqueue_qdisc_ops, +struct Qdisc noqueue_qdisc = { + .enqueue = NULL, + .dequeue = noop_dequeue, + .flags = TCQ_F_BUILTIN, + .ops = &noqueue_qdisc_ops, }; @@ -343,19 +339,17 @@ return 0; } -static struct Qdisc_ops pfifo_fast_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "pfifo_fast", - .priv_size = 3 * sizeof(struct sk_buff_head), - - .enqueue = pfifo_fast_enqueue, - .dequeue = pfifo_fast_dequeue, - .requeue = pfifo_fast_requeue, - - .init = pfifo_fast_init, - .reset = pfifo_fast_reset, +static struct Qdisc_ops pfifo_fast_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "pfifo_fast", + .priv_size = 3 * sizeof(struct sk_buff_head), + .enqueue = pfifo_fast_enqueue, + .dequeue = pfifo_fast_dequeue, + .requeue = pfifo_fast_requeue, + .init = pfifo_fast_init, + .reset = pfifo_fast_reset, + .owner = THIS_MODULE, }; struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops) @@ -422,6 +416,7 @@ ops->reset(qdisc); if (ops->destroy) ops->destroy(qdisc); + module_put(ops->owner); if (!(qdisc->flags&TCQ_F_BUILTIN)) kfree(qdisc); } diff -Nru a/net/sched/sch_gred.c b/net/sched/sch_gred.c --- a/net/sched/sch_gred.c Tue Feb 25 11:05:27 2003 +++ b/net/sched/sch_gred.c Sun Apr 20 00:57:16 2003 @@ -348,7 +348,6 @@ table->grio=sopt->grio; table->initd=0; /* probably need to clear all the table DP entries as well */ - MOD_INC_USE_COUNT; return 0; } @@ -490,7 +489,6 @@ table->def=sopt->def_DP; table->grio=sopt->grio; table->initd=0; - MOD_INC_USE_COUNT; return 0; } @@ -602,27 +600,23 @@ if (table->tab[i]) kfree(table->tab[i]); } - MOD_DEC_USE_COUNT; } -struct Qdisc_ops gred_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "gred", - .priv_size = sizeof(struct gred_sched), - - .enqueue = gred_enqueue, - .dequeue = gred_dequeue, - .requeue = gred_requeue, - .drop = gred_drop, - - .init = gred_init, - .reset = gred_reset, - .destroy = gred_destroy, - .change = gred_change, - - .dump = gred_dump, +struct Qdisc_ops gred_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "gred", + .priv_size = sizeof(struct gred_sched), + .enqueue = gred_enqueue, + .dequeue = gred_dequeue, + .requeue = gred_requeue, + .drop = gred_drop, + .init = gred_init, + .reset = gred_reset, + .destroy = gred_destroy, + .change = gred_change, + .dump = gred_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c --- a/net/sched/sch_htb.c Fri Apr 11 00:08:40 2003 +++ b/net/sched/sch_htb.c Sun Apr 20 00:57:16 2003 @@ -1167,7 +1167,6 @@ q->rate2quantum = 1; q->defcls = gopt->defcls; - MOD_INC_USE_COUNT; return 0; } @@ -1352,7 +1351,6 @@ htb_destroy_filters(&q->filter_list); __skb_queue_purge(&q->direct_queue); - MOD_DEC_USE_COUNT; } static int htb_delete(struct Qdisc *sch, unsigned long arg) @@ -1588,41 +1586,35 @@ } } -static struct Qdisc_class_ops htb_class_ops = -{ - htb_graft, - htb_leaf, - htb_get, - htb_put, - htb_change_class, - htb_delete, - htb_walk, - - htb_find_tcf, - htb_bind_filter, - htb_unbind_filter, - - htb_dump_class, +static struct Qdisc_class_ops htb_class_ops = { + .graft = htb_graft, + .leaf = htb_leaf, + .get = htb_get, + .put = htb_put, + .change = htb_change_class, + .delete = htb_delete, + .walk = htb_walk, + .tcf_chain = htb_find_tcf, + .bind_tcf = htb_bind_filter, + .unbind_tcf = htb_unbind_filter, + .dump = htb_dump_class, }; -struct Qdisc_ops htb_qdisc_ops = -{ - NULL, - &htb_class_ops, - "htb", - sizeof(struct htb_sched), - - htb_enqueue, - htb_dequeue, - htb_requeue, - htb_drop, - - htb_init, - htb_reset, - htb_destroy, - NULL /* htb_change */, - - htb_dump, +struct Qdisc_ops htb_qdisc_ops = { + .next = NULL, + .cl_ops = &htb_class_ops, + .id = "htb", + .priv_size = sizeof(struct htb_sched), + .enqueue = htb_enqueue, + .dequeue = htb_dequeue, + .requeue = htb_requeue, + .drop = htb_drop, + .init = htb_init, + .reset = htb_reset, + .destroy = htb_destroy, + .change = NULL /* htb_change */, + .dump = htb_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c --- a/net/sched/sch_ingress.c Wed Apr 9 22:08:17 2003 +++ b/net/sched/sch_ingress.c Sun Apr 20 00:57:16 2003 @@ -262,7 +262,6 @@ memset(p, 0, sizeof(*p)); p->filter_list = NULL; p->q = &noop_qdisc; - MOD_INC_USE_COUNT; return 0; error: return -EINVAL; @@ -308,9 +307,6 @@ /* for future use */ qdisc_destroy(p->q); #endif - - MOD_DEC_USE_COUNT; - } @@ -329,41 +325,35 @@ return -1; } -static struct Qdisc_class_ops ingress_class_ops = -{ - .graft = ingress_graft, - .leaf = ingress_leaf, - .get = ingress_get, - .put = ingress_put, - .change = ingress_change, - .delete = NULL, - .walk = ingress_walk, - - .tcf_chain = ingress_find_tcf, - .bind_tcf = ingress_bind_filter, - .unbind_tcf = ingress_put, - - .dump = NULL, +static struct Qdisc_class_ops ingress_class_ops = { + .graft = ingress_graft, + .leaf = ingress_leaf, + .get = ingress_get, + .put = ingress_put, + .change = ingress_change, + .delete = NULL, + .walk = ingress_walk, + .tcf_chain = ingress_find_tcf, + .bind_tcf = ingress_bind_filter, + .unbind_tcf = ingress_put, + .dump = NULL, }; -struct Qdisc_ops ingress_qdisc_ops = -{ - .next = NULL, - .cl_ops = &ingress_class_ops, - .id = "ingress", - .priv_size = sizeof(struct ingress_qdisc_data), - - .enqueue = ingress_enqueue, - .dequeue = ingress_dequeue, - .requeue = ingress_requeue, - .drop = ingress_drop, - - .init = ingress_init, - .reset = ingress_reset, - .destroy = ingress_destroy, - .change = NULL, - - .dump = ingress_dump, +struct Qdisc_ops ingress_qdisc_ops = { + .next = NULL, + .cl_ops = &ingress_class_ops, + .id = "ingress", + .priv_size = sizeof(struct ingress_qdisc_data), + .enqueue = ingress_enqueue, + .dequeue = ingress_dequeue, + .requeue = ingress_requeue, + .drop = ingress_drop, + .init = ingress_init, + .reset = ingress_reset, + .destroy = ingress_destroy, + .change = NULL, + .dump = ingress_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c --- a/net/sched/sch_prio.c Thu Apr 10 22:56:20 2003 +++ b/net/sched/sch_prio.c Sun Apr 20 00:57:16 2003 @@ -169,7 +169,6 @@ qdisc_destroy(q->queues[prio]); q->queues[prio] = &noop_qdisc; } - MOD_DEC_USE_COUNT; } static int prio_tune(struct Qdisc *sch, struct rtattr *opt) @@ -233,7 +232,6 @@ if ((err= prio_tune(sch, opt)) != 0) return err; } - MOD_INC_USE_COUNT; return 0; } @@ -369,42 +367,35 @@ return &q->filter_list; } -static struct Qdisc_class_ops prio_class_ops = -{ - .graft = prio_graft, - .leaf = prio_leaf, - - .get = prio_get, - .put = prio_put, - .change = prio_change, - .delete = prio_delete, - .walk = prio_walk, - - .tcf_chain = prio_find_tcf, - .bind_tcf = prio_bind, - .unbind_tcf = prio_put, - - .dump = prio_dump_class, +static struct Qdisc_class_ops prio_class_ops = { + .graft = prio_graft, + .leaf = prio_leaf, + .get = prio_get, + .put = prio_put, + .change = prio_change, + .delete = prio_delete, + .walk = prio_walk, + .tcf_chain = prio_find_tcf, + .bind_tcf = prio_bind, + .unbind_tcf = prio_put, + .dump = prio_dump_class, }; -struct Qdisc_ops prio_qdisc_ops = -{ - .next = NULL, - .cl_ops = &prio_class_ops, - .id = "prio", - .priv_size = sizeof(struct prio_sched_data), - - .enqueue = prio_enqueue, - .dequeue = prio_dequeue, - .requeue = prio_requeue, - .drop = prio_drop, - - .init = prio_init, - .reset = prio_reset, - .destroy = prio_destroy, - .change = prio_tune, - - .dump = prio_dump, +struct Qdisc_ops prio_qdisc_ops = { + .next = NULL, + .cl_ops = &prio_class_ops, + .id = "prio", + .priv_size = sizeof(struct prio_sched_data), + .enqueue = prio_enqueue, + .dequeue = prio_dequeue, + .requeue = prio_requeue, + .drop = prio_drop, + .init = prio_init, + .reset = prio_reset, + .destroy = prio_destroy, + .change = prio_tune, + .dump = prio_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_red.c b/net/sched/sch_red.c --- a/net/sched/sch_red.c Mon Oct 7 07:44:52 2002 +++ b/net/sched/sch_red.c Sun Apr 20 00:57:16 2003 @@ -407,14 +407,7 @@ static int red_init(struct Qdisc* sch, struct rtattr *opt) { - int err; - - MOD_INC_USE_COUNT; - - if ((err = red_change(sch, opt)) != 0) { - MOD_DEC_USE_COUNT; - } - return err; + return red_change(sch, opt); } @@ -458,27 +451,23 @@ static void red_destroy(struct Qdisc *sch) { - MOD_DEC_USE_COUNT; } -struct Qdisc_ops red_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "red", - .priv_size = sizeof(struct red_sched_data), - - .enqueue = red_enqueue, - .dequeue = red_dequeue, - .requeue = red_requeue, - .drop = red_drop, - - .init = red_init, - .reset = red_reset, - .destroy = red_destroy, - .change = red_change, - - .dump = red_dump, +struct Qdisc_ops red_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "red", + .priv_size = sizeof(struct red_sched_data), + .enqueue = red_enqueue, + .dequeue = red_dequeue, + .requeue = red_requeue, + .drop = red_drop, + .init = red_init, + .reset = red_reset, + .destroy = red_destroy, + .change = red_change, + .dump = red_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c --- a/net/sched/sch_sfq.c Sat Apr 12 15:42:42 2003 +++ b/net/sched/sch_sfq.c Sun Apr 20 00:57:16 2003 @@ -431,7 +431,6 @@ } for (i=0; idata; del_timer(&q->perturb_timer); - MOD_DEC_USE_COUNT; } static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb) @@ -464,24 +462,21 @@ return -1; } -struct Qdisc_ops sfq_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "sfq", - .priv_size = sizeof(struct sfq_sched_data), - - .enqueue = sfq_enqueue, - .dequeue = sfq_dequeue, - .requeue = sfq_requeue, - .drop = sfq_drop, - - .init = sfq_init, - .reset = sfq_reset, - .destroy = sfq_destroy, - .change = NULL, - - .dump = sfq_dump, +struct Qdisc_ops sfq_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "sfq", + .priv_size = sizeof(struct sfq_sched_data), + .enqueue = sfq_enqueue, + .dequeue = sfq_dequeue, + .requeue = sfq_requeue, + .drop = sfq_drop, + .init = sfq_init, + .reset = sfq_reset, + .destroy = sfq_destroy, + .change = NULL, + .dump = sfq_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c --- a/net/sched/sch_tbf.c Mon Oct 7 07:44:52 2002 +++ b/net/sched/sch_tbf.c Sun Apr 20 00:57:16 2003 @@ -330,23 +330,17 @@ static int tbf_init(struct Qdisc* sch, struct rtattr *opt) { - int err; struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data; if (opt == NULL) return -EINVAL; - MOD_INC_USE_COUNT; - PSCHED_GET_TIME(q->t_c); init_timer(&q->wd_timer); q->wd_timer.function = tbf_watchdog; q->wd_timer.data = (unsigned long)sch; - if ((err = tbf_change(sch, opt)) != 0) { - MOD_DEC_USE_COUNT; - } - return err; + return tbf_change(sch, opt); } static void tbf_destroy(struct Qdisc *sch) @@ -359,8 +353,6 @@ qdisc_put_rtab(q->P_tab); if (q->R_tab) qdisc_put_rtab(q->R_tab); - - MOD_DEC_USE_COUNT; } static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb) @@ -391,24 +383,20 @@ return -1; } -struct Qdisc_ops tbf_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "tbf", - .priv_size = sizeof(struct tbf_sched_data), - - .enqueue = tbf_enqueue, - .dequeue = tbf_dequeue, - .requeue = tbf_requeue, - .drop = tbf_drop, - - .init = tbf_init, - .reset = tbf_reset, - .destroy = tbf_destroy, - .change = tbf_change, - - .dump = tbf_dump, +struct Qdisc_ops tbf_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "tbf", + .priv_size = sizeof(struct tbf_sched_data), + .enqueue = tbf_enqueue, + .dequeue = tbf_dequeue, + .requeue = tbf_requeue, + .drop = tbf_drop, + .init = tbf_init, + .reset = tbf_reset, + .destroy = tbf_destroy, + .change = tbf_change, + .dump = tbf_dump, }; diff -Nru a/net/sched/sch_teql.c b/net/sched/sch_teql.c --- a/net/sched/sch_teql.c Mon Oct 7 07:44:52 2002 +++ b/net/sched/sch_teql.c Sun Apr 20 00:57:16 2003 @@ -177,8 +177,6 @@ } while ((prev = q) != master->slaves); } - - MOD_DEC_USE_COUNT; } static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt) @@ -222,8 +220,6 @@ m->dev.mtu = dev->mtu; m->dev.flags = (m->dev.flags&~FMASK)|(dev->flags&FMASK); } - - MOD_INC_USE_COUNT; return 0; } @@ -386,14 +382,12 @@ m->dev.mtu = mtu; m->dev.flags = (m->dev.flags&~FMASK) | flags; netif_start_queue(&m->dev); - MOD_INC_USE_COUNT; return 0; } static int teql_master_close(struct net_device *dev) { netif_stop_queue(dev); - MOD_DEC_USE_COUNT; return 0; } @@ -440,20 +434,19 @@ static struct teql_master the_master = { { - .next = NULL, - .cl_ops = NULL, - .id = "", - .priv_size = sizeof(struct teql_sched_data), - - .enqueue = teql_enqueue, - .dequeue = teql_dequeue, - .requeue = teql_requeue, - .drop = NULL, - - .init = teql_qdisc_init, - .reset = teql_reset, - .destroy = teql_destroy, - .dump = NULL, + .next = NULL, + .cl_ops = NULL, + .id = "", + .priv_size = sizeof(struct teql_sched_data), + .enqueue = teql_enqueue, + .dequeue = teql_dequeue, + .requeue = teql_requeue, + .drop = NULL, + .init = teql_qdisc_init, + .reset = teql_reset, + .destroy = teql_destroy, + .dump = NULL, + .owner = THIS_MODULE, },}; @@ -474,6 +467,7 @@ memcpy(the_master.qops.id, the_master.dev.name, IFNAMSIZ); the_master.dev.init = teql_master_init; + SET_MODULE_OWNER(&the_master.dev); err = register_netdevice(&the_master.dev); if (err == 0) { err = register_qdisc(&the_master.qops); diff -Nru a/net/socket.c b/net/socket.c --- a/net/socket.c Fri Apr 18 10:39:05 2003 +++ b/net/socket.c Sat Apr 19 16:21:17 2003 @@ -506,8 +506,13 @@ void sock_release(struct socket *sock) { - if (sock->ops) + if (sock->ops) { + const int family = sock->ops->family; + sock->ops->release(sock); + sock->ops = NULL; + module_put(net_families[family]->owner); + } if (sock->fasync_list) printk(KERN_ERR "sock_release: fasync list not empty!\n"); @@ -1058,11 +1063,12 @@ sock->type = type; + i = -EBUSY; + if (!try_module_get(net_families[family]->owner)) + goto out_release; + if ((i = net_families[family]->create(sock, protocol)) < 0) - { - sock_release(sock); - goto out; - } + goto out_release; *res = sock; security_socket_post_create(sock, family, type, protocol); @@ -1070,6 +1076,9 @@ out: net_family_read_unlock(); return i; +out_release: + sock_release(sock); + goto out; } asmlinkage long sys_socket(int family, int type, int protocol) diff -Nru a/sound/core/sgbuf.c b/sound/core/sgbuf.c --- a/sound/core/sgbuf.c Thu Apr 10 03:28:11 2003 +++ b/sound/core/sgbuf.c Sat Apr 19 23:22:50 2003 @@ -85,7 +85,7 @@ } sgbuf->size = size; - dmab->area = vmap(sgbuf->page_table, sgbuf->pages); + dmab->area = vmap(sgbuf->page_table, sgbuf->pages, VM_MAP, PAGE_KERNEL); if (! dmab->area) goto _failed; return dmab->area; diff -Nru a/sound/core/sound.c b/sound/core/sound.c --- a/sound/core/sound.c Thu Apr 10 03:28:11 2003 +++ b/sound/core/sound.c Fri Apr 18 11:18:17 2003 @@ -68,10 +68,6 @@ static DECLARE_MUTEX(sound_mutex); -#ifdef CONFIG_DEVFS_FS -static devfs_handle_t devfs_handle = NULL; -#endif - #ifdef CONFIG_KMOD /** @@ -343,15 +339,7 @@ if ((err = snd_oss_init_module()) < 0) return err; #endif -#ifdef CONFIG_DEVFS_FS -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) - devfs_handle = devfs_mk_dir(NULL, "snd", 3, NULL); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,5,67) - devfs_handle = devfs_mk_dir(NULL, "snd", NULL); -#else - devfs_handle = devfs_mk_dir("snd"); -#endif -#endif + devfs_mk_dir("snd"); if (register_chrdev(major, "alsa", &snd_fops)) { snd_printk(KERN_ERR "unable to register native major device number %d\n", major); return -EIO; @@ -404,9 +392,7 @@ #endif if (unregister_chrdev(major, "alsa") != 0) snd_printk(KERN_ERR "unable to unregister major device number %d\n", major); -#ifdef CONFIG_DEVFS_FS - devfs_unregister(devfs_handle); -#endif + devfs_remove("snd"); } module_init(alsa_sound_init) diff -Nru a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c --- a/sound/drivers/mpu401/mpu401_uart.c Thu Mar 20 08:41:13 2003 +++ b/sound/drivers/mpu401/mpu401_uart.c Sun Apr 20 14:14:29 2003 @@ -90,7 +90,7 @@ #endif } -static void _snd_mpu401_uart_interrupt(mpu401_t *mpu) +static irqreturn_t _snd_mpu401_uart_interrupt(mpu401_t *mpu) { if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { if (! test_and_set_bit(MPU401_MODE_BIT_RX_LOOP, &mpu->mode)) { @@ -108,6 +108,9 @@ snd_mpu401_uart_output_write(mpu); spin_unlock(&mpu->output_lock); } + + /* FIXME! This should really check whether the irq was for us */ + return IRQ_HANDLED; } /** @@ -118,13 +121,13 @@ * * Processes the interrupt for MPU401-UART i/o. */ -void snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) { mpu401_t *mpu = snd_magic_cast(mpu401_t, dev_id, return); if (mpu == NULL) - return; - _snd_mpu401_uart_interrupt(mpu); + return IRQ_NONE; + return _snd_mpu401_uart_interrupt(mpu); } /* diff -Nru a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c --- a/sound/drivers/mtpav.c Wed Mar 19 09:22:05 2003 +++ b/sound/drivers/mtpav.c Mon Apr 21 00:32:53 2003 @@ -585,7 +585,7 @@ } while (sbyt & SIGS_BYTE); } -static void snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs) { mtpav_t *mcard = snd_magic_cast(mtpav_t, dev_id, return); @@ -593,6 +593,7 @@ spin_lock(&mcard->spinlock); snd_mtpav_read_bytes(mcard); spin_unlock(&mcard->spinlock); + return IRQ_HANDLED; } /* diff -Nru a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c --- a/sound/drivers/serial-u16550.c Tue Feb 18 10:31:36 2003 +++ b/sound/drivers/serial-u16550.c Mon Apr 21 00:32:53 2003 @@ -290,7 +290,7 @@ * Note that some devices need OUT2 to be set before they will generate * interrupts at all. (Possibly tied to an internal pull-up on CTS?) */ -static void snd_uart16550_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_uart16550_interrupt(int irq, void *dev_id, struct pt_regs *regs) { snd_uart16550_t *uart; @@ -298,11 +298,12 @@ spin_lock(&uart->open_lock); if (uart->filemode == SERIAL_MODE_NOT_OPENED) { spin_unlock(&uart->open_lock); - return; + return IRQ_NONE; } inb(uart->base + UART_IIR); /* indicate to the UART that the interrupt has been serviced */ snd_uart16550_io_loop(uart); spin_unlock(&uart->open_lock); + return IRQ_HANDLED; } /* When the polling mode, this function calls snd_uart16550_io_loop. */ diff -Nru a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c --- a/sound/isa/ad1816a/ad1816a_lib.c Sat Feb 8 12:10:49 2003 +++ b/sound/isa/ad1816a/ad1816a_lib.c Mon Apr 21 00:32:53 2003 @@ -311,7 +311,7 @@ } -static void snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ad1816a_t *chip = snd_magic_cast(ad1816a_t, dev_id, return); unsigned char status; @@ -332,6 +332,7 @@ spin_lock(&chip->lock); snd_ad1816a_out(chip, AD1816A_INTERRUPT_STATUS, 0x00); spin_unlock(&chip->lock); + return IRQ_HANDLED; } diff -Nru a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c --- a/sound/isa/ad1848/ad1848_lib.c Sat Feb 8 12:10:49 2003 +++ b/sound/isa/ad1848/ad1848_lib.c Mon Apr 21 00:32:53 2003 @@ -585,7 +585,7 @@ return 0; } -void snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ad1848_t *chip = snd_magic_cast(ad1848_t, dev_id, return); @@ -596,6 +596,7 @@ (chip->mode & AD1848_MODE_RUNNING)) snd_pcm_period_elapsed(chip->capture_substream); outb(0, AD1848P(chip, STATUS)); /* clear global interrupt bit */ + return IRQ_HANDLED; } static snd_pcm_uframes_t snd_ad1848_playback_pointer(snd_pcm_substream_t * substream) diff -Nru a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c --- a/sound/isa/cs423x/cs4231_lib.c Sun Feb 16 05:47:42 2003 +++ b/sound/isa/cs423x/cs4231_lib.c Mon Apr 21 00:32:53 2003 @@ -967,7 +967,7 @@ chip->capture_substream->runtime->overrange++; } -void snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs) { cs4231_t *chip = snd_magic_cast(cs4231_t, dev_id, return); unsigned char status; @@ -998,6 +998,7 @@ spin_lock(&chip->reg_lock); snd_cs4231_outm(chip, CS4231_IRQ_STATUS, ~CS4231_ALL_IRQS | ~status, 0); spin_unlock(&chip->reg_lock); + return IRQ_HANDLED; } #ifdef LEGACY_SUPPORT diff -Nru a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c --- a/sound/isa/es1688/es1688_lib.c Sat Feb 8 12:10:50 2003 +++ b/sound/isa/es1688/es1688_lib.c Mon Apr 21 00:32:53 2003 @@ -482,7 +482,7 @@ return snd_es1688_trigger(chip, cmd, 0x0f); } -void snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs) { es1688_t *chip = snd_magic_cast(es1688_t, dev_id, return); @@ -492,6 +492,7 @@ snd_pcm_period_elapsed(chip->capture_substream); inb(ES1688P(chip, DATA_AVAIL)); /* ack interrupt */ + return IRQ_HANDLED; } static snd_pcm_uframes_t snd_es1688_playback_pointer(snd_pcm_substream_t * substream) diff -Nru a/sound/isa/es18xx.c b/sound/isa/es18xx.c --- a/sound/isa/es18xx.c Thu Apr 10 06:38:19 2003 +++ b/sound/isa/es18xx.c Mon Apr 21 00:32:53 2003 @@ -727,12 +727,11 @@ return snd_es18xx_playback2_trigger(chip, substream, cmd); } -static void snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { es18xx_t *chip = snd_magic_cast(es18xx_t, dev_id, return); unsigned char status; - if (chip->caps & ES18XX_CONTROL) { /* Read Interrupt status */ status = inb(chip->ctrl_port + 6); @@ -787,7 +786,7 @@ /* ack interrupt */ snd_es18xx_mixer_write(chip, 0x66, 0x00); } - + return IRQ_HANDLED; } static snd_pcm_uframes_t snd_es18xx_playback_pointer(snd_pcm_substream_t * substream) diff -Nru a/sound/isa/gus/gus_irq.c b/sound/isa/gus/gus_irq.c --- a/sound/isa/gus/gus_irq.c Mon Jan 27 09:30:52 2003 +++ b/sound/isa/gus/gus_irq.c Mon Apr 21 00:32:53 2003 @@ -30,16 +30,18 @@ #define STAT_ADD(x) while (0) { ; } #endif -void snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs) { snd_gus_card_t * gus = snd_magic_cast(snd_gus_card_t, dev_id, return); unsigned char status; int loop = 100; - - __again: + int handled = 0; + +__again: status = inb(gus->gf1.reg_irqstat); if (status == 0) - return; + return IRQ_RETVAL(handled); + handled = 1; // snd_printk("IRQ: status = 0x%x\n", status); if (status & 0x02) { STAT_ADD(gus->gf1.interrupt_stat_midi_in); @@ -101,6 +103,7 @@ } if (--loop > 0) goto __again; + return IRQ_NONE; } #ifdef CONFIG_SND_DEBUG diff -Nru a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c --- a/sound/isa/gus/gusmax.c Tue Oct 22 06:04:00 2002 +++ b/sound/isa/gus/gusmax.c Mon Apr 21 00:32:53 2003 @@ -129,22 +129,26 @@ return 0; } -static void snd_gusmax_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct snd_gusmax *maxcard = (struct snd_gusmax *) dev_id; int loop, max = 5; + int handled = 0; do { loop = 0; if (inb(maxcard->gus_status_reg)) { + handled = 1; snd_gus_interrupt(irq, maxcard->gus, regs); loop++; } if (inb(maxcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ + handled = 1; snd_cs4231_interrupt(irq, maxcard->cs4231, regs); loop++; } } while (loop && --max > 0); + return IRQ_RETVAL(handled); } static void __init snd_gusmax_init(int dev, snd_card_t * card, snd_gus_card_t * gus) diff -Nru a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c --- a/sound/isa/gus/interwave.c Thu Apr 10 03:28:12 2003 +++ b/sound/isa/gus/interwave.c Mon Apr 21 00:32:53 2003 @@ -312,22 +312,26 @@ return -ENODEV; } -static void snd_interwave_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_interwave_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct snd_interwave *iwcard = (struct snd_interwave *) dev_id; int loop, max = 5; + int handled = 0; do { loop = 0; if (inb(iwcard->gus_status_reg)) { + handled = 1; snd_gus_interrupt(irq, iwcard->gus, regs); loop++; } if (inb(iwcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ + handled = 1; snd_cs4231_interrupt(irq, iwcard->cs4231, regs); loop++; } } while (loop && --max > 0); + return IRQ_RETVAL(handled); } static void __devinit snd_interwave_reset(snd_gus_card_t * gus) diff -Nru a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c --- a/sound/isa/opl3sa2.c Thu Apr 10 03:28:12 2003 +++ b/sound/isa/opl3sa2.c Mon Apr 21 00:32:53 2003 @@ -297,26 +297,34 @@ return 0; } -static void snd_opl3sa2_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_opl3sa2_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned short status; opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, dev_id, return); + int handled = 0; if (chip == NULL || chip->card == NULL) - return; + return IRQ_NONE; status = snd_opl3sa2_read(chip, OPL3SA2_IRQ_STATUS); - if (status & 0x20) + if (status & 0x20) { + handled = 1; snd_opl3_interrupt(chip->synth); + } - if ((status & 0x10) && chip->rmidi != NULL) + if ((status & 0x10) && chip->rmidi != NULL) { + handled = 1; snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs); + } - if (status & 0x07) /* TI,CI,PI */ + if (status & 0x07) { /* TI,CI,PI */ + handled = 1; snd_cs4231_interrupt(irq, chip->cs4231, regs); + } if (status & 0x40) { /* hardware volume change */ + handled = 1; /* reading from Master Lch register at 0x07 clears this bit */ snd_opl3sa2_read(chip, OPL3SA2_MASTER_RIGHT); snd_opl3sa2_read(chip, OPL3SA2_MASTER_LEFT); @@ -325,6 +333,7 @@ snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->master_volume->id); } } + return IRQ_RETVAL(handled); } #define OPL3SA2_SINGLE(xname, xindex, reg, shift, mask, invert) \ diff -Nru a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c --- a/sound/isa/opti9xx/opti92x-ad1848.c Thu Apr 10 03:28:12 2003 +++ b/sound/isa/opti9xx/opti92x-ad1848.c Mon Apr 21 00:32:53 2003 @@ -1125,7 +1125,7 @@ spin_unlock_irqrestore(&chip->lock, flags); } -void snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs *regs) { opti93x_t *codec = snd_magic_cast(opti93x_t, dev_id, return); unsigned char status; @@ -1138,6 +1138,7 @@ snd_pcm_period_elapsed(codec->capture_substream); } outb(0x00, OPTi93X_PORT(codec, STATUS)); + return IRQ_HANDLED; } diff -Nru a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c --- a/sound/isa/sb/sb16_main.c Sat Feb 8 12:10:51 2003 +++ b/sound/isa/sb/sb16_main.c Mon Apr 21 00:32:53 2003 @@ -393,7 +393,7 @@ return result; } -void snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs) { sb_t *chip = snd_magic_cast(sb_t, dev_id, return); unsigned char status; @@ -438,6 +438,7 @@ snd_sb_ack_16bit(chip); spin_unlock(&chip->reg_lock); } + return IRQ_HANDLED; } /* diff -Nru a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c --- a/sound/isa/sb/sb8.c Thu Apr 10 03:28:12 2003 +++ b/sound/isa/sb/sb8.c Mon Apr 21 00:32:53 2003 @@ -70,7 +70,7 @@ static snd_card_t *snd_sb8_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; -static void snd_sb8_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id, struct pt_regs *regs) { sb_t *chip = snd_magic_cast(sb_t, dev_id, return); @@ -79,6 +79,7 @@ } else { snd_sb8dsp_midi_interrupt(chip); } + return IRQ_HANDLED; } static void snd_sb8_free(snd_card_t *card) diff -Nru a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c --- a/sound/isa/sb/sb_common.c Mon Jan 27 10:41:40 2003 +++ b/sound/isa/sb/sb_common.c Mon Apr 21 00:32:59 2003 @@ -214,7 +214,7 @@ int snd_sbdsp_create(snd_card_t *card, unsigned long port, int irq, - void (*irq_handler)(int, void *, struct pt_regs *), + irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), int dma8, int dma16, unsigned short hardware, diff -Nru a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c --- a/sound/isa/sgalaxy.c Thu Apr 10 03:28:12 2003 +++ b/sound/isa/sgalaxy.c Mon Apr 21 00:32:53 2003 @@ -112,8 +112,9 @@ return 0; } -static void snd_sgalaxy_dummy_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_sgalaxy_dummy_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + return IRQ_NONE; } static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma) diff -Nru a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c --- a/sound/isa/wavefront/wavefront.c Thu Apr 10 03:28:12 2003 +++ b/sound/isa/wavefront/wavefront.c Mon Apr 21 00:32:53 2003 @@ -276,7 +276,7 @@ #endif /* CONFIG_PNP */ -static void snd_wavefront_ics2115_interrupt(int irq, +static irqreturn_t snd_wavefront_ics2115_interrupt(int irq, void *dev_id, struct pt_regs *regs) { @@ -285,13 +285,14 @@ acard = (snd_wavefront_card_t *) dev_id; if (acard == NULL) - return; + return IRQ_NONE; if (acard->wavefront.interrupts_are_midi) { snd_wavefront_midi_interrupt (acard); } else { snd_wavefront_internal_interrupt (acard); } + return IRQ_HANDLED; } snd_hwdep_t * __devinit diff -Nru a/sound/oss/Kconfig b/sound/oss/Kconfig --- a/sound/oss/Kconfig Mon Mar 3 13:09:18 2003 +++ b/sound/oss/Kconfig Sun Apr 20 12:56:52 2003 @@ -872,7 +872,7 @@ Say Y here if you have a Sound Blaster SB32, AWE32-PnP, SB AWE64 or similar sound card. See , and the Soundblaster-AWE - mini-HOWTO, available from + mini-HOWTO, available from for more info. config SOUND_WAVEFRONT diff -Nru a/sound/oss/ad1816.c b/sound/oss/ad1816.c --- a/sound/oss/ad1816.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/ad1816.c Mon Apr 21 00:32:53 2003 @@ -540,7 +540,7 @@ /* Interrupt handler */ -static void ad1816_interrupt (int irq, void *dev_id, struct pt_regs *dummy) +static irqreturn_t ad1816_interrupt (int irq, void *dev_id, struct pt_regs *dummy) { unsigned char status; ad1816_info *devc; @@ -549,7 +549,7 @@ if (irq < 0 || irq > 15) { printk(KERN_WARNING "ad1816: Got bogus interrupt %d\n", irq); - return; + return IRQ_NONE; } dev = irq2dev[irq]; @@ -557,7 +557,7 @@ if (dev < 0 || dev >= num_audiodevs) { printk(KERN_WARNING "ad1816: IRQ2AD1816-mapping failed for " "irq %d device %d\n", irq,dev); - return; + return IRQ_NONE; } devc = (ad1816_info *) audio_devs[dev]->devc; @@ -583,6 +583,7 @@ DMAbuf_outputintr (dev, 1); spin_unlock(&devc->lock); + return IRQ_HANDLED; } /* ------------------------------------------------------------------- */ diff -Nru a/sound/oss/ad1848.c b/sound/oss/ad1848.c --- a/sound/oss/ad1848.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/ad1848.c Mon Apr 21 00:32:53 2003 @@ -2212,7 +2212,7 @@ printk(KERN_ERR "ad1848: Can't find device to be unloaded. Base=%x\n", io_base); } -void adintr(int irq, void *dev_id, struct pt_regs *dummy) +irqreturn_t adintr(int irq, void *dev_id, struct pt_regs *dummy) { unsigned char status; ad1848_info *devc; @@ -2287,6 +2287,7 @@ { goto interrupt_again; } + return IRQ_HANDLED; } /* diff -Nru a/sound/oss/ad1848.h b/sound/oss/ad1848.h --- a/sound/oss/ad1848.h Mon Feb 4 14:15:17 2002 +++ b/sound/oss/ad1848.h Mon Apr 21 00:32:53 2003 @@ -1,4 +1,6 @@ +#include + #define AD_F_CS4231 0x0001 /* Returned if a CS4232 (or compatible) detected */ #define AD_F_CS4248 0x0001 /* Returned if a CS4248 (or compatible) detected */ @@ -16,7 +18,7 @@ int ad1848_detect (int io_base, int *flags, int *osp); int ad1848_control(int cmd, int arg); -void adintr(int irq, void *dev_id, struct pt_regs * dummy); +irqreturn_t adintr(int irq, void *dev_id, struct pt_regs * dummy); void attach_ms_sound(struct address_info * hw_config, struct module * owner); int probe_ms_sound(struct address_info *hw_config); diff -Nru a/sound/oss/btaudio.c b/sound/oss/btaudio.c --- a/sound/oss/btaudio.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/btaudio.c Mon Apr 21 00:32:53 2003 @@ -817,18 +817,20 @@ "RISCI", "FBUS", "FTRGT", "FDSR", "PPERR", "RIPERR", "PABORT", "OCERR", "SCERR" }; -static void btaudio_irq(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t btaudio_irq(int irq, void *dev_id, struct pt_regs * regs) { int count = 0; u32 stat,astat; struct btaudio *bta = dev_id; + int handled = 0; for (;;) { count++; stat = btread(REG_INT_STAT); astat = stat & btread(REG_INT_MASK); if (!astat) - return; + return IRQ_RETVAL(handled); + handled = 1; btwrite(astat,REG_INT_STAT); if (irq_debug) { @@ -864,7 +866,7 @@ btwrite(0, REG_INT_MASK); } } - return; + return IRQ_NONE; } /* -------------------------------------------------------------- */ diff -Nru a/sound/oss/cmpci.c b/sound/oss/cmpci.c --- a/sound/oss/cmpci.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/cmpci.c Mon Apr 21 00:32:53 2003 @@ -1156,7 +1156,7 @@ } #endif -static void cm_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cm_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct cm_state *s = (struct cm_state *)dev_id; unsigned int intsrc, intstat; @@ -1165,7 +1165,7 @@ /* fastpath out, to ease interrupt sharing */ intsrc = inl(s->iobase + CODEC_CMI_INT_STATUS); if (!(intsrc & 0x80000000)) - return; + return IRQ_NONE; spin_lock(&s->lock); intstat = inb(s->iobase + CODEC_CMI_INT_HLDCLR + 2); /* acknowledge interrupt */ @@ -1180,6 +1180,7 @@ cm_handle_midi(s); #endif spin_unlock(&s->lock); + return IRQ_HANDLED; } #ifdef CONFIG_SOUND_CMPCI_MIDI diff -Nru a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c --- a/sound/oss/cs4281/cs4281m.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/cs4281/cs4281m.c Mon Apr 21 00:32:53 2003 @@ -3792,7 +3792,7 @@ -static void cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct cs4281_state *s = (struct cs4281_state *) dev_id; unsigned int temp1; @@ -3809,7 +3809,7 @@ writel(HICR_IEV | HICR_CHGM, s->pBA0 + BA0_HICR); CS_DBGOUT(CS_INTERRUPT, 9, printk(KERN_INFO "cs4281: cs4281_interrupt(): returning not cs4281 interrupt.\n")); - return; + return IRQ_NONE; } if (temp1 & HISR_DMA0) // If play interrupt, @@ -3823,6 +3823,7 @@ cs4281_update_ptr(s,CS_TRUE); cs4281_handle_midi(s); spin_unlock(&s->lock); + return IRQ_HANDLED; } // ************************************************************************** diff -Nru a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c --- a/sound/oss/cs46xx.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/cs46xx.c Mon Apr 21 00:32:53 2003 @@ -1670,7 +1670,7 @@ wake_up(&card->midi.owait); } -static void cs_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cs_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct cs_card *card = (struct cs_card *)dev_id; /* Single channel card */ @@ -1688,7 +1688,7 @@ { cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV); spin_unlock(&card->lock); - return; + return IRQ_HANDLED; /* Might be IRQ_NONE.. */ } /* @@ -1709,6 +1709,7 @@ cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV); spin_unlock(&card->lock); CS_DBGOUT(CS_INTERRUPT, 9, printk("cs46xx: cs_interrupt()- \n")); + return IRQ_HANDLED; } diff -Nru a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c --- a/sound/oss/dmasound/dmasound_atari.c Thu Apr 3 14:34:57 2003 +++ b/sound/oss/dmasound/dmasound_atari.c Mon Apr 21 00:32:53 2003 @@ -134,7 +134,7 @@ static int FalconSetVolume(int volume); static void AtaPlayNextFrame(int index); static void AtaPlay(void); -static void AtaInterrupt(int irq, void *dummy, struct pt_regs *fp); +static irqreturn_t AtaInterrupt(int irq, void *dummy, struct pt_regs *fp); /*** Mid level stuff *********************************************************/ @@ -1250,7 +1250,7 @@ } -static void AtaInterrupt(int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t AtaInterrupt(int irq, void *dummy, struct pt_regs *fp) { #if 0 /* ++TeSche: if you should want to test this... */ @@ -1259,7 +1259,7 @@ if (++cnt == 10) { /* simulate losing an interrupt */ cnt = 0; - return; + return IRQ_HANDLED; } #endif spin_lock(&dmasound.lock); @@ -1269,7 +1269,7 @@ * (almost) like on the TT. */ write_sq_ignore_int = 0; - return; + return IRQ_HANDLED; } if (!write_sq.active) { @@ -1277,7 +1277,7 @@ * the sq variables, so better don't do anything here. */ WAKE_UP(write_sq.sync_queue); - return; + return IRQ_HANDLED; } /* Probably ;) one frame is finished. Well, in fact it may be that a @@ -1315,6 +1315,7 @@ is nothing to play any more. Wake up a process waiting for audio output to drain. */ spin_unlock(&dmasound.lock); + return IRQ_HANDLED; } diff -Nru a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c --- a/sound/oss/dmasound/dmasound_awacs.c Thu Apr 3 14:34:57 2003 +++ b/sound/oss/dmasound/dmasound_awacs.c Mon Apr 21 00:32:53 2003 @@ -266,9 +266,9 @@ static int PMacSetVolume(int volume); static void PMacPlay(void); static void PMacRecord(void); -static void pmac_awacs_tx_intr(int irq, void *devid, struct pt_regs *regs); -static void pmac_awacs_rx_intr(int irq, void *devid, struct pt_regs *regs); -static void pmac_awacs_intr(int irq, void *devid, struct pt_regs *regs); +static irqreturn_t pmac_awacs_tx_intr(int irq, void *devid, struct pt_regs *regs); +static irqreturn_t pmac_awacs_rx_intr(int irq, void *devid, struct pt_regs *regs); +static irqreturn_t pmac_awacs_intr(int irq, void *devid, struct pt_regs *regs); static void awacs_write(int val); static int awacs_get_volume(int reg, int lshift); static int awacs_volume_setter(int volume, int n, int mute, int lshift); @@ -395,20 +395,24 @@ return ((pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio_addr, 0) & 0x02) !=0); } -static void +static irqreturn_t headphone_intr(int irq, void *devid, struct pt_regs *regs) { + int handled = 0; spin_lock(&dmasound.lock); if (read_audio_gpio(gpio_headphone_detect) == gpio_headphone_detect_pol) { + handled = 1; printk(KERN_INFO "Audio jack plugged, muting speakers.\n"); write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol); write_audio_gpio(gpio_headphone_mute, !gpio_headphone_mute_pol); } else { + handled = 1; printk(KERN_INFO "Audio jack unplugged, enabling speakers.\n"); write_audio_gpio(gpio_amp_mute, !gpio_amp_mute_pol); write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol); } spin_unlock(&dmasound.lock); + return IRQ_RETVAL(handled); } @@ -923,7 +927,7 @@ 'next_cmd' field will already point back to the original loop of blocks. */ -static void +static irqreturn_t pmac_awacs_tx_intr(int irq, void *devid, struct pt_regs *regs) { int i = write_sq.front; @@ -1009,10 +1013,11 @@ if (!write_sq.active && (write_sq.syncing & 1)) WAKE_UP(write_sq.sync_queue); /* any time we're empty */ spin_unlock(&dmasound.lock); + return IRQ_HANDLED; } -static void +static irqreturn_t pmac_awacs_rx_intr(int irq, void *devid, struct pt_regs *regs) { int stat ; @@ -1023,12 +1028,12 @@ * just blow it off. */ if (in_le32(&awacs_rxdma->cmdptr) == 0) - return; + return IRQ_HANDLED; /* We also want to blow 'em off when shutting down. */ if (read_sq.active == 0) - return; + return IRQ_HANDLED; spin_lock(&dmasound.lock); /* Check multiple buffers in case we were held off from @@ -1063,7 +1068,7 @@ out_le32(&awacs_rxdma->control, ((RUN|WAKE) << 16) + (RUN|WAKE)); spin_unlock(&dmasound.lock); - return; /* try this block again */ + return IRQ_HANDLED; /* try this block again */ } /* Clear status and move on to next buffer. */ @@ -1091,10 +1096,11 @@ WAKE_UP(read_sq.action_queue); spin_unlock(&dmasound.lock); + return IRQ_HANDLED; } -static void +static irqreturn_t pmac_awacs_intr(int irq, void *devid, struct pt_regs *regs) { int ctrl; @@ -1113,6 +1119,7 @@ /* Writing 1s to the CNTLERR and PORTCHG bits clears them... */ out_le32(&awacs->control, ctrl); spin_unlock(&dmasound.lock); + return IRQ_HANDLED; } static void diff -Nru a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c --- a/sound/oss/dmasound/dmasound_paula.c Thu Apr 3 14:34:57 2003 +++ b/sound/oss/dmasound/dmasound_paula.c Mon Apr 21 00:32:53 2003 @@ -83,7 +83,7 @@ static int AmiSetTreble(int treble); static void AmiPlayNextFrame(int index); static void AmiPlay(void); -static void AmiInterrupt(int irq, void *dummy, struct pt_regs *fp); +static irqreturn_t AmiInterrupt(int irq, void *dummy, struct pt_regs *fp); #ifdef CONFIG_HEARTBEAT @@ -567,7 +567,7 @@ } -static void AmiInterrupt(int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t AmiInterrupt(int irq, void *dummy, struct pt_regs *fp) { int minframes = 1; @@ -578,7 +578,7 @@ * the sq variables, so better don't do anything here. */ WAKE_UP(write_sq.sync_queue); - return; + return IRQ_HANDLED; } if (write_sq.active & AMI_PLAY_PLAYING) { @@ -608,6 +608,7 @@ /* Nothing to play anymore. Wake up a process waiting for audio output to drain. */ WAKE_UP(write_sq.sync_queue); + return IRQ_HANDLED; } /*** Mid level stuff *********************************************************/ diff -Nru a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c --- a/sound/oss/dmasound/dmasound_q40.c Thu Apr 3 14:34:57 2003 +++ b/sound/oss/dmasound/dmasound_q40.c Mon Apr 21 00:32:53 2003 @@ -49,8 +49,8 @@ static int Q40SetVolume(int volume); static void Q40PlayNextFrame(int index); static void Q40Play(void); -static void Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp); -static void Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp); +static irqreturn_t Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp); +static irqreturn_t Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp); static void Q40Interrupt(void); @@ -464,7 +464,7 @@ spin_unlock_irqrestore_flags(&dmasound.lock, flags); } -static void Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp) { spin_lock(&dmasound.lock); if (q40_sc>1){ @@ -474,8 +474,9 @@ master_outb(1,SAMPLE_CLEAR_REG); }else Q40Interrupt(); spin_unlock(&dmasound.lock); + return IRQ_HANDLED; } -static void Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp) { spin_lock(&dmasound.lock); if (q40_sc>0){ @@ -485,6 +486,7 @@ master_outb(1,SAMPLE_CLEAR_REG); }else Q40Interrupt(); spin_unlock(&dmasound.lock); + return IRQ_HANDLED; } static void Q40Interrupt(void) { diff -Nru a/sound/oss/emu10k1/cardwo.c b/sound/oss/emu10k1/cardwo.c --- a/sound/oss/emu10k1/cardwo.c Sat Mar 22 04:41:48 2003 +++ b/sound/oss/emu10k1/cardwo.c Mon Apr 21 00:32:53 2003 @@ -444,7 +444,7 @@ while (len) { for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) { if (__copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample)) - return -EFAULT; + return; src += woinst->format.bytespervoicesample; } diff -Nru a/sound/oss/emu10k1/irqmgr.c b/sound/oss/emu10k1/irqmgr.c --- a/sound/oss/emu10k1/irqmgr.c Sun Feb 16 16:30:06 2003 +++ b/sound/oss/emu10k1/irqmgr.c Mon Apr 21 00:32:53 2003 @@ -37,10 +37,11 @@ /* Interrupt handler */ -void emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct emu10k1_card *card = (struct emu10k1_card *) dev_id; u32 irqstatus, irqstatus_tmp; + int handled = 0; DPD(4, "emu10k1_interrupt called, irq = %u\n", irq); @@ -105,6 +106,8 @@ } /* acknowledge interrupt */ - outl(irqstatus_tmp, card->iobase + IPR); + outl(irqstatus_tmp, card->iobase + IPR); + handled = 1; } + return IRQ_RETVAL(handled); } diff -Nru a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c --- a/sound/oss/emu10k1/main.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/emu10k1/main.c Mon Apr 21 00:32:53 2003 @@ -157,7 +157,7 @@ static struct midi_operations emu10k1_midi_operations; #endif -extern void emu10k1_interrupt(int, void *, struct pt_regs *s); +extern irqreturn_t emu10k1_interrupt(int, void *, struct pt_regs *s); static int __devinit emu10k1_audio_init(struct emu10k1_card *card) { diff -Nru a/sound/oss/es1370.c b/sound/oss/es1370.c --- a/sound/oss/es1370.c Thu Apr 17 12:36:40 2003 +++ b/sound/oss/es1370.c Mon Apr 21 00:32:53 2003 @@ -755,7 +755,7 @@ outb((s->midi.ocnt > 0) ? UCTRL_RXINTEN | UCTRL_ENA_TXINT : UCTRL_RXINTEN, s->io+ES1370_REG_UART_CONTROL); } -static void es1370_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t es1370_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct es1370_state *s = (struct es1370_state *)dev_id; unsigned int intsrc, sctl; @@ -763,7 +763,7 @@ /* fastpath out, to ease interrupt sharing */ intsrc = inl(s->io+ES1370_REG_STATUS); if (!(intsrc & 0x80000000)) - return; + return IRQ_NONE; spin_lock(&s->lock); /* clear audio interrupts first */ sctl = s->sctrl; @@ -778,6 +778,7 @@ es1370_update_ptr(s); es1370_handle_midi(s); spin_unlock(&s->lock); + return IRQ_HANDLED; } /* --------------------------------------------------------------------- */ diff -Nru a/sound/oss/es1371.c b/sound/oss/es1371.c --- a/sound/oss/es1371.c Thu Apr 17 12:36:40 2003 +++ b/sound/oss/es1371.c Mon Apr 21 00:32:53 2003 @@ -1091,7 +1091,7 @@ outb((s->midi.ocnt > 0) ? UCTRL_RXINTEN | UCTRL_ENA_TXINT : UCTRL_RXINTEN, s->io+ES1371_REG_UART_CONTROL); } -static void es1371_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t es1371_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct es1371_state *s = (struct es1371_state *)dev_id; unsigned int intsrc, sctl; @@ -1099,7 +1099,7 @@ /* fastpath out, to ease interrupt sharing */ intsrc = inl(s->io+ES1371_REG_STATUS); if (!(intsrc & 0x80000000)) - return; + return IRQ_NONE; spin_lock(&s->lock); /* clear audio interrupts first */ sctl = s->sctrl; @@ -1114,6 +1114,7 @@ es1371_update_ptr(s); es1371_handle_midi(s); spin_unlock(&s->lock); + return IRQ_HANDLED; } /* --------------------------------------------------------------------- */ diff -Nru a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c --- a/sound/oss/esssolo1.c Thu Apr 17 12:36:40 2003 +++ b/sound/oss/esssolo1.c Mon Apr 21 00:32:53 2003 @@ -1694,7 +1694,7 @@ wake_up(&s->midi.owait); } -static void solo1_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t solo1_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct solo1_state *s = (struct solo1_state *)dev_id; unsigned int intsrc; @@ -1702,7 +1702,7 @@ /* fastpath out, to ease interrupt sharing */ intsrc = inb(s->iobase+7); /* get interrupt source(s) */ if (!intsrc) - return; + return IRQ_NONE; (void)inb(s->sbbase+0xe); /* clear interrupt */ spin_lock(&s->lock); /* clear audio interrupts first */ @@ -1711,6 +1711,7 @@ solo1_update_ptr(s); solo1_handle_midi(s); spin_unlock(&s->lock); + return IRQ_HANDLED; } static void solo1_midi_timer(unsigned long data) diff -Nru a/sound/oss/gus.h b/sound/oss/gus.h --- a/sound/oss/gus.h Mon Feb 4 14:15:17 2002 +++ b/sound/oss/gus.h Mon Apr 21 00:32:53 2003 @@ -3,7 +3,7 @@ /* From gus_card.c */ int gus_set_midi_irq(int num); -void gusintr(int irq, void *dev_id, struct pt_regs * dummy); +irqreturn_t gusintr(int irq, void *dev_id, struct pt_regs * dummy); /* From gus_wave.c */ int gus_wave_detect(int baseaddr); diff -Nru a/sound/oss/gus_card.c b/sound/oss/gus_card.c --- a/sound/oss/gus_card.c Sun Nov 17 19:33:01 2002 +++ b/sound/oss/gus_card.c Mon Apr 21 00:32:53 2003 @@ -25,7 +25,7 @@ #include "gus.h" #include "gus_hw.h" -void gusintr(int irq, void *dev_id, struct pt_regs *dummy); +irqreturn_t gusintr(int irq, void *dev_id, struct pt_regs *dummy); int gus_base = 0, gus_irq = 0, gus_dma = 0; int gus_no_wave_dma = 0; @@ -119,10 +119,11 @@ sound_free_dma(hw_config->dma2); } -void gusintr(int irq, void *dev_id, struct pt_regs *dummy) +irqreturn_t gusintr(int irq, void *dev_id, struct pt_regs *dummy) { unsigned char src; extern int gus_timer_enabled; + int handled = 0; #ifdef CONFIG_SOUND_GUSMAX if (have_gus_max) { @@ -140,8 +141,8 @@ while (1) { if (!(src = inb(u_IrqStatus))) - return; - + break; + handled = 1; if (src & DMA_TC_IRQ) { guswave_dma_irq(); @@ -160,6 +161,7 @@ if (src & (WAVETABLE_IRQ | ENVELOPE_IRQ)) gus_voice_irq(); } + return IRQ_RETVAL(handled); } /* diff -Nru a/sound/oss/gus_wave.c b/sound/oss/gus_wave.c --- a/sound/oss/gus_wave.c Thu Apr 3 14:45:12 2003 +++ b/sound/oss/gus_wave.c Mon Apr 21 00:32:53 2003 @@ -508,7 +508,7 @@ { unsigned vol, prev_vol, phase; unsigned char rate; - long int flags; + unsigned long flags; if (voices[voice].mode & WAVE_SUSTAIN_ON && voices[voice].env_phase == 2) { @@ -593,7 +593,7 @@ static void gus_voice_fade(int voice) { int instr_no = sample_map[voice], is16bits; - long int flags; + unsigned long flags; spin_lock_irqsave(&gus_lock,flags); gus_select_voice(voice); @@ -1511,7 +1511,7 @@ static int guswave_start_note(int dev, int voice, int note_num, int volume) { - long int flags; + unsigned long flags; int mode; int ret_val = 0; diff -Nru a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c --- a/sound/oss/i810_audio.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/i810_audio.c Mon Apr 21 00:32:53 2003 @@ -1389,7 +1389,7 @@ #endif } -static void i810_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct i810_card *card = (struct i810_card *)dev_id; u32 status; @@ -1401,7 +1401,7 @@ if(!(status & INT_MASK)) { spin_unlock(&card->lock); - return; /* not for us */ + return IRQ_NONE; /* not for us */ } if(status & (INT_PO|INT_PI|INT_MC)) @@ -1410,6 +1410,7 @@ /* clear 'em */ outl(status & INT_MASK, card->iobase + GLOB_STA); spin_unlock(&card->lock); + return IRQ_HANDLED; } /* in this loop, dmabuf.count signifies the amount of data that is diff -Nru a/sound/oss/ite8172.c b/sound/oss/ite8172.c --- a/sound/oss/ite8172.c Thu Apr 17 12:36:40 2003 +++ b/sound/oss/ite8172.c Mon Apr 21 00:32:53 2003 @@ -727,7 +727,7 @@ /* hold spinlock for the following! */ -static void it8172_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t it8172_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct it8172_state *s = (struct it8172_state *)dev_id; struct dmabuf* dac = &s->dma_dac; @@ -741,8 +741,10 @@ isc = inb(s->io+IT_AC_ISC); /* fastpath out, to ease interrupt sharing */ - if (!(isc & (ISC_VCI | ISC_CCI | ISC_PCI))) - return; + if (!(isc & (ISC_VCI | ISC_CCI | ISC_PCI))) { + spin_unlock(&s->lock); + return IRQ_NONE; + } /* clear audio interrupts first */ outb(isc | ISC_VCI | ISC_CCI | ISC_PCI, s->io+IT_AC_ISC); @@ -819,6 +821,7 @@ } spin_unlock(&s->lock); + return IRQ_HANDLED; } /* --------------------------------------------------------------------- */ diff -Nru a/sound/oss/maestro.c b/sound/oss/maestro.c --- a/sound/oss/maestro.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/maestro.c Mon Apr 21 00:32:53 2003 @@ -1631,7 +1631,7 @@ * Meet Bob, the timer... */ -static void ess_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ess_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void stop_bob(struct ess_state *s) { @@ -1900,7 +1900,7 @@ } } -static void +static irqreturn_t ess_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct ess_state *s; @@ -1908,7 +1908,8 @@ int i; u32 event; - if ( ! (event = inb(c->iobase+0x1A)) ) return; + if ( ! (event = inb(c->iobase+0x1A)) ) + return IRQ_NONE; outw(inw(c->iobase+4)&1, c->iobase+4); @@ -1972,6 +1973,7 @@ ess_update_ptr(s); spin_unlock(&s->lock); } + return IRQ_HANDLED; } diff -Nru a/sound/oss/maestro3.c b/sound/oss/maestro3.c --- a/sound/oss/maestro3.c Tue Feb 25 09:57:27 2003 +++ b/sound/oss/maestro3.c Mon Apr 21 00:32:53 2003 @@ -1232,7 +1232,7 @@ } } -static void m3_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t m3_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct m3_card *c = (struct m3_card *)dev_id; struct m3_state *s = &c->channels[0]; @@ -1240,13 +1240,14 @@ status = inb(c->iobase+0x1A); - if(status == 0xff) return; + if(status == 0xff) + return IRQ_NONE; /* presumably acking the ints? */ outw(status, c->iobase+0x1A); if(c->in_suspend) - return; + return IRQ_HANDLED; /* * ack an assp int if its running @@ -1269,6 +1270,7 @@ /* XXX is this needed? */ if(status & 0x40) outb(0x40, c->iobase+0x1A); + return IRQ_HANDLED; } diff -Nru a/sound/oss/maui.c b/sound/oss/maui.c --- a/sound/oss/maui.c Sun Dec 8 05:04:01 2002 +++ b/sound/oss/maui.c Mon Apr 21 00:32:53 2003 @@ -102,9 +102,10 @@ return 0; } -static void mauiintr(int irq, void *dev_id, struct pt_regs *dummy) +static irqreturn_t mauiintr(int irq, void *dev_id, struct pt_regs *dummy) { irq_ok = 1; + return IRQ_HANDLED; } static int __init download_code(void) diff -Nru a/sound/oss/mpu401.c b/sound/oss/mpu401.c --- a/sound/oss/mpu401.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/mpu401.c Mon Apr 21 00:32:53 2003 @@ -444,15 +444,17 @@ return input_avail(devc); } -void mpuintr(int irq, void *dev_id, struct pt_regs *dummy) +irqreturn_t mpuintr(int irq, void *dev_id, struct pt_regs *dummy) { struct mpu_config *devc; int dev = (int) dev_id; + int handled = 0; devc = &dev_conf[dev]; if (input_avail(devc)) { + handled = 1; if (devc->base != 0 && (devc->opened & OPEN_READ || devc->mode == MODE_SYNTH)) mpu401_input_loop(devc); else @@ -461,6 +463,7 @@ read_data(devc); } } + return IRQ_RETVAL(handled); } static int mpu401_open(int dev, int mode, @@ -500,7 +503,7 @@ { if (!try_module_get(coprocessor->owner)) { mpu401_close(dev); - return err; + return -ENODEV; } if ((err = coprocessor->open(coprocessor->devc, COPR_MIDI)) < 0) @@ -839,7 +842,7 @@ coprocessor = midi_devs[midi_dev]->coproc; if (coprocessor) { if (!try_module_get(coprocessor->owner)) - return err; + return -ENODEV; if ((err = coprocessor->open(coprocessor->devc, COPR_MIDI)) < 0) { diff -Nru a/sound/oss/mpu401.h b/sound/oss/mpu401.h --- a/sound/oss/mpu401.h Sat Dec 7 18:59:03 2002 +++ b/sound/oss/mpu401.h Mon Apr 21 00:32:53 2003 @@ -3,7 +3,7 @@ int probe_uart401 (struct address_info *hw_config, struct module *owner); void unload_uart401 (struct address_info *hw_config); -void uart401intr (int irq, void *dev_id, struct pt_regs * dummy); +irqreturn_t uart401intr (int irq, void *dev_id, struct pt_regs * dummy); /* From mpu401.c */ int probe_mpu401(struct address_info *hw_config); @@ -11,4 +11,4 @@ void unload_mpu401(struct address_info *hw_info); int intchk_mpu401(void *dev_id); -void mpuintr(int irq, void *dev_id, struct pt_regs * dummy); +irqreturn_t mpuintr(int irq, void *dev_id, struct pt_regs * dummy); diff -Nru a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c --- a/sound/oss/msnd_pinnacle.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/msnd_pinnacle.c Mon Apr 21 00:32:53 2003 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1061,7 +1062,7 @@ } } -static void intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t intr(int irq, void *dev_id, struct pt_regs *regs) { /* Send ack to DSP */ inb(dev.io + HP_RXL); @@ -1077,6 +1078,7 @@ else isa_writew(wTmp, dev.DSPQ + JQS_wHead); } + return IRQ_HANDLED; } static struct file_operations dev_fileops = { diff -Nru a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c --- a/sound/oss/nec_vrc5477.c Thu Apr 17 12:36:40 2003 +++ b/sound/oss/nec_vrc5477.c Mon Apr 21 00:32:53 2003 @@ -813,7 +813,7 @@ wake_up_interruptible(&dac->wait); } -static void vrc5477_ac97_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t vrc5477_ac97_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct vrc5477_ac97_state *s = (struct vrc5477_ac97_state *)dev_id; u32 irqStatus; @@ -851,6 +851,7 @@ } spin_unlock(&s->lock); + return IRQ_HANDLED; } /* --------------------------------------------------------------------- */ diff -Nru a/sound/oss/nm256.h b/sound/oss/nm256.h --- a/sound/oss/nm256.h Tue Aug 13 07:04:59 2002 +++ b/sound/oss/nm256.h Mon Apr 21 00:32:53 2003 @@ -2,6 +2,8 @@ #define _NM256_H_ #include +#include + #include "ac97.h" /* The revisions that we currently handle. */ @@ -113,7 +115,7 @@ int has_irq; /* The card interrupt service routine. */ - void (*introutine) (int, void *, struct pt_regs *); + irqreturn_t (*introutine) (int, void *, struct pt_regs *); /* Current audio config, cached. */ struct sinfo { diff -Nru a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c --- a/sound/oss/nm256_audio.c Thu Apr 17 12:36:40 2003 +++ b/sound/oss/nm256_audio.c Mon Apr 21 00:32:53 2003 @@ -44,8 +44,8 @@ static int nm256_grabInterrupt (struct nm256_info *card); static int nm256_releaseInterrupt (struct nm256_info *card); -static void nm256_interrupt (int irq, void *dev_id, struct pt_regs *dummy); -static void nm256_interrupt_zx (int irq, void *dev_id, struct pt_regs *dummy); +static irqreturn_t nm256_interrupt (int irq, void *dev_id, struct pt_regs *dummy); +static irqreturn_t nm256_interrupt_zx (int irq, void *dev_id, struct pt_regs *dummy); static int handle_pm_event (struct pm_dev *dev, pm_request_t rqst, void *data); /* These belong in linux/pci.h. */ @@ -528,16 +528,17 @@ * I suppose...yucky bleah.) */ -static void +static irqreturn_t nm256_interrupt (int irq, void *dev_id, struct pt_regs *dummy) { struct nm256_info *card = (struct nm256_info *)dev_id; u16 status; static int badintrcount = 0; + int handled = 0; if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) { printk (KERN_ERR "NM256: Bad card pointer\n"); - return; + return IRQ_NONE; } status = nm256_readPort16 (card, 2, NM_INT_REG); @@ -558,13 +559,14 @@ * inserted a PCMCIA card and someone's spamming us with IRQ 9s. */ + handled = 1; if (card->playing) stopPlay (card); if (card->recording) stopRecord (card); badintrcount = 0; } - return; + return IRQ_RETVAL(handled); } badintrcount = 0; @@ -572,6 +574,7 @@ /* Rather boring; check for individual interrupts and process them. */ if (status & NM_PLAYBACK_INT) { + handled = 1; status &= ~NM_PLAYBACK_INT; NM_ACK_INT (card, NM_PLAYBACK_INT); @@ -580,6 +583,7 @@ } if (status & NM_RECORD_INT) { + handled = 1; status &= ~NM_RECORD_INT; NM_ACK_INT (card, NM_RECORD_INT); @@ -590,6 +594,7 @@ if (status & NM_MISC_INT_1) { u8 cbyte; + handled = 1; status &= ~NM_MISC_INT_1; printk (KERN_ERR "NM256: Got misc interrupt #1\n"); NM_ACK_INT (card, NM_MISC_INT_1); @@ -601,6 +606,7 @@ if (status & NM_MISC_INT_2) { u8 cbyte; + handled = 1; status &= ~NM_MISC_INT_2; printk (KERN_ERR "NM256: Got misc interrupt #2\n"); NM_ACK_INT (card, NM_MISC_INT_2); @@ -610,11 +616,13 @@ /* Unknown interrupt. */ if (status) { + handled = 1; printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n", status); /* Pray. */ NM_ACK_INT (card, status); } + return IRQ_RETVAL(handled); } /* @@ -623,16 +631,17 @@ * routine. */ -static void +static irqreturn_t nm256_interrupt_zx (int irq, void *dev_id, struct pt_regs *dummy) { struct nm256_info *card = (struct nm256_info *)dev_id; u32 status; static int badintrcount = 0; + int handled = 0; if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) { printk (KERN_ERR "NM256: Bad card pointer\n"); - return; + return IRQ_NONE; } status = nm256_readPort32 (card, 2, NM_INT_REG); @@ -655,13 +664,14 @@ * IRQ 9s. */ + handled = 1; if (card->playing) stopPlay (card); if (card->recording) stopRecord (card); badintrcount = 0; } - return; + return IRQ_RETVAL(handled); } badintrcount = 0; @@ -669,6 +679,7 @@ /* Rather boring; check for individual interrupts and process them. */ if (status & NM2_PLAYBACK_INT) { + handled = 1; status &= ~NM2_PLAYBACK_INT; NM2_ACK_INT (card, NM2_PLAYBACK_INT); @@ -677,6 +688,7 @@ } if (status & NM2_RECORD_INT) { + handled = 1; status &= ~NM2_RECORD_INT; NM2_ACK_INT (card, NM2_RECORD_INT); @@ -687,6 +699,7 @@ if (status & NM2_MISC_INT_1) { u8 cbyte; + handled = 1; status &= ~NM2_MISC_INT_1; printk (KERN_ERR "NM256: Got misc interrupt #1\n"); NM2_ACK_INT (card, NM2_MISC_INT_1); @@ -697,6 +710,7 @@ if (status & NM2_MISC_INT_2) { u8 cbyte; + handled = 1; status &= ~NM2_MISC_INT_2; printk (KERN_ERR "NM256: Got misc interrupt #2\n"); NM2_ACK_INT (card, NM2_MISC_INT_2); @@ -706,11 +720,13 @@ /* Unknown interrupt. */ if (status) { + handled = 1; printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n", status); /* Pray. */ NM2_ACK_INT (card, status); } + return IRQ_RETVAL(handled); } /* diff -Nru a/sound/oss/pas2_card.c b/sound/oss/pas2_card.c --- a/sound/oss/pas2_card.c Mon Jan 13 17:11:59 2003 +++ b/sound/oss/pas2_card.c Mon Apr 21 00:32:53 2003 @@ -89,7 +89,7 @@ /******************* Begin of the Interrupt Handler ********************/ -void pasintr(int irq, void *dev_id, struct pt_regs *dummy) +static irqreturn_t pasintr(int irq, void *dev_id, struct pt_regs *dummy) { int status; @@ -106,6 +106,7 @@ pas_midi_interrupt(); status &= ~0x10; } + return IRQ_HANDLED; } int pas_set_intr(int mask) diff -Nru a/sound/oss/pss.c b/sound/oss/pss.c --- a/sound/oss/pss.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/pss.c Mon Apr 21 00:32:53 2003 @@ -152,7 +152,7 @@ static void pss_write(pss_confdata *devc, int data) { - int i, limit; + unsigned long i, limit; limit = jiffies + HZ/10; /* The timeout is 0.1 seconds */ /* @@ -305,7 +305,8 @@ static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size, int flags) { - int i, limit, val, count; + int i, val, count; + unsigned long limit; if (flags & CPF_FIRST) { diff -Nru a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c --- a/sound/oss/rme96xx.c Mon Feb 24 12:51:23 2003 +++ b/sound/oss/rme96xx.c Mon Apr 21 00:32:53 2003 @@ -542,7 +542,7 @@ inline int rme96xx_gethwptr(rme96xx_info* s,int exact) { - long flags; + unsigned long flags; if (exact) { unsigned int hwp; /* the hwptr seems to be rather unreliable :(, so we don't use it */ @@ -587,7 +587,7 @@ static int rme96xx_startcard(rme96xx_info *s,int stop) { int i; - long flags; + unsigned long flags; COMM ("startcard"); if(s->control_register & RME96xx_IE){ @@ -760,7 +760,7 @@ } -static void rme96xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t rme96xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { int i; rme96xx_info *s = (rme96xx_info *)dev_id; @@ -770,7 +770,7 @@ status = readl(s->iobase + RME96xx_status_register); if (!(status & RME96xx_IRQ)) { - return; + return IRQ_NONE; } spin_lock_irqsave(&s->lock,flags); @@ -785,6 +785,7 @@ wake_up(&(db->wait)); } spin_unlock_irqrestore(&s->lock,flags); + return IRQ_HANDLED; } diff -Nru a/sound/oss/sb_common.c b/sound/oss/sb_common.c --- a/sound/oss/sb_common.c Sun Nov 17 19:33:01 2002 +++ b/sound/oss/sb_common.c Mon Apr 21 00:32:53 2003 @@ -201,7 +201,7 @@ sb_intr(devc); } -static void sbintr(int irq, void *dev_id, struct pt_regs *dummy) +static irqreturn_t sbintr(int irq, void *dev_id, struct pt_regs *dummy) { sb_devc *devc = dev_id; @@ -219,6 +219,7 @@ sb_intr (devc); break; } + return IRQ_HANDLED; } int sb_dsp_reset(sb_devc * devc) diff -Nru a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c --- a/sound/oss/sonicvibes.c Thu Apr 17 12:36:40 2003 +++ b/sound/oss/sonicvibes.c Mon Apr 21 00:32:53 2003 @@ -899,7 +899,7 @@ wake_up(&s->midi.owait); } -static void sv_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sv_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct sv_state *s = (struct sv_state *)dev_id; unsigned int intsrc; @@ -907,11 +907,12 @@ /* fastpath out, to ease interrupt sharing */ intsrc = inb(s->ioenh + SV_CODEC_STATUS); if (!(intsrc & (SV_CSTAT_DMAA | SV_CSTAT_DMAC | SV_CSTAT_MIDI))) - return; + return IRQ_NONE; spin_lock(&s->lock); sv_update_ptr(s); sv_handle_midi(s); spin_unlock(&s->lock); + return IRQ_HANDLED; } static void sv_midi_timer(unsigned long data) diff -Nru a/sound/oss/trident.c b/sound/oss/trident.c --- a/sound/oss/trident.c Thu Apr 3 14:52:57 2003 +++ b/sound/oss/trident.c Mon Apr 21 00:32:53 2003 @@ -1728,7 +1728,7 @@ } } -static void trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct trident_card *card = (struct trident_card *)dev_id; u32 event; @@ -1755,13 +1755,14 @@ event = inl(TRID_REG(card, T4D_MISCINT)); outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(card, T4D_MISCINT)); spin_unlock(&card->lock); - return; + return IRQ_HANDLED; } /* manually clear interrupt status, bad hardware design, blame T^2 */ outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(card, T4D_MISCINT)); spin_unlock(&card->lock); + return IRQ_HANDLED; } /* in this loop, dmabuf.count signifies the amount of data that is waiting to be copied to diff -Nru a/sound/oss/uart401.c b/sound/oss/uart401.c --- a/sound/oss/uart401.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/uart401.c Mon Apr 21 00:32:53 2003 @@ -96,18 +96,19 @@ printk(KERN_WARNING "Too much work in interrupt on uart401 (0x%X). UART jabbering ??\n", devc->base); } -void uart401intr(int irq, void *dev_id, struct pt_regs *dummy) +irqreturn_t uart401intr(int irq, void *dev_id, struct pt_regs *dummy) { uart401_devc *devc = dev_id; if (devc == NULL) { printk(KERN_ERR "uart401: bad devc\n"); - return; + return IRQ_NONE; } if (input_avail(devc)) uart401_input_loop(devc); + return IRQ_HANDLED; } static int diff -Nru a/sound/oss/uart6850.c b/sound/oss/uart6850.c --- a/sound/oss/uart6850.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/uart6850.c Mon Apr 21 00:32:53 2003 @@ -105,10 +105,11 @@ } } -void m6850intr(int irq, void *dev_id, struct pt_regs *dummy) +static irqreturn_t m6850intr(int irq, void *dev_id, struct pt_regs *dummy) { if (input_avail()) uart6850_input_loop(); + return IRQ_HANDLED; } /* diff -Nru a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c --- a/sound/oss/via82cxxx_audio.c Thu Apr 3 15:55:38 2003 +++ b/sound/oss/via82cxxx_audio.c Mon Apr 21 00:32:53 2003 @@ -1694,10 +1694,11 @@ } -static void via_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t via_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct via_info *card = dev_id; u32 status32; + int handled = 0; /* to minimize interrupt sharing costs, we use the SGD status * shadow register to check the status of all inputs and @@ -1708,10 +1709,12 @@ if (!(status32 & VIA_INTR_MASK)) { #ifdef CONFIG_MIDI_VIA82CXXX - if (card->midi_devc) + if (card->midi_devc) { uart401intr(irq, card->midi_devc, regs); + handled = 1; + } #endif - return; + goto out; } DPRINTK ("intr, status32 == 0x%08X\n", status32); @@ -1720,14 +1723,21 @@ */ spin_lock (&card->lock); - if (status32 & VIA_INTR_OUT) + if (status32 & VIA_INTR_OUT) { + handled = 1; via_intr_channel (&card->ch_out); - if (status32 & VIA_INTR_IN) + } + if (status32 & VIA_INTR_IN) { + handled = 1; via_intr_channel (&card->ch_in); - if (status32 & VIA_INTR_FM) + } + if (status32 & VIA_INTR_FM) { + handled = 1; via_intr_channel (&card->ch_fm); - + } spin_unlock (&card->lock); +out: + return IRQ_RETVAL(handled); } diff -Nru a/sound/oss/vidc.h b/sound/oss/vidc.h --- a/sound/oss/vidc.h Sun Feb 10 18:50:08 2002 +++ b/sound/oss/vidc.h Mon Apr 21 00:32:53 2003 @@ -37,7 +37,7 @@ * DMA Interrupt handler */ -extern void vidc_sound_dma_irq(int irqnr, void *ref, struct pt_regs *regs); +extern irqreturn_t vidc_sound_dma_irq(int irqnr, void *ref, struct pt_regs *regs); /* * Filler routine pointer diff -Nru a/sound/oss/vidc_fill.S b/sound/oss/vidc_fill.S --- a/sound/oss/vidc_fill.S Sun Nov 24 15:14:23 2002 +++ b/sound/oss/vidc_fill.S Mon Apr 21 00:32:53 2003 @@ -133,6 +133,10 @@ * ip = corrupted */ +%%%%%%%%%%%%%%%%%%% +fixme! This funtion needs to return IRQ_HANDLED +%%%%%%%%%%%%%%%%%%% + ENTRY(vidc_sound_dma_irq) stmfd sp!, {r4 - r8, lr} ldr r8, =dma_start diff -Nru a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c --- a/sound/oss/vwsnd.c Tue Feb 18 18:58:58 2003 +++ b/sound/oss/vwsnd.c Mon Apr 21 00:32:53 2003 @@ -2236,7 +2236,7 @@ pcm_output(devc, underflown, 0); } -static void vwsnd_audio_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t vwsnd_audio_intr(int irq, void *dev_id, struct pt_regs *regs) { vwsnd_dev_t *devc = (vwsnd_dev_t *) dev_id; unsigned int status; @@ -2246,6 +2246,7 @@ status = li_get_clear_intr_status(&devc->lith); vwsnd_audio_read_intr(devc, status); vwsnd_audio_write_intr(devc, status); + return IRQ_HANDLED; } static ssize_t vwsnd_audio_do_read(struct file *file, diff -Nru a/sound/oss/waveartist.c b/sound/oss/waveartist.c --- a/sound/oss/waveartist.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/waveartist.c Mon Apr 21 00:32:53 2003 @@ -833,7 +833,7 @@ }; -static void +static irqreturn_t waveartist_intr(int irq, void *dev_id, struct pt_regs *regs) { wavnc_info *devc = (wavnc_info *)dev_id; @@ -872,6 +872,7 @@ // We do not use SB mode natively... printk(KERN_WARNING "waveartist: Unexpected SB interrupt...\n"); spin_unlock(&waveartist_lock); + return IRQ_HANDLED; } /* ------------------------------------------------------------------------- diff -Nru a/sound/oss/wavfront.c b/sound/oss/wavfront.c --- a/sound/oss/wavfront.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/wavfront.c Mon Apr 21 00:32:53 2003 @@ -2123,8 +2123,8 @@ /* WaveFront: Linux modular sound kernel installation interface */ /***********************************************************************/ -void -wavefrontintr (int irq, void *dev_id, struct pt_regs *dummy) +static irqreturn_t +wavefrontintr(int irq, void *dev_id, struct pt_regs *dummy) { struct wf_config *hw = dev_id; @@ -2149,12 +2149,13 @@ */ if ((wavefront_status() & (STAT_INTR_READ|STAT_INTR_WRITE)) == 0) { - return; + return IRQ_NONE; } hw->irq_ok = 1; hw->irq_cnt++; wake_up_interruptible (&hw->interrupt_sleeper); + return IRQ_HANDLED; } /* STATUS REGISTER diff -Nru a/sound/oss/wf_midi.c b/sound/oss/wf_midi.c --- a/sound/oss/wf_midi.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/wf_midi.c Mon Apr 21 00:32:53 2003 @@ -354,8 +354,8 @@ return 1; } -void -wf_mpuintr (int irq, void *dev_id, struct pt_regs *dummy) +static irqreturn_t +wf_mpuintr(int irq, void *dev_id, struct pt_regs *dummy) { struct wf_mpu_config *physical_dev = dev_id; @@ -364,10 +364,11 @@ int n; if (!input_avail()) { /* not for us */ - return; + return IRQ_NONE; } - if (mi->m_busy) return; + if (mi->m_busy) + return IRQ_HANDLED; spin_lock(&lock); mi->m_busy = 1; @@ -410,6 +411,7 @@ mi->m_busy = 0; spin_unlock(&lock); + return IRQ_HANDLED; } static int diff -Nru a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c --- a/sound/oss/ymfpci.c Thu Apr 3 14:35:48 2003 +++ b/sound/oss/ymfpci.c Mon Apr 21 00:32:53 2003 @@ -1016,7 +1016,7 @@ return 0; } -void ymf_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ymf_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ymfpci_t *codec = dev_id; u32 status, nvoice, mode; @@ -1050,6 +1050,7 @@ /* timer handler */ ymfpci_writel(codec, YDSXGR_INTFLAG, ~0); } + return IRQ_HANDLED; } static void ymf_pcm_free_substream(struct ymf_pcm *ypcm) diff -Nru a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c --- a/sound/pci/ali5451/ali5451.c Thu Apr 10 03:28:12 2003 +++ b/sound/pci/ali5451/ali5451.c Mon Apr 21 10:36:33 2003 @@ -1032,15 +1032,16 @@ } -static void snd_ali_card_interrupt(int irq, - void *dev_id, - struct pt_regs *regs) +static irqreturn_t snd_ali_card_interrupt(int irq, + void *dev_id, + struct pt_regs *regs) { ali_t *codec = snd_magic_cast(ali_t, dev_id, return); if (codec == NULL) - return; + return IRQ_NONE; snd_ali_interrupt(codec); + return IRQ_HANDLED; } diff -Nru a/sound/pci/als4000.c b/sound/pci/als4000.c --- a/sound/pci/als4000.c Tue Feb 18 10:31:36 2003 +++ b/sound/pci/als4000.c Mon Apr 21 00:32:53 2003 @@ -356,7 +356,7 @@ return bytes_to_frames( substream->runtime, result ); } -static void snd_als4000_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id, struct pt_regs *regs) { sb_t *chip = snd_magic_cast(sb_t, dev_id, return); unsigned long flags; @@ -387,6 +387,7 @@ inb(chip->mpu_port); if (sb_status & 0x20) inb(SBP(chip, RESET)); + return IRQ_HANDLED; } /*****************************************************************/ diff -Nru a/sound/pci/cmipci.c b/sound/pci/cmipci.c --- a/sound/pci/cmipci.c Thu Apr 10 03:28:12 2003 +++ b/sound/pci/cmipci.c Mon Apr 21 10:36:31 2003 @@ -1640,7 +1640,7 @@ /* * interrupt handler */ -static void snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { cmipci_t *cm = snd_magic_cast(cmipci_t, dev_id, return); unsigned int status, mask = 0; @@ -1648,7 +1648,7 @@ /* fastpath out, to ease interrupt sharing */ status = snd_cmipci_read(cm, CM_REG_INT_STATUS); if (!(status & CM_INTR)) - return; + return IRQ_NONE; /* acknowledge interrupt */ spin_lock(&cm->reg_lock); @@ -1669,6 +1669,8 @@ if ((status & CM_CHINT1) && cm->channel[1].running) snd_pcm_period_elapsed(cm->channel[1].substream); } + + return IRQ_HANDLED; } /* diff -Nru a/sound/pci/cs4281.c b/sound/pci/cs4281.c --- a/sound/pci/cs4281.c Thu Apr 10 03:28:12 2003 +++ b/sound/pci/cs4281.c Mon Apr 21 10:39:41 2003 @@ -511,7 +511,7 @@ }; -static void snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs); static struct pci_device_id snd_cs4281_ids[] __devinitdata = { { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */ @@ -1883,18 +1883,18 @@ * Interrupt handler */ -static void snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs) { cs4281_t *chip = snd_magic_cast(cs4281_t, dev_id, return); unsigned int status, dma, val; cs4281_dma_t *cdma; if (chip == NULL) - return; + return IRQ_NONE; status = snd_cs4281_peekBA0(chip, BA0_HISR); if ((status & 0x7fffffff) == 0) { snd_cs4281_pokeBA0(chip, BA0_HICR, BA0_HICR_EOI); - return; + return IRQ_NONE; } if (status & (BA0_HISR_DMA(0)|BA0_HISR_DMA(1)|BA0_HISR_DMA(2)|BA0_HISR_DMA(3))) { @@ -1949,6 +1949,8 @@ /* EOI to the PCI part... reenables interrupts */ snd_cs4281_pokeBA0(chip, BA0_HICR, BA0_HICR_EOI); + + return IRQ_HANDLED; } diff -Nru a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c --- a/sound/pci/cs46xx/cs46xx_lib.c Thu Apr 10 03:28:12 2003 +++ b/sound/pci/cs46xx/cs46xx_lib.c Mon Apr 21 10:39:41 2003 @@ -1217,7 +1217,7 @@ return 0; } -static void snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { cs46xx_t *chip = snd_magic_cast(cs46xx_t, dev_id, return); u32 status1; @@ -1234,7 +1234,7 @@ status1 = snd_cs46xx_peekBA0(chip, BA0_HISR); if ((status1 & 0x7fffffff) == 0) { snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_CHGM | HICR_IEV); - return; + return IRQ_NONE; } #ifdef CONFIG_SND_CS46XX_NEW_DSP @@ -1305,6 +1305,8 @@ * EOI to the PCI part....reenables interrupts */ snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_CHGM | HICR_IEV); + + return IRQ_HANDLED; } static snd_pcm_hardware_t snd_cs46xx_playback = diff -Nru a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c --- a/sound/pci/emu10k1/irq.c Tue Oct 1 10:06:00 2002 +++ b/sound/pci/emu10k1/irq.c Mon Apr 21 10:39:41 2003 @@ -30,13 +30,15 @@ #include #include -void snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) { emu10k1_t *emu = snd_magic_cast(emu10k1_t, dev_id, return); unsigned int status; + int handled = 0; while ((status = inl(emu->port + IPR)) != 0) { // printk("irq - status = 0x%x\n", status); + handled = 1; if (status & IPR_PCIERROR) { snd_printk("interrupt: PCI error\n"); snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE); @@ -145,4 +147,5 @@ outl(IPR_FXDSP, emu->port + IPR); } } + return IRQ_RETVAL(handled); } diff -Nru a/sound/pci/ens1370.c b/sound/pci/ens1370.c --- a/sound/pci/ens1370.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/ens1370.c Sun Apr 20 14:45:01 2003 @@ -412,7 +412,7 @@ #endif }; -static void snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs); static struct pci_device_id snd_audiopci_ids[] __devinitdata = { #ifdef CHIP1370 @@ -2231,17 +2231,17 @@ * Interrupt handler */ -static void snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ensoniq_t *ensoniq = snd_magic_cast(ensoniq_t, dev_id, return); unsigned int status, sctrl; if (ensoniq == NULL) - return; + return IRQ_NONE; status = inl(ES_REG(ensoniq, STATUS)); if (!(status & ES_INTR)) - return; + return IRQ_NONE; spin_lock(&ensoniq->reg_lock); sctrl = ensoniq->sctrl; @@ -2263,6 +2263,7 @@ snd_pcm_period_elapsed(ensoniq->capture_substream); if ((status & ES_DAC1) && ensoniq->playback1_substream) snd_pcm_period_elapsed(ensoniq->playback1_substream); + return IRQ_HANDLED; } static int __devinit snd_audiopci_probe(struct pci_dev *pci, diff -Nru a/sound/pci/es1938.c b/sound/pci/es1938.c --- a/sound/pci/es1938.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/es1938.c Mon Apr 21 10:39:41 2003 @@ -249,7 +249,7 @@ #endif }; -static void snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs); static struct pci_device_id snd_es1938_ids[] __devinitdata = { { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */ @@ -1490,10 +1490,11 @@ /* -------------------------------------------------------------------- * Interrupt handler * -------------------------------------------------------------------- */ -static void snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs) { es1938_t *chip = snd_magic_cast(es1938_t, dev_id, return); unsigned char status, audiostatus; + int handled = 0; status = inb(SLIO_REG(chip, IRQCONTROL)); #if 0 @@ -1509,6 +1510,7 @@ printk("Es1938debug - AUDIO channel 1 DMAC DMA status: 0x%x\n", inl(SLDM_REG(chip, DMASTATUS))); #endif /* clear irq */ + handled = 1; audiostatus = inb(SLSB_REG(chip, STATUS)); if (chip->active & ADC1) snd_pcm_period_elapsed(chip->capture_substream); @@ -1525,6 +1527,7 @@ #endif /* clear irq */ + handled = 1; snd_es1938_mixer_bits(chip, ESSSB_IREG_AUDIO2CONTROL2, 0x80, 0); if (chip->active & DAC2) snd_pcm_period_elapsed(chip->playback1_substream); @@ -1533,6 +1536,7 @@ /* Hardware volume */ if (status & 0x40) { int split = snd_es1938_mixer_read(chip, 0x64) & 0x80; + handled = 1; snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->hw_switch->id); snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->hw_volume->id); if (!split) { @@ -1546,9 +1550,12 @@ /* MPU401 */ if (status & 0x80) { // snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0); /* ack? */ - if (chip->rmidi) + if (chip->rmidi) { + handled = 1; snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs); + } } + return IRQ_RETVAL(handled); } #define ES1938_DMA_SIZE 64 diff -Nru a/sound/pci/es1968.c b/sound/pci/es1968.c --- a/sound/pci/es1968.c Thu Mar 20 08:41:14 2003 +++ b/sound/pci/es1968.c Mon Apr 21 10:36:32 2003 @@ -600,7 +600,7 @@ #endif }; -static void snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs); static struct pci_device_id snd_es1968_ids[] __devinitdata = { /* Maestro 1 */ @@ -2009,13 +2009,13 @@ /* * interrupt handler */ -static void snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs) { es1968_t *chip = snd_magic_cast(es1968_t, dev_id, return); u32 event; if (!(event = inb(chip->io_port + 0x1A))) - return; + return IRQ_NONE; outw(inw(chip->io_port + 4) & 1, chip->io_port + 4); @@ -2041,6 +2041,8 @@ } spin_unlock(&chip->substream_lock); } + + return IRQ_HANDLED; } /* diff -Nru a/sound/pci/fm801.c b/sound/pci/fm801.c --- a/sound/pci/fm801.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/fm801.c Mon Apr 21 10:36:32 2003 @@ -481,7 +481,7 @@ return bytes_to_frames(substream->runtime, ptr); } -static void snd_fm801_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_fm801_interrupt(int irq, void *dev_id, struct pt_regs *regs) { fm801_t *chip = snd_magic_cast(fm801_t, dev_id, return); unsigned short status; @@ -490,7 +490,7 @@ status = inw(FM801_REG(chip, IRQ_STATUS)); status &= FM801_IRQ_PLAYBACK|FM801_IRQ_CAPTURE|FM801_IRQ_MPU|FM801_IRQ_VOLUME; if (! status) - return; + return IRQ_NONE; /* ack first */ outw(status, FM801_REG(chip, IRQ_STATUS)); if (chip->pcm && (status & FM801_IRQ_PLAYBACK) && chip->playback_substream) { @@ -525,6 +525,8 @@ snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs); if (status & FM801_IRQ_VOLUME) ;/* TODO */ + + return IRQ_HANDLED; } static snd_pcm_hardware_t snd_fm801_playback = diff -Nru a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c --- a/sound/pci/ice1712/ice1712.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/ice1712/ice1712.c Mon Apr 21 10:39:41 2003 @@ -398,15 +398,17 @@ * Interrupt handler */ -static void snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return); unsigned char status; + int handled = 0; while (1) { status = inb(ICEREG(ice, IRQSTAT)); if (status == 0) break; + handled = 1; if (status & ICE1712_IRQ_MPU1) { if (ice->rmidi[0]) snd_mpu401_uart_interrupt(irq, ice->rmidi[0]->private_data, regs); @@ -462,6 +464,7 @@ outb(ICE1712_IRQ_CONPBK, ICEREG(ice, IRQSTAT)); } } + return IRQ_RETVAL(handled); } diff -Nru a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c --- a/sound/pci/ice1712/ice1724.c Thu Mar 20 08:41:20 2003 +++ b/sound/pci/ice1712/ice1724.c Mon Apr 21 00:32:53 2003 @@ -194,16 +194,18 @@ * Interrupt handler */ -static void snd_vt1724_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return); unsigned char status; + int handled = 0; while (1) { status = inb(ICEREG1724(ice, IRQSTAT)); if (status == 0) break; - + + handled = 1; /* these should probably be separated at some point, but as we don't currently have MPU support on the board I will leave it */ if ((status & VT1724_IRQ_MPU_RX)||(status & VT1724_IRQ_MPU_TX)) { @@ -242,6 +244,7 @@ } } + return IRQ_RETVAL(handled); } /* diff -Nru a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c --- a/sound/pci/intel8x0.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/intel8x0.c Sun Apr 20 14:14:29 2003 @@ -716,7 +716,7 @@ iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI); } -static void snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) { intel8x0_t *chip = snd_magic_cast(intel8x0_t, dev_id, return); ichdev_t *ichdev; @@ -727,7 +727,7 @@ status = igetdword(chip, chip->int_sta_reg); if ((status & chip->int_sta_mask) == 0) { spin_unlock(&chip->reg_lock); - return; + return IRQ_NONE; } /* ack first */ iputdword(chip, chip->int_sta_reg, status & ~chip->int_sta_mask); @@ -738,6 +738,7 @@ if (status & ichdev->int_sta_mask) snd_intel8x0_update(chip, ichdev); } + return IRQ_HANDLED; } /* diff -Nru a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c --- a/sound/pci/korg1212/korg1212.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/korg1212/korg1212.c Mon Apr 21 10:39:41 2003 @@ -1133,18 +1133,18 @@ snd_korg1212_setCardState(korg1212, K1212_STATE_DSP_COMPLETE); } -static void snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 doorbellValue; korg1212_t *korg1212 = snd_magic_cast(korg1212_t, dev_id, return); if(irq != korg1212->irq) - return; + return IRQ_NONE; doorbellValue = readl(korg1212->inDoorbellPtr); if (!doorbellValue) - return; + return IRQ_NONE; spin_lock(&korg1212->lock); @@ -1218,6 +1218,8 @@ korg1212->inIRQ--; spin_unlock(&korg1212->lock); + + return IRQ_HANDLED; } static int snd_korg1212_downloadDSPCode(korg1212_t *korg1212) diff -Nru a/sound/pci/maestro3.c b/sound/pci/maestro3.c --- a/sound/pci/maestro3.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/maestro3.c Mon Apr 21 10:36:32 2003 @@ -1549,7 +1549,7 @@ } } -static void +static irqreturn_t snd_m3_interrupt(int irq, void *dev_id, struct pt_regs *regs) { m3_t *chip = snd_magic_cast(m3_t, dev_id, ); @@ -1559,13 +1559,13 @@ status = inb(chip->iobase + 0x1A); if (status == 0xff) - return; + return IRQ_NONE; /* presumably acking the ints? */ outw(status, chip->iobase + 0x1A); /*if (in_suspend) - return;*/ + return IRQ_NONE;*/ /* * ack an assp int if its running @@ -1592,6 +1592,8 @@ /* XXX is this needed? */ if (status & 0x40) outb(0x40, chip->iobase+0x1A); + + return IRQ_HANDLED; } diff -Nru a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c --- a/sound/pci/nm256/nm256.c Sun Feb 16 05:47:44 2003 +++ b/sound/pci/nm256/nm256.c Mon Apr 21 00:32:53 2003 @@ -238,7 +238,7 @@ int mixer_status_mask; /* bit mask to test the mixer status */ int irq; - void (*interrupt)(int, void *, struct pt_regs *); + irqreturn_t (*interrupt)(int, void *, struct pt_regs *); int badintrcount; /* counter to check bogus interrupts */ nm256_stream_t streams[2]; @@ -972,7 +972,7 @@ * I suppose...yucky bleah.) */ -static void +static irqreturn_t snd_nm256_interrupt(int irq, void *dev_id, struct pt_regs *dummy) { nm256_t *chip = snd_magic_cast(nm256_t, dev_id, return); @@ -984,7 +984,7 @@ /* Not ours. */ if (status == 0) { snd_nm256_intr_check(chip); - return; + return IRQ_NONE; } chip->badintrcount = 0; @@ -1030,6 +1030,7 @@ } spin_unlock(&chip->reg_lock); + return IRQ_HANDLED; } /* @@ -1038,7 +1039,7 @@ * routine. */ -static void +static irqreturn_t snd_nm256_interrupt_zx(int irq, void *dev_id, struct pt_regs *dummy) { nm256_t *chip = snd_magic_cast(nm256_t, dev_id, return); @@ -1050,7 +1051,7 @@ /* Not ours. */ if (status == 0) { snd_nm256_intr_check(chip); - return; + return IRQ_NONE; } chip->badintrcount = 0; @@ -1095,6 +1096,7 @@ } spin_unlock(&chip->reg_lock); + return IRQ_HANDLED; } /* diff -Nru a/sound/pci/rme32.c b/sound/pci/rme32.c --- a/sound/pci/rme32.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/rme32.c Mon Apr 21 00:32:53 2003 @@ -833,14 +833,14 @@ writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER); } -static void +static irqreturn_t snd_rme32_interrupt(int irq, void *dev_id, struct pt_regs *regs) { rme32_t *rme32 = (rme32_t *) dev_id; rme32->rcreg = readl(rme32->iobase + RME32_IO_CONTROL_REGISTER); if (!(rme32->rcreg & RME32_RCR_IRQ)) { - return; + return IRQ_NONE; } else { if (rme32->capture_substream) { snd_pcm_period_elapsed(rme32->capture_substream); @@ -850,6 +850,7 @@ } writel(0, rme32->iobase + RME32_IO_CONFIRM_ACTION_IRQ); } + return IRQ_HANDLED; } static unsigned int period_bytes[] = { RME32_BLOCK_SIZE }; diff -Nru a/sound/pci/rme96.c b/sound/pci/rme96.c --- a/sound/pci/rme96.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/rme96.c Mon Apr 21 00:32:53 2003 @@ -1153,7 +1153,7 @@ writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER); } -static void +static irqreturn_t snd_rme96_interrupt(int irq, void *dev_id, struct pt_regs *regs) @@ -1165,7 +1165,7 @@ if (!((rme96->rcreg & RME96_RCR_IRQ) || (rme96->rcreg & RME96_RCR_IRQ_2))) { - return; + return IRQ_NONE; } if (rme96->rcreg & RME96_RCR_IRQ) { @@ -1178,6 +1178,7 @@ snd_pcm_period_elapsed(rme96->capture_substream); writel(0, rme96->iobase + RME96_IO_CONFIRM_REC_IRQ); } + return IRQ_HANDLED; } static unsigned int period_bytes[] = { RME96_SMALL_BLOCK_SIZE, RME96_LARGE_BLOCK_SIZE }; diff -Nru a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c --- a/sound/pci/rme9652/hdsp.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/rme9652/hdsp.c Mon Apr 21 00:32:53 2003 @@ -3076,7 +3076,7 @@ } } -void snd_hdsp_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id, struct pt_regs *regs) { hdsp_t *hdsp = (hdsp_t *) dev_id; unsigned int status; @@ -3094,7 +3094,7 @@ midi1 = status & HDSP_midi1IRQPending; if (!audio && !midi0 && !midi1) { - return; + return IRQ_NONE; } hdsp_write(hdsp, HDSP_interruptConfirmation, 0); @@ -3128,6 +3128,7 @@ } if (schedule) tasklet_hi_schedule(&hdsp->midi_tasklet); + return IRQ_HANDLED; } static snd_pcm_uframes_t snd_hdsp_hw_pointer(snd_pcm_substream_t *substream) diff -Nru a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c --- a/sound/pci/rme9652/rme9652.c Thu Apr 10 03:28:14 2003 +++ b/sound/pci/rme9652/rme9652.c Mon Apr 21 00:32:53 2003 @@ -1947,12 +1947,12 @@ rme9652_set_rate(rme9652, 48000); } -void snd_rme9652_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_rme9652_interrupt(int irq, void *dev_id, struct pt_regs *regs) { rme9652_t *rme9652 = (rme9652_t *) dev_id; if (!(rme9652_read(rme9652, RME9652_status_register) & RME9652_IRQ)) { - return; + return IRQ_NONE; } rme9652_write(rme9652, RME9652_irq_clear, 0); @@ -1964,6 +1964,7 @@ if (rme9652->playback_substream) { snd_pcm_period_elapsed(rme9652->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); } + return IRQ_HANDLED; } static snd_pcm_uframes_t snd_rme9652_hw_pointer(snd_pcm_substream_t *substream) diff -Nru a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c --- a/sound/pci/sonicvibes.c Thu Mar 20 08:41:15 2003 +++ b/sound/pci/sonicvibes.c Mon Apr 21 10:36:32 2003 @@ -596,18 +596,18 @@ return result; } -static void snd_sonicvibes_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_sonicvibes_interrupt(int irq, void *dev_id, struct pt_regs *regs) { sonicvibes_t *sonic = snd_magic_cast(sonicvibes_t, dev_id, return); unsigned char status; status = inb(SV_REG(sonic, STATUS)); if (!(status & (SV_DMAA_IRQ | SV_DMAC_IRQ | SV_MIDI_IRQ))) - return; + return IRQ_NONE; if (status == 0xff) { /* failure */ outb(sonic->irqmask = ~0, SV_REG(sonic, IRQMASK)); snd_printk("IRQ failure - interrupts disabled!!\n"); - return; + return IRQ_HANDLED; } if (sonic->pcm) { if (status & SV_DMAA_IRQ) @@ -654,6 +654,8 @@ snd_ctl_notify(sonic->card, SNDRV_CTL_EVENT_MASK_VALUE, &sonic->master_mute->id); snd_ctl_notify(sonic->card, SNDRV_CTL_EVENT_MASK_VALUE, &sonic->master_volume->id); } + + return IRQ_HANDLED; } /* diff -Nru a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c --- a/sound/pci/trident/trident_main.c Thu Apr 10 03:28:14 2003 +++ b/sound/pci/trident/trident_main.c Mon Apr 21 10:36:33 2003 @@ -48,7 +48,7 @@ static int snd_trident_pcm_mixer_build(trident_t *trident, snd_trident_voice_t * voice, snd_pcm_substream_t *substream); static int snd_trident_pcm_mixer_free(trident_t *trident, snd_trident_voice_t * voice, snd_pcm_substream_t *substream); -static void snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs); #ifdef CONFIG_PM static int snd_trident_set_power_state(snd_card_t *card, unsigned int power_state); #endif @@ -3683,11 +3683,11 @@ the method try & fail so it is possible that it won't work on all computers. [jaroslav] - Returns: None. + Returns: Whether IRQ was handled or not. ---------------------------------------------------------------------------*/ -static void snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) { trident_t *trident = snd_magic_cast(trident_t, dev_id, return); unsigned int audio_int, chn_int, stimer, channel, mask, tmp; @@ -3696,7 +3696,7 @@ audio_int = inl(TRID_REG(trident, T4D_MISCINT)); if ((audio_int & (ADDRESS_IRQ|MPU401_IRQ)) == 0) - return; + return IRQ_NONE; if (audio_int & ADDRESS_IRQ) { // get interrupt status for all channels spin_lock(&trident->reg_lock); @@ -3781,6 +3781,8 @@ } } // outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(trident, T4D_MISCINT)); + + return IRQ_HANDLED; } /*--------------------------------------------------------------------------- diff -Nru a/sound/pci/via82xx.c b/sound/pci/via82xx.c --- a/sound/pci/via82xx.c Thu Apr 10 03:28:14 2003 +++ b/sound/pci/via82xx.c Mon Apr 21 00:32:53 2003 @@ -574,7 +574,7 @@ * Interrupt handler */ -static void snd_via82xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_via82xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { via82xx_t *chip = snd_magic_cast(via82xx_t, dev_id, return); unsigned int status; @@ -591,8 +591,8 @@ spin_unlock(&chip->reg_lock); if (chip->rmidi) /* check mpu401 interrupt */ - snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs); - return; + return snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs); + return IRQ_NONE; } // _skip_sgd: @@ -611,6 +611,7 @@ outb(c_status, VIADEV_REG(viadev, OFFSET_STATUS)); /* ack */ } spin_unlock(&chip->reg_lock); + return IRQ_HANDLED; } /* diff -Nru a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c --- a/sound/pci/ymfpci/ymfpci_main.c Thu Apr 10 03:28:14 2003 +++ b/sound/pci/ymfpci/ymfpci_main.c Mon Apr 21 10:36:33 2003 @@ -741,7 +741,7 @@ } } -static void snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ymfpci_t *chip = snd_magic_cast(ymfpci_t, dev_id, return); u32 status, nvoice, mode; @@ -787,6 +787,8 @@ if (chip->rawmidi) snd_mpu401_uart_interrupt(irq, chip->rawmidi->private_data, regs); + + return IRQ_HANDLED; } static snd_pcm_hardware_t snd_ymfpci_playback = diff -Nru a/sound/ppc/pmac.c b/sound/ppc/pmac.c --- a/sound/ppc/pmac.c Thu Apr 10 03:28:14 2003 +++ b/sound/ppc/pmac.c Mon Apr 21 00:32:53 2003 @@ -693,23 +693,25 @@ /* * interrupt handlers */ -static void +static irqreturn_t snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs) { pmac_t *chip = snd_magic_cast(pmac_t, devid, return); snd_pmac_pcm_update(chip, &chip->playback); + return IRQ_HANDLED; } -static void +static irqreturn_t snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs) { pmac_t *chip = snd_magic_cast(pmac_t, devid, return); snd_pmac_pcm_update(chip, &chip->capture); + return IRQ_HANDLED; } -static void +static irqreturn_t snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs) { pmac_t *chip = snd_magic_cast(pmac_t, devid, return); @@ -728,6 +730,7 @@ } /* Writing 1s to the CNTLERR and PORTCHG bits clears them... */ out_le32(&chip->awacs->control, ctrl); + return IRQ_HANDLED; } diff -Nru a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c --- a/sound/ppc/tumbler.c Sun Feb 9 10:47:45 2003 +++ b/sound/ppc/tumbler.c Mon Apr 21 00:32:53 2003 @@ -785,11 +785,14 @@ /* interrupt - headphone plug changed */ -static void headphone_intr(int irq, void *devid, struct pt_regs *regs) +static irqreturn_t headphone_intr(int irq, void *devid, struct pt_regs *regs) { pmac_t *chip = snd_magic_cast(pmac_t, devid, return); - if (chip->update_automute && chip->initialized) + if (chip->update_automute && chip->initialized) { chip->update_automute(chip, 1); + return IRQ_HANDLED; + } + return IRQ_NONE; } /* look for audio-gpio device */ diff -Nru a/sound/sound_core.c b/sound/sound_core.c --- a/sound/sound_core.c Sat Mar 22 07:38:05 2003 +++ b/sound/sound_core.c Fri Apr 18 11:59:04 2003 @@ -54,7 +54,7 @@ int unit_minor; struct file_operations *unit_fops; struct sound_unit *next; - devfs_handle_t de; + char name[32]; }; #ifdef CONFIG_SOUND_MSNDCLAS @@ -151,30 +151,29 @@ static int sound_insert_unit(struct sound_unit **list, struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode) { + struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL); int r; - struct sound_unit *s=(struct sound_unit *)kmalloc(sizeof(struct sound_unit), GFP_KERNEL); - char name_buf[32]; - if(s==NULL) + if (!s) return -ENOMEM; spin_lock(&sound_loader_lock); - r=__sound_insert_unit(s,list,fops,index,low,top); + r = __sound_insert_unit(s, list, fops, index, low, top); spin_unlock(&sound_loader_lock); - if(r<0) - { - kfree(s); - return r; - } - - if (r < SOUND_STEP) - sprintf (name_buf, "sound/%s", name); + if (r < 0) + goto fail; + else if (r < SOUND_STEP) + sprintf(s->name, "sound/%s", name); else - sprintf (name_buf, "sound/%s%d", name, r / SOUND_STEP); - s->de = devfs_register (NULL, name_buf, - DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor, - S_IFCHR | mode, fops, NULL); + sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP); + + devfs_register(NULL, s->name, 0, SOUND_MAJOR, s->unit_minor, + S_IFCHR | mode, fops, NULL); + return r; + + fail: + kfree(s); return r; } @@ -192,7 +191,7 @@ p = __sound_remove_unit(list, unit); spin_unlock(&sound_loader_lock); if (p) { - devfs_unregister (p->de); + devfs_remove(p->name); kfree(p); } } diff -Nru a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c --- a/sound/sparc/amd7930.c Mon Nov 18 14:37:24 2002 +++ b/sound/sparc/amd7930.c Mon Apr 21 10:36:33 2003 @@ -497,7 +497,7 @@ __amd7930_write_map(amd); } -static void snd_amd7930_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_amd7930_interrupt(int irq, void *dev_id, struct pt_regs *regs) { amd7930_t *amd = dev_id; unsigned int elapsed; @@ -536,6 +536,8 @@ snd_pcm_period_elapsed(amd->playback_substream); else snd_pcm_period_elapsed(amd->capture_substream); + + return IRQ_HANDLED; } static int snd_amd7930_trigger(amd7930_t *amd, unsigned int flag, int cmd) diff -Nru a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c --- a/sound/sparc/cs4231.c Sat Nov 30 10:41:33 2002 +++ b/sound/sparc/cs4231.c Mon Apr 21 10:36:33 2003 @@ -1228,7 +1228,7 @@ } #ifdef SBUS_SUPPORT -static void snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_regs *regs) { cs4231_t *chip = snd_magic_cast(cs4231_t, dev_id, return); u32 csr; @@ -1240,12 +1240,14 @@ APC_GENL_INT | APC_XINT_PEMP | APC_XINT_CEMP))) - return; + return IRQ_NONE; /* ACK the APC interrupt. */ sbus_writel(csr, chip->port + APCCSR); snd_cs4231_generic_interrupt(chip); + + return IRQ_HANDLED; } #endif