1 |
commit: b4a959370d2f0791ccc063afa96af89fe14f21ff |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 24 10:51:11 2016 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 24 10:51:11 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b4a95937 |
7 |
|
8 |
Linux patch 4.4.22 |
9 |
|
10 |
0000_README | 4 + |
11 |
1021_linux-4.4.22.patch | 3663 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 3667 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 71b358f..d60af0e 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -127,6 +127,10 @@ Patch: 1020_linux-4.4.21.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.4.21 |
21 |
|
22 |
+Patch: 1021_linux-4.4.22.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.4.22 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1021_linux-4.4.22.patch b/1021_linux-4.4.22.patch |
31 |
new file mode 100644 |
32 |
index 0000000..8381b8d |
33 |
--- /dev/null |
34 |
+++ b/1021_linux-4.4.22.patch |
35 |
@@ -0,0 +1,3663 @@ |
36 |
+diff --git a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt |
37 |
+index a9a5fe19ff2a..ec9d65682702 100644 |
38 |
+--- a/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt |
39 |
++++ b/Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt |
40 |
+@@ -12,6 +12,11 @@ Required properties: |
41 |
+ - vref-supply: The regulator supply ADC reference voltage. |
42 |
+ - #io-channel-cells: Should be 1, see ../iio-bindings.txt |
43 |
+ |
44 |
++Optional properties: |
45 |
++- resets: Must contain an entry for each entry in reset-names if need support |
46 |
++ this option. See ../reset/reset.txt for details. |
47 |
++- reset-names: Must include the name "saradc-apb". |
48 |
++ |
49 |
+ Example: |
50 |
+ saradc: saradc@2006c000 { |
51 |
+ compatible = "rockchip,saradc"; |
52 |
+@@ -19,6 +24,8 @@ Example: |
53 |
+ interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; |
54 |
+ clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; |
55 |
+ clock-names = "saradc", "apb_pclk"; |
56 |
++ resets = <&cru SRST_SARADC>; |
57 |
++ reset-names = "saradc-apb"; |
58 |
+ #io-channel-cells = <1>; |
59 |
+ vref-supply = <&vcc18>; |
60 |
+ }; |
61 |
+diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c |
62 |
+index aaeafa18d99b..c99a75968c01 100644 |
63 |
+--- a/Documentation/mic/mpssd/mpssd.c |
64 |
++++ b/Documentation/mic/mpssd/mpssd.c |
65 |
+@@ -1538,9 +1538,9 @@ set_cmdline(struct mic_info *mic) |
66 |
+ |
67 |
+ len = snprintf(buffer, PATH_MAX, |
68 |
+ "clocksource=tsc highres=off nohz=off "); |
69 |
+- len += snprintf(buffer + len, PATH_MAX, |
70 |
++ len += snprintf(buffer + len, PATH_MAX - len, |
71 |
+ "cpufreq_on;corec6_off;pc3_off;pc6_off "); |
72 |
+- len += snprintf(buffer + len, PATH_MAX, |
73 |
++ len += snprintf(buffer + len, PATH_MAX - len, |
74 |
+ "ifcfg=static;address,172.31.%d.1;netmask,255.255.255.0", |
75 |
+ mic->id + 1); |
76 |
+ |
77 |
+diff --git a/Makefile b/Makefile |
78 |
+index d1cc9e0b7473..a6512f4eec9f 100644 |
79 |
+--- a/Makefile |
80 |
++++ b/Makefile |
81 |
+@@ -1,6 +1,6 @@ |
82 |
+ VERSION = 4 |
83 |
+ PATCHLEVEL = 4 |
84 |
+-SUBLEVEL = 21 |
85 |
++SUBLEVEL = 22 |
86 |
+ EXTRAVERSION = |
87 |
+ NAME = Blurry Fish Butt |
88 |
+ |
89 |
+diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h |
90 |
+index 9b0d40093c9a..c0ddbbf73400 100644 |
91 |
+--- a/arch/alpha/include/asm/uaccess.h |
92 |
++++ b/arch/alpha/include/asm/uaccess.h |
93 |
+@@ -371,14 +371,6 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len) |
94 |
+ return __cu_len; |
95 |
+ } |
96 |
+ |
97 |
+-extern inline long |
98 |
+-__copy_tofrom_user(void *to, const void *from, long len, const void __user *validate) |
99 |
+-{ |
100 |
+- if (__access_ok((unsigned long)validate, len, get_fs())) |
101 |
+- len = __copy_tofrom_user_nocheck(to, from, len); |
102 |
+- return len; |
103 |
+-} |
104 |
+- |
105 |
+ #define __copy_to_user(to, from, n) \ |
106 |
+ ({ \ |
107 |
+ __chk_user_ptr(to); \ |
108 |
+@@ -393,17 +385,22 @@ __copy_tofrom_user(void *to, const void *from, long len, const void __user *vali |
109 |
+ #define __copy_to_user_inatomic __copy_to_user |
110 |
+ #define __copy_from_user_inatomic __copy_from_user |
111 |
+ |
112 |
+- |
113 |
+ extern inline long |
114 |
+ copy_to_user(void __user *to, const void *from, long n) |
115 |
+ { |
116 |
+- return __copy_tofrom_user((__force void *)to, from, n, to); |
117 |
++ if (likely(__access_ok((unsigned long)to, n, get_fs()))) |
118 |
++ n = __copy_tofrom_user_nocheck((__force void *)to, from, n); |
119 |
++ return n; |
120 |
+ } |
121 |
+ |
122 |
+ extern inline long |
123 |
+ copy_from_user(void *to, const void __user *from, long n) |
124 |
+ { |
125 |
+- return __copy_tofrom_user(to, (__force void *)from, n, from); |
126 |
++ if (likely(__access_ok((unsigned long)from, n, get_fs()))) |
127 |
++ n = __copy_tofrom_user_nocheck(to, (__force void *)from, n); |
128 |
++ else |
129 |
++ memset(to, 0, n); |
130 |
++ return n; |
131 |
+ } |
132 |
+ |
133 |
+ extern void __do_clear_user(void); |
134 |
+diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h |
135 |
+index 3cab04255ae0..e5fec320f158 100644 |
136 |
+--- a/arch/arc/include/asm/pgtable.h |
137 |
++++ b/arch/arc/include/asm/pgtable.h |
138 |
+@@ -277,8 +277,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) |
139 |
+ |
140 |
+ #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) |
141 |
+ #define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) |
142 |
+-#define pfn_pte(pfn, prot) (__pte(((pte_t)(pfn) << PAGE_SHIFT) | \ |
143 |
+- pgprot_val(prot))) |
144 |
++#define pfn_pte(pfn, prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) |
145 |
+ #define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) |
146 |
+ |
147 |
+ /* |
148 |
+diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h |
149 |
+index d1da6032b715..d4d8df706efa 100644 |
150 |
+--- a/arch/arc/include/asm/uaccess.h |
151 |
++++ b/arch/arc/include/asm/uaccess.h |
152 |
+@@ -83,7 +83,10 @@ |
153 |
+ "2: ;nop\n" \ |
154 |
+ " .section .fixup, \"ax\"\n" \ |
155 |
+ " .align 4\n" \ |
156 |
+- "3: mov %0, %3\n" \ |
157 |
++ "3: # return -EFAULT\n" \ |
158 |
++ " mov %0, %3\n" \ |
159 |
++ " # zero out dst ptr\n" \ |
160 |
++ " mov %1, 0\n" \ |
161 |
+ " j 2b\n" \ |
162 |
+ " .previous\n" \ |
163 |
+ " .section __ex_table, \"a\"\n" \ |
164 |
+@@ -101,7 +104,11 @@ |
165 |
+ "2: ;nop\n" \ |
166 |
+ " .section .fixup, \"ax\"\n" \ |
167 |
+ " .align 4\n" \ |
168 |
+- "3: mov %0, %3\n" \ |
169 |
++ "3: # return -EFAULT\n" \ |
170 |
++ " mov %0, %3\n" \ |
171 |
++ " # zero out dst ptr\n" \ |
172 |
++ " mov %1, 0\n" \ |
173 |
++ " mov %R1, 0\n" \ |
174 |
+ " j 2b\n" \ |
175 |
+ " .previous\n" \ |
176 |
+ " .section __ex_table, \"a\"\n" \ |
177 |
+diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi |
178 |
+index 2b6cc8bf3c5c..e6af41c4bbc1 100644 |
179 |
+--- a/arch/arm/boot/dts/imx6qdl.dtsi |
180 |
++++ b/arch/arm/boot/dts/imx6qdl.dtsi |
181 |
+@@ -221,7 +221,7 @@ |
182 |
+ clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>, |
183 |
+ <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_ASRC>, |
184 |
+ <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_ESAI_EXTAL>, |
185 |
+- <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_MLB>, |
186 |
++ <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_DUMMY>, |
187 |
+ <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_SPBA>; |
188 |
+ clock-names = "core", "rxtx0", |
189 |
+ "rxtx1", "rxtx2", |
190 |
+diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts |
191 |
+index bfa5edde179c..2c1e7f09205f 100644 |
192 |
+--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts |
193 |
++++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts |
194 |
+@@ -113,7 +113,7 @@ |
195 |
+ |
196 |
+ partition@e0000 { |
197 |
+ label = "u-boot environment"; |
198 |
+- reg = <0xe0000 0x100000>; |
199 |
++ reg = <0xe0000 0x20000>; |
200 |
+ }; |
201 |
+ |
202 |
+ partition@100000 { |
203 |
+diff --git a/arch/arm/boot/dts/omap3-overo-base.dtsi b/arch/arm/boot/dts/omap3-overo-base.dtsi |
204 |
+index a29ad16cc9bb..64c5af30c1d0 100644 |
205 |
+--- a/arch/arm/boot/dts/omap3-overo-base.dtsi |
206 |
++++ b/arch/arm/boot/dts/omap3-overo-base.dtsi |
207 |
+@@ -223,7 +223,9 @@ |
208 |
+ }; |
209 |
+ |
210 |
+ &gpmc { |
211 |
+- ranges = <0 0 0x00000000 0x20000000>; |
212 |
++ ranges = <0 0 0x30000000 0x1000000>, /* CS0 */ |
213 |
++ <4 0 0x2b000000 0x1000000>, /* CS4 */ |
214 |
++ <5 0 0x2c000000 0x1000000>; /* CS5 */ |
215 |
+ |
216 |
+ nand@0,0 { |
217 |
+ linux,mtd-name= "micron,mt29c4g96maz"; |
218 |
+diff --git a/arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi b/arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi |
219 |
+index 17b82f82638a..64047788216b 100644 |
220 |
+--- a/arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi |
221 |
++++ b/arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi |
222 |
+@@ -55,8 +55,6 @@ |
223 |
+ #include "omap-gpmc-smsc9221.dtsi" |
224 |
+ |
225 |
+ &gpmc { |
226 |
+- ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */ |
227 |
+- |
228 |
+ ethernet@gpmc { |
229 |
+ reg = <5 0 0xff>; |
230 |
+ interrupt-parent = <&gpio6>; |
231 |
+diff --git a/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi |
232 |
+index 9e24b6a1d07b..1b304e2f1bd2 100644 |
233 |
+--- a/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi |
234 |
++++ b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi |
235 |
+@@ -27,8 +27,6 @@ |
236 |
+ #include "omap-gpmc-smsc9221.dtsi" |
237 |
+ |
238 |
+ &gpmc { |
239 |
+- ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */ |
240 |
+- |
241 |
+ ethernet@gpmc { |
242 |
+ reg = <5 0 0xff>; |
243 |
+ interrupt-parent = <&gpio6>; |
244 |
+diff --git a/arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi b/arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi |
245 |
+index 334109e14613..82e98ee3023a 100644 |
246 |
+--- a/arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi |
247 |
++++ b/arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi |
248 |
+@@ -15,9 +15,6 @@ |
249 |
+ #include "omap-gpmc-smsc9221.dtsi" |
250 |
+ |
251 |
+ &gpmc { |
252 |
+- ranges = <4 0 0x2b000000 0x1000000>, /* CS4 */ |
253 |
+- <5 0 0x2c000000 0x1000000>; /* CS5 */ |
254 |
+- |
255 |
+ smsc1: ethernet@gpmc { |
256 |
+ reg = <5 0 0xff>; |
257 |
+ interrupt-parent = <&gpio6>; |
258 |
+diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi |
259 |
+index 81f81214cdf9..bbf95375cf99 100644 |
260 |
+--- a/arch/arm/boot/dts/stih407-family.dtsi |
261 |
++++ b/arch/arm/boot/dts/stih407-family.dtsi |
262 |
+@@ -497,8 +497,9 @@ |
263 |
+ interrupt-names = "mmcirq"; |
264 |
+ pinctrl-names = "default"; |
265 |
+ pinctrl-0 = <&pinctrl_mmc0>; |
266 |
+- clock-names = "mmc"; |
267 |
+- clocks = <&clk_s_c0_flexgen CLK_MMC_0>; |
268 |
++ clock-names = "mmc", "icn"; |
269 |
++ clocks = <&clk_s_c0_flexgen CLK_MMC_0>, |
270 |
++ <&clk_s_c0_flexgen CLK_RX_ICN_HVA>; |
271 |
+ bus-width = <8>; |
272 |
+ non-removable; |
273 |
+ }; |
274 |
+@@ -512,8 +513,9 @@ |
275 |
+ interrupt-names = "mmcirq"; |
276 |
+ pinctrl-names = "default"; |
277 |
+ pinctrl-0 = <&pinctrl_sd1>; |
278 |
+- clock-names = "mmc"; |
279 |
+- clocks = <&clk_s_c0_flexgen CLK_MMC_1>; |
280 |
++ clock-names = "mmc", "icn"; |
281 |
++ clocks = <&clk_s_c0_flexgen CLK_MMC_1>, |
282 |
++ <&clk_s_c0_flexgen CLK_RX_ICN_HVA>; |
283 |
+ resets = <&softreset STIH407_MMC1_SOFTRESET>; |
284 |
+ bus-width = <4>; |
285 |
+ }; |
286 |
+diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi |
287 |
+index 18ed1ad10d32..40318869c733 100644 |
288 |
+--- a/arch/arm/boot/dts/stih410.dtsi |
289 |
++++ b/arch/arm/boot/dts/stih410.dtsi |
290 |
+@@ -41,7 +41,8 @@ |
291 |
+ compatible = "st,st-ohci-300x"; |
292 |
+ reg = <0x9a03c00 0x100>; |
293 |
+ interrupts = <GIC_SPI 180 IRQ_TYPE_NONE>; |
294 |
+- clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; |
295 |
++ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
296 |
++ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; |
297 |
+ resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>, |
298 |
+ <&softreset STIH407_USB2_PORT0_SOFTRESET>; |
299 |
+ reset-names = "power", "softreset"; |
300 |
+@@ -57,7 +58,8 @@ |
301 |
+ interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>; |
302 |
+ pinctrl-names = "default"; |
303 |
+ pinctrl-0 = <&pinctrl_usb0>; |
304 |
+- clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; |
305 |
++ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
306 |
++ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; |
307 |
+ resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>, |
308 |
+ <&softreset STIH407_USB2_PORT0_SOFTRESET>; |
309 |
+ reset-names = "power", "softreset"; |
310 |
+@@ -71,7 +73,8 @@ |
311 |
+ compatible = "st,st-ohci-300x"; |
312 |
+ reg = <0x9a83c00 0x100>; |
313 |
+ interrupts = <GIC_SPI 181 IRQ_TYPE_NONE>; |
314 |
+- clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; |
315 |
++ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
316 |
++ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; |
317 |
+ resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>, |
318 |
+ <&softreset STIH407_USB2_PORT1_SOFTRESET>; |
319 |
+ reset-names = "power", "softreset"; |
320 |
+@@ -87,7 +90,8 @@ |
321 |
+ interrupts = <GIC_SPI 153 IRQ_TYPE_NONE>; |
322 |
+ pinctrl-names = "default"; |
323 |
+ pinctrl-0 = <&pinctrl_usb1>; |
324 |
+- clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>; |
325 |
++ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>, |
326 |
++ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>; |
327 |
+ resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>, |
328 |
+ <&softreset STIH407_USB2_PORT1_SOFTRESET>; |
329 |
+ reset-names = "power", "softreset"; |
330 |
+diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c |
331 |
+index e06fd299de08..d7bef2144760 100644 |
332 |
+--- a/arch/arm/kvm/arm.c |
333 |
++++ b/arch/arm/kvm/arm.c |
334 |
+@@ -155,8 +155,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm) |
335 |
+ { |
336 |
+ int i; |
337 |
+ |
338 |
+- kvm_free_stage2_pgd(kvm); |
339 |
+- |
340 |
+ for (i = 0; i < KVM_MAX_VCPUS; ++i) { |
341 |
+ if (kvm->vcpus[i]) { |
342 |
+ kvm_arch_vcpu_free(kvm->vcpus[i]); |
343 |
+diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c |
344 |
+index 12d727fae0a7..11b6595c2672 100644 |
345 |
+--- a/arch/arm/kvm/mmu.c |
346 |
++++ b/arch/arm/kvm/mmu.c |
347 |
+@@ -1852,6 +1852,7 @@ void kvm_arch_memslots_updated(struct kvm *kvm, struct kvm_memslots *slots) |
348 |
+ |
349 |
+ void kvm_arch_flush_shadow_all(struct kvm *kvm) |
350 |
+ { |
351 |
++ kvm_free_stage2_pgd(kvm); |
352 |
+ } |
353 |
+ |
354 |
+ void kvm_arch_flush_shadow_memslot(struct kvm *kvm, |
355 |
+diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c |
356 |
+index 4470376af5f8..a19d20f23e71 100644 |
357 |
+--- a/arch/arm/mach-imx/pm-imx6.c |
358 |
++++ b/arch/arm/mach-imx/pm-imx6.c |
359 |
+@@ -295,7 +295,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode) |
360 |
+ val &= ~BM_CLPCR_SBYOS; |
361 |
+ if (cpu_is_imx6sl()) |
362 |
+ val |= BM_CLPCR_BYPASS_PMIC_READY; |
363 |
+- if (cpu_is_imx6sl() || cpu_is_imx6sx()) |
364 |
++ if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul()) |
365 |
+ val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS; |
366 |
+ else |
367 |
+ val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS; |
368 |
+@@ -310,7 +310,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode) |
369 |
+ val |= 0x3 << BP_CLPCR_STBY_COUNT; |
370 |
+ val |= BM_CLPCR_VSTBY; |
371 |
+ val |= BM_CLPCR_SBYOS; |
372 |
+- if (cpu_is_imx6sl()) |
373 |
++ if (cpu_is_imx6sl() || cpu_is_imx6sx()) |
374 |
+ val |= BM_CLPCR_BYPASS_PMIC_READY; |
375 |
+ if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul()) |
376 |
+ val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS; |
377 |
+diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |
378 |
+index 907a452b78ea..b31ad596be79 100644 |
379 |
+--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |
380 |
++++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |
381 |
+@@ -1474,6 +1474,7 @@ static void omap_hwmod_am43xx_rst(void) |
382 |
+ { |
383 |
+ RSTCTRL(am33xx_pruss_hwmod, AM43XX_RM_PER_RSTCTRL_OFFSET); |
384 |
+ RSTCTRL(am33xx_gfx_hwmod, AM43XX_RM_GFX_RSTCTRL_OFFSET); |
385 |
++ RSTST(am33xx_pruss_hwmod, AM43XX_RM_PER_RSTST_OFFSET); |
386 |
+ RSTST(am33xx_gfx_hwmod, AM43XX_RM_GFX_RSTST_OFFSET); |
387 |
+ } |
388 |
+ |
389 |
+diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |
390 |
+index aff78d5198d2..131f8967589b 100644 |
391 |
+--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |
392 |
++++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |
393 |
+@@ -723,8 +723,20 @@ static struct omap_hwmod omap3xxx_dss_dispc_hwmod = { |
394 |
+ * display serial interface controller |
395 |
+ */ |
396 |
+ |
397 |
++static struct omap_hwmod_class_sysconfig omap3xxx_dsi_sysc = { |
398 |
++ .rev_offs = 0x0000, |
399 |
++ .sysc_offs = 0x0010, |
400 |
++ .syss_offs = 0x0014, |
401 |
++ .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | |
402 |
++ SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | |
403 |
++ SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), |
404 |
++ .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
405 |
++ .sysc_fields = &omap_hwmod_sysc_type1, |
406 |
++}; |
407 |
++ |
408 |
+ static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = { |
409 |
+ .name = "dsi", |
410 |
++ .sysc = &omap3xxx_dsi_sysc, |
411 |
+ }; |
412 |
+ |
413 |
+ static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = { |
414 |
+diff --git a/arch/arm/mach-omap2/prcm43xx.h b/arch/arm/mach-omap2/prcm43xx.h |
415 |
+index 7c34c44eb0ae..babb5db5a3a4 100644 |
416 |
+--- a/arch/arm/mach-omap2/prcm43xx.h |
417 |
++++ b/arch/arm/mach-omap2/prcm43xx.h |
418 |
+@@ -39,6 +39,7 @@ |
419 |
+ |
420 |
+ /* RM RSTST offsets */ |
421 |
+ #define AM43XX_RM_GFX_RSTST_OFFSET 0x0014 |
422 |
++#define AM43XX_RM_PER_RSTST_OFFSET 0x0014 |
423 |
+ #define AM43XX_RM_WKUP_RSTST_OFFSET 0x0014 |
424 |
+ |
425 |
+ /* CM instances */ |
426 |
+diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h |
427 |
+index c85e96d174a5..499e8de33a00 100644 |
428 |
+--- a/arch/arm64/include/asm/spinlock.h |
429 |
++++ b/arch/arm64/include/asm/spinlock.h |
430 |
+@@ -312,4 +312,14 @@ static inline int arch_read_trylock(arch_rwlock_t *rw) |
431 |
+ #define arch_read_relax(lock) cpu_relax() |
432 |
+ #define arch_write_relax(lock) cpu_relax() |
433 |
+ |
434 |
++/* |
435 |
++ * Accesses appearing in program order before a spin_lock() operation |
436 |
++ * can be reordered with accesses inside the critical section, by virtue |
437 |
++ * of arch_spin_lock being constructed using acquire semantics. |
438 |
++ * |
439 |
++ * In cases where this is problematic (e.g. try_to_wake_up), an |
440 |
++ * smp_mb__before_spinlock() can restore the required ordering. |
441 |
++ */ |
442 |
++#define smp_mb__before_spinlock() smp_mb() |
443 |
++ |
444 |
+ #endif /* __ASM_SPINLOCK_H */ |
445 |
+diff --git a/arch/avr32/include/asm/uaccess.h b/arch/avr32/include/asm/uaccess.h |
446 |
+index 68cf638faf48..b1ec1fa06463 100644 |
447 |
+--- a/arch/avr32/include/asm/uaccess.h |
448 |
++++ b/arch/avr32/include/asm/uaccess.h |
449 |
+@@ -74,7 +74,7 @@ extern __kernel_size_t __copy_user(void *to, const void *from, |
450 |
+ |
451 |
+ extern __kernel_size_t copy_to_user(void __user *to, const void *from, |
452 |
+ __kernel_size_t n); |
453 |
+-extern __kernel_size_t copy_from_user(void *to, const void __user *from, |
454 |
++extern __kernel_size_t ___copy_from_user(void *to, const void __user *from, |
455 |
+ __kernel_size_t n); |
456 |
+ |
457 |
+ static inline __kernel_size_t __copy_to_user(void __user *to, const void *from, |
458 |
+@@ -88,6 +88,15 @@ static inline __kernel_size_t __copy_from_user(void *to, |
459 |
+ { |
460 |
+ return __copy_user(to, (const void __force *)from, n); |
461 |
+ } |
462 |
++static inline __kernel_size_t copy_from_user(void *to, |
463 |
++ const void __user *from, |
464 |
++ __kernel_size_t n) |
465 |
++{ |
466 |
++ size_t res = ___copy_from_user(to, from, n); |
467 |
++ if (unlikely(res)) |
468 |
++ memset(to + (n - res), 0, res); |
469 |
++ return res; |
470 |
++} |
471 |
+ |
472 |
+ #define __copy_to_user_inatomic __copy_to_user |
473 |
+ #define __copy_from_user_inatomic __copy_from_user |
474 |
+diff --git a/arch/avr32/kernel/avr32_ksyms.c b/arch/avr32/kernel/avr32_ksyms.c |
475 |
+index d93ead02daed..7c6cf14f0985 100644 |
476 |
+--- a/arch/avr32/kernel/avr32_ksyms.c |
477 |
++++ b/arch/avr32/kernel/avr32_ksyms.c |
478 |
+@@ -36,7 +36,7 @@ EXPORT_SYMBOL(copy_page); |
479 |
+ /* |
480 |
+ * Userspace access stuff. |
481 |
+ */ |
482 |
+-EXPORT_SYMBOL(copy_from_user); |
483 |
++EXPORT_SYMBOL(___copy_from_user); |
484 |
+ EXPORT_SYMBOL(copy_to_user); |
485 |
+ EXPORT_SYMBOL(__copy_user); |
486 |
+ EXPORT_SYMBOL(strncpy_from_user); |
487 |
+diff --git a/arch/avr32/lib/copy_user.S b/arch/avr32/lib/copy_user.S |
488 |
+index ea59c04b07de..075373471da1 100644 |
489 |
+--- a/arch/avr32/lib/copy_user.S |
490 |
++++ b/arch/avr32/lib/copy_user.S |
491 |
+@@ -23,13 +23,13 @@ |
492 |
+ */ |
493 |
+ .text |
494 |
+ .align 1 |
495 |
+- .global copy_from_user |
496 |
+- .type copy_from_user, @function |
497 |
+-copy_from_user: |
498 |
++ .global ___copy_from_user |
499 |
++ .type ___copy_from_user, @function |
500 |
++___copy_from_user: |
501 |
+ branch_if_kernel r8, __copy_user |
502 |
+ ret_if_privileged r8, r11, r10, r10 |
503 |
+ rjmp __copy_user |
504 |
+- .size copy_from_user, . - copy_from_user |
505 |
++ .size ___copy_from_user, . - ___copy_from_user |
506 |
+ |
507 |
+ .global copy_to_user |
508 |
+ .type copy_to_user, @function |
509 |
+diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h |
510 |
+index 90612a7f2cf3..8cd0184ea9ef 100644 |
511 |
+--- a/arch/blackfin/include/asm/uaccess.h |
512 |
++++ b/arch/blackfin/include/asm/uaccess.h |
513 |
+@@ -177,11 +177,12 @@ static inline int bad_user_access_length(void) |
514 |
+ static inline unsigned long __must_check |
515 |
+ copy_from_user(void *to, const void __user *from, unsigned long n) |
516 |
+ { |
517 |
+- if (access_ok(VERIFY_READ, from, n)) |
518 |
++ if (likely(access_ok(VERIFY_READ, from, n))) { |
519 |
+ memcpy(to, (const void __force *)from, n); |
520 |
+- else |
521 |
+- return n; |
522 |
+- return 0; |
523 |
++ return 0; |
524 |
++ } |
525 |
++ memset(to, 0, n); |
526 |
++ return n; |
527 |
+ } |
528 |
+ |
529 |
+ static inline unsigned long __must_check |
530 |
+diff --git a/arch/cris/include/asm/uaccess.h b/arch/cris/include/asm/uaccess.h |
531 |
+index e3530d0f13ee..56c7d5750abd 100644 |
532 |
+--- a/arch/cris/include/asm/uaccess.h |
533 |
++++ b/arch/cris/include/asm/uaccess.h |
534 |
+@@ -194,30 +194,6 @@ extern unsigned long __copy_user(void __user *to, const void *from, unsigned lon |
535 |
+ extern unsigned long __copy_user_zeroing(void *to, const void __user *from, unsigned long n); |
536 |
+ extern unsigned long __do_clear_user(void __user *to, unsigned long n); |
537 |
+ |
538 |
+-static inline unsigned long |
539 |
+-__generic_copy_to_user(void __user *to, const void *from, unsigned long n) |
540 |
+-{ |
541 |
+- if (access_ok(VERIFY_WRITE, to, n)) |
542 |
+- return __copy_user(to, from, n); |
543 |
+- return n; |
544 |
+-} |
545 |
+- |
546 |
+-static inline unsigned long |
547 |
+-__generic_copy_from_user(void *to, const void __user *from, unsigned long n) |
548 |
+-{ |
549 |
+- if (access_ok(VERIFY_READ, from, n)) |
550 |
+- return __copy_user_zeroing(to, from, n); |
551 |
+- return n; |
552 |
+-} |
553 |
+- |
554 |
+-static inline unsigned long |
555 |
+-__generic_clear_user(void __user *to, unsigned long n) |
556 |
+-{ |
557 |
+- if (access_ok(VERIFY_WRITE, to, n)) |
558 |
+- return __do_clear_user(to, n); |
559 |
+- return n; |
560 |
+-} |
561 |
+- |
562 |
+ static inline long |
563 |
+ __strncpy_from_user(char *dst, const char __user *src, long count) |
564 |
+ { |
565 |
+@@ -282,7 +258,7 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n) |
566 |
+ else if (n == 24) |
567 |
+ __asm_copy_from_user_24(to, from, ret); |
568 |
+ else |
569 |
+- ret = __generic_copy_from_user(to, from, n); |
570 |
++ ret = __copy_user_zeroing(to, from, n); |
571 |
+ |
572 |
+ return ret; |
573 |
+ } |
574 |
+@@ -333,7 +309,7 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n) |
575 |
+ else if (n == 24) |
576 |
+ __asm_copy_to_user_24(to, from, ret); |
577 |
+ else |
578 |
+- ret = __generic_copy_to_user(to, from, n); |
579 |
++ ret = __copy_user(to, from, n); |
580 |
+ |
581 |
+ return ret; |
582 |
+ } |
583 |
+@@ -366,26 +342,43 @@ __constant_clear_user(void __user *to, unsigned long n) |
584 |
+ else if (n == 24) |
585 |
+ __asm_clear_24(to, ret); |
586 |
+ else |
587 |
+- ret = __generic_clear_user(to, n); |
588 |
++ ret = __do_clear_user(to, n); |
589 |
+ |
590 |
+ return ret; |
591 |
+ } |
592 |
+ |
593 |
+ |
594 |
+-#define clear_user(to, n) \ |
595 |
+- (__builtin_constant_p(n) ? \ |
596 |
+- __constant_clear_user(to, n) : \ |
597 |
+- __generic_clear_user(to, n)) |
598 |
++static inline size_t clear_user(void __user *to, size_t n) |
599 |
++{ |
600 |
++ if (unlikely(!access_ok(VERIFY_WRITE, to, n))) |
601 |
++ return n; |
602 |
++ if (__builtin_constant_p(n)) |
603 |
++ return __constant_clear_user(to, n); |
604 |
++ else |
605 |
++ return __do_clear_user(to, n); |
606 |
++} |
607 |
+ |
608 |
+-#define copy_from_user(to, from, n) \ |
609 |
+- (__builtin_constant_p(n) ? \ |
610 |
+- __constant_copy_from_user(to, from, n) : \ |
611 |
+- __generic_copy_from_user(to, from, n)) |
612 |
++static inline size_t copy_from_user(void *to, const void __user *from, size_t n) |
613 |
++{ |
614 |
++ if (unlikely(!access_ok(VERIFY_READ, from, n))) { |
615 |
++ memset(to, 0, n); |
616 |
++ return n; |
617 |
++ } |
618 |
++ if (__builtin_constant_p(n)) |
619 |
++ return __constant_copy_from_user(to, from, n); |
620 |
++ else |
621 |
++ return __copy_user_zeroing(to, from, n); |
622 |
++} |
623 |
+ |
624 |
+-#define copy_to_user(to, from, n) \ |
625 |
+- (__builtin_constant_p(n) ? \ |
626 |
+- __constant_copy_to_user(to, from, n) : \ |
627 |
+- __generic_copy_to_user(to, from, n)) |
628 |
++static inline size_t copy_to_user(void __user *to, const void *from, size_t n) |
629 |
++{ |
630 |
++ if (unlikely(!access_ok(VERIFY_WRITE, to, n))) |
631 |
++ return n; |
632 |
++ if (__builtin_constant_p(n)) |
633 |
++ return __constant_copy_to_user(to, from, n); |
634 |
++ else |
635 |
++ return __copy_user(to, from, n); |
636 |
++} |
637 |
+ |
638 |
+ /* We let the __ versions of copy_from/to_user inline, because they're often |
639 |
+ * used in fast paths and have only a small space overhead. |
640 |
+diff --git a/arch/frv/include/asm/uaccess.h b/arch/frv/include/asm/uaccess.h |
641 |
+index 3ac9a59d65d4..87d9e34c5df8 100644 |
642 |
+--- a/arch/frv/include/asm/uaccess.h |
643 |
++++ b/arch/frv/include/asm/uaccess.h |
644 |
+@@ -263,19 +263,25 @@ do { \ |
645 |
+ extern long __memset_user(void *dst, unsigned long count); |
646 |
+ extern long __memcpy_user(void *dst, const void *src, unsigned long count); |
647 |
+ |
648 |
+-#define clear_user(dst,count) __memset_user(____force(dst), (count)) |
649 |
++#define __clear_user(dst,count) __memset_user(____force(dst), (count)) |
650 |
+ #define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), ____force(from), (n)) |
651 |
+ #define __copy_to_user_inatomic(to, from, n) __memcpy_user(____force(to), (from), (n)) |
652 |
+ |
653 |
+ #else |
654 |
+ |
655 |
+-#define clear_user(dst,count) (memset(____force(dst), 0, (count)), 0) |
656 |
++#define __clear_user(dst,count) (memset(____force(dst), 0, (count)), 0) |
657 |
+ #define __copy_from_user_inatomic(to, from, n) (memcpy((to), ____force(from), (n)), 0) |
658 |
+ #define __copy_to_user_inatomic(to, from, n) (memcpy(____force(to), (from), (n)), 0) |
659 |
+ |
660 |
+ #endif |
661 |
+ |
662 |
+-#define __clear_user clear_user |
663 |
++static inline unsigned long __must_check |
664 |
++clear_user(void __user *to, unsigned long n) |
665 |
++{ |
666 |
++ if (likely(__access_ok(to, n))) |
667 |
++ n = __clear_user(to, n); |
668 |
++ return n; |
669 |
++} |
670 |
+ |
671 |
+ static inline unsigned long __must_check |
672 |
+ __copy_to_user(void __user *to, const void *from, unsigned long n) |
673 |
+diff --git a/arch/hexagon/include/asm/uaccess.h b/arch/hexagon/include/asm/uaccess.h |
674 |
+index f000a382bc7f..f61cfb28e9f2 100644 |
675 |
+--- a/arch/hexagon/include/asm/uaccess.h |
676 |
++++ b/arch/hexagon/include/asm/uaccess.h |
677 |
+@@ -103,7 +103,8 @@ static inline long hexagon_strncpy_from_user(char *dst, const char __user *src, |
678 |
+ { |
679 |
+ long res = __strnlen_user(src, n); |
680 |
+ |
681 |
+- /* return from strnlen can't be zero -- that would be rubbish. */ |
682 |
++ if (unlikely(!res)) |
683 |
++ return -EFAULT; |
684 |
+ |
685 |
+ if (res > n) { |
686 |
+ copy_from_user(dst, src, n); |
687 |
+diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h |
688 |
+index 4f3fb6ccbf21..40c2027a2bf4 100644 |
689 |
+--- a/arch/ia64/include/asm/uaccess.h |
690 |
++++ b/arch/ia64/include/asm/uaccess.h |
691 |
+@@ -263,17 +263,15 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) |
692 |
+ __cu_len; \ |
693 |
+ }) |
694 |
+ |
695 |
+-#define copy_from_user(to, from, n) \ |
696 |
+-({ \ |
697 |
+- void *__cu_to = (to); \ |
698 |
+- const void __user *__cu_from = (from); \ |
699 |
+- long __cu_len = (n); \ |
700 |
+- \ |
701 |
+- __chk_user_ptr(__cu_from); \ |
702 |
+- if (__access_ok(__cu_from, __cu_len, get_fs())) \ |
703 |
+- __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len); \ |
704 |
+- __cu_len; \ |
705 |
+-}) |
706 |
++static inline unsigned long |
707 |
++copy_from_user(void *to, const void __user *from, unsigned long n) |
708 |
++{ |
709 |
++ if (likely(__access_ok(from, n, get_fs()))) |
710 |
++ n = __copy_user((__force void __user *) to, from, n); |
711 |
++ else |
712 |
++ memset(to, 0, n); |
713 |
++ return n; |
714 |
++} |
715 |
+ |
716 |
+ #define __copy_in_user(to, from, size) __copy_user((to), (from), (size)) |
717 |
+ |
718 |
+diff --git a/arch/m32r/include/asm/uaccess.h b/arch/m32r/include/asm/uaccess.h |
719 |
+index cac7014daef3..6f8982157a75 100644 |
720 |
+--- a/arch/m32r/include/asm/uaccess.h |
721 |
++++ b/arch/m32r/include/asm/uaccess.h |
722 |
+@@ -219,7 +219,7 @@ extern int fixup_exception(struct pt_regs *regs); |
723 |
+ #define __get_user_nocheck(x, ptr, size) \ |
724 |
+ ({ \ |
725 |
+ long __gu_err = 0; \ |
726 |
+- unsigned long __gu_val; \ |
727 |
++ unsigned long __gu_val = 0; \ |
728 |
+ might_fault(); \ |
729 |
+ __get_user_size(__gu_val, (ptr), (size), __gu_err); \ |
730 |
+ (x) = (__force __typeof__(*(ptr)))__gu_val; \ |
731 |
+diff --git a/arch/metag/include/asm/uaccess.h b/arch/metag/include/asm/uaccess.h |
732 |
+index 8282cbce7e39..273e61225c27 100644 |
733 |
+--- a/arch/metag/include/asm/uaccess.h |
734 |
++++ b/arch/metag/include/asm/uaccess.h |
735 |
+@@ -204,8 +204,9 @@ extern unsigned long __must_check __copy_user_zeroing(void *to, |
736 |
+ static inline unsigned long |
737 |
+ copy_from_user(void *to, const void __user *from, unsigned long n) |
738 |
+ { |
739 |
+- if (access_ok(VERIFY_READ, from, n)) |
740 |
++ if (likely(access_ok(VERIFY_READ, from, n))) |
741 |
+ return __copy_user_zeroing(to, from, n); |
742 |
++ memset(to, 0, n); |
743 |
+ return n; |
744 |
+ } |
745 |
+ |
746 |
+diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h |
747 |
+index 331b0d35f89c..826676778094 100644 |
748 |
+--- a/arch/microblaze/include/asm/uaccess.h |
749 |
++++ b/arch/microblaze/include/asm/uaccess.h |
750 |
+@@ -227,7 +227,7 @@ extern long __user_bad(void); |
751 |
+ |
752 |
+ #define __get_user(x, ptr) \ |
753 |
+ ({ \ |
754 |
+- unsigned long __gu_val; \ |
755 |
++ unsigned long __gu_val = 0; \ |
756 |
+ /*unsigned long __gu_ptr = (unsigned long)(ptr);*/ \ |
757 |
+ long __gu_err; \ |
758 |
+ switch (sizeof(*(ptr))) { \ |
759 |
+@@ -373,10 +373,13 @@ extern long __user_bad(void); |
760 |
+ static inline long copy_from_user(void *to, |
761 |
+ const void __user *from, unsigned long n) |
762 |
+ { |
763 |
++ unsigned long res = n; |
764 |
+ might_fault(); |
765 |
+- if (access_ok(VERIFY_READ, from, n)) |
766 |
+- return __copy_from_user(to, from, n); |
767 |
+- return n; |
768 |
++ if (likely(access_ok(VERIFY_READ, from, n))) |
769 |
++ res = __copy_from_user(to, from, n); |
770 |
++ if (unlikely(res)) |
771 |
++ memset(to + (n - res), 0, res); |
772 |
++ return res; |
773 |
+ } |
774 |
+ |
775 |
+ #define __copy_to_user(to, from, n) \ |
776 |
+diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h |
777 |
+index 095ecafe6bd3..c74c32ccc647 100644 |
778 |
+--- a/arch/mips/include/asm/uaccess.h |
779 |
++++ b/arch/mips/include/asm/uaccess.h |
780 |
+@@ -14,6 +14,7 @@ |
781 |
+ #include <linux/kernel.h> |
782 |
+ #include <linux/errno.h> |
783 |
+ #include <linux/thread_info.h> |
784 |
++#include <linux/string.h> |
785 |
+ #include <asm/asm-eva.h> |
786 |
+ |
787 |
+ /* |
788 |
+@@ -1170,6 +1171,8 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n); |
789 |
+ __cu_len = __invoke_copy_from_user(__cu_to, \ |
790 |
+ __cu_from, \ |
791 |
+ __cu_len); \ |
792 |
++ } else { \ |
793 |
++ memset(__cu_to, 0, __cu_len); \ |
794 |
+ } \ |
795 |
+ } \ |
796 |
+ __cu_len; \ |
797 |
+diff --git a/arch/mips/kvm/tlb.c b/arch/mips/kvm/tlb.c |
798 |
+index 7a7ed9ca01bb..eff71c75dc27 100644 |
799 |
+--- a/arch/mips/kvm/tlb.c |
800 |
++++ b/arch/mips/kvm/tlb.c |
801 |
+@@ -152,7 +152,7 @@ static int kvm_mips_map_page(struct kvm *kvm, gfn_t gfn) |
802 |
+ srcu_idx = srcu_read_lock(&kvm->srcu); |
803 |
+ pfn = kvm_mips_gfn_to_pfn(kvm, gfn); |
804 |
+ |
805 |
+- if (kvm_mips_is_error_pfn(pfn)) { |
806 |
++ if (is_error_noslot_pfn(pfn)) { |
807 |
+ kvm_err("Couldn't get pfn for gfn %#" PRIx64 "!\n", gfn); |
808 |
+ err = -EFAULT; |
809 |
+ goto out; |
810 |
+diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h |
811 |
+index 537278746a15..4af43d9ba495 100644 |
812 |
+--- a/arch/mn10300/include/asm/uaccess.h |
813 |
++++ b/arch/mn10300/include/asm/uaccess.h |
814 |
+@@ -181,6 +181,7 @@ struct __large_struct { unsigned long buf[100]; }; |
815 |
+ "2:\n" \ |
816 |
+ " .section .fixup,\"ax\"\n" \ |
817 |
+ "3:\n\t" \ |
818 |
++ " mov 0,%1\n" \ |
819 |
+ " mov %3,%0\n" \ |
820 |
+ " jmp 2b\n" \ |
821 |
+ " .previous\n" \ |
822 |
+diff --git a/arch/mn10300/lib/usercopy.c b/arch/mn10300/lib/usercopy.c |
823 |
+index 7826e6c364e7..ce8899e5e171 100644 |
824 |
+--- a/arch/mn10300/lib/usercopy.c |
825 |
++++ b/arch/mn10300/lib/usercopy.c |
826 |
+@@ -9,7 +9,7 @@ |
827 |
+ * as published by the Free Software Foundation; either version |
828 |
+ * 2 of the Licence, or (at your option) any later version. |
829 |
+ */ |
830 |
+-#include <asm/uaccess.h> |
831 |
++#include <linux/uaccess.h> |
832 |
+ |
833 |
+ unsigned long |
834 |
+ __generic_copy_to_user(void *to, const void *from, unsigned long n) |
835 |
+@@ -24,6 +24,8 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n) |
836 |
+ { |
837 |
+ if (access_ok(VERIFY_READ, from, n)) |
838 |
+ __copy_user_zeroing(to, from, n); |
839 |
++ else |
840 |
++ memset(to, 0, n); |
841 |
+ return n; |
842 |
+ } |
843 |
+ |
844 |
+diff --git a/arch/nios2/include/asm/uaccess.h b/arch/nios2/include/asm/uaccess.h |
845 |
+index caa51ff85a3c..0ab82324c817 100644 |
846 |
+--- a/arch/nios2/include/asm/uaccess.h |
847 |
++++ b/arch/nios2/include/asm/uaccess.h |
848 |
+@@ -102,9 +102,12 @@ extern long __copy_to_user(void __user *to, const void *from, unsigned long n); |
849 |
+ static inline long copy_from_user(void *to, const void __user *from, |
850 |
+ unsigned long n) |
851 |
+ { |
852 |
+- if (!access_ok(VERIFY_READ, from, n)) |
853 |
+- return n; |
854 |
+- return __copy_from_user(to, from, n); |
855 |
++ unsigned long res = n; |
856 |
++ if (access_ok(VERIFY_READ, from, n)) |
857 |
++ res = __copy_from_user(to, from, n); |
858 |
++ if (unlikely(res)) |
859 |
++ memset(to + (n - res), 0, res); |
860 |
++ return res; |
861 |
+ } |
862 |
+ |
863 |
+ static inline long copy_to_user(void __user *to, const void *from, |
864 |
+@@ -139,7 +142,7 @@ extern long strnlen_user(const char __user *s, long n); |
865 |
+ |
866 |
+ #define __get_user_unknown(val, size, ptr, err) do { \ |
867 |
+ err = 0; \ |
868 |
+- if (copy_from_user(&(val), ptr, size)) { \ |
869 |
++ if (__copy_from_user(&(val), ptr, size)) { \ |
870 |
+ err = -EFAULT; \ |
871 |
+ } \ |
872 |
+ } while (0) |
873 |
+@@ -166,7 +169,7 @@ do { \ |
874 |
+ ({ \ |
875 |
+ long __gu_err = -EFAULT; \ |
876 |
+ const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ |
877 |
+- unsigned long __gu_val; \ |
878 |
++ unsigned long __gu_val = 0; \ |
879 |
+ __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\ |
880 |
+ (x) = (__force __typeof__(x))__gu_val; \ |
881 |
+ __gu_err; \ |
882 |
+diff --git a/arch/openrisc/include/asm/uaccess.h b/arch/openrisc/include/asm/uaccess.h |
883 |
+index a6bd07ca3d6c..5cc6b4f1b795 100644 |
884 |
+--- a/arch/openrisc/include/asm/uaccess.h |
885 |
++++ b/arch/openrisc/include/asm/uaccess.h |
886 |
+@@ -273,28 +273,20 @@ __copy_tofrom_user(void *to, const void *from, unsigned long size); |
887 |
+ static inline unsigned long |
888 |
+ copy_from_user(void *to, const void *from, unsigned long n) |
889 |
+ { |
890 |
+- unsigned long over; |
891 |
+- |
892 |
+- if (access_ok(VERIFY_READ, from, n)) |
893 |
+- return __copy_tofrom_user(to, from, n); |
894 |
+- if ((unsigned long)from < TASK_SIZE) { |
895 |
+- over = (unsigned long)from + n - TASK_SIZE; |
896 |
+- return __copy_tofrom_user(to, from, n - over) + over; |
897 |
+- } |
898 |
+- return n; |
899 |
++ unsigned long res = n; |
900 |
++ |
901 |
++ if (likely(access_ok(VERIFY_READ, from, n))) |
902 |
++ res = __copy_tofrom_user(to, from, n); |
903 |
++ if (unlikely(res)) |
904 |
++ memset(to + (n - res), 0, res); |
905 |
++ return res; |
906 |
+ } |
907 |
+ |
908 |
+ static inline unsigned long |
909 |
+ copy_to_user(void *to, const void *from, unsigned long n) |
910 |
+ { |
911 |
+- unsigned long over; |
912 |
+- |
913 |
+- if (access_ok(VERIFY_WRITE, to, n)) |
914 |
+- return __copy_tofrom_user(to, from, n); |
915 |
+- if ((unsigned long)to < TASK_SIZE) { |
916 |
+- over = (unsigned long)to + n - TASK_SIZE; |
917 |
+- return __copy_tofrom_user(to, from, n - over) + over; |
918 |
+- } |
919 |
++ if (likely(access_ok(VERIFY_WRITE, to, n))) |
920 |
++ n = __copy_tofrom_user(to, from, n); |
921 |
+ return n; |
922 |
+ } |
923 |
+ |
924 |
+@@ -303,13 +295,8 @@ extern unsigned long __clear_user(void *addr, unsigned long size); |
925 |
+ static inline __must_check unsigned long |
926 |
+ clear_user(void *addr, unsigned long size) |
927 |
+ { |
928 |
+- |
929 |
+- if (access_ok(VERIFY_WRITE, addr, size)) |
930 |
+- return __clear_user(addr, size); |
931 |
+- if ((unsigned long)addr < TASK_SIZE) { |
932 |
+- unsigned long over = (unsigned long)addr + size - TASK_SIZE; |
933 |
+- return __clear_user(addr, size - over) + over; |
934 |
+- } |
935 |
++ if (likely(access_ok(VERIFY_WRITE, addr, size))) |
936 |
++ size = __clear_user(addr, size); |
937 |
+ return size; |
938 |
+ } |
939 |
+ |
940 |
+diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h |
941 |
+index 1960b87c1c8b..4ad51465890b 100644 |
942 |
+--- a/arch/parisc/include/asm/uaccess.h |
943 |
++++ b/arch/parisc/include/asm/uaccess.h |
944 |
+@@ -10,6 +10,7 @@ |
945 |
+ #include <asm-generic/uaccess-unaligned.h> |
946 |
+ |
947 |
+ #include <linux/bug.h> |
948 |
++#include <linux/string.h> |
949 |
+ |
950 |
+ #define VERIFY_READ 0 |
951 |
+ #define VERIFY_WRITE 1 |
952 |
+@@ -245,13 +246,14 @@ static inline unsigned long __must_check copy_from_user(void *to, |
953 |
+ unsigned long n) |
954 |
+ { |
955 |
+ int sz = __compiletime_object_size(to); |
956 |
+- int ret = -EFAULT; |
957 |
++ unsigned long ret = n; |
958 |
+ |
959 |
+ if (likely(sz == -1 || !__builtin_constant_p(n) || sz >= n)) |
960 |
+ ret = __copy_from_user(to, from, n); |
961 |
+ else |
962 |
+ copy_from_user_overflow(); |
963 |
+- |
964 |
++ if (unlikely(ret)) |
965 |
++ memset(to + (n - ret), 0, ret); |
966 |
+ return ret; |
967 |
+ } |
968 |
+ |
969 |
+diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h |
970 |
+index 2a8ebae0936b..a5ffe0207c16 100644 |
971 |
+--- a/arch/powerpc/include/asm/uaccess.h |
972 |
++++ b/arch/powerpc/include/asm/uaccess.h |
973 |
+@@ -323,30 +323,17 @@ extern unsigned long __copy_tofrom_user(void __user *to, |
974 |
+ static inline unsigned long copy_from_user(void *to, |
975 |
+ const void __user *from, unsigned long n) |
976 |
+ { |
977 |
+- unsigned long over; |
978 |
+- |
979 |
+- if (access_ok(VERIFY_READ, from, n)) |
980 |
++ if (likely(access_ok(VERIFY_READ, from, n))) |
981 |
+ return __copy_tofrom_user((__force void __user *)to, from, n); |
982 |
+- if ((unsigned long)from < TASK_SIZE) { |
983 |
+- over = (unsigned long)from + n - TASK_SIZE; |
984 |
+- return __copy_tofrom_user((__force void __user *)to, from, |
985 |
+- n - over) + over; |
986 |
+- } |
987 |
++ memset(to, 0, n); |
988 |
+ return n; |
989 |
+ } |
990 |
+ |
991 |
+ static inline unsigned long copy_to_user(void __user *to, |
992 |
+ const void *from, unsigned long n) |
993 |
+ { |
994 |
+- unsigned long over; |
995 |
+- |
996 |
+ if (access_ok(VERIFY_WRITE, to, n)) |
997 |
+ return __copy_tofrom_user(to, (__force void __user *)from, n); |
998 |
+- if ((unsigned long)to < TASK_SIZE) { |
999 |
+- over = (unsigned long)to + n - TASK_SIZE; |
1000 |
+- return __copy_tofrom_user(to, (__force void __user *)from, |
1001 |
+- n - over) + over; |
1002 |
+- } |
1003 |
+ return n; |
1004 |
+ } |
1005 |
+ |
1006 |
+@@ -437,10 +424,6 @@ static inline unsigned long clear_user(void __user *addr, unsigned long size) |
1007 |
+ might_fault(); |
1008 |
+ if (likely(access_ok(VERIFY_WRITE, addr, size))) |
1009 |
+ return __clear_user(addr, size); |
1010 |
+- if ((unsigned long)addr < TASK_SIZE) { |
1011 |
+- unsigned long over = (unsigned long)addr + size - TASK_SIZE; |
1012 |
+- return __clear_user(addr, size - over) + over; |
1013 |
+- } |
1014 |
+ return size; |
1015 |
+ } |
1016 |
+ |
1017 |
+diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S |
1018 |
+index a94f155db78e..edba294620db 100644 |
1019 |
+--- a/arch/powerpc/kernel/entry_64.S |
1020 |
++++ b/arch/powerpc/kernel/entry_64.S |
1021 |
+@@ -334,13 +334,13 @@ syscall_exit_work: |
1022 |
+ tabort_syscall: |
1023 |
+ /* Firstly we need to enable TM in the kernel */ |
1024 |
+ mfmsr r10 |
1025 |
+- li r13, 1 |
1026 |
+- rldimi r10, r13, MSR_TM_LG, 63-MSR_TM_LG |
1027 |
++ li r9, 1 |
1028 |
++ rldimi r10, r9, MSR_TM_LG, 63-MSR_TM_LG |
1029 |
+ mtmsrd r10, 0 |
1030 |
+ |
1031 |
+ /* tabort, this dooms the transaction, nothing else */ |
1032 |
+- li r13, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT) |
1033 |
+- TABORT(R13) |
1034 |
++ li r9, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT) |
1035 |
++ TABORT(R9) |
1036 |
+ |
1037 |
+ /* |
1038 |
+ * Return directly to userspace. We have corrupted user register state, |
1039 |
+@@ -348,8 +348,8 @@ tabort_syscall: |
1040 |
+ * resume after the tbegin of the aborted transaction with the |
1041 |
+ * checkpointed register state. |
1042 |
+ */ |
1043 |
+- li r13, MSR_RI |
1044 |
+- andc r10, r10, r13 |
1045 |
++ li r9, MSR_RI |
1046 |
++ andc r10, r10, r9 |
1047 |
+ mtmsrd r10, 1 |
1048 |
+ mtspr SPRN_SRR0, r11 |
1049 |
+ mtspr SPRN_SRR1, r12 |
1050 |
+diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S |
1051 |
+index 736d18b3cefd..4c48b487698c 100644 |
1052 |
+--- a/arch/powerpc/mm/slb_low.S |
1053 |
++++ b/arch/powerpc/mm/slb_low.S |
1054 |
+@@ -113,7 +113,12 @@ BEGIN_FTR_SECTION |
1055 |
+ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT) |
1056 |
+ b slb_finish_load_1T |
1057 |
+ |
1058 |
+-0: |
1059 |
++0: /* |
1060 |
++ * For userspace addresses, make sure this is region 0. |
1061 |
++ */ |
1062 |
++ cmpdi r9, 0 |
1063 |
++ bne 8f |
1064 |
++ |
1065 |
+ /* when using slices, we extract the psize off the slice bitmaps |
1066 |
+ * and then we need to get the sllp encoding off the mmu_psize_defs |
1067 |
+ * array. |
1068 |
+diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c |
1069 |
+index 2ee96431f736..4c827826c05e 100644 |
1070 |
+--- a/arch/powerpc/platforms/powernv/opal-dump.c |
1071 |
++++ b/arch/powerpc/platforms/powernv/opal-dump.c |
1072 |
+@@ -370,6 +370,7 @@ static irqreturn_t process_dump(int irq, void *data) |
1073 |
+ uint32_t dump_id, dump_size, dump_type; |
1074 |
+ struct dump_obj *dump; |
1075 |
+ char name[22]; |
1076 |
++ struct kobject *kobj; |
1077 |
+ |
1078 |
+ rc = dump_read_info(&dump_id, &dump_size, &dump_type); |
1079 |
+ if (rc != OPAL_SUCCESS) |
1080 |
+@@ -381,8 +382,12 @@ static irqreturn_t process_dump(int irq, void *data) |
1081 |
+ * that gracefully and not create two conflicting |
1082 |
+ * entries. |
1083 |
+ */ |
1084 |
+- if (kset_find_obj(dump_kset, name)) |
1085 |
++ kobj = kset_find_obj(dump_kset, name); |
1086 |
++ if (kobj) { |
1087 |
++ /* Drop reference added by kset_find_obj() */ |
1088 |
++ kobject_put(kobj); |
1089 |
+ return 0; |
1090 |
++ } |
1091 |
+ |
1092 |
+ dump = create_dump_obj(dump_id, dump_size, dump_type); |
1093 |
+ if (!dump) |
1094 |
+diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c |
1095 |
+index 37f959bf392e..f2344cbd2f46 100644 |
1096 |
+--- a/arch/powerpc/platforms/powernv/opal-elog.c |
1097 |
++++ b/arch/powerpc/platforms/powernv/opal-elog.c |
1098 |
+@@ -247,6 +247,7 @@ static irqreturn_t elog_event(int irq, void *data) |
1099 |
+ uint64_t elog_type; |
1100 |
+ int rc; |
1101 |
+ char name[2+16+1]; |
1102 |
++ struct kobject *kobj; |
1103 |
+ |
1104 |
+ rc = opal_get_elog_size(&id, &size, &type); |
1105 |
+ if (rc != OPAL_SUCCESS) { |
1106 |
+@@ -269,8 +270,12 @@ static irqreturn_t elog_event(int irq, void *data) |
1107 |
+ * that gracefully and not create two conflicting |
1108 |
+ * entries. |
1109 |
+ */ |
1110 |
+- if (kset_find_obj(elog_kset, name)) |
1111 |
++ kobj = kset_find_obj(elog_kset, name); |
1112 |
++ if (kobj) { |
1113 |
++ /* Drop reference added by kset_find_obj() */ |
1114 |
++ kobject_put(kobj); |
1115 |
+ return IRQ_HANDLED; |
1116 |
++ } |
1117 |
+ |
1118 |
+ create_elog_obj(log_id, elog_size, elog_type); |
1119 |
+ |
1120 |
+diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h |
1121 |
+index 9dd4cc47ddc7..5c7381c5ad7f 100644 |
1122 |
+--- a/arch/s390/include/asm/uaccess.h |
1123 |
++++ b/arch/s390/include/asm/uaccess.h |
1124 |
+@@ -215,28 +215,28 @@ int __put_user_bad(void) __attribute__((noreturn)); |
1125 |
+ __chk_user_ptr(ptr); \ |
1126 |
+ switch (sizeof(*(ptr))) { \ |
1127 |
+ case 1: { \ |
1128 |
+- unsigned char __x; \ |
1129 |
++ unsigned char __x = 0; \ |
1130 |
+ __gu_err = __get_user_fn(&__x, ptr, \ |
1131 |
+ sizeof(*(ptr))); \ |
1132 |
+ (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
1133 |
+ break; \ |
1134 |
+ }; \ |
1135 |
+ case 2: { \ |
1136 |
+- unsigned short __x; \ |
1137 |
++ unsigned short __x = 0; \ |
1138 |
+ __gu_err = __get_user_fn(&__x, ptr, \ |
1139 |
+ sizeof(*(ptr))); \ |
1140 |
+ (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
1141 |
+ break; \ |
1142 |
+ }; \ |
1143 |
+ case 4: { \ |
1144 |
+- unsigned int __x; \ |
1145 |
++ unsigned int __x = 0; \ |
1146 |
+ __gu_err = __get_user_fn(&__x, ptr, \ |
1147 |
+ sizeof(*(ptr))); \ |
1148 |
+ (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
1149 |
+ break; \ |
1150 |
+ }; \ |
1151 |
+ case 8: { \ |
1152 |
+- unsigned long long __x; \ |
1153 |
++ unsigned long long __x = 0; \ |
1154 |
+ __gu_err = __get_user_fn(&__x, ptr, \ |
1155 |
+ sizeof(*(ptr))); \ |
1156 |
+ (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
1157 |
+diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h |
1158 |
+index 20a3591225cc..01aec8ccde83 100644 |
1159 |
+--- a/arch/score/include/asm/uaccess.h |
1160 |
++++ b/arch/score/include/asm/uaccess.h |
1161 |
+@@ -163,7 +163,7 @@ do { \ |
1162 |
+ __get_user_asm(val, "lw", ptr); \ |
1163 |
+ break; \ |
1164 |
+ case 8: \ |
1165 |
+- if ((copy_from_user((void *)&val, ptr, 8)) == 0) \ |
1166 |
++ if (__copy_from_user((void *)&val, ptr, 8) == 0) \ |
1167 |
+ __gu_err = 0; \ |
1168 |
+ else \ |
1169 |
+ __gu_err = -EFAULT; \ |
1170 |
+@@ -188,6 +188,8 @@ do { \ |
1171 |
+ \ |
1172 |
+ if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \ |
1173 |
+ __get_user_common((x), size, __gu_ptr); \ |
1174 |
++ else \ |
1175 |
++ (x) = 0; \ |
1176 |
+ \ |
1177 |
+ __gu_err; \ |
1178 |
+ }) |
1179 |
+@@ -201,6 +203,7 @@ do { \ |
1180 |
+ "2:\n" \ |
1181 |
+ ".section .fixup,\"ax\"\n" \ |
1182 |
+ "3:li %0, %4\n" \ |
1183 |
++ "li %1, 0\n" \ |
1184 |
+ "j 2b\n" \ |
1185 |
+ ".previous\n" \ |
1186 |
+ ".section __ex_table,\"a\"\n" \ |
1187 |
+@@ -298,35 +301,34 @@ extern int __copy_tofrom_user(void *to, const void *from, unsigned long len); |
1188 |
+ static inline unsigned long |
1189 |
+ copy_from_user(void *to, const void *from, unsigned long len) |
1190 |
+ { |
1191 |
+- unsigned long over; |
1192 |
++ unsigned long res = len; |
1193 |
+ |
1194 |
+- if (access_ok(VERIFY_READ, from, len)) |
1195 |
+- return __copy_tofrom_user(to, from, len); |
1196 |
++ if (likely(access_ok(VERIFY_READ, from, len))) |
1197 |
++ res = __copy_tofrom_user(to, from, len); |
1198 |
+ |
1199 |
+- if ((unsigned long)from < TASK_SIZE) { |
1200 |
+- over = (unsigned long)from + len - TASK_SIZE; |
1201 |
+- return __copy_tofrom_user(to, from, len - over) + over; |
1202 |
+- } |
1203 |
+- return len; |
1204 |
++ if (unlikely(res)) |
1205 |
++ memset(to + (len - res), 0, res); |
1206 |
++ |
1207 |
++ return res; |
1208 |
+ } |
1209 |
+ |
1210 |
+ static inline unsigned long |
1211 |
+ copy_to_user(void *to, const void *from, unsigned long len) |
1212 |
+ { |
1213 |
+- unsigned long over; |
1214 |
+- |
1215 |
+- if (access_ok(VERIFY_WRITE, to, len)) |
1216 |
+- return __copy_tofrom_user(to, from, len); |
1217 |
++ if (likely(access_ok(VERIFY_WRITE, to, len))) |
1218 |
++ len = __copy_tofrom_user(to, from, len); |
1219 |
+ |
1220 |
+- if ((unsigned long)to < TASK_SIZE) { |
1221 |
+- over = (unsigned long)to + len - TASK_SIZE; |
1222 |
+- return __copy_tofrom_user(to, from, len - over) + over; |
1223 |
+- } |
1224 |
+ return len; |
1225 |
+ } |
1226 |
+ |
1227 |
+-#define __copy_from_user(to, from, len) \ |
1228 |
+- __copy_tofrom_user((to), (from), (len)) |
1229 |
++static inline unsigned long |
1230 |
++__copy_from_user(void *to, const void *from, unsigned long len) |
1231 |
++{ |
1232 |
++ unsigned long left = __copy_tofrom_user(to, from, len); |
1233 |
++ if (unlikely(left)) |
1234 |
++ memset(to + (len - left), 0, left); |
1235 |
++ return left; |
1236 |
++} |
1237 |
+ |
1238 |
+ #define __copy_to_user(to, from, len) \ |
1239 |
+ __copy_tofrom_user((to), (from), (len)) |
1240 |
+@@ -340,17 +342,17 @@ __copy_to_user_inatomic(void *to, const void *from, unsigned long len) |
1241 |
+ static inline unsigned long |
1242 |
+ __copy_from_user_inatomic(void *to, const void *from, unsigned long len) |
1243 |
+ { |
1244 |
+- return __copy_from_user(to, from, len); |
1245 |
++ return __copy_tofrom_user(to, from, len); |
1246 |
+ } |
1247 |
+ |
1248 |
+-#define __copy_in_user(to, from, len) __copy_from_user(to, from, len) |
1249 |
++#define __copy_in_user(to, from, len) __copy_tofrom_user(to, from, len) |
1250 |
+ |
1251 |
+ static inline unsigned long |
1252 |
+ copy_in_user(void *to, const void *from, unsigned long len) |
1253 |
+ { |
1254 |
+ if (access_ok(VERIFY_READ, from, len) && |
1255 |
+ access_ok(VERFITY_WRITE, to, len)) |
1256 |
+- return copy_from_user(to, from, len); |
1257 |
++ return __copy_tofrom_user(to, from, len); |
1258 |
+ } |
1259 |
+ |
1260 |
+ /* |
1261 |
+diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h |
1262 |
+index a49635c51266..92ade79ac427 100644 |
1263 |
+--- a/arch/sh/include/asm/uaccess.h |
1264 |
++++ b/arch/sh/include/asm/uaccess.h |
1265 |
+@@ -151,7 +151,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n) |
1266 |
+ __kernel_size_t __copy_size = (__kernel_size_t) n; |
1267 |
+ |
1268 |
+ if (__copy_size && __access_ok(__copy_from, __copy_size)) |
1269 |
+- return __copy_user(to, from, __copy_size); |
1270 |
++ __copy_size = __copy_user(to, from, __copy_size); |
1271 |
++ |
1272 |
++ if (unlikely(__copy_size)) |
1273 |
++ memset(to + (n - __copy_size), 0, __copy_size); |
1274 |
+ |
1275 |
+ return __copy_size; |
1276 |
+ } |
1277 |
+diff --git a/arch/sh/include/asm/uaccess_64.h b/arch/sh/include/asm/uaccess_64.h |
1278 |
+index c01376c76b86..ca5073dd4596 100644 |
1279 |
+--- a/arch/sh/include/asm/uaccess_64.h |
1280 |
++++ b/arch/sh/include/asm/uaccess_64.h |
1281 |
+@@ -24,6 +24,7 @@ |
1282 |
+ #define __get_user_size(x,ptr,size,retval) \ |
1283 |
+ do { \ |
1284 |
+ retval = 0; \ |
1285 |
++ x = 0; \ |
1286 |
+ switch (size) { \ |
1287 |
+ case 1: \ |
1288 |
+ retval = __get_user_asm_b((void *)&x, \ |
1289 |
+diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h |
1290 |
+index 64ee103dc29d..dfb542c7cc71 100644 |
1291 |
+--- a/arch/sparc/include/asm/uaccess_32.h |
1292 |
++++ b/arch/sparc/include/asm/uaccess_32.h |
1293 |
+@@ -328,8 +328,10 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un |
1294 |
+ { |
1295 |
+ if (n && __access_ok((unsigned long) from, n)) |
1296 |
+ return __copy_user((__force void __user *) to, from, n); |
1297 |
+- else |
1298 |
++ else { |
1299 |
++ memset(to, 0, n); |
1300 |
+ return n; |
1301 |
++ } |
1302 |
+ } |
1303 |
+ |
1304 |
+ static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) |
1305 |
+diff --git a/arch/x86/configs/tiny.config b/arch/x86/configs/tiny.config |
1306 |
+index 4e2ecfa23c15..4b429df40d7a 100644 |
1307 |
+--- a/arch/x86/configs/tiny.config |
1308 |
++++ b/arch/x86/configs/tiny.config |
1309 |
+@@ -1 +1,3 @@ |
1310 |
+ CONFIG_NOHIGHMEM=y |
1311 |
++# CONFIG_HIGHMEM4G is not set |
1312 |
++# CONFIG_HIGHMEM64G is not set |
1313 |
+diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h |
1314 |
+index 09b1b0ab94b7..d42252ce9b4d 100644 |
1315 |
+--- a/arch/x86/include/asm/uaccess.h |
1316 |
++++ b/arch/x86/include/asm/uaccess.h |
1317 |
+@@ -394,7 +394,11 @@ do { \ |
1318 |
+ #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ |
1319 |
+ asm volatile("1: mov"itype" %1,%"rtype"0\n" \ |
1320 |
+ "2:\n" \ |
1321 |
+- _ASM_EXTABLE_EX(1b, 2b) \ |
1322 |
++ ".section .fixup,\"ax\"\n" \ |
1323 |
++ "3:xor"itype" %"rtype"0,%"rtype"0\n" \ |
1324 |
++ " jmp 2b\n" \ |
1325 |
++ ".previous\n" \ |
1326 |
++ _ASM_EXTABLE_EX(1b, 3b) \ |
1327 |
+ : ltype(x) : "m" (__m(addr))) |
1328 |
+ |
1329 |
+ #define __put_user_nocheck(x, ptr, size) \ |
1330 |
+diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c |
1331 |
+index a8816b325162..6cb5834062a3 100644 |
1332 |
+--- a/arch/x86/kernel/cpu/amd.c |
1333 |
++++ b/arch/x86/kernel/cpu/amd.c |
1334 |
+@@ -656,6 +656,17 @@ static void init_amd_gh(struct cpuinfo_x86 *c) |
1335 |
+ set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH); |
1336 |
+ } |
1337 |
+ |
1338 |
++#define MSR_AMD64_DE_CFG 0xC0011029 |
1339 |
++ |
1340 |
++static void init_amd_ln(struct cpuinfo_x86 *c) |
1341 |
++{ |
1342 |
++ /* |
1343 |
++ * Apply erratum 665 fix unconditionally so machines without a BIOS |
1344 |
++ * fix work. |
1345 |
++ */ |
1346 |
++ msr_set_bit(MSR_AMD64_DE_CFG, 31); |
1347 |
++} |
1348 |
++ |
1349 |
+ static void init_amd_bd(struct cpuinfo_x86 *c) |
1350 |
+ { |
1351 |
+ u64 value; |
1352 |
+@@ -713,6 +724,7 @@ static void init_amd(struct cpuinfo_x86 *c) |
1353 |
+ case 6: init_amd_k7(c); break; |
1354 |
+ case 0xf: init_amd_k8(c); break; |
1355 |
+ case 0x10: init_amd_gh(c); break; |
1356 |
++ case 0x12: init_amd_ln(c); break; |
1357 |
+ case 0x15: init_amd_bd(c); break; |
1358 |
+ } |
1359 |
+ |
1360 |
+diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c |
1361 |
+index c2130aef3f9d..f534a0e3af53 100644 |
1362 |
+--- a/arch/x86/kernel/paravirt.c |
1363 |
++++ b/arch/x86/kernel/paravirt.c |
1364 |
+@@ -55,12 +55,12 @@ asm (".pushsection .entry.text, \"ax\"\n" |
1365 |
+ ".popsection"); |
1366 |
+ |
1367 |
+ /* identity function, which can be inlined */ |
1368 |
+-u32 _paravirt_ident_32(u32 x) |
1369 |
++u32 notrace _paravirt_ident_32(u32 x) |
1370 |
+ { |
1371 |
+ return x; |
1372 |
+ } |
1373 |
+ |
1374 |
+-u64 _paravirt_ident_64(u64 x) |
1375 |
++u64 notrace _paravirt_ident_64(u64 x) |
1376 |
+ { |
1377 |
+ return x; |
1378 |
+ } |
1379 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
1380 |
+index be222666b1c2..d7cb9577fa31 100644 |
1381 |
+--- a/arch/x86/kvm/x86.c |
1382 |
++++ b/arch/x86/kvm/x86.c |
1383 |
+@@ -2735,7 +2735,6 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) |
1384 |
+ } |
1385 |
+ |
1386 |
+ kvm_make_request(KVM_REQ_STEAL_UPDATE, vcpu); |
1387 |
+- vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD; |
1388 |
+ } |
1389 |
+ |
1390 |
+ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) |
1391 |
+diff --git a/crypto/cryptd.c b/crypto/cryptd.c |
1392 |
+index c81861b1350b..e7aa904cb20b 100644 |
1393 |
+--- a/crypto/cryptd.c |
1394 |
++++ b/crypto/cryptd.c |
1395 |
+@@ -594,9 +594,14 @@ static int cryptd_hash_export(struct ahash_request *req, void *out) |
1396 |
+ |
1397 |
+ static int cryptd_hash_import(struct ahash_request *req, const void *in) |
1398 |
+ { |
1399 |
+- struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); |
1400 |
++ struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); |
1401 |
++ struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); |
1402 |
++ struct shash_desc *desc = cryptd_shash_desc(req); |
1403 |
++ |
1404 |
++ desc->tfm = ctx->child; |
1405 |
++ desc->flags = req->base.flags; |
1406 |
+ |
1407 |
+- return crypto_shash_import(&rctx->desc, in); |
1408 |
++ return crypto_shash_import(desc, in); |
1409 |
+ } |
1410 |
+ |
1411 |
+ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, |
1412 |
+diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c |
1413 |
+index 7082c7268845..0f54cb7ddcbb 100644 |
1414 |
+--- a/drivers/bus/arm-ccn.c |
1415 |
++++ b/drivers/bus/arm-ccn.c |
1416 |
+@@ -187,6 +187,7 @@ struct arm_ccn { |
1417 |
+ struct arm_ccn_component *xp; |
1418 |
+ |
1419 |
+ struct arm_ccn_dt dt; |
1420 |
++ int mn_id; |
1421 |
+ }; |
1422 |
+ |
1423 |
+ |
1424 |
+@@ -326,6 +327,7 @@ struct arm_ccn_pmu_event { |
1425 |
+ static ssize_t arm_ccn_pmu_event_show(struct device *dev, |
1426 |
+ struct device_attribute *attr, char *buf) |
1427 |
+ { |
1428 |
++ struct arm_ccn *ccn = pmu_to_arm_ccn(dev_get_drvdata(dev)); |
1429 |
+ struct arm_ccn_pmu_event *event = container_of(attr, |
1430 |
+ struct arm_ccn_pmu_event, attr); |
1431 |
+ ssize_t res; |
1432 |
+@@ -352,6 +354,9 @@ static ssize_t arm_ccn_pmu_event_show(struct device *dev, |
1433 |
+ res += snprintf(buf + res, PAGE_SIZE - res, |
1434 |
+ ",cmp_l=?,cmp_h=?,mask=?"); |
1435 |
+ break; |
1436 |
++ case CCN_TYPE_MN: |
1437 |
++ res += snprintf(buf + res, PAGE_SIZE - res, ",node=%d", ccn->mn_id); |
1438 |
++ break; |
1439 |
+ default: |
1440 |
+ res += snprintf(buf + res, PAGE_SIZE - res, ",node=?"); |
1441 |
+ break; |
1442 |
+@@ -381,9 +386,9 @@ static umode_t arm_ccn_pmu_events_is_visible(struct kobject *kobj, |
1443 |
+ } |
1444 |
+ |
1445 |
+ static struct arm_ccn_pmu_event arm_ccn_pmu_events[] = { |
1446 |
+- CCN_EVENT_MN(eobarrier, "dir=0,vc=0,cmp_h=0x1c00", CCN_IDX_MASK_OPCODE), |
1447 |
+- CCN_EVENT_MN(ecbarrier, "dir=0,vc=0,cmp_h=0x1e00", CCN_IDX_MASK_OPCODE), |
1448 |
+- CCN_EVENT_MN(dvmop, "dir=0,vc=0,cmp_h=0x2800", CCN_IDX_MASK_OPCODE), |
1449 |
++ CCN_EVENT_MN(eobarrier, "dir=1,vc=0,cmp_h=0x1c00", CCN_IDX_MASK_OPCODE), |
1450 |
++ CCN_EVENT_MN(ecbarrier, "dir=1,vc=0,cmp_h=0x1e00", CCN_IDX_MASK_OPCODE), |
1451 |
++ CCN_EVENT_MN(dvmop, "dir=1,vc=0,cmp_h=0x2800", CCN_IDX_MASK_OPCODE), |
1452 |
+ CCN_EVENT_HNI(txdatflits, "dir=1,vc=3", CCN_IDX_MASK_ANY), |
1453 |
+ CCN_EVENT_HNI(rxdatflits, "dir=0,vc=3", CCN_IDX_MASK_ANY), |
1454 |
+ CCN_EVENT_HNI(txreqflits, "dir=1,vc=0", CCN_IDX_MASK_ANY), |
1455 |
+@@ -757,6 +762,12 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) |
1456 |
+ |
1457 |
+ /* Validate node/xp vs topology */ |
1458 |
+ switch (type) { |
1459 |
++ case CCN_TYPE_MN: |
1460 |
++ if (node_xp != ccn->mn_id) { |
1461 |
++ dev_warn(ccn->dev, "Invalid MN ID %d!\n", node_xp); |
1462 |
++ return -EINVAL; |
1463 |
++ } |
1464 |
++ break; |
1465 |
+ case CCN_TYPE_XP: |
1466 |
+ if (node_xp >= ccn->num_xps) { |
1467 |
+ dev_warn(ccn->dev, "Invalid XP ID %d!\n", node_xp); |
1468 |
+@@ -884,6 +895,10 @@ static void arm_ccn_pmu_xp_dt_config(struct perf_event *event, int enable) |
1469 |
+ struct arm_ccn_component *xp; |
1470 |
+ u32 val, dt_cfg; |
1471 |
+ |
1472 |
++ /* Nothing to do for cycle counter */ |
1473 |
++ if (hw->idx == CCN_IDX_PMU_CYCLE_COUNTER) |
1474 |
++ return; |
1475 |
++ |
1476 |
+ if (CCN_CONFIG_TYPE(event->attr.config) == CCN_TYPE_XP) |
1477 |
+ xp = &ccn->xp[CCN_CONFIG_XP(event->attr.config)]; |
1478 |
+ else |
1479 |
+@@ -986,7 +1001,7 @@ static void arm_ccn_pmu_xp_watchpoint_config(struct perf_event *event) |
1480 |
+ |
1481 |
+ /* Comparison values */ |
1482 |
+ writel(cmp_l & 0xffffffff, source->base + CCN_XP_DT_CMP_VAL_L(wp)); |
1483 |
+- writel((cmp_l >> 32) & 0xefffffff, |
1484 |
++ writel((cmp_l >> 32) & 0x7fffffff, |
1485 |
+ source->base + CCN_XP_DT_CMP_VAL_L(wp) + 4); |
1486 |
+ writel(cmp_h & 0xffffffff, source->base + CCN_XP_DT_CMP_VAL_H(wp)); |
1487 |
+ writel((cmp_h >> 32) & 0x0fffffff, |
1488 |
+@@ -994,7 +1009,7 @@ static void arm_ccn_pmu_xp_watchpoint_config(struct perf_event *event) |
1489 |
+ |
1490 |
+ /* Mask */ |
1491 |
+ writel(mask_l & 0xffffffff, source->base + CCN_XP_DT_CMP_MASK_L(wp)); |
1492 |
+- writel((mask_l >> 32) & 0xefffffff, |
1493 |
++ writel((mask_l >> 32) & 0x7fffffff, |
1494 |
+ source->base + CCN_XP_DT_CMP_MASK_L(wp) + 4); |
1495 |
+ writel(mask_h & 0xffffffff, source->base + CCN_XP_DT_CMP_MASK_H(wp)); |
1496 |
+ writel((mask_h >> 32) & 0x0fffffff, |
1497 |
+@@ -1368,6 +1383,8 @@ static int arm_ccn_init_nodes(struct arm_ccn *ccn, int region, |
1498 |
+ |
1499 |
+ switch (type) { |
1500 |
+ case CCN_TYPE_MN: |
1501 |
++ ccn->mn_id = id; |
1502 |
++ return 0; |
1503 |
+ case CCN_TYPE_DT: |
1504 |
+ return 0; |
1505 |
+ case CCN_TYPE_XP: |
1506 |
+diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c |
1507 |
+index 6f3719d73390..e84877a2cacc 100644 |
1508 |
+--- a/drivers/clocksource/sun4i_timer.c |
1509 |
++++ b/drivers/clocksource/sun4i_timer.c |
1510 |
+@@ -123,12 +123,16 @@ static struct clock_event_device sun4i_clockevent = { |
1511 |
+ .set_next_event = sun4i_clkevt_next_event, |
1512 |
+ }; |
1513 |
+ |
1514 |
++static void sun4i_timer_clear_interrupt(void) |
1515 |
++{ |
1516 |
++ writel(TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_ST_REG); |
1517 |
++} |
1518 |
+ |
1519 |
+ static irqreturn_t sun4i_timer_interrupt(int irq, void *dev_id) |
1520 |
+ { |
1521 |
+ struct clock_event_device *evt = (struct clock_event_device *)dev_id; |
1522 |
+ |
1523 |
+- writel(0x1, timer_base + TIMER_IRQ_ST_REG); |
1524 |
++ sun4i_timer_clear_interrupt(); |
1525 |
+ evt->event_handler(evt); |
1526 |
+ |
1527 |
+ return IRQ_HANDLED; |
1528 |
+@@ -193,6 +197,9 @@ static void __init sun4i_timer_init(struct device_node *node) |
1529 |
+ /* Make sure timer is stopped before playing with interrupts */ |
1530 |
+ sun4i_clkevt_time_stop(0); |
1531 |
+ |
1532 |
++ /* clear timer0 interrupt */ |
1533 |
++ sun4i_timer_clear_interrupt(); |
1534 |
++ |
1535 |
+ sun4i_clockevent.cpumask = cpu_possible_mask; |
1536 |
+ sun4i_clockevent.irq = irq; |
1537 |
+ |
1538 |
+diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |
1539 |
+index 59d1269626b1..e231176cb66b 100644 |
1540 |
+--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |
1541 |
++++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |
1542 |
+@@ -316,19 +316,19 @@ atmel_hlcdc_plane_update_pos_and_size(struct atmel_hlcdc_plane *plane, |
1543 |
+ u32 *coeff_tab = heo_upscaling_ycoef; |
1544 |
+ u32 max_memsize; |
1545 |
+ |
1546 |
+- if (state->crtc_w < state->src_w) |
1547 |
++ if (state->crtc_h < state->src_h) |
1548 |
+ coeff_tab = heo_downscaling_ycoef; |
1549 |
+ for (i = 0; i < ARRAY_SIZE(heo_upscaling_ycoef); i++) |
1550 |
+ atmel_hlcdc_layer_update_cfg(&plane->layer, |
1551 |
+ 33 + i, |
1552 |
+ 0xffffffff, |
1553 |
+ coeff_tab[i]); |
1554 |
+- factor = ((8 * 256 * state->src_w) - (256 * 4)) / |
1555 |
+- state->crtc_w; |
1556 |
++ factor = ((8 * 256 * state->src_h) - (256 * 4)) / |
1557 |
++ state->crtc_h; |
1558 |
+ factor++; |
1559 |
+- max_memsize = ((factor * state->crtc_w) + (256 * 4)) / |
1560 |
++ max_memsize = ((factor * state->crtc_h) + (256 * 4)) / |
1561 |
+ 2048; |
1562 |
+- if (max_memsize > state->src_w) |
1563 |
++ if (max_memsize > state->src_h) |
1564 |
+ factor--; |
1565 |
+ factor_reg |= (factor << 16) | 0x80000000; |
1566 |
+ } |
1567 |
+diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c |
1568 |
+index 57676f8d7ecf..a6289752be16 100644 |
1569 |
+--- a/drivers/gpu/drm/drm_ioc32.c |
1570 |
++++ b/drivers/gpu/drm/drm_ioc32.c |
1571 |
+@@ -1015,6 +1015,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, |
1572 |
+ return 0; |
1573 |
+ } |
1574 |
+ |
1575 |
++#if defined(CONFIG_X86) || defined(CONFIG_IA64) |
1576 |
+ typedef struct drm_mode_fb_cmd232 { |
1577 |
+ u32 fb_id; |
1578 |
+ u32 width; |
1579 |
+@@ -1071,6 +1072,7 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd, |
1580 |
+ |
1581 |
+ return 0; |
1582 |
+ } |
1583 |
++#endif |
1584 |
+ |
1585 |
+ static drm_ioctl_compat_t *drm_compat_ioctls[] = { |
1586 |
+ [DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version, |
1587 |
+@@ -1104,7 +1106,9 @@ static drm_ioctl_compat_t *drm_compat_ioctls[] = { |
1588 |
+ [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw, |
1589 |
+ #endif |
1590 |
+ [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank, |
1591 |
++#if defined(CONFIG_X86) || defined(CONFIG_IA64) |
1592 |
+ [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2, |
1593 |
++#endif |
1594 |
+ }; |
1595 |
+ |
1596 |
+ /** |
1597 |
+diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c |
1598 |
+index 17cea400ae32..d3de377dc857 100644 |
1599 |
+--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c |
1600 |
++++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c |
1601 |
+@@ -220,7 +220,7 @@ i2c_dp_aux_prepare_bus(struct i2c_adapter *adapter) |
1602 |
+ * FIXME: This is the old dp aux helper, gma500 is the last driver that needs to |
1603 |
+ * be ported over to the new helper code in drm_dp_helper.c like i915 or radeon. |
1604 |
+ */ |
1605 |
+-static int __deprecated |
1606 |
++static int |
1607 |
+ i2c_dp_aux_add_bus(struct i2c_adapter *adapter) |
1608 |
+ { |
1609 |
+ int error; |
1610 |
+diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c |
1611 |
+index a3254c3bcc7c..909d1d71d130 100644 |
1612 |
+--- a/drivers/gpu/drm/i915/intel_display.c |
1613 |
++++ b/drivers/gpu/drm/i915/intel_display.c |
1614 |
+@@ -2950,13 +2950,13 @@ u32 intel_fb_stride_alignment(struct drm_device *dev, uint64_t fb_modifier, |
1615 |
+ } |
1616 |
+ } |
1617 |
+ |
1618 |
+-unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane, |
1619 |
+- struct drm_i915_gem_object *obj, |
1620 |
+- unsigned int plane) |
1621 |
++u32 intel_plane_obj_offset(struct intel_plane *intel_plane, |
1622 |
++ struct drm_i915_gem_object *obj, |
1623 |
++ unsigned int plane) |
1624 |
+ { |
1625 |
+ const struct i915_ggtt_view *view = &i915_ggtt_view_normal; |
1626 |
+ struct i915_vma *vma; |
1627 |
+- unsigned char *offset; |
1628 |
++ u64 offset; |
1629 |
+ |
1630 |
+ if (intel_rotation_90_or_270(intel_plane->base.state->rotation)) |
1631 |
+ view = &i915_ggtt_view_rotated; |
1632 |
+@@ -2966,14 +2966,16 @@ unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane, |
1633 |
+ view->type)) |
1634 |
+ return -1; |
1635 |
+ |
1636 |
+- offset = (unsigned char *)vma->node.start; |
1637 |
++ offset = vma->node.start; |
1638 |
+ |
1639 |
+ if (plane == 1) { |
1640 |
+ offset += vma->ggtt_view.rotation_info.uv_start_page * |
1641 |
+ PAGE_SIZE; |
1642 |
+ } |
1643 |
+ |
1644 |
+- return (unsigned long)offset; |
1645 |
++ WARN_ON(upper_32_bits(offset)); |
1646 |
++ |
1647 |
++ return lower_32_bits(offset); |
1648 |
+ } |
1649 |
+ |
1650 |
+ static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id) |
1651 |
+@@ -3099,7 +3101,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, |
1652 |
+ u32 tile_height, plane_offset, plane_size; |
1653 |
+ unsigned int rotation; |
1654 |
+ int x_offset, y_offset; |
1655 |
+- unsigned long surf_addr; |
1656 |
++ u32 surf_addr; |
1657 |
+ struct intel_crtc_state *crtc_state = intel_crtc->config; |
1658 |
+ struct intel_plane_state *plane_state; |
1659 |
+ int src_x = 0, src_y = 0, src_w = 0, src_h = 0; |
1660 |
+diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h |
1661 |
+index 67f72a7ee7cb..41442e619595 100644 |
1662 |
+--- a/drivers/gpu/drm/i915/intel_drv.h |
1663 |
++++ b/drivers/gpu/drm/i915/intel_drv.h |
1664 |
+@@ -1177,9 +1177,9 @@ void intel_modeset_preclose(struct drm_device *dev, struct drm_file *file); |
1665 |
+ int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state); |
1666 |
+ int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state); |
1667 |
+ |
1668 |
+-unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane, |
1669 |
+- struct drm_i915_gem_object *obj, |
1670 |
+- unsigned int plane); |
1671 |
++u32 intel_plane_obj_offset(struct intel_plane *intel_plane, |
1672 |
++ struct drm_i915_gem_object *obj, |
1673 |
++ unsigned int plane); |
1674 |
+ |
1675 |
+ u32 skl_plane_ctl_format(uint32_t pixel_format); |
1676 |
+ u32 skl_plane_ctl_tiling(uint64_t fb_modifier); |
1677 |
+diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c |
1678 |
+index 56dc132e8e20..2cc6aa072f4c 100644 |
1679 |
+--- a/drivers/gpu/drm/i915/intel_sprite.c |
1680 |
++++ b/drivers/gpu/drm/i915/intel_sprite.c |
1681 |
+@@ -195,7 +195,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc, |
1682 |
+ int pixel_size = drm_format_plane_cpp(fb->pixel_format, 0); |
1683 |
+ const struct drm_intel_sprite_colorkey *key = |
1684 |
+ &to_intel_plane_state(drm_plane->state)->ckey; |
1685 |
+- unsigned long surf_addr; |
1686 |
++ u32 surf_addr; |
1687 |
+ u32 tile_height, plane_offset, plane_size; |
1688 |
+ unsigned int rotation; |
1689 |
+ int x_offset, y_offset; |
1690 |
+diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c |
1691 |
+index 291c61a41c9a..fa24d5196615 100644 |
1692 |
+--- a/drivers/iio/accel/bmc150-accel-core.c |
1693 |
++++ b/drivers/iio/accel/bmc150-accel-core.c |
1694 |
+@@ -68,6 +68,9 @@ |
1695 |
+ #define BMC150_ACCEL_REG_PMU_BW 0x10 |
1696 |
+ #define BMC150_ACCEL_DEF_BW 125 |
1697 |
+ |
1698 |
++#define BMC150_ACCEL_REG_RESET 0x14 |
1699 |
++#define BMC150_ACCEL_RESET_VAL 0xB6 |
1700 |
++ |
1701 |
+ #define BMC150_ACCEL_REG_INT_MAP_0 0x19 |
1702 |
+ #define BMC150_ACCEL_INT_MAP_0_BIT_SLOPE BIT(2) |
1703 |
+ |
1704 |
+@@ -1487,6 +1490,14 @@ static int bmc150_accel_chip_init(struct bmc150_accel_data *data) |
1705 |
+ int ret, i; |
1706 |
+ unsigned int val; |
1707 |
+ |
1708 |
++ /* |
1709 |
++ * Reset chip to get it in a known good state. A delay of 1.8ms after |
1710 |
++ * reset is required according to the data sheets of supported chips. |
1711 |
++ */ |
1712 |
++ regmap_write(data->regmap, BMC150_ACCEL_REG_RESET, |
1713 |
++ BMC150_ACCEL_RESET_VAL); |
1714 |
++ usleep_range(1800, 2500); |
1715 |
++ |
1716 |
+ ret = regmap_read(data->regmap, BMC150_ACCEL_REG_CHIP_ID, &val); |
1717 |
+ if (ret < 0) { |
1718 |
+ dev_err(data->dev, |
1719 |
+diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c |
1720 |
+index 3a9f106787d2..9d72d4bcf5e9 100644 |
1721 |
+--- a/drivers/iio/accel/kxsd9.c |
1722 |
++++ b/drivers/iio/accel/kxsd9.c |
1723 |
+@@ -160,11 +160,13 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev, |
1724 |
+ if (ret < 0) |
1725 |
+ goto error_ret; |
1726 |
+ *val = ret; |
1727 |
++ ret = IIO_VAL_INT; |
1728 |
+ break; |
1729 |
+ case IIO_CHAN_INFO_SCALE: |
1730 |
+ ret = spi_w8r8(st->us, KXSD9_READ(KXSD9_REG_CTRL_C)); |
1731 |
+ if (ret < 0) |
1732 |
+ goto error_ret; |
1733 |
++ *val = 0; |
1734 |
+ *val2 = kxsd9_micro_scales[ret & KXSD9_FS_MASK]; |
1735 |
+ ret = IIO_VAL_INT_PLUS_MICRO; |
1736 |
+ break; |
1737 |
+diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig |
1738 |
+index 1e7aded53117..bda6bbe4479c 100644 |
1739 |
+--- a/drivers/iio/adc/Kconfig |
1740 |
++++ b/drivers/iio/adc/Kconfig |
1741 |
+@@ -306,6 +306,7 @@ config QCOM_SPMI_VADC |
1742 |
+ config ROCKCHIP_SARADC |
1743 |
+ tristate "Rockchip SARADC driver" |
1744 |
+ depends on ARCH_ROCKCHIP || (ARM && COMPILE_TEST) |
1745 |
++ depends on RESET_CONTROLLER |
1746 |
+ help |
1747 |
+ Say yes here to build support for the SARADC found in SoCs from |
1748 |
+ Rockchip. |
1749 |
+diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c |
1750 |
+index 01d71588d752..ba82de25a797 100644 |
1751 |
+--- a/drivers/iio/adc/ad799x.c |
1752 |
++++ b/drivers/iio/adc/ad799x.c |
1753 |
+@@ -533,6 +533,7 @@ static struct attribute_group ad799x_event_attrs_group = { |
1754 |
+ static const struct iio_info ad7991_info = { |
1755 |
+ .read_raw = &ad799x_read_raw, |
1756 |
+ .driver_module = THIS_MODULE, |
1757 |
++ .update_scan_mode = ad799x_update_scan_mode, |
1758 |
+ }; |
1759 |
+ |
1760 |
+ static const struct iio_info ad7993_4_7_8_noirq_info = { |
1761 |
+diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c |
1762 |
+index 7b40925dd4ff..93986f0590ef 100644 |
1763 |
+--- a/drivers/iio/adc/at91_adc.c |
1764 |
++++ b/drivers/iio/adc/at91_adc.c |
1765 |
+@@ -381,8 +381,8 @@ static irqreturn_t at91_adc_rl_interrupt(int irq, void *private) |
1766 |
+ st->ts_bufferedmeasure = false; |
1767 |
+ input_report_key(st->ts_input, BTN_TOUCH, 0); |
1768 |
+ input_sync(st->ts_input); |
1769 |
+- } else if (status & AT91_ADC_EOC(3)) { |
1770 |
+- /* Conversion finished */ |
1771 |
++ } else if (status & AT91_ADC_EOC(3) && st->ts_input) { |
1772 |
++ /* Conversion finished and we've a touchscreen */ |
1773 |
+ if (st->ts_bufferedmeasure) { |
1774 |
+ /* |
1775 |
+ * Last measurement is always discarded, since it can |
1776 |
+diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c |
1777 |
+index 9c311c1e1ac7..dffff64b5989 100644 |
1778 |
+--- a/drivers/iio/adc/rockchip_saradc.c |
1779 |
++++ b/drivers/iio/adc/rockchip_saradc.c |
1780 |
+@@ -21,6 +21,8 @@ |
1781 |
+ #include <linux/of_device.h> |
1782 |
+ #include <linux/clk.h> |
1783 |
+ #include <linux/completion.h> |
1784 |
++#include <linux/delay.h> |
1785 |
++#include <linux/reset.h> |
1786 |
+ #include <linux/regulator/consumer.h> |
1787 |
+ #include <linux/iio/iio.h> |
1788 |
+ |
1789 |
+@@ -53,6 +55,7 @@ struct rockchip_saradc { |
1790 |
+ struct clk *clk; |
1791 |
+ struct completion completion; |
1792 |
+ struct regulator *vref; |
1793 |
++ struct reset_control *reset; |
1794 |
+ const struct rockchip_saradc_data *data; |
1795 |
+ u16 last_val; |
1796 |
+ }; |
1797 |
+@@ -171,6 +174,16 @@ static const struct of_device_id rockchip_saradc_match[] = { |
1798 |
+ }; |
1799 |
+ MODULE_DEVICE_TABLE(of, rockchip_saradc_match); |
1800 |
+ |
1801 |
++/** |
1802 |
++ * Reset SARADC Controller. |
1803 |
++ */ |
1804 |
++static void rockchip_saradc_reset_controller(struct reset_control *reset) |
1805 |
++{ |
1806 |
++ reset_control_assert(reset); |
1807 |
++ usleep_range(10, 20); |
1808 |
++ reset_control_deassert(reset); |
1809 |
++} |
1810 |
++ |
1811 |
+ static int rockchip_saradc_probe(struct platform_device *pdev) |
1812 |
+ { |
1813 |
+ struct rockchip_saradc *info = NULL; |
1814 |
+@@ -199,6 +212,20 @@ static int rockchip_saradc_probe(struct platform_device *pdev) |
1815 |
+ if (IS_ERR(info->regs)) |
1816 |
+ return PTR_ERR(info->regs); |
1817 |
+ |
1818 |
++ /* |
1819 |
++ * The reset should be an optional property, as it should work |
1820 |
++ * with old devicetrees as well |
1821 |
++ */ |
1822 |
++ info->reset = devm_reset_control_get(&pdev->dev, "saradc-apb"); |
1823 |
++ if (IS_ERR(info->reset)) { |
1824 |
++ ret = PTR_ERR(info->reset); |
1825 |
++ if (ret != -ENOENT) |
1826 |
++ return ret; |
1827 |
++ |
1828 |
++ dev_dbg(&pdev->dev, "no reset control found\n"); |
1829 |
++ info->reset = NULL; |
1830 |
++ } |
1831 |
++ |
1832 |
+ init_completion(&info->completion); |
1833 |
+ |
1834 |
+ irq = platform_get_irq(pdev, 0); |
1835 |
+@@ -233,6 +260,9 @@ static int rockchip_saradc_probe(struct platform_device *pdev) |
1836 |
+ return PTR_ERR(info->vref); |
1837 |
+ } |
1838 |
+ |
1839 |
++ if (info->reset) |
1840 |
++ rockchip_saradc_reset_controller(info->reset); |
1841 |
++ |
1842 |
+ /* |
1843 |
+ * Use a default value for the converter clock. |
1844 |
+ * This may become user-configurable in the future. |
1845 |
+diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c |
1846 |
+index c1e05532d437..0470fc843d4e 100644 |
1847 |
+--- a/drivers/iio/adc/ti_am335x_adc.c |
1848 |
++++ b/drivers/iio/adc/ti_am335x_adc.c |
1849 |
+@@ -32,6 +32,7 @@ |
1850 |
+ |
1851 |
+ struct tiadc_device { |
1852 |
+ struct ti_tscadc_dev *mfd_tscadc; |
1853 |
++ struct mutex fifo1_lock; /* to protect fifo access */ |
1854 |
+ int channels; |
1855 |
+ u8 channel_line[8]; |
1856 |
+ u8 channel_step[8]; |
1857 |
+@@ -360,6 +361,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, |
1858 |
+ int *val, int *val2, long mask) |
1859 |
+ { |
1860 |
+ struct tiadc_device *adc_dev = iio_priv(indio_dev); |
1861 |
++ int ret = IIO_VAL_INT; |
1862 |
+ int i, map_val; |
1863 |
+ unsigned int fifo1count, read, stepid; |
1864 |
+ bool found = false; |
1865 |
+@@ -373,13 +375,14 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, |
1866 |
+ if (!step_en) |
1867 |
+ return -EINVAL; |
1868 |
+ |
1869 |
++ mutex_lock(&adc_dev->fifo1_lock); |
1870 |
+ fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT); |
1871 |
+ while (fifo1count--) |
1872 |
+ tiadc_readl(adc_dev, REG_FIFO1); |
1873 |
+ |
1874 |
+ am335x_tsc_se_set_once(adc_dev->mfd_tscadc, step_en); |
1875 |
+ |
1876 |
+- timeout = jiffies + usecs_to_jiffies |
1877 |
++ timeout = jiffies + msecs_to_jiffies |
1878 |
+ (IDLE_TIMEOUT * adc_dev->channels); |
1879 |
+ /* Wait for Fifo threshold interrupt */ |
1880 |
+ while (1) { |
1881 |
+@@ -389,7 +392,8 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, |
1882 |
+ |
1883 |
+ if (time_after(jiffies, timeout)) { |
1884 |
+ am335x_tsc_se_adc_done(adc_dev->mfd_tscadc); |
1885 |
+- return -EAGAIN; |
1886 |
++ ret = -EAGAIN; |
1887 |
++ goto err_unlock; |
1888 |
+ } |
1889 |
+ } |
1890 |
+ map_val = adc_dev->channel_step[chan->scan_index]; |
1891 |
+@@ -415,8 +419,11 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, |
1892 |
+ am335x_tsc_se_adc_done(adc_dev->mfd_tscadc); |
1893 |
+ |
1894 |
+ if (found == false) |
1895 |
+- return -EBUSY; |
1896 |
+- return IIO_VAL_INT; |
1897 |
++ ret = -EBUSY; |
1898 |
++ |
1899 |
++err_unlock: |
1900 |
++ mutex_unlock(&adc_dev->fifo1_lock); |
1901 |
++ return ret; |
1902 |
+ } |
1903 |
+ |
1904 |
+ static const struct iio_info tiadc_info = { |
1905 |
+@@ -485,6 +492,7 @@ static int tiadc_probe(struct platform_device *pdev) |
1906 |
+ |
1907 |
+ tiadc_step_config(indio_dev); |
1908 |
+ tiadc_writel(adc_dev, REG_FIFO1THR, FIFO1_THRESHOLD); |
1909 |
++ mutex_init(&adc_dev->fifo1_lock); |
1910 |
+ |
1911 |
+ err = tiadc_channel_init(indio_dev, adc_dev->channels); |
1912 |
+ if (err < 0) |
1913 |
+diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c |
1914 |
+index e81f434760f4..dc33c1dd5191 100644 |
1915 |
+--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c |
1916 |
++++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c |
1917 |
+@@ -56,8 +56,8 @@ static struct { |
1918 |
+ {HID_USAGE_SENSOR_ALS, 0, 1, 0}, |
1919 |
+ {HID_USAGE_SENSOR_ALS, HID_USAGE_SENSOR_UNITS_LUX, 1, 0}, |
1920 |
+ |
1921 |
+- {HID_USAGE_SENSOR_PRESSURE, 0, 100000, 0}, |
1922 |
+- {HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 1, 0}, |
1923 |
++ {HID_USAGE_SENSOR_PRESSURE, 0, 100, 0}, |
1924 |
++ {HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 0, 1000}, |
1925 |
+ }; |
1926 |
+ |
1927 |
+ static int pow_10(unsigned power) |
1928 |
+diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c |
1929 |
+index 7afd226a3321..32bb036069eb 100644 |
1930 |
+--- a/drivers/iio/industrialio-buffer.c |
1931 |
++++ b/drivers/iio/industrialio-buffer.c |
1932 |
+@@ -110,7 +110,7 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf, |
1933 |
+ DEFINE_WAIT_FUNC(wait, woken_wake_function); |
1934 |
+ size_t datum_size; |
1935 |
+ size_t to_wait; |
1936 |
+- int ret; |
1937 |
++ int ret = 0; |
1938 |
+ |
1939 |
+ if (!indio_dev->info) |
1940 |
+ return -ENODEV; |
1941 |
+@@ -153,7 +153,7 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf, |
1942 |
+ ret = rb->access->read_first_n(rb, n, buf); |
1943 |
+ if (ret == 0 && (filp->f_flags & O_NONBLOCK)) |
1944 |
+ ret = -EAGAIN; |
1945 |
+- } while (ret == 0); |
1946 |
++ } while (ret == 0); |
1947 |
+ remove_wait_queue(&rb->pollq, &wait); |
1948 |
+ |
1949 |
+ return ret; |
1950 |
+diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c |
1951 |
+index 159ede61f793..7ede941e9301 100644 |
1952 |
+--- a/drivers/iio/industrialio-core.c |
1953 |
++++ b/drivers/iio/industrialio-core.c |
1954 |
+@@ -447,9 +447,8 @@ ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals) |
1955 |
+ return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); |
1956 |
+ case IIO_VAL_FRACTIONAL: |
1957 |
+ tmp = div_s64((s64)vals[0] * 1000000000LL, vals[1]); |
1958 |
+- vals[1] = do_div(tmp, 1000000000LL); |
1959 |
+- vals[0] = tmp; |
1960 |
+- return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); |
1961 |
++ vals[0] = (int)div_s64_rem(tmp, 1000000000, &vals[1]); |
1962 |
++ return sprintf(buf, "%d.%09u\n", vals[0], abs(vals[1])); |
1963 |
+ case IIO_VAL_FRACTIONAL_LOG2: |
1964 |
+ tmp = (s64)vals[0] * 1000000000LL >> vals[1]; |
1965 |
+ vals[1] = do_div(tmp, 1000000000LL); |
1966 |
+diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c |
1967 |
+index e2f926cdcad2..a0aedda7dfd7 100644 |
1968 |
+--- a/drivers/iio/proximity/as3935.c |
1969 |
++++ b/drivers/iio/proximity/as3935.c |
1970 |
+@@ -392,7 +392,7 @@ static int as3935_probe(struct spi_device *spi) |
1971 |
+ return ret; |
1972 |
+ } |
1973 |
+ |
1974 |
+- ret = iio_triggered_buffer_setup(indio_dev, NULL, |
1975 |
++ ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time, |
1976 |
+ &as3935_trigger_handler, NULL); |
1977 |
+ |
1978 |
+ if (ret) { |
1979 |
+diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h |
1980 |
+index 94bbd8c155fc..a2d19d136099 100644 |
1981 |
+--- a/drivers/infiniband/core/uverbs.h |
1982 |
++++ b/drivers/infiniband/core/uverbs.h |
1983 |
+@@ -116,6 +116,7 @@ struct ib_uverbs_event_file { |
1984 |
+ struct ib_uverbs_file { |
1985 |
+ struct kref ref; |
1986 |
+ struct mutex mutex; |
1987 |
++ struct mutex cleanup_mutex; /* protect cleanup */ |
1988 |
+ struct ib_uverbs_device *device; |
1989 |
+ struct ib_ucontext *ucontext; |
1990 |
+ struct ib_event_handler event_handler; |
1991 |
+diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c |
1992 |
+index 24f3ca2c4ad7..d625c82d6c82 100644 |
1993 |
+--- a/drivers/infiniband/core/uverbs_main.c |
1994 |
++++ b/drivers/infiniband/core/uverbs_main.c |
1995 |
+@@ -922,6 +922,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp) |
1996 |
+ file->async_file = NULL; |
1997 |
+ kref_init(&file->ref); |
1998 |
+ mutex_init(&file->mutex); |
1999 |
++ mutex_init(&file->cleanup_mutex); |
2000 |
+ |
2001 |
+ filp->private_data = file; |
2002 |
+ kobject_get(&dev->kobj); |
2003 |
+@@ -947,18 +948,20 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp) |
2004 |
+ { |
2005 |
+ struct ib_uverbs_file *file = filp->private_data; |
2006 |
+ struct ib_uverbs_device *dev = file->device; |
2007 |
+- struct ib_ucontext *ucontext = NULL; |
2008 |
++ |
2009 |
++ mutex_lock(&file->cleanup_mutex); |
2010 |
++ if (file->ucontext) { |
2011 |
++ ib_uverbs_cleanup_ucontext(file, file->ucontext); |
2012 |
++ file->ucontext = NULL; |
2013 |
++ } |
2014 |
++ mutex_unlock(&file->cleanup_mutex); |
2015 |
+ |
2016 |
+ mutex_lock(&file->device->lists_mutex); |
2017 |
+- ucontext = file->ucontext; |
2018 |
+- file->ucontext = NULL; |
2019 |
+ if (!file->is_closed) { |
2020 |
+ list_del(&file->list); |
2021 |
+ file->is_closed = 1; |
2022 |
+ } |
2023 |
+ mutex_unlock(&file->device->lists_mutex); |
2024 |
+- if (ucontext) |
2025 |
+- ib_uverbs_cleanup_ucontext(file, ucontext); |
2026 |
+ |
2027 |
+ if (file->async_file) |
2028 |
+ kref_put(&file->async_file->ref, ib_uverbs_release_event_file); |
2029 |
+@@ -1172,22 +1175,30 @@ static void ib_uverbs_free_hw_resources(struct ib_uverbs_device *uverbs_dev, |
2030 |
+ mutex_lock(&uverbs_dev->lists_mutex); |
2031 |
+ while (!list_empty(&uverbs_dev->uverbs_file_list)) { |
2032 |
+ struct ib_ucontext *ucontext; |
2033 |
+- |
2034 |
+ file = list_first_entry(&uverbs_dev->uverbs_file_list, |
2035 |
+ struct ib_uverbs_file, list); |
2036 |
+ file->is_closed = 1; |
2037 |
+- ucontext = file->ucontext; |
2038 |
+ list_del(&file->list); |
2039 |
+- file->ucontext = NULL; |
2040 |
+ kref_get(&file->ref); |
2041 |
+ mutex_unlock(&uverbs_dev->lists_mutex); |
2042 |
+- /* We must release the mutex before going ahead and calling |
2043 |
+- * disassociate_ucontext. disassociate_ucontext might end up |
2044 |
+- * indirectly calling uverbs_close, for example due to freeing |
2045 |
+- * the resources (e.g mmput). |
2046 |
+- */ |
2047 |
++ |
2048 |
+ ib_uverbs_event_handler(&file->event_handler, &event); |
2049 |
++ |
2050 |
++ mutex_lock(&file->cleanup_mutex); |
2051 |
++ ucontext = file->ucontext; |
2052 |
++ file->ucontext = NULL; |
2053 |
++ mutex_unlock(&file->cleanup_mutex); |
2054 |
++ |
2055 |
++ /* At this point ib_uverbs_close cannot be running |
2056 |
++ * ib_uverbs_cleanup_ucontext |
2057 |
++ */ |
2058 |
+ if (ucontext) { |
2059 |
++ /* We must release the mutex before going ahead and |
2060 |
++ * calling disassociate_ucontext. disassociate_ucontext |
2061 |
++ * might end up indirectly calling uverbs_close, |
2062 |
++ * for example due to freeing the resources |
2063 |
++ * (e.g mmput). |
2064 |
++ */ |
2065 |
+ ib_dev->disassociate_ucontext(ucontext); |
2066 |
+ ib_uverbs_cleanup_ucontext(file, ucontext); |
2067 |
+ } |
2068 |
+diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c |
2069 |
+index 8a0c7f288198..981c3959da59 100644 |
2070 |
+--- a/drivers/irqchip/irq-atmel-aic.c |
2071 |
++++ b/drivers/irqchip/irq-atmel-aic.c |
2072 |
+@@ -176,6 +176,7 @@ static int aic_irq_domain_xlate(struct irq_domain *d, |
2073 |
+ { |
2074 |
+ struct irq_domain_chip_generic *dgc = d->gc; |
2075 |
+ struct irq_chip_generic *gc; |
2076 |
++ unsigned long flags; |
2077 |
+ unsigned smr; |
2078 |
+ int idx; |
2079 |
+ int ret; |
2080 |
+@@ -194,12 +195,12 @@ static int aic_irq_domain_xlate(struct irq_domain *d, |
2081 |
+ |
2082 |
+ gc = dgc->gc[idx]; |
2083 |
+ |
2084 |
+- irq_gc_lock(gc); |
2085 |
++ irq_gc_lock_irqsave(gc, flags); |
2086 |
+ smr = irq_reg_readl(gc, AT91_AIC_SMR(*out_hwirq)); |
2087 |
+ ret = aic_common_set_priority(intspec[2], &smr); |
2088 |
+ if (!ret) |
2089 |
+ irq_reg_writel(gc, smr, AT91_AIC_SMR(*out_hwirq)); |
2090 |
+- irq_gc_unlock(gc); |
2091 |
++ irq_gc_unlock_irqrestore(gc, flags); |
2092 |
+ |
2093 |
+ return ret; |
2094 |
+ } |
2095 |
+diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c |
2096 |
+index 62bb840c613f..7dee71bde350 100644 |
2097 |
+--- a/drivers/irqchip/irq-atmel-aic5.c |
2098 |
++++ b/drivers/irqchip/irq-atmel-aic5.c |
2099 |
+@@ -258,6 +258,7 @@ static int aic5_irq_domain_xlate(struct irq_domain *d, |
2100 |
+ unsigned int *out_type) |
2101 |
+ { |
2102 |
+ struct irq_chip_generic *bgc = irq_get_domain_generic_chip(d, 0); |
2103 |
++ unsigned long flags; |
2104 |
+ unsigned smr; |
2105 |
+ int ret; |
2106 |
+ |
2107 |
+@@ -269,13 +270,13 @@ static int aic5_irq_domain_xlate(struct irq_domain *d, |
2108 |
+ if (ret) |
2109 |
+ return ret; |
2110 |
+ |
2111 |
+- irq_gc_lock(bgc); |
2112 |
++ irq_gc_lock_irqsave(bgc, flags); |
2113 |
+ irq_reg_writel(bgc, *out_hwirq, AT91_AIC5_SSR); |
2114 |
+ smr = irq_reg_readl(bgc, AT91_AIC5_SMR); |
2115 |
+ ret = aic_common_set_priority(intspec[2], &smr); |
2116 |
+ if (!ret) |
2117 |
+ irq_reg_writel(bgc, intspec[2] | smr, AT91_AIC5_SMR); |
2118 |
+- irq_gc_unlock(bgc); |
2119 |
++ irq_gc_unlock_irqrestore(bgc, flags); |
2120 |
+ |
2121 |
+ return ret; |
2122 |
+ } |
2123 |
+diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c |
2124 |
+index a9859489acf6..596347f345db 100644 |
2125 |
+--- a/drivers/lightnvm/rrpc.c |
2126 |
++++ b/drivers/lightnvm/rrpc.c |
2127 |
+@@ -287,8 +287,10 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk) |
2128 |
+ } |
2129 |
+ |
2130 |
+ page = mempool_alloc(rrpc->page_pool, GFP_NOIO); |
2131 |
+- if (!page) |
2132 |
++ if (!page) { |
2133 |
++ bio_put(bio); |
2134 |
+ return -ENOMEM; |
2135 |
++ } |
2136 |
+ |
2137 |
+ while ((slot = find_first_zero_bit(rblk->invalid_pages, |
2138 |
+ nr_pgs_per_blk)) < nr_pgs_per_blk) { |
2139 |
+diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c |
2140 |
+index 3147c8d09ea8..51eda7235e32 100644 |
2141 |
+--- a/drivers/md/dm-crypt.c |
2142 |
++++ b/drivers/md/dm-crypt.c |
2143 |
+@@ -1920,6 +1920,13 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) |
2144 |
+ return DM_MAPIO_REMAPPED; |
2145 |
+ } |
2146 |
+ |
2147 |
++ /* |
2148 |
++ * Check if bio is too large, split as needed. |
2149 |
++ */ |
2150 |
++ if (unlikely(bio->bi_iter.bi_size > (BIO_MAX_PAGES << PAGE_SHIFT)) && |
2151 |
++ bio_data_dir(bio) == WRITE) |
2152 |
++ dm_accept_partial_bio(bio, ((BIO_MAX_PAGES << PAGE_SHIFT) >> SECTOR_SHIFT)); |
2153 |
++ |
2154 |
+ io = dm_per_bio_data(bio, cc->per_bio_data_size); |
2155 |
+ crypt_io_init(io, cc, bio, dm_target_offset(ti, bio->bi_iter.bi_sector)); |
2156 |
+ io->ctx.req = (struct ablkcipher_request *)(io + 1); |
2157 |
+diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c |
2158 |
+index cd0a93df4cb7..8e9e928dafba 100644 |
2159 |
+--- a/drivers/md/dm-flakey.c |
2160 |
++++ b/drivers/md/dm-flakey.c |
2161 |
+@@ -289,15 +289,13 @@ static int flakey_map(struct dm_target *ti, struct bio *bio) |
2162 |
+ pb->bio_submitted = true; |
2163 |
+ |
2164 |
+ /* |
2165 |
+- * Map reads as normal only if corrupt_bio_byte set. |
2166 |
++ * Error reads if neither corrupt_bio_byte or drop_writes are set. |
2167 |
++ * Otherwise, flakey_end_io() will decide if the reads should be modified. |
2168 |
+ */ |
2169 |
+ if (bio_data_dir(bio) == READ) { |
2170 |
+- /* If flags were specified, only corrupt those that match. */ |
2171 |
+- if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) && |
2172 |
+- all_corrupt_bio_flags_match(bio, fc)) |
2173 |
+- goto map_bio; |
2174 |
+- else |
2175 |
++ if (!fc->corrupt_bio_byte && !test_bit(DROP_WRITES, &fc->flags)) |
2176 |
+ return -EIO; |
2177 |
++ goto map_bio; |
2178 |
+ } |
2179 |
+ |
2180 |
+ /* |
2181 |
+@@ -334,14 +332,21 @@ static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error) |
2182 |
+ struct flakey_c *fc = ti->private; |
2183 |
+ struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data)); |
2184 |
+ |
2185 |
+- /* |
2186 |
+- * Corrupt successful READs while in down state. |
2187 |
+- */ |
2188 |
+ if (!error && pb->bio_submitted && (bio_data_dir(bio) == READ)) { |
2189 |
+- if (fc->corrupt_bio_byte) |
2190 |
++ if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) && |
2191 |
++ all_corrupt_bio_flags_match(bio, fc)) { |
2192 |
++ /* |
2193 |
++ * Corrupt successful matching READs while in down state. |
2194 |
++ */ |
2195 |
+ corrupt_bio_data(bio, fc); |
2196 |
+- else |
2197 |
++ |
2198 |
++ } else if (!test_bit(DROP_WRITES, &fc->flags)) { |
2199 |
++ /* |
2200 |
++ * Error read during the down_interval if drop_writes |
2201 |
++ * wasn't configured. |
2202 |
++ */ |
2203 |
+ return -EIO; |
2204 |
++ } |
2205 |
+ } |
2206 |
+ |
2207 |
+ return error; |
2208 |
+diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c |
2209 |
+index 624589d51c2c..d8956b4a7b09 100644 |
2210 |
+--- a/drivers/md/dm-log-writes.c |
2211 |
++++ b/drivers/md/dm-log-writes.c |
2212 |
+@@ -258,12 +258,12 @@ static int log_one_block(struct log_writes_c *lc, |
2213 |
+ goto out; |
2214 |
+ sector++; |
2215 |
+ |
2216 |
++ atomic_inc(&lc->io_blocks); |
2217 |
+ bio = bio_alloc(GFP_KERNEL, block->vec_cnt); |
2218 |
+ if (!bio) { |
2219 |
+ DMERR("Couldn't alloc log bio"); |
2220 |
+ goto error; |
2221 |
+ } |
2222 |
+- atomic_inc(&lc->io_blocks); |
2223 |
+ bio->bi_iter.bi_size = 0; |
2224 |
+ bio->bi_iter.bi_sector = sector; |
2225 |
+ bio->bi_bdev = lc->logdev->bdev; |
2226 |
+@@ -456,9 +456,9 @@ static int log_writes_ctr(struct dm_target *ti, unsigned int argc, char **argv) |
2227 |
+ goto bad; |
2228 |
+ } |
2229 |
+ |
2230 |
+- ret = -EINVAL; |
2231 |
+ lc->log_kthread = kthread_run(log_writes_kthread, lc, "log-write"); |
2232 |
+- if (!lc->log_kthread) { |
2233 |
++ if (IS_ERR(lc->log_kthread)) { |
2234 |
++ ret = PTR_ERR(lc->log_kthread); |
2235 |
+ ti->error = "Couldn't alloc kthread"; |
2236 |
+ dm_put_device(ti, lc->dev); |
2237 |
+ dm_put_device(ti, lc->logdev); |
2238 |
+diff --git a/drivers/md/md.c b/drivers/md/md.c |
2239 |
+index c57fdf847b47..c1c7d4fb4b77 100644 |
2240 |
+--- a/drivers/md/md.c |
2241 |
++++ b/drivers/md/md.c |
2242 |
+@@ -7572,16 +7572,12 @@ EXPORT_SYMBOL(unregister_md_cluster_operations); |
2243 |
+ |
2244 |
+ int md_setup_cluster(struct mddev *mddev, int nodes) |
2245 |
+ { |
2246 |
+- int err; |
2247 |
+- |
2248 |
+- err = request_module("md-cluster"); |
2249 |
+- if (err) { |
2250 |
+- pr_err("md-cluster module not found.\n"); |
2251 |
+- return -ENOENT; |
2252 |
+- } |
2253 |
+- |
2254 |
++ if (!md_cluster_ops) |
2255 |
++ request_module("md-cluster"); |
2256 |
+ spin_lock(&pers_lock); |
2257 |
++ /* ensure module won't be unloaded */ |
2258 |
+ if (!md_cluster_ops || !try_module_get(md_cluster_mod)) { |
2259 |
++ pr_err("can't find md-cluster module or get it's reference.\n"); |
2260 |
+ spin_unlock(&pers_lock); |
2261 |
+ return -ENOENT; |
2262 |
+ } |
2263 |
+diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c |
2264 |
+index 7e1d13b68b06..81bdeeb05a4d 100644 |
2265 |
+--- a/drivers/mmc/host/dw_mmc-pltfm.c |
2266 |
++++ b/drivers/mmc/host/dw_mmc-pltfm.c |
2267 |
+@@ -60,7 +60,7 @@ int dw_mci_pltfm_register(struct platform_device *pdev, |
2268 |
+ |
2269 |
+ regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2270 |
+ /* Get registers' physical base address */ |
2271 |
+- host->phy_regs = (void *)(regs->start); |
2272 |
++ host->phy_regs = regs->start; |
2273 |
+ host->regs = devm_ioremap_resource(&pdev->dev, regs); |
2274 |
+ if (IS_ERR(host->regs)) |
2275 |
+ return PTR_ERR(host->regs); |
2276 |
+diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c |
2277 |
+index 7a6cedbe48a8..fb204ee6ff89 100644 |
2278 |
+--- a/drivers/mmc/host/dw_mmc.c |
2279 |
++++ b/drivers/mmc/host/dw_mmc.c |
2280 |
+@@ -699,7 +699,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host, |
2281 |
+ int ret = 0; |
2282 |
+ |
2283 |
+ /* Set external dma config: burst size, burst width */ |
2284 |
+- cfg.dst_addr = (dma_addr_t)(host->phy_regs + fifo_offset); |
2285 |
++ cfg.dst_addr = host->phy_regs + fifo_offset; |
2286 |
+ cfg.src_addr = cfg.dst_addr; |
2287 |
+ cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; |
2288 |
+ cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; |
2289 |
+diff --git a/drivers/net/ethernet/cavium/thunder/nic_reg.h b/drivers/net/ethernet/cavium/thunder/nic_reg.h |
2290 |
+index afb10e326b4f..fab35a593898 100644 |
2291 |
+--- a/drivers/net/ethernet/cavium/thunder/nic_reg.h |
2292 |
++++ b/drivers/net/ethernet/cavium/thunder/nic_reg.h |
2293 |
+@@ -170,7 +170,6 @@ |
2294 |
+ #define NIC_QSET_SQ_0_7_DOOR (0x010838) |
2295 |
+ #define NIC_QSET_SQ_0_7_STATUS (0x010840) |
2296 |
+ #define NIC_QSET_SQ_0_7_DEBUG (0x010848) |
2297 |
+-#define NIC_QSET_SQ_0_7_CNM_CHG (0x010860) |
2298 |
+ #define NIC_QSET_SQ_0_7_STAT_0_1 (0x010900) |
2299 |
+ |
2300 |
+ #define NIC_QSET_RBDR_0_1_CFG (0x010C00) |
2301 |
+diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c |
2302 |
+index a12b2e38cf61..ff1d777f3ed9 100644 |
2303 |
+--- a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c |
2304 |
++++ b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c |
2305 |
+@@ -380,7 +380,10 @@ static void nicvf_get_regs(struct net_device *dev, |
2306 |
+ p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DOOR, q); |
2307 |
+ p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STATUS, q); |
2308 |
+ p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DEBUG, q); |
2309 |
+- p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_CNM_CHG, q); |
2310 |
++ /* Padding, was NIC_QSET_SQ_0_7_CNM_CHG, which |
2311 |
++ * produces bus errors when read |
2312 |
++ */ |
2313 |
++ p[i++] = 0; |
2314 |
+ p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STAT_0_1, q); |
2315 |
+ reg_offset = NIC_QSET_SQ_0_7_STAT_0_1 | (1 << 3); |
2316 |
+ p[i++] = nicvf_queue_reg_read(nic, reg_offset, q); |
2317 |
+diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c |
2318 |
+index d184e682e636..8c5d2cf9c979 100644 |
2319 |
+--- a/drivers/net/wireless/ath/ath9k/main.c |
2320 |
++++ b/drivers/net/wireless/ath/ath9k/main.c |
2321 |
+@@ -1550,13 +1550,13 @@ static int ath9k_sta_state(struct ieee80211_hw *hw, |
2322 |
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
2323 |
+ int ret = 0; |
2324 |
+ |
2325 |
+- if (old_state == IEEE80211_STA_AUTH && |
2326 |
+- new_state == IEEE80211_STA_ASSOC) { |
2327 |
++ if (old_state == IEEE80211_STA_NOTEXIST && |
2328 |
++ new_state == IEEE80211_STA_NONE) { |
2329 |
+ ret = ath9k_sta_add(hw, vif, sta); |
2330 |
+ ath_dbg(common, CONFIG, |
2331 |
+ "Add station: %pM\n", sta->addr); |
2332 |
+- } else if (old_state == IEEE80211_STA_ASSOC && |
2333 |
+- new_state == IEEE80211_STA_AUTH) { |
2334 |
++ } else if (old_state == IEEE80211_STA_NONE && |
2335 |
++ new_state == IEEE80211_STA_NOTEXIST) { |
2336 |
+ ret = ath9k_sta_remove(hw, vif, sta); |
2337 |
+ ath_dbg(common, CONFIG, |
2338 |
+ "Remove station: %pM\n", sta->addr); |
2339 |
+diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c |
2340 |
+index b3235fd2950c..271cca63e9bd 100644 |
2341 |
+--- a/drivers/pinctrl/pinctrl-at91-pio4.c |
2342 |
++++ b/drivers/pinctrl/pinctrl-at91-pio4.c |
2343 |
+@@ -1002,7 +1002,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) |
2344 |
+ atmel_pioctrl->irqs[i] = res->start; |
2345 |
+ irq_set_chained_handler(res->start, atmel_gpio_irq_handler); |
2346 |
+ irq_set_handler_data(res->start, atmel_pioctrl); |
2347 |
+- dev_dbg(dev, "bank %i: hwirq=%u\n", i, res->start); |
2348 |
++ dev_dbg(dev, "bank %i: irq=%pr\n", i, res); |
2349 |
+ } |
2350 |
+ |
2351 |
+ atmel_pioctrl->irq_domain = irq_domain_add_linear(dev->of_node, |
2352 |
+diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c |
2353 |
+index 6b1a47f8c096..98a459b1c095 100644 |
2354 |
+--- a/drivers/pinctrl/pinctrl-pistachio.c |
2355 |
++++ b/drivers/pinctrl/pinctrl-pistachio.c |
2356 |
+@@ -809,17 +809,17 @@ static const struct pistachio_pin_group pistachio_groups[] = { |
2357 |
+ PADS_FUNCTION_SELECT2, 12, 0x3), |
2358 |
+ MFIO_MUX_PIN_GROUP(83, MIPS_PLL_LOCK, MIPS_TRACE_DATA, USB_DEBUG, |
2359 |
+ PADS_FUNCTION_SELECT2, 14, 0x3), |
2360 |
+- MFIO_MUX_PIN_GROUP(84, SYS_PLL_LOCK, MIPS_TRACE_DATA, USB_DEBUG, |
2361 |
++ MFIO_MUX_PIN_GROUP(84, AUDIO_PLL_LOCK, MIPS_TRACE_DATA, USB_DEBUG, |
2362 |
+ PADS_FUNCTION_SELECT2, 16, 0x3), |
2363 |
+- MFIO_MUX_PIN_GROUP(85, WIFI_PLL_LOCK, MIPS_TRACE_DATA, SDHOST_DEBUG, |
2364 |
++ MFIO_MUX_PIN_GROUP(85, RPU_V_PLL_LOCK, MIPS_TRACE_DATA, SDHOST_DEBUG, |
2365 |
+ PADS_FUNCTION_SELECT2, 18, 0x3), |
2366 |
+- MFIO_MUX_PIN_GROUP(86, BT_PLL_LOCK, MIPS_TRACE_DATA, SDHOST_DEBUG, |
2367 |
++ MFIO_MUX_PIN_GROUP(86, RPU_L_PLL_LOCK, MIPS_TRACE_DATA, SDHOST_DEBUG, |
2368 |
+ PADS_FUNCTION_SELECT2, 20, 0x3), |
2369 |
+- MFIO_MUX_PIN_GROUP(87, RPU_V_PLL_LOCK, DREQ2, SOCIF_DEBUG, |
2370 |
++ MFIO_MUX_PIN_GROUP(87, SYS_PLL_LOCK, DREQ2, SOCIF_DEBUG, |
2371 |
+ PADS_FUNCTION_SELECT2, 22, 0x3), |
2372 |
+- MFIO_MUX_PIN_GROUP(88, RPU_L_PLL_LOCK, DREQ3, SOCIF_DEBUG, |
2373 |
++ MFIO_MUX_PIN_GROUP(88, WIFI_PLL_LOCK, DREQ3, SOCIF_DEBUG, |
2374 |
+ PADS_FUNCTION_SELECT2, 24, 0x3), |
2375 |
+- MFIO_MUX_PIN_GROUP(89, AUDIO_PLL_LOCK, DREQ4, DREQ5, |
2376 |
++ MFIO_MUX_PIN_GROUP(89, BT_PLL_LOCK, DREQ4, DREQ5, |
2377 |
+ PADS_FUNCTION_SELECT2, 26, 0x3), |
2378 |
+ PIN_GROUP(TCK, "tck"), |
2379 |
+ PIN_GROUP(TRSTN, "trstn"), |
2380 |
+diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c |
2381 |
+index 55083d278bb1..51fbf85301be 100644 |
2382 |
+--- a/drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c |
2383 |
++++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c |
2384 |
+@@ -485,12 +485,12 @@ static const struct sunxi_desc_pin sun8i_a23_pins[] = { |
2385 |
+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8), |
2386 |
+ SUNXI_FUNCTION(0x0, "gpio_in"), |
2387 |
+ SUNXI_FUNCTION(0x1, "gpio_out"), |
2388 |
+- SUNXI_FUNCTION(0x2, "uart2"), /* RTS */ |
2389 |
++ SUNXI_FUNCTION(0x2, "uart1"), /* RTS */ |
2390 |
+ SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 8)), /* PG_EINT8 */ |
2391 |
+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9), |
2392 |
+ SUNXI_FUNCTION(0x0, "gpio_in"), |
2393 |
+ SUNXI_FUNCTION(0x1, "gpio_out"), |
2394 |
+- SUNXI_FUNCTION(0x2, "uart2"), /* CTS */ |
2395 |
++ SUNXI_FUNCTION(0x2, "uart1"), /* CTS */ |
2396 |
+ SUNXI_FUNCTION_IRQ_BANK(0x4, 2, 9)), /* PG_EINT9 */ |
2397 |
+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10), |
2398 |
+ SUNXI_FUNCTION(0x0, "gpio_in"), |
2399 |
+diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c |
2400 |
+index 8b381d69df86..584cdedea7a4 100644 |
2401 |
+--- a/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c |
2402 |
++++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c |
2403 |
+@@ -407,12 +407,12 @@ static const struct sunxi_desc_pin sun8i_a33_pins[] = { |
2404 |
+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8), |
2405 |
+ SUNXI_FUNCTION(0x0, "gpio_in"), |
2406 |
+ SUNXI_FUNCTION(0x1, "gpio_out"), |
2407 |
+- SUNXI_FUNCTION(0x2, "uart2"), /* RTS */ |
2408 |
++ SUNXI_FUNCTION(0x2, "uart1"), /* RTS */ |
2409 |
+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 8)), /* PG_EINT8 */ |
2410 |
+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9), |
2411 |
+ SUNXI_FUNCTION(0x0, "gpio_in"), |
2412 |
+ SUNXI_FUNCTION(0x1, "gpio_out"), |
2413 |
+- SUNXI_FUNCTION(0x2, "uart2"), /* CTS */ |
2414 |
++ SUNXI_FUNCTION(0x2, "uart1"), /* CTS */ |
2415 |
+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 9)), /* PG_EINT9 */ |
2416 |
+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10), |
2417 |
+ SUNXI_FUNCTION(0x0, "gpio_in"), |
2418 |
+diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c |
2419 |
+index b04b05a0904e..65bce1eecaf8 100644 |
2420 |
+--- a/drivers/soc/qcom/spm.c |
2421 |
++++ b/drivers/soc/qcom/spm.c |
2422 |
+@@ -288,7 +288,7 @@ static struct spm_driver_data *spm_get_drv(struct platform_device *pdev, |
2423 |
+ struct spm_driver_data *drv = NULL; |
2424 |
+ struct device_node *cpu_node, *saw_node; |
2425 |
+ int cpu; |
2426 |
+- bool found; |
2427 |
++ bool found = 0; |
2428 |
+ |
2429 |
+ for_each_possible_cpu(cpu) { |
2430 |
+ cpu_node = of_cpu_device_node_get(cpu); |
2431 |
+diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c |
2432 |
+index ed489880e62b..83b3988eb6b2 100644 |
2433 |
+--- a/drivers/tty/serial/8250/8250_mid.c |
2434 |
++++ b/drivers/tty/serial/8250/8250_mid.c |
2435 |
+@@ -149,6 +149,9 @@ static void mid8250_set_termios(struct uart_port *p, |
2436 |
+ unsigned long w = BIT(24) - 1; |
2437 |
+ unsigned long mul, div; |
2438 |
+ |
2439 |
++ /* Gracefully handle the B0 case: fall back to B9600 */ |
2440 |
++ fuart = fuart ? fuart : 9600 * 16; |
2441 |
++ |
2442 |
+ if (mid->board->freq < fuart) { |
2443 |
+ /* Find prescaler value that satisfies Fuart < Fref */ |
2444 |
+ if (mid->board->freq > baud) |
2445 |
+diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c |
2446 |
+index c1d4a8fa9be8..029de3f99752 100644 |
2447 |
+--- a/drivers/tty/serial/8250/8250_pci.c |
2448 |
++++ b/drivers/tty/serial/8250/8250_pci.c |
2449 |
+@@ -1952,6 +1952,43 @@ pci_wch_ch38x_setup(struct serial_private *priv, |
2450 |
+ #define PCI_DEVICE_ID_PERICOM_PI7C9X7954 0x7954 |
2451 |
+ #define PCI_DEVICE_ID_PERICOM_PI7C9X7958 0x7958 |
2452 |
+ |
2453 |
++#define PCI_VENDOR_ID_ACCESIO 0x494f |
2454 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB 0x1051 |
2455 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S 0x1053 |
2456 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB 0x105C |
2457 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4S 0x105E |
2458 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_2DB 0x1091 |
2459 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_2 0x1093 |
2460 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB 0x1099 |
2461 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_4 0x109B |
2462 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SMDB 0x10D1 |
2463 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2SM 0x10D3 |
2464 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB 0x10DA |
2465 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4SM 0x10DC |
2466 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_1 0x1108 |
2467 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_2 0x1110 |
2468 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_2 0x1111 |
2469 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4 0x1118 |
2470 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_4 0x1119 |
2471 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2S 0x1152 |
2472 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4S 0x115A |
2473 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_2 0x1190 |
2474 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_2 0x1191 |
2475 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4 0x1198 |
2476 |
++#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_4 0x1199 |
2477 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2SM 0x11D0 |
2478 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM422_4 0x105A |
2479 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM485_4 0x105B |
2480 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM422_8 0x106A |
2481 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM485_8 0x106B |
2482 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4 0x1098 |
2483 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_8 0x10A9 |
2484 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SM 0x10D9 |
2485 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_8SM 0x10E9 |
2486 |
++#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4SM 0x11D8 |
2487 |
++ |
2488 |
++ |
2489 |
++ |
2490 |
+ /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ |
2491 |
+ #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 |
2492 |
+ #define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588 |
2493 |
+@@ -5120,6 +5157,108 @@ static struct pci_device_id serial_pci_tbl[] = { |
2494 |
+ 0, |
2495 |
+ 0, pbn_pericom_PI7C9X7958 }, |
2496 |
+ /* |
2497 |
++ * ACCES I/O Products quad |
2498 |
++ */ |
2499 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB, |
2500 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2501 |
++ pbn_pericom_PI7C9X7954 }, |
2502 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S, |
2503 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2504 |
++ pbn_pericom_PI7C9X7954 }, |
2505 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB, |
2506 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2507 |
++ pbn_pericom_PI7C9X7954 }, |
2508 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4S, |
2509 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2510 |
++ pbn_pericom_PI7C9X7954 }, |
2511 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_2DB, |
2512 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2513 |
++ pbn_pericom_PI7C9X7954 }, |
2514 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_2, |
2515 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2516 |
++ pbn_pericom_PI7C9X7954 }, |
2517 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB, |
2518 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2519 |
++ pbn_pericom_PI7C9X7954 }, |
2520 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_4, |
2521 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2522 |
++ pbn_pericom_PI7C9X7954 }, |
2523 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SMDB, |
2524 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2525 |
++ pbn_pericom_PI7C9X7954 }, |
2526 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2SM, |
2527 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2528 |
++ pbn_pericom_PI7C9X7954 }, |
2529 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB, |
2530 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2531 |
++ pbn_pericom_PI7C9X7954 }, |
2532 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4SM, |
2533 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2534 |
++ pbn_pericom_PI7C9X7954 }, |
2535 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_1, |
2536 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2537 |
++ pbn_pericom_PI7C9X7954 }, |
2538 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_2, |
2539 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2540 |
++ pbn_pericom_PI7C9X7954 }, |
2541 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_2, |
2542 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2543 |
++ pbn_pericom_PI7C9X7954 }, |
2544 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4, |
2545 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2546 |
++ pbn_pericom_PI7C9X7954 }, |
2547 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_4, |
2548 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2549 |
++ pbn_pericom_PI7C9X7954 }, |
2550 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2S, |
2551 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2552 |
++ pbn_pericom_PI7C9X7954 }, |
2553 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4S, |
2554 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2555 |
++ pbn_pericom_PI7C9X7954 }, |
2556 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_2, |
2557 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2558 |
++ pbn_pericom_PI7C9X7954 }, |
2559 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_2, |
2560 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2561 |
++ pbn_pericom_PI7C9X7954 }, |
2562 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4, |
2563 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2564 |
++ pbn_pericom_PI7C9X7954 }, |
2565 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_4, |
2566 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2567 |
++ pbn_pericom_PI7C9X7954 }, |
2568 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2SM, |
2569 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2570 |
++ pbn_pericom_PI7C9X7954 }, |
2571 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM422_4, |
2572 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2573 |
++ pbn_pericom_PI7C9X7958 }, |
2574 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM485_4, |
2575 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2576 |
++ pbn_pericom_PI7C9X7958 }, |
2577 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM422_8, |
2578 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2579 |
++ pbn_pericom_PI7C9X7958 }, |
2580 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM485_8, |
2581 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2582 |
++ pbn_pericom_PI7C9X7958 }, |
2583 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4, |
2584 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2585 |
++ pbn_pericom_PI7C9X7958 }, |
2586 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_8, |
2587 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2588 |
++ pbn_pericom_PI7C9X7958 }, |
2589 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SM, |
2590 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2591 |
++ pbn_pericom_PI7C9X7958 }, |
2592 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_8SM, |
2593 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2594 |
++ pbn_pericom_PI7C9X7958 }, |
2595 |
++ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4SM, |
2596 |
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2597 |
++ pbn_pericom_PI7C9X7958 }, |
2598 |
++ /* |
2599 |
+ * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke) |
2600 |
+ */ |
2601 |
+ { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560, |
2602 |
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c |
2603 |
+index ca367b05e440..68fc5fce4cc5 100644 |
2604 |
+--- a/drivers/usb/chipidea/udc.c |
2605 |
++++ b/drivers/usb/chipidea/udc.c |
2606 |
+@@ -939,6 +939,15 @@ static int isr_setup_status_phase(struct ci_hdrc *ci) |
2607 |
+ int retval; |
2608 |
+ struct ci_hw_ep *hwep; |
2609 |
+ |
2610 |
++ /* |
2611 |
++ * Unexpected USB controller behavior, caused by bad signal integrity |
2612 |
++ * or ground reference problems, can lead to isr_setup_status_phase |
2613 |
++ * being called with ci->status equal to NULL. |
2614 |
++ * If this situation occurs, you should review your USB hardware design. |
2615 |
++ */ |
2616 |
++ if (WARN_ON_ONCE(!ci->status)) |
2617 |
++ return -EPIPE; |
2618 |
++ |
2619 |
+ hwep = (ci->ep0_dir == TX) ? ci->ep0out : ci->ep0in; |
2620 |
+ ci->status->context = ci; |
2621 |
+ ci->status->complete = isr_setup_status_complete; |
2622 |
+diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c |
2623 |
+index 80c8d90d8b75..ff44cfa26af8 100644 |
2624 |
+--- a/drivers/usb/core/config.c |
2625 |
++++ b/drivers/usb/core/config.c |
2626 |
+@@ -211,8 +211,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, |
2627 |
+ memcpy(&endpoint->desc, d, n); |
2628 |
+ INIT_LIST_HEAD(&endpoint->urb_list); |
2629 |
+ |
2630 |
+- /* Fix up bInterval values outside the legal range. Use 32 ms if no |
2631 |
+- * proper value can be guessed. */ |
2632 |
++ /* |
2633 |
++ * Fix up bInterval values outside the legal range. |
2634 |
++ * Use 10 or 8 ms if no proper value can be guessed. |
2635 |
++ */ |
2636 |
+ i = 0; /* i = min, j = max, n = default */ |
2637 |
+ j = 255; |
2638 |
+ if (usb_endpoint_xfer_int(d)) { |
2639 |
+@@ -221,13 +223,15 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, |
2640 |
+ case USB_SPEED_SUPER_PLUS: |
2641 |
+ case USB_SPEED_SUPER: |
2642 |
+ case USB_SPEED_HIGH: |
2643 |
+- /* Many device manufacturers are using full-speed |
2644 |
++ /* |
2645 |
++ * Many device manufacturers are using full-speed |
2646 |
+ * bInterval values in high-speed interrupt endpoint |
2647 |
+- * descriptors. Try to fix those and fall back to a |
2648 |
+- * 32 ms default value otherwise. */ |
2649 |
++ * descriptors. Try to fix those and fall back to an |
2650 |
++ * 8-ms default value otherwise. |
2651 |
++ */ |
2652 |
+ n = fls(d->bInterval*8); |
2653 |
+ if (n == 0) |
2654 |
+- n = 9; /* 32 ms = 2^(9-1) uframes */ |
2655 |
++ n = 7; /* 8 ms = 2^(7-1) uframes */ |
2656 |
+ j = 16; |
2657 |
+ |
2658 |
+ /* |
2659 |
+@@ -242,10 +246,12 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, |
2660 |
+ } |
2661 |
+ break; |
2662 |
+ default: /* USB_SPEED_FULL or _LOW */ |
2663 |
+- /* For low-speed, 10 ms is the official minimum. |
2664 |
++ /* |
2665 |
++ * For low-speed, 10 ms is the official minimum. |
2666 |
+ * But some "overclocked" devices might want faster |
2667 |
+- * polling so we'll allow it. */ |
2668 |
+- n = 32; |
2669 |
++ * polling so we'll allow it. |
2670 |
++ */ |
2671 |
++ n = 10; |
2672 |
+ break; |
2673 |
+ } |
2674 |
+ } else if (usb_endpoint_xfer_isoc(d)) { |
2675 |
+@@ -253,10 +259,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, |
2676 |
+ j = 16; |
2677 |
+ switch (to_usb_device(ddev)->speed) { |
2678 |
+ case USB_SPEED_HIGH: |
2679 |
+- n = 9; /* 32 ms = 2^(9-1) uframes */ |
2680 |
++ n = 7; /* 8 ms = 2^(7-1) uframes */ |
2681 |
+ break; |
2682 |
+ default: /* USB_SPEED_FULL */ |
2683 |
+- n = 6; /* 32 ms = 2^(6-1) frames */ |
2684 |
++ n = 4; /* 8 ms = 2^(4-1) frames */ |
2685 |
+ break; |
2686 |
+ } |
2687 |
+ } |
2688 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
2689 |
+index 1f37b89e7267..62a5c8d5e028 100644 |
2690 |
+--- a/drivers/usb/host/xhci-ring.c |
2691 |
++++ b/drivers/usb/host/xhci-ring.c |
2692 |
+@@ -846,6 +846,10 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg) |
2693 |
+ spin_lock_irqsave(&xhci->lock, flags); |
2694 |
+ |
2695 |
+ ep->stop_cmds_pending--; |
2696 |
++ if (xhci->xhc_state & XHCI_STATE_REMOVING) { |
2697 |
++ spin_unlock_irqrestore(&xhci->lock, flags); |
2698 |
++ return; |
2699 |
++ } |
2700 |
+ if (xhci->xhc_state & XHCI_STATE_DYING) { |
2701 |
+ xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
2702 |
+ "Stop EP timer ran, but another timer marked " |
2703 |
+@@ -899,7 +903,7 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg) |
2704 |
+ spin_unlock_irqrestore(&xhci->lock, flags); |
2705 |
+ xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
2706 |
+ "Calling usb_hc_died()"); |
2707 |
+- usb_hc_died(xhci_to_hcd(xhci)->primary_hcd); |
2708 |
++ usb_hc_died(xhci_to_hcd(xhci)); |
2709 |
+ xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
2710 |
+ "xHCI host controller is dead."); |
2711 |
+ } |
2712 |
+diff --git a/drivers/usb/renesas_usbhs/mod.c b/drivers/usb/renesas_usbhs/mod.c |
2713 |
+index d4be5d594896..28965ef4f824 100644 |
2714 |
+--- a/drivers/usb/renesas_usbhs/mod.c |
2715 |
++++ b/drivers/usb/renesas_usbhs/mod.c |
2716 |
+@@ -282,9 +282,16 @@ static irqreturn_t usbhs_interrupt(int irq, void *data) |
2717 |
+ if (usbhs_mod_is_host(priv)) |
2718 |
+ usbhs_write(priv, INTSTS1, ~irq_state.intsts1 & INTSTS1_MAGIC); |
2719 |
+ |
2720 |
+- usbhs_write(priv, BRDYSTS, ~irq_state.brdysts); |
2721 |
++ /* |
2722 |
++ * The driver should not clear the xxxSTS after the line of |
2723 |
++ * "call irq callback functions" because each "if" statement is |
2724 |
++ * possible to call the callback function for avoiding any side effects. |
2725 |
++ */ |
2726 |
++ if (irq_state.intsts0 & BRDY) |
2727 |
++ usbhs_write(priv, BRDYSTS, ~irq_state.brdysts); |
2728 |
+ usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts); |
2729 |
+- usbhs_write(priv, BEMPSTS, ~irq_state.bempsts); |
2730 |
++ if (irq_state.intsts0 & BEMP) |
2731 |
++ usbhs_write(priv, BEMPSTS, ~irq_state.bempsts); |
2732 |
+ |
2733 |
+ /* |
2734 |
+ * call irq callback functions |
2735 |
+diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c |
2736 |
+index a204782ae530..e98b6e57b703 100644 |
2737 |
+--- a/drivers/usb/serial/usb-serial-simple.c |
2738 |
++++ b/drivers/usb/serial/usb-serial-simple.c |
2739 |
+@@ -54,7 +54,8 @@ DEVICE(funsoft, FUNSOFT_IDS); |
2740 |
+ /* Infineon Flashloader driver */ |
2741 |
+ #define FLASHLOADER_IDS() \ |
2742 |
+ { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \ |
2743 |
+- { USB_DEVICE(0x8087, 0x0716) } |
2744 |
++ { USB_DEVICE(0x8087, 0x0716) }, \ |
2745 |
++ { USB_DEVICE(0x8087, 0x0801) } |
2746 |
+ DEVICE(flashloader, FLASHLOADER_IDS); |
2747 |
+ |
2748 |
+ /* Google Serial USB SubClass */ |
2749 |
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c |
2750 |
+index 0e044d7ee721..1415f6d58633 100644 |
2751 |
+--- a/fs/btrfs/tree-log.c |
2752 |
++++ b/fs/btrfs/tree-log.c |
2753 |
+@@ -2850,6 +2850,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, |
2754 |
+ |
2755 |
+ if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { |
2756 |
+ blk_finish_plug(&plug); |
2757 |
++ list_del_init(&root_log_ctx.list); |
2758 |
+ mutex_unlock(&log_root_tree->log_mutex); |
2759 |
+ ret = root_log_ctx.log_ret; |
2760 |
+ goto out; |
2761 |
+diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c |
2762 |
+index ad050698143f..8a9feb341f31 100644 |
2763 |
+--- a/fs/ext4/crypto_policy.c |
2764 |
++++ b/fs/ext4/crypto_policy.c |
2765 |
+@@ -102,6 +102,9 @@ static int ext4_create_encryption_context_from_policy( |
2766 |
+ int ext4_process_policy(const struct ext4_encryption_policy *policy, |
2767 |
+ struct inode *inode) |
2768 |
+ { |
2769 |
++ if (!inode_owner_or_capable(inode)) |
2770 |
++ return -EACCES; |
2771 |
++ |
2772 |
+ if (policy->version != 0) |
2773 |
+ return -EINVAL; |
2774 |
+ |
2775 |
+diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c |
2776 |
+index 5e872fd40e5e..1fb12f9c97a6 100644 |
2777 |
+--- a/fs/ext4/ioctl.c |
2778 |
++++ b/fs/ext4/ioctl.c |
2779 |
+@@ -629,7 +629,13 @@ resizefs_out: |
2780 |
+ goto encryption_policy_out; |
2781 |
+ } |
2782 |
+ |
2783 |
++ err = mnt_want_write_file(filp); |
2784 |
++ if (err) |
2785 |
++ goto encryption_policy_out; |
2786 |
++ |
2787 |
+ err = ext4_process_policy(&policy, inode); |
2788 |
++ |
2789 |
++ mnt_drop_write_file(filp); |
2790 |
+ encryption_policy_out: |
2791 |
+ return err; |
2792 |
+ #else |
2793 |
+diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c |
2794 |
+index c4dcac8a018d..3c7f0c44cfb3 100644 |
2795 |
+--- a/fs/ext4/mballoc.c |
2796 |
++++ b/fs/ext4/mballoc.c |
2797 |
+@@ -815,7 +815,7 @@ static void mb_regenerate_buddy(struct ext4_buddy *e4b) |
2798 |
+ * for this page; do not hold this lock when calling this routine! |
2799 |
+ */ |
2800 |
+ |
2801 |
+-static int ext4_mb_init_cache(struct page *page, char *incore) |
2802 |
++static int ext4_mb_init_cache(struct page *page, char *incore, gfp_t gfp) |
2803 |
+ { |
2804 |
+ ext4_group_t ngroups; |
2805 |
+ int blocksize; |
2806 |
+@@ -848,7 +848,7 @@ static int ext4_mb_init_cache(struct page *page, char *incore) |
2807 |
+ /* allocate buffer_heads to read bitmaps */ |
2808 |
+ if (groups_per_page > 1) { |
2809 |
+ i = sizeof(struct buffer_head *) * groups_per_page; |
2810 |
+- bh = kzalloc(i, GFP_NOFS); |
2811 |
++ bh = kzalloc(i, gfp); |
2812 |
+ if (bh == NULL) { |
2813 |
+ err = -ENOMEM; |
2814 |
+ goto out; |
2815 |
+@@ -983,7 +983,7 @@ out: |
2816 |
+ * are on the same page e4b->bd_buddy_page is NULL and return value is 0. |
2817 |
+ */ |
2818 |
+ static int ext4_mb_get_buddy_page_lock(struct super_block *sb, |
2819 |
+- ext4_group_t group, struct ext4_buddy *e4b) |
2820 |
++ ext4_group_t group, struct ext4_buddy *e4b, gfp_t gfp) |
2821 |
+ { |
2822 |
+ struct inode *inode = EXT4_SB(sb)->s_buddy_cache; |
2823 |
+ int block, pnum, poff; |
2824 |
+@@ -1002,7 +1002,7 @@ static int ext4_mb_get_buddy_page_lock(struct super_block *sb, |
2825 |
+ block = group * 2; |
2826 |
+ pnum = block / blocks_per_page; |
2827 |
+ poff = block % blocks_per_page; |
2828 |
+- page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS); |
2829 |
++ page = find_or_create_page(inode->i_mapping, pnum, gfp); |
2830 |
+ if (!page) |
2831 |
+ return -ENOMEM; |
2832 |
+ BUG_ON(page->mapping != inode->i_mapping); |
2833 |
+@@ -1016,7 +1016,7 @@ static int ext4_mb_get_buddy_page_lock(struct super_block *sb, |
2834 |
+ |
2835 |
+ block++; |
2836 |
+ pnum = block / blocks_per_page; |
2837 |
+- page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS); |
2838 |
++ page = find_or_create_page(inode->i_mapping, pnum, gfp); |
2839 |
+ if (!page) |
2840 |
+ return -ENOMEM; |
2841 |
+ BUG_ON(page->mapping != inode->i_mapping); |
2842 |
+@@ -1042,7 +1042,7 @@ static void ext4_mb_put_buddy_page_lock(struct ext4_buddy *e4b) |
2843 |
+ * calling this routine! |
2844 |
+ */ |
2845 |
+ static noinline_for_stack |
2846 |
+-int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) |
2847 |
++int ext4_mb_init_group(struct super_block *sb, ext4_group_t group, gfp_t gfp) |
2848 |
+ { |
2849 |
+ |
2850 |
+ struct ext4_group_info *this_grp; |
2851 |
+@@ -1062,7 +1062,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) |
2852 |
+ * The call to ext4_mb_get_buddy_page_lock will mark the |
2853 |
+ * page accessed. |
2854 |
+ */ |
2855 |
+- ret = ext4_mb_get_buddy_page_lock(sb, group, &e4b); |
2856 |
++ ret = ext4_mb_get_buddy_page_lock(sb, group, &e4b, gfp); |
2857 |
+ if (ret || !EXT4_MB_GRP_NEED_INIT(this_grp)) { |
2858 |
+ /* |
2859 |
+ * somebody initialized the group |
2860 |
+@@ -1072,7 +1072,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) |
2861 |
+ } |
2862 |
+ |
2863 |
+ page = e4b.bd_bitmap_page; |
2864 |
+- ret = ext4_mb_init_cache(page, NULL); |
2865 |
++ ret = ext4_mb_init_cache(page, NULL, gfp); |
2866 |
+ if (ret) |
2867 |
+ goto err; |
2868 |
+ if (!PageUptodate(page)) { |
2869 |
+@@ -1091,7 +1091,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) |
2870 |
+ } |
2871 |
+ /* init buddy cache */ |
2872 |
+ page = e4b.bd_buddy_page; |
2873 |
+- ret = ext4_mb_init_cache(page, e4b.bd_bitmap); |
2874 |
++ ret = ext4_mb_init_cache(page, e4b.bd_bitmap, gfp); |
2875 |
+ if (ret) |
2876 |
+ goto err; |
2877 |
+ if (!PageUptodate(page)) { |
2878 |
+@@ -1109,8 +1109,8 @@ err: |
2879 |
+ * calling this routine! |
2880 |
+ */ |
2881 |
+ static noinline_for_stack int |
2882 |
+-ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, |
2883 |
+- struct ext4_buddy *e4b) |
2884 |
++ext4_mb_load_buddy_gfp(struct super_block *sb, ext4_group_t group, |
2885 |
++ struct ext4_buddy *e4b, gfp_t gfp) |
2886 |
+ { |
2887 |
+ int blocks_per_page; |
2888 |
+ int block; |
2889 |
+@@ -1140,7 +1140,7 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, |
2890 |
+ * we need full data about the group |
2891 |
+ * to make a good selection |
2892 |
+ */ |
2893 |
+- ret = ext4_mb_init_group(sb, group); |
2894 |
++ ret = ext4_mb_init_group(sb, group, gfp); |
2895 |
+ if (ret) |
2896 |
+ return ret; |
2897 |
+ } |
2898 |
+@@ -1168,11 +1168,11 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, |
2899 |
+ * wait for it to initialize. |
2900 |
+ */ |
2901 |
+ page_cache_release(page); |
2902 |
+- page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS); |
2903 |
++ page = find_or_create_page(inode->i_mapping, pnum, gfp); |
2904 |
+ if (page) { |
2905 |
+ BUG_ON(page->mapping != inode->i_mapping); |
2906 |
+ if (!PageUptodate(page)) { |
2907 |
+- ret = ext4_mb_init_cache(page, NULL); |
2908 |
++ ret = ext4_mb_init_cache(page, NULL, gfp); |
2909 |
+ if (ret) { |
2910 |
+ unlock_page(page); |
2911 |
+ goto err; |
2912 |
+@@ -1204,11 +1204,12 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, |
2913 |
+ if (page == NULL || !PageUptodate(page)) { |
2914 |
+ if (page) |
2915 |
+ page_cache_release(page); |
2916 |
+- page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS); |
2917 |
++ page = find_or_create_page(inode->i_mapping, pnum, gfp); |
2918 |
+ if (page) { |
2919 |
+ BUG_ON(page->mapping != inode->i_mapping); |
2920 |
+ if (!PageUptodate(page)) { |
2921 |
+- ret = ext4_mb_init_cache(page, e4b->bd_bitmap); |
2922 |
++ ret = ext4_mb_init_cache(page, e4b->bd_bitmap, |
2923 |
++ gfp); |
2924 |
+ if (ret) { |
2925 |
+ unlock_page(page); |
2926 |
+ goto err; |
2927 |
+@@ -1247,6 +1248,12 @@ err: |
2928 |
+ return ret; |
2929 |
+ } |
2930 |
+ |
2931 |
++static int ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, |
2932 |
++ struct ext4_buddy *e4b) |
2933 |
++{ |
2934 |
++ return ext4_mb_load_buddy_gfp(sb, group, e4b, GFP_NOFS); |
2935 |
++} |
2936 |
++ |
2937 |
+ static void ext4_mb_unload_buddy(struct ext4_buddy *e4b) |
2938 |
+ { |
2939 |
+ if (e4b->bd_bitmap_page) |
2940 |
+@@ -2047,7 +2054,7 @@ static int ext4_mb_good_group(struct ext4_allocation_context *ac, |
2941 |
+ |
2942 |
+ /* We only do this if the grp has never been initialized */ |
2943 |
+ if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) { |
2944 |
+- int ret = ext4_mb_init_group(ac->ac_sb, group); |
2945 |
++ int ret = ext4_mb_init_group(ac->ac_sb, group, GFP_NOFS); |
2946 |
+ if (ret) |
2947 |
+ return ret; |
2948 |
+ } |
2949 |
+@@ -4808,7 +4815,9 @@ do_more: |
2950 |
+ #endif |
2951 |
+ trace_ext4_mballoc_free(sb, inode, block_group, bit, count_clusters); |
2952 |
+ |
2953 |
+- err = ext4_mb_load_buddy(sb, block_group, &e4b); |
2954 |
++ /* __GFP_NOFAIL: retry infinitely, ignore TIF_MEMDIE and memcg limit. */ |
2955 |
++ err = ext4_mb_load_buddy_gfp(sb, block_group, &e4b, |
2956 |
++ GFP_NOFS|__GFP_NOFAIL); |
2957 |
+ if (err) |
2958 |
+ goto error_return; |
2959 |
+ |
2960 |
+@@ -5210,7 +5219,7 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range) |
2961 |
+ grp = ext4_get_group_info(sb, group); |
2962 |
+ /* We only do this if the grp has never been initialized */ |
2963 |
+ if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) { |
2964 |
+- ret = ext4_mb_init_group(sb, group); |
2965 |
++ ret = ext4_mb_init_group(sb, group, GFP_NOFS); |
2966 |
+ if (ret) |
2967 |
+ break; |
2968 |
+ } |
2969 |
+diff --git a/fs/f2fs/crypto_policy.c b/fs/f2fs/crypto_policy.c |
2970 |
+index d4a96af513c2..e504f548b64e 100644 |
2971 |
+--- a/fs/f2fs/crypto_policy.c |
2972 |
++++ b/fs/f2fs/crypto_policy.c |
2973 |
+@@ -89,6 +89,9 @@ static int f2fs_create_encryption_context_from_policy( |
2974 |
+ int f2fs_process_policy(const struct f2fs_encryption_policy *policy, |
2975 |
+ struct inode *inode) |
2976 |
+ { |
2977 |
++ if (!inode_owner_or_capable(inode)) |
2978 |
++ return -EACCES; |
2979 |
++ |
2980 |
+ if (policy->version != 0) |
2981 |
+ return -EINVAL; |
2982 |
+ |
2983 |
+diff --git a/fs/fuse/file.c b/fs/fuse/file.c |
2984 |
+index d58d4c0af0ce..682e79965c16 100644 |
2985 |
+--- a/fs/fuse/file.c |
2986 |
++++ b/fs/fuse/file.c |
2987 |
+@@ -540,13 +540,13 @@ void fuse_read_fill(struct fuse_req *req, struct file *file, loff_t pos, |
2988 |
+ req->out.args[0].size = count; |
2989 |
+ } |
2990 |
+ |
2991 |
+-static void fuse_release_user_pages(struct fuse_req *req, int write) |
2992 |
++static void fuse_release_user_pages(struct fuse_req *req, bool should_dirty) |
2993 |
+ { |
2994 |
+ unsigned i; |
2995 |
+ |
2996 |
+ for (i = 0; i < req->num_pages; i++) { |
2997 |
+ struct page *page = req->pages[i]; |
2998 |
+- if (write) |
2999 |
++ if (should_dirty) |
3000 |
+ set_page_dirty_lock(page); |
3001 |
+ put_page(page); |
3002 |
+ } |
3003 |
+@@ -1331,6 +1331,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter, |
3004 |
+ loff_t *ppos, int flags) |
3005 |
+ { |
3006 |
+ int write = flags & FUSE_DIO_WRITE; |
3007 |
++ bool should_dirty = !write && iter_is_iovec(iter); |
3008 |
+ int cuse = flags & FUSE_DIO_CUSE; |
3009 |
+ struct file *file = io->file; |
3010 |
+ struct inode *inode = file->f_mapping->host; |
3011 |
+@@ -1375,7 +1376,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter, |
3012 |
+ nres = fuse_send_read(req, io, pos, nbytes, owner); |
3013 |
+ |
3014 |
+ if (!io->async) |
3015 |
+- fuse_release_user_pages(req, !write); |
3016 |
++ fuse_release_user_pages(req, should_dirty); |
3017 |
+ if (req->out.h.error) { |
3018 |
+ if (!res) |
3019 |
+ res = req->out.h.error; |
3020 |
+diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c |
3021 |
+index 7247252ee9b1..6e9a912d394c 100644 |
3022 |
+--- a/fs/kernfs/file.c |
3023 |
++++ b/fs/kernfs/file.c |
3024 |
+@@ -833,21 +833,35 @@ repeat: |
3025 |
+ mutex_lock(&kernfs_mutex); |
3026 |
+ |
3027 |
+ list_for_each_entry(info, &kernfs_root(kn)->supers, node) { |
3028 |
++ struct kernfs_node *parent; |
3029 |
+ struct inode *inode; |
3030 |
+- struct dentry *dentry; |
3031 |
+ |
3032 |
++ /* |
3033 |
++ * We want fsnotify_modify() on @kn but as the |
3034 |
++ * modifications aren't originating from userland don't |
3035 |
++ * have the matching @file available. Look up the inodes |
3036 |
++ * and generate the events manually. |
3037 |
++ */ |
3038 |
+ inode = ilookup(info->sb, kn->ino); |
3039 |
+ if (!inode) |
3040 |
+ continue; |
3041 |
+ |
3042 |
+- dentry = d_find_any_alias(inode); |
3043 |
+- if (dentry) { |
3044 |
+- fsnotify_parent(NULL, dentry, FS_MODIFY); |
3045 |
+- fsnotify(inode, FS_MODIFY, inode, FSNOTIFY_EVENT_INODE, |
3046 |
+- NULL, 0); |
3047 |
+- dput(dentry); |
3048 |
++ parent = kernfs_get_parent(kn); |
3049 |
++ if (parent) { |
3050 |
++ struct inode *p_inode; |
3051 |
++ |
3052 |
++ p_inode = ilookup(info->sb, parent->ino); |
3053 |
++ if (p_inode) { |
3054 |
++ fsnotify(p_inode, FS_MODIFY | FS_EVENT_ON_CHILD, |
3055 |
++ inode, FSNOTIFY_EVENT_INODE, kn->name, 0); |
3056 |
++ iput(p_inode); |
3057 |
++ } |
3058 |
++ |
3059 |
++ kernfs_put(parent); |
3060 |
+ } |
3061 |
+ |
3062 |
++ fsnotify(inode, FS_MODIFY, inode, FSNOTIFY_EVENT_INODE, |
3063 |
++ kn->name, 0); |
3064 |
+ iput(inode); |
3065 |
+ } |
3066 |
+ |
3067 |
+diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c |
3068 |
+index a7f2e6e33305..52a28311e2a4 100644 |
3069 |
+--- a/fs/nfs/callback.c |
3070 |
++++ b/fs/nfs/callback.c |
3071 |
+@@ -275,6 +275,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv, |
3072 |
+ err_socks: |
3073 |
+ svc_rpcb_cleanup(serv, net); |
3074 |
+ err_bind: |
3075 |
++ nn->cb_users[minorversion]--; |
3076 |
+ dprintk("NFS: Couldn't create callback socket: err = %d; " |
3077 |
+ "net = %p\n", ret, net); |
3078 |
+ return ret; |
3079 |
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c |
3080 |
+index fc215ab4dcd5..3c69299c01ab 100644 |
3081 |
+--- a/fs/nfs/nfs4proc.c |
3082 |
++++ b/fs/nfs/nfs4proc.c |
3083 |
+@@ -7424,12 +7424,20 @@ static int _nfs4_proc_create_session(struct nfs_client *clp, |
3084 |
+ status = rpc_call_sync(session->clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); |
3085 |
+ trace_nfs4_create_session(clp, status); |
3086 |
+ |
3087 |
++ switch (status) { |
3088 |
++ case -NFS4ERR_STALE_CLIENTID: |
3089 |
++ case -NFS4ERR_DELAY: |
3090 |
++ case -ETIMEDOUT: |
3091 |
++ case -EACCES: |
3092 |
++ case -EAGAIN: |
3093 |
++ goto out; |
3094 |
++ }; |
3095 |
++ |
3096 |
++ clp->cl_seqid++; |
3097 |
+ if (!status) { |
3098 |
+ /* Verify the session's negotiated channel_attrs values */ |
3099 |
+ status = nfs4_verify_channel_attrs(&args, &res); |
3100 |
+ /* Increment the clientid slot sequence id */ |
3101 |
+- if (clp->cl_seqid == res.seqid) |
3102 |
+- clp->cl_seqid++; |
3103 |
+ if (status) |
3104 |
+ goto out; |
3105 |
+ nfs4_update_session(session, &res); |
3106 |
+diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c |
3107 |
+index bec0384499f7..5cd3568eea06 100644 |
3108 |
+--- a/fs/nfs/pnfs.c |
3109 |
++++ b/fs/nfs/pnfs.c |
3110 |
+@@ -365,6 +365,9 @@ pnfs_layout_need_return(struct pnfs_layout_hdr *lo, |
3111 |
+ static bool |
3112 |
+ pnfs_prepare_layoutreturn(struct pnfs_layout_hdr *lo) |
3113 |
+ { |
3114 |
++ /* Serialise LAYOUTGET/LAYOUTRETURN */ |
3115 |
++ if (atomic_read(&lo->plh_outstanding) != 0) |
3116 |
++ return false; |
3117 |
+ if (test_and_set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) |
3118 |
+ return false; |
3119 |
+ lo->plh_return_iomode = 0; |
3120 |
+@@ -1530,6 +1533,7 @@ pnfs_update_layout(struct inode *ino, |
3121 |
+ goto out; |
3122 |
+ |
3123 |
+ lookup_again: |
3124 |
++ nfs4_client_recover_expired_lease(clp); |
3125 |
+ first = false; |
3126 |
+ spin_lock(&ino->i_lock); |
3127 |
+ lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags); |
3128 |
+diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c |
3129 |
+index f7ea624780a7..55638110cb06 100644 |
3130 |
+--- a/fs/nfsd/nfs4state.c |
3131 |
++++ b/fs/nfsd/nfs4state.c |
3132 |
+@@ -1200,27 +1200,6 @@ free_ol_stateid_reaplist(struct list_head *reaplist) |
3133 |
+ } |
3134 |
+ } |
3135 |
+ |
3136 |
+-static void release_lockowner(struct nfs4_lockowner *lo) |
3137 |
+-{ |
3138 |
+- struct nfs4_client *clp = lo->lo_owner.so_client; |
3139 |
+- struct nfs4_ol_stateid *stp; |
3140 |
+- struct list_head reaplist; |
3141 |
+- |
3142 |
+- INIT_LIST_HEAD(&reaplist); |
3143 |
+- |
3144 |
+- spin_lock(&clp->cl_lock); |
3145 |
+- unhash_lockowner_locked(lo); |
3146 |
+- while (!list_empty(&lo->lo_owner.so_stateids)) { |
3147 |
+- stp = list_first_entry(&lo->lo_owner.so_stateids, |
3148 |
+- struct nfs4_ol_stateid, st_perstateowner); |
3149 |
+- WARN_ON(!unhash_lock_stateid(stp)); |
3150 |
+- put_ol_stateid_locked(stp, &reaplist); |
3151 |
+- } |
3152 |
+- spin_unlock(&clp->cl_lock); |
3153 |
+- free_ol_stateid_reaplist(&reaplist); |
3154 |
+- nfs4_put_stateowner(&lo->lo_owner); |
3155 |
+-} |
3156 |
+- |
3157 |
+ static void release_open_stateid_locks(struct nfs4_ol_stateid *open_stp, |
3158 |
+ struct list_head *reaplist) |
3159 |
+ { |
3160 |
+@@ -5952,6 +5931,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, |
3161 |
+ __be32 status; |
3162 |
+ struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); |
3163 |
+ struct nfs4_client *clp; |
3164 |
++ LIST_HEAD (reaplist); |
3165 |
+ |
3166 |
+ dprintk("nfsd4_release_lockowner clientid: (%08x/%08x):\n", |
3167 |
+ clid->cl_boot, clid->cl_id); |
3168 |
+@@ -5982,9 +5962,23 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, |
3169 |
+ nfs4_get_stateowner(sop); |
3170 |
+ break; |
3171 |
+ } |
3172 |
++ if (!lo) { |
3173 |
++ spin_unlock(&clp->cl_lock); |
3174 |
++ return status; |
3175 |
++ } |
3176 |
++ |
3177 |
++ unhash_lockowner_locked(lo); |
3178 |
++ while (!list_empty(&lo->lo_owner.so_stateids)) { |
3179 |
++ stp = list_first_entry(&lo->lo_owner.so_stateids, |
3180 |
++ struct nfs4_ol_stateid, |
3181 |
++ st_perstateowner); |
3182 |
++ WARN_ON(!unhash_lock_stateid(stp)); |
3183 |
++ put_ol_stateid_locked(stp, &reaplist); |
3184 |
++ } |
3185 |
+ spin_unlock(&clp->cl_lock); |
3186 |
+- if (lo) |
3187 |
+- release_lockowner(lo); |
3188 |
++ free_ol_stateid_reaplist(&reaplist); |
3189 |
++ nfs4_put_stateowner(&lo->lo_owner); |
3190 |
++ |
3191 |
+ return status; |
3192 |
+ } |
3193 |
+ |
3194 |
+diff --git a/fs/proc/base.c b/fs/proc/base.c |
3195 |
+index e8bbf6cdb437..d2b8c754f627 100644 |
3196 |
+--- a/fs/proc/base.c |
3197 |
++++ b/fs/proc/base.c |
3198 |
+@@ -1545,18 +1545,13 @@ static const struct file_operations proc_pid_set_comm_operations = { |
3199 |
+ static int proc_exe_link(struct dentry *dentry, struct path *exe_path) |
3200 |
+ { |
3201 |
+ struct task_struct *task; |
3202 |
+- struct mm_struct *mm; |
3203 |
+ struct file *exe_file; |
3204 |
+ |
3205 |
+ task = get_proc_task(d_inode(dentry)); |
3206 |
+ if (!task) |
3207 |
+ return -ENOENT; |
3208 |
+- mm = get_task_mm(task); |
3209 |
++ exe_file = get_task_exe_file(task); |
3210 |
+ put_task_struct(task); |
3211 |
+- if (!mm) |
3212 |
+- return -ENOENT; |
3213 |
+- exe_file = get_mm_exe_file(mm); |
3214 |
+- mmput(mm); |
3215 |
+ if (exe_file) { |
3216 |
+ *exe_path = exe_file->f_path; |
3217 |
+ path_get(&exe_file->f_path); |
3218 |
+diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h |
3219 |
+index 1bfa602958f2..32901d11f8c4 100644 |
3220 |
+--- a/include/asm-generic/uaccess.h |
3221 |
++++ b/include/asm-generic/uaccess.h |
3222 |
+@@ -230,14 +230,18 @@ extern int __put_user_bad(void) __attribute__((noreturn)); |
3223 |
+ might_fault(); \ |
3224 |
+ access_ok(VERIFY_READ, __p, sizeof(*ptr)) ? \ |
3225 |
+ __get_user((x), (__typeof__(*(ptr)) *)__p) : \ |
3226 |
+- -EFAULT; \ |
3227 |
++ ((x) = (__typeof__(*(ptr)))0,-EFAULT); \ |
3228 |
+ }) |
3229 |
+ |
3230 |
+ #ifndef __get_user_fn |
3231 |
+ static inline int __get_user_fn(size_t size, const void __user *ptr, void *x) |
3232 |
+ { |
3233 |
+- size = __copy_from_user(x, ptr, size); |
3234 |
+- return size ? -EFAULT : size; |
3235 |
++ size_t n = __copy_from_user(x, ptr, size); |
3236 |
++ if (unlikely(n)) { |
3237 |
++ memset(x + (size - n), 0, n); |
3238 |
++ return -EFAULT; |
3239 |
++ } |
3240 |
++ return 0; |
3241 |
+ } |
3242 |
+ |
3243 |
+ #define __get_user_fn(sz, u, k) __get_user_fn(sz, u, k) |
3244 |
+@@ -257,11 +261,13 @@ extern int __get_user_bad(void) __attribute__((noreturn)); |
3245 |
+ static inline long copy_from_user(void *to, |
3246 |
+ const void __user * from, unsigned long n) |
3247 |
+ { |
3248 |
++ unsigned long res = n; |
3249 |
+ might_fault(); |
3250 |
+- if (access_ok(VERIFY_READ, from, n)) |
3251 |
+- return __copy_from_user(to, from, n); |
3252 |
+- else |
3253 |
+- return n; |
3254 |
++ if (likely(access_ok(VERIFY_READ, from, n))) |
3255 |
++ res = __copy_from_user(to, from, n); |
3256 |
++ if (unlikely(res)) |
3257 |
++ memset(to + (n - res), 0, res); |
3258 |
++ return res; |
3259 |
+ } |
3260 |
+ |
3261 |
+ static inline long copy_to_user(void __user *to, |
3262 |
+diff --git a/include/linux/irq.h b/include/linux/irq.h |
3263 |
+index 3c1c96786248..f7cade00c525 100644 |
3264 |
+--- a/include/linux/irq.h |
3265 |
++++ b/include/linux/irq.h |
3266 |
+@@ -916,6 +916,16 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { } |
3267 |
+ static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } |
3268 |
+ #endif |
3269 |
+ |
3270 |
++/* |
3271 |
++ * The irqsave variants are for usage in non interrupt code. Do not use |
3272 |
++ * them in irq_chip callbacks. Use irq_gc_lock() instead. |
3273 |
++ */ |
3274 |
++#define irq_gc_lock_irqsave(gc, flags) \ |
3275 |
++ raw_spin_lock_irqsave(&(gc)->lock, flags) |
3276 |
++ |
3277 |
++#define irq_gc_unlock_irqrestore(gc, flags) \ |
3278 |
++ raw_spin_unlock_irqrestore(&(gc)->lock, flags) |
3279 |
++ |
3280 |
+ static inline void irq_reg_writel(struct irq_chip_generic *gc, |
3281 |
+ u32 val, int reg_offset) |
3282 |
+ { |
3283 |
+diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h |
3284 |
+index 1fd50dcfe47c..175c82699e9d 100644 |
3285 |
+--- a/include/linux/mfd/ti_am335x_tscadc.h |
3286 |
++++ b/include/linux/mfd/ti_am335x_tscadc.h |
3287 |
+@@ -138,16 +138,16 @@ |
3288 |
+ /* |
3289 |
+ * time in us for processing a single channel, calculated as follows: |
3290 |
+ * |
3291 |
+- * num cycles = open delay + (sample delay + conv time) * averaging |
3292 |
++ * max num cycles = open delay + (sample delay + conv time) * averaging |
3293 |
+ * |
3294 |
+- * num cycles: 152 + (1 + 13) * 16 = 376 |
3295 |
++ * max num cycles: 262143 + (255 + 13) * 16 = 266431 |
3296 |
+ * |
3297 |
+ * clock frequency: 26MHz / 8 = 3.25MHz |
3298 |
+ * clock period: 1 / 3.25MHz = 308ns |
3299 |
+ * |
3300 |
+- * processing time: 376 * 308ns = 116us |
3301 |
++ * max processing time: 266431 * 308ns = 83ms(approx) |
3302 |
+ */ |
3303 |
+-#define IDLE_TIMEOUT 116 /* microsec */ |
3304 |
++#define IDLE_TIMEOUT 83 /* milliseconds */ |
3305 |
+ |
3306 |
+ #define TSCADC_CELLS 2 |
3307 |
+ |
3308 |
+diff --git a/include/linux/mm.h b/include/linux/mm.h |
3309 |
+index 8a761248d01e..cfebb742ee18 100644 |
3310 |
+--- a/include/linux/mm.h |
3311 |
++++ b/include/linux/mm.h |
3312 |
+@@ -1898,6 +1898,7 @@ extern void mm_drop_all_locks(struct mm_struct *mm); |
3313 |
+ |
3314 |
+ extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); |
3315 |
+ extern struct file *get_mm_exe_file(struct mm_struct *mm); |
3316 |
++extern struct file *get_task_exe_file(struct task_struct *task); |
3317 |
+ |
3318 |
+ extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); |
3319 |
+ extern struct vm_area_struct *_install_special_mapping(struct mm_struct *mm, |
3320 |
+diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h |
3321 |
+index f67b2ec18e6d..7776afb0ffa5 100644 |
3322 |
+--- a/include/linux/mmc/dw_mmc.h |
3323 |
++++ b/include/linux/mmc/dw_mmc.h |
3324 |
+@@ -172,7 +172,7 @@ struct dw_mci { |
3325 |
+ /* For edmac */ |
3326 |
+ struct dw_mci_dma_slave *dms; |
3327 |
+ /* Registers's physical base address */ |
3328 |
+- void *phy_regs; |
3329 |
++ resource_size_t phy_regs; |
3330 |
+ |
3331 |
+ u32 cmd_status; |
3332 |
+ u32 data_status; |
3333 |
+diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h |
3334 |
+index 04c068e55353..b97d6823ef3c 100644 |
3335 |
+--- a/include/linux/netdevice.h |
3336 |
++++ b/include/linux/netdevice.h |
3337 |
+@@ -511,7 +511,6 @@ static inline void napi_enable(struct napi_struct *n) |
3338 |
+ clear_bit(NAPI_STATE_NPSVC, &n->state); |
3339 |
+ } |
3340 |
+ |
3341 |
+-#ifdef CONFIG_SMP |
3342 |
+ /** |
3343 |
+ * napi_synchronize - wait until NAPI is not running |
3344 |
+ * @n: napi context |
3345 |
+@@ -522,12 +521,12 @@ static inline void napi_enable(struct napi_struct *n) |
3346 |
+ */ |
3347 |
+ static inline void napi_synchronize(const struct napi_struct *n) |
3348 |
+ { |
3349 |
+- while (test_bit(NAPI_STATE_SCHED, &n->state)) |
3350 |
+- msleep(1); |
3351 |
++ if (IS_ENABLED(CONFIG_SMP)) |
3352 |
++ while (test_bit(NAPI_STATE_SCHED, &n->state)) |
3353 |
++ msleep(1); |
3354 |
++ else |
3355 |
++ barrier(); |
3356 |
+ } |
3357 |
+-#else |
3358 |
+-# define napi_synchronize(n) barrier() |
3359 |
+-#endif |
3360 |
+ |
3361 |
+ enum netdev_queue_state_t { |
3362 |
+ __QUEUE_STATE_DRV_XOFF, |
3363 |
+diff --git a/include/linux/uio.h b/include/linux/uio.h |
3364 |
+index 8b01e1c3c614..5f9c59da978b 100644 |
3365 |
+--- a/include/linux/uio.h |
3366 |
++++ b/include/linux/uio.h |
3367 |
+@@ -76,7 +76,7 @@ size_t iov_iter_copy_from_user_atomic(struct page *page, |
3368 |
+ struct iov_iter *i, unsigned long offset, size_t bytes); |
3369 |
+ void iov_iter_advance(struct iov_iter *i, size_t bytes); |
3370 |
+ int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); |
3371 |
+-int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes); |
3372 |
++#define iov_iter_fault_in_multipages_readable iov_iter_fault_in_readable |
3373 |
+ size_t iov_iter_single_seg_count(const struct iov_iter *i); |
3374 |
+ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, |
3375 |
+ struct iov_iter *i); |
3376 |
+diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c |
3377 |
+index 656c7e93ac0d..939945a5649c 100644 |
3378 |
+--- a/kernel/audit_watch.c |
3379 |
++++ b/kernel/audit_watch.c |
3380 |
+@@ -19,6 +19,7 @@ |
3381 |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
3382 |
+ */ |
3383 |
+ |
3384 |
++#include <linux/file.h> |
3385 |
+ #include <linux/kernel.h> |
3386 |
+ #include <linux/audit.h> |
3387 |
+ #include <linux/kthread.h> |
3388 |
+@@ -544,10 +545,11 @@ int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark) |
3389 |
+ unsigned long ino; |
3390 |
+ dev_t dev; |
3391 |
+ |
3392 |
+- rcu_read_lock(); |
3393 |
+- exe_file = rcu_dereference(tsk->mm->exe_file); |
3394 |
++ exe_file = get_task_exe_file(tsk); |
3395 |
++ if (!exe_file) |
3396 |
++ return 0; |
3397 |
+ ino = exe_file->f_inode->i_ino; |
3398 |
+ dev = exe_file->f_inode->i_sb->s_dev; |
3399 |
+- rcu_read_unlock(); |
3400 |
++ fput(exe_file); |
3401 |
+ return audit_mark_compare(mark, ino, dev); |
3402 |
+ } |
3403 |
+diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config |
3404 |
+index c2de56ab0fce..7fa0c4ae6394 100644 |
3405 |
+--- a/kernel/configs/tiny.config |
3406 |
++++ b/kernel/configs/tiny.config |
3407 |
+@@ -1,4 +1,12 @@ |
3408 |
++# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set |
3409 |
+ CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
3410 |
++# CONFIG_KERNEL_GZIP is not set |
3411 |
++# CONFIG_KERNEL_BZIP2 is not set |
3412 |
++# CONFIG_KERNEL_LZMA is not set |
3413 |
+ CONFIG_KERNEL_XZ=y |
3414 |
++# CONFIG_KERNEL_LZO is not set |
3415 |
++# CONFIG_KERNEL_LZ4 is not set |
3416 |
+ CONFIG_OPTIMIZE_INLINING=y |
3417 |
++# CONFIG_SLAB is not set |
3418 |
++# CONFIG_SLUB is not set |
3419 |
+ CONFIG_SLOB=y |
3420 |
+diff --git a/kernel/cpuset.c b/kernel/cpuset.c |
3421 |
+index 11eaf14b52c2..e120bd983ad0 100644 |
3422 |
+--- a/kernel/cpuset.c |
3423 |
++++ b/kernel/cpuset.c |
3424 |
+@@ -2074,6 +2074,20 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) |
3425 |
+ mutex_unlock(&cpuset_mutex); |
3426 |
+ } |
3427 |
+ |
3428 |
++/* |
3429 |
++ * Make sure the new task conform to the current state of its parent, |
3430 |
++ * which could have been changed by cpuset just after it inherits the |
3431 |
++ * state from the parent and before it sits on the cgroup's task list. |
3432 |
++ */ |
3433 |
++void cpuset_fork(struct task_struct *task) |
3434 |
++{ |
3435 |
++ if (task_css_is_root(task, cpuset_cgrp_id)) |
3436 |
++ return; |
3437 |
++ |
3438 |
++ set_cpus_allowed_ptr(task, ¤t->cpus_allowed); |
3439 |
++ task->mems_allowed = current->mems_allowed; |
3440 |
++} |
3441 |
++ |
3442 |
+ struct cgroup_subsys cpuset_cgrp_subsys = { |
3443 |
+ .css_alloc = cpuset_css_alloc, |
3444 |
+ .css_online = cpuset_css_online, |
3445 |
+@@ -2084,6 +2098,7 @@ struct cgroup_subsys cpuset_cgrp_subsys = { |
3446 |
+ .attach = cpuset_attach, |
3447 |
+ .post_attach = cpuset_post_attach, |
3448 |
+ .bind = cpuset_bind, |
3449 |
++ .fork = cpuset_fork, |
3450 |
+ .legacy_cftypes = files, |
3451 |
+ .early_init = 1, |
3452 |
+ }; |
3453 |
+diff --git a/kernel/fork.c b/kernel/fork.c |
3454 |
+index c485cb156772..8860d1f50d24 100644 |
3455 |
+--- a/kernel/fork.c |
3456 |
++++ b/kernel/fork.c |
3457 |
+@@ -764,6 +764,29 @@ struct file *get_mm_exe_file(struct mm_struct *mm) |
3458 |
+ EXPORT_SYMBOL(get_mm_exe_file); |
3459 |
+ |
3460 |
+ /** |
3461 |
++ * get_task_exe_file - acquire a reference to the task's executable file |
3462 |
++ * |
3463 |
++ * Returns %NULL if task's mm (if any) has no associated executable file or |
3464 |
++ * this is a kernel thread with borrowed mm (see the comment above get_task_mm). |
3465 |
++ * User must release file via fput(). |
3466 |
++ */ |
3467 |
++struct file *get_task_exe_file(struct task_struct *task) |
3468 |
++{ |
3469 |
++ struct file *exe_file = NULL; |
3470 |
++ struct mm_struct *mm; |
3471 |
++ |
3472 |
++ task_lock(task); |
3473 |
++ mm = task->mm; |
3474 |
++ if (mm) { |
3475 |
++ if (!(task->flags & PF_KTHREAD)) |
3476 |
++ exe_file = get_mm_exe_file(mm); |
3477 |
++ } |
3478 |
++ task_unlock(task); |
3479 |
++ return exe_file; |
3480 |
++} |
3481 |
++EXPORT_SYMBOL(get_task_exe_file); |
3482 |
++ |
3483 |
++/** |
3484 |
+ * get_task_mm - acquire a reference to the task's mm |
3485 |
+ * |
3486 |
+ * Returns %NULL if the task has no mm. Checks PF_KTHREAD (meaning |
3487 |
+diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c |
3488 |
+index 4b21779d5163..cd6009006510 100644 |
3489 |
+--- a/kernel/irq/msi.c |
3490 |
++++ b/kernel/irq/msi.c |
3491 |
+@@ -298,6 +298,7 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev, |
3492 |
+ ops->msi_finish(&arg, 0); |
3493 |
+ |
3494 |
+ for_each_msi_entry(desc, dev) { |
3495 |
++ virq = desc->irq; |
3496 |
+ if (desc->nvec_used == 1) |
3497 |
+ dev_dbg(dev, "irq %d for MSI\n", virq); |
3498 |
+ else |
3499 |
+diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c |
3500 |
+index b70ada0028d2..6030efd4a188 100644 |
3501 |
+--- a/kernel/kexec_file.c |
3502 |
++++ b/kernel/kexec_file.c |
3503 |
+@@ -934,7 +934,10 @@ int kexec_load_purgatory(struct kimage *image, unsigned long min, |
3504 |
+ return 0; |
3505 |
+ out: |
3506 |
+ vfree(pi->sechdrs); |
3507 |
++ pi->sechdrs = NULL; |
3508 |
++ |
3509 |
+ vfree(pi->purgatory_buf); |
3510 |
++ pi->purgatory_buf = NULL; |
3511 |
+ return ret; |
3512 |
+ } |
3513 |
+ |
3514 |
+diff --git a/kernel/sched/core.c b/kernel/sched/core.c |
3515 |
+index ea863bc22caf..20253dbc8610 100644 |
3516 |
+--- a/kernel/sched/core.c |
3517 |
++++ b/kernel/sched/core.c |
3518 |
+@@ -1945,6 +1945,28 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) |
3519 |
+ success = 1; /* we're going to change ->state */ |
3520 |
+ cpu = task_cpu(p); |
3521 |
+ |
3522 |
++ /* |
3523 |
++ * Ensure we load p->on_rq _after_ p->state, otherwise it would |
3524 |
++ * be possible to, falsely, observe p->on_rq == 0 and get stuck |
3525 |
++ * in smp_cond_load_acquire() below. |
3526 |
++ * |
3527 |
++ * sched_ttwu_pending() try_to_wake_up() |
3528 |
++ * [S] p->on_rq = 1; [L] P->state |
3529 |
++ * UNLOCK rq->lock -----. |
3530 |
++ * \ |
3531 |
++ * +--- RMB |
3532 |
++ * schedule() / |
3533 |
++ * LOCK rq->lock -----' |
3534 |
++ * UNLOCK rq->lock |
3535 |
++ * |
3536 |
++ * [task p] |
3537 |
++ * [S] p->state = UNINTERRUPTIBLE [L] p->on_rq |
3538 |
++ * |
3539 |
++ * Pairs with the UNLOCK+LOCK on rq->lock from the |
3540 |
++ * last wakeup of our task and the schedule that got our task |
3541 |
++ * current. |
3542 |
++ */ |
3543 |
++ smp_rmb(); |
3544 |
+ if (p->on_rq && ttwu_remote(p, wake_flags)) |
3545 |
+ goto stat; |
3546 |
+ |
3547 |
+diff --git a/lib/iov_iter.c b/lib/iov_iter.c |
3548 |
+index 75232ad0a5e7..daca582a8ed0 100644 |
3549 |
+--- a/lib/iov_iter.c |
3550 |
++++ b/lib/iov_iter.c |
3551 |
+@@ -298,33 +298,13 @@ done: |
3552 |
+ } |
3553 |
+ |
3554 |
+ /* |
3555 |
+- * Fault in the first iovec of the given iov_iter, to a maximum length |
3556 |
+- * of bytes. Returns 0 on success, or non-zero if the memory could not be |
3557 |
+- * accessed (ie. because it is an invalid address). |
3558 |
+- * |
3559 |
+- * writev-intensive code may want this to prefault several iovecs -- that |
3560 |
+- * would be possible (callers must not rely on the fact that _only_ the |
3561 |
+- * first iovec will be faulted with the current implementation). |
3562 |
+- */ |
3563 |
+-int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes) |
3564 |
+-{ |
3565 |
+- if (!(i->type & (ITER_BVEC|ITER_KVEC))) { |
3566 |
+- char __user *buf = i->iov->iov_base + i->iov_offset; |
3567 |
+- bytes = min(bytes, i->iov->iov_len - i->iov_offset); |
3568 |
+- return fault_in_pages_readable(buf, bytes); |
3569 |
+- } |
3570 |
+- return 0; |
3571 |
+-} |
3572 |
+-EXPORT_SYMBOL(iov_iter_fault_in_readable); |
3573 |
+- |
3574 |
+-/* |
3575 |
+ * Fault in one or more iovecs of the given iov_iter, to a maximum length of |
3576 |
+ * bytes. For each iovec, fault in each page that constitutes the iovec. |
3577 |
+ * |
3578 |
+ * Return 0 on success, or non-zero if the memory could not be accessed (i.e. |
3579 |
+ * because it is an invalid address). |
3580 |
+ */ |
3581 |
+-int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes) |
3582 |
++int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes) |
3583 |
+ { |
3584 |
+ size_t skip = i->iov_offset; |
3585 |
+ const struct iovec *iov; |
3586 |
+@@ -341,7 +321,7 @@ int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes) |
3587 |
+ } |
3588 |
+ return 0; |
3589 |
+ } |
3590 |
+-EXPORT_SYMBOL(iov_iter_fault_in_multipages_readable); |
3591 |
++EXPORT_SYMBOL(iov_iter_fault_in_readable); |
3592 |
+ |
3593 |
+ void iov_iter_init(struct iov_iter *i, int direction, |
3594 |
+ const struct iovec *iov, unsigned long nr_segs, |
3595 |
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c |
3596 |
+index e8d3da0817d3..036b39eb1220 100644 |
3597 |
+--- a/net/ipv6/addrconf.c |
3598 |
++++ b/net/ipv6/addrconf.c |
3599 |
+@@ -1898,6 +1898,7 @@ errdad: |
3600 |
+ spin_unlock_bh(&ifp->lock); |
3601 |
+ |
3602 |
+ addrconf_mod_dad_work(ifp, 0); |
3603 |
++ in6_ifa_put(ifp); |
3604 |
+ } |
3605 |
+ |
3606 |
+ /* Join to solicited addr multicast group. |
3607 |
+@@ -3609,6 +3610,7 @@ static void addrconf_dad_work(struct work_struct *w) |
3608 |
+ addrconf_dad_begin(ifp); |
3609 |
+ goto out; |
3610 |
+ } else if (action == DAD_ABORT) { |
3611 |
++ in6_ifa_hold(ifp); |
3612 |
+ addrconf_dad_stop(ifp, 1); |
3613 |
+ goto out; |
3614 |
+ } |
3615 |
+diff --git a/net/tipc/link.c b/net/tipc/link.c |
3616 |
+index 91aea071ab27..72268eac4ec7 100644 |
3617 |
+--- a/net/tipc/link.c |
3618 |
++++ b/net/tipc/link.c |
3619 |
+@@ -1262,6 +1262,8 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, |
3620 |
+ /* fall thru' */ |
3621 |
+ |
3622 |
+ case ACTIVATE_MSG: |
3623 |
++ skb_linearize(skb); |
3624 |
++ hdr = buf_msg(skb); |
3625 |
+ |
3626 |
+ /* Complete own link name with peer's interface name */ |
3627 |
+ if_name = strrchr(l->name, ':') + 1; |
3628 |
+diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c |
3629 |
+index c07612bab95c..f51c8bdbea1c 100644 |
3630 |
+--- a/net/tipc/name_distr.c |
3631 |
++++ b/net/tipc/name_distr.c |
3632 |
+@@ -397,6 +397,7 @@ void tipc_named_rcv(struct net *net, struct sk_buff_head *inputq) |
3633 |
+ |
3634 |
+ spin_lock_bh(&tn->nametbl_lock); |
3635 |
+ for (skb = skb_dequeue(inputq); skb; skb = skb_dequeue(inputq)) { |
3636 |
++ skb_linearize(skb); |
3637 |
+ msg = buf_msg(skb); |
3638 |
+ mtype = msg_type(msg); |
3639 |
+ item = (struct distr_item *)msg_data(msg); |
3640 |
+diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c |
3641 |
+index 70c03271b798..6af78c6276b4 100644 |
3642 |
+--- a/net/tipc/udp_media.c |
3643 |
++++ b/net/tipc/udp_media.c |
3644 |
+@@ -48,7 +48,6 @@ |
3645 |
+ #include <linux/tipc_netlink.h> |
3646 |
+ #include "core.h" |
3647 |
+ #include "bearer.h" |
3648 |
+-#include "msg.h" |
3649 |
+ |
3650 |
+ /* IANA assigned UDP port */ |
3651 |
+ #define UDP_PORT_DEFAULT 6118 |
3652 |
+@@ -224,10 +223,6 @@ static int tipc_udp_recv(struct sock *sk, struct sk_buff *skb) |
3653 |
+ { |
3654 |
+ struct udp_bearer *ub; |
3655 |
+ struct tipc_bearer *b; |
3656 |
+- int usr = msg_user(buf_msg(skb)); |
3657 |
+- |
3658 |
+- if ((usr == LINK_PROTOCOL) || (usr == NAME_DISTRIBUTOR)) |
3659 |
+- skb_linearize(skb); |
3660 |
+ |
3661 |
+ ub = rcu_dereference_sk_user_data(sk); |
3662 |
+ if (!ub) { |
3663 |
+diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c |
3664 |
+index c753211cb83f..b50ee5d622e1 100644 |
3665 |
+--- a/net/wireless/wext-core.c |
3666 |
++++ b/net/wireless/wext-core.c |
3667 |
+@@ -955,29 +955,8 @@ static int wireless_process_ioctl(struct net *net, struct ifreq *ifr, |
3668 |
+ return private(dev, iwr, cmd, info, handler); |
3669 |
+ } |
3670 |
+ /* Old driver API : call driver ioctl handler */ |
3671 |
+- if (dev->netdev_ops->ndo_do_ioctl) { |
3672 |
+-#ifdef CONFIG_COMPAT |
3673 |
+- if (info->flags & IW_REQUEST_FLAG_COMPAT) { |
3674 |
+- int ret = 0; |
3675 |
+- struct iwreq iwr_lcl; |
3676 |
+- struct compat_iw_point *iwp_compat = (void *) &iwr->u.data; |
3677 |
+- |
3678 |
+- memcpy(&iwr_lcl, iwr, sizeof(struct iwreq)); |
3679 |
+- iwr_lcl.u.data.pointer = compat_ptr(iwp_compat->pointer); |
3680 |
+- iwr_lcl.u.data.length = iwp_compat->length; |
3681 |
+- iwr_lcl.u.data.flags = iwp_compat->flags; |
3682 |
+- |
3683 |
+- ret = dev->netdev_ops->ndo_do_ioctl(dev, (void *) &iwr_lcl, cmd); |
3684 |
+- |
3685 |
+- iwp_compat->pointer = ptr_to_compat(iwr_lcl.u.data.pointer); |
3686 |
+- iwp_compat->length = iwr_lcl.u.data.length; |
3687 |
+- iwp_compat->flags = iwr_lcl.u.data.flags; |
3688 |
+- |
3689 |
+- return ret; |
3690 |
+- } else |
3691 |
+-#endif |
3692 |
+- return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd); |
3693 |
+- } |
3694 |
++ if (dev->netdev_ops->ndo_do_ioctl) |
3695 |
++ return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd); |
3696 |
+ return -EOPNOTSUPP; |
3697 |
+ } |
3698 |
+ |