diff options
66 files changed, 403 insertions, 317 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 12a6b2973492..82640e640f36 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -911,11 +911,11 @@ F: arch/arm/include/asm/hardware/dec21285.h | |||
911 | F: arch/arm/mach-footbridge/ | 911 | F: arch/arm/mach-footbridge/ |
912 | 912 | ||
913 | ARM/FREESCALE IMX / MXC ARM ARCHITECTURE | 913 | ARM/FREESCALE IMX / MXC ARM ARCHITECTURE |
914 | M: Shawn Guo <shawn.guo@linaro.org> | 914 | M: Shawn Guo <shawn.guo@freescale.com> |
915 | M: Sascha Hauer <kernel@pengutronix.de> | 915 | M: Sascha Hauer <kernel@pengutronix.de> |
916 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 916 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
917 | S: Maintained | 917 | S: Maintained |
918 | T: git git://git.linaro.org/people/shawnguo/linux-2.6.git | 918 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git |
919 | F: arch/arm/mach-imx/ | 919 | F: arch/arm/mach-imx/ |
920 | F: arch/arm/boot/dts/imx* | 920 | F: arch/arm/boot/dts/imx* |
921 | F: arch/arm/configs/imx*_defconfig | 921 | F: arch/arm/configs/imx*_defconfig |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 3 | 1 | VERSION = 3 |
2 | PATCHLEVEL = 14 | 2 | PATCHLEVEL = 14 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Shuffling Zombie Juror | 5 | NAME = Shuffling Zombie Juror |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/dts/sama5d36.dtsi b/arch/arm/boot/dts/sama5d36.dtsi index 6c31c26e6cc0..db58cad6acd3 100644 --- a/arch/arm/boot/dts/sama5d36.dtsi +++ b/arch/arm/boot/dts/sama5d36.dtsi | |||
@@ -8,8 +8,8 @@ | |||
8 | */ | 8 | */ |
9 | #include "sama5d3.dtsi" | 9 | #include "sama5d3.dtsi" |
10 | #include "sama5d3_can.dtsi" | 10 | #include "sama5d3_can.dtsi" |
11 | #include "sama5d3_emac.dtsi" | ||
12 | #include "sama5d3_gmac.dtsi" | 11 | #include "sama5d3_gmac.dtsi" |
12 | #include "sama5d3_emac.dtsi" | ||
13 | #include "sama5d3_lcd.dtsi" | 13 | #include "sama5d3_lcd.dtsi" |
14 | #include "sama5d3_mci2.dtsi" | 14 | #include "sama5d3_mci2.dtsi" |
15 | #include "sama5d3_tcb1.dtsi" | 15 | #include "sama5d3_tcb1.dtsi" |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index dcae3a7035db..95fa1f1d5c8b 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1776,12 +1776,12 @@ endchoice | |||
1776 | 1776 | ||
1777 | config FORCE_MAX_ZONEORDER | 1777 | config FORCE_MAX_ZONEORDER |
1778 | int "Maximum zone order" | 1778 | int "Maximum zone order" |
1779 | range 14 64 if HUGETLB_PAGE && PAGE_SIZE_64KB | 1779 | range 14 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_64KB |
1780 | default "14" if HUGETLB_PAGE && PAGE_SIZE_64KB | 1780 | default "14" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_64KB |
1781 | range 13 64 if HUGETLB_PAGE && PAGE_SIZE_32KB | 1781 | range 13 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_32KB |
1782 | default "13" if HUGETLB_PAGE && PAGE_SIZE_32KB | 1782 | default "13" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_32KB |
1783 | range 12 64 if HUGETLB_PAGE && PAGE_SIZE_16KB | 1783 | range 12 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB |
1784 | default "12" if HUGETLB_PAGE && PAGE_SIZE_16KB | 1784 | default "12" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB |
1785 | range 11 64 | 1785 | range 11 64 |
1786 | default "11" | 1786 | default "11" |
1787 | help | 1787 | help |
@@ -2353,9 +2353,8 @@ config SECCOMP | |||
2353 | If unsure, say Y. Only embedded should say N here. | 2353 | If unsure, say Y. Only embedded should say N here. |
2354 | 2354 | ||
2355 | config MIPS_O32_FP64_SUPPORT | 2355 | config MIPS_O32_FP64_SUPPORT |
2356 | bool "Support for O32 binaries using 64-bit FP" | 2356 | bool "Support for O32 binaries using 64-bit FP (EXPERIMENTAL)" |
2357 | depends on 32BIT || MIPS32_O32 | 2357 | depends on 32BIT || MIPS32_O32 |
2358 | default y | ||
2359 | help | 2358 | help |
2360 | When this is enabled, the kernel will support use of 64-bit floating | 2359 | When this is enabled, the kernel will support use of 64-bit floating |
2361 | point registers with binaries using the O32 ABI along with the | 2360 | point registers with binaries using the O32 ABI along with the |
@@ -2367,7 +2366,14 @@ config MIPS_O32_FP64_SUPPORT | |||
2367 | of your kernel & potentially improve FP emulation performance by | 2366 | of your kernel & potentially improve FP emulation performance by |
2368 | saying N here. | 2367 | saying N here. |
2369 | 2368 | ||
2370 | If unsure, say Y. | 2369 | Although binutils currently supports use of this flag the details |
2370 | concerning its effect upon the O32 ABI in userland are still being | ||
2371 | worked on. In order to avoid userland becoming dependant upon current | ||
2372 | behaviour before the details have been finalised, this option should | ||
2373 | be considered experimental and only enabled by those working upon | ||
2374 | said details. | ||
2375 | |||
2376 | If unsure, say N. | ||
2371 | 2377 | ||
2372 | config USE_OF | 2378 | config USE_OF |
2373 | bool | 2379 | bool |
diff --git a/arch/mips/alchemy/board-gpr.c b/arch/mips/alchemy/board-gpr.c index 9edc35ff8cf1..acf9a2a37f5a 100644 --- a/arch/mips/alchemy/board-gpr.c +++ b/arch/mips/alchemy/board-gpr.c | |||
@@ -53,10 +53,8 @@ void __init prom_init(void) | |||
53 | prom_init_cmdline(); | 53 | prom_init_cmdline(); |
54 | 54 | ||
55 | memsize_str = prom_getenv("memsize"); | 55 | memsize_str = prom_getenv("memsize"); |
56 | if (!memsize_str) | 56 | if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) |
57 | memsize = 0x04000000; | 57 | memsize = 0x04000000; |
58 | else | ||
59 | strict_strtoul(memsize_str, 0, &memsize); | ||
60 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 58 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
61 | } | 59 | } |
62 | 60 | ||
diff --git a/arch/mips/alchemy/board-mtx1.c b/arch/mips/alchemy/board-mtx1.c index 9969dbab19e3..25a59a23547e 100644 --- a/arch/mips/alchemy/board-mtx1.c +++ b/arch/mips/alchemy/board-mtx1.c | |||
@@ -52,10 +52,8 @@ void __init prom_init(void) | |||
52 | prom_init_cmdline(); | 52 | prom_init_cmdline(); |
53 | 53 | ||
54 | memsize_str = prom_getenv("memsize"); | 54 | memsize_str = prom_getenv("memsize"); |
55 | if (!memsize_str) | 55 | if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) |
56 | memsize = 0x04000000; | 56 | memsize = 0x04000000; |
57 | else | ||
58 | strict_strtoul(memsize_str, 0, &memsize); | ||
59 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 57 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
60 | } | 58 | } |
61 | 59 | ||
diff --git a/arch/mips/bcm47xx/board.c b/arch/mips/bcm47xx/board.c index 6d612e2b949b..cdd8246f92b3 100644 --- a/arch/mips/bcm47xx/board.c +++ b/arch/mips/bcm47xx/board.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <linux/errno.h> | ||
1 | #include <linux/export.h> | 2 | #include <linux/export.h> |
2 | #include <linux/string.h> | 3 | #include <linux/string.h> |
3 | #include <bcm47xx_board.h> | 4 | #include <bcm47xx_board.h> |
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c index 6decb27cf48b..2bed73a684ae 100644 --- a/arch/mips/bcm47xx/nvram.c +++ b/arch/mips/bcm47xx/nvram.c | |||
@@ -196,7 +196,7 @@ int bcm47xx_nvram_gpio_pin(const char *name) | |||
196 | char nvram_var[10]; | 196 | char nvram_var[10]; |
197 | char buf[30]; | 197 | char buf[30]; |
198 | 198 | ||
199 | for (i = 0; i < 16; i++) { | 199 | for (i = 0; i < 32; i++) { |
200 | err = snprintf(nvram_var, sizeof(nvram_var), "gpio%i", i); | 200 | err = snprintf(nvram_var, sizeof(nvram_var), "gpio%i", i); |
201 | if (err <= 0) | 201 | if (err <= 0) |
202 | continue; | 202 | continue; |
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index 25fbfae06c1f..c2bb4f896ce7 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
@@ -975,10 +975,6 @@ static int octeon_irq_ciu_xlat(struct irq_domain *d, | |||
975 | if (ciu > 1 || bit > 63) | 975 | if (ciu > 1 || bit > 63) |
976 | return -EINVAL; | 976 | return -EINVAL; |
977 | 977 | ||
978 | /* These are the GPIO lines */ | ||
979 | if (ciu == 0 && bit >= 16 && bit < 32) | ||
980 | return -EINVAL; | ||
981 | |||
982 | *out_hwirq = (ciu << 6) | bit; | 978 | *out_hwirq = (ciu << 6) | bit; |
983 | *out_type = 0; | 979 | *out_type = 0; |
984 | 980 | ||
@@ -1007,6 +1003,10 @@ static int octeon_irq_ciu_map(struct irq_domain *d, | |||
1007 | if (!octeon_irq_virq_in_range(virq)) | 1003 | if (!octeon_irq_virq_in_range(virq)) |
1008 | return -EINVAL; | 1004 | return -EINVAL; |
1009 | 1005 | ||
1006 | /* Don't map irq if it is reserved for GPIO. */ | ||
1007 | if (line == 0 && bit >= 16 && bit <32) | ||
1008 | return 0; | ||
1009 | |||
1010 | if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0) | 1010 | if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0) |
1011 | return -EINVAL; | 1011 | return -EINVAL; |
1012 | 1012 | ||
@@ -1525,10 +1525,6 @@ static int octeon_irq_ciu2_xlat(struct irq_domain *d, | |||
1525 | ciu = intspec[0]; | 1525 | ciu = intspec[0]; |
1526 | bit = intspec[1]; | 1526 | bit = intspec[1]; |
1527 | 1527 | ||
1528 | /* Line 7 are the GPIO lines */ | ||
1529 | if (ciu > 6 || bit > 63) | ||
1530 | return -EINVAL; | ||
1531 | |||
1532 | *out_hwirq = (ciu << 6) | bit; | 1528 | *out_hwirq = (ciu << 6) | bit; |
1533 | *out_type = 0; | 1529 | *out_type = 0; |
1534 | 1530 | ||
@@ -1570,8 +1566,14 @@ static int octeon_irq_ciu2_map(struct irq_domain *d, | |||
1570 | if (!octeon_irq_virq_in_range(virq)) | 1566 | if (!octeon_irq_virq_in_range(virq)) |
1571 | return -EINVAL; | 1567 | return -EINVAL; |
1572 | 1568 | ||
1573 | /* Line 7 are the GPIO lines */ | 1569 | /* |
1574 | if (line > 6 || octeon_irq_ciu_to_irq[line][bit] != 0) | 1570 | * Don't map irq if it is reserved for GPIO. |
1571 | * (Line 7 are the GPIO lines.) | ||
1572 | */ | ||
1573 | if (line == 7) | ||
1574 | return 0; | ||
1575 | |||
1576 | if (line > 7 || octeon_irq_ciu_to_irq[line][bit] != 0) | ||
1575 | return -EINVAL; | 1577 | return -EINVAL; |
1576 | 1578 | ||
1577 | if (octeon_irq_ciu2_is_edge(line, bit)) | 1579 | if (octeon_irq_ciu2_is_edge(line, bit)) |
diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h index 3220c93ea981..4225e99bd7bf 100644 --- a/arch/mips/include/asm/asmmacro.h +++ b/arch/mips/include/asm/asmmacro.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define _ASM_ASMMACRO_H | 9 | #define _ASM_ASMMACRO_H |
10 | 10 | ||
11 | #include <asm/hazards.h> | 11 | #include <asm/hazards.h> |
12 | #include <asm/asm-offsets.h> | ||
12 | 13 | ||
13 | #ifdef CONFIG_32BIT | 14 | #ifdef CONFIG_32BIT |
14 | #include <asm/asmmacro-32.h> | 15 | #include <asm/asmmacro-32.h> |
@@ -54,11 +55,21 @@ | |||
54 | .endm | 55 | .endm |
55 | 56 | ||
56 | .macro local_irq_disable reg=t0 | 57 | .macro local_irq_disable reg=t0 |
58 | #ifdef CONFIG_PREEMPT | ||
59 | lw \reg, TI_PRE_COUNT($28) | ||
60 | addi \reg, \reg, 1 | ||
61 | sw \reg, TI_PRE_COUNT($28) | ||
62 | #endif | ||
57 | mfc0 \reg, CP0_STATUS | 63 | mfc0 \reg, CP0_STATUS |
58 | ori \reg, \reg, 1 | 64 | ori \reg, \reg, 1 |
59 | xori \reg, \reg, 1 | 65 | xori \reg, \reg, 1 |
60 | mtc0 \reg, CP0_STATUS | 66 | mtc0 \reg, CP0_STATUS |
61 | irq_disable_hazard | 67 | irq_disable_hazard |
68 | #ifdef CONFIG_PREEMPT | ||
69 | lw \reg, TI_PRE_COUNT($28) | ||
70 | addi \reg, \reg, -1 | ||
71 | sw \reg, TI_PRE_COUNT($28) | ||
72 | #endif | ||
62 | .endm | 73 | .endm |
63 | #endif /* CONFIG_MIPS_MT_SMTC */ | 74 | #endif /* CONFIG_MIPS_MT_SMTC */ |
64 | 75 | ||
@@ -106,7 +117,7 @@ | |||
106 | .endm | 117 | .endm |
107 | 118 | ||
108 | .macro fpu_save_double thread status tmp | 119 | .macro fpu_save_double thread status tmp |
109 | #if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2) | 120 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
110 | sll \tmp, \status, 5 | 121 | sll \tmp, \status, 5 |
111 | bgez \tmp, 10f | 122 | bgez \tmp, 10f |
112 | fpu_save_16odd \thread | 123 | fpu_save_16odd \thread |
@@ -159,7 +170,7 @@ | |||
159 | .endm | 170 | .endm |
160 | 171 | ||
161 | .macro fpu_restore_double thread status tmp | 172 | .macro fpu_restore_double thread status tmp |
162 | #if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2) | 173 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
163 | sll \tmp, \status, 5 | 174 | sll \tmp, \status, 5 |
164 | bgez \tmp, 10f # 16 register mode? | 175 | bgez \tmp, 10f # 16 register mode? |
165 | 176 | ||
diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h index 6b9749540edf..58e50cbdb1a6 100644 --- a/arch/mips/include/asm/fpu.h +++ b/arch/mips/include/asm/fpu.h | |||
@@ -57,7 +57,7 @@ static inline int __enable_fpu(enum fpu_mode mode) | |||
57 | return 0; | 57 | return 0; |
58 | 58 | ||
59 | case FPU_64BIT: | 59 | case FPU_64BIT: |
60 | #if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_MIPS64)) | 60 | #if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_64BIT)) |
61 | /* we only have a 32-bit FPU */ | 61 | /* we only have a 32-bit FPU */ |
62 | return SIGFPE; | 62 | return SIGFPE; |
63 | #endif | 63 | #endif |
diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftrace.h index ce35c9af0c28..992aaba603b5 100644 --- a/arch/mips/include/asm/ftrace.h +++ b/arch/mips/include/asm/ftrace.h | |||
@@ -22,12 +22,12 @@ extern void _mcount(void); | |||
22 | #define safe_load(load, src, dst, error) \ | 22 | #define safe_load(load, src, dst, error) \ |
23 | do { \ | 23 | do { \ |
24 | asm volatile ( \ | 24 | asm volatile ( \ |
25 | "1: " load " %[" STR(dst) "], 0(%[" STR(src) "])\n"\ | 25 | "1: " load " %[tmp_dst], 0(%[tmp_src])\n" \ |
26 | " li %[" STR(error) "], 0\n" \ | 26 | " li %[tmp_err], 0\n" \ |
27 | "2:\n" \ | 27 | "2:\n" \ |
28 | \ | 28 | \ |
29 | ".section .fixup, \"ax\"\n" \ | 29 | ".section .fixup, \"ax\"\n" \ |
30 | "3: li %[" STR(error) "], 1\n" \ | 30 | "3: li %[tmp_err], 1\n" \ |
31 | " j 2b\n" \ | 31 | " j 2b\n" \ |
32 | ".previous\n" \ | 32 | ".previous\n" \ |
33 | \ | 33 | \ |
@@ -35,8 +35,8 @@ do { \ | |||
35 | STR(PTR) "\t1b, 3b\n\t" \ | 35 | STR(PTR) "\t1b, 3b\n\t" \ |
36 | ".previous\n" \ | 36 | ".previous\n" \ |
37 | \ | 37 | \ |
38 | : [dst] "=&r" (dst), [error] "=r" (error)\ | 38 | : [tmp_dst] "=&r" (dst), [tmp_err] "=r" (error)\ |
39 | : [src] "r" (src) \ | 39 | : [tmp_src] "r" (src) \ |
40 | : "memory" \ | 40 | : "memory" \ |
41 | ); \ | 41 | ); \ |
42 | } while (0) | 42 | } while (0) |
@@ -44,12 +44,12 @@ do { \ | |||
44 | #define safe_store(store, src, dst, error) \ | 44 | #define safe_store(store, src, dst, error) \ |
45 | do { \ | 45 | do { \ |
46 | asm volatile ( \ | 46 | asm volatile ( \ |
47 | "1: " store " %[" STR(src) "], 0(%[" STR(dst) "])\n"\ | 47 | "1: " store " %[tmp_src], 0(%[tmp_dst])\n"\ |
48 | " li %[" STR(error) "], 0\n" \ | 48 | " li %[tmp_err], 0\n" \ |
49 | "2:\n" \ | 49 | "2:\n" \ |
50 | \ | 50 | \ |
51 | ".section .fixup, \"ax\"\n" \ | 51 | ".section .fixup, \"ax\"\n" \ |
52 | "3: li %[" STR(error) "], 1\n" \ | 52 | "3: li %[tmp_err], 1\n" \ |
53 | " j 2b\n" \ | 53 | " j 2b\n" \ |
54 | ".previous\n" \ | 54 | ".previous\n" \ |
55 | \ | 55 | \ |
@@ -57,8 +57,8 @@ do { \ | |||
57 | STR(PTR) "\t1b, 3b\n\t" \ | 57 | STR(PTR) "\t1b, 3b\n\t" \ |
58 | ".previous\n" \ | 58 | ".previous\n" \ |
59 | \ | 59 | \ |
60 | : [error] "=r" (error) \ | 60 | : [tmp_err] "=r" (error) \ |
61 | : [dst] "r" (dst), [src] "r" (src)\ | 61 | : [tmp_dst] "r" (dst), [tmp_src] "r" (src)\ |
62 | : "memory" \ | 62 | : "memory" \ |
63 | ); \ | 63 | ); \ |
64 | } while (0) | 64 | } while (0) |
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index 33e8dbfc1b63..f35b131977e6 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifndef __ASM_MIPS_SYSCALL_H | 13 | #ifndef __ASM_MIPS_SYSCALL_H |
14 | #define __ASM_MIPS_SYSCALL_H | 14 | #define __ASM_MIPS_SYSCALL_H |
15 | 15 | ||
16 | #include <linux/compiler.h> | ||
16 | #include <linux/audit.h> | 17 | #include <linux/audit.h> |
17 | #include <linux/elf-em.h> | 18 | #include <linux/elf-em.h> |
18 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
@@ -39,14 +40,14 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, | |||
39 | 40 | ||
40 | #ifdef CONFIG_32BIT | 41 | #ifdef CONFIG_32BIT |
41 | case 4: case 5: case 6: case 7: | 42 | case 4: case 5: case 6: case 7: |
42 | return get_user(*arg, (int *)usp + 4 * n); | 43 | return get_user(*arg, (int *)usp + n); |
43 | #endif | 44 | #endif |
44 | 45 | ||
45 | #ifdef CONFIG_64BIT | 46 | #ifdef CONFIG_64BIT |
46 | case 4: case 5: case 6: case 7: | 47 | case 4: case 5: case 6: case 7: |
47 | #ifdef CONFIG_MIPS32_O32 | 48 | #ifdef CONFIG_MIPS32_O32 |
48 | if (test_thread_flag(TIF_32BIT_REGS)) | 49 | if (test_thread_flag(TIF_32BIT_REGS)) |
49 | return get_user(*arg, (int *)usp + 4 * n); | 50 | return get_user(*arg, (int *)usp + n); |
50 | else | 51 | else |
51 | #endif | 52 | #endif |
52 | *arg = regs->regs[4 + n]; | 53 | *arg = regs->regs[4 + n]; |
@@ -57,6 +58,8 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, | |||
57 | default: | 58 | default: |
58 | BUG(); | 59 | BUG(); |
59 | } | 60 | } |
61 | |||
62 | unreachable(); | ||
60 | } | 63 | } |
61 | 64 | ||
62 | static inline long syscall_get_return_value(struct task_struct *task, | 65 | static inline long syscall_get_return_value(struct task_struct *task, |
@@ -83,11 +86,10 @@ static inline void syscall_get_arguments(struct task_struct *task, | |||
83 | unsigned int i, unsigned int n, | 86 | unsigned int i, unsigned int n, |
84 | unsigned long *args) | 87 | unsigned long *args) |
85 | { | 88 | { |
86 | unsigned long arg; | ||
87 | int ret; | 89 | int ret; |
88 | 90 | ||
89 | while (n--) | 91 | while (n--) |
90 | ret |= mips_get_syscall_arg(&arg, task, regs, i++); | 92 | ret |= mips_get_syscall_arg(args++, task, regs, i++); |
91 | 93 | ||
92 | /* | 94 | /* |
93 | * No way to communicate an error because this is a void function. | 95 | * No way to communicate an error because this is a void function. |
diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index b39ba25b41cc..f25181b19941 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h | |||
@@ -163,8 +163,8 @@ enum cop1_sdw_func { | |||
163 | */ | 163 | */ |
164 | enum cop1x_func { | 164 | enum cop1x_func { |
165 | lwxc1_op = 0x00, ldxc1_op = 0x01, | 165 | lwxc1_op = 0x00, ldxc1_op = 0x01, |
166 | pfetch_op = 0x07, swxc1_op = 0x08, | 166 | swxc1_op = 0x08, sdxc1_op = 0x09, |
167 | sdxc1_op = 0x09, madd_s_op = 0x20, | 167 | pfetch_op = 0x0f, madd_s_op = 0x20, |
168 | madd_d_op = 0x21, madd_e_op = 0x22, | 168 | madd_d_op = 0x21, madd_e_op = 0x22, |
169 | msub_s_op = 0x28, msub_d_op = 0x29, | 169 | msub_s_op = 0x28, msub_d_op = 0x29, |
170 | msub_e_op = 0x2a, nmadd_s_op = 0x30, | 170 | msub_e_op = 0x2a, nmadd_s_op = 0x30, |
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index 185ba258361b..374ed74cd516 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c | |||
@@ -111,11 +111,10 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1, | |||
111 | safe_store_code(new_code1, ip, faulted); | 111 | safe_store_code(new_code1, ip, faulted); |
112 | if (unlikely(faulted)) | 112 | if (unlikely(faulted)) |
113 | return -EFAULT; | 113 | return -EFAULT; |
114 | ip += 4; | 114 | safe_store_code(new_code2, ip + 4, faulted); |
115 | safe_store_code(new_code2, ip, faulted); | ||
116 | if (unlikely(faulted)) | 115 | if (unlikely(faulted)) |
117 | return -EFAULT; | 116 | return -EFAULT; |
118 | flush_icache_range(ip, ip + 8); /* original ip + 12 */ | 117 | flush_icache_range(ip, ip + 8); |
119 | return 0; | 118 | return 0; |
120 | } | 119 | } |
121 | #endif | 120 | #endif |
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S index 253b2fb52026..73b0ddf910d4 100644 --- a/arch/mips/kernel/r4k_fpu.S +++ b/arch/mips/kernel/r4k_fpu.S | |||
@@ -35,9 +35,9 @@ | |||
35 | LEAF(_save_fp_context) | 35 | LEAF(_save_fp_context) |
36 | cfc1 t1, fcr31 | 36 | cfc1 t1, fcr31 |
37 | 37 | ||
38 | #if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2) | 38 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
39 | .set push | 39 | .set push |
40 | #ifdef CONFIG_MIPS32_R2 | 40 | #ifdef CONFIG_CPU_MIPS32_R2 |
41 | .set mips64r2 | 41 | .set mips64r2 |
42 | mfc0 t0, CP0_STATUS | 42 | mfc0 t0, CP0_STATUS |
43 | sll t0, t0, 5 | 43 | sll t0, t0, 5 |
@@ -146,11 +146,11 @@ LEAF(_save_fp_context32) | |||
146 | * - cp1 status/control register | 146 | * - cp1 status/control register |
147 | */ | 147 | */ |
148 | LEAF(_restore_fp_context) | 148 | LEAF(_restore_fp_context) |
149 | EX lw t0, SC_FPC_CSR(a0) | 149 | EX lw t1, SC_FPC_CSR(a0) |
150 | 150 | ||
151 | #if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2) | 151 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
152 | .set push | 152 | .set push |
153 | #ifdef CONFIG_MIPS32_R2 | 153 | #ifdef CONFIG_CPU_MIPS32_R2 |
154 | .set mips64r2 | 154 | .set mips64r2 |
155 | mfc0 t0, CP0_STATUS | 155 | mfc0 t0, CP0_STATUS |
156 | sll t0, t0, 5 | 156 | sll t0, t0, 5 |
@@ -191,7 +191,7 @@ LEAF(_restore_fp_context) | |||
191 | EX ldc1 $f26, SC_FPREGS+208(a0) | 191 | EX ldc1 $f26, SC_FPREGS+208(a0) |
192 | EX ldc1 $f28, SC_FPREGS+224(a0) | 192 | EX ldc1 $f28, SC_FPREGS+224(a0) |
193 | EX ldc1 $f30, SC_FPREGS+240(a0) | 193 | EX ldc1 $f30, SC_FPREGS+240(a0) |
194 | ctc1 t0, fcr31 | 194 | ctc1 t1, fcr31 |
195 | jr ra | 195 | jr ra |
196 | li v0, 0 # success | 196 | li v0, 0 # success |
197 | END(_restore_fp_context) | 197 | END(_restore_fp_context) |
@@ -199,7 +199,7 @@ LEAF(_restore_fp_context) | |||
199 | #ifdef CONFIG_MIPS32_COMPAT | 199 | #ifdef CONFIG_MIPS32_COMPAT |
200 | LEAF(_restore_fp_context32) | 200 | LEAF(_restore_fp_context32) |
201 | /* Restore an o32 sigcontext. */ | 201 | /* Restore an o32 sigcontext. */ |
202 | EX lw t0, SC32_FPC_CSR(a0) | 202 | EX lw t1, SC32_FPC_CSR(a0) |
203 | 203 | ||
204 | mfc0 t0, CP0_STATUS | 204 | mfc0 t0, CP0_STATUS |
205 | sll t0, t0, 5 | 205 | sll t0, t0, 5 |
@@ -239,7 +239,7 @@ LEAF(_restore_fp_context32) | |||
239 | EX ldc1 $f26, SC32_FPREGS+208(a0) | 239 | EX ldc1 $f26, SC32_FPREGS+208(a0) |
240 | EX ldc1 $f28, SC32_FPREGS+224(a0) | 240 | EX ldc1 $f28, SC32_FPREGS+224(a0) |
241 | EX ldc1 $f30, SC32_FPREGS+240(a0) | 241 | EX ldc1 $f30, SC32_FPREGS+240(a0) |
242 | ctc1 t0, fcr31 | 242 | ctc1 t1, fcr31 |
243 | jr ra | 243 | jr ra |
244 | li v0, 0 # success | 244 | li v0, 0 # success |
245 | END(_restore_fp_context32) | 245 | END(_restore_fp_context32) |
diff --git a/arch/mips/kernel/rtlx-cmp.c b/arch/mips/kernel/rtlx-cmp.c index 56dc69635153..758fb3cd2326 100644 --- a/arch/mips/kernel/rtlx-cmp.c +++ b/arch/mips/kernel/rtlx-cmp.c | |||
@@ -112,5 +112,8 @@ void __exit rtlx_module_exit(void) | |||
112 | 112 | ||
113 | for (i = 0; i < RTLX_CHANNELS; i++) | 113 | for (i = 0; i < RTLX_CHANNELS; i++) |
114 | device_destroy(mt_class, MKDEV(major, i)); | 114 | device_destroy(mt_class, MKDEV(major, i)); |
115 | |||
115 | unregister_chrdev(major, RTLX_MODULE_NAME); | 116 | unregister_chrdev(major, RTLX_MODULE_NAME); |
117 | |||
118 | aprp_hook = NULL; | ||
116 | } | 119 | } |
diff --git a/arch/mips/kernel/rtlx-mt.c b/arch/mips/kernel/rtlx-mt.c index 91d61ba422b4..9c1aca00fd54 100644 --- a/arch/mips/kernel/rtlx-mt.c +++ b/arch/mips/kernel/rtlx-mt.c | |||
@@ -144,5 +144,8 @@ void __exit rtlx_module_exit(void) | |||
144 | 144 | ||
145 | for (i = 0; i < RTLX_CHANNELS; i++) | 145 | for (i = 0; i < RTLX_CHANNELS; i++) |
146 | device_destroy(mt_class, MKDEV(major, i)); | 146 | device_destroy(mt_class, MKDEV(major, i)); |
147 | |||
147 | unregister_chrdev(major, RTLX_MODULE_NAME); | 148 | unregister_chrdev(major, RTLX_MODULE_NAME); |
149 | |||
150 | aprp_hook = NULL; | ||
148 | } | 151 | } |
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index 506925b2c3f3..0b4e2e38294b 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c | |||
@@ -1538,10 +1538,10 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1538 | break; | 1538 | break; |
1539 | } | 1539 | } |
1540 | 1540 | ||
1541 | case 0x7: /* 7 */ | 1541 | case 0x3: |
1542 | if (MIPSInst_FUNC(ir) != pfetch_op) { | 1542 | if (MIPSInst_FUNC(ir) != pfetch_op) |
1543 | return SIGILL; | 1543 | return SIGILL; |
1544 | } | 1544 | |
1545 | /* ignore prefx operation */ | 1545 | /* ignore prefx operation */ |
1546 | break; | 1546 | break; |
1547 | 1547 | ||
diff --git a/arch/mips/mti-malta/malta-amon.c b/arch/mips/mti-malta/malta-amon.c index 592ac0427426..84ac523b0ce0 100644 --- a/arch/mips/mti-malta/malta-amon.c +++ b/arch/mips/mti-malta/malta-amon.c | |||
@@ -72,7 +72,7 @@ int amon_cpu_start(int cpu, | |||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
74 | 74 | ||
75 | #ifdef CONFIG_MIPS_VPE_LOADER | 75 | #ifdef CONFIG_MIPS_VPE_LOADER_CMP |
76 | int vpe_run(struct vpe *v) | 76 | int vpe_run(struct vpe *v) |
77 | { | 77 | { |
78 | struct vpe_notifications *n; | 78 | struct vpe_notifications *n; |
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index ca3e3a46a42f..2242181a6284 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c | |||
@@ -119,7 +119,7 @@ static void malta_hw0_irqdispatch(void) | |||
119 | 119 | ||
120 | do_IRQ(MALTA_INT_BASE + irq); | 120 | do_IRQ(MALTA_INT_BASE + irq); |
121 | 121 | ||
122 | #ifdef MIPS_VPE_APSP_API | 122 | #ifdef CONFIG_MIPS_VPE_APSP_API_MT |
123 | if (aprp_hook) | 123 | if (aprp_hook) |
124 | aprp_hook(); | 124 | aprp_hook(); |
125 | #endif | 125 | #endif |
@@ -310,7 +310,7 @@ static void ipi_call_dispatch(void) | |||
310 | 310 | ||
311 | static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) | 311 | static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) |
312 | { | 312 | { |
313 | #ifdef MIPS_VPE_APSP_API | 313 | #ifdef CONFIG_MIPS_VPE_APSP_API_CMP |
314 | if (aprp_hook) | 314 | if (aprp_hook) |
315 | aprp_hook(); | 315 | aprp_hook(); |
316 | #endif | 316 | #endif |
diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c index d37be36dc659..2b91b0e61566 100644 --- a/arch/mips/pci/msi-octeon.c +++ b/arch/mips/pci/msi-octeon.c | |||
@@ -150,6 +150,7 @@ msi_irq_allocated: | |||
150 | msg.address_lo = | 150 | msg.address_lo = |
151 | ((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff; | 151 | ((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff; |
152 | msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32; | 152 | msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32; |
153 | break; | ||
153 | case OCTEON_DMA_BAR_TYPE_BIG: | 154 | case OCTEON_DMA_BAR_TYPE_BIG: |
154 | /* When using big bar, Bar 0 is based at 0 */ | 155 | /* When using big bar, Bar 0 is based at 0 */ |
155 | msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff; | 156 | msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff; |
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index e66d4ec04d95..818dce344e82 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
@@ -1504,73 +1504,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) | |||
1504 | 1: addi r8,r8,16 | 1504 | 1: addi r8,r8,16 |
1505 | .endr | 1505 | .endr |
1506 | 1506 | ||
1507 | /* Save DEC */ | ||
1508 | mfspr r5,SPRN_DEC | ||
1509 | mftb r6 | ||
1510 | extsw r5,r5 | ||
1511 | add r5,r5,r6 | ||
1512 | std r5,VCPU_DEC_EXPIRES(r9) | ||
1513 | |||
1514 | BEGIN_FTR_SECTION | ||
1515 | b 8f | ||
1516 | END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) | ||
1517 | /* Turn on TM so we can access TFHAR/TFIAR/TEXASR */ | ||
1518 | mfmsr r8 | ||
1519 | li r0, 1 | ||
1520 | rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG | ||
1521 | mtmsrd r8 | ||
1522 | |||
1523 | /* Save POWER8-specific registers */ | ||
1524 | mfspr r5, SPRN_IAMR | ||
1525 | mfspr r6, SPRN_PSPB | ||
1526 | mfspr r7, SPRN_FSCR | ||
1527 | std r5, VCPU_IAMR(r9) | ||
1528 | stw r6, VCPU_PSPB(r9) | ||
1529 | std r7, VCPU_FSCR(r9) | ||
1530 | mfspr r5, SPRN_IC | ||
1531 | mfspr r6, SPRN_VTB | ||
1532 | mfspr r7, SPRN_TAR | ||
1533 | std r5, VCPU_IC(r9) | ||
1534 | std r6, VCPU_VTB(r9) | ||
1535 | std r7, VCPU_TAR(r9) | ||
1536 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM | ||
1537 | mfspr r5, SPRN_TFHAR | ||
1538 | mfspr r6, SPRN_TFIAR | ||
1539 | mfspr r7, SPRN_TEXASR | ||
1540 | std r5, VCPU_TFHAR(r9) | ||
1541 | std r6, VCPU_TFIAR(r9) | ||
1542 | std r7, VCPU_TEXASR(r9) | ||
1543 | #endif | ||
1544 | mfspr r8, SPRN_EBBHR | ||
1545 | std r8, VCPU_EBBHR(r9) | ||
1546 | mfspr r5, SPRN_EBBRR | ||
1547 | mfspr r6, SPRN_BESCR | ||
1548 | mfspr r7, SPRN_CSIGR | ||
1549 | mfspr r8, SPRN_TACR | ||
1550 | std r5, VCPU_EBBRR(r9) | ||
1551 | std r6, VCPU_BESCR(r9) | ||
1552 | std r7, VCPU_CSIGR(r9) | ||
1553 | std r8, VCPU_TACR(r9) | ||
1554 | mfspr r5, SPRN_TCSCR | ||
1555 | mfspr r6, SPRN_ACOP | ||
1556 | mfspr r7, SPRN_PID | ||
1557 | mfspr r8, SPRN_WORT | ||
1558 | std r5, VCPU_TCSCR(r9) | ||
1559 | std r6, VCPU_ACOP(r9) | ||
1560 | stw r7, VCPU_GUEST_PID(r9) | ||
1561 | std r8, VCPU_WORT(r9) | ||
1562 | 8: | ||
1563 | |||
1564 | /* Save and reset AMR and UAMOR before turning on the MMU */ | ||
1565 | BEGIN_FTR_SECTION | ||
1566 | mfspr r5,SPRN_AMR | ||
1567 | mfspr r6,SPRN_UAMOR | ||
1568 | std r5,VCPU_AMR(r9) | ||
1569 | std r6,VCPU_UAMOR(r9) | ||
1570 | li r6,0 | ||
1571 | mtspr SPRN_AMR,r6 | ||
1572 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) | ||
1573 | |||
1574 | /* Unset guest mode */ | 1507 | /* Unset guest mode */ |
1575 | li r0, KVM_GUEST_MODE_NONE | 1508 | li r0, KVM_GUEST_MODE_NONE |
1576 | stb r0, HSTATE_IN_GUEST(r13) | 1509 | stb r0, HSTATE_IN_GUEST(r13) |
@@ -2203,7 +2136,7 @@ BEGIN_FTR_SECTION | |||
2203 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | 2136 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) |
2204 | #endif | 2137 | #endif |
2205 | mfspr r6,SPRN_VRSAVE | 2138 | mfspr r6,SPRN_VRSAVE |
2206 | stw r6,VCPU_VRSAVE(r3) | 2139 | stw r6,VCPU_VRSAVE(r31) |
2207 | mtlr r30 | 2140 | mtlr r30 |
2208 | mtmsrd r5 | 2141 | mtmsrd r5 |
2209 | isync | 2142 | isync |
@@ -2240,7 +2173,7 @@ BEGIN_FTR_SECTION | |||
2240 | bl .load_vr_state | 2173 | bl .load_vr_state |
2241 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | 2174 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) |
2242 | #endif | 2175 | #endif |
2243 | lwz r7,VCPU_VRSAVE(r4) | 2176 | lwz r7,VCPU_VRSAVE(r31) |
2244 | mtspr SPRN_VRSAVE,r7 | 2177 | mtspr SPRN_VRSAVE,r7 |
2245 | mtlr r30 | 2178 | mtlr r30 |
2246 | mr r4,r31 | 2179 | mr r4,r31 |
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index fd972a3e4cbb..9fa8aa051f54 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/pci_ids.h> | 18 | #include <linux/pci_ids.h> |
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
21 | #include <linux/ioport.h> | ||
22 | #include <linux/suspend.h> | 21 | #include <linux/suspend.h> |
23 | #include <asm/e820.h> | 22 | #include <asm/e820.h> |
24 | #include <asm/io.h> | 23 | #include <asm/io.h> |
@@ -54,18 +53,6 @@ int fallback_aper_force __initdata; | |||
54 | 53 | ||
55 | int fix_aperture __initdata = 1; | 54 | int fix_aperture __initdata = 1; |
56 | 55 | ||
57 | static struct resource gart_resource = { | ||
58 | .name = "GART", | ||
59 | .flags = IORESOURCE_MEM, | ||
60 | }; | ||
61 | |||
62 | static void __init insert_aperture_resource(u32 aper_base, u32 aper_size) | ||
63 | { | ||
64 | gart_resource.start = aper_base; | ||
65 | gart_resource.end = aper_base + aper_size - 1; | ||
66 | insert_resource(&iomem_resource, &gart_resource); | ||
67 | } | ||
68 | |||
69 | /* This code runs before the PCI subsystem is initialized, so just | 56 | /* This code runs before the PCI subsystem is initialized, so just |
70 | access the northbridge directly. */ | 57 | access the northbridge directly. */ |
71 | 58 | ||
@@ -96,7 +83,6 @@ static u32 __init allocate_aperture(void) | |||
96 | memblock_reserve(addr, aper_size); | 83 | memblock_reserve(addr, aper_size); |
97 | printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", | 84 | printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", |
98 | aper_size >> 10, addr); | 85 | aper_size >> 10, addr); |
99 | insert_aperture_resource((u32)addr, aper_size); | ||
100 | register_nosave_region(addr >> PAGE_SHIFT, | 86 | register_nosave_region(addr >> PAGE_SHIFT, |
101 | (addr+aper_size) >> PAGE_SHIFT); | 87 | (addr+aper_size) >> PAGE_SHIFT); |
102 | 88 | ||
@@ -444,12 +430,8 @@ int __init gart_iommu_hole_init(void) | |||
444 | 430 | ||
445 | out: | 431 | out: |
446 | if (!fix && !fallback_aper_force) { | 432 | if (!fix && !fallback_aper_force) { |
447 | if (last_aper_base) { | 433 | if (last_aper_base) |
448 | unsigned long n = (32 * 1024 * 1024) << last_aper_order; | ||
449 | |||
450 | insert_aperture_resource((u32)last_aper_base, n); | ||
451 | return 1; | 434 | return 1; |
452 | } | ||
453 | return 0; | 435 | return 0; |
454 | } | 436 | } |
455 | 437 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index c88f7f4b03ee..047f540cf3f7 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
@@ -3334,6 +3334,8 @@ static int __init uncore_type_init(struct intel_uncore_type *type) | |||
3334 | if (!pmus) | 3334 | if (!pmus) |
3335 | return -ENOMEM; | 3335 | return -ENOMEM; |
3336 | 3336 | ||
3337 | type->pmus = pmus; | ||
3338 | |||
3337 | type->unconstrainted = (struct event_constraint) | 3339 | type->unconstrainted = (struct event_constraint) |
3338 | __EVENT_CONSTRAINT(0, (1ULL << type->num_counters) - 1, | 3340 | __EVENT_CONSTRAINT(0, (1ULL << type->num_counters) - 1, |
3339 | 0, type->num_counters, 0, 0); | 3341 | 0, type->num_counters, 0, 0); |
@@ -3369,7 +3371,6 @@ static int __init uncore_type_init(struct intel_uncore_type *type) | |||
3369 | } | 3371 | } |
3370 | 3372 | ||
3371 | type->pmu_group = &uncore_pmu_attr_group; | 3373 | type->pmu_group = &uncore_pmu_attr_group; |
3372 | type->pmus = pmus; | ||
3373 | return 0; | 3374 | return 0; |
3374 | fail: | 3375 | fail: |
3375 | uncore_type_exit(type); | 3376 | uncore_type_exit(type); |
diff --git a/block/blk-core.c b/block/blk-core.c index 853f92749202..bfe16d5af9f9 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -693,20 +693,11 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) | |||
693 | if (!uninit_q) | 693 | if (!uninit_q) |
694 | return NULL; | 694 | return NULL; |
695 | 695 | ||
696 | uninit_q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL); | ||
697 | if (!uninit_q->flush_rq) | ||
698 | goto out_cleanup_queue; | ||
699 | |||
700 | q = blk_init_allocated_queue(uninit_q, rfn, lock); | 696 | q = blk_init_allocated_queue(uninit_q, rfn, lock); |
701 | if (!q) | 697 | if (!q) |
702 | goto out_free_flush_rq; | 698 | blk_cleanup_queue(uninit_q); |
703 | return q; | ||
704 | 699 | ||
705 | out_free_flush_rq: | 700 | return q; |
706 | kfree(uninit_q->flush_rq); | ||
707 | out_cleanup_queue: | ||
708 | blk_cleanup_queue(uninit_q); | ||
709 | return NULL; | ||
710 | } | 701 | } |
711 | EXPORT_SYMBOL(blk_init_queue_node); | 702 | EXPORT_SYMBOL(blk_init_queue_node); |
712 | 703 | ||
@@ -717,9 +708,13 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn, | |||
717 | if (!q) | 708 | if (!q) |
718 | return NULL; | 709 | return NULL; |
719 | 710 | ||
720 | if (blk_init_rl(&q->root_rl, q, GFP_KERNEL)) | 711 | q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL); |
712 | if (!q->flush_rq) | ||
721 | return NULL; | 713 | return NULL; |
722 | 714 | ||
715 | if (blk_init_rl(&q->root_rl, q, GFP_KERNEL)) | ||
716 | goto fail; | ||
717 | |||
723 | q->request_fn = rfn; | 718 | q->request_fn = rfn; |
724 | q->prep_rq_fn = NULL; | 719 | q->prep_rq_fn = NULL; |
725 | q->unprep_rq_fn = NULL; | 720 | q->unprep_rq_fn = NULL; |
@@ -742,12 +737,16 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn, | |||
742 | /* init elevator */ | 737 | /* init elevator */ |
743 | if (elevator_init(q, NULL)) { | 738 | if (elevator_init(q, NULL)) { |
744 | mutex_unlock(&q->sysfs_lock); | 739 | mutex_unlock(&q->sysfs_lock); |
745 | return NULL; | 740 | goto fail; |
746 | } | 741 | } |
747 | 742 | ||
748 | mutex_unlock(&q->sysfs_lock); | 743 | mutex_unlock(&q->sysfs_lock); |
749 | 744 | ||
750 | return q; | 745 | return q; |
746 | |||
747 | fail: | ||
748 | kfree(q->flush_rq); | ||
749 | return NULL; | ||
751 | } | 750 | } |
752 | EXPORT_SYMBOL(blk_init_allocated_queue); | 751 | EXPORT_SYMBOL(blk_init_allocated_queue); |
753 | 752 | ||
diff --git a/block/blk-flush.c b/block/blk-flush.c index f598f794c3c6..43e6b4755e9a 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
@@ -140,14 +140,17 @@ static void mq_flush_run(struct work_struct *work) | |||
140 | blk_mq_insert_request(rq, false, true, false); | 140 | blk_mq_insert_request(rq, false, true, false); |
141 | } | 141 | } |
142 | 142 | ||
143 | static bool blk_flush_queue_rq(struct request *rq) | 143 | static bool blk_flush_queue_rq(struct request *rq, bool add_front) |
144 | { | 144 | { |
145 | if (rq->q->mq_ops) { | 145 | if (rq->q->mq_ops) { |
146 | INIT_WORK(&rq->mq_flush_work, mq_flush_run); | 146 | INIT_WORK(&rq->mq_flush_work, mq_flush_run); |
147 | kblockd_schedule_work(rq->q, &rq->mq_flush_work); | 147 | kblockd_schedule_work(rq->q, &rq->mq_flush_work); |
148 | return false; | 148 | return false; |
149 | } else { | 149 | } else { |
150 | list_add_tail(&rq->queuelist, &rq->q->queue_head); | 150 | if (add_front) |
151 | list_add(&rq->queuelist, &rq->q->queue_head); | ||
152 | else | ||
153 | list_add_tail(&rq->queuelist, &rq->q->queue_head); | ||
151 | return true; | 154 | return true; |
152 | } | 155 | } |
153 | } | 156 | } |
@@ -193,7 +196,7 @@ static bool blk_flush_complete_seq(struct request *rq, unsigned int seq, | |||
193 | 196 | ||
194 | case REQ_FSEQ_DATA: | 197 | case REQ_FSEQ_DATA: |
195 | list_move_tail(&rq->flush.list, &q->flush_data_in_flight); | 198 | list_move_tail(&rq->flush.list, &q->flush_data_in_flight); |
196 | queued = blk_flush_queue_rq(rq); | 199 | queued = blk_flush_queue_rq(rq, true); |
197 | break; | 200 | break; |
198 | 201 | ||
199 | case REQ_FSEQ_DONE: | 202 | case REQ_FSEQ_DONE: |
@@ -326,7 +329,7 @@ static bool blk_kick_flush(struct request_queue *q) | |||
326 | q->flush_rq->rq_disk = first_rq->rq_disk; | 329 | q->flush_rq->rq_disk = first_rq->rq_disk; |
327 | q->flush_rq->end_io = flush_end_io; | 330 | q->flush_rq->end_io = flush_end_io; |
328 | 331 | ||
329 | return blk_flush_queue_rq(q->flush_rq); | 332 | return blk_flush_queue_rq(q->flush_rq, false); |
330 | } | 333 | } |
331 | 334 | ||
332 | static void flush_data_end_io(struct request *rq, int error) | 335 | static void flush_data_end_io(struct request *rq, int error) |
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 516026954be6..d777bb7cea93 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -4498,7 +4498,7 @@ static int mtip_pci_probe(struct pci_dev *pdev, | |||
4498 | } | 4498 | } |
4499 | dev_info(&pdev->dev, "NUMA node %d (closest: %d,%d, probe on %d:%d)\n", | 4499 | dev_info(&pdev->dev, "NUMA node %d (closest: %d,%d, probe on %d:%d)\n", |
4500 | my_node, pcibus_to_node(pdev->bus), dev_to_node(&pdev->dev), | 4500 | my_node, pcibus_to_node(pdev->bus), dev_to_node(&pdev->dev), |
4501 | cpu_to_node(smp_processor_id()), smp_processor_id()); | 4501 | cpu_to_node(raw_smp_processor_id()), raw_smp_processor_id()); |
4502 | 4502 | ||
4503 | dd = kzalloc_node(sizeof(struct driver_data), GFP_KERNEL, my_node); | 4503 | dd = kzalloc_node(sizeof(struct driver_data), GFP_KERNEL, my_node); |
4504 | if (dd == NULL) { | 4504 | if (dd == NULL) { |
diff --git a/drivers/clocksource/vf_pit_timer.c b/drivers/clocksource/vf_pit_timer.c index 02821b06a39e..a918bc481c52 100644 --- a/drivers/clocksource/vf_pit_timer.c +++ b/drivers/clocksource/vf_pit_timer.c | |||
@@ -54,7 +54,7 @@ static inline void pit_irq_acknowledge(void) | |||
54 | 54 | ||
55 | static u64 pit_read_sched_clock(void) | 55 | static u64 pit_read_sched_clock(void) |
56 | { | 56 | { |
57 | return __raw_readl(clksrc_base + PITCVAL); | 57 | return ~__raw_readl(clksrc_base + PITCVAL); |
58 | } | 58 | } |
59 | 59 | ||
60 | static int __init pit_clocksource_init(unsigned long rate) | 60 | static int __init pit_clocksource_init(unsigned long rate) |
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 5736aaa7e86c..f7af69bcf3f4 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c | |||
@@ -468,8 +468,8 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) | |||
468 | } else { | 468 | } else { |
469 | list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list, | 469 | list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list, |
470 | legacy_dev_list) { | 470 | legacy_dev_list) { |
471 | drm_put_dev(dev); | ||
472 | list_del(&dev->legacy_dev_list); | 471 | list_del(&dev->legacy_dev_list); |
472 | drm_put_dev(dev); | ||
473 | } | 473 | } |
474 | } | 474 | } |
475 | DRM_INFO("Module unloaded\n"); | 475 | DRM_INFO("Module unloaded\n"); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 215131ab1dd2..c204b4e3356e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
@@ -172,20 +172,24 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) | |||
172 | 172 | ||
173 | ret = exynos_drm_subdrv_open(dev, file); | 173 | ret = exynos_drm_subdrv_open(dev, file); |
174 | if (ret) | 174 | if (ret) |
175 | goto out; | 175 | goto err_file_priv_free; |
176 | 176 | ||
177 | anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops, | 177 | anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops, |
178 | NULL, 0); | 178 | NULL, 0); |
179 | if (IS_ERR(anon_filp)) { | 179 | if (IS_ERR(anon_filp)) { |
180 | ret = PTR_ERR(anon_filp); | 180 | ret = PTR_ERR(anon_filp); |
181 | goto out; | 181 | goto err_subdrv_close; |
182 | } | 182 | } |
183 | 183 | ||
184 | anon_filp->f_mode = FMODE_READ | FMODE_WRITE; | 184 | anon_filp->f_mode = FMODE_READ | FMODE_WRITE; |
185 | file_priv->anon_filp = anon_filp; | 185 | file_priv->anon_filp = anon_filp; |
186 | 186 | ||
187 | return ret; | 187 | return ret; |
188 | out: | 188 | |
189 | err_subdrv_close: | ||
190 | exynos_drm_subdrv_close(dev, file); | ||
191 | |||
192 | err_file_priv_free: | ||
189 | kfree(file_priv); | 193 | kfree(file_priv); |
190 | file->driver_priv = NULL; | 194 | file->driver_priv = NULL; |
191 | return ret; | 195 | return ret; |
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index d58b4e287e32..28d24caa49f3 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c | |||
@@ -214,6 +214,13 @@ int i915_gem_init_stolen(struct drm_device *dev) | |||
214 | struct drm_i915_private *dev_priv = dev->dev_private; | 214 | struct drm_i915_private *dev_priv = dev->dev_private; |
215 | int bios_reserved = 0; | 215 | int bios_reserved = 0; |
216 | 216 | ||
217 | #ifdef CONFIG_INTEL_IOMMU | ||
218 | if (intel_iommu_gfx_mapped) { | ||
219 | DRM_INFO("DMAR active, disabling use of stolen memory\n"); | ||
220 | return 0; | ||
221 | } | ||
222 | #endif | ||
223 | |||
217 | if (dev_priv->gtt.stolen_size == 0) | 224 | if (dev_priv->gtt.stolen_size == 0) |
218 | return 0; | 225 | return 0; |
219 | 226 | ||
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 9fec71175571..d554169ac592 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -618,33 +618,25 @@ static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) | |||
618 | 618 | ||
619 | /* raw reads, only for fast reads of display block, no need for forcewake etc. */ | 619 | /* raw reads, only for fast reads of display block, no need for forcewake etc. */ |
620 | #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__)) | 620 | #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__)) |
621 | #define __raw_i915_read16(dev_priv__, reg__) readw((dev_priv__)->regs + (reg__)) | ||
622 | 621 | ||
623 | static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) | 622 | static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) |
624 | { | 623 | { |
625 | struct drm_i915_private *dev_priv = dev->dev_private; | 624 | struct drm_i915_private *dev_priv = dev->dev_private; |
626 | uint32_t status; | 625 | uint32_t status; |
627 | 626 | int reg; | |
628 | if (INTEL_INFO(dev)->gen < 7) { | 627 | |
629 | status = pipe == PIPE_A ? | 628 | if (INTEL_INFO(dev)->gen >= 8) { |
630 | DE_PIPEA_VBLANK : | 629 | status = GEN8_PIPE_VBLANK; |
631 | DE_PIPEB_VBLANK; | 630 | reg = GEN8_DE_PIPE_ISR(pipe); |
631 | } else if (INTEL_INFO(dev)->gen >= 7) { | ||
632 | status = DE_PIPE_VBLANK_IVB(pipe); | ||
633 | reg = DEISR; | ||
632 | } else { | 634 | } else { |
633 | switch (pipe) { | 635 | status = DE_PIPE_VBLANK(pipe); |
634 | default: | 636 | reg = DEISR; |
635 | case PIPE_A: | ||
636 | status = DE_PIPEA_VBLANK_IVB; | ||
637 | break; | ||
638 | case PIPE_B: | ||
639 | status = DE_PIPEB_VBLANK_IVB; | ||
640 | break; | ||
641 | case PIPE_C: | ||
642 | status = DE_PIPEC_VBLANK_IVB; | ||
643 | break; | ||
644 | } | ||
645 | } | 637 | } |
646 | 638 | ||
647 | return __raw_i915_read32(dev_priv, DEISR) & status; | 639 | return __raw_i915_read32(dev_priv, reg) & status; |
648 | } | 640 | } |
649 | 641 | ||
650 | static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | 642 | static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, |
@@ -702,7 +694,28 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | |||
702 | else | 694 | else |
703 | position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3; | 695 | position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3; |
704 | 696 | ||
705 | if (HAS_PCH_SPLIT(dev)) { | 697 | if (HAS_DDI(dev)) { |
698 | /* | ||
699 | * On HSW HDMI outputs there seems to be a 2 line | ||
700 | * difference, whereas eDP has the normal 1 line | ||
701 | * difference that earlier platforms have. External | ||
702 | * DP is unknown. For now just check for the 2 line | ||
703 | * difference case on all output types on HSW+. | ||
704 | * | ||
705 | * This might misinterpret the scanline counter being | ||
706 | * one line too far along on eDP, but that's less | ||
707 | * dangerous than the alternative since that would lead | ||
708 | * the vblank timestamp code astray when it sees a | ||
709 | * scanline count before vblank_start during a vblank | ||
710 | * interrupt. | ||
711 | */ | ||
712 | in_vbl = ilk_pipe_in_vblank_locked(dev, pipe); | ||
713 | if ((in_vbl && (position == vbl_start - 2 || | ||
714 | position == vbl_start - 1)) || | ||
715 | (!in_vbl && (position == vbl_end - 2 || | ||
716 | position == vbl_end - 1))) | ||
717 | position = (position + 2) % vtotal; | ||
718 | } else if (HAS_PCH_SPLIT(dev)) { | ||
706 | /* | 719 | /* |
707 | * The scanline counter increments at the leading edge | 720 | * The scanline counter increments at the leading edge |
708 | * of hsync, ie. it completely misses the active portion | 721 | * of hsync, ie. it completely misses the active portion |
@@ -2769,10 +2782,9 @@ static void ibx_irq_postinstall(struct drm_device *dev) | |||
2769 | return; | 2782 | return; |
2770 | 2783 | ||
2771 | if (HAS_PCH_IBX(dev)) { | 2784 | if (HAS_PCH_IBX(dev)) { |
2772 | mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER | | 2785 | mask = SDE_GMBUS | SDE_AUX_MASK | SDE_POISON; |
2773 | SDE_TRANSA_FIFO_UNDER | SDE_POISON; | ||
2774 | } else { | 2786 | } else { |
2775 | mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT; | 2787 | mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT; |
2776 | 2788 | ||
2777 | I915_WRITE(SERR_INT, I915_READ(SERR_INT)); | 2789 | I915_WRITE(SERR_INT, I915_READ(SERR_INT)); |
2778 | } | 2790 | } |
@@ -2832,20 +2844,19 @@ static int ironlake_irq_postinstall(struct drm_device *dev) | |||
2832 | display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE_IVB | | 2844 | display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE_IVB | |
2833 | DE_PCH_EVENT_IVB | DE_PLANEC_FLIP_DONE_IVB | | 2845 | DE_PCH_EVENT_IVB | DE_PLANEC_FLIP_DONE_IVB | |
2834 | DE_PLANEB_FLIP_DONE_IVB | | 2846 | DE_PLANEB_FLIP_DONE_IVB | |
2835 | DE_PLANEA_FLIP_DONE_IVB | DE_AUX_CHANNEL_A_IVB | | 2847 | DE_PLANEA_FLIP_DONE_IVB | DE_AUX_CHANNEL_A_IVB); |
2836 | DE_ERR_INT_IVB); | ||
2837 | extra_mask = (DE_PIPEC_VBLANK_IVB | DE_PIPEB_VBLANK_IVB | | 2848 | extra_mask = (DE_PIPEC_VBLANK_IVB | DE_PIPEB_VBLANK_IVB | |
2838 | DE_PIPEA_VBLANK_IVB); | 2849 | DE_PIPEA_VBLANK_IVB | DE_ERR_INT_IVB); |
2839 | 2850 | ||
2840 | I915_WRITE(GEN7_ERR_INT, I915_READ(GEN7_ERR_INT)); | 2851 | I915_WRITE(GEN7_ERR_INT, I915_READ(GEN7_ERR_INT)); |
2841 | } else { | 2852 | } else { |
2842 | display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT | | 2853 | display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT | |
2843 | DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE | | 2854 | DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE | |
2844 | DE_AUX_CHANNEL_A | | 2855 | DE_AUX_CHANNEL_A | |
2845 | DE_PIPEB_FIFO_UNDERRUN | DE_PIPEA_FIFO_UNDERRUN | | ||
2846 | DE_PIPEB_CRC_DONE | DE_PIPEA_CRC_DONE | | 2856 | DE_PIPEB_CRC_DONE | DE_PIPEA_CRC_DONE | |
2847 | DE_POISON); | 2857 | DE_POISON); |
2848 | extra_mask = DE_PIPEA_VBLANK | DE_PIPEB_VBLANK | DE_PCU_EVENT; | 2858 | extra_mask = DE_PIPEA_VBLANK | DE_PIPEB_VBLANK | DE_PCU_EVENT | |
2859 | DE_PIPEB_FIFO_UNDERRUN | DE_PIPEA_FIFO_UNDERRUN; | ||
2849 | } | 2860 | } |
2850 | 2861 | ||
2851 | dev_priv->irq_mask = ~display_mask; | 2862 | dev_priv->irq_mask = ~display_mask; |
@@ -2961,9 +2972,9 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) | |||
2961 | struct drm_device *dev = dev_priv->dev; | 2972 | struct drm_device *dev = dev_priv->dev; |
2962 | uint32_t de_pipe_masked = GEN8_PIPE_FLIP_DONE | | 2973 | uint32_t de_pipe_masked = GEN8_PIPE_FLIP_DONE | |
2963 | GEN8_PIPE_CDCLK_CRC_DONE | | 2974 | GEN8_PIPE_CDCLK_CRC_DONE | |
2964 | GEN8_PIPE_FIFO_UNDERRUN | | ||
2965 | GEN8_DE_PIPE_IRQ_FAULT_ERRORS; | 2975 | GEN8_DE_PIPE_IRQ_FAULT_ERRORS; |
2966 | uint32_t de_pipe_enables = de_pipe_masked | GEN8_PIPE_VBLANK; | 2976 | uint32_t de_pipe_enables = de_pipe_masked | GEN8_PIPE_VBLANK | |
2977 | GEN8_PIPE_FIFO_UNDERRUN; | ||
2967 | int pipe; | 2978 | int pipe; |
2968 | dev_priv->de_irq_mask[PIPE_A] = ~de_pipe_masked; | 2979 | dev_priv->de_irq_mask[PIPE_A] = ~de_pipe_masked; |
2969 | dev_priv->de_irq_mask[PIPE_B] = ~de_pipe_masked; | 2980 | dev_priv->de_irq_mask[PIPE_B] = ~de_pipe_masked; |
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index e06b9e017d6b..234ac5f7bc5a 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -1244,6 +1244,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder) | |||
1244 | if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { | 1244 | if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { |
1245 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | 1245 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); |
1246 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); | 1246 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); |
1247 | ironlake_edp_panel_vdd_on(intel_dp); | ||
1247 | ironlake_edp_panel_off(intel_dp); | 1248 | ironlake_edp_panel_off(intel_dp); |
1248 | } | 1249 | } |
1249 | 1250 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 57552eb386b0..2688f6d64bb9 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -1249,17 +1249,24 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp) | |||
1249 | 1249 | ||
1250 | DRM_DEBUG_KMS("Turn eDP power off\n"); | 1250 | DRM_DEBUG_KMS("Turn eDP power off\n"); |
1251 | 1251 | ||
1252 | WARN(!intel_dp->want_panel_vdd, "Need VDD to turn off panel\n"); | ||
1253 | |||
1252 | pp = ironlake_get_pp_control(intel_dp); | 1254 | pp = ironlake_get_pp_control(intel_dp); |
1253 | /* We need to switch off panel power _and_ force vdd, for otherwise some | 1255 | /* We need to switch off panel power _and_ force vdd, for otherwise some |
1254 | * panels get very unhappy and cease to work. */ | 1256 | * panels get very unhappy and cease to work. */ |
1255 | pp &= ~(POWER_TARGET_ON | PANEL_POWER_RESET | EDP_BLC_ENABLE); | 1257 | pp &= ~(POWER_TARGET_ON | EDP_FORCE_VDD | PANEL_POWER_RESET | EDP_BLC_ENABLE); |
1256 | 1258 | ||
1257 | pp_ctrl_reg = _pp_ctrl_reg(intel_dp); | 1259 | pp_ctrl_reg = _pp_ctrl_reg(intel_dp); |
1258 | 1260 | ||
1259 | I915_WRITE(pp_ctrl_reg, pp); | 1261 | I915_WRITE(pp_ctrl_reg, pp); |
1260 | POSTING_READ(pp_ctrl_reg); | 1262 | POSTING_READ(pp_ctrl_reg); |
1261 | 1263 | ||
1264 | intel_dp->want_panel_vdd = false; | ||
1265 | |||
1262 | ironlake_wait_panel_off(intel_dp); | 1266 | ironlake_wait_panel_off(intel_dp); |
1267 | |||
1268 | /* We got a reference when we enabled the VDD. */ | ||
1269 | intel_runtime_pm_put(dev_priv); | ||
1263 | } | 1270 | } |
1264 | 1271 | ||
1265 | void ironlake_edp_backlight_on(struct intel_dp *intel_dp) | 1272 | void ironlake_edp_backlight_on(struct intel_dp *intel_dp) |
@@ -1639,7 +1646,7 @@ static void intel_edp_psr_enable_source(struct intel_dp *intel_dp) | |||
1639 | val |= EDP_PSR_LINK_DISABLE; | 1646 | val |= EDP_PSR_LINK_DISABLE; |
1640 | 1647 | ||
1641 | I915_WRITE(EDP_PSR_CTL(dev), val | | 1648 | I915_WRITE(EDP_PSR_CTL(dev), val | |
1642 | IS_BROADWELL(dev) ? 0 : link_entry_time | | 1649 | (IS_BROADWELL(dev) ? 0 : link_entry_time) | |
1643 | max_sleep_time << EDP_PSR_MAX_SLEEP_TIME_SHIFT | | 1650 | max_sleep_time << EDP_PSR_MAX_SLEEP_TIME_SHIFT | |
1644 | idle_frames << EDP_PSR_IDLE_FRAME_SHIFT | | 1651 | idle_frames << EDP_PSR_IDLE_FRAME_SHIFT | |
1645 | EDP_PSR_ENABLE); | 1652 | EDP_PSR_ENABLE); |
@@ -1784,6 +1791,7 @@ static void intel_disable_dp(struct intel_encoder *encoder) | |||
1784 | 1791 | ||
1785 | /* Make sure the panel is off before trying to change the mode. But also | 1792 | /* Make sure the panel is off before trying to change the mode. But also |
1786 | * ensure that we have vdd while we switch off the panel. */ | 1793 | * ensure that we have vdd while we switch off the panel. */ |
1794 | ironlake_edp_panel_vdd_on(intel_dp); | ||
1787 | ironlake_edp_backlight_off(intel_dp); | 1795 | ironlake_edp_backlight_off(intel_dp); |
1788 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); | 1796 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); |
1789 | ironlake_edp_panel_off(intel_dp); | 1797 | ironlake_edp_panel_off(intel_dp); |
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index befe0e336471..24883b4d1a49 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #define G25_REV_MIN 0x22 | 43 | #define G25_REV_MIN 0x22 |
44 | #define G27_REV_MAJ 0x12 | 44 | #define G27_REV_MAJ 0x12 |
45 | #define G27_REV_MIN 0x38 | 45 | #define G27_REV_MIN 0x38 |
46 | #define G27_2_REV_MIN 0x39 | ||
46 | 47 | ||
47 | #define to_hid_device(pdev) container_of(pdev, struct hid_device, dev) | 48 | #define to_hid_device(pdev) container_of(pdev, struct hid_device, dev) |
48 | 49 | ||
@@ -130,6 +131,7 @@ static const struct lg4ff_usb_revision lg4ff_revs[] = { | |||
130 | {DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */ | 131 | {DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */ |
131 | {G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */ | 132 | {G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */ |
132 | {G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */ | 133 | {G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */ |
134 | {G27_REV_MAJ, G27_2_REV_MIN, &native_g27}, /* G27 v2 */ | ||
133 | }; | 135 | }; |
134 | 136 | ||
135 | /* Recalculates X axis value accordingly to currently selected range */ | 137 | /* Recalculates X axis value accordingly to currently selected range */ |
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 12354055d474..2f19b15f47f2 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #define DUALSHOCK4_CONTROLLER_BT BIT(6) | 42 | #define DUALSHOCK4_CONTROLLER_BT BIT(6) |
43 | 43 | ||
44 | #define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER_USB | BUZZ_CONTROLLER | DUALSHOCK4_CONTROLLER_USB) | 44 | #define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER_USB | BUZZ_CONTROLLER | DUALSHOCK4_CONTROLLER_USB) |
45 | #define SONY_FF_SUPPORT (SIXAXIS_CONTROLLER_USB | DUALSHOCK4_CONTROLLER_USB) | ||
45 | 46 | ||
46 | #define MAX_LEDS 4 | 47 | #define MAX_LEDS 4 |
47 | 48 | ||
@@ -499,6 +500,7 @@ struct sony_sc { | |||
499 | __u8 right; | 500 | __u8 right; |
500 | #endif | 501 | #endif |
501 | 502 | ||
503 | __u8 worker_initialized; | ||
502 | __u8 led_state[MAX_LEDS]; | 504 | __u8 led_state[MAX_LEDS]; |
503 | __u8 led_count; | 505 | __u8 led_count; |
504 | }; | 506 | }; |
@@ -993,22 +995,11 @@ static int sony_init_ff(struct hid_device *hdev) | |||
993 | return input_ff_create_memless(input_dev, NULL, sony_play_effect); | 995 | return input_ff_create_memless(input_dev, NULL, sony_play_effect); |
994 | } | 996 | } |
995 | 997 | ||
996 | static void sony_destroy_ff(struct hid_device *hdev) | ||
997 | { | ||
998 | struct sony_sc *sc = hid_get_drvdata(hdev); | ||
999 | |||
1000 | cancel_work_sync(&sc->state_worker); | ||
1001 | } | ||
1002 | |||
1003 | #else | 998 | #else |
1004 | static int sony_init_ff(struct hid_device *hdev) | 999 | static int sony_init_ff(struct hid_device *hdev) |
1005 | { | 1000 | { |
1006 | return 0; | 1001 | return 0; |
1007 | } | 1002 | } |
1008 | |||
1009 | static void sony_destroy_ff(struct hid_device *hdev) | ||
1010 | { | ||
1011 | } | ||
1012 | #endif | 1003 | #endif |
1013 | 1004 | ||
1014 | static int sony_set_output_report(struct sony_sc *sc, int req_id, int req_size) | 1005 | static int sony_set_output_report(struct sony_sc *sc, int req_id, int req_size) |
@@ -1077,6 +1068,8 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1077 | if (sc->quirks & SIXAXIS_CONTROLLER_USB) { | 1068 | if (sc->quirks & SIXAXIS_CONTROLLER_USB) { |
1078 | hdev->hid_output_raw_report = sixaxis_usb_output_raw_report; | 1069 | hdev->hid_output_raw_report = sixaxis_usb_output_raw_report; |
1079 | ret = sixaxis_set_operational_usb(hdev); | 1070 | ret = sixaxis_set_operational_usb(hdev); |
1071 | |||
1072 | sc->worker_initialized = 1; | ||
1080 | INIT_WORK(&sc->state_worker, sixaxis_state_worker); | 1073 | INIT_WORK(&sc->state_worker, sixaxis_state_worker); |
1081 | } | 1074 | } |
1082 | else if (sc->quirks & SIXAXIS_CONTROLLER_BT) | 1075 | else if (sc->quirks & SIXAXIS_CONTROLLER_BT) |
@@ -1087,6 +1080,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1087 | if (ret < 0) | 1080 | if (ret < 0) |
1088 | goto err_stop; | 1081 | goto err_stop; |
1089 | 1082 | ||
1083 | sc->worker_initialized = 1; | ||
1090 | INIT_WORK(&sc->state_worker, dualshock4_state_worker); | 1084 | INIT_WORK(&sc->state_worker, dualshock4_state_worker); |
1091 | } else { | 1085 | } else { |
1092 | ret = 0; | 1086 | ret = 0; |
@@ -1101,9 +1095,11 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1101 | goto err_stop; | 1095 | goto err_stop; |
1102 | } | 1096 | } |
1103 | 1097 | ||
1104 | ret = sony_init_ff(hdev); | 1098 | if (sc->quirks & SONY_FF_SUPPORT) { |
1105 | if (ret < 0) | 1099 | ret = sony_init_ff(hdev); |
1106 | goto err_stop; | 1100 | if (ret < 0) |
1101 | goto err_stop; | ||
1102 | } | ||
1107 | 1103 | ||
1108 | return 0; | 1104 | return 0; |
1109 | err_stop: | 1105 | err_stop: |
@@ -1120,7 +1116,8 @@ static void sony_remove(struct hid_device *hdev) | |||
1120 | if (sc->quirks & SONY_LED_SUPPORT) | 1116 | if (sc->quirks & SONY_LED_SUPPORT) |
1121 | sony_leds_remove(hdev); | 1117 | sony_leds_remove(hdev); |
1122 | 1118 | ||
1123 | sony_destroy_ff(hdev); | 1119 | if (sc->worker_initialized) |
1120 | cancel_work_sync(&sc->state_worker); | ||
1124 | 1121 | ||
1125 | hid_hw_stop(hdev); | 1122 | hid_hw_stop(hdev); |
1126 | } | 1123 | } |
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index cb0137b3718d..ab24ce2eb28f 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
@@ -320,13 +320,13 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit) | |||
320 | hid_hw_close(hidraw->hid); | 320 | hid_hw_close(hidraw->hid); |
321 | wake_up_interruptible(&hidraw->wait); | 321 | wake_up_interruptible(&hidraw->wait); |
322 | } | 322 | } |
323 | device_destroy(hidraw_class, | ||
324 | MKDEV(hidraw_major, hidraw->minor)); | ||
323 | } else { | 325 | } else { |
324 | --hidraw->open; | 326 | --hidraw->open; |
325 | } | 327 | } |
326 | if (!hidraw->open) { | 328 | if (!hidraw->open) { |
327 | if (!hidraw->exist) { | 329 | if (!hidraw->exist) { |
328 | device_destroy(hidraw_class, | ||
329 | MKDEV(hidraw_major, hidraw->minor)); | ||
330 | hidraw_table[hidraw->minor] = NULL; | 330 | hidraw_table[hidraw->minor] = NULL; |
331 | kfree(hidraw); | 331 | kfree(hidraw); |
332 | } else { | 332 | } else { |
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 1f375051483a..5642a9b250c2 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -325,7 +325,7 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc) | |||
325 | if (!abrt_task->sc || abrt_task->state == ISCSI_TASK_FREE) | 325 | if (!abrt_task->sc || abrt_task->state == ISCSI_TASK_FREE) |
326 | continue; | 326 | continue; |
327 | 327 | ||
328 | if (abrt_task->sc->device->lun != abrt_task->sc->device->lun) | 328 | if (sc->device->lun != abrt_task->sc->device->lun) |
329 | continue; | 329 | continue; |
330 | 330 | ||
331 | /* Invalidate WRB Posted for this Task */ | 331 | /* Invalidate WRB Posted for this Task */ |
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index 4911310a38f5..22a9bb1abae1 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h | |||
@@ -311,9 +311,8 @@ static inline struct Scsi_Host *to_shost(struct isci_host *ihost) | |||
311 | } | 311 | } |
312 | 312 | ||
313 | #define for_each_isci_host(id, ihost, pdev) \ | 313 | #define for_each_isci_host(id, ihost, pdev) \ |
314 | for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ | 314 | for (id = 0; id < SCI_MAX_CONTROLLERS && \ |
315 | id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ | 315 | (ihost = to_pci_info(pdev)->hosts[id]); id++) |
316 | ihost = to_pci_info(pdev)->hosts[++id]) | ||
317 | 316 | ||
318 | static inline void wait_for_start(struct isci_host *ihost) | 317 | static inline void wait_for_start(struct isci_host *ihost) |
319 | { | 318 | { |
diff --git a/drivers/scsi/isci/port_config.c b/drivers/scsi/isci/port_config.c index 85c77f6b802b..ac879745ef80 100644 --- a/drivers/scsi/isci/port_config.c +++ b/drivers/scsi/isci/port_config.c | |||
@@ -615,13 +615,6 @@ static void sci_apc_agent_link_up(struct isci_host *ihost, | |||
615 | SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION); | 615 | SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION); |
616 | } else { | 616 | } else { |
617 | /* the phy is already the part of the port */ | 617 | /* the phy is already the part of the port */ |
618 | u32 port_state = iport->sm.current_state_id; | ||
619 | |||
620 | /* if the PORT'S state is resetting then the link up is from | ||
621 | * port hard reset in this case, we need to tell the port | ||
622 | * that link up is recieved | ||
623 | */ | ||
624 | BUG_ON(port_state != SCI_PORT_RESETTING); | ||
625 | port_agent->phy_ready_mask |= 1 << phy_index; | 618 | port_agent->phy_ready_mask |= 1 << phy_index; |
626 | sci_port_link_up(iport, iphy); | 619 | sci_port_link_up(iport, iphy); |
627 | } | 620 | } |
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index 0d30ca849e8f..5d6fda72d659 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
@@ -801,7 +801,7 @@ int isci_task_I_T_nexus_reset(struct domain_device *dev) | |||
801 | /* XXX: need to cleanup any ireqs targeting this | 801 | /* XXX: need to cleanup any ireqs targeting this |
802 | * domain_device | 802 | * domain_device |
803 | */ | 803 | */ |
804 | ret = TMF_RESP_FUNC_COMPLETE; | 804 | ret = -ENODEV; |
805 | goto out; | 805 | goto out; |
806 | } | 806 | } |
807 | 807 | ||
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index e1fe95ef23e1..266724b6b899 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2996,8 +2996,7 @@ struct qla_hw_data { | |||
2996 | IS_QLA82XX(ha) || IS_QLA83XX(ha) || \ | 2996 | IS_QLA82XX(ha) || IS_QLA83XX(ha) || \ |
2997 | IS_QLA8044(ha)) | 2997 | IS_QLA8044(ha)) |
2998 | #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) | 2998 | #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
2999 | #define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha) || \ | 2999 | #define IS_NOPOLLING_TYPE(ha) (IS_QLA81XX(ha) && (ha)->flags.msix_enabled) |
3000 | IS_QLA83XX(ha)) && (ha)->flags.msix_enabled) | ||
3001 | #define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) | 3000 | #define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
3002 | #define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) | 3001 | #define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
3003 | #define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha)) | 3002 | #define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha)) |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 9bc86b9e86b1..0a1dcb43d18b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -2880,6 +2880,7 @@ static int | |||
2880 | qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) | 2880 | qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) |
2881 | { | 2881 | { |
2882 | #define MIN_MSIX_COUNT 2 | 2882 | #define MIN_MSIX_COUNT 2 |
2883 | #define ATIO_VECTOR 2 | ||
2883 | int i, ret; | 2884 | int i, ret; |
2884 | struct msix_entry *entries; | 2885 | struct msix_entry *entries; |
2885 | struct qla_msix_entry *qentry; | 2886 | struct qla_msix_entry *qentry; |
@@ -2936,34 +2937,47 @@ msix_failed: | |||
2936 | } | 2937 | } |
2937 | 2938 | ||
2938 | /* Enable MSI-X vectors for the base queue */ | 2939 | /* Enable MSI-X vectors for the base queue */ |
2939 | for (i = 0; i < ha->msix_count; i++) { | 2940 | for (i = 0; i < 2; i++) { |
2940 | qentry = &ha->msix_entries[i]; | 2941 | qentry = &ha->msix_entries[i]; |
2941 | if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { | 2942 | if (IS_P3P_TYPE(ha)) |
2942 | ret = request_irq(qentry->vector, | ||
2943 | qla83xx_msix_entries[i].handler, | ||
2944 | 0, qla83xx_msix_entries[i].name, rsp); | ||
2945 | } else if (IS_P3P_TYPE(ha)) { | ||
2946 | ret = request_irq(qentry->vector, | 2943 | ret = request_irq(qentry->vector, |
2947 | qla82xx_msix_entries[i].handler, | 2944 | qla82xx_msix_entries[i].handler, |
2948 | 0, qla82xx_msix_entries[i].name, rsp); | 2945 | 0, qla82xx_msix_entries[i].name, rsp); |
2949 | } else { | 2946 | else |
2950 | ret = request_irq(qentry->vector, | 2947 | ret = request_irq(qentry->vector, |
2951 | msix_entries[i].handler, | 2948 | msix_entries[i].handler, |
2952 | 0, msix_entries[i].name, rsp); | 2949 | 0, msix_entries[i].name, rsp); |
2953 | } | 2950 | if (ret) |
2954 | if (ret) { | 2951 | goto msix_register_fail; |
2955 | ql_log(ql_log_fatal, vha, 0x00cb, | ||
2956 | "MSI-X: unable to register handler -- %x/%d.\n", | ||
2957 | qentry->vector, ret); | ||
2958 | qla24xx_disable_msix(ha); | ||
2959 | ha->mqenable = 0; | ||
2960 | goto msix_out; | ||
2961 | } | ||
2962 | qentry->have_irq = 1; | 2952 | qentry->have_irq = 1; |
2963 | qentry->rsp = rsp; | 2953 | qentry->rsp = rsp; |
2964 | rsp->msix = qentry; | 2954 | rsp->msix = qentry; |
2965 | } | 2955 | } |
2966 | 2956 | ||
2957 | /* | ||
2958 | * If target mode is enable, also request the vector for the ATIO | ||
2959 | * queue. | ||
2960 | */ | ||
2961 | if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { | ||
2962 | qentry = &ha->msix_entries[ATIO_VECTOR]; | ||
2963 | ret = request_irq(qentry->vector, | ||
2964 | qla83xx_msix_entries[ATIO_VECTOR].handler, | ||
2965 | 0, qla83xx_msix_entries[ATIO_VECTOR].name, rsp); | ||
2966 | qentry->have_irq = 1; | ||
2967 | qentry->rsp = rsp; | ||
2968 | rsp->msix = qentry; | ||
2969 | } | ||
2970 | |||
2971 | msix_register_fail: | ||
2972 | if (ret) { | ||
2973 | ql_log(ql_log_fatal, vha, 0x00cb, | ||
2974 | "MSI-X: unable to register handler -- %x/%d.\n", | ||
2975 | qentry->vector, ret); | ||
2976 | qla24xx_disable_msix(ha); | ||
2977 | ha->mqenable = 0; | ||
2978 | goto msix_out; | ||
2979 | } | ||
2980 | |||
2967 | /* Enable MSI-X vector for response queue update for queue 0 */ | 2981 | /* Enable MSI-X vector for response queue update for queue 0 */ |
2968 | if (IS_QLA83XX(ha)) { | 2982 | if (IS_QLA83XX(ha)) { |
2969 | if (ha->msixbase && ha->mqiobase && | 2983 | if (ha->msixbase && ha->mqiobase && |
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 17d740427240..9969fa1ef7c4 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c | |||
@@ -1419,6 +1419,9 @@ static void storvsc_device_destroy(struct scsi_device *sdevice) | |||
1419 | { | 1419 | { |
1420 | struct stor_mem_pools *memp = sdevice->hostdata; | 1420 | struct stor_mem_pools *memp = sdevice->hostdata; |
1421 | 1421 | ||
1422 | if (!memp) | ||
1423 | return; | ||
1424 | |||
1422 | mempool_destroy(memp->request_mempool); | 1425 | mempool_destroy(memp->request_mempool); |
1423 | kmem_cache_destroy(memp->request_pool); | 1426 | kmem_cache_destroy(memp->request_pool); |
1424 | kfree(memp); | 1427 | kfree(memp); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 4e4cc28623ad..4cdb3a17bcb5 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -495,10 +495,6 @@ enum { | |||
495 | FILTER_TRACE_FN, | 495 | FILTER_TRACE_FN, |
496 | }; | 496 | }; |
497 | 497 | ||
498 | #define EVENT_STORAGE_SIZE 128 | ||
499 | extern struct mutex event_storage_mutex; | ||
500 | extern char event_storage[EVENT_STORAGE_SIZE]; | ||
501 | |||
502 | extern int trace_event_raw_init(struct ftrace_event_call *call); | 498 | extern int trace_event_raw_init(struct ftrace_event_call *call); |
503 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | 499 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, |
504 | const char *name, int offset, int size, | 500 | const char *name, int offset, int size, |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 1da693d51255..b66c2110cb1f 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -250,8 +250,7 @@ struct rmap_walk_control { | |||
250 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, | 250 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, |
251 | unsigned long addr, void *arg); | 251 | unsigned long addr, void *arg); |
252 | int (*done)(struct page *page); | 252 | int (*done)(struct page *page); |
253 | int (*file_nonlinear)(struct page *, struct address_space *, | 253 | int (*file_nonlinear)(struct page *, struct address_space *, void *arg); |
254 | struct vm_area_struct *vma); | ||
255 | struct anon_vma *(*anon_lock)(struct page *page); | 254 | struct anon_vma *(*anon_lock)(struct page *page); |
256 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); | 255 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); |
257 | }; | 256 | }; |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 1a8b28db3775..1ee19a24cc5f 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -310,15 +310,12 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \ | |||
310 | #undef __array | 310 | #undef __array |
311 | #define __array(type, item, len) \ | 311 | #define __array(type, item, len) \ |
312 | do { \ | 312 | do { \ |
313 | mutex_lock(&event_storage_mutex); \ | 313 | char *type_str = #type"["__stringify(len)"]"; \ |
314 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 314 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
315 | snprintf(event_storage, sizeof(event_storage), \ | 315 | ret = trace_define_field(event_call, type_str, #item, \ |
316 | "%s[%d]", #type, len); \ | ||
317 | ret = trace_define_field(event_call, event_storage, #item, \ | ||
318 | offsetof(typeof(field), item), \ | 316 | offsetof(typeof(field), item), \ |
319 | sizeof(field.item), \ | 317 | sizeof(field.item), \ |
320 | is_signed_type(type), FILTER_OTHER); \ | 318 | is_signed_type(type), FILTER_OTHER); \ |
321 | mutex_unlock(&event_storage_mutex); \ | ||
322 | if (ret) \ | 319 | if (ret) \ |
323 | return ret; \ | 320 | return ret; \ |
324 | } while (0); | 321 | } while (0); |
@@ -901,6 +901,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl | |||
901 | return -EINVAL; | 901 | return -EINVAL; |
902 | 902 | ||
903 | if (msgflg & MSG_COPY) { | 903 | if (msgflg & MSG_COPY) { |
904 | if ((msgflg & MSG_EXCEPT) || !(msgflg & IPC_NOWAIT)) | ||
905 | return -EINVAL; | ||
904 | copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax)); | 906 | copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax)); |
905 | if (IS_ERR(copy)) | 907 | if (IS_ERR(copy)) |
906 | return PTR_ERR(copy); | 908 | return PTR_ERR(copy); |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 105f273b6f86..0c753ddd223b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -4112,17 +4112,17 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss) | |||
4112 | 4112 | ||
4113 | err = percpu_ref_init(&css->refcnt, css_release); | 4113 | err = percpu_ref_init(&css->refcnt, css_release); |
4114 | if (err) | 4114 | if (err) |
4115 | goto err_free; | 4115 | goto err_free_css; |
4116 | 4116 | ||
4117 | init_css(css, ss, cgrp); | 4117 | init_css(css, ss, cgrp); |
4118 | 4118 | ||
4119 | err = cgroup_populate_dir(cgrp, 1 << ss->subsys_id); | 4119 | err = cgroup_populate_dir(cgrp, 1 << ss->subsys_id); |
4120 | if (err) | 4120 | if (err) |
4121 | goto err_free; | 4121 | goto err_free_percpu_ref; |
4122 | 4122 | ||
4123 | err = online_css(css); | 4123 | err = online_css(css); |
4124 | if (err) | 4124 | if (err) |
4125 | goto err_free; | 4125 | goto err_clear_dir; |
4126 | 4126 | ||
4127 | dget(cgrp->dentry); | 4127 | dget(cgrp->dentry); |
4128 | css_get(css->parent); | 4128 | css_get(css->parent); |
@@ -4138,8 +4138,11 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss) | |||
4138 | 4138 | ||
4139 | return 0; | 4139 | return 0; |
4140 | 4140 | ||
4141 | err_free: | 4141 | err_clear_dir: |
4142 | cgroup_clear_dir(css->cgroup, 1 << css->ss->subsys_id); | ||
4143 | err_free_percpu_ref: | ||
4142 | percpu_ref_cancel_init(&css->refcnt); | 4144 | percpu_ref_cancel_init(&css->refcnt); |
4145 | err_free_css: | ||
4143 | ss->css_free(css); | 4146 | ss->css_free(css); |
4144 | return err; | 4147 | return err; |
4145 | } | 4148 | } |
diff --git a/kernel/futex.c b/kernel/futex.c index 44a1261cb9ff..08ec814ad9d2 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -234,6 +234,7 @@ static const struct futex_q futex_q_init = { | |||
234 | * waiting on a futex. | 234 | * waiting on a futex. |
235 | */ | 235 | */ |
236 | struct futex_hash_bucket { | 236 | struct futex_hash_bucket { |
237 | atomic_t waiters; | ||
237 | spinlock_t lock; | 238 | spinlock_t lock; |
238 | struct plist_head chain; | 239 | struct plist_head chain; |
239 | } ____cacheline_aligned_in_smp; | 240 | } ____cacheline_aligned_in_smp; |
@@ -253,22 +254,37 @@ static inline void futex_get_mm(union futex_key *key) | |||
253 | smp_mb__after_atomic_inc(); | 254 | smp_mb__after_atomic_inc(); |
254 | } | 255 | } |
255 | 256 | ||
256 | static inline bool hb_waiters_pending(struct futex_hash_bucket *hb) | 257 | /* |
258 | * Reflects a new waiter being added to the waitqueue. | ||
259 | */ | ||
260 | static inline void hb_waiters_inc(struct futex_hash_bucket *hb) | ||
257 | { | 261 | { |
258 | #ifdef CONFIG_SMP | 262 | #ifdef CONFIG_SMP |
263 | atomic_inc(&hb->waiters); | ||
259 | /* | 264 | /* |
260 | * Tasks trying to enter the critical region are most likely | 265 | * Full barrier (A), see the ordering comment above. |
261 | * potential waiters that will be added to the plist. Ensure | ||
262 | * that wakers won't miss to-be-slept tasks in the window between | ||
263 | * the wait call and the actual plist_add. | ||
264 | */ | 266 | */ |
265 | if (spin_is_locked(&hb->lock)) | 267 | smp_mb__after_atomic_inc(); |
266 | return true; | 268 | #endif |
267 | smp_rmb(); /* Make sure we check the lock state first */ | 269 | } |
270 | |||
271 | /* | ||
272 | * Reflects a waiter being removed from the waitqueue by wakeup | ||
273 | * paths. | ||
274 | */ | ||
275 | static inline void hb_waiters_dec(struct futex_hash_bucket *hb) | ||
276 | { | ||
277 | #ifdef CONFIG_SMP | ||
278 | atomic_dec(&hb->waiters); | ||
279 | #endif | ||
280 | } | ||
268 | 281 | ||
269 | return !plist_head_empty(&hb->chain); | 282 | static inline int hb_waiters_pending(struct futex_hash_bucket *hb) |
283 | { | ||
284 | #ifdef CONFIG_SMP | ||
285 | return atomic_read(&hb->waiters); | ||
270 | #else | 286 | #else |
271 | return true; | 287 | return 1; |
272 | #endif | 288 | #endif |
273 | } | 289 | } |
274 | 290 | ||
@@ -954,6 +970,7 @@ static void __unqueue_futex(struct futex_q *q) | |||
954 | 970 | ||
955 | hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock); | 971 | hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock); |
956 | plist_del(&q->list, &hb->chain); | 972 | plist_del(&q->list, &hb->chain); |
973 | hb_waiters_dec(hb); | ||
957 | } | 974 | } |
958 | 975 | ||
959 | /* | 976 | /* |
@@ -1257,7 +1274,9 @@ void requeue_futex(struct futex_q *q, struct futex_hash_bucket *hb1, | |||
1257 | */ | 1274 | */ |
1258 | if (likely(&hb1->chain != &hb2->chain)) { | 1275 | if (likely(&hb1->chain != &hb2->chain)) { |
1259 | plist_del(&q->list, &hb1->chain); | 1276 | plist_del(&q->list, &hb1->chain); |
1277 | hb_waiters_dec(hb1); | ||
1260 | plist_add(&q->list, &hb2->chain); | 1278 | plist_add(&q->list, &hb2->chain); |
1279 | hb_waiters_inc(hb2); | ||
1261 | q->lock_ptr = &hb2->lock; | 1280 | q->lock_ptr = &hb2->lock; |
1262 | } | 1281 | } |
1263 | get_futex_key_refs(key2); | 1282 | get_futex_key_refs(key2); |
@@ -1600,6 +1619,17 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q) | |||
1600 | struct futex_hash_bucket *hb; | 1619 | struct futex_hash_bucket *hb; |
1601 | 1620 | ||
1602 | hb = hash_futex(&q->key); | 1621 | hb = hash_futex(&q->key); |
1622 | |||
1623 | /* | ||
1624 | * Increment the counter before taking the lock so that | ||
1625 | * a potential waker won't miss a to-be-slept task that is | ||
1626 | * waiting for the spinlock. This is safe as all queue_lock() | ||
1627 | * users end up calling queue_me(). Similarly, for housekeeping, | ||
1628 | * decrement the counter at queue_unlock() when some error has | ||
1629 | * occurred and we don't end up adding the task to the list. | ||
1630 | */ | ||
1631 | hb_waiters_inc(hb); | ||
1632 | |||
1603 | q->lock_ptr = &hb->lock; | 1633 | q->lock_ptr = &hb->lock; |
1604 | 1634 | ||
1605 | spin_lock(&hb->lock); /* implies MB (A) */ | 1635 | spin_lock(&hb->lock); /* implies MB (A) */ |
@@ -1611,6 +1641,7 @@ queue_unlock(struct futex_hash_bucket *hb) | |||
1611 | __releases(&hb->lock) | 1641 | __releases(&hb->lock) |
1612 | { | 1642 | { |
1613 | spin_unlock(&hb->lock); | 1643 | spin_unlock(&hb->lock); |
1644 | hb_waiters_dec(hb); | ||
1614 | } | 1645 | } |
1615 | 1646 | ||
1616 | /** | 1647 | /** |
@@ -2342,6 +2373,7 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb, | |||
2342 | * Unqueue the futex_q and determine which it was. | 2373 | * Unqueue the futex_q and determine which it was. |
2343 | */ | 2374 | */ |
2344 | plist_del(&q->list, &hb->chain); | 2375 | plist_del(&q->list, &hb->chain); |
2376 | hb_waiters_dec(hb); | ||
2345 | 2377 | ||
2346 | /* Handle spurious wakeups gracefully */ | 2378 | /* Handle spurious wakeups gracefully */ |
2347 | ret = -EWOULDBLOCK; | 2379 | ret = -EWOULDBLOCK; |
@@ -2875,6 +2907,7 @@ static int __init futex_init(void) | |||
2875 | futex_cmpxchg_enabled = 1; | 2907 | futex_cmpxchg_enabled = 1; |
2876 | 2908 | ||
2877 | for (i = 0; i < futex_hashsize; i++) { | 2909 | for (i = 0; i < futex_hashsize; i++) { |
2910 | atomic_set(&futex_queues[i].waiters, 0); | ||
2878 | plist_head_init(&futex_queues[i].chain); | 2911 | plist_head_init(&futex_queues[i].chain); |
2879 | spin_lock_init(&futex_queues[i].lock); | 2912 | spin_lock_init(&futex_queues[i].lock); |
2880 | } | 2913 | } |
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c index 43c2bcc35761..b30a2924ef14 100644 --- a/kernel/sched/clock.c +++ b/kernel/sched/clock.c | |||
@@ -301,14 +301,14 @@ u64 sched_clock_cpu(int cpu) | |||
301 | if (unlikely(!sched_clock_running)) | 301 | if (unlikely(!sched_clock_running)) |
302 | return 0ull; | 302 | return 0ull; |
303 | 303 | ||
304 | preempt_disable(); | 304 | preempt_disable_notrace(); |
305 | scd = cpu_sdc(cpu); | 305 | scd = cpu_sdc(cpu); |
306 | 306 | ||
307 | if (cpu != smp_processor_id()) | 307 | if (cpu != smp_processor_id()) |
308 | clock = sched_clock_remote(scd); | 308 | clock = sched_clock_remote(scd); |
309 | else | 309 | else |
310 | clock = sched_clock_local(scd); | 310 | clock = sched_clock_local(scd); |
311 | preempt_enable(); | 311 | preempt_enable_notrace(); |
312 | 312 | ||
313 | return clock; | 313 | return clock; |
314 | } | 314 | } |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 6edbef296ece..f5c6635b806c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -3338,6 +3338,15 @@ recheck: | |||
3338 | return -EPERM; | 3338 | return -EPERM; |
3339 | } | 3339 | } |
3340 | 3340 | ||
3341 | /* | ||
3342 | * Can't set/change SCHED_DEADLINE policy at all for now | ||
3343 | * (safest behavior); in the future we would like to allow | ||
3344 | * unprivileged DL tasks to increase their relative deadline | ||
3345 | * or reduce their runtime (both ways reducing utilization) | ||
3346 | */ | ||
3347 | if (dl_policy(policy)) | ||
3348 | return -EPERM; | ||
3349 | |||
3341 | /* | 3350 | /* |
3342 | * Treat SCHED_IDLE as nice 20. Only allow a switch to | 3351 | * Treat SCHED_IDLE as nice 20. Only allow a switch to |
3343 | * SCHED_NORMAL if the RLIMIT_NICE would normally permit it. | 3352 | * SCHED_NORMAL if the RLIMIT_NICE would normally permit it. |
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 84571e09c907..01fbae5b97b7 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c | |||
@@ -293,7 +293,7 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void * | |||
293 | */ | 293 | */ |
294 | smp_call_function_single(min(cpu1, cpu2), | 294 | smp_call_function_single(min(cpu1, cpu2), |
295 | &irq_cpu_stop_queue_work, | 295 | &irq_cpu_stop_queue_work, |
296 | &call_args, 0); | 296 | &call_args, 1); |
297 | lg_local_unlock(&stop_cpus_lock); | 297 | lg_local_unlock(&stop_cpus_lock); |
298 | preempt_enable(); | 298 | preempt_enable(); |
299 | 299 | ||
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f3989ceb5cd5..7b16d40bd64d 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -27,12 +27,6 @@ | |||
27 | 27 | ||
28 | DEFINE_MUTEX(event_mutex); | 28 | DEFINE_MUTEX(event_mutex); |
29 | 29 | ||
30 | DEFINE_MUTEX(event_storage_mutex); | ||
31 | EXPORT_SYMBOL_GPL(event_storage_mutex); | ||
32 | |||
33 | char event_storage[EVENT_STORAGE_SIZE]; | ||
34 | EXPORT_SYMBOL_GPL(event_storage); | ||
35 | |||
36 | LIST_HEAD(ftrace_events); | 30 | LIST_HEAD(ftrace_events); |
37 | static LIST_HEAD(ftrace_common_fields); | 31 | static LIST_HEAD(ftrace_common_fields); |
38 | 32 | ||
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 7c3e3e72e2b6..ee0a5098ac43 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -95,15 +95,12 @@ static void __always_unused ____ftrace_check_##name(void) \ | |||
95 | #undef __array | 95 | #undef __array |
96 | #define __array(type, item, len) \ | 96 | #define __array(type, item, len) \ |
97 | do { \ | 97 | do { \ |
98 | char *type_str = #type"["__stringify(len)"]"; \ | ||
98 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 99 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
99 | mutex_lock(&event_storage_mutex); \ | 100 | ret = trace_define_field(event_call, type_str, #item, \ |
100 | snprintf(event_storage, sizeof(event_storage), \ | ||
101 | "%s[%d]", #type, len); \ | ||
102 | ret = trace_define_field(event_call, event_storage, #item, \ | ||
103 | offsetof(typeof(field), item), \ | 101 | offsetof(typeof(field), item), \ |
104 | sizeof(field.item), \ | 102 | sizeof(field.item), \ |
105 | is_signed_type(type), filter_type); \ | 103 | is_signed_type(type), filter_type); \ |
106 | mutex_unlock(&event_storage_mutex); \ | ||
107 | if (ret) \ | 104 | if (ret) \ |
108 | return ret; \ | 105 | return ret; \ |
109 | } while (0); | 106 | } while (0); |
diff --git a/mm/fremap.c b/mm/fremap.c index bbc4d660221a..34feba60a17e 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -23,28 +23,44 @@ | |||
23 | 23 | ||
24 | #include "internal.h" | 24 | #include "internal.h" |
25 | 25 | ||
26 | static int mm_counter(struct page *page) | ||
27 | { | ||
28 | return PageAnon(page) ? MM_ANONPAGES : MM_FILEPAGES; | ||
29 | } | ||
30 | |||
26 | static void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma, | 31 | static void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma, |
27 | unsigned long addr, pte_t *ptep) | 32 | unsigned long addr, pte_t *ptep) |
28 | { | 33 | { |
29 | pte_t pte = *ptep; | 34 | pte_t pte = *ptep; |
35 | struct page *page; | ||
36 | swp_entry_t entry; | ||
30 | 37 | ||
31 | if (pte_present(pte)) { | 38 | if (pte_present(pte)) { |
32 | struct page *page; | ||
33 | |||
34 | flush_cache_page(vma, addr, pte_pfn(pte)); | 39 | flush_cache_page(vma, addr, pte_pfn(pte)); |
35 | pte = ptep_clear_flush(vma, addr, ptep); | 40 | pte = ptep_clear_flush(vma, addr, ptep); |
36 | page = vm_normal_page(vma, addr, pte); | 41 | page = vm_normal_page(vma, addr, pte); |
37 | if (page) { | 42 | if (page) { |
38 | if (pte_dirty(pte)) | 43 | if (pte_dirty(pte)) |
39 | set_page_dirty(page); | 44 | set_page_dirty(page); |
45 | update_hiwater_rss(mm); | ||
46 | dec_mm_counter(mm, mm_counter(page)); | ||
40 | page_remove_rmap(page); | 47 | page_remove_rmap(page); |
41 | page_cache_release(page); | 48 | page_cache_release(page); |
49 | } | ||
50 | } else { /* zap_pte() is not called when pte_none() */ | ||
51 | if (!pte_file(pte)) { | ||
42 | update_hiwater_rss(mm); | 52 | update_hiwater_rss(mm); |
43 | dec_mm_counter(mm, MM_FILEPAGES); | 53 | entry = pte_to_swp_entry(pte); |
54 | if (non_swap_entry(entry)) { | ||
55 | if (is_migration_entry(entry)) { | ||
56 | page = migration_entry_to_page(entry); | ||
57 | dec_mm_counter(mm, mm_counter(page)); | ||
58 | } | ||
59 | } else { | ||
60 | free_swap_and_cache(entry); | ||
61 | dec_mm_counter(mm, MM_SWAPENTS); | ||
62 | } | ||
44 | } | 63 | } |
45 | } else { | ||
46 | if (!pte_file(pte)) | ||
47 | free_swap_and_cache(pte_to_swp_entry(pte)); | ||
48 | pte_clear_not_present_full(mm, addr, ptep, 0); | 64 | pte_clear_not_present_full(mm, addr, ptep, 0); |
49 | } | 65 | } |
50 | } | 66 | } |
diff --git a/mm/migrate.c b/mm/migrate.c index b494fdb9a636..bed48809e5d0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -178,6 +178,37 @@ out: | |||
178 | } | 178 | } |
179 | 179 | ||
180 | /* | 180 | /* |
181 | * Congratulations to trinity for discovering this bug. | ||
182 | * mm/fremap.c's remap_file_pages() accepts any range within a single vma to | ||
183 | * convert that vma to VM_NONLINEAR; and generic_file_remap_pages() will then | ||
184 | * replace the specified range by file ptes throughout (maybe populated after). | ||
185 | * If page migration finds a page within that range, while it's still located | ||
186 | * by vma_interval_tree rather than lost to i_mmap_nonlinear list, no problem: | ||
187 | * zap_pte() clears the temporary migration entry before mmap_sem is dropped. | ||
188 | * But if the migrating page is in a part of the vma outside the range to be | ||
189 | * remapped, then it will not be cleared, and remove_migration_ptes() needs to | ||
190 | * deal with it. Fortunately, this part of the vma is of course still linear, | ||
191 | * so we just need to use linear location on the nonlinear list. | ||
192 | */ | ||
193 | static int remove_linear_migration_ptes_from_nonlinear(struct page *page, | ||
194 | struct address_space *mapping, void *arg) | ||
195 | { | ||
196 | struct vm_area_struct *vma; | ||
197 | /* hugetlbfs does not support remap_pages, so no huge pgoff worries */ | ||
198 | pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); | ||
199 | unsigned long addr; | ||
200 | |||
201 | list_for_each_entry(vma, | ||
202 | &mapping->i_mmap_nonlinear, shared.nonlinear) { | ||
203 | |||
204 | addr = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); | ||
205 | if (addr >= vma->vm_start && addr < vma->vm_end) | ||
206 | remove_migration_pte(page, vma, addr, arg); | ||
207 | } | ||
208 | return SWAP_AGAIN; | ||
209 | } | ||
210 | |||
211 | /* | ||
181 | * Get rid of all migration entries and replace them by | 212 | * Get rid of all migration entries and replace them by |
182 | * references to the indicated page. | 213 | * references to the indicated page. |
183 | */ | 214 | */ |
@@ -186,6 +217,7 @@ static void remove_migration_ptes(struct page *old, struct page *new) | |||
186 | struct rmap_walk_control rwc = { | 217 | struct rmap_walk_control rwc = { |
187 | .rmap_one = remove_migration_pte, | 218 | .rmap_one = remove_migration_pte, |
188 | .arg = old, | 219 | .arg = old, |
220 | .file_nonlinear = remove_linear_migration_ptes_from_nonlinear, | ||
189 | }; | 221 | }; |
190 | 222 | ||
191 | rmap_walk(new, &rwc); | 223 | rmap_walk(new, &rwc); |
@@ -1360,8 +1360,9 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount, | |||
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | static int try_to_unmap_nonlinear(struct page *page, | 1362 | static int try_to_unmap_nonlinear(struct page *page, |
1363 | struct address_space *mapping, struct vm_area_struct *vma) | 1363 | struct address_space *mapping, void *arg) |
1364 | { | 1364 | { |
1365 | struct vm_area_struct *vma; | ||
1365 | int ret = SWAP_AGAIN; | 1366 | int ret = SWAP_AGAIN; |
1366 | unsigned long cursor; | 1367 | unsigned long cursor; |
1367 | unsigned long max_nl_cursor = 0; | 1368 | unsigned long max_nl_cursor = 0; |
@@ -1663,7 +1664,7 @@ static int rmap_walk_file(struct page *page, struct rmap_walk_control *rwc) | |||
1663 | if (list_empty(&mapping->i_mmap_nonlinear)) | 1664 | if (list_empty(&mapping->i_mmap_nonlinear)) |
1664 | goto done; | 1665 | goto done; |
1665 | 1666 | ||
1666 | ret = rwc->file_nonlinear(page, mapping, vma); | 1667 | ret = rwc->file_nonlinear(page, mapping, rwc->arg); |
1667 | 1668 | ||
1668 | done: | 1669 | done: |
1669 | mutex_unlock(&mapping->i_mmap_mutex); | 1670 | mutex_unlock(&mapping->i_mmap_mutex); |
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 7a20897d33db..7403f348ed14 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c | |||
@@ -133,7 +133,7 @@ static int snd_compr_open(struct inode *inode, struct file *f) | |||
133 | kfree(data); | 133 | kfree(data); |
134 | } | 134 | } |
135 | snd_card_unref(compr->card); | 135 | snd_card_unref(compr->card); |
136 | return 0; | 136 | return ret; |
137 | } | 137 | } |
138 | 138 | ||
139 | static int snd_compr_free(struct inode *inode, struct file *f) | 139 | static int snd_compr_free(struct inode *inode, struct file *f) |
diff --git a/sound/pci/oxygen/xonar_dg.c b/sound/pci/oxygen/xonar_dg.c index ed6f199f8a38..4cf3200e988b 100644 --- a/sound/pci/oxygen/xonar_dg.c +++ b/sound/pci/oxygen/xonar_dg.c | |||
@@ -238,11 +238,21 @@ void set_cs4245_adc_params(struct oxygen *chip, | |||
238 | cs4245_write_spi(chip, CS4245_MCLK_FREQ); | 238 | cs4245_write_spi(chip, CS4245_MCLK_FREQ); |
239 | } | 239 | } |
240 | 240 | ||
241 | static inline unsigned int shift_bits(unsigned int value, | ||
242 | unsigned int shift_from, | ||
243 | unsigned int shift_to, | ||
244 | unsigned int mask) | ||
245 | { | ||
246 | if (shift_from < shift_to) | ||
247 | return (value << (shift_to - shift_from)) & mask; | ||
248 | else | ||
249 | return (value >> (shift_from - shift_to)) & mask; | ||
250 | } | ||
251 | |||
241 | unsigned int adjust_dg_dac_routing(struct oxygen *chip, | 252 | unsigned int adjust_dg_dac_routing(struct oxygen *chip, |
242 | unsigned int play_routing) | 253 | unsigned int play_routing) |
243 | { | 254 | { |
244 | struct dg *data = chip->model_data; | 255 | struct dg *data = chip->model_data; |
245 | unsigned int routing = 0; | ||
246 | 256 | ||
247 | switch (data->output_sel) { | 257 | switch (data->output_sel) { |
248 | case PLAYBACK_DST_HP: | 258 | case PLAYBACK_DST_HP: |
@@ -252,15 +262,23 @@ unsigned int adjust_dg_dac_routing(struct oxygen *chip, | |||
252 | OXYGEN_PLAY_MUTE67, OXYGEN_PLAY_MUTE_MASK); | 262 | OXYGEN_PLAY_MUTE67, OXYGEN_PLAY_MUTE_MASK); |
253 | break; | 263 | break; |
254 | case PLAYBACK_DST_MULTICH: | 264 | case PLAYBACK_DST_MULTICH: |
255 | routing = (0 << OXYGEN_PLAY_DAC0_SOURCE_SHIFT) | | ||
256 | (2 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | | ||
257 | (1 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | | ||
258 | (0 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); | ||
259 | oxygen_write8_masked(chip, OXYGEN_PLAY_ROUTING, | 265 | oxygen_write8_masked(chip, OXYGEN_PLAY_ROUTING, |
260 | OXYGEN_PLAY_MUTE01, OXYGEN_PLAY_MUTE_MASK); | 266 | OXYGEN_PLAY_MUTE01, OXYGEN_PLAY_MUTE_MASK); |
261 | break; | 267 | break; |
262 | } | 268 | } |
263 | return routing; | 269 | return (play_routing & OXYGEN_PLAY_DAC0_SOURCE_MASK) | |
270 | shift_bits(play_routing, | ||
271 | OXYGEN_PLAY_DAC2_SOURCE_SHIFT, | ||
272 | OXYGEN_PLAY_DAC1_SOURCE_SHIFT, | ||
273 | OXYGEN_PLAY_DAC1_SOURCE_MASK) | | ||
274 | shift_bits(play_routing, | ||
275 | OXYGEN_PLAY_DAC1_SOURCE_SHIFT, | ||
276 | OXYGEN_PLAY_DAC2_SOURCE_SHIFT, | ||
277 | OXYGEN_PLAY_DAC2_SOURCE_MASK) | | ||
278 | shift_bits(play_routing, | ||
279 | OXYGEN_PLAY_DAC0_SOURCE_SHIFT, | ||
280 | OXYGEN_PLAY_DAC3_SOURCE_SHIFT, | ||
281 | OXYGEN_PLAY_DAC3_SOURCE_MASK); | ||
264 | } | 282 | } |
265 | 283 | ||
266 | void dump_cs4245_registers(struct oxygen *chip, | 284 | void dump_cs4245_registers(struct oxygen *chip, |
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index d4c83c60b9b2..97d86d828190 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c | |||
@@ -1593,6 +1593,7 @@ static void init_params(struct params *p, const char *name, int argc, const char | |||
1593 | p->data_rand_walk = true; | 1593 | p->data_rand_walk = true; |
1594 | p->nr_loops = -1; | 1594 | p->nr_loops = -1; |
1595 | p->init_random = true; | 1595 | p->init_random = true; |
1596 | p->run_all = argc == 1; | ||
1596 | } | 1597 | } |
1597 | 1598 | ||
1598 | static int run_bench_numa(const char *name, const char **argv) | 1599 | static int run_bench_numa(const char *name, const char **argv) |
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c index e47f90cc7b98..8a987d252780 100644 --- a/tools/perf/builtin-bench.c +++ b/tools/perf/builtin-bench.c | |||
@@ -76,7 +76,7 @@ static struct collection collections[] = { | |||
76 | 76 | ||
77 | /* Iterate over all benchmarks within a collection: */ | 77 | /* Iterate over all benchmarks within a collection: */ |
78 | #define for_each_bench(coll, bench) \ | 78 | #define for_each_bench(coll, bench) \ |
79 | for (bench = coll->benchmarks; bench->name; bench++) | 79 | for (bench = coll->benchmarks; bench && bench->name; bench++) |
80 | 80 | ||
81 | static void dump_benchmarks(struct collection *coll) | 81 | static void dump_benchmarks(struct collection *coll) |
82 | { | 82 | { |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 6aa6fb6f7bd9..f954c26de231 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -825,7 +825,6 @@ static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscal | |||
825 | P_SIGNUM(PIPE); | 825 | P_SIGNUM(PIPE); |
826 | P_SIGNUM(ALRM); | 826 | P_SIGNUM(ALRM); |
827 | P_SIGNUM(TERM); | 827 | P_SIGNUM(TERM); |
828 | P_SIGNUM(STKFLT); | ||
829 | P_SIGNUM(CHLD); | 828 | P_SIGNUM(CHLD); |
830 | P_SIGNUM(CONT); | 829 | P_SIGNUM(CONT); |
831 | P_SIGNUM(STOP); | 830 | P_SIGNUM(STOP); |
@@ -841,6 +840,15 @@ static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscal | |||
841 | P_SIGNUM(IO); | 840 | P_SIGNUM(IO); |
842 | P_SIGNUM(PWR); | 841 | P_SIGNUM(PWR); |
843 | P_SIGNUM(SYS); | 842 | P_SIGNUM(SYS); |
843 | #ifdef SIGEMT | ||
844 | P_SIGNUM(EMT); | ||
845 | #endif | ||
846 | #ifdef SIGSTKFLT | ||
847 | P_SIGNUM(STKFLT); | ||
848 | #endif | ||
849 | #ifdef SIGSWI | ||
850 | P_SIGNUM(SWI); | ||
851 | #endif | ||
844 | default: break; | 852 | default: break; |
845 | } | 853 | } |
846 | 854 | ||
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index c872991e0f65..620a1983b76b 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1213,7 +1213,7 @@ static void ip__resolve_ams(struct machine *machine, struct thread *thread, | |||
1213 | */ | 1213 | */ |
1214 | thread__find_addr_location(thread, machine, m, MAP__FUNCTION, | 1214 | thread__find_addr_location(thread, machine, m, MAP__FUNCTION, |
1215 | ip, &al); | 1215 | ip, &al); |
1216 | if (al.sym) | 1216 | if (al.map) |
1217 | goto found; | 1217 | goto found; |
1218 | } | 1218 | } |
1219 | found: | 1219 | found: |
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 3e9f336740fa..516d19fb999b 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -151,15 +151,15 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, | |||
151 | 151 | ||
152 | gelf_getshdr(sec, shp); | 152 | gelf_getshdr(sec, shp); |
153 | str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); | 153 | str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); |
154 | if (!strcmp(name, str)) { | 154 | if (str && !strcmp(name, str)) { |
155 | if (idx) | 155 | if (idx) |
156 | *idx = cnt; | 156 | *idx = cnt; |
157 | break; | 157 | return sec; |
158 | } | 158 | } |
159 | ++cnt; | 159 | ++cnt; |
160 | } | 160 | } |
161 | 161 | ||
162 | return sec; | 162 | return NULL; |
163 | } | 163 | } |
164 | 164 | ||
165 | #define elf_section__for_each_rel(reldata, pos, pos_mem, idx, nr_entries) \ | 165 | #define elf_section__for_each_rel(reldata, pos, pos_mem, idx, nr_entries) \ |