Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Wed, 01 Feb 2017 12:59:13
Message-Id: 1485953934.90a958c6f264f2eb2a1108dbc2b7fabb4c1d43ea.alicef@gentoo
1 commit: 90a958c6f264f2eb2a1108dbc2b7fabb4c1d43ea
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 1 12:58:54 2017 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 1 12:58:54 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=90a958c6
7
8 Linux kernel 4.4.46
9
10 0000_README | 4 +
11 1045_linux-4.4.46.patch | 838 ++++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 842 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index b4fb9ea..adfde9f 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -223,6 +223,10 @@ Patch: 1044_linux-4.4.45.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.4.45
21
22 +Patch: 1045_linux-4.4.46.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.4.46
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/1045_linux-4.4.46.patch b/1045_linux-4.4.46.patch
31 new file mode 100644
32 index 0000000..a1943b9
33 --- /dev/null
34 +++ b/1045_linux-4.4.46.patch
35 @@ -0,0 +1,838 @@
36 +diff --git a/Makefile b/Makefile
37 +index a3dfc73da722..2dd5cb2fe182 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 4
42 + PATCHLEVEL = 4
43 +-SUBLEVEL = 45
44 ++SUBLEVEL = 46
45 + EXTRAVERSION =
46 + NAME = Blurry Fish Butt
47 +
48 +diff --git a/arch/arc/include/asm/delay.h b/arch/arc/include/asm/delay.h
49 +index a36e8601114d..d5da2115d78a 100644
50 +--- a/arch/arc/include/asm/delay.h
51 ++++ b/arch/arc/include/asm/delay.h
52 +@@ -26,7 +26,9 @@ static inline void __delay(unsigned long loops)
53 + " lp 1f \n"
54 + " nop \n"
55 + "1: \n"
56 +- : : "r"(loops));
57 ++ :
58 ++ : "r"(loops)
59 ++ : "lp_count");
60 + }
61 +
62 + extern void __bad_udelay(void);
63 +diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c
64 +index abd961f3e763..91ebe382147f 100644
65 +--- a/arch/arc/kernel/unaligned.c
66 ++++ b/arch/arc/kernel/unaligned.c
67 +@@ -241,8 +241,9 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs,
68 + if (state.fault)
69 + goto fault;
70 +
71 ++ /* clear any remanants of delay slot */
72 + if (delay_mode(regs)) {
73 +- regs->ret = regs->bta;
74 ++ regs->ret = regs->bta ~1U;
75 + regs->status32 &= ~STATUS_DE_MASK;
76 + } else {
77 + regs->ret += state.instr_len;
78 +diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
79 +index 3f9406d9b9d6..da87943328a5 100644
80 +--- a/arch/parisc/include/asm/bitops.h
81 ++++ b/arch/parisc/include/asm/bitops.h
82 +@@ -6,7 +6,7 @@
83 + #endif
84 +
85 + #include <linux/compiler.h>
86 +-#include <asm/types.h> /* for BITS_PER_LONG/SHIFT_PER_LONG */
87 ++#include <asm/types.h>
88 + #include <asm/byteorder.h>
89 + #include <asm/barrier.h>
90 + #include <linux/atomic.h>
91 +@@ -17,6 +17,12 @@
92 + * to include/asm-i386/bitops.h or kerneldoc
93 + */
94 +
95 ++#if __BITS_PER_LONG == 64
96 ++#define SHIFT_PER_LONG 6
97 ++#else
98 ++#define SHIFT_PER_LONG 5
99 ++#endif
100 ++
101 + #define CHOP_SHIFTCOUNT(x) (((unsigned long) (x)) & (BITS_PER_LONG - 1))
102 +
103 +
104 +diff --git a/arch/parisc/include/uapi/asm/bitsperlong.h b/arch/parisc/include/uapi/asm/bitsperlong.h
105 +index e0a23c7bdd43..07fa7e50bdc0 100644
106 +--- a/arch/parisc/include/uapi/asm/bitsperlong.h
107 ++++ b/arch/parisc/include/uapi/asm/bitsperlong.h
108 +@@ -3,10 +3,8 @@
109 +
110 + #if defined(__LP64__)
111 + #define __BITS_PER_LONG 64
112 +-#define SHIFT_PER_LONG 6
113 + #else
114 + #define __BITS_PER_LONG 32
115 +-#define SHIFT_PER_LONG 5
116 + #endif
117 +
118 + #include <asm-generic/bitsperlong.h>
119 +diff --git a/arch/parisc/include/uapi/asm/swab.h b/arch/parisc/include/uapi/asm/swab.h
120 +index e78403b129ef..928e1bbac98f 100644
121 +--- a/arch/parisc/include/uapi/asm/swab.h
122 ++++ b/arch/parisc/include/uapi/asm/swab.h
123 +@@ -1,6 +1,7 @@
124 + #ifndef _PARISC_SWAB_H
125 + #define _PARISC_SWAB_H
126 +
127 ++#include <asm/bitsperlong.h>
128 + #include <linux/types.h>
129 + #include <linux/compiler.h>
130 +
131 +@@ -38,7 +39,7 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
132 + }
133 + #define __arch_swab32 __arch_swab32
134 +
135 +-#if BITS_PER_LONG > 32
136 ++#if __BITS_PER_LONG > 32
137 + /*
138 + ** From "PA-RISC 2.0 Architecture", HP Professional Books.
139 + ** See Appendix I page 8 , "Endian Byte Swapping".
140 +@@ -61,6 +62,6 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
141 + return x;
142 + }
143 + #define __arch_swab64 __arch_swab64
144 +-#endif /* BITS_PER_LONG > 32 */
145 ++#endif /* __BITS_PER_LONG > 32 */
146 +
147 + #endif /* _PARISC_SWAB_H */
148 +diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
149 +index 01c37b36caf9..02bd587b610b 100644
150 +--- a/arch/s390/kernel/ptrace.c
151 ++++ b/arch/s390/kernel/ptrace.c
152 +@@ -963,6 +963,11 @@ static int s390_fpregs_set(struct task_struct *target,
153 + if (target == current)
154 + save_fpu_regs();
155 +
156 ++ if (MACHINE_HAS_VX)
157 ++ convert_vx_to_fp(fprs, target->thread.fpu.vxrs);
158 ++ else
159 ++ memcpy(&fprs, target->thread.fpu.fprs, sizeof(fprs));
160 ++
161 + /* If setting FPC, must validate it first. */
162 + if (count > 0 && pos < offsetof(s390_fp_regs, fprs)) {
163 + u32 ufpc[2] = { target->thread.fpu.fpc, 0 };
164 +@@ -1067,6 +1072,9 @@ static int s390_vxrs_low_set(struct task_struct *target,
165 + if (target == current)
166 + save_fpu_regs();
167 +
168 ++ for (i = 0; i < __NUM_VXRS_LOW; i++)
169 ++ vxrs[i] = *((__u64 *)(target->thread.fpu.vxrs + i) + 1);
170 ++
171 + rc = user_regset_copyin(&pos, &count, &kbuf, &ubuf, vxrs, 0, -1);
172 + if (rc == 0)
173 + for (i = 0; i < __NUM_VXRS_LOW; i++)
174 +diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c
175 +index bdc126faf741..6239aa155f6d 100644
176 +--- a/arch/tile/kernel/ptrace.c
177 ++++ b/arch/tile/kernel/ptrace.c
178 +@@ -111,7 +111,7 @@ static int tile_gpr_set(struct task_struct *target,
179 + const void *kbuf, const void __user *ubuf)
180 + {
181 + int ret;
182 +- struct pt_regs regs;
183 ++ struct pt_regs regs = *task_pt_regs(target);
184 +
185 + ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &regs, 0,
186 + sizeof(regs));
187 +diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
188 +index 39e30abddf08..71a10f08522e 100644
189 +--- a/drivers/gpu/drm/drm_modes.c
190 ++++ b/drivers/gpu/drm/drm_modes.c
191 +@@ -1401,6 +1401,13 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev,
192 + return NULL;
193 +
194 + mode->type |= DRM_MODE_TYPE_USERDEF;
195 ++ /* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */
196 ++ if (cmd->xres == 1366 && mode->hdisplay == 1368) {
197 ++ mode->hdisplay = 1366;
198 ++ mode->hsync_start--;
199 ++ mode->hsync_end--;
200 ++ drm_mode_set_name(mode);
201 ++ }
202 + drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
203 + return mode;
204 + }
205 +diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
206 +index 97d1ed20418b..63fea6a2869c 100644
207 +--- a/drivers/gpu/drm/i915/intel_crt.c
208 ++++ b/drivers/gpu/drm/i915/intel_crt.c
209 +@@ -445,6 +445,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
210 + struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private;
211 + struct edid *edid;
212 + struct i2c_adapter *i2c;
213 ++ bool ret = false;
214 +
215 + BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG);
216 +
217 +@@ -461,17 +462,17 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
218 + */
219 + if (!is_digital) {
220 + DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
221 +- return true;
222 ++ ret = true;
223 ++ } else {
224 ++ DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
225 + }
226 +-
227 +- DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
228 + } else {
229 + DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n");
230 + }
231 +
232 + kfree(edid);
233 +
234 +- return false;
235 ++ return ret;
236 + }
237 +
238 + static enum drm_connector_status
239 +diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
240 +index 17a15c56028c..c9dcad6a53bf 100644
241 +--- a/drivers/infiniband/core/cma.c
242 ++++ b/drivers/infiniband/core/cma.c
243 +@@ -2578,7 +2578,8 @@ static int cma_bind_addr(struct rdma_cm_id *id, struct sockaddr *src_addr,
244 + if (!src_addr || !src_addr->sa_family) {
245 + src_addr = (struct sockaddr *) &id->route.addr.src_addr;
246 + src_addr->sa_family = dst_addr->sa_family;
247 +- if (dst_addr->sa_family == AF_INET6) {
248 ++ if (IS_ENABLED(CONFIG_IPV6) &&
249 ++ dst_addr->sa_family == AF_INET6) {
250 + struct sockaddr_in6 *src_addr6 = (struct sockaddr_in6 *) src_addr;
251 + struct sockaddr_in6 *dst_addr6 = (struct sockaddr_in6 *) dst_addr;
252 + src_addr6->sin6_scope_id = dst_addr6->sin6_scope_id;
253 +diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
254 +index 04f3c0db9126..0ae337bec4f2 100644
255 +--- a/drivers/infiniband/core/umem.c
256 ++++ b/drivers/infiniband/core/umem.c
257 +@@ -134,6 +134,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
258 + IB_ACCESS_REMOTE_ATOMIC | IB_ACCESS_MW_BIND));
259 +
260 + if (access & IB_ACCESS_ON_DEMAND) {
261 ++ put_pid(umem->pid);
262 + ret = ib_umem_odp_get(context, umem);
263 + if (ret) {
264 + kfree(umem);
265 +@@ -149,6 +150,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
266 +
267 + page_list = (struct page **) __get_free_page(GFP_KERNEL);
268 + if (!page_list) {
269 ++ put_pid(umem->pid);
270 + kfree(umem);
271 + return ERR_PTR(-ENOMEM);
272 + }
273 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
274 +index 69a151ae8261..07cfcc326863 100644
275 +--- a/drivers/infiniband/ulp/ipoib/ipoib.h
276 ++++ b/drivers/infiniband/ulp/ipoib/ipoib.h
277 +@@ -63,6 +63,8 @@ enum ipoib_flush_level {
278 +
279 + enum {
280 + IPOIB_ENCAP_LEN = 4,
281 ++ IPOIB_PSEUDO_LEN = 20,
282 ++ IPOIB_HARD_LEN = IPOIB_ENCAP_LEN + IPOIB_PSEUDO_LEN,
283 +
284 + IPOIB_UD_HEAD_SIZE = IB_GRH_BYTES + IPOIB_ENCAP_LEN,
285 + IPOIB_UD_RX_SG = 2, /* max buffer needed for 4K mtu */
286 +@@ -131,15 +133,21 @@ struct ipoib_header {
287 + u16 reserved;
288 + };
289 +
290 +-struct ipoib_cb {
291 +- struct qdisc_skb_cb qdisc_cb;
292 +- u8 hwaddr[INFINIBAND_ALEN];
293 ++struct ipoib_pseudo_header {
294 ++ u8 hwaddr[INFINIBAND_ALEN];
295 + };
296 +
297 +-static inline struct ipoib_cb *ipoib_skb_cb(const struct sk_buff *skb)
298 ++static inline void skb_add_pseudo_hdr(struct sk_buff *skb)
299 + {
300 +- BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ipoib_cb));
301 +- return (struct ipoib_cb *)skb->cb;
302 ++ char *data = skb_push(skb, IPOIB_PSEUDO_LEN);
303 ++
304 ++ /*
305 ++ * only the ipoib header is present now, make room for a dummy
306 ++ * pseudo header and set skb field accordingly
307 ++ */
308 ++ memset(data, 0, IPOIB_PSEUDO_LEN);
309 ++ skb_reset_mac_header(skb);
310 ++ skb_pull(skb, IPOIB_HARD_LEN);
311 + }
312 +
313 + /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */
314 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
315 +index de5e2b01ab05..3ba7de5f9379 100644
316 +--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
317 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
318 +@@ -63,6 +63,8 @@ MODULE_PARM_DESC(cm_data_debug_level,
319 + #define IPOIB_CM_RX_DELAY (3 * 256 * HZ)
320 + #define IPOIB_CM_RX_UPDATE_MASK (0x3)
321 +
322 ++#define IPOIB_CM_RX_RESERVE (ALIGN(IPOIB_HARD_LEN, 16) - IPOIB_ENCAP_LEN)
323 ++
324 + static struct ib_qp_attr ipoib_cm_err_attr = {
325 + .qp_state = IB_QPS_ERR
326 + };
327 +@@ -147,15 +149,15 @@ static struct sk_buff *ipoib_cm_alloc_rx_skb(struct net_device *dev,
328 + struct sk_buff *skb;
329 + int i;
330 +
331 +- skb = dev_alloc_skb(IPOIB_CM_HEAD_SIZE + 12);
332 ++ skb = dev_alloc_skb(ALIGN(IPOIB_CM_HEAD_SIZE + IPOIB_PSEUDO_LEN, 16));
333 + if (unlikely(!skb))
334 + return NULL;
335 +
336 + /*
337 +- * IPoIB adds a 4 byte header. So we need 12 more bytes to align the
338 ++ * IPoIB adds a IPOIB_ENCAP_LEN byte header, this will align the
339 + * IP header to a multiple of 16.
340 + */
341 +- skb_reserve(skb, 12);
342 ++ skb_reserve(skb, IPOIB_CM_RX_RESERVE);
343 +
344 + mapping[0] = ib_dma_map_single(priv->ca, skb->data, IPOIB_CM_HEAD_SIZE,
345 + DMA_FROM_DEVICE);
346 +@@ -624,9 +626,9 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
347 + if (wc->byte_len < IPOIB_CM_COPYBREAK) {
348 + int dlen = wc->byte_len;
349 +
350 +- small_skb = dev_alloc_skb(dlen + 12);
351 ++ small_skb = dev_alloc_skb(dlen + IPOIB_CM_RX_RESERVE);
352 + if (small_skb) {
353 +- skb_reserve(small_skb, 12);
354 ++ skb_reserve(small_skb, IPOIB_CM_RX_RESERVE);
355 + ib_dma_sync_single_for_cpu(priv->ca, rx_ring[wr_id].mapping[0],
356 + dlen, DMA_FROM_DEVICE);
357 + skb_copy_from_linear_data(skb, small_skb->data, dlen);
358 +@@ -663,8 +665,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
359 +
360 + copied:
361 + skb->protocol = ((struct ipoib_header *) skb->data)->proto;
362 +- skb_reset_mac_header(skb);
363 +- skb_pull(skb, IPOIB_ENCAP_LEN);
364 ++ skb_add_pseudo_hdr(skb);
365 +
366 + ++dev->stats.rx_packets;
367 + dev->stats.rx_bytes += skb->len;
368 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
369 +index 85de078fb0ce..8f8c3af9f4e8 100644
370 +--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
371 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
372 +@@ -130,16 +130,15 @@ static struct sk_buff *ipoib_alloc_rx_skb(struct net_device *dev, int id)
373 +
374 + buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu);
375 +
376 +- skb = dev_alloc_skb(buf_size + IPOIB_ENCAP_LEN);
377 ++ skb = dev_alloc_skb(buf_size + IPOIB_HARD_LEN);
378 + if (unlikely(!skb))
379 + return NULL;
380 +
381 + /*
382 +- * IB will leave a 40 byte gap for a GRH and IPoIB adds a 4 byte
383 +- * header. So we need 4 more bytes to get to 48 and align the
384 +- * IP header to a multiple of 16.
385 ++ * the IP header will be at IPOIP_HARD_LEN + IB_GRH_BYTES, that is
386 ++ * 64 bytes aligned
387 + */
388 +- skb_reserve(skb, 4);
389 ++ skb_reserve(skb, sizeof(struct ipoib_pseudo_header));
390 +
391 + mapping = priv->rx_ring[id].mapping;
392 + mapping[0] = ib_dma_map_single(priv->ca, skb->data, buf_size,
393 +@@ -242,8 +241,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
394 + skb_pull(skb, IB_GRH_BYTES);
395 +
396 + skb->protocol = ((struct ipoib_header *) skb->data)->proto;
397 +- skb_reset_mac_header(skb);
398 +- skb_pull(skb, IPOIB_ENCAP_LEN);
399 ++ skb_add_pseudo_hdr(skb);
400 +
401 + ++dev->stats.rx_packets;
402 + dev->stats.rx_bytes += skb->len;
403 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
404 +index 5f7681b975d0..8a4d10452d61 100644
405 +--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
406 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
407 +@@ -850,9 +850,12 @@ static void neigh_add_path(struct sk_buff *skb, u8 *daddr,
408 + ipoib_neigh_free(neigh);
409 + goto err_drop;
410 + }
411 +- if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE)
412 ++ if (skb_queue_len(&neigh->queue) <
413 ++ IPOIB_MAX_PATH_REC_QUEUE) {
414 ++ /* put pseudoheader back on for next time */
415 ++ skb_push(skb, IPOIB_PSEUDO_LEN);
416 + __skb_queue_tail(&neigh->queue, skb);
417 +- else {
418 ++ } else {
419 + ipoib_warn(priv, "queue length limit %d. Packet drop.\n",
420 + skb_queue_len(&neigh->queue));
421 + goto err_drop;
422 +@@ -889,7 +892,7 @@ err_drop:
423 + }
424 +
425 + static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
426 +- struct ipoib_cb *cb)
427 ++ struct ipoib_pseudo_header *phdr)
428 + {
429 + struct ipoib_dev_priv *priv = netdev_priv(dev);
430 + struct ipoib_path *path;
431 +@@ -897,16 +900,18 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
432 +
433 + spin_lock_irqsave(&priv->lock, flags);
434 +
435 +- path = __path_find(dev, cb->hwaddr + 4);
436 ++ path = __path_find(dev, phdr->hwaddr + 4);
437 + if (!path || !path->valid) {
438 + int new_path = 0;
439 +
440 + if (!path) {
441 +- path = path_rec_create(dev, cb->hwaddr + 4);
442 ++ path = path_rec_create(dev, phdr->hwaddr + 4);
443 + new_path = 1;
444 + }
445 + if (path) {
446 + if (skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
447 ++ /* put pseudoheader back on for next time */
448 ++ skb_push(skb, IPOIB_PSEUDO_LEN);
449 + __skb_queue_tail(&path->queue, skb);
450 + } else {
451 + ++dev->stats.tx_dropped;
452 +@@ -934,10 +939,12 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
453 + be16_to_cpu(path->pathrec.dlid));
454 +
455 + spin_unlock_irqrestore(&priv->lock, flags);
456 +- ipoib_send(dev, skb, path->ah, IPOIB_QPN(cb->hwaddr));
457 ++ ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr));
458 + return;
459 + } else if ((path->query || !path_rec_start(dev, path)) &&
460 + skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
461 ++ /* put pseudoheader back on for next time */
462 ++ skb_push(skb, IPOIB_PSEUDO_LEN);
463 + __skb_queue_tail(&path->queue, skb);
464 + } else {
465 + ++dev->stats.tx_dropped;
466 +@@ -951,13 +958,15 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
467 + {
468 + struct ipoib_dev_priv *priv = netdev_priv(dev);
469 + struct ipoib_neigh *neigh;
470 +- struct ipoib_cb *cb = ipoib_skb_cb(skb);
471 ++ struct ipoib_pseudo_header *phdr;
472 + struct ipoib_header *header;
473 + unsigned long flags;
474 +
475 ++ phdr = (struct ipoib_pseudo_header *) skb->data;
476 ++ skb_pull(skb, sizeof(*phdr));
477 + header = (struct ipoib_header *) skb->data;
478 +
479 +- if (unlikely(cb->hwaddr[4] == 0xff)) {
480 ++ if (unlikely(phdr->hwaddr[4] == 0xff)) {
481 + /* multicast, arrange "if" according to probability */
482 + if ((header->proto != htons(ETH_P_IP)) &&
483 + (header->proto != htons(ETH_P_IPV6)) &&
484 +@@ -970,13 +979,13 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
485 + return NETDEV_TX_OK;
486 + }
487 + /* Add in the P_Key for multicast*/
488 +- cb->hwaddr[8] = (priv->pkey >> 8) & 0xff;
489 +- cb->hwaddr[9] = priv->pkey & 0xff;
490 ++ phdr->hwaddr[8] = (priv->pkey >> 8) & 0xff;
491 ++ phdr->hwaddr[9] = priv->pkey & 0xff;
492 +
493 +- neigh = ipoib_neigh_get(dev, cb->hwaddr);
494 ++ neigh = ipoib_neigh_get(dev, phdr->hwaddr);
495 + if (likely(neigh))
496 + goto send_using_neigh;
497 +- ipoib_mcast_send(dev, cb->hwaddr, skb);
498 ++ ipoib_mcast_send(dev, phdr->hwaddr, skb);
499 + return NETDEV_TX_OK;
500 + }
501 +
502 +@@ -985,16 +994,16 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
503 + case htons(ETH_P_IP):
504 + case htons(ETH_P_IPV6):
505 + case htons(ETH_P_TIPC):
506 +- neigh = ipoib_neigh_get(dev, cb->hwaddr);
507 ++ neigh = ipoib_neigh_get(dev, phdr->hwaddr);
508 + if (unlikely(!neigh)) {
509 +- neigh_add_path(skb, cb->hwaddr, dev);
510 ++ neigh_add_path(skb, phdr->hwaddr, dev);
511 + return NETDEV_TX_OK;
512 + }
513 + break;
514 + case htons(ETH_P_ARP):
515 + case htons(ETH_P_RARP):
516 + /* for unicast ARP and RARP should always perform path find */
517 +- unicast_arp_send(skb, dev, cb);
518 ++ unicast_arp_send(skb, dev, phdr);
519 + return NETDEV_TX_OK;
520 + default:
521 + /* ethertype not supported by IPoIB */
522 +@@ -1011,11 +1020,13 @@ send_using_neigh:
523 + goto unref;
524 + }
525 + } else if (neigh->ah) {
526 +- ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(cb->hwaddr));
527 ++ ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(phdr->hwaddr));
528 + goto unref;
529 + }
530 +
531 + if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
532 ++ /* put pseudoheader back on for next time */
533 ++ skb_push(skb, sizeof(*phdr));
534 + spin_lock_irqsave(&priv->lock, flags);
535 + __skb_queue_tail(&neigh->queue, skb);
536 + spin_unlock_irqrestore(&priv->lock, flags);
537 +@@ -1047,8 +1058,8 @@ static int ipoib_hard_header(struct sk_buff *skb,
538 + unsigned short type,
539 + const void *daddr, const void *saddr, unsigned len)
540 + {
541 ++ struct ipoib_pseudo_header *phdr;
542 + struct ipoib_header *header;
543 +- struct ipoib_cb *cb = ipoib_skb_cb(skb);
544 +
545 + header = (struct ipoib_header *) skb_push(skb, sizeof *header);
546 +
547 +@@ -1057,12 +1068,13 @@ static int ipoib_hard_header(struct sk_buff *skb,
548 +
549 + /*
550 + * we don't rely on dst_entry structure, always stuff the
551 +- * destination address into skb->cb so we can figure out where
552 ++ * destination address into skb hard header so we can figure out where
553 + * to send the packet later.
554 + */
555 +- memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
556 ++ phdr = (struct ipoib_pseudo_header *) skb_push(skb, sizeof(*phdr));
557 ++ memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
558 +
559 +- return sizeof *header;
560 ++ return IPOIB_HARD_LEN;
561 + }
562 +
563 + static void ipoib_set_mcast_list(struct net_device *dev)
564 +@@ -1638,7 +1650,7 @@ void ipoib_setup(struct net_device *dev)
565 +
566 + dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
567 +
568 +- dev->hard_header_len = IPOIB_ENCAP_LEN;
569 ++ dev->hard_header_len = IPOIB_HARD_LEN;
570 + dev->addr_len = INFINIBAND_ALEN;
571 + dev->type = ARPHRD_INFINIBAND;
572 + dev->tx_queue_len = ipoib_sendq_size * 2;
573 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
574 +index 8ec99bdea76b..5580ab0b5781 100644
575 +--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
576 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
577 +@@ -756,9 +756,11 @@ void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb)
578 + __ipoib_mcast_add(dev, mcast);
579 + list_add_tail(&mcast->list, &priv->multicast_list);
580 + }
581 +- if (skb_queue_len(&mcast->pkt_queue) < IPOIB_MAX_MCAST_QUEUE)
582 ++ if (skb_queue_len(&mcast->pkt_queue) < IPOIB_MAX_MCAST_QUEUE) {
583 ++ /* put pseudoheader back on for next time */
584 ++ skb_push(skb, sizeof(struct ipoib_pseudo_header));
585 + skb_queue_tail(&mcast->pkt_queue, skb);
586 +- else {
587 ++ } else {
588 + ++dev->stats.tx_dropped;
589 + dev_kfree_skb_any(skb);
590 + }
591 +diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
592 +index d7c286656a25..7b4ddf0a39ec 100644
593 +--- a/drivers/isdn/hardware/eicon/message.c
594 ++++ b/drivers/isdn/hardware/eicon/message.c
595 +@@ -11304,7 +11304,8 @@ static void mixer_notify_update(PLCI *plci, byte others)
596 + ((CAPI_MSG *) msg)->header.ncci = 0;
597 + ((CAPI_MSG *) msg)->info.facility_req.Selector = SELECTOR_LINE_INTERCONNECT;
598 + ((CAPI_MSG *) msg)->info.facility_req.structs[0] = 3;
599 +- PUT_WORD(&(((CAPI_MSG *) msg)->info.facility_req.structs[1]), LI_REQ_SILENT_UPDATE);
600 ++ ((CAPI_MSG *) msg)->info.facility_req.structs[1] = LI_REQ_SILENT_UPDATE & 0xff;
601 ++ ((CAPI_MSG *) msg)->info.facility_req.structs[2] = LI_REQ_SILENT_UPDATE >> 8;
602 + ((CAPI_MSG *) msg)->info.facility_req.structs[3] = 0;
603 + w = api_put(notify_plci->appl, (CAPI_MSG *) msg);
604 + if (w != _QUEUE_FULL)
605 +diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
606 +index 521bbf1b29bc..670240c0ece8 100644
607 +--- a/drivers/media/i2c/Kconfig
608 ++++ b/drivers/media/i2c/Kconfig
609 +@@ -607,6 +607,7 @@ config VIDEO_S5K6A3
610 + config VIDEO_S5K4ECGX
611 + tristate "Samsung S5K4ECGX sensor support"
612 + depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
613 ++ select CRC32
614 + ---help---
615 + This is a V4L2 sensor-level driver for Samsung S5K4ECGX 5M
616 + camera sensor with an embedded SoC image signal processor.
617 +diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
618 +index 7be393c96b1a..cf7c18947189 100644
619 +--- a/drivers/net/can/c_can/c_can_pci.c
620 ++++ b/drivers/net/can/c_can/c_can_pci.c
621 +@@ -161,6 +161,7 @@ static int c_can_pci_probe(struct pci_dev *pdev,
622 +
623 + dev->irq = pdev->irq;
624 + priv->base = addr;
625 ++ priv->device = &pdev->dev;
626 +
627 + if (!c_can_pci_data->freq) {
628 + dev_err(&pdev->dev, "no clock frequency defined\n");
629 +diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
630 +index 680d1ff07a55..6749b1829469 100644
631 +--- a/drivers/net/can/ti_hecc.c
632 ++++ b/drivers/net/can/ti_hecc.c
633 +@@ -948,7 +948,12 @@ static int ti_hecc_probe(struct platform_device *pdev)
634 + netif_napi_add(ndev, &priv->napi, ti_hecc_rx_poll,
635 + HECC_DEF_NAPI_WEIGHT);
636 +
637 +- clk_enable(priv->clk);
638 ++ err = clk_prepare_enable(priv->clk);
639 ++ if (err) {
640 ++ dev_err(&pdev->dev, "clk_prepare_enable() failed\n");
641 ++ goto probe_exit_clk;
642 ++ }
643 ++
644 + err = register_candev(ndev);
645 + if (err) {
646 + dev_err(&pdev->dev, "register_candev() failed\n");
647 +@@ -981,7 +986,7 @@ static int ti_hecc_remove(struct platform_device *pdev)
648 + struct ti_hecc_priv *priv = netdev_priv(ndev);
649 +
650 + unregister_candev(ndev);
651 +- clk_disable(priv->clk);
652 ++ clk_disable_unprepare(priv->clk);
653 + clk_put(priv->clk);
654 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
655 + iounmap(priv->base);
656 +@@ -1006,7 +1011,7 @@ static int ti_hecc_suspend(struct platform_device *pdev, pm_message_t state)
657 + hecc_set_bit(priv, HECC_CANMC, HECC_CANMC_PDR);
658 + priv->can.state = CAN_STATE_SLEEPING;
659 +
660 +- clk_disable(priv->clk);
661 ++ clk_disable_unprepare(priv->clk);
662 +
663 + return 0;
664 + }
665 +@@ -1015,8 +1020,11 @@ static int ti_hecc_resume(struct platform_device *pdev)
666 + {
667 + struct net_device *dev = platform_get_drvdata(pdev);
668 + struct ti_hecc_priv *priv = netdev_priv(dev);
669 ++ int err;
670 +
671 +- clk_enable(priv->clk);
672 ++ err = clk_prepare_enable(priv->clk);
673 ++ if (err)
674 ++ return err;
675 +
676 + hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_PDR);
677 + priv->can.state = CAN_STATE_ERROR_ACTIVE;
678 +diff --git a/drivers/pinctrl/intel/pinctrl-broxton.c b/drivers/pinctrl/intel/pinctrl-broxton.c
679 +index 5979d38c46b2..7329500943a3 100644
680 +--- a/drivers/pinctrl/intel/pinctrl-broxton.c
681 ++++ b/drivers/pinctrl/intel/pinctrl-broxton.c
682 +@@ -19,7 +19,7 @@
683 +
684 + #define BXT_PAD_OWN 0x020
685 + #define BXT_HOSTSW_OWN 0x080
686 +-#define BXT_PADCFGLOCK 0x090
687 ++#define BXT_PADCFGLOCK 0x060
688 + #define BXT_GPI_IE 0x110
689 +
690 + #define BXT_COMMUNITY(s, e) \
691 +diff --git a/drivers/platform/x86/intel_mid_powerbtn.c b/drivers/platform/x86/intel_mid_powerbtn.c
692 +index 1fc0de870ff8..361770568ad0 100644
693 +--- a/drivers/platform/x86/intel_mid_powerbtn.c
694 ++++ b/drivers/platform/x86/intel_mid_powerbtn.c
695 +@@ -77,7 +77,7 @@ static int mfld_pb_probe(struct platform_device *pdev)
696 +
697 + input_set_capability(input, EV_KEY, KEY_POWER);
698 +
699 +- error = request_threaded_irq(irq, NULL, mfld_pb_isr, 0,
700 ++ error = request_threaded_irq(irq, NULL, mfld_pb_isr, IRQF_ONESHOT,
701 + DRIVER_NAME, input);
702 + if (error) {
703 + dev_err(&pdev->dev, "Unable to request irq %d for mfld power"
704 +diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c
705 +index f89245b8ba8e..68a113594808 100644
706 +--- a/drivers/video/fbdev/core/fbcmap.c
707 ++++ b/drivers/video/fbdev/core/fbcmap.c
708 +@@ -163,17 +163,18 @@ void fb_dealloc_cmap(struct fb_cmap *cmap)
709 +
710 + int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to)
711 + {
712 +- int tooff = 0, fromoff = 0;
713 +- int size;
714 ++ unsigned int tooff = 0, fromoff = 0;
715 ++ size_t size;
716 +
717 + if (to->start > from->start)
718 + fromoff = to->start - from->start;
719 + else
720 + tooff = from->start - to->start;
721 +- size = to->len - tooff;
722 +- if (size > (int) (from->len - fromoff))
723 +- size = from->len - fromoff;
724 +- if (size <= 0)
725 ++ if (fromoff >= from->len || tooff >= to->len)
726 ++ return -EINVAL;
727 ++
728 ++ size = min_t(size_t, to->len - tooff, from->len - fromoff);
729 ++ if (size == 0)
730 + return -EINVAL;
731 + size *= sizeof(u16);
732 +
733 +@@ -187,17 +188,18 @@ int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to)
734 +
735 + int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to)
736 + {
737 +- int tooff = 0, fromoff = 0;
738 +- int size;
739 ++ unsigned int tooff = 0, fromoff = 0;
740 ++ size_t size;
741 +
742 + if (to->start > from->start)
743 + fromoff = to->start - from->start;
744 + else
745 + tooff = from->start - to->start;
746 +- size = to->len - tooff;
747 +- if (size > (int) (from->len - fromoff))
748 +- size = from->len - fromoff;
749 +- if (size <= 0)
750 ++ if (fromoff >= from->len || tooff >= to->len)
751 ++ return -EINVAL;
752 ++
753 ++ size = min_t(size_t, to->len - tooff, from->len - fromoff);
754 ++ if (size == 0)
755 + return -EINVAL;
756 + size *= sizeof(u16);
757 +
758 +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
759 +index 3c69299c01ab..9a524e763c3e 100644
760 +--- a/fs/nfs/nfs4proc.c
761 ++++ b/fs/nfs/nfs4proc.c
762 +@@ -2422,7 +2422,8 @@ static inline void nfs4_exclusive_attrset(struct nfs4_opendata *opendata,
763 + sattr->ia_valid |= ATTR_MTIME;
764 +
765 + /* Except MODE, it seems harmless of setting twice. */
766 +- if ((attrset[1] & FATTR4_WORD1_MODE))
767 ++ if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE &&
768 ++ attrset[1] & FATTR4_WORD1_MODE)
769 + sattr->ia_valid &= ~ATTR_MODE;
770 +
771 + if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL)
772 +diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
773 +index e7e78537aea2..63a817631f06 100644
774 +--- a/include/linux/nfs4.h
775 ++++ b/include/linux/nfs4.h
776 +@@ -266,7 +266,7 @@ enum nfsstat4 {
777 +
778 + static inline bool seqid_mutating_err(u32 err)
779 + {
780 +- /* rfc 3530 section 8.1.5: */
781 ++ /* See RFC 7530, section 9.1.7 */
782 + switch (err) {
783 + case NFS4ERR_STALE_CLIENTID:
784 + case NFS4ERR_STALE_STATEID:
785 +@@ -275,6 +275,7 @@ static inline bool seqid_mutating_err(u32 err)
786 + case NFS4ERR_BADXDR:
787 + case NFS4ERR_RESOURCE:
788 + case NFS4ERR_NOFILEHANDLE:
789 ++ case NFS4ERR_MOVED:
790 + return false;
791 + };
792 + return true;
793 +diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
794 +index 9b6027c51736..316a5525b730 100644
795 +--- a/include/linux/sunrpc/clnt.h
796 ++++ b/include/linux/sunrpc/clnt.h
797 +@@ -180,5 +180,6 @@ const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
798 + int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t);
799 +
800 + const char *rpc_proc_name(const struct rpc_task *task);
801 ++void rpc_cleanup_clids(void);
802 + #endif /* __KERNEL__ */
803 + #endif /* _LINUX_SUNRPC_CLNT_H */
804 +diff --git a/kernel/sysctl.c b/kernel/sysctl.c
805 +index 999e025bf68e..2f0d157258a2 100644
806 +--- a/kernel/sysctl.c
807 ++++ b/kernel/sysctl.c
808 +@@ -2414,6 +2414,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
809 + break;
810 + if (neg)
811 + continue;
812 ++ val = convmul * val / convdiv;
813 + if ((min && val < *min) || (max && val > *max))
814 + continue;
815 + *i = val;
816 +diff --git a/mm/memcontrol.c b/mm/memcontrol.c
817 +index 5d9c8a3136bc..43eefe9d834c 100644
818 +--- a/mm/memcontrol.c
819 ++++ b/mm/memcontrol.c
820 +@@ -4496,9 +4496,9 @@ static int mem_cgroup_do_precharge(unsigned long count)
821 + return ret;
822 + }
823 +
824 +- /* Try charges one by one with reclaim */
825 ++ /* Try charges one by one with reclaim, but do not retry */
826 + while (count--) {
827 +- ret = try_charge(mc.to, GFP_KERNEL & ~__GFP_NORETRY, 1);
828 ++ ret = try_charge(mc.to, GFP_KERNEL | __GFP_NORETRY, 1);
829 + if (ret)
830 + return ret;
831 + mc.precharge++;
832 +diff --git a/mm/mempolicy.c b/mm/mempolicy.c
833 +index 87a177917cb2..a4217fe60dff 100644
834 +--- a/mm/mempolicy.c
835 ++++ b/mm/mempolicy.c
836 +@@ -2006,8 +2006,8 @@ retry_cpuset:
837 +
838 + nmask = policy_nodemask(gfp, pol);
839 + zl = policy_zonelist(gfp, pol, node);
840 +- mpol_cond_put(pol);
841 + page = __alloc_pages_nodemask(gfp, order, zl, nmask);
842 ++ mpol_cond_put(pol);
843 + out:
844 + if (unlikely(!page && read_mems_allowed_retry(cpuset_mems_cookie)))
845 + goto retry_cpuset;
846 +diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
847 +index 7a93922457ff..f28aeb2cfd32 100644
848 +--- a/net/sunrpc/clnt.c
849 ++++ b/net/sunrpc/clnt.c
850 +@@ -337,6 +337,11 @@ out:
851 +
852 + static DEFINE_IDA(rpc_clids);
853 +
854 ++void rpc_cleanup_clids(void)
855 ++{
856 ++ ida_destroy(&rpc_clids);
857 ++}
858 ++
859 + static int rpc_alloc_clid(struct rpc_clnt *clnt)
860 + {
861 + int clid;
862 +diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
863 +index ee5d3d253102..3142f38d1104 100644
864 +--- a/net/sunrpc/sunrpc_syms.c
865 ++++ b/net/sunrpc/sunrpc_syms.c
866 +@@ -119,6 +119,7 @@ out:
867 + static void __exit
868 + cleanup_sunrpc(void)
869 + {
870 ++ rpc_cleanup_clids();
871 + rpcauth_remove_module();
872 + cleanup_socket_xprt();
873 + svc_cleanup_xprt_sock();