From: Linus Torvalds Date: Fri, 23 Nov 2007 20:39:27 +0000 (-0500) Subject: Linux 2.4.0-test10pre3 X-Git-Tag: 2.4.0-test10pre3 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=52bb34eca7a1e109192fdef2d641f8c5cf043033;p=history.git Linux 2.4.0-test10pre3 - update email address of Joerg Reuter - Andries Brouwer: spelling fixes, missing atari brelse(), breada() fix - Geert Uytterhoeven: used named initializers for "struct console". - Carsten Paeth: ISDN capifs - iput() only once. - Petr Vandrovec: VFAT short name generation fix - Jeff Garzik: i810_rng cleanup, and i815 chipset added. - Bartlomiej Zolnierkiewicz: clean up some remaining old-style Makefiles - Dave Jones: x86 setup fixes (recognize Pentium IV etc). - x86: do the "fast A20" setup too in setup.S - NIIBE Yutaka: update SuperH for the global page table (vmalloc) change. - David Miller: sparc updates (vmalloc stuff still pending) - David Miller: CodaFS warnings and 64-bit warnings in pci_size() - David Miller: pcnet32 - correct NULL test - David Miller: vmlist lock -> page_table_lock clarification - Trond Myklebust: Ouch. rpcauth_lookup_credcache() memory corruption bug - Matthew Wilcox: file locking cleanups - David Woodhouse: USB audio spinlock fixes - Torben Mathiasen: tlan driver cleanups - Randy Dunlap: Yenta: CACHE_LINE_SIZE is in dwords, not bytes. - Randy Dunlap: more USB updates - Kanoj Sarcar: clean up the NUMA interfaces (pg_data instead of nodes) - "save_fpu()" was broken. Need to clear pending errors: save_init_fpu(). --- diff --git a/CREDITS b/CREDITS index a9f3e219d564..1e3563dc2a54 100644 --- a/CREDITS +++ b/CREDITS @@ -1703,7 +1703,7 @@ D: cfdisk (curses based disk partitioning program) N: Torben Mathiasen E: torben.mathiasen@compaq.com -E: tmm@image.dk +E: torben@kernel.dk W: http://tlan.kernel.dk D: ThunderLAN maintainer D: ThunderLAN updates and other kernel fixes. @@ -2173,9 +2173,9 @@ S: 79098 Freiburg S: Germany N: Joerg Reuter -E: jreuter@poboxes.com -W: http://poboxes.com/jreuter/ -W: http://qsl.net/dl1bke/ +E: jreuter@yaina.de +W: http://yaina.de/jreuter/ +W: http://www.qsl.net/dl1bke/ D: Generic Z8530 driver, AX.25 DAMA slave implementation D: Several AX.25 hacks diff --git a/Documentation/networking/z8530drv.txt b/Documentation/networking/z8530drv.txt index c74fb4253e6b..60f453d18f89 100644 --- a/Documentation/networking/z8530drv.txt +++ b/Documentation/networking/z8530drv.txt @@ -4,17 +4,14 @@ full package from: Internet: ========= -1. ftp://ftp.ccac.rwth-aachen.de/pub/jr/z8530drv-utils-3.0-1.tar.gz +1. ftp://ftp.ccac.rwth-aachen.de/pub/jr/z8530drv-utils_3.0-3.tar.gz -2. ftp://ftp.pspt.fi/pub/ham/linux/ax25/z8530drv-utils-3.0-1.tar.gz - -3. ftp://ftp.ucsd.edu/hamradio/packet/tcpip/incoming/z8530drv-utils-3.0.tar.gz - If you can't find it there, try .../tcpip/linux/z8530drv-utils-3.0.tar.gz +2. ftp://ftp.pspt.fi/pub/ham/linux/ax25/z8530drv-utils_3.0-3.tar.gz Please note that the information in this document may be hopelessly outdated. A new version of the documentation, along with links to other important Linux Kernel AX.25 documentation and programs, is available on -http://www.rat.de/jr +http://yaina.de/jreuter ----------------------------------------------------------------------------- @@ -23,7 +20,7 @@ http://www.rat.de/jr ******************************************************************** - (c) 1993,1998 by Joerg Reuter DL1BKE + (c) 1993,2000 by Joerg Reuter DL1BKE portions (c) 1993 Guido ten Dolle PE1NNZ @@ -655,6 +652,6 @@ Many thanks to Linus Torvalds and Alan Cox for including the driver in the Linux standard distribution and their support. Joerg Reuter ampr-net: dl1bke@db0pra.ampr.org - AX-25 : DL1BKE @ DB0ACH.#NRW.DEU.EU - Internet: jreuter@poboxes.com - WWW : http://www.rat.de/jr/ + AX-25 : DL1BKE @ DB0ABH.#BAY.DEU.EU + Internet: jreuter@yaina.de + WWW : http://yaina.de/jreuter diff --git a/Documentation/s390/cds.txt b/Documentation/s390/cds.txt index 99d514d4c3bb..1de55871840f 100644 --- a/Documentation/s390/cds.txt +++ b/Documentation/s390/cds.txt @@ -419,7 +419,7 @@ therefore not rely on this parameter on function entry. free_irq() - Release Device Ownership A device driver may call free_irq() to release ownership of a previously -aquired device. +acquired device. void free_irq( unsigned int irq, void *dev_id); diff --git a/Documentation/vm/locking b/Documentation/vm/locking index 125cde7cdf69..f2e8e6c75e3e 100644 --- a/Documentation/vm/locking +++ b/Documentation/vm/locking @@ -4,7 +4,7 @@ The intent of this file is to have an uptodate, running commentary from different people about how locking and synchronization is done in the Linux vm code. -vmlist_access_lock/vmlist_modify_lock +page_table_lock -------------------------------------- Page stealers pick processes out of the process pool and scan for @@ -12,10 +12,10 @@ the best process to steal pages from. To guarantee the existence of the victim mm, a mm_count inc and a mmdrop are done in swap_out(). Page stealers hold kernel_lock to protect against a bunch of races. The vma list of the victim mm is also scanned by the stealer, -and the vmlist_lock is used to preserve list sanity against the +and the page_table_lock is used to preserve list sanity against the process adding/deleting to the list. This also guarantees existence of the vma. Vma existence is not guaranteed once try_to_swap_out() -drops the vmlist lock. To guarantee the existence of the underlying +drops the page_table_lock. To guarantee the existence of the underlying file structure, a get_file is done before the swapout() method is invoked. The page passed into swapout() is guaranteed not to be reused for a different purpose because the page reference count due to being @@ -32,19 +32,19 @@ you must hold mmap_sem to guard against clones doing mmap/munmap/faults, (ie all vm system calls and faults), and from ptrace, swapin due to swap deletion etc. 2. To modify the vmlist (add/delete or change fields in an element), -you must also hold vmlist_modify_lock, to guard against page stealers +you must also hold page_table_lock, to guard against page stealers scanning the list. 3. To scan the vmlist (find_vma()), you must either a. grab mmap_sem, which should be done by all cases except page stealer. or - b. grab vmlist_access_lock, only done by page stealer. -4. While holding the vmlist_modify_lock, you must be able to guarantee + b. grab page_table_lock, only done by page stealer. +4. While holding the page_table_lock, you must be able to guarantee that no code path will lead to page stealing. A better guarantee is to claim non sleepability, which ensures that you are not sleeping for a lock, whose holder might in turn be doing page stealing. -5. You must be able to guarantee that while holding vmlist_modify_lock -or vmlist_access_lock of mm A, you will not try to get either lock +5. You must be able to guarantee that while holding page_table_lock +or page_table_lock of mm A, you will not try to get either lock for mm B. The caveats are: @@ -52,7 +52,7 @@ The caveats are: The update of mmap_cache is racy (page stealer can race with other code that invokes find_vma with mmap_sem held), but that is okay, since it is a hint. This can be fixed, if desired, by having find_vma grab the -vmlist lock. +page_table_lock. Code that add/delete elements from the vmlist chain are @@ -72,23 +72,16 @@ in some cases it is not really needed. Eg, vm_start is modified by expand_stack(), it is hard to come up with a destructive scenario without having the vmlist protection in this case. -The vmlist lock nests with the inode i_shared_lock and the kmem cache +The page_table_lock nests with the inode i_shared_lock and the kmem cache c_spinlock spinlocks. This is okay, since code that holds i_shared_lock never asks for memory, and the kmem code asks for pages after dropping -c_spinlock. The vmlist lock also nests with pagecache_lock and +c_spinlock. The page_table_lock also nests with pagecache_lock and pagemap_lru_lock spinlocks, and no code asks for memory with these locks held. -The vmlist lock is grabbed while holding the kernel_lock spinning monitor. +The page_table_lock is grabbed while holding the kernel_lock spinning monitor. -The vmlist lock can be a sleeping or spin lock. In either case, care -must be taken that it is not held on entry to the driver methods, since -those methods might sleep or ask for memory, causing deadlocks. - -The current implementation of the vmlist lock uses the page_table_lock, -which is also the spinlock that page stealers use to protect changes to -the victim process' ptes. Thus we have a reduction in the total number -of locks. +The page_table_lock is a spin lock. swap_list_lock/swap_device_lock ------------------------------- diff --git a/MAINTAINERS b/MAINTAINERS index 3be1a37d0c1e..0e61213e5ca4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -295,9 +295,9 @@ S: Supported DAMA SLAVE for AX.25 P: Joerg Reuter -M: jreuter@poboxes.com -W: http://poboxes.com/jreuter/ -W: http://qsl.net/dl1bke/ +M: jreuter@yaina.de +W: http://yaina.de/jreuter/ +W: http://www.qsl.net/dl1bke/ L: linux-hams@vger.kernel.org S: Maintained @@ -423,8 +423,8 @@ S: Maintained FILE LOCKING (flock() and fcntl()/lockf()) P: Matthew Wilcox -M: willy@thepuffingroup.com -L: linux-kernel@vger.kernel.org +M: matthew@wil.cx +L: linux-fsdevel@vger.kernel.org S: Maintained FPU EMULATOR @@ -1151,7 +1151,7 @@ S: Maintained TLAN NETWORK DRIVER P: Torben Mathiasen M: torben.mathiasen@compaq.com -M: tmm@image.dk +M: torben@kernel.dk L: tlan@vuser.vu.union.edu L: linux-net@vger.kernel.org W: http://tlan.kernel.dk @@ -1386,9 +1386,9 @@ S: Maintained for 2.2 only Z8530 DRIVER FOR AX.25 P: Joerg Reuter -M: jreuter@poboxes.com -W: http://poboxes.com/jreuter/ -W: http://qsl.net/dl1bke/ +M: jreuter@yaina.de +W: http://yaina.de/jreuter/ +W: http://www.qsl.net/dl1bke/ L: linux-hams@vger.kernel.org S: Maintained diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index 4aded0d6aecd..ed7d896c47f7 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -449,17 +449,13 @@ static int __init srm_console_setup(struct console *co, char *options) } static struct console srmcons = { - "srm0", - srm_console_write, - NULL, - srm_console_device, - srm_console_wait_key, - NULL, - srm_console_setup, - CON_PRINTBUFFER | CON_ENABLED, /* fake it out */ - -1, - 0, - NULL + name: "srm0", + write: srm_console_write, + device: srm_console_device, + wait_key: srm_console_wait_key, + setup: srm_console_setup, + flags: CON_PRINTBUFFER | CON_ENABLED, /* fake it out */ + index: -1, }; #else diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c index e01a6417eb64..f898526411c1 100644 --- a/arch/arm/kernel/semaphore.c +++ b/arch/arm/kernel/semaphore.c @@ -19,8 +19,8 @@ /* * Semaphores are implemented using a two-way counter: * The "count" variable is decremented for each process - * that tries to aquire the semaphore, while the "sleeping" - * variable is a count of such aquires. + * that tries to acquire the semaphore, while the "sleeping" + * variable is a count of such acquires. * * Notably, the inline "up()" and "down()" functions can * efficiently test if they need to do any extra work (up @@ -257,7 +257,7 @@ struct rw_semaphore *down_write_failed(struct rw_semaphore *sem) while (atomic_read(&sem->count) < 0) { set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (atomic_read(&sem->count) >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S index c91d8ff0037e..d3e6fa4114bf 100644 --- a/arch/i386/boot/setup.S +++ b/arch/i386/boot/setup.S @@ -641,6 +641,9 @@ end_move_self: # now we are at the right place outb %al, $0x60 call empty_8042 + movb $02, %al # "fast A20" version + outb %al, $0x92 # some chips have only this + # wait until a20 really *is* enabled; it can take a fair amount of # time on certain systems; Toshiba Tecras are known to have this # problem. The memory location used here (0x200) is the int 0x80 diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c index b264c54a31a2..5044c7cadb37 100644 --- a/arch/i386/kernel/i387.c +++ b/arch/i386/kernel/i387.c @@ -36,19 +36,6 @@ * FPU lazy state save handling. */ -void save_fpu( struct task_struct *tsk ) -{ - if ( HAVE_FXSR ) { - asm volatile( "fxsave %0 ; fwait" - : "=m" (tsk->thread.i387.fxsave) ); - } else { - asm volatile( "fnsave %0 ; fwait" - : "=m" (tsk->thread.i387.fsave) ); - } - tsk->flags &= ~PF_USEDFPU; - stts(); -} - void save_init_fpu( struct task_struct *tsk ) { if ( HAVE_FXSR ) { diff --git a/arch/i386/kernel/semaphore.c b/arch/i386/kernel/semaphore.c index febc592aeb5a..d70e9e569693 100644 --- a/arch/i386/kernel/semaphore.c +++ b/arch/i386/kernel/semaphore.c @@ -20,8 +20,8 @@ /* * Semaphores are implemented using a two-way counter: * The "count" variable is decremented for each process - * that tries to aquire the semaphore, while the "sleeping" - * variable is a count of such aquires. + * that tries to acquire the semaphore, while the "sleeping" + * variable is a count of such acquires. * * Notably, the inline "up()" and "down()" functions can * efficiently test if they need to do any extra work (up @@ -373,7 +373,7 @@ struct rw_semaphore *down_write_failed(struct rw_semaphore *sem) while (atomic_read(&sem->count) < 0) { set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (atomic_read(&sem->count) >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index e765a0e94864..bd4adf92c4ca 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -51,6 +51,10 @@ * Forward port AMD Duron errata T13 from 2.2.17pre * Dave Jones , August 2000 * + * Forward port lots of fixes/improvements from 2.2.18pre + * Cyrix III, Pentium IV support. + * Dave Jones , October 2000 + * */ /* @@ -137,6 +141,8 @@ extern int root_mountflags; extern char _text, _etext, _edata, _end; extern unsigned long cpu_khz; +static int disable_x86_serial_nr __initdata = 1; + /* * This is set up by the setup-routine at boot-time */ @@ -844,12 +850,6 @@ static int __init get_model_name(struct cpuinfo_x86 *c) { unsigned int n, dummy, *v; - /* - * Actually we must have cpuid or we could never have - * figured out that this was AMD/Cyrix/Transmeta - * from the vendor info :-). - */ - cpuid(0x80000000, &n, &dummy, &dummy, &dummy); if (n < 0x80000004) return 0; @@ -862,29 +862,45 @@ static int __init get_model_name(struct cpuinfo_x86 *c) return 1; } + +static void __init display_cacheinfo(struct cpuinfo_x86 *c) +{ + unsigned int n, dummy, ecx, edx; + + cpuid(0x80000000, &n, &dummy, &dummy, &dummy); + + if (n >= 0x80000005) { + cpuid(0x80000005, &dummy, &dummy, &ecx, &edx); + printk("CPU: L1 I Cache: %dK L1 D Cache: %dK (%d bytes/line)\n", + edx>>24, ecx>>24, edx&0xFF); + c->x86_cache_size=(ecx>>24)+(edx>>24); + } + + if (n < 0x80000006) /* Cyrix just has large L1. */ + return; + + cpuid(0x80000006, &dummy, &dummy, &ecx, &edx); + c->x86_cache_size = ecx >>16; + + /* AMD errata T13 (order #21922) */ + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && + boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 3 && + boot_cpu_data.x86_mask == 0) + { + c->x86_cache_size = 64; + } + printk("CPU: L2 Cache: %dK\n", ecx>>16); +} + + static int __init amd_model(struct cpuinfo_x86 *c) { u32 l, h; unsigned long flags; - unsigned int n, dummy, ecx, edx; int mbytes = max_mapnr >> (20-PAGE_SHIFT); int r=get_model_name(c); - /* - * Set MTRR capability flag if appropriate - */ - if(boot_cpu_data.x86 == 5) { - if((boot_cpu_data.x86_model == 13) || - (boot_cpu_data.x86_model == 9) || - ((boot_cpu_data.x86_model == 8) && - (boot_cpu_data.x86_mask >= 8))) - c->x86_capability |= X86_FEATURE_MTRR; - } - - /* - * Now do the cache operations. - */ switch(c->x86) { case 5: @@ -923,6 +939,7 @@ static int __init amd_model(struct cpuinfo_x86 *c) if(mbytes>4092) mbytes=4092; + rdmsr(0xC0000082, l, h); if((l&0xFFFF0000)==0) { @@ -935,35 +952,23 @@ static int __init amd_model(struct cpuinfo_x86 *c) printk(KERN_INFO "Enabling new style K6 write allocation for %d Mb\n", mbytes); } + + /* Set MTRR capability flag if appropriate */ + if((boot_cpu_data.x86_model == 13) || + (boot_cpu_data.x86_model == 9) || + ((boot_cpu_data.x86_model == 8) && + (boot_cpu_data.x86_mask >= 8))) + c->x86_capability |= X86_FEATURE_MTRR; break; } + break; + case 6: /* An Athlon/Duron. We can trust the BIOS probably */ break; } - cpuid(0x80000000, &n, &dummy, &dummy, &dummy); - if (n >= 0x80000005) { - cpuid(0x80000005, &dummy, &dummy, &ecx, &edx); - printk("CPU: L1 I Cache: %dK L1 D Cache: %dK (%d bytes/line)\n", - edx>>24, ecx>>24, edx&0xFF); - c->x86_cache_size=(ecx>>24)+(edx>>24); - } - - /* AMD errata T13 (order #21922) */ - if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 3 && - boot_cpu_data.x86_mask == 0) - { - c->x86_cache_size = 64; - printk("CPU: L2 Cache: 64K\n"); - } else { - if (n >= 0x80000006) { - cpuid(0x80000006, &dummy, &dummy, &ecx, &edx); - printk("CPU: L2 Cache: %dK\n", ecx>>16); - c->x86_cache_size=(ecx>>16); - } - } - + display_cacheinfo(c); return r; } @@ -1097,9 +1102,8 @@ static void __init cyrix_model(struct cpuinfo_x86 *c) bug to do with 'hlt'. I've not seen any boards using VSA2 and X doesn't seem to support it either so who cares 8). VSA1 we work around however. - */ - + printk(KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n"); isa_dma_bridge_buggy = 2; #endif @@ -1183,79 +1187,104 @@ static void __init centaur_model(struct cpuinfo_x86 *c) u32 lo,hi,newlo; u32 aa,bb,cc,dd; - switch(c->x86_model) { - case 4: - name="C6"; - fcr_set=ECX8|DSMC|EDCTLB|EMMX|ERETSTK; - fcr_clr=DPDC; - printk("Disabling bugged TSC.\n"); - c->x86_capability &= ~X86_FEATURE_TSC; - break; - case 8: - switch(c->x86_mask) { - default: - name="2"; - break; - case 7 ... 9: - name="2A"; - break; - case 10 ... 15: - name="2B"; + switch (c->x86) { + + case 5: + switch(c->x86_model) { + case 4: + name="C6"; + fcr_set=ECX8|DSMC|EDCTLB|EMMX|ERETSTK; + fcr_clr=DPDC; + printk("Disabling bugged TSC.\n"); + c->x86_capability &= ~X86_FEATURE_TSC; + break; + case 8: + switch(c->x86_mask) { + default: + name="2"; + break; + case 7 ... 9: + name="2A"; + break; + case 10 ... 15: + name="2B"; + break; + } + fcr_set=ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK|E2MMX|EAMD3D; + fcr_clr=DPDC; + break; + case 9: + name="3"; + fcr_set=ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK|E2MMX|EAMD3D; + fcr_clr=DPDC; + break; + case 10: + name="4"; + /* no info on the WC4 yet */ + break; + default: + name="??"; + } + + /* get FCR */ + rdmsr(0x107, lo, hi); + + newlo=(lo|fcr_set) & (~fcr_clr); + + if (newlo!=lo) { + printk("Centaur FCR was 0x%X now 0x%X\n", lo, newlo ); + wrmsr(0x107, newlo, hi ); + } else { + printk("Centaur FCR is 0x%X\n",lo); + } + /* Emulate MTRRs using Centaur's MCR. */ + c->x86_capability |= X86_FEATURE_MTRR; + /* Report CX8 */ + c->x86_capability |= X86_FEATURE_CX8; + /* Set 3DNow! on Winchip 2 and above. */ + if (c->x86_model >=8) + c->x86_capability |= X86_FEATURE_AMD3D; + /* See if we can find out some more. */ + cpuid(0x80000000,&aa,&bb,&cc,&dd); + if (aa>=0x80000005) { /* Yes, we can. */ + cpuid(0x80000005,&aa,&bb,&cc,&dd); + /* Add L1 data and code cache sizes. */ + c->x86_cache_size = (cc>>24)+(dd>>24); + } + sprintf( c->x86_model_id, "WinChip %s", name ); break; - } - fcr_set=ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK|E2MMX|EAMD3D; - fcr_clr=DPDC; - break; - case 9: - name="3"; - fcr_set=ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK|E2MMX|EAMD3D; - fcr_clr=DPDC; - break; - case 10: - name="4"; - /* no info on the WC4 yet */ - break; - default: - name="??"; - } - /* get FCR */ - rdmsr(0x107, lo, hi); + case 6: + switch (c->x86_model) { + case 6: /* Cyrix III */ + rdmsr (0x1107, lo, hi); + lo |= (1<<1 | 1<<7); /* Report CX8 & enable PGE */ + wrmsr (0x1107, lo, hi); - newlo=(lo|fcr_set) & (~fcr_clr); + c->x86_capability |= X86_FEATURE_CX8; + rdmsr (0x80000001, lo, hi); + if (hi & (1<<31)) + c->x86_capability |= X86_FEATURE_AMD3D; - if (newlo!=lo) { - printk("Centaur FCR was 0x%X now 0x%X\n", lo, newlo ); - wrmsr(0x107, newlo, hi ); - } else { - printk("Centaur FCR is 0x%X\n",lo); + get_model_name(c); + display_cacheinfo(c); + break; + } + break; } - /* Emulate MTRRs using Centaur's MCR. */ - c->x86_capability |= X86_FEATURE_MTRR; - /* Report CX8 */ - c->x86_capability |= X86_FEATURE_CX8; - /* Set 3DNow! on Winchip 2 and above. */ - if (c->x86_model >=8) - c->x86_capability |= X86_FEATURE_AMD3D; - /* See if we can find out some more. */ - cpuid(0x80000000,&aa,&bb,&cc,&dd); - if (aa>=0x80000005) { /* Yes, we can. */ - cpuid(0x80000005,&aa,&bb,&cc,&dd); - /* Add L1 data and code cache sizes. */ - c->x86_cache_size = (cc>>24)+(dd>>24); - } - sprintf( c->x86_model_id, "WinChip %s", name ); } + static void __init transmeta_model(struct cpuinfo_x86 *c) { - unsigned int cap_mask, uk, max, dummy, n, ecx, edx; + unsigned int cap_mask, uk, max, dummy; unsigned int cms_rev1, cms_rev2; unsigned int cpu_rev, cpu_freq, cpu_flags; char cpu_info[65]; get_model_name(c); /* Same as AMD/Cyrix */ + display_cacheinfo(c); /* Print CMS and CPU revision */ cpuid(0x80860000, &max, &dummy, &dummy, &dummy); @@ -1309,22 +1338,6 @@ static void __init transmeta_model(struct cpuinfo_x86 *c) wrmsr(0x80860004, ~0, uk); cpuid(0x00000001, &dummy, &dummy, &dummy, &c->x86_capability); wrmsr(0x80860004, cap_mask, uk); - - - /* L1/L2 cache */ - cpuid(0x80000000, &n, &dummy, &dummy, &dummy); - - if (n >= 0x80000005) { - cpuid(0x80000005, &dummy, &dummy, &ecx, &edx); - printk("CPU: L1 I Cache: %dK L1 D Cache: %dK\n", - ecx>>24, edx>>24); - c->x86_cache_size=(ecx>>24)+(edx>>24); - } - if (n >= 0x80000006) { - cpuid(0x80000006, &dummy, &dummy, &ecx, &edx); - printk("CPU: L2 Cache: %dK\n", ecx>>16); - c->x86_cache_size=(ecx>>16); - } } @@ -1407,7 +1420,7 @@ static struct cpu_model_info cpu_models[] __initdata = { * to have CPUID. (Thanks to Herbert Oppmann) */ -static int deep_magic_nexgen_probe(void) +static int __init deep_magic_nexgen_probe(void) { int ret; @@ -1424,9 +1437,9 @@ static int deep_magic_nexgen_probe(void) return ret; } -static void squash_the_stupid_serial_number(struct cpuinfo_x86 *c) +static void __init squash_the_stupid_serial_number(struct cpuinfo_x86 *c) { - if(c->x86_capability&(1<<18)) { + if(c->x86_capability&(X86_FEATURE_PN) && disable_x86_serial_nr) { /* Disable processor serial number */ unsigned long lo,hi; rdmsr(0x119,lo,hi); @@ -1436,10 +1449,20 @@ static void squash_the_stupid_serial_number(struct cpuinfo_x86 *c) } } + +int __init x86_serial_nr_setup(char *s) +{ + disable_x86_serial_nr = 0; + return 1; +} +__setup("serialnumber", x86_serial_nr_setup); + + void __init identify_cpu(struct cpuinfo_x86 *c) { int i=0; char *p = NULL; + extern void mcheck_init(void); c->loops_per_sec = loops_per_sec; c->x86_cache_size = -1; @@ -1476,9 +1499,10 @@ void __init identify_cpu(struct cpuinfo_x86 *c) return; case X86_VENDOR_INTEL: - + squash_the_stupid_serial_number(c); - + mcheck_init(); + if (c->cpuid_level > 1) { /* supports eax=2 call */ int edx, dummy; @@ -1522,6 +1546,13 @@ void __init identify_cpu(struct cpuinfo_x86 *c) } } + /* Pentium IV. */ + if (c->x86 == 15) { + c->x86 = 6; + get_model_name(c); + goto name_decoded; + } + /* Names for the Pentium II/Celeron processors detectable only by also checking the cache size. Dixon is NOT a Celeron. */ @@ -1555,7 +1586,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c) squash_the_stupid_serial_number(c); return; } - + /* may be changed in the switch so needs to be after */ if(c->x86_vendor == X86_VENDOR_NEXGEN) diff --git a/arch/ia64/hp/hpsim_console.c b/arch/ia64/hp/hpsim_console.c index b97116cee888..4f56dc829635 100644 --- a/arch/ia64/hp/hpsim_console.c +++ b/arch/ia64/hp/hpsim_console.c @@ -28,17 +28,13 @@ static int simcons_wait_key (struct console *); static kdev_t simcons_console_device (struct console *); struct console hpsim_cons = { - "simcons", - simcons_write, /* write */ - NULL, /* read */ - simcons_console_device, /* device */ - simcons_wait_key, /* wait_key */ - NULL, /* unblank */ - simcons_init, /* setup */ - CON_PRINTBUFFER, /* flags */ - -1, /* index */ - 0, /* cflag */ - NULL /* next */ + name: "simcons", + write: simcons_write, + device: simcons_console_device, + wait_key: simcons_wait_key, + setup: simcons_init, + flags: CON_PRINTBUFFER, + index: -1, }; static int diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index a34d601eb5a7..759db7f52ce2 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -18,6 +18,7 @@ * Goutham Rao: * Skip non-WB memory and ignore empty memory ranges. */ +#include #include #include #include diff --git a/arch/ia64/kernel/mca_asm.S b/arch/ia64/kernel/mca_asm.S index af746a658955..15993525d356 100644 --- a/arch/ia64/kernel/mca_asm.S +++ b/arch/ia64/kernel/mca_asm.S @@ -6,6 +6,8 @@ // 00/03/29 cfleck Added code to save INIT handoff state in pt_regs format, switch to temp kstack, // switch modes, jump to C INIT handler // +#include + #include #include #include diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 9ae2cdda9bc6..de71a2d22e82 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c @@ -16,6 +16,7 @@ * - as of 2.2.9/2.2.12, the following values are still wrong * PAL_VM_SUMMARY: key & rid sizes */ +#include #include #include #include diff --git a/arch/ia64/kernel/semaphore.c b/arch/ia64/kernel/semaphore.c index 1bbe4feab974..84ff34cf6305 100644 --- a/arch/ia64/kernel/semaphore.c +++ b/arch/ia64/kernel/semaphore.c @@ -7,9 +7,9 @@ /* * Semaphores are implemented using a two-way counter: The "count" - * variable is decremented for each process that tries to aquire the + * variable is decremented for each process that tries to acquire the * semaphore, while the "sleepers" variable is a count of such - * aquires. + * acquires. * * Notably, the inline "up()" and "down()" functions can efficiently * test if they need to do any extra work (up needs to do something @@ -188,7 +188,7 @@ down_read_failed_biased (struct rw_semaphore *sem) } /* - * This gets called if we failed to aquire the lock and we are not + * This gets called if we failed to acquire the lock and we are not * biased to acquire the lock. We undo the decrement that was * done earlier, go to sleep, and then attempt to re-acquire the * lock afterwards. @@ -279,7 +279,7 @@ down_write_failed (struct rw_semaphore *sem) while (sem->count < 0) { set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (sem->count >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 9cc5424712a0..83bff8b0c57d 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c @@ -4,8 +4,6 @@ * Application processor startup code, moved from smp.c to better support kernel profile */ -#include - #include #include #include diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 3eca427f5c4e..d7cc137a9482 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -89,17 +89,10 @@ static void amiga_heartbeat(int on); #endif static struct console amiga_console_driver = { - "debug", - NULL, /* write */ - NULL, /* read */ - NULL, /* device */ - amiga_wait_key, /* wait_key */ - NULL, /* unblank */ - NULL, /* setup */ - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "debug", + wait_key: amiga_wait_key, + flags: CON_PRINTBUFFER, + index: -1, }; #ifdef CONFIG_MAGIC_SYSRQ diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c index e30cb4e55788..2900f7758334 100644 --- a/arch/m68k/atari/debug.c +++ b/arch/m68k/atari/debug.c @@ -31,17 +31,9 @@ int atari_SCC_init_done = 0; int atari_SCC_reset_done = 0; static struct console atari_console_driver = { - "debug", - NULL, /* write */ - NULL, /* read */ - NULL, /* device */ - NULL, /* wait_key */ - NULL, /* unblank */ - NULL, /* setup */ - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "debug", + flags: CON_PRINTBUFFER, + index: -1, }; diff --git a/arch/m68k/kernel/semaphore.c b/arch/m68k/kernel/semaphore.c index b873ee9c70e6..139a75b64f22 100644 --- a/arch/m68k/kernel/semaphore.c +++ b/arch/m68k/kernel/semaphore.c @@ -182,7 +182,7 @@ void down_write_failed(struct rw_semaphore *sem) while (atomic_read(&sem->count) < 0) { set_task_state(current, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (atomic_read(&sem->count) >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c index fa3910b5e227..330d30955dd4 100644 --- a/arch/m68k/mac/debug.c +++ b/arch/m68k/mac/debug.c @@ -159,17 +159,9 @@ int mac_SCC_reset_done = 0; static int scc_port = -1; static struct console mac_console_driver = { - "debug", - NULL, /* write */ - NULL, /* read */ - NULL, /* device */ - NULL, /* wait_key */ - NULL, /* unblank */ - NULL, /* setup */ - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "debug", + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index df0a577629c9..2496aa9ba3fd 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -74,17 +74,10 @@ static unsigned char bin2bcd (unsigned char b); static int q40_wait_key(struct console *co){return 0;} static struct console q40_console_driver = { - "debug", - NULL, /* write */ - NULL, /* read */ - NULL, /* device */ - q40_wait_key, /* wait_key */ - NULL, /* unblank */ - NULL, /* setup */ - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "debug", + wait_key: q40_wait_key, + flags: CON_PRINTBUFFER, + index: -1, }; diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c index 1c2918e5bf79..d4200a341671 100644 --- a/arch/mips/baget/vacserial.c +++ b/arch/mips/baget/vacserial.c @@ -2811,17 +2811,13 @@ static int __init serial_console_setup(struct console *co, char *options) } static struct console sercons = { - "ttyS", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/arch/mips/dec/promcon.c b/arch/mips/dec/promcon.c index de9eaf5b2a31..2c8ba4d7f3af 100644 --- a/arch/mips/dec/promcon.c +++ b/arch/mips/dec/promcon.c @@ -47,17 +47,13 @@ static kdev_t prom_console_device(struct console *c) static struct console sercons = { - "ttyS", - prom_console_write, - NULL, - prom_console_device, - prom_console_wait_key, - NULL, - prom_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: prom_console_write, + device: prom_console_device, + wait_key: prom_console_wait_key, + setup: prom_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/arch/mips/orion/promcon.c b/arch/mips/orion/promcon.c index 29b702f7f151..8609b88ec200 100644 --- a/arch/mips/orion/promcon.c +++ b/arch/mips/orion/promcon.c @@ -68,17 +68,13 @@ static kdev_t prom_console_device(struct console *c) static struct console sercons = { - "ttyS", - prom_console_write, - NULL, - prom_console_device, - prom_console_wait_key, - NULL, - prom_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: prom_console_write, + device: prom_console_device, + wait_key: prom_console_wait_key, + setup: prom_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/arch/mips/sgi/kernel/promcon.c b/arch/mips/sgi/kernel/promcon.c index 391f9613cd5a..a5d8ecdf510c 100644 --- a/arch/mips/sgi/kernel/promcon.c +++ b/arch/mips/sgi/kernel/promcon.c @@ -49,17 +49,13 @@ static kdev_t prom_console_device(struct console *c) static struct console sercons = { - "ttyS", - prom_console_write, - NULL, - prom_console_device, - prom_console_wait_key, - NULL, - prom_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: prom_console_write, + device: prom_console_device, + wait_key: prom_console_wait_key, + setup: prom_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c index 97c4cb880884..f7ce9da03230 100644 --- a/arch/ppc/8260_io/uart.c +++ b/arch/ppc/8260_io/uart.c @@ -2268,17 +2268,13 @@ static kdev_t serial_console_device(struct console *c) static struct console sercons = { - "ttyS", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - CONFIG_SERIAL_CONSOLE_PORT, - 0, - NULL + name: "ttyS", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: CONFIG_SERIAL_CONSOLE_PORT, }; /* diff --git a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c index b9f791832c1f..7c05954c24b7 100644 --- a/arch/ppc/8xx_io/uart.c +++ b/arch/ppc/8xx_io/uart.c @@ -2407,17 +2407,13 @@ static kdev_t serial_console_device(struct console *c) static struct console sercons = { - "ttyS", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - CONFIG_SERIAL_CONSOLE_PORT, - 0, - NULL + name: "ttyS", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: CONFIG_SERIAL_CONSOLE_PORT, }; /* diff --git a/arch/ppc/amiga/config.c b/arch/ppc/amiga/config.c index 652eb1582f3e..83e33e17b78b 100644 --- a/arch/ppc/amiga/config.c +++ b/arch/ppc/amiga/config.c @@ -97,17 +97,10 @@ static void amiga_heartbeat(int on); #endif static struct console amiga_console_driver = { - "debug", - NULL, /* write */ - NULL, /* read */ - NULL, /* device */ - amiga_wait_key, /* wait_key */ - NULL, /* unblank */ - NULL, /* setup */ - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "debug", + wait_key: amiga_wait_key, + flags: CON_PRINTBUFFER, + index: -1, }; #ifdef CONFIG_MAGIC_SYSRQ diff --git a/arch/s390/kernel/semaphore.c b/arch/s390/kernel/semaphore.c index 36869222246c..86aef01853ce 100644 --- a/arch/s390/kernel/semaphore.c +++ b/arch/s390/kernel/semaphore.c @@ -16,8 +16,8 @@ /* * Semaphores are implemented using a two-way counter: * The "count" variable is decremented for each process - * that tries to aquire the semaphore, while the "sleeping" - * variable is a count of such aquires. + * that tries to acquire the semaphore, while the "sleeping" + * variable is a count of such acquires. * * Notably, the inline "up()" and "down()" functions can * efficiently test if they need to do any extra work (up @@ -242,7 +242,7 @@ void down_write_failed(struct rw_semaphore *sem) while (atomic_read(&sem->count) < 0) { set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (atomic_read(&sem->count) >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S index 3b74e2d8e2fa..37d29a6c40ad 100644 --- a/arch/sh/kernel/entry.S +++ b/arch/sh/kernel/entry.S @@ -149,52 +149,55 @@ SYSCALL_NR = (16*4+6*4) .align 2 tlb_miss_load: - mov.l 2f, $r0 - mov.l @$r0, $r6 - mov $r15, $r4 - mov.l 1f, $r0 - jmp @$r0 + bra call_dpf mov #0, $r5 .align 2 tlb_miss_store: - mov.l 2f, $r0 - mov.l @$r0, $r6 - mov $r15, $r4 - mov.l 1f, $r0 - jmp @$r0 + bra call_dpf mov #1, $r5 .align 2 initial_page_write: - mov.l 2f, $r0 - mov.l @$r0, $r6 - mov $r15, $r4 - mov.l 1f, $r0 - jmp @$r0 + bra call_dpf mov #1, $r5 .align 2 tlb_protection_violation_load: - mov.l 2f, $r0 - mov.l @$r0, $r6 - mov $r15, $r4 - mov.l 1f, $r0 - jmp @$r0 + bra call_dpf mov #0, $r5 .align 2 tlb_protection_violation_store: - mov.l 2f, $r0 - mov.l @$r0, $r6 - mov $r15, $r4 + bra call_dpf + mov #1, $r5 + +call_dpf: mov.l 1f, $r0 + mov $r5, $r8 + mov.l @$r0, $r6 + mov $r6, $r9 + mov.l 2f, $r0 + sts $pr, $r10 + jsr @$r0 + mov $r15, $r4 + ! + tst #0xff, $r0 + bf/s 0f + lds $r10, $pr + rts + nop +0: STI() + mov.l 3f, $r0 + mov $r9, $r6 + mov $r8, $r5 jmp @$r0 - mov #1, $r5 + mov $r15, $r4 .align 2 -1: .long SYMBOL_NAME(__do_page_fault) -2: .long MMU_TEA +1: .long MMU_TEA +2: .long SYMBOL_NAME(__do_page_fault) +3: .long SYMBOL_NAME(do_page_fault) #if defined(CONFIG_DEBUG_KERNEL_WITH_GDB_STUB) || defined(CONFIG_SH_STANDARD_BIOS) .align 2 diff --git a/arch/sh/kernel/semaphore.c b/arch/sh/kernel/semaphore.c index f733501c1cc6..990960aa8379 100644 --- a/arch/sh/kernel/semaphore.c +++ b/arch/sh/kernel/semaphore.c @@ -253,7 +253,7 @@ struct rw_semaphore *down_write_failed(struct rw_semaphore *sem) while (atomic_read(&sem->count) < 0) { set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (atomic_read(&sem->count) >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index aaea2e6df23d..66f7460f9c5e 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -166,17 +166,13 @@ static int __init sh_console_setup(struct console *co, char *options) } static struct console sh_console = { - "bios", - sh_console_write, - NULL, - sh_console_device, - sh_console_wait_key, - NULL, - sh_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "bios", + write: sh_console_write, + device: sh_console_device, + wait_key: sh_console_wait_key, + setup: sh_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; void sh_console_init(void) diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 9c06626da9a8..b9c8c991b69a 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -231,8 +231,11 @@ do_sigbus: goto no_context; } -static int __do_page_fault1(struct pt_regs *regs, unsigned long writeaccess, - unsigned long address) +/* + * Called with interrupt disabled. + */ +asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess, + unsigned long address) { pgd_t *dir; pmd_t *pmd; @@ -240,8 +243,6 @@ static int __do_page_fault1(struct pt_regs *regs, unsigned long writeaccess, pte_t entry; if (address >= VMALLOC_START && address < VMALLOC_END) - /* We can change the implementation of P3 area pte entries. - set_pgdir and such. */ dir = pgd_offset_k(address); else dir = pgd_offset(current->mm, address); @@ -275,23 +276,6 @@ static int __do_page_fault1(struct pt_regs *regs, unsigned long writeaccess, return 0; } -/* - * Called with interrupt disabled. - */ -asmlinkage void __do_page_fault(struct pt_regs *regs, unsigned long writeaccess, - unsigned long address) -{ - /* - * XXX: Could you please implement this (calling __do_page_fault1) - * in assembler language in entry.S? - */ - if (__do_page_fault1(regs, writeaccess, address) == 0) - /* Done. */ - return; - sti(); - do_page_fault(regs, writeaccess, address); -} - void update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte) { diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index 2dd1e6ec2aad..d859f3440059 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c @@ -17,6 +17,9 @@ static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned l unsigned long phys_addr, unsigned long flags) { unsigned long end; + pgprot_t pgprot = __pgprot(_PAGE_PRESENT | _PAGE_RW | + _PAGE_DIRTY | _PAGE_ACCESSED | + _PAGE_HW_SHARED | _PAGE_FLAGS_HARD | flags); address &= ~PMD_MASK; end = address + size; @@ -25,8 +28,7 @@ static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned l do { if (!pte_none(*pte)) printk("remap_area_pte: page already exists\n"); - set_pte(pte, mk_pte_phys(phys_addr, __pgprot(_PAGE_PRESENT | _PAGE_RW | - _PAGE_DIRTY | _PAGE_ACCESSED | flags))); + set_pte(pte, mk_pte_phys(phys_addr, pgprot)); address += PAGE_SIZE; phys_addr += PAGE_SIZE; pte++; @@ -55,22 +57,21 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo } static int remap_area_pages(unsigned long address, unsigned long phys_addr, - unsigned long size, unsigned long flags) + unsigned long size, unsigned long flags) { pgd_t * dir; unsigned long end = address + size; phys_addr -= address; - dir = pgd_offset(&init_mm, address); + dir = pgd_offset_k(address); flush_cache_all(); while (address < end) { pmd_t *pmd = pmd_alloc_kernel(dir, address); if (!pmd) return -ENOMEM; if (remap_area_pmd(pmd, address, end - address, - phys_addr + address, flags)) + phys_addr + address, flags)) return -ENOMEM; - set_pgdir(address, *dir); address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++; } diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index ca81aa872194..e0be43e08971 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -1,4 +1,4 @@ -/* $Id: ioport.c,v 1.39 2000/06/20 01:10:00 anton Exp $ +/* $Id: ioport.c,v 1.40 2000/10/10 09:44:46 anton Exp $ * ioport.c: Simple io mapping allocator. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -244,6 +244,7 @@ static void _sparc_free_io(struct resource *res) unsigned long plen; plen = res->end - res->start + 1; + plen = (plen + PAGE_SIZE-1) & PAGE_MASK; while (plen != 0) { plen -= PAGE_SIZE; (*_sparc_unmapioaddr)(res->start + plen); @@ -323,7 +324,7 @@ void sbus_free_consistent(struct sbus_dev *sdev, long n, void *p, u32 ba) return; } - if (((unsigned long)p & (PAGE_MASK-1)) != 0) { + if (((unsigned long)p & (PAGE_SIZE-1)) != 0) { printk("sbus_free_consistent: unaligned va %p\n", p); return; } @@ -496,7 +497,7 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t len, dma_addr_t *pba) if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) { free_pages(va, order); - printk("sbus_alloc_consistent: no core\n"); + printk("pci_alloc_consistent: no core\n"); return NULL; } memset((char*)res, 0, sizeof(struct resource)); @@ -546,18 +547,18 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba) if ((res = _sparc_find_resource(&_sparc_dvma, (unsigned long)p)) == NULL) { - printk("sbus_free_consistent: cannot free %p\n", p); + printk("pci_free_consistent: cannot free %p\n", p); return; } - if (((unsigned long)p & (PAGE_MASK-1)) != 0) { - printk("sbus_free_consistent: unaligned va %p\n", p); + if (((unsigned long)p & (PAGE_SIZE-1)) != 0) { + printk("pci_free_consistent: unaligned va %p\n", p); return; } n = (n + PAGE_SIZE-1) & PAGE_MASK; if ((res->end-res->start)+1 != n) { - printk("sbus_free_consistent: region 0x%lx asked 0x%lx\n", + printk("pci_free_consistent: region 0x%lx asked 0x%lx\n", (long)((res->end-res->start)+1), (long)n); return; } diff --git a/arch/sparc/kernel/semaphore.c b/arch/sparc/kernel/semaphore.c index 1dcf35d4296a..9b45d18bd785 100644 --- a/arch/sparc/kernel/semaphore.c +++ b/arch/sparc/kernel/semaphore.c @@ -218,7 +218,7 @@ void down_write_failed(struct rw_semaphore *sem) while (sem->count < 0) { set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (sem->count >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c index bce4ffcdfd76..2c64c9ba193a 100644 --- a/arch/sparc/kernel/setup.c +++ b/arch/sparc/kernel/setup.c @@ -287,7 +287,9 @@ static void prom_cons_write(struct console *con, const char *str, unsigned count } static struct console prom_console = { - "PROM", prom_cons_write, 0, 0, 0, 0, 0, CON_PRINTBUFFER, 0, 0, 0 + name: "PROM", + write: prom_cons_write, + flags: CON_PRINTBUFFER, }; #endif diff --git a/arch/sparc64/kernel/semaphore.c b/arch/sparc64/kernel/semaphore.c index 0919089ef18d..5eac1939217e 100644 --- a/arch/sparc64/kernel/semaphore.c +++ b/arch/sparc64/kernel/semaphore.c @@ -275,7 +275,7 @@ void down_write_failed(struct rw_semaphore *sem) while (sem->count < 0) { set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (sem->count >= 0) - break; /* we must attempt to aquire or bias the lock */ + break; /* we must attempt to acquire or bias the lock */ schedule(); } diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index 84cc201fd49e..6f0d34c4a13c 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c @@ -75,17 +75,10 @@ prom_console_write(struct console *con, const char *s, unsigned n) } static struct console prom_console = { - "prom", - prom_console_write, - NULL, - NULL, - NULL, - NULL, - NULL, - CON_CONSDEV | CON_ENABLED, - -1, - 0, - NULL + name: "prom", + write: prom_console_write, + flags: CON_CONSDEV | CON_ENABLED, + index: -1, }; #define PROM_TRUE -1 @@ -294,17 +287,10 @@ unsigned long cmdline_memory_size = 0; #ifdef PROM_DEBUG_CONSOLE static struct console prom_debug_console = { - "debug", - prom_console_write, - NULL, - NULL, - NULL, - NULL, - NULL, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "debug", + write: prom_console_write, + flags: CON_PRINTBUFFER, + index: -1, }; #endif diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index db562b8ac1d1..d9d3f8622120 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -328,7 +328,7 @@ static int ll_merge_requests_fn(request_queue_t *q, struct request *req, * on the list. * * This is called with interrupts off and no requests on the queue. - * (and with the request spinlock aquired) + * (and with the request spinlock acquired) */ static void generic_plug_device(request_queue_t *q, kdev_t dev) { @@ -570,7 +570,7 @@ inline void drive_stat_acct (kdev_t dev, int rw, /* * add-request adds a request to the linked list. - * It disables interrupts (aquires the request spinlock) so that it can muck + * It disables interrupts (acquires the request spinlock) so that it can muck * with the request-lists in peace. Thus it should be called with no spinlocks * held. * @@ -624,7 +624,7 @@ void inline blkdev_release_request(struct request *req) } /* - * Has to be called with the request spinlock aquired + * Has to be called with the request spinlock acquired */ static void attempt_merge(request_queue_t * q, struct request *req, diff --git a/drivers/block/paride/Makefile b/drivers/block/paride/Makefile index 9f529353041b..86dbc0a8942c 100644 --- a/drivers/block/paride/Makefile +++ b/drivers/block/paride/Makefile @@ -1,183 +1,34 @@ # -# Makefile for PARIDE +# Makefile for Parallel port IDE device drivers. # -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). +# 7 October 2000, Bartlomiej Zolnierkiewicz +# Rewritten to use lists instead of if-statements. # -# Note 2! The CFLAGS definitions are now inherited from the -# parent makes.. - -SUB_DIRS := -MOD_SUB_DIRS := $(SUB_DIRS) -ALL_SUB_DIRS := $(SUB_DIRS) L_TARGET := paride.a -MX_OBJS := -LX_OBJS := -MI_OBJS := -MIX_OBJS := - -ifeq ($(CONFIG_PARIDE),y) - LX_OBJS += paride.o -else - ifeq ($(CONFIG_PARIDE),m) - MX_OBJS += paride.o - endif -endif - -ifeq ($(CONFIG_PARIDE_PD),y) - LX_OBJS += pd.o -else - ifeq ($(CONFIG_PARIDE_PD),m) - M_OBJS += pd.o - endif -endif - -ifeq ($(CONFIG_PARIDE_PCD),y) - LX_OBJS += pcd.o -else - ifeq ($(CONFIG_PARIDE_PCD),m) - M_OBJS += pcd.o - endif -endif - -ifeq ($(CONFIG_PARIDE_PF),y) - LX_OBJS += pf.o -else - ifeq ($(CONFIG_PARIDE_PF),m) - M_OBJS += pf.o - endif -endif - -ifeq ($(CONFIG_PARIDE_PT),y) - LX_OBJS += pt.o -else - ifeq ($(CONFIG_PARIDE_PT),m) - M_OBJS += pt.o - endif -endif - -ifeq ($(CONFIG_PARIDE_PG),y) - LX_OBJS += pg.o -else - ifeq ($(CONFIG_PARIDE_PG),m) - M_OBJS += pg.o - endif -endif - -ifeq ($(CONFIG_PARIDE_ATEN),y) - LX_OBJS += aten.o -else - ifeq ($(CONFIG_PARIDE_ATEN),m) - M_OBJS += aten.o - endif -endif - -ifeq ($(CONFIG_PARIDE_BPCK),y) - LX_OBJS += bpck.o -else - ifeq ($(CONFIG_PARIDE_BPCK),m) - M_OBJS += bpck.o - endif -endif - -ifeq ($(CONFIG_PARIDE_COMM),y) - LX_OBJS += comm.o -else - ifeq ($(CONFIG_PARIDE_COMM),m) - M_OBJS += comm.o - endif -endif - -ifeq ($(CONFIG_PARIDE_DSTR),y) - LX_OBJS += dstr.o -else - ifeq ($(CONFIG_PARIDE_DSTR),m) - M_OBJS += dstr.o - endif -endif -ifeq ($(CONFIG_PARIDE_KBIC),y) - LX_OBJS += kbic.o -else - ifeq ($(CONFIG_PARIDE_KBIC),m) - M_OBJS += kbic.o - endif -endif - -ifeq ($(CONFIG_PARIDE_EPAT),y) - LX_OBJS += epat.o -else - ifeq ($(CONFIG_PARIDE_EPAT),m) - M_OBJS += epat.o - endif -endif - -ifeq ($(CONFIG_PARIDE_EPIA),y) - LX_OBJS += epia.o -else - ifeq ($(CONFIG_PARIDE_EPIA),m) - M_OBJS += epia.o - endif -endif - -ifeq ($(CONFIG_PARIDE_FIT2),y) - LX_OBJS += fit2.o -else - ifeq ($(CONFIG_PARIDE_FIT2),m) - M_OBJS += fit2.o - endif -endif - -ifeq ($(CONFIG_PARIDE_FIT3),y) - LX_OBJS += fit3.o -else - ifeq ($(CONFIG_PARIDE_FIT3),m) - M_OBJS += fit3.o - endif -endif - -ifeq ($(CONFIG_PARIDE_FRPW),y) - LX_OBJS += frpw.o -else - ifeq ($(CONFIG_PARIDE_FRPW),m) - M_OBJS += frpw.o - endif -endif - - -ifeq ($(CONFIG_PARIDE_FRIQ),y) - LX_OBJS += friq.o -else - ifeq ($(CONFIG_PARIDE_FRIQ),m) - M_OBJS += friq.o - endif -endif - -ifeq ($(CONFIG_PARIDE_ON20),y) - LX_OBJS += on20.o -else - ifeq ($(CONFIG_PARIDE_ON20),m) - M_OBJS += on20.o - endif -endif - -ifeq ($(CONFIG_PARIDE_ON26),y) - LX_OBJS += on26.o -else - ifeq ($(CONFIG_PARIDE_ON26),m) - M_OBJS += on26.o - endif -endif - -ifeq ($(CONFIG_PARIDE_KTTI),y) - LX_OBJS += ktti.o -else - ifeq ($(CONFIG_PARIDE_KTTI),m) - M_OBJS += ktti.o - endif -endif +obj-$(CONFIG_PARIDE) += paride.o +obj-$(CONFIG_PARIDE_PD) += pd.o +obj-$(CONFIG_PARIDE_PCD) += pcd.o +obj-$(CONFIG_PARIDE_PF) += pf.o +obj-$(CONFIG_PARIDE_PT) += pt.o +obj-$(CONFIG_PARIDE_PG) += pg.o +obj-$(CONFIG_PARIDE_ATEN) += aten.o +obj-$(CONFIG_PARIDE_BPCK) += bpck.o +obj-$(CONFIG_PARIDE_COMM) += comm.o +obj-$(CONFIG_PARIDE_DSTR) += dstr.o +obj-$(CONFIG_PARIDE_KBIC) += kbic.o +obj-$(CONFIG_PARIDE_EPAT) += epat.o +obj-$(CONFIG_PARIDE_EPIA) += epia.o +obj-$(CONFIG_PARIDE_FIT2) += fit2.o +obj-$(CONFIG_PARIDE_FIT3) += fit3.o +obj-$(CONFIG_PARIDE_FRPW) += frpw.o +obj-$(CONFIG_PARIDE_FRIQ) += friq.o +obj-$(CONFIG_PARIDE_ON20) += on20.o +obj-$(CONFIG_PARIDE_ON26) += on26.o +obj-$(CONFIG_PARIDE_KTTI) += ktti.o + +L_OBJS := $(obj-y) +M_OBJS := $(obj-m) include $(TOPDIR)/Rules.make - diff --git a/drivers/char/console.c b/drivers/char/console.c index 67654551c29b..8c9a8ba4a892 100644 --- a/drivers/char/console.c +++ b/drivers/char/console.c @@ -2147,17 +2147,13 @@ static kdev_t vt_console_device(struct console *c) } struct console vt_console_driver = { - "tty", - vt_console_print, - NULL, - vt_console_device, - keyboard_wait_for_keypress, - unblank_screen, - NULL, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "tty", + write: vt_console_print, + device: vt_console_device, + wait_key: keyboard_wait_for_keypress, + unblank: unblank_screen, + flags: CON_PRINTBUFFER, + index: -1, }; #endif diff --git a/drivers/char/dz.c b/drivers/char/dz.c index bf4b20e790ef..dd2b50d8cc8b 100644 --- a/drivers/char/dz.c +++ b/drivers/char/dz.c @@ -1553,17 +1553,13 @@ static int __init dz_console_setup(struct console *co, char *options) } static struct console dz_sercons = { - "ttyS", - dz_console_print, - NULL, - dz_console_device, - dz_console_wait_key, - NULL, - dz_console_setup, - CON_CONSDEV | CON_PRINTBUFFER, - CONSOLE_LINE, - 0, - NULL + name: "ttyS", + write: dz_console_print, + device: dz_console_device, + wait_key: dz_console_wait_key, + setup: dz_console_setup, + flags: CON_CONSDEV | CON_PRINTBUFFER, + index: CONSOLE_LINE, }; void __init dz_serial_console_init(void) diff --git a/drivers/char/i810_rng.c b/drivers/char/i810_rng.c index 18e198f51b6e..f3a6f6bdfa51 100644 --- a/drivers/char/i810_rng.c +++ b/drivers/char/i810_rng.c @@ -2,6 +2,7 @@ Hardware driver for Intel i810 Random Number Generator (RNG) Copyright 2000 Jeff Garzik + Copyright 2000 Philipp Rumpf Driver Web site: http://gtf.org/garzik/drivers/i810_rng/ @@ -131,6 +132,9 @@ This will slow things down but guarantee that bad data is never passed upstream. + * FIXME: module unload is racy. To fix this, struct ctl_table + needs an owner member a la struct file_operations. + * Since the RNG is accessed from a timer as well as normal kernel code, but not from interrupts, we use spin_lock_bh in regular code, and spin_lock in the timer function, to @@ -164,6 +168,14 @@ * Convert numeric globals to unsigned * Module unload cleanup + Version 0.9.1: + * Support i815 chipsets too (Matt Sottek) + * Fix reference counting when statically compiled (prumpf) + * Rewrite rng_dev_read (prumpf) + * Make module races less likely (prumpf) + * Small miscellaneous bug fixes (prumpf) + * Use pci table for PCI id list + */ @@ -187,7 +199,7 @@ /* * core module and version information */ -#define RNG_VERSION "0.9.0" +#define RNG_VERSION "0.9.1" #define RNG_MODULE_NAME "i810_rng" #define RNG_DRIVER_NAME RNG_MODULE_NAME " hardware driver " RNG_VERSION #define PFX RNG_MODULE_NAME ": " @@ -217,11 +229,6 @@ #endif -/* - * misc helper macros - */ -#define arraysize(x) (sizeof(x)/sizeof(*(x))) - /* * prototypes */ @@ -363,7 +370,7 @@ static void rng_timer_tick (unsigned long data) /* - * rng_enable - enable or disable the RNG and internal timer + * rng_enable - enable or disable the RNG hardware */ static int rng_enable (int enable) { @@ -377,15 +384,13 @@ static int rng_enable (int enable) hw_status = rng_hwstatus (); if (enable) { - rng_hw_enabled = 1; + rng_hw_enabled++; MOD_INC_USE_COUNT; } else { -#ifndef __alpha__ - if (GET_USE_COUNT (THIS_MODULE) > 0) + if (rng_hw_enabled) { + rng_hw_enabled--; MOD_DEC_USE_COUNT; - if (GET_USE_COUNT (THIS_MODULE) == 0) - rng_hw_enabled = 0; -#endif + } } if (rng_hw_enabled && ((hw_status & RNG_ENABLED) == 0)) { @@ -407,7 +412,8 @@ static int rng_enable (int enable) else if (action == 2) printk (KERN_INFO PFX "RNG h/w disabled\n"); - if ((!!enable) != (!!(new_status & RNG_ENABLED))) { + /* too bad C doesn't have ^^ */ + if ((!enable) != (!(new_status & RNG_ENABLED))) { printk (KERN_ERR PFX "Unable to %sable the RNG\n", enable ? "en" : "dis"); rc = -EIO; @@ -429,6 +435,7 @@ static int rng_handle_sysctl_enable (ctl_table * table, int write, struct file * DPRINTK ("ENTER\n"); + MOD_INC_USE_COUNT; spin_lock_bh (&rng_lock); rng_enabled_sysctl = enabled_save = rng_timer_enabled; spin_unlock_bh (&rng_lock); @@ -456,6 +463,9 @@ static int rng_handle_sysctl_enable (ctl_table * table, int write, struct file * spin_unlock_bh (&rng_lock); } + /* This needs to be in a higher layer */ + MOD_DEC_USE_COUNT; + DPRINTK ("EXIT, returning 0\n"); return 0; } @@ -661,63 +671,44 @@ static int rng_dev_release (struct inode *inode, struct file *filp) } -static ssize_t rng_dev_read (struct file *filp, char * buf, size_t size, - loff_t *offp) +static ssize_t rng_dev_read (struct file *filp, char *buf, size_t size, + loff_t * offp) { - int have_data, copied = 0; - u8 data=0; - u8 *page; - - if (size < 1) - return 0; - - page = (unsigned char *) get_free_page (GFP_KERNEL); - if (!page) - return -ENOMEM; - -read_loop: - /* using the fact that read() can return >0 but - * less than the requested amount, we simply - * read up to PAGE_SIZE or buffer size, whichever - * is smaller, and return that data. - */ - if ((copied == size) || (copied == PAGE_SIZE)) { - size_t tmpsize = (copied == size) ? size : PAGE_SIZE; - int rc = copy_to_user (buf, page, tmpsize); - free_page ((long)page); - if (rc) return rc; - return tmpsize; - } + int have_data; + u8 data = 0; + ssize_t ret = 0; - spin_lock_bh (&rng_lock); + while (size) { + spin_lock_bh (&rng_lock); - have_data = 0; - if (rng_data_present ()) { - data = rng_data_read (); - have_data = 1; - } + have_data = 0; + if (rng_data_present ()) { + data = rng_data_read (); + have_data = 1; + } - spin_unlock_bh (&rng_lock); + spin_unlock_bh (&rng_lock); - if (have_data) { - page[copied] = data; - copied++; - } else { - if (filp->f_flags & O_NONBLOCK) { - free_page ((long)page); - return -EAGAIN; + if (have_data) { + if (put_user (data, buf++)) { + ret = ret ? : -EFAULT; + break; + } + size--; + ret++; } - } - if (current->need_resched) - schedule (); + if (current->need_resched) + schedule (); + + if (signal_pending (current)) + return ret ? : -ERESTARTSYS; - if (signal_pending (current)) { - free_page ((long)page); - return -ERESTARTSYS; + if (filp->f_flags & O_NONBLOCK) + return ret ? : -EAGAIN; } - goto read_loop; + return ret; } @@ -793,8 +784,9 @@ err_out_free_res: * want to register another driver on the same PCI id. */ const static struct pci_device_id rng_pci_tbl[] __initdata = { - { 0x8086, 0x2418, PCI_ANY_ID, PCI_ANY_ID, }, - { 0x8086, 0x2428, PCI_ANY_ID, PCI_ANY_ID, }, + { 0x8086, 0x2418, PCI_ANY_ID, PCI_ANY_ID, }, + { 0x8086, 0x2428, PCI_ANY_ID, PCI_ANY_ID, }, + { 0x8086, 0x1130, PCI_ANY_ID, PCI_ANY_ID, }, { 0, }, }; MODULE_DEVICE_TABLE (pci, rng_pci_tbl); @@ -834,12 +826,15 @@ static int __init rng_init (void) init_MUTEX (&rng_open_sem); init_waitqueue_head (&rng_open_wait); - pdev = pci_find_device (0x8086, 0x2418, NULL); - if (!pdev) - pdev = pci_find_device (0x8086, 0x2428, NULL); - if (!pdev) - return -ENODEV; + pci_for_each_dev(pdev) { + if (pci_match_device (rng_pci_tbl, pdev) != NULL) + goto match; + } + + DPRINTK ("EXIT, returning -ENODEV\n"); + return -ENODEV; +match: rc = rng_init_one (pdev); if (rc) return rc; @@ -894,7 +889,7 @@ module_exit (rng_cleanup); * 4.11.1 (http://csrc.nist.gov/fips/fips1401.htm) * The Monobit, Poker, Runs, and Long Runs tests are implemented below. * This test is run at periodic intervals to verify -* data is sufficently random. If the tests are failed the RNG module +* data is sufficiently random. If the tests are failed the RNG module * will no longer submit data to the entropy pool, but the tests will * continue to run at the given interval. If at a later time the RNG * passes all tests it will be re-enabled for the next period. @@ -905,7 +900,7 @@ module_exit (rng_cleanup); * disable the RNG, we will just leave it disabled for the period of * time until the tests are rerun and passed. * -* For argument sake I tested /proc/urandom with these tests and it +* For argument sake I tested /dev/urandom with these tests and it * took 142,095 tries before I got a failure, and urandom isn't as * random as random :) */ @@ -923,7 +918,7 @@ static void rng_fips_test_store (int rng_data) int j; static int last_bit = 0; - DPRINTK ("ENTER, rng_data = %d\n", rng_data & 0xFF); + DPRINTK ("ENTER, rng_data = %d\n", rng_data); poker[rng_data >> 4]++; poker[rng_data & 15]++; @@ -1010,8 +1005,8 @@ static void rng_run_fips_test (void) rng_trusted = rng_test; /* finally, clear out FIPS variables for start of next run */ - memset (&poker, 0, sizeof (poker)); - memset (&runs, 0, sizeof (runs)); + memset (poker, 0, sizeof (poker)); + memset (runs, 0, sizeof (runs)); ones = 0; rlength = -1; current_bit = 0; @@ -1019,4 +1014,3 @@ static void rng_run_fips_test (void) DPRINTK ("EXIT\n"); } - diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 2e9e170c4687..97f99de1cdc9 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -603,17 +603,10 @@ static kdev_t lp_console_device (struct console *c) } static struct console lpcons = { - "lp", - lp_console_write, - NULL, - lp_console_device, - NULL, - NULL, - NULL, - CON_PRINTBUFFER, - 0, - 0, - NULL + name: "lp", + write: lp_console_write, + device: lp_console_device, + flags: CON_PRINTBUFFER, }; #endif /* console on line printer */ diff --git a/drivers/char/serial.c b/drivers/char/serial.c index b5492def344d..7ee9b0211741 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -5666,17 +5666,13 @@ static int __init serial_console_setup(struct console *co, char *options) } static struct console sercons = { - "ttyS", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 35b480a1ce71..3496229c6d7a 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -2858,17 +2858,13 @@ static int __init serial167_console_setup(struct console *co, char *options) static struct console sercons = { - "ttyS", - serial167_console_write, - NULL, - serial167_console_device, - serial167_console_wait_key, - NULL, - serial167_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: serial167_console_write, + device: serial167_console_device, + wait_key: serial167_console_wait_key, + setup: serial167_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; diff --git a/drivers/char/serial_21285.c b/drivers/char/serial_21285.c index 575cf0bc0759..16ad022bd7a4 100644 --- a/drivers/char/serial_21285.c +++ b/drivers/char/serial_21285.c @@ -490,17 +490,13 @@ static int __init rs285_console_setup(struct console *co, char *options) static struct console rs285_cons = { - SERIAL_21285_NAME, - rs285_console_write, - NULL, - rs285_console_device, - rs285_console_wait_key, - NULL, - rs285_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: SERIAL_21285_NAME, + write: rs285_console_write, + device: rs285_console_device, + wait_key: rs285_console_wait_key, + setup: rs285_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; void __init rs285_console_init(void) diff --git a/drivers/char/serial_amba.c b/drivers/char/serial_amba.c index 580427f6b1f6..eaab7d34e626 100644 --- a/drivers/char/serial_amba.c +++ b/drivers/char/serial_amba.c @@ -2016,7 +2016,6 @@ static struct console ambauart_cons = #endif device: ambauart_console_device, wait_key: ambauart_console_wait_key, - unblank: NULL, setup: ambauart_console_setup, flags: CON_PRINTBUFFER, index: -1, diff --git a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c index 8f0178d9b71e..01812ecb0096 100644 --- a/drivers/char/sh-sci.c +++ b/drivers/char/sh-sci.c @@ -1247,17 +1247,13 @@ static int __init serial_console_setup(struct console *co, char *options) } static struct console sercons = { - "ttySC", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttySC", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index b6b2263a0f3a..ecf7cf05ec12 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c @@ -1111,17 +1111,13 @@ static int __init scc_console_setup(struct console *co, char *options) static struct console sercons = { - "ttyS", - scc_console_write, - NULL, - scc_console_device, - scc_console_wait_key, - NULL, - scc_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: scc_console_write, + device: scc_console_device, + wait_key: scc_console_wait_key, + setup: scc_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; diff --git a/drivers/isdn/avmb1/capifs.c b/drivers/isdn/avmb1/capifs.c index 64ef8436c11c..d4956c45bb9e 100644 --- a/drivers/isdn/avmb1/capifs.c +++ b/drivers/isdn/avmb1/capifs.c @@ -1,11 +1,14 @@ /* - * $Id: capifs.c,v 1.9 2000/08/20 07:30:13 keil Exp $ + * $Id: capifs.c,v 1.10 2000/10/12 10:12:35 calle Exp $ * * (c) Copyright 2000 by Carsten Paeth (calle@calle.de) * * Heavily based on devpts filesystem from H. Peter Anvin * * $Log: capifs.c,v $ + * Revision 1.10 2000/10/12 10:12:35 calle + * Bugfix: second iput(inode) on umount, destroies a foreign inode. + * * Revision 1.9 2000/08/20 07:30:13 keil * changes for 2.4 * @@ -69,7 +72,7 @@ MODULE_AUTHOR("Carsten Paeth "); -static char *revision = "$Revision: 1.9 $"; +static char *revision = "$Revision: 1.10 $"; struct capifs_ncci { struct inode *inode; @@ -552,6 +555,7 @@ void capifs_free_ncci(char type, unsigned int num) continue; if (np->inode) { inode = np->inode; + np->inode = 0; np->used = 0; inode->i_nlink--; iput(inode); diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c index 54849eab1900..471ec549ec9c 100644 --- a/drivers/isdn/hysdn/boardergo.c +++ b/drivers/isdn/hysdn/boardergo.c @@ -459,7 +459,7 @@ ergo_inithardware(hysdn_card * card) request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN"); ergo_stopcard(card); /* disable interrupts */ if (request_irq(card->irq, ergo_interrupt, SA_SHIRQ, "HYSDN", card)) { - ergo_releasehardware(card); /* return the aquired hardware */ + ergo_releasehardware(card); /* return the acquired hardware */ return (-1); } /* success, now setup the function pointers */ diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index e455c074e6f6..e379ae44255d 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -302,7 +302,7 @@ int init_sc(void) /* * No interrupt could be used */ - pr_debug("Failed to aquire an IRQ line\n"); + pr_debug("Failed to acquire an IRQ line\n"); continue; } diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c index 55cf255b9e5b..6ed94158d4e1 100644 --- a/drivers/macintosh/macserial.c +++ b/drivers/macintosh/macserial.c @@ -2890,17 +2890,13 @@ static int __init serial_console_setup(struct console *co, char *options) } static struct console sercons = { - "ttyS", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/drivers/net/hamradio/Makefile b/drivers/net/hamradio/Makefile index 7ca3c1efdb6b..3c5e330b52f2 100644 --- a/drivers/net/hamradio/Makefile +++ b/drivers/net/hamradio/Makefile @@ -4,7 +4,7 @@ # # 19971130 Moved the amateur radio related network drivers from # drivers/net/ to drivers/hamradio for easier maintainance. -# Joerg Reuter DL1BKE +# Joerg Reuter DL1BKE # # 20000806 Rewritten to use lists instead of if-statements. # Christoph Hellwig diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 6319f983de17..5f765d5bf9ef 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c @@ -652,7 +652,7 @@ static void __exit bpq_cleanup_driver(void) unregister_netdev(&bpq->axdev); } -MODULE_AUTHOR("Joerg Reuter DL1BKE "); +MODULE_AUTHOR("Joerg Reuter DL1BKE "); MODULE_DESCRIPTION("Transmit and receive AX.25 packets over Ethernet"); module_init(bpq_init_driver); module_exit(bpq_cleanup_driver); diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index 99d8c65aa5df..2ea55b0f1dbf 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c @@ -130,9 +130,9 @@ vy 73, Joerg Reuter ampr-net: dl1bke@db0pra.ampr.org - AX-25 : DL1BKE @ DB0ACH.#NRW.DEU.EU - Internet: jreuter@poboxes.com - www : http://poboxes.com/jreuter/ + AX-25 : DL1BKE @ DB0ABH.#BAY.DEU.EU + Internet: jreuter@yaina.de + www : http://yaina.de/jreuter */ /* ----------------------------------------------------------------------- */ @@ -2226,8 +2226,8 @@ static void __exit scc_cleanup_driver(void) scc_net_procfs_remove(); } -MODULE_AUTHOR("Joerg Reuter "); +MODULE_AUTHOR("Joerg Reuter "); MODULE_DESCRIPTION("AX.25 Device Driver for Z8530 based HDLC cards"); -MODULE_SUPPORTED_DEVICE("scc"); +MODULE_SUPPORTED_DEVICE("Z8530 based SCC cards for Amateur Radio"); module_init(scc_init_driver); module_exit(scc_cleanup_driver); diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 44276a3d9048..9be388cf8208 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -683,11 +683,11 @@ pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared, int car if (fdx && !(lp->options & PORT_ASEL) && full_duplex[card_idx]) lp->options |= PORT_FD; - lp->a = *a; if (a == NULL) { printk(KERN_ERR "pcnet32: No access methods\n"); return -ENODEV; } + lp->a = *a; /* detect special T1/E1 WAN card by checking for MAC address */ if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 && dev->dev_addr[2] == 0x75) diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 0b945d36fa3f..5ef2a4a1ee38 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c @@ -1110,7 +1110,7 @@ struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev) * dev - pointer to device information * * Functional Description: - * This function aquires the driver lock and only calls + * This function acquires the driver lock and only calls * skfp_ctl_set_multicast_list_wo_lock then. * This routine follows a fairly simple algorithm for setting the * adapter filters and CAM: diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index bfbb8273adca..33e98c23e776 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c @@ -134,6 +134,8 @@ * - Incresed tx_timeout beacuse of auto-neg. * - Adjusted timers for forced speeds. * + * v1.12 Oct 12, 2000 - Minor fixes (memleak, init, etc.) + * *******************************************************************************/ @@ -153,14 +155,14 @@ typedef u32 (TLanIntVectorFunc)( struct net_device *, u16 ); /* For removing EISA devices */ -static struct net_device *TLan_Eisa_Devices = NULL; +static struct net_device *TLan_Eisa_Devices; -static int TLanDevicesInstalled = 0; +static int TLanDevicesInstalled; /* Force speed, duplex and aui settings */ -static int aui = 0; -static int duplex = 0; -static int speed = 0; +static int aui; +static int duplex; +static int speed; MODULE_AUTHOR("Maintainer: Torben Mathiasen "); MODULE_DESCRIPTION("Driver for TI ThunderLAN based ethernet PCI adapters"); @@ -174,14 +176,14 @@ EXPORT_NO_SYMBOLS; #undef MONITOR /* Turn on debugging. See linux/Documentation/networking/tlan.txt for details */ -static int debug = 0; +static int debug; -static int bbuf = 0; +static int bbuf; static u8 *TLanPadBuffer; static char TLanSignature[] = "TLAN"; -static const char *tlan_banner = "ThunderLAN driver v1.11\n"; -static int tlan_have_pci = 0; -static int tlan_have_eisa = 0; +static const char *tlan_banner = "ThunderLAN driver v1.12\n"; +static int tlan_have_pci; +static int tlan_have_eisa; const char *media[] = { "10BaseT-HD ", "10BaseT-FD ","100baseTx-HD ", @@ -244,7 +246,7 @@ static struct pci_device_id tlan_pci_tbl[] __devinitdata = { }; MODULE_DEVICE_TABLE(pci, tlan_pci_tbl); -static int TLan_EisaProbe( void ); +static void TLan_EisaProbe( void ); static void TLan_Eisa_Cleanup( void ); static int TLan_Init( struct net_device * ); static int TLan_Open( struct net_device *dev ); @@ -371,7 +373,7 @@ TLan_SetTimer( struct net_device *dev, u32 ticks, u32 type ) **************************************************************/ -static void __exit tlan_remove_one( struct pci_dev *pdev) +static void __devexit tlan_remove_one( struct pci_dev *pdev) { struct net_device *dev = pdev->driver_data; TLanPrivateInfo *priv = (TLanPrivateInfo *) dev->priv; @@ -397,7 +399,6 @@ static struct pci_driver tlan_driver = { static int __init tlan_probe(void) { - int rc; static int pad_allocated = 0; printk(KERN_INFO "%s", tlan_banner); @@ -417,10 +418,10 @@ static int __init tlan_probe(void) /* Use new style PCI probing. Now the kernel will do most of this for us */ - rc = pci_module_init(&tlan_driver); + pci_module_init(&tlan_driver); TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n"); - rc = TLan_EisaProbe(); + TLan_EisaProbe(); printk(KERN_INFO "TLAN: %d device%s installed, PCI: %d EISA: %d\n", TLanDevicesInstalled, TLanDevicesInstalled == 1 ? "" : "s", @@ -459,7 +460,7 @@ static int __devinit tlan_init_one( struct pci_dev *pdev, * **************************************************************/ -static int __init TLan_probe1(struct pci_dev *pdev, +static int __devinit TLan_probe1(struct pci_dev *pdev, long ioaddr, int irq, int rev, const struct pci_device_id *ent ) { @@ -475,8 +476,6 @@ static int __init TLan_probe1(struct pci_dev *pdev, } priv = dev->priv; - memset(priv, 0, sizeof(TLanPrivateInfo)); - dev->base_addr = ioaddr; dev->irq = irq; @@ -485,8 +484,11 @@ static int __init TLan_probe1(struct pci_dev *pdev, /* Is this a PCI device? */ if (pdev) { priv->adapter = &board_info[ent->driver_data]; - if (pci_enable_device(pdev)) + if (pci_enable_device(pdev)) { + unregister_netdev(dev); + kfree(dev); return -1; + } pci_read_config_byte ( pdev, PCI_REVISION_ID, &pci_rev); priv->adapterRev = pci_rev; pci_set_master(pdev); @@ -618,7 +620,7 @@ module_exit(tlan_exit); * *************************************************************/ -static int __init TLan_EisaProbe (void) +static void __init TLan_EisaProbe (void) { long ioaddr; int rc = -ENODEV; @@ -627,7 +629,7 @@ static int __init TLan_EisaProbe (void) if (!EISA_bus) { TLAN_DBG(TLAN_DEBUG_PROBE, "No EISA bus present\n"); - return 0; + return; } /* Loop through all slots of the EISA bus */ @@ -697,8 +699,6 @@ static int __init TLan_EisaProbe (void) } - return rc; - } /* TLan_EisaProbe */ @@ -822,7 +822,7 @@ static int TLan_Open( struct net_device *dev ) if ( err ) { printk(KERN_ERR "TLAN: Cannot open %s because IRQ %d is already in use.\n", dev->name, dev->irq ); MOD_DEC_USE_COUNT; - return -EAGAIN; + return err; } init_timer(&priv->timer); @@ -899,7 +899,6 @@ static int TLan_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static void TLan_tx_timeout(struct net_device *dev) { - //TLanPrivateInfo *priv = (TLanPrivateInfo *) dev->priv; TLAN_DBG( TLAN_DEBUG_GNRL, "%s: Transmit timed out.\n", dev->name); @@ -908,7 +907,7 @@ static void TLan_tx_timeout(struct net_device *dev) TLan_ReadAndClearStats( dev, TLAN_IGNORE ); TLan_ResetAdapter( dev ); dev->trans_start = jiffies; - netif_start_queue( dev ); + netif_wake_queue( dev ); } @@ -2640,9 +2639,8 @@ void TLan_PhyFinishAutoNeg( struct net_device *dev ) * * ******************************************************************/ -void TLan_PhyMonitor( struct net_device *data ) +void TLan_PhyMonitor( struct net_device *dev ) { - struct net_device *dev = (struct net_device *)data; TLanPrivateInfo *priv = (TLanPrivateInfo *) dev->priv; u16 phy; u16 phy_status; diff --git a/drivers/net/wavelan.c b/drivers/net/wavelan.c index 30ab655af254..5c43c9a3abbd 100644 --- a/drivers/net/wavelan.c +++ b/drivers/net/wavelan.c @@ -3680,8 +3680,8 @@ static void wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs) #endif /* Prevent reentrancy. We need to do that because we may have - * multiple interrupt handler running concurently. - * It is safe because wv_splhi() disable interrupts before aquiring + * multiple interrupt handler running concurrently. + * It is safe because wv_splhi() disables interrupts before acquiring * the spinlock. */ spin_lock(&lp->spinlock); diff --git a/drivers/parport/Makefile b/drivers/parport/Makefile index 68d5120e2955..95a778e96aec 100644 --- a/drivers/parport/Makefile +++ b/drivers/parport/Makefile @@ -1,101 +1,51 @@ # -# Makefile for the kernel miscellaneous drivers. +# Makefile for the kernel Parallel port device drivers. # -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). +# Note! Parport is the Borg. We have assimilated some other +# drivers in the `char', `net' and `scsi' directories, +# but left them there to allay suspicion. # -# Note 2! The CFLAGS definitions are now inherited from the -# parent makes.. +# 7 October 2000, Bartlomiej Zolnierkiewicz +# Rewritten to use lists instead of if-statements. # -# Note 3! Parport is the Borg. We have assimilated some other -# drivers in the `char', `net' and `scsi' directories, but left them -# there to allay suspicion. - -SUB_DIRS := -MOD_SUB_DIRS := $(SUB_DIRS) -ALL_SUB_DIRS := $(SUB_DIRS) L_TARGET := parport.a -MX_OBJS := -LX_OBJS := -MI_OBJS := -MIX_OBJS := -ifeq ($(CONFIG_PARPORT),y) - L_OBJS += share.o ieee1284.o ieee1284_ops.o procfs.o +export-objs := init.o parport_pc.o - ifeq ($(CONFIG_PARPORT_1284),y) - L_OBJS += daisy.o probe.o - endif +list-multi := parport.o +parport-objs := share.o ieee1284.o ieee1284_ops.o init.o procfs.o - ifeq ($(CONFIG_PARPORT_PC),y) - LX_OBJS += parport_pc.o - else - ifeq ($(CONFIG_PARPORT_PC),m) - MX_OBJS += parport_pc.o - endif - endif - ifeq ($(CONFIG_PARPORT_AMIGA),y) - LX_OBJS += parport_amiga.o - else - ifeq ($(CONFIG_PARPORT_AMIGA),m) - M_OBJS += parport_amiga.o - endif - endif - ifeq ($(CONFIG_PARPORT_MFC3),y) - LX_OBJS += parport_mfc3.o - else - ifeq ($(CONFIG_PARPORT_MFC3),m) - M_OBJS += parport_mfc3.o - endif - endif - ifeq ($(CONFIG_PARPORT_ATARI),y) - LX_OBJS += parport_atari.o - else - ifeq ($(CONFIG_PARPORT_ATARI),m) - M_OBJS += parport_atari.o - endif - endif - ifeq ($(CONFIG_PARPORT_SUNBPP),y) - LX_OBJS += parport_sunbpp.o - else - ifeq ($(CONFIG_PARPORT_SUNBPP),m) - MX_OBJS += parport_sunbpp.o - endif - endif - LX_OBJS += init.o -else - ifeq ($(CONFIG_PARPORT),m) - MI_OBJS += share.o ieee1284.o ieee1284_ops.o - ifeq ($(CONFIG_PARPORT_1284),y) - MI_OBJS += daisy.o probe.o - endif - ifneq ($(CONFIG_PROC_FS),n) - MI_OBJS += procfs.o - endif - MIX_OBJS += init.o - M_OBJS += parport.o - endif - ifeq ($(CONFIG_PARPORT_PC),m) - MX_OBJS += parport_pc.o - endif - ifeq ($(CONFIG_PARPORT_AMIGA),m) - M_OBJS += parport_amiga.o - endif - ifeq ($(CONFIG_PARPORT_MFC3),m) - M_OBJS += parport_mfc3.o - endif - ifeq ($(CONFIG_PARPORT_ATARI),m) - M_OBJS += parport_atari.o - endif - ifeq ($(CONFIG_PARPORT_SUNBPP),m) - M_OBJS += parport_sunbpp.o - endif +ifeq ($(CONFIG_PARPORT_1284),y) + parport-objs += daisy.o probe.o endif +obj-$(CONFIG_PARPORT) += parport.o +obj-$(CONFIG_PARPORT_PC) += parport_pc.o +obj-$(CONFIG_PARPORT_AMIGA) += parport_amiga.o +obj-$(CONFIG_PARPORT_MFC3) += parport_mfc3.o +obj-$(CONFIG_PARPORT_ATARI) += parport_atari.o +obj-$(CONFIG_PARPORT_SUNBPP) += parport_sunbpp.o + +# Extract lists of the multi-part drivers. +# The 'int-*' lists are the intermediate files used to build the multi's. +multi-y := $(filter $(list-multi), $(obj-y)) +multi-m := $(filter $(list-multi), $(obj-m)) +int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) +int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) + +# Take multi-part drivers out of obj-y and put components in. +obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) + +# Translate to Rules.make lists. +L_OBJS := $(filter-out $(export-objs), $(obj-y)) +LX_OBJS := $(filter $(export-objs), $(obj-y)) +M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) +MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) +MI_OBJS := $(sort $(filter-out $(export-objs), $(int-m))) +MIX_OBJS := $(sort $(filter $(export-objs), $(int-m))) + include $(TOPDIR)/Rules.make -# Special rule to build the composite parport.o module -parport.o: $(MI_OBJS) $(MIX_OBJS) - $(LD) $(LD_RFLAG) -r -o $@ $(MI_OBJS) $(MIX_OBJS) +parport.o: $(parport-objs) + $(LD) -r -o $@ $(parport-objs) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f5a2c55406e9..41478ea51644 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -477,7 +477,7 @@ static inline unsigned int pci_calc_resource_flags(unsigned int flags) /* * Find the extent of a PCI decode.. */ -static u32 pci_size(u32 base, u32 mask) +static u32 pci_size(u32 base, unsigned long mask) { u32 size = mask & base; /* Find the significant bits */ size = size & ~(size-1); /* Get the lowest of them to find the decode size */ diff --git a/drivers/pcmcia/yenta.c b/drivers/pcmcia/yenta.c index 4569e0dd8f0b..59e1dbdc6a5b 100644 --- a/drivers/pcmcia/yenta.c +++ b/drivers/pcmcia/yenta.c @@ -626,7 +626,7 @@ static void yenta_config_init(pci_socket_t *socket) PCI_COMMAND_WAIT); /* MAGIC NUMBERS! Fixme */ - config_writeb(socket, PCI_CACHE_LINE_SIZE, 32); + config_writeb(socket, PCI_CACHE_LINE_SIZE, L1_CACHE_BYTES / 4); config_writeb(socket, PCI_LATENCY_TIMER, 168); config_writeb(socket, PCI_SEC_LATENCY_TIMER, 176); config_writeb(socket, PCI_PRIMARY_BUS, dev->bus->number); diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index aec5d83af3b3..624d7dfd7f04 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -795,17 +795,12 @@ static int __init con3215_consetup(struct console *co, char *options) * The console structure for the 3215 console */ static struct console con3215 = { - "tty3215", - con3215_write, - NULL, - con3215_device, - NULL, - con3215_unblank, - con3215_consetup, - CON_PRINTBUFFER, - 0, - 0, - NULL + name: "tty3215", + write: con3215_write, + device: con3215_device, + unblank: con3215_unblank, + setup: con3215_consetup, + flags: CON_PRINTBUFFER, }; #endif diff --git a/drivers/s390/char/hwc_con.c b/drivers/s390/char/hwc_con.c index 16d5553e8e54..238dd21505b1 100644 --- a/drivers/s390/char/hwc_con.c +++ b/drivers/s390/char/hwc_con.c @@ -35,17 +35,10 @@ kdev_t hwc_console_device (struct console *); struct console hwc_console = { - hwc_console_name, - hwc_console_write, - NULL, - hwc_console_device, - NULL, - NULL, - NULL, - CON_PRINTBUFFER, - 0, - 0, - NULL + name: hwc_console_name, + write: hwc_console_write, + device: hwc_console_device, + flags: CON_PRINTBUFFER, }; void diff --git a/drivers/sbus/audio/Makefile b/drivers/sbus/audio/Makefile index cf38aa1d837a..eaac51698880 100644 --- a/drivers/sbus/audio/Makefile +++ b/drivers/sbus/audio/Makefile @@ -1,76 +1,23 @@ # -# Makefile for the linux kernel. +# Makefile for the kernel SPARC audio drivers. # -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# -# Note 2! The CFLAGS definitions are now in the main makefile... - -# -# sbus audio drivers +# 7 October 2000, Bartlomiej Zolnierkiewicz +# Rewritten to use lists instead of if-statements. # O_TARGET := sparcaudio.o -O_OBJS := -M_OBJS := -M := -MM := - -ifeq ($(CONFIG_SPARCAUDIO),y) -M=y -else - ifeq ($(CONFIG_SPARCAUDIO),m) - MM=y - endif -endif - -ifeq ($(CONFIG_SPARCAUDIO_AMD7930),y) -M=y -OX_OBJS += amd7930.o -else - ifeq ($(CONFIG_SPARCAUDIO_AMD7930),m) - MM=y - MX_OBJS += amd7930.o - endif -endif - -ifeq ($(CONFIG_SPARCAUDIO_CS4231),y) -M=y -O_OBJS += cs4231.o -else - ifeq ($(CONFIG_SPARCAUDIO_CS4231),m) - MM=y - M_OBJS += cs4231.o - endif -endif -ifeq ($(CONFIG_SPARCAUDIO_DBRI),y) -M=y -OX_OBJS += dbri.o -else - ifeq ($(CONFIG_SPARCAUDIO_DBRI),m) - MM=y - MX_OBJS += dbri.o - endif -endif +export-objs := audio.o amd7930.o dbri.o -ifeq ($(CONFIG_SPARCAUDIO_DUMMY),y) -M=y -O_OBJS += dmy.o -else - ifeq ($(CONFIG_SPARCAUDIO_DUMMY),m) - MM=y - M_OBJS += dmy.o - endif -endif +obj-$(CONFIG_SPARCAUDIO) += audio.o +obj-$(CONFIG_SPARCAUDIO_AMD7930) += amd7930.o +obj-$(CONFIG_SPARCAUDIO_CS4231) += cs4231.o +obj-$(CONFIG_SPARCAUDIO_DBRI) += dbri.o +obj-$(CONFIG_SPARCAUDIO_DUMMY) += dmy.o -ifdef M -OX_OBJS += audio.o -else - ifdef MM - MX_OBJS += audio.o - endif -endif +O_OBJS := $(filter-out $(export-objs), $(obj-y)) +OX_OBJS := $(filter $(export-objs), $(obj-y)) +M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) +MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) include $(TOPDIR)/Rules.make diff --git a/drivers/sbus/audio/dbri.h b/drivers/sbus/audio/dbri.h index 1cbe77241914..c7f8be99c949 100644 --- a/drivers/sbus/audio/dbri.h +++ b/drivers/sbus/audio/dbri.h @@ -1,4 +1,4 @@ -/* $Id: dbri.h,v 1.12 1999/09/21 14:37:34 davem Exp $ +/* $Id: dbri.h,v 1.13 2000/10/13 00:34:24 uzi Exp $ * drivers/sbus/audio/cs4231.h * * Copyright (C) 1997 Rudolf Koenig (rfkoenig@immd4.informatik.uni-erlangen.de) @@ -18,7 +18,12 @@ #define REG9 0x24UL /* Interrupt Queue Pointer */ #define DBRI_NO_CMDS 64 -#define DBRI_NO_INTS 2 +#define DBRI_NO_INTS 1 /* Note: the value of this define was + * originally 2. The ringbuffer to store + * interrupts in dma is currently broken. + * This is a temporary fix until the ringbuffer + * is fixed. + */ #define DBRI_INT_BLK 64 #define DBRI_NO_DESCS 64 diff --git a/drivers/sbus/char/Makefile b/drivers/sbus/char/Makefile index 7c5a21b2cacd..1679cb6d4d73 100644 --- a/drivers/sbus/char/Makefile +++ b/drivers/sbus/char/Makefile @@ -1,128 +1,47 @@ # -# Makefile for the linux kernel. +# Makefile for the kernel miscellaneous SPARC device drivers. # -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# -# Note 2! The CFLAGS definitions are now in the main makefile... - # Dave Redman Frame Buffer tuning support. -# OK this is kind of ugly but it does allow drivers to be added fairly -# easily. and you can even choose what sort of support you want. +# +# 7 October 2000, Bartlomiej Zolnierkiewicz +# Rewritten to use lists instead of if-statements. +# O_TARGET := sunchar.o O_OBJS := ${O_OBJ} sunkbd.o sunkbdmap.o sunmouse.o sunserial.o zs.o -M_OBJS := -ifeq ($(ARCH),sparc64) +vfc-objs := vfc_dev.o vfc_i2c.o ifeq ($(CONFIG_PCI),y) - -OX_OBJS += su.o -O_OBJS += pcikbd.o - -ifeq ($(CONFIG_SAB82532),y) -O_OBJS += sab82532.o -else - ifeq ($(CONFIG_SAB82532),m) - M_OBJS += sab82532.o - endif -endif - -ifeq ($(CONFIG_ENVCTRL),y) -O_OBJS += envctrl.o -else - ifeq ($(CONFIG_ENVCTRL),m) - M_OBJS += envctrl.o - endif -endif - -ifeq ($(CONFIG_DISPLAY7SEG),y) -O_OBJS += display7seg.o -else - ifeq ($(CONFIG_DISPLAY7SEG),m) - M_OBJS += display7seg.o - endif -endif - -endif # eq($(CONFIG_PCI,y) - -ifeq ($(CONFIG_OBP_FLASH),y) -O_OBJS += flash.o -else - ifeq ($(CONFIG_OBP_FLASH),m) - M_OBJS += flash.o - endif +OX_OBJS += su.o +O_OBJS += pcikbd.o endif -else # !eq($(ARCH),sparc64) +ifeq ($(ARCH),sparc64) ifeq ($(CONFIG_PCI),y) -OX_OBJS += su.o -O_OBJS += pcikbd.o -endif - -endif # !eq($(ARCH),sparc64) - -ifeq ($(CONFIG_SUN_OPENPROMIO),y) -O_OBJS += openprom.o -else - ifeq ($(CONFIG_SUN_OPENPROMIO),m) - M_OBJS += openprom.o - endif +obj-$(CONFIG_SAB82532) += sab82532.o +obj-$(CONFIG_ENVCTRL) += envctrl.o +obj-$(CONFIG_DISPLAY7SEG) += display7seg.o endif -ifeq ($(CONFIG_SUN_MOSTEK_RTC),y) -O_OBJS += rtc.o -else - ifeq ($(CONFIG_SUN_MOSTEK_RTC),m) - M_OBJS += rtc.o - endif +obj-$(CONFIG_OBP_FLASH) += flash.o endif -ifeq ($(CONFIG_SUN_BPP),y) -O_OBJS += bpp.o -else - ifeq ($(CONFIG_SUN_BPP),m) - M_OBJS += bpp.o - endif -endif - -ifeq ($(CONFIG_SUN_VIDEOPIX),y) -O_OBJS += vfc.o -else - ifeq ($(CONFIG_SUN_VIDEOPIX),m) - M_OBJS += vfc.o - endif -endif +obj-$(CONFIG_SUN_OPENPROMIO) += openprom.o +obj-$(CONFIG_SUN_MOSTEK_RTC) += rtc.o +obj-$(CONFIG_SUN_BPP) += bpp.o +obj-$(CONFIG_SUN_VIDEOPIX) += vfc.o +obj-$(CONFIG_SUN_AURORA) += aurora.o +obj-$(CONFIG_TADPOLE_TS102_UCTRL) += uctrl.o +obj-$(CONFIG_SUN_JSFLASH) += jsflash.o -ifeq ($(CONFIG_SUN_AURORA),y) -O_OBJS += aurora.o -else - ifeq ($(CONFIG_SUN_AURORA),m) - M_OBJS += aurora.o - endif -endif - -ifeq ($(CONFIG_TADPOLE_TS102_UCTRL),y) -O_OBJS += uctrl.o -else - ifeq ($(CONFIG_TADPOLE_TS102_UCTRL),m) - M_OBJS += uctrl.o - endif -endif - -ifeq ($(CONFIG_SUN_JSFLASH),y) -O_OBJS += jsflash.o -endif -ifeq ($(CONFIG_SUN_JSFLASH),m) -M_OBJS += jsflash.o -endif +O_OBJS := $(obj-y) +M_OBJS := $(obj-m) include $(TOPDIR)/Rules.make sunkbdmap.o: sunkeymap.c -vfc.o: vfc_dev.o vfc_i2c.o - $(LD) -r -o vfc.o vfc_dev.o vfc_i2c.o +vfc.o: $(vfc-objs) + $(LD) -r -o $@ $(vfc-objs) diff --git a/drivers/sbus/char/sab82532.c b/drivers/sbus/char/sab82532.c index 7d010f035972..be1071c784ae 100644 --- a/drivers/sbus/char/sab82532.c +++ b/drivers/sbus/char/sab82532.c @@ -2596,17 +2596,13 @@ sab82532_console_setup(struct console *con, char *options) } static struct console sab82532_console = { - "ttyS", - sab82532_console_write, - NULL, - sab82532_console_device, - sab82532_console_wait_key, - NULL, - sab82532_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: sab82532_console_write, + device: sab82532_console_device, + wait_key: sab82532_console_wait_key, + setup: sab82532_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; int __init sab82532_console_init(void) diff --git a/drivers/sbus/char/su.c b/drivers/sbus/char/su.c index c6e90328ece1..416bfd58aa11 100644 --- a/drivers/sbus/char/su.c +++ b/drivers/sbus/char/su.c @@ -2938,17 +2938,13 @@ static int __init serial_console_setup(struct console *co, char *options) } static struct console sercons = { - "ttyS", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; int su_console_registered = 0; diff --git a/drivers/sbus/char/zs.c b/drivers/sbus/char/zs.c index 7acfb2abae01..aa6472d492a7 100644 --- a/drivers/sbus/char/zs.c +++ b/drivers/sbus/char/zs.c @@ -2830,17 +2830,13 @@ static int __init zs_console_setup(struct console *con, char *options) } static struct console zs_console = { - "ttyS", - zs_console_write, - NULL, - zs_console_device, - zs_console_wait_key, - NULL, - zs_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: zs_console_write, + device: zs_console_device, + wait_key: zs_console_wait_key, + setup: zs_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; static int __init zs_console_init(void) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index ba54b2bf0119..a02006cb3e34 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -1346,7 +1346,7 @@ int aha152x_release(struct Scsi_Host *shpnt) /* * setup controller to generate interrupts depending - * on current state (lock has to be aquired) + * on current state (lock has to be acquired) * */ static int setup_expected_interrupts(struct Scsi_Host *shpnt) diff --git a/drivers/scsi/aic7xxx.c b/drivers/scsi/aic7xxx.c index 166ec8c5903b..8bb8cd96d99c 100644 --- a/drivers/scsi/aic7xxx.c +++ b/drivers/scsi/aic7xxx.c @@ -7749,7 +7749,7 @@ aic785x_cable_detect(struct aic7xxx_host *p, int *int_50, * Description: * Detect the cables that are present on the 2940-UWPro cards * - * NOTE: This functions assumes the SEEPROM will have already been aquired + * NOTE: This function assumes the SEEPROM will have already been acquired * prior to invocation of this function. *-F*************************************************************************/ static void @@ -7795,7 +7795,7 @@ aic2940_uwpro_wide_cable_detect(struct aic7xxx_host *p, int *int_68, * Description: * Detect the cables that are present on aic787x class controller chips * - * NOTE: This functions assumes the SEEPROM will have already been aquired + * NOTE: This function assumes the SEEPROM will have already been acquired * prior to invocation of this function. *-F*************************************************************************/ static void @@ -7842,7 +7842,7 @@ aic787x_cable_detect(struct aic7xxx_host *p, int *int_50, int *int_68, * Description: * Detect the termination settings present on ultra2 class controllers * - * NOTE: This functions assumes the SEEPROM will have already been aquired + * NOTE: This function assumes the SEEPROM will have already been acquired * prior to invocation of this function. *-F*************************************************************************/ static void diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 2f0c1a185e3d..6d312168c056 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -1104,7 +1104,7 @@ int imm_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) } /* - * Aimmrently the the disk->capacity attribute is off by 1 sector + * Apparently the the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really * be done in sd.c. Even if it gets fixed there, this will still * work. @@ -1118,8 +1118,6 @@ int imm_biosparam(Disk * disk, kdev_t dev, int ip[]) ip[0] = 0xff; ip[1] = 0x3f; ip[2] = (disk->capacity + 1) / (ip[0] * ip[1]); - if (ip[2] > 1023) - ip[2] = 1023; } return 0; } diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 542876daf7c9..2e9fd7313a60 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -2155,8 +2155,11 @@ static void scsi_unregister_host(Scsi_Host_Template * tpnt) (scsi_memory_upper_value - scsi_init_memory_start) / 1024); #endif - /* Remove it from the linked list and /proc */ - if (tpnt->present) { + /* + * Remove it from the linked list and /proc if all + * hosts were successfully removed (ie preset == 0) + */ + if (!tpnt->present) { Scsi_Host_Template **SHTp = &scsi_hosts; Scsi_Host_Template *SHT; diff --git a/drivers/sgi/char/sgiserial.c b/drivers/sgi/char/sgiserial.c index b0ccff4f88bd..fdf62b8482a0 100644 --- a/drivers/sgi/char/sgiserial.c +++ b/drivers/sgi/char/sgiserial.c @@ -2208,17 +2208,13 @@ static int __init zs_console_setup(struct console *con, char *options) } static struct console sgi_console_driver = { - "ttyS", - zs_console_write, /* write */ - NULL, /* read */ - zs_console_device, /* device */ - zs_console_wait_key, /* wait_key */ - NULL, /* unblank */ - zs_console_setup, /* setup */ - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: zs_console_write, + device: zs_console_device, + wait_key: zs_console_wait_key, + setup: zs_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c index 7fa446c0053a..f8ad9cf179ba 100644 --- a/drivers/tc/zs.c +++ b/drivers/tc/zs.c @@ -1998,17 +1998,13 @@ static int __init serial_console_setup(struct console *co, char *options) } static struct console sercons = { - "ttyS", - serial_console_write, - NULL, - serial_console_device, - serial_console_wait_key, - NULL, - serial_console_setup, - CON_PRINTBUFFER, - -1, - 0, - NULL + name: "ttyS", + write: serial_console_write, + device: serial_console_device, + wait_key: serial_console_wait_key, + setup: serial_console_setup, + flags: CON_PRINTBUFFER, + index: -1, }; /* diff --git a/drivers/usb/audio.c b/drivers/usb/audio.c index 7d948d95920f..1db828b24066 100644 --- a/drivers/usb/audio.c +++ b/drivers/usb/audio.c @@ -1009,8 +1009,10 @@ static int usbin_start(struct usb_audiodev *as) } spin_lock_irqsave(&as->lock, flags); } - if (u->dma.count >= u->dma.dmasize && !u->dma.mapped) + if (u->dma.count >= u->dma.dmasize && !u->dma.mapped) { + spin_unlock_irqrestore(&as->lock, flags); return 0; + } u->flags |= FLG_RUNNING; if (!(u->flags & FLG_URB0RUNNING)) { urb = &u->durb[0].urb; @@ -1372,8 +1374,10 @@ static int usbout_start(struct usb_audiodev *as) } spin_lock_irqsave(&as->lock, flags); } - if (u->dma.count <= 0 && !u->dma.mapped) + if (u->dma.count <= 0 && !u->dma.mapped) { + spin_unlock_irqrestore(&as->lock, flags); return 0; + } u->flags |= FLG_RUNNING; if (!(u->flags & FLG_URB0RUNNING)) { urb = &u->durb[0].urb; @@ -2772,6 +2776,14 @@ static void usb_audio_parsestreaming(struct usb_audio_state *s, unsigned char *b init_waitqueue_head(&as->usbin.dma.wait); init_waitqueue_head(&as->usbout.dma.wait); spin_lock_init(&as->lock); + spin_lock_init(&as->usbin.durb[0].urb.lock); + spin_lock_init(&as->usbin.durb[1].urb.lock); + spin_lock_init(&as->usbin.surb[0].urb.lock); + spin_lock_init(&as->usbin.surb[1].urb.lock); + spin_lock_init(&as->usbout.durb[0].urb.lock); + spin_lock_init(&as->usbout.durb[1].urb.lock); + spin_lock_init(&as->usbout.surb[0].urb.lock); + spin_lock_init(&as->usbout.surb[1].urb.lock); as->state = s; as->usbin.interface = asifin; as->usbout.interface = asifout; diff --git a/drivers/usb/mdc800.c b/drivers/usb/mdc800.c index 80a1ebbf4174..c35f75c81e5b 100644 --- a/drivers/usb/mdc800.c +++ b/drivers/usb/mdc800.c @@ -562,6 +562,7 @@ static int mdc800_device_open (struct inode* inode, struct file *file) mdc800->camera_request_ready=0; retval=0; + mdc800->irq_urb->dev = mdc800->dev; if (usb_submit_urb (mdc800->irq_urb)) { err ("request USB irq fails (submit_retval=%i urb_status=%i).",retval, mdc800->irq_urb->status); @@ -640,6 +641,7 @@ static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, lof mdc800->out_ptr=0; /* Download -> Request new bytes */ + mdc800->download_urb->dev = mdc800->dev; if (usb_submit_urb (mdc800->download_urb)) { err ("Can't submit download urb (status=%i)",mdc800->download_urb->status); @@ -738,6 +740,7 @@ static ssize_t mdc800_device_write (struct file *file, const char *buf, size_t l mdc800->state=WORKING; memcpy (mdc800->write_urb->transfer_buffer, mdc800->in,8); + mdc800->write_urb->dev = mdc800->dev; if (usb_submit_urb (mdc800->write_urb)) { err ("submitting write urb fails (status=%i)", mdc800->write_urb->status); diff --git a/drivers/usb/pegasus.c b/drivers/usb/pegasus.c index a71ff2439014..02c1eff8056a 100644 --- a/drivers/usb/pegasus.c +++ b/drivers/usb/pegasus.c @@ -50,7 +50,7 @@ #include -static const char *version = __FILE__ ": v0.4.13 2000/10/09 (C) 1999-2000 Petko Manolov (petkan@dce.bg)"; +static const char *version = __FILE__ ": v0.4.13 2000/10/13 (C) 1999-2000 Petko Manolov (petkan@dce.bg)"; #define PEGASUS_USE_INTR @@ -478,6 +478,7 @@ static void set_ethernet_addr( pegasus_t *pegasus ) __u8 node_id[6]; get_node_id(pegasus, node_id); + set_registers( pegasus, EthID, sizeof(node_id), node_id ); memcpy( pegasus->net->dev_addr, node_id, sizeof(node_id) ); } @@ -631,7 +632,7 @@ static void write_bulk_callback( struct urb *urb ) netif_wake_queue( pegasus->net ); } - +#ifdef PEGASUS_USE_INTR static void intr_callback( struct urb *urb ) { pegasus_t *pegasus = urb->context; @@ -662,7 +663,7 @@ static void intr_callback( struct urb *urb ) info("intr status %d", urb->status); } } - +#endif static void pegasus_tx_timeout( struct net_device *net ) { @@ -904,7 +905,12 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum ) init_MUTEX( &pegasus-> ctrl_sem ); init_waitqueue_head( &pegasus->ctrl_wait ); - net = init_etherdev(0, 0); + net = init_etherdev( NULL, 0 ); + if ( !net ) { + kfree( pegasus ); + return NULL; + } + pegasus->usb = dev; pegasus->net = net; net->priv = pegasus; @@ -920,9 +926,6 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum ) net->get_stats = pegasus_netdev_stats; net->mtu = PEGASUS_MTU; - set_ethernet_addr( pegasus ); - register_netdev( net ); - pegasus->features = usb_dev_id[dev_indx].private; if ( reset_mac(pegasus) ) { err("can't reset MAC"); @@ -932,18 +935,19 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum ) return NULL; } + set_ethernet_addr( pegasus ); + if ( pegasus->features & PEGASUS_II ) { info( "setup Pegasus II specific registers" ); setup_pegasus_II( pegasus ); } - + pegasus->phy = mii_phy_probe( pegasus ); if ( !pegasus->phy ) { warn( "can't locate MII phy, using default" ); pegasus->phy = 1; } - info( "%s: %s", net->name, usb_dev_id[dev_indx].name ); return pegasus; diff --git a/drivers/usb/plusb.c b/drivers/usb/plusb.c index a8ffa3aba690..d3d1b4e6ac8b 100644 --- a/drivers/usb/plusb.c +++ b/drivers/usb/plusb.c @@ -245,6 +245,7 @@ static void plusb_int_complete(urb_t *purb) return; } + s->bulkurb->dev = s->usbdev; ret=usb_submit_urb(s->bulkurb); if(ret && ret!=-EBUSY) { err("plusb_int_complete: usb_submit_urb failed"); diff --git a/drivers/usb/usbmouse.c b/drivers/usb/usbmouse.c index 39df8e5e05b7..1e873b285209 100644 --- a/drivers/usb/usbmouse.c +++ b/drivers/usb/usbmouse.c @@ -43,6 +43,7 @@ struct usb_mouse { char name[128]; struct input_dev dev; struct urb irq; + struct usb_device *my_usb_device; // for resubmitting my urb int open; }; @@ -72,6 +73,7 @@ static int usb_mouse_open(struct input_dev *dev) if (mouse->open++) return 0; + mouse->irq.dev = mouse->my_usb_device; if (usb_submit_urb(&mouse->irq)) return -EIO; @@ -148,6 +150,7 @@ static void *usb_mouse_probe(struct usb_device *dev, unsigned int ifnum) kfree(buf); + mouse->my_usb_device = dev; FILL_INT_URB(&mouse->irq, dev, pipe, mouse->data, maxp > 8 ? 8 : maxp, usb_mouse_irq, mouse, endpoint->bInterval); diff --git a/drivers/usb/wacom.c b/drivers/usb/wacom.c index b74a003e8f1f..4dcc86436fc2 100644 --- a/drivers/usb/wacom.c +++ b/drivers/usb/wacom.c @@ -117,6 +117,7 @@ struct wacom_features { struct wacom { signed char data[10]; struct input_dev dev; + struct usb_device *usbdev; struct urb irq; struct wacom_features *features; int tool; @@ -239,6 +240,7 @@ static int wacom_open(struct input_dev *dev) if (wacom->open++) return 0; + wacom->irq.dev = wacom->usbdev; if (usb_submit_urb(&wacom->irq)) return -EIO; @@ -293,6 +295,7 @@ static void *wacom_probe(struct usb_device *dev, unsigned int ifnum) wacom->dev.idvendor = dev->descriptor.idVendor; wacom->dev.idproduct = dev->descriptor.idProduct; wacom->dev.idversion = dev->descriptor.bcdDevice; + wacom->usbdev = dev; FILL_INT_URB(&wacom->irq, dev, usb_rcvintpipe(dev, endpoint->bEndpointAddress), wacom->data, wacom->features->pktlen, wacom->features->irq, wacom, endpoint->bInterval); diff --git a/fs/buffer.c b/fs/buffer.c index 328daa93950a..4de38a0e4869 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -586,7 +586,7 @@ unsigned int get_hardblocksize(kdev_t dev) These are two special cases. Normal usage imply the device driver to issue a sync on the device (without waiting I/O completation) and - then an invalidate_buffers call that doesn't trashes dirty buffers. */ + then an invalidate_buffers call that doesn't trash dirty buffers. */ void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers) { int i, nlist, slept; @@ -618,6 +618,8 @@ void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers) __remove_from_queues(bh); put_last_free(bh); } + /* else complain loudly? */ + write_unlock(&hash_table_lock); if (slept) goto out; @@ -1041,13 +1043,9 @@ struct buffer_head * breada(kdev_t dev, int block, int bufsize, blocks = (filesize - pos) >> (9+index); - if (blocks < (read_ahead[MAJOR(dev)] >> index)) - blocks = read_ahead[MAJOR(dev)] >> index; if (blocks > NBUF) blocks = NBUF; -/* if (blocks) printk("breada (new) %d blocks\n",blocks); */ - bhlist[0] = bh; j = 1; for(i=1; ivm_pgoff = 0; mpnt->vm_file = NULL; mpnt->vm_private_data = (void *) 0; - vmlist_modify_lock(current->mm); + spin_lock(¤t->mm->page_table_lock); insert_vm_struct(current->mm, mpnt); - vmlist_modify_unlock(current->mm); + spin_unlock(¤t->mm->page_table_lock); current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; } diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c index 43eb2cb57f40..5f5ec196fbe5 100644 --- a/fs/hpfs/buffer.c +++ b/fs/hpfs/buffer.c @@ -125,8 +125,7 @@ void *hpfs_map_sector(struct super_block *s, unsigned secno, struct buffer_head kdev_t dev = s->s_dev; struct buffer_head *bh; - /* vvvv - workaround for the breada bug */ - if (!ahead || secno + ahead + (read_ahead[MAJOR(dev)] >> 9) >= s->s_hpfs_fs_size) + if (!ahead || secno + ahead >= s->s_hpfs_fs_size) *bhp = bh = bread(dev, secno, 512); else *bhp = bh = breada(dev, secno, 512, 0, (ahead + 1) << 9); if (bh != NULL) @@ -174,8 +173,7 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe goto bail; } - /* vvvv - workaround for the breada bug */ - if (!ahead || secno + 4 + ahead + (read_ahead[MAJOR(dev)] >> 9) > s->s_hpfs_fs_size) + if (!ahead || secno + 4 + ahead > s->s_hpfs_fs_size) qbh->bh[0] = bh = bread(dev, secno, 512); else qbh->bh[0] = bh = breada(dev, secno, 512, 0, (ahead + 4) << 9); if (!bh) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index a175d39eb029..eae976616d6e 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -349,7 +349,7 @@ again: /* Append to list of blocked */ nlmsvc_insert_block(block, NLM_NEVER); - if (list_empty(&block->b_call.a_args.lock.fl.fl_list)) { + if (list_empty(&block->b_call.a_args.lock.fl.fl_block)) { /* Now add block to block list of the conflicting lock if we haven't done so. */ dprintk("lockd: blocking on this lock.\n"); diff --git a/fs/locks.c b/fs/locks.c index 95310133dbf9..0e92b740f482 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -164,7 +164,7 @@ static inline void locks_free_lock(struct file_lock *fl) if (!list_empty(&fl->fl_block)) panic("Attempting to free lock with active block list"); - if (!list_empty(&fl->fl_link) || !list_empty(&fl->fl_list)) + if (!list_empty(&fl->fl_link)) panic("Attempting to free lock on active lock list"); kmem_cache_free(filelock_cache, fl); @@ -174,7 +174,6 @@ void locks_init_lock(struct file_lock *fl) { INIT_LIST_HEAD(&fl->fl_link); INIT_LIST_HEAD(&fl->fl_block); - INIT_LIST_HEAD(&fl->fl_list); init_waitqueue_head(&fl->fl_wait); fl->fl_next = NULL; fl->fl_fasync = NULL; @@ -403,8 +402,8 @@ locks_same_owner(struct file_lock *fl1, struct file_lock *fl2) */ static void locks_delete_block(struct file_lock *waiter) { - list_del(&waiter->fl_list); - INIT_LIST_HEAD(&waiter->fl_list); + list_del(&waiter->fl_block); + INIT_LIST_HEAD(&waiter->fl_block); list_del(&waiter->fl_link); INIT_LIST_HEAD(&waiter->fl_link); waiter->fl_next = NULL; @@ -418,13 +417,13 @@ static void locks_delete_block(struct file_lock *waiter) static void locks_insert_block(struct file_lock *blocker, struct file_lock *waiter) { - if (!list_empty(&waiter->fl_list)) { + if (!list_empty(&waiter->fl_block)) { printk(KERN_ERR "locks_insert_block: removing duplicated lock " "(pid=%d %Ld-%Ld type=%d)\n", waiter->fl_pid, waiter->fl_start, waiter->fl_end, waiter->fl_type); locks_delete_block(waiter); } - list_add_tail(&waiter->fl_list, &blocker->fl_block); + list_add_tail(&waiter->fl_block, &blocker->fl_block); waiter->fl_next = blocker; list_add(&waiter->fl_link, &blocked_list); } @@ -436,7 +435,7 @@ static void locks_insert_block(struct file_lock *blocker, static void locks_wake_up_blocks(struct file_lock *blocker, unsigned int wait) { while (!list_empty(&blocker->fl_block)) { - struct file_lock *waiter = list_entry(blocker->fl_block.next, struct file_lock, fl_list); + struct file_lock *waiter = list_entry(blocker->fl_block.next, struct file_lock, fl_block); /* N.B. Is it possible for the notify function to block?? */ if (waiter->fl_notify) waiter->fl_notify(waiter); @@ -644,7 +643,6 @@ static int posix_locks_deadlock(struct file_lock *caller_fl, caller_pid = caller_fl->fl_pid; blocked_owner = block_fl->fl_owner; blocked_pid = block_fl->fl_pid; - tmp = blocked_list.next; next_task: if (caller_owner == blocked_owner && caller_pid == blocked_pid) @@ -1708,7 +1706,7 @@ void posix_unblock_lock(struct file_lock *waiter) { acquire_fl_sem(); - if (!list_empty(&waiter->fl_list)) { + if (!list_empty(&waiter->fl_block)) { locks_delete_block(waiter); wake_up(&waiter->fl_wait); } @@ -1815,7 +1813,7 @@ int get_locks_status(char *buffer, char **start, off_t offset, int length) list_for_each(btmp, &fl->fl_block) { struct file_lock *bfl = list_entry(btmp, - struct file_lock, fl_list); + struct file_lock, fl_block); lock_get_status(q, bfl, i, " ->"); move_lock_status(&q, &pos, offset); diff --git a/fs/partitions/atari.c b/fs/partitions/atari.c index a94f8f5fcddb..0180daca8ef4 100644 --- a/fs/partitions/atari.c +++ b/fs/partitions/atari.c @@ -62,6 +62,7 @@ int atari_partition (struct gendisk *hd, kdev_t dev, /* if there's no valid primary partition, assume that no Atari format partition table (there's no reliable magic or the like :-() */ + brelse(bh); return 0; } diff --git a/fs/pipe.c b/fs/pipe.c index 8745b6f88eb7..1856d54d3543 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -284,7 +284,7 @@ pipe_poll(struct file *filp, poll_table *wait) poll_wait(filp, PIPE_WAIT(*inode), wait); - /* Reading only -- no need for aquiring the semaphore. */ + /* Reading only -- no need for acquiring the semaphore. */ mask = POLLIN | POLLRDNORM; if (PIPE_EMPTY(*inode)) mask = POLLOUT | POLLWRNORM; diff --git a/fs/vfat/namei.c b/fs/vfat/namei.c index 0ac6d53141c3..1f4829709fe8 100644 --- a/fs/vfat/namei.c +++ b/fs/vfat/namei.c @@ -618,12 +618,11 @@ static int vfat_create_shortname(struct inode *dir, struct nls_table *nls, sz = len; ext_start = NULL; } - break; + goto stop0; } } - if (charbuf[chi] == '.') - break; } +stop0:; if (ext_start == name - 1) { sz = len; ext_start = NULL; @@ -640,10 +639,12 @@ static int vfat_create_shortname(struct inode *dir, struct nls_table *nls, if (chl == 0) break; for (chi = 0; chi < chl; chi++) - if (!strchr(skip_chars, charbuf[chi])) - break; + if (!strchr(skip_chars, charbuf[chi])) { + goto stop1; + } name_start++; } +stop1:; if (name_start != ext_start) { sz = ext_start - name; ext_start++; diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index ec7650841944..e41ca1da0ed6 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h @@ -19,13 +19,12 @@ /* * FPU lazy state save handling... */ -extern void save_fpu( struct task_struct *tsk ); extern void save_init_fpu( struct task_struct *tsk ); extern void restore_fpu( struct task_struct *tsk ); #define unlazy_fpu( tsk ) do { \ if ( tsk->flags & PF_USEDFPU ) \ - save_fpu( tsk ); \ + save_init_fpu( tsk ); \ } while (0) #define clear_fpu( tsk ) do { \ diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 769269192a51..76ac26cae5b7 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -85,7 +85,7 @@ struct cpuinfo_x86 { #define X86_FEATURE_CMOV 0x00008000 /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */ #define X86_FEATURE_PAT 0x00010000 /* Page Attribute Table */ #define X86_FEATURE_PSE36 0x00020000 /* 36-bit PSEs */ -#define X86_FEATURE_18 0x00040000 +#define X86_FEATURE_PN 0x00040000 #define X86_FEATURE_19 0x00080000 #define X86_FEATURE_20 0x00100000 #define X86_FEATURE_21 0x00200000 diff --git a/include/asm-ia64/acpikcfg.h b/include/asm-ia64/acpikcfg.h index cc9dc35bb331..1bf49cf01924 100644 --- a/include/asm-ia64/acpikcfg.h +++ b/include/asm-ia64/acpikcfg.h @@ -1,4 +1,3 @@ -#ifdef CONFIG_ACPI_KERNEL_CONFIG /* * acpikcfg.h - ACPI based Kernel Configuration Manager External Interfaces * @@ -6,6 +5,9 @@ * Copyright (C) 2000 J.I. Lee */ +#include + +#ifdef CONFIG_ACPI_KERNEL_CONFIG u32 __init acpi_cf_init (void * rsdp); u32 __init acpi_cf_terminate (void ); diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h index 19c93ab25d27..06528f8d2f78 100644 --- a/include/asm-ia64/hw_irq.h +++ b/include/asm-ia64/hw_irq.h @@ -6,8 +6,6 @@ * Copyright (C) 2000 David Mosberger-Tang */ -#include - #include #include diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index 127443310961..652aaffcab9b 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h @@ -1,7 +1,6 @@ #ifndef _ASM_IA64_PCI_H #define _ASM_IA64_PCI_H -#include #include #include #include diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index 9ed33ac5c601..98b4787e5c47 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h @@ -105,7 +105,6 @@ #include #include -#include #include /* diff --git a/include/asm-sh/pgalloc-2level.h b/include/asm-sh/pgalloc-2level.h index a106b23a3a4d..a9c9fddc473e 100644 --- a/include/asm-sh/pgalloc-2level.h +++ b/include/asm-sh/pgalloc-2level.h @@ -5,15 +5,15 @@ * traditional two-level paging, page table allocation routines: */ -extern __inline__ pmd_t *get_pmd_fast(void) +static __inline__ pmd_t *get_pmd_fast(void) { return (pmd_t *)0; } -extern __inline__ void free_pmd_fast(pmd_t *pmd) { } -extern __inline__ void free_pmd_slow(pmd_t *pmd) { } +static __inline__ void free_pmd_fast(pmd_t *pmd) { } +static __inline__ void free_pmd_slow(pmd_t *pmd) { } -extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) +static __inline__ pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) { if (!pgd) BUG(); diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h index 0b728aee381a..5984937fa4c6 100644 --- a/include/asm-sh/pgalloc.h +++ b/include/asm-sh/pgalloc.h @@ -3,6 +3,7 @@ #include #include +#include #define pgd_quicklist (current_cpu_data.pgd_quick) #define pmd_quicklist ((unsigned long *)0) @@ -17,18 +18,18 @@ * if any. */ -extern __inline__ pgd_t *get_pgd_slow(void) +static __inline__ pgd_t *get_pgd_slow(void) { - pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL); + unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); + pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); + + if (ret) + memset(ret, 0, pgd_size); - if (ret) { - memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); - memcpy(ret + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); - } return ret; } -extern __inline__ pgd_t *get_pgd_fast(void) +static __inline__ pgd_t *get_pgd_fast(void) { unsigned long *ret; @@ -41,22 +42,22 @@ extern __inline__ pgd_t *get_pgd_fast(void) return (pgd_t *)ret; } -extern __inline__ void free_pgd_fast(pgd_t *pgd) +static __inline__ void free_pgd_fast(pgd_t *pgd) { *(unsigned long *)pgd = (unsigned long) pgd_quicklist; pgd_quicklist = (unsigned long *) pgd; pgtable_cache_size++; } -extern __inline__ void free_pgd_slow(pgd_t *pgd) +static __inline__ void free_pgd_slow(pgd_t *pgd) { - free_page((unsigned long)pgd); + kfree(pgd); } extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted); -extern __inline__ pte_t *get_pte_fast(void) +static __inline__ pte_t *get_pte_fast(void) { unsigned long *ret; @@ -68,14 +69,14 @@ extern __inline__ pte_t *get_pte_fast(void) return (pte_t *)ret; } -extern __inline__ void free_pte_fast(pte_t *pte) +static __inline__ void free_pte_fast(pte_t *pte) { *(unsigned long *)pte = (unsigned long) pte_quicklist; pte_quicklist = (unsigned long *) pte; pgtable_cache_size++; } -extern __inline__ void free_pte_slow(pte_t *pte) +static __inline__ void free_pte_slow(pte_t *pte) { free_page((unsigned long)pte); } @@ -85,7 +86,7 @@ extern __inline__ void free_pte_slow(pte_t *pte) #define pgd_free(pgd) free_pgd_slow(pgd) #define pgd_alloc() get_pgd_fast() -extern inline pte_t * pte_alloc_kernel(pmd_t * pmd, unsigned long address) +static __inline__ pte_t * pte_alloc_kernel(pmd_t * pmd, unsigned long address) { if (!pmd) BUG(); @@ -105,7 +106,7 @@ extern inline pte_t * pte_alloc_kernel(pmd_t * pmd, unsigned long address) return (pte_t *) pmd_page(*pmd) + address; } -extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address) +static __inline__ pte_t * pte_alloc(pmd_t * pmd, unsigned long address) { address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); @@ -132,7 +133,7 @@ fix: * allocating and freeing a pmd is trivial: the 1-entry pmd is * inside the pgd, so has no extra memory associated with it. */ -extern inline void pmd_free(pmd_t * pmd) +static __inline__ void pmd_free(pmd_t * pmd) { } @@ -141,22 +142,6 @@ extern inline void pmd_free(pmd_t * pmd) extern int do_check_pgt_cache(int, int); -extern inline void set_pgdir(unsigned long address, pgd_t entry) -{ - struct task_struct * p; - pgd_t *pgd; - - read_lock(&tasklist_lock); - for_each_task(p) { - if (!p->mm) - continue; - *pgd_offset(p->mm,address) = entry; - } - read_unlock(&tasklist_lock); - for (pgd = (pgd_t *)pgd_quicklist; pgd; pgd = (pgd_t *)*(unsigned long *)pgd) - pgd[address >> PGDIR_SHIFT] = entry; -} - /* * TLB flushing: * @@ -174,8 +159,9 @@ extern void flush_tlb_mm(struct mm_struct *mm); extern void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end); extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); -extern inline void flush_tlb_pgtables(struct mm_struct *mm, - unsigned long start, unsigned long end) + +static __inline__ void flush_tlb_pgtables(struct mm_struct *mm, + unsigned long start, unsigned long end) { } diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h index 180709c85e66..66e4aab801f7 100644 --- a/include/asm-sparc/pgalloc.h +++ b/include/asm-sparc/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id: pgalloc.h,v 1.9 2000/08/01 04:53:58 anton Exp $ */ +/* $Id: pgalloc.h,v 1.10 2000/10/13 01:40:26 davem Exp $ */ #ifndef _SPARC_PGALLOC_H #define _SPARC_PGALLOC_H @@ -139,7 +139,7 @@ BTFIXUPDEF_CALL(pgd_t *, pgd_alloc, void) #define pgd_free(pgd) BTFIXUP_CALL(pgd_free)(pgd) #define pgd_alloc() BTFIXUP_CALL(pgd_alloc)() -BTFIXUPDEF_CALL(void, set_pgdir, unsigned long, pgd_t) +#error Anton, you need to do set_pgdir things now as on ix86, see i386/mm/fault.c #define set_pgdir(address,entry) BTFIXUP_CALL(set_pgdir)(address,entry) diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index b81b9cee496a..be3dde29ca68 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h @@ -304,7 +304,4 @@ extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) extern int do_check_pgt_cache(int, int); -/* Nothing to do on sparc64 :) */ -#define set_pgdir(address, entry) do { } while(0) - #endif /* _SPARC64_PGALLOC_H */ diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index 3374036ce6b1..f5e795919e4e 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -40,8 +40,6 @@ int coda_release(struct inode *i, struct file *f); int coda_permission(struct inode *inode, int mask); int coda_revalidate_inode(struct dentry *); int coda_notify_change(struct dentry *, struct iattr *); -int coda_pioctl(struct inode * inode, struct file * filp, - unsigned int cmd, unsigned long arg); /* global variables */ extern int coda_debug; diff --git a/include/linux/fs.h b/include/linux/fs.h index eb224122683c..72effef4a3c8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -517,8 +517,7 @@ typedef struct files_struct *fl_owner_t; struct file_lock { struct file_lock *fl_next; /* singly linked list for this inode */ struct list_head fl_link; /* doubly linked list of all locks */ - struct list_head fl_block; /* circular list of blocked processes */ - struct list_head fl_list; /* block list member */ + struct list_head fl_block; /* circular list of blocked processes */ fl_owner_t fl_owner; unsigned int fl_pid; wait_queue_head_t fl_wait; diff --git a/include/linux/mm.h b/include/linux/mm.h index 69d4d2490c0c..f67d6be5261b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -380,7 +380,7 @@ extern void FASTCALL(free_pages(unsigned long addr, unsigned long order)); #define free_page(addr) free_pages((addr),0) extern void show_free_areas(void); -extern void show_free_areas_node(int nid); +extern void show_free_areas_node(pg_data_t *pgdat); extern void clear_page_tables(struct mm_struct *, unsigned long, int); @@ -527,11 +527,6 @@ extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned lon #define pgcache_under_min() (atomic_read(&page_cache_size) * 100 < \ page_cache.min_percent * num_physpages) -#define vmlist_access_lock(mm) spin_lock(&mm->page_table_lock) -#define vmlist_access_unlock(mm) spin_unlock(&mm->page_table_lock) -#define vmlist_modify_lock(mm) vmlist_access_lock(mm) -#define vmlist_modify_unlock(mm) vmlist_access_unlock(mm) - #endif /* __KERNEL__ */ #endif diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 4a8280d7d36a..c14decdfcac6 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -101,15 +101,15 @@ extern pg_data_t *pgdat_list; * prototypes for the discontig memory code. */ struct page; -extern void show_free_areas_core(int); +extern void show_free_areas_core(pg_data_t *pgdat); extern void free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, unsigned long *zones_size, unsigned long paddr, unsigned long *zholes_size, struct page *pmap); -#ifndef CONFIG_DISCONTIGMEM - extern pg_data_t contig_page_data; +#ifndef CONFIG_DISCONTIGMEM + #define NODE_DATA(nid) (&contig_page_data) #define NODE_MEM_MAP(nid) mem_map diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 242be9730f1b..d66474b60c42 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -43,6 +43,7 @@ struct rpc_cred { * Client authentication handle */ #define RPC_CREDCACHE_NR 8 +#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) struct rpc_auth { struct rpc_cred * au_credcache[RPC_CREDCACHE_NR]; unsigned long au_expire; /* cache expiry interval */ diff --git a/ipc/sem.c b/ipc/sem.c index 1976697c10d5..203418a8abb4 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -41,7 +41,7 @@ * get the semaphore and if this process wants to reduce some * semaphore value we simply wake it up without doing the * operation. So it has to try to get it later. Thus e.g. the - * running process may reaquire the semaphore during the current + * running process may reacquire the semaphore during the current * time slice. If it only waits for zero or increases the semaphore, * we do the operation in advance and wake it up. * 2) It did not wake up all zero waiting processes. We try to do diff --git a/kernel/signal.c b/kernel/signal.c index b4a1dee278df..4f56f54439e8 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -458,7 +458,7 @@ static int send_signal(int sig, struct siginfo *info, struct sigpending *signals * NOTE! we rely on the previous spin_lock to * lock interrupts for us! We can only be called with * "sigmask_lock" held, and the local interrupt must - * have been disabled when that got aquired! + * have been disabled when that got acquired! * * No need to set need_resched since signal event passing * goes through ->blocked diff --git a/kernel/user.c b/kernel/user.c index 867408211bd7..d033c9659717 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -76,7 +76,7 @@ static inline struct user_struct *uid_hash_find(uid_t uid, struct user_struct ** /* * For SMP, we need to re-test the user struct counter - * after having aquired the spinlock. This allows us to do + * after having acquired the spinlock. This allows us to do * the common case (not freeing anything) without having * any locking. */ diff --git a/mm/filemap.c b/mm/filemap.c index 6aca16409ec2..68937481cf8e 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1766,11 +1766,11 @@ static long madvise_fixup_start(struct vm_area_struct * vma, get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_pgoff += (end - vma->vm_start) >> PAGE_SHIFT; vma->vm_start = end; insert_vm_struct(current->mm, n); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -1790,10 +1790,10 @@ static long madvise_fixup_end(struct vm_area_struct * vma, get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_end = start; insert_vm_struct(current->mm, n); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -1823,7 +1823,7 @@ static long madvise_fixup_middle(struct vm_area_struct * vma, vma->vm_ops->open(left); vma->vm_ops->open(right); } - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_pgoff += (start - vma->vm_start) >> PAGE_SHIFT; vma->vm_start = start; vma->vm_end = end; @@ -1831,7 +1831,7 @@ static long madvise_fixup_middle(struct vm_area_struct * vma, vma->vm_raend = 0; insert_vm_struct(current->mm, left); insert_vm_struct(current->mm, right); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } diff --git a/mm/mlock.c b/mm/mlock.c index a3d10ff99dc5..f684a3c606ef 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -14,9 +14,9 @@ static inline int mlock_fixup_all(struct vm_area_struct * vma, int newflags) { - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_flags = newflags; - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -36,11 +36,11 @@ static inline int mlock_fixup_start(struct vm_area_struct * vma, get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_pgoff += (end - vma->vm_start) >> PAGE_SHIFT; vma->vm_start = end; insert_vm_struct(current->mm, n); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -61,10 +61,10 @@ static inline int mlock_fixup_end(struct vm_area_struct * vma, get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_end = start; insert_vm_struct(current->mm, n); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -96,7 +96,7 @@ static inline int mlock_fixup_middle(struct vm_area_struct * vma, vma->vm_ops->open(left); vma->vm_ops->open(right); } - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_pgoff += (start - vma->vm_start) >> PAGE_SHIFT; vma->vm_start = start; vma->vm_end = end; @@ -104,7 +104,7 @@ static inline int mlock_fixup_middle(struct vm_area_struct * vma, vma->vm_raend = 0; insert_vm_struct(current->mm, left); insert_vm_struct(current->mm, right); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -183,9 +183,9 @@ static int do_mlock(unsigned long start, size_t len, int on) break; } } - vmlist_modify_lock(current->mm); + spin_lock(¤t->mm->page_table_lock); merge_segments(current->mm, start, end); - vmlist_modify_unlock(current->mm); + spin_unlock(¤t->mm->page_table_lock); return error; } @@ -257,9 +257,9 @@ static int do_mlockall(int flags) if (error) break; } - vmlist_modify_lock(current->mm); + spin_lock(¤t->mm->page_table_lock); merge_segments(current->mm, 0, TASK_SIZE); - vmlist_modify_unlock(current->mm); + spin_unlock(¤t->mm->page_table_lock); return error; } diff --git a/mm/mmap.c b/mm/mmap.c index 4348ad56b4fc..c50de6ed80af 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -317,12 +317,12 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, unsigned lon */ flags = vma->vm_flags; addr = vma->vm_start; /* can addr have changed?? */ - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); insert_vm_struct(mm, vma); if (correct_wcount) atomic_inc(&file->f_dentry->d_inode->i_writecount); merge_segments(mm, vma->vm_start, vma->vm_end); - vmlist_modify_unlock(mm); + spin_unlock(&mm->page_table_lock); mm->total_vm += len >> PAGE_SHIFT; if (flags & VM_LOCKED) { @@ -534,11 +534,11 @@ static struct vm_area_struct * unmap_fixup(struct mm_struct *mm, /* Work out to one of the ends. */ if (end == area->vm_end) { area->vm_end = addr; - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); } else if (addr == area->vm_start) { area->vm_pgoff += (end - area->vm_start) >> PAGE_SHIFT; area->vm_start = end; - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); } else { /* Unmapping a hole: area->vm_start < addr <= end < area->vm_end */ /* Add end mapping -- leave beginning for below */ @@ -560,12 +560,12 @@ static struct vm_area_struct * unmap_fixup(struct mm_struct *mm, if (mpnt->vm_ops && mpnt->vm_ops->open) mpnt->vm_ops->open(mpnt); area->vm_end = addr; /* Truncate area */ - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); insert_vm_struct(mm, mpnt); } insert_vm_struct(mm, area); - vmlist_modify_unlock(mm); + spin_unlock(&mm->page_table_lock); return extra; } @@ -670,7 +670,7 @@ int do_munmap(struct mm_struct *mm, unsigned long addr, size_t len) npp = (prev ? &prev->vm_next : &mm->mmap); free = NULL; - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); for ( ; mpnt && mpnt->vm_start < addr+len; mpnt = *npp) { *npp = mpnt->vm_next; mpnt->vm_next = free; @@ -679,7 +679,7 @@ int do_munmap(struct mm_struct *mm, unsigned long addr, size_t len) avl_remove(mpnt, &mm->mmap_avl); } mm->mmap_cache = NULL; /* Kill the cache. */ - vmlist_modify_unlock(mm); + spin_unlock(&mm->page_table_lock); /* Ok - we have the memory areas we should free on the 'free' list, * so release them, and unmap the page range.. @@ -811,10 +811,10 @@ unsigned long do_brk(unsigned long addr, unsigned long len) flags = vma->vm_flags; addr = vma->vm_start; - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); insert_vm_struct(mm, vma); merge_segments(mm, vma->vm_start, vma->vm_end); - vmlist_modify_unlock(mm); + spin_unlock(&mm->page_table_lock); mm->total_vm += len >> PAGE_SHIFT; if (flags & VM_LOCKED) { @@ -840,10 +840,10 @@ void exit_mmap(struct mm_struct * mm) struct vm_area_struct * mpnt; release_segments(mm); - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); mpnt = mm->mmap; mm->mmap = mm->mmap_avl = mm->mmap_cache = NULL; - vmlist_modify_unlock(mm); + spin_unlock(&mm->page_table_lock); mm->rss = 0; mm->total_vm = 0; mm->locked_vm = 0; @@ -985,9 +985,9 @@ void merge_segments (struct mm_struct * mm, unsigned long start_addr, unsigned l if (mpnt->vm_ops && mpnt->vm_ops->close) { mpnt->vm_pgoff += (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; mpnt->vm_start = mpnt->vm_end; - vmlist_modify_unlock(mm); + spin_unlock(&mm->page_table_lock); mpnt->vm_ops->close(mpnt); - vmlist_modify_lock(mm); + spin_lock(&mm->page_table_lock); } mm->map_count--; remove_shared_vm_struct(mpnt); diff --git a/mm/mprotect.c b/mm/mprotect.c index 53fc53acb211..b62536c7fea8 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -86,10 +86,10 @@ static void change_protection(unsigned long start, unsigned long end, pgprot_t n static inline int mprotect_fixup_all(struct vm_area_struct * vma, int newflags, pgprot_t prot) { - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_flags = newflags; vma->vm_page_prot = prot; - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -111,11 +111,11 @@ static inline int mprotect_fixup_start(struct vm_area_struct * vma, get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_pgoff += (end - vma->vm_start) >> PAGE_SHIFT; vma->vm_start = end; insert_vm_struct(current->mm, n); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -138,10 +138,10 @@ static inline int mprotect_fixup_end(struct vm_area_struct * vma, get_file(n->vm_file); if (n->vm_ops && n->vm_ops->open) n->vm_ops->open(n); - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_end = start; insert_vm_struct(current->mm, n); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -172,7 +172,7 @@ static inline int mprotect_fixup_middle(struct vm_area_struct * vma, vma->vm_ops->open(left); vma->vm_ops->open(right); } - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_pgoff += (start - vma->vm_start) >> PAGE_SHIFT; vma->vm_start = start; vma->vm_end = end; @@ -181,7 +181,7 @@ static inline int mprotect_fixup_middle(struct vm_area_struct * vma, vma->vm_page_prot = prot; insert_vm_struct(current->mm, left); insert_vm_struct(current->mm, right); - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } @@ -263,9 +263,9 @@ asmlinkage long sys_mprotect(unsigned long start, size_t len, unsigned long prot break; } } - vmlist_modify_lock(current->mm); + spin_lock(¤t->mm->page_table_lock); merge_segments(current->mm, start, end); - vmlist_modify_unlock(current->mm); + spin_unlock(¤t->mm->page_table_lock); out: up(¤t->mm->mmap_sem); return error; diff --git a/mm/mremap.c b/mm/mremap.c index d1f6a7b8b0a9..ebc27b744524 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -141,10 +141,10 @@ static inline unsigned long move_vma(struct vm_area_struct * vma, get_file(new_vma->vm_file); if (new_vma->vm_ops && new_vma->vm_ops->open) new_vma->vm_ops->open(new_vma); - vmlist_modify_lock(current->mm); + spin_lock(¤t->mm->page_table_lock); insert_vm_struct(current->mm, new_vma); merge_segments(current->mm, new_vma->vm_start, new_vma->vm_end); - vmlist_modify_unlock(current->mm); + spin_unlock(¤t->mm->page_table_lock); do_munmap(current->mm, addr, old_len); current->mm->total_vm += new_len >> PAGE_SHIFT; if (new_vma->vm_flags & VM_LOCKED) { @@ -258,9 +258,9 @@ unsigned long do_mremap(unsigned long addr, /* can we just expand the current mapping? */ if (max_addr - addr >= new_len) { int pages = (new_len - old_len) >> PAGE_SHIFT; - vmlist_modify_lock(vma->vm_mm); + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_end = addr + new_len; - vmlist_modify_unlock(vma->vm_mm); + spin_unlock(&vma->vm_mm->page_table_lock); current->mm->total_vm += pages; if (vma->vm_flags & VM_LOCKED) { current->mm->locked_vm += pages; diff --git a/mm/numa.c b/mm/numa.c index 06ad9ec63490..60f8350a0d02 100644 --- a/mm/numa.c +++ b/mm/numa.c @@ -11,11 +11,11 @@ int numnodes = 1; /* Initialized for UMA platforms */ -#ifndef CONFIG_DISCONTIGMEM - static bootmem_data_t contig_bootmem_data; pg_data_t contig_page_data = { bdata: &contig_bootmem_data }; +#ifndef CONFIG_DISCONTIGMEM + /* * This is meant to be invoked by platforms whose physical memory starts * at a considerably higher value than 0. Examples are Super-H, ARM, m68k. @@ -25,7 +25,7 @@ void __init free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap, unsigned long *zones_size, unsigned long zone_start_paddr, unsigned long *zholes_size) { - free_area_init_core(0, NODE_DATA(0), &mem_map, zones_size, + free_area_init_core(0, &contig_page_data, &mem_map, zones_size, zone_start_paddr, zholes_size, pmap); } @@ -33,7 +33,11 @@ void __init free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap, struct page * alloc_pages_node(int nid, int gfp_mask, unsigned long order) { +#ifdef CONFIG_NUMA return __alloc_pages(NODE_DATA(nid)->node_zonelists + gfp_mask, order); +#else + return alloc_pages(gfp_mask, order); +#endif } #ifdef CONFIG_DISCONTIGMEM @@ -42,13 +46,12 @@ struct page * alloc_pages_node(int nid, int gfp_mask, unsigned long order) static spinlock_t node_lock = SPIN_LOCK_UNLOCKED; -void show_free_areas_node(int nid) +void show_free_areas_node(pg_data_t *pgdat) { unsigned long flags; spin_lock_irqsave(&node_lock, flags); - printk("Memory information for node %d:\n", nid); - show_free_areas_core(nid); + show_free_areas_core(pgdat); spin_unlock_irqrestore(&node_lock, flags); } @@ -79,6 +82,12 @@ void __init free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap, memset(pgdat->valid_addr_bitmap, 0, size); } +static struct page * alloc_pages_pgdat(pg_data_t *pgdat, int gfp_mask, + unsigned long order) +{ + return __alloc_pages(pgdat->node_zonelists + gfp_mask, order); +} + /* * This can be refined. Currently, tries to do round robin, instead * should do concentratic circle search, starting from current node. @@ -86,33 +95,34 @@ void __init free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap, struct page * alloc_pages(int gfp_mask, unsigned long order) { struct page *ret = 0; - int startnode, tnode; + pg_data_t *start, *temp; #ifndef CONFIG_NUMA unsigned long flags; - static int nextnid = 0; + static pg_data_t *next = 0; #endif if (order >= MAX_ORDER) return NULL; #ifdef CONFIG_NUMA - tnode = numa_node_id(); + temp = NODE_DATA(numa_node_id()); #else spin_lock_irqsave(&node_lock, flags); - tnode = nextnid; - nextnid++; - if (nextnid == numnodes) - nextnid = 0; + if (!next) next = pgdat_list; + temp = next; + next = next->node_next; spin_unlock_irqrestore(&node_lock, flags); #endif - startnode = tnode; - while (tnode < numnodes) { - if ((ret = alloc_pages_node(tnode++, gfp_mask, order))) + start = temp; + while (temp) { + if ((ret = alloc_pages_pgdat(temp, gfp_mask, order))) return(ret); + temp = temp->node_next; } - tnode = 0; - while (tnode != startnode) { - if ((ret = alloc_pages_node(tnode++, gfp_mask, order))) + temp = pgdat_list; + while (temp != start) { + if ((ret = alloc_pages_pgdat(temp, gfp_mask, order))) return(ret); + temp = temp->node_next; } return(0); } diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3846af8fed05..0a8aa7cf85e0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -17,13 +17,6 @@ #include #include -/* Use NUMNODES instead of numnodes for better code inside kernel APIs */ -#ifndef CONFIG_DISCONTIGMEM -#define NUMNODES 1 -#else -#define NUMNODES numnodes -#endif - int nr_swap_pages; int nr_active_pages; int nr_inactive_dirty_pages; @@ -588,12 +581,14 @@ unsigned int nr_free_pages (void) { unsigned int sum; zone_t *zone; - int i; + pg_data_t *pgdat = pgdat_list; sum = 0; - for (i = 0; i < NUMNODES; i++) - for (zone = NODE_DATA(i)->node_zones; zone < NODE_DATA(i)->node_zones + MAX_NR_ZONES; zone++) + while (pgdat) { + for (zone = pgdat->node_zones; zone < pgdat->node_zones + MAX_NR_ZONES; zone++) sum += zone->free_pages; + pgdat = pgdat->node_next; + } return sum; } @@ -604,12 +599,14 @@ unsigned int nr_inactive_clean_pages (void) { unsigned int sum; zone_t *zone; - int i; + pg_data_t *pgdat = pgdat_list; sum = 0; - for (i = 0; i < NUMNODES; i++) - for (zone = NODE_DATA(i)->node_zones; zone < NODE_DATA(i)->node_zones + MAX_NR_ZONES; zone++) + while (pgdat) { + for (zone = pgdat->node_zones; zone < pgdat->node_zones + MAX_NR_ZONES; zone++) sum += zone->inactive_clean_pages; + pgdat = pgdat->node_next; + } return sum; } @@ -644,11 +641,13 @@ unsigned int nr_free_buffer_pages (void) #if CONFIG_HIGHMEM unsigned int nr_free_highpages (void) { - int i; + pg_data_t *pgdat = pgdat_list; unsigned int pages = 0; - for (i = 0; i < NUMNODES; i++) - pages += NODE_DATA(i)->node_zones[ZONE_HIGHMEM].free_pages; + while (pgdat) { + pages += pgdat->node_zones[ZONE_HIGHMEM].free_pages; + pgdat = pgdat->node_next; + } return pages; } #endif @@ -658,7 +657,7 @@ unsigned int nr_free_highpages (void) * We also calculate the percentage fragmentation. We do this by counting the * memory on each free list with the exception of the first item on the list. */ -void show_free_areas_core(int nid) +void show_free_areas_core(pg_data_t *pgdat) { unsigned long order; unsigned type; @@ -678,7 +677,7 @@ void show_free_areas_core(int nid) for (type = 0; type < MAX_NR_ZONES; type++) { struct list_head *head, *curr; - zone_t *zone = NODE_DATA(nid)->node_zones + type; + zone_t *zone = pgdat->node_zones + type; unsigned long nr, total, flags; total = 0; @@ -710,7 +709,7 @@ void show_free_areas_core(int nid) void show_free_areas(void) { - show_free_areas_core(0); + show_free_areas_core(pgdat_list); } /* @@ -907,7 +906,7 @@ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, void __init free_area_init(unsigned long *zones_size) { - free_area_init_core(0, NODE_DATA(0), &mem_map, zones_size, 0, 0, 0); + free_area_init_core(0, &contig_page_data, &mem_map, zones_size, 0, 0, 0); } static int __init setup_mem_frac(char *str) diff --git a/mm/swapfile.c b/mm/swapfile.c index fa4cb133e99e..4cad5deab84c 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -315,12 +315,12 @@ static void unuse_process(struct mm_struct * mm, */ if (!mm) return; - vmlist_access_lock(mm); + spin_lock(&mm->page_table_lock); for (vma = mm->mmap; vma; vma = vma->vm_next) { pgd_t * pgd = pgd_offset(mm, vma->vm_start); unuse_vma(vma, pgd, entry, page); } - vmlist_access_unlock(mm); + spin_unlock(&mm->page_table_lock); return; } diff --git a/mm/vmscan.c b/mm/vmscan.c index ba745d8a963b..26fd18455896 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -172,7 +172,7 @@ drop_pte: pte_clear(page_table); mm->rss--; flush_tlb_page(vma, address); - vmlist_access_unlock(mm); + spin_unlock(&mm->page_table_lock); error = swapout(page, file); UnlockPage(page); if (file) fput(file); @@ -205,7 +205,7 @@ drop_pte: mm->rss--; set_pte(page_table, swp_entry_to_pte(entry)); flush_tlb_page(vma, address); - vmlist_access_unlock(mm); + spin_unlock(&mm->page_table_lock); /* OK, do a physical asynchronous write to swap. */ rw_swap_page(WRITE, page, 0); @@ -341,7 +341,7 @@ static int swap_out_mm(struct mm_struct * mm, int gfp_mask) * Find the proper vm-area after freezing the vma chain * and ptes. */ - vmlist_access_lock(mm); + spin_lock(&mm->page_table_lock); vma = find_vma(mm, address); if (vma) { if (address < vma->vm_start) @@ -364,7 +364,7 @@ static int swap_out_mm(struct mm_struct * mm, int gfp_mask) mm->swap_cnt = 0; out_unlock: - vmlist_access_unlock(mm); + spin_unlock(&mm->page_table_lock); /* We didn't find anything for the process */ return 0; diff --git a/net/ax25/Config.in b/net/ax25/Config.in index 2670528b32fb..b8e5d7333052 100644 --- a/net/ax25/Config.in +++ b/net/ax25/Config.in @@ -3,7 +3,7 @@ # # 19971130 Now in an own category to make correct compilation of the # AX.25 stuff easier... -# Joerg Reuter DL1BKE +# Joerg Reuter DL1BKE # 19980129 Moved to net/ax25/Config.in, sourcing device drivers. mainmenu_option next_comment diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index fc8910f2dee6..02874c103e23 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1193,7 +1193,7 @@ static int ax25_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le */ if (sk->zapped) { /* check if we can remove this feature. It is broken. */ - printk(KERN_WARNING "ax25_connect(): %s uses autobind, please contact jreuter@poboxes.com\n", + printk(KERN_WARNING "ax25_connect(): %s uses autobind, please contact jreuter@yaina.de\n", current->comm); if ((err = ax25_rt_autobind(sk->protinfo.ax25, &fsa->fsa_ax25.sax25_call)) < 0) return err; diff --git a/net/ax25/ax25_ds_in.c b/net/ax25/ax25_ds_in.c index 4641228235be..3354206dfb97 100644 --- a/net/ax25/ax25_ds_in.c +++ b/net/ax25/ax25_ds_in.c @@ -89,10 +89,8 @@ static int ax25_ds_state1_machine(ax25_cb *ax25, struct sk_buff *skb, int framet ax25_dama_on(ax25); /* according to DK4EG´s spec we are required to - * send a RR RESPONSE FINAL NR=0. Please mail - * if this causes problems - * with the TheNetNode DAMA Master implementation. - */ + * send a RR RESPONSE FINAL NR=0. + */ ax25_std_enquiry_response(ax25); break; diff --git a/net/core/dv.c b/net/core/dv.c index d60c980d99dc..62dc2890a07a 100644 --- a/net/core/dv.c +++ b/net/core/dv.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/net/socket.c b/net/socket.c index 9fdc84fb510a..5957514aac34 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1490,7 +1490,7 @@ out: /* * Perform a file control on a socket file descriptor. * - * Doesn't aquire a fd lock, because no network fcntl + * Doesn't acquire a fd lock, because no network fcntl * function sleeps currently. */ diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 7eb578a60b63..a295ecaf7ce3 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -159,7 +159,7 @@ rpcauth_insert_credcache(struct rpc_auth *auth, struct rpc_cred *cred) { int nr; - nr = (cred->cr_uid % RPC_CREDCACHE_NR); + nr = (cred->cr_uid & RPC_CREDCACHE_MASK); spin_lock(&rpc_credcache_lock); cred->cr_next = auth->au_credcache[nr]; auth->au_credcache[nr] = cred; @@ -178,7 +178,7 @@ rpcauth_lookup_credcache(struct rpc_auth *auth, int taskflags) int nr = 0; if (!(taskflags & RPC_TASK_ROOTCREDS)) - nr = current->uid % RPC_CREDCACHE_NR; + nr = current->uid & RPC_CREDCACHE_MASK; if (time_before(auth->au_nextgc, jiffies)) rpcauth_gc_credcache(auth); @@ -218,7 +218,7 @@ rpcauth_remove_credcache(struct rpc_auth *auth, struct rpc_cred *cred) struct rpc_cred **q, *cr; int nr; - nr = (cred->cr_uid % RPC_CREDCACHE_NR); + nr = (cred->cr_uid & RPC_CREDCACHE_MASK); spin_lock(&rpc_credcache_lock); q = &auth->au_credcache[nr]; while ((cr = *q) != NULL) { diff --git a/net/sunrpc/auth_null.c b/net/sunrpc/auth_null.c index d2e645acd26b..a9e42721a2c5 100644 --- a/net/sunrpc/auth_null.c +++ b/net/sunrpc/auth_null.c @@ -54,6 +54,7 @@ nul_create_cred(int flags) return NULL; cred->cr_count = 0; cred->cr_flags = RPCAUTH_CRED_UPTODATE; + cred->cr_uid = current->uid; return cred; }