1 |
commit: 87fae04b9002143c5b0a9d9d6c63804e30fd2849 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 26 15:03:22 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 26 15:03:22 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=87fae04b |
7 |
|
8 |
proj/linux-patches: Linux patch 4.9.153 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1152_linux-4.9.153.patch | 1094 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1098 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index da300b6..f17614f 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -651,6 +651,10 @@ Patch: 1151_linux-4.9.152.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.152 |
23 |
|
24 |
+Patch: 1152_linux-4.9.153.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.153 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1152_linux-4.9.153.patch b/1152_linux-4.9.153.patch |
33 |
new file mode 100644 |
34 |
index 0000000..0e8d271 |
35 |
--- /dev/null |
36 |
+++ b/1152_linux-4.9.153.patch |
37 |
@@ -0,0 +1,1094 @@ |
38 |
+diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt |
39 |
+index 74329fd0add2..077c37ed976f 100644 |
40 |
+--- a/Documentation/filesystems/proc.txt |
41 |
++++ b/Documentation/filesystems/proc.txt |
42 |
+@@ -484,7 +484,9 @@ manner. The codes are the following: |
43 |
+ |
44 |
+ Note that there is no guarantee that every flag and associated mnemonic will |
45 |
+ be present in all further kernel releases. Things get changed, the flags may |
46 |
+-be vanished or the reverse -- new added. |
47 |
++be vanished or the reverse -- new added. Interpretation of their meaning |
48 |
++might change in future as well. So each consumer of these flags has to |
49 |
++follow each specific kernel version for the exact semantic. |
50 |
+ |
51 |
+ This file is only present if the CONFIG_MMU kernel configuration option is |
52 |
+ enabled. |
53 |
+diff --git a/Makefile b/Makefile |
54 |
+index 27a9292fc0ed..44a487ee24d2 100644 |
55 |
+--- a/Makefile |
56 |
++++ b/Makefile |
57 |
+@@ -1,6 +1,6 @@ |
58 |
+ VERSION = 4 |
59 |
+ PATCHLEVEL = 9 |
60 |
+-SUBLEVEL = 152 |
61 |
++SUBLEVEL = 153 |
62 |
+ EXTRAVERSION = |
63 |
+ NAME = Roaring Lionus |
64 |
+ |
65 |
+diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c |
66 |
+index 199a23f058d5..0770d6d1c37f 100644 |
67 |
+--- a/arch/arm64/kernel/perf_event.c |
68 |
++++ b/arch/arm64/kernel/perf_event.c |
69 |
+@@ -1114,6 +1114,7 @@ static struct platform_driver armv8_pmu_driver = { |
70 |
+ .driver = { |
71 |
+ .name = ARMV8_PMU_PDEV_NAME, |
72 |
+ .of_match_table = armv8_pmu_of_device_ids, |
73 |
++ .suppress_bind_attrs = true, |
74 |
+ }, |
75 |
+ .probe = armv8_pmu_device_probe, |
76 |
+ }; |
77 |
+diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig |
78 |
+index 1d987061d1a1..bb9940c6927e 100644 |
79 |
+--- a/arch/mips/Kconfig |
80 |
++++ b/arch/mips/Kconfig |
81 |
+@@ -791,6 +791,7 @@ config SIBYTE_SWARM |
82 |
+ select SYS_SUPPORTS_HIGHMEM |
83 |
+ select SYS_SUPPORTS_LITTLE_ENDIAN |
84 |
+ select ZONE_DMA32 if 64BIT |
85 |
++ select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI |
86 |
+ |
87 |
+ config SIBYTE_LITTLESUR |
88 |
+ bool "Sibyte BCM91250C2-LittleSur" |
89 |
+@@ -813,6 +814,7 @@ config SIBYTE_SENTOSA |
90 |
+ select SYS_HAS_CPU_SB1 |
91 |
+ select SYS_SUPPORTS_BIG_ENDIAN |
92 |
+ select SYS_SUPPORTS_LITTLE_ENDIAN |
93 |
++ select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI |
94 |
+ |
95 |
+ config SIBYTE_BIGSUR |
96 |
+ bool "Sibyte BCM91480B-BigSur" |
97 |
+@@ -826,6 +828,7 @@ config SIBYTE_BIGSUR |
98 |
+ select SYS_SUPPORTS_HIGHMEM |
99 |
+ select SYS_SUPPORTS_LITTLE_ENDIAN |
100 |
+ select ZONE_DMA32 if 64BIT |
101 |
++ select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI |
102 |
+ |
103 |
+ config SNI_RM |
104 |
+ bool "SNI RM200/300/400" |
105 |
+diff --git a/arch/mips/sibyte/common/Makefile b/arch/mips/sibyte/common/Makefile |
106 |
+index b3d6bf23a662..3ef3fb658136 100644 |
107 |
+--- a/arch/mips/sibyte/common/Makefile |
108 |
++++ b/arch/mips/sibyte/common/Makefile |
109 |
+@@ -1,4 +1,5 @@ |
110 |
+ obj-y := cfe.o |
111 |
++obj-$(CONFIG_SWIOTLB) += dma.o |
112 |
+ obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o |
113 |
+ obj-$(CONFIG_SIBYTE_CFE_CONSOLE) += cfe_console.o |
114 |
+ obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o |
115 |
+diff --git a/arch/mips/sibyte/common/dma.c b/arch/mips/sibyte/common/dma.c |
116 |
+new file mode 100644 |
117 |
+index 000000000000..eb47a94f3583 |
118 |
+--- /dev/null |
119 |
++++ b/arch/mips/sibyte/common/dma.c |
120 |
+@@ -0,0 +1,14 @@ |
121 |
++// SPDX-License-Identifier: GPL-2.0+ |
122 |
++/* |
123 |
++ * DMA support for Broadcom SiByte platforms. |
124 |
++ * |
125 |
++ * Copyright (c) 2018 Maciej W. Rozycki |
126 |
++ */ |
127 |
++ |
128 |
++#include <linux/swiotlb.h> |
129 |
++#include <asm/bootinfo.h> |
130 |
++ |
131 |
++void __init plat_swiotlb_setup(void) |
132 |
++{ |
133 |
++ swiotlb_init(1); |
134 |
++} |
135 |
+diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c |
136 |
+index 760545519a0b..687e8b8bf5c6 100644 |
137 |
+--- a/arch/powerpc/xmon/xmon.c |
138 |
++++ b/arch/powerpc/xmon/xmon.c |
139 |
+@@ -73,6 +73,9 @@ static int xmon_gate; |
140 |
+ #define xmon_owner 0 |
141 |
+ #endif /* CONFIG_SMP */ |
142 |
+ |
143 |
++#ifdef CONFIG_PPC_PSERIES |
144 |
++static int set_indicator_token = RTAS_UNKNOWN_SERVICE; |
145 |
++#endif |
146 |
+ static unsigned long in_xmon __read_mostly = 0; |
147 |
+ |
148 |
+ static unsigned long adrs; |
149 |
+@@ -340,7 +343,6 @@ static inline void disable_surveillance(void) |
150 |
+ #ifdef CONFIG_PPC_PSERIES |
151 |
+ /* Since this can't be a module, args should end up below 4GB. */ |
152 |
+ static struct rtas_args args; |
153 |
+- int token; |
154 |
+ |
155 |
+ /* |
156 |
+ * At this point we have got all the cpus we can into |
157 |
+@@ -349,11 +351,11 @@ static inline void disable_surveillance(void) |
158 |
+ * If we did try to take rtas.lock there would be a |
159 |
+ * real possibility of deadlock. |
160 |
+ */ |
161 |
+- token = rtas_token("set-indicator"); |
162 |
+- if (token == RTAS_UNKNOWN_SERVICE) |
163 |
++ if (set_indicator_token == RTAS_UNKNOWN_SERVICE) |
164 |
+ return; |
165 |
+ |
166 |
+- rtas_call_unlocked(&args, token, 3, 1, NULL, SURVEILLANCE_TOKEN, 0, 0); |
167 |
++ rtas_call_unlocked(&args, set_indicator_token, 3, 1, NULL, |
168 |
++ SURVEILLANCE_TOKEN, 0, 0); |
169 |
+ |
170 |
+ #endif /* CONFIG_PPC_PSERIES */ |
171 |
+ } |
172 |
+@@ -3227,6 +3229,14 @@ static void xmon_init(int enable) |
173 |
+ __debugger_iabr_match = xmon_iabr_match; |
174 |
+ __debugger_break_match = xmon_break_match; |
175 |
+ __debugger_fault_handler = xmon_fault_handler; |
176 |
++ |
177 |
++#ifdef CONFIG_PPC_PSERIES |
178 |
++ /* |
179 |
++ * Get the token here to avoid trying to get a lock |
180 |
++ * during the crash, causing a deadlock. |
181 |
++ */ |
182 |
++ set_indicator_token = rtas_token("set-indicator"); |
183 |
++#endif |
184 |
+ } else { |
185 |
+ __debugger = NULL; |
186 |
+ __debugger_ipi = NULL; |
187 |
+diff --git a/drivers/base/bus.c b/drivers/base/bus.c |
188 |
+index e32a74eb28a3..a7ae9a0e8a78 100644 |
189 |
+--- a/drivers/base/bus.c |
190 |
++++ b/drivers/base/bus.c |
191 |
+@@ -33,6 +33,9 @@ static struct kset *system_kset; |
192 |
+ |
193 |
+ #define to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr) |
194 |
+ |
195 |
++#define DRIVER_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \ |
196 |
++ struct driver_attribute driver_attr_##_name = \ |
197 |
++ __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) |
198 |
+ |
199 |
+ static int __must_check bus_rescan_devices_helper(struct device *dev, |
200 |
+ void *data); |
201 |
+@@ -197,7 +200,7 @@ static ssize_t unbind_store(struct device_driver *drv, const char *buf, |
202 |
+ bus_put(bus); |
203 |
+ return err; |
204 |
+ } |
205 |
+-static DRIVER_ATTR_WO(unbind); |
206 |
++static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, S_IWUSR, NULL, unbind_store); |
207 |
+ |
208 |
+ /* |
209 |
+ * Manually attach a device to a driver. |
210 |
+@@ -233,7 +236,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf, |
211 |
+ bus_put(bus); |
212 |
+ return err; |
213 |
+ } |
214 |
+-static DRIVER_ATTR_WO(bind); |
215 |
++static DRIVER_ATTR_IGNORE_LOCKDEP(bind, S_IWUSR, NULL, bind_store); |
216 |
+ |
217 |
+ static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf) |
218 |
+ { |
219 |
+diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c |
220 |
+index a0bb52bc6582..dac36ef450ba 100644 |
221 |
+--- a/drivers/char/ipmi/ipmi_ssif.c |
222 |
++++ b/drivers/char/ipmi/ipmi_ssif.c |
223 |
+@@ -641,8 +641,9 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, |
224 |
+ |
225 |
+ /* Remove the multi-part read marker. */ |
226 |
+ len -= 2; |
227 |
++ data += 2; |
228 |
+ for (i = 0; i < len; i++) |
229 |
+- ssif_info->data[i] = data[i+2]; |
230 |
++ ssif_info->data[i] = data[i]; |
231 |
+ ssif_info->multi_len = len; |
232 |
+ ssif_info->multi_pos = 1; |
233 |
+ |
234 |
+@@ -670,8 +671,19 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, |
235 |
+ } |
236 |
+ |
237 |
+ blocknum = data[0]; |
238 |
++ len--; |
239 |
++ data++; |
240 |
++ |
241 |
++ if (blocknum != 0xff && len != 31) { |
242 |
++ /* All blocks but the last must have 31 data bytes. */ |
243 |
++ result = -EIO; |
244 |
++ if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) |
245 |
++ pr_info("Received middle message <31\n"); |
246 |
+ |
247 |
+- if (ssif_info->multi_len + len - 1 > IPMI_MAX_MSG_LENGTH) { |
248 |
++ goto continue_op; |
249 |
++ } |
250 |
++ |
251 |
++ if (ssif_info->multi_len + len > IPMI_MAX_MSG_LENGTH) { |
252 |
+ /* Received message too big, abort the operation. */ |
253 |
+ result = -E2BIG; |
254 |
+ if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) |
255 |
+@@ -680,16 +692,14 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, |
256 |
+ goto continue_op; |
257 |
+ } |
258 |
+ |
259 |
+- /* Remove the blocknum from the data. */ |
260 |
+- len--; |
261 |
+ for (i = 0; i < len; i++) |
262 |
+- ssif_info->data[i + ssif_info->multi_len] = data[i + 1]; |
263 |
++ ssif_info->data[i + ssif_info->multi_len] = data[i]; |
264 |
+ ssif_info->multi_len += len; |
265 |
+ if (blocknum == 0xff) { |
266 |
+ /* End of read */ |
267 |
+ len = ssif_info->multi_len; |
268 |
+ data = ssif_info->data; |
269 |
+- } else if (blocknum + 1 != ssif_info->multi_pos) { |
270 |
++ } else if (blocknum != ssif_info->multi_pos) { |
271 |
+ /* |
272 |
+ * Out of sequence block, just abort. Block |
273 |
+ * numbers start at zero for the second block, |
274 |
+@@ -717,6 +727,7 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, |
275 |
+ } |
276 |
+ } |
277 |
+ |
278 |
++ continue_op: |
279 |
+ if (result < 0) { |
280 |
+ ssif_inc_stat(ssif_info, receive_errors); |
281 |
+ } else { |
282 |
+@@ -724,8 +735,6 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, |
283 |
+ ssif_inc_stat(ssif_info, received_message_parts); |
284 |
+ } |
285 |
+ |
286 |
+- |
287 |
+- continue_op: |
288 |
+ if (ssif_info->ssif_debug & SSIF_DEBUG_STATE) |
289 |
+ pr_info(PFX "DONE 1: state = %d, result=%d.\n", |
290 |
+ ssif_info->ssif_state, result); |
291 |
+diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c |
292 |
+index 93a19667003d..14682df5d312 100644 |
293 |
+--- a/drivers/clk/imx/clk-imx6q.c |
294 |
++++ b/drivers/clk/imx/clk-imx6q.c |
295 |
+@@ -258,8 +258,12 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) |
296 |
+ * lvds1_gate and lvds2_gate are pseudo-gates. Both can be |
297 |
+ * independently configured as clock inputs or outputs. We treat |
298 |
+ * the "output_enable" bit as a gate, even though it's really just |
299 |
+- * enabling clock output. |
300 |
++ * enabling clock output. Initially the gate bits are cleared, as |
301 |
++ * otherwise the exclusive configuration gets locked in the setup done |
302 |
++ * by software running before the clock driver, with no way to change |
303 |
++ * it. |
304 |
+ */ |
305 |
++ writel(readl(base + 0x160) & ~0x3c00, base + 0x160); |
306 |
+ clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12)); |
307 |
+ clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13)); |
308 |
+ |
309 |
+diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c |
310 |
+index 166ccd711ec9..83203c59bf59 100644 |
311 |
+--- a/drivers/cpuidle/cpuidle-pseries.c |
312 |
++++ b/drivers/cpuidle/cpuidle-pseries.c |
313 |
+@@ -230,7 +230,13 @@ static int pseries_idle_probe(void) |
314 |
+ return -ENODEV; |
315 |
+ |
316 |
+ if (firmware_has_feature(FW_FEATURE_SPLPAR)) { |
317 |
+- if (lppaca_shared_proc(get_lppaca())) { |
318 |
++ /* |
319 |
++ * Use local_paca instead of get_lppaca() since |
320 |
++ * preemption is not disabled, and it is not required in |
321 |
++ * fact, since lppaca_ptr does not need to be the value |
322 |
++ * associated to the current CPU, it can be from any CPU. |
323 |
++ */ |
324 |
++ if (lppaca_shared_proc(local_paca->lppaca_ptr)) { |
325 |
+ cpuidle_state_table = shared_states; |
326 |
+ max_idle_state = ARRAY_SIZE(shared_states); |
327 |
+ } else { |
328 |
+diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c |
329 |
+index 47219ebd8ff2..0f9fe2ca2a91 100644 |
330 |
+--- a/drivers/infiniband/sw/rxe/rxe_req.c |
331 |
++++ b/drivers/infiniband/sw/rxe/rxe_req.c |
332 |
+@@ -643,6 +643,7 @@ next_wqe: |
333 |
+ rmr->access = wqe->wr.wr.reg.access; |
334 |
+ rmr->lkey = wqe->wr.wr.reg.key; |
335 |
+ rmr->rkey = wqe->wr.wr.reg.key; |
336 |
++ rmr->iova = wqe->wr.wr.reg.mr->iova; |
337 |
+ wqe->state = wqe_state_done; |
338 |
+ wqe->status = IB_WC_SUCCESS; |
339 |
+ } else { |
340 |
+diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c |
341 |
+index 56fcccc30554..e0cfde3501e0 100644 |
342 |
+--- a/drivers/md/dm-kcopyd.c |
343 |
++++ b/drivers/md/dm-kcopyd.c |
344 |
+@@ -55,15 +55,17 @@ struct dm_kcopyd_client { |
345 |
+ struct dm_kcopyd_throttle *throttle; |
346 |
+ |
347 |
+ /* |
348 |
+- * We maintain three lists of jobs: |
349 |
++ * We maintain four lists of jobs: |
350 |
+ * |
351 |
+ * i) jobs waiting for pages |
352 |
+ * ii) jobs that have pages, and are waiting for the io to be issued. |
353 |
+- * iii) jobs that have completed. |
354 |
++ * iii) jobs that don't need to do any IO and just run a callback |
355 |
++ * iv) jobs that have completed. |
356 |
+ * |
357 |
+- * All three of these are protected by job_lock. |
358 |
++ * All four of these are protected by job_lock. |
359 |
+ */ |
360 |
+ spinlock_t job_lock; |
361 |
++ struct list_head callback_jobs; |
362 |
+ struct list_head complete_jobs; |
363 |
+ struct list_head io_jobs; |
364 |
+ struct list_head pages_jobs; |
365 |
+@@ -584,6 +586,7 @@ static void do_work(struct work_struct *work) |
366 |
+ struct dm_kcopyd_client *kc = container_of(work, |
367 |
+ struct dm_kcopyd_client, kcopyd_work); |
368 |
+ struct blk_plug plug; |
369 |
++ unsigned long flags; |
370 |
+ |
371 |
+ /* |
372 |
+ * The order that these are called is *very* important. |
373 |
+@@ -592,6 +595,10 @@ static void do_work(struct work_struct *work) |
374 |
+ * list. io jobs call wake when they complete and it all |
375 |
+ * starts again. |
376 |
+ */ |
377 |
++ spin_lock_irqsave(&kc->job_lock, flags); |
378 |
++ list_splice_tail_init(&kc->callback_jobs, &kc->complete_jobs); |
379 |
++ spin_unlock_irqrestore(&kc->job_lock, flags); |
380 |
++ |
381 |
+ blk_start_plug(&plug); |
382 |
+ process_jobs(&kc->complete_jobs, kc, run_complete_job); |
383 |
+ process_jobs(&kc->pages_jobs, kc, run_pages_job); |
384 |
+@@ -609,7 +616,7 @@ static void dispatch_job(struct kcopyd_job *job) |
385 |
+ struct dm_kcopyd_client *kc = job->kc; |
386 |
+ atomic_inc(&kc->nr_jobs); |
387 |
+ if (unlikely(!job->source.count)) |
388 |
+- push(&kc->complete_jobs, job); |
389 |
++ push(&kc->callback_jobs, job); |
390 |
+ else if (job->pages == &zero_page_list) |
391 |
+ push(&kc->io_jobs, job); |
392 |
+ else |
393 |
+@@ -796,7 +803,7 @@ void dm_kcopyd_do_callback(void *j, int read_err, unsigned long write_err) |
394 |
+ job->read_err = read_err; |
395 |
+ job->write_err = write_err; |
396 |
+ |
397 |
+- push(&kc->complete_jobs, job); |
398 |
++ push(&kc->callback_jobs, job); |
399 |
+ wake(kc); |
400 |
+ } |
401 |
+ EXPORT_SYMBOL(dm_kcopyd_do_callback); |
402 |
+@@ -826,6 +833,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *thro |
403 |
+ return ERR_PTR(-ENOMEM); |
404 |
+ |
405 |
+ spin_lock_init(&kc->job_lock); |
406 |
++ INIT_LIST_HEAD(&kc->callback_jobs); |
407 |
+ INIT_LIST_HEAD(&kc->complete_jobs); |
408 |
+ INIT_LIST_HEAD(&kc->io_jobs); |
409 |
+ INIT_LIST_HEAD(&kc->pages_jobs); |
410 |
+@@ -875,6 +883,7 @@ void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc) |
411 |
+ /* Wait for completion of all jobs submitted by this client. */ |
412 |
+ wait_event(kc->destroyq, !atomic_read(&kc->nr_jobs)); |
413 |
+ |
414 |
++ BUG_ON(!list_empty(&kc->callback_jobs)); |
415 |
+ BUG_ON(!list_empty(&kc->complete_jobs)); |
416 |
+ BUG_ON(!list_empty(&kc->io_jobs)); |
417 |
+ BUG_ON(!list_empty(&kc->pages_jobs)); |
418 |
+diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c |
419 |
+index c65feeada864..2da0b9b213c7 100644 |
420 |
+--- a/drivers/md/dm-snap.c |
421 |
++++ b/drivers/md/dm-snap.c |
422 |
+@@ -19,6 +19,7 @@ |
423 |
+ #include <linux/vmalloc.h> |
424 |
+ #include <linux/log2.h> |
425 |
+ #include <linux/dm-kcopyd.h> |
426 |
++#include <linux/semaphore.h> |
427 |
+ |
428 |
+ #include "dm.h" |
429 |
+ |
430 |
+@@ -105,6 +106,9 @@ struct dm_snapshot { |
431 |
+ /* The on disk metadata handler */ |
432 |
+ struct dm_exception_store *store; |
433 |
+ |
434 |
++ /* Maximum number of in-flight COW jobs. */ |
435 |
++ struct semaphore cow_count; |
436 |
++ |
437 |
+ struct dm_kcopyd_client *kcopyd_client; |
438 |
+ |
439 |
+ /* Wait for events based on state_bits */ |
440 |
+@@ -145,6 +149,19 @@ struct dm_snapshot { |
441 |
+ #define RUNNING_MERGE 0 |
442 |
+ #define SHUTDOWN_MERGE 1 |
443 |
+ |
444 |
++/* |
445 |
++ * Maximum number of chunks being copied on write. |
446 |
++ * |
447 |
++ * The value was decided experimentally as a trade-off between memory |
448 |
++ * consumption, stalling the kernel's workqueues and maintaining a high enough |
449 |
++ * throughput. |
450 |
++ */ |
451 |
++#define DEFAULT_COW_THRESHOLD 2048 |
452 |
++ |
453 |
++static int cow_threshold = DEFAULT_COW_THRESHOLD; |
454 |
++module_param_named(snapshot_cow_threshold, cow_threshold, int, 0644); |
455 |
++MODULE_PARM_DESC(snapshot_cow_threshold, "Maximum number of chunks being copied on write"); |
456 |
++ |
457 |
+ DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(snapshot_copy_throttle, |
458 |
+ "A percentage of time allocated for copy on write"); |
459 |
+ |
460 |
+@@ -1189,6 +1206,8 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) |
461 |
+ goto bad_hash_tables; |
462 |
+ } |
463 |
+ |
464 |
++ sema_init(&s->cow_count, (cow_threshold > 0) ? cow_threshold : INT_MAX); |
465 |
++ |
466 |
+ s->kcopyd_client = dm_kcopyd_client_create(&dm_kcopyd_throttle); |
467 |
+ if (IS_ERR(s->kcopyd_client)) { |
468 |
+ r = PTR_ERR(s->kcopyd_client); |
469 |
+@@ -1560,6 +1579,7 @@ static void copy_callback(int read_err, unsigned long write_err, void *context) |
470 |
+ } |
471 |
+ list_add(&pe->out_of_order_entry, lh); |
472 |
+ } |
473 |
++ up(&s->cow_count); |
474 |
+ } |
475 |
+ |
476 |
+ /* |
477 |
+@@ -1583,6 +1603,7 @@ static void start_copy(struct dm_snap_pending_exception *pe) |
478 |
+ dest.count = src.count; |
479 |
+ |
480 |
+ /* Hand over to kcopyd */ |
481 |
++ down(&s->cow_count); |
482 |
+ dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe); |
483 |
+ } |
484 |
+ |
485 |
+@@ -1602,6 +1623,7 @@ static void start_full_bio(struct dm_snap_pending_exception *pe, |
486 |
+ pe->full_bio = bio; |
487 |
+ pe->full_bio_end_io = bio->bi_end_io; |
488 |
+ |
489 |
++ down(&s->cow_count); |
490 |
+ callback_data = dm_kcopyd_prepare_callback(s->kcopyd_client, |
491 |
+ copy_callback, pe); |
492 |
+ |
493 |
+diff --git a/drivers/media/firewire/firedtv-avc.c b/drivers/media/firewire/firedtv-avc.c |
494 |
+index 251a556112a9..280b5ffea592 100644 |
495 |
+--- a/drivers/media/firewire/firedtv-avc.c |
496 |
++++ b/drivers/media/firewire/firedtv-avc.c |
497 |
+@@ -968,7 +968,8 @@ static int get_ca_object_length(struct avc_response_frame *r) |
498 |
+ return r->operand[7]; |
499 |
+ } |
500 |
+ |
501 |
+-int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len) |
502 |
++int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info, |
503 |
++ unsigned int *len) |
504 |
+ { |
505 |
+ struct avc_command_frame *c = (void *)fdtv->avc_data; |
506 |
+ struct avc_response_frame *r = (void *)fdtv->avc_data; |
507 |
+@@ -1009,7 +1010,8 @@ out: |
508 |
+ return ret; |
509 |
+ } |
510 |
+ |
511 |
+-int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len) |
512 |
++int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info, |
513 |
++ unsigned int *len) |
514 |
+ { |
515 |
+ struct avc_command_frame *c = (void *)fdtv->avc_data; |
516 |
+ struct avc_response_frame *r = (void *)fdtv->avc_data; |
517 |
+diff --git a/drivers/media/firewire/firedtv.h b/drivers/media/firewire/firedtv.h |
518 |
+index 345d1eda8c05..5b18a08c6285 100644 |
519 |
+--- a/drivers/media/firewire/firedtv.h |
520 |
++++ b/drivers/media/firewire/firedtv.h |
521 |
+@@ -124,8 +124,10 @@ int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst, |
522 |
+ struct dvb_diseqc_master_cmd *diseqcmd); |
523 |
+ void avc_remote_ctrl_work(struct work_struct *work); |
524 |
+ int avc_register_remote_control(struct firedtv *fdtv); |
525 |
+-int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len); |
526 |
+-int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len); |
527 |
++int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info, |
528 |
++ unsigned int *len); |
529 |
++int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info, |
530 |
++ unsigned int *len); |
531 |
+ int avc_ca_reset(struct firedtv *fdtv); |
532 |
+ int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length); |
533 |
+ int avc_ca_get_time_date(struct firedtv *fdtv, int *interval); |
534 |
+diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c |
535 |
+index 0ad8ef565b74..b73d68e7b195 100644 |
536 |
+--- a/drivers/mmc/host/atmel-mci.c |
537 |
++++ b/drivers/mmc/host/atmel-mci.c |
538 |
+@@ -1984,13 +1984,14 @@ static void atmci_tasklet_func(unsigned long priv) |
539 |
+ } |
540 |
+ |
541 |
+ atmci_request_end(host, host->mrq); |
542 |
+- state = STATE_IDLE; |
543 |
++ goto unlock; /* atmci_request_end() sets host->state */ |
544 |
+ break; |
545 |
+ } |
546 |
+ } while (state != prev_state); |
547 |
+ |
548 |
+ host->state = state; |
549 |
+ |
550 |
++unlock: |
551 |
+ spin_unlock(&host->lock); |
552 |
+ } |
553 |
+ |
554 |
+diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c |
555 |
+index ad03763e009a..a9f8edc17827 100644 |
556 |
+--- a/drivers/net/ethernet/intel/e1000e/ptp.c |
557 |
++++ b/drivers/net/ethernet/intel/e1000e/ptp.c |
558 |
+@@ -191,10 +191,14 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) |
559 |
+ struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, |
560 |
+ ptp_clock_info); |
561 |
+ unsigned long flags; |
562 |
+- u64 ns; |
563 |
++ u64 cycles, ns; |
564 |
+ |
565 |
+ spin_lock_irqsave(&adapter->systim_lock, flags); |
566 |
+- ns = timecounter_read(&adapter->tc); |
567 |
++ |
568 |
++ /* Use timecounter_cyc2time() to allow non-monotonic SYSTIM readings */ |
569 |
++ cycles = adapter->cc.read(&adapter->cc); |
570 |
++ ns = timecounter_cyc2time(&adapter->tc, cycles); |
571 |
++ |
572 |
+ spin_unlock_irqrestore(&adapter->systim_lock, flags); |
573 |
+ |
574 |
+ *ts = ns_to_timespec64(ns); |
575 |
+@@ -250,9 +254,12 @@ static void e1000e_systim_overflow_work(struct work_struct *work) |
576 |
+ systim_overflow_work.work); |
577 |
+ struct e1000_hw *hw = &adapter->hw; |
578 |
+ struct timespec64 ts; |
579 |
++ u64 ns; |
580 |
+ |
581 |
+- adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts); |
582 |
++ /* Update the timecounter */ |
583 |
++ ns = timecounter_read(&adapter->tc); |
584 |
+ |
585 |
++ ts = ns_to_timespec64(ns); |
586 |
+ e_dbg("SYSTIM overflow check at %lld.%09lu\n", |
587 |
+ (long long) ts.tv_sec, ts.tv_nsec); |
588 |
+ |
589 |
+diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c |
590 |
+index 24754d3fb0ac..7a4393ffe98e 100644 |
591 |
+--- a/drivers/net/ethernet/realtek/r8169.c |
592 |
++++ b/drivers/net/ethernet/realtek/r8169.c |
593 |
+@@ -324,6 +324,8 @@ enum cfg_version { |
594 |
+ }; |
595 |
+ |
596 |
+ static const struct pci_device_id rtl8169_pci_tbl[] = { |
597 |
++ { PCI_VDEVICE(REALTEK, 0x2502), RTL_CFG_1 }, |
598 |
++ { PCI_VDEVICE(REALTEK, 0x2600), RTL_CFG_1 }, |
599 |
+ { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8129), 0, 0, RTL_CFG_0 }, |
600 |
+ { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8136), 0, 0, RTL_CFG_2 }, |
601 |
+ { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8161), 0, 0, RTL_CFG_1 }, |
602 |
+diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c |
603 |
+index ed277685da1d..10bd13b30178 100644 |
604 |
+--- a/drivers/platform/x86/asus-wmi.c |
605 |
++++ b/drivers/platform/x86/asus-wmi.c |
606 |
+@@ -2154,7 +2154,8 @@ static int asus_wmi_add(struct platform_device *pdev) |
607 |
+ err = asus_wmi_backlight_init(asus); |
608 |
+ if (err && err != -ENODEV) |
609 |
+ goto fail_backlight; |
610 |
+- } |
611 |
++ } else |
612 |
++ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL); |
613 |
+ |
614 |
+ status = wmi_install_notify_handler(asus->driver->event_guid, |
615 |
+ asus_wmi_notify, asus); |
616 |
+diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c |
617 |
+index e413113c86ac..663d8f503c86 100644 |
618 |
+--- a/drivers/scsi/megaraid/megaraid_sas_fp.c |
619 |
++++ b/drivers/scsi/megaraid/megaraid_sas_fp.c |
620 |
+@@ -1275,7 +1275,7 @@ void mr_update_load_balance_params(struct MR_DRV_RAID_MAP_ALL *drv_map, |
621 |
+ |
622 |
+ for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) { |
623 |
+ ld = MR_TargetIdToLdGet(ldCount, drv_map); |
624 |
+- if (ld >= MAX_LOGICAL_DRIVES_EXT) { |
625 |
++ if (ld >= MAX_LOGICAL_DRIVES_EXT - 1) { |
626 |
+ lbInfo[ldCount].loadBalanceFlag = 0; |
627 |
+ continue; |
628 |
+ } |
629 |
+diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
630 |
+index f722a0e6caa4..fe1a20973e47 100644 |
631 |
+--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c |
632 |
++++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
633 |
+@@ -1902,7 +1902,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance, |
634 |
+ device_id < instance->fw_supported_vd_count)) { |
635 |
+ |
636 |
+ ld = MR_TargetIdToLdGet(device_id, local_map_ptr); |
637 |
+- if (ld >= instance->fw_supported_vd_count) |
638 |
++ if (ld >= instance->fw_supported_vd_count - 1) |
639 |
+ fp_possible = 0; |
640 |
+ |
641 |
+ raid = MR_LdRaidGet(ld, local_map_ptr); |
642 |
+diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c |
643 |
+index 96a343ec8313..b2b969990a5d 100644 |
644 |
+--- a/drivers/scsi/smartpqi/smartpqi_init.c |
645 |
++++ b/drivers/scsi/smartpqi/smartpqi_init.c |
646 |
+@@ -2523,6 +2523,9 @@ static unsigned int pqi_process_io_intr(struct pqi_ctrl_info *ctrl_info, |
647 |
+ switch (response->header.iu_type) { |
648 |
+ case PQI_RESPONSE_IU_RAID_PATH_IO_SUCCESS: |
649 |
+ case PQI_RESPONSE_IU_AIO_PATH_IO_SUCCESS: |
650 |
++ if (io_request->scmd) |
651 |
++ io_request->scmd->result = 0; |
652 |
++ /* fall through */ |
653 |
+ case PQI_RESPONSE_IU_GENERAL_MANAGEMENT: |
654 |
+ break; |
655 |
+ case PQI_RESPONSE_IU_TASK_MANAGEMENT: |
656 |
+diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c |
657 |
+index 2a91ed3ef380..37d7d57cf2c6 100644 |
658 |
+--- a/drivers/target/target_core_spc.c |
659 |
++++ b/drivers/target/target_core_spc.c |
660 |
+@@ -108,12 +108,17 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf) |
661 |
+ |
662 |
+ buf[7] = 0x2; /* CmdQue=1 */ |
663 |
+ |
664 |
+- memcpy(&buf[8], "LIO-ORG ", 8); |
665 |
+- memset(&buf[16], 0x20, 16); |
666 |
++ /* |
667 |
++ * ASCII data fields described as being left-aligned shall have any |
668 |
++ * unused bytes at the end of the field (i.e., highest offset) and the |
669 |
++ * unused bytes shall be filled with ASCII space characters (20h). |
670 |
++ */ |
671 |
++ memset(&buf[8], 0x20, 8 + 16 + 4); |
672 |
++ memcpy(&buf[8], "LIO-ORG", sizeof("LIO-ORG") - 1); |
673 |
+ memcpy(&buf[16], dev->t10_wwn.model, |
674 |
+- min_t(size_t, strlen(dev->t10_wwn.model), 16)); |
675 |
++ strnlen(dev->t10_wwn.model, 16)); |
676 |
+ memcpy(&buf[32], dev->t10_wwn.revision, |
677 |
+- min_t(size_t, strlen(dev->t10_wwn.revision), 4)); |
678 |
++ strnlen(dev->t10_wwn.revision, 4)); |
679 |
+ buf[4] = 31; /* Set additional length to 31 */ |
680 |
+ |
681 |
+ return 0; |
682 |
+@@ -251,7 +256,9 @@ check_t10_vend_desc: |
683 |
+ buf[off] = 0x2; /* ASCII */ |
684 |
+ buf[off+1] = 0x1; /* T10 Vendor ID */ |
685 |
+ buf[off+2] = 0x0; |
686 |
+- memcpy(&buf[off+4], "LIO-ORG", 8); |
687 |
++ /* left align Vendor ID and pad with spaces */ |
688 |
++ memset(&buf[off+4], 0x20, 8); |
689 |
++ memcpy(&buf[off+4], "LIO-ORG", sizeof("LIO-ORG") - 1); |
690 |
+ /* Extra Byte for NULL Terminator */ |
691 |
+ id_len++; |
692 |
+ /* Identifier Length */ |
693 |
+diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c |
694 |
+index 41b0dd67fcce..2d8089fc2139 100644 |
695 |
+--- a/drivers/tty/serial/amba-pl011.c |
696 |
++++ b/drivers/tty/serial/amba-pl011.c |
697 |
+@@ -2712,6 +2712,7 @@ static struct platform_driver arm_sbsa_uart_platform_driver = { |
698 |
+ .name = "sbsa-uart", |
699 |
+ .of_match_table = of_match_ptr(sbsa_uart_of_match), |
700 |
+ .acpi_match_table = ACPI_PTR(sbsa_uart_acpi_match), |
701 |
++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_AMBA_PL011), |
702 |
+ }, |
703 |
+ }; |
704 |
+ |
705 |
+@@ -2740,6 +2741,7 @@ static struct amba_driver pl011_driver = { |
706 |
+ .drv = { |
707 |
+ .name = "uart-pl011", |
708 |
+ .pm = &pl011_dev_pm_ops, |
709 |
++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_AMBA_PL011), |
710 |
+ }, |
711 |
+ .id_table = pl011_ids, |
712 |
+ .probe = pl011_probe, |
713 |
+diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c |
714 |
+index 7f8e99bbcb73..fb77d55a8d95 100644 |
715 |
+--- a/drivers/tty/serial/pic32_uart.c |
716 |
++++ b/drivers/tty/serial/pic32_uart.c |
717 |
+@@ -920,6 +920,7 @@ static struct platform_driver pic32_uart_platform_driver = { |
718 |
+ .driver = { |
719 |
+ .name = PIC32_DEV_NAME, |
720 |
+ .of_match_table = of_match_ptr(pic32_serial_dt_ids), |
721 |
++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_PIC32), |
722 |
+ }, |
723 |
+ }; |
724 |
+ |
725 |
+diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c |
726 |
+index 53e6db8b0330..bcfdaf6ddbb2 100644 |
727 |
+--- a/drivers/tty/serial/serial_core.c |
728 |
++++ b/drivers/tty/serial/serial_core.c |
729 |
+@@ -195,10 +195,15 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state, |
730 |
+ if (!state->xmit.buf) { |
731 |
+ state->xmit.buf = (unsigned char *) page; |
732 |
+ uart_circ_clear(&state->xmit); |
733 |
++ uart_port_unlock(uport, flags); |
734 |
+ } else { |
735 |
++ uart_port_unlock(uport, flags); |
736 |
++ /* |
737 |
++ * Do not free() the page under the port lock, see |
738 |
++ * uart_shutdown(). |
739 |
++ */ |
740 |
+ free_page(page); |
741 |
+ } |
742 |
+- uart_port_unlock(uport, flags); |
743 |
+ |
744 |
+ retval = uport->ops->startup(uport); |
745 |
+ if (retval == 0) { |
746 |
+@@ -258,6 +263,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) |
747 |
+ struct uart_port *uport = uart_port_check(state); |
748 |
+ struct tty_port *port = &state->port; |
749 |
+ unsigned long flags = 0; |
750 |
++ char *xmit_buf = NULL; |
751 |
+ |
752 |
+ /* |
753 |
+ * Set the TTY IO error marker |
754 |
+@@ -288,14 +294,18 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) |
755 |
+ tty_port_set_suspended(port, 0); |
756 |
+ |
757 |
+ /* |
758 |
+- * Free the transmit buffer page. |
759 |
++ * Do not free() the transmit buffer page under the port lock since |
760 |
++ * this can create various circular locking scenarios. For instance, |
761 |
++ * console driver may need to allocate/free a debug object, which |
762 |
++ * can endup in printk() recursion. |
763 |
+ */ |
764 |
+ uart_port_lock(state, flags); |
765 |
+- if (state->xmit.buf) { |
766 |
+- free_page((unsigned long)state->xmit.buf); |
767 |
+- state->xmit.buf = NULL; |
768 |
+- } |
769 |
++ xmit_buf = state->xmit.buf; |
770 |
++ state->xmit.buf = NULL; |
771 |
+ uart_port_unlock(uport, flags); |
772 |
++ |
773 |
++ if (xmit_buf) |
774 |
++ free_page((unsigned long)xmit_buf); |
775 |
+ } |
776 |
+ |
777 |
+ /** |
778 |
+diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c |
779 |
+index fcf2e51f2cfe..7333d64f68f2 100644 |
780 |
+--- a/drivers/tty/serial/xilinx_uartps.c |
781 |
++++ b/drivers/tty/serial/xilinx_uartps.c |
782 |
+@@ -1602,6 +1602,7 @@ static struct platform_driver cdns_uart_platform_driver = { |
783 |
+ .name = CDNS_UART_NAME, |
784 |
+ .of_match_table = cdns_uart_of_match, |
785 |
+ .pm = &cdns_uart_dev_pm_ops, |
786 |
++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_XILINX_PS_UART), |
787 |
+ }, |
788 |
+ }; |
789 |
+ |
790 |
+diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c |
791 |
+index 79b0de846f21..226640563df3 100644 |
792 |
+--- a/fs/jffs2/super.c |
793 |
++++ b/fs/jffs2/super.c |
794 |
+@@ -101,7 +101,8 @@ static int jffs2_sync_fs(struct super_block *sb, int wait) |
795 |
+ struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); |
796 |
+ |
797 |
+ #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
798 |
+- cancel_delayed_work_sync(&c->wbuf_dwork); |
799 |
++ if (jffs2_is_writebuffered(c)) |
800 |
++ cancel_delayed_work_sync(&c->wbuf_dwork); |
801 |
+ #endif |
802 |
+ |
803 |
+ mutex_lock(&c->alloc_sem); |
804 |
+diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c |
805 |
+index fe0d1f9571bb..5d53d0d63d19 100644 |
806 |
+--- a/fs/ocfs2/localalloc.c |
807 |
++++ b/fs/ocfs2/localalloc.c |
808 |
+@@ -345,13 +345,18 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb) |
809 |
+ if (num_used |
810 |
+ || alloc->id1.bitmap1.i_used |
811 |
+ || alloc->id1.bitmap1.i_total |
812 |
+- || la->la_bm_off) |
813 |
+- mlog(ML_ERROR, "Local alloc hasn't been recovered!\n" |
814 |
++ || la->la_bm_off) { |
815 |
++ mlog(ML_ERROR, "inconsistent detected, clean journal with" |
816 |
++ " unrecovered local alloc, please run fsck.ocfs2!\n" |
817 |
+ "found = %u, set = %u, taken = %u, off = %u\n", |
818 |
+ num_used, le32_to_cpu(alloc->id1.bitmap1.i_used), |
819 |
+ le32_to_cpu(alloc->id1.bitmap1.i_total), |
820 |
+ OCFS2_LOCAL_ALLOC(alloc)->la_bm_off); |
821 |
+ |
822 |
++ status = -EINVAL; |
823 |
++ goto bail; |
824 |
++ } |
825 |
++ |
826 |
+ osb->local_alloc_bh = alloc_bh; |
827 |
+ osb->local_alloc_state = OCFS2_LA_ENABLED; |
828 |
+ |
829 |
+diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c |
830 |
+index ecdb3baa1283..11e558efd61e 100644 |
831 |
+--- a/fs/pstore/ram_core.c |
832 |
++++ b/fs/pstore/ram_core.c |
833 |
+@@ -488,6 +488,11 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig, |
834 |
+ sig ^= PERSISTENT_RAM_SIG; |
835 |
+ |
836 |
+ if (prz->buffer->sig == sig) { |
837 |
++ if (buffer_size(prz) == 0) { |
838 |
++ pr_debug("found existing empty buffer\n"); |
839 |
++ return 0; |
840 |
++ } |
841 |
++ |
842 |
+ if (buffer_size(prz) > prz->buffer_size || |
843 |
+ buffer_start(prz) > buffer_size(prz)) |
844 |
+ pr_info("found existing invalid buffer, size %zu, start %zu\n", |
845 |
+diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h |
846 |
+index d10f1e7d6ba8..6503e96710fa 100644 |
847 |
+--- a/include/asm-generic/qspinlock_types.h |
848 |
++++ b/include/asm-generic/qspinlock_types.h |
849 |
+@@ -18,6 +18,8 @@ |
850 |
+ #ifndef __ASM_GENERIC_QSPINLOCK_TYPES_H |
851 |
+ #define __ASM_GENERIC_QSPINLOCK_TYPES_H |
852 |
+ |
853 |
++#include <asm/byteorder.h> |
854 |
++ |
855 |
+ /* |
856 |
+ * Including atomic.h with PARAVIRT on will cause compilation errors because |
857 |
+ * of recursive header file incluson via paravirt_types.h. So don't include |
858 |
+diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h |
859 |
+index 32728ff8095c..4ea779b25a51 100644 |
860 |
+--- a/include/linux/backing-dev-defs.h |
861 |
++++ b/include/linux/backing-dev-defs.h |
862 |
+@@ -225,6 +225,14 @@ static inline void wb_get(struct bdi_writeback *wb) |
863 |
+ */ |
864 |
+ static inline void wb_put(struct bdi_writeback *wb) |
865 |
+ { |
866 |
++ if (WARN_ON_ONCE(!wb->bdi)) { |
867 |
++ /* |
868 |
++ * A driver bug might cause a file to be removed before bdi was |
869 |
++ * initialized. |
870 |
++ */ |
871 |
++ return; |
872 |
++ } |
873 |
++ |
874 |
+ if (wb != &wb->bdi->wb) |
875 |
+ percpu_ref_put(&wb->refcnt); |
876 |
+ } |
877 |
+diff --git a/mm/page-writeback.c b/mm/page-writeback.c |
878 |
+index 807236aed275..281a46aeae61 100644 |
879 |
+--- a/mm/page-writeback.c |
880 |
++++ b/mm/page-writeback.c |
881 |
+@@ -2148,6 +2148,7 @@ int write_cache_pages(struct address_space *mapping, |
882 |
+ { |
883 |
+ int ret = 0; |
884 |
+ int done = 0; |
885 |
++ int error; |
886 |
+ struct pagevec pvec; |
887 |
+ int nr_pages; |
888 |
+ pgoff_t uninitialized_var(writeback_index); |
889 |
+@@ -2244,25 +2245,31 @@ continue_unlock: |
890 |
+ goto continue_unlock; |
891 |
+ |
892 |
+ trace_wbc_writepage(wbc, inode_to_bdi(mapping->host)); |
893 |
+- ret = (*writepage)(page, wbc, data); |
894 |
+- if (unlikely(ret)) { |
895 |
+- if (ret == AOP_WRITEPAGE_ACTIVATE) { |
896 |
++ error = (*writepage)(page, wbc, data); |
897 |
++ if (unlikely(error)) { |
898 |
++ /* |
899 |
++ * Handle errors according to the type of |
900 |
++ * writeback. There's no need to continue for |
901 |
++ * background writeback. Just push done_index |
902 |
++ * past this page so media errors won't choke |
903 |
++ * writeout for the entire file. For integrity |
904 |
++ * writeback, we must process the entire dirty |
905 |
++ * set regardless of errors because the fs may |
906 |
++ * still have state to clear for each page. In |
907 |
++ * that case we continue processing and return |
908 |
++ * the first error. |
909 |
++ */ |
910 |
++ if (error == AOP_WRITEPAGE_ACTIVATE) { |
911 |
+ unlock_page(page); |
912 |
+- ret = 0; |
913 |
+- } else { |
914 |
+- /* |
915 |
+- * done_index is set past this page, |
916 |
+- * so media errors will not choke |
917 |
+- * background writeout for the entire |
918 |
+- * file. This has consequences for |
919 |
+- * range_cyclic semantics (ie. it may |
920 |
+- * not be suitable for data integrity |
921 |
+- * writeout). |
922 |
+- */ |
923 |
++ error = 0; |
924 |
++ } else if (wbc->sync_mode != WB_SYNC_ALL) { |
925 |
++ ret = error; |
926 |
+ done_index = page->index + 1; |
927 |
+ done = 1; |
928 |
+ break; |
929 |
+ } |
930 |
++ if (!ret) |
931 |
++ ret = error; |
932 |
+ } |
933 |
+ |
934 |
+ /* |
935 |
+diff --git a/net/core/sock.c b/net/core/sock.c |
936 |
+index 68c831e1a5c0..3041aa6df602 100644 |
937 |
+--- a/net/core/sock.c |
938 |
++++ b/net/core/sock.c |
939 |
+@@ -699,6 +699,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, |
940 |
+ break; |
941 |
+ case SO_DONTROUTE: |
942 |
+ sock_valbool_flag(sk, SOCK_LOCALROUTE, valbool); |
943 |
++ sk_dst_reset(sk); |
944 |
+ break; |
945 |
+ case SO_BROADCAST: |
946 |
+ sock_valbool_flag(sk, SOCK_BROADCAST, valbool); |
947 |
+diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c |
948 |
+index f7b425615c12..c81b2c5caf26 100644 |
949 |
+--- a/net/ipv6/af_inet6.c |
950 |
++++ b/net/ipv6/af_inet6.c |
951 |
+@@ -306,6 +306,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
952 |
+ |
953 |
+ /* Check if the address belongs to the host. */ |
954 |
+ if (addr_type == IPV6_ADDR_MAPPED) { |
955 |
++ struct net_device *dev = NULL; |
956 |
+ int chk_addr_ret; |
957 |
+ |
958 |
+ /* Binding to v4-mapped address on a v6-only socket |
959 |
+@@ -316,9 +317,20 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
960 |
+ goto out; |
961 |
+ } |
962 |
+ |
963 |
++ rcu_read_lock(); |
964 |
++ if (sk->sk_bound_dev_if) { |
965 |
++ dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if); |
966 |
++ if (!dev) { |
967 |
++ err = -ENODEV; |
968 |
++ goto out_unlock; |
969 |
++ } |
970 |
++ } |
971 |
++ |
972 |
+ /* Reproduce AF_INET checks to make the bindings consistent */ |
973 |
+ v4addr = addr->sin6_addr.s6_addr32[3]; |
974 |
+- chk_addr_ret = inet_addr_type(net, v4addr); |
975 |
++ chk_addr_ret = inet_addr_type_dev_table(net, dev, v4addr); |
976 |
++ rcu_read_unlock(); |
977 |
++ |
978 |
+ if (!net->ipv4.sysctl_ip_nonlocal_bind && |
979 |
+ !(inet->freebind || inet->transparent) && |
980 |
+ v4addr != htonl(INADDR_ANY) && |
981 |
+diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l |
982 |
+index c410d257da06..0c7800112ff5 100644 |
983 |
+--- a/scripts/kconfig/zconf.l |
984 |
++++ b/scripts/kconfig/zconf.l |
985 |
+@@ -71,7 +71,7 @@ static void warn_ignored_character(char chr) |
986 |
+ { |
987 |
+ fprintf(stderr, |
988 |
+ "%s:%d:warning: ignoring unsupported character '%c'\n", |
989 |
+- zconf_curname(), zconf_lineno(), chr); |
990 |
++ current_file->name, yylineno, chr); |
991 |
+ } |
992 |
+ %} |
993 |
+ |
994 |
+@@ -191,6 +191,8 @@ n [A-Za-z0-9_-] |
995 |
+ } |
996 |
+ <<EOF>> { |
997 |
+ BEGIN(INITIAL); |
998 |
++ yylval.string = text; |
999 |
++ return T_WORD_QUOTE; |
1000 |
+ } |
1001 |
+ } |
1002 |
+ |
1003 |
+diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c |
1004 |
+index 8ded80867b92..d293b546a2aa 100644 |
1005 |
+--- a/security/selinux/hooks.c |
1006 |
++++ b/security/selinux/hooks.c |
1007 |
+@@ -2758,7 +2758,7 @@ static int selinux_sb_kern_mount(struct super_block *sb, int flags, void *data) |
1008 |
+ return rc; |
1009 |
+ |
1010 |
+ /* Allow all mounts performed by the kernel */ |
1011 |
+- if (flags & MS_KERNMOUNT) |
1012 |
++ if (flags & (MS_KERNMOUNT | MS_SUBMOUNT)) |
1013 |
+ return 0; |
1014 |
+ |
1015 |
+ ad.type = LSM_AUDIT_DATA_DENTRY; |
1016 |
+diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig |
1017 |
+index ab894ed1ff67..8557e54d2659 100644 |
1018 |
+--- a/sound/firewire/Kconfig |
1019 |
++++ b/sound/firewire/Kconfig |
1020 |
+@@ -40,6 +40,7 @@ config SND_OXFW |
1021 |
+ * Mackie(Loud) U.420/U.420d |
1022 |
+ * TASCAM FireOne |
1023 |
+ * Stanton Controllers & Systems 1 Deck/Mixer |
1024 |
++ * APOGEE duet FireWire |
1025 |
+ |
1026 |
+ To compile this driver as a module, choose M here: the module |
1027 |
+ will be called snd-oxfw. |
1028 |
+diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c |
1029 |
+index d0dfa822266b..3b4eaffe4a7f 100644 |
1030 |
+--- a/sound/firewire/bebob/bebob.c |
1031 |
++++ b/sound/firewire/bebob/bebob.c |
1032 |
+@@ -434,7 +434,7 @@ static const struct ieee1394_device_id bebob_id_table[] = { |
1033 |
+ /* Apogee Electronics, DA/AD/DD-16X (X-FireWire card) */ |
1034 |
+ SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00010048, &spec_normal), |
1035 |
+ /* Apogee Electronics, Ensemble */ |
1036 |
+- SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00001eee, &spec_normal), |
1037 |
++ SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x01eeee, &spec_normal), |
1038 |
+ /* ESI, Quatafire610 */ |
1039 |
+ SND_BEBOB_DEV_ENTRY(VEN_ESI, 0x00010064, &spec_normal), |
1040 |
+ /* AcousticReality, eARMasterOne */ |
1041 |
+diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c |
1042 |
+index 696b6cf35003..b0395c4209ab 100644 |
1043 |
+--- a/sound/firewire/oxfw/oxfw.c |
1044 |
++++ b/sound/firewire/oxfw/oxfw.c |
1045 |
+@@ -20,6 +20,7 @@ |
1046 |
+ #define VENDOR_LACIE 0x00d04b |
1047 |
+ #define VENDOR_TASCAM 0x00022e |
1048 |
+ #define OUI_STANTON 0x001260 |
1049 |
++#define OUI_APOGEE 0x0003db |
1050 |
+ |
1051 |
+ #define MODEL_SATELLITE 0x00200f |
1052 |
+ |
1053 |
+@@ -441,6 +442,13 @@ static const struct ieee1394_device_id oxfw_id_table[] = { |
1054 |
+ .vendor_id = OUI_STANTON, |
1055 |
+ .model_id = 0x002000, |
1056 |
+ }, |
1057 |
++ // APOGEE, duet FireWire |
1058 |
++ { |
1059 |
++ .match_flags = IEEE1394_MATCH_VENDOR_ID | |
1060 |
++ IEEE1394_MATCH_MODEL_ID, |
1061 |
++ .vendor_id = OUI_APOGEE, |
1062 |
++ .model_id = 0x01dddd, |
1063 |
++ }, |
1064 |
+ { } |
1065 |
+ }; |
1066 |
+ MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table); |
1067 |
+diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile |
1068 |
+index ce4b7e527566..a690d230c311 100644 |
1069 |
+--- a/tools/lib/subcmd/Makefile |
1070 |
++++ b/tools/lib/subcmd/Makefile |
1071 |
+@@ -29,8 +29,6 @@ endif |
1072 |
+ CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
1073 |
+ |
1074 |
+ CFLAGS += -I$(srctree)/tools/include/ |
1075 |
+-CFLAGS += -I$(srctree)/include/uapi |
1076 |
+-CFLAGS += -I$(srctree)/include |
1077 |
+ |
1078 |
+ SUBCMD_IN := $(OUTPUT)libsubcmd-in.o |
1079 |
+ |
1080 |
+diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c |
1081 |
+index 90fa2286edcf..c88adcbf966e 100644 |
1082 |
+--- a/tools/perf/arch/x86/util/intel-pt.c |
1083 |
++++ b/tools/perf/arch/x86/util/intel-pt.c |
1084 |
+@@ -522,10 +522,21 @@ static int intel_pt_validate_config(struct perf_pmu *intel_pt_pmu, |
1085 |
+ struct perf_evsel *evsel) |
1086 |
+ { |
1087 |
+ int err; |
1088 |
++ char c; |
1089 |
+ |
1090 |
+ if (!evsel) |
1091 |
+ return 0; |
1092 |
+ |
1093 |
++ /* |
1094 |
++ * If supported, force pass-through config term (pt=1) even if user |
1095 |
++ * sets pt=0, which avoids senseless kernel errors. |
1096 |
++ */ |
1097 |
++ if (perf_pmu__scan_file(intel_pt_pmu, "format/pt", "%c", &c) == 1 && |
1098 |
++ !(evsel->attr.config & 1)) { |
1099 |
++ pr_warning("pt=0 doesn't make sense, forcing pt=1\n"); |
1100 |
++ evsel->attr.config |= 1; |
1101 |
++ } |
1102 |
++ |
1103 |
+ err = intel_pt_val_config_term(intel_pt_pmu, "caps/cycle_thresholds", |
1104 |
+ "cyc_thresh", "caps/psb_cyc", |
1105 |
+ evsel->attr.config); |
1106 |
+diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c |
1107 |
+index 415a9c38d9f0..14f111a10650 100644 |
1108 |
+--- a/tools/perf/util/parse-events.c |
1109 |
++++ b/tools/perf/util/parse-events.c |
1110 |
+@@ -2225,7 +2225,7 @@ restart: |
1111 |
+ if (!name_only && strlen(syms->alias)) |
1112 |
+ snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias); |
1113 |
+ else |
1114 |
+- strncpy(name, syms->symbol, MAX_NAME_LEN); |
1115 |
++ strlcpy(name, syms->symbol, MAX_NAME_LEN); |
1116 |
+ |
1117 |
+ evt_list[evt_i] = strdup(name); |
1118 |
+ if (evt_list[evt_i] == NULL) |
1119 |
+diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c |
1120 |
+index 1cbada2dc6be..f735ee038713 100644 |
1121 |
+--- a/tools/perf/util/svghelper.c |
1122 |
++++ b/tools/perf/util/svghelper.c |
1123 |
+@@ -334,7 +334,7 @@ static char *cpu_model(void) |
1124 |
+ if (file) { |
1125 |
+ while (fgets(buf, 255, file)) { |
1126 |
+ if (strstr(buf, "model name")) { |
1127 |
+- strncpy(cpu_m, &buf[13], 255); |
1128 |
++ strlcpy(cpu_m, &buf[13], 255); |
1129 |
+ break; |
1130 |
+ } |
1131 |
+ } |