Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:3.18 commit in: /
Date: Wed, 30 Nov 2016 15:42:59
Message-Id: 1480520547.111437b328d0310b3e4cdc09a811ef99e1b64c5e.mpagano@gentoo
1 commit: 111437b328d0310b3e4cdc09a811ef99e1b64c5e
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 30 15:42:27 2016 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 30 15:42:27 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=111437b3
7
8 Linux patch 3.18.45
9
10 0000_README | 4 +
11 1044_linux-3.18.45.patch | 1239 ++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 1243 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index bfb562d..bdec9ea 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -219,6 +219,10 @@ Patch: 1043_linux-3.18.44.patch
19 From: http://www.kernel.org
20 Desc: Linux 3.18.44
21
22 +Patch: 1044_linux-3.18.45.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 3.18.45
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1044_linux-3.18.45.patch b/1044_linux-3.18.45.patch
31 new file mode 100644
32 index 0000000..dbe8f9b
33 --- /dev/null
34 +++ b/1044_linux-3.18.45.patch
35 @@ -0,0 +1,1239 @@
36 +diff --git a/Makefile b/Makefile
37 +index 05b64e6d1456..de29f33d03a9 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 3
42 + PATCHLEVEL = 18
43 +-SUBLEVEL = 44
44 ++SUBLEVEL = 45
45 + EXTRAVERSION =
46 + NAME = Diseased Newt
47 +
48 +@@ -610,6 +610,8 @@ all: vmlinux
49 + include $(srctree)/arch/$(SRCARCH)/Makefile
50 +
51 + KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
52 ++KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
53 ++KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
54 +
55 + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
56 + KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
57 +diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
58 +index 824be0da92cd..f49289f7fd2a 100644
59 +--- a/arch/mips/kvm/emulate.c
60 ++++ b/arch/mips/kvm/emulate.c
61 +@@ -752,15 +752,15 @@ enum emulation_result kvm_mips_emul_eret(struct kvm_vcpu *vcpu)
62 + struct mips_coproc *cop0 = vcpu->arch.cop0;
63 + enum emulation_result er = EMULATE_DONE;
64 +
65 +- if (kvm_read_c0_guest_status(cop0) & ST0_EXL) {
66 ++ if (kvm_read_c0_guest_status(cop0) & ST0_ERL) {
67 ++ kvm_clear_c0_guest_status(cop0, ST0_ERL);
68 ++ vcpu->arch.pc = kvm_read_c0_guest_errorepc(cop0);
69 ++ } else if (kvm_read_c0_guest_status(cop0) & ST0_EXL) {
70 + kvm_debug("[%#lx] ERET to %#lx\n", vcpu->arch.pc,
71 + kvm_read_c0_guest_epc(cop0));
72 + kvm_clear_c0_guest_status(cop0, ST0_EXL);
73 + vcpu->arch.pc = kvm_read_c0_guest_epc(cop0);
74 +
75 +- } else if (kvm_read_c0_guest_status(cop0) & ST0_ERL) {
76 +- kvm_clear_c0_guest_status(cop0, ST0_ERL);
77 +- vcpu->arch.pc = kvm_read_c0_guest_errorepc(cop0);
78 + } else {
79 + kvm_err("[%#lx] ERET when MIPS_SR_EXL|MIPS_SR_ERL == 0\n",
80 + vcpu->arch.pc);
81 +diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
82 +index 099c23616901..8f13c7facdd7 100644
83 +--- a/arch/parisc/kernel/syscall.S
84 ++++ b/arch/parisc/kernel/syscall.S
85 +@@ -106,8 +106,6 @@ linux_gateway_entry:
86 + mtsp %r0,%sr4 /* get kernel space into sr4 */
87 + mtsp %r0,%sr5 /* get kernel space into sr5 */
88 + mtsp %r0,%sr6 /* get kernel space into sr6 */
89 +- mfsp %sr7,%r1 /* save user sr7 */
90 +- mtsp %r1,%sr3 /* and store it in sr3 */
91 +
92 + #ifdef CONFIG_64BIT
93 + /* for now we can *always* set the W bit on entry to the syscall
94 +@@ -133,6 +131,14 @@ linux_gateway_entry:
95 + depdi 0, 31, 32, %r21
96 + 1:
97 + #endif
98 ++
99 ++ /* We use a rsm/ssm pair to prevent sr3 from being clobbered
100 ++ * by external interrupts.
101 ++ */
102 ++ mfsp %sr7,%r1 /* save user sr7 */
103 ++ rsm PSW_SM_I, %r0 /* disable interrupts */
104 ++ mtsp %r1,%sr3 /* and store it in sr3 */
105 ++
106 + mfctl %cr30,%r1
107 + xor %r1,%r30,%r30 /* ye olde xor trick */
108 + xor %r1,%r30,%r1
109 +@@ -147,6 +153,7 @@ linux_gateway_entry:
110 + */
111 +
112 + mtsp %r0,%sr7 /* get kernel space into sr7 */
113 ++ ssm PSW_SM_I, %r0 /* enable interrupts */
114 + STREGM %r1,FRAME_SIZE(%r30) /* save r1 (usp) here for now */
115 + mfctl %cr30,%r1 /* get task ptr in %r1 */
116 + LDREG TI_TASK(%r1),%r1
117 +diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S
118 +index 283c603716a0..df448d17641d 100644
119 +--- a/arch/powerpc/kernel/idle_power7.S
120 ++++ b/arch/powerpc/kernel/idle_power7.S
121 +@@ -28,7 +28,7 @@
122 + std r0,0(r1); \
123 + ptesync; \
124 + ld r0,0(r1); \
125 +-1: cmp cr0,r0,r0; \
126 ++1: cmpd cr0,r0,r0; \
127 + bne 1b; \
128 + IDLE_INST; \
129 + b .
130 +diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
131 +index 1b5305d4bdab..575b871c3887 100644
132 +--- a/arch/powerpc/mm/copro_fault.c
133 ++++ b/arch/powerpc/mm/copro_fault.c
134 +@@ -102,6 +102,8 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
135 + switch (REGION_ID(ea)) {
136 + case USER_REGION_ID:
137 + pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
138 ++ if (mm == NULL)
139 ++ return 1;
140 + psize = get_slice_psize(mm, ea);
141 + ssize = user_segment_size(ea);
142 + vsid = get_vsid(mm->context.id, ea, ssize);
143 +diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
144 +index 6e09c1dac2b7..2453a9f20d01 100644
145 +--- a/drivers/char/virtio_console.c
146 ++++ b/drivers/char/virtio_console.c
147 +@@ -1532,19 +1532,29 @@ static void remove_port_data(struct port *port)
148 + spin_lock_irq(&port->inbuf_lock);
149 + /* Remove unused data this port might have received. */
150 + discard_port_data(port);
151 ++ spin_unlock_irq(&port->inbuf_lock);
152 +
153 + /* Remove buffers we queued up for the Host to send us data in. */
154 +- while ((buf = virtqueue_detach_unused_buf(port->in_vq)))
155 +- free_buf(buf, true);
156 +- spin_unlock_irq(&port->inbuf_lock);
157 ++ do {
158 ++ spin_lock_irq(&port->inbuf_lock);
159 ++ buf = virtqueue_detach_unused_buf(port->in_vq);
160 ++ spin_unlock_irq(&port->inbuf_lock);
161 ++ if (buf)
162 ++ free_buf(buf, true);
163 ++ } while (buf);
164 +
165 + spin_lock_irq(&port->outvq_lock);
166 + reclaim_consumed_buffers(port);
167 ++ spin_unlock_irq(&port->outvq_lock);
168 +
169 + /* Free pending buffers from the out-queue. */
170 +- while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
171 +- free_buf(buf, true);
172 +- spin_unlock_irq(&port->outvq_lock);
173 ++ do {
174 ++ spin_lock_irq(&port->outvq_lock);
175 ++ buf = virtqueue_detach_unused_buf(port->out_vq);
176 ++ spin_unlock_irq(&port->outvq_lock);
177 ++ if (buf)
178 ++ free_buf(buf, true);
179 ++ } while (buf);
180 + }
181 +
182 + /*
183 +diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
184 +index 2c68da1ceeee..e7a085acf72d 100644
185 +--- a/drivers/firewire/net.c
186 ++++ b/drivers/firewire/net.c
187 +@@ -73,13 +73,13 @@ struct rfc2734_header {
188 +
189 + #define fwnet_get_hdr_lf(h) (((h)->w0 & 0xc0000000) >> 30)
190 + #define fwnet_get_hdr_ether_type(h) (((h)->w0 & 0x0000ffff))
191 +-#define fwnet_get_hdr_dg_size(h) (((h)->w0 & 0x0fff0000) >> 16)
192 ++#define fwnet_get_hdr_dg_size(h) ((((h)->w0 & 0x0fff0000) >> 16) + 1)
193 + #define fwnet_get_hdr_fg_off(h) (((h)->w0 & 0x00000fff))
194 + #define fwnet_get_hdr_dgl(h) (((h)->w1 & 0xffff0000) >> 16)
195 +
196 +-#define fwnet_set_hdr_lf(lf) ((lf) << 30)
197 ++#define fwnet_set_hdr_lf(lf) ((lf) << 30)
198 + #define fwnet_set_hdr_ether_type(et) (et)
199 +-#define fwnet_set_hdr_dg_size(dgs) ((dgs) << 16)
200 ++#define fwnet_set_hdr_dg_size(dgs) (((dgs) - 1) << 16)
201 + #define fwnet_set_hdr_fg_off(fgo) (fgo)
202 +
203 + #define fwnet_set_hdr_dgl(dgl) ((dgl) << 16)
204 +@@ -591,6 +591,9 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
205 + int retval;
206 + u16 ether_type;
207 +
208 ++ if (len <= RFC2374_UNFRAG_HDR_SIZE)
209 ++ return 0;
210 ++
211 + hdr.w0 = be32_to_cpu(buf[0]);
212 + lf = fwnet_get_hdr_lf(&hdr);
213 + if (lf == RFC2374_HDR_UNFRAG) {
214 +@@ -615,7 +618,12 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
215 + return fwnet_finish_incoming_packet(net, skb, source_node_id,
216 + is_broadcast, ether_type);
217 + }
218 ++
219 + /* A datagram fragment has been received, now the fun begins. */
220 ++
221 ++ if (len <= RFC2374_FRAG_HDR_SIZE)
222 ++ return 0;
223 ++
224 + hdr.w1 = ntohl(buf[1]);
225 + buf += 2;
226 + len -= RFC2374_FRAG_HDR_SIZE;
227 +@@ -627,7 +635,10 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
228 + fg_off = fwnet_get_hdr_fg_off(&hdr);
229 + }
230 + datagram_label = fwnet_get_hdr_dgl(&hdr);
231 +- dg_size = fwnet_get_hdr_dg_size(&hdr); /* ??? + 1 */
232 ++ dg_size = fwnet_get_hdr_dg_size(&hdr);
233 ++
234 ++ if (fg_off + len > dg_size)
235 ++ return 0;
236 +
237 + spin_lock_irqsave(&dev->lock, flags);
238 +
239 +@@ -735,6 +746,22 @@ static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r,
240 + fw_send_response(card, r, rcode);
241 + }
242 +
243 ++static int gasp_source_id(__be32 *p)
244 ++{
245 ++ return be32_to_cpu(p[0]) >> 16;
246 ++}
247 ++
248 ++static u32 gasp_specifier_id(__be32 *p)
249 ++{
250 ++ return (be32_to_cpu(p[0]) & 0xffff) << 8 |
251 ++ (be32_to_cpu(p[1]) & 0xff000000) >> 24;
252 ++}
253 ++
254 ++static u32 gasp_version(__be32 *p)
255 ++{
256 ++ return be32_to_cpu(p[1]) & 0xffffff;
257 ++}
258 ++
259 + static void fwnet_receive_broadcast(struct fw_iso_context *context,
260 + u32 cycle, size_t header_length, void *header, void *data)
261 + {
262 +@@ -744,9 +771,6 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
263 + __be32 *buf_ptr;
264 + int retval;
265 + u32 length;
266 +- u16 source_node_id;
267 +- u32 specifier_id;
268 +- u32 ver;
269 + unsigned long offset;
270 + unsigned long flags;
271 +
272 +@@ -763,22 +787,17 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
273 +
274 + spin_unlock_irqrestore(&dev->lock, flags);
275 +
276 +- specifier_id = (be32_to_cpu(buf_ptr[0]) & 0xffff) << 8
277 +- | (be32_to_cpu(buf_ptr[1]) & 0xff000000) >> 24;
278 +- ver = be32_to_cpu(buf_ptr[1]) & 0xffffff;
279 +- source_node_id = be32_to_cpu(buf_ptr[0]) >> 16;
280 +-
281 +- if (specifier_id == IANA_SPECIFIER_ID &&
282 +- (ver == RFC2734_SW_VERSION
283 ++ if (length > IEEE1394_GASP_HDR_SIZE &&
284 ++ gasp_specifier_id(buf_ptr) == IANA_SPECIFIER_ID &&
285 ++ (gasp_version(buf_ptr) == RFC2734_SW_VERSION
286 + #if IS_ENABLED(CONFIG_IPV6)
287 +- || ver == RFC3146_SW_VERSION
288 ++ || gasp_version(buf_ptr) == RFC3146_SW_VERSION
289 + #endif
290 +- )) {
291 +- buf_ptr += 2;
292 +- length -= IEEE1394_GASP_HDR_SIZE;
293 +- fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,
294 ++ ))
295 ++ fwnet_incoming_packet(dev, buf_ptr + 2,
296 ++ length - IEEE1394_GASP_HDR_SIZE,
297 ++ gasp_source_id(buf_ptr),
298 + context->card->generation, true);
299 +- }
300 +
301 + packet.payload_length = dev->rcv_buffer_size;
302 + packet.interrupt = 1;
303 +diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
304 +index a019ba246e39..3e8a0d634420 100644
305 +--- a/drivers/gpu/drm/radeon/ni.c
306 ++++ b/drivers/gpu/drm/radeon/ni.c
307 +@@ -1339,9 +1339,7 @@ static void cayman_pcie_gart_fini(struct radeon_device *rdev)
308 + void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
309 + int ring, u32 cp_int_cntl)
310 + {
311 +- u32 srbm_gfx_cntl = RREG32(SRBM_GFX_CNTL) & ~3;
312 +-
313 +- WREG32(SRBM_GFX_CNTL, srbm_gfx_cntl | (ring & 3));
314 ++ WREG32(SRBM_GFX_CNTL, RINGID(ring));
315 + WREG32(CP_INT_CNTL, cp_int_cntl);
316 + }
317 +
318 +diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c
319 +index 65a0c1c03c69..fdac8d3847dc 100644
320 +--- a/drivers/gpu/drm/radeon/r600_dpm.c
321 ++++ b/drivers/gpu/drm/radeon/r600_dpm.c
322 +@@ -156,19 +156,20 @@ u32 r600_dpm_get_vblank_time(struct radeon_device *rdev)
323 + struct drm_device *dev = rdev->ddev;
324 + struct drm_crtc *crtc;
325 + struct radeon_crtc *radeon_crtc;
326 +- u32 line_time_us, vblank_lines;
327 ++ u32 vblank_in_pixels;
328 + u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
329 +
330 + if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
331 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
332 + radeon_crtc = to_radeon_crtc(crtc);
333 + if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
334 +- line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) /
335 +- radeon_crtc->hw_mode.clock;
336 +- vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end -
337 +- radeon_crtc->hw_mode.crtc_vdisplay +
338 +- (radeon_crtc->v_border * 2);
339 +- vblank_time_us = vblank_lines * line_time_us;
340 ++ vblank_in_pixels =
341 ++ radeon_crtc->hw_mode.crtc_htotal *
342 ++ (radeon_crtc->hw_mode.crtc_vblank_end -
343 ++ radeon_crtc->hw_mode.crtc_vdisplay +
344 ++ (radeon_crtc->v_border * 2));
345 ++
346 ++ vblank_time_us = vblank_in_pixels * 1000 / radeon_crtc->hw_mode.clock;
347 + break;
348 + }
349 + }
350 +diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
351 +index c3530caa7ddd..1a75d78a2708 100644
352 +--- a/drivers/gpu/drm/radeon/si_dpm.c
353 ++++ b/drivers/gpu/drm/radeon/si_dpm.c
354 +@@ -2945,6 +2945,49 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev,
355 + int i;
356 + struct si_dpm_quirk *p = si_dpm_quirk_list;
357 +
358 ++ /* limit all SI kickers */
359 ++ if (rdev->family == CHIP_PITCAIRN) {
360 ++ if ((rdev->pdev->revision == 0x81) ||
361 ++ (rdev->pdev->device == 0x6810) ||
362 ++ (rdev->pdev->device == 0x6811) ||
363 ++ (rdev->pdev->device == 0x6816) ||
364 ++ (rdev->pdev->device == 0x6817) ||
365 ++ (rdev->pdev->device == 0x6806))
366 ++ max_mclk = 120000;
367 ++ } else if (rdev->family == CHIP_VERDE) {
368 ++ if ((rdev->pdev->revision == 0x81) ||
369 ++ (rdev->pdev->revision == 0x83) ||
370 ++ (rdev->pdev->revision == 0x87) ||
371 ++ (rdev->pdev->device == 0x6820) ||
372 ++ (rdev->pdev->device == 0x6821) ||
373 ++ (rdev->pdev->device == 0x6822) ||
374 ++ (rdev->pdev->device == 0x6823) ||
375 ++ (rdev->pdev->device == 0x682A) ||
376 ++ (rdev->pdev->device == 0x682B)) {
377 ++ max_sclk = 75000;
378 ++ max_mclk = 80000;
379 ++ }
380 ++ } else if (rdev->family == CHIP_OLAND) {
381 ++ if ((rdev->pdev->revision == 0xC7) ||
382 ++ (rdev->pdev->revision == 0x80) ||
383 ++ (rdev->pdev->revision == 0x81) ||
384 ++ (rdev->pdev->revision == 0x83) ||
385 ++ (rdev->pdev->device == 0x6604) ||
386 ++ (rdev->pdev->device == 0x6605)) {
387 ++ max_sclk = 75000;
388 ++ max_mclk = 80000;
389 ++ }
390 ++ } else if (rdev->family == CHIP_HAINAN) {
391 ++ if ((rdev->pdev->revision == 0x81) ||
392 ++ (rdev->pdev->revision == 0x83) ||
393 ++ (rdev->pdev->revision == 0xC3) ||
394 ++ (rdev->pdev->device == 0x6664) ||
395 ++ (rdev->pdev->device == 0x6665) ||
396 ++ (rdev->pdev->device == 0x6667)) {
397 ++ max_sclk = 75000;
398 ++ max_mclk = 80000;
399 ++ }
400 ++ }
401 + /* Apply dpm quirks */
402 + while (p && p->chip_device != 0) {
403 + if (rdev->pdev->vendor == p->chip_vendor &&
404 +@@ -2957,10 +3000,6 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev,
405 + }
406 + ++p;
407 + }
408 +- /* limit mclk on all R7 370 parts for stability */
409 +- if (rdev->pdev->device == 0x6811 &&
410 +- rdev->pdev->revision == 0x81)
411 +- max_mclk = 120000;
412 +
413 + if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
414 + ni_dpm_vblank_too_short(rdev))
415 +diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
416 +index 3b9c9ef0deb8..2d1414d07305 100644
417 +--- a/drivers/hv/hv_util.c
418 ++++ b/drivers/hv/hv_util.c
419 +@@ -283,10 +283,14 @@ static void heartbeat_onchannelcallback(void *context)
420 + u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
421 + struct icmsg_negotiate *negop = NULL;
422 +
423 +- vmbus_recvpacket(channel, hbeat_txf_buf,
424 +- PAGE_SIZE, &recvlen, &requestid);
425 ++ while (1) {
426 ++
427 ++ vmbus_recvpacket(channel, hbeat_txf_buf,
428 ++ PAGE_SIZE, &recvlen, &requestid);
429 ++
430 ++ if (!recvlen)
431 ++ break;
432 +
433 +- if (recvlen > 0) {
434 + icmsghdrp = (struct icmsg_hdr *)&hbeat_txf_buf[
435 + sizeof(struct vmbuspipe_hdr)];
436 +
437 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
438 +index 89daac119a69..faccb8349647 100644
439 +--- a/drivers/input/serio/i8042-x86ia64io.h
440 ++++ b/drivers/input/serio/i8042-x86ia64io.h
441 +@@ -783,6 +783,13 @@ static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
442 + DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
443 + },
444 + },
445 ++ {
446 ++ /* Schenker XMG C504 - Elantech touchpad */
447 ++ .matches = {
448 ++ DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
449 ++ DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
450 ++ },
451 ++ },
452 + { }
453 + };
454 +
455 +diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
456 +index 1242d8a25721..70565fc17ea7 100644
457 +--- a/drivers/irqchip/irq-gic-v3.c
458 ++++ b/drivers/irqchip/irq-gic-v3.c
459 +@@ -178,7 +178,7 @@ static void gic_enable_redist(bool enable)
460 + return; /* No PM support in this redistributor */
461 + }
462 +
463 +- while (count--) {
464 ++ while (--count) {
465 + val = readl_relaxed(rbase + GICR_WAKER);
466 + if (enable ^ (val & GICR_WAKER_ChildrenAsleep))
467 + break;
468 +diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
469 +index b2bd1ebf4562..fc93bd80270f 100644
470 +--- a/drivers/md/dm-table.c
471 ++++ b/drivers/md/dm-table.c
472 +@@ -691,37 +691,32 @@ int dm_table_add_target(struct dm_table *t, const char *type,
473 +
474 + tgt->type = dm_get_target_type(type);
475 + if (!tgt->type) {
476 +- DMERR("%s: %s: unknown target type", dm_device_name(t->md),
477 +- type);
478 ++ DMERR("%s: %s: unknown target type", dm_device_name(t->md), type);
479 + return -EINVAL;
480 + }
481 +
482 + if (dm_target_needs_singleton(tgt->type)) {
483 + if (t->num_targets) {
484 +- DMERR("%s: target type %s must appear alone in table",
485 +- dm_device_name(t->md), type);
486 +- return -EINVAL;
487 ++ tgt->error = "singleton target type must appear alone in table";
488 ++ goto bad;
489 + }
490 + t->singleton = 1;
491 + }
492 +
493 + if (dm_target_always_writeable(tgt->type) && !(t->mode & FMODE_WRITE)) {
494 +- DMERR("%s: target type %s may not be included in read-only tables",
495 +- dm_device_name(t->md), type);
496 +- return -EINVAL;
497 ++ tgt->error = "target type may not be included in a read-only table";
498 ++ goto bad;
499 + }
500 +
501 + if (t->immutable_target_type) {
502 + if (t->immutable_target_type != tgt->type) {
503 +- DMERR("%s: immutable target type %s cannot be mixed with other target types",
504 +- dm_device_name(t->md), t->immutable_target_type->name);
505 +- return -EINVAL;
506 ++ tgt->error = "immutable target type cannot be mixed with other target types";
507 ++ goto bad;
508 + }
509 + } else if (dm_target_is_immutable(tgt->type)) {
510 + if (t->num_targets) {
511 +- DMERR("%s: immutable target type %s cannot be mixed with other target types",
512 +- dm_device_name(t->md), tgt->type->name);
513 +- return -EINVAL;
514 ++ tgt->error = "immutable target type cannot be mixed with other target types";
515 ++ goto bad;
516 + }
517 + t->immutable_target_type = tgt->type;
518 + }
519 +@@ -736,7 +731,6 @@ int dm_table_add_target(struct dm_table *t, const char *type,
520 + */
521 + if (!adjoin(t, tgt)) {
522 + tgt->error = "Gap in table";
523 +- r = -EINVAL;
524 + goto bad;
525 + }
526 +
527 +diff --git a/drivers/md/md.c b/drivers/md/md.c
528 +index 3d2cc7453ec1..a4b0b4e43b40 100644
529 +--- a/drivers/md/md.c
530 ++++ b/drivers/md/md.c
531 +@@ -7409,6 +7409,9 @@ void md_do_sync(struct md_thread *thread)
532 + break;
533 +
534 + j += sectors;
535 ++ if (j > max_sectors)
536 ++ /* when skipping, extra large numbers can be returned. */
537 ++ j = max_sectors;
538 + if (j > 2)
539 + mddev->curr_resync = j;
540 + mddev->curr_mark_cnt = io_sectors;
541 +@@ -7468,11 +7471,17 @@ void md_do_sync(struct md_thread *thread)
542 + blk_finish_plug(&plug);
543 + wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active));
544 +
545 ++ if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
546 ++ !test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
547 ++ mddev->curr_resync > 3) {
548 ++ mddev->curr_resync_completed = mddev->curr_resync;
549 ++ sysfs_notify(&mddev->kobj, NULL, "sync_completed");
550 ++ }
551 + /* tell personality that we are finished */
552 + mddev->pers->sync_request(mddev, max_sectors, &skipped, 1);
553 +
554 + if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
555 +- mddev->curr_resync > 2) {
556 ++ mddev->curr_resync > 3) {
557 + if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
558 + if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
559 + if (mddev->curr_resync >= mddev->recovery_cp) {
560 +diff --git a/drivers/memstick/host/rtsx_usb_ms.c b/drivers/memstick/host/rtsx_usb_ms.c
561 +index a7282b7d4de8..021e4252ee04 100644
562 +--- a/drivers/memstick/host/rtsx_usb_ms.c
563 ++++ b/drivers/memstick/host/rtsx_usb_ms.c
564 +@@ -524,6 +524,7 @@ static void rtsx_usb_ms_handle_req(struct work_struct *work)
565 + int rc;
566 +
567 + if (!host->req) {
568 ++ pm_runtime_get_sync(ms_dev(host));
569 + do {
570 + rc = memstick_next_req(msh, &host->req);
571 + dev_dbg(ms_dev(host), "next req %d\n", rc);
572 +@@ -544,6 +545,7 @@ static void rtsx_usb_ms_handle_req(struct work_struct *work)
573 + host->req->error);
574 + }
575 + } while (!rc);
576 ++ pm_runtime_put(ms_dev(host));
577 + }
578 +
579 + }
580 +@@ -570,6 +572,7 @@ static int rtsx_usb_ms_set_param(struct memstick_host *msh,
581 + dev_dbg(ms_dev(host), "%s: param = %d, value = %d\n",
582 + __func__, param, value);
583 +
584 ++ pm_runtime_get_sync(ms_dev(host));
585 + mutex_lock(&ucr->dev_mutex);
586 +
587 + err = rtsx_usb_card_exclusive_check(ucr, RTSX_USB_MS_CARD);
588 +@@ -635,6 +638,7 @@ static int rtsx_usb_ms_set_param(struct memstick_host *msh,
589 + }
590 + out:
591 + mutex_unlock(&ucr->dev_mutex);
592 ++ pm_runtime_put(ms_dev(host));
593 +
594 + /* power-on delay */
595 + if (param == MEMSTICK_POWER && value == MEMSTICK_POWER_ON)
596 +@@ -681,6 +685,7 @@ static int rtsx_usb_detect_ms_card(void *__host)
597 + int err;
598 +
599 + for (;;) {
600 ++ pm_runtime_get_sync(ms_dev(host));
601 + mutex_lock(&ucr->dev_mutex);
602 +
603 + /* Check pending MS card changes */
604 +@@ -703,6 +708,7 @@ static int rtsx_usb_detect_ms_card(void *__host)
605 + }
606 +
607 + poll_again:
608 ++ pm_runtime_put(ms_dev(host));
609 + if (host->eject)
610 + break;
611 +
612 +diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c
613 +index 1ca94e6fa8fb..e9e6f7d61a71 100644
614 +--- a/drivers/misc/genwqe/card_utils.c
615 ++++ b/drivers/misc/genwqe/card_utils.c
616 +@@ -351,17 +351,27 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
617 + if (copy_from_user(sgl->lpage, user_addr + user_size -
618 + sgl->lpage_size, sgl->lpage_size)) {
619 + rc = -EFAULT;
620 +- goto err_out1;
621 ++ goto err_out2;
622 + }
623 + }
624 + return 0;
625 +
626 ++ err_out2:
627 ++ __genwqe_free_consistent(cd, PAGE_SIZE, sgl->lpage,
628 ++ sgl->lpage_dma_addr);
629 ++ sgl->lpage = NULL;
630 ++ sgl->lpage_dma_addr = 0;
631 + err_out1:
632 + __genwqe_free_consistent(cd, PAGE_SIZE, sgl->fpage,
633 + sgl->fpage_dma_addr);
634 ++ sgl->fpage = NULL;
635 ++ sgl->fpage_dma_addr = 0;
636 + err_out:
637 + __genwqe_free_consistent(cd, sgl->sgl_size, sgl->sgl,
638 + sgl->sgl_dma_addr);
639 ++ sgl->sgl = NULL;
640 ++ sgl->sgl_dma_addr = 0;
641 ++ sgl->sgl_size = 0;
642 + return -ENOMEM;
643 + }
644 +
645 +diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
646 +index c11a01a1ec21..2e76fd528c70 100644
647 +--- a/drivers/misc/mei/hw-txe.c
648 ++++ b/drivers/misc/mei/hw-txe.c
649 +@@ -973,11 +973,13 @@ static bool mei_txe_check_and_ack_intrs(struct mei_device *dev, bool do_ack)
650 + hisr = mei_txe_br_reg_read(hw, HISR_REG);
651 +
652 + aliveness = mei_txe_aliveness_get(dev);
653 +- if (hhisr & IPC_HHIER_SEC && aliveness)
654 ++ if (hhisr & IPC_HHIER_SEC && aliveness) {
655 + ipc_isr = mei_txe_sec_reg_read_silent(hw,
656 + SEC_IPC_HOST_INT_STATUS_REG);
657 +- else
658 ++ } else {
659 + ipc_isr = 0;
660 ++ hhisr &= ~IPC_HHIER_SEC;
661 ++ }
662 +
663 + generated = generated ||
664 + (hisr & HISR_INT_STS_MSK) ||
665 +diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
666 +index 4078ebe81c45..dec6b0ec4def 100644
667 +--- a/drivers/mmc/card/block.c
668 ++++ b/drivers/mmc/card/block.c
669 +@@ -1657,7 +1657,7 @@ static void mmc_blk_packed_hdr_wrq_prep(struct mmc_queue_req *mqrq,
670 + struct mmc_blk_data *md = mq->data;
671 + struct mmc_packed *packed = mqrq->packed;
672 + bool do_rel_wr, do_data_tag;
673 +- u32 *packed_cmd_hdr;
674 ++ __le32 *packed_cmd_hdr;
675 + u8 hdr_blocks;
676 + u8 i = 1;
677 +
678 +diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
679 +index 99e6521e6169..f42c11293dd8 100644
680 +--- a/drivers/mmc/card/queue.h
681 ++++ b/drivers/mmc/card/queue.h
682 +@@ -24,7 +24,7 @@ enum mmc_packed_type {
683 +
684 + struct mmc_packed {
685 + struct list_head list;
686 +- u32 cmd_hdr[1024];
687 ++ __le32 cmd_hdr[1024];
688 + unsigned int blocks;
689 + u8 nr_entries;
690 + u8 retries;
691 +diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
692 +index 88af827e086b..a9e97a138f3d 100644
693 +--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
694 ++++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
695 +@@ -1138,11 +1138,6 @@ static void sdmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
696 + dev_dbg(sdmmc_dev(host), "%s\n", __func__);
697 + mutex_lock(&ucr->dev_mutex);
698 +
699 +- if (rtsx_usb_card_exclusive_check(ucr, RTSX_USB_SD_CARD)) {
700 +- mutex_unlock(&ucr->dev_mutex);
701 +- return;
702 +- }
703 +-
704 + sd_set_power_mode(host, ios->power_mode);
705 + sd_set_bus_width(host, ios->bus_width);
706 + sd_set_timing(host, ios->timing, &host->ddr_mode);
707 +@@ -1314,6 +1309,7 @@ static void rtsx_usb_update_led(struct work_struct *work)
708 + container_of(work, struct rtsx_usb_sdmmc, led_work);
709 + struct rtsx_ucr *ucr = host->ucr;
710 +
711 ++ pm_runtime_get_sync(sdmmc_dev(host));
712 + mutex_lock(&ucr->dev_mutex);
713 +
714 + if (host->led.brightness == LED_OFF)
715 +@@ -1322,6 +1318,7 @@ static void rtsx_usb_update_led(struct work_struct *work)
716 + rtsx_usb_turn_on_led(ucr);
717 +
718 + mutex_unlock(&ucr->dev_mutex);
719 ++ pm_runtime_put(sdmmc_dev(host));
720 + }
721 + #endif
722 +
723 +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
724 +index 8e7605894dfd..388046e71e80 100644
725 +--- a/drivers/mmc/host/sdhci.c
726 ++++ b/drivers/mmc/host/sdhci.c
727 +@@ -669,7 +669,7 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd)
728 + * host->clock is in Hz. target_timeout is in us.
729 + * Hence, us = 1000000 * cycles / Hz. Round up.
730 + */
731 +- val = 1000000 * data->timeout_clks;
732 ++ val = 1000000ULL * data->timeout_clks;
733 + if (do_div(val, host->clock))
734 + target_timeout++;
735 + target_timeout += val;
736 +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
737 +index 0b44fb5ee485..7bded8e3f116 100644
738 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c
739 ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
740 +@@ -2545,18 +2545,9 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd,
741 + struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
742 + struct CommandControlBlock *ccb;
743 + int target = cmd->device->id;
744 +- int lun = cmd->device->lun;
745 +- uint8_t scsicmd = cmd->cmnd[0];
746 + cmd->scsi_done = done;
747 + cmd->host_scribble = NULL;
748 + cmd->result = 0;
749 +- if ((scsicmd == SYNCHRONIZE_CACHE) ||(scsicmd == SEND_DIAGNOSTIC)){
750 +- if(acb->devstate[target][lun] == ARECA_RAID_GONE) {
751 +- cmd->result = (DID_NO_CONNECT << 16);
752 +- }
753 +- cmd->scsi_done(cmd);
754 +- return 0;
755 +- }
756 + if (target == 16) {
757 + /* virtual device for iop message transfer */
758 + arcmsr_handle_virtual_command(acb, cmd);
759 +diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
760 +index b1af2987b0c8..1ff0ece87644 100644
761 +--- a/drivers/scsi/megaraid/megaraid_sas_base.c
762 ++++ b/drivers/scsi/megaraid/megaraid_sas_base.c
763 +@@ -1614,16 +1614,13 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
764 + goto out_done;
765 + }
766 +
767 +- switch (scmd->cmnd[0]) {
768 +- case SYNCHRONIZE_CACHE:
769 +- /*
770 +- * FW takes care of flush cache on its own
771 +- * No need to send it down
772 +- */
773 ++ /*
774 ++ * FW takes care of flush cache on its own for Virtual Disk.
775 ++ * No need to send it down for VD. For JBOD send SYNCHRONIZE_CACHE to FW.
776 ++ */
777 ++ if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && MEGASAS_IS_LOGICAL(scmd)) {
778 + scmd->result = DID_OK << 16;
779 + goto out_done;
780 +- default:
781 +- break;
782 + }
783 +
784 + if (instance->instancet->build_and_issue_cmd(instance, scmd)) {
785 +diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
786 +index 238e06f13b8a..dda3a32743b5 100644
787 +--- a/drivers/scsi/scsi_debug.c
788 ++++ b/drivers/scsi/scsi_debug.c
789 +@@ -3998,6 +3998,7 @@ static void __exit scsi_debug_exit(void)
790 + if (dif_storep)
791 + vfree(dif_storep);
792 +
793 ++ vfree(map_storep);
794 + vfree(fake_storep);
795 + }
796 +
797 +diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
798 +index f49cb534a829..3386e72ba7e4 100644
799 +--- a/drivers/scsi/scsi_scan.c
800 ++++ b/drivers/scsi/scsi_scan.c
801 +@@ -1531,12 +1531,12 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
802 + out_err:
803 + kfree(lun_data);
804 + out:
805 +- scsi_device_put(sdev);
806 + if (scsi_device_created(sdev))
807 + /*
808 + * the sdev we used didn't appear in the report luns scan
809 + */
810 + __scsi_remove_device(sdev);
811 ++ scsi_device_put(sdev);
812 + return ret;
813 + }
814 +
815 +diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
816 +index e9186cdf35e9..01ee1273a6eb 100644
817 +--- a/drivers/target/target_core_xcopy.c
818 ++++ b/drivers/target/target_core_xcopy.c
819 +@@ -698,6 +698,7 @@ static int target_xcopy_read_source(
820 + rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0],
821 + remote_port, true);
822 + if (rc < 0) {
823 ++ ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
824 + transport_generic_free_cmd(se_cmd, 0);
825 + return rc;
826 + }
827 +@@ -709,6 +710,7 @@ static int target_xcopy_read_source(
828 +
829 + rc = target_xcopy_issue_pt_cmd(xpt_cmd);
830 + if (rc < 0) {
831 ++ ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
832 + transport_generic_free_cmd(se_cmd, 0);
833 + return rc;
834 + }
835 +@@ -759,6 +761,7 @@ static int target_xcopy_write_destination(
836 + remote_port, false);
837 + if (rc < 0) {
838 + struct se_cmd *src_cmd = &xop->src_pt_cmd->se_cmd;
839 ++ ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
840 + /*
841 + * If the failure happened before the t_mem_list hand-off in
842 + * target_xcopy_setup_pt_cmd(), Reset memory + clear flag so that
843 +@@ -774,6 +777,7 @@ static int target_xcopy_write_destination(
844 +
845 + rc = target_xcopy_issue_pt_cmd(xpt_cmd);
846 + if (rc < 0) {
847 ++ ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
848 + se_cmd->se_cmd_flags &= ~SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC;
849 + transport_generic_free_cmd(se_cmd, 0);
850 + return rc;
851 +@@ -860,9 +864,14 @@ static void target_xcopy_do_work(struct work_struct *work)
852 + out:
853 + xcopy_pt_undepend_remotedev(xop);
854 + kfree(xop);
855 +-
856 +- pr_warn("target_xcopy_do_work: Setting X-COPY CHECK_CONDITION -> sending response\n");
857 +- ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION;
858 ++ /*
859 ++ * Don't override an error scsi status if it has already been set
860 ++ */
861 ++ if (ec_cmd->scsi_status == SAM_STAT_GOOD) {
862 ++ pr_warn_ratelimited("target_xcopy_do_work: rc: %d, Setting X-COPY"
863 ++ " CHECK_CONDITION -> sending response\n", rc);
864 ++ ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION;
865 ++ }
866 + target_complete_cmd(ec_cmd, SAM_STAT_CHECK_CONDITION);
867 + }
868 +
869 +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
870 +index 9062636d3154..1a049e4de937 100644
871 +--- a/drivers/tty/vt/vt.c
872 ++++ b/drivers/tty/vt/vt.c
873 +@@ -863,10 +863,15 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
874 + if (new_cols == vc->vc_cols && new_rows == vc->vc_rows)
875 + return 0;
876 +
877 ++ if (new_screen_size > (4 << 20))
878 ++ return -EINVAL;
879 + newscreen = kmalloc(new_screen_size, GFP_USER);
880 + if (!newscreen)
881 + return -ENOMEM;
882 +
883 ++ if (vc == sel_cons)
884 ++ clear_selection();
885 ++
886 + old_rows = vc->vc_rows;
887 + old_row_size = vc->vc_size_row;
888 +
889 +diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
890 +index 6e6f87656e7b..2e7d27b4cf89 100644
891 +--- a/drivers/usb/gadget/function/u_ether.c
892 ++++ b/drivers/usb/gadget/function/u_ether.c
893 +@@ -591,8 +591,9 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
894 +
895 + /* throttle high/super speed IRQ rate back slightly */
896 + if (gadget_is_dualspeed(dev->gadget))
897 +- req->no_interrupt = (dev->gadget->speed == USB_SPEED_HIGH ||
898 +- dev->gadget->speed == USB_SPEED_SUPER)
899 ++ req->no_interrupt = (((dev->gadget->speed == USB_SPEED_HIGH ||
900 ++ dev->gadget->speed == USB_SPEED_SUPER)) &&
901 ++ !list_empty(&dev->tx_reqs))
902 + ? ((atomic_read(&dev->tx_qlen) % dev->qmult) != 0)
903 + : 0;
904 +
905 +diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
906 +index d664edabf14e..af2412f5abab 100644
907 +--- a/drivers/usb/host/ohci-hcd.c
908 ++++ b/drivers/usb/host/ohci-hcd.c
909 +@@ -72,7 +72,7 @@
910 + static const char hcd_name [] = "ohci_hcd";
911 +
912 + #define STATECHANGE_DELAY msecs_to_jiffies(300)
913 +-#define IO_WATCHDOG_DELAY msecs_to_jiffies(250)
914 ++#define IO_WATCHDOG_DELAY msecs_to_jiffies(275)
915 +
916 + #include "ohci.h"
917 + #include "pci-quirks.h"
918 +diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
919 +index 54caaf87c567..575582e807d3 100644
920 +--- a/drivers/usb/host/xhci-pci.c
921 ++++ b/drivers/usb/host/xhci-pci.c
922 +@@ -45,6 +45,7 @@
923 +
924 + #define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31
925 + #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
926 ++#define PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI 0x9cb1
927 + #define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5
928 + #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f
929 + #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI 0x9d2f
930 +@@ -147,7 +148,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
931 + xhci->quirks |= XHCI_SPURIOUS_REBOOT;
932 + }
933 + if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
934 +- pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
935 ++ (pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI ||
936 ++ pdev->device == PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI)) {
937 + xhci->quirks |= XHCI_SPURIOUS_REBOOT;
938 + xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
939 + }
940 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
941 +index 685a90168d8e..faab1f8ea370 100644
942 +--- a/drivers/usb/serial/cp210x.c
943 ++++ b/drivers/usb/serial/cp210x.c
944 +@@ -845,7 +845,9 @@ static int cp210x_tiocmget(struct tty_struct *tty)
945 + unsigned int control;
946 + int result;
947 +
948 +- cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
949 ++ result = cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
950 ++ if (result)
951 ++ return result;
952 +
953 + result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
954 + |((control & CONTROL_RTS) ? TIOCM_RTS : 0)
955 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
956 +index 8c48c9d83d48..494167fe6a2c 100644
957 +--- a/drivers/usb/serial/ftdi_sio.c
958 ++++ b/drivers/usb/serial/ftdi_sio.c
959 +@@ -986,7 +986,8 @@ static const struct usb_device_id id_table_combined[] = {
960 + /* ekey Devices */
961 + { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) },
962 + /* Infineon Devices */
963 +- { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_PID, 1) },
964 ++ { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC1798_PID, 1) },
965 ++ { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC2X7_PID, 1) },
966 + /* GE Healthcare devices */
967 + { USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) },
968 + /* Active Research (Actisense) devices */
969 +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
970 +index 48db84f25cc9..db1a9b3a5f38 100644
971 +--- a/drivers/usb/serial/ftdi_sio_ids.h
972 ++++ b/drivers/usb/serial/ftdi_sio_ids.h
973 +@@ -626,8 +626,9 @@
974 + /*
975 + * Infineon Technologies
976 + */
977 +-#define INFINEON_VID 0x058b
978 +-#define INFINEON_TRIBOARD_PID 0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
979 ++#define INFINEON_VID 0x058b
980 ++#define INFINEON_TRIBOARD_TC1798_PID 0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
981 ++#define INFINEON_TRIBOARD_TC2X7_PID 0x0043 /* DAS JTAG TriBoard TC2X7 V1.0 */
982 +
983 + /*
984 + * Acton Research Corp.
985 +diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
986 +index d3bf8348e638..a290891ddd84 100644
987 +--- a/drivers/usb/serial/usb-serial.c
988 ++++ b/drivers/usb/serial/usb-serial.c
989 +@@ -1061,7 +1061,8 @@ static int usb_serial_probe(struct usb_interface *interface,
990 +
991 + serial->disconnected = 0;
992 +
993 +- usb_serial_console_init(serial->port[0]->minor);
994 ++ if (num_ports > 0)
995 ++ usb_serial_console_init(serial->port[0]->minor);
996 + exit:
997 + module_put(type->driver.owner);
998 + return 0;
999 +diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
1000 +index ccad76a482ca..6f5fe1104ec6 100644
1001 +--- a/fs/btrfs/tree-log.c
1002 ++++ b/fs/btrfs/tree-log.c
1003 +@@ -2453,14 +2453,12 @@ static inline void btrfs_remove_all_log_ctxs(struct btrfs_root *root,
1004 + int index, int error)
1005 + {
1006 + struct btrfs_log_ctx *ctx;
1007 ++ struct btrfs_log_ctx *safe;
1008 +
1009 +- if (!error) {
1010 +- INIT_LIST_HEAD(&root->log_ctxs[index]);
1011 +- return;
1012 +- }
1013 +-
1014 +- list_for_each_entry(ctx, &root->log_ctxs[index], list)
1015 ++ list_for_each_entry_safe(ctx, safe, &root->log_ctxs[index], list) {
1016 ++ list_del_init(&ctx->list);
1017 + ctx->log_ret = error;
1018 ++ }
1019 +
1020 + INIT_LIST_HEAD(&root->log_ctxs[index]);
1021 + }
1022 +@@ -2690,13 +2688,9 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
1023 + mutex_unlock(&root->log_mutex);
1024 +
1025 + out_wake_log_root:
1026 +- /*
1027 +- * We needn't get log_mutex here because we are sure all
1028 +- * the other tasks are blocked.
1029 +- */
1030 ++ mutex_lock(&log_root_tree->log_mutex);
1031 + btrfs_remove_all_log_ctxs(log_root_tree, index2, ret);
1032 +
1033 +- mutex_lock(&log_root_tree->log_mutex);
1034 + log_root_tree->log_transid_committed++;
1035 + atomic_set(&log_root_tree->log_commit[index2], 0);
1036 + mutex_unlock(&log_root_tree->log_mutex);
1037 +@@ -2704,10 +2698,8 @@ out_wake_log_root:
1038 + if (waitqueue_active(&log_root_tree->log_commit_wait[index2]))
1039 + wake_up(&log_root_tree->log_commit_wait[index2]);
1040 + out:
1041 +- /* See above. */
1042 +- btrfs_remove_all_log_ctxs(root, index1, ret);
1043 +-
1044 + mutex_lock(&root->log_mutex);
1045 ++ btrfs_remove_all_log_ctxs(root, index1, ret);
1046 + root->log_transid_committed++;
1047 + atomic_set(&root->log_commit[index1], 0);
1048 + mutex_unlock(&root->log_mutex);
1049 +diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
1050 +index d67a16f2a45d..350f67fb5b9c 100644
1051 +--- a/fs/isofs/inode.c
1052 ++++ b/fs/isofs/inode.c
1053 +@@ -690,6 +690,11 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
1054 + pri_bh = NULL;
1055 +
1056 + root_found:
1057 ++ /* We don't support read-write mounts */
1058 ++ if (!(s->s_flags & MS_RDONLY)) {
1059 ++ error = -EACCES;
1060 ++ goto out_freebh;
1061 ++ }
1062 +
1063 + if (joliet_level && (pri == NULL || !opt.rock)) {
1064 + /* This is the case of Joliet with the norock mount flag.
1065 +@@ -1503,9 +1508,6 @@ struct inode *__isofs_iget(struct super_block *sb,
1066 + static struct dentry *isofs_mount(struct file_system_type *fs_type,
1067 + int flags, const char *dev_name, void *data)
1068 + {
1069 +- /* We don't support read-write mounts */
1070 +- if (!(flags & MS_RDONLY))
1071 +- return ERR_PTR(-EACCES);
1072 + return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
1073 + }
1074 +
1075 +diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
1076 +index ff2f2e6ad311..2abbb2babcae 100644
1077 +--- a/fs/jbd2/transaction.c
1078 ++++ b/fs/jbd2/transaction.c
1079 +@@ -1087,6 +1087,7 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
1080 + JBUFFER_TRACE(jh, "file as BJ_Reserved");
1081 + spin_lock(&journal->j_list_lock);
1082 + __jbd2_journal_file_buffer(jh, transaction, BJ_Reserved);
1083 ++ spin_unlock(&journal->j_list_lock);
1084 + } else if (jh->b_transaction == journal->j_committing_transaction) {
1085 + /* first access by this transaction */
1086 + jh->b_modified = 0;
1087 +@@ -1094,8 +1095,8 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
1088 + JBUFFER_TRACE(jh, "set next transaction");
1089 + spin_lock(&journal->j_list_lock);
1090 + jh->b_next_transaction = transaction;
1091 ++ spin_unlock(&journal->j_list_lock);
1092 + }
1093 +- spin_unlock(&journal->j_list_lock);
1094 + jbd_unlock_bh_state(bh);
1095 +
1096 + /*
1097 +diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
1098 +index 4cb1c10c7706..ca48dff09e19 100644
1099 +--- a/fs/overlayfs/copy_up.c
1100 ++++ b/fs/overlayfs/copy_up.c
1101 +@@ -129,6 +129,8 @@ static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len)
1102 + len -= bytes;
1103 + }
1104 +
1105 ++ if (!error)
1106 ++ error = vfs_fsync(new_file, 0);
1107 + fput(new_file);
1108 + out_fput:
1109 + fput(old_file);
1110 +diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
1111 +index 5e0a63b1b0d5..ce6c0d4aa48d 100644
1112 +--- a/fs/ubifs/xattr.c
1113 ++++ b/fs/ubifs/xattr.c
1114 +@@ -167,6 +167,7 @@ out_cancel:
1115 + host_ui->xattr_cnt -= 1;
1116 + host_ui->xattr_size -= CALC_DENT_SIZE(nm->len);
1117 + host_ui->xattr_size -= CALC_XATTR_BYTES(size);
1118 ++ host_ui->xattr_names -= nm->len;
1119 + mutex_unlock(&host_ui->ui_mutex);
1120 + out_free:
1121 + make_bad_inode(inode);
1122 +@@ -514,6 +515,7 @@ out_cancel:
1123 + host_ui->xattr_cnt += 1;
1124 + host_ui->xattr_size += CALC_DENT_SIZE(nm->len);
1125 + host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len);
1126 ++ host_ui->xattr_names += nm->len;
1127 + mutex_unlock(&host_ui->ui_mutex);
1128 + ubifs_release_budget(c, &req);
1129 + make_bad_inode(inode);
1130 +diff --git a/fs/xfs/libxfs/xfs_dquot_buf.c b/fs/xfs/libxfs/xfs_dquot_buf.c
1131 +index c6fba7314e8f..7c45d324880b 100644
1132 +--- a/fs/xfs/libxfs/xfs_dquot_buf.c
1133 ++++ b/fs/xfs/libxfs/xfs_dquot_buf.c
1134 +@@ -193,8 +193,7 @@ xfs_dquot_buf_verify_crc(
1135 + if (mp->m_quotainfo)
1136 + ndquots = mp->m_quotainfo->qi_dqperchunk;
1137 + else
1138 +- ndquots = xfs_calc_dquots_per_chunk(
1139 +- XFS_BB_TO_FSB(mp, bp->b_length));
1140 ++ ndquots = xfs_calc_dquots_per_chunk(bp->b_length);
1141 +
1142 + for (i = 0; i < ndquots; i++, d++) {
1143 + if (!xfs_verify_cksum((char *)d, sizeof(struct xfs_dqblk),
1144 +diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
1145 +index 2a5d388d76a4..ee26711a952a 100644
1146 +--- a/net/ipv4/udp.c
1147 ++++ b/net/ipv4/udp.c
1148 +@@ -1252,6 +1252,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
1149 + int peeked, off = 0;
1150 + int err;
1151 + int is_udplite = IS_UDPLITE(sk);
1152 ++ bool checksum_valid = false;
1153 + bool slow;
1154 +
1155 + if (flags & MSG_ERRQUEUE)
1156 +@@ -1277,11 +1278,12 @@ try_again:
1157 + */
1158 +
1159 + if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) {
1160 +- if (udp_lib_checksum_complete(skb))
1161 ++ checksum_valid = !udp_lib_checksum_complete(skb);
1162 ++ if (!checksum_valid)
1163 + goto csum_copy_err;
1164 + }
1165 +
1166 +- if (skb_csum_unnecessary(skb))
1167 ++ if (checksum_valid || skb_csum_unnecessary(skb))
1168 + err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
1169 + msg->msg_iov, copied);
1170 + else {
1171 +diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
1172 +index 7d0111696190..143e6c758b18 100644
1173 +--- a/net/ipv6/udp.c
1174 ++++ b/net/ipv6/udp.c
1175 +@@ -388,6 +388,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
1176 + int peeked, off = 0;
1177 + int err;
1178 + int is_udplite = IS_UDPLITE(sk);
1179 ++ bool checksum_valid = false;
1180 + int is_udp4;
1181 + bool slow;
1182 +
1183 +@@ -419,11 +420,12 @@ try_again:
1184 + */
1185 +
1186 + if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) {
1187 +- if (udp_lib_checksum_complete(skb))
1188 ++ checksum_valid = !udp_lib_checksum_complete(skb);
1189 ++ if (!checksum_valid)
1190 + goto csum_copy_err;
1191 + }
1192 +
1193 +- if (skb_csum_unnecessary(skb))
1194 ++ if (checksum_valid || skb_csum_unnecessary(skb))
1195 + err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
1196 + msg->msg_iov, copied);
1197 + else {
1198 +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
1199 +index c848d0b38c86..bb6f6ef07566 100644
1200 +--- a/net/mac80211/rx.c
1201 ++++ b/net/mac80211/rx.c
1202 +@@ -2040,16 +2040,22 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
1203 + if (!(status->rx_flags & IEEE80211_RX_AMSDU))
1204 + return RX_CONTINUE;
1205 +
1206 +- if (ieee80211_has_a4(hdr->frame_control) &&
1207 +- rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
1208 +- !rx->sdata->u.vlan.sta)
1209 +- return RX_DROP_UNUSABLE;
1210 ++ if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
1211 ++ switch (rx->sdata->vif.type) {
1212 ++ case NL80211_IFTYPE_AP_VLAN:
1213 ++ if (!rx->sdata->u.vlan.sta)
1214 ++ return RX_DROP_UNUSABLE;
1215 ++ break;
1216 ++ case NL80211_IFTYPE_STATION:
1217 ++ if (!rx->sdata->u.mgd.use_4addr)
1218 ++ return RX_DROP_UNUSABLE;
1219 ++ break;
1220 ++ default:
1221 ++ return RX_DROP_UNUSABLE;
1222 ++ }
1223 ++ }
1224 +
1225 +- if (is_multicast_ether_addr(hdr->addr1) &&
1226 +- ((rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
1227 +- rx->sdata->u.vlan.sta) ||
1228 +- (rx->sdata->vif.type == NL80211_IFTYPE_STATION &&
1229 +- rx->sdata->u.mgd.use_4addr)))
1230 ++ if (is_multicast_ether_addr(hdr->addr1))
1231 + return RX_DROP_UNUSABLE;
1232 +
1233 + skb->dev = dev;
1234 +diff --git a/security/keys/proc.c b/security/keys/proc.c
1235 +index 972eeb336b81..9962535ef9ad 100644
1236 +--- a/security/keys/proc.c
1237 ++++ b/security/keys/proc.c
1238 +@@ -187,7 +187,7 @@ static int proc_keys_show(struct seq_file *m, void *v)
1239 + struct timespec now;
1240 + unsigned long timo;
1241 + key_ref_t key_ref, skey_ref;
1242 +- char xbuf[12];
1243 ++ char xbuf[16];
1244 + int rc;
1245 +
1246 + struct keyring_search_context ctx = {
1247 +diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
1248 +index 17e1fdabd456..0051077a7b9d 100644
1249 +--- a/sound/usb/quirks-table.h
1250 ++++ b/sound/usb/quirks-table.h
1251 +@@ -2942,6 +2942,23 @@ AU0828_DEVICE(0x2040, 0x7260, "Hauppauge", "HVR-950Q"),
1252 + AU0828_DEVICE(0x2040, 0x7213, "Hauppauge", "HVR-950Q"),
1253 + AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
1254 +
1255 ++/* Syntek STK1160 */
1256 ++{
1257 ++ .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
1258 ++ USB_DEVICE_ID_MATCH_INT_CLASS |
1259 ++ USB_DEVICE_ID_MATCH_INT_SUBCLASS,
1260 ++ .idVendor = 0x05e1,
1261 ++ .idProduct = 0x0408,
1262 ++ .bInterfaceClass = USB_CLASS_AUDIO,
1263 ++ .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
1264 ++ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
1265 ++ .vendor_name = "Syntek",
1266 ++ .product_name = "STK1160",
1267 ++ .ifnum = QUIRK_ANY_INTERFACE,
1268 ++ .type = QUIRK_AUDIO_ALIGN_TRANSFER
1269 ++ }
1270 ++},
1271 ++
1272 + /* Digidesign Mbox */
1273 + {
1274 + /* Thanks to Clemens Ladisch <clemens@×××××××.de> */