1 |
commit: 7f39f6e6b366931633750a78904e8b378f7f75eb |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 2 15:26:14 2014 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 2 15:26:14 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=7f39f6e6 |
7 |
|
8 |
Linux patch 3.10.51 |
9 |
|
10 |
--- |
11 |
0000_README | 4 + |
12 |
1050_linux-3.10.51.patch | 708 +++++++++++++++++++++++++++++++++++++++++++++++ |
13 |
2 files changed, 712 insertions(+) |
14 |
|
15 |
diff --git a/0000_README b/0000_README |
16 |
index e86111a..35d32f5 100644 |
17 |
--- a/0000_README |
18 |
+++ b/0000_README |
19 |
@@ -242,6 +242,10 @@ Patch: 1049_linux-3.10.50.patch |
20 |
From: http://www.kernel.org |
21 |
Desc: Linux 3.10.50 |
22 |
|
23 |
+Patch: 1050_linux-3.10.51.patch |
24 |
+From: http://www.kernel.org |
25 |
+Desc: Linux 3.10.51 |
26 |
+ |
27 |
Patch: 1500_XATTR_USER_PREFIX.patch |
28 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
29 |
Desc: Support for namespace user.pax.* on tmpfs. |
30 |
|
31 |
diff --git a/1050_linux-3.10.51.patch b/1050_linux-3.10.51.patch |
32 |
new file mode 100644 |
33 |
index 0000000..ba39b5f |
34 |
--- /dev/null |
35 |
+++ b/1050_linux-3.10.51.patch |
36 |
@@ -0,0 +1,708 @@ |
37 |
+diff --git a/Makefile b/Makefile |
38 |
+index 8d891c66803c..f9f6ee59c61a 100644 |
39 |
+--- a/Makefile |
40 |
++++ b/Makefile |
41 |
+@@ -1,6 +1,6 @@ |
42 |
+ VERSION = 3 |
43 |
+ PATCHLEVEL = 10 |
44 |
+-SUBLEVEL = 50 |
45 |
++SUBLEVEL = 51 |
46 |
+ EXTRAVERSION = |
47 |
+ NAME = TOSSUG Baby Fish |
48 |
+ |
49 |
+@@ -614,6 +614,8 @@ KBUILD_CFLAGS += -fomit-frame-pointer |
50 |
+ endif |
51 |
+ endif |
52 |
+ |
53 |
++KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments) |
54 |
++ |
55 |
+ ifdef CONFIG_DEBUG_INFO |
56 |
+ KBUILD_CFLAGS += -g |
57 |
+ KBUILD_AFLAGS += -gdwarf-2 |
58 |
+diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h |
59 |
+index a2fa297196bc..f5645d6a89f2 100644 |
60 |
+--- a/arch/parisc/include/uapi/asm/signal.h |
61 |
++++ b/arch/parisc/include/uapi/asm/signal.h |
62 |
+@@ -69,8 +69,6 @@ |
63 |
+ #define SA_NOMASK SA_NODEFER |
64 |
+ #define SA_ONESHOT SA_RESETHAND |
65 |
+ |
66 |
+-#define SA_RESTORER 0x04000000 /* obsolete -- ignored */ |
67 |
+- |
68 |
+ #define MINSIGSTKSZ 2048 |
69 |
+ #define SIGSTKSZ 8192 |
70 |
+ |
71 |
+diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c |
72 |
+index a314c57f4e94..9677d935583c 100644 |
73 |
+--- a/arch/s390/kernel/ptrace.c |
74 |
++++ b/arch/s390/kernel/ptrace.c |
75 |
+@@ -314,7 +314,9 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) |
76 |
+ * psw and gprs are stored on the stack |
77 |
+ */ |
78 |
+ if (addr == (addr_t) &dummy->regs.psw.mask && |
79 |
+- ((data & ~PSW_MASK_USER) != psw_user_bits || |
80 |
++ (((data^psw_user_bits) & ~PSW_MASK_USER) || |
81 |
++ (((data^psw_user_bits) & PSW_MASK_ASC) && |
82 |
++ ((data|psw_user_bits) & PSW_MASK_ASC) == PSW_MASK_ASC) || |
83 |
+ ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)))) |
84 |
+ /* Invalid psw mask. */ |
85 |
+ return -EINVAL; |
86 |
+@@ -627,7 +629,10 @@ static int __poke_user_compat(struct task_struct *child, |
87 |
+ */ |
88 |
+ if (addr == (addr_t) &dummy32->regs.psw.mask) { |
89 |
+ /* Build a 64 bit psw mask from 31 bit mask. */ |
90 |
+- if ((tmp & ~PSW32_MASK_USER) != psw32_user_bits) |
91 |
++ if (((tmp^psw32_user_bits) & ~PSW32_MASK_USER) || |
92 |
++ (((tmp^psw32_user_bits) & PSW32_MASK_ASC) && |
93 |
++ ((tmp|psw32_user_bits) & PSW32_MASK_ASC) |
94 |
++ == PSW32_MASK_ASC)) |
95 |
+ /* Invalid psw mask. */ |
96 |
+ return -EINVAL; |
97 |
+ regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
98 |
+diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S |
99 |
+index 9ec06a1f6d61..425712462178 100644 |
100 |
+--- a/arch/x86/boot/header.S |
101 |
++++ b/arch/x86/boot/header.S |
102 |
+@@ -91,10 +91,9 @@ bs_die: |
103 |
+ |
104 |
+ .section ".bsdata", "a" |
105 |
+ bugger_off_msg: |
106 |
+- .ascii "Direct floppy boot is not supported. " |
107 |
+- .ascii "Use a boot loader program instead.\r\n" |
108 |
++ .ascii "Use a boot loader.\r\n" |
109 |
+ .ascii "\n" |
110 |
+- .ascii "Remove disk and press any key to reboot ...\r\n" |
111 |
++ .ascii "Remove disk and press any key to reboot...\r\n" |
112 |
+ .byte 0 |
113 |
+ |
114 |
+ #ifdef CONFIG_EFI_STUB |
115 |
+@@ -108,7 +107,7 @@ coff_header: |
116 |
+ #else |
117 |
+ .word 0x8664 # x86-64 |
118 |
+ #endif |
119 |
+- .word 3 # nr_sections |
120 |
++ .word 4 # nr_sections |
121 |
+ .long 0 # TimeDateStamp |
122 |
+ .long 0 # PointerToSymbolTable |
123 |
+ .long 1 # NumberOfSymbols |
124 |
+@@ -250,6 +249,25 @@ section_table: |
125 |
+ .word 0 # NumberOfLineNumbers |
126 |
+ .long 0x60500020 # Characteristics (section flags) |
127 |
+ |
128 |
++ # |
129 |
++ # The offset & size fields are filled in by build.c. |
130 |
++ # |
131 |
++ .ascii ".bss" |
132 |
++ .byte 0 |
133 |
++ .byte 0 |
134 |
++ .byte 0 |
135 |
++ .byte 0 |
136 |
++ .long 0 |
137 |
++ .long 0x0 |
138 |
++ .long 0 # Size of initialized data |
139 |
++ # on disk |
140 |
++ .long 0x0 |
141 |
++ .long 0 # PointerToRelocations |
142 |
++ .long 0 # PointerToLineNumbers |
143 |
++ .word 0 # NumberOfRelocations |
144 |
++ .word 0 # NumberOfLineNumbers |
145 |
++ .long 0xc8000080 # Characteristics (section flags) |
146 |
++ |
147 |
+ #endif /* CONFIG_EFI_STUB */ |
148 |
+ |
149 |
+ # Kernel attributes; used by setup. This is part 1 of the |
150 |
+diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c |
151 |
+index 94c544650020..971a0ce062aa 100644 |
152 |
+--- a/arch/x86/boot/tools/build.c |
153 |
++++ b/arch/x86/boot/tools/build.c |
154 |
+@@ -141,7 +141,7 @@ static void usage(void) |
155 |
+ |
156 |
+ #ifdef CONFIG_EFI_STUB |
157 |
+ |
158 |
+-static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) |
159 |
++static void update_pecoff_section_header_fields(char *section_name, u32 vma, u32 size, u32 datasz, u32 offset) |
160 |
+ { |
161 |
+ unsigned int pe_header; |
162 |
+ unsigned short num_sections; |
163 |
+@@ -162,10 +162,10 @@ static void update_pecoff_section_header(char *section_name, u32 offset, u32 siz |
164 |
+ put_unaligned_le32(size, section + 0x8); |
165 |
+ |
166 |
+ /* section header vma field */ |
167 |
+- put_unaligned_le32(offset, section + 0xc); |
168 |
++ put_unaligned_le32(vma, section + 0xc); |
169 |
+ |
170 |
+ /* section header 'size of initialised data' field */ |
171 |
+- put_unaligned_le32(size, section + 0x10); |
172 |
++ put_unaligned_le32(datasz, section + 0x10); |
173 |
+ |
174 |
+ /* section header 'file offset' field */ |
175 |
+ put_unaligned_le32(offset, section + 0x14); |
176 |
+@@ -177,6 +177,11 @@ static void update_pecoff_section_header(char *section_name, u32 offset, u32 siz |
177 |
+ } |
178 |
+ } |
179 |
+ |
180 |
++static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) |
181 |
++{ |
182 |
++ update_pecoff_section_header_fields(section_name, offset, size, size, offset); |
183 |
++} |
184 |
++ |
185 |
+ static void update_pecoff_setup_and_reloc(unsigned int size) |
186 |
+ { |
187 |
+ u32 setup_offset = 0x200; |
188 |
+@@ -201,9 +206,6 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) |
189 |
+ |
190 |
+ pe_header = get_unaligned_le32(&buf[0x3c]); |
191 |
+ |
192 |
+- /* Size of image */ |
193 |
+- put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); |
194 |
+- |
195 |
+ /* |
196 |
+ * Size of code: Subtract the size of the first sector (512 bytes) |
197 |
+ * which includes the header. |
198 |
+@@ -218,6 +220,22 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) |
199 |
+ update_pecoff_section_header(".text", text_start, text_sz); |
200 |
+ } |
201 |
+ |
202 |
++static void update_pecoff_bss(unsigned int file_sz, unsigned int init_sz) |
203 |
++{ |
204 |
++ unsigned int pe_header; |
205 |
++ unsigned int bss_sz = init_sz - file_sz; |
206 |
++ |
207 |
++ pe_header = get_unaligned_le32(&buf[0x3c]); |
208 |
++ |
209 |
++ /* Size of uninitialized data */ |
210 |
++ put_unaligned_le32(bss_sz, &buf[pe_header + 0x24]); |
211 |
++ |
212 |
++ /* Size of image */ |
213 |
++ put_unaligned_le32(init_sz, &buf[pe_header + 0x50]); |
214 |
++ |
215 |
++ update_pecoff_section_header_fields(".bss", file_sz, bss_sz, 0, 0); |
216 |
++} |
217 |
++ |
218 |
+ #endif /* CONFIG_EFI_STUB */ |
219 |
+ |
220 |
+ |
221 |
+@@ -268,6 +286,9 @@ int main(int argc, char ** argv) |
222 |
+ int fd; |
223 |
+ void *kernel; |
224 |
+ u32 crc = 0xffffffffUL; |
225 |
++#ifdef CONFIG_EFI_STUB |
226 |
++ unsigned int init_sz; |
227 |
++#endif |
228 |
+ |
229 |
+ /* Defaults for old kernel */ |
230 |
+ #ifdef CONFIG_X86_32 |
231 |
+@@ -338,7 +359,9 @@ int main(int argc, char ** argv) |
232 |
+ put_unaligned_le32(sys_size, &buf[0x1f4]); |
233 |
+ |
234 |
+ #ifdef CONFIG_EFI_STUB |
235 |
+- update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz)); |
236 |
++ update_pecoff_text(setup_sectors * 512, i + (sys_size * 16)); |
237 |
++ init_sz = get_unaligned_le32(&buf[0x260]); |
238 |
++ update_pecoff_bss(i + (sys_size * 16), init_sz); |
239 |
+ |
240 |
+ #ifdef CONFIG_X86_64 /* Yes, this is really how we defined it :( */ |
241 |
+ efi_stub_entry -= 0x200; |
242 |
+diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S |
243 |
+index ac6328176097..08fa44443a01 100644 |
244 |
+--- a/arch/x86/kernel/entry_32.S |
245 |
++++ b/arch/x86/kernel/entry_32.S |
246 |
+@@ -436,8 +436,8 @@ sysenter_do_call: |
247 |
+ cmpl $(NR_syscalls), %eax |
248 |
+ jae sysenter_badsys |
249 |
+ call *sys_call_table(,%eax,4) |
250 |
+- movl %eax,PT_EAX(%esp) |
251 |
+ sysenter_after_call: |
252 |
++ movl %eax,PT_EAX(%esp) |
253 |
+ LOCKDEP_SYS_EXIT |
254 |
+ DISABLE_INTERRUPTS(CLBR_ANY) |
255 |
+ TRACE_IRQS_OFF |
256 |
+@@ -517,6 +517,7 @@ ENTRY(system_call) |
257 |
+ jae syscall_badsys |
258 |
+ syscall_call: |
259 |
+ call *sys_call_table(,%eax,4) |
260 |
++syscall_after_call: |
261 |
+ movl %eax,PT_EAX(%esp) # store the return value |
262 |
+ syscall_exit: |
263 |
+ LOCKDEP_SYS_EXIT |
264 |
+@@ -686,12 +687,12 @@ syscall_fault: |
265 |
+ END(syscall_fault) |
266 |
+ |
267 |
+ syscall_badsys: |
268 |
+- movl $-ENOSYS,PT_EAX(%esp) |
269 |
+- jmp syscall_exit |
270 |
++ movl $-ENOSYS,%eax |
271 |
++ jmp syscall_after_call |
272 |
+ END(syscall_badsys) |
273 |
+ |
274 |
+ sysenter_badsys: |
275 |
+- movl $-ENOSYS,PT_EAX(%esp) |
276 |
++ movl $-ENOSYS,%eax |
277 |
+ jmp sysenter_after_call |
278 |
+ END(syscall_badsys) |
279 |
+ CFI_ENDPROC |
280 |
+diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c |
281 |
+index e8918ffaf96d..b95219d2168d 100644 |
282 |
+--- a/block/blk-cgroup.c |
283 |
++++ b/block/blk-cgroup.c |
284 |
+@@ -876,6 +876,13 @@ void blkcg_drain_queue(struct request_queue *q) |
285 |
+ { |
286 |
+ lockdep_assert_held(q->queue_lock); |
287 |
+ |
288 |
++ /* |
289 |
++ * @q could be exiting and already have destroyed all blkgs as |
290 |
++ * indicated by NULL root_blkg. If so, don't confuse policies. |
291 |
++ */ |
292 |
++ if (!q->root_blkg) |
293 |
++ return; |
294 |
++ |
295 |
+ blk_throtl_drain(q); |
296 |
+ } |
297 |
+ |
298 |
+diff --git a/block/blk-tag.c b/block/blk-tag.c |
299 |
+index cc345e1d8d4e..0c51b4b34f47 100644 |
300 |
+--- a/block/blk-tag.c |
301 |
++++ b/block/blk-tag.c |
302 |
+@@ -27,18 +27,15 @@ struct request *blk_queue_find_tag(struct request_queue *q, int tag) |
303 |
+ EXPORT_SYMBOL(blk_queue_find_tag); |
304 |
+ |
305 |
+ /** |
306 |
+- * __blk_free_tags - release a given set of tag maintenance info |
307 |
++ * blk_free_tags - release a given set of tag maintenance info |
308 |
+ * @bqt: the tag map to free |
309 |
+ * |
310 |
+- * Tries to free the specified @bqt. Returns true if it was |
311 |
+- * actually freed and false if there are still references using it |
312 |
++ * Drop the reference count on @bqt and frees it when the last reference |
313 |
++ * is dropped. |
314 |
+ */ |
315 |
+-static int __blk_free_tags(struct blk_queue_tag *bqt) |
316 |
++void blk_free_tags(struct blk_queue_tag *bqt) |
317 |
+ { |
318 |
+- int retval; |
319 |
+- |
320 |
+- retval = atomic_dec_and_test(&bqt->refcnt); |
321 |
+- if (retval) { |
322 |
++ if (atomic_dec_and_test(&bqt->refcnt)) { |
323 |
+ BUG_ON(find_first_bit(bqt->tag_map, bqt->max_depth) < |
324 |
+ bqt->max_depth); |
325 |
+ |
326 |
+@@ -50,9 +47,8 @@ static int __blk_free_tags(struct blk_queue_tag *bqt) |
327 |
+ |
328 |
+ kfree(bqt); |
329 |
+ } |
330 |
+- |
331 |
+- return retval; |
332 |
+ } |
333 |
++EXPORT_SYMBOL(blk_free_tags); |
334 |
+ |
335 |
+ /** |
336 |
+ * __blk_queue_free_tags - release tag maintenance info |
337 |
+@@ -69,28 +65,13 @@ void __blk_queue_free_tags(struct request_queue *q) |
338 |
+ if (!bqt) |
339 |
+ return; |
340 |
+ |
341 |
+- __blk_free_tags(bqt); |
342 |
++ blk_free_tags(bqt); |
343 |
+ |
344 |
+ q->queue_tags = NULL; |
345 |
+ queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q); |
346 |
+ } |
347 |
+ |
348 |
+ /** |
349 |
+- * blk_free_tags - release a given set of tag maintenance info |
350 |
+- * @bqt: the tag map to free |
351 |
+- * |
352 |
+- * For externally managed @bqt frees the map. Callers of this |
353 |
+- * function must guarantee to have released all the queues that |
354 |
+- * might have been using this tag map. |
355 |
+- */ |
356 |
+-void blk_free_tags(struct blk_queue_tag *bqt) |
357 |
+-{ |
358 |
+- if (unlikely(!__blk_free_tags(bqt))) |
359 |
+- BUG(); |
360 |
+-} |
361 |
+-EXPORT_SYMBOL(blk_free_tags); |
362 |
+- |
363 |
+-/** |
364 |
+ * blk_queue_free_tags - release tag maintenance info |
365 |
+ * @q: the request queue for the device |
366 |
+ * |
367 |
+diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c |
368 |
+index 7c668c8a6f95..21ad6869a5ce 100644 |
369 |
+--- a/block/compat_ioctl.c |
370 |
++++ b/block/compat_ioctl.c |
371 |
+@@ -689,6 +689,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) |
372 |
+ case BLKROSET: |
373 |
+ case BLKDISCARD: |
374 |
+ case BLKSECDISCARD: |
375 |
++ case BLKZEROOUT: |
376 |
+ /* |
377 |
+ * the ones below are implemented in blkdev_locked_ioctl, |
378 |
+ * but we call blkdev_ioctl, which gets the lock for us |
379 |
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c |
380 |
+index b0d33d9533aa..3b39687c6336 100644 |
381 |
+--- a/drivers/ata/ahci.c |
382 |
++++ b/drivers/ata/ahci.c |
383 |
+@@ -455,6 +455,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { |
384 |
+ |
385 |
+ /* Promise */ |
386 |
+ { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ |
387 |
++ { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */ |
388 |
+ |
389 |
+ /* Asmedia */ |
390 |
+ { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ |
391 |
+diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c |
392 |
+index bf00fbcde8ad..ca7c23d58a03 100644 |
393 |
+--- a/drivers/ata/libata-core.c |
394 |
++++ b/drivers/ata/libata-core.c |
395 |
+@@ -4758,6 +4758,10 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) |
396 |
+ * ata_qc_new - Request an available ATA command, for queueing |
397 |
+ * @ap: target port |
398 |
+ * |
399 |
++ * Some ATA host controllers may implement a queue depth which is less |
400 |
++ * than ATA_MAX_QUEUE. So we shouldn't allocate a tag which is beyond |
401 |
++ * the hardware limitation. |
402 |
++ * |
403 |
+ * LOCKING: |
404 |
+ * None. |
405 |
+ */ |
406 |
+@@ -4765,14 +4769,15 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) |
407 |
+ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) |
408 |
+ { |
409 |
+ struct ata_queued_cmd *qc = NULL; |
410 |
++ unsigned int max_queue = ap->host->n_tags; |
411 |
+ unsigned int i, tag; |
412 |
+ |
413 |
+ /* no command while frozen */ |
414 |
+ if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) |
415 |
+ return NULL; |
416 |
+ |
417 |
+- for (i = 0; i < ATA_MAX_QUEUE; i++) { |
418 |
+- tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE; |
419 |
++ for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { |
420 |
++ tag = tag < max_queue ? tag : 0; |
421 |
+ |
422 |
+ /* the last tag is reserved for internal command. */ |
423 |
+ if (tag == ATA_TAG_INTERNAL) |
424 |
+@@ -6073,6 +6078,7 @@ void ata_host_init(struct ata_host *host, struct device *dev, |
425 |
+ { |
426 |
+ spin_lock_init(&host->lock); |
427 |
+ mutex_init(&host->eh_mutex); |
428 |
++ host->n_tags = ATA_MAX_QUEUE - 1; |
429 |
+ host->dev = dev; |
430 |
+ host->ops = ops; |
431 |
+ } |
432 |
+@@ -6154,6 +6160,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) |
433 |
+ { |
434 |
+ int i, rc; |
435 |
+ |
436 |
++ host->n_tags = clamp(sht->can_queue, 1, ATA_MAX_QUEUE - 1); |
437 |
++ |
438 |
+ /* host must have been started */ |
439 |
+ if (!(host->flags & ATA_HOST_STARTED)) { |
440 |
+ dev_err(host->dev, "BUG: trying to register unstarted host\n"); |
441 |
+diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c |
442 |
+index efee4c59239f..34b9a601ad07 100644 |
443 |
+--- a/drivers/hwmon/smsc47m192.c |
444 |
++++ b/drivers/hwmon/smsc47m192.c |
445 |
+@@ -86,7 +86,7 @@ static inline u8 IN_TO_REG(unsigned long val, int n) |
446 |
+ */ |
447 |
+ static inline s8 TEMP_TO_REG(int val) |
448 |
+ { |
449 |
+- return clamp_val(SCALE(val, 1, 1000), -128000, 127000); |
450 |
++ return SCALE(clamp_val(val, -128000, 127000), 1, 1000); |
451 |
+ } |
452 |
+ |
453 |
+ static inline int TEMP_FROM_REG(s8 val) |
454 |
+@@ -384,6 +384,8 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, |
455 |
+ err = kstrtoul(buf, 10, &val); |
456 |
+ if (err) |
457 |
+ return err; |
458 |
++ if (val > 255) |
459 |
++ return -EINVAL; |
460 |
+ |
461 |
+ data->vrm = val; |
462 |
+ return count; |
463 |
+diff --git a/drivers/input/input.c b/drivers/input/input.c |
464 |
+index 66984e272c45..a161021c4526 100644 |
465 |
+--- a/drivers/input/input.c |
466 |
++++ b/drivers/input/input.c |
467 |
+@@ -257,9 +257,10 @@ static int input_handle_abs_event(struct input_dev *dev, |
468 |
+ } |
469 |
+ |
470 |
+ static int input_get_disposition(struct input_dev *dev, |
471 |
+- unsigned int type, unsigned int code, int value) |
472 |
++ unsigned int type, unsigned int code, int *pval) |
473 |
+ { |
474 |
+ int disposition = INPUT_IGNORE_EVENT; |
475 |
++ int value = *pval; |
476 |
+ |
477 |
+ switch (type) { |
478 |
+ |
479 |
+@@ -357,6 +358,7 @@ static int input_get_disposition(struct input_dev *dev, |
480 |
+ break; |
481 |
+ } |
482 |
+ |
483 |
++ *pval = value; |
484 |
+ return disposition; |
485 |
+ } |
486 |
+ |
487 |
+@@ -365,7 +367,7 @@ static void input_handle_event(struct input_dev *dev, |
488 |
+ { |
489 |
+ int disposition; |
490 |
+ |
491 |
+- disposition = input_get_disposition(dev, type, code, value); |
492 |
++ disposition = input_get_disposition(dev, type, code, &value); |
493 |
+ |
494 |
+ if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event) |
495 |
+ dev->event(dev, type, code, value); |
496 |
+diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c |
497 |
+index 36eb27d3fdf1..def7812d7b22 100644 |
498 |
+--- a/drivers/media/dvb-frontends/tda10071.c |
499 |
++++ b/drivers/media/dvb-frontends/tda10071.c |
500 |
+@@ -667,6 +667,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) |
501 |
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
502 |
+ int ret, i; |
503 |
+ u8 mode, rolloff, pilot, inversion, div; |
504 |
++ fe_modulation_t modulation; |
505 |
+ |
506 |
+ dev_dbg(&priv->i2c->dev, "%s: delivery_system=%d modulation=%d " \ |
507 |
+ "frequency=%d symbol_rate=%d inversion=%d pilot=%d " \ |
508 |
+@@ -701,10 +702,13 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) |
509 |
+ |
510 |
+ switch (c->delivery_system) { |
511 |
+ case SYS_DVBS: |
512 |
++ modulation = QPSK; |
513 |
+ rolloff = 0; |
514 |
+ pilot = 2; |
515 |
+ break; |
516 |
+ case SYS_DVBS2: |
517 |
++ modulation = c->modulation; |
518 |
++ |
519 |
+ switch (c->rolloff) { |
520 |
+ case ROLLOFF_20: |
521 |
+ rolloff = 2; |
522 |
+@@ -749,7 +753,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) |
523 |
+ |
524 |
+ for (i = 0, mode = 0xff; i < ARRAY_SIZE(TDA10071_MODCOD); i++) { |
525 |
+ if (c->delivery_system == TDA10071_MODCOD[i].delivery_system && |
526 |
+- c->modulation == TDA10071_MODCOD[i].modulation && |
527 |
++ modulation == TDA10071_MODCOD[i].modulation && |
528 |
+ c->fec_inner == TDA10071_MODCOD[i].fec) { |
529 |
+ mode = TDA10071_MODCOD[i].val; |
530 |
+ dev_dbg(&priv->i2c->dev, "%s: mode found=%02x\n", |
531 |
+diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c |
532 |
+index 774ba0e820be..eed70a4d24e6 100644 |
533 |
+--- a/drivers/media/usb/hdpvr/hdpvr-video.c |
534 |
++++ b/drivers/media/usb/hdpvr/hdpvr-video.c |
535 |
+@@ -81,7 +81,7 @@ static void hdpvr_read_bulk_callback(struct urb *urb) |
536 |
+ } |
537 |
+ |
538 |
+ /*=========================================================================*/ |
539 |
+-/* bufffer bits */ |
540 |
++/* buffer bits */ |
541 |
+ |
542 |
+ /* function expects dev->io_mutex to be hold by caller */ |
543 |
+ int hdpvr_cancel_queue(struct hdpvr_device *dev) |
544 |
+@@ -921,7 +921,7 @@ static int hdpvr_s_ctrl(struct v4l2_ctrl *ctrl) |
545 |
+ case V4L2_CID_MPEG_AUDIO_ENCODING: |
546 |
+ if (dev->flags & HDPVR_FLAG_AC3_CAP) { |
547 |
+ opt->audio_codec = ctrl->val; |
548 |
+- return hdpvr_set_audio(dev, opt->audio_input, |
549 |
++ return hdpvr_set_audio(dev, opt->audio_input + 1, |
550 |
+ opt->audio_codec); |
551 |
+ } |
552 |
+ return 0; |
553 |
+@@ -1191,7 +1191,7 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent, |
554 |
+ v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, |
555 |
+ V4L2_CID_MPEG_AUDIO_ENCODING, |
556 |
+ ac3 ? V4L2_MPEG_AUDIO_ENCODING_AC3 : V4L2_MPEG_AUDIO_ENCODING_AAC, |
557 |
+- 0x7, V4L2_MPEG_AUDIO_ENCODING_AAC); |
558 |
++ 0x7, ac3 ? dev->options.audio_codec : V4L2_MPEG_AUDIO_ENCODING_AAC); |
559 |
+ v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, |
560 |
+ V4L2_CID_MPEG_VIDEO_ENCODING, |
561 |
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 0x3, |
562 |
+diff --git a/fs/coredump.c b/fs/coredump.c |
563 |
+index dafafbafa731..1d402ce5b72f 100644 |
564 |
+--- a/fs/coredump.c |
565 |
++++ b/fs/coredump.c |
566 |
+@@ -299,7 +299,7 @@ static int zap_threads(struct task_struct *tsk, struct mm_struct *mm, |
567 |
+ if (unlikely(nr < 0)) |
568 |
+ return nr; |
569 |
+ |
570 |
+- tsk->flags = PF_DUMPCORE; |
571 |
++ tsk->flags |= PF_DUMPCORE; |
572 |
+ if (atomic_read(&mm->mm_users) == nr + 1) |
573 |
+ goto done; |
574 |
+ /* |
575 |
+diff --git a/include/linux/libata.h b/include/linux/libata.h |
576 |
+index eec130af2dfa..cc82cfb66259 100644 |
577 |
+--- a/include/linux/libata.h |
578 |
++++ b/include/linux/libata.h |
579 |
+@@ -547,6 +547,7 @@ struct ata_host { |
580 |
+ struct device *dev; |
581 |
+ void __iomem * const *iomap; |
582 |
+ unsigned int n_ports; |
583 |
++ unsigned int n_tags; /* nr of NCQ tags */ |
584 |
+ void *private_data; |
585 |
+ struct ata_port_operations *ops; |
586 |
+ unsigned long flags; |
587 |
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
588 |
+index 98a830d079b9..18cdf91b2f85 100644 |
589 |
+--- a/kernel/trace/trace.c |
590 |
++++ b/kernel/trace/trace.c |
591 |
+@@ -741,7 +741,7 @@ static struct { |
592 |
+ { trace_clock_local, "local", 1 }, |
593 |
+ { trace_clock_global, "global", 1 }, |
594 |
+ { trace_clock_counter, "counter", 0 }, |
595 |
+- { trace_clock_jiffies, "uptime", 1 }, |
596 |
++ { trace_clock_jiffies, "uptime", 0 }, |
597 |
+ { trace_clock, "perf", 1 }, |
598 |
+ ARCH_TRACE_CLOCKS |
599 |
+ }; |
600 |
+diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c |
601 |
+index 26dc348332b7..57b67b1f24d1 100644 |
602 |
+--- a/kernel/trace/trace_clock.c |
603 |
++++ b/kernel/trace/trace_clock.c |
604 |
+@@ -59,13 +59,14 @@ u64 notrace trace_clock(void) |
605 |
+ |
606 |
+ /* |
607 |
+ * trace_jiffy_clock(): Simply use jiffies as a clock counter. |
608 |
++ * Note that this use of jiffies_64 is not completely safe on |
609 |
++ * 32-bit systems. But the window is tiny, and the effect if |
610 |
++ * we are affected is that we will have an obviously bogus |
611 |
++ * timestamp on a trace event - i.e. not life threatening. |
612 |
+ */ |
613 |
+ u64 notrace trace_clock_jiffies(void) |
614 |
+ { |
615 |
+- u64 jiffy = jiffies - INITIAL_JIFFIES; |
616 |
+- |
617 |
+- /* Return nsecs */ |
618 |
+- return (u64)jiffies_to_usecs(jiffy) * 1000ULL; |
619 |
++ return jiffies_64_to_clock_t(jiffies_64 - INITIAL_JIFFIES); |
620 |
+ } |
621 |
+ |
622 |
+ /* |
623 |
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c |
624 |
+index dbc949c409c7..7de4f67c81fe 100644 |
625 |
+--- a/mm/hugetlb.c |
626 |
++++ b/mm/hugetlb.c |
627 |
+@@ -2400,6 +2400,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, |
628 |
+ } else { |
629 |
+ if (cow) |
630 |
+ huge_ptep_set_wrprotect(src, addr, src_pte); |
631 |
++ entry = huge_ptep_get(src_pte); |
632 |
+ ptepage = pte_page(entry); |
633 |
+ get_page(ptepage); |
634 |
+ page_dup_rmap(ptepage); |
635 |
+diff --git a/mm/slab_common.c b/mm/slab_common.c |
636 |
+index 2d414508e9ec..7d21d3fddbf0 100644 |
637 |
+--- a/mm/slab_common.c |
638 |
++++ b/mm/slab_common.c |
639 |
+@@ -55,6 +55,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name, |
640 |
+ continue; |
641 |
+ } |
642 |
+ |
643 |
++#if !defined(CONFIG_SLUB) |
644 |
+ /* |
645 |
+ * For simplicity, we won't check this in the list of memcg |
646 |
+ * caches. We have control over memcg naming, and if there |
647 |
+@@ -68,6 +69,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name, |
648 |
+ s = NULL; |
649 |
+ return -EINVAL; |
650 |
+ } |
651 |
++#endif |
652 |
+ } |
653 |
+ |
654 |
+ WARN_ON(strchr(name, ' ')); /* It confuses parsers */ |
655 |
+diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c |
656 |
+index 5352b2d2d5bf..2b8199f68785 100644 |
657 |
+--- a/net/netfilter/nfnetlink_queue_core.c |
658 |
++++ b/net/netfilter/nfnetlink_queue_core.c |
659 |
+@@ -227,22 +227,23 @@ nfqnl_flush(struct nfqnl_instance *queue, nfqnl_cmpfn cmpfn, unsigned long data) |
660 |
+ spin_unlock_bh(&queue->lock); |
661 |
+ } |
662 |
+ |
663 |
+-static void |
664 |
++static int |
665 |
+ nfqnl_zcopy(struct sk_buff *to, const struct sk_buff *from, int len, int hlen) |
666 |
+ { |
667 |
+ int i, j = 0; |
668 |
+ int plen = 0; /* length of skb->head fragment */ |
669 |
++ int ret; |
670 |
+ struct page *page; |
671 |
+ unsigned int offset; |
672 |
+ |
673 |
+ /* dont bother with small payloads */ |
674 |
+- if (len <= skb_tailroom(to)) { |
675 |
+- skb_copy_bits(from, 0, skb_put(to, len), len); |
676 |
+- return; |
677 |
+- } |
678 |
++ if (len <= skb_tailroom(to)) |
679 |
++ return skb_copy_bits(from, 0, skb_put(to, len), len); |
680 |
+ |
681 |
+ if (hlen) { |
682 |
+- skb_copy_bits(from, 0, skb_put(to, hlen), hlen); |
683 |
++ ret = skb_copy_bits(from, 0, skb_put(to, hlen), hlen); |
684 |
++ if (unlikely(ret)) |
685 |
++ return ret; |
686 |
+ len -= hlen; |
687 |
+ } else { |
688 |
+ plen = min_t(int, skb_headlen(from), len); |
689 |
+@@ -260,6 +261,11 @@ nfqnl_zcopy(struct sk_buff *to, const struct sk_buff *from, int len, int hlen) |
690 |
+ to->len += len + plen; |
691 |
+ to->data_len += len + plen; |
692 |
+ |
693 |
++ if (unlikely(skb_orphan_frags(from, GFP_ATOMIC))) { |
694 |
++ skb_tx_error(from); |
695 |
++ return -ENOMEM; |
696 |
++ } |
697 |
++ |
698 |
+ for (i = 0; i < skb_shinfo(from)->nr_frags; i++) { |
699 |
+ if (!len) |
700 |
+ break; |
701 |
+@@ -270,6 +276,8 @@ nfqnl_zcopy(struct sk_buff *to, const struct sk_buff *from, int len, int hlen) |
702 |
+ j++; |
703 |
+ } |
704 |
+ skb_shinfo(to)->nr_frags = j; |
705 |
++ |
706 |
++ return 0; |
707 |
+ } |
708 |
+ |
709 |
+ static int nfqnl_put_packet_info(struct sk_buff *nlskb, struct sk_buff *packet) |
710 |
+@@ -355,13 +363,16 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue, |
711 |
+ |
712 |
+ skb = nfnetlink_alloc_skb(&init_net, size, queue->peer_portid, |
713 |
+ GFP_ATOMIC); |
714 |
+- if (!skb) |
715 |
++ if (!skb) { |
716 |
++ skb_tx_error(entskb); |
717 |
+ return NULL; |
718 |
++ } |
719 |
+ |
720 |
+ nlh = nlmsg_put(skb, 0, 0, |
721 |
+ NFNL_SUBSYS_QUEUE << 8 | NFQNL_MSG_PACKET, |
722 |
+ sizeof(struct nfgenmsg), 0); |
723 |
+ if (!nlh) { |
724 |
++ skb_tx_error(entskb); |
725 |
+ kfree_skb(skb); |
726 |
+ return NULL; |
727 |
+ } |
728 |
+@@ -481,13 +492,15 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue, |
729 |
+ nla->nla_type = NFQA_PAYLOAD; |
730 |
+ nla->nla_len = nla_attr_size(data_len); |
731 |
+ |
732 |
+- nfqnl_zcopy(skb, entskb, data_len, hlen); |
733 |
++ if (nfqnl_zcopy(skb, entskb, data_len, hlen)) |
734 |
++ goto nla_put_failure; |
735 |
+ } |
736 |
+ |
737 |
+ nlh->nlmsg_len = skb->len; |
738 |
+ return skb; |
739 |
+ |
740 |
+ nla_put_failure: |
741 |
++ skb_tx_error(entskb); |
742 |
+ kfree_skb(skb); |
743 |
+ net_err_ratelimited("nf_queue: error creating packet message\n"); |
744 |
+ return NULL; |