Magellan Linux

Contents of /trunk/kernel-magellan/patches-3.15/0107-3.15.8-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2488 - (show annotations) (download)
Thu Aug 7 08:28:06 2014 UTC (9 years, 8 months ago) by niro
File size: 32685 byte(s)
-linux-3.15.8
1 diff --git a/Makefile b/Makefile
2 index 833f67f3f80f..d5d9a22a404a 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,8 +1,8 @@
6 VERSION = 3
7 PATCHLEVEL = 15
8 -SUBLEVEL = 7
9 +SUBLEVEL = 8
10 EXTRAVERSION =
11 -NAME = Shuffling Zombie Juror
12 +NAME = Double Funky Skunk
13
14 # *DOCUMENTATION*
15 # To see a list of typical targets execute "make help"
16 @@ -669,6 +669,8 @@ KBUILD_CFLAGS += -fomit-frame-pointer
17 endif
18 endif
19
20 +KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments)
21 +
22 ifdef CONFIG_DEBUG_INFO
23 KBUILD_CFLAGS += -g
24 KBUILD_AFLAGS += -Wa,--gdwarf-2
25 diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
26 index a2fa297196bc..f5645d6a89f2 100644
27 --- a/arch/parisc/include/uapi/asm/signal.h
28 +++ b/arch/parisc/include/uapi/asm/signal.h
29 @@ -69,8 +69,6 @@
30 #define SA_NOMASK SA_NODEFER
31 #define SA_ONESHOT SA_RESETHAND
32
33 -#define SA_RESTORER 0x04000000 /* obsolete -- ignored */
34 -
35 #define MINSIGSTKSZ 2048
36 #define SIGSTKSZ 8192
37
38 diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
39 index 022b38e6a80b..2d0b4d68a40a 100644
40 --- a/arch/powerpc/platforms/pseries/dlpar.c
41 +++ b/arch/powerpc/platforms/pseries/dlpar.c
42 @@ -86,6 +86,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
43 }
44
45 of_node_set_flag(dn, OF_DYNAMIC);
46 + of_node_init(dn);
47
48 return dn;
49 }
50 diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
51 index 0435bb65d0aa..1c0a60d98867 100644
52 --- a/arch/powerpc/platforms/pseries/reconfig.c
53 +++ b/arch/powerpc/platforms/pseries/reconfig.c
54 @@ -69,6 +69,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
55
56 np->properties = proplist;
57 of_node_set_flag(np, OF_DYNAMIC);
58 + of_node_init(np);
59
60 np->parent = derive_parent(path);
61 if (IS_ERR(np->parent)) {
62 diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
63 index 1c82619eb4f7..8c390e7a525a 100644
64 --- a/arch/s390/kernel/ptrace.c
65 +++ b/arch/s390/kernel/ptrace.c
66 @@ -334,9 +334,14 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
67 unsigned long mask = PSW_MASK_USER;
68
69 mask |= is_ri_task(child) ? PSW_MASK_RI : 0;
70 - if ((data & ~mask) != PSW_USER_BITS)
71 + if ((data ^ PSW_USER_BITS) & ~mask)
72 + /* Invalid psw mask. */
73 + return -EINVAL;
74 + if ((data & PSW_MASK_ASC) == PSW_ASC_HOME)
75 + /* Invalid address-space-control bits */
76 return -EINVAL;
77 if ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA))
78 + /* Invalid addressing mode bits */
79 return -EINVAL;
80 }
81 *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;
82 @@ -672,9 +677,12 @@ static int __poke_user_compat(struct task_struct *child,
83
84 mask |= is_ri_task(child) ? PSW32_MASK_RI : 0;
85 /* Build a 64 bit psw mask from 31 bit mask. */
86 - if ((tmp & ~mask) != PSW32_USER_BITS)
87 + if ((tmp ^ PSW32_USER_BITS) & ~mask)
88 /* Invalid psw mask. */
89 return -EINVAL;
90 + if ((data & PSW32_MASK_ASC) == PSW32_ASC_HOME)
91 + /* Invalid address-space-control bits */
92 + return -EINVAL;
93 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
94 (regs->psw.mask & PSW_MASK_BA) |
95 (__u64)(tmp & mask) << 32;
96 diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
97 index 6491353cc9aa..c87810b1b557 100644
98 --- a/arch/x86/kernel/entry_32.S
99 +++ b/arch/x86/kernel/entry_32.S
100 @@ -433,8 +433,8 @@ sysenter_do_call:
101 cmpl $(NR_syscalls), %eax
102 jae sysenter_badsys
103 call *sys_call_table(,%eax,4)
104 - movl %eax,PT_EAX(%esp)
105 sysenter_after_call:
106 + movl %eax,PT_EAX(%esp)
107 LOCKDEP_SYS_EXIT
108 DISABLE_INTERRUPTS(CLBR_ANY)
109 TRACE_IRQS_OFF
110 @@ -514,6 +514,7 @@ ENTRY(system_call)
111 jae syscall_badsys
112 syscall_call:
113 call *sys_call_table(,%eax,4)
114 +syscall_after_call:
115 movl %eax,PT_EAX(%esp) # store the return value
116 syscall_exit:
117 LOCKDEP_SYS_EXIT
118 @@ -683,12 +684,12 @@ syscall_fault:
119 END(syscall_fault)
120
121 syscall_badsys:
122 - movl $-ENOSYS,PT_EAX(%esp)
123 - jmp syscall_exit
124 + movl $-ENOSYS,%eax
125 + jmp syscall_after_call
126 END(syscall_badsys)
127
128 sysenter_badsys:
129 - movl $-ENOSYS,PT_EAX(%esp)
130 + movl $-ENOSYS,%eax
131 jmp sysenter_after_call
132 END(syscall_badsys)
133 CFI_ENDPROC
134 diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
135 index 4224256bb215..77ed20209ca5 100644
136 --- a/arch/xtensa/mm/init.c
137 +++ b/arch/xtensa/mm/init.c
138 @@ -191,7 +191,7 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist)
139 return -EINVAL;
140 }
141
142 - if (it && start - it->start < bank_sz) {
143 + if (it && start - it->start <= bank_sz) {
144 if (start == it->start) {
145 if (end - it->start < bank_sz) {
146 it->start = end;
147 diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
148 index 95ee425bf7c6..f1e380368372 100644
149 --- a/block/blk-cgroup.c
150 +++ b/block/blk-cgroup.c
151 @@ -872,6 +872,13 @@ void blkcg_drain_queue(struct request_queue *q)
152 {
153 lockdep_assert_held(q->queue_lock);
154
155 + /*
156 + * @q could be exiting and already have destroyed all blkgs as
157 + * indicated by NULL root_blkg. If so, don't confuse policies.
158 + */
159 + if (!q->root_blkg)
160 + return;
161 +
162 blk_throtl_drain(q);
163 }
164
165 diff --git a/block/blk-tag.c b/block/blk-tag.c
166 index 3f33d8672268..a185b86741e5 100644
167 --- a/block/blk-tag.c
168 +++ b/block/blk-tag.c
169 @@ -27,18 +27,15 @@ struct request *blk_queue_find_tag(struct request_queue *q, int tag)
170 EXPORT_SYMBOL(blk_queue_find_tag);
171
172 /**
173 - * __blk_free_tags - release a given set of tag maintenance info
174 + * blk_free_tags - release a given set of tag maintenance info
175 * @bqt: the tag map to free
176 *
177 - * Tries to free the specified @bqt. Returns true if it was
178 - * actually freed and false if there are still references using it
179 + * Drop the reference count on @bqt and frees it when the last reference
180 + * is dropped.
181 */
182 -static int __blk_free_tags(struct blk_queue_tag *bqt)
183 +void blk_free_tags(struct blk_queue_tag *bqt)
184 {
185 - int retval;
186 -
187 - retval = atomic_dec_and_test(&bqt->refcnt);
188 - if (retval) {
189 + if (atomic_dec_and_test(&bqt->refcnt)) {
190 BUG_ON(find_first_bit(bqt->tag_map, bqt->max_depth) <
191 bqt->max_depth);
192
193 @@ -50,9 +47,8 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)
194
195 kfree(bqt);
196 }
197 -
198 - return retval;
199 }
200 +EXPORT_SYMBOL(blk_free_tags);
201
202 /**
203 * __blk_queue_free_tags - release tag maintenance info
204 @@ -69,28 +65,13 @@ void __blk_queue_free_tags(struct request_queue *q)
205 if (!bqt)
206 return;
207
208 - __blk_free_tags(bqt);
209 + blk_free_tags(bqt);
210
211 q->queue_tags = NULL;
212 queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
213 }
214
215 /**
216 - * blk_free_tags - release a given set of tag maintenance info
217 - * @bqt: the tag map to free
218 - *
219 - * For externally managed @bqt frees the map. Callers of this
220 - * function must guarantee to have released all the queues that
221 - * might have been using this tag map.
222 - */
223 -void blk_free_tags(struct blk_queue_tag *bqt)
224 -{
225 - if (unlikely(!__blk_free_tags(bqt)))
226 - BUG();
227 -}
228 -EXPORT_SYMBOL(blk_free_tags);
229 -
230 -/**
231 * blk_queue_free_tags - release tag maintenance info
232 * @q: the request queue for the device
233 *
234 diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
235 index fbd5a67cb773..a0926a6094b2 100644
236 --- a/block/compat_ioctl.c
237 +++ b/block/compat_ioctl.c
238 @@ -690,6 +690,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
239 case BLKROSET:
240 case BLKDISCARD:
241 case BLKSECDISCARD:
242 + case BLKZEROOUT:
243 /*
244 * the ones below are implemented in blkdev_locked_ioctl,
245 * but we call blkdev_ioctl, which gets the lock for us
246 diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
247 index dae5607e1115..4cd52a4541a9 100644
248 --- a/drivers/ata/ahci.c
249 +++ b/drivers/ata/ahci.c
250 @@ -456,6 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
251
252 /* Promise */
253 { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
254 + { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */
255
256 /* Asmedia */
257 { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */
258 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
259 index 18d97d5c7d90..677c0c1b03bd 100644
260 --- a/drivers/ata/libata-core.c
261 +++ b/drivers/ata/libata-core.c
262 @@ -4787,6 +4787,10 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)
263 * ata_qc_new - Request an available ATA command, for queueing
264 * @ap: target port
265 *
266 + * Some ATA host controllers may implement a queue depth which is less
267 + * than ATA_MAX_QUEUE. So we shouldn't allocate a tag which is beyond
268 + * the hardware limitation.
269 + *
270 * LOCKING:
271 * None.
272 */
273 @@ -4794,14 +4798,15 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)
274 static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
275 {
276 struct ata_queued_cmd *qc = NULL;
277 + unsigned int max_queue = ap->host->n_tags;
278 unsigned int i, tag;
279
280 /* no command while frozen */
281 if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
282 return NULL;
283
284 - for (i = 0; i < ATA_MAX_QUEUE; i++) {
285 - tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE;
286 + for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) {
287 + tag = tag < max_queue ? tag : 0;
288
289 /* the last tag is reserved for internal command. */
290 if (tag == ATA_TAG_INTERNAL)
291 @@ -6088,6 +6093,7 @@ void ata_host_init(struct ata_host *host, struct device *dev,
292 {
293 spin_lock_init(&host->lock);
294 mutex_init(&host->eh_mutex);
295 + host->n_tags = ATA_MAX_QUEUE - 1;
296 host->dev = dev;
297 host->ops = ops;
298 }
299 @@ -6169,6 +6175,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
300 {
301 int i, rc;
302
303 + host->n_tags = clamp(sht->can_queue, 1, ATA_MAX_QUEUE - 1);
304 +
305 /* host must have been started */
306 if (!(host->flags & ATA_HOST_STARTED)) {
307 dev_err(host->dev, "BUG: trying to register unstarted host\n");
308 diff --git a/drivers/base/platform.c b/drivers/base/platform.c
309 index 5b47210889e0..cd2a7d0a56b2 100644
310 --- a/drivers/base/platform.c
311 +++ b/drivers/base/platform.c
312 @@ -89,8 +89,13 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
313 return dev->archdata.irqs[num];
314 #else
315 struct resource *r;
316 - if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node)
317 - return of_irq_get(dev->dev.of_node, num);
318 + if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
319 + int ret;
320 +
321 + ret = of_irq_get(dev->dev.of_node, num);
322 + if (ret >= 0 || ret == -EPROBE_DEFER)
323 + return ret;
324 + }
325
326 r = platform_get_resource(dev, IORESOURCE_IRQ, num);
327
328 diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
329 index 089e72cd37be..36e54be402df 100644
330 --- a/drivers/block/zram/zram_drv.c
331 +++ b/drivers/block/zram/zram_drv.c
332 @@ -622,11 +622,18 @@ static void zram_reset_device(struct zram *zram, bool reset_capacity)
333 memset(&zram->stats, 0, sizeof(zram->stats));
334
335 zram->disksize = 0;
336 - if (reset_capacity) {
337 + if (reset_capacity)
338 set_capacity(zram->disk, 0);
339 - revalidate_disk(zram->disk);
340 - }
341 +
342 up_write(&zram->init_lock);
343 +
344 + /*
345 + * Revalidate disk out of the init_lock to avoid lockdep splat.
346 + * It's okay because disk's capacity is protected by init_lock
347 + * so that revalidate_disk always sees up-to-date capacity.
348 + */
349 + if (reset_capacity)
350 + revalidate_disk(zram->disk);
351 }
352
353 static ssize_t disksize_store(struct device *dev,
354 @@ -666,8 +673,15 @@ static ssize_t disksize_store(struct device *dev,
355 zram->comp = comp;
356 zram->disksize = disksize;
357 set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
358 - revalidate_disk(zram->disk);
359 up_write(&zram->init_lock);
360 +
361 + /*
362 + * Revalidate disk out of the init_lock to avoid lockdep splat.
363 + * It's okay because disk's capacity is protected by init_lock
364 + * so that revalidate_disk always sees up-to-date capacity.
365 + */
366 + revalidate_disk(zram->disk);
367 +
368 return len;
369
370 out_destroy_comp:
371 diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
372 index 2a451b14b3cc..c4419ea1ab07 100644
373 --- a/drivers/char/hw_random/core.c
374 +++ b/drivers/char/hw_random/core.c
375 @@ -68,6 +68,12 @@ static void add_early_randomness(struct hwrng *rng)
376 unsigned char bytes[16];
377 int bytes_read;
378
379 + /*
380 + * Currently only virtio-rng cannot return data during device
381 + * probe, and that's handled in virtio-rng.c itself. If there
382 + * are more such devices, this call to rng_get_data can be
383 + * made conditional here instead of doing it per-device.
384 + */
385 bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1);
386 if (bytes_read > 0)
387 add_device_randomness(bytes, bytes_read);
388 diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
389 index 2ce0e225e58c..e4ecf99971fe 100644
390 --- a/drivers/char/hw_random/virtio-rng.c
391 +++ b/drivers/char/hw_random/virtio-rng.c
392 @@ -30,6 +30,8 @@ static unsigned int data_avail;
393 static DECLARE_COMPLETION(have_data);
394 static bool busy;
395
396 +static bool probe_done;
397 +
398 static void random_recv_done(struct virtqueue *vq)
399 {
400 /* We can get spurious callbacks, e.g. shared IRQs + virtio_pci. */
401 @@ -56,6 +58,13 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait)
402 {
403 int ret;
404
405 + /*
406 + * Don't ask host for data till we're setup. This call can
407 + * happen during hwrng_register(), after commit d9e7972619.
408 + */
409 + if (unlikely(!probe_done))
410 + return 0;
411 +
412 if (!busy) {
413 busy = true;
414 init_completion(&have_data);
415 @@ -110,6 +119,7 @@ static int probe_common(struct virtio_device *vdev)
416 return err;
417 }
418
419 + probe_done = true;
420 return 0;
421 }
422
423 diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
424 index d2fd98968085..03ff689229ff 100644
425 --- a/drivers/gpu/drm/radeon/cik.c
426 +++ b/drivers/gpu/drm/radeon/cik.c
427 @@ -2290,6 +2290,7 @@ static void cik_tiling_mode_table_init(struct radeon_device *rdev)
428 gb_tile_moden = 0;
429 break;
430 }
431 + rdev->config.cik.macrotile_mode_array[reg_offset] = gb_tile_moden;
432 WREG32(GB_MACROTILE_MODE0 + (reg_offset * 4), gb_tile_moden);
433 }
434 } else if (num_pipe_configs == 8) {
435 @@ -7363,6 +7364,7 @@ static inline u32 cik_get_ih_wptr(struct radeon_device *rdev)
436 tmp = RREG32(IH_RB_CNTL);
437 tmp |= IH_WPTR_OVERFLOW_CLEAR;
438 WREG32(IH_RB_CNTL, tmp);
439 + wptr &= ~RB_OVERFLOW;
440 }
441 return (wptr & rdev->ih.ptr_mask);
442 }
443 diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
444 index a61a9039f6f6..9da5a9506d60 100644
445 --- a/drivers/gpu/drm/radeon/evergreen.c
446 +++ b/drivers/gpu/drm/radeon/evergreen.c
447 @@ -4759,6 +4759,7 @@ static u32 evergreen_get_ih_wptr(struct radeon_device *rdev)
448 tmp = RREG32(IH_RB_CNTL);
449 tmp |= IH_WPTR_OVERFLOW_CLEAR;
450 WREG32(IH_RB_CNTL, tmp);
451 + wptr &= ~RB_OVERFLOW;
452 }
453 return (wptr & rdev->ih.ptr_mask);
454 }
455 diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
456 index bbc189fd3ddc..7600a432d702 100644
457 --- a/drivers/gpu/drm/radeon/r600.c
458 +++ b/drivers/gpu/drm/radeon/r600.c
459 @@ -3792,6 +3792,7 @@ static u32 r600_get_ih_wptr(struct radeon_device *rdev)
460 tmp = RREG32(IH_RB_CNTL);
461 tmp |= IH_WPTR_OVERFLOW_CLEAR;
462 WREG32(IH_RB_CNTL, tmp);
463 + wptr &= ~RB_OVERFLOW;
464 }
465 return (wptr & rdev->ih.ptr_mask);
466 }
467 diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
468 index 22a63c98ba14..70d4c7603c28 100644
469 --- a/drivers/gpu/drm/radeon/si.c
470 +++ b/drivers/gpu/drm/radeon/si.c
471 @@ -6090,6 +6090,7 @@ static inline u32 si_get_ih_wptr(struct radeon_device *rdev)
472 tmp = RREG32(IH_RB_CNTL);
473 tmp |= IH_WPTR_OVERFLOW_CLEAR;
474 WREG32(IH_RB_CNTL, tmp);
475 + wptr &= ~RB_OVERFLOW;
476 }
477 return (wptr & rdev->ih.ptr_mask);
478 }
479 diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c
480 index efee4c59239f..34b9a601ad07 100644
481 --- a/drivers/hwmon/smsc47m192.c
482 +++ b/drivers/hwmon/smsc47m192.c
483 @@ -86,7 +86,7 @@ static inline u8 IN_TO_REG(unsigned long val, int n)
484 */
485 static inline s8 TEMP_TO_REG(int val)
486 {
487 - return clamp_val(SCALE(val, 1, 1000), -128000, 127000);
488 + return SCALE(clamp_val(val, -128000, 127000), 1, 1000);
489 }
490
491 static inline int TEMP_FROM_REG(s8 val)
492 @@ -384,6 +384,8 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr,
493 err = kstrtoul(buf, 10, &val);
494 if (err)
495 return err;
496 + if (val > 255)
497 + return -EINVAL;
498
499 data->vrm = val;
500 return count;
501 diff --git a/drivers/input/input.c b/drivers/input/input.c
502 index 1c4c0db05550..29ca0bb4f561 100644
503 --- a/drivers/input/input.c
504 +++ b/drivers/input/input.c
505 @@ -257,9 +257,10 @@ static int input_handle_abs_event(struct input_dev *dev,
506 }
507
508 static int input_get_disposition(struct input_dev *dev,
509 - unsigned int type, unsigned int code, int value)
510 + unsigned int type, unsigned int code, int *pval)
511 {
512 int disposition = INPUT_IGNORE_EVENT;
513 + int value = *pval;
514
515 switch (type) {
516
517 @@ -357,6 +358,7 @@ static int input_get_disposition(struct input_dev *dev,
518 break;
519 }
520
521 + *pval = value;
522 return disposition;
523 }
524
525 @@ -365,7 +367,7 @@ static void input_handle_event(struct input_dev *dev,
526 {
527 int disposition;
528
529 - disposition = input_get_disposition(dev, type, code, value);
530 + disposition = input_get_disposition(dev, type, code, &value);
531
532 if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event)
533 dev->event(dev, type, code, value);
534 diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
535 index ec772d962f06..ef9e0b8a9aa7 100644
536 --- a/drivers/input/mouse/synaptics.c
537 +++ b/drivers/input/mouse/synaptics.c
538 @@ -132,7 +132,8 @@ static const struct min_max_quirk min_max_pnpid_table[] = {
539 1232, 5710, 1156, 4696
540 },
541 {
542 - (const char * const []){"LEN0034", "LEN0036", "LEN2004", NULL},
543 + (const char * const []){"LEN0034", "LEN0036", "LEN2002",
544 + "LEN2004", NULL},
545 1024, 5112, 2024, 4832
546 },
547 {
548 @@ -168,7 +169,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
549 "LEN0049",
550 "LEN2000",
551 "LEN2001", /* Edge E431 */
552 - "LEN2002",
553 + "LEN2002", /* Edge E531 */
554 "LEN2003",
555 "LEN2004", /* L440 */
556 "LEN2005",
557 diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c
558 index 522fe00f5eee..49874e76548b 100644
559 --- a/drivers/media/dvb-frontends/tda10071.c
560 +++ b/drivers/media/dvb-frontends/tda10071.c
561 @@ -668,6 +668,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe)
562 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
563 int ret, i;
564 u8 mode, rolloff, pilot, inversion, div;
565 + fe_modulation_t modulation;
566
567 dev_dbg(&priv->i2c->dev,
568 "%s: delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d pilot=%d rolloff=%d\n",
569 @@ -702,10 +703,13 @@ static int tda10071_set_frontend(struct dvb_frontend *fe)
570
571 switch (c->delivery_system) {
572 case SYS_DVBS:
573 + modulation = QPSK;
574 rolloff = 0;
575 pilot = 2;
576 break;
577 case SYS_DVBS2:
578 + modulation = c->modulation;
579 +
580 switch (c->rolloff) {
581 case ROLLOFF_20:
582 rolloff = 2;
583 @@ -750,7 +754,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe)
584
585 for (i = 0, mode = 0xff; i < ARRAY_SIZE(TDA10071_MODCOD); i++) {
586 if (c->delivery_system == TDA10071_MODCOD[i].delivery_system &&
587 - c->modulation == TDA10071_MODCOD[i].modulation &&
588 + modulation == TDA10071_MODCOD[i].modulation &&
589 c->fec_inner == TDA10071_MODCOD[i].fec) {
590 mode = TDA10071_MODCOD[i].val;
591 dev_dbg(&priv->i2c->dev, "%s: mode found=%02x\n",
592 diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
593 index 021e4d35e4d7..7b9b75f60774 100644
594 --- a/drivers/media/usb/dvb-usb-v2/af9035.c
595 +++ b/drivers/media/usb/dvb-usb-v2/af9035.c
596 @@ -704,15 +704,41 @@ static int af9035_read_config(struct dvb_usb_device *d)
597 if (ret < 0)
598 goto err;
599
600 - if (tmp == 0x00)
601 - dev_dbg(&d->udev->dev,
602 - "%s: [%d]tuner not set, using default\n",
603 - __func__, i);
604 - else
605 + dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n",
606 + __func__, i, tmp);
607 +
608 + /* tuner sanity check */
609 + if (state->chip_type == 0x9135) {
610 + if (state->chip_version == 0x02) {
611 + /* IT9135 BX (v2) */
612 + switch (tmp) {
613 + case AF9033_TUNER_IT9135_60:
614 + case AF9033_TUNER_IT9135_61:
615 + case AF9033_TUNER_IT9135_62:
616 + state->af9033_config[i].tuner = tmp;
617 + break;
618 + }
619 + } else {
620 + /* IT9135 AX (v1) */
621 + switch (tmp) {
622 + case AF9033_TUNER_IT9135_38:
623 + case AF9033_TUNER_IT9135_51:
624 + case AF9033_TUNER_IT9135_52:
625 + state->af9033_config[i].tuner = tmp;
626 + break;
627 + }
628 + }
629 + } else {
630 + /* AF9035 */
631 state->af9033_config[i].tuner = tmp;
632 + }
633
634 - dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n",
635 - __func__, i, state->af9033_config[i].tuner);
636 + if (state->af9033_config[i].tuner != tmp) {
637 + dev_info(&d->udev->dev,
638 + "%s: [%d] overriding tuner from %02x to %02x\n",
639 + KBUILD_MODNAME, i, tmp,
640 + state->af9033_config[i].tuner);
641 + }
642
643 switch (state->af9033_config[i].tuner) {
644 case AF9033_TUNER_TUA9001:
645 diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
646 index 0500c4175d5f..6bce01a674f9 100644
647 --- a/drivers/media/usb/hdpvr/hdpvr-video.c
648 +++ b/drivers/media/usb/hdpvr/hdpvr-video.c
649 @@ -82,7 +82,7 @@ static void hdpvr_read_bulk_callback(struct urb *urb)
650 }
651
652 /*=========================================================================*/
653 -/* bufffer bits */
654 +/* buffer bits */
655
656 /* function expects dev->io_mutex to be hold by caller */
657 int hdpvr_cancel_queue(struct hdpvr_device *dev)
658 @@ -926,7 +926,7 @@ static int hdpvr_s_ctrl(struct v4l2_ctrl *ctrl)
659 case V4L2_CID_MPEG_AUDIO_ENCODING:
660 if (dev->flags & HDPVR_FLAG_AC3_CAP) {
661 opt->audio_codec = ctrl->val;
662 - return hdpvr_set_audio(dev, opt->audio_input,
663 + return hdpvr_set_audio(dev, opt->audio_input + 1,
664 opt->audio_codec);
665 }
666 return 0;
667 @@ -1198,7 +1198,7 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent,
668 v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops,
669 V4L2_CID_MPEG_AUDIO_ENCODING,
670 ac3 ? V4L2_MPEG_AUDIO_ENCODING_AC3 : V4L2_MPEG_AUDIO_ENCODING_AAC,
671 - 0x7, V4L2_MPEG_AUDIO_ENCODING_AAC);
672 + 0x7, ac3 ? dev->options.audio_codec : V4L2_MPEG_AUDIO_ENCODING_AAC);
673 v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops,
674 V4L2_CID_MPEG_VIDEO_ENCODING,
675 V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 0x3,
676 diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c
677 index 48b20dfcc4d0..eb3850c246a6 100644
678 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c
679 +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c
680 @@ -599,10 +599,10 @@ struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait)
681 aspect.denominator = 9;
682 } else if (ratio == 34) {
683 aspect.numerator = 4;
684 - aspect.numerator = 3;
685 + aspect.denominator = 3;
686 } else if (ratio == 68) {
687 aspect.numerator = 15;
688 - aspect.numerator = 9;
689 + aspect.denominator = 9;
690 } else {
691 aspect.numerator = hor_landscape + 99;
692 aspect.denominator = 100;
693 diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
694 index 2872ece81f35..44333bd8f908 100644
695 --- a/drivers/parport/Kconfig
696 +++ b/drivers/parport/Kconfig
697 @@ -5,6 +5,12 @@
698 # Parport configuration.
699 #
700
701 +config ARCH_MIGHT_HAVE_PC_PARPORT
702 + bool
703 + help
704 + Select this config option from the architecture Kconfig if
705 + the architecture might have PC parallel port hardware.
706 +
707 menuconfig PARPORT
708 tristate "Parallel port support"
709 depends on HAS_IOMEM
710 @@ -31,12 +37,6 @@ menuconfig PARPORT
711
712 If unsure, say Y.
713
714 -config ARCH_MIGHT_HAVE_PC_PARPORT
715 - bool
716 - help
717 - Select this config option from the architecture Kconfig if
718 - the architecture might have PC parallel port hardware.
719 -
720 if PARPORT
721
722 config PARPORT_PC
723 diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
724 index bd725b0a4341..3a364686c112 100644
725 --- a/drivers/pinctrl/pinctrl-st.c
726 +++ b/drivers/pinctrl/pinctrl-st.c
727 @@ -1467,7 +1467,7 @@ static void st_gpio_irqmux_handler(unsigned irq, struct irq_desc *desc)
728
729 status = readl(info->irqmux_base);
730
731 - for_each_set_bit(n, &status, ST_GPIO_PINS_PER_BANK)
732 + for_each_set_bit(n, &status, info->nbanks)
733 __gpio_irq_handler(&info->banks[n]);
734
735 chained_irq_exit(chip, desc);
736 diff --git a/drivers/staging/media/omap4iss/Kconfig b/drivers/staging/media/omap4iss/Kconfig
737 index b9fe753969bd..15940f8fdd24 100644
738 --- a/drivers/staging/media/omap4iss/Kconfig
739 +++ b/drivers/staging/media/omap4iss/Kconfig
740 @@ -1,6 +1,6 @@
741 config VIDEO_OMAP4
742 bool "OMAP 4 Camera support"
743 - depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
744 + depends on VIDEO_V4L2=y && VIDEO_V4L2_SUBDEV_API && I2C=y && ARCH_OMAP4
745 select VIDEOBUF2_DMA_CONTIG
746 ---help---
747 Driver for an OMAP 4 ISS controller.
748 diff --git a/fs/coredump.c b/fs/coredump.c
749 index 0b2528fb640e..a93f7e6ea4cf 100644
750 --- a/fs/coredump.c
751 +++ b/fs/coredump.c
752 @@ -306,7 +306,7 @@ static int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
753 if (unlikely(nr < 0))
754 return nr;
755
756 - tsk->flags = PF_DUMPCORE;
757 + tsk->flags |= PF_DUMPCORE;
758 if (atomic_read(&mm->mm_users) == nr + 1)
759 goto done;
760 /*
761 diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
762 index e2cd799e4d21..2d9c1d071a7a 100644
763 --- a/fs/fuse/inode.c
764 +++ b/fs/fuse/inode.c
765 @@ -907,9 +907,6 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
766 fc->writeback_cache = 1;
767 if (arg->time_gran && arg->time_gran <= 1000000000)
768 fc->sb->s_time_gran = arg->time_gran;
769 - else
770 - fc->sb->s_time_gran = 1000000000;
771 -
772 } else {
773 ra_pages = fc->max_read / PAGE_CACHE_SIZE;
774 fc->no_lock = 1;
775 @@ -938,7 +935,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
776 FUSE_SPLICE_WRITE | FUSE_SPLICE_MOVE | FUSE_SPLICE_READ |
777 FUSE_FLOCK_LOCKS | FUSE_IOCTL_DIR | FUSE_AUTO_INVAL_DATA |
778 FUSE_DO_READDIRPLUS | FUSE_READDIRPLUS_AUTO | FUSE_ASYNC_DIO |
779 - FUSE_WRITEBACK_CACHE;
780 + FUSE_WRITEBACK_CACHE | FUSE_NO_OPEN_SUPPORT;
781 req->in.h.opcode = FUSE_INIT;
782 req->in.numargs = 1;
783 req->in.args[0].size = sizeof(*arg);
784 diff --git a/fs/namei.c b/fs/namei.c
785 index 985c6f368485..9eb787e5c167 100644
786 --- a/fs/namei.c
787 +++ b/fs/namei.c
788 @@ -2256,9 +2256,10 @@ done:
789 goto out;
790 }
791 path->dentry = dentry;
792 - path->mnt = mntget(nd->path.mnt);
793 + path->mnt = nd->path.mnt;
794 if (should_follow_link(dentry, nd->flags & LOOKUP_FOLLOW))
795 return 1;
796 + mntget(path->mnt);
797 follow_mount(path);
798 error = 0;
799 out:
800 diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c
801 index 871d6eda8dba..8f854dde4150 100644
802 --- a/fs/nfs/nfs3acl.c
803 +++ b/fs/nfs/nfs3acl.c
804 @@ -247,3 +247,46 @@ const struct xattr_handler *nfs3_xattr_handlers[] = {
805 &posix_acl_default_xattr_handler,
806 NULL,
807 };
808 +
809 +static int
810 +nfs3_list_one_acl(struct inode *inode, int type, const char *name, void *data,
811 + size_t size, ssize_t *result)
812 +{
813 + struct posix_acl *acl;
814 + char *p = data + *result;
815 +
816 + acl = get_acl(inode, type);
817 + if (!acl)
818 + return 0;
819 +
820 + posix_acl_release(acl);
821 +
822 + *result += strlen(name);
823 + *result += 1;
824 + if (!size)
825 + return 0;
826 + if (*result > size)
827 + return -ERANGE;
828 +
829 + strcpy(p, name);
830 + return 0;
831 +}
832 +
833 +ssize_t
834 +nfs3_listxattr(struct dentry *dentry, char *data, size_t size)
835 +{
836 + struct inode *inode = dentry->d_inode;
837 + ssize_t result = 0;
838 + int error;
839 +
840 + error = nfs3_list_one_acl(inode, ACL_TYPE_ACCESS,
841 + POSIX_ACL_XATTR_ACCESS, data, size, &result);
842 + if (error)
843 + return error;
844 +
845 + error = nfs3_list_one_acl(inode, ACL_TYPE_DEFAULT,
846 + POSIX_ACL_XATTR_DEFAULT, data, size, &result);
847 + if (error)
848 + return error;
849 + return result;
850 +}
851 diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
852 index db60149c4579..0e2bb2658c94 100644
853 --- a/fs/nfs/nfs3proc.c
854 +++ b/fs/nfs/nfs3proc.c
855 @@ -891,7 +891,7 @@ static const struct inode_operations nfs3_dir_inode_operations = {
856 .getattr = nfs_getattr,
857 .setattr = nfs_setattr,
858 #ifdef CONFIG_NFS_V3_ACL
859 - .listxattr = generic_listxattr,
860 + .listxattr = nfs3_listxattr,
861 .getxattr = generic_getxattr,
862 .setxattr = generic_setxattr,
863 .removexattr = generic_removexattr,
864 @@ -905,7 +905,7 @@ static const struct inode_operations nfs3_file_inode_operations = {
865 .getattr = nfs_getattr,
866 .setattr = nfs_setattr,
867 #ifdef CONFIG_NFS_V3_ACL
868 - .listxattr = generic_listxattr,
869 + .listxattr = nfs3_listxattr,
870 .getxattr = generic_getxattr,
871 .setxattr = generic_setxattr,
872 .removexattr = generic_removexattr,
873 diff --git a/include/linux/libata.h b/include/linux/libata.h
874 index 5ab4e3a76721..92abb497ab14 100644
875 --- a/include/linux/libata.h
876 +++ b/include/linux/libata.h
877 @@ -593,6 +593,7 @@ struct ata_host {
878 struct device *dev;
879 void __iomem * const *iomap;
880 unsigned int n_ports;
881 + unsigned int n_tags; /* nr of NCQ tags */
882 void *private_data;
883 struct ata_port_operations *ops;
884 unsigned long flags;
885 diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
886 index 40b5ca8a1b1f..25084a052a1e 100644
887 --- a/include/uapi/linux/fuse.h
888 +++ b/include/uapi/linux/fuse.h
889 @@ -101,6 +101,7 @@
890 * - add FATTR_CTIME
891 * - add ctime and ctimensec to fuse_setattr_in
892 * - add FUSE_RENAME2 request
893 + * - add FUSE_NO_OPEN_SUPPORT flag
894 */
895
896 #ifndef _LINUX_FUSE_H
897 @@ -229,6 +230,7 @@ struct fuse_file_lock {
898 * FUSE_READDIRPLUS_AUTO: adaptive readdirplus
899 * FUSE_ASYNC_DIO: asynchronous direct I/O submission
900 * FUSE_WRITEBACK_CACHE: use writeback cache for buffered writes
901 + * FUSE_NO_OPEN_SUPPORT: kernel supports zero-message opens
902 */
903 #define FUSE_ASYNC_READ (1 << 0)
904 #define FUSE_POSIX_LOCKS (1 << 1)
905 @@ -247,6 +249,7 @@ struct fuse_file_lock {
906 #define FUSE_READDIRPLUS_AUTO (1 << 14)
907 #define FUSE_ASYNC_DIO (1 << 15)
908 #define FUSE_WRITEBACK_CACHE (1 << 16)
909 +#define FUSE_NO_OPEN_SUPPORT (1 << 17)
910
911 /**
912 * CUSE INIT request/reply flags
913 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
914 index 4dcbf7dc3c51..e1baa92f8013 100644
915 --- a/kernel/trace/trace.c
916 +++ b/kernel/trace/trace.c
917 @@ -823,7 +823,7 @@ static struct {
918 { trace_clock_local, "local", 1 },
919 { trace_clock_global, "global", 1 },
920 { trace_clock_counter, "counter", 0 },
921 - { trace_clock_jiffies, "uptime", 1 },
922 + { trace_clock_jiffies, "uptime", 0 },
923 { trace_clock, "perf", 1 },
924 ARCH_TRACE_CLOCKS
925 };
926 diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
927 index 26dc348332b7..57b67b1f24d1 100644
928 --- a/kernel/trace/trace_clock.c
929 +++ b/kernel/trace/trace_clock.c
930 @@ -59,13 +59,14 @@ u64 notrace trace_clock(void)
931
932 /*
933 * trace_jiffy_clock(): Simply use jiffies as a clock counter.
934 + * Note that this use of jiffies_64 is not completely safe on
935 + * 32-bit systems. But the window is tiny, and the effect if
936 + * we are affected is that we will have an obviously bogus
937 + * timestamp on a trace event - i.e. not life threatening.
938 */
939 u64 notrace trace_clock_jiffies(void)
940 {
941 - u64 jiffy = jiffies - INITIAL_JIFFIES;
942 -
943 - /* Return nsecs */
944 - return (u64)jiffies_to_usecs(jiffy) * 1000ULL;
945 + return jiffies_64_to_clock_t(jiffies_64 - INITIAL_JIFFIES);
946 }
947
948 /*
949 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
950 index a646f1598d58..002f08e3d61c 100644
951 --- a/mm/hugetlb.c
952 +++ b/mm/hugetlb.c
953 @@ -2461,6 +2461,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
954 } else {
955 if (cow)
956 huge_ptep_set_wrprotect(src, addr, src_pte);
957 + entry = huge_ptep_get(src_pte);
958 ptepage = pte_page(entry);
959 get_page(ptepage);
960 page_dup_rmap(ptepage);
961 diff --git a/mm/memory.c b/mm/memory.c
962 index e302ae1dcce0..4f9e53024b24 100644
963 --- a/mm/memory.c
964 +++ b/mm/memory.c
965 @@ -3515,7 +3515,7 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
966 * if page by the offset is not ready to be mapped (cold cache or
967 * something).
968 */
969 - if (vma->vm_ops->map_pages) {
970 + if (vma->vm_ops->map_pages && !(flags & FAULT_FLAG_NONLINEAR)) {
971 pte = pte_offset_map_lock(mm, pmd, address, &ptl);
972 do_fault_around(vma, address, pte, pgoff, flags);
973 if (!pte_same(*pte, orig_pte))
974 diff --git a/mm/slab_common.c b/mm/slab_common.c
975 index 102cc6fca3d3..b810fba0095d 100644
976 --- a/mm/slab_common.c
977 +++ b/mm/slab_common.c
978 @@ -55,7 +55,7 @@ static int kmem_cache_sanity_check(const char *name, size_t size)
979 continue;
980 }
981
982 -#if !defined(CONFIG_SLUB) || !defined(CONFIG_SLUB_DEBUG_ON)
983 +#if !defined(CONFIG_SLUB)
984 if (!strcmp(s->name, name)) {
985 pr_err("%s (%s): Cache name already exists.\n",
986 __func__, name);
987 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
988 index 052c1bf8ffac..8060b28dcef6 100644
989 --- a/net/wireless/nl80211.c
990 +++ b/net/wireless/nl80211.c
991 @@ -1470,18 +1470,17 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
992 }
993 CMD(start_p2p_device, START_P2P_DEVICE);
994 CMD(set_mcast_rate, SET_MCAST_RATE);
995 +#ifdef CONFIG_NL80211_TESTMODE
996 + CMD(testmode_cmd, TESTMODE);
997 +#endif
998 if (state->split) {
999 CMD(crit_proto_start, CRIT_PROTOCOL_START);
1000 CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
1001 if (dev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)
1002 CMD(channel_switch, CHANNEL_SWITCH);
1003 + CMD(set_qos_map, SET_QOS_MAP);
1004 }
1005 - CMD(set_qos_map, SET_QOS_MAP);
1006 -
1007 -#ifdef CONFIG_NL80211_TESTMODE
1008 - CMD(testmode_cmd, TESTMODE);
1009 -#endif
1010 -
1011 + /* add into the if now */
1012 #undef CMD
1013
1014 if (dev->ops->connect || dev->ops->auth) {