diff options
164 files changed, 1509 insertions, 984 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index c8f47bf154f4..3f591629e953 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -410,9 +410,8 @@ F: drivers/i2c/busses/i2c-ali1563.c | |||
410 | 410 | ||
411 | ALPHA PORT | 411 | ALPHA PORT |
412 | M: Richard Henderson <rth@twiddle.net> | 412 | M: Richard Henderson <rth@twiddle.net> |
413 | S: Odd Fixes for 2.4; Maintained for 2.6. | ||
414 | M: Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 413 | M: Ivan Kokshaysky <ink@jurassic.park.msu.ru> |
415 | S: Maintained for 2.4; PCI support for 2.6. | 414 | M: Matt Turner <mattst88@gmail.com> |
416 | L: linux-alpha@vger.kernel.org | 415 | L: linux-alpha@vger.kernel.org |
417 | F: arch/alpha/ | 416 | F: arch/alpha/ |
418 | 417 | ||
diff --git a/arch/alpha/include/asm/topology.h b/arch/alpha/include/asm/topology.h index 36b3a30ba0e5..9251e13e144f 100644 --- a/arch/alpha/include/asm/topology.h +++ b/arch/alpha/include/asm/topology.h | |||
@@ -28,6 +28,9 @@ static const struct cpumask *cpumask_of_node(int node) | |||
28 | { | 28 | { |
29 | int cpu; | 29 | int cpu; |
30 | 30 | ||
31 | if (node == -1) | ||
32 | return cpu_all_mask; | ||
33 | |||
31 | cpumask_clear(&node_to_cpumask_map[node]); | 34 | cpumask_clear(&node_to_cpumask_map[node]); |
32 | 35 | ||
33 | for_each_online_cpu(cpu) { | 36 | for_each_online_cpu(cpu) { |
diff --git a/arch/arm/mach-davinci/include/mach/keyscan.h b/arch/arm/mach-davinci/include/mach/keyscan.h index b4e21a2976d1..7a560e05bda8 100644 --- a/arch/arm/mach-davinci/include/mach/keyscan.h +++ b/arch/arm/mach-davinci/include/mach/keyscan.h | |||
@@ -29,6 +29,7 @@ enum davinci_matrix_types { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct davinci_ks_platform_data { | 31 | struct davinci_ks_platform_data { |
32 | int (*device_enable)(struct device *dev); | ||
32 | unsigned short *keymap; | 33 | unsigned short *keymap; |
33 | u32 keymapsize; | 34 | u32 keymapsize; |
34 | u8 rep:1; | 35 | u8 rep:1; |
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c index 547d4fc99131..2068e9096a43 100644 --- a/arch/arm/mach-s3c2440/mach-mini2440.c +++ b/arch/arm/mach-s3c2440/mach-mini2440.c | |||
@@ -288,7 +288,7 @@ static struct s3c2410_platform_nand mini2440_nand_info __initdata = { | |||
288 | 288 | ||
289 | /* DM9000AEP 10/100 ethernet controller */ | 289 | /* DM9000AEP 10/100 ethernet controller */ |
290 | 290 | ||
291 | static struct resource mini2440_dm9k_resource[] __initdata = { | 291 | static struct resource mini2440_dm9k_resource[] = { |
292 | [0] = { | 292 | [0] = { |
293 | .start = MACH_MINI2440_DM9K_BASE, | 293 | .start = MACH_MINI2440_DM9K_BASE, |
294 | .end = MACH_MINI2440_DM9K_BASE + 3, | 294 | .end = MACH_MINI2440_DM9K_BASE + 3, |
@@ -310,11 +310,11 @@ static struct resource mini2440_dm9k_resource[] __initdata = { | |||
310 | * The DM9000 has no eeprom, and it's MAC address is set by | 310 | * The DM9000 has no eeprom, and it's MAC address is set by |
311 | * the bootloader before starting the kernel. | 311 | * the bootloader before starting the kernel. |
312 | */ | 312 | */ |
313 | static struct dm9000_plat_data mini2440_dm9k_pdata __initdata = { | 313 | static struct dm9000_plat_data mini2440_dm9k_pdata = { |
314 | .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), | 314 | .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), |
315 | }; | 315 | }; |
316 | 316 | ||
317 | static struct platform_device mini2440_device_eth __initdata = { | 317 | static struct platform_device mini2440_device_eth = { |
318 | .name = "dm9000", | 318 | .name = "dm9000", |
319 | .id = -1, | 319 | .id = -1, |
320 | .num_resources = ARRAY_SIZE(mini2440_dm9k_resource), | 320 | .num_resources = ARRAY_SIZE(mini2440_dm9k_resource), |
@@ -341,7 +341,7 @@ static struct platform_device mini2440_device_eth __initdata = { | |||
341 | * | | +----+ +----+ | 341 | * | | +----+ +----+ |
342 | * ..... | 342 | * ..... |
343 | */ | 343 | */ |
344 | static struct gpio_keys_button mini2440_buttons[] __initdata = { | 344 | static struct gpio_keys_button mini2440_buttons[] = { |
345 | { | 345 | { |
346 | .gpio = S3C2410_GPG(0), /* K1 */ | 346 | .gpio = S3C2410_GPG(0), /* K1 */ |
347 | .code = KEY_F1, | 347 | .code = KEY_F1, |
@@ -384,12 +384,12 @@ static struct gpio_keys_button mini2440_buttons[] __initdata = { | |||
384 | #endif | 384 | #endif |
385 | }; | 385 | }; |
386 | 386 | ||
387 | static struct gpio_keys_platform_data mini2440_button_data __initdata = { | 387 | static struct gpio_keys_platform_data mini2440_button_data = { |
388 | .buttons = mini2440_buttons, | 388 | .buttons = mini2440_buttons, |
389 | .nbuttons = ARRAY_SIZE(mini2440_buttons), | 389 | .nbuttons = ARRAY_SIZE(mini2440_buttons), |
390 | }; | 390 | }; |
391 | 391 | ||
392 | static struct platform_device mini2440_button_device __initdata = { | 392 | static struct platform_device mini2440_button_device = { |
393 | .name = "gpio-keys", | 393 | .name = "gpio-keys", |
394 | .id = -1, | 394 | .id = -1, |
395 | .dev = { | 395 | .dev = { |
@@ -399,41 +399,41 @@ static struct platform_device mini2440_button_device __initdata = { | |||
399 | 399 | ||
400 | /* LEDS */ | 400 | /* LEDS */ |
401 | 401 | ||
402 | static struct s3c24xx_led_platdata mini2440_led1_pdata __initdata = { | 402 | static struct s3c24xx_led_platdata mini2440_led1_pdata = { |
403 | .name = "led1", | 403 | .name = "led1", |
404 | .gpio = S3C2410_GPB(5), | 404 | .gpio = S3C2410_GPB(5), |
405 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 405 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
406 | .def_trigger = "heartbeat", | 406 | .def_trigger = "heartbeat", |
407 | }; | 407 | }; |
408 | 408 | ||
409 | static struct s3c24xx_led_platdata mini2440_led2_pdata __initdata = { | 409 | static struct s3c24xx_led_platdata mini2440_led2_pdata = { |
410 | .name = "led2", | 410 | .name = "led2", |
411 | .gpio = S3C2410_GPB(6), | 411 | .gpio = S3C2410_GPB(6), |
412 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 412 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
413 | .def_trigger = "nand-disk", | 413 | .def_trigger = "nand-disk", |
414 | }; | 414 | }; |
415 | 415 | ||
416 | static struct s3c24xx_led_platdata mini2440_led3_pdata __initdata = { | 416 | static struct s3c24xx_led_platdata mini2440_led3_pdata = { |
417 | .name = "led3", | 417 | .name = "led3", |
418 | .gpio = S3C2410_GPB(7), | 418 | .gpio = S3C2410_GPB(7), |
419 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 419 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
420 | .def_trigger = "mmc0", | 420 | .def_trigger = "mmc0", |
421 | }; | 421 | }; |
422 | 422 | ||
423 | static struct s3c24xx_led_platdata mini2440_led4_pdata __initdata = { | 423 | static struct s3c24xx_led_platdata mini2440_led4_pdata = { |
424 | .name = "led4", | 424 | .name = "led4", |
425 | .gpio = S3C2410_GPB(8), | 425 | .gpio = S3C2410_GPB(8), |
426 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 426 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
427 | .def_trigger = "", | 427 | .def_trigger = "", |
428 | }; | 428 | }; |
429 | 429 | ||
430 | static struct s3c24xx_led_platdata mini2440_led_backlight_pdata __initdata = { | 430 | static struct s3c24xx_led_platdata mini2440_led_backlight_pdata = { |
431 | .name = "backlight", | 431 | .name = "backlight", |
432 | .gpio = S3C2410_GPG(4), | 432 | .gpio = S3C2410_GPG(4), |
433 | .def_trigger = "backlight", | 433 | .def_trigger = "backlight", |
434 | }; | 434 | }; |
435 | 435 | ||
436 | static struct platform_device mini2440_led1 __initdata = { | 436 | static struct platform_device mini2440_led1 = { |
437 | .name = "s3c24xx_led", | 437 | .name = "s3c24xx_led", |
438 | .id = 1, | 438 | .id = 1, |
439 | .dev = { | 439 | .dev = { |
@@ -441,7 +441,7 @@ static struct platform_device mini2440_led1 __initdata = { | |||
441 | }, | 441 | }, |
442 | }; | 442 | }; |
443 | 443 | ||
444 | static struct platform_device mini2440_led2 __initdata = { | 444 | static struct platform_device mini2440_led2 = { |
445 | .name = "s3c24xx_led", | 445 | .name = "s3c24xx_led", |
446 | .id = 2, | 446 | .id = 2, |
447 | .dev = { | 447 | .dev = { |
@@ -449,7 +449,7 @@ static struct platform_device mini2440_led2 __initdata = { | |||
449 | }, | 449 | }, |
450 | }; | 450 | }; |
451 | 451 | ||
452 | static struct platform_device mini2440_led3 __initdata = { | 452 | static struct platform_device mini2440_led3 = { |
453 | .name = "s3c24xx_led", | 453 | .name = "s3c24xx_led", |
454 | .id = 3, | 454 | .id = 3, |
455 | .dev = { | 455 | .dev = { |
@@ -457,7 +457,7 @@ static struct platform_device mini2440_led3 __initdata = { | |||
457 | }, | 457 | }, |
458 | }; | 458 | }; |
459 | 459 | ||
460 | static struct platform_device mini2440_led4 __initdata = { | 460 | static struct platform_device mini2440_led4 = { |
461 | .name = "s3c24xx_led", | 461 | .name = "s3c24xx_led", |
462 | .id = 4, | 462 | .id = 4, |
463 | .dev = { | 463 | .dev = { |
@@ -465,7 +465,7 @@ static struct platform_device mini2440_led4 __initdata = { | |||
465 | }, | 465 | }, |
466 | }; | 466 | }; |
467 | 467 | ||
468 | static struct platform_device mini2440_led_backlight __initdata = { | 468 | static struct platform_device mini2440_led_backlight = { |
469 | .name = "s3c24xx_led", | 469 | .name = "s3c24xx_led", |
470 | .id = 5, | 470 | .id = 5, |
471 | .dev = { | 471 | .dev = { |
@@ -475,14 +475,14 @@ static struct platform_device mini2440_led_backlight __initdata = { | |||
475 | 475 | ||
476 | /* AUDIO */ | 476 | /* AUDIO */ |
477 | 477 | ||
478 | static struct s3c24xx_uda134x_platform_data mini2440_audio_pins __initdata = { | 478 | static struct s3c24xx_uda134x_platform_data mini2440_audio_pins = { |
479 | .l3_clk = S3C2410_GPB(4), | 479 | .l3_clk = S3C2410_GPB(4), |
480 | .l3_mode = S3C2410_GPB(2), | 480 | .l3_mode = S3C2410_GPB(2), |
481 | .l3_data = S3C2410_GPB(3), | 481 | .l3_data = S3C2410_GPB(3), |
482 | .model = UDA134X_UDA1341 | 482 | .model = UDA134X_UDA1341 |
483 | }; | 483 | }; |
484 | 484 | ||
485 | static struct platform_device mini2440_audio __initdata = { | 485 | static struct platform_device mini2440_audio = { |
486 | .name = "s3c24xx_uda134x", | 486 | .name = "s3c24xx_uda134x", |
487 | .id = 0, | 487 | .id = 0, |
488 | .dev = { | 488 | .dev = { |
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 480d297c1de2..8969fe73b83f 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c | |||
@@ -211,6 +211,7 @@ static struct fixed_voltage_config smdk6410_b_pwr_5v_pdata = { | |||
211 | .supply_name = "B_PWR_5V", | 211 | .supply_name = "B_PWR_5V", |
212 | .microvolts = 5000000, | 212 | .microvolts = 5000000, |
213 | .init_data = &smdk6410_b_pwr_5v_data, | 213 | .init_data = &smdk6410_b_pwr_5v_data, |
214 | .gpio = -EINVAL, | ||
214 | }; | 215 | }; |
215 | 216 | ||
216 | static struct platform_device smdk6410_b_pwr_5v = { | 217 | static struct platform_device smdk6410_b_pwr_5v = { |
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c index 84808ccda70e..a52fb6cf618f 100644 --- a/arch/arm/plat-s3c/dev-nand.c +++ b/arch/arm/plat-s3c/dev-nand.c | |||
@@ -58,8 +58,8 @@ static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set) | |||
58 | return -ENOMEM; | 58 | return -ENOMEM; |
59 | } | 59 | } |
60 | 60 | ||
61 | size = sizeof(int) * set->nr_chips; | 61 | if (set->nr_map && set->nr_chips) { |
62 | if (size) { | 62 | size = sizeof(int) * set->nr_chips; |
63 | ptr = kmemdup(set->nr_map, size, GFP_KERNEL); | 63 | ptr = kmemdup(set->nr_map, size, GFP_KERNEL); |
64 | set->nr_map = ptr; | 64 | set->nr_map = ptr; |
65 | 65 | ||
diff --git a/arch/m68knommu/platform/coldfire/pit.c b/arch/m68knommu/platform/coldfire/pit.c index d8720ee34510..aebea19abd78 100644 --- a/arch/m68knommu/platform/coldfire/pit.c +++ b/arch/m68knommu/platform/coldfire/pit.c | |||
@@ -146,7 +146,6 @@ static struct clocksource pit_clk = { | |||
146 | .read = pit_read_clk, | 146 | .read = pit_read_clk, |
147 | .shift = 20, | 147 | .shift = 20, |
148 | .mask = CLOCKSOURCE_MASK(32), | 148 | .mask = CLOCKSOURCE_MASK(32), |
149 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
150 | }; | 149 | }; |
151 | 150 | ||
152 | /***************************************************************************/ | 151 | /***************************************************************************/ |
diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h index efb74fd5156e..b1066b9fb5f8 100644 --- a/arch/s390/include/asm/bug.h +++ b/arch/s390/include/asm/bug.h | |||
@@ -52,6 +52,10 @@ | |||
52 | unreachable(); \ | 52 | unreachable(); \ |
53 | } while (0) | 53 | } while (0) |
54 | 54 | ||
55 | #define __WARN() do { \ | ||
56 | __EMIT_BUG(BUGFLAG_WARNING); \ | ||
57 | } while (0) | ||
58 | |||
55 | #define WARN_ON(x) ({ \ | 59 | #define WARN_ON(x) ({ \ |
56 | int __ret_warn_on = !!(x); \ | 60 | int __ret_warn_on = !!(x); \ |
57 | if (__builtin_constant_p(__ret_warn_on)) { \ | 61 | if (__builtin_constant_p(__ret_warn_on)) { \ |
diff --git a/arch/s390/include/asm/sigp.h b/arch/s390/include/asm/sigp.h index ec403d4304f8..f72d611f7e13 100644 --- a/arch/s390/include/asm/sigp.h +++ b/arch/s390/include/asm/sigp.h | |||
@@ -15,11 +15,19 @@ | |||
15 | #ifndef __SIGP__ | 15 | #ifndef __SIGP__ |
16 | #define __SIGP__ | 16 | #define __SIGP__ |
17 | 17 | ||
18 | #include <asm/ptrace.h> | 18 | #include <asm/system.h> |
19 | #include <asm/atomic.h> | ||
20 | 19 | ||
21 | /* get real cpu address from logical cpu number */ | 20 | /* get real cpu address from logical cpu number */ |
22 | extern volatile int __cpu_logical_map[]; | 21 | extern int __cpu_logical_map[]; |
22 | |||
23 | static inline int cpu_logical_map(int cpu) | ||
24 | { | ||
25 | #ifdef CONFIG_SMP | ||
26 | return __cpu_logical_map[cpu]; | ||
27 | #else | ||
28 | return stap(); | ||
29 | #endif | ||
30 | } | ||
23 | 31 | ||
24 | typedef enum | 32 | typedef enum |
25 | { | 33 | { |
@@ -79,7 +87,7 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code) | |||
79 | " ipm %0\n" | 87 | " ipm %0\n" |
80 | " srl %0,28\n" | 88 | " srl %0,28\n" |
81 | : "=d" (ccode) | 89 | : "=d" (ccode) |
82 | : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), | 90 | : "d" (reg1), "d" (cpu_logical_map(cpu_addr)), |
83 | "a" (order_code) : "cc" , "memory"); | 91 | "a" (order_code) : "cc" , "memory"); |
84 | return ccode; | 92 | return ccode; |
85 | } | 93 | } |
@@ -98,7 +106,7 @@ signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code) | |||
98 | " ipm %0\n" | 106 | " ipm %0\n" |
99 | " srl %0,28\n" | 107 | " srl %0,28\n" |
100 | : "=d" (ccode) | 108 | : "=d" (ccode) |
101 | : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), | 109 | : "d" (reg1), "d" (cpu_logical_map(cpu_addr)), |
102 | "a" (order_code) : "cc" , "memory"); | 110 | "a" (order_code) : "cc" , "memory"); |
103 | return ccode; | 111 | return ccode; |
104 | } | 112 | } |
@@ -118,7 +126,7 @@ signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr, | |||
118 | " ipm %0\n" | 126 | " ipm %0\n" |
119 | " srl %0,28\n" | 127 | " srl %0,28\n" |
120 | : "=d" (ccode), "+d" (reg1) | 128 | : "=d" (ccode), "+d" (reg1) |
121 | : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) | 129 | : "d" (cpu_logical_map(cpu_addr)), "a" (order_code) |
122 | : "cc" , "memory"); | 130 | : "cc" , "memory"); |
123 | *statusptr = reg1; | 131 | *statusptr = reg1; |
124 | return ccode; | 132 | return ccode; |
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h index 07eb61b2fb3a..66069e736842 100644 --- a/arch/s390/include/asm/thread_info.h +++ b/arch/s390/include/asm/thread_info.h | |||
@@ -93,13 +93,12 @@ static inline struct thread_info *current_thread_info(void) | |||
93 | #define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */ | 93 | #define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */ |
94 | #define TIF_SECCOMP 10 /* secure computing */ | 94 | #define TIF_SECCOMP 10 /* secure computing */ |
95 | #define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint instrumentation */ | 95 | #define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint instrumentation */ |
96 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | 96 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling |
97 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling | ||
98 | TIF_NEED_RESCHED */ | 97 | TIF_NEED_RESCHED */ |
99 | #define TIF_31BIT 18 /* 32bit process */ | 98 | #define TIF_31BIT 17 /* 32bit process */ |
100 | #define TIF_MEMDIE 19 | 99 | #define TIF_MEMDIE 18 |
101 | #define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */ | 100 | #define TIF_RESTORE_SIGMASK 19 /* restore signal mask in do_signal() */ |
102 | #define TIF_FREEZE 21 /* thread is freezing for suspend */ | 101 | #define TIF_FREEZE 20 /* thread is freezing for suspend */ |
103 | 102 | ||
104 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 103 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
105 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 104 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
@@ -112,7 +111,6 @@ static inline struct thread_info *current_thread_info(void) | |||
112 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 111 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
113 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 112 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
114 | #define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) | 113 | #define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) |
115 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | ||
116 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 114 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
117 | #define _TIF_31BIT (1<<TIF_31BIT) | 115 | #define _TIF_31BIT (1<<TIF_31BIT) |
118 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 116 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index 192a7203a14f..6e9f049fa823 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h | |||
@@ -269,8 +269,7 @@ | |||
269 | #define __NR_pwritev 329 | 269 | #define __NR_pwritev 329 |
270 | #define __NR_rt_tgsigqueueinfo 330 | 270 | #define __NR_rt_tgsigqueueinfo 330 |
271 | #define __NR_perf_event_open 331 | 271 | #define __NR_perf_event_open 331 |
272 | #define __NR_recvmmsg 332 | 272 | #define NR_syscalls 332 |
273 | #define NR_syscalls 333 | ||
274 | 273 | ||
275 | /* | 274 | /* |
276 | * There are some system calls that are not present on 64 bit, some | 275 | * There are some system calls that are not present on 64 bit, some |
@@ -377,6 +376,9 @@ | |||
377 | #define __IGNORE_migrate_pages | 376 | #define __IGNORE_migrate_pages |
378 | #define __IGNORE_move_pages | 377 | #define __IGNORE_move_pages |
379 | 378 | ||
379 | /* Ignore system calls that are also reachable via sys_socket */ | ||
380 | #define __IGNORE_recvmmsg | ||
381 | |||
380 | #define __ARCH_WANT_IPC_PARSE_VERSION | 382 | #define __ARCH_WANT_IPC_PARSE_VERSION |
381 | #define __ARCH_WANT_OLD_READDIR | 383 | #define __ARCH_WANT_OLD_READDIR |
382 | #define __ARCH_WANT_SYS_ALARM | 384 | #define __ARCH_WANT_SYS_ALARM |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 22c9e557bb22..11c3aba664ea 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -616,44 +616,35 @@ asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, | |||
616 | */ | 616 | */ |
617 | 617 | ||
618 | struct mmap_arg_struct_emu31 { | 618 | struct mmap_arg_struct_emu31 { |
619 | u32 addr; | 619 | compat_ulong_t addr; |
620 | u32 len; | 620 | compat_ulong_t len; |
621 | u32 prot; | 621 | compat_ulong_t prot; |
622 | u32 flags; | 622 | compat_ulong_t flags; |
623 | u32 fd; | 623 | compat_ulong_t fd; |
624 | u32 offset; | 624 | compat_ulong_t offset; |
625 | }; | 625 | }; |
626 | 626 | ||
627 | asmlinkage unsigned long | 627 | asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg) |
628 | old32_mmap(struct mmap_arg_struct_emu31 __user *arg) | ||
629 | { | 628 | { |
630 | struct mmap_arg_struct_emu31 a; | 629 | struct mmap_arg_struct_emu31 a; |
631 | int error = -EFAULT; | ||
632 | 630 | ||
633 | if (copy_from_user(&a, arg, sizeof(a))) | 631 | if (copy_from_user(&a, arg, sizeof(a))) |
634 | goto out; | 632 | return -EFAULT; |
635 | |||
636 | error = -EINVAL; | ||
637 | if (a.offset & ~PAGE_MASK) | 633 | if (a.offset & ~PAGE_MASK) |
638 | goto out; | 634 | return -EINVAL; |
639 | 635 | a.addr = (unsigned long) compat_ptr(a.addr); | |
640 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, | 636 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, |
641 | a.offset >> PAGE_SHIFT); | 637 | a.offset >> PAGE_SHIFT); |
642 | out: | ||
643 | return error; | ||
644 | } | 638 | } |
645 | 639 | ||
646 | asmlinkage long | 640 | asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) |
647 | sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) | ||
648 | { | 641 | { |
649 | struct mmap_arg_struct_emu31 a; | 642 | struct mmap_arg_struct_emu31 a; |
650 | int error = -EFAULT; | ||
651 | 643 | ||
652 | if (copy_from_user(&a, arg, sizeof(a))) | 644 | if (copy_from_user(&a, arg, sizeof(a))) |
653 | goto out; | 645 | return -EFAULT; |
654 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); | 646 | a.addr = (unsigned long) compat_ptr(a.addr); |
655 | out: | 647 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); |
656 | return error; | ||
657 | } | 648 | } |
658 | 649 | ||
659 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) | 650 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index faeaccc7d7d9..30de2d0e52bb 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1853,12 +1853,3 @@ sys32_execve_wrapper: | |||
1853 | llgtr %r3,%r3 # compat_uptr_t * | 1853 | llgtr %r3,%r3 # compat_uptr_t * |
1854 | llgtr %r4,%r4 # compat_uptr_t * | 1854 | llgtr %r4,%r4 # compat_uptr_t * |
1855 | jg sys32_execve # branch to system call | 1855 | jg sys32_execve # branch to system call |
1856 | |||
1857 | .globl compat_sys_recvmmsg_wrapper | ||
1858 | compat_sys_recvmmsg_wrapper: | ||
1859 | lgfr %r2,%r2 # int | ||
1860 | llgtr %r3,%r3 # struct compat_mmsghdr * | ||
1861 | llgfr %r4,%r4 # unsigned int | ||
1862 | llgfr %r5,%r5 # unsigned int | ||
1863 | llgtr %r6,%r6 # struct compat_timespec * | ||
1864 | jg compat_sys_recvmmsg | ||
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 5417eb57271a..00b6d1d292f2 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -153,8 +153,6 @@ void exit_thread(void) | |||
153 | 153 | ||
154 | void flush_thread(void) | 154 | void flush_thread(void) |
155 | { | 155 | { |
156 | clear_used_math(); | ||
157 | clear_tsk_thread_flag(current, TIF_USEDFPU); | ||
158 | } | 156 | } |
159 | 157 | ||
160 | void release_thread(struct task_struct *dead_task) | 158 | void release_thread(struct task_struct *dead_task) |
@@ -217,6 +215,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, | |||
217 | p->thread.mm_segment = get_fs(); | 215 | p->thread.mm_segment = get_fs(); |
218 | /* Don't copy debug registers */ | 216 | /* Don't copy debug registers */ |
219 | memset(&p->thread.per_info, 0, sizeof(p->thread.per_info)); | 217 | memset(&p->thread.per_info, 0, sizeof(p->thread.per_info)); |
218 | clear_tsk_thread_flag(p, TIF_SINGLE_STEP); | ||
220 | /* Initialize per thread user and system timer values */ | 219 | /* Initialize per thread user and system timer values */ |
221 | ti = task_thread_info(p); | 220 | ti = task_thread_info(p); |
222 | ti->user_timer = 0; | 221 | ti->user_timer = 0; |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 13815d39f7dd..7cf464234419 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -65,6 +65,7 @@ FixPerRegisters(struct task_struct *task) | |||
65 | { | 65 | { |
66 | struct pt_regs *regs; | 66 | struct pt_regs *regs; |
67 | per_struct *per_info; | 67 | per_struct *per_info; |
68 | per_cr_words cr_words; | ||
68 | 69 | ||
69 | regs = task_pt_regs(task); | 70 | regs = task_pt_regs(task); |
70 | per_info = (per_struct *) &task->thread.per_info; | 71 | per_info = (per_struct *) &task->thread.per_info; |
@@ -98,6 +99,13 @@ FixPerRegisters(struct task_struct *task) | |||
98 | per_info->control_regs.bits.storage_alt_space_ctl = 1; | 99 | per_info->control_regs.bits.storage_alt_space_ctl = 1; |
99 | else | 100 | else |
100 | per_info->control_regs.bits.storage_alt_space_ctl = 0; | 101 | per_info->control_regs.bits.storage_alt_space_ctl = 0; |
102 | |||
103 | if (task == current) { | ||
104 | __ctl_store(cr_words, 9, 11); | ||
105 | if (memcmp(&cr_words, &per_info->control_regs.words, | ||
106 | sizeof(cr_words)) != 0) | ||
107 | __ctl_load(per_info->control_regs.words, 9, 11); | ||
108 | } | ||
101 | } | 109 | } |
102 | 110 | ||
103 | void user_enable_single_step(struct task_struct *task) | 111 | void user_enable_single_step(struct task_struct *task) |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 0663287fa1b3..8d8957b38ab3 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -87,7 +87,6 @@ unsigned long elf_hwcap = 0; | |||
87 | char elf_platform[ELF_PLATFORM_SIZE]; | 87 | char elf_platform[ELF_PLATFORM_SIZE]; |
88 | 88 | ||
89 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; | 89 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; |
90 | volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ | ||
91 | 90 | ||
92 | int __initdata memory_end_set; | 91 | int __initdata memory_end_set; |
93 | unsigned long __initdata memory_end; | 92 | unsigned long __initdata memory_end; |
@@ -124,12 +123,6 @@ void __cpuinit cpu_init(void) | |||
124 | */ | 123 | */ |
125 | get_cpu_id(&S390_lowcore.cpu_id); | 124 | get_cpu_id(&S390_lowcore.cpu_id); |
126 | 125 | ||
127 | /* | ||
128 | * Force FPU initialization: | ||
129 | */ | ||
130 | clear_thread_flag(TIF_USEDFPU); | ||
131 | clear_used_math(); | ||
132 | |||
133 | atomic_inc(&init_mm.mm_count); | 126 | atomic_inc(&init_mm.mm_count); |
134 | current->active_mm = &init_mm; | 127 | current->active_mm = &init_mm; |
135 | BUG_ON(current->mm); | 128 | BUG_ON(current->mm); |
@@ -855,7 +848,6 @@ setup_arch(char **cmdline_p) | |||
855 | setup_lowcore(); | 848 | setup_lowcore(); |
856 | 849 | ||
857 | cpu_init(); | 850 | cpu_init(); |
858 | __cpu_logical_map[0] = stap(); | ||
859 | s390_init_cpu_topology(); | 851 | s390_init_cpu_topology(); |
860 | 852 | ||
861 | /* | 853 | /* |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 6b4fef877f9d..1675c48b9145 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -500,18 +500,10 @@ void do_signal(struct pt_regs *regs) | |||
500 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 500 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
501 | 501 | ||
502 | /* | 502 | /* |
503 | * If we would have taken a single-step trap | ||
504 | * for a normal instruction, act like we took | ||
505 | * one for the handler setup. | ||
506 | */ | ||
507 | if (current->thread.per_info.single_step) | ||
508 | set_thread_flag(TIF_SINGLE_STEP); | ||
509 | |||
510 | /* | ||
511 | * Let tracing know that we've done the handler setup. | 503 | * Let tracing know that we've done the handler setup. |
512 | */ | 504 | */ |
513 | tracehook_signal_handler(signr, &info, &ka, regs, | 505 | tracehook_signal_handler(signr, &info, &ka, regs, |
514 | test_thread_flag(TIF_SINGLE_STEP)); | 506 | current->thread.per_info.single_step); |
515 | } | 507 | } |
516 | return; | 508 | return; |
517 | } | 509 | } |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 93e52039321b..76a6fdd46c45 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -52,6 +52,9 @@ | |||
52 | #include <asm/cpu.h> | 52 | #include <asm/cpu.h> |
53 | #include "entry.h" | 53 | #include "entry.h" |
54 | 54 | ||
55 | /* logical cpu to cpu address */ | ||
56 | int __cpu_logical_map[NR_CPUS]; | ||
57 | |||
55 | static struct task_struct *current_set[NR_CPUS]; | 58 | static struct task_struct *current_set[NR_CPUS]; |
56 | 59 | ||
57 | static u8 smp_cpu_type; | 60 | static u8 smp_cpu_type; |
@@ -717,6 +720,12 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
717 | { | 720 | { |
718 | } | 721 | } |
719 | 722 | ||
723 | void __init smp_setup_processor_id(void) | ||
724 | { | ||
725 | S390_lowcore.cpu_nr = 0; | ||
726 | __cpu_logical_map[0] = stap(); | ||
727 | } | ||
728 | |||
720 | /* | 729 | /* |
721 | * the frequency of the profiling timer can be changed | 730 | * the frequency of the profiling timer can be changed |
722 | * by writing a multiplier value into /proc/profile. | 731 | * by writing a multiplier value into /proc/profile. |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 4f292c936872..30eca070d426 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -340,4 +340,3 @@ SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper) | |||
340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper) | 340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper) |
341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */ | 341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */ |
342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) | 342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) |
343 | SYSCALL(sys_recvmmsg,sys_recvmmsg,compat_sys_recvmmsg_wrapper) | ||
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 3c72c9cf22b6..14ef6f05e432 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -114,7 +114,7 @@ static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core) | |||
114 | 114 | ||
115 | rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin; | 115 | rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin; |
116 | for_each_present_cpu(lcpu) { | 116 | for_each_present_cpu(lcpu) { |
117 | if (__cpu_logical_map[lcpu] == rcpu) { | 117 | if (cpu_logical_map(lcpu) == rcpu) { |
118 | cpu_set(lcpu, core->mask); | 118 | cpu_set(lcpu, core->mask); |
119 | smp_cpu_polarization[lcpu] = tl_cpu->pp; | 119 | smp_cpu_polarization[lcpu] = tl_cpu->pp; |
120 | } | 120 | } |
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c index 10754a375668..cff327f109a8 100644 --- a/arch/s390/lib/spinlock.c +++ b/arch/s390/lib/spinlock.c | |||
@@ -34,7 +34,7 @@ static inline void _raw_yield_cpu(int cpu) | |||
34 | { | 34 | { |
35 | if (MACHINE_HAS_DIAG9C) | 35 | if (MACHINE_HAS_DIAG9C) |
36 | asm volatile("diag %0,0,0x9c" | 36 | asm volatile("diag %0,0,0x9c" |
37 | : : "d" (__cpu_logical_map[cpu])); | 37 | : : "d" (cpu_logical_map(cpu))); |
38 | else | 38 | else |
39 | _raw_yield(); | 39 | _raw_yield(); |
40 | } | 40 | } |
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c index f4558ccf02b9..869efbaed3ea 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | static inline unsigned long mmap_base(void) | 41 | static inline unsigned long mmap_base(void) |
42 | { | 42 | { |
43 | unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; | 43 | unsigned long gap = rlimit(RLIMIT_STACK); |
44 | 44 | ||
45 | if (gap < MIN_GAP) | 45 | if (gap < MIN_GAP) |
46 | gap = MIN_GAP; | 46 | gap = MIN_GAP; |
@@ -61,7 +61,7 @@ static inline int mmap_is_legacy(void) | |||
61 | #endif | 61 | #endif |
62 | return sysctl_legacy_va_layout || | 62 | return sysctl_legacy_va_layout || |
63 | (current->personality & ADDR_COMPAT_LAYOUT) || | 63 | (current->personality & ADDR_COMPAT_LAYOUT) || |
64 | current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY; | 64 | rlimit(RLIMIT_STACK) == RLIM_INFINITY; |
65 | } | 65 | } |
66 | 66 | ||
67 | #ifndef CONFIG_64BIT | 67 | #ifndef CONFIG_64BIT |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 6a8861b39f05..5c246289b4f0 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -353,6 +353,10 @@ static struct i2c_board_info i2c1_devices[] = { | |||
353 | { | 353 | { |
354 | I2C_BOARD_INFO("r2025sd", 0x32), | 354 | I2C_BOARD_INFO("r2025sd", 0x32), |
355 | }, | 355 | }, |
356 | { | ||
357 | I2C_BOARD_INFO("lis3lv02d", 0x1c), | ||
358 | .irq = 33, | ||
359 | } | ||
356 | }; | 360 | }; |
357 | 361 | ||
358 | /* KEYSC */ | 362 | /* KEYSC */ |
@@ -1115,6 +1119,10 @@ static int __init arch_setup(void) | |||
1115 | gpio_direction_output(GPIO_PTU0, 0); | 1119 | gpio_direction_output(GPIO_PTU0, 0); |
1116 | mdelay(20); | 1120 | mdelay(20); |
1117 | 1121 | ||
1122 | /* enable motion sensor */ | ||
1123 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); | ||
1124 | gpio_direction_input(GPIO_FN_INTC_IRQ1); | ||
1125 | |||
1118 | /* enable I2C device */ | 1126 | /* enable I2C device */ |
1119 | i2c_register_board_info(0, i2c0_devices, | 1127 | i2c_register_board_info(0, i2c0_devices, |
1120 | ARRAY_SIZE(i2c0_devices)); | 1128 | ARRAY_SIZE(i2c0_devices)); |
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 858baa061cfc..6c3fdd631ed3 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -108,10 +108,11 @@ struct mce_log { | |||
108 | #define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) | 108 | #define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) |
109 | #define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) | 109 | #define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) |
110 | 110 | ||
111 | extern struct atomic_notifier_head x86_mce_decoder_chain; | ||
112 | 111 | ||
113 | #ifdef __KERNEL__ | 112 | #ifdef __KERNEL__ |
114 | 113 | ||
114 | extern struct atomic_notifier_head x86_mce_decoder_chain; | ||
115 | |||
115 | #include <linux/percpu.h> | 116 | #include <linux/percpu.h> |
116 | #include <linux/init.h> | 117 | #include <linux/init.h> |
117 | #include <asm/atomic.h> | 118 | #include <asm/atomic.h> |
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index bc54fa965af3..40be813fefb1 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -495,5 +495,17 @@ static inline void uv_hub_send_ipi(int pnode, int apicid, int vector) | |||
495 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | 495 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
496 | } | 496 | } |
497 | 497 | ||
498 | /* | ||
499 | * Get the minimum revision number of the hub chips within the partition. | ||
500 | * 1 - initial rev 1.0 silicon | ||
501 | * 2 - rev 2.0 production silicon | ||
502 | */ | ||
503 | static inline int uv_get_min_hub_revision_id(void) | ||
504 | { | ||
505 | extern int uv_min_hub_revision_id; | ||
506 | |||
507 | return uv_min_hub_revision_id; | ||
508 | } | ||
509 | |||
498 | #endif /* CONFIG_X86_64 */ | 510 | #endif /* CONFIG_X86_64 */ |
499 | #endif /* _ASM_X86_UV_UV_HUB_H */ | 511 | #endif /* _ASM_X86_UV_UV_HUB_H */ |
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index 3704997e8b25..f147a95fd84a 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <asm/x86_init.h> | 31 | #include <asm/x86_init.h> |
32 | 32 | ||
33 | int gart_iommu_aperture; | 33 | int gart_iommu_aperture; |
34 | EXPORT_SYMBOL_GPL(gart_iommu_aperture); | ||
34 | int gart_iommu_aperture_disabled __initdata; | 35 | int gart_iommu_aperture_disabled __initdata; |
35 | int gart_iommu_aperture_allowed __initdata; | 36 | int gart_iommu_aperture_allowed __initdata; |
36 | 37 | ||
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 5f92494dab61..21db3cbea7dc 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -36,6 +36,8 @@ DEFINE_PER_CPU(int, x2apic_extra_bits); | |||
36 | 36 | ||
37 | static enum uv_system_type uv_system_type; | 37 | static enum uv_system_type uv_system_type; |
38 | static u64 gru_start_paddr, gru_end_paddr; | 38 | static u64 gru_start_paddr, gru_end_paddr; |
39 | int uv_min_hub_revision_id; | ||
40 | EXPORT_SYMBOL_GPL(uv_min_hub_revision_id); | ||
39 | 41 | ||
40 | static inline bool is_GRU_range(u64 start, u64 end) | 42 | static inline bool is_GRU_range(u64 start, u64 end) |
41 | { | 43 | { |
@@ -55,12 +57,19 @@ static int early_get_nodeid(void) | |||
55 | mmr = early_ioremap(UV_LOCAL_MMR_BASE | UVH_NODE_ID, sizeof(*mmr)); | 57 | mmr = early_ioremap(UV_LOCAL_MMR_BASE | UVH_NODE_ID, sizeof(*mmr)); |
56 | node_id.v = *mmr; | 58 | node_id.v = *mmr; |
57 | early_iounmap(mmr, sizeof(*mmr)); | 59 | early_iounmap(mmr, sizeof(*mmr)); |
60 | |||
61 | /* Currently, all blades have same revision number */ | ||
62 | uv_min_hub_revision_id = node_id.s.revision; | ||
63 | |||
58 | return node_id.s.node_id; | 64 | return node_id.s.node_id; |
59 | } | 65 | } |
60 | 66 | ||
61 | static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 67 | static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
62 | { | 68 | { |
69 | int nodeid; | ||
70 | |||
63 | if (!strcmp(oem_id, "SGI")) { | 71 | if (!strcmp(oem_id, "SGI")) { |
72 | nodeid = early_get_nodeid(); | ||
64 | x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; | 73 | x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; |
65 | if (!strcmp(oem_table_id, "UVL")) | 74 | if (!strcmp(oem_table_id, "UVL")) |
66 | uv_system_type = UV_LEGACY_APIC; | 75 | uv_system_type = UV_LEGACY_APIC; |
@@ -68,7 +77,7 @@ static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
68 | uv_system_type = UV_X2APIC; | 77 | uv_system_type = UV_X2APIC; |
69 | else if (!strcmp(oem_table_id, "UVH")) { | 78 | else if (!strcmp(oem_table_id, "UVH")) { |
70 | __get_cpu_var(x2apic_extra_bits) = | 79 | __get_cpu_var(x2apic_extra_bits) = |
71 | early_get_nodeid() << (UV_APIC_PNODE_SHIFT - 1); | 80 | nodeid << (UV_APIC_PNODE_SHIFT - 1); |
72 | uv_system_type = UV_NON_UNIQUE_APIC; | 81 | uv_system_type = UV_NON_UNIQUE_APIC; |
73 | return 1; | 82 | return 1; |
74 | } | 83 | } |
@@ -374,13 +383,13 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) | |||
374 | 383 | ||
375 | enum map_type {map_wb, map_uc}; | 384 | enum map_type {map_wb, map_uc}; |
376 | 385 | ||
377 | static __init void map_high(char *id, unsigned long base, int shift, | 386 | static __init void map_high(char *id, unsigned long base, int pshift, |
378 | int max_pnode, enum map_type map_type) | 387 | int bshift, int max_pnode, enum map_type map_type) |
379 | { | 388 | { |
380 | unsigned long bytes, paddr; | 389 | unsigned long bytes, paddr; |
381 | 390 | ||
382 | paddr = base << shift; | 391 | paddr = base << pshift; |
383 | bytes = (1UL << shift) * (max_pnode + 1); | 392 | bytes = (1UL << bshift) * (max_pnode + 1); |
384 | printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr, | 393 | printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr, |
385 | paddr + bytes); | 394 | paddr + bytes); |
386 | if (map_type == map_uc) | 395 | if (map_type == map_uc) |
@@ -396,7 +405,7 @@ static __init void map_gru_high(int max_pnode) | |||
396 | 405 | ||
397 | gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR); | 406 | gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR); |
398 | if (gru.s.enable) { | 407 | if (gru.s.enable) { |
399 | map_high("GRU", gru.s.base, shift, max_pnode, map_wb); | 408 | map_high("GRU", gru.s.base, shift, shift, max_pnode, map_wb); |
400 | gru_start_paddr = ((u64)gru.s.base << shift); | 409 | gru_start_paddr = ((u64)gru.s.base << shift); |
401 | gru_end_paddr = gru_start_paddr + (1UL << shift) * (max_pnode + 1); | 410 | gru_end_paddr = gru_start_paddr + (1UL << shift) * (max_pnode + 1); |
402 | 411 | ||
@@ -410,7 +419,7 @@ static __init void map_mmr_high(int max_pnode) | |||
410 | 419 | ||
411 | mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR); | 420 | mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR); |
412 | if (mmr.s.enable) | 421 | if (mmr.s.enable) |
413 | map_high("MMR", mmr.s.base, shift, max_pnode, map_uc); | 422 | map_high("MMR", mmr.s.base, shift, shift, max_pnode, map_uc); |
414 | } | 423 | } |
415 | 424 | ||
416 | static __init void map_mmioh_high(int max_pnode) | 425 | static __init void map_mmioh_high(int max_pnode) |
@@ -420,7 +429,8 @@ static __init void map_mmioh_high(int max_pnode) | |||
420 | 429 | ||
421 | mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); | 430 | mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); |
422 | if (mmioh.s.enable) | 431 | if (mmioh.s.enable) |
423 | map_high("MMIOH", mmioh.s.base, shift, max_pnode, map_uc); | 432 | map_high("MMIOH", mmioh.s.base, shift, mmioh.s.m_io, |
433 | max_pnode, map_uc); | ||
424 | } | 434 | } |
425 | 435 | ||
426 | static __init void map_low_mmrs(void) | 436 | static __init void map_low_mmrs(void) |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index c56bc2873030..6d817554780a 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -123,13 +123,15 @@ print_context_stack_bp(struct thread_info *tinfo, | |||
123 | while (valid_stack_ptr(tinfo, ret_addr, sizeof(*ret_addr), end)) { | 123 | while (valid_stack_ptr(tinfo, ret_addr, sizeof(*ret_addr), end)) { |
124 | unsigned long addr = *ret_addr; | 124 | unsigned long addr = *ret_addr; |
125 | 125 | ||
126 | if (__kernel_text_address(addr)) { | 126 | if (!__kernel_text_address(addr)) |
127 | ops->address(data, addr, 1); | 127 | break; |
128 | frame = frame->next_frame; | 128 | |
129 | ret_addr = &frame->return_address; | 129 | ops->address(data, addr, 1); |
130 | print_ftrace_graph_addr(addr, data, ops, tinfo, graph); | 130 | frame = frame->next_frame; |
131 | } | 131 | ret_addr = &frame->return_address; |
132 | print_ftrace_graph_addr(addr, data, ops, tinfo, graph); | ||
132 | } | 133 | } |
134 | |||
133 | return (unsigned long)frame; | 135 | return (unsigned long)frame; |
134 | } | 136 | } |
135 | EXPORT_SYMBOL_GPL(print_context_stack_bp); | 137 | EXPORT_SYMBOL_GPL(print_context_stack_bp); |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index c6ee241c8a98..02c3ee013ccd 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -288,6 +288,8 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | |||
288 | regs.es = __USER_DS; | 288 | regs.es = __USER_DS; |
289 | regs.fs = __KERNEL_PERCPU; | 289 | regs.fs = __KERNEL_PERCPU; |
290 | regs.gs = __KERNEL_STACK_CANARY; | 290 | regs.gs = __KERNEL_STACK_CANARY; |
291 | #else | ||
292 | regs.ss = __KERNEL_DS; | ||
291 | #endif | 293 | #endif |
292 | 294 | ||
293 | regs.orig_ax = -1; | 295 | regs.orig_ax = -1; |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 2b26dd5930c6..36daccb68642 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1151,9 +1151,13 @@ asmlinkage void __init xen_start_kernel(void) | |||
1151 | 1151 | ||
1152 | /* keep using Xen gdt for now; no urgent need to change it */ | 1152 | /* keep using Xen gdt for now; no urgent need to change it */ |
1153 | 1153 | ||
1154 | #ifdef CONFIG_X86_32 | ||
1154 | pv_info.kernel_rpl = 1; | 1155 | pv_info.kernel_rpl = 1; |
1155 | if (xen_feature(XENFEAT_supervisor_mode_kernel)) | 1156 | if (xen_feature(XENFEAT_supervisor_mode_kernel)) |
1156 | pv_info.kernel_rpl = 0; | 1157 | pv_info.kernel_rpl = 0; |
1158 | #else | ||
1159 | pv_info.kernel_rpl = 0; | ||
1160 | #endif | ||
1157 | 1161 | ||
1158 | /* set the limit of our address space */ | 1162 | /* set the limit of our address space */ |
1159 | xen_reserve_top(); | 1163 | xen_reserve_top(); |
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index d7d77d4a402c..ae6b6c43cff9 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -309,17 +309,19 @@ static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL); | |||
309 | * Block size attribute stuff | 309 | * Block size attribute stuff |
310 | */ | 310 | */ |
311 | static ssize_t | 311 | static ssize_t |
312 | print_block_size(struct class *class, char *buf) | 312 | print_block_size(struct sysdev_class *class, |
313 | struct sysdev_class_attribute *class_attr, | ||
314 | char *buf) | ||
313 | { | 315 | { |
314 | return sprintf(buf, "%lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); | 316 | return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); |
315 | } | 317 | } |
316 | 318 | ||
317 | static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); | 319 | static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); |
318 | 320 | ||
319 | static int block_size_init(void) | 321 | static int block_size_init(void) |
320 | { | 322 | { |
321 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 323 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, |
322 | &class_attr_block_size_bytes.attr); | 324 | &attr_block_size_bytes.attr); |
323 | } | 325 | } |
324 | 326 | ||
325 | /* | 327 | /* |
@@ -330,7 +332,9 @@ static int block_size_init(void) | |||
330 | */ | 332 | */ |
331 | #ifdef CONFIG_ARCH_MEMORY_PROBE | 333 | #ifdef CONFIG_ARCH_MEMORY_PROBE |
332 | static ssize_t | 334 | static ssize_t |
333 | memory_probe_store(struct class *class, const char *buf, size_t count) | 335 | memory_probe_store(struct sysdev_class *class, |
336 | struct sysdev_class_attribute *class_attr, | ||
337 | const char *buf, size_t count) | ||
334 | { | 338 | { |
335 | u64 phys_addr; | 339 | u64 phys_addr; |
336 | int nid; | 340 | int nid; |
@@ -346,12 +350,12 @@ memory_probe_store(struct class *class, const char *buf, size_t count) | |||
346 | 350 | ||
347 | return count; | 351 | return count; |
348 | } | 352 | } |
349 | static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); | 353 | static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); |
350 | 354 | ||
351 | static int memory_probe_init(void) | 355 | static int memory_probe_init(void) |
352 | { | 356 | { |
353 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 357 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, |
354 | &class_attr_probe.attr); | 358 | &attr_probe.attr); |
355 | } | 359 | } |
356 | #else | 360 | #else |
357 | static inline int memory_probe_init(void) | 361 | static inline int memory_probe_init(void) |
@@ -367,7 +371,9 @@ static inline int memory_probe_init(void) | |||
367 | 371 | ||
368 | /* Soft offline a page */ | 372 | /* Soft offline a page */ |
369 | static ssize_t | 373 | static ssize_t |
370 | store_soft_offline_page(struct class *class, const char *buf, size_t count) | 374 | store_soft_offline_page(struct sysdev_class *class, |
375 | struct sysdev_class_attribute *class_attr, | ||
376 | const char *buf, size_t count) | ||
371 | { | 377 | { |
372 | int ret; | 378 | int ret; |
373 | u64 pfn; | 379 | u64 pfn; |
@@ -384,7 +390,9 @@ store_soft_offline_page(struct class *class, const char *buf, size_t count) | |||
384 | 390 | ||
385 | /* Forcibly offline a page, including killing processes. */ | 391 | /* Forcibly offline a page, including killing processes. */ |
386 | static ssize_t | 392 | static ssize_t |
387 | store_hard_offline_page(struct class *class, const char *buf, size_t count) | 393 | store_hard_offline_page(struct sysdev_class *class, |
394 | struct sysdev_class_attribute *class_attr, | ||
395 | const char *buf, size_t count) | ||
388 | { | 396 | { |
389 | int ret; | 397 | int ret; |
390 | u64 pfn; | 398 | u64 pfn; |
@@ -397,18 +405,18 @@ store_hard_offline_page(struct class *class, const char *buf, size_t count) | |||
397 | return ret ? ret : count; | 405 | return ret ? ret : count; |
398 | } | 406 | } |
399 | 407 | ||
400 | static CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); | 408 | static SYSDEV_CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); |
401 | static CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); | 409 | static SYSDEV_CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); |
402 | 410 | ||
403 | static __init int memory_fail_init(void) | 411 | static __init int memory_fail_init(void) |
404 | { | 412 | { |
405 | int err; | 413 | int err; |
406 | 414 | ||
407 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 415 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, |
408 | &class_attr_soft_offline_page.attr); | 416 | &attr_soft_offline_page.attr); |
409 | if (!err) | 417 | if (!err) |
410 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 418 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, |
411 | &class_attr_hard_offline_page.attr); | 419 | &attr_hard_offline_page.attr); |
412 | return err; | 420 | return err; |
413 | } | 421 | } |
414 | #else | 422 | #else |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 5aa7a586a7ff..1afb8968a342 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -725,12 +725,11 @@ static struct pci_driver agp_amd64_pci_driver = { | |||
725 | int __init agp_amd64_init(void) | 725 | int __init agp_amd64_init(void) |
726 | { | 726 | { |
727 | int err = 0; | 727 | int err = 0; |
728 | static int done = 0; | ||
729 | 728 | ||
730 | if (agp_off) | 729 | if (agp_off) |
731 | return -EINVAL; | 730 | return -EINVAL; |
732 | 731 | ||
733 | if (done++) | 732 | if (gart_iommu_aperture) |
734 | return agp_bridges_found ? 0 : -ENODEV; | 733 | return agp_bridges_found ? 0 : -ENODEV; |
735 | 734 | ||
736 | err = pci_register_driver(&agp_amd64_pci_driver); | 735 | err = pci_register_driver(&agp_amd64_pci_driver); |
@@ -771,6 +770,8 @@ int __init agp_amd64_init(void) | |||
771 | 770 | ||
772 | static void __exit agp_amd64_cleanup(void) | 771 | static void __exit agp_amd64_cleanup(void) |
773 | { | 772 | { |
773 | if (gart_iommu_aperture) | ||
774 | return; | ||
774 | if (aperture_resource) | 775 | if (aperture_resource) |
775 | release_resource(aperture_resource); | 776 | release_resource(aperture_resource); |
776 | pci_unregister_driver(&agp_amd64_pci_driver); | 777 | pci_unregister_driver(&agp_amd64_pci_driver); |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 30c36ac2cd00..3999a5f25f38 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -2460,10 +2460,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
2460 | &bridge->mode); | 2460 | &bridge->mode); |
2461 | } | 2461 | } |
2462 | 2462 | ||
2463 | if (bridge->driver->mask_memory == intel_i965_mask_memory) | 2463 | if (bridge->driver->mask_memory == intel_i965_mask_memory) { |
2464 | if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36))) | 2464 | if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36))) |
2465 | dev_err(&intel_private.pcidev->dev, | 2465 | dev_err(&intel_private.pcidev->dev, |
2466 | "set gfx device dma mask 36bit failed!\n"); | 2466 | "set gfx device dma mask 36bit failed!\n"); |
2467 | else | ||
2468 | pci_set_consistent_dma_mask(intel_private.pcidev, | ||
2469 | DMA_BIT_MASK(36)); | ||
2470 | } | ||
2467 | 2471 | ||
2468 | pci_set_drvdata(pdev, bridge); | 2472 | pci_set_drvdata(pdev, bridge); |
2469 | return agp_add_bridge(bridge); | 2473 | return agp_add_bridge(bridge); |
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index bdaef8e94021..64fe0a793efd 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -114,7 +114,7 @@ static struct virtio_device_id id_table[] = { | |||
114 | { 0 }, | 114 | { 0 }, |
115 | }; | 115 | }; |
116 | 116 | ||
117 | static struct virtio_driver virtio_rng = { | 117 | static struct virtio_driver virtio_rng_driver = { |
118 | .driver.name = KBUILD_MODNAME, | 118 | .driver.name = KBUILD_MODNAME, |
119 | .driver.owner = THIS_MODULE, | 119 | .driver.owner = THIS_MODULE, |
120 | .id_table = id_table, | 120 | .id_table = id_table, |
@@ -124,12 +124,12 @@ static struct virtio_driver virtio_rng = { | |||
124 | 124 | ||
125 | static int __init init(void) | 125 | static int __init init(void) |
126 | { | 126 | { |
127 | return register_virtio_driver(&virtio_rng); | 127 | return register_virtio_driver(&virtio_rng_driver); |
128 | } | 128 | } |
129 | 129 | ||
130 | static void __exit fini(void) | 130 | static void __exit fini(void) |
131 | { | 131 | { |
132 | unregister_virtio_driver(&virtio_rng); | 132 | unregister_virtio_driver(&virtio_rng_driver); |
133 | } | 133 | } |
134 | module_init(init); | 134 | module_init(init); |
135 | module_exit(fini); | 135 | module_exit(fini); |
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index c5facd951dda..000dc67b85b7 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -197,7 +197,7 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci, u32 *bw) | |||
197 | edac_printk(KERN_DEBUG, EDAC_MC, | 197 | edac_printk(KERN_DEBUG, EDAC_MC, |
198 | "pci-read, sdram scrub control value: %d \n", scrubval); | 198 | "pci-read, sdram scrub control value: %d \n", scrubval); |
199 | 199 | ||
200 | for (i = 0; ARRAY_SIZE(scrubrates); i++) { | 200 | for (i = 0; i < ARRAY_SIZE(scrubrates); i++) { |
201 | if (scrubrates[i].scrubval == scrubval) { | 201 | if (scrubrates[i].scrubval == scrubval) { |
202 | *bw = scrubrates[i].bandwidth; | 202 | *bw = scrubrates[i].bandwidth; |
203 | status = 0; | 203 | status = 0; |
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c index 77a9579d7167..adc10a2ac5f6 100644 --- a/drivers/edac/i5000_edac.c +++ b/drivers/edac/i5000_edac.c | |||
@@ -577,7 +577,13 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci, | |||
577 | debugf0("\tUncorrected bits= 0x%x\n", ue_errors); | 577 | debugf0("\tUncorrected bits= 0x%x\n", ue_errors); |
578 | 578 | ||
579 | branch = EXTRACT_FBDCHAN_INDX(info->ferr_nf_fbd); | 579 | branch = EXTRACT_FBDCHAN_INDX(info->ferr_nf_fbd); |
580 | channel = branch; | 580 | |
581 | /* | ||
582 | * According with i5000 datasheet, bit 28 has no significance | ||
583 | * for errors M4Err-M12Err and M17Err-M21Err, on FERR_NF_FBD | ||
584 | */ | ||
585 | channel = branch & 2; | ||
586 | |||
581 | bank = NREC_BANK(info->nrecmema); | 587 | bank = NREC_BANK(info->nrecmema); |
582 | rank = NREC_RANK(info->nrecmema); | 588 | rank = NREC_RANK(info->nrecmema); |
583 | rdwr = NREC_RDWR(info->nrecmema); | 589 | rdwr = NREC_RDWR(info->nrecmema); |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index bbe47812e4b6..e660ac07f3b2 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -134,6 +134,10 @@ static int i915_init_phys_hws(struct drm_device *dev) | |||
134 | 134 | ||
135 | memset(dev_priv->hw_status_page, 0, PAGE_SIZE); | 135 | memset(dev_priv->hw_status_page, 0, PAGE_SIZE); |
136 | 136 | ||
137 | if (IS_I965G(dev)) | ||
138 | dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) & | ||
139 | 0xf0; | ||
140 | |||
137 | I915_WRITE(HWS_PGA, dev_priv->dma_status_page); | 141 | I915_WRITE(HWS_PGA, dev_priv->dma_status_page); |
138 | DRM_DEBUG_DRIVER("Enabled hardware status page\n"); | 142 | DRM_DEBUG_DRIVER("Enabled hardware status page\n"); |
139 | return 0; | 143 | return 0; |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index be631cc3e4dc..46d88965852a 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -45,6 +45,9 @@ module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); | |||
45 | unsigned int i915_powersave = 1; | 45 | unsigned int i915_powersave = 1; |
46 | module_param_named(powersave, i915_powersave, int, 0400); | 46 | module_param_named(powersave, i915_powersave, int, 0400); |
47 | 47 | ||
48 | unsigned int i915_lvds_downclock = 0; | ||
49 | module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400); | ||
50 | |||
48 | static struct drm_driver driver; | 51 | static struct drm_driver driver; |
49 | 52 | ||
50 | #define INTEL_VGA_DEVICE(id, info) { \ | 53 | #define INTEL_VGA_DEVICE(id, info) { \ |
@@ -464,8 +467,11 @@ static struct drm_driver driver = { | |||
464 | .lastclose = i915_driver_lastclose, | 467 | .lastclose = i915_driver_lastclose, |
465 | .preclose = i915_driver_preclose, | 468 | .preclose = i915_driver_preclose, |
466 | .postclose = i915_driver_postclose, | 469 | .postclose = i915_driver_postclose, |
470 | |||
471 | /* Used in place of i915_pm_ops for non-DRIVER_MODESET */ | ||
467 | .suspend = i915_suspend, | 472 | .suspend = i915_suspend, |
468 | .resume = i915_resume, | 473 | .resume = i915_resume, |
474 | |||
469 | .device_is_agp = i915_driver_device_is_agp, | 475 | .device_is_agp = i915_driver_device_is_agp, |
470 | .enable_vblank = i915_enable_vblank, | 476 | .enable_vblank = i915_enable_vblank, |
471 | .disable_vblank = i915_disable_vblank, | 477 | .disable_vblank = i915_disable_vblank, |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 29dd67626967..2c1669488b5a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -283,6 +283,7 @@ typedef struct drm_i915_private { | |||
283 | unsigned int lvds_use_ssc:1; | 283 | unsigned int lvds_use_ssc:1; |
284 | unsigned int edp_support:1; | 284 | unsigned int edp_support:1; |
285 | int lvds_ssc_freq; | 285 | int lvds_ssc_freq; |
286 | int edp_bpp; | ||
286 | 287 | ||
287 | struct notifier_block lid_notifier; | 288 | struct notifier_block lid_notifier; |
288 | 289 | ||
@@ -722,6 +723,7 @@ extern struct drm_ioctl_desc i915_ioctls[]; | |||
722 | extern int i915_max_ioctl; | 723 | extern int i915_max_ioctl; |
723 | extern unsigned int i915_fbpercrtc; | 724 | extern unsigned int i915_fbpercrtc; |
724 | extern unsigned int i915_powersave; | 725 | extern unsigned int i915_powersave; |
726 | extern unsigned int i915_lvds_downclock; | ||
725 | 727 | ||
726 | extern void i915_save_display(struct drm_device *dev); | 728 | extern void i915_save_display(struct drm_device *dev); |
727 | extern void i915_restore_display(struct drm_device *dev); | 729 | extern void i915_restore_display(struct drm_device *dev); |
@@ -864,6 +866,7 @@ int i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptib | |||
864 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); | 866 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); |
865 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, | 867 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, |
866 | int write); | 868 | int write); |
869 | int i915_gem_object_set_to_display_plane(struct drm_gem_object *obj); | ||
867 | int i915_gem_attach_phys_object(struct drm_device *dev, | 870 | int i915_gem_attach_phys_object(struct drm_device *dev, |
868 | struct drm_gem_object *obj, int id); | 871 | struct drm_gem_object *obj, int id); |
869 | void i915_gem_detach_phys_object(struct drm_device *dev, | 872 | void i915_gem_detach_phys_object(struct drm_device *dev, |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 2748609f05b3..0c67924ca80c 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2837,6 +2837,57 @@ i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write) | |||
2837 | return 0; | 2837 | return 0; |
2838 | } | 2838 | } |
2839 | 2839 | ||
2840 | /* | ||
2841 | * Prepare buffer for display plane. Use uninterruptible for possible flush | ||
2842 | * wait, as in modesetting process we're not supposed to be interrupted. | ||
2843 | */ | ||
2844 | int | ||
2845 | i915_gem_object_set_to_display_plane(struct drm_gem_object *obj) | ||
2846 | { | ||
2847 | struct drm_device *dev = obj->dev; | ||
2848 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
2849 | uint32_t old_write_domain, old_read_domains; | ||
2850 | int ret; | ||
2851 | |||
2852 | /* Not valid to be called on unbound objects. */ | ||
2853 | if (obj_priv->gtt_space == NULL) | ||
2854 | return -EINVAL; | ||
2855 | |||
2856 | i915_gem_object_flush_gpu_write_domain(obj); | ||
2857 | |||
2858 | /* Wait on any GPU rendering and flushing to occur. */ | ||
2859 | if (obj_priv->active) { | ||
2860 | #if WATCH_BUF | ||
2861 | DRM_INFO("%s: object %p wait for seqno %08x\n", | ||
2862 | __func__, obj, obj_priv->last_rendering_seqno); | ||
2863 | #endif | ||
2864 | ret = i915_do_wait_request(dev, obj_priv->last_rendering_seqno, 0); | ||
2865 | if (ret != 0) | ||
2866 | return ret; | ||
2867 | } | ||
2868 | |||
2869 | old_write_domain = obj->write_domain; | ||
2870 | old_read_domains = obj->read_domains; | ||
2871 | |||
2872 | obj->read_domains &= I915_GEM_DOMAIN_GTT; | ||
2873 | |||
2874 | i915_gem_object_flush_cpu_write_domain(obj); | ||
2875 | |||
2876 | /* It should now be out of any other write domains, and we can update | ||
2877 | * the domain values for our changes. | ||
2878 | */ | ||
2879 | BUG_ON((obj->write_domain & ~I915_GEM_DOMAIN_GTT) != 0); | ||
2880 | obj->read_domains |= I915_GEM_DOMAIN_GTT; | ||
2881 | obj->write_domain = I915_GEM_DOMAIN_GTT; | ||
2882 | obj_priv->dirty = 1; | ||
2883 | |||
2884 | trace_i915_gem_object_change_domain(obj, | ||
2885 | old_read_domains, | ||
2886 | old_write_domain); | ||
2887 | |||
2888 | return 0; | ||
2889 | } | ||
2890 | |||
2840 | /** | 2891 | /** |
2841 | * Moves a single object to the CPU read, and possibly write domain. | 2892 | * Moves a single object to the CPU read, and possibly write domain. |
2842 | * | 2893 | * |
@@ -4000,8 +4051,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, | |||
4000 | "back to user (%d)\n", | 4051 | "back to user (%d)\n", |
4001 | args->buffer_count, ret); | 4052 | args->buffer_count, ret); |
4002 | } | 4053 | } |
4003 | } else { | ||
4004 | DRM_ERROR("i915_gem_do_execbuffer returns %d\n", ret); | ||
4005 | } | 4054 | } |
4006 | 4055 | ||
4007 | drm_free_large(exec_list); | 4056 | drm_free_large(exec_list); |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 7cd8110051b6..89a071a3e6fb 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -274,7 +274,6 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
274 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 274 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
275 | int ret = IRQ_NONE; | 275 | int ret = IRQ_NONE; |
276 | u32 de_iir, gt_iir, de_ier, pch_iir; | 276 | u32 de_iir, gt_iir, de_ier, pch_iir; |
277 | u32 new_de_iir, new_gt_iir, new_pch_iir; | ||
278 | struct drm_i915_master_private *master_priv; | 277 | struct drm_i915_master_private *master_priv; |
279 | 278 | ||
280 | /* disable master interrupt before clearing iir */ | 279 | /* disable master interrupt before clearing iir */ |
@@ -286,51 +285,42 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
286 | gt_iir = I915_READ(GTIIR); | 285 | gt_iir = I915_READ(GTIIR); |
287 | pch_iir = I915_READ(SDEIIR); | 286 | pch_iir = I915_READ(SDEIIR); |
288 | 287 | ||
289 | for (;;) { | 288 | if (de_iir == 0 && gt_iir == 0 && pch_iir == 0) |
290 | if (de_iir == 0 && gt_iir == 0 && pch_iir == 0) | 289 | goto done; |
291 | break; | ||
292 | |||
293 | ret = IRQ_HANDLED; | ||
294 | 290 | ||
295 | /* should clear PCH hotplug event before clear CPU irq */ | 291 | ret = IRQ_HANDLED; |
296 | I915_WRITE(SDEIIR, pch_iir); | ||
297 | new_pch_iir = I915_READ(SDEIIR); | ||
298 | 292 | ||
299 | I915_WRITE(DEIIR, de_iir); | 293 | if (dev->primary->master) { |
300 | new_de_iir = I915_READ(DEIIR); | 294 | master_priv = dev->primary->master->driver_priv; |
301 | I915_WRITE(GTIIR, gt_iir); | 295 | if (master_priv->sarea_priv) |
302 | new_gt_iir = I915_READ(GTIIR); | 296 | master_priv->sarea_priv->last_dispatch = |
303 | 297 | READ_BREADCRUMB(dev_priv); | |
304 | if (dev->primary->master) { | 298 | } |
305 | master_priv = dev->primary->master->driver_priv; | ||
306 | if (master_priv->sarea_priv) | ||
307 | master_priv->sarea_priv->last_dispatch = | ||
308 | READ_BREADCRUMB(dev_priv); | ||
309 | } | ||
310 | |||
311 | if (gt_iir & GT_USER_INTERRUPT) { | ||
312 | u32 seqno = i915_get_gem_seqno(dev); | ||
313 | dev_priv->mm.irq_gem_seqno = seqno; | ||
314 | trace_i915_gem_request_complete(dev, seqno); | ||
315 | DRM_WAKEUP(&dev_priv->irq_queue); | ||
316 | dev_priv->hangcheck_count = 0; | ||
317 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); | ||
318 | } | ||
319 | 299 | ||
320 | if (de_iir & DE_GSE) | 300 | if (gt_iir & GT_USER_INTERRUPT) { |
321 | ironlake_opregion_gse_intr(dev); | 301 | u32 seqno = i915_get_gem_seqno(dev); |
302 | dev_priv->mm.irq_gem_seqno = seqno; | ||
303 | trace_i915_gem_request_complete(dev, seqno); | ||
304 | DRM_WAKEUP(&dev_priv->irq_queue); | ||
305 | dev_priv->hangcheck_count = 0; | ||
306 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); | ||
307 | } | ||
322 | 308 | ||
323 | /* check event from PCH */ | 309 | if (de_iir & DE_GSE) |
324 | if ((de_iir & DE_PCH_EVENT) && | 310 | ironlake_opregion_gse_intr(dev); |
325 | (pch_iir & SDE_HOTPLUG_MASK)) { | ||
326 | queue_work(dev_priv->wq, &dev_priv->hotplug_work); | ||
327 | } | ||
328 | 311 | ||
329 | de_iir = new_de_iir; | 312 | /* check event from PCH */ |
330 | gt_iir = new_gt_iir; | 313 | if ((de_iir & DE_PCH_EVENT) && |
331 | pch_iir = new_pch_iir; | 314 | (pch_iir & SDE_HOTPLUG_MASK)) { |
315 | queue_work(dev_priv->wq, &dev_priv->hotplug_work); | ||
332 | } | 316 | } |
333 | 317 | ||
318 | /* should clear PCH hotplug event before clear CPU irq */ | ||
319 | I915_WRITE(SDEIIR, pch_iir); | ||
320 | I915_WRITE(GTIIR, gt_iir); | ||
321 | I915_WRITE(DEIIR, de_iir); | ||
322 | |||
323 | done: | ||
334 | I915_WRITE(DEIER, de_ier); | 324 | I915_WRITE(DEIER, de_ier); |
335 | (void)I915_READ(DEIER); | 325 | (void)I915_READ(DEIER); |
336 | 326 | ||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 149d360d64a3..847006c5218e 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -1815,7 +1815,7 @@ | |||
1815 | #define DSPFW_PLANEB_SHIFT 8 | 1815 | #define DSPFW_PLANEB_SHIFT 8 |
1816 | #define DSPFW2 0x70038 | 1816 | #define DSPFW2 0x70038 |
1817 | #define DSPFW_CURSORA_MASK 0x00003f00 | 1817 | #define DSPFW_CURSORA_MASK 0x00003f00 |
1818 | #define DSPFW_CURSORA_SHIFT 16 | 1818 | #define DSPFW_CURSORA_SHIFT 8 |
1819 | #define DSPFW3 0x7003c | 1819 | #define DSPFW3 0x7003c |
1820 | #define DSPFW_HPLL_SR_EN (1<<31) | 1820 | #define DSPFW_HPLL_SR_EN (1<<31) |
1821 | #define DSPFW_CURSOR_SR_SHIFT 24 | 1821 | #define DSPFW_CURSOR_SR_SHIFT 24 |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index f27567747580..15fbc1b5a83e 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #define SLAVE_ADDR1 0x70 | 33 | #define SLAVE_ADDR1 0x70 |
34 | #define SLAVE_ADDR2 0x72 | 34 | #define SLAVE_ADDR2 0x72 |
35 | 35 | ||
36 | static int panel_type; | ||
37 | |||
36 | static void * | 38 | static void * |
37 | find_section(struct bdb_header *bdb, int section_id) | 39 | find_section(struct bdb_header *bdb, int section_id) |
38 | { | 40 | { |
@@ -128,6 +130,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
128 | dev_priv->lvds_dither = lvds_options->pixel_dither; | 130 | dev_priv->lvds_dither = lvds_options->pixel_dither; |
129 | if (lvds_options->panel_type == 0xff) | 131 | if (lvds_options->panel_type == 0xff) |
130 | return; | 132 | return; |
133 | panel_type = lvds_options->panel_type; | ||
131 | 134 | ||
132 | lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA); | 135 | lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA); |
133 | if (!lvds_lfp_data) | 136 | if (!lvds_lfp_data) |
@@ -197,7 +200,8 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
197 | memset(temp_mode, 0, sizeof(*temp_mode)); | 200 | memset(temp_mode, 0, sizeof(*temp_mode)); |
198 | } | 201 | } |
199 | kfree(temp_mode); | 202 | kfree(temp_mode); |
200 | if (temp_downclock < panel_fixed_mode->clock) { | 203 | if (temp_downclock < panel_fixed_mode->clock && |
204 | i915_lvds_downclock) { | ||
201 | dev_priv->lvds_downclock_avail = 1; | 205 | dev_priv->lvds_downclock_avail = 1; |
202 | dev_priv->lvds_downclock = temp_downclock; | 206 | dev_priv->lvds_downclock = temp_downclock; |
203 | DRM_DEBUG_KMS("LVDS downclock is found in VBT. ", | 207 | DRM_DEBUG_KMS("LVDS downclock is found in VBT. ", |
@@ -405,6 +409,34 @@ parse_driver_features(struct drm_i915_private *dev_priv, | |||
405 | } | 409 | } |
406 | 410 | ||
407 | static void | 411 | static void |
412 | parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb) | ||
413 | { | ||
414 | struct bdb_edp *edp; | ||
415 | |||
416 | edp = find_section(bdb, BDB_EDP); | ||
417 | if (!edp) { | ||
418 | if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp_support) { | ||
419 | DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported,\ | ||
420 | assume 18bpp panel color depth.\n"); | ||
421 | dev_priv->edp_bpp = 18; | ||
422 | } | ||
423 | return; | ||
424 | } | ||
425 | |||
426 | switch ((edp->color_depth >> (panel_type * 2)) & 3) { | ||
427 | case EDP_18BPP: | ||
428 | dev_priv->edp_bpp = 18; | ||
429 | break; | ||
430 | case EDP_24BPP: | ||
431 | dev_priv->edp_bpp = 24; | ||
432 | break; | ||
433 | case EDP_30BPP: | ||
434 | dev_priv->edp_bpp = 30; | ||
435 | break; | ||
436 | } | ||
437 | } | ||
438 | |||
439 | static void | ||
408 | parse_device_mapping(struct drm_i915_private *dev_priv, | 440 | parse_device_mapping(struct drm_i915_private *dev_priv, |
409 | struct bdb_header *bdb) | 441 | struct bdb_header *bdb) |
410 | { | 442 | { |
@@ -521,6 +553,7 @@ intel_init_bios(struct drm_device *dev) | |||
521 | parse_sdvo_device_mapping(dev_priv, bdb); | 553 | parse_sdvo_device_mapping(dev_priv, bdb); |
522 | parse_device_mapping(dev_priv, bdb); | 554 | parse_device_mapping(dev_priv, bdb); |
523 | parse_driver_features(dev_priv, bdb); | 555 | parse_driver_features(dev_priv, bdb); |
556 | parse_edp(dev_priv, bdb); | ||
524 | 557 | ||
525 | pci_unmap_rom(pdev, bios); | 558 | pci_unmap_rom(pdev, bios); |
526 | 559 | ||
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h index 425ac9d7f724..4c18514f6f80 100644 --- a/drivers/gpu/drm/i915/intel_bios.h +++ b/drivers/gpu/drm/i915/intel_bios.h | |||
@@ -98,6 +98,7 @@ struct vbios_data { | |||
98 | #define BDB_SDVO_LVDS_PNP_IDS 24 | 98 | #define BDB_SDVO_LVDS_PNP_IDS 24 |
99 | #define BDB_SDVO_LVDS_POWER_SEQ 25 | 99 | #define BDB_SDVO_LVDS_POWER_SEQ 25 |
100 | #define BDB_TV_OPTIONS 26 | 100 | #define BDB_TV_OPTIONS 26 |
101 | #define BDB_EDP 27 | ||
101 | #define BDB_LVDS_OPTIONS 40 | 102 | #define BDB_LVDS_OPTIONS 40 |
102 | #define BDB_LVDS_LFP_DATA_PTRS 41 | 103 | #define BDB_LVDS_LFP_DATA_PTRS 41 |
103 | #define BDB_LVDS_LFP_DATA 42 | 104 | #define BDB_LVDS_LFP_DATA 42 |
@@ -426,6 +427,45 @@ struct bdb_driver_features { | |||
426 | u8 custom_vbt_version; | 427 | u8 custom_vbt_version; |
427 | } __attribute__((packed)); | 428 | } __attribute__((packed)); |
428 | 429 | ||
430 | #define EDP_18BPP 0 | ||
431 | #define EDP_24BPP 1 | ||
432 | #define EDP_30BPP 2 | ||
433 | #define EDP_RATE_1_62 0 | ||
434 | #define EDP_RATE_2_7 1 | ||
435 | #define EDP_LANE_1 0 | ||
436 | #define EDP_LANE_2 1 | ||
437 | #define EDP_LANE_4 3 | ||
438 | #define EDP_PREEMPHASIS_NONE 0 | ||
439 | #define EDP_PREEMPHASIS_3_5dB 1 | ||
440 | #define EDP_PREEMPHASIS_6dB 2 | ||
441 | #define EDP_PREEMPHASIS_9_5dB 3 | ||
442 | #define EDP_VSWING_0_4V 0 | ||
443 | #define EDP_VSWING_0_6V 1 | ||
444 | #define EDP_VSWING_0_8V 2 | ||
445 | #define EDP_VSWING_1_2V 3 | ||
446 | |||
447 | struct edp_power_seq { | ||
448 | u16 t3; | ||
449 | u16 t7; | ||
450 | u16 t9; | ||
451 | u16 t10; | ||
452 | u16 t12; | ||
453 | } __attribute__ ((packed)); | ||
454 | |||
455 | struct edp_link_params { | ||
456 | u8 rate:4; | ||
457 | u8 lanes:4; | ||
458 | u8 preemphasis:4; | ||
459 | u8 vswing:4; | ||
460 | } __attribute__ ((packed)); | ||
461 | |||
462 | struct bdb_edp { | ||
463 | struct edp_power_seq power_seqs[16]; | ||
464 | u32 color_depth; | ||
465 | u32 sdrrs_msa_timing_delay; | ||
466 | struct edp_link_params link_params[16]; | ||
467 | } __attribute__ ((packed)); | ||
468 | |||
429 | bool intel_init_bios(struct drm_device *dev); | 469 | bool intel_init_bios(struct drm_device *dev); |
430 | 470 | ||
431 | /* | 471 | /* |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 002612fae717..45da78ef4a92 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -70,8 +70,6 @@ struct intel_limit { | |||
70 | intel_p2_t p2; | 70 | intel_p2_t p2; |
71 | bool (* find_pll)(const intel_limit_t *, struct drm_crtc *, | 71 | bool (* find_pll)(const intel_limit_t *, struct drm_crtc *, |
72 | int, int, intel_clock_t *); | 72 | int, int, intel_clock_t *); |
73 | bool (* find_reduced_pll)(const intel_limit_t *, struct drm_crtc *, | ||
74 | int, int, intel_clock_t *); | ||
75 | }; | 73 | }; |
76 | 74 | ||
77 | #define I8XX_DOT_MIN 25000 | 75 | #define I8XX_DOT_MIN 25000 |
@@ -243,11 +241,11 @@ struct intel_limit { | |||
243 | #define IRONLAKE_VCO_MIN 1760000 | 241 | #define IRONLAKE_VCO_MIN 1760000 |
244 | #define IRONLAKE_VCO_MAX 3510000 | 242 | #define IRONLAKE_VCO_MAX 3510000 |
245 | #define IRONLAKE_N_MIN 1 | 243 | #define IRONLAKE_N_MIN 1 |
246 | #define IRONLAKE_N_MAX 5 | 244 | #define IRONLAKE_N_MAX 6 |
247 | #define IRONLAKE_M_MIN 79 | 245 | #define IRONLAKE_M_MIN 79 |
248 | #define IRONLAKE_M_MAX 118 | 246 | #define IRONLAKE_M_MAX 127 |
249 | #define IRONLAKE_M1_MIN 12 | 247 | #define IRONLAKE_M1_MIN 12 |
250 | #define IRONLAKE_M1_MAX 23 | 248 | #define IRONLAKE_M1_MAX 22 |
251 | #define IRONLAKE_M2_MIN 5 | 249 | #define IRONLAKE_M2_MIN 5 |
252 | #define IRONLAKE_M2_MAX 9 | 250 | #define IRONLAKE_M2_MAX 9 |
253 | #define IRONLAKE_P_SDVO_DAC_MIN 5 | 251 | #define IRONLAKE_P_SDVO_DAC_MIN 5 |
@@ -274,9 +272,6 @@ static bool | |||
274 | intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | 272 | intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, |
275 | int target, int refclk, intel_clock_t *best_clock); | 273 | int target, int refclk, intel_clock_t *best_clock); |
276 | static bool | 274 | static bool |
277 | intel_find_best_reduced_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | ||
278 | int target, int refclk, intel_clock_t *best_clock); | ||
279 | static bool | ||
280 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | 275 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, |
281 | int target, int refclk, intel_clock_t *best_clock); | 276 | int target, int refclk, intel_clock_t *best_clock); |
282 | 277 | ||
@@ -299,7 +294,6 @@ static const intel_limit_t intel_limits_i8xx_dvo = { | |||
299 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, | 294 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, |
300 | .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST }, | 295 | .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST }, |
301 | .find_pll = intel_find_best_PLL, | 296 | .find_pll = intel_find_best_PLL, |
302 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
303 | }; | 297 | }; |
304 | 298 | ||
305 | static const intel_limit_t intel_limits_i8xx_lvds = { | 299 | static const intel_limit_t intel_limits_i8xx_lvds = { |
@@ -314,7 +308,6 @@ static const intel_limit_t intel_limits_i8xx_lvds = { | |||
314 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, | 308 | .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, |
315 | .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST }, | 309 | .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST }, |
316 | .find_pll = intel_find_best_PLL, | 310 | .find_pll = intel_find_best_PLL, |
317 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
318 | }; | 311 | }; |
319 | 312 | ||
320 | static const intel_limit_t intel_limits_i9xx_sdvo = { | 313 | static const intel_limit_t intel_limits_i9xx_sdvo = { |
@@ -329,7 +322,6 @@ static const intel_limit_t intel_limits_i9xx_sdvo = { | |||
329 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, | 322 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, |
330 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, | 323 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, |
331 | .find_pll = intel_find_best_PLL, | 324 | .find_pll = intel_find_best_PLL, |
332 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
333 | }; | 325 | }; |
334 | 326 | ||
335 | static const intel_limit_t intel_limits_i9xx_lvds = { | 327 | static const intel_limit_t intel_limits_i9xx_lvds = { |
@@ -347,7 +339,6 @@ static const intel_limit_t intel_limits_i9xx_lvds = { | |||
347 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, | 339 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, |
348 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST }, | 340 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST }, |
349 | .find_pll = intel_find_best_PLL, | 341 | .find_pll = intel_find_best_PLL, |
350 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
351 | }; | 342 | }; |
352 | 343 | ||
353 | /* below parameter and function is for G4X Chipset Family*/ | 344 | /* below parameter and function is for G4X Chipset Family*/ |
@@ -365,7 +356,6 @@ static const intel_limit_t intel_limits_g4x_sdvo = { | |||
365 | .p2_fast = G4X_P2_SDVO_FAST | 356 | .p2_fast = G4X_P2_SDVO_FAST |
366 | }, | 357 | }, |
367 | .find_pll = intel_g4x_find_best_PLL, | 358 | .find_pll = intel_g4x_find_best_PLL, |
368 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
369 | }; | 359 | }; |
370 | 360 | ||
371 | static const intel_limit_t intel_limits_g4x_hdmi = { | 361 | static const intel_limit_t intel_limits_g4x_hdmi = { |
@@ -382,7 +372,6 @@ static const intel_limit_t intel_limits_g4x_hdmi = { | |||
382 | .p2_fast = G4X_P2_HDMI_DAC_FAST | 372 | .p2_fast = G4X_P2_HDMI_DAC_FAST |
383 | }, | 373 | }, |
384 | .find_pll = intel_g4x_find_best_PLL, | 374 | .find_pll = intel_g4x_find_best_PLL, |
385 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
386 | }; | 375 | }; |
387 | 376 | ||
388 | static const intel_limit_t intel_limits_g4x_single_channel_lvds = { | 377 | static const intel_limit_t intel_limits_g4x_single_channel_lvds = { |
@@ -407,7 +396,6 @@ static const intel_limit_t intel_limits_g4x_single_channel_lvds = { | |||
407 | .p2_fast = G4X_P2_SINGLE_CHANNEL_LVDS_FAST | 396 | .p2_fast = G4X_P2_SINGLE_CHANNEL_LVDS_FAST |
408 | }, | 397 | }, |
409 | .find_pll = intel_g4x_find_best_PLL, | 398 | .find_pll = intel_g4x_find_best_PLL, |
410 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
411 | }; | 399 | }; |
412 | 400 | ||
413 | static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { | 401 | static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { |
@@ -432,7 +420,6 @@ static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { | |||
432 | .p2_fast = G4X_P2_DUAL_CHANNEL_LVDS_FAST | 420 | .p2_fast = G4X_P2_DUAL_CHANNEL_LVDS_FAST |
433 | }, | 421 | }, |
434 | .find_pll = intel_g4x_find_best_PLL, | 422 | .find_pll = intel_g4x_find_best_PLL, |
435 | .find_reduced_pll = intel_g4x_find_best_PLL, | ||
436 | }; | 423 | }; |
437 | 424 | ||
438 | static const intel_limit_t intel_limits_g4x_display_port = { | 425 | static const intel_limit_t intel_limits_g4x_display_port = { |
@@ -470,7 +457,6 @@ static const intel_limit_t intel_limits_pineview_sdvo = { | |||
470 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, | 457 | .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, |
471 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, | 458 | .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, |
472 | .find_pll = intel_find_best_PLL, | 459 | .find_pll = intel_find_best_PLL, |
473 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
474 | }; | 460 | }; |
475 | 461 | ||
476 | static const intel_limit_t intel_limits_pineview_lvds = { | 462 | static const intel_limit_t intel_limits_pineview_lvds = { |
@@ -486,7 +472,6 @@ static const intel_limit_t intel_limits_pineview_lvds = { | |||
486 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, | 472 | .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, |
487 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW }, | 473 | .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW }, |
488 | .find_pll = intel_find_best_PLL, | 474 | .find_pll = intel_find_best_PLL, |
489 | .find_reduced_pll = intel_find_best_reduced_PLL, | ||
490 | }; | 475 | }; |
491 | 476 | ||
492 | static const intel_limit_t intel_limits_ironlake_sdvo = { | 477 | static const intel_limit_t intel_limits_ironlake_sdvo = { |
@@ -768,46 +753,6 @@ intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | |||
768 | return (err != target); | 753 | return (err != target); |
769 | } | 754 | } |
770 | 755 | ||
771 | |||
772 | static bool | ||
773 | intel_find_best_reduced_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | ||
774 | int target, int refclk, intel_clock_t *best_clock) | ||
775 | |||
776 | { | ||
777 | struct drm_device *dev = crtc->dev; | ||
778 | intel_clock_t clock; | ||
779 | int err = target; | ||
780 | bool found = false; | ||
781 | |||
782 | memcpy(&clock, best_clock, sizeof(intel_clock_t)); | ||
783 | |||
784 | for (clock.m1 = limit->m1.min; clock.m1 <= limit->m1.max; clock.m1++) { | ||
785 | for (clock.m2 = limit->m2.min; clock.m2 <= limit->m2.max; clock.m2++) { | ||
786 | /* m1 is always 0 in Pineview */ | ||
787 | if (clock.m2 >= clock.m1 && !IS_PINEVIEW(dev)) | ||
788 | break; | ||
789 | for (clock.n = limit->n.min; clock.n <= limit->n.max; | ||
790 | clock.n++) { | ||
791 | int this_err; | ||
792 | |||
793 | intel_clock(dev, refclk, &clock); | ||
794 | |||
795 | if (!intel_PLL_is_valid(crtc, &clock)) | ||
796 | continue; | ||
797 | |||
798 | this_err = abs(clock.dot - target); | ||
799 | if (this_err < err) { | ||
800 | *best_clock = clock; | ||
801 | err = this_err; | ||
802 | found = true; | ||
803 | } | ||
804 | } | ||
805 | } | ||
806 | } | ||
807 | |||
808 | return found; | ||
809 | } | ||
810 | |||
811 | static bool | 756 | static bool |
812 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | 757 | intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, |
813 | int target, int refclk, intel_clock_t *best_clock) | 758 | int target, int refclk, intel_clock_t *best_clock) |
@@ -1262,7 +1207,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
1262 | return ret; | 1207 | return ret; |
1263 | } | 1208 | } |
1264 | 1209 | ||
1265 | ret = i915_gem_object_set_to_gtt_domain(obj, 1); | 1210 | ret = i915_gem_object_set_to_display_plane(obj); |
1266 | if (ret != 0) { | 1211 | if (ret != 0) { |
1267 | i915_gem_object_unpin(obj); | 1212 | i915_gem_object_unpin(obj); |
1268 | mutex_unlock(&dev->struct_mutex); | 1213 | mutex_unlock(&dev->struct_mutex); |
@@ -2910,10 +2855,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
2910 | return -EINVAL; | 2855 | return -EINVAL; |
2911 | } | 2856 | } |
2912 | 2857 | ||
2913 | if (is_lvds && limit->find_reduced_pll && | 2858 | if (is_lvds && dev_priv->lvds_downclock_avail) { |
2914 | dev_priv->lvds_downclock_avail) { | 2859 | has_reduced_clock = limit->find_pll(limit, crtc, |
2915 | memcpy(&reduced_clock, &clock, sizeof(intel_clock_t)); | ||
2916 | has_reduced_clock = limit->find_reduced_pll(limit, crtc, | ||
2917 | dev_priv->lvds_downclock, | 2860 | dev_priv->lvds_downclock, |
2918 | refclk, | 2861 | refclk, |
2919 | &reduced_clock); | 2862 | &reduced_clock); |
@@ -2981,6 +2924,21 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
2981 | temp |= PIPE_8BPC; | 2924 | temp |= PIPE_8BPC; |
2982 | else | 2925 | else |
2983 | temp |= PIPE_6BPC; | 2926 | temp |= PIPE_6BPC; |
2927 | } else if (is_edp) { | ||
2928 | switch (dev_priv->edp_bpp/3) { | ||
2929 | case 8: | ||
2930 | temp |= PIPE_8BPC; | ||
2931 | break; | ||
2932 | case 10: | ||
2933 | temp |= PIPE_10BPC; | ||
2934 | break; | ||
2935 | case 6: | ||
2936 | temp |= PIPE_6BPC; | ||
2937 | break; | ||
2938 | case 12: | ||
2939 | temp |= PIPE_12BPC; | ||
2940 | break; | ||
2941 | } | ||
2984 | } else | 2942 | } else |
2985 | temp |= PIPE_8BPC; | 2943 | temp |= PIPE_8BPC; |
2986 | I915_WRITE(pipeconf_reg, temp); | 2944 | I915_WRITE(pipeconf_reg, temp); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1349d9fd01c4..439506cefc14 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -125,9 +125,15 @@ intel_dp_link_clock(uint8_t link_bw) | |||
125 | 125 | ||
126 | /* I think this is a fiction */ | 126 | /* I think this is a fiction */ |
127 | static int | 127 | static int |
128 | intel_dp_link_required(int pixel_clock) | 128 | intel_dp_link_required(struct drm_device *dev, |
129 | struct intel_output *intel_output, int pixel_clock) | ||
129 | { | 130 | { |
130 | return pixel_clock * 3; | 131 | struct drm_i915_private *dev_priv = dev->dev_private; |
132 | |||
133 | if (IS_eDP(intel_output)) | ||
134 | return (pixel_clock * dev_priv->edp_bpp) / 8; | ||
135 | else | ||
136 | return pixel_clock * 3; | ||
131 | } | 137 | } |
132 | 138 | ||
133 | static int | 139 | static int |
@@ -138,7 +144,8 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
138 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_output)); | 144 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_output)); |
139 | int max_lanes = intel_dp_max_lane_count(intel_output); | 145 | int max_lanes = intel_dp_max_lane_count(intel_output); |
140 | 146 | ||
141 | if (intel_dp_link_required(mode->clock) > max_link_clock * max_lanes) | 147 | if (intel_dp_link_required(connector->dev, intel_output, mode->clock) |
148 | > max_link_clock * max_lanes) | ||
142 | return MODE_CLOCK_HIGH; | 149 | return MODE_CLOCK_HIGH; |
143 | 150 | ||
144 | if (mode->clock < 10000) | 151 | if (mode->clock < 10000) |
@@ -492,7 +499,8 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
492 | for (clock = 0; clock <= max_clock; clock++) { | 499 | for (clock = 0; clock <= max_clock; clock++) { |
493 | int link_avail = intel_dp_link_clock(bws[clock]) * lane_count; | 500 | int link_avail = intel_dp_link_clock(bws[clock]) * lane_count; |
494 | 501 | ||
495 | if (intel_dp_link_required(mode->clock) <= link_avail) { | 502 | if (intel_dp_link_required(encoder->dev, intel_output, mode->clock) |
503 | <= link_avail) { | ||
496 | dp_priv->link_bw = bws[clock]; | 504 | dp_priv->link_bw = bws[clock]; |
497 | dp_priv->lane_count = lane_count; | 505 | dp_priv->lane_count = lane_count; |
498 | adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw); | 506 | adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw); |
@@ -1289,53 +1297,7 @@ intel_dp_hot_plug(struct intel_output *intel_output) | |||
1289 | if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON) | 1297 | if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON) |
1290 | intel_dp_check_link_status(intel_output); | 1298 | intel_dp_check_link_status(intel_output); |
1291 | } | 1299 | } |
1292 | /* | 1300 | |
1293 | * Enumerate the child dev array parsed from VBT to check whether | ||
1294 | * the given DP is present. | ||
1295 | * If it is present, return 1. | ||
1296 | * If it is not present, return false. | ||
1297 | * If no child dev is parsed from VBT, it is assumed that the given | ||
1298 | * DP is present. | ||
1299 | */ | ||
1300 | static int dp_is_present_in_vbt(struct drm_device *dev, int dp_reg) | ||
1301 | { | ||
1302 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1303 | struct child_device_config *p_child; | ||
1304 | int i, dp_port, ret; | ||
1305 | |||
1306 | if (!dev_priv->child_dev_num) | ||
1307 | return 1; | ||
1308 | |||
1309 | dp_port = 0; | ||
1310 | if (dp_reg == DP_B || dp_reg == PCH_DP_B) | ||
1311 | dp_port = PORT_IDPB; | ||
1312 | else if (dp_reg == DP_C || dp_reg == PCH_DP_C) | ||
1313 | dp_port = PORT_IDPC; | ||
1314 | else if (dp_reg == DP_D || dp_reg == PCH_DP_D) | ||
1315 | dp_port = PORT_IDPD; | ||
1316 | |||
1317 | ret = 0; | ||
1318 | for (i = 0; i < dev_priv->child_dev_num; i++) { | ||
1319 | p_child = dev_priv->child_dev + i; | ||
1320 | /* | ||
1321 | * If the device type is not DP, continue. | ||
1322 | */ | ||
1323 | if (p_child->device_type != DEVICE_TYPE_DP && | ||
1324 | p_child->device_type != DEVICE_TYPE_eDP) | ||
1325 | continue; | ||
1326 | /* Find the eDP port */ | ||
1327 | if (dp_reg == DP_A && p_child->device_type == DEVICE_TYPE_eDP) { | ||
1328 | ret = 1; | ||
1329 | break; | ||
1330 | } | ||
1331 | /* Find the DP port */ | ||
1332 | if (p_child->dvo_port == dp_port) { | ||
1333 | ret = 1; | ||
1334 | break; | ||
1335 | } | ||
1336 | } | ||
1337 | return ret; | ||
1338 | } | ||
1339 | void | 1301 | void |
1340 | intel_dp_init(struct drm_device *dev, int output_reg) | 1302 | intel_dp_init(struct drm_device *dev, int output_reg) |
1341 | { | 1303 | { |
@@ -1345,10 +1307,6 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
1345 | struct intel_dp_priv *dp_priv; | 1307 | struct intel_dp_priv *dp_priv; |
1346 | const char *name = NULL; | 1308 | const char *name = NULL; |
1347 | 1309 | ||
1348 | if (!dp_is_present_in_vbt(dev, output_reg)) { | ||
1349 | DRM_DEBUG_KMS("DP is not present. Ignore it\n"); | ||
1350 | return; | ||
1351 | } | ||
1352 | intel_output = kcalloc(sizeof(struct intel_output) + | 1310 | intel_output = kcalloc(sizeof(struct intel_output) + |
1353 | sizeof(struct intel_dp_priv), 1, GFP_KERNEL); | 1311 | sizeof(struct intel_dp_priv), 1, GFP_KERNEL); |
1354 | if (!intel_output) | 1312 | if (!intel_output) |
@@ -1373,11 +1331,10 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
1373 | else if (output_reg == DP_D || output_reg == PCH_DP_D) | 1331 | else if (output_reg == DP_D || output_reg == PCH_DP_D) |
1374 | intel_output->clone_mask = (1 << INTEL_DP_D_CLONE_BIT); | 1332 | intel_output->clone_mask = (1 << INTEL_DP_D_CLONE_BIT); |
1375 | 1333 | ||
1376 | if (IS_eDP(intel_output)) { | 1334 | if (IS_eDP(intel_output)) |
1377 | intel_output->crtc_mask = (1 << 1); | ||
1378 | intel_output->clone_mask = (1 << INTEL_EDP_CLONE_BIT); | 1335 | intel_output->clone_mask = (1 << INTEL_EDP_CLONE_BIT); |
1379 | } else | 1336 | |
1380 | intel_output->crtc_mask = (1 << 0) | (1 << 1); | 1337 | intel_output->crtc_mask = (1 << 0) | (1 << 1); |
1381 | connector->interlace_allowed = true; | 1338 | connector->interlace_allowed = true; |
1382 | connector->doublescan_allowed = 0; | 1339 | connector->doublescan_allowed = 0; |
1383 | 1340 | ||
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 06431941b233..0e268deed761 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -225,52 +225,6 @@ static const struct drm_encoder_funcs intel_hdmi_enc_funcs = { | |||
225 | .destroy = intel_hdmi_enc_destroy, | 225 | .destroy = intel_hdmi_enc_destroy, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | /* | ||
229 | * Enumerate the child dev array parsed from VBT to check whether | ||
230 | * the given HDMI is present. | ||
231 | * If it is present, return 1. | ||
232 | * If it is not present, return false. | ||
233 | * If no child dev is parsed from VBT, it assumes that the given | ||
234 | * HDMI is present. | ||
235 | */ | ||
236 | static int hdmi_is_present_in_vbt(struct drm_device *dev, int hdmi_reg) | ||
237 | { | ||
238 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
239 | struct child_device_config *p_child; | ||
240 | int i, hdmi_port, ret; | ||
241 | |||
242 | if (!dev_priv->child_dev_num) | ||
243 | return 1; | ||
244 | |||
245 | if (hdmi_reg == SDVOB) | ||
246 | hdmi_port = DVO_B; | ||
247 | else if (hdmi_reg == SDVOC) | ||
248 | hdmi_port = DVO_C; | ||
249 | else if (hdmi_reg == HDMIB) | ||
250 | hdmi_port = DVO_B; | ||
251 | else if (hdmi_reg == HDMIC) | ||
252 | hdmi_port = DVO_C; | ||
253 | else if (hdmi_reg == HDMID) | ||
254 | hdmi_port = DVO_D; | ||
255 | else | ||
256 | return 0; | ||
257 | |||
258 | ret = 0; | ||
259 | for (i = 0; i < dev_priv->child_dev_num; i++) { | ||
260 | p_child = dev_priv->child_dev + i; | ||
261 | /* | ||
262 | * If the device type is not HDMI, continue. | ||
263 | */ | ||
264 | if (p_child->device_type != DEVICE_TYPE_HDMI) | ||
265 | continue; | ||
266 | /* Find the HDMI port */ | ||
267 | if (p_child->dvo_port == hdmi_port) { | ||
268 | ret = 1; | ||
269 | break; | ||
270 | } | ||
271 | } | ||
272 | return ret; | ||
273 | } | ||
274 | void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) | 228 | void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) |
275 | { | 229 | { |
276 | struct drm_i915_private *dev_priv = dev->dev_private; | 230 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -278,10 +232,6 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) | |||
278 | struct intel_output *intel_output; | 232 | struct intel_output *intel_output; |
279 | struct intel_hdmi_priv *hdmi_priv; | 233 | struct intel_hdmi_priv *hdmi_priv; |
280 | 234 | ||
281 | if (!hdmi_is_present_in_vbt(dev, sdvox_reg)) { | ||
282 | DRM_DEBUG_KMS("HDMI is not present. Ignored it \n"); | ||
283 | return; | ||
284 | } | ||
285 | intel_output = kcalloc(sizeof(struct intel_output) + | 235 | intel_output = kcalloc(sizeof(struct intel_output) + |
286 | sizeof(struct intel_hdmi_priv), 1, GFP_KERNEL); | 236 | sizeof(struct intel_hdmi_priv), 1, GFP_KERNEL); |
287 | if (!intel_output) | 237 | if (!intel_output) |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index f4b4aa242df1..aa74e59bec61 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -602,6 +602,20 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder, | |||
602 | /* Some lid devices report incorrect lid status, assume they're connected */ | 602 | /* Some lid devices report incorrect lid status, assume they're connected */ |
603 | static const struct dmi_system_id bad_lid_status[] = { | 603 | static const struct dmi_system_id bad_lid_status[] = { |
604 | { | 604 | { |
605 | .ident = "Compaq nx9020", | ||
606 | .matches = { | ||
607 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
608 | DMI_MATCH(DMI_BOARD_NAME, "3084"), | ||
609 | }, | ||
610 | }, | ||
611 | { | ||
612 | .ident = "Samsung SX20S", | ||
613 | .matches = { | ||
614 | DMI_MATCH(DMI_SYS_VENDOR, "Phoenix Technologies LTD"), | ||
615 | DMI_MATCH(DMI_BOARD_NAME, "SX20S"), | ||
616 | }, | ||
617 | }, | ||
618 | { | ||
605 | .ident = "Aspire One", | 619 | .ident = "Aspire One", |
606 | .matches = { | 620 | .matches = { |
607 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 621 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
@@ -912,7 +926,8 @@ static void intel_find_lvds_downclock(struct drm_device *dev, | |||
912 | } | 926 | } |
913 | } | 927 | } |
914 | mutex_unlock(&dev->mode_config.mutex); | 928 | mutex_unlock(&dev->mode_config.mutex); |
915 | if (temp_downclock < panel_fixed_mode->clock) { | 929 | if (temp_downclock < panel_fixed_mode->clock && |
930 | i915_lvds_downclock) { | ||
916 | /* We found the downclock for LVDS. */ | 931 | /* We found the downclock for LVDS. */ |
917 | dev_priv->lvds_downclock_avail = 1; | 932 | dev_priv->lvds_downclock_avail = 1; |
918 | dev_priv->lvds_downclock = temp_downclock; | 933 | dev_priv->lvds_downclock = temp_downclock; |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index de5144c8c153..eaacfd0920df 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -462,14 +462,63 @@ static int intel_sdvo_get_pixel_multiplier(struct drm_display_mode *mode) | |||
462 | } | 462 | } |
463 | 463 | ||
464 | /** | 464 | /** |
465 | * Don't check status code from this as it switches the bus back to the | 465 | * Try to read the response after issuie the DDC switch command. But it |
466 | * SDVO chips which defeats the purpose of doing a bus switch in the first | 466 | * is noted that we must do the action of reading response and issuing DDC |
467 | * place. | 467 | * switch command in one I2C transaction. Otherwise when we try to start |
468 | * another I2C transaction after issuing the DDC bus switch, it will be | ||
469 | * switched to the internal SDVO register. | ||
468 | */ | 470 | */ |
469 | static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, | 471 | static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, |
470 | u8 target) | 472 | u8 target) |
471 | { | 473 | { |
472 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_CONTROL_BUS_SWITCH, &target, 1); | 474 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; |
475 | u8 out_buf[2], cmd_buf[2], ret_value[2], ret; | ||
476 | struct i2c_msg msgs[] = { | ||
477 | { | ||
478 | .addr = sdvo_priv->slave_addr >> 1, | ||
479 | .flags = 0, | ||
480 | .len = 2, | ||
481 | .buf = out_buf, | ||
482 | }, | ||
483 | /* the following two are to read the response */ | ||
484 | { | ||
485 | .addr = sdvo_priv->slave_addr >> 1, | ||
486 | .flags = 0, | ||
487 | .len = 1, | ||
488 | .buf = cmd_buf, | ||
489 | }, | ||
490 | { | ||
491 | .addr = sdvo_priv->slave_addr >> 1, | ||
492 | .flags = I2C_M_RD, | ||
493 | .len = 1, | ||
494 | .buf = ret_value, | ||
495 | }, | ||
496 | }; | ||
497 | |||
498 | intel_sdvo_debug_write(intel_output, SDVO_CMD_SET_CONTROL_BUS_SWITCH, | ||
499 | &target, 1); | ||
500 | /* write the DDC switch command argument */ | ||
501 | intel_sdvo_write_byte(intel_output, SDVO_I2C_ARG_0, target); | ||
502 | |||
503 | out_buf[0] = SDVO_I2C_OPCODE; | ||
504 | out_buf[1] = SDVO_CMD_SET_CONTROL_BUS_SWITCH; | ||
505 | cmd_buf[0] = SDVO_I2C_CMD_STATUS; | ||
506 | cmd_buf[1] = 0; | ||
507 | ret_value[0] = 0; | ||
508 | ret_value[1] = 0; | ||
509 | |||
510 | ret = i2c_transfer(intel_output->i2c_bus, msgs, 3); | ||
511 | if (ret != 3) { | ||
512 | /* failure in I2C transfer */ | ||
513 | DRM_DEBUG_KMS("I2c transfer returned %d\n", ret); | ||
514 | return; | ||
515 | } | ||
516 | if (ret_value[0] != SDVO_CMD_STATUS_SUCCESS) { | ||
517 | DRM_DEBUG_KMS("DDC switch command returns response %d\n", | ||
518 | ret_value[0]); | ||
519 | return; | ||
520 | } | ||
521 | return; | ||
473 | } | 522 | } |
474 | 523 | ||
475 | static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool target_0, bool target_1) | 524 | static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool target_0, bool target_1) |
@@ -1579,6 +1628,32 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) | |||
1579 | edid = drm_get_edid(&intel_output->base, | 1628 | edid = drm_get_edid(&intel_output->base, |
1580 | intel_output->ddc_bus); | 1629 | intel_output->ddc_bus); |
1581 | 1630 | ||
1631 | /* This is only applied to SDVO cards with multiple outputs */ | ||
1632 | if (edid == NULL && intel_sdvo_multifunc_encoder(intel_output)) { | ||
1633 | uint8_t saved_ddc, temp_ddc; | ||
1634 | saved_ddc = sdvo_priv->ddc_bus; | ||
1635 | temp_ddc = sdvo_priv->ddc_bus >> 1; | ||
1636 | /* | ||
1637 | * Don't use the 1 as the argument of DDC bus switch to get | ||
1638 | * the EDID. It is used for SDVO SPD ROM. | ||
1639 | */ | ||
1640 | while(temp_ddc > 1) { | ||
1641 | sdvo_priv->ddc_bus = temp_ddc; | ||
1642 | edid = drm_get_edid(&intel_output->base, | ||
1643 | intel_output->ddc_bus); | ||
1644 | if (edid) { | ||
1645 | /* | ||
1646 | * When we can get the EDID, maybe it is the | ||
1647 | * correct DDC bus. Update it. | ||
1648 | */ | ||
1649 | sdvo_priv->ddc_bus = temp_ddc; | ||
1650 | break; | ||
1651 | } | ||
1652 | temp_ddc >>= 1; | ||
1653 | } | ||
1654 | if (edid == NULL) | ||
1655 | sdvo_priv->ddc_bus = saved_ddc; | ||
1656 | } | ||
1582 | /* when there is no edid and no monitor is connected with VGA | 1657 | /* when there is no edid and no monitor is connected with VGA |
1583 | * port, try to use the CRT ddc to read the EDID for DVI-connector | 1658 | * port, try to use the CRT ddc to read the EDID for DVI-connector |
1584 | */ | 1659 | */ |
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 1d5b9b7b033f..552ec110b741 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
@@ -1840,8 +1840,6 @@ intel_tv_init(struct drm_device *dev) | |||
1840 | drm_connector_attach_property(connector, | 1840 | drm_connector_attach_property(connector, |
1841 | dev->mode_config.tv_bottom_margin_property, | 1841 | dev->mode_config.tv_bottom_margin_property, |
1842 | tv_priv->margin[TV_MARGIN_BOTTOM]); | 1842 | tv_priv->margin[TV_MARGIN_BOTTOM]); |
1843 | |||
1844 | dev_priv->hotplug_supported_mask |= TV_HOTPLUG_INT_STATUS; | ||
1845 | out: | 1843 | out: |
1846 | drm_sysfs_connector_add(connector); | 1844 | drm_sysfs_connector_add(connector); |
1847 | } | 1845 | } |
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c index f70f46582c6c..4687af40dd50 100644 --- a/drivers/i2c/busses/i2c-ali1563.c +++ b/drivers/i2c/busses/i2c-ali1563.c | |||
@@ -87,9 +87,9 @@ static int ali1563_transaction(struct i2c_adapter * a, int size) | |||
87 | outb_p(inb_p(SMB_HST_CNTL2) | HST_CNTL2_START, SMB_HST_CNTL2); | 87 | outb_p(inb_p(SMB_HST_CNTL2) | HST_CNTL2_START, SMB_HST_CNTL2); |
88 | 88 | ||
89 | timeout = ALI1563_MAX_TIMEOUT; | 89 | timeout = ALI1563_MAX_TIMEOUT; |
90 | do | 90 | do { |
91 | msleep(1); | 91 | msleep(1); |
92 | while (((data = inb_p(SMB_HST_STS)) & HST_STS_BUSY) && --timeout); | 92 | } while (((data = inb_p(SMB_HST_STS)) & HST_STS_BUSY) && --timeout); |
93 | 93 | ||
94 | dev_dbg(&a->dev, "Transaction (post): STS=%02x, CNTL1=%02x, " | 94 | dev_dbg(&a->dev, "Transaction (post): STS=%02x, CNTL1=%02x, " |
95 | "CNTL2=%02x, CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n", | 95 | "CNTL2=%02x, CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n", |
@@ -157,9 +157,9 @@ static int ali1563_block_start(struct i2c_adapter * a) | |||
157 | outb_p(inb_p(SMB_HST_CNTL2) | HST_CNTL2_START, SMB_HST_CNTL2); | 157 | outb_p(inb_p(SMB_HST_CNTL2) | HST_CNTL2_START, SMB_HST_CNTL2); |
158 | 158 | ||
159 | timeout = ALI1563_MAX_TIMEOUT; | 159 | timeout = ALI1563_MAX_TIMEOUT; |
160 | do | 160 | do { |
161 | msleep(1); | 161 | msleep(1); |
162 | while (!((data = inb_p(SMB_HST_STS)) & HST_STS_DONE) && --timeout); | 162 | } while (!((data = inb_p(SMB_HST_STS)) & HST_STS_DONE) && --timeout); |
163 | 163 | ||
164 | dev_dbg(&a->dev, "Block (post): STS=%02x, CNTL1=%02x, " | 164 | dev_dbg(&a->dev, "Block (post): STS=%02x, CNTL1=%02x, " |
165 | "CNTL2=%02x, CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n", | 165 | "CNTL2=%02x, CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n", |
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c index 0ed68e2ccd22..f7346a9bd95f 100644 --- a/drivers/i2c/busses/i2c-pca-isa.c +++ b/drivers/i2c/busses/i2c-pca-isa.c | |||
@@ -75,7 +75,7 @@ static int pca_isa_waitforcompletion(void *pd) | |||
75 | unsigned long timeout; | 75 | unsigned long timeout; |
76 | 76 | ||
77 | if (irq > -1) { | 77 | if (irq > -1) { |
78 | ret = wait_event_interruptible_timeout(pca_wait, | 78 | ret = wait_event_timeout(pca_wait, |
79 | pca_isa_readbyte(pd, I2C_PCA_CON) | 79 | pca_isa_readbyte(pd, I2C_PCA_CON) |
80 | & I2C_PCA_CON_SI, pca_isa_ops.timeout); | 80 | & I2C_PCA_CON_SI, pca_isa_ops.timeout); |
81 | } else { | 81 | } else { |
@@ -96,7 +96,7 @@ static void pca_isa_resetchip(void *pd) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | static irqreturn_t pca_handler(int this_irq, void *dev_id) { | 98 | static irqreturn_t pca_handler(int this_irq, void *dev_id) { |
99 | wake_up_interruptible(&pca_wait); | 99 | wake_up(&pca_wait); |
100 | return IRQ_HANDLED; | 100 | return IRQ_HANDLED; |
101 | } | 101 | } |
102 | 102 | ||
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index c4df9d411cd5..5b2213df5ed0 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c | |||
@@ -84,7 +84,7 @@ static int i2c_pca_pf_waitforcompletion(void *pd) | |||
84 | unsigned long timeout; | 84 | unsigned long timeout; |
85 | 85 | ||
86 | if (i2c->irq) { | 86 | if (i2c->irq) { |
87 | ret = wait_event_interruptible_timeout(i2c->wait, | 87 | ret = wait_event_timeout(i2c->wait, |
88 | i2c->algo_data.read_byte(i2c, I2C_PCA_CON) | 88 | i2c->algo_data.read_byte(i2c, I2C_PCA_CON) |
89 | & I2C_PCA_CON_SI, i2c->adap.timeout); | 89 | & I2C_PCA_CON_SI, i2c->adap.timeout); |
90 | } else { | 90 | } else { |
@@ -122,7 +122,7 @@ static irqreturn_t i2c_pca_pf_handler(int this_irq, void *dev_id) | |||
122 | if ((i2c->algo_data.read_byte(i2c, I2C_PCA_CON) & I2C_PCA_CON_SI) == 0) | 122 | if ((i2c->algo_data.read_byte(i2c, I2C_PCA_CON) & I2C_PCA_CON_SI) == 0) |
123 | return IRQ_NONE; | 123 | return IRQ_NONE; |
124 | 124 | ||
125 | wake_up_interruptible(&i2c->wait); | 125 | wake_up(&i2c->wait); |
126 | 126 | ||
127 | return IRQ_HANDLED; | 127 | return IRQ_HANDLED; |
128 | } | 128 | } |
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 1e245e9cad31..e56e4b6823ca 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c | |||
@@ -324,12 +324,12 @@ static int piix4_transaction(void) | |||
324 | else | 324 | else |
325 | msleep(1); | 325 | msleep(1); |
326 | 326 | ||
327 | while ((timeout++ < MAX_TIMEOUT) && | 327 | while ((++timeout < MAX_TIMEOUT) && |
328 | ((temp = inb_p(SMBHSTSTS)) & 0x01)) | 328 | ((temp = inb_p(SMBHSTSTS)) & 0x01)) |
329 | msleep(1); | 329 | msleep(1); |
330 | 330 | ||
331 | /* If the SMBus is still busy, we give up */ | 331 | /* If the SMBus is still busy, we give up */ |
332 | if (timeout >= MAX_TIMEOUT) { | 332 | if (timeout == MAX_TIMEOUT) { |
333 | dev_err(&piix4_adapter.dev, "SMBus Timeout!\n"); | 333 | dev_err(&piix4_adapter.dev, "SMBus Timeout!\n"); |
334 | result = -ETIMEDOUT; | 334 | result = -ETIMEDOUT; |
335 | } | 335 | } |
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index e4b1543015af..a84a909e1234 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
@@ -165,10 +165,10 @@ static int vt596_transaction(u8 size) | |||
165 | do { | 165 | do { |
166 | msleep(1); | 166 | msleep(1); |
167 | temp = inb_p(SMBHSTSTS); | 167 | temp = inb_p(SMBHSTSTS); |
168 | } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT)); | 168 | } while ((temp & 0x01) && (++timeout < MAX_TIMEOUT)); |
169 | 169 | ||
170 | /* If the SMBus is still busy, we give up */ | 170 | /* If the SMBus is still busy, we give up */ |
171 | if (timeout >= MAX_TIMEOUT) { | 171 | if (timeout == MAX_TIMEOUT) { |
172 | result = -ETIMEDOUT; | 172 | result = -ETIMEDOUT; |
173 | dev_err(&vt596_adapter.dev, "SMBus timeout!\n"); | 173 | dev_err(&vt596_adapter.dev, "SMBus timeout!\n"); |
174 | } | 174 | } |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 0ac2f90ab840..10be7b5fbe97 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -248,7 +248,7 @@ static const struct attribute_group *i2c_dev_attr_groups[] = { | |||
248 | NULL | 248 | NULL |
249 | }; | 249 | }; |
250 | 250 | ||
251 | const static struct dev_pm_ops i2c_device_pm_ops = { | 251 | static const struct dev_pm_ops i2c_device_pm_ops = { |
252 | .suspend = i2c_device_pm_suspend, | 252 | .suspend = i2c_device_pm_suspend, |
253 | .resume = i2c_device_pm_resume, | 253 | .resume = i2c_device_pm_resume, |
254 | }; | 254 | }; |
@@ -843,6 +843,9 @@ int i2c_del_adapter(struct i2c_adapter *adap) | |||
843 | adap->dev.parent); | 843 | adap->dev.parent); |
844 | #endif | 844 | #endif |
845 | 845 | ||
846 | /* device name is gone after device_unregister */ | ||
847 | dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name); | ||
848 | |||
846 | /* clean up the sysfs representation */ | 849 | /* clean up the sysfs representation */ |
847 | init_completion(&adap->dev_released); | 850 | init_completion(&adap->dev_released); |
848 | device_unregister(&adap->dev); | 851 | device_unregister(&adap->dev); |
@@ -855,8 +858,6 @@ int i2c_del_adapter(struct i2c_adapter *adap) | |||
855 | idr_remove(&i2c_adapter_idr, adap->nr); | 858 | idr_remove(&i2c_adapter_idr, adap->nr); |
856 | mutex_unlock(&core_lock); | 859 | mutex_unlock(&core_lock); |
857 | 860 | ||
858 | dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name); | ||
859 | |||
860 | /* Clear the device structure in case this adapter is ever going to be | 861 | /* Clear the device structure in case this adapter is ever going to be |
861 | added again */ | 862 | added again */ |
862 | memset(&adap->dev, 0, sizeof(adap->dev)); | 863 | memset(&adap->dev, 0, sizeof(adap->dev)); |
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index dee6706038aa..258c639571b5 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -59,7 +59,8 @@ static void evdev_pass_event(struct evdev_client *client, | |||
59 | client->head &= EVDEV_BUFFER_SIZE - 1; | 59 | client->head &= EVDEV_BUFFER_SIZE - 1; |
60 | spin_unlock(&client->buffer_lock); | 60 | spin_unlock(&client->buffer_lock); |
61 | 61 | ||
62 | kill_fasync(&client->fasync, SIGIO, POLL_IN); | 62 | if (event->type == EV_SYN) |
63 | kill_fasync(&client->fasync, SIGIO, POLL_IN); | ||
63 | } | 64 | } |
64 | 65 | ||
65 | /* | 66 | /* |
diff --git a/drivers/input/input.c b/drivers/input/input.c index ab060710688f..30b503b8d67b 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/mutex.h> | 24 | #include <linux/mutex.h> |
25 | #include <linux/rcupdate.h> | 25 | #include <linux/rcupdate.h> |
26 | #include <linux/smp_lock.h> | 26 | #include <linux/smp_lock.h> |
27 | #include "input-compat.h" | ||
27 | 28 | ||
28 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); | 29 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); |
29 | MODULE_DESCRIPTION("Input core"); | 30 | MODULE_DESCRIPTION("Input core"); |
@@ -764,6 +765,40 @@ static int input_attach_handler(struct input_dev *dev, struct input_handler *han | |||
764 | return error; | 765 | return error; |
765 | } | 766 | } |
766 | 767 | ||
768 | #ifdef CONFIG_COMPAT | ||
769 | |||
770 | static int input_bits_to_string(char *buf, int buf_size, | ||
771 | unsigned long bits, bool skip_empty) | ||
772 | { | ||
773 | int len = 0; | ||
774 | |||
775 | if (INPUT_COMPAT_TEST) { | ||
776 | u32 dword = bits >> 32; | ||
777 | if (dword || !skip_empty) | ||
778 | len += snprintf(buf, buf_size, "%x ", dword); | ||
779 | |||
780 | dword = bits & 0xffffffffUL; | ||
781 | if (dword || !skip_empty || len) | ||
782 | len += snprintf(buf + len, max(buf_size - len, 0), | ||
783 | "%x", dword); | ||
784 | } else { | ||
785 | if (bits || !skip_empty) | ||
786 | len += snprintf(buf, buf_size, "%lx", bits); | ||
787 | } | ||
788 | |||
789 | return len; | ||
790 | } | ||
791 | |||
792 | #else /* !CONFIG_COMPAT */ | ||
793 | |||
794 | static int input_bits_to_string(char *buf, int buf_size, | ||
795 | unsigned long bits, bool skip_empty) | ||
796 | { | ||
797 | return bits || !skip_empty ? | ||
798 | snprintf(buf, buf_size, "%lx", bits) : 0; | ||
799 | } | ||
800 | |||
801 | #endif | ||
767 | 802 | ||
768 | #ifdef CONFIG_PROC_FS | 803 | #ifdef CONFIG_PROC_FS |
769 | 804 | ||
@@ -832,14 +867,25 @@ static void input_seq_print_bitmap(struct seq_file *seq, const char *name, | |||
832 | unsigned long *bitmap, int max) | 867 | unsigned long *bitmap, int max) |
833 | { | 868 | { |
834 | int i; | 869 | int i; |
835 | 870 | bool skip_empty = true; | |
836 | for (i = BITS_TO_LONGS(max) - 1; i > 0; i--) | 871 | char buf[18]; |
837 | if (bitmap[i]) | ||
838 | break; | ||
839 | 872 | ||
840 | seq_printf(seq, "B: %s=", name); | 873 | seq_printf(seq, "B: %s=", name); |
841 | for (; i >= 0; i--) | 874 | |
842 | seq_printf(seq, "%lx%s", bitmap[i], i > 0 ? " " : ""); | 875 | for (i = BITS_TO_LONGS(max) - 1; i >= 0; i--) { |
876 | if (input_bits_to_string(buf, sizeof(buf), | ||
877 | bitmap[i], skip_empty)) { | ||
878 | skip_empty = false; | ||
879 | seq_printf(seq, "%s%s", buf, i > 0 ? " " : ""); | ||
880 | } | ||
881 | } | ||
882 | |||
883 | /* | ||
884 | * If no output was produced print a single 0. | ||
885 | */ | ||
886 | if (skip_empty) | ||
887 | seq_puts(seq, "0"); | ||
888 | |||
843 | seq_putc(seq, '\n'); | 889 | seq_putc(seq, '\n'); |
844 | } | 890 | } |
845 | 891 | ||
@@ -1128,14 +1174,23 @@ static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap, | |||
1128 | { | 1174 | { |
1129 | int i; | 1175 | int i; |
1130 | int len = 0; | 1176 | int len = 0; |
1177 | bool skip_empty = true; | ||
1178 | |||
1179 | for (i = BITS_TO_LONGS(max) - 1; i >= 0; i--) { | ||
1180 | len += input_bits_to_string(buf + len, max(buf_size - len, 0), | ||
1181 | bitmap[i], skip_empty); | ||
1182 | if (len) { | ||
1183 | skip_empty = false; | ||
1184 | if (i > 0) | ||
1185 | len += snprintf(buf + len, max(buf_size - len, 0), " "); | ||
1186 | } | ||
1187 | } | ||
1131 | 1188 | ||
1132 | for (i = BITS_TO_LONGS(max) - 1; i > 0; i--) | 1189 | /* |
1133 | if (bitmap[i]) | 1190 | * If no output was produced print a single 0. |
1134 | break; | 1191 | */ |
1135 | 1192 | if (len == 0) | |
1136 | for (; i >= 0; i--) | 1193 | len = snprintf(buf, buf_size, "%d", 0); |
1137 | len += snprintf(buf + len, max(buf_size - len, 0), | ||
1138 | "%lx%s", bitmap[i], i > 0 ? " " : ""); | ||
1139 | 1194 | ||
1140 | if (add_cr) | 1195 | if (add_cr) |
1141 | len += snprintf(buf + len, max(buf_size - len, 0), "\n"); | 1196 | len += snprintf(buf + len, max(buf_size - len, 0), "\n"); |
@@ -1150,7 +1205,8 @@ static ssize_t input_dev_show_cap_##bm(struct device *dev, \ | |||
1150 | { \ | 1205 | { \ |
1151 | struct input_dev *input_dev = to_input_dev(dev); \ | 1206 | struct input_dev *input_dev = to_input_dev(dev); \ |
1152 | int len = input_print_bitmap(buf, PAGE_SIZE, \ | 1207 | int len = input_print_bitmap(buf, PAGE_SIZE, \ |
1153 | input_dev->bm##bit, ev##_MAX, 1); \ | 1208 | input_dev->bm##bit, ev##_MAX, \ |
1209 | true); \ | ||
1154 | return min_t(int, len, PAGE_SIZE); \ | 1210 | return min_t(int, len, PAGE_SIZE); \ |
1155 | } \ | 1211 | } \ |
1156 | static DEVICE_ATTR(bm, S_IRUGO, input_dev_show_cap_##bm, NULL) | 1212 | static DEVICE_ATTR(bm, S_IRUGO, input_dev_show_cap_##bm, NULL) |
@@ -1214,7 +1270,7 @@ static int input_add_uevent_bm_var(struct kobj_uevent_env *env, | |||
1214 | 1270 | ||
1215 | len = input_print_bitmap(&env->buf[env->buflen - 1], | 1271 | len = input_print_bitmap(&env->buf[env->buflen - 1], |
1216 | sizeof(env->buf) - env->buflen, | 1272 | sizeof(env->buf) - env->buflen, |
1217 | bitmap, max, 0); | 1273 | bitmap, max, false); |
1218 | if (len >= (sizeof(env->buf) - env->buflen)) | 1274 | if (len >= (sizeof(env->buf) - env->buflen)) |
1219 | return -ENOMEM; | 1275 | return -ENOMEM; |
1220 | 1276 | ||
diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index 67c207f5b1a1..45ac70eae0aa 100644 --- a/drivers/input/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c | |||
@@ -277,7 +277,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
277 | } | 277 | } |
278 | 278 | ||
279 | #ifdef RESET_WORKS | 279 | #ifdef RESET_WORKS |
280 | if ((gf2k->id != (GB(19,2,0) | GB(15,3,2) | GB(12,3,5))) || | 280 | if ((gf2k->id != (GB(19,2,0) | GB(15,3,2) | GB(12,3,5))) && |
281 | (gf2k->id != (GB(31,2,0) | GB(27,3,2) | GB(24,3,5)))) { | 281 | (gf2k->id != (GB(31,2,0) | GB(27,3,2) | GB(24,3,5)))) { |
282 | err = -ENODEV; | 282 | err = -ENODEV; |
283 | goto fail2; | 283 | goto fail2; |
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 482cb1204e43..8a28fb7846dc 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
@@ -446,7 +446,7 @@ static void xpad_irq_in(struct urb *urb) | |||
446 | } | 446 | } |
447 | 447 | ||
448 | exit: | 448 | exit: |
449 | retval = usb_submit_urb (urb, GFP_ATOMIC); | 449 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
450 | if (retval) | 450 | if (retval) |
451 | err ("%s - usb_submit_urb failed with result %d", | 451 | err ("%s - usb_submit_urb failed with result %d", |
452 | __func__, retval); | 452 | __func__, retval); |
@@ -571,7 +571,7 @@ static int xpad_play_effect(struct input_dev *dev, void *data, | |||
571 | xpad->odata[6] = 0x00; | 571 | xpad->odata[6] = 0x00; |
572 | xpad->odata[7] = 0x00; | 572 | xpad->odata[7] = 0x00; |
573 | xpad->irq_out->transfer_buffer_length = 8; | 573 | xpad->irq_out->transfer_buffer_length = 8; |
574 | usb_submit_urb(xpad->irq_out, GFP_KERNEL); | 574 | usb_submit_urb(xpad->irq_out, GFP_ATOMIC); |
575 | } | 575 | } |
576 | 576 | ||
577 | return 0; | 577 | return 0; |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 1f5e2ce327d6..7b4056292eaf 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -225,8 +225,10 @@ struct atkbd { | |||
225 | 225 | ||
226 | struct delayed_work event_work; | 226 | struct delayed_work event_work; |
227 | unsigned long event_jiffies; | 227 | unsigned long event_jiffies; |
228 | struct mutex event_mutex; | ||
229 | unsigned long event_mask; | 228 | unsigned long event_mask; |
229 | |||
230 | /* Serializes reconnect(), attr->set() and event work */ | ||
231 | struct mutex mutex; | ||
230 | }; | 232 | }; |
231 | 233 | ||
232 | /* | 234 | /* |
@@ -577,7 +579,7 @@ static void atkbd_event_work(struct work_struct *work) | |||
577 | { | 579 | { |
578 | struct atkbd *atkbd = container_of(work, struct atkbd, event_work.work); | 580 | struct atkbd *atkbd = container_of(work, struct atkbd, event_work.work); |
579 | 581 | ||
580 | mutex_lock(&atkbd->event_mutex); | 582 | mutex_lock(&atkbd->mutex); |
581 | 583 | ||
582 | if (!atkbd->enabled) { | 584 | if (!atkbd->enabled) { |
583 | /* | 585 | /* |
@@ -596,7 +598,7 @@ static void atkbd_event_work(struct work_struct *work) | |||
596 | atkbd_set_repeat_rate(atkbd); | 598 | atkbd_set_repeat_rate(atkbd); |
597 | } | 599 | } |
598 | 600 | ||
599 | mutex_unlock(&atkbd->event_mutex); | 601 | mutex_unlock(&atkbd->mutex); |
600 | } | 602 | } |
601 | 603 | ||
602 | /* | 604 | /* |
@@ -612,7 +614,7 @@ static void atkbd_schedule_event_work(struct atkbd *atkbd, int event_bit) | |||
612 | 614 | ||
613 | atkbd->event_jiffies = jiffies; | 615 | atkbd->event_jiffies = jiffies; |
614 | set_bit(event_bit, &atkbd->event_mask); | 616 | set_bit(event_bit, &atkbd->event_mask); |
615 | wmb(); | 617 | mb(); |
616 | schedule_delayed_work(&atkbd->event_work, delay); | 618 | schedule_delayed_work(&atkbd->event_work, delay); |
617 | } | 619 | } |
618 | 620 | ||
@@ -849,13 +851,20 @@ static void atkbd_disconnect(struct serio *serio) | |||
849 | { | 851 | { |
850 | struct atkbd *atkbd = serio_get_drvdata(serio); | 852 | struct atkbd *atkbd = serio_get_drvdata(serio); |
851 | 853 | ||
854 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); | ||
855 | |||
852 | atkbd_disable(atkbd); | 856 | atkbd_disable(atkbd); |
853 | 857 | ||
854 | /* make sure we don't have a command in flight */ | 858 | input_unregister_device(atkbd->dev); |
859 | |||
860 | /* | ||
861 | * Make sure we don't have a command in flight. | ||
862 | * Note that since atkbd->enabled is false event work will keep | ||
863 | * rescheduling itself until it gets canceled and will not try | ||
864 | * accessing freed input device or serio port. | ||
865 | */ | ||
855 | cancel_delayed_work_sync(&atkbd->event_work); | 866 | cancel_delayed_work_sync(&atkbd->event_work); |
856 | 867 | ||
857 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); | ||
858 | input_unregister_device(atkbd->dev); | ||
859 | serio_close(serio); | 868 | serio_close(serio); |
860 | serio_set_drvdata(serio, NULL); | 869 | serio_set_drvdata(serio, NULL); |
861 | kfree(atkbd); | 870 | kfree(atkbd); |
@@ -1087,7 +1096,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
1087 | atkbd->dev = dev; | 1096 | atkbd->dev = dev; |
1088 | ps2_init(&atkbd->ps2dev, serio); | 1097 | ps2_init(&atkbd->ps2dev, serio); |
1089 | INIT_DELAYED_WORK(&atkbd->event_work, atkbd_event_work); | 1098 | INIT_DELAYED_WORK(&atkbd->event_work, atkbd_event_work); |
1090 | mutex_init(&atkbd->event_mutex); | 1099 | mutex_init(&atkbd->mutex); |
1091 | 1100 | ||
1092 | switch (serio->id.type) { | 1101 | switch (serio->id.type) { |
1093 | 1102 | ||
@@ -1160,19 +1169,23 @@ static int atkbd_reconnect(struct serio *serio) | |||
1160 | { | 1169 | { |
1161 | struct atkbd *atkbd = serio_get_drvdata(serio); | 1170 | struct atkbd *atkbd = serio_get_drvdata(serio); |
1162 | struct serio_driver *drv = serio->drv; | 1171 | struct serio_driver *drv = serio->drv; |
1172 | int retval = -1; | ||
1163 | 1173 | ||
1164 | if (!atkbd || !drv) { | 1174 | if (!atkbd || !drv) { |
1165 | printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n"); | 1175 | printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n"); |
1166 | return -1; | 1176 | return -1; |
1167 | } | 1177 | } |
1168 | 1178 | ||
1179 | mutex_lock(&atkbd->mutex); | ||
1180 | |||
1169 | atkbd_disable(atkbd); | 1181 | atkbd_disable(atkbd); |
1170 | 1182 | ||
1171 | if (atkbd->write) { | 1183 | if (atkbd->write) { |
1172 | if (atkbd_probe(atkbd)) | 1184 | if (atkbd_probe(atkbd)) |
1173 | return -1; | 1185 | goto out; |
1186 | |||
1174 | if (atkbd->set != atkbd_select_set(atkbd, atkbd->set, atkbd->extra)) | 1187 | if (atkbd->set != atkbd_select_set(atkbd, atkbd->set, atkbd->extra)) |
1175 | return -1; | 1188 | goto out; |
1176 | 1189 | ||
1177 | atkbd_activate(atkbd); | 1190 | atkbd_activate(atkbd); |
1178 | 1191 | ||
@@ -1190,8 +1203,11 @@ static int atkbd_reconnect(struct serio *serio) | |||
1190 | } | 1203 | } |
1191 | 1204 | ||
1192 | atkbd_enable(atkbd); | 1205 | atkbd_enable(atkbd); |
1206 | retval = 0; | ||
1193 | 1207 | ||
1194 | return 0; | 1208 | out: |
1209 | mutex_unlock(&atkbd->mutex); | ||
1210 | return retval; | ||
1195 | } | 1211 | } |
1196 | 1212 | ||
1197 | static struct serio_device_id atkbd_serio_ids[] = { | 1213 | static struct serio_device_id atkbd_serio_ids[] = { |
@@ -1235,47 +1251,28 @@ static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf, | |||
1235 | ssize_t (*handler)(struct atkbd *, char *)) | 1251 | ssize_t (*handler)(struct atkbd *, char *)) |
1236 | { | 1252 | { |
1237 | struct serio *serio = to_serio_port(dev); | 1253 | struct serio *serio = to_serio_port(dev); |
1238 | int retval; | 1254 | struct atkbd *atkbd = serio_get_drvdata(serio); |
1239 | |||
1240 | retval = serio_pin_driver(serio); | ||
1241 | if (retval) | ||
1242 | return retval; | ||
1243 | |||
1244 | if (serio->drv != &atkbd_drv) { | ||
1245 | retval = -ENODEV; | ||
1246 | goto out; | ||
1247 | } | ||
1248 | |||
1249 | retval = handler((struct atkbd *)serio_get_drvdata(serio), buf); | ||
1250 | 1255 | ||
1251 | out: | 1256 | return handler(atkbd, buf); |
1252 | serio_unpin_driver(serio); | ||
1253 | return retval; | ||
1254 | } | 1257 | } |
1255 | 1258 | ||
1256 | static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count, | 1259 | static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count, |
1257 | ssize_t (*handler)(struct atkbd *, const char *, size_t)) | 1260 | ssize_t (*handler)(struct atkbd *, const char *, size_t)) |
1258 | { | 1261 | { |
1259 | struct serio *serio = to_serio_port(dev); | 1262 | struct serio *serio = to_serio_port(dev); |
1260 | struct atkbd *atkbd; | 1263 | struct atkbd *atkbd = serio_get_drvdata(serio); |
1261 | int retval; | 1264 | int retval; |
1262 | 1265 | ||
1263 | retval = serio_pin_driver(serio); | 1266 | retval = mutex_lock_interruptible(&atkbd->mutex); |
1264 | if (retval) | 1267 | if (retval) |
1265 | return retval; | 1268 | return retval; |
1266 | 1269 | ||
1267 | if (serio->drv != &atkbd_drv) { | ||
1268 | retval = -ENODEV; | ||
1269 | goto out; | ||
1270 | } | ||
1271 | |||
1272 | atkbd = serio_get_drvdata(serio); | ||
1273 | atkbd_disable(atkbd); | 1270 | atkbd_disable(atkbd); |
1274 | retval = handler(atkbd, buf, count); | 1271 | retval = handler(atkbd, buf, count); |
1275 | atkbd_enable(atkbd); | 1272 | atkbd_enable(atkbd); |
1276 | 1273 | ||
1277 | out: | 1274 | mutex_unlock(&atkbd->mutex); |
1278 | serio_unpin_driver(serio); | 1275 | |
1279 | return retval; | 1276 | return retval; |
1280 | } | 1277 | } |
1281 | 1278 | ||
diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c index 6e52d855f637..d410d7a52f1d 100644 --- a/drivers/input/keyboard/davinci_keyscan.c +++ b/drivers/input/keyboard/davinci_keyscan.c | |||
@@ -174,6 +174,14 @@ static int __init davinci_ks_probe(struct platform_device *pdev) | |||
174 | struct davinci_ks_platform_data *pdata = pdev->dev.platform_data; | 174 | struct davinci_ks_platform_data *pdata = pdev->dev.platform_data; |
175 | int error, i; | 175 | int error, i; |
176 | 176 | ||
177 | if (pdata->device_enable) { | ||
178 | error = pdata->device_enable(dev); | ||
179 | if (error < 0) { | ||
180 | dev_dbg(dev, "device enable function failed\n"); | ||
181 | return error; | ||
182 | } | ||
183 | } | ||
184 | |||
177 | if (!pdata->keymap) { | 185 | if (!pdata->keymap) { |
178 | dev_dbg(dev, "no keymap from pdata\n"); | 186 | dev_dbg(dev, "no keymap from pdata\n"); |
179 | return -EINVAL; | 187 | return -EINVAL; |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 0d1d33468b43..4f8fe0886b2a 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -139,6 +139,7 @@ struct tp_finger { | |||
139 | /* trackpad finger data size, empirically at least ten fingers */ | 139 | /* trackpad finger data size, empirically at least ten fingers */ |
140 | #define SIZEOF_FINGER sizeof(struct tp_finger) | 140 | #define SIZEOF_FINGER sizeof(struct tp_finger) |
141 | #define SIZEOF_ALL_FINGERS (16 * SIZEOF_FINGER) | 141 | #define SIZEOF_ALL_FINGERS (16 * SIZEOF_FINGER) |
142 | #define MAX_FINGER_ORIENTATION 16384 | ||
142 | 143 | ||
143 | /* device-specific parameters */ | 144 | /* device-specific parameters */ |
144 | struct bcm5974_param { | 145 | struct bcm5974_param { |
@@ -284,6 +285,26 @@ static void setup_events_to_report(struct input_dev *input_dev, | |||
284 | input_set_abs_params(input_dev, ABS_Y, | 285 | input_set_abs_params(input_dev, ABS_Y, |
285 | 0, cfg->y.dim, cfg->y.fuzz, 0); | 286 | 0, cfg->y.dim, cfg->y.fuzz, 0); |
286 | 287 | ||
288 | /* finger touch area */ | ||
289 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, | ||
290 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
291 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MINOR, | ||
292 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
293 | /* finger approach area */ | ||
294 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, | ||
295 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
296 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MINOR, | ||
297 | cfg->w.devmin, cfg->w.devmax, 0, 0); | ||
298 | /* finger orientation */ | ||
299 | input_set_abs_params(input_dev, ABS_MT_ORIENTATION, | ||
300 | -MAX_FINGER_ORIENTATION, | ||
301 | MAX_FINGER_ORIENTATION, 0, 0); | ||
302 | /* finger position */ | ||
303 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | ||
304 | cfg->x.devmin, cfg->x.devmax, 0, 0); | ||
305 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, | ||
306 | cfg->y.devmin, cfg->y.devmax, 0, 0); | ||
307 | |||
287 | __set_bit(EV_KEY, input_dev->evbit); | 308 | __set_bit(EV_KEY, input_dev->evbit); |
288 | __set_bit(BTN_TOUCH, input_dev->keybit); | 309 | __set_bit(BTN_TOUCH, input_dev->keybit); |
289 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); | 310 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); |
@@ -310,13 +331,29 @@ static int report_bt_state(struct bcm5974 *dev, int size) | |||
310 | return 0; | 331 | return 0; |
311 | } | 332 | } |
312 | 333 | ||
334 | static void report_finger_data(struct input_dev *input, | ||
335 | const struct bcm5974_config *cfg, | ||
336 | const struct tp_finger *f) | ||
337 | { | ||
338 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, raw2int(f->force_major)); | ||
339 | input_report_abs(input, ABS_MT_TOUCH_MINOR, raw2int(f->force_minor)); | ||
340 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, raw2int(f->size_major)); | ||
341 | input_report_abs(input, ABS_MT_WIDTH_MINOR, raw2int(f->size_minor)); | ||
342 | input_report_abs(input, ABS_MT_ORIENTATION, | ||
343 | MAX_FINGER_ORIENTATION - raw2int(f->orientation)); | ||
344 | input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x)); | ||
345 | input_report_abs(input, ABS_MT_POSITION_Y, | ||
346 | cfg->y.devmin + cfg->y.devmax - raw2int(f->abs_y)); | ||
347 | input_mt_sync(input); | ||
348 | } | ||
349 | |||
313 | /* report trackpad data as logical trackpad state */ | 350 | /* report trackpad data as logical trackpad state */ |
314 | static int report_tp_state(struct bcm5974 *dev, int size) | 351 | static int report_tp_state(struct bcm5974 *dev, int size) |
315 | { | 352 | { |
316 | const struct bcm5974_config *c = &dev->cfg; | 353 | const struct bcm5974_config *c = &dev->cfg; |
317 | const struct tp_finger *f; | 354 | const struct tp_finger *f; |
318 | struct input_dev *input = dev->input; | 355 | struct input_dev *input = dev->input; |
319 | int raw_p, raw_w, raw_x, raw_y, raw_n; | 356 | int raw_p, raw_w, raw_x, raw_y, raw_n, i; |
320 | int ptest, origin, ibt = 0, nmin = 0, nmax = 0; | 357 | int ptest, origin, ibt = 0, nmin = 0, nmax = 0; |
321 | int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0; | 358 | int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0; |
322 | 359 | ||
@@ -329,6 +366,11 @@ static int report_tp_state(struct bcm5974 *dev, int size) | |||
329 | 366 | ||
330 | /* always track the first finger; when detached, start over */ | 367 | /* always track the first finger; when detached, start over */ |
331 | if (raw_n) { | 368 | if (raw_n) { |
369 | |||
370 | /* report raw trackpad data */ | ||
371 | for (i = 0; i < raw_n; i++) | ||
372 | report_finger_data(input, c, &f[i]); | ||
373 | |||
332 | raw_p = raw2int(f->force_major); | 374 | raw_p = raw2int(f->force_major); |
333 | raw_w = raw2int(f->size_major); | 375 | raw_w = raw2int(f->size_major); |
334 | raw_x = raw2int(f->abs_x); | 376 | raw_x = raw2int(f->abs_x); |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 401ac6b6edd4..9774bdfaa482 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -627,8 +627,15 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
627 | synaptics_hardware = true; | 627 | synaptics_hardware = true; |
628 | 628 | ||
629 | if (max_proto > PSMOUSE_IMEX) { | 629 | if (max_proto > PSMOUSE_IMEX) { |
630 | if (!set_properties || synaptics_init(psmouse) == 0) | 630 | /* |
631 | * Try activating protocol, but check if support is enabled first, since | ||
632 | * we try detecting Synaptics even when protocol is disabled. | ||
633 | */ | ||
634 | if (synaptics_supported() && | ||
635 | (!set_properties || synaptics_init(psmouse) == 0)) { | ||
631 | return PSMOUSE_SYNAPTICS; | 636 | return PSMOUSE_SYNAPTICS; |
637 | } | ||
638 | |||
632 | /* | 639 | /* |
633 | * Some Synaptics touchpads can emulate extended protocols (like IMPS/2). | 640 | * Some Synaptics touchpads can emulate extended protocols (like IMPS/2). |
634 | * Unfortunately Logitech/Genius probes confuse some firmware versions so | 641 | * Unfortunately Logitech/Genius probes confuse some firmware versions so |
@@ -683,19 +690,6 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
683 | max_proto = PSMOUSE_IMEX; | 690 | max_proto = PSMOUSE_IMEX; |
684 | } | 691 | } |
685 | 692 | ||
686 | /* | ||
687 | * Try Finger Sensing Pad | ||
688 | */ | ||
689 | if (max_proto > PSMOUSE_IMEX) { | ||
690 | if (fsp_detect(psmouse, set_properties) == 0) { | ||
691 | if (!set_properties || fsp_init(psmouse) == 0) | ||
692 | return PSMOUSE_FSP; | ||
693 | /* | ||
694 | * Init failed, try basic relative protocols | ||
695 | */ | ||
696 | max_proto = PSMOUSE_IMEX; | ||
697 | } | ||
698 | } | ||
699 | 693 | ||
700 | if (max_proto > PSMOUSE_IMEX) { | 694 | if (max_proto > PSMOUSE_IMEX) { |
701 | if (genius_detect(psmouse, set_properties) == 0) | 695 | if (genius_detect(psmouse, set_properties) == 0) |
@@ -712,6 +706,21 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
712 | } | 706 | } |
713 | 707 | ||
714 | /* | 708 | /* |
709 | * Try Finger Sensing Pad. We do it here because its probe upsets | ||
710 | * Trackpoint devices (causing TP_READ_ID command to time out). | ||
711 | */ | ||
712 | if (max_proto > PSMOUSE_IMEX) { | ||
713 | if (fsp_detect(psmouse, set_properties) == 0) { | ||
714 | if (!set_properties || fsp_init(psmouse) == 0) | ||
715 | return PSMOUSE_FSP; | ||
716 | /* | ||
717 | * Init failed, try basic relative protocols | ||
718 | */ | ||
719 | max_proto = PSMOUSE_IMEX; | ||
720 | } | ||
721 | } | ||
722 | |||
723 | /* | ||
715 | * Reset to defaults in case the device got confused by extended | 724 | * Reset to defaults in case the device got confused by extended |
716 | * protocol probes. Note that we follow up with full reset because | 725 | * protocol probes. Note that we follow up with full reset because |
717 | * some mice put themselves to sleep when they see PSMOUSE_RESET_DIS. | 726 | * some mice put themselves to sleep when they see PSMOUSE_RESET_DIS. |
@@ -1450,24 +1459,10 @@ ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *de | |||
1450 | struct serio *serio = to_serio_port(dev); | 1459 | struct serio *serio = to_serio_port(dev); |
1451 | struct psmouse_attribute *attr = to_psmouse_attr(devattr); | 1460 | struct psmouse_attribute *attr = to_psmouse_attr(devattr); |
1452 | struct psmouse *psmouse; | 1461 | struct psmouse *psmouse; |
1453 | int retval; | ||
1454 | |||
1455 | retval = serio_pin_driver(serio); | ||
1456 | if (retval) | ||
1457 | return retval; | ||
1458 | |||
1459 | if (serio->drv != &psmouse_drv) { | ||
1460 | retval = -ENODEV; | ||
1461 | goto out; | ||
1462 | } | ||
1463 | 1462 | ||
1464 | psmouse = serio_get_drvdata(serio); | 1463 | psmouse = serio_get_drvdata(serio); |
1465 | 1464 | ||
1466 | retval = attr->show(psmouse, attr->data, buf); | 1465 | return attr->show(psmouse, attr->data, buf); |
1467 | |||
1468 | out: | ||
1469 | serio_unpin_driver(serio); | ||
1470 | return retval; | ||
1471 | } | 1466 | } |
1472 | 1467 | ||
1473 | ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *devattr, | 1468 | ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *devattr, |
@@ -1478,18 +1473,9 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev | |||
1478 | struct psmouse *psmouse, *parent = NULL; | 1473 | struct psmouse *psmouse, *parent = NULL; |
1479 | int retval; | 1474 | int retval; |
1480 | 1475 | ||
1481 | retval = serio_pin_driver(serio); | ||
1482 | if (retval) | ||
1483 | return retval; | ||
1484 | |||
1485 | if (serio->drv != &psmouse_drv) { | ||
1486 | retval = -ENODEV; | ||
1487 | goto out_unpin; | ||
1488 | } | ||
1489 | |||
1490 | retval = mutex_lock_interruptible(&psmouse_mutex); | 1476 | retval = mutex_lock_interruptible(&psmouse_mutex); |
1491 | if (retval) | 1477 | if (retval) |
1492 | goto out_unpin; | 1478 | goto out; |
1493 | 1479 | ||
1494 | psmouse = serio_get_drvdata(serio); | 1480 | psmouse = serio_get_drvdata(serio); |
1495 | 1481 | ||
@@ -1519,8 +1505,7 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev | |||
1519 | 1505 | ||
1520 | out_unlock: | 1506 | out_unlock: |
1521 | mutex_unlock(&psmouse_mutex); | 1507 | mutex_unlock(&psmouse_mutex); |
1522 | out_unpin: | 1508 | out: |
1523 | serio_unpin_driver(serio); | ||
1524 | return retval; | 1509 | return retval; |
1525 | } | 1510 | } |
1526 | 1511 | ||
@@ -1582,9 +1567,7 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co | |||
1582 | } | 1567 | } |
1583 | 1568 | ||
1584 | mutex_unlock(&psmouse_mutex); | 1569 | mutex_unlock(&psmouse_mutex); |
1585 | serio_unpin_driver(serio); | ||
1586 | serio_unregister_child_port(serio); | 1570 | serio_unregister_child_port(serio); |
1587 | serio_pin_driver_uninterruptible(serio); | ||
1588 | mutex_lock(&psmouse_mutex); | 1571 | mutex_lock(&psmouse_mutex); |
1589 | 1572 | ||
1590 | if (serio->drv != &psmouse_drv) { | 1573 | if (serio->drv != &psmouse_drv) { |
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 77b9fd0b3fbf..81a6b81cb2fe 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Finger Sensing Pad PS/2 mouse driver. | 2 | * Finger Sensing Pad PS/2 mouse driver. |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. | 4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. |
5 | * Copyright (C) 2005-2009 Tai-hwa Liang, Sentelic Corporation. | 5 | * Copyright (C) 2005-2010 Tai-hwa Liang, Sentelic Corporation. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
@@ -658,9 +658,9 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) | |||
658 | if (packet[3] & BIT(1)) | 658 | if (packet[3] & BIT(1)) |
659 | button_status |= 0x0f; /* wheel up */ | 659 | button_status |= 0x0f; /* wheel up */ |
660 | if (packet[3] & BIT(2)) | 660 | if (packet[3] & BIT(2)) |
661 | button_status |= BIT(5);/* horizontal left */ | 661 | button_status |= BIT(4);/* horizontal left */ |
662 | if (packet[3] & BIT(3)) | 662 | if (packet[3] & BIT(3)) |
663 | button_status |= BIT(4);/* horizontal right */ | 663 | button_status |= BIT(5);/* horizontal right */ |
664 | /* push back to packet queue */ | 664 | /* push back to packet queue */ |
665 | if (button_status != 0) | 665 | if (button_status != 0) |
666 | packet[3] = button_status; | 666 | packet[3] = button_status; |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 05689e732191..d3f5243fa093 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -743,6 +743,11 @@ int synaptics_init(struct psmouse *psmouse) | |||
743 | return -1; | 743 | return -1; |
744 | } | 744 | } |
745 | 745 | ||
746 | bool synaptics_supported(void) | ||
747 | { | ||
748 | return true; | ||
749 | } | ||
750 | |||
746 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 751 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
747 | 752 | ||
748 | void __init synaptics_module_init(void) | 753 | void __init synaptics_module_init(void) |
@@ -754,5 +759,10 @@ int synaptics_init(struct psmouse *psmouse) | |||
754 | return -ENOSYS; | 759 | return -ENOSYS; |
755 | } | 760 | } |
756 | 761 | ||
762 | bool synaptics_supported(void) | ||
763 | { | ||
764 | return false; | ||
765 | } | ||
766 | |||
757 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 767 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
758 | 768 | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 838e7f2c9b30..f0f40a331dc8 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -109,5 +109,6 @@ void synaptics_module_init(void); | |||
109 | int synaptics_detect(struct psmouse *psmouse, bool set_properties); | 109 | int synaptics_detect(struct psmouse *psmouse, bool set_properties); |
110 | int synaptics_init(struct psmouse *psmouse); | 110 | int synaptics_init(struct psmouse *psmouse); |
111 | void synaptics_reset(struct psmouse *psmouse); | 111 | void synaptics_reset(struct psmouse *psmouse); |
112 | bool synaptics_supported(void); | ||
112 | 113 | ||
113 | #endif /* _SYNAPTICS_H */ | 114 | #endif /* _SYNAPTICS_H */ |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 64b688daf48a..2a5982e532f8 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -524,6 +524,13 @@ static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = { | |||
524 | */ | 524 | */ |
525 | static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = { | 525 | static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = { |
526 | { | 526 | { |
527 | /* Acer Aspire 5610 */ | ||
528 | .matches = { | ||
529 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
530 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), | ||
531 | }, | ||
532 | }, | ||
533 | { | ||
527 | /* Acer Aspire 5630 */ | 534 | /* Acer Aspire 5630 */ |
528 | .matches = { | 535 | .matches = { |
529 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 536 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index cebbd9079d53..d6ee28f6ea08 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -582,7 +582,6 @@ extern s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | |||
582 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); | 582 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); |
583 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | 583 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, |
584 | u16 data); | 584 | u16 data); |
585 | extern s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow); | ||
586 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); | 585 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); |
587 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); | 586 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); |
588 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); | 587 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index ad08cf3f40c0..8b6ecd127889 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -138,6 +138,10 @@ | |||
138 | #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */ | 138 | #define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */ |
139 | #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */ | 139 | #define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */ |
140 | 140 | ||
141 | /* KMRN Mode Control */ | ||
142 | #define HV_KMRN_MODE_CTRL PHY_REG(769, 16) | ||
143 | #define HV_KMRN_MDIO_SLOW 0x0400 | ||
144 | |||
141 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ | 145 | /* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ |
142 | /* Offset 04h HSFSTS */ | 146 | /* Offset 04h HSFSTS */ |
143 | union ich8_hws_flash_status { | 147 | union ich8_hws_flash_status { |
@@ -219,6 +223,7 @@ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active); | |||
219 | static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw); | 223 | static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw); |
220 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); | 224 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); |
221 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | 225 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); |
226 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | ||
222 | 227 | ||
223 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 228 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
224 | { | 229 | { |
@@ -270,7 +275,21 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
270 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | 275 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; |
271 | 276 | ||
272 | phy->id = e1000_phy_unknown; | 277 | phy->id = e1000_phy_unknown; |
273 | e1000e_get_phy_id(hw); | 278 | ret_val = e1000e_get_phy_id(hw); |
279 | if (ret_val) | ||
280 | goto out; | ||
281 | if ((phy->id == 0) || (phy->id == PHY_REVISION_MASK)) { | ||
282 | /* | ||
283 | * In case the PHY needs to be in mdio slow mode (eg. 82577), | ||
284 | * set slow mode and try to get the PHY id again. | ||
285 | */ | ||
286 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
287 | if (ret_val) | ||
288 | goto out; | ||
289 | ret_val = e1000e_get_phy_id(hw); | ||
290 | if (ret_val) | ||
291 | goto out; | ||
292 | } | ||
274 | phy->type = e1000e_get_phy_type_from_id(phy->id); | 293 | phy->type = e1000e_get_phy_type_from_id(phy->id); |
275 | 294 | ||
276 | switch (phy->type) { | 295 | switch (phy->type) { |
@@ -292,6 +311,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
292 | break; | 311 | break; |
293 | } | 312 | } |
294 | 313 | ||
314 | out: | ||
295 | return ret_val; | 315 | return ret_val; |
296 | } | 316 | } |
297 | 317 | ||
@@ -1076,16 +1096,44 @@ out: | |||
1076 | 1096 | ||
1077 | 1097 | ||
1078 | /** | 1098 | /** |
1099 | * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode | ||
1100 | * @hw: pointer to the HW structure | ||
1101 | **/ | ||
1102 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw) | ||
1103 | { | ||
1104 | s32 ret_val; | ||
1105 | u16 data; | ||
1106 | |||
1107 | ret_val = e1e_rphy(hw, HV_KMRN_MODE_CTRL, &data); | ||
1108 | if (ret_val) | ||
1109 | return ret_val; | ||
1110 | |||
1111 | data |= HV_KMRN_MDIO_SLOW; | ||
1112 | |||
1113 | ret_val = e1e_wphy(hw, HV_KMRN_MODE_CTRL, data); | ||
1114 | |||
1115 | return ret_val; | ||
1116 | } | ||
1117 | |||
1118 | /** | ||
1079 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be | 1119 | * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be |
1080 | * done after every PHY reset. | 1120 | * done after every PHY reset. |
1081 | **/ | 1121 | **/ |
1082 | static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | 1122 | static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) |
1083 | { | 1123 | { |
1084 | s32 ret_val = 0; | 1124 | s32 ret_val = 0; |
1125 | u16 phy_data; | ||
1085 | 1126 | ||
1086 | if (hw->mac.type != e1000_pchlan) | 1127 | if (hw->mac.type != e1000_pchlan) |
1087 | return ret_val; | 1128 | return ret_val; |
1088 | 1129 | ||
1130 | /* Set MDIO slow mode before any other MDIO access */ | ||
1131 | if (hw->phy.type == e1000_phy_82577) { | ||
1132 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
1133 | if (ret_val) | ||
1134 | goto out; | ||
1135 | } | ||
1136 | |||
1089 | if (((hw->phy.type == e1000_phy_82577) && | 1137 | if (((hw->phy.type == e1000_phy_82577) && |
1090 | ((hw->phy.revision == 1) || (hw->phy.revision == 2))) || | 1138 | ((hw->phy.revision == 1) || (hw->phy.revision == 2))) || |
1091 | ((hw->phy.type == e1000_phy_82578) && (hw->phy.revision == 1))) { | 1139 | ((hw->phy.type == e1000_phy_82578) && (hw->phy.revision == 1))) { |
@@ -1118,16 +1166,32 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) | |||
1118 | 1166 | ||
1119 | hw->phy.addr = 1; | 1167 | hw->phy.addr = 1; |
1120 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); | 1168 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); |
1169 | hw->phy.ops.release(hw); | ||
1121 | if (ret_val) | 1170 | if (ret_val) |
1122 | goto out; | 1171 | goto out; |
1123 | hw->phy.ops.release(hw); | ||
1124 | 1172 | ||
1125 | /* | 1173 | /* |
1126 | * Configure the K1 Si workaround during phy reset assuming there is | 1174 | * Configure the K1 Si workaround during phy reset assuming there is |
1127 | * link so that it disables K1 if link is in 1Gbps. | 1175 | * link so that it disables K1 if link is in 1Gbps. |
1128 | */ | 1176 | */ |
1129 | ret_val = e1000_k1_gig_workaround_hv(hw, true); | 1177 | ret_val = e1000_k1_gig_workaround_hv(hw, true); |
1178 | if (ret_val) | ||
1179 | goto out; | ||
1130 | 1180 | ||
1181 | /* Workaround for link disconnects on a busy hub in half duplex */ | ||
1182 | ret_val = hw->phy.ops.acquire(hw); | ||
1183 | if (ret_val) | ||
1184 | goto out; | ||
1185 | ret_val = hw->phy.ops.read_reg_locked(hw, | ||
1186 | PHY_REG(BM_PORT_CTRL_PAGE, 17), | ||
1187 | &phy_data); | ||
1188 | if (ret_val) | ||
1189 | goto release; | ||
1190 | ret_val = hw->phy.ops.write_reg_locked(hw, | ||
1191 | PHY_REG(BM_PORT_CTRL_PAGE, 17), | ||
1192 | phy_data & 0x00FF); | ||
1193 | release: | ||
1194 | hw->phy.ops.release(hw); | ||
1131 | out: | 1195 | out: |
1132 | return ret_val; | 1196 | return ret_val; |
1133 | } | 1197 | } |
@@ -1184,6 +1248,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
1184 | /* Allow time for h/w to get to a quiescent state after reset */ | 1248 | /* Allow time for h/w to get to a quiescent state after reset */ |
1185 | mdelay(10); | 1249 | mdelay(10); |
1186 | 1250 | ||
1251 | /* Perform any necessary post-reset workarounds */ | ||
1187 | if (hw->mac.type == e1000_pchlan) { | 1252 | if (hw->mac.type == e1000_pchlan) { |
1188 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | 1253 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); |
1189 | if (ret_val) | 1254 | if (ret_val) |
@@ -2484,6 +2549,10 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2484 | if (!ret_val) | 2549 | if (!ret_val) |
2485 | e1000_release_swflag_ich8lan(hw); | 2550 | e1000_release_swflag_ich8lan(hw); |
2486 | 2551 | ||
2552 | /* Perform any necessary post-reset workarounds */ | ||
2553 | if (hw->mac.type == e1000_pchlan) | ||
2554 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | ||
2555 | |||
2487 | if (ctrl & E1000_CTRL_PHY_RST) | 2556 | if (ctrl & E1000_CTRL_PHY_RST) |
2488 | ret_val = hw->phy.ops.get_cfg_done(hw); | 2557 | ret_val = hw->phy.ops.get_cfg_done(hw); |
2489 | 2558 | ||
@@ -2528,9 +2597,6 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2528 | kab |= E1000_KABGTXD_BGSQLBIAS; | 2597 | kab |= E1000_KABGTXD_BGSQLBIAS; |
2529 | ew32(KABGTXD, kab); | 2598 | ew32(KABGTXD, kab); |
2530 | 2599 | ||
2531 | if (hw->mac.type == e1000_pchlan) | ||
2532 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | ||
2533 | |||
2534 | out: | 2600 | out: |
2535 | return ret_val; | 2601 | return ret_val; |
2536 | } | 2602 | } |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 55a2c0acfee7..7f3ceb9dad6a 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -152,32 +152,9 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw) | |||
152 | if (phy->id != 0 && phy->id != PHY_REVISION_MASK) | 152 | if (phy->id != 0 && phy->id != PHY_REVISION_MASK) |
153 | goto out; | 153 | goto out; |
154 | 154 | ||
155 | /* | ||
156 | * If the PHY ID is still unknown, we may have an 82577 | ||
157 | * without link. We will try again after setting Slow MDIC | ||
158 | * mode. No harm in trying again in this case since the PHY | ||
159 | * ID is unknown at this point anyway. | ||
160 | */ | ||
161 | ret_val = phy->ops.acquire(hw); | ||
162 | if (ret_val) | ||
163 | goto out; | ||
164 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
165 | if (ret_val) | ||
166 | goto out; | ||
167 | phy->ops.release(hw); | ||
168 | |||
169 | retry_count++; | 155 | retry_count++; |
170 | } | 156 | } |
171 | out: | 157 | out: |
172 | /* Revert to MDIO fast mode, if applicable */ | ||
173 | if (retry_count) { | ||
174 | ret_val = phy->ops.acquire(hw); | ||
175 | if (ret_val) | ||
176 | return ret_val; | ||
177 | ret_val = e1000_set_mdio_slow_mode_hv(hw, false); | ||
178 | phy->ops.release(hw); | ||
179 | } | ||
180 | |||
181 | return ret_val; | 158 | return ret_val; |
182 | } | 159 | } |
183 | 160 | ||
@@ -2791,38 +2768,6 @@ static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active) | |||
2791 | } | 2768 | } |
2792 | 2769 | ||
2793 | /** | 2770 | /** |
2794 | * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode | ||
2795 | * @hw: pointer to the HW structure | ||
2796 | * @slow: true for slow mode, false for normal mode | ||
2797 | * | ||
2798 | * Assumes semaphore already acquired. | ||
2799 | **/ | ||
2800 | s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow) | ||
2801 | { | ||
2802 | s32 ret_val = 0; | ||
2803 | u16 data = 0; | ||
2804 | |||
2805 | /* Set MDIO mode - page 769, register 16: 0x2580==slow, 0x2180==fast */ | ||
2806 | hw->phy.addr = 1; | ||
2807 | ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, | ||
2808 | (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); | ||
2809 | if (ret_val) | ||
2810 | goto out; | ||
2811 | |||
2812 | ret_val = e1000e_write_phy_reg_mdic(hw, BM_CS_CTRL1, | ||
2813 | (0x2180 | (slow << 10))); | ||
2814 | if (ret_val) | ||
2815 | goto out; | ||
2816 | |||
2817 | /* dummy read when reverting to fast mode - throw away result */ | ||
2818 | if (!slow) | ||
2819 | ret_val = e1000e_read_phy_reg_mdic(hw, BM_CS_CTRL1, &data); | ||
2820 | |||
2821 | out: | ||
2822 | return ret_val; | ||
2823 | } | ||
2824 | |||
2825 | /** | ||
2826 | * __e1000_read_phy_reg_hv - Read HV PHY register | 2771 | * __e1000_read_phy_reg_hv - Read HV PHY register |
2827 | * @hw: pointer to the HW structure | 2772 | * @hw: pointer to the HW structure |
2828 | * @offset: register offset to be read | 2773 | * @offset: register offset to be read |
@@ -2839,7 +2784,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2839 | s32 ret_val; | 2784 | s32 ret_val; |
2840 | u16 page = BM_PHY_REG_PAGE(offset); | 2785 | u16 page = BM_PHY_REG_PAGE(offset); |
2841 | u16 reg = BM_PHY_REG_NUM(offset); | 2786 | u16 reg = BM_PHY_REG_NUM(offset); |
2842 | bool in_slow_mode = false; | ||
2843 | 2787 | ||
2844 | if (!locked) { | 2788 | if (!locked) { |
2845 | ret_val = hw->phy.ops.acquire(hw); | 2789 | ret_val = hw->phy.ops.acquire(hw); |
@@ -2847,16 +2791,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2847 | return ret_val; | 2791 | return ret_val; |
2848 | } | 2792 | } |
2849 | 2793 | ||
2850 | /* Workaround failure in MDIO access while cable is disconnected */ | ||
2851 | if ((hw->phy.type == e1000_phy_82577) && | ||
2852 | !(er32(STATUS) & E1000_STATUS_LU)) { | ||
2853 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
2854 | if (ret_val) | ||
2855 | goto out; | ||
2856 | |||
2857 | in_slow_mode = true; | ||
2858 | } | ||
2859 | |||
2860 | /* Page 800 works differently than the rest so it has its own func */ | 2794 | /* Page 800 works differently than the rest so it has its own func */ |
2861 | if (page == BM_WUC_PAGE) { | 2795 | if (page == BM_WUC_PAGE) { |
2862 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, | 2796 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, |
@@ -2893,10 +2827,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2893 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, | 2827 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, |
2894 | data); | 2828 | data); |
2895 | out: | 2829 | out: |
2896 | /* Revert to MDIO fast mode, if applicable */ | ||
2897 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | ||
2898 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); | ||
2899 | |||
2900 | if (!locked) | 2830 | if (!locked) |
2901 | hw->phy.ops.release(hw); | 2831 | hw->phy.ops.release(hw); |
2902 | 2832 | ||
@@ -2948,7 +2878,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2948 | s32 ret_val; | 2878 | s32 ret_val; |
2949 | u16 page = BM_PHY_REG_PAGE(offset); | 2879 | u16 page = BM_PHY_REG_PAGE(offset); |
2950 | u16 reg = BM_PHY_REG_NUM(offset); | 2880 | u16 reg = BM_PHY_REG_NUM(offset); |
2951 | bool in_slow_mode = false; | ||
2952 | 2881 | ||
2953 | if (!locked) { | 2882 | if (!locked) { |
2954 | ret_val = hw->phy.ops.acquire(hw); | 2883 | ret_val = hw->phy.ops.acquire(hw); |
@@ -2956,16 +2885,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2956 | return ret_val; | 2885 | return ret_val; |
2957 | } | 2886 | } |
2958 | 2887 | ||
2959 | /* Workaround failure in MDIO access while cable is disconnected */ | ||
2960 | if ((hw->phy.type == e1000_phy_82577) && | ||
2961 | !(er32(STATUS) & E1000_STATUS_LU)) { | ||
2962 | ret_val = e1000_set_mdio_slow_mode_hv(hw, true); | ||
2963 | if (ret_val) | ||
2964 | goto out; | ||
2965 | |||
2966 | in_slow_mode = true; | ||
2967 | } | ||
2968 | |||
2969 | /* Page 800 works differently than the rest so it has its own func */ | 2888 | /* Page 800 works differently than the rest so it has its own func */ |
2970 | if (page == BM_WUC_PAGE) { | 2889 | if (page == BM_WUC_PAGE) { |
2971 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, | 2890 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, |
@@ -3019,10 +2938,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
3019 | data); | 2938 | data); |
3020 | 2939 | ||
3021 | out: | 2940 | out: |
3022 | /* Revert to MDIO fast mode, if applicable */ | ||
3023 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | ||
3024 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); | ||
3025 | |||
3026 | if (!locked) | 2941 | if (!locked) |
3027 | hw->phy.ops.release(hw); | 2942 | hw->phy.ops.release(hw); |
3028 | 2943 | ||
diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index 21b41f42b61c..bfef0ebcba9a 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | ################################################################################ | 1 | ################################################################################ |
2 | # | 2 | # |
3 | # Intel 10 Gigabit PCI Express Linux driver | 3 | # Intel 10 Gigabit PCI Express Linux driver |
4 | # Copyright(c) 1999 - 2009 Intel Corporation. | 4 | # Copyright(c) 1999 - 2010 Intel Corporation. |
5 | # | 5 | # |
6 | # This program is free software; you can redistribute it and/or modify it | 6 | # This program is free software; you can redistribute it and/or modify it |
7 | # under the terms and conditions of the GNU General Public License, | 7 | # under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 8da8eb535084..303e7bd39b67 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index 204177d78cec..3103f4165311 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 538340527aa6..b49bd6b9feb7 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 688b8ca5da32..21f158f79dd0 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h index 27f3214bed2e..dfff0ffaa502 100644 --- a/drivers/net/ixgbe/ixgbe_common.h +++ b/drivers/net/ixgbe/ixgbe_common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb.c b/drivers/net/ixgbe/ixgbe_dcb.c index a1562287342f..9aea4f04bbd2 100644 --- a/drivers/net/ixgbe/ixgbe_dcb.c +++ b/drivers/net/ixgbe/ixgbe_dcb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb.h b/drivers/net/ixgbe/ixgbe_dcb.h index 64a9fa15c059..5caafd4afbc3 100644 --- a/drivers/net/ixgbe/ixgbe_dcb.h +++ b/drivers/net/ixgbe/ixgbe_dcb.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ixgbe/ixgbe_dcb_82598.c index f30263898ebc..f0e9279d4669 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82598.c +++ b/drivers/net/ixgbe/ixgbe_dcb_82598.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.h b/drivers/net/ixgbe/ixgbe_dcb_82598.h index ebbe53c352a7..cc728fa092e2 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82598.h +++ b/drivers/net/ixgbe/ixgbe_dcb_82598.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c index ec8a252636d3..4f7a26ab411e 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82599.c +++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.h b/drivers/net/ixgbe/ixgbe_dcb_82599.h index 9e5e2827e4af..0f3f791e1e1d 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82599.h +++ b/drivers/net/ixgbe/ixgbe_dcb_82599.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index 3c7a79a7d7c6..56f37f66b696 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 0bd49d3b9f65..d77961fc75f9 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index da32a108a7b4..e9a20c88c155 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.h b/drivers/net/ixgbe/ixgbe_fcoe.h index de8ff53187da..abf4b2b3f252 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.h +++ b/drivers/net/ixgbe/ixgbe_fcoe.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 2ad754c864cf..9c9202f40b10 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -52,7 +52,7 @@ static const char ixgbe_driver_string[] = | |||
52 | 52 | ||
53 | #define DRV_VERSION "2.0.44-k2" | 53 | #define DRV_VERSION "2.0.44-k2" |
54 | const char ixgbe_driver_version[] = DRV_VERSION; | 54 | const char ixgbe_driver_version[] = DRV_VERSION; |
55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2009 Intel Corporation."; | 55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2010 Intel Corporation."; |
56 | 56 | ||
57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { | 57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { |
58 | [board_82598] = &ixgbe_82598_info, | 58 | [board_82598] = &ixgbe_82598_info, |
@@ -5576,6 +5576,10 @@ static void ixgbe_netpoll(struct net_device *netdev) | |||
5576 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 5576 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
5577 | int i; | 5577 | int i; |
5578 | 5578 | ||
5579 | /* if interface is down do nothing */ | ||
5580 | if (test_bit(__IXGBE_DOWN, &adapter->state)) | ||
5581 | return; | ||
5582 | |||
5579 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; | 5583 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; |
5580 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | 5584 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { |
5581 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | 5585 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 9ecad17522c3..1c1efd386956 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h index 9b700f5bf1ed..9cf5f3b4cc5d 100644 --- a/drivers/net/ixgbe/ixgbe_phy.h +++ b/drivers/net/ixgbe/ixgbe_phy.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 84650c6ebe03..9eafddfa1b97 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c index 683353b904c7..0d4eba7266ec 100644 --- a/drivers/net/sfc/mcdi.c +++ b/drivers/net/sfc/mcdi.c | |||
@@ -142,8 +142,9 @@ static int efx_mcdi_poll(struct efx_nic *efx) | |||
142 | if (spins != 0) { | 142 | if (spins != 0) { |
143 | --spins; | 143 | --spins; |
144 | udelay(1); | 144 | udelay(1); |
145 | } else | 145 | } else { |
146 | schedule(); | 146 | schedule_timeout_uninterruptible(1); |
147 | } | ||
147 | 148 | ||
148 | time = get_seconds(); | 149 | time = get_seconds(); |
149 | 150 | ||
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index af3933579790..250c8827b842 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -79,10 +79,14 @@ struct efx_loopback_state { | |||
79 | static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests) | 79 | static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests) |
80 | { | 80 | { |
81 | int rc = 0; | 81 | int rc = 0; |
82 | int devad = __ffs(efx->mdio.mmds); | 82 | int devad; |
83 | u16 physid1, physid2; | 83 | u16 physid1, physid2; |
84 | 84 | ||
85 | if (efx->phy_type == PHY_TYPE_NONE) | 85 | if (efx->mdio.mode_support & MDIO_SUPPORTS_C45) |
86 | devad = __ffs(efx->mdio.mmds); | ||
87 | else if (efx->mdio.mode_support & MDIO_SUPPORTS_C22) | ||
88 | devad = MDIO_DEVAD_NONE; | ||
89 | else | ||
86 | return 0; | 90 | return 0; |
87 | 91 | ||
88 | mutex_lock(&efx->mac_lock); | 92 | mutex_lock(&efx->mac_lock); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 3a74d2168598..7f82b0238e08 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) |
5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) | 5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) |
6 | * Copyright (C) 2004 Sun Microsystems Inc. | 6 | * Copyright (C) 2004 Sun Microsystems Inc. |
7 | * Copyright (C) 2005-2009 Broadcom Corporation. | 7 | * Copyright (C) 2005-2010 Broadcom Corporation. |
8 | * | 8 | * |
9 | * Firmware is: | 9 | * Firmware is: |
10 | * Derived from proprietary unpublished source code, | 10 | * Derived from proprietary unpublished source code, |
@@ -68,8 +68,8 @@ | |||
68 | 68 | ||
69 | #define DRV_MODULE_NAME "tg3" | 69 | #define DRV_MODULE_NAME "tg3" |
70 | #define PFX DRV_MODULE_NAME ": " | 70 | #define PFX DRV_MODULE_NAME ": " |
71 | #define DRV_MODULE_VERSION "3.105" | 71 | #define DRV_MODULE_VERSION "3.106" |
72 | #define DRV_MODULE_RELDATE "December 2, 2009" | 72 | #define DRV_MODULE_RELDATE "January 12, 2010" |
73 | 73 | ||
74 | #define TG3_DEF_MAC_MODE 0 | 74 | #define TG3_DEF_MAC_MODE 0 |
75 | #define TG3_DEF_RX_MODE 0 | 75 | #define TG3_DEF_RX_MODE 0 |
@@ -1037,7 +1037,11 @@ static void tg3_mdio_start(struct tg3 *tp) | |||
1037 | else | 1037 | else |
1038 | tp->phy_addr = 1; | 1038 | tp->phy_addr = 1; |
1039 | 1039 | ||
1040 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | 1040 | if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) |
1041 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | ||
1042 | else | ||
1043 | is_serdes = tr32(TG3_CPMU_PHY_STRAP) & | ||
1044 | TG3_CPMU_PHY_STRAP_IS_SERDES; | ||
1041 | if (is_serdes) | 1045 | if (is_serdes) |
1042 | tp->phy_addr += 7; | 1046 | tp->phy_addr += 7; |
1043 | } else | 1047 | } else |
@@ -4693,8 +4697,9 @@ next_pkt: | |||
4693 | (*post_ptr)++; | 4697 | (*post_ptr)++; |
4694 | 4698 | ||
4695 | if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { | 4699 | if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { |
4696 | u32 idx = *post_ptr % TG3_RX_RING_SIZE; | 4700 | tpr->rx_std_prod_idx = std_prod_idx % TG3_RX_RING_SIZE; |
4697 | tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, idx); | 4701 | tw32_rx_mbox(TG3_RX_STD_PROD_IDX_REG, |
4702 | tpr->rx_std_prod_idx); | ||
4698 | work_mask &= ~RXD_OPAQUE_RING_STD; | 4703 | work_mask &= ~RXD_OPAQUE_RING_STD; |
4699 | rx_std_posted = 0; | 4704 | rx_std_posted = 0; |
4700 | } | 4705 | } |
@@ -7742,7 +7747,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7742 | ((u64) tpr->rx_std_mapping >> 32)); | 7747 | ((u64) tpr->rx_std_mapping >> 32)); |
7743 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, | 7748 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, |
7744 | ((u64) tpr->rx_std_mapping & 0xffffffff)); | 7749 | ((u64) tpr->rx_std_mapping & 0xffffffff)); |
7745 | if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) | 7750 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) |
7746 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, | 7751 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, |
7747 | NIC_SRAM_RX_BUFFER_DESC); | 7752 | NIC_SRAM_RX_BUFFER_DESC); |
7748 | 7753 | ||
@@ -12122,7 +12127,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
12122 | 12127 | ||
12123 | tp->phy_id = eeprom_phy_id; | 12128 | tp->phy_id = eeprom_phy_id; |
12124 | if (eeprom_phy_serdes) { | 12129 | if (eeprom_phy_serdes) { |
12125 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) | 12130 | if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || |
12131 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
12126 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; | 12132 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; |
12127 | else | 12133 | else |
12128 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; | 12134 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; |
@@ -13384,6 +13390,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13384 | if (err) | 13390 | if (err) |
13385 | return err; | 13391 | return err; |
13386 | 13392 | ||
13393 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | ||
13394 | (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 || | ||
13395 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))) | ||
13396 | return -ENOTSUPP; | ||
13397 | |||
13387 | /* Initialize data/descriptor byte/word swapping. */ | 13398 | /* Initialize data/descriptor byte/word swapping. */ |
13388 | val = tr32(GRC_MODE); | 13399 | val = tr32(GRC_MODE); |
13389 | val &= GRC_MODE_HOST_STACKUP; | 13400 | val &= GRC_MODE_HOST_STACKUP; |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index cd30889650f8..8a167912902b 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) |
5 | * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) | 5 | * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) |
6 | * Copyright (C) 2004 Sun Microsystems Inc. | 6 | * Copyright (C) 2004 Sun Microsystems Inc. |
7 | * Copyright (C) 2007-2010 Broadcom Corporation. | ||
7 | */ | 8 | */ |
8 | 9 | ||
9 | #ifndef _T3_H | 10 | #ifndef _T3_H |
@@ -1054,6 +1055,8 @@ | |||
1054 | #define CPMU_MUTEX_REQ_DRIVER 0x00001000 | 1055 | #define CPMU_MUTEX_REQ_DRIVER 0x00001000 |
1055 | #define TG3_CPMU_MUTEX_GNT 0x00003660 | 1056 | #define TG3_CPMU_MUTEX_GNT 0x00003660 |
1056 | #define CPMU_MUTEX_GNT_DRIVER 0x00001000 | 1057 | #define CPMU_MUTEX_GNT_DRIVER 0x00001000 |
1058 | #define TG3_CPMU_PHY_STRAP 0x00003664 | ||
1059 | #define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 | ||
1057 | /* 0x3664 --> 0x3800 unused */ | 1060 | /* 0x3664 --> 0x3800 unused */ |
1058 | 1061 | ||
1059 | /* Mbuf cluster free registers */ | 1062 | /* Mbuf cluster free registers */ |
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 5d1c8677f180..6a3f4da7fb48 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c | |||
@@ -97,7 +97,7 @@ ath5k_eeprom_init_header(struct ath5k_hw *ah) | |||
97 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | 97 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; |
98 | int ret; | 98 | int ret; |
99 | u16 val; | 99 | u16 val; |
100 | u32 cksum, offset; | 100 | u32 cksum, offset, eep_max = AR5K_EEPROM_INFO_MAX; |
101 | 101 | ||
102 | /* | 102 | /* |
103 | * Read values from EEPROM and store them in the capability structure | 103 | * Read values from EEPROM and store them in the capability structure |
@@ -116,12 +116,38 @@ ath5k_eeprom_init_header(struct ath5k_hw *ah) | |||
116 | * Validate the checksum of the EEPROM date. There are some | 116 | * Validate the checksum of the EEPROM date. There are some |
117 | * devices with invalid EEPROMs. | 117 | * devices with invalid EEPROMs. |
118 | */ | 118 | */ |
119 | for (cksum = 0, offset = 0; offset < AR5K_EEPROM_INFO_MAX; offset++) { | 119 | AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_UPPER, val); |
120 | if (val) { | ||
121 | eep_max = (val & AR5K_EEPROM_SIZE_UPPER_MASK) << | ||
122 | AR5K_EEPROM_SIZE_ENDLOC_SHIFT; | ||
123 | AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_LOWER, val); | ||
124 | eep_max = (eep_max | val) - AR5K_EEPROM_INFO_BASE; | ||
125 | |||
126 | /* | ||
127 | * Fail safe check to prevent stupid loops due | ||
128 | * to busted EEPROMs. XXX: This value is likely too | ||
129 | * big still, waiting on a better value. | ||
130 | */ | ||
131 | if (eep_max > (3 * AR5K_EEPROM_INFO_MAX)) { | ||
132 | ATH5K_ERR(ah->ah_sc, "Invalid max custom EEPROM size: " | ||
133 | "%d (0x%04x) max expected: %d (0x%04x)\n", | ||
134 | eep_max, eep_max, | ||
135 | 3 * AR5K_EEPROM_INFO_MAX, | ||
136 | 3 * AR5K_EEPROM_INFO_MAX); | ||
137 | return -EIO; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | for (cksum = 0, offset = 0; offset < eep_max; offset++) { | ||
120 | AR5K_EEPROM_READ(AR5K_EEPROM_INFO(offset), val); | 142 | AR5K_EEPROM_READ(AR5K_EEPROM_INFO(offset), val); |
121 | cksum ^= val; | 143 | cksum ^= val; |
122 | } | 144 | } |
123 | if (cksum != AR5K_EEPROM_INFO_CKSUM) { | 145 | if (cksum != AR5K_EEPROM_INFO_CKSUM) { |
124 | ATH5K_ERR(ah->ah_sc, "Invalid EEPROM checksum 0x%04x\n", cksum); | 146 | ATH5K_ERR(ah->ah_sc, "Invalid EEPROM " |
147 | "checksum: 0x%04x eep_max: 0x%04x (%s)\n", | ||
148 | cksum, eep_max, | ||
149 | eep_max == AR5K_EEPROM_INFO_MAX ? | ||
150 | "default size" : "custom size"); | ||
125 | return -EIO; | 151 | return -EIO; |
126 | } | 152 | } |
127 | 153 | ||
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h index 0123f3521a0b..473a483bb9c3 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.h +++ b/drivers/net/wireless/ath/ath5k/eeprom.h | |||
@@ -37,6 +37,14 @@ | |||
37 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 | 37 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 |
38 | 38 | ||
39 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ | 39 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ |
40 | |||
41 | /* FLASH(EEPROM) Defines for AR531X chips */ | ||
42 | #define AR5K_EEPROM_SIZE_LOWER 0x1b /* size info -- lower */ | ||
43 | #define AR5K_EEPROM_SIZE_UPPER 0x1c /* size info -- upper */ | ||
44 | #define AR5K_EEPROM_SIZE_UPPER_MASK 0xfff0 | ||
45 | #define AR5K_EEPROM_SIZE_UPPER_SHIFT 4 | ||
46 | #define AR5K_EEPROM_SIZE_ENDLOC_SHIFT 12 | ||
47 | |||
40 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ | 48 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ |
41 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ | 49 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ |
42 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) | 50 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) |
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index 03a1106ad725..5774cea23a3b 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig | |||
@@ -25,7 +25,7 @@ config ATH9K | |||
25 | 25 | ||
26 | config ATH9K_DEBUGFS | 26 | config ATH9K_DEBUGFS |
27 | bool "Atheros ath9k debugging" | 27 | bool "Atheros ath9k debugging" |
28 | depends on ATH9K | 28 | depends on ATH9K && DEBUG_FS |
29 | ---help--- | 29 | ---help--- |
30 | Say Y, if you need access to ath9k's statistics for | 30 | Say Y, if you need access to ath9k's statistics for |
31 | interrupts, rate control, etc. | 31 | interrupts, rate control, etc. |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index e2cef2ff5d8f..1597a42731ed 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -33,11 +33,11 @@ struct ath_node; | |||
33 | 33 | ||
34 | /* Macro to expand scalars to 64-bit objects */ | 34 | /* Macro to expand scalars to 64-bit objects */ |
35 | 35 | ||
36 | #define ito64(x) (sizeof(x) == 8) ? \ | 36 | #define ito64(x) (sizeof(x) == 1) ? \ |
37 | (((unsigned long long int)(x)) & (0xff)) : \ | 37 | (((unsigned long long int)(x)) & (0xff)) : \ |
38 | (sizeof(x) == 16) ? \ | 38 | (sizeof(x) == 2) ? \ |
39 | (((unsigned long long int)(x)) & 0xffff) : \ | 39 | (((unsigned long long int)(x)) & 0xffff) : \ |
40 | ((sizeof(x) == 32) ? \ | 40 | ((sizeof(x) == 4) ? \ |
41 | (((unsigned long long int)(x)) & 0xffffffff) : \ | 41 | (((unsigned long long int)(x)) & 0xffffffff) : \ |
42 | (unsigned long long int)(x)) | 42 | (unsigned long long int)(x)) |
43 | 43 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 484c5fdf7c2a..9b4b8b5c7574 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -1961,7 +1961,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
1961 | struct ieee80211_tx_info *info; | 1961 | struct ieee80211_tx_info *info; |
1962 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; | 1962 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
1963 | u32 status = le32_to_cpu(tx_resp->u.status); | 1963 | u32 status = le32_to_cpu(tx_resp->u.status); |
1964 | int tid = MAX_TID_COUNT; | 1964 | int uninitialized_var(tid); |
1965 | int sta_id; | 1965 | int sta_id; |
1966 | int freed; | 1966 | int freed; |
1967 | u8 *qc = NULL; | 1967 | u8 *qc = NULL; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 574d36658702..5461f105bd2d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2344,6 +2344,21 @@ static void iwl_ht_conf(struct iwl_priv *priv, | |||
2344 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2344 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2345 | } | 2345 | } |
2346 | 2346 | ||
2347 | static inline void iwl_set_no_assoc(struct iwl_priv *priv) | ||
2348 | { | ||
2349 | priv->assoc_id = 0; | ||
2350 | iwl_led_disassociate(priv); | ||
2351 | /* | ||
2352 | * inform the ucode that there is no longer an | ||
2353 | * association and that no more packets should be | ||
2354 | * sent | ||
2355 | */ | ||
2356 | priv->staging_rxon.filter_flags &= | ||
2357 | ~RXON_FILTER_ASSOC_MSK; | ||
2358 | priv->staging_rxon.assoc_id = 0; | ||
2359 | iwlcore_commit_rxon(priv); | ||
2360 | } | ||
2361 | |||
2347 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) | 2362 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) |
2348 | void iwl_bss_info_changed(struct ieee80211_hw *hw, | 2363 | void iwl_bss_info_changed(struct ieee80211_hw *hw, |
2349 | struct ieee80211_vif *vif, | 2364 | struct ieee80211_vif *vif, |
@@ -2475,20 +2490,8 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
2475 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; | 2490 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; |
2476 | if (!iwl_is_rfkill(priv)) | 2491 | if (!iwl_is_rfkill(priv)) |
2477 | priv->cfg->ops->lib->post_associate(priv); | 2492 | priv->cfg->ops->lib->post_associate(priv); |
2478 | } else { | 2493 | } else |
2479 | priv->assoc_id = 0; | 2494 | iwl_set_no_assoc(priv); |
2480 | iwl_led_disassociate(priv); | ||
2481 | |||
2482 | /* | ||
2483 | * inform the ucode that there is no longer an | ||
2484 | * association and that no more packets should be | ||
2485 | * send | ||
2486 | */ | ||
2487 | priv->staging_rxon.filter_flags &= | ||
2488 | ~RXON_FILTER_ASSOC_MSK; | ||
2489 | priv->staging_rxon.assoc_id = 0; | ||
2490 | iwlcore_commit_rxon(priv); | ||
2491 | } | ||
2492 | } | 2495 | } |
2493 | 2496 | ||
2494 | if (changes && iwl_is_associated(priv) && priv->assoc_id) { | 2497 | if (changes && iwl_is_associated(priv) && priv->assoc_id) { |
@@ -2503,12 +2506,14 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
2503 | } | 2506 | } |
2504 | } | 2507 | } |
2505 | 2508 | ||
2506 | if ((changes & BSS_CHANGED_BEACON_ENABLED) && | 2509 | if (changes & BSS_CHANGED_BEACON_ENABLED) { |
2507 | vif->bss_conf.enable_beacon) { | 2510 | if (vif->bss_conf.enable_beacon) { |
2508 | memcpy(priv->staging_rxon.bssid_addr, | 2511 | memcpy(priv->staging_rxon.bssid_addr, |
2509 | bss_conf->bssid, ETH_ALEN); | 2512 | bss_conf->bssid, ETH_ALEN); |
2510 | memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN); | 2513 | memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN); |
2511 | iwlcore_config_ap(priv); | 2514 | iwlcore_config_ap(priv); |
2515 | } else | ||
2516 | iwl_set_no_assoc(priv); | ||
2512 | } | 2517 | } |
2513 | 2518 | ||
2514 | mutex_unlock(&priv->mutex); | 2519 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 165d1f6e2dd9..3822cf53e368 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -711,7 +711,7 @@ extern void iwl_txq_ctx_stop(struct iwl_priv *priv); | |||
711 | extern int iwl_queue_space(const struct iwl_queue *q); | 711 | extern int iwl_queue_space(const struct iwl_queue *q); |
712 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) | 712 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) |
713 | { | 713 | { |
714 | return q->write_ptr > q->read_ptr ? | 714 | return q->write_ptr >= q->read_ptr ? |
715 | (i >= q->read_ptr && i < q->write_ptr) : | 715 | (i >= q->read_ptr && i < q->write_ptr) : |
716 | !(i < q->read_ptr && i >= q->write_ptr); | 716 | !(i < q->read_ptr && i >= q->write_ptr); |
717 | } | 717 | } |
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 59d49159cf2a..59f92105b0c2 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -3157,8 +3157,10 @@ static void mwl8k_configure_filter(struct ieee80211_hw *hw, | |||
3157 | /* Clear unsupported feature flags */ | 3157 | /* Clear unsupported feature flags */ |
3158 | *total_flags &= FIF_ALLMULTI | FIF_BCN_PRBRESP_PROMISC; | 3158 | *total_flags &= FIF_ALLMULTI | FIF_BCN_PRBRESP_PROMISC; |
3159 | 3159 | ||
3160 | if (mwl8k_fw_lock(hw)) | 3160 | if (mwl8k_fw_lock(hw)) { |
3161 | kfree(cmd); | ||
3161 | return; | 3162 | return; |
3163 | } | ||
3162 | 3164 | ||
3163 | if (priv->sniffer_enabled) { | 3165 | if (priv->sniffer_enabled) { |
3164 | mwl8k_enable_sniffer(hw, 0); | 3166 | mwl8k_enable_sniffer(hw, 0); |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 27bf887f1453..9deae41cb784 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -340,7 +340,7 @@ static int rt2800_blink_set(struct led_classdev *led_cdev, | |||
340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); | 340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); |
341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); | 341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); |
342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); | 342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); |
343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 12); | 343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 3); |
344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); | 344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); |
345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); | 345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); |
346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); | 346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 4d841c07c970..dcfc8c25d1a7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -113,6 +113,12 @@ | |||
113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) | 113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Constants for extra TX headroom for alignment purposes. | ||
117 | */ | ||
118 | #define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */ | ||
119 | #define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */ | ||
120 | |||
121 | /* | ||
116 | * Standard timing and size defines. | 122 | * Standard timing and size defines. |
117 | * These values should follow the ieee80211 specifications. | 123 | * These values should follow the ieee80211 specifications. |
118 | */ | 124 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 06c43ca39bf8..265e66dba552 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
686 | /* | 686 | /* |
687 | * Initialize extra TX headroom required. | 687 | * Initialize extra TX headroom required. |
688 | */ | 688 | */ |
689 | rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom; | 689 | rt2x00dev->hw->extra_tx_headroom = |
690 | max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM, | ||
691 | rt2x00dev->ops->extra_tx_headroom); | ||
692 | |||
693 | /* | ||
694 | * Take TX headroom required for alignment into account. | ||
695 | */ | ||
696 | if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) | ||
697 | rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE; | ||
698 | else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags)) | ||
699 | rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE; | ||
690 | 700 | ||
691 | /* | 701 | /* |
692 | * Register HW. | 702 | * Register HW. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 239afc7a9c0b..9915a09141ef 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -104,7 +104,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
104 | * is also mapped to the DMA so it can be used for transfering | 104 | * is also mapped to the DMA so it can be used for transfering |
105 | * additional descriptor information to the hardware. | 105 | * additional descriptor information to the hardware. |
106 | */ | 106 | */ |
107 | skb_push(skb, rt2x00dev->hw->extra_tx_headroom); | 107 | skb_push(skb, rt2x00dev->ops->extra_tx_headroom); |
108 | 108 | ||
109 | skbdesc->skb_dma = | 109 | skbdesc->skb_dma = |
110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); | 110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); |
@@ -112,7 +112,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
112 | /* | 112 | /* |
113 | * Restore data pointer to original location again. | 113 | * Restore data pointer to original location again. |
114 | */ | 114 | */ |
115 | skb_pull(skb, rt2x00dev->hw->extra_tx_headroom); | 115 | skb_pull(skb, rt2x00dev->ops->extra_tx_headroom); |
116 | 116 | ||
117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; | 117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; |
118 | } | 118 | } |
@@ -134,7 +134,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
134 | * by the driver, but it was actually mapped to DMA. | 134 | * by the driver, but it was actually mapped to DMA. |
135 | */ | 135 | */ |
136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, | 136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, |
137 | skb->len + rt2x00dev->hw->extra_tx_headroom, | 137 | skb->len + rt2x00dev->ops->extra_tx_headroom, |
138 | DMA_TO_DEVICE); | 138 | DMA_TO_DEVICE); |
139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; | 139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; |
140 | } | 140 | } |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 8ebf5c33955d..f14deb0c8514 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -987,12 +987,13 @@ static void zd_op_configure_filter(struct ieee80211_hw *hw, | |||
987 | changed_flags &= SUPPORTED_FIF_FLAGS; | 987 | changed_flags &= SUPPORTED_FIF_FLAGS; |
988 | *new_flags &= SUPPORTED_FIF_FLAGS; | 988 | *new_flags &= SUPPORTED_FIF_FLAGS; |
989 | 989 | ||
990 | /* changed_flags is always populated but this driver | 990 | /* |
991 | * doesn't support all FIF flags so its possible we don't | 991 | * If multicast parameter (as returned by zd_op_prepare_multicast) |
992 | * need to do anything */ | 992 | * has changed, no bit in changed_flags is set. To handle this |
993 | if (!changed_flags) | 993 | * situation, we do not return if changed_flags is 0. If we do so, |
994 | return; | 994 | * we will have some issue with IPv6 which uses multicast for link |
995 | 995 | * layer address resolution. | |
996 | */ | ||
996 | if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) | 997 | if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) |
997 | zd_mc_add_all(&hash); | 998 | zd_mc_add_all(&hash); |
998 | 999 | ||
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 5819dc02a143..1c500c462225 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/debug.h> | 23 | #include <asm/debug.h> |
24 | #include <asm/idals.h> | 24 | #include <asm/idals.h> |
25 | #include <asm/ebcdic.h> | 25 | #include <asm/ebcdic.h> |
26 | #include <asm/compat.h> | ||
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
28 | #include <asm/cio.h> | 29 | #include <asm/cio.h> |
@@ -2844,13 +2845,16 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) | |||
2844 | rc = -EFAULT; | 2845 | rc = -EFAULT; |
2845 | if (copy_from_user(&usrparm, argp, sizeof(usrparm))) | 2846 | if (copy_from_user(&usrparm, argp, sizeof(usrparm))) |
2846 | goto out; | 2847 | goto out; |
2847 | #ifndef CONFIG_64BIT | 2848 | if (is_compat_task() || sizeof(long) == 4) { |
2848 | /* Make sure pointers are sane even on 31 bit. */ | 2849 | /* Make sure pointers are sane even on 31 bit. */ |
2849 | if ((usrparm.psf_data >> 32) != 0 || (usrparm.rssd_result >> 32) != 0) { | ||
2850 | rc = -EINVAL; | 2850 | rc = -EINVAL; |
2851 | goto out; | 2851 | if ((usrparm.psf_data >> 32) != 0) |
2852 | goto out; | ||
2853 | if ((usrparm.rssd_result >> 32) != 0) | ||
2854 | goto out; | ||
2855 | usrparm.psf_data &= 0x7fffffffULL; | ||
2856 | usrparm.rssd_result &= 0x7fffffffULL; | ||
2852 | } | 2857 | } |
2853 | #endif | ||
2854 | /* alloc I/O data area */ | 2858 | /* alloc I/O data area */ |
2855 | psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA); | 2859 | psf_data = kzalloc(usrparm.psf_data_len, GFP_KERNEL | GFP_DMA); |
2856 | rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA); | 2860 | rssd_result = kzalloc(usrparm.rssd_result_len, GFP_KERNEL | GFP_DMA); |
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 478bcdb90b6f..fc7b30b4a255 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/blkpg.h> | 18 | #include <linux/blkpg.h> |
19 | #include <linux/smp_lock.h> | 19 | #include <linux/smp_lock.h> |
20 | 20 | #include <asm/compat.h> | |
21 | #include <asm/ccwdev.h> | 21 | #include <asm/ccwdev.h> |
22 | #include <asm/cmb.h> | 22 | #include <asm/cmb.h> |
23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
@@ -358,9 +358,8 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) | |||
358 | } | 358 | } |
359 | 359 | ||
360 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, | 360 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, |
361 | unsigned long arg) | 361 | struct cmbdata __user *argp) |
362 | { | 362 | { |
363 | struct cmbdata __user *argp = (void __user *) arg; | ||
364 | size_t size = _IOC_SIZE(cmd); | 363 | size_t size = _IOC_SIZE(cmd); |
365 | struct cmbdata data; | 364 | struct cmbdata data; |
366 | int ret; | 365 | int ret; |
@@ -376,7 +375,12 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
376 | unsigned int cmd, unsigned long arg) | 375 | unsigned int cmd, unsigned long arg) |
377 | { | 376 | { |
378 | struct dasd_block *block = bdev->bd_disk->private_data; | 377 | struct dasd_block *block = bdev->bd_disk->private_data; |
379 | void __user *argp = (void __user *)arg; | 378 | void __user *argp; |
379 | |||
380 | if (is_compat_task()) | ||
381 | argp = compat_ptr(arg); | ||
382 | else | ||
383 | argp = (void __user *)arg; | ||
380 | 384 | ||
381 | if (!block) | 385 | if (!block) |
382 | return -ENODEV; | 386 | return -ENODEV; |
@@ -414,7 +418,7 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
414 | case BIODASDCMFDISABLE: | 418 | case BIODASDCMFDISABLE: |
415 | return disable_cmf(block->base->cdev); | 419 | return disable_cmf(block->base->cdev); |
416 | case BIODASDREADALLCMB: | 420 | case BIODASDREADALLCMB: |
417 | return dasd_ioctl_readall_cmb(block, cmd, arg); | 421 | return dasd_ioctl_readall_cmb(block, cmd, argp); |
418 | default: | 422 | default: |
419 | /* if the discipline has an ioctl method try it. */ | 423 | /* if the discipline has an ioctl method try it. */ |
420 | if (block->base->discipline->ioctl) { | 424 | if (block->base->discipline->ioctl) { |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 9d61683b5633..59ec073724bf 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -1037,22 +1037,6 @@ static void tty3215_flush_buffer(struct tty_struct *tty) | |||
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | /* | 1039 | /* |
1040 | * Currently we don't have any io controls for 3215 ttys | ||
1041 | */ | ||
1042 | static int tty3215_ioctl(struct tty_struct *tty, struct file * file, | ||
1043 | unsigned int cmd, unsigned long arg) | ||
1044 | { | ||
1045 | if (tty->flags & (1 << TTY_IO_ERROR)) | ||
1046 | return -EIO; | ||
1047 | |||
1048 | switch (cmd) { | ||
1049 | default: | ||
1050 | return -ENOIOCTLCMD; | ||
1051 | } | ||
1052 | return 0; | ||
1053 | } | ||
1054 | |||
1055 | /* | ||
1056 | * Disable reading from a 3215 tty | 1040 | * Disable reading from a 3215 tty |
1057 | */ | 1041 | */ |
1058 | static void tty3215_throttle(struct tty_struct * tty) | 1042 | static void tty3215_throttle(struct tty_struct * tty) |
@@ -1117,7 +1101,6 @@ static const struct tty_operations tty3215_ops = { | |||
1117 | .write_room = tty3215_write_room, | 1101 | .write_room = tty3215_write_room, |
1118 | .chars_in_buffer = tty3215_chars_in_buffer, | 1102 | .chars_in_buffer = tty3215_chars_in_buffer, |
1119 | .flush_buffer = tty3215_flush_buffer, | 1103 | .flush_buffer = tty3215_flush_buffer, |
1120 | .ioctl = tty3215_ioctl, | ||
1121 | .throttle = tty3215_throttle, | 1104 | .throttle = tty3215_throttle, |
1122 | .unthrottle = tty3215_unthrottle, | 1105 | .unthrottle = tty3215_unthrottle, |
1123 | .stop = tty3215_stop, | 1106 | .stop = tty3215_stop, |
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 247b2b934728..31c59b0d6df0 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/smp_lock.h> | 16 | #include <linux/smp_lock.h> |
17 | 17 | ||
18 | #include <asm/compat.h> | ||
18 | #include <asm/ccwdev.h> | 19 | #include <asm/ccwdev.h> |
19 | #include <asm/cio.h> | 20 | #include <asm/cio.h> |
20 | #include <asm/ebcdic.h> | 21 | #include <asm/ebcdic.h> |
@@ -322,6 +323,7 @@ fs3270_write(struct file *filp, const char __user *data, size_t count, loff_t *o | |||
322 | static long | 323 | static long |
323 | fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 324 | fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
324 | { | 325 | { |
326 | char __user *argp; | ||
325 | struct fs3270 *fp; | 327 | struct fs3270 *fp; |
326 | struct raw3270_iocb iocb; | 328 | struct raw3270_iocb iocb; |
327 | int rc; | 329 | int rc; |
@@ -329,6 +331,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
329 | fp = filp->private_data; | 331 | fp = filp->private_data; |
330 | if (!fp) | 332 | if (!fp) |
331 | return -ENODEV; | 333 | return -ENODEV; |
334 | if (is_compat_task()) | ||
335 | argp = compat_ptr(arg); | ||
336 | else | ||
337 | argp = (char __user *)arg; | ||
332 | rc = 0; | 338 | rc = 0; |
333 | mutex_lock(&fs3270_mutex); | 339 | mutex_lock(&fs3270_mutex); |
334 | switch (cmd) { | 340 | switch (cmd) { |
@@ -339,10 +345,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
339 | fp->write_command = arg; | 345 | fp->write_command = arg; |
340 | break; | 346 | break; |
341 | case TUBGETI: | 347 | case TUBGETI: |
342 | rc = put_user(fp->read_command, (char __user *) arg); | 348 | rc = put_user(fp->read_command, argp); |
343 | break; | 349 | break; |
344 | case TUBGETO: | 350 | case TUBGETO: |
345 | rc = put_user(fp->write_command,(char __user *) arg); | 351 | rc = put_user(fp->write_command, argp); |
346 | break; | 352 | break; |
347 | case TUBGETMOD: | 353 | case TUBGETMOD: |
348 | iocb.model = fp->view.model; | 354 | iocb.model = fp->view.model; |
@@ -351,8 +357,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
351 | iocb.pf_cnt = 24; | 357 | iocb.pf_cnt = 24; |
352 | iocb.re_cnt = 20; | 358 | iocb.re_cnt = 20; |
353 | iocb.map = 0; | 359 | iocb.map = 0; |
354 | if (copy_to_user((char __user *) arg, &iocb, | 360 | if (copy_to_user(argp, &iocb, sizeof(struct raw3270_iocb))) |
355 | sizeof(struct raw3270_iocb))) | ||
356 | rc = -EFAULT; | 361 | rc = -EFAULT; |
357 | break; | 362 | break; |
358 | } | 363 | } |
@@ -511,8 +516,8 @@ static const struct file_operations fs3270_fops = { | |||
511 | .write = fs3270_write, /* write */ | 516 | .write = fs3270_write, /* write */ |
512 | .unlocked_ioctl = fs3270_ioctl, /* ioctl */ | 517 | .unlocked_ioctl = fs3270_ioctl, /* ioctl */ |
513 | .compat_ioctl = fs3270_ioctl, /* ioctl */ | 518 | .compat_ioctl = fs3270_ioctl, /* ioctl */ |
514 | .open = fs3270_open, /* open */ | 519 | .open = fs3270_open, /* open */ |
515 | .release = fs3270_close, /* release */ | 520 | .release = fs3270_close, /* release */ |
516 | }; | 521 | }; |
517 | 522 | ||
518 | /* | 523 | /* |
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 96816149368a..8d3d720737da 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -46,8 +46,6 @@ | |||
46 | */ | 46 | */ |
47 | static int tapeblock_open(struct block_device *, fmode_t); | 47 | static int tapeblock_open(struct block_device *, fmode_t); |
48 | static int tapeblock_release(struct gendisk *, fmode_t); | 48 | static int tapeblock_release(struct gendisk *, fmode_t); |
49 | static int tapeblock_ioctl(struct block_device *, fmode_t, unsigned int, | ||
50 | unsigned long); | ||
51 | static int tapeblock_medium_changed(struct gendisk *); | 49 | static int tapeblock_medium_changed(struct gendisk *); |
52 | static int tapeblock_revalidate_disk(struct gendisk *); | 50 | static int tapeblock_revalidate_disk(struct gendisk *); |
53 | 51 | ||
@@ -55,7 +53,6 @@ static const struct block_device_operations tapeblock_fops = { | |||
55 | .owner = THIS_MODULE, | 53 | .owner = THIS_MODULE, |
56 | .open = tapeblock_open, | 54 | .open = tapeblock_open, |
57 | .release = tapeblock_release, | 55 | .release = tapeblock_release, |
58 | .ioctl = tapeblock_ioctl, | ||
59 | .media_changed = tapeblock_medium_changed, | 56 | .media_changed = tapeblock_medium_changed, |
60 | .revalidate_disk = tapeblock_revalidate_disk, | 57 | .revalidate_disk = tapeblock_revalidate_disk, |
61 | }; | 58 | }; |
@@ -416,42 +413,6 @@ tapeblock_release(struct gendisk *disk, fmode_t mode) | |||
416 | } | 413 | } |
417 | 414 | ||
418 | /* | 415 | /* |
419 | * Support of some generic block device IOCTLs. | ||
420 | */ | ||
421 | static int | ||
422 | tapeblock_ioctl( | ||
423 | struct block_device * bdev, | ||
424 | fmode_t mode, | ||
425 | unsigned int command, | ||
426 | unsigned long arg | ||
427 | ) { | ||
428 | int rc; | ||
429 | int minor; | ||
430 | struct gendisk *disk = bdev->bd_disk; | ||
431 | struct tape_device *device; | ||
432 | |||
433 | rc = 0; | ||
434 | BUG_ON(!disk); | ||
435 | device = disk->private_data; | ||
436 | BUG_ON(!device); | ||
437 | minor = MINOR(bdev->bd_dev); | ||
438 | |||
439 | DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command); | ||
440 | DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor); | ||
441 | |||
442 | switch (command) { | ||
443 | /* Refuse some IOCTL calls without complaining (mount). */ | ||
444 | case 0x5310: /* CDROMMULTISESSION */ | ||
445 | rc = -EINVAL; | ||
446 | break; | ||
447 | default: | ||
448 | rc = -EINVAL; | ||
449 | } | ||
450 | |||
451 | return rc; | ||
452 | } | ||
453 | |||
454 | /* | ||
455 | * Initialize block device frontend. | 416 | * Initialize block device frontend. |
456 | */ | 417 | */ |
457 | int | 418 | int |
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 2125ec7d95f0..539045acaad4 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/proc_fs.h> | 18 | #include <linux/proc_fs.h> |
19 | #include <linux/mtio.h> | 19 | #include <linux/mtio.h> |
20 | #include <linux/smp_lock.h> | 20 | #include <linux/smp_lock.h> |
21 | #include <linux/compat.h> | ||
21 | 22 | ||
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
23 | 24 | ||
@@ -37,8 +38,9 @@ static ssize_t tapechar_write(struct file *, const char __user *, size_t, loff_t | |||
37 | static int tapechar_open(struct inode *,struct file *); | 38 | static int tapechar_open(struct inode *,struct file *); |
38 | static int tapechar_release(struct inode *,struct file *); | 39 | static int tapechar_release(struct inode *,struct file *); |
39 | static long tapechar_ioctl(struct file *, unsigned int, unsigned long); | 40 | static long tapechar_ioctl(struct file *, unsigned int, unsigned long); |
40 | static long tapechar_compat_ioctl(struct file *, unsigned int, | 41 | #ifdef CONFIG_COMPAT |
41 | unsigned long); | 42 | static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long); |
43 | #endif | ||
42 | 44 | ||
43 | static const struct file_operations tape_fops = | 45 | static const struct file_operations tape_fops = |
44 | { | 46 | { |
@@ -46,7 +48,9 @@ static const struct file_operations tape_fops = | |||
46 | .read = tapechar_read, | 48 | .read = tapechar_read, |
47 | .write = tapechar_write, | 49 | .write = tapechar_write, |
48 | .unlocked_ioctl = tapechar_ioctl, | 50 | .unlocked_ioctl = tapechar_ioctl, |
51 | #ifdef CONFIG_COMPAT | ||
49 | .compat_ioctl = tapechar_compat_ioctl, | 52 | .compat_ioctl = tapechar_compat_ioctl, |
53 | #endif | ||
50 | .open = tapechar_open, | 54 | .open = tapechar_open, |
51 | .release = tapechar_release, | 55 | .release = tapechar_release, |
52 | }; | 56 | }; |
@@ -457,15 +461,22 @@ tapechar_ioctl(struct file *filp, unsigned int no, unsigned long data) | |||
457 | return rc; | 461 | return rc; |
458 | } | 462 | } |
459 | 463 | ||
464 | #ifdef CONFIG_COMPAT | ||
460 | static long | 465 | static long |
461 | tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) | 466 | tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) |
462 | { | 467 | { |
463 | struct tape_device *device = filp->private_data; | 468 | struct tape_device *device = filp->private_data; |
464 | int rval = -ENOIOCTLCMD; | 469 | int rval = -ENOIOCTLCMD; |
470 | unsigned long argp; | ||
465 | 471 | ||
472 | /* The 'arg' argument of any ioctl function may only be used for | ||
473 | * pointers because of the compat pointer conversion. | ||
474 | * Consider this when adding new ioctls. | ||
475 | */ | ||
476 | argp = (unsigned long) compat_ptr(data); | ||
466 | if (device->discipline->ioctl_fn) { | 477 | if (device->discipline->ioctl_fn) { |
467 | mutex_lock(&device->mutex); | 478 | mutex_lock(&device->mutex); |
468 | rval = device->discipline->ioctl_fn(device, no, data); | 479 | rval = device->discipline->ioctl_fn(device, no, argp); |
469 | mutex_unlock(&device->mutex); | 480 | mutex_unlock(&device->mutex); |
470 | if (rval == -EINVAL) | 481 | if (rval == -EINVAL) |
471 | rval = -ENOIOCTLCMD; | 482 | rval = -ENOIOCTLCMD; |
@@ -473,6 +484,7 @@ tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) | |||
473 | 484 | ||
474 | return rval; | 485 | return rval; |
475 | } | 486 | } |
487 | #endif /* CONFIG_COMPAT */ | ||
476 | 488 | ||
477 | /* | 489 | /* |
478 | * Initialize character device frontend. | 490 | * Initialize character device frontend. |
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index a6087cec55b4..921dcda77676 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/miscdevice.h> | 20 | #include <linux/miscdevice.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <asm/compat.h> | ||
22 | #include <asm/cpcmd.h> | 23 | #include <asm/cpcmd.h> |
23 | #include <asm/debug.h> | 24 | #include <asm/debug.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
@@ -139,21 +140,26 @@ vmcp_write(struct file *file, const char __user *buff, size_t count, | |||
139 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 140 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
140 | { | 141 | { |
141 | struct vmcp_session *session; | 142 | struct vmcp_session *session; |
143 | int __user *argp; | ||
142 | int temp; | 144 | int temp; |
143 | 145 | ||
144 | session = (struct vmcp_session *)file->private_data; | 146 | session = (struct vmcp_session *)file->private_data; |
147 | if (is_compat_task()) | ||
148 | argp = compat_ptr(arg); | ||
149 | else | ||
150 | argp = (int __user *)arg; | ||
145 | if (mutex_lock_interruptible(&session->mutex)) | 151 | if (mutex_lock_interruptible(&session->mutex)) |
146 | return -ERESTARTSYS; | 152 | return -ERESTARTSYS; |
147 | switch (cmd) { | 153 | switch (cmd) { |
148 | case VMCP_GETCODE: | 154 | case VMCP_GETCODE: |
149 | temp = session->resp_code; | 155 | temp = session->resp_code; |
150 | mutex_unlock(&session->mutex); | 156 | mutex_unlock(&session->mutex); |
151 | return put_user(temp, (int __user *)arg); | 157 | return put_user(temp, argp); |
152 | case VMCP_SETBUF: | 158 | case VMCP_SETBUF: |
153 | free_pages((unsigned long)session->response, | 159 | free_pages((unsigned long)session->response, |
154 | get_order(session->bufsize)); | 160 | get_order(session->bufsize)); |
155 | session->response=NULL; | 161 | session->response=NULL; |
156 | temp = get_user(session->bufsize, (int __user *)arg); | 162 | temp = get_user(session->bufsize, argp); |
157 | if (get_order(session->bufsize) > 8) { | 163 | if (get_order(session->bufsize) > 8) { |
158 | session->bufsize = PAGE_SIZE; | 164 | session->bufsize = PAGE_SIZE; |
159 | temp = -EINVAL; | 165 | temp = -EINVAL; |
@@ -163,7 +169,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
163 | case VMCP_GETSIZE: | 169 | case VMCP_GETSIZE: |
164 | temp = session->resp_size; | 170 | temp = session->resp_size; |
165 | mutex_unlock(&session->mutex); | 171 | mutex_unlock(&session->mutex); |
166 | return put_user(temp, (int __user *)arg); | 172 | return put_user(temp, argp); |
167 | default: | 173 | default: |
168 | mutex_unlock(&session->mutex); | 174 | mutex_unlock(&session->mutex); |
169 | return -ENOIOCTLCMD; | 175 | return -ENOIOCTLCMD; |
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index cc5144b6f9d9..c84ac9443079 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/uaccess.h> | 12 | #include <linux/uaccess.h> |
13 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
14 | 14 | ||
15 | #include <asm/compat.h> | ||
15 | #include <asm/cio.h> | 16 | #include <asm/cio.h> |
16 | #include <asm/chsc.h> | 17 | #include <asm/chsc.h> |
17 | #include <asm/isc.h> | 18 | #include <asm/isc.h> |
@@ -770,24 +771,30 @@ out_free: | |||
770 | static long chsc_ioctl(struct file *filp, unsigned int cmd, | 771 | static long chsc_ioctl(struct file *filp, unsigned int cmd, |
771 | unsigned long arg) | 772 | unsigned long arg) |
772 | { | 773 | { |
774 | void __user *argp; | ||
775 | |||
773 | CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd); | 776 | CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd); |
777 | if (is_compat_task()) | ||
778 | argp = compat_ptr(arg); | ||
779 | else | ||
780 | argp = (void __user *)arg; | ||
774 | switch (cmd) { | 781 | switch (cmd) { |
775 | case CHSC_START: | 782 | case CHSC_START: |
776 | return chsc_ioctl_start((void __user *)arg); | 783 | return chsc_ioctl_start(argp); |
777 | case CHSC_INFO_CHANNEL_PATH: | 784 | case CHSC_INFO_CHANNEL_PATH: |
778 | return chsc_ioctl_info_channel_path((void __user *)arg); | 785 | return chsc_ioctl_info_channel_path(argp); |
779 | case CHSC_INFO_CU: | 786 | case CHSC_INFO_CU: |
780 | return chsc_ioctl_info_cu((void __user *)arg); | 787 | return chsc_ioctl_info_cu(argp); |
781 | case CHSC_INFO_SCH_CU: | 788 | case CHSC_INFO_SCH_CU: |
782 | return chsc_ioctl_info_sch_cu((void __user *)arg); | 789 | return chsc_ioctl_info_sch_cu(argp); |
783 | case CHSC_INFO_CI: | 790 | case CHSC_INFO_CI: |
784 | return chsc_ioctl_conf_info((void __user *)arg); | 791 | return chsc_ioctl_conf_info(argp); |
785 | case CHSC_INFO_CCL: | 792 | case CHSC_INFO_CCL: |
786 | return chsc_ioctl_conf_comp_list((void __user *)arg); | 793 | return chsc_ioctl_conf_comp_list(argp); |
787 | case CHSC_INFO_CPD: | 794 | case CHSC_INFO_CPD: |
788 | return chsc_ioctl_chpd((void __user *)arg); | 795 | return chsc_ioctl_chpd(argp); |
789 | case CHSC_INFO_DCAL: | 796 | case CHSC_INFO_DCAL: |
790 | return chsc_ioctl_dcal((void __user *)arg); | 797 | return chsc_ioctl_dcal(argp); |
791 | default: /* unknown ioctl number */ | 798 | default: /* unknown ioctl number */ |
792 | return -ENOIOCTLCMD; | 799 | return -ENOIOCTLCMD; |
793 | } | 800 | } |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 0d4d18bdd45c..c68be24e27d9 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
@@ -393,10 +393,12 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt) | |||
393 | * u_mult_inv > 128 bytes. | 393 | * u_mult_inv > 128 bytes. |
394 | */ | 394 | */ |
395 | if (copied == 0) { | 395 | if (copied == 0) { |
396 | int len; | 396 | unsigned int len; |
397 | spin_unlock_bh(&zcrypt_device_lock); | 397 | spin_unlock_bh(&zcrypt_device_lock); |
398 | /* len is max 256 / 2 - 120 = 8 */ | 398 | /* len is max 256 / 2 - 120 = 8 */ |
399 | len = crt->inputdatalength / 2 - 120; | 399 | len = crt->inputdatalength / 2 - 120; |
400 | if (len > sizeof(z1)) | ||
401 | return -EFAULT; | ||
400 | z1 = z2 = z3 = 0; | 402 | z1 = z2 = z3 = 0; |
401 | if (copy_from_user(&z1, crt->np_prime, len) || | 403 | if (copy_from_user(&z1, crt->np_prime, len) || |
402 | copy_from_user(&z2, crt->bp_key, len) || | 404 | copy_from_user(&z2, crt->bp_key, len) || |
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index 36ede02ceacf..b5496a19d967 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c | |||
@@ -354,6 +354,8 @@ static const struct pnp_device_id pnp_dev_table[] = { | |||
354 | { "FUJ02E5", 0 }, | 354 | { "FUJ02E5", 0 }, |
355 | /* Fujitsu P-series tablet PC device */ | 355 | /* Fujitsu P-series tablet PC device */ |
356 | { "FUJ02E6", 0 }, | 356 | { "FUJ02E6", 0 }, |
357 | /* Fujitsu Wacom 2FGT Tablet PC device */ | ||
358 | { "FUJ02E7", 0 }, | ||
357 | /* | 359 | /* |
358 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in | 360 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in |
359 | * disguise) | 361 | * disguise) |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 37f0de9dd9ce..42f3333c4ad0 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -1052,7 +1052,18 @@ static void __devinit sci_init_single(struct platform_device *dev, | |||
1052 | sci_port->port.ops = &sci_uart_ops; | 1052 | sci_port->port.ops = &sci_uart_ops; |
1053 | sci_port->port.iotype = UPIO_MEM; | 1053 | sci_port->port.iotype = UPIO_MEM; |
1054 | sci_port->port.line = index; | 1054 | sci_port->port.line = index; |
1055 | sci_port->port.fifosize = 1; | 1055 | |
1056 | switch (p->type) { | ||
1057 | case PORT_SCIFA: | ||
1058 | sci_port->port.fifosize = 64; | ||
1059 | break; | ||
1060 | case PORT_SCIF: | ||
1061 | sci_port->port.fifosize = 16; | ||
1062 | break; | ||
1063 | default: | ||
1064 | sci_port->port.fifosize = 1; | ||
1065 | break; | ||
1066 | } | ||
1056 | 1067 | ||
1057 | if (dev) { | 1068 | if (dev) { |
1058 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; | 1069 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; |
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index adf9632c6b1f..53cb722c45a0 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
@@ -211,21 +211,23 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, | |||
211 | 211 | ||
212 | /** | 212 | /** |
213 | * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock. | 213 | * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock. |
214 | * @id: window id. | ||
215 | * @sfb: The hardware state. | 214 | * @sfb: The hardware state. |
216 | * @pixclock: The pixel clock wanted, in picoseconds. | 215 | * @pixclock: The pixel clock wanted, in picoseconds. |
217 | * | 216 | * |
218 | * Given the specified pixel clock, work out the necessary divider to get | 217 | * Given the specified pixel clock, work out the necessary divider to get |
219 | * close to the output frequency. | 218 | * close to the output frequency. |
220 | */ | 219 | */ |
221 | static int s3c_fb_calc_pixclk(unsigned char id, struct s3c_fb *sfb, unsigned int pixclk) | 220 | static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk) |
222 | { | 221 | { |
223 | struct s3c_fb_pd_win *win = sfb->pdata->win[id]; | ||
224 | unsigned long clk = clk_get_rate(sfb->bus_clk); | 222 | unsigned long clk = clk_get_rate(sfb->bus_clk); |
223 | unsigned long long tmp; | ||
225 | unsigned int result; | 224 | unsigned int result; |
226 | 225 | ||
227 | pixclk *= win->win_mode.refresh; | 226 | tmp = (unsigned long long)clk; |
228 | result = clk / pixclk; | 227 | tmp *= pixclk; |
228 | |||
229 | do_div(tmp, 1000000000UL); | ||
230 | result = (unsigned int)tmp / 1000; | ||
229 | 231 | ||
230 | dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", | 232 | dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", |
231 | pixclk, clk, result, clk / result); | 233 | pixclk, clk, result, clk / result); |
@@ -301,7 +303,7 @@ static int s3c_fb_set_par(struct fb_info *info) | |||
301 | /* use window 0 as the basis for the lcd output timings */ | 303 | /* use window 0 as the basis for the lcd output timings */ |
302 | 304 | ||
303 | if (win_no == 0) { | 305 | if (win_no == 0) { |
304 | clkdiv = s3c_fb_calc_pixclk(win_no, sfb, var->pixclock); | 306 | clkdiv = s3c_fb_calc_pixclk(sfb, var->pixclock); |
305 | 307 | ||
306 | data = sfb->pdata->vidcon0; | 308 | data = sfb->pdata->vidcon0; |
307 | data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR); | 309 | data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR); |
diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index 9d4f3a49ba4a..d5077dfa9e00 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c | |||
@@ -137,7 +137,7 @@ static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height, | |||
137 | tmp, dst_pitch); | 137 | tmp, dst_pitch); |
138 | return -EINVAL; | 138 | return -EINVAL; |
139 | } | 139 | } |
140 | tmp = (tmp >> 3) | (dst_pitch << (16 - 3)); | 140 | tmp = VIA_PITCH_ENABLE | (tmp >> 3) | (dst_pitch << (16 - 3)); |
141 | writel(tmp, engine + 0x38); | 141 | writel(tmp, engine + 0x38); |
142 | 142 | ||
143 | if (op == VIA_BITBLT_FILL) | 143 | if (op == VIA_BITBLT_FILL) |
@@ -352,6 +352,9 @@ int viafb_init_engine(struct fb_info *info) | |||
352 | viapar->shared->vq_vram_addr = viapar->fbmem_free; | 352 | viapar->shared->vq_vram_addr = viapar->fbmem_free; |
353 | viapar->fbmem_used += VQ_SIZE; | 353 | viapar->fbmem_used += VQ_SIZE; |
354 | 354 | ||
355 | /* Init 2D engine reg to reset 2D engine */ | ||
356 | writel(0x0, engine + VIA_REG_KEYCONTROL); | ||
357 | |||
355 | /* Init AGP and VQ regs */ | 358 | /* Init AGP and VQ regs */ |
356 | switch (chip_name) { | 359 | switch (chip_name) { |
357 | case UNICHROME_K8M890: | 360 | case UNICHROME_K8M890: |
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index d8df17a7d5fc..3028e7ddc3b5 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -177,16 +177,15 @@ static int viafb_set_par(struct fb_info *info) | |||
177 | } | 177 | } |
178 | 178 | ||
179 | if (vmode_index != VIA_RES_INVALID) { | 179 | if (vmode_index != VIA_RES_INVALID) { |
180 | viafb_setmode(vmode_index, info->var.xres, info->var.yres, | ||
181 | info->var.bits_per_pixel, vmode_index1, | ||
182 | viafb_second_xres, viafb_second_yres, viafb_bpp1); | ||
183 | |||
184 | viafb_update_fix(info); | 180 | viafb_update_fix(info); |
185 | viafb_bpp = info->var.bits_per_pixel; | 181 | viafb_bpp = info->var.bits_per_pixel; |
186 | if (info->var.accel_flags & FB_ACCELF_TEXT) | 182 | if (info->var.accel_flags & FB_ACCELF_TEXT) |
187 | info->flags &= ~FBINFO_HWACCEL_DISABLED; | 183 | info->flags &= ~FBINFO_HWACCEL_DISABLED; |
188 | else | 184 | else |
189 | info->flags |= FBINFO_HWACCEL_DISABLED; | 185 | info->flags |= FBINFO_HWACCEL_DISABLED; |
186 | viafb_setmode(vmode_index, info->var.xres, info->var.yres, | ||
187 | info->var.bits_per_pixel, vmode_index1, | ||
188 | viafb_second_xres, viafb_second_yres, viafb_bpp1); | ||
190 | } | 189 | } |
191 | 190 | ||
192 | return 0; | 191 | return 0; |
@@ -872,7 +871,9 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
872 | if (info->flags & FBINFO_HWACCEL_DISABLED || info != viafbinfo) | 871 | if (info->flags & FBINFO_HWACCEL_DISABLED || info != viafbinfo) |
873 | return -ENODEV; | 872 | return -ENODEV; |
874 | 873 | ||
875 | if (chip_name == UNICHROME_CLE266 && viapar->iga_path == IGA2) | 874 | /* LCD ouput does not support hw cursors (at least on VN896) */ |
875 | if ((chip_name == UNICHROME_CLE266 && viapar->iga_path == IGA2) || | ||
876 | viafb_LCD_ON) | ||
876 | return -ENODEV; | 877 | return -ENODEV; |
877 | 878 | ||
878 | viafb_show_hw_cursor(info, HW_Cursor_OFF); | 879 | viafb_show_hw_cursor(info, HW_Cursor_OFF); |
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 9dd588042880..505be88c82ae 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -266,7 +266,7 @@ static void __devexit virtballoon_remove(struct virtio_device *vdev) | |||
266 | 266 | ||
267 | static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST }; | 267 | static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST }; |
268 | 268 | ||
269 | static struct virtio_driver virtio_balloon = { | 269 | static struct virtio_driver virtio_balloon_driver = { |
270 | .feature_table = features, | 270 | .feature_table = features, |
271 | .feature_table_size = ARRAY_SIZE(features), | 271 | .feature_table_size = ARRAY_SIZE(features), |
272 | .driver.name = KBUILD_MODNAME, | 272 | .driver.name = KBUILD_MODNAME, |
@@ -279,12 +279,12 @@ static struct virtio_driver virtio_balloon = { | |||
279 | 279 | ||
280 | static int __init init(void) | 280 | static int __init init(void) |
281 | { | 281 | { |
282 | return register_virtio_driver(&virtio_balloon); | 282 | return register_virtio_driver(&virtio_balloon_driver); |
283 | } | 283 | } |
284 | 284 | ||
285 | static void __exit fini(void) | 285 | static void __exit fini(void) |
286 | { | 286 | { |
287 | unregister_virtio_driver(&virtio_balloon); | 287 | unregister_virtio_driver(&virtio_balloon_driver); |
288 | } | 288 | } |
289 | module_init(init); | 289 | module_init(init); |
290 | module_exit(fini); | 290 | module_exit(fini); |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index c4997930afc7..5d42d55e299b 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -102,15 +102,15 @@ static void do_suspend(void) | |||
102 | goto out_thaw; | 102 | goto out_thaw; |
103 | } | 103 | } |
104 | 104 | ||
105 | printk(KERN_DEBUG "suspending xenstore...\n"); | ||
106 | xs_suspend(); | ||
107 | |||
105 | err = dpm_suspend_noirq(PMSG_SUSPEND); | 108 | err = dpm_suspend_noirq(PMSG_SUSPEND); |
106 | if (err) { | 109 | if (err) { |
107 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); | 110 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); |
108 | goto out_resume; | 111 | goto out_resume; |
109 | } | 112 | } |
110 | 113 | ||
111 | printk(KERN_DEBUG "suspending xenstore...\n"); | ||
112 | xs_suspend(); | ||
113 | |||
114 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); | 114 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); |
115 | 115 | ||
116 | dpm_resume_noirq(PMSG_RESUME); | 116 | dpm_resume_noirq(PMSG_RESUME); |
@@ -120,13 +120,13 @@ static void do_suspend(void) | |||
120 | cancelled = 1; | 120 | cancelled = 1; |
121 | } | 121 | } |
122 | 122 | ||
123 | out_resume: | ||
123 | if (!cancelled) { | 124 | if (!cancelled) { |
124 | xen_arch_resume(); | 125 | xen_arch_resume(); |
125 | xs_resume(); | 126 | xs_resume(); |
126 | } else | 127 | } else |
127 | xs_suspend_cancel(); | 128 | xs_suspend_cancel(); |
128 | 129 | ||
129 | out_resume: | ||
130 | dpm_resume_end(PMSG_RESUME); | 130 | dpm_resume_end(PMSG_RESUME); |
131 | 131 | ||
132 | /* Make sure timer events get retriggered on all CPUs */ | 132 | /* Make sure timer events get retriggered on all CPUs */ |
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index c9ee67b442e1..1afb0a10229f 100644 --- a/fs/notify/inotify/inotify_fsnotify.c +++ b/fs/notify/inotify/inotify_fsnotify.c | |||
@@ -121,7 +121,7 @@ static int idr_callback(int id, void *p, void *data) | |||
121 | if (warned) | 121 | if (warned) |
122 | return 0; | 122 | return 0; |
123 | 123 | ||
124 | warned = false; | 124 | warned = true; |
125 | entry = p; | 125 | entry = p; |
126 | ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); | 126 | ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); |
127 | 127 | ||
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 8271cf05c957..a94e8bd8eb1f 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -552,7 +552,7 @@ retry: | |||
552 | 552 | ||
553 | spin_lock(&group->inotify_data.idr_lock); | 553 | spin_lock(&group->inotify_data.idr_lock); |
554 | ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry, | 554 | ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry, |
555 | group->inotify_data.last_wd, | 555 | group->inotify_data.last_wd+1, |
556 | &tmp_ientry->wd); | 556 | &tmp_ientry->wd); |
557 | spin_unlock(&group->inotify_data.idr_lock); | 557 | spin_unlock(&group->inotify_data.idr_lock); |
558 | if (ret) { | 558 | if (ret) { |
@@ -632,7 +632,7 @@ static struct fsnotify_group *inotify_new_group(struct user_struct *user, unsign | |||
632 | 632 | ||
633 | spin_lock_init(&group->inotify_data.idr_lock); | 633 | spin_lock_init(&group->inotify_data.idr_lock); |
634 | idr_init(&group->inotify_data.idr); | 634 | idr_init(&group->inotify_data.idr); |
635 | group->inotify_data.last_wd = 1; | 635 | group->inotify_data.last_wd = 0; |
636 | group->inotify_data.user = user; | 636 | group->inotify_data.user = user; |
637 | group->inotify_data.fa = NULL; | 637 | group->inotify_data.fa = NULL; |
638 | 638 | ||
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 2efc57173fd7..1739a4aba25f 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -123,30 +123,6 @@ add_error: | |||
123 | 123 | ||
124 | /*****************************************************************************/ | 124 | /*****************************************************************************/ |
125 | /* | 125 | /* |
126 | * check that file shrinkage doesn't leave any VMAs dangling in midair | ||
127 | */ | ||
128 | static int ramfs_nommu_check_mappings(struct inode *inode, | ||
129 | size_t newsize, size_t size) | ||
130 | { | ||
131 | struct vm_area_struct *vma; | ||
132 | struct prio_tree_iter iter; | ||
133 | |||
134 | /* search for VMAs that fall within the dead zone */ | ||
135 | vma_prio_tree_foreach(vma, &iter, &inode->i_mapping->i_mmap, | ||
136 | newsize >> PAGE_SHIFT, | ||
137 | (size + PAGE_SIZE - 1) >> PAGE_SHIFT | ||
138 | ) { | ||
139 | /* found one - only interested if it's shared out of the page | ||
140 | * cache */ | ||
141 | if (vma->vm_flags & VM_SHARED) | ||
142 | return -ETXTBSY; /* not quite true, but near enough */ | ||
143 | } | ||
144 | |||
145 | return 0; | ||
146 | } | ||
147 | |||
148 | /*****************************************************************************/ | ||
149 | /* | ||
150 | * | 126 | * |
151 | */ | 127 | */ |
152 | static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size) | 128 | static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size) |
@@ -164,7 +140,7 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size) | |||
164 | 140 | ||
165 | /* check that a decrease in size doesn't cut off any shared mappings */ | 141 | /* check that a decrease in size doesn't cut off any shared mappings */ |
166 | if (newsize < size) { | 142 | if (newsize < size) { |
167 | ret = ramfs_nommu_check_mappings(inode, newsize, size); | 143 | ret = nommu_shrink_inode_mappings(inode, size, newsize); |
168 | if (ret < 0) | 144 | if (ret < 0) |
169 | return ret; | 145 | return ret; |
170 | } | 146 | } |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3fc9f5aab5f8..328bca609b9b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -734,6 +734,10 @@ struct sysinfo { | |||
734 | /* Force a compilation error if condition is constant and true */ | 734 | /* Force a compilation error if condition is constant and true */ |
735 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | 735 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) |
736 | 736 | ||
737 | /* Force a compilation error if a constant expression is not a power of 2 */ | ||
738 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | ||
739 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | ||
740 | |||
737 | /* Force a compilation error if condition is true, but also produce a | 741 | /* Force a compilation error if condition is true, but also produce a |
738 | result (of value 0 and type size_t), so the expression can be used | 742 | result (of value 0 and type size_t), so the expression can be used |
739 | e.g. in a structure initializer (or where-ever else comma expressions | 743 | e.g. in a structure initializer (or where-ever else comma expressions |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 7c6b32a1421c..6f6c5f300af6 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -67,7 +67,7 @@ struct kfifo { | |||
67 | /** | 67 | /** |
68 | * DECLARE_KFIFO - macro to declare a kfifo and the associated buffer | 68 | * DECLARE_KFIFO - macro to declare a kfifo and the associated buffer |
69 | * @name: name of the declared kfifo datatype | 69 | * @name: name of the declared kfifo datatype |
70 | * @size: size of the fifo buffer | 70 | * @size: size of the fifo buffer. Must be a power of two. |
71 | * | 71 | * |
72 | * Note1: the macro can be used inside struct or union declaration | 72 | * Note1: the macro can be used inside struct or union declaration |
73 | * Note2: the macro creates two objects: | 73 | * Note2: the macro creates two objects: |
@@ -91,7 +91,7 @@ union { \ | |||
91 | /** | 91 | /** |
92 | * DEFINE_KFIFO - macro to define and initialize a kfifo | 92 | * DEFINE_KFIFO - macro to define and initialize a kfifo |
93 | * @name: name of the declared kfifo datatype | 93 | * @name: name of the declared kfifo datatype |
94 | * @size: size of the fifo buffer | 94 | * @size: size of the fifo buffer. Must be a power of two. |
95 | * | 95 | * |
96 | * Note1: the macro can be used for global and local kfifo data type variables | 96 | * Note1: the macro can be used for global and local kfifo data type variables |
97 | * Note2: the macro creates two objects: | 97 | * Note2: the macro creates two objects: |
@@ -104,15 +104,28 @@ union { \ | |||
104 | 104 | ||
105 | #undef __kfifo_initializer | 105 | #undef __kfifo_initializer |
106 | 106 | ||
107 | extern void kfifo_init(struct kfifo *fifo, unsigned char *buffer, | 107 | extern void kfifo_init(struct kfifo *fifo, void *buffer, |
108 | unsigned int size); | 108 | unsigned int size); |
109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, | 109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, |
110 | gfp_t gfp_mask); | 110 | gfp_t gfp_mask); |
111 | extern void kfifo_free(struct kfifo *fifo); | 111 | extern void kfifo_free(struct kfifo *fifo); |
112 | extern unsigned int kfifo_in(struct kfifo *fifo, | 112 | extern unsigned int kfifo_in(struct kfifo *fifo, |
113 | const unsigned char *from, unsigned int len); | 113 | const void *from, unsigned int len); |
114 | extern __must_check unsigned int kfifo_out(struct kfifo *fifo, | 114 | extern __must_check unsigned int kfifo_out(struct kfifo *fifo, |
115 | unsigned char *to, unsigned int len); | 115 | void *to, unsigned int len); |
116 | extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo, | ||
117 | void *to, unsigned int len, unsigned offset); | ||
118 | |||
119 | /** | ||
120 | * kfifo_initialized - Check if kfifo is initialized. | ||
121 | * @fifo: fifo to check | ||
122 | * Return %true if FIFO is initialized, otherwise %false. | ||
123 | * Assumes the fifo was 0 before. | ||
124 | */ | ||
125 | static inline bool kfifo_initialized(struct kfifo *fifo) | ||
126 | { | ||
127 | return fifo->buffer != 0; | ||
128 | } | ||
116 | 129 | ||
117 | /** | 130 | /** |
118 | * kfifo_reset - removes the entire FIFO contents | 131 | * kfifo_reset - removes the entire FIFO contents |
@@ -194,7 +207,7 @@ static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo) | |||
194 | * bytes copied. | 207 | * bytes copied. |
195 | */ | 208 | */ |
196 | static inline unsigned int kfifo_in_locked(struct kfifo *fifo, | 209 | static inline unsigned int kfifo_in_locked(struct kfifo *fifo, |
197 | const unsigned char *from, unsigned int n, spinlock_t *lock) | 210 | const void *from, unsigned int n, spinlock_t *lock) |
198 | { | 211 | { |
199 | unsigned long flags; | 212 | unsigned long flags; |
200 | unsigned int ret; | 213 | unsigned int ret; |
@@ -219,7 +232,7 @@ static inline unsigned int kfifo_in_locked(struct kfifo *fifo, | |||
219 | * @to buffer and returns the number of copied bytes. | 232 | * @to buffer and returns the number of copied bytes. |
220 | */ | 233 | */ |
221 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, | 234 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, |
222 | unsigned char *to, unsigned int n, spinlock_t *lock) | 235 | void *to, unsigned int n, spinlock_t *lock) |
223 | { | 236 | { |
224 | unsigned long flags; | 237 | unsigned long flags; |
225 | unsigned int ret; | 238 | unsigned int ret; |
@@ -228,13 +241,6 @@ static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, | |||
228 | 241 | ||
229 | ret = kfifo_out(fifo, to, n); | 242 | ret = kfifo_out(fifo, to, n); |
230 | 243 | ||
231 | /* | ||
232 | * optimization: if the FIFO is empty, set the indices to 0 | ||
233 | * so we don't wrap the next time | ||
234 | */ | ||
235 | if (kfifo_is_empty(fifo)) | ||
236 | kfifo_reset(fifo); | ||
237 | |||
238 | spin_unlock_irqrestore(lock, flags); | 244 | spin_unlock_irqrestore(lock, flags); |
239 | 245 | ||
240 | return ret; | 246 | return ret; |
@@ -242,11 +248,11 @@ static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, | |||
242 | 248 | ||
243 | extern void kfifo_skip(struct kfifo *fifo, unsigned int len); | 249 | extern void kfifo_skip(struct kfifo *fifo, unsigned int len); |
244 | 250 | ||
245 | extern __must_check unsigned int kfifo_from_user(struct kfifo *fifo, | 251 | extern __must_check int kfifo_from_user(struct kfifo *fifo, |
246 | const void __user *from, unsigned int n); | 252 | const void __user *from, unsigned int n, unsigned *lenout); |
247 | 253 | ||
248 | extern __must_check unsigned int kfifo_to_user(struct kfifo *fifo, | 254 | extern __must_check int kfifo_to_user(struct kfifo *fifo, |
249 | void __user *to, unsigned int n); | 255 | void __user *to, unsigned int n, unsigned *lenout); |
250 | 256 | ||
251 | /* | 257 | /* |
252 | * __kfifo_add_out internal helper function for updating the out offset | 258 | * __kfifo_add_out internal helper function for updating the out offset |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 2265f28eb47a..60c467bfbabd 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1089,6 +1089,7 @@ extern void zone_pcp_update(struct zone *zone); | |||
1089 | 1089 | ||
1090 | /* nommu.c */ | 1090 | /* nommu.c */ |
1091 | extern atomic_long_t mmap_pages_allocated; | 1091 | extern atomic_long_t mmap_pages_allocated; |
1092 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); | ||
1092 | 1093 | ||
1093 | /* prio_tree.c */ | 1094 | /* prio_tree.c */ |
1094 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 1095 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 84d020bed083..36f96271306c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -122,7 +122,7 @@ struct vm_region { | |||
122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ | 122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ |
123 | struct file *vm_file; /* the backing file or NULL */ | 123 | struct file *vm_file; /* the backing file or NULL */ |
124 | 124 | ||
125 | atomic_t vm_usage; /* region usage count */ | 125 | int vm_usage; /* region usage count (access under nommu_region_sem) */ |
126 | bool vm_icache_flushed : 1; /* true if the icache has been flushed for | 126 | bool vm_icache_flushed : 1; /* true if the icache has been flushed for |
127 | * this region */ | 127 | * this region */ |
128 | }; | 128 | }; |
@@ -205,10 +205,12 @@ struct mm_struct { | |||
205 | struct vm_area_struct * mmap; /* list of VMAs */ | 205 | struct vm_area_struct * mmap; /* list of VMAs */ |
206 | struct rb_root mm_rb; | 206 | struct rb_root mm_rb; |
207 | struct vm_area_struct * mmap_cache; /* last find_vma result */ | 207 | struct vm_area_struct * mmap_cache; /* last find_vma result */ |
208 | #ifdef CONFIG_MMU | ||
208 | unsigned long (*get_unmapped_area) (struct file *filp, | 209 | unsigned long (*get_unmapped_area) (struct file *filp, |
209 | unsigned long addr, unsigned long len, | 210 | unsigned long addr, unsigned long len, |
210 | unsigned long pgoff, unsigned long flags); | 211 | unsigned long pgoff, unsigned long flags); |
211 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | 212 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); |
213 | #endif | ||
212 | unsigned long mmap_base; /* base of mmap area */ | 214 | unsigned long mmap_base; /* base of mmap area */ |
213 | unsigned long task_size; /* size of task vm space */ | 215 | unsigned long task_size; /* size of task vm space */ |
214 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | 216 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8d4991be9d53..6f7bba93929b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -377,6 +377,8 @@ extern int sysctl_max_map_count; | |||
377 | 377 | ||
378 | #include <linux/aio.h> | 378 | #include <linux/aio.h> |
379 | 379 | ||
380 | #ifdef CONFIG_MMU | ||
381 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
380 | extern unsigned long | 382 | extern unsigned long |
381 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, | 383 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, |
382 | unsigned long, unsigned long); | 384 | unsigned long, unsigned long); |
@@ -386,6 +388,9 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
386 | unsigned long flags); | 388 | unsigned long flags); |
387 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | 389 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
388 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | 390 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
391 | #else | ||
392 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | ||
393 | #endif | ||
389 | 394 | ||
390 | #if USE_SPLIT_PTLOCKS | 395 | #if USE_SPLIT_PTLOCKS |
391 | /* | 396 | /* |
@@ -2491,8 +2496,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
2491 | 2496 | ||
2492 | #endif /* CONFIG_SMP */ | 2497 | #endif /* CONFIG_SMP */ |
2493 | 2498 | ||
2494 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
2495 | |||
2496 | #ifdef CONFIG_TRACING | 2499 | #ifdef CONFIG_TRACING |
2497 | extern void | 2500 | extern void |
2498 | __trace_special(void *__tr, void *__data, | 2501 | __trace_special(void *__tr, void *__data, |
diff --git a/include/linux/serio.h b/include/linux/serio.h index e2f3044d4a4a..813d26c247ec 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -136,25 +136,6 @@ static inline void serio_continue_rx(struct serio *serio) | |||
136 | spin_unlock_irq(&serio->lock); | 136 | spin_unlock_irq(&serio->lock); |
137 | } | 137 | } |
138 | 138 | ||
139 | /* | ||
140 | * Use the following functions to pin serio's driver in process context | ||
141 | */ | ||
142 | static inline int serio_pin_driver(struct serio *serio) | ||
143 | { | ||
144 | return mutex_lock_interruptible(&serio->drv_mutex); | ||
145 | } | ||
146 | |||
147 | static inline void serio_pin_driver_uninterruptible(struct serio *serio) | ||
148 | { | ||
149 | mutex_lock(&serio->drv_mutex); | ||
150 | } | ||
151 | |||
152 | static inline void serio_unpin_driver(struct serio *serio) | ||
153 | { | ||
154 | mutex_unlock(&serio->drv_mutex); | ||
155 | } | ||
156 | |||
157 | |||
158 | #endif | 139 | #endif |
159 | 140 | ||
160 | /* | 141 | /* |
diff --git a/include/linux/string.h b/include/linux/string.h index 651839a2a755..a716ee2a8adb 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -72,7 +72,10 @@ static inline __must_check char *strstrip(char *str) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | #ifndef __HAVE_ARCH_STRSTR | 74 | #ifndef __HAVE_ARCH_STRSTR |
75 | extern char * strstr(const char *,const char *); | 75 | extern char * strstr(const char *, const char *); |
76 | #endif | ||
77 | #ifndef __HAVE_ARCH_STRNSTR | ||
78 | extern char * strnstr(const char *, const char *, size_t); | ||
76 | #endif | 79 | #endif |
77 | #ifndef __HAVE_ARCH_STRLEN | 80 | #ifndef __HAVE_ARCH_STRLEN |
78 | extern __kernel_size_t strlen(const char *); | 81 | extern __kernel_size_t strlen(const char *); |
diff --git a/include/linux/tty.h b/include/linux/tty.h index ef3a2947b102..6abfcf5b5887 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -464,7 +464,7 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port); | |||
464 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 464 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
465 | extern void tty_port_put(struct tty_port *port); | 465 | extern void tty_port_put(struct tty_port *port); |
466 | 466 | ||
467 | extern inline struct tty_port *tty_port_get(struct tty_port *port) | 467 | static inline struct tty_port *tty_port_get(struct tty_port *port) |
468 | { | 468 | { |
469 | if (port) | 469 | if (port) |
470 | kref_get(&port->kref); | 470 | kref_get(&port->kref); |
@@ -486,7 +486,7 @@ extern void tty_port_close(struct tty_port *port, | |||
486 | struct tty_struct *tty, struct file *filp); | 486 | struct tty_struct *tty, struct file *filp); |
487 | extern int tty_port_open(struct tty_port *port, | 487 | extern int tty_port_open(struct tty_port *port, |
488 | struct tty_struct *tty, struct file *filp); | 488 | struct tty_struct *tty, struct file *filp); |
489 | extern inline int tty_port_users(struct tty_port *port) | 489 | static inline int tty_port_users(struct tty_port *port) |
490 | { | 490 | { |
491 | return port->count + port->blocked_open; | 491 | return port->count + port->blocked_open; |
492 | } | 492 | } |
diff --git a/include/net/ip.h b/include/net/ip.h index d9a0e74d8923..fb63371c07a8 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -338,7 +338,7 @@ static inline int sk_mc_loop(struct sock *sk) | |||
338 | return inet6_sk(sk)->mc_loop; | 338 | return inet6_sk(sk)->mc_loop; |
339 | #endif | 339 | #endif |
340 | } | 340 | } |
341 | __WARN(); | 341 | WARN_ON(1); |
342 | return 1; | 342 | return 1; |
343 | } | 343 | } |
344 | 344 | ||
@@ -298,6 +298,9 @@ static const struct file_operations shm_file_operations = { | |||
298 | .mmap = shm_mmap, | 298 | .mmap = shm_mmap, |
299 | .fsync = shm_fsync, | 299 | .fsync = shm_fsync, |
300 | .release = shm_release, | 300 | .release = shm_release, |
301 | #ifndef CONFIG_MMU | ||
302 | .get_unmapped_area = shm_get_unmapped_area, | ||
303 | #endif | ||
301 | }; | 304 | }; |
302 | 305 | ||
303 | static const struct file_operations shm_file_operations_huge = { | 306 | static const struct file_operations shm_file_operations_huge = { |
diff --git a/kernel/futex.c b/kernel/futex.c index 8e3c3ffe1b9a..d9b3a2228f9d 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -203,8 +203,6 @@ static void drop_futex_key_refs(union futex_key *key) | |||
203 | * @uaddr: virtual address of the futex | 203 | * @uaddr: virtual address of the futex |
204 | * @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED | 204 | * @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED |
205 | * @key: address where result is stored. | 205 | * @key: address where result is stored. |
206 | * @rw: mapping needs to be read/write (values: VERIFY_READ, | ||
207 | * VERIFY_WRITE) | ||
208 | * | 206 | * |
209 | * Returns a negative error code or 0 | 207 | * Returns a negative error code or 0 |
210 | * The key words are stored in *key on success. | 208 | * The key words are stored in *key on success. |
@@ -216,7 +214,7 @@ static void drop_futex_key_refs(union futex_key *key) | |||
216 | * lock_page() might sleep, the caller should not hold a spinlock. | 214 | * lock_page() might sleep, the caller should not hold a spinlock. |
217 | */ | 215 | */ |
218 | static int | 216 | static int |
219 | get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) | 217 | get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key) |
220 | { | 218 | { |
221 | unsigned long address = (unsigned long)uaddr; | 219 | unsigned long address = (unsigned long)uaddr; |
222 | struct mm_struct *mm = current->mm; | 220 | struct mm_struct *mm = current->mm; |
@@ -239,7 +237,7 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) | |||
239 | * but access_ok() should be faster than find_vma() | 237 | * but access_ok() should be faster than find_vma() |
240 | */ | 238 | */ |
241 | if (!fshared) { | 239 | if (!fshared) { |
242 | if (unlikely(!access_ok(rw, uaddr, sizeof(u32)))) | 240 | if (unlikely(!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))) |
243 | return -EFAULT; | 241 | return -EFAULT; |
244 | key->private.mm = mm; | 242 | key->private.mm = mm; |
245 | key->private.address = address; | 243 | key->private.address = address; |
@@ -248,7 +246,7 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) | |||
248 | } | 246 | } |
249 | 247 | ||
250 | again: | 248 | again: |
251 | err = get_user_pages_fast(address, 1, rw == VERIFY_WRITE, &page); | 249 | err = get_user_pages_fast(address, 1, 1, &page); |
252 | if (err < 0) | 250 | if (err < 0) |
253 | return err; | 251 | return err; |
254 | 252 | ||
@@ -867,7 +865,7 @@ static int futex_wake(u32 __user *uaddr, int fshared, int nr_wake, u32 bitset) | |||
867 | if (!bitset) | 865 | if (!bitset) |
868 | return -EINVAL; | 866 | return -EINVAL; |
869 | 867 | ||
870 | ret = get_futex_key(uaddr, fshared, &key, VERIFY_READ); | 868 | ret = get_futex_key(uaddr, fshared, &key); |
871 | if (unlikely(ret != 0)) | 869 | if (unlikely(ret != 0)) |
872 | goto out; | 870 | goto out; |
873 | 871 | ||
@@ -913,10 +911,10 @@ futex_wake_op(u32 __user *uaddr1, int fshared, u32 __user *uaddr2, | |||
913 | int ret, op_ret; | 911 | int ret, op_ret; |
914 | 912 | ||
915 | retry: | 913 | retry: |
916 | ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ); | 914 | ret = get_futex_key(uaddr1, fshared, &key1); |
917 | if (unlikely(ret != 0)) | 915 | if (unlikely(ret != 0)) |
918 | goto out; | 916 | goto out; |
919 | ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_WRITE); | 917 | ret = get_futex_key(uaddr2, fshared, &key2); |
920 | if (unlikely(ret != 0)) | 918 | if (unlikely(ret != 0)) |
921 | goto out_put_key1; | 919 | goto out_put_key1; |
922 | 920 | ||
@@ -1175,11 +1173,10 @@ retry: | |||
1175 | pi_state = NULL; | 1173 | pi_state = NULL; |
1176 | } | 1174 | } |
1177 | 1175 | ||
1178 | ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ); | 1176 | ret = get_futex_key(uaddr1, fshared, &key1); |
1179 | if (unlikely(ret != 0)) | 1177 | if (unlikely(ret != 0)) |
1180 | goto out; | 1178 | goto out; |
1181 | ret = get_futex_key(uaddr2, fshared, &key2, | 1179 | ret = get_futex_key(uaddr2, fshared, &key2); |
1182 | requeue_pi ? VERIFY_WRITE : VERIFY_READ); | ||
1183 | if (unlikely(ret != 0)) | 1180 | if (unlikely(ret != 0)) |
1184 | goto out_put_key1; | 1181 | goto out_put_key1; |
1185 | 1182 | ||
@@ -1738,7 +1735,7 @@ static int futex_wait_setup(u32 __user *uaddr, u32 val, int fshared, | |||
1738 | */ | 1735 | */ |
1739 | retry: | 1736 | retry: |
1740 | q->key = FUTEX_KEY_INIT; | 1737 | q->key = FUTEX_KEY_INIT; |
1741 | ret = get_futex_key(uaddr, fshared, &q->key, VERIFY_READ); | 1738 | ret = get_futex_key(uaddr, fshared, &q->key); |
1742 | if (unlikely(ret != 0)) | 1739 | if (unlikely(ret != 0)) |
1743 | return ret; | 1740 | return ret; |
1744 | 1741 | ||
@@ -1904,7 +1901,7 @@ static int futex_lock_pi(u32 __user *uaddr, int fshared, | |||
1904 | q.requeue_pi_key = NULL; | 1901 | q.requeue_pi_key = NULL; |
1905 | retry: | 1902 | retry: |
1906 | q.key = FUTEX_KEY_INIT; | 1903 | q.key = FUTEX_KEY_INIT; |
1907 | ret = get_futex_key(uaddr, fshared, &q.key, VERIFY_WRITE); | 1904 | ret = get_futex_key(uaddr, fshared, &q.key); |
1908 | if (unlikely(ret != 0)) | 1905 | if (unlikely(ret != 0)) |
1909 | goto out; | 1906 | goto out; |
1910 | 1907 | ||
@@ -2023,7 +2020,7 @@ retry: | |||
2023 | if ((uval & FUTEX_TID_MASK) != task_pid_vnr(current)) | 2020 | if ((uval & FUTEX_TID_MASK) != task_pid_vnr(current)) |
2024 | return -EPERM; | 2021 | return -EPERM; |
2025 | 2022 | ||
2026 | ret = get_futex_key(uaddr, fshared, &key, VERIFY_WRITE); | 2023 | ret = get_futex_key(uaddr, fshared, &key); |
2027 | if (unlikely(ret != 0)) | 2024 | if (unlikely(ret != 0)) |
2028 | goto out; | 2025 | goto out; |
2029 | 2026 | ||
@@ -2215,7 +2212,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared, | |||
2215 | rt_waiter.task = NULL; | 2212 | rt_waiter.task = NULL; |
2216 | 2213 | ||
2217 | key2 = FUTEX_KEY_INIT; | 2214 | key2 = FUTEX_KEY_INIT; |
2218 | ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_WRITE); | 2215 | ret = get_futex_key(uaddr2, fshared, &key2); |
2219 | if (unlikely(ret != 0)) | 2216 | if (unlikely(ret != 0)) |
2220 | goto out; | 2217 | goto out; |
2221 | 2218 | ||
diff --git a/kernel/kfifo.c b/kernel/kfifo.c index e92d519f93b1..32c5c15d750d 100644 --- a/kernel/kfifo.c +++ b/kernel/kfifo.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/log2.h> | 28 | #include <linux/log2.h> |
29 | #include <linux/uaccess.h> | 29 | #include <linux/uaccess.h> |
30 | 30 | ||
31 | static void _kfifo_init(struct kfifo *fifo, unsigned char *buffer, | 31 | static void _kfifo_init(struct kfifo *fifo, void *buffer, |
32 | unsigned int size) | 32 | unsigned int size) |
33 | { | 33 | { |
34 | fifo->buffer = buffer; | 34 | fifo->buffer = buffer; |
@@ -41,10 +41,10 @@ static void _kfifo_init(struct kfifo *fifo, unsigned char *buffer, | |||
41 | * kfifo_init - initialize a FIFO using a preallocated buffer | 41 | * kfifo_init - initialize a FIFO using a preallocated buffer |
42 | * @fifo: the fifo to assign the buffer | 42 | * @fifo: the fifo to assign the buffer |
43 | * @buffer: the preallocated buffer to be used. | 43 | * @buffer: the preallocated buffer to be used. |
44 | * @size: the size of the internal buffer, this have to be a power of 2. | 44 | * @size: the size of the internal buffer, this has to be a power of 2. |
45 | * | 45 | * |
46 | */ | 46 | */ |
47 | void kfifo_init(struct kfifo *fifo, unsigned char *buffer, unsigned int size) | 47 | void kfifo_init(struct kfifo *fifo, void *buffer, unsigned int size) |
48 | { | 48 | { |
49 | /* size must be a power of 2 */ | 49 | /* size must be a power of 2 */ |
50 | BUG_ON(!is_power_of_2(size)); | 50 | BUG_ON(!is_power_of_2(size)); |
@@ -159,8 +159,9 @@ static inline void __kfifo_out_data(struct kfifo *fifo, | |||
159 | memcpy(to + l, fifo->buffer, len - l); | 159 | memcpy(to + l, fifo->buffer, len - l); |
160 | } | 160 | } |
161 | 161 | ||
162 | static inline unsigned int __kfifo_from_user_data(struct kfifo *fifo, | 162 | static inline int __kfifo_from_user_data(struct kfifo *fifo, |
163 | const void __user *from, unsigned int len, unsigned int off) | 163 | const void __user *from, unsigned int len, unsigned int off, |
164 | unsigned *lenout) | ||
164 | { | 165 | { |
165 | unsigned int l; | 166 | unsigned int l; |
166 | int ret; | 167 | int ret; |
@@ -177,16 +178,20 @@ static inline unsigned int __kfifo_from_user_data(struct kfifo *fifo, | |||
177 | /* first put the data starting from fifo->in to buffer end */ | 178 | /* first put the data starting from fifo->in to buffer end */ |
178 | l = min(len, fifo->size - off); | 179 | l = min(len, fifo->size - off); |
179 | ret = copy_from_user(fifo->buffer + off, from, l); | 180 | ret = copy_from_user(fifo->buffer + off, from, l); |
180 | 181 | if (unlikely(ret)) { | |
181 | if (unlikely(ret)) | 182 | *lenout = ret; |
182 | return ret + len - l; | 183 | return -EFAULT; |
184 | } | ||
185 | *lenout = l; | ||
183 | 186 | ||
184 | /* then put the rest (if any) at the beginning of the buffer */ | 187 | /* then put the rest (if any) at the beginning of the buffer */ |
185 | return copy_from_user(fifo->buffer, from + l, len - l); | 188 | ret = copy_from_user(fifo->buffer, from + l, len - l); |
189 | *lenout += ret ? ret : len - l; | ||
190 | return ret ? -EFAULT : 0; | ||
186 | } | 191 | } |
187 | 192 | ||
188 | static inline unsigned int __kfifo_to_user_data(struct kfifo *fifo, | 193 | static inline int __kfifo_to_user_data(struct kfifo *fifo, |
189 | void __user *to, unsigned int len, unsigned int off) | 194 | void __user *to, unsigned int len, unsigned int off, unsigned *lenout) |
190 | { | 195 | { |
191 | unsigned int l; | 196 | unsigned int l; |
192 | int ret; | 197 | int ret; |
@@ -203,12 +208,21 @@ static inline unsigned int __kfifo_to_user_data(struct kfifo *fifo, | |||
203 | /* first get the data from fifo->out until the end of the buffer */ | 208 | /* first get the data from fifo->out until the end of the buffer */ |
204 | l = min(len, fifo->size - off); | 209 | l = min(len, fifo->size - off); |
205 | ret = copy_to_user(to, fifo->buffer + off, l); | 210 | ret = copy_to_user(to, fifo->buffer + off, l); |
206 | 211 | *lenout = l; | |
207 | if (unlikely(ret)) | 212 | if (unlikely(ret)) { |
208 | return ret + len - l; | 213 | *lenout -= ret; |
214 | return -EFAULT; | ||
215 | } | ||
209 | 216 | ||
210 | /* then get the rest (if any) from the beginning of the buffer */ | 217 | /* then get the rest (if any) from the beginning of the buffer */ |
211 | return copy_to_user(to + l, fifo->buffer, len - l); | 218 | len -= l; |
219 | ret = copy_to_user(to + l, fifo->buffer, len); | ||
220 | if (unlikely(ret)) { | ||
221 | *lenout += len - ret; | ||
222 | return -EFAULT; | ||
223 | } | ||
224 | *lenout += len; | ||
225 | return 0; | ||
212 | } | 226 | } |
213 | 227 | ||
214 | unsigned int __kfifo_in_n(struct kfifo *fifo, | 228 | unsigned int __kfifo_in_n(struct kfifo *fifo, |
@@ -235,7 +249,7 @@ EXPORT_SYMBOL(__kfifo_in_n); | |||
235 | * Note that with only one concurrent reader and one concurrent | 249 | * Note that with only one concurrent reader and one concurrent |
236 | * writer, you don't need extra locking to use these functions. | 250 | * writer, you don't need extra locking to use these functions. |
237 | */ | 251 | */ |
238 | unsigned int kfifo_in(struct kfifo *fifo, const unsigned char *from, | 252 | unsigned int kfifo_in(struct kfifo *fifo, const void *from, |
239 | unsigned int len) | 253 | unsigned int len) |
240 | { | 254 | { |
241 | len = min(kfifo_avail(fifo), len); | 255 | len = min(kfifo_avail(fifo), len); |
@@ -277,7 +291,7 @@ EXPORT_SYMBOL(__kfifo_out_n); | |||
277 | * Note that with only one concurrent reader and one concurrent | 291 | * Note that with only one concurrent reader and one concurrent |
278 | * writer, you don't need extra locking to use these functions. | 292 | * writer, you don't need extra locking to use these functions. |
279 | */ | 293 | */ |
280 | unsigned int kfifo_out(struct kfifo *fifo, unsigned char *to, unsigned int len) | 294 | unsigned int kfifo_out(struct kfifo *fifo, void *to, unsigned int len) |
281 | { | 295 | { |
282 | len = min(kfifo_len(fifo), len); | 296 | len = min(kfifo_len(fifo), len); |
283 | 297 | ||
@@ -288,6 +302,27 @@ unsigned int kfifo_out(struct kfifo *fifo, unsigned char *to, unsigned int len) | |||
288 | } | 302 | } |
289 | EXPORT_SYMBOL(kfifo_out); | 303 | EXPORT_SYMBOL(kfifo_out); |
290 | 304 | ||
305 | /** | ||
306 | * kfifo_out_peek - copy some data from the FIFO, but do not remove it | ||
307 | * @fifo: the fifo to be used. | ||
308 | * @to: where the data must be copied. | ||
309 | * @len: the size of the destination buffer. | ||
310 | * @offset: offset into the fifo | ||
311 | * | ||
312 | * This function copies at most @len bytes at @offset from the FIFO | ||
313 | * into the @to buffer and returns the number of copied bytes. | ||
314 | * The data is not removed from the FIFO. | ||
315 | */ | ||
316 | unsigned int kfifo_out_peek(struct kfifo *fifo, void *to, unsigned int len, | ||
317 | unsigned offset) | ||
318 | { | ||
319 | len = min(kfifo_len(fifo), len + offset); | ||
320 | |||
321 | __kfifo_out_data(fifo, to, len, offset); | ||
322 | return len; | ||
323 | } | ||
324 | EXPORT_SYMBOL(kfifo_out_peek); | ||
325 | |||
291 | unsigned int __kfifo_out_generic(struct kfifo *fifo, | 326 | unsigned int __kfifo_out_generic(struct kfifo *fifo, |
292 | void *to, unsigned int len, unsigned int recsize, | 327 | void *to, unsigned int len, unsigned int recsize, |
293 | unsigned int *total) | 328 | unsigned int *total) |
@@ -299,10 +334,13 @@ EXPORT_SYMBOL(__kfifo_out_generic); | |||
299 | unsigned int __kfifo_from_user_n(struct kfifo *fifo, | 334 | unsigned int __kfifo_from_user_n(struct kfifo *fifo, |
300 | const void __user *from, unsigned int len, unsigned int recsize) | 335 | const void __user *from, unsigned int len, unsigned int recsize) |
301 | { | 336 | { |
337 | unsigned total; | ||
338 | |||
302 | if (kfifo_avail(fifo) < len + recsize) | 339 | if (kfifo_avail(fifo) < len + recsize) |
303 | return len + 1; | 340 | return len + 1; |
304 | 341 | ||
305 | return __kfifo_from_user_data(fifo, from, len, recsize); | 342 | __kfifo_from_user_data(fifo, from, len, recsize, &total); |
343 | return total; | ||
306 | } | 344 | } |
307 | EXPORT_SYMBOL(__kfifo_from_user_n); | 345 | EXPORT_SYMBOL(__kfifo_from_user_n); |
308 | 346 | ||
@@ -313,18 +351,21 @@ EXPORT_SYMBOL(__kfifo_from_user_n); | |||
313 | * @len: the length of the data to be added. | 351 | * @len: the length of the data to be added. |
314 | * | 352 | * |
315 | * This function copies at most @len bytes from the @from into the | 353 | * This function copies at most @len bytes from the @from into the |
316 | * FIFO depending and returns the number of copied bytes. | 354 | * FIFO depending and returns -EFAULT/0. |
317 | * | 355 | * |
318 | * Note that with only one concurrent reader and one concurrent | 356 | * Note that with only one concurrent reader and one concurrent |
319 | * writer, you don't need extra locking to use these functions. | 357 | * writer, you don't need extra locking to use these functions. |
320 | */ | 358 | */ |
321 | unsigned int kfifo_from_user(struct kfifo *fifo, | 359 | int kfifo_from_user(struct kfifo *fifo, |
322 | const void __user *from, unsigned int len) | 360 | const void __user *from, unsigned int len, unsigned *total) |
323 | { | 361 | { |
362 | int ret; | ||
324 | len = min(kfifo_avail(fifo), len); | 363 | len = min(kfifo_avail(fifo), len); |
325 | len -= __kfifo_from_user_data(fifo, from, len, 0); | 364 | ret = __kfifo_from_user_data(fifo, from, len, 0, total); |
365 | if (ret) | ||
366 | return ret; | ||
326 | __kfifo_add_in(fifo, len); | 367 | __kfifo_add_in(fifo, len); |
327 | return len; | 368 | return 0; |
328 | } | 369 | } |
329 | EXPORT_SYMBOL(kfifo_from_user); | 370 | EXPORT_SYMBOL(kfifo_from_user); |
330 | 371 | ||
@@ -339,17 +380,17 @@ unsigned int __kfifo_to_user_n(struct kfifo *fifo, | |||
339 | void __user *to, unsigned int len, unsigned int reclen, | 380 | void __user *to, unsigned int len, unsigned int reclen, |
340 | unsigned int recsize) | 381 | unsigned int recsize) |
341 | { | 382 | { |
342 | unsigned int ret; | 383 | unsigned int ret, total; |
343 | 384 | ||
344 | if (kfifo_len(fifo) < reclen + recsize) | 385 | if (kfifo_len(fifo) < reclen + recsize) |
345 | return len; | 386 | return len; |
346 | 387 | ||
347 | ret = __kfifo_to_user_data(fifo, to, reclen, recsize); | 388 | ret = __kfifo_to_user_data(fifo, to, reclen, recsize, &total); |
348 | 389 | ||
349 | if (likely(ret == 0)) | 390 | if (likely(ret == 0)) |
350 | __kfifo_add_out(fifo, reclen + recsize); | 391 | __kfifo_add_out(fifo, reclen + recsize); |
351 | 392 | ||
352 | return ret; | 393 | return total; |
353 | } | 394 | } |
354 | EXPORT_SYMBOL(__kfifo_to_user_n); | 395 | EXPORT_SYMBOL(__kfifo_to_user_n); |
355 | 396 | ||
@@ -358,20 +399,22 @@ EXPORT_SYMBOL(__kfifo_to_user_n); | |||
358 | * @fifo: the fifo to be used. | 399 | * @fifo: the fifo to be used. |
359 | * @to: where the data must be copied. | 400 | * @to: where the data must be copied. |
360 | * @len: the size of the destination buffer. | 401 | * @len: the size of the destination buffer. |
402 | @ @lenout: pointer to output variable with copied data | ||
361 | * | 403 | * |
362 | * This function copies at most @len bytes from the FIFO into the | 404 | * This function copies at most @len bytes from the FIFO into the |
363 | * @to buffer and returns the number of copied bytes. | 405 | * @to buffer and 0 or -EFAULT. |
364 | * | 406 | * |
365 | * Note that with only one concurrent reader and one concurrent | 407 | * Note that with only one concurrent reader and one concurrent |
366 | * writer, you don't need extra locking to use these functions. | 408 | * writer, you don't need extra locking to use these functions. |
367 | */ | 409 | */ |
368 | unsigned int kfifo_to_user(struct kfifo *fifo, | 410 | int kfifo_to_user(struct kfifo *fifo, |
369 | void __user *to, unsigned int len) | 411 | void __user *to, unsigned int len, unsigned *lenout) |
370 | { | 412 | { |
413 | int ret; | ||
371 | len = min(kfifo_len(fifo), len); | 414 | len = min(kfifo_len(fifo), len); |
372 | len -= __kfifo_to_user_data(fifo, to, len, 0); | 415 | ret = __kfifo_to_user_data(fifo, to, len, 0, lenout); |
373 | __kfifo_add_out(fifo, len); | 416 | __kfifo_add_out(fifo, *lenout); |
374 | return len; | 417 | return ret; |
375 | } | 418 | } |
376 | EXPORT_SYMBOL(kfifo_to_user); | 419 | EXPORT_SYMBOL(kfifo_to_user); |
377 | 420 | ||
diff --git a/kernel/smp.c b/kernel/smp.c index de735a6637d0..f10408422444 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
@@ -347,7 +347,7 @@ int smp_call_function_any(const struct cpumask *mask, | |||
347 | goto call; | 347 | goto call; |
348 | 348 | ||
349 | /* Try for same node. */ | 349 | /* Try for same node. */ |
350 | nodemask = cpumask_of_node(cpu); | 350 | nodemask = cpumask_of_node(cpu_to_node(cpu)); |
351 | for (cpu = cpumask_first_and(nodemask, mask); cpu < nr_cpu_ids; | 351 | for (cpu = cpumask_first_and(nodemask, mask); cpu < nr_cpu_ids; |
352 | cpu = cpumask_next_and(cpu, nodemask, mask)) { | 352 | cpu = cpumask_next_and(cpu, nodemask, mask)) { |
353 | if (cpu_online(cpu)) | 353 | if (cpu_online(cpu)) |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 7968762c8167..1e6640f80454 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1690,7 +1690,7 @@ ftrace_regex_lseek(struct file *file, loff_t offset, int origin) | |||
1690 | static int ftrace_match(char *str, char *regex, int len, int type) | 1690 | static int ftrace_match(char *str, char *regex, int len, int type) |
1691 | { | 1691 | { |
1692 | int matched = 0; | 1692 | int matched = 0; |
1693 | char *ptr; | 1693 | int slen; |
1694 | 1694 | ||
1695 | switch (type) { | 1695 | switch (type) { |
1696 | case MATCH_FULL: | 1696 | case MATCH_FULL: |
@@ -1706,8 +1706,8 @@ static int ftrace_match(char *str, char *regex, int len, int type) | |||
1706 | matched = 1; | 1706 | matched = 1; |
1707 | break; | 1707 | break; |
1708 | case MATCH_END_ONLY: | 1708 | case MATCH_END_ONLY: |
1709 | ptr = strstr(str, regex); | 1709 | slen = strlen(str); |
1710 | if (ptr && (ptr[len] == 0)) | 1710 | if (slen >= len && memcmp(str + slen - len, regex, len) == 0) |
1711 | matched = 1; | 1711 | matched = 1; |
1712 | break; | 1712 | break; |
1713 | } | 1713 | } |
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 2326b04c95c4..edefe3b2801b 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -2869,7 +2869,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) | |||
2869 | * Splice the empty reader page into the list around the head. | 2869 | * Splice the empty reader page into the list around the head. |
2870 | */ | 2870 | */ |
2871 | reader = rb_set_head_page(cpu_buffer); | 2871 | reader = rb_set_head_page(cpu_buffer); |
2872 | cpu_buffer->reader_page->list.next = reader->list.next; | 2872 | cpu_buffer->reader_page->list.next = rb_list_head(reader->list.next); |
2873 | cpu_buffer->reader_page->list.prev = reader->list.prev; | 2873 | cpu_buffer->reader_page->list.prev = reader->list.prev; |
2874 | 2874 | ||
2875 | /* | 2875 | /* |
@@ -2906,7 +2906,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) | |||
2906 | * | 2906 | * |
2907 | * Now make the new head point back to the reader page. | 2907 | * Now make the new head point back to the reader page. |
2908 | */ | 2908 | */ |
2909 | reader->list.next->prev = &cpu_buffer->reader_page->list; | 2909 | rb_list_head(reader->list.next)->prev = &cpu_buffer->reader_page->list; |
2910 | rb_inc_page(cpu_buffer, &cpu_buffer->head_page); | 2910 | rb_inc_page(cpu_buffer, &cpu_buffer->head_page); |
2911 | 2911 | ||
2912 | /* Finally update the reader page to the new head */ | 2912 | /* Finally update the reader page to the new head */ |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 50504cb228de..e42af9aad69f 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -211,8 +211,9 @@ static int filter_pred_pchar(struct filter_pred *pred, void *event, | |||
211 | { | 211 | { |
212 | char **addr = (char **)(event + pred->offset); | 212 | char **addr = (char **)(event + pred->offset); |
213 | int cmp, match; | 213 | int cmp, match; |
214 | int len = strlen(*addr) + 1; /* including tailing '\0' */ | ||
214 | 215 | ||
215 | cmp = pred->regex.match(*addr, &pred->regex, pred->regex.field_len); | 216 | cmp = pred->regex.match(*addr, &pred->regex, len); |
216 | 217 | ||
217 | match = cmp ^ pred->not; | 218 | match = cmp ^ pred->not; |
218 | 219 | ||
@@ -251,7 +252,18 @@ static int filter_pred_none(struct filter_pred *pred, void *event, | |||
251 | return 0; | 252 | return 0; |
252 | } | 253 | } |
253 | 254 | ||
254 | /* Basic regex callbacks */ | 255 | /* |
256 | * regex_match_foo - Basic regex callbacks | ||
257 | * | ||
258 | * @str: the string to be searched | ||
259 | * @r: the regex structure containing the pattern string | ||
260 | * @len: the length of the string to be searched (including '\0') | ||
261 | * | ||
262 | * Note: | ||
263 | * - @str might not be NULL-terminated if it's of type DYN_STRING | ||
264 | * or STATIC_STRING | ||
265 | */ | ||
266 | |||
255 | static int regex_match_full(char *str, struct regex *r, int len) | 267 | static int regex_match_full(char *str, struct regex *r, int len) |
256 | { | 268 | { |
257 | if (strncmp(str, r->pattern, len) == 0) | 269 | if (strncmp(str, r->pattern, len) == 0) |
@@ -261,23 +273,24 @@ static int regex_match_full(char *str, struct regex *r, int len) | |||
261 | 273 | ||
262 | static int regex_match_front(char *str, struct regex *r, int len) | 274 | static int regex_match_front(char *str, struct regex *r, int len) |
263 | { | 275 | { |
264 | if (strncmp(str, r->pattern, len) == 0) | 276 | if (strncmp(str, r->pattern, r->len) == 0) |
265 | return 1; | 277 | return 1; |
266 | return 0; | 278 | return 0; |
267 | } | 279 | } |
268 | 280 | ||
269 | static int regex_match_middle(char *str, struct regex *r, int len) | 281 | static int regex_match_middle(char *str, struct regex *r, int len) |
270 | { | 282 | { |
271 | if (strstr(str, r->pattern)) | 283 | if (strnstr(str, r->pattern, len)) |
272 | return 1; | 284 | return 1; |
273 | return 0; | 285 | return 0; |
274 | } | 286 | } |
275 | 287 | ||
276 | static int regex_match_end(char *str, struct regex *r, int len) | 288 | static int regex_match_end(char *str, struct regex *r, int len) |
277 | { | 289 | { |
278 | char *ptr = strstr(str, r->pattern); | 290 | int strlen = len - 1; |
279 | 291 | ||
280 | if (ptr && (ptr[r->len] == 0)) | 292 | if (strlen >= r->len && |
293 | memcmp(str + strlen - r->len, r->pattern, r->len) == 0) | ||
281 | return 1; | 294 | return 1; |
282 | return 0; | 295 | return 0; |
283 | } | 296 | } |
@@ -781,10 +794,8 @@ static int filter_add_pred(struct filter_parse_state *ps, | |||
781 | pred->regex.field_len = field->size; | 794 | pred->regex.field_len = field->size; |
782 | } else if (field->filter_type == FILTER_DYN_STRING) | 795 | } else if (field->filter_type == FILTER_DYN_STRING) |
783 | fn = filter_pred_strloc; | 796 | fn = filter_pred_strloc; |
784 | else { | 797 | else |
785 | fn = filter_pred_pchar; | 798 | fn = filter_pred_pchar; |
786 | pred->regex.field_len = strlen(pred->regex.pattern); | ||
787 | } | ||
788 | } else { | 799 | } else { |
789 | if (field->is_signed) | 800 | if (field->is_signed) |
790 | ret = strict_strtoll(pred->regex.pattern, 0, &val); | 801 | ret = strict_strtoll(pred->regex.pattern, 0, &val); |
diff --git a/lib/string.c b/lib/string.c index 9f75b4ec50b8..a1cdcfcc42d0 100644 --- a/lib/string.c +++ b/lib/string.c | |||
@@ -667,7 +667,7 @@ EXPORT_SYMBOL(memscan); | |||
667 | */ | 667 | */ |
668 | char *strstr(const char *s1, const char *s2) | 668 | char *strstr(const char *s1, const char *s2) |
669 | { | 669 | { |
670 | int l1, l2; | 670 | size_t l1, l2; |
671 | 671 | ||
672 | l2 = strlen(s2); | 672 | l2 = strlen(s2); |
673 | if (!l2) | 673 | if (!l2) |
@@ -684,6 +684,31 @@ char *strstr(const char *s1, const char *s2) | |||
684 | EXPORT_SYMBOL(strstr); | 684 | EXPORT_SYMBOL(strstr); |
685 | #endif | 685 | #endif |
686 | 686 | ||
687 | #ifndef __HAVE_ARCH_STRNSTR | ||
688 | /** | ||
689 | * strnstr - Find the first substring in a length-limited string | ||
690 | * @s1: The string to be searched | ||
691 | * @s2: The string to search for | ||
692 | * @len: the maximum number of characters to search | ||
693 | */ | ||
694 | char *strnstr(const char *s1, const char *s2, size_t len) | ||
695 | { | ||
696 | size_t l1 = len, l2; | ||
697 | |||
698 | l2 = strlen(s2); | ||
699 | if (!l2) | ||
700 | return (char *)s1; | ||
701 | while (l1 >= l2) { | ||
702 | l1--; | ||
703 | if (!memcmp(s1, s2, l2)) | ||
704 | return (char *)s1; | ||
705 | s1++; | ||
706 | } | ||
707 | return NULL; | ||
708 | } | ||
709 | EXPORT_SYMBOL(strnstr); | ||
710 | #endif | ||
711 | |||
687 | #ifndef __HAVE_ARCH_MEMCHR | 712 | #ifndef __HAVE_ARCH_MEMCHR |
688 | /** | 713 | /** |
689 | * memchr - Find a character in an area of memory. | 714 | * memchr - Find a character in an area of memory. |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 488b644e0e8e..954032b80bed 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -2586,7 +2586,7 @@ static int mem_cgroup_force_empty(struct mem_cgroup *mem, bool free_all) | |||
2586 | if (free_all) | 2586 | if (free_all) |
2587 | goto try_to_free; | 2587 | goto try_to_free; |
2588 | move_account: | 2588 | move_account: |
2589 | while (mem->res.usage > 0) { | 2589 | do { |
2590 | ret = -EBUSY; | 2590 | ret = -EBUSY; |
2591 | if (cgroup_task_count(cgrp) || !list_empty(&cgrp->children)) | 2591 | if (cgroup_task_count(cgrp) || !list_empty(&cgrp->children)) |
2592 | goto out; | 2592 | goto out; |
@@ -2614,8 +2614,8 @@ move_account: | |||
2614 | if (ret == -ENOMEM) | 2614 | if (ret == -ENOMEM) |
2615 | goto try_to_free; | 2615 | goto try_to_free; |
2616 | cond_resched(); | 2616 | cond_resched(); |
2617 | } | 2617 | /* "ret" should also be checked to ensure all lists are empty. */ |
2618 | ret = 0; | 2618 | } while (mem->res.usage > 0 || ret); |
2619 | out: | 2619 | out: |
2620 | css_put(&mem->css); | 2620 | css_put(&mem->css); |
2621 | return ret; | 2621 | return ret; |
@@ -2648,10 +2648,7 @@ try_to_free: | |||
2648 | } | 2648 | } |
2649 | lru_add_drain(); | 2649 | lru_add_drain(); |
2650 | /* try move_account...there may be some *locked* pages. */ | 2650 | /* try move_account...there may be some *locked* pages. */ |
2651 | if (mem->res.usage) | 2651 | goto move_account; |
2652 | goto move_account; | ||
2653 | ret = 0; | ||
2654 | goto out; | ||
2655 | } | 2652 | } |
2656 | 2653 | ||
2657 | int mem_cgroup_force_empty_write(struct cgroup *cont, unsigned int event) | 2654 | int mem_cgroup_force_empty_write(struct cgroup *cont, unsigned int event) |
diff --git a/mm/nommu.c b/mm/nommu.c index 17773862619b..48a2ecfaf059 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -552,11 +552,11 @@ static void free_page_series(unsigned long from, unsigned long to) | |||
552 | static void __put_nommu_region(struct vm_region *region) | 552 | static void __put_nommu_region(struct vm_region *region) |
553 | __releases(nommu_region_sem) | 553 | __releases(nommu_region_sem) |
554 | { | 554 | { |
555 | kenter("%p{%d}", region, atomic_read(®ion->vm_usage)); | 555 | kenter("%p{%d}", region, region->vm_usage); |
556 | 556 | ||
557 | BUG_ON(!nommu_region_tree.rb_node); | 557 | BUG_ON(!nommu_region_tree.rb_node); |
558 | 558 | ||
559 | if (atomic_dec_and_test(®ion->vm_usage)) { | 559 | if (--region->vm_usage == 0) { |
560 | if (region->vm_top > region->vm_start) | 560 | if (region->vm_top > region->vm_start) |
561 | delete_nommu_region(region); | 561 | delete_nommu_region(region); |
562 | up_write(&nommu_region_sem); | 562 | up_write(&nommu_region_sem); |
@@ -1205,7 +1205,7 @@ unsigned long do_mmap_pgoff(struct file *file, | |||
1205 | if (!vma) | 1205 | if (!vma) |
1206 | goto error_getting_vma; | 1206 | goto error_getting_vma; |
1207 | 1207 | ||
1208 | atomic_set(®ion->vm_usage, 1); | 1208 | region->vm_usage = 1; |
1209 | region->vm_flags = vm_flags; | 1209 | region->vm_flags = vm_flags; |
1210 | region->vm_pgoff = pgoff; | 1210 | region->vm_pgoff = pgoff; |
1211 | 1211 | ||
@@ -1272,7 +1272,7 @@ unsigned long do_mmap_pgoff(struct file *file, | |||
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | /* we've found a region we can share */ | 1274 | /* we've found a region we can share */ |
1275 | atomic_inc(&pregion->vm_usage); | 1275 | pregion->vm_usage++; |
1276 | vma->vm_region = pregion; | 1276 | vma->vm_region = pregion; |
1277 | start = pregion->vm_start; | 1277 | start = pregion->vm_start; |
1278 | start += (pgoff - pregion->vm_pgoff) << PAGE_SHIFT; | 1278 | start += (pgoff - pregion->vm_pgoff) << PAGE_SHIFT; |
@@ -1289,7 +1289,7 @@ unsigned long do_mmap_pgoff(struct file *file, | |||
1289 | vma->vm_region = NULL; | 1289 | vma->vm_region = NULL; |
1290 | vma->vm_start = 0; | 1290 | vma->vm_start = 0; |
1291 | vma->vm_end = 0; | 1291 | vma->vm_end = 0; |
1292 | atomic_dec(&pregion->vm_usage); | 1292 | pregion->vm_usage--; |
1293 | pregion = NULL; | 1293 | pregion = NULL; |
1294 | goto error_just_free; | 1294 | goto error_just_free; |
1295 | } | 1295 | } |
@@ -1441,10 +1441,9 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1441 | 1441 | ||
1442 | kenter(""); | 1442 | kenter(""); |
1443 | 1443 | ||
1444 | /* we're only permitted to split anonymous regions that have a single | 1444 | /* we're only permitted to split anonymous regions (these should have |
1445 | * owner */ | 1445 | * only a single usage on the region) */ |
1446 | if (vma->vm_file || | 1446 | if (vma->vm_file) |
1447 | atomic_read(&vma->vm_region->vm_usage) != 1) | ||
1448 | return -ENOMEM; | 1447 | return -ENOMEM; |
1449 | 1448 | ||
1450 | if (mm->map_count >= sysctl_max_map_count) | 1449 | if (mm->map_count >= sysctl_max_map_count) |
@@ -1518,7 +1517,7 @@ static int shrink_vma(struct mm_struct *mm, | |||
1518 | 1517 | ||
1519 | /* cut the backing region down to size */ | 1518 | /* cut the backing region down to size */ |
1520 | region = vma->vm_region; | 1519 | region = vma->vm_region; |
1521 | BUG_ON(atomic_read(®ion->vm_usage) != 1); | 1520 | BUG_ON(region->vm_usage != 1); |
1522 | 1521 | ||
1523 | down_write(&nommu_region_sem); | 1522 | down_write(&nommu_region_sem); |
1524 | delete_nommu_region(region); | 1523 | delete_nommu_region(region); |
@@ -1762,27 +1761,6 @@ void unmap_mapping_range(struct address_space *mapping, | |||
1762 | EXPORT_SYMBOL(unmap_mapping_range); | 1761 | EXPORT_SYMBOL(unmap_mapping_range); |
1763 | 1762 | ||
1764 | /* | 1763 | /* |
1765 | * ask for an unmapped area at which to create a mapping on a file | ||
1766 | */ | ||
1767 | unsigned long get_unmapped_area(struct file *file, unsigned long addr, | ||
1768 | unsigned long len, unsigned long pgoff, | ||
1769 | unsigned long flags) | ||
1770 | { | ||
1771 | unsigned long (*get_area)(struct file *, unsigned long, unsigned long, | ||
1772 | unsigned long, unsigned long); | ||
1773 | |||
1774 | get_area = current->mm->get_unmapped_area; | ||
1775 | if (file && file->f_op && file->f_op->get_unmapped_area) | ||
1776 | get_area = file->f_op->get_unmapped_area; | ||
1777 | |||
1778 | if (!get_area) | ||
1779 | return -ENOSYS; | ||
1780 | |||
1781 | return get_area(file, addr, len, pgoff, flags); | ||
1782 | } | ||
1783 | EXPORT_SYMBOL(get_unmapped_area); | ||
1784 | |||
1785 | /* | ||
1786 | * Check that a process has enough memory to allocate a new virtual | 1764 | * Check that a process has enough memory to allocate a new virtual |
1787 | * mapping. 0 means there is enough memory for the allocation to | 1765 | * mapping. 0 means there is enough memory for the allocation to |
1788 | * succeed and -ENOMEM implies there is not. | 1766 | * succeed and -ENOMEM implies there is not. |
@@ -1936,3 +1914,65 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in | |||
1936 | mmput(mm); | 1914 | mmput(mm); |
1937 | return len; | 1915 | return len; |
1938 | } | 1916 | } |
1917 | |||
1918 | /** | ||
1919 | * nommu_shrink_inode_mappings - Shrink the shared mappings on an inode | ||
1920 | * @inode: The inode to check | ||
1921 | * @size: The current filesize of the inode | ||
1922 | * @newsize: The proposed filesize of the inode | ||
1923 | * | ||
1924 | * Check the shared mappings on an inode on behalf of a shrinking truncate to | ||
1925 | * make sure that that any outstanding VMAs aren't broken and then shrink the | ||
1926 | * vm_regions that extend that beyond so that do_mmap_pgoff() doesn't | ||
1927 | * automatically grant mappings that are too large. | ||
1928 | */ | ||
1929 | int nommu_shrink_inode_mappings(struct inode *inode, size_t size, | ||
1930 | size_t newsize) | ||
1931 | { | ||
1932 | struct vm_area_struct *vma; | ||
1933 | struct prio_tree_iter iter; | ||
1934 | struct vm_region *region; | ||
1935 | pgoff_t low, high; | ||
1936 | size_t r_size, r_top; | ||
1937 | |||
1938 | low = newsize >> PAGE_SHIFT; | ||
1939 | high = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
1940 | |||
1941 | down_write(&nommu_region_sem); | ||
1942 | |||
1943 | /* search for VMAs that fall within the dead zone */ | ||
1944 | vma_prio_tree_foreach(vma, &iter, &inode->i_mapping->i_mmap, | ||
1945 | low, high) { | ||
1946 | /* found one - only interested if it's shared out of the page | ||
1947 | * cache */ | ||
1948 | if (vma->vm_flags & VM_SHARED) { | ||
1949 | up_write(&nommu_region_sem); | ||
1950 | return -ETXTBSY; /* not quite true, but near enough */ | ||
1951 | } | ||
1952 | } | ||
1953 | |||
1954 | /* reduce any regions that overlap the dead zone - if in existence, | ||
1955 | * these will be pointed to by VMAs that don't overlap the dead zone | ||
1956 | * | ||
1957 | * we don't check for any regions that start beyond the EOF as there | ||
1958 | * shouldn't be any | ||
1959 | */ | ||
1960 | vma_prio_tree_foreach(vma, &iter, &inode->i_mapping->i_mmap, | ||
1961 | 0, ULONG_MAX) { | ||
1962 | if (!(vma->vm_flags & VM_SHARED)) | ||
1963 | continue; | ||
1964 | |||
1965 | region = vma->vm_region; | ||
1966 | r_size = region->vm_top - region->vm_start; | ||
1967 | r_top = (region->vm_pgoff << PAGE_SHIFT) + r_size; | ||
1968 | |||
1969 | if (r_top > newsize) { | ||
1970 | region->vm_top -= r_top - newsize; | ||
1971 | if (region->vm_end > region->vm_top) | ||
1972 | region->vm_end = region->vm_top; | ||
1973 | } | ||
1974 | } | ||
1975 | |||
1976 | up_write(&nommu_region_sem); | ||
1977 | return 0; | ||
1978 | } | ||
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4e9f5cc5fb59..d2a8889b4c58 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1222,10 +1222,10 @@ again: | |||
1222 | } | 1222 | } |
1223 | spin_lock_irqsave(&zone->lock, flags); | 1223 | spin_lock_irqsave(&zone->lock, flags); |
1224 | page = __rmqueue(zone, order, migratetype); | 1224 | page = __rmqueue(zone, order, migratetype); |
1225 | __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order)); | ||
1226 | spin_unlock(&zone->lock); | 1225 | spin_unlock(&zone->lock); |
1227 | if (!page) | 1226 | if (!page) |
1228 | goto failed; | 1227 | goto failed; |
1228 | __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order)); | ||
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | __count_zone_vm_events(PGALLOC, zone, 1 << order); | 1231 | __count_zone_vm_events(PGALLOC, zone, 1 << order); |
@@ -3998,7 +3998,7 @@ void __init add_active_range(unsigned int nid, unsigned long start_pfn, | |||
3998 | } | 3998 | } |
3999 | 3999 | ||
4000 | /* Merge backward if suitable */ | 4000 | /* Merge backward if suitable */ |
4001 | if (start_pfn < early_node_map[i].end_pfn && | 4001 | if (start_pfn < early_node_map[i].start_pfn && |
4002 | end_pfn >= early_node_map[i].start_pfn) { | 4002 | end_pfn >= early_node_map[i].start_pfn) { |
4003 | early_node_map[i].start_pfn = start_pfn; | 4003 | early_node_map[i].start_pfn = start_pfn; |
4004 | return; | 4004 | return; |
@@ -220,7 +220,7 @@ char *strndup_user(const char __user *s, long n) | |||
220 | } | 220 | } |
221 | EXPORT_SYMBOL(strndup_user); | 221 | EXPORT_SYMBOL(strndup_user); |
222 | 222 | ||
223 | #ifndef HAVE_ARCH_PICK_MMAP_LAYOUT | 223 | #if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT) |
224 | void arch_pick_mmap_layout(struct mm_struct *mm) | 224 | void arch_pick_mmap_layout(struct mm_struct *mm) |
225 | { | 225 | { |
226 | mm->mmap_base = TASK_UNMAPPED_BASE; | 226 | mm->mmap_base = TASK_UNMAPPED_BASE; |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 885207a6b6b7..c26986c85ce0 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1922,6 +1922,9 @@ static int sleeping_prematurely(pg_data_t *pgdat, int order, long remaining) | |||
1922 | if (!populated_zone(zone)) | 1922 | if (!populated_zone(zone)) |
1923 | continue; | 1923 | continue; |
1924 | 1924 | ||
1925 | if (zone_is_all_unreclaimable(zone)) | ||
1926 | continue; | ||
1927 | |||
1925 | if (!zone_watermark_ok(zone, order, high_wmark_pages(zone), | 1928 | if (!zone_watermark_ok(zone, order, high_wmark_pages(zone), |
1926 | 0, 0)) | 1929 | 0, 0)) |
1927 | return 1; | 1930 | return 1; |
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index df159fffe4bc..4bac362b1335 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -559,6 +559,11 @@ static inline struct inet6_dev *ipv6_skb_idev(struct sk_buff *skb) | |||
559 | return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev); | 559 | return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev); |
560 | } | 560 | } |
561 | 561 | ||
562 | static inline struct net *ipv6_skb_net(struct sk_buff *skb) | ||
563 | { | ||
564 | return skb_dst(skb) ? dev_net(skb_dst(skb)->dev) : dev_net(skb->dev); | ||
565 | } | ||
566 | |||
562 | /* Router Alert as of RFC 2711 */ | 567 | /* Router Alert as of RFC 2711 */ |
563 | 568 | ||
564 | static int ipv6_hop_ra(struct sk_buff *skb, int optoff) | 569 | static int ipv6_hop_ra(struct sk_buff *skb, int optoff) |
@@ -580,8 +585,8 @@ static int ipv6_hop_ra(struct sk_buff *skb, int optoff) | |||
580 | static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff) | 585 | static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff) |
581 | { | 586 | { |
582 | const unsigned char *nh = skb_network_header(skb); | 587 | const unsigned char *nh = skb_network_header(skb); |
588 | struct net *net = ipv6_skb_net(skb); | ||
583 | u32 pkt_len; | 589 | u32 pkt_len; |
584 | struct net *net = dev_net(skb_dst(skb)->dev); | ||
585 | 590 | ||
586 | if (nh[optoff + 1] != 4 || (optoff & 3) != 2) { | 591 | if (nh[optoff + 1] != 4 || (optoff & 3) != 2) { |
587 | LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", | 592 | LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 80c16f6e2af6..32abae3ce32a 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -15,12 +15,14 @@ | |||
15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
16 | #include <linux/rtnetlink.h> | 16 | #include <linux/rtnetlink.h> |
17 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
18 | #include <net/ieee80211_radiotap.h> | ||
18 | #include "ieee80211_i.h" | 19 | #include "ieee80211_i.h" |
19 | #include "sta_info.h" | 20 | #include "sta_info.h" |
20 | #include "debugfs_netdev.h" | 21 | #include "debugfs_netdev.h" |
21 | #include "mesh.h" | 22 | #include "mesh.h" |
22 | #include "led.h" | 23 | #include "led.h" |
23 | #include "driver-ops.h" | 24 | #include "driver-ops.h" |
25 | #include "wme.h" | ||
24 | 26 | ||
25 | /** | 27 | /** |
26 | * DOC: Interface list locking | 28 | * DOC: Interface list locking |
@@ -314,7 +316,7 @@ static int ieee80211_open(struct net_device *dev) | |||
314 | if (sdata->vif.type == NL80211_IFTYPE_STATION) | 316 | if (sdata->vif.type == NL80211_IFTYPE_STATION) |
315 | ieee80211_queue_work(&local->hw, &sdata->u.mgd.work); | 317 | ieee80211_queue_work(&local->hw, &sdata->u.mgd.work); |
316 | 318 | ||
317 | netif_start_queue(dev); | 319 | netif_tx_start_all_queues(dev); |
318 | 320 | ||
319 | return 0; | 321 | return 0; |
320 | err_del_interface: | 322 | err_del_interface: |
@@ -343,7 +345,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
343 | /* | 345 | /* |
344 | * Stop TX on this interface first. | 346 | * Stop TX on this interface first. |
345 | */ | 347 | */ |
346 | netif_stop_queue(dev); | 348 | netif_tx_stop_all_queues(dev); |
347 | 349 | ||
348 | /* | 350 | /* |
349 | * Now delete all active aggregation sessions. | 351 | * Now delete all active aggregation sessions. |
@@ -644,6 +646,12 @@ static void ieee80211_teardown_sdata(struct net_device *dev) | |||
644 | WARN_ON(flushed); | 646 | WARN_ON(flushed); |
645 | } | 647 | } |
646 | 648 | ||
649 | static u16 ieee80211_netdev_select_queue(struct net_device *dev, | ||
650 | struct sk_buff *skb) | ||
651 | { | ||
652 | return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); | ||
653 | } | ||
654 | |||
647 | static const struct net_device_ops ieee80211_dataif_ops = { | 655 | static const struct net_device_ops ieee80211_dataif_ops = { |
648 | .ndo_open = ieee80211_open, | 656 | .ndo_open = ieee80211_open, |
649 | .ndo_stop = ieee80211_stop, | 657 | .ndo_stop = ieee80211_stop, |
@@ -652,8 +660,38 @@ static const struct net_device_ops ieee80211_dataif_ops = { | |||
652 | .ndo_set_multicast_list = ieee80211_set_multicast_list, | 660 | .ndo_set_multicast_list = ieee80211_set_multicast_list, |
653 | .ndo_change_mtu = ieee80211_change_mtu, | 661 | .ndo_change_mtu = ieee80211_change_mtu, |
654 | .ndo_set_mac_address = eth_mac_addr, | 662 | .ndo_set_mac_address = eth_mac_addr, |
663 | .ndo_select_queue = ieee80211_netdev_select_queue, | ||
655 | }; | 664 | }; |
656 | 665 | ||
666 | static u16 ieee80211_monitor_select_queue(struct net_device *dev, | ||
667 | struct sk_buff *skb) | ||
668 | { | ||
669 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
670 | struct ieee80211_local *local = sdata->local; | ||
671 | struct ieee80211_hdr *hdr; | ||
672 | struct ieee80211_radiotap_header *rtap = (void *)skb->data; | ||
673 | u8 *p; | ||
674 | |||
675 | if (local->hw.queues < 4) | ||
676 | return 0; | ||
677 | |||
678 | if (skb->len < 4 || | ||
679 | skb->len < le16_to_cpu(rtap->it_len) + 2 /* frame control */) | ||
680 | return 0; /* doesn't matter, frame will be dropped */ | ||
681 | |||
682 | hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len)); | ||
683 | |||
684 | if (!ieee80211_is_data_qos(hdr->frame_control)) { | ||
685 | skb->priority = 7; | ||
686 | return ieee802_1d_to_ac[skb->priority]; | ||
687 | } | ||
688 | |||
689 | p = ieee80211_get_qos_ctl(hdr); | ||
690 | skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; | ||
691 | |||
692 | return ieee80211_downgrade_queue(local, skb); | ||
693 | } | ||
694 | |||
657 | static const struct net_device_ops ieee80211_monitorif_ops = { | 695 | static const struct net_device_ops ieee80211_monitorif_ops = { |
658 | .ndo_open = ieee80211_open, | 696 | .ndo_open = ieee80211_open, |
659 | .ndo_stop = ieee80211_stop, | 697 | .ndo_stop = ieee80211_stop, |
@@ -662,6 +700,7 @@ static const struct net_device_ops ieee80211_monitorif_ops = { | |||
662 | .ndo_set_multicast_list = ieee80211_set_multicast_list, | 700 | .ndo_set_multicast_list = ieee80211_set_multicast_list, |
663 | .ndo_change_mtu = ieee80211_change_mtu, | 701 | .ndo_change_mtu = ieee80211_change_mtu, |
664 | .ndo_set_mac_address = eth_mac_addr, | 702 | .ndo_set_mac_address = eth_mac_addr, |
703 | .ndo_select_queue = ieee80211_monitor_select_queue, | ||
665 | }; | 704 | }; |
666 | 705 | ||
667 | static void ieee80211_if_setup(struct net_device *dev) | 706 | static void ieee80211_if_setup(struct net_device *dev) |
@@ -768,8 +807,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
768 | 807 | ||
769 | ASSERT_RTNL(); | 808 | ASSERT_RTNL(); |
770 | 809 | ||
771 | ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, | 810 | ndev = alloc_netdev_mq(sizeof(*sdata) + local->hw.vif_data_size, |
772 | name, ieee80211_if_setup); | 811 | name, ieee80211_if_setup, local->hw.queues); |
773 | if (!ndev) | 812 | if (!ndev) |
774 | return -ENOMEM; | 813 | return -ENOMEM; |
775 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); | 814 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index c79e59f82fd9..05a18f43e1bf 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -942,7 +942,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, | |||
942 | ieee80211_recalc_ps(local, -1); | 942 | ieee80211_recalc_ps(local, -1); |
943 | mutex_unlock(&local->iflist_mtx); | 943 | mutex_unlock(&local->iflist_mtx); |
944 | 944 | ||
945 | netif_start_queue(sdata->dev); | 945 | netif_tx_start_all_queues(sdata->dev); |
946 | netif_carrier_on(sdata->dev); | 946 | netif_carrier_on(sdata->dev); |
947 | } | 947 | } |
948 | 948 | ||
@@ -1074,7 +1074,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1074 | * time -- we don't want the scan code to enable queues. | 1074 | * time -- we don't want the scan code to enable queues. |
1075 | */ | 1075 | */ |
1076 | 1076 | ||
1077 | netif_stop_queue(sdata->dev); | 1077 | netif_tx_stop_all_queues(sdata->dev); |
1078 | netif_carrier_off(sdata->dev); | 1078 | netif_carrier_off(sdata->dev); |
1079 | 1079 | ||
1080 | rcu_read_lock(); | 1080 | rcu_read_lock(); |
@@ -1963,7 +1963,9 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
1963 | rma = ieee80211_rx_mgmt_disassoc(sdata, mgmt, skb->len); | 1963 | rma = ieee80211_rx_mgmt_disassoc(sdata, mgmt, skb->len); |
1964 | break; | 1964 | break; |
1965 | case IEEE80211_STYPE_ACTION: | 1965 | case IEEE80211_STYPE_ACTION: |
1966 | /* XXX: differentiate, can only happen for CSA now! */ | 1966 | if (mgmt->u.action.category != WLAN_CATEGORY_SPECTRUM_MGMT) |
1967 | break; | ||
1968 | |||
1967 | ieee80211_sta_process_chanswitch(sdata, | 1969 | ieee80211_sta_process_chanswitch(sdata, |
1968 | &mgmt->u.action.u.chan_switch.sw_elem, | 1970 | &mgmt->u.action.u.chan_switch.sw_elem, |
1969 | ifmgd->associated); | 1971 | ifmgd->associated); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 9f2807aeaf52..82a30c1bf3ab 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1746,7 +1746,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1746 | memset(info, 0, sizeof(*info)); | 1746 | memset(info, 0, sizeof(*info)); |
1747 | info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; | 1747 | info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; |
1748 | info->control.vif = &rx->sdata->vif; | 1748 | info->control.vif = &rx->sdata->vif; |
1749 | ieee80211_select_queue(local, fwd_skb); | 1749 | skb_set_queue_mapping(skb, |
1750 | ieee80211_select_queue(rx->sdata, fwd_skb)); | ||
1751 | ieee80211_set_qos_hdr(local, skb); | ||
1750 | if (is_multicast_ether_addr(fwd_hdr->addr1)) | 1752 | if (is_multicast_ether_addr(fwd_hdr->addr1)) |
1751 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, | 1753 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, |
1752 | fwded_mcast); | 1754 | fwded_mcast); |
@@ -2013,6 +2015,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
2013 | } | 2015 | } |
2014 | break; | 2016 | break; |
2015 | default: | 2017 | default: |
2018 | /* do not process rejected action frames */ | ||
2019 | if (mgmt->u.action.category & 0x80) | ||
2020 | return RX_DROP_MONITOR; | ||
2021 | |||
2016 | return RX_CONTINUE; | 2022 | return RX_CONTINUE; |
2017 | } | 2023 | } |
2018 | 2024 | ||
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index f1a4c7160300..f934c9620b73 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -353,10 +353,10 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) | |||
353 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | 353 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
354 | if (sdata->u.mgd.associated) { | 354 | if (sdata->u.mgd.associated) { |
355 | ieee80211_scan_ps_disable(sdata); | 355 | ieee80211_scan_ps_disable(sdata); |
356 | netif_wake_queue(sdata->dev); | 356 | netif_tx_wake_all_queues(sdata->dev); |
357 | } | 357 | } |
358 | } else | 358 | } else |
359 | netif_wake_queue(sdata->dev); | 359 | netif_tx_wake_all_queues(sdata->dev); |
360 | 360 | ||
361 | /* re-enable beaconing */ | 361 | /* re-enable beaconing */ |
362 | if (sdata->vif.type == NL80211_IFTYPE_AP || | 362 | if (sdata->vif.type == NL80211_IFTYPE_AP || |
@@ -411,7 +411,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local) | |||
411 | * are handled in the scan state machine | 411 | * are handled in the scan state machine |
412 | */ | 412 | */ |
413 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 413 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
414 | netif_stop_queue(sdata->dev); | 414 | netif_tx_stop_all_queues(sdata->dev); |
415 | } | 415 | } |
416 | mutex_unlock(&local->iflist_mtx); | 416 | mutex_unlock(&local->iflist_mtx); |
417 | 417 | ||
@@ -575,7 +575,7 @@ static void ieee80211_scan_state_leave_oper_channel(struct ieee80211_local *loca | |||
575 | continue; | 575 | continue; |
576 | 576 | ||
577 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | 577 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
578 | netif_stop_queue(sdata->dev); | 578 | netif_tx_stop_all_queues(sdata->dev); |
579 | if (sdata->u.mgd.associated) | 579 | if (sdata->u.mgd.associated) |
580 | ieee80211_scan_ps_enable(sdata); | 580 | ieee80211_scan_ps_enable(sdata); |
581 | } | 581 | } |
@@ -610,7 +610,7 @@ static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *loca | |||
610 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | 610 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
611 | if (sdata->u.mgd.associated) | 611 | if (sdata->u.mgd.associated) |
612 | ieee80211_scan_ps_disable(sdata); | 612 | ieee80211_scan_ps_disable(sdata); |
613 | netif_wake_queue(sdata->dev); | 613 | netif_tx_wake_all_queues(sdata->dev); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | mutex_unlock(&local->iflist_mtx); | 616 | mutex_unlock(&local->iflist_mtx); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 27ceaefd7bc8..ac210b586702 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1512,7 +1512,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, | |||
1512 | return; | 1512 | return; |
1513 | } | 1513 | } |
1514 | 1514 | ||
1515 | ieee80211_select_queue(local, skb); | 1515 | ieee80211_set_qos_hdr(local, skb); |
1516 | ieee80211_tx(sdata, skb, false); | 1516 | ieee80211_tx(sdata, skb, false); |
1517 | rcu_read_unlock(); | 1517 | rcu_read_unlock(); |
1518 | } | 1518 | } |
@@ -2291,6 +2291,9 @@ void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) | |||
2291 | skb_set_network_header(skb, 0); | 2291 | skb_set_network_header(skb, 0); |
2292 | skb_set_transport_header(skb, 0); | 2292 | skb_set_transport_header(skb, 0); |
2293 | 2293 | ||
2294 | /* send all internal mgmt frames on VO */ | ||
2295 | skb_set_queue_mapping(skb, 0); | ||
2296 | |||
2294 | /* | 2297 | /* |
2295 | * The other path calling ieee80211_xmit is from the tasklet, | 2298 | * The other path calling ieee80211_xmit is from the tasklet, |
2296 | * and while we can handle concurrent transmissions locking | 2299 | * and while we can handle concurrent transmissions locking |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index dc76267e436e..3848140313f5 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -269,6 +269,7 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, | |||
269 | enum queue_stop_reason reason) | 269 | enum queue_stop_reason reason) |
270 | { | 270 | { |
271 | struct ieee80211_local *local = hw_to_local(hw); | 271 | struct ieee80211_local *local = hw_to_local(hw); |
272 | struct ieee80211_sub_if_data *sdata; | ||
272 | 273 | ||
273 | if (WARN_ON(queue >= hw->queues)) | 274 | if (WARN_ON(queue >= hw->queues)) |
274 | return; | 275 | return; |
@@ -281,6 +282,11 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, | |||
281 | 282 | ||
282 | if (!skb_queue_empty(&local->pending[queue])) | 283 | if (!skb_queue_empty(&local->pending[queue])) |
283 | tasklet_schedule(&local->tx_pending_tasklet); | 284 | tasklet_schedule(&local->tx_pending_tasklet); |
285 | |||
286 | rcu_read_lock(); | ||
287 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | ||
288 | netif_tx_wake_queue(netdev_get_tx_queue(sdata->dev, queue)); | ||
289 | rcu_read_unlock(); | ||
284 | } | 290 | } |
285 | 291 | ||
286 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, | 292 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, |
@@ -305,11 +311,17 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue, | |||
305 | enum queue_stop_reason reason) | 311 | enum queue_stop_reason reason) |
306 | { | 312 | { |
307 | struct ieee80211_local *local = hw_to_local(hw); | 313 | struct ieee80211_local *local = hw_to_local(hw); |
314 | struct ieee80211_sub_if_data *sdata; | ||
308 | 315 | ||
309 | if (WARN_ON(queue >= hw->queues)) | 316 | if (WARN_ON(queue >= hw->queues)) |
310 | return; | 317 | return; |
311 | 318 | ||
312 | __set_bit(reason, &local->queue_stop_reasons[queue]); | 319 | __set_bit(reason, &local->queue_stop_reasons[queue]); |
320 | |||
321 | rcu_read_lock(); | ||
322 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | ||
323 | netif_tx_stop_queue(netdev_get_tx_queue(sdata->dev, queue)); | ||
324 | rcu_read_unlock(); | ||
313 | } | 325 | } |
314 | 326 | ||
315 | void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, | 327 | void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, |
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index b19b7696f3a2..79d887dae738 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -44,22 +44,69 @@ static int wme_downgrade_ac(struct sk_buff *skb) | |||
44 | } | 44 | } |
45 | 45 | ||
46 | 46 | ||
47 | /* Indicate which queue to use. */ | 47 | /* Indicate which queue to use. */ |
48 | static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb) | 48 | u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, |
49 | struct sk_buff *skb) | ||
49 | { | 50 | { |
50 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 51 | struct ieee80211_local *local = sdata->local; |
52 | struct sta_info *sta = NULL; | ||
53 | u32 sta_flags = 0; | ||
54 | const u8 *ra = NULL; | ||
55 | bool qos = false; | ||
51 | 56 | ||
52 | if (!ieee80211_is_data(hdr->frame_control)) { | 57 | if (local->hw.queues < 4 || skb->len < 6) { |
53 | /* management frames go on AC_VO queue, but are sent | 58 | skb->priority = 0; /* required for correct WPA/11i MIC */ |
54 | * without QoS control fields */ | 59 | return min_t(u16, local->hw.queues - 1, |
55 | return 0; | 60 | ieee802_1d_to_ac[skb->priority]); |
61 | } | ||
62 | |||
63 | rcu_read_lock(); | ||
64 | switch (sdata->vif.type) { | ||
65 | case NL80211_IFTYPE_AP_VLAN: | ||
66 | rcu_read_lock(); | ||
67 | sta = rcu_dereference(sdata->u.vlan.sta); | ||
68 | if (sta) | ||
69 | sta_flags = get_sta_flags(sta); | ||
70 | rcu_read_unlock(); | ||
71 | if (sta) | ||
72 | break; | ||
73 | case NL80211_IFTYPE_AP: | ||
74 | ra = skb->data; | ||
75 | break; | ||
76 | case NL80211_IFTYPE_WDS: | ||
77 | ra = sdata->u.wds.remote_addr; | ||
78 | break; | ||
79 | #ifdef CONFIG_MAC80211_MESH | ||
80 | case NL80211_IFTYPE_MESH_POINT: | ||
81 | /* | ||
82 | * XXX: This is clearly broken ... but already was before, | ||
83 | * because ieee80211_fill_mesh_addresses() would clear A1 | ||
84 | * except for multicast addresses. | ||
85 | */ | ||
86 | break; | ||
87 | #endif | ||
88 | case NL80211_IFTYPE_STATION: | ||
89 | ra = sdata->u.mgd.bssid; | ||
90 | break; | ||
91 | case NL80211_IFTYPE_ADHOC: | ||
92 | ra = skb->data; | ||
93 | break; | ||
94 | default: | ||
95 | break; | ||
56 | } | 96 | } |
57 | 97 | ||
58 | if (0 /* injected */) { | 98 | if (!sta && ra && !is_multicast_ether_addr(ra)) { |
59 | /* use AC from radiotap */ | 99 | sta = sta_info_get(local, ra); |
100 | if (sta) | ||
101 | sta_flags = get_sta_flags(sta); | ||
60 | } | 102 | } |
61 | 103 | ||
62 | if (!ieee80211_is_data_qos(hdr->frame_control)) { | 104 | if (sta_flags & WLAN_STA_WME) |
105 | qos = true; | ||
106 | |||
107 | rcu_read_unlock(); | ||
108 | |||
109 | if (!qos) { | ||
63 | skb->priority = 0; /* required for correct WPA/11i MIC */ | 110 | skb->priority = 0; /* required for correct WPA/11i MIC */ |
64 | return ieee802_1d_to_ac[skb->priority]; | 111 | return ieee802_1d_to_ac[skb->priority]; |
65 | } | 112 | } |
@@ -68,6 +115,12 @@ static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb) | |||
68 | * data frame has */ | 115 | * data frame has */ |
69 | skb->priority = cfg80211_classify8021d(skb); | 116 | skb->priority = cfg80211_classify8021d(skb); |
70 | 117 | ||
118 | return ieee80211_downgrade_queue(local, skb); | ||
119 | } | ||
120 | |||
121 | u16 ieee80211_downgrade_queue(struct ieee80211_local *local, | ||
122 | struct sk_buff *skb) | ||
123 | { | ||
71 | /* in case we are a client verify acm is not set for this ac */ | 124 | /* in case we are a client verify acm is not set for this ac */ |
72 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { | 125 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { |
73 | if (wme_downgrade_ac(skb)) { | 126 | if (wme_downgrade_ac(skb)) { |
@@ -85,24 +138,17 @@ static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb) | |||
85 | return ieee802_1d_to_ac[skb->priority]; | 138 | return ieee802_1d_to_ac[skb->priority]; |
86 | } | 139 | } |
87 | 140 | ||
88 | void ieee80211_select_queue(struct ieee80211_local *local, struct sk_buff *skb) | 141 | void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb) |
89 | { | 142 | { |
90 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 143 | struct ieee80211_hdr *hdr = (void *)skb->data; |
91 | u16 queue; | 144 | |
92 | u8 tid; | 145 | /* Fill in the QoS header if there is one. */ |
93 | |||
94 | queue = classify80211(local, skb); | ||
95 | if (unlikely(queue >= local->hw.queues)) | ||
96 | queue = local->hw.queues - 1; | ||
97 | |||
98 | /* | ||
99 | * Now we know the 1d priority, fill in the QoS header if | ||
100 | * there is one (and we haven't done this before). | ||
101 | */ | ||
102 | if (ieee80211_is_data_qos(hdr->frame_control)) { | 146 | if (ieee80211_is_data_qos(hdr->frame_control)) { |
103 | u8 *p = ieee80211_get_qos_ctl(hdr); | 147 | u8 *p = ieee80211_get_qos_ctl(hdr); |
104 | u8 ack_policy = 0; | 148 | u8 ack_policy = 0, tid; |
149 | |||
105 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; | 150 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; |
151 | |||
106 | if (unlikely(local->wifi_wme_noack_test)) | 152 | if (unlikely(local->wifi_wme_noack_test)) |
107 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << | 153 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << |
108 | QOS_CONTROL_ACK_POLICY_SHIFT; | 154 | QOS_CONTROL_ACK_POLICY_SHIFT; |
@@ -110,6 +156,4 @@ void ieee80211_select_queue(struct ieee80211_local *local, struct sk_buff *skb) | |||
110 | *p++ = ack_policy | tid; | 156 | *p++ = ack_policy | tid; |
111 | *p = 0; | 157 | *p = 0; |
112 | } | 158 | } |
113 | |||
114 | skb_set_queue_mapping(skb, queue); | ||
115 | } | 159 | } |
diff --git a/net/mac80211/wme.h b/net/mac80211/wme.h index d4fd87ca5118..6053b1c9feee 100644 --- a/net/mac80211/wme.h +++ b/net/mac80211/wme.h | |||
@@ -20,7 +20,11 @@ | |||
20 | 20 | ||
21 | extern const int ieee802_1d_to_ac[8]; | 21 | extern const int ieee802_1d_to_ac[8]; |
22 | 22 | ||
23 | void ieee80211_select_queue(struct ieee80211_local *local, | 23 | u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, |
24 | struct sk_buff *skb); | 24 | struct sk_buff *skb); |
25 | void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb); | ||
26 | u16 ieee80211_downgrade_queue(struct ieee80211_local *local, | ||
27 | struct sk_buff *skb); | ||
28 | |||
25 | 29 | ||
26 | #endif /* _WME_H */ | 30 | #endif /* _WME_H */ |
diff --git a/net/wireless/core.c b/net/wireless/core.c index c2a2c563d21a..92b812442488 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -745,9 +745,9 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
745 | mutex_unlock(&rdev->devlist_mtx); | 745 | mutex_unlock(&rdev->devlist_mtx); |
746 | dev_put(dev); | 746 | dev_put(dev); |
747 | } | 747 | } |
748 | #ifdef CONFIG_CFG80211_WEXT | ||
749 | cfg80211_lock_rdev(rdev); | 748 | cfg80211_lock_rdev(rdev); |
750 | mutex_lock(&rdev->devlist_mtx); | 749 | mutex_lock(&rdev->devlist_mtx); |
750 | #ifdef CONFIG_CFG80211_WEXT | ||
751 | wdev_lock(wdev); | 751 | wdev_lock(wdev); |
752 | switch (wdev->iftype) { | 752 | switch (wdev->iftype) { |
753 | case NL80211_IFTYPE_ADHOC: | 753 | case NL80211_IFTYPE_ADHOC: |
@@ -760,10 +760,10 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
760 | break; | 760 | break; |
761 | } | 761 | } |
762 | wdev_unlock(wdev); | 762 | wdev_unlock(wdev); |
763 | #endif | ||
763 | rdev->opencount++; | 764 | rdev->opencount++; |
764 | mutex_unlock(&rdev->devlist_mtx); | 765 | mutex_unlock(&rdev->devlist_mtx); |
765 | cfg80211_unlock_rdev(rdev); | 766 | cfg80211_unlock_rdev(rdev); |
766 | #endif | ||
767 | break; | 767 | break; |
768 | case NETDEV_UNREGISTER: | 768 | case NETDEV_UNREGISTER: |
769 | /* | 769 | /* |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index baa898add287..7a0754c92df4 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1690,7 +1690,7 @@ int regulatory_hint_user(const char *alpha2) | |||
1690 | request->wiphy_idx = WIPHY_IDX_STALE; | 1690 | request->wiphy_idx = WIPHY_IDX_STALE; |
1691 | request->alpha2[0] = alpha2[0]; | 1691 | request->alpha2[0] = alpha2[0]; |
1692 | request->alpha2[1] = alpha2[1]; | 1692 | request->alpha2[1] = alpha2[1]; |
1693 | request->initiator = NL80211_REGDOM_SET_BY_USER, | 1693 | request->initiator = NL80211_REGDOM_SET_BY_USER; |
1694 | 1694 | ||
1695 | queue_regulatory_request(request); | 1695 | queue_regulatory_request(request); |
1696 | 1696 | ||
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl index 5f0fcb712e29..ce3e40b01e48 100644 --- a/scripts/markup_oops.pl +++ b/scripts/markup_oops.pl | |||
@@ -154,7 +154,7 @@ while (<STDIN>) { | |||
154 | if ($line =~ /RIP: 0010:\[\<([a-z0-9]+)\>\]/) { | 154 | if ($line =~ /RIP: 0010:\[\<([a-z0-9]+)\>\]/) { |
155 | $target = $1; | 155 | $target = $1; |
156 | } | 156 | } |
157 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) { | 157 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+0x([0-9a-f]+)\/0x[a-f0-9]/) { |
158 | $function = $1; | 158 | $function = $1; |
159 | $func_offset = $2; | 159 | $func_offset = $2; |
160 | } | 160 | } |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 6f426afbc522..220213e603db 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -804,7 +804,7 @@ static inline int sym_is(const char *symbol, const char *name) | |||
804 | match = strstr(symbol, name); | 804 | match = strstr(symbol, name); |
805 | if (!match) | 805 | if (!match) |
806 | return 0; | 806 | return 0; |
807 | return match[strlen(symbol)] == '\0'; | 807 | return match[strlen(name)] == '\0'; |
808 | } | 808 | } |
809 | 809 | ||
810 | static void do_table(void *symval, unsigned long size, | 810 | static void do_table(void *symval, unsigned long size, |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 92f09fe9639e..ea6f6e3adaea 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -194,7 +194,7 @@ sub check_objcopy | |||
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||
197 | if ($arch eq "x86") { | 197 | if ($arch =~ /(x86(_64)?)|(i386)/) { |
198 | if ($bits == 64) { | 198 | if ($bits == 64) { |
199 | $arch = "x86_64"; | 199 | $arch = "x86_64"; |
200 | } else { | 200 | } else { |
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 652a470b5f74..2e7fa3a06806 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -250,7 +250,19 @@ PTHREAD_LIBS = -lpthread | |||
250 | # explicitly what architecture to check for. Fix this up for yours.. | 250 | # explicitly what architecture to check for. Fix this up for yours.. |
251 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ | 251 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
252 | 252 | ||
253 | ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y) | 253 | ifeq ($(V), 2) |
254 | QUIET_STDERR = ">/dev/null" | ||
255 | else | ||
256 | QUIET_STDERR = ">/dev/null 2>&1" | ||
257 | endif | ||
258 | |||
259 | BITBUCKET = "/dev/null" | ||
260 | |||
261 | ifneq ($(shell sh -c "(echo '\#include <stdio.h>'; echo 'int main(void) { return puts(\"hi\"); }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) "$(QUIET_STDERR)" && echo y"), y) | ||
262 | BITBUCKET = .perf.dev.null | ||
263 | endif | ||
264 | |||
265 | ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o $(BITBUCKET) "$(QUIET_STDERR)" && echo y"), y) | ||
254 | CFLAGS := $(CFLAGS) -fstack-protector-all | 266 | CFLAGS := $(CFLAGS) -fstack-protector-all |
255 | endif | 267 | endif |
256 | 268 | ||
@@ -451,11 +463,6 @@ BUILTIN_OBJS += builtin-kmem.o | |||
451 | 463 | ||
452 | PERFLIBS = $(LIB_FILE) | 464 | PERFLIBS = $(LIB_FILE) |
453 | 465 | ||
454 | ifeq ($(V), 2) | ||
455 | QUIET_STDERR = ">/dev/null" | ||
456 | else | ||
457 | QUIET_STDERR = ">/dev/null 2>&1" | ||
458 | endif | ||
459 | # | 466 | # |
460 | # Platform specific tweaks | 467 | # Platform specific tweaks |
461 | # | 468 | # |
@@ -483,19 +490,19 @@ ifeq ($(uname_S),Darwin) | |||
483 | PTHREAD_LIBS = | 490 | PTHREAD_LIBS = |
484 | endif | 491 | endif |
485 | 492 | ||
486 | ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) | 493 | ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) |
487 | ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) | 494 | ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) |
488 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); | 495 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); |
489 | endif | 496 | endif |
490 | 497 | ||
491 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) | 498 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) |
492 | BASIC_CFLAGS += -DLIBELF_NO_MMAP | 499 | BASIC_CFLAGS += -DLIBELF_NO_MMAP |
493 | endif | 500 | endif |
494 | else | 501 | else |
495 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); | 502 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); |
496 | endif | 503 | endif |
497 | 504 | ||
498 | ifneq ($(shell sh -c "(echo '\#ifndef _MIPS_SZLONG'; echo '\#define _MIPS_SZLONG 0'; echo '\#endif'; echo '\#include <dwarf.h>'; echo '\#include <libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/libdwarf -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) | 505 | ifneq ($(shell sh -c "(echo '\#ifndef _MIPS_SZLONG'; echo '\#define _MIPS_SZLONG 0'; echo '\#endif'; echo '\#include <dwarf.h>'; echo '\#include <libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/libdwarf -ldwarf -lelf -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y) |
499 | msg := $(warning No libdwarf.h found or old libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel >= 20081231); | 506 | msg := $(warning No libdwarf.h found or old libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel >= 20081231); |
500 | BASIC_CFLAGS += -DNO_LIBDWARF | 507 | BASIC_CFLAGS += -DNO_LIBDWARF |
501 | else | 508 | else |
@@ -509,7 +516,7 @@ PERL_EMBED_LDOPTS = `perl -MExtUtils::Embed -e ldopts 2>/dev/null` | |||
509 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` | 516 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` |
510 | endif | 517 | endif |
511 | 518 | ||
512 | ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; echo 'int main(void) { perl_alloc(); return 0; }') | $(CC) -x c - $(PERL_EMBED_CCOPTS) -o /dev/null $(PERL_EMBED_LDOPTS) > /dev/null 2>&1 && echo y"), y) | 519 | ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; echo 'int main(void) { perl_alloc(); return 0; }') | $(CC) -x c - $(PERL_EMBED_CCOPTS) -o $(BITBUCKET) $(PERL_EMBED_LDOPTS) > /dev/null 2>&1 && echo y"), y) |
513 | BASIC_CFLAGS += -DNO_LIBPERL | 520 | BASIC_CFLAGS += -DNO_LIBPERL |
514 | else | 521 | else |
515 | ALL_LDFLAGS += $(PERL_EMBED_LDOPTS) | 522 | ALL_LDFLAGS += $(PERL_EMBED_LDOPTS) |
@@ -519,20 +526,20 @@ endif | |||
519 | ifdef NO_DEMANGLE | 526 | ifdef NO_DEMANGLE |
520 | BASIC_CFLAGS += -DNO_DEMANGLE | 527 | BASIC_CFLAGS += -DNO_DEMANGLE |
521 | else | 528 | else |
522 | has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y") | 529 | has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y") |
523 | 530 | ||
524 | ifeq ($(has_bfd),y) | 531 | ifeq ($(has_bfd),y) |
525 | EXTLIBS += -lbfd | 532 | EXTLIBS += -lbfd |
526 | else | 533 | else |
527 | has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y") | 534 | has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y") |
528 | ifeq ($(has_bfd_iberty),y) | 535 | ifeq ($(has_bfd_iberty),y) |
529 | EXTLIBS += -lbfd -liberty | 536 | EXTLIBS += -lbfd -liberty |
530 | else | 537 | else |
531 | has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y") | 538 | has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y") |
532 | ifeq ($(has_bfd_iberty_z),y) | 539 | ifeq ($(has_bfd_iberty_z),y) |
533 | EXTLIBS += -lbfd -liberty -lz | 540 | EXTLIBS += -lbfd -liberty -lz |
534 | else | 541 | else |
535 | has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y") | 542 | has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y") |
536 | ifeq ($(has_cplus_demangle),y) | 543 | ifeq ($(has_cplus_demangle),y) |
537 | EXTLIBS += -liberty | 544 | EXTLIBS += -liberty |
538 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE | 545 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE |
@@ -780,7 +787,7 @@ export TAR INSTALL DESTDIR SHELL_PATH | |||
780 | 787 | ||
781 | SHELL = $(SHELL_PATH) | 788 | SHELL = $(SHELL_PATH) |
782 | 789 | ||
783 | all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS | 790 | all:: .perf.dev.null shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS |
784 | ifneq (,$X) | 791 | ifneq (,$X) |
785 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';) | 792 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';) |
786 | endif | 793 | endif |
@@ -1107,6 +1114,11 @@ clean: | |||
1107 | .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS | 1114 | .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS |
1108 | .PHONY: .FORCE-PERF-BUILD-OPTIONS | 1115 | .PHONY: .FORCE-PERF-BUILD-OPTIONS |
1109 | 1116 | ||
1117 | .perf.dev.null: | ||
1118 | touch .perf.dev.null | ||
1119 | |||
1120 | .INTERMEDIATE: .perf.dev.null | ||
1121 | |||
1110 | ### Make sure built-ins do not have dups and listed in perf.c | 1122 | ### Make sure built-ins do not have dups and listed in perf.c |
1111 | # | 1123 | # |
1112 | check-builtins:: | 1124 | check-builtins:: |