Magellan Linux

Contents of /trunk/kernel-alx/patches-4.19/0131-4.19.32-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3410 - (show annotations) (download)
Fri Aug 2 11:47:41 2019 UTC (4 years, 9 months ago) by niro
File size: 50422 byte(s)
-linux-4.19.32
1 diff --git a/Makefile b/Makefile
2 index 3b1c6cff6700..d66c433df5b1 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,7 +1,7 @@
6 # SPDX-License-Identifier: GPL-2.0
7 VERSION = 4
8 PATCHLEVEL = 19
9 -SUBLEVEL = 31
10 +SUBLEVEL = 32
11 EXTRAVERSION =
12 NAME = "People's Front"
13
14 diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h
15 index e77672539e8e..e4456e450f94 100644
16 --- a/arch/mips/include/asm/jump_label.h
17 +++ b/arch/mips/include/asm/jump_label.h
18 @@ -21,15 +21,15 @@
19 #endif
20
21 #ifdef CONFIG_CPU_MICROMIPS
22 -#define NOP_INSN "nop32"
23 +#define B_INSN "b32"
24 #else
25 -#define NOP_INSN "nop"
26 +#define B_INSN "b"
27 #endif
28
29 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
30 {
31 - asm_volatile_goto("1:\t" NOP_INSN "\n\t"
32 - "nop\n\t"
33 + asm_volatile_goto("1:\t" B_INSN " 2f\n\t"
34 + "2:\tnop\n\t"
35 ".pushsection __jump_table, \"aw\"\n\t"
36 WORD_INSN " 1b, %l[l_yes], %0\n\t"
37 ".popsection\n\t"
38 diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
39 index 971a504001c2..36f2e860ba3e 100644
40 --- a/arch/mips/kernel/vmlinux.lds.S
41 +++ b/arch/mips/kernel/vmlinux.lds.S
42 @@ -140,6 +140,13 @@ SECTIONS
43 PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
44 #endif
45
46 +#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
47 + .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
48 + *(.appended_dtb)
49 + KEEP(*(.appended_dtb))
50 + }
51 +#endif
52 +
53 #ifdef CONFIG_RELOCATABLE
54 . = ALIGN(4);
55
56 @@ -164,11 +171,6 @@ SECTIONS
57 __appended_dtb = .;
58 /* leave space for appended DTB */
59 . += 0x100000;
60 -#elif defined(CONFIG_MIPS_ELF_APPENDED_DTB)
61 - .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
62 - *(.appended_dtb)
63 - KEEP(*(.appended_dtb))
64 - }
65 #endif
66 /*
67 * Align to 64K in attempt to eliminate holes before the
68 diff --git a/arch/mips/loongson64/lemote-2f/irq.c b/arch/mips/loongson64/lemote-2f/irq.c
69 index 9e33e45aa17c..b213cecb8e3a 100644
70 --- a/arch/mips/loongson64/lemote-2f/irq.c
71 +++ b/arch/mips/loongson64/lemote-2f/irq.c
72 @@ -103,7 +103,7 @@ static struct irqaction ip6_irqaction = {
73 static struct irqaction cascade_irqaction = {
74 .handler = no_action,
75 .name = "cascade",
76 - .flags = IRQF_NO_THREAD,
77 + .flags = IRQF_NO_THREAD | IRQF_NO_SUSPEND,
78 };
79
80 void __init mach_init_irq(void)
81 diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h
82 index 1afe90ade595..bbc06bd72b1f 100644
83 --- a/arch/powerpc/include/asm/vdso_datapage.h
84 +++ b/arch/powerpc/include/asm/vdso_datapage.h
85 @@ -82,10 +82,10 @@ struct vdso_data {
86 __u32 icache_block_size; /* L1 i-cache block size */
87 __u32 dcache_log_block_size; /* L1 d-cache log block size */
88 __u32 icache_log_block_size; /* L1 i-cache log block size */
89 - __s32 wtom_clock_sec; /* Wall to monotonic clock */
90 - __s32 wtom_clock_nsec;
91 - struct timespec stamp_xtime; /* xtime as at tb_orig_stamp */
92 - __u32 stamp_sec_fraction; /* fractional seconds of stamp_xtime */
93 + __u32 stamp_sec_fraction; /* fractional seconds of stamp_xtime */
94 + __s32 wtom_clock_nsec; /* Wall to monotonic clock nsec */
95 + __s64 wtom_clock_sec; /* Wall to monotonic clock sec */
96 + struct timespec stamp_xtime; /* xtime as at tb_orig_stamp */
97 __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls */
98 __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
99 };
100 diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S
101 index c002adcc694c..afbad2ac3147 100644
102 --- a/arch/powerpc/kernel/vdso64/gettimeofday.S
103 +++ b/arch/powerpc/kernel/vdso64/gettimeofday.S
104 @@ -92,7 +92,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
105 * At this point, r4,r5 contain our sec/nsec values.
106 */
107
108 - lwa r6,WTOM_CLOCK_SEC(r3)
109 + ld r6,WTOM_CLOCK_SEC(r3)
110 lwa r9,WTOM_CLOCK_NSEC(r3)
111
112 /* We now have our result in r6,r9. We create a fake dependency
113 @@ -125,7 +125,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
114 bne cr6,75f
115
116 /* CLOCK_MONOTONIC_COARSE */
117 - lwa r6,WTOM_CLOCK_SEC(r3)
118 + ld r6,WTOM_CLOCK_SEC(r3)
119 lwa r9,WTOM_CLOCK_NSEC(r3)
120
121 /* check if counter has updated */
122 diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h
123 index 1f86e1b0a5cd..499578f7e6d7 100644
124 --- a/arch/x86/include/asm/unwind.h
125 +++ b/arch/x86/include/asm/unwind.h
126 @@ -23,6 +23,12 @@ struct unwind_state {
127 #elif defined(CONFIG_UNWINDER_FRAME_POINTER)
128 bool got_irq;
129 unsigned long *bp, *orig_sp, ip;
130 + /*
131 + * If non-NULL: The current frame is incomplete and doesn't contain a
132 + * valid BP. When looking for the next frame, use this instead of the
133 + * non-existent saved BP.
134 + */
135 + unsigned long *next_bp;
136 struct pt_regs *regs;
137 #else
138 unsigned long *sp;
139 diff --git a/arch/x86/kernel/unwind_frame.c b/arch/x86/kernel/unwind_frame.c
140 index 3dc26f95d46e..9b9fd4826e7a 100644
141 --- a/arch/x86/kernel/unwind_frame.c
142 +++ b/arch/x86/kernel/unwind_frame.c
143 @@ -320,10 +320,14 @@ bool unwind_next_frame(struct unwind_state *state)
144 }
145
146 /* Get the next frame pointer: */
147 - if (state->regs)
148 + if (state->next_bp) {
149 + next_bp = state->next_bp;
150 + state->next_bp = NULL;
151 + } else if (state->regs) {
152 next_bp = (unsigned long *)state->regs->bp;
153 - else
154 + } else {
155 next_bp = (unsigned long *)READ_ONCE_TASK_STACK(state->task, *state->bp);
156 + }
157
158 /* Move to the next frame if it's safe: */
159 if (!update_stack_state(state, next_bp))
160 @@ -398,6 +402,21 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
161
162 bp = get_frame_pointer(task, regs);
163
164 + /*
165 + * If we crash with IP==0, the last successfully executed instruction
166 + * was probably an indirect function call with a NULL function pointer.
167 + * That means that SP points into the middle of an incomplete frame:
168 + * *SP is a return pointer, and *(SP-sizeof(unsigned long)) is where we
169 + * would have written a frame pointer if we hadn't crashed.
170 + * Pretend that the frame is complete and that BP points to it, but save
171 + * the real BP so that we can use it when looking for the next frame.
172 + */
173 + if (regs && regs->ip == 0 &&
174 + (unsigned long *)kernel_stack_pointer(regs) >= first_frame) {
175 + state->next_bp = bp;
176 + bp = ((unsigned long *)kernel_stack_pointer(regs)) - 1;
177 + }
178 +
179 /* Initialize stack info and make sure the frame data is accessible: */
180 get_stack_info(bp, state->task, &state->stack_info,
181 &state->stack_mask);
182 @@ -410,7 +429,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
183 */
184 while (!unwind_done(state) &&
185 (!on_stack(&state->stack_info, first_frame, sizeof(long)) ||
186 - state->bp < first_frame))
187 + (state->next_bp == NULL && state->bp < first_frame)))
188 unwind_next_frame(state);
189 }
190 EXPORT_SYMBOL_GPL(__unwind_start);
191 diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
192 index 26038eacf74a..89be1be1790c 100644
193 --- a/arch/x86/kernel/unwind_orc.c
194 +++ b/arch/x86/kernel/unwind_orc.c
195 @@ -113,6 +113,20 @@ static struct orc_entry *orc_ftrace_find(unsigned long ip)
196 }
197 #endif
198
199 +/*
200 + * If we crash with IP==0, the last successfully executed instruction
201 + * was probably an indirect function call with a NULL function pointer,
202 + * and we don't have unwind information for NULL.
203 + * This hardcoded ORC entry for IP==0 allows us to unwind from a NULL function
204 + * pointer into its parent and then continue normally from there.
205 + */
206 +static struct orc_entry null_orc_entry = {
207 + .sp_offset = sizeof(long),
208 + .sp_reg = ORC_REG_SP,
209 + .bp_reg = ORC_REG_UNDEFINED,
210 + .type = ORC_TYPE_CALL
211 +};
212 +
213 static struct orc_entry *orc_find(unsigned long ip)
214 {
215 static struct orc_entry *orc;
216 @@ -120,6 +134,9 @@ static struct orc_entry *orc_find(unsigned long ip)
217 if (!orc_init)
218 return NULL;
219
220 + if (ip == 0)
221 + return &null_orc_entry;
222 +
223 /* For non-init vmlinux addresses, use the fast lookup table: */
224 if (ip >= LOOKUP_START_IP && ip < LOOKUP_STOP_IP) {
225 unsigned int idx, start, stop;
226 diff --git a/drivers/block/loop.c b/drivers/block/loop.c
227 index c9c2bcc36e26..0c5aeab4d23a 100644
228 --- a/drivers/block/loop.c
229 +++ b/drivers/block/loop.c
230 @@ -657,7 +657,7 @@ static int loop_validate_file(struct file *file, struct block_device *bdev)
231 return -EBADF;
232
233 l = f->f_mapping->host->i_bdev->bd_disk->private_data;
234 - if (l->lo_state == Lo_unbound) {
235 + if (l->lo_state != Lo_bound) {
236 return -EINVAL;
237 }
238 f = l->lo_backing_file;
239 diff --git a/drivers/bluetooth/h4_recv.h b/drivers/bluetooth/h4_recv.h
240 index b432651f8236..307d82166f48 100644
241 --- a/drivers/bluetooth/h4_recv.h
242 +++ b/drivers/bluetooth/h4_recv.h
243 @@ -60,6 +60,10 @@ static inline struct sk_buff *h4_recv_buf(struct hci_dev *hdev,
244 const struct h4_recv_pkt *pkts,
245 int pkts_count)
246 {
247 + /* Check for error from previous call */
248 + if (IS_ERR(skb))
249 + skb = NULL;
250 +
251 while (count) {
252 int i, len;
253
254 diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
255 index fb97a3bf069b..5d97d77627c1 100644
256 --- a/drivers/bluetooth/hci_h4.c
257 +++ b/drivers/bluetooth/hci_h4.c
258 @@ -174,6 +174,10 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
259 struct hci_uart *hu = hci_get_drvdata(hdev);
260 u8 alignment = hu->alignment ? hu->alignment : 1;
261
262 + /* Check for error from previous call */
263 + if (IS_ERR(skb))
264 + skb = NULL;
265 +
266 while (count) {
267 int i, len;
268
269 diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
270 index ea6238ed5c0e..c915daf01a89 100644
271 --- a/drivers/bluetooth/hci_ldisc.c
272 +++ b/drivers/bluetooth/hci_ldisc.c
273 @@ -207,11 +207,11 @@ void hci_uart_init_work(struct work_struct *work)
274 err = hci_register_dev(hu->hdev);
275 if (err < 0) {
276 BT_ERR("Can't register HCI device");
277 + clear_bit(HCI_UART_PROTO_READY, &hu->flags);
278 + hu->proto->close(hu);
279 hdev = hu->hdev;
280 hu->hdev = NULL;
281 hci_free_dev(hdev);
282 - clear_bit(HCI_UART_PROTO_READY, &hu->flags);
283 - hu->proto->close(hu);
284 return;
285 }
286
287 @@ -616,6 +616,7 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
288 static int hci_uart_register_dev(struct hci_uart *hu)
289 {
290 struct hci_dev *hdev;
291 + int err;
292
293 BT_DBG("");
294
295 @@ -659,11 +660,22 @@ static int hci_uart_register_dev(struct hci_uart *hu)
296 else
297 hdev->dev_type = HCI_PRIMARY;
298
299 + /* Only call open() for the protocol after hdev is fully initialized as
300 + * open() (or a timer/workqueue it starts) may attempt to reference it.
301 + */
302 + err = hu->proto->open(hu);
303 + if (err) {
304 + hu->hdev = NULL;
305 + hci_free_dev(hdev);
306 + return err;
307 + }
308 +
309 if (test_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags))
310 return 0;
311
312 if (hci_register_dev(hdev) < 0) {
313 BT_ERR("Can't register HCI device");
314 + hu->proto->close(hu);
315 hu->hdev = NULL;
316 hci_free_dev(hdev);
317 return -ENODEV;
318 @@ -683,20 +695,14 @@ static int hci_uart_set_proto(struct hci_uart *hu, int id)
319 if (!p)
320 return -EPROTONOSUPPORT;
321
322 - err = p->open(hu);
323 - if (err)
324 - return err;
325 -
326 hu->proto = p;
327 - set_bit(HCI_UART_PROTO_READY, &hu->flags);
328
329 err = hci_uart_register_dev(hu);
330 if (err) {
331 - clear_bit(HCI_UART_PROTO_READY, &hu->flags);
332 - p->close(hu);
333 return err;
334 }
335
336 + set_bit(HCI_UART_PROTO_READY, &hu->flags);
337 return 0;
338 }
339
340 diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
341 index fcb0ab0abb75..57cc9aa6683a 100644
342 --- a/drivers/gpu/drm/drm_mode_object.c
343 +++ b/drivers/gpu/drm/drm_mode_object.c
344 @@ -458,12 +458,13 @@ static int set_property_atomic(struct drm_mode_object *obj,
345 struct drm_modeset_acquire_ctx ctx;
346 int ret;
347
348 - drm_modeset_acquire_init(&ctx, 0);
349 -
350 state = drm_atomic_state_alloc(dev);
351 if (!state)
352 return -ENOMEM;
353 +
354 + drm_modeset_acquire_init(&ctx, 0);
355 state->acquire_ctx = &ctx;
356 +
357 retry:
358 if (prop == state->dev->mode_config.dpms_property) {
359 if (obj->type != DRM_MODE_OBJECT_CONNECTOR) {
360 diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
361 index b913a56f3426..2a9112515f46 100644
362 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
363 +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
364 @@ -564,11 +564,9 @@ static int vmw_fb_set_par(struct fb_info *info)
365 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
366 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC)
367 };
368 - struct drm_display_mode *old_mode;
369 struct drm_display_mode *mode;
370 int ret;
371
372 - old_mode = par->set_mode;
373 mode = drm_mode_duplicate(vmw_priv->dev, &new_mode);
374 if (!mode) {
375 DRM_ERROR("Could not create new fb mode.\n");
376 @@ -579,11 +577,7 @@ static int vmw_fb_set_par(struct fb_info *info)
377 mode->vdisplay = var->yres;
378 vmw_guess_mode_timing(mode);
379
380 - if (old_mode && drm_mode_equal(old_mode, mode)) {
381 - drm_mode_destroy(vmw_priv->dev, mode);
382 - mode = old_mode;
383 - old_mode = NULL;
384 - } else if (!vmw_kms_validate_mode_vram(vmw_priv,
385 + if (!vmw_kms_validate_mode_vram(vmw_priv,
386 mode->hdisplay *
387 DIV_ROUND_UP(var->bits_per_pixel, 8),
388 mode->vdisplay)) {
389 @@ -620,8 +614,8 @@ static int vmw_fb_set_par(struct fb_info *info)
390 schedule_delayed_work(&par->local_work, 0);
391
392 out_unlock:
393 - if (old_mode)
394 - drm_mode_destroy(vmw_priv->dev, old_mode);
395 + if (par->set_mode)
396 + drm_mode_destroy(vmw_priv->dev, par->set_mode);
397 par->set_mode = mode;
398
399 mutex_unlock(&par->bo_mutex);
400 diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
401 index b93c558dd86e..7da752ca1c34 100644
402 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
403 +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
404 @@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man,
405
406 id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL);
407 if (id < 0)
408 - return id;
409 + return (id != -ENOMEM ? 0 : id);
410
411 spin_lock(&gman->lock);
412
413 diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
414 index a36c94930c31..6f5be7802476 100644
415 --- a/drivers/infiniband/core/cma.c
416 +++ b/drivers/infiniband/core/cma.c
417 @@ -2854,13 +2854,22 @@ static void addr_handler(int status, struct sockaddr *src_addr,
418 {
419 struct rdma_id_private *id_priv = context;
420 struct rdma_cm_event event = {};
421 + struct sockaddr *addr;
422 + struct sockaddr_storage old_addr;
423
424 mutex_lock(&id_priv->handler_mutex);
425 if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_QUERY,
426 RDMA_CM_ADDR_RESOLVED))
427 goto out;
428
429 - memcpy(cma_src_addr(id_priv), src_addr, rdma_addr_size(src_addr));
430 + /*
431 + * Store the previous src address, so that if we fail to acquire
432 + * matching rdma device, old address can be restored back, which helps
433 + * to cancel the cma listen operation correctly.
434 + */
435 + addr = cma_src_addr(id_priv);
436 + memcpy(&old_addr, addr, rdma_addr_size(addr));
437 + memcpy(addr, src_addr, rdma_addr_size(src_addr));
438 if (!status && !id_priv->cma_dev) {
439 status = cma_acquire_dev(id_priv, NULL);
440 if (status)
441 @@ -2871,6 +2880,8 @@ static void addr_handler(int status, struct sockaddr *src_addr,
442 }
443
444 if (status) {
445 + memcpy(addr, &old_addr,
446 + rdma_addr_size((struct sockaddr *)&old_addr));
447 if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_RESOLVED,
448 RDMA_CM_ADDR_BOUND))
449 goto out;
450 diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
451 index 27500abe8ca7..0b3877681e4a 100644
452 --- a/drivers/iommu/amd_iommu.c
453 +++ b/drivers/iommu/amd_iommu.c
454 @@ -2543,7 +2543,12 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
455
456 /* Everything is mapped - write the right values into s->dma_address */
457 for_each_sg(sglist, s, nelems, i) {
458 - s->dma_address += address + s->offset;
459 + /*
460 + * Add in the remaining piece of the scatter-gather offset that
461 + * was masked out when we were determining the physical address
462 + * via (sg_phys(s) & PAGE_MASK) earlier.
463 + */
464 + s->dma_address += address + (s->offset & ~PAGE_MASK);
465 s->dma_length = s->length;
466 }
467
468 diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
469 index 78970cdf2ef6..65ab2c80529c 100644
470 --- a/drivers/irqchip/irq-gic-v3-its.c
471 +++ b/drivers/irqchip/irq-gic-v3-its.c
472 @@ -1477,7 +1477,7 @@ static int lpi_range_cmp(void *priv, struct list_head *a, struct list_head *b)
473 ra = container_of(a, struct lpi_range, entry);
474 rb = container_of(b, struct lpi_range, entry);
475
476 - return rb->base_id - ra->base_id;
477 + return ra->base_id - rb->base_id;
478 }
479
480 static void merge_lpi_ranges(void)
481 diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
482 index c2ad102bd693..467b1ddaf4e7 100644
483 --- a/drivers/media/usb/uvc/uvc_ctrl.c
484 +++ b/drivers/media/usb/uvc/uvc_ctrl.c
485 @@ -1212,7 +1212,7 @@ static void uvc_ctrl_fill_event(struct uvc_video_chain *chain,
486
487 __uvc_query_v4l2_ctrl(chain, ctrl, mapping, &v4l2_ctrl);
488
489 - memset(ev->reserved, 0, sizeof(ev->reserved));
490 + memset(ev, 0, sizeof(*ev));
491 ev->type = V4L2_EVENT_CTRL;
492 ev->id = v4l2_ctrl.id;
493 ev->u.ctrl.value = value;
494 diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
495 index 599c1cbff3b9..6ac5f5d42615 100644
496 --- a/drivers/media/v4l2-core/v4l2-ctrls.c
497 +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
498 @@ -1379,7 +1379,7 @@ static u32 user_flags(const struct v4l2_ctrl *ctrl)
499
500 static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes)
501 {
502 - memset(ev->reserved, 0, sizeof(ev->reserved));
503 + memset(ev, 0, sizeof(*ev));
504 ev->type = V4L2_EVENT_CTRL;
505 ev->id = ctrl->id;
506 ev->u.ctrl.changes = changes;
507 diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
508 index de4e6e5bf304..2f604b312767 100644
509 --- a/drivers/mmc/host/mxcmmc.c
510 +++ b/drivers/mmc/host/mxcmmc.c
511 @@ -292,11 +292,8 @@ static void mxcmci_swap_buffers(struct mmc_data *data)
512 struct scatterlist *sg;
513 int i;
514
515 - for_each_sg(data->sg, sg, data->sg_len, i) {
516 - void *buf = kmap_atomic(sg_page(sg) + sg->offset);
517 - buffer_swap32(buf, sg->length);
518 - kunmap_atomic(buf);
519 - }
520 + for_each_sg(data->sg, sg, data->sg_len, i)
521 + buffer_swap32(sg_virt(sg), sg->length);
522 }
523 #else
524 static inline void mxcmci_swap_buffers(struct mmc_data *data) {}
525 @@ -613,7 +610,6 @@ static int mxcmci_transfer_data(struct mxcmci_host *host)
526 {
527 struct mmc_data *data = host->req->data;
528 struct scatterlist *sg;
529 - void *buf;
530 int stat, i;
531
532 host->data = data;
533 @@ -621,18 +617,14 @@ static int mxcmci_transfer_data(struct mxcmci_host *host)
534
535 if (data->flags & MMC_DATA_READ) {
536 for_each_sg(data->sg, sg, data->sg_len, i) {
537 - buf = kmap_atomic(sg_page(sg) + sg->offset);
538 - stat = mxcmci_pull(host, buf, sg->length);
539 - kunmap(buf);
540 + stat = mxcmci_pull(host, sg_virt(sg), sg->length);
541 if (stat)
542 return stat;
543 host->datasize += sg->length;
544 }
545 } else {
546 for_each_sg(data->sg, sg, data->sg_len, i) {
547 - buf = kmap_atomic(sg_page(sg) + sg->offset);
548 - stat = mxcmci_push(host, buf, sg->length);
549 - kunmap(buf);
550 + stat = mxcmci_push(host, sg_virt(sg), sg->length);
551 if (stat)
552 return stat;
553 host->datasize += sg->length;
554 diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
555 index f7ffbf1676b1..00b5465dfb0c 100644
556 --- a/drivers/mmc/host/pxamci.c
557 +++ b/drivers/mmc/host/pxamci.c
558 @@ -164,7 +164,7 @@ static void pxamci_dma_irq(void *param);
559 static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
560 {
561 struct dma_async_tx_descriptor *tx;
562 - enum dma_data_direction direction;
563 + enum dma_transfer_direction direction;
564 struct dma_slave_config config;
565 struct dma_chan *chan;
566 unsigned int nob = data->blocks;
567 diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
568 index 777e32b0e410..45baf5d9120e 100644
569 --- a/drivers/mmc/host/renesas_sdhi_core.c
570 +++ b/drivers/mmc/host/renesas_sdhi_core.c
571 @@ -557,6 +557,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
572 struct renesas_sdhi *priv;
573 struct resource *res;
574 int irq, ret, i;
575 + u16 ver;
576
577 of_data = of_device_get_match_data(&pdev->dev);
578
579 @@ -671,12 +672,17 @@ int renesas_sdhi_probe(struct platform_device *pdev,
580 if (ret)
581 goto efree;
582
583 + ver = sd_ctrl_read16(host, CTL_VERSION);
584 + /* GEN2_SDR104 is first known SDHI to use 32bit block count */
585 + if (ver < SDHI_VER_GEN2_SDR104 && mmc_data->max_blk_count > U16_MAX)
586 + mmc_data->max_blk_count = U16_MAX;
587 +
588 ret = tmio_mmc_host_probe(host);
589 if (ret < 0)
590 goto edisclk;
591
592 /* One Gen2 SDHI incarnation does NOT have a CBSY bit */
593 - if (sd_ctrl_read16(host, CTL_VERSION) == SDHI_VER_GEN2_SDR50)
594 + if (ver == SDHI_VER_GEN2_SDR50)
595 mmc_data->flags &= ~TMIO_MMC_HAVE_CBSY;
596
597 /* Enable tuning iff we have an SCC and a supported mode */
598 diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
599 index faa1a67cf3d2..7ae983e37f64 100644
600 --- a/drivers/power/supply/charger-manager.c
601 +++ b/drivers/power/supply/charger-manager.c
602 @@ -1212,7 +1212,6 @@ static int charger_extcon_init(struct charger_manager *cm,
603 if (ret < 0) {
604 pr_info("Cannot register extcon_dev for %s(cable: %s)\n",
605 cable->extcon_name, cable->name);
606 - ret = -EINVAL;
607 }
608
609 return ret;
610 @@ -1633,7 +1632,7 @@ static int charger_manager_probe(struct platform_device *pdev)
611
612 if (IS_ERR(desc)) {
613 dev_err(&pdev->dev, "No platform data (desc) found\n");
614 - return -ENODEV;
615 + return PTR_ERR(desc);
616 }
617
618 cm = devm_kzalloc(&pdev->dev, sizeof(*cm), GFP_KERNEL);
619 diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
620 index 9df8a1a2299c..e60822f07653 100644
621 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
622 +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
623 @@ -96,6 +96,7 @@ static int client_reserve = 1;
624 static char partition_name[96] = "UNKNOWN";
625 static unsigned int partition_number = -1;
626 static LIST_HEAD(ibmvscsi_head);
627 +static DEFINE_SPINLOCK(ibmvscsi_driver_lock);
628
629 static struct scsi_transport_template *ibmvscsi_transport_template;
630
631 @@ -2271,7 +2272,9 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
632 }
633
634 dev_set_drvdata(&vdev->dev, hostdata);
635 + spin_lock(&ibmvscsi_driver_lock);
636 list_add_tail(&hostdata->host_list, &ibmvscsi_head);
637 + spin_unlock(&ibmvscsi_driver_lock);
638 return 0;
639
640 add_srp_port_failed:
641 @@ -2293,15 +2296,27 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
642 static int ibmvscsi_remove(struct vio_dev *vdev)
643 {
644 struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev);
645 - list_del(&hostdata->host_list);
646 - unmap_persist_bufs(hostdata);
647 + unsigned long flags;
648 +
649 + srp_remove_host(hostdata->host);
650 + scsi_remove_host(hostdata->host);
651 +
652 + purge_requests(hostdata, DID_ERROR);
653 +
654 + spin_lock_irqsave(hostdata->host->host_lock, flags);
655 release_event_pool(&hostdata->pool, hostdata);
656 + spin_unlock_irqrestore(hostdata->host->host_lock, flags);
657 +
658 ibmvscsi_release_crq_queue(&hostdata->queue, hostdata,
659 max_events);
660
661 kthread_stop(hostdata->work_thread);
662 - srp_remove_host(hostdata->host);
663 - scsi_remove_host(hostdata->host);
664 + unmap_persist_bufs(hostdata);
665 +
666 + spin_lock(&ibmvscsi_driver_lock);
667 + list_del(&hostdata->host_list);
668 + spin_unlock(&ibmvscsi_driver_lock);
669 +
670 scsi_host_put(hostdata->host);
671
672 return 0;
673 diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
674 index a2d701775c49..3d0db37d64ad 100644
675 --- a/fs/cifs/smb2pdu.c
676 +++ b/fs/cifs/smb2pdu.c
677 @@ -1500,9 +1500,16 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
678 iov[1].iov_base = unc_path;
679 iov[1].iov_len = unc_path_len;
680
681 - /* 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1 */
682 + /*
683 + * 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1
684 + * unless it is guest or anonymous user. See MS-SMB2 3.2.5.3.1
685 + * (Samba servers don't always set the flag so also check if null user)
686 + */
687 if ((ses->server->dialect == SMB311_PROT_ID) &&
688 - !smb3_encryption_required(tcon))
689 + !smb3_encryption_required(tcon) &&
690 + !(ses->session_flags &
691 + (SMB2_SESSION_FLAG_IS_GUEST|SMB2_SESSION_FLAG_IS_NULL)) &&
692 + ((ses->user_name != NULL) || (ses->sectype == Kerberos)))
693 req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
694
695 memset(&rqst, 0, sizeof(struct smb_rqst));
696 diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
697 index 15b6dd733780..df908ef79cce 100644
698 --- a/fs/ext4/ext4_jbd2.h
699 +++ b/fs/ext4/ext4_jbd2.h
700 @@ -384,7 +384,7 @@ static inline void ext4_update_inode_fsync_trans(handle_t *handle,
701 {
702 struct ext4_inode_info *ei = EXT4_I(inode);
703
704 - if (ext4_handle_valid(handle)) {
705 + if (ext4_handle_valid(handle) && !is_handle_aborted(handle)) {
706 ei->i_sync_tid = handle->h_transaction->t_tid;
707 if (datasync)
708 ei->i_datasync_tid = handle->h_transaction->t_tid;
709 diff --git a/fs/ext4/file.c b/fs/ext4/file.c
710 index 69d65d49837b..98ec11f69cd4 100644
711 --- a/fs/ext4/file.c
712 +++ b/fs/ext4/file.c
713 @@ -125,7 +125,7 @@ ext4_unaligned_aio(struct inode *inode, struct iov_iter *from, loff_t pos)
714 struct super_block *sb = inode->i_sb;
715 int blockmask = sb->s_blocksize - 1;
716
717 - if (pos >= i_size_read(inode))
718 + if (pos >= ALIGN(i_size_read(inode), sb->s_blocksize))
719 return 0;
720
721 if ((pos | iov_iter_alignment(from)) & blockmask)
722 diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
723 index bf7fa1507e81..9e96a0bd08d9 100644
724 --- a/fs/ext4/indirect.c
725 +++ b/fs/ext4/indirect.c
726 @@ -1387,10 +1387,14 @@ end_range:
727 partial->p + 1,
728 partial2->p,
729 (chain+n-1) - partial);
730 - BUFFER_TRACE(partial->bh, "call brelse");
731 - brelse(partial->bh);
732 - BUFFER_TRACE(partial2->bh, "call brelse");
733 - brelse(partial2->bh);
734 + while (partial > chain) {
735 + BUFFER_TRACE(partial->bh, "call brelse");
736 + brelse(partial->bh);
737 + }
738 + while (partial2 > chain2) {
739 + BUFFER_TRACE(partial2->bh, "call brelse");
740 + brelse(partial2->bh);
741 + }
742 return 0;
743 }
744
745 diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
746 index 30779aaa9dba..1fa6f8185766 100644
747 --- a/fs/f2fs/segment.c
748 +++ b/fs/f2fs/segment.c
749 @@ -216,7 +216,8 @@ void f2fs_register_inmem_page(struct inode *inode, struct page *page)
750 }
751
752 static int __revoke_inmem_pages(struct inode *inode,
753 - struct list_head *head, bool drop, bool recover)
754 + struct list_head *head, bool drop, bool recover,
755 + bool trylock)
756 {
757 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
758 struct inmem_pages *cur, *tmp;
759 @@ -228,7 +229,16 @@ static int __revoke_inmem_pages(struct inode *inode,
760 if (drop)
761 trace_f2fs_commit_inmem_page(page, INMEM_DROP);
762
763 - lock_page(page);
764 + if (trylock) {
765 + /*
766 + * to avoid deadlock in between page lock and
767 + * inmem_lock.
768 + */
769 + if (!trylock_page(page))
770 + continue;
771 + } else {
772 + lock_page(page);
773 + }
774
775 f2fs_wait_on_page_writeback(page, DATA, true);
776
777 @@ -317,13 +327,19 @@ void f2fs_drop_inmem_pages(struct inode *inode)
778 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
779 struct f2fs_inode_info *fi = F2FS_I(inode);
780
781 - mutex_lock(&fi->inmem_lock);
782 - __revoke_inmem_pages(inode, &fi->inmem_pages, true, false);
783 - spin_lock(&sbi->inode_lock[ATOMIC_FILE]);
784 - if (!list_empty(&fi->inmem_ilist))
785 - list_del_init(&fi->inmem_ilist);
786 - spin_unlock(&sbi->inode_lock[ATOMIC_FILE]);
787 - mutex_unlock(&fi->inmem_lock);
788 + while (!list_empty(&fi->inmem_pages)) {
789 + mutex_lock(&fi->inmem_lock);
790 + __revoke_inmem_pages(inode, &fi->inmem_pages,
791 + true, false, true);
792 +
793 + if (list_empty(&fi->inmem_pages)) {
794 + spin_lock(&sbi->inode_lock[ATOMIC_FILE]);
795 + if (!list_empty(&fi->inmem_ilist))
796 + list_del_init(&fi->inmem_ilist);
797 + spin_unlock(&sbi->inode_lock[ATOMIC_FILE]);
798 + }
799 + mutex_unlock(&fi->inmem_lock);
800 + }
801
802 clear_inode_flag(inode, FI_ATOMIC_FILE);
803 fi->i_gc_failures[GC_FAILURE_ATOMIC] = 0;
804 @@ -427,12 +443,15 @@ retry:
805 * recovery or rewrite & commit last transaction. For other
806 * error number, revoking was done by filesystem itself.
807 */
808 - err = __revoke_inmem_pages(inode, &revoke_list, false, true);
809 + err = __revoke_inmem_pages(inode, &revoke_list,
810 + false, true, false);
811
812 /* drop all uncommitted pages */
813 - __revoke_inmem_pages(inode, &fi->inmem_pages, true, false);
814 + __revoke_inmem_pages(inode, &fi->inmem_pages,
815 + true, false, false);
816 } else {
817 - __revoke_inmem_pages(inode, &revoke_list, false, false);
818 + __revoke_inmem_pages(inode, &revoke_list,
819 + false, false, false);
820 }
821
822 return err;
823 diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
824 index b647f0bd150c..94220ba85628 100644
825 --- a/fs/udf/truncate.c
826 +++ b/fs/udf/truncate.c
827 @@ -260,6 +260,9 @@ void udf_truncate_extents(struct inode *inode)
828 epos.block = eloc;
829 epos.bh = udf_tread(sb,
830 udf_get_lb_pblock(sb, &eloc, 0));
831 + /* Error reading indirect block? */
832 + if (!epos.bh)
833 + return;
834 if (elen)
835 indirect_ext_len =
836 (elen + sb->s_blocksize - 1) >>
837 diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
838 index 68bb09c29ce8..0b589e684554 100644
839 --- a/include/linux/ceph/libceph.h
840 +++ b/include/linux/ceph/libceph.h
841 @@ -292,6 +292,8 @@ extern void ceph_destroy_client(struct ceph_client *client);
842 extern int __ceph_open_session(struct ceph_client *client,
843 unsigned long started);
844 extern int ceph_open_session(struct ceph_client *client);
845 +int ceph_wait_for_latest_osdmap(struct ceph_client *client,
846 + unsigned long timeout);
847
848 /* pagevec.c */
849 extern void ceph_release_page_vector(struct page **pages, int num_pages);
850 diff --git a/kernel/futex.c b/kernel/futex.c
851 index c5fca746edc4..5a26d843a015 100644
852 --- a/kernel/futex.c
853 +++ b/kernel/futex.c
854 @@ -3432,6 +3432,10 @@ int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi)
855 {
856 u32 uval, uninitialized_var(nval), mval;
857
858 + /* Futex address must be 32bit aligned */
859 + if ((((unsigned long)uaddr) % sizeof(*uaddr)) != 0)
860 + return -1;
861 +
862 retry:
863 if (get_user(uval, uaddr))
864 return -1;
865 diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
866 index 26b57e24476f..0cbdbbb0729f 100644
867 --- a/kernel/locking/lockdep.c
868 +++ b/kernel/locking/lockdep.c
869 @@ -3567,6 +3567,9 @@ __lock_set_class(struct lockdep_map *lock, const char *name,
870 unsigned int depth;
871 int i;
872
873 + if (unlikely(!debug_locks))
874 + return 0;
875 +
876 depth = curr->lockdep_depth;
877 /*
878 * This function is about (re)setting the class of a held lock,
879 diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
880 index 1506e1632394..d4e2a166ae17 100644
881 --- a/net/bluetooth/hci_sock.c
882 +++ b/net/bluetooth/hci_sock.c
883 @@ -831,8 +831,6 @@ static int hci_sock_release(struct socket *sock)
884 if (!sk)
885 return 0;
886
887 - hdev = hci_pi(sk)->hdev;
888 -
889 switch (hci_pi(sk)->channel) {
890 case HCI_CHANNEL_MONITOR:
891 atomic_dec(&monitor_promisc);
892 @@ -854,6 +852,7 @@ static int hci_sock_release(struct socket *sock)
893
894 bt_sock_unlink(&hci_sk_list, sk);
895
896 + hdev = hci_pi(sk)->hdev;
897 if (hdev) {
898 if (hci_pi(sk)->channel == HCI_CHANNEL_USER) {
899 /* When releasing a user channel exclusive access,
900 diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
901 index 6693e209efe8..f77888ec93f1 100644
902 --- a/net/bridge/netfilter/ebtables.c
903 +++ b/net/bridge/netfilter/ebtables.c
904 @@ -31,10 +31,6 @@
905 /* needed for logical [in,out]-dev filtering */
906 #include "../br_private.h"
907
908 -#define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\
909 - "report to author: "format, ## args)
910 -/* #define BUGPRINT(format, args...) */
911 -
912 /* Each cpu has its own set of counters, so there is no need for write_lock in
913 * the softirq
914 * For reading or updating the counters, the user context needs to
915 @@ -466,8 +462,6 @@ static int ebt_verify_pointers(const struct ebt_replace *repl,
916 /* we make userspace set this right,
917 * so there is no misunderstanding
918 */
919 - BUGPRINT("EBT_ENTRY_OR_ENTRIES shouldn't be set "
920 - "in distinguisher\n");
921 return -EINVAL;
922 }
923 if (i != NF_BR_NUMHOOKS)
924 @@ -485,18 +479,14 @@ static int ebt_verify_pointers(const struct ebt_replace *repl,
925 offset += e->next_offset;
926 }
927 }
928 - if (offset != limit) {
929 - BUGPRINT("entries_size too small\n");
930 + if (offset != limit)
931 return -EINVAL;
932 - }
933
934 /* check if all valid hooks have a chain */
935 for (i = 0; i < NF_BR_NUMHOOKS; i++) {
936 if (!newinfo->hook_entry[i] &&
937 - (valid_hooks & (1 << i))) {
938 - BUGPRINT("Valid hook without chain\n");
939 + (valid_hooks & (1 << i)))
940 return -EINVAL;
941 - }
942 }
943 return 0;
944 }
945 @@ -523,26 +513,20 @@ ebt_check_entry_size_and_hooks(const struct ebt_entry *e,
946 /* this checks if the previous chain has as many entries
947 * as it said it has
948 */
949 - if (*n != *cnt) {
950 - BUGPRINT("nentries does not equal the nr of entries "
951 - "in the chain\n");
952 + if (*n != *cnt)
953 return -EINVAL;
954 - }
955 +
956 if (((struct ebt_entries *)e)->policy != EBT_DROP &&
957 ((struct ebt_entries *)e)->policy != EBT_ACCEPT) {
958 /* only RETURN from udc */
959 if (i != NF_BR_NUMHOOKS ||
960 - ((struct ebt_entries *)e)->policy != EBT_RETURN) {
961 - BUGPRINT("bad policy\n");
962 + ((struct ebt_entries *)e)->policy != EBT_RETURN)
963 return -EINVAL;
964 - }
965 }
966 if (i == NF_BR_NUMHOOKS) /* it's a user defined chain */
967 (*udc_cnt)++;
968 - if (((struct ebt_entries *)e)->counter_offset != *totalcnt) {
969 - BUGPRINT("counter_offset != totalcnt");
970 + if (((struct ebt_entries *)e)->counter_offset != *totalcnt)
971 return -EINVAL;
972 - }
973 *n = ((struct ebt_entries *)e)->nentries;
974 *cnt = 0;
975 return 0;
976 @@ -550,15 +534,13 @@ ebt_check_entry_size_and_hooks(const struct ebt_entry *e,
977 /* a plain old entry, heh */
978 if (sizeof(struct ebt_entry) > e->watchers_offset ||
979 e->watchers_offset > e->target_offset ||
980 - e->target_offset >= e->next_offset) {
981 - BUGPRINT("entry offsets not in right order\n");
982 + e->target_offset >= e->next_offset)
983 return -EINVAL;
984 - }
985 +
986 /* this is not checked anywhere else */
987 - if (e->next_offset - e->target_offset < sizeof(struct ebt_entry_target)) {
988 - BUGPRINT("target size too small\n");
989 + if (e->next_offset - e->target_offset < sizeof(struct ebt_entry_target))
990 return -EINVAL;
991 - }
992 +
993 (*cnt)++;
994 (*totalcnt)++;
995 return 0;
996 @@ -678,18 +660,15 @@ ebt_check_entry(struct ebt_entry *e, struct net *net,
997 if (e->bitmask == 0)
998 return 0;
999
1000 - if (e->bitmask & ~EBT_F_MASK) {
1001 - BUGPRINT("Unknown flag for bitmask\n");
1002 + if (e->bitmask & ~EBT_F_MASK)
1003 return -EINVAL;
1004 - }
1005 - if (e->invflags & ~EBT_INV_MASK) {
1006 - BUGPRINT("Unknown flag for inv bitmask\n");
1007 +
1008 + if (e->invflags & ~EBT_INV_MASK)
1009 return -EINVAL;
1010 - }
1011 - if ((e->bitmask & EBT_NOPROTO) && (e->bitmask & EBT_802_3)) {
1012 - BUGPRINT("NOPROTO & 802_3 not allowed\n");
1013 +
1014 + if ((e->bitmask & EBT_NOPROTO) && (e->bitmask & EBT_802_3))
1015 return -EINVAL;
1016 - }
1017 +
1018 /* what hook do we belong to? */
1019 for (i = 0; i < NF_BR_NUMHOOKS; i++) {
1020 if (!newinfo->hook_entry[i])
1021 @@ -748,13 +727,11 @@ ebt_check_entry(struct ebt_entry *e, struct net *net,
1022 t->u.target = target;
1023 if (t->u.target == &ebt_standard_target) {
1024 if (gap < sizeof(struct ebt_standard_target)) {
1025 - BUGPRINT("Standard target size too big\n");
1026 ret = -EFAULT;
1027 goto cleanup_watchers;
1028 }
1029 if (((struct ebt_standard_target *)t)->verdict <
1030 -NUM_STANDARD_TARGETS) {
1031 - BUGPRINT("Invalid standard target\n");
1032 ret = -EFAULT;
1033 goto cleanup_watchers;
1034 }
1035 @@ -813,10 +790,9 @@ static int check_chainloops(const struct ebt_entries *chain, struct ebt_cl_stack
1036 if (strcmp(t->u.name, EBT_STANDARD_TARGET))
1037 goto letscontinue;
1038 if (e->target_offset + sizeof(struct ebt_standard_target) >
1039 - e->next_offset) {
1040 - BUGPRINT("Standard target size too big\n");
1041 + e->next_offset)
1042 return -1;
1043 - }
1044 +
1045 verdict = ((struct ebt_standard_target *)t)->verdict;
1046 if (verdict >= 0) { /* jump to another chain */
1047 struct ebt_entries *hlp2 =
1048 @@ -825,14 +801,12 @@ static int check_chainloops(const struct ebt_entries *chain, struct ebt_cl_stack
1049 if (hlp2 == cl_s[i].cs.chaininfo)
1050 break;
1051 /* bad destination or loop */
1052 - if (i == udc_cnt) {
1053 - BUGPRINT("bad destination\n");
1054 + if (i == udc_cnt)
1055 return -1;
1056 - }
1057 - if (cl_s[i].cs.n) {
1058 - BUGPRINT("loop\n");
1059 +
1060 + if (cl_s[i].cs.n)
1061 return -1;
1062 - }
1063 +
1064 if (cl_s[i].hookmask & (1 << hooknr))
1065 goto letscontinue;
1066 /* this can't be 0, so the loop test is correct */
1067 @@ -865,24 +839,21 @@ static int translate_table(struct net *net, const char *name,
1068 i = 0;
1069 while (i < NF_BR_NUMHOOKS && !newinfo->hook_entry[i])
1070 i++;
1071 - if (i == NF_BR_NUMHOOKS) {
1072 - BUGPRINT("No valid hooks specified\n");
1073 + if (i == NF_BR_NUMHOOKS)
1074 return -EINVAL;
1075 - }
1076 - if (newinfo->hook_entry[i] != (struct ebt_entries *)newinfo->entries) {
1077 - BUGPRINT("Chains don't start at beginning\n");
1078 +
1079 + if (newinfo->hook_entry[i] != (struct ebt_entries *)newinfo->entries)
1080 return -EINVAL;
1081 - }
1082 +
1083 /* make sure chains are ordered after each other in same order
1084 * as their corresponding hooks
1085 */
1086 for (j = i + 1; j < NF_BR_NUMHOOKS; j++) {
1087 if (!newinfo->hook_entry[j])
1088 continue;
1089 - if (newinfo->hook_entry[j] <= newinfo->hook_entry[i]) {
1090 - BUGPRINT("Hook order must be followed\n");
1091 + if (newinfo->hook_entry[j] <= newinfo->hook_entry[i])
1092 return -EINVAL;
1093 - }
1094 +
1095 i = j;
1096 }
1097
1098 @@ -900,15 +871,11 @@ static int translate_table(struct net *net, const char *name,
1099 if (ret != 0)
1100 return ret;
1101
1102 - if (i != j) {
1103 - BUGPRINT("nentries does not equal the nr of entries in the "
1104 - "(last) chain\n");
1105 + if (i != j)
1106 return -EINVAL;
1107 - }
1108 - if (k != newinfo->nentries) {
1109 - BUGPRINT("Total nentries is wrong\n");
1110 +
1111 + if (k != newinfo->nentries)
1112 return -EINVAL;
1113 - }
1114
1115 /* get the location of the udc, put them in an array
1116 * while we're at it, allocate the chainstack
1117 @@ -942,7 +909,6 @@ static int translate_table(struct net *net, const char *name,
1118 ebt_get_udc_positions, newinfo, &i, cl_s);
1119 /* sanity check */
1120 if (i != udc_cnt) {
1121 - BUGPRINT("i != udc_cnt\n");
1122 vfree(cl_s);
1123 return -EFAULT;
1124 }
1125 @@ -1042,7 +1008,6 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
1126 goto free_unlock;
1127
1128 if (repl->num_counters && repl->num_counters != t->private->nentries) {
1129 - BUGPRINT("Wrong nr. of counters requested\n");
1130 ret = -EINVAL;
1131 goto free_unlock;
1132 }
1133 @@ -1118,15 +1083,12 @@ static int do_replace(struct net *net, const void __user *user,
1134 if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
1135 return -EFAULT;
1136
1137 - if (len != sizeof(tmp) + tmp.entries_size) {
1138 - BUGPRINT("Wrong len argument\n");
1139 + if (len != sizeof(tmp) + tmp.entries_size)
1140 return -EINVAL;
1141 - }
1142
1143 - if (tmp.entries_size == 0) {
1144 - BUGPRINT("Entries_size never zero\n");
1145 + if (tmp.entries_size == 0)
1146 return -EINVAL;
1147 - }
1148 +
1149 /* overflow check */
1150 if (tmp.nentries >= ((INT_MAX - sizeof(struct ebt_table_info)) /
1151 NR_CPUS - SMP_CACHE_BYTES) / sizeof(struct ebt_counter))
1152 @@ -1153,7 +1115,6 @@ static int do_replace(struct net *net, const void __user *user,
1153 }
1154 if (copy_from_user(
1155 newinfo->entries, tmp.entries, tmp.entries_size) != 0) {
1156 - BUGPRINT("Couldn't copy entries from userspace\n");
1157 ret = -EFAULT;
1158 goto free_entries;
1159 }
1160 @@ -1194,10 +1155,8 @@ int ebt_register_table(struct net *net, const struct ebt_table *input_table,
1161
1162 if (input_table == NULL || (repl = input_table->table) == NULL ||
1163 repl->entries == NULL || repl->entries_size == 0 ||
1164 - repl->counters != NULL || input_table->private != NULL) {
1165 - BUGPRINT("Bad table data for ebt_register_table!!!\n");
1166 + repl->counters != NULL || input_table->private != NULL)
1167 return -EINVAL;
1168 - }
1169
1170 /* Don't add one table to multiple lists. */
1171 table = kmemdup(input_table, sizeof(struct ebt_table), GFP_KERNEL);
1172 @@ -1235,13 +1194,10 @@ int ebt_register_table(struct net *net, const struct ebt_table *input_table,
1173 ((char *)repl->hook_entry[i] - repl->entries);
1174 }
1175 ret = translate_table(net, repl->name, newinfo);
1176 - if (ret != 0) {
1177 - BUGPRINT("Translate_table failed\n");
1178 + if (ret != 0)
1179 goto free_chainstack;
1180 - }
1181
1182 if (table->check && table->check(newinfo, table->valid_hooks)) {
1183 - BUGPRINT("The table doesn't like its own initial data, lol\n");
1184 ret = -EINVAL;
1185 goto free_chainstack;
1186 }
1187 @@ -1252,7 +1208,6 @@ int ebt_register_table(struct net *net, const struct ebt_table *input_table,
1188 list_for_each_entry(t, &net->xt.tables[NFPROTO_BRIDGE], list) {
1189 if (strcmp(t->name, table->name) == 0) {
1190 ret = -EEXIST;
1191 - BUGPRINT("Table name already exists\n");
1192 goto free_unlock;
1193 }
1194 }
1195 @@ -1320,7 +1275,6 @@ static int do_update_counters(struct net *net, const char *name,
1196 goto free_tmp;
1197
1198 if (num_counters != t->private->nentries) {
1199 - BUGPRINT("Wrong nr of counters\n");
1200 ret = -EINVAL;
1201 goto unlock_mutex;
1202 }
1203 @@ -1447,10 +1401,8 @@ static int copy_counters_to_user(struct ebt_table *t,
1204 if (num_counters == 0)
1205 return 0;
1206
1207 - if (num_counters != nentries) {
1208 - BUGPRINT("Num_counters wrong\n");
1209 + if (num_counters != nentries)
1210 return -EINVAL;
1211 - }
1212
1213 counterstmp = vmalloc(array_size(nentries, sizeof(*counterstmp)));
1214 if (!counterstmp)
1215 @@ -1496,15 +1448,11 @@ static int copy_everything_to_user(struct ebt_table *t, void __user *user,
1216 (tmp.num_counters ? nentries * sizeof(struct ebt_counter) : 0))
1217 return -EINVAL;
1218
1219 - if (tmp.nentries != nentries) {
1220 - BUGPRINT("Nentries wrong\n");
1221 + if (tmp.nentries != nentries)
1222 return -EINVAL;
1223 - }
1224
1225 - if (tmp.entries_size != entries_size) {
1226 - BUGPRINT("Wrong size\n");
1227 + if (tmp.entries_size != entries_size)
1228 return -EINVAL;
1229 - }
1230
1231 ret = copy_counters_to_user(t, oldcounters, tmp.counters,
1232 tmp.num_counters, nentries);
1233 @@ -1576,7 +1524,6 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
1234 }
1235 mutex_unlock(&ebt_mutex);
1236 if (copy_to_user(user, &tmp, *len) != 0) {
1237 - BUGPRINT("c2u Didn't work\n");
1238 ret = -EFAULT;
1239 break;
1240 }
1241 diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
1242 index 87afb9ec4c68..20f0c3d7ed50 100644
1243 --- a/net/ceph/ceph_common.c
1244 +++ b/net/ceph/ceph_common.c
1245 @@ -729,7 +729,6 @@ int __ceph_open_session(struct ceph_client *client, unsigned long started)
1246 }
1247 EXPORT_SYMBOL(__ceph_open_session);
1248
1249 -
1250 int ceph_open_session(struct ceph_client *client)
1251 {
1252 int ret;
1253 @@ -745,6 +744,23 @@ int ceph_open_session(struct ceph_client *client)
1254 }
1255 EXPORT_SYMBOL(ceph_open_session);
1256
1257 +int ceph_wait_for_latest_osdmap(struct ceph_client *client,
1258 + unsigned long timeout)
1259 +{
1260 + u64 newest_epoch;
1261 + int ret;
1262 +
1263 + ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch);
1264 + if (ret)
1265 + return ret;
1266 +
1267 + if (client->osdc.osdmap->epoch >= newest_epoch)
1268 + return 0;
1269 +
1270 + ceph_osdc_maybe_request_map(&client->osdc);
1271 + return ceph_monc_wait_osdmap(&client->monc, newest_epoch, timeout);
1272 +}
1273 +EXPORT_SYMBOL(ceph_wait_for_latest_osdmap);
1274
1275 static int __init init_ceph_lib(void)
1276 {
1277 diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
1278 index 18deb3d889c4..a53e4fbb6319 100644
1279 --- a/net/ceph/mon_client.c
1280 +++ b/net/ceph/mon_client.c
1281 @@ -922,6 +922,15 @@ int ceph_monc_blacklist_add(struct ceph_mon_client *monc,
1282 mutex_unlock(&monc->mutex);
1283
1284 ret = wait_generic_request(req);
1285 + if (!ret)
1286 + /*
1287 + * Make sure we have the osdmap that includes the blacklist
1288 + * entry. This is needed to ensure that the OSDs pick up the
1289 + * new blacklist before processing any future requests from
1290 + * this client.
1291 + */
1292 + ret = ceph_wait_for_latest_osdmap(monc->client, 0);
1293 +
1294 out:
1295 put_generic_request(req);
1296 return ret;
1297 diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c
1298 index 9f0c480489ef..9cbf6927abe9 100644
1299 --- a/sound/ac97/bus.c
1300 +++ b/sound/ac97/bus.c
1301 @@ -84,7 +84,7 @@ ac97_of_get_child_device(struct ac97_controller *ac97_ctrl, int idx,
1302 if ((idx != of_property_read_u32(node, "reg", &reg)) ||
1303 !of_device_is_compatible(node, compat))
1304 continue;
1305 - return of_node_get(node);
1306 + return node;
1307 }
1308
1309 return NULL;
1310 diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
1311 index 300d31b6f191..743015e87a96 100644
1312 --- a/sound/firewire/motu/motu.c
1313 +++ b/sound/firewire/motu/motu.c
1314 @@ -36,7 +36,7 @@ static void name_card(struct snd_motu *motu)
1315 fw_csr_iterator_init(&it, motu->unit->directory);
1316 while (fw_csr_iterator_next(&it, &key, &val)) {
1317 switch (key) {
1318 - case CSR_VERSION:
1319 + case CSR_MODEL:
1320 version = val;
1321 break;
1322 }
1323 @@ -46,7 +46,7 @@ static void name_card(struct snd_motu *motu)
1324 strcpy(motu->card->shortname, motu->spec->name);
1325 strcpy(motu->card->mixername, motu->spec->name);
1326 snprintf(motu->card->longname, sizeof(motu->card->longname),
1327 - "MOTU %s (version:%d), GUID %08x%08x at %s, S%d",
1328 + "MOTU %s (version:%06x), GUID %08x%08x at %s, S%d",
1329 motu->spec->name, version,
1330 fw_dev->config_rom[3], fw_dev->config_rom[4],
1331 dev_name(&motu->unit->device), 100 << fw_dev->max_speed);
1332 @@ -258,20 +258,20 @@ static const struct snd_motu_spec motu_audio_express = {
1333 #define SND_MOTU_DEV_ENTRY(model, data) \
1334 { \
1335 .match_flags = IEEE1394_MATCH_VENDOR_ID | \
1336 - IEEE1394_MATCH_MODEL_ID | \
1337 - IEEE1394_MATCH_SPECIFIER_ID, \
1338 + IEEE1394_MATCH_SPECIFIER_ID | \
1339 + IEEE1394_MATCH_VERSION, \
1340 .vendor_id = OUI_MOTU, \
1341 - .model_id = model, \
1342 .specifier_id = OUI_MOTU, \
1343 + .version = model, \
1344 .driver_data = (kernel_ulong_t)data, \
1345 }
1346
1347 static const struct ieee1394_device_id motu_id_table[] = {
1348 - SND_MOTU_DEV_ENTRY(0x101800, &motu_828mk2),
1349 - SND_MOTU_DEV_ENTRY(0x107800, &snd_motu_spec_traveler),
1350 - SND_MOTU_DEV_ENTRY(0x106800, &motu_828mk3), /* FireWire only. */
1351 - SND_MOTU_DEV_ENTRY(0x100800, &motu_828mk3), /* Hybrid. */
1352 - SND_MOTU_DEV_ENTRY(0x104800, &motu_audio_express),
1353 + SND_MOTU_DEV_ENTRY(0x000003, &motu_828mk2),
1354 + SND_MOTU_DEV_ENTRY(0x000009, &snd_motu_spec_traveler),
1355 + SND_MOTU_DEV_ENTRY(0x000015, &motu_828mk3), /* FireWire only. */
1356 + SND_MOTU_DEV_ENTRY(0x000035, &motu_828mk3), /* Hybrid. */
1357 + SND_MOTU_DEV_ENTRY(0x000033, &motu_audio_express),
1358 { }
1359 };
1360 MODULE_DEVICE_TABLE(ieee1394, motu_id_table);
1361 diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
1362 index 26d348b47867..21de8145f1a6 100644
1363 --- a/sound/pci/hda/hda_codec.c
1364 +++ b/sound/pci/hda/hda_codec.c
1365 @@ -2909,6 +2909,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
1366 hda_jackpoll_work(&codec->jackpoll_work.work);
1367 else
1368 snd_hda_jack_report_sync(codec);
1369 + codec->core.dev.power.power_state = PMSG_ON;
1370 snd_hdac_leave_pm(&codec->core);
1371 }
1372
1373 @@ -2942,10 +2943,62 @@ static int hda_codec_runtime_resume(struct device *dev)
1374 }
1375 #endif /* CONFIG_PM */
1376
1377 +#ifdef CONFIG_PM_SLEEP
1378 +static int hda_codec_force_resume(struct device *dev)
1379 +{
1380 + int ret;
1381 +
1382 + /* The get/put pair below enforces the runtime resume even if the
1383 + * device hasn't been used at suspend time. This trick is needed to
1384 + * update the jack state change during the sleep.
1385 + */
1386 + pm_runtime_get_noresume(dev);
1387 + ret = pm_runtime_force_resume(dev);
1388 + pm_runtime_put(dev);
1389 + return ret;
1390 +}
1391 +
1392 +static int hda_codec_pm_suspend(struct device *dev)
1393 +{
1394 + dev->power.power_state = PMSG_SUSPEND;
1395 + return pm_runtime_force_suspend(dev);
1396 +}
1397 +
1398 +static int hda_codec_pm_resume(struct device *dev)
1399 +{
1400 + dev->power.power_state = PMSG_RESUME;
1401 + return hda_codec_force_resume(dev);
1402 +}
1403 +
1404 +static int hda_codec_pm_freeze(struct device *dev)
1405 +{
1406 + dev->power.power_state = PMSG_FREEZE;
1407 + return pm_runtime_force_suspend(dev);
1408 +}
1409 +
1410 +static int hda_codec_pm_thaw(struct device *dev)
1411 +{
1412 + dev->power.power_state = PMSG_THAW;
1413 + return hda_codec_force_resume(dev);
1414 +}
1415 +
1416 +static int hda_codec_pm_restore(struct device *dev)
1417 +{
1418 + dev->power.power_state = PMSG_RESTORE;
1419 + return hda_codec_force_resume(dev);
1420 +}
1421 +#endif /* CONFIG_PM_SLEEP */
1422 +
1423 /* referred in hda_bind.c */
1424 const struct dev_pm_ops hda_codec_driver_pm = {
1425 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1426 - pm_runtime_force_resume)
1427 +#ifdef CONFIG_PM_SLEEP
1428 + .suspend = hda_codec_pm_suspend,
1429 + .resume = hda_codec_pm_resume,
1430 + .freeze = hda_codec_pm_freeze,
1431 + .thaw = hda_codec_pm_thaw,
1432 + .poweroff = hda_codec_pm_suspend,
1433 + .restore = hda_codec_pm_restore,
1434 +#endif /* CONFIG_PM_SLEEP */
1435 SET_RUNTIME_PM_OPS(hda_codec_runtime_suspend, hda_codec_runtime_resume,
1436 NULL)
1437 };
1438 diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
1439 index 1bb7613701ac..7572b8cc7127 100644
1440 --- a/sound/pci/hda/hda_intel.c
1441 +++ b/sound/pci/hda/hda_intel.c
1442 @@ -2274,10 +2274,12 @@ static struct snd_pci_quirk power_save_blacklist[] = {
1443 SND_PCI_QUIRK(0x8086, 0x2057, "Intel NUC5i7RYB", 0),
1444 /* https://bugzilla.redhat.com/show_bug.cgi?id=1520902 */
1445 SND_PCI_QUIRK(0x8086, 0x2068, "Intel NUC7i3BNB", 0),
1446 - /* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
1447 - SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0),
1448 /* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */
1449 SND_PCI_QUIRK(0x17aa, 0x2227, "Lenovo X1 Carbon 3rd Gen", 0),
1450 + /* https://bugzilla.redhat.com/show_bug.cgi?id=1689623 */
1451 + SND_PCI_QUIRK(0x17aa, 0x367b, "Lenovo IdeaCentre B550", 0),
1452 + /* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
1453 + SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0),
1454 {}
1455 };
1456 #endif /* CONFIG_PM */
1457 diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
1458 index dffd60cebc31..80f73810b21b 100644
1459 --- a/sound/pci/hda/patch_ca0132.c
1460 +++ b/sound/pci/hda/patch_ca0132.c
1461 @@ -7394,7 +7394,7 @@ static void ca0132_free(struct hda_codec *codec)
1462 ca0132_exit_chip(codec);
1463
1464 snd_hda_power_down(codec);
1465 - if (spec->mem_base)
1466 + if (IS_ENABLED(CONFIG_PCI) && spec->mem_base)
1467 pci_iounmap(codec->bus->pci, spec->mem_base);
1468 kfree(spec->spec_init_verbs);
1469 kfree(codec->spec);
1470 diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
1471 index fa7dca5a68c8..ec50d1d0b5fe 100644
1472 --- a/sound/x86/intel_hdmi_audio.c
1473 +++ b/sound/x86/intel_hdmi_audio.c
1474 @@ -1900,7 +1900,6 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
1475
1476 pm_runtime_use_autosuspend(&pdev->dev);
1477 pm_runtime_mark_last_busy(&pdev->dev);
1478 - pm_runtime_set_active(&pdev->dev);
1479
1480 dev_dbg(&pdev->dev, "%s: handle pending notification\n", __func__);
1481 for_each_port(card_ctx, port) {
1482 diff --git a/tools/objtool/check.c b/tools/objtool/check.c
1483 index 2928939b98ec..550f17611bd7 100644
1484 --- a/tools/objtool/check.c
1485 +++ b/tools/objtool/check.c
1486 @@ -2157,9 +2157,10 @@ static void cleanup(struct objtool_file *file)
1487 elf_close(file->elf);
1488 }
1489
1490 +static struct objtool_file file;
1491 +
1492 int check(const char *_objname, bool orc)
1493 {
1494 - struct objtool_file file;
1495 int ret, warnings = 0;
1496
1497 objname = _objname;
1498 diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
1499 index f119eb628dbb..a22e1f538aea 100644
1500 --- a/tools/perf/util/probe-event.c
1501 +++ b/tools/perf/util/probe-event.c
1502 @@ -157,8 +157,10 @@ static struct map *kernel_get_module_map(const char *module)
1503 if (module && strchr(module, '/'))
1504 return dso__new_map(module);
1505
1506 - if (!module)
1507 - module = "kernel";
1508 + if (!module) {
1509 + pos = machine__kernel_map(host_machine);
1510 + return map__get(pos);
1511 + }
1512
1513 for (pos = maps__first(maps); pos; pos = map__next(pos)) {
1514 /* short_name is "[module]" */