diff options
179 files changed, 1243 insertions, 678 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index e589ae67ae65..519653813500 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -77,6 +77,7 @@ Descriptions of section entries: | |||
77 | Q: Patchwork web based patch tracking system site | 77 | Q: Patchwork web based patch tracking system site |
78 | T: SCM tree type and location. | 78 | T: SCM tree type and location. |
79 | Type is one of: git, hg, quilt, stgit, topgit | 79 | Type is one of: git, hg, quilt, stgit, topgit |
80 | B: Bug tracking system location. | ||
80 | S: Status, one of the following: | 81 | S: Status, one of the following: |
81 | Supported: Someone is actually paid to look after this. | 82 | Supported: Someone is actually paid to look after this. |
82 | Maintained: Someone actually looks after it. | 83 | Maintained: Someone actually looks after it. |
@@ -281,6 +282,7 @@ L: linux-acpi@vger.kernel.org | |||
281 | W: https://01.org/linux-acpi | 282 | W: https://01.org/linux-acpi |
282 | Q: https://patchwork.kernel.org/project/linux-acpi/list/ | 283 | Q: https://patchwork.kernel.org/project/linux-acpi/list/ |
283 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm | 284 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm |
285 | B: https://bugzilla.kernel.org | ||
284 | S: Supported | 286 | S: Supported |
285 | F: drivers/acpi/ | 287 | F: drivers/acpi/ |
286 | F: drivers/pnp/pnpacpi/ | 288 | F: drivers/pnp/pnpacpi/ |
@@ -304,6 +306,8 @@ W: https://acpica.org/ | |||
304 | W: https://github.com/acpica/acpica/ | 306 | W: https://github.com/acpica/acpica/ |
305 | Q: https://patchwork.kernel.org/project/linux-acpi/list/ | 307 | Q: https://patchwork.kernel.org/project/linux-acpi/list/ |
306 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm | 308 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm |
309 | B: https://bugzilla.kernel.org | ||
310 | B: https://bugs.acpica.org | ||
307 | S: Supported | 311 | S: Supported |
308 | F: drivers/acpi/acpica/ | 312 | F: drivers/acpi/acpica/ |
309 | F: include/acpi/ | 313 | F: include/acpi/ |
@@ -313,6 +317,7 @@ ACPI FAN DRIVER | |||
313 | M: Zhang Rui <rui.zhang@intel.com> | 317 | M: Zhang Rui <rui.zhang@intel.com> |
314 | L: linux-acpi@vger.kernel.org | 318 | L: linux-acpi@vger.kernel.org |
315 | W: https://01.org/linux-acpi | 319 | W: https://01.org/linux-acpi |
320 | B: https://bugzilla.kernel.org | ||
316 | S: Supported | 321 | S: Supported |
317 | F: drivers/acpi/fan.c | 322 | F: drivers/acpi/fan.c |
318 | 323 | ||
@@ -328,6 +333,7 @@ ACPI THERMAL DRIVER | |||
328 | M: Zhang Rui <rui.zhang@intel.com> | 333 | M: Zhang Rui <rui.zhang@intel.com> |
329 | L: linux-acpi@vger.kernel.org | 334 | L: linux-acpi@vger.kernel.org |
330 | W: https://01.org/linux-acpi | 335 | W: https://01.org/linux-acpi |
336 | B: https://bugzilla.kernel.org | ||
331 | S: Supported | 337 | S: Supported |
332 | F: drivers/acpi/*thermal* | 338 | F: drivers/acpi/*thermal* |
333 | 339 | ||
@@ -335,6 +341,7 @@ ACPI VIDEO DRIVER | |||
335 | M: Zhang Rui <rui.zhang@intel.com> | 341 | M: Zhang Rui <rui.zhang@intel.com> |
336 | L: linux-acpi@vger.kernel.org | 342 | L: linux-acpi@vger.kernel.org |
337 | W: https://01.org/linux-acpi | 343 | W: https://01.org/linux-acpi |
344 | B: https://bugzilla.kernel.org | ||
338 | S: Supported | 345 | S: Supported |
339 | F: drivers/acpi/acpi_video.c | 346 | F: drivers/acpi/acpi_video.c |
340 | 347 | ||
@@ -5665,6 +5672,7 @@ HIBERNATION (aka Software Suspend, aka swsusp) | |||
5665 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> | 5672 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> |
5666 | M: Pavel Machek <pavel@ucw.cz> | 5673 | M: Pavel Machek <pavel@ucw.cz> |
5667 | L: linux-pm@vger.kernel.org | 5674 | L: linux-pm@vger.kernel.org |
5675 | B: https://bugzilla.kernel.org | ||
5668 | S: Supported | 5676 | S: Supported |
5669 | F: arch/x86/power/ | 5677 | F: arch/x86/power/ |
5670 | F: drivers/base/power/ | 5678 | F: drivers/base/power/ |
@@ -9625,6 +9633,7 @@ POWER MANAGEMENT CORE | |||
9625 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> | 9633 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> |
9626 | L: linux-pm@vger.kernel.org | 9634 | L: linux-pm@vger.kernel.org |
9627 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm | 9635 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm |
9636 | B: https://bugzilla.kernel.org | ||
9628 | S: Supported | 9637 | S: Supported |
9629 | F: drivers/base/power/ | 9638 | F: drivers/base/power/ |
9630 | F: include/linux/pm.h | 9639 | F: include/linux/pm.h |
@@ -11614,6 +11623,7 @@ M: "Rafael J. Wysocki" <rjw@rjwysocki.net> | |||
11614 | M: Len Brown <len.brown@intel.com> | 11623 | M: Len Brown <len.brown@intel.com> |
11615 | M: Pavel Machek <pavel@ucw.cz> | 11624 | M: Pavel Machek <pavel@ucw.cz> |
11616 | L: linux-pm@vger.kernel.org | 11625 | L: linux-pm@vger.kernel.org |
11626 | B: https://bugzilla.kernel.org | ||
11617 | S: Supported | 11627 | S: Supported |
11618 | F: Documentation/power/ | 11628 | F: Documentation/power/ |
11619 | F: arch/x86/kernel/acpi/ | 11629 | F: arch/x86/kernel/acpi/ |
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 0745538b26d3..55e0e3ea9cb6 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
@@ -8,7 +8,6 @@ generic-y += early_ioremap.h | |||
8 | generic-y += emergency-restart.h | 8 | generic-y += emergency-restart.h |
9 | generic-y += errno.h | 9 | generic-y += errno.h |
10 | generic-y += exec.h | 10 | generic-y += exec.h |
11 | generic-y += export.h | ||
12 | generic-y += ioctl.h | 11 | generic-y += ioctl.h |
13 | generic-y += ipcbuf.h | 12 | generic-y += ipcbuf.h |
14 | generic-y += irq_regs.h | 13 | generic-y += irq_regs.h |
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 68c2c097cffe..ad325a8c7e1e 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -33,7 +33,7 @@ endif | |||
33 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 33 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
34 | obj-$(CONFIG_ISA_DMA_API) += dma.o | 34 | obj-$(CONFIG_ISA_DMA_API) += dma.o |
35 | obj-$(CONFIG_FIQ) += fiq.o fiqasm.o | 35 | obj-$(CONFIG_FIQ) += fiq.o fiqasm.o |
36 | obj-$(CONFIG_MODULES) += module.o | 36 | obj-$(CONFIG_MODULES) += armksyms.o module.o |
37 | obj-$(CONFIG_ARM_MODULE_PLTS) += module-plts.o | 37 | obj-$(CONFIG_ARM_MODULE_PLTS) += module-plts.o |
38 | obj-$(CONFIG_ISA_DMA) += dma-isa.o | 38 | obj-$(CONFIG_ISA_DMA) += dma-isa.o |
39 | obj-$(CONFIG_PCI) += bios32.o isa.o | 39 | obj-$(CONFIG_PCI) += bios32.o isa.o |
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c new file mode 100644 index 000000000000..7e45f69a0ddc --- /dev/null +++ b/arch/arm/kernel/armksyms.c | |||
@@ -0,0 +1,183 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/armksyms.c | ||
3 | * | ||
4 | * Copyright (C) 2000 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #include <linux/export.h> | ||
11 | #include <linux/sched.h> | ||
12 | #include <linux/string.h> | ||
13 | #include <linux/cryptohash.h> | ||
14 | #include <linux/delay.h> | ||
15 | #include <linux/in6.h> | ||
16 | #include <linux/syscalls.h> | ||
17 | #include <linux/uaccess.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <linux/arm-smccc.h> | ||
20 | |||
21 | #include <asm/checksum.h> | ||
22 | #include <asm/ftrace.h> | ||
23 | |||
24 | /* | ||
25 | * libgcc functions - functions that are used internally by the | ||
26 | * compiler... (prototypes are not correct though, but that | ||
27 | * doesn't really matter since they're not versioned). | ||
28 | */ | ||
29 | extern void __ashldi3(void); | ||
30 | extern void __ashrdi3(void); | ||
31 | extern void __divsi3(void); | ||
32 | extern void __lshrdi3(void); | ||
33 | extern void __modsi3(void); | ||
34 | extern void __muldi3(void); | ||
35 | extern void __ucmpdi2(void); | ||
36 | extern void __udivsi3(void); | ||
37 | extern void __umodsi3(void); | ||
38 | extern void __do_div64(void); | ||
39 | extern void __bswapsi2(void); | ||
40 | extern void __bswapdi2(void); | ||
41 | |||
42 | extern void __aeabi_idiv(void); | ||
43 | extern void __aeabi_idivmod(void); | ||
44 | extern void __aeabi_lasr(void); | ||
45 | extern void __aeabi_llsl(void); | ||
46 | extern void __aeabi_llsr(void); | ||
47 | extern void __aeabi_lmul(void); | ||
48 | extern void __aeabi_uidiv(void); | ||
49 | extern void __aeabi_uidivmod(void); | ||
50 | extern void __aeabi_ulcmp(void); | ||
51 | |||
52 | extern void fpundefinstr(void); | ||
53 | |||
54 | void mmioset(void *, unsigned int, size_t); | ||
55 | void mmiocpy(void *, const void *, size_t); | ||
56 | |||
57 | /* platform dependent support */ | ||
58 | EXPORT_SYMBOL(arm_delay_ops); | ||
59 | |||
60 | /* networking */ | ||
61 | EXPORT_SYMBOL(csum_partial); | ||
62 | EXPORT_SYMBOL(csum_partial_copy_from_user); | ||
63 | EXPORT_SYMBOL(csum_partial_copy_nocheck); | ||
64 | EXPORT_SYMBOL(__csum_ipv6_magic); | ||
65 | |||
66 | /* io */ | ||
67 | #ifndef __raw_readsb | ||
68 | EXPORT_SYMBOL(__raw_readsb); | ||
69 | #endif | ||
70 | #ifndef __raw_readsw | ||
71 | EXPORT_SYMBOL(__raw_readsw); | ||
72 | #endif | ||
73 | #ifndef __raw_readsl | ||
74 | EXPORT_SYMBOL(__raw_readsl); | ||
75 | #endif | ||
76 | #ifndef __raw_writesb | ||
77 | EXPORT_SYMBOL(__raw_writesb); | ||
78 | #endif | ||
79 | #ifndef __raw_writesw | ||
80 | EXPORT_SYMBOL(__raw_writesw); | ||
81 | #endif | ||
82 | #ifndef __raw_writesl | ||
83 | EXPORT_SYMBOL(__raw_writesl); | ||
84 | #endif | ||
85 | |||
86 | /* string / mem functions */ | ||
87 | EXPORT_SYMBOL(strchr); | ||
88 | EXPORT_SYMBOL(strrchr); | ||
89 | EXPORT_SYMBOL(memset); | ||
90 | EXPORT_SYMBOL(memcpy); | ||
91 | EXPORT_SYMBOL(memmove); | ||
92 | EXPORT_SYMBOL(memchr); | ||
93 | EXPORT_SYMBOL(__memzero); | ||
94 | |||
95 | EXPORT_SYMBOL(mmioset); | ||
96 | EXPORT_SYMBOL(mmiocpy); | ||
97 | |||
98 | #ifdef CONFIG_MMU | ||
99 | EXPORT_SYMBOL(copy_page); | ||
100 | |||
101 | EXPORT_SYMBOL(arm_copy_from_user); | ||
102 | EXPORT_SYMBOL(arm_copy_to_user); | ||
103 | EXPORT_SYMBOL(arm_clear_user); | ||
104 | |||
105 | EXPORT_SYMBOL(__get_user_1); | ||
106 | EXPORT_SYMBOL(__get_user_2); | ||
107 | EXPORT_SYMBOL(__get_user_4); | ||
108 | EXPORT_SYMBOL(__get_user_8); | ||
109 | |||
110 | #ifdef __ARMEB__ | ||
111 | EXPORT_SYMBOL(__get_user_64t_1); | ||
112 | EXPORT_SYMBOL(__get_user_64t_2); | ||
113 | EXPORT_SYMBOL(__get_user_64t_4); | ||
114 | EXPORT_SYMBOL(__get_user_32t_8); | ||
115 | #endif | ||
116 | |||
117 | EXPORT_SYMBOL(__put_user_1); | ||
118 | EXPORT_SYMBOL(__put_user_2); | ||
119 | EXPORT_SYMBOL(__put_user_4); | ||
120 | EXPORT_SYMBOL(__put_user_8); | ||
121 | #endif | ||
122 | |||
123 | /* gcc lib functions */ | ||
124 | EXPORT_SYMBOL(__ashldi3); | ||
125 | EXPORT_SYMBOL(__ashrdi3); | ||
126 | EXPORT_SYMBOL(__divsi3); | ||
127 | EXPORT_SYMBOL(__lshrdi3); | ||
128 | EXPORT_SYMBOL(__modsi3); | ||
129 | EXPORT_SYMBOL(__muldi3); | ||
130 | EXPORT_SYMBOL(__ucmpdi2); | ||
131 | EXPORT_SYMBOL(__udivsi3); | ||
132 | EXPORT_SYMBOL(__umodsi3); | ||
133 | EXPORT_SYMBOL(__do_div64); | ||
134 | EXPORT_SYMBOL(__bswapsi2); | ||
135 | EXPORT_SYMBOL(__bswapdi2); | ||
136 | |||
137 | #ifdef CONFIG_AEABI | ||
138 | EXPORT_SYMBOL(__aeabi_idiv); | ||
139 | EXPORT_SYMBOL(__aeabi_idivmod); | ||
140 | EXPORT_SYMBOL(__aeabi_lasr); | ||
141 | EXPORT_SYMBOL(__aeabi_llsl); | ||
142 | EXPORT_SYMBOL(__aeabi_llsr); | ||
143 | EXPORT_SYMBOL(__aeabi_lmul); | ||
144 | EXPORT_SYMBOL(__aeabi_uidiv); | ||
145 | EXPORT_SYMBOL(__aeabi_uidivmod); | ||
146 | EXPORT_SYMBOL(__aeabi_ulcmp); | ||
147 | #endif | ||
148 | |||
149 | /* bitops */ | ||
150 | EXPORT_SYMBOL(_set_bit); | ||
151 | EXPORT_SYMBOL(_test_and_set_bit); | ||
152 | EXPORT_SYMBOL(_clear_bit); | ||
153 | EXPORT_SYMBOL(_test_and_clear_bit); | ||
154 | EXPORT_SYMBOL(_change_bit); | ||
155 | EXPORT_SYMBOL(_test_and_change_bit); | ||
156 | EXPORT_SYMBOL(_find_first_zero_bit_le); | ||
157 | EXPORT_SYMBOL(_find_next_zero_bit_le); | ||
158 | EXPORT_SYMBOL(_find_first_bit_le); | ||
159 | EXPORT_SYMBOL(_find_next_bit_le); | ||
160 | |||
161 | #ifdef __ARMEB__ | ||
162 | EXPORT_SYMBOL(_find_first_zero_bit_be); | ||
163 | EXPORT_SYMBOL(_find_next_zero_bit_be); | ||
164 | EXPORT_SYMBOL(_find_first_bit_be); | ||
165 | EXPORT_SYMBOL(_find_next_bit_be); | ||
166 | #endif | ||
167 | |||
168 | #ifdef CONFIG_FUNCTION_TRACER | ||
169 | #ifdef CONFIG_OLD_MCOUNT | ||
170 | EXPORT_SYMBOL(mcount); | ||
171 | #endif | ||
172 | EXPORT_SYMBOL(__gnu_mcount_nc); | ||
173 | #endif | ||
174 | |||
175 | #ifdef CONFIG_ARM_PATCH_PHYS_VIRT | ||
176 | EXPORT_SYMBOL(__pv_phys_pfn_offset); | ||
177 | EXPORT_SYMBOL(__pv_offset); | ||
178 | #endif | ||
179 | |||
180 | #ifdef CONFIG_HAVE_ARM_SMCCC | ||
181 | EXPORT_SYMBOL(arm_smccc_smc); | ||
182 | EXPORT_SYMBOL(arm_smccc_hvc); | ||
183 | #endif | ||
diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S index b629d3f11c3d..c73c4030ca5d 100644 --- a/arch/arm/kernel/entry-ftrace.S +++ b/arch/arm/kernel/entry-ftrace.S | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <asm/assembler.h> | 7 | #include <asm/assembler.h> |
8 | #include <asm/ftrace.h> | 8 | #include <asm/ftrace.h> |
9 | #include <asm/unwind.h> | 9 | #include <asm/unwind.h> |
10 | #include <asm/export.h> | ||
11 | 10 | ||
12 | #include "entry-header.S" | 11 | #include "entry-header.S" |
13 | 12 | ||
@@ -154,7 +153,6 @@ ENTRY(mcount) | |||
154 | __mcount _old | 153 | __mcount _old |
155 | #endif | 154 | #endif |
156 | ENDPROC(mcount) | 155 | ENDPROC(mcount) |
157 | EXPORT_SYMBOL(mcount) | ||
158 | 156 | ||
159 | #ifdef CONFIG_DYNAMIC_FTRACE | 157 | #ifdef CONFIG_DYNAMIC_FTRACE |
160 | ENTRY(ftrace_caller_old) | 158 | ENTRY(ftrace_caller_old) |
@@ -207,7 +205,6 @@ UNWIND(.fnstart) | |||
207 | #endif | 205 | #endif |
208 | UNWIND(.fnend) | 206 | UNWIND(.fnend) |
209 | ENDPROC(__gnu_mcount_nc) | 207 | ENDPROC(__gnu_mcount_nc) |
210 | EXPORT_SYMBOL(__gnu_mcount_nc) | ||
211 | 208 | ||
212 | #ifdef CONFIG_DYNAMIC_FTRACE | 209 | #ifdef CONFIG_DYNAMIC_FTRACE |
213 | ENTRY(ftrace_caller) | 210 | ENTRY(ftrace_caller) |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index f41cee4c5746..04286fd9e09c 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <asm/memory.h> | 22 | #include <asm/memory.h> |
23 | #include <asm/thread_info.h> | 23 | #include <asm/thread_info.h> |
24 | #include <asm/pgtable.h> | 24 | #include <asm/pgtable.h> |
25 | #include <asm/export.h> | ||
26 | 25 | ||
27 | #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING) | 26 | #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING) |
28 | #include CONFIG_DEBUG_LL_INCLUDE | 27 | #include CONFIG_DEBUG_LL_INCLUDE |
@@ -728,8 +727,6 @@ __pv_phys_pfn_offset: | |||
728 | __pv_offset: | 727 | __pv_offset: |
729 | .quad 0 | 728 | .quad 0 |
730 | .size __pv_offset, . -__pv_offset | 729 | .size __pv_offset, . -__pv_offset |
731 | EXPORT_SYMBOL(__pv_phys_pfn_offset) | ||
732 | EXPORT_SYMBOL(__pv_offset) | ||
733 | #endif | 730 | #endif |
734 | 731 | ||
735 | #include "head-common.S" | 732 | #include "head-common.S" |
diff --git a/arch/arm/kernel/smccc-call.S b/arch/arm/kernel/smccc-call.S index 37669e7e13af..2e48b674aab1 100644 --- a/arch/arm/kernel/smccc-call.S +++ b/arch/arm/kernel/smccc-call.S | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <asm/opcodes-sec.h> | 16 | #include <asm/opcodes-sec.h> |
17 | #include <asm/opcodes-virt.h> | 17 | #include <asm/opcodes-virt.h> |
18 | #include <asm/unwind.h> | 18 | #include <asm/unwind.h> |
19 | #include <asm/export.h> | ||
20 | 19 | ||
21 | /* | 20 | /* |
22 | * Wrap c macros in asm macros to delay expansion until after the | 21 | * Wrap c macros in asm macros to delay expansion until after the |
@@ -52,7 +51,6 @@ UNWIND( .fnend) | |||
52 | ENTRY(arm_smccc_smc) | 51 | ENTRY(arm_smccc_smc) |
53 | SMCCC SMCCC_SMC | 52 | SMCCC SMCCC_SMC |
54 | ENDPROC(arm_smccc_smc) | 53 | ENDPROC(arm_smccc_smc) |
55 | EXPORT_SYMBOL(arm_smccc_smc) | ||
56 | 54 | ||
57 | /* | 55 | /* |
58 | * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, | 56 | * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, |
@@ -62,4 +60,3 @@ EXPORT_SYMBOL(arm_smccc_smc) | |||
62 | ENTRY(arm_smccc_hvc) | 60 | ENTRY(arm_smccc_hvc) |
63 | SMCCC SMCCC_HVC | 61 | SMCCC SMCCC_HVC |
64 | ENDPROC(arm_smccc_hvc) | 62 | ENDPROC(arm_smccc_hvc) |
65 | EXPORT_SYMBOL(arm_smccc_hvc) | ||
diff --git a/arch/arm/lib/ashldi3.S b/arch/arm/lib/ashldi3.S index a7e7de89bd75..b05e95840651 100644 --- a/arch/arm/lib/ashldi3.S +++ b/arch/arm/lib/ashldi3.S | |||
@@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */ | |||
28 | 28 | ||
29 | #include <linux/linkage.h> | 29 | #include <linux/linkage.h> |
30 | #include <asm/assembler.h> | 30 | #include <asm/assembler.h> |
31 | #include <asm/export.h> | ||
32 | 31 | ||
33 | #ifdef __ARMEB__ | 32 | #ifdef __ARMEB__ |
34 | #define al r1 | 33 | #define al r1 |
@@ -53,5 +52,3 @@ ENTRY(__aeabi_llsl) | |||
53 | 52 | ||
54 | ENDPROC(__ashldi3) | 53 | ENDPROC(__ashldi3) |
55 | ENDPROC(__aeabi_llsl) | 54 | ENDPROC(__aeabi_llsl) |
56 | EXPORT_SYMBOL(__ashldi3) | ||
57 | EXPORT_SYMBOL(__aeabi_llsl) | ||
diff --git a/arch/arm/lib/ashrdi3.S b/arch/arm/lib/ashrdi3.S index 490336e42518..275d7d2341a4 100644 --- a/arch/arm/lib/ashrdi3.S +++ b/arch/arm/lib/ashrdi3.S | |||
@@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */ | |||
28 | 28 | ||
29 | #include <linux/linkage.h> | 29 | #include <linux/linkage.h> |
30 | #include <asm/assembler.h> | 30 | #include <asm/assembler.h> |
31 | #include <asm/export.h> | ||
32 | 31 | ||
33 | #ifdef __ARMEB__ | 32 | #ifdef __ARMEB__ |
34 | #define al r1 | 33 | #define al r1 |
@@ -53,5 +52,3 @@ ENTRY(__aeabi_lasr) | |||
53 | 52 | ||
54 | ENDPROC(__ashrdi3) | 53 | ENDPROC(__ashrdi3) |
55 | ENDPROC(__aeabi_lasr) | 54 | ENDPROC(__aeabi_lasr) |
56 | EXPORT_SYMBOL(__ashrdi3) | ||
57 | EXPORT_SYMBOL(__aeabi_lasr) | ||
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h index df06638b327c..7d807cfd8ef5 100644 --- a/arch/arm/lib/bitops.h +++ b/arch/arm/lib/bitops.h | |||
@@ -1,6 +1,5 @@ | |||
1 | #include <asm/assembler.h> | 1 | #include <asm/assembler.h> |
2 | #include <asm/unwind.h> | 2 | #include <asm/unwind.h> |
3 | #include <asm/export.h> | ||
4 | 3 | ||
5 | #if __LINUX_ARM_ARCH__ >= 6 | 4 | #if __LINUX_ARM_ARCH__ >= 6 |
6 | .macro bitop, name, instr | 5 | .macro bitop, name, instr |
@@ -26,7 +25,6 @@ UNWIND( .fnstart ) | |||
26 | bx lr | 25 | bx lr |
27 | UNWIND( .fnend ) | 26 | UNWIND( .fnend ) |
28 | ENDPROC(\name ) | 27 | ENDPROC(\name ) |
29 | EXPORT_SYMBOL(\name ) | ||
30 | .endm | 28 | .endm |
31 | 29 | ||
32 | .macro testop, name, instr, store | 30 | .macro testop, name, instr, store |
@@ -57,7 +55,6 @@ UNWIND( .fnstart ) | |||
57 | 2: bx lr | 55 | 2: bx lr |
58 | UNWIND( .fnend ) | 56 | UNWIND( .fnend ) |
59 | ENDPROC(\name ) | 57 | ENDPROC(\name ) |
60 | EXPORT_SYMBOL(\name ) | ||
61 | .endm | 58 | .endm |
62 | #else | 59 | #else |
63 | .macro bitop, name, instr | 60 | .macro bitop, name, instr |
@@ -77,7 +74,6 @@ UNWIND( .fnstart ) | |||
77 | ret lr | 74 | ret lr |
78 | UNWIND( .fnend ) | 75 | UNWIND( .fnend ) |
79 | ENDPROC(\name ) | 76 | ENDPROC(\name ) |
80 | EXPORT_SYMBOL(\name ) | ||
81 | .endm | 77 | .endm |
82 | 78 | ||
83 | /** | 79 | /** |
@@ -106,6 +102,5 @@ UNWIND( .fnstart ) | |||
106 | ret lr | 102 | ret lr |
107 | UNWIND( .fnend ) | 103 | UNWIND( .fnend ) |
108 | ENDPROC(\name ) | 104 | ENDPROC(\name ) |
109 | EXPORT_SYMBOL(\name ) | ||
110 | .endm | 105 | .endm |
111 | #endif | 106 | #endif |
diff --git a/arch/arm/lib/bswapsdi2.S b/arch/arm/lib/bswapsdi2.S index f05f78247304..07cda737bb11 100644 --- a/arch/arm/lib/bswapsdi2.S +++ b/arch/arm/lib/bswapsdi2.S | |||
@@ -1,6 +1,5 @@ | |||
1 | #include <linux/linkage.h> | 1 | #include <linux/linkage.h> |
2 | #include <asm/assembler.h> | 2 | #include <asm/assembler.h> |
3 | #include <asm/export.h> | ||
4 | 3 | ||
5 | #if __LINUX_ARM_ARCH__ >= 6 | 4 | #if __LINUX_ARM_ARCH__ >= 6 |
6 | ENTRY(__bswapsi2) | 5 | ENTRY(__bswapsi2) |
@@ -36,5 +35,3 @@ ENTRY(__bswapdi2) | |||
36 | ret lr | 35 | ret lr |
37 | ENDPROC(__bswapdi2) | 36 | ENDPROC(__bswapdi2) |
38 | #endif | 37 | #endif |
39 | EXPORT_SYMBOL(__bswapsi2) | ||
40 | EXPORT_SYMBOL(__bswapdi2) | ||
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S index b566154f5cf4..e936352ccb00 100644 --- a/arch/arm/lib/clear_user.S +++ b/arch/arm/lib/clear_user.S | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/unwind.h> | 12 | #include <asm/unwind.h> |
13 | #include <asm/export.h> | ||
14 | 13 | ||
15 | .text | 14 | .text |
16 | 15 | ||
@@ -51,9 +50,6 @@ USER( strnebt r2, [r0]) | |||
51 | UNWIND(.fnend) | 50 | UNWIND(.fnend) |
52 | ENDPROC(arm_clear_user) | 51 | ENDPROC(arm_clear_user) |
53 | ENDPROC(__clear_user_std) | 52 | ENDPROC(__clear_user_std) |
54 | #ifndef CONFIG_UACCESS_WITH_MEMCPY | ||
55 | EXPORT_SYMBOL(arm_clear_user) | ||
56 | #endif | ||
57 | 53 | ||
58 | .pushsection .text.fixup,"ax" | 54 | .pushsection .text.fixup,"ax" |
59 | .align 0 | 55 | .align 0 |
diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S index 63e4c1ed0225..7a4b06049001 100644 --- a/arch/arm/lib/copy_from_user.S +++ b/arch/arm/lib/copy_from_user.S | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/assembler.h> | 14 | #include <asm/assembler.h> |
15 | #include <asm/unwind.h> | 15 | #include <asm/unwind.h> |
16 | #include <asm/export.h> | ||
17 | 16 | ||
18 | /* | 17 | /* |
19 | * Prototype: | 18 | * Prototype: |
@@ -95,7 +94,6 @@ ENTRY(arm_copy_from_user) | |||
95 | #include "copy_template.S" | 94 | #include "copy_template.S" |
96 | 95 | ||
97 | ENDPROC(arm_copy_from_user) | 96 | ENDPROC(arm_copy_from_user) |
98 | EXPORT_SYMBOL(arm_copy_from_user) | ||
99 | 97 | ||
100 | .pushsection .fixup,"ax" | 98 | .pushsection .fixup,"ax" |
101 | .align 0 | 99 | .align 0 |
diff --git a/arch/arm/lib/copy_page.S b/arch/arm/lib/copy_page.S index d97851d4af7a..6ee2f6706f86 100644 --- a/arch/arm/lib/copy_page.S +++ b/arch/arm/lib/copy_page.S | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <asm/assembler.h> | 13 | #include <asm/assembler.h> |
14 | #include <asm/asm-offsets.h> | 14 | #include <asm/asm-offsets.h> |
15 | #include <asm/cache.h> | 15 | #include <asm/cache.h> |
16 | #include <asm/export.h> | ||
17 | 16 | ||
18 | #define COPY_COUNT (PAGE_SZ / (2 * L1_CACHE_BYTES) PLD( -1 )) | 17 | #define COPY_COUNT (PAGE_SZ / (2 * L1_CACHE_BYTES) PLD( -1 )) |
19 | 18 | ||
@@ -46,4 +45,3 @@ ENTRY(copy_page) | |||
46 | PLD( beq 2b ) | 45 | PLD( beq 2b ) |
47 | ldmfd sp!, {r4, pc} @ 3 | 46 | ldmfd sp!, {r4, pc} @ 3 |
48 | ENDPROC(copy_page) | 47 | ENDPROC(copy_page) |
49 | EXPORT_SYMBOL(copy_page) | ||
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S index 592c179112d1..caf5019d8161 100644 --- a/arch/arm/lib/copy_to_user.S +++ b/arch/arm/lib/copy_to_user.S | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/assembler.h> | 14 | #include <asm/assembler.h> |
15 | #include <asm/unwind.h> | 15 | #include <asm/unwind.h> |
16 | #include <asm/export.h> | ||
17 | 16 | ||
18 | /* | 17 | /* |
19 | * Prototype: | 18 | * Prototype: |
@@ -100,9 +99,6 @@ WEAK(arm_copy_to_user) | |||
100 | 99 | ||
101 | ENDPROC(arm_copy_to_user) | 100 | ENDPROC(arm_copy_to_user) |
102 | ENDPROC(__copy_to_user_std) | 101 | ENDPROC(__copy_to_user_std) |
103 | #ifndef CONFIG_UACCESS_WITH_MEMCPY | ||
104 | EXPORT_SYMBOL(arm_copy_to_user) | ||
105 | #endif | ||
106 | 102 | ||
107 | .pushsection .text.fixup,"ax" | 103 | .pushsection .text.fixup,"ax" |
108 | .align 0 | 104 | .align 0 |
diff --git a/arch/arm/lib/csumipv6.S b/arch/arm/lib/csumipv6.S index 68603b5ee537..3ac6ef01bc43 100644 --- a/arch/arm/lib/csumipv6.S +++ b/arch/arm/lib/csumipv6.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .text | 13 | .text |
15 | 14 | ||
@@ -31,4 +30,4 @@ ENTRY(__csum_ipv6_magic) | |||
31 | adcs r0, r0, #0 | 30 | adcs r0, r0, #0 |
32 | ldmfd sp!, {pc} | 31 | ldmfd sp!, {pc} |
33 | ENDPROC(__csum_ipv6_magic) | 32 | ENDPROC(__csum_ipv6_magic) |
34 | EXPORT_SYMBOL(__csum_ipv6_magic) | 33 | |
diff --git a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S index 830b20e81c37..984e0f29d548 100644 --- a/arch/arm/lib/csumpartial.S +++ b/arch/arm/lib/csumpartial.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .text | 13 | .text |
15 | 14 | ||
@@ -141,4 +140,3 @@ ENTRY(csum_partial) | |||
141 | bne 4b | 140 | bne 4b |
142 | b .Lless4 | 141 | b .Lless4 |
143 | ENDPROC(csum_partial) | 142 | ENDPROC(csum_partial) |
144 | EXPORT_SYMBOL(csum_partial) | ||
diff --git a/arch/arm/lib/csumpartialcopy.S b/arch/arm/lib/csumpartialcopy.S index 9c3383fed129..d03fc71fc88c 100644 --- a/arch/arm/lib/csumpartialcopy.S +++ b/arch/arm/lib/csumpartialcopy.S | |||
@@ -49,6 +49,5 @@ | |||
49 | 49 | ||
50 | #define FN_ENTRY ENTRY(csum_partial_copy_nocheck) | 50 | #define FN_ENTRY ENTRY(csum_partial_copy_nocheck) |
51 | #define FN_EXIT ENDPROC(csum_partial_copy_nocheck) | 51 | #define FN_EXIT ENDPROC(csum_partial_copy_nocheck) |
52 | #define FN_EXPORT EXPORT_SYMBOL(csum_partial_copy_nocheck) | ||
53 | 52 | ||
54 | #include "csumpartialcopygeneric.S" | 53 | #include "csumpartialcopygeneric.S" |
diff --git a/arch/arm/lib/csumpartialcopygeneric.S b/arch/arm/lib/csumpartialcopygeneric.S index 8b94d20e51d1..10b45909610c 100644 --- a/arch/arm/lib/csumpartialcopygeneric.S +++ b/arch/arm/lib/csumpartialcopygeneric.S | |||
@@ -8,7 +8,6 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <asm/assembler.h> | 10 | #include <asm/assembler.h> |
11 | #include <asm/export.h> | ||
12 | 11 | ||
13 | /* | 12 | /* |
14 | * unsigned int | 13 | * unsigned int |
@@ -332,4 +331,3 @@ FN_ENTRY | |||
332 | mov r5, r4, get_byte_1 | 331 | mov r5, r4, get_byte_1 |
333 | b .Lexit | 332 | b .Lexit |
334 | FN_EXIT | 333 | FN_EXIT |
335 | FN_EXPORT | ||
diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S index 5d495edf3d83..1712f132b80d 100644 --- a/arch/arm/lib/csumpartialcopyuser.S +++ b/arch/arm/lib/csumpartialcopyuser.S | |||
@@ -73,7 +73,6 @@ | |||
73 | 73 | ||
74 | #define FN_ENTRY ENTRY(csum_partial_copy_from_user) | 74 | #define FN_ENTRY ENTRY(csum_partial_copy_from_user) |
75 | #define FN_EXIT ENDPROC(csum_partial_copy_from_user) | 75 | #define FN_EXIT ENDPROC(csum_partial_copy_from_user) |
76 | #define FN_EXPORT EXPORT_SYMBOL(csum_partial_copy_from_user) | ||
77 | 76 | ||
78 | #include "csumpartialcopygeneric.S" | 77 | #include "csumpartialcopygeneric.S" |
79 | 78 | ||
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index 69aad80a3af4..2cef11884857 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/export.h> | ||
28 | #include <linux/timex.h> | 27 | #include <linux/timex.h> |
29 | 28 | ||
30 | /* | 29 | /* |
@@ -35,7 +34,6 @@ struct arm_delay_ops arm_delay_ops __ro_after_init = { | |||
35 | .const_udelay = __loop_const_udelay, | 34 | .const_udelay = __loop_const_udelay, |
36 | .udelay = __loop_udelay, | 35 | .udelay = __loop_udelay, |
37 | }; | 36 | }; |
38 | EXPORT_SYMBOL(arm_delay_ops); | ||
39 | 37 | ||
40 | static const struct delay_timer *delay_timer; | 38 | static const struct delay_timer *delay_timer; |
41 | static bool delay_calibrated; | 39 | static bool delay_calibrated; |
diff --git a/arch/arm/lib/div64.S b/arch/arm/lib/div64.S index 0c9e1c18fc9e..a9eafe4981eb 100644 --- a/arch/arm/lib/div64.S +++ b/arch/arm/lib/div64.S | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <asm/assembler.h> | 16 | #include <asm/assembler.h> |
17 | #include <asm/unwind.h> | 17 | #include <asm/unwind.h> |
18 | #include <asm/export.h> | ||
19 | 18 | ||
20 | #ifdef __ARMEB__ | 19 | #ifdef __ARMEB__ |
21 | #define xh r0 | 20 | #define xh r0 |
@@ -211,4 +210,3 @@ Ldiv0_64: | |||
211 | 210 | ||
212 | UNWIND(.fnend) | 211 | UNWIND(.fnend) |
213 | ENDPROC(__do_div64) | 212 | ENDPROC(__do_div64) |
214 | EXPORT_SYMBOL(__do_div64) | ||
diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S index 26302b8cd38f..7848780e8834 100644 --- a/arch/arm/lib/findbit.S +++ b/arch/arm/lib/findbit.S | |||
@@ -15,7 +15,6 @@ | |||
15 | */ | 15 | */ |
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <asm/assembler.h> | 17 | #include <asm/assembler.h> |
18 | #include <asm/export.h> | ||
19 | .text | 18 | .text |
20 | 19 | ||
21 | /* | 20 | /* |
@@ -38,7 +37,6 @@ ENTRY(_find_first_zero_bit_le) | |||
38 | 3: mov r0, r1 @ no free bits | 37 | 3: mov r0, r1 @ no free bits |
39 | ret lr | 38 | ret lr |
40 | ENDPROC(_find_first_zero_bit_le) | 39 | ENDPROC(_find_first_zero_bit_le) |
41 | EXPORT_SYMBOL(_find_first_zero_bit_le) | ||
42 | 40 | ||
43 | /* | 41 | /* |
44 | * Purpose : Find next 'zero' bit | 42 | * Purpose : Find next 'zero' bit |
@@ -59,7 +57,6 @@ ENTRY(_find_next_zero_bit_le) | |||
59 | add r2, r2, #1 @ align bit pointer | 57 | add r2, r2, #1 @ align bit pointer |
60 | b 2b @ loop for next bit | 58 | b 2b @ loop for next bit |
61 | ENDPROC(_find_next_zero_bit_le) | 59 | ENDPROC(_find_next_zero_bit_le) |
62 | EXPORT_SYMBOL(_find_next_zero_bit_le) | ||
63 | 60 | ||
64 | /* | 61 | /* |
65 | * Purpose : Find a 'one' bit | 62 | * Purpose : Find a 'one' bit |
@@ -81,7 +78,6 @@ ENTRY(_find_first_bit_le) | |||
81 | 3: mov r0, r1 @ no free bits | 78 | 3: mov r0, r1 @ no free bits |
82 | ret lr | 79 | ret lr |
83 | ENDPROC(_find_first_bit_le) | 80 | ENDPROC(_find_first_bit_le) |
84 | EXPORT_SYMBOL(_find_first_bit_le) | ||
85 | 81 | ||
86 | /* | 82 | /* |
87 | * Purpose : Find next 'one' bit | 83 | * Purpose : Find next 'one' bit |
@@ -101,7 +97,6 @@ ENTRY(_find_next_bit_le) | |||
101 | add r2, r2, #1 @ align bit pointer | 97 | add r2, r2, #1 @ align bit pointer |
102 | b 2b @ loop for next bit | 98 | b 2b @ loop for next bit |
103 | ENDPROC(_find_next_bit_le) | 99 | ENDPROC(_find_next_bit_le) |
104 | EXPORT_SYMBOL(_find_next_bit_le) | ||
105 | 100 | ||
106 | #ifdef __ARMEB__ | 101 | #ifdef __ARMEB__ |
107 | 102 | ||
@@ -121,7 +116,6 @@ ENTRY(_find_first_zero_bit_be) | |||
121 | 3: mov r0, r1 @ no free bits | 116 | 3: mov r0, r1 @ no free bits |
122 | ret lr | 117 | ret lr |
123 | ENDPROC(_find_first_zero_bit_be) | 118 | ENDPROC(_find_first_zero_bit_be) |
124 | EXPORT_SYMBOL(_find_first_zero_bit_be) | ||
125 | 119 | ||
126 | ENTRY(_find_next_zero_bit_be) | 120 | ENTRY(_find_next_zero_bit_be) |
127 | teq r1, #0 | 121 | teq r1, #0 |
@@ -139,7 +133,6 @@ ENTRY(_find_next_zero_bit_be) | |||
139 | add r2, r2, #1 @ align bit pointer | 133 | add r2, r2, #1 @ align bit pointer |
140 | b 2b @ loop for next bit | 134 | b 2b @ loop for next bit |
141 | ENDPROC(_find_next_zero_bit_be) | 135 | ENDPROC(_find_next_zero_bit_be) |
142 | EXPORT_SYMBOL(_find_next_zero_bit_be) | ||
143 | 136 | ||
144 | ENTRY(_find_first_bit_be) | 137 | ENTRY(_find_first_bit_be) |
145 | teq r1, #0 | 138 | teq r1, #0 |
@@ -157,7 +150,6 @@ ENTRY(_find_first_bit_be) | |||
157 | 3: mov r0, r1 @ no free bits | 150 | 3: mov r0, r1 @ no free bits |
158 | ret lr | 151 | ret lr |
159 | ENDPROC(_find_first_bit_be) | 152 | ENDPROC(_find_first_bit_be) |
160 | EXPORT_SYMBOL(_find_first_bit_be) | ||
161 | 153 | ||
162 | ENTRY(_find_next_bit_be) | 154 | ENTRY(_find_next_bit_be) |
163 | teq r1, #0 | 155 | teq r1, #0 |
@@ -174,7 +166,6 @@ ENTRY(_find_next_bit_be) | |||
174 | add r2, r2, #1 @ align bit pointer | 166 | add r2, r2, #1 @ align bit pointer |
175 | b 2b @ loop for next bit | 167 | b 2b @ loop for next bit |
176 | ENDPROC(_find_next_bit_be) | 168 | ENDPROC(_find_next_bit_be) |
177 | EXPORT_SYMBOL(_find_next_bit_be) | ||
178 | 169 | ||
179 | #endif | 170 | #endif |
180 | 171 | ||
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S index 9d09a38e73af..8ecfd15c3a02 100644 --- a/arch/arm/lib/getuser.S +++ b/arch/arm/lib/getuser.S | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <asm/assembler.h> | 31 | #include <asm/assembler.h> |
32 | #include <asm/errno.h> | 32 | #include <asm/errno.h> |
33 | #include <asm/domain.h> | 33 | #include <asm/domain.h> |
34 | #include <asm/export.h> | ||
35 | 34 | ||
36 | ENTRY(__get_user_1) | 35 | ENTRY(__get_user_1) |
37 | check_uaccess r0, 1, r1, r2, __get_user_bad | 36 | check_uaccess r0, 1, r1, r2, __get_user_bad |
@@ -39,7 +38,6 @@ ENTRY(__get_user_1) | |||
39 | mov r0, #0 | 38 | mov r0, #0 |
40 | ret lr | 39 | ret lr |
41 | ENDPROC(__get_user_1) | 40 | ENDPROC(__get_user_1) |
42 | EXPORT_SYMBOL(__get_user_1) | ||
43 | 41 | ||
44 | ENTRY(__get_user_2) | 42 | ENTRY(__get_user_2) |
45 | check_uaccess r0, 2, r1, r2, __get_user_bad | 43 | check_uaccess r0, 2, r1, r2, __get_user_bad |
@@ -60,7 +58,6 @@ rb .req r0 | |||
60 | mov r0, #0 | 58 | mov r0, #0 |
61 | ret lr | 59 | ret lr |
62 | ENDPROC(__get_user_2) | 60 | ENDPROC(__get_user_2) |
63 | EXPORT_SYMBOL(__get_user_2) | ||
64 | 61 | ||
65 | ENTRY(__get_user_4) | 62 | ENTRY(__get_user_4) |
66 | check_uaccess r0, 4, r1, r2, __get_user_bad | 63 | check_uaccess r0, 4, r1, r2, __get_user_bad |
@@ -68,7 +65,6 @@ ENTRY(__get_user_4) | |||
68 | mov r0, #0 | 65 | mov r0, #0 |
69 | ret lr | 66 | ret lr |
70 | ENDPROC(__get_user_4) | 67 | ENDPROC(__get_user_4) |
71 | EXPORT_SYMBOL(__get_user_4) | ||
72 | 68 | ||
73 | ENTRY(__get_user_8) | 69 | ENTRY(__get_user_8) |
74 | check_uaccess r0, 8, r1, r2, __get_user_bad | 70 | check_uaccess r0, 8, r1, r2, __get_user_bad |
@@ -82,7 +78,6 @@ ENTRY(__get_user_8) | |||
82 | mov r0, #0 | 78 | mov r0, #0 |
83 | ret lr | 79 | ret lr |
84 | ENDPROC(__get_user_8) | 80 | ENDPROC(__get_user_8) |
85 | EXPORT_SYMBOL(__get_user_8) | ||
86 | 81 | ||
87 | #ifdef __ARMEB__ | 82 | #ifdef __ARMEB__ |
88 | ENTRY(__get_user_32t_8) | 83 | ENTRY(__get_user_32t_8) |
@@ -96,7 +91,6 @@ ENTRY(__get_user_32t_8) | |||
96 | mov r0, #0 | 91 | mov r0, #0 |
97 | ret lr | 92 | ret lr |
98 | ENDPROC(__get_user_32t_8) | 93 | ENDPROC(__get_user_32t_8) |
99 | EXPORT_SYMBOL(__get_user_32t_8) | ||
100 | 94 | ||
101 | ENTRY(__get_user_64t_1) | 95 | ENTRY(__get_user_64t_1) |
102 | check_uaccess r0, 1, r1, r2, __get_user_bad8 | 96 | check_uaccess r0, 1, r1, r2, __get_user_bad8 |
@@ -104,7 +98,6 @@ ENTRY(__get_user_64t_1) | |||
104 | mov r0, #0 | 98 | mov r0, #0 |
105 | ret lr | 99 | ret lr |
106 | ENDPROC(__get_user_64t_1) | 100 | ENDPROC(__get_user_64t_1) |
107 | EXPORT_SYMBOL(__get_user_64t_1) | ||
108 | 101 | ||
109 | ENTRY(__get_user_64t_2) | 102 | ENTRY(__get_user_64t_2) |
110 | check_uaccess r0, 2, r1, r2, __get_user_bad8 | 103 | check_uaccess r0, 2, r1, r2, __get_user_bad8 |
@@ -121,7 +114,6 @@ rb .req r0 | |||
121 | mov r0, #0 | 114 | mov r0, #0 |
122 | ret lr | 115 | ret lr |
123 | ENDPROC(__get_user_64t_2) | 116 | ENDPROC(__get_user_64t_2) |
124 | EXPORT_SYMBOL(__get_user_64t_2) | ||
125 | 117 | ||
126 | ENTRY(__get_user_64t_4) | 118 | ENTRY(__get_user_64t_4) |
127 | check_uaccess r0, 4, r1, r2, __get_user_bad8 | 119 | check_uaccess r0, 4, r1, r2, __get_user_bad8 |
@@ -129,7 +121,6 @@ ENTRY(__get_user_64t_4) | |||
129 | mov r0, #0 | 121 | mov r0, #0 |
130 | ret lr | 122 | ret lr |
131 | ENDPROC(__get_user_64t_4) | 123 | ENDPROC(__get_user_64t_4) |
132 | EXPORT_SYMBOL(__get_user_64t_4) | ||
133 | #endif | 124 | #endif |
134 | 125 | ||
135 | __get_user_bad8: | 126 | __get_user_bad8: |
diff --git a/arch/arm/lib/io-readsb.S b/arch/arm/lib/io-readsb.S index 3dff7a3a2aef..c31b2f3153f1 100644 --- a/arch/arm/lib/io-readsb.S +++ b/arch/arm/lib/io-readsb.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .Linsb_align: rsb ip, ip, #4 | 13 | .Linsb_align: rsb ip, ip, #4 |
15 | cmp ip, r2 | 14 | cmp ip, r2 |
@@ -122,4 +121,3 @@ ENTRY(__raw_readsb) | |||
122 | 121 | ||
123 | ldmfd sp!, {r4 - r6, pc} | 122 | ldmfd sp!, {r4 - r6, pc} |
124 | ENDPROC(__raw_readsb) | 123 | ENDPROC(__raw_readsb) |
125 | EXPORT_SYMBOL(__raw_readsb) | ||
diff --git a/arch/arm/lib/io-readsl.S b/arch/arm/lib/io-readsl.S index bfd39682325b..2ed86fa5465f 100644 --- a/arch/arm/lib/io-readsl.S +++ b/arch/arm/lib/io-readsl.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | ENTRY(__raw_readsl) | 13 | ENTRY(__raw_readsl) |
15 | teq r2, #0 @ do we have to check for the zero len? | 14 | teq r2, #0 @ do we have to check for the zero len? |
@@ -78,4 +77,3 @@ ENTRY(__raw_readsl) | |||
78 | strb r3, [r1, #0] | 77 | strb r3, [r1, #0] |
79 | ret lr | 78 | ret lr |
80 | ENDPROC(__raw_readsl) | 79 | ENDPROC(__raw_readsl) |
81 | EXPORT_SYMBOL(__raw_readsl) | ||
diff --git a/arch/arm/lib/io-readsw-armv3.S b/arch/arm/lib/io-readsw-armv3.S index b3af3db6caac..413da9914529 100644 --- a/arch/arm/lib/io-readsw-armv3.S +++ b/arch/arm/lib/io-readsw-armv3.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .Linsw_bad_alignment: | 13 | .Linsw_bad_alignment: |
15 | adr r0, .Linsw_bad_align_msg | 14 | adr r0, .Linsw_bad_align_msg |
@@ -104,4 +103,4 @@ ENTRY(__raw_readsw) | |||
104 | 103 | ||
105 | ldmfd sp!, {r4, r5, r6, pc} | 104 | ldmfd sp!, {r4, r5, r6, pc} |
106 | 105 | ||
107 | EXPORT_SYMBOL(__raw_readsw) | 106 | |
diff --git a/arch/arm/lib/io-readsw-armv4.S b/arch/arm/lib/io-readsw-armv4.S index 3c7a7a40b33e..d9a45e9692ae 100644 --- a/arch/arm/lib/io-readsw-armv4.S +++ b/arch/arm/lib/io-readsw-armv4.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .macro pack, rd, hw1, hw2 | 13 | .macro pack, rd, hw1, hw2 |
15 | #ifndef __ARMEB__ | 14 | #ifndef __ARMEB__ |
@@ -130,4 +129,3 @@ ENTRY(__raw_readsw) | |||
130 | strneb ip, [r1] | 129 | strneb ip, [r1] |
131 | ldmfd sp!, {r4, pc} | 130 | ldmfd sp!, {r4, pc} |
132 | ENDPROC(__raw_readsw) | 131 | ENDPROC(__raw_readsw) |
133 | EXPORT_SYMBOL(__raw_readsw) | ||
diff --git a/arch/arm/lib/io-writesb.S b/arch/arm/lib/io-writesb.S index fa3633594415..a46bbc9b168b 100644 --- a/arch/arm/lib/io-writesb.S +++ b/arch/arm/lib/io-writesb.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .macro outword, rd | 13 | .macro outword, rd |
15 | #ifndef __ARMEB__ | 14 | #ifndef __ARMEB__ |
@@ -93,4 +92,3 @@ ENTRY(__raw_writesb) | |||
93 | 92 | ||
94 | ldmfd sp!, {r4, r5, pc} | 93 | ldmfd sp!, {r4, r5, pc} |
95 | ENDPROC(__raw_writesb) | 94 | ENDPROC(__raw_writesb) |
96 | EXPORT_SYMBOL(__raw_writesb) | ||
diff --git a/arch/arm/lib/io-writesl.S b/arch/arm/lib/io-writesl.S index 98ed6aec0b47..4ea2435988c1 100644 --- a/arch/arm/lib/io-writesl.S +++ b/arch/arm/lib/io-writesl.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | ENTRY(__raw_writesl) | 13 | ENTRY(__raw_writesl) |
15 | teq r2, #0 @ do we have to check for the zero len? | 14 | teq r2, #0 @ do we have to check for the zero len? |
@@ -66,4 +65,3 @@ ENTRY(__raw_writesl) | |||
66 | bne 6b | 65 | bne 6b |
67 | ret lr | 66 | ret lr |
68 | ENDPROC(__raw_writesl) | 67 | ENDPROC(__raw_writesl) |
69 | EXPORT_SYMBOL(__raw_writesl) | ||
diff --git a/arch/arm/lib/io-writesw-armv3.S b/arch/arm/lib/io-writesw-armv3.S index 577184c082bb..121789eb6802 100644 --- a/arch/arm/lib/io-writesw-armv3.S +++ b/arch/arm/lib/io-writesw-armv3.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .Loutsw_bad_alignment: | 13 | .Loutsw_bad_alignment: |
15 | adr r0, .Loutsw_bad_align_msg | 14 | adr r0, .Loutsw_bad_align_msg |
@@ -125,4 +124,3 @@ ENTRY(__raw_writesw) | |||
125 | strne ip, [r0] | 124 | strne ip, [r0] |
126 | 125 | ||
127 | ldmfd sp!, {r4, r5, r6, pc} | 126 | ldmfd sp!, {r4, r5, r6, pc} |
128 | EXPORT_SYMBOL(__raw_writesw) | ||
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S index e335f489d1fc..269f90c51ad2 100644 --- a/arch/arm/lib/io-writesw-armv4.S +++ b/arch/arm/lib/io-writesw-armv4.S | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/export.h> | ||
13 | 12 | ||
14 | .macro outword, rd | 13 | .macro outword, rd |
15 | #ifndef __ARMEB__ | 14 | #ifndef __ARMEB__ |
@@ -99,4 +98,3 @@ ENTRY(__raw_writesw) | |||
99 | strneh ip, [r0] | 98 | strneh ip, [r0] |
100 | ret lr | 99 | ret lr |
101 | ENDPROC(__raw_writesw) | 100 | ENDPROC(__raw_writesw) |
102 | EXPORT_SYMBOL(__raw_writesw) | ||
diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S index f541bc013bff..9397b2e532af 100644 --- a/arch/arm/lib/lib1funcs.S +++ b/arch/arm/lib/lib1funcs.S | |||
@@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */ | |||
36 | #include <linux/linkage.h> | 36 | #include <linux/linkage.h> |
37 | #include <asm/assembler.h> | 37 | #include <asm/assembler.h> |
38 | #include <asm/unwind.h> | 38 | #include <asm/unwind.h> |
39 | #include <asm/export.h> | ||
40 | 39 | ||
41 | .macro ARM_DIV_BODY dividend, divisor, result, curbit | 40 | .macro ARM_DIV_BODY dividend, divisor, result, curbit |
42 | 41 | ||
@@ -239,8 +238,6 @@ UNWIND(.fnstart) | |||
239 | UNWIND(.fnend) | 238 | UNWIND(.fnend) |
240 | ENDPROC(__udivsi3) | 239 | ENDPROC(__udivsi3) |
241 | ENDPROC(__aeabi_uidiv) | 240 | ENDPROC(__aeabi_uidiv) |
242 | EXPORT_SYMBOL(__udivsi3) | ||
243 | EXPORT_SYMBOL(__aeabi_uidiv) | ||
244 | 241 | ||
245 | ENTRY(__umodsi3) | 242 | ENTRY(__umodsi3) |
246 | UNWIND(.fnstart) | 243 | UNWIND(.fnstart) |
@@ -259,7 +256,6 @@ UNWIND(.fnstart) | |||
259 | 256 | ||
260 | UNWIND(.fnend) | 257 | UNWIND(.fnend) |
261 | ENDPROC(__umodsi3) | 258 | ENDPROC(__umodsi3) |
262 | EXPORT_SYMBOL(__umodsi3) | ||
263 | 259 | ||
264 | #ifdef CONFIG_ARM_PATCH_IDIV | 260 | #ifdef CONFIG_ARM_PATCH_IDIV |
265 | .align 3 | 261 | .align 3 |
@@ -307,8 +303,6 @@ UNWIND(.fnstart) | |||
307 | UNWIND(.fnend) | 303 | UNWIND(.fnend) |
308 | ENDPROC(__divsi3) | 304 | ENDPROC(__divsi3) |
309 | ENDPROC(__aeabi_idiv) | 305 | ENDPROC(__aeabi_idiv) |
310 | EXPORT_SYMBOL(__divsi3) | ||
311 | EXPORT_SYMBOL(__aeabi_idiv) | ||
312 | 306 | ||
313 | ENTRY(__modsi3) | 307 | ENTRY(__modsi3) |
314 | UNWIND(.fnstart) | 308 | UNWIND(.fnstart) |
@@ -333,7 +327,6 @@ UNWIND(.fnstart) | |||
333 | 327 | ||
334 | UNWIND(.fnend) | 328 | UNWIND(.fnend) |
335 | ENDPROC(__modsi3) | 329 | ENDPROC(__modsi3) |
336 | EXPORT_SYMBOL(__modsi3) | ||
337 | 330 | ||
338 | #ifdef CONFIG_AEABI | 331 | #ifdef CONFIG_AEABI |
339 | 332 | ||
@@ -350,7 +343,6 @@ UNWIND(.save {r0, r1, ip, lr} ) | |||
350 | 343 | ||
351 | UNWIND(.fnend) | 344 | UNWIND(.fnend) |
352 | ENDPROC(__aeabi_uidivmod) | 345 | ENDPROC(__aeabi_uidivmod) |
353 | EXPORT_SYMBOL(__aeabi_uidivmod) | ||
354 | 346 | ||
355 | ENTRY(__aeabi_idivmod) | 347 | ENTRY(__aeabi_idivmod) |
356 | UNWIND(.fnstart) | 348 | UNWIND(.fnstart) |
@@ -364,7 +356,6 @@ UNWIND(.save {r0, r1, ip, lr} ) | |||
364 | 356 | ||
365 | UNWIND(.fnend) | 357 | UNWIND(.fnend) |
366 | ENDPROC(__aeabi_idivmod) | 358 | ENDPROC(__aeabi_idivmod) |
367 | EXPORT_SYMBOL(__aeabi_idivmod) | ||
368 | 359 | ||
369 | #endif | 360 | #endif |
370 | 361 | ||
diff --git a/arch/arm/lib/lshrdi3.S b/arch/arm/lib/lshrdi3.S index e40833981417..922dcd88b02b 100644 --- a/arch/arm/lib/lshrdi3.S +++ b/arch/arm/lib/lshrdi3.S | |||
@@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */ | |||
28 | 28 | ||
29 | #include <linux/linkage.h> | 29 | #include <linux/linkage.h> |
30 | #include <asm/assembler.h> | 30 | #include <asm/assembler.h> |
31 | #include <asm/export.h> | ||
32 | 31 | ||
33 | #ifdef __ARMEB__ | 32 | #ifdef __ARMEB__ |
34 | #define al r1 | 33 | #define al r1 |
@@ -53,5 +52,3 @@ ENTRY(__aeabi_llsr) | |||
53 | 52 | ||
54 | ENDPROC(__lshrdi3) | 53 | ENDPROC(__lshrdi3) |
55 | ENDPROC(__aeabi_llsr) | 54 | ENDPROC(__aeabi_llsr) |
56 | EXPORT_SYMBOL(__lshrdi3) | ||
57 | EXPORT_SYMBOL(__aeabi_llsr) | ||
diff --git a/arch/arm/lib/memchr.S b/arch/arm/lib/memchr.S index 44182bf686a5..74a5bed6d999 100644 --- a/arch/arm/lib/memchr.S +++ b/arch/arm/lib/memchr.S | |||
@@ -11,7 +11,6 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
13 | #include <asm/assembler.h> | 13 | #include <asm/assembler.h> |
14 | #include <asm/export.h> | ||
15 | 14 | ||
16 | .text | 15 | .text |
17 | .align 5 | 16 | .align 5 |
@@ -25,4 +24,3 @@ ENTRY(memchr) | |||
25 | 2: movne r0, #0 | 24 | 2: movne r0, #0 |
26 | ret lr | 25 | ret lr |
27 | ENDPROC(memchr) | 26 | ENDPROC(memchr) |
28 | EXPORT_SYMBOL(memchr) | ||
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S index 1be5b6ddf37c..64111bd4440b 100644 --- a/arch/arm/lib/memcpy.S +++ b/arch/arm/lib/memcpy.S | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/assembler.h> | 14 | #include <asm/assembler.h> |
15 | #include <asm/unwind.h> | 15 | #include <asm/unwind.h> |
16 | #include <asm/export.h> | ||
17 | 16 | ||
18 | #define LDR1W_SHIFT 0 | 17 | #define LDR1W_SHIFT 0 |
19 | #define STR1W_SHIFT 0 | 18 | #define STR1W_SHIFT 0 |
@@ -69,5 +68,3 @@ ENTRY(memcpy) | |||
69 | 68 | ||
70 | ENDPROC(memcpy) | 69 | ENDPROC(memcpy) |
71 | ENDPROC(mmiocpy) | 70 | ENDPROC(mmiocpy) |
72 | EXPORT_SYMBOL(memcpy) | ||
73 | EXPORT_SYMBOL(mmiocpy) | ||
diff --git a/arch/arm/lib/memmove.S b/arch/arm/lib/memmove.S index 71dcc5400d02..69a9d47fc5ab 100644 --- a/arch/arm/lib/memmove.S +++ b/arch/arm/lib/memmove.S | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/assembler.h> | 14 | #include <asm/assembler.h> |
15 | #include <asm/unwind.h> | 15 | #include <asm/unwind.h> |
16 | #include <asm/export.h> | ||
17 | 16 | ||
18 | .text | 17 | .text |
19 | 18 | ||
@@ -226,4 +225,3 @@ ENTRY(memmove) | |||
226 | 18: backward_copy_shift push=24 pull=8 | 225 | 18: backward_copy_shift push=24 pull=8 |
227 | 226 | ||
228 | ENDPROC(memmove) | 227 | ENDPROC(memmove) |
229 | EXPORT_SYMBOL(memmove) | ||
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S index 7b72044cba62..3c65e3bd790f 100644 --- a/arch/arm/lib/memset.S +++ b/arch/arm/lib/memset.S | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
13 | #include <asm/assembler.h> | 13 | #include <asm/assembler.h> |
14 | #include <asm/unwind.h> | 14 | #include <asm/unwind.h> |
15 | #include <asm/export.h> | ||
16 | 15 | ||
17 | .text | 16 | .text |
18 | .align 5 | 17 | .align 5 |
@@ -136,5 +135,3 @@ UNWIND( .fnstart ) | |||
136 | UNWIND( .fnend ) | 135 | UNWIND( .fnend ) |
137 | ENDPROC(memset) | 136 | ENDPROC(memset) |
138 | ENDPROC(mmioset) | 137 | ENDPROC(mmioset) |
139 | EXPORT_SYMBOL(memset) | ||
140 | EXPORT_SYMBOL(mmioset) | ||
diff --git a/arch/arm/lib/memzero.S b/arch/arm/lib/memzero.S index 6dec26ed5bcc..0eded952e089 100644 --- a/arch/arm/lib/memzero.S +++ b/arch/arm/lib/memzero.S | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/unwind.h> | 12 | #include <asm/unwind.h> |
13 | #include <asm/export.h> | ||
14 | 13 | ||
15 | .text | 14 | .text |
16 | .align 5 | 15 | .align 5 |
@@ -136,4 +135,3 @@ UNWIND( .fnstart ) | |||
136 | ret lr @ 1 | 135 | ret lr @ 1 |
137 | UNWIND( .fnend ) | 136 | UNWIND( .fnend ) |
138 | ENDPROC(__memzero) | 137 | ENDPROC(__memzero) |
139 | EXPORT_SYMBOL(__memzero) | ||
diff --git a/arch/arm/lib/muldi3.S b/arch/arm/lib/muldi3.S index b8f12388ccac..204305956925 100644 --- a/arch/arm/lib/muldi3.S +++ b/arch/arm/lib/muldi3.S | |||
@@ -12,7 +12,6 @@ | |||
12 | 12 | ||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/assembler.h> | 14 | #include <asm/assembler.h> |
15 | #include <asm/export.h> | ||
16 | 15 | ||
17 | #ifdef __ARMEB__ | 16 | #ifdef __ARMEB__ |
18 | #define xh r0 | 17 | #define xh r0 |
@@ -47,5 +46,3 @@ ENTRY(__aeabi_lmul) | |||
47 | 46 | ||
48 | ENDPROC(__muldi3) | 47 | ENDPROC(__muldi3) |
49 | ENDPROC(__aeabi_lmul) | 48 | ENDPROC(__aeabi_lmul) |
50 | EXPORT_SYMBOL(__muldi3) | ||
51 | EXPORT_SYMBOL(__aeabi_lmul) | ||
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S index 11de126e2ed6..38d660d3705f 100644 --- a/arch/arm/lib/putuser.S +++ b/arch/arm/lib/putuser.S | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <asm/assembler.h> | 31 | #include <asm/assembler.h> |
32 | #include <asm/errno.h> | 32 | #include <asm/errno.h> |
33 | #include <asm/domain.h> | 33 | #include <asm/domain.h> |
34 | #include <asm/export.h> | ||
35 | 34 | ||
36 | ENTRY(__put_user_1) | 35 | ENTRY(__put_user_1) |
37 | check_uaccess r0, 1, r1, ip, __put_user_bad | 36 | check_uaccess r0, 1, r1, ip, __put_user_bad |
@@ -39,7 +38,6 @@ ENTRY(__put_user_1) | |||
39 | mov r0, #0 | 38 | mov r0, #0 |
40 | ret lr | 39 | ret lr |
41 | ENDPROC(__put_user_1) | 40 | ENDPROC(__put_user_1) |
42 | EXPORT_SYMBOL(__put_user_1) | ||
43 | 41 | ||
44 | ENTRY(__put_user_2) | 42 | ENTRY(__put_user_2) |
45 | check_uaccess r0, 2, r1, ip, __put_user_bad | 43 | check_uaccess r0, 2, r1, ip, __put_user_bad |
@@ -64,7 +62,6 @@ ENTRY(__put_user_2) | |||
64 | mov r0, #0 | 62 | mov r0, #0 |
65 | ret lr | 63 | ret lr |
66 | ENDPROC(__put_user_2) | 64 | ENDPROC(__put_user_2) |
67 | EXPORT_SYMBOL(__put_user_2) | ||
68 | 65 | ||
69 | ENTRY(__put_user_4) | 66 | ENTRY(__put_user_4) |
70 | check_uaccess r0, 4, r1, ip, __put_user_bad | 67 | check_uaccess r0, 4, r1, ip, __put_user_bad |
@@ -72,7 +69,6 @@ ENTRY(__put_user_4) | |||
72 | mov r0, #0 | 69 | mov r0, #0 |
73 | ret lr | 70 | ret lr |
74 | ENDPROC(__put_user_4) | 71 | ENDPROC(__put_user_4) |
75 | EXPORT_SYMBOL(__put_user_4) | ||
76 | 72 | ||
77 | ENTRY(__put_user_8) | 73 | ENTRY(__put_user_8) |
78 | check_uaccess r0, 8, r1, ip, __put_user_bad | 74 | check_uaccess r0, 8, r1, ip, __put_user_bad |
@@ -86,7 +82,6 @@ ENTRY(__put_user_8) | |||
86 | mov r0, #0 | 82 | mov r0, #0 |
87 | ret lr | 83 | ret lr |
88 | ENDPROC(__put_user_8) | 84 | ENDPROC(__put_user_8) |
89 | EXPORT_SYMBOL(__put_user_8) | ||
90 | 85 | ||
91 | __put_user_bad: | 86 | __put_user_bad: |
92 | mov r0, #-EFAULT | 87 | mov r0, #-EFAULT |
diff --git a/arch/arm/lib/strchr.S b/arch/arm/lib/strchr.S index 7301f6e6046c..013d64c71e8d 100644 --- a/arch/arm/lib/strchr.S +++ b/arch/arm/lib/strchr.S | |||
@@ -11,7 +11,6 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
13 | #include <asm/assembler.h> | 13 | #include <asm/assembler.h> |
14 | #include <asm/export.h> | ||
15 | 14 | ||
16 | .text | 15 | .text |
17 | .align 5 | 16 | .align 5 |
@@ -26,4 +25,3 @@ ENTRY(strchr) | |||
26 | subeq r0, r0, #1 | 25 | subeq r0, r0, #1 |
27 | ret lr | 26 | ret lr |
28 | ENDPROC(strchr) | 27 | ENDPROC(strchr) |
29 | EXPORT_SYMBOL(strchr) | ||
diff --git a/arch/arm/lib/strrchr.S b/arch/arm/lib/strrchr.S index aaf9fd98b754..3cec1c7482c4 100644 --- a/arch/arm/lib/strrchr.S +++ b/arch/arm/lib/strrchr.S | |||
@@ -11,7 +11,6 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
13 | #include <asm/assembler.h> | 13 | #include <asm/assembler.h> |
14 | #include <asm/export.h> | ||
15 | 14 | ||
16 | .text | 15 | .text |
17 | .align 5 | 16 | .align 5 |
@@ -25,4 +24,3 @@ ENTRY(strrchr) | |||
25 | mov r0, r3 | 24 | mov r0, r3 |
26 | ret lr | 25 | ret lr |
27 | ENDPROC(strrchr) | 26 | ENDPROC(strrchr) |
28 | EXPORT_SYMBOL(strrchr) | ||
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c index 1626e3a551a1..6bd1089b07e0 100644 --- a/arch/arm/lib/uaccess_with_memcpy.c +++ b/arch/arm/lib/uaccess_with_memcpy.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
20 | #include <linux/highmem.h> | 20 | #include <linux/highmem.h> |
21 | #include <linux/hugetlb.h> | 21 | #include <linux/hugetlb.h> |
22 | #include <linux/export.h> | ||
23 | #include <asm/current.h> | 22 | #include <asm/current.h> |
24 | #include <asm/page.h> | 23 | #include <asm/page.h> |
25 | 24 | ||
@@ -157,7 +156,6 @@ arm_copy_to_user(void __user *to, const void *from, unsigned long n) | |||
157 | } | 156 | } |
158 | return n; | 157 | return n; |
159 | } | 158 | } |
160 | EXPORT_SYMBOL(arm_copy_to_user); | ||
161 | 159 | ||
162 | static unsigned long noinline | 160 | static unsigned long noinline |
163 | __clear_user_memset(void __user *addr, unsigned long n) | 161 | __clear_user_memset(void __user *addr, unsigned long n) |
@@ -215,7 +213,6 @@ unsigned long arm_clear_user(void __user *addr, unsigned long n) | |||
215 | } | 213 | } |
216 | return n; | 214 | return n; |
217 | } | 215 | } |
218 | EXPORT_SYMBOL(arm_clear_user); | ||
219 | 216 | ||
220 | #if 0 | 217 | #if 0 |
221 | 218 | ||
diff --git a/arch/arm/lib/ucmpdi2.S b/arch/arm/lib/ucmpdi2.S index 127a91af46f3..ad4a6309141a 100644 --- a/arch/arm/lib/ucmpdi2.S +++ b/arch/arm/lib/ucmpdi2.S | |||
@@ -12,7 +12,6 @@ | |||
12 | 12 | ||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/assembler.h> | 14 | #include <asm/assembler.h> |
15 | #include <asm/export.h> | ||
16 | 15 | ||
17 | #ifdef __ARMEB__ | 16 | #ifdef __ARMEB__ |
18 | #define xh r0 | 17 | #define xh r0 |
@@ -36,7 +35,6 @@ ENTRY(__ucmpdi2) | |||
36 | ret lr | 35 | ret lr |
37 | 36 | ||
38 | ENDPROC(__ucmpdi2) | 37 | ENDPROC(__ucmpdi2) |
39 | EXPORT_SYMBOL(__ucmpdi2) | ||
40 | 38 | ||
41 | #ifdef CONFIG_AEABI | 39 | #ifdef CONFIG_AEABI |
42 | 40 | ||
@@ -50,7 +48,6 @@ ENTRY(__aeabi_ulcmp) | |||
50 | ret lr | 48 | ret lr |
51 | 49 | ||
52 | ENDPROC(__aeabi_ulcmp) | 50 | ENDPROC(__aeabi_ulcmp) |
53 | EXPORT_SYMBOL(__aeabi_ulcmp) | ||
54 | 51 | ||
55 | #endif | 52 | #endif |
56 | 53 | ||
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 737450fe790c..cab128913e72 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -32,6 +32,7 @@ endif | |||
32 | 32 | ||
33 | ifdef CONFIG_SND_IMX_SOC | 33 | ifdef CONFIG_SND_IMX_SOC |
34 | obj-y += ssi-fiq.o | 34 | obj-y += ssi-fiq.o |
35 | obj-y += ssi-fiq-ksym.o | ||
35 | endif | 36 | endif |
36 | 37 | ||
37 | # i.MX21 based machines | 38 | # i.MX21 based machines |
diff --git a/arch/arm/mach-imx/ssi-fiq-ksym.c b/arch/arm/mach-imx/ssi-fiq-ksym.c new file mode 100644 index 000000000000..792090f9a032 --- /dev/null +++ b/arch/arm/mach-imx/ssi-fiq-ksym.c | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Exported ksyms for the SSI FIQ handler | ||
3 | * | ||
4 | * Copyright (C) 2009, Sascha Hauer <s.hauer@pengutronix.de> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | |||
13 | #include <linux/platform_data/asoc-imx-ssi.h> | ||
14 | |||
15 | EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer); | ||
16 | EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer); | ||
17 | EXPORT_SYMBOL(imx_ssi_fiq_start); | ||
18 | EXPORT_SYMBOL(imx_ssi_fiq_end); | ||
19 | EXPORT_SYMBOL(imx_ssi_fiq_base); | ||
20 | |||
diff --git a/arch/arm/mach-imx/ssi-fiq.S b/arch/arm/mach-imx/ssi-fiq.S index fd7917f1c204..a8b93c5f29b5 100644 --- a/arch/arm/mach-imx/ssi-fiq.S +++ b/arch/arm/mach-imx/ssi-fiq.S | |||
@@ -8,7 +8,6 @@ | |||
8 | 8 | ||
9 | #include <linux/linkage.h> | 9 | #include <linux/linkage.h> |
10 | #include <asm/assembler.h> | 10 | #include <asm/assembler.h> |
11 | #include <asm/export.h> | ||
12 | 11 | ||
13 | /* | 12 | /* |
14 | * r8 = bit 0-15: tx offset, bit 16-31: tx buffer size | 13 | * r8 = bit 0-15: tx offset, bit 16-31: tx buffer size |
@@ -145,8 +144,4 @@ imx_ssi_fiq_tx_buffer: | |||
145 | .word 0x0 | 144 | .word 0x0 |
146 | .L_imx_ssi_fiq_end: | 145 | .L_imx_ssi_fiq_end: |
147 | imx_ssi_fiq_end: | 146 | imx_ssi_fiq_end: |
148 | EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer) | 147 | |
149 | EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer) | ||
150 | EXPORT_SYMBOL(imx_ssi_fiq_start) | ||
151 | EXPORT_SYMBOL(imx_ssi_fiq_end) | ||
152 | EXPORT_SYMBOL(imx_ssi_fiq_base) | ||
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 71c4a3aa3752..a14b86587013 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -34,7 +34,9 @@ config PARISC | |||
34 | select HAVE_ARCH_HASH | 34 | select HAVE_ARCH_HASH |
35 | select HAVE_ARCH_SECCOMP_FILTER | 35 | select HAVE_ARCH_SECCOMP_FILTER |
36 | select HAVE_ARCH_TRACEHOOK | 36 | select HAVE_ARCH_TRACEHOOK |
37 | select HAVE_UNSTABLE_SCHED_CLOCK if (SMP || !64BIT) | 37 | select GENERIC_SCHED_CLOCK |
38 | select HAVE_UNSTABLE_SCHED_CLOCK if SMP | ||
39 | select GENERIC_CLOCKEVENTS | ||
38 | select ARCH_NO_COHERENT_DMA_MMAP | 40 | select ARCH_NO_COHERENT_DMA_MMAP |
39 | select CPU_NO_EFFICIENT_FFS | 41 | select CPU_NO_EFFICIENT_FFS |
40 | 42 | ||
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 629eb464d5ba..c263301648f3 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
@@ -369,6 +369,7 @@ void __init parisc_setup_cache_timing(void) | |||
369 | { | 369 | { |
370 | unsigned long rangetime, alltime; | 370 | unsigned long rangetime, alltime; |
371 | unsigned long size, start; | 371 | unsigned long size, start; |
372 | unsigned long threshold; | ||
372 | 373 | ||
373 | alltime = mfctl(16); | 374 | alltime = mfctl(16); |
374 | flush_data_cache(); | 375 | flush_data_cache(); |
@@ -382,17 +383,12 @@ void __init parisc_setup_cache_timing(void) | |||
382 | printk(KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n", | 383 | printk(KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n", |
383 | alltime, size, rangetime); | 384 | alltime, size, rangetime); |
384 | 385 | ||
385 | /* Racy, but if we see an intermediate value, it's ok too... */ | 386 | threshold = L1_CACHE_ALIGN(size * alltime / rangetime); |
386 | parisc_cache_flush_threshold = size * alltime / rangetime; | 387 | if (threshold > cache_info.dc_size) |
387 | 388 | threshold = cache_info.dc_size; | |
388 | parisc_cache_flush_threshold = L1_CACHE_ALIGN(parisc_cache_flush_threshold); | 389 | if (threshold) |
389 | if (!parisc_cache_flush_threshold) | 390 | parisc_cache_flush_threshold = threshold; |
390 | parisc_cache_flush_threshold = FLUSH_THRESHOLD; | 391 | printk(KERN_INFO "Cache flush threshold set to %lu KiB\n", |
391 | |||
392 | if (parisc_cache_flush_threshold > cache_info.dc_size) | ||
393 | parisc_cache_flush_threshold = cache_info.dc_size; | ||
394 | |||
395 | printk(KERN_INFO "Setting cache flush threshold to %lu kB\n", | ||
396 | parisc_cache_flush_threshold/1024); | 392 | parisc_cache_flush_threshold/1024); |
397 | 393 | ||
398 | /* calculate TLB flush threshold */ | 394 | /* calculate TLB flush threshold */ |
@@ -401,7 +397,7 @@ void __init parisc_setup_cache_timing(void) | |||
401 | flush_tlb_all(); | 397 | flush_tlb_all(); |
402 | alltime = mfctl(16) - alltime; | 398 | alltime = mfctl(16) - alltime; |
403 | 399 | ||
404 | size = PAGE_SIZE; | 400 | size = 0; |
405 | start = (unsigned long) _text; | 401 | start = (unsigned long) _text; |
406 | rangetime = mfctl(16); | 402 | rangetime = mfctl(16); |
407 | while (start < (unsigned long) _end) { | 403 | while (start < (unsigned long) _end) { |
@@ -414,13 +410,10 @@ void __init parisc_setup_cache_timing(void) | |||
414 | printk(KERN_DEBUG "Whole TLB flush %lu cycles, flushing %lu bytes %lu cycles\n", | 410 | printk(KERN_DEBUG "Whole TLB flush %lu cycles, flushing %lu bytes %lu cycles\n", |
415 | alltime, size, rangetime); | 411 | alltime, size, rangetime); |
416 | 412 | ||
417 | parisc_tlb_flush_threshold = size * alltime / rangetime; | 413 | threshold = PAGE_ALIGN(num_online_cpus() * size * alltime / rangetime); |
418 | parisc_tlb_flush_threshold *= num_online_cpus(); | 414 | if (threshold) |
419 | parisc_tlb_flush_threshold = PAGE_ALIGN(parisc_tlb_flush_threshold); | 415 | parisc_tlb_flush_threshold = threshold; |
420 | if (!parisc_tlb_flush_threshold) | 416 | printk(KERN_INFO "TLB flush threshold set to %lu KiB\n", |
421 | parisc_tlb_flush_threshold = FLUSH_TLB_THRESHOLD; | ||
422 | |||
423 | printk(KERN_INFO "Setting TLB flush threshold to %lu kB\n", | ||
424 | parisc_tlb_flush_threshold/1024); | 417 | parisc_tlb_flush_threshold/1024); |
425 | } | 418 | } |
426 | 419 | ||
diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index 545f9d2fe711..c05d1876d27c 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c | |||
@@ -58,7 +58,7 @@ void __init setup_pdc(void) | |||
58 | status = pdc_system_map_find_mods(&module_result, &module_path, 0); | 58 | status = pdc_system_map_find_mods(&module_result, &module_path, 0); |
59 | if (status == PDC_OK) { | 59 | if (status == PDC_OK) { |
60 | pdc_type = PDC_TYPE_SYSTEM_MAP; | 60 | pdc_type = PDC_TYPE_SYSTEM_MAP; |
61 | printk("System Map.\n"); | 61 | pr_cont("System Map.\n"); |
62 | return; | 62 | return; |
63 | } | 63 | } |
64 | 64 | ||
@@ -77,7 +77,7 @@ void __init setup_pdc(void) | |||
77 | status = pdc_pat_cell_get_number(&cell_info); | 77 | status = pdc_pat_cell_get_number(&cell_info); |
78 | if (status == PDC_OK) { | 78 | if (status == PDC_OK) { |
79 | pdc_type = PDC_TYPE_PAT; | 79 | pdc_type = PDC_TYPE_PAT; |
80 | printk("64 bit PAT.\n"); | 80 | pr_cont("64 bit PAT.\n"); |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | #endif | 83 | #endif |
@@ -97,12 +97,12 @@ void __init setup_pdc(void) | |||
97 | case 0xC: /* 715/64, at least */ | 97 | case 0xC: /* 715/64, at least */ |
98 | 98 | ||
99 | pdc_type = PDC_TYPE_SNAKE; | 99 | pdc_type = PDC_TYPE_SNAKE; |
100 | printk("Snake.\n"); | 100 | pr_cont("Snake.\n"); |
101 | return; | 101 | return; |
102 | 102 | ||
103 | default: /* Everything else */ | 103 | default: /* Everything else */ |
104 | 104 | ||
105 | printk("Unsupported.\n"); | 105 | pr_cont("Unsupported.\n"); |
106 | panic("If this is a 64-bit machine, please try a 64-bit kernel.\n"); | 106 | panic("If this is a 64-bit machine, please try a 64-bit kernel.\n"); |
107 | } | 107 | } |
108 | } | 108 | } |
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S index 985e06da37f5..1b39a2acaadf 100644 --- a/arch/parisc/kernel/pacache.S +++ b/arch/parisc/kernel/pacache.S | |||
@@ -96,7 +96,7 @@ fitmanyloop: /* Loop if LOOP >= 2 */ | |||
96 | 96 | ||
97 | fitmanymiddle: /* Loop if LOOP >= 2 */ | 97 | fitmanymiddle: /* Loop if LOOP >= 2 */ |
98 | addib,COND(>) -1, %r31, fitmanymiddle /* Adjusted inner loop decr */ | 98 | addib,COND(>) -1, %r31, fitmanymiddle /* Adjusted inner loop decr */ |
99 | pitlbe 0(%sr1, %r28) | 99 | pitlbe %r0(%sr1, %r28) |
100 | pitlbe,m %arg1(%sr1, %r28) /* Last pitlbe and addr adjust */ | 100 | pitlbe,m %arg1(%sr1, %r28) /* Last pitlbe and addr adjust */ |
101 | addib,COND(>) -1, %r29, fitmanymiddle /* Middle loop decr */ | 101 | addib,COND(>) -1, %r29, fitmanymiddle /* Middle loop decr */ |
102 | copy %arg3, %r31 /* Re-init inner loop count */ | 102 | copy %arg3, %r31 /* Re-init inner loop count */ |
@@ -139,7 +139,7 @@ fdtmanyloop: /* Loop if LOOP >= 2 */ | |||
139 | 139 | ||
140 | fdtmanymiddle: /* Loop if LOOP >= 2 */ | 140 | fdtmanymiddle: /* Loop if LOOP >= 2 */ |
141 | addib,COND(>) -1, %r31, fdtmanymiddle /* Adjusted inner loop decr */ | 141 | addib,COND(>) -1, %r31, fdtmanymiddle /* Adjusted inner loop decr */ |
142 | pdtlbe 0(%sr1, %r28) | 142 | pdtlbe %r0(%sr1, %r28) |
143 | pdtlbe,m %arg1(%sr1, %r28) /* Last pdtlbe and addr adjust */ | 143 | pdtlbe,m %arg1(%sr1, %r28) /* Last pdtlbe and addr adjust */ |
144 | addib,COND(>) -1, %r29, fdtmanymiddle /* Middle loop decr */ | 144 | addib,COND(>) -1, %r29, fdtmanymiddle /* Middle loop decr */ |
145 | copy %arg3, %r31 /* Re-init inner loop count */ | 145 | copy %arg3, %r31 /* Re-init inner loop count */ |
@@ -626,12 +626,12 @@ ENTRY_CFI(copy_user_page_asm) | |||
626 | /* Purge any old translations */ | 626 | /* Purge any old translations */ |
627 | 627 | ||
628 | #ifdef CONFIG_PA20 | 628 | #ifdef CONFIG_PA20 |
629 | pdtlb,l 0(%r28) | 629 | pdtlb,l %r0(%r28) |
630 | pdtlb,l 0(%r29) | 630 | pdtlb,l %r0(%r29) |
631 | #else | 631 | #else |
632 | tlb_lock %r20,%r21,%r22 | 632 | tlb_lock %r20,%r21,%r22 |
633 | pdtlb 0(%r28) | 633 | pdtlb %r0(%r28) |
634 | pdtlb 0(%r29) | 634 | pdtlb %r0(%r29) |
635 | tlb_unlock %r20,%r21,%r22 | 635 | tlb_unlock %r20,%r21,%r22 |
636 | #endif | 636 | #endif |
637 | 637 | ||
@@ -774,10 +774,10 @@ ENTRY_CFI(clear_user_page_asm) | |||
774 | /* Purge any old translation */ | 774 | /* Purge any old translation */ |
775 | 775 | ||
776 | #ifdef CONFIG_PA20 | 776 | #ifdef CONFIG_PA20 |
777 | pdtlb,l 0(%r28) | 777 | pdtlb,l %r0(%r28) |
778 | #else | 778 | #else |
779 | tlb_lock %r20,%r21,%r22 | 779 | tlb_lock %r20,%r21,%r22 |
780 | pdtlb 0(%r28) | 780 | pdtlb %r0(%r28) |
781 | tlb_unlock %r20,%r21,%r22 | 781 | tlb_unlock %r20,%r21,%r22 |
782 | #endif | 782 | #endif |
783 | 783 | ||
@@ -858,10 +858,10 @@ ENTRY_CFI(flush_dcache_page_asm) | |||
858 | /* Purge any old translation */ | 858 | /* Purge any old translation */ |
859 | 859 | ||
860 | #ifdef CONFIG_PA20 | 860 | #ifdef CONFIG_PA20 |
861 | pdtlb,l 0(%r28) | 861 | pdtlb,l %r0(%r28) |
862 | #else | 862 | #else |
863 | tlb_lock %r20,%r21,%r22 | 863 | tlb_lock %r20,%r21,%r22 |
864 | pdtlb 0(%r28) | 864 | pdtlb %r0(%r28) |
865 | tlb_unlock %r20,%r21,%r22 | 865 | tlb_unlock %r20,%r21,%r22 |
866 | #endif | 866 | #endif |
867 | 867 | ||
@@ -898,10 +898,10 @@ ENTRY_CFI(flush_dcache_page_asm) | |||
898 | sync | 898 | sync |
899 | 899 | ||
900 | #ifdef CONFIG_PA20 | 900 | #ifdef CONFIG_PA20 |
901 | pdtlb,l 0(%r25) | 901 | pdtlb,l %r0(%r25) |
902 | #else | 902 | #else |
903 | tlb_lock %r20,%r21,%r22 | 903 | tlb_lock %r20,%r21,%r22 |
904 | pdtlb 0(%r25) | 904 | pdtlb %r0(%r25) |
905 | tlb_unlock %r20,%r21,%r22 | 905 | tlb_unlock %r20,%r21,%r22 |
906 | #endif | 906 | #endif |
907 | 907 | ||
@@ -931,13 +931,18 @@ ENTRY_CFI(flush_icache_page_asm) | |||
931 | depwi 0, 31,PAGE_SHIFT, %r28 /* Clear any offset bits */ | 931 | depwi 0, 31,PAGE_SHIFT, %r28 /* Clear any offset bits */ |
932 | #endif | 932 | #endif |
933 | 933 | ||
934 | /* Purge any old translation */ | 934 | /* Purge any old translation. Note that the FIC instruction |
935 | * may use either the instruction or data TLB. Given that we | ||
936 | * have a flat address space, it's not clear which TLB will be | ||
937 | * used. So, we purge both entries. */ | ||
935 | 938 | ||
936 | #ifdef CONFIG_PA20 | 939 | #ifdef CONFIG_PA20 |
940 | pdtlb,l %r0(%r28) | ||
937 | pitlb,l %r0(%sr4,%r28) | 941 | pitlb,l %r0(%sr4,%r28) |
938 | #else | 942 | #else |
939 | tlb_lock %r20,%r21,%r22 | 943 | tlb_lock %r20,%r21,%r22 |
940 | pitlb (%sr4,%r28) | 944 | pdtlb %r0(%r28) |
945 | pitlb %r0(%sr4,%r28) | ||
941 | tlb_unlock %r20,%r21,%r22 | 946 | tlb_unlock %r20,%r21,%r22 |
942 | #endif | 947 | #endif |
943 | 948 | ||
@@ -976,10 +981,12 @@ ENTRY_CFI(flush_icache_page_asm) | |||
976 | sync | 981 | sync |
977 | 982 | ||
978 | #ifdef CONFIG_PA20 | 983 | #ifdef CONFIG_PA20 |
984 | pdtlb,l %r0(%r28) | ||
979 | pitlb,l %r0(%sr4,%r25) | 985 | pitlb,l %r0(%sr4,%r25) |
980 | #else | 986 | #else |
981 | tlb_lock %r20,%r21,%r22 | 987 | tlb_lock %r20,%r21,%r22 |
982 | pitlb (%sr4,%r25) | 988 | pdtlb %r0(%r28) |
989 | pitlb %r0(%sr4,%r25) | ||
983 | tlb_unlock %r20,%r21,%r22 | 990 | tlb_unlock %r20,%r21,%r22 |
984 | #endif | 991 | #endif |
985 | 992 | ||
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index 02d9ed0f3949..494ff6e8c88a 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c | |||
@@ -95,8 +95,8 @@ static inline int map_pte_uncached(pte_t * pte, | |||
95 | 95 | ||
96 | if (!pte_none(*pte)) | 96 | if (!pte_none(*pte)) |
97 | printk(KERN_ERR "map_pte_uncached: page already exists\n"); | 97 | printk(KERN_ERR "map_pte_uncached: page already exists\n"); |
98 | set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); | ||
99 | purge_tlb_start(flags); | 98 | purge_tlb_start(flags); |
99 | set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); | ||
100 | pdtlb_kernel(orig_vaddr); | 100 | pdtlb_kernel(orig_vaddr); |
101 | purge_tlb_end(flags); | 101 | purge_tlb_end(flags); |
102 | vaddr += PAGE_SIZE; | 102 | vaddr += PAGE_SIZE; |
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index 81d6f6391944..2e66a887788e 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c | |||
@@ -334,6 +334,10 @@ static int __init parisc_init(void) | |||
334 | /* tell PDC we're Linux. Nevermind failure. */ | 334 | /* tell PDC we're Linux. Nevermind failure. */ |
335 | pdc_stable_write(0x40, &osid, sizeof(osid)); | 335 | pdc_stable_write(0x40, &osid, sizeof(osid)); |
336 | 336 | ||
337 | /* start with known state */ | ||
338 | flush_cache_all_local(); | ||
339 | flush_tlb_all_local(NULL); | ||
340 | |||
337 | processor_init(); | 341 | processor_init(); |
338 | #ifdef CONFIG_SMP | 342 | #ifdef CONFIG_SMP |
339 | pr_info("CPU(s): %d out of %d %s at %d.%06d MHz online\n", | 343 | pr_info("CPU(s): %d out of %d %s at %d.%06d MHz online\n", |
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 9b63b876a13a..325f30d82b64 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/rtc.h> | 15 | #include <linux/rtc.h> |
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/sched_clock.h> | ||
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/param.h> | 19 | #include <linux/param.h> |
19 | #include <linux/string.h> | 20 | #include <linux/string.h> |
@@ -39,18 +40,6 @@ | |||
39 | 40 | ||
40 | static unsigned long clocktick __read_mostly; /* timer cycles per tick */ | 41 | static unsigned long clocktick __read_mostly; /* timer cycles per tick */ |
41 | 42 | ||
42 | #ifndef CONFIG_64BIT | ||
43 | /* | ||
44 | * The processor-internal cycle counter (Control Register 16) is used as time | ||
45 | * source for the sched_clock() function. This register is 64bit wide on a | ||
46 | * 64-bit kernel and 32bit on a 32-bit kernel. Since sched_clock() always | ||
47 | * requires a 64bit counter we emulate on the 32-bit kernel the higher 32bits | ||
48 | * with a per-cpu variable which we increase every time the counter | ||
49 | * wraps-around (which happens every ~4 secounds). | ||
50 | */ | ||
51 | static DEFINE_PER_CPU(unsigned long, cr16_high_32_bits); | ||
52 | #endif | ||
53 | |||
54 | /* | 43 | /* |
55 | * We keep time on PA-RISC Linux by using the Interval Timer which is | 44 | * We keep time on PA-RISC Linux by using the Interval Timer which is |
56 | * a pair of registers; one is read-only and one is write-only; both | 45 | * a pair of registers; one is read-only and one is write-only; both |
@@ -121,12 +110,6 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id) | |||
121 | */ | 110 | */ |
122 | mtctl(next_tick, 16); | 111 | mtctl(next_tick, 16); |
123 | 112 | ||
124 | #if !defined(CONFIG_64BIT) | ||
125 | /* check for overflow on a 32bit kernel (every ~4 seconds). */ | ||
126 | if (unlikely(next_tick < now)) | ||
127 | this_cpu_inc(cr16_high_32_bits); | ||
128 | #endif | ||
129 | |||
130 | /* Skip one clocktick on purpose if we missed next_tick. | 113 | /* Skip one clocktick on purpose if we missed next_tick. |
131 | * The new CR16 must be "later" than current CR16 otherwise | 114 | * The new CR16 must be "later" than current CR16 otherwise |
132 | * itimer would not fire until CR16 wrapped - e.g 4 seconds | 115 | * itimer would not fire until CR16 wrapped - e.g 4 seconds |
@@ -208,7 +191,7 @@ EXPORT_SYMBOL(profile_pc); | |||
208 | 191 | ||
209 | /* clock source code */ | 192 | /* clock source code */ |
210 | 193 | ||
211 | static cycle_t read_cr16(struct clocksource *cs) | 194 | static cycle_t notrace read_cr16(struct clocksource *cs) |
212 | { | 195 | { |
213 | return get_cycles(); | 196 | return get_cycles(); |
214 | } | 197 | } |
@@ -287,26 +270,9 @@ void read_persistent_clock(struct timespec *ts) | |||
287 | } | 270 | } |
288 | 271 | ||
289 | 272 | ||
290 | /* | 273 | static u64 notrace read_cr16_sched_clock(void) |
291 | * sched_clock() framework | ||
292 | */ | ||
293 | |||
294 | static u32 cyc2ns_mul __read_mostly; | ||
295 | static u32 cyc2ns_shift __read_mostly; | ||
296 | |||
297 | u64 sched_clock(void) | ||
298 | { | 274 | { |
299 | u64 now; | 275 | return get_cycles(); |
300 | |||
301 | /* Get current cycle counter (Control Register 16). */ | ||
302 | #ifdef CONFIG_64BIT | ||
303 | now = mfctl(16); | ||
304 | #else | ||
305 | now = mfctl(16) + (((u64) this_cpu_read(cr16_high_32_bits)) << 32); | ||
306 | #endif | ||
307 | |||
308 | /* return the value in ns (cycles_2_ns) */ | ||
309 | return mul_u64_u32_shr(now, cyc2ns_mul, cyc2ns_shift); | ||
310 | } | 276 | } |
311 | 277 | ||
312 | 278 | ||
@@ -316,17 +282,16 @@ u64 sched_clock(void) | |||
316 | 282 | ||
317 | void __init time_init(void) | 283 | void __init time_init(void) |
318 | { | 284 | { |
319 | unsigned long current_cr16_khz; | 285 | unsigned long cr16_hz; |
320 | 286 | ||
321 | current_cr16_khz = PAGE0->mem_10msec/10; /* kHz */ | ||
322 | clocktick = (100 * PAGE0->mem_10msec) / HZ; | 287 | clocktick = (100 * PAGE0->mem_10msec) / HZ; |
323 | |||
324 | /* calculate mult/shift values for cr16 */ | ||
325 | clocks_calc_mult_shift(&cyc2ns_mul, &cyc2ns_shift, current_cr16_khz, | ||
326 | NSEC_PER_MSEC, 0); | ||
327 | |||
328 | start_cpu_itimer(); /* get CPU 0 started */ | 288 | start_cpu_itimer(); /* get CPU 0 started */ |
329 | 289 | ||
290 | cr16_hz = 100 * PAGE0->mem_10msec; /* Hz */ | ||
291 | |||
330 | /* register at clocksource framework */ | 292 | /* register at clocksource framework */ |
331 | clocksource_register_khz(&clocksource_cr16, current_cr16_khz); | 293 | clocksource_register_hz(&clocksource_cr16, cr16_hz); |
294 | |||
295 | /* register as sched_clock source */ | ||
296 | sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz); | ||
332 | } | 297 | } |
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c index 57d42d129033..78aaf4ffd7ab 100644 --- a/arch/powerpc/boot/main.c +++ b/arch/powerpc/boot/main.c | |||
@@ -232,8 +232,12 @@ void start(void) | |||
232 | console_ops.close(); | 232 | console_ops.close(); |
233 | 233 | ||
234 | kentry = (kernel_entry_t) vmlinux.addr; | 234 | kentry = (kernel_entry_t) vmlinux.addr; |
235 | if (ft_addr) | 235 | if (ft_addr) { |
236 | kentry(ft_addr, 0, NULL); | 236 | if(platform_ops.kentry) |
237 | platform_ops.kentry(ft_addr, vmlinux.addr); | ||
238 | else | ||
239 | kentry(ft_addr, 0, NULL); | ||
240 | } | ||
237 | else | 241 | else |
238 | kentry((unsigned long)initrd.addr, initrd.size, | 242 | kentry((unsigned long)initrd.addr, initrd.size, |
239 | loader_info.promptr); | 243 | loader_info.promptr); |
diff --git a/arch/powerpc/boot/opal-calls.S b/arch/powerpc/boot/opal-calls.S index ff2f1b97bc53..2a99fc9a3ccf 100644 --- a/arch/powerpc/boot/opal-calls.S +++ b/arch/powerpc/boot/opal-calls.S | |||
@@ -12,6 +12,19 @@ | |||
12 | 12 | ||
13 | .text | 13 | .text |
14 | 14 | ||
15 | .globl opal_kentry | ||
16 | opal_kentry: | ||
17 | /* r3 is the fdt ptr */ | ||
18 | mtctr r4 | ||
19 | li r4, 0 | ||
20 | li r5, 0 | ||
21 | li r6, 0 | ||
22 | li r7, 0 | ||
23 | ld r11,opal@got(r2) | ||
24 | ld r8,0(r11) | ||
25 | ld r9,8(r11) | ||
26 | bctr | ||
27 | |||
15 | #define OPAL_CALL(name, token) \ | 28 | #define OPAL_CALL(name, token) \ |
16 | .globl name; \ | 29 | .globl name; \ |
17 | name: \ | 30 | name: \ |
diff --git a/arch/powerpc/boot/opal.c b/arch/powerpc/boot/opal.c index 1f37e1c1d6d8..d7b4fd47eb44 100644 --- a/arch/powerpc/boot/opal.c +++ b/arch/powerpc/boot/opal.c | |||
@@ -23,14 +23,25 @@ struct opal { | |||
23 | 23 | ||
24 | static u32 opal_con_id; | 24 | static u32 opal_con_id; |
25 | 25 | ||
26 | /* see opal-wrappers.S */ | ||
26 | int64_t opal_console_write(int64_t term_number, u64 *length, const u8 *buffer); | 27 | int64_t opal_console_write(int64_t term_number, u64 *length, const u8 *buffer); |
27 | int64_t opal_console_read(int64_t term_number, uint64_t *length, u8 *buffer); | 28 | int64_t opal_console_read(int64_t term_number, uint64_t *length, u8 *buffer); |
28 | int64_t opal_console_write_buffer_space(uint64_t term_number, uint64_t *length); | 29 | int64_t opal_console_write_buffer_space(uint64_t term_number, uint64_t *length); |
29 | int64_t opal_console_flush(uint64_t term_number); | 30 | int64_t opal_console_flush(uint64_t term_number); |
30 | int64_t opal_poll_events(uint64_t *outstanding_event_mask); | 31 | int64_t opal_poll_events(uint64_t *outstanding_event_mask); |
31 | 32 | ||
33 | void opal_kentry(unsigned long fdt_addr, void *vmlinux_addr); | ||
34 | |||
32 | static int opal_con_open(void) | 35 | static int opal_con_open(void) |
33 | { | 36 | { |
37 | /* | ||
38 | * When OPAL loads the boot kernel it stashes the OPAL base and entry | ||
39 | * address in r8 and r9 so the kernel can use the OPAL console | ||
40 | * before unflattening the devicetree. While executing the wrapper will | ||
41 | * probably trash r8 and r9 so this kentry hook restores them before | ||
42 | * entering the decompressed kernel. | ||
43 | */ | ||
44 | platform_ops.kentry = opal_kentry; | ||
34 | return 0; | 45 | return 0; |
35 | } | 46 | } |
36 | 47 | ||
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index 309d1b127e96..fad1862f4b2d 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h | |||
@@ -30,6 +30,7 @@ struct platform_ops { | |||
30 | void * (*realloc)(void *ptr, unsigned long size); | 30 | void * (*realloc)(void *ptr, unsigned long size); |
31 | void (*exit)(void); | 31 | void (*exit)(void); |
32 | void * (*vmlinux_alloc)(unsigned long size); | 32 | void * (*vmlinux_alloc)(unsigned long size); |
33 | void (*kentry)(unsigned long fdt_addr, void *vmlinux_addr); | ||
33 | }; | 34 | }; |
34 | extern struct platform_ops platform_ops; | 35 | extern struct platform_ops platform_ops; |
35 | 36 | ||
diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h index d1492736d852..e0baba1535e6 100644 --- a/arch/powerpc/include/asm/asm-prototypes.h +++ b/arch/powerpc/include/asm/asm-prototypes.h | |||
@@ -14,6 +14,10 @@ | |||
14 | 14 | ||
15 | #include <linux/threads.h> | 15 | #include <linux/threads.h> |
16 | #include <linux/kprobes.h> | 16 | #include <linux/kprobes.h> |
17 | #include <asm/cacheflush.h> | ||
18 | #include <asm/checksum.h> | ||
19 | #include <asm/uaccess.h> | ||
20 | #include <asm/epapr_hcalls.h> | ||
17 | 21 | ||
18 | #include <uapi/asm/ucontext.h> | 22 | #include <uapi/asm/ucontext.h> |
19 | 23 | ||
@@ -109,4 +113,12 @@ void early_setup_secondary(void); | |||
109 | /* time */ | 113 | /* time */ |
110 | void accumulate_stolen_time(void); | 114 | void accumulate_stolen_time(void); |
111 | 115 | ||
116 | /* misc runtime */ | ||
117 | extern u64 __bswapdi2(u64); | ||
118 | extern s64 __lshrdi3(s64, int); | ||
119 | extern s64 __ashldi3(s64, int); | ||
120 | extern s64 __ashrdi3(s64, int); | ||
121 | extern int __cmpdi2(s64, s64); | ||
122 | extern int __ucmpdi2(u64, u64); | ||
123 | |||
112 | #endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */ | 124 | #endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */ |
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index e88368354e49..e311c25751a4 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h | |||
@@ -29,6 +29,12 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * Kernel read only support. | ||
33 | * We added the ppp value 0b110 in ISA 2.04. | ||
34 | */ | ||
35 | #define MMU_FTR_KERNEL_RO ASM_CONST(0x00004000) | ||
36 | |||
37 | /* | ||
32 | * We need to clear top 16bits of va (from the remaining 64 bits )in | 38 | * We need to clear top 16bits of va (from the remaining 64 bits )in |
33 | * tlbie* instructions | 39 | * tlbie* instructions |
34 | */ | 40 | */ |
@@ -103,10 +109,10 @@ | |||
103 | #define MMU_FTRS_POWER4 MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | 109 | #define MMU_FTRS_POWER4 MMU_FTRS_DEFAULT_HPTE_ARCH_V2 |
104 | #define MMU_FTRS_PPC970 MMU_FTRS_POWER4 | MMU_FTR_TLBIE_CROP_VA | 110 | #define MMU_FTRS_PPC970 MMU_FTRS_POWER4 | MMU_FTR_TLBIE_CROP_VA |
105 | #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 111 | #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE |
106 | #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 112 | #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO |
107 | #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 113 | #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO |
108 | #define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 114 | #define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO |
109 | #define MMU_FTRS_POWER9 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 115 | #define MMU_FTRS_POWER9 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO |
110 | #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ | 116 | #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ |
111 | MMU_FTR_CI_LARGE_PAGE | 117 | MMU_FTR_CI_LARGE_PAGE |
112 | #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ | 118 | #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 9cd4e8cbc78c..9e1499f98def 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -355,6 +355,7 @@ | |||
355 | #define LPCR_PECE0 ASM_CONST(0x0000000000004000) /* ext. exceptions can cause exit */ | 355 | #define LPCR_PECE0 ASM_CONST(0x0000000000004000) /* ext. exceptions can cause exit */ |
356 | #define LPCR_PECE1 ASM_CONST(0x0000000000002000) /* decrementer can cause exit */ | 356 | #define LPCR_PECE1 ASM_CONST(0x0000000000002000) /* decrementer can cause exit */ |
357 | #define LPCR_PECE2 ASM_CONST(0x0000000000001000) /* machine check etc can cause exit */ | 357 | #define LPCR_PECE2 ASM_CONST(0x0000000000001000) /* machine check etc can cause exit */ |
358 | #define LPCR_PECE_HVEE ASM_CONST(0x0000400000000000) /* P9 Wakeup on HV interrupts */ | ||
358 | #define LPCR_MER ASM_CONST(0x0000000000000800) /* Mediated External Exception */ | 359 | #define LPCR_MER ASM_CONST(0x0000000000000800) /* Mediated External Exception */ |
359 | #define LPCR_MER_SH 11 | 360 | #define LPCR_MER_SH 11 |
360 | #define LPCR_TC ASM_CONST(0x0000000000000200) /* Translation control */ | 361 | #define LPCR_TC ASM_CONST(0x0000000000000200) /* Translation control */ |
diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S index 52ff3f025437..37c027ca83b2 100644 --- a/arch/powerpc/kernel/cpu_setup_power.S +++ b/arch/powerpc/kernel/cpu_setup_power.S | |||
@@ -98,8 +98,8 @@ _GLOBAL(__setup_cpu_power9) | |||
98 | li r0,0 | 98 | li r0,0 |
99 | mtspr SPRN_LPID,r0 | 99 | mtspr SPRN_LPID,r0 |
100 | mfspr r3,SPRN_LPCR | 100 | mfspr r3,SPRN_LPCR |
101 | ori r3, r3, LPCR_PECEDH | 101 | LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE) |
102 | ori r3, r3, LPCR_HVICE | 102 | or r3, r3, r4 |
103 | bl __init_LPCR | 103 | bl __init_LPCR |
104 | bl __init_HFSCR | 104 | bl __init_HFSCR |
105 | bl __init_tlb_power9 | 105 | bl __init_tlb_power9 |
@@ -118,8 +118,8 @@ _GLOBAL(__restore_cpu_power9) | |||
118 | li r0,0 | 118 | li r0,0 |
119 | mtspr SPRN_LPID,r0 | 119 | mtspr SPRN_LPID,r0 |
120 | mfspr r3,SPRN_LPCR | 120 | mfspr r3,SPRN_LPCR |
121 | ori r3, r3, LPCR_PECEDH | 121 | LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE) |
122 | ori r3, r3, LPCR_HVICE | 122 | or r3, r3, r4 |
123 | bl __init_LPCR | 123 | bl __init_LPCR |
124 | bl __init_HFSCR | 124 | bl __init_HFSCR |
125 | bl __init_tlb_power9 | 125 | bl __init_tlb_power9 |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 5503078090cd..78dabf065ba9 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -193,8 +193,12 @@ unsigned long htab_convert_pte_flags(unsigned long pteflags) | |||
193 | /* | 193 | /* |
194 | * Kernel read only mapped with ppp bits 0b110 | 194 | * Kernel read only mapped with ppp bits 0b110 |
195 | */ | 195 | */ |
196 | if (!(pteflags & _PAGE_WRITE)) | 196 | if (!(pteflags & _PAGE_WRITE)) { |
197 | rflags |= (HPTE_R_PP0 | 0x2); | 197 | if (mmu_has_feature(MMU_FTR_KERNEL_RO)) |
198 | rflags |= (HPTE_R_PP0 | 0x2); | ||
199 | else | ||
200 | rflags |= 0x3; | ||
201 | } | ||
198 | } else { | 202 | } else { |
199 | if (pteflags & _PAGE_RWX) | 203 | if (pteflags & _PAGE_RWX) |
200 | rflags |= 0x2; | 204 | rflags |= 0x2; |
diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c index 178989e6d3e3..ea960d660917 100644 --- a/arch/tile/kernel/time.c +++ b/arch/tile/kernel/time.c | |||
@@ -218,8 +218,8 @@ void do_timer_interrupt(struct pt_regs *regs, int fault_num) | |||
218 | */ | 218 | */ |
219 | unsigned long long sched_clock(void) | 219 | unsigned long long sched_clock(void) |
220 | { | 220 | { |
221 | return clocksource_cyc2ns(get_cycles(), | 221 | return mult_frac(get_cycles(), |
222 | sched_clock_mult, SCHED_CLOCK_SHIFT); | 222 | sched_clock_mult, 1ULL << SCHED_CLOCK_SHIFT); |
223 | } | 223 | } |
224 | 224 | ||
225 | int setup_profiling_timer(unsigned int multiplier) | 225 | int setup_profiling_timer(unsigned int multiplier) |
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 536ccfcc01c6..34d9e15857c3 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
@@ -40,8 +40,8 @@ GCOV_PROFILE := n | |||
40 | UBSAN_SANITIZE :=n | 40 | UBSAN_SANITIZE :=n |
41 | 41 | ||
42 | LDFLAGS := -m elf_$(UTS_MACHINE) | 42 | LDFLAGS := -m elf_$(UTS_MACHINE) |
43 | ifeq ($(CONFIG_RELOCATABLE),y) | 43 | # Compressed kernel should be built as PIE since it may be loaded at any |
44 | # If kernel is relocatable, build compressed kernel as PIE. | 44 | # address by the bootloader. |
45 | ifeq ($(CONFIG_X86_32),y) | 45 | ifeq ($(CONFIG_X86_32),y) |
46 | LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker) | 46 | LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker) |
47 | else | 47 | else |
@@ -51,7 +51,6 @@ else | |||
51 | LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ | 51 | LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ |
52 | && echo "-z noreloc-overflow -pie --no-dynamic-linker") | 52 | && echo "-z noreloc-overflow -pie --no-dynamic-linker") |
53 | endif | 53 | endif |
54 | endif | ||
55 | LDFLAGS_vmlinux := -T | 54 | LDFLAGS_vmlinux := -T |
56 | 55 | ||
57 | hostprogs-y := mkpiggy | 56 | hostprogs-y := mkpiggy |
diff --git a/arch/x86/boot/cpu.c b/arch/x86/boot/cpu.c index 26240dde081e..4224ede43b4e 100644 --- a/arch/x86/boot/cpu.c +++ b/arch/x86/boot/cpu.c | |||
@@ -87,6 +87,12 @@ int validate_cpu(void) | |||
87 | return -1; | 87 | return -1; |
88 | } | 88 | } |
89 | 89 | ||
90 | if (CONFIG_X86_MINIMUM_CPU_FAMILY <= 4 && !IS_ENABLED(CONFIG_M486) && | ||
91 | !has_eflag(X86_EFLAGS_ID)) { | ||
92 | printf("This kernel requires a CPU with the CPUID instruction. Build with CONFIG_M486=y to run on this CPU.\n"); | ||
93 | return -1; | ||
94 | } | ||
95 | |||
90 | if (err_flags) { | 96 | if (err_flags) { |
91 | puts("This kernel requires the following features " | 97 | puts("This kernel requires the following features " |
92 | "not present on the CPU:\n"); | 98 | "not present on the CPU:\n"); |
diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index f5f4b3fbbbc2..afb222b63cae 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c | |||
@@ -662,7 +662,13 @@ static int __init amd_core_pmu_init(void) | |||
662 | pr_cont("Fam15h "); | 662 | pr_cont("Fam15h "); |
663 | x86_pmu.get_event_constraints = amd_get_event_constraints_f15h; | 663 | x86_pmu.get_event_constraints = amd_get_event_constraints_f15h; |
664 | break; | 664 | break; |
665 | 665 | case 0x17: | |
666 | pr_cont("Fam17h "); | ||
667 | /* | ||
668 | * In family 17h, there are no event constraints in the PMC hardware. | ||
669 | * We fallback to using default amd_get_event_constraints. | ||
670 | */ | ||
671 | break; | ||
666 | default: | 672 | default: |
667 | pr_err("core perfctr but no constraints; unknown hardware!\n"); | 673 | pr_err("core perfctr but no constraints; unknown hardware!\n"); |
668 | return -ENODEV; | 674 | return -ENODEV; |
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index d31735f37ed7..9d4bf3ab049e 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c | |||
@@ -2352,7 +2352,7 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *ent | |||
2352 | frame.next_frame = 0; | 2352 | frame.next_frame = 0; |
2353 | frame.return_address = 0; | 2353 | frame.return_address = 0; |
2354 | 2354 | ||
2355 | if (!access_ok(VERIFY_READ, fp, 8)) | 2355 | if (!valid_user_frame(fp, sizeof(frame))) |
2356 | break; | 2356 | break; |
2357 | 2357 | ||
2358 | bytes = __copy_from_user_nmi(&frame.next_frame, fp, 4); | 2358 | bytes = __copy_from_user_nmi(&frame.next_frame, fp, 4); |
@@ -2362,9 +2362,6 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *ent | |||
2362 | if (bytes != 0) | 2362 | if (bytes != 0) |
2363 | break; | 2363 | break; |
2364 | 2364 | ||
2365 | if (!valid_user_frame(fp, sizeof(frame))) | ||
2366 | break; | ||
2367 | |||
2368 | perf_callchain_store(entry, cs_base + frame.return_address); | 2365 | perf_callchain_store(entry, cs_base + frame.return_address); |
2369 | fp = compat_ptr(ss_base + frame.next_frame); | 2366 | fp = compat_ptr(ss_base + frame.next_frame); |
2370 | } | 2367 | } |
@@ -2413,7 +2410,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs | |||
2413 | frame.next_frame = NULL; | 2410 | frame.next_frame = NULL; |
2414 | frame.return_address = 0; | 2411 | frame.return_address = 0; |
2415 | 2412 | ||
2416 | if (!access_ok(VERIFY_READ, fp, sizeof(*fp) * 2)) | 2413 | if (!valid_user_frame(fp, sizeof(frame))) |
2417 | break; | 2414 | break; |
2418 | 2415 | ||
2419 | bytes = __copy_from_user_nmi(&frame.next_frame, fp, sizeof(*fp)); | 2416 | bytes = __copy_from_user_nmi(&frame.next_frame, fp, sizeof(*fp)); |
@@ -2423,9 +2420,6 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs | |||
2423 | if (bytes != 0) | 2420 | if (bytes != 0) |
2424 | break; | 2421 | break; |
2425 | 2422 | ||
2426 | if (!valid_user_frame(fp, sizeof(frame))) | ||
2427 | break; | ||
2428 | |||
2429 | perf_callchain_store(entry, frame.return_address); | 2423 | perf_callchain_store(entry, frame.return_address); |
2430 | fp = (void __user *)frame.next_frame; | 2424 | fp = (void __user *)frame.next_frame; |
2431 | } | 2425 | } |
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index 0319311dbdbb..be202390bbd3 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c | |||
@@ -1108,20 +1108,20 @@ static void setup_pebs_sample_data(struct perf_event *event, | |||
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | /* | 1110 | /* |
1111 | * We use the interrupt regs as a base because the PEBS record | 1111 | * We use the interrupt regs as a base because the PEBS record does not |
1112 | * does not contain a full regs set, specifically it seems to | 1112 | * contain a full regs set, specifically it seems to lack segment |
1113 | * lack segment descriptors, which get used by things like | 1113 | * descriptors, which get used by things like user_mode(). |
1114 | * user_mode(). | ||
1115 | * | 1114 | * |
1116 | * In the simple case fix up only the IP and BP,SP regs, for | 1115 | * In the simple case fix up only the IP for PERF_SAMPLE_IP. |
1117 | * PERF_SAMPLE_IP and PERF_SAMPLE_CALLCHAIN to function properly. | 1116 | * |
1118 | * A possible PERF_SAMPLE_REGS will have to transfer all regs. | 1117 | * We must however always use BP,SP from iregs for the unwinder to stay |
1118 | * sane; the record BP,SP can point into thin air when the record is | ||
1119 | * from a previous PMI context or an (I)RET happend between the record | ||
1120 | * and PMI. | ||
1119 | */ | 1121 | */ |
1120 | *regs = *iregs; | 1122 | *regs = *iregs; |
1121 | regs->flags = pebs->flags; | 1123 | regs->flags = pebs->flags; |
1122 | set_linear_ip(regs, pebs->ip); | 1124 | set_linear_ip(regs, pebs->ip); |
1123 | regs->bp = pebs->bp; | ||
1124 | regs->sp = pebs->sp; | ||
1125 | 1125 | ||
1126 | if (sample_type & PERF_SAMPLE_REGS_INTR) { | 1126 | if (sample_type & PERF_SAMPLE_REGS_INTR) { |
1127 | regs->ax = pebs->ax; | 1127 | regs->ax = pebs->ax; |
@@ -1130,10 +1130,21 @@ static void setup_pebs_sample_data(struct perf_event *event, | |||
1130 | regs->dx = pebs->dx; | 1130 | regs->dx = pebs->dx; |
1131 | regs->si = pebs->si; | 1131 | regs->si = pebs->si; |
1132 | regs->di = pebs->di; | 1132 | regs->di = pebs->di; |
1133 | regs->bp = pebs->bp; | ||
1134 | regs->sp = pebs->sp; | ||
1135 | 1133 | ||
1136 | regs->flags = pebs->flags; | 1134 | /* |
1135 | * Per the above; only set BP,SP if we don't need callchains. | ||
1136 | * | ||
1137 | * XXX: does this make sense? | ||
1138 | */ | ||
1139 | if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) { | ||
1140 | regs->bp = pebs->bp; | ||
1141 | regs->sp = pebs->sp; | ||
1142 | } | ||
1143 | |||
1144 | /* | ||
1145 | * Preserve PERF_EFLAGS_VM from set_linear_ip(). | ||
1146 | */ | ||
1147 | regs->flags = pebs->flags | (regs->flags & PERF_EFLAGS_VM); | ||
1137 | #ifndef CONFIG_X86_32 | 1148 | #ifndef CONFIG_X86_32 |
1138 | regs->r8 = pebs->r8; | 1149 | regs->r8 = pebs->r8; |
1139 | regs->r9 = pebs->r9; | 1150 | regs->r9 = pebs->r9; |
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index efca2685d876..dbaaf7dc8373 100644 --- a/arch/x86/events/intel/uncore.c +++ b/arch/x86/events/intel/uncore.c | |||
@@ -319,9 +319,9 @@ static struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, | |||
319 | */ | 319 | */ |
320 | static int uncore_pmu_event_init(struct perf_event *event); | 320 | static int uncore_pmu_event_init(struct perf_event *event); |
321 | 321 | ||
322 | static bool is_uncore_event(struct perf_event *event) | 322 | static bool is_box_event(struct intel_uncore_box *box, struct perf_event *event) |
323 | { | 323 | { |
324 | return event->pmu->event_init == uncore_pmu_event_init; | 324 | return &box->pmu->pmu == event->pmu; |
325 | } | 325 | } |
326 | 326 | ||
327 | static int | 327 | static int |
@@ -340,7 +340,7 @@ uncore_collect_events(struct intel_uncore_box *box, struct perf_event *leader, | |||
340 | 340 | ||
341 | n = box->n_events; | 341 | n = box->n_events; |
342 | 342 | ||
343 | if (is_uncore_event(leader)) { | 343 | if (is_box_event(box, leader)) { |
344 | box->event_list[n] = leader; | 344 | box->event_list[n] = leader; |
345 | n++; | 345 | n++; |
346 | } | 346 | } |
@@ -349,7 +349,7 @@ uncore_collect_events(struct intel_uncore_box *box, struct perf_event *leader, | |||
349 | return n; | 349 | return n; |
350 | 350 | ||
351 | list_for_each_entry(event, &leader->sibling_list, group_entry) { | 351 | list_for_each_entry(event, &leader->sibling_list, group_entry) { |
352 | if (!is_uncore_event(event) || | 352 | if (!is_box_event(box, event) || |
353 | event->state <= PERF_EVENT_STATE_OFF) | 353 | event->state <= PERF_EVENT_STATE_OFF) |
354 | continue; | 354 | continue; |
355 | 355 | ||
diff --git a/arch/x86/events/intel/uncore_snb.c b/arch/x86/events/intel/uncore_snb.c index 81195cca7eae..a3dcc12bef4a 100644 --- a/arch/x86/events/intel/uncore_snb.c +++ b/arch/x86/events/intel/uncore_snb.c | |||
@@ -490,24 +490,12 @@ static int snb_uncore_imc_event_add(struct perf_event *event, int flags) | |||
490 | 490 | ||
491 | snb_uncore_imc_event_start(event, 0); | 491 | snb_uncore_imc_event_start(event, 0); |
492 | 492 | ||
493 | box->n_events++; | ||
494 | |||
495 | return 0; | 493 | return 0; |
496 | } | 494 | } |
497 | 495 | ||
498 | static void snb_uncore_imc_event_del(struct perf_event *event, int flags) | 496 | static void snb_uncore_imc_event_del(struct perf_event *event, int flags) |
499 | { | 497 | { |
500 | struct intel_uncore_box *box = uncore_event_to_box(event); | ||
501 | int i; | ||
502 | |||
503 | snb_uncore_imc_event_stop(event, PERF_EF_UPDATE); | 498 | snb_uncore_imc_event_stop(event, PERF_EF_UPDATE); |
504 | |||
505 | for (i = 0; i < box->n_events; i++) { | ||
506 | if (event == box->event_list[i]) { | ||
507 | --box->n_events; | ||
508 | break; | ||
509 | } | ||
510 | } | ||
511 | } | 499 | } |
512 | 500 | ||
513 | int snb_pci2phy_map_init(int devid) | 501 | int snb_pci2phy_map_init(int devid) |
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h index 5874d8de1f8d..a77ee026643d 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h | |||
@@ -113,7 +113,7 @@ struct debug_store { | |||
113 | * Per register state. | 113 | * Per register state. |
114 | */ | 114 | */ |
115 | struct er_account { | 115 | struct er_account { |
116 | raw_spinlock_t lock; /* per-core: protect structure */ | 116 | raw_spinlock_t lock; /* per-core: protect structure */ |
117 | u64 config; /* extra MSR config */ | 117 | u64 config; /* extra MSR config */ |
118 | u64 reg; /* extra MSR number */ | 118 | u64 reg; /* extra MSR number */ |
119 | atomic_t ref; /* reference count */ | 119 | atomic_t ref; /* reference count */ |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 9b7cf5c28f5f..85f854b98a9d 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -112,7 +112,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
112 | for (; stack < stack_info.end; stack++) { | 112 | for (; stack < stack_info.end; stack++) { |
113 | unsigned long real_addr; | 113 | unsigned long real_addr; |
114 | int reliable = 0; | 114 | int reliable = 0; |
115 | unsigned long addr = *stack; | 115 | unsigned long addr = READ_ONCE_NOCHECK(*stack); |
116 | unsigned long *ret_addr_p = | 116 | unsigned long *ret_addr_p = |
117 | unwind_get_return_address_ptr(&state); | 117 | unwind_get_return_address_ptr(&state); |
118 | 118 | ||
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 47004010ad5d..ebb4e95fbd74 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c | |||
@@ -521,14 +521,14 @@ void fpu__clear(struct fpu *fpu) | |||
521 | { | 521 | { |
522 | WARN_ON_FPU(fpu != ¤t->thread.fpu); /* Almost certainly an anomaly */ | 522 | WARN_ON_FPU(fpu != ¤t->thread.fpu); /* Almost certainly an anomaly */ |
523 | 523 | ||
524 | if (!use_eager_fpu() || !static_cpu_has(X86_FEATURE_FPU)) { | 524 | fpu__drop(fpu); |
525 | /* FPU state will be reallocated lazily at the first use. */ | 525 | |
526 | fpu__drop(fpu); | 526 | /* |
527 | } else { | 527 | * Make sure fpstate is cleared and initialized. |
528 | if (!fpu->fpstate_active) { | 528 | */ |
529 | fpu__activate_curr(fpu); | 529 | if (static_cpu_has(X86_FEATURE_FPU)) { |
530 | user_fpu_begin(); | 530 | fpu__activate_curr(fpu); |
531 | } | 531 | user_fpu_begin(); |
532 | copy_init_fpstate_to_fpregs(); | 532 | copy_init_fpstate_to_fpregs(); |
533 | } | 533 | } |
534 | } | 534 | } |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index b6b2f0264af3..2dabea46f039 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -665,14 +665,17 @@ __PAGE_ALIGNED_BSS | |||
665 | initial_pg_pmd: | 665 | initial_pg_pmd: |
666 | .fill 1024*KPMDS,4,0 | 666 | .fill 1024*KPMDS,4,0 |
667 | #else | 667 | #else |
668 | ENTRY(initial_page_table) | 668 | .globl initial_page_table |
669 | initial_page_table: | ||
669 | .fill 1024,4,0 | 670 | .fill 1024,4,0 |
670 | #endif | 671 | #endif |
671 | initial_pg_fixmap: | 672 | initial_pg_fixmap: |
672 | .fill 1024,4,0 | 673 | .fill 1024,4,0 |
673 | ENTRY(empty_zero_page) | 674 | .globl empty_zero_page |
675 | empty_zero_page: | ||
674 | .fill 4096,1,0 | 676 | .fill 4096,1,0 |
675 | ENTRY(swapper_pg_dir) | 677 | .globl swapper_pg_dir |
678 | swapper_pg_dir: | ||
676 | .fill 1024,4,0 | 679 | .fill 1024,4,0 |
677 | EXPORT_SYMBOL(empty_zero_page) | 680 | EXPORT_SYMBOL(empty_zero_page) |
678 | 681 | ||
diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c index 764a29f84de7..85195d447a92 100644 --- a/arch/x86/kernel/sysfb_simplefb.c +++ b/arch/x86/kernel/sysfb_simplefb.c | |||
@@ -66,13 +66,36 @@ __init int create_simplefb(const struct screen_info *si, | |||
66 | { | 66 | { |
67 | struct platform_device *pd; | 67 | struct platform_device *pd; |
68 | struct resource res; | 68 | struct resource res; |
69 | unsigned long len; | 69 | u64 base, size; |
70 | u32 length; | ||
70 | 71 | ||
71 | /* don't use lfb_size as it may contain the whole VMEM instead of only | 72 | /* |
72 | * the part that is occupied by the framebuffer */ | 73 | * If the 64BIT_BASE capability is set, ext_lfb_base will contain the |
73 | len = mode->height * mode->stride; | 74 | * upper half of the base address. Assemble the address, then make sure |
74 | len = PAGE_ALIGN(len); | 75 | * it is valid and we can actually access it. |
75 | if (len > (u64)si->lfb_size << 16) { | 76 | */ |
77 | base = si->lfb_base; | ||
78 | if (si->capabilities & VIDEO_CAPABILITY_64BIT_BASE) | ||
79 | base |= (u64)si->ext_lfb_base << 32; | ||
80 | if (!base || (u64)(resource_size_t)base != base) { | ||
81 | printk(KERN_DEBUG "sysfb: inaccessible VRAM base\n"); | ||
82 | return -EINVAL; | ||
83 | } | ||
84 | |||
85 | /* | ||
86 | * Don't use lfb_size as IORESOURCE size, since it may contain the | ||
87 | * entire VMEM, and thus require huge mappings. Use just the part we | ||
88 | * need, that is, the part where the framebuffer is located. But verify | ||
89 | * that it does not exceed the advertised VMEM. | ||
90 | * Note that in case of VBE, the lfb_size is shifted by 16 bits for | ||
91 | * historical reasons. | ||
92 | */ | ||
93 | size = si->lfb_size; | ||
94 | if (si->orig_video_isVGA == VIDEO_TYPE_VLFB) | ||
95 | size <<= 16; | ||
96 | length = mode->height * mode->stride; | ||
97 | length = PAGE_ALIGN(length); | ||
98 | if (length > size) { | ||
76 | printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n"); | 99 | printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n"); |
77 | return -EINVAL; | 100 | return -EINVAL; |
78 | } | 101 | } |
@@ -81,8 +104,8 @@ __init int create_simplefb(const struct screen_info *si, | |||
81 | memset(&res, 0, sizeof(res)); | 104 | memset(&res, 0, sizeof(res)); |
82 | res.flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 105 | res.flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
83 | res.name = simplefb_resname; | 106 | res.name = simplefb_resname; |
84 | res.start = si->lfb_base; | 107 | res.start = base; |
85 | res.end = si->lfb_base + len - 1; | 108 | res.end = res.start + length - 1; |
86 | if (res.end <= res.start) | 109 | if (res.end <= res.start) |
87 | return -EINVAL; | 110 | return -EINVAL; |
88 | 111 | ||
diff --git a/arch/x86/kernel/unwind_guess.c b/arch/x86/kernel/unwind_guess.c index 2d721e533cf4..b80e8bf43cc6 100644 --- a/arch/x86/kernel/unwind_guess.c +++ b/arch/x86/kernel/unwind_guess.c | |||
@@ -7,11 +7,13 @@ | |||
7 | 7 | ||
8 | unsigned long unwind_get_return_address(struct unwind_state *state) | 8 | unsigned long unwind_get_return_address(struct unwind_state *state) |
9 | { | 9 | { |
10 | unsigned long addr = READ_ONCE_NOCHECK(*state->sp); | ||
11 | |||
10 | if (unwind_done(state)) | 12 | if (unwind_done(state)) |
11 | return 0; | 13 | return 0; |
12 | 14 | ||
13 | return ftrace_graph_ret_addr(state->task, &state->graph_idx, | 15 | return ftrace_graph_ret_addr(state->task, &state->graph_idx, |
14 | *state->sp, state->sp); | 16 | addr, state->sp); |
15 | } | 17 | } |
16 | EXPORT_SYMBOL_GPL(unwind_get_return_address); | 18 | EXPORT_SYMBOL_GPL(unwind_get_return_address); |
17 | 19 | ||
@@ -23,8 +25,10 @@ bool unwind_next_frame(struct unwind_state *state) | |||
23 | return false; | 25 | return false; |
24 | 26 | ||
25 | do { | 27 | do { |
28 | unsigned long addr = READ_ONCE_NOCHECK(*state->sp); | ||
29 | |||
26 | for (state->sp++; state->sp < info->end; state->sp++) | 30 | for (state->sp++; state->sp < info->end; state->sp++) |
27 | if (__kernel_text_address(*state->sp)) | 31 | if (__kernel_text_address(addr)) |
28 | return true; | 32 | return true; |
29 | 33 | ||
30 | state->sp = info->next_sp; | 34 | state->sp = info->next_sp; |
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index cbd7b92585bb..a3ce9d260d68 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2105,16 +2105,10 @@ static int em_iret(struct x86_emulate_ctxt *ctxt) | |||
2105 | static int em_jmp_far(struct x86_emulate_ctxt *ctxt) | 2105 | static int em_jmp_far(struct x86_emulate_ctxt *ctxt) |
2106 | { | 2106 | { |
2107 | int rc; | 2107 | int rc; |
2108 | unsigned short sel, old_sel; | 2108 | unsigned short sel; |
2109 | struct desc_struct old_desc, new_desc; | 2109 | struct desc_struct new_desc; |
2110 | const struct x86_emulate_ops *ops = ctxt->ops; | ||
2111 | u8 cpl = ctxt->ops->cpl(ctxt); | 2110 | u8 cpl = ctxt->ops->cpl(ctxt); |
2112 | 2111 | ||
2113 | /* Assignment of RIP may only fail in 64-bit mode */ | ||
2114 | if (ctxt->mode == X86EMUL_MODE_PROT64) | ||
2115 | ops->get_segment(ctxt, &old_sel, &old_desc, NULL, | ||
2116 | VCPU_SREG_CS); | ||
2117 | |||
2118 | memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); | 2112 | memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); |
2119 | 2113 | ||
2120 | rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, | 2114 | rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, |
@@ -2124,12 +2118,10 @@ static int em_jmp_far(struct x86_emulate_ctxt *ctxt) | |||
2124 | return rc; | 2118 | return rc; |
2125 | 2119 | ||
2126 | rc = assign_eip_far(ctxt, ctxt->src.val, &new_desc); | 2120 | rc = assign_eip_far(ctxt, ctxt->src.val, &new_desc); |
2127 | if (rc != X86EMUL_CONTINUE) { | 2121 | /* Error handling is not implemented. */ |
2128 | WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64); | 2122 | if (rc != X86EMUL_CONTINUE) |
2129 | /* assigning eip failed; restore the old cs */ | 2123 | return X86EMUL_UNHANDLEABLE; |
2130 | ops->set_segment(ctxt, old_sel, &old_desc, 0, VCPU_SREG_CS); | 2124 | |
2131 | return rc; | ||
2132 | } | ||
2133 | return rc; | 2125 | return rc; |
2134 | } | 2126 | } |
2135 | 2127 | ||
@@ -2189,14 +2181,8 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt) | |||
2189 | { | 2181 | { |
2190 | int rc; | 2182 | int rc; |
2191 | unsigned long eip, cs; | 2183 | unsigned long eip, cs; |
2192 | u16 old_cs; | ||
2193 | int cpl = ctxt->ops->cpl(ctxt); | 2184 | int cpl = ctxt->ops->cpl(ctxt); |
2194 | struct desc_struct old_desc, new_desc; | 2185 | struct desc_struct new_desc; |
2195 | const struct x86_emulate_ops *ops = ctxt->ops; | ||
2196 | |||
2197 | if (ctxt->mode == X86EMUL_MODE_PROT64) | ||
2198 | ops->get_segment(ctxt, &old_cs, &old_desc, NULL, | ||
2199 | VCPU_SREG_CS); | ||
2200 | 2186 | ||
2201 | rc = emulate_pop(ctxt, &eip, ctxt->op_bytes); | 2187 | rc = emulate_pop(ctxt, &eip, ctxt->op_bytes); |
2202 | if (rc != X86EMUL_CONTINUE) | 2188 | if (rc != X86EMUL_CONTINUE) |
@@ -2213,10 +2199,10 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt) | |||
2213 | if (rc != X86EMUL_CONTINUE) | 2199 | if (rc != X86EMUL_CONTINUE) |
2214 | return rc; | 2200 | return rc; |
2215 | rc = assign_eip_far(ctxt, eip, &new_desc); | 2201 | rc = assign_eip_far(ctxt, eip, &new_desc); |
2216 | if (rc != X86EMUL_CONTINUE) { | 2202 | /* Error handling is not implemented. */ |
2217 | WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64); | 2203 | if (rc != X86EMUL_CONTINUE) |
2218 | ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS); | 2204 | return X86EMUL_UNHANDLEABLE; |
2219 | } | 2205 | |
2220 | return rc; | 2206 | return rc; |
2221 | } | 2207 | } |
2222 | 2208 | ||
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index 1a22de70f7f7..6e219e5c07d2 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c | |||
@@ -94,7 +94,7 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic, | |||
94 | static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic) | 94 | static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic) |
95 | { | 95 | { |
96 | ioapic->rtc_status.pending_eoi = 0; | 96 | ioapic->rtc_status.pending_eoi = 0; |
97 | bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPUS); | 97 | bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID); |
98 | } | 98 | } |
99 | 99 | ||
100 | static void kvm_rtc_eoi_tracking_restore_all(struct kvm_ioapic *ioapic); | 100 | static void kvm_rtc_eoi_tracking_restore_all(struct kvm_ioapic *ioapic); |
diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h index 7d2692a49657..1cc6e54436db 100644 --- a/arch/x86/kvm/ioapic.h +++ b/arch/x86/kvm/ioapic.h | |||
@@ -42,13 +42,13 @@ struct kvm_vcpu; | |||
42 | 42 | ||
43 | struct dest_map { | 43 | struct dest_map { |
44 | /* vcpu bitmap where IRQ has been sent */ | 44 | /* vcpu bitmap where IRQ has been sent */ |
45 | DECLARE_BITMAP(map, KVM_MAX_VCPUS); | 45 | DECLARE_BITMAP(map, KVM_MAX_VCPU_ID); |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Vector sent to a given vcpu, only valid when | 48 | * Vector sent to a given vcpu, only valid when |
49 | * the vcpu's bit in map is set | 49 | * the vcpu's bit in map is set |
50 | */ | 50 | */ |
51 | u8 vectors[KVM_MAX_VCPUS]; | 51 | u8 vectors[KVM_MAX_VCPU_ID]; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | 54 | ||
diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c index 4da03030d5a7..6c0191615f23 100644 --- a/arch/x86/kvm/irq_comm.c +++ b/arch/x86/kvm/irq_comm.c | |||
@@ -41,6 +41,15 @@ static int kvm_set_pic_irq(struct kvm_kernel_irq_routing_entry *e, | |||
41 | bool line_status) | 41 | bool line_status) |
42 | { | 42 | { |
43 | struct kvm_pic *pic = pic_irqchip(kvm); | 43 | struct kvm_pic *pic = pic_irqchip(kvm); |
44 | |||
45 | /* | ||
46 | * XXX: rejecting pic routes when pic isn't in use would be better, | ||
47 | * but the default routing table is installed while kvm->arch.vpic is | ||
48 | * NULL and KVM_CREATE_IRQCHIP can race with KVM_IRQ_LINE. | ||
49 | */ | ||
50 | if (!pic) | ||
51 | return -1; | ||
52 | |||
44 | return kvm_pic_set_irq(pic, e->irqchip.pin, irq_source_id, level); | 53 | return kvm_pic_set_irq(pic, e->irqchip.pin, irq_source_id, level); |
45 | } | 54 | } |
46 | 55 | ||
@@ -49,6 +58,10 @@ static int kvm_set_ioapic_irq(struct kvm_kernel_irq_routing_entry *e, | |||
49 | bool line_status) | 58 | bool line_status) |
50 | { | 59 | { |
51 | struct kvm_ioapic *ioapic = kvm->arch.vioapic; | 60 | struct kvm_ioapic *ioapic = kvm->arch.vioapic; |
61 | |||
62 | if (!ioapic) | ||
63 | return -1; | ||
64 | |||
52 | return kvm_ioapic_set_irq(ioapic, e->irqchip.pin, irq_source_id, level, | 65 | return kvm_ioapic_set_irq(ioapic, e->irqchip.pin, irq_source_id, level, |
53 | line_status); | 66 | line_status); |
54 | } | 67 | } |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 23b99f305382..6f69340f9fa3 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -138,7 +138,7 @@ static inline bool kvm_apic_map_get_logical_dest(struct kvm_apic_map *map, | |||
138 | *mask = dest_id & 0xff; | 138 | *mask = dest_id & 0xff; |
139 | return true; | 139 | return true; |
140 | case KVM_APIC_MODE_XAPIC_CLUSTER: | 140 | case KVM_APIC_MODE_XAPIC_CLUSTER: |
141 | *cluster = map->xapic_cluster_map[dest_id >> 4]; | 141 | *cluster = map->xapic_cluster_map[(dest_id >> 4) & 0xf]; |
142 | *mask = dest_id & 0xf; | 142 | *mask = dest_id & 0xf; |
143 | return true; | 143 | return true; |
144 | default: | 144 | default: |
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c index 79ae939970d3..fcd06f7526de 100644 --- a/arch/x86/mm/extable.c +++ b/arch/x86/mm/extable.c | |||
@@ -135,7 +135,12 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr) | |||
135 | if (early_recursion_flag > 2) | 135 | if (early_recursion_flag > 2) |
136 | goto halt_loop; | 136 | goto halt_loop; |
137 | 137 | ||
138 | if (regs->cs != __KERNEL_CS) | 138 | /* |
139 | * Old CPUs leave the high bits of CS on the stack | ||
140 | * undefined. I'm not sure which CPUs do this, but at least | ||
141 | * the 486 DX works this way. | ||
142 | */ | ||
143 | if ((regs->cs & 0xFFFF) != __KERNEL_CS) | ||
139 | goto fail; | 144 | goto fail; |
140 | 145 | ||
141 | /* | 146 | /* |
diff --git a/arch/x86/platform/intel-mid/device_libs/Makefile b/arch/x86/platform/intel-mid/device_libs/Makefile index 429d08be7848..dd6cfa4ad3ac 100644 --- a/arch/x86/platform/intel-mid/device_libs/Makefile +++ b/arch/x86/platform/intel-mid/device_libs/Makefile | |||
@@ -28,4 +28,4 @@ obj-$(subst m,y,$(CONFIG_GPIO_PCA953X)) += platform_pcal9555a.o | |||
28 | obj-$(subst m,y,$(CONFIG_GPIO_PCA953X)) += platform_tca6416.o | 28 | obj-$(subst m,y,$(CONFIG_GPIO_PCA953X)) += platform_tca6416.o |
29 | # MISC Devices | 29 | # MISC Devices |
30 | obj-$(subst m,y,$(CONFIG_KEYBOARD_GPIO)) += platform_gpio_keys.o | 30 | obj-$(subst m,y,$(CONFIG_KEYBOARD_GPIO)) += platform_gpio_keys.o |
31 | obj-$(subst m,y,$(CONFIG_INTEL_MID_WATCHDOG)) += platform_wdt.o | 31 | obj-$(subst m,y,$(CONFIG_INTEL_MID_WATCHDOG)) += platform_mrfld_wdt.o |
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_wdt.c b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_wdt.c index de734134bc8d..3f1f1c77d090 100644 --- a/arch/x86/platform/intel-mid/device_libs/platform_wdt.c +++ b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_wdt.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * platform_wdt.c: Watchdog platform library file | 2 | * Intel Merrifield watchdog platform device library file |
3 | * | 3 | * |
4 | * (C) Copyright 2014 Intel Corporation | 4 | * (C) Copyright 2014 Intel Corporation |
5 | * Author: David Cohen <david.a.cohen@linux.intel.com> | 5 | * Author: David Cohen <david.a.cohen@linux.intel.com> |
@@ -14,7 +14,9 @@ | |||
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/platform_data/intel-mid_wdt.h> | 16 | #include <linux/platform_data/intel-mid_wdt.h> |
17 | |||
17 | #include <asm/intel-mid.h> | 18 | #include <asm/intel-mid.h> |
19 | #include <asm/intel_scu_ipc.h> | ||
18 | #include <asm/io_apic.h> | 20 | #include <asm/io_apic.h> |
19 | 21 | ||
20 | #define TANGIER_EXT_TIMER0_MSI 15 | 22 | #define TANGIER_EXT_TIMER0_MSI 15 |
@@ -50,14 +52,34 @@ static struct intel_mid_wdt_pdata tangier_pdata = { | |||
50 | .probe = tangier_probe, | 52 | .probe = tangier_probe, |
51 | }; | 53 | }; |
52 | 54 | ||
53 | static int __init register_mid_wdt(void) | 55 | static int wdt_scu_status_change(struct notifier_block *nb, |
56 | unsigned long code, void *data) | ||
54 | { | 57 | { |
55 | if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_TANGIER) { | 58 | if (code == SCU_DOWN) { |
56 | wdt_dev.dev.platform_data = &tangier_pdata; | 59 | platform_device_unregister(&wdt_dev); |
57 | return platform_device_register(&wdt_dev); | 60 | return 0; |
58 | } | 61 | } |
59 | 62 | ||
60 | return -ENODEV; | 63 | return platform_device_register(&wdt_dev); |
61 | } | 64 | } |
62 | 65 | ||
66 | static struct notifier_block wdt_scu_notifier = { | ||
67 | .notifier_call = wdt_scu_status_change, | ||
68 | }; | ||
69 | |||
70 | static int __init register_mid_wdt(void) | ||
71 | { | ||
72 | if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER) | ||
73 | return -ENODEV; | ||
74 | |||
75 | wdt_dev.dev.platform_data = &tangier_pdata; | ||
76 | |||
77 | /* | ||
78 | * We need to be sure that the SCU IPC is ready before watchdog device | ||
79 | * can be registered: | ||
80 | */ | ||
81 | intel_scu_notifier_add(&wdt_scu_notifier); | ||
82 | |||
83 | return 0; | ||
84 | } | ||
63 | rootfs_initcall(register_mid_wdt); | 85 | rootfs_initcall(register_mid_wdt); |
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 05e21b464433..d19b09cdf284 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c | |||
@@ -214,7 +214,7 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, | |||
214 | 214 | ||
215 | ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0); | 215 | ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0); |
216 | 216 | ||
217 | if (!result) { | 217 | if (!result && !ctx->more) { |
218 | err = af_alg_wait_for_completion( | 218 | err = af_alg_wait_for_completion( |
219 | crypto_ahash_init(&ctx->req), | 219 | crypto_ahash_init(&ctx->req), |
220 | &ctx->completion); | 220 | &ctx->completion); |
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 865f46ea724f..c80765b211cf 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c | |||
@@ -133,7 +133,6 @@ struct x509_certificate *x509_cert_parse(const void *data, size_t datalen) | |||
133 | return cert; | 133 | return cert; |
134 | 134 | ||
135 | error_decode: | 135 | error_decode: |
136 | kfree(cert->pub->key); | ||
137 | kfree(ctx); | 136 | kfree(ctx); |
138 | error_no_ctx: | 137 | error_no_ctx: |
139 | x509_free_certificate(cert); | 138 | x509_free_certificate(cert); |
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index 52ce17a3dd63..c16c94f88733 100644 --- a/crypto/scatterwalk.c +++ b/crypto/scatterwalk.c | |||
@@ -68,10 +68,6 @@ void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg, | |||
68 | 68 | ||
69 | sg = scatterwalk_ffwd(tmp, sg, start); | 69 | sg = scatterwalk_ffwd(tmp, sg, start); |
70 | 70 | ||
71 | if (sg_page(sg) == virt_to_page(buf) && | ||
72 | sg->offset == offset_in_page(buf)) | ||
73 | return; | ||
74 | |||
75 | scatterwalk_start(&walk, sg); | 71 | scatterwalk_start(&walk, sg); |
76 | scatterwalk_copychunks(buf, &walk, nbytes, out); | 72 | scatterwalk_copychunks(buf, &walk, nbytes, out); |
77 | scatterwalk_done(&walk, out, 0); | 73 | scatterwalk_done(&walk, out, 0); |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index deb0ff78eba8..54abb26b7366 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -47,32 +47,15 @@ static void acpi_sleep_tts_switch(u32 acpi_state) | |||
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | static void acpi_sleep_pts_switch(u32 acpi_state) | 50 | static int tts_notify_reboot(struct notifier_block *this, |
51 | { | ||
52 | acpi_status status; | ||
53 | |||
54 | status = acpi_execute_simple_method(NULL, "\\_PTS", acpi_state); | ||
55 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | ||
56 | /* | ||
57 | * OS can't evaluate the _PTS object correctly. Some warning | ||
58 | * message will be printed. But it won't break anything. | ||
59 | */ | ||
60 | printk(KERN_NOTICE "Failure in evaluating _PTS object\n"); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | static int sleep_notify_reboot(struct notifier_block *this, | ||
65 | unsigned long code, void *x) | 51 | unsigned long code, void *x) |
66 | { | 52 | { |
67 | acpi_sleep_tts_switch(ACPI_STATE_S5); | 53 | acpi_sleep_tts_switch(ACPI_STATE_S5); |
68 | |||
69 | acpi_sleep_pts_switch(ACPI_STATE_S5); | ||
70 | |||
71 | return NOTIFY_DONE; | 54 | return NOTIFY_DONE; |
72 | } | 55 | } |
73 | 56 | ||
74 | static struct notifier_block sleep_notifier = { | 57 | static struct notifier_block tts_notifier = { |
75 | .notifier_call = sleep_notify_reboot, | 58 | .notifier_call = tts_notify_reboot, |
76 | .next = NULL, | 59 | .next = NULL, |
77 | .priority = 0, | 60 | .priority = 0, |
78 | }; | 61 | }; |
@@ -916,9 +899,9 @@ int __init acpi_sleep_init(void) | |||
916 | pr_info(PREFIX "(supports%s)\n", supported); | 899 | pr_info(PREFIX "(supports%s)\n", supported); |
917 | 900 | ||
918 | /* | 901 | /* |
919 | * Register the sleep_notifier to reboot notifier list so that the _TTS | 902 | * Register the tts_notifier to reboot notifier list so that the _TTS |
920 | * and _PTS object can also be evaluated when the system enters S5. | 903 | * object can also be evaluated when the system enters S5. |
921 | */ | 904 | */ |
922 | register_reboot_notifier(&sleep_notifier); | 905 | register_reboot_notifier(&tts_notifier); |
923 | return 0; | 906 | return 0; |
924 | } | 907 | } |
diff --git a/drivers/clk/berlin/bg2.c b/drivers/clk/berlin/bg2.c index edf3b96b3b73..1d99292e2039 100644 --- a/drivers/clk/berlin/bg2.c +++ b/drivers/clk/berlin/bg2.c | |||
@@ -685,7 +685,7 @@ static void __init berlin2_clock_setup(struct device_node *np) | |||
685 | } | 685 | } |
686 | 686 | ||
687 | /* register clk-provider */ | 687 | /* register clk-provider */ |
688 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, &clk_data); | 688 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); |
689 | 689 | ||
690 | return; | 690 | return; |
691 | 691 | ||
diff --git a/drivers/clk/berlin/bg2q.c b/drivers/clk/berlin/bg2q.c index 0718e831475f..3b784b593afd 100644 --- a/drivers/clk/berlin/bg2q.c +++ b/drivers/clk/berlin/bg2q.c | |||
@@ -382,7 +382,7 @@ static void __init berlin2q_clock_setup(struct device_node *np) | |||
382 | } | 382 | } |
383 | 383 | ||
384 | /* register clk-provider */ | 384 | /* register clk-provider */ |
385 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, &clk_data); | 385 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); |
386 | 386 | ||
387 | return; | 387 | return; |
388 | 388 | ||
diff --git a/drivers/clk/clk-efm32gg.c b/drivers/clk/clk-efm32gg.c index 8802a2dd56ac..f674778fb3ac 100644 --- a/drivers/clk/clk-efm32gg.c +++ b/drivers/clk/clk-efm32gg.c | |||
@@ -82,6 +82,6 @@ static void __init efm32gg_cmu_init(struct device_node *np) | |||
82 | hws[clk_HFPERCLKDAC0] = clk_hw_register_gate(NULL, "HFPERCLK.DAC0", | 82 | hws[clk_HFPERCLKDAC0] = clk_hw_register_gate(NULL, "HFPERCLK.DAC0", |
83 | "HFXO", 0, base + CMU_HFPERCLKEN0, 17, 0, NULL); | 83 | "HFXO", 0, base + CMU_HFPERCLKEN0, 17, 0, NULL); |
84 | 84 | ||
85 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, &clk_data); | 85 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); |
86 | } | 86 | } |
87 | CLK_OF_DECLARE(efm32ggcmu, "efm32gg,cmu", efm32gg_cmu_init); | 87 | CLK_OF_DECLARE(efm32ggcmu, "efm32gg,cmu", efm32gg_cmu_init); |
diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c index 79596463e0d9..4a82a49cff5e 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c +++ b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c | |||
@@ -191,6 +191,8 @@ static struct clk_div_table axi_div_table[] = { | |||
191 | static SUNXI_CCU_DIV_TABLE(axi_clk, "axi", "cpu", | 191 | static SUNXI_CCU_DIV_TABLE(axi_clk, "axi", "cpu", |
192 | 0x050, 0, 3, axi_div_table, 0); | 192 | 0x050, 0, 3, axi_div_table, 0); |
193 | 193 | ||
194 | #define SUN6I_A31_AHB1_REG 0x054 | ||
195 | |||
194 | static const char * const ahb1_parents[] = { "osc32k", "osc24M", | 196 | static const char * const ahb1_parents[] = { "osc32k", "osc24M", |
195 | "axi", "pll-periph" }; | 197 | "axi", "pll-periph" }; |
196 | 198 | ||
@@ -1230,6 +1232,16 @@ static void __init sun6i_a31_ccu_setup(struct device_node *node) | |||
1230 | val &= BIT(16); | 1232 | val &= BIT(16); |
1231 | writel(val, reg + SUN6I_A31_PLL_MIPI_REG); | 1233 | writel(val, reg + SUN6I_A31_PLL_MIPI_REG); |
1232 | 1234 | ||
1235 | /* Force AHB1 to PLL6 / 3 */ | ||
1236 | val = readl(reg + SUN6I_A31_AHB1_REG); | ||
1237 | /* set PLL6 pre-div = 3 */ | ||
1238 | val &= ~GENMASK(7, 6); | ||
1239 | val |= 0x2 << 6; | ||
1240 | /* select PLL6 / pre-div */ | ||
1241 | val &= ~GENMASK(13, 12); | ||
1242 | val |= 0x3 << 12; | ||
1243 | writel(val, reg + SUN6I_A31_AHB1_REG); | ||
1244 | |||
1233 | sunxi_ccu_probe(node, reg, &sun6i_a31_ccu_desc); | 1245 | sunxi_ccu_probe(node, reg, &sun6i_a31_ccu_desc); |
1234 | 1246 | ||
1235 | ccu_mux_notifier_register(pll_cpu_clk.common.hw.clk, | 1247 | ccu_mux_notifier_register(pll_cpu_clk.common.hw.clk, |
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 838b22aa8b67..f2c9274b8bd5 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c | |||
@@ -373,7 +373,7 @@ static void sun4i_get_apb1_factors(struct factors_request *req) | |||
373 | else | 373 | else |
374 | calcp = 3; | 374 | calcp = 3; |
375 | 375 | ||
376 | calcm = (req->parent_rate >> calcp) - 1; | 376 | calcm = (div >> calcp) - 1; |
377 | 377 | ||
378 | req->rate = (req->parent_rate >> calcp) / (calcm + 1); | 378 | req->rate = (req->parent_rate >> calcp) / (calcm + 1); |
379 | req->m = calcm; | 379 | req->m = calcm; |
diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c index 0e499bfca41c..3d94ff20fdca 100644 --- a/drivers/dax/dax.c +++ b/drivers/dax/dax.c | |||
@@ -270,8 +270,8 @@ static int check_vma(struct dax_dev *dax_dev, struct vm_area_struct *vma, | |||
270 | if (!dax_dev->alive) | 270 | if (!dax_dev->alive) |
271 | return -ENXIO; | 271 | return -ENXIO; |
272 | 272 | ||
273 | /* prevent private / writable mappings from being established */ | 273 | /* prevent private mappings from being established */ |
274 | if ((vma->vm_flags & (VM_NORESERVE|VM_SHARED|VM_WRITE)) == VM_WRITE) { | 274 | if ((vma->vm_flags & VM_SHARED) != VM_SHARED) { |
275 | dev_info(dev, "%s: %s: fail, attempted private mapping\n", | 275 | dev_info(dev, "%s: %s: fail, attempted private mapping\n", |
276 | current->comm, func); | 276 | current->comm, func); |
277 | return -EINVAL; | 277 | return -EINVAL; |
diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c index 4a15fa5df98b..73c6ce93a0d9 100644 --- a/drivers/dax/pmem.c +++ b/drivers/dax/pmem.c | |||
@@ -78,7 +78,9 @@ static int dax_pmem_probe(struct device *dev) | |||
78 | nsio = to_nd_namespace_io(&ndns->dev); | 78 | nsio = to_nd_namespace_io(&ndns->dev); |
79 | 79 | ||
80 | /* parse the 'pfn' info block via ->rw_bytes */ | 80 | /* parse the 'pfn' info block via ->rw_bytes */ |
81 | devm_nsio_enable(dev, nsio); | 81 | rc = devm_nsio_enable(dev, nsio); |
82 | if (rc) | ||
83 | return rc; | ||
82 | altmap = nvdimm_setup_pfn(nd_pfn, &res, &__altmap); | 84 | altmap = nvdimm_setup_pfn(nd_pfn, &res, &__altmap); |
83 | if (IS_ERR(altmap)) | 85 | if (IS_ERR(altmap)) |
84 | return PTR_ERR(altmap); | 86 | return PTR_ERR(altmap); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index dae35a96a694..02ca5dd978f6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | |||
@@ -34,6 +34,7 @@ struct amdgpu_atpx { | |||
34 | 34 | ||
35 | static struct amdgpu_atpx_priv { | 35 | static struct amdgpu_atpx_priv { |
36 | bool atpx_detected; | 36 | bool atpx_detected; |
37 | bool bridge_pm_usable; | ||
37 | /* handle for device - and atpx */ | 38 | /* handle for device - and atpx */ |
38 | acpi_handle dhandle; | 39 | acpi_handle dhandle; |
39 | acpi_handle other_handle; | 40 | acpi_handle other_handle; |
@@ -205,7 +206,11 @@ static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx) | |||
205 | atpx->is_hybrid = false; | 206 | atpx->is_hybrid = false; |
206 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { | 207 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { |
207 | printk("ATPX Hybrid Graphics\n"); | 208 | printk("ATPX Hybrid Graphics\n"); |
208 | atpx->functions.power_cntl = false; | 209 | /* |
210 | * Disable legacy PM methods only when pcie port PM is usable, | ||
211 | * otherwise the device might fail to power off or power on. | ||
212 | */ | ||
213 | atpx->functions.power_cntl = !amdgpu_atpx_priv.bridge_pm_usable; | ||
209 | atpx->is_hybrid = true; | 214 | atpx->is_hybrid = true; |
210 | } | 215 | } |
211 | 216 | ||
@@ -480,6 +485,7 @@ static int amdgpu_atpx_power_state(enum vga_switcheroo_client_id id, | |||
480 | */ | 485 | */ |
481 | static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) | 486 | static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) |
482 | { | 487 | { |
488 | struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); | ||
483 | acpi_handle dhandle, atpx_handle; | 489 | acpi_handle dhandle, atpx_handle; |
484 | acpi_status status; | 490 | acpi_status status; |
485 | 491 | ||
@@ -494,6 +500,7 @@ static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) | |||
494 | } | 500 | } |
495 | amdgpu_atpx_priv.dhandle = dhandle; | 501 | amdgpu_atpx_priv.dhandle = dhandle; |
496 | amdgpu_atpx_priv.atpx.handle = atpx_handle; | 502 | amdgpu_atpx_priv.atpx.handle = atpx_handle; |
503 | amdgpu_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3; | ||
497 | return true; | 504 | return true; |
498 | } | 505 | } |
499 | 506 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index 13f2b705ea49..08cd0bd3ebe5 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | |||
@@ -2984,19 +2984,19 @@ static int smu7_get_pp_table_entry_callback_func_v0(struct pp_hwmgr *hwmgr, | |||
2984 | if (!(data->mc_micro_code_feature & DISABLE_MC_LOADMICROCODE) && memory_clock > data->highest_mclk) | 2984 | if (!(data->mc_micro_code_feature & DISABLE_MC_LOADMICROCODE) && memory_clock > data->highest_mclk) |
2985 | data->highest_mclk = memory_clock; | 2985 | data->highest_mclk = memory_clock; |
2986 | 2986 | ||
2987 | performance_level = &(ps->performance_levels | ||
2988 | [ps->performance_level_count++]); | ||
2989 | |||
2990 | PP_ASSERT_WITH_CODE( | 2987 | PP_ASSERT_WITH_CODE( |
2991 | (ps->performance_level_count < smum_get_mac_definition(hwmgr->smumgr, SMU_MAX_LEVELS_GRAPHICS)), | 2988 | (ps->performance_level_count < smum_get_mac_definition(hwmgr->smumgr, SMU_MAX_LEVELS_GRAPHICS)), |
2992 | "Performance levels exceeds SMC limit!", | 2989 | "Performance levels exceeds SMC limit!", |
2993 | return -EINVAL); | 2990 | return -EINVAL); |
2994 | 2991 | ||
2995 | PP_ASSERT_WITH_CODE( | 2992 | PP_ASSERT_WITH_CODE( |
2996 | (ps->performance_level_count <= | 2993 | (ps->performance_level_count < |
2997 | hwmgr->platform_descriptor.hardwareActivityPerformanceLevels), | 2994 | hwmgr->platform_descriptor.hardwareActivityPerformanceLevels), |
2998 | "Performance levels exceeds Driver limit!", | 2995 | "Performance levels exceeds Driver limit, Skip!", |
2999 | return -EINVAL); | 2996 | return 0); |
2997 | |||
2998 | performance_level = &(ps->performance_levels | ||
2999 | [ps->performance_level_count++]); | ||
3000 | 3000 | ||
3001 | /* Performance levels are arranged from low to high. */ | 3001 | /* Performance levels are arranged from low to high. */ |
3002 | performance_level->memory_clock = memory_clock; | 3002 | performance_level->memory_clock = memory_clock; |
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 48019ae22ddb..28341b32067f 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c | |||
@@ -150,15 +150,14 @@ static void hdlcd_crtc_enable(struct drm_crtc *crtc) | |||
150 | clk_prepare_enable(hdlcd->clk); | 150 | clk_prepare_enable(hdlcd->clk); |
151 | hdlcd_crtc_mode_set_nofb(crtc); | 151 | hdlcd_crtc_mode_set_nofb(crtc); |
152 | hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 1); | 152 | hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 1); |
153 | drm_crtc_vblank_on(crtc); | ||
153 | } | 154 | } |
154 | 155 | ||
155 | static void hdlcd_crtc_disable(struct drm_crtc *crtc) | 156 | static void hdlcd_crtc_disable(struct drm_crtc *crtc) |
156 | { | 157 | { |
157 | struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); | 158 | struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); |
158 | 159 | ||
159 | if (!crtc->state->active) | 160 | drm_crtc_vblank_off(crtc); |
160 | return; | ||
161 | |||
162 | hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0); | 161 | hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0); |
163 | clk_disable_unprepare(hdlcd->clk); | 162 | clk_disable_unprepare(hdlcd->clk); |
164 | } | 163 | } |
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index e8fb6ef947ee..38eaa63afb31 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -1907,6 +1907,8 @@ err_disable_pm_runtime: | |||
1907 | err_hdmiphy: | 1907 | err_hdmiphy: |
1908 | if (hdata->hdmiphy_port) | 1908 | if (hdata->hdmiphy_port) |
1909 | put_device(&hdata->hdmiphy_port->dev); | 1909 | put_device(&hdata->hdmiphy_port->dev); |
1910 | if (hdata->regs_hdmiphy) | ||
1911 | iounmap(hdata->regs_hdmiphy); | ||
1910 | err_ddc: | 1912 | err_ddc: |
1911 | put_device(&hdata->ddc_adpt->dev); | 1913 | put_device(&hdata->ddc_adpt->dev); |
1912 | 1914 | ||
@@ -1929,6 +1931,9 @@ static int hdmi_remove(struct platform_device *pdev) | |||
1929 | if (hdata->hdmiphy_port) | 1931 | if (hdata->hdmiphy_port) |
1930 | put_device(&hdata->hdmiphy_port->dev); | 1932 | put_device(&hdata->hdmiphy_port->dev); |
1931 | 1933 | ||
1934 | if (hdata->regs_hdmiphy) | ||
1935 | iounmap(hdata->regs_hdmiphy); | ||
1936 | |||
1932 | put_device(&hdata->ddc_adpt->dev); | 1937 | put_device(&hdata->ddc_adpt->dev); |
1933 | 1938 | ||
1934 | return 0; | 1939 | return 0; |
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index f75c5b5a536c..c70310206ac5 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c | |||
@@ -251,13 +251,6 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) | |||
251 | if (irq < 0) | 251 | if (irq < 0) |
252 | return irq; | 252 | return irq; |
253 | 253 | ||
254 | ret = devm_request_irq(dev, irq, mtk_disp_ovl_irq_handler, | ||
255 | IRQF_TRIGGER_NONE, dev_name(dev), priv); | ||
256 | if (ret < 0) { | ||
257 | dev_err(dev, "Failed to request irq %d: %d\n", irq, ret); | ||
258 | return ret; | ||
259 | } | ||
260 | |||
261 | comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DISP_OVL); | 254 | comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DISP_OVL); |
262 | if (comp_id < 0) { | 255 | if (comp_id < 0) { |
263 | dev_err(dev, "Failed to identify by alias: %d\n", comp_id); | 256 | dev_err(dev, "Failed to identify by alias: %d\n", comp_id); |
@@ -273,6 +266,13 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) | |||
273 | 266 | ||
274 | platform_set_drvdata(pdev, priv); | 267 | platform_set_drvdata(pdev, priv); |
275 | 268 | ||
269 | ret = devm_request_irq(dev, irq, mtk_disp_ovl_irq_handler, | ||
270 | IRQF_TRIGGER_NONE, dev_name(dev), priv); | ||
271 | if (ret < 0) { | ||
272 | dev_err(dev, "Failed to request irq %d: %d\n", irq, ret); | ||
273 | return ret; | ||
274 | } | ||
275 | |||
276 | ret = component_add(dev, &mtk_disp_ovl_component_ops); | 276 | ret = component_add(dev, &mtk_disp_ovl_component_ops); |
277 | if (ret) | 277 | if (ret) |
278 | dev_err(dev, "Failed to add component: %d\n", ret); | 278 | dev_err(dev, "Failed to add component: %d\n", ret); |
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c index df33b3ca6ffd..48cc01fd20c7 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | |||
@@ -123,7 +123,7 @@ static void mtk_od_config(struct mtk_ddp_comp *comp, unsigned int w, | |||
123 | unsigned int bpc) | 123 | unsigned int bpc) |
124 | { | 124 | { |
125 | writel(w << 16 | h, comp->regs + DISP_OD_SIZE); | 125 | writel(w << 16 | h, comp->regs + DISP_OD_SIZE); |
126 | writel(OD_RELAYMODE, comp->regs + OD_RELAYMODE); | 126 | writel(OD_RELAYMODE, comp->regs + DISP_OD_CFG); |
127 | mtk_dither_set(comp, bpc, DISP_OD_CFG); | 127 | mtk_dither_set(comp, bpc, DISP_OD_CFG); |
128 | } | 128 | } |
129 | 129 | ||
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 28b2044ed9f2..eaa5a2240c0c 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c | |||
@@ -86,7 +86,7 @@ | |||
86 | 86 | ||
87 | #define DSI_PHY_TIMECON0 0x110 | 87 | #define DSI_PHY_TIMECON0 0x110 |
88 | #define LPX (0xff << 0) | 88 | #define LPX (0xff << 0) |
89 | #define HS_PRPR (0xff << 8) | 89 | #define HS_PREP (0xff << 8) |
90 | #define HS_ZERO (0xff << 16) | 90 | #define HS_ZERO (0xff << 16) |
91 | #define HS_TRAIL (0xff << 24) | 91 | #define HS_TRAIL (0xff << 24) |
92 | 92 | ||
@@ -102,10 +102,16 @@ | |||
102 | #define CLK_TRAIL (0xff << 24) | 102 | #define CLK_TRAIL (0xff << 24) |
103 | 103 | ||
104 | #define DSI_PHY_TIMECON3 0x11c | 104 | #define DSI_PHY_TIMECON3 0x11c |
105 | #define CLK_HS_PRPR (0xff << 0) | 105 | #define CLK_HS_PREP (0xff << 0) |
106 | #define CLK_HS_POST (0xff << 8) | 106 | #define CLK_HS_POST (0xff << 8) |
107 | #define CLK_HS_EXIT (0xff << 16) | 107 | #define CLK_HS_EXIT (0xff << 16) |
108 | 108 | ||
109 | #define T_LPX 5 | ||
110 | #define T_HS_PREP 6 | ||
111 | #define T_HS_TRAIL 8 | ||
112 | #define T_HS_EXIT 7 | ||
113 | #define T_HS_ZERO 10 | ||
114 | |||
109 | #define NS_TO_CYCLE(n, c) ((n) / (c) + (((n) % (c)) ? 1 : 0)) | 115 | #define NS_TO_CYCLE(n, c) ((n) / (c) + (((n) % (c)) ? 1 : 0)) |
110 | 116 | ||
111 | struct phy; | 117 | struct phy; |
@@ -161,20 +167,18 @@ static void mtk_dsi_mask(struct mtk_dsi *dsi, u32 offset, u32 mask, u32 data) | |||
161 | static void dsi_phy_timconfig(struct mtk_dsi *dsi) | 167 | static void dsi_phy_timconfig(struct mtk_dsi *dsi) |
162 | { | 168 | { |
163 | u32 timcon0, timcon1, timcon2, timcon3; | 169 | u32 timcon0, timcon1, timcon2, timcon3; |
164 | unsigned int ui, cycle_time; | 170 | u32 ui, cycle_time; |
165 | unsigned int lpx; | ||
166 | 171 | ||
167 | ui = 1000 / dsi->data_rate + 0x01; | 172 | ui = 1000 / dsi->data_rate + 0x01; |
168 | cycle_time = 8000 / dsi->data_rate + 0x01; | 173 | cycle_time = 8000 / dsi->data_rate + 0x01; |
169 | lpx = 5; | ||
170 | 174 | ||
171 | timcon0 = (8 << 24) | (0xa << 16) | (0x6 << 8) | lpx; | 175 | timcon0 = T_LPX | T_HS_PREP << 8 | T_HS_ZERO << 16 | T_HS_TRAIL << 24; |
172 | timcon1 = (7 << 24) | (5 * lpx << 16) | ((3 * lpx) / 2) << 8 | | 176 | timcon1 = 4 * T_LPX | (3 * T_LPX / 2) << 8 | 5 * T_LPX << 16 | |
173 | (4 * lpx); | 177 | T_HS_EXIT << 24; |
174 | timcon2 = ((NS_TO_CYCLE(0x64, cycle_time) + 0xa) << 24) | | 178 | timcon2 = ((NS_TO_CYCLE(0x64, cycle_time) + 0xa) << 24) | |
175 | (NS_TO_CYCLE(0x150, cycle_time) << 16); | 179 | (NS_TO_CYCLE(0x150, cycle_time) << 16); |
176 | timcon3 = (2 * lpx) << 16 | NS_TO_CYCLE(80 + 52 * ui, cycle_time) << 8 | | 180 | timcon3 = NS_TO_CYCLE(0x40, cycle_time) | (2 * T_LPX) << 16 | |
177 | NS_TO_CYCLE(0x40, cycle_time); | 181 | NS_TO_CYCLE(80 + 52 * ui, cycle_time) << 8; |
178 | 182 | ||
179 | writel(timcon0, dsi->regs + DSI_PHY_TIMECON0); | 183 | writel(timcon0, dsi->regs + DSI_PHY_TIMECON0); |
180 | writel(timcon1, dsi->regs + DSI_PHY_TIMECON1); | 184 | writel(timcon1, dsi->regs + DSI_PHY_TIMECON1); |
@@ -202,19 +206,47 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi) | |||
202 | { | 206 | { |
203 | struct device *dev = dsi->dev; | 207 | struct device *dev = dsi->dev; |
204 | int ret; | 208 | int ret; |
209 | u64 pixel_clock, total_bits; | ||
210 | u32 htotal, htotal_bits, bit_per_pixel, overhead_cycles, overhead_bits; | ||
205 | 211 | ||
206 | if (++dsi->refcount != 1) | 212 | if (++dsi->refcount != 1) |
207 | return 0; | 213 | return 0; |
208 | 214 | ||
215 | switch (dsi->format) { | ||
216 | case MIPI_DSI_FMT_RGB565: | ||
217 | bit_per_pixel = 16; | ||
218 | break; | ||
219 | case MIPI_DSI_FMT_RGB666_PACKED: | ||
220 | bit_per_pixel = 18; | ||
221 | break; | ||
222 | case MIPI_DSI_FMT_RGB666: | ||
223 | case MIPI_DSI_FMT_RGB888: | ||
224 | default: | ||
225 | bit_per_pixel = 24; | ||
226 | break; | ||
227 | } | ||
228 | |||
209 | /** | 229 | /** |
210 | * data_rate = (pixel_clock / 1000) * pixel_dipth * mipi_ratio; | 230 | * vm.pixelclock is in kHz, pixel_clock unit is Hz, so multiply by 1000 |
211 | * pixel_clock unit is Khz, data_rata unit is MHz, so need divide 1000. | 231 | * htotal_time = htotal * byte_per_pixel / num_lanes |
212 | * mipi_ratio is mipi clk coefficient for balance the pixel clk in mipi. | 232 | * overhead_time = lpx + hs_prepare + hs_zero + hs_trail + hs_exit |
213 | * we set mipi_ratio is 1.05. | 233 | * mipi_ratio = (htotal_time + overhead_time) / htotal_time |
234 | * data_rate = pixel_clock * bit_per_pixel * mipi_ratio / num_lanes; | ||
214 | */ | 235 | */ |
215 | dsi->data_rate = dsi->vm.pixelclock * 3 * 21 / (1 * 1000 * 10); | 236 | pixel_clock = dsi->vm.pixelclock * 1000; |
237 | htotal = dsi->vm.hactive + dsi->vm.hback_porch + dsi->vm.hfront_porch + | ||
238 | dsi->vm.hsync_len; | ||
239 | htotal_bits = htotal * bit_per_pixel; | ||
240 | |||
241 | overhead_cycles = T_LPX + T_HS_PREP + T_HS_ZERO + T_HS_TRAIL + | ||
242 | T_HS_EXIT; | ||
243 | overhead_bits = overhead_cycles * dsi->lanes * 8; | ||
244 | total_bits = htotal_bits + overhead_bits; | ||
245 | |||
246 | dsi->data_rate = DIV_ROUND_UP_ULL(pixel_clock * total_bits, | ||
247 | htotal * dsi->lanes); | ||
216 | 248 | ||
217 | ret = clk_set_rate(dsi->hs_clk, dsi->data_rate * 1000000); | 249 | ret = clk_set_rate(dsi->hs_clk, dsi->data_rate); |
218 | if (ret < 0) { | 250 | if (ret < 0) { |
219 | dev_err(dev, "Failed to set data rate: %d\n", ret); | 251 | dev_err(dev, "Failed to set data rate: %d\n", ret); |
220 | goto err_refcount; | 252 | goto err_refcount; |
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index 2fdcd04bc93f..4129b12521a6 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c | |||
@@ -34,6 +34,7 @@ struct radeon_atpx { | |||
34 | 34 | ||
35 | static struct radeon_atpx_priv { | 35 | static struct radeon_atpx_priv { |
36 | bool atpx_detected; | 36 | bool atpx_detected; |
37 | bool bridge_pm_usable; | ||
37 | /* handle for device - and atpx */ | 38 | /* handle for device - and atpx */ |
38 | acpi_handle dhandle; | 39 | acpi_handle dhandle; |
39 | struct radeon_atpx atpx; | 40 | struct radeon_atpx atpx; |
@@ -203,7 +204,11 @@ static int radeon_atpx_validate(struct radeon_atpx *atpx) | |||
203 | atpx->is_hybrid = false; | 204 | atpx->is_hybrid = false; |
204 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { | 205 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { |
205 | printk("ATPX Hybrid Graphics\n"); | 206 | printk("ATPX Hybrid Graphics\n"); |
206 | atpx->functions.power_cntl = false; | 207 | /* |
208 | * Disable legacy PM methods only when pcie port PM is usable, | ||
209 | * otherwise the device might fail to power off or power on. | ||
210 | */ | ||
211 | atpx->functions.power_cntl = !radeon_atpx_priv.bridge_pm_usable; | ||
207 | atpx->is_hybrid = true; | 212 | atpx->is_hybrid = true; |
208 | } | 213 | } |
209 | 214 | ||
@@ -474,6 +479,7 @@ static int radeon_atpx_power_state(enum vga_switcheroo_client_id id, | |||
474 | */ | 479 | */ |
475 | static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) | 480 | static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) |
476 | { | 481 | { |
482 | struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); | ||
477 | acpi_handle dhandle, atpx_handle; | 483 | acpi_handle dhandle, atpx_handle; |
478 | acpi_status status; | 484 | acpi_status status; |
479 | 485 | ||
@@ -487,6 +493,7 @@ static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) | |||
487 | 493 | ||
488 | radeon_atpx_priv.dhandle = dhandle; | 494 | radeon_atpx_priv.dhandle = dhandle; |
489 | radeon_atpx_priv.atpx.handle = atpx_handle; | 495 | radeon_atpx_priv.atpx.handle = atpx_handle; |
496 | radeon_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3; | ||
490 | return true; | 497 | return true; |
491 | } | 498 | } |
492 | 499 | ||
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c index 086d8a507157..60d30203a5fa 100644 --- a/drivers/hid/hid-cp2112.c +++ b/drivers/hid/hid-cp2112.c | |||
@@ -32,6 +32,11 @@ | |||
32 | #include <linux/usb/ch9.h> | 32 | #include <linux/usb/ch9.h> |
33 | #include "hid-ids.h" | 33 | #include "hid-ids.h" |
34 | 34 | ||
35 | #define CP2112_REPORT_MAX_LENGTH 64 | ||
36 | #define CP2112_GPIO_CONFIG_LENGTH 5 | ||
37 | #define CP2112_GPIO_GET_LENGTH 2 | ||
38 | #define CP2112_GPIO_SET_LENGTH 3 | ||
39 | |||
35 | enum { | 40 | enum { |
36 | CP2112_GPIO_CONFIG = 0x02, | 41 | CP2112_GPIO_CONFIG = 0x02, |
37 | CP2112_GPIO_GET = 0x03, | 42 | CP2112_GPIO_GET = 0x03, |
@@ -161,6 +166,8 @@ struct cp2112_device { | |||
161 | atomic_t read_avail; | 166 | atomic_t read_avail; |
162 | atomic_t xfer_avail; | 167 | atomic_t xfer_avail; |
163 | struct gpio_chip gc; | 168 | struct gpio_chip gc; |
169 | u8 *in_out_buffer; | ||
170 | spinlock_t lock; | ||
164 | }; | 171 | }; |
165 | 172 | ||
166 | static int gpio_push_pull = 0xFF; | 173 | static int gpio_push_pull = 0xFF; |
@@ -171,62 +178,86 @@ static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | |||
171 | { | 178 | { |
172 | struct cp2112_device *dev = gpiochip_get_data(chip); | 179 | struct cp2112_device *dev = gpiochip_get_data(chip); |
173 | struct hid_device *hdev = dev->hdev; | 180 | struct hid_device *hdev = dev->hdev; |
174 | u8 buf[5]; | 181 | u8 *buf = dev->in_out_buffer; |
182 | unsigned long flags; | ||
175 | int ret; | 183 | int ret; |
176 | 184 | ||
185 | spin_lock_irqsave(&dev->lock, flags); | ||
186 | |||
177 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, | 187 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, |
178 | sizeof(buf), HID_FEATURE_REPORT, | 188 | CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT, |
179 | HID_REQ_GET_REPORT); | 189 | HID_REQ_GET_REPORT); |
180 | if (ret != sizeof(buf)) { | 190 | if (ret != CP2112_GPIO_CONFIG_LENGTH) { |
181 | hid_err(hdev, "error requesting GPIO config: %d\n", ret); | 191 | hid_err(hdev, "error requesting GPIO config: %d\n", ret); |
182 | return ret; | 192 | goto exit; |
183 | } | 193 | } |
184 | 194 | ||
185 | buf[1] &= ~(1 << offset); | 195 | buf[1] &= ~(1 << offset); |
186 | buf[2] = gpio_push_pull; | 196 | buf[2] = gpio_push_pull; |
187 | 197 | ||
188 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, sizeof(buf), | 198 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, |
189 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | 199 | CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT, |
200 | HID_REQ_SET_REPORT); | ||
190 | if (ret < 0) { | 201 | if (ret < 0) { |
191 | hid_err(hdev, "error setting GPIO config: %d\n", ret); | 202 | hid_err(hdev, "error setting GPIO config: %d\n", ret); |
192 | return ret; | 203 | goto exit; |
193 | } | 204 | } |
194 | 205 | ||
195 | return 0; | 206 | ret = 0; |
207 | |||
208 | exit: | ||
209 | spin_unlock_irqrestore(&dev->lock, flags); | ||
210 | return ret <= 0 ? ret : -EIO; | ||
196 | } | 211 | } |
197 | 212 | ||
198 | static void cp2112_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 213 | static void cp2112_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |
199 | { | 214 | { |
200 | struct cp2112_device *dev = gpiochip_get_data(chip); | 215 | struct cp2112_device *dev = gpiochip_get_data(chip); |
201 | struct hid_device *hdev = dev->hdev; | 216 | struct hid_device *hdev = dev->hdev; |
202 | u8 buf[3]; | 217 | u8 *buf = dev->in_out_buffer; |
218 | unsigned long flags; | ||
203 | int ret; | 219 | int ret; |
204 | 220 | ||
221 | spin_lock_irqsave(&dev->lock, flags); | ||
222 | |||
205 | buf[0] = CP2112_GPIO_SET; | 223 | buf[0] = CP2112_GPIO_SET; |
206 | buf[1] = value ? 0xff : 0; | 224 | buf[1] = value ? 0xff : 0; |
207 | buf[2] = 1 << offset; | 225 | buf[2] = 1 << offset; |
208 | 226 | ||
209 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf, sizeof(buf), | 227 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf, |
210 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | 228 | CP2112_GPIO_SET_LENGTH, HID_FEATURE_REPORT, |
229 | HID_REQ_SET_REPORT); | ||
211 | if (ret < 0) | 230 | if (ret < 0) |
212 | hid_err(hdev, "error setting GPIO values: %d\n", ret); | 231 | hid_err(hdev, "error setting GPIO values: %d\n", ret); |
232 | |||
233 | spin_unlock_irqrestore(&dev->lock, flags); | ||
213 | } | 234 | } |
214 | 235 | ||
215 | static int cp2112_gpio_get(struct gpio_chip *chip, unsigned offset) | 236 | static int cp2112_gpio_get(struct gpio_chip *chip, unsigned offset) |
216 | { | 237 | { |
217 | struct cp2112_device *dev = gpiochip_get_data(chip); | 238 | struct cp2112_device *dev = gpiochip_get_data(chip); |
218 | struct hid_device *hdev = dev->hdev; | 239 | struct hid_device *hdev = dev->hdev; |
219 | u8 buf[2]; | 240 | u8 *buf = dev->in_out_buffer; |
241 | unsigned long flags; | ||
220 | int ret; | 242 | int ret; |
221 | 243 | ||
222 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_GET, buf, sizeof(buf), | 244 | spin_lock_irqsave(&dev->lock, flags); |
223 | HID_FEATURE_REPORT, HID_REQ_GET_REPORT); | 245 | |
224 | if (ret != sizeof(buf)) { | 246 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_GET, buf, |
247 | CP2112_GPIO_GET_LENGTH, HID_FEATURE_REPORT, | ||
248 | HID_REQ_GET_REPORT); | ||
249 | if (ret != CP2112_GPIO_GET_LENGTH) { | ||
225 | hid_err(hdev, "error requesting GPIO values: %d\n", ret); | 250 | hid_err(hdev, "error requesting GPIO values: %d\n", ret); |
226 | return ret; | 251 | ret = ret < 0 ? ret : -EIO; |
252 | goto exit; | ||
227 | } | 253 | } |
228 | 254 | ||
229 | return (buf[1] >> offset) & 1; | 255 | ret = (buf[1] >> offset) & 1; |
256 | |||
257 | exit: | ||
258 | spin_unlock_irqrestore(&dev->lock, flags); | ||
259 | |||
260 | return ret; | ||
230 | } | 261 | } |
231 | 262 | ||
232 | static int cp2112_gpio_direction_output(struct gpio_chip *chip, | 263 | static int cp2112_gpio_direction_output(struct gpio_chip *chip, |
@@ -234,27 +265,33 @@ static int cp2112_gpio_direction_output(struct gpio_chip *chip, | |||
234 | { | 265 | { |
235 | struct cp2112_device *dev = gpiochip_get_data(chip); | 266 | struct cp2112_device *dev = gpiochip_get_data(chip); |
236 | struct hid_device *hdev = dev->hdev; | 267 | struct hid_device *hdev = dev->hdev; |
237 | u8 buf[5]; | 268 | u8 *buf = dev->in_out_buffer; |
269 | unsigned long flags; | ||
238 | int ret; | 270 | int ret; |
239 | 271 | ||
272 | spin_lock_irqsave(&dev->lock, flags); | ||
273 | |||
240 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, | 274 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, |
241 | sizeof(buf), HID_FEATURE_REPORT, | 275 | CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT, |
242 | HID_REQ_GET_REPORT); | 276 | HID_REQ_GET_REPORT); |
243 | if (ret != sizeof(buf)) { | 277 | if (ret != CP2112_GPIO_CONFIG_LENGTH) { |
244 | hid_err(hdev, "error requesting GPIO config: %d\n", ret); | 278 | hid_err(hdev, "error requesting GPIO config: %d\n", ret); |
245 | return ret; | 279 | goto fail; |
246 | } | 280 | } |
247 | 281 | ||
248 | buf[1] |= 1 << offset; | 282 | buf[1] |= 1 << offset; |
249 | buf[2] = gpio_push_pull; | 283 | buf[2] = gpio_push_pull; |
250 | 284 | ||
251 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, sizeof(buf), | 285 | ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, |
252 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | 286 | CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT, |
287 | HID_REQ_SET_REPORT); | ||
253 | if (ret < 0) { | 288 | if (ret < 0) { |
254 | hid_err(hdev, "error setting GPIO config: %d\n", ret); | 289 | hid_err(hdev, "error setting GPIO config: %d\n", ret); |
255 | return ret; | 290 | goto fail; |
256 | } | 291 | } |
257 | 292 | ||
293 | spin_unlock_irqrestore(&dev->lock, flags); | ||
294 | |||
258 | /* | 295 | /* |
259 | * Set gpio value when output direction is already set, | 296 | * Set gpio value when output direction is already set, |
260 | * as specified in AN495, Rev. 0.2, cpt. 4.4 | 297 | * as specified in AN495, Rev. 0.2, cpt. 4.4 |
@@ -262,6 +299,10 @@ static int cp2112_gpio_direction_output(struct gpio_chip *chip, | |||
262 | cp2112_gpio_set(chip, offset, value); | 299 | cp2112_gpio_set(chip, offset, value); |
263 | 300 | ||
264 | return 0; | 301 | return 0; |
302 | |||
303 | fail: | ||
304 | spin_unlock_irqrestore(&dev->lock, flags); | ||
305 | return ret < 0 ? ret : -EIO; | ||
265 | } | 306 | } |
266 | 307 | ||
267 | static int cp2112_hid_get(struct hid_device *hdev, unsigned char report_number, | 308 | static int cp2112_hid_get(struct hid_device *hdev, unsigned char report_number, |
@@ -1007,6 +1048,17 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1007 | struct cp2112_smbus_config_report config; | 1048 | struct cp2112_smbus_config_report config; |
1008 | int ret; | 1049 | int ret; |
1009 | 1050 | ||
1051 | dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL); | ||
1052 | if (!dev) | ||
1053 | return -ENOMEM; | ||
1054 | |||
1055 | dev->in_out_buffer = devm_kzalloc(&hdev->dev, CP2112_REPORT_MAX_LENGTH, | ||
1056 | GFP_KERNEL); | ||
1057 | if (!dev->in_out_buffer) | ||
1058 | return -ENOMEM; | ||
1059 | |||
1060 | spin_lock_init(&dev->lock); | ||
1061 | |||
1010 | ret = hid_parse(hdev); | 1062 | ret = hid_parse(hdev); |
1011 | if (ret) { | 1063 | if (ret) { |
1012 | hid_err(hdev, "parse failed\n"); | 1064 | hid_err(hdev, "parse failed\n"); |
@@ -1063,12 +1115,6 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1063 | goto err_power_normal; | 1115 | goto err_power_normal; |
1064 | } | 1116 | } |
1065 | 1117 | ||
1066 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | ||
1067 | if (!dev) { | ||
1068 | ret = -ENOMEM; | ||
1069 | goto err_power_normal; | ||
1070 | } | ||
1071 | |||
1072 | hid_set_drvdata(hdev, (void *)dev); | 1118 | hid_set_drvdata(hdev, (void *)dev); |
1073 | dev->hdev = hdev; | 1119 | dev->hdev = hdev; |
1074 | dev->adap.owner = THIS_MODULE; | 1120 | dev->adap.owner = THIS_MODULE; |
@@ -1087,7 +1133,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1087 | 1133 | ||
1088 | if (ret) { | 1134 | if (ret) { |
1089 | hid_err(hdev, "error registering i2c adapter\n"); | 1135 | hid_err(hdev, "error registering i2c adapter\n"); |
1090 | goto err_free_dev; | 1136 | goto err_power_normal; |
1091 | } | 1137 | } |
1092 | 1138 | ||
1093 | hid_dbg(hdev, "adapter registered\n"); | 1139 | hid_dbg(hdev, "adapter registered\n"); |
@@ -1123,8 +1169,6 @@ err_gpiochip_remove: | |||
1123 | gpiochip_remove(&dev->gc); | 1169 | gpiochip_remove(&dev->gc); |
1124 | err_free_i2c: | 1170 | err_free_i2c: |
1125 | i2c_del_adapter(&dev->adap); | 1171 | i2c_del_adapter(&dev->adap); |
1126 | err_free_dev: | ||
1127 | kfree(dev); | ||
1128 | err_power_normal: | 1172 | err_power_normal: |
1129 | hid_hw_power(hdev, PM_HINT_NORMAL); | 1173 | hid_hw_power(hdev, PM_HINT_NORMAL); |
1130 | err_hid_close: | 1174 | err_hid_close: |
@@ -1149,7 +1193,6 @@ static void cp2112_remove(struct hid_device *hdev) | |||
1149 | */ | 1193 | */ |
1150 | hid_hw_close(hdev); | 1194 | hid_hw_close(hdev); |
1151 | hid_hw_stop(hdev); | 1195 | hid_hw_stop(hdev); |
1152 | kfree(dev); | ||
1153 | } | 1196 | } |
1154 | 1197 | ||
1155 | static int cp2112_raw_event(struct hid_device *hdev, struct hid_report *report, | 1198 | static int cp2112_raw_event(struct hid_device *hdev, struct hid_report *report, |
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 76f644deb0a7..c5c5fbe9d605 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -756,11 +756,16 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
756 | 756 | ||
757 | /* Setup wireless link with Logitech Wii wheel */ | 757 | /* Setup wireless link with Logitech Wii wheel */ |
758 | if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { | 758 | if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { |
759 | unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | 759 | const unsigned char cbuf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
760 | u8 *buf = kmemdup(cbuf, sizeof(cbuf), GFP_KERNEL); | ||
760 | 761 | ||
761 | ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), | 762 | if (!buf) { |
762 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | 763 | ret = -ENOMEM; |
764 | goto err_free; | ||
765 | } | ||
763 | 766 | ||
767 | ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), | ||
768 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | ||
764 | if (ret >= 0) { | 769 | if (ret >= 0) { |
765 | /* insert a little delay of 10 jiffies ~ 40ms */ | 770 | /* insert a little delay of 10 jiffies ~ 40ms */ |
766 | wait_queue_head_t wait; | 771 | wait_queue_head_t wait; |
@@ -772,9 +777,10 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
772 | buf[1] = 0xB2; | 777 | buf[1] = 0xB2; |
773 | get_random_bytes(&buf[2], 2); | 778 | get_random_bytes(&buf[2], 2); |
774 | 779 | ||
775 | ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), | 780 | ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), |
776 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | 781 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
777 | } | 782 | } |
783 | kfree(buf); | ||
778 | } | 784 | } |
779 | 785 | ||
780 | if (drv_data->quirks & LG_FF) | 786 | if (drv_data->quirks & LG_FF) |
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index d6fa496d0ca2..20b40ad26325 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c | |||
@@ -493,7 +493,8 @@ static int magicmouse_input_configured(struct hid_device *hdev, | |||
493 | static int magicmouse_probe(struct hid_device *hdev, | 493 | static int magicmouse_probe(struct hid_device *hdev, |
494 | const struct hid_device_id *id) | 494 | const struct hid_device_id *id) |
495 | { | 495 | { |
496 | __u8 feature[] = { 0xd7, 0x01 }; | 496 | const u8 feature[] = { 0xd7, 0x01 }; |
497 | u8 *buf; | ||
497 | struct magicmouse_sc *msc; | 498 | struct magicmouse_sc *msc; |
498 | struct hid_report *report; | 499 | struct hid_report *report; |
499 | int ret; | 500 | int ret; |
@@ -544,6 +545,12 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
544 | } | 545 | } |
545 | report->size = 6; | 546 | report->size = 6; |
546 | 547 | ||
548 | buf = kmemdup(feature, sizeof(feature), GFP_KERNEL); | ||
549 | if (!buf) { | ||
550 | ret = -ENOMEM; | ||
551 | goto err_stop_hw; | ||
552 | } | ||
553 | |||
547 | /* | 554 | /* |
548 | * Some devices repond with 'invalid report id' when feature | 555 | * Some devices repond with 'invalid report id' when feature |
549 | * report switching it into multitouch mode is sent to it. | 556 | * report switching it into multitouch mode is sent to it. |
@@ -552,8 +559,9 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
552 | * but there seems to be no other way of switching the mode. | 559 | * but there seems to be no other way of switching the mode. |
553 | * Thus the super-ugly hacky success check below. | 560 | * Thus the super-ugly hacky success check below. |
554 | */ | 561 | */ |
555 | ret = hid_hw_raw_request(hdev, feature[0], feature, sizeof(feature), | 562 | ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(feature), |
556 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | 563 | HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
564 | kfree(buf); | ||
557 | if (ret != -EIO && ret != sizeof(feature)) { | 565 | if (ret != -EIO && ret != sizeof(feature)) { |
558 | hid_err(hdev, "unable to request touch data (%d)\n", ret); | 566 | hid_err(hdev, "unable to request touch data (%d)\n", ret); |
559 | goto err_stop_hw; | 567 | goto err_stop_hw; |
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c index 9cd2ca34a6be..be89bcbf6a71 100644 --- a/drivers/hid/hid-rmi.c +++ b/drivers/hid/hid-rmi.c | |||
@@ -188,10 +188,16 @@ static int rmi_set_page(struct hid_device *hdev, u8 page) | |||
188 | static int rmi_set_mode(struct hid_device *hdev, u8 mode) | 188 | static int rmi_set_mode(struct hid_device *hdev, u8 mode) |
189 | { | 189 | { |
190 | int ret; | 190 | int ret; |
191 | u8 txbuf[2] = {RMI_SET_RMI_MODE_REPORT_ID, mode}; | 191 | const u8 txbuf[2] = {RMI_SET_RMI_MODE_REPORT_ID, mode}; |
192 | u8 *buf; | ||
192 | 193 | ||
193 | ret = hid_hw_raw_request(hdev, RMI_SET_RMI_MODE_REPORT_ID, txbuf, | 194 | buf = kmemdup(txbuf, sizeof(txbuf), GFP_KERNEL); |
195 | if (!buf) | ||
196 | return -ENOMEM; | ||
197 | |||
198 | ret = hid_hw_raw_request(hdev, RMI_SET_RMI_MODE_REPORT_ID, buf, | ||
194 | sizeof(txbuf), HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | 199 | sizeof(txbuf), HID_FEATURE_REPORT, HID_REQ_SET_REPORT); |
200 | kfree(buf); | ||
195 | if (ret < 0) { | 201 | if (ret < 0) { |
196 | dev_err(&hdev->dev, "unable to set rmi mode to %d (%d)\n", mode, | 202 | dev_err(&hdev->dev, "unable to set rmi mode to %d (%d)\n", mode, |
197 | ret); | 203 | ret); |
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index c5c3d6111729..60875625cbdf 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c | |||
@@ -212,6 +212,7 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | |||
212 | __s32 value; | 212 | __s32 value; |
213 | int ret = 0; | 213 | int ret = 0; |
214 | 214 | ||
215 | memset(buffer, 0, buffer_size); | ||
215 | mutex_lock(&data->mutex); | 216 | mutex_lock(&data->mutex); |
216 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); | 217 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); |
217 | if (!report || (field_index >= report->maxfield)) { | 218 | if (!report || (field_index >= report->maxfield)) { |
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c index 11e866d05368..b403fa5ecf49 100644 --- a/drivers/i2c/busses/i2c-designware-core.c +++ b/drivers/i2c/busses/i2c-designware-core.c | |||
@@ -91,9 +91,7 @@ | |||
91 | DW_IC_INTR_TX_ABRT | \ | 91 | DW_IC_INTR_TX_ABRT | \ |
92 | DW_IC_INTR_STOP_DET) | 92 | DW_IC_INTR_STOP_DET) |
93 | 93 | ||
94 | #define DW_IC_STATUS_ACTIVITY 0x1 | 94 | #define DW_IC_STATUS_ACTIVITY 0x1 |
95 | #define DW_IC_STATUS_TFE BIT(2) | ||
96 | #define DW_IC_STATUS_MST_ACTIVITY BIT(5) | ||
97 | 95 | ||
98 | #define DW_IC_SDA_HOLD_RX_SHIFT 16 | 96 | #define DW_IC_SDA_HOLD_RX_SHIFT 16 |
99 | #define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, DW_IC_SDA_HOLD_RX_SHIFT) | 97 | #define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, DW_IC_SDA_HOLD_RX_SHIFT) |
@@ -478,25 +476,9 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev) | |||
478 | { | 476 | { |
479 | struct i2c_msg *msgs = dev->msgs; | 477 | struct i2c_msg *msgs = dev->msgs; |
480 | u32 ic_tar = 0; | 478 | u32 ic_tar = 0; |
481 | bool enabled; | ||
482 | 479 | ||
483 | enabled = dw_readl(dev, DW_IC_ENABLE_STATUS) & 1; | 480 | /* Disable the adapter */ |
484 | 481 | __i2c_dw_enable_and_wait(dev, false); | |
485 | if (enabled) { | ||
486 | u32 ic_status; | ||
487 | |||
488 | /* | ||
489 | * Only disable adapter if ic_tar and ic_con can't be | ||
490 | * dynamically updated | ||
491 | */ | ||
492 | ic_status = dw_readl(dev, DW_IC_STATUS); | ||
493 | if (!dev->dynamic_tar_update_enabled || | ||
494 | (ic_status & DW_IC_STATUS_MST_ACTIVITY) || | ||
495 | !(ic_status & DW_IC_STATUS_TFE)) { | ||
496 | __i2c_dw_enable_and_wait(dev, false); | ||
497 | enabled = false; | ||
498 | } | ||
499 | } | ||
500 | 482 | ||
501 | /* if the slave address is ten bit address, enable 10BITADDR */ | 483 | /* if the slave address is ten bit address, enable 10BITADDR */ |
502 | if (dev->dynamic_tar_update_enabled) { | 484 | if (dev->dynamic_tar_update_enabled) { |
@@ -526,8 +508,8 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev) | |||
526 | /* enforce disabled interrupts (due to HW issues) */ | 508 | /* enforce disabled interrupts (due to HW issues) */ |
527 | i2c_dw_disable_int(dev); | 509 | i2c_dw_disable_int(dev); |
528 | 510 | ||
529 | if (!enabled) | 511 | /* Enable the adapter */ |
530 | __i2c_dw_enable(dev, true); | 512 | __i2c_dw_enable(dev, true); |
531 | 513 | ||
532 | /* Clear and enable interrupts */ | 514 | /* Clear and enable interrupts */ |
533 | dw_readl(dev, DW_IC_CLR_INTR); | 515 | dw_readl(dev, DW_IC_CLR_INTR); |
@@ -611,7 +593,7 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) | |||
611 | if (msgs[dev->msg_write_idx].flags & I2C_M_RD) { | 593 | if (msgs[dev->msg_write_idx].flags & I2C_M_RD) { |
612 | 594 | ||
613 | /* avoid rx buffer overrun */ | 595 | /* avoid rx buffer overrun */ |
614 | if (rx_limit - dev->rx_outstanding <= 0) | 596 | if (dev->rx_outstanding >= dev->rx_fifo_depth) |
615 | break; | 597 | break; |
616 | 598 | ||
617 | dw_writel(dev, cmd | 0x100, DW_IC_DATA_CMD); | 599 | dw_writel(dev, cmd | 0x100, DW_IC_DATA_CMD); |
@@ -708,8 +690,7 @@ static int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev) | |||
708 | } | 690 | } |
709 | 691 | ||
710 | /* | 692 | /* |
711 | * Prepare controller for a transaction and start transfer by calling | 693 | * Prepare controller for a transaction and call i2c_dw_xfer_msg |
712 | * i2c_dw_xfer_init() | ||
713 | */ | 694 | */ |
714 | static int | 695 | static int |
715 | i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) | 696 | i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) |
@@ -752,13 +733,23 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) | |||
752 | goto done; | 733 | goto done; |
753 | } | 734 | } |
754 | 735 | ||
736 | /* | ||
737 | * We must disable the adapter before returning and signaling the end | ||
738 | * of the current transfer. Otherwise the hardware might continue | ||
739 | * generating interrupts which in turn causes a race condition with | ||
740 | * the following transfer. Needs some more investigation if the | ||
741 | * additional interrupts are a hardware bug or this driver doesn't | ||
742 | * handle them correctly yet. | ||
743 | */ | ||
744 | __i2c_dw_enable(dev, false); | ||
745 | |||
755 | if (dev->msg_err) { | 746 | if (dev->msg_err) { |
756 | ret = dev->msg_err; | 747 | ret = dev->msg_err; |
757 | goto done; | 748 | goto done; |
758 | } | 749 | } |
759 | 750 | ||
760 | /* no error */ | 751 | /* no error */ |
761 | if (likely(!dev->cmd_err)) { | 752 | if (likely(!dev->cmd_err && !dev->status)) { |
762 | ret = num; | 753 | ret = num; |
763 | goto done; | 754 | goto done; |
764 | } | 755 | } |
@@ -768,6 +759,11 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) | |||
768 | ret = i2c_dw_handle_tx_abort(dev); | 759 | ret = i2c_dw_handle_tx_abort(dev); |
769 | goto done; | 760 | goto done; |
770 | } | 761 | } |
762 | |||
763 | if (dev->status) | ||
764 | dev_err(dev->dev, | ||
765 | "transfer terminated early - interrupt latency too high?\n"); | ||
766 | |||
771 | ret = -EIO; | 767 | ret = -EIO; |
772 | 768 | ||
773 | done: | 769 | done: |
@@ -888,19 +884,9 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id) | |||
888 | */ | 884 | */ |
889 | 885 | ||
890 | tx_aborted: | 886 | tx_aborted: |
891 | if ((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET)) | 887 | if ((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET)) || dev->msg_err) |
892 | || dev->msg_err) { | ||
893 | /* | ||
894 | * We must disable interruts before returning and signaling | ||
895 | * the end of the current transfer. Otherwise the hardware | ||
896 | * might continue generating interrupts for non-existent | ||
897 | * transfers. | ||
898 | */ | ||
899 | i2c_dw_disable_int(dev); | ||
900 | dw_readl(dev, DW_IC_CLR_INTR); | ||
901 | |||
902 | complete(&dev->cmd_complete); | 888 | complete(&dev->cmd_complete); |
903 | } else if (unlikely(dev->accessor_flags & ACCESS_INTR_MASK)) { | 889 | else if (unlikely(dev->accessor_flags & ACCESS_INTR_MASK)) { |
904 | /* workaround to trigger pending interrupt */ | 890 | /* workaround to trigger pending interrupt */ |
905 | stat = dw_readl(dev, DW_IC_INTR_MASK); | 891 | stat = dw_readl(dev, DW_IC_INTR_MASK); |
906 | i2c_dw_disable_int(dev); | 892 | i2c_dw_disable_int(dev); |
diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index 317ef63ee789..8d96a22647b3 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c | |||
@@ -281,6 +281,14 @@ static void free_firmware(struct xc2028_data *priv) | |||
281 | int i; | 281 | int i; |
282 | tuner_dbg("%s called\n", __func__); | 282 | tuner_dbg("%s called\n", __func__); |
283 | 283 | ||
284 | /* free allocated f/w string */ | ||
285 | if (priv->fname != firmware_name) | ||
286 | kfree(priv->fname); | ||
287 | priv->fname = NULL; | ||
288 | |||
289 | priv->state = XC2028_NO_FIRMWARE; | ||
290 | memset(&priv->cur_fw, 0, sizeof(priv->cur_fw)); | ||
291 | |||
284 | if (!priv->firm) | 292 | if (!priv->firm) |
285 | return; | 293 | return; |
286 | 294 | ||
@@ -291,9 +299,6 @@ static void free_firmware(struct xc2028_data *priv) | |||
291 | 299 | ||
292 | priv->firm = NULL; | 300 | priv->firm = NULL; |
293 | priv->firm_size = 0; | 301 | priv->firm_size = 0; |
294 | priv->state = XC2028_NO_FIRMWARE; | ||
295 | |||
296 | memset(&priv->cur_fw, 0, sizeof(priv->cur_fw)); | ||
297 | } | 302 | } |
298 | 303 | ||
299 | static int load_all_firmwares(struct dvb_frontend *fe, | 304 | static int load_all_firmwares(struct dvb_frontend *fe, |
@@ -884,9 +889,8 @@ read_not_reliable: | |||
884 | return 0; | 889 | return 0; |
885 | 890 | ||
886 | fail: | 891 | fail: |
887 | priv->state = XC2028_NO_FIRMWARE; | 892 | free_firmware(priv); |
888 | 893 | ||
889 | memset(&priv->cur_fw, 0, sizeof(priv->cur_fw)); | ||
890 | if (retry_count < 8) { | 894 | if (retry_count < 8) { |
891 | msleep(50); | 895 | msleep(50); |
892 | retry_count++; | 896 | retry_count++; |
@@ -1332,11 +1336,8 @@ static int xc2028_dvb_release(struct dvb_frontend *fe) | |||
1332 | mutex_lock(&xc2028_list_mutex); | 1336 | mutex_lock(&xc2028_list_mutex); |
1333 | 1337 | ||
1334 | /* only perform final cleanup if this is the last instance */ | 1338 | /* only perform final cleanup if this is the last instance */ |
1335 | if (hybrid_tuner_report_instance_count(priv) == 1) { | 1339 | if (hybrid_tuner_report_instance_count(priv) == 1) |
1336 | free_firmware(priv); | 1340 | free_firmware(priv); |
1337 | kfree(priv->ctrl.fname); | ||
1338 | priv->ctrl.fname = NULL; | ||
1339 | } | ||
1340 | 1341 | ||
1341 | if (priv) | 1342 | if (priv) |
1342 | hybrid_tuner_release_state(priv); | 1343 | hybrid_tuner_release_state(priv); |
@@ -1399,19 +1400,8 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg) | |||
1399 | 1400 | ||
1400 | /* | 1401 | /* |
1401 | * Copy the config data. | 1402 | * Copy the config data. |
1402 | * For the firmware name, keep a local copy of the string, | ||
1403 | * in order to avoid troubles during device release. | ||
1404 | */ | 1403 | */ |
1405 | kfree(priv->ctrl.fname); | ||
1406 | priv->ctrl.fname = NULL; | ||
1407 | memcpy(&priv->ctrl, p, sizeof(priv->ctrl)); | 1404 | memcpy(&priv->ctrl, p, sizeof(priv->ctrl)); |
1408 | if (p->fname) { | ||
1409 | priv->ctrl.fname = kstrdup(p->fname, GFP_KERNEL); | ||
1410 | if (priv->ctrl.fname == NULL) { | ||
1411 | rc = -ENOMEM; | ||
1412 | goto unlock; | ||
1413 | } | ||
1414 | } | ||
1415 | 1405 | ||
1416 | /* | 1406 | /* |
1417 | * If firmware name changed, frees firmware. As free_firmware will | 1407 | * If firmware name changed, frees firmware. As free_firmware will |
@@ -1426,10 +1416,15 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg) | |||
1426 | 1416 | ||
1427 | if (priv->state == XC2028_NO_FIRMWARE) { | 1417 | if (priv->state == XC2028_NO_FIRMWARE) { |
1428 | if (!firmware_name[0]) | 1418 | if (!firmware_name[0]) |
1429 | priv->fname = priv->ctrl.fname; | 1419 | priv->fname = kstrdup(p->fname, GFP_KERNEL); |
1430 | else | 1420 | else |
1431 | priv->fname = firmware_name; | 1421 | priv->fname = firmware_name; |
1432 | 1422 | ||
1423 | if (!priv->fname) { | ||
1424 | rc = -ENOMEM; | ||
1425 | goto unlock; | ||
1426 | } | ||
1427 | |||
1433 | rc = request_firmware_nowait(THIS_MODULE, 1, | 1428 | rc = request_firmware_nowait(THIS_MODULE, 1, |
1434 | priv->fname, | 1429 | priv->fname, |
1435 | priv->i2c_props.adap->dev.parent, | 1430 | priv->i2c_props.adap->dev.parent, |
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index 2f2225e845ef..b93fe4c4957a 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c | |||
@@ -73,8 +73,10 @@ static struct syscon *of_syscon_register(struct device_node *np) | |||
73 | /* Parse the device's DT node for an endianness specification */ | 73 | /* Parse the device's DT node for an endianness specification */ |
74 | if (of_property_read_bool(np, "big-endian")) | 74 | if (of_property_read_bool(np, "big-endian")) |
75 | syscon_config.val_format_endian = REGMAP_ENDIAN_BIG; | 75 | syscon_config.val_format_endian = REGMAP_ENDIAN_BIG; |
76 | else if (of_property_read_bool(np, "little-endian")) | 76 | else if (of_property_read_bool(np, "little-endian")) |
77 | syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE; | 77 | syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE; |
78 | else if (of_property_read_bool(np, "native-endian")) | ||
79 | syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE; | ||
78 | 80 | ||
79 | /* | 81 | /* |
80 | * search for reg-io-width property in DT. If it is not provided, | 82 | * search for reg-io-width property in DT. If it is not provided, |
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 7eec619a6023..8588dbad3301 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -393,8 +393,13 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
393 | BUG(); | 393 | BUG(); |
394 | goto err; | 394 | goto err; |
395 | } | 395 | } |
396 | 396 | ||
397 | ret = devm_regulator_bulk_get(wm8994->dev, wm8994->num_supplies, | 397 | /* |
398 | * Can't use devres helper here as some of the supplies are provided by | ||
399 | * wm8994->dev's children (regulators) and those regulators are | ||
400 | * unregistered by the devres core before the supplies are freed. | ||
401 | */ | ||
402 | ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies, | ||
398 | wm8994->supplies); | 403 | wm8994->supplies); |
399 | if (ret != 0) { | 404 | if (ret != 0) { |
400 | dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); | 405 | dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); |
@@ -405,7 +410,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
405 | wm8994->supplies); | 410 | wm8994->supplies); |
406 | if (ret != 0) { | 411 | if (ret != 0) { |
407 | dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); | 412 | dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); |
408 | goto err; | 413 | goto err_regulator_free; |
409 | } | 414 | } |
410 | 415 | ||
411 | ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET); | 416 | ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET); |
@@ -596,6 +601,8 @@ err_irq: | |||
596 | err_enable: | 601 | err_enable: |
597 | regulator_bulk_disable(wm8994->num_supplies, | 602 | regulator_bulk_disable(wm8994->num_supplies, |
598 | wm8994->supplies); | 603 | wm8994->supplies); |
604 | err_regulator_free: | ||
605 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); | ||
599 | err: | 606 | err: |
600 | mfd_remove_devices(wm8994->dev); | 607 | mfd_remove_devices(wm8994->dev); |
601 | return ret; | 608 | return ret; |
@@ -604,10 +611,11 @@ err: | |||
604 | static void wm8994_device_exit(struct wm8994 *wm8994) | 611 | static void wm8994_device_exit(struct wm8994 *wm8994) |
605 | { | 612 | { |
606 | pm_runtime_disable(wm8994->dev); | 613 | pm_runtime_disable(wm8994->dev); |
607 | mfd_remove_devices(wm8994->dev); | ||
608 | wm8994_irq_exit(wm8994); | 614 | wm8994_irq_exit(wm8994); |
609 | regulator_bulk_disable(wm8994->num_supplies, | 615 | regulator_bulk_disable(wm8994->num_supplies, |
610 | wm8994->supplies); | 616 | wm8994->supplies); |
617 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); | ||
618 | mfd_remove_devices(wm8994->dev); | ||
611 | } | 619 | } |
612 | 620 | ||
613 | static const struct of_device_id wm8994_of_match[] = { | 621 | static const struct of_device_id wm8994_of_match[] = { |
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 50a674be6655..df478ae72e23 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -1058,6 +1058,7 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) | |||
1058 | spin_unlock_irqrestore(&host->irq_lock, irqflags); | 1058 | spin_unlock_irqrestore(&host->irq_lock, irqflags); |
1059 | 1059 | ||
1060 | if (host->dma_ops->start(host, sg_len)) { | 1060 | if (host->dma_ops->start(host, sg_len)) { |
1061 | host->dma_ops->stop(host); | ||
1061 | /* We can't do DMA, try PIO for this one */ | 1062 | /* We can't do DMA, try PIO for this one */ |
1062 | dev_dbg(host->dev, | 1063 | dev_dbg(host->dev, |
1063 | "%s: fall back to PIO mode for current transfer\n", | 1064 | "%s: fall back to PIO mode for current transfer\n", |
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index fb71c866eacc..1bb11e4a9fe5 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c | |||
@@ -66,6 +66,20 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host, | |||
66 | return ret; | 66 | return ret; |
67 | } | 67 | } |
68 | } | 68 | } |
69 | /* | ||
70 | * The DAT[3:0] line signal levels and the CMD line signal level are | ||
71 | * not compatible with standard SDHC register. The line signal levels | ||
72 | * DAT[7:0] are at bits 31:24 and the command line signal level is at | ||
73 | * bit 23. All other bits are the same as in the standard SDHC | ||
74 | * register. | ||
75 | */ | ||
76 | if (spec_reg == SDHCI_PRESENT_STATE) { | ||
77 | ret = value & 0x000fffff; | ||
78 | ret |= (value >> 4) & SDHCI_DATA_LVL_MASK; | ||
79 | ret |= (value << 1) & SDHCI_CMD_LVL; | ||
80 | return ret; | ||
81 | } | ||
82 | |||
69 | ret = value; | 83 | ret = value; |
70 | return ret; | 84 | return ret; |
71 | } | 85 | } |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 766df17fb7eb..2570455b219a 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -73,6 +73,7 @@ | |||
73 | #define SDHCI_DATA_LVL_MASK 0x00F00000 | 73 | #define SDHCI_DATA_LVL_MASK 0x00F00000 |
74 | #define SDHCI_DATA_LVL_SHIFT 20 | 74 | #define SDHCI_DATA_LVL_SHIFT 20 |
75 | #define SDHCI_DATA_0_LVL_MASK 0x00100000 | 75 | #define SDHCI_DATA_0_LVL_MASK 0x00100000 |
76 | #define SDHCI_CMD_LVL 0x01000000 | ||
76 | 77 | ||
77 | #define SDHCI_HOST_CONTROL 0x28 | 78 | #define SDHCI_HOST_CONTROL 0x28 |
78 | #define SDHCI_CTRL_LED 0x01 | 79 | #define SDHCI_CTRL_LED 0x01 |
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 8c7bdbe66313..0e4f168bea9e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -1812,6 +1812,9 @@ static int bnxt_busy_poll(struct napi_struct *napi) | |||
1812 | if (atomic_read(&bp->intr_sem) != 0) | 1812 | if (atomic_read(&bp->intr_sem) != 0) |
1813 | return LL_FLUSH_FAILED; | 1813 | return LL_FLUSH_FAILED; |
1814 | 1814 | ||
1815 | if (!bp->link_info.link_up) | ||
1816 | return LL_FLUSH_FAILED; | ||
1817 | |||
1815 | if (!bnxt_lock_poll(bnapi)) | 1818 | if (!bnxt_lock_poll(bnapi)) |
1816 | return LL_FLUSH_BUSY; | 1819 | return LL_FLUSH_BUSY; |
1817 | 1820 | ||
@@ -3211,11 +3214,17 @@ static int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, __be16 port, | |||
3211 | goto err_out; | 3214 | goto err_out; |
3212 | } | 3215 | } |
3213 | 3216 | ||
3214 | if (tunnel_type & TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN) | 3217 | switch (tunnel_type) { |
3218 | case TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN: | ||
3215 | bp->vxlan_fw_dst_port_id = resp->tunnel_dst_port_id; | 3219 | bp->vxlan_fw_dst_port_id = resp->tunnel_dst_port_id; |
3216 | 3220 | break; | |
3217 | else if (tunnel_type & TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE) | 3221 | case TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE: |
3218 | bp->nge_fw_dst_port_id = resp->tunnel_dst_port_id; | 3222 | bp->nge_fw_dst_port_id = resp->tunnel_dst_port_id; |
3223 | break; | ||
3224 | default: | ||
3225 | break; | ||
3226 | } | ||
3227 | |||
3219 | err_out: | 3228 | err_out: |
3220 | mutex_unlock(&bp->hwrm_cmd_lock); | 3229 | mutex_unlock(&bp->hwrm_cmd_lock); |
3221 | return rc; | 3230 | return rc; |
diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index efabb04a1ae8..4b0f3a50b293 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c | |||
@@ -722,9 +722,6 @@ int tgec_free(struct fman_mac *tgec) | |||
722 | { | 722 | { |
723 | free_init_resources(tgec); | 723 | free_init_resources(tgec); |
724 | 724 | ||
725 | if (tgec->cfg) | ||
726 | tgec->cfg = NULL; | ||
727 | |||
728 | kfree(tgec->cfg); | 725 | kfree(tgec->cfg); |
729 | kfree(tgec); | 726 | kfree(tgec); |
730 | 727 | ||
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 1e486d1312e9..c12596676bbb 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c | |||
@@ -74,7 +74,6 @@ | |||
74 | #include <asm/iommu.h> | 74 | #include <asm/iommu.h> |
75 | #include <linux/uaccess.h> | 75 | #include <linux/uaccess.h> |
76 | #include <asm/firmware.h> | 76 | #include <asm/firmware.h> |
77 | #include <linux/seq_file.h> | ||
78 | #include <linux/workqueue.h> | 77 | #include <linux/workqueue.h> |
79 | 78 | ||
80 | #include "ibmvnic.h" | 79 | #include "ibmvnic.h" |
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 87274d4ab102..0a24571e44b9 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -4131,7 +4131,7 @@ static int mvneta_probe(struct platform_device *pdev) | |||
4131 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; | 4131 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; |
4132 | dev->hw_features |= dev->features; | 4132 | dev->hw_features |= dev->features; |
4133 | dev->vlan_features |= dev->features; | 4133 | dev->vlan_features |= dev->features; |
4134 | dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE; | 4134 | dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; |
4135 | dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; | 4135 | dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; |
4136 | 4136 | ||
4137 | /* MTU range: 68 - 9676 */ | 4137 | /* MTU range: 68 - 9676 */ |
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index ee857868bea5..dabc5418efcc 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c | |||
@@ -3293,7 +3293,7 @@ static void mvpp2_cls_init(struct mvpp2 *priv) | |||
3293 | mvpp2_write(priv, MVPP2_CLS_MODE_REG, MVPP2_CLS_MODE_ACTIVE_MASK); | 3293 | mvpp2_write(priv, MVPP2_CLS_MODE_REG, MVPP2_CLS_MODE_ACTIVE_MASK); |
3294 | 3294 | ||
3295 | /* Clear classifier flow table */ | 3295 | /* Clear classifier flow table */ |
3296 | memset(&fe.data, 0, MVPP2_CLS_FLOWS_TBL_DATA_WORDS); | 3296 | memset(&fe.data, 0, sizeof(fe.data)); |
3297 | for (index = 0; index < MVPP2_CLS_FLOWS_TBL_SIZE; index++) { | 3297 | for (index = 0; index < MVPP2_CLS_FLOWS_TBL_SIZE; index++) { |
3298 | fe.index = index; | 3298 | fe.index = index; |
3299 | mvpp2_cls_flow_write(priv, &fe); | 3299 | mvpp2_cls_flow_write(priv, &fe); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 9018bb1b2e12..c48ce3f366c3 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -129,6 +129,9 @@ static enum mlx4_net_trans_rule_id mlx4_ip_proto_to_trans_rule_id(u8 ip_proto) | |||
129 | } | 129 | } |
130 | }; | 130 | }; |
131 | 131 | ||
132 | /* Must not acquire state_lock, as its corresponding work_sync | ||
133 | * is done under it. | ||
134 | */ | ||
132 | static void mlx4_en_filter_work(struct work_struct *work) | 135 | static void mlx4_en_filter_work(struct work_struct *work) |
133 | { | 136 | { |
134 | struct mlx4_en_filter *filter = container_of(work, | 137 | struct mlx4_en_filter *filter = container_of(work, |
@@ -2239,13 +2242,13 @@ void mlx4_en_destroy_netdev(struct net_device *dev) | |||
2239 | mutex_lock(&mdev->state_lock); | 2242 | mutex_lock(&mdev->state_lock); |
2240 | mdev->pndev[priv->port] = NULL; | 2243 | mdev->pndev[priv->port] = NULL; |
2241 | mdev->upper[priv->port] = NULL; | 2244 | mdev->upper[priv->port] = NULL; |
2242 | mutex_unlock(&mdev->state_lock); | ||
2243 | 2245 | ||
2244 | #ifdef CONFIG_RFS_ACCEL | 2246 | #ifdef CONFIG_RFS_ACCEL |
2245 | mlx4_en_cleanup_filters(priv); | 2247 | mlx4_en_cleanup_filters(priv); |
2246 | #endif | 2248 | #endif |
2247 | 2249 | ||
2248 | mlx4_en_free_resources(priv); | 2250 | mlx4_en_free_resources(priv); |
2251 | mutex_unlock(&mdev->state_lock); | ||
2249 | 2252 | ||
2250 | for (t = 0; t < MLX4_EN_NUM_TX_TYPES; t++) { | 2253 | for (t = 0; t < MLX4_EN_NUM_TX_TYPES; t++) { |
2251 | kfree(priv->tx_ring[t]); | 2254 | kfree(priv->tx_ring[t]); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index b440a16101d2..2dc28695196c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <linux/mlx5/srq.h> | 46 | #include <linux/mlx5/srq.h> |
47 | #include <linux/debugfs.h> | 47 | #include <linux/debugfs.h> |
48 | #include <linux/kmod.h> | 48 | #include <linux/kmod.h> |
49 | #include <linux/delay.h> | ||
50 | #include <linux/mlx5/mlx5_ifc.h> | 49 | #include <linux/mlx5/mlx5_ifc.h> |
51 | #ifdef CONFIG_RFS_ACCEL | 50 | #ifdef CONFIG_RFS_ACCEL |
52 | #include <linux/cpu_rmap.h> | 51 | #include <linux/cpu_rmap.h> |
diff --git a/drivers/net/ethernet/synopsys/dwc_eth_qos.c b/drivers/net/ethernet/synopsys/dwc_eth_qos.c index 70533017aaa7..acce385f69d4 100644 --- a/drivers/net/ethernet/synopsys/dwc_eth_qos.c +++ b/drivers/net/ethernet/synopsys/dwc_eth_qos.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/stat.h> | 33 | #include <linux/stat.h> |
34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
35 | 35 | ||
36 | #include <linux/types.h> | ||
37 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
38 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
39 | #include <linux/mm.h> | 38 | #include <linux/mm.h> |
@@ -43,7 +42,6 @@ | |||
43 | 42 | ||
44 | #include <linux/phy.h> | 43 | #include <linux/phy.h> |
45 | #include <linux/mii.h> | 44 | #include <linux/mii.h> |
46 | #include <linux/delay.h> | ||
47 | #include <linux/dma-mapping.h> | 45 | #include <linux/dma-mapping.h> |
48 | #include <linux/vmalloc.h> | 46 | #include <linux/vmalloc.h> |
49 | 47 | ||
diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c index 4ff4c7d4b5e0..3e4c8b21403c 100644 --- a/drivers/net/ieee802154/adf7242.c +++ b/drivers/net/ieee802154/adf7242.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/skbuff.h> | 20 | #include <linux/skbuff.h> |
21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
22 | #include <linux/irq.h> | 22 | #include <linux/irq.h> |
23 | #include <linux/delay.h> | ||
24 | #include <linux/debugfs.h> | 23 | #include <linux/debugfs.h> |
25 | #include <linux/bitops.h> | 24 | #include <linux/bitops.h> |
26 | #include <linux/ieee802154.h> | 25 | #include <linux/ieee802154.h> |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 7ddfd2c917ea..3c0a1714977b 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -622,7 +622,8 @@ hash_add: | |||
622 | return 0; | 622 | return 0; |
623 | 623 | ||
624 | clear_multi: | 624 | clear_multi: |
625 | dev_set_allmulti(lowerdev, -1); | 625 | if (dev->flags & IFF_ALLMULTI) |
626 | dev_set_allmulti(lowerdev, -1); | ||
626 | del_unicast: | 627 | del_unicast: |
627 | dev_uc_del(lowerdev, dev->dev_addr); | 628 | dev_uc_del(lowerdev, dev->dev_addr); |
628 | out: | 629 | out: |
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 081df68d2ce1..ea92d524d5a8 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
@@ -318,12 +318,12 @@ static int ksz8041_config_init(struct phy_device *phydev) | |||
318 | /* Limit supported and advertised modes in fiber mode */ | 318 | /* Limit supported and advertised modes in fiber mode */ |
319 | if (of_property_read_bool(of_node, "micrel,fiber-mode")) { | 319 | if (of_property_read_bool(of_node, "micrel,fiber-mode")) { |
320 | phydev->dev_flags |= MICREL_PHY_FXEN; | 320 | phydev->dev_flags |= MICREL_PHY_FXEN; |
321 | phydev->supported &= SUPPORTED_FIBRE | | 321 | phydev->supported &= SUPPORTED_100baseT_Full | |
322 | SUPPORTED_100baseT_Full | | ||
323 | SUPPORTED_100baseT_Half; | 322 | SUPPORTED_100baseT_Half; |
324 | phydev->advertising &= ADVERTISED_FIBRE | | 323 | phydev->supported |= SUPPORTED_FIBRE; |
325 | ADVERTISED_100baseT_Full | | 324 | phydev->advertising &= ADVERTISED_100baseT_Full | |
326 | ADVERTISED_100baseT_Half; | 325 | ADVERTISED_100baseT_Half; |
326 | phydev->advertising |= ADVERTISED_FIBRE; | ||
327 | phydev->autoneg = AUTONEG_DISABLE; | 327 | phydev->autoneg = AUTONEG_DISABLE; |
328 | } | 328 | } |
329 | 329 | ||
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 87e6334eab93..547ca7b3f098 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy/phy-twl4030-usb.c | |||
@@ -459,8 +459,6 @@ static int twl4030_phy_power_off(struct phy *phy) | |||
459 | struct twl4030_usb *twl = phy_get_drvdata(phy); | 459 | struct twl4030_usb *twl = phy_get_drvdata(phy); |
460 | 460 | ||
461 | dev_dbg(twl->dev, "%s\n", __func__); | 461 | dev_dbg(twl->dev, "%s\n", __func__); |
462 | pm_runtime_mark_last_busy(twl->dev); | ||
463 | pm_runtime_put_autosuspend(twl->dev); | ||
464 | 462 | ||
465 | return 0; | 463 | return 0; |
466 | } | 464 | } |
@@ -472,6 +470,8 @@ static int twl4030_phy_power_on(struct phy *phy) | |||
472 | dev_dbg(twl->dev, "%s\n", __func__); | 470 | dev_dbg(twl->dev, "%s\n", __func__); |
473 | pm_runtime_get_sync(twl->dev); | 471 | pm_runtime_get_sync(twl->dev); |
474 | schedule_delayed_work(&twl->id_workaround_work, HZ); | 472 | schedule_delayed_work(&twl->id_workaround_work, HZ); |
473 | pm_runtime_mark_last_busy(twl->dev); | ||
474 | pm_runtime_put_autosuspend(twl->dev); | ||
475 | 475 | ||
476 | return 0; | 476 | return 0; |
477 | } | 477 | } |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 8aa769a2d919..91b70bc46e7f 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | |||
@@ -4010,7 +4010,10 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) | |||
4010 | SAM_STAT_CHECK_CONDITION; | 4010 | SAM_STAT_CHECK_CONDITION; |
4011 | } | 4011 | } |
4012 | 4012 | ||
4013 | 4013 | static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd) | |
4014 | { | ||
4015 | return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16); | ||
4016 | } | ||
4014 | 4017 | ||
4015 | /** | 4018 | /** |
4016 | * scsih_qcmd - main scsi request entry point | 4019 | * scsih_qcmd - main scsi request entry point |
@@ -4038,6 +4041,13 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) | |||
4038 | if (ioc->logging_level & MPT_DEBUG_SCSI) | 4041 | if (ioc->logging_level & MPT_DEBUG_SCSI) |
4039 | scsi_print_command(scmd); | 4042 | scsi_print_command(scmd); |
4040 | 4043 | ||
4044 | /* | ||
4045 | * Lock the device for any subsequent command until command is | ||
4046 | * done. | ||
4047 | */ | ||
4048 | if (ata_12_16_cmd(scmd)) | ||
4049 | scsi_internal_device_block(scmd->device); | ||
4050 | |||
4041 | sas_device_priv_data = scmd->device->hostdata; | 4051 | sas_device_priv_data = scmd->device->hostdata; |
4042 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { | 4052 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { |
4043 | scmd->result = DID_NO_CONNECT << 16; | 4053 | scmd->result = DID_NO_CONNECT << 16; |
@@ -4613,6 +4623,9 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) | |||
4613 | if (scmd == NULL) | 4623 | if (scmd == NULL) |
4614 | return 1; | 4624 | return 1; |
4615 | 4625 | ||
4626 | if (ata_12_16_cmd(scmd)) | ||
4627 | scsi_internal_device_unblock(scmd->device, SDEV_RUNNING); | ||
4628 | |||
4616 | mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); | 4629 | mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); |
4617 | 4630 | ||
4618 | if (mpi_reply == NULL) { | 4631 | if (mpi_reply == NULL) { |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 567fa080e261..56d6142852a5 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1456,15 +1456,20 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) | |||
1456 | for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) { | 1456 | for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) { |
1457 | sp = req->outstanding_cmds[cnt]; | 1457 | sp = req->outstanding_cmds[cnt]; |
1458 | if (sp) { | 1458 | if (sp) { |
1459 | /* Get a reference to the sp and drop the lock. | 1459 | /* Don't abort commands in adapter during EEH |
1460 | * The reference ensures this sp->done() call | 1460 | * recovery as it's not accessible/responding. |
1461 | * - and not the call in qla2xxx_eh_abort() - | ||
1462 | * ends the SCSI command (with result 'res'). | ||
1463 | */ | 1461 | */ |
1464 | sp_get(sp); | 1462 | if (!ha->flags.eeh_busy) { |
1465 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1463 | /* Get a reference to the sp and drop the lock. |
1466 | qla2xxx_eh_abort(GET_CMD_SP(sp)); | 1464 | * The reference ensures this sp->done() call |
1467 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1465 | * - and not the call in qla2xxx_eh_abort() - |
1466 | * ends the SCSI command (with result 'res'). | ||
1467 | */ | ||
1468 | sp_get(sp); | ||
1469 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
1470 | qla2xxx_eh_abort(GET_CMD_SP(sp)); | ||
1471 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
1472 | } | ||
1468 | req->outstanding_cmds[cnt] = NULL; | 1473 | req->outstanding_cmds[cnt] = NULL; |
1469 | sp->done(vha, sp, res); | 1474 | sp->done(vha, sp, res); |
1470 | } | 1475 | } |
diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c index 7a223074df3d..afada655f861 100644 --- a/drivers/thermal/intel_powerclamp.c +++ b/drivers/thermal/intel_powerclamp.c | |||
@@ -669,9 +669,16 @@ static struct thermal_cooling_device_ops powerclamp_cooling_ops = { | |||
669 | .set_cur_state = powerclamp_set_cur_state, | 669 | .set_cur_state = powerclamp_set_cur_state, |
670 | }; | 670 | }; |
671 | 671 | ||
672 | static const struct x86_cpu_id __initconst intel_powerclamp_ids[] = { | ||
673 | { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_MWAIT }, | ||
674 | {} | ||
675 | }; | ||
676 | MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids); | ||
677 | |||
672 | static int __init powerclamp_probe(void) | 678 | static int __init powerclamp_probe(void) |
673 | { | 679 | { |
674 | if (!boot_cpu_has(X86_FEATURE_MWAIT)) { | 680 | |
681 | if (!x86_match_cpu(intel_powerclamp_ids)) { | ||
675 | pr_err("CPU does not support MWAIT"); | 682 | pr_err("CPU does not support MWAIT"); |
676 | return -ENODEV; | 683 | return -ENODEV; |
677 | } | 684 | } |
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 69426e644d17..3dbb4a21ab44 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -914,6 +914,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) | |||
914 | if (!ci) | 914 | if (!ci) |
915 | return -ENOMEM; | 915 | return -ENOMEM; |
916 | 916 | ||
917 | spin_lock_init(&ci->lock); | ||
917 | ci->dev = dev; | 918 | ci->dev = dev; |
918 | ci->platdata = dev_get_platdata(dev); | 919 | ci->platdata = dev_get_platdata(dev); |
919 | ci->imx28_write_fix = !!(ci->platdata->flags & | 920 | ci->imx28_write_fix = !!(ci->platdata->flags & |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 661f43fe0f9e..c9e80ad48fdc 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1889,8 +1889,6 @@ static int udc_start(struct ci_hdrc *ci) | |||
1889 | struct usb_otg_caps *otg_caps = &ci->platdata->ci_otg_caps; | 1889 | struct usb_otg_caps *otg_caps = &ci->platdata->ci_otg_caps; |
1890 | int retval = 0; | 1890 | int retval = 0; |
1891 | 1891 | ||
1892 | spin_lock_init(&ci->lock); | ||
1893 | |||
1894 | ci->gadget.ops = &usb_gadget_ops; | 1892 | ci->gadget.ops = &usb_gadget_ops; |
1895 | ci->gadget.speed = USB_SPEED_UNKNOWN; | 1893 | ci->gadget.speed = USB_SPEED_UNKNOWN; |
1896 | ci->gadget.max_speed = USB_SPEED_HIGH; | 1894 | ci->gadget.max_speed = USB_SPEED_HIGH; |
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index e40d47d47d82..17989b72cdae 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c | |||
@@ -3225,11 +3225,11 @@ static bool ffs_func_req_match(struct usb_function *f, | |||
3225 | 3225 | ||
3226 | switch (creq->bRequestType & USB_RECIP_MASK) { | 3226 | switch (creq->bRequestType & USB_RECIP_MASK) { |
3227 | case USB_RECIP_INTERFACE: | 3227 | case USB_RECIP_INTERFACE: |
3228 | return ffs_func_revmap_intf(func, | 3228 | return (ffs_func_revmap_intf(func, |
3229 | le16_to_cpu(creq->wIndex) >= 0); | 3229 | le16_to_cpu(creq->wIndex)) >= 0); |
3230 | case USB_RECIP_ENDPOINT: | 3230 | case USB_RECIP_ENDPOINT: |
3231 | return ffs_func_revmap_ep(func, | 3231 | return (ffs_func_revmap_ep(func, |
3232 | le16_to_cpu(creq->wIndex) >= 0); | 3232 | le16_to_cpu(creq->wIndex)) >= 0); |
3233 | default: | 3233 | default: |
3234 | return (bool) (func->ffs->user_flags & | 3234 | return (bool) (func->ffs->user_flags & |
3235 | FUNCTIONFS_ALL_CTRL_RECIP); | 3235 | FUNCTIONFS_ALL_CTRL_RECIP); |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index e01116e4c067..c3e172e15ec3 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -986,7 +986,7 @@ b_host: | |||
986 | } | 986 | } |
987 | #endif | 987 | #endif |
988 | 988 | ||
989 | schedule_work(&musb->irq_work); | 989 | schedule_delayed_work(&musb->irq_work, 0); |
990 | 990 | ||
991 | return handled; | 991 | return handled; |
992 | } | 992 | } |
@@ -1855,14 +1855,23 @@ static void musb_pm_runtime_check_session(struct musb *musb) | |||
1855 | MUSB_DEVCTL_HR; | 1855 | MUSB_DEVCTL_HR; |
1856 | switch (devctl & ~s) { | 1856 | switch (devctl & ~s) { |
1857 | case MUSB_QUIRK_B_INVALID_VBUS_91: | 1857 | case MUSB_QUIRK_B_INVALID_VBUS_91: |
1858 | if (!musb->session && !musb->quirk_invalid_vbus) { | 1858 | if (musb->quirk_retries--) { |
1859 | musb->quirk_invalid_vbus = true; | ||
1860 | musb_dbg(musb, | 1859 | musb_dbg(musb, |
1861 | "First invalid vbus, assume no session"); | 1860 | "Poll devctl on invalid vbus, assume no session"); |
1861 | schedule_delayed_work(&musb->irq_work, | ||
1862 | msecs_to_jiffies(1000)); | ||
1863 | |||
1862 | return; | 1864 | return; |
1863 | } | 1865 | } |
1864 | break; | ||
1865 | case MUSB_QUIRK_A_DISCONNECT_19: | 1866 | case MUSB_QUIRK_A_DISCONNECT_19: |
1867 | if (musb->quirk_retries--) { | ||
1868 | musb_dbg(musb, | ||
1869 | "Poll devctl on possible host mode disconnect"); | ||
1870 | schedule_delayed_work(&musb->irq_work, | ||
1871 | msecs_to_jiffies(1000)); | ||
1872 | |||
1873 | return; | ||
1874 | } | ||
1866 | if (!musb->session) | 1875 | if (!musb->session) |
1867 | break; | 1876 | break; |
1868 | musb_dbg(musb, "Allow PM on possible host mode disconnect"); | 1877 | musb_dbg(musb, "Allow PM on possible host mode disconnect"); |
@@ -1886,9 +1895,9 @@ static void musb_pm_runtime_check_session(struct musb *musb) | |||
1886 | if (error < 0) | 1895 | if (error < 0) |
1887 | dev_err(musb->controller, "Could not enable: %i\n", | 1896 | dev_err(musb->controller, "Could not enable: %i\n", |
1888 | error); | 1897 | error); |
1898 | musb->quirk_retries = 3; | ||
1889 | } else { | 1899 | } else { |
1890 | musb_dbg(musb, "Allow PM with no session: %02x", devctl); | 1900 | musb_dbg(musb, "Allow PM with no session: %02x", devctl); |
1891 | musb->quirk_invalid_vbus = false; | ||
1892 | pm_runtime_mark_last_busy(musb->controller); | 1901 | pm_runtime_mark_last_busy(musb->controller); |
1893 | pm_runtime_put_autosuspend(musb->controller); | 1902 | pm_runtime_put_autosuspend(musb->controller); |
1894 | } | 1903 | } |
@@ -1899,7 +1908,7 @@ static void musb_pm_runtime_check_session(struct musb *musb) | |||
1899 | /* Only used to provide driver mode change events */ | 1908 | /* Only used to provide driver mode change events */ |
1900 | static void musb_irq_work(struct work_struct *data) | 1909 | static void musb_irq_work(struct work_struct *data) |
1901 | { | 1910 | { |
1902 | struct musb *musb = container_of(data, struct musb, irq_work); | 1911 | struct musb *musb = container_of(data, struct musb, irq_work.work); |
1903 | 1912 | ||
1904 | musb_pm_runtime_check_session(musb); | 1913 | musb_pm_runtime_check_session(musb); |
1905 | 1914 | ||
@@ -1969,6 +1978,7 @@ static struct musb *allocate_instance(struct device *dev, | |||
1969 | INIT_LIST_HEAD(&musb->control); | 1978 | INIT_LIST_HEAD(&musb->control); |
1970 | INIT_LIST_HEAD(&musb->in_bulk); | 1979 | INIT_LIST_HEAD(&musb->in_bulk); |
1971 | INIT_LIST_HEAD(&musb->out_bulk); | 1980 | INIT_LIST_HEAD(&musb->out_bulk); |
1981 | INIT_LIST_HEAD(&musb->pending_list); | ||
1972 | 1982 | ||
1973 | musb->vbuserr_retry = VBUSERR_RETRY_COUNT; | 1983 | musb->vbuserr_retry = VBUSERR_RETRY_COUNT; |
1974 | musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; | 1984 | musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; |
@@ -2018,6 +2028,84 @@ static void musb_free(struct musb *musb) | |||
2018 | musb_host_free(musb); | 2028 | musb_host_free(musb); |
2019 | } | 2029 | } |
2020 | 2030 | ||
2031 | struct musb_pending_work { | ||
2032 | int (*callback)(struct musb *musb, void *data); | ||
2033 | void *data; | ||
2034 | struct list_head node; | ||
2035 | }; | ||
2036 | |||
2037 | /* | ||
2038 | * Called from musb_runtime_resume(), musb_resume(), and | ||
2039 | * musb_queue_resume_work(). Callers must take musb->lock. | ||
2040 | */ | ||
2041 | static int musb_run_resume_work(struct musb *musb) | ||
2042 | { | ||
2043 | struct musb_pending_work *w, *_w; | ||
2044 | unsigned long flags; | ||
2045 | int error = 0; | ||
2046 | |||
2047 | spin_lock_irqsave(&musb->list_lock, flags); | ||
2048 | list_for_each_entry_safe(w, _w, &musb->pending_list, node) { | ||
2049 | if (w->callback) { | ||
2050 | error = w->callback(musb, w->data); | ||
2051 | if (error < 0) { | ||
2052 | dev_err(musb->controller, | ||
2053 | "resume callback %p failed: %i\n", | ||
2054 | w->callback, error); | ||
2055 | } | ||
2056 | } | ||
2057 | list_del(&w->node); | ||
2058 | devm_kfree(musb->controller, w); | ||
2059 | } | ||
2060 | spin_unlock_irqrestore(&musb->list_lock, flags); | ||
2061 | |||
2062 | return error; | ||
2063 | } | ||
2064 | |||
2065 | /* | ||
2066 | * Called to run work if device is active or else queue the work to happen | ||
2067 | * on resume. Caller must take musb->lock and must hold an RPM reference. | ||
2068 | * | ||
2069 | * Note that we cowardly refuse queuing work after musb PM runtime | ||
2070 | * resume is done calling musb_run_resume_work() and return -EINPROGRESS | ||
2071 | * instead. | ||
2072 | */ | ||
2073 | int musb_queue_resume_work(struct musb *musb, | ||
2074 | int (*callback)(struct musb *musb, void *data), | ||
2075 | void *data) | ||
2076 | { | ||
2077 | struct musb_pending_work *w; | ||
2078 | unsigned long flags; | ||
2079 | int error; | ||
2080 | |||
2081 | if (WARN_ON(!callback)) | ||
2082 | return -EINVAL; | ||
2083 | |||
2084 | if (pm_runtime_active(musb->controller)) | ||
2085 | return callback(musb, data); | ||
2086 | |||
2087 | w = devm_kzalloc(musb->controller, sizeof(*w), GFP_ATOMIC); | ||
2088 | if (!w) | ||
2089 | return -ENOMEM; | ||
2090 | |||
2091 | w->callback = callback; | ||
2092 | w->data = data; | ||
2093 | spin_lock_irqsave(&musb->list_lock, flags); | ||
2094 | if (musb->is_runtime_suspended) { | ||
2095 | list_add_tail(&w->node, &musb->pending_list); | ||
2096 | error = 0; | ||
2097 | } else { | ||
2098 | dev_err(musb->controller, "could not add resume work %p\n", | ||
2099 | callback); | ||
2100 | devm_kfree(musb->controller, w); | ||
2101 | error = -EINPROGRESS; | ||
2102 | } | ||
2103 | spin_unlock_irqrestore(&musb->list_lock, flags); | ||
2104 | |||
2105 | return error; | ||
2106 | } | ||
2107 | EXPORT_SYMBOL_GPL(musb_queue_resume_work); | ||
2108 | |||
2021 | static void musb_deassert_reset(struct work_struct *work) | 2109 | static void musb_deassert_reset(struct work_struct *work) |
2022 | { | 2110 | { |
2023 | struct musb *musb; | 2111 | struct musb *musb; |
@@ -2065,6 +2153,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
2065 | } | 2153 | } |
2066 | 2154 | ||
2067 | spin_lock_init(&musb->lock); | 2155 | spin_lock_init(&musb->lock); |
2156 | spin_lock_init(&musb->list_lock); | ||
2068 | musb->board_set_power = plat->set_power; | 2157 | musb->board_set_power = plat->set_power; |
2069 | musb->min_power = plat->min_power; | 2158 | musb->min_power = plat->min_power; |
2070 | musb->ops = plat->platform_ops; | 2159 | musb->ops = plat->platform_ops; |
@@ -2208,7 +2297,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
2208 | musb_generic_disable(musb); | 2297 | musb_generic_disable(musb); |
2209 | 2298 | ||
2210 | /* Init IRQ workqueue before request_irq */ | 2299 | /* Init IRQ workqueue before request_irq */ |
2211 | INIT_WORK(&musb->irq_work, musb_irq_work); | 2300 | INIT_DELAYED_WORK(&musb->irq_work, musb_irq_work); |
2212 | INIT_DELAYED_WORK(&musb->deassert_reset_work, musb_deassert_reset); | 2301 | INIT_DELAYED_WORK(&musb->deassert_reset_work, musb_deassert_reset); |
2213 | INIT_DELAYED_WORK(&musb->finish_resume_work, musb_host_finish_resume); | 2302 | INIT_DELAYED_WORK(&musb->finish_resume_work, musb_host_finish_resume); |
2214 | 2303 | ||
@@ -2291,6 +2380,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
2291 | if (status) | 2380 | if (status) |
2292 | goto fail5; | 2381 | goto fail5; |
2293 | 2382 | ||
2383 | musb->is_initialized = 1; | ||
2294 | pm_runtime_mark_last_busy(musb->controller); | 2384 | pm_runtime_mark_last_busy(musb->controller); |
2295 | pm_runtime_put_autosuspend(musb->controller); | 2385 | pm_runtime_put_autosuspend(musb->controller); |
2296 | 2386 | ||
@@ -2304,7 +2394,7 @@ fail4: | |||
2304 | musb_host_cleanup(musb); | 2394 | musb_host_cleanup(musb); |
2305 | 2395 | ||
2306 | fail3: | 2396 | fail3: |
2307 | cancel_work_sync(&musb->irq_work); | 2397 | cancel_delayed_work_sync(&musb->irq_work); |
2308 | cancel_delayed_work_sync(&musb->finish_resume_work); | 2398 | cancel_delayed_work_sync(&musb->finish_resume_work); |
2309 | cancel_delayed_work_sync(&musb->deassert_reset_work); | 2399 | cancel_delayed_work_sync(&musb->deassert_reset_work); |
2310 | if (musb->dma_controller) | 2400 | if (musb->dma_controller) |
@@ -2371,7 +2461,7 @@ static int musb_remove(struct platform_device *pdev) | |||
2371 | */ | 2461 | */ |
2372 | musb_exit_debugfs(musb); | 2462 | musb_exit_debugfs(musb); |
2373 | 2463 | ||
2374 | cancel_work_sync(&musb->irq_work); | 2464 | cancel_delayed_work_sync(&musb->irq_work); |
2375 | cancel_delayed_work_sync(&musb->finish_resume_work); | 2465 | cancel_delayed_work_sync(&musb->finish_resume_work); |
2376 | cancel_delayed_work_sync(&musb->deassert_reset_work); | 2466 | cancel_delayed_work_sync(&musb->deassert_reset_work); |
2377 | pm_runtime_get_sync(musb->controller); | 2467 | pm_runtime_get_sync(musb->controller); |
@@ -2557,6 +2647,7 @@ static int musb_suspend(struct device *dev) | |||
2557 | 2647 | ||
2558 | musb_platform_disable(musb); | 2648 | musb_platform_disable(musb); |
2559 | musb_generic_disable(musb); | 2649 | musb_generic_disable(musb); |
2650 | WARN_ON(!list_empty(&musb->pending_list)); | ||
2560 | 2651 | ||
2561 | spin_lock_irqsave(&musb->lock, flags); | 2652 | spin_lock_irqsave(&musb->lock, flags); |
2562 | 2653 | ||
@@ -2578,9 +2669,11 @@ static int musb_suspend(struct device *dev) | |||
2578 | 2669 | ||
2579 | static int musb_resume(struct device *dev) | 2670 | static int musb_resume(struct device *dev) |
2580 | { | 2671 | { |
2581 | struct musb *musb = dev_to_musb(dev); | 2672 | struct musb *musb = dev_to_musb(dev); |
2582 | u8 devctl; | 2673 | unsigned long flags; |
2583 | u8 mask; | 2674 | int error; |
2675 | u8 devctl; | ||
2676 | u8 mask; | ||
2584 | 2677 | ||
2585 | /* | 2678 | /* |
2586 | * For static cmos like DaVinci, register values were preserved | 2679 | * For static cmos like DaVinci, register values were preserved |
@@ -2614,6 +2707,13 @@ static int musb_resume(struct device *dev) | |||
2614 | 2707 | ||
2615 | musb_start(musb); | 2708 | musb_start(musb); |
2616 | 2709 | ||
2710 | spin_lock_irqsave(&musb->lock, flags); | ||
2711 | error = musb_run_resume_work(musb); | ||
2712 | if (error) | ||
2713 | dev_err(musb->controller, "resume work failed with %i\n", | ||
2714 | error); | ||
2715 | spin_unlock_irqrestore(&musb->lock, flags); | ||
2716 | |||
2617 | return 0; | 2717 | return 0; |
2618 | } | 2718 | } |
2619 | 2719 | ||
@@ -2622,14 +2722,16 @@ static int musb_runtime_suspend(struct device *dev) | |||
2622 | struct musb *musb = dev_to_musb(dev); | 2722 | struct musb *musb = dev_to_musb(dev); |
2623 | 2723 | ||
2624 | musb_save_context(musb); | 2724 | musb_save_context(musb); |
2725 | musb->is_runtime_suspended = 1; | ||
2625 | 2726 | ||
2626 | return 0; | 2727 | return 0; |
2627 | } | 2728 | } |
2628 | 2729 | ||
2629 | static int musb_runtime_resume(struct device *dev) | 2730 | static int musb_runtime_resume(struct device *dev) |
2630 | { | 2731 | { |
2631 | struct musb *musb = dev_to_musb(dev); | 2732 | struct musb *musb = dev_to_musb(dev); |
2632 | static int first = 1; | 2733 | unsigned long flags; |
2734 | int error; | ||
2633 | 2735 | ||
2634 | /* | 2736 | /* |
2635 | * When pm_runtime_get_sync called for the first time in driver | 2737 | * When pm_runtime_get_sync called for the first time in driver |
@@ -2640,9 +2742,10 @@ static int musb_runtime_resume(struct device *dev) | |||
2640 | * Also context restore without save does not make | 2742 | * Also context restore without save does not make |
2641 | * any sense | 2743 | * any sense |
2642 | */ | 2744 | */ |
2643 | if (!first) | 2745 | if (!musb->is_initialized) |
2644 | musb_restore_context(musb); | 2746 | return 0; |
2645 | first = 0; | 2747 | |
2748 | musb_restore_context(musb); | ||
2646 | 2749 | ||
2647 | if (musb->need_finish_resume) { | 2750 | if (musb->need_finish_resume) { |
2648 | musb->need_finish_resume = 0; | 2751 | musb->need_finish_resume = 0; |
@@ -2650,6 +2753,14 @@ static int musb_runtime_resume(struct device *dev) | |||
2650 | msecs_to_jiffies(USB_RESUME_TIMEOUT)); | 2753 | msecs_to_jiffies(USB_RESUME_TIMEOUT)); |
2651 | } | 2754 | } |
2652 | 2755 | ||
2756 | spin_lock_irqsave(&musb->lock, flags); | ||
2757 | error = musb_run_resume_work(musb); | ||
2758 | if (error) | ||
2759 | dev_err(musb->controller, "resume work failed with %i\n", | ||
2760 | error); | ||
2761 | musb->is_runtime_suspended = 0; | ||
2762 | spin_unlock_irqrestore(&musb->lock, flags); | ||
2763 | |||
2653 | return 0; | 2764 | return 0; |
2654 | } | 2765 | } |
2655 | 2766 | ||
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 2cb88a498f8a..91817d77d59c 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -303,13 +303,14 @@ struct musb_context_registers { | |||
303 | struct musb { | 303 | struct musb { |
304 | /* device lock */ | 304 | /* device lock */ |
305 | spinlock_t lock; | 305 | spinlock_t lock; |
306 | spinlock_t list_lock; /* resume work list lock */ | ||
306 | 307 | ||
307 | struct musb_io io; | 308 | struct musb_io io; |
308 | const struct musb_platform_ops *ops; | 309 | const struct musb_platform_ops *ops; |
309 | struct musb_context_registers context; | 310 | struct musb_context_registers context; |
310 | 311 | ||
311 | irqreturn_t (*isr)(int, void *); | 312 | irqreturn_t (*isr)(int, void *); |
312 | struct work_struct irq_work; | 313 | struct delayed_work irq_work; |
313 | struct delayed_work deassert_reset_work; | 314 | struct delayed_work deassert_reset_work; |
314 | struct delayed_work finish_resume_work; | 315 | struct delayed_work finish_resume_work; |
315 | struct delayed_work gadget_work; | 316 | struct delayed_work gadget_work; |
@@ -337,6 +338,7 @@ struct musb { | |||
337 | struct list_head control; /* of musb_qh */ | 338 | struct list_head control; /* of musb_qh */ |
338 | struct list_head in_bulk; /* of musb_qh */ | 339 | struct list_head in_bulk; /* of musb_qh */ |
339 | struct list_head out_bulk; /* of musb_qh */ | 340 | struct list_head out_bulk; /* of musb_qh */ |
341 | struct list_head pending_list; /* pending work list */ | ||
340 | 342 | ||
341 | struct timer_list otg_timer; | 343 | struct timer_list otg_timer; |
342 | struct notifier_block nb; | 344 | struct notifier_block nb; |
@@ -379,12 +381,15 @@ struct musb { | |||
379 | 381 | ||
380 | int port_mode; /* MUSB_PORT_MODE_* */ | 382 | int port_mode; /* MUSB_PORT_MODE_* */ |
381 | bool session; | 383 | bool session; |
382 | bool quirk_invalid_vbus; | 384 | unsigned long quirk_retries; |
383 | bool is_host; | 385 | bool is_host; |
384 | 386 | ||
385 | int a_wait_bcon; /* VBUS timeout in msecs */ | 387 | int a_wait_bcon; /* VBUS timeout in msecs */ |
386 | unsigned long idle_timeout; /* Next timeout in jiffies */ | 388 | unsigned long idle_timeout; /* Next timeout in jiffies */ |
387 | 389 | ||
390 | unsigned is_initialized:1; | ||
391 | unsigned is_runtime_suspended:1; | ||
392 | |||
388 | /* active means connected and not suspended */ | 393 | /* active means connected and not suspended */ |
389 | unsigned is_active:1; | 394 | unsigned is_active:1; |
390 | 395 | ||
@@ -540,6 +545,10 @@ extern irqreturn_t musb_interrupt(struct musb *); | |||
540 | 545 | ||
541 | extern void musb_hnp_stop(struct musb *musb); | 546 | extern void musb_hnp_stop(struct musb *musb); |
542 | 547 | ||
548 | int musb_queue_resume_work(struct musb *musb, | ||
549 | int (*callback)(struct musb *musb, void *data), | ||
550 | void *data); | ||
551 | |||
543 | static inline void musb_platform_set_vbus(struct musb *musb, int is_on) | 552 | static inline void musb_platform_set_vbus(struct musb *musb, int is_on) |
544 | { | 553 | { |
545 | if (musb->ops->set_vbus) | 554 | if (musb->ops->set_vbus) |
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 0f17d2140db6..feae1561b9ab 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c | |||
@@ -185,24 +185,19 @@ static void dsps_musb_disable(struct musb *musb) | |||
185 | musb_writel(reg_base, wrp->coreintr_clear, wrp->usb_bitmap); | 185 | musb_writel(reg_base, wrp->coreintr_clear, wrp->usb_bitmap); |
186 | musb_writel(reg_base, wrp->epintr_clear, | 186 | musb_writel(reg_base, wrp->epintr_clear, |
187 | wrp->txep_bitmap | wrp->rxep_bitmap); | 187 | wrp->txep_bitmap | wrp->rxep_bitmap); |
188 | del_timer_sync(&glue->timer); | ||
188 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | 189 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); |
189 | } | 190 | } |
190 | 191 | ||
191 | static void otg_timer(unsigned long _musb) | 192 | /* Caller must take musb->lock */ |
193 | static int dsps_check_status(struct musb *musb, void *unused) | ||
192 | { | 194 | { |
193 | struct musb *musb = (void *)_musb; | ||
194 | void __iomem *mregs = musb->mregs; | 195 | void __iomem *mregs = musb->mregs; |
195 | struct device *dev = musb->controller; | 196 | struct device *dev = musb->controller; |
196 | struct dsps_glue *glue = dev_get_drvdata(dev->parent); | 197 | struct dsps_glue *glue = dev_get_drvdata(dev->parent); |
197 | const struct dsps_musb_wrapper *wrp = glue->wrp; | 198 | const struct dsps_musb_wrapper *wrp = glue->wrp; |
198 | u8 devctl; | 199 | u8 devctl; |
199 | unsigned long flags; | ||
200 | int skip_session = 0; | 200 | int skip_session = 0; |
201 | int err; | ||
202 | |||
203 | err = pm_runtime_get_sync(dev); | ||
204 | if (err < 0) | ||
205 | dev_err(dev, "Poll could not pm_runtime_get: %i\n", err); | ||
206 | 201 | ||
207 | /* | 202 | /* |
208 | * We poll because DSPS IP's won't expose several OTG-critical | 203 | * We poll because DSPS IP's won't expose several OTG-critical |
@@ -212,7 +207,6 @@ static void otg_timer(unsigned long _musb) | |||
212 | dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, | 207 | dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, |
213 | usb_otg_state_string(musb->xceiv->otg->state)); | 208 | usb_otg_state_string(musb->xceiv->otg->state)); |
214 | 209 | ||
215 | spin_lock_irqsave(&musb->lock, flags); | ||
216 | switch (musb->xceiv->otg->state) { | 210 | switch (musb->xceiv->otg->state) { |
217 | case OTG_STATE_A_WAIT_VRISE: | 211 | case OTG_STATE_A_WAIT_VRISE: |
218 | mod_timer(&glue->timer, jiffies + | 212 | mod_timer(&glue->timer, jiffies + |
@@ -245,8 +239,30 @@ static void otg_timer(unsigned long _musb) | |||
245 | default: | 239 | default: |
246 | break; | 240 | break; |
247 | } | 241 | } |
248 | spin_unlock_irqrestore(&musb->lock, flags); | ||
249 | 242 | ||
243 | return 0; | ||
244 | } | ||
245 | |||
246 | static void otg_timer(unsigned long _musb) | ||
247 | { | ||
248 | struct musb *musb = (void *)_musb; | ||
249 | struct device *dev = musb->controller; | ||
250 | unsigned long flags; | ||
251 | int err; | ||
252 | |||
253 | err = pm_runtime_get(dev); | ||
254 | if ((err != -EINPROGRESS) && err < 0) { | ||
255 | dev_err(dev, "Poll could not pm_runtime_get: %i\n", err); | ||
256 | pm_runtime_put_noidle(dev); | ||
257 | |||
258 | return; | ||
259 | } | ||
260 | |||
261 | spin_lock_irqsave(&musb->lock, flags); | ||
262 | err = musb_queue_resume_work(musb, dsps_check_status, NULL); | ||
263 | if (err < 0) | ||
264 | dev_err(dev, "%s resume work: %i\n", __func__, err); | ||
265 | spin_unlock_irqrestore(&musb->lock, flags); | ||
250 | pm_runtime_mark_last_busy(dev); | 266 | pm_runtime_mark_last_busy(dev); |
251 | pm_runtime_put_autosuspend(dev); | 267 | pm_runtime_put_autosuspend(dev); |
252 | } | 268 | } |
@@ -767,28 +783,13 @@ static int dsps_probe(struct platform_device *pdev) | |||
767 | 783 | ||
768 | platform_set_drvdata(pdev, glue); | 784 | platform_set_drvdata(pdev, glue); |
769 | pm_runtime_enable(&pdev->dev); | 785 | pm_runtime_enable(&pdev->dev); |
770 | pm_runtime_use_autosuspend(&pdev->dev); | ||
771 | pm_runtime_set_autosuspend_delay(&pdev->dev, 200); | ||
772 | |||
773 | ret = pm_runtime_get_sync(&pdev->dev); | ||
774 | if (ret < 0) { | ||
775 | dev_err(&pdev->dev, "pm_runtime_get_sync FAILED"); | ||
776 | goto err2; | ||
777 | } | ||
778 | |||
779 | ret = dsps_create_musb_pdev(glue, pdev); | 786 | ret = dsps_create_musb_pdev(glue, pdev); |
780 | if (ret) | 787 | if (ret) |
781 | goto err3; | 788 | goto err; |
782 | |||
783 | pm_runtime_mark_last_busy(&pdev->dev); | ||
784 | pm_runtime_put_autosuspend(&pdev->dev); | ||
785 | 789 | ||
786 | return 0; | 790 | return 0; |
787 | 791 | ||
788 | err3: | 792 | err: |
789 | pm_runtime_put_sync(&pdev->dev); | ||
790 | err2: | ||
791 | pm_runtime_dont_use_autosuspend(&pdev->dev); | ||
792 | pm_runtime_disable(&pdev->dev); | 793 | pm_runtime_disable(&pdev->dev); |
793 | return ret; | 794 | return ret; |
794 | } | 795 | } |
@@ -799,9 +800,6 @@ static int dsps_remove(struct platform_device *pdev) | |||
799 | 800 | ||
800 | platform_device_unregister(glue->musb); | 801 | platform_device_unregister(glue->musb); |
801 | 802 | ||
802 | /* disable usbss clocks */ | ||
803 | pm_runtime_dont_use_autosuspend(&pdev->dev); | ||
804 | pm_runtime_put_sync(&pdev->dev); | ||
805 | pm_runtime_disable(&pdev->dev); | 803 | pm_runtime_disable(&pdev->dev); |
806 | 804 | ||
807 | return 0; | 805 | return 0; |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 4042ea017985..a55173c9e564 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1114,7 +1114,7 @@ static int musb_gadget_enable(struct usb_ep *ep, | |||
1114 | musb_ep->dma ? "dma, " : "", | 1114 | musb_ep->dma ? "dma, " : "", |
1115 | musb_ep->packet_sz); | 1115 | musb_ep->packet_sz); |
1116 | 1116 | ||
1117 | schedule_work(&musb->irq_work); | 1117 | schedule_delayed_work(&musb->irq_work, 0); |
1118 | 1118 | ||
1119 | fail: | 1119 | fail: |
1120 | spin_unlock_irqrestore(&musb->lock, flags); | 1120 | spin_unlock_irqrestore(&musb->lock, flags); |
@@ -1158,7 +1158,7 @@ static int musb_gadget_disable(struct usb_ep *ep) | |||
1158 | musb_ep->desc = NULL; | 1158 | musb_ep->desc = NULL; |
1159 | musb_ep->end_point.desc = NULL; | 1159 | musb_ep->end_point.desc = NULL; |
1160 | 1160 | ||
1161 | schedule_work(&musb->irq_work); | 1161 | schedule_delayed_work(&musb->irq_work, 0); |
1162 | 1162 | ||
1163 | spin_unlock_irqrestore(&(musb->lock), flags); | 1163 | spin_unlock_irqrestore(&(musb->lock), flags); |
1164 | 1164 | ||
@@ -1222,13 +1222,22 @@ void musb_ep_restart(struct musb *musb, struct musb_request *req) | |||
1222 | rxstate(musb, req); | 1222 | rxstate(musb, req); |
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | static int musb_ep_restart_resume_work(struct musb *musb, void *data) | ||
1226 | { | ||
1227 | struct musb_request *req = data; | ||
1228 | |||
1229 | musb_ep_restart(musb, req); | ||
1230 | |||
1231 | return 0; | ||
1232 | } | ||
1233 | |||
1225 | static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, | 1234 | static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, |
1226 | gfp_t gfp_flags) | 1235 | gfp_t gfp_flags) |
1227 | { | 1236 | { |
1228 | struct musb_ep *musb_ep; | 1237 | struct musb_ep *musb_ep; |
1229 | struct musb_request *request; | 1238 | struct musb_request *request; |
1230 | struct musb *musb; | 1239 | struct musb *musb; |
1231 | int status = 0; | 1240 | int status; |
1232 | unsigned long lockflags; | 1241 | unsigned long lockflags; |
1233 | 1242 | ||
1234 | if (!ep || !req) | 1243 | if (!ep || !req) |
@@ -1245,6 +1254,17 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, | |||
1245 | if (request->ep != musb_ep) | 1254 | if (request->ep != musb_ep) |
1246 | return -EINVAL; | 1255 | return -EINVAL; |
1247 | 1256 | ||
1257 | status = pm_runtime_get(musb->controller); | ||
1258 | if ((status != -EINPROGRESS) && status < 0) { | ||
1259 | dev_err(musb->controller, | ||
1260 | "pm runtime get failed in %s\n", | ||
1261 | __func__); | ||
1262 | pm_runtime_put_noidle(musb->controller); | ||
1263 | |||
1264 | return status; | ||
1265 | } | ||
1266 | status = 0; | ||
1267 | |||
1248 | trace_musb_req_enq(request); | 1268 | trace_musb_req_enq(request); |
1249 | 1269 | ||
1250 | /* request is mine now... */ | 1270 | /* request is mine now... */ |
@@ -1255,7 +1275,6 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, | |||
1255 | 1275 | ||
1256 | map_dma_buffer(request, musb, musb_ep); | 1276 | map_dma_buffer(request, musb, musb_ep); |
1257 | 1277 | ||
1258 | pm_runtime_get_sync(musb->controller); | ||
1259 | spin_lock_irqsave(&musb->lock, lockflags); | 1278 | spin_lock_irqsave(&musb->lock, lockflags); |
1260 | 1279 | ||
1261 | /* don't queue if the ep is down */ | 1280 | /* don't queue if the ep is down */ |
@@ -1271,8 +1290,14 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, | |||
1271 | list_add_tail(&request->list, &musb_ep->req_list); | 1290 | list_add_tail(&request->list, &musb_ep->req_list); |
1272 | 1291 | ||
1273 | /* it this is the head of the queue, start i/o ... */ | 1292 | /* it this is the head of the queue, start i/o ... */ |
1274 | if (!musb_ep->busy && &request->list == musb_ep->req_list.next) | 1293 | if (!musb_ep->busy && &request->list == musb_ep->req_list.next) { |
1275 | musb_ep_restart(musb, request); | 1294 | status = musb_queue_resume_work(musb, |
1295 | musb_ep_restart_resume_work, | ||
1296 | request); | ||
1297 | if (status < 0) | ||
1298 | dev_err(musb->controller, "%s resume work: %i\n", | ||
1299 | __func__, status); | ||
1300 | } | ||
1276 | 1301 | ||
1277 | unlock: | 1302 | unlock: |
1278 | spin_unlock_irqrestore(&musb->lock, lockflags); | 1303 | spin_unlock_irqrestore(&musb->lock, lockflags); |
@@ -1969,7 +1994,7 @@ static int musb_gadget_stop(struct usb_gadget *g) | |||
1969 | */ | 1994 | */ |
1970 | 1995 | ||
1971 | /* Force check of devctl register for PM runtime */ | 1996 | /* Force check of devctl register for PM runtime */ |
1972 | schedule_work(&musb->irq_work); | 1997 | schedule_delayed_work(&musb->irq_work, 0); |
1973 | 1998 | ||
1974 | pm_runtime_mark_last_busy(musb->controller); | 1999 | pm_runtime_mark_last_busy(musb->controller); |
1975 | pm_runtime_put_autosuspend(musb->controller); | 2000 | pm_runtime_put_autosuspend(musb->controller); |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index cc1225485509..e8be8e39ab8f 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -513,17 +513,18 @@ static int omap2430_probe(struct platform_device *pdev) | |||
513 | } | 513 | } |
514 | 514 | ||
515 | pm_runtime_enable(glue->dev); | 515 | pm_runtime_enable(glue->dev); |
516 | pm_runtime_use_autosuspend(glue->dev); | ||
517 | pm_runtime_set_autosuspend_delay(glue->dev, 100); | ||
518 | 516 | ||
519 | ret = platform_device_add(musb); | 517 | ret = platform_device_add(musb); |
520 | if (ret) { | 518 | if (ret) { |
521 | dev_err(&pdev->dev, "failed to register musb device\n"); | 519 | dev_err(&pdev->dev, "failed to register musb device\n"); |
522 | goto err2; | 520 | goto err3; |
523 | } | 521 | } |
524 | 522 | ||
525 | return 0; | 523 | return 0; |
526 | 524 | ||
525 | err3: | ||
526 | pm_runtime_disable(glue->dev); | ||
527 | |||
527 | err2: | 528 | err2: |
528 | platform_device_put(musb); | 529 | platform_device_put(musb); |
529 | 530 | ||
@@ -535,10 +536,7 @@ static int omap2430_remove(struct platform_device *pdev) | |||
535 | { | 536 | { |
536 | struct omap2430_glue *glue = platform_get_drvdata(pdev); | 537 | struct omap2430_glue *glue = platform_get_drvdata(pdev); |
537 | 538 | ||
538 | pm_runtime_get_sync(glue->dev); | ||
539 | platform_device_unregister(glue->musb); | 539 | platform_device_unregister(glue->musb); |
540 | pm_runtime_put_sync(glue->dev); | ||
541 | pm_runtime_dont_use_autosuspend(glue->dev); | ||
542 | pm_runtime_disable(glue->dev); | 540 | pm_runtime_disable(glue->dev); |
543 | 541 | ||
544 | return 0; | 542 | return 0; |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index df7c9f46be54..e85cc8e4e7a9 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -724,7 +724,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) | |||
724 | dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", | 724 | dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", |
725 | usb_otg_state_string(musb->xceiv->otg->state), otg_stat); | 725 | usb_otg_state_string(musb->xceiv->otg->state), otg_stat); |
726 | idle_timeout = jiffies + (1 * HZ); | 726 | idle_timeout = jiffies + (1 * HZ); |
727 | schedule_work(&musb->irq_work); | 727 | schedule_delayed_work(&musb->irq_work, 0); |
728 | 728 | ||
729 | } else /* A-dev state machine */ { | 729 | } else /* A-dev state machine */ { |
730 | dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", | 730 | dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", |
@@ -814,7 +814,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) | |||
814 | break; | 814 | break; |
815 | } | 815 | } |
816 | } | 816 | } |
817 | schedule_work(&musb->irq_work); | 817 | schedule_delayed_work(&musb->irq_work, 0); |
818 | 818 | ||
819 | return idle_timeout; | 819 | return idle_timeout; |
820 | } | 820 | } |
@@ -864,7 +864,7 @@ static irqreturn_t tusb_musb_interrupt(int irq, void *__hci) | |||
864 | musb_writel(tbase, TUSB_PRCM_WAKEUP_CLEAR, reg); | 864 | musb_writel(tbase, TUSB_PRCM_WAKEUP_CLEAR, reg); |
865 | if (reg & ~TUSB_PRCM_WNORCS) { | 865 | if (reg & ~TUSB_PRCM_WNORCS) { |
866 | musb->is_active = 1; | 866 | musb->is_active = 1; |
867 | schedule_work(&musb->irq_work); | 867 | schedule_delayed_work(&musb->irq_work, 0); |
868 | } | 868 | } |
869 | dev_dbg(musb->controller, "wake %sactive %02x\n", | 869 | dev_dbg(musb->controller, "wake %sactive %02x\n", |
870 | musb->is_active ? "" : "in", reg); | 870 | musb->is_active ? "" : "in", reg); |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index f61477bed3a8..243ac5ebe46a 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -131,6 +131,7 @@ static const struct usb_device_id id_table[] = { | |||
131 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ | 131 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ |
132 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ | 132 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ |
133 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ | 133 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ |
134 | { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */ | ||
134 | { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ | 135 | { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ |
135 | { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ | 136 | { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ |
136 | { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ | 137 | { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 0ff7f38d7800..6e9fc8bcc285 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -1012,6 +1012,8 @@ static const struct usb_device_id id_table_combined[] = { | |||
1012 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, | 1012 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, |
1013 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, | 1013 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, |
1014 | { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, | 1014 | { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, |
1015 | { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), | ||
1016 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
1015 | { } /* Terminating entry */ | 1017 | { } /* Terminating entry */ |
1016 | }; | 1018 | }; |
1017 | 1019 | ||
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 21011c0a4c64..48ee04c94a75 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -596,6 +596,12 @@ | |||
596 | #define STK541_PID 0x2109 /* Zigbee Controller */ | 596 | #define STK541_PID 0x2109 /* Zigbee Controller */ |
597 | 597 | ||
598 | /* | 598 | /* |
599 | * Texas Instruments | ||
600 | */ | ||
601 | #define TI_VID 0x0451 | ||
602 | #define TI_CC3200_LAUNCHPAD_PID 0xC32A /* SimpleLink Wi-Fi CC3200 LaunchPad */ | ||
603 | |||
604 | /* | ||
599 | * Blackfin gnICE JTAG | 605 | * Blackfin gnICE JTAG |
600 | * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice | 606 | * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice |
601 | */ | 607 | */ |
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index ffd086733421..1a59f335b063 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c | |||
@@ -954,10 +954,15 @@ int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us) | |||
954 | 954 | ||
955 | /* COMMAND STAGE */ | 955 | /* COMMAND STAGE */ |
956 | /* let's send the command via the control pipe */ | 956 | /* let's send the command via the control pipe */ |
957 | /* | ||
958 | * Command is sometime (f.e. after scsi_eh_prep_cmnd) on the stack. | ||
959 | * Stack may be vmallocated. So no DMA for us. Make a copy. | ||
960 | */ | ||
961 | memcpy(us->iobuf, srb->cmnd, srb->cmd_len); | ||
957 | result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, | 962 | result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, |
958 | US_CBI_ADSC, | 963 | US_CBI_ADSC, |
959 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, | 964 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, |
960 | us->ifnum, srb->cmnd, srb->cmd_len); | 965 | us->ifnum, us->iobuf, srb->cmd_len); |
961 | 966 | ||
962 | /* check the return code for the command */ | 967 | /* check the return code for the command */ |
963 | usb_stor_dbg(us, "Call to usb_stor_ctrl_transfer() returned %d\n", | 968 | usb_stor_dbg(us, "Call to usb_stor_ctrl_transfer() returned %d\n", |
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index fdd3228e0678..3eb58cb51e56 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -155,6 +155,7 @@ config TANGOX_WATCHDOG | |||
155 | config WDAT_WDT | 155 | config WDAT_WDT |
156 | tristate "ACPI Watchdog Action Table (WDAT)" | 156 | tristate "ACPI Watchdog Action Table (WDAT)" |
157 | depends on ACPI | 157 | depends on ACPI |
158 | select WATCHDOG_CORE | ||
158 | select ACPI_WATCHDOG | 159 | select ACPI_WATCHDOG |
159 | help | 160 | help |
160 | This driver adds support for systems with ACPI Watchdog Action | 161 | This driver adds support for systems with ACPI Watchdog Action |
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 532d8e242d4d..484bebc20bca 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -197,7 +197,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv, | |||
197 | } | 197 | } |
198 | 198 | ||
199 | ret = -EPROTONOSUPPORT; | 199 | ret = -EPROTONOSUPPORT; |
200 | if (minorversion == 0) | 200 | if (!IS_ENABLED(CONFIG_NFS_V4_1) || minorversion == 0) |
201 | ret = nfs4_callback_up_net(serv, net); | 201 | ret = nfs4_callback_up_net(serv, net); |
202 | else if (xprt->ops->bc_up) | 202 | else if (xprt->ops->bc_up) |
203 | ret = xprt->ops->bc_up(serv, net); | 203 | ret = xprt->ops->bc_up(serv, net); |
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 9b3a82abab07..1452177c822d 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -542,6 +542,13 @@ static inline bool nfs4_valid_open_stateid(const struct nfs4_state *state) | |||
542 | return test_bit(NFS_STATE_RECOVERY_FAILED, &state->flags) == 0; | 542 | return test_bit(NFS_STATE_RECOVERY_FAILED, &state->flags) == 0; |
543 | } | 543 | } |
544 | 544 | ||
545 | static inline bool nfs4_state_match_open_stateid_other(const struct nfs4_state *state, | ||
546 | const nfs4_stateid *stateid) | ||
547 | { | ||
548 | return test_bit(NFS_OPEN_STATE, &state->flags) && | ||
549 | nfs4_stateid_match_other(&state->open_stateid, stateid); | ||
550 | } | ||
551 | |||
545 | #else | 552 | #else |
546 | 553 | ||
547 | #define nfs4_close_state(a, b) do { } while (0) | 554 | #define nfs4_close_state(a, b) do { } while (0) |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 7897826d7c51..241da19b7da4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1451,7 +1451,6 @@ static void nfs_resync_open_stateid_locked(struct nfs4_state *state) | |||
1451 | } | 1451 | } |
1452 | 1452 | ||
1453 | static void nfs_clear_open_stateid_locked(struct nfs4_state *state, | 1453 | static void nfs_clear_open_stateid_locked(struct nfs4_state *state, |
1454 | nfs4_stateid *arg_stateid, | ||
1455 | nfs4_stateid *stateid, fmode_t fmode) | 1454 | nfs4_stateid *stateid, fmode_t fmode) |
1456 | { | 1455 | { |
1457 | clear_bit(NFS_O_RDWR_STATE, &state->flags); | 1456 | clear_bit(NFS_O_RDWR_STATE, &state->flags); |
@@ -1469,10 +1468,9 @@ static void nfs_clear_open_stateid_locked(struct nfs4_state *state, | |||
1469 | } | 1468 | } |
1470 | if (stateid == NULL) | 1469 | if (stateid == NULL) |
1471 | return; | 1470 | return; |
1472 | /* Handle races with OPEN */ | 1471 | /* Handle OPEN+OPEN_DOWNGRADE races */ |
1473 | if (!nfs4_stateid_match_other(arg_stateid, &state->open_stateid) || | 1472 | if (nfs4_stateid_match_other(stateid, &state->open_stateid) && |
1474 | (nfs4_stateid_match_other(stateid, &state->open_stateid) && | 1473 | !nfs4_stateid_is_newer(stateid, &state->open_stateid)) { |
1475 | !nfs4_stateid_is_newer(stateid, &state->open_stateid))) { | ||
1476 | nfs_resync_open_stateid_locked(state); | 1474 | nfs_resync_open_stateid_locked(state); |
1477 | return; | 1475 | return; |
1478 | } | 1476 | } |
@@ -1486,7 +1484,9 @@ static void nfs_clear_open_stateid(struct nfs4_state *state, | |||
1486 | nfs4_stateid *stateid, fmode_t fmode) | 1484 | nfs4_stateid *stateid, fmode_t fmode) |
1487 | { | 1485 | { |
1488 | write_seqlock(&state->seqlock); | 1486 | write_seqlock(&state->seqlock); |
1489 | nfs_clear_open_stateid_locked(state, arg_stateid, stateid, fmode); | 1487 | /* Ignore, if the CLOSE argment doesn't match the current stateid */ |
1488 | if (nfs4_state_match_open_stateid_other(state, arg_stateid)) | ||
1489 | nfs_clear_open_stateid_locked(state, stateid, fmode); | ||
1490 | write_sequnlock(&state->seqlock); | 1490 | write_sequnlock(&state->seqlock); |
1491 | if (test_bit(NFS_STATE_RECLAIM_NOGRACE, &state->flags)) | 1491 | if (test_bit(NFS_STATE_RECLAIM_NOGRACE, &state->flags)) |
1492 | nfs4_schedule_state_manager(state->owner->so_server->nfs_client); | 1492 | nfs4_schedule_state_manager(state->owner->so_server->nfs_client); |
@@ -2564,15 +2564,23 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) | |||
2564 | static int nfs41_check_expired_locks(struct nfs4_state *state) | 2564 | static int nfs41_check_expired_locks(struct nfs4_state *state) |
2565 | { | 2565 | { |
2566 | int status, ret = NFS_OK; | 2566 | int status, ret = NFS_OK; |
2567 | struct nfs4_lock_state *lsp; | 2567 | struct nfs4_lock_state *lsp, *prev = NULL; |
2568 | struct nfs_server *server = NFS_SERVER(state->inode); | 2568 | struct nfs_server *server = NFS_SERVER(state->inode); |
2569 | 2569 | ||
2570 | if (!test_bit(LK_STATE_IN_USE, &state->flags)) | 2570 | if (!test_bit(LK_STATE_IN_USE, &state->flags)) |
2571 | goto out; | 2571 | goto out; |
2572 | |||
2573 | spin_lock(&state->state_lock); | ||
2572 | list_for_each_entry(lsp, &state->lock_states, ls_locks) { | 2574 | list_for_each_entry(lsp, &state->lock_states, ls_locks) { |
2573 | if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags)) { | 2575 | if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags)) { |
2574 | struct rpc_cred *cred = lsp->ls_state->owner->so_cred; | 2576 | struct rpc_cred *cred = lsp->ls_state->owner->so_cred; |
2575 | 2577 | ||
2578 | atomic_inc(&lsp->ls_count); | ||
2579 | spin_unlock(&state->state_lock); | ||
2580 | |||
2581 | nfs4_put_lock_state(prev); | ||
2582 | prev = lsp; | ||
2583 | |||
2576 | status = nfs41_test_and_free_expired_stateid(server, | 2584 | status = nfs41_test_and_free_expired_stateid(server, |
2577 | &lsp->ls_stateid, | 2585 | &lsp->ls_stateid, |
2578 | cred); | 2586 | cred); |
@@ -2585,10 +2593,14 @@ static int nfs41_check_expired_locks(struct nfs4_state *state) | |||
2585 | set_bit(NFS_LOCK_LOST, &lsp->ls_flags); | 2593 | set_bit(NFS_LOCK_LOST, &lsp->ls_flags); |
2586 | } else if (status != NFS_OK) { | 2594 | } else if (status != NFS_OK) { |
2587 | ret = status; | 2595 | ret = status; |
2588 | break; | 2596 | nfs4_put_lock_state(prev); |
2597 | goto out; | ||
2589 | } | 2598 | } |
2599 | spin_lock(&state->state_lock); | ||
2590 | } | 2600 | } |
2591 | }; | 2601 | } |
2602 | spin_unlock(&state->state_lock); | ||
2603 | nfs4_put_lock_state(prev); | ||
2592 | out: | 2604 | out: |
2593 | return ret; | 2605 | return ret; |
2594 | } | 2606 | } |
@@ -3122,7 +3134,8 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) | |||
3122 | } else if (is_rdwr) | 3134 | } else if (is_rdwr) |
3123 | calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; | 3135 | calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; |
3124 | 3136 | ||
3125 | if (!nfs4_valid_open_stateid(state)) | 3137 | if (!nfs4_valid_open_stateid(state) || |
3138 | test_bit(NFS_OPEN_STATE, &state->flags) == 0) | ||
3126 | call_close = 0; | 3139 | call_close = 0; |
3127 | spin_unlock(&state->owner->so_lock); | 3140 | spin_unlock(&state->owner->so_lock); |
3128 | 3141 | ||
@@ -5569,6 +5582,7 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata) | |||
5569 | switch (task->tk_status) { | 5582 | switch (task->tk_status) { |
5570 | case 0: | 5583 | case 0: |
5571 | renew_lease(data->res.server, data->timestamp); | 5584 | renew_lease(data->res.server, data->timestamp); |
5585 | break; | ||
5572 | case -NFS4ERR_ADMIN_REVOKED: | 5586 | case -NFS4ERR_ADMIN_REVOKED: |
5573 | case -NFS4ERR_DELEG_REVOKED: | 5587 | case -NFS4ERR_DELEG_REVOKED: |
5574 | case -NFS4ERR_EXPIRED: | 5588 | case -NFS4ERR_EXPIRED: |
@@ -5579,8 +5593,6 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata) | |||
5579 | case -NFS4ERR_OLD_STATEID: | 5593 | case -NFS4ERR_OLD_STATEID: |
5580 | case -NFS4ERR_STALE_STATEID: | 5594 | case -NFS4ERR_STALE_STATEID: |
5581 | task->tk_status = 0; | 5595 | task->tk_status = 0; |
5582 | if (data->roc) | ||
5583 | pnfs_roc_set_barrier(data->inode, data->roc_barrier); | ||
5584 | break; | 5596 | break; |
5585 | default: | 5597 | default: |
5586 | if (nfs4_async_handle_error(task, data->res.server, | 5598 | if (nfs4_async_handle_error(task, data->res.server, |
@@ -5590,6 +5602,8 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata) | |||
5590 | } | 5602 | } |
5591 | } | 5603 | } |
5592 | data->rpc_status = task->tk_status; | 5604 | data->rpc_status = task->tk_status; |
5605 | if (data->roc && data->rpc_status == 0) | ||
5606 | pnfs_roc_set_barrier(data->inode, data->roc_barrier); | ||
5593 | } | 5607 | } |
5594 | 5608 | ||
5595 | static void nfs4_delegreturn_release(void *calldata) | 5609 | static void nfs4_delegreturn_release(void *calldata) |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 5f4281ec5f72..0959c9661662 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1547,6 +1547,7 @@ restart: | |||
1547 | ssleep(1); | 1547 | ssleep(1); |
1548 | case -NFS4ERR_ADMIN_REVOKED: | 1548 | case -NFS4ERR_ADMIN_REVOKED: |
1549 | case -NFS4ERR_STALE_STATEID: | 1549 | case -NFS4ERR_STALE_STATEID: |
1550 | case -NFS4ERR_OLD_STATEID: | ||
1550 | case -NFS4ERR_BAD_STATEID: | 1551 | case -NFS4ERR_BAD_STATEID: |
1551 | case -NFS4ERR_RECLAIM_BAD: | 1552 | case -NFS4ERR_RECLAIM_BAD: |
1552 | case -NFS4ERR_RECLAIM_CONFLICT: | 1553 | case -NFS4ERR_RECLAIM_CONFLICT: |
diff --git a/fs/splice.c b/fs/splice.c index dcaf185a5731..5a7750bd2eea 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -408,7 +408,8 @@ static ssize_t default_file_splice_read(struct file *in, loff_t *ppos, | |||
408 | if (res <= 0) | 408 | if (res <= 0) |
409 | return -ENOMEM; | 409 | return -ENOMEM; |
410 | 410 | ||
411 | nr_pages = res / PAGE_SIZE; | 411 | BUG_ON(dummy); |
412 | nr_pages = DIV_ROUND_UP(res, PAGE_SIZE); | ||
412 | 413 | ||
413 | vec = __vec; | 414 | vec = __vec; |
414 | if (nr_pages > PIPE_DEF_BUFFERS) { | 415 | if (nr_pages > PIPE_DEF_BUFFERS) { |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ae32a27523f9..ff57cd2eba3b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1619,7 +1619,7 @@ enum netdev_priv_flags { | |||
1619 | * @dcbnl_ops: Data Center Bridging netlink ops | 1619 | * @dcbnl_ops: Data Center Bridging netlink ops |
1620 | * @num_tc: Number of traffic classes in the net device | 1620 | * @num_tc: Number of traffic classes in the net device |
1621 | * @tc_to_txq: XXX: need comments on this one | 1621 | * @tc_to_txq: XXX: need comments on this one |
1622 | * @prio_tc_map XXX: need comments on this one | 1622 | * @prio_tc_map: XXX: need comments on this one |
1623 | * | 1623 | * |
1624 | * @fcoe_ddp_xid: Max exchange id for FCoE LRO by ddp | 1624 | * @fcoe_ddp_xid: Max exchange id for FCoE LRO by ddp |
1625 | * | 1625 | * |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 348f51b0ec92..e9c009dc3a4a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2567,6 +2567,7 @@ extern void sched_autogroup_create_attach(struct task_struct *p); | |||
2567 | extern void sched_autogroup_detach(struct task_struct *p); | 2567 | extern void sched_autogroup_detach(struct task_struct *p); |
2568 | extern void sched_autogroup_fork(struct signal_struct *sig); | 2568 | extern void sched_autogroup_fork(struct signal_struct *sig); |
2569 | extern void sched_autogroup_exit(struct signal_struct *sig); | 2569 | extern void sched_autogroup_exit(struct signal_struct *sig); |
2570 | extern void sched_autogroup_exit_task(struct task_struct *p); | ||
2570 | #ifdef CONFIG_PROC_FS | 2571 | #ifdef CONFIG_PROC_FS |
2571 | extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m); | 2572 | extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m); |
2572 | extern int proc_sched_autogroup_set_nice(struct task_struct *p, int nice); | 2573 | extern int proc_sched_autogroup_set_nice(struct task_struct *p, int nice); |
@@ -2576,6 +2577,7 @@ static inline void sched_autogroup_create_attach(struct task_struct *p) { } | |||
2576 | static inline void sched_autogroup_detach(struct task_struct *p) { } | 2577 | static inline void sched_autogroup_detach(struct task_struct *p) { } |
2577 | static inline void sched_autogroup_fork(struct signal_struct *sig) { } | 2578 | static inline void sched_autogroup_fork(struct signal_struct *sig) { } |
2578 | static inline void sched_autogroup_exit(struct signal_struct *sig) { } | 2579 | static inline void sched_autogroup_exit(struct signal_struct *sig) { } |
2580 | static inline void sched_autogroup_exit_task(struct task_struct *p) { } | ||
2579 | #endif | 2581 | #endif |
2580 | 2582 | ||
2581 | extern int yield_to(struct task_struct *p, bool preempt); | 2583 | extern int yield_to(struct task_struct *p, bool preempt); |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index f00bf667ec33..554671c81f4a 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -1018,7 +1018,7 @@ static inline void hci_set_drvdata(struct hci_dev *hdev, void *data) | |||
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | struct hci_dev *hci_dev_get(int index); | 1020 | struct hci_dev *hci_dev_get(int index); |
1021 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); | 1021 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, u8 src_type); |
1022 | 1022 | ||
1023 | struct hci_dev *hci_alloc_dev(void); | 1023 | struct hci_dev *hci_alloc_dev(void); |
1024 | void hci_free_dev(struct hci_dev *hdev); | 1024 | void hci_free_dev(struct hci_dev *hdev); |
diff --git a/init/Kconfig b/init/Kconfig index 405120b5f13e..5001a576b1d7 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -1957,6 +1957,7 @@ config MODULE_FORCE_UNLOAD | |||
1957 | 1957 | ||
1958 | config MODVERSIONS | 1958 | config MODVERSIONS |
1959 | bool "Module versioning support" | 1959 | bool "Module versioning support" |
1960 | depends on BROKEN | ||
1960 | help | 1961 | help |
1961 | Usually, you have to use modules compiled with your kernel. | 1962 | Usually, you have to use modules compiled with your kernel. |
1962 | Saying Y here makes it sometimes possible to use modules | 1963 | Saying Y here makes it sometimes possible to use modules |
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index 8a09b32e07d6..dd4104c9aa12 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c | |||
@@ -272,7 +272,7 @@ int __init rd_load_image(char *from) | |||
272 | sys_write(out_fd, buf, BLOCK_SIZE); | 272 | sys_write(out_fd, buf, BLOCK_SIZE); |
273 | #if !defined(CONFIG_S390) | 273 | #if !defined(CONFIG_S390) |
274 | if (!(i % 16)) { | 274 | if (!(i % 16)) { |
275 | printk("%c\b", rotator[rotate & 0x3]); | 275 | pr_cont("%c\b", rotator[rotate & 0x3]); |
276 | rotate++; | 276 | rotate++; |
277 | } | 277 | } |
278 | #endif | 278 | #endif |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 0e292132efac..6ee1febdf6ff 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -902,6 +902,17 @@ list_update_cgroup_event(struct perf_event *event, | |||
902 | * this will always be called from the right CPU. | 902 | * this will always be called from the right CPU. |
903 | */ | 903 | */ |
904 | cpuctx = __get_cpu_context(ctx); | 904 | cpuctx = __get_cpu_context(ctx); |
905 | |||
906 | /* Only set/clear cpuctx->cgrp if current task uses event->cgrp. */ | ||
907 | if (perf_cgroup_from_task(current, ctx) != event->cgrp) { | ||
908 | /* | ||
909 | * We are removing the last cpu event in this context. | ||
910 | * If that event is not active in this cpu, cpuctx->cgrp | ||
911 | * should've been cleared by perf_cgroup_switch. | ||
912 | */ | ||
913 | WARN_ON_ONCE(!add && cpuctx->cgrp); | ||
914 | return; | ||
915 | } | ||
905 | cpuctx->cgrp = add ? event->cgrp : NULL; | 916 | cpuctx->cgrp = add ? event->cgrp : NULL; |
906 | } | 917 | } |
907 | 918 | ||
@@ -8018,6 +8029,7 @@ restart: | |||
8018 | * if <size> is not specified, the range is treated as a single address. | 8029 | * if <size> is not specified, the range is treated as a single address. |
8019 | */ | 8030 | */ |
8020 | enum { | 8031 | enum { |
8032 | IF_ACT_NONE = -1, | ||
8021 | IF_ACT_FILTER, | 8033 | IF_ACT_FILTER, |
8022 | IF_ACT_START, | 8034 | IF_ACT_START, |
8023 | IF_ACT_STOP, | 8035 | IF_ACT_STOP, |
@@ -8041,6 +8053,7 @@ static const match_table_t if_tokens = { | |||
8041 | { IF_SRC_KERNEL, "%u/%u" }, | 8053 | { IF_SRC_KERNEL, "%u/%u" }, |
8042 | { IF_SRC_FILEADDR, "%u@%s" }, | 8054 | { IF_SRC_FILEADDR, "%u@%s" }, |
8043 | { IF_SRC_KERNELADDR, "%u" }, | 8055 | { IF_SRC_KERNELADDR, "%u" }, |
8056 | { IF_ACT_NONE, NULL }, | ||
8044 | }; | 8057 | }; |
8045 | 8058 | ||
8046 | /* | 8059 | /* |
diff --git a/kernel/exit.c b/kernel/exit.c index 9d68c45ebbe3..3076f3089919 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -836,6 +836,7 @@ void __noreturn do_exit(long code) | |||
836 | */ | 836 | */ |
837 | perf_event_exit_task(tsk); | 837 | perf_event_exit_task(tsk); |
838 | 838 | ||
839 | sched_autogroup_exit_task(tsk); | ||
839 | cgroup_exit(tsk); | 840 | cgroup_exit(tsk); |
840 | 841 | ||
841 | /* | 842 | /* |
diff --git a/kernel/sched/auto_group.c b/kernel/sched/auto_group.c index a5d966cb8891..f1c8fd566246 100644 --- a/kernel/sched/auto_group.c +++ b/kernel/sched/auto_group.c | |||
@@ -111,10 +111,13 @@ bool task_wants_autogroup(struct task_struct *p, struct task_group *tg) | |||
111 | { | 111 | { |
112 | if (tg != &root_task_group) | 112 | if (tg != &root_task_group) |
113 | return false; | 113 | return false; |
114 | |||
115 | /* | 114 | /* |
116 | * We can only assume the task group can't go away on us if | 115 | * If we race with autogroup_move_group() the caller can use the old |
117 | * autogroup_move_group() can see us on ->thread_group list. | 116 | * value of signal->autogroup but in this case sched_move_task() will |
117 | * be called again before autogroup_kref_put(). | ||
118 | * | ||
119 | * However, there is no way sched_autogroup_exit_task() could tell us | ||
120 | * to avoid autogroup->tg, so we abuse PF_EXITING flag for this case. | ||
118 | */ | 121 | */ |
119 | if (p->flags & PF_EXITING) | 122 | if (p->flags & PF_EXITING) |
120 | return false; | 123 | return false; |
@@ -122,6 +125,16 @@ bool task_wants_autogroup(struct task_struct *p, struct task_group *tg) | |||
122 | return true; | 125 | return true; |
123 | } | 126 | } |
124 | 127 | ||
128 | void sched_autogroup_exit_task(struct task_struct *p) | ||
129 | { | ||
130 | /* | ||
131 | * We are going to call exit_notify() and autogroup_move_group() can't | ||
132 | * see this thread after that: we can no longer use signal->autogroup. | ||
133 | * See the PF_EXITING check in task_wants_autogroup(). | ||
134 | */ | ||
135 | sched_move_task(p); | ||
136 | } | ||
137 | |||
125 | static void | 138 | static void |
126 | autogroup_move_group(struct task_struct *p, struct autogroup *ag) | 139 | autogroup_move_group(struct task_struct *p, struct autogroup *ag) |
127 | { | 140 | { |
@@ -138,13 +151,20 @@ autogroup_move_group(struct task_struct *p, struct autogroup *ag) | |||
138 | } | 151 | } |
139 | 152 | ||
140 | p->signal->autogroup = autogroup_kref_get(ag); | 153 | p->signal->autogroup = autogroup_kref_get(ag); |
141 | 154 | /* | |
142 | if (!READ_ONCE(sysctl_sched_autogroup_enabled)) | 155 | * We can't avoid sched_move_task() after we changed signal->autogroup, |
143 | goto out; | 156 | * this process can already run with task_group() == prev->tg or we can |
144 | 157 | * race with cgroup code which can read autogroup = prev under rq->lock. | |
158 | * In the latter case for_each_thread() can not miss a migrating thread, | ||
159 | * cpu_cgroup_attach() must not be possible after cgroup_exit() and it | ||
160 | * can't be removed from thread list, we hold ->siglock. | ||
161 | * | ||
162 | * If an exiting thread was already removed from thread list we rely on | ||
163 | * sched_autogroup_exit_task(). | ||
164 | */ | ||
145 | for_each_thread(p, t) | 165 | for_each_thread(p, t) |
146 | sched_move_task(t); | 166 | sched_move_task(t); |
147 | out: | 167 | |
148 | unlock_task_sighand(p, &flags); | 168 | unlock_task_sighand(p, &flags); |
149 | autogroup_kref_put(prev); | 169 | autogroup_kref_put(prev); |
150 | } | 170 | } |
diff --git a/lib/mpi/mpi-pow.c b/lib/mpi/mpi-pow.c index 5464c8744ea9..e24388a863a7 100644 --- a/lib/mpi/mpi-pow.c +++ b/lib/mpi/mpi-pow.c | |||
@@ -64,8 +64,13 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod) | |||
64 | if (!esize) { | 64 | if (!esize) { |
65 | /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0 | 65 | /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0 |
66 | * depending on if MOD equals 1. */ | 66 | * depending on if MOD equals 1. */ |
67 | rp[0] = 1; | ||
68 | res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1; | 67 | res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1; |
68 | if (res->nlimbs) { | ||
69 | if (mpi_resize(res, 1) < 0) | ||
70 | goto enomem; | ||
71 | rp = res->d; | ||
72 | rp[0] = 1; | ||
73 | } | ||
69 | res->sign = 0; | 74 | res->sign = 0; |
70 | goto leave; | 75 | goto leave; |
71 | } | 76 | } |
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index d020299baba4..1904a93f47d5 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c | |||
@@ -1090,7 +1090,6 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type, | |||
1090 | { | 1090 | { |
1091 | struct hci_conn *hcon; | 1091 | struct hci_conn *hcon; |
1092 | struct hci_dev *hdev; | 1092 | struct hci_dev *hdev; |
1093 | bdaddr_t *src = BDADDR_ANY; | ||
1094 | int n; | 1093 | int n; |
1095 | 1094 | ||
1096 | n = sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hhu", | 1095 | n = sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hhu", |
@@ -1101,7 +1100,8 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type, | |||
1101 | if (n < 7) | 1100 | if (n < 7) |
1102 | return -EINVAL; | 1101 | return -EINVAL; |
1103 | 1102 | ||
1104 | hdev = hci_get_route(addr, src); | 1103 | /* The LE_PUBLIC address type is ignored because of BDADDR_ANY */ |
1104 | hdev = hci_get_route(addr, BDADDR_ANY, BDADDR_LE_PUBLIC); | ||
1105 | if (!hdev) | 1105 | if (!hdev) |
1106 | return -ENOENT; | 1106 | return -ENOENT; |
1107 | 1107 | ||
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 3809617aa98d..dc59eae54717 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -613,7 +613,7 @@ int hci_conn_del(struct hci_conn *conn) | |||
613 | return 0; | 613 | return 0; |
614 | } | 614 | } |
615 | 615 | ||
616 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src) | 616 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, uint8_t src_type) |
617 | { | 617 | { |
618 | int use_src = bacmp(src, BDADDR_ANY); | 618 | int use_src = bacmp(src, BDADDR_ANY); |
619 | struct hci_dev *hdev = NULL, *d; | 619 | struct hci_dev *hdev = NULL, *d; |
@@ -634,7 +634,29 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src) | |||
634 | */ | 634 | */ |
635 | 635 | ||
636 | if (use_src) { | 636 | if (use_src) { |
637 | if (!bacmp(&d->bdaddr, src)) { | 637 | bdaddr_t id_addr; |
638 | u8 id_addr_type; | ||
639 | |||
640 | if (src_type == BDADDR_BREDR) { | ||
641 | if (!lmp_bredr_capable(d)) | ||
642 | continue; | ||
643 | bacpy(&id_addr, &d->bdaddr); | ||
644 | id_addr_type = BDADDR_BREDR; | ||
645 | } else { | ||
646 | if (!lmp_le_capable(d)) | ||
647 | continue; | ||
648 | |||
649 | hci_copy_identity_address(d, &id_addr, | ||
650 | &id_addr_type); | ||
651 | |||
652 | /* Convert from HCI to three-value type */ | ||
653 | if (id_addr_type == ADDR_LE_DEV_PUBLIC) | ||
654 | id_addr_type = BDADDR_LE_PUBLIC; | ||
655 | else | ||
656 | id_addr_type = BDADDR_LE_RANDOM; | ||
657 | } | ||
658 | |||
659 | if (!bacmp(&id_addr, src) && id_addr_type == src_type) { | ||
638 | hdev = d; break; | 660 | hdev = d; break; |
639 | } | 661 | } |
640 | } else { | 662 | } else { |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index d4cad29b033f..577f1c01454a 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -7060,7 +7060,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, | |||
7060 | BT_DBG("%pMR -> %pMR (type %u) psm 0x%2.2x", &chan->src, dst, | 7060 | BT_DBG("%pMR -> %pMR (type %u) psm 0x%2.2x", &chan->src, dst, |
7061 | dst_type, __le16_to_cpu(psm)); | 7061 | dst_type, __le16_to_cpu(psm)); |
7062 | 7062 | ||
7063 | hdev = hci_get_route(dst, &chan->src); | 7063 | hdev = hci_get_route(dst, &chan->src, chan->src_type); |
7064 | if (!hdev) | 7064 | if (!hdev) |
7065 | return -EHOSTUNREACH; | 7065 | return -EHOSTUNREACH; |
7066 | 7066 | ||
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 8e385a0ae60e..2f2cb5e27cdd 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -178,7 +178,7 @@ static void rfcomm_reparent_device(struct rfcomm_dev *dev) | |||
178 | struct hci_dev *hdev; | 178 | struct hci_dev *hdev; |
179 | struct hci_conn *conn; | 179 | struct hci_conn *conn; |
180 | 180 | ||
181 | hdev = hci_get_route(&dev->dst, &dev->src); | 181 | hdev = hci_get_route(&dev->dst, &dev->src, BDADDR_BREDR); |
182 | if (!hdev) | 182 | if (!hdev) |
183 | return; | 183 | return; |
184 | 184 | ||
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index f52bcbf2e58c..3125ce670c2f 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -219,7 +219,7 @@ static int sco_connect(struct sock *sk) | |||
219 | 219 | ||
220 | BT_DBG("%pMR -> %pMR", &sco_pi(sk)->src, &sco_pi(sk)->dst); | 220 | BT_DBG("%pMR -> %pMR", &sco_pi(sk)->src, &sco_pi(sk)->dst); |
221 | 221 | ||
222 | hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src); | 222 | hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src, BDADDR_BREDR); |
223 | if (!hdev) | 223 | if (!hdev) |
224 | return -EHOSTUNREACH; | 224 | return -EHOSTUNREACH; |
225 | 225 | ||
diff --git a/net/can/bcm.c b/net/can/bcm.c index 8af9d25ff988..436a7537e6a9 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -77,7 +77,7 @@ | |||
77 | (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG) : \ | 77 | (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG) : \ |
78 | (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG)) | 78 | (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG)) |
79 | 79 | ||
80 | #define CAN_BCM_VERSION "20160617" | 80 | #define CAN_BCM_VERSION "20161123" |
81 | 81 | ||
82 | MODULE_DESCRIPTION("PF_CAN broadcast manager protocol"); | 82 | MODULE_DESCRIPTION("PF_CAN broadcast manager protocol"); |
83 | MODULE_LICENSE("Dual BSD/GPL"); | 83 | MODULE_LICENSE("Dual BSD/GPL"); |
@@ -109,8 +109,9 @@ struct bcm_op { | |||
109 | u32 count; | 109 | u32 count; |
110 | u32 nframes; | 110 | u32 nframes; |
111 | u32 currframe; | 111 | u32 currframe; |
112 | struct canfd_frame *frames; | 112 | /* void pointers to arrays of struct can[fd]_frame */ |
113 | struct canfd_frame *last_frames; | 113 | void *frames; |
114 | void *last_frames; | ||
114 | struct canfd_frame sframe; | 115 | struct canfd_frame sframe; |
115 | struct canfd_frame last_sframe; | 116 | struct canfd_frame last_sframe; |
116 | struct sock *sk; | 117 | struct sock *sk; |
@@ -681,7 +682,7 @@ static void bcm_rx_handler(struct sk_buff *skb, void *data) | |||
681 | 682 | ||
682 | if (op->flags & RX_FILTER_ID) { | 683 | if (op->flags & RX_FILTER_ID) { |
683 | /* the easiest case */ | 684 | /* the easiest case */ |
684 | bcm_rx_update_and_send(op, &op->last_frames[0], rxframe); | 685 | bcm_rx_update_and_send(op, op->last_frames, rxframe); |
685 | goto rx_starttimer; | 686 | goto rx_starttimer; |
686 | } | 687 | } |
687 | 688 | ||
@@ -1068,7 +1069,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
1068 | 1069 | ||
1069 | if (msg_head->nframes) { | 1070 | if (msg_head->nframes) { |
1070 | /* update CAN frames content */ | 1071 | /* update CAN frames content */ |
1071 | err = memcpy_from_msg((u8 *)op->frames, msg, | 1072 | err = memcpy_from_msg(op->frames, msg, |
1072 | msg_head->nframes * op->cfsiz); | 1073 | msg_head->nframes * op->cfsiz); |
1073 | if (err < 0) | 1074 | if (err < 0) |
1074 | return err; | 1075 | return err; |
@@ -1118,7 +1119,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
1118 | } | 1119 | } |
1119 | 1120 | ||
1120 | if (msg_head->nframes) { | 1121 | if (msg_head->nframes) { |
1121 | err = memcpy_from_msg((u8 *)op->frames, msg, | 1122 | err = memcpy_from_msg(op->frames, msg, |
1122 | msg_head->nframes * op->cfsiz); | 1123 | msg_head->nframes * op->cfsiz); |
1123 | if (err < 0) { | 1124 | if (err < 0) { |
1124 | if (op->frames != &op->sframe) | 1125 | if (op->frames != &op->sframe) |
@@ -1163,6 +1164,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
1163 | /* check flags */ | 1164 | /* check flags */ |
1164 | 1165 | ||
1165 | if (op->flags & RX_RTR_FRAME) { | 1166 | if (op->flags & RX_RTR_FRAME) { |
1167 | struct canfd_frame *frame0 = op->frames; | ||
1166 | 1168 | ||
1167 | /* no timers in RTR-mode */ | 1169 | /* no timers in RTR-mode */ |
1168 | hrtimer_cancel(&op->thrtimer); | 1170 | hrtimer_cancel(&op->thrtimer); |
@@ -1174,8 +1176,8 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
1174 | * prevent a full-load-loopback-test ... ;-] | 1176 | * prevent a full-load-loopback-test ... ;-] |
1175 | */ | 1177 | */ |
1176 | if ((op->flags & TX_CP_CAN_ID) || | 1178 | if ((op->flags & TX_CP_CAN_ID) || |
1177 | (op->frames[0].can_id == op->can_id)) | 1179 | (frame0->can_id == op->can_id)) |
1178 | op->frames[0].can_id = op->can_id & ~CAN_RTR_FLAG; | 1180 | frame0->can_id = op->can_id & ~CAN_RTR_FLAG; |
1179 | 1181 | ||
1180 | } else { | 1182 | } else { |
1181 | if (op->flags & SETTIMER) { | 1183 | if (op->flags & SETTIMER) { |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 0adb3bec5b5a..e23766c7e3ba 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -2570,6 +2570,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
2570 | case ETHTOOL_GEEE: | 2570 | case ETHTOOL_GEEE: |
2571 | case ETHTOOL_GTUNABLE: | 2571 | case ETHTOOL_GTUNABLE: |
2572 | case ETHTOOL_PHY_GTUNABLE: | 2572 | case ETHTOOL_PHY_GTUNABLE: |
2573 | case ETHTOOL_GLINKSETTINGS: | ||
2573 | break; | 2574 | break; |
2574 | default: | 2575 | default: |
2575 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) | 2576 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) |
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index b481a4a6d3ec..1eb6f949e5b2 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c | |||
@@ -1013,4 +1013,4 @@ static int __init init_default_flow_dissectors(void) | |||
1013 | return 0; | 1013 | return 0; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | late_initcall_sync(init_default_flow_dissectors); | 1016 | core_initcall(init_default_flow_dissectors); |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index ef8a96010816..4e60525ea586 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -2737,7 +2737,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
2737 | ext_filter_mask)); | 2737 | ext_filter_mask)); |
2738 | } | 2738 | } |
2739 | 2739 | ||
2740 | return min_ifinfo_dump_size; | 2740 | return nlmsg_total_size(min_ifinfo_dump_size); |
2741 | } | 2741 | } |
2742 | 2742 | ||
2743 | static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) | 2743 | static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index b3b6bc5b9731..e1d0bf8eba4b 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1562,7 +1562,7 @@ static void udp_v4_rehash(struct sock *sk) | |||
1562 | udp_lib_rehash(sk, new_hash); | 1562 | udp_lib_rehash(sk, new_hash); |
1563 | } | 1563 | } |
1564 | 1564 | ||
1565 | static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | 1565 | int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) |
1566 | { | 1566 | { |
1567 | int rc; | 1567 | int rc; |
1568 | 1568 | ||
diff --git a/net/ipv4/udp_impl.h b/net/ipv4/udp_impl.h index 7e0fe4bdd967..feb50a16398d 100644 --- a/net/ipv4/udp_impl.h +++ b/net/ipv4/udp_impl.h | |||
@@ -25,7 +25,7 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, | |||
25 | int flags, int *addr_len); | 25 | int flags, int *addr_len); |
26 | int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, | 26 | int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, |
27 | int flags); | 27 | int flags); |
28 | int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 28 | int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
29 | void udp_destroy_sock(struct sock *sk); | 29 | void udp_destroy_sock(struct sock *sk); |
30 | 30 | ||
31 | #ifdef CONFIG_PROC_FS | 31 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 86219c0a0104..4c387dc338e3 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -183,7 +183,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx, | |||
183 | 183 | ||
184 | static void addrconf_dad_start(struct inet6_ifaddr *ifp); | 184 | static void addrconf_dad_start(struct inet6_ifaddr *ifp); |
185 | static void addrconf_dad_work(struct work_struct *w); | 185 | static void addrconf_dad_work(struct work_struct *w); |
186 | static void addrconf_dad_completed(struct inet6_ifaddr *ifp); | 186 | static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id); |
187 | static void addrconf_dad_run(struct inet6_dev *idev); | 187 | static void addrconf_dad_run(struct inet6_dev *idev); |
188 | static void addrconf_rs_timer(unsigned long data); | 188 | static void addrconf_rs_timer(unsigned long data); |
189 | static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); | 189 | static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); |
@@ -2906,6 +2906,7 @@ static void add_addr(struct inet6_dev *idev, const struct in6_addr *addr, | |||
2906 | spin_lock_bh(&ifp->lock); | 2906 | spin_lock_bh(&ifp->lock); |
2907 | ifp->flags &= ~IFA_F_TENTATIVE; | 2907 | ifp->flags &= ~IFA_F_TENTATIVE; |
2908 | spin_unlock_bh(&ifp->lock); | 2908 | spin_unlock_bh(&ifp->lock); |
2909 | rt_genid_bump_ipv6(dev_net(idev->dev)); | ||
2909 | ipv6_ifa_notify(RTM_NEWADDR, ifp); | 2910 | ipv6_ifa_notify(RTM_NEWADDR, ifp); |
2910 | in6_ifa_put(ifp); | 2911 | in6_ifa_put(ifp); |
2911 | } | 2912 | } |
@@ -3748,7 +3749,7 @@ static void addrconf_dad_begin(struct inet6_ifaddr *ifp) | |||
3748 | { | 3749 | { |
3749 | struct inet6_dev *idev = ifp->idev; | 3750 | struct inet6_dev *idev = ifp->idev; |
3750 | struct net_device *dev = idev->dev; | 3751 | struct net_device *dev = idev->dev; |
3751 | bool notify = false; | 3752 | bool bump_id, notify = false; |
3752 | 3753 | ||
3753 | addrconf_join_solict(dev, &ifp->addr); | 3754 | addrconf_join_solict(dev, &ifp->addr); |
3754 | 3755 | ||
@@ -3763,11 +3764,12 @@ static void addrconf_dad_begin(struct inet6_ifaddr *ifp) | |||
3763 | idev->cnf.accept_dad < 1 || | 3764 | idev->cnf.accept_dad < 1 || |
3764 | !(ifp->flags&IFA_F_TENTATIVE) || | 3765 | !(ifp->flags&IFA_F_TENTATIVE) || |
3765 | ifp->flags & IFA_F_NODAD) { | 3766 | ifp->flags & IFA_F_NODAD) { |
3767 | bump_id = ifp->flags & IFA_F_TENTATIVE; | ||
3766 | ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED); | 3768 | ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED); |
3767 | spin_unlock(&ifp->lock); | 3769 | spin_unlock(&ifp->lock); |
3768 | read_unlock_bh(&idev->lock); | 3770 | read_unlock_bh(&idev->lock); |
3769 | 3771 | ||
3770 | addrconf_dad_completed(ifp); | 3772 | addrconf_dad_completed(ifp, bump_id); |
3771 | return; | 3773 | return; |
3772 | } | 3774 | } |
3773 | 3775 | ||
@@ -3827,8 +3829,8 @@ static void addrconf_dad_work(struct work_struct *w) | |||
3827 | struct inet6_ifaddr, | 3829 | struct inet6_ifaddr, |
3828 | dad_work); | 3830 | dad_work); |
3829 | struct inet6_dev *idev = ifp->idev; | 3831 | struct inet6_dev *idev = ifp->idev; |
3832 | bool bump_id, disable_ipv6 = false; | ||
3830 | struct in6_addr mcaddr; | 3833 | struct in6_addr mcaddr; |
3831 | bool disable_ipv6 = false; | ||
3832 | 3834 | ||
3833 | enum { | 3835 | enum { |
3834 | DAD_PROCESS, | 3836 | DAD_PROCESS, |
@@ -3898,11 +3900,12 @@ static void addrconf_dad_work(struct work_struct *w) | |||
3898 | * DAD was successful | 3900 | * DAD was successful |
3899 | */ | 3901 | */ |
3900 | 3902 | ||
3903 | bump_id = ifp->flags & IFA_F_TENTATIVE; | ||
3901 | ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED); | 3904 | ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED); |
3902 | spin_unlock(&ifp->lock); | 3905 | spin_unlock(&ifp->lock); |
3903 | write_unlock_bh(&idev->lock); | 3906 | write_unlock_bh(&idev->lock); |
3904 | 3907 | ||
3905 | addrconf_dad_completed(ifp); | 3908 | addrconf_dad_completed(ifp, bump_id); |
3906 | 3909 | ||
3907 | goto out; | 3910 | goto out; |
3908 | } | 3911 | } |
@@ -3939,7 +3942,7 @@ static bool ipv6_lonely_lladdr(struct inet6_ifaddr *ifp) | |||
3939 | return true; | 3942 | return true; |
3940 | } | 3943 | } |
3941 | 3944 | ||
3942 | static void addrconf_dad_completed(struct inet6_ifaddr *ifp) | 3945 | static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id) |
3943 | { | 3946 | { |
3944 | struct net_device *dev = ifp->idev->dev; | 3947 | struct net_device *dev = ifp->idev->dev; |
3945 | struct in6_addr lladdr; | 3948 | struct in6_addr lladdr; |
@@ -3991,6 +3994,9 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp) | |||
3991 | spin_unlock(&ifp->lock); | 3994 | spin_unlock(&ifp->lock); |
3992 | write_unlock_bh(&ifp->idev->lock); | 3995 | write_unlock_bh(&ifp->idev->lock); |
3993 | } | 3996 | } |
3997 | |||
3998 | if (bump_id) | ||
3999 | rt_genid_bump_ipv6(dev_net(dev)); | ||
3994 | } | 4000 | } |
3995 | 4001 | ||
3996 | static void addrconf_dad_run(struct inet6_dev *idev) | 4002 | static void addrconf_dad_run(struct inet6_dev *idev) |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index ba25ec20806b..649efc26a252 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -512,7 +512,7 @@ out: | |||
512 | return; | 512 | return; |
513 | } | 513 | } |
514 | 514 | ||
515 | static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | 515 | int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) |
516 | { | 516 | { |
517 | int rc; | 517 | int rc; |
518 | 518 | ||
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h index f6eb1ab34f4b..e78bdc76dcc3 100644 --- a/net/ipv6/udp_impl.h +++ b/net/ipv6/udp_impl.h | |||
@@ -26,7 +26,7 @@ int compat_udpv6_getsockopt(struct sock *sk, int level, int optname, | |||
26 | int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len); | 26 | int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len); |
27 | int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, | 27 | int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, |
28 | int flags, int *addr_len); | 28 | int flags, int *addr_len); |
29 | int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 29 | int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
30 | void udpv6_destroy_sock(struct sock *sk); | 30 | void udpv6_destroy_sock(struct sock *sk); |
31 | 31 | ||
32 | #ifdef CONFIG_PROC_FS | 32 | #ifdef CONFIG_PROC_FS |
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index 5b90eb6c82c4..e2c6ae024565 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c | |||
@@ -97,7 +97,7 @@ static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
97 | unsigned int len = skb->len; | 97 | unsigned int len = skb->len; |
98 | int ret = l2tp_xmit_skb(session, skb, session->hdr_len); | 98 | int ret = l2tp_xmit_skb(session, skb, session->hdr_len); |
99 | 99 | ||
100 | if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) { | 100 | if (likely(ret == NET_XMIT_SUCCESS)) { |
101 | atomic_long_add(len, &priv->tx_bytes); | 101 | atomic_long_add(len, &priv->tx_bytes); |
102 | atomic_long_inc(&priv->tx_packets); | 102 | atomic_long_inc(&priv->tx_packets); |
103 | } else { | 103 | } else { |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 8e93d4afe5ea..b05d4a2155b0 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -112,7 +112,7 @@ static void tfilter_notify_chain(struct net *net, struct sk_buff *oskb, | |||
112 | 112 | ||
113 | for (it_chain = chain; (tp = rtnl_dereference(*it_chain)) != NULL; | 113 | for (it_chain = chain; (tp = rtnl_dereference(*it_chain)) != NULL; |
114 | it_chain = &tp->next) | 114 | it_chain = &tp->next) |
115 | tfilter_notify(net, oskb, n, tp, n->nlmsg_flags, event, false); | 115 | tfilter_notify(net, oskb, n, tp, 0, event, false); |
116 | } | 116 | } |
117 | 117 | ||
118 | /* Select new prio value from the range, managed by kernel. */ | 118 | /* Select new prio value from the range, managed by kernel. */ |
diff --git a/net/tipc/link.c b/net/tipc/link.c index 1055164c6232..ecc12411155e 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -1492,8 +1492,9 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, | |||
1492 | if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) | 1492 | if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) |
1493 | l->tolerance = peers_tol; | 1493 | l->tolerance = peers_tol; |
1494 | 1494 | ||
1495 | if (peers_prio && in_range(peers_prio, TIPC_MIN_LINK_PRI, | 1495 | /* Update own prio if peer indicates a different value */ |
1496 | TIPC_MAX_LINK_PRI)) { | 1496 | if ((peers_prio != l->priority) && |
1497 | in_range(peers_prio, 1, TIPC_MAX_LINK_PRI)) { | ||
1497 | l->priority = peers_prio; | 1498 | l->priority = peers_prio; |
1498 | rc = tipc_link_fsm_evt(l, LINK_FAILURE_EVT); | 1499 | rc = tipc_link_fsm_evt(l, LINK_FAILURE_EVT); |
1499 | } | 1500 | } |
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c index ed97a5876ebe..9e109bb1a207 100644 --- a/net/tipc/monitor.c +++ b/net/tipc/monitor.c | |||
@@ -455,14 +455,14 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr, | |||
455 | int i, applied_bef; | 455 | int i, applied_bef; |
456 | 456 | ||
457 | state->probing = false; | 457 | state->probing = false; |
458 | if (!dlen) | ||
459 | return; | ||
460 | 458 | ||
461 | /* Sanity check received domain record */ | 459 | /* Sanity check received domain record */ |
462 | if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen) { | 460 | if (dlen < dom_rec_len(arrv_dom, 0)) |
463 | pr_warn_ratelimited("Received illegal domain record\n"); | 461 | return; |
462 | if (dlen != dom_rec_len(arrv_dom, new_member_cnt)) | ||
463 | return; | ||
464 | if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen) | ||
464 | return; | 465 | return; |
465 | } | ||
466 | 466 | ||
467 | /* Synch generation numbers with peer if link just came up */ | 467 | /* Synch generation numbers with peer if link just came up */ |
468 | if (!state->synched) { | 468 | if (!state->synched) { |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 4916d8fea328..333c5dae0072 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -184,7 +184,7 @@ static struct tipc_sock *tipc_sk(const struct sock *sk) | |||
184 | 184 | ||
185 | static bool tsk_conn_cong(struct tipc_sock *tsk) | 185 | static bool tsk_conn_cong(struct tipc_sock *tsk) |
186 | { | 186 | { |
187 | return tsk->snt_unacked >= tsk->snd_win; | 187 | return tsk->snt_unacked > tsk->snd_win; |
188 | } | 188 | } |
189 | 189 | ||
190 | /* tsk_blocks(): translate a buffer size in bytes to number of | 190 | /* tsk_blocks(): translate a buffer size in bytes to number of |