Magellan Linux

Contents of /trunk/kernel26-magellan-server/patches-2.6.31-r3/0103-2.6.31.4-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 946 - (show annotations) (download)
Thu Dec 10 13:02:09 2009 UTC (14 years, 4 months ago) by niro
File size: 41817 byte(s)
-2.6.31-magellan-r3: updated to linux-2.6.31.7

1 diff --git a/Documentation/networking/timestamping/timestamping.c b/Documentation/networking/timestamping/timestamping.c
2 index 43d1431..a7936fe 100644
3 --- a/Documentation/networking/timestamping/timestamping.c
4 +++ b/Documentation/networking/timestamping/timestamping.c
5 @@ -381,7 +381,7 @@ int main(int argc, char **argv)
6 memset(&hwtstamp, 0, sizeof(hwtstamp));
7 strncpy(hwtstamp.ifr_name, interface, sizeof(hwtstamp.ifr_name));
8 hwtstamp.ifr_data = (void *)&hwconfig;
9 - memset(&hwconfig, 0, sizeof(&hwconfig));
10 + memset(&hwconfig, 0, sizeof(hwconfig));
11 hwconfig.tx_type =
12 (so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ?
13 HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
14 diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
15 index e590261..d76b026 100644
16 --- a/arch/x86/ia32/ia32entry.S
17 +++ b/arch/x86/ia32/ia32entry.S
18 @@ -21,8 +21,8 @@
19 #define __AUDIT_ARCH_LE 0x40000000
20
21 #ifndef CONFIG_AUDITSYSCALL
22 -#define sysexit_audit int_ret_from_sys_call
23 -#define sysretl_audit int_ret_from_sys_call
24 +#define sysexit_audit ia32_ret_from_sys_call
25 +#define sysretl_audit ia32_ret_from_sys_call
26 #endif
27
28 #define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
29 @@ -39,12 +39,12 @@
30 .endm
31
32 /* clobbers %eax */
33 - .macro CLEAR_RREGS _r9=rax
34 + .macro CLEAR_RREGS offset=0, _r9=rax
35 xorl %eax,%eax
36 - movq %rax,R11(%rsp)
37 - movq %rax,R10(%rsp)
38 - movq %\_r9,R9(%rsp)
39 - movq %rax,R8(%rsp)
40 + movq %rax,\offset+R11(%rsp)
41 + movq %rax,\offset+R10(%rsp)
42 + movq %\_r9,\offset+R9(%rsp)
43 + movq %rax,\offset+R8(%rsp)
44 .endm
45
46 /*
47 @@ -172,6 +172,10 @@ sysexit_from_sys_call:
48 movl RIP-R11(%rsp),%edx /* User %eip */
49 CFI_REGISTER rip,rdx
50 RESTORE_ARGS 1,24,1,1,1,1
51 + xorq %r8,%r8
52 + xorq %r9,%r9
53 + xorq %r10,%r10
54 + xorq %r11,%r11
55 popfq
56 CFI_ADJUST_CFA_OFFSET -8
57 /*CFI_RESTORE rflags*/
58 @@ -202,7 +206,7 @@ sysexit_from_sys_call:
59
60 .macro auditsys_exit exit,ebpsave=RBP
61 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
62 - jnz int_ret_from_sys_call
63 + jnz ia32_ret_from_sys_call
64 TRACE_IRQS_ON
65 sti
66 movl %eax,%esi /* second arg, syscall return value */
67 @@ -218,8 +222,9 @@ sysexit_from_sys_call:
68 cli
69 TRACE_IRQS_OFF
70 testl %edi,TI_flags(%r10)
71 - jnz int_with_check
72 - jmp \exit
73 + jz \exit
74 + CLEAR_RREGS -ARGOFFSET
75 + jmp int_with_check
76 .endm
77
78 sysenter_auditsys:
79 @@ -329,6 +334,9 @@ sysretl_from_sys_call:
80 CFI_REGISTER rip,rcx
81 movl EFLAGS-ARGOFFSET(%rsp),%r11d
82 /*CFI_REGISTER rflags,r11*/
83 + xorq %r10,%r10
84 + xorq %r9,%r9
85 + xorq %r8,%r8
86 TRACE_IRQS_ON
87 movl RSP-ARGOFFSET(%rsp),%esp
88 CFI_RESTORE rsp
89 @@ -353,7 +361,7 @@ cstar_tracesys:
90 #endif
91 xchgl %r9d,%ebp
92 SAVE_REST
93 - CLEAR_RREGS r9
94 + CLEAR_RREGS 0, r9
95 movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
96 movq %rsp,%rdi /* &pt_regs -> arg1 */
97 call syscall_trace_enter
98 @@ -425,6 +433,8 @@ ia32_do_call:
99 call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
100 ia32_sysret:
101 movq %rax,RAX-ARGOFFSET(%rsp)
102 +ia32_ret_from_sys_call:
103 + CLEAR_RREGS -ARGOFFSET
104 jmp int_ret_from_sys_call
105
106 ia32_tracesys:
107 @@ -442,8 +452,8 @@ END(ia32_syscall)
108
109 ia32_badsys:
110 movq $0,ORIG_RAX-ARGOFFSET(%rsp)
111 - movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
112 - jmp int_ret_from_sys_call
113 + movq $-ENOSYS,%rax
114 + jmp ia32_sysret
115
116 quiet_ni_syscall:
117 movq $-ENOSYS,%rax
118 diff --git a/arch/x86/include/asm/checksum_32.h b/arch/x86/include/asm/checksum_32.h
119 index 7c5ef8b..46fc474 100644
120 --- a/arch/x86/include/asm/checksum_32.h
121 +++ b/arch/x86/include/asm/checksum_32.h
122 @@ -161,7 +161,8 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
123 "adcl $0, %0 ;\n"
124 : "=&r" (sum)
125 : "r" (saddr), "r" (daddr),
126 - "r" (htonl(len)), "r" (htonl(proto)), "0" (sum));
127 + "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
128 + : "memory");
129
130 return csum_fold(sum);
131 }
132 diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
133 index 8c44c23..59cdfa4 100644
134 --- a/arch/x86/kernel/acpi/cstate.c
135 +++ b/arch/x86/kernel/acpi/cstate.c
136 @@ -48,7 +48,7 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
137 * P4, Core and beyond CPUs
138 */
139 if (c->x86_vendor == X86_VENDOR_INTEL &&
140 - (c->x86 > 0x6 || (c->x86 == 6 && c->x86_model >= 14)))
141 + (c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 14)))
142 flags->bm_control = 0;
143 }
144 EXPORT_SYMBOL(acpi_processor_power_init_bm_check);
145 diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
146 index 5cf36c0..da890f0 100644
147 --- a/arch/x86/kernel/i8253.c
148 +++ b/arch/x86/kernel/i8253.c
149 @@ -21,8 +21,10 @@ EXPORT_SYMBOL(i8253_lock);
150
151 #ifdef CONFIG_X86_32
152 static void pit_disable_clocksource(void);
153 +static void pit_enable_clocksource(void);
154 #else
155 static inline void pit_disable_clocksource(void) { }
156 +static inline void pit_enable_clocksource(void) { }
157 #endif
158
159 /*
160 @@ -67,7 +69,7 @@ static void init_pit_timer(enum clock_event_mode mode,
161 break;
162
163 case CLOCK_EVT_MODE_RESUME:
164 - /* Nothing to do here */
165 + pit_enable_clocksource();
166 break;
167 }
168 spin_unlock(&i8253_lock);
169 @@ -200,19 +202,27 @@ static struct clocksource pit_cs = {
170 .shift = 20,
171 };
172
173 +int pit_cs_registered;
174 static void pit_disable_clocksource(void)
175 {
176 - /*
177 - * Use mult to check whether it is registered or not
178 - */
179 - if (pit_cs.mult) {
180 + if (pit_cs_registered) {
181 clocksource_unregister(&pit_cs);
182 - pit_cs.mult = 0;
183 + pit_cs_registered = 0;
184 + }
185 +}
186 +
187 +static void pit_enable_clocksource(void)
188 +{
189 + if (!pit_cs_registered && !clocksource_register(&pit_cs)) {
190 + pit_cs_registered = 1;
191 }
192 }
193
194 +
195 +
196 static int __init init_pit_clocksource(void)
197 {
198 + int ret;
199 /*
200 * Several reasons not to register PIT as a clocksource:
201 *
202 @@ -226,7 +236,10 @@ static int __init init_pit_clocksource(void)
203
204 pit_cs.mult = clocksource_hz2mult(CLOCK_TICK_RATE, pit_cs.shift);
205
206 - return clocksource_register(&pit_cs);
207 + ret = clocksource_register(&pit_cs);
208 + if (!ret)
209 + pit_cs_registered = 1;
210 + return ret;
211 }
212 arch_initcall(init_pit_clocksource);
213
214 diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
215 index bb6277d..b225176 100644
216 --- a/arch/x86/kvm/lapic.c
217 +++ b/arch/x86/kvm/lapic.c
218 @@ -567,7 +567,7 @@ static void start_apic_timer(struct kvm_lapic *apic)
219 {
220 ktime_t now = apic->lapic_timer.timer.base->get_time();
221
222 - apic->lapic_timer.period = apic_get_reg(apic, APIC_TMICT) *
223 + apic->lapic_timer.period = (u64)apic_get_reg(apic, APIC_TMICT) *
224 APIC_BUS_CYCLE_NS * apic->divide_count;
225 atomic_set(&apic->lapic_timer.pending, 0);
226
227 diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
228 index b1f658a..4ac6899 100644
229 --- a/arch/x86/kvm/svm.c
230 +++ b/arch/x86/kvm/svm.c
231 @@ -709,6 +709,8 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
232 rdtscll(tsc_this);
233 delta = vcpu->arch.host_tsc - tsc_this;
234 svm->vmcb->control.tsc_offset += delta;
235 + if (is_nested(svm))
236 + svm->hsave->control.tsc_offset += delta;
237 vcpu->cpu = cpu;
238 kvm_migrate_timers(vcpu);
239 svm->asid_generation = 0;
240 @@ -1954,10 +1956,14 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
241
242 switch (ecx) {
243 case MSR_IA32_TIME_STAMP_COUNTER: {
244 - u64 tsc;
245 + u64 tsc_offset;
246
247 - rdtscll(tsc);
248 - *data = svm->vmcb->control.tsc_offset + tsc;
249 + if (is_nested(svm))
250 + tsc_offset = svm->hsave->control.tsc_offset;
251 + else
252 + tsc_offset = svm->vmcb->control.tsc_offset;
253 +
254 + *data = tsc_offset + native_read_tsc();
255 break;
256 }
257 case MSR_K6_STAR:
258 @@ -2044,10 +2050,17 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
259
260 switch (ecx) {
261 case MSR_IA32_TIME_STAMP_COUNTER: {
262 - u64 tsc;
263 + u64 tsc_offset = data - native_read_tsc();
264 + u64 g_tsc_offset = 0;
265 +
266 + if (is_nested(svm)) {
267 + g_tsc_offset = svm->vmcb->control.tsc_offset -
268 + svm->hsave->control.tsc_offset;
269 + svm->hsave->control.tsc_offset = tsc_offset;
270 + }
271 +
272 + svm->vmcb->control.tsc_offset = tsc_offset + g_tsc_offset;
273
274 - rdtscll(tsc);
275 - svm->vmcb->control.tsc_offset = data - tsc;
276 break;
277 }
278 case MSR_K6_STAR:
279 diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
280 index 6a768ff..ff72e4d 100644
281 --- a/arch/x86/kvm/vmx.c
282 +++ b/arch/x86/kvm/vmx.c
283 @@ -661,7 +661,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
284 if (vcpu->cpu != cpu) {
285 vcpu_clear(vmx);
286 kvm_migrate_timers(vcpu);
287 - vpid_sync_vcpu_all(vmx);
288 + set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests);
289 local_irq_disable();
290 list_add(&vmx->local_vcpus_link,
291 &per_cpu(vcpus_on_cpu, cpu));
292 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
293 index 91a077f..8aafb62 100644
294 --- a/arch/x86/kvm/x86.c
295 +++ b/arch/x86/kvm/x86.c
296 @@ -1429,6 +1429,8 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
297
298 if (cpuid->nent < 1)
299 goto out;
300 + if (cpuid->nent > KVM_MAX_CPUID_ENTRIES)
301 + cpuid->nent = KVM_MAX_CPUID_ENTRIES;
302 r = -ENOMEM;
303 cpuid_entries = vmalloc(sizeof(struct kvm_cpuid_entry2) * cpuid->nent);
304 if (!cpuid_entries)
305 diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
306 index 5691f16..8dff236 100644
307 --- a/drivers/acpi/osl.c
308 +++ b/drivers/acpi/osl.c
309 @@ -1182,7 +1182,13 @@ int acpi_check_resource_conflict(struct resource *res)
310 res_list_elem->name,
311 (long long) res_list_elem->start,
312 (long long) res_list_elem->end);
313 - printk(KERN_INFO "ACPI: Device needs an ACPI driver\n");
314 + if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX)
315 + printk(KERN_NOTICE "ACPI: This conflict may"
316 + " cause random problems and system"
317 + " instability\n");
318 + printk(KERN_INFO "ACPI: If an ACPI driver is available"
319 + " for this device, you should use it instead of"
320 + " the native driver\n");
321 }
322 if (acpi_enforce_resources == ENFORCE_RESOURCES_STRICT)
323 return -EBUSY;
324 diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
325 index 79711b6..c644fec 100644
326 --- a/drivers/ata/libata-eh.c
327 +++ b/drivers/ata/libata-eh.c
328 @@ -2541,14 +2541,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
329 dev->pio_mode = XFER_PIO_0;
330 dev->flags &= ~ATA_DFLAG_SLEEPING;
331
332 - if (!ata_phys_link_offline(ata_dev_phys_link(dev))) {
333 - /* apply class override */
334 - if (lflags & ATA_LFLAG_ASSUME_ATA)
335 - classes[dev->devno] = ATA_DEV_ATA;
336 - else if (lflags & ATA_LFLAG_ASSUME_SEMB)
337 - classes[dev->devno] = ATA_DEV_SEMB_UNSUP;
338 - } else
339 - classes[dev->devno] = ATA_DEV_NONE;
340 + if (ata_phys_link_offline(ata_dev_phys_link(dev)))
341 + continue;
342 +
343 + /* apply class override */
344 + if (lflags & ATA_LFLAG_ASSUME_ATA)
345 + classes[dev->devno] = ATA_DEV_ATA;
346 + else if (lflags & ATA_LFLAG_ASSUME_SEMB)
347 + classes[dev->devno] = ATA_DEV_SEMB_UNSUP;
348 }
349
350 /* record current link speed */
351 @@ -2581,34 +2581,48 @@ int ata_eh_reset(struct ata_link *link, int classify,
352 slave->eh_info.serror = 0;
353 spin_unlock_irqrestore(link->ap->lock, flags);
354
355 - /* Make sure onlineness and classification result correspond.
356 + /*
357 + * Make sure onlineness and classification result correspond.
358 * Hotplug could have happened during reset and some
359 * controllers fail to wait while a drive is spinning up after
360 * being hotplugged causing misdetection. By cross checking
361 - * link onlineness and classification result, those conditions
362 - * can be reliably detected and retried.
363 + * link on/offlineness and classification result, those
364 + * conditions can be reliably detected and retried.
365 */
366 nr_unknown = 0;
367 ata_for_each_dev(dev, link, ALL) {
368 - /* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */
369 - if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
370 - classes[dev->devno] = ATA_DEV_NONE;
371 - if (ata_phys_link_online(ata_dev_phys_link(dev)))
372 + if (ata_phys_link_online(ata_dev_phys_link(dev))) {
373 + if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
374 + ata_dev_printk(dev, KERN_DEBUG, "link online "
375 + "but device misclassifed\n");
376 + classes[dev->devno] = ATA_DEV_NONE;
377 nr_unknown++;
378 + }
379 + } else if (ata_phys_link_offline(ata_dev_phys_link(dev))) {
380 + if (ata_class_enabled(classes[dev->devno]))
381 + ata_dev_printk(dev, KERN_DEBUG, "link offline, "
382 + "clearing class %d to NONE\n",
383 + classes[dev->devno]);
384 + classes[dev->devno] = ATA_DEV_NONE;
385 + } else if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
386 + ata_dev_printk(dev, KERN_DEBUG, "link status unknown, "
387 + "clearing UNKNOWN to NONE\n");
388 + classes[dev->devno] = ATA_DEV_NONE;
389 }
390 }
391
392 if (classify && nr_unknown) {
393 if (try < max_tries) {
394 ata_link_printk(link, KERN_WARNING, "link online but "
395 - "device misclassified, retrying\n");
396 + "%d devices misclassified, retrying\n",
397 + nr_unknown);
398 failed_link = link;
399 rc = -EAGAIN;
400 goto fail;
401 }
402 ata_link_printk(link, KERN_WARNING,
403 - "link online but device misclassified, "
404 - "device detection might fail\n");
405 + "link online but %d devices misclassified, "
406 + "device detection might fail\n", nr_unknown);
407 }
408
409 /* reset successful, schedule revalidation */
410 diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
411 index e48af9f..414372a 100644
412 --- a/drivers/char/tty_ldisc.c
413 +++ b/drivers/char/tty_ldisc.c
414 @@ -516,7 +516,7 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old)
415 static int tty_ldisc_halt(struct tty_struct *tty)
416 {
417 clear_bit(TTY_LDISC, &tty->flags);
418 - return cancel_delayed_work(&tty->buf.work);
419 + return cancel_delayed_work_sync(&tty->buf.work);
420 }
421
422 /**
423 @@ -754,12 +754,9 @@ void tty_ldisc_hangup(struct tty_struct *tty)
424 * N_TTY.
425 */
426 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
427 - /* Make sure the old ldisc is quiescent */
428 - tty_ldisc_halt(tty);
429 - flush_scheduled_work();
430 -
431 /* Avoid racing set_ldisc or tty_ldisc_release */
432 mutex_lock(&tty->ldisc_mutex);
433 + tty_ldisc_halt(tty);
434 if (tty->ldisc) { /* Not yet closed */
435 /* Switch back to N_TTY */
436 tty_ldisc_reinit(tty);
437 diff --git a/drivers/ide/sis5513.c b/drivers/ide/sis5513.c
438 index afca22b..3b88eba 100644
439 --- a/drivers/ide/sis5513.c
440 +++ b/drivers/ide/sis5513.c
441 @@ -2,7 +2,7 @@
442 * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
443 * Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer
444 * Copyright (C) 2003 Vojtech Pavlik <vojtech@suse.cz>
445 - * Copyright (C) 2007 Bartlomiej Zolnierkiewicz
446 + * Copyright (C) 2007-2009 Bartlomiej Zolnierkiewicz
447 *
448 * May be copied or modified under the terms of the GNU General Public License
449 *
450 @@ -281,11 +281,13 @@ static void config_drive_art_rwp(ide_drive_t *drive)
451
452 pci_read_config_byte(dev, 0x4b, &reg4bh);
453
454 + rw_prefetch = reg4bh & ~(0x11 << drive->dn);
455 +
456 if (drive->media == ide_disk)
457 - rw_prefetch = 0x11 << drive->dn;
458 + rw_prefetch |= 0x11 << drive->dn;
459
460 - if ((reg4bh & (0x11 << drive->dn)) != rw_prefetch)
461 - pci_write_config_byte(dev, 0x4b, reg4bh|rw_prefetch);
462 + if (reg4bh != rw_prefetch)
463 + pci_write_config_byte(dev, 0x4b, rw_prefetch);
464 }
465
466 static void sis_set_pio_mode(ide_drive_t *drive, const u8 pio)
467 diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
468 index 78cea5e..bf9ab65 100644
469 --- a/drivers/net/appletalk/ipddp.c
470 +++ b/drivers/net/appletalk/ipddp.c
471 @@ -176,8 +176,7 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
472 dev->stats.tx_packets++;
473 dev->stats.tx_bytes += skb->len;
474
475 - if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0)
476 - dev_kfree_skb(skb);
477 + aarp_send_ddp(rt->dev, skb, &rt->at, NULL);
478
479 spin_unlock(&ipddp_route_lock);
480
481 diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
482 index e44215c..9048718 100644
483 --- a/drivers/net/iseries_veth.c
484 +++ b/drivers/net/iseries_veth.c
485 @@ -495,7 +495,7 @@ static void veth_take_cap_ack(struct veth_lpar_connection *cnx,
486 cnx->remote_lp);
487 } else {
488 memcpy(&cnx->cap_ack_event, event,
489 - sizeof(&cnx->cap_ack_event));
490 + sizeof(cnx->cap_ack_event));
491 cnx->state |= VETH_STATE_GOTCAPACK;
492 veth_kick_statemachine(cnx);
493 }
494 diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
495 index 0a551d8..a606e7f 100644
496 --- a/drivers/net/sky2.c
497 +++ b/drivers/net/sky2.c
498 @@ -1455,7 +1455,6 @@ static int sky2_up(struct net_device *dev)
499 if (ramsize > 0) {
500 u32 rxspace;
501
502 - hw->flags |= SKY2_HW_RAM_BUFFER;
503 pr_debug(PFX "%s: ram buffer %dK\n", dev->name, ramsize);
504 if (ramsize < 16)
505 rxspace = ramsize / 2;
506 @@ -2942,6 +2941,9 @@ static int __devinit sky2_init(struct sky2_hw *hw)
507 ++hw->ports;
508 }
509
510 + if (sky2_read8(hw, B2_E_0))
511 + hw->flags |= SKY2_HW_RAM_BUFFER;
512 +
513 return 0;
514 }
515
516 diff --git a/drivers/net/tun.c b/drivers/net/tun.c
517 index 42b6c63..156f59b 100644
518 --- a/drivers/net/tun.c
519 +++ b/drivers/net/tun.c
520 @@ -943,8 +943,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
521 char *name;
522 unsigned long flags = 0;
523
524 - err = -EINVAL;
525 -
526 if (!capable(CAP_NET_ADMIN))
527 return -EPERM;
528
529 @@ -958,7 +956,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
530 flags |= TUN_TAP_DEV;
531 name = "tap%d";
532 } else
533 - goto failed;
534 + return -EINVAL;
535
536 if (*ifr->ifr_name)
537 name = ifr->ifr_name;
538 diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
539 index fe04589..df49d0d 100644
540 --- a/drivers/net/usb/smsc95xx.c
541 +++ b/drivers/net/usb/smsc95xx.c
542 @@ -1232,7 +1232,7 @@ static const struct driver_info smsc95xx_info = {
543 .rx_fixup = smsc95xx_rx_fixup,
544 .tx_fixup = smsc95xx_tx_fixup,
545 .status = smsc95xx_status,
546 - .flags = FLAG_ETHER,
547 + .flags = FLAG_ETHER | FLAG_SEND_ZLP,
548 };
549
550 static const struct usb_device_id products[] = {
551 diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
552 index edfd9e1..d49df73 100644
553 --- a/drivers/net/usb/usbnet.c
554 +++ b/drivers/net/usb/usbnet.c
555 @@ -988,7 +988,7 @@ int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
556 * NOTE: strictly conforming cdc-ether devices should expect
557 * the ZLP here, but ignore the one-byte packet.
558 */
559 - if ((length % dev->maxpacket) == 0) {
560 + if (!(info->flags & FLAG_SEND_ZLP) && (length % dev->maxpacket) == 0) {
561 urb->transfer_buffer_length++;
562 if (skb_tailroom(skb)) {
563 skb->data[skb->len] = 0;
564 diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
565 index 101fe4c..c6ac85d 100644
566 --- a/fs/ecryptfs/main.c
567 +++ b/fs/ecryptfs/main.c
568 @@ -35,6 +35,7 @@
569 #include <linux/key.h>
570 #include <linux/parser.h>
571 #include <linux/fs_stack.h>
572 +#include <linux/ima.h>
573 #include "ecryptfs_kernel.h"
574
575 /**
576 @@ -118,6 +119,7 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
577 const struct cred *cred = current_cred();
578 struct ecryptfs_inode_info *inode_info =
579 ecryptfs_inode_to_private(ecryptfs_dentry->d_inode);
580 + int opened_lower_file = 0;
581 int rc = 0;
582
583 mutex_lock(&inode_info->lower_file_mutex);
584 @@ -134,9 +136,12 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
585 "for lower_dentry [0x%p] and lower_mnt [0x%p]; "
586 "rc = [%d]\n", lower_dentry, lower_mnt, rc);
587 inode_info->lower_file = NULL;
588 - }
589 + } else
590 + opened_lower_file = 1;
591 }
592 mutex_unlock(&inode_info->lower_file_mutex);
593 + if (opened_lower_file)
594 + ima_counts_get(inode_info->lower_file);
595 return rc;
596 }
597
598 diff --git a/fs/namei.c b/fs/namei.c
599 index 1f13751..fcfc553 100644
600 --- a/fs/namei.c
601 +++ b/fs/namei.c
602 @@ -1533,9 +1533,11 @@ int may_open(struct path *path, int acc_mode, int flag)
603 if (error)
604 return error;
605
606 - error = ima_path_check(path,
607 - acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC),
608 + error = ima_path_check(path, acc_mode ?
609 + acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC) :
610 + ACC_MODE(flag) & (MAY_READ | MAY_WRITE),
611 IMA_COUNT_UPDATE);
612 +
613 if (error)
614 return error;
615 /*
616 diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
617 index dc3b132..708085a 100644
618 --- a/include/linux/ftrace.h
619 +++ b/include/linux/ftrace.h
620 @@ -241,7 +241,7 @@ extern void ftrace_enable_daemon(void);
621 # define ftrace_set_filter(buf, len, reset) do { } while (0)
622 # define ftrace_disable_daemon() do { } while (0)
623 # define ftrace_enable_daemon() do { } while (0)
624 -static inline void ftrace_release(void *start, unsigned long size) { }
625 +static inline void ftrace_release_mod(struct module *mod) {}
626 static inline int register_ftrace_command(struct ftrace_func_command *cmd)
627 {
628 return -EINVAL;
629 diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
630 index 310e18a..c42eeb3 100644
631 --- a/include/linux/usb/usbnet.h
632 +++ b/include/linux/usb/usbnet.h
633 @@ -86,6 +86,7 @@ struct driver_info {
634
635 #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */
636 #define FLAG_WLAN 0x0080 /* use "wlan%d" names */
637 +#define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */
638
639
640 /* init device ... can sleep, or cause probe() failure */
641 diff --git a/kernel/exit.c b/kernel/exit.c
642 index 869dc22..b8606f0 100644
643 --- a/kernel/exit.c
644 +++ b/kernel/exit.c
645 @@ -987,8 +987,6 @@ NORET_TYPE void do_exit(long code)
646 tsk->mempolicy = NULL;
647 #endif
648 #ifdef CONFIG_FUTEX
649 - if (unlikely(!list_empty(&tsk->pi_state_list)))
650 - exit_pi_state_list(tsk);
651 if (unlikely(current->pi_state_cache))
652 kfree(current->pi_state_cache);
653 #endif
654 diff --git a/kernel/fork.c b/kernel/fork.c
655 index e6c04d4..4b36858 100644
656 --- a/kernel/fork.c
657 +++ b/kernel/fork.c
658 @@ -544,12 +544,18 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
659
660 /* Get rid of any futexes when releasing the mm */
661 #ifdef CONFIG_FUTEX
662 - if (unlikely(tsk->robust_list))
663 + if (unlikely(tsk->robust_list)) {
664 exit_robust_list(tsk);
665 + tsk->robust_list = NULL;
666 + }
667 #ifdef CONFIG_COMPAT
668 - if (unlikely(tsk->compat_robust_list))
669 + if (unlikely(tsk->compat_robust_list)) {
670 compat_exit_robust_list(tsk);
671 + tsk->compat_robust_list = NULL;
672 + }
673 #endif
674 + if (unlikely(!list_empty(&tsk->pi_state_list)))
675 + exit_pi_state_list(tsk);
676 #endif
677
678 /* Get rid of any cached register state */
679 diff --git a/kernel/futex.c b/kernel/futex.c
680 index e18cfbd..2362d06 100644
681 --- a/kernel/futex.c
682 +++ b/kernel/futex.c
683 @@ -912,8 +912,8 @@ retry:
684 hb1 = hash_futex(&key1);
685 hb2 = hash_futex(&key2);
686
687 - double_lock_hb(hb1, hb2);
688 retry_private:
689 + double_lock_hb(hb1, hb2);
690 op_ret = futex_atomic_op_inuser(op, uaddr2);
691 if (unlikely(op_ret < 0)) {
692
693 @@ -2087,7 +2087,6 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
694 * Unqueue the futex_q and determine which it was.
695 */
696 plist_del(&q->list, &q->list.plist);
697 - drop_futex_key_refs(&q->key);
698
699 if (timeout && !timeout->task)
700 ret = -ETIMEDOUT;
701 diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
702 index e0f59a2..89aed59 100644
703 --- a/kernel/time/tick-sched.c
704 +++ b/kernel/time/tick-sched.c
705 @@ -231,6 +231,13 @@ void tick_nohz_stop_sched_tick(int inidle)
706 if (!inidle && !ts->inidle)
707 goto end;
708
709 + /*
710 + * Set ts->inidle unconditionally. Even if the system did not
711 + * switch to NOHZ mode the cpu frequency governers rely on the
712 + * update of the idle time accounting in tick_nohz_start_idle().
713 + */
714 + ts->inidle = 1;
715 +
716 now = tick_nohz_start_idle(ts);
717
718 /*
719 @@ -248,8 +255,6 @@ void tick_nohz_stop_sched_tick(int inidle)
720 if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
721 goto end;
722
723 - ts->inidle = 1;
724 -
725 if (need_resched())
726 goto end;
727
728 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
729 index 25edd5c..52eb251 100644
730 --- a/kernel/trace/ftrace.c
731 +++ b/kernel/trace/ftrace.c
732 @@ -1110,14 +1110,9 @@ static void ftrace_replace_code(int enable)
733 failed = __ftrace_replace_code(rec, enable);
734 if (failed) {
735 rec->flags |= FTRACE_FL_FAILED;
736 - if ((system_state == SYSTEM_BOOTING) ||
737 - !core_kernel_text(rec->ip)) {
738 - ftrace_free_rec(rec);
739 - } else {
740 - ftrace_bug(failed, rec->ip);
741 - /* Stop processing */
742 - return;
743 - }
744 + ftrace_bug(failed, rec->ip);
745 + /* Stop processing */
746 + return;
747 }
748 } while_for_each_ftrace_rec();
749 }
750 @@ -2801,19 +2796,17 @@ static int ftrace_convert_nops(struct module *mod,
751 }
752
753 #ifdef CONFIG_MODULES
754 -void ftrace_release(void *start, void *end)
755 +void ftrace_release_mod(struct module *mod)
756 {
757 struct dyn_ftrace *rec;
758 struct ftrace_page *pg;
759 - unsigned long s = (unsigned long)start;
760 - unsigned long e = (unsigned long)end;
761
762 - if (ftrace_disabled || !start || start == end)
763 + if (ftrace_disabled)
764 return;
765
766 mutex_lock(&ftrace_lock);
767 do_for_each_ftrace_rec(pg, rec) {
768 - if ((rec->ip >= s) && (rec->ip < e)) {
769 + if (within_module_core(rec->ip, mod)) {
770 /*
771 * rec->ip is changed in ftrace_free_rec()
772 * It should not between s and e if record was freed.
773 @@ -2845,9 +2838,7 @@ static int ftrace_module_notify(struct notifier_block *self,
774 mod->num_ftrace_callsites);
775 break;
776 case MODULE_STATE_GOING:
777 - ftrace_release(mod->ftrace_callsites,
778 - mod->ftrace_callsites +
779 - mod->num_ftrace_callsites);
780 + ftrace_release_mod(mod);
781 break;
782 }
783
784 diff --git a/mm/swap_state.c b/mm/swap_state.c
785 index 42cd38e..0313a13 100644
786 --- a/mm/swap_state.c
787 +++ b/mm/swap_state.c
788 @@ -66,10 +66,10 @@ void show_swap_cache_info(void)
789 }
790
791 /*
792 - * add_to_swap_cache resembles add_to_page_cache_locked on swapper_space,
793 + * __add_to_swap_cache resembles add_to_page_cache_locked on swapper_space,
794 * but sets SwapCache flag and private instead of mapping and index.
795 */
796 -int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
797 +static int __add_to_swap_cache(struct page *page, swp_entry_t entry)
798 {
799 int error;
800
801 @@ -77,28 +77,37 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
802 VM_BUG_ON(PageSwapCache(page));
803 VM_BUG_ON(!PageSwapBacked(page));
804
805 + page_cache_get(page);
806 + SetPageSwapCache(page);
807 + set_page_private(page, entry.val);
808 +
809 + spin_lock_irq(&swapper_space.tree_lock);
810 + error = radix_tree_insert(&swapper_space.page_tree, entry.val, page);
811 + if (likely(!error)) {
812 + total_swapcache_pages++;
813 + __inc_zone_page_state(page, NR_FILE_PAGES);
814 + INC_CACHE_INFO(add_total);
815 + }
816 + spin_unlock_irq(&swapper_space.tree_lock);
817 +
818 + if (unlikely(error)) {
819 + set_page_private(page, 0UL);
820 + ClearPageSwapCache(page);
821 + page_cache_release(page);
822 + }
823 +
824 + return error;
825 +}
826 +
827 +
828 +int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
829 +{
830 + int error;
831 +
832 error = radix_tree_preload(gfp_mask);
833 if (!error) {
834 - page_cache_get(page);
835 - SetPageSwapCache(page);
836 - set_page_private(page, entry.val);
837 -
838 - spin_lock_irq(&swapper_space.tree_lock);
839 - error = radix_tree_insert(&swapper_space.page_tree,
840 - entry.val, page);
841 - if (likely(!error)) {
842 - total_swapcache_pages++;
843 - __inc_zone_page_state(page, NR_FILE_PAGES);
844 - INC_CACHE_INFO(add_total);
845 - }
846 - spin_unlock_irq(&swapper_space.tree_lock);
847 + error = __add_to_swap_cache(page, entry);
848 radix_tree_preload_end();
849 -
850 - if (unlikely(error)) {
851 - set_page_private(page, 0UL);
852 - ClearPageSwapCache(page);
853 - page_cache_release(page);
854 - }
855 }
856 return error;
857 }
858 @@ -289,13 +298,24 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
859 }
860
861 /*
862 + * call radix_tree_preload() while we can wait.
863 + */
864 + err = radix_tree_preload(gfp_mask & GFP_KERNEL);
865 + if (err)
866 + break;
867 +
868 + /*
869 * Swap entry may have been freed since our caller observed it.
870 */
871 err = swapcache_prepare(entry);
872 - if (err == -EEXIST) /* seems racy */
873 + if (err == -EEXIST) { /* seems racy */
874 + radix_tree_preload_end();
875 continue;
876 - if (err) /* swp entry is obsolete ? */
877 + }
878 + if (err) { /* swp entry is obsolete ? */
879 + radix_tree_preload_end();
880 break;
881 + }
882
883 /*
884 * Associate the page with swap entry in the swap cache.
885 @@ -307,8 +327,9 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
886 */
887 __set_page_locked(new_page);
888 SetPageSwapBacked(new_page);
889 - err = add_to_swap_cache(new_page, entry, gfp_mask & GFP_KERNEL);
890 + err = __add_to_swap_cache(new_page, entry);
891 if (likely(!err)) {
892 + radix_tree_preload_end();
893 /*
894 * Initiate read into locked page and return.
895 */
896 @@ -316,6 +337,7 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
897 swap_readpage(new_page);
898 return new_page;
899 }
900 + radix_tree_preload_end();
901 ClearPageSwapBacked(new_page);
902 __clear_page_locked(new_page);
903 swapcache_free(entry, NULL);
904 diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
905 index 89f99d3..9d4adfd 100644
906 --- a/net/appletalk/aarp.c
907 +++ b/net/appletalk/aarp.c
908 @@ -599,7 +599,7 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
909
910 /* Non ELAP we cannot do. */
911 if (dev->type != ARPHRD_ETHER)
912 - return -1;
913 + goto free_it;
914
915 skb->dev = dev;
916 skb->protocol = htons(ETH_P_ATALK);
917 @@ -634,7 +634,7 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
918 if (!a) {
919 /* Whoops slipped... good job it's an unreliable protocol 8) */
920 write_unlock_bh(&aarp_lock);
921 - return -1;
922 + goto free_it;
923 }
924
925 /* Set up the queue */
926 @@ -663,15 +663,21 @@ out_unlock:
927 write_unlock_bh(&aarp_lock);
928
929 /* Tell the ddp layer we have taken over for this frame. */
930 - return 0;
931 + goto sent;
932
933 sendit:
934 if (skb->sk)
935 skb->priority = skb->sk->sk_priority;
936 - dev_queue_xmit(skb);
937 + if (dev_queue_xmit(skb))
938 + goto drop;
939 sent:
940 - return 1;
941 + return NET_XMIT_SUCCESS;
942 +free_it:
943 + kfree_skb(skb);
944 +drop:
945 + return NET_XMIT_DROP;
946 }
947 +EXPORT_SYMBOL(aarp_send_ddp);
948
949 /*
950 * An entry in the aarp unresolved queue has become resolved. Send
951 diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
952 index 875eda5..0e16544 100644
953 --- a/net/appletalk/ddp.c
954 +++ b/net/appletalk/ddp.c
955 @@ -1270,8 +1270,10 @@ static int handle_ip_over_ddp(struct sk_buff *skb)
956 struct net_device_stats *stats;
957
958 /* This needs to be able to handle ipddp"N" devices */
959 - if (!dev)
960 - return -ENODEV;
961 + if (!dev) {
962 + kfree_skb(skb);
963 + return NET_RX_DROP;
964 + }
965
966 skb->protocol = htons(ETH_P_IP);
967 skb_pull(skb, 13);
968 @@ -1281,8 +1283,7 @@ static int handle_ip_over_ddp(struct sk_buff *skb)
969 stats = netdev_priv(dev);
970 stats->rx_packets++;
971 stats->rx_bytes += skb->len + 13;
972 - netif_rx(skb); /* Send the SKB up to a higher place. */
973 - return 0;
974 + return netif_rx(skb); /* Send the SKB up to a higher place. */
975 }
976 #else
977 /* make it easy for gcc to optimize this test out, i.e. kill the code */
978 @@ -1290,9 +1291,8 @@ static int handle_ip_over_ddp(struct sk_buff *skb)
979 #define handle_ip_over_ddp(skb) 0
980 #endif
981
982 -static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
983 - struct ddpehdr *ddp, __u16 len_hops,
984 - int origlen)
985 +static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
986 + struct ddpehdr *ddp, __u16 len_hops, int origlen)
987 {
988 struct atalk_route *rt;
989 struct atalk_addr ta;
990 @@ -1359,8 +1359,6 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
991 /* 22 bytes - 12 ether, 2 len, 3 802.2 5 snap */
992 struct sk_buff *nskb = skb_realloc_headroom(skb, 32);
993 kfree_skb(skb);
994 - if (!nskb)
995 - goto out;
996 skb = nskb;
997 } else
998 skb = skb_unshare(skb, GFP_ATOMIC);
999 @@ -1369,12 +1367,18 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
1000 * If the buffer didn't vanish into the lack of space bitbucket we can
1001 * send it.
1002 */
1003 - if (skb && aarp_send_ddp(rt->dev, skb, &ta, NULL) == -1)
1004 - goto free_it;
1005 -out:
1006 - return;
1007 + if (skb == NULL)
1008 + goto drop;
1009 +
1010 + /*
1011 + * It is OK, NET_XMIT_SUCCESS == NET_RX_SUCCESS and
1012 + * NET_XMIT_DROP == NET_RX_DROP
1013 + */
1014 + return aarp_send_ddp(rt->dev, skb, &ta, NULL);
1015 free_it:
1016 kfree_skb(skb);
1017 +drop:
1018 + return NET_RX_DROP;
1019 }
1020
1021 /**
1022 @@ -1404,7 +1408,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
1023
1024 /* Don't mangle buffer if shared */
1025 if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
1026 - goto out;
1027 + goto drop;
1028
1029 /* Size check and make sure header is contiguous */
1030 if (!pskb_may_pull(skb, sizeof(*ddp)))
1031 @@ -1448,8 +1452,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
1032 /* Not ours, so we route the packet via the correct
1033 * AppleTalk iface
1034 */
1035 - atalk_route_packet(skb, dev, ddp, len_hops, origlen);
1036 - goto out;
1037 + return atalk_route_packet(skb, dev, ddp, len_hops, origlen);
1038 }
1039
1040 /* if IP over DDP is not selected this code will be optimized out */
1041 @@ -1472,11 +1475,12 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
1042
1043 if (sock_queue_rcv_skb(sock, skb) < 0)
1044 goto freeit;
1045 -out:
1046 - return 0;
1047 +
1048 + return NET_RX_SUCCESS;
1049 freeit:
1050 kfree_skb(skb);
1051 - goto out;
1052 +drop:
1053 + return NET_RX_DROP;
1054 }
1055
1056 /*
1057 @@ -1652,10 +1656,10 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
1058 if (skb2) {
1059 loopback = 1;
1060 SOCK_DEBUG(sk, "SK %p: send out(copy).\n", sk);
1061 - if (aarp_send_ddp(dev, skb2,
1062 - &usat->sat_addr, NULL) == -1)
1063 - kfree_skb(skb2);
1064 - /* else queued/sent above in the aarp queue */
1065 + /*
1066 + * If it fails it is queued/sent above in the aarp queue
1067 + */
1068 + aarp_send_ddp(dev, skb2, &usat->sat_addr, NULL);
1069 }
1070 }
1071
1072 @@ -1685,9 +1689,10 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
1073 usat = &gsat;
1074 }
1075
1076 - if (aarp_send_ddp(dev, skb, &usat->sat_addr, NULL) == -1)
1077 - kfree_skb(skb);
1078 - /* else queued/sent above in the aarp queue */
1079 + /*
1080 + * If it fails it is queued/sent above in the aarp queue
1081 + */
1082 + aarp_send_ddp(dev, skb, &usat->sat_addr, NULL);
1083 }
1084 SOCK_DEBUG(sk, "SK %p: Done write (%Zd).\n", sk, len);
1085
1086 @@ -1865,7 +1870,6 @@ static struct packet_type ppptalk_packet_type __read_mostly = {
1087 static unsigned char ddp_snap_id[] = { 0x08, 0x00, 0x07, 0x80, 0x9B };
1088
1089 /* Export symbols for use by drivers when AppleTalk is a module */
1090 -EXPORT_SYMBOL(aarp_send_ddp);
1091 EXPORT_SYMBOL(atrtr_get_dev);
1092 EXPORT_SYMBOL(atalk_find_dev_addr);
1093
1094 diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
1095 index f03529c..f8969fe 100644
1096 --- a/net/ax25/af_ax25.c
1097 +++ b/net/ax25/af_ax25.c
1098 @@ -893,7 +893,6 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev)
1099
1100 sock_init_data(NULL, sk);
1101
1102 - sk->sk_destruct = ax25_free_sock;
1103 sk->sk_type = osk->sk_type;
1104 sk->sk_priority = osk->sk_priority;
1105 sk->sk_protocol = osk->sk_protocol;
1106 @@ -931,6 +930,7 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev)
1107 }
1108
1109 sk->sk_protinfo = ax25;
1110 + sk->sk_destruct = ax25_free_sock;
1111 ax25->sk = sk;
1112
1113 return sk;
1114 @@ -1781,8 +1781,8 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1115 ax25_info.idletimer = ax25_display_timer(&ax25->idletimer) / (60 * HZ);
1116 ax25_info.n2count = ax25->n2count;
1117 ax25_info.state = ax25->state;
1118 - ax25_info.rcv_q = sk_wmem_alloc_get(sk);
1119 - ax25_info.snd_q = sk_rmem_alloc_get(sk);
1120 + ax25_info.rcv_q = sk_rmem_alloc_get(sk);
1121 + ax25_info.snd_q = sk_wmem_alloc_get(sk);
1122 ax25_info.vs = ax25->vs;
1123 ax25_info.vr = ax25->vr;
1124 ax25_info.va = ax25->va;
1125 diff --git a/net/core/dev.c b/net/core/dev.c
1126 index 6a94475..a2f575b 100644
1127 --- a/net/core/dev.c
1128 +++ b/net/core/dev.c
1129 @@ -2248,6 +2248,9 @@ int netif_receive_skb(struct sk_buff *skb)
1130 int ret = NET_RX_DROP;
1131 __be16 type;
1132
1133 + if (!skb->tstamp.tv64)
1134 + net_timestamp(skb);
1135 +
1136 if (skb->vlan_tci && vlan_hwaccel_do_receive(skb))
1137 return NET_RX_SUCCESS;
1138
1139 @@ -2255,9 +2258,6 @@ int netif_receive_skb(struct sk_buff *skb)
1140 if (netpoll_receive_skb(skb))
1141 return NET_RX_DROP;
1142
1143 - if (!skb->tstamp.tv64)
1144 - net_timestamp(skb);
1145 -
1146 if (!skb->iif)
1147 skb->iif = skb->dev->ifindex;
1148
1149 diff --git a/net/core/sock.c b/net/core/sock.c
1150 index 7633422..dd120d8 100644
1151 --- a/net/core/sock.c
1152 +++ b/net/core/sock.c
1153 @@ -1218,17 +1218,22 @@ void __init sk_init(void)
1154 void sock_wfree(struct sk_buff *skb)
1155 {
1156 struct sock *sk = skb->sk;
1157 - int res;
1158 + unsigned int len = skb->truesize;
1159
1160 - /* In case it might be waiting for more memory. */
1161 - res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
1162 - if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE))
1163 + if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE)) {
1164 + /*
1165 + * Keep a reference on sk_wmem_alloc, this will be released
1166 + * after sk_write_space() call
1167 + */
1168 + atomic_sub(len - 1, &sk->sk_wmem_alloc);
1169 sk->sk_write_space(sk);
1170 + len = 1;
1171 + }
1172 /*
1173 - * if sk_wmem_alloc reached 0, we are last user and should
1174 - * free this sock, as sk_free() call could not do it.
1175 + * if sk_wmem_alloc reaches 0, we must finish what sk_free()
1176 + * could not do because of in-flight packets
1177 */
1178 - if (res == 0)
1179 + if (atomic_sub_and_test(len, &sk->sk_wmem_alloc))
1180 __sk_free(sk);
1181 }
1182 EXPORT_SYMBOL(sock_wfree);
1183 diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
1184 index f8d67cc..96440e5 100644
1185 --- a/net/ipv4/tcp_minisocks.c
1186 +++ b/net/ipv4/tcp_minisocks.c
1187 @@ -363,7 +363,7 @@ void tcp_twsk_destructor(struct sock *sk)
1188 #ifdef CONFIG_TCP_MD5SIG
1189 struct tcp_timewait_sock *twsk = tcp_twsk(sk);
1190 if (twsk->tw_md5_keylen)
1191 - tcp_put_md5sig_pool();
1192 + tcp_free_md5sig_pool();
1193 #endif
1194 }
1195
1196 diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
1197 index 98b7327..2e41849 100644
1198 --- a/net/ipv6/sit.c
1199 +++ b/net/ipv6/sit.c
1200 @@ -313,7 +313,7 @@ static int ipip6_tunnel_get_prl(struct ip_tunnel *t,
1201
1202 c = 0;
1203 for (prl = t->prl; prl; prl = prl->next) {
1204 - if (c > cmax)
1205 + if (c >= cmax)
1206 break;
1207 if (kprl.addr != htonl(INADDR_ANY) && prl->addr != kprl.addr)
1208 continue;
1209 diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
1210 index fc3ebb9..51ab497 100644
1211 --- a/net/unix/af_unix.c
1212 +++ b/net/unix/af_unix.c
1213 @@ -1501,6 +1501,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
1214 struct sk_buff *skb;
1215 int sent = 0;
1216 struct scm_cookie tmp_scm;
1217 + bool fds_sent = false;
1218
1219 if (NULL == siocb->scm)
1220 siocb->scm = &tmp_scm;
1221 @@ -1562,12 +1563,14 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
1222 size = min_t(int, size, skb_tailroom(skb));
1223
1224 memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
1225 - if (siocb->scm->fp) {
1226 + /* Only send the fds in the first buffer */
1227 + if (siocb->scm->fp && !fds_sent) {
1228 err = unix_attach_fds(siocb->scm, skb);
1229 if (err) {
1230 kfree_skb(skb);
1231 goto out_err;
1232 }
1233 + fds_sent = true;
1234 }
1235
1236 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
1237 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1238 index 30eeb30..713bf69 100644
1239 --- a/sound/pci/hda/patch_realtek.c
1240 +++ b/sound/pci/hda/patch_realtek.c
1241 @@ -16876,6 +16876,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
1242 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS),
1243 SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K",
1244 ALC662_3ST_6ch_DIG),
1245 + SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC663_ASUS_MODE4),
1246 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10),
1247 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
1248 ALC662_3ST_6ch_DIG),
1249 diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
1250 index acfa476..91683a3 100644
1251 --- a/sound/pci/via82xx.c
1252 +++ b/sound/pci/via82xx.c
1253 @@ -1626,7 +1626,7 @@ static int snd_via8233_dxs_volume_get(struct snd_kcontrol *kcontrol,
1254 struct snd_ctl_elem_value *ucontrol)
1255 {
1256 struct via82xx *chip = snd_kcontrol_chip(kcontrol);
1257 - unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id);
1258 + unsigned int idx = kcontrol->id.subdevice;
1259
1260 ucontrol->value.integer.value[0] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][0];
1261 ucontrol->value.integer.value[1] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][1];
1262 @@ -1646,7 +1646,7 @@ static int snd_via8233_dxs_volume_put(struct snd_kcontrol *kcontrol,
1263 struct snd_ctl_elem_value *ucontrol)
1264 {
1265 struct via82xx *chip = snd_kcontrol_chip(kcontrol);
1266 - unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id);
1267 + unsigned int idx = kcontrol->id.subdevice;
1268 unsigned long port = chip->port + 0x10 * idx;
1269 unsigned char val;
1270 int i, change = 0;
1271 @@ -1705,11 +1705,12 @@ static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control __devinitdata =
1272 };
1273
1274 static struct snd_kcontrol_new snd_via8233_dxs_volume_control __devinitdata = {
1275 - .name = "VIA DXS Playback Volume",
1276 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1277 + .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1278 + .device = 0,
1279 + /* .subdevice set later */
1280 + .name = "PCM Playback Volume",
1281 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1282 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1283 - .count = 4,
1284 .info = snd_via8233_dxs_volume_info,
1285 .get = snd_via8233_dxs_volume_get,
1286 .put = snd_via8233_dxs_volume_put,
1287 @@ -1936,10 +1937,18 @@ static int __devinit snd_via8233_init_misc(struct via82xx *chip)
1288 }
1289 else /* Using DXS when PCM emulation is enabled is really weird */
1290 {
1291 - /* Standalone DXS controls */
1292 - err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_dxs_volume_control, chip));
1293 - if (err < 0)
1294 - return err;
1295 + for (i = 0; i < 4; ++i) {
1296 + struct snd_kcontrol *kctl;
1297 +
1298 + kctl = snd_ctl_new1(
1299 + &snd_via8233_dxs_volume_control, chip);
1300 + if (!kctl)
1301 + return -ENOMEM;
1302 + kctl->id.subdevice = i;
1303 + err = snd_ctl_add(chip->card, kctl);
1304 + if (err < 0)
1305 + return err;
1306 + }
1307 }
1308 }
1309 /* select spdif data slot 10/11 */
1310 diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
1311 index b3a2de8..003b742 100644
1312 --- a/sound/soc/codecs/wm8350.c
1313 +++ b/sound/soc/codecs/wm8350.c
1314 @@ -580,7 +580,7 @@ static const struct snd_kcontrol_new wm8350_left_capt_mixer_controls[] = {
1315 SOC_DAPM_SINGLE_TLV("L3 Capture Volume",
1316 WM8350_INPUT_MIXER_VOLUME_L, 9, 7, 0, out_mix_tlv),
1317 SOC_DAPM_SINGLE("PGA Capture Switch",
1318 - WM8350_LEFT_INPUT_VOLUME, 14, 1, 0),
1319 + WM8350_LEFT_INPUT_VOLUME, 14, 1, 1),
1320 };
1321
1322 /* Right Input Mixer */
1323 @@ -590,7 +590,7 @@ static const struct snd_kcontrol_new wm8350_right_capt_mixer_controls[] = {
1324 SOC_DAPM_SINGLE_TLV("L3 Capture Volume",
1325 WM8350_INPUT_MIXER_VOLUME_R, 13, 7, 0, out_mix_tlv),
1326 SOC_DAPM_SINGLE("PGA Capture Switch",
1327 - WM8350_RIGHT_INPUT_VOLUME, 14, 1, 0),
1328 + WM8350_RIGHT_INPUT_VOLUME, 14, 1, 1),
1329 };
1330
1331 /* Left Mic Mixer */