Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:3.14 commit in: /
Date: Wed, 04 May 2016 23:46:15
Message-Id: 1462405560.6432eff023765a13f41839ec11cdc025f3046c26.mpagano@gentoo
1 commit: 6432eff023765a13f41839ec11cdc025f3046c26
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 4 23:46:00 2016 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed May 4 23:46:00 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6432eff0
7
8 Linux patch 3.14.68
9
10 0000_README | 4 +
11 1067_linux-3.14.68.patch | 1259 ++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 1263 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index b3e38b1..b24780e 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -310,6 +310,10 @@ Patch: 1066_linux-3.14.67.patch
19 From: http://www.kernel.org
20 Desc: Linux 3.14.67
21
22 +Patch: 1067_linux-3.14.68.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 3.14.68
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/1067_linux-3.14.68.patch b/1067_linux-3.14.68.patch
31 new file mode 100644
32 index 0000000..8e6aef3
33 --- /dev/null
34 +++ b/1067_linux-3.14.68.patch
35 @@ -0,0 +1,1259 @@
36 +diff --git a/Makefile b/Makefile
37 +index 0a28325ef49c..5ec8a7dda8ba 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 3
42 + PATCHLEVEL = 14
43 +-SUBLEVEL = 67
44 ++SUBLEVEL = 68
45 + EXTRAVERSION =
46 + NAME = Remembering Coco
47 +
48 +diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
49 +index e18709d3b95d..38e1bdcaf015 100644
50 +--- a/arch/arm/mach-omap2/cpuidle34xx.c
51 ++++ b/arch/arm/mach-omap2/cpuidle34xx.c
52 +@@ -34,6 +34,7 @@
53 + #include "pm.h"
54 + #include "control.h"
55 + #include "common.h"
56 ++#include "soc.h"
57 +
58 + /* Mach specific information to be recorded in the C-state driver_data */
59 + struct omap3_idle_statedata {
60 +@@ -322,6 +323,69 @@ static struct cpuidle_driver omap3_idle_driver = {
61 + .safe_state_index = 0,
62 + };
63 +
64 ++/*
65 ++ * Numbers based on measurements made in October 2009 for PM optimized kernel
66 ++ * with CPU freq enabled on device Nokia N900. Assumes OPP2 (main idle OPP,
67 ++ * and worst case latencies).
68 ++ */
69 ++static struct cpuidle_driver omap3430_idle_driver = {
70 ++ .name = "omap3430_idle",
71 ++ .owner = THIS_MODULE,
72 ++ .states = {
73 ++ {
74 ++ .enter = omap3_enter_idle_bm,
75 ++ .exit_latency = 110 + 162,
76 ++ .target_residency = 5,
77 ++ .name = "C1",
78 ++ .desc = "MPU ON + CORE ON",
79 ++ },
80 ++ {
81 ++ .enter = omap3_enter_idle_bm,
82 ++ .exit_latency = 106 + 180,
83 ++ .target_residency = 309,
84 ++ .name = "C2",
85 ++ .desc = "MPU ON + CORE ON",
86 ++ },
87 ++ {
88 ++ .enter = omap3_enter_idle_bm,
89 ++ .exit_latency = 107 + 410,
90 ++ .target_residency = 46057,
91 ++ .name = "C3",
92 ++ .desc = "MPU RET + CORE ON",
93 ++ },
94 ++ {
95 ++ .enter = omap3_enter_idle_bm,
96 ++ .exit_latency = 121 + 3374,
97 ++ .target_residency = 46057,
98 ++ .name = "C4",
99 ++ .desc = "MPU OFF + CORE ON",
100 ++ },
101 ++ {
102 ++ .enter = omap3_enter_idle_bm,
103 ++ .exit_latency = 855 + 1146,
104 ++ .target_residency = 46057,
105 ++ .name = "C5",
106 ++ .desc = "MPU RET + CORE RET",
107 ++ },
108 ++ {
109 ++ .enter = omap3_enter_idle_bm,
110 ++ .exit_latency = 7580 + 4134,
111 ++ .target_residency = 484329,
112 ++ .name = "C6",
113 ++ .desc = "MPU OFF + CORE RET",
114 ++ },
115 ++ {
116 ++ .enter = omap3_enter_idle_bm,
117 ++ .exit_latency = 7505 + 15274,
118 ++ .target_residency = 484329,
119 ++ .name = "C7",
120 ++ .desc = "MPU OFF + CORE OFF",
121 ++ },
122 ++ },
123 ++ .state_count = ARRAY_SIZE(omap3_idle_data),
124 ++ .safe_state_index = 0,
125 ++};
126 ++
127 + /* Public functions */
128 +
129 + /**
130 +@@ -340,5 +404,8 @@ int __init omap3_idle_init(void)
131 + if (!mpu_pd || !core_pd || !per_pd || !cam_pd)
132 + return -ENODEV;
133 +
134 +- return cpuidle_register(&omap3_idle_driver, NULL);
135 ++ if (cpu_is_omap3430())
136 ++ return cpuidle_register(&omap3430_idle_driver, NULL);
137 ++ else
138 ++ return cpuidle_register(&omap3_idle_driver, NULL);
139 + }
140 +diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
141 +index 399af1e9f6e1..4bfd470b6d55 100644
142 +--- a/arch/arm/mach-omap2/omap_hwmod.c
143 ++++ b/arch/arm/mach-omap2/omap_hwmod.c
144 +@@ -1439,9 +1439,7 @@ static void _enable_sysc(struct omap_hwmod *oh)
145 + (sf & SYSC_HAS_CLOCKACTIVITY))
146 + _set_clockactivity(oh, oh->class->sysc->clockact, &v);
147 +
148 +- /* If the cached value is the same as the new value, skip the write */
149 +- if (oh->_sysc_cache != v)
150 +- _write_sysconfig(v, oh);
151 ++ _write_sysconfig(v, oh);
152 +
153 + /*
154 + * Set the autoidle bit only after setting the smartidle bit
155 +@@ -1504,7 +1502,9 @@ static void _idle_sysc(struct omap_hwmod *oh)
156 + _set_master_standbymode(oh, idlemode, &v);
157 + }
158 +
159 +- _write_sysconfig(v, oh);
160 ++ /* If the cached value is the same as the new value, skip the write */
161 ++ if (oh->_sysc_cache != v)
162 ++ _write_sysconfig(v, oh);
163 + }
164 +
165 + /**
166 +diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h
167 +index d866959e5685..d2ad00a42234 100644
168 +--- a/arch/x86/include/asm/xen/hypervisor.h
169 ++++ b/arch/x86/include/asm/xen/hypervisor.h
170 +@@ -57,4 +57,6 @@ static inline bool xen_x2apic_para_available(void)
171 + }
172 + #endif
173 +
174 ++extern void xen_set_iopl_mask(unsigned mask);
175 ++
176 + #endif /* _ASM_X86_XEN_HYPERVISOR_H */
177 +diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
178 +index e2d26ce9b854..4b8716d09ff9 100644
179 +--- a/arch/x86/kernel/process_64.c
180 ++++ b/arch/x86/kernel/process_64.c
181 +@@ -49,6 +49,7 @@
182 + #include <asm/syscalls.h>
183 + #include <asm/debugreg.h>
184 + #include <asm/switch_to.h>
185 ++#include <asm/xen/hypervisor.h>
186 +
187 + asmlinkage extern void ret_from_fork(void);
188 +
189 +@@ -427,6 +428,17 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
190 + task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))
191 + __switch_to_xtra(prev_p, next_p, tss);
192 +
193 ++#ifdef CONFIG_XEN
194 ++ /*
195 ++ * On Xen PV, IOPL bits in pt_regs->flags have no effect, and
196 ++ * current_pt_regs()->flags may not match the current task's
197 ++ * intended IOPL. We need to switch it manually.
198 ++ */
199 ++ if (unlikely(xen_pv_domain() &&
200 ++ prev->iopl != next->iopl))
201 ++ xen_set_iopl_mask(next->iopl);
202 ++#endif
203 ++
204 + return prev_p;
205 + }
206 +
207 +diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
208 +index a7fab60bdeeb..ac1e7dafb32e 100644
209 +--- a/arch/x86/xen/enlighten.c
210 ++++ b/arch/x86/xen/enlighten.c
211 +@@ -956,7 +956,7 @@ static void xen_load_sp0(struct tss_struct *tss,
212 + xen_mc_issue(PARAVIRT_LAZY_CPU);
213 + }
214 +
215 +-static void xen_set_iopl_mask(unsigned mask)
216 ++void xen_set_iopl_mask(unsigned mask)
217 + {
218 + struct physdev_set_iopl set_iopl;
219 +
220 +diff --git a/crypto/gcm.c b/crypto/gcm.c
221 +index 9cea4d0b6904..f0bd00b15f26 100644
222 +--- a/crypto/gcm.c
223 ++++ b/crypto/gcm.c
224 +@@ -1173,6 +1173,9 @@ static struct aead_request *crypto_rfc4543_crypt(struct aead_request *req,
225 + aead_request_set_tfm(subreq, ctx->child);
226 + aead_request_set_callback(subreq, req->base.flags, crypto_rfc4543_done,
227 + req);
228 ++ if (!enc)
229 ++ aead_request_set_callback(subreq, req->base.flags,
230 ++ req->base.complete, req->base.data);
231 + aead_request_set_crypt(subreq, cipher, cipher, enc ? 0 : authsize, iv);
232 + aead_request_set_assoc(subreq, assoc, assoclen);
233 +
234 +diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
235 +index 19ad8f0c83ef..897b6b9e53b1 100644
236 +--- a/drivers/block/paride/pd.c
237 ++++ b/drivers/block/paride/pd.c
238 +@@ -126,7 +126,7 @@
239 + */
240 + #include <linux/types.h>
241 +
242 +-static bool verbose = 0;
243 ++static int verbose = 0;
244 + static int major = PD_MAJOR;
245 + static char *name = PD_NAME;
246 + static int cluster = 64;
247 +@@ -161,7 +161,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV};
248 + static DEFINE_MUTEX(pd_mutex);
249 + static DEFINE_SPINLOCK(pd_lock);
250 +
251 +-module_param(verbose, bool, 0);
252 ++module_param(verbose, int, 0);
253 + module_param(major, int, 0);
254 + module_param(name, charp, 0);
255 + module_param(cluster, int, 0);
256 +diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
257 +index 2596042eb987..ada45058e04d 100644
258 +--- a/drivers/block/paride/pt.c
259 ++++ b/drivers/block/paride/pt.c
260 +@@ -117,7 +117,7 @@
261 +
262 + */
263 +
264 +-static bool verbose = 0;
265 ++static int verbose = 0;
266 + static int major = PT_MAJOR;
267 + static char *name = PT_NAME;
268 + static int disable = 0;
269 +@@ -152,7 +152,7 @@ static int (*drives[4])[6] = {&drive0, &drive1, &drive2, &drive3};
270 +
271 + #include <asm/uaccess.h>
272 +
273 +-module_param(verbose, bool, 0);
274 ++module_param(verbose, int, 0);
275 + module_param(major, int, 0);
276 + module_param(name, charp, 0);
277 + module_param_array(drive0, int, NULL, 0);
278 +diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
279 +index 3ef58c8dbf11..78737f4fd894 100644
280 +--- a/drivers/bus/imx-weim.c
281 ++++ b/drivers/bus/imx-weim.c
282 +@@ -92,7 +92,7 @@ static int __init weim_parse_dt(struct platform_device *pdev,
283 + struct device_node *child;
284 + int ret;
285 +
286 +- for_each_child_of_node(pdev->dev.of_node, child) {
287 ++ for_each_available_child_of_node(pdev->dev.of_node, child) {
288 + if (!child->name)
289 + continue;
290 +
291 +diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
292 +index 5c93afb1841a..f10b4998937d 100644
293 +--- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
294 ++++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
295 +@@ -206,6 +206,9 @@ static int ccp_aes_cmac_export(struct ahash_request *req, void *out)
296 + struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req);
297 + struct ccp_aes_cmac_exp_ctx state;
298 +
299 ++ /* Don't let anything leak to 'out' */
300 ++ memset(&state, 0, sizeof(state));
301 ++
302 + state.null_msg = rctx->null_msg;
303 + memcpy(state.iv, rctx->iv, sizeof(state.iv));
304 + state.buf_count = rctx->buf_count;
305 +diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c
306 +index bdbb5865a50f..c5b393694dfe 100644
307 +--- a/drivers/crypto/ccp/ccp-crypto-sha.c
308 ++++ b/drivers/crypto/ccp/ccp-crypto-sha.c
309 +@@ -262,6 +262,9 @@ static int ccp_sha_export(struct ahash_request *req, void *out)
310 + struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req);
311 + struct ccp_sha_exp_ctx state;
312 +
313 ++ /* Don't let anything leak to 'out' */
314 ++ memset(&state, 0, sizeof(state));
315 ++
316 + state.type = rctx->type;
317 + state.msg_bits = rctx->msg_bits;
318 + state.first = rctx->first;
319 +diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
320 +index d871275196f6..91abfbc1a0a5 100644
321 +--- a/drivers/edac/i7core_edac.c
322 ++++ b/drivers/edac/i7core_edac.c
323 +@@ -1878,7 +1878,7 @@ static int i7core_mce_check_error(struct notifier_block *nb, unsigned long val,
324 +
325 + i7_dev = get_i7core_dev(mce->socketid);
326 + if (!i7_dev)
327 +- return NOTIFY_BAD;
328 ++ return NOTIFY_DONE;
329 +
330 + mci = i7_dev->mci;
331 + pvt = mci->pvt_info;
332 +diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
333 +index 3e623ab5e315..424c235407ba 100644
334 +--- a/drivers/edac/sb_edac.c
335 ++++ b/drivers/edac/sb_edac.c
336 +@@ -1840,7 +1840,7 @@ static int sbridge_mce_check_error(struct notifier_block *nb, unsigned long val,
337 +
338 + mci = get_mci_for_node_id(mce->socketid);
339 + if (!mci)
340 +- return NOTIFY_BAD;
341 ++ return NOTIFY_DONE;
342 + pvt = mci->pvt_info;
343 +
344 + /*
345 +diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c
346 +index 4e2f46938bf0..e7566d4931c6 100644
347 +--- a/drivers/firmware/efi/vars.c
348 ++++ b/drivers/firmware/efi/vars.c
349 +@@ -202,29 +202,44 @@ static const struct variable_validate variable_validate[] = {
350 + { NULL_GUID, "", NULL },
351 + };
352 +
353 ++/*
354 ++ * Check if @var_name matches the pattern given in @match_name.
355 ++ *
356 ++ * @var_name: an array of @len non-NUL characters.
357 ++ * @match_name: a NUL-terminated pattern string, optionally ending in "*". A
358 ++ * final "*" character matches any trailing characters @var_name,
359 ++ * including the case when there are none left in @var_name.
360 ++ * @match: on output, the number of non-wildcard characters in @match_name
361 ++ * that @var_name matches, regardless of the return value.
362 ++ * @return: whether @var_name fully matches @match_name.
363 ++ */
364 + static bool
365 + variable_matches(const char *var_name, size_t len, const char *match_name,
366 + int *match)
367 + {
368 + for (*match = 0; ; (*match)++) {
369 + char c = match_name[*match];
370 +- char u = var_name[*match];
371 +
372 +- /* Wildcard in the matching name means we've matched */
373 +- if (c == '*')
374 ++ switch (c) {
375 ++ case '*':
376 ++ /* Wildcard in @match_name means we've matched. */
377 + return true;
378 +
379 +- /* Case sensitive match */
380 +- if (!c && *match == len)
381 +- return true;
382 ++ case '\0':
383 ++ /* @match_name has ended. Has @var_name too? */
384 ++ return (*match == len);
385 +
386 +- if (c != u)
387 ++ default:
388 ++ /*
389 ++ * We've reached a non-wildcard char in @match_name.
390 ++ * Continue only if there's an identical character in
391 ++ * @var_name.
392 ++ */
393 ++ if (*match < len && c == var_name[*match])
394 ++ continue;
395 + return false;
396 +-
397 +- if (!c)
398 +- return true;
399 ++ }
400 + }
401 +- return true;
402 + }
403 +
404 + bool
405 +diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
406 +index 11f401ac6bdc..d2fdee27acec 100644
407 +--- a/drivers/gpu/drm/qxl/qxl_display.c
408 ++++ b/drivers/gpu/drm/qxl/qxl_display.c
409 +@@ -295,10 +295,15 @@ static int qxl_crtc_cursor_set2(struct drm_crtc *crtc,
410 +
411 + qxl_bo_kunmap(user_bo);
412 +
413 ++ qcrtc->cur_x += qcrtc->hot_spot_x - hot_x;
414 ++ qcrtc->cur_y += qcrtc->hot_spot_y - hot_y;
415 ++ qcrtc->hot_spot_x = hot_x;
416 ++ qcrtc->hot_spot_y = hot_y;
417 ++
418 + cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release);
419 + cmd->type = QXL_CURSOR_SET;
420 +- cmd->u.set.position.x = qcrtc->cur_x;
421 +- cmd->u.set.position.y = qcrtc->cur_y;
422 ++ cmd->u.set.position.x = qcrtc->cur_x + qcrtc->hot_spot_x;
423 ++ cmd->u.set.position.y = qcrtc->cur_y + qcrtc->hot_spot_y;
424 +
425 + cmd->u.set.shape = qxl_bo_physical_address(qdev, cursor_bo, 0);
426 +
427 +@@ -361,8 +366,8 @@ static int qxl_crtc_cursor_move(struct drm_crtc *crtc,
428 +
429 + cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release);
430 + cmd->type = QXL_CURSOR_MOVE;
431 +- cmd->u.position.x = qcrtc->cur_x;
432 +- cmd->u.position.y = qcrtc->cur_y;
433 ++ cmd->u.position.x = qcrtc->cur_x + qcrtc->hot_spot_x;
434 ++ cmd->u.position.y = qcrtc->cur_y + qcrtc->hot_spot_y;
435 + qxl_release_unmap(qdev, release, &cmd->release_info);
436 +
437 + qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
438 +diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
439 +index 8aa077ca8244..d5ebf3e33f8e 100644
440 +--- a/drivers/gpu/drm/qxl/qxl_drv.h
441 ++++ b/drivers/gpu/drm/qxl/qxl_drv.h
442 +@@ -139,6 +139,8 @@ struct qxl_crtc {
443 + int index;
444 + int cur_x;
445 + int cur_y;
446 ++ int hot_spot_x;
447 ++ int hot_spot_y;
448 + };
449 +
450 + struct qxl_output {
451 +diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
452 +index 077bb1bdac34..e3b734186375 100644
453 +--- a/drivers/hv/vmbus_drv.c
454 ++++ b/drivers/hv/vmbus_drv.c
455 +@@ -31,6 +31,7 @@
456 + #include <linux/slab.h>
457 + #include <linux/acpi.h>
458 + #include <linux/completion.h>
459 ++#include <linux/cpu.h>
460 + #include <linux/hyperv.h>
461 + #include <linux/kernel_stat.h>
462 + #include <asm/hyperv.h>
463 +@@ -689,6 +690,39 @@ static void vmbus_flow_handler(unsigned int irq, struct irq_desc *desc)
464 + desc->action->handler(irq, desc->action->dev_id);
465 + }
466 +
467 ++#ifdef CONFIG_HOTPLUG_CPU
468 ++static int hyperv_cpu_disable(void)
469 ++{
470 ++ return -ENOSYS;
471 ++}
472 ++
473 ++static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
474 ++{
475 ++ static void *previous_cpu_disable;
476 ++
477 ++ /*
478 ++ * Offlining a CPU when running on newer hypervisors (WS2012R2, Win8,
479 ++ * ...) is not supported at this moment as channel interrupts are
480 ++ * distributed across all of them.
481 ++ */
482 ++
483 ++ if ((vmbus_proto_version == VERSION_WS2008) ||
484 ++ (vmbus_proto_version == VERSION_WIN7))
485 ++ return;
486 ++
487 ++ if (vmbus_loaded) {
488 ++ previous_cpu_disable = smp_ops.cpu_disable;
489 ++ smp_ops.cpu_disable = hyperv_cpu_disable;
490 ++ pr_notice("CPU offlining is not supported by hypervisor\n");
491 ++ } else if (previous_cpu_disable)
492 ++ smp_ops.cpu_disable = previous_cpu_disable;
493 ++}
494 ++#else
495 ++static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
496 ++{
497 ++}
498 ++#endif
499 ++
500 + /*
501 + * vmbus_bus_init -Main vmbus driver initialization routine.
502 + *
503 +@@ -747,6 +781,7 @@ static int vmbus_bus_init(int irq)
504 + if (ret)
505 + goto err_alloc;
506 +
507 ++ hv_cpu_hotplug_quirk(true);
508 + vmbus_request_offers();
509 +
510 + return 0;
511 +@@ -984,6 +1019,7 @@ static void __exit vmbus_exit(void)
512 + bus_unregister(&hv_bus);
513 + hv_cleanup();
514 + acpi_bus_unregister_driver(&vmbus_acpi_driver);
515 ++ hv_cpu_hotplug_quirk(false);
516 + }
517 +
518 +
519 +diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
520 +index f3b89a4698b6..a866fc1a09f4 100644
521 +--- a/drivers/i2c/busses/i2c-cpm.c
522 ++++ b/drivers/i2c/busses/i2c-cpm.c
523 +@@ -120,8 +120,8 @@ struct cpm_i2c {
524 + cbd_t __iomem *rbase;
525 + u_char *txbuf[CPM_MAXBD];
526 + u_char *rxbuf[CPM_MAXBD];
527 +- u32 txdma[CPM_MAXBD];
528 +- u32 rxdma[CPM_MAXBD];
529 ++ dma_addr_t txdma[CPM_MAXBD];
530 ++ dma_addr_t rxdma[CPM_MAXBD];
531 + };
532 +
533 + static irqreturn_t cpm_i2c_interrupt(int irq, void *dev_id)
534 +diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
535 +index 9fd711c03dd2..78dfba3cf442 100644
536 +--- a/drivers/i2c/busses/i2c-exynos5.c
537 ++++ b/drivers/i2c/busses/i2c-exynos5.c
538 +@@ -574,7 +574,9 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap,
539 + return -EIO;
540 + }
541 +
542 +- clk_prepare_enable(i2c->clk);
543 ++ ret = clk_enable(i2c->clk);
544 ++ if (ret)
545 ++ return ret;
546 +
547 + for (i = 0; i < num; i++, msgs++) {
548 + stop = (i == num - 1);
549 +@@ -598,7 +600,7 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap,
550 + }
551 +
552 + out:
553 +- clk_disable_unprepare(i2c->clk);
554 ++ clk_disable(i2c->clk);
555 + return ret;
556 + }
557 +
558 +@@ -652,7 +654,9 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
559 + return -ENOENT;
560 + }
561 +
562 +- clk_prepare_enable(i2c->clk);
563 ++ ret = clk_prepare_enable(i2c->clk);
564 ++ if (ret)
565 ++ return ret;
566 +
567 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
568 + i2c->regs = devm_ioremap_resource(&pdev->dev, mem);
569 +@@ -701,6 +705,10 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
570 +
571 + platform_set_drvdata(pdev, i2c);
572 +
573 ++ clk_disable(i2c->clk);
574 ++
575 ++ return 0;
576 ++
577 + err_clk:
578 + clk_disable_unprepare(i2c->clk);
579 + return ret;
580 +@@ -712,6 +720,8 @@ static int exynos5_i2c_remove(struct platform_device *pdev)
581 +
582 + i2c_del_adapter(&i2c->adap);
583 +
584 ++ clk_unprepare(i2c->clk);
585 ++
586 + return 0;
587 + }
588 +
589 +@@ -722,6 +732,8 @@ static int exynos5_i2c_suspend_noirq(struct device *dev)
590 +
591 + i2c->suspended = 1;
592 +
593 ++ clk_unprepare(i2c->clk);
594 ++
595 + return 0;
596 + }
597 +
598 +@@ -731,7 +743,9 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
599 + struct exynos5_i2c *i2c = platform_get_drvdata(pdev);
600 + int ret = 0;
601 +
602 +- clk_prepare_enable(i2c->clk);
603 ++ ret = clk_prepare_enable(i2c->clk);
604 ++ if (ret)
605 ++ return ret;
606 +
607 + ret = exynos5_hsi2c_clock_setup(i2c);
608 + if (ret) {
609 +@@ -740,7 +754,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
610 + }
611 +
612 + exynos5_i2c_init(i2c);
613 +- clk_disable_unprepare(i2c->clk);
614 ++ clk_disable(i2c->clk);
615 + i2c->suspended = 0;
616 +
617 + return 0;
618 +diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
619 +index caecffe8caff..b12aedcdd89b 100644
620 +--- a/drivers/input/tablet/gtco.c
621 ++++ b/drivers/input/tablet/gtco.c
622 +@@ -868,6 +868,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
623 + goto err_free_buf;
624 + }
625 +
626 ++ /* Sanity check that a device has an endpoint */
627 ++ if (usbinterface->altsetting[0].desc.bNumEndpoints < 1) {
628 ++ dev_err(&usbinterface->dev,
629 ++ "Invalid number of endpoints\n");
630 ++ error = -EINVAL;
631 ++ goto err_free_urb;
632 ++ }
633 ++
634 + /*
635 + * The endpoint is always altsetting 0, we know this since we know
636 + * this device only has one interrupt endpoint
637 +@@ -889,7 +897,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
638 + * HID report descriptor
639 + */
640 + if (usb_get_extra_descriptor(usbinterface->cur_altsetting,
641 +- HID_DEVICE_TYPE, &hid_desc) != 0){
642 ++ HID_DEVICE_TYPE, &hid_desc) != 0) {
643 + dev_err(&usbinterface->dev,
644 + "Can't retrieve exta USB descriptor to get hid report descriptor length\n");
645 + error = -EIO;
646 +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
647 +index 6cb388e8fb7d..958e0e776683 100644
648 +--- a/drivers/misc/Kconfig
649 ++++ b/drivers/misc/Kconfig
650 +@@ -438,7 +438,7 @@ config ARM_CHARLCD
651 + still useful.
652 +
653 + config BMP085
654 +- bool
655 ++ tristate
656 + depends on SYSFS
657 +
658 + config BMP085_I2C
659 +diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
660 +index d3eee113baeb..daae8e58447d 100644
661 +--- a/drivers/misc/ad525x_dpot.c
662 ++++ b/drivers/misc/ad525x_dpot.c
663 +@@ -216,7 +216,7 @@ static s32 dpot_read_i2c(struct dpot_data *dpot, u8 reg)
664 + */
665 + value = swab16(value);
666 +
667 +- if (dpot->uid == DPOT_UID(AD5271_ID))
668 ++ if (dpot->uid == DPOT_UID(AD5274_ID))
669 + value = value >> 2;
670 + return value;
671 + default:
672 +diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
673 +index 2b20e2368fca..b6ecb3f06499 100644
674 +--- a/drivers/net/ethernet/jme.c
675 ++++ b/drivers/net/ethernet/jme.c
676 +@@ -270,11 +270,17 @@ jme_reset_mac_processor(struct jme_adapter *jme)
677 + }
678 +
679 + static inline void
680 +-jme_clear_pm(struct jme_adapter *jme)
681 ++jme_clear_pm_enable_wol(struct jme_adapter *jme)
682 + {
683 + jwrite32(jme, JME_PMCS, PMCS_STMASK | jme->reg_pmcs);
684 + }
685 +
686 ++static inline void
687 ++jme_clear_pm_disable_wol(struct jme_adapter *jme)
688 ++{
689 ++ jwrite32(jme, JME_PMCS, PMCS_STMASK);
690 ++}
691 ++
692 + static int
693 + jme_reload_eeprom(struct jme_adapter *jme)
694 + {
695 +@@ -1857,7 +1863,7 @@ jme_open(struct net_device *netdev)
696 + struct jme_adapter *jme = netdev_priv(netdev);
697 + int rc;
698 +
699 +- jme_clear_pm(jme);
700 ++ jme_clear_pm_disable_wol(jme);
701 + JME_NAPI_ENABLE(jme);
702 +
703 + tasklet_init(&jme->linkch_task, jme_link_change_tasklet,
704 +@@ -1929,11 +1935,11 @@ jme_wait_link(struct jme_adapter *jme)
705 + static void
706 + jme_powersave_phy(struct jme_adapter *jme)
707 + {
708 +- if (jme->reg_pmcs) {
709 ++ if (jme->reg_pmcs && device_may_wakeup(&jme->pdev->dev)) {
710 + jme_set_100m_half(jme);
711 + if (jme->reg_pmcs & (PMCS_LFEN | PMCS_LREN))
712 + jme_wait_link(jme);
713 +- jme_clear_pm(jme);
714 ++ jme_clear_pm_enable_wol(jme);
715 + } else {
716 + jme_phy_off(jme);
717 + }
718 +@@ -2621,9 +2627,6 @@ jme_set_wol(struct net_device *netdev,
719 + if (wol->wolopts & WAKE_MAGIC)
720 + jme->reg_pmcs |= PMCS_MFEN;
721 +
722 +- jwrite32(jme, JME_PMCS, jme->reg_pmcs);
723 +- device_set_wakeup_enable(&jme->pdev->dev, !!(jme->reg_pmcs));
724 +-
725 + return 0;
726 + }
727 +
728 +@@ -3147,8 +3150,8 @@ jme_init_one(struct pci_dev *pdev,
729 + jme->mii_if.mdio_read = jme_mdio_read;
730 + jme->mii_if.mdio_write = jme_mdio_write;
731 +
732 +- jme_clear_pm(jme);
733 +- device_set_wakeup_enable(&pdev->dev, true);
734 ++ jme_clear_pm_disable_wol(jme);
735 ++ device_init_wakeup(&pdev->dev, true);
736 +
737 + jme_set_phyfifo_5level(jme);
738 + jme->pcirev = pdev->revision;
739 +@@ -3279,7 +3282,7 @@ jme_resume(struct device *dev)
740 + if (!netif_running(netdev))
741 + return 0;
742 +
743 +- jme_clear_pm(jme);
744 ++ jme_clear_pm_disable_wol(jme);
745 + jme_phy_on(jme);
746 + if (test_bit(JME_FLAG_SSET, &jme->flags))
747 + jme_set_settings(netdev, &jme->old_ecmd);
748 +diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
749 +index de6459628b4f..fa2dcbcdb921 100644
750 +--- a/drivers/pinctrl/pinctrl-single.c
751 ++++ b/drivers/pinctrl/pinctrl-single.c
752 +@@ -1313,9 +1313,9 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
753 +
754 + /* Parse pins in each row from LSB */
755 + while (mask) {
756 +- bit_pos = ffs(mask);
757 ++ bit_pos = __ffs(mask);
758 + pin_num_from_lsb = bit_pos / pcs->bits_per_pin;
759 +- mask_pos = ((pcs->fmask) << (bit_pos - 1));
760 ++ mask_pos = ((pcs->fmask) << bit_pos);
761 + val_pos = val & mask_pos;
762 + submask = mask & mask_pos;
763 +
764 +@@ -1892,7 +1892,7 @@ static int pcs_probe(struct platform_device *pdev)
765 + ret = of_property_read_u32(np, "pinctrl-single,function-mask",
766 + &pcs->fmask);
767 + if (!ret) {
768 +- pcs->fshift = ffs(pcs->fmask) - 1;
769 ++ pcs->fshift = __ffs(pcs->fmask);
770 + pcs->fmax = pcs->fmask >> pcs->fshift;
771 + } else {
772 + /* If mask property doesn't exist, function mux is invalid. */
773 +diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
774 +index e5f13c4310fe..ea99fffd5556 100644
775 +--- a/drivers/rtc/rtc-hym8563.c
776 ++++ b/drivers/rtc/rtc-hym8563.c
777 +@@ -144,7 +144,7 @@ static int hym8563_rtc_set_time(struct device *dev, struct rtc_time *tm)
778 + * it does not seem to carry it over a subsequent write/read.
779 + * So we'll limit ourself to 100 years, starting at 2000 for now.
780 + */
781 +- buf[6] = tm->tm_year - 100;
782 ++ buf[6] = bin2bcd(tm->tm_year - 100);
783 +
784 + /*
785 + * CTL1 only contains TEST-mode bits apart from stop,
786 +diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
787 +index 88c9c92e89fd..4b0966ed5394 100644
788 +--- a/drivers/rtc/rtc-vr41xx.c
789 ++++ b/drivers/rtc/rtc-vr41xx.c
790 +@@ -272,12 +272,13 @@ static irqreturn_t rtclong1_interrupt(int irq, void *dev_id)
791 + }
792 +
793 + static const struct rtc_class_ops vr41xx_rtc_ops = {
794 +- .release = vr41xx_rtc_release,
795 +- .ioctl = vr41xx_rtc_ioctl,
796 +- .read_time = vr41xx_rtc_read_time,
797 +- .set_time = vr41xx_rtc_set_time,
798 +- .read_alarm = vr41xx_rtc_read_alarm,
799 +- .set_alarm = vr41xx_rtc_set_alarm,
800 ++ .release = vr41xx_rtc_release,
801 ++ .ioctl = vr41xx_rtc_ioctl,
802 ++ .read_time = vr41xx_rtc_read_time,
803 ++ .set_time = vr41xx_rtc_set_time,
804 ++ .read_alarm = vr41xx_rtc_read_alarm,
805 ++ .set_alarm = vr41xx_rtc_set_alarm,
806 ++ .alarm_irq_enable = vr41xx_rtc_alarm_irq_enable,
807 + };
808 +
809 + static int rtc_probe(struct platform_device *pdev)
810 +diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
811 +index 96552e3a1bfb..b2c9359d9cee 100644
812 +--- a/drivers/staging/usbip/usbip_common.c
813 ++++ b/drivers/staging/usbip/usbip_common.c
814 +@@ -785,6 +785,17 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb)
815 + if (!(size > 0))
816 + return 0;
817 +
818 ++ if (size > urb->transfer_buffer_length) {
819 ++ /* should not happen, probably malicious packet */
820 ++ if (ud->side == USBIP_STUB) {
821 ++ usbip_event_add(ud, SDEV_EVENT_ERROR_TCP);
822 ++ return 0;
823 ++ } else {
824 ++ usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
825 ++ return -EPIPE;
826 ++ }
827 ++ }
828 ++
829 + ret = usbip_recv(ud->tcp_socket, urb->transfer_buffer, size);
830 + if (ret != size) {
831 + dev_err(&urb->dev->dev, "recv xbuf, %d\n", ret);
832 +diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
833 +index be33d2b0613b..0eabbac2500d 100644
834 +--- a/drivers/tty/serial/sh-sci.c
835 ++++ b/drivers/tty/serial/sh-sci.c
836 +@@ -38,7 +38,6 @@
837 + #include <linux/major.h>
838 + #include <linux/module.h>
839 + #include <linux/mm.h>
840 +-#include <linux/notifier.h>
841 + #include <linux/of.h>
842 + #include <linux/platform_device.h>
843 + #include <linux/pm_runtime.h>
844 +@@ -118,8 +117,6 @@ struct sci_port {
845 + struct timer_list rx_timer;
846 + unsigned int rx_timeout;
847 + #endif
848 +-
849 +- struct notifier_block freq_transition;
850 + };
851 +
852 + /* Function prototypes */
853 +@@ -1029,30 +1026,6 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
854 + return ret;
855 + }
856 +
857 +-/*
858 +- * Here we define a transition notifier so that we can update all of our
859 +- * ports' baud rate when the peripheral clock changes.
860 +- */
861 +-static int sci_notifier(struct notifier_block *self,
862 +- unsigned long phase, void *p)
863 +-{
864 +- struct sci_port *sci_port;
865 +- unsigned long flags;
866 +-
867 +- sci_port = container_of(self, struct sci_port, freq_transition);
868 +-
869 +- if ((phase == CPUFREQ_POSTCHANGE) ||
870 +- (phase == CPUFREQ_RESUMECHANGE)) {
871 +- struct uart_port *port = &sci_port->port;
872 +-
873 +- spin_lock_irqsave(&port->lock, flags);
874 +- port->uartclk = clk_get_rate(sci_port->iclk);
875 +- spin_unlock_irqrestore(&port->lock, flags);
876 +- }
877 +-
878 +- return NOTIFY_OK;
879 +-}
880 +-
881 + static struct sci_irq_desc {
882 + const char *desc;
883 + irq_handler_t handler;
884 +@@ -2406,9 +2379,6 @@ static int sci_remove(struct platform_device *dev)
885 + {
886 + struct sci_port *port = platform_get_drvdata(dev);
887 +
888 +- cpufreq_unregister_notifier(&port->freq_transition,
889 +- CPUFREQ_TRANSITION_NOTIFIER);
890 +-
891 + uart_remove_one_port(&sci_uart_driver, &port->port);
892 +
893 + sci_cleanup_single(port);
894 +@@ -2559,15 +2529,6 @@ static int sci_probe(struct platform_device *dev)
895 + if (ret)
896 + return ret;
897 +
898 +- sp->freq_transition.notifier_call = sci_notifier;
899 +-
900 +- ret = cpufreq_register_notifier(&sp->freq_transition,
901 +- CPUFREQ_TRANSITION_NOTIFIER);
902 +- if (unlikely(ret < 0)) {
903 +- sci_cleanup_single(sp);
904 +- return ret;
905 +- }
906 +-
907 + #ifdef CONFIG_SH_STANDARD_BIOS
908 + sh_bios_gdb_detach();
909 + #endif
910 +diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
911 +index 1f02e65fe305..ccdcc7063eee 100644
912 +--- a/drivers/usb/core/hcd-pci.c
913 ++++ b/drivers/usb/core/hcd-pci.c
914 +@@ -74,6 +74,15 @@ static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd,
915 + if (companion->bus != pdev->bus ||
916 + PCI_SLOT(companion->devfn) != slot)
917 + continue;
918 ++
919 ++ /*
920 ++ * Companion device should be either UHCI,OHCI or EHCI host
921 ++ * controller, otherwise skip.
922 ++ */
923 ++ if (companion->class != CL_UHCI && companion->class != CL_OHCI &&
924 ++ companion->class != CL_EHCI)
925 ++ continue;
926 ++
927 + companion_hcd = pci_get_drvdata(companion);
928 + if (!companion_hcd || !companion_hcd->self.root_hub)
929 + continue;
930 +diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
931 +index 86bfaf904ab5..b39d217310fe 100644
932 +--- a/drivers/usb/host/xhci-mem.c
933 ++++ b/drivers/usb/host/xhci-mem.c
934 +@@ -1785,6 +1785,12 @@ no_bw:
935 + kfree(xhci->rh_bw);
936 + kfree(xhci->ext_caps);
937 +
938 ++ xhci->usb2_ports = NULL;
939 ++ xhci->usb3_ports = NULL;
940 ++ xhci->port_array = NULL;
941 ++ xhci->rh_bw = NULL;
942 ++ xhci->ext_caps = NULL;
943 ++
944 + xhci->page_size = 0;
945 + xhci->page_shift = 0;
946 + xhci->bus_state[0].bus_suspended = 0;
947 +diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
948 +index a1d74dd11988..d06600a594c3 100644
949 +--- a/drivers/video/da8xx-fb.c
950 ++++ b/drivers/video/da8xx-fb.c
951 +@@ -209,8 +209,7 @@ static struct fb_videomode known_lcd_panels[] = {
952 + .lower_margin = 2,
953 + .hsync_len = 0,
954 + .vsync_len = 0,
955 +- .sync = FB_SYNC_CLK_INVERT |
956 +- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
957 ++ .sync = FB_SYNC_CLK_INVERT,
958 + },
959 + /* Sharp LK043T1DG01 */
960 + [1] = {
961 +@@ -224,7 +223,7 @@ static struct fb_videomode known_lcd_panels[] = {
962 + .lower_margin = 2,
963 + .hsync_len = 41,
964 + .vsync_len = 10,
965 +- .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
966 ++ .sync = 0,
967 + .flag = 0,
968 + },
969 + [2] = {
970 +@@ -239,7 +238,7 @@ static struct fb_videomode known_lcd_panels[] = {
971 + .lower_margin = 10,
972 + .hsync_len = 10,
973 + .vsync_len = 10,
974 +- .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
975 ++ .sync = 0,
976 + .flag = 0,
977 + },
978 + };
979 +diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
980 +index f9c63ae7276a..58001fcff037 100644
981 +--- a/fs/ext4/inode.c
982 ++++ b/fs/ext4/inode.c
983 +@@ -4972,6 +4972,8 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
984 + might_sleep();
985 + trace_ext4_mark_inode_dirty(inode, _RET_IP_);
986 + err = ext4_reserve_inode_write(handle, inode, &iloc);
987 ++ if (err)
988 ++ return err;
989 + if (ext4_handle_valid(handle) &&
990 + EXT4_I(inode)->i_extra_isize < sbi->s_want_extra_isize &&
991 + !ext4_test_inode_state(inode, EXT4_STATE_NO_EXPAND)) {
992 +@@ -5002,9 +5004,7 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
993 + }
994 + }
995 + }
996 +- if (!err)
997 +- err = ext4_mark_iloc_dirty(handle, inode, &iloc);
998 +- return err;
999 ++ return ext4_mark_iloc_dirty(handle, inode, &iloc);
1000 + }
1001 +
1002 + /*
1003 +diff --git a/include/linux/poison.h b/include/linux/poison.h
1004 +index 2110a81c5e2a..253c9b4198ef 100644
1005 +--- a/include/linux/poison.h
1006 ++++ b/include/linux/poison.h
1007 +@@ -19,8 +19,8 @@
1008 + * under normal circumstances, used to verify that nobody uses
1009 + * non-initialized list entries.
1010 + */
1011 +-#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA)
1012 +-#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA)
1013 ++#define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA)
1014 ++#define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA)
1015 +
1016 + /********** include/linux/timer.h **********/
1017 + /*
1018 +diff --git a/kernel/futex.c b/kernel/futex.c
1019 +index b125c385a257..9fd1a30ab5bb 100644
1020 +--- a/kernel/futex.c
1021 ++++ b/kernel/futex.c
1022 +@@ -1378,8 +1378,8 @@ void requeue_futex(struct futex_q *q, struct futex_hash_bucket *hb1,
1023 + if (likely(&hb1->chain != &hb2->chain)) {
1024 + plist_del(&q->list, &hb1->chain);
1025 + hb_waiters_dec(hb1);
1026 +- plist_add(&q->list, &hb2->chain);
1027 + hb_waiters_inc(hb2);
1028 ++ plist_add(&q->list, &hb2->chain);
1029 + q->lock_ptr = &hb2->lock;
1030 + }
1031 + get_futex_key_refs(key2);
1032 +diff --git a/kernel/workqueue.c b/kernel/workqueue.c
1033 +index 423c9e37a9e7..0f73a448b162 100644
1034 +--- a/kernel/workqueue.c
1035 ++++ b/kernel/workqueue.c
1036 +@@ -629,6 +629,35 @@ static void set_work_pool_and_clear_pending(struct work_struct *work,
1037 + */
1038 + smp_wmb();
1039 + set_work_data(work, (unsigned long)pool_id << WORK_OFFQ_POOL_SHIFT, 0);
1040 ++ /*
1041 ++ * The following mb guarantees that previous clear of a PENDING bit
1042 ++ * will not be reordered with any speculative LOADS or STORES from
1043 ++ * work->current_func, which is executed afterwards. This possible
1044 ++ * reordering can lead to a missed execution on attempt to qeueue
1045 ++ * the same @work. E.g. consider this case:
1046 ++ *
1047 ++ * CPU#0 CPU#1
1048 ++ * ---------------------------- --------------------------------
1049 ++ *
1050 ++ * 1 STORE event_indicated
1051 ++ * 2 queue_work_on() {
1052 ++ * 3 test_and_set_bit(PENDING)
1053 ++ * 4 } set_..._and_clear_pending() {
1054 ++ * 5 set_work_data() # clear bit
1055 ++ * 6 smp_mb()
1056 ++ * 7 work->current_func() {
1057 ++ * 8 LOAD event_indicated
1058 ++ * }
1059 ++ *
1060 ++ * Without an explicit full barrier speculative LOAD on line 8 can
1061 ++ * be executed before CPU#0 does STORE on line 1. If that happens,
1062 ++ * CPU#0 observes the PENDING bit is still set and new execution of
1063 ++ * a @work is not queued in a hope, that CPU#1 will eventually
1064 ++ * finish the queued @work. Meanwhile CPU#1 does not see
1065 ++ * event_indicated is set, because speculative LOAD was executed
1066 ++ * before actual STORE.
1067 ++ */
1068 ++ smp_mb();
1069 + }
1070 +
1071 + static void clear_work_data(struct work_struct *work)
1072 +diff --git a/lib/assoc_array.c b/lib/assoc_array.c
1073 +index 2404d03e251a..03a77f4740c1 100644
1074 +--- a/lib/assoc_array.c
1075 ++++ b/lib/assoc_array.c
1076 +@@ -523,7 +523,9 @@ static bool assoc_array_insert_into_terminal_node(struct assoc_array_edit *edit,
1077 + free_slot = i;
1078 + continue;
1079 + }
1080 +- if (ops->compare_object(assoc_array_ptr_to_leaf(ptr), index_key)) {
1081 ++ if (assoc_array_ptr_is_leaf(ptr) &&
1082 ++ ops->compare_object(assoc_array_ptr_to_leaf(ptr),
1083 ++ index_key)) {
1084 + pr_devel("replace in slot %d\n", i);
1085 + edit->leaf_p = &node->slots[i];
1086 + edit->dead_leaf = node->slots[i];
1087 +diff --git a/lib/lz4/lz4defs.h b/lib/lz4/lz4defs.h
1088 +index abcecdc2d0f2..0710a62ad2f6 100644
1089 +--- a/lib/lz4/lz4defs.h
1090 ++++ b/lib/lz4/lz4defs.h
1091 +@@ -11,8 +11,7 @@
1092 + /*
1093 + * Detects 64 bits mode
1094 + */
1095 +-#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) \
1096 +- || defined(__ppc64__) || defined(__LP64__))
1097 ++#if defined(CONFIG_64BIT)
1098 + #define LZ4_ARCH64 1
1099 + #else
1100 + #define LZ4_ARCH64 0
1101 +@@ -35,6 +34,10 @@ typedef struct _U64_S { u64 v; } U64_S;
1102 +
1103 + #define PUT4(s, d) (A32(d) = A32(s))
1104 + #define PUT8(s, d) (A64(d) = A64(s))
1105 ++
1106 ++#define LZ4_READ_LITTLEENDIAN_16(d, s, p) \
1107 ++ (d = s - A16(p))
1108 ++
1109 + #define LZ4_WRITE_LITTLEENDIAN_16(p, v) \
1110 + do { \
1111 + A16(p) = v; \
1112 +@@ -51,10 +54,13 @@ typedef struct _U64_S { u64 v; } U64_S;
1113 + #define PUT8(s, d) \
1114 + put_unaligned(get_unaligned((const u64 *) s), (u64 *) d)
1115 +
1116 +-#define LZ4_WRITE_LITTLEENDIAN_16(p, v) \
1117 +- do { \
1118 +- put_unaligned(v, (u16 *)(p)); \
1119 +- p += 2; \
1120 ++#define LZ4_READ_LITTLEENDIAN_16(d, s, p) \
1121 ++ (d = s - get_unaligned_le16(p))
1122 ++
1123 ++#define LZ4_WRITE_LITTLEENDIAN_16(p, v) \
1124 ++ do { \
1125 ++ put_unaligned_le16(v, (u16 *)(p)); \
1126 ++ p += 2; \
1127 + } while (0)
1128 + #endif
1129 +
1130 +@@ -140,9 +146,6 @@ typedef struct _U64_S { u64 v; } U64_S;
1131 +
1132 + #endif
1133 +
1134 +-#define LZ4_READ_LITTLEENDIAN_16(d, s, p) \
1135 +- (d = s - get_unaligned_le16(p))
1136 +-
1137 + #define LZ4_WILDCOPY(s, d, e) \
1138 + do { \
1139 + LZ4_COPYPACKET(s, d); \
1140 +diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
1141 +index 07edbcd8697e..311daab4161d 100644
1142 +--- a/net/sunrpc/cache.c
1143 ++++ b/net/sunrpc/cache.c
1144 +@@ -1187,14 +1187,14 @@ int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h)
1145 + }
1146 +
1147 + crq->q.reader = 0;
1148 +- crq->item = cache_get(h);
1149 + crq->buf = buf;
1150 + crq->len = 0;
1151 + crq->readers = 0;
1152 + spin_lock(&queue_lock);
1153 +- if (test_bit(CACHE_PENDING, &h->flags))
1154 ++ if (test_bit(CACHE_PENDING, &h->flags)) {
1155 ++ crq->item = cache_get(h);
1156 + list_add_tail(&crq->q.list, &detail->queue);
1157 +- else
1158 ++ } else
1159 + /* Lost a race, no longer PENDING, so don't enqueue */
1160 + ret = -EAGAIN;
1161 + spin_unlock(&queue_lock);
1162 +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
1163 +index c260243dbe07..7bf5f463566b 100644
1164 +--- a/net/wireless/nl80211.c
1165 ++++ b/net/wireless/nl80211.c
1166 +@@ -11522,7 +11522,7 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
1167 + struct wireless_dev *wdev;
1168 + struct cfg80211_beacon_registration *reg, *tmp;
1169 +
1170 +- if (state != NETLINK_URELEASE)
1171 ++ if (state != NETLINK_URELEASE || notify->protocol != NETLINK_GENERIC)
1172 + return NOTIFY_DONE;
1173 +
1174 + rcu_read_lock();
1175 +diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
1176 +index 5cb515b08a32..a14ae58377f5 100644
1177 +--- a/sound/soc/codecs/rt5640.c
1178 ++++ b/sound/soc/codecs/rt5640.c
1179 +@@ -359,7 +359,7 @@ static unsigned int bst_tlv[] = {
1180 +
1181 + /* Interface data select */
1182 + static const char * const rt5640_data_select[] = {
1183 +- "Normal", "left copy to right", "right copy to left", "Swap"};
1184 ++ "Normal", "Swap", "left copy to right", "right copy to left"};
1185 +
1186 + static const SOC_ENUM_SINGLE_DECL(rt5640_if1_dac_enum, RT5640_DIG_INF_DATA,
1187 + RT5640_IF1_DAC_SEL_SFT, rt5640_data_select);
1188 +diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h
1189 +index 5e8df25a13f3..02e3fe767df6 100644
1190 +--- a/sound/soc/codecs/rt5640.h
1191 ++++ b/sound/soc/codecs/rt5640.h
1192 +@@ -435,39 +435,39 @@
1193 + #define RT5640_IF1_DAC_SEL_MASK (0x3 << 14)
1194 + #define RT5640_IF1_DAC_SEL_SFT 14
1195 + #define RT5640_IF1_DAC_SEL_NOR (0x0 << 14)
1196 +-#define RT5640_IF1_DAC_SEL_L2R (0x1 << 14)
1197 +-#define RT5640_IF1_DAC_SEL_R2L (0x2 << 14)
1198 +-#define RT5640_IF1_DAC_SEL_SWAP (0x3 << 14)
1199 ++#define RT5640_IF1_DAC_SEL_SWAP (0x1 << 14)
1200 ++#define RT5640_IF1_DAC_SEL_L2R (0x2 << 14)
1201 ++#define RT5640_IF1_DAC_SEL_R2L (0x3 << 14)
1202 + #define RT5640_IF1_ADC_SEL_MASK (0x3 << 12)
1203 + #define RT5640_IF1_ADC_SEL_SFT 12
1204 + #define RT5640_IF1_ADC_SEL_NOR (0x0 << 12)
1205 +-#define RT5640_IF1_ADC_SEL_L2R (0x1 << 12)
1206 +-#define RT5640_IF1_ADC_SEL_R2L (0x2 << 12)
1207 +-#define RT5640_IF1_ADC_SEL_SWAP (0x3 << 12)
1208 ++#define RT5640_IF1_ADC_SEL_SWAP (0x1 << 12)
1209 ++#define RT5640_IF1_ADC_SEL_L2R (0x2 << 12)
1210 ++#define RT5640_IF1_ADC_SEL_R2L (0x3 << 12)
1211 + #define RT5640_IF2_DAC_SEL_MASK (0x3 << 10)
1212 + #define RT5640_IF2_DAC_SEL_SFT 10
1213 + #define RT5640_IF2_DAC_SEL_NOR (0x0 << 10)
1214 +-#define RT5640_IF2_DAC_SEL_L2R (0x1 << 10)
1215 +-#define RT5640_IF2_DAC_SEL_R2L (0x2 << 10)
1216 +-#define RT5640_IF2_DAC_SEL_SWAP (0x3 << 10)
1217 ++#define RT5640_IF2_DAC_SEL_SWAP (0x1 << 10)
1218 ++#define RT5640_IF2_DAC_SEL_L2R (0x2 << 10)
1219 ++#define RT5640_IF2_DAC_SEL_R2L (0x3 << 10)
1220 + #define RT5640_IF2_ADC_SEL_MASK (0x3 << 8)
1221 + #define RT5640_IF2_ADC_SEL_SFT 8
1222 + #define RT5640_IF2_ADC_SEL_NOR (0x0 << 8)
1223 +-#define RT5640_IF2_ADC_SEL_L2R (0x1 << 8)
1224 +-#define RT5640_IF2_ADC_SEL_R2L (0x2 << 8)
1225 +-#define RT5640_IF2_ADC_SEL_SWAP (0x3 << 8)
1226 ++#define RT5640_IF2_ADC_SEL_SWAP (0x1 << 8)
1227 ++#define RT5640_IF2_ADC_SEL_L2R (0x2 << 8)
1228 ++#define RT5640_IF2_ADC_SEL_R2L (0x3 << 8)
1229 + #define RT5640_IF3_DAC_SEL_MASK (0x3 << 6)
1230 + #define RT5640_IF3_DAC_SEL_SFT 6
1231 + #define RT5640_IF3_DAC_SEL_NOR (0x0 << 6)
1232 +-#define RT5640_IF3_DAC_SEL_L2R (0x1 << 6)
1233 +-#define RT5640_IF3_DAC_SEL_R2L (0x2 << 6)
1234 +-#define RT5640_IF3_DAC_SEL_SWAP (0x3 << 6)
1235 ++#define RT5640_IF3_DAC_SEL_SWAP (0x1 << 6)
1236 ++#define RT5640_IF3_DAC_SEL_L2R (0x2 << 6)
1237 ++#define RT5640_IF3_DAC_SEL_R2L (0x3 << 6)
1238 + #define RT5640_IF3_ADC_SEL_MASK (0x3 << 4)
1239 + #define RT5640_IF3_ADC_SEL_SFT 4
1240 + #define RT5640_IF3_ADC_SEL_NOR (0x0 << 4)
1241 +-#define RT5640_IF3_ADC_SEL_L2R (0x1 << 4)
1242 +-#define RT5640_IF3_ADC_SEL_R2L (0x2 << 4)
1243 +-#define RT5640_IF3_ADC_SEL_SWAP (0x3 << 4)
1244 ++#define RT5640_IF3_ADC_SEL_SWAP (0x1 << 4)
1245 ++#define RT5640_IF3_ADC_SEL_L2R (0x2 << 4)
1246 ++#define RT5640_IF3_ADC_SEL_R2L (0x3 << 4)
1247 +
1248 + /* REC Left Mixer Control 1 (0x3b) */
1249 + #define RT5640_G_HP_L_RM_L_MASK (0x7 << 13)
1250 +diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c
1251 +index 79e7efb9283c..e0d6936d17ea 100644
1252 +--- a/sound/soc/samsung/s3c-i2s-v2.c
1253 ++++ b/sound/soc/samsung/s3c-i2s-v2.c
1254 +@@ -726,7 +726,7 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
1255 + #endif
1256 +
1257 + int s3c_i2sv2_register_component(struct device *dev, int id,
1258 +- struct snd_soc_component_driver *cmp_drv,
1259 ++ const struct snd_soc_component_driver *cmp_drv,
1260 + struct snd_soc_dai_driver *dai_drv)
1261 + {
1262 + struct snd_soc_dai_ops *ops = dai_drv->ops;
1263 +diff --git a/sound/soc/samsung/s3c-i2s-v2.h b/sound/soc/samsung/s3c-i2s-v2.h
1264 +index 90abab364b49..d0684145ed1f 100644
1265 +--- a/sound/soc/samsung/s3c-i2s-v2.h
1266 ++++ b/sound/soc/samsung/s3c-i2s-v2.h
1267 +@@ -101,7 +101,7 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,
1268 + * soc core.
1269 + */
1270 + extern int s3c_i2sv2_register_component(struct device *dev, int id,
1271 +- struct snd_soc_component_driver *cmp_drv,
1272 ++ const struct snd_soc_component_driver *cmp_drv,
1273 + struct snd_soc_dai_driver *dai_drv);
1274 +
1275 + #endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */
1276 +diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
1277 +index 29ee857c09c6..6f9fbb44cd19 100644
1278 +--- a/tools/perf/Documentation/perf-stat.txt
1279 ++++ b/tools/perf/Documentation/perf-stat.txt
1280 +@@ -50,6 +50,14 @@ OPTIONS
1281 + --scale::
1282 + scale/normalize counter values
1283 +
1284 ++-d::
1285 ++--detailed::
1286 ++ print more detailed statistics, can be specified up to 3 times
1287 ++
1288 ++ -d: detailed events, L1 and LLC data cache
1289 ++ -d -d: more detailed events, dTLB and iTLB events
1290 ++ -d -d -d: very detailed events, adding prefetch events
1291 ++
1292 + -r::
1293 + --repeat=<n>::
1294 + repeat command and print average + stddev (max: 100). 0 means forever.