diff options
176 files changed, 1133 insertions, 806 deletions
| @@ -3643,11 +3643,9 @@ S: Cambridge. CB1 7EG | |||
| 3643 | S: England | 3643 | S: England |
| 3644 | 3644 | ||
| 3645 | N: Chris Wright | 3645 | N: Chris Wright |
| 3646 | E: chrisw@osdl.org | 3646 | E: chrisw@sous-sol.org |
| 3647 | D: hacking on LSM framework and security modules. | 3647 | D: hacking on LSM framework and security modules. |
| 3648 | S: c/o OSDL | 3648 | S: Portland, OR |
| 3649 | S: 12725 SW Millikan Way, Suite 400 | ||
| 3650 | S: Beaverton, OR 97005 | ||
| 3651 | S: USA | 3649 | S: USA |
| 3652 | 3650 | ||
| 3653 | N: Michal Wronski | 3651 | N: Michal Wronski |
diff --git a/Documentation/dvb/bt8xx.txt b/Documentation/dvb/bt8xx.txt index df6c05453cb5..52ed462061df 100644 --- a/Documentation/dvb/bt8xx.txt +++ b/Documentation/dvb/bt8xx.txt | |||
| @@ -111,4 +111,8 @@ source: linux/Documentation/video4linux/CARDLIST.bttv | |||
| 111 | If you have problems with this please do ask on the mailing list. | 111 | If you have problems with this please do ask on the mailing list. |
| 112 | 112 | ||
| 113 | -- | 113 | -- |
| 114 | Authors: Richard Walker, Jamie Honan, Michael Hunold, Manu Abraham | 114 | Authors: Richard Walker, |
| 115 | Jamie Honan, | ||
| 116 | Michael Hunold, | ||
| 117 | Manu Abraham, | ||
| 118 | Michael Krufky | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index be5ae600f533..81bc51369f59 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
| @@ -180,3 +180,12 @@ Why: These events are not correct, and do not properly let userspace know | |||
| 180 | when a file system has been mounted or unmounted. Userspace should | 180 | when a file system has been mounted or unmounted. Userspace should |
| 181 | poll the /proc/mounts file instead to detect this properly. | 181 | poll the /proc/mounts file instead to detect this properly. |
| 182 | Who: Greg Kroah-Hartman <gregkh@suse.de> | 182 | Who: Greg Kroah-Hartman <gregkh@suse.de> |
| 183 | |||
| 184 | --------------------------- | ||
| 185 | |||
| 186 | What: Support for NEC DDB5074 and DDB5476 evaluation boards. | ||
| 187 | When: June 2006 | ||
| 188 | Why: Board specific code doesn't build anymore since ~2.6.0 and no | ||
| 189 | users have complained indicating there is no more need for these | ||
| 190 | boards. This should really be considered a last call. | ||
| 191 | Who: Ralf Baechle <ralf@linux-mips.org> | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 75205391b335..fc99075e0af4 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -335,6 +335,12 @@ running once the system is up. | |||
| 335 | timesource is not avalible, it defaults to PIT. | 335 | timesource is not avalible, it defaults to PIT. |
| 336 | Format: { pit | tsc | cyclone | pmtmr } | 336 | Format: { pit | tsc | cyclone | pmtmr } |
| 337 | 337 | ||
| 338 | disable_8254_timer | ||
| 339 | enable_8254_timer | ||
| 340 | [IA32/X86_64] Disable/Enable interrupt 0 timer routing | ||
| 341 | over the 8254 in addition to over the IO-APIC. The | ||
| 342 | kernel tries to set a sensible default. | ||
| 343 | |||
| 338 | hpet= [IA-32,HPET] option to disable HPET and use PIT. | 344 | hpet= [IA-32,HPET] option to disable HPET and use PIT. |
| 339 | Format: disable | 345 | Format: disable |
| 340 | 346 | ||
| @@ -1284,6 +1290,19 @@ running once the system is up. | |||
| 1284 | New name for the ramdisk parameter. | 1290 | New name for the ramdisk parameter. |
| 1285 | See Documentation/ramdisk.txt. | 1291 | See Documentation/ramdisk.txt. |
| 1286 | 1292 | ||
| 1293 | rcu.blimit= [KNL,BOOT] Set maximum number of finished | ||
| 1294 | RCU callbacks to process in one batch. | ||
| 1295 | |||
| 1296 | rcu.qhimark= [KNL,BOOT] Set threshold of queued | ||
| 1297 | RCU callbacks over which batch limiting is disabled. | ||
| 1298 | |||
| 1299 | rcu.qlowmark= [KNL,BOOT] Set threshold of queued | ||
| 1300 | RCU callbacks below which batch limiting is re-enabled. | ||
| 1301 | |||
| 1302 | rcu.rsinterval= [KNL,BOOT,SMP] Set the number of additional | ||
| 1303 | RCU callbacks to queued before forcing reschedule | ||
| 1304 | on all cpus. | ||
| 1305 | |||
| 1287 | rdinit= [KNL] | 1306 | rdinit= [KNL] |
| 1288 | Format: <full_path> | 1307 | Format: <full_path> |
| 1289 | Run specified binary instead of /init from the ramdisk, | 1308 | Run specified binary instead of /init from the ramdisk, |
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 8a352597830f..da4fb890165f 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | 12 -> Medion 7134 [16be:0003] | 13 | 12 -> Medion 7134 [16be:0003] |
| 14 | 13 -> Typhoon TV+Radio 90031 | 14 | 13 -> Typhoon TV+Radio 90031 |
| 15 | 14 -> ELSA EX-VISION 300TV [1048:226b] | 15 | 14 -> ELSA EX-VISION 300TV [1048:226b] |
| 16 | 15 -> ELSA EX-VISION 500TV [1048:226b] | 16 | 15 -> ELSA EX-VISION 500TV [1048:226a] |
| 17 | 16 -> ASUS TV-FM 7134 [1043:4842,1043:4830,1043:4840] | 17 | 16 -> ASUS TV-FM 7134 [1043:4842,1043:4830,1043:4840] |
| 18 | 17 -> AOPEN VA1000 POWER [1131:7133] | 18 | 17 -> AOPEN VA1000 POWER [1131:7133] |
| 19 | 18 -> BMK MPEX No Tuner | 19 | 18 -> BMK MPEX No Tuner |
| @@ -75,7 +75,7 @@ | |||
| 75 | 74 -> LifeView FlyTV Platinum Mini2 [14c0:1212] | 75 | 74 -> LifeView FlyTV Platinum Mini2 [14c0:1212] |
| 76 | 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044] | 76 | 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044] |
| 77 | 76 -> SKNet MonsterTV Mobile [1131:4ee9] | 77 | 76 -> SKNet MonsterTV Mobile [1131:4ee9] |
| 78 | 77 -> Pinnacle PCTV 110i (saa7133) [11bd:002e] | 78 | 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e] |
| 79 | 78 -> ASUSTeK P7131 Dual [1043:4862] | 79 | 78 -> ASUSTeK P7131 Dual [1043:4862] |
| 80 | 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) | 80 | 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) |
| 81 | 80 -> ASUS Digimatrix TV [1043:0210] | 81 | 80 -> ASUS Digimatrix TV [1043:0210] |
diff --git a/MAINTAINERS b/MAINTAINERS index 9c592aa0280c..3d7d30dc5439 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -838,7 +838,6 @@ S: Maintained | |||
| 838 | 838 | ||
| 839 | DVB SUBSYSTEM AND DRIVERS | 839 | DVB SUBSYSTEM AND DRIVERS |
| 840 | P: LinuxTV.org Project | 840 | P: LinuxTV.org Project |
| 841 | M: mchehab@infradead.org | ||
| 842 | M: v4l-dvb-maintainer@linuxtv.org | 841 | M: v4l-dvb-maintainer@linuxtv.org |
| 843 | L: linux-dvb@linuxtv.org (subscription required) | 842 | L: linux-dvb@linuxtv.org (subscription required) |
| 844 | W: http://linuxtv.org/ | 843 | W: http://linuxtv.org/ |
| @@ -1632,8 +1631,8 @@ S: Supported | |||
| 1632 | 1631 | ||
| 1633 | LINUX SECURITY MODULE (LSM) FRAMEWORK | 1632 | LINUX SECURITY MODULE (LSM) FRAMEWORK |
| 1634 | P: Chris Wright | 1633 | P: Chris Wright |
| 1635 | M: chrisw@osdl.org | 1634 | M: chrisw@sous-sol.org |
| 1636 | L: linux-security-module@wirex.com | 1635 | L: linux-security-module@vger.kernel.org |
| 1637 | W: http://lsm.immunix.org | 1636 | W: http://lsm.immunix.org |
| 1638 | T: git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git | 1637 | T: git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git |
| 1639 | S: Supported | 1638 | S: Supported |
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 2 | 1 | VERSION = 2 |
| 2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
| 3 | SUBLEVEL = 16 | 3 | SUBLEVEL = 16 |
| 4 | EXTRAVERSION =-rc5 | 4 | EXTRAVERSION =-rc6 |
| 5 | NAME=Sliding Snow Leopard | 5 | NAME=Sliding Snow Leopard |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
| @@ -905,7 +905,7 @@ define filechk_version.h | |||
| 905 | ) | 905 | ) |
| 906 | endef | 906 | endef |
| 907 | 907 | ||
| 908 | include/linux/version.h: $(srctree)/Makefile .config FORCE | 908 | include/linux/version.h: $(srctree)/Makefile .config .kernelrelease FORCE |
| 909 | $(call filechk,version.h) | 909 | $(call filechk,version.h) |
| 910 | 910 | ||
| 911 | # --------------------------------------------------------------------------- | 911 | # --------------------------------------------------------------------------- |
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index 9006063e7369..da677f829f76 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c | |||
| @@ -151,8 +151,13 @@ handle_irq(int irq, struct pt_regs * regs) | |||
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | irq_enter(); | 153 | irq_enter(); |
| 154 | /* | ||
| 155 | * __do_IRQ() must be called with IPL_MAX. Note that we do not | ||
| 156 | * explicitly enable interrupts afterwards - some MILO PALcode | ||
| 157 | * (namely LX164 one) seems to have severe problems with RTI | ||
| 158 | * at IPL 0. | ||
| 159 | */ | ||
| 154 | local_irq_disable(); | 160 | local_irq_disable(); |
| 155 | __do_IRQ(irq, regs); | 161 | __do_IRQ(irq, regs); |
| 156 | local_irq_enable(); | ||
| 157 | irq_exit(); | 162 | irq_exit(); |
| 158 | } | 163 | } |
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 53bb9a79e274..65656c033d70 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile | |||
| @@ -11,7 +11,7 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ | |||
| 11 | 11 | ||
| 12 | obj-y += cpu/ | 12 | obj-y += cpu/ |
| 13 | obj-y += timers/ | 13 | obj-y += timers/ |
| 14 | obj-$(CONFIG_ACPI) += acpi/ | 14 | obj-y += acpi/ |
| 15 | obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o | 15 | obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o |
| 16 | obj-$(CONFIG_MCA) += mca.o | 16 | obj-$(CONFIG_MCA) += mca.o |
| 17 | obj-$(CONFIG_X86_MSR) += msr.o | 17 | obj-$(CONFIG_X86_MSR) += msr.o |
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile index d51c7313cae8..7e9ac99354f4 100644 --- a/arch/i386/kernel/acpi/Makefile +++ b/arch/i386/kernel/acpi/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | obj-y := boot.o | 1 | obj-$(CONFIG_ACPI) += boot.o |
| 2 | obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o | 2 | obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o |
| 3 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o | 3 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o |
| 4 | 4 | ||
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 79577f0ace98..f1a21945963d 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
| @@ -1111,9 +1111,6 @@ int __init acpi_boot_table_init(void) | |||
| 1111 | disable_acpi(); | 1111 | disable_acpi(); |
| 1112 | return error; | 1112 | return error; |
| 1113 | } | 1113 | } |
| 1114 | #ifdef __i386__ | ||
| 1115 | check_acpi_pci(); | ||
| 1116 | #endif | ||
| 1117 | 1114 | ||
| 1118 | acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); | 1115 | acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); |
| 1119 | 1116 | ||
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c index f1b9d2a46dab..2e3b643a4dc4 100644 --- a/arch/i386/kernel/acpi/earlyquirk.c +++ b/arch/i386/kernel/acpi/earlyquirk.c | |||
| @@ -7,14 +7,22 @@ | |||
| 7 | #include <linux/pci.h> | 7 | #include <linux/pci.h> |
| 8 | #include <asm/pci-direct.h> | 8 | #include <asm/pci-direct.h> |
| 9 | #include <asm/acpi.h> | 9 | #include <asm/acpi.h> |
| 10 | #include <asm/apic.h> | ||
| 10 | 11 | ||
| 11 | static int __init check_bridge(int vendor, int device) | 12 | static int __init check_bridge(int vendor, int device) |
| 12 | { | 13 | { |
| 14 | #ifdef CONFIG_ACPI | ||
| 13 | /* According to Nvidia all timer overrides are bogus. Just ignore | 15 | /* According to Nvidia all timer overrides are bogus. Just ignore |
| 14 | them all. */ | 16 | them all. */ |
| 15 | if (vendor == PCI_VENDOR_ID_NVIDIA) { | 17 | if (vendor == PCI_VENDOR_ID_NVIDIA) { |
| 16 | acpi_skip_timer_override = 1; | 18 | acpi_skip_timer_override = 1; |
| 17 | } | 19 | } |
| 20 | #endif | ||
| 21 | if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) { | ||
| 22 | timer_over_8254 = 0; | ||
| 23 | printk(KERN_INFO "ATI board detected. Disabling timer routing " | ||
| 24 | "over 8254.\n"); | ||
| 25 | } | ||
| 18 | return 0; | 26 | return 0; |
| 19 | } | 27 | } |
| 20 | 28 | ||
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index 4ecd4b326ded..e6bd095ae108 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
| @@ -278,10 +278,10 @@ void __devinit generic_identify(struct cpuinfo_x86 * c) | |||
| 278 | c->x86_capability[4] = excap; | 278 | c->x86_capability[4] = excap; |
| 279 | c->x86 = (tfms >> 8) & 15; | 279 | c->x86 = (tfms >> 8) & 15; |
| 280 | c->x86_model = (tfms >> 4) & 15; | 280 | c->x86_model = (tfms >> 4) & 15; |
| 281 | if (c->x86 == 0xf) { | 281 | if (c->x86 == 0xf) |
| 282 | c->x86 += (tfms >> 20) & 0xff; | 282 | c->x86 += (tfms >> 20) & 0xff; |
| 283 | if (c->x86 >= 0x6) | ||
| 283 | c->x86_model += ((tfms >> 16) & 0xF) << 4; | 284 | c->x86_model += ((tfms >> 16) & 0xF) << 4; |
| 284 | } | ||
| 285 | c->x86_mask = tfms & 15; | 285 | c->x86_mask = tfms & 15; |
| 286 | } else { | 286 | } else { |
| 287 | /* Have CPUID level 0 only - unheard of */ | 287 | /* Have CPUID level 0 only - unheard of */ |
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 235822b3f41b..39d9a5fa907e 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c | |||
| @@ -51,6 +51,8 @@ static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; | |||
| 51 | 51 | ||
| 52 | static DEFINE_SPINLOCK(ioapic_lock); | 52 | static DEFINE_SPINLOCK(ioapic_lock); |
| 53 | 53 | ||
| 54 | int timer_over_8254 __initdata = 1; | ||
| 55 | |||
| 54 | /* | 56 | /* |
| 55 | * Is the SiS APIC rmw bug present ? | 57 | * Is the SiS APIC rmw bug present ? |
| 56 | * -1 = don't know, 0 = no, 1 = yes | 58 | * -1 = don't know, 0 = no, 1 = yes |
| @@ -2267,7 +2269,8 @@ static inline void check_timer(void) | |||
| 2267 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); | 2269 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); |
| 2268 | init_8259A(1); | 2270 | init_8259A(1); |
| 2269 | timer_ack = 1; | 2271 | timer_ack = 1; |
| 2270 | enable_8259A_irq(0); | 2272 | if (timer_over_8254 > 0) |
| 2273 | enable_8259A_irq(0); | ||
| 2271 | 2274 | ||
| 2272 | pin1 = find_isa_irq_pin(0, mp_INT); | 2275 | pin1 = find_isa_irq_pin(0, mp_INT); |
| 2273 | apic1 = find_isa_irq_apic(0, mp_INT); | 2276 | apic1 = find_isa_irq_apic(0, mp_INT); |
| @@ -2392,6 +2395,20 @@ void __init setup_IO_APIC(void) | |||
| 2392 | print_IO_APIC(); | 2395 | print_IO_APIC(); |
| 2393 | } | 2396 | } |
| 2394 | 2397 | ||
| 2398 | static int __init setup_disable_8254_timer(char *s) | ||
| 2399 | { | ||
| 2400 | timer_over_8254 = -1; | ||
| 2401 | return 1; | ||
| 2402 | } | ||
| 2403 | static int __init setup_enable_8254_timer(char *s) | ||
| 2404 | { | ||
| 2405 | timer_over_8254 = 2; | ||
| 2406 | return 1; | ||
| 2407 | } | ||
| 2408 | |||
| 2409 | __setup("disable_8254_timer", setup_disable_8254_timer); | ||
| 2410 | __setup("enable_8254_timer", setup_enable_8254_timer); | ||
| 2411 | |||
| 2395 | /* | 2412 | /* |
| 2396 | * Called after all the initialization is done. If we didnt find any | 2413 | * Called after all the initialization is done. If we didnt find any |
| 2397 | * APIC bugs then we can allow the modify fast path | 2414 | * APIC bugs then we can allow the modify fast path |
diff --git a/arch/i386/kernel/machine_kexec.c b/arch/i386/kernel/machine_kexec.c index a912fed48482..f73d7374a2ba 100644 --- a/arch/i386/kernel/machine_kexec.c +++ b/arch/i386/kernel/machine_kexec.c | |||
| @@ -116,13 +116,13 @@ static void load_segments(void) | |||
| 116 | __asm__ __volatile__ ( | 116 | __asm__ __volatile__ ( |
| 117 | "\tljmp $"STR(__KERNEL_CS)",$1f\n" | 117 | "\tljmp $"STR(__KERNEL_CS)",$1f\n" |
| 118 | "\t1:\n" | 118 | "\t1:\n" |
| 119 | "\tmovl $"STR(__KERNEL_DS)",%eax\n" | 119 | "\tmovl $"STR(__KERNEL_DS)",%%eax\n" |
| 120 | "\tmovl %eax,%ds\n" | 120 | "\tmovl %%eax,%%ds\n" |
| 121 | "\tmovl %eax,%es\n" | 121 | "\tmovl %%eax,%%es\n" |
| 122 | "\tmovl %eax,%fs\n" | 122 | "\tmovl %%eax,%%fs\n" |
| 123 | "\tmovl %eax,%gs\n" | 123 | "\tmovl %%eax,%%gs\n" |
| 124 | "\tmovl %eax,%ss\n" | 124 | "\tmovl %%eax,%%ss\n" |
| 125 | ); | 125 | ::: "eax", "memory"); |
| 126 | #undef STR | 126 | #undef STR |
| 127 | #undef __STR | 127 | #undef __STR |
| 128 | } | 128 | } |
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index 63f39a7e2c96..be87c5e2ee95 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c | |||
| @@ -357,7 +357,7 @@ static void clear_msr_range(unsigned int base, unsigned int n) | |||
| 357 | wrmsr(base+i, 0, 0); | 357 | wrmsr(base+i, 0, 0); |
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | static inline void write_watchdog_counter(const char *descr) | 360 | static void write_watchdog_counter(const char *descr) |
| 361 | { | 361 | { |
| 362 | u64 count = (u64)cpu_khz * 1000; | 362 | u64 count = (u64)cpu_khz * 1000; |
| 363 | 363 | ||
| @@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs * regs) | |||
| 544 | * die_nmi will return ONLY if NOTIFY_STOP happens.. | 544 | * die_nmi will return ONLY if NOTIFY_STOP happens.. |
| 545 | */ | 545 | */ |
| 546 | die_nmi(regs, "NMI Watchdog detected LOCKUP"); | 546 | die_nmi(regs, "NMI Watchdog detected LOCKUP"); |
| 547 | 547 | } else { | |
| 548 | last_irq_sums[cpu] = sum; | 548 | last_irq_sums[cpu] = sum; |
| 549 | alert_counter[cpu] = 0; | 549 | alert_counter[cpu] = 0; |
| 550 | } | 550 | } |
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 51e513b4f72d..ab62a9f4701e 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
| @@ -1599,6 +1599,10 @@ void __init setup_arch(char **cmdline_p) | |||
| 1599 | if (efi_enabled) | 1599 | if (efi_enabled) |
| 1600 | efi_map_memmap(); | 1600 | efi_map_memmap(); |
| 1601 | 1601 | ||
| 1602 | #ifdef CONFIG_X86_IO_APIC | ||
| 1603 | check_acpi_pci(); /* Checks more than just ACPI actually */ | ||
| 1604 | #endif | ||
| 1605 | |||
| 1602 | #ifdef CONFIG_ACPI | 1606 | #ifdef CONFIG_ACPI |
| 1603 | /* | 1607 | /* |
| 1604 | * Parse the ACPI tables for possible boot-time SMP configuration. | 1608 | * Parse the ACPI tables for possible boot-time SMP configuration. |
diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig index 184678fe7832..744fd2f79f61 100644 --- a/arch/ia64/configs/gensparse_defconfig +++ b/arch/ia64/configs/gensparse_defconfig | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # | 1 | # |
| 2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
| 3 | # Linux kernel version: 2.6.16-rc5 | 3 | # Linux kernel version: 2.6.16-rc5 |
| 4 | # Mon Feb 27 16:15:43 2006 | 4 | # Thu Mar 2 16:39:10 2006 |
| 5 | # | 5 | # |
| 6 | 6 | ||
| 7 | # | 7 | # |
| @@ -312,7 +312,13 @@ CONFIG_FW_LOADER=m | |||
| 312 | # | 312 | # |
| 313 | # Plug and Play support | 313 | # Plug and Play support |
| 314 | # | 314 | # |
| 315 | # CONFIG_PNP is not set | 315 | CONFIG_PNP=y |
| 316 | # CONFIG_PNP_DEBUG is not set | ||
| 317 | |||
| 318 | # | ||
| 319 | # Protocols | ||
| 320 | # | ||
| 321 | CONFIG_PNPACPI=y | ||
| 316 | 322 | ||
| 317 | # | 323 | # |
| 318 | # Block devices | 324 | # Block devices |
| @@ -357,6 +363,7 @@ CONFIG_BLK_DEV_IDESCSI=m | |||
| 357 | # IDE chipset support/bugfixes | 363 | # IDE chipset support/bugfixes |
| 358 | # | 364 | # |
| 359 | CONFIG_IDE_GENERIC=y | 365 | CONFIG_IDE_GENERIC=y |
| 366 | # CONFIG_BLK_DEV_IDEPNP is not set | ||
| 360 | CONFIG_BLK_DEV_IDEPCI=y | 367 | CONFIG_BLK_DEV_IDEPCI=y |
| 361 | # CONFIG_IDEPCI_SHARE_IRQ is not set | 368 | # CONFIG_IDEPCI_SHARE_IRQ is not set |
| 362 | # CONFIG_BLK_DEV_OFFBOARD is not set | 369 | # CONFIG_BLK_DEV_OFFBOARD is not set |
| @@ -525,6 +532,7 @@ CONFIG_DUMMY=m | |||
| 525 | # CONFIG_BONDING is not set | 532 | # CONFIG_BONDING is not set |
| 526 | # CONFIG_EQUALIZER is not set | 533 | # CONFIG_EQUALIZER is not set |
| 527 | # CONFIG_TUN is not set | 534 | # CONFIG_TUN is not set |
| 535 | # CONFIG_NET_SB1000 is not set | ||
| 528 | 536 | ||
| 529 | # | 537 | # |
| 530 | # ARCnet devices | 538 | # ARCnet devices |
diff --git a/arch/ia64/kernel/cyclone.c b/arch/ia64/kernel/cyclone.c index 6ade3790ce07..e00b21514f7c 100644 --- a/arch/ia64/kernel/cyclone.c +++ b/arch/ia64/kernel/cyclone.c | |||
| @@ -36,7 +36,7 @@ int __init init_cyclone_clock(void) | |||
| 36 | u32* volatile cyclone_timer; /* Cyclone MPMC0 register */ | 36 | u32* volatile cyclone_timer; /* Cyclone MPMC0 register */ |
| 37 | 37 | ||
| 38 | if (!use_cyclone) | 38 | if (!use_cyclone) |
| 39 | return -ENODEV; | 39 | return 0; |
| 40 | 40 | ||
| 41 | printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n"); | 41 | printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n"); |
| 42 | 42 | ||
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S index 9f80569a32b0..dcd906fe5749 100644 --- a/arch/ia64/kernel/ivt.S +++ b/arch/ia64/kernel/ivt.S | |||
| @@ -561,11 +561,12 @@ ENTRY(dirty_bit) | |||
| 561 | ;; // avoid RAW on r18 | 561 | ;; // avoid RAW on r18 |
| 562 | mov ar.ccv=r18 // set compare value for cmpxchg | 562 | mov ar.ccv=r18 // set compare value for cmpxchg |
| 563 | or r25=_PAGE_D|_PAGE_A,r18 // set the dirty and accessed bits | 563 | or r25=_PAGE_D|_PAGE_A,r18 // set the dirty and accessed bits |
| 564 | tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit | ||
| 564 | ;; | 565 | ;; |
| 565 | cmpxchg8.acq r26=[r17],r25,ar.ccv | 566 | (p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only update if page is present |
| 566 | mov r24=PAGE_SHIFT<<2 | 567 | mov r24=PAGE_SHIFT<<2 |
| 567 | ;; | 568 | ;; |
| 568 | cmp.eq p6,p7=r26,r18 | 569 | (p6) cmp.eq p6,p7=r26,r18 // Only compare if page is present |
| 569 | ;; | 570 | ;; |
| 570 | (p6) itc.d r25 // install updated PTE | 571 | (p6) itc.d r25 // install updated PTE |
| 571 | ;; | 572 | ;; |
| @@ -626,11 +627,12 @@ ENTRY(iaccess_bit) | |||
| 626 | ;; | 627 | ;; |
| 627 | mov ar.ccv=r18 // set compare value for cmpxchg | 628 | mov ar.ccv=r18 // set compare value for cmpxchg |
| 628 | or r25=_PAGE_A,r18 // set the accessed bit | 629 | or r25=_PAGE_A,r18 // set the accessed bit |
| 630 | tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit | ||
| 629 | ;; | 631 | ;; |
| 630 | cmpxchg8.acq r26=[r17],r25,ar.ccv | 632 | (p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only if page present |
| 631 | mov r24=PAGE_SHIFT<<2 | 633 | mov r24=PAGE_SHIFT<<2 |
| 632 | ;; | 634 | ;; |
| 633 | cmp.eq p6,p7=r26,r18 | 635 | (p6) cmp.eq p6,p7=r26,r18 // Only if page present |
| 634 | ;; | 636 | ;; |
| 635 | (p6) itc.i r25 // install updated PTE | 637 | (p6) itc.i r25 // install updated PTE |
| 636 | ;; | 638 | ;; |
| @@ -680,11 +682,12 @@ ENTRY(daccess_bit) | |||
| 680 | ;; // avoid RAW on r18 | 682 | ;; // avoid RAW on r18 |
| 681 | mov ar.ccv=r18 // set compare value for cmpxchg | 683 | mov ar.ccv=r18 // set compare value for cmpxchg |
| 682 | or r25=_PAGE_A,r18 // set the dirty bit | 684 | or r25=_PAGE_A,r18 // set the dirty bit |
| 685 | tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit | ||
| 683 | ;; | 686 | ;; |
| 684 | cmpxchg8.acq r26=[r17],r25,ar.ccv | 687 | (p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only if page is present |
| 685 | mov r24=PAGE_SHIFT<<2 | 688 | mov r24=PAGE_SHIFT<<2 |
| 686 | ;; | 689 | ;; |
| 687 | cmp.eq p6,p7=r26,r18 | 690 | (p6) cmp.eq p6,p7=r26,r18 // Only if page is present |
| 688 | ;; | 691 | ;; |
| 689 | (p6) itc.d r25 // install updated PTE | 692 | (p6) itc.d r25 // install updated PTE |
| 690 | /* | 693 | /* |
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 8fd93afa75a7..e883d85906db 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c | |||
| @@ -123,8 +123,9 @@ mca_page_isolate(unsigned long paddr) | |||
| 123 | void | 123 | void |
| 124 | mca_handler_bh(unsigned long paddr) | 124 | mca_handler_bh(unsigned long paddr) |
| 125 | { | 125 | { |
| 126 | printk(KERN_DEBUG "OS_MCA: process [pid: %d](%s) encounters MCA.\n", | 126 | printk(KERN_ERR |
| 127 | current->pid, current->comm); | 127 | "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n", |
| 128 | current->pid, current->comm, paddr); | ||
| 128 | 129 | ||
| 129 | spin_lock(&mca_bh_lock); | 130 | spin_lock(&mca_bh_lock); |
| 130 | switch (mca_page_isolate(paddr)) { | 131 | switch (mca_page_isolate(paddr)) { |
| @@ -132,7 +133,7 @@ mca_handler_bh(unsigned long paddr) | |||
| 132 | printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); | 133 | printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); |
| 133 | break; | 134 | break; |
| 134 | case ISOLATE_NG: | 135 | case ISOLATE_NG: |
| 135 | printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr); | 136 | printk(KERN_CRIT "Page isolation: ( %lx ) failure.\n", paddr); |
| 136 | break; | 137 | break; |
| 137 | default: | 138 | default: |
| 138 | break; | 139 | break; |
| @@ -567,10 +568,15 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, | |||
| 567 | return 0; | 568 | return 0; |
| 568 | 569 | ||
| 569 | /* | 570 | /* |
| 570 | * If there is no bus error, record is weird but we need not to recover. | 571 | * The cache check and bus check bits have four possible states |
| 572 | * cc bc | ||
| 573 | * 0 0 Weird record, not recovered | ||
| 574 | * 1 0 Cache error, not recovered | ||
| 575 | * 0 1 I/O error, attempt recovery | ||
| 576 | * 1 1 Memory error, attempt recovery | ||
| 571 | */ | 577 | */ |
| 572 | if (psp->bc == 0 || pbci == NULL) | 578 | if (psp->bc == 0 || pbci == NULL) |
| 573 | return 1; | 579 | return 0; |
| 574 | 580 | ||
| 575 | /* | 581 | /* |
| 576 | * Sorry, we cannot handle so many. | 582 | * Sorry, we cannot handle so many. |
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index 24eefb2fc55f..b2e1e746b47f 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c | |||
| @@ -446,7 +446,7 @@ static struct proc_dir_entry *proc_sn2_ptc; | |||
| 446 | static int __init sn2_ptc_init(void) | 446 | static int __init sn2_ptc_init(void) |
| 447 | { | 447 | { |
| 448 | if (!ia64_platform_is("sn2")) | 448 | if (!ia64_platform_is("sn2")) |
| 449 | return -ENOSYS; | 449 | return 0; |
| 450 | 450 | ||
| 451 | if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) { | 451 | if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) { |
| 452 | printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); | 452 | printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); |
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c index 8a56f8b5ffa2..99cb28e74295 100644 --- a/arch/ia64/sn/kernel/tiocx.c +++ b/arch/ia64/sn/kernel/tiocx.c | |||
| @@ -484,7 +484,7 @@ static int __init tiocx_init(void) | |||
| 484 | int found_tiocx_device = 0; | 484 | int found_tiocx_device = 0; |
| 485 | 485 | ||
| 486 | if (!ia64_platform_is("sn2")) | 486 | if (!ia64_platform_is("sn2")) |
| 487 | return -ENODEV; | 487 | return 0; |
| 488 | 488 | ||
| 489 | bus_register(&tiocx_bus_type); | 489 | bus_register(&tiocx_bus_type); |
| 490 | 490 | ||
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 767de847b4ab..3a0f89d2c8dc 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
| @@ -1053,6 +1053,7 @@ config CPU_MIPS32_R1 | |||
| 1053 | depends on SYS_HAS_CPU_MIPS32_R1 | 1053 | depends on SYS_HAS_CPU_MIPS32_R1 |
| 1054 | select CPU_HAS_PREFETCH | 1054 | select CPU_HAS_PREFETCH |
| 1055 | select CPU_SUPPORTS_32BIT_KERNEL | 1055 | select CPU_SUPPORTS_32BIT_KERNEL |
| 1056 | select CPU_SUPPORTS_HIGHMEM | ||
| 1056 | help | 1057 | help |
| 1057 | Choose this option to build a kernel for release 1 or later of the | 1058 | Choose this option to build a kernel for release 1 or later of the |
| 1058 | MIPS32 architecture. Most modern embedded systems with a 32-bit | 1059 | MIPS32 architecture. Most modern embedded systems with a 32-bit |
| @@ -1069,6 +1070,7 @@ config CPU_MIPS32_R2 | |||
| 1069 | depends on SYS_HAS_CPU_MIPS32_R2 | 1070 | depends on SYS_HAS_CPU_MIPS32_R2 |
| 1070 | select CPU_HAS_PREFETCH | 1071 | select CPU_HAS_PREFETCH |
| 1071 | select CPU_SUPPORTS_32BIT_KERNEL | 1072 | select CPU_SUPPORTS_32BIT_KERNEL |
| 1073 | select CPU_SUPPORTS_HIGHMEM | ||
| 1072 | help | 1074 | help |
| 1073 | Choose this option to build a kernel for release 2 or later of the | 1075 | Choose this option to build a kernel for release 2 or later of the |
| 1074 | MIPS32 architecture. Most modern embedded systems with a 32-bit | 1076 | MIPS32 architecture. Most modern embedded systems with a 32-bit |
| @@ -1082,6 +1084,7 @@ config CPU_MIPS64_R1 | |||
| 1082 | select CPU_HAS_PREFETCH | 1084 | select CPU_HAS_PREFETCH |
| 1083 | select CPU_SUPPORTS_32BIT_KERNEL | 1085 | select CPU_SUPPORTS_32BIT_KERNEL |
| 1084 | select CPU_SUPPORTS_64BIT_KERNEL | 1086 | select CPU_SUPPORTS_64BIT_KERNEL |
| 1087 | select CPU_SUPPORTS_HIGHMEM | ||
| 1085 | help | 1088 | help |
| 1086 | Choose this option to build a kernel for release 1 or later of the | 1089 | Choose this option to build a kernel for release 1 or later of the |
| 1087 | MIPS64 architecture. Many modern embedded systems with a 64-bit | 1090 | MIPS64 architecture. Many modern embedded systems with a 64-bit |
| @@ -1099,6 +1102,7 @@ config CPU_MIPS64_R2 | |||
| 1099 | select CPU_HAS_PREFETCH | 1102 | select CPU_HAS_PREFETCH |
| 1100 | select CPU_SUPPORTS_32BIT_KERNEL | 1103 | select CPU_SUPPORTS_32BIT_KERNEL |
| 1101 | select CPU_SUPPORTS_64BIT_KERNEL | 1104 | select CPU_SUPPORTS_64BIT_KERNEL |
| 1105 | select CPU_SUPPORTS_HIGHMEM | ||
| 1102 | help | 1106 | help |
| 1103 | Choose this option to build a kernel for release 2 or later of the | 1107 | Choose this option to build a kernel for release 2 or later of the |
| 1104 | MIPS64 architecture. Many modern embedded systems with a 64-bit | 1108 | MIPS64 architecture. Many modern embedded systems with a 64-bit |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 38c0f3360d51..fe9da16f3a40 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
| @@ -95,6 +95,7 @@ endif | |||
| 95 | # crossformat linking we rely on the elf2ecoff tool for format conversion. | 95 | # crossformat linking we rely on the elf2ecoff tool for format conversion. |
| 96 | # | 96 | # |
| 97 | cflags-y += -G 0 -mno-abicalls -fno-pic -pipe | 97 | cflags-y += -G 0 -mno-abicalls -fno-pic -pipe |
| 98 | cflags-y += -msoft-float | ||
| 98 | LDFLAGS_vmlinux += -G 0 -static -n -nostdlib | 99 | LDFLAGS_vmlinux += -G 0 -static -n -nostdlib |
| 99 | MODFLAGS += -mlong-calls | 100 | MODFLAGS += -mlong-calls |
| 100 | 101 | ||
diff --git a/arch/mips/arc/arc_con.c b/arch/mips/arc/arc_con.c index 51785a6a7328..bc32fe64f42a 100644 --- a/arch/mips/arc/arc_con.c +++ b/arch/mips/arc/arc_con.c | |||
| @@ -24,7 +24,7 @@ static void prom_console_write(struct console *co, const char *s, | |||
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | static int __init prom_console_setup(struct console *co, char *options) | 27 | static int prom_console_setup(struct console *co, char *options) |
| 28 | { | 28 | { |
| 29 | return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE); | 29 | return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE); |
| 30 | } | 30 | } |
diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c index 0ac067f45cf5..0613f1f36b1b 100644 --- a/arch/mips/kernel/irq-mv6434x.c +++ b/arch/mips/kernel/irq-mv6434x.c | |||
| @@ -11,12 +11,14 @@ | |||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <asm/ptrace.h> | ||
| 15 | #include <linux/sched.h> | ||
| 16 | #include <linux/kernel_stat.h> | 14 | #include <linux/kernel_stat.h> |
| 15 | #include <linux/mv643xx.h> | ||
| 16 | #include <linux/sched.h> | ||
| 17 | |||
| 18 | #include <asm/ptrace.h> | ||
| 17 | #include <asm/io.h> | 19 | #include <asm/io.h> |
| 18 | #include <asm/irq.h> | 20 | #include <asm/irq.h> |
| 19 | #include <linux/mv643xx.h> | 21 | #include <asm/marvell.h> |
| 20 | 22 | ||
| 21 | static unsigned int irq_base; | 23 | static unsigned int irq_base; |
| 22 | 24 | ||
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index ff699dbb99f7..2ad0cedf29fe 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S | |||
| @@ -106,6 +106,9 @@ SECTIONS | |||
| 106 | .con_initcall.init : { *(.con_initcall.init) } | 106 | .con_initcall.init : { *(.con_initcall.init) } |
| 107 | __con_initcall_end = .; | 107 | __con_initcall_end = .; |
| 108 | SECURITY_INIT | 108 | SECURITY_INIT |
| 109 | /* .exit.text is discarded at runtime, not link time, to deal with | ||
| 110 | references from .rodata */ | ||
| 111 | .exit.text : { *(.exit.text) } | ||
| 109 | . = ALIGN(_PAGE_SIZE); | 112 | . = ALIGN(_PAGE_SIZE); |
| 110 | __initramfs_start = .; | 113 | __initramfs_start = .; |
| 111 | .init.ramfs : { *(.init.ramfs) } | 114 | .init.ramfs : { *(.init.ramfs) } |
| @@ -133,7 +136,6 @@ SECTIONS | |||
| 133 | 136 | ||
| 134 | /* Sections to be discarded */ | 137 | /* Sections to be discarded */ |
| 135 | /DISCARD/ : { | 138 | /DISCARD/ : { |
| 136 | *(.exit.text) | ||
| 137 | *(.exit.data) | 139 | *(.exit.data) |
| 138 | *(.exitcall.exit) | 140 | *(.exitcall.exit) |
| 139 | 141 | ||
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 0f9485806bac..ac4f4bfaae50 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
| @@ -280,69 +280,69 @@ static void __init build_insn(u32 **buf, enum opcode opc, ...) | |||
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | #define I_u1u2u3(op) \ | 282 | #define I_u1u2u3(op) \ |
| 283 | static inline void i##op(u32 **buf, unsigned int a, \ | 283 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 284 | unsigned int b, unsigned int c) \ | 284 | unsigned int b, unsigned int c) \ |
| 285 | { \ | 285 | { \ |
| 286 | build_insn(buf, insn##op, a, b, c); \ | 286 | build_insn(buf, insn##op, a, b, c); \ |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | #define I_u2u1u3(op) \ | 289 | #define I_u2u1u3(op) \ |
| 290 | static inline void i##op(u32 **buf, unsigned int a, \ | 290 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 291 | unsigned int b, unsigned int c) \ | 291 | unsigned int b, unsigned int c) \ |
| 292 | { \ | 292 | { \ |
| 293 | build_insn(buf, insn##op, b, a, c); \ | 293 | build_insn(buf, insn##op, b, a, c); \ |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | #define I_u3u1u2(op) \ | 296 | #define I_u3u1u2(op) \ |
| 297 | static inline void i##op(u32 **buf, unsigned int a, \ | 297 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 298 | unsigned int b, unsigned int c) \ | 298 | unsigned int b, unsigned int c) \ |
| 299 | { \ | 299 | { \ |
| 300 | build_insn(buf, insn##op, b, c, a); \ | 300 | build_insn(buf, insn##op, b, c, a); \ |
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | #define I_u1u2s3(op) \ | 303 | #define I_u1u2s3(op) \ |
| 304 | static inline void i##op(u32 **buf, unsigned int a, \ | 304 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 305 | unsigned int b, signed int c) \ | 305 | unsigned int b, signed int c) \ |
| 306 | { \ | 306 | { \ |
| 307 | build_insn(buf, insn##op, a, b, c); \ | 307 | build_insn(buf, insn##op, a, b, c); \ |
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | #define I_u2s3u1(op) \ | 310 | #define I_u2s3u1(op) \ |
| 311 | static inline void i##op(u32 **buf, unsigned int a, \ | 311 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 312 | signed int b, unsigned int c) \ | 312 | signed int b, unsigned int c) \ |
| 313 | { \ | 313 | { \ |
| 314 | build_insn(buf, insn##op, c, a, b); \ | 314 | build_insn(buf, insn##op, c, a, b); \ |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | #define I_u2u1s3(op) \ | 317 | #define I_u2u1s3(op) \ |
| 318 | static inline void i##op(u32 **buf, unsigned int a, \ | 318 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 319 | unsigned int b, signed int c) \ | 319 | unsigned int b, signed int c) \ |
| 320 | { \ | 320 | { \ |
| 321 | build_insn(buf, insn##op, b, a, c); \ | 321 | build_insn(buf, insn##op, b, a, c); \ |
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | #define I_u1u2(op) \ | 324 | #define I_u1u2(op) \ |
| 325 | static inline void i##op(u32 **buf, unsigned int a, \ | 325 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 326 | unsigned int b) \ | 326 | unsigned int b) \ |
| 327 | { \ | 327 | { \ |
| 328 | build_insn(buf, insn##op, a, b); \ | 328 | build_insn(buf, insn##op, a, b); \ |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | #define I_u1s2(op) \ | 331 | #define I_u1s2(op) \ |
| 332 | static inline void i##op(u32 **buf, unsigned int a, \ | 332 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
| 333 | signed int b) \ | 333 | signed int b) \ |
| 334 | { \ | 334 | { \ |
| 335 | build_insn(buf, insn##op, a, b); \ | 335 | build_insn(buf, insn##op, a, b); \ |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | #define I_u1(op) \ | 338 | #define I_u1(op) \ |
| 339 | static inline void i##op(u32 **buf, unsigned int a) \ | 339 | static inline void __init i##op(u32 **buf, unsigned int a) \ |
| 340 | { \ | 340 | { \ |
| 341 | build_insn(buf, insn##op, a); \ | 341 | build_insn(buf, insn##op, a); \ |
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | #define I_0(op) \ | 344 | #define I_0(op) \ |
| 345 | static inline void i##op(u32 **buf) \ | 345 | static inline void __init i##op(u32 **buf) \ |
| 346 | { \ | 346 | { \ |
| 347 | build_insn(buf, insn##op); \ | 347 | build_insn(buf, insn##op); \ |
| 348 | } | 348 | } |
| @@ -623,42 +623,42 @@ static __init int __attribute__((unused)) insn_has_bdelay(struct reloc *rel, | |||
| 623 | } | 623 | } |
| 624 | 624 | ||
| 625 | /* convenience functions for labeled branches */ | 625 | /* convenience functions for labeled branches */ |
| 626 | static void __attribute__((unused)) il_bltz(u32 **p, struct reloc **r, | 626 | static void __init __attribute__((unused)) |
| 627 | unsigned int reg, enum label_id l) | 627 | il_bltz(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) |
| 628 | { | 628 | { |
| 629 | r_mips_pc16(r, *p, l); | 629 | r_mips_pc16(r, *p, l); |
| 630 | i_bltz(p, reg, 0); | 630 | i_bltz(p, reg, 0); |
| 631 | } | 631 | } |
| 632 | 632 | ||
| 633 | static void __attribute__((unused)) il_b(u32 **p, struct reloc **r, | 633 | static void __init __attribute__((unused)) il_b(u32 **p, struct reloc **r, |
| 634 | enum label_id l) | 634 | enum label_id l) |
| 635 | { | 635 | { |
| 636 | r_mips_pc16(r, *p, l); | 636 | r_mips_pc16(r, *p, l); |
| 637 | i_b(p, 0); | 637 | i_b(p, 0); |
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | static void il_beqz(u32 **p, struct reloc **r, unsigned int reg, | 640 | static void __init il_beqz(u32 **p, struct reloc **r, unsigned int reg, |
| 641 | enum label_id l) | 641 | enum label_id l) |
| 642 | { | 642 | { |
| 643 | r_mips_pc16(r, *p, l); | 643 | r_mips_pc16(r, *p, l); |
| 644 | i_beqz(p, reg, 0); | 644 | i_beqz(p, reg, 0); |
| 645 | } | 645 | } |
| 646 | 646 | ||
| 647 | static void __attribute__((unused)) | 647 | static void __init __attribute__((unused)) |
| 648 | il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) | 648 | il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) |
| 649 | { | 649 | { |
| 650 | r_mips_pc16(r, *p, l); | 650 | r_mips_pc16(r, *p, l); |
| 651 | i_beqzl(p, reg, 0); | 651 | i_beqzl(p, reg, 0); |
| 652 | } | 652 | } |
| 653 | 653 | ||
| 654 | static void il_bnez(u32 **p, struct reloc **r, unsigned int reg, | 654 | static void __init il_bnez(u32 **p, struct reloc **r, unsigned int reg, |
| 655 | enum label_id l) | 655 | enum label_id l) |
| 656 | { | 656 | { |
| 657 | r_mips_pc16(r, *p, l); | 657 | r_mips_pc16(r, *p, l); |
| 658 | i_bnez(p, reg, 0); | 658 | i_bnez(p, reg, 0); |
| 659 | } | 659 | } |
| 660 | 660 | ||
| 661 | static void il_bgezl(u32 **p, struct reloc **r, unsigned int reg, | 661 | static void __init il_bgezl(u32 **p, struct reloc **r, unsigned int reg, |
| 662 | enum label_id l) | 662 | enum label_id l) |
| 663 | { | 663 | { |
| 664 | r_mips_pc16(r, *p, l); | 664 | r_mips_pc16(r, *p, l); |
diff --git a/arch/mips/momentum/jaguar_atx/prom.c b/arch/mips/momentum/jaguar_atx/prom.c index aae7a802767a..1cadaa92946a 100644 --- a/arch/mips/momentum/jaguar_atx/prom.c +++ b/arch/mips/momentum/jaguar_atx/prom.c | |||
| @@ -21,10 +21,10 @@ | |||
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
| 23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
| 24 | #include <linux/mv643xx.h> | ||
| 24 | 25 | ||
| 25 | #include <asm/addrspace.h> | 26 | #include <asm/addrspace.h> |
| 26 | #include <asm/bootinfo.h> | 27 | #include <asm/bootinfo.h> |
| 27 | #include <asm/mv64340.h> | ||
| 28 | #include <asm/pmon.h> | 28 | #include <asm/pmon.h> |
| 29 | 29 | ||
| 30 | #include "jaguar_atx_fpga.h" | 30 | #include "jaguar_atx_fpga.h" |
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c index 301d67226d72..2699917b640a 100644 --- a/arch/mips/momentum/jaguar_atx/setup.c +++ b/arch/mips/momentum/jaguar_atx/setup.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * BRIEF MODULE DESCRIPTION | 2 | * BRIEF MODULE DESCRIPTION |
| 3 | * Momentum Computer Jaguar-ATX board dependent boot routines | 3 | * Momentum Computer Jaguar-ATX board dependent boot routines |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 1996, 1997, 2001, 2004 Ralf Baechle (ralf@linux-mips.org) | 5 | * Copyright (C) 1996, 1997, 2001, 04, 06 Ralf Baechle (ralf@linux-mips.org) |
| 6 | * Copyright (C) 2000 RidgeRun, Inc. | 6 | * Copyright (C) 2000 RidgeRun, Inc. |
| 7 | * Copyright (C) 2001 Red Hat, Inc. | 7 | * Copyright (C) 2001 Red Hat, Inc. |
| 8 | * Copyright (C) 2002 Momentum Computer | 8 | * Copyright (C) 2002 Momentum Computer |
| @@ -55,6 +55,8 @@ | |||
| 55 | #include <linux/interrupt.h> | 55 | #include <linux/interrupt.h> |
| 56 | #include <linux/timex.h> | 56 | #include <linux/timex.h> |
| 57 | #include <linux/vmalloc.h> | 57 | #include <linux/vmalloc.h> |
| 58 | #include <linux/mv643xx.h> | ||
| 59 | |||
| 58 | #include <asm/time.h> | 60 | #include <asm/time.h> |
| 59 | #include <asm/bootinfo.h> | 61 | #include <asm/bootinfo.h> |
| 60 | #include <asm/page.h> | 62 | #include <asm/page.h> |
| @@ -64,7 +66,6 @@ | |||
| 64 | #include <asm/ptrace.h> | 66 | #include <asm/ptrace.h> |
| 65 | #include <asm/reboot.h> | 67 | #include <asm/reboot.h> |
| 66 | #include <asm/tlbflush.h> | 68 | #include <asm/tlbflush.h> |
| 67 | #include <asm/mv64340.h> | ||
| 68 | 69 | ||
| 69 | #include "jaguar_atx_fpga.h" | 70 | #include "jaguar_atx_fpga.h" |
| 70 | 71 | ||
diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c index 300fe8e4fbe8..a5764bc20e36 100644 --- a/arch/mips/momentum/ocelot_c/irq.c +++ b/arch/mips/momentum/ocelot_c/irq.c | |||
| @@ -41,11 +41,11 @@ | |||
| 41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
| 42 | #include <linux/random.h> | 42 | #include <linux/random.h> |
| 43 | #include <linux/bitops.h> | 43 | #include <linux/bitops.h> |
| 44 | #include <linux/mv643xx.h> | ||
| 44 | #include <asm/bootinfo.h> | 45 | #include <asm/bootinfo.h> |
| 45 | #include <asm/io.h> | 46 | #include <asm/io.h> |
| 46 | #include <asm/irq_cpu.h> | 47 | #include <asm/irq_cpu.h> |
| 47 | #include <asm/mipsregs.h> | 48 | #include <asm/mipsregs.h> |
| 48 | #include <asm/mv64340.h> | ||
| 49 | #include <asm/system.h> | 49 | #include <asm/system.h> |
| 50 | 50 | ||
| 51 | extern asmlinkage void ocelot_handle_int(void); | 51 | extern asmlinkage void ocelot_handle_int(void); |
diff --git a/arch/mips/momentum/ocelot_c/prom.c b/arch/mips/momentum/ocelot_c/prom.c index 5b6809724b15..e92364482c7b 100644 --- a/arch/mips/momentum/ocelot_c/prom.c +++ b/arch/mips/momentum/ocelot_c/prom.c | |||
| @@ -19,10 +19,10 @@ | |||
| 19 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
| 20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 21 | #include <linux/bootmem.h> | 21 | #include <linux/bootmem.h> |
| 22 | #include <linux/mv643xx.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/addrspace.h> | 24 | #include <asm/addrspace.h> |
| 24 | #include <asm/bootinfo.h> | 25 | #include <asm/bootinfo.h> |
| 25 | #include <asm/mv64340.h> | ||
| 26 | #include <asm/pmon.h> | 26 | #include <asm/pmon.h> |
| 27 | 27 | ||
| 28 | #include "ocelot_c_fpga.h" | 28 | #include "ocelot_c_fpga.h" |
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c index 15998d8a9341..bd02e60d037a 100644 --- a/arch/mips/momentum/ocelot_c/setup.c +++ b/arch/mips/momentum/ocelot_c/setup.c | |||
| @@ -54,6 +54,7 @@ | |||
| 54 | #include <linux/pm.h> | 54 | #include <linux/pm.h> |
| 55 | #include <linux/timex.h> | 55 | #include <linux/timex.h> |
| 56 | #include <linux/vmalloc.h> | 56 | #include <linux/vmalloc.h> |
| 57 | #include <linux/mv643xx.h> | ||
| 57 | 58 | ||
| 58 | #include <asm/time.h> | 59 | #include <asm/time.h> |
| 59 | #include <asm/bootinfo.h> | 60 | #include <asm/bootinfo.h> |
| @@ -64,9 +65,9 @@ | |||
| 64 | #include <asm/processor.h> | 65 | #include <asm/processor.h> |
| 65 | #include <asm/ptrace.h> | 66 | #include <asm/ptrace.h> |
| 66 | #include <asm/reboot.h> | 67 | #include <asm/reboot.h> |
| 68 | #include <asm/marvell.h> | ||
| 67 | #include <linux/bootmem.h> | 69 | #include <linux/bootmem.h> |
| 68 | #include <linux/blkdev.h> | 70 | #include <linux/blkdev.h> |
| 69 | #include <asm/mv64340.h> | ||
| 70 | #include "ocelot_c_fpga.h" | 71 | #include "ocelot_c_fpga.h" |
| 71 | 72 | ||
| 72 | unsigned long marvell_base; | 73 | unsigned long marvell_base; |
| @@ -252,22 +253,22 @@ void __init plat_setup(void) | |||
| 252 | /* shut down ethernet ports, just to be sure our memory doesn't get | 253 | /* shut down ethernet ports, just to be sure our memory doesn't get |
| 253 | * corrupted by random ethernet traffic. | 254 | * corrupted by random ethernet traffic. |
| 254 | */ | 255 | */ |
| 255 | MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8); | 256 | MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8); |
| 256 | MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8); | 257 | MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8); |
| 257 | MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8); | 258 | MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8); |
| 258 | MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8); | 259 | MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8); |
| 259 | do {} | 260 | do {} |
| 260 | while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff); | 261 | while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff); |
| 261 | do {} | 262 | do {} |
| 262 | while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff); | 263 | while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff); |
| 263 | do {} | 264 | do {} |
| 264 | while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff); | 265 | while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff); |
| 265 | do {} | 266 | do {} |
| 266 | while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff); | 267 | while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff); |
| 267 | MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0), | 268 | MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0), |
| 268 | MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1); | 269 | MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1); |
| 269 | MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1), | 270 | MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1), |
| 270 | MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1); | 271 | MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1); |
| 271 | 272 | ||
| 272 | /* Turn off the Bit-Error LED */ | 273 | /* Turn off the Bit-Error LED */ |
| 273 | OCELOT_FPGA_WRITE(0x80, CLR); | 274 | OCELOT_FPGA_WRITE(0x80, CLR); |
diff --git a/arch/mips/pci/pci-ocelot-c.c b/arch/mips/pci/pci-ocelot-c.c index 1d84d36e034d..027759f7c904 100644 --- a/arch/mips/pci/pci-ocelot-c.c +++ b/arch/mips/pci/pci-ocelot-c.c | |||
| @@ -3,15 +3,17 @@ | |||
| 3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. | 4 | * for more details. |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) | 6 | * Copyright (C) 2004, 06 by Ralf Baechle (ralf@linux-mips.org) |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
| 10 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
| 11 | #include <asm/mv64340.h> | 11 | #include <linux/mv643xx.h> |
| 12 | 12 | ||
| 13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| 14 | 14 | ||
| 15 | #include <asm/marvell.h> | ||
| 16 | |||
| 15 | /* | 17 | /* |
| 16 | * We assume the address ranges have already been setup appropriately by | 18 | * We assume the address ranges have already been setup appropriately by |
| 17 | * the firmware. PMON in case of the Ocelot C does that. | 19 | * the firmware. PMON in case of the Ocelot C does that. |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 840aad43a98b..c9a660e4c2db 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
| @@ -92,7 +92,6 @@ int main(void) | |||
| 92 | 92 | ||
| 93 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); | 93 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); |
| 94 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); | 94 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); |
| 95 | DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame)); | ||
| 96 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); | 95 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); |
| 97 | #ifdef CONFIG_PPC32 | 96 | #ifdef CONFIG_PPC32 |
| 98 | DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); | 97 | DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 10696456a4c6..e4e81374cb9a 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
| @@ -53,8 +53,10 @@ extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec); | |||
| 53 | PPC_FEATURE_HAS_MMU) | 53 | PPC_FEATURE_HAS_MMU) |
| 54 | #define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64) | 54 | #define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64) |
| 55 | #define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4) | 55 | #define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4) |
| 56 | #define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5) | 56 | #define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\ |
| 57 | #define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS) | 57 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP) |
| 58 | #define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\ | ||
| 59 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP) | ||
| 58 | #define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ | 60 | #define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ |
| 59 | PPC_FEATURE_BOOKE) | 61 | PPC_FEATURE_BOOKE) |
| 60 | 62 | ||
| @@ -267,7 +269,8 @@ struct cpu_spec cpu_specs[] = { | |||
| 267 | .cpu_name = "Cell Broadband Engine", | 269 | .cpu_name = "Cell Broadband Engine", |
| 268 | .cpu_features = CPU_FTRS_CELL, | 270 | .cpu_features = CPU_FTRS_CELL, |
| 269 | .cpu_user_features = COMMON_USER_PPC64 | | 271 | .cpu_user_features = COMMON_USER_PPC64 | |
| 270 | PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP, | 272 | PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP | |
| 273 | PPC_FEATURE_SMT, | ||
| 271 | .icache_bsize = 128, | 274 | .icache_bsize = 128, |
| 272 | .dcache_bsize = 128, | 275 | .dcache_bsize = 128, |
| 273 | .cpu_setup = __setup_cpu_be, | 276 | .cpu_setup = __setup_cpu_be, |
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index f20a67261ec7..4827ca1ec89b 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
| @@ -227,7 +227,7 @@ ret_from_syscall: | |||
| 227 | MTMSRD(r10) | 227 | MTMSRD(r10) |
| 228 | lwz r9,TI_FLAGS(r12) | 228 | lwz r9,TI_FLAGS(r12) |
| 229 | li r8,-_LAST_ERRNO | 229 | li r8,-_LAST_ERRNO |
| 230 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK) | 230 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK) |
| 231 | bne- syscall_exit_work | 231 | bne- syscall_exit_work |
| 232 | cmplw 0,r3,r8 | 232 | cmplw 0,r3,r8 |
| 233 | blt+ syscall_exit_cont | 233 | blt+ syscall_exit_cont |
| @@ -287,8 +287,10 @@ syscall_dotrace: | |||
| 287 | 287 | ||
| 288 | syscall_exit_work: | 288 | syscall_exit_work: |
| 289 | andi. r0,r9,_TIF_RESTOREALL | 289 | andi. r0,r9,_TIF_RESTOREALL |
| 290 | bne- 2f | 290 | beq+ 0f |
| 291 | cmplw 0,r3,r8 | 291 | REST_NVGPRS(r1) |
| 292 | b 2f | ||
| 293 | 0: cmplw 0,r3,r8 | ||
| 292 | blt+ 1f | 294 | blt+ 1f |
| 293 | andi. r0,r9,_TIF_NOERROR | 295 | andi. r0,r9,_TIF_NOERROR |
| 294 | bne- 1f | 296 | bne- 1f |
| @@ -302,9 +304,7 @@ syscall_exit_work: | |||
| 302 | 2: andi. r0,r9,(_TIF_PERSYSCALL_MASK) | 304 | 2: andi. r0,r9,(_TIF_PERSYSCALL_MASK) |
| 303 | beq 4f | 305 | beq 4f |
| 304 | 306 | ||
| 305 | /* Clear per-syscall TIF flags if any are set, but _leave_ | 307 | /* Clear per-syscall TIF flags if any are set. */ |
| 306 | _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that | ||
| 307 | yet. */ | ||
| 308 | 308 | ||
| 309 | li r11,_TIF_PERSYSCALL_MASK | 309 | li r11,_TIF_PERSYSCALL_MASK |
| 310 | addi r12,r12,TI_FLAGS | 310 | addi r12,r12,TI_FLAGS |
| @@ -318,8 +318,13 @@ syscall_exit_work: | |||
| 318 | subi r12,r12,TI_FLAGS | 318 | subi r12,r12,TI_FLAGS |
| 319 | 319 | ||
| 320 | 4: /* Anything which requires enabling interrupts? */ | 320 | 4: /* Anything which requires enabling interrupts? */ |
| 321 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS) | 321 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) |
| 322 | beq 7f | 322 | beq ret_from_except |
| 323 | |||
| 324 | /* Re-enable interrupts */ | ||
| 325 | ori r10,r10,MSR_EE | ||
| 326 | SYNC | ||
| 327 | MTMSRD(r10) | ||
| 323 | 328 | ||
| 324 | /* Save NVGPRS if they're not saved already */ | 329 | /* Save NVGPRS if they're not saved already */ |
| 325 | lwz r4,_TRAP(r1) | 330 | lwz r4,_TRAP(r1) |
| @@ -328,71 +333,11 @@ syscall_exit_work: | |||
| 328 | SAVE_NVGPRS(r1) | 333 | SAVE_NVGPRS(r1) |
| 329 | li r4,0xc00 | 334 | li r4,0xc00 |
| 330 | stw r4,_TRAP(r1) | 335 | stw r4,_TRAP(r1) |
| 331 | 336 | 5: | |
| 332 | /* Re-enable interrupts */ | ||
| 333 | 5: ori r10,r10,MSR_EE | ||
| 334 | SYNC | ||
| 335 | MTMSRD(r10) | ||
| 336 | |||
| 337 | andi. r0,r9,_TIF_SAVE_NVGPRS | ||
| 338 | bne save_user_nvgprs | ||
| 339 | |||
| 340 | save_user_nvgprs_cont: | ||
| 341 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) | ||
| 342 | beq 7f | ||
| 343 | |||
| 344 | addi r3,r1,STACK_FRAME_OVERHEAD | 337 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 345 | bl do_syscall_trace_leave | 338 | bl do_syscall_trace_leave |
| 346 | REST_NVGPRS(r1) | 339 | b ret_from_except_full |
| 347 | |||
| 348 | 6: lwz r3,GPR3(r1) | ||
| 349 | LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */ | ||
| 350 | SYNC | ||
| 351 | MTMSRD(r10) /* disable interrupts again */ | ||
| 352 | rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ | ||
| 353 | lwz r9,TI_FLAGS(r12) | ||
| 354 | 7: | ||
| 355 | andi. r0,r9,_TIF_NEED_RESCHED | ||
| 356 | bne 8f | ||
| 357 | lwz r5,_MSR(r1) | ||
| 358 | andi. r5,r5,MSR_PR | ||
| 359 | beq ret_from_except | ||
| 360 | andi. r0,r9,_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK | ||
| 361 | beq ret_from_except | ||
| 362 | b do_user_signal | ||
| 363 | 8: | ||
| 364 | ori r10,r10,MSR_EE | ||
| 365 | SYNC | ||
| 366 | MTMSRD(r10) /* re-enable interrupts */ | ||
| 367 | bl schedule | ||
| 368 | b 6b | ||
| 369 | |||
| 370 | save_user_nvgprs: | ||
| 371 | lwz r8,TI_SIGFRAME(r12) | ||
| 372 | |||
| 373 | .macro savewords start, end | ||
| 374 | 1: stw \start,4*(\start)(r8) | ||
| 375 | .section __ex_table,"a" | ||
| 376 | .align 2 | ||
| 377 | .long 1b,save_user_nvgprs_fault | ||
| 378 | .previous | ||
| 379 | .if \end - \start | ||
| 380 | savewords "(\start+1)",\end | ||
| 381 | .endif | ||
| 382 | .endm | ||
| 383 | savewords 14,31 | ||
| 384 | b save_user_nvgprs_cont | ||
| 385 | |||
| 386 | |||
| 387 | save_user_nvgprs_fault: | ||
| 388 | li r3,11 /* SIGSEGV */ | ||
| 389 | lwz r4,TI_TASK(r12) | ||
| 390 | bl force_sigsegv | ||
| 391 | 340 | ||
| 392 | rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ | ||
| 393 | lwz r9,TI_FLAGS(r12) | ||
| 394 | b save_user_nvgprs_cont | ||
| 395 | |||
| 396 | #ifdef SHOW_SYSCALLS | 341 | #ifdef SHOW_SYSCALLS |
| 397 | do_show_syscall: | 342 | do_show_syscall: |
| 398 | #ifdef SHOW_SYSCALLS_TASK | 343 | #ifdef SHOW_SYSCALLS_TASK |
| @@ -490,6 +435,14 @@ ppc_clone: | |||
| 490 | stw r0,_TRAP(r1) /* register set saved */ | 435 | stw r0,_TRAP(r1) /* register set saved */ |
| 491 | b sys_clone | 436 | b sys_clone |
| 492 | 437 | ||
| 438 | .globl ppc_swapcontext | ||
| 439 | ppc_swapcontext: | ||
| 440 | SAVE_NVGPRS(r1) | ||
| 441 | lwz r0,_TRAP(r1) | ||
| 442 | rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */ | ||
| 443 | stw r0,_TRAP(r1) /* register set saved */ | ||
| 444 | b sys_swapcontext | ||
| 445 | |||
| 493 | /* | 446 | /* |
| 494 | * Top-level page fault handling. | 447 | * Top-level page fault handling. |
| 495 | * This is in assembler because if do_page_fault tells us that | 448 | * This is in assembler because if do_page_fault tells us that |
| @@ -683,7 +636,7 @@ user_exc_return: /* r10 contains MSR_KERNEL here */ | |||
| 683 | /* Check current_thread_info()->flags */ | 636 | /* Check current_thread_info()->flags */ |
| 684 | rlwinm r9,r1,0,0,(31-THREAD_SHIFT) | 637 | rlwinm r9,r1,0,0,(31-THREAD_SHIFT) |
| 685 | lwz r9,TI_FLAGS(r9) | 638 | lwz r9,TI_FLAGS(r9) |
| 686 | andi. r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK) | 639 | andi. r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED) |
| 687 | bne do_work | 640 | bne do_work |
| 688 | 641 | ||
| 689 | restore_user: | 642 | restore_user: |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 388f861b8ed1..24be0cf86d7f 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
| @@ -160,7 +160,7 @@ syscall_exit: | |||
| 160 | mtmsrd r10,1 | 160 | mtmsrd r10,1 |
| 161 | ld r9,TI_FLAGS(r12) | 161 | ld r9,TI_FLAGS(r12) |
| 162 | li r11,-_LAST_ERRNO | 162 | li r11,-_LAST_ERRNO |
| 163 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_SAVE_NVGPRS|_TIF_NOERROR|_TIF_RESTORE_SIGMASK) | 163 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK) |
| 164 | bne- syscall_exit_work | 164 | bne- syscall_exit_work |
| 165 | cmpld r3,r11 | 165 | cmpld r3,r11 |
| 166 | ld r5,_CCR(r1) | 166 | ld r5,_CCR(r1) |
| @@ -216,8 +216,10 @@ syscall_exit_work: | |||
| 216 | If TIF_NOERROR is set, just save r3 as it is. */ | 216 | If TIF_NOERROR is set, just save r3 as it is. */ |
| 217 | 217 | ||
| 218 | andi. r0,r9,_TIF_RESTOREALL | 218 | andi. r0,r9,_TIF_RESTOREALL |
| 219 | bne- 2f | 219 | beq+ 0f |
| 220 | cmpld r3,r11 /* r10 is -LAST_ERRNO */ | 220 | REST_NVGPRS(r1) |
| 221 | b 2f | ||
| 222 | 0: cmpld r3,r11 /* r10 is -LAST_ERRNO */ | ||
| 221 | blt+ 1f | 223 | blt+ 1f |
| 222 | andi. r0,r9,_TIF_NOERROR | 224 | andi. r0,r9,_TIF_NOERROR |
| 223 | bne- 1f | 225 | bne- 1f |
| @@ -229,9 +231,7 @@ syscall_exit_work: | |||
| 229 | 2: andi. r0,r9,(_TIF_PERSYSCALL_MASK) | 231 | 2: andi. r0,r9,(_TIF_PERSYSCALL_MASK) |
| 230 | beq 4f | 232 | beq 4f |
| 231 | 233 | ||
| 232 | /* Clear per-syscall TIF flags if any are set, but _leave_ | 234 | /* Clear per-syscall TIF flags if any are set. */ |
| 233 | _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that | ||
| 234 | yet. */ | ||
| 235 | 235 | ||
| 236 | li r11,_TIF_PERSYSCALL_MASK | 236 | li r11,_TIF_PERSYSCALL_MASK |
| 237 | addi r12,r12,TI_FLAGS | 237 | addi r12,r12,TI_FLAGS |
| @@ -240,10 +240,9 @@ syscall_exit_work: | |||
| 240 | stdcx. r10,0,r12 | 240 | stdcx. r10,0,r12 |
| 241 | bne- 3b | 241 | bne- 3b |
| 242 | subi r12,r12,TI_FLAGS | 242 | subi r12,r12,TI_FLAGS |
| 243 | 243 | ||
| 244 | 4: bl .save_nvgprs | 244 | 4: /* Anything else left to do? */ |
| 245 | /* Anything else left to do? */ | 245 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) |
| 246 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS) | ||
| 247 | beq .ret_from_except_lite | 246 | beq .ret_from_except_lite |
| 248 | 247 | ||
| 249 | /* Re-enable interrupts */ | 248 | /* Re-enable interrupts */ |
| @@ -251,26 +250,10 @@ syscall_exit_work: | |||
| 251 | ori r10,r10,MSR_EE | 250 | ori r10,r10,MSR_EE |
| 252 | mtmsrd r10,1 | 251 | mtmsrd r10,1 |
| 253 | 252 | ||
| 254 | andi. r0,r9,_TIF_SAVE_NVGPRS | 253 | bl .save_nvgprs |
| 255 | bne save_user_nvgprs | ||
| 256 | |||
| 257 | /* If tracing, re-enable interrupts and do it */ | ||
| 258 | save_user_nvgprs_cont: | ||
| 259 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) | ||
| 260 | beq 5f | ||
| 261 | |||
| 262 | addi r3,r1,STACK_FRAME_OVERHEAD | 254 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 263 | bl .do_syscall_trace_leave | 255 | bl .do_syscall_trace_leave |
| 264 | REST_NVGPRS(r1) | 256 | b .ret_from_except |
| 265 | clrrdi r12,r1,THREAD_SHIFT | ||
| 266 | |||
| 267 | /* Disable interrupts again and handle other work if any */ | ||
| 268 | 5: mfmsr r10 | ||
| 269 | rldicl r10,r10,48,1 | ||
| 270 | rotldi r10,r10,16 | ||
| 271 | mtmsrd r10,1 | ||
| 272 | |||
| 273 | b .ret_from_except_lite | ||
| 274 | 257 | ||
| 275 | /* Save non-volatile GPRs, if not already saved. */ | 258 | /* Save non-volatile GPRs, if not already saved. */ |
| 276 | _GLOBAL(save_nvgprs) | 259 | _GLOBAL(save_nvgprs) |
| @@ -282,51 +265,6 @@ _GLOBAL(save_nvgprs) | |||
| 282 | std r0,_TRAP(r1) | 265 | std r0,_TRAP(r1) |
| 283 | blr | 266 | blr |
| 284 | 267 | ||
| 285 | |||
| 286 | save_user_nvgprs: | ||
| 287 | ld r10,TI_SIGFRAME(r12) | ||
| 288 | andi. r0,r9,_TIF_32BIT | ||
| 289 | beq- save_user_nvgprs_64 | ||
| 290 | |||
| 291 | /* 32-bit save to userspace */ | ||
| 292 | |||
| 293 | .macro savewords start, end | ||
| 294 | 1: stw \start,4*(\start)(r10) | ||
| 295 | .section __ex_table,"a" | ||
| 296 | .align 3 | ||
| 297 | .llong 1b,save_user_nvgprs_fault | ||
| 298 | .previous | ||
| 299 | .if \end - \start | ||
| 300 | savewords "(\start+1)",\end | ||
| 301 | .endif | ||
| 302 | .endm | ||
| 303 | savewords 14,31 | ||
| 304 | b save_user_nvgprs_cont | ||
| 305 | |||
| 306 | save_user_nvgprs_64: | ||
| 307 | /* 64-bit save to userspace */ | ||
| 308 | |||
| 309 | .macro savelongs start, end | ||
| 310 | 1: std \start,8*(\start)(r10) | ||
| 311 | .section __ex_table,"a" | ||
| 312 | .align 3 | ||
| 313 | .llong 1b,save_user_nvgprs_fault | ||
| 314 | .previous | ||
| 315 | .if \end - \start | ||
| 316 | savelongs "(\start+1)",\end | ||
| 317 | .endif | ||
| 318 | .endm | ||
| 319 | savelongs 14,31 | ||
| 320 | b save_user_nvgprs_cont | ||
| 321 | |||
| 322 | save_user_nvgprs_fault: | ||
| 323 | li r3,11 /* SIGSEGV */ | ||
| 324 | ld r4,TI_TASK(r12) | ||
| 325 | bl .force_sigsegv | ||
| 326 | |||
| 327 | clrrdi r12,r1,THREAD_SHIFT | ||
| 328 | ld r9,TI_FLAGS(r12) | ||
| 329 | b save_user_nvgprs_cont | ||
| 330 | 268 | ||
| 331 | /* | 269 | /* |
| 332 | * The sigsuspend and rt_sigsuspend system calls can call do_signal | 270 | * The sigsuspend and rt_sigsuspend system calls can call do_signal |
| @@ -352,6 +290,16 @@ _GLOBAL(ppc_clone) | |||
| 352 | bl .sys_clone | 290 | bl .sys_clone |
| 353 | b syscall_exit | 291 | b syscall_exit |
| 354 | 292 | ||
| 293 | _GLOBAL(ppc32_swapcontext) | ||
| 294 | bl .save_nvgprs | ||
| 295 | bl .compat_sys_swapcontext | ||
| 296 | b syscall_exit | ||
| 297 | |||
| 298 | _GLOBAL(ppc64_swapcontext) | ||
| 299 | bl .save_nvgprs | ||
| 300 | bl .sys_swapcontext | ||
| 301 | b syscall_exit | ||
| 302 | |||
| 355 | _GLOBAL(ret_from_fork) | 303 | _GLOBAL(ret_from_fork) |
| 356 | bl .schedule_tail | 304 | bl .schedule_tail |
| 357 | REST_NVGPRS(r1) | 305 | REST_NVGPRS(r1) |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index d34fe537400e..813c2cd194c2 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
| @@ -978,7 +978,7 @@ static void __init prom_init_mem(void) | |||
| 978 | if (size == 0) | 978 | if (size == 0) |
| 979 | continue; | 979 | continue; |
| 980 | prom_debug(" %x %x\n", base, size); | 980 | prom_debug(" %x %x\n", base, size); |
| 981 | if (base == 0) | 981 | if (base == 0 && (RELOC(of_platform) & PLATFORM_LPAR)) |
| 982 | RELOC(rmo_top) = size; | 982 | RELOC(rmo_top) = size; |
| 983 | if ((base + size) > RELOC(ram_top)) | 983 | if ((base + size) > RELOC(ram_top)) |
| 984 | RELOC(ram_top) = base + size; | 984 | RELOC(ram_top) = base + size; |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 400793c71304..bcb83574335b 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
| @@ -561,10 +561,7 @@ void do_syscall_trace_leave(struct pt_regs *regs) | |||
| 561 | regs->result); | 561 | regs->result); |
| 562 | 562 | ||
| 563 | if ((test_thread_flag(TIF_SYSCALL_TRACE) | 563 | if ((test_thread_flag(TIF_SYSCALL_TRACE) |
| 564 | #ifdef CONFIG_PPC64 | 564 | || test_thread_flag(TIF_SINGLESTEP)) |
| 565 | || test_thread_flag(TIF_SINGLESTEP) | ||
| 566 | #endif | ||
| 567 | ) | ||
| 568 | && (current->ptrace & PT_PTRACED)) | 565 | && (current->ptrace & PT_PTRACED)) |
| 569 | do_syscall_trace(); | 566 | do_syscall_trace(); |
| 570 | } | 567 | } |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index bd837b5dbf06..d7a4e814974d 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
| @@ -151,10 +151,7 @@ static inline int save_general_regs(struct pt_regs *regs, | |||
| 151 | elf_greg_t64 *gregs = (elf_greg_t64 *)regs; | 151 | elf_greg_t64 *gregs = (elf_greg_t64 *)regs; |
| 152 | int i; | 152 | int i; |
| 153 | 153 | ||
| 154 | if (!FULL_REGS(regs)) { | 154 | WARN_ON(!FULL_REGS(regs)); |
| 155 | set_thread_flag(TIF_SAVE_NVGPRS); | ||
| 156 | current_thread_info()->nvgprs_frame = frame->mc_gregs; | ||
| 157 | } | ||
| 158 | 155 | ||
| 159 | for (i = 0; i <= PT_RESULT; i ++) { | 156 | for (i = 0; i <= PT_RESULT; i ++) { |
| 160 | if (i == 14 && !FULL_REGS(regs)) | 157 | if (i == 14 && !FULL_REGS(regs)) |
| @@ -215,15 +212,7 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka, | |||
| 215 | static inline int save_general_regs(struct pt_regs *regs, | 212 | static inline int save_general_regs(struct pt_regs *regs, |
| 216 | struct mcontext __user *frame) | 213 | struct mcontext __user *frame) |
| 217 | { | 214 | { |
| 218 | if (!FULL_REGS(regs)) { | 215 | WARN_ON(!FULL_REGS(regs)); |
| 219 | /* Zero out the unsaved GPRs to avoid information | ||
| 220 | leak, and set TIF_SAVE_NVGPRS to ensure that the | ||
| 221 | registers do actually get saved later. */ | ||
| 222 | memset(®s->gpr[14], 0, 18 * sizeof(unsigned long)); | ||
| 223 | current_thread_info()->nvgprs_frame = &frame->mc_gregs; | ||
| 224 | set_thread_flag(TIF_SAVE_NVGPRS); | ||
| 225 | } | ||
| 226 | |||
| 227 | return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE); | 216 | return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE); |
| 228 | } | 217 | } |
| 229 | 218 | ||
| @@ -826,8 +815,8 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int | |||
| 826 | } | 815 | } |
| 827 | 816 | ||
| 828 | long sys_swapcontext(struct ucontext __user *old_ctx, | 817 | long sys_swapcontext(struct ucontext __user *old_ctx, |
| 829 | struct ucontext __user *new_ctx, | 818 | struct ucontext __user *new_ctx, |
| 830 | int ctx_size, int r6, int r7, int r8, struct pt_regs *regs) | 819 | int ctx_size, int r6, int r7, int r8, struct pt_regs *regs) |
| 831 | { | 820 | { |
| 832 | unsigned char tmp; | 821 | unsigned char tmp; |
| 833 | 822 | ||
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 497a5d3df359..4324f8a8ba24 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
| @@ -118,14 +118,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, | |||
| 118 | err |= __put_user(0, &sc->v_regs); | 118 | err |= __put_user(0, &sc->v_regs); |
| 119 | #endif /* CONFIG_ALTIVEC */ | 119 | #endif /* CONFIG_ALTIVEC */ |
| 120 | err |= __put_user(&sc->gp_regs, &sc->regs); | 120 | err |= __put_user(&sc->gp_regs, &sc->regs); |
| 121 | if (!FULL_REGS(regs)) { | 121 | WARN_ON(!FULL_REGS(regs)); |
| 122 | /* Zero out the unsaved GPRs to avoid information | ||
| 123 | leak, and set TIF_SAVE_NVGPRS to ensure that the | ||
| 124 | registers do actually get saved later. */ | ||
| 125 | memset(®s->gpr[14], 0, 18 * sizeof(unsigned long)); | ||
| 126 | set_thread_flag(TIF_SAVE_NVGPRS); | ||
| 127 | current_thread_info()->nvgprs_frame = &sc->gp_regs; | ||
| 128 | } | ||
| 129 | err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE); | 122 | err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE); |
| 130 | err |= __copy_to_user(&sc->fp_regs, ¤t->thread.fpr, FP_REGS_SIZE); | 123 | err |= __copy_to_user(&sc->fp_regs, ¤t->thread.fpr, FP_REGS_SIZE); |
| 131 | err |= __put_user(signr, &sc->signal); | 124 | err |= __put_user(signr, &sc->signal); |
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S index 8a9f994ed917..1ad55f0466fd 100644 --- a/arch/powerpc/kernel/systbl.S +++ b/arch/powerpc/kernel/systbl.S | |||
| @@ -288,7 +288,7 @@ COMPAT_SYS(clock_settime) | |||
| 288 | COMPAT_SYS(clock_gettime) | 288 | COMPAT_SYS(clock_gettime) |
| 289 | COMPAT_SYS(clock_getres) | 289 | COMPAT_SYS(clock_getres) |
| 290 | COMPAT_SYS(clock_nanosleep) | 290 | COMPAT_SYS(clock_nanosleep) |
| 291 | COMPAT_SYS(swapcontext) | 291 | SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext) |
| 292 | COMPAT_SYS(tgkill) | 292 | COMPAT_SYS(tgkill) |
| 293 | COMPAT_SYS(utimes) | 293 | COMPAT_SYS(utimes) |
| 294 | COMPAT_SYS(statfs64) | 294 | COMPAT_SYS(statfs64) |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 7509aa6474f2..98660aedeeb7 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
| @@ -814,6 +814,8 @@ void __kprobes program_check_exception(struct pt_regs *regs) | |||
| 814 | return; | 814 | return; |
| 815 | } | 815 | } |
| 816 | 816 | ||
| 817 | local_irq_enable(); | ||
| 818 | |||
| 817 | /* Try to emulate it if we should. */ | 819 | /* Try to emulate it if we should. */ |
| 818 | if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) { | 820 | if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) { |
| 819 | switch (emulate_instruction(regs)) { | 821 | switch (emulate_instruction(regs)) { |
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c index 4ffd2a9832a0..9b7150f10414 100644 --- a/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/arch/powerpc/platforms/powermac/pfunc_base.c | |||
| @@ -9,7 +9,12 @@ | |||
| 9 | #include <asm/pmac_feature.h> | 9 | #include <asm/pmac_feature.h> |
| 10 | #include <asm/pmac_pfunc.h> | 10 | #include <asm/pmac_pfunc.h> |
| 11 | 11 | ||
| 12 | #undef DEBUG | ||
| 13 | #ifdef DEBUG | ||
| 12 | #define DBG(fmt...) printk(fmt) | 14 | #define DBG(fmt...) printk(fmt) |
| 15 | #else | ||
| 16 | #define DBG(fmt...) | ||
| 17 | #endif | ||
| 13 | 18 | ||
| 14 | static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs) | 19 | static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs) |
| 15 | { | 20 | { |
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index 356a739e52b2..4baa75b1d36f 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
| @@ -20,7 +20,13 @@ | |||
| 20 | #define LOG_PARSE(fmt...) | 20 | #define LOG_PARSE(fmt...) |
| 21 | #define LOG_ERROR(fmt...) printk(fmt) | 21 | #define LOG_ERROR(fmt...) printk(fmt) |
| 22 | #define LOG_BLOB(t,b,c) | 22 | #define LOG_BLOB(t,b,c) |
| 23 | |||
| 24 | #undef DEBUG | ||
| 25 | #ifdef DEBUG | ||
| 23 | #define DBG(fmt...) printk(fmt) | 26 | #define DBG(fmt...) printk(fmt) |
| 27 | #else | ||
| 28 | #define DBG(fmt...) | ||
| 29 | #endif | ||
| 24 | 30 | ||
| 25 | /* Command numbers */ | 31 | /* Command numbers */ |
| 26 | #define PMF_CMD_LIST 0 | 32 | #define PMF_CMD_LIST 0 |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 0df2cdcd805c..6d64a9bf3474 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
| @@ -435,7 +435,7 @@ struct smp_ops_t psurge_smp_ops = { | |||
| 435 | */ | 435 | */ |
| 436 | 436 | ||
| 437 | static void (*pmac_tb_freeze)(int freeze); | 437 | static void (*pmac_tb_freeze)(int freeze); |
| 438 | static unsigned long timebase; | 438 | static u64 timebase; |
| 439 | static int tb_req; | 439 | static int tb_req; |
| 440 | 440 | ||
| 441 | static void smp_core99_give_timebase(void) | 441 | static void smp_core99_give_timebase(void) |
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c index 7964bf660e92..77e4dc780f8c 100644 --- a/arch/ppc/kernel/asm-offsets.c +++ b/arch/ppc/kernel/asm-offsets.c | |||
| @@ -131,7 +131,6 @@ main(void) | |||
| 131 | DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); | 131 | DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); |
| 132 | DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); | 132 | DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); |
| 133 | 133 | ||
| 134 | DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame)); | ||
| 135 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); | 134 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); |
| 136 | DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); | 135 | DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); |
| 137 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); | 136 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); |
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S index a48b950722a1..3a2815978488 100644 --- a/arch/ppc/kernel/entry.S +++ b/arch/ppc/kernel/entry.S | |||
| @@ -227,7 +227,7 @@ ret_from_syscall: | |||
| 227 | MTMSRD(r10) | 227 | MTMSRD(r10) |
| 228 | lwz r9,TI_FLAGS(r12) | 228 | lwz r9,TI_FLAGS(r12) |
| 229 | li r8,-_LAST_ERRNO | 229 | li r8,-_LAST_ERRNO |
| 230 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL) | 230 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK) |
| 231 | bne- syscall_exit_work | 231 | bne- syscall_exit_work |
| 232 | cmplw 0,r3,r8 | 232 | cmplw 0,r3,r8 |
| 233 | blt+ syscall_exit_cont | 233 | blt+ syscall_exit_cont |
| @@ -287,8 +287,10 @@ syscall_dotrace: | |||
| 287 | 287 | ||
| 288 | syscall_exit_work: | 288 | syscall_exit_work: |
| 289 | andi. r0,r9,_TIF_RESTOREALL | 289 | andi. r0,r9,_TIF_RESTOREALL |
| 290 | bne- 2f | 290 | beq+ 0f |
| 291 | cmplw 0,r3,r8 | 291 | REST_NVGPRS(r1) |
| 292 | b 2f | ||
| 293 | 0: cmplw 0,r3,r8 | ||
| 292 | blt+ 1f | 294 | blt+ 1f |
| 293 | andi. r0,r9,_TIF_NOERROR | 295 | andi. r0,r9,_TIF_NOERROR |
| 294 | bne- 1f | 296 | bne- 1f |
| @@ -302,9 +304,7 @@ syscall_exit_work: | |||
| 302 | 2: andi. r0,r9,(_TIF_PERSYSCALL_MASK) | 304 | 2: andi. r0,r9,(_TIF_PERSYSCALL_MASK) |
| 303 | beq 4f | 305 | beq 4f |
| 304 | 306 | ||
| 305 | /* Clear per-syscall TIF flags if any are set, but _leave_ | 307 | /* Clear per-syscall TIF flags if any are set. */ |
| 306 | _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that | ||
| 307 | yet. */ | ||
| 308 | 308 | ||
| 309 | li r11,_TIF_PERSYSCALL_MASK | 309 | li r11,_TIF_PERSYSCALL_MASK |
| 310 | addi r12,r12,TI_FLAGS | 310 | addi r12,r12,TI_FLAGS |
| @@ -318,8 +318,13 @@ syscall_exit_work: | |||
| 318 | subi r12,r12,TI_FLAGS | 318 | subi r12,r12,TI_FLAGS |
| 319 | 319 | ||
| 320 | 4: /* Anything which requires enabling interrupts? */ | 320 | 4: /* Anything which requires enabling interrupts? */ |
| 321 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS) | 321 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) |
| 322 | beq 7f | 322 | beq ret_from_except |
| 323 | |||
| 324 | /* Re-enable interrupts */ | ||
| 325 | ori r10,r10,MSR_EE | ||
| 326 | SYNC | ||
| 327 | MTMSRD(r10) | ||
| 323 | 328 | ||
| 324 | /* Save NVGPRS if they're not saved already */ | 329 | /* Save NVGPRS if they're not saved already */ |
| 325 | lwz r4,TRAP(r1) | 330 | lwz r4,TRAP(r1) |
| @@ -328,71 +333,11 @@ syscall_exit_work: | |||
| 328 | SAVE_NVGPRS(r1) | 333 | SAVE_NVGPRS(r1) |
| 329 | li r4,0xc00 | 334 | li r4,0xc00 |
| 330 | stw r4,TRAP(r1) | 335 | stw r4,TRAP(r1) |
| 331 | 336 | 5: | |
| 332 | /* Re-enable interrupts */ | ||
| 333 | 5: ori r10,r10,MSR_EE | ||
| 334 | SYNC | ||
| 335 | MTMSRD(r10) | ||
| 336 | |||
| 337 | andi. r0,r9,_TIF_SAVE_NVGPRS | ||
| 338 | bne save_user_nvgprs | ||
| 339 | |||
| 340 | save_user_nvgprs_cont: | ||
| 341 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) | ||
| 342 | beq 7f | ||
| 343 | |||
| 344 | addi r3,r1,STACK_FRAME_OVERHEAD | 337 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 345 | bl do_syscall_trace_leave | 338 | bl do_syscall_trace_leave |
| 346 | REST_NVGPRS(r1) | 339 | b ret_from_except_full |
| 347 | |||
| 348 | 6: lwz r3,GPR3(r1) | ||
| 349 | LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */ | ||
| 350 | SYNC | ||
| 351 | MTMSRD(r10) /* disable interrupts again */ | ||
| 352 | rlwinm r12,r1,0,0,18 /* current_thread_info() */ | ||
| 353 | lwz r9,TI_FLAGS(r12) | ||
| 354 | 7: | ||
| 355 | andi. r0,r9,_TIF_NEED_RESCHED | ||
| 356 | bne 8f | ||
| 357 | lwz r5,_MSR(r1) | ||
| 358 | andi. r5,r5,MSR_PR | ||
| 359 | beq ret_from_except | ||
| 360 | andi. r0,r9,_TIF_SIGPENDING | ||
| 361 | beq ret_from_except | ||
| 362 | b do_user_signal | ||
| 363 | 8: | ||
| 364 | ori r10,r10,MSR_EE | ||
| 365 | SYNC | ||
| 366 | MTMSRD(r10) /* re-enable interrupts */ | ||
| 367 | bl schedule | ||
| 368 | b 6b | ||
| 369 | |||
| 370 | save_user_nvgprs: | ||
| 371 | lwz r8,TI_SIGFRAME(r12) | ||
| 372 | |||
| 373 | .macro savewords start, end | ||
| 374 | 1: stw \start,4*(\start)(r8) | ||
| 375 | .section __ex_table,"a" | ||
| 376 | .align 2 | ||
| 377 | .long 1b,save_user_nvgprs_fault | ||
| 378 | .previous | ||
| 379 | .if \end - \start | ||
| 380 | savewords "(\start+1)",\end | ||
| 381 | .endif | ||
| 382 | .endm | ||
| 383 | savewords 14,31 | ||
| 384 | b save_user_nvgprs_cont | ||
| 385 | |||
| 386 | |||
| 387 | save_user_nvgprs_fault: | ||
| 388 | li r3,11 /* SIGSEGV */ | ||
| 389 | lwz r4,TI_TASK(r12) | ||
| 390 | bl force_sigsegv | ||
| 391 | 340 | ||
| 392 | rlwinm r12,r1,0,0,18 /* current_thread_info() */ | ||
| 393 | lwz r9,TI_FLAGS(r12) | ||
| 394 | b save_user_nvgprs_cont | ||
| 395 | |||
| 396 | #ifdef SHOW_SYSCALLS | 341 | #ifdef SHOW_SYSCALLS |
| 397 | do_show_syscall: | 342 | do_show_syscall: |
| 398 | #ifdef SHOW_SYSCALLS_TASK | 343 | #ifdef SHOW_SYSCALLS_TASK |
| @@ -490,6 +435,14 @@ ppc_clone: | |||
| 490 | stw r0,TRAP(r1) /* register set saved */ | 435 | stw r0,TRAP(r1) /* register set saved */ |
| 491 | b sys_clone | 436 | b sys_clone |
| 492 | 437 | ||
| 438 | .globl ppc_swapcontext | ||
| 439 | ppc_swapcontext: | ||
| 440 | SAVE_NVGPRS(r1) | ||
| 441 | lwz r0,TRAP(r1) | ||
| 442 | rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */ | ||
| 443 | stw r0,TRAP(r1) /* register set saved */ | ||
| 444 | b sys_swapcontext | ||
| 445 | |||
| 493 | /* | 446 | /* |
| 494 | * Top-level page fault handling. | 447 | * Top-level page fault handling. |
| 495 | * This is in assembler because if do_page_fault tells us that | 448 | * This is in assembler because if do_page_fault tells us that |
| @@ -683,7 +636,7 @@ user_exc_return: /* r10 contains MSR_KERNEL here */ | |||
| 683 | /* Check current_thread_info()->flags */ | 636 | /* Check current_thread_info()->flags */ |
| 684 | rlwinm r9,r1,0,0,18 | 637 | rlwinm r9,r1,0,0,18 |
| 685 | lwz r9,TI_FLAGS(r9) | 638 | lwz r9,TI_FLAGS(r9) |
| 686 | andi. r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL) | 639 | andi. r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED) |
| 687 | bne do_work | 640 | bne do_work |
| 688 | 641 | ||
| 689 | restore_user: | 642 | restore_user: |
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c index 60f80a4eed4e..b9b7958a226a 100644 --- a/arch/s390/lib/spinlock.c +++ b/arch/s390/lib/spinlock.c | |||
| @@ -2,8 +2,7 @@ | |||
| 2 | * arch/s390/lib/spinlock.c | 2 | * arch/s390/lib/spinlock.c |
| 3 | * Out of line spinlock code. | 3 | * Out of line spinlock code. |
| 4 | * | 4 | * |
| 5 | * S390 version | 5 | * Copyright (C) IBM Corp. 2004, 2006 |
| 6 | * Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation | ||
| 7 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) | 6 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) |
| 8 | */ | 7 | */ |
| 9 | 8 | ||
| @@ -44,6 +43,8 @@ _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc) | |||
| 44 | _diag44(); | 43 | _diag44(); |
| 45 | count = spin_retry; | 44 | count = spin_retry; |
| 46 | } | 45 | } |
| 46 | if (__raw_spin_is_locked(lp)) | ||
| 47 | continue; | ||
| 47 | if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) | 48 | if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) |
| 48 | return; | 49 | return; |
| 49 | } | 50 | } |
| @@ -56,6 +57,8 @@ _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc) | |||
| 56 | int count = spin_retry; | 57 | int count = spin_retry; |
| 57 | 58 | ||
| 58 | while (count-- > 0) { | 59 | while (count-- > 0) { |
| 60 | if (__raw_spin_is_locked(lp)) | ||
| 61 | continue; | ||
| 59 | if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) | 62 | if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0) |
| 60 | return 1; | 63 | return 1; |
| 61 | } | 64 | } |
| @@ -74,6 +77,8 @@ _raw_read_lock_wait(raw_rwlock_t *rw) | |||
| 74 | _diag44(); | 77 | _diag44(); |
| 75 | count = spin_retry; | 78 | count = spin_retry; |
| 76 | } | 79 | } |
| 80 | if (!__raw_read_can_lock(rw)) | ||
| 81 | continue; | ||
| 77 | old = rw->lock & 0x7fffffffU; | 82 | old = rw->lock & 0x7fffffffU; |
| 78 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) | 83 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) |
| 79 | return; | 84 | return; |
| @@ -88,6 +93,8 @@ _raw_read_trylock_retry(raw_rwlock_t *rw) | |||
| 88 | int count = spin_retry; | 93 | int count = spin_retry; |
| 89 | 94 | ||
| 90 | while (count-- > 0) { | 95 | while (count-- > 0) { |
| 96 | if (!__raw_read_can_lock(rw)) | ||
| 97 | continue; | ||
| 91 | old = rw->lock & 0x7fffffffU; | 98 | old = rw->lock & 0x7fffffffU; |
| 92 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) | 99 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) |
| 93 | return 1; | 100 | return 1; |
| @@ -106,6 +113,8 @@ _raw_write_lock_wait(raw_rwlock_t *rw) | |||
| 106 | _diag44(); | 113 | _diag44(); |
| 107 | count = spin_retry; | 114 | count = spin_retry; |
| 108 | } | 115 | } |
| 116 | if (!__raw_write_can_lock(rw)) | ||
| 117 | continue; | ||
| 109 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) | 118 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) |
| 110 | return; | 119 | return; |
| 111 | } | 120 | } |
| @@ -118,6 +127,8 @@ _raw_write_trylock_retry(raw_rwlock_t *rw) | |||
| 118 | int count = spin_retry; | 127 | int count = spin_retry; |
| 119 | 128 | ||
| 120 | while (count-- > 0) { | 129 | while (count-- > 0) { |
| 130 | if (!__raw_write_can_lock(rw)) | ||
| 131 | continue; | ||
| 121 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) | 132 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) |
| 122 | return 1; | 133 | return 1; |
| 123 | } | 134 | } |
diff --git a/arch/s390/lib/uaccess.S b/arch/s390/lib/uaccess.S index 88fc94fe6488..5d59e2625048 100644 --- a/arch/s390/lib/uaccess.S +++ b/arch/s390/lib/uaccess.S | |||
| @@ -198,12 +198,12 @@ __strnlen_user_asm: | |||
| 198 | 0: srst %r2,%r1 | 198 | 0: srst %r2,%r1 |
| 199 | jo 0b | 199 | jo 0b |
| 200 | sacf 0 | 200 | sacf 0 |
| 201 | jh 1f # \0 found in string ? | ||
| 202 | ahi %r2,1 # strnlen_user result includes the \0 | 201 | ahi %r2,1 # strnlen_user result includes the \0 |
| 203 | 1: slr %r2,%r3 | 202 | # or return count+1 if \0 not found |
| 203 | slr %r2,%r3 | ||
| 204 | br %r14 | 204 | br %r14 |
| 205 | 2: sacf 0 | 205 | 2: sacf 0 |
| 206 | lhi %r2,-EFAULT | 206 | slr %r2,%r2 # return 0 on exception |
| 207 | br %r14 | 207 | br %r14 |
| 208 | .section __ex_table,"a" | 208 | .section __ex_table,"a" |
| 209 | .long 0b,2b | 209 | .long 0b,2b |
diff --git a/arch/s390/lib/uaccess64.S b/arch/s390/lib/uaccess64.S index 50219786fc7a..19b41a33c230 100644 --- a/arch/s390/lib/uaccess64.S +++ b/arch/s390/lib/uaccess64.S | |||
| @@ -194,12 +194,12 @@ __strnlen_user_asm: | |||
| 194 | 0: srst %r2,%r1 | 194 | 0: srst %r2,%r1 |
| 195 | jo 0b | 195 | jo 0b |
| 196 | sacf 0 | 196 | sacf 0 |
| 197 | jh 1f # \0 found in string ? | ||
| 198 | aghi %r2,1 # strnlen_user result includes the \0 | 197 | aghi %r2,1 # strnlen_user result includes the \0 |
| 199 | 1: slgr %r2,%r3 | 198 | # or return count+1 if \0 not found |
| 199 | slgr %r2,%r3 | ||
| 200 | br %r14 | 200 | br %r14 |
| 201 | 2: sacf 0 | 201 | 2: sacf 0 |
| 202 | lghi %r2,-EFAULT | 202 | slgr %r2,%r2 # return 0 on exception |
| 203 | br %r14 | 203 | br %r14 |
| 204 | .section __ex_table,"a" | 204 | .section __ex_table,"a" |
| 205 | .quad 0b,2b | 205 | .quad 0b,2b |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index e73621d03a28..e9b275d90737 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
| @@ -392,9 +392,9 @@ config SH_TMU | |||
| 392 | 392 | ||
| 393 | endmenu | 393 | endmenu |
| 394 | 394 | ||
| 395 | source "arch/sh/boards/renesas/hs7751rvoip/Kconfig" | 395 | #source "arch/sh/boards/renesas/hs7751rvoip/Kconfig" |
| 396 | 396 | ||
| 397 | source "arch/sh/boards/renesas/rts7751r2d/Kconfig" | 397 | #source "arch/sh/boards/renesas/rts7751r2d/Kconfig" |
| 398 | 398 | ||
| 399 | config SH_PCLK_FREQ | 399 | config SH_PCLK_FREQ |
| 400 | int "Peripheral clock frequency (in Hz)" | 400 | int "Peripheral clock frequency (in Hz)" |
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c index 89fab51e20f4..25ac8a3faae6 100644 --- a/arch/x86_64/kernel/machine_kexec.c +++ b/arch/x86_64/kernel/machine_kexec.c | |||
| @@ -140,7 +140,7 @@ static void load_segments(void) | |||
| 140 | "\tmovl %0,%%ss\n" | 140 | "\tmovl %0,%%ss\n" |
| 141 | "\tmovl %0,%%fs\n" | 141 | "\tmovl %0,%%fs\n" |
| 142 | "\tmovl %0,%%gs\n" | 142 | "\tmovl %0,%%gs\n" |
| 143 | : : "a" (__KERNEL_DS) | 143 | : : "a" (__KERNEL_DS) : "memory" |
| 144 | ); | 144 | ); |
| 145 | } | 145 | } |
| 146 | 146 | ||
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 7ee4a14ec3b1..e90ef5db8913 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
| @@ -26,6 +26,10 @@ config GENERIC_HARDIRQS | |||
| 26 | bool | 26 | bool |
| 27 | default y | 27 | default y |
| 28 | 28 | ||
| 29 | config RWSEM_GENERIC_SPINLOCK | ||
| 30 | bool | ||
| 31 | default y | ||
| 32 | |||
| 29 | source "init/Kconfig" | 33 | source "init/Kconfig" |
| 30 | 34 | ||
| 31 | menu "Processor type and features" | 35 | menu "Processor type and features" |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 03d9c82b0fe7..0ef2971a9e82 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
| @@ -625,26 +625,31 @@ static inline int ordered_bio_endio(struct request *rq, struct bio *bio, | |||
| 625 | * Different hardware can have different requirements as to what pages | 625 | * Different hardware can have different requirements as to what pages |
| 626 | * it can do I/O directly to. A low level driver can call | 626 | * it can do I/O directly to. A low level driver can call |
| 627 | * blk_queue_bounce_limit to have lower memory pages allocated as bounce | 627 | * blk_queue_bounce_limit to have lower memory pages allocated as bounce |
| 628 | * buffers for doing I/O to pages residing above @page. By default | 628 | * buffers for doing I/O to pages residing above @page. |
| 629 | * the block layer sets this to the highest numbered "low" memory page. | ||
| 630 | **/ | 629 | **/ |
| 631 | void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr) | 630 | void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr) |
| 632 | { | 631 | { |
| 633 | unsigned long bounce_pfn = dma_addr >> PAGE_SHIFT; | 632 | unsigned long bounce_pfn = dma_addr >> PAGE_SHIFT; |
| 634 | 633 | int dma = 0; | |
| 635 | /* | 634 | |
| 636 | * set appropriate bounce gfp mask -- unfortunately we don't have a | 635 | q->bounce_gfp = GFP_NOIO; |
| 637 | * full 4GB zone, so we have to resort to low memory for any bounces. | 636 | #if BITS_PER_LONG == 64 |
| 638 | * ISA has its own < 16MB zone. | 637 | /* Assume anything <= 4GB can be handled by IOMMU. |
| 639 | */ | 638 | Actually some IOMMUs can handle everything, but I don't |
| 640 | if (bounce_pfn < blk_max_low_pfn) { | 639 | know of a way to test this here. */ |
| 641 | BUG_ON(dma_addr < BLK_BOUNCE_ISA); | 640 | if (bounce_pfn < (0xffffffff>>PAGE_SHIFT)) |
| 641 | dma = 1; | ||
| 642 | q->bounce_pfn = max_low_pfn; | ||
| 643 | #else | ||
| 644 | if (bounce_pfn < blk_max_low_pfn) | ||
| 645 | dma = 1; | ||
| 646 | q->bounce_pfn = bounce_pfn; | ||
| 647 | #endif | ||
| 648 | if (dma) { | ||
| 642 | init_emergency_isa_pool(); | 649 | init_emergency_isa_pool(); |
| 643 | q->bounce_gfp = GFP_NOIO | GFP_DMA; | 650 | q->bounce_gfp = GFP_NOIO | GFP_DMA; |
| 644 | } else | 651 | q->bounce_pfn = bounce_pfn; |
| 645 | q->bounce_gfp = GFP_NOIO; | 652 | } |
| 646 | |||
| 647 | q->bounce_pfn = bounce_pfn; | ||
| 648 | } | 653 | } |
| 649 | 654 | ||
| 650 | EXPORT_SYMBOL(blk_queue_bounce_limit); | 655 | EXPORT_SYMBOL(blk_queue_bounce_limit); |
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 6ede1f352c29..37b8cda3e8bc 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <linux/timer.h> | 41 | #include <linux/timer.h> |
| 42 | #include <linux/pci.h> | 42 | #include <linux/pci.h> |
| 43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
| 44 | #include <linux/random.h> | ||
| 44 | #include <asm/io.h> | 45 | #include <asm/io.h> |
| 45 | #include <asm/uaccess.h> | 46 | #include <asm/uaccess.h> |
| 46 | #include "DAC960.h" | 47 | #include "DAC960.h" |
| @@ -3463,7 +3464,7 @@ static inline boolean DAC960_ProcessCompletedRequest(DAC960_Command_T *Command, | |||
| 3463 | Command->SegmentCount, Command->DmaDirection); | 3464 | Command->SegmentCount, Command->DmaDirection); |
| 3464 | 3465 | ||
| 3465 | if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) { | 3466 | if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) { |
| 3466 | 3467 | add_disk_randomness(Request->rq_disk); | |
| 3467 | end_that_request_last(Request, UpToDate); | 3468 | end_that_request_last(Request, UpToDate); |
| 3468 | 3469 | ||
| 3469 | if (Command->Completion) { | 3470 | if (Command->Completion) { |
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index c92378121b4c..1b05fa688996 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
| @@ -675,7 +675,7 @@ static int __init mmtimer_init(void) | |||
| 675 | cnodeid_t node, maxn = -1; | 675 | cnodeid_t node, maxn = -1; |
| 676 | 676 | ||
| 677 | if (!ia64_platform_is("sn2")) | 677 | if (!ia64_platform_is("sn2")) |
| 678 | return -1; | 678 | return 0; |
| 679 | 679 | ||
| 680 | /* | 680 | /* |
| 681 | * Sanity check the cycles/sec variable | 681 | * Sanity check the cycles/sec variable |
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 18a455651121..52f3eb45d2b9 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig | |||
| @@ -6,17 +6,29 @@ | |||
| 6 | # $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $ | 6 | # $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $ |
| 7 | # | 7 | # |
| 8 | 8 | ||
| 9 | menu 'EDAC - error detection and reporting (RAS)' | 9 | menu 'EDAC - error detection and reporting (RAS) (EXPERIMENTAL)' |
| 10 | 10 | ||
| 11 | config EDAC | 11 | config EDAC |
| 12 | tristate "EDAC core system error reporting" | 12 | tristate "EDAC core system error reporting (EXPERIMENTAL)" |
| 13 | depends on X86 | 13 | depends on X86 && EXPERIMENTAL |
| 14 | help | 14 | help |
| 15 | EDAC is designed to report errors in the core system. | 15 | EDAC is designed to report errors in the core system. |
| 16 | These are low-level errors that are reported in the CPU or | 16 | These are low-level errors that are reported in the CPU or |
| 17 | supporting chipset: memory errors, cache errors, PCI errors, | 17 | supporting chipset: memory errors, cache errors, PCI errors, |
| 18 | thermal throttling, etc.. If unsure, select 'Y'. | 18 | thermal throttling, etc.. If unsure, select 'Y'. |
| 19 | 19 | ||
| 20 | If this code is reporting problems on your system, please | ||
| 21 | see the EDAC project web pages for more information at: | ||
| 22 | |||
| 23 | <http://bluesmoke.sourceforge.net/> | ||
| 24 | |||
| 25 | and: | ||
| 26 | |||
| 27 | <http://buttersideup.com/edacwiki> | ||
| 28 | |||
| 29 | There is also a mailing list for the EDAC project, which can | ||
| 30 | be found via the sourceforge page. | ||
| 31 | |||
| 20 | 32 | ||
| 21 | comment "Reporting subsystems" | 33 | comment "Reporting subsystems" |
| 22 | depends on EDAC | 34 | depends on EDAC |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index b10ee4698b1d..262e44544dc8 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
| @@ -132,11 +132,13 @@ static struct kobject edac_pci_kobj; | |||
| 132 | * /sys/devices/system/edac/mc; | 132 | * /sys/devices/system/edac/mc; |
| 133 | * data structures and methods | 133 | * data structures and methods |
| 134 | */ | 134 | */ |
| 135 | #if 0 | ||
| 135 | static ssize_t memctrl_string_show(void *ptr, char *buffer) | 136 | static ssize_t memctrl_string_show(void *ptr, char *buffer) |
| 136 | { | 137 | { |
| 137 | char *value = (char*) ptr; | 138 | char *value = (char*) ptr; |
| 138 | return sprintf(buffer, "%s\n", value); | 139 | return sprintf(buffer, "%s\n", value); |
| 139 | } | 140 | } |
| 141 | #endif | ||
| 140 | 142 | ||
| 141 | static ssize_t memctrl_int_show(void *ptr, char *buffer) | 143 | static ssize_t memctrl_int_show(void *ptr, char *buffer) |
| 142 | { | 144 | { |
| @@ -207,7 +209,9 @@ struct memctrl_dev_attribute attr_##_name = { \ | |||
| 207 | }; | 209 | }; |
| 208 | 210 | ||
| 209 | /* cwrow<id> attribute f*/ | 211 | /* cwrow<id> attribute f*/ |
| 212 | #if 0 | ||
| 210 | MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL); | 213 | MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL); |
| 214 | #endif | ||
| 211 | 215 | ||
| 212 | /* csrow<id> control files */ | 216 | /* csrow<id> control files */ |
| 213 | MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); | 217 | MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); |
| @@ -222,7 +226,6 @@ static struct memctrl_dev_attribute *memctrl_attr[] = { | |||
| 222 | &attr_log_ue, | 226 | &attr_log_ue, |
| 223 | &attr_log_ce, | 227 | &attr_log_ce, |
| 224 | &attr_poll_msec, | 228 | &attr_poll_msec, |
| 225 | &attr_mc_version, | ||
| 226 | NULL, | 229 | NULL, |
| 227 | }; | 230 | }; |
| 228 | 231 | ||
| @@ -309,6 +312,8 @@ struct list_control { | |||
| 309 | int *count; | 312 | int *count; |
| 310 | }; | 313 | }; |
| 311 | 314 | ||
| 315 | |||
| 316 | #if 0 | ||
| 312 | /* Output the list as: vendor_id:device:id<,vendor_id:device_id> */ | 317 | /* Output the list as: vendor_id:device:id<,vendor_id:device_id> */ |
| 313 | static ssize_t edac_pci_list_string_show(void *ptr, char *buffer) | 318 | static ssize_t edac_pci_list_string_show(void *ptr, char *buffer) |
| 314 | { | 319 | { |
| @@ -430,6 +435,7 @@ static ssize_t edac_pci_list_string_store(void *ptr, const char *buffer, | |||
| 430 | return count; | 435 | return count; |
| 431 | } | 436 | } |
| 432 | 437 | ||
| 438 | #endif | ||
| 433 | static ssize_t edac_pci_int_show(void *ptr, char *buffer) | 439 | static ssize_t edac_pci_int_show(void *ptr, char *buffer) |
| 434 | { | 440 | { |
| 435 | int *value = ptr; | 441 | int *value = ptr; |
| @@ -498,6 +504,7 @@ struct edac_pci_dev_attribute edac_pci_attr_##_name = { \ | |||
| 498 | .store = _store, \ | 504 | .store = _store, \ |
| 499 | }; | 505 | }; |
| 500 | 506 | ||
| 507 | #if 0 | ||
| 501 | static struct list_control pci_whitelist_control = { | 508 | static struct list_control pci_whitelist_control = { |
| 502 | .list = pci_whitelist, | 509 | .list = pci_whitelist, |
| 503 | .count = &pci_whitelist_count | 510 | .count = &pci_whitelist_count |
| @@ -520,6 +527,7 @@ EDAC_PCI_STRING_ATTR(pci_parity_blacklist, | |||
| 520 | S_IRUGO|S_IWUSR, | 527 | S_IRUGO|S_IWUSR, |
| 521 | edac_pci_list_string_show, | 528 | edac_pci_list_string_show, |
| 522 | edac_pci_list_string_store); | 529 | edac_pci_list_string_store); |
| 530 | #endif | ||
| 523 | 531 | ||
| 524 | /* PCI Parity control files */ | 532 | /* PCI Parity control files */ |
| 525 | EDAC_PCI_ATTR(check_pci_parity,S_IRUGO|S_IWUSR,edac_pci_int_show,edac_pci_int_store); | 533 | EDAC_PCI_ATTR(check_pci_parity,S_IRUGO|S_IWUSR,edac_pci_int_show,edac_pci_int_store); |
| @@ -531,8 +539,6 @@ static struct edac_pci_dev_attribute *edac_pci_attr[] = { | |||
| 531 | &edac_pci_attr_check_pci_parity, | 539 | &edac_pci_attr_check_pci_parity, |
| 532 | &edac_pci_attr_panic_on_pci_parity, | 540 | &edac_pci_attr_panic_on_pci_parity, |
| 533 | &edac_pci_attr_pci_parity_count, | 541 | &edac_pci_attr_pci_parity_count, |
| 534 | &edac_pci_attr_pci_parity_whitelist, | ||
| 535 | &edac_pci_attr_pci_parity_blacklist, | ||
| 536 | NULL, | 542 | NULL, |
| 537 | }; | 543 | }; |
| 538 | 544 | ||
diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c index 8ed6ddbb9c5d..4652512f7d1a 100644 --- a/drivers/firmware/dcdbas.c +++ b/drivers/firmware/dcdbas.c | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | #include "dcdbas.h" | 39 | #include "dcdbas.h" |
| 40 | 40 | ||
| 41 | #define DRIVER_NAME "dcdbas" | 41 | #define DRIVER_NAME "dcdbas" |
| 42 | #define DRIVER_VERSION "5.6.0-1" | 42 | #define DRIVER_VERSION "5.6.0-2" |
| 43 | #define DRIVER_DESCRIPTION "Dell Systems Management Base Driver" | 43 | #define DRIVER_DESCRIPTION "Dell Systems Management Base Driver" |
| 44 | 44 | ||
| 45 | static struct platform_device *dcdbas_pdev; | 45 | static struct platform_device *dcdbas_pdev; |
| @@ -581,9 +581,13 @@ static int __init dcdbas_init(void) | |||
| 581 | */ | 581 | */ |
| 582 | static void __exit dcdbas_exit(void) | 582 | static void __exit dcdbas_exit(void) |
| 583 | { | 583 | { |
| 584 | platform_device_unregister(dcdbas_pdev); | 584 | /* |
| 585 | * make sure functions that use dcdbas_pdev are called | ||
| 586 | * before platform_device_unregister | ||
| 587 | */ | ||
| 585 | unregister_reboot_notifier(&dcdbas_reboot_nb); | 588 | unregister_reboot_notifier(&dcdbas_reboot_nb); |
| 586 | smi_data_buf_free(); | 589 | smi_data_buf_free(); |
| 590 | platform_device_unregister(dcdbas_pdev); | ||
| 587 | } | 591 | } |
| 588 | 592 | ||
| 589 | module_init(dcdbas_init); | 593 | module_init(dcdbas_init); |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 19b1b0121726..ad6217467676 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
| @@ -58,7 +58,7 @@ static unsigned int psmouse_resetafter = 5; | |||
| 58 | module_param_named(resetafter, psmouse_resetafter, uint, 0644); | 58 | module_param_named(resetafter, psmouse_resetafter, uint, 0644); |
| 59 | MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never)."); | 59 | MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never)."); |
| 60 | 60 | ||
| 61 | static unsigned int psmouse_resync_time = 5; | 61 | static unsigned int psmouse_resync_time; |
| 62 | module_param_named(resync_time, psmouse_resync_time, uint, 0644); | 62 | module_param_named(resync_time, psmouse_resync_time, uint, 0644); |
| 63 | MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing resync (in seconds, 0 = never)."); | 63 | MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing resync (in seconds, 0 = never)."); |
| 64 | 64 | ||
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c index bb8d5efe19bf..6c0ba04bc57a 100644 --- a/drivers/macintosh/windfarm_core.c +++ b/drivers/macintosh/windfarm_core.c | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
| 36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
| 37 | 37 | ||
| 38 | #include <asm/prom.h> | ||
| 39 | |||
| 38 | #include "windfarm.h" | 40 | #include "windfarm.h" |
| 39 | 41 | ||
| 40 | #define VERSION "0.2" | 42 | #define VERSION "0.2" |
| @@ -465,6 +467,11 @@ static int __init windfarm_core_init(void) | |||
| 465 | { | 467 | { |
| 466 | DBG("wf: core loaded\n"); | 468 | DBG("wf: core loaded\n"); |
| 467 | 469 | ||
| 470 | /* Don't register on old machines that use therm_pm72 for now */ | ||
| 471 | if (machine_is_compatible("PowerMac7,2") || | ||
| 472 | machine_is_compatible("PowerMac7,3") || | ||
| 473 | machine_is_compatible("RackMac3,1")) | ||
| 474 | return -ENODEV; | ||
| 468 | platform_device_register(&wf_platform_device); | 475 | platform_device_register(&wf_platform_device); |
| 469 | return 0; | 476 | return 0; |
| 470 | } | 477 | } |
diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c index 607dbaca69c9..81337cd16e80 100644 --- a/drivers/macintosh/windfarm_cpufreq_clamp.c +++ b/drivers/macintosh/windfarm_cpufreq_clamp.c | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #include <linux/wait.h> | 8 | #include <linux/wait.h> |
| 9 | #include <linux/cpufreq.h> | 9 | #include <linux/cpufreq.h> |
| 10 | 10 | ||
| 11 | #include <asm/prom.h> | ||
| 12 | |||
| 11 | #include "windfarm.h" | 13 | #include "windfarm.h" |
| 12 | 14 | ||
| 13 | #define VERSION "0.3" | 15 | #define VERSION "0.3" |
| @@ -74,6 +76,12 @@ static int __init wf_cpufreq_clamp_init(void) | |||
| 74 | { | 76 | { |
| 75 | struct wf_control *clamp; | 77 | struct wf_control *clamp; |
| 76 | 78 | ||
| 79 | /* Don't register on old machines that use therm_pm72 for now */ | ||
| 80 | if (machine_is_compatible("PowerMac7,2") || | ||
| 81 | machine_is_compatible("PowerMac7,3") || | ||
| 82 | machine_is_compatible("RackMac3,1")) | ||
| 83 | return -ENODEV; | ||
| 84 | |||
| 77 | clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL); | 85 | clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL); |
| 78 | if (clamp == NULL) | 86 | if (clamp == NULL) |
| 79 | return -ENOMEM; | 87 | return -ENOMEM; |
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index 906d3ecae6e6..423bfa2432c0 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | #include "windfarm.h" | 26 | #include "windfarm.h" |
| 27 | 27 | ||
| 28 | #define VERSION "0.1" | 28 | #define VERSION "0.2" |
| 29 | 29 | ||
| 30 | #undef DEBUG | 30 | #undef DEBUG |
| 31 | 31 | ||
| @@ -113,6 +113,7 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter, | |||
| 113 | const char *loc) | 113 | const char *loc) |
| 114 | { | 114 | { |
| 115 | struct wf_lm75_sensor *lm; | 115 | struct wf_lm75_sensor *lm; |
| 116 | int rc; | ||
| 116 | 117 | ||
| 117 | DBG("wf_lm75: creating %s device at address 0x%02x\n", | 118 | DBG("wf_lm75: creating %s device at address 0x%02x\n", |
| 118 | ds1775 ? "ds1775" : "lm75", addr); | 119 | ds1775 ? "ds1775" : "lm75", addr); |
| @@ -139,9 +140,11 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter, | |||
| 139 | lm->i2c.driver = &wf_lm75_driver; | 140 | lm->i2c.driver = &wf_lm75_driver; |
| 140 | strncpy(lm->i2c.name, lm->sens.name, I2C_NAME_SIZE-1); | 141 | strncpy(lm->i2c.name, lm->sens.name, I2C_NAME_SIZE-1); |
| 141 | 142 | ||
| 142 | if (i2c_attach_client(&lm->i2c)) { | 143 | rc = i2c_attach_client(&lm->i2c); |
| 143 | printk(KERN_ERR "windfarm: failed to attach %s %s to i2c\n", | 144 | if (rc) { |
| 144 | ds1775 ? "ds1775" : "lm75", lm->i2c.name); | 145 | printk(KERN_ERR "windfarm: failed to attach %s %s to i2c," |
| 146 | " err %d\n", ds1775 ? "ds1775" : "lm75", | ||
| 147 | lm->i2c.name, rc); | ||
| 145 | goto fail; | 148 | goto fail; |
| 146 | } | 149 | } |
| 147 | 150 | ||
| @@ -175,16 +178,22 @@ static int wf_lm75_attach(struct i2c_adapter *adapter) | |||
| 175 | (dev = of_get_next_child(busnode, dev)) != NULL;) { | 178 | (dev = of_get_next_child(busnode, dev)) != NULL;) { |
| 176 | const char *loc = | 179 | const char *loc = |
| 177 | get_property(dev, "hwsensor-location", NULL); | 180 | get_property(dev, "hwsensor-location", NULL); |
| 178 | u32 *reg = (u32 *)get_property(dev, "reg", NULL); | 181 | u8 addr; |
| 179 | DBG(" dev: %s... (loc: %p, reg: %p)\n", dev->name, loc, reg); | 182 | |
| 180 | if (loc == NULL || reg == NULL) | 183 | /* We must re-match the adapter in order to properly check |
| 184 | * the channel on multibus setups | ||
| 185 | */ | ||
| 186 | if (!pmac_i2c_match_adapter(dev, adapter)) | ||
| 187 | continue; | ||
| 188 | addr = pmac_i2c_get_dev_addr(dev); | ||
| 189 | if (loc == NULL || addr == 0) | ||
| 181 | continue; | 190 | continue; |
| 182 | /* real lm75 */ | 191 | /* real lm75 */ |
| 183 | if (device_is_compatible(dev, "lm75")) | 192 | if (device_is_compatible(dev, "lm75")) |
| 184 | wf_lm75_create(adapter, *reg, 0, loc); | 193 | wf_lm75_create(adapter, addr, 0, loc); |
| 185 | /* ds1775 (compatible, better resolution */ | 194 | /* ds1775 (compatible, better resolution */ |
| 186 | else if (device_is_compatible(dev, "ds1775")) | 195 | else if (device_is_compatible(dev, "ds1775")) |
| 187 | wf_lm75_create(adapter, *reg, 1, loc); | 196 | wf_lm75_create(adapter, addr, 1, loc); |
| 188 | } | 197 | } |
| 189 | return 0; | 198 | return 0; |
| 190 | } | 199 | } |
| @@ -206,6 +215,11 @@ static int wf_lm75_detach(struct i2c_client *client) | |||
| 206 | 215 | ||
| 207 | static int __init wf_lm75_sensor_init(void) | 216 | static int __init wf_lm75_sensor_init(void) |
| 208 | { | 217 | { |
| 218 | /* Don't register on old machines that use therm_pm72 for now */ | ||
| 219 | if (machine_is_compatible("PowerMac7,2") || | ||
| 220 | machine_is_compatible("PowerMac7,3") || | ||
| 221 | machine_is_compatible("RackMac3,1")) | ||
| 222 | return -ENODEV; | ||
| 209 | return i2c_add_driver(&wf_lm75_driver); | 223 | return i2c_add_driver(&wf_lm75_driver); |
| 210 | } | 224 | } |
| 211 | 225 | ||
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index 5b9ad6ca7cba..8e99d408fddd 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include "windfarm.h" | 18 | #include "windfarm.h" |
| 19 | 19 | ||
| 20 | #define VERSION "0.1" | 20 | #define VERSION "0.2" |
| 21 | 21 | ||
| 22 | /* This currently only exports the external temperature sensor, | 22 | /* This currently only exports the external temperature sensor, |
| 23 | since that's all the control loops need. */ | 23 | since that's all the control loops need. */ |
| @@ -81,7 +81,7 @@ static struct wf_sensor_ops wf_max6690_ops = { | |||
| 81 | static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr) | 81 | static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr) |
| 82 | { | 82 | { |
| 83 | struct wf_6690_sensor *max; | 83 | struct wf_6690_sensor *max; |
| 84 | char *name = "u4-temp"; | 84 | char *name = "backside-temp"; |
| 85 | 85 | ||
| 86 | max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL); | 86 | max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL); |
| 87 | if (max == NULL) { | 87 | if (max == NULL) { |
| @@ -118,7 +118,6 @@ static int wf_max6690_attach(struct i2c_adapter *adapter) | |||
| 118 | struct device_node *busnode, *dev = NULL; | 118 | struct device_node *busnode, *dev = NULL; |
| 119 | struct pmac_i2c_bus *bus; | 119 | struct pmac_i2c_bus *bus; |
| 120 | const char *loc; | 120 | const char *loc; |
| 121 | u32 *reg; | ||
| 122 | 121 | ||
| 123 | bus = pmac_i2c_adapter_to_bus(adapter); | 122 | bus = pmac_i2c_adapter_to_bus(adapter); |
| 124 | if (bus == NULL) | 123 | if (bus == NULL) |
| @@ -126,16 +125,23 @@ static int wf_max6690_attach(struct i2c_adapter *adapter) | |||
| 126 | busnode = pmac_i2c_get_bus_node(bus); | 125 | busnode = pmac_i2c_get_bus_node(bus); |
| 127 | 126 | ||
| 128 | while ((dev = of_get_next_child(busnode, dev)) != NULL) { | 127 | while ((dev = of_get_next_child(busnode, dev)) != NULL) { |
| 128 | u8 addr; | ||
| 129 | |||
| 130 | /* We must re-match the adapter in order to properly check | ||
| 131 | * the channel on multibus setups | ||
| 132 | */ | ||
| 133 | if (!pmac_i2c_match_adapter(dev, adapter)) | ||
| 134 | continue; | ||
| 129 | if (!device_is_compatible(dev, "max6690")) | 135 | if (!device_is_compatible(dev, "max6690")) |
| 130 | continue; | 136 | continue; |
| 137 | addr = pmac_i2c_get_dev_addr(dev); | ||
| 131 | loc = get_property(dev, "hwsensor-location", NULL); | 138 | loc = get_property(dev, "hwsensor-location", NULL); |
| 132 | reg = (u32 *) get_property(dev, "reg", NULL); | 139 | if (loc == NULL || addr == 0) |
| 133 | if (!loc || !reg) | ||
| 134 | continue; | 140 | continue; |
| 135 | printk("found max6690, loc=%s reg=%x\n", loc, *reg); | 141 | printk("found max6690, loc=%s addr=0x%02x\n", loc, addr); |
| 136 | if (strcmp(loc, "BACKSIDE")) | 142 | if (strcmp(loc, "BACKSIDE")) |
| 137 | continue; | 143 | continue; |
| 138 | wf_max6690_create(adapter, *reg); | 144 | wf_max6690_create(adapter, addr); |
| 139 | } | 145 | } |
| 140 | 146 | ||
| 141 | return 0; | 147 | return 0; |
| @@ -153,6 +159,11 @@ static int wf_max6690_detach(struct i2c_client *client) | |||
| 153 | 159 | ||
| 154 | static int __init wf_max6690_sensor_init(void) | 160 | static int __init wf_max6690_sensor_init(void) |
| 155 | { | 161 | { |
| 162 | /* Don't register on old machines that use therm_pm72 for now */ | ||
| 163 | if (machine_is_compatible("PowerMac7,2") || | ||
| 164 | machine_is_compatible("PowerMac7,3") || | ||
| 165 | machine_is_compatible("RackMac3,1")) | ||
| 166 | return -ENODEV; | ||
| 156 | return i2c_add_driver(&wf_max6690_driver); | 167 | return i2c_add_driver(&wf_max6690_driver); |
| 157 | } | 168 | } |
| 158 | 169 | ||
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index c2a4e689c784..ef66bf2778ec 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c | |||
| @@ -358,6 +358,7 @@ static void backside_fan_tick(void) | |||
| 358 | return; | 358 | return; |
| 359 | if (!backside_tick) { | 359 | if (!backside_tick) { |
| 360 | /* first time; initialize things */ | 360 | /* first time; initialize things */ |
| 361 | printk(KERN_INFO "windfarm: Backside control loop started.\n"); | ||
| 361 | backside_param.min = backside_fan->ops->get_min(backside_fan); | 362 | backside_param.min = backside_fan->ops->get_min(backside_fan); |
| 362 | backside_param.max = backside_fan->ops->get_max(backside_fan); | 363 | backside_param.max = backside_fan->ops->get_max(backside_fan); |
| 363 | wf_pid_init(&backside_pid, &backside_param); | 364 | wf_pid_init(&backside_pid, &backside_param); |
| @@ -407,6 +408,7 @@ static void drive_bay_fan_tick(void) | |||
| 407 | return; | 408 | return; |
| 408 | if (!drive_bay_tick) { | 409 | if (!drive_bay_tick) { |
| 409 | /* first time; initialize things */ | 410 | /* first time; initialize things */ |
| 411 | printk(KERN_INFO "windfarm: Drive bay control loop started.\n"); | ||
| 410 | drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan); | 412 | drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan); |
| 411 | drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan); | 413 | drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan); |
| 412 | wf_pid_init(&drive_bay_pid, &drive_bay_prm); | 414 | wf_pid_init(&drive_bay_pid, &drive_bay_prm); |
| @@ -458,6 +460,7 @@ static void slots_fan_tick(void) | |||
| 458 | return; | 460 | return; |
| 459 | if (!slots_started) { | 461 | if (!slots_started) { |
| 460 | /* first time; initialize things */ | 462 | /* first time; initialize things */ |
| 463 | printk(KERN_INFO "windfarm: Slots control loop started.\n"); | ||
| 461 | wf_pid_init(&slots_pid, &slots_param); | 464 | wf_pid_init(&slots_pid, &slots_param); |
| 462 | slots_started = 1; | 465 | slots_started = 1; |
| 463 | } | 466 | } |
| @@ -504,6 +507,7 @@ static void pm112_tick(void) | |||
| 504 | 507 | ||
| 505 | if (!started) { | 508 | if (!started) { |
| 506 | started = 1; | 509 | started = 1; |
| 510 | printk(KERN_INFO "windfarm: CPUs control loops started.\n"); | ||
| 507 | for (i = 0; i < nr_cores; ++i) { | 511 | for (i = 0; i < nr_cores; ++i) { |
| 508 | if (create_cpu_loop(i) < 0) { | 512 | if (create_cpu_loop(i) < 0) { |
| 509 | failure_state = FAILURE_PERM; | 513 | failure_state = FAILURE_PERM; |
| @@ -594,8 +598,6 @@ static void pm112_new_sensor(struct wf_sensor *sr) | |||
| 594 | { | 598 | { |
| 595 | unsigned int i; | 599 | unsigned int i; |
| 596 | 600 | ||
| 597 | if (have_all_sensors) | ||
| 598 | return; | ||
| 599 | if (!strncmp(sr->name, "cpu-temp-", 9)) { | 601 | if (!strncmp(sr->name, "cpu-temp-", 9)) { |
| 600 | i = sr->name[9] - '0'; | 602 | i = sr->name[9] - '0'; |
| 601 | if (sr->name[10] == 0 && i < NR_CORES && | 603 | if (sr->name[10] == 0 && i < NR_CORES && |
| @@ -613,7 +615,7 @@ static void pm112_new_sensor(struct wf_sensor *sr) | |||
| 613 | } else if (!strcmp(sr->name, "slots-power")) { | 615 | } else if (!strcmp(sr->name, "slots-power")) { |
| 614 | if (slots_power == NULL && wf_get_sensor(sr) == 0) | 616 | if (slots_power == NULL && wf_get_sensor(sr) == 0) |
| 615 | slots_power = sr; | 617 | slots_power = sr; |
| 616 | } else if (!strcmp(sr->name, "u4-temp")) { | 618 | } else if (!strcmp(sr->name, "backside-temp")) { |
| 617 | if (u4_temp == NULL && wf_get_sensor(sr) == 0) | 619 | if (u4_temp == NULL && wf_get_sensor(sr) == 0) |
| 618 | u4_temp = sr; | 620 | u4_temp = sr; |
| 619 | } else | 621 | } else |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d39f584cd8b3..5d88329e3c7a 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
| @@ -306,6 +306,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
| 306 | r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); | 306 | r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); |
| 307 | int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); | 307 | int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); |
| 308 | conf_t *conf = mddev_to_conf(r1_bio->mddev); | 308 | conf_t *conf = mddev_to_conf(r1_bio->mddev); |
| 309 | struct bio *to_put = NULL; | ||
| 309 | 310 | ||
| 310 | if (bio->bi_size) | 311 | if (bio->bi_size) |
| 311 | return 1; | 312 | return 1; |
| @@ -323,6 +324,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
| 323 | * this branch is our 'one mirror IO has finished' event handler: | 324 | * this branch is our 'one mirror IO has finished' event handler: |
| 324 | */ | 325 | */ |
| 325 | r1_bio->bios[mirror] = NULL; | 326 | r1_bio->bios[mirror] = NULL; |
| 327 | to_put = bio; | ||
| 326 | if (!uptodate) { | 328 | if (!uptodate) { |
| 327 | md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); | 329 | md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); |
| 328 | /* an I/O failed, we can't clear the bitmap */ | 330 | /* an I/O failed, we can't clear the bitmap */ |
| @@ -375,7 +377,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
| 375 | /* Don't dec_pending yet, we want to hold | 377 | /* Don't dec_pending yet, we want to hold |
| 376 | * the reference over the retry | 378 | * the reference over the retry |
| 377 | */ | 379 | */ |
| 378 | return 0; | 380 | goto out; |
| 379 | } | 381 | } |
| 380 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { | 382 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { |
| 381 | /* free extra copy of the data pages */ | 383 | /* free extra copy of the data pages */ |
| @@ -392,10 +394,11 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
| 392 | raid_end_bio_io(r1_bio); | 394 | raid_end_bio_io(r1_bio); |
| 393 | } | 395 | } |
| 394 | 396 | ||
| 395 | if (r1_bio->bios[mirror]==NULL) | ||
| 396 | bio_put(bio); | ||
| 397 | |||
| 398 | rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); | 397 | rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); |
| 398 | out: | ||
| 399 | if (to_put) | ||
| 400 | bio_put(to_put); | ||
| 401 | |||
| 399 | return 0; | 402 | return 0; |
| 400 | } | 403 | } |
| 401 | 404 | ||
| @@ -857,7 +860,7 @@ static int make_request(request_queue_t *q, struct bio * bio) | |||
| 857 | atomic_set(&r1_bio->remaining, 0); | 860 | atomic_set(&r1_bio->remaining, 0); |
| 858 | atomic_set(&r1_bio->behind_remaining, 0); | 861 | atomic_set(&r1_bio->behind_remaining, 0); |
| 859 | 862 | ||
| 860 | do_barriers = bio->bi_rw & BIO_RW_BARRIER; | 863 | do_barriers = bio_barrier(bio); |
| 861 | if (do_barriers) | 864 | if (do_barriers) |
| 862 | set_bit(R1BIO_Barrier, &r1_bio->state); | 865 | set_bit(R1BIO_Barrier, &r1_bio->state); |
| 863 | 866 | ||
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index 390cc3a99ce6..9c7f122826e0 100644 --- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c | |||
| @@ -526,7 +526,7 @@ int flexcop_frontend_init(struct flexcop_device *fc) | |||
| 526 | info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address); | 526 | info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address); |
| 527 | } else | 527 | } else |
| 528 | /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */ | 528 | /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */ |
| 529 | if ((fc->fe = vp310_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { | 529 | if ((fc->fe = vp310_mt312_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { |
| 530 | ops = fc->fe->ops; | 530 | ops = fc->fe->ops; |
| 531 | 531 | ||
| 532 | ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; | 532 | ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; |
diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c index 34c3189a1a33..356f447ee2ab 100644 --- a/drivers/media/dvb/bt8xx/bt878.c +++ b/drivers/media/dvb/bt8xx/bt878.c | |||
| @@ -382,7 +382,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet * | |||
| 382 | EXPORT_SYMBOL(bt878_device_control); | 382 | EXPORT_SYMBOL(bt878_device_control); |
| 383 | 383 | ||
| 384 | 384 | ||
| 385 | struct cards card_list[] __devinitdata = { | 385 | static struct cards card_list[] __devinitdata = { |
| 386 | 386 | ||
| 387 | { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" }, | 387 | { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" }, |
| 388 | { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" }, | 388 | { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" }, |
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index 3a2ff1cc24b7..0310e3dd07e6 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c | |||
| @@ -602,7 +602,7 @@ static int dst_type_print(u8 type) | |||
| 602 | 602 | ||
| 603 | */ | 603 | */ |
| 604 | 604 | ||
| 605 | struct dst_types dst_tlist[] = { | 605 | static struct dst_types dst_tlist[] = { |
| 606 | { | 606 | { |
| 607 | .device_id = "200103A", | 607 | .device_id = "200103A", |
| 608 | .offset = 0, | 608 | .offset = 0, |
diff --git a/drivers/media/dvb/dvb-core/demux.h b/drivers/media/dvb/dvb-core/demux.h index 9f025825b2d2..0c1d87c5227a 100644 --- a/drivers/media/dvb/dvb-core/demux.h +++ b/drivers/media/dvb/dvb-core/demux.h | |||
| @@ -216,7 +216,7 @@ struct dmx_frontend { | |||
| 216 | /*--------------------------------------------------------------------------*/ | 216 | /*--------------------------------------------------------------------------*/ |
| 217 | 217 | ||
| 218 | /* | 218 | /* |
| 219 | * Flags OR'ed in the capabilites field of struct dmx_demux. | 219 | * Flags OR'ed in the capabilities field of struct dmx_demux. |
| 220 | */ | 220 | */ |
| 221 | 221 | ||
| 222 | #define DMX_TS_FILTERING 1 | 222 | #define DMX_TS_FILTERING 1 |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index f327fac1688e..162f9795cd89 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
| @@ -282,7 +282,7 @@ static struct cx22702_config cxusb_cx22702_config = { | |||
| 282 | .pll_set = dvb_usb_pll_set_i2c, | 282 | .pll_set = dvb_usb_pll_set_i2c, |
| 283 | }; | 283 | }; |
| 284 | 284 | ||
| 285 | static struct lgdt330x_config cxusb_lgdt330x_config = { | 285 | static struct lgdt330x_config cxusb_lgdt3303_config = { |
| 286 | .demod_address = 0x0e, | 286 | .demod_address = 0x0e, |
| 287 | .demod_chip = LGDT3303, | 287 | .demod_chip = LGDT3303, |
| 288 | .pll_set = dvb_usb_pll_set_i2c, | 288 | .pll_set = dvb_usb_pll_set_i2c, |
| @@ -357,14 +357,14 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) | |||
| 357 | return -EIO; | 357 | return -EIO; |
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d) | 360 | static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d) |
| 361 | { | 361 | { |
| 362 | if (usb_set_interface(d->udev,0,7) < 0) | 362 | if (usb_set_interface(d->udev,0,7) < 0) |
| 363 | err("set interface failed"); | 363 | err("set interface failed"); |
| 364 | 364 | ||
| 365 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); | 365 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); |
| 366 | 366 | ||
| 367 | if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL) | 367 | if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) |
| 368 | return 0; | 368 | return 0; |
| 369 | 369 | ||
| 370 | return -EIO; | 370 | return -EIO; |
| @@ -506,7 +506,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { | |||
| 506 | 506 | ||
| 507 | .streaming_ctrl = cxusb_streaming_ctrl, | 507 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 508 | .power_ctrl = cxusb_power_ctrl, | 508 | .power_ctrl = cxusb_power_ctrl, |
| 509 | .frontend_attach = cxusb_lgdt330x_frontend_attach, | 509 | .frontend_attach = cxusb_lgdt3303_frontend_attach, |
| 510 | .tuner_attach = cxusb_lgh064f_tuner_attach, | 510 | .tuner_attach = cxusb_lgh064f_tuner_attach, |
| 511 | 511 | ||
| 512 | .i2c_algo = &cxusb_i2c_algo, | 512 | .i2c_algo = &cxusb_i2c_algo, |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index 716f8bf528cd..ce34a55e5c24 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c | |||
| @@ -47,7 +47,7 @@ static int dvb_usb_init(struct dvb_usb_device *d) | |||
| 47 | 47 | ||
| 48 | d->state = DVB_USB_STATE_INIT; | 48 | d->state = DVB_USB_STATE_INIT; |
| 49 | 49 | ||
| 50 | /* check the capabilites and set appropriate variables */ | 50 | /* check the capabilities and set appropriate variables */ |
| 51 | 51 | ||
| 52 | /* speed - when running at FULL speed we need a HW PID filter */ | 52 | /* speed - when running at FULL speed we need a HW PID filter */ |
| 53 | if (d->udev->speed == USB_SPEED_FULL && !(d->props.caps & DVB_USB_HAS_PID_FILTER)) { | 53 | if (d->udev->speed == USB_SPEED_FULL && !(d->props.caps & DVB_USB_HAS_PID_FILTER)) { |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 5e5d21ad93c9..d4909e5c67e0 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
| @@ -87,7 +87,7 @@ struct dvb_usb_device; | |||
| 87 | 87 | ||
| 88 | /** | 88 | /** |
| 89 | * struct dvb_usb_properties - properties of a dvb-usb-device | 89 | * struct dvb_usb_properties - properties of a dvb-usb-device |
| 90 | * @caps: capabilites of the DVB USB device. | 90 | * @caps: capabilities of the DVB USB device. |
| 91 | * @pid_filter_count: number of PID filter position in the optional hardware | 91 | * @pid_filter_count: number of PID filter position in the optional hardware |
| 92 | * PID-filter. | 92 | * PID-filter. |
| 93 | * | 93 | * |
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index 76b6a2aef32f..c676b1e23ab0 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig | |||
| @@ -29,7 +29,7 @@ config DVB_TDA8083 | |||
| 29 | A DVB-S tuner module. Say Y when you want to support this frontend. | 29 | A DVB-S tuner module. Say Y when you want to support this frontend. |
| 30 | 30 | ||
| 31 | config DVB_MT312 | 31 | config DVB_MT312 |
| 32 | tristate "Zarlink MT312 based" | 32 | tristate "Zarlink VP310/MT312 based" |
| 33 | depends on DVB_CORE | 33 | depends on DVB_CORE |
| 34 | help | 34 | help |
| 35 | A DVB-S tuner module. Say Y when you want to support this frontend. | 35 | A DVB-S tuner module. Say Y when you want to support this frontend. |
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c index ec4e641acc64..d3aea83cf218 100644 --- a/drivers/media/dvb/frontends/mt312.c +++ b/drivers/media/dvb/frontends/mt312.c | |||
| @@ -612,76 +612,6 @@ static void mt312_release(struct dvb_frontend* fe) | |||
| 612 | kfree(state); | 612 | kfree(state); |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | static struct dvb_frontend_ops vp310_mt312_ops; | ||
| 616 | |||
| 617 | struct dvb_frontend* vp310_attach(const struct mt312_config* config, | ||
| 618 | struct i2c_adapter* i2c) | ||
| 619 | { | ||
| 620 | struct mt312_state* state = NULL; | ||
| 621 | |||
| 622 | /* allocate memory for the internal state */ | ||
| 623 | state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); | ||
| 624 | if (state == NULL) | ||
| 625 | goto error; | ||
| 626 | |||
| 627 | /* setup the state */ | ||
| 628 | state->config = config; | ||
| 629 | state->i2c = i2c; | ||
| 630 | memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); | ||
| 631 | strcpy(state->ops.info.name, "Zarlink VP310 DVB-S"); | ||
| 632 | |||
| 633 | /* check if the demod is there */ | ||
| 634 | if (mt312_readreg(state, ID, &state->id) < 0) | ||
| 635 | goto error; | ||
| 636 | if (state->id != ID_VP310) { | ||
| 637 | goto error; | ||
| 638 | } | ||
| 639 | |||
| 640 | /* create dvb_frontend */ | ||
| 641 | state->frequency = 90; | ||
| 642 | state->frontend.ops = &state->ops; | ||
| 643 | state->frontend.demodulator_priv = state; | ||
| 644 | return &state->frontend; | ||
| 645 | |||
| 646 | error: | ||
| 647 | kfree(state); | ||
| 648 | return NULL; | ||
| 649 | } | ||
| 650 | |||
| 651 | struct dvb_frontend* mt312_attach(const struct mt312_config* config, | ||
| 652 | struct i2c_adapter* i2c) | ||
| 653 | { | ||
| 654 | struct mt312_state* state = NULL; | ||
| 655 | |||
| 656 | /* allocate memory for the internal state */ | ||
| 657 | state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); | ||
| 658 | if (state == NULL) | ||
| 659 | goto error; | ||
| 660 | |||
| 661 | /* setup the state */ | ||
| 662 | state->config = config; | ||
| 663 | state->i2c = i2c; | ||
| 664 | memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); | ||
| 665 | strcpy(state->ops.info.name, "Zarlink MT312 DVB-S"); | ||
| 666 | |||
| 667 | /* check if the demod is there */ | ||
| 668 | if (mt312_readreg(state, ID, &state->id) < 0) | ||
| 669 | goto error; | ||
| 670 | if (state->id != ID_MT312) { | ||
| 671 | goto error; | ||
| 672 | } | ||
| 673 | |||
| 674 | /* create dvb_frontend */ | ||
| 675 | state->frequency = 60; | ||
| 676 | state->frontend.ops = &state->ops; | ||
| 677 | state->frontend.demodulator_priv = state; | ||
| 678 | return &state->frontend; | ||
| 679 | |||
| 680 | error: | ||
| 681 | kfree(state); | ||
| 682 | return NULL; | ||
| 683 | } | ||
| 684 | |||
| 685 | static struct dvb_frontend_ops vp310_mt312_ops = { | 615 | static struct dvb_frontend_ops vp310_mt312_ops = { |
| 686 | 616 | ||
| 687 | .info = { | 617 | .info = { |
| @@ -720,6 +650,49 @@ static struct dvb_frontend_ops vp310_mt312_ops = { | |||
| 720 | .set_voltage = mt312_set_voltage, | 650 | .set_voltage = mt312_set_voltage, |
| 721 | }; | 651 | }; |
| 722 | 652 | ||
| 653 | struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config, | ||
| 654 | struct i2c_adapter* i2c) | ||
| 655 | { | ||
| 656 | struct mt312_state* state = NULL; | ||
| 657 | |||
| 658 | /* allocate memory for the internal state */ | ||
| 659 | state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); | ||
| 660 | if (state == NULL) | ||
| 661 | goto error; | ||
| 662 | |||
| 663 | /* setup the state */ | ||
| 664 | state->config = config; | ||
| 665 | state->i2c = i2c; | ||
| 666 | memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); | ||
| 667 | |||
| 668 | /* check if the demod is there */ | ||
| 669 | if (mt312_readreg(state, ID, &state->id) < 0) | ||
| 670 | goto error; | ||
| 671 | |||
| 672 | switch (state->id) { | ||
| 673 | case ID_VP310: | ||
| 674 | strcpy(state->ops.info.name, "Zarlink VP310 DVB-S"); | ||
| 675 | state->frequency = 90; | ||
| 676 | break; | ||
| 677 | case ID_MT312: | ||
| 678 | strcpy(state->ops.info.name, "Zarlink MT312 DVB-S"); | ||
| 679 | state->frequency = 60; | ||
| 680 | break; | ||
| 681 | default: | ||
| 682 | printk (KERN_WARNING "Only Zarlink VP310/MT312 are supported chips.\n"); | ||
| 683 | goto error; | ||
| 684 | } | ||
| 685 | |||
| 686 | /* create dvb_frontend */ | ||
| 687 | state->frontend.ops = &state->ops; | ||
| 688 | state->frontend.demodulator_priv = state; | ||
| 689 | return &state->frontend; | ||
| 690 | |||
| 691 | error: | ||
| 692 | kfree(state); | ||
| 693 | return NULL; | ||
| 694 | } | ||
| 695 | |||
| 723 | module_param(debug, int, 0644); | 696 | module_param(debug, int, 0644); |
| 724 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); | 697 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); |
| 725 | 698 | ||
| @@ -727,5 +700,4 @@ MODULE_DESCRIPTION("Zarlink VP310/MT312 DVB-S Demodulator driver"); | |||
| 727 | MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>"); | 700 | MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>"); |
| 728 | MODULE_LICENSE("GPL"); | 701 | MODULE_LICENSE("GPL"); |
| 729 | 702 | ||
| 730 | EXPORT_SYMBOL(mt312_attach); | 703 | EXPORT_SYMBOL(vp310_mt312_attach); |
| 731 | EXPORT_SYMBOL(vp310_attach); | ||
diff --git a/drivers/media/dvb/frontends/mt312.h b/drivers/media/dvb/frontends/mt312.h index b3a53a73a117..074d844f0139 100644 --- a/drivers/media/dvb/frontends/mt312.h +++ b/drivers/media/dvb/frontends/mt312.h | |||
| @@ -38,10 +38,8 @@ struct mt312_config | |||
| 38 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); | 38 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | extern struct dvb_frontend* mt312_attach(const struct mt312_config* config, | 41 | struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config, |
| 42 | struct i2c_adapter* i2c); | 42 | struct i2c_adapter* i2c); |
| 43 | 43 | ||
| 44 | extern struct dvb_frontend* vp310_attach(const struct mt312_config* config, | ||
| 45 | struct i2c_adapter* i2c); | ||
| 46 | 44 | ||
| 47 | #endif // MT312_H | 45 | #endif // MT312_H |
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c index 6122ba754bc5..eb15676d374f 100644 --- a/drivers/media/dvb/frontends/stv0297.c +++ b/drivers/media/dvb/frontends/stv0297.c | |||
| @@ -393,10 +393,6 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par | |||
| 393 | break; | 393 | break; |
| 394 | 394 | ||
| 395 | case QAM_128: | 395 | case QAM_128: |
| 396 | delay = 150; | ||
| 397 | sweeprate = 1000; | ||
| 398 | break; | ||
| 399 | |||
| 400 | case QAM_256: | 396 | case QAM_256: |
| 401 | delay = 200; | 397 | delay = 200; |
| 402 | sweeprate = 500; | 398 | sweeprate = 500; |
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index d36369e9e88f..7c6ccb96b157 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
| @@ -1439,7 +1439,7 @@ static int check_firmware(struct av7110* av7110) | |||
| 1439 | len = ntohl(*(u32*) ptr); | 1439 | len = ntohl(*(u32*) ptr); |
| 1440 | ptr += 4; | 1440 | ptr += 4; |
| 1441 | if (len >= 512) { | 1441 | if (len >= 512) { |
| 1442 | printk("dvb-ttpci: dpram file is way to big.\n"); | 1442 | printk("dvb-ttpci: dpram file is way too big.\n"); |
| 1443 | return -EINVAL; | 1443 | return -EINVAL; |
| 1444 | } | 1444 | } |
| 1445 | if (crc != crc32_le(0, ptr, len)) { | 1445 | if (crc != crc32_le(0, ptr, len)) { |
| @@ -2477,7 +2477,8 @@ static int frontend_init(struct av7110 *av7110) | |||
| 2477 | * The same behaviour of missing VSYNC can be duplicated on budget | 2477 | * The same behaviour of missing VSYNC can be duplicated on budget |
| 2478 | * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. | 2478 | * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. |
| 2479 | */ | 2479 | */ |
| 2480 | static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext) | 2480 | static int __devinit av7110_attach(struct saa7146_dev* dev, |
| 2481 | struct saa7146_pci_extension_data *pci_ext) | ||
| 2481 | { | 2482 | { |
| 2482 | const int length = TS_WIDTH * TS_HEIGHT; | 2483 | const int length = TS_WIDTH * TS_HEIGHT; |
| 2483 | struct pci_dev *pdev = dev->pci; | 2484 | struct pci_dev *pdev = dev->pci; |
| @@ -2827,7 +2828,7 @@ err_kfree_0: | |||
| 2827 | goto out; | 2828 | goto out; |
| 2828 | } | 2829 | } |
| 2829 | 2830 | ||
| 2830 | static int av7110_detach(struct saa7146_dev* saa) | 2831 | static int __devexit av7110_detach(struct saa7146_dev* saa) |
| 2831 | { | 2832 | { |
| 2832 | struct av7110 *av7110 = saa->ext_priv; | 2833 | struct av7110 *av7110 = saa->ext_priv; |
| 2833 | dprintk(4, "%p\n", av7110); | 2834 | dprintk(4, "%p\n", av7110); |
| @@ -2974,7 +2975,7 @@ static struct saa7146_extension av7110_extension = { | |||
| 2974 | .module = THIS_MODULE, | 2975 | .module = THIS_MODULE, |
| 2975 | .pci_tbl = &pci_tbl[0], | 2976 | .pci_tbl = &pci_tbl[0], |
| 2976 | .attach = av7110_attach, | 2977 | .attach = av7110_attach, |
| 2977 | .detach = av7110_detach, | 2978 | .detach = __devexit_p(av7110_detach), |
| 2978 | 2979 | ||
| 2979 | .irq_mask = MASK_19 | MASK_03 | MASK_10, | 2980 | .irq_mask = MASK_19 | MASK_03 | MASK_10, |
| 2980 | .irq_func = av7110_irq, | 2981 | .irq_func = av7110_irq, |
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c index b2e63e9fc053..0bb6e74ae7f0 100644 --- a/drivers/media/dvb/ttpci/av7110_hw.c +++ b/drivers/media/dvb/ttpci/av7110_hw.c | |||
| @@ -245,6 +245,9 @@ int av7110_bootarm(struct av7110 *av7110) | |||
| 245 | 245 | ||
| 246 | /* test DEBI */ | 246 | /* test DEBI */ |
| 247 | iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4); | 247 | iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4); |
| 248 | /* FIXME: Why does Nexus CA require 2x iwdebi for first init? */ | ||
| 249 | iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4); | ||
| 250 | |||
| 248 | if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) { | 251 | if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) { |
| 249 | printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() failed: " | 252 | printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() failed: " |
| 250 | "%08x != %08x (check your BIOS 'Plug&Play OS' settings)\n", | 253 | "%08x != %08x (check your BIOS 'Plug&Play OS' settings)\n", |
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c index 617e4f6c0ed7..d54bbcdde2cc 100644 --- a/drivers/media/dvb/ttpci/av7110_ir.c +++ b/drivers/media/dvb/ttpci/av7110_ir.c | |||
| @@ -208,7 +208,7 @@ static void ir_handler(struct av7110 *av7110, u32 ircom) | |||
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | 210 | ||
| 211 | int __init av7110_ir_init(struct av7110 *av7110) | 211 | int __devinit av7110_ir_init(struct av7110 *av7110) |
| 212 | { | 212 | { |
| 213 | static struct proc_dir_entry *e; | 213 | static struct proc_dir_entry *e; |
| 214 | 214 | ||
| @@ -248,7 +248,7 @@ int __init av7110_ir_init(struct av7110 *av7110) | |||
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | 250 | ||
| 251 | void __exit av7110_ir_exit(struct av7110 *av7110) | 251 | void __devexit av7110_ir_exit(struct av7110 *av7110) |
| 252 | { | 252 | { |
| 253 | int i; | 253 | int i; |
| 254 | 254 | ||
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index 9f59541155d9..85d964b5b33c 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c | |||
| @@ -3369,7 +3369,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file, | |||
| 3369 | //DBG("cpia_ioctl: %u\n", ioctlnr); | 3369 | //DBG("cpia_ioctl: %u\n", ioctlnr); |
| 3370 | 3370 | ||
| 3371 | switch (ioctlnr) { | 3371 | switch (ioctlnr) { |
| 3372 | /* query capabilites */ | 3372 | /* query capabilities */ |
| 3373 | case VIDIOCGCAP: | 3373 | case VIDIOCGCAP: |
| 3374 | { | 3374 | { |
| 3375 | struct video_capability *b = arg; | 3375 | struct video_capability *b = arg; |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 08ffd1f325fc..5588b9a5c430 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
| @@ -567,7 +567,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = { | |||
| 567 | .type = V4L2_CTRL_TYPE_INTEGER, | 567 | .type = V4L2_CTRL_TYPE_INTEGER, |
| 568 | .name = "Contrast", | 568 | .name = "Contrast", |
| 569 | .minimum = 0, | 569 | .minimum = 0, |
| 570 | .maximum = 255, | 570 | .maximum = 127, |
| 571 | .step = 1, | 571 | .step = 1, |
| 572 | .default_value = 64, | 572 | .default_value = 64, |
| 573 | .flags = 0, | 573 | .flags = 0, |
| @@ -576,7 +576,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = { | |||
| 576 | .type = V4L2_CTRL_TYPE_INTEGER, | 576 | .type = V4L2_CTRL_TYPE_INTEGER, |
| 577 | .name = "Saturation", | 577 | .name = "Saturation", |
| 578 | .minimum = 0, | 578 | .minimum = 0, |
| 579 | .maximum = 255, | 579 | .maximum = 127, |
| 580 | .step = 1, | 580 | .step = 1, |
| 581 | .default_value = 64, | 581 | .default_value = 64, |
| 582 | .flags = 0, | 582 | .flags = 0, |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 048d000941c7..ffd87ce55556 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
| @@ -1027,7 +1027,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = { | |||
| 1027 | .type = V4L2_CTRL_TYPE_INTEGER, | 1027 | .type = V4L2_CTRL_TYPE_INTEGER, |
| 1028 | .name = "Contrast", | 1028 | .name = "Contrast", |
| 1029 | .minimum = 0, | 1029 | .minimum = 0, |
| 1030 | .maximum = 255, | 1030 | .maximum = 127, |
| 1031 | .step = 1, | 1031 | .step = 1, |
| 1032 | .default_value = 64, | 1032 | .default_value = 64, |
| 1033 | .flags = 0, | 1033 | .flags = 0, |
| @@ -1036,7 +1036,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = { | |||
| 1036 | .type = V4L2_CTRL_TYPE_INTEGER, | 1036 | .type = V4L2_CTRL_TYPE_INTEGER, |
| 1037 | .name = "Saturation", | 1037 | .name = "Saturation", |
| 1038 | .minimum = 0, | 1038 | .minimum = 0, |
| 1039 | .maximum = 255, | 1039 | .maximum = 127, |
| 1040 | .step = 1, | 1040 | .step = 1, |
| 1041 | .default_value = 64, | 1041 | .default_value = 64, |
| 1042 | .flags = 0, | 1042 | .flags = 0, |
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index a7a6ab9298a9..7df5e0826e12 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
| @@ -54,10 +54,12 @@ MODULE_PARM_DESC(debug,"enable debug messages [alsa]"); | |||
| 54 | 54 | ||
| 55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| 57 | static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; | 57 | static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1}; |
| 58 | 58 | ||
| 59 | module_param_array(index, int, NULL, 0444); | 59 | module_param_array(index, int, NULL, 0444); |
| 60 | module_param_array(enable, int, NULL, 0444); | ||
| 60 | MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); | 61 | MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); |
| 62 | MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s)."); | ||
| 61 | 63 | ||
| 62 | #define dprintk(fmt, arg...) if (debug) \ | 64 | #define dprintk(fmt, arg...) if (debug) \ |
| 63 | printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg) | 65 | printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg) |
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 5a35d3b6550d..6bc63a4086c1 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
| @@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = { | |||
| 977 | .radio_type = UNSET, | 977 | .radio_type = UNSET, |
| 978 | .tuner_addr = ADDR_UNSET, | 978 | .tuner_addr = ADDR_UNSET, |
| 979 | .radio_addr = ADDR_UNSET, | 979 | .radio_addr = ADDR_UNSET, |
| 980 | .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, | 980 | .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE, |
| 981 | .inputs = {{ | 981 | .inputs = {{ |
| 982 | .name = name_tv, | 982 | .name = name_tv, |
| 983 | .vmux = 3, | 983 | .vmux = 3, |
| @@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = { | |||
| 1666 | .radio_type = UNSET, | 1666 | .radio_type = UNSET, |
| 1667 | .tuner_addr = ADDR_UNSET, | 1667 | .tuner_addr = ADDR_UNSET, |
| 1668 | .radio_addr = ADDR_UNSET, | 1668 | .radio_addr = ADDR_UNSET, |
| 1669 | .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, | 1669 | .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE, |
| 1670 | .mpeg = SAA7134_MPEG_DVB, | 1670 | .mpeg = SAA7134_MPEG_DVB, |
| 1671 | .inputs = {{ | 1671 | .inputs = {{ |
| 1672 | .name = name_tv, | 1672 | .name = name_tv, |
| @@ -2187,7 +2187,7 @@ struct saa7134_board saa7134_boards[] = { | |||
| 2187 | .radio_type = UNSET, | 2187 | .radio_type = UNSET, |
| 2188 | .tuner_addr = 0x61, | 2188 | .tuner_addr = 0x61, |
| 2189 | .radio_addr = ADDR_UNSET, | 2189 | .radio_addr = ADDR_UNSET, |
| 2190 | .tda9887_conf = TDA9887_PRESENT, | 2190 | .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE, |
| 2191 | .mpeg = SAA7134_MPEG_DVB, | 2191 | .mpeg = SAA7134_MPEG_DVB, |
| 2192 | .inputs = {{ | 2192 | .inputs = {{ |
| 2193 | .name = name_tv, | 2193 | .name = name_tv, |
| @@ -2211,7 +2211,7 @@ struct saa7134_board saa7134_boards[] = { | |||
| 2211 | .radio_type = UNSET, | 2211 | .radio_type = UNSET, |
| 2212 | .tuner_addr = 0x61, | 2212 | .tuner_addr = 0x61, |
| 2213 | .radio_addr = ADDR_UNSET, | 2213 | .radio_addr = ADDR_UNSET, |
| 2214 | .tda9887_conf = TDA9887_PRESENT, | 2214 | .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE, |
| 2215 | .mpeg = SAA7134_MPEG_DVB, | 2215 | .mpeg = SAA7134_MPEG_DVB, |
| 2216 | .inputs = {{ | 2216 | .inputs = {{ |
| 2217 | .name = name_tv, | 2217 | .name = name_tv, |
| @@ -2392,7 +2392,7 @@ struct saa7134_board saa7134_boards[] = { | |||
| 2392 | }}, | 2392 | }}, |
| 2393 | }, | 2393 | }, |
| 2394 | [SAA7134_BOARD_PINNACLE_PCTV_110i] = { | 2394 | [SAA7134_BOARD_PINNACLE_PCTV_110i] = { |
| 2395 | .name = "Pinnacle PCTV 110i (saa7133)", | 2395 | .name = "Pinnacle PCTV 40i/50i/110i (saa7133)", |
| 2396 | .audio_clock = 0x00187de7, | 2396 | .audio_clock = 0x00187de7, |
| 2397 | .tuner_type = TUNER_PHILIPS_TDA8290, | 2397 | .tuner_type = TUNER_PHILIPS_TDA8290, |
| 2398 | .radio_type = UNSET, | 2398 | .radio_type = UNSET, |
| @@ -2407,6 +2407,10 @@ struct saa7134_board saa7134_boards[] = { | |||
| 2407 | },{ | 2407 | },{ |
| 2408 | .name = name_comp1, | 2408 | .name = name_comp1, |
| 2409 | .vmux = 1, | 2409 | .vmux = 1, |
| 2410 | .amux = LINE2, | ||
| 2411 | },{ | ||
| 2412 | .name = name_comp2, | ||
| 2413 | .vmux = 0, | ||
| 2410 | .amux = LINE2, | 2414 | .amux = LINE2, |
| 2411 | },{ | 2415 | },{ |
| 2412 | .name = name_svideo, | 2416 | .name = name_svideo, |
| @@ -2745,7 +2749,7 @@ struct pci_device_id saa7134_pci_tbl[] = { | |||
| 2745 | .vendor = PCI_VENDOR_ID_PHILIPS, | 2749 | .vendor = PCI_VENDOR_ID_PHILIPS, |
| 2746 | .device = PCI_DEVICE_ID_PHILIPS_SAA7130, | 2750 | .device = PCI_DEVICE_ID_PHILIPS_SAA7130, |
| 2747 | .subvendor = 0x1048, | 2751 | .subvendor = 0x1048, |
| 2748 | .subdevice = 0x226b, | 2752 | .subdevice = 0x226a, |
| 2749 | .driver_data = SAA7134_BOARD_ELSA_500TV, | 2753 | .driver_data = SAA7134_BOARD_ELSA_500TV, |
| 2750 | },{ | 2754 | },{ |
| 2751 | .vendor = PCI_VENDOR_ID_PHILIPS, | 2755 | .vendor = PCI_VENDOR_ID_PHILIPS, |
| @@ -3201,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_dev *dev) | |||
| 3201 | /* power-up tuner chip */ | 3205 | /* power-up tuner chip */ |
| 3202 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); | 3206 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); |
| 3203 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); | 3207 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); |
| 3208 | case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: | ||
| 3209 | /* this turns the remote control chip off to work around a bug in it */ | ||
| 3210 | saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); | ||
| 3211 | saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80); | ||
| 3212 | break; | ||
| 3204 | case SAA7134_BOARD_MONSTERTV_MOBILE: | 3213 | case SAA7134_BOARD_MONSTERTV_MOBILE: |
| 3205 | /* power-up tuner chip */ | 3214 | /* power-up tuner chip */ |
| 3206 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); | 3215 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 1a536e865277..9db8e13f21c3 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
| @@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe) | |||
| 110 | mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg)); | 110 | mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg)); |
| 111 | mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg)); | 111 | mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg)); |
| 112 | mt352_write(fe, irq_cfg, sizeof(irq_cfg)); | 112 | mt352_write(fe, irq_cfg, sizeof(irq_cfg)); |
| 113 | |||
| 113 | return 0; | 114 | return 0; |
| 114 | } | 115 | } |
| 115 | 116 | ||
| @@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, | |||
| 117 | struct dvb_frontend_parameters* params, | 118 | struct dvb_frontend_parameters* params, |
| 118 | u8* pllbuf) | 119 | u8* pllbuf) |
| 119 | { | 120 | { |
| 120 | static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE; | 121 | u8 off[] = { 0x00, 0xf1}; |
| 121 | static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE; | 122 | u8 on[] = { 0x00, 0x71}; |
| 123 | struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)}; | ||
| 124 | |||
| 122 | struct saa7134_dev *dev = fe->dvb->priv; | 125 | struct saa7134_dev *dev = fe->dvb->priv; |
| 123 | struct v4l2_frequency f; | 126 | struct v4l2_frequency f; |
| 124 | 127 | ||
| @@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, | |||
| 126 | f.tuner = 0; | 129 | f.tuner = 0; |
| 127 | f.type = V4L2_TUNER_DIGITAL_TV; | 130 | f.type = V4L2_TUNER_DIGITAL_TV; |
| 128 | f.frequency = params->frequency / 1000 * 16 / 1000; | 131 | f.frequency = params->frequency / 1000 * 16 / 1000; |
| 129 | saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on); | 132 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
| 130 | saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); | 133 | saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); |
| 131 | saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off); | 134 | msg.buf = on; |
| 135 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
| 132 | 136 | ||
| 133 | pinnacle_antenna_pwr(dev, antenna_pwr); | 137 | pinnacle_antenna_pwr(dev, antenna_pwr); |
| 134 | 138 | ||
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index 7b4fb282ac82..a796a4e1917c 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c | |||
| @@ -580,9 +580,10 @@ int tda8290_init(struct i2c_client *c) | |||
| 580 | 580 | ||
| 581 | int tda8290_probe(struct i2c_client *c) | 581 | int tda8290_probe(struct i2c_client *c) |
| 582 | { | 582 | { |
| 583 | unsigned char soft_reset[] = { 0x00, 0x00 }; | 583 | unsigned char soft_reset[] = { 0x00, 0x00 }; |
| 584 | unsigned char easy_mode_b[] = { 0x01, 0x02 }; | 584 | unsigned char easy_mode_b[] = { 0x01, 0x02 }; |
| 585 | unsigned char easy_mode_g[] = { 0x01, 0x04 }; | 585 | unsigned char easy_mode_g[] = { 0x01, 0x04 }; |
| 586 | unsigned char restore_9886[] = { 0x00, 0xd6, 0x30 }; | ||
| 586 | unsigned char addr_dto_lsb = 0x07; | 587 | unsigned char addr_dto_lsb = 0x07; |
| 587 | unsigned char data; | 588 | unsigned char data; |
| 588 | 589 | ||
| @@ -599,6 +600,7 @@ int tda8290_probe(struct i2c_client *c) | |||
| 599 | return 0; | 600 | return 0; |
| 600 | } | 601 | } |
| 601 | } | 602 | } |
| 603 | i2c_master_send(c, restore_9886, 3); | ||
| 602 | return -1; | 604 | return -1; |
| 603 | } | 605 | } |
| 604 | 606 | ||
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index e7ee619d62c5..b6101bf446d4 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
| @@ -713,8 +713,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
| 713 | struct v4l2_frequency *f = arg; | 713 | struct v4l2_frequency *f = arg; |
| 714 | 714 | ||
| 715 | switch_v4l2(); | 715 | switch_v4l2(); |
| 716 | if (V4L2_TUNER_RADIO == f->type && | 716 | if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode) |
| 717 | V4L2_TUNER_RADIO != t->mode) { | 717 | || (V4L2_TUNER_DIGITAL_TV == f->type |
| 718 | && V4L2_TUNER_DIGITAL_TV != t->mode)) { | ||
| 718 | if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") | 719 | if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") |
| 719 | == EINVAL) | 720 | == EINVAL) |
| 720 | return 0; | 721 | return 0; |
diff --git a/drivers/media/video/videocodec.h b/drivers/media/video/videocodec.h index 156ae57096fe..b1239ac7f371 100644 --- a/drivers/media/video/videocodec.h +++ b/drivers/media/video/videocodec.h | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | the slave is bound to it). Otherwise it doesn't need this functions and | 56 | the slave is bound to it). Otherwise it doesn't need this functions and |
| 57 | therfor they may not be initialized. | 57 | therfor they may not be initialized. |
| 58 | 58 | ||
| 59 | The other fuctions are just for convenience, as they are for shure used by | 59 | The other fuctions are just for convenience, as they are for sure used by |
| 60 | most/all of the codecs. The last ones may be ommited, too. | 60 | most/all of the codecs. The last ones may be ommited, too. |
| 61 | 61 | ||
| 62 | See the structure declaration below for more information and which data has | 62 | See the structure declaration below for more information and which data has |
diff --git a/drivers/media/video/zr36050.c b/drivers/media/video/zr36050.c index bd0cd28543ca..6699725be605 100644 --- a/drivers/media/video/zr36050.c +++ b/drivers/media/video/zr36050.c | |||
| @@ -159,7 +159,7 @@ zr36050_wait_end (struct zr36050 *ptr) | |||
| 159 | 159 | ||
| 160 | while (!(zr36050_read_status1(ptr) & 0x4)) { | 160 | while (!(zr36050_read_status1(ptr) & 0x4)) { |
| 161 | udelay(1); | 161 | udelay(1); |
| 162 | if (i++ > 200000) { // 200ms, there is for shure something wrong!!! | 162 | if (i++ > 200000) { // 200ms, there is for sure something wrong!!! |
| 163 | dprintk(1, | 163 | dprintk(1, |
| 164 | "%s: timout at wait_end (last status: 0x%02x)\n", | 164 | "%s: timout at wait_end (last status: 0x%02x)\n", |
| 165 | ptr->name, ptr->status1); | 165 | ptr->name, ptr->status1); |
diff --git a/drivers/media/video/zr36060.c b/drivers/media/video/zr36060.c index 28fa31a5f150..d8dd003a7aad 100644 --- a/drivers/media/video/zr36060.c +++ b/drivers/media/video/zr36060.c | |||
| @@ -161,7 +161,7 @@ zr36060_wait_end (struct zr36060 *ptr) | |||
| 161 | 161 | ||
| 162 | while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) { | 162 | while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) { |
| 163 | udelay(1); | 163 | udelay(1); |
| 164 | if (i++ > 200000) { // 200ms, there is for shure something wrong!!! | 164 | if (i++ > 200000) { // 200ms, there is for sure something wrong!!! |
| 165 | dprintk(1, | 165 | dprintk(1, |
| 166 | "%s: timout at wait_end (last status: 0x%02x)\n", | 166 | "%s: timout at wait_end (last status: 0x%02x)\n", |
| 167 | ptr->name, ptr->status); | 167 | ptr->name, ptr->status); |
diff --git a/drivers/media/video/zr36120_i2c.c b/drivers/media/video/zr36120_i2c.c index 6bfe84d657f1..21fde43a6aed 100644 --- a/drivers/media/video/zr36120_i2c.c +++ b/drivers/media/video/zr36120_i2c.c | |||
| @@ -65,7 +65,7 @@ void attach_inform(struct i2c_bus *bus, int id) | |||
| 65 | case I2C_DRIVERID_VIDEODECODER: | 65 | case I2C_DRIVERID_VIDEODECODER: |
| 66 | DEBUG(printk(CARD_INFO "decoder attached\n",CARD)); | 66 | DEBUG(printk(CARD_INFO "decoder attached\n",CARD)); |
| 67 | 67 | ||
| 68 | /* fetch the capabilites of the decoder */ | 68 | /* fetch the capabilities of the decoder */ |
| 69 | rv = i2c_control_device(&ztv->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_GET_CAPABILITIES, &dc); | 69 | rv = i2c_control_device(&ztv->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_GET_CAPABILITIES, &dc); |
| 70 | if (rv) { | 70 | if (rv) { |
| 71 | DEBUG(printk(CARD_DEBUG "decoder is not V4L aware!\n",CARD)); | 71 | DEBUG(printk(CARD_DEBUG "decoder is not V4L aware!\n",CARD)); |
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h index 1cef2387fa65..6aba41954448 100644 --- a/drivers/misc/ibmasm/ibmasm.h +++ b/drivers/misc/ibmasm/ibmasm.h | |||
| @@ -101,15 +101,16 @@ struct command { | |||
| 101 | static inline void command_put(struct command *cmd) | 101 | static inline void command_put(struct command *cmd) |
| 102 | { | 102 | { |
| 103 | unsigned long flags; | 103 | unsigned long flags; |
| 104 | spinlock_t *lock = cmd->lock; | ||
| 104 | 105 | ||
| 105 | spin_lock_irqsave(cmd->lock, flags); | 106 | spin_lock_irqsave(lock, flags); |
| 106 | kobject_put(&cmd->kobj); | 107 | kobject_put(&cmd->kobj); |
| 107 | spin_unlock_irqrestore(cmd->lock, flags); | 108 | spin_unlock_irqrestore(lock, flags); |
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | static inline void command_get(struct command *cmd) | 111 | static inline void command_get(struct command *cmd) |
| 111 | { | 112 | { |
| 112 | kobject_get(&cmd->kobj); | 113 | kobject_get(&cmd->kobj); |
| 113 | } | 114 | } |
| 114 | 115 | ||
| 115 | 116 | ||
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 824e430486c2..830528dce0ca 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
| @@ -1574,6 +1574,7 @@ MODULE_LICENSE("GPL"); | |||
| 1574 | 1574 | ||
| 1575 | static int __init el3_init_module(void) | 1575 | static int __init el3_init_module(void) |
| 1576 | { | 1576 | { |
| 1577 | int ret = 0; | ||
| 1577 | el3_cards = 0; | 1578 | el3_cards = 0; |
| 1578 | 1579 | ||
| 1579 | if (debug >= 0) | 1580 | if (debug >= 0) |
| @@ -1589,14 +1590,16 @@ static int __init el3_init_module(void) | |||
| 1589 | } | 1590 | } |
| 1590 | 1591 | ||
| 1591 | #ifdef CONFIG_EISA | 1592 | #ifdef CONFIG_EISA |
| 1592 | if (eisa_driver_register (&el3_eisa_driver) < 0) { | 1593 | ret = eisa_driver_register(&el3_eisa_driver); |
| 1593 | eisa_driver_unregister (&el3_eisa_driver); | ||
| 1594 | } | ||
| 1595 | #endif | 1594 | #endif |
| 1596 | #ifdef CONFIG_MCA | 1595 | #ifdef CONFIG_MCA |
| 1597 | mca_register_driver(&el3_mca_driver); | 1596 | { |
| 1597 | int err = mca_register_driver(&el3_mca_driver); | ||
| 1598 | if (ret == 0) | ||
| 1599 | ret = err; | ||
| 1600 | } | ||
| 1598 | #endif | 1601 | #endif |
| 1599 | return 0; | 1602 | return ret; |
| 1600 | } | 1603 | } |
| 1601 | 1604 | ||
| 1602 | static void __exit el3_cleanup_module(void) | 1605 | static void __exit el3_cleanup_module(void) |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e45a8f959719..aa633fa95e64 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -1087,7 +1087,8 @@ config NE2000 | |||
| 1087 | without a specific driver are compatible with NE2000. | 1087 | without a specific driver are compatible with NE2000. |
| 1088 | 1088 | ||
| 1089 | If you have a PCI NE2000 card however, say N here and Y to "PCI | 1089 | If you have a PCI NE2000 card however, say N here and Y to "PCI |
| 1090 | NE2000 support", above. If you have a NE2000 card and are running on | 1090 | NE2000 and clone support" under "EISA, VLB, PCI and on board |
| 1091 | controllers" below. If you have a NE2000 card and are running on | ||
| 1091 | an MCA system (a bus system used on some IBM PS/2 computers and | 1092 | an MCA system (a bus system used on some IBM PS/2 computers and |
| 1092 | laptops), say N here and Y to "NE/2 (ne2000 MCA version) support", | 1093 | laptops), say N here and Y to "NE/2 (ne2000 MCA version) support", |
| 1093 | below. | 1094 | below. |
diff --git a/drivers/net/de620.c b/drivers/net/de620.c index 0069f5fa973a..22fc5b869a60 100644 --- a/drivers/net/de620.c +++ b/drivers/net/de620.c | |||
| @@ -1012,7 +1012,7 @@ static int __init read_eeprom(struct net_device *dev) | |||
| 1012 | #ifdef MODULE | 1012 | #ifdef MODULE |
| 1013 | static struct net_device *de620_dev; | 1013 | static struct net_device *de620_dev; |
| 1014 | 1014 | ||
| 1015 | int init_module(void) | 1015 | int __init init_module(void) |
| 1016 | { | 1016 | { |
| 1017 | de620_dev = de620_probe(-1); | 1017 | de620_dev = de620_probe(-1); |
| 1018 | if (IS_ERR(de620_dev)) | 1018 | if (IS_ERR(de620_dev)) |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 430c628279b3..fb9dae302dcc 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
| @@ -50,8 +50,8 @@ | |||
| 50 | 50 | ||
| 51 | */ | 51 | */ |
| 52 | #define DRV_NAME "D-Link DL2000-based linux driver" | 52 | #define DRV_NAME "D-Link DL2000-based linux driver" |
| 53 | #define DRV_VERSION "v1.17a" | 53 | #define DRV_VERSION "v1.17b" |
| 54 | #define DRV_RELDATE "2002/10/04" | 54 | #define DRV_RELDATE "2006/03/10" |
| 55 | #include "dl2k.h" | 55 | #include "dl2k.h" |
| 56 | 56 | ||
| 57 | static char version[] __devinitdata = | 57 | static char version[] __devinitdata = |
| @@ -765,7 +765,7 @@ rio_free_tx (struct net_device *dev, int irq) | |||
| 765 | break; | 765 | break; |
| 766 | skb = np->tx_skbuff[entry]; | 766 | skb = np->tx_skbuff[entry]; |
| 767 | pci_unmap_single (np->pdev, | 767 | pci_unmap_single (np->pdev, |
| 768 | np->tx_ring[entry].fraginfo, | 768 | np->tx_ring[entry].fraginfo & 0xffffffffffff, |
| 769 | skb->len, PCI_DMA_TODEVICE); | 769 | skb->len, PCI_DMA_TODEVICE); |
| 770 | if (irq) | 770 | if (irq) |
| 771 | dev_kfree_skb_irq (skb); | 771 | dev_kfree_skb_irq (skb); |
| @@ -892,14 +892,16 @@ receive_packet (struct net_device *dev) | |||
| 892 | 892 | ||
| 893 | /* Small skbuffs for short packets */ | 893 | /* Small skbuffs for short packets */ |
| 894 | if (pkt_len > copy_thresh) { | 894 | if (pkt_len > copy_thresh) { |
| 895 | pci_unmap_single (np->pdev, desc->fraginfo, | 895 | pci_unmap_single (np->pdev, |
| 896 | desc->fraginfo & 0xffffffffffff, | ||
| 896 | np->rx_buf_sz, | 897 | np->rx_buf_sz, |
| 897 | PCI_DMA_FROMDEVICE); | 898 | PCI_DMA_FROMDEVICE); |
| 898 | skb_put (skb = np->rx_skbuff[entry], pkt_len); | 899 | skb_put (skb = np->rx_skbuff[entry], pkt_len); |
| 899 | np->rx_skbuff[entry] = NULL; | 900 | np->rx_skbuff[entry] = NULL; |
| 900 | } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { | 901 | } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { |
| 901 | pci_dma_sync_single_for_cpu(np->pdev, | 902 | pci_dma_sync_single_for_cpu(np->pdev, |
| 902 | desc->fraginfo, | 903 | desc->fraginfo & |
| 904 | 0xffffffffffff, | ||
| 903 | np->rx_buf_sz, | 905 | np->rx_buf_sz, |
| 904 | PCI_DMA_FROMDEVICE); | 906 | PCI_DMA_FROMDEVICE); |
| 905 | skb->dev = dev; | 907 | skb->dev = dev; |
| @@ -910,7 +912,8 @@ receive_packet (struct net_device *dev) | |||
| 910 | pkt_len, 0); | 912 | pkt_len, 0); |
| 911 | skb_put (skb, pkt_len); | 913 | skb_put (skb, pkt_len); |
| 912 | pci_dma_sync_single_for_device(np->pdev, | 914 | pci_dma_sync_single_for_device(np->pdev, |
| 913 | desc->fraginfo, | 915 | desc->fraginfo & |
| 916 | 0xffffffffffff, | ||
| 914 | np->rx_buf_sz, | 917 | np->rx_buf_sz, |
| 915 | PCI_DMA_FROMDEVICE); | 918 | PCI_DMA_FROMDEVICE); |
| 916 | } | 919 | } |
| @@ -1796,8 +1799,9 @@ rio_close (struct net_device *dev) | |||
| 1796 | np->rx_ring[i].fraginfo = 0; | 1799 | np->rx_ring[i].fraginfo = 0; |
| 1797 | skb = np->rx_skbuff[i]; | 1800 | skb = np->rx_skbuff[i]; |
| 1798 | if (skb) { | 1801 | if (skb) { |
| 1799 | pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo, | 1802 | pci_unmap_single(np->pdev, |
| 1800 | skb->len, PCI_DMA_FROMDEVICE); | 1803 | np->rx_ring[i].fraginfo & 0xffffffffffff, |
| 1804 | skb->len, PCI_DMA_FROMDEVICE); | ||
| 1801 | dev_kfree_skb (skb); | 1805 | dev_kfree_skb (skb); |
| 1802 | np->rx_skbuff[i] = NULL; | 1806 | np->rx_skbuff[i] = NULL; |
| 1803 | } | 1807 | } |
| @@ -1805,8 +1809,9 @@ rio_close (struct net_device *dev) | |||
| 1805 | for (i = 0; i < TX_RING_SIZE; i++) { | 1809 | for (i = 0; i < TX_RING_SIZE; i++) { |
| 1806 | skb = np->tx_skbuff[i]; | 1810 | skb = np->tx_skbuff[i]; |
| 1807 | if (skb) { | 1811 | if (skb) { |
| 1808 | pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo, | 1812 | pci_unmap_single(np->pdev, |
| 1809 | skb->len, PCI_DMA_TODEVICE); | 1813 | np->tx_ring[i].fraginfo & 0xffffffffffff, |
| 1814 | skb->len, PCI_DMA_TODEVICE); | ||
| 1810 | dev_kfree_skb (skb); | 1815 | dev_kfree_skb (skb); |
| 1811 | np->tx_skbuff[i] = NULL; | 1816 | np->tx_skbuff[i] = NULL; |
| 1812 | } | 1817 | } |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5b7d0f425af2..4c4db96d0b7b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
| @@ -2917,7 +2917,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
| 2917 | if (!__pskb_pull_tail(skb, pull_size)) { | 2917 | if (!__pskb_pull_tail(skb, pull_size)) { |
| 2918 | printk(KERN_ERR "__pskb_pull_tail failed.\n"); | 2918 | printk(KERN_ERR "__pskb_pull_tail failed.\n"); |
| 2919 | dev_kfree_skb_any(skb); | 2919 | dev_kfree_skb_any(skb); |
| 2920 | return -EFAULT; | 2920 | return NETDEV_TX_OK; |
| 2921 | } | 2921 | } |
| 2922 | len = skb->len - skb->data_len; | 2922 | len = skb->len - skb->data_len; |
| 2923 | } | 2923 | } |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 72c1630977d6..73260364cba3 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
| @@ -74,7 +74,7 @@ | |||
| 74 | #define TX_RING_SIZE 512 | 74 | #define TX_RING_SIZE 512 |
| 75 | #define TX_DEF_PENDING (TX_RING_SIZE - 1) | 75 | #define TX_DEF_PENDING (TX_RING_SIZE - 1) |
| 76 | #define TX_MIN_PENDING 64 | 76 | #define TX_MIN_PENDING 64 |
| 77 | #define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS) | 77 | #define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) |
| 78 | 78 | ||
| 79 | #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ | 79 | #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ |
| 80 | #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) | 80 | #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) |
| @@ -622,8 +622,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
| 622 | 622 | ||
| 623 | /* Configure Rx MAC FIFO */ | 623 | /* Configure Rx MAC FIFO */ |
| 624 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); | 624 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); |
| 625 | sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T), | 625 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), |
| 626 | GMF_RX_CTRL_DEF); | 626 | GMF_OPER_ON | GMF_RX_F_FL_ON); |
| 627 | 627 | ||
| 628 | /* Flush Rx MAC FIFO on any flow control or error */ | 628 | /* Flush Rx MAC FIFO on any flow control or error */ |
| 629 | sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); | 629 | sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); |
| @@ -995,6 +995,10 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
| 995 | sky2_rx_add(sky2, re->mapaddr); | 995 | sky2_rx_add(sky2, re->mapaddr); |
| 996 | } | 996 | } |
| 997 | 997 | ||
| 998 | /* Truncate oversize frames */ | ||
| 999 | sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8); | ||
| 1000 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); | ||
| 1001 | |||
| 998 | /* Tell chip about available buffers */ | 1002 | /* Tell chip about available buffers */ |
| 999 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); | 1003 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); |
| 1000 | sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX)); | 1004 | sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX)); |
| @@ -1145,6 +1149,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
| 1145 | struct sky2_tx_le *le = NULL; | 1149 | struct sky2_tx_le *le = NULL; |
| 1146 | struct tx_ring_info *re; | 1150 | struct tx_ring_info *re; |
| 1147 | unsigned i, len; | 1151 | unsigned i, len; |
| 1152 | int avail; | ||
| 1148 | dma_addr_t mapping; | 1153 | dma_addr_t mapping; |
| 1149 | u32 addr64; | 1154 | u32 addr64; |
| 1150 | u16 mss; | 1155 | u16 mss; |
| @@ -1287,12 +1292,16 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
| 1287 | re->idx = sky2->tx_prod; | 1292 | re->idx = sky2->tx_prod; |
| 1288 | le->ctrl |= EOP; | 1293 | le->ctrl |= EOP; |
| 1289 | 1294 | ||
| 1295 | avail = tx_avail(sky2); | ||
| 1296 | if (mss != 0 || avail < TX_MIN_PENDING) { | ||
| 1297 | le->ctrl |= FRC_STAT; | ||
| 1298 | if (avail <= MAX_SKB_TX_LE) | ||
| 1299 | netif_stop_queue(dev); | ||
| 1300 | } | ||
| 1301 | |||
| 1290 | sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, | 1302 | sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, |
| 1291 | &sky2->tx_last_put, TX_RING_SIZE); | 1303 | &sky2->tx_last_put, TX_RING_SIZE); |
| 1292 | 1304 | ||
| 1293 | if (tx_avail(sky2) <= MAX_SKB_TX_LE) | ||
| 1294 | netif_stop_queue(dev); | ||
| 1295 | |||
| 1296 | out_unlock: | 1305 | out_unlock: |
| 1297 | spin_unlock(&sky2->tx_lock); | 1306 | spin_unlock(&sky2->tx_lock); |
| 1298 | 1307 | ||
| @@ -1707,10 +1716,12 @@ static void sky2_tx_timeout(struct net_device *dev) | |||
| 1707 | 1716 | ||
| 1708 | 1717 | ||
| 1709 | #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) | 1718 | #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) |
| 1710 | /* Want receive buffer size to be multiple of 64 bits, and incl room for vlan */ | 1719 | /* Want receive buffer size to be multiple of 64 bits |
| 1720 | * and incl room for vlan and truncation | ||
| 1721 | */ | ||
| 1711 | static inline unsigned sky2_buf_size(int mtu) | 1722 | static inline unsigned sky2_buf_size(int mtu) |
| 1712 | { | 1723 | { |
| 1713 | return roundup(mtu + ETH_HLEN + 4, 8); | 1724 | return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; |
| 1714 | } | 1725 | } |
| 1715 | 1726 | ||
| 1716 | static int sky2_change_mtu(struct net_device *dev, int new_mtu) | 1727 | static int sky2_change_mtu(struct net_device *dev, int new_mtu) |
| @@ -1793,7 +1804,7 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2, | |||
| 1793 | if (!(status & GMR_FS_RX_OK)) | 1804 | if (!(status & GMR_FS_RX_OK)) |
| 1794 | goto resubmit; | 1805 | goto resubmit; |
| 1795 | 1806 | ||
| 1796 | if ((status >> 16) != length || length > sky2->rx_bufsize) | 1807 | if (length > sky2->netdev->mtu + ETH_HLEN) |
| 1797 | goto oversize; | 1808 | goto oversize; |
| 1798 | 1809 | ||
| 1799 | if (length < copybreak) { | 1810 | if (length < copybreak) { |
| @@ -3243,8 +3254,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
| 3243 | } | 3254 | } |
| 3244 | } | 3255 | } |
| 3245 | 3256 | ||
| 3246 | err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, | 3257 | err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw); |
| 3247 | DRV_NAME, hw); | ||
| 3248 | if (err) { | 3258 | if (err) { |
| 3249 | printk(KERN_ERR PFX "%s: cannot assign irq %d\n", | 3259 | printk(KERN_ERR PFX "%s: cannot assign irq %d\n", |
| 3250 | pci_name(pdev), pdev->irq); | 3260 | pci_name(pdev), pdev->irq); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 15545620ab0e..b8f1524da557 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
| @@ -10543,8 +10543,6 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str) | |||
| 10543 | strcat(str, "66MHz"); | 10543 | strcat(str, "66MHz"); |
| 10544 | else if (clock_ctrl == 6) | 10544 | else if (clock_ctrl == 6) |
| 10545 | strcat(str, "100MHz"); | 10545 | strcat(str, "100MHz"); |
| 10546 | else if (clock_ctrl == 7) | ||
| 10547 | strcat(str, "133MHz"); | ||
| 10548 | } else { | 10546 | } else { |
| 10549 | strcpy(str, "PCI:"); | 10547 | strcpy(str, "PCI:"); |
| 10550 | if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) | 10548 | if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index d7fb3ffe06ac..2d0cfbceee22 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
| @@ -1362,7 +1362,6 @@ static int de_open (struct net_device *dev) | |||
| 1362 | { | 1362 | { |
| 1363 | struct de_private *de = dev->priv; | 1363 | struct de_private *de = dev->priv; |
| 1364 | int rc; | 1364 | int rc; |
| 1365 | unsigned long flags; | ||
| 1366 | 1365 | ||
| 1367 | if (netif_msg_ifup(de)) | 1366 | if (netif_msg_ifup(de)) |
| 1368 | printk(KERN_DEBUG "%s: enabling interface\n", dev->name); | 1367 | printk(KERN_DEBUG "%s: enabling interface\n", dev->name); |
| @@ -1376,18 +1375,20 @@ static int de_open (struct net_device *dev) | |||
| 1376 | return rc; | 1375 | return rc; |
| 1377 | } | 1376 | } |
| 1378 | 1377 | ||
| 1379 | rc = de_init_hw(de); | 1378 | dw32(IntrMask, 0); |
| 1380 | if (rc) { | ||
| 1381 | printk(KERN_ERR "%s: h/w init failure, err=%d\n", | ||
| 1382 | dev->name, rc); | ||
| 1383 | goto err_out_free; | ||
| 1384 | } | ||
| 1385 | 1379 | ||
| 1386 | rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); | 1380 | rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); |
| 1387 | if (rc) { | 1381 | if (rc) { |
| 1388 | printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", | 1382 | printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", |
| 1389 | dev->name, dev->irq, rc); | 1383 | dev->name, dev->irq, rc); |
| 1390 | goto err_out_hw; | 1384 | goto err_out_free; |
| 1385 | } | ||
| 1386 | |||
| 1387 | rc = de_init_hw(de); | ||
| 1388 | if (rc) { | ||
| 1389 | printk(KERN_ERR "%s: h/w init failure, err=%d\n", | ||
| 1390 | dev->name, rc); | ||
| 1391 | goto err_out_free_irq; | ||
| 1391 | } | 1392 | } |
| 1392 | 1393 | ||
| 1393 | netif_start_queue(dev); | 1394 | netif_start_queue(dev); |
| @@ -1395,11 +1396,8 @@ static int de_open (struct net_device *dev) | |||
| 1395 | 1396 | ||
| 1396 | return 0; | 1397 | return 0; |
| 1397 | 1398 | ||
| 1398 | err_out_hw: | 1399 | err_out_free_irq: |
| 1399 | spin_lock_irqsave(&de->lock, flags); | 1400 | free_irq(dev->irq, dev); |
| 1400 | de_stop_hw(de); | ||
| 1401 | spin_unlock_irqrestore(&de->lock, flags); | ||
| 1402 | |||
| 1403 | err_out_free: | 1401 | err_out_free: |
| 1404 | de_free_rings(de); | 1402 | de_free_rings(de); |
| 1405 | return rc; | 1403 | return rc; |
| @@ -1455,6 +1453,8 @@ static void de_tx_timeout (struct net_device *dev) | |||
| 1455 | synchronize_irq(dev->irq); | 1453 | synchronize_irq(dev->irq); |
| 1456 | de_clean_rings(de); | 1454 | de_clean_rings(de); |
| 1457 | 1455 | ||
| 1456 | de_init_rings(de); | ||
| 1457 | |||
| 1458 | de_init_hw(de); | 1458 | de_init_hw(de); |
| 1459 | 1459 | ||
| 1460 | netif_wake_queue(dev); | 1460 | netif_wake_queue(dev); |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 50b8c6754b1e..a1ed2d983740 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
| @@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, | |||
| 249 | 249 | ||
| 250 | if (align) | 250 | if (align) |
| 251 | skb_reserve(skb, align); | 251 | skb_reserve(skb, align); |
| 252 | if (memcpy_fromiovec(skb_put(skb, len), iv, len)) | 252 | if (memcpy_fromiovec(skb_put(skb, len), iv, len)) { |
| 253 | tun->stats.rx_dropped++; | ||
| 254 | kfree_skb(skb); | ||
| 253 | return -EFAULT; | 255 | return -EFAULT; |
| 256 | } | ||
| 254 | 257 | ||
| 255 | skb->dev = tun->dev; | 258 | skb->dev = tun->dev; |
| 256 | switch (tun->flags & TUN_TYPE_MASK) { | 259 | switch (tun->flags & TUN_TYPE_MASK) { |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 54ad93daca3c..bb96ce1db08c 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
| @@ -411,7 +411,7 @@ static int pcmcia_device_probe(struct device * dev) | |||
| 411 | * pseudo devices, and if not, add the second one. | 411 | * pseudo devices, and if not, add the second one. |
| 412 | */ | 412 | */ |
| 413 | did = (struct pcmcia_device_id *) p_dev->dev.driver_data; | 413 | did = (struct pcmcia_device_id *) p_dev->dev.driver_data; |
| 414 | if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && | 414 | if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && |
| 415 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) | 415 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) |
| 416 | pcmcia_add_pseudo_device(p_dev->socket); | 416 | pcmcia_add_pseudo_device(p_dev->socket); |
| 417 | 417 | ||
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index af1d5b404cee..33157c84d1d3 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
| @@ -215,9 +215,10 @@ dasd_state_basic_to_known(struct dasd_device * device) | |||
| 215 | * interrupt for this detection ccw uses the kernel event daemon to | 215 | * interrupt for this detection ccw uses the kernel event daemon to |
| 216 | * trigger the call to dasd_change_state. All this is done in the | 216 | * trigger the call to dasd_change_state. All this is done in the |
| 217 | * discipline code, see dasd_eckd.c. | 217 | * discipline code, see dasd_eckd.c. |
| 218 | * After the analysis ccw is done (do_analysis returned 0 or error) | 218 | * After the analysis ccw is done (do_analysis returned 0) the block |
| 219 | * the block device is setup. Either a fake disk is added to allow | 219 | * device is setup. |
| 220 | * formatting or a proper device request queue is created. | 220 | * In case the analysis returns an error, the device setup is stopped |
| 221 | * (a fake disk was already added to allow formatting). | ||
| 221 | */ | 222 | */ |
| 222 | static inline int | 223 | static inline int |
| 223 | dasd_state_basic_to_ready(struct dasd_device * device) | 224 | dasd_state_basic_to_ready(struct dasd_device * device) |
| @@ -227,13 +228,19 @@ dasd_state_basic_to_ready(struct dasd_device * device) | |||
| 227 | rc = 0; | 228 | rc = 0; |
| 228 | if (device->discipline->do_analysis != NULL) | 229 | if (device->discipline->do_analysis != NULL) |
| 229 | rc = device->discipline->do_analysis(device); | 230 | rc = device->discipline->do_analysis(device); |
| 230 | if (rc) | 231 | if (rc) { |
| 232 | if (rc != -EAGAIN) | ||
| 233 | device->state = DASD_STATE_UNFMT; | ||
| 231 | return rc; | 234 | return rc; |
| 235 | } | ||
| 236 | /* make disk known with correct capacity */ | ||
| 232 | dasd_setup_queue(device); | 237 | dasd_setup_queue(device); |
| 238 | set_capacity(device->gdp, device->blocks << device->s2b_shift); | ||
| 233 | device->state = DASD_STATE_READY; | 239 | device->state = DASD_STATE_READY; |
| 234 | if (dasd_scan_partitions(device) != 0) | 240 | rc = dasd_scan_partitions(device); |
| 241 | if (rc) | ||
| 235 | device->state = DASD_STATE_BASIC; | 242 | device->state = DASD_STATE_BASIC; |
| 236 | return 0; | 243 | return rc; |
| 237 | } | 244 | } |
| 238 | 245 | ||
| 239 | /* | 246 | /* |
| @@ -254,6 +261,15 @@ dasd_state_ready_to_basic(struct dasd_device * device) | |||
| 254 | } | 261 | } |
| 255 | 262 | ||
| 256 | /* | 263 | /* |
| 264 | * Back to basic. | ||
| 265 | */ | ||
| 266 | static inline void | ||
| 267 | dasd_state_unfmt_to_basic(struct dasd_device * device) | ||
| 268 | { | ||
| 269 | device->state = DASD_STATE_BASIC; | ||
| 270 | } | ||
| 271 | |||
| 272 | /* | ||
| 257 | * Make the device online and schedule the bottom half to start | 273 | * Make the device online and schedule the bottom half to start |
| 258 | * the requeueing of requests from the linux request queue to the | 274 | * the requeueing of requests from the linux request queue to the |
| 259 | * ccw queue. | 275 | * ccw queue. |
| @@ -319,8 +335,12 @@ dasd_decrease_state(struct dasd_device *device) | |||
| 319 | if (device->state == DASD_STATE_READY && | 335 | if (device->state == DASD_STATE_READY && |
| 320 | device->target <= DASD_STATE_BASIC) | 336 | device->target <= DASD_STATE_BASIC) |
| 321 | dasd_state_ready_to_basic(device); | 337 | dasd_state_ready_to_basic(device); |
| 322 | 338 | ||
| 323 | if (device->state == DASD_STATE_BASIC && | 339 | if (device->state == DASD_STATE_UNFMT && |
| 340 | device->target <= DASD_STATE_BASIC) | ||
| 341 | dasd_state_unfmt_to_basic(device); | ||
| 342 | |||
| 343 | if (device->state == DASD_STATE_BASIC && | ||
| 324 | device->target <= DASD_STATE_KNOWN) | 344 | device->target <= DASD_STATE_KNOWN) |
| 325 | dasd_state_basic_to_known(device); | 345 | dasd_state_basic_to_known(device); |
| 326 | 346 | ||
| @@ -1722,7 +1742,7 @@ dasd_open(struct inode *inp, struct file *filp) | |||
| 1722 | goto out; | 1742 | goto out; |
| 1723 | } | 1743 | } |
| 1724 | 1744 | ||
| 1725 | if (device->state < DASD_STATE_BASIC) { | 1745 | if (device->state <= DASD_STATE_BASIC) { |
| 1726 | DBF_DEV_EVENT(DBF_ERR, device, " %s", | 1746 | DBF_DEV_EVENT(DBF_ERR, device, " %s", |
| 1727 | " Cannot open unrecognized device"); | 1747 | " Cannot open unrecognized device"); |
| 1728 | rc = -ENODEV; | 1748 | rc = -ENODEV; |
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 65dc844b975c..fce2835e7d19 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c | |||
| @@ -100,8 +100,6 @@ dasd_scan_partitions(struct dasd_device * device) | |||
| 100 | { | 100 | { |
| 101 | struct block_device *bdev; | 101 | struct block_device *bdev; |
| 102 | 102 | ||
| 103 | /* Make the disk known. */ | ||
| 104 | set_capacity(device->gdp, device->blocks << device->s2b_shift); | ||
| 105 | bdev = bdget_disk(device->gdp, 0); | 103 | bdev = bdget_disk(device->gdp, 0); |
| 106 | if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0) | 104 | if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0) |
| 107 | return -ENODEV; | 105 | return -ENODEV; |
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index 0592354cc604..7cb0b9e78a6a 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | * new: the dasd_device structure is allocated. | 26 | * new: the dasd_device structure is allocated. |
| 27 | * known: the discipline for the device is identified. | 27 | * known: the discipline for the device is identified. |
| 28 | * basic: the device can do basic i/o. | 28 | * basic: the device can do basic i/o. |
| 29 | * accept: the device is analysed (format is known). | 29 | * unfmt: the device could not be analyzed (format is unknown). |
| 30 | * ready: partition detection is done and the device is can do block io. | 30 | * ready: partition detection is done and the device is can do block io. |
| 31 | * online: the device accepts requests from the block device queue. | 31 | * online: the device accepts requests from the block device queue. |
| 32 | * | 32 | * |
| @@ -47,8 +47,9 @@ | |||
| 47 | #define DASD_STATE_NEW 0 | 47 | #define DASD_STATE_NEW 0 |
| 48 | #define DASD_STATE_KNOWN 1 | 48 | #define DASD_STATE_KNOWN 1 |
| 49 | #define DASD_STATE_BASIC 2 | 49 | #define DASD_STATE_BASIC 2 |
| 50 | #define DASD_STATE_READY 3 | 50 | #define DASD_STATE_UNFMT 3 |
| 51 | #define DASD_STATE_ONLINE 4 | 51 | #define DASD_STATE_READY 4 |
| 52 | #define DASD_STATE_ONLINE 5 | ||
| 52 | 53 | ||
| 53 | #include <linux/module.h> | 54 | #include <linux/module.h> |
| 54 | #include <linux/wait.h> | 55 | #include <linux/wait.h> |
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 2d5da3c75ca7..1aa3c261718a 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c | |||
| @@ -93,6 +93,9 @@ dasd_devices_show(struct seq_file *m, void *v) | |||
| 93 | case DASD_STATE_BASIC: | 93 | case DASD_STATE_BASIC: |
| 94 | seq_printf(m, "basic"); | 94 | seq_printf(m, "basic"); |
| 95 | break; | 95 | break; |
| 96 | case DASD_STATE_UNFMT: | ||
| 97 | seq_printf(m, "unformatted"); | ||
| 98 | break; | ||
| 96 | case DASD_STATE_READY: | 99 | case DASD_STATE_READY: |
| 97 | case DASD_STATE_ONLINE: | 100 | case DASD_STATE_ONLINE: |
| 98 | seq_printf(m, "active "); | 101 | seq_printf(m, "active "); |
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index d6469baa7e16..72118ee68954 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c | |||
| @@ -168,7 +168,7 @@ smsg_init(void) | |||
| 168 | driver_unregister(&smsg_driver); | 168 | driver_unregister(&smsg_driver); |
| 169 | return -EIO; /* better errno ? */ | 169 | return -EIO; /* better errno ? */ |
| 170 | } | 170 | } |
| 171 | rc = iucv_connect (&smsg_pathid, 1, 0, "*MSG ", 0, 0, 0, 0, | 171 | rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG ", 0, 0, 0, 0, |
| 172 | smsg_handle, 0); | 172 | smsg_handle, 0); |
| 173 | if (rc) { | 173 | if (rc) { |
| 174 | printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG"); | 174 | printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG"); |
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index f3763d2ccb86..a37579ce6d76 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c | |||
| @@ -2301,7 +2301,6 @@ static void receive_chars(struct uart_port *the_port) | |||
| 2301 | int read_count, request_count = IOC4_MAX_CHARS; | 2301 | int read_count, request_count = IOC4_MAX_CHARS; |
| 2302 | struct uart_icount *icount; | 2302 | struct uart_icount *icount; |
| 2303 | struct uart_info *info = the_port->info; | 2303 | struct uart_info *info = the_port->info; |
| 2304 | int flip = 0; | ||
| 2305 | unsigned long pflags; | 2304 | unsigned long pflags; |
| 2306 | 2305 | ||
| 2307 | /* Make sure all the pointers are "good" ones */ | 2306 | /* Make sure all the pointers are "good" ones */ |
| @@ -2313,7 +2312,7 @@ static void receive_chars(struct uart_port *the_port) | |||
| 2313 | spin_lock_irqsave(&the_port->lock, pflags); | 2312 | spin_lock_irqsave(&the_port->lock, pflags); |
| 2314 | tty = info->tty; | 2313 | tty = info->tty; |
| 2315 | 2314 | ||
| 2316 | request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS - 2); | 2315 | request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS); |
| 2317 | 2316 | ||
| 2318 | if (request_count > 0) { | 2317 | if (request_count > 0) { |
| 2319 | icount = &the_port->icount; | 2318 | icount = &the_port->icount; |
| @@ -2326,8 +2325,7 @@ static void receive_chars(struct uart_port *the_port) | |||
| 2326 | 2325 | ||
| 2327 | spin_unlock_irqrestore(&the_port->lock, pflags); | 2326 | spin_unlock_irqrestore(&the_port->lock, pflags); |
| 2328 | 2327 | ||
| 2329 | if (flip) | 2328 | tty_flip_buffer_push(tty); |
| 2330 | tty_flip_buffer_push(tty); | ||
| 2331 | } | 2329 | } |
| 2332 | 2330 | ||
| 2333 | /** | 2331 | /** |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 95fb4939c675..cc1faa31d124 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
| @@ -71,6 +71,11 @@ static void uart_change_pm(struct uart_state *state, int pm_state); | |||
| 71 | void uart_write_wakeup(struct uart_port *port) | 71 | void uart_write_wakeup(struct uart_port *port) |
| 72 | { | 72 | { |
| 73 | struct uart_info *info = port->info; | 73 | struct uart_info *info = port->info; |
| 74 | /* | ||
| 75 | * This means you called this function _after_ the port was | ||
| 76 | * closed. No cookie for you. | ||
| 77 | */ | ||
| 78 | BUG_ON(!info); | ||
| 74 | tasklet_schedule(&info->tlet); | 79 | tasklet_schedule(&info->tlet); |
| 75 | } | 80 | } |
| 76 | 81 | ||
| @@ -471,14 +476,26 @@ static void uart_flush_chars(struct tty_struct *tty) | |||
| 471 | } | 476 | } |
| 472 | 477 | ||
| 473 | static int | 478 | static int |
| 474 | uart_write(struct tty_struct *tty, const unsigned char * buf, int count) | 479 | uart_write(struct tty_struct *tty, const unsigned char *buf, int count) |
| 475 | { | 480 | { |
| 476 | struct uart_state *state = tty->driver_data; | 481 | struct uart_state *state = tty->driver_data; |
| 477 | struct uart_port *port = state->port; | 482 | struct uart_port *port; |
| 478 | struct circ_buf *circ = &state->info->xmit; | 483 | struct circ_buf *circ; |
| 479 | unsigned long flags; | 484 | unsigned long flags; |
| 480 | int c, ret = 0; | 485 | int c, ret = 0; |
| 481 | 486 | ||
| 487 | /* | ||
| 488 | * This means you called this function _after_ the port was | ||
| 489 | * closed. No cookie for you. | ||
| 490 | */ | ||
| 491 | if (!state || !state->info) { | ||
| 492 | WARN_ON(1); | ||
| 493 | return -EL3HLT; | ||
| 494 | } | ||
| 495 | |||
| 496 | port = state->port; | ||
| 497 | circ = &state->info->xmit; | ||
| 498 | |||
| 482 | if (!circ->buf) | 499 | if (!circ->buf) |
| 483 | return 0; | 500 | return 0; |
| 484 | 501 | ||
| @@ -521,6 +538,15 @@ static void uart_flush_buffer(struct tty_struct *tty) | |||
| 521 | struct uart_port *port = state->port; | 538 | struct uart_port *port = state->port; |
| 522 | unsigned long flags; | 539 | unsigned long flags; |
| 523 | 540 | ||
| 541 | /* | ||
| 542 | * This means you called this function _after_ the port was | ||
| 543 | * closed. No cookie for you. | ||
| 544 | */ | ||
| 545 | if (!state || !state->info) { | ||
| 546 | WARN_ON(1); | ||
| 547 | return; | ||
| 548 | } | ||
| 549 | |||
| 524 | DPRINTK("uart_flush_buffer(%d) called\n", tty->index); | 550 | DPRINTK("uart_flush_buffer(%d) called\n", tty->index); |
| 525 | 551 | ||
| 526 | spin_lock_irqsave(&port->lock, flags); | 552 | spin_lock_irqsave(&port->lock, flags); |
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 43e67d6c29d4..60ea4a3f0713 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c | |||
| @@ -820,7 +820,7 @@ static int __init sn_sal_module_init(void) | |||
| 820 | int retval; | 820 | int retval; |
| 821 | 821 | ||
| 822 | if (!ia64_platform_is("sn2")) | 822 | if (!ia64_platform_is("sn2")) |
| 823 | return -ENODEV; | 823 | return 0; |
| 824 | 824 | ||
| 825 | printk(KERN_INFO "sn_console: Console driver init\n"); | 825 | printk(KERN_INFO "sn_console: Console driver init\n"); |
| 826 | 826 | ||
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c index df8e5667b348..466042808daf 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c | |||
| @@ -253,7 +253,7 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper, | |||
| 253 | { | 253 | { |
| 254 | unsigned char *src; | 254 | unsigned char *src; |
| 255 | unsigned int xindex, yindex, chipindex, linesize; | 255 | unsigned int xindex, yindex, chipindex, linesize; |
| 256 | int i, count; | 256 | int i; |
| 257 | unsigned char val; | 257 | unsigned char val; |
| 258 | unsigned char bitmask, rightshift; | 258 | unsigned char bitmask, rightshift; |
| 259 | 259 | ||
| @@ -282,7 +282,6 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper, | |||
| 282 | } | 282 | } |
| 283 | ks108_writeb_data(par, chipindex, val); | 283 | ks108_writeb_data(par, chipindex, val); |
| 284 | left++; | 284 | left++; |
| 285 | count++; | ||
| 286 | if (bitmask == 0x80) { | 285 | if (bitmask == 0x80) { |
| 287 | bitmask = 1; | 286 | bitmask = 1; |
| 288 | src++; | 287 | src++; |
| @@ -460,11 +459,11 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou | |||
| 460 | inode = file->f_dentry->d_inode; | 459 | inode = file->f_dentry->d_inode; |
| 461 | fbidx = iminor(inode); | 460 | fbidx = iminor(inode); |
| 462 | info = registered_fb[fbidx]; | 461 | info = registered_fb[fbidx]; |
| 463 | par = info->par; | ||
| 464 | 462 | ||
| 465 | if (!info || !info->screen_base) | 463 | if (!info || !info->screen_base) |
| 466 | return -ENODEV; | 464 | return -ENODEV; |
| 467 | 465 | ||
| 466 | par = info->par; | ||
| 468 | xres = info->var.xres; | 467 | xres = info->var.xres; |
| 469 | fbmemlength = (xres * info->var.yres)/8; | 468 | fbmemlength = (xres * info->var.yres)/8; |
| 470 | 469 | ||
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index bfc8a93b2c73..620c9a934e0e 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
| @@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, | |||
| 1326 | unsigned char post_dividers[] = {1,2,4,8,3,6,12}; | 1326 | unsigned char post_dividers[] = {1,2,4,8,3,6,12}; |
| 1327 | u32 output_freq; | 1327 | u32 output_freq; |
| 1328 | u32 vclk; /* in .01 MHz */ | 1328 | u32 vclk; /* in .01 MHz */ |
| 1329 | int i; | 1329 | int i = 0; |
| 1330 | u32 n, d; | 1330 | u32 n, d; |
| 1331 | 1331 | ||
| 1332 | vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ | 1332 | vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ |
| @@ -1340,15 +1340,16 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, | |||
| 1340 | /* now, find an acceptable divider */ | 1340 | /* now, find an acceptable divider */ |
| 1341 | for (i = 0; i < sizeof(post_dividers); i++) { | 1341 | for (i = 0; i < sizeof(post_dividers); i++) { |
| 1342 | output_freq = post_dividers[i] * vclk; | 1342 | output_freq = post_dividers[i] * vclk; |
| 1343 | if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) | 1343 | if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) { |
| 1344 | pll->post_divider = post_dividers[i]; | ||
| 1344 | break; | 1345 | break; |
| 1346 | } | ||
| 1345 | } | 1347 | } |
| 1346 | 1348 | ||
| 1347 | /* calculate feedback divider */ | 1349 | /* calculate feedback divider */ |
| 1348 | n = c.ref_divider * output_freq; | 1350 | n = c.ref_divider * output_freq; |
| 1349 | d = c.ref_clk; | 1351 | d = c.ref_clk; |
| 1350 | 1352 | ||
| 1351 | pll->post_divider = post_dividers[i]; | ||
| 1352 | pll->feedback_divider = round_div(n, d); | 1353 | pll->feedback_divider = round_div(n, d); |
| 1353 | pll->vclk = vclk; | 1354 | pll->vclk = vclk; |
| 1354 | 1355 | ||
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c index 7f9838dceab5..98c05bc0de44 100644 --- a/drivers/video/aty/radeon_monitor.c +++ b/drivers/video/aty/radeon_monitor.c | |||
| @@ -396,6 +396,10 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo, | |||
| 396 | s1[i] = *s; | 396 | s1[i] = *s; |
| 397 | i++; | 397 | i++; |
| 398 | } | 398 | } |
| 399 | |||
| 400 | if (i > 4) | ||
| 401 | i = 4; | ||
| 402 | |||
| 399 | } while (*s++); | 403 | } while (*s++); |
| 400 | if (second) | 404 | if (second) |
| 401 | s2[i] = 0; | 405 | s2[i] = 0; |
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index bd39bbd88d41..151fda8dded0 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
| @@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda | |||
| 172 | 172 | ||
| 173 | new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL); | 173 | new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL); |
| 174 | if (unlikely(!new_bd)) | 174 | if (unlikely(!new_bd)) |
| 175 | return ERR_PTR(ENOMEM); | 175 | return ERR_PTR(-ENOMEM); |
| 176 | 176 | ||
| 177 | init_MUTEX(&new_bd->sem); | 177 | init_MUTEX(&new_bd->sem); |
| 178 | new_bd->props = bp; | 178 | new_bd->props = bp; |
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 9e32485ee7bb..86908a60c630 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
| @@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata, | |||
| 171 | 171 | ||
| 172 | new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL); | 172 | new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL); |
| 173 | if (unlikely(!new_ld)) | 173 | if (unlikely(!new_ld)) |
| 174 | return ERR_PTR(ENOMEM); | 174 | return ERR_PTR(-ENOMEM); |
| 175 | 175 | ||
| 176 | init_MUTEX(&new_ld->sem); | 176 | init_MUTEX(&new_ld->sem); |
| 177 | new_ld->props = lp; | 177 | new_ld->props = lp; |
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c index ad416ae47596..7db42542eb19 100644 --- a/drivers/video/imsttfb.c +++ b/drivers/video/imsttfb.c | |||
| @@ -1510,6 +1510,8 @@ imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 1510 | default: | 1510 | default: |
| 1511 | printk(KERN_INFO "imsttfb: Device 0x%x unknown, " | 1511 | printk(KERN_INFO "imsttfb: Device 0x%x unknown, " |
| 1512 | "contact maintainer.\n", pdev->device); | 1512 | "contact maintainer.\n", pdev->device); |
| 1513 | release_mem_region(addr, size); | ||
| 1514 | framebuffer_release(info); | ||
| 1513 | return -ENODEV; | 1515 | return -ENODEV; |
| 1514 | } | 1516 | } |
| 1515 | 1517 | ||
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 6b8bd3cdf9c0..995b47c165a7 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
| @@ -1333,33 +1333,35 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
| 1333 | if (regno > 255) | 1333 | if (regno > 255) |
| 1334 | return 1; | 1334 | return 1; |
| 1335 | 1335 | ||
| 1336 | switch (dinfo->depth) { | 1336 | if (dinfo->depth == 8) { |
| 1337 | case 8: | 1337 | red >>= 8; |
| 1338 | { | 1338 | green >>= 8; |
| 1339 | red >>= 8; | 1339 | blue >>= 8; |
| 1340 | green >>= 8; | 1340 | |
| 1341 | blue >>= 8; | 1341 | intelfbhw_setcolreg(dinfo, regno, red, green, blue, |
| 1342 | transp); | ||
| 1343 | } | ||
| 1342 | 1344 | ||
| 1343 | intelfbhw_setcolreg(dinfo, regno, red, green, blue, | 1345 | if (regno < 16) { |
| 1344 | transp); | 1346 | switch (dinfo->depth) { |
| 1347 | case 15: | ||
| 1348 | dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) | | ||
| 1349 | ((green & 0xf800) >> 6) | | ||
| 1350 | ((blue & 0xf800) >> 11); | ||
| 1351 | break; | ||
| 1352 | case 16: | ||
| 1353 | dinfo->pseudo_palette[regno] = (red & 0xf800) | | ||
| 1354 | ((green & 0xfc00) >> 5) | | ||
| 1355 | ((blue & 0xf800) >> 11); | ||
| 1356 | break; | ||
| 1357 | case 24: | ||
| 1358 | dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) | | ||
| 1359 | (green & 0xff00) | | ||
| 1360 | ((blue & 0xff00) >> 8); | ||
| 1361 | break; | ||
| 1345 | } | 1362 | } |
| 1346 | break; | ||
| 1347 | case 15: | ||
| 1348 | dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) | | ||
| 1349 | ((green & 0xf800) >> 6) | | ||
| 1350 | ((blue & 0xf800) >> 11); | ||
| 1351 | break; | ||
| 1352 | case 16: | ||
| 1353 | dinfo->pseudo_palette[regno] = (red & 0xf800) | | ||
| 1354 | ((green & 0xfc00) >> 5) | | ||
| 1355 | ((blue & 0xf800) >> 11); | ||
| 1356 | break; | ||
| 1357 | case 24: | ||
| 1358 | dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) | | ||
| 1359 | (green & 0xff00) | | ||
| 1360 | ((blue & 0xff00) >> 8); | ||
| 1361 | break; | ||
| 1362 | } | 1363 | } |
| 1364 | |||
| 1363 | return 0; | 1365 | return 0; |
| 1364 | } | 1366 | } |
| 1365 | 1367 | ||
diff --git a/drivers/video/kyro/STG4000VTG.c b/drivers/video/kyro/STG4000VTG.c index 3690b04190af..bd389709d234 100644 --- a/drivers/video/kyro/STG4000VTG.c +++ b/drivers/video/kyro/STG4000VTG.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | void DisableVGA(volatile STG4000REG __iomem *pSTGReg) | 17 | void DisableVGA(volatile STG4000REG __iomem *pSTGReg) |
| 18 | { | 18 | { |
| 19 | u32 tmp; | 19 | u32 tmp; |
| 20 | volatile u32 count, i; | 20 | volatile u32 count = 0, i; |
| 21 | 21 | ||
| 22 | /* Reset the VGA registers */ | 22 | /* Reset the VGA registers */ |
| 23 | tmp = STG_READ_REG(SoftwareReset); | 23 | tmp = STG_READ_REG(SoftwareReset); |
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index a2e201dc40f7..b961d5601bd9 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c | |||
| @@ -486,10 +486,8 @@ static void vgaHWRestore(const struct fb_info *info, | |||
| 486 | static inline int neo2200_sync(struct fb_info *info) | 486 | static inline int neo2200_sync(struct fb_info *info) |
| 487 | { | 487 | { |
| 488 | struct neofb_par *par = info->par; | 488 | struct neofb_par *par = info->par; |
| 489 | int waitcycles; | ||
| 490 | 489 | ||
| 491 | while (readl(&par->neo2200->bltStat) & 1) | 490 | while (readl(&par->neo2200->bltStat) & 1); |
| 492 | waitcycles++; | ||
| 493 | return 0; | 491 | return 0; |
| 494 | } | 492 | } |
| 495 | 493 | ||
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c index e5d0f92eeae3..feec47bdd479 100644 --- a/drivers/video/s1d13xxxfb.c +++ b/drivers/video/s1d13xxxfb.c | |||
| @@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device *pdev) | |||
| 588 | goto bail; | 588 | goto bail; |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | platform_set_drvdata(pdev, info); | ||
| 591 | default_par = info->par; | 592 | default_par = info->par; |
| 592 | default_par->regs = ioremap_nocache(pdev->resource[1].start, | 593 | default_par->regs = ioremap_nocache(pdev->resource[1].start, |
| 593 | pdev->resource[1].end - pdev->resource[1].start +1); | 594 | pdev->resource[1].end - pdev->resource[1].start +1); |
| @@ -638,8 +639,6 @@ s1d13xxxfb_probe(struct platform_device *pdev) | |||
| 638 | goto bail; | 639 | goto bail; |
| 639 | } | 640 | } |
| 640 | 641 | ||
| 641 | platform_set_drvdata(pdev, info); | ||
| 642 | |||
| 643 | printk(KERN_INFO "fb%d: %s frame buffer device\n", | 642 | printk(KERN_INFO "fb%d: %s frame buffer device\n", |
| 644 | info->node, info->fix.id); | 643 | info->node, info->fix.id); |
| 645 | 644 | ||
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index ab727eaa7f43..10e6b3aab9ea 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
| @@ -2021,8 +2021,8 @@ static int __devinit savagefb_probe (struct pci_dev* dev, | |||
| 2021 | #if defined(CONFIG_FB_SAVAGE_I2C) | 2021 | #if defined(CONFIG_FB_SAVAGE_I2C) |
| 2022 | savagefb_create_i2c_busses(info); | 2022 | savagefb_create_i2c_busses(info); |
| 2023 | savagefb_probe_i2c_connector(info, &par->edid); | 2023 | savagefb_probe_i2c_connector(info, &par->edid); |
| 2024 | kfree(par->edid); | ||
| 2025 | fb_edid_to_monspecs(par->edid, &info->monspecs); | 2024 | fb_edid_to_monspecs(par->edid, &info->monspecs); |
| 2025 | kfree(par->edid); | ||
| 2026 | fb_videomode_to_modelist(info->monspecs.modedb, | 2026 | fb_videomode_to_modelist(info->monspecs.modedb, |
| 2027 | info->monspecs.modedb_len, | 2027 | info->monspecs.modedb_len, |
| 2028 | &info->modelist); | 2028 | &info->modelist); |
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 3e7baf4c9fa8..5e5328d682db 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c | |||
| @@ -786,28 +786,32 @@ static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
| 786 | if (regno >= info->cmap.len || regno > 255) return 1; | 786 | if (regno >= info->cmap.len || regno > 255) return 1; |
| 787 | 787 | ||
| 788 | switch (info->fix.visual) { | 788 | switch (info->fix.visual) { |
| 789 | case FB_VISUAL_PSEUDOCOLOR: | 789 | case FB_VISUAL_PSEUDOCOLOR: |
| 790 | rgbcol =(((u32)red & 0xff00) << 8) | | 790 | rgbcol =(((u32)red & 0xff00) << 8) | |
| 791 | (((u32)green & 0xff00) << 0) | | 791 | (((u32)green & 0xff00) << 0) | |
| 792 | (((u32)blue & 0xff00) >> 8); | 792 | (((u32)blue & 0xff00) >> 8); |
| 793 | do_setpalentry(par, regno, rgbcol); | 793 | do_setpalentry(par, regno, rgbcol); |
| 794 | break; | 794 | break; |
| 795 | /* Truecolor has no hardware color palettes. */ | 795 | /* Truecolor has no hardware color palettes. */ |
| 796 | case FB_VISUAL_TRUECOLOR: | 796 | case FB_VISUAL_TRUECOLOR: |
| 797 | if (regno < 16) { | ||
| 797 | rgbcol = (CNVT_TOHW( red, info->var.red.length) << | 798 | rgbcol = (CNVT_TOHW( red, info->var.red.length) << |
| 798 | info->var.red.offset) | | 799 | info->var.red.offset) | |
| 799 | (CNVT_TOHW( green, info->var.green.length) << | 800 | (CNVT_TOHW( green, info->var.green.length) << |
| 800 | info->var.green.offset) | | 801 | info->var.green.offset) | |
| 801 | (CNVT_TOHW( blue, info->var.blue.length) << | 802 | (CNVT_TOHW( blue, info->var.blue.length) << |
| 802 | info->var.blue.offset) | | 803 | info->var.blue.offset) | |
| 803 | (CNVT_TOHW( transp, info->var.transp.length) << | 804 | (CNVT_TOHW( transp, info->var.transp.length) << |
| 804 | info->var.transp.offset); | 805 | info->var.transp.offset); |
| 805 | par->palette[regno] = rgbcol; | 806 | par->palette[regno] = rgbcol; |
| 806 | break; | 807 | } |
| 807 | default: | 808 | |
| 808 | DPRINTK("bad depth %u\n", info->var.bits_per_pixel); | 809 | break; |
| 809 | break; | 810 | default: |
| 811 | DPRINTK("bad depth %u\n", info->var.bits_per_pixel); | ||
| 812 | break; | ||
| 810 | } | 813 | } |
| 814 | |||
| 811 | return 0; | 815 | return 0; |
| 812 | } | 816 | } |
| 813 | 817 | ||
diff --git a/fs/9p/9p.c b/fs/9p/9p.c index 1a6d08761f39..f86a28d1d6a6 100644 --- a/fs/9p/9p.c +++ b/fs/9p/9p.c | |||
| @@ -111,7 +111,6 @@ static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc, | |||
| 111 | if (!rc) | 111 | if (!rc) |
| 112 | return; | 112 | return; |
| 113 | 113 | ||
| 114 | dprintk(DEBUG_9P, "tcall id %d rcall id %d\n", tc->id, rc->id); | ||
| 115 | v9ses = a; | 114 | v9ses = a; |
| 116 | if (rc->id == RCLUNK) | 115 | if (rc->id == RCLUNK) |
| 117 | v9fs_put_idpool(fid, &v9ses->fidpool); | 116 | v9fs_put_idpool(fid, &v9ses->fidpool); |
diff --git a/fs/9p/trans_fd.c b/fs/9p/trans_fd.c index 1a28ef97a3d1..5b2ce21b10fa 100644 --- a/fs/9p/trans_fd.c +++ b/fs/9p/trans_fd.c | |||
| @@ -80,6 +80,7 @@ static int v9fs_fd_send(struct v9fs_transport *trans, void *v, int len) | |||
| 80 | if (!trans || trans->status != Connected || !ts) | 80 | if (!trans || trans->status != Connected || !ts) |
| 81 | return -EIO; | 81 | return -EIO; |
| 82 | 82 | ||
| 83 | oldfs = get_fs(); | ||
| 83 | set_fs(get_ds()); | 84 | set_fs(get_ds()); |
| 84 | /* The cast to a user pointer is valid due to the set_fs() */ | 85 | /* The cast to a user pointer is valid due to the set_fs() */ |
| 85 | ret = vfs_write(ts->out_file, (void __user *)v, len, &ts->out_file->f_pos); | 86 | ret = vfs_write(ts->out_file, (void __user *)v, len, &ts->out_file->f_pos); |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index dce729d42869..3ad8455f8577 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
| @@ -265,8 +265,7 @@ v9fs_create(struct v9fs_session_info *v9ses, u32 pfid, char *name, | |||
| 265 | fid = v9fs_get_idpool(&v9ses->fidpool); | 265 | fid = v9fs_get_idpool(&v9ses->fidpool); |
| 266 | if (fid < 0) { | 266 | if (fid < 0) { |
| 267 | eprintk(KERN_WARNING, "no free fids available\n"); | 267 | eprintk(KERN_WARNING, "no free fids available\n"); |
| 268 | err = -ENOSPC; | 268 | return -ENOSPC; |
| 269 | goto error; | ||
| 270 | } | 269 | } |
| 271 | 270 | ||
| 272 | err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall); | 271 | err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall); |
| @@ -313,8 +312,7 @@ v9fs_clone_walk(struct v9fs_session_info *v9ses, u32 fid, struct dentry *dentry) | |||
| 313 | nfid = v9fs_get_idpool(&v9ses->fidpool); | 312 | nfid = v9fs_get_idpool(&v9ses->fidpool); |
| 314 | if (nfid < 0) { | 313 | if (nfid < 0) { |
| 315 | eprintk(KERN_WARNING, "no free fids available\n"); | 314 | eprintk(KERN_WARNING, "no free fids available\n"); |
| 316 | err = -ENOSPC; | 315 | return ERR_PTR(-ENOSPC); |
| 317 | goto error; | ||
| 318 | } | 316 | } |
| 319 | 317 | ||
| 320 | err = v9fs_t_walk(v9ses, fid, nfid, (char *) dentry->d_name.name, | 318 | err = v9fs_t_walk(v9ses, fid, nfid, (char *) dentry->d_name.name, |
| @@ -612,7 +610,7 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, | |||
| 612 | int result = 0; | 610 | int result = 0; |
| 613 | 611 | ||
| 614 | dprintk(DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n", | 612 | dprintk(DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n", |
| 615 | dir, dentry->d_iname, dentry, nameidata); | 613 | dir, dentry->d_name.name, dentry, nameidata); |
| 616 | 614 | ||
| 617 | sb = dir->i_sb; | 615 | sb = dir->i_sb; |
| 618 | v9ses = v9fs_inode2v9ses(dir); | 616 | v9ses = v9fs_inode2v9ses(dir); |
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index cdf787ee08de..d05318fa684e 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
| @@ -156,7 +156,6 @@ static struct super_block *v9fs_get_sb(struct file_system_type | |||
| 156 | stat_result = v9fs_t_stat(v9ses, newfid, &fcall); | 156 | stat_result = v9fs_t_stat(v9ses, newfid, &fcall); |
| 157 | if (stat_result < 0) { | 157 | if (stat_result < 0) { |
| 158 | dprintk(DEBUG_ERROR, "stat error\n"); | 158 | dprintk(DEBUG_ERROR, "stat error\n"); |
| 159 | kfree(fcall); | ||
| 160 | v9fs_t_clunk(v9ses, newfid); | 159 | v9fs_t_clunk(v9ses, newfid); |
| 161 | } else { | 160 | } else { |
| 162 | /* Setup the Root Inode */ | 161 | /* Setup the Root Inode */ |
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 537ac70edfe5..c666769a875d 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
| @@ -446,7 +446,7 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg) | |||
| 446 | ifr = ifc.ifc_req; | 446 | ifr = ifc.ifc_req; |
| 447 | ifr32 = compat_ptr(ifc32.ifcbuf); | 447 | ifr32 = compat_ptr(ifc32.ifcbuf); |
| 448 | for (i = 0, j = 0; | 448 | for (i = 0, j = 0; |
| 449 | i + sizeof (struct ifreq32) < ifc32.ifc_len && j < ifc.ifc_len; | 449 | i + sizeof (struct ifreq32) <= ifc32.ifc_len && j < ifc.ifc_len; |
| 450 | i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) { | 450 | i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) { |
| 451 | if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32))) | 451 | if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32))) |
| 452 | return -EFAULT; | 452 | return -EFAULT; |
diff --git a/fs/dcache.c b/fs/dcache.c index a173bba32666..11dc83092d4a 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
| @@ -1736,7 +1736,7 @@ void __init vfs_caches_init(unsigned long mempages) | |||
| 1736 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); | 1736 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); |
| 1737 | 1737 | ||
| 1738 | filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, | 1738 | filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, |
| 1739 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, filp_ctor, filp_dtor); | 1739 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); |
| 1740 | 1740 | ||
| 1741 | dcache_init(mempages); | 1741 | dcache_init(mempages); |
| 1742 | inode_init(mempages); | 1742 | inode_init(mempages); |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 3fc4238e9703..0384e539b88f 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
| @@ -1624,15 +1624,14 @@ static int ext3_block_truncate_page(handle_t *handle, struct page *page, | |||
| 1624 | * For "nobh" option, we can only work if we don't need to | 1624 | * For "nobh" option, we can only work if we don't need to |
| 1625 | * read-in the page - otherwise we create buffers to do the IO. | 1625 | * read-in the page - otherwise we create buffers to do the IO. |
| 1626 | */ | 1626 | */ |
| 1627 | if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH)) { | 1627 | if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) && |
| 1628 | if (PageUptodate(page)) { | 1628 | ext3_should_writeback_data(inode) && PageUptodate(page)) { |
| 1629 | kaddr = kmap_atomic(page, KM_USER0); | 1629 | kaddr = kmap_atomic(page, KM_USER0); |
| 1630 | memset(kaddr + offset, 0, length); | 1630 | memset(kaddr + offset, 0, length); |
| 1631 | flush_dcache_page(page); | 1631 | flush_dcache_page(page); |
| 1632 | kunmap_atomic(kaddr, KM_USER0); | 1632 | kunmap_atomic(kaddr, KM_USER0); |
| 1633 | set_page_dirty(page); | 1633 | set_page_dirty(page); |
| 1634 | goto unlock; | 1634 | goto unlock; |
| 1635 | } | ||
| 1636 | } | 1635 | } |
| 1637 | 1636 | ||
| 1638 | if (!page_has_buffers(page)) | 1637 | if (!page_has_buffers(page)) |
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 8bd8ac077704..b8f5cd1e540d 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
| @@ -2141,7 +2141,8 @@ retry: | |||
| 2141 | * We have a transaction open. All is sweetness. It also sets | 2141 | * We have a transaction open. All is sweetness. It also sets |
| 2142 | * i_size in generic_commit_write(). | 2142 | * i_size in generic_commit_write(). |
| 2143 | */ | 2143 | */ |
| 2144 | err = page_symlink(inode, symname, l); | 2144 | err = __page_symlink(inode, symname, l, |
| 2145 | mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); | ||
| 2145 | if (err) { | 2146 | if (err) { |
| 2146 | ext3_dec_count(handle, inode); | 2147 | ext3_dec_count(handle, inode); |
| 2147 | ext3_mark_inode_dirty(handle, inode); | 2148 | ext3_mark_inode_dirty(handle, inode); |
diff --git a/fs/file_table.c b/fs/file_table.c index 768b58167543..44fabeaa9415 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) | 5 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/config.h> | ||
| 8 | #include <linux/string.h> | 9 | #include <linux/string.h> |
| 9 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
| 10 | #include <linux/file.h> | 11 | #include <linux/file.h> |
| @@ -19,52 +20,67 @@ | |||
| 19 | #include <linux/capability.h> | 20 | #include <linux/capability.h> |
| 20 | #include <linux/cdev.h> | 21 | #include <linux/cdev.h> |
| 21 | #include <linux/fsnotify.h> | 22 | #include <linux/fsnotify.h> |
| 23 | #include <linux/sysctl.h> | ||
| 24 | #include <linux/percpu_counter.h> | ||
| 25 | |||
| 26 | #include <asm/atomic.h> | ||
| 22 | 27 | ||
| 23 | /* sysctl tunables... */ | 28 | /* sysctl tunables... */ |
| 24 | struct files_stat_struct files_stat = { | 29 | struct files_stat_struct files_stat = { |
| 25 | .max_files = NR_FILE | 30 | .max_files = NR_FILE |
| 26 | }; | 31 | }; |
| 27 | 32 | ||
| 28 | EXPORT_SYMBOL(files_stat); /* Needed by unix.o */ | ||
| 29 | |||
| 30 | /* public. Not pretty! */ | 33 | /* public. Not pretty! */ |
| 31 | __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock); | 34 | __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock); |
| 32 | 35 | ||
| 33 | static DEFINE_SPINLOCK(filp_count_lock); | 36 | static struct percpu_counter nr_files __cacheline_aligned_in_smp; |
| 34 | 37 | ||
| 35 | /* slab constructors and destructors are called from arbitrary | 38 | static inline void file_free_rcu(struct rcu_head *head) |
| 36 | * context and must be fully threaded - use a local spinlock | ||
| 37 | * to protect files_stat.nr_files | ||
| 38 | */ | ||
| 39 | void filp_ctor(void *objp, struct kmem_cache *cachep, unsigned long cflags) | ||
| 40 | { | 39 | { |
| 41 | if ((cflags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == | 40 | struct file *f = container_of(head, struct file, f_u.fu_rcuhead); |
| 42 | SLAB_CTOR_CONSTRUCTOR) { | 41 | kmem_cache_free(filp_cachep, f); |
| 43 | unsigned long flags; | ||
| 44 | spin_lock_irqsave(&filp_count_lock, flags); | ||
| 45 | files_stat.nr_files++; | ||
| 46 | spin_unlock_irqrestore(&filp_count_lock, flags); | ||
| 47 | } | ||
| 48 | } | 42 | } |
| 49 | 43 | ||
| 50 | void filp_dtor(void *objp, struct kmem_cache *cachep, unsigned long dflags) | 44 | static inline void file_free(struct file *f) |
| 51 | { | 45 | { |
| 52 | unsigned long flags; | 46 | percpu_counter_dec(&nr_files); |
| 53 | spin_lock_irqsave(&filp_count_lock, flags); | 47 | call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); |
| 54 | files_stat.nr_files--; | ||
| 55 | spin_unlock_irqrestore(&filp_count_lock, flags); | ||
| 56 | } | 48 | } |
| 57 | 49 | ||
| 58 | static inline void file_free_rcu(struct rcu_head *head) | 50 | /* |
| 51 | * Return the total number of open files in the system | ||
| 52 | */ | ||
| 53 | static int get_nr_files(void) | ||
| 59 | { | 54 | { |
| 60 | struct file *f = container_of(head, struct file, f_u.fu_rcuhead); | 55 | return percpu_counter_read_positive(&nr_files); |
| 61 | kmem_cache_free(filp_cachep, f); | ||
| 62 | } | 56 | } |
| 63 | 57 | ||
| 64 | static inline void file_free(struct file *f) | 58 | /* |
| 59 | * Return the maximum number of open files in the system | ||
| 60 | */ | ||
| 61 | int get_max_files(void) | ||
| 65 | { | 62 | { |
| 66 | call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); | 63 | return files_stat.max_files; |
| 67 | } | 64 | } |
| 65 | EXPORT_SYMBOL_GPL(get_max_files); | ||
| 66 | |||
| 67 | /* | ||
| 68 | * Handle nr_files sysctl | ||
| 69 | */ | ||
| 70 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS) | ||
| 71 | int proc_nr_files(ctl_table *table, int write, struct file *filp, | ||
| 72 | void __user *buffer, size_t *lenp, loff_t *ppos) | ||
| 73 | { | ||
| 74 | files_stat.nr_files = get_nr_files(); | ||
| 75 | return proc_dointvec(table, write, filp, buffer, lenp, ppos); | ||
| 76 | } | ||
| 77 | #else | ||
| 78 | int proc_nr_files(ctl_table *table, int write, struct file *filp, | ||
| 79 | void __user *buffer, size_t *lenp, loff_t *ppos) | ||
| 80 | { | ||
| 81 | return -ENOSYS; | ||
| 82 | } | ||
| 83 | #endif | ||
| 68 | 84 | ||
| 69 | /* Find an unused file structure and return a pointer to it. | 85 | /* Find an unused file structure and return a pointer to it. |
| 70 | * Returns NULL, if there are no more free file structures or | 86 | * Returns NULL, if there are no more free file structures or |
| @@ -78,14 +94,20 @@ struct file *get_empty_filp(void) | |||
| 78 | /* | 94 | /* |
| 79 | * Privileged users can go above max_files | 95 | * Privileged users can go above max_files |
| 80 | */ | 96 | */ |
| 81 | if (files_stat.nr_files >= files_stat.max_files && | 97 | if (get_nr_files() >= files_stat.max_files && !capable(CAP_SYS_ADMIN)) { |
| 82 | !capable(CAP_SYS_ADMIN)) | 98 | /* |
| 83 | goto over; | 99 | * percpu_counters are inaccurate. Do an expensive check before |
| 100 | * we go and fail. | ||
| 101 | */ | ||
| 102 | if (percpu_counter_sum(&nr_files) >= files_stat.max_files) | ||
| 103 | goto over; | ||
| 104 | } | ||
| 84 | 105 | ||
| 85 | f = kmem_cache_alloc(filp_cachep, GFP_KERNEL); | 106 | f = kmem_cache_alloc(filp_cachep, GFP_KERNEL); |
| 86 | if (f == NULL) | 107 | if (f == NULL) |
| 87 | goto fail; | 108 | goto fail; |
| 88 | 109 | ||
| 110 | percpu_counter_inc(&nr_files); | ||
| 89 | memset(f, 0, sizeof(*f)); | 111 | memset(f, 0, sizeof(*f)); |
| 90 | if (security_file_alloc(f)) | 112 | if (security_file_alloc(f)) |
| 91 | goto fail_sec; | 113 | goto fail_sec; |
| @@ -101,10 +123,10 @@ struct file *get_empty_filp(void) | |||
| 101 | 123 | ||
| 102 | over: | 124 | over: |
| 103 | /* Ran out of filps - report that */ | 125 | /* Ran out of filps - report that */ |
| 104 | if (files_stat.nr_files > old_max) { | 126 | if (get_nr_files() > old_max) { |
| 105 | printk(KERN_INFO "VFS: file-max limit %d reached\n", | 127 | printk(KERN_INFO "VFS: file-max limit %d reached\n", |
| 106 | files_stat.max_files); | 128 | get_max_files()); |
| 107 | old_max = files_stat.nr_files; | 129 | old_max = get_nr_files(); |
| 108 | } | 130 | } |
| 109 | goto fail; | 131 | goto fail; |
| 110 | 132 | ||
| @@ -276,4 +298,5 @@ void __init files_init(unsigned long mempages) | |||
| 276 | if (files_stat.max_files < NR_FILE) | 298 | if (files_stat.max_files < NR_FILE) |
| 277 | files_stat.max_files = NR_FILE; | 299 | files_stat.max_files = NR_FILE; |
| 278 | files_defer_init(); | 300 | files_defer_init(); |
| 301 | percpu_counter_init(&nr_files); | ||
| 279 | } | 302 | } |
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index b635e167a3fa..d4d0c41490cd 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.c | |||
| @@ -406,7 +406,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info | |||
| 406 | int err = 0, pointed = 0; | 406 | int err = 0, pointed = 0; |
| 407 | struct jffs2_eraseblock *jeb; | 407 | struct jffs2_eraseblock *jeb; |
| 408 | unsigned char *buffer; | 408 | unsigned char *buffer; |
| 409 | uint32_t crc, ofs, retlen, len; | 409 | uint32_t crc, ofs, len; |
| 410 | size_t retlen; | ||
| 410 | 411 | ||
| 411 | BUG_ON(tn->csize == 0); | 412 | BUG_ON(tn->csize == 0); |
| 412 | 413 | ||
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 5f0652df5d47..f1695642d0f7 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
| @@ -112,7 +112,7 @@ static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_r | |||
| 112 | * negative error code on failure. | 112 | * negative error code on failure. |
| 113 | */ | 113 | */ |
| 114 | static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, | 114 | static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, |
| 115 | struct jffs2_raw_dirent *rd, uint32_t read, struct jffs2_full_dirent **fdp, | 115 | struct jffs2_raw_dirent *rd, size_t read, struct jffs2_full_dirent **fdp, |
| 116 | uint32_t *latest_mctime, uint32_t *mctime_ver) | 116 | uint32_t *latest_mctime, uint32_t *mctime_ver) |
| 117 | { | 117 | { |
| 118 | struct jffs2_full_dirent *fd; | 118 | struct jffs2_full_dirent *fd; |
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 3e51dd1da8aa..cf55b221fc2b 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c | |||
| @@ -233,7 +233,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) | |||
| 233 | c->nextblock->dirty_size = 0; | 233 | c->nextblock->dirty_size = 0; |
| 234 | } | 234 | } |
| 235 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER | 235 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
| 236 | if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) { | 236 | if (!jffs2_can_mark_obsolete(c) && c->wbuf_pagesize && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) { |
| 237 | /* If we're going to start writing into a block which already | 237 | /* If we're going to start writing into a block which already |
| 238 | contains data, and the end of the data isn't page-aligned, | 238 | contains data, and the end of the data isn't page-aligned, |
| 239 | skip a little and align it. */ | 239 | skip a little and align it. */ |
diff --git a/fs/namei.c b/fs/namei.c index 557dcf395ca1..8dc2b038d5d9 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
| @@ -2613,13 +2613,15 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) | |||
| 2613 | } | 2613 | } |
| 2614 | } | 2614 | } |
| 2615 | 2615 | ||
| 2616 | int page_symlink(struct inode *inode, const char *symname, int len) | 2616 | int __page_symlink(struct inode *inode, const char *symname, int len, |
| 2617 | gfp_t gfp_mask) | ||
| 2617 | { | 2618 | { |
| 2618 | struct address_space *mapping = inode->i_mapping; | 2619 | struct address_space *mapping = inode->i_mapping; |
| 2619 | struct page *page = grab_cache_page(mapping, 0); | 2620 | struct page *page; |
| 2620 | int err = -ENOMEM; | 2621 | int err = -ENOMEM; |
| 2621 | char *kaddr; | 2622 | char *kaddr; |
| 2622 | 2623 | ||
| 2624 | page = find_or_create_page(mapping, 0, gfp_mask); | ||
| 2623 | if (!page) | 2625 | if (!page) |
| 2624 | goto fail; | 2626 | goto fail; |
| 2625 | err = mapping->a_ops->prepare_write(NULL, page, 0, len-1); | 2627 | err = mapping->a_ops->prepare_write(NULL, page, 0, len-1); |
| @@ -2654,6 +2656,12 @@ fail: | |||
| 2654 | return err; | 2656 | return err; |
| 2655 | } | 2657 | } |
| 2656 | 2658 | ||
| 2659 | int page_symlink(struct inode *inode, const char *symname, int len) | ||
| 2660 | { | ||
| 2661 | return __page_symlink(inode, symname, len, | ||
| 2662 | mapping_gfp_mask(inode->i_mapping)); | ||
| 2663 | } | ||
| 2664 | |||
| 2657 | struct inode_operations page_symlink_inode_operations = { | 2665 | struct inode_operations page_symlink_inode_operations = { |
| 2658 | .readlink = generic_readlink, | 2666 | .readlink = generic_readlink, |
| 2659 | .follow_link = page_follow_link_light, | 2667 | .follow_link = page_follow_link_light, |
| @@ -2672,6 +2680,7 @@ EXPORT_SYMBOL(lookup_one_len); | |||
| 2672 | EXPORT_SYMBOL(page_follow_link_light); | 2680 | EXPORT_SYMBOL(page_follow_link_light); |
| 2673 | EXPORT_SYMBOL(page_put_link); | 2681 | EXPORT_SYMBOL(page_put_link); |
| 2674 | EXPORT_SYMBOL(page_readlink); | 2682 | EXPORT_SYMBOL(page_readlink); |
| 2683 | EXPORT_SYMBOL(__page_symlink); | ||
| 2675 | EXPORT_SYMBOL(page_symlink); | 2684 | EXPORT_SYMBOL(page_symlink); |
| 2676 | EXPORT_SYMBOL(page_symlink_inode_operations); | 2685 | EXPORT_SYMBOL(page_symlink_inode_operations); |
| 2677 | EXPORT_SYMBOL(path_lookup); | 2686 | EXPORT_SYMBOL(path_lookup); |
diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c index 78010ad60e47..1e4a93835fed 100644 --- a/fs/partitions/ibm.c +++ b/fs/partitions/ibm.c | |||
| @@ -52,6 +52,7 @@ int | |||
| 52 | ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | 52 | ibm_partition(struct parsed_partitions *state, struct block_device *bdev) |
| 53 | { | 53 | { |
| 54 | int blocksize, offset, size; | 54 | int blocksize, offset, size; |
| 55 | loff_t i_size; | ||
| 55 | dasd_information_t *info; | 56 | dasd_information_t *info; |
| 56 | struct hd_geometry *geo; | 57 | struct hd_geometry *geo; |
| 57 | char type[5] = {0,}; | 58 | char type[5] = {0,}; |
| @@ -63,6 +64,13 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
| 63 | unsigned char *data; | 64 | unsigned char *data; |
| 64 | Sector sect; | 65 | Sector sect; |
| 65 | 66 | ||
| 67 | blocksize = bdev_hardsect_size(bdev); | ||
| 68 | if (blocksize <= 0) | ||
| 69 | return 0; | ||
| 70 | i_size = i_size_read(bdev->bd_inode); | ||
| 71 | if (i_size == 0) | ||
| 72 | return 0; | ||
| 73 | |||
| 66 | if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL) | 74 | if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL) |
| 67 | goto out_noinfo; | 75 | goto out_noinfo; |
| 68 | if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL) | 76 | if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL) |
| @@ -73,9 +81,6 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
| 73 | if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || | 81 | if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || |
| 74 | ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) | 82 | ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) |
| 75 | goto out_noioctl; | 83 | goto out_noioctl; |
| 76 | |||
| 77 | if ((blocksize = bdev_hardsect_size(bdev)) <= 0) | ||
| 78 | goto out_badsect; | ||
| 79 | 84 | ||
| 80 | /* | 85 | /* |
| 81 | * Get volume label, extract name and type. | 86 | * Get volume label, extract name and type. |
| @@ -111,7 +116,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
| 111 | } else { | 116 | } else { |
| 112 | printk("CMS1/%8s:", name); | 117 | printk("CMS1/%8s:", name); |
| 113 | offset = (info->label_block + 1); | 118 | offset = (info->label_block + 1); |
| 114 | size = bdev->bd_inode->i_size >> 9; | 119 | size = i_size >> 9; |
| 115 | } | 120 | } |
| 116 | put_partition(state, 1, offset*(blocksize >> 9), | 121 | put_partition(state, 1, offset*(blocksize >> 9), |
| 117 | size-offset*(blocksize >> 9)); | 122 | size-offset*(blocksize >> 9)); |
| @@ -168,7 +173,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
| 168 | else | 173 | else |
| 169 | printk("(nonl)/%8s:", name); | 174 | printk("(nonl)/%8s:", name); |
| 170 | offset = (info->label_block + 1); | 175 | offset = (info->label_block + 1); |
| 171 | size = (bdev->bd_inode->i_size >> 9); | 176 | size = i_size >> 9; |
| 172 | put_partition(state, 1, offset*(blocksize >> 9), | 177 | put_partition(state, 1, offset*(blocksize >> 9), |
| 173 | size-offset*(blocksize >> 9)); | 178 | size-offset*(blocksize >> 9)); |
| 174 | } | 179 | } |
| @@ -180,7 +185,6 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
| 180 | return 1; | 185 | return 1; |
| 181 | 186 | ||
| 182 | out_readerr: | 187 | out_readerr: |
| 183 | out_badsect: | ||
| 184 | out_noioctl: | 188 | out_noioctl: |
| 185 | kfree(label); | 189 | kfree(label); |
| 186 | out_nolab: | 190 | out_nolab: |
| @@ -605,7 +605,7 @@ struct file_operations rdwr_fifo_fops = { | |||
| 605 | .fasync = pipe_rdwr_fasync, | 605 | .fasync = pipe_rdwr_fasync, |
| 606 | }; | 606 | }; |
| 607 | 607 | ||
| 608 | struct file_operations read_pipe_fops = { | 608 | static struct file_operations read_pipe_fops = { |
| 609 | .llseek = no_llseek, | 609 | .llseek = no_llseek, |
| 610 | .read = pipe_read, | 610 | .read = pipe_read, |
| 611 | .readv = pipe_readv, | 611 | .readv = pipe_readv, |
| @@ -617,7 +617,7 @@ struct file_operations read_pipe_fops = { | |||
| 617 | .fasync = pipe_read_fasync, | 617 | .fasync = pipe_read_fasync, |
| 618 | }; | 618 | }; |
| 619 | 619 | ||
| 620 | struct file_operations write_pipe_fops = { | 620 | static struct file_operations write_pipe_fops = { |
| 621 | .llseek = no_llseek, | 621 | .llseek = no_llseek, |
| 622 | .read = bad_pipe_r, | 622 | .read = bad_pipe_r, |
| 623 | .write = pipe_write, | 623 | .write = pipe_write, |
| @@ -629,7 +629,7 @@ struct file_operations write_pipe_fops = { | |||
| 629 | .fasync = pipe_write_fasync, | 629 | .fasync = pipe_write_fasync, |
| 630 | }; | 630 | }; |
| 631 | 631 | ||
| 632 | struct file_operations rdwr_pipe_fops = { | 632 | static struct file_operations rdwr_pipe_fops = { |
| 633 | .llseek = no_llseek, | 633 | .llseek = no_llseek, |
| 634 | .read = pipe_read, | 634 | .read = pipe_read, |
| 635 | .readv = pipe_readv, | 635 | .readv = pipe_readv, |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 395e582ee542..d04cff2273b6 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
| @@ -1045,10 +1045,14 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) | |||
| 1045 | } | 1045 | } |
| 1046 | 1046 | ||
| 1047 | inode->i_uid = le32_to_cpu(fe->uid); | 1047 | inode->i_uid = le32_to_cpu(fe->uid); |
| 1048 | if ( inode->i_uid == -1 ) inode->i_uid = UDF_SB(inode->i_sb)->s_uid; | 1048 | if (inode->i_uid == -1 || UDF_QUERY_FLAG(inode->i_sb, |
| 1049 | UDF_FLAG_UID_IGNORE)) | ||
| 1050 | inode->i_uid = UDF_SB(inode->i_sb)->s_uid; | ||
| 1049 | 1051 | ||
| 1050 | inode->i_gid = le32_to_cpu(fe->gid); | 1052 | inode->i_gid = le32_to_cpu(fe->gid); |
| 1051 | if ( inode->i_gid == -1 ) inode->i_gid = UDF_SB(inode->i_sb)->s_gid; | 1053 | if (inode->i_gid == -1 || UDF_QUERY_FLAG(inode->i_sb, |
| 1054 | UDF_FLAG_GID_IGNORE)) | ||
| 1055 | inode->i_gid = UDF_SB(inode->i_sb)->s_gid; | ||
| 1052 | 1056 | ||
| 1053 | inode->i_nlink = le16_to_cpu(fe->fileLinkCount); | 1057 | inode->i_nlink = le16_to_cpu(fe->fileLinkCount); |
| 1054 | if (!inode->i_nlink) | 1058 | if (!inode->i_nlink) |
| @@ -1335,10 +1339,14 @@ udf_update_inode(struct inode *inode, int do_sync) | |||
| 1335 | return err; | 1339 | return err; |
| 1336 | } | 1340 | } |
| 1337 | 1341 | ||
| 1338 | if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid) | 1342 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET)) |
| 1343 | fe->uid = cpu_to_le32(-1); | ||
| 1344 | else if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid) | ||
| 1339 | fe->uid = cpu_to_le32(inode->i_uid); | 1345 | fe->uid = cpu_to_le32(inode->i_uid); |
| 1340 | 1346 | ||
| 1341 | if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid) | 1347 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET)) |
| 1348 | fe->gid = cpu_to_le32(-1); | ||
| 1349 | else if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid) | ||
| 1342 | fe->gid = cpu_to_le32(inode->i_gid); | 1350 | fe->gid = cpu_to_le32(inode->i_gid); |
| 1343 | 1351 | ||
| 1344 | udfperms = ((inode->i_mode & S_IRWXO) ) | | 1352 | udfperms = ((inode->i_mode & S_IRWXO) ) | |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 4a6f49adc609..368d8f81fe54 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
| @@ -269,7 +269,7 @@ enum { | |||
| 269 | Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock, | 269 | Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock, |
| 270 | Opt_anchor, Opt_volume, Opt_partition, Opt_fileset, | 270 | Opt_anchor, Opt_volume, Opt_partition, Opt_fileset, |
| 271 | Opt_rootdir, Opt_utf8, Opt_iocharset, | 271 | Opt_rootdir, Opt_utf8, Opt_iocharset, |
| 272 | Opt_err | 272 | Opt_err, Opt_uforget, Opt_uignore, Opt_gforget, Opt_gignore |
| 273 | }; | 273 | }; |
| 274 | 274 | ||
| 275 | static match_table_t tokens = { | 275 | static match_table_t tokens = { |
| @@ -282,6 +282,10 @@ static match_table_t tokens = { | |||
| 282 | {Opt_adinicb, "adinicb"}, | 282 | {Opt_adinicb, "adinicb"}, |
| 283 | {Opt_shortad, "shortad"}, | 283 | {Opt_shortad, "shortad"}, |
| 284 | {Opt_longad, "longad"}, | 284 | {Opt_longad, "longad"}, |
| 285 | {Opt_uforget, "uid=forget"}, | ||
| 286 | {Opt_uignore, "uid=ignore"}, | ||
| 287 | {Opt_gforget, "gid=forget"}, | ||
| 288 | {Opt_gignore, "gid=ignore"}, | ||
| 285 | {Opt_gid, "gid=%u"}, | 289 | {Opt_gid, "gid=%u"}, |
| 286 | {Opt_uid, "uid=%u"}, | 290 | {Opt_uid, "uid=%u"}, |
| 287 | {Opt_umask, "umask=%o"}, | 291 | {Opt_umask, "umask=%o"}, |
| @@ -414,6 +418,18 @@ udf_parse_options(char *options, struct udf_options *uopt) | |||
| 414 | uopt->flags |= (1 << UDF_FLAG_NLS_MAP); | 418 | uopt->flags |= (1 << UDF_FLAG_NLS_MAP); |
| 415 | break; | 419 | break; |
| 416 | #endif | 420 | #endif |
| 421 | case Opt_uignore: | ||
| 422 | uopt->flags |= (1 << UDF_FLAG_UID_IGNORE); | ||
| 423 | break; | ||
| 424 | case Opt_uforget: | ||
| 425 | uopt->flags |= (1 << UDF_FLAG_UID_FORGET); | ||
| 426 | break; | ||
| 427 | case Opt_gignore: | ||
| 428 | uopt->flags |= (1 << UDF_FLAG_GID_IGNORE); | ||
| 429 | break; | ||
| 430 | case Opt_gforget: | ||
| 431 | uopt->flags |= (1 << UDF_FLAG_GID_FORGET); | ||
| 432 | break; | ||
| 417 | default: | 433 | default: |
| 418 | printk(KERN_ERR "udf: bad mount option \"%s\" " | 434 | printk(KERN_ERR "udf: bad mount option \"%s\" " |
| 419 | "or missing value\n", p); | 435 | "or missing value\n", p); |
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h index 663669810be6..110f8d62616f 100644 --- a/fs/udf/udf_sb.h +++ b/fs/udf/udf_sb.h | |||
| @@ -20,6 +20,10 @@ | |||
| 20 | #define UDF_FLAG_VARCONV 8 | 20 | #define UDF_FLAG_VARCONV 8 |
| 21 | #define UDF_FLAG_NLS_MAP 9 | 21 | #define UDF_FLAG_NLS_MAP 9 |
| 22 | #define UDF_FLAG_UTF8 10 | 22 | #define UDF_FLAG_UTF8 10 |
| 23 | #define UDF_FLAG_UID_FORGET 11 /* save -1 for uid to disk */ | ||
| 24 | #define UDF_FLAG_UID_IGNORE 12 /* use sb uid instead of on disk uid */ | ||
| 25 | #define UDF_FLAG_GID_FORGET 13 | ||
| 26 | #define UDF_FLAG_GID_IGNORE 14 | ||
| 23 | 27 | ||
| 24 | #define UDF_PART_FLAG_UNALLOC_BITMAP 0x0001 | 28 | #define UDF_PART_FLAG_UNALLOC_BITMAP 0x0001 |
| 25 | #define UDF_PART_FLAG_UNALLOC_TABLE 0x0002 | 29 | #define UDF_PART_FLAG_UNALLOC_TABLE 0x0002 |
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 4dc8ddb401c1..09ec447fe2af 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h | |||
| @@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u16 *addr) | |||
| 78 | 78 | ||
| 79 | #define __get_unaligned(ptr, size) ({ \ | 79 | #define __get_unaligned(ptr, size) ({ \ |
| 80 | const void *__gu_p = ptr; \ | 80 | const void *__gu_p = ptr; \ |
| 81 | __typeof__(*(ptr)) val; \ | 81 | __u64 val; \ |
| 82 | switch (size) { \ | 82 | switch (size) { \ |
| 83 | case 1: \ | 83 | case 1: \ |
| 84 | val = *(const __u8 *)__gu_p; \ | 84 | val = *(const __u8 *)__gu_p; \ |
| @@ -95,7 +95,7 @@ static inline void __ustw(__u16 val, __u16 *addr) | |||
| 95 | default: \ | 95 | default: \ |
| 96 | bad_unaligned_access_length(); \ | 96 | bad_unaligned_access_length(); \ |
| 97 | }; \ | 97 | }; \ |
| 98 | val; \ | 98 | (__typeof__(*(ptr)))val; \ |
| 99 | }) | 99 | }) |
| 100 | 100 | ||
| 101 | #define __put_unaligned(val, ptr, size) \ | 101 | #define __put_unaligned(val, ptr, size) \ |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index d30b8571573f..ff9ac8d19eb2 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
| @@ -137,6 +137,8 @@ void switch_APIC_timer_to_ipi(void *cpumask); | |||
| 137 | void switch_ipi_to_APIC_timer(void *cpumask); | 137 | void switch_ipi_to_APIC_timer(void *cpumask); |
| 138 | #define ARCH_APICTIMER_STOPS_ON_C3 1 | 138 | #define ARCH_APICTIMER_STOPS_ON_C3 1 |
| 139 | 139 | ||
| 140 | extern int timer_over_8254; | ||
| 141 | |||
| 140 | #else /* !CONFIG_X86_LOCAL_APIC */ | 142 | #else /* !CONFIG_X86_LOCAL_APIC */ |
| 141 | static inline void lapic_shutdown(void) { } | 143 | static inline void lapic_shutdown(void) { } |
| 142 | 144 | ||
diff --git a/include/asm-m68k/atomic.h b/include/asm-m68k/atomic.h index a4a84d5c65d5..862e497c2645 100644 --- a/include/asm-m68k/atomic.h +++ b/include/asm-m68k/atomic.h | |||
| @@ -55,6 +55,7 @@ static inline int atomic_inc_and_test(atomic_t *v) | |||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | #ifdef CONFIG_RMW_INSNS | 57 | #ifdef CONFIG_RMW_INSNS |
| 58 | |||
| 58 | static inline int atomic_add_return(int i, atomic_t *v) | 59 | static inline int atomic_add_return(int i, atomic_t *v) |
| 59 | { | 60 | { |
| 60 | int t, tmp; | 61 | int t, tmp; |
| @@ -82,7 +83,12 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
| 82 | : "g" (i), "2" (atomic_read(v))); | 83 | : "g" (i), "2" (atomic_read(v))); |
| 83 | return t; | 84 | return t; |
| 84 | } | 85 | } |
| 86 | |||
| 87 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) | ||
| 88 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
| 89 | |||
| 85 | #else /* !CONFIG_RMW_INSNS */ | 90 | #else /* !CONFIG_RMW_INSNS */ |
| 91 | |||
| 86 | static inline int atomic_add_return(int i, atomic_t * v) | 92 | static inline int atomic_add_return(int i, atomic_t * v) |
| 87 | { | 93 | { |
| 88 | unsigned long flags; | 94 | unsigned long flags; |
| @@ -110,6 +116,32 @@ static inline int atomic_sub_return(int i, atomic_t * v) | |||
| 110 | 116 | ||
| 111 | return t; | 117 | return t; |
| 112 | } | 118 | } |
| 119 | |||
| 120 | static inline int atomic_cmpxchg(atomic_t *v, int old, int new) | ||
| 121 | { | ||
| 122 | unsigned long flags; | ||
| 123 | int prev; | ||
| 124 | |||
| 125 | local_irq_save(flags); | ||
| 126 | prev = atomic_read(v); | ||
| 127 | if (prev == old) | ||
| 128 | atomic_set(v, new); | ||
| 129 | local_irq_restore(flags); | ||
| 130 | return prev; | ||
| 131 | } | ||
| 132 | |||
| 133 | static inline int atomic_xchg(atomic_t *v, int new) | ||
| 134 | { | ||
| 135 | unsigned long flags; | ||
| 136 | int prev; | ||
| 137 | |||
| 138 | local_irq_save(flags); | ||
| 139 | prev = atomic_read(v); | ||
| 140 | atomic_set(v, new); | ||
| 141 | local_irq_restore(flags); | ||
| 142 | return prev; | ||
| 143 | } | ||
| 144 | |||
| 113 | #endif /* !CONFIG_RMW_INSNS */ | 145 | #endif /* !CONFIG_RMW_INSNS */ |
| 114 | 146 | ||
| 115 | #define atomic_dec_return(v) atomic_sub_return(1, (v)) | 147 | #define atomic_dec_return(v) atomic_sub_return(1, (v)) |
| @@ -139,9 +171,6 @@ static inline void atomic_set_mask(unsigned long mask, unsigned long *v) | |||
| 139 | __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask)); | 171 | __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask)); |
| 140 | } | 172 | } |
| 141 | 173 | ||
| 142 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) | ||
| 143 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
| 144 | |||
| 145 | #define atomic_add_unless(v, a, u) \ | 174 | #define atomic_add_unless(v, a, u) \ |
| 146 | ({ \ | 175 | ({ \ |
| 147 | int c, old; \ | 176 | int c, old; \ |
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h index ca5cec97e167..34755c0a6398 100644 --- a/include/asm-mips/vga.h +++ b/include/asm-mips/vga.h | |||
| @@ -26,6 +26,9 @@ | |||
| 26 | * <linux/vt_buffer.h> has already done the right job for us. | 26 | * <linux/vt_buffer.h> has already done the right job for us. |
| 27 | */ | 27 | */ |
| 28 | 28 | ||
| 29 | #undef scr_writew | ||
| 30 | #undef scr_readw | ||
| 31 | |||
| 29 | static inline void scr_writew(u16 val, volatile u16 *addr) | 32 | static inline void scr_writew(u16 val, volatile u16 *addr) |
| 30 | { | 33 | { |
| 31 | *addr = cpu_to_le16(val); | 34 | *addr = cpu_to_le16(val); |
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 90d005bb4d1c..5638518968c3 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #define PPC_FEATURE_POWER5_PLUS 0x00020000 | 20 | #define PPC_FEATURE_POWER5_PLUS 0x00020000 |
| 21 | #define PPC_FEATURE_CELL 0x00010000 | 21 | #define PPC_FEATURE_CELL 0x00010000 |
| 22 | #define PPC_FEATURE_BOOKE 0x00008000 | 22 | #define PPC_FEATURE_BOOKE 0x00008000 |
| 23 | #define PPC_FEATURE_SMT 0x00004000 | ||
| 24 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 | ||
| 23 | 25 | ||
| 24 | #ifdef __KERNEL__ | 26 | #ifdef __KERNEL__ |
| 25 | #ifndef __ASSEMBLY__ | 27 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index eb392032e19b..5207758a6dd9 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
| @@ -118,6 +118,8 @@ static inline void pci_addr_cache_build(void) { } | |||
| 118 | 118 | ||
| 119 | static inline void eeh_add_device_early(struct device_node *dn) { } | 119 | static inline void eeh_add_device_early(struct device_node *dn) { } |
| 120 | 120 | ||
| 121 | static inline void eeh_add_device_late(struct pci_dev *dev) { } | ||
| 122 | |||
| 121 | static inline void eeh_remove_device(struct pci_dev *dev) { } | 123 | static inline void eeh_remove_device(struct pci_dev *dev) { } |
| 122 | 124 | ||
| 123 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } | 125 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } |
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h index bda2f217e6fe..6a2af2f6853b 100644 --- a/include/asm-powerpc/kexec.h +++ b/include/asm-powerpc/kexec.h | |||
| @@ -93,7 +93,8 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
| 93 | "mfxer %0\n" | 93 | "mfxer %0\n" |
| 94 | "std %0, 296(%2)\n" | 94 | "std %0, 296(%2)\n" |
| 95 | : "=&r" (tmp1), "=&r" (tmp2) | 95 | : "=&r" (tmp1), "=&r" (tmp2) |
| 96 | : "b" (newregs)); | 96 | : "b" (newregs) |
| 97 | : "memory"); | ||
| 97 | } | 98 | } |
| 98 | } | 99 | } |
| 99 | #else | 100 | #else |
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h index e9590c06ad92..80a7832d2721 100644 --- a/include/asm-powerpc/pgtable-4k.h +++ b/include/asm-powerpc/pgtable-4k.h | |||
| @@ -88,4 +88,4 @@ | |||
| 88 | (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) | 88 | (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) |
| 89 | 89 | ||
| 90 | #define pud_ERROR(e) \ | 90 | #define pud_ERROR(e) \ |
| 91 | printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pud_val(e)) | 91 | printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e)) |
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index 237fc2b72974..ffc7462d77ba 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
| @@ -37,7 +37,6 @@ struct thread_info { | |||
| 37 | int preempt_count; /* 0 => preemptable, | 37 | int preempt_count; /* 0 => preemptable, |
| 38 | <0 => BUG */ | 38 | <0 => BUG */ |
| 39 | struct restart_block restart_block; | 39 | struct restart_block restart_block; |
| 40 | void __user *nvgprs_frame; | ||
| 41 | /* low level flags - has atomic operations done on it */ | 40 | /* low level flags - has atomic operations done on it */ |
| 42 | unsigned long flags ____cacheline_aligned_in_smp; | 41 | unsigned long flags ____cacheline_aligned_in_smp; |
| 43 | }; | 42 | }; |
| @@ -120,7 +119,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 120 | #define TIF_MEMDIE 10 | 119 | #define TIF_MEMDIE 10 |
| 121 | #define TIF_SECCOMP 11 /* secure computing */ | 120 | #define TIF_SECCOMP 11 /* secure computing */ |
| 122 | #define TIF_RESTOREALL 12 /* Restore all regs (implies NOERROR) */ | 121 | #define TIF_RESTOREALL 12 /* Restore all regs (implies NOERROR) */ |
| 123 | #define TIF_SAVE_NVGPRS 13 /* Save r14-r31 in signal frame */ | ||
| 124 | #define TIF_NOERROR 14 /* Force successful syscall return */ | 122 | #define TIF_NOERROR 14 /* Force successful syscall return */ |
| 125 | #define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ | 123 | #define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ |
| 126 | 124 | ||
| @@ -137,15 +135,13 @@ static inline struct thread_info *current_thread_info(void) | |||
| 137 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) | 135 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) |
| 138 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 136 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
| 139 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) | 137 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) |
| 140 | #define _TIF_SAVE_NVGPRS (1<<TIF_SAVE_NVGPRS) | ||
| 141 | #define _TIF_NOERROR (1<<TIF_NOERROR) | 138 | #define _TIF_NOERROR (1<<TIF_NOERROR) |
| 142 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 139 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
| 143 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | 140 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) |
| 144 | 141 | ||
| 145 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ | 142 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ |
| 146 | _TIF_NEED_RESCHED | _TIF_RESTOREALL | \ | 143 | _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) |
| 147 | _TIF_RESTORE_SIGMASK) | 144 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) |
| 148 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR|_TIF_SAVE_NVGPRS) | ||
| 149 | 145 | ||
| 150 | #endif /* __KERNEL__ */ | 146 | #endif /* __KERNEL__ */ |
| 151 | 147 | ||
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 8fad50f8e389..ae7dfb790df3 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
| @@ -696,6 +696,8 @@ COMPATIBLE_IOCTL(MEMLOCK) | |||
| 696 | COMPATIBLE_IOCTL(MEMUNLOCK) | 696 | COMPATIBLE_IOCTL(MEMUNLOCK) |
| 697 | COMPATIBLE_IOCTL(MEMGETREGIONCOUNT) | 697 | COMPATIBLE_IOCTL(MEMGETREGIONCOUNT) |
| 698 | COMPATIBLE_IOCTL(MEMGETREGIONINFO) | 698 | COMPATIBLE_IOCTL(MEMGETREGIONINFO) |
| 699 | COMPATIBLE_IOCTL(MEMGETBADBLOCK) | ||
| 700 | COMPATIBLE_IOCTL(MEMSETBADBLOCK) | ||
| 699 | /* NBD */ | 701 | /* NBD */ |
| 700 | ULONG_IOCTL(NBD_SET_SOCK) | 702 | ULONG_IOCTL(NBD_SET_SOCK) |
| 701 | ULONG_IOCTL(NBD_SET_BLKSIZE) | 703 | ULONG_IOCTL(NBD_SET_BLKSIZE) |
diff --git a/include/linux/file.h b/include/linux/file.h index 418b6101b59a..9901b850f2e4 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
| @@ -60,8 +60,6 @@ extern void put_filp(struct file *); | |||
| 60 | extern int get_unused_fd(void); | 60 | extern int get_unused_fd(void); |
| 61 | extern void FASTCALL(put_unused_fd(unsigned int fd)); | 61 | extern void FASTCALL(put_unused_fd(unsigned int fd)); |
| 62 | struct kmem_cache; | 62 | struct kmem_cache; |
| 63 | extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long cflags); | ||
| 64 | extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long dflags); | ||
| 65 | 63 | ||
| 66 | extern struct file ** alloc_fd_array(int); | 64 | extern struct file ** alloc_fd_array(int); |
| 67 | extern void free_fd_array(struct file **, int); | 65 | extern void free_fd_array(struct file **, int); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e059da947007..128d0082522c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -35,6 +35,7 @@ struct files_stat_struct { | |||
| 35 | int max_files; /* tunable */ | 35 | int max_files; /* tunable */ |
| 36 | }; | 36 | }; |
| 37 | extern struct files_stat_struct files_stat; | 37 | extern struct files_stat_struct files_stat; |
| 38 | extern int get_max_files(void); | ||
| 38 | 39 | ||
| 39 | struct inodes_stat_t { | 40 | struct inodes_stat_t { |
| 40 | int nr_inodes; | 41 | int nr_inodes; |
| @@ -1418,9 +1419,6 @@ extern int is_bad_inode(struct inode *); | |||
| 1418 | extern struct file_operations read_fifo_fops; | 1419 | extern struct file_operations read_fifo_fops; |
| 1419 | extern struct file_operations write_fifo_fops; | 1420 | extern struct file_operations write_fifo_fops; |
| 1420 | extern struct file_operations rdwr_fifo_fops; | 1421 | extern struct file_operations rdwr_fifo_fops; |
| 1421 | extern struct file_operations read_pipe_fops; | ||
| 1422 | extern struct file_operations write_pipe_fops; | ||
| 1423 | extern struct file_operations rdwr_pipe_fops; | ||
| 1424 | 1422 | ||
| 1425 | extern int fs_may_remount_ro(struct super_block *); | 1423 | extern int fs_may_remount_ro(struct super_block *); |
| 1426 | 1424 | ||
| @@ -1666,6 +1664,8 @@ extern int vfs_follow_link(struct nameidata *, const char *); | |||
| 1666 | extern int page_readlink(struct dentry *, char __user *, int); | 1664 | extern int page_readlink(struct dentry *, char __user *, int); |
| 1667 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); | 1665 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); |
| 1668 | extern void page_put_link(struct dentry *, struct nameidata *, void *); | 1666 | extern void page_put_link(struct dentry *, struct nameidata *, void *); |
| 1667 | extern int __page_symlink(struct inode *inode, const char *symname, int len, | ||
| 1668 | gfp_t gfp_mask); | ||
| 1669 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 1669 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
| 1670 | extern struct inode_operations page_symlink_inode_operations; | 1670 | extern struct inode_operations page_symlink_inode_operations; |
| 1671 | extern int generic_readlink(struct dentry *, char __user *, int); | 1671 | extern int generic_readlink(struct dentry *, char __user *, int); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 20f9148e38d9..7851e6b520cf 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -157,9 +157,9 @@ extern void FASTCALL(free_cold_page(struct page *page)); | |||
| 157 | 157 | ||
| 158 | void page_alloc_init(void); | 158 | void page_alloc_init(void); |
| 159 | #ifdef CONFIG_NUMA | 159 | #ifdef CONFIG_NUMA |
| 160 | void drain_remote_pages(void); | 160 | void drain_node_pages(int node); |
| 161 | #else | 161 | #else |
| 162 | static inline void drain_remote_pages(void) { }; | 162 | static inline void drain_node_pages(int node) { }; |
| 163 | #endif | 163 | #endif |
| 164 | 164 | ||
| 165 | #endif /* __LINUX_GFP_H */ | 165 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index bd6708e2c027..682525511c9e 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
| @@ -39,6 +39,7 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc) | |||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void percpu_counter_mod(struct percpu_counter *fbc, long amount); | 41 | void percpu_counter_mod(struct percpu_counter *fbc, long amount); |
| 42 | long percpu_counter_sum(struct percpu_counter *fbc); | ||
| 42 | 43 | ||
| 43 | static inline long percpu_counter_read(struct percpu_counter *fbc) | 44 | static inline long percpu_counter_read(struct percpu_counter *fbc) |
| 44 | { | 45 | { |
| @@ -92,6 +93,11 @@ static inline long percpu_counter_read_positive(struct percpu_counter *fbc) | |||
| 92 | return fbc->count; | 93 | return fbc->count; |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 96 | static inline long percpu_counter_sum(struct percpu_counter *fbc) | ||
| 97 | { | ||
| 98 | return percpu_counter_read_positive(fbc); | ||
| 99 | } | ||
| 100 | |||
| 95 | #endif /* CONFIG_SMP */ | 101 | #endif /* CONFIG_SMP */ |
| 96 | 102 | ||
| 97 | static inline void percpu_counter_inc(struct percpu_counter *fbc) | 103 | static inline void percpu_counter_inc(struct percpu_counter *fbc) |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index b87aefa082e2..c2ec6c77874e 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -98,13 +98,17 @@ struct rcu_data { | |||
| 98 | long batch; /* Batch # for current RCU batch */ | 98 | long batch; /* Batch # for current RCU batch */ |
| 99 | struct rcu_head *nxtlist; | 99 | struct rcu_head *nxtlist; |
| 100 | struct rcu_head **nxttail; | 100 | struct rcu_head **nxttail; |
| 101 | long count; /* # of queued items */ | 101 | long qlen; /* # of queued callbacks */ |
| 102 | struct rcu_head *curlist; | 102 | struct rcu_head *curlist; |
| 103 | struct rcu_head **curtail; | 103 | struct rcu_head **curtail; |
| 104 | struct rcu_head *donelist; | 104 | struct rcu_head *donelist; |
| 105 | struct rcu_head **donetail; | 105 | struct rcu_head **donetail; |
| 106 | long blimit; /* Upper limit on a processed batch */ | ||
| 106 | int cpu; | 107 | int cpu; |
| 107 | struct rcu_head barrier; | 108 | struct rcu_head barrier; |
| 109 | #ifdef CONFIG_SMP | ||
| 110 | long last_rs_qlen; /* qlen during the last resched */ | ||
| 111 | #endif | ||
| 108 | }; | 112 | }; |
| 109 | 113 | ||
| 110 | DECLARE_PER_CPU(struct rcu_data, rcu_data); | 114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index ff2e09c953b9..62e6314382f0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -892,7 +892,6 @@ static inline int pid_alive(struct task_struct *p) | |||
| 892 | } | 892 | } |
| 893 | 893 | ||
| 894 | extern void free_task(struct task_struct *tsk); | 894 | extern void free_task(struct task_struct *tsk); |
| 895 | extern void __put_task_struct(struct task_struct *tsk); | ||
| 896 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 895 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
| 897 | 896 | ||
| 898 | extern void __put_task_struct_cb(struct rcu_head *rhp); | 897 | extern void __put_task_struct_cb(struct rcu_head *rhp); |
diff --git a/kernel/fork.c b/kernel/fork.c index fbea12d7a943..a8eab86de7f1 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -108,8 +108,10 @@ void free_task(struct task_struct *tsk) | |||
| 108 | } | 108 | } |
| 109 | EXPORT_SYMBOL(free_task); | 109 | EXPORT_SYMBOL(free_task); |
| 110 | 110 | ||
| 111 | void __put_task_struct(struct task_struct *tsk) | 111 | void __put_task_struct_cb(struct rcu_head *rhp) |
| 112 | { | 112 | { |
| 113 | struct task_struct *tsk = container_of(rhp, struct task_struct, rcu); | ||
| 114 | |||
| 113 | WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE))); | 115 | WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE))); |
| 114 | WARN_ON(atomic_read(&tsk->usage)); | 116 | WARN_ON(atomic_read(&tsk->usage)); |
| 115 | WARN_ON(tsk == current); | 117 | WARN_ON(tsk == current); |
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index 0cf8146bd585..8cf15a569fcd 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
| @@ -67,7 +67,43 @@ DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L }; | |||
| 67 | 67 | ||
| 68 | /* Fake initialization required by compiler */ | 68 | /* Fake initialization required by compiler */ |
| 69 | static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL}; | 69 | static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL}; |
| 70 | static int maxbatch = 10000; | 70 | static int blimit = 10; |
| 71 | static int qhimark = 10000; | ||
| 72 | static int qlowmark = 100; | ||
| 73 | #ifdef CONFIG_SMP | ||
| 74 | static int rsinterval = 1000; | ||
| 75 | #endif | ||
| 76 | |||
| 77 | static atomic_t rcu_barrier_cpu_count; | ||
| 78 | static struct semaphore rcu_barrier_sema; | ||
| 79 | static struct completion rcu_barrier_completion; | ||
| 80 | |||
| 81 | #ifdef CONFIG_SMP | ||
| 82 | static void force_quiescent_state(struct rcu_data *rdp, | ||
| 83 | struct rcu_ctrlblk *rcp) | ||
| 84 | { | ||
| 85 | int cpu; | ||
| 86 | cpumask_t cpumask; | ||
| 87 | set_need_resched(); | ||
| 88 | if (unlikely(rdp->qlen - rdp->last_rs_qlen > rsinterval)) { | ||
| 89 | rdp->last_rs_qlen = rdp->qlen; | ||
| 90 | /* | ||
| 91 | * Don't send IPI to itself. With irqs disabled, | ||
| 92 | * rdp->cpu is the current cpu. | ||
| 93 | */ | ||
| 94 | cpumask = rcp->cpumask; | ||
| 95 | cpu_clear(rdp->cpu, cpumask); | ||
| 96 | for_each_cpu_mask(cpu, cpumask) | ||
| 97 | smp_send_reschedule(cpu); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | #else | ||
| 101 | static inline void force_quiescent_state(struct rcu_data *rdp, | ||
| 102 | struct rcu_ctrlblk *rcp) | ||
| 103 | { | ||
| 104 | set_need_resched(); | ||
| 105 | } | ||
| 106 | #endif | ||
| 71 | 107 | ||
| 72 | /** | 108 | /** |
| 73 | * call_rcu - Queue an RCU callback for invocation after a grace period. | 109 | * call_rcu - Queue an RCU callback for invocation after a grace period. |
| @@ -92,17 +128,13 @@ void fastcall call_rcu(struct rcu_head *head, | |||
| 92 | rdp = &__get_cpu_var(rcu_data); | 128 | rdp = &__get_cpu_var(rcu_data); |
| 93 | *rdp->nxttail = head; | 129 | *rdp->nxttail = head; |
| 94 | rdp->nxttail = &head->next; | 130 | rdp->nxttail = &head->next; |
| 95 | 131 | if (unlikely(++rdp->qlen > qhimark)) { | |
| 96 | if (unlikely(++rdp->count > 10000)) | 132 | rdp->blimit = INT_MAX; |
| 97 | set_need_resched(); | 133 | force_quiescent_state(rdp, &rcu_ctrlblk); |
| 98 | 134 | } | |
| 99 | local_irq_restore(flags); | 135 | local_irq_restore(flags); |
| 100 | } | 136 | } |
| 101 | 137 | ||
| 102 | static atomic_t rcu_barrier_cpu_count; | ||
| 103 | static struct semaphore rcu_barrier_sema; | ||
| 104 | static struct completion rcu_barrier_completion; | ||
| 105 | |||
| 106 | /** | 138 | /** |
| 107 | * call_rcu_bh - Queue an RCU for invocation after a quicker grace period. | 139 | * call_rcu_bh - Queue an RCU for invocation after a quicker grace period. |
| 108 | * @head: structure to be used for queueing the RCU updates. | 140 | * @head: structure to be used for queueing the RCU updates. |
| @@ -131,12 +163,12 @@ void fastcall call_rcu_bh(struct rcu_head *head, | |||
| 131 | rdp = &__get_cpu_var(rcu_bh_data); | 163 | rdp = &__get_cpu_var(rcu_bh_data); |
| 132 | *rdp->nxttail = head; | 164 | *rdp->nxttail = head; |
| 133 | rdp->nxttail = &head->next; | 165 | rdp->nxttail = &head->next; |
| 134 | rdp->count++; | 166 | |
| 135 | /* | 167 | if (unlikely(++rdp->qlen > qhimark)) { |
| 136 | * Should we directly call rcu_do_batch() here ? | 168 | rdp->blimit = INT_MAX; |
| 137 | * if (unlikely(rdp->count > 10000)) | 169 | force_quiescent_state(rdp, &rcu_bh_ctrlblk); |
| 138 | * rcu_do_batch(rdp); | 170 | } |
| 139 | */ | 171 | |
| 140 | local_irq_restore(flags); | 172 | local_irq_restore(flags); |
| 141 | } | 173 | } |
| 142 | 174 | ||
| @@ -199,10 +231,12 @@ static void rcu_do_batch(struct rcu_data *rdp) | |||
| 199 | next = rdp->donelist = list->next; | 231 | next = rdp->donelist = list->next; |
| 200 | list->func(list); | 232 | list->func(list); |
| 201 | list = next; | 233 | list = next; |
| 202 | rdp->count--; | 234 | rdp->qlen--; |
| 203 | if (++count >= maxbatch) | 235 | if (++count >= rdp->blimit) |
| 204 | break; | 236 | break; |
| 205 | } | 237 | } |
| 238 | if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark) | ||
| 239 | rdp->blimit = blimit; | ||
| 206 | if (!rdp->donelist) | 240 | if (!rdp->donelist) |
| 207 | rdp->donetail = &rdp->donelist; | 241 | rdp->donetail = &rdp->donelist; |
| 208 | else | 242 | else |
| @@ -473,6 +507,7 @@ static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp, | |||
| 473 | rdp->quiescbatch = rcp->completed; | 507 | rdp->quiescbatch = rcp->completed; |
| 474 | rdp->qs_pending = 0; | 508 | rdp->qs_pending = 0; |
| 475 | rdp->cpu = cpu; | 509 | rdp->cpu = cpu; |
| 510 | rdp->blimit = blimit; | ||
| 476 | } | 511 | } |
| 477 | 512 | ||
| 478 | static void __devinit rcu_online_cpu(int cpu) | 513 | static void __devinit rcu_online_cpu(int cpu) |
| @@ -567,7 +602,12 @@ void synchronize_kernel(void) | |||
| 567 | synchronize_rcu(); | 602 | synchronize_rcu(); |
| 568 | } | 603 | } |
| 569 | 604 | ||
| 570 | module_param(maxbatch, int, 0); | 605 | module_param(blimit, int, 0); |
| 606 | module_param(qhimark, int, 0); | ||
| 607 | module_param(qlowmark, int, 0); | ||
| 608 | #ifdef CONFIG_SMP | ||
| 609 | module_param(rsinterval, int, 0); | ||
| 610 | #endif | ||
| 571 | EXPORT_SYMBOL_GPL(rcu_batches_completed); | 611 | EXPORT_SYMBOL_GPL(rcu_batches_completed); |
| 572 | EXPORT_SYMBOL(call_rcu); /* WARNING: GPL-only in April 2006. */ | 612 | EXPORT_SYMBOL(call_rcu); /* WARNING: GPL-only in April 2006. */ |
| 573 | EXPORT_SYMBOL(call_rcu_bh); /* WARNING: GPL-only in April 2006. */ | 613 | EXPORT_SYMBOL(call_rcu_bh); /* WARNING: GPL-only in April 2006. */ |
diff --git a/kernel/sched.c b/kernel/sched.c index 3454bb869fd0..4d46e90f59c3 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -178,13 +178,6 @@ static unsigned int task_timeslice(task_t *p) | |||
| 178 | #define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran) \ | 178 | #define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran) \ |
| 179 | < (long long) (sd)->cache_hot_time) | 179 | < (long long) (sd)->cache_hot_time) |
| 180 | 180 | ||
| 181 | void __put_task_struct_cb(struct rcu_head *rhp) | ||
| 182 | { | ||
| 183 | __put_task_struct(container_of(rhp, struct task_struct, rcu)); | ||
| 184 | } | ||
| 185 | |||
| 186 | EXPORT_SYMBOL_GPL(__put_task_struct_cb); | ||
| 187 | |||
| 188 | /* | 181 | /* |
| 189 | * These are the runqueue data structures: | 182 | * These are the runqueue data structures: |
| 190 | */ | 183 | */ |
| @@ -4335,6 +4328,7 @@ void __devinit init_idle(task_t *idle, int cpu) | |||
| 4335 | runqueue_t *rq = cpu_rq(cpu); | 4328 | runqueue_t *rq = cpu_rq(cpu); |
| 4336 | unsigned long flags; | 4329 | unsigned long flags; |
| 4337 | 4330 | ||
| 4331 | idle->timestamp = sched_clock(); | ||
| 4338 | idle->sleep_avg = 0; | 4332 | idle->sleep_avg = 0; |
| 4339 | idle->array = NULL; | 4333 | idle->array = NULL; |
| 4340 | idle->prio = MAX_PRIO; | 4334 | idle->prio = MAX_PRIO; |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index de2d9109194e..32b48e8ee36e 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -50,6 +50,9 @@ | |||
| 50 | #include <asm/uaccess.h> | 50 | #include <asm/uaccess.h> |
| 51 | #include <asm/processor.h> | 51 | #include <asm/processor.h> |
| 52 | 52 | ||
| 53 | extern int proc_nr_files(ctl_table *table, int write, struct file *filp, | ||
| 54 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
| 55 | |||
| 53 | #if defined(CONFIG_SYSCTL) | 56 | #if defined(CONFIG_SYSCTL) |
| 54 | 57 | ||
| 55 | /* External variables not in a header file. */ | 58 | /* External variables not in a header file. */ |
| @@ -943,7 +946,7 @@ static ctl_table fs_table[] = { | |||
| 943 | .data = &files_stat, | 946 | .data = &files_stat, |
| 944 | .maxlen = 3*sizeof(int), | 947 | .maxlen = 3*sizeof(int), |
| 945 | .mode = 0444, | 948 | .mode = 0444, |
| 946 | .proc_handler = &proc_dointvec, | 949 | .proc_handler = &proc_nr_files, |
| 947 | }, | 950 | }, |
| 948 | { | 951 | { |
| 949 | .ctl_name = FS_MAXFILE, | 952 | .ctl_name = FS_MAXFILE, |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index a918f77f02f3..1fe76d963ac2 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
| @@ -130,6 +130,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages) | |||
| 130 | onlined_pages++; | 130 | onlined_pages++; |
| 131 | } | 131 | } |
| 132 | zone->present_pages += onlined_pages; | 132 | zone->present_pages += onlined_pages; |
| 133 | zone->zone_pgdat->node_present_pages += onlined_pages; | ||
| 133 | 134 | ||
| 134 | setup_per_zone_pages_min(); | 135 | setup_per_zone_pages_min(); |
| 135 | 136 | ||
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index d80fa7d8f720..954981b14303 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
| @@ -1789,6 +1789,7 @@ static void gather_stats(struct page *page, void *private, int pte_dirty) | |||
| 1789 | cond_resched(); | 1789 | cond_resched(); |
| 1790 | } | 1790 | } |
| 1791 | 1791 | ||
| 1792 | #ifdef CONFIG_HUGETLB_PAGE | ||
| 1792 | static void check_huge_range(struct vm_area_struct *vma, | 1793 | static void check_huge_range(struct vm_area_struct *vma, |
| 1793 | unsigned long start, unsigned long end, | 1794 | unsigned long start, unsigned long end, |
| 1794 | struct numa_maps *md) | 1795 | struct numa_maps *md) |
| @@ -1814,6 +1815,13 @@ static void check_huge_range(struct vm_area_struct *vma, | |||
| 1814 | gather_stats(page, md, pte_dirty(*ptep)); | 1815 | gather_stats(page, md, pte_dirty(*ptep)); |
| 1815 | } | 1816 | } |
| 1816 | } | 1817 | } |
| 1818 | #else | ||
| 1819 | static inline void check_huge_range(struct vm_area_struct *vma, | ||
| 1820 | unsigned long start, unsigned long end, | ||
| 1821 | struct numa_maps *md) | ||
| 1822 | { | ||
| 1823 | } | ||
| 1824 | #endif | ||
| 1817 | 1825 | ||
| 1818 | int show_numa_map(struct seq_file *m, void *v) | 1826 | int show_numa_map(struct seq_file *m, void *v) |
| 1819 | { | 1827 | { |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 791690d7d3fa..234bd4895d14 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -590,21 +590,20 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order, | |||
| 590 | } | 590 | } |
| 591 | 591 | ||
| 592 | #ifdef CONFIG_NUMA | 592 | #ifdef CONFIG_NUMA |
| 593 | /* Called from the slab reaper to drain remote pagesets */ | 593 | /* |
| 594 | void drain_remote_pages(void) | 594 | * Called from the slab reaper to drain pagesets on a particular node that |
| 595 | * belong to the currently executing processor. | ||
| 596 | */ | ||
| 597 | void drain_node_pages(int nodeid) | ||
| 595 | { | 598 | { |
| 596 | struct zone *zone; | 599 | int i, z; |
| 597 | int i; | ||
| 598 | unsigned long flags; | 600 | unsigned long flags; |
| 599 | 601 | ||
| 600 | local_irq_save(flags); | 602 | local_irq_save(flags); |
| 601 | for_each_zone(zone) { | 603 | for (z = 0; z < MAX_NR_ZONES; z++) { |
| 604 | struct zone *zone = NODE_DATA(nodeid)->node_zones + z; | ||
| 602 | struct per_cpu_pageset *pset; | 605 | struct per_cpu_pageset *pset; |
| 603 | 606 | ||
| 604 | /* Do not drain local pagesets */ | ||
| 605 | if (zone->zone_pgdat->node_id == numa_node_id()) | ||
| 606 | continue; | ||
| 607 | |||
| 608 | pset = zone_pcp(zone, smp_processor_id()); | 607 | pset = zone_pcp(zone, smp_processor_id()); |
| 609 | for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) { | 608 | for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) { |
| 610 | struct per_cpu_pages *pcp; | 609 | struct per_cpu_pages *pcp; |
| @@ -537,9 +537,6 @@ void page_add_new_anon_rmap(struct page *page, | |||
| 537 | */ | 537 | */ |
| 538 | void page_add_file_rmap(struct page *page) | 538 | void page_add_file_rmap(struct page *page) |
| 539 | { | 539 | { |
| 540 | BUG_ON(PageAnon(page)); | ||
| 541 | BUG_ON(!pfn_valid(page_to_pfn(page))); | ||
| 542 | |||
| 543 | if (atomic_inc_and_test(&page->_mapcount)) | 540 | if (atomic_inc_and_test(&page->_mapcount)) |
| 544 | __inc_page_state(nr_mapped); | 541 | __inc_page_state(nr_mapped); |
| 545 | } | 542 | } |
| @@ -789,6 +789,47 @@ static void __slab_error(const char *function, struct kmem_cache *cachep, char * | |||
| 789 | dump_stack(); | 789 | dump_stack(); |
| 790 | } | 790 | } |
| 791 | 791 | ||
| 792 | #ifdef CONFIG_NUMA | ||
| 793 | /* | ||
| 794 | * Special reaping functions for NUMA systems called from cache_reap(). | ||
| 795 | * These take care of doing round robin flushing of alien caches (containing | ||
| 796 | * objects freed on different nodes from which they were allocated) and the | ||
| 797 | * flushing of remote pcps by calling drain_node_pages. | ||
| 798 | */ | ||
| 799 | static DEFINE_PER_CPU(unsigned long, reap_node); | ||
| 800 | |||
| 801 | static void init_reap_node(int cpu) | ||
| 802 | { | ||
| 803 | int node; | ||
| 804 | |||
| 805 | node = next_node(cpu_to_node(cpu), node_online_map); | ||
| 806 | if (node == MAX_NUMNODES) | ||
| 807 | node = 0; | ||
| 808 | |||
| 809 | __get_cpu_var(reap_node) = node; | ||
| 810 | } | ||
| 811 | |||
| 812 | static void next_reap_node(void) | ||
| 813 | { | ||
| 814 | int node = __get_cpu_var(reap_node); | ||
| 815 | |||
| 816 | /* | ||
| 817 | * Also drain per cpu pages on remote zones | ||
| 818 | */ | ||
| 819 | if (node != numa_node_id()) | ||
| 820 | drain_node_pages(node); | ||
| 821 | |||
| 822 | node = next_node(node, node_online_map); | ||
| 823 | if (unlikely(node >= MAX_NUMNODES)) | ||
| 824 | node = first_node(node_online_map); | ||
| 825 | __get_cpu_var(reap_node) = node; | ||
| 826 | } | ||
| 827 | |||
| 828 | #else | ||
| 829 | #define init_reap_node(cpu) do { } while (0) | ||
| 830 | #define next_reap_node(void) do { } while (0) | ||
| 831 | #endif | ||
| 832 | |||
| 792 | /* | 833 | /* |
| 793 | * Initiate the reap timer running on the target CPU. We run at around 1 to 2Hz | 834 | * Initiate the reap timer running on the target CPU. We run at around 1 to 2Hz |
| 794 | * via the workqueue/eventd. | 835 | * via the workqueue/eventd. |
| @@ -806,6 +847,7 @@ static void __devinit start_cpu_timer(int cpu) | |||
| 806 | * at that time. | 847 | * at that time. |
| 807 | */ | 848 | */ |
| 808 | if (keventd_up() && reap_work->func == NULL) { | 849 | if (keventd_up() && reap_work->func == NULL) { |
| 850 | init_reap_node(cpu); | ||
| 809 | INIT_WORK(reap_work, cache_reap, NULL); | 851 | INIT_WORK(reap_work, cache_reap, NULL); |
| 810 | schedule_delayed_work_on(cpu, reap_work, HZ + 3 * cpu); | 852 | schedule_delayed_work_on(cpu, reap_work, HZ + 3 * cpu); |
| 811 | } | 853 | } |
| @@ -884,6 +926,23 @@ static void __drain_alien_cache(struct kmem_cache *cachep, | |||
| 884 | } | 926 | } |
| 885 | } | 927 | } |
| 886 | 928 | ||
| 929 | /* | ||
| 930 | * Called from cache_reap() to regularly drain alien caches round robin. | ||
| 931 | */ | ||
| 932 | static void reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3) | ||
| 933 | { | ||
| 934 | int node = __get_cpu_var(reap_node); | ||
| 935 | |||
| 936 | if (l3->alien) { | ||
| 937 | struct array_cache *ac = l3->alien[node]; | ||
| 938 | if (ac && ac->avail) { | ||
| 939 | spin_lock_irq(&ac->lock); | ||
| 940 | __drain_alien_cache(cachep, ac, node); | ||
| 941 | spin_unlock_irq(&ac->lock); | ||
| 942 | } | ||
| 943 | } | ||
| 944 | } | ||
| 945 | |||
| 887 | static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache **alien) | 946 | static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache **alien) |
| 888 | { | 947 | { |
| 889 | int i = 0; | 948 | int i = 0; |
| @@ -902,6 +961,7 @@ static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache **al | |||
| 902 | #else | 961 | #else |
| 903 | 962 | ||
| 904 | #define drain_alien_cache(cachep, alien) do { } while (0) | 963 | #define drain_alien_cache(cachep, alien) do { } while (0) |
| 964 | #define reap_alien(cachep, l3) do { } while (0) | ||
| 905 | 965 | ||
| 906 | static inline struct array_cache **alloc_alien_cache(int node, int limit) | 966 | static inline struct array_cache **alloc_alien_cache(int node, int limit) |
| 907 | { | 967 | { |
| @@ -1124,6 +1184,7 @@ void __init kmem_cache_init(void) | |||
| 1124 | struct cache_sizes *sizes; | 1184 | struct cache_sizes *sizes; |
| 1125 | struct cache_names *names; | 1185 | struct cache_names *names; |
| 1126 | int i; | 1186 | int i; |
| 1187 | int order; | ||
| 1127 | 1188 | ||
| 1128 | for (i = 0; i < NUM_INIT_LISTS; i++) { | 1189 | for (i = 0; i < NUM_INIT_LISTS; i++) { |
| 1129 | kmem_list3_init(&initkmem_list3[i]); | 1190 | kmem_list3_init(&initkmem_list3[i]); |
| @@ -1167,11 +1228,15 @@ void __init kmem_cache_init(void) | |||
| 1167 | 1228 | ||
| 1168 | cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, cache_line_size()); | 1229 | cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, cache_line_size()); |
| 1169 | 1230 | ||
| 1170 | cache_estimate(0, cache_cache.buffer_size, cache_line_size(), 0, | 1231 | for (order = 0; order < MAX_ORDER; order++) { |
| 1171 | &left_over, &cache_cache.num); | 1232 | cache_estimate(order, cache_cache.buffer_size, |
| 1233 | cache_line_size(), 0, &left_over, &cache_cache.num); | ||
| 1234 | if (cache_cache.num) | ||
| 1235 | break; | ||
| 1236 | } | ||
| 1172 | if (!cache_cache.num) | 1237 | if (!cache_cache.num) |
| 1173 | BUG(); | 1238 | BUG(); |
| 1174 | 1239 | cache_cache.gfporder = order; | |
| 1175 | cache_cache.colour = left_over / cache_cache.colour_off; | 1240 | cache_cache.colour = left_over / cache_cache.colour_off; |
| 1176 | cache_cache.slab_size = ALIGN(cache_cache.num * sizeof(kmem_bufctl_t) + | 1241 | cache_cache.slab_size = ALIGN(cache_cache.num * sizeof(kmem_bufctl_t) + |
| 1177 | sizeof(struct slab), cache_line_size()); | 1242 | sizeof(struct slab), cache_line_size()); |
| @@ -1648,6 +1713,14 @@ static inline size_t calculate_slab_order(struct kmem_cache *cachep, | |||
| 1648 | left_over = remainder; | 1713 | left_over = remainder; |
| 1649 | 1714 | ||
| 1650 | /* | 1715 | /* |
| 1716 | * A VFS-reclaimable slab tends to have most allocations | ||
| 1717 | * as GFP_NOFS and we really don't want to have to be allocating | ||
| 1718 | * higher-order pages when we are unable to shrink dcache. | ||
| 1719 | */ | ||
| 1720 | if (flags & SLAB_RECLAIM_ACCOUNT) | ||
| 1721 | break; | ||
| 1722 | |||
| 1723 | /* | ||
| 1651 | * Large number of objects is good, but very large slabs are | 1724 | * Large number of objects is good, but very large slabs are |
| 1652 | * currently bad for the gfp()s. | 1725 | * currently bad for the gfp()s. |
| 1653 | */ | 1726 | */ |
| @@ -1869,17 +1942,7 @@ kmem_cache_create (const char *name, size_t size, size_t align, | |||
| 1869 | 1942 | ||
| 1870 | size = ALIGN(size, align); | 1943 | size = ALIGN(size, align); |
| 1871 | 1944 | ||
| 1872 | if ((flags & SLAB_RECLAIM_ACCOUNT) && size <= PAGE_SIZE) { | 1945 | left_over = calculate_slab_order(cachep, size, align, flags); |
| 1873 | /* | ||
| 1874 | * A VFS-reclaimable slab tends to have most allocations | ||
| 1875 | * as GFP_NOFS and we really don't want to have to be allocating | ||
| 1876 | * higher-order pages when we are unable to shrink dcache. | ||
| 1877 | */ | ||
| 1878 | cachep->gfporder = 0; | ||
| 1879 | cache_estimate(cachep->gfporder, size, align, flags, | ||
| 1880 | &left_over, &cachep->num); | ||
| 1881 | } else | ||
| 1882 | left_over = calculate_slab_order(cachep, size, align, flags); | ||
| 1883 | 1946 | ||
| 1884 | if (!cachep->num) { | 1947 | if (!cachep->num) { |
| 1885 | printk("kmem_cache_create: couldn't create cache %s.\n", name); | 1948 | printk("kmem_cache_create: couldn't create cache %s.\n", name); |
| @@ -3494,8 +3557,7 @@ static void cache_reap(void *unused) | |||
| 3494 | check_irq_on(); | 3557 | check_irq_on(); |
| 3495 | 3558 | ||
| 3496 | l3 = searchp->nodelists[numa_node_id()]; | 3559 | l3 = searchp->nodelists[numa_node_id()]; |
| 3497 | if (l3->alien) | 3560 | reap_alien(searchp, l3); |
| 3498 | drain_alien_cache(searchp, l3->alien); | ||
| 3499 | spin_lock_irq(&l3->list_lock); | 3561 | spin_lock_irq(&l3->list_lock); |
| 3500 | 3562 | ||
| 3501 | drain_array_locked(searchp, cpu_cache_get(searchp), 0, | 3563 | drain_array_locked(searchp, cpu_cache_get(searchp), 0, |
| @@ -3545,7 +3607,7 @@ static void cache_reap(void *unused) | |||
| 3545 | } | 3607 | } |
| 3546 | check_irq_on(); | 3608 | check_irq_on(); |
| 3547 | mutex_unlock(&cache_chain_mutex); | 3609 | mutex_unlock(&cache_chain_mutex); |
| 3548 | drain_remote_pages(); | 3610 | next_reap_node(); |
| 3549 | /* Setup the next iteration */ | 3611 | /* Setup the next iteration */ |
| 3550 | schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC); | 3612 | schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC); |
| 3551 | } | 3613 | } |
| @@ -489,13 +489,34 @@ void percpu_counter_mod(struct percpu_counter *fbc, long amount) | |||
| 489 | if (count >= FBC_BATCH || count <= -FBC_BATCH) { | 489 | if (count >= FBC_BATCH || count <= -FBC_BATCH) { |
| 490 | spin_lock(&fbc->lock); | 490 | spin_lock(&fbc->lock); |
| 491 | fbc->count += count; | 491 | fbc->count += count; |
| 492 | *pcount = 0; | ||
| 492 | spin_unlock(&fbc->lock); | 493 | spin_unlock(&fbc->lock); |
| 493 | count = 0; | 494 | } else { |
| 495 | *pcount = count; | ||
| 494 | } | 496 | } |
| 495 | *pcount = count; | ||
| 496 | put_cpu(); | 497 | put_cpu(); |
| 497 | } | 498 | } |
| 498 | EXPORT_SYMBOL(percpu_counter_mod); | 499 | EXPORT_SYMBOL(percpu_counter_mod); |
| 500 | |||
| 501 | /* | ||
| 502 | * Add up all the per-cpu counts, return the result. This is a more accurate | ||
| 503 | * but much slower version of percpu_counter_read_positive() | ||
| 504 | */ | ||
| 505 | long percpu_counter_sum(struct percpu_counter *fbc) | ||
| 506 | { | ||
| 507 | long ret; | ||
| 508 | int cpu; | ||
| 509 | |||
| 510 | spin_lock(&fbc->lock); | ||
| 511 | ret = fbc->count; | ||
| 512 | for_each_cpu(cpu) { | ||
| 513 | long *pcount = per_cpu_ptr(fbc->counters, cpu); | ||
| 514 | ret += *pcount; | ||
| 515 | } | ||
| 516 | spin_unlock(&fbc->lock); | ||
| 517 | return ret < 0 ? 0 : ret; | ||
| 518 | } | ||
| 519 | EXPORT_SYMBOL(percpu_counter_sum); | ||
| 499 | #endif | 520 | #endif |
| 500 | 521 | ||
| 501 | /* | 522 | /* |
diff --git a/mm/vmscan.c b/mm/vmscan.c index b0af7593d01e..7ccf763bb30b 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -1883,7 +1883,8 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) | |||
| 1883 | 1883 | ||
| 1884 | if (!(gfp_mask & __GFP_WAIT) || | 1884 | if (!(gfp_mask & __GFP_WAIT) || |
| 1885 | zone->all_unreclaimable || | 1885 | zone->all_unreclaimable || |
| 1886 | atomic_read(&zone->reclaim_in_progress) > 0) | 1886 | atomic_read(&zone->reclaim_in_progress) > 0 || |
| 1887 | (p->flags & PF_MEMALLOC)) | ||
| 1887 | return 0; | 1888 | return 0; |
| 1888 | 1889 | ||
| 1889 | node_id = zone->zone_pgdat->node_id; | 1890 | node_id = zone->zone_pgdat->node_id; |
diff --git a/net/bridge/netfilter/Makefile b/net/bridge/netfilter/Makefile index 8bf6d9f6e9d3..905087e0d485 100644 --- a/net/bridge/netfilter/Makefile +++ b/net/bridge/netfilter/Makefile | |||
| @@ -29,4 +29,4 @@ obj-$(CONFIG_BRIDGE_EBT_SNAT) += ebt_snat.o | |||
| 29 | 29 | ||
| 30 | # watchers | 30 | # watchers |
| 31 | obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o | 31 | obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o |
| 32 | obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_ulog.o | 32 | obj-$(CONFIG_BRIDGE_EBT_ULOG) += ebt_ulog.o |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index a7623ead39a8..9f498a6c8895 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -1036,6 +1036,10 @@ static int tcp_tso_should_defer(struct sock *sk, struct tcp_sock *tp, struct sk_ | |||
| 1036 | 1036 | ||
| 1037 | limit = min(send_win, cong_win); | 1037 | limit = min(send_win, cong_win); |
| 1038 | 1038 | ||
| 1039 | /* If a full-sized TSO skb can be sent, do it. */ | ||
| 1040 | if (limit >= 65536) | ||
| 1041 | return 0; | ||
| 1042 | |||
| 1039 | if (sysctl_tcp_tso_win_divisor) { | 1043 | if (sysctl_tcp_tso_win_divisor) { |
| 1040 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); | 1044 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); |
| 1041 | 1045 | ||
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index b7d8822c1be4..19727d941962 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -822,7 +822,7 @@ struct ipv6_saddr_score { | |||
| 822 | int addr_type; | 822 | int addr_type; |
| 823 | unsigned int attrs; | 823 | unsigned int attrs; |
| 824 | int matchlen; | 824 | int matchlen; |
| 825 | unsigned int scope; | 825 | int scope; |
| 826 | unsigned int rule; | 826 | unsigned int rule; |
| 827 | }; | 827 | }; |
| 828 | 828 | ||
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 1b5989b1b670..c323cc6a28b0 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
| @@ -547,7 +547,7 @@ static struct sock * unix_create1(struct socket *sock) | |||
| 547 | struct sock *sk = NULL; | 547 | struct sock *sk = NULL; |
| 548 | struct unix_sock *u; | 548 | struct unix_sock *u; |
| 549 | 549 | ||
| 550 | if (atomic_read(&unix_nr_socks) >= 2*files_stat.max_files) | 550 | if (atomic_read(&unix_nr_socks) >= 2*get_max_files()) |
| 551 | goto out; | 551 | goto out; |
| 552 | 552 | ||
| 553 | sk = sk_alloc(PF_UNIX, GFP_KERNEL, &unix_proto, 1); | 553 | sk = sk_alloc(PF_UNIX, GFP_KERNEL, &unix_proto, 1); |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index b7773bf68efa..b65c201e9ff5 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
| @@ -1262,7 +1262,7 @@ static int selinux_ptrace(struct task_struct *parent, struct task_struct *child) | |||
| 1262 | 1262 | ||
| 1263 | rc = task_has_perm(parent, child, PROCESS__PTRACE); | 1263 | rc = task_has_perm(parent, child, PROCESS__PTRACE); |
| 1264 | /* Save the SID of the tracing process for later use in apply_creds. */ | 1264 | /* Save the SID of the tracing process for later use in apply_creds. */ |
| 1265 | if (!rc) | 1265 | if (!(child->ptrace & PT_PTRACED) && !rc) |
| 1266 | csec->ptrace_sid = psec->sid; | 1266 | csec->ptrace_sid = psec->sid; |
| 1267 | return rc; | 1267 | return rc; |
| 1268 | } | 1268 | } |
