diff options
199 files changed, 1780 insertions, 1133 deletions
diff --git a/Documentation/serial/driver b/Documentation/serial/driver index df82116a9f26..88ad615dd338 100644 --- a/Documentation/serial/driver +++ b/Documentation/serial/driver | |||
@@ -214,12 +214,13 @@ hardware. | |||
214 | The interaction of the iflag bits is as follows (parity error | 214 | The interaction of the iflag bits is as follows (parity error |
215 | given as an example): | 215 | given as an example): |
216 | Parity error INPCK IGNPAR | 216 | Parity error INPCK IGNPAR |
217 | None n/a n/a character received | 217 | n/a 0 n/a character received, marked as |
218 | Yes n/a 0 character discarded | ||
219 | Yes 0 1 character received, marked as | ||
220 | TTY_NORMAL | 218 | TTY_NORMAL |
221 | Yes 1 1 character received, marked as | 219 | None 1 n/a character received, marked as |
220 | TTY_NORMAL | ||
221 | Yes 1 0 character received, marked as | ||
222 | TTY_PARITY | 222 | TTY_PARITY |
223 | Yes 1 1 character discarded | ||
223 | 224 | ||
224 | Other flags may be used (eg, xon/xoff characters) if your | 225 | Other flags may be used (eg, xon/xoff characters) if your |
225 | hardware supports hardware "soft" flow control. | 226 | hardware supports hardware "soft" flow control. |
diff --git a/MAINTAINERS b/MAINTAINERS index 31c23e3a2de9..1421f74b6009 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -565,7 +565,19 @@ BROADBAND PROCESSOR ARCHITECTURE | |||
565 | P: Arnd Bergmann | 565 | P: Arnd Bergmann |
566 | M: arnd@arndb.de | 566 | M: arnd@arndb.de |
567 | L: linuxppc-dev@ozlabs.org | 567 | L: linuxppc-dev@ozlabs.org |
568 | W: http://linuxppc64.org | 568 | W: http://www.penguinppc.org/ppc64/ |
569 | S: Supported | ||
570 | |||
571 | BROADCOM BNX2 GIGABIT ETHERNET DRIVER | ||
572 | P: Michael Chan | ||
573 | M: mchan@broadcom.com | ||
574 | L: netdev@vger.kernel.org | ||
575 | S: Supported | ||
576 | |||
577 | BROADCOM TG3 GIGABIT ETHERNET DRIVER | ||
578 | P: Michael Chan | ||
579 | M: mchan@broadcom.com | ||
580 | L: netdev@vger.kernel.org | ||
569 | S: Supported | 581 | S: Supported |
570 | 582 | ||
571 | BTTV VIDEO4LINUX DRIVER | 583 | BTTV VIDEO4LINUX DRIVER |
@@ -1722,7 +1734,7 @@ M: paulus@au.ibm.com | |||
1722 | P: Anton Blanchard | 1734 | P: Anton Blanchard |
1723 | M: anton@samba.org | 1735 | M: anton@samba.org |
1724 | M: anton@au.ibm.com | 1736 | M: anton@au.ibm.com |
1725 | W: http://linuxppc64.org | 1737 | W: http://www.penguinppc.org/ppc64/ |
1726 | L: linuxppc-dev@ozlabs.org | 1738 | L: linuxppc-dev@ozlabs.org |
1727 | S: Supported | 1739 | S: Supported |
1728 | 1740 | ||
@@ -1883,6 +1895,11 @@ L: linux-kernel@vger.kernel.org | |||
1883 | W: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html | 1895 | W: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html |
1884 | S: Maintained | 1896 | S: Maintained |
1885 | 1897 | ||
1898 | MULTIMEDIA CARD SUBSYSTEM | ||
1899 | P: Russell King | ||
1900 | M: rmk+mmc@arm.linux.org.uk | ||
1901 | S: Maintained | ||
1902 | |||
1886 | MULTISOUND SOUND DRIVER | 1903 | MULTISOUND SOUND DRIVER |
1887 | P: Andrew Veliath | 1904 | P: Andrew Veliath |
1888 | M: andrewtv@usa.net | 1905 | M: andrewtv@usa.net |
@@ -1,8 +1,8 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 17 | 3 | SUBLEVEL = 17 |
4 | EXTRAVERSION =-rc5 | 4 | EXTRAVERSION =-rc6 |
5 | NAME=Lordi Rules | 5 | NAME=Crazed Snow-Weasel |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
8 | # To see a list of typical targets execute "make help" | 8 | # To see a list of typical targets execute "make help" |
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c index c645c5e14786..2b245ad731ee 100644 --- a/arch/alpha/kernel/alpha_ksyms.c +++ b/arch/alpha/kernel/alpha_ksyms.c | |||
@@ -182,7 +182,6 @@ EXPORT_SYMBOL(smp_num_cpus); | |||
182 | EXPORT_SYMBOL(smp_call_function); | 182 | EXPORT_SYMBOL(smp_call_function); |
183 | EXPORT_SYMBOL(smp_call_function_on_cpu); | 183 | EXPORT_SYMBOL(smp_call_function_on_cpu); |
184 | EXPORT_SYMBOL(_atomic_dec_and_lock); | 184 | EXPORT_SYMBOL(_atomic_dec_and_lock); |
185 | EXPORT_SYMBOL(cpu_present_mask); | ||
186 | #endif /* CONFIG_SMP */ | 185 | #endif /* CONFIG_SMP */ |
187 | 186 | ||
188 | /* | 187 | /* |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 9924fd07743a..c760a831fd1a 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -94,7 +94,7 @@ common_shutdown_1(void *generic_ptr) | |||
94 | if (cpuid != boot_cpuid) { | 94 | if (cpuid != boot_cpuid) { |
95 | flags |= 0x00040000UL; /* "remain halted" */ | 95 | flags |= 0x00040000UL; /* "remain halted" */ |
96 | *pflags = flags; | 96 | *pflags = flags; |
97 | clear_bit(cpuid, &cpu_present_mask); | 97 | cpu_clear(cpuid, cpu_present_map); |
98 | halt(); | 98 | halt(); |
99 | } | 99 | } |
100 | #endif | 100 | #endif |
@@ -120,8 +120,8 @@ common_shutdown_1(void *generic_ptr) | |||
120 | 120 | ||
121 | #ifdef CONFIG_SMP | 121 | #ifdef CONFIG_SMP |
122 | /* Wait for the secondaries to halt. */ | 122 | /* Wait for the secondaries to halt. */ |
123 | cpu_clear(boot_cpuid, cpu_possible_map); | 123 | cpu_clear(boot_cpuid, cpu_present_map); |
124 | while (cpus_weight(cpu_possible_map)) | 124 | while (cpus_weight(cpu_present_map)) |
125 | barrier(); | 125 | barrier(); |
126 | #endif | 126 | #endif |
127 | 127 | ||
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 185255416e85..4dc273e537fd 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -68,7 +68,6 @@ enum ipi_message_type { | |||
68 | static int smp_secondary_alive __initdata = 0; | 68 | static int smp_secondary_alive __initdata = 0; |
69 | 69 | ||
70 | /* Which cpus ids came online. */ | 70 | /* Which cpus ids came online. */ |
71 | cpumask_t cpu_present_mask; | ||
72 | cpumask_t cpu_online_map; | 71 | cpumask_t cpu_online_map; |
73 | 72 | ||
74 | EXPORT_SYMBOL(cpu_online_map); | 73 | EXPORT_SYMBOL(cpu_online_map); |
@@ -439,7 +438,7 @@ setup_smp(void) | |||
439 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 438 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
440 | smp_num_probed++; | 439 | smp_num_probed++; |
441 | /* Assume here that "whami" == index */ | 440 | /* Assume here that "whami" == index */ |
442 | cpu_set(i, cpu_present_mask); | 441 | cpu_set(i, cpu_present_map); |
443 | cpu->pal_revision = boot_cpu_palrev; | 442 | cpu->pal_revision = boot_cpu_palrev; |
444 | } | 443 | } |
445 | 444 | ||
@@ -450,11 +449,10 @@ setup_smp(void) | |||
450 | } | 449 | } |
451 | } else { | 450 | } else { |
452 | smp_num_probed = 1; | 451 | smp_num_probed = 1; |
453 | cpu_set(boot_cpuid, cpu_present_mask); | ||
454 | } | 452 | } |
455 | 453 | ||
456 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", | 454 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_map = %lx\n", |
457 | smp_num_probed, cpu_possible_map.bits[0]); | 455 | smp_num_probed, cpu_present_map.bits[0]); |
458 | } | 456 | } |
459 | 457 | ||
460 | /* | 458 | /* |
@@ -473,7 +471,7 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
473 | 471 | ||
474 | /* Nothing to do on a UP box, or when told not to. */ | 472 | /* Nothing to do on a UP box, or when told not to. */ |
475 | if (smp_num_probed == 1 || max_cpus == 0) { | 473 | if (smp_num_probed == 1 || max_cpus == 0) { |
476 | cpu_present_mask = cpumask_of_cpu(boot_cpuid); | 474 | cpu_present_map = cpumask_of_cpu(boot_cpuid); |
477 | printk(KERN_INFO "SMP mode deactivated.\n"); | 475 | printk(KERN_INFO "SMP mode deactivated.\n"); |
478 | return; | 476 | return; |
479 | } | 477 | } |
@@ -486,10 +484,6 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
486 | void __devinit | 484 | void __devinit |
487 | smp_prepare_boot_cpu(void) | 485 | smp_prepare_boot_cpu(void) |
488 | { | 486 | { |
489 | /* | ||
490 | * Mark the boot cpu (current cpu) as online | ||
491 | */ | ||
492 | cpu_set(smp_processor_id(), cpu_online_map); | ||
493 | } | 487 | } |
494 | 488 | ||
495 | int __devinit | 489 | int __devinit |
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 5f84417eeb7b..2551fb49ae09 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c | |||
@@ -66,7 +66,7 @@ titan_update_irq_hw(unsigned long mask) | |||
66 | register int bcpu = boot_cpuid; | 66 | register int bcpu = boot_cpuid; |
67 | 67 | ||
68 | #ifdef CONFIG_SMP | 68 | #ifdef CONFIG_SMP |
69 | cpumask_t cpm = cpu_present_mask; | 69 | cpumask_t cpm = cpu_present_map; |
70 | volatile unsigned long *dim0, *dim1, *dim2, *dim3; | 70 | volatile unsigned long *dim0, *dim1, *dim2, *dim3; |
71 | unsigned long mask0, mask1, mask2, mask3, dummy; | 71 | unsigned long mask0, mask1, mask2, mask3, dummy; |
72 | 72 | ||
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 5d3acff8c596..d22f38b957db 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -101,7 +101,7 @@ config DEBUG_S3C2410_UART | |||
101 | help | 101 | help |
102 | Choice for UART for kernel low-level using S3C2410 UARTS, | 102 | Choice for UART for kernel low-level using S3C2410 UARTS, |
103 | should be between zero and two. The port must have been | 103 | should be between zero and two. The port must have been |
104 | initalised by the boot-loader before use. | 104 | initialised by the boot-loader before use. |
105 | 105 | ||
106 | The uncompressor code port configuration is now handled | 106 | The uncompressor code port configuration is now handled |
107 | by CONFIG_S3C2410_LOWLEVEL_UART_PORT. | 107 | by CONFIG_S3C2410_LOWLEVEL_UART_PORT. |
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c index 092ee12ced42..affd1d5d7440 100644 --- a/arch/arm/mach-ixp23xx/core.c +++ b/arch/arm/mach-ixp23xx/core.c | |||
@@ -178,8 +178,12 @@ static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type) | |||
178 | 178 | ||
179 | static void ixp23xx_irq_mask(unsigned int irq) | 179 | static void ixp23xx_irq_mask(unsigned int irq) |
180 | { | 180 | { |
181 | volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); | 181 | volatile unsigned long *intr_reg; |
182 | 182 | ||
183 | if (irq >= 56) | ||
184 | irq += 8; | ||
185 | |||
186 | intr_reg = IXP23XX_INTR_EN1 + (irq / 32); | ||
183 | *intr_reg &= ~(1 << (irq % 32)); | 187 | *intr_reg &= ~(1 << (irq % 32)); |
184 | } | 188 | } |
185 | 189 | ||
@@ -199,17 +203,25 @@ static void ixp23xx_irq_ack(unsigned int irq) | |||
199 | */ | 203 | */ |
200 | static void ixp23xx_irq_level_unmask(unsigned int irq) | 204 | static void ixp23xx_irq_level_unmask(unsigned int irq) |
201 | { | 205 | { |
202 | volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); | 206 | volatile unsigned long *intr_reg; |
203 | 207 | ||
204 | ixp23xx_irq_ack(irq); | 208 | ixp23xx_irq_ack(irq); |
205 | 209 | ||
210 | if (irq >= 56) | ||
211 | irq += 8; | ||
212 | |||
213 | intr_reg = IXP23XX_INTR_EN1 + (irq / 32); | ||
206 | *intr_reg |= (1 << (irq % 32)); | 214 | *intr_reg |= (1 << (irq % 32)); |
207 | } | 215 | } |
208 | 216 | ||
209 | static void ixp23xx_irq_edge_unmask(unsigned int irq) | 217 | static void ixp23xx_irq_edge_unmask(unsigned int irq) |
210 | { | 218 | { |
211 | volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); | 219 | volatile unsigned long *intr_reg; |
220 | |||
221 | if (irq >= 56) | ||
222 | irq += 8; | ||
212 | 223 | ||
224 | intr_reg = IXP23XX_INTR_EN1 + (irq / 32); | ||
213 | *intr_reg |= (1 << (irq % 32)); | 225 | *intr_reg |= (1 << (irq % 32)); |
214 | } | 226 | } |
215 | 227 | ||
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig index 2a39f9e481ad..3b23f43cb160 100644 --- a/arch/arm/mach-ixp4xx/Kconfig +++ b/arch/arm/mach-ixp4xx/Kconfig | |||
@@ -141,7 +141,7 @@ config IXP4XX_INDIRECT_PCI | |||
141 | 2) If > 64MB of memory space is required, the IXP4xx can be | 141 | 2) If > 64MB of memory space is required, the IXP4xx can be |
142 | configured to use indirect registers to access PCI This allows | 142 | configured to use indirect registers to access PCI This allows |
143 | for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. | 143 | for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. |
144 | The disadvantadge of this is that every PCI access requires | 144 | The disadvantage of this is that every PCI access requires |
145 | three local register accesses plus a spinlock, but in some | 145 | three local register accesses plus a spinlock, but in some |
146 | cases the performance hit is acceptable. In addition, you cannot | 146 | cases the performance hit is acceptable. In addition, you cannot |
147 | mmap() PCI devices in this case due to the indirect nature | 147 | mmap() PCI devices in this case due to the indirect nature |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 02e188d98e7d..b307f11951df 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -493,6 +493,7 @@ static void __init mainstone_map_io(void) | |||
493 | MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") | 493 | MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") |
494 | /* Maintainer: MontaVista Software Inc. */ | 494 | /* Maintainer: MontaVista Software Inc. */ |
495 | .phys_io = 0x40000000, | 495 | .phys_io = 0x40000000, |
496 | .boot_params = 0xa0000100, /* BLOB boot parameter setting */ | ||
496 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 497 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
497 | .map_io = mainstone_map_io, | 498 | .map_io = mainstone_map_io, |
498 | .init_irq = mainstone_init_irq, | 499 | .init_irq = mainstone_init_irq, |
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig index ce7d81000695..970f98dadffc 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig | |||
@@ -170,7 +170,7 @@ config S3C2410_PM_DEBUG | |||
170 | depends on ARCH_S3C2410 && PM | 170 | depends on ARCH_S3C2410 && PM |
171 | help | 171 | help |
172 | Say Y here if you want verbose debugging from the PM Suspend and | 172 | Say Y here if you want verbose debugging from the PM Suspend and |
173 | Resume code. See `Documentation/arm/Samsing-S3C24XX/Suspend.txt` | 173 | Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt> |
174 | for more information. | 174 | for more information. |
175 | 175 | ||
176 | config S3C2410_PM_CHECK | 176 | config S3C2410_PM_CHECK |
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index f14b2d0f3690..95273de4f772 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c | |||
@@ -376,7 +376,7 @@ void __init build_mem_type_table(void) | |||
376 | ecc_mask = 0; | 376 | ecc_mask = 0; |
377 | } | 377 | } |
378 | 378 | ||
379 | if (cpu_arch <= CPU_ARCH_ARMv5TEJ) { | 379 | if (cpu_arch <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) { |
380 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { | 380 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { |
381 | if (mem_types[i].prot_l1) | 381 | if (mem_types[i].prot_l1) |
382 | mem_types[i].prot_l1 |= PMD_BIT4; | 382 | mem_types[i].prot_l1 |= PMD_BIT4; |
@@ -631,7 +631,7 @@ void setup_mm_for_reboot(char mode) | |||
631 | pgd = init_mm.pgd; | 631 | pgd = init_mm.pgd; |
632 | 632 | ||
633 | base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT; | 633 | base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT; |
634 | if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ) | 634 | if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) |
635 | base_pmdval |= PMD_BIT4; | 635 | base_pmdval |= PMD_BIT4; |
636 | 636 | ||
637 | for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) { | 637 | for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) { |
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S index 80873b36c3f7..8d32e21fe151 100644 --- a/arch/arm/mm/proc-xsc3.S +++ b/arch/arm/mm/proc-xsc3.S | |||
@@ -427,12 +427,13 @@ __xsc3_setup: | |||
427 | #endif | 427 | #endif |
428 | mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg | 428 | mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg |
429 | mrc p15, 0, r0, c1, c0, 0 @ get control register | 429 | mrc p15, 0, r0, c1, c0, 0 @ get control register |
430 | bic r0, r0, #0x0200 @ .... ..R. .... .... | ||
431 | bic r0, r0, #0x0002 @ .... .... .... ..A. | 430 | bic r0, r0, #0x0002 @ .... .... .... ..A. |
432 | orr r0, r0, #0x0005 @ .... .... .... .C.M | 431 | orr r0, r0, #0x0005 @ .... .... .... .C.M |
433 | #if BTB_ENABLE | 432 | #if BTB_ENABLE |
433 | bic r0, r0, #0x0200 @ .... ..R. .... .... | ||
434 | orr r0, r0, #0x3900 @ ..VI Z..S .... .... | 434 | orr r0, r0, #0x3900 @ ..VI Z..S .... .... |
435 | #else | 435 | #else |
436 | bic r0, r0, #0x0a00 @ .... Z.R. .... .... | ||
436 | orr r0, r0, #0x3100 @ ..VI ...S .... .... | 437 | orr r0, r0, #0x3100 @ ..VI ...S .... .... |
437 | #endif | 438 | #endif |
438 | #if L2_CACHE_ENABLE | 439 | #if L2_CACHE_ENABLE |
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index daee69579b1c..40e5aba3ad3d 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -1066,14 +1066,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { | |||
1066 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), | 1066 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), |
1067 | }, | 1067 | }, |
1068 | }, | 1068 | }, |
1069 | { | ||
1070 | .callback = disable_acpi_pci, | ||
1071 | .ident = "HP xw9300", | ||
1072 | .matches = { | ||
1073 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
1074 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw9300 Workstation"), | ||
1075 | }, | ||
1076 | }, | ||
1077 | {} | 1069 | {} |
1078 | }; | 1070 | }; |
1079 | 1071 | ||
diff --git a/arch/i386/mach-generic/probe.c b/arch/i386/mach-generic/probe.c index cea5b3ce4b57..d55fa7b187ab 100644 --- a/arch/i386/mach-generic/probe.c +++ b/arch/i386/mach-generic/probe.c | |||
@@ -93,9 +93,11 @@ int __init mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid | |||
93 | int i; | 93 | int i; |
94 | for (i = 0; apic_probe[i]; ++i) { | 94 | for (i = 0; apic_probe[i]; ++i) { |
95 | if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) { | 95 | if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) { |
96 | genapic = apic_probe[i]; | 96 | if (!cmdline_apic) { |
97 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | 97 | genapic = apic_probe[i]; |
98 | genapic->name); | 98 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", |
99 | genapic->name); | ||
100 | } | ||
99 | return 1; | 101 | return 1; |
100 | } | 102 | } |
101 | } | 103 | } |
@@ -107,9 +109,11 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
107 | int i; | 109 | int i; |
108 | for (i = 0; apic_probe[i]; ++i) { | 110 | for (i = 0; apic_probe[i]; ++i) { |
109 | if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { | 111 | if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { |
110 | genapic = apic_probe[i]; | 112 | if (!cmdline_apic) { |
111 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | 113 | genapic = apic_probe[i]; |
112 | genapic->name); | 114 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", |
115 | genapic->name); | ||
116 | } | ||
113 | return 1; | 117 | return 1; |
114 | } | 118 | } |
115 | } | 119 | } |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index ee5fbb02b28f..e8ff09fe73d9 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -13,7 +13,7 @@ choice | |||
13 | default SGI_IP22 | 13 | default SGI_IP22 |
14 | 14 | ||
15 | config MIPS_MTX1 | 15 | config MIPS_MTX1 |
16 | bool "Support for 4G Systems MTX-1 board" | 16 | bool "4G Systems MTX-1 board" |
17 | select DMA_NONCOHERENT | 17 | select DMA_NONCOHERENT |
18 | select HW_HAS_PCI | 18 | select HW_HAS_PCI |
19 | select SOC_AU1500 | 19 | select SOC_AU1500 |
@@ -120,7 +120,7 @@ config MIPS_MIRAGE | |||
120 | select SYS_SUPPORTS_LITTLE_ENDIAN | 120 | select SYS_SUPPORTS_LITTLE_ENDIAN |
121 | 121 | ||
122 | config MIPS_COBALT | 122 | config MIPS_COBALT |
123 | bool "Support for Cobalt Server" | 123 | bool "Cobalt Server" |
124 | select DMA_NONCOHERENT | 124 | select DMA_NONCOHERENT |
125 | select HW_HAS_PCI | 125 | select HW_HAS_PCI |
126 | select I8259 | 126 | select I8259 |
@@ -132,7 +132,7 @@ config MIPS_COBALT | |||
132 | select SYS_SUPPORTS_LITTLE_ENDIAN | 132 | select SYS_SUPPORTS_LITTLE_ENDIAN |
133 | 133 | ||
134 | config MACH_DECSTATION | 134 | config MACH_DECSTATION |
135 | bool "Support for DECstations" | 135 | bool "DECstations" |
136 | select BOOT_ELF32 | 136 | select BOOT_ELF32 |
137 | select DMA_NONCOHERENT | 137 | select DMA_NONCOHERENT |
138 | select EARLY_PRINTK | 138 | select EARLY_PRINTK |
@@ -158,7 +158,7 @@ config MACH_DECSTATION | |||
158 | otherwise choose R3000. | 158 | otherwise choose R3000. |
159 | 159 | ||
160 | config MIPS_EV64120 | 160 | config MIPS_EV64120 |
161 | bool "Support for Galileo EV64120 Evaluation board (EXPERIMENTAL)" | 161 | bool "Galileo EV64120 Evaluation board (EXPERIMENTAL)" |
162 | depends on EXPERIMENTAL | 162 | depends on EXPERIMENTAL |
163 | select DMA_NONCOHERENT | 163 | select DMA_NONCOHERENT |
164 | select HW_HAS_PCI | 164 | select HW_HAS_PCI |
@@ -175,7 +175,7 @@ config MIPS_EV64120 | |||
175 | kernel for this platform. | 175 | kernel for this platform. |
176 | 176 | ||
177 | config MIPS_EV96100 | 177 | config MIPS_EV96100 |
178 | bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)" | 178 | bool "Galileo EV96100 Evaluation board (EXPERIMENTAL)" |
179 | depends on EXPERIMENTAL | 179 | depends on EXPERIMENTAL |
180 | select DMA_NONCOHERENT | 180 | select DMA_NONCOHERENT |
181 | select HW_HAS_PCI | 181 | select HW_HAS_PCI |
@@ -195,7 +195,7 @@ config MIPS_EV96100 | |||
195 | here if you wish to build a kernel for this platform. | 195 | here if you wish to build a kernel for this platform. |
196 | 196 | ||
197 | config MIPS_IVR | 197 | config MIPS_IVR |
198 | bool "Support for Globespan IVR board" | 198 | bool "Globespan IVR board" |
199 | select DMA_NONCOHERENT | 199 | select DMA_NONCOHERENT |
200 | select HW_HAS_PCI | 200 | select HW_HAS_PCI |
201 | select ITE_BOARD_GEN | 201 | select ITE_BOARD_GEN |
@@ -211,7 +211,7 @@ config MIPS_IVR | |||
211 | build a kernel for this platform. | 211 | build a kernel for this platform. |
212 | 212 | ||
213 | config MIPS_ITE8172 | 213 | config MIPS_ITE8172 |
214 | bool "Support for ITE 8172G board" | 214 | bool "ITE 8172G board" |
215 | select DMA_NONCOHERENT | 215 | select DMA_NONCOHERENT |
216 | select HW_HAS_PCI | 216 | select HW_HAS_PCI |
217 | select ITE_BOARD_GEN | 217 | select ITE_BOARD_GEN |
@@ -228,7 +228,7 @@ config MIPS_ITE8172 | |||
228 | a kernel for this platform. | 228 | a kernel for this platform. |
229 | 229 | ||
230 | config MACH_JAZZ | 230 | config MACH_JAZZ |
231 | bool "Support for the Jazz family of machines" | 231 | bool "Jazz family of machines" |
232 | select ARC | 232 | select ARC |
233 | select ARC32 | 233 | select ARC32 |
234 | select ARCH_MAY_HAVE_PC_FDC | 234 | select ARCH_MAY_HAVE_PC_FDC |
@@ -246,7 +246,7 @@ config MACH_JAZZ | |||
246 | Olivetti M700-10 workstations. | 246 | Olivetti M700-10 workstations. |
247 | 247 | ||
248 | config LASAT | 248 | config LASAT |
249 | bool "Support for LASAT Networks platforms" | 249 | bool "LASAT Networks platforms" |
250 | select DMA_NONCOHERENT | 250 | select DMA_NONCOHERENT |
251 | select HW_HAS_PCI | 251 | select HW_HAS_PCI |
252 | select MIPS_GT64120 | 252 | select MIPS_GT64120 |
@@ -258,7 +258,7 @@ config LASAT | |||
258 | select SYS_SUPPORTS_LITTLE_ENDIAN | 258 | select SYS_SUPPORTS_LITTLE_ENDIAN |
259 | 259 | ||
260 | config MIPS_ATLAS | 260 | config MIPS_ATLAS |
261 | bool "Support for MIPS Atlas board" | 261 | bool "MIPS Atlas board" |
262 | select BOOT_ELF32 | 262 | select BOOT_ELF32 |
263 | select DMA_NONCOHERENT | 263 | select DMA_NONCOHERENT |
264 | select IRQ_CPU | 264 | select IRQ_CPU |
@@ -283,7 +283,7 @@ config MIPS_ATLAS | |||
283 | board. | 283 | board. |
284 | 284 | ||
285 | config MIPS_MALTA | 285 | config MIPS_MALTA |
286 | bool "Support for MIPS Malta board" | 286 | bool "MIPS Malta board" |
287 | select ARCH_MAY_HAVE_PC_FDC | 287 | select ARCH_MAY_HAVE_PC_FDC |
288 | select BOOT_ELF32 | 288 | select BOOT_ELF32 |
289 | select HAVE_STD_PC_SERIAL_PORT | 289 | select HAVE_STD_PC_SERIAL_PORT |
@@ -311,7 +311,7 @@ config MIPS_MALTA | |||
311 | board. | 311 | board. |
312 | 312 | ||
313 | config MIPS_SEAD | 313 | config MIPS_SEAD |
314 | bool "Support for MIPS SEAD board (EXPERIMENTAL)" | 314 | bool "MIPS SEAD board (EXPERIMENTAL)" |
315 | depends on EXPERIMENTAL | 315 | depends on EXPERIMENTAL |
316 | select IRQ_CPU | 316 | select IRQ_CPU |
317 | select DMA_NONCOHERENT | 317 | select DMA_NONCOHERENT |
@@ -328,7 +328,7 @@ config MIPS_SEAD | |||
328 | board. | 328 | board. |
329 | 329 | ||
330 | config MIPS_SIM | 330 | config MIPS_SIM |
331 | bool 'Support for MIPS simulator (MIPSsim)' | 331 | bool 'MIPS simulator (MIPSsim)' |
332 | select DMA_NONCOHERENT | 332 | select DMA_NONCOHERENT |
333 | select IRQ_CPU | 333 | select IRQ_CPU |
334 | select SYS_HAS_CPU_MIPS32_R1 | 334 | select SYS_HAS_CPU_MIPS32_R1 |
@@ -341,7 +341,7 @@ config MIPS_SIM | |||
341 | emulator. | 341 | emulator. |
342 | 342 | ||
343 | config MOMENCO_JAGUAR_ATX | 343 | config MOMENCO_JAGUAR_ATX |
344 | bool "Support for Momentum Jaguar board" | 344 | bool "Momentum Jaguar board" |
345 | select BOOT_ELF32 | 345 | select BOOT_ELF32 |
346 | select DMA_NONCOHERENT | 346 | select DMA_NONCOHERENT |
347 | select HW_HAS_PCI | 347 | select HW_HAS_PCI |
@@ -361,7 +361,7 @@ config MOMENCO_JAGUAR_ATX | |||
361 | Momentum Computer <http://www.momenco.com/>. | 361 | Momentum Computer <http://www.momenco.com/>. |
362 | 362 | ||
363 | config MOMENCO_OCELOT | 363 | config MOMENCO_OCELOT |
364 | bool "Support for Momentum Ocelot board" | 364 | bool "Momentum Ocelot board" |
365 | select DMA_NONCOHERENT | 365 | select DMA_NONCOHERENT |
366 | select HW_HAS_PCI | 366 | select HW_HAS_PCI |
367 | select IRQ_CPU | 367 | select IRQ_CPU |
@@ -378,7 +378,7 @@ config MOMENCO_OCELOT | |||
378 | Momentum Computer <http://www.momenco.com/>. | 378 | Momentum Computer <http://www.momenco.com/>. |
379 | 379 | ||
380 | config MOMENCO_OCELOT_3 | 380 | config MOMENCO_OCELOT_3 |
381 | bool "Support for Momentum Ocelot-3 board" | 381 | bool "Momentum Ocelot-3 board" |
382 | select BOOT_ELF32 | 382 | select BOOT_ELF32 |
383 | select DMA_NONCOHERENT | 383 | select DMA_NONCOHERENT |
384 | select HW_HAS_PCI | 384 | select HW_HAS_PCI |
@@ -397,7 +397,7 @@ config MOMENCO_OCELOT_3 | |||
397 | PMC-Sierra Rm79000 core. | 397 | PMC-Sierra Rm79000 core. |
398 | 398 | ||
399 | config MOMENCO_OCELOT_C | 399 | config MOMENCO_OCELOT_C |
400 | bool "Support for Momentum Ocelot-C board" | 400 | bool "Momentum Ocelot-C board" |
401 | select DMA_NONCOHERENT | 401 | select DMA_NONCOHERENT |
402 | select HW_HAS_PCI | 402 | select HW_HAS_PCI |
403 | select IRQ_CPU | 403 | select IRQ_CPU |
@@ -414,7 +414,7 @@ config MOMENCO_OCELOT_C | |||
414 | Momentum Computer <http://www.momenco.com/>. | 414 | Momentum Computer <http://www.momenco.com/>. |
415 | 415 | ||
416 | config MOMENCO_OCELOT_G | 416 | config MOMENCO_OCELOT_G |
417 | bool "Support for Momentum Ocelot-G board" | 417 | bool "Momentum Ocelot-G board" |
418 | select DMA_NONCOHERENT | 418 | select DMA_NONCOHERENT |
419 | select HW_HAS_PCI | 419 | select HW_HAS_PCI |
420 | select IRQ_CPU | 420 | select IRQ_CPU |
@@ -431,23 +431,23 @@ config MOMENCO_OCELOT_G | |||
431 | Momentum Computer <http://www.momenco.com/>. | 431 | Momentum Computer <http://www.momenco.com/>. |
432 | 432 | ||
433 | config MIPS_XXS1500 | 433 | config MIPS_XXS1500 |
434 | bool "Support for MyCable XXS1500 board" | 434 | bool "MyCable XXS1500 board" |
435 | select DMA_NONCOHERENT | 435 | select DMA_NONCOHERENT |
436 | select SOC_AU1500 | 436 | select SOC_AU1500 |
437 | select SYS_SUPPORTS_LITTLE_ENDIAN | 437 | select SYS_SUPPORTS_LITTLE_ENDIAN |
438 | 438 | ||
439 | config PNX8550_V2PCI | 439 | config PNX8550_V2PCI |
440 | bool "Support for Philips PNX8550 based Viper2-PCI board" | 440 | bool "Philips PNX8550 based Viper2-PCI board" |
441 | select PNX8550 | 441 | select PNX8550 |
442 | select SYS_SUPPORTS_LITTLE_ENDIAN | 442 | select SYS_SUPPORTS_LITTLE_ENDIAN |
443 | 443 | ||
444 | config PNX8550_JBS | 444 | config PNX8550_JBS |
445 | bool "Support for Philips PNX8550 based JBS board" | 445 | bool "Philips PNX8550 based JBS board" |
446 | select PNX8550 | 446 | select PNX8550 |
447 | select SYS_SUPPORTS_LITTLE_ENDIAN | 447 | select SYS_SUPPORTS_LITTLE_ENDIAN |
448 | 448 | ||
449 | config DDB5074 | 449 | config DDB5074 |
450 | bool "Support for NEC DDB Vrc-5074 (EXPERIMENTAL)" | 450 | bool "NEC DDB Vrc-5074 (EXPERIMENTAL)" |
451 | depends on EXPERIMENTAL | 451 | depends on EXPERIMENTAL |
452 | select DDB5XXX_COMMON | 452 | select DDB5XXX_COMMON |
453 | select DMA_NONCOHERENT | 453 | select DMA_NONCOHERENT |
@@ -465,7 +465,7 @@ config DDB5074 | |||
465 | evaluation board. | 465 | evaluation board. |
466 | 466 | ||
467 | config DDB5476 | 467 | config DDB5476 |
468 | bool "Support for NEC DDB Vrc-5476" | 468 | bool "NEC DDB Vrc-5476" |
469 | select DDB5XXX_COMMON | 469 | select DDB5XXX_COMMON |
470 | select DMA_NONCOHERENT | 470 | select DMA_NONCOHERENT |
471 | select HAVE_STD_PC_SERIAL_PORT | 471 | select HAVE_STD_PC_SERIAL_PORT |
@@ -486,7 +486,7 @@ config DDB5476 | |||
486 | IDE controller, PS2 keyboard, PS2 mouse, etc. | 486 | IDE controller, PS2 keyboard, PS2 mouse, etc. |
487 | 487 | ||
488 | config DDB5477 | 488 | config DDB5477 |
489 | bool "Support for NEC DDB Vrc-5477" | 489 | bool "NEC DDB Vrc-5477" |
490 | select DDB5XXX_COMMON | 490 | select DDB5XXX_COMMON |
491 | select DMA_NONCOHERENT | 491 | select DMA_NONCOHERENT |
492 | select HW_HAS_PCI | 492 | select HW_HAS_PCI |
@@ -504,13 +504,13 @@ config DDB5477 | |||
504 | ether port USB, AC97, PCI, etc. | 504 | ether port USB, AC97, PCI, etc. |
505 | 505 | ||
506 | config MACH_VR41XX | 506 | config MACH_VR41XX |
507 | bool "Support for NEC VR4100 series based machines" | 507 | bool "NEC VR41XX-based machines" |
508 | select SYS_HAS_CPU_VR41XX | 508 | select SYS_HAS_CPU_VR41XX |
509 | select SYS_SUPPORTS_32BIT_KERNEL | 509 | select SYS_SUPPORTS_32BIT_KERNEL |
510 | select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL | 510 | select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL |
511 | 511 | ||
512 | config PMC_YOSEMITE | 512 | config PMC_YOSEMITE |
513 | bool "Support for PMC-Sierra Yosemite eval board" | 513 | bool "PMC-Sierra Yosemite eval board" |
514 | select DMA_COHERENT | 514 | select DMA_COHERENT |
515 | select HW_HAS_PCI | 515 | select HW_HAS_PCI |
516 | select IRQ_CPU | 516 | select IRQ_CPU |
@@ -527,7 +527,7 @@ config PMC_YOSEMITE | |||
527 | manufactured by PMC-Sierra. | 527 | manufactured by PMC-Sierra. |
528 | 528 | ||
529 | config QEMU | 529 | config QEMU |
530 | bool "Support for Qemu" | 530 | bool "Qemu" |
531 | select DMA_COHERENT | 531 | select DMA_COHERENT |
532 | select GENERIC_ISA_DMA | 532 | select GENERIC_ISA_DMA |
533 | select HAVE_STD_PC_SERIAL_PORT | 533 | select HAVE_STD_PC_SERIAL_PORT |
@@ -547,7 +547,7 @@ config QEMU | |||
547 | can be found at http://www.linux-mips.org/wiki/Qemu. | 547 | can be found at http://www.linux-mips.org/wiki/Qemu. |
548 | 548 | ||
549 | config SGI_IP22 | 549 | config SGI_IP22 |
550 | bool "Support for SGI IP22 (Indy/Indigo2)" | 550 | bool "SGI IP22 (Indy/Indigo2)" |
551 | select ARC | 551 | select ARC |
552 | select ARC32 | 552 | select ARC32 |
553 | select BOOT_ELF32 | 553 | select BOOT_ELF32 |
@@ -567,7 +567,7 @@ config SGI_IP22 | |||
567 | that runs on these, say Y here. | 567 | that runs on these, say Y here. |
568 | 568 | ||
569 | config SGI_IP27 | 569 | config SGI_IP27 |
570 | bool "Support for SGI IP27 (Origin200/2000)" | 570 | bool "SGI IP27 (Origin200/2000)" |
571 | select ARC | 571 | select ARC |
572 | select ARC64 | 572 | select ARC64 |
573 | select BOOT_ELF64 | 573 | select BOOT_ELF64 |
@@ -583,7 +583,7 @@ config SGI_IP27 | |||
583 | here. | 583 | here. |
584 | 584 | ||
585 | config SGI_IP32 | 585 | config SGI_IP32 |
586 | bool "Support for SGI IP32 (O2) (EXPERIMENTAL)" | 586 | bool "SGI IP32 (O2) (EXPERIMENTAL)" |
587 | depends on EXPERIMENTAL | 587 | depends on EXPERIMENTAL |
588 | select ARC | 588 | select ARC |
589 | select ARC32 | 589 | select ARC32 |
@@ -604,7 +604,7 @@ config SGI_IP32 | |||
604 | If you want this kernel to run on SGI O2 workstation, say Y here. | 604 | If you want this kernel to run on SGI O2 workstation, say Y here. |
605 | 605 | ||
606 | config SIBYTE_BIGSUR | 606 | config SIBYTE_BIGSUR |
607 | bool "Support for Sibyte BCM91480B-BigSur" | 607 | bool "Sibyte BCM91480B-BigSur" |
608 | select BOOT_ELF32 | 608 | select BOOT_ELF32 |
609 | select DMA_COHERENT | 609 | select DMA_COHERENT |
610 | select PCI_DOMAINS | 610 | select PCI_DOMAINS |
@@ -615,7 +615,7 @@ config SIBYTE_BIGSUR | |||
615 | select SYS_SUPPORTS_LITTLE_ENDIAN | 615 | select SYS_SUPPORTS_LITTLE_ENDIAN |
616 | 616 | ||
617 | config SIBYTE_SWARM | 617 | config SIBYTE_SWARM |
618 | bool "Support for Sibyte BCM91250A-SWARM" | 618 | bool "Sibyte BCM91250A-SWARM" |
619 | select BOOT_ELF32 | 619 | select BOOT_ELF32 |
620 | select DMA_COHERENT | 620 | select DMA_COHERENT |
621 | select SIBYTE_SB1250 | 621 | select SIBYTE_SB1250 |
@@ -626,7 +626,7 @@ config SIBYTE_SWARM | |||
626 | select SYS_SUPPORTS_LITTLE_ENDIAN | 626 | select SYS_SUPPORTS_LITTLE_ENDIAN |
627 | 627 | ||
628 | config SIBYTE_SENTOSA | 628 | config SIBYTE_SENTOSA |
629 | bool "Support for Sibyte BCM91250E-Sentosa" | 629 | bool "Sibyte BCM91250E-Sentosa" |
630 | depends on EXPERIMENTAL | 630 | depends on EXPERIMENTAL |
631 | select BOOT_ELF32 | 631 | select BOOT_ELF32 |
632 | select DMA_COHERENT | 632 | select DMA_COHERENT |
@@ -637,7 +637,7 @@ config SIBYTE_SENTOSA | |||
637 | select SYS_SUPPORTS_LITTLE_ENDIAN | 637 | select SYS_SUPPORTS_LITTLE_ENDIAN |
638 | 638 | ||
639 | config SIBYTE_RHONE | 639 | config SIBYTE_RHONE |
640 | bool "Support for Sibyte BCM91125E-Rhone" | 640 | bool "Sibyte BCM91125E-Rhone" |
641 | depends on EXPERIMENTAL | 641 | depends on EXPERIMENTAL |
642 | select BOOT_ELF32 | 642 | select BOOT_ELF32 |
643 | select DMA_COHERENT | 643 | select DMA_COHERENT |
@@ -648,7 +648,7 @@ config SIBYTE_RHONE | |||
648 | select SYS_SUPPORTS_LITTLE_ENDIAN | 648 | select SYS_SUPPORTS_LITTLE_ENDIAN |
649 | 649 | ||
650 | config SIBYTE_CARMEL | 650 | config SIBYTE_CARMEL |
651 | bool "Support for Sibyte BCM91120x-Carmel" | 651 | bool "Sibyte BCM91120x-Carmel" |
652 | depends on EXPERIMENTAL | 652 | depends on EXPERIMENTAL |
653 | select BOOT_ELF32 | 653 | select BOOT_ELF32 |
654 | select DMA_COHERENT | 654 | select DMA_COHERENT |
@@ -659,7 +659,7 @@ config SIBYTE_CARMEL | |||
659 | select SYS_SUPPORTS_LITTLE_ENDIAN | 659 | select SYS_SUPPORTS_LITTLE_ENDIAN |
660 | 660 | ||
661 | config SIBYTE_PTSWARM | 661 | config SIBYTE_PTSWARM |
662 | bool "Support for Sibyte BCM91250PT-PTSWARM" | 662 | bool "Sibyte BCM91250PT-PTSWARM" |
663 | depends on EXPERIMENTAL | 663 | depends on EXPERIMENTAL |
664 | select BOOT_ELF32 | 664 | select BOOT_ELF32 |
665 | select DMA_COHERENT | 665 | select DMA_COHERENT |
@@ -671,7 +671,7 @@ config SIBYTE_PTSWARM | |||
671 | select SYS_SUPPORTS_LITTLE_ENDIAN | 671 | select SYS_SUPPORTS_LITTLE_ENDIAN |
672 | 672 | ||
673 | config SIBYTE_LITTLESUR | 673 | config SIBYTE_LITTLESUR |
674 | bool "Support for Sibyte BCM91250C2-LittleSur" | 674 | bool "Sibyte BCM91250C2-LittleSur" |
675 | depends on EXPERIMENTAL | 675 | depends on EXPERIMENTAL |
676 | select BOOT_ELF32 | 676 | select BOOT_ELF32 |
677 | select DMA_COHERENT | 677 | select DMA_COHERENT |
@@ -683,7 +683,7 @@ config SIBYTE_LITTLESUR | |||
683 | select SYS_SUPPORTS_LITTLE_ENDIAN | 683 | select SYS_SUPPORTS_LITTLE_ENDIAN |
684 | 684 | ||
685 | config SIBYTE_CRHINE | 685 | config SIBYTE_CRHINE |
686 | bool "Support for Sibyte BCM91120C-CRhine" | 686 | bool "Sibyte BCM91120C-CRhine" |
687 | depends on EXPERIMENTAL | 687 | depends on EXPERIMENTAL |
688 | select BOOT_ELF32 | 688 | select BOOT_ELF32 |
689 | select DMA_COHERENT | 689 | select DMA_COHERENT |
@@ -694,7 +694,7 @@ config SIBYTE_CRHINE | |||
694 | select SYS_SUPPORTS_LITTLE_ENDIAN | 694 | select SYS_SUPPORTS_LITTLE_ENDIAN |
695 | 695 | ||
696 | config SIBYTE_CRHONE | 696 | config SIBYTE_CRHONE |
697 | bool "Support for Sibyte BCM91125C-CRhone" | 697 | bool "Sibyte BCM91125C-CRhone" |
698 | depends on EXPERIMENTAL | 698 | depends on EXPERIMENTAL |
699 | select BOOT_ELF32 | 699 | select BOOT_ELF32 |
700 | select DMA_COHERENT | 700 | select DMA_COHERENT |
@@ -706,7 +706,7 @@ config SIBYTE_CRHONE | |||
706 | select SYS_SUPPORTS_LITTLE_ENDIAN | 706 | select SYS_SUPPORTS_LITTLE_ENDIAN |
707 | 707 | ||
708 | config SNI_RM200_PCI | 708 | config SNI_RM200_PCI |
709 | bool "Support for SNI RM200 PCI" | 709 | bool "SNI RM200 PCI" |
710 | select ARC | 710 | select ARC |
711 | select ARC32 | 711 | select ARC32 |
712 | select ARCH_MAY_HAVE_PC_FDC | 712 | select ARCH_MAY_HAVE_PC_FDC |
@@ -732,7 +732,7 @@ config SNI_RM200_PCI | |||
732 | support this machine type. | 732 | support this machine type. |
733 | 733 | ||
734 | config TOSHIBA_JMR3927 | 734 | config TOSHIBA_JMR3927 |
735 | bool "Support for Toshiba JMR-TX3927 board" | 735 | bool "Toshiba JMR-TX3927 board" |
736 | select DMA_NONCOHERENT | 736 | select DMA_NONCOHERENT |
737 | select HW_HAS_PCI | 737 | select HW_HAS_PCI |
738 | select MIPS_TX3927 | 738 | select MIPS_TX3927 |
@@ -743,7 +743,7 @@ config TOSHIBA_JMR3927 | |||
743 | select TOSHIBA_BOARDS | 743 | select TOSHIBA_BOARDS |
744 | 744 | ||
745 | config TOSHIBA_RBTX4927 | 745 | config TOSHIBA_RBTX4927 |
746 | bool "Support for Toshiba TBTX49[23]7 board" | 746 | bool "Toshiba TBTX49[23]7 board" |
747 | select DMA_NONCOHERENT | 747 | select DMA_NONCOHERENT |
748 | select HAS_TXX9_SERIAL | 748 | select HAS_TXX9_SERIAL |
749 | select HW_HAS_PCI | 749 | select HW_HAS_PCI |
@@ -760,7 +760,7 @@ config TOSHIBA_RBTX4927 | |||
760 | support this machine type | 760 | support this machine type |
761 | 761 | ||
762 | config TOSHIBA_RBTX4938 | 762 | config TOSHIBA_RBTX4938 |
763 | bool "Support for Toshiba RBTX4938 board" | 763 | bool "Toshiba RBTX4938 board" |
764 | select HAVE_STD_PC_SERIAL_PORT | 764 | select HAVE_STD_PC_SERIAL_PORT |
765 | select DMA_NONCOHERENT | 765 | select DMA_NONCOHERENT |
766 | select GENERIC_ISA_DMA | 766 | select GENERIC_ISA_DMA |
@@ -1411,13 +1411,12 @@ config PAGE_SIZE_8KB | |||
1411 | 1411 | ||
1412 | config PAGE_SIZE_16KB | 1412 | config PAGE_SIZE_16KB |
1413 | bool "16kB" | 1413 | bool "16kB" |
1414 | depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX | 1414 | depends on !CPU_R3000 && !CPU_TX39XX |
1415 | help | 1415 | help |
1416 | Using 16kB page size will result in higher performance kernel at | 1416 | Using 16kB page size will result in higher performance kernel at |
1417 | the price of higher memory consumption. This option is available on | 1417 | the price of higher memory consumption. This option is available on |
1418 | all non-R3000 family processor. Not that at the time of this | 1418 | all non-R3000 family processors. Note that you will need a suitable |
1419 | writing this option is still high experimental; there are also | 1419 | Linux distribution to support this. |
1420 | issues with compatibility of user applications. | ||
1421 | 1420 | ||
1422 | config PAGE_SIZE_64KB | 1421 | config PAGE_SIZE_64KB |
1423 | bool "64kB" | 1422 | bool "64kB" |
@@ -1426,8 +1425,7 @@ config PAGE_SIZE_64KB | |||
1426 | Using 64kB page size will result in higher performance kernel at | 1425 | Using 64kB page size will result in higher performance kernel at |
1427 | the price of higher memory consumption. This option is available on | 1426 | the price of higher memory consumption. This option is available on |
1428 | all non-R3000 family processor. Not that at the time of this | 1427 | all non-R3000 family processor. Not that at the time of this |
1429 | writing this option is still high experimental; there are also | 1428 | writing this option is still high experimental. |
1430 | issues with compatibility of user applications. | ||
1431 | 1429 | ||
1432 | endchoice | 1430 | endchoice |
1433 | 1431 | ||
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c index da61de776154..afe05ec12c27 100644 --- a/arch/mips/au1000/common/irq.c +++ b/arch/mips/au1000/common/irq.c | |||
@@ -68,6 +68,7 @@ | |||
68 | 68 | ||
69 | extern void set_debug_traps(void); | 69 | extern void set_debug_traps(void); |
70 | extern irq_cpustat_t irq_stat [NR_CPUS]; | 70 | extern irq_cpustat_t irq_stat [NR_CPUS]; |
71 | extern void mips_timer_interrupt(struct pt_regs *regs); | ||
71 | 72 | ||
72 | static void setup_local_irq(unsigned int irq, int type, int int_req); | 73 | static void setup_local_irq(unsigned int irq, int type, int int_req); |
73 | static unsigned int startup_irq(unsigned int irq); | 74 | static unsigned int startup_irq(unsigned int irq); |
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c index 9c171afd9a53..ae7d8c57bf3f 100644 --- a/arch/mips/au1000/common/prom.c +++ b/arch/mips/au1000/common/prom.c | |||
@@ -1,10 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * BRIEF MODULE DESCRIPTION | 3 | * BRIEF MODULE DESCRIPTION |
4 | * PROM library initialisation code, assuming a version of | 4 | * PROM library initialisation code, assuming YAMON is the boot loader. |
5 | * pmon is the boot code. | ||
6 | * | 5 | * |
7 | * Copyright 2000,2001 MontaVista Software Inc. | 6 | * Copyright 2000, 2001, 2006 MontaVista Software Inc. |
8 | * Author: MontaVista Software, Inc. | 7 | * Author: MontaVista Software, Inc. |
9 | * ppopov@mvista.com or source@mvista.com | 8 | * ppopov@mvista.com or source@mvista.com |
10 | * | 9 | * |
@@ -49,9 +48,9 @@ extern char **prom_argv, **prom_envp; | |||
49 | 48 | ||
50 | typedef struct | 49 | typedef struct |
51 | { | 50 | { |
52 | char *name; | 51 | char *name; |
53 | /* char *val; */ | 52 | char *val; |
54 | }t_env_var; | 53 | } t_env_var; |
55 | 54 | ||
56 | 55 | ||
57 | char * prom_getcmdline(void) | 56 | char * prom_getcmdline(void) |
@@ -85,21 +84,16 @@ char *prom_getenv(char *envname) | |||
85 | { | 84 | { |
86 | /* | 85 | /* |
87 | * Return a pointer to the given environment variable. | 86 | * Return a pointer to the given environment variable. |
88 | * Environment variables are stored in the form of "memsize=64". | ||
89 | */ | 87 | */ |
90 | 88 | ||
91 | t_env_var *env = (t_env_var *)prom_envp; | 89 | t_env_var *env = (t_env_var *)prom_envp; |
92 | int i; | ||
93 | |||
94 | i = strlen(envname); | ||
95 | 90 | ||
96 | while(env->name) { | 91 | while (env->name) { |
97 | if(strncmp(envname, env->name, i) == 0) { | 92 | if (strcmp(envname, env->name) == 0) |
98 | return(env->name + strlen(envname) + 1); | 93 | return env->val; |
99 | } | ||
100 | env++; | 94 | env++; |
101 | } | 95 | } |
102 | return(NULL); | 96 | return NULL; |
103 | } | 97 | } |
104 | 98 | ||
105 | inline unsigned char str2hexnum(unsigned char c) | 99 | inline unsigned char str2hexnum(unsigned char c) |
diff --git a/arch/mips/au1000/common/sleeper.S b/arch/mips/au1000/common/sleeper.S index 44dac3b0df3b..683d9da84b66 100644 --- a/arch/mips/au1000/common/sleeper.S +++ b/arch/mips/au1000/common/sleeper.S | |||
@@ -112,6 +112,11 @@ sdsleep: | |||
112 | mtc0 k0, CP0_PAGEMASK | 112 | mtc0 k0, CP0_PAGEMASK |
113 | lw k0, 0x14(sp) | 113 | lw k0, 0x14(sp) |
114 | mtc0 k0, CP0_CONFIG | 114 | mtc0 k0, CP0_CONFIG |
115 | |||
116 | /* We need to catch the ealry Alchemy SOCs with | ||
117 | * the write-only Config[OD] bit and set it back to one... | ||
118 | */ | ||
119 | jal au1x00_fixup_config_od | ||
115 | lw $1, PT_R1(sp) | 120 | lw $1, PT_R1(sp) |
116 | lw $2, PT_R2(sp) | 121 | lw $2, PT_R2(sp) |
117 | lw $3, PT_R3(sp) | 122 | lw $3, PT_R3(sp) |
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index f85f1524b366..f74d66a58a21 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c | |||
@@ -116,6 +116,7 @@ void mips_timer_interrupt(struct pt_regs *regs) | |||
116 | 116 | ||
117 | null: | 117 | null: |
118 | ack_r4ktimer(0); | 118 | ack_r4ktimer(0); |
119 | irq_exit(); | ||
119 | } | 120 | } |
120 | 121 | ||
121 | #ifdef CONFIG_PM | 122 | #ifdef CONFIG_PM |
diff --git a/arch/mips/ddb5xxx/ddb5476/dbg_io.c b/arch/mips/ddb5xxx/ddb5476/dbg_io.c index 85e9e5013679..f2296a999953 100644 --- a/arch/mips/ddb5xxx/ddb5476/dbg_io.c +++ b/arch/mips/ddb5xxx/ddb5476/dbg_io.c | |||
@@ -86,7 +86,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) | |||
86 | /* disable interrupts */ | 86 | /* disable interrupts */ |
87 | UART16550_WRITE(OFS_INTR_ENABLE, 0); | 87 | UART16550_WRITE(OFS_INTR_ENABLE, 0); |
88 | 88 | ||
89 | /* set up buad rate */ | 89 | /* set up baud rate */ |
90 | { | 90 | { |
91 | uint32 divisor; | 91 | uint32 divisor; |
92 | 92 | ||
diff --git a/arch/mips/ddb5xxx/ddb5477/kgdb_io.c b/arch/mips/ddb5xxx/ddb5477/kgdb_io.c index 1d18d590495b..385bbdb10170 100644 --- a/arch/mips/ddb5xxx/ddb5477/kgdb_io.c +++ b/arch/mips/ddb5xxx/ddb5477/kgdb_io.c | |||
@@ -86,7 +86,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) | |||
86 | /* disable interrupts */ | 86 | /* disable interrupts */ |
87 | UART16550_WRITE(OFS_INTR_ENABLE, 0); | 87 | UART16550_WRITE(OFS_INTR_ENABLE, 0); |
88 | 88 | ||
89 | /* set up buad rate */ | 89 | /* set up baud rate */ |
90 | { | 90 | { |
91 | uint32 divisor; | 91 | uint32 divisor; |
92 | 92 | ||
diff --git a/arch/mips/gt64120/ev64120/serialGT.c b/arch/mips/gt64120/ev64120/serialGT.c index 16e34a546e54..8f0d835491ff 100644 --- a/arch/mips/gt64120/ev64120/serialGT.c +++ b/arch/mips/gt64120/ev64120/serialGT.c | |||
@@ -149,7 +149,7 @@ void serial_set(int channel, unsigned long baud) | |||
149 | #else | 149 | #else |
150 | /* | 150 | /* |
151 | * Note: Set baud rate, hardcoded here for rate of 115200 | 151 | * Note: Set baud rate, hardcoded here for rate of 115200 |
152 | * since became unsure of above "buad rate" algorithm (??). | 152 | * since became unsure of above "baud rate" algorithm (??). |
153 | */ | 153 | */ |
154 | outreg(channel, LCR, 0x83); | 154 | outreg(channel, LCR, 0x83); |
155 | outreg(channel, DLM, 0x00); // See note above | 155 | outreg(channel, DLM, 0x00); // See note above |
diff --git a/arch/mips/gt64120/momenco_ocelot/dbg_io.c b/arch/mips/gt64120/momenco_ocelot/dbg_io.c index 8720bccfdea2..f0a6a38fcf4d 100644 --- a/arch/mips/gt64120/momenco_ocelot/dbg_io.c +++ b/arch/mips/gt64120/momenco_ocelot/dbg_io.c | |||
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) | |||
73 | /* disable interrupts */ | 73 | /* disable interrupts */ |
74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); | 74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); |
75 | 75 | ||
76 | /* set up buad rate */ | 76 | /* set up baud rate */ |
77 | { | 77 | { |
78 | uint32 divisor; | 78 | uint32 divisor; |
79 | 79 | ||
diff --git a/arch/mips/ite-boards/generic/dbg_io.c b/arch/mips/ite-boards/generic/dbg_io.c index c4f8530fd07e..6a7ccaf93502 100644 --- a/arch/mips/ite-boards/generic/dbg_io.c +++ b/arch/mips/ite-boards/generic/dbg_io.c | |||
@@ -72,7 +72,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) | |||
72 | /* disable interrupts */ | 72 | /* disable interrupts */ |
73 | UART16550_WRITE(OFS_INTR_ENABLE, 0); | 73 | UART16550_WRITE(OFS_INTR_ENABLE, 0); |
74 | 74 | ||
75 | /* set up buad rate */ | 75 | /* set up baud rate */ |
76 | { | 76 | { |
77 | uint32 divisor; | 77 | uint32 divisor; |
78 | 78 | ||
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 92b28b674d6f..0facfaf4e950 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c | |||
@@ -272,8 +272,8 @@ void output_sc_defines(void) | |||
272 | text("/* Linux sigcontext offsets. */"); | 272 | text("/* Linux sigcontext offsets. */"); |
273 | offset("#define SC_REGS ", struct sigcontext, sc_regs); | 273 | offset("#define SC_REGS ", struct sigcontext, sc_regs); |
274 | offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); | 274 | offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); |
275 | offset("#define SC_MDHI ", struct sigcontext, sc_hi); | 275 | offset("#define SC_MDHI ", struct sigcontext, sc_mdhi); |
276 | offset("#define SC_MDLO ", struct sigcontext, sc_lo); | 276 | offset("#define SC_MDLO ", struct sigcontext, sc_mdlo); |
277 | offset("#define SC_PC ", struct sigcontext, sc_pc); | 277 | offset("#define SC_PC ", struct sigcontext, sc_pc); |
278 | offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); | 278 | offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); |
279 | linefeed; | 279 | linefeed; |
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c index 47a087b6c11b..d268827c62bd 100644 --- a/arch/mips/kernel/cpu-bugs64.c +++ b/arch/mips/kernel/cpu-bugs64.c | |||
@@ -206,7 +206,7 @@ static inline void check_daddi(void) | |||
206 | "daddi %0, %1, %3\n\t" | 206 | "daddi %0, %1, %3\n\t" |
207 | ".set pop" | 207 | ".set pop" |
208 | : "=r" (v), "=&r" (tmp) | 208 | : "=r" (v), "=&r" (tmp) |
209 | : "I" (0xffffffffffffdb9a), "I" (0x1234)); | 209 | : "I" (0xffffffffffffdb9aUL), "I" (0x1234)); |
210 | set_except_vector(12, handler); | 210 | set_except_vector(12, handler); |
211 | local_irq_restore(flags); | 211 | local_irq_restore(flags); |
212 | 212 | ||
@@ -224,7 +224,7 @@ static inline void check_daddi(void) | |||
224 | "dsrl %1, %1, 1\n\t" | 224 | "dsrl %1, %1, 1\n\t" |
225 | "daddi %0, %1, %3" | 225 | "daddi %0, %1, %3" |
226 | : "=r" (v), "=&r" (tmp) | 226 | : "=r" (v), "=&r" (tmp) |
227 | : "I" (0xffffffffffffdb9a), "I" (0x1234)); | 227 | : "I" (0xffffffffffffdb9aUL), "I" (0x1234)); |
228 | set_except_vector(12, handler); | 228 | set_except_vector(12, handler); |
229 | local_irq_restore(flags); | 229 | local_irq_restore(flags); |
230 | 230 | ||
@@ -280,7 +280,7 @@ static inline void check_daddiu(void) | |||
280 | "daddu %1, %2\n\t" | 280 | "daddu %1, %2\n\t" |
281 | ".set pop" | 281 | ".set pop" |
282 | : "=&r" (v), "=&r" (w), "=&r" (tmp) | 282 | : "=&r" (v), "=&r" (w), "=&r" (tmp) |
283 | : "I" (0xffffffffffffdb9a), "I" (0x1234)); | 283 | : "I" (0xffffffffffffdb9aUL), "I" (0x1234)); |
284 | 284 | ||
285 | if (v == w) { | 285 | if (v == w) { |
286 | printk("no.\n"); | 286 | printk("no.\n"); |
@@ -296,7 +296,7 @@ static inline void check_daddiu(void) | |||
296 | "addiu %1, $0, %4\n\t" | 296 | "addiu %1, $0, %4\n\t" |
297 | "daddu %1, %2" | 297 | "daddu %1, %2" |
298 | : "=&r" (v), "=&r" (w), "=&r" (tmp) | 298 | : "=&r" (v), "=&r" (w), "=&r" (tmp) |
299 | : "I" (0xffffffffffffdb9a), "I" (0x1234)); | 299 | : "I" (0xffffffffffffdb9aUL), "I" (0x1234)); |
300 | 300 | ||
301 | if (v == w) { | 301 | if (v == w) { |
302 | printk("yes.\n"); | 302 | printk("yes.\n"); |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 58b3b14873cb..8c2c359a05f4 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -121,6 +121,7 @@ static inline void check_wait(void) | |||
121 | case CPU_24K: | 121 | case CPU_24K: |
122 | case CPU_25KF: | 122 | case CPU_25KF: |
123 | case CPU_34K: | 123 | case CPU_34K: |
124 | case CPU_74K: | ||
124 | case CPU_PR4450: | 125 | case CPU_PR4450: |
125 | cpu_wait = r4k_wait; | 126 | cpu_wait = r4k_wait; |
126 | printk(" available.\n"); | 127 | printk(" available.\n"); |
@@ -432,6 +433,15 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c) | |||
432 | MIPS_CPU_LLSC; | 433 | MIPS_CPU_LLSC; |
433 | c->tlbsize = 64; | 434 | c->tlbsize = 64; |
434 | break; | 435 | break; |
436 | case PRID_IMP_R14000: | ||
437 | c->cputype = CPU_R14000; | ||
438 | c->isa_level = MIPS_CPU_ISA_IV; | ||
439 | c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | | ||
440 | MIPS_CPU_FPU | MIPS_CPU_32FPR | | ||
441 | MIPS_CPU_COUNTER | MIPS_CPU_WATCH | | ||
442 | MIPS_CPU_LLSC; | ||
443 | c->tlbsize = 64; | ||
444 | break; | ||
435 | } | 445 | } |
436 | } | 446 | } |
437 | 447 | ||
@@ -593,6 +603,9 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c) | |||
593 | case PRID_IMP_34K: | 603 | case PRID_IMP_34K: |
594 | c->cputype = CPU_34K; | 604 | c->cputype = CPU_34K; |
595 | break; | 605 | break; |
606 | case PRID_IMP_74K: | ||
607 | c->cputype = CPU_74K; | ||
608 | break; | ||
596 | } | 609 | } |
597 | } | 610 | } |
598 | 611 | ||
@@ -642,7 +655,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c) | |||
642 | case PRID_IMP_SB1: | 655 | case PRID_IMP_SB1: |
643 | c->cputype = CPU_SB1; | 656 | c->cputype = CPU_SB1; |
644 | /* FPU in pass1 is known to have issues. */ | 657 | /* FPU in pass1 is known to have issues. */ |
645 | if ((c->processor_id & 0xff) < 0x20) | 658 | if ((c->processor_id & 0xff) < 0x02) |
646 | c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); | 659 | c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); |
647 | break; | 660 | break; |
648 | case PRID_IMP_SB1A: | 661 | case PRID_IMP_SB1A: |
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index d101d2fb24ca..a9c6de1b9542 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S | |||
@@ -101,7 +101,7 @@ FEXPORT(restore_all) # restore full frame | |||
101 | EMT | 101 | EMT |
102 | 1: | 102 | 1: |
103 | mfc0 v1, CP0_TCSTATUS | 103 | mfc0 v1, CP0_TCSTATUS |
104 | /* We set IXMT above, XOR should cler it here */ | 104 | /* We set IXMT above, XOR should clear it here */ |
105 | xori v1, v1, TCSTATUS_IXMT | 105 | xori v1, v1, TCSTATUS_IXMT |
106 | or v1, v0, v1 | 106 | or v1, v0, v1 |
107 | mtc0 v1, CP0_TCSTATUS | 107 | mtc0 v1, CP0_TCSTATUS |
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S index 10f28fb9f008..5fd7a8af0c62 100644 --- a/arch/mips/kernel/gdb-low.S +++ b/arch/mips/kernel/gdb-low.S | |||
@@ -54,9 +54,11 @@ | |||
54 | */ | 54 | */ |
55 | mfc0 k0, CP0_CAUSE | 55 | mfc0 k0, CP0_CAUSE |
56 | andi k0, k0, 0x7c | 56 | andi k0, k0, 0x7c |
57 | add k1, k1, k0 | 57 | #ifdef CONFIG_64BIT |
58 | PTR_L k0, saved_vectors(k1) | 58 | dsll k0, k0, 1 |
59 | jr k0 | 59 | #endif |
60 | PTR_L k1, saved_vectors(k0) | ||
61 | jr k1 | ||
60 | nop | 62 | nop |
61 | 1: | 63 | 1: |
62 | move k0, sp | 64 | move k0, sp |
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index e54a7f442f8a..d7bf0215bc1d 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c | |||
@@ -288,6 +288,9 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, | |||
288 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr | 288 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr |
289 | + ELF_MIPS_R_SYM(rel[i]); | 289 | + ELF_MIPS_R_SYM(rel[i]); |
290 | if (!sym->st_value) { | 290 | if (!sym->st_value) { |
291 | /* Ignore unresolved weak symbol */ | ||
292 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) | ||
293 | continue; | ||
291 | printk(KERN_WARNING "%s: Unknown symbol %s\n", | 294 | printk(KERN_WARNING "%s: Unknown symbol %s\n", |
292 | me->name, strtab + sym->st_name); | 295 | me->name, strtab + sym->st_name); |
293 | return -ENOENT; | 296 | return -ENOENT; |
@@ -325,6 +328,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, | |||
325 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr | 328 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr |
326 | + ELF_MIPS_R_SYM(rel[i]); | 329 | + ELF_MIPS_R_SYM(rel[i]); |
327 | if (!sym->st_value) { | 330 | if (!sym->st_value) { |
331 | /* Ignore unresolved weak symbol */ | ||
332 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) | ||
333 | continue; | ||
328 | printk(KERN_WARNING "%s: Unknown symbol %s\n", | 334 | printk(KERN_WARNING "%s: Unknown symbol %s\n", |
329 | me->name, strtab + sym->st_name); | 335 | me->name, strtab + sym->st_name); |
330 | return -ENOENT; | 336 | return -ENOENT; |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index 84ab959f924a..9def554f335b 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -42,6 +42,7 @@ static const char *cpu_name[] = { | |||
42 | [CPU_R8000] = "R8000", | 42 | [CPU_R8000] = "R8000", |
43 | [CPU_R10000] = "R10000", | 43 | [CPU_R10000] = "R10000", |
44 | [CPU_R12000] = "R12000", | 44 | [CPU_R12000] = "R12000", |
45 | [CPU_R14000] = "R14000", | ||
45 | [CPU_R4300] = "R4300", | 46 | [CPU_R4300] = "R4300", |
46 | [CPU_R4650] = "R4650", | 47 | [CPU_R4650] = "R4650", |
47 | [CPU_R4700] = "R4700", | 48 | [CPU_R4700] = "R4700", |
@@ -74,6 +75,7 @@ static const char *cpu_name[] = { | |||
74 | [CPU_24K] = "MIPS 24K", | 75 | [CPU_24K] = "MIPS 24K", |
75 | [CPU_25KF] = "MIPS 25Kf", | 76 | [CPU_25KF] = "MIPS 25Kf", |
76 | [CPU_34K] = "MIPS 34K", | 77 | [CPU_34K] = "MIPS 34K", |
78 | [CPU_74K] = "MIPS 74K", | ||
77 | [CPU_VR4111] = "NEC VR4111", | 79 | [CPU_VR4111] = "NEC VR4111", |
78 | [CPU_VR4121] = "NEC VR4121", | 80 | [CPU_VR4121] = "NEC VR4121", |
79 | [CPU_VR4122] = "NEC VR4122", | 81 | [CPU_VR4122] = "NEC VR4122", |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index b53a9207f530..8efb23a84131 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -209,7 +209,7 @@ sys_call_table: | |||
209 | PTR sys_fork | 209 | PTR sys_fork |
210 | PTR sys_read | 210 | PTR sys_read |
211 | PTR sys_write | 211 | PTR sys_write |
212 | PTR sys_open /* 4005 */ | 212 | PTR compat_sys_open /* 4005 */ |
213 | PTR sys_close | 213 | PTR sys_close |
214 | PTR sys_waitpid | 214 | PTR sys_waitpid |
215 | PTR sys_creat | 215 | PTR sys_creat |
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index bcf1b10e518f..397a70e651b5 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -246,7 +246,7 @@ static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_en | |||
246 | #ifdef CONFIG_64BIT | 246 | #ifdef CONFIG_64BIT |
247 | /* HACK: Guess if the sign extension was forgotten */ | 247 | /* HACK: Guess if the sign extension was forgotten */ |
248 | if (start > 0x0000000080000000 && start < 0x00000000ffffffff) | 248 | if (start > 0x0000000080000000 && start < 0x00000000ffffffff) |
249 | start |= 0xffffffff00000000; | 249 | start |= 0xffffffff00000000UL; |
250 | #endif | 250 | #endif |
251 | 251 | ||
252 | end = start + size; | 252 | end = start + size; |
@@ -355,8 +355,6 @@ static inline void bootmem_init(void) | |||
355 | } | 355 | } |
356 | #endif | 356 | #endif |
357 | 357 | ||
358 | memory_present(0, first_usable_pfn, max_low_pfn); | ||
359 | |||
360 | /* Initialize the boot-time allocator with low memory only. */ | 358 | /* Initialize the boot-time allocator with low memory only. */ |
361 | bootmap_size = init_bootmem(first_usable_pfn, max_low_pfn); | 359 | bootmap_size = init_bootmem(first_usable_pfn, max_low_pfn); |
362 | 360 | ||
@@ -410,6 +408,7 @@ static inline void bootmem_init(void) | |||
410 | 408 | ||
411 | /* Register lowmem ranges */ | 409 | /* Register lowmem ranges */ |
412 | free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size)); | 410 | free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size)); |
411 | memory_present(0, curr_pfn, curr_pfn + size - 1); | ||
413 | } | 412 | } |
414 | 413 | ||
415 | /* Reserve the bootmap memory. */ | 414 | /* Reserve the bootmap memory. */ |
@@ -419,17 +418,20 @@ static inline void bootmem_init(void) | |||
419 | #ifdef CONFIG_BLK_DEV_INITRD | 418 | #ifdef CONFIG_BLK_DEV_INITRD |
420 | initrd_below_start_ok = 1; | 419 | initrd_below_start_ok = 1; |
421 | if (initrd_start) { | 420 | if (initrd_start) { |
422 | unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start); | 421 | unsigned long initrd_size = ((unsigned char *)initrd_end) - |
422 | ((unsigned char *)initrd_start); | ||
423 | const int width = sizeof(long) * 2; | ||
424 | |||
423 | printk("Initial ramdisk at: 0x%p (%lu bytes)\n", | 425 | printk("Initial ramdisk at: 0x%p (%lu bytes)\n", |
424 | (void *)initrd_start, initrd_size); | 426 | (void *)initrd_start, initrd_size); |
425 | 427 | ||
426 | if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { | 428 | if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { |
427 | printk("initrd extends beyond end of memory " | 429 | printk("initrd extends beyond end of memory " |
428 | "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", | 430 | "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", |
429 | sizeof(long) * 2, | 431 | width, |
430 | (unsigned long long)CPHYSADDR(initrd_end), | 432 | (unsigned long long) CPHYSADDR(initrd_end), |
431 | sizeof(long) * 2, | 433 | width, |
432 | (unsigned long long)PFN_PHYS(max_low_pfn)); | 434 | (unsigned long long) PFN_PHYS(max_low_pfn)); |
433 | initrd_start = initrd_end = 0; | 435 | initrd_start = initrd_end = 0; |
434 | initrd_reserve_bootmem = 0; | 436 | initrd_reserve_bootmem = 0; |
435 | } | 437 | } |
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h index 3ca786215d48..ce6cb915c0a7 100644 --- a/arch/mips/kernel/signal-common.h +++ b/arch/mips/kernel/signal-common.h | |||
@@ -31,7 +31,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
31 | save_gp_reg(31); | 31 | save_gp_reg(31); |
32 | #undef save_gp_reg | 32 | #undef save_gp_reg |
33 | 33 | ||
34 | #ifdef CONFIG_32BIT | ||
35 | err |= __put_user(regs->hi, &sc->sc_mdhi); | 34 | err |= __put_user(regs->hi, &sc->sc_mdhi); |
36 | err |= __put_user(regs->lo, &sc->sc_mdlo); | 35 | err |= __put_user(regs->lo, &sc->sc_mdlo); |
37 | if (cpu_has_dsp) { | 36 | if (cpu_has_dsp) { |
@@ -43,20 +42,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
43 | err |= __put_user(mflo3(), &sc->sc_lo3); | 42 | err |= __put_user(mflo3(), &sc->sc_lo3); |
44 | err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); | 43 | err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); |
45 | } | 44 | } |
46 | #endif | ||
47 | #ifdef CONFIG_64BIT | ||
48 | err |= __put_user(regs->hi, &sc->sc_hi[0]); | ||
49 | err |= __put_user(regs->lo, &sc->sc_lo[0]); | ||
50 | if (cpu_has_dsp) { | ||
51 | err |= __put_user(mfhi1(), &sc->sc_hi[1]); | ||
52 | err |= __put_user(mflo1(), &sc->sc_lo[1]); | ||
53 | err |= __put_user(mfhi2(), &sc->sc_hi[2]); | ||
54 | err |= __put_user(mflo2(), &sc->sc_lo[2]); | ||
55 | err |= __put_user(mfhi3(), &sc->sc_hi[3]); | ||
56 | err |= __put_user(mflo3(), &sc->sc_lo[3]); | ||
57 | err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); | ||
58 | } | ||
59 | #endif | ||
60 | 45 | ||
61 | err |= __put_user(!!used_math(), &sc->sc_used_math); | 46 | err |= __put_user(!!used_math(), &sc->sc_used_math); |
62 | 47 | ||
@@ -92,7 +77,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
92 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | 77 | current_thread_info()->restart_block.fn = do_no_restart_syscall; |
93 | 78 | ||
94 | err |= __get_user(regs->cp0_epc, &sc->sc_pc); | 79 | err |= __get_user(regs->cp0_epc, &sc->sc_pc); |
95 | #ifdef CONFIG_32BIT | ||
96 | err |= __get_user(regs->hi, &sc->sc_mdhi); | 80 | err |= __get_user(regs->hi, &sc->sc_mdhi); |
97 | err |= __get_user(regs->lo, &sc->sc_mdlo); | 81 | err |= __get_user(regs->lo, &sc->sc_mdlo); |
98 | if (cpu_has_dsp) { | 82 | if (cpu_has_dsp) { |
@@ -104,20 +88,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
104 | err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg); | 88 | err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg); |
105 | err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK); | 89 | err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK); |
106 | } | 90 | } |
107 | #endif | ||
108 | #ifdef CONFIG_64BIT | ||
109 | err |= __get_user(regs->hi, &sc->sc_hi[0]); | ||
110 | err |= __get_user(regs->lo, &sc->sc_lo[0]); | ||
111 | if (cpu_has_dsp) { | ||
112 | err |= __get_user(treg, &sc->sc_hi[1]); mthi1(treg); | ||
113 | err |= __get_user(treg, &sc->sc_lo[1]); mthi1(treg); | ||
114 | err |= __get_user(treg, &sc->sc_hi[2]); mthi2(treg); | ||
115 | err |= __get_user(treg, &sc->sc_lo[2]); mthi2(treg); | ||
116 | err |= __get_user(treg, &sc->sc_hi[3]); mthi3(treg); | ||
117 | err |= __get_user(treg, &sc->sc_lo[3]); mthi3(treg); | ||
118 | err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK); | ||
119 | } | ||
120 | #endif | ||
121 | 91 | ||
122 | #define restore_gp_reg(i) do { \ | 92 | #define restore_gp_reg(i) do { \ |
123 | err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ | 93 | err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index d42f358754ad..298f82fe8440 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -247,6 +247,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
247 | current_thread_info()->cpu = 0; | 247 | current_thread_info()->cpu = 0; |
248 | smp_tune_scheduling(); | 248 | smp_tune_scheduling(); |
249 | plat_prepare_cpus(max_cpus); | 249 | plat_prepare_cpus(max_cpus); |
250 | #ifndef CONFIG_HOTPLUG_CPU | ||
251 | cpu_present_map = cpu_possible_map; | ||
252 | #endif | ||
250 | } | 253 | } |
251 | 254 | ||
252 | /* preload SMP state for boot cpu */ | 255 | /* preload SMP state for boot cpu */ |
@@ -442,7 +445,7 @@ static int __init topology_init(void) | |||
442 | int cpu; | 445 | int cpu; |
443 | int ret; | 446 | int ret; |
444 | 447 | ||
445 | for_each_cpu(cpu) { | 448 | for_each_present_cpu(cpu) { |
446 | ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); | 449 | ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); |
447 | if (ret) | 450 | if (ret) |
448 | printk(KERN_WARNING "topology_init: register_cpu %d " | 451 | printk(KERN_WARNING "topology_init: register_cpu %d " |
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 2aeaa2fd4b32..5e8a18a8e2bd 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -276,31 +276,9 @@ void sys_set_thread_area(unsigned long addr) | |||
276 | 276 | ||
277 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | 277 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) |
278 | { | 278 | { |
279 | int tmp, len; | 279 | int tmp; |
280 | char __user *name; | ||
281 | 280 | ||
282 | switch(cmd) { | 281 | switch(cmd) { |
283 | case SETNAME: { | ||
284 | char nodename[__NEW_UTS_LEN + 1]; | ||
285 | |||
286 | if (!capable(CAP_SYS_ADMIN)) | ||
287 | return -EPERM; | ||
288 | |||
289 | name = (char __user *) arg1; | ||
290 | |||
291 | len = strncpy_from_user(nodename, name, __NEW_UTS_LEN); | ||
292 | if (len < 0) | ||
293 | return -EFAULT; | ||
294 | |||
295 | down_write(&uts_sem); | ||
296 | strncpy(system_utsname.nodename, nodename, len); | ||
297 | nodename[__NEW_UTS_LEN] = '\0'; | ||
298 | strlcpy(system_utsname.nodename, nodename, | ||
299 | sizeof(system_utsname.nodename)); | ||
300 | up_write(&uts_sem); | ||
301 | return 0; | ||
302 | } | ||
303 | |||
304 | case MIPS_ATOMIC_SET: | 282 | case MIPS_ATOMIC_SET: |
305 | printk(KERN_CRIT "How did I get here?\n"); | 283 | printk(KERN_CRIT "How did I get here?\n"); |
306 | return -EINVAL; | 284 | return -EINVAL; |
@@ -313,9 +291,6 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | |||
313 | case FLUSH_CACHE: | 291 | case FLUSH_CACHE: |
314 | __flush_cache_all(); | 292 | __flush_cache_all(); |
315 | return 0; | 293 | return 0; |
316 | |||
317 | case MIPS_RDNVRAM: | ||
318 | return -EIO; | ||
319 | } | 294 | } |
320 | 295 | ||
321 | return -EINVAL; | 296 | return -EINVAL; |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 4901f0a37fca..a7564b08eb4d 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -819,15 +819,30 @@ asmlinkage void do_watch(struct pt_regs *regs) | |||
819 | 819 | ||
820 | asmlinkage void do_mcheck(struct pt_regs *regs) | 820 | asmlinkage void do_mcheck(struct pt_regs *regs) |
821 | { | 821 | { |
822 | const int field = 2 * sizeof(unsigned long); | ||
823 | int multi_match = regs->cp0_status & ST0_TS; | ||
824 | |||
822 | show_regs(regs); | 825 | show_regs(regs); |
823 | dump_tlb_all(); | 826 | |
827 | if (multi_match) { | ||
828 | printk("Index : %0x\n", read_c0_index()); | ||
829 | printk("Pagemask: %0x\n", read_c0_pagemask()); | ||
830 | printk("EntryHi : %0*lx\n", field, read_c0_entryhi()); | ||
831 | printk("EntryLo0: %0*lx\n", field, read_c0_entrylo0()); | ||
832 | printk("EntryLo1: %0*lx\n", field, read_c0_entrylo1()); | ||
833 | printk("\n"); | ||
834 | dump_tlb_all(); | ||
835 | } | ||
836 | |||
837 | show_code((unsigned int *) regs->cp0_epc); | ||
838 | |||
824 | /* | 839 | /* |
825 | * Some chips may have other causes of machine check (e.g. SB1 | 840 | * Some chips may have other causes of machine check (e.g. SB1 |
826 | * graduation timer) | 841 | * graduation timer) |
827 | */ | 842 | */ |
828 | panic("Caught Machine Check exception - %scaused by multiple " | 843 | panic("Caught Machine Check exception - %scaused by multiple " |
829 | "matching entries in the TLB.", | 844 | "matching entries in the TLB.", |
830 | (regs->cp0_status & ST0_TS) ? "" : "not "); | 845 | (multi_match) ? "" : "not "); |
831 | } | 846 | } |
832 | 847 | ||
833 | asmlinkage void do_mt(struct pt_regs *regs) | 848 | asmlinkage void do_mt(struct pt_regs *regs) |
@@ -902,6 +917,7 @@ static inline void parity_protection_init(void) | |||
902 | { | 917 | { |
903 | switch (current_cpu_data.cputype) { | 918 | switch (current_cpu_data.cputype) { |
904 | case CPU_24K: | 919 | case CPU_24K: |
920 | case CPU_34K: | ||
905 | case CPU_5KC: | 921 | case CPU_5KC: |
906 | write_c0_ecc(0x80000000); | 922 | write_c0_ecc(0x80000000); |
907 | back_to_back_c0_hazard(); | 923 | back_to_back_c0_hazard(); |
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 14fa00e3cdfa..b84d1f9ce28e 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S | |||
@@ -151,23 +151,13 @@ SECTIONS | |||
151 | 151 | ||
152 | /* This is the MIPS specific mdebug section. */ | 152 | /* This is the MIPS specific mdebug section. */ |
153 | .mdebug : { *(.mdebug) } | 153 | .mdebug : { *(.mdebug) } |
154 | /* These are needed for ELF backends which have not yet been | 154 | |
155 | converted to the new style linker. */ | 155 | STABS_DEBUG |
156 | .stab 0 : { *(.stab) } | 156 | |
157 | .stabstr 0 : { *(.stabstr) } | 157 | DWARF_DEBUG |
158 | /* DWARF debug sections. | 158 | |
159 | Symbols in the .debug DWARF section are relative to the beginning of the | ||
160 | section so we begin .debug at 0. It's not clear yet what needs to happen | ||
161 | for the others. */ | ||
162 | .debug 0 : { *(.debug) } | ||
163 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | ||
164 | .debug_aranges 0 : { *(.debug_aranges) } | ||
165 | .debug_pubnames 0 : { *(.debug_pubnames) } | ||
166 | .debug_sfnames 0 : { *(.debug_sfnames) } | ||
167 | .line 0 : { *(.line) } | ||
168 | /* These must appear regardless of . */ | 159 | /* These must appear regardless of . */ |
169 | .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } | 160 | .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } |
170 | .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } | 161 | .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } |
171 | .comment : { *(.comment) } | ||
172 | .note : { *(.note) } | 162 | .note : { *(.note) } |
173 | } | 163 | } |
diff --git a/arch/mips/math-emu/dp_fint.c b/arch/mips/math-emu/dp_fint.c index a1962eb460f8..39a71de16f47 100644 --- a/arch/mips/math-emu/dp_fint.c +++ b/arch/mips/math-emu/dp_fint.c | |||
@@ -29,7 +29,9 @@ | |||
29 | 29 | ||
30 | ieee754dp ieee754dp_fint(int x) | 30 | ieee754dp ieee754dp_fint(int x) |
31 | { | 31 | { |
32 | COMPXDP; | 32 | u64 xm; |
33 | int xe; | ||
34 | int xs; | ||
33 | 35 | ||
34 | CLEARCX; | 36 | CLEARCX; |
35 | 37 | ||
diff --git a/arch/mips/math-emu/dp_flong.c b/arch/mips/math-emu/dp_flong.c index eae90a866aa1..f08f223e488a 100644 --- a/arch/mips/math-emu/dp_flong.c +++ b/arch/mips/math-emu/dp_flong.c | |||
@@ -29,7 +29,9 @@ | |||
29 | 29 | ||
30 | ieee754dp ieee754dp_flong(s64 x) | 30 | ieee754dp ieee754dp_flong(s64 x) |
31 | { | 31 | { |
32 | COMPXDP; | 32 | u64 xm; |
33 | int xe; | ||
34 | int xs; | ||
33 | 35 | ||
34 | CLEARCX; | 36 | CLEARCX; |
35 | 37 | ||
diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c index 7aac13afb09a..e88e125e01c2 100644 --- a/arch/mips/math-emu/sp_fint.c +++ b/arch/mips/math-emu/sp_fint.c | |||
@@ -29,7 +29,9 @@ | |||
29 | 29 | ||
30 | ieee754sp ieee754sp_fint(int x) | 30 | ieee754sp ieee754sp_fint(int x) |
31 | { | 31 | { |
32 | COMPXSP; | 32 | unsigned xm; |
33 | int xe; | ||
34 | int xs; | ||
33 | 35 | ||
34 | CLEARCX; | 36 | CLEARCX; |
35 | 37 | ||
diff --git a/arch/mips/math-emu/sp_flong.c b/arch/mips/math-emu/sp_flong.c index 3d6c1d11c178..26d6919a269a 100644 --- a/arch/mips/math-emu/sp_flong.c +++ b/arch/mips/math-emu/sp_flong.c | |||
@@ -29,7 +29,9 @@ | |||
29 | 29 | ||
30 | ieee754sp ieee754sp_flong(s64 x) | 30 | ieee754sp ieee754sp_flong(s64 x) |
31 | { | 31 | { |
32 | COMPXDP; /* <--- need 64-bit mantissa temp */ | 32 | u64 xm; /* <--- need 64-bit mantissa temp */ |
33 | int xe; | ||
34 | int xs; | ||
33 | 35 | ||
34 | CLEARCX; | 36 | CLEARCX; |
35 | 37 | ||
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 4182e1176fae..4a43924cd4fc 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -29,6 +29,27 @@ | |||
29 | #include <asm/war.h> | 29 | #include <asm/war.h> |
30 | #include <asm/cacheflush.h> /* for run_uncached() */ | 30 | #include <asm/cacheflush.h> /* for run_uncached() */ |
31 | 31 | ||
32 | |||
33 | /* | ||
34 | * Special Variant of smp_call_function for use by cache functions: | ||
35 | * | ||
36 | * o No return value | ||
37 | * o collapses to normal function call on UP kernels | ||
38 | * o collapses to normal function call on systems with a single shared | ||
39 | * primary cache. | ||
40 | */ | ||
41 | static inline void r4k_on_each_cpu(void (*func) (void *info), void *info, | ||
42 | int retry, int wait) | ||
43 | { | ||
44 | preempt_disable(); | ||
45 | |||
46 | #if !defined(CONFIG_MIPS_MT_SMP) && !defined(CONFIG_MIPS_MT_SMTC) | ||
47 | smp_call_function(func, info, retry, wait); | ||
48 | #endif | ||
49 | func(info); | ||
50 | preempt_enable(); | ||
51 | } | ||
52 | |||
32 | /* | 53 | /* |
33 | * Must die. | 54 | * Must die. |
34 | */ | 55 | */ |
@@ -299,7 +320,7 @@ static void r4k_flush_cache_all(void) | |||
299 | if (!cpu_has_dc_aliases) | 320 | if (!cpu_has_dc_aliases) |
300 | return; | 321 | return; |
301 | 322 | ||
302 | on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1); | 323 | r4k_on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1); |
303 | } | 324 | } |
304 | 325 | ||
305 | static inline void local_r4k___flush_cache_all(void * args) | 326 | static inline void local_r4k___flush_cache_all(void * args) |
@@ -314,13 +335,14 @@ static inline void local_r4k___flush_cache_all(void * args) | |||
314 | case CPU_R4400MC: | 335 | case CPU_R4400MC: |
315 | case CPU_R10000: | 336 | case CPU_R10000: |
316 | case CPU_R12000: | 337 | case CPU_R12000: |
338 | case CPU_R14000: | ||
317 | r4k_blast_scache(); | 339 | r4k_blast_scache(); |
318 | } | 340 | } |
319 | } | 341 | } |
320 | 342 | ||
321 | static void r4k___flush_cache_all(void) | 343 | static void r4k___flush_cache_all(void) |
322 | { | 344 | { |
323 | on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1); | 345 | r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1); |
324 | } | 346 | } |
325 | 347 | ||
326 | static inline void local_r4k_flush_cache_range(void * args) | 348 | static inline void local_r4k_flush_cache_range(void * args) |
@@ -341,7 +363,7 @@ static inline void local_r4k_flush_cache_range(void * args) | |||
341 | static void r4k_flush_cache_range(struct vm_area_struct *vma, | 363 | static void r4k_flush_cache_range(struct vm_area_struct *vma, |
342 | unsigned long start, unsigned long end) | 364 | unsigned long start, unsigned long end) |
343 | { | 365 | { |
344 | on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1); | 366 | r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1); |
345 | } | 367 | } |
346 | 368 | ||
347 | static inline void local_r4k_flush_cache_mm(void * args) | 369 | static inline void local_r4k_flush_cache_mm(void * args) |
@@ -370,7 +392,7 @@ static void r4k_flush_cache_mm(struct mm_struct *mm) | |||
370 | if (!cpu_has_dc_aliases) | 392 | if (!cpu_has_dc_aliases) |
371 | return; | 393 | return; |
372 | 394 | ||
373 | on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1); | 395 | r4k_on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1); |
374 | } | 396 | } |
375 | 397 | ||
376 | struct flush_cache_page_args { | 398 | struct flush_cache_page_args { |
@@ -461,7 +483,7 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma, | |||
461 | args.addr = addr; | 483 | args.addr = addr; |
462 | args.pfn = pfn; | 484 | args.pfn = pfn; |
463 | 485 | ||
464 | on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1); | 486 | r4k_on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1); |
465 | } | 487 | } |
466 | 488 | ||
467 | static inline void local_r4k_flush_data_cache_page(void * addr) | 489 | static inline void local_r4k_flush_data_cache_page(void * addr) |
@@ -471,7 +493,7 @@ static inline void local_r4k_flush_data_cache_page(void * addr) | |||
471 | 493 | ||
472 | static void r4k_flush_data_cache_page(unsigned long addr) | 494 | static void r4k_flush_data_cache_page(unsigned long addr) |
473 | { | 495 | { |
474 | on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1); | 496 | r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1); |
475 | } | 497 | } |
476 | 498 | ||
477 | struct flush_icache_range_args { | 499 | struct flush_icache_range_args { |
@@ -514,7 +536,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end) | |||
514 | args.start = start; | 536 | args.start = start; |
515 | args.end = end; | 537 | args.end = end; |
516 | 538 | ||
517 | on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); | 539 | r4k_on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); |
518 | instruction_hazard(); | 540 | instruction_hazard(); |
519 | } | 541 | } |
520 | 542 | ||
@@ -590,7 +612,7 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma, | |||
590 | args.vma = vma; | 612 | args.vma = vma; |
591 | args.page = page; | 613 | args.page = page; |
592 | 614 | ||
593 | on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1); | 615 | r4k_on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1); |
594 | } | 616 | } |
595 | 617 | ||
596 | 618 | ||
@@ -689,7 +711,7 @@ static void local_r4k_flush_cache_sigtramp(void * arg) | |||
689 | 711 | ||
690 | static void r4k_flush_cache_sigtramp(unsigned long addr) | 712 | static void r4k_flush_cache_sigtramp(unsigned long addr) |
691 | { | 713 | { |
692 | on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1); | 714 | r4k_on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1); |
693 | } | 715 | } |
694 | 716 | ||
695 | static void r4k_flush_icache_all(void) | 717 | static void r4k_flush_icache_all(void) |
@@ -812,6 +834,7 @@ static void __init probe_pcache(void) | |||
812 | 834 | ||
813 | case CPU_R10000: | 835 | case CPU_R10000: |
814 | case CPU_R12000: | 836 | case CPU_R12000: |
837 | case CPU_R14000: | ||
815 | icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29)); | 838 | icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29)); |
816 | c->icache.linesz = 64; | 839 | c->icache.linesz = 64; |
817 | c->icache.ways = 2; | 840 | c->icache.ways = 2; |
@@ -965,9 +988,11 @@ static void __init probe_pcache(void) | |||
965 | c->dcache.flags |= MIPS_CACHE_PINDEX; | 988 | c->dcache.flags |= MIPS_CACHE_PINDEX; |
966 | case CPU_R10000: | 989 | case CPU_R10000: |
967 | case CPU_R12000: | 990 | case CPU_R12000: |
991 | case CPU_R14000: | ||
968 | case CPU_SB1: | 992 | case CPU_SB1: |
969 | break; | 993 | break; |
970 | case CPU_24K: | 994 | case CPU_24K: |
995 | case CPU_34K: | ||
971 | if (!(read_c0_config7() & (1 << 16))) | 996 | if (!(read_c0_config7() & (1 << 16))) |
972 | default: | 997 | default: |
973 | if (c->dcache.waysize > PAGE_SIZE) | 998 | if (c->dcache.waysize > PAGE_SIZE) |
@@ -1091,6 +1116,7 @@ static void __init setup_scache(void) | |||
1091 | 1116 | ||
1092 | case CPU_R10000: | 1117 | case CPU_R10000: |
1093 | case CPU_R12000: | 1118 | case CPU_R12000: |
1119 | case CPU_R14000: | ||
1094 | scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16); | 1120 | scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16); |
1095 | c->scache.linesz = 64 << ((config >> 13) & 1); | 1121 | c->scache.linesz = 64 << ((config >> 13) & 1); |
1096 | c->scache.ways = 2; | 1122 | c->scache.ways = 2; |
@@ -1135,6 +1161,31 @@ static void __init setup_scache(void) | |||
1135 | c->options |= MIPS_CPU_SUBSET_CACHES; | 1161 | c->options |= MIPS_CPU_SUBSET_CACHES; |
1136 | } | 1162 | } |
1137 | 1163 | ||
1164 | void au1x00_fixup_config_od(void) | ||
1165 | { | ||
1166 | /* | ||
1167 | * c0_config.od (bit 19) was write only (and read as 0) | ||
1168 | * on the early revisions of Alchemy SOCs. It disables the bus | ||
1169 | * transaction overlapping and needs to be set to fix various errata. | ||
1170 | */ | ||
1171 | switch (read_c0_prid()) { | ||
1172 | case 0x00030100: /* Au1000 DA */ | ||
1173 | case 0x00030201: /* Au1000 HA */ | ||
1174 | case 0x00030202: /* Au1000 HB */ | ||
1175 | case 0x01030200: /* Au1500 AB */ | ||
1176 | /* | ||
1177 | * Au1100 errata actually keeps silence about this bit, so we set it | ||
1178 | * just in case for those revisions that require it to be set according | ||
1179 | * to arch/mips/au1000/common/cputable.c | ||
1180 | */ | ||
1181 | case 0x02030200: /* Au1100 AB */ | ||
1182 | case 0x02030201: /* Au1100 BA */ | ||
1183 | case 0x02030202: /* Au1100 BC */ | ||
1184 | set_c0_config(1 << 19); | ||
1185 | break; | ||
1186 | } | ||
1187 | } | ||
1188 | |||
1138 | static inline void coherency_setup(void) | 1189 | static inline void coherency_setup(void) |
1139 | { | 1190 | { |
1140 | change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT); | 1191 | change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT); |
@@ -1155,6 +1206,15 @@ static inline void coherency_setup(void) | |||
1155 | case CPU_R4400MC: | 1206 | case CPU_R4400MC: |
1156 | clear_c0_config(CONF_CU); | 1207 | clear_c0_config(CONF_CU); |
1157 | break; | 1208 | break; |
1209 | /* | ||
1210 | * We need to catch the ealry Alchemy SOCs with | ||
1211 | * the write-only co_config.od bit and set it back to one... | ||
1212 | */ | ||
1213 | case CPU_AU1000: /* rev. DA, HA, HB */ | ||
1214 | case CPU_AU1100: /* rev. AB, BA, BC ?? */ | ||
1215 | case CPU_AU1500: /* rev. AB */ | ||
1216 | au1x00_fixup_config_od(); | ||
1217 | break; | ||
1158 | } | 1218 | } |
1159 | } | 1219 | } |
1160 | 1220 | ||
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index c22308b93ff0..33f6e1cdfd5b 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -227,7 +227,7 @@ void __init mem_init(void) | |||
227 | for (tmp = 0; tmp < max_low_pfn; tmp++) | 227 | for (tmp = 0; tmp < max_low_pfn; tmp++) |
228 | if (page_is_ram(tmp)) { | 228 | if (page_is_ram(tmp)) { |
229 | ram++; | 229 | ram++; |
230 | if (PageReserved(mem_map+tmp)) | 230 | if (PageReserved(pfn_to_page(tmp))) |
231 | reservedpages++; | 231 | reservedpages++; |
232 | } | 232 | } |
233 | 233 | ||
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c index e4390dc3eb48..b7c749232ffe 100644 --- a/arch/mips/mm/pg-r4k.c +++ b/arch/mips/mm/pg-r4k.c | |||
@@ -357,6 +357,7 @@ void __init build_clear_page(void) | |||
357 | 357 | ||
358 | case CPU_R10000: | 358 | case CPU_R10000: |
359 | case CPU_R12000: | 359 | case CPU_R12000: |
360 | case CPU_R14000: | ||
360 | pref_src_mode = Pref_LoadStreamed; | 361 | pref_src_mode = Pref_LoadStreamed; |
361 | pref_dst_mode = Pref_StoreStreamed; | 362 | pref_dst_mode = Pref_StoreStreamed; |
362 | break; | 363 | break; |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 053dbacac56b..54507be2ab5b 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -875,6 +875,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l, | |||
875 | 875 | ||
876 | case CPU_R10000: | 876 | case CPU_R10000: |
877 | case CPU_R12000: | 877 | case CPU_R12000: |
878 | case CPU_R14000: | ||
878 | case CPU_4KC: | 879 | case CPU_4KC: |
879 | case CPU_SB1: | 880 | case CPU_SB1: |
880 | case CPU_SB1A: | 881 | case CPU_SB1A: |
@@ -906,6 +907,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l, | |||
906 | case CPU_4KEC: | 907 | case CPU_4KEC: |
907 | case CPU_24K: | 908 | case CPU_24K: |
908 | case CPU_34K: | 909 | case CPU_34K: |
910 | case CPU_74K: | ||
909 | i_ehb(p); | 911 | i_ehb(p); |
910 | tlbw(p); | 912 | tlbw(p); |
911 | break; | 913 | break; |
diff --git a/arch/mips/momentum/jaguar_atx/dbg_io.c b/arch/mips/momentum/jaguar_atx/dbg_io.c index 542eac82b63c..d7dea0a136aa 100644 --- a/arch/mips/momentum/jaguar_atx/dbg_io.c +++ b/arch/mips/momentum/jaguar_atx/dbg_io.c | |||
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) | |||
73 | /* disable interrupts */ | 73 | /* disable interrupts */ |
74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); | 74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); |
75 | 75 | ||
76 | /* set up buad rate */ | 76 | /* set up baud rate */ |
77 | { | 77 | { |
78 | uint32 divisor; | 78 | uint32 divisor; |
79 | 79 | ||
diff --git a/arch/mips/momentum/ocelot_c/dbg_io.c b/arch/mips/momentum/ocelot_c/dbg_io.c index 8720bccfdea2..f0a6a38fcf4d 100644 --- a/arch/mips/momentum/ocelot_c/dbg_io.c +++ b/arch/mips/momentum/ocelot_c/dbg_io.c | |||
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) | |||
73 | /* disable interrupts */ | 73 | /* disable interrupts */ |
74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); | 74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); |
75 | 75 | ||
76 | /* set up buad rate */ | 76 | /* set up baud rate */ |
77 | { | 77 | { |
78 | uint32 divisor; | 78 | uint32 divisor; |
79 | 79 | ||
diff --git a/arch/mips/momentum/ocelot_g/dbg_io.c b/arch/mips/momentum/ocelot_g/dbg_io.c index 8720bccfdea2..f0a6a38fcf4d 100644 --- a/arch/mips/momentum/ocelot_g/dbg_io.c +++ b/arch/mips/momentum/ocelot_g/dbg_io.c | |||
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop) | |||
73 | /* disable interrupts */ | 73 | /* disable interrupts */ |
74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); | 74 | UART16550_WRITE(OFS_INTR_ENABLE, 0); |
75 | 75 | ||
76 | /* set up buad rate */ | 76 | /* set up baud rate */ |
77 | { | 77 | { |
78 | uint32 divisor; | 78 | uint32 divisor; |
79 | 79 | ||
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c index f2b4862aaae5..c31e4cff64e0 100644 --- a/arch/mips/oprofile/common.c +++ b/arch/mips/oprofile/common.c | |||
@@ -14,8 +14,8 @@ | |||
14 | 14 | ||
15 | #include "op_impl.h" | 15 | #include "op_impl.h" |
16 | 16 | ||
17 | extern struct op_mips_model op_model_mipsxx __attribute__((weak)); | 17 | extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak)); |
18 | extern struct op_mips_model op_model_rm9000 __attribute__((weak)); | 18 | extern struct op_mips_model op_model_rm9000_ops __attribute__((weak)); |
19 | 19 | ||
20 | static struct op_mips_model *model; | 20 | static struct op_mips_model *model; |
21 | 21 | ||
@@ -80,13 +80,14 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
80 | case CPU_24K: | 80 | case CPU_24K: |
81 | case CPU_25KF: | 81 | case CPU_25KF: |
82 | case CPU_34K: | 82 | case CPU_34K: |
83 | case CPU_74K: | ||
83 | case CPU_SB1: | 84 | case CPU_SB1: |
84 | case CPU_SB1A: | 85 | case CPU_SB1A: |
85 | lmodel = &op_model_mipsxx; | 86 | lmodel = &op_model_mipsxx_ops; |
86 | break; | 87 | break; |
87 | 88 | ||
88 | case CPU_RM9000: | 89 | case CPU_RM9000: |
89 | lmodel = &op_model_rm9000; | 90 | lmodel = &op_model_rm9000_ops; |
90 | break; | 91 | break; |
91 | }; | 92 | }; |
92 | 93 | ||
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c index 95d488ca0754..f26a00e13204 100644 --- a/arch/mips/oprofile/op_model_mipsxx.c +++ b/arch/mips/oprofile/op_model_mipsxx.c | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #define M_COUNTER_OVERFLOW (1UL << 31) | 24 | #define M_COUNTER_OVERFLOW (1UL << 31) |
25 | 25 | ||
26 | struct op_mips_model op_model_mipsxx; | 26 | struct op_mips_model op_model_mipsxx_ops; |
27 | 27 | ||
28 | static struct mipsxx_register_config { | 28 | static struct mipsxx_register_config { |
29 | unsigned int control[4]; | 29 | unsigned int control[4]; |
@@ -34,7 +34,7 @@ static struct mipsxx_register_config { | |||
34 | 34 | ||
35 | static void mipsxx_reg_setup(struct op_counter_config *ctr) | 35 | static void mipsxx_reg_setup(struct op_counter_config *ctr) |
36 | { | 36 | { |
37 | unsigned int counters = op_model_mipsxx.num_counters; | 37 | unsigned int counters = op_model_mipsxx_ops.num_counters; |
38 | int i; | 38 | int i; |
39 | 39 | ||
40 | /* Compute the performance counter control word. */ | 40 | /* Compute the performance counter control word. */ |
@@ -62,7 +62,7 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr) | |||
62 | 62 | ||
63 | static void mipsxx_cpu_setup (void *args) | 63 | static void mipsxx_cpu_setup (void *args) |
64 | { | 64 | { |
65 | unsigned int counters = op_model_mipsxx.num_counters; | 65 | unsigned int counters = op_model_mipsxx_ops.num_counters; |
66 | 66 | ||
67 | switch (counters) { | 67 | switch (counters) { |
68 | case 4: | 68 | case 4: |
@@ -83,7 +83,7 @@ static void mipsxx_cpu_setup (void *args) | |||
83 | /* Start all counters on current CPU */ | 83 | /* Start all counters on current CPU */ |
84 | static void mipsxx_cpu_start(void *args) | 84 | static void mipsxx_cpu_start(void *args) |
85 | { | 85 | { |
86 | unsigned int counters = op_model_mipsxx.num_counters; | 86 | unsigned int counters = op_model_mipsxx_ops.num_counters; |
87 | 87 | ||
88 | switch (counters) { | 88 | switch (counters) { |
89 | case 4: | 89 | case 4: |
@@ -100,7 +100,7 @@ static void mipsxx_cpu_start(void *args) | |||
100 | /* Stop all counters on current CPU */ | 100 | /* Stop all counters on current CPU */ |
101 | static void mipsxx_cpu_stop(void *args) | 101 | static void mipsxx_cpu_stop(void *args) |
102 | { | 102 | { |
103 | unsigned int counters = op_model_mipsxx.num_counters; | 103 | unsigned int counters = op_model_mipsxx_ops.num_counters; |
104 | 104 | ||
105 | switch (counters) { | 105 | switch (counters) { |
106 | case 4: | 106 | case 4: |
@@ -116,7 +116,7 @@ static void mipsxx_cpu_stop(void *args) | |||
116 | 116 | ||
117 | static int mipsxx_perfcount_handler(struct pt_regs *regs) | 117 | static int mipsxx_perfcount_handler(struct pt_regs *regs) |
118 | { | 118 | { |
119 | unsigned int counters = op_model_mipsxx.num_counters; | 119 | unsigned int counters = op_model_mipsxx_ops.num_counters; |
120 | unsigned int control; | 120 | unsigned int control; |
121 | unsigned int counter; | 121 | unsigned int counter; |
122 | int handled = 0; | 122 | int handled = 0; |
@@ -187,33 +187,37 @@ static int __init mipsxx_init(void) | |||
187 | 187 | ||
188 | reset_counters(counters); | 188 | reset_counters(counters); |
189 | 189 | ||
190 | op_model_mipsxx.num_counters = counters; | 190 | op_model_mipsxx_ops.num_counters = counters; |
191 | switch (current_cpu_data.cputype) { | 191 | switch (current_cpu_data.cputype) { |
192 | case CPU_20KC: | 192 | case CPU_20KC: |
193 | op_model_mipsxx.cpu_type = "mips/20K"; | 193 | op_model_mipsxx_ops.cpu_type = "mips/20K"; |
194 | break; | 194 | break; |
195 | 195 | ||
196 | case CPU_24K: | 196 | case CPU_24K: |
197 | op_model_mipsxx.cpu_type = "mips/24K"; | 197 | op_model_mipsxx_ops.cpu_type = "mips/24K"; |
198 | break; | 198 | break; |
199 | 199 | ||
200 | case CPU_25KF: | 200 | case CPU_25KF: |
201 | op_model_mipsxx.cpu_type = "mips/25K"; | 201 | op_model_mipsxx_ops.cpu_type = "mips/25K"; |
202 | break; | 202 | break; |
203 | 203 | ||
204 | #ifndef CONFIG_SMP | 204 | #ifndef CONFIG_SMP |
205 | case CPU_34K: | 205 | case CPU_34K: |
206 | op_model_mipsxx.cpu_type = "mips/34K"; | 206 | op_model_mipsxx_ops.cpu_type = "mips/34K"; |
207 | break; | ||
208 | |||
209 | case CPU_74K: | ||
210 | op_model_mipsxx_ops.cpu_type = "mips/74K"; | ||
207 | break; | 211 | break; |
208 | #endif | 212 | #endif |
209 | 213 | ||
210 | case CPU_5KC: | 214 | case CPU_5KC: |
211 | op_model_mipsxx.cpu_type = "mips/5K"; | 215 | op_model_mipsxx_ops.cpu_type = "mips/5K"; |
212 | break; | 216 | break; |
213 | 217 | ||
214 | case CPU_SB1: | 218 | case CPU_SB1: |
215 | case CPU_SB1A: | 219 | case CPU_SB1A: |
216 | op_model_mipsxx.cpu_type = "mips/sb1"; | 220 | op_model_mipsxx_ops.cpu_type = "mips/sb1"; |
217 | break; | 221 | break; |
218 | 222 | ||
219 | default: | 223 | default: |
@@ -229,12 +233,12 @@ static int __init mipsxx_init(void) | |||
229 | 233 | ||
230 | static void mipsxx_exit(void) | 234 | static void mipsxx_exit(void) |
231 | { | 235 | { |
232 | reset_counters(op_model_mipsxx.num_counters); | 236 | reset_counters(op_model_mipsxx_ops.num_counters); |
233 | 237 | ||
234 | perf_irq = null_perf_irq; | 238 | perf_irq = null_perf_irq; |
235 | } | 239 | } |
236 | 240 | ||
237 | struct op_mips_model op_model_mipsxx = { | 241 | struct op_mips_model op_model_mipsxx_ops = { |
238 | .reg_setup = mipsxx_reg_setup, | 242 | .reg_setup = mipsxx_reg_setup, |
239 | .cpu_setup = mipsxx_cpu_setup, | 243 | .cpu_setup = mipsxx_cpu_setup, |
240 | .init = mipsxx_init, | 244 | .init = mipsxx_init, |
diff --git a/arch/mips/oprofile/op_model_rm9000.c b/arch/mips/oprofile/op_model_rm9000.c index 9b75e41c78ef..b7063fefa65b 100644 --- a/arch/mips/oprofile/op_model_rm9000.c +++ b/arch/mips/oprofile/op_model_rm9000.c | |||
@@ -126,7 +126,7 @@ static void rm9000_exit(void) | |||
126 | free_irq(rm9000_perfcount_irq, NULL); | 126 | free_irq(rm9000_perfcount_irq, NULL); |
127 | } | 127 | } |
128 | 128 | ||
129 | struct op_mips_model op_model_rm9000 = { | 129 | struct op_mips_model op_model_rm9000_ops = { |
130 | .reg_setup = rm9000_reg_setup, | 130 | .reg_setup = rm9000_reg_setup, |
131 | .cpu_setup = rm9000_cpu_setup, | 131 | .cpu_setup = rm9000_cpu_setup, |
132 | .init = rm9000_init, | 132 | .init = rm9000_init, |
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c index de01c9815bdd..8ba08047d164 100644 --- a/arch/mips/sgi-ip32/ip32-irq.c +++ b/arch/mips/sgi-ip32/ip32-irq.c | |||
@@ -31,12 +31,12 @@ | |||
31 | /* issue a PIO read to make sure no PIO writes are pending */ | 31 | /* issue a PIO read to make sure no PIO writes are pending */ |
32 | static void inline flush_crime_bus(void) | 32 | static void inline flush_crime_bus(void) |
33 | { | 33 | { |
34 | volatile unsigned long junk = crime->control; | 34 | crime->control; |
35 | } | 35 | } |
36 | 36 | ||
37 | static void inline flush_mace_bus(void) | 37 | static void inline flush_mace_bus(void) |
38 | { | 38 | { |
39 | volatile unsigned long junk = mace->perif.ctrl.misc; | 39 | mace->perif.ctrl.misc; |
40 | } | 40 | } |
41 | 41 | ||
42 | #undef DEBUG_IRQ | 42 | #undef DEBUG_IRQ |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 2d80653aa2af..41e9ab40cd54 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -2057,10 +2057,45 @@ static void __init flatten_device_tree(void) | |||
2057 | 2057 | ||
2058 | } | 2058 | } |
2059 | 2059 | ||
2060 | 2060 | #ifdef CONFIG_PPC_MAPLE | |
2061 | static void __init fixup_device_tree(void) | 2061 | /* PIBS Version 1.05.0000 04/26/2005 has an incorrect /ht/isa/ranges property. |
2062 | * The values are bad, and it doesn't even have the right number of cells. */ | ||
2063 | static void __init fixup_device_tree_maple(void) | ||
2062 | { | 2064 | { |
2065 | phandle isa; | ||
2066 | u32 isa_ranges[6]; | ||
2067 | |||
2068 | isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4")); | ||
2069 | if (!PHANDLE_VALID(isa)) | ||
2070 | return; | ||
2071 | |||
2072 | if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges)) | ||
2073 | == PROM_ERROR) | ||
2074 | return; | ||
2075 | |||
2076 | if (isa_ranges[0] != 0x1 || | ||
2077 | isa_ranges[1] != 0xf4000000 || | ||
2078 | isa_ranges[2] != 0x00010000) | ||
2079 | return; | ||
2080 | |||
2081 | prom_printf("fixing up bogus ISA range on Maple...\n"); | ||
2082 | |||
2083 | isa_ranges[0] = 0x1; | ||
2084 | isa_ranges[1] = 0x0; | ||
2085 | isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */ | ||
2086 | isa_ranges[3] = 0x0; | ||
2087 | isa_ranges[4] = 0x0; | ||
2088 | isa_ranges[5] = 0x00010000; | ||
2089 | prom_setprop(isa, "/ht@0/isa@4", "ranges", | ||
2090 | isa_ranges, sizeof(isa_ranges)); | ||
2091 | } | ||
2092 | #else | ||
2093 | #define fixup_device_tree_maple() | ||
2094 | #endif | ||
2095 | |||
2063 | #if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) | 2096 | #if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) |
2097 | static void __init fixup_device_tree_pmac(void) | ||
2098 | { | ||
2064 | phandle u3, i2c, mpic; | 2099 | phandle u3, i2c, mpic; |
2065 | u32 u3_rev; | 2100 | u32 u3_rev; |
2066 | u32 interrupts[2]; | 2101 | u32 interrupts[2]; |
@@ -2097,9 +2132,16 @@ static void __init fixup_device_tree(void) | |||
2097 | parent = (u32)mpic; | 2132 | parent = (u32)mpic; |
2098 | prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", | 2133 | prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", |
2099 | &parent, sizeof(parent)); | 2134 | &parent, sizeof(parent)); |
2100 | #endif | ||
2101 | } | 2135 | } |
2136 | #else | ||
2137 | #define fixup_device_tree_pmac() | ||
2138 | #endif | ||
2102 | 2139 | ||
2140 | static void __init fixup_device_tree(void) | ||
2141 | { | ||
2142 | fixup_device_tree_maple(); | ||
2143 | fixup_device_tree_pmac(); | ||
2144 | } | ||
2103 | 2145 | ||
2104 | static void __init prom_find_boot_cpu(void) | 2146 | static void __init prom_find_boot_cpu(void) |
2105 | { | 2147 | { |
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index df2343e1956b..c896ce83d412 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c | |||
@@ -1157,6 +1157,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_xfer); | |||
1157 | /* some quirks for platform function decoding */ | 1157 | /* some quirks for platform function decoding */ |
1158 | enum { | 1158 | enum { |
1159 | pmac_i2c_quirk_invmask = 0x00000001u, | 1159 | pmac_i2c_quirk_invmask = 0x00000001u, |
1160 | pmac_i2c_quirk_skip = 0x00000002u, | ||
1160 | }; | 1161 | }; |
1161 | 1162 | ||
1162 | static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, | 1163 | static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, |
@@ -1172,6 +1173,15 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, | |||
1172 | /* XXX Study device-tree's & apple drivers are get the quirks | 1173 | /* XXX Study device-tree's & apple drivers are get the quirks |
1173 | * right ! | 1174 | * right ! |
1174 | */ | 1175 | */ |
1176 | /* Workaround: It seems that running the clockspreading | ||
1177 | * properties on the eMac will cause lockups during boot. | ||
1178 | * The machine seems to work fine without that. So for now, | ||
1179 | * let's make sure i2c-hwclock doesn't match about "imic" | ||
1180 | * clocks and we'll figure out if we really need to do | ||
1181 | * something special about those later. | ||
1182 | */ | ||
1183 | { "i2c-hwclock", "imic5002", pmac_i2c_quirk_skip }, | ||
1184 | { "i2c-hwclock", "imic5003", pmac_i2c_quirk_skip }, | ||
1175 | { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask }, | 1185 | { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask }, |
1176 | { "i2c-cpu-voltage", NULL, 0}, | 1186 | { "i2c-cpu-voltage", NULL, 0}, |
1177 | { "temp-monitor", NULL, 0 }, | 1187 | { "temp-monitor", NULL, 0 }, |
@@ -1198,6 +1208,8 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, | |||
1198 | if (p->compatible && | 1208 | if (p->compatible && |
1199 | !device_is_compatible(np, p->compatible)) | 1209 | !device_is_compatible(np, p->compatible)) |
1200 | continue; | 1210 | continue; |
1211 | if (p->quirks & pmac_i2c_quirk_skip) | ||
1212 | break; | ||
1201 | callback(np, p->quirks); | 1213 | callback(np, p->quirks); |
1202 | break; | 1214 | break; |
1203 | } | 1215 | } |
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index 4baa75b1d36f..f08173b0f065 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/mutex.h> | ||
14 | 15 | ||
15 | #include <asm/semaphore.h> | 16 | #include <asm/semaphore.h> |
16 | #include <asm/prom.h> | 17 | #include <asm/prom.h> |
@@ -546,6 +547,7 @@ struct pmf_device { | |||
546 | 547 | ||
547 | static LIST_HEAD(pmf_devices); | 548 | static LIST_HEAD(pmf_devices); |
548 | static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED; | 549 | static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED; |
550 | static DEFINE_MUTEX(pmf_irq_mutex); | ||
549 | 551 | ||
550 | static void pmf_release_device(struct kref *kref) | 552 | static void pmf_release_device(struct kref *kref) |
551 | { | 553 | { |
@@ -864,15 +866,17 @@ int pmf_register_irq_client(struct device_node *target, | |||
864 | 866 | ||
865 | spin_lock_irqsave(&pmf_lock, flags); | 867 | spin_lock_irqsave(&pmf_lock, flags); |
866 | func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN); | 868 | func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN); |
867 | if (func == NULL) { | 869 | if (func) |
868 | spin_unlock_irqrestore(&pmf_lock, flags); | 870 | func = pmf_get_function(func); |
871 | spin_unlock_irqrestore(&pmf_lock, flags); | ||
872 | if (func == NULL) | ||
869 | return -ENODEV; | 873 | return -ENODEV; |
870 | } | 874 | mutex_lock(&pmf_irq_mutex); |
871 | if (list_empty(&func->irq_clients)) | 875 | if (list_empty(&func->irq_clients)) |
872 | func->dev->handlers->irq_enable(func); | 876 | func->dev->handlers->irq_enable(func); |
873 | list_add(&client->link, &func->irq_clients); | 877 | list_add(&client->link, &func->irq_clients); |
874 | client->func = func; | 878 | client->func = func; |
875 | spin_unlock_irqrestore(&pmf_lock, flags); | 879 | mutex_unlock(&pmf_irq_mutex); |
876 | 880 | ||
877 | return 0; | 881 | return 0; |
878 | } | 882 | } |
@@ -881,16 +885,16 @@ EXPORT_SYMBOL_GPL(pmf_register_irq_client); | |||
881 | void pmf_unregister_irq_client(struct pmf_irq_client *client) | 885 | void pmf_unregister_irq_client(struct pmf_irq_client *client) |
882 | { | 886 | { |
883 | struct pmf_function *func = client->func; | 887 | struct pmf_function *func = client->func; |
884 | unsigned long flags; | ||
885 | 888 | ||
886 | BUG_ON(func == NULL); | 889 | BUG_ON(func == NULL); |
887 | 890 | ||
888 | spin_lock_irqsave(&pmf_lock, flags); | 891 | mutex_lock(&pmf_irq_mutex); |
889 | client->func = NULL; | 892 | client->func = NULL; |
890 | list_del(&client->link); | 893 | list_del(&client->link); |
891 | if (list_empty(&func->irq_clients)) | 894 | if (list_empty(&func->irq_clients)) |
892 | func->dev->handlers->irq_disable(func); | 895 | func->dev->handlers->irq_disable(func); |
893 | spin_unlock_irqrestore(&pmf_lock, flags); | 896 | mutex_unlock(&pmf_irq_mutex); |
897 | pmf_put_function(func); | ||
894 | } | 898 | } |
895 | EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); | 899 | EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); |
896 | 900 | ||
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c index cc7c4aea9397..2f5c5e157617 100644 --- a/arch/ppc/kernel/asm-offsets.c +++ b/arch/ppc/kernel/asm-offsets.c | |||
@@ -134,7 +134,7 @@ main(void) | |||
134 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); | 134 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); |
135 | DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); | 135 | DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); |
136 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); | 136 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); |
137 | DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, flags)); | 137 | DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); |
138 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); | 138 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); |
139 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); | 139 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); |
140 | 140 | ||
diff --git a/arch/ppc/platforms/mpc8272ads_setup.c b/arch/ppc/platforms/mpc8272ads_setup.c index e62b75707f7a..abb7154de2c7 100644 --- a/arch/ppc/platforms/mpc8272ads_setup.c +++ b/arch/ppc/platforms/mpc8272ads_setup.c | |||
@@ -279,11 +279,11 @@ static int mpc8272ads_platform_notify(struct device *dev) | |||
279 | static const struct platform_notify_dev_map dev_map[] = { | 279 | static const struct platform_notify_dev_map dev_map[] = { |
280 | { | 280 | { |
281 | .bus_id = "fsl-cpm-fcc", | 281 | .bus_id = "fsl-cpm-fcc", |
282 | .rtn = mpc8272ads_fixup_enet_pdata | 282 | .rtn = mpc8272ads_fixup_enet_pdata, |
283 | }, | 283 | }, |
284 | { | 284 | { |
285 | .bus_id = "fsl-cpm-scc:uart", | 285 | .bus_id = "fsl-cpm-scc:uart", |
286 | .rtn = mpc | 286 | .rtn = mpc8272ads_fixup_uart_pdata, |
287 | }, | 287 | }, |
288 | { | 288 | { |
289 | .bus_id = NULL | 289 | .bus_id = NULL |
@@ -335,15 +335,15 @@ struct platform_device* early_uart_get_pdev(int index) | |||
335 | struct platform_device* pdev = NULL; | 335 | struct platform_device* pdev = NULL; |
336 | if(index) { /*assume SCC4 here*/ | 336 | if(index) { /*assume SCC4 here*/ |
337 | pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC4]; | 337 | pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC4]; |
338 | pinfo = &mpc8272<F12>_uart_pdata[1]; | 338 | pinfo = &mpc8272_uart_pdata[fsid_scc4_uart]; |
339 | } else { /*over SCC1*/ | 339 | } else { /*over SCC1*/ |
340 | pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC1]; | 340 | pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC1]; |
341 | pinfo = &mpc8272_uart_pdata[0]; | 341 | pinfo = &mpc8272_uart_pdata[fsid_scc1_uart]; |
342 | } | 342 | } |
343 | 343 | ||
344 | pinfo->uart_clk = bd->bi_intfreq; | 344 | pinfo->uart_clk = bd->bi_intfreq; |
345 | pdev->dev.platform_data = pinfo; | 345 | pdev->dev.platform_data = pinfo; |
346 | ppc_sys_fixup_mem_resource(pdev, IMAP_ADDR); | 346 | ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR); |
347 | return NULL; | 347 | return NULL; |
348 | } | 348 | } |
349 | 349 | ||
diff --git a/arch/ppc/syslib/pq2_devices.c b/arch/ppc/syslib/pq2_devices.c index 0636aed7b827..8692d00c08c4 100644 --- a/arch/ppc/syslib/pq2_devices.c +++ b/arch/ppc/syslib/pq2_devices.c | |||
@@ -121,13 +121,13 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
121 | .num_resources = 3, | 121 | .num_resources = 3, |
122 | .resource = (struct resource[]) { | 122 | .resource = (struct resource[]) { |
123 | { | 123 | { |
124 | .name = "scc_mem", | 124 | .name = "regs", |
125 | .start = 0x11A00, | 125 | .start = 0x11A00, |
126 | .end = 0x11A1F, | 126 | .end = 0x11A1F, |
127 | .flags = IORESOURCE_MEM, | 127 | .flags = IORESOURCE_MEM, |
128 | }, | 128 | }, |
129 | { | 129 | { |
130 | .name = "scc_pram", | 130 | .name = "pram", |
131 | .start = 0x8000, | 131 | .start = 0x8000, |
132 | .end = 0x80ff, | 132 | .end = 0x80ff, |
133 | .flags = IORESOURCE_MEM, | 133 | .flags = IORESOURCE_MEM, |
@@ -145,13 +145,13 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
145 | .num_resources = 3, | 145 | .num_resources = 3, |
146 | .resource = (struct resource[]) { | 146 | .resource = (struct resource[]) { |
147 | { | 147 | { |
148 | .name = "scc_mem", | 148 | .name = "regs", |
149 | .start = 0x11A20, | 149 | .start = 0x11A20, |
150 | .end = 0x11A3F, | 150 | .end = 0x11A3F, |
151 | .flags = IORESOURCE_MEM, | 151 | .flags = IORESOURCE_MEM, |
152 | }, | 152 | }, |
153 | { | 153 | { |
154 | .name = "scc_pram", | 154 | .name = "pram", |
155 | .start = 0x8100, | 155 | .start = 0x8100, |
156 | .end = 0x81ff, | 156 | .end = 0x81ff, |
157 | .flags = IORESOURCE_MEM, | 157 | .flags = IORESOURCE_MEM, |
@@ -169,13 +169,13 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
169 | .num_resources = 3, | 169 | .num_resources = 3, |
170 | .resource = (struct resource[]) { | 170 | .resource = (struct resource[]) { |
171 | { | 171 | { |
172 | .name = "scc_mem", | 172 | .name = "regs", |
173 | .start = 0x11A40, | 173 | .start = 0x11A40, |
174 | .end = 0x11A5F, | 174 | .end = 0x11A5F, |
175 | .flags = IORESOURCE_MEM, | 175 | .flags = IORESOURCE_MEM, |
176 | }, | 176 | }, |
177 | { | 177 | { |
178 | .name = "scc_pram", | 178 | .name = "pram", |
179 | .start = 0x8200, | 179 | .start = 0x8200, |
180 | .end = 0x82ff, | 180 | .end = 0x82ff, |
181 | .flags = IORESOURCE_MEM, | 181 | .flags = IORESOURCE_MEM, |
@@ -193,13 +193,13 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
193 | .num_resources = 3, | 193 | .num_resources = 3, |
194 | .resource = (struct resource[]) { | 194 | .resource = (struct resource[]) { |
195 | { | 195 | { |
196 | .name = "scc_mem", | 196 | .name = "regs", |
197 | .start = 0x11A60, | 197 | .start = 0x11A60, |
198 | .end = 0x11A7F, | 198 | .end = 0x11A7F, |
199 | .flags = IORESOURCE_MEM, | 199 | .flags = IORESOURCE_MEM, |
200 | }, | 200 | }, |
201 | { | 201 | { |
202 | .name = "scc_pram", | 202 | .name = "pram", |
203 | .start = 0x8300, | 203 | .start = 0x8300, |
204 | .end = 0x83ff, | 204 | .end = 0x83ff, |
205 | .flags = IORESOURCE_MEM, | 205 | .flags = IORESOURCE_MEM, |
diff --git a/arch/ppc/syslib/pq2_sys.c b/arch/ppc/syslib/pq2_sys.c index 433b0fa203e1..fee8948162b9 100644 --- a/arch/ppc/syslib/pq2_sys.c +++ b/arch/ppc/syslib/pq2_sys.c | |||
@@ -139,13 +139,13 @@ struct ppc_sys_spec ppc_sys_specs[] = { | |||
139 | .ppc_sys_name = "8272", | 139 | .ppc_sys_name = "8272", |
140 | .mask = 0x0000ff00, | 140 | .mask = 0x0000ff00, |
141 | .value = 0x00000c00, | 141 | .value = 0x00000c00, |
142 | .num_devices = 11, | 142 | .num_devices = 12, |
143 | .device_list = (enum ppc_sys_devices[]) | 143 | .device_list = (enum ppc_sys_devices[]) |
144 | { | 144 | { |
145 | MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1, | 145 | MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1, |
146 | MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1, | 146 | MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4, |
147 | MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, | 147 | MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, |
148 | MPC82xx_CPM_USB, MPC82xx_SEC1, | 148 | MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1, |
149 | }, | 149 | }, |
150 | }, | 150 | }, |
151 | /* below is a list of the 8280 family of processors */ | 151 | /* below is a list of the 8280 family of processors */ |
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S index 3eadac5e171e..31c5892f5acc 100644 --- a/arch/sparc64/kernel/head.S +++ b/arch/sparc64/kernel/head.S | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
11 | #include <linux/version.h> | 11 | #include <linux/version.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/threads.h> | ||
13 | #include <asm/thread_info.h> | 14 | #include <asm/thread_info.h> |
14 | #include <asm/asi.h> | 15 | #include <asm/asi.h> |
15 | #include <asm/pstate.h> | 16 | #include <asm/pstate.h> |
@@ -493,6 +494,35 @@ tlb_fixup_done: | |||
493 | call prom_init | 494 | call prom_init |
494 | mov %l7, %o0 ! OpenPROM cif handler | 495 | mov %l7, %o0 ! OpenPROM cif handler |
495 | 496 | ||
497 | /* Initialize current_thread_info()->cpu as early as possible. | ||
498 | * In order to do that accurately we have to patch up the get_cpuid() | ||
499 | * assembler sequences. And that, in turn, requires that we know | ||
500 | * if we are on a Starfire box or not. While we're here, patch up | ||
501 | * the sun4v sequences as well. | ||
502 | */ | ||
503 | call check_if_starfire | ||
504 | nop | ||
505 | call per_cpu_patch | ||
506 | nop | ||
507 | call sun4v_patch | ||
508 | nop | ||
509 | |||
510 | #ifdef CONFIG_SMP | ||
511 | call hard_smp_processor_id | ||
512 | nop | ||
513 | cmp %o0, NR_CPUS | ||
514 | blu,pt %xcc, 1f | ||
515 | nop | ||
516 | call boot_cpu_id_too_large | ||
517 | nop | ||
518 | /* Not reached... */ | ||
519 | |||
520 | 1: | ||
521 | #else | ||
522 | mov 0, %o0 | ||
523 | #endif | ||
524 | stb %o0, [%g6 + TI_CPU] | ||
525 | |||
496 | /* Off we go.... */ | 526 | /* Off we go.... */ |
497 | call start_kernel | 527 | call start_kernel |
498 | nop | 528 | nop |
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index 005167f82419..9cf1c88cd774 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c | |||
@@ -220,7 +220,7 @@ char reboot_command[COMMAND_LINE_SIZE]; | |||
220 | 220 | ||
221 | static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; | 221 | static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; |
222 | 222 | ||
223 | static void __init per_cpu_patch(void) | 223 | void __init per_cpu_patch(void) |
224 | { | 224 | { |
225 | struct cpuid_patch_entry *p; | 225 | struct cpuid_patch_entry *p; |
226 | unsigned long ver; | 226 | unsigned long ver; |
@@ -280,7 +280,7 @@ static void __init per_cpu_patch(void) | |||
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | static void __init sun4v_patch(void) | 283 | void __init sun4v_patch(void) |
284 | { | 284 | { |
285 | struct sun4v_1insn_patch_entry *p1; | 285 | struct sun4v_1insn_patch_entry *p1; |
286 | struct sun4v_2insn_patch_entry *p2; | 286 | struct sun4v_2insn_patch_entry *p2; |
@@ -315,6 +315,15 @@ static void __init sun4v_patch(void) | |||
315 | } | 315 | } |
316 | } | 316 | } |
317 | 317 | ||
318 | #ifdef CONFIG_SMP | ||
319 | void __init boot_cpu_id_too_large(int cpu) | ||
320 | { | ||
321 | prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n", | ||
322 | cpu, NR_CPUS); | ||
323 | prom_halt(); | ||
324 | } | ||
325 | #endif | ||
326 | |||
318 | void __init setup_arch(char **cmdline_p) | 327 | void __init setup_arch(char **cmdline_p) |
319 | { | 328 | { |
320 | /* Initialize PROM console and command line. */ | 329 | /* Initialize PROM console and command line. */ |
@@ -332,16 +341,6 @@ void __init setup_arch(char **cmdline_p) | |||
332 | conswitchp = &prom_con; | 341 | conswitchp = &prom_con; |
333 | #endif | 342 | #endif |
334 | 343 | ||
335 | /* Work out if we are starfire early on */ | ||
336 | check_if_starfire(); | ||
337 | |||
338 | /* Now we know enough to patch the get_cpuid sequences | ||
339 | * used by trap code. | ||
340 | */ | ||
341 | per_cpu_patch(); | ||
342 | |||
343 | sun4v_patch(); | ||
344 | |||
345 | boot_flags_init(*cmdline_p); | 344 | boot_flags_init(*cmdline_p); |
346 | 345 | ||
347 | idprom_init(); | 346 | idprom_init(); |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 90eaca3ec9a6..4e8cd79156e0 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -1264,7 +1264,6 @@ void __init smp_tick_init(void) | |||
1264 | boot_cpu_id = hard_smp_processor_id(); | 1264 | boot_cpu_id = hard_smp_processor_id(); |
1265 | current_tick_offset = timer_tick_offset; | 1265 | current_tick_offset = timer_tick_offset; |
1266 | 1266 | ||
1267 | cpu_set(boot_cpu_id, cpu_online_map); | ||
1268 | prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1; | 1267 | prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1; |
1269 | } | 1268 | } |
1270 | 1269 | ||
@@ -1345,18 +1344,6 @@ void __init smp_setup_cpu_possible_map(void) | |||
1345 | 1344 | ||
1346 | void __devinit smp_prepare_boot_cpu(void) | 1345 | void __devinit smp_prepare_boot_cpu(void) |
1347 | { | 1346 | { |
1348 | int cpu = hard_smp_processor_id(); | ||
1349 | |||
1350 | if (cpu >= NR_CPUS) { | ||
1351 | prom_printf("Serious problem, boot cpu id >= NR_CPUS\n"); | ||
1352 | prom_halt(); | ||
1353 | } | ||
1354 | |||
1355 | current_thread_info()->cpu = cpu; | ||
1356 | __local_per_cpu_offset = __per_cpu_offset(cpu); | ||
1357 | |||
1358 | cpu_set(smp_processor_id(), cpu_online_map); | ||
1359 | cpu_set(smp_processor_id(), phys_cpu_present_map); | ||
1360 | } | 1347 | } |
1361 | 1348 | ||
1362 | int __devinit __cpu_up(unsigned int cpu) | 1349 | int __devinit __cpu_up(unsigned int cpu) |
@@ -1433,4 +1420,7 @@ void __init setup_per_cpu_areas(void) | |||
1433 | 1420 | ||
1434 | for (i = 0; i < NR_CPUS; i++, ptr += size) | 1421 | for (i = 0; i < NR_CPUS; i++, ptr += size) |
1435 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); | 1422 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); |
1423 | |||
1424 | /* Setup %g5 for the boot cpu. */ | ||
1425 | __local_per_cpu_offset = __per_cpu_offset(smp_processor_id()); | ||
1436 | } | 1426 | } |
diff --git a/arch/sparc64/lib/checksum.S b/arch/sparc64/lib/checksum.S index ba9cd3ccc2b2..1d230f693dc4 100644 --- a/arch/sparc64/lib/checksum.S +++ b/arch/sparc64/lib/checksum.S | |||
@@ -165,8 +165,9 @@ csum_partial_end_cruft: | |||
165 | sll %g1, 8, %g1 | 165 | sll %g1, 8, %g1 |
166 | or %o5, %g1, %o4 | 166 | or %o5, %g1, %o4 |
167 | 167 | ||
168 | 1: add %o2, %o4, %o2 | 168 | 1: addcc %o2, %o4, %o2 |
169 | addc %g0, %o2, %o2 | ||
169 | 170 | ||
170 | csum_partial_finish: | 171 | csum_partial_finish: |
171 | retl | 172 | retl |
172 | mov %o2, %o0 | 173 | srl %o2, 0, %o0 |
diff --git a/arch/sparc64/lib/csum_copy.S b/arch/sparc64/lib/csum_copy.S index 71af48839064..e566c770a0f6 100644 --- a/arch/sparc64/lib/csum_copy.S +++ b/arch/sparc64/lib/csum_copy.S | |||
@@ -221,11 +221,12 @@ FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */ | |||
221 | sll %g1, 8, %g1 | 221 | sll %g1, 8, %g1 |
222 | or %o5, %g1, %o4 | 222 | or %o5, %g1, %o4 |
223 | 223 | ||
224 | 1: add %o3, %o4, %o3 | 224 | 1: addcc %o3, %o4, %o3 |
225 | addc %g0, %o3, %o3 | ||
225 | 226 | ||
226 | 70: | 227 | 70: |
227 | retl | 228 | retl |
228 | mov %o3, %o0 | 229 | srl %o3, 0, %o0 |
229 | 230 | ||
230 | 95: mov 0, GLOBAL_SPARE | 231 | 95: mov 0, GLOBAL_SPARE |
231 | brlez,pn %o2, 4f | 232 | brlez,pn %o2, 4f |
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 7a0e04e34bf9..b65ca115ef77 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 | |||
@@ -33,5 +33,9 @@ include $(srctree)/arch/i386/Makefile.cpu | |||
33 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. | 33 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. |
34 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) | 34 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) |
35 | 35 | ||
36 | # Prevent sprintf in nfsd from being converted to strcpy and resulting in | ||
37 | # an unresolved reference. | ||
38 | cflags-y += -ffreestanding | ||
39 | |||
36 | CFLAGS += $(cflags-y) | 40 | CFLAGS += $(cflags-y) |
37 | USER_CFLAGS += $(cflags-y) | 41 | USER_CFLAGS += $(cflags-y) |
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index efa3d33c0be6..310980b32173 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
@@ -120,20 +120,11 @@ extern int is_syscall(unsigned long addr); | |||
120 | extern void free_irq(unsigned int, void *); | 120 | extern void free_irq(unsigned int, void *); |
121 | extern int cpu(void); | 121 | extern int cpu(void); |
122 | 122 | ||
123 | extern void time_init_kern(void); | ||
124 | |||
123 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ | 125 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ |
124 | extern int __cant_sleep(void); | 126 | extern int __cant_sleep(void); |
125 | extern void segv_handler(int sig, union uml_pt_regs *regs); | 127 | extern void segv_handler(int sig, union uml_pt_regs *regs); |
126 | extern void sigio_handler(int sig, union uml_pt_regs *regs); | 128 | extern void sigio_handler(int sig, union uml_pt_regs *regs); |
127 | 129 | ||
128 | #endif | 130 | #endif |
129 | |||
130 | /* | ||
131 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
132 | * Emacs will notice this stuff at the end of the file and automatically | ||
133 | * adjust the settings for this buffer only. This must remain at the end | ||
134 | * of the file. | ||
135 | * --------------------------------------------------------------------------- | ||
136 | * Local variables: | ||
137 | * c-file-style: "linux" | ||
138 | * End: | ||
139 | */ | ||
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 528cf623f8b4..86f51d04c98d 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c | |||
@@ -84,6 +84,16 @@ void timer_irq(union uml_pt_regs *regs) | |||
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | |||
88 | void time_init_kern(void) | ||
89 | { | ||
90 | unsigned long long nsecs; | ||
91 | |||
92 | nsecs = os_nsecs(); | ||
93 | set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION, | ||
94 | -nsecs % BILLION); | ||
95 | } | ||
96 | |||
87 | void do_boot_timer_handler(struct sigcontext * sc) | 97 | void do_boot_timer_handler(struct sigcontext * sc) |
88 | { | 98 | { |
89 | struct pt_regs regs; | 99 | struct pt_regs regs; |
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 3a0ac38e978b..90912aaca7aa 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -59,7 +59,7 @@ static __init void do_uml_initcalls(void) | |||
59 | initcall_t *call; | 59 | initcall_t *call; |
60 | 60 | ||
61 | call = &__uml_initcall_start; | 61 | call = &__uml_initcall_start; |
62 | while (call < &__uml_initcall_end){; | 62 | while (call < &__uml_initcall_end){ |
63 | (*call)(); | 63 | (*call)(); |
64 | call++; | 64 | call++; |
65 | } | 65 | } |
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index 6f7626775acb..280c4fb9b585 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c | |||
@@ -81,20 +81,12 @@ void uml_idle_timer(void) | |||
81 | set_interval(ITIMER_REAL); | 81 | set_interval(ITIMER_REAL); |
82 | } | 82 | } |
83 | 83 | ||
84 | extern void ktime_get_ts(struct timespec *ts); | ||
85 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | ||
86 | |||
87 | void time_init(void) | 84 | void time_init(void) |
88 | { | 85 | { |
89 | struct timespec now; | ||
90 | |||
91 | if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) | 86 | if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) |
92 | panic("Couldn't set SIGVTALRM handler"); | 87 | panic("Couldn't set SIGVTALRM handler"); |
93 | set_interval(ITIMER_VIRTUAL); | 88 | set_interval(ITIMER_VIRTUAL); |
94 | 89 | time_init_kern(); | |
95 | do_posix_clock_monotonic_gettime(&now); | ||
96 | wall_to_monotonic.tv_sec = -now.tv_sec; | ||
97 | wall_to_monotonic.tv_nsec = -now.tv_nsec; | ||
98 | } | 90 | } |
99 | 91 | ||
100 | unsigned long long os_nsecs(void) | 92 | unsigned long long os_nsecs(void) |
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c index 749dd1bfe60f..710d5fb807e1 100644 --- a/arch/um/sys-i386/syscalls.c +++ b/arch/um/sys-i386/syscalls.c | |||
@@ -99,11 +99,12 @@ long sys_ipc (uint call, int first, int second, | |||
99 | 99 | ||
100 | switch (call) { | 100 | switch (call) { |
101 | case SEMOP: | 101 | case SEMOP: |
102 | return sys_semtimedop(first, (struct sembuf *) ptr, second, | 102 | return sys_semtimedop(first, (struct sembuf __user *) ptr, |
103 | NULL); | 103 | second, NULL); |
104 | case SEMTIMEDOP: | 104 | case SEMTIMEDOP: |
105 | return sys_semtimedop(first, (struct sembuf *) ptr, second, | 105 | return sys_semtimedop(first, (struct sembuf __user *) ptr, |
106 | (const struct timespec *) fifth); | 106 | second, |
107 | (const struct timespec __user *) fifth); | ||
107 | case SEMGET: | 108 | case SEMGET: |
108 | return sys_semget (first, second, third); | 109 | return sys_semget (first, second, third); |
109 | case SEMCTL: { | 110 | case SEMCTL: { |
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index a4c46a8af008..9edf114faf79 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "skas.h" | 21 | #include "skas.h" |
22 | 22 | ||
23 | static int copy_sc_from_user_skas(struct pt_regs *regs, | 23 | static int copy_sc_from_user_skas(struct pt_regs *regs, |
24 | struct sigcontext *from) | 24 | struct sigcontext __user *from) |
25 | { | 25 | { |
26 | int err = 0; | 26 | int err = 0; |
27 | 27 | ||
@@ -54,7 +54,8 @@ static int copy_sc_from_user_skas(struct pt_regs *regs, | |||
54 | return(err); | 54 | return(err); |
55 | } | 55 | } |
56 | 56 | ||
57 | int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, | 57 | int copy_sc_to_user_skas(struct sigcontext __user *to, |
58 | struct _fpstate __user *to_fp, | ||
58 | struct pt_regs *regs, unsigned long mask, | 59 | struct pt_regs *regs, unsigned long mask, |
59 | unsigned long sp) | 60 | unsigned long sp) |
60 | { | 61 | { |
@@ -106,10 +107,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, | |||
106 | #endif | 107 | #endif |
107 | 108 | ||
108 | #ifdef CONFIG_MODE_TT | 109 | #ifdef CONFIG_MODE_TT |
109 | int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, | 110 | int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from, |
110 | int fpsize) | 111 | int fpsize) |
111 | { | 112 | { |
112 | struct _fpstate *to_fp, *from_fp; | 113 | struct _fpstate *to_fp; |
114 | struct _fpstate __user *from_fp; | ||
113 | unsigned long sigs; | 115 | unsigned long sigs; |
114 | int err; | 116 | int err; |
115 | 117 | ||
@@ -124,13 +126,14 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, | |||
124 | return(err); | 126 | return(err); |
125 | } | 127 | } |
126 | 128 | ||
127 | int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, | 129 | int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp, |
128 | struct sigcontext *from, int fpsize, unsigned long sp) | 130 | struct sigcontext *from, int fpsize, unsigned long sp) |
129 | { | 131 | { |
130 | struct _fpstate *to_fp, *from_fp; | 132 | struct _fpstate __user *to_fp; |
133 | struct _fpstate *from_fp; | ||
131 | int err; | 134 | int err; |
132 | 135 | ||
133 | to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); | 136 | to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1)); |
134 | from_fp = from->fpstate; | 137 | from_fp = from->fpstate; |
135 | err = copy_to_user(to, from, sizeof(*to)); | 138 | err = copy_to_user(to, from, sizeof(*to)); |
136 | /* The SP in the sigcontext is the updated one for the signal | 139 | /* The SP in the sigcontext is the updated one for the signal |
@@ -158,7 +161,8 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from) | |||
158 | return(ret); | 161 | return(ret); |
159 | } | 162 | } |
160 | 163 | ||
161 | static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, | 164 | static int copy_sc_to_user(struct sigcontext __user *to, |
165 | struct _fpstate __user *fp, | ||
162 | struct pt_regs *from, unsigned long mask, | 166 | struct pt_regs *from, unsigned long mask, |
163 | unsigned long sp) | 167 | unsigned long sp) |
164 | { | 168 | { |
@@ -169,7 +173,7 @@ static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, | |||
169 | 173 | ||
170 | struct rt_sigframe | 174 | struct rt_sigframe |
171 | { | 175 | { |
172 | char *pretcode; | 176 | char __user *pretcode; |
173 | struct ucontext uc; | 177 | struct ucontext uc; |
174 | struct siginfo info; | 178 | struct siginfo info; |
175 | }; | 179 | }; |
@@ -188,7 +192,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
188 | 192 | ||
189 | frame = (struct rt_sigframe __user *) | 193 | frame = (struct rt_sigframe __user *) |
190 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; | 194 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; |
191 | frame = (struct rt_sigframe *) ((unsigned long) frame - 128); | 195 | frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128); |
192 | 196 | ||
193 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) | 197 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) |
194 | goto out; | 198 | goto out; |
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index 6acee5c4ada6..6fce9f45dfdc 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -45,7 +45,7 @@ static long arch_prctl_tt(int code, unsigned long addr) | |||
45 | case ARCH_GET_GS: | 45 | case ARCH_GET_GS: |
46 | ret = arch_prctl(code, (unsigned long) &tmp); | 46 | ret = arch_prctl(code, (unsigned long) &tmp); |
47 | if(!ret) | 47 | if(!ret) |
48 | ret = put_user(tmp, &addr); | 48 | ret = put_user(tmp, (long __user *)addr); |
49 | break; | 49 | break; |
50 | default: | 50 | default: |
51 | ret = -EINVAL; | 51 | ret = -EINVAL; |
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c index e776139afb20..926c4743d13b 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86_64/ia32/ia32_binfmt.c | |||
@@ -339,7 +339,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, | |||
339 | struct mm_struct *mm = current->mm; | 339 | struct mm_struct *mm = current->mm; |
340 | int i, ret; | 340 | int i, ret; |
341 | 341 | ||
342 | stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE; | 342 | stack_base = stack_top - MAX_ARG_PAGES * PAGE_SIZE; |
343 | mm->arg_start = bprm->p + stack_base; | 343 | mm->arg_start = bprm->p + stack_base; |
344 | 344 | ||
345 | bprm->p += stack_base; | 345 | bprm->p += stack_base; |
@@ -357,7 +357,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, | |||
357 | { | 357 | { |
358 | mpnt->vm_mm = mm; | 358 | mpnt->vm_mm = mm; |
359 | mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; | 359 | mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; |
360 | mpnt->vm_end = IA32_STACK_TOP; | 360 | mpnt->vm_end = stack_top; |
361 | if (executable_stack == EXSTACK_ENABLE_X) | 361 | if (executable_stack == EXSTACK_ENABLE_X) |
362 | mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; | 362 | mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; |
363 | else if (executable_stack == EXSTACK_DISABLE_X) | 363 | else if (executable_stack == EXSTACK_DISABLE_X) |
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index 222b5b46d2b2..1ef6028f721e 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c | |||
@@ -149,7 +149,7 @@ unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsi | |||
149 | addr = start; | 149 | addr = start; |
150 | if (addr > ei->addr + ei->size) | 150 | if (addr > ei->addr + ei->size) |
151 | continue; | 151 | continue; |
152 | while (bad_addr(&addr, size) && addr+size < ei->addr + ei->size) | 152 | while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size) |
153 | ; | 153 | ; |
154 | last = addr + size; | 154 | last = addr + size; |
155 | if (last > ei->addr + ei->size) | 155 | if (last > ei->addr + ei->size) |
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index c946e4fe67a7..586b34c00c48 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S | |||
@@ -281,12 +281,7 @@ tracesys: | |||
281 | ja 1f | 281 | ja 1f |
282 | movq %r10,%rcx /* fixup for C */ | 282 | movq %r10,%rcx /* fixup for C */ |
283 | call *sys_call_table(,%rax,8) | 283 | call *sys_call_table(,%rax,8) |
284 | movq %rax,RAX-ARGOFFSET(%rsp) | 284 | 1: movq %rax,RAX-ARGOFFSET(%rsp) |
285 | 1: SAVE_REST | ||
286 | movq %rsp,%rdi | ||
287 | call syscall_trace_leave | ||
288 | RESTORE_TOP_OF_STACK %rbx | ||
289 | RESTORE_REST | ||
290 | /* Use IRET because user could have changed frame */ | 285 | /* Use IRET because user could have changed frame */ |
291 | jmp int_ret_from_sys_call | 286 | jmp int_ret_from_sys_call |
292 | CFI_ENDPROC | 287 | CFI_ENDPROC |
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c index af035ede70cd..a9275c9557cf 100644 --- a/arch/x86_64/kernel/pci-dma.c +++ b/arch/x86_64/kernel/pci-dma.c | |||
@@ -54,6 +54,10 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order) | |||
54 | else | 54 | else |
55 | #endif | 55 | #endif |
56 | node = numa_node_id(); | 56 | node = numa_node_id(); |
57 | |||
58 | if (node < first_node(node_online_map)) | ||
59 | node = first_node(node_online_map); | ||
60 | |||
57 | page = alloc_pages_node(node, gfp, order); | 61 | page = alloc_pages_node(node, gfp, order); |
58 | return page ? page_address(page) : NULL; | 62 | return page ? page_address(page) : NULL; |
59 | } | 63 | } |
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index 2480d3f08a47..82a7c9bfdfa0 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c | |||
@@ -631,10 +631,8 @@ static int __init pci_iommu_init(void) | |||
631 | printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n"); | 631 | printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n"); |
632 | if (end_pfn > MAX_DMA32_PFN) { | 632 | if (end_pfn > MAX_DMA32_PFN) { |
633 | printk(KERN_ERR "WARNING more than 4GB of memory " | 633 | printk(KERN_ERR "WARNING more than 4GB of memory " |
634 | "but IOMMU not compiled in.\n" | 634 | "but IOMMU not available.\n" |
635 | KERN_ERR "WARNING 32bit PCI may malfunction.\n" | 635 | KERN_ERR "WARNING 32bit PCI may malfunction.\n"); |
636 | KERN_ERR "You might want to enable " | ||
637 | "CONFIG_GART_IOMMU\n"); | ||
638 | } | 636 | } |
639 | return -1; | 637 | return -1; |
640 | } | 638 | } |
diff --git a/arch/x86_64/kernel/pmtimer.c b/arch/x86_64/kernel/pmtimer.c index b0444a415bd6..bf421ed26808 100644 --- a/arch/x86_64/kernel/pmtimer.c +++ b/arch/x86_64/kernel/pmtimer.c | |||
@@ -68,7 +68,7 @@ int pmtimer_mark_offset(void) | |||
68 | offset_delay = delta % (USEC_PER_SEC / HZ); | 68 | offset_delay = delta % (USEC_PER_SEC / HZ); |
69 | 69 | ||
70 | rdtscll(tsc); | 70 | rdtscll(tsc); |
71 | vxtime.last_tsc = tsc - offset_delay * cpu_khz; | 71 | vxtime.last_tsc = tsc - offset_delay * (u64)cpu_khz / 1000; |
72 | 72 | ||
73 | /* don't calculate delay for first run, | 73 | /* don't calculate delay for first run, |
74 | or if we've got less then a tick */ | 74 | or if we've got less then a tick */ |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index f0870bef24d1..655b9192eeb3 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -1051,7 +1051,7 @@ static void srat_detect_node(void) | |||
1051 | for now. */ | 1051 | for now. */ |
1052 | node = apicid_to_node[hard_smp_processor_id()]; | 1052 | node = apicid_to_node[hard_smp_processor_id()]; |
1053 | if (node == NUMA_NO_NODE) | 1053 | if (node == NUMA_NO_NODE) |
1054 | node = 0; | 1054 | node = first_node(node_online_map); |
1055 | numa_set_node(cpu, node); | 1055 | numa_set_node(cpu, node); |
1056 | 1056 | ||
1057 | if (acpi_numa > 0) | 1057 | if (acpi_numa > 0) |
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index e1513532df29..474df22c6ed2 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c | |||
@@ -399,8 +399,10 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
399 | /* First clean up the node list */ | 399 | /* First clean up the node list */ |
400 | for (i = 0; i < MAX_NUMNODES; i++) { | 400 | for (i = 0; i < MAX_NUMNODES; i++) { |
401 | cutoff_node(i, start, end); | 401 | cutoff_node(i, start, end); |
402 | if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) | 402 | if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) { |
403 | unparse_node(i); | 403 | unparse_node(i); |
404 | node_set_offline(i); | ||
405 | } | ||
404 | } | 406 | } |
405 | 407 | ||
406 | if (acpi_numa <= 0) | 408 | if (acpi_numa <= 0) |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 2540dfaa3e38..8e9d84825e1c 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -33,7 +33,7 @@ static int cfq_slice_idle = HZ / 70; | |||
33 | 33 | ||
34 | #define CFQ_KEY_ASYNC (0) | 34 | #define CFQ_KEY_ASYNC (0) |
35 | 35 | ||
36 | static DEFINE_RWLOCK(cfq_exit_lock); | 36 | static DEFINE_SPINLOCK(cfq_exit_lock); |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * for the hash of cfqq inside the cfqd | 39 | * for the hash of cfqq inside the cfqd |
@@ -133,6 +133,7 @@ struct cfq_data { | |||
133 | mempool_t *crq_pool; | 133 | mempool_t *crq_pool; |
134 | 134 | ||
135 | int rq_in_driver; | 135 | int rq_in_driver; |
136 | int hw_tag; | ||
136 | 137 | ||
137 | /* | 138 | /* |
138 | * schedule slice state info | 139 | * schedule slice state info |
@@ -500,10 +501,13 @@ static void cfq_resort_rr_list(struct cfq_queue *cfqq, int preempted) | |||
500 | 501 | ||
501 | /* | 502 | /* |
502 | * if queue was preempted, just add to front to be fair. busy_rr | 503 | * if queue was preempted, just add to front to be fair. busy_rr |
503 | * isn't sorted. | 504 | * isn't sorted, but insert at the back for fairness. |
504 | */ | 505 | */ |
505 | if (preempted || list == &cfqd->busy_rr) { | 506 | if (preempted || list == &cfqd->busy_rr) { |
506 | list_add(&cfqq->cfq_list, list); | 507 | if (preempted) |
508 | list = list->prev; | ||
509 | |||
510 | list_add_tail(&cfqq->cfq_list, list); | ||
507 | return; | 511 | return; |
508 | } | 512 | } |
509 | 513 | ||
@@ -664,6 +668,15 @@ static void cfq_activate_request(request_queue_t *q, struct request *rq) | |||
664 | struct cfq_data *cfqd = q->elevator->elevator_data; | 668 | struct cfq_data *cfqd = q->elevator->elevator_data; |
665 | 669 | ||
666 | cfqd->rq_in_driver++; | 670 | cfqd->rq_in_driver++; |
671 | |||
672 | /* | ||
673 | * If the depth is larger 1, it really could be queueing. But lets | ||
674 | * make the mark a little higher - idling could still be good for | ||
675 | * low queueing, and a low queueing number could also just indicate | ||
676 | * a SCSI mid layer like behaviour where limit+1 is often seen. | ||
677 | */ | ||
678 | if (!cfqd->hw_tag && cfqd->rq_in_driver > 4) | ||
679 | cfqd->hw_tag = 1; | ||
667 | } | 680 | } |
668 | 681 | ||
669 | static void cfq_deactivate_request(request_queue_t *q, struct request *rq) | 682 | static void cfq_deactivate_request(request_queue_t *q, struct request *rq) |
@@ -879,6 +892,13 @@ static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd) | |||
879 | cfqq = list_entry_cfqq(cfqd->cur_rr.next); | 892 | cfqq = list_entry_cfqq(cfqd->cur_rr.next); |
880 | 893 | ||
881 | /* | 894 | /* |
895 | * If no new queues are available, check if the busy list has some | ||
896 | * before falling back to idle io. | ||
897 | */ | ||
898 | if (!cfqq && !list_empty(&cfqd->busy_rr)) | ||
899 | cfqq = list_entry_cfqq(cfqd->busy_rr.next); | ||
900 | |||
901 | /* | ||
882 | * if we have idle queues and no rt or be queues had pending | 902 | * if we have idle queues and no rt or be queues had pending |
883 | * requests, either allow immediate service if the grace period | 903 | * requests, either allow immediate service if the grace period |
884 | * has passed or arm the idle grace timer | 904 | * has passed or arm the idle grace timer |
@@ -1284,7 +1304,7 @@ static void cfq_exit_io_context(struct io_context *ioc) | |||
1284 | /* | 1304 | /* |
1285 | * put the reference this task is holding to the various queues | 1305 | * put the reference this task is holding to the various queues |
1286 | */ | 1306 | */ |
1287 | read_lock_irqsave(&cfq_exit_lock, flags); | 1307 | spin_lock_irqsave(&cfq_exit_lock, flags); |
1288 | 1308 | ||
1289 | n = rb_first(&ioc->cic_root); | 1309 | n = rb_first(&ioc->cic_root); |
1290 | while (n != NULL) { | 1310 | while (n != NULL) { |
@@ -1294,7 +1314,7 @@ static void cfq_exit_io_context(struct io_context *ioc) | |||
1294 | n = rb_next(n); | 1314 | n = rb_next(n); |
1295 | } | 1315 | } |
1296 | 1316 | ||
1297 | read_unlock_irqrestore(&cfq_exit_lock, flags); | 1317 | spin_unlock_irqrestore(&cfq_exit_lock, flags); |
1298 | } | 1318 | } |
1299 | 1319 | ||
1300 | static struct cfq_io_context * | 1320 | static struct cfq_io_context * |
@@ -1400,17 +1420,17 @@ static int cfq_ioc_set_ioprio(struct io_context *ioc, unsigned int ioprio) | |||
1400 | struct cfq_io_context *cic; | 1420 | struct cfq_io_context *cic; |
1401 | struct rb_node *n; | 1421 | struct rb_node *n; |
1402 | 1422 | ||
1403 | write_lock(&cfq_exit_lock); | 1423 | spin_lock(&cfq_exit_lock); |
1404 | 1424 | ||
1405 | n = rb_first(&ioc->cic_root); | 1425 | n = rb_first(&ioc->cic_root); |
1406 | while (n != NULL) { | 1426 | while (n != NULL) { |
1407 | cic = rb_entry(n, struct cfq_io_context, rb_node); | 1427 | cic = rb_entry(n, struct cfq_io_context, rb_node); |
1408 | 1428 | ||
1409 | changed_ioprio(cic); | 1429 | changed_ioprio(cic); |
1410 | n = rb_next(n); | 1430 | n = rb_next(n); |
1411 | } | 1431 | } |
1412 | 1432 | ||
1413 | write_unlock(&cfq_exit_lock); | 1433 | spin_unlock(&cfq_exit_lock); |
1414 | 1434 | ||
1415 | return 0; | 1435 | return 0; |
1416 | } | 1436 | } |
@@ -1458,7 +1478,8 @@ retry: | |||
1458 | * set ->slice_left to allow preemption for a new process | 1478 | * set ->slice_left to allow preemption for a new process |
1459 | */ | 1479 | */ |
1460 | cfqq->slice_left = 2 * cfqd->cfq_slice_idle; | 1480 | cfqq->slice_left = 2 * cfqd->cfq_slice_idle; |
1461 | cfq_mark_cfqq_idle_window(cfqq); | 1481 | if (!cfqd->hw_tag) |
1482 | cfq_mark_cfqq_idle_window(cfqq); | ||
1462 | cfq_mark_cfqq_prio_changed(cfqq); | 1483 | cfq_mark_cfqq_prio_changed(cfqq); |
1463 | cfq_init_prio_data(cfqq); | 1484 | cfq_init_prio_data(cfqq); |
1464 | } | 1485 | } |
@@ -1475,9 +1496,10 @@ out: | |||
1475 | static void | 1496 | static void |
1476 | cfq_drop_dead_cic(struct io_context *ioc, struct cfq_io_context *cic) | 1497 | cfq_drop_dead_cic(struct io_context *ioc, struct cfq_io_context *cic) |
1477 | { | 1498 | { |
1478 | read_lock(&cfq_exit_lock); | 1499 | spin_lock(&cfq_exit_lock); |
1479 | rb_erase(&cic->rb_node, &ioc->cic_root); | 1500 | rb_erase(&cic->rb_node, &ioc->cic_root); |
1480 | read_unlock(&cfq_exit_lock); | 1501 | list_del_init(&cic->queue_list); |
1502 | spin_unlock(&cfq_exit_lock); | ||
1481 | kmem_cache_free(cfq_ioc_pool, cic); | 1503 | kmem_cache_free(cfq_ioc_pool, cic); |
1482 | atomic_dec(&ioc_count); | 1504 | atomic_dec(&ioc_count); |
1483 | } | 1505 | } |
@@ -1545,11 +1567,11 @@ restart: | |||
1545 | BUG(); | 1567 | BUG(); |
1546 | } | 1568 | } |
1547 | 1569 | ||
1548 | read_lock(&cfq_exit_lock); | 1570 | spin_lock(&cfq_exit_lock); |
1549 | rb_link_node(&cic->rb_node, parent, p); | 1571 | rb_link_node(&cic->rb_node, parent, p); |
1550 | rb_insert_color(&cic->rb_node, &ioc->cic_root); | 1572 | rb_insert_color(&cic->rb_node, &ioc->cic_root); |
1551 | list_add(&cic->queue_list, &cfqd->cic_list); | 1573 | list_add(&cic->queue_list, &cfqd->cic_list); |
1552 | read_unlock(&cfq_exit_lock); | 1574 | spin_unlock(&cfq_exit_lock); |
1553 | } | 1575 | } |
1554 | 1576 | ||
1555 | /* | 1577 | /* |
@@ -1648,7 +1670,7 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
1648 | { | 1670 | { |
1649 | int enable_idle = cfq_cfqq_idle_window(cfqq); | 1671 | int enable_idle = cfq_cfqq_idle_window(cfqq); |
1650 | 1672 | ||
1651 | if (!cic->ioc->task || !cfqd->cfq_slice_idle) | 1673 | if (!cic->ioc->task || !cfqd->cfq_slice_idle || cfqd->hw_tag) |
1652 | enable_idle = 0; | 1674 | enable_idle = 0; |
1653 | else if (sample_valid(cic->ttime_samples)) { | 1675 | else if (sample_valid(cic->ttime_samples)) { |
1654 | if (cic->ttime_mean > cfqd->cfq_slice_idle) | 1676 | if (cic->ttime_mean > cfqd->cfq_slice_idle) |
@@ -1739,14 +1761,24 @@ cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
1739 | 1761 | ||
1740 | cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq); | 1762 | cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq); |
1741 | 1763 | ||
1764 | cic = crq->io_context; | ||
1765 | |||
1742 | /* | 1766 | /* |
1743 | * we never wait for an async request and we don't allow preemption | 1767 | * we never wait for an async request and we don't allow preemption |
1744 | * of an async request. so just return early | 1768 | * of an async request. so just return early |
1745 | */ | 1769 | */ |
1746 | if (!cfq_crq_is_sync(crq)) | 1770 | if (!cfq_crq_is_sync(crq)) { |
1771 | /* | ||
1772 | * sync process issued an async request, if it's waiting | ||
1773 | * then expire it and kick rq handling. | ||
1774 | */ | ||
1775 | if (cic == cfqd->active_cic && | ||
1776 | del_timer(&cfqd->idle_slice_timer)) { | ||
1777 | cfq_slice_expired(cfqd, 0); | ||
1778 | cfq_start_queueing(cfqd, cfqq); | ||
1779 | } | ||
1747 | return; | 1780 | return; |
1748 | 1781 | } | |
1749 | cic = crq->io_context; | ||
1750 | 1782 | ||
1751 | cfq_update_io_thinktime(cfqd, cic); | 1783 | cfq_update_io_thinktime(cfqd, cic); |
1752 | cfq_update_io_seektime(cfqd, cic, crq); | 1784 | cfq_update_io_seektime(cfqd, cic, crq); |
@@ -2164,10 +2196,9 @@ static void cfq_idle_class_timer(unsigned long data) | |||
2164 | * race with a non-idle queue, reset timer | 2196 | * race with a non-idle queue, reset timer |
2165 | */ | 2197 | */ |
2166 | end = cfqd->last_end_request + CFQ_IDLE_GRACE; | 2198 | end = cfqd->last_end_request + CFQ_IDLE_GRACE; |
2167 | if (!time_after_eq(jiffies, end)) { | 2199 | if (!time_after_eq(jiffies, end)) |
2168 | cfqd->idle_class_timer.expires = end; | 2200 | mod_timer(&cfqd->idle_class_timer, end); |
2169 | add_timer(&cfqd->idle_class_timer); | 2201 | else |
2170 | } else | ||
2171 | cfq_schedule_dispatch(cfqd); | 2202 | cfq_schedule_dispatch(cfqd); |
2172 | 2203 | ||
2173 | spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); | 2204 | spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); |
@@ -2187,7 +2218,7 @@ static void cfq_exit_queue(elevator_t *e) | |||
2187 | 2218 | ||
2188 | cfq_shutdown_timer_wq(cfqd); | 2219 | cfq_shutdown_timer_wq(cfqd); |
2189 | 2220 | ||
2190 | write_lock(&cfq_exit_lock); | 2221 | spin_lock(&cfq_exit_lock); |
2191 | spin_lock_irq(q->queue_lock); | 2222 | spin_lock_irq(q->queue_lock); |
2192 | 2223 | ||
2193 | if (cfqd->active_queue) | 2224 | if (cfqd->active_queue) |
@@ -2210,7 +2241,7 @@ static void cfq_exit_queue(elevator_t *e) | |||
2210 | } | 2241 | } |
2211 | 2242 | ||
2212 | spin_unlock_irq(q->queue_lock); | 2243 | spin_unlock_irq(q->queue_lock); |
2213 | write_unlock(&cfq_exit_lock); | 2244 | spin_unlock(&cfq_exit_lock); |
2214 | 2245 | ||
2215 | cfq_shutdown_timer_wq(cfqd); | 2246 | cfq_shutdown_timer_wq(cfqd); |
2216 | 2247 | ||
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 662209d3f42d..2a769cc6f5f9 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c | |||
@@ -8,7 +8,6 @@ | |||
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/vt_kern.h> | ||
12 | #include <linux/device.h> | 11 | #include <linux/device.h> |
13 | #include <linux/kallsyms.h> | 12 | #include <linux/kallsyms.h> |
14 | #include <linux/pm.h> | 13 | #include <linux/pm.h> |
@@ -66,6 +65,7 @@ int suspend_device(struct device * dev, pm_message_t state) | |||
66 | return error; | 65 | return error; |
67 | } | 66 | } |
68 | 67 | ||
68 | |||
69 | /** | 69 | /** |
70 | * device_suspend - Save state and stop all devices in system. | 70 | * device_suspend - Save state and stop all devices in system. |
71 | * @state: Power state to put each device in. | 71 | * @state: Power state to put each device in. |
@@ -85,9 +85,6 @@ int device_suspend(pm_message_t state) | |||
85 | { | 85 | { |
86 | int error = 0; | 86 | int error = 0; |
87 | 87 | ||
88 | if (!is_console_suspend_safe()) | ||
89 | return -EINVAL; | ||
90 | |||
91 | down(&dpm_sem); | 88 | down(&dpm_sem); |
92 | down(&dpm_list_sem); | 89 | down(&dpm_list_sem); |
93 | while (!list_empty(&dpm_active) && error == 0) { | 90 | while (!list_empty(&dpm_active) && error == 0) { |
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig index 0b9cf9c59a21..7c88c060a9e6 100644 --- a/drivers/char/agp/Kconfig +++ b/drivers/char/agp/Kconfig | |||
@@ -86,7 +86,7 @@ config AGP_NVIDIA | |||
86 | 86 | ||
87 | config AGP_SIS | 87 | config AGP_SIS |
88 | tristate "SiS chipset support" | 88 | tristate "SiS chipset support" |
89 | depends on AGP && X86_32 | 89 | depends on AGP |
90 | help | 90 | help |
91 | This option gives you AGP support for the GLX component of | 91 | This option gives you AGP support for the GLX component of |
92 | X on Silicon Integrated Systems [SiS] chipsets. | 92 | X on Silicon Integrated Systems [SiS] chipsets. |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 36517d4d1ad9..ac3c33a2e37d 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -617,6 +617,9 @@ static int agp_amd64_resume(struct pci_dev *pdev) | |||
617 | pci_set_power_state(pdev, PCI_D0); | 617 | pci_set_power_state(pdev, PCI_D0); |
618 | pci_restore_state(pdev); | 618 | pci_restore_state(pdev); |
619 | 619 | ||
620 | if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) | ||
621 | nforce3_agp_init(pdev); | ||
622 | |||
620 | return amd_8151_configure(); | 623 | return amd_8151_configure(); |
621 | } | 624 | } |
622 | 625 | ||
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index 97b0a890ba7f..b8ec25d17478 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c | |||
@@ -345,6 +345,12 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata = | |||
345 | .chipset_name = "PT880", | 345 | .chipset_name = "PT880", |
346 | }, | 346 | }, |
347 | 347 | ||
348 | /* PT880 Ultra */ | ||
349 | { | ||
350 | .device_id = PCI_DEVICE_ID_VIA_PT880ULTRA, | ||
351 | .chipset_name = "PT880 Ultra", | ||
352 | }, | ||
353 | |||
348 | /* PT890 */ | 354 | /* PT890 */ |
349 | { | 355 | { |
350 | .device_id = PCI_DEVICE_ID_VIA_8783_0, | 356 | .device_id = PCI_DEVICE_ID_VIA_8783_0, |
@@ -511,6 +517,7 @@ static struct pci_device_id agp_via_pci_table[] = { | |||
511 | ID(PCI_DEVICE_ID_VIA_8763_0), | 517 | ID(PCI_DEVICE_ID_VIA_8763_0), |
512 | ID(PCI_DEVICE_ID_VIA_8378_0), | 518 | ID(PCI_DEVICE_ID_VIA_8378_0), |
513 | ID(PCI_DEVICE_ID_VIA_PT880), | 519 | ID(PCI_DEVICE_ID_VIA_PT880), |
520 | ID(PCI_DEVICE_ID_VIA_PT880ULTRA), | ||
514 | ID(PCI_DEVICE_ID_VIA_8783_0), | 521 | ID(PCI_DEVICE_ID_VIA_8783_0), |
515 | ID(PCI_DEVICE_ID_VIA_PX8X0_0), | 522 | ID(PCI_DEVICE_ID_VIA_PX8X0_0), |
516 | ID(PCI_DEVICE_ID_VIA_3269_0), | 523 | ID(PCI_DEVICE_ID_VIA_3269_0), |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index b36eef0e9d19..02a7dd7a8a55 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -1184,20 +1184,20 @@ static void port_outl(struct si_sm_io *io, unsigned int offset, | |||
1184 | static void port_cleanup(struct smi_info *info) | 1184 | static void port_cleanup(struct smi_info *info) |
1185 | { | 1185 | { |
1186 | unsigned int addr = info->io.addr_data; | 1186 | unsigned int addr = info->io.addr_data; |
1187 | int mapsize; | 1187 | int idx; |
1188 | 1188 | ||
1189 | if (addr) { | 1189 | if (addr) { |
1190 | mapsize = ((info->io_size * info->io.regspacing) | 1190 | for (idx = 0; idx < info->io_size; idx++) { |
1191 | - (info->io.regspacing - info->io.regsize)); | 1191 | release_region(addr + idx * info->io.regspacing, |
1192 | 1192 | info->io.regsize); | |
1193 | release_region (addr, mapsize); | 1193 | } |
1194 | } | 1194 | } |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | static int port_setup(struct smi_info *info) | 1197 | static int port_setup(struct smi_info *info) |
1198 | { | 1198 | { |
1199 | unsigned int addr = info->io.addr_data; | 1199 | unsigned int addr = info->io.addr_data; |
1200 | int mapsize; | 1200 | int idx; |
1201 | 1201 | ||
1202 | if (!addr) | 1202 | if (!addr) |
1203 | return -ENODEV; | 1203 | return -ENODEV; |
@@ -1225,16 +1225,22 @@ static int port_setup(struct smi_info *info) | |||
1225 | return -EINVAL; | 1225 | return -EINVAL; |
1226 | } | 1226 | } |
1227 | 1227 | ||
1228 | /* Calculate the total amount of memory to claim. This is an | 1228 | /* Some BIOSes reserve disjoint I/O regions in their ACPI |
1229 | * unusual looking calculation, but it avoids claiming any | 1229 | * tables. This causes problems when trying to register the |
1230 | * more memory than it has to. It will claim everything | 1230 | * entire I/O region. Therefore we must register each I/O |
1231 | * between the first address to the end of the last full | 1231 | * port separately. |
1232 | * register. */ | 1232 | */ |
1233 | mapsize = ((info->io_size * info->io.regspacing) | 1233 | for (idx = 0; idx < info->io_size; idx++) { |
1234 | - (info->io.regspacing - info->io.regsize)); | 1234 | if (request_region(addr + idx * info->io.regspacing, |
1235 | 1235 | info->io.regsize, DEVICE_NAME) == NULL) { | |
1236 | if (request_region(addr, mapsize, DEVICE_NAME) == NULL) | 1236 | /* Undo allocations */ |
1237 | return -EIO; | 1237 | while (idx--) { |
1238 | release_region(addr + idx * info->io.regspacing, | ||
1239 | info->io.regsize); | ||
1240 | } | ||
1241 | return -EIO; | ||
1242 | } | ||
1243 | } | ||
1238 | return 0; | 1244 | return 0; |
1239 | } | 1245 | } |
1240 | 1246 | ||
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 128b2632512d..eab5394da666 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -149,7 +149,7 @@ struct cm4000_dev { | |||
149 | #define ZERO_DEV(dev) \ | 149 | #define ZERO_DEV(dev) \ |
150 | memset(&dev->atr_csum,0, \ | 150 | memset(&dev->atr_csum,0, \ |
151 | sizeof(struct cm4000_dev) - \ | 151 | sizeof(struct cm4000_dev) - \ |
152 | /*link*/ sizeof(struct pcmcia_device) - \ | 152 | /*link*/ sizeof(struct pcmcia_device *) - \ |
153 | /*node*/ sizeof(dev_node_t) - \ | 153 | /*node*/ sizeof(dev_node_t) - \ |
154 | /*atr*/ MAX_ATR*sizeof(char) - \ | 154 | /*atr*/ MAX_ATR*sizeof(char) - \ |
155 | /*rbuf*/ 512*sizeof(char) - \ | 155 | /*rbuf*/ 512*sizeof(char) - \ |
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index e45f0d3d12de..a611972024e6 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c | |||
@@ -105,6 +105,12 @@ static const char* tcpa_event_type_strings[] = { | |||
105 | "Non-Host Info" | 105 | "Non-Host Info" |
106 | }; | 106 | }; |
107 | 107 | ||
108 | struct tcpa_pc_event { | ||
109 | u32 event_id; | ||
110 | u32 event_size; | ||
111 | u8 event_data[0]; | ||
112 | }; | ||
113 | |||
108 | enum tcpa_pc_event_ids { | 114 | enum tcpa_pc_event_ids { |
109 | SMBIOS = 1, | 115 | SMBIOS = 1, |
110 | BIS_CERT, | 116 | BIS_CERT, |
@@ -114,14 +120,15 @@ enum tcpa_pc_event_ids { | |||
114 | NVRAM, | 120 | NVRAM, |
115 | OPTION_ROM_EXEC, | 121 | OPTION_ROM_EXEC, |
116 | OPTION_ROM_CONFIG, | 122 | OPTION_ROM_CONFIG, |
117 | OPTION_ROM_MICROCODE, | 123 | OPTION_ROM_MICROCODE = 10, |
118 | S_CRTM_VERSION, | 124 | S_CRTM_VERSION, |
119 | S_CRTM_CONTENTS, | 125 | S_CRTM_CONTENTS, |
120 | POST_CONTENTS, | 126 | POST_CONTENTS, |
127 | HOST_TABLE_OF_DEVICES, | ||
121 | }; | 128 | }; |
122 | 129 | ||
123 | static const char* tcpa_pc_event_id_strings[] = { | 130 | static const char* tcpa_pc_event_id_strings[] = { |
124 | "" | 131 | "", |
125 | "SMBIOS", | 132 | "SMBIOS", |
126 | "BIS Certificate", | 133 | "BIS Certificate", |
127 | "POST BIOS ", | 134 | "POST BIOS ", |
@@ -130,11 +137,12 @@ static const char* tcpa_pc_event_id_strings[] = { | |||
130 | "NVRAM", | 137 | "NVRAM", |
131 | "Option ROM", | 138 | "Option ROM", |
132 | "Option ROM config", | 139 | "Option ROM config", |
133 | "Option ROM microcode", | 140 | "", |
141 | "Option ROM microcode ", | ||
134 | "S-CRTM Version", | 142 | "S-CRTM Version", |
135 | "S-CRTM Contents", | 143 | "S-CRTM Contents ", |
136 | "S-CRTM POST Contents", | 144 | "POST Contents ", |
137 | "POST Contents", | 145 | "Table of Devices", |
138 | }; | 146 | }; |
139 | 147 | ||
140 | /* returns pointer to start of pos. entry of tcg log */ | 148 | /* returns pointer to start of pos. entry of tcg log */ |
@@ -206,7 +214,7 @@ static int get_event_name(char *dest, struct tcpa_event *event, | |||
206 | const char *name = ""; | 214 | const char *name = ""; |
207 | char data[40] = ""; | 215 | char data[40] = ""; |
208 | int i, n_len = 0, d_len = 0; | 216 | int i, n_len = 0, d_len = 0; |
209 | u32 event_id; | 217 | struct tcpa_pc_event *pc_event; |
210 | 218 | ||
211 | switch(event->event_type) { | 219 | switch(event->event_type) { |
212 | case PREBOOT: | 220 | case PREBOOT: |
@@ -235,31 +243,32 @@ static int get_event_name(char *dest, struct tcpa_event *event, | |||
235 | } | 243 | } |
236 | break; | 244 | break; |
237 | case EVENT_TAG: | 245 | case EVENT_TAG: |
238 | event_id = be32_to_cpu(*((u32 *)event_entry)); | 246 | pc_event = (struct tcpa_pc_event *)event_entry; |
239 | 247 | ||
240 | /* ToDo Row data -> Base64 */ | 248 | /* ToDo Row data -> Base64 */ |
241 | 249 | ||
242 | switch (event_id) { | 250 | switch (pc_event->event_id) { |
243 | case SMBIOS: | 251 | case SMBIOS: |
244 | case BIS_CERT: | 252 | case BIS_CERT: |
245 | case CMOS: | 253 | case CMOS: |
246 | case NVRAM: | 254 | case NVRAM: |
247 | case OPTION_ROM_EXEC: | 255 | case OPTION_ROM_EXEC: |
248 | case OPTION_ROM_CONFIG: | 256 | case OPTION_ROM_CONFIG: |
249 | case OPTION_ROM_MICROCODE: | ||
250 | case S_CRTM_VERSION: | 257 | case S_CRTM_VERSION: |
251 | case S_CRTM_CONTENTS: | 258 | name = tcpa_pc_event_id_strings[pc_event->event_id]; |
252 | case POST_CONTENTS: | ||
253 | name = tcpa_pc_event_id_strings[event_id]; | ||
254 | n_len = strlen(name); | 259 | n_len = strlen(name); |
255 | break; | 260 | break; |
261 | /* hash data */ | ||
256 | case POST_BIOS_ROM: | 262 | case POST_BIOS_ROM: |
257 | case ESCD: | 263 | case ESCD: |
258 | name = tcpa_pc_event_id_strings[event_id]; | 264 | case OPTION_ROM_MICROCODE: |
265 | case S_CRTM_CONTENTS: | ||
266 | case POST_CONTENTS: | ||
267 | name = tcpa_pc_event_id_strings[pc_event->event_id]; | ||
259 | n_len = strlen(name); | 268 | n_len = strlen(name); |
260 | for (i = 0; i < 20; i++) | 269 | for (i = 0; i < 20; i++) |
261 | d_len += sprintf(data, "%02x", | 270 | d_len += sprintf(&data[2*i], "%02x", |
262 | event_entry[8 + i]); | 271 | pc_event->event_data[i]); |
263 | break; | 272 | break; |
264 | default: | 273 | default: |
265 | break; | 274 | break; |
@@ -275,53 +284,13 @@ static int get_event_name(char *dest, struct tcpa_event *event, | |||
275 | 284 | ||
276 | static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) | 285 | static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) |
277 | { | 286 | { |
287 | struct tcpa_event *event = v; | ||
288 | char *data = v; | ||
289 | int i; | ||
278 | 290 | ||
279 | char *eventname; | 291 | for (i = 0; i < sizeof(struct tcpa_event) + event->event_size; i++) |
280 | char data[4]; | ||
281 | u32 help; | ||
282 | int i, len; | ||
283 | struct tcpa_event *event = (struct tcpa_event *) v; | ||
284 | unsigned char *event_entry = | ||
285 | (unsigned char *) (v + sizeof(struct tcpa_event)); | ||
286 | |||
287 | eventname = kmalloc(MAX_TEXT_EVENT, GFP_KERNEL); | ||
288 | if (!eventname) { | ||
289 | printk(KERN_ERR "%s: ERROR - No Memory for event name\n ", | ||
290 | __func__); | ||
291 | return -ENOMEM; | ||
292 | } | ||
293 | |||
294 | /* 1st: PCR used is in little-endian format (4 bytes) */ | ||
295 | help = le32_to_cpu(event->pcr_index); | ||
296 | memcpy(data, &help, 4); | ||
297 | for (i = 0; i < 4; i++) | ||
298 | seq_putc(m, data[i]); | ||
299 | |||
300 | /* 2nd: SHA1 (20 bytes) */ | ||
301 | for (i = 0; i < 20; i++) | ||
302 | seq_putc(m, event->pcr_value[i]); | ||
303 | |||
304 | /* 3rd: event type identifier (4 bytes) */ | ||
305 | help = le32_to_cpu(event->event_type); | ||
306 | memcpy(data, &help, 4); | ||
307 | for (i = 0; i < 4; i++) | ||
308 | seq_putc(m, data[i]); | 292 | seq_putc(m, data[i]); |
309 | 293 | ||
310 | len = 0; | ||
311 | |||
312 | len += get_event_name(eventname, event, event_entry); | ||
313 | |||
314 | /* 4th: filename <= 255 + \'0' delimiter */ | ||
315 | if (len > TCG_EVENT_NAME_LEN_MAX) | ||
316 | len = TCG_EVENT_NAME_LEN_MAX; | ||
317 | |||
318 | for (i = 0; i < len; i++) | ||
319 | seq_putc(m, eventname[i]); | ||
320 | |||
321 | /* 5th: delimiter */ | ||
322 | seq_putc(m, '\0'); | ||
323 | |||
324 | kfree(eventname); | ||
325 | return 0; | 294 | return 0; |
326 | } | 295 | } |
327 | 296 | ||
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index acc5d47844eb..6c94879e0b99 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -3238,14 +3238,6 @@ void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org) | |||
3238 | } | 3238 | } |
3239 | } | 3239 | } |
3240 | 3240 | ||
3241 | int is_console_suspend_safe(void) | ||
3242 | { | ||
3243 | /* It is unsafe to suspend devices while X has control of the | ||
3244 | * hardware. Make sure we are running on a kernel-controlled console. | ||
3245 | */ | ||
3246 | return vc_cons[fg_console].d->vc_mode == KD_TEXT; | ||
3247 | } | ||
3248 | |||
3249 | /* | 3241 | /* |
3250 | * Visible symbols for modules | 3242 | * Visible symbols for modules |
3251 | */ | 3243 | */ |
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index 43b96e298363..27c9eb989a9a 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -345,17 +345,17 @@ sgiioc4_resetproc(ide_drive_t * drive) | |||
345 | static u8 | 345 | static u8 |
346 | sgiioc4_INB(unsigned long port) | 346 | sgiioc4_INB(unsigned long port) |
347 | { | 347 | { |
348 | u8 reg = (u8) inb(port); | 348 | u8 reg = (u8) readb((void __iomem *) port); |
349 | 349 | ||
350 | if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ | 350 | if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ |
351 | if (reg & 0x51) { /* Not busy...check for interrupt */ | 351 | if (reg & 0x51) { /* Not busy...check for interrupt */ |
352 | unsigned long other_ir = port - 0x110; | 352 | unsigned long other_ir = port - 0x110; |
353 | unsigned int intr_reg = (u32) inl(other_ir); | 353 | unsigned int intr_reg = (u32) readl((void __iomem *) other_ir); |
354 | 354 | ||
355 | /* Clear the Interrupt, Error bits on the IOC4 */ | 355 | /* Clear the Interrupt, Error bits on the IOC4 */ |
356 | if (intr_reg & 0x03) { | 356 | if (intr_reg & 0x03) { |
357 | outl(0x03, other_ir); | 357 | writel(0x03, (void __iomem *) other_ir); |
358 | intr_reg = (u32) inl(other_ir); | 358 | intr_reg = (u32) readl((void __iomem *) other_ir); |
359 | } | 359 | } |
360 | } | 360 | } |
361 | } | 361 | } |
@@ -606,6 +606,12 @@ ide_init_sgiioc4(ide_hwif_t * hwif) | |||
606 | hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off; | 606 | hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off; |
607 | hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; | 607 | hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; |
608 | hwif->ide_dma_timeout = &__ide_dma_timeout; | 608 | hwif->ide_dma_timeout = &__ide_dma_timeout; |
609 | |||
610 | /* | ||
611 | * The IOC4 uses MMIO rather than Port IO. | ||
612 | * It also needs special workarounds for INB. | ||
613 | */ | ||
614 | default_hwif_mmiops(hwif); | ||
609 | hwif->INB = &sgiioc4_INB; | 615 | hwif->INB = &sgiioc4_INB; |
610 | } | 616 | } |
611 | 617 | ||
@@ -743,6 +749,6 @@ ioc4_ide_exit(void) | |||
743 | module_init(ioc4_ide_init); | 749 | module_init(ioc4_ide_init); |
744 | module_exit(ioc4_ide_exit); | 750 | module_exit(ioc4_ide_exit); |
745 | 751 | ||
746 | MODULE_AUTHOR("Aniket Malatpure - Silicon Graphics Inc. (SGI)"); | 752 | MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon"); |
747 | MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card"); | 753 | MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card"); |
748 | MODULE_LICENSE("GPL"); | 754 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 8a23fb54c693..5413dc43b9f1 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -845,7 +845,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud | |||
845 | &sbp2_highlevel, ud->ne->host, &sbp2_ops, | 845 | &sbp2_highlevel, ud->ne->host, &sbp2_ops, |
846 | sizeof(struct sbp2_status_block), sizeof(quadlet_t), | 846 | sizeof(struct sbp2_status_block), sizeof(quadlet_t), |
847 | 0x010000000000ULL, CSR1212_ALL_SPACE_END); | 847 | 0x010000000000ULL, CSR1212_ALL_SPACE_END); |
848 | if (!scsi_id->status_fifo_addr) { | 848 | if (scsi_id->status_fifo_addr == ~0ULL) { |
849 | SBP2_ERR("failed to allocate status FIFO address range"); | 849 | SBP2_ERR("failed to allocate status FIFO address range"); |
850 | goto failed_alloc; | 850 | goto failed_alloc; |
851 | } | 851 | } |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index a54da42849ae..8406839b91cf 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -275,6 +275,7 @@ static void ipoib_ib_handle_wc(struct net_device *dev, | |||
275 | spin_lock_irqsave(&priv->tx_lock, flags); | 275 | spin_lock_irqsave(&priv->tx_lock, flags); |
276 | ++priv->tx_tail; | 276 | ++priv->tx_tail; |
277 | if (netif_queue_stopped(dev) && | 277 | if (netif_queue_stopped(dev) && |
278 | test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags) && | ||
278 | priv->tx_head - priv->tx_tail <= ipoib_sendq_size >> 1) | 279 | priv->tx_head - priv->tx_tail <= ipoib_sendq_size >> 1) |
279 | netif_wake_queue(dev); | 280 | netif_wake_queue(dev); |
280 | spin_unlock_irqrestore(&priv->tx_lock, flags); | 281 | spin_unlock_irqrestore(&priv->tx_lock, flags); |
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 2b2ec1057dee..95c0de7964a0 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c | |||
@@ -589,7 +589,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
589 | struct sw *sw; | 589 | struct sw *sw; |
590 | struct input_dev *input_dev; | 590 | struct input_dev *input_dev; |
591 | int i, j, k, l; | 591 | int i, j, k, l; |
592 | int err; | 592 | int err = 0; |
593 | unsigned char *buf = NULL; /* [SW_LENGTH] */ | 593 | unsigned char *buf = NULL; /* [SW_LENGTH] */ |
594 | unsigned char *idbuf = NULL; /* [SW_LENGTH] */ | 594 | unsigned char *idbuf = NULL; /* [SW_LENGTH] */ |
595 | unsigned char m = 1; | 595 | unsigned char m = 1; |
@@ -776,7 +776,10 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
776 | goto fail4; | 776 | goto fail4; |
777 | } | 777 | } |
778 | 778 | ||
779 | return 0; | 779 | out: kfree(buf); |
780 | kfree(idbuf); | ||
781 | |||
782 | return err; | ||
780 | 783 | ||
781 | fail4: input_free_device(sw->dev[i]); | 784 | fail4: input_free_device(sw->dev[i]); |
782 | fail3: while (--i >= 0) | 785 | fail3: while (--i >= 0) |
@@ -784,9 +787,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
784 | fail2: gameport_close(gameport); | 787 | fail2: gameport_close(gameport); |
785 | fail1: gameport_set_drvdata(gameport, NULL); | 788 | fail1: gameport_set_drvdata(gameport, NULL); |
786 | kfree(sw); | 789 | kfree(sw); |
787 | kfree(buf); | 790 | goto out; |
788 | kfree(idbuf); | ||
789 | return err; | ||
790 | } | 791 | } |
791 | 792 | ||
792 | static void sw_disconnect(struct gameport *gameport) | 793 | static void sw_disconnect(struct gameport *gameport) |
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index 96c6bf77248a..1f0e720267d7 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
@@ -245,9 +245,9 @@ static void corgikbd_hinge_timer(unsigned long data) | |||
245 | if (hinge_count >= HINGE_STABLE_COUNT) { | 245 | if (hinge_count >= HINGE_STABLE_COUNT) { |
246 | spin_lock_irqsave(&corgikbd_data->lock, flags); | 246 | spin_lock_irqsave(&corgikbd_data->lock, flags); |
247 | 247 | ||
248 | input_report_switch(corgikbd_data->input, SW_0, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); | 248 | input_report_switch(corgikbd_data->input, SW_LID, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); |
249 | input_report_switch(corgikbd_data->input, SW_1, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); | 249 | input_report_switch(corgikbd_data->input, SW_TABLET_MODE, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); |
250 | input_report_switch(corgikbd_data->input, SW_2, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); | 250 | input_report_switch(corgikbd_data->input, SW_HEADPHONE_INSERT, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); |
251 | input_sync(corgikbd_data->input); | 251 | input_sync(corgikbd_data->input); |
252 | 252 | ||
253 | spin_unlock_irqrestore(&corgikbd_data->lock, flags); | 253 | spin_unlock_irqrestore(&corgikbd_data->lock, flags); |
@@ -340,9 +340,9 @@ static int __init corgikbd_probe(struct platform_device *pdev) | |||
340 | for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) | 340 | for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) |
341 | set_bit(corgikbd->keycode[i], input_dev->keybit); | 341 | set_bit(corgikbd->keycode[i], input_dev->keybit); |
342 | clear_bit(0, input_dev->keybit); | 342 | clear_bit(0, input_dev->keybit); |
343 | set_bit(SW_0, input_dev->swbit); | 343 | set_bit(SW_LID, input_dev->swbit); |
344 | set_bit(SW_1, input_dev->swbit); | 344 | set_bit(SW_TABLET_MODE, input_dev->swbit); |
345 | set_bit(SW_2, input_dev->swbit); | 345 | set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); |
346 | 346 | ||
347 | input_register_device(corgikbd->input); | 347 | input_register_device(corgikbd->input); |
348 | 348 | ||
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 1d238a9d52d6..c5d03fb77bcb 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
@@ -299,9 +299,9 @@ static void spitzkbd_hinge_timer(unsigned long data) | |||
299 | if (hinge_count >= HINGE_STABLE_COUNT) { | 299 | if (hinge_count >= HINGE_STABLE_COUNT) { |
300 | spin_lock_irqsave(&spitzkbd_data->lock, flags); | 300 | spin_lock_irqsave(&spitzkbd_data->lock, flags); |
301 | 301 | ||
302 | input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); | 302 | input_report_switch(spitzkbd_data->input, SW_LID, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); |
303 | input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); | 303 | input_report_switch(spitzkbd_data->input, SW_TABLET_MODE, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); |
304 | input_report_switch(spitzkbd_data->input, SW_2, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); | 304 | input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); |
305 | input_sync(spitzkbd_data->input); | 305 | input_sync(spitzkbd_data->input); |
306 | 306 | ||
307 | spin_unlock_irqrestore(&spitzkbd_data->lock, flags); | 307 | spin_unlock_irqrestore(&spitzkbd_data->lock, flags); |
@@ -398,9 +398,9 @@ static int __init spitzkbd_probe(struct platform_device *dev) | |||
398 | for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) | 398 | for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) |
399 | set_bit(spitzkbd->keycode[i], input_dev->keybit); | 399 | set_bit(spitzkbd->keycode[i], input_dev->keybit); |
400 | clear_bit(0, input_dev->keybit); | 400 | clear_bit(0, input_dev->keybit); |
401 | set_bit(SW_0, input_dev->swbit); | 401 | set_bit(SW_LID, input_dev->swbit); |
402 | set_bit(SW_1, input_dev->swbit); | 402 | set_bit(SW_TABLET_MODE, input_dev->swbit); |
403 | set_bit(SW_2, input_dev->swbit); | 403 | set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); |
404 | 404 | ||
405 | input_register_device(input_dev); | 405 | input_register_device(input_dev); |
406 | 406 | ||
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index 36cd2e07fce8..e4e5be111c96 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c | |||
@@ -318,6 +318,16 @@ static struct key_entry keymap_acer_travelmate_240[] = { | |||
318 | { KE_END, 0 } | 318 | { KE_END, 0 } |
319 | }; | 319 | }; |
320 | 320 | ||
321 | static struct key_entry keymap_aopen_1559as[] = { | ||
322 | { KE_KEY, 0x01, KEY_HELP }, | ||
323 | { KE_KEY, 0x06, KEY_PROG3 }, | ||
324 | { KE_KEY, 0x11, KEY_PROG1 }, | ||
325 | { KE_KEY, 0x12, KEY_PROG2 }, | ||
326 | { KE_WIFI, 0x30, 0 }, | ||
327 | { KE_KEY, 0x31, KEY_MAIL }, | ||
328 | { KE_KEY, 0x36, KEY_WWW }, | ||
329 | }; | ||
330 | |||
321 | /* | 331 | /* |
322 | * If your machine is not here (which is currently rather likely), please send | 332 | * If your machine is not here (which is currently rather likely), please send |
323 | * a list of buttons and their key codes (reported when loading this module | 333 | * a list of buttons and their key codes (reported when loading this module |
@@ -369,6 +379,15 @@ static struct dmi_system_id dmi_ids[] = { | |||
369 | }, | 379 | }, |
370 | .driver_data = keymap_acer_travelmate_240 | 380 | .driver_data = keymap_acer_travelmate_240 |
371 | }, | 381 | }, |
382 | { | ||
383 | .callback = dmi_matched, | ||
384 | .ident = "AOpen 1559AS", | ||
385 | .matches = { | ||
386 | DMI_MATCH(DMI_PRODUCT_NAME, "E2U"), | ||
387 | DMI_MATCH(DMI_BOARD_NAME, "E2U"), | ||
388 | }, | ||
389 | .driver_data = keymap_aopen_1559as | ||
390 | }, | ||
372 | { NULL, } | 391 | { NULL, } |
373 | }; | 392 | }; |
374 | 393 | ||
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 2141501e9f2e..a0e2e797c6d5 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -100,8 +100,8 @@ static void alps_process_packet(struct psmouse *psmouse, struct pt_regs *regs) | |||
100 | } | 100 | } |
101 | 101 | ||
102 | if (priv->i->flags & ALPS_OLDPROTO) { | 102 | if (priv->i->flags & ALPS_OLDPROTO) { |
103 | left = packet[2] & 0x08; | 103 | left = packet[2] & 0x10; |
104 | right = packet[2] & 0x10; | 104 | right = packet[2] & 0x08; |
105 | middle = 0; | 105 | middle = 0; |
106 | x = packet[1] | ((packet[0] & 0x07) << 7); | 106 | x = packet[1] | ((packet[0] & 0x07) << 7); |
107 | y = packet[4] | ((packet[3] & 0x07) << 7); | 107 | y = packet[4] | ((packet[3] & 0x07) << 7); |
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 5ccc3ef3b89e..c14395ba7980 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -22,12 +22,36 @@ | |||
22 | 22 | ||
23 | static struct dmi_system_id lifebook_dmi_table[] = { | 23 | static struct dmi_system_id lifebook_dmi_table[] = { |
24 | { | 24 | { |
25 | .ident = "LifeBook B", | ||
26 | .matches = { | ||
27 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), | ||
28 | }, | ||
29 | }, | ||
30 | { | ||
25 | .ident = "Lifebook B", | 31 | .ident = "Lifebook B", |
26 | .matches = { | 32 | .matches = { |
27 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), | 33 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), |
28 | }, | 34 | }, |
29 | }, | 35 | }, |
30 | { | 36 | { |
37 | .ident = "Lifebook B213x/B2150", | ||
38 | .matches = { | ||
39 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), | ||
40 | }, | ||
41 | }, | ||
42 | { | ||
43 | .ident = "Zephyr", | ||
44 | .matches = { | ||
45 | DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), | ||
46 | }, | ||
47 | }, | ||
48 | { | ||
49 | .ident = "CF-18", | ||
50 | .matches = { | ||
51 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), | ||
52 | }, | ||
53 | }, | ||
54 | { | ||
31 | .ident = "Lifebook B142", | 55 | .ident = "Lifebook B142", |
32 | .matches = { | 56 | .matches = { |
33 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), | 57 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), |
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index 40333d61093c..2f0d28840810 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #define PS2PP_KIND_WHEEL 1 | 19 | #define PS2PP_KIND_WHEEL 1 |
20 | #define PS2PP_KIND_MX 2 | 20 | #define PS2PP_KIND_MX 2 |
21 | #define PS2PP_KIND_TP3 3 | 21 | #define PS2PP_KIND_TP3 3 |
22 | #define PS2PP_KIND_TRACKMAN 4 | ||
22 | 23 | ||
23 | /* Logitech mouse features */ | 24 | /* Logitech mouse features */ |
24 | #define PS2PP_WHEEL 0x01 | 25 | #define PS2PP_WHEEL 0x01 |
@@ -223,6 +224,7 @@ static struct ps2pp_info *get_model_info(unsigned char model) | |||
223 | { 73, 0, PS2PP_SIDE_BTN }, | 224 | { 73, 0, PS2PP_SIDE_BTN }, |
224 | { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 225 | { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
225 | { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 226 | { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
227 | { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */ | ||
226 | { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, | 228 | { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, |
227 | { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 229 | { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
228 | { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 230 | { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
@@ -298,6 +300,10 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_inf | |||
298 | psmouse->name = "TouchPad 3"; | 300 | psmouse->name = "TouchPad 3"; |
299 | break; | 301 | break; |
300 | 302 | ||
303 | case PS2PP_KIND_TRACKMAN: | ||
304 | psmouse->name = "TrackMan"; | ||
305 | break; | ||
306 | |||
301 | default: | 307 | default: |
302 | /* | 308 | /* |
303 | * Set name to "Mouse" only when using PS2++, | 309 | * Set name to "Mouse" only when using PS2++, |
diff --git a/drivers/md/md.c b/drivers/md/md.c index ec802913f977..f19b874753a9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -167,6 +167,15 @@ void md_new_event(mddev_t *mddev) | |||
167 | } | 167 | } |
168 | EXPORT_SYMBOL_GPL(md_new_event); | 168 | EXPORT_SYMBOL_GPL(md_new_event); |
169 | 169 | ||
170 | /* Alternate version that can be called from interrupts | ||
171 | * when calling sysfs_notify isn't needed. | ||
172 | */ | ||
173 | void md_new_event_inintr(mddev_t *mddev) | ||
174 | { | ||
175 | atomic_inc(&md_event_count); | ||
176 | wake_up(&md_event_waiters); | ||
177 | } | ||
178 | |||
170 | /* | 179 | /* |
171 | * Enables to iterate over all existing md arrays | 180 | * Enables to iterate over all existing md arrays |
172 | * all_mddevs_lock protects this list. | 181 | * all_mddevs_lock protects this list. |
@@ -4149,7 +4158,7 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev) | |||
4149 | set_bit(MD_RECOVERY_INTR, &mddev->recovery); | 4158 | set_bit(MD_RECOVERY_INTR, &mddev->recovery); |
4150 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 4159 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
4151 | md_wakeup_thread(mddev->thread); | 4160 | md_wakeup_thread(mddev->thread); |
4152 | md_new_event(mddev); | 4161 | md_new_event_inintr(mddev); |
4153 | } | 4162 | } |
4154 | 4163 | ||
4155 | /* seq_file implementation /proc/mdstat */ | 4164 | /* seq_file implementation /proc/mdstat */ |
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 9080853fe283..a30084076ac8 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1605,6 +1605,21 @@ mpt_resume(struct pci_dev *pdev) | |||
1605 | } | 1605 | } |
1606 | #endif | 1606 | #endif |
1607 | 1607 | ||
1608 | static int | ||
1609 | mpt_signal_reset(int index, MPT_ADAPTER *ioc, int reset_phase) | ||
1610 | { | ||
1611 | if ((MptDriverClass[index] == MPTSPI_DRIVER && | ||
1612 | ioc->bus_type != SPI) || | ||
1613 | (MptDriverClass[index] == MPTFC_DRIVER && | ||
1614 | ioc->bus_type != FC) || | ||
1615 | (MptDriverClass[index] == MPTSAS_DRIVER && | ||
1616 | ioc->bus_type != SAS)) | ||
1617 | /* make sure we only call the relevant reset handler | ||
1618 | * for the bus */ | ||
1619 | return 0; | ||
1620 | return (MptResetHandlers[index])(ioc, reset_phase); | ||
1621 | } | ||
1622 | |||
1608 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 1623 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1609 | /* | 1624 | /* |
1610 | * mpt_do_ioc_recovery - Initialize or recover MPT adapter. | 1625 | * mpt_do_ioc_recovery - Initialize or recover MPT adapter. |
@@ -1885,14 +1900,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1885 | if ((ret == 0) && MptResetHandlers[ii]) { | 1900 | if ((ret == 0) && MptResetHandlers[ii]) { |
1886 | dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n", | 1901 | dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n", |
1887 | ioc->name, ii)); | 1902 | ioc->name, ii)); |
1888 | rc += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_POST_RESET); | 1903 | rc += mpt_signal_reset(ii, ioc, MPT_IOC_POST_RESET); |
1889 | handlers++; | 1904 | handlers++; |
1890 | } | 1905 | } |
1891 | 1906 | ||
1892 | if (alt_ioc_ready && MptResetHandlers[ii]) { | 1907 | if (alt_ioc_ready && MptResetHandlers[ii]) { |
1893 | drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n", | 1908 | drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n", |
1894 | ioc->name, ioc->alt_ioc->name, ii)); | 1909 | ioc->name, ioc->alt_ioc->name, ii)); |
1895 | rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); | 1910 | rc += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_POST_RESET); |
1896 | handlers++; | 1911 | handlers++; |
1897 | } | 1912 | } |
1898 | } | 1913 | } |
@@ -3267,11 +3282,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) | |||
3267 | if (MptResetHandlers[ii]) { | 3282 | if (MptResetHandlers[ii]) { |
3268 | dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n", | 3283 | dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n", |
3269 | ioc->name, ii)); | 3284 | ioc->name, ii)); |
3270 | r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_PRE_RESET); | 3285 | r += mpt_signal_reset(ii, ioc, MPT_IOC_PRE_RESET); |
3271 | if (ioc->alt_ioc) { | 3286 | if (ioc->alt_ioc) { |
3272 | dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n", | 3287 | dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n", |
3273 | ioc->name, ioc->alt_ioc->name, ii)); | 3288 | ioc->name, ioc->alt_ioc->name, ii)); |
3274 | r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_PRE_RESET); | 3289 | r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_PRE_RESET); |
3275 | } | 3290 | } |
3276 | } | 3291 | } |
3277 | } | 3292 | } |
@@ -5706,11 +5721,11 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
5706 | if (MptResetHandlers[ii]) { | 5721 | if (MptResetHandlers[ii]) { |
5707 | dtmprintk((MYIOC_s_INFO_FMT "Calling IOC reset_setup handler #%d\n", | 5722 | dtmprintk((MYIOC_s_INFO_FMT "Calling IOC reset_setup handler #%d\n", |
5708 | ioc->name, ii)); | 5723 | ioc->name, ii)); |
5709 | r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_SETUP_RESET); | 5724 | r += mpt_signal_reset(ii, ioc, MPT_IOC_SETUP_RESET); |
5710 | if (ioc->alt_ioc) { | 5725 | if (ioc->alt_ioc) { |
5711 | dtmprintk((MYIOC_s_INFO_FMT "Calling alt-%s setup reset handler #%d\n", | 5726 | dtmprintk((MYIOC_s_INFO_FMT "Calling alt-%s setup reset handler #%d\n", |
5712 | ioc->name, ioc->alt_ioc->name, ii)); | 5727 | ioc->name, ioc->alt_ioc->name, ii)); |
5713 | r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_SETUP_RESET); | 5728 | r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_SETUP_RESET); |
5714 | } | 5729 | } |
5715 | } | 5730 | } |
5716 | } | 5731 | } |
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 003b077c2324..45bcf098e762 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig | |||
@@ -84,7 +84,7 @@ config MMC_WBSD | |||
84 | 84 | ||
85 | config MMC_AU1X | 85 | config MMC_AU1X |
86 | tristate "Alchemy AU1XX0 MMC Card Interface support" | 86 | tristate "Alchemy AU1XX0 MMC Card Interface support" |
87 | depends on SOC_AU1X00 && MMC | 87 | depends on MMC && SOC_AU1200 |
88 | help | 88 | help |
89 | This selects the AMD Alchemy(R) Multimedia card interface. | 89 | This selects the AMD Alchemy(R) Multimedia card interface. |
90 | If you have a Alchemy platform with a MMC slot, say Y or M here. | 90 | If you have a Alchemy platform with a MMC slot, say Y or M here. |
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index cfdf0b24ffc1..6ed7f599eba3 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -871,13 +871,16 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) | |||
871 | *data = 0; | 871 | *data = 0; |
872 | 872 | ||
873 | /* Hook up test interrupt handler just for this test */ | 873 | /* Hook up test interrupt handler just for this test */ |
874 | if (!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) { | 874 | if (!request_irq(irq, &e1000_test_intr, SA_PROBEIRQ, netdev->name, |
875 | shared_int = FALSE; | 875 | netdev)) { |
876 | } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ, | 876 | shared_int = FALSE; |
877 | } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ, | ||
877 | netdev->name, netdev)){ | 878 | netdev->name, netdev)){ |
878 | *data = 1; | 879 | *data = 1; |
879 | return -1; | 880 | return -1; |
880 | } | 881 | } |
882 | DPRINTK(PROBE,INFO, "testing %s interrupt\n", | ||
883 | (shared_int ? "shared" : "unshared")); | ||
881 | 884 | ||
882 | /* Disable all the interrupts */ | 885 | /* Disable all the interrupts */ |
883 | E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF); | 886 | E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 564fab4914e1..56c7492e3e91 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3509,7 +3509,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3509 | buffer_info = &rx_ring->buffer_info[i]; | 3509 | buffer_info = &rx_ring->buffer_info[i]; |
3510 | 3510 | ||
3511 | while (rx_desc->status & E1000_RXD_STAT_DD) { | 3511 | while (rx_desc->status & E1000_RXD_STAT_DD) { |
3512 | struct sk_buff *skb, *next_skb; | 3512 | struct sk_buff *skb; |
3513 | u8 status; | 3513 | u8 status; |
3514 | #ifdef CONFIG_E1000_NAPI | 3514 | #ifdef CONFIG_E1000_NAPI |
3515 | if (*work_done >= work_to_do) | 3515 | if (*work_done >= work_to_do) |
@@ -3527,8 +3527,6 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3527 | prefetch(next_rxd); | 3527 | prefetch(next_rxd); |
3528 | 3528 | ||
3529 | next_buffer = &rx_ring->buffer_info[i]; | 3529 | next_buffer = &rx_ring->buffer_info[i]; |
3530 | next_skb = next_buffer->skb; | ||
3531 | prefetch(next_skb->data - NET_IP_ALIGN); | ||
3532 | 3530 | ||
3533 | cleaned = TRUE; | 3531 | cleaned = TRUE; |
3534 | cleaned_count++; | 3532 | cleaned_count++; |
@@ -3659,7 +3657,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
3659 | struct e1000_buffer *buffer_info, *next_buffer; | 3657 | struct e1000_buffer *buffer_info, *next_buffer; |
3660 | struct e1000_ps_page *ps_page; | 3658 | struct e1000_ps_page *ps_page; |
3661 | struct e1000_ps_page_dma *ps_page_dma; | 3659 | struct e1000_ps_page_dma *ps_page_dma; |
3662 | struct sk_buff *skb, *next_skb; | 3660 | struct sk_buff *skb; |
3663 | unsigned int i, j; | 3661 | unsigned int i, j; |
3664 | uint32_t length, staterr; | 3662 | uint32_t length, staterr; |
3665 | int cleaned_count = 0; | 3663 | int cleaned_count = 0; |
@@ -3689,8 +3687,6 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
3689 | prefetch(next_rxd); | 3687 | prefetch(next_rxd); |
3690 | 3688 | ||
3691 | next_buffer = &rx_ring->buffer_info[i]; | 3689 | next_buffer = &rx_ring->buffer_info[i]; |
3692 | next_skb = next_buffer->skb; | ||
3693 | prefetch(next_skb->data - NET_IP_ALIGN); | ||
3694 | 3690 | ||
3695 | cleaned = TRUE; | 3691 | cleaned = TRUE; |
3696 | cleaned_count++; | 3692 | cleaned_count++; |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 66ea5fc5c2e2..5669b95162b3 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -2675,6 +2675,18 @@ static int nv_nway_reset(struct net_device *dev) | |||
2675 | return ret; | 2675 | return ret; |
2676 | } | 2676 | } |
2677 | 2677 | ||
2678 | #ifdef NETIF_F_TSO | ||
2679 | static int nv_set_tso(struct net_device *dev, u32 value) | ||
2680 | { | ||
2681 | struct fe_priv *np = netdev_priv(dev); | ||
2682 | |||
2683 | if ((np->driver_data & DEV_HAS_CHECKSUM)) | ||
2684 | return ethtool_op_set_tso(dev, value); | ||
2685 | else | ||
2686 | return value ? -EOPNOTSUPP : 0; | ||
2687 | } | ||
2688 | #endif | ||
2689 | |||
2678 | static struct ethtool_ops ops = { | 2690 | static struct ethtool_ops ops = { |
2679 | .get_drvinfo = nv_get_drvinfo, | 2691 | .get_drvinfo = nv_get_drvinfo, |
2680 | .get_link = ethtool_op_get_link, | 2692 | .get_link = ethtool_op_get_link, |
@@ -2686,6 +2698,10 @@ static struct ethtool_ops ops = { | |||
2686 | .get_regs = nv_get_regs, | 2698 | .get_regs = nv_get_regs, |
2687 | .nway_reset = nv_nway_reset, | 2699 | .nway_reset = nv_nway_reset, |
2688 | .get_perm_addr = ethtool_op_get_perm_addr, | 2700 | .get_perm_addr = ethtool_op_get_perm_addr, |
2701 | #ifdef NETIF_F_TSO | ||
2702 | .get_tso = ethtool_op_get_tso, | ||
2703 | .set_tso = nv_set_tso | ||
2704 | #endif | ||
2689 | }; | 2705 | }; |
2690 | 2706 | ||
2691 | static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) | 2707 | static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 87933cba7e22..e1feb58bd661 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/string.h> | 44 | #include <linux/string.h> |
45 | #include <linux/module.h> | 45 | #include <linux/module.h> |
46 | #include <linux/pci.h> | 46 | #include <linux/pci.h> |
47 | #include <linux/dma-mapping.h> | ||
47 | #include <linux/etherdevice.h> | 48 | #include <linux/etherdevice.h> |
48 | #include <linux/if_ether.h> | 49 | #include <linux/if_ether.h> |
49 | #include <linux/if_vlan.h> | 50 | #include <linux/if_vlan.h> |
@@ -62,7 +63,6 @@ | |||
62 | #include <net/checksum.h> | 63 | #include <net/checksum.h> |
63 | #include <asm/byteorder.h> | 64 | #include <asm/byteorder.h> |
64 | #include <asm/io.h> | 65 | #include <asm/io.h> |
65 | #include <asm/pci.h> | ||
66 | #include <asm/processor.h> | 66 | #include <asm/processor.h> |
67 | #ifdef CONFIG_MTRR | 67 | #ifdef CONFIG_MTRR |
68 | #include <asm/mtrr.h> | 68 | #include <asm/mtrr.h> |
@@ -71,7 +71,7 @@ | |||
71 | #include "myri10ge_mcp.h" | 71 | #include "myri10ge_mcp.h" |
72 | #include "myri10ge_mcp_gen_header.h" | 72 | #include "myri10ge_mcp_gen_header.h" |
73 | 73 | ||
74 | #define MYRI10GE_VERSION_STR "0.9.0" | 74 | #define MYRI10GE_VERSION_STR "1.0.0" |
75 | 75 | ||
76 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 76 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
77 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 77 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -480,7 +480,19 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size) | |||
480 | goto abort_with_fw; | 480 | goto abort_with_fw; |
481 | 481 | ||
482 | crc = crc32(~0, fw->data, fw->size); | 482 | crc = crc32(~0, fw->data, fw->size); |
483 | memcpy_toio(mgp->sram + MYRI10GE_FW_OFFSET, fw->data, fw->size); | 483 | if (mgp->tx.boundary == 2048) { |
484 | /* Avoid PCI burst on chipset with unaligned completions. */ | ||
485 | int i; | ||
486 | __iomem u32 *ptr = (__iomem u32 *) (mgp->sram + | ||
487 | MYRI10GE_FW_OFFSET); | ||
488 | for (i = 0; i < fw->size / 4; i++) { | ||
489 | __raw_writel(((u32 *) fw->data)[i], ptr + i); | ||
490 | wmb(); | ||
491 | } | ||
492 | } else { | ||
493 | myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET, fw->data, | ||
494 | fw->size); | ||
495 | } | ||
484 | /* corruption checking is good for parity recovery and buggy chipset */ | 496 | /* corruption checking is good for parity recovery and buggy chipset */ |
485 | memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); | 497 | memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); |
486 | reread_crc = crc32(~0, fw->data, fw->size); | 498 | reread_crc = crc32(~0, fw->data, fw->size); |
@@ -536,6 +548,7 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp) | |||
536 | u32 dma_low, dma_high, size; | 548 | u32 dma_low, dma_high, size; |
537 | int status, i; | 549 | int status, i; |
538 | 550 | ||
551 | size = 0; | ||
539 | status = myri10ge_load_hotplug_firmware(mgp, &size); | 552 | status = myri10ge_load_hotplug_firmware(mgp, &size); |
540 | if (status) { | 553 | if (status) { |
541 | dev_warn(&mgp->pdev->dev, "hotplug firmware loading failed\n"); | 554 | dev_warn(&mgp->pdev->dev, "hotplug firmware loading failed\n"); |
@@ -778,7 +791,7 @@ myri10ge_submit_8rx(struct mcp_kreq_ether_recv __iomem * dst, | |||
778 | } | 791 | } |
779 | 792 | ||
780 | /* | 793 | /* |
781 | * Set of routunes to get a new receive buffer. Any buffer which | 794 | * Set of routines to get a new receive buffer. Any buffer which |
782 | * crosses a 4KB boundary must start on a 4KB boundary due to PCIe | 795 | * crosses a 4KB boundary must start on a 4KB boundary due to PCIe |
783 | * wdma restrictions. We also try to align any smaller allocation to | 796 | * wdma restrictions. We also try to align any smaller allocation to |
784 | * at least a 16 byte boundary for efficiency. We assume the linux | 797 | * at least a 16 byte boundary for efficiency. We assume the linux |
@@ -1349,7 +1362,7 @@ static struct ethtool_ops myri10ge_ethtool_ops = { | |||
1349 | .get_rx_csum = myri10ge_get_rx_csum, | 1362 | .get_rx_csum = myri10ge_get_rx_csum, |
1350 | .set_rx_csum = myri10ge_set_rx_csum, | 1363 | .set_rx_csum = myri10ge_set_rx_csum, |
1351 | .get_tx_csum = ethtool_op_get_tx_csum, | 1364 | .get_tx_csum = ethtool_op_get_tx_csum, |
1352 | .set_tx_csum = ethtool_op_set_tx_csum, | 1365 | .set_tx_csum = ethtool_op_set_tx_hw_csum, |
1353 | .get_sg = ethtool_op_get_sg, | 1366 | .get_sg = ethtool_op_get_sg, |
1354 | .set_sg = ethtool_op_set_sg, | 1367 | .set_sg = ethtool_op_set_sg, |
1355 | #ifdef NETIF_F_TSO | 1368 | #ifdef NETIF_F_TSO |
@@ -2615,12 +2628,13 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2615 | dev_err(&pdev->dev, "Error %d setting DMA mask\n", status); | 2628 | dev_err(&pdev->dev, "Error %d setting DMA mask\n", status); |
2616 | goto abort_with_netdev; | 2629 | goto abort_with_netdev; |
2617 | } | 2630 | } |
2618 | mgp->cmd = pci_alloc_consistent(pdev, sizeof(*mgp->cmd), &mgp->cmd_bus); | 2631 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), |
2632 | &mgp->cmd_bus, GFP_KERNEL); | ||
2619 | if (mgp->cmd == NULL) | 2633 | if (mgp->cmd == NULL) |
2620 | goto abort_with_netdev; | 2634 | goto abort_with_netdev; |
2621 | 2635 | ||
2622 | mgp->fw_stats = pci_alloc_consistent(pdev, sizeof(*mgp->fw_stats), | 2636 | mgp->fw_stats = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->fw_stats), |
2623 | &mgp->fw_stats_bus); | 2637 | &mgp->fw_stats_bus, GFP_KERNEL); |
2624 | if (mgp->fw_stats == NULL) | 2638 | if (mgp->fw_stats == NULL) |
2625 | goto abort_with_cmd; | 2639 | goto abort_with_cmd; |
2626 | 2640 | ||
@@ -2659,8 +2673,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2659 | 2673 | ||
2660 | /* allocate rx done ring */ | 2674 | /* allocate rx done ring */ |
2661 | bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry); | 2675 | bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry); |
2662 | mgp->rx_done.entry = | 2676 | mgp->rx_done.entry = dma_alloc_coherent(&pdev->dev, bytes, |
2663 | pci_alloc_consistent(pdev, bytes, &mgp->rx_done.bus); | 2677 | &mgp->rx_done.bus, GFP_KERNEL); |
2664 | if (mgp->rx_done.entry == NULL) | 2678 | if (mgp->rx_done.entry == NULL) |
2665 | goto abort_with_ioremap; | 2679 | goto abort_with_ioremap; |
2666 | memset(mgp->rx_done.entry, 0, bytes); | 2680 | memset(mgp->rx_done.entry, 0, bytes); |
@@ -2750,7 +2764,8 @@ abort_with_firmware: | |||
2750 | 2764 | ||
2751 | abort_with_rx_done: | 2765 | abort_with_rx_done: |
2752 | bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry); | 2766 | bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry); |
2753 | pci_free_consistent(pdev, bytes, mgp->rx_done.entry, mgp->rx_done.bus); | 2767 | dma_free_coherent(&pdev->dev, bytes, |
2768 | mgp->rx_done.entry, mgp->rx_done.bus); | ||
2754 | 2769 | ||
2755 | abort_with_ioremap: | 2770 | abort_with_ioremap: |
2756 | iounmap(mgp->sram); | 2771 | iounmap(mgp->sram); |
@@ -2760,11 +2775,12 @@ abort_with_wc: | |||
2760 | if (mgp->mtrr >= 0) | 2775 | if (mgp->mtrr >= 0) |
2761 | mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span); | 2776 | mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span); |
2762 | #endif | 2777 | #endif |
2763 | pci_free_consistent(pdev, sizeof(*mgp->fw_stats), | 2778 | dma_free_coherent(&pdev->dev, sizeof(*mgp->fw_stats), |
2764 | mgp->fw_stats, mgp->fw_stats_bus); | 2779 | mgp->fw_stats, mgp->fw_stats_bus); |
2765 | 2780 | ||
2766 | abort_with_cmd: | 2781 | abort_with_cmd: |
2767 | pci_free_consistent(pdev, sizeof(*mgp->cmd), mgp->cmd, mgp->cmd_bus); | 2782 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), |
2783 | mgp->cmd, mgp->cmd_bus); | ||
2768 | 2784 | ||
2769 | abort_with_netdev: | 2785 | abort_with_netdev: |
2770 | 2786 | ||
@@ -2799,7 +2815,8 @@ static void myri10ge_remove(struct pci_dev *pdev) | |||
2799 | myri10ge_dummy_rdma(mgp, 0); | 2815 | myri10ge_dummy_rdma(mgp, 0); |
2800 | 2816 | ||
2801 | bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry); | 2817 | bytes = myri10ge_max_intr_slots * sizeof(*mgp->rx_done.entry); |
2802 | pci_free_consistent(pdev, bytes, mgp->rx_done.entry, mgp->rx_done.bus); | 2818 | dma_free_coherent(&pdev->dev, bytes, |
2819 | mgp->rx_done.entry, mgp->rx_done.bus); | ||
2803 | 2820 | ||
2804 | iounmap(mgp->sram); | 2821 | iounmap(mgp->sram); |
2805 | 2822 | ||
@@ -2807,19 +2824,20 @@ static void myri10ge_remove(struct pci_dev *pdev) | |||
2807 | if (mgp->mtrr >= 0) | 2824 | if (mgp->mtrr >= 0) |
2808 | mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span); | 2825 | mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span); |
2809 | #endif | 2826 | #endif |
2810 | pci_free_consistent(pdev, sizeof(*mgp->fw_stats), | 2827 | dma_free_coherent(&pdev->dev, sizeof(*mgp->fw_stats), |
2811 | mgp->fw_stats, mgp->fw_stats_bus); | 2828 | mgp->fw_stats, mgp->fw_stats_bus); |
2812 | 2829 | ||
2813 | pci_free_consistent(pdev, sizeof(*mgp->cmd), mgp->cmd, mgp->cmd_bus); | 2830 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), |
2831 | mgp->cmd, mgp->cmd_bus); | ||
2814 | 2832 | ||
2815 | free_netdev(netdev); | 2833 | free_netdev(netdev); |
2816 | pci_set_drvdata(pdev, NULL); | 2834 | pci_set_drvdata(pdev, NULL); |
2817 | } | 2835 | } |
2818 | 2836 | ||
2819 | #define PCI_DEVICE_ID_MYIRCOM_MYRI10GE_Z8E 0x0008 | 2837 | #define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E 0x0008 |
2820 | 2838 | ||
2821 | static struct pci_device_id myri10ge_pci_tbl[] = { | 2839 | static struct pci_device_id myri10ge_pci_tbl[] = { |
2822 | {PCI_DEVICE(PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYIRCOM_MYRI10GE_Z8E)}, | 2840 | {PCI_DEVICE(PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E)}, |
2823 | {0}, | 2841 | {0}, |
2824 | }; | 2842 | }; |
2825 | 2843 | ||
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 66e74f740261..bf58db29e2ed 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -107,7 +107,7 @@ static int init_netconsole(void) | |||
107 | 107 | ||
108 | if(!configured) { | 108 | if(!configured) { |
109 | printk("netconsole: not configured, aborting\n"); | 109 | printk("netconsole: not configured, aborting\n"); |
110 | return -EINVAL; | 110 | return 0; |
111 | } | 111 | } |
112 | 112 | ||
113 | if(netpoll_setup(&np)) | 113 | if(netpoll_setup(&np)) |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 4260c2128f47..a8f6bfc96fd2 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -1204,7 +1204,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt) | |||
1204 | 1204 | ||
1205 | dev->last_rx = jiffies; | 1205 | dev->last_rx = jiffies; |
1206 | lp->linux_stats.rx_packets++; | 1206 | lp->linux_stats.rx_packets++; |
1207 | lp->linux_stats.rx_bytes += skb->len; | 1207 | lp->linux_stats.rx_bytes += pkt_len; |
1208 | outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ | 1208 | outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ |
1209 | continue; | 1209 | continue; |
1210 | } else { | 1210 | } else { |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 475dc930380f..0d101a18026a 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -861,6 +861,9 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) | |||
861 | * give dev_queue_xmit something it can free. | 861 | * give dev_queue_xmit something it can free. |
862 | */ | 862 | */ |
863 | skb2 = skb_clone(skb, GFP_ATOMIC); | 863 | skb2 = skb_clone(skb, GFP_ATOMIC); |
864 | |||
865 | if (skb2 == NULL) | ||
866 | goto abort; | ||
864 | } | 867 | } |
865 | 868 | ||
866 | ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr)); | 869 | ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr)); |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 5ca5a1b546a1..536dd1cf7f79 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -44,12 +44,13 @@ | |||
44 | #include "skge.h" | 44 | #include "skge.h" |
45 | 45 | ||
46 | #define DRV_NAME "skge" | 46 | #define DRV_NAME "skge" |
47 | #define DRV_VERSION "1.5" | 47 | #define DRV_VERSION "1.6" |
48 | #define PFX DRV_NAME " " | 48 | #define PFX DRV_NAME " " |
49 | 49 | ||
50 | #define DEFAULT_TX_RING_SIZE 128 | 50 | #define DEFAULT_TX_RING_SIZE 128 |
51 | #define DEFAULT_RX_RING_SIZE 512 | 51 | #define DEFAULT_RX_RING_SIZE 512 |
52 | #define MAX_TX_RING_SIZE 1024 | 52 | #define MAX_TX_RING_SIZE 1024 |
53 | #define TX_LOW_WATER (MAX_SKB_FRAGS + 1) | ||
53 | #define MAX_RX_RING_SIZE 4096 | 54 | #define MAX_RX_RING_SIZE 4096 |
54 | #define RX_COPY_THRESHOLD 128 | 55 | #define RX_COPY_THRESHOLD 128 |
55 | #define RX_BUF_SIZE 1536 | 56 | #define RX_BUF_SIZE 1536 |
@@ -401,7 +402,7 @@ static int skge_set_ring_param(struct net_device *dev, | |||
401 | int err; | 402 | int err; |
402 | 403 | ||
403 | if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || | 404 | if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || |
404 | p->tx_pending < MAX_SKB_FRAGS+1 || p->tx_pending > MAX_TX_RING_SIZE) | 405 | p->tx_pending < TX_LOW_WATER || p->tx_pending > MAX_TX_RING_SIZE) |
405 | return -EINVAL; | 406 | return -EINVAL; |
406 | 407 | ||
407 | skge->rx_ring.count = p->rx_pending; | 408 | skge->rx_ring.count = p->rx_pending; |
@@ -603,7 +604,7 @@ static void skge_led(struct skge_port *skge, enum led_mode mode) | |||
603 | struct skge_hw *hw = skge->hw; | 604 | struct skge_hw *hw = skge->hw; |
604 | int port = skge->port; | 605 | int port = skge->port; |
605 | 606 | ||
606 | spin_lock_bh(&hw->phy_lock); | 607 | mutex_lock(&hw->phy_mutex); |
607 | if (hw->chip_id == CHIP_ID_GENESIS) { | 608 | if (hw->chip_id == CHIP_ID_GENESIS) { |
608 | switch (mode) { | 609 | switch (mode) { |
609 | case LED_MODE_OFF: | 610 | case LED_MODE_OFF: |
@@ -663,7 +664,7 @@ static void skge_led(struct skge_port *skge, enum led_mode mode) | |||
663 | PHY_M_LED_MO_RX(MO_LED_ON)); | 664 | PHY_M_LED_MO_RX(MO_LED_ON)); |
664 | } | 665 | } |
665 | } | 666 | } |
666 | spin_unlock_bh(&hw->phy_lock); | 667 | mutex_unlock(&hw->phy_mutex); |
667 | } | 668 | } |
668 | 669 | ||
669 | /* blink LED's for finding board */ | 670 | /* blink LED's for finding board */ |
@@ -2038,7 +2039,7 @@ static void skge_phy_reset(struct skge_port *skge) | |||
2038 | netif_stop_queue(skge->netdev); | 2039 | netif_stop_queue(skge->netdev); |
2039 | netif_carrier_off(skge->netdev); | 2040 | netif_carrier_off(skge->netdev); |
2040 | 2041 | ||
2041 | spin_lock_bh(&hw->phy_lock); | 2042 | mutex_lock(&hw->phy_mutex); |
2042 | if (hw->chip_id == CHIP_ID_GENESIS) { | 2043 | if (hw->chip_id == CHIP_ID_GENESIS) { |
2043 | genesis_reset(hw, port); | 2044 | genesis_reset(hw, port); |
2044 | genesis_mac_init(hw, port); | 2045 | genesis_mac_init(hw, port); |
@@ -2046,7 +2047,7 @@ static void skge_phy_reset(struct skge_port *skge) | |||
2046 | yukon_reset(hw, port); | 2047 | yukon_reset(hw, port); |
2047 | yukon_init(hw, port); | 2048 | yukon_init(hw, port); |
2048 | } | 2049 | } |
2049 | spin_unlock_bh(&hw->phy_lock); | 2050 | mutex_unlock(&hw->phy_mutex); |
2050 | } | 2051 | } |
2051 | 2052 | ||
2052 | /* Basic MII support */ | 2053 | /* Basic MII support */ |
@@ -2067,12 +2068,12 @@ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
2067 | /* fallthru */ | 2068 | /* fallthru */ |
2068 | case SIOCGMIIREG: { | 2069 | case SIOCGMIIREG: { |
2069 | u16 val = 0; | 2070 | u16 val = 0; |
2070 | spin_lock_bh(&hw->phy_lock); | 2071 | mutex_lock(&hw->phy_mutex); |
2071 | if (hw->chip_id == CHIP_ID_GENESIS) | 2072 | if (hw->chip_id == CHIP_ID_GENESIS) |
2072 | err = __xm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val); | 2073 | err = __xm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val); |
2073 | else | 2074 | else |
2074 | err = __gm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val); | 2075 | err = __gm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val); |
2075 | spin_unlock_bh(&hw->phy_lock); | 2076 | mutex_unlock(&hw->phy_mutex); |
2076 | data->val_out = val; | 2077 | data->val_out = val; |
2077 | break; | 2078 | break; |
2078 | } | 2079 | } |
@@ -2081,14 +2082,14 @@ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
2081 | if (!capable(CAP_NET_ADMIN)) | 2082 | if (!capable(CAP_NET_ADMIN)) |
2082 | return -EPERM; | 2083 | return -EPERM; |
2083 | 2084 | ||
2084 | spin_lock_bh(&hw->phy_lock); | 2085 | mutex_lock(&hw->phy_mutex); |
2085 | if (hw->chip_id == CHIP_ID_GENESIS) | 2086 | if (hw->chip_id == CHIP_ID_GENESIS) |
2086 | err = xm_phy_write(hw, skge->port, data->reg_num & 0x1f, | 2087 | err = xm_phy_write(hw, skge->port, data->reg_num & 0x1f, |
2087 | data->val_in); | 2088 | data->val_in); |
2088 | else | 2089 | else |
2089 | err = gm_phy_write(hw, skge->port, data->reg_num & 0x1f, | 2090 | err = gm_phy_write(hw, skge->port, data->reg_num & 0x1f, |
2090 | data->val_in); | 2091 | data->val_in); |
2091 | spin_unlock_bh(&hw->phy_lock); | 2092 | mutex_unlock(&hw->phy_mutex); |
2092 | break; | 2093 | break; |
2093 | } | 2094 | } |
2094 | return err; | 2095 | return err; |
@@ -2191,12 +2192,12 @@ static int skge_up(struct net_device *dev) | |||
2191 | goto free_rx_ring; | 2192 | goto free_rx_ring; |
2192 | 2193 | ||
2193 | /* Initialize MAC */ | 2194 | /* Initialize MAC */ |
2194 | spin_lock_bh(&hw->phy_lock); | 2195 | mutex_lock(&hw->phy_mutex); |
2195 | if (hw->chip_id == CHIP_ID_GENESIS) | 2196 | if (hw->chip_id == CHIP_ID_GENESIS) |
2196 | genesis_mac_init(hw, port); | 2197 | genesis_mac_init(hw, port); |
2197 | else | 2198 | else |
2198 | yukon_mac_init(hw, port); | 2199 | yukon_mac_init(hw, port); |
2199 | spin_unlock_bh(&hw->phy_lock); | 2200 | mutex_unlock(&hw->phy_mutex); |
2200 | 2201 | ||
2201 | /* Configure RAMbuffers */ | 2202 | /* Configure RAMbuffers */ |
2202 | chunk = hw->ram_size / ((hw->ports + 1)*2); | 2203 | chunk = hw->ram_size / ((hw->ports + 1)*2); |
@@ -2302,21 +2303,20 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
2302 | { | 2303 | { |
2303 | struct skge_port *skge = netdev_priv(dev); | 2304 | struct skge_port *skge = netdev_priv(dev); |
2304 | struct skge_hw *hw = skge->hw; | 2305 | struct skge_hw *hw = skge->hw; |
2305 | struct skge_ring *ring = &skge->tx_ring; | ||
2306 | struct skge_element *e; | 2306 | struct skge_element *e; |
2307 | struct skge_tx_desc *td; | 2307 | struct skge_tx_desc *td; |
2308 | int i; | 2308 | int i; |
2309 | u32 control, len; | 2309 | u32 control, len; |
2310 | u64 map; | 2310 | u64 map; |
2311 | unsigned long flags; | ||
2311 | 2312 | ||
2312 | skb = skb_padto(skb, ETH_ZLEN); | 2313 | skb = skb_padto(skb, ETH_ZLEN); |
2313 | if (!skb) | 2314 | if (!skb) |
2314 | return NETDEV_TX_OK; | 2315 | return NETDEV_TX_OK; |
2315 | 2316 | ||
2316 | if (!spin_trylock(&skge->tx_lock)) { | 2317 | if (!spin_trylock_irqsave(&skge->tx_lock, flags)) |
2317 | /* Collision - tell upper layer to requeue */ | 2318 | /* Collision - tell upper layer to requeue */ |
2318 | return NETDEV_TX_LOCKED; | 2319 | return NETDEV_TX_LOCKED; |
2319 | } | ||
2320 | 2320 | ||
2321 | if (unlikely(skge_avail(&skge->tx_ring) < skb_shinfo(skb)->nr_frags + 1)) { | 2321 | if (unlikely(skge_avail(&skge->tx_ring) < skb_shinfo(skb)->nr_frags + 1)) { |
2322 | if (!netif_queue_stopped(dev)) { | 2322 | if (!netif_queue_stopped(dev)) { |
@@ -2325,12 +2325,13 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
2325 | printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", | 2325 | printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", |
2326 | dev->name); | 2326 | dev->name); |
2327 | } | 2327 | } |
2328 | spin_unlock(&skge->tx_lock); | 2328 | spin_unlock_irqrestore(&skge->tx_lock, flags); |
2329 | return NETDEV_TX_BUSY; | 2329 | return NETDEV_TX_BUSY; |
2330 | } | 2330 | } |
2331 | 2331 | ||
2332 | e = ring->to_use; | 2332 | e = skge->tx_ring.to_use; |
2333 | td = e->desc; | 2333 | td = e->desc; |
2334 | BUG_ON(td->control & BMU_OWN); | ||
2334 | e->skb = skb; | 2335 | e->skb = skb; |
2335 | len = skb_headlen(skb); | 2336 | len = skb_headlen(skb); |
2336 | map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); | 2337 | map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); |
@@ -2371,8 +2372,10 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
2371 | frag->size, PCI_DMA_TODEVICE); | 2372 | frag->size, PCI_DMA_TODEVICE); |
2372 | 2373 | ||
2373 | e = e->next; | 2374 | e = e->next; |
2374 | e->skb = NULL; | 2375 | e->skb = skb; |
2375 | tf = e->desc; | 2376 | tf = e->desc; |
2377 | BUG_ON(tf->control & BMU_OWN); | ||
2378 | |||
2376 | tf->dma_lo = map; | 2379 | tf->dma_lo = map; |
2377 | tf->dma_hi = (u64) map >> 32; | 2380 | tf->dma_hi = (u64) map >> 32; |
2378 | pci_unmap_addr_set(e, mapaddr, map); | 2381 | pci_unmap_addr_set(e, mapaddr, map); |
@@ -2389,56 +2392,68 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
2389 | 2392 | ||
2390 | skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_START); | 2393 | skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_START); |
2391 | 2394 | ||
2392 | if (netif_msg_tx_queued(skge)) | 2395 | if (unlikely(netif_msg_tx_queued(skge))) |
2393 | printk(KERN_DEBUG "%s: tx queued, slot %td, len %d\n", | 2396 | printk(KERN_DEBUG "%s: tx queued, slot %td, len %d\n", |
2394 | dev->name, e - ring->start, skb->len); | 2397 | dev->name, e - skge->tx_ring.start, skb->len); |
2395 | 2398 | ||
2396 | ring->to_use = e->next; | 2399 | skge->tx_ring.to_use = e->next; |
2397 | if (skge_avail(&skge->tx_ring) <= MAX_SKB_FRAGS + 1) { | 2400 | if (skge_avail(&skge->tx_ring) <= TX_LOW_WATER) { |
2398 | pr_debug("%s: transmit queue full\n", dev->name); | 2401 | pr_debug("%s: transmit queue full\n", dev->name); |
2399 | netif_stop_queue(dev); | 2402 | netif_stop_queue(dev); |
2400 | } | 2403 | } |
2401 | 2404 | ||
2402 | mmiowb(); | 2405 | spin_unlock_irqrestore(&skge->tx_lock, flags); |
2403 | spin_unlock(&skge->tx_lock); | ||
2404 | 2406 | ||
2405 | dev->trans_start = jiffies; | 2407 | dev->trans_start = jiffies; |
2406 | 2408 | ||
2407 | return NETDEV_TX_OK; | 2409 | return NETDEV_TX_OK; |
2408 | } | 2410 | } |
2409 | 2411 | ||
2410 | static void skge_tx_complete(struct skge_port *skge, struct skge_element *last) | 2412 | |
2413 | /* Free resources associated with this reing element */ | ||
2414 | static void skge_tx_free(struct skge_port *skge, struct skge_element *e, | ||
2415 | u32 control) | ||
2411 | { | 2416 | { |
2412 | struct pci_dev *pdev = skge->hw->pdev; | 2417 | struct pci_dev *pdev = skge->hw->pdev; |
2413 | struct skge_element *e; | ||
2414 | 2418 | ||
2415 | for (e = skge->tx_ring.to_clean; e != last; e = e->next) { | 2419 | BUG_ON(!e->skb); |
2416 | struct sk_buff *skb = e->skb; | ||
2417 | int i; | ||
2418 | 2420 | ||
2419 | e->skb = NULL; | 2421 | /* skb header vs. fragment */ |
2422 | if (control & BMU_STF) | ||
2420 | pci_unmap_single(pdev, pci_unmap_addr(e, mapaddr), | 2423 | pci_unmap_single(pdev, pci_unmap_addr(e, mapaddr), |
2421 | skb_headlen(skb), PCI_DMA_TODEVICE); | 2424 | pci_unmap_len(e, maplen), |
2425 | PCI_DMA_TODEVICE); | ||
2426 | else | ||
2427 | pci_unmap_page(pdev, pci_unmap_addr(e, mapaddr), | ||
2428 | pci_unmap_len(e, maplen), | ||
2429 | PCI_DMA_TODEVICE); | ||
2422 | 2430 | ||
2423 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 2431 | if (control & BMU_EOF) { |
2424 | e = e->next; | 2432 | if (unlikely(netif_msg_tx_done(skge))) |
2425 | pci_unmap_page(pdev, pci_unmap_addr(e, mapaddr), | 2433 | printk(KERN_DEBUG PFX "%s: tx done slot %td\n", |
2426 | skb_shinfo(skb)->frags[i].size, | 2434 | skge->netdev->name, e - skge->tx_ring.start); |
2427 | PCI_DMA_TODEVICE); | ||
2428 | } | ||
2429 | 2435 | ||
2430 | dev_kfree_skb(skb); | 2436 | dev_kfree_skb_any(e->skb); |
2431 | } | 2437 | } |
2432 | skge->tx_ring.to_clean = e; | 2438 | e->skb = NULL; |
2433 | } | 2439 | } |
2434 | 2440 | ||
2441 | /* Free all buffers in transmit ring */ | ||
2435 | static void skge_tx_clean(struct skge_port *skge) | 2442 | static void skge_tx_clean(struct skge_port *skge) |
2436 | { | 2443 | { |
2444 | struct skge_element *e; | ||
2445 | unsigned long flags; | ||
2446 | |||
2447 | spin_lock_irqsave(&skge->tx_lock, flags); | ||
2448 | for (e = skge->tx_ring.to_clean; e != skge->tx_ring.to_use; e = e->next) { | ||
2449 | struct skge_tx_desc *td = e->desc; | ||
2450 | skge_tx_free(skge, e, td->control); | ||
2451 | td->control = 0; | ||
2452 | } | ||
2437 | 2453 | ||
2438 | spin_lock_bh(&skge->tx_lock); | 2454 | skge->tx_ring.to_clean = e; |
2439 | skge_tx_complete(skge, skge->tx_ring.to_use); | ||
2440 | netif_wake_queue(skge->netdev); | 2455 | netif_wake_queue(skge->netdev); |
2441 | spin_unlock_bh(&skge->tx_lock); | 2456 | spin_unlock_irqrestore(&skge->tx_lock, flags); |
2442 | } | 2457 | } |
2443 | 2458 | ||
2444 | static void skge_tx_timeout(struct net_device *dev) | 2459 | static void skge_tx_timeout(struct net_device *dev) |
@@ -2664,32 +2679,28 @@ resubmit: | |||
2664 | return NULL; | 2679 | return NULL; |
2665 | } | 2680 | } |
2666 | 2681 | ||
2667 | static void skge_tx_done(struct skge_port *skge) | 2682 | /* Free all buffers in Tx ring which are no longer owned by device */ |
2683 | static void skge_txirq(struct net_device *dev) | ||
2668 | { | 2684 | { |
2685 | struct skge_port *skge = netdev_priv(dev); | ||
2669 | struct skge_ring *ring = &skge->tx_ring; | 2686 | struct skge_ring *ring = &skge->tx_ring; |
2670 | struct skge_element *e, *last; | 2687 | struct skge_element *e; |
2688 | |||
2689 | rmb(); | ||
2671 | 2690 | ||
2672 | spin_lock(&skge->tx_lock); | 2691 | spin_lock(&skge->tx_lock); |
2673 | last = ring->to_clean; | ||
2674 | for (e = ring->to_clean; e != ring->to_use; e = e->next) { | 2692 | for (e = ring->to_clean; e != ring->to_use; e = e->next) { |
2675 | struct skge_tx_desc *td = e->desc; | 2693 | struct skge_tx_desc *td = e->desc; |
2676 | 2694 | ||
2677 | if (td->control & BMU_OWN) | 2695 | if (td->control & BMU_OWN) |
2678 | break; | 2696 | break; |
2679 | 2697 | ||
2680 | if (td->control & BMU_EOF) { | 2698 | skge_tx_free(skge, e, td->control); |
2681 | last = e->next; | ||
2682 | if (unlikely(netif_msg_tx_done(skge))) | ||
2683 | printk(KERN_DEBUG PFX "%s: tx done slot %td\n", | ||
2684 | skge->netdev->name, e - ring->start); | ||
2685 | } | ||
2686 | } | 2699 | } |
2700 | skge->tx_ring.to_clean = e; | ||
2687 | 2701 | ||
2688 | skge_tx_complete(skge, last); | 2702 | if (netif_queue_stopped(skge->netdev) |
2689 | 2703 | && skge_avail(&skge->tx_ring) > TX_LOW_WATER) | |
2690 | skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_IRQ_CL_F); | ||
2691 | |||
2692 | if (skge_avail(&skge->tx_ring) > MAX_SKB_FRAGS + 1) | ||
2693 | netif_wake_queue(skge->netdev); | 2704 | netif_wake_queue(skge->netdev); |
2694 | 2705 | ||
2695 | spin_unlock(&skge->tx_lock); | 2706 | spin_unlock(&skge->tx_lock); |
@@ -2704,8 +2715,6 @@ static int skge_poll(struct net_device *dev, int *budget) | |||
2704 | int to_do = min(dev->quota, *budget); | 2715 | int to_do = min(dev->quota, *budget); |
2705 | int work_done = 0; | 2716 | int work_done = 0; |
2706 | 2717 | ||
2707 | skge_tx_done(skge); | ||
2708 | |||
2709 | for (e = ring->to_clean; prefetch(e->next), work_done < to_do; e = e->next) { | 2718 | for (e = ring->to_clean; prefetch(e->next), work_done < to_do; e = e->next) { |
2710 | struct skge_rx_desc *rd = e->desc; | 2719 | struct skge_rx_desc *rd = e->desc; |
2711 | struct sk_buff *skb; | 2720 | struct sk_buff *skb; |
@@ -2737,10 +2746,12 @@ static int skge_poll(struct net_device *dev, int *budget) | |||
2737 | return 1; /* not done */ | 2746 | return 1; /* not done */ |
2738 | 2747 | ||
2739 | netif_rx_complete(dev); | 2748 | netif_rx_complete(dev); |
2740 | mmiowb(); | ||
2741 | 2749 | ||
2742 | hw->intr_mask |= skge->port == 0 ? (IS_R1_F|IS_XA1_F) : (IS_R2_F|IS_XA2_F); | 2750 | spin_lock_irq(&hw->hw_lock); |
2751 | hw->intr_mask |= rxirqmask[skge->port]; | ||
2743 | skge_write32(hw, B0_IMSK, hw->intr_mask); | 2752 | skge_write32(hw, B0_IMSK, hw->intr_mask); |
2753 | mmiowb(); | ||
2754 | spin_unlock_irq(&hw->hw_lock); | ||
2744 | 2755 | ||
2745 | return 0; | 2756 | return 0; |
2746 | } | 2757 | } |
@@ -2847,16 +2858,16 @@ static void skge_error_irq(struct skge_hw *hw) | |||
2847 | } | 2858 | } |
2848 | 2859 | ||
2849 | /* | 2860 | /* |
2850 | * Interrupt from PHY are handled in tasklet (soft irq) | 2861 | * Interrupt from PHY are handled in work queue |
2851 | * because accessing phy registers requires spin wait which might | 2862 | * because accessing phy registers requires spin wait which might |
2852 | * cause excess interrupt latency. | 2863 | * cause excess interrupt latency. |
2853 | */ | 2864 | */ |
2854 | static void skge_extirq(unsigned long data) | 2865 | static void skge_extirq(void *arg) |
2855 | { | 2866 | { |
2856 | struct skge_hw *hw = (struct skge_hw *) data; | 2867 | struct skge_hw *hw = arg; |
2857 | int port; | 2868 | int port; |
2858 | 2869 | ||
2859 | spin_lock(&hw->phy_lock); | 2870 | mutex_lock(&hw->phy_mutex); |
2860 | for (port = 0; port < hw->ports; port++) { | 2871 | for (port = 0; port < hw->ports; port++) { |
2861 | struct net_device *dev = hw->dev[port]; | 2872 | struct net_device *dev = hw->dev[port]; |
2862 | struct skge_port *skge = netdev_priv(dev); | 2873 | struct skge_port *skge = netdev_priv(dev); |
@@ -2868,10 +2879,12 @@ static void skge_extirq(unsigned long data) | |||
2868 | bcom_phy_intr(skge); | 2879 | bcom_phy_intr(skge); |
2869 | } | 2880 | } |
2870 | } | 2881 | } |
2871 | spin_unlock(&hw->phy_lock); | 2882 | mutex_unlock(&hw->phy_mutex); |
2872 | 2883 | ||
2884 | spin_lock_irq(&hw->hw_lock); | ||
2873 | hw->intr_mask |= IS_EXT_REG; | 2885 | hw->intr_mask |= IS_EXT_REG; |
2874 | skge_write32(hw, B0_IMSK, hw->intr_mask); | 2886 | skge_write32(hw, B0_IMSK, hw->intr_mask); |
2887 | spin_unlock_irq(&hw->hw_lock); | ||
2875 | } | 2888 | } |
2876 | 2889 | ||
2877 | static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) | 2890 | static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) |
@@ -2884,54 +2897,68 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
2884 | if (status == 0) | 2897 | if (status == 0) |
2885 | return IRQ_NONE; | 2898 | return IRQ_NONE; |
2886 | 2899 | ||
2900 | spin_lock(&hw->hw_lock); | ||
2901 | status &= hw->intr_mask; | ||
2887 | if (status & IS_EXT_REG) { | 2902 | if (status & IS_EXT_REG) { |
2888 | hw->intr_mask &= ~IS_EXT_REG; | 2903 | hw->intr_mask &= ~IS_EXT_REG; |
2889 | tasklet_schedule(&hw->ext_tasklet); | 2904 | schedule_work(&hw->phy_work); |
2890 | } | 2905 | } |
2891 | 2906 | ||
2892 | if (status & (IS_R1_F|IS_XA1_F)) { | 2907 | if (status & IS_XA1_F) { |
2893 | skge_write8(hw, Q_ADDR(Q_R1, Q_CSR), CSR_IRQ_CL_F); | 2908 | skge_write8(hw, Q_ADDR(Q_XA1, Q_CSR), CSR_IRQ_CL_F); |
2894 | hw->intr_mask &= ~(IS_R1_F|IS_XA1_F); | 2909 | skge_txirq(hw->dev[0]); |
2895 | netif_rx_schedule(hw->dev[0]); | ||
2896 | } | 2910 | } |
2897 | 2911 | ||
2898 | if (status & (IS_R2_F|IS_XA2_F)) { | 2912 | if (status & IS_R1_F) { |
2899 | skge_write8(hw, Q_ADDR(Q_R2, Q_CSR), CSR_IRQ_CL_F); | 2913 | skge_write8(hw, Q_ADDR(Q_R1, Q_CSR), CSR_IRQ_CL_F); |
2900 | hw->intr_mask &= ~(IS_R2_F|IS_XA2_F); | 2914 | hw->intr_mask &= ~IS_R1_F; |
2901 | netif_rx_schedule(hw->dev[1]); | 2915 | netif_rx_schedule(hw->dev[0]); |
2902 | } | 2916 | } |
2903 | 2917 | ||
2904 | if (likely((status & hw->intr_mask) == 0)) | 2918 | if (status & IS_PA_TO_TX1) |
2905 | return IRQ_HANDLED; | 2919 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_TX1); |
2906 | 2920 | ||
2907 | if (status & IS_PA_TO_RX1) { | 2921 | if (status & IS_PA_TO_RX1) { |
2908 | struct skge_port *skge = netdev_priv(hw->dev[0]); | 2922 | struct skge_port *skge = netdev_priv(hw->dev[0]); |
2909 | ++skge->net_stats.rx_over_errors; | ||
2910 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_RX1); | ||
2911 | } | ||
2912 | 2923 | ||
2913 | if (status & IS_PA_TO_RX2) { | ||
2914 | struct skge_port *skge = netdev_priv(hw->dev[1]); | ||
2915 | ++skge->net_stats.rx_over_errors; | 2924 | ++skge->net_stats.rx_over_errors; |
2916 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_RX2); | 2925 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_RX1); |
2917 | } | 2926 | } |
2918 | 2927 | ||
2919 | if (status & IS_PA_TO_TX1) | ||
2920 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_TX1); | ||
2921 | |||
2922 | if (status & IS_PA_TO_TX2) | ||
2923 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_TX2); | ||
2924 | 2928 | ||
2925 | if (status & IS_MAC1) | 2929 | if (status & IS_MAC1) |
2926 | skge_mac_intr(hw, 0); | 2930 | skge_mac_intr(hw, 0); |
2927 | 2931 | ||
2928 | if (status & IS_MAC2) | 2932 | if (hw->dev[1]) { |
2929 | skge_mac_intr(hw, 1); | 2933 | if (status & IS_XA2_F) { |
2934 | skge_write8(hw, Q_ADDR(Q_XA2, Q_CSR), CSR_IRQ_CL_F); | ||
2935 | skge_txirq(hw->dev[1]); | ||
2936 | } | ||
2937 | |||
2938 | if (status & IS_R2_F) { | ||
2939 | skge_write8(hw, Q_ADDR(Q_R2, Q_CSR), CSR_IRQ_CL_F); | ||
2940 | hw->intr_mask &= ~IS_R2_F; | ||
2941 | netif_rx_schedule(hw->dev[1]); | ||
2942 | } | ||
2943 | |||
2944 | if (status & IS_PA_TO_RX2) { | ||
2945 | struct skge_port *skge = netdev_priv(hw->dev[1]); | ||
2946 | ++skge->net_stats.rx_over_errors; | ||
2947 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_RX2); | ||
2948 | } | ||
2949 | |||
2950 | if (status & IS_PA_TO_TX2) | ||
2951 | skge_write16(hw, B3_PA_CTRL, PA_CLR_TO_TX2); | ||
2952 | |||
2953 | if (status & IS_MAC2) | ||
2954 | skge_mac_intr(hw, 1); | ||
2955 | } | ||
2930 | 2956 | ||
2931 | if (status & IS_HW_ERR) | 2957 | if (status & IS_HW_ERR) |
2932 | skge_error_irq(hw); | 2958 | skge_error_irq(hw); |
2933 | 2959 | ||
2934 | skge_write32(hw, B0_IMSK, hw->intr_mask); | 2960 | skge_write32(hw, B0_IMSK, hw->intr_mask); |
2961 | spin_unlock(&hw->hw_lock); | ||
2935 | 2962 | ||
2936 | return IRQ_HANDLED; | 2963 | return IRQ_HANDLED; |
2937 | } | 2964 | } |
@@ -2957,7 +2984,7 @@ static int skge_set_mac_address(struct net_device *dev, void *p) | |||
2957 | if (!is_valid_ether_addr(addr->sa_data)) | 2984 | if (!is_valid_ether_addr(addr->sa_data)) |
2958 | return -EADDRNOTAVAIL; | 2985 | return -EADDRNOTAVAIL; |
2959 | 2986 | ||
2960 | spin_lock_bh(&hw->phy_lock); | 2987 | mutex_lock(&hw->phy_mutex); |
2961 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 2988 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); |
2962 | memcpy_toio(hw->regs + B2_MAC_1 + port*8, | 2989 | memcpy_toio(hw->regs + B2_MAC_1 + port*8, |
2963 | dev->dev_addr, ETH_ALEN); | 2990 | dev->dev_addr, ETH_ALEN); |
@@ -2970,7 +2997,7 @@ static int skge_set_mac_address(struct net_device *dev, void *p) | |||
2970 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); | 2997 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); |
2971 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); | 2998 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); |
2972 | } | 2999 | } |
2973 | spin_unlock_bh(&hw->phy_lock); | 3000 | mutex_unlock(&hw->phy_mutex); |
2974 | 3001 | ||
2975 | return 0; | 3002 | return 0; |
2976 | } | 3003 | } |
@@ -3082,6 +3109,7 @@ static int skge_reset(struct skge_hw *hw) | |||
3082 | else | 3109 | else |
3083 | hw->ram_size = t8 * 4096; | 3110 | hw->ram_size = t8 * 4096; |
3084 | 3111 | ||
3112 | spin_lock_init(&hw->hw_lock); | ||
3085 | hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; | 3113 | hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; |
3086 | if (hw->ports > 1) | 3114 | if (hw->ports > 1) |
3087 | hw->intr_mask |= IS_PORT_2; | 3115 | hw->intr_mask |= IS_PORT_2; |
@@ -3150,14 +3178,14 @@ static int skge_reset(struct skge_hw *hw) | |||
3150 | 3178 | ||
3151 | skge_write32(hw, B0_IMSK, hw->intr_mask); | 3179 | skge_write32(hw, B0_IMSK, hw->intr_mask); |
3152 | 3180 | ||
3153 | spin_lock_bh(&hw->phy_lock); | 3181 | mutex_lock(&hw->phy_mutex); |
3154 | for (i = 0; i < hw->ports; i++) { | 3182 | for (i = 0; i < hw->ports; i++) { |
3155 | if (hw->chip_id == CHIP_ID_GENESIS) | 3183 | if (hw->chip_id == CHIP_ID_GENESIS) |
3156 | genesis_reset(hw, i); | 3184 | genesis_reset(hw, i); |
3157 | else | 3185 | else |
3158 | yukon_reset(hw, i); | 3186 | yukon_reset(hw, i); |
3159 | } | 3187 | } |
3160 | spin_unlock_bh(&hw->phy_lock); | 3188 | mutex_unlock(&hw->phy_mutex); |
3161 | 3189 | ||
3162 | return 0; | 3190 | return 0; |
3163 | } | 3191 | } |
@@ -3305,8 +3333,8 @@ static int __devinit skge_probe(struct pci_dev *pdev, | |||
3305 | } | 3333 | } |
3306 | 3334 | ||
3307 | hw->pdev = pdev; | 3335 | hw->pdev = pdev; |
3308 | spin_lock_init(&hw->phy_lock); | 3336 | mutex_init(&hw->phy_mutex); |
3309 | tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); | 3337 | INIT_WORK(&hw->phy_work, skge_extirq, hw); |
3310 | 3338 | ||
3311 | hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); | 3339 | hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); |
3312 | if (!hw->regs) { | 3340 | if (!hw->regs) { |
@@ -3334,6 +3362,14 @@ static int __devinit skge_probe(struct pci_dev *pdev, | |||
3334 | if ((dev = skge_devinit(hw, 0, using_dac)) == NULL) | 3362 | if ((dev = skge_devinit(hw, 0, using_dac)) == NULL) |
3335 | goto err_out_led_off; | 3363 | goto err_out_led_off; |
3336 | 3364 | ||
3365 | if (!is_valid_ether_addr(dev->dev_addr)) { | ||
3366 | printk(KERN_ERR PFX "%s: bad (zero?) ethernet address in rom\n", | ||
3367 | pci_name(pdev)); | ||
3368 | err = -EIO; | ||
3369 | goto err_out_free_netdev; | ||
3370 | } | ||
3371 | |||
3372 | |||
3337 | err = register_netdev(dev); | 3373 | err = register_netdev(dev); |
3338 | if (err) { | 3374 | if (err) { |
3339 | printk(KERN_ERR PFX "%s: cannot register net device\n", | 3375 | printk(KERN_ERR PFX "%s: cannot register net device\n", |
@@ -3388,11 +3424,15 @@ static void __devexit skge_remove(struct pci_dev *pdev) | |||
3388 | dev0 = hw->dev[0]; | 3424 | dev0 = hw->dev[0]; |
3389 | unregister_netdev(dev0); | 3425 | unregister_netdev(dev0); |
3390 | 3426 | ||
3427 | spin_lock_irq(&hw->hw_lock); | ||
3428 | hw->intr_mask = 0; | ||
3391 | skge_write32(hw, B0_IMSK, 0); | 3429 | skge_write32(hw, B0_IMSK, 0); |
3430 | spin_unlock_irq(&hw->hw_lock); | ||
3431 | |||
3392 | skge_write16(hw, B0_LED, LED_STAT_OFF); | 3432 | skge_write16(hw, B0_LED, LED_STAT_OFF); |
3393 | skge_write8(hw, B0_CTST, CS_RST_SET); | 3433 | skge_write8(hw, B0_CTST, CS_RST_SET); |
3394 | 3434 | ||
3395 | tasklet_kill(&hw->ext_tasklet); | 3435 | flush_scheduled_work(); |
3396 | 3436 | ||
3397 | free_irq(pdev->irq, hw); | 3437 | free_irq(pdev->irq, hw); |
3398 | pci_release_regions(pdev); | 3438 | pci_release_regions(pdev); |
diff --git a/drivers/net/skge.h b/drivers/net/skge.h index 1f1ce88c8186..ed19ff47ce11 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h | |||
@@ -2388,6 +2388,7 @@ struct skge_ring { | |||
2388 | struct skge_hw { | 2388 | struct skge_hw { |
2389 | void __iomem *regs; | 2389 | void __iomem *regs; |
2390 | struct pci_dev *pdev; | 2390 | struct pci_dev *pdev; |
2391 | spinlock_t hw_lock; | ||
2391 | u32 intr_mask; | 2392 | u32 intr_mask; |
2392 | struct net_device *dev[2]; | 2393 | struct net_device *dev[2]; |
2393 | 2394 | ||
@@ -2399,9 +2400,8 @@ struct skge_hw { | |||
2399 | u32 ram_size; | 2400 | u32 ram_size; |
2400 | u32 ram_offset; | 2401 | u32 ram_offset; |
2401 | u16 phy_addr; | 2402 | u16 phy_addr; |
2402 | 2403 | struct work_struct phy_work; | |
2403 | struct tasklet_struct ext_tasklet; | 2404 | struct mutex phy_mutex; |
2404 | spinlock_t phy_lock; | ||
2405 | }; | 2405 | }; |
2406 | 2406 | ||
2407 | enum { | 2407 | enum { |
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h index d9a774b91ddc..f1b2640ebdc6 100644 --- a/drivers/net/via-velocity.h +++ b/drivers/net/via-velocity.h | |||
@@ -307,7 +307,7 @@ enum velocity_owner { | |||
307 | #define TX_QUEUE_NO 4 | 307 | #define TX_QUEUE_NO 4 |
308 | 308 | ||
309 | #define MAX_HW_MIB_COUNTER 32 | 309 | #define MAX_HW_MIB_COUNTER 32 |
310 | #define VELOCITY_MIN_MTU (1514-14) | 310 | #define VELOCITY_MIN_MTU (64) |
311 | #define VELOCITY_MAX_MTU (9000) | 311 | #define VELOCITY_MAX_MTU (9000) |
312 | 312 | ||
313 | /* | 313 | /* |
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index d7691c482835..30ec235e6935 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -531,6 +531,23 @@ config PRISM54 | |||
531 | say M here and read <file:Documentation/modules.txt>. The module | 531 | say M here and read <file:Documentation/modules.txt>. The module |
532 | will be called prism54.ko. | 532 | will be called prism54.ko. |
533 | 533 | ||
534 | config USB_ZD1201 | ||
535 | tristate "USB ZD1201 based Wireless device support" | ||
536 | depends on USB && NET_RADIO | ||
537 | select FW_LOADER | ||
538 | ---help--- | ||
539 | Say Y if you want to use wireless LAN adapters based on the ZyDAS | ||
540 | ZD1201 chip. | ||
541 | |||
542 | This driver makes the adapter appear as a normal Ethernet interface, | ||
543 | typically on wlan0. | ||
544 | |||
545 | The zd1201 device requires external firmware to be loaded. | ||
546 | This can be found at http://linux-lc100020.sourceforge.net/ | ||
547 | |||
548 | To compile this driver as a module, choose M here: the | ||
549 | module will be called zd1201. | ||
550 | |||
534 | source "drivers/net/wireless/hostap/Kconfig" | 551 | source "drivers/net/wireless/hostap/Kconfig" |
535 | source "drivers/net/wireless/bcm43xx/Kconfig" | 552 | source "drivers/net/wireless/bcm43xx/Kconfig" |
536 | 553 | ||
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile index c86779879361..512603de309a 100644 --- a/drivers/net/wireless/Makefile +++ b/drivers/net/wireless/Makefile | |||
@@ -40,3 +40,5 @@ obj-$(CONFIG_BCM43XX) += bcm43xx/ | |||
40 | # 16-bit wireless PCMCIA client drivers | 40 | # 16-bit wireless PCMCIA client drivers |
41 | obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o | 41 | obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o |
42 | obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o | 42 | obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o |
43 | |||
44 | obj-$(CONFIG_USB_ZD1201) += zd1201.o | ||
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c index bbecba02e697..d0318e525ba7 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c | |||
@@ -624,25 +624,28 @@ err_destroy_tx0: | |||
624 | static u16 generate_cookie(struct bcm43xx_dmaring *ring, | 624 | static u16 generate_cookie(struct bcm43xx_dmaring *ring, |
625 | int slot) | 625 | int slot) |
626 | { | 626 | { |
627 | u16 cookie = 0x0000; | 627 | u16 cookie = 0xF000; |
628 | 628 | ||
629 | /* Use the upper 4 bits of the cookie as | 629 | /* Use the upper 4 bits of the cookie as |
630 | * DMA controller ID and store the slot number | 630 | * DMA controller ID and store the slot number |
631 | * in the lower 12 bits | 631 | * in the lower 12 bits. |
632 | * Note that the cookie must never be 0, as this | ||
633 | * is a special value used in RX path. | ||
632 | */ | 634 | */ |
633 | switch (ring->mmio_base) { | 635 | switch (ring->mmio_base) { |
634 | default: | 636 | default: |
635 | assert(0); | 637 | assert(0); |
636 | case BCM43xx_MMIO_DMA1_BASE: | 638 | case BCM43xx_MMIO_DMA1_BASE: |
639 | cookie = 0xA000; | ||
637 | break; | 640 | break; |
638 | case BCM43xx_MMIO_DMA2_BASE: | 641 | case BCM43xx_MMIO_DMA2_BASE: |
639 | cookie = 0x1000; | 642 | cookie = 0xB000; |
640 | break; | 643 | break; |
641 | case BCM43xx_MMIO_DMA3_BASE: | 644 | case BCM43xx_MMIO_DMA3_BASE: |
642 | cookie = 0x2000; | 645 | cookie = 0xC000; |
643 | break; | 646 | break; |
644 | case BCM43xx_MMIO_DMA4_BASE: | 647 | case BCM43xx_MMIO_DMA4_BASE: |
645 | cookie = 0x3000; | 648 | cookie = 0xD000; |
646 | break; | 649 | break; |
647 | } | 650 | } |
648 | assert(((u16)slot & 0xF000) == 0x0000); | 651 | assert(((u16)slot & 0xF000) == 0x0000); |
@@ -660,16 +663,16 @@ struct bcm43xx_dmaring * parse_cookie(struct bcm43xx_private *bcm, | |||
660 | struct bcm43xx_dmaring *ring = NULL; | 663 | struct bcm43xx_dmaring *ring = NULL; |
661 | 664 | ||
662 | switch (cookie & 0xF000) { | 665 | switch (cookie & 0xF000) { |
663 | case 0x0000: | 666 | case 0xA000: |
664 | ring = dma->tx_ring0; | 667 | ring = dma->tx_ring0; |
665 | break; | 668 | break; |
666 | case 0x1000: | 669 | case 0xB000: |
667 | ring = dma->tx_ring1; | 670 | ring = dma->tx_ring1; |
668 | break; | 671 | break; |
669 | case 0x2000: | 672 | case 0xC000: |
670 | ring = dma->tx_ring2; | 673 | ring = dma->tx_ring2; |
671 | break; | 674 | break; |
672 | case 0x3000: | 675 | case 0xD000: |
673 | ring = dma->tx_ring3; | 676 | ring = dma->tx_ring3; |
674 | break; | 677 | break; |
675 | default: | 678 | default: |
@@ -839,8 +842,18 @@ static void dma_rx(struct bcm43xx_dmaring *ring, | |||
839 | /* We received an xmit status. */ | 842 | /* We received an xmit status. */ |
840 | struct bcm43xx_hwxmitstatus *hw = (struct bcm43xx_hwxmitstatus *)skb->data; | 843 | struct bcm43xx_hwxmitstatus *hw = (struct bcm43xx_hwxmitstatus *)skb->data; |
841 | struct bcm43xx_xmitstatus stat; | 844 | struct bcm43xx_xmitstatus stat; |
845 | int i = 0; | ||
842 | 846 | ||
843 | stat.cookie = le16_to_cpu(hw->cookie); | 847 | stat.cookie = le16_to_cpu(hw->cookie); |
848 | while (stat.cookie == 0) { | ||
849 | if (unlikely(++i >= 10000)) { | ||
850 | assert(0); | ||
851 | break; | ||
852 | } | ||
853 | udelay(2); | ||
854 | barrier(); | ||
855 | stat.cookie = le16_to_cpu(hw->cookie); | ||
856 | } | ||
844 | stat.flags = hw->flags; | 857 | stat.flags = hw->flags; |
845 | stat.cnt1 = hw->cnt1; | 858 | stat.cnt1 = hw->cnt1; |
846 | stat.cnt2 = hw->cnt2; | 859 | stat.cnt2 = hw->cnt2; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index c0502905a956..736dde96c4a3 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -3555,7 +3555,7 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev, | |||
3555 | unsigned long flags; | 3555 | unsigned long flags; |
3556 | int keyidx; | 3556 | int keyidx; |
3557 | 3557 | ||
3558 | dprintk(KERN_INFO PFX "set security called\n"); | 3558 | dprintk(KERN_INFO PFX "set security called"); |
3559 | 3559 | ||
3560 | bcm43xx_lock_mmio(bcm, flags); | 3560 | bcm43xx_lock_mmio(bcm, flags); |
3561 | 3561 | ||
@@ -3568,24 +3568,25 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev, | |||
3568 | 3568 | ||
3569 | if (sec->flags & SEC_ACTIVE_KEY) { | 3569 | if (sec->flags & SEC_ACTIVE_KEY) { |
3570 | secinfo->active_key = sec->active_key; | 3570 | secinfo->active_key = sec->active_key; |
3571 | dprintk(KERN_INFO PFX " .active_key = %d\n", sec->active_key); | 3571 | dprintk(", .active_key = %d", sec->active_key); |
3572 | } | 3572 | } |
3573 | if (sec->flags & SEC_UNICAST_GROUP) { | 3573 | if (sec->flags & SEC_UNICAST_GROUP) { |
3574 | secinfo->unicast_uses_group = sec->unicast_uses_group; | 3574 | secinfo->unicast_uses_group = sec->unicast_uses_group; |
3575 | dprintk(KERN_INFO PFX " .unicast_uses_group = %d\n", sec->unicast_uses_group); | 3575 | dprintk(", .unicast_uses_group = %d", sec->unicast_uses_group); |
3576 | } | 3576 | } |
3577 | if (sec->flags & SEC_LEVEL) { | 3577 | if (sec->flags & SEC_LEVEL) { |
3578 | secinfo->level = sec->level; | 3578 | secinfo->level = sec->level; |
3579 | dprintk(KERN_INFO PFX " .level = %d\n", sec->level); | 3579 | dprintk(", .level = %d", sec->level); |
3580 | } | 3580 | } |
3581 | if (sec->flags & SEC_ENABLED) { | 3581 | if (sec->flags & SEC_ENABLED) { |
3582 | secinfo->enabled = sec->enabled; | 3582 | secinfo->enabled = sec->enabled; |
3583 | dprintk(KERN_INFO PFX " .enabled = %d\n", sec->enabled); | 3583 | dprintk(", .enabled = %d", sec->enabled); |
3584 | } | 3584 | } |
3585 | if (sec->flags & SEC_ENCRYPT) { | 3585 | if (sec->flags & SEC_ENCRYPT) { |
3586 | secinfo->encrypt = sec->encrypt; | 3586 | secinfo->encrypt = sec->encrypt; |
3587 | dprintk(KERN_INFO PFX " .encrypt = %d\n", sec->encrypt); | 3587 | dprintk(", .encrypt = %d", sec->encrypt); |
3588 | } | 3588 | } |
3589 | dprintk("\n"); | ||
3589 | if (bcm->initialized && !bcm->ieee->host_encrypt) { | 3590 | if (bcm->initialized && !bcm->ieee->host_encrypt) { |
3590 | if (secinfo->enabled) { | 3591 | if (secinfo->enabled) { |
3591 | /* upload WEP keys to hardware */ | 3592 | /* upload WEP keys to hardware */ |
diff --git a/drivers/usb/net/zd1201.c b/drivers/net/wireless/zd1201.c index 9b1e4ed1d07e..662ecc8a33ff 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -33,7 +33,7 @@ static struct usb_device_id zd1201_table[] = { | |||
33 | {} | 33 | {} |
34 | }; | 34 | }; |
35 | 35 | ||
36 | static int ap = 0; /* Are we an AP or a normal station? */ | 36 | static int ap; /* Are we an AP or a normal station? */ |
37 | 37 | ||
38 | #define ZD1201_VERSION "0.15" | 38 | #define ZD1201_VERSION "0.15" |
39 | 39 | ||
@@ -49,7 +49,7 @@ MODULE_DEVICE_TABLE(usb, zd1201_table); | |||
49 | static int zd1201_fw_upload(struct usb_device *dev, int apfw) | 49 | static int zd1201_fw_upload(struct usb_device *dev, int apfw) |
50 | { | 50 | { |
51 | const struct firmware *fw_entry; | 51 | const struct firmware *fw_entry; |
52 | char* data; | 52 | char *data; |
53 | unsigned long len; | 53 | unsigned long len; |
54 | int err; | 54 | int err; |
55 | unsigned char ret; | 55 | unsigned char ret; |
@@ -65,7 +65,7 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw) | |||
65 | if (err) { | 65 | if (err) { |
66 | dev_err(&dev->dev, "Failed to load %s firmware file!\n", fwfile); | 66 | dev_err(&dev->dev, "Failed to load %s firmware file!\n", fwfile); |
67 | dev_err(&dev->dev, "Make sure the hotplug firmware loader is installed.\n"); | 67 | dev_err(&dev->dev, "Make sure the hotplug firmware loader is installed.\n"); |
68 | dev_err(&dev->dev, "Goto http://linux-lc100020.sourceforge.net for more info\n"); | 68 | dev_err(&dev->dev, "Goto http://linux-lc100020.sourceforge.net for more info.\n"); |
69 | return err; | 69 | return err; |
70 | } | 70 | } |
71 | 71 | ||
@@ -94,12 +94,12 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw) | |||
94 | USB_DIR_OUT | 0x40, 0, 0, NULL, 0, ZD1201_FW_TIMEOUT); | 94 | USB_DIR_OUT | 0x40, 0, 0, NULL, 0, ZD1201_FW_TIMEOUT); |
95 | if (err < 0) | 95 | if (err < 0) |
96 | goto exit; | 96 | goto exit; |
97 | 97 | ||
98 | err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4, | 98 | err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4, |
99 | USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT); | 99 | USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT); |
100 | if (err < 0) | 100 | if (err < 0) |
101 | goto exit; | 101 | goto exit; |
102 | 102 | ||
103 | if (ret & 0x80) { | 103 | if (ret & 0x80) { |
104 | err = -EIO; | 104 | err = -EIO; |
105 | goto exit; | 105 | goto exit; |
@@ -166,13 +166,13 @@ static int zd1201_docmd(struct zd1201 *zd, int cmd, int parm0, | |||
166 | return -ENOMEM; | 166 | return -ENOMEM; |
167 | } | 167 | } |
168 | usb_fill_bulk_urb(urb, zd->usb, usb_sndbulkpipe(zd->usb, zd->endp_out2), | 168 | usb_fill_bulk_urb(urb, zd->usb, usb_sndbulkpipe(zd->usb, zd->endp_out2), |
169 | command, 16, zd1201_usbfree, zd); | 169 | command, 16, zd1201_usbfree, zd); |
170 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 170 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
171 | if (ret) { | 171 | if (ret) { |
172 | kfree(command); | 172 | kfree(command); |
173 | usb_free_urb(urb); | 173 | usb_free_urb(urb); |
174 | } | 174 | } |
175 | 175 | ||
176 | return ret; | 176 | return ret; |
177 | } | 177 | } |
178 | 178 | ||
@@ -316,7 +316,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
316 | fc = le16_to_cpu(*(__le16 *)&data[datalen-16]); | 316 | fc = le16_to_cpu(*(__le16 *)&data[datalen-16]); |
317 | seq = le16_to_cpu(*(__le16 *)&data[datalen-24]); | 317 | seq = le16_to_cpu(*(__le16 *)&data[datalen-24]); |
318 | 318 | ||
319 | if(zd->monitor) { | 319 | if (zd->monitor) { |
320 | if (datalen < 24) | 320 | if (datalen < 24) |
321 | goto resubmit; | 321 | goto resubmit; |
322 | if (!(skb = dev_alloc_skb(datalen+24))) | 322 | if (!(skb = dev_alloc_skb(datalen+24))) |
@@ -364,7 +364,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
364 | goto resubmit; | 364 | goto resubmit; |
365 | } | 365 | } |
366 | hlist_for_each_entry(frag, node, &zd->fraglist, fnode) | 366 | hlist_for_each_entry(frag, node, &zd->fraglist, fnode) |
367 | if(frag->seq == (seq&IEEE80211_SCTL_SEQ)) | 367 | if (frag->seq == (seq&IEEE80211_SCTL_SEQ)) |
368 | break; | 368 | break; |
369 | if (!frag) | 369 | if (!frag) |
370 | goto resubmit; | 370 | goto resubmit; |
@@ -376,7 +376,6 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
376 | goto resubmit; | 376 | goto resubmit; |
377 | hlist_del_init(&frag->fnode); | 377 | hlist_del_init(&frag->fnode); |
378 | kfree(frag); | 378 | kfree(frag); |
379 | /* Fallthrough */ | ||
380 | } else { | 379 | } else { |
381 | if (datalen<14) | 380 | if (datalen<14) |
382 | goto resubmit; | 381 | goto resubmit; |
@@ -422,7 +421,7 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata, | |||
422 | int rid_fid; | 421 | int rid_fid; |
423 | int length; | 422 | int length; |
424 | unsigned char *pdata; | 423 | unsigned char *pdata; |
425 | 424 | ||
426 | zd->rxdatas = 0; | 425 | zd->rxdatas = 0; |
427 | err = zd1201_docmd(zd, ZD1201_CMDCODE_ACCESS, rid, 0, 0); | 426 | err = zd1201_docmd(zd, ZD1201_CMDCODE_ACCESS, rid, 0, 0); |
428 | if (err) | 427 | if (err) |
@@ -471,11 +470,11 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata, | |||
471 | length = zd->rxlen; | 470 | length = zd->rxlen; |
472 | 471 | ||
473 | do { | 472 | do { |
474 | int actual_length; | 473 | int actual_length; |
475 | 474 | ||
476 | actual_length = (length > 64) ? 64 : length; | 475 | actual_length = (length > 64) ? 64 : length; |
477 | 476 | ||
478 | if(pdata[0] != 0x3) { | 477 | if (pdata[0] != 0x3) { |
479 | dev_dbg(&zd->usb->dev, "Rx Resource packet type error: %02X\n", | 478 | dev_dbg(&zd->usb->dev, "Rx Resource packet type error: %02X\n", |
480 | pdata[0]); | 479 | pdata[0]); |
481 | return -EINVAL; | 480 | return -EINVAL; |
@@ -487,11 +486,10 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata, | |||
487 | } | 486 | } |
488 | 487 | ||
489 | /* Skip the 4 bytes header (RID length and RID) */ | 488 | /* Skip the 4 bytes header (RID length and RID) */ |
490 | if(i == 0) { | 489 | if (i == 0) { |
491 | pdata += 8; | 490 | pdata += 8; |
492 | actual_length -= 8; | 491 | actual_length -= 8; |
493 | } | 492 | } else { |
494 | else { | ||
495 | pdata += 4; | 493 | pdata += 4; |
496 | actual_length -= 4; | 494 | actual_length -= 4; |
497 | } | 495 | } |
@@ -620,7 +618,7 @@ static int zd1201_drvr_start(struct zd1201 *zd) | |||
620 | short max; | 618 | short max; |
621 | __le16 zdmax; | 619 | __le16 zdmax; |
622 | unsigned char *buffer; | 620 | unsigned char *buffer; |
623 | 621 | ||
624 | buffer = kzalloc(ZD1201_RXSIZE, GFP_KERNEL); | 622 | buffer = kzalloc(ZD1201_RXSIZE, GFP_KERNEL); |
625 | if (!buffer) | 623 | if (!buffer) |
626 | return -ENOMEM; | 624 | return -ENOMEM; |
@@ -632,7 +630,7 @@ static int zd1201_drvr_start(struct zd1201 *zd) | |||
632 | err = usb_submit_urb(zd->rx_urb, GFP_KERNEL); | 630 | err = usb_submit_urb(zd->rx_urb, GFP_KERNEL); |
633 | if (err) | 631 | if (err) |
634 | goto err_buffer; | 632 | goto err_buffer; |
635 | 633 | ||
636 | err = zd1201_docmd(zd, ZD1201_CMDCODE_INIT, 0, 0, 0); | 634 | err = zd1201_docmd(zd, ZD1201_CMDCODE_INIT, 0, 0, 0); |
637 | if (err) | 635 | if (err) |
638 | goto err_urb; | 636 | goto err_urb; |
@@ -684,7 +682,7 @@ static int zd1201_enable(struct zd1201 *zd) | |||
684 | static int zd1201_disable(struct zd1201 *zd) | 682 | static int zd1201_disable(struct zd1201 *zd) |
685 | { | 683 | { |
686 | int err; | 684 | int err; |
687 | 685 | ||
688 | if (!zd->mac_enabled) | 686 | if (!zd->mac_enabled) |
689 | return 0; | 687 | return 0; |
690 | if (zd->monitor) { | 688 | if (zd->monitor) { |
@@ -764,7 +762,6 @@ static int zd1201_net_open(struct net_device *dev) | |||
764 | static int zd1201_net_stop(struct net_device *dev) | 762 | static int zd1201_net_stop(struct net_device *dev) |
765 | { | 763 | { |
766 | netif_stop_queue(dev); | 764 | netif_stop_queue(dev); |
767 | |||
768 | return 0; | 765 | return 0; |
769 | } | 766 | } |
770 | 767 | ||
@@ -915,7 +912,6 @@ static int zd1201_get_name(struct net_device *dev, | |||
915 | struct iw_request_info *info, char *name, char *extra) | 912 | struct iw_request_info *info, char *name, char *extra) |
916 | { | 913 | { |
917 | strcpy(name, "IEEE 802.11b"); | 914 | strcpy(name, "IEEE 802.11b"); |
918 | |||
919 | return 0; | 915 | return 0; |
920 | } | 916 | } |
921 | 917 | ||
@@ -1013,11 +1009,10 @@ static int zd1201_set_mode(struct net_device *dev, | |||
1013 | if (err) | 1009 | if (err) |
1014 | return err; | 1010 | return err; |
1015 | } | 1011 | } |
1016 | zd->monitor=monitor; | 1012 | zd->monitor = monitor; |
1017 | /* If monitor mode is set we don't actually turn it on here since it | 1013 | /* If monitor mode is set we don't actually turn it on here since it |
1018 | * is done during mac reset anyway (see zd1201_mac_enable). | 1014 | * is done during mac reset anyway (see zd1201_mac_enable). |
1019 | */ | 1015 | */ |
1020 | |||
1021 | zd1201_mac_reset(zd); | 1016 | zd1201_mac_reset(zd); |
1022 | 1017 | ||
1023 | return 0; | 1018 | return 0; |
@@ -1117,7 +1112,7 @@ static int zd1201_get_wap(struct net_device *dev, | |||
1117 | zd->iwstats.qual.updated = 2; | 1112 | zd->iwstats.qual.updated = 2; |
1118 | } | 1113 | } |
1119 | 1114 | ||
1120 | return zd1201_getconfig(zd,ZD1201_RID_CURRENTBSSID,ap_addr->sa_data,6); | 1115 | return zd1201_getconfig(zd, ZD1201_RID_CURRENTBSSID, ap_addr->sa_data, 6); |
1121 | } | 1116 | } |
1122 | 1117 | ||
1123 | static int zd1201_set_scan(struct net_device *dev, | 1118 | static int zd1201_set_scan(struct net_device *dev, |
@@ -1275,7 +1270,7 @@ static int zd1201_set_rate(struct net_device *dev, | |||
1275 | if (!rrq->fixed) { /* Also enable all lower bitrates */ | 1270 | if (!rrq->fixed) { /* Also enable all lower bitrates */ |
1276 | rate |= rate-1; | 1271 | rate |= rate-1; |
1277 | } | 1272 | } |
1278 | 1273 | ||
1279 | err = zd1201_setconfig16(zd, ZD1201_RID_TXRATECNTL, rate); | 1274 | err = zd1201_setconfig16(zd, ZD1201_RID_TXRATECNTL, rate); |
1280 | if (err) | 1275 | if (err) |
1281 | return err; | 1276 | return err; |
@@ -1486,7 +1481,7 @@ static int zd1201_get_encode(struct net_device *dev, | |||
1486 | return -EINVAL; | 1481 | return -EINVAL; |
1487 | 1482 | ||
1488 | erq->flags |= i+1; | 1483 | erq->flags |= i+1; |
1489 | 1484 | ||
1490 | erq->length = zd->encode_keylen[i]; | 1485 | erq->length = zd->encode_keylen[i]; |
1491 | memcpy(key, zd->encode_keys[i], erq->length); | 1486 | memcpy(key, zd->encode_keys[i], erq->length); |
1492 | 1487 | ||
@@ -1529,11 +1524,7 @@ static int zd1201_set_power(struct net_device *dev, | |||
1529 | return -EINVAL; | 1524 | return -EINVAL; |
1530 | } | 1525 | } |
1531 | out: | 1526 | out: |
1532 | err = zd1201_setconfig16(zd, ZD1201_RID_CNFPMENABLED, enabled); | 1527 | return zd1201_setconfig16(zd, ZD1201_RID_CNFPMENABLED, enabled); |
1533 | if (err) | ||
1534 | return err; | ||
1535 | |||
1536 | return 0; | ||
1537 | } | 1528 | } |
1538 | 1529 | ||
1539 | static int zd1201_get_power(struct net_device *dev, | 1530 | static int zd1201_get_power(struct net_device *dev, |
@@ -1627,15 +1618,11 @@ static int zd1201_set_hostauth(struct net_device *dev, | |||
1627 | struct iw_request_info *info, struct iw_param *rrq, char *extra) | 1618 | struct iw_request_info *info, struct iw_param *rrq, char *extra) |
1628 | { | 1619 | { |
1629 | struct zd1201 *zd = (struct zd1201 *)dev->priv; | 1620 | struct zd1201 *zd = (struct zd1201 *)dev->priv; |
1630 | int err; | ||
1631 | 1621 | ||
1632 | if (!zd->ap) | 1622 | if (!zd->ap) |
1633 | return -EOPNOTSUPP; | 1623 | return -EOPNOTSUPP; |
1634 | 1624 | ||
1635 | err = zd1201_setconfig16(zd, ZD1201_RID_CNFHOSTAUTH, rrq->value); | 1625 | return zd1201_setconfig16(zd, ZD1201_RID_CNFHOSTAUTH, rrq->value); |
1636 | if (err) | ||
1637 | return err; | ||
1638 | return 0; | ||
1639 | } | 1626 | } |
1640 | 1627 | ||
1641 | static int zd1201_get_hostauth(struct net_device *dev, | 1628 | static int zd1201_get_hostauth(struct net_device *dev, |
@@ -1744,7 +1731,7 @@ static int zd1201_probe(struct usb_interface *interface, | |||
1744 | { | 1731 | { |
1745 | struct zd1201 *zd; | 1732 | struct zd1201 *zd; |
1746 | struct usb_device *usb; | 1733 | struct usb_device *usb; |
1747 | int i, err; | 1734 | int err; |
1748 | short porttype; | 1735 | short porttype; |
1749 | char buf[IW_ESSID_MAX_SIZE+2]; | 1736 | char buf[IW_ESSID_MAX_SIZE+2]; |
1750 | 1737 | ||
@@ -1773,9 +1760,7 @@ static int zd1201_probe(struct usb_interface *interface, | |||
1773 | if (!zd->rx_urb || !zd->tx_urb) | 1760 | if (!zd->rx_urb || !zd->tx_urb) |
1774 | goto err_zd; | 1761 | goto err_zd; |
1775 | 1762 | ||
1776 | for(i = 0; i<100; i++) | 1763 | mdelay(100); |
1777 | udelay(1000); | ||
1778 | |||
1779 | err = zd1201_drvr_start(zd); | 1764 | err = zd1201_drvr_start(zd); |
1780 | if (err) | 1765 | if (err) |
1781 | goto err_zd; | 1766 | goto err_zd; |
@@ -1833,7 +1818,7 @@ static int zd1201_probe(struct usb_interface *interface, | |||
1833 | goto err_net; | 1818 | goto err_net; |
1834 | dev_info(&usb->dev, "%s: ZD1201 USB Wireless interface\n", | 1819 | dev_info(&usb->dev, "%s: ZD1201 USB Wireless interface\n", |
1835 | zd->dev->name); | 1820 | zd->dev->name); |
1836 | 1821 | ||
1837 | usb_set_intfdata(interface, zd); | 1822 | usb_set_intfdata(interface, zd); |
1838 | return 0; | 1823 | return 0; |
1839 | 1824 | ||
diff --git a/drivers/usb/net/zd1201.h b/drivers/net/wireless/zd1201.h index 235f0ee34b24..235f0ee34b24 100644 --- a/drivers/usb/net/zd1201.h +++ b/drivers/net/wireless/zd1201.h | |||
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 48d3b3d30c21..74b3124e8247 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -1143,6 +1143,12 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) | |||
1143 | { | 1143 | { |
1144 | struct pcmcia_socket *s = pcmcia_get_socket(skt); | 1144 | struct pcmcia_socket *s = pcmcia_get_socket(skt); |
1145 | 1145 | ||
1146 | if (!s) { | ||
1147 | printk(KERN_ERR "PCMCIA obtaining reference to socket %p " \ | ||
1148 | "failed, event 0x%x lost!\n", skt, event); | ||
1149 | return -ENODEV; | ||
1150 | } | ||
1151 | |||
1146 | ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n", | 1152 | ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n", |
1147 | event, priority, skt); | 1153 | event, priority, skt); |
1148 | 1154 | ||
diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c index f6e7ee04f3dc..8c0d1a6739ad 100644 --- a/drivers/rtc/rtc-m48t86.c +++ b/drivers/rtc/rtc-m48t86.c | |||
@@ -48,33 +48,33 @@ static int m48t86_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
48 | struct platform_device *pdev = to_platform_device(dev); | 48 | struct platform_device *pdev = to_platform_device(dev); |
49 | struct m48t86_ops *ops = pdev->dev.platform_data; | 49 | struct m48t86_ops *ops = pdev->dev.platform_data; |
50 | 50 | ||
51 | reg = ops->readb(M48T86_REG_B); | 51 | reg = ops->readbyte(M48T86_REG_B); |
52 | 52 | ||
53 | if (reg & M48T86_REG_B_DM) { | 53 | if (reg & M48T86_REG_B_DM) { |
54 | /* data (binary) mode */ | 54 | /* data (binary) mode */ |
55 | tm->tm_sec = ops->readb(M48T86_REG_SEC); | 55 | tm->tm_sec = ops->readbyte(M48T86_REG_SEC); |
56 | tm->tm_min = ops->readb(M48T86_REG_MIN); | 56 | tm->tm_min = ops->readbyte(M48T86_REG_MIN); |
57 | tm->tm_hour = ops->readb(M48T86_REG_HOUR) & 0x3F; | 57 | tm->tm_hour = ops->readbyte(M48T86_REG_HOUR) & 0x3F; |
58 | tm->tm_mday = ops->readb(M48T86_REG_DOM); | 58 | tm->tm_mday = ops->readbyte(M48T86_REG_DOM); |
59 | /* tm_mon is 0-11 */ | 59 | /* tm_mon is 0-11 */ |
60 | tm->tm_mon = ops->readb(M48T86_REG_MONTH) - 1; | 60 | tm->tm_mon = ops->readbyte(M48T86_REG_MONTH) - 1; |
61 | tm->tm_year = ops->readb(M48T86_REG_YEAR) + 100; | 61 | tm->tm_year = ops->readbyte(M48T86_REG_YEAR) + 100; |
62 | tm->tm_wday = ops->readb(M48T86_REG_DOW); | 62 | tm->tm_wday = ops->readbyte(M48T86_REG_DOW); |
63 | } else { | 63 | } else { |
64 | /* bcd mode */ | 64 | /* bcd mode */ |
65 | tm->tm_sec = BCD2BIN(ops->readb(M48T86_REG_SEC)); | 65 | tm->tm_sec = BCD2BIN(ops->readbyte(M48T86_REG_SEC)); |
66 | tm->tm_min = BCD2BIN(ops->readb(M48T86_REG_MIN)); | 66 | tm->tm_min = BCD2BIN(ops->readbyte(M48T86_REG_MIN)); |
67 | tm->tm_hour = BCD2BIN(ops->readb(M48T86_REG_HOUR) & 0x3F); | 67 | tm->tm_hour = BCD2BIN(ops->readbyte(M48T86_REG_HOUR) & 0x3F); |
68 | tm->tm_mday = BCD2BIN(ops->readb(M48T86_REG_DOM)); | 68 | tm->tm_mday = BCD2BIN(ops->readbyte(M48T86_REG_DOM)); |
69 | /* tm_mon is 0-11 */ | 69 | /* tm_mon is 0-11 */ |
70 | tm->tm_mon = BCD2BIN(ops->readb(M48T86_REG_MONTH)) - 1; | 70 | tm->tm_mon = BCD2BIN(ops->readbyte(M48T86_REG_MONTH)) - 1; |
71 | tm->tm_year = BCD2BIN(ops->readb(M48T86_REG_YEAR)) + 100; | 71 | tm->tm_year = BCD2BIN(ops->readbyte(M48T86_REG_YEAR)) + 100; |
72 | tm->tm_wday = BCD2BIN(ops->readb(M48T86_REG_DOW)); | 72 | tm->tm_wday = BCD2BIN(ops->readbyte(M48T86_REG_DOW)); |
73 | } | 73 | } |
74 | 74 | ||
75 | /* correct the hour if the clock is in 12h mode */ | 75 | /* correct the hour if the clock is in 12h mode */ |
76 | if (!(reg & M48T86_REG_B_H24)) | 76 | if (!(reg & M48T86_REG_B_H24)) |
77 | if (ops->readb(M48T86_REG_HOUR) & 0x80) | 77 | if (ops->readbyte(M48T86_REG_HOUR) & 0x80) |
78 | tm->tm_hour += 12; | 78 | tm->tm_hour += 12; |
79 | 79 | ||
80 | return 0; | 80 | return 0; |
@@ -86,35 +86,35 @@ static int m48t86_rtc_set_time(struct device *dev, struct rtc_time *tm) | |||
86 | struct platform_device *pdev = to_platform_device(dev); | 86 | struct platform_device *pdev = to_platform_device(dev); |
87 | struct m48t86_ops *ops = pdev->dev.platform_data; | 87 | struct m48t86_ops *ops = pdev->dev.platform_data; |
88 | 88 | ||
89 | reg = ops->readb(M48T86_REG_B); | 89 | reg = ops->readbyte(M48T86_REG_B); |
90 | 90 | ||
91 | /* update flag and 24h mode */ | 91 | /* update flag and 24h mode */ |
92 | reg |= M48T86_REG_B_SET | M48T86_REG_B_H24; | 92 | reg |= M48T86_REG_B_SET | M48T86_REG_B_H24; |
93 | ops->writeb(reg, M48T86_REG_B); | 93 | ops->writebyte(reg, M48T86_REG_B); |
94 | 94 | ||
95 | if (reg & M48T86_REG_B_DM) { | 95 | if (reg & M48T86_REG_B_DM) { |
96 | /* data (binary) mode */ | 96 | /* data (binary) mode */ |
97 | ops->writeb(tm->tm_sec, M48T86_REG_SEC); | 97 | ops->writebyte(tm->tm_sec, M48T86_REG_SEC); |
98 | ops->writeb(tm->tm_min, M48T86_REG_MIN); | 98 | ops->writebyte(tm->tm_min, M48T86_REG_MIN); |
99 | ops->writeb(tm->tm_hour, M48T86_REG_HOUR); | 99 | ops->writebyte(tm->tm_hour, M48T86_REG_HOUR); |
100 | ops->writeb(tm->tm_mday, M48T86_REG_DOM); | 100 | ops->writebyte(tm->tm_mday, M48T86_REG_DOM); |
101 | ops->writeb(tm->tm_mon + 1, M48T86_REG_MONTH); | 101 | ops->writebyte(tm->tm_mon + 1, M48T86_REG_MONTH); |
102 | ops->writeb(tm->tm_year % 100, M48T86_REG_YEAR); | 102 | ops->writebyte(tm->tm_year % 100, M48T86_REG_YEAR); |
103 | ops->writeb(tm->tm_wday, M48T86_REG_DOW); | 103 | ops->writebyte(tm->tm_wday, M48T86_REG_DOW); |
104 | } else { | 104 | } else { |
105 | /* bcd mode */ | 105 | /* bcd mode */ |
106 | ops->writeb(BIN2BCD(tm->tm_sec), M48T86_REG_SEC); | 106 | ops->writebyte(BIN2BCD(tm->tm_sec), M48T86_REG_SEC); |
107 | ops->writeb(BIN2BCD(tm->tm_min), M48T86_REG_MIN); | 107 | ops->writebyte(BIN2BCD(tm->tm_min), M48T86_REG_MIN); |
108 | ops->writeb(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR); | 108 | ops->writebyte(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR); |
109 | ops->writeb(BIN2BCD(tm->tm_mday), M48T86_REG_DOM); | 109 | ops->writebyte(BIN2BCD(tm->tm_mday), M48T86_REG_DOM); |
110 | ops->writeb(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH); | 110 | ops->writebyte(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH); |
111 | ops->writeb(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR); | 111 | ops->writebyte(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR); |
112 | ops->writeb(BIN2BCD(tm->tm_wday), M48T86_REG_DOW); | 112 | ops->writebyte(BIN2BCD(tm->tm_wday), M48T86_REG_DOW); |
113 | } | 113 | } |
114 | 114 | ||
115 | /* update ended */ | 115 | /* update ended */ |
116 | reg &= ~M48T86_REG_B_SET; | 116 | reg &= ~M48T86_REG_B_SET; |
117 | ops->writeb(reg, M48T86_REG_B); | 117 | ops->writebyte(reg, M48T86_REG_B); |
118 | 118 | ||
119 | return 0; | 119 | return 0; |
120 | } | 120 | } |
@@ -125,12 +125,12 @@ static int m48t86_rtc_proc(struct device *dev, struct seq_file *seq) | |||
125 | struct platform_device *pdev = to_platform_device(dev); | 125 | struct platform_device *pdev = to_platform_device(dev); |
126 | struct m48t86_ops *ops = pdev->dev.platform_data; | 126 | struct m48t86_ops *ops = pdev->dev.platform_data; |
127 | 127 | ||
128 | reg = ops->readb(M48T86_REG_B); | 128 | reg = ops->readbyte(M48T86_REG_B); |
129 | 129 | ||
130 | seq_printf(seq, "mode\t\t: %s\n", | 130 | seq_printf(seq, "mode\t\t: %s\n", |
131 | (reg & M48T86_REG_B_DM) ? "binary" : "bcd"); | 131 | (reg & M48T86_REG_B_DM) ? "binary" : "bcd"); |
132 | 132 | ||
133 | reg = ops->readb(M48T86_REG_D); | 133 | reg = ops->readbyte(M48T86_REG_D); |
134 | 134 | ||
135 | seq_printf(seq, "battery\t\t: %s\n", | 135 | seq_printf(seq, "battery\t\t: %s\n", |
136 | (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); | 136 | (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); |
@@ -157,7 +157,7 @@ static int __devinit m48t86_rtc_probe(struct platform_device *dev) | |||
157 | platform_set_drvdata(dev, rtc); | 157 | platform_set_drvdata(dev, rtc); |
158 | 158 | ||
159 | /* read battery status */ | 159 | /* read battery status */ |
160 | reg = ops->readb(M48T86_REG_D); | 160 | reg = ops->readbyte(M48T86_REG_D); |
161 | dev_info(&dev->dev, "battery %s\n", | 161 | dev_info(&dev->dev, "battery %s\n", |
162 | (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); | 162 | (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); |
163 | 163 | ||
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index 74a257b23383..e210f89a2449 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h | |||
@@ -45,11 +45,11 @@ struct pgid { | |||
45 | union { | 45 | union { |
46 | __u8 fc; /* SPID function code */ | 46 | __u8 fc; /* SPID function code */ |
47 | struct path_state ps; /* SNID path state */ | 47 | struct path_state ps; /* SNID path state */ |
48 | } inf; | 48 | } __attribute__ ((packed)) inf; |
49 | union { | 49 | union { |
50 | __u32 cpu_addr : 16; /* CPU address */ | 50 | __u32 cpu_addr : 16; /* CPU address */ |
51 | struct extended_cssid ext_cssid; | 51 | struct extended_cssid ext_cssid; |
52 | } pgid_high; | 52 | } __attribute__ ((packed)) pgid_high; |
53 | __u32 cpu_id : 24; /* CPU identification */ | 53 | __u32 cpu_id : 24; /* CPU identification */ |
54 | __u32 cpu_model : 16; /* CPU model */ | 54 | __u32 cpu_model : 16; /* CPU model */ |
55 | __u32 tod_high; /* high word TOD clock */ | 55 | __u32 tod_high; /* high word TOD clock */ |
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 180b3bf8b90d..49ec562d7f60 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -749,7 +749,7 @@ ccw_device_irq(struct ccw_device *cdev, enum dev_event dev_event) | |||
749 | /* Unit check but no sense data. Need basic sense. */ | 749 | /* Unit check but no sense data. Need basic sense. */ |
750 | if (ccw_device_do_sense(cdev, irb) != 0) | 750 | if (ccw_device_do_sense(cdev, irb) != 0) |
751 | goto call_handler_unsol; | 751 | goto call_handler_unsol; |
752 | memcpy(irb, &cdev->private->irb, sizeof(struct irb)); | 752 | memcpy(&cdev->private->irb, irb, sizeof(struct irb)); |
753 | cdev->private->state = DEV_STATE_W4SENSE; | 753 | cdev->private->state = DEV_STATE_W4SENSE; |
754 | cdev->private->intparm = 0; | 754 | cdev->private->intparm = 0; |
755 | return; | 755 | return; |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index fa476e7e0a48..b046ffa22101 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -4297,6 +4297,7 @@ static int ata_start_drive(struct ata_port *ap, struct ata_device *dev) | |||
4297 | int ata_device_resume(struct ata_port *ap, struct ata_device *dev) | 4297 | int ata_device_resume(struct ata_port *ap, struct ata_device *dev) |
4298 | { | 4298 | { |
4299 | if (ap->flags & ATA_FLAG_SUSPENDED) { | 4299 | if (ap->flags & ATA_FLAG_SUSPENDED) { |
4300 | ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000); | ||
4300 | ap->flags &= ~ATA_FLAG_SUSPENDED; | 4301 | ap->flags &= ~ATA_FLAG_SUSPENDED; |
4301 | ata_set_mode(ap); | 4302 | ata_set_mode(ap); |
4302 | } | 4303 | } |
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index fee843fab1c7..108910f512e4 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c | |||
@@ -982,6 +982,12 @@ static int device_check(ppa_struct *dev) | |||
982 | return -ENODEV; | 982 | return -ENODEV; |
983 | } | 983 | } |
984 | 984 | ||
985 | static int ppa_adjust_queue(struct scsi_device *device) | ||
986 | { | ||
987 | blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH); | ||
988 | return 0; | ||
989 | } | ||
990 | |||
985 | static struct scsi_host_template ppa_template = { | 991 | static struct scsi_host_template ppa_template = { |
986 | .module = THIS_MODULE, | 992 | .module = THIS_MODULE, |
987 | .proc_name = "ppa", | 993 | .proc_name = "ppa", |
@@ -997,6 +1003,7 @@ static struct scsi_host_template ppa_template = { | |||
997 | .cmd_per_lun = 1, | 1003 | .cmd_per_lun = 1, |
998 | .use_clustering = ENABLE_CLUSTERING, | 1004 | .use_clustering = ENABLE_CLUSTERING, |
999 | .can_queue = 1, | 1005 | .can_queue = 1, |
1006 | .slave_alloc = ppa_adjust_queue, | ||
1000 | }; | 1007 | }; |
1001 | 1008 | ||
1002 | /*************************************************************************** | 1009 | /*************************************************************************** |
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index f7264fd611c2..cb9082fd7e2f 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
@@ -454,7 +454,7 @@ static int sil24_softreset(struct ata_port *ap, int verbose, | |||
454 | */ | 454 | */ |
455 | msleep(10); | 455 | msleep(10); |
456 | 456 | ||
457 | prb->ctrl = PRB_CTRL_SRST; | 457 | prb->ctrl = cpu_to_le16(PRB_CTRL_SRST); |
458 | prb->fis[1] = 0; /* no PM yet */ | 458 | prb->fis[1] = 0; /* no PM yet */ |
459 | 459 | ||
460 | writel((u32)paddr, port + PORT_CMD_ACTIVATE); | 460 | writel((u32)paddr, port + PORT_CMD_ACTIVATE); |
@@ -551,9 +551,9 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) | |||
551 | 551 | ||
552 | if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { | 552 | if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { |
553 | if (qc->tf.flags & ATA_TFLAG_WRITE) | 553 | if (qc->tf.flags & ATA_TFLAG_WRITE) |
554 | prb->ctrl = PRB_CTRL_PACKET_WRITE; | 554 | prb->ctrl = cpu_to_le16(PRB_CTRL_PACKET_WRITE); |
555 | else | 555 | else |
556 | prb->ctrl = PRB_CTRL_PACKET_READ; | 556 | prb->ctrl = cpu_to_le16(PRB_CTRL_PACKET_READ); |
557 | } else | 557 | } else |
558 | prb->ctrl = 0; | 558 | prb->ctrl = 0; |
559 | 559 | ||
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index 941c1e15c899..62f8cb7b3d2b 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c | |||
@@ -165,6 +165,7 @@ static struct { | |||
165 | {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD}, | 165 | {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD}, |
166 | {"HP", "C1557A", NULL, BLIST_FORCELUN}, | 166 | {"HP", "C1557A", NULL, BLIST_FORCELUN}, |
167 | {"HP", "C3323-300", "4269", BLIST_NOTQ}, | 167 | {"HP", "C3323-300", "4269", BLIST_NOTQ}, |
168 | {"HP", "C5713A", NULL, BLIST_NOREPORTLUN}, | ||
168 | {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN}, | 169 | {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN}, |
169 | {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, | 170 | {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, |
170 | {"IBM", "2105", NULL, BLIST_RETRY_HWERROR}, | 171 | {"IBM", "2105", NULL, BLIST_RETRY_HWERROR}, |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 764a8b375ead..faee4757c03a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -367,7 +367,7 @@ static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl, | |||
367 | int nsegs, unsigned bufflen, gfp_t gfp) | 367 | int nsegs, unsigned bufflen, gfp_t gfp) |
368 | { | 368 | { |
369 | struct request_queue *q = rq->q; | 369 | struct request_queue *q = rq->q; |
370 | int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT; | 370 | int nr_pages = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> PAGE_SHIFT; |
371 | unsigned int data_len = 0, len, bytes, off; | 371 | unsigned int data_len = 0, len, bytes, off; |
372 | struct page *page; | 372 | struct page *page; |
373 | struct bio *bio = NULL; | 373 | struct bio *bio = NULL; |
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8b6d65e21bae..f3b16066387c 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c | |||
@@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel, | |||
955 | list_for_each_entry(rphy, &sas_host->rphy_list, list) { | 955 | list_for_each_entry(rphy, &sas_host->rphy_list, list) { |
956 | struct sas_phy *parent = dev_to_phy(rphy->dev.parent); | 956 | struct sas_phy *parent = dev_to_phy(rphy->dev.parent); |
957 | 957 | ||
958 | if (rphy->scsi_target_id == -1) | 958 | if (rphy->identify.device_type != SAS_END_DEVICE || |
959 | rphy->scsi_target_id == -1) | ||
959 | continue; | 960 | continue; |
960 | 961 | ||
961 | if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && | 962 | if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && |
@@ -977,7 +978,6 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel, | |||
977 | #define SETUP_TEMPLATE(attrb, field, perm, test) \ | 978 | #define SETUP_TEMPLATE(attrb, field, perm, test) \ |
978 | i->private_##attrb[count] = class_device_attr_##field; \ | 979 | i->private_##attrb[count] = class_device_attr_##field; \ |
979 | i->private_##attrb[count].attr.mode = perm; \ | 980 | i->private_##attrb[count].attr.mode = perm; \ |
980 | i->private_##attrb[count].store = NULL; \ | ||
981 | i->attrb[count] = &i->private_##attrb[count]; \ | 981 | i->attrb[count] = &i->private_##attrb[count]; \ |
982 | if (test) \ | 982 | if (test) \ |
983 | count++ | 983 | count++ |
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 969f94900431..5cba59ad7dc5 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -1164,14 +1164,16 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1164 | struct fs_uart_platform_info *pdata; | 1164 | struct fs_uart_platform_info *pdata; |
1165 | struct platform_device* pdev = early_uart_get_pdev(co->index); | 1165 | struct platform_device* pdev = early_uart_get_pdev(co->index); |
1166 | 1166 | ||
1167 | port = | ||
1168 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; | ||
1169 | pinfo = (struct uart_cpm_port *)port; | ||
1170 | if (!pdev) { | 1167 | if (!pdev) { |
1171 | pr_info("cpm_uart: console: compat mode\n"); | 1168 | pr_info("cpm_uart: console: compat mode\n"); |
1172 | /* compatibility - will be cleaned up */ | 1169 | /* compatibility - will be cleaned up */ |
1173 | cpm_uart_init_portdesc(); | 1170 | cpm_uart_init_portdesc(); |
1171 | } | ||
1174 | 1172 | ||
1173 | port = | ||
1174 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; | ||
1175 | pinfo = (struct uart_cpm_port *)port; | ||
1176 | if (!pdev) { | ||
1175 | if (pinfo->set_lineif) | 1177 | if (pinfo->set_lineif) |
1176 | pinfo->set_lineif(pinfo); | 1178 | pinfo->set_lineif(pinfo); |
1177 | } else { | 1179 | } else { |
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index 4b2de08f46d0..cdba128250a9 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c | |||
@@ -213,7 +213,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) | |||
213 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); | 213 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); |
214 | if (is_con) { | 214 | if (is_con) { |
215 | mem_addr = alloc_bootmem(memsz); | 215 | mem_addr = alloc_bootmem(memsz); |
216 | dma_addr = mem_addr; | 216 | dma_addr = virt_to_bus(mem_addr); |
217 | } | 217 | } |
218 | else | 218 | else |
219 | mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, | 219 | mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, |
diff --git a/drivers/usb/net/Kconfig b/drivers/usb/net/Kconfig index efd6ca7e4ac5..054059632a21 100644 --- a/drivers/usb/net/Kconfig +++ b/drivers/usb/net/Kconfig | |||
@@ -301,21 +301,4 @@ config USB_NET_ZAURUS | |||
301 | some cases CDC MDLM) protocol, not "g_ether". | 301 | some cases CDC MDLM) protocol, not "g_ether". |
302 | 302 | ||
303 | 303 | ||
304 | config USB_ZD1201 | ||
305 | tristate "USB ZD1201 based Wireless device support" | ||
306 | depends on NET_RADIO | ||
307 | select FW_LOADER | ||
308 | ---help--- | ||
309 | Say Y if you want to use wireless LAN adapters based on the ZyDAS | ||
310 | ZD1201 chip. | ||
311 | |||
312 | This driver makes the adapter appear as a normal Ethernet interface, | ||
313 | typically on wlan0. | ||
314 | |||
315 | The zd1201 device requires external firmware to be loaded. | ||
316 | This can be found at http://linux-lc100020.sourceforge.net/ | ||
317 | |||
318 | To compile this driver as a module, choose M here: the | ||
319 | module will be called zd1201. | ||
320 | |||
321 | endmenu | 304 | endmenu |
diff --git a/drivers/usb/net/Makefile b/drivers/usb/net/Makefile index a21e6eaabaf6..160f19dbdf12 100644 --- a/drivers/usb/net/Makefile +++ b/drivers/usb/net/Makefile | |||
@@ -15,7 +15,6 @@ obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o | |||
15 | obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o | 15 | obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o |
16 | obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o | 16 | obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o |
17 | obj-$(CONFIG_USB_USBNET) += usbnet.o | 17 | obj-$(CONFIG_USB_USBNET) += usbnet.o |
18 | obj-$(CONFIG_USB_ZD1201) += zd1201.o | ||
19 | 18 | ||
20 | ifeq ($(CONFIG_USB_DEBUG),y) | 19 | ifeq ($(CONFIG_USB_DEBUG),y) |
21 | EXTRA_CFLAGS += -DDEBUG | 20 | EXTRA_CFLAGS += -DDEBUG |
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 3d04b2def0f1..789450bb0bc9 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -214,10 +214,13 @@ int au1100fb_setmode(struct au1100fb_device *fbdev) | |||
214 | */ | 214 | */ |
215 | int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi) | 215 | int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi) |
216 | { | 216 | { |
217 | struct au1100fb_device *fbdev = to_au1100fb_device(fbi); | 217 | struct au1100fb_device *fbdev; |
218 | u32 *palette = fbdev->regs->lcd_pallettebase; | 218 | u32 *palette; |
219 | u32 value; | 219 | u32 value; |
220 | 220 | ||
221 | fbdev = to_au1100fb_device(fbi); | ||
222 | palette = fbdev->regs->lcd_pallettebase; | ||
223 | |||
221 | if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1)) | 224 | if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1)) |
222 | return -EINVAL; | 225 | return -EINVAL; |
223 | 226 | ||
@@ -316,9 +319,11 @@ int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) | |||
316 | */ | 319 | */ |
317 | int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi) | 320 | int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi) |
318 | { | 321 | { |
319 | struct au1100fb_device *fbdev = to_au1100fb_device(fbi); | 322 | struct au1100fb_device *fbdev; |
320 | int dy; | 323 | int dy; |
321 | 324 | ||
325 | fbdev = to_au1100fb_device(fbi); | ||
326 | |||
322 | print_dbg("fb_pan_display %p %p", var, fbi); | 327 | print_dbg("fb_pan_display %p %p", var, fbi); |
323 | 328 | ||
324 | if (!var || !fbdev) { | 329 | if (!var || !fbdev) { |
@@ -382,10 +387,12 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle) | |||
382 | */ | 387 | */ |
383 | int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) | 388 | int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) |
384 | { | 389 | { |
385 | struct au1100fb_device *fbdev = to_au1100fb_device(fbi); | 390 | struct au1100fb_device *fbdev; |
386 | unsigned int len; | 391 | unsigned int len; |
387 | unsigned long start=0, off; | 392 | unsigned long start=0, off; |
388 | 393 | ||
394 | fbdev = to_au1100fb_device(fbi); | ||
395 | |||
389 | if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { | 396 | if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { |
390 | return -EINVAL; | 397 | return -EINVAL; |
391 | } | 398 | } |
@@ -467,7 +474,7 @@ int au1100fb_drv_probe(struct device *dev) | |||
467 | 474 | ||
468 | if (!request_mem_region(au1100fb_fix.mmio_start, au1100fb_fix.mmio_len, | 475 | if (!request_mem_region(au1100fb_fix.mmio_start, au1100fb_fix.mmio_len, |
469 | DRIVER_NAME)) { | 476 | DRIVER_NAME)) { |
470 | print_err("fail to lock memory region at 0x%08x", | 477 | print_err("fail to lock memory region at 0x%08lx", |
471 | au1100fb_fix.mmio_start); | 478 | au1100fb_fix.mmio_start); |
472 | return -EBUSY; | 479 | return -EBUSY; |
473 | } | 480 | } |
@@ -595,13 +602,13 @@ int au1100fb_drv_remove(struct device *dev) | |||
595 | return 0; | 602 | return 0; |
596 | } | 603 | } |
597 | 604 | ||
598 | int au1100fb_drv_suspend(struct device *dev, u32 state, u32 level) | 605 | int au1100fb_drv_suspend(struct device *dev, pm_message_t state) |
599 | { | 606 | { |
600 | /* TODO */ | 607 | /* TODO */ |
601 | return 0; | 608 | return 0; |
602 | } | 609 | } |
603 | 610 | ||
604 | int au1100fb_drv_resume(struct device *dev, u32 level) | 611 | int au1100fb_drv_resume(struct device *dev) |
605 | { | 612 | { |
606 | /* TODO */ | 613 | /* TODO */ |
607 | return 0; | 614 | return 0; |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index ca020719d20b..953eb8c171d6 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -2631,7 +2631,7 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines) | |||
2631 | scr_memcpyw((u16 *) q, (u16 *) p, | 2631 | scr_memcpyw((u16 *) q, (u16 *) p, |
2632 | vc->vc_size_row); | 2632 | vc->vc_size_row); |
2633 | } | 2633 | } |
2634 | softback_in = p; | 2634 | softback_in = softback_curr = p; |
2635 | update_region(vc, vc->vc_origin, | 2635 | update_region(vc, vc->vc_origin, |
2636 | logo_lines * vc->vc_cols); | 2636 | logo_lines * vc->vc_cols); |
2637 | } | 2637 | } |
diff --git a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c index 743e7ad26acc..f85421bf7cb5 100644 --- a/drivers/video/maxinefb.c +++ b/drivers/video/maxinefb.c | |||
@@ -55,7 +55,7 @@ static struct fb_var_screeninfo maxinefb_defined = { | |||
55 | }; | 55 | }; |
56 | 56 | ||
57 | static struct fb_fix_screeninfo maxinefb_fix = { | 57 | static struct fb_fix_screeninfo maxinefb_fix = { |
58 | .id = "Maxine onboard graphics 1024x768x8", | 58 | .id = "Maxine", |
59 | .smem_len = (1024*768), | 59 | .smem_len = (1024*768), |
60 | .type = FB_TYPE_PACKED_PIXELS, | 60 | .type = FB_TYPE_PACKED_PIXELS, |
61 | .visual = FB_VISUAL_PSEUDOCOLOR, | 61 | .visual = FB_VISUAL_PSEUDOCOLOR, |
@@ -107,8 +107,6 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
107 | 107 | ||
108 | static struct fb_ops maxinefb_ops = { | 108 | static struct fb_ops maxinefb_ops = { |
109 | .owner = THIS_MODULE, | 109 | .owner = THIS_MODULE, |
110 | .fb_get_fix = gen_get_fix, | ||
111 | .fb_get_var = gen_get_var, | ||
112 | .fb_setcolreg = maxinefb_setcolreg, | 110 | .fb_setcolreg = maxinefb_setcolreg, |
113 | .fb_fillrect = cfb_fillrect, | 111 | .fb_fillrect = cfb_fillrect, |
114 | .fb_copyarea = cfb_copyarea, | 112 | .fb_copyarea = cfb_copyarea, |
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 1a27ecb46c9a..7271bb0257f6 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -1,3 +1,10 @@ | |||
1 | Version 1.43 | ||
2 | ------------ | ||
3 | POSIX locking to servers which support CIFS POSIX Extensions | ||
4 | (disabled by default controlled by proc/fs/cifs/Experimental). | ||
5 | Handle conversion of long share names (especially Asian languages) | ||
6 | to Unicode during mount. | ||
7 | |||
1 | Version 1.42 | 8 | Version 1.42 |
2 | ------------ | 9 | ------------ |
3 | Fix slow oplock break when mounted to different servers at the same time and | 10 | Fix slow oplock break when mounted to different servers at the same time and |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 4e829dc672a6..c98755dca868 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -99,5 +99,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t); | |||
99 | extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); | 99 | extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); |
100 | extern int cifs_ioctl (struct inode * inode, struct file * filep, | 100 | extern int cifs_ioctl (struct inode * inode, struct file * filep, |
101 | unsigned int command, unsigned long arg); | 101 | unsigned int command, unsigned long arg); |
102 | #define CIFS_VERSION "1.42" | 102 | #define CIFS_VERSION "1.43" |
103 | #endif /* _CIFSFS_H */ | 103 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 2879ba343ca7..310ea2f0e0bf 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -267,7 +267,7 @@ extern int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, | |||
267 | const int waitFlag); | 267 | const int waitFlag); |
268 | extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | 268 | extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, |
269 | const __u16 smb_file_id, const int get_flag, | 269 | const __u16 smb_file_id, const int get_flag, |
270 | const __u64 len, const __u64 offset, | 270 | const __u64 len, struct file_lock *, |
271 | const __u16 lock_type, const int waitFlag); | 271 | const __u16 lock_type, const int waitFlag); |
272 | extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon); | 272 | extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon); |
273 | extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses); | 273 | extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses); |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index fd36892eda55..925881e00ff2 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1355,7 +1355,8 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, | |||
1355 | int | 1355 | int |
1356 | CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | 1356 | CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, |
1357 | const __u16 smb_file_id, const int get_flag, const __u64 len, | 1357 | const __u16 smb_file_id, const int get_flag, const __u64 len, |
1358 | const __u64 lkoffset, const __u16 lock_type, const int waitFlag) | 1358 | struct file_lock *pLockData, const __u16 lock_type, |
1359 | const int waitFlag) | ||
1359 | { | 1360 | { |
1360 | struct smb_com_transaction2_sfi_req *pSMB = NULL; | 1361 | struct smb_com_transaction2_sfi_req *pSMB = NULL; |
1361 | struct smb_com_transaction2_sfi_rsp *pSMBr = NULL; | 1362 | struct smb_com_transaction2_sfi_rsp *pSMBr = NULL; |
@@ -1366,6 +1367,10 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1366 | __u16 params, param_offset, offset, byte_count, count; | 1367 | __u16 params, param_offset, offset, byte_count, count; |
1367 | 1368 | ||
1368 | cFYI(1, ("Posix Lock")); | 1369 | cFYI(1, ("Posix Lock")); |
1370 | |||
1371 | if(pLockData == NULL) | ||
1372 | return EINVAL; | ||
1373 | |||
1369 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); | 1374 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); |
1370 | 1375 | ||
1371 | if (rc) | 1376 | if (rc) |
@@ -1404,10 +1409,10 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1404 | 1409 | ||
1405 | parm_data->lock_type = cpu_to_le16(lock_type); | 1410 | parm_data->lock_type = cpu_to_le16(lock_type); |
1406 | if(waitFlag) | 1411 | if(waitFlag) |
1407 | parm_data->lock_flags = 1; | 1412 | parm_data->lock_flags = cpu_to_le16(1); |
1408 | parm_data->pid = cpu_to_le32(current->tgid); | 1413 | parm_data->pid = cpu_to_le32(current->tgid); |
1409 | parm_data->start = lkoffset; | 1414 | parm_data->start = cpu_to_le64(pLockData->fl_start); |
1410 | parm_data->length = len; /* normalize negative numbers */ | 1415 | parm_data->length = cpu_to_le64(len); /* normalize negative numbers */ |
1411 | 1416 | ||
1412 | pSMB->DataOffset = cpu_to_le16(offset); | 1417 | pSMB->DataOffset = cpu_to_le16(offset); |
1413 | pSMB->Fid = smb_file_id; | 1418 | pSMB->Fid = smb_file_id; |
@@ -1419,8 +1424,33 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1419 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1424 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1420 | if (rc) { | 1425 | if (rc) { |
1421 | cFYI(1, ("Send error in Posix Lock = %d", rc)); | 1426 | cFYI(1, ("Send error in Posix Lock = %d", rc)); |
1422 | } | 1427 | } else if (get_flag) { |
1428 | /* lock structure can be returned on get */ | ||
1429 | __u16 data_offset; | ||
1430 | __u16 data_count; | ||
1431 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | ||
1423 | 1432 | ||
1433 | if (rc || (pSMBr->ByteCount < sizeof(struct cifs_posix_lock))) { | ||
1434 | rc = -EIO; /* bad smb */ | ||
1435 | goto plk_err_exit; | ||
1436 | } | ||
1437 | if(pLockData == NULL) { | ||
1438 | rc = -EINVAL; | ||
1439 | goto plk_err_exit; | ||
1440 | } | ||
1441 | data_offset = le16_to_cpu(pSMBr->t2.DataOffset); | ||
1442 | data_count = le16_to_cpu(pSMBr->t2.DataCount); | ||
1443 | if(data_count < sizeof(struct cifs_posix_lock)) { | ||
1444 | rc = -EIO; | ||
1445 | goto plk_err_exit; | ||
1446 | } | ||
1447 | parm_data = (struct cifs_posix_lock *) | ||
1448 | ((char *)&pSMBr->hdr.Protocol + data_offset); | ||
1449 | if(parm_data->lock_type == cpu_to_le16(CIFS_UNLCK)) | ||
1450 | pLockData->fl_type = F_UNLCK; | ||
1451 | } | ||
1452 | |||
1453 | plk_err_exit: | ||
1424 | if (pSMB) | 1454 | if (pSMB) |
1425 | cifs_small_buf_release(pSMB); | 1455 | cifs_small_buf_release(pSMB); |
1426 | 1456 | ||
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d2ec806a4f32..bae1479318d1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -2148,6 +2148,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2148 | /* We look for obvious messed up bcc or strings in response so we do not go off | 2148 | /* We look for obvious messed up bcc or strings in response so we do not go off |
2149 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 2149 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
2150 | terminating last Unicode string in response */ | 2150 | terminating last Unicode string in response */ |
2151 | if(ses->serverOS) | ||
2152 | kfree(ses->serverOS); | ||
2151 | ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); | 2153 | ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); |
2152 | if(ses->serverOS == NULL) | 2154 | if(ses->serverOS == NULL) |
2153 | goto sesssetup_nomem; | 2155 | goto sesssetup_nomem; |
@@ -2160,6 +2162,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2160 | if (remaining_words > 0) { | 2162 | if (remaining_words > 0) { |
2161 | len = UniStrnlen((wchar_t *)bcc_ptr, | 2163 | len = UniStrnlen((wchar_t *)bcc_ptr, |
2162 | remaining_words-1); | 2164 | remaining_words-1); |
2165 | if(ses->serverNOS) | ||
2166 | kfree(ses->serverNOS); | ||
2163 | ses->serverNOS = kzalloc(2 * (len + 1),GFP_KERNEL); | 2167 | ses->serverNOS = kzalloc(2 * (len + 1),GFP_KERNEL); |
2164 | if(ses->serverNOS == NULL) | 2168 | if(ses->serverNOS == NULL) |
2165 | goto sesssetup_nomem; | 2169 | goto sesssetup_nomem; |
@@ -2177,6 +2181,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2177 | if (remaining_words > 0) { | 2181 | if (remaining_words > 0) { |
2178 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 2182 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
2179 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ | 2183 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ |
2184 | if(ses->serverDomain) | ||
2185 | kfree(ses->serverDomain); | ||
2180 | ses->serverDomain = | 2186 | ses->serverDomain = |
2181 | kzalloc(2*(len+1),GFP_KERNEL); | 2187 | kzalloc(2*(len+1),GFP_KERNEL); |
2182 | if(ses->serverDomain == NULL) | 2188 | if(ses->serverDomain == NULL) |
@@ -2187,15 +2193,22 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2187 | ses->serverDomain[2*len] = 0; | 2193 | ses->serverDomain[2*len] = 0; |
2188 | ses->serverDomain[1+(2*len)] = 0; | 2194 | ses->serverDomain[1+(2*len)] = 0; |
2189 | } /* else no more room so create dummy domain string */ | 2195 | } /* else no more room so create dummy domain string */ |
2190 | else | 2196 | else { |
2197 | if(ses->serverDomain) | ||
2198 | kfree(ses->serverDomain); | ||
2191 | ses->serverDomain = | 2199 | ses->serverDomain = |
2192 | kzalloc(2, GFP_KERNEL); | 2200 | kzalloc(2, GFP_KERNEL); |
2201 | } | ||
2193 | } else { /* no room so create dummy domain and NOS string */ | 2202 | } else { /* no room so create dummy domain and NOS string */ |
2194 | /* if these kcallocs fail not much we | 2203 | /* if these kcallocs fail not much we |
2195 | can do, but better to not fail the | 2204 | can do, but better to not fail the |
2196 | sesssetup itself */ | 2205 | sesssetup itself */ |
2206 | if(ses->serverDomain) | ||
2207 | kfree(ses->serverDomain); | ||
2197 | ses->serverDomain = | 2208 | ses->serverDomain = |
2198 | kzalloc(2, GFP_KERNEL); | 2209 | kzalloc(2, GFP_KERNEL); |
2210 | if(ses->serverNOS) | ||
2211 | kfree(ses->serverNOS); | ||
2199 | ses->serverNOS = | 2212 | ses->serverNOS = |
2200 | kzalloc(2, GFP_KERNEL); | 2213 | kzalloc(2, GFP_KERNEL); |
2201 | } | 2214 | } |
@@ -2204,6 +2217,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2204 | if (((long) bcc_ptr + len) - (long) | 2217 | if (((long) bcc_ptr + len) - (long) |
2205 | pByteArea(smb_buffer_response) | 2218 | pByteArea(smb_buffer_response) |
2206 | <= BCC(smb_buffer_response)) { | 2219 | <= BCC(smb_buffer_response)) { |
2220 | if(ses->serverOS) | ||
2221 | kfree(ses->serverOS); | ||
2207 | ses->serverOS = kzalloc(len + 1,GFP_KERNEL); | 2222 | ses->serverOS = kzalloc(len + 1,GFP_KERNEL); |
2208 | if(ses->serverOS == NULL) | 2223 | if(ses->serverOS == NULL) |
2209 | goto sesssetup_nomem; | 2224 | goto sesssetup_nomem; |
@@ -2214,6 +2229,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2214 | bcc_ptr++; | 2229 | bcc_ptr++; |
2215 | 2230 | ||
2216 | len = strnlen(bcc_ptr, 1024); | 2231 | len = strnlen(bcc_ptr, 1024); |
2232 | if(ses->serverNOS) | ||
2233 | kfree(ses->serverNOS); | ||
2217 | ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); | 2234 | ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); |
2218 | if(ses->serverNOS == NULL) | 2235 | if(ses->serverNOS == NULL) |
2219 | goto sesssetup_nomem; | 2236 | goto sesssetup_nomem; |
@@ -2223,6 +2240,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2223 | bcc_ptr++; | 2240 | bcc_ptr++; |
2224 | 2241 | ||
2225 | len = strnlen(bcc_ptr, 1024); | 2242 | len = strnlen(bcc_ptr, 1024); |
2243 | if(ses->serverDomain) | ||
2244 | kfree(ses->serverDomain); | ||
2226 | ses->serverDomain = kzalloc(len + 1,GFP_KERNEL); | 2245 | ses->serverDomain = kzalloc(len + 1,GFP_KERNEL); |
2227 | if(ses->serverDomain == NULL) | 2246 | if(ses->serverDomain == NULL) |
2228 | goto sesssetup_nomem; | 2247 | goto sesssetup_nomem; |
@@ -2427,6 +2446,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2427 | /* We look for obvious messed up bcc or strings in response so we do not go off | 2446 | /* We look for obvious messed up bcc or strings in response so we do not go off |
2428 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 2447 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
2429 | terminating last Unicode string in response */ | 2448 | terminating last Unicode string in response */ |
2449 | if(ses->serverOS) | ||
2450 | kfree(ses->serverOS); | ||
2430 | ses->serverOS = | 2451 | ses->serverOS = |
2431 | kzalloc(2 * (len + 1), GFP_KERNEL); | 2452 | kzalloc(2 * (len + 1), GFP_KERNEL); |
2432 | cifs_strfromUCS_le(ses->serverOS, | 2453 | cifs_strfromUCS_le(ses->serverOS, |
@@ -2441,6 +2462,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2441 | len = UniStrnlen((wchar_t *)bcc_ptr, | 2462 | len = UniStrnlen((wchar_t *)bcc_ptr, |
2442 | remaining_words | 2463 | remaining_words |
2443 | - 1); | 2464 | - 1); |
2465 | if(ses->serverNOS) | ||
2466 | kfree(ses->serverNOS); | ||
2444 | ses->serverNOS = | 2467 | ses->serverNOS = |
2445 | kzalloc(2 * (len + 1), | 2468 | kzalloc(2 * (len + 1), |
2446 | GFP_KERNEL); | 2469 | GFP_KERNEL); |
@@ -2454,7 +2477,9 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2454 | remaining_words -= len + 1; | 2477 | remaining_words -= len + 1; |
2455 | if (remaining_words > 0) { | 2478 | if (remaining_words > 0) { |
2456 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 2479 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
2457 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ | 2480 | /* last string not null terminated (e.g.Windows XP/2000) */ |
2481 | if(ses->serverDomain) | ||
2482 | kfree(ses->serverDomain); | ||
2458 | ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL); | 2483 | ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL); |
2459 | cifs_strfromUCS_le(ses->serverDomain, | 2484 | cifs_strfromUCS_le(ses->serverDomain, |
2460 | (__le16 *)bcc_ptr, | 2485 | (__le16 *)bcc_ptr, |
@@ -2463,11 +2488,18 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2463 | ses->serverDomain[2*len] = 0; | 2488 | ses->serverDomain[2*len] = 0; |
2464 | ses->serverDomain[1+(2*len)] = 0; | 2489 | ses->serverDomain[1+(2*len)] = 0; |
2465 | } /* else no more room so create dummy domain string */ | 2490 | } /* else no more room so create dummy domain string */ |
2466 | else | 2491 | else { |
2492 | if(ses->serverDomain) | ||
2493 | kfree(ses->serverDomain); | ||
2467 | ses->serverDomain = | 2494 | ses->serverDomain = |
2468 | kzalloc(2,GFP_KERNEL); | 2495 | kzalloc(2,GFP_KERNEL); |
2469 | } else { /* no room so create dummy domain and NOS string */ | 2496 | } |
2497 | } else {/* no room use dummy domain&NOS */ | ||
2498 | if(ses->serverDomain) | ||
2499 | kfree(ses->serverDomain); | ||
2470 | ses->serverDomain = kzalloc(2, GFP_KERNEL); | 2500 | ses->serverDomain = kzalloc(2, GFP_KERNEL); |
2501 | if(ses->serverNOS) | ||
2502 | kfree(ses->serverNOS); | ||
2471 | ses->serverNOS = kzalloc(2, GFP_KERNEL); | 2503 | ses->serverNOS = kzalloc(2, GFP_KERNEL); |
2472 | } | 2504 | } |
2473 | } else { /* ASCII */ | 2505 | } else { /* ASCII */ |
@@ -2476,6 +2508,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2476 | if (((long) bcc_ptr + len) - (long) | 2508 | if (((long) bcc_ptr + len) - (long) |
2477 | pByteArea(smb_buffer_response) | 2509 | pByteArea(smb_buffer_response) |
2478 | <= BCC(smb_buffer_response)) { | 2510 | <= BCC(smb_buffer_response)) { |
2511 | if(ses->serverOS) | ||
2512 | kfree(ses->serverOS); | ||
2479 | ses->serverOS = kzalloc(len + 1, GFP_KERNEL); | 2513 | ses->serverOS = kzalloc(len + 1, GFP_KERNEL); |
2480 | strncpy(ses->serverOS, bcc_ptr, len); | 2514 | strncpy(ses->serverOS, bcc_ptr, len); |
2481 | 2515 | ||
@@ -2484,6 +2518,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2484 | bcc_ptr++; | 2518 | bcc_ptr++; |
2485 | 2519 | ||
2486 | len = strnlen(bcc_ptr, 1024); | 2520 | len = strnlen(bcc_ptr, 1024); |
2521 | if(ses->serverNOS) | ||
2522 | kfree(ses->serverNOS); | ||
2487 | ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); | 2523 | ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); |
2488 | strncpy(ses->serverNOS, bcc_ptr, len); | 2524 | strncpy(ses->serverNOS, bcc_ptr, len); |
2489 | bcc_ptr += len; | 2525 | bcc_ptr += len; |
@@ -2491,6 +2527,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2491 | bcc_ptr++; | 2527 | bcc_ptr++; |
2492 | 2528 | ||
2493 | len = strnlen(bcc_ptr, 1024); | 2529 | len = strnlen(bcc_ptr, 1024); |
2530 | if(ses->serverDomain) | ||
2531 | kfree(ses->serverDomain); | ||
2494 | ses->serverDomain = kzalloc(len + 1, GFP_KERNEL); | 2532 | ses->serverDomain = kzalloc(len + 1, GFP_KERNEL); |
2495 | strncpy(ses->serverDomain, bcc_ptr, len); | 2533 | strncpy(ses->serverDomain, bcc_ptr, len); |
2496 | bcc_ptr += len; | 2534 | bcc_ptr += len; |
@@ -2728,6 +2766,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2728 | /* We look for obvious messed up bcc or strings in response so we do not go off | 2766 | /* We look for obvious messed up bcc or strings in response so we do not go off |
2729 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 2767 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
2730 | terminating last Unicode string in response */ | 2768 | terminating last Unicode string in response */ |
2769 | if(ses->serverOS) | ||
2770 | kfree(ses->serverOS); | ||
2731 | ses->serverOS = | 2771 | ses->serverOS = |
2732 | kzalloc(2 * (len + 1), GFP_KERNEL); | 2772 | kzalloc(2 * (len + 1), GFP_KERNEL); |
2733 | cifs_strfromUCS_le(ses->serverOS, | 2773 | cifs_strfromUCS_le(ses->serverOS, |
@@ -2743,6 +2783,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2743 | bcc_ptr, | 2783 | bcc_ptr, |
2744 | remaining_words | 2784 | remaining_words |
2745 | - 1); | 2785 | - 1); |
2786 | if(ses->serverNOS) | ||
2787 | kfree(ses->serverNOS); | ||
2746 | ses->serverNOS = | 2788 | ses->serverNOS = |
2747 | kzalloc(2 * (len + 1), | 2789 | kzalloc(2 * (len + 1), |
2748 | GFP_KERNEL); | 2790 | GFP_KERNEL); |
@@ -2760,6 +2802,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2760 | if (remaining_words > 0) { | 2802 | if (remaining_words > 0) { |
2761 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 2803 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
2762 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ | 2804 | /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ |
2805 | if(ses->serverDomain) | ||
2806 | kfree(ses->serverDomain); | ||
2763 | ses->serverDomain = | 2807 | ses->serverDomain = |
2764 | kzalloc(2 * | 2808 | kzalloc(2 * |
2765 | (len + | 2809 | (len + |
@@ -2777,13 +2821,20 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2777 | [1 + (2 * len)] | 2821 | [1 + (2 * len)] |
2778 | = 0; | 2822 | = 0; |
2779 | } /* else no more room so create dummy domain string */ | 2823 | } /* else no more room so create dummy domain string */ |
2780 | else | 2824 | else { |
2825 | if(ses->serverDomain) | ||
2826 | kfree(ses->serverDomain); | ||
2781 | ses->serverDomain = | 2827 | ses->serverDomain = |
2782 | kzalloc(2, | 2828 | kzalloc(2, |
2783 | GFP_KERNEL); | 2829 | GFP_KERNEL); |
2830 | } | ||
2784 | } else { /* no room so create dummy domain and NOS string */ | 2831 | } else { /* no room so create dummy domain and NOS string */ |
2832 | if(ses->serverDomain); | ||
2833 | kfree(ses->serverDomain); | ||
2785 | ses->serverDomain = | 2834 | ses->serverDomain = |
2786 | kzalloc(2, GFP_KERNEL); | 2835 | kzalloc(2, GFP_KERNEL); |
2836 | if(ses->serverNOS) | ||
2837 | kfree(ses->serverNOS); | ||
2787 | ses->serverNOS = | 2838 | ses->serverNOS = |
2788 | kzalloc(2, GFP_KERNEL); | 2839 | kzalloc(2, GFP_KERNEL); |
2789 | } | 2840 | } |
@@ -2792,6 +2843,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2792 | if (((long) bcc_ptr + len) - (long) | 2843 | if (((long) bcc_ptr + len) - (long) |
2793 | pByteArea(smb_buffer_response) | 2844 | pByteArea(smb_buffer_response) |
2794 | <= BCC(smb_buffer_response)) { | 2845 | <= BCC(smb_buffer_response)) { |
2846 | if(ses->serverOS) | ||
2847 | kfree(ses->serverOS); | ||
2795 | ses->serverOS = | 2848 | ses->serverOS = |
2796 | kzalloc(len + 1, | 2849 | kzalloc(len + 1, |
2797 | GFP_KERNEL); | 2850 | GFP_KERNEL); |
@@ -2803,6 +2856,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2803 | bcc_ptr++; | 2856 | bcc_ptr++; |
2804 | 2857 | ||
2805 | len = strnlen(bcc_ptr, 1024); | 2858 | len = strnlen(bcc_ptr, 1024); |
2859 | if(ses->serverNOS) | ||
2860 | kfree(ses->serverNOS); | ||
2806 | ses->serverNOS = | 2861 | ses->serverNOS = |
2807 | kzalloc(len + 1, | 2862 | kzalloc(len + 1, |
2808 | GFP_KERNEL); | 2863 | GFP_KERNEL); |
@@ -2812,6 +2867,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2812 | bcc_ptr++; | 2867 | bcc_ptr++; |
2813 | 2868 | ||
2814 | len = strnlen(bcc_ptr, 1024); | 2869 | len = strnlen(bcc_ptr, 1024); |
2870 | if(ses->serverDomain) | ||
2871 | kfree(ses->serverDomain); | ||
2815 | ses->serverDomain = | 2872 | ses->serverDomain = |
2816 | kzalloc(len + 1, | 2873 | kzalloc(len + 1, |
2817 | GFP_KERNEL); | 2874 | GFP_KERNEL); |
@@ -3116,6 +3173,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3116 | /* We look for obvious messed up bcc or strings in response so we do not go off | 3173 | /* We look for obvious messed up bcc or strings in response so we do not go off |
3117 | the end since (at least) WIN2K and Windows XP have a major bug in not null | 3174 | the end since (at least) WIN2K and Windows XP have a major bug in not null |
3118 | terminating last Unicode string in response */ | 3175 | terminating last Unicode string in response */ |
3176 | if(ses->serverOS) | ||
3177 | kfree(ses->serverOS); | ||
3119 | ses->serverOS = | 3178 | ses->serverOS = |
3120 | kzalloc(2 * (len + 1), GFP_KERNEL); | 3179 | kzalloc(2 * (len + 1), GFP_KERNEL); |
3121 | cifs_strfromUCS_le(ses->serverOS, | 3180 | cifs_strfromUCS_le(ses->serverOS, |
@@ -3131,6 +3190,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3131 | bcc_ptr, | 3190 | bcc_ptr, |
3132 | remaining_words | 3191 | remaining_words |
3133 | - 1); | 3192 | - 1); |
3193 | if(ses->serverNOS) | ||
3194 | kfree(ses->serverNOS); | ||
3134 | ses->serverNOS = | 3195 | ses->serverNOS = |
3135 | kzalloc(2 * (len + 1), | 3196 | kzalloc(2 * (len + 1), |
3136 | GFP_KERNEL); | 3197 | GFP_KERNEL); |
@@ -3147,6 +3208,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3147 | if (remaining_words > 0) { | 3208 | if (remaining_words > 0) { |
3148 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); | 3209 | len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); |
3149 | /* last string not always null terminated (e.g. for Windows XP & 2000) */ | 3210 | /* last string not always null terminated (e.g. for Windows XP & 2000) */ |
3211 | if(ses->serverDomain) | ||
3212 | kfree(ses->serverDomain); | ||
3150 | ses->serverDomain = | 3213 | ses->serverDomain = |
3151 | kzalloc(2 * | 3214 | kzalloc(2 * |
3152 | (len + | 3215 | (len + |
@@ -3172,10 +3235,17 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3172 | len)] | 3235 | len)] |
3173 | = 0; | 3236 | = 0; |
3174 | } /* else no more room so create dummy domain string */ | 3237 | } /* else no more room so create dummy domain string */ |
3175 | else | 3238 | else { |
3239 | if(ses->serverDomain) | ||
3240 | kfree(ses->serverDomain); | ||
3176 | ses->serverDomain = kzalloc(2,GFP_KERNEL); | 3241 | ses->serverDomain = kzalloc(2,GFP_KERNEL); |
3242 | } | ||
3177 | } else { /* no room so create dummy domain and NOS string */ | 3243 | } else { /* no room so create dummy domain and NOS string */ |
3244 | if(ses->serverDomain) | ||
3245 | kfree(ses->serverDomain); | ||
3178 | ses->serverDomain = kzalloc(2, GFP_KERNEL); | 3246 | ses->serverDomain = kzalloc(2, GFP_KERNEL); |
3247 | if(ses->serverNOS) | ||
3248 | kfree(ses->serverNOS); | ||
3179 | ses->serverNOS = kzalloc(2, GFP_KERNEL); | 3249 | ses->serverNOS = kzalloc(2, GFP_KERNEL); |
3180 | } | 3250 | } |
3181 | } else { /* ASCII */ | 3251 | } else { /* ASCII */ |
@@ -3183,6 +3253,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3183 | if (((long) bcc_ptr + len) - | 3253 | if (((long) bcc_ptr + len) - |
3184 | (long) pByteArea(smb_buffer_response) | 3254 | (long) pByteArea(smb_buffer_response) |
3185 | <= BCC(smb_buffer_response)) { | 3255 | <= BCC(smb_buffer_response)) { |
3256 | if(ses->serverOS) | ||
3257 | kfree(ses->serverOS); | ||
3186 | ses->serverOS = kzalloc(len + 1,GFP_KERNEL); | 3258 | ses->serverOS = kzalloc(len + 1,GFP_KERNEL); |
3187 | strncpy(ses->serverOS,bcc_ptr, len); | 3259 | strncpy(ses->serverOS,bcc_ptr, len); |
3188 | 3260 | ||
@@ -3191,6 +3263,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3191 | bcc_ptr++; | 3263 | bcc_ptr++; |
3192 | 3264 | ||
3193 | len = strnlen(bcc_ptr, 1024); | 3265 | len = strnlen(bcc_ptr, 1024); |
3266 | if(ses->serverNOS) | ||
3267 | kfree(ses->serverNOS); | ||
3194 | ses->serverNOS = kzalloc(len+1,GFP_KERNEL); | 3268 | ses->serverNOS = kzalloc(len+1,GFP_KERNEL); |
3195 | strncpy(ses->serverNOS, bcc_ptr, len); | 3269 | strncpy(ses->serverNOS, bcc_ptr, len); |
3196 | bcc_ptr += len; | 3270 | bcc_ptr += len; |
@@ -3198,6 +3272,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3198 | bcc_ptr++; | 3272 | bcc_ptr++; |
3199 | 3273 | ||
3200 | len = strnlen(bcc_ptr, 1024); | 3274 | len = strnlen(bcc_ptr, 1024); |
3275 | if(ses->serverDomain) | ||
3276 | kfree(ses->serverDomain); | ||
3201 | ses->serverDomain = kzalloc(len+1,GFP_KERNEL); | 3277 | ses->serverDomain = kzalloc(len+1,GFP_KERNEL); |
3202 | strncpy(ses->serverDomain, bcc_ptr, len); | 3278 | strncpy(ses->serverDomain, bcc_ptr, len); |
3203 | bcc_ptr += len; | 3279 | bcc_ptr += len; |
@@ -3282,7 +3358,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3282 | bcc_ptr++; /* align */ | 3358 | bcc_ptr++; /* align */ |
3283 | } | 3359 | } |
3284 | 3360 | ||
3285 | if(ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | 3361 | if(ses->server->secMode & |
3362 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | ||
3286 | smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; | 3363 | smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; |
3287 | 3364 | ||
3288 | if (ses->capabilities & CAP_STATUS32) { | 3365 | if (ses->capabilities & CAP_STATUS32) { |
@@ -3294,8 +3371,10 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3294 | if (ses->capabilities & CAP_UNICODE) { | 3371 | if (ses->capabilities & CAP_UNICODE) { |
3295 | smb_buffer->Flags2 |= SMBFLG2_UNICODE; | 3372 | smb_buffer->Flags2 |= SMBFLG2_UNICODE; |
3296 | length = | 3373 | length = |
3297 | cifs_strtoUCS((__le16 *) bcc_ptr, tree, 100, nls_codepage); | 3374 | cifs_strtoUCS((__le16 *) bcc_ptr, tree, |
3298 | bcc_ptr += 2 * length; /* convert num of 16 bit words to bytes */ | 3375 | 6 /* max utf8 char length in bytes */ * |
3376 | (/* server len*/ + 256 /* share len */), nls_codepage); | ||
3377 | bcc_ptr += 2 * length; /* convert num 16 bit words to bytes */ | ||
3299 | bcc_ptr += 2; /* skip trailing null */ | 3378 | bcc_ptr += 2; /* skip trailing null */ |
3300 | } else { /* ASCII */ | 3379 | } else { /* ASCII */ |
3301 | strcpy(bcc_ptr, tree); | 3380 | strcpy(bcc_ptr, tree); |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index e152bf6afa60..e2b4ce1dad66 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -84,6 +84,8 @@ static inline int cifs_get_disposition(unsigned int flags) | |||
84 | return FILE_OVERWRITE_IF; | 84 | return FILE_OVERWRITE_IF; |
85 | else if ((flags & O_CREAT) == O_CREAT) | 85 | else if ((flags & O_CREAT) == O_CREAT) |
86 | return FILE_OPEN_IF; | 86 | return FILE_OPEN_IF; |
87 | else if ((flags & O_TRUNC) == O_TRUNC) | ||
88 | return FILE_OVERWRITE; | ||
87 | else | 89 | else |
88 | return FILE_OPEN; | 90 | return FILE_OPEN; |
89 | } | 91 | } |
@@ -656,7 +658,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) | |||
656 | else | 658 | else |
657 | posix_lock_type = CIFS_WRLCK; | 659 | posix_lock_type = CIFS_WRLCK; |
658 | rc = CIFSSMBPosixLock(xid, pTcon, netfid, 1 /* get */, | 660 | rc = CIFSSMBPosixLock(xid, pTcon, netfid, 1 /* get */, |
659 | length, pfLock->fl_start, | 661 | length, pfLock, |
660 | posix_lock_type, wait_flag); | 662 | posix_lock_type, wait_flag); |
661 | FreeXid(xid); | 663 | FreeXid(xid); |
662 | return rc; | 664 | return rc; |
@@ -704,7 +706,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) | |||
704 | return -EOPNOTSUPP; | 706 | return -EOPNOTSUPP; |
705 | } | 707 | } |
706 | rc = CIFSSMBPosixLock(xid, pTcon, netfid, 0 /* set */, | 708 | rc = CIFSSMBPosixLock(xid, pTcon, netfid, 0 /* set */, |
707 | length, pfLock->fl_start, | 709 | length, pfLock, |
708 | posix_lock_type, wait_flag); | 710 | posix_lock_type, wait_flag); |
709 | } else | 711 | } else |
710 | rc = CIFSSMBLock(xid, pTcon, netfid, length, pfLock->fl_start, | 712 | rc = CIFSSMBLock(xid, pTcon, netfid, length, pfLock->fl_start, |
@@ -904,8 +906,10 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
904 | if (rc != 0) | 906 | if (rc != 0) |
905 | break; | 907 | break; |
906 | } | 908 | } |
907 | if(experimEnabled || (pTcon->ses->server->secMode & | 909 | if(experimEnabled || (pTcon->ses->server && |
908 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { | 910 | ((pTcon->ses->server->secMode & |
911 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | ||
912 | == 0))) { | ||
909 | struct kvec iov[2]; | 913 | struct kvec iov[2]; |
910 | unsigned int len; | 914 | unsigned int len; |
911 | 915 | ||
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c index 8aac5334680d..34b39e9a1e5a 100644 --- a/fs/ext3/resize.c +++ b/fs/ext3/resize.c | |||
@@ -767,7 +767,6 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input) | |||
767 | if (input->group != sbi->s_groups_count) { | 767 | if (input->group != sbi->s_groups_count) { |
768 | ext3_warning(sb, __FUNCTION__, | 768 | ext3_warning(sb, __FUNCTION__, |
769 | "multiple resizers run on filesystem!"); | 769 | "multiple resizers run on filesystem!"); |
770 | unlock_super(sb); | ||
771 | err = -EBUSY; | 770 | err = -EBUSY; |
772 | goto exit_journal; | 771 | goto exit_journal; |
773 | } | 772 | } |
diff --git a/fs/namei.c b/fs/namei.c index 96723ae83c89..d6e2ee251736 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1080,8 +1080,8 @@ static int fastcall do_path_lookup(int dfd, const char *name, | |||
1080 | nd->flags = flags; | 1080 | nd->flags = flags; |
1081 | nd->depth = 0; | 1081 | nd->depth = 0; |
1082 | 1082 | ||
1083 | read_lock(¤t->fs->lock); | ||
1084 | if (*name=='/') { | 1083 | if (*name=='/') { |
1084 | read_lock(¤t->fs->lock); | ||
1085 | if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) { | 1085 | if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) { |
1086 | nd->mnt = mntget(current->fs->altrootmnt); | 1086 | nd->mnt = mntget(current->fs->altrootmnt); |
1087 | nd->dentry = dget(current->fs->altroot); | 1087 | nd->dentry = dget(current->fs->altroot); |
@@ -1092,33 +1092,35 @@ static int fastcall do_path_lookup(int dfd, const char *name, | |||
1092 | } | 1092 | } |
1093 | nd->mnt = mntget(current->fs->rootmnt); | 1093 | nd->mnt = mntget(current->fs->rootmnt); |
1094 | nd->dentry = dget(current->fs->root); | 1094 | nd->dentry = dget(current->fs->root); |
1095 | read_unlock(¤t->fs->lock); | ||
1095 | } else if (dfd == AT_FDCWD) { | 1096 | } else if (dfd == AT_FDCWD) { |
1097 | read_lock(¤t->fs->lock); | ||
1096 | nd->mnt = mntget(current->fs->pwdmnt); | 1098 | nd->mnt = mntget(current->fs->pwdmnt); |
1097 | nd->dentry = dget(current->fs->pwd); | 1099 | nd->dentry = dget(current->fs->pwd); |
1100 | read_unlock(¤t->fs->lock); | ||
1098 | } else { | 1101 | } else { |
1099 | struct dentry *dentry; | 1102 | struct dentry *dentry; |
1100 | 1103 | ||
1101 | file = fget_light(dfd, &fput_needed); | 1104 | file = fget_light(dfd, &fput_needed); |
1102 | retval = -EBADF; | 1105 | retval = -EBADF; |
1103 | if (!file) | 1106 | if (!file) |
1104 | goto unlock_fail; | 1107 | goto out_fail; |
1105 | 1108 | ||
1106 | dentry = file->f_dentry; | 1109 | dentry = file->f_dentry; |
1107 | 1110 | ||
1108 | retval = -ENOTDIR; | 1111 | retval = -ENOTDIR; |
1109 | if (!S_ISDIR(dentry->d_inode->i_mode)) | 1112 | if (!S_ISDIR(dentry->d_inode->i_mode)) |
1110 | goto fput_unlock_fail; | 1113 | goto fput_fail; |
1111 | 1114 | ||
1112 | retval = file_permission(file, MAY_EXEC); | 1115 | retval = file_permission(file, MAY_EXEC); |
1113 | if (retval) | 1116 | if (retval) |
1114 | goto fput_unlock_fail; | 1117 | goto fput_fail; |
1115 | 1118 | ||
1116 | nd->mnt = mntget(file->f_vfsmnt); | 1119 | nd->mnt = mntget(file->f_vfsmnt); |
1117 | nd->dentry = dget(dentry); | 1120 | nd->dentry = dget(dentry); |
1118 | 1121 | ||
1119 | fput_light(file, fput_needed); | 1122 | fput_light(file, fput_needed); |
1120 | } | 1123 | } |
1121 | read_unlock(¤t->fs->lock); | ||
1122 | current->total_link_count = 0; | 1124 | current->total_link_count = 0; |
1123 | retval = link_path_walk(name, nd); | 1125 | retval = link_path_walk(name, nd); |
1124 | out: | 1126 | out: |
@@ -1127,13 +1129,12 @@ out: | |||
1127 | nd->dentry->d_inode)) | 1129 | nd->dentry->d_inode)) |
1128 | audit_inode(name, nd->dentry->d_inode, flags); | 1130 | audit_inode(name, nd->dentry->d_inode, flags); |
1129 | } | 1131 | } |
1132 | out_fail: | ||
1130 | return retval; | 1133 | return retval; |
1131 | 1134 | ||
1132 | fput_unlock_fail: | 1135 | fput_fail: |
1133 | fput_light(file, fput_needed); | 1136 | fput_light(file, fput_needed); |
1134 | unlock_fail: | 1137 | goto out_fail; |
1135 | read_unlock(¤t->fs->lock); | ||
1136 | return retval; | ||
1137 | } | 1138 | } |
1138 | 1139 | ||
1139 | int fastcall path_lookup(const char *name, unsigned int flags, | 1140 | int fastcall path_lookup(const char *name, unsigned int flags, |
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h index 9950706abdf8..e1432102be05 100644 --- a/include/asm-alpha/smp.h +++ b/include/asm-alpha/smp.h | |||
@@ -45,10 +45,8 @@ extern struct cpuinfo_alpha cpu_data[NR_CPUS]; | |||
45 | #define hard_smp_processor_id() __hard_smp_processor_id() | 45 | #define hard_smp_processor_id() __hard_smp_processor_id() |
46 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 46 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
47 | 47 | ||
48 | extern cpumask_t cpu_present_mask; | ||
49 | extern cpumask_t cpu_online_map; | ||
50 | extern int smp_num_cpus; | 48 | extern int smp_num_cpus; |
51 | #define cpu_possible_map cpu_present_mask | 49 | #define cpu_possible_map cpu_present_map |
52 | 50 | ||
53 | int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu); | 51 | int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu); |
54 | 52 | ||
diff --git a/include/asm-arm/arch-ixp23xx/memory.h b/include/asm-arm/arch-ixp23xx/memory.h index 6e19f46d54d1..c85fc06a043c 100644 --- a/include/asm-arm/arch-ixp23xx/memory.h +++ b/include/asm-arm/arch-ixp23xx/memory.h | |||
@@ -49,7 +49,7 @@ static inline int __ixp23xx_arch_is_coherent(void) | |||
49 | { | 49 | { |
50 | extern unsigned int processor_id; | 50 | extern unsigned int processor_id; |
51 | 51 | ||
52 | if (((processor_id & 15) >= 2) || machine_is_roadrunner()) | 52 | if (((processor_id & 15) >= 4) || machine_is_roadrunner()) |
53 | return 1; | 53 | return 1; |
54 | 54 | ||
55 | return 0; | 55 | return 0; |
diff --git a/include/asm-arm/arch-l7200/serial_l7200.h b/include/asm-arm/arch-l7200/serial_l7200.h index 238c595d97ea..b1008a9d23e5 100644 --- a/include/asm-arm/arch-l7200/serial_l7200.h +++ b/include/asm-arm/arch-l7200/serial_l7200.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #define UARTDR 0x00 /* Tx/Rx data */ | 28 | #define UARTDR 0x00 /* Tx/Rx data */ |
29 | #define RXSTAT 0x04 /* Rx status */ | 29 | #define RXSTAT 0x04 /* Rx status */ |
30 | #define H_UBRLCR 0x08 /* mode register high */ | 30 | #define H_UBRLCR 0x08 /* mode register high */ |
31 | #define M_UBRLCR 0x0C /* mode reg mid (MSB of buad)*/ | 31 | #define M_UBRLCR 0x0C /* mode reg mid (MSB of baud)*/ |
32 | #define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/ | 32 | #define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/ |
33 | #define UARTCON 0x14 /* control register */ | 33 | #define UARTCON 0x14 /* control register */ |
34 | #define UARTFLG 0x18 /* flag register */ | 34 | #define UARTFLG 0x18 /* flag register */ |
diff --git a/include/asm-arm/arch-l7200/uncompress.h b/include/asm-arm/arch-l7200/uncompress.h index 9fcd40aee3e3..04be2a088639 100644 --- a/include/asm-arm/arch-l7200/uncompress.h +++ b/include/asm-arm/arch-l7200/uncompress.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * Changelog: | 6 | * Changelog: |
7 | * 05-01-2000 SJH Created | 7 | * 05-01-2000 SJH Created |
8 | * 05-13-2000 SJH Filled in function bodies | 8 | * 05-13-2000 SJH Filled in function bodies |
9 | * 07-26-2000 SJH Removed hard coded buad rate | 9 | * 07-26-2000 SJH Removed hard coded baud rate |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <asm/hardware.h> | 12 | #include <asm/hardware.h> |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 95b3abf4851b..7c9568d30307 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -127,6 +127,12 @@ static inline int cpu_is_xsc3(void) | |||
127 | } | 127 | } |
128 | #endif | 128 | #endif |
129 | 129 | ||
130 | #if !defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_CPU_XSC3) | ||
131 | #define cpu_is_xscale() 0 | ||
132 | #else | ||
133 | #define cpu_is_xscale() 1 | ||
134 | #endif | ||
135 | |||
130 | #define set_cr(x) \ | 136 | #define set_cr(x) \ |
131 | __asm__ __volatile__( \ | 137 | __asm__ __volatile__( \ |
132 | "mcr p15, 0, %0, c1, c0, 0 @ set CR" \ | 138 | "mcr p15, 0, %0, c1, c0, 0 @ set CR" \ |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 358e4d309ceb..c2059a3a0621 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -159,17 +159,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
159 | #define lazy_mmu_prot_update(pte) do { } while (0) | 159 | #define lazy_mmu_prot_update(pte) do { } while (0) |
160 | #endif | 160 | #endif |
161 | 161 | ||
162 | #ifndef __HAVE_ARCH_MULTIPLE_ZERO_PAGE | 162 | #ifndef __HAVE_ARCH_MOVE_PTE |
163 | #define move_pte(pte, prot, old_addr, new_addr) (pte) | 163 | #define move_pte(pte, prot, old_addr, new_addr) (pte) |
164 | #else | ||
165 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
166 | ({ \ | ||
167 | pte_t newpte = (pte); \ | ||
168 | if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \ | ||
169 | pte_page(pte) == ZERO_PAGE(old_addr)) \ | ||
170 | newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \ | ||
171 | newpte; \ | ||
172 | }) | ||
173 | #endif | 164 | #endif |
174 | 165 | ||
175 | /* | 166 | /* |
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 42520cc84b0f..1386af1cb7d9 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h | |||
@@ -129,6 +129,7 @@ | |||
129 | #if defined (CONFIG_CPU_R4300) \ | 129 | #if defined (CONFIG_CPU_R4300) \ |
130 | || defined (CONFIG_CPU_R4X00) \ | 130 | || defined (CONFIG_CPU_R4X00) \ |
131 | || defined (CONFIG_CPU_R5000) \ | 131 | || defined (CONFIG_CPU_R5000) \ |
132 | || defined (CONFIG_CPU_RM7000) \ | ||
132 | || defined (CONFIG_CPU_NEVADA) \ | 133 | || defined (CONFIG_CPU_NEVADA) \ |
133 | || defined (CONFIG_CPU_TX49XX) \ | 134 | || defined (CONFIG_CPU_TX49XX) \ |
134 | || defined (CONFIG_CPU_MIPS64) | 135 | || defined (CONFIG_CPU_MIPS64) |
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index 818b9a97e214..dff2a0a52f8f 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #define PRID_IMP_R4300 0x0b00 | 51 | #define PRID_IMP_R4300 0x0b00 |
52 | #define PRID_IMP_VR41XX 0x0c00 | 52 | #define PRID_IMP_VR41XX 0x0c00 |
53 | #define PRID_IMP_R12000 0x0e00 | 53 | #define PRID_IMP_R12000 0x0e00 |
54 | #define PRID_IMP_R14000 0x0f00 | ||
54 | #define PRID_IMP_R8000 0x1000 | 55 | #define PRID_IMP_R8000 0x1000 |
55 | #define PRID_IMP_PR4450 0x1200 | 56 | #define PRID_IMP_PR4450 0x1200 |
56 | #define PRID_IMP_R4600 0x2000 | 57 | #define PRID_IMP_R4600 0x2000 |
@@ -87,6 +88,7 @@ | |||
87 | #define PRID_IMP_24K 0x9300 | 88 | #define PRID_IMP_24K 0x9300 |
88 | #define PRID_IMP_34K 0x9500 | 89 | #define PRID_IMP_34K 0x9500 |
89 | #define PRID_IMP_24KE 0x9600 | 90 | #define PRID_IMP_24KE 0x9600 |
91 | #define PRID_IMP_74K 0x9700 | ||
90 | 92 | ||
91 | /* | 93 | /* |
92 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE | 94 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE |
@@ -196,7 +198,9 @@ | |||
196 | #define CPU_34K 60 | 198 | #define CPU_34K 60 |
197 | #define CPU_PR4450 61 | 199 | #define CPU_PR4450 61 |
198 | #define CPU_SB1A 62 | 200 | #define CPU_SB1A 62 |
199 | #define CPU_LAST 62 | 201 | #define CPU_74K 63 |
202 | #define CPU_R14000 64 | ||
203 | #define CPU_LAST 64 | ||
200 | 204 | ||
201 | /* | 205 | /* |
202 | * ISA Level encodings | 206 | * ISA Level encodings |
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h index 64dd45150f64..928f30f8c45c 100644 --- a/include/asm-mips/delay.h +++ b/include/asm-mips/delay.h | |||
@@ -19,20 +19,22 @@ static inline void __delay(unsigned long loops) | |||
19 | { | 19 | { |
20 | if (sizeof(long) == 4) | 20 | if (sizeof(long) == 4) |
21 | __asm__ __volatile__ ( | 21 | __asm__ __volatile__ ( |
22 | ".set\tnoreorder\n" | 22 | " .set noreorder \n" |
23 | "1:\tbnez\t%0,1b\n\t" | 23 | " .align 3 \n" |
24 | "subu\t%0,1\n\t" | 24 | "1: bnez %0, 1b \n" |
25 | ".set\treorder" | 25 | " subu %0, 1 \n" |
26 | " .set reorder \n" | ||
26 | : "=r" (loops) | 27 | : "=r" (loops) |
27 | : "0" (loops)); | 28 | : "0" (loops)); |
28 | else if (sizeof(long) == 8) | 29 | else if (sizeof(long) == 8) |
29 | __asm__ __volatile__ ( | 30 | __asm__ __volatile__ ( |
30 | ".set\tnoreorder\n" | 31 | " .set noreorder \n" |
31 | "1:\tbnez\t%0,1b\n\t" | 32 | " .align 3 \n" |
32 | "dsubu\t%0,1\n\t" | 33 | "1: bnez %0, 1b \n" |
33 | ".set\treorder" | 34 | " dsubu %0, 1 \n" |
34 | :"=r" (loops) | 35 | " .set reorder \n" |
35 | :"0" (loops)); | 36 | : "=r" (loops) |
37 | : "0" (loops)); | ||
36 | } | 38 | } |
37 | 39 | ||
38 | 40 | ||
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h index a554089991f2..12d118f1bc9c 100644 --- a/include/asm-mips/futex.h +++ b/include/asm-mips/futex.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/futex.h> | 7 | #include <linux/futex.h> |
8 | #include <asm/errno.h> | 8 | #include <asm/errno.h> |
9 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
10 | #include <asm/war.h> | ||
10 | 11 | ||
11 | #ifdef CONFIG_SMP | 12 | #ifdef CONFIG_SMP |
12 | #define __FUTEX_SMP_SYNC " sync \n" | 13 | #define __FUTEX_SMP_SYNC " sync \n" |
@@ -16,30 +17,58 @@ | |||
16 | 17 | ||
17 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 18 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ |
18 | { \ | 19 | { \ |
19 | __asm__ __volatile__( \ | 20 | if (cpu_has_llsc && R10000_LLSC_WAR) { \ |
20 | " .set push \n" \ | 21 | __asm__ __volatile__( \ |
21 | " .set noat \n" \ | 22 | " .set push \n" \ |
22 | " .set mips3 \n" \ | 23 | " .set noat \n" \ |
23 | "1: ll %1, (%3) # __futex_atomic_op1 \n" \ | 24 | " .set mips3 \n" \ |
24 | " .set mips0 \n" \ | 25 | "1: ll %1, (%3) # __futex_atomic_op \n" \ |
25 | " " insn " \n" \ | 26 | " .set mips0 \n" \ |
26 | " .set mips3 \n" \ | 27 | " " insn " \n" \ |
27 | "2: sc $1, (%3) \n" \ | 28 | " .set mips3 \n" \ |
28 | " beqzl $1, 1b \n" \ | 29 | "2: sc $1, (%3) \n" \ |
29 | __FUTEX_SMP_SYNC \ | 30 | " beqzl $1, 1b \n" \ |
30 | "3: \n" \ | 31 | __FUTEX_SMP_SYNC \ |
31 | " .set pop \n" \ | 32 | "3: \n" \ |
32 | " .set mips0 \n" \ | 33 | " .set pop \n" \ |
33 | " .section .fixup,\"ax\" \n" \ | 34 | " .set mips0 \n" \ |
34 | "4: li %0, %5 \n" \ | 35 | " .section .fixup,\"ax\" \n" \ |
35 | " j 2b \n" \ | 36 | "4: li %0, %5 \n" \ |
36 | " .previous \n" \ | 37 | " j 2b \n" \ |
37 | " .section __ex_table,\"a\" \n" \ | 38 | " .previous \n" \ |
38 | " "__UA_ADDR "\t1b, 4b \n" \ | 39 | " .section __ex_table,\"a\" \n" \ |
39 | " "__UA_ADDR "\t2b, 4b \n" \ | 40 | " "__UA_ADDR "\t1b, 4b \n" \ |
40 | " .previous \n" \ | 41 | " "__UA_ADDR "\t2b, 4b \n" \ |
41 | : "=r" (ret), "=r" (oldval) \ | 42 | " .previous \n" \ |
42 | : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ | 43 | : "=r" (ret), "=r" (oldval) \ |
44 | : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ | ||
45 | } else if (cpu_has_llsc) { \ | ||
46 | __asm__ __volatile__( \ | ||
47 | " .set push \n" \ | ||
48 | " .set noat \n" \ | ||
49 | " .set mips3 \n" \ | ||
50 | "1: ll %1, (%3) # __futex_atomic_op \n" \ | ||
51 | " .set mips0 \n" \ | ||
52 | " " insn " \n" \ | ||
53 | " .set mips3 \n" \ | ||
54 | "2: sc $1, (%3) \n" \ | ||
55 | " beqz $1, 1b \n" \ | ||
56 | __FUTEX_SMP_SYNC \ | ||
57 | "3: \n" \ | ||
58 | " .set pop \n" \ | ||
59 | " .set mips0 \n" \ | ||
60 | " .section .fixup,\"ax\" \n" \ | ||
61 | "4: li %0, %5 \n" \ | ||
62 | " j 2b \n" \ | ||
63 | " .previous \n" \ | ||
64 | " .section __ex_table,\"a\" \n" \ | ||
65 | " "__UA_ADDR "\t1b, 4b \n" \ | ||
66 | " "__UA_ADDR "\t2b, 4b \n" \ | ||
67 | " .previous \n" \ | ||
68 | : "=r" (ret), "=r" (oldval) \ | ||
69 | : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ | ||
70 | } else \ | ||
71 | ret = -ENOSYS; \ | ||
43 | } | 72 | } |
44 | 73 | ||
45 | static inline int | 74 | static inline int |
@@ -102,7 +131,69 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
102 | static inline int | 131 | static inline int |
103 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | 132 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) |
104 | { | 133 | { |
105 | return -ENOSYS; | 134 | int retval; |
135 | |||
136 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | ||
137 | return -EFAULT; | ||
138 | |||
139 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
140 | __asm__ __volatile__( | ||
141 | "# futex_atomic_cmpxchg_inatomic \n" | ||
142 | " .set push \n" | ||
143 | " .set noat \n" | ||
144 | " .set mips3 \n" | ||
145 | "1: ll %0, %2 \n" | ||
146 | " bne %0, %z3, 3f \n" | ||
147 | " .set mips0 \n" | ||
148 | " move $1, %z4 \n" | ||
149 | " .set mips3 \n" | ||
150 | "2: sc $1, %1 \n" | ||
151 | " beqzl $1, 1b \n" | ||
152 | __FUTEX_SMP_SYNC | ||
153 | "3: \n" | ||
154 | " .set pop \n" | ||
155 | " .section .fixup,\"ax\" \n" | ||
156 | "4: li %0, %5 \n" | ||
157 | " j 3b \n" | ||
158 | " .previous \n" | ||
159 | " .section __ex_table,\"a\" \n" | ||
160 | " "__UA_ADDR "\t1b, 4b \n" | ||
161 | " "__UA_ADDR "\t2b, 4b \n" | ||
162 | " .previous \n" | ||
163 | : "=&r" (retval), "=R" (*uaddr) | ||
164 | : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT) | ||
165 | : "memory"); | ||
166 | } else if (cpu_has_llsc) { | ||
167 | __asm__ __volatile__( | ||
168 | "# futex_atomic_cmpxchg_inatomic \n" | ||
169 | " .set push \n" | ||
170 | " .set noat \n" | ||
171 | " .set mips3 \n" | ||
172 | "1: ll %0, %2 \n" | ||
173 | " bne %0, %z3, 3f \n" | ||
174 | " .set mips0 \n" | ||
175 | " move $1, %z4 \n" | ||
176 | " .set mips3 \n" | ||
177 | "2: sc $1, %1 \n" | ||
178 | " beqz $1, 1b \n" | ||
179 | __FUTEX_SMP_SYNC | ||
180 | "3: \n" | ||
181 | " .set pop \n" | ||
182 | " .section .fixup,\"ax\" \n" | ||
183 | "4: li %0, %5 \n" | ||
184 | " j 3b \n" | ||
185 | " .previous \n" | ||
186 | " .section __ex_table,\"a\" \n" | ||
187 | " "__UA_ADDR "\t1b, 4b \n" | ||
188 | " "__UA_ADDR "\t2b, 4b \n" | ||
189 | " .previous \n" | ||
190 | : "=&r" (retval), "=R" (*uaddr) | ||
191 | : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT) | ||
192 | : "memory"); | ||
193 | } else | ||
194 | return -ENOSYS; | ||
195 | |||
196 | return retval; | ||
106 | } | 197 | } |
107 | 198 | ||
108 | #endif | 199 | #endif |
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h index e0745f4ff624..1ed8d0f62577 100644 --- a/include/asm-mips/inst.h +++ b/include/asm-mips/inst.h | |||
@@ -6,6 +6,7 @@ | |||
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 1996, 2000 by Ralf Baechle | 8 | * Copyright (C) 1996, 2000 by Ralf Baechle |
9 | * Copyright (C) 2006 by Thiemo Seufer | ||
9 | */ | 10 | */ |
10 | #ifndef _ASM_INST_H | 11 | #ifndef _ASM_INST_H |
11 | #define _ASM_INST_H | 12 | #define _ASM_INST_H |
@@ -21,14 +22,14 @@ enum major_op { | |||
21 | cop0_op, cop1_op, cop2_op, cop1x_op, | 22 | cop0_op, cop1_op, cop2_op, cop1x_op, |
22 | beql_op, bnel_op, blezl_op, bgtzl_op, | 23 | beql_op, bnel_op, blezl_op, bgtzl_op, |
23 | daddi_op, daddiu_op, ldl_op, ldr_op, | 24 | daddi_op, daddiu_op, ldl_op, ldr_op, |
24 | major_1c_op, jalx_op, major_1e_op, major_1f_op, | 25 | spec2_op, jalx_op, mdmx_op, spec3_op, |
25 | lb_op, lh_op, lwl_op, lw_op, | 26 | lb_op, lh_op, lwl_op, lw_op, |
26 | lbu_op, lhu_op, lwr_op, lwu_op, | 27 | lbu_op, lhu_op, lwr_op, lwu_op, |
27 | sb_op, sh_op, swl_op, sw_op, | 28 | sb_op, sh_op, swl_op, sw_op, |
28 | sdl_op, sdr_op, swr_op, cache_op, | 29 | sdl_op, sdr_op, swr_op, cache_op, |
29 | ll_op, lwc1_op, lwc2_op, pref_op, | 30 | ll_op, lwc1_op, lwc2_op, pref_op, |
30 | lld_op, ldc1_op, ldc2_op, ld_op, | 31 | lld_op, ldc1_op, ldc2_op, ld_op, |
31 | sc_op, swc1_op, swc2_op, rdhwr_op, | 32 | sc_op, swc1_op, swc2_op, major_3b_op, |
32 | scd_op, sdc1_op, sdc2_op, sd_op | 33 | scd_op, sdc1_op, sdc2_op, sd_op |
33 | }; | 34 | }; |
34 | 35 | ||
@@ -37,7 +38,7 @@ enum major_op { | |||
37 | */ | 38 | */ |
38 | enum spec_op { | 39 | enum spec_op { |
39 | sll_op, movc_op, srl_op, sra_op, | 40 | sll_op, movc_op, srl_op, sra_op, |
40 | sllv_op, srlv_op, srav_op, spec1_unused_op, /* Opcode 0x07 is unused */ | 41 | sllv_op, pmon_op, srlv_op, srav_op, |
41 | jr_op, jalr_op, movz_op, movn_op, | 42 | jr_op, jalr_op, movz_op, movn_op, |
42 | syscall_op, break_op, spim_op, sync_op, | 43 | syscall_op, break_op, spim_op, sync_op, |
43 | mfhi_op, mthi_op, mflo_op, mtlo_op, | 44 | mfhi_op, mthi_op, mflo_op, mtlo_op, |
@@ -55,6 +56,28 @@ enum spec_op { | |||
55 | }; | 56 | }; |
56 | 57 | ||
57 | /* | 58 | /* |
59 | * func field of spec2 opcode. | ||
60 | */ | ||
61 | enum spec2_op { | ||
62 | madd_op, maddu_op, mul_op, spec2_3_unused_op, | ||
63 | msub_op, msubu_op, /* more unused ops */ | ||
64 | clz_op = 0x20, clo_op, | ||
65 | dclz_op = 0x24, dclo_op, | ||
66 | sdbpp_op = 0x3f | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * func field of spec3 opcode. | ||
71 | */ | ||
72 | enum spec3_op { | ||
73 | ext_op, dextm_op, dextu_op, dext_op, | ||
74 | ins_op, dinsm_op, dinsu_op, dins_op, | ||
75 | bshfl_op = 0x20, | ||
76 | dbshfl_op = 0x24, | ||
77 | rdhwr_op = 0x3f | ||
78 | }; | ||
79 | |||
80 | /* | ||
58 | * rt field of bcond opcodes. | 81 | * rt field of bcond opcodes. |
59 | */ | 82 | */ |
60 | enum rt_op { | 83 | enum rt_op { |
@@ -151,8 +174,8 @@ enum cop1x_func { | |||
151 | * func field for mad opcodes (MIPS IV). | 174 | * func field for mad opcodes (MIPS IV). |
152 | */ | 175 | */ |
153 | enum mad_func { | 176 | enum mad_func { |
154 | madd_op = 0x08, msub_op = 0x0a, | 177 | madd_fp_op = 0x08, msub_fp_op = 0x0a, |
155 | nmadd_op = 0x0c, nmsub_op = 0x0e | 178 | nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e |
156 | }; | 179 | }; |
157 | 180 | ||
158 | /* | 181 | /* |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index a2ef579f6b1a..5af7517fce8a 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -291,7 +291,7 @@ | |||
291 | #define ST0_DL (_ULCAST_(1) << 24) | 291 | #define ST0_DL (_ULCAST_(1) << 24) |
292 | 292 | ||
293 | /* | 293 | /* |
294 | * Enable the MIPS DSP ASE | 294 | * Enable the MIPS MDMX and DSP ASEs |
295 | */ | 295 | */ |
296 | #define ST0_MX 0x01000000 | 296 | #define ST0_MX 0x01000000 |
297 | 297 | ||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index a1eab136ff6c..4035ec79ecd4 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -139,9 +139,11 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
139 | 139 | ||
140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
141 | 141 | ||
142 | #ifndef CONFIG_SPARSEMEM | ||
142 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 143 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
143 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 144 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
144 | #endif | 145 | #endif |
146 | #endif | ||
145 | 147 | ||
146 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 148 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) |
147 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 149 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h index 4d6bc45df594..087c20769256 100644 --- a/include/asm-mips/pgtable-32.h +++ b/include/asm-mips/pgtable-32.h | |||
@@ -177,48 +177,67 @@ pfn_pte(unsigned long pfn, pgprot_t prot) | |||
177 | ((swp_entry_t) { ((type) << 10) | ((offset) << 15) }) | 177 | ((swp_entry_t) { ((type) << 10) | ((offset) << 15) }) |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * Bits 0, 1, 2, 9 and 10 are taken, split up the 27 bits of offset | 180 | * Bits 0, 4, 8, and 9 are taken, split up 28 bits of offset into this range: |
181 | * into this range: | ||
182 | */ | 181 | */ |
183 | #define PTE_FILE_MAX_BITS 27 | 182 | #define PTE_FILE_MAX_BITS 28 |
184 | 183 | ||
185 | #define pte_to_pgoff(_pte) \ | 184 | #define pte_to_pgoff(_pte) ((((_pte).pte >> 1 ) & 0x07) | \ |
186 | ((((_pte).pte >> 3) & 0x3f ) + (((_pte).pte >> 11) << 8 )) | 185 | (((_pte).pte >> 2 ) & 0x38) | \ |
186 | (((_pte).pte >> 10) << 6 )) | ||
187 | 187 | ||
188 | #define pgoff_to_pte(off) \ | 188 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x07) << 1 ) | \ |
189 | ((pte_t) { (((off) & 0x3f) << 3) + (((off) >> 8) << 11) + _PAGE_FILE }) | 189 | (((off) & 0x38) << 2 ) | \ |
190 | (((off) >> 6 ) << 10) | \ | ||
191 | _PAGE_FILE }) | ||
190 | 192 | ||
191 | #else | 193 | #else |
192 | 194 | ||
193 | /* Swap entries must have VALID and GLOBAL bits cleared. */ | 195 | /* Swap entries must have VALID and GLOBAL bits cleared. */ |
196 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
197 | #define __swp_type(x) (((x).val >> 2) & 0x1f) | ||
198 | #define __swp_offset(x) ((x).val >> 7) | ||
199 | #define __swp_entry(type,offset) \ | ||
200 | ((swp_entry_t) { ((type) << 2) | ((offset) << 7) }) | ||
201 | #else | ||
194 | #define __swp_type(x) (((x).val >> 8) & 0x1f) | 202 | #define __swp_type(x) (((x).val >> 8) & 0x1f) |
195 | #define __swp_offset(x) ((x).val >> 13) | 203 | #define __swp_offset(x) ((x).val >> 13) |
196 | #define __swp_entry(type,offset) \ | 204 | #define __swp_entry(type,offset) \ |
197 | ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) | 205 | ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) |
206 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ | ||
198 | 207 | ||
208 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
199 | /* | 209 | /* |
200 | * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset | 210 | * Bits 0 and 1 of pte_high are taken, use the rest for the page offset... |
201 | * into this range: | ||
202 | */ | 211 | */ |
203 | #define PTE_FILE_MAX_BITS 27 | 212 | #define PTE_FILE_MAX_BITS 30 |
204 | 213 | ||
205 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 214 | #define pte_to_pgoff(_pte) ((_pte).pte_high >> 2) |
206 | /* fixme */ | 215 | #define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) << 2 }) |
207 | #define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f)) | ||
208 | #define pgoff_to_pte(off) \ | ||
209 | ((pte_t){(((off) & 0x3f) + ((off) << 6) + _PAGE_FILE)}) | ||
210 | 216 | ||
211 | #else | 217 | #else |
212 | #define pte_to_pgoff(_pte) \ | 218 | /* |
213 | ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) | 219 | * Bits 0, 4, 6, and 7 are taken, split up 28 bits of offset into this range: |
220 | */ | ||
221 | #define PTE_FILE_MAX_BITS 28 | ||
222 | |||
223 | #define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) | \ | ||
224 | (((_pte).pte >> 2) & 0x8) | \ | ||
225 | (((_pte).pte >> 8) << 4)) | ||
214 | 226 | ||
215 | #define pgoff_to_pte(off) \ | 227 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) | \ |
216 | ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE }) | 228 | (((off) & 0x8) << 2) | \ |
229 | (((off) >> 4) << 8) | \ | ||
230 | _PAGE_FILE }) | ||
217 | #endif | 231 | #endif |
218 | 232 | ||
219 | #endif | 233 | #endif |
220 | 234 | ||
235 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
236 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high }) | ||
237 | #define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val }) | ||
238 | #else | ||
221 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 239 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
222 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 240 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
241 | #endif | ||
223 | 242 | ||
224 | #endif /* _ASM_PGTABLE_32_H */ | 243 | #endif /* _ASM_PGTABLE_32_H */ |
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index 82166b254b27..2faf5c9ff127 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -224,15 +224,12 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) | |||
224 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 224 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
225 | 225 | ||
226 | /* | 226 | /* |
227 | * Bits 0, 1, 2, 7 and 8 are taken, split up the 32 bits of offset | 227 | * Bits 0, 4, 6, and 7 are taken. Let's leave bits 1, 2, 3, and 5 alone to |
228 | * into this range: | 228 | * make things easier, and only use the upper 56 bits for the page offset... |
229 | */ | 229 | */ |
230 | #define PTE_FILE_MAX_BITS 32 | 230 | #define PTE_FILE_MAX_BITS 56 |
231 | 231 | ||
232 | #define pte_to_pgoff(_pte) \ | 232 | #define pte_to_pgoff(_pte) ((_pte).pte >> 8) |
233 | ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) | 233 | #define pgoff_to_pte(off) ((pte_t) { ((off) << 8) | _PAGE_FILE }) |
234 | |||
235 | #define pgoff_to_pte(off) \ | ||
236 | ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE }) | ||
237 | 234 | ||
238 | #endif /* _ASM_PGTABLE_64_H */ | 235 | #endif /* _ASM_PGTABLE_64_H */ |
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 702a28fa7a34..d0af2a3b0152 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -70,7 +70,15 @@ extern unsigned long zero_page_mask; | |||
70 | #define ZERO_PAGE(vaddr) \ | 70 | #define ZERO_PAGE(vaddr) \ |
71 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) | 71 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) |
72 | 72 | ||
73 | #define __HAVE_ARCH_MULTIPLE_ZERO_PAGE | 73 | #define __HAVE_ARCH_MOVE_PTE |
74 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
75 | ({ \ | ||
76 | pte_t newpte = (pte); \ | ||
77 | if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \ | ||
78 | pte_page(pte) == ZERO_PAGE(old_addr)) \ | ||
79 | newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \ | ||
80 | newpte; \ | ||
81 | }) | ||
74 | 82 | ||
75 | extern void paging_init(void); | 83 | extern void paging_init(void); |
76 | 84 | ||
@@ -82,10 +90,11 @@ extern void paging_init(void); | |||
82 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) | 90 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) |
83 | #define pmd_page_kernel(pmd) pmd_val(pmd) | 91 | #define pmd_page_kernel(pmd) pmd_val(pmd) |
84 | 92 | ||
85 | #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) | ||
86 | #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) | ||
87 | |||
88 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 93 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
94 | |||
95 | #define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL)) | ||
96 | #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT) | ||
97 | |||
89 | static inline void set_pte(pte_t *ptep, pte_t pte) | 98 | static inline void set_pte(pte_t *ptep, pte_t pte) |
90 | { | 99 | { |
91 | ptep->pte_high = pte.pte_high; | 100 | ptep->pte_high = pte.pte_high; |
@@ -93,27 +102,35 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
93 | ptep->pte_low = pte.pte_low; | 102 | ptep->pte_low = pte.pte_low; |
94 | //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low); | 103 | //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low); |
95 | 104 | ||
96 | if (pte_val(pte) & _PAGE_GLOBAL) { | 105 | if (pte.pte_low & _PAGE_GLOBAL) { |
97 | pte_t *buddy = ptep_buddy(ptep); | 106 | pte_t *buddy = ptep_buddy(ptep); |
98 | /* | 107 | /* |
99 | * Make sure the buddy is global too (if it's !none, | 108 | * Make sure the buddy is global too (if it's !none, |
100 | * it better already be global) | 109 | * it better already be global) |
101 | */ | 110 | */ |
102 | if (pte_none(*buddy)) | 111 | if (pte_none(*buddy)) { |
103 | buddy->pte_low |= _PAGE_GLOBAL; | 112 | buddy->pte_low |= _PAGE_GLOBAL; |
113 | buddy->pte_high |= _PAGE_GLOBAL; | ||
114 | } | ||
104 | } | 115 | } |
105 | } | 116 | } |
106 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 117 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) |
107 | 118 | ||
108 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 119 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
109 | { | 120 | { |
121 | pte_t null = __pte(0); | ||
122 | |||
110 | /* Preserve global status for the pair */ | 123 | /* Preserve global status for the pair */ |
111 | if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL) | 124 | if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL) |
112 | set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL)); | 125 | null.pte_low = null.pte_high = _PAGE_GLOBAL; |
113 | else | 126 | |
114 | set_pte_at(mm, addr, ptep, __pte(0)); | 127 | set_pte_at(mm, addr, ptep, null); |
115 | } | 128 | } |
116 | #else | 129 | #else |
130 | |||
131 | #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) | ||
132 | #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) | ||
133 | |||
117 | /* | 134 | /* |
118 | * Certain architectures need to do special things when pte's | 135 | * Certain architectures need to do special things when pte's |
119 | * within a page table are directly modified. Thus, the following | 136 | * within a page table are directly modified. Thus, the following |
@@ -174,75 +191,76 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
174 | */ | 191 | */ |
175 | static inline int pte_user(pte_t pte) { BUG(); return 0; } | 192 | static inline int pte_user(pte_t pte) { BUG(); return 0; } |
176 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 193 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
177 | static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_READ; } | 194 | static inline int pte_read(pte_t pte) { return pte.pte_low & _PAGE_READ; } |
178 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_WRITE; } | 195 | static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } |
179 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_MODIFIED; } | 196 | static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } |
180 | static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } | 197 | static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } |
181 | static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; } | 198 | static inline int pte_file(pte_t pte) { return pte.pte_low & _PAGE_FILE; } |
199 | |||
182 | static inline pte_t pte_wrprotect(pte_t pte) | 200 | static inline pte_t pte_wrprotect(pte_t pte) |
183 | { | 201 | { |
184 | (pte).pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); | 202 | pte.pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); |
185 | (pte).pte_high &= ~_PAGE_SILENT_WRITE; | 203 | pte.pte_high &= ~_PAGE_SILENT_WRITE; |
186 | return pte; | 204 | return pte; |
187 | } | 205 | } |
188 | 206 | ||
189 | static inline pte_t pte_rdprotect(pte_t pte) | 207 | static inline pte_t pte_rdprotect(pte_t pte) |
190 | { | 208 | { |
191 | (pte).pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ); | 209 | pte.pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ); |
192 | (pte).pte_high &= ~_PAGE_SILENT_READ; | 210 | pte.pte_high &= ~_PAGE_SILENT_READ; |
193 | return pte; | 211 | return pte; |
194 | } | 212 | } |
195 | 213 | ||
196 | static inline pte_t pte_mkclean(pte_t pte) | 214 | static inline pte_t pte_mkclean(pte_t pte) |
197 | { | 215 | { |
198 | (pte).pte_low &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE); | 216 | pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); |
199 | (pte).pte_high &= ~_PAGE_SILENT_WRITE; | 217 | pte.pte_high &= ~_PAGE_SILENT_WRITE; |
200 | return pte; | 218 | return pte; |
201 | } | 219 | } |
202 | 220 | ||
203 | static inline pte_t pte_mkold(pte_t pte) | 221 | static inline pte_t pte_mkold(pte_t pte) |
204 | { | 222 | { |
205 | (pte).pte_low &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ); | 223 | pte.pte_low &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ); |
206 | (pte).pte_high &= ~_PAGE_SILENT_READ; | 224 | pte.pte_high &= ~_PAGE_SILENT_READ; |
207 | return pte; | 225 | return pte; |
208 | } | 226 | } |
209 | 227 | ||
210 | static inline pte_t pte_mkwrite(pte_t pte) | 228 | static inline pte_t pte_mkwrite(pte_t pte) |
211 | { | 229 | { |
212 | (pte).pte_low |= _PAGE_WRITE; | 230 | pte.pte_low |= _PAGE_WRITE; |
213 | if ((pte).pte_low & _PAGE_MODIFIED) { | 231 | if (pte.pte_low & _PAGE_MODIFIED) { |
214 | (pte).pte_low |= _PAGE_SILENT_WRITE; | 232 | pte.pte_low |= _PAGE_SILENT_WRITE; |
215 | (pte).pte_high |= _PAGE_SILENT_WRITE; | 233 | pte.pte_high |= _PAGE_SILENT_WRITE; |
216 | } | 234 | } |
217 | return pte; | 235 | return pte; |
218 | } | 236 | } |
219 | 237 | ||
220 | static inline pte_t pte_mkread(pte_t pte) | 238 | static inline pte_t pte_mkread(pte_t pte) |
221 | { | 239 | { |
222 | (pte).pte_low |= _PAGE_READ; | 240 | pte.pte_low |= _PAGE_READ; |
223 | if ((pte).pte_low & _PAGE_ACCESSED) { | 241 | if (pte.pte_low & _PAGE_ACCESSED) { |
224 | (pte).pte_low |= _PAGE_SILENT_READ; | 242 | pte.pte_low |= _PAGE_SILENT_READ; |
225 | (pte).pte_high |= _PAGE_SILENT_READ; | 243 | pte.pte_high |= _PAGE_SILENT_READ; |
226 | } | 244 | } |
227 | return pte; | 245 | return pte; |
228 | } | 246 | } |
229 | 247 | ||
230 | static inline pte_t pte_mkdirty(pte_t pte) | 248 | static inline pte_t pte_mkdirty(pte_t pte) |
231 | { | 249 | { |
232 | (pte).pte_low |= _PAGE_MODIFIED; | 250 | pte.pte_low |= _PAGE_MODIFIED; |
233 | if ((pte).pte_low & _PAGE_WRITE) { | 251 | if (pte.pte_low & _PAGE_WRITE) { |
234 | (pte).pte_low |= _PAGE_SILENT_WRITE; | 252 | pte.pte_low |= _PAGE_SILENT_WRITE; |
235 | (pte).pte_high |= _PAGE_SILENT_WRITE; | 253 | pte.pte_high |= _PAGE_SILENT_WRITE; |
236 | } | 254 | } |
237 | return pte; | 255 | return pte; |
238 | } | 256 | } |
239 | 257 | ||
240 | static inline pte_t pte_mkyoung(pte_t pte) | 258 | static inline pte_t pte_mkyoung(pte_t pte) |
241 | { | 259 | { |
242 | (pte).pte_low |= _PAGE_ACCESSED; | 260 | pte.pte_low |= _PAGE_ACCESSED; |
243 | if ((pte).pte_low & _PAGE_READ) | 261 | if (pte.pte_low & _PAGE_READ) |
244 | (pte).pte_low |= _PAGE_SILENT_READ; | 262 | pte.pte_low |= _PAGE_SILENT_READ; |
245 | (pte).pte_high |= _PAGE_SILENT_READ; | 263 | pte.pte_high |= _PAGE_SILENT_READ; |
246 | return pte; | 264 | return pte; |
247 | } | 265 | } |
248 | #else | 266 | #else |
@@ -335,8 +353,9 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot) | |||
335 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 353 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
336 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 354 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
337 | { | 355 | { |
338 | pte.pte_low &= _PAGE_CHG_MASK; | 356 | pte.pte_low &= _PAGE_CHG_MASK; |
339 | pte.pte_low |= pgprot_val(newprot); | 357 | pte.pte_high &= ~0x3f; |
358 | pte.pte_low |= pgprot_val(newprot); | ||
340 | pte.pte_high |= pgprot_val(newprot) & 0x3f; | 359 | pte.pte_high |= pgprot_val(newprot) & 0x3f; |
341 | return pte; | 360 | return pte; |
342 | } | 361 | } |
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h index 8edabb0be23f..cefa657dd04a 100644 --- a/include/asm-mips/sigcontext.h +++ b/include/asm-mips/sigcontext.h | |||
@@ -55,8 +55,14 @@ struct sigcontext { | |||
55 | struct sigcontext { | 55 | struct sigcontext { |
56 | unsigned long sc_regs[32]; | 56 | unsigned long sc_regs[32]; |
57 | unsigned long sc_fpregs[32]; | 57 | unsigned long sc_fpregs[32]; |
58 | unsigned long sc_hi[4]; | 58 | unsigned long sc_mdhi; |
59 | unsigned long sc_lo[4]; | 59 | unsigned long sc_hi1; |
60 | unsigned long sc_hi2; | ||
61 | unsigned long sc_hi3; | ||
62 | unsigned long sc_mdlo; | ||
63 | unsigned long sc_lo1; | ||
64 | unsigned long sc_lo2; | ||
65 | unsigned long sc_lo3; | ||
60 | unsigned long sc_pc; | 66 | unsigned long sc_pc; |
61 | unsigned int sc_fpc_csr; | 67 | unsigned int sc_fpc_csr; |
62 | unsigned int sc_used_math; | 68 | unsigned int sc_used_math; |
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h index 75c6fe7c2126..e14e4b69de21 100644 --- a/include/asm-mips/smp.h +++ b/include/asm-mips/smp.h | |||
@@ -48,7 +48,6 @@ extern struct call_data_struct *call_data; | |||
48 | #define SMP_CALL_FUNCTION 0x2 | 48 | #define SMP_CALL_FUNCTION 0x2 |
49 | 49 | ||
50 | extern cpumask_t phys_cpu_present_map; | 50 | extern cpumask_t phys_cpu_present_map; |
51 | extern cpumask_t cpu_online_map; | ||
52 | #define cpu_possible_map phys_cpu_present_map | 51 | #define cpu_possible_map phys_cpu_present_map |
53 | 52 | ||
54 | extern cpumask_t cpu_callout_map; | 53 | extern cpumask_t cpu_callout_map; |
@@ -86,9 +85,9 @@ extern void prom_init_secondary(void); | |||
86 | extern void plat_smp_setup(void); | 85 | extern void plat_smp_setup(void); |
87 | 86 | ||
88 | /* | 87 | /* |
89 | * Called after init_IRQ but before __cpu_up. | 88 | * Called in smp_prepare_cpus. |
90 | */ | 89 | */ |
91 | extern void prom_prepare_cpus(unsigned int max_cpus); | 90 | extern void plat_prepare_cpus(unsigned int max_cpus); |
92 | 91 | ||
93 | /* | 92 | /* |
94 | * Last chance for the board code to finish SMP initialization before | 93 | * Last chance for the board code to finish SMP initialization before |
diff --git a/include/asm-mips/sparsemem.h b/include/asm-mips/sparsemem.h new file mode 100644 index 000000000000..795ac6c23203 --- /dev/null +++ b/include/asm-mips/sparsemem.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _MIPS_SPARSEMEM_H | ||
2 | #define _MIPS_SPARSEMEM_H | ||
3 | #ifdef CONFIG_SPARSEMEM | ||
4 | |||
5 | /* | ||
6 | * SECTION_SIZE_BITS 2^N: how big each section will be | ||
7 | * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space | ||
8 | */ | ||
9 | #define SECTION_SIZE_BITS 28 | ||
10 | #define MAX_PHYSMEM_BITS 35 | ||
11 | |||
12 | #endif /* CONFIG_SPARSEMEM */ | ||
13 | #endif /* _MIPS_SPARSEMEM_H */ | ||
14 | |||
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index db0606c1abd4..bea727904287 100644 --- a/include/asm-s390/lowcore.h +++ b/include/asm-s390/lowcore.h | |||
@@ -98,8 +98,8 @@ | |||
98 | #define __LC_KERNEL_ASCE 0xD58 | 98 | #define __LC_KERNEL_ASCE 0xD58 |
99 | #define __LC_USER_ASCE 0xD60 | 99 | #define __LC_USER_ASCE 0xD60 |
100 | #define __LC_PANIC_STACK 0xD68 | 100 | #define __LC_PANIC_STACK 0xD68 |
101 | #define __LC_CPUID 0xD90 | 101 | #define __LC_CPUID 0xD80 |
102 | #define __LC_CPUADDR 0xD98 | 102 | #define __LC_CPUADDR 0xD88 |
103 | #define __LC_IPLDEV 0xDB8 | 103 | #define __LC_IPLDEV 0xDB8 |
104 | #define __LC_JIFFY_TIMER 0xDC0 | 104 | #define __LC_JIFFY_TIMER 0xDC0 |
105 | #define __LC_CURRENT 0xDD8 | 105 | #define __LC_CURRENT 0xDD8 |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index c44e7466534e..cd464f469a2c 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -689,6 +689,23 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p | |||
689 | #define pte_clear(mm,addr,ptep) \ | 689 | #define pte_clear(mm,addr,ptep) \ |
690 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) | 690 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) |
691 | 691 | ||
692 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
693 | #define __HAVE_ARCH_MOVE_PTE | ||
694 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
695 | ({ \ | ||
696 | pte_t newpte = (pte); \ | ||
697 | if (tlb_type != hypervisor && pte_present(pte)) { \ | ||
698 | unsigned long this_pfn = pte_pfn(pte); \ | ||
699 | \ | ||
700 | if (pfn_valid(this_pfn) && \ | ||
701 | (((old_addr) ^ (new_addr)) & (1 << 13))) \ | ||
702 | flush_dcache_page_all(current->mm, \ | ||
703 | pfn_to_page(this_pfn)); \ | ||
704 | } \ | ||
705 | newpte; \ | ||
706 | }) | ||
707 | #endif | ||
708 | |||
692 | extern pgd_t swapper_pg_dir[2048]; | 709 | extern pgd_t swapper_pg_dir[2048]; |
693 | extern pmd_t swapper_low_pmd_dir[2048]; | 710 | extern pmd_t swapper_low_pmd_dir[2048]; |
694 | 711 | ||
diff --git a/include/asm-um/irqflags.h b/include/asm-um/irqflags.h new file mode 100644 index 000000000000..659b9abdfdba --- /dev/null +++ b/include/asm-um/irqflags.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __UM_IRQFLAGS_H | ||
2 | #define __UM_IRQFLAGS_H | ||
3 | |||
4 | /* Empty for now */ | ||
5 | |||
6 | #endif | ||
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index bea5a015f667..16c734af9193 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h | |||
@@ -41,11 +41,11 @@ | |||
41 | 41 | ||
42 | #define __get_user(x, ptr) \ | 42 | #define __get_user(x, ptr) \ |
43 | ({ \ | 43 | ({ \ |
44 | const __typeof__(ptr) __private_ptr = ptr; \ | 44 | const __typeof__(*(ptr)) __user *__private_ptr = (ptr); \ |
45 | __typeof__(x) __private_val; \ | 45 | __typeof__(x) __private_val; \ |
46 | int __private_ret = -EFAULT; \ | 46 | int __private_ret = -EFAULT; \ |
47 | (x) = (__typeof__(*(__private_ptr)))0; \ | 47 | (x) = (__typeof__(*(__private_ptr)))0; \ |
48 | if (__copy_from_user((void *) &__private_val, (__private_ptr), \ | 48 | if (__copy_from_user((__force void *)&__private_val, (__private_ptr),\ |
49 | sizeof(*(__private_ptr))) == 0) { \ | 49 | sizeof(*(__private_ptr))) == 0) { \ |
50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ | 50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ |
51 | __private_ret = 0; \ | 51 | __private_ret = 0; \ |
@@ -62,7 +62,7 @@ | |||
62 | 62 | ||
63 | #define __put_user(x, ptr) \ | 63 | #define __put_user(x, ptr) \ |
64 | ({ \ | 64 | ({ \ |
65 | __typeof__(ptr) __private_ptr = ptr; \ | 65 | __typeof__(*(ptr)) __user *__private_ptr = ptr; \ |
66 | __typeof__(*(__private_ptr)) __private_val; \ | 66 | __typeof__(*(__private_ptr)) __private_val; \ |
67 | int __private_ret = -EFAULT; \ | 67 | int __private_ret = -EFAULT; \ |
68 | __private_val = (__typeof__(*(__private_ptr))) (x); \ | 68 | __private_val = (__typeof__(*(__private_ptr))) (x); \ |
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h index c98633af07d2..b4f8f4a41a6e 100644 --- a/include/asm-x86_64/elf.h +++ b/include/asm-x86_64/elf.h | |||
@@ -159,7 +159,7 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | |||
159 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) | 159 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) |
160 | 160 | ||
161 | /* 1GB for 64bit, 8MB for 32bit */ | 161 | /* 1GB for 64bit, 8MB for 32bit */ |
162 | #define STACK_RND_MASK (is_compat_task() ? 0x7ff : 0x3fffff) | 162 | #define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) |
163 | 163 | ||
164 | #endif | 164 | #endif |
165 | 165 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index 50e338d2ffda..ce1a756c4c30 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -345,6 +345,8 @@ struct input_absinfo { | |||
345 | #define KEY_SAVE 234 | 345 | #define KEY_SAVE 234 |
346 | #define KEY_DOCUMENTS 235 | 346 | #define KEY_DOCUMENTS 235 |
347 | 347 | ||
348 | #define KEY_BATTERY 236 | ||
349 | |||
348 | #define KEY_UNKNOWN 240 | 350 | #define KEY_UNKNOWN 240 |
349 | 351 | ||
350 | #define BTN_MISC 0x100 | 352 | #define BTN_MISC 0x100 |
@@ -577,14 +579,9 @@ struct input_absinfo { | |||
577 | * Switch events | 579 | * Switch events |
578 | */ | 580 | */ |
579 | 581 | ||
580 | #define SW_0 0x00 | 582 | #define SW_LID 0x00 /* set = lid shut */ |
581 | #define SW_1 0x01 | 583 | #define SW_TABLET_MODE 0x01 /* set = tablet mode */ |
582 | #define SW_2 0x02 | 584 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ |
583 | #define SW_3 0x03 | ||
584 | #define SW_4 0x04 | ||
585 | #define SW_5 0x05 | ||
586 | #define SW_6 0x06 | ||
587 | #define SW_7 0x07 | ||
588 | #define SW_MAX 0x0f | 585 | #define SW_MAX 0x0f |
589 | 586 | ||
590 | /* | 587 | /* |
diff --git a/include/linux/m48t86.h b/include/linux/m48t86.h index 9065199319d0..915d6b4f0f89 100644 --- a/include/linux/m48t86.h +++ b/include/linux/m48t86.h | |||
@@ -11,6 +11,6 @@ | |||
11 | 11 | ||
12 | struct m48t86_ops | 12 | struct m48t86_ops |
13 | { | 13 | { |
14 | void (*writeb)(unsigned char value, unsigned long addr); | 14 | void (*writebyte)(unsigned char value, unsigned long addr); |
15 | unsigned char (*readb)(unsigned long addr); | 15 | unsigned char (*readbyte)(unsigned long addr); |
16 | }; | 16 | }; |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 36740354d4db..2d8337150493 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/seqlock.h> | 15 | #include <linux/seqlock.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
18 | #include <asm/page.h> | ||
18 | 19 | ||
19 | /* Free memory management - zoned buddy allocator. */ | 20 | /* Free memory management - zoned buddy allocator. */ |
20 | #ifndef CONFIG_FORCE_MAX_ZONEORDER | 21 | #ifndef CONFIG_FORCE_MAX_ZONEORDER |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index dce2534ab7dc..c3fe769c9129 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1240,6 +1240,7 @@ | |||
1240 | #define PCI_DEVICE_ID_VIA_8380_0 0x0204 | 1240 | #define PCI_DEVICE_ID_VIA_8380_0 0x0204 |
1241 | #define PCI_DEVICE_ID_VIA_3238_0 0x0238 | 1241 | #define PCI_DEVICE_ID_VIA_3238_0 0x0238 |
1242 | #define PCI_DEVICE_ID_VIA_PT880 0x0258 | 1242 | #define PCI_DEVICE_ID_VIA_PT880 0x0258 |
1243 | #define PCI_DEVICE_ID_VIA_PT880ULTRA 0x0308 | ||
1243 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 | 1244 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 |
1244 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 | 1245 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 |
1245 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 | 1246 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 530ae3f4248c..fab5aed8ca31 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -73,11 +73,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
73 | int vt_waitactive(int vt); | 73 | int vt_waitactive(int vt); |
74 | void change_console(struct vc_data *new_vc); | 74 | void change_console(struct vc_data *new_vc); |
75 | void reset_vc(struct vc_data *vc); | 75 | void reset_vc(struct vc_data *vc); |
76 | #ifdef CONFIG_VT | ||
77 | int is_console_suspend_safe(void); | ||
78 | #else | ||
79 | static inline int is_console_suspend_safe(void) { return 1; } | ||
80 | #endif | ||
81 | 76 | ||
82 | /* | 77 | /* |
83 | * vc_screen.c shares this temporary buffer with the console write code so that | 78 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/net/compat.h b/include/net/compat.h index 8662b8f43df5..e65cbedb6abc 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | struct sock; | ||
7 | |||
6 | #if defined(CONFIG_COMPAT) | 8 | #if defined(CONFIG_COMPAT) |
7 | 9 | ||
8 | #include <linux/compat.h> | 10 | #include <linux/compat.h> |
@@ -23,7 +25,6 @@ struct compat_cmsghdr { | |||
23 | compat_int_t cmsg_type; | 25 | compat_int_t cmsg_type; |
24 | }; | 26 | }; |
25 | 27 | ||
26 | struct sock; | ||
27 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | 28 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); |
28 | 29 | ||
29 | #else /* defined(CONFIG_COMPAT) */ | 30 | #else /* defined(CONFIG_COMPAT) */ |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 293e920ca59d..d5147770ad47 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -1247,7 +1247,8 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee); | |||
1247 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); | 1247 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); |
1248 | extern void ieee80211_txb_free(struct ieee80211_txb *); | 1248 | extern void ieee80211_txb_free(struct ieee80211_txb *); |
1249 | extern int ieee80211_tx_frame(struct ieee80211_device *ieee, | 1249 | extern int ieee80211_tx_frame(struct ieee80211_device *ieee, |
1250 | struct ieee80211_hdr *frame, int len); | 1250 | struct ieee80211_hdr *frame, int hdr_len, |
1251 | int total_len, int encrypt_mpdu); | ||
1251 | 1252 | ||
1252 | /* ieee80211_rx.c */ | 1253 | /* ieee80211_rx.c */ |
1253 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | 1254 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index 703463a8828b..7a483ab4022f 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -310,7 +310,7 @@ extern void ieee80211softmac_stop(struct net_device *dev); | |||
310 | * - context set to the context data you want passed | 310 | * - context set to the context data you want passed |
311 | * The return value is 0, or an error. | 311 | * The return value is 0, or an error. |
312 | */ | 312 | */ |
313 | typedef void (*notify_function_ptr)(struct net_device *dev, void *context); | 313 | typedef void (*notify_function_ptr)(struct net_device *dev, int event_type, void *context); |
314 | 314 | ||
315 | #define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL); | 315 | #define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL); |
316 | #define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC); | 316 | #define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC); |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index b7f0388bd71c..01fa2ae98a85 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -456,6 +456,7 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) | |||
456 | 456 | ||
457 | return ret; | 457 | return ret; |
458 | } | 458 | } |
459 | EXPORT_SYMBOL_GPL(hrtimer_start); | ||
459 | 460 | ||
460 | /** | 461 | /** |
461 | * hrtimer_try_to_cancel - try to deactivate a timer | 462 | * hrtimer_try_to_cancel - try to deactivate a timer |
@@ -484,6 +485,7 @@ int hrtimer_try_to_cancel(struct hrtimer *timer) | |||
484 | return ret; | 485 | return ret; |
485 | 486 | ||
486 | } | 487 | } |
488 | EXPORT_SYMBOL_GPL(hrtimer_try_to_cancel); | ||
487 | 489 | ||
488 | /** | 490 | /** |
489 | * hrtimer_cancel - cancel a timer and wait for the handler to finish. | 491 | * hrtimer_cancel - cancel a timer and wait for the handler to finish. |
@@ -504,6 +506,7 @@ int hrtimer_cancel(struct hrtimer *timer) | |||
504 | cpu_relax(); | 506 | cpu_relax(); |
505 | } | 507 | } |
506 | } | 508 | } |
509 | EXPORT_SYMBOL_GPL(hrtimer_cancel); | ||
507 | 510 | ||
508 | /** | 511 | /** |
509 | * hrtimer_get_remaining - get remaining time for the timer | 512 | * hrtimer_get_remaining - get remaining time for the timer |
@@ -522,6 +525,7 @@ ktime_t hrtimer_get_remaining(const struct hrtimer *timer) | |||
522 | 525 | ||
523 | return rem; | 526 | return rem; |
524 | } | 527 | } |
528 | EXPORT_SYMBOL_GPL(hrtimer_get_remaining); | ||
525 | 529 | ||
526 | #ifdef CONFIG_NO_IDLE_HZ | 530 | #ifdef CONFIG_NO_IDLE_HZ |
527 | /** | 531 | /** |
@@ -580,6 +584,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, | |||
580 | timer->base = &bases[clock_id]; | 584 | timer->base = &bases[clock_id]; |
581 | timer->node.rb_parent = HRTIMER_INACTIVE; | 585 | timer->node.rb_parent = HRTIMER_INACTIVE; |
582 | } | 586 | } |
587 | EXPORT_SYMBOL_GPL(hrtimer_init); | ||
583 | 588 | ||
584 | /** | 589 | /** |
585 | * hrtimer_get_res - get the timer resolution for a clock | 590 | * hrtimer_get_res - get the timer resolution for a clock |
@@ -599,6 +604,7 @@ int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp) | |||
599 | 604 | ||
600 | return 0; | 605 | return 0; |
601 | } | 606 | } |
607 | EXPORT_SYMBOL_GPL(hrtimer_get_res); | ||
602 | 608 | ||
603 | /* | 609 | /* |
604 | * Expire the per base hrtimer-queue: | 610 | * Expire the per base hrtimer-queue: |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 1ae2b2cc3a54..70df5c0d957e 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -91,8 +91,8 @@ static void grow_zone_span(struct zone *zone, | |||
91 | if (start_pfn < zone->zone_start_pfn) | 91 | if (start_pfn < zone->zone_start_pfn) |
92 | zone->zone_start_pfn = start_pfn; | 92 | zone->zone_start_pfn = start_pfn; |
93 | 93 | ||
94 | if (end_pfn > old_zone_end_pfn) | 94 | zone->spanned_pages = max(old_zone_end_pfn, end_pfn) - |
95 | zone->spanned_pages = end_pfn - zone->zone_start_pfn; | 95 | zone->zone_start_pfn; |
96 | 96 | ||
97 | zone_span_writeunlock(zone); | 97 | zone_span_writeunlock(zone); |
98 | } | 98 | } |
@@ -106,8 +106,8 @@ static void grow_pgdat_span(struct pglist_data *pgdat, | |||
106 | if (start_pfn < pgdat->node_start_pfn) | 106 | if (start_pfn < pgdat->node_start_pfn) |
107 | pgdat->node_start_pfn = start_pfn; | 107 | pgdat->node_start_pfn = start_pfn; |
108 | 108 | ||
109 | if (end_pfn > old_pgdat_end_pfn) | 109 | pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) - |
110 | pgdat->node_spanned_pages = end_pfn - pgdat->node_start_pfn; | 110 | pgdat->node_start_pfn; |
111 | } | 111 | } |
112 | 112 | ||
113 | int online_pages(unsigned long pfn, unsigned long nr_pages) | 113 | int online_pages(unsigned long pfn, unsigned long nr_pages) |
@@ -207,11 +207,6 @@ typedef unsigned int kmem_bufctl_t; | |||
207 | #define BUFCTL_ACTIVE (((kmem_bufctl_t)(~0U))-2) | 207 | #define BUFCTL_ACTIVE (((kmem_bufctl_t)(~0U))-2) |
208 | #define SLAB_LIMIT (((kmem_bufctl_t)(~0U))-3) | 208 | #define SLAB_LIMIT (((kmem_bufctl_t)(~0U))-3) |
209 | 209 | ||
210 | /* Max number of objs-per-slab for caches which use off-slab slabs. | ||
211 | * Needed to avoid a possible looping condition in cache_grow(). | ||
212 | */ | ||
213 | static unsigned long offslab_limit; | ||
214 | |||
215 | /* | 210 | /* |
216 | * struct slab | 211 | * struct slab |
217 | * | 212 | * |
@@ -1356,12 +1351,6 @@ void __init kmem_cache_init(void) | |||
1356 | NULL, NULL); | 1351 | NULL, NULL); |
1357 | } | 1352 | } |
1358 | 1353 | ||
1359 | /* Inc off-slab bufctl limit until the ceiling is hit. */ | ||
1360 | if (!(OFF_SLAB(sizes->cs_cachep))) { | ||
1361 | offslab_limit = sizes->cs_size - sizeof(struct slab); | ||
1362 | offslab_limit /= sizeof(kmem_bufctl_t); | ||
1363 | } | ||
1364 | |||
1365 | sizes->cs_dmacachep = kmem_cache_create(names->name_dma, | 1354 | sizes->cs_dmacachep = kmem_cache_create(names->name_dma, |
1366 | sizes->cs_size, | 1355 | sizes->cs_size, |
1367 | ARCH_KMALLOC_MINALIGN, | 1356 | ARCH_KMALLOC_MINALIGN, |
@@ -1780,6 +1769,7 @@ static void set_up_list3s(struct kmem_cache *cachep, int index) | |||
1780 | static size_t calculate_slab_order(struct kmem_cache *cachep, | 1769 | static size_t calculate_slab_order(struct kmem_cache *cachep, |
1781 | size_t size, size_t align, unsigned long flags) | 1770 | size_t size, size_t align, unsigned long flags) |
1782 | { | 1771 | { |
1772 | unsigned long offslab_limit; | ||
1783 | size_t left_over = 0; | 1773 | size_t left_over = 0; |
1784 | int gfporder; | 1774 | int gfporder; |
1785 | 1775 | ||
@@ -1791,9 +1781,18 @@ static size_t calculate_slab_order(struct kmem_cache *cachep, | |||
1791 | if (!num) | 1781 | if (!num) |
1792 | continue; | 1782 | continue; |
1793 | 1783 | ||
1794 | /* More than offslab_limit objects will cause problems */ | 1784 | if (flags & CFLGS_OFF_SLAB) { |
1795 | if ((flags & CFLGS_OFF_SLAB) && num > offslab_limit) | 1785 | /* |
1796 | break; | 1786 | * Max number of objs-per-slab for caches which |
1787 | * use off-slab slabs. Needed to avoid a possible | ||
1788 | * looping condition in cache_grow(). | ||
1789 | */ | ||
1790 | offslab_limit = size - sizeof(struct slab); | ||
1791 | offslab_limit /= sizeof(kmem_bufctl_t); | ||
1792 | |||
1793 | if (num > offslab_limit) | ||
1794 | break; | ||
1795 | } | ||
1797 | 1796 | ||
1798 | /* Found something acceptable - save it away */ | 1797 | /* Found something acceptable - save it away */ |
1799 | cachep->num = num; | 1798 | cachep->num = num; |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index ad1c7af65ec8..f5d47bf4f967 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -300,25 +300,20 @@ int br_add_bridge(const char *name) | |||
300 | rtnl_lock(); | 300 | rtnl_lock(); |
301 | if (strchr(dev->name, '%')) { | 301 | if (strchr(dev->name, '%')) { |
302 | ret = dev_alloc_name(dev, dev->name); | 302 | ret = dev_alloc_name(dev, dev->name); |
303 | if (ret < 0) | 303 | if (ret < 0) { |
304 | goto err1; | 304 | free_netdev(dev); |
305 | goto out; | ||
306 | } | ||
305 | } | 307 | } |
306 | 308 | ||
307 | ret = register_netdevice(dev); | 309 | ret = register_netdevice(dev); |
308 | if (ret) | 310 | if (ret) |
309 | goto err2; | 311 | goto out; |
310 | 312 | ||
311 | ret = br_sysfs_addbr(dev); | 313 | ret = br_sysfs_addbr(dev); |
312 | if (ret) | 314 | if (ret) |
313 | goto err3; | 315 | unregister_netdevice(dev); |
314 | rtnl_unlock(); | 316 | out: |
315 | return 0; | ||
316 | |||
317 | err3: | ||
318 | unregister_netdev(dev); | ||
319 | err2: | ||
320 | free_netdev(dev); | ||
321 | err1: | ||
322 | rtnl_unlock(); | 317 | rtnl_unlock(); |
323 | return ret; | 318 | return ret; |
324 | } | 319 | } |
diff --git a/net/ethernet/Makefile b/net/ethernet/Makefile index 69b74a9a0fc3..7cef1d8ace27 100644 --- a/net/ethernet/Makefile +++ b/net/ethernet/Makefile | |||
@@ -3,6 +3,5 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y += eth.o | 5 | obj-y += eth.o |
6 | obj-$(CONFIG_SYSCTL) += sysctl_net_ether.o | ||
7 | obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o | 6 | obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o |
8 | obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o | 7 | obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o |
diff --git a/net/ethernet/sysctl_net_ether.c b/net/ethernet/sysctl_net_ether.c deleted file mode 100644 index 66b39fc342d2..000000000000 --- a/net/ethernet/sysctl_net_ether.c +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | /* -*- linux-c -*- | ||
2 | * sysctl_net_ether.c: sysctl interface to net Ethernet subsystem. | ||
3 | * | ||
4 | * Begun April 1, 1996, Mike Shaver. | ||
5 | * Added /proc/sys/net/ether directory entry (empty =) ). [MS] | ||
6 | */ | ||
7 | |||
8 | #include <linux/mm.h> | ||
9 | #include <linux/sysctl.h> | ||
10 | #include <linux/if_ether.h> | ||
11 | |||
12 | ctl_table ether_table[] = { | ||
13 | {0} | ||
14 | }; | ||
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c index 233d527c6953..6a5de1b84459 100644 --- a/net/ieee80211/ieee80211_tx.c +++ b/net/ieee80211/ieee80211_tx.c | |||
@@ -555,7 +555,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
555 | /* Incoming 802.11 strucure is converted to a TXB | 555 | /* Incoming 802.11 strucure is converted to a TXB |
556 | * a block of 802.11 fragment packets (stored as skbs) */ | 556 | * a block of 802.11 fragment packets (stored as skbs) */ |
557 | int ieee80211_tx_frame(struct ieee80211_device *ieee, | 557 | int ieee80211_tx_frame(struct ieee80211_device *ieee, |
558 | struct ieee80211_hdr *frame, int len) | 558 | struct ieee80211_hdr *frame, int hdr_len, int total_len, |
559 | int encrypt_mpdu) | ||
559 | { | 560 | { |
560 | struct ieee80211_txb *txb = NULL; | 561 | struct ieee80211_txb *txb = NULL; |
561 | unsigned long flags; | 562 | unsigned long flags; |
@@ -565,6 +566,9 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee, | |||
565 | 566 | ||
566 | spin_lock_irqsave(&ieee->lock, flags); | 567 | spin_lock_irqsave(&ieee->lock, flags); |
567 | 568 | ||
569 | if (encrypt_mpdu && !ieee->sec.encrypt) | ||
570 | encrypt_mpdu = 0; | ||
571 | |||
568 | /* If there is no driver handler to take the TXB, dont' bother | 572 | /* If there is no driver handler to take the TXB, dont' bother |
569 | * creating it... */ | 573 | * creating it... */ |
570 | if (!ieee->hard_start_xmit) { | 574 | if (!ieee->hard_start_xmit) { |
@@ -572,32 +576,41 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee, | |||
572 | goto success; | 576 | goto success; |
573 | } | 577 | } |
574 | 578 | ||
575 | if (unlikely(len < 24)) { | 579 | if (unlikely(total_len < 24)) { |
576 | printk(KERN_WARNING "%s: skb too small (%d).\n", | 580 | printk(KERN_WARNING "%s: skb too small (%d).\n", |
577 | ieee->dev->name, len); | 581 | ieee->dev->name, total_len); |
578 | goto success; | 582 | goto success; |
579 | } | 583 | } |
580 | 584 | ||
585 | if (encrypt_mpdu) | ||
586 | frame->frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); | ||
587 | |||
581 | /* When we allocate the TXB we allocate enough space for the reserve | 588 | /* When we allocate the TXB we allocate enough space for the reserve |
582 | * and full fragment bytes (bytes_per_frag doesn't include prefix, | 589 | * and full fragment bytes (bytes_per_frag doesn't include prefix, |
583 | * postfix, header, FCS, etc.) */ | 590 | * postfix, header, FCS, etc.) */ |
584 | txb = ieee80211_alloc_txb(1, len, ieee->tx_headroom, GFP_ATOMIC); | 591 | txb = ieee80211_alloc_txb(1, total_len, ieee->tx_headroom, GFP_ATOMIC); |
585 | if (unlikely(!txb)) { | 592 | if (unlikely(!txb)) { |
586 | printk(KERN_WARNING "%s: Could not allocate TXB\n", | 593 | printk(KERN_WARNING "%s: Could not allocate TXB\n", |
587 | ieee->dev->name); | 594 | ieee->dev->name); |
588 | goto failed; | 595 | goto failed; |
589 | } | 596 | } |
590 | txb->encrypted = 0; | 597 | txb->encrypted = 0; |
591 | txb->payload_size = len; | 598 | txb->payload_size = total_len; |
592 | 599 | ||
593 | skb_frag = txb->fragments[0]; | 600 | skb_frag = txb->fragments[0]; |
594 | 601 | ||
595 | memcpy(skb_put(skb_frag, len), frame, len); | 602 | memcpy(skb_put(skb_frag, total_len), frame, total_len); |
596 | 603 | ||
597 | if (ieee->config & | 604 | if (ieee->config & |
598 | (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) | 605 | (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) |
599 | skb_put(skb_frag, 4); | 606 | skb_put(skb_frag, 4); |
600 | 607 | ||
608 | /* To avoid overcomplicating things, we do the corner-case frame | ||
609 | * encryption in software. The only real situation where encryption is | ||
610 | * needed here is during software-based shared key authentication. */ | ||
611 | if (encrypt_mpdu) | ||
612 | ieee80211_encrypt_fragment(ieee, skb_frag, hdr_len); | ||
613 | |||
601 | success: | 614 | success: |
602 | spin_unlock_irqrestore(&ieee->lock, flags); | 615 | spin_unlock_irqrestore(&ieee->lock, flags); |
603 | 616 | ||
diff --git a/net/ieee80211/softmac/Kconfig b/net/ieee80211/softmac/Kconfig index f2a27cc6ecb1..2811651cb134 100644 --- a/net/ieee80211/softmac/Kconfig +++ b/net/ieee80211/softmac/Kconfig | |||
@@ -2,6 +2,7 @@ config IEEE80211_SOFTMAC | |||
2 | tristate "Software MAC add-on to the IEEE 802.11 networking stack" | 2 | tristate "Software MAC add-on to the IEEE 802.11 networking stack" |
3 | depends on IEEE80211 && EXPERIMENTAL | 3 | depends on IEEE80211 && EXPERIMENTAL |
4 | select WIRELESS_EXT | 4 | select WIRELESS_EXT |
5 | select IEEE80211_CRYPT_WEP | ||
5 | ---help--- | 6 | ---help--- |
6 | This option enables the hardware independent software MAC addon | 7 | This option enables the hardware independent software MAC addon |
7 | for the IEEE 802.11 networking stack. | 8 | for the IEEE 802.11 networking stack. |
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c index 5d90b9a6ee50..5e9a90651d04 100644 --- a/net/ieee80211/softmac/ieee80211softmac_assoc.c +++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c | |||
@@ -164,12 +164,28 @@ network_matches_request(struct ieee80211softmac_device *mac, struct ieee80211_ne | |||
164 | } | 164 | } |
165 | 165 | ||
166 | static void | 166 | static void |
167 | ieee80211softmac_assoc_notify(struct net_device *dev, void *context) | 167 | ieee80211softmac_assoc_notify_scan(struct net_device *dev, int event_type, void *context) |
168 | { | 168 | { |
169 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 169 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
170 | ieee80211softmac_assoc_work((void*)mac); | 170 | ieee80211softmac_assoc_work((void*)mac); |
171 | } | 171 | } |
172 | 172 | ||
173 | static void | ||
174 | ieee80211softmac_assoc_notify_auth(struct net_device *dev, int event_type, void *context) | ||
175 | { | ||
176 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | ||
177 | |||
178 | switch (event_type) { | ||
179 | case IEEE80211SOFTMAC_EVENT_AUTHENTICATED: | ||
180 | ieee80211softmac_assoc_work((void*)mac); | ||
181 | break; | ||
182 | case IEEE80211SOFTMAC_EVENT_AUTH_FAILED: | ||
183 | case IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT: | ||
184 | ieee80211softmac_disassoc(mac); | ||
185 | break; | ||
186 | } | ||
187 | } | ||
188 | |||
173 | /* This function is called to handle userspace requests (asynchronously) */ | 189 | /* This function is called to handle userspace requests (asynchronously) */ |
174 | void | 190 | void |
175 | ieee80211softmac_assoc_work(void *d) | 191 | ieee80211softmac_assoc_work(void *d) |
@@ -249,7 +265,7 @@ ieee80211softmac_assoc_work(void *d) | |||
249 | * Maybe we can hope to have more memory after scanning finishes ;) | 265 | * Maybe we can hope to have more memory after scanning finishes ;) |
250 | */ | 266 | */ |
251 | dprintk(KERN_INFO PFX "Associate: Scanning for networks first.\n"); | 267 | dprintk(KERN_INFO PFX "Associate: Scanning for networks first.\n"); |
252 | ieee80211softmac_notify(mac->dev, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, ieee80211softmac_assoc_notify, NULL); | 268 | ieee80211softmac_notify(mac->dev, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, ieee80211softmac_assoc_notify_scan, NULL); |
253 | if (ieee80211softmac_start_scan(mac)) | 269 | if (ieee80211softmac_start_scan(mac)) |
254 | dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n"); | 270 | dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n"); |
255 | return; | 271 | return; |
@@ -284,7 +300,7 @@ ieee80211softmac_assoc_work(void *d) | |||
284 | * otherwise adding the notification would be racy. */ | 300 | * otherwise adding the notification would be racy. */ |
285 | if (!ieee80211softmac_auth_req(mac, found)) { | 301 | if (!ieee80211softmac_auth_req(mac, found)) { |
286 | dprintk(KERN_INFO PFX "cannot associate without being authenticated, requested authentication\n"); | 302 | dprintk(KERN_INFO PFX "cannot associate without being authenticated, requested authentication\n"); |
287 | ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify, NULL, GFP_KERNEL); | 303 | ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify_auth, NULL, GFP_KERNEL); |
288 | } else { | 304 | } else { |
289 | printkl(KERN_WARNING PFX "Not authenticated, but requesting authentication failed. Giving up to associate\n"); | 305 | printkl(KERN_WARNING PFX "Not authenticated, but requesting authentication failed. Giving up to associate\n"); |
290 | ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, found); | 306 | ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, found); |
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c index 084b6211f293..90b8484e509b 100644 --- a/net/ieee80211/softmac/ieee80211softmac_auth.c +++ b/net/ieee80211/softmac/ieee80211softmac_auth.c | |||
@@ -107,6 +107,7 @@ ieee80211softmac_auth_queue(void *data) | |||
107 | printkl(KERN_WARNING PFX "Authentication timed out with "MAC_FMT"\n", MAC_ARG(net->bssid)); | 107 | printkl(KERN_WARNING PFX "Authentication timed out with "MAC_FMT"\n", MAC_ARG(net->bssid)); |
108 | /* Remove this item from the queue */ | 108 | /* Remove this item from the queue */ |
109 | spin_lock_irqsave(&mac->lock, flags); | 109 | spin_lock_irqsave(&mac->lock, flags); |
110 | net->authenticating = 0; | ||
110 | ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT, net); | 111 | ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT, net); |
111 | cancel_delayed_work(&auth->work); /* just to make sure... */ | 112 | cancel_delayed_work(&auth->work); /* just to make sure... */ |
112 | list_del(&auth->list); | 113 | list_del(&auth->list); |
@@ -212,13 +213,13 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
212 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; | 213 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; |
213 | spin_unlock_irqrestore(&mac->lock, flags); | 214 | spin_unlock_irqrestore(&mac->lock, flags); |
214 | 215 | ||
215 | /* Switch to correct channel for this network */ | 216 | /* Send our response */ |
216 | mac->set_channel(mac->dev, net->channel); | ||
217 | |||
218 | /* Send our response (How to encrypt?) */ | ||
219 | ieee80211softmac_send_mgt_frame(mac, aq->net, IEEE80211_STYPE_AUTH, aq->state); | 217 | ieee80211softmac_send_mgt_frame(mac, aq->net, IEEE80211_STYPE_AUTH, aq->state); |
220 | break; | 218 | return 0; |
221 | case IEEE80211SOFTMAC_AUTH_SHARED_PASS: | 219 | case IEEE80211SOFTMAC_AUTH_SHARED_PASS: |
220 | kfree(net->challenge); | ||
221 | net->challenge = NULL; | ||
222 | net->challenge_len = 0; | ||
222 | /* Check the status code of the response */ | 223 | /* Check the status code of the response */ |
223 | switch(auth->status) { | 224 | switch(auth->status) { |
224 | case WLAN_STATUS_SUCCESS: | 225 | case WLAN_STATUS_SUCCESS: |
@@ -229,6 +230,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
229 | spin_unlock_irqrestore(&mac->lock, flags); | 230 | spin_unlock_irqrestore(&mac->lock, flags); |
230 | printkl(KERN_NOTICE PFX "Shared Key Authentication completed with "MAC_FMT"\n", | 231 | printkl(KERN_NOTICE PFX "Shared Key Authentication completed with "MAC_FMT"\n", |
231 | MAC_ARG(net->bssid)); | 232 | MAC_ARG(net->bssid)); |
233 | ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net); | ||
232 | break; | 234 | break; |
233 | default: | 235 | default: |
234 | printkl(KERN_NOTICE PFX "Shared Key Authentication with "MAC_FMT" failed, error code: %i\n", | 236 | printkl(KERN_NOTICE PFX "Shared Key Authentication with "MAC_FMT" failed, error code: %i\n", |
diff --git a/net/ieee80211/softmac/ieee80211softmac_event.c b/net/ieee80211/softmac/ieee80211softmac_event.c index 4b153f7cc96c..f34fa2ef666b 100644 --- a/net/ieee80211/softmac/ieee80211softmac_event.c +++ b/net/ieee80211/softmac/ieee80211softmac_event.c | |||
@@ -78,7 +78,7 @@ ieee80211softmac_notify_callback(void *d) | |||
78 | struct ieee80211softmac_event event = *(struct ieee80211softmac_event*) d; | 78 | struct ieee80211softmac_event event = *(struct ieee80211softmac_event*) d; |
79 | kfree(d); | 79 | kfree(d); |
80 | 80 | ||
81 | event.fun(event.mac->dev, event.context); | 81 | event.fun(event.mac->dev, event.event_type, event.context); |
82 | } | 82 | } |
83 | 83 | ||
84 | int | 84 | int |
@@ -167,6 +167,9 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve | |||
167 | if ((eventptr->event_type == event || eventptr->event_type == -1) | 167 | if ((eventptr->event_type == event || eventptr->event_type == -1) |
168 | && (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) { | 168 | && (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) { |
169 | list_del(&eventptr->list); | 169 | list_del(&eventptr->list); |
170 | /* User may have subscribed to ANY event, so | ||
171 | * we tell them which event triggered it. */ | ||
172 | eventptr->event_type = event; | ||
170 | schedule_work(&eventptr->work); | 173 | schedule_work(&eventptr->work); |
171 | } | 174 | } |
172 | } | 175 | } |
diff --git a/net/ieee80211/softmac/ieee80211softmac_io.c b/net/ieee80211/softmac/ieee80211softmac_io.c index cc6cd56c85b1..09541611e48c 100644 --- a/net/ieee80211/softmac/ieee80211softmac_io.c +++ b/net/ieee80211/softmac/ieee80211softmac_io.c | |||
@@ -149,6 +149,56 @@ ieee80211softmac_hdr_3addr(struct ieee80211softmac_device *mac, | |||
149 | * shouldn't the sequence number be in ieee80211? */ | 149 | * shouldn't the sequence number be in ieee80211? */ |
150 | } | 150 | } |
151 | 151 | ||
152 | static u16 | ||
153 | ieee80211softmac_capabilities(struct ieee80211softmac_device *mac, | ||
154 | struct ieee80211softmac_network *net) | ||
155 | { | ||
156 | u16 capability = 0; | ||
157 | |||
158 | /* ESS and IBSS bits are set according to the current mode */ | ||
159 | switch (mac->ieee->iw_mode) { | ||
160 | case IW_MODE_INFRA: | ||
161 | capability = cpu_to_le16(WLAN_CAPABILITY_ESS); | ||
162 | break; | ||
163 | case IW_MODE_ADHOC: | ||
164 | capability = cpu_to_le16(WLAN_CAPABILITY_IBSS); | ||
165 | break; | ||
166 | case IW_MODE_AUTO: | ||
167 | capability = net->capabilities & | ||
168 | (WLAN_CAPABILITY_ESS|WLAN_CAPABILITY_IBSS); | ||
169 | break; | ||
170 | default: | ||
171 | /* bleh. we don't ever go to these modes */ | ||
172 | printk(KERN_ERR PFX "invalid iw_mode!\n"); | ||
173 | break; | ||
174 | } | ||
175 | |||
176 | /* CF Pollable / CF Poll Request */ | ||
177 | /* Needs to be implemented, for now, the 0's == not supported */ | ||
178 | |||
179 | /* Privacy Bit */ | ||
180 | capability |= mac->ieee->sec.level ? | ||
181 | cpu_to_le16(WLAN_CAPABILITY_PRIVACY) : 0; | ||
182 | |||
183 | /* Short Preamble */ | ||
184 | /* Always supported: we probably won't ever be powering devices which | ||
185 | * dont support this... */ | ||
186 | capability |= WLAN_CAPABILITY_SHORT_PREAMBLE; | ||
187 | |||
188 | /* PBCC */ | ||
189 | /* Not widely used */ | ||
190 | |||
191 | /* Channel Agility */ | ||
192 | /* Not widely used */ | ||
193 | |||
194 | /* Short Slot */ | ||
195 | /* Will be implemented later */ | ||
196 | |||
197 | /* DSSS-OFDM */ | ||
198 | /* Not widely used */ | ||
199 | |||
200 | return capability; | ||
201 | } | ||
152 | 202 | ||
153 | /***************************************************************************** | 203 | /***************************************************************************** |
154 | * Create Management packets | 204 | * Create Management packets |
@@ -179,27 +229,6 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt, | |||
179 | return 0; | 229 | return 0; |
180 | ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid); | 230 | ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid); |
181 | 231 | ||
182 | /* Fill in capability Info */ | ||
183 | switch (mac->ieee->iw_mode) { | ||
184 | case IW_MODE_INFRA: | ||
185 | (*pkt)->capability = cpu_to_le16(WLAN_CAPABILITY_ESS); | ||
186 | break; | ||
187 | case IW_MODE_ADHOC: | ||
188 | (*pkt)->capability = cpu_to_le16(WLAN_CAPABILITY_IBSS); | ||
189 | break; | ||
190 | case IW_MODE_AUTO: | ||
191 | (*pkt)->capability = net->capabilities & (WLAN_CAPABILITY_ESS|WLAN_CAPABILITY_IBSS); | ||
192 | break; | ||
193 | default: | ||
194 | /* bleh. we don't ever go to these modes */ | ||
195 | printk(KERN_ERR PFX "invalid iw_mode!\n"); | ||
196 | break; | ||
197 | } | ||
198 | /* Need to add this | ||
199 | (*pkt)->capability |= mac->ieee->short_slot ? | ||
200 | cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME) : 0; | ||
201 | */ | ||
202 | (*pkt)->capability |= mac->ieee->sec.level ? cpu_to_le16(WLAN_CAPABILITY_PRIVACY) : 0; | ||
203 | /* Fill in Listen Interval (?) */ | 232 | /* Fill in Listen Interval (?) */ |
204 | (*pkt)->listen_interval = cpu_to_le16(10); | 233 | (*pkt)->listen_interval = cpu_to_le16(10); |
205 | 234 | ||
@@ -239,17 +268,9 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt, | |||
239 | return 0; | 268 | return 0; |
240 | ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_REASSOC_REQ, net->bssid, net->bssid); | 269 | ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_REASSOC_REQ, net->bssid, net->bssid); |
241 | 270 | ||
242 | /* Fill in capability Info */ | 271 | /* Fill in the capabilities */ |
243 | (*pkt)->capability = mac->ieee->iw_mode == IW_MODE_MASTER ? | 272 | (*pkt)->capability = ieee80211softmac_capabilities(mac, net); |
244 | cpu_to_le16(WLAN_CAPABILITY_ESS) : | 273 | |
245 | cpu_to_le16(WLAN_CAPABILITY_IBSS); | ||
246 | /* | ||
247 | (*pkt)->capability |= mac->ieee->short_slot ? | ||
248 | cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME) : 0; | ||
249 | */ | ||
250 | (*pkt)->capability |= mac->ieee->sec.level ? | ||
251 | cpu_to_le16(WLAN_CAPABILITY_PRIVACY) : 0; | ||
252 | |||
253 | /* Fill in Listen Interval (?) */ | 274 | /* Fill in Listen Interval (?) */ |
254 | (*pkt)->listen_interval = cpu_to_le16(10); | 275 | (*pkt)->listen_interval = cpu_to_le16(10); |
255 | /* Fill in the current AP MAC */ | 276 | /* Fill in the current AP MAC */ |
@@ -268,26 +289,27 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt, | |||
268 | static u32 | 289 | static u32 |
269 | ieee80211softmac_auth(struct ieee80211_auth **pkt, | 290 | ieee80211softmac_auth(struct ieee80211_auth **pkt, |
270 | struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net, | 291 | struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net, |
271 | u16 transaction, u16 status) | 292 | u16 transaction, u16 status, int *encrypt_mpdu) |
272 | { | 293 | { |
273 | u8 *data; | 294 | u8 *data; |
295 | int auth_mode = mac->ieee->sec.auth_mode; | ||
296 | int is_shared_response = (auth_mode == WLAN_AUTH_SHARED_KEY | ||
297 | && transaction == IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE); | ||
298 | |||
274 | /* Allocate Packet */ | 299 | /* Allocate Packet */ |
275 | (*pkt) = (struct ieee80211_auth *)ieee80211softmac_alloc_mgt( | 300 | (*pkt) = (struct ieee80211_auth *)ieee80211softmac_alloc_mgt( |
276 | 2 + /* Auth Algorithm */ | 301 | 2 + /* Auth Algorithm */ |
277 | 2 + /* Auth Transaction Seq */ | 302 | 2 + /* Auth Transaction Seq */ |
278 | 2 + /* Status Code */ | 303 | 2 + /* Status Code */ |
279 | /* Challenge Text IE */ | 304 | /* Challenge Text IE */ |
280 | mac->ieee->open_wep ? 0 : | 305 | is_shared_response ? 0 : 1 + 1 + net->challenge_len |
281 | 1 + 1 + WLAN_AUTH_CHALLENGE_LEN | 306 | ); |
282 | ); | ||
283 | if (unlikely((*pkt) == NULL)) | 307 | if (unlikely((*pkt) == NULL)) |
284 | return 0; | 308 | return 0; |
285 | ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_AUTH, net->bssid, net->bssid); | 309 | ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_AUTH, net->bssid, net->bssid); |
286 | 310 | ||
287 | /* Algorithm */ | 311 | /* Algorithm */ |
288 | (*pkt)->algorithm = mac->ieee->open_wep ? | 312 | (*pkt)->algorithm = cpu_to_le16(auth_mode); |
289 | cpu_to_le16(WLAN_AUTH_OPEN) : | ||
290 | cpu_to_le16(WLAN_AUTH_SHARED_KEY); | ||
291 | /* Transaction */ | 313 | /* Transaction */ |
292 | (*pkt)->transaction = cpu_to_le16(transaction); | 314 | (*pkt)->transaction = cpu_to_le16(transaction); |
293 | /* Status */ | 315 | /* Status */ |
@@ -295,18 +317,20 @@ ieee80211softmac_auth(struct ieee80211_auth **pkt, | |||
295 | 317 | ||
296 | data = (u8 *)(*pkt)->info_element; | 318 | data = (u8 *)(*pkt)->info_element; |
297 | /* Challenge Text */ | 319 | /* Challenge Text */ |
298 | if(!mac->ieee->open_wep){ | 320 | if (is_shared_response) { |
299 | *data = MFIE_TYPE_CHALLENGE; | 321 | *data = MFIE_TYPE_CHALLENGE; |
300 | data++; | 322 | data++; |
301 | 323 | ||
302 | /* Copy the challenge in */ | 324 | /* Copy the challenge in */ |
303 | // *data = challenge length | 325 | *data = net->challenge_len; |
304 | // data += sizeof(u16); | 326 | data++; |
305 | // memcpy(data, challenge, challenge length); | 327 | memcpy(data, net->challenge, net->challenge_len); |
306 | // data += challenge length; | 328 | data += net->challenge_len; |
307 | 329 | ||
308 | /* Add the full size to the packet length */ | 330 | /* Make sure this frame gets encrypted with the shared key */ |
309 | } | 331 | *encrypt_mpdu = 1; |
332 | } else | ||
333 | *encrypt_mpdu = 0; | ||
310 | 334 | ||
311 | /* Return the packet size */ | 335 | /* Return the packet size */ |
312 | return (data - (u8 *)(*pkt)); | 336 | return (data - (u8 *)(*pkt)); |
@@ -396,6 +420,7 @@ ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac, | |||
396 | { | 420 | { |
397 | void *pkt = NULL; | 421 | void *pkt = NULL; |
398 | u32 pkt_size = 0; | 422 | u32 pkt_size = 0; |
423 | int encrypt_mpdu = 0; | ||
399 | 424 | ||
400 | switch(type) { | 425 | switch(type) { |
401 | case IEEE80211_STYPE_ASSOC_REQ: | 426 | case IEEE80211_STYPE_ASSOC_REQ: |
@@ -405,7 +430,7 @@ ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac, | |||
405 | pkt_size = ieee80211softmac_reassoc_req((struct ieee80211_reassoc_request **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg); | 430 | pkt_size = ieee80211softmac_reassoc_req((struct ieee80211_reassoc_request **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg); |
406 | break; | 431 | break; |
407 | case IEEE80211_STYPE_AUTH: | 432 | case IEEE80211_STYPE_AUTH: |
408 | pkt_size = ieee80211softmac_auth((struct ieee80211_auth **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg, (u16)(arg & 0xFFFF), (u16) (arg >> 16)); | 433 | pkt_size = ieee80211softmac_auth((struct ieee80211_auth **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg, (u16)(arg & 0xFFFF), (u16) (arg >> 16), &encrypt_mpdu); |
409 | break; | 434 | break; |
410 | case IEEE80211_STYPE_DISASSOC: | 435 | case IEEE80211_STYPE_DISASSOC: |
411 | case IEEE80211_STYPE_DEAUTH: | 436 | case IEEE80211_STYPE_DEAUTH: |
@@ -434,52 +459,8 @@ ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac, | |||
434 | * or get rid of it alltogether? | 459 | * or get rid of it alltogether? |
435 | * Does this work for you now? | 460 | * Does this work for you now? |
436 | */ | 461 | */ |
437 | ieee80211_tx_frame(mac->ieee, (struct ieee80211_hdr *)pkt, pkt_size); | 462 | ieee80211_tx_frame(mac->ieee, (struct ieee80211_hdr *)pkt, |
438 | 463 | IEEE80211_3ADDR_LEN, pkt_size, encrypt_mpdu); | |
439 | kfree(pkt); | ||
440 | return 0; | ||
441 | } | ||
442 | |||
443 | |||
444 | /* Create an rts/cts frame */ | ||
445 | static u32 | ||
446 | ieee80211softmac_rts_cts(struct ieee80211_hdr_2addr **pkt, | ||
447 | struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net, | ||
448 | u32 type) | ||
449 | { | ||
450 | /* Allocate Packet */ | ||
451 | (*pkt) = kmalloc(IEEE80211_2ADDR_LEN, GFP_ATOMIC); | ||
452 | memset(*pkt, 0, IEEE80211_2ADDR_LEN); | ||
453 | if((*pkt) == NULL) | ||
454 | return 0; | ||
455 | ieee80211softmac_hdr_2addr(mac, (*pkt), type, net->bssid); | ||
456 | return IEEE80211_2ADDR_LEN; | ||
457 | } | ||
458 | |||
459 | |||
460 | /* Sends a control packet */ | ||
461 | static int | ||
462 | ieee80211softmac_send_ctl_frame(struct ieee80211softmac_device *mac, | ||
463 | struct ieee80211softmac_network *net, u32 type, u32 arg) | ||
464 | { | ||
465 | void *pkt = NULL; | ||
466 | u32 pkt_size = 0; | ||
467 | |||
468 | switch(type) { | ||
469 | case IEEE80211_STYPE_RTS: | ||
470 | case IEEE80211_STYPE_CTS: | ||
471 | pkt_size = ieee80211softmac_rts_cts((struct ieee80211_hdr_2addr **)(&pkt), mac, net, type); | ||
472 | break; | ||
473 | default: | ||
474 | printkl(KERN_DEBUG PFX "Unsupported Control Frame type: %i\n", type); | ||
475 | return -EINVAL; | ||
476 | } | ||
477 | |||
478 | if(pkt_size == 0) | ||
479 | return -ENOMEM; | ||
480 | |||
481 | /* Send the packet to the ieee80211 layer for tx */ | ||
482 | ieee80211_tx_frame(mac->ieee, (struct ieee80211_hdr *) pkt, pkt_size); | ||
483 | 464 | ||
484 | kfree(pkt); | 465 | kfree(pkt); |
485 | return 0; | 466 | return 0; |
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig index 3d560dec63ab..d4072533da21 100644 --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig | |||
@@ -170,8 +170,8 @@ config IP_NF_PPTP | |||
170 | Documentation/modules.txt. If unsure, say `N'. | 170 | Documentation/modules.txt. If unsure, say `N'. |
171 | 171 | ||
172 | config IP_NF_H323 | 172 | config IP_NF_H323 |
173 | tristate 'H.323 protocol support' | 173 | tristate 'H.323 protocol support (EXPERIMENTAL)' |
174 | depends on IP_NF_CONNTRACK | 174 | depends on IP_NF_CONNTRACK && EXPERIMENTAL |
175 | help | 175 | help |
176 | H.323 is a VoIP signalling protocol from ITU-T. As one of the most | 176 | H.323 is a VoIP signalling protocol from ITU-T. As one of the most |
177 | important VoIP protocols, it is widely used by voice hardware and | 177 | important VoIP protocols, it is widely used by voice hardware and |
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index 979a2eac6f00..a297da7bbef5 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c | |||
@@ -1318,6 +1318,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len) | |||
1318 | .tuple.dst.u.tcp.port; | 1318 | .tuple.dst.u.tcp.port; |
1319 | sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] | 1319 | sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] |
1320 | .tuple.dst.ip; | 1320 | .tuple.dst.ip; |
1321 | memset(sin.sin_zero, 0, sizeof(sin.sin_zero)); | ||
1321 | 1322 | ||
1322 | DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", | 1323 | DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", |
1323 | NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); | 1324 | NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); |
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c index 7d3ba4302e9e..8ccfe17bb253 100644 --- a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c +++ b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c | |||
@@ -469,8 +469,8 @@ pptp_inbound_pkt(struct sk_buff **pskb, | |||
469 | DEBUGP("%s but no session\n", pptp_msg_name[msg]); | 469 | DEBUGP("%s but no session\n", pptp_msg_name[msg]); |
470 | break; | 470 | break; |
471 | } | 471 | } |
472 | if (info->sstate != PPTP_CALL_IN_REP | 472 | if (info->cstate != PPTP_CALL_IN_REP |
473 | && info->sstate != PPTP_CALL_IN_CONF) { | 473 | && info->cstate != PPTP_CALL_IN_CONF) { |
474 | DEBUGP("%s but never sent IN_CALL_REPLY\n", | 474 | DEBUGP("%s but never sent IN_CALL_REPLY\n", |
475 | pptp_msg_name[msg]); | 475 | pptp_msg_name[msg]); |
476 | break; | 476 | break; |
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c index 5bc9f64d7b5b..77d974443c7b 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | |||
@@ -348,6 +348,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len) | |||
348 | .tuple.dst.u.tcp.port; | 348 | .tuple.dst.u.tcp.port; |
349 | sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] | 349 | sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] |
350 | .tuple.dst.u3.ip; | 350 | .tuple.dst.u3.ip; |
351 | memset(sin.sin_zero, 0, sizeof(sin.sin_zero)); | ||
351 | 352 | ||
352 | DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", | 353 | DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", |
353 | NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); | 354 | NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); |
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c index b72fa55dfb84..ba7c63ca5bb1 100644 --- a/net/ipv4/tcp_highspeed.c +++ b/net/ipv4/tcp_highspeed.c | |||
@@ -135,7 +135,8 @@ static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt, | |||
135 | 135 | ||
136 | /* Do additive increase */ | 136 | /* Do additive increase */ |
137 | if (tp->snd_cwnd < tp->snd_cwnd_clamp) { | 137 | if (tp->snd_cwnd < tp->snd_cwnd_clamp) { |
138 | tp->snd_cwnd_cnt += ca->ai; | 138 | /* cwnd = cwnd + a(w) / cwnd */ |
139 | tp->snd_cwnd_cnt += ca->ai + 1; | ||
139 | if (tp->snd_cwnd_cnt >= tp->snd_cwnd) { | 140 | if (tp->snd_cwnd_cnt >= tp->snd_cwnd) { |
140 | tp->snd_cwnd_cnt -= tp->snd_cwnd; | 141 | tp->snd_cwnd_cnt -= tp->snd_cwnd; |
141 | tp->snd_cwnd++; | 142 | tp->snd_cwnd++; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 743016baa048..f33c9dddaa12 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -642,7 +642,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss | |||
642 | * eventually). The difference is that pulled data not copied, but | 642 | * eventually). The difference is that pulled data not copied, but |
643 | * immediately discarded. | 643 | * immediately discarded. |
644 | */ | 644 | */ |
645 | static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len) | 645 | static void __pskb_trim_head(struct sk_buff *skb, int len) |
646 | { | 646 | { |
647 | int i, k, eat; | 647 | int i, k, eat; |
648 | 648 | ||
@@ -667,7 +667,6 @@ static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len) | |||
667 | skb->tail = skb->data; | 667 | skb->tail = skb->data; |
668 | skb->data_len -= len; | 668 | skb->data_len -= len; |
669 | skb->len = skb->data_len; | 669 | skb->len = skb->data_len; |
670 | return skb->tail; | ||
671 | } | 670 | } |
672 | 671 | ||
673 | int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | 672 | int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) |
@@ -676,12 +675,11 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | |||
676 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | 675 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) |
677 | return -ENOMEM; | 676 | return -ENOMEM; |
678 | 677 | ||
679 | if (len <= skb_headlen(skb)) { | 678 | /* If len == headlen, we avoid __skb_pull to preserve alignment. */ |
679 | if (unlikely(len < skb_headlen(skb))) | ||
680 | __skb_pull(skb, len); | 680 | __skb_pull(skb, len); |
681 | } else { | 681 | else |
682 | if (__pskb_trim_head(skb, len-skb_headlen(skb)) == NULL) | 682 | __pskb_trim_head(skb, len - skb_headlen(skb)); |
683 | return -ENOMEM; | ||
684 | } | ||
685 | 683 | ||
686 | TCP_SKB_CB(skb)->seq += len; | 684 | TCP_SKB_CB(skb)->seq += len; |
687 | skb->ip_summed = CHECKSUM_HW; | 685 | skb->ip_summed = CHECKSUM_HW; |
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index 7029618f5719..a16528657b4c 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
@@ -884,7 +884,8 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) | |||
884 | if (now) { | 884 | if (now) { |
885 | /* Send down empty frame to trigger speed change */ | 885 | /* Send down empty frame to trigger speed change */ |
886 | skb = dev_alloc_skb(0); | 886 | skb = dev_alloc_skb(0); |
887 | irlap_queue_xmit(self, skb); | 887 | if (skb) |
888 | irlap_queue_xmit(self, skb); | ||
888 | } | 889 | } |
889 | } | 890 | } |
890 | 891 | ||
diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 55538f6b60ff..58a1b6b42ddd 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c | |||
@@ -37,14 +37,6 @@ struct ctl_table net_table[] = { | |||
37 | .mode = 0555, | 37 | .mode = 0555, |
38 | .child = core_table, | 38 | .child = core_table, |
39 | }, | 39 | }, |
40 | #ifdef CONFIG_NET | ||
41 | { | ||
42 | .ctl_name = NET_ETHER, | ||
43 | .procname = "ethernet", | ||
44 | .mode = 0555, | ||
45 | .child = ether_table, | ||
46 | }, | ||
47 | #endif | ||
48 | #ifdef CONFIG_INET | 40 | #ifdef CONFIG_INET |
49 | { | 41 | { |
50 | .ctl_name = NET_IPV4, | 42 | .ctl_name = NET_IPV4, |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 21dad415b896..90b4cdc0c948 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -4422,6 +4422,7 @@ void selinux_complete_init(void) | |||
4422 | 4422 | ||
4423 | /* Set up any superblocks initialized prior to the policy load. */ | 4423 | /* Set up any superblocks initialized prior to the policy load. */ |
4424 | printk(KERN_INFO "SELinux: Setting up existing superblocks.\n"); | 4424 | printk(KERN_INFO "SELinux: Setting up existing superblocks.\n"); |
4425 | spin_lock(&sb_lock); | ||
4425 | spin_lock(&sb_security_lock); | 4426 | spin_lock(&sb_security_lock); |
4426 | next_sb: | 4427 | next_sb: |
4427 | if (!list_empty(&superblock_security_head)) { | 4428 | if (!list_empty(&superblock_security_head)) { |
@@ -4430,19 +4431,20 @@ next_sb: | |||
4430 | struct superblock_security_struct, | 4431 | struct superblock_security_struct, |
4431 | list); | 4432 | list); |
4432 | struct super_block *sb = sbsec->sb; | 4433 | struct super_block *sb = sbsec->sb; |
4433 | spin_lock(&sb_lock); | ||
4434 | sb->s_count++; | 4434 | sb->s_count++; |
4435 | spin_unlock(&sb_lock); | ||
4436 | spin_unlock(&sb_security_lock); | 4435 | spin_unlock(&sb_security_lock); |
4436 | spin_unlock(&sb_lock); | ||
4437 | down_read(&sb->s_umount); | 4437 | down_read(&sb->s_umount); |
4438 | if (sb->s_root) | 4438 | if (sb->s_root) |
4439 | superblock_doinit(sb, NULL); | 4439 | superblock_doinit(sb, NULL); |
4440 | drop_super(sb); | 4440 | drop_super(sb); |
4441 | spin_lock(&sb_lock); | ||
4441 | spin_lock(&sb_security_lock); | 4442 | spin_lock(&sb_security_lock); |
4442 | list_del_init(&sbsec->list); | 4443 | list_del_init(&sbsec->list); |
4443 | goto next_sb; | 4444 | goto next_sb; |
4444 | } | 4445 | } |
4445 | spin_unlock(&sb_security_lock); | 4446 | spin_unlock(&sb_security_lock); |
4447 | spin_unlock(&sb_lock); | ||
4446 | } | 4448 | } |
4447 | 4449 | ||
4448 | /* SELinux requires early initialization in order to label | 4450 | /* SELinux requires early initialization in order to label |