···33Required properties:44- compatible : "fsl,sgtl5000".5566+- reg : the I2C address of the device77+68Example:79810codec: sgtl5000@0a {
+10
Documentation/feature-removal-schedule.txt
···539539Why: setitimer is not returning -EFAULT if user pointer is NULL. This540540 violates the spec.541541Who: Sasikantha Babu <sasikanth.v19@gmail.com>542542+543543+----------------------------544544+545545+What: V4L2_CID_HCENTER, V4L2_CID_VCENTER V4L2 controls546546+When: 3.7547547+Why: The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated548548+ for about 4 years and they are not used by any mainline driver.549549+ There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide550550+ similar functionality.551551+Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
+3-3
MAINTAINERS
···19691969F: drivers/net/ethernet/ti/cpmac.c1970197019711971CPU FREQUENCY DRIVERS19721972-M: Dave Jones <davej@redhat.com>19721972+M: Rafael J. Wysocki <rjw@sisk.pl>19731973L: cpufreq@vger.kernel.org19741974-W: http://www.codemonkey.org.uk/projects/cpufreq/19751975-T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git19741974+L: linux-pm@vger.kernel.org19761975S: Maintained19771976F: drivers/cpufreq/19781977F: include/linux/cpufreq.h···40314032F: drivers/scsi/53c700*4032403340334034LED SUBSYSTEM40354035+M: Bryan Wu <bryan.wu@canonical.com>40344036M: Richard Purdie <rpurdie@rpsys.net>40354037S: Maintained40364038F: drivers/leds/
···906906 return ret;907907}908908909909-#ifdef __ARMEB__910910-#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB911911-#else912912-#define AUDIT_ARCH_NR AUDIT_ARCH_ARM913913-#endif914914-915909asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)916910{917911 unsigned long ip;918912919919- /*920920- * Save IP. IP is used to denote syscall entry/exit:921921- * IP = 0 -> entry, = 1 -> exit922922- */923923- ip = regs->ARM_ip;924924- regs->ARM_ip = why;925925-926926- if (!ip)913913+ if (why)927914 audit_syscall_exit(regs);928915 else929929- audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0,916916+ audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,930917 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);931918932919 if (!test_thread_flag(TIF_SYSCALL_TRACE))···922935 return scno;923936924937 current_thread_info()->syscall = scno;938938+939939+ /*940940+ * IP is used to denote syscall entry/exit:941941+ * IP = 0 -> entry, =1 -> exit942942+ */943943+ ip = regs->ARM_ip;944944+ regs->ARM_ip = why;925945926946 /* the 0x80 provides a way for the tracing parent to distinguish927947 between a syscall stop and SIGTRAP delivery */
+2-2
arch/arm/kernel/smp.c
···251251 struct mm_struct *mm = &init_mm;252252 unsigned int cpu = smp_processor_id();253253254254- printk("CPU%u: Booted secondary processor\n", cpu);255255-256254 /*257255 * All kernel threads share the same mm context; grab a258256 * reference and switch to it.···261263 cpu_switch_mm(mm->pgd, mm);262264 enter_lazy_tlb(mm, current);263265 local_flush_tlb_all();266266+267267+ printk("CPU%u: Booted secondary processor\n", cpu);264268265269 cpu_init();266270 preempt_disable();
···16161717 __CPUINIT18181919+/* Cache invalidation nicked from arch/arm/mach-imx/head-v7.S, thanks!2020+ *2121+ * The secondary kernel init calls v7_flush_dcache_all before it enables2222+ * the L1; however, the L1 comes out of reset in an undefined state, so2323+ * the clean + invalidate performed by v7_flush_dcache_all causes a bunch2424+ * of cache lines with uninitialized data and uninitialized tags to get2525+ * written out to memory, which does really unpleasant things to the main2626+ * processor. We fix this by performing an invalidate, rather than a2727+ * clean + invalidate, before jumping into the kernel.2828+ *2929+ * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs3030+ * to be called for both secondary cores startup and primary core resume3131+ * procedures. Ideally, it should be moved into arch/arm/mm/cache-v7.S.3232+ */3333+ENTRY(v7_invalidate_l1)3434+ mov r0, #03535+ mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache3636+ mcr p15, 2, r0, c0, c0, 03737+ mrc p15, 1, r0, c0, c0, 03838+3939+ ldr r1, =0x7fff4040+ and r2, r1, r0, lsr #134141+4242+ ldr r1, =0x3ff4343+4444+ and r3, r1, r0, lsr #3 @ NumWays - 14545+ add r2, r2, #1 @ NumSets4646+4747+ and r0, r0, #0x74848+ add r0, r0, #4 @ SetShift4949+5050+ clz r1, r3 @ WayShift5151+ add r4, r3, #1 @ NumWays5252+1: sub r2, r2, #1 @ NumSets--5353+ mov r3, r4 @ Temp = NumWays5454+2: subs r3, r3, #1 @ Temp--5555+ mov r5, r3, lsl r15656+ mov r6, r2, lsl r05757+ orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)5858+ mcr p15, 0, r5, c7, c6, 25959+ bgt 2b6060+ cmp r2, #06161+ bgt 1b6262+ dsb6363+ isb6464+ mov pc, lr6565+ENDPROC(v7_invalidate_l1)6666+6767+ENTRY(shmobile_invalidate_start)6868+ bl v7_invalidate_l16969+ b secondary_startup7070+ENDPROC(shmobile_invalidate_start)7171+1972/*2073 * Reset vector for secondary CPUs.2174 * This will be mapped at address 0 by SBAR register.···7724 .align 127825ENTRY(shmobile_secondary_vector)7926 ldr pc, 1f8080-1: .long secondary_startup - PAGE_OFFSET + PLAT_PHYS_OFFSET2727+1: .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET2828+ENDPROC(shmobile_secondary_vector)
+1-1
arch/arm/mach-shmobile/include/mach/common.h
···44extern void shmobile_earlytimer_init(void);55extern struct sys_timer shmobile_timer;66struct twd_local_timer;77-void shmobile_twd_init(struct twd_local_timer *twd_local_timer);87extern void shmobile_setup_console(void);98extern void shmobile_secondary_vector(void);109extern int shmobile_platform_cpu_kill(unsigned int cpu);···8182extern void r8a7779_secondary_init(unsigned int cpu);8283extern int r8a7779_boot_secondary(unsigned int cpu);8384extern void r8a7779_smp_prepare_cpus(void);8585+extern void r8a7779_register_twd(void);84868587#endif /* __ARCH_MACH_COMMON_H */
+4
arch/arm/mach-shmobile/setup-r8a7779.c
···262262 ARRAY_SIZE(r8a7779_late_devices));263263}264264265265+/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */266266+void __init __weak r8a7779_register_twd(void) { }267267+265268static void __init r8a7779_earlytimer_init(void)266269{267270 r8a7779_clock_init();268271 shmobile_earlytimer_init();272272+ r8a7779_register_twd();269273}270274271275void __init r8a7779_add_early_devices(void)
+4
arch/arm/mach-shmobile/setup-sh73a0.c
···688688 ARRAY_SIZE(sh73a0_late_devices));689689}690690691691+/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */692692+void __init __weak sh73a0_register_twd(void) { }693693+691694static void __init sh73a0_earlytimer_init(void)692695{693696 sh73a0_clock_init();694697 shmobile_earlytimer_init();698698+ sh73a0_register_twd();695699}696700697701void __init sh73a0_add_early_devices(void)
+7-1
arch/arm/mach-shmobile/smp-r8a7779.c
···6464static DEFINE_SPINLOCK(scu_lock);6565static unsigned long tmp;66666767+#ifdef CONFIG_HAVE_ARM_TWD6768static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);6969+7070+void __init r8a7779_register_twd(void)7171+{7272+ twd_local_timer_register(&twd_local_timer);7373+}7474+#endif68756976static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)7077{···9184{9285 void __iomem *scu_base = scu_base_addr();93869494- shmobile_twd_init(&twd_local_timer);9587 return scu_get_core_count(scu_base);9688}9789
+6-1
arch/arm/mach-shmobile/smp-sh73a0.c
···4242static DEFINE_SPINLOCK(scu_lock);4343static unsigned long tmp;44444545+#ifdef CONFIG_HAVE_ARM_TWD4546static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);4747+void __init sh73a0_register_twd(void)4848+{4949+ twd_local_timer_register(&twd_local_timer);5050+}5151+#endif46524753static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)4854{···6862{6963 void __iomem *scu_base = scu_base_addr();70647171- shmobile_twd_init(&twd_local_timer);7265 return scu_get_core_count(scu_base);7366}7467
···160160161161#include <asm-generic/memory_model.h>162162#include <asm-generic/getorder.h>163163+#include <asm/pdc.h>164164+165165+#define PAGE0 ((struct zeropage *)__PAGE_OFFSET)166166+167167+/* DEFINITION OF THE ZERO-PAGE (PAG0) */168168+/* based on work by Jason Eckhardt (jason@equator.com) */163169164170#endif /* _PARISC_PAGE_H */
-7
arch/parisc/include/asm/pdc.h
···343343344344#ifdef __KERNEL__345345346346-#include <asm/page.h> /* for __PAGE_OFFSET */347347-348346extern int pdc_type;349347350348/* Values for pdc_type */···674676}675677676678#endif /* __KERNEL__ */677677-678678-#define PAGE0 ((struct zeropage *)__PAGE_OFFSET)679679-680680-/* DEFINITION OF THE ZERO-PAGE (PAG0) */681681-/* based on work by Jason Eckhardt (jason@equator.com) */682679683680/* flags of the device_path */684681#define PF_AUTOBOOT 0x80
···588588fast_exc_return_irq:589589restore:590590 /*591591- * This is the main kernel exit path, we first check if we592592- * have to change our interrupt state.591591+ * This is the main kernel exit path. First we check if we592592+ * are about to re-enable interrupts593593 */594594 ld r5,SOFTE(r1)595595 lbz r6,PACASOFTIRQEN(r13)596596- cmpwi cr1,r5,0597597- cmpw cr0,r5,r6598598- beq cr0,4f596596+ cmpwi cr0,r5,0597597+ beq restore_irq_off599598600600- /* We do, handle disable first, which is easy */601601- bne cr1,3f;602602- li r0,0603603- stb r0,PACASOFTIRQEN(r13);604604- TRACE_DISABLE_INTS605605- b 4f599599+ /* We are enabling, were we already enabled ? Yes, just return */600600+ cmpwi cr0,r6,1601601+ beq cr0,do_restore606602607607-3: /*603603+ /*608604 * We are about to soft-enable interrupts (we are hard disabled609605 * at this point). We check if there's anything that needs to610606 * be replayed first.···622626 /*623627 * Final return path. BookE is handled in a different file624628 */625625-4:629629+do_restore:626630#ifdef CONFIG_PPC_BOOK3E627631 b .exception_return_book3e628632#else···696700#endif /* CONFIG_PPC_BOOK3E */697701698702 /*703703+ * We are returning to a context with interrupts soft disabled.704704+ *705705+ * However, we may also about to hard enable, so we need to706706+ * make sure that in this case, we also clear PACA_IRQ_HARD_DIS707707+ * or that bit can get out of sync and bad things will happen708708+ */709709+restore_irq_off:710710+ ld r3,_MSR(r1)711711+ lbz r7,PACAIRQHAPPENED(r13)712712+ andi. r0,r3,MSR_EE713713+ beq 1f714714+ rlwinm r7,r7,0,~PACA_IRQ_HARD_DIS715715+ stb r7,PACAIRQHAPPENED(r13)716716+1: li r0,0717717+ stb r0,PACASOFTIRQEN(r13);718718+ TRACE_DISABLE_INTS719719+ b do_restore720720+721721+ /*699722 * Something did happen, check if a re-emit is needed700723 * (this also clears paca->irq_happened)701724 */···763748#endif /* CONFIG_PPC_BOOK3E */7647491: b .ret_from_except /* What else to do here ? */765750751751+752752+753753+3:766754do_work:767755#ifdef CONFIG_PREEMPT768756 andi. r0,r3,MSR_PR /* Returning to user mode? */···785767 SOFT_DISABLE_INTS(r3,r4)7867681: bl .preempt_schedule_irq787769788788- /* Hard-disable interrupts again (and update PACA) */789789-#ifdef CONFIG_PPC_BOOK3E790790- wrteei 0791791-#else792792- ld r10,PACAKMSR(r13) /* Get kernel MSR without EE */793793- mtmsrd r10,1794794-#endif /* CONFIG_PPC_BOOK3E */795795- li r0,PACA_IRQ_HARD_DIS796796- stb r0,PACAIRQHAPPENED(r13)797797-798770 /* Re-test flags and eventually loop */799771 clrrdi r9,r1,THREAD_SHIFT800772 ld r4,TI_FLAGS(r9)···794786795787user_work:796788#endif /* CONFIG_PREEMPT */797797-798798- /* Enable interrupts */799799-#ifdef CONFIG_PPC_BOOK3E800800- wrteei 1801801-#else802802- ori r10,r10,MSR_EE803803- mtmsrd r10,1804804-#endif /* CONFIG_PPC_BOOK3E */805789806790 andi. r0,r4,_TIF_NEED_RESCHED807791 beq 1f
···229229 */230230 if (unlikely(irq_happened != PACA_IRQ_HARD_DIS))231231 __hard_irq_disable();232232+#ifdef CONFIG_TRACE_IRQFLAG233233+ else {234234+ /*235235+ * We should already be hard disabled here. We had bugs236236+ * where that wasn't the case so let's dbl check it and237237+ * warn if we are wrong. Only do that when IRQ tracing238238+ * is enabled as mfmsr() can be costly.239239+ */240240+ if (WARN_ON(mfmsr() & MSR_EE))241241+ __hard_irq_disable();242242+ }243243+#endif /* CONFIG_TRACE_IRQFLAG */244244+232245 set_soft_enabled(0);233246234247 /*···273260 * if they are currently disabled. This is typically called before274261 * schedule() or do_signal() when returning to userspace. We do it275262 * in C to avoid the burden of dealing with lockdep etc...263263+ *264264+ * NOTE: This is called with interrupts hard disabled but not marked265265+ * as such in paca->irq_happened, so we need to resync this.276266 */277267void restore_interrupts(void)278268{279279- if (irqs_disabled())269269+ if (irqs_disabled()) {270270+ local_paca->irq_happened |= PACA_IRQ_HARD_DIS;280271 local_irq_enable();272272+ } else273273+ __hard_irq_enable();281274}282275283276#endif /* CONFIG_PPC64 */
+8-2
arch/powerpc/kernel/traps.c
···248248 addr, regs->nip, regs->link, code);249249 }250250251251- if (!arch_irq_disabled_regs(regs))251251+ if (arch_irqs_disabled() && !arch_irq_disabled_regs(regs))252252 local_irq_enable();253253254254 memset(&info, 0, sizeof(info));···10191019 return;10201020 }1021102110221022- local_irq_enable();10221022+ /* We restore the interrupt state now */10231023+ if (!arch_irq_disabled_regs(regs))10241024+ local_irq_enable();1023102510241026#ifdef CONFIG_MATH_EMULATION10251027 /* (reason & REASON_ILLEGAL) would be the obvious thing here,···10701068void alignment_exception(struct pt_regs *regs)10711069{10721070 int sig, code, fixed = 0;10711071+10721072+ /* We restore the interrupt state now */10731073+ if (!arch_irq_disabled_regs(regs))10741074+ local_irq_enable();1073107510741076 /* we don't implement logging of alignment exceptions */10751077 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
···258258 !(memslot->userspace_addr & (s - 1))) {259259 start &= ~(s - 1);260260 pgsize = s;261261+ get_page(hpage);262262+ put_page(page);261263 page = hpage;262264 }263265 }···283281 err = 0;284282285283 out:286286- if (got) {287287- if (PageHuge(page))288288- page = compound_head(page);284284+ if (got)289285 put_page(page);290290- }291286 return err;292287293288 up_err:···677678 SetPageDirty(page);678679679680 out_put:680680- if (page)681681- put_page(page);681681+ if (page) {682682+ /*683683+ * We drop pages[0] here, not page because page might684684+ * have been set to the head page of a compound, but685685+ * we have to drop the reference on the correct tail686686+ * page to match the get inside gup()687687+ */688688+ put_page(pages[0]);689689+ }682690 return ret;683691684692 out_unlock:···985979 pa = *physp;986980 }987981 page = pfn_to_page(pa >> PAGE_SHIFT);982982+ get_page(page);988983 } else {989984 hva = gfn_to_hva_memslot(memslot, gfn);990985 npages = get_user_pages_fast(hva, 1, 1, pages);···998991 page = compound_head(page);999992 psize <<= compound_order(page);1000993 }10011001- if (!kvm->arch.using_mmu_notifiers)10021002- get_page(page);1003994 offset = gpa & (psize - 1);1004995 if (nb_ret)1005996 *nb_ret = psize - offset;···10081003{10091004 struct page *page = virt_to_page(va);1010100510111011- page = compound_head(page);10121006 put_page(page);10131007}10141008
···463463 /* insert R and C bits from PTE */464464 rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C);465465 args[j] |= rcbits << (56 - 5);466466+ hp[0] = 0;466467 continue;467468 }468469
+28-14
arch/powerpc/kvm/book3s_segment.S
···197197 /* Save guest PC and MSR */198198#ifdef CONFIG_PPC64199199BEGIN_FTR_SECTION200200- andi. r0,r12,0x2200200+ andi. r0, r12, 0x2201201+ cmpwi cr1, r0, 0201202 beq 1f202203 mfspr r3,SPRN_HSRR0203204 mfspr r4,SPRN_HSRR1···251250 beq ld_last_prev_inst252251 cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT253252 beq- ld_last_inst253253+#ifdef CONFIG_PPC64254254+BEGIN_FTR_SECTION255255+ cmpwi r12, BOOK3S_INTERRUPT_H_EMUL_ASSIST256256+ beq- ld_last_inst257257+END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)258258+#endif254259255260 b no_ld_last_inst256261···323316 * Having set up SRR0/1 with the address where we want324317 * to continue with relocation on (potentially in module325318 * space), we either just go straight there with rfi[d],326326- * or we jump to an interrupt handler with bctr if there327327- * is an interrupt to be handled first. In the latter328328- * case, the rfi[d] at the end of the interrupt handler329329- * will get us back to where we want to continue.319319+ * or we jump to an interrupt handler if there is an320320+ * interrupt to be handled first. In the latter case,321321+ * the rfi[d] at the end of the interrupt handler will322322+ * get us back to where we want to continue.330323 */331331-332332- cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL333333- beq 1f334334- cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER335335- beq 1f336336- cmpwi r12, BOOK3S_INTERRUPT_PERFMON337337-1: mtctr r12338324339325 /* Register usage at this point:340326 *341327 * R1 = host R1342328 * R2 = host R2329329+ * R10 = raw exit handler id343330 * R12 = exit handler id344331 * R13 = shadow vcpu (32-bit) or PACA (64-bit)345332 * SVCPU.* = guest *···343342 PPC_LL r6, HSTATE_HOST_MSR(r13)344343 PPC_LL r8, HSTATE_VMHANDLER(r13)345344346346- /* Restore host msr -> SRR1 */345345+#ifdef CONFIG_PPC64346346+BEGIN_FTR_SECTION347347+ beq cr1, 1f348348+ mtspr SPRN_HSRR1, r6349349+ mtspr SPRN_HSRR0, r8350350+END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)351351+#endif352352+1: /* Restore host msr -> SRR1 */347353 mtsrr1 r6348354 /* Load highmem handler address */349355 mtsrr0 r8350356351357 /* RFI into the highmem handler, or jump to interrupt handler */352352- beqctr358358+ cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL359359+ beqa BOOK3S_INTERRUPT_EXTERNAL360360+ cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER361361+ beqa BOOK3S_INTERRUPT_DECREMENTER362362+ cmpwi r12, BOOK3S_INTERRUPT_PERFMON363363+ beqa BOOK3S_INTERRUPT_PERFMON364364+353365 RFI354366kvmppc_handler_trampoline_exit_end:
···495495 stx %o7, [%g1 + GR_SNAP_O7]496496 stx %i7, [%g1 + GR_SNAP_I7]497497 /* Don't try this at home kids... */498498- rdpr %cwp, %g2499499- sub %g2, 1, %g7498498+ rdpr %cwp, %g3499499+ sub %g3, 1, %g7500500 wrpr %g7, %cwp501501 mov %i7, %g7502502- wrpr %g2, %cwp502502+ wrpr %g3, %cwp503503 stx %g7, [%g1 + GR_SNAP_RPC]504504 sethi %hi(trap_block), %g7505505 or %g7, %lo(trap_block), %g7
+7-2
arch/tile/include/asm/thread_info.h
···100100101101#else /* __ASSEMBLY__ */102102103103-/* how to get the thread information struct from ASM */103103+/*104104+ * How to get the thread information struct from assembly.105105+ * Note that we use different macros since different architectures106106+ * have different semantics in their "mm" instruction and we would107107+ * like to guarantee that the macro expands to exactly one instruction.108108+ */104109#ifdef __tilegx__105105-#define GET_THREAD_INFO(reg) move reg, sp; mm reg, zero, LOG2_THREAD_SIZE, 63110110+#define EXTRACT_THREAD_INFO(reg) mm reg, zero, LOG2_THREAD_SIZE, 63106111#else107112#define GET_THREAD_INFO(reg) mm reg, sp, zero, LOG2_THREAD_SIZE, 31108113#endif
+5-7
arch/tile/kernel/compat_signal.c
···403403 * Set up registers for signal handler.404404 * Registers that we don't modify keep the value they had from405405 * user-space at the time we took the signal.406406+ * We always pass siginfo and mcontext, regardless of SA_SIGINFO,407407+ * since some things rely on this (e.g. glibc's debug/segfault.c).406408 */407409 regs->pc = ptr_to_compat_reg(ka->sa.sa_handler);408410 regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */409411 regs->sp = ptr_to_compat_reg(frame);410412 regs->lr = restorer;411413 regs->regs[0] = (unsigned long) usig;412412-413413- if (ka->sa.sa_flags & SA_SIGINFO) {414414- /* Need extra arguments, so mark to restore caller-saves. */415415- regs->regs[1] = ptr_to_compat_reg(&frame->info);416416- regs->regs[2] = ptr_to_compat_reg(&frame->uc);417417- regs->flags |= PT_FLAGS_CALLER_SAVES;418418- }414414+ regs->regs[1] = ptr_to_compat_reg(&frame->info);415415+ regs->regs[2] = ptr_to_compat_reg(&frame->uc);416416+ regs->flags |= PT_FLAGS_CALLER_SAVES;419417420418 /*421419 * Notify any tracer that was single-stepping it.
+28-13
arch/tile/kernel/intvec_32.S
···839839 FEEDBACK_REENTER(interrupt_return)840840841841 /*842842+ * Use r33 to hold whether we have already loaded the callee-saves843843+ * into ptregs. We don't want to do it twice in this loop, since844844+ * then we'd clobber whatever changes are made by ptrace, etc.845845+ * Get base of stack in r32.846846+ */847847+ {848848+ GET_THREAD_INFO(r32)849849+ movei r33, 0850850+ }851851+852852+.Lretry_work_pending:853853+ /*842854 * Disable interrupts so as to make sure we don't843855 * miss an interrupt that sets any of the thread flags (like844856 * need_resched or sigpending) between sampling and the iret.···859847 */860848 IRQ_DISABLE(r20, r21)861849 TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */862862-863863- /* Get base of stack in r32; note r30/31 are used as arguments here. */864864- GET_THREAD_INFO(r32)865850866851867852 /* Check to see if there is any work to do before returning to user. */···875866876867 /*877868 * Make sure we have all the registers saved for signal878878- * handling or single-step. Call out to C code to figure out879879- * exactly what we need to do for each flag bit, then if880880- * necessary, reload the flags and recheck.869869+ * handling, notify-resume, or single-step. Call out to C870870+ * code to figure out exactly what we need to do for each flag bit,871871+ * then if necessary, reload the flags and recheck.881872 */882882- push_extra_callee_saves r0883873 {884874 PTREGS_PTR(r0, PTREGS_OFFSET_BASE)885885- jal do_work_pending875875+ bnz r33, 1f886876 }887887- bnz r0, .Lresume_userspace877877+ push_extra_callee_saves r0878878+ movei r33, 1879879+1: jal do_work_pending880880+ bnz r0, .Lretry_work_pending888881889882 /*890883 * In the NMI case we···11911180 add r20, r20, tp11921181 lw r21, r2011931182 addi r21, r21, 111941194- sw r20, r2111831183+ {11841184+ sw r20, r2111851185+ GET_THREAD_INFO(r31)11861186+ }1195118711961188 /* Trace syscalls, if requested. */11971197- GET_THREAD_INFO(r31)11981189 addi r31, r31, THREAD_INFO_FLAGS_OFFSET11991190 lw r30, r3112001191 andi r30, r30, _TIF_SYSCALL_TRACE···137513623:13761363 /* set PC and continue */13771364 lw r26, r2413781378- sw r28, r2613651365+ {13661366+ sw r28, r2613671367+ GET_THREAD_INFO(r0)13681368+ }1379136913801370 /*13811371 * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill.···13861370 * need to clear it here and can't really impose on all other arches.13871371 * So what's another write between friends?13881372 */13891389- GET_THREAD_INFO(r0)1390137313911374 addi r1, r0, THREAD_INFO_FLAGS_OFFSET13921375 {
+28-10
arch/tile/kernel/intvec_64.S
···647647 FEEDBACK_REENTER(interrupt_return)648648649649 /*650650+ * Use r33 to hold whether we have already loaded the callee-saves651651+ * into ptregs. We don't want to do it twice in this loop, since652652+ * then we'd clobber whatever changes are made by ptrace, etc.653653+ */654654+ {655655+ movei r33, 0656656+ move r32, sp657657+ }658658+659659+ /* Get base of stack in r32. */660660+ EXTRACT_THREAD_INFO(r32)661661+662662+.Lretry_work_pending:663663+ /*650664 * Disable interrupts so as to make sure we don't651665 * miss an interrupt that sets any of the thread flags (like652666 * need_resched or sigpending) between sampling and the iret.···669655 */670656 IRQ_DISABLE(r20, r21)671657 TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */672672-673673- /* Get base of stack in r32; note r30/31 are used as arguments here. */674674- GET_THREAD_INFO(r32)675658676659677660 /* Check to see if there is any work to do before returning to user. */···685674686675 /*687676 * Make sure we have all the registers saved for signal688688- * handling or single-step. Call out to C code to figure out677677+ * handling or notify-resume. Call out to C code to figure out689678 * exactly what we need to do for each flag bit, then if690679 * necessary, reload the flags and recheck.691680 */692692- push_extra_callee_saves r0693681 {694682 PTREGS_PTR(r0, PTREGS_OFFSET_BASE)695695- jal do_work_pending683683+ bnez r33, 1f696684 }697697- bnez r0, .Lresume_userspace685685+ push_extra_callee_saves r0686686+ movei r33, 1687687+1: jal do_work_pending688688+ bnez r0, .Lretry_work_pending698689699690 /*700691 * In the NMI case we···981968 shl16insli r20, r20, hw0(irq_stat + IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET)982969 add r20, r20, tp983970 ld4s r21, r20984984- addi r21, r21, 1985985- st4 r20, r21971971+ {972972+ addi r21, r21, 1973973+ move r31, sp974974+ }975975+ {976976+ st4 r20, r21977977+ EXTRACT_THREAD_INFO(r31)978978+ }986979987980 /* Trace syscalls, if requested. */988988- GET_THREAD_INFO(r31)989981 addi r31, r31, THREAD_INFO_FLAGS_OFFSET990982 ld r30, r31991983 andi r30, r30, _TIF_SYSCALL_TRACE
+5-2
arch/tile/kernel/process.c
···567567 */568568int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)569569{570570+ /* If we enter in kernel mode, do nothing and exit the caller loop. */571571+ if (!user_mode(regs))572572+ return 0;573573+570574 if (thread_info_flags & _TIF_NEED_RESCHED) {571575 schedule();572576 return 1;···593589 return 1;594590 }595591 if (thread_info_flags & _TIF_SINGLESTEP) {596596- if ((regs->ex1 & SPR_EX_CONTEXT_1_1__PL_MASK) == 0)597597- single_step_once(regs);592592+ single_step_once(regs);598593 return 0;599594 }600595 panic("work_pending: bad flags %#x\n", thread_info_flags);
···403403 for (i = 0; i < ehdr.e_shnum; i++) {404404 struct section *sec = &secs[i];405405 char *sym_strtab;406406- Elf32_Sym *sh_symtab;407406 int j;408407409408 if (sec->shdr.sh_type != SHT_SYMTAB) {410409 continue;411410 }412412- sh_symtab = sec->symtab;413411 sym_strtab = sec->link->strtab;414412 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) {415413 Elf32_Sym *sym;
+1-2
arch/x86/ia32/ia32_aout.c
···294294295295 /* OK, This is the point of no return */296296 set_personality(PER_LINUX);297297- set_thread_flag(TIF_IA32);298298- current->mm->context.ia32_compat = 1;297297+ set_personality_ia32(false);299298300299 setup_new_exec(bprm);301300
+33
arch/x86/include/asm/word-at-a-time.h
···4343 return ((a - REPEAT_BYTE(0x01)) & ~a) & REPEAT_BYTE(0x80);4444}45454646+/*4747+ * Load an unaligned word from kernel space.4848+ *4949+ * In the (very unlikely) case of the word being a page-crosser5050+ * and the next page not being mapped, take the exception and5151+ * return zeroes in the non-existing part.5252+ */5353+static inline unsigned long load_unaligned_zeropad(const void *addr)5454+{5555+ unsigned long ret, dummy;5656+5757+ asm(5858+ "1:\tmov %2,%0\n"5959+ "2:\n"6060+ ".section .fixup,\"ax\"\n"6161+ "3:\t"6262+ "lea %2,%1\n\t"6363+ "and %3,%1\n\t"6464+ "mov (%1),%0\n\t"6565+ "leal %2,%%ecx\n\t"6666+ "andl %4,%%ecx\n\t"6767+ "shll $3,%%ecx\n\t"6868+ "shr %%cl,%0\n\t"6969+ "jmp 2b\n"7070+ ".previous\n"7171+ _ASM_EXTABLE(1b, 3b)7272+ :"=&r" (ret),"=&c" (dummy)7373+ :"m" (*(unsigned long *)addr),7474+ "i" (-sizeof(unsigned long)),7575+ "i" (sizeof(unsigned long)-1));7676+ return ret;7777+}7878+4679#endif /* _ASM_WORD_AT_A_TIME_H */
+18
arch/x86/kernel/cpu/amd.c
···580580 }581581 }582582583583+ /* re-enable TopologyExtensions if switched off by BIOS */584584+ if ((c->x86 == 0x15) &&585585+ (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) &&586586+ !cpu_has(c, X86_FEATURE_TOPOEXT)) {587587+ u64 val;588588+589589+ if (!rdmsrl_amd_safe(0xc0011005, &val)) {590590+ val |= 1ULL << 54;591591+ wrmsrl_amd_safe(0xc0011005, val);592592+ rdmsrl(0xc0011005, val);593593+ if (val & (1ULL << 54)) {594594+ set_cpu_cap(c, X86_FEATURE_TOPOEXT);595595+ printk(KERN_INFO FW_INFO "CPU: Re-enabling "596596+ "disabled Topology Extensions Support\n");597597+ }598598+ }599599+ }600600+583601 cpu_detect_cache_sizes(c);584602585603 /* Multi core CPU? */
+1-8
arch/x86/kernel/kvm.c
···7979 u32 token;8080 int cpu;8181 bool halted;8282- struct mm_struct *mm;8382};84838584static struct kvm_task_sleep_head {···125126126127 n.token = token;127128 n.cpu = smp_processor_id();128128- n.mm = current->active_mm;129129 n.halted = idle || preempt_count() > 1;130130- atomic_inc(&n.mm->mm_count);131130 init_waitqueue_head(&n.wq);132131 hlist_add_head(&n.link, &b->list);133132 spin_unlock(&b->lock);···158161static void apf_task_wake_one(struct kvm_task_sleep_node *n)159162{160163 hlist_del_init(&n->link);161161- if (!n->mm)162162- return;163163- mmdrop(n->mm);164164 if (n->halted)165165 smp_send_reschedule(n->cpu);166166 else if (waitqueue_active(&n->wq))···201207 * async PF was not yet handled.202208 * Add dummy entry for the token.203209 */204204- n = kmalloc(sizeof(*n), GFP_ATOMIC);210210+ n = kzalloc(sizeof(*n), GFP_ATOMIC);205211 if (!n) {206212 /*207213 * Allocation failed! Busy wait while other cpu···213219 }214220 n->token = token;215221 n->cpu = smp_processor_id();216216- n->mm = NULL;217222 init_waitqueue_head(&n->wq);218223 hlist_add_head(&n->link, &b->list);219224 } else
+1
arch/x86/kernel/process_64.c
···423423 current_thread_info()->status |= TS_COMPAT;424424 }425425}426426+EXPORT_SYMBOL_GPL(set_personality_ia32);426427427428unsigned long get_wchan(struct task_struct *p)428429{
+13-1
arch/x86/kernel/setup_percpu.c
···185185#endif186186 rc = -EINVAL;187187 if (pcpu_chosen_fc != PCPU_FC_PAGE) {188188- const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;189188 const size_t dyn_size = PERCPU_MODULE_RESERVE +190189 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;190190+ size_t atom_size;191191192192+ /*193193+ * On 64bit, use PMD_SIZE for atom_size so that embedded194194+ * percpu areas are aligned to PMD. This, in the future,195195+ * can also allow using PMD mappings in vmalloc area. Use196196+ * PAGE_SIZE on 32bit as vmalloc space is highly contended197197+ * and large vmalloc area allocs can easily fail.198198+ */199199+#ifdef CONFIG_X86_64200200+ atom_size = PMD_SIZE;201201+#else202202+ atom_size = PAGE_SIZE;203203+#endif192204 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,193205 dyn_size, atom_size,194206 pcpu_cpu_distance,
···6363#include <asm/stackprotector.h>6464#include <asm/hypervisor.h>6565#include <asm/mwait.h>6666+#include <asm/pci_x86.h>66676768#ifdef CONFIG_ACPI6869#include <linux/acpi.h>···810809}811810812811#ifdef CONFIG_X86_LOCAL_APIC812812+static unsigned long xen_set_apic_id(unsigned int x)813813+{814814+ WARN_ON(1);815815+ return x;816816+}817817+static unsigned int xen_get_apic_id(unsigned long x)818818+{819819+ return ((x)>>24) & 0xFFu;820820+}813821static u32 xen_apic_read(u32 reg)814822{815815- return 0;823823+ struct xen_platform_op op = {824824+ .cmd = XENPF_get_cpuinfo,825825+ .interface_version = XENPF_INTERFACE_VERSION,826826+ .u.pcpu_info.xen_cpuid = 0,827827+ };828828+ int ret = 0;829829+830830+ /* Shouldn't need this as APIC is turned off for PV, and we only831831+ * get called on the bootup processor. But just in case. */832832+ if (!xen_initial_domain() || smp_processor_id())833833+ return 0;834834+835835+ if (reg == APIC_LVR)836836+ return 0x10;837837+838838+ if (reg != APIC_ID)839839+ return 0;840840+841841+ ret = HYPERVISOR_dom0_op(&op);842842+ if (ret)843843+ return 0;844844+845845+ return op.u.pcpu_info.apic_id << 24;816846}817847818848static void xen_apic_write(u32 reg, u32 val)···881849 apic->icr_write = xen_apic_icr_write;882850 apic->wait_icr_idle = xen_apic_wait_icr_idle;883851 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;852852+ apic->set_apic_id = xen_set_apic_id;853853+ apic->get_apic_id = xen_get_apic_id;884854}885855886856#endif···13991365 /* Make sure ACS will be enabled */14001366 pci_request_acs();14011367 }14021402-14031403-13681368+#ifdef CONFIG_PCI13691369+ /* PCI BIOS service won't work from a PV guest. */13701370+ pci_probe &= ~PCI_PROBE_BIOS;13711371+#endif14041372 xen_raw_console_write("about to get started...\n");1405137314061374 xen_setup_runstate_info(0);
+6-1
arch/x86/xen/mmu.c
···353353{354354 if (val & _PAGE_PRESENT) {355355 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;356356+ unsigned long pfn = mfn_to_pfn(mfn);357357+356358 pteval_t flags = val & PTE_FLAGS_MASK;357357- val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags;359359+ if (unlikely(pfn == ~0))360360+ val = flags & ~_PAGE_PRESENT;361361+ else362362+ val = ((pteval_t)pfn << PAGE_SHIFT) | flags;358363 }359364360365 return val;
+1-1
drivers/acpi/power.c
···631631 * We know a device's inferred power state when all the resources632632 * required for a given D-state are 'on'.633633 */634634- for (i = ACPI_STATE_D0; i < ACPI_STATE_D3; i++) {634634+ for (i = ACPI_STATE_D0; i < ACPI_STATE_D3_HOT; i++) {635635 list = &device->power.states[i].resources;636636 if (list->count < 1)637637 continue;
+7-10
drivers/acpi/scan.c
···869869 /*870870 * Enumerate supported power management states871871 */872872- for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3; i++) {872872+ for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {873873 struct acpi_device_power_state *ps = &device->power.states[i];874874 char object_name[5] = { '_', 'P', 'R', '0' + i, '\0' };875875···884884 acpi_bus_add_power_resource(ps->resources.handles[j]);885885 }886886887887- /* The exist of _PR3 indicates D3Cold support */888888- if (i == ACPI_STATE_D3) {889889- status = acpi_get_handle(device->handle, object_name, &handle);890890- if (ACPI_SUCCESS(status))891891- device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;892892- }893893-894887 /* Evaluate "_PSx" to see if we can do explicit sets */895888 object_name[2] = 'S';896889 status = acpi_get_handle(device->handle, object_name, &handle);897890 if (ACPI_SUCCESS(status))898891 ps->flags.explicit_set = 1;899892900900- /* State is valid if we have some power control */901901- if (ps->resources.count || ps->flags.explicit_set)893893+ /*894894+ * State is valid if there are means to put the device into it.895895+ * D3hot is only valid if _PR3 present.896896+ */897897+ if (ps->resources.count ||898898+ (ps->flags.explicit_set && i < ACPI_STATE_D3_HOT))902899 ps->flags.valid = 1;903900904901 ps->power = -1; /* Unknown - driver assigned */
+3-1
drivers/base/regmap/regmap.c
···775775 map->format.parse_val(val + i);776776 } else {777777 for (i = 0; i < val_count; i++) {778778- ret = regmap_read(map, reg + i, val + (i * val_bytes));778778+ unsigned int ival;779779+ ret = regmap_read(map, reg + i, &ival);779780 if (ret != 0)780781 return ret;782782+ memcpy(val + (i * val_bytes), &ival, val_bytes);781783 }782784 }783785
···70727072 struct drm_device *dev = crtc->dev;70737073 drm_i915_private_t *dev_priv = dev->dev_private;70747074 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);70757075- int pipe = intel_crtc->pipe;70767076- int dpll_reg = DPLL(pipe);70777077- int dpll = I915_READ(dpll_reg);7078707570797076 if (HAS_PCH_SPLIT(dev))70807077 return;···70847087 * the manual case.70857088 */70867089 if (!HAS_PIPE_CXSR(dev) && intel_crtc->lowfreq_avail) {70907090+ int pipe = intel_crtc->pipe;70917091+ int dpll_reg = DPLL(pipe);70927092+ u32 dpll;70937093+70877094 DRM_DEBUG_DRIVER("downclocking LVDS\n");7088709570897096 assert_panel_unlocked(dev_priv, pipe);7090709770987098+ dpll = I915_READ(dpll_reg);70917099 dpll |= DISPLAY_RATE_SELECT_FPA1;70927100 I915_WRITE(dpll_reg, dpll);70937101 intel_wait_for_vblank(dev, pipe);···71007098 if (!(dpll & DISPLAY_RATE_SELECT_FPA1))71017099 DRM_DEBUG_DRIVER("failed to downclock LVDS!\n");71027100 }71037103-71047101}7105710271067103/**
+1-1
drivers/gpu/drm/i915/intel_hdmi.c
···136136137137 val &= ~VIDEO_DIP_SELECT_MASK;138138139139- I915_WRITE(VIDEO_DIP_CTL, val | port | flags);139139+ I915_WRITE(VIDEO_DIP_CTL, VIDEO_DIP_ENABLE | val | port | flags);140140141141 for (i = 0; i < len; i += 4) {142142 I915_WRITE(VIDEO_DIP_DATA, *data);
···398398 return ret;399399 }400400401401- if (INTEL_INFO(dev)->gen >= 6) {402402- I915_WRITE(INSTPM,403403- INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);404401402402+ if (IS_GEN6(dev)) {405403 /* From the Sandybridge PRM, volume 1 part 3, page 24:406404 * "If this bit is set, STCunit will have LRA as replacement407405 * policy. [...] This bit must be reset. LRA replacement···407409 */408410 I915_WRITE(CACHE_MODE_0,409411 CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT);412412+ }413413+414414+ if (INTEL_INFO(dev)->gen >= 6) {415415+ I915_WRITE(INSTPM,416416+ INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);410417 }411418412419 return ret;
+6
drivers/gpu/drm/i915/intel_sdvo.c
···1220122012211221static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo)12221222{12231223+ struct drm_device *dev = intel_sdvo->base.base.dev;12231224 u8 response[2];12251225+12261226+ /* HW Erratum: SDVO Hotplug is broken on all i945G chips, there's noise12271227+ * on the line. */12281228+ if (IS_I945G(dev) || IS_I945GM(dev))12291229+ return false;1224123012251231 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT,12261232 &response, 2) && response[0];
+21-178
drivers/gpu/drm/nouveau/nouveau_i2c.c
···2929#include "nouveau_i2c.h"3030#include "nouveau_hw.h"31313232-#define T_TIMEOUT 22000003333-#define T_RISEFALL 10003434-#define T_HOLD 50003535-3632static void3733i2c_drive_scl(void *data, int state)3834{···108112 }109113 return 0;110114}111111-112112-static void113113-i2c_delay(struct nouveau_i2c_chan *port, u32 nsec)114114-{115115- udelay((nsec + 500) / 1000);116116-}117117-118118-static bool119119-i2c_raise_scl(struct nouveau_i2c_chan *port)120120-{121121- u32 timeout = T_TIMEOUT / T_RISEFALL;122122-123123- i2c_drive_scl(port, 1);124124- do {125125- i2c_delay(port, T_RISEFALL);126126- } while (!i2c_sense_scl(port) && --timeout);127127-128128- return timeout != 0;129129-}130130-131131-static int132132-i2c_start(struct nouveau_i2c_chan *port)133133-{134134- int ret = 0;135135-136136- port->state = i2c_sense_scl(port);137137- port->state |= i2c_sense_sda(port) << 1;138138- if (port->state != 3) {139139- i2c_drive_scl(port, 0);140140- i2c_drive_sda(port, 1);141141- if (!i2c_raise_scl(port))142142- ret = -EBUSY;143143- }144144-145145- i2c_drive_sda(port, 0);146146- i2c_delay(port, T_HOLD);147147- i2c_drive_scl(port, 0);148148- i2c_delay(port, T_HOLD);149149- return ret;150150-}151151-152152-static void153153-i2c_stop(struct nouveau_i2c_chan *port)154154-{155155- i2c_drive_scl(port, 0);156156- i2c_drive_sda(port, 0);157157- i2c_delay(port, T_RISEFALL);158158-159159- i2c_drive_scl(port, 1);160160- i2c_delay(port, T_HOLD);161161- i2c_drive_sda(port, 1);162162- i2c_delay(port, T_HOLD);163163-}164164-165165-static int166166-i2c_bitw(struct nouveau_i2c_chan *port, int sda)167167-{168168- i2c_drive_sda(port, sda);169169- i2c_delay(port, T_RISEFALL);170170-171171- if (!i2c_raise_scl(port))172172- return -ETIMEDOUT;173173- i2c_delay(port, T_HOLD);174174-175175- i2c_drive_scl(port, 0);176176- i2c_delay(port, T_HOLD);177177- return 0;178178-}179179-180180-static int181181-i2c_bitr(struct nouveau_i2c_chan *port)182182-{183183- int sda;184184-185185- i2c_drive_sda(port, 1);186186- i2c_delay(port, T_RISEFALL);187187-188188- if (!i2c_raise_scl(port))189189- return -ETIMEDOUT;190190- i2c_delay(port, T_HOLD);191191-192192- sda = i2c_sense_sda(port);193193-194194- i2c_drive_scl(port, 0);195195- i2c_delay(port, T_HOLD);196196- return sda;197197-}198198-199199-static int200200-i2c_get_byte(struct nouveau_i2c_chan *port, u8 *byte, bool last)201201-{202202- int i, bit;203203-204204- *byte = 0;205205- for (i = 7; i >= 0; i--) {206206- bit = i2c_bitr(port);207207- if (bit < 0)208208- return bit;209209- *byte |= bit << i;210210- }211211-212212- return i2c_bitw(port, last ? 1 : 0);213213-}214214-215215-static int216216-i2c_put_byte(struct nouveau_i2c_chan *port, u8 byte)217217-{218218- int i, ret;219219- for (i = 7; i >= 0; i--) {220220- ret = i2c_bitw(port, !!(byte & (1 << i)));221221- if (ret < 0)222222- return ret;223223- }224224-225225- ret = i2c_bitr(port);226226- if (ret == 1) /* nack */227227- ret = -EIO;228228- return ret;229229-}230230-231231-static int232232-i2c_addr(struct nouveau_i2c_chan *port, struct i2c_msg *msg)233233-{234234- u32 addr = msg->addr << 1;235235- if (msg->flags & I2C_M_RD)236236- addr |= 1;237237- return i2c_put_byte(port, addr);238238-}239239-240240-static int241241-i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)242242-{243243- struct nouveau_i2c_chan *port = (struct nouveau_i2c_chan *)adap;244244- struct i2c_msg *msg = msgs;245245- int ret = 0, mcnt = num;246246-247247- while (!ret && mcnt--) {248248- u8 remaining = msg->len;249249- u8 *ptr = msg->buf;250250-251251- ret = i2c_start(port);252252- if (ret == 0)253253- ret = i2c_addr(port, msg);254254-255255- if (msg->flags & I2C_M_RD) {256256- while (!ret && remaining--)257257- ret = i2c_get_byte(port, ptr++, !remaining);258258- } else {259259- while (!ret && remaining--)260260- ret = i2c_put_byte(port, *ptr++);261261- }262262-263263- msg++;264264- }265265-266266- i2c_stop(port);267267- return (ret < 0) ? ret : num;268268-}269269-270270-static u32271271-i2c_bit_func(struct i2c_adapter *adap)272272-{273273- return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;274274-}275275-276276-const struct i2c_algorithm nouveau_i2c_bit_algo = {277277- .master_xfer = i2c_bit_xfer,278278- .functionality = i2c_bit_func279279-};280115281116static const uint32_t nv50_i2c_port[] = {282117 0x00e138, 0x00e150, 0x00e168, 0x00e180,···211384 case 0: /* NV04:NV50 */212385 port->drive = entry[0];213386 port->sense = entry[1];214214- port->adapter.algo = &nouveau_i2c_bit_algo;215387 break;216388 case 4: /* NV4E */217389 port->drive = 0x600800 + entry[1];218390 port->sense = port->drive;219219- port->adapter.algo = &nouveau_i2c_bit_algo;220391 break;221392 case 5: /* NV50- */222393 port->drive = entry[0] & 0x0f;···227402 port->drive = 0x00d014 + (port->drive * 0x20);228403 port->sense = port->drive;229404 }230230- port->adapter.algo = &nouveau_i2c_bit_algo;231405 break;232406 case 6: /* NV50- DP AUX */233407 port->drive = entry[0];···237413 break;238414 }239415240240- if (!port->adapter.algo) {416416+ if (!port->adapter.algo && !port->drive) {241417 NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n",242418 i, port->type, port->drive, port->sense);243419 kfree(port);···253429 port->dcb = ROM32(entry[0]);254430 i2c_set_adapdata(&port->adapter, i2c);255431256256- ret = i2c_add_adapter(&port->adapter);432432+ if (port->adapter.algo != &nouveau_dp_i2c_algo) {433433+ port->adapter.algo_data = &port->bit;434434+ port->bit.udelay = 10;435435+ port->bit.timeout = usecs_to_jiffies(2200);436436+ port->bit.data = port;437437+ port->bit.setsda = i2c_drive_sda;438438+ port->bit.setscl = i2c_drive_scl;439439+ port->bit.getsda = i2c_sense_sda;440440+ port->bit.getscl = i2c_sense_scl;441441+442442+ i2c_drive_scl(port, 0);443443+ i2c_drive_sda(port, 1);444444+ i2c_drive_scl(port, 1);445445+446446+ ret = i2c_bit_add_bus(&port->adapter);447447+ } else {448448+ port->adapter.algo = &nouveau_dp_i2c_algo;449449+ ret = i2c_add_adapter(&port->adapter);450450+ }451451+257452 if (ret) {258453 NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret);259454 kfree(port);
···17271727 bitmap->chunkshift = (ffz(~mddev->bitmap_info.chunksize)17281728 - BITMAP_BLOCK_SHIFT);1729172917301730- /* now that chunksize and chunkshift are set, we can use these macros */17311731- chunks = (blocks + bitmap->chunkshift - 1) >>17301730+ chunks = (blocks + (1 << bitmap->chunkshift) - 1) >>17321731 bitmap->chunkshift;17331732 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;17341733
-3
drivers/md/bitmap.h
···101101102102#define BITMAP_BLOCK_SHIFT 9103103104104-/* how many blocks per chunk? (this is variable) */105105-#define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->mddev->bitmap_info.chunksize >> BITMAP_BLOCK_SHIFT)106106-107104#endif108105109106/*
+1-1
drivers/md/dm-log-userspace-transfer.c
···134134{135135 struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1);136136137137- if (!cap_raised(current_cap(), CAP_SYS_ADMIN))137137+ if (!capable(CAP_SYS_ADMIN))138138 return;139139140140 spin_lock(&receiving_list_lock);
+2-2
drivers/md/dm-mpath.c
···718718 return 0;719719720720 m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL);721721- request_module("scsi_dh_%s", m->hw_handler_name);722722- if (scsi_dh_handler_exist(m->hw_handler_name) == 0) {721721+ if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name),722722+ "scsi_dh_%s", m->hw_handler_name)) {723723 ti->error = "unknown hardware handler type";724724 ret = -EINVAL;725725 goto fail;
···19211921 } else {19221922 /* default values */19231923 switch (c->delivery_system) {19241924+ case SYS_DVBS:19251925+ case SYS_DVBS2:19261926+ case SYS_ISDBS:19271927+ case SYS_TURBO:19241928 case SYS_DVBC_ANNEX_A:19251929 case SYS_DVBC_ANNEX_C:19261930 fepriv->min_delay = HZ / 20;
···29232923 * not the JPEG end of frame ('ff d9').29242924 */2925292529262926+ /* count the packets and their size */29272927+ sd->npkt++;29282928+ sd->pktsz += len;29292929+29262930/*fixme: assumption about the following code:29272931 * - there can be only one marker in a packet29282932 */···29482944 return;29492945 data += i;29502946 }29512951-29522952- /* count the packets and their size */29532953- sd->npkt++;29542954- sd->pktsz += len;2955294729562948 /* search backwards if there is a marker in the packet */29572949 for (i = len - 1; --i >= 0; ) {
···246246247247}248248249249-static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane)250250-{251251- if (!fr || plane >= fr->fmt->memplanes)252252- return 0;253253- return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8;254254-}255255-256256-static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,249249+static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,257250 unsigned int *num_buffers, unsigned int *num_planes,258251 unsigned int sizes[], void *allocators[])259252{253253+ const struct v4l2_pix_format_mplane *pixm = NULL;260254 struct fimc_ctx *ctx = vq->drv_priv;261261- struct fimc_fmt *fmt = ctx->d_frame.fmt;255255+ struct fimc_frame *frame = &ctx->d_frame;256256+ struct fimc_fmt *fmt = frame->fmt;257257+ unsigned long wh;262258 int i;263259264264- if (!fmt)260260+ if (pfmt) {261261+ pixm = &pfmt->fmt.pix_mp;262262+ fmt = fimc_find_format(&pixm->pixelformat, NULL,263263+ FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1);264264+ wh = pixm->width * pixm->height;265265+ } else {266266+ wh = frame->f_width * frame->f_height;267267+ }268268+269269+ if (fmt == NULL)265270 return -EINVAL;266271267272 *num_planes = fmt->memplanes;268273269274 for (i = 0; i < fmt->memplanes; i++) {270270- sizes[i] = get_plane_size(&ctx->d_frame, i);275275+ unsigned int size = (wh * fmt->depth[i]) / 8;276276+ if (pixm)277277+ sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);278278+ else279279+ sizes[i] = size;271280 allocators[i] = ctx->fimc_dev->alloc_ctx;272281 }273282···13921383 fimc_capture_try_crop(ctx, r, crop->pad);1393138413941385 if (crop->which == V4L2_SUBDEV_FORMAT_TRY) {13951395- mutex_lock(&fimc->lock);13861386+ mutex_unlock(&fimc->lock);13961387 *v4l2_subdev_get_try_crop(fh, crop->pad) = *r;13971388 return 0;13981389 }
+2-2
drivers/media/video/s5p-fimc/fimc-core.c
···10481048 * @mask: the color flags to match10491049 * @index: offset in the fimc_formats array, ignored if negative10501050 */10511051-struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code,10511051+struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,10521052 unsigned int mask, int index)10531053{10541054 struct fimc_fmt *fmt, *def_fmt = NULL;10551055 unsigned int i;10561056 int id = 0;1057105710581058- if (index >= ARRAY_SIZE(fimc_formats))10581058+ if (index >= (int)ARRAY_SIZE(fimc_formats))10591059 return NULL;1060106010611061 for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) {
···55555656 return vma_copy;5757}5858+EXPORT_SYMBOL_GPL(vb2_get_vma);58595960/**6061 * vb2_put_userptr() - release a userspace virtual memory area
+1-1
drivers/mtd/mtdchar.c
···376376 * Make a fake call to mtd_read_fact_prot_reg() to check if OTP377377 * operations are supported.378378 */379379- if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP)379379+ if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP)380380 return -EOPNOTSUPP;381381382382 switch (mode) {
+6-11
drivers/mtd/nand/ams-delta.c
···212212 /* Link the private data with the MTD structure */213213 ams_delta_mtd->priv = this;214214215215- if (!request_mem_region(res->start, resource_size(res),216216- dev_name(&pdev->dev))) {217217- dev_err(&pdev->dev, "request_mem_region failed\n");218218- err = -EBUSY;219219- goto out_free;220220- }215215+ /*216216+ * Don't try to request the memory region from here,217217+ * it should have been already requested from the218218+ * gpio-omap driver and requesting it again would fail.219219+ */221220222221 io_base = ioremap(res->start, resource_size(res));223222 if (io_base == NULL) {224223 dev_err(&pdev->dev, "ioremap failed\n");225224 err = -EIO;226226- goto out_release_io;225225+ goto out_free;227226 }228227229228 this->priv = io_base;···270271 platform_set_drvdata(pdev, NULL);271272 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);272273 iounmap(io_base);273273-out_release_io:274274- release_mem_region(res->start, resource_size(res));275274out_free:276275 kfree(ams_delta_mtd);277276 out:···282285static int __devexit ams_delta_cleanup(struct platform_device *pdev)283286{284287 void __iomem *io_base = platform_get_drvdata(pdev);285285- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);286288287289 /* Release resources, unregister device */288290 nand_release(ams_delta_mtd);···289293 gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));290294 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);291295 iounmap(io_base);292292- release_mem_region(res->start, resource_size(res));293296294297 /* Free the MTD device structure */295298 kfree(ams_delta_mtd);
+12-6
drivers/net/bonding/bond_3ad.c
···21732173 * received frames (loopback). Since only the payload is given to this21742174 * function, it check for loopback.21752175 */21762176-static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length)21762176+static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length)21772177{21782178 struct port *port;21792179+ int ret = RX_HANDLER_ANOTHER;2179218021802181 if (length >= sizeof(struct lacpdu)) {21812182···21852184 if (!port->slave) {21862185 pr_warning("%s: Warning: port of slave %s is uninitialized\n",21872186 slave->dev->name, slave->dev->master->name);21882188- return;21872187+ return ret;21892188 }2190218921912190 switch (lacpdu->subtype) {21922191 case AD_TYPE_LACPDU:21922192+ ret = RX_HANDLER_CONSUMED;21932193 pr_debug("Received LACPDU on port %d\n",21942194 port->actor_port_number);21952195 /* Protect against concurrent state machines */···22002198 break;2201219922022200 case AD_TYPE_MARKER:22012201+ ret = RX_HANDLER_CONSUMED;22032202 // No need to convert fields to Little Endian since we don't use the marker's fields.2204220322052204 switch (((struct bond_marker *)lacpdu)->tlv_type) {···22222219 }22232220 }22242221 }22222222+ return ret;22252223}2226222422272225/**···24602456 return NETDEV_TX_OK;24612457}2462245824632463-void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,24592459+int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,24642460 struct slave *slave)24652461{24622462+ int ret = RX_HANDLER_ANOTHER;24662463 if (skb->protocol != PKT_TYPE_LACPDU)24672467- return;24642464+ return ret;2468246524692466 if (!pskb_may_pull(skb, sizeof(struct lacpdu)))24702470- return;24672467+ return ret;2471246824722469 read_lock(&bond->lock);24732473- bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);24702470+ ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);24742471 read_unlock(&bond->lock);24722472+ return ret;24752473}2476247424772475/*
···342342 _unlock_rx_hashtbl_bh(bond);343343}344344345345-static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,345345+static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,346346 struct slave *slave)347347{348348 struct arp_pkt *arp;349349350350 if (skb->protocol != cpu_to_be16(ETH_P_ARP))351351- return;351351+ goto out;352352353353 arp = (struct arp_pkt *) skb->data;354354 if (!arp) {355355 pr_debug("Packet has no ARP data\n");356356- return;356356+ goto out;357357 }358358359359 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))360360- return;360360+ goto out;361361362362 if (skb->len < sizeof(struct arp_pkt)) {363363 pr_debug("Packet is too small to be an ARP\n");364364- return;364364+ goto out;365365 }366366367367 if (arp->op_code == htons(ARPOP_REPLY)) {···369369 rlb_update_entry_from_arp(bond, arp);370370 pr_debug("Server received an ARP Reply from client\n");371371 }372372+out:373373+ return RX_HANDLER_ANOTHER;372374}373375374376/* Caller must hold bond lock for read */
···11031103 adapter->flags |= IGB_FLAG_HAS_MSI;11041104out:11051105 /* Notify the stack of the (possibly) reduced queue counts. */11061106+ rtnl_lock();11061107 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);11071107- return netif_set_real_num_rx_queues(adapter->netdev,11081108- adapter->num_rx_queues);11081108+ err = netif_set_real_num_rx_queues(adapter->netdev,11091109+ adapter->num_rx_queues);11101110+ rtnl_unlock();11111111+ return err;11091112}1110111311111114/**···67096706 pci_enable_wake(pdev, PCI_D3hot, 0);67106707 pci_enable_wake(pdev, PCI_D3cold, 0);6711670867126712- if (!rtnl_is_locked()) {67136713- /*67146714- * shut up ASSERT_RTNL() warning in67156715- * netif_set_real_num_tx/rx_queues.67166716- */67176717- rtnl_lock();67186718- err = igb_init_interrupt_scheme(adapter);67196719- rtnl_unlock();67206720- } else {67216721- err = igb_init_interrupt_scheme(adapter);67226722- }67236723- if (err) {67096709+ if (igb_init_interrupt_scheme(adapter)) {67246710 dev_err(&pdev->dev, "Unable to allocate memory for queues\n");67256711 return -ENOMEM;67266712 }
+4-3
drivers/net/ethernet/micrel/ks8851.c
···618618 netif_dbg(ks, intr, ks->netdev,619619 "%s: status 0x%04x\n", __func__, status);620620621621- if (status & IRQ_LCI) {622622- /* should do something about checking link status */621621+ if (status & IRQ_LCI)623622 handled |= IRQ_LCI;624624- }625623626624 if (status & IRQ_LDI) {627625 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR);···681683 }682684683685 mutex_unlock(&ks->lock);686686+687687+ if (status & IRQ_LCI)688688+ mii_check_link(&ks->mii);684689685690 if (status & IRQ_TXI)686691 netif_wake_queue(ks->netdev);
-2
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
···584584/**585585 * struct pch_gbe_adapter - board specific private data structure586586 * @stats_lock: Spinlock structure for status587587- * @tx_queue_lock: Spinlock structure for transmit588587 * @ethtool_lock: Spinlock structure for ethtool589588 * @irq_sem: Semaphore for interrupt590589 * @netdev: Pointer of network device structure···608609609610struct pch_gbe_adapter {610611 spinlock_t stats_lock;611611- spinlock_t tx_queue_lock;612612 spinlock_t ethtool_lock;613613 atomic_t irq_sem;614614 struct net_device *netdev;
···645645 */646646static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter)647647{648648- int size;649649-650650- size = (int)sizeof(struct pch_gbe_tx_ring);651651- adapter->tx_ring = kzalloc(size, GFP_KERNEL);648648+ adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL);652649 if (!adapter->tx_ring)653650 return -ENOMEM;654654- size = (int)sizeof(struct pch_gbe_rx_ring);655655- adapter->rx_ring = kzalloc(size, GFP_KERNEL);651651+652652+ adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL);656653 if (!adapter->rx_ring) {657654 kfree(adapter->tx_ring);658655 return -ENOMEM;···11661169 struct sk_buff *tmp_skb;11671170 unsigned int frame_ctrl;11681171 unsigned int ring_num;11691169- unsigned long flags;1170117211711173 /*-- Set frame control --*/11721174 frame_ctrl = 0;···12121216 }12131217 }12141218 }12151215- spin_lock_irqsave(&tx_ring->tx_lock, flags);12191219+12161220 ring_num = tx_ring->next_to_use;12171221 if (unlikely((ring_num + 1) == tx_ring->count))12181222 tx_ring->next_to_use = 0;12191223 else12201224 tx_ring->next_to_use = ring_num + 1;1221122512221222- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);12261226+12231227 buffer_info = &tx_ring->buffer_info[ring_num];12241228 tmp_skb = buffer_info->skb;12251229···15211525 &rx_ring->rx_buff_pool_logic,15221526 GFP_KERNEL);15231527 if (!rx_ring->rx_buff_pool) {15241524- pr_err("Unable to allocate memory for the receive poll buffer\n");15281528+ pr_err("Unable to allocate memory for the receive pool buffer\n");15251529 return -ENOMEM;15261530 }15271531 memset(rx_ring->rx_buff_pool, 0, size);···16401644 pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n",16411645 cleaned_count);16421646 /* Recover from running out of Tx resources in xmit_frame */16471647+ spin_lock(&tx_ring->tx_lock);16431648 if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) {16441649 netif_wake_queue(adapter->netdev);16451650 adapter->stats.tx_restart_count++;16461651 pr_debug("Tx wake queue\n");16471652 }16481648- spin_lock(&adapter->tx_queue_lock);16531653+16491654 tx_ring->next_to_clean = i;16501650- spin_unlock(&adapter->tx_queue_lock);16551655+16511656 pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean);16571657+ spin_unlock(&tx_ring->tx_lock);16521658 return cleaned;16531659}16541660···20412043 return -ENOMEM;20422044 }20432045 spin_lock_init(&adapter->hw.miim_lock);20442044- spin_lock_init(&adapter->tx_queue_lock);20452046 spin_lock_init(&adapter->stats_lock);20462047 spin_lock_init(&adapter->ethtool_lock);20472048 atomic_set(&adapter->irq_sem, 0);···21452148 tx_ring->next_to_use, tx_ring->next_to_clean);21462149 return NETDEV_TX_BUSY;21472150 }21482148- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);2149215121502152 /* CRC,ITAG no support */21512153 pch_gbe_tx_queue(adapter, tx_ring, skb);21542154+ spin_unlock_irqrestore(&tx_ring->tx_lock, flags);21522155 return NETDEV_TX_OK;21532156}21542157
+10-6
drivers/net/ethernet/realtek/r8169.c
···6363#define R8169_MSG_DEFAULT \6464 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)65656666-#define TX_BUFFS_AVAIL(tp) \6767- (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1)6666+#define TX_SLOTS_AVAIL(tp) \6767+ (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx)6868+6969+/* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */7070+#define TX_FRAGS_READY_FOR(tp,nr_frags) \7171+ (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1))68726973/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).7074 The RTL chips use a 64 element hash table based on the Ethernet CRC. */···54985494 u32 opts[2];54995495 int frags;5500549655015501- if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) {54975497+ if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {55025498 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");55035499 goto err_stop_0;55045500 }···5552554855535549 mmiowb();5554555055555555- if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) {55515551+ if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {55565552 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must55575553 * not miss a ring update when it notices a stopped queue.55585554 */···55665562 * can't.55675563 */55685564 smp_mb();55695569- if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)55655565+ if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS))55705566 netif_wake_queue(dev);55715567 }55725568···56895685 */56905686 smp_mb();56915687 if (netif_queue_stopped(dev) &&56925692- (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) {56885688+ TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {56935689 netif_wake_queue(dev);56945690 }56955691 /*
+1-1
drivers/net/ethernet/sfc/efx.c
···13541354 }1355135513561356 /* RSS might be usable on VFs even if it is disabled on the PF */13571357- efx->rss_spread = (efx->n_rx_channels > 1 ?13571357+ efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ?13581358 efx->n_rx_channels : efx_vf_size(efx));1359135913601360 return 0;
···175175176176 if (cmd->comp)177177 complete_all(cmd->comp);178178- mempool_free(cmd, virtscsi_cmd_pool);178178+ else179179+ mempool_free(cmd, virtscsi_cmd_pool);179180}180181181182static void virtscsi_ctrl_done(struct virtqueue *vq)···312311static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd)313312{314313 DECLARE_COMPLETION_ONSTACK(comp);315315- int ret;314314+ int ret = FAILED;316315317316 cmd->comp = ∁318318- ret = virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd,319319- sizeof cmd->req.tmf, sizeof cmd->resp.tmf,320320- GFP_NOIO);321321- if (ret < 0)322322- return FAILED;317317+ if (virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd,318318+ sizeof cmd->req.tmf, sizeof cmd->resp.tmf,319319+ GFP_NOIO) < 0)320320+ goto out;323321324322 wait_for_completion(&comp);325325- if (cmd->resp.tmf.response != VIRTIO_SCSI_S_OK &&326326- cmd->resp.tmf.response != VIRTIO_SCSI_S_FUNCTION_SUCCEEDED)327327- return FAILED;323323+ if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK ||324324+ cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED)325325+ ret = SUCCESS;328326329329- return SUCCESS;327327+out:328328+ mempool_free(cmd, virtscsi_cmd_pool);329329+ return ret;330330}331331332332static int virtscsi_device_reset(struct scsi_cmnd *sc)
-22
drivers/target/target_core_tpg.c
···6060 int i;6161 struct se_dev_entry *deve;6262 struct se_lun *lun;6363- struct se_lun_acl *acl, *acl_tmp;64636564 spin_lock_irq(&nacl->device_list_lock);6665 for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) {···8081 core_update_device_list_for_node(lun, NULL, deve->mapped_lun,8182 TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0);82838383- spin_lock(&lun->lun_acl_lock);8484- list_for_each_entry_safe(acl, acl_tmp,8585- &lun->lun_acl_list, lacl_list) {8686- if (!strcmp(acl->initiatorname, nacl->initiatorname) &&8787- (acl->mapped_lun == deve->mapped_lun))8888- break;8989- }9090-9191- if (!acl) {9292- pr_err("Unable to locate struct se_lun_acl for %s,"9393- " mapped_lun: %u\n", nacl->initiatorname,9494- deve->mapped_lun);9595- spin_unlock(&lun->lun_acl_lock);9696- spin_lock_irq(&nacl->device_list_lock);9797- continue;9898- }9999-100100- list_del(&acl->lacl_list);101101- spin_unlock(&lun->lun_acl_lock);102102-10384 spin_lock_irq(&nacl->device_list_lock);104104- kfree(acl);10585 }10686 spin_unlock_irq(&nacl->device_list_lock);10787}
+1-1
drivers/tty/vt/keyboard.c
···20442044 kbd->default_ledflagstate = ((arg >> 4) & 7);20452045 set_leds();20462046 spin_unlock_irqrestore(&kbd_event_lock, flags);20472047- break;20472047+ return 0;2048204820492049 /* the ioctls below only set the lights, not the functions */20502050 /* for those, see KDGKBLED and KDSKBLED above */
+6-1
drivers/vhost/net.c
···2424#include <linux/if_arp.h>2525#include <linux/if_tun.h>2626#include <linux/if_macvlan.h>2727+#include <linux/if_vlan.h>27282829#include <net/sock.h>2930···287286288287 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags);289288 head = skb_peek(&sk->sk_receive_queue);290290- if (likely(head))289289+ if (likely(head)) {291290 len = head->len;291291+ if (vlan_tx_tag_present(head))292292+ len += VLAN_HLEN;293293+ }294294+292295 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags);293296 return len;294297}
···7373 struct uvesafb_task *utask;7474 struct uvesafb_ktask *task;75757676- if (!cap_raised(current_cap(), CAP_SYS_ADMIN))7676+ if (!capable(CAP_SYS_ADMIN))7777 return;78787979 if (msg->seq >= UVESAFB_TASKS_MAX)
+16-11
drivers/video/xen-fbfront.c
···365365 struct fb_info *fb_info;366366 int fb_size;367367 int val;368368- int ret;368368+ int ret = 0;369369370370 info = kzalloc(sizeof(*info), GFP_KERNEL);371371 if (info == NULL) {···458458 xenfb_init_shared_page(info, fb_info);459459460460 ret = xenfb_connect_backend(dev, info);461461- if (ret < 0)462462- goto error;461461+ if (ret < 0) {462462+ xenbus_dev_fatal(dev, ret, "xenfb_connect_backend");463463+ goto error_fb;464464+ }463465464466 ret = register_framebuffer(fb_info);465467 if (ret) {466466- fb_deferred_io_cleanup(fb_info);467467- fb_dealloc_cmap(&fb_info->cmap);468468- framebuffer_release(fb_info);469468 xenbus_dev_fatal(dev, ret, "register_framebuffer");470470- goto error;469469+ goto error_fb;471470 }472471 info->fb_info = fb_info;473472474473 xenfb_make_preferred_console();475474 return 0;476475477477- error_nomem:478478- ret = -ENOMEM;479479- xenbus_dev_fatal(dev, ret, "allocating device memory");480480- error:476476+error_fb:477477+ fb_deferred_io_cleanup(fb_info);478478+ fb_dealloc_cmap(&fb_info->cmap);479479+ framebuffer_release(fb_info);480480+error_nomem:481481+ if (!ret) {482482+ ret = -ENOMEM;483483+ xenbus_dev_fatal(dev, ret, "allocating device memory");484484+ }485485+error:481486 xenfb_remove(dev);482487 return ret;483488}
+10-8
drivers/xen/Kconfig
···183183 depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ184184 default m185185 help186186- This ACPI processor uploads Power Management information to the Xen hypervisor.186186+ This ACPI processor uploads Power Management information to the Xen187187+ hypervisor.187188188188- To do that the driver parses the Power Management data and uploads said189189- information to the Xen hypervisor. Then the Xen hypervisor can select the190190- proper Cx and Pxx states. It also registers itslef as the SMM so that191191- other drivers (such as ACPI cpufreq scaling driver) will not load.189189+ To do that the driver parses the Power Management data and uploads190190+ said information to the Xen hypervisor. Then the Xen hypervisor can191191+ select the proper Cx and Pxx states. It also registers itslef as the192192+ SMM so that other drivers (such as ACPI cpufreq scaling driver) will193193+ not load.192194193193- To compile this driver as a module, choose M here: the194194- module will be called xen_acpi_processor If you do not know what to choose,195195- select M here. If the CPUFREQ drivers are built in, select Y here.195195+ To compile this driver as a module, choose M here: the module will be196196+ called xen_acpi_processor If you do not know what to choose, select197197+ M here. If the CPUFREQ drivers are built in, select Y here.196198197199endmenu
+19-9
fs/btrfs/ctree.c
···220220 */221221static void add_root_to_dirty_list(struct btrfs_root *root)222222{223223+ spin_lock(&root->fs_info->trans_lock);223224 if (root->track_dirty && list_empty(&root->dirty_list)) {224225 list_add(&root->dirty_list,225226 &root->fs_info->dirty_cowonly_roots);226227 }228228+ spin_unlock(&root->fs_info->trans_lock);227229}228230229231/*···725723726724 cur = btrfs_find_tree_block(root, blocknr, blocksize);727725 if (cur)728728- uptodate = btrfs_buffer_uptodate(cur, gen);726726+ uptodate = btrfs_buffer_uptodate(cur, gen, 0);729727 else730728 uptodate = 0;731729 if (!cur || !uptodate) {···13601358 block1 = btrfs_node_blockptr(parent, slot - 1);13611359 gen = btrfs_node_ptr_generation(parent, slot - 1);13621360 eb = btrfs_find_tree_block(root, block1, blocksize);13631363- if (eb && btrfs_buffer_uptodate(eb, gen))13611361+ /*13621362+ * if we get -eagain from btrfs_buffer_uptodate, we13631363+ * don't want to return eagain here. That will loop13641364+ * forever13651365+ */13661366+ if (eb && btrfs_buffer_uptodate(eb, gen, 1) != 0)13641367 block1 = 0;13651368 free_extent_buffer(eb);13661369 }···13731366 block2 = btrfs_node_blockptr(parent, slot + 1);13741367 gen = btrfs_node_ptr_generation(parent, slot + 1);13751368 eb = btrfs_find_tree_block(root, block2, blocksize);13761376- if (eb && btrfs_buffer_uptodate(eb, gen))13691369+ if (eb && btrfs_buffer_uptodate(eb, gen, 1) != 0)13771370 block2 = 0;13781371 free_extent_buffer(eb);13791372 }···1511150415121505 tmp = btrfs_find_tree_block(root, blocknr, blocksize);15131506 if (tmp) {15141514- if (btrfs_buffer_uptodate(tmp, 0)) {15151515- if (btrfs_buffer_uptodate(tmp, gen)) {15071507+ /* first we do an atomic uptodate check */15081508+ if (btrfs_buffer_uptodate(tmp, 0, 1) > 0) {15091509+ if (btrfs_buffer_uptodate(tmp, gen, 1) > 0) {15161510 /*15171511 * we found an up to date block without15181512 * sleeping, return···15311523 free_extent_buffer(tmp);15321524 btrfs_set_path_blocking(p);1533152515261526+ /* now we're allowed to do a blocking uptodate check */15341527 tmp = read_tree_block(root, blocknr, blocksize, gen);15351535- if (tmp && btrfs_buffer_uptodate(tmp, gen)) {15281528+ if (tmp && btrfs_buffer_uptodate(tmp, gen, 0) > 0) {15361529 *eb_ret = tmp;15371530 return 0;15381531 }···15681559 * and give up so that our caller doesn't loop forever15691560 * on our EAGAINs.15701561 */15711571- if (!btrfs_buffer_uptodate(tmp, 0))15621562+ if (!btrfs_buffer_uptodate(tmp, 0, 0))15721563 ret = -EIO;15731564 free_extent_buffer(tmp);15741565 }···40524043 tmp = btrfs_find_tree_block(root, blockptr,40534044 btrfs_level_size(root, level - 1));4054404540554055- if (tmp && btrfs_buffer_uptodate(tmp, gen)) {40464046+ if (tmp && btrfs_buffer_uptodate(tmp, gen, 1) > 0) {40564047 free_extent_buffer(tmp);40574048 break;40584049 }···41754166 struct extent_buffer *cur;41764167 cur = btrfs_find_tree_block(root, blockptr,41774168 btrfs_level_size(root, level - 1));41784178- if (!cur || !btrfs_buffer_uptodate(cur, gen)) {41694169+ if (!cur ||41704170+ btrfs_buffer_uptodate(cur, gen, 1) <= 0) {41794171 slot++;41804172 if (cur)41814173 free_extent_buffer(cur);
+13-5
fs/btrfs/disk-io.c
···323323 * in the wrong place.324324 */325325static int verify_parent_transid(struct extent_io_tree *io_tree,326326- struct extent_buffer *eb, u64 parent_transid)326326+ struct extent_buffer *eb, u64 parent_transid,327327+ int atomic)327328{328329 struct extent_state *cached_state = NULL;329330 int ret;330331331332 if (!parent_transid || btrfs_header_generation(eb) == parent_transid)332333 return 0;334334+335335+ if (atomic)336336+ return -EAGAIN;333337334338 lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1,335339 0, &cached_state);···376372 ret = read_extent_buffer_pages(io_tree, eb, start,377373 WAIT_COMPLETE,378374 btree_get_extent, mirror_num);379379- if (!ret && !verify_parent_transid(io_tree, eb, parent_transid))375375+ if (!ret && !verify_parent_transid(io_tree, eb,376376+ parent_transid, 0))380377 break;381378382379 /*···12071202 root->commit_root = NULL;12081203 root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item),12091204 blocksize, generation);12101210- if (!root->node || !btrfs_buffer_uptodate(root->node, generation)) {12051205+ if (!root->node || !btrfs_buffer_uptodate(root->node, generation, 0)) {12111206 free_extent_buffer(root->node);12121207 root->node = NULL;12131208 return -EIO;···31483143 return 0;31493144}3150314531513151-int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid)31463146+int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid,31473147+ int atomic)31523148{31533149 int ret;31543150 struct inode *btree_inode = buf->pages[0]->mapping->host;···31593153 return ret;3160315431613155 ret = verify_parent_transid(&BTRFS_I(btree_inode)->io_tree, buf,31623162- parent_transid);31563156+ parent_transid, atomic);31573157+ if (ret == -EAGAIN)31583158+ return ret;31633159 return !ret;31643160}31653161
···279279 log->fs_info->extent_root,280280 eb->start, eb->len);281281282282- if (btrfs_buffer_uptodate(eb, gen)) {282282+ if (btrfs_buffer_uptodate(eb, gen, 0)) {283283 if (wc->write)284284 btrfs_write_tree_block(eb);285285 if (wc->wait)
+2-2
fs/cifs/cifsfs.c
···442442 seq_printf(s, ",rsize=%u", cifs_sb->rsize);443443 seq_printf(s, ",wsize=%u", cifs_sb->wsize);444444 /* convert actimeo and display it in seconds */445445- seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ);445445+ seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ);446446447447 return 0;448448}···699699 * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate700700 * the cached file length701701 */702702- if (origin != SEEK_SET || origin != SEEK_CUR) {702702+ if (origin != SEEK_SET && origin != SEEK_CUR) {703703 int rc;704704 struct inode *inode = file->f_path.dentry->d_inode;705705
···668668 return 0;669669 else {670670 /*671671- * Forcibly invalidate automounting directory inodes672672- * (remote DFS directories) so to have them673673- * instantiated again for automount671671+ * If the inode wasn't known to be a dfs entry when672672+ * the dentry was instantiated, such as when created673673+ * via ->readdir(), it needs to be set now since the674674+ * attributes will have been updated by675675+ * cifs_revalidate_dentry().674676 */675675- if (IS_AUTOMOUNT(direntry->d_inode))676676- return 0;677677+ if (IS_AUTOMOUNT(direntry->d_inode) &&678678+ !(direntry->d_flags & DCACHE_NEED_AUTOMOUNT)) {679679+ spin_lock(&direntry->d_lock);680680+ direntry->d_flags |= DCACHE_NEED_AUTOMOUNT;681681+ spin_unlock(&direntry->d_lock);682682+ }683683+677684 return 1;678685 }679686 }
+22-4
fs/dcache.c
···141141 * Compare 2 name strings, return 0 if they match, otherwise non-zero.142142 * The strings are both count bytes long, and count is non-zero.143143 */144144+#ifdef CONFIG_DCACHE_WORD_ACCESS145145+146146+#include <asm/word-at-a-time.h>147147+/*148148+ * NOTE! 'cs' and 'scount' come from a dentry, so it has a149149+ * aligned allocation for this particular component. We don't150150+ * strictly need the load_unaligned_zeropad() safety, but it151151+ * doesn't hurt either.152152+ *153153+ * In contrast, 'ct' and 'tcount' can be from a pathname, and do154154+ * need the careful unaligned handling.155155+ */144156static inline int dentry_cmp(const unsigned char *cs, size_t scount,145157 const unsigned char *ct, size_t tcount)146158{147147-#ifdef CONFIG_DCACHE_WORD_ACCESS148159 unsigned long a,b,mask;149160150161 if (unlikely(scount != tcount))151162 return 1;152163153164 for (;;) {154154- a = *(unsigned long *)cs;155155- b = *(unsigned long *)ct;165165+ a = load_unaligned_zeropad(cs);166166+ b = load_unaligned_zeropad(ct);156167 if (tcount < sizeof(unsigned long))157168 break;158169 if (unlikely(a != b))···176165 }177166 mask = ~(~0ul << tcount*8);178167 return unlikely(!!((a ^ b) & mask));168168+}169169+179170#else171171+172172+static inline int dentry_cmp(const unsigned char *cs, size_t scount,173173+ const unsigned char *ct, size_t tcount)174174+{180175 if (scount != tcount)181176 return 1;182177···194177 tcount--;195178 } while (tcount);196179 return 0;197197-#endif198180}181181+182182+#endif199183200184static void __d_free(struct rcu_head *head)201185{
···150150 filp->f_pos++;151151 /* fall through */152152 case 1:153153+ if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) {154154+ err = -EIO;155155+ goto out;156156+ }157157+153158 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,154159 fd.entrylength);155160 if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) {···186181 err = -EIO;187182 goto out;188183 }184184+185185+ if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) {186186+ err = -EIO;187187+ goto out;188188+ }189189+189190 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,190191 fd.entrylength);191192 type = be16_to_cpu(entry.type);
+1-1
fs/jffs2/gc.c
···234234 return 0;235235236236 jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n");237237- spin_lock(&c->erase_completion_lock);238237 mutex_lock(&c->alloc_sem);238238+ spin_lock(&c->erase_completion_lock);239239 }240240241241 /* First, work out which block we're garbage-collecting */
+2-2
fs/namei.c
···14291429 unsigned long hash = 0;1430143014311431 for (;;) {14321432- a = *(unsigned long *)name;14321432+ a = load_unaligned_zeropad(name);14331433 if (len < sizeof(unsigned long))14341434 break;14351435 hash += a;···14591459 do {14601460 hash = (hash + a) * 9;14611461 len += sizeof(unsigned long);14621462- a = *(unsigned long *)(name+len);14621462+ a = load_unaligned_zeropad(name+len);14631463 /* Do we have any NUL or '/' bytes in this word? */14641464 mask = has_zero(a) | has_zero(a ^ REPEAT_BYTE('/'));14651465 } while (!mask);
+10-2
fs/proc/task_mmu.c
···747747 else if (pte_present(pte))748748 *pme = make_pme(PM_PFRAME(pte_pfn(pte))749749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);750750+ else751751+ *pme = make_pme(PM_NOT_PRESENT);750752}751753752754#ifdef CONFIG_TRANSPARENT_HUGEPAGE···763761 if (pmd_present(pmd))764762 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset)765763 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);764764+ else765765+ *pme = make_pme(PM_NOT_PRESENT);766766}767767#else768768static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme,···805801806802 /* check to see if we've left 'vma' behind807803 * and need a new, higher one */808808- if (vma && (addr >= vma->vm_end))804804+ if (vma && (addr >= vma->vm_end)) {809805 vma = find_vma(walk->mm, addr);806806+ pme = make_pme(PM_NOT_PRESENT);807807+ }810808811809 /* check that 'vma' actually covers this address,812810 * and that it isn't a huge page vma */···836830 if (pte_present(pte))837831 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset)838832 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);833833+ else834834+ *pme = make_pme(PM_NOT_PRESENT);839835}840836841837/* This function walks within one hugetlb entry in the single call */···847839{848840 struct pagemapread *pm = walk->private;849841 int err = 0;850850- pagemap_entry_t pme = make_pme(PM_NOT_PRESENT);842842+ pagemap_entry_t pme;851843852844 for (; addr != end; addr += PAGE_SIZE) {853845 int offset = (addr & ~hmask) >> PAGE_SHIFT;
···9999#endif100100};101101102102+static size_t103103+htable_size(u8 hbits)104104+{105105+ size_t hsize;106106+107107+ /* We must fit both into u32 in jhash and size_t */108108+ if (hbits > 31)109109+ return 0;110110+ hsize = jhash_size(hbits);111111+ if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket)112112+ < hsize)113113+ return 0;114114+115115+ return hsize * sizeof(struct hbucket) + sizeof(struct htable);116116+}117117+102118/* Compute htable_bits from the user input parameter hashsize */103119static u8104120htable_bits(u32 hashsize)
+22-1
include/linux/seqlock.h
···141141 unsigned ret;142142143143repeat:144144- ret = s->sequence;144144+ ret = ACCESS_ONCE(s->sequence);145145 if (unlikely(ret & 1)) {146146 cpu_relax();147147 goto repeat;···163163 unsigned ret = __read_seqcount_begin(s);164164 smp_rmb();165165 return ret;166166+}167167+168168+/**169169+ * raw_seqcount_begin - begin a seq-read critical section170170+ * @s: pointer to seqcount_t171171+ * Returns: count to be passed to read_seqcount_retry172172+ *173173+ * raw_seqcount_begin opens a read critical section of the given seqcount.174174+ * Validity of the critical section is tested by checking read_seqcount_retry175175+ * function.176176+ *177177+ * Unlike read_seqcount_begin(), this function will not wait for the count178178+ * to stabilize. If a writer is active when we begin, we will fail the179179+ * read_seqcount_retry() instead of stabilizing at the beginning of the180180+ * critical section.181181+ */182182+static inline unsigned raw_seqcount_begin(const seqcount_t *s)183183+{184184+ unsigned ret = ACCESS_ONCE(s->sequence);185185+ smp_rmb();186186+ return ret & ~1;166187}167188168189/**
+2-1
include/linux/usb/usbnet.h
···191191enum skb_state {192192 illegal = 0,193193 tx_start, tx_done,194194- rx_start, rx_done, rx_cleanup194194+ rx_start, rx_done, rx_cleanup,195195+ unlink_start195196};196197197198struct skb_data { /* skb->cb is one of these */
···704704 addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff);705705}706706707707+/* The cookie is always 0 since this is how it's used in the708708+ * pmtu code.709709+ */710710+static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)711711+{712712+ if (t->dst && !dst_check(t->dst, 0)) {713713+ dst_release(t->dst);714714+ t->dst = NULL;715715+ }716716+717717+ return t->dst;718718+}719719+707720#endif /* __net_sctp_h__ */
+1-1
init/do_mounts.c
···472472void __init mount_root(void)473473{474474#ifdef CONFIG_ROOT_NFS475475- if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {475475+ if (ROOT_DEV == Root_NFS) {476476 if (mount_nfs_root())477477 return;478478
+46-17
kernel/compat.c
···372372373373#ifdef __ARCH_WANT_SYS_SIGPROCMASK374374375375-asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,376376- compat_old_sigset_t __user *oset)375375+/*376376+ * sys_sigprocmask SIG_SETMASK sets the first (compat) word of the377377+ * blocked set of signals to the supplied signal set378378+ */379379+static inline void compat_sig_setmask(sigset_t *blocked, compat_sigset_word set)377380{378378- old_sigset_t s;379379- long ret;380380- mm_segment_t old_fs;381381+ memcpy(blocked->sig, &set, sizeof(set));382382+}381383382382- if (set && get_user(s, set))383383- return -EFAULT;384384- old_fs = get_fs();385385- set_fs(KERNEL_DS);386386- ret = sys_sigprocmask(how,387387- set ? (old_sigset_t __user *) &s : NULL,388388- oset ? (old_sigset_t __user *) &s : NULL);389389- set_fs(old_fs);390390- if (ret == 0)391391- if (oset)392392- ret = put_user(s, oset);393393- return ret;384384+asmlinkage long compat_sys_sigprocmask(int how,385385+ compat_old_sigset_t __user *nset,386386+ compat_old_sigset_t __user *oset)387387+{388388+ old_sigset_t old_set, new_set;389389+ sigset_t new_blocked;390390+391391+ old_set = current->blocked.sig[0];392392+393393+ if (nset) {394394+ if (get_user(new_set, nset))395395+ return -EFAULT;396396+ new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP));397397+398398+ new_blocked = current->blocked;399399+400400+ switch (how) {401401+ case SIG_BLOCK:402402+ sigaddsetmask(&new_blocked, new_set);403403+ break;404404+ case SIG_UNBLOCK:405405+ sigdelsetmask(&new_blocked, new_set);406406+ break;407407+ case SIG_SETMASK:408408+ compat_sig_setmask(&new_blocked, new_set);409409+ break;410410+ default:411411+ return -EINVAL;412412+ }413413+414414+ set_current_blocked(&new_blocked);415415+ }416416+417417+ if (oset) {418418+ if (put_user(old_set, oset))419419+ return -EFAULT;420420+ }421421+422422+ return 0;394423}395424396425#endif
+3
kernel/fork.c
···4747#include <linux/audit.h>4848#include <linux/memcontrol.h>4949#include <linux/ftrace.h>5050+#include <linux/proc_fs.h>5051#include <linux/profile.h>5152#include <linux/rmap.h>5253#include <linux/ksm.h>···14651464 if (p->io_context)14661465 exit_io_context(p);14671466bad_fork_cleanup_namespaces:14671467+ if (unlikely(clone_flags & CLONE_NEWPID))14681468+ pid_ns_release_proc(p->nsproxy->pid_ns);14681469 exit_task_namespaces(p);14691470bad_fork_cleanup_mm:14701471 if (p->mm)
···45074507swap_buffers:45084508 /* Swap primary and spare array */45094509 thresholds->spare = thresholds->primary;45104510+ /* If all events are unregistered, free the spare array */45114511+ if (!new) {45124512+ kfree(thresholds->spare);45134513+ thresholds->spare = NULL;45144514+ }45154515+45104516 rcu_assign_pointer(thresholds->primary, new);4511451745124518 /* To be sure that nobody uses thresholds */
+1-2
mm/nobootmem.c
···82828383static void __init __free_pages_memory(unsigned long start, unsigned long end)8484{8585- int i;8686- unsigned long start_aligned, end_aligned;8585+ unsigned long i, start_aligned, end_aligned;8786 int order = ilog2(BITS_PER_LONG);88878988 start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1);
+1-1
mm/page_alloc.c
···52035203 int ret;5204520452055205 ret = proc_dointvec_minmax(table, write, buffer, length, ppos);52065206- if (!write || (ret == -EINVAL))52065206+ if (!write || (ret < 0))52075207 return ret;52085208 for_each_populated_zone(zone) {52095209 for_each_possible_cpu(cpu) {
+17-5
mm/percpu.c
···11321132 for (alloc_end += gi->nr_units / upa;11331133 alloc < alloc_end; alloc++) {11341134 if (!(alloc % apl)) {11351135- printk("\n");11351135+ printk(KERN_CONT "\n");11361136 printk("%spcpu-alloc: ", lvl);11371137 }11381138- printk("[%0*d] ", group_width, group);11381138+ printk(KERN_CONT "[%0*d] ", group_width, group);1139113911401140 for (unit_end += upa; unit < unit_end; unit++)11411141 if (gi->cpu_map[unit] != NR_CPUS)11421142- printk("%0*d ", cpu_width,11421142+ printk(KERN_CONT "%0*d ", cpu_width,11431143 gi->cpu_map[unit]);11441144 else11451145- printk("%s ", empty_str);11451145+ printk(KERN_CONT "%s ", empty_str);11461146 }11471147 }11481148- printk("\n");11481148+ printk(KERN_CONT "\n");11491149}1150115011511151/**···16501650 areas[group] = ptr;1651165116521652 base = min(ptr, base);16531653+ }16541654+16551655+ /*16561656+ * Copy data and free unused parts. This should happen after all16571657+ * allocations are complete; otherwise, we may end up with16581658+ * overlapping groups.16591659+ */16601660+ for (group = 0; group < ai->nr_groups; group++) {16611661+ struct pcpu_group_info *gi = &ai->groups[group];16621662+ void *ptr = areas[group];1653166316541664 for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) {16551665 if (gi->cpu_map[i] == NR_CPUS) {···18951885 fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS));18961886 if (!ai || !fc)18971887 panic("Failed to allocate memory for percpu areas.");18881888+ /* kmemleak tracks the percpu allocations separately */18891889+ kmemleak_free(fc);1898189018991891 ai->dyn_size = unit_size;19001892 ai->unit_size = unit_size;
+1-1
net/8021q/vlan_dev.c
···157157 skb = __vlan_hwaccel_put_tag(skb, vlan_tci);158158 }159159160160- skb_set_dev(skb, vlan_dev_priv(dev)->real_dev);160160+ skb->dev = vlan_dev_priv(dev)->real_dev;161161 len = skb->len;162162 if (netpoll_tx_running(dev))163163 return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev);
···592592 sk->sk_state = BT_CONFIG;593593 chan->state = BT_CONFIG;594594595595- /* or for ACL link, under defer_setup time */596596- } else if (sk->sk_state == BT_CONNECT2 &&597597- bt_sk(sk)->defer_setup) {598598- err = l2cap_chan_check_security(chan);595595+ /* or for ACL link */596596+ } else if ((sk->sk_state == BT_CONNECT2 &&597597+ bt_sk(sk)->defer_setup) ||598598+ sk->sk_state == BT_CONNECTED) {599599+ if (!l2cap_chan_check_security(chan))600600+ bt_sk(sk)->suspended = true;601601+ else602602+ sk->sk_state_change(sk);599603 } else {600604 err = -EINVAL;601605 }
+5-31
net/core/dev.c
···16161616 return NET_RX_DROP;16171617 }16181618 skb->skb_iif = 0;16191619- skb_set_dev(skb, dev);16191619+ skb->dev = dev;16201620+ skb_dst_drop(skb);16201621 skb->tstamp.tv64 = 0;16211622 skb->pkt_type = PACKET_HOST;16221623 skb->protocol = eth_type_trans(skb, dev);16241624+ skb->mark = 0;16251625+ secpath_reset(skb);16261626+ nf_reset(skb);16231627 return netif_rx(skb);16241628}16251629EXPORT_SYMBOL_GPL(dev_forward_skb);···18701866 }18711867}18721868EXPORT_SYMBOL(netif_device_attach);18731873-18741874-/**18751875- * skb_dev_set -- assign a new device to a buffer18761876- * @skb: buffer for the new device18771877- * @dev: network device18781878- *18791879- * If an skb is owned by a device already, we have to reset18801880- * all data private to the namespace a device belongs to18811881- * before assigning it a new device.18821882- */18831883-#ifdef CONFIG_NET_NS18841884-void skb_set_dev(struct sk_buff *skb, struct net_device *dev)18851885-{18861886- skb_dst_drop(skb);18871887- if (skb->dev && !net_eq(dev_net(skb->dev), dev_net(dev))) {18881888- secpath_reset(skb);18891889- nf_reset(skb);18901890- skb_init_secmark(skb);18911891- skb->mark = 0;18921892- skb->priority = 0;18931893- skb->nf_trace = 0;18941894- skb->ipvs_property = 0;18951895-#ifdef CONFIG_NET_SCHED18961896- skb->tc_index = 0;18971897-#endif18981898- }18991899- skb->dev = dev;19001900-}19011901-EXPORT_SYMBOL(skb_set_dev);19021902-#endif /* CONFIG_NET_NS */1903186919041870static void skb_warn_bad_offload(const struct sk_buff *skb)19051871{
+8-2
net/core/pktgen.c
···19311931{19321932 struct net_device *dev = ptr;1933193319341934- if (!net_eq(dev_net(dev), &init_net))19341934+ if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting)19351935 return NOTIFY_DONE;1936193619371937 /* It is OK that we do not hold the group lock right now,···37543754{37553755 struct pktgen_thread *t;37563756 struct list_head *q, *n;37573757+ struct list_head list;3757375837583759 /* Stop all interfaces & threads */37593760 pktgen_exiting = true;3760376137613761- list_for_each_safe(q, n, &pktgen_threads) {37623762+ mutex_lock(&pktgen_thread_lock);37633763+ list_splice(&list, &pktgen_threads);37643764+ mutex_unlock(&pktgen_thread_lock);37653765+37663766+ list_for_each_safe(q, n, &list) {37623767 t = list_entry(q, struct pktgen_thread, th_list);37683768+ list_del(&t->th_list);37633769 kthread_stop(t->tsk);37643770 kfree(t);37653771 }
+2
net/ipv4/fib_trie.c
···1370137013711371 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos)13721372 continue;13731373+ if (fi->fib_dead)13741374+ continue;13731375 if (fa->fa_info->fib_scope < flp->flowi4_scope)13741376 continue;13751377 fib_alias_accessed(fa);
···377377 */378378 skb_set_owner_w(nskb, sk);379379380380- /* The 'obsolete' field of dst is set to 2 when a dst is freed. */381381- if (!dst || (dst->obsolete > 1)) {382382- dst_release(dst);380380+ if (!sctp_transport_dst_check(tp)) {383381 sctp_transport_route(tp, NULL, sctp_sk(sk));384382 if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) {385383 sctp_assoc_sync_pmtu(asoc);
-17
net/sctp/transport.c
···226226 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;227227}228228229229-/* this is a complete rip-off from __sk_dst_check230230- * the cookie is always 0 since this is how it's used in the231231- * pmtu code232232- */233233-static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)234234-{235235- struct dst_entry *dst = t->dst;236236-237237- if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) {238238- dst_release(t->dst);239239- t->dst = NULL;240240- return NULL;241241- }242242-243243- return dst;244244-}245245-246229void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)247230{248231 struct dst_entry *dst;
+4-3
net/sunrpc/auth_gss/gss_mech_switch.c
···242242int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr)243243{244244 struct gss_api_mech *pos = NULL;245245- int i = 0;245245+ int j, i = 0;246246247247 spin_lock(®istered_mechs_lock);248248 list_for_each_entry(pos, ®istered_mechs, gm_list) {249249- array_ptr[i] = pos->gm_pfs->pseudoflavor;250250- i++;249249+ for (j=0; j < pos->gm_pf_num; j++) {250250+ array_ptr[i++] = pos->gm_pfs[j].pseudoflavor;251251+ }251252 }252253 spin_unlock(®istered_mechs_lock);253254 return i;
+1-1
sound/pci/echoaudio/echoaudio_dsp.c
···475475 const struct firmware *fw;476476 int box_type, err;477477478478- if (snd_BUG_ON(!chip->dsp_code_to_load || !chip->comm_page))478478+ if (snd_BUG_ON(!chip->comm_page))479479 return -EPERM;480480481481 /* See if the ASIC is present and working - only if the DSP is already loaded */
-4
sound/pci/hda/hda_codec.c
···54445444 list_for_each_entry(codec, &bus->codec_list, list) {54455445 if (hda_codec_is_power_on(codec))54465446 hda_call_codec_suspend(codec);54475447- else /* forcibly change the power to D3 even if not used */54485448- hda_set_power_state(codec,54495449- codec->afg ? codec->afg : codec->mfg,54505450- AC_PWRST_D3);54515447 if (codec->patch_ops.post_suspend)54525448 codec->patch_ops.post_suspend(codec);54535449 }
+17-3
sound/pci/hda/hda_intel.c
···783783{784784 struct azx *chip = bus->private_data;785785 unsigned long timeout;786786+ unsigned long loopcounter;786787 int do_poll = 0;787788788789 again:789790 timeout = jiffies + msecs_to_jiffies(1000);790790- for (;;) {791791+792792+ for (loopcounter = 0;; loopcounter++) {791793 if (chip->polling_mode || do_poll) {792794 spin_lock_irq(&chip->reg_lock);793795 azx_update_rirb(chip);···805803 }806804 if (time_after(jiffies, timeout))807805 break;808808- if (bus->needs_damn_long_delay)806806+ if (bus->needs_damn_long_delay || loopcounter > 3000)809807 msleep(2); /* temporary workaround */810808 else {811809 udelay(10);···23532351 * power management23542352 */2355235323542354+static int snd_hda_codecs_inuse(struct hda_bus *bus)23552355+{23562356+ struct hda_codec *codec;23572357+23582358+ list_for_each_entry(codec, &bus->codec_list, list) {23592359+ if (snd_hda_codec_needs_resume(codec))23602360+ return 1;23612361+ }23622362+ return 0;23632363+}23642364+23562365static int azx_suspend(struct pci_dev *pci, pm_message_t state)23572366{23582367 struct snd_card *card = pci_get_drvdata(pci);···24102397 return -EIO;24112398 azx_init_pci(chip);2412239924132413- azx_init_chip(chip, 1);24002400+ if (snd_hda_codecs_inuse(chip->bus))24012401+ azx_init_chip(chip, 1);2414240224152403 snd_hda_resume(chip->bus);24162404 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
···36253625 int i, ret;3626362636273627 num_routes = of_property_count_strings(np, propname);36283628- if (num_routes & 1) {36283628+ if (num_routes < 0 || num_routes & 1) {36293629 dev_err(card->dev,36303630- "Property '%s's length is not even\n",36313631- propname);36303630+ "Property '%s' does not exist or its length is not even\n",36313631+ propname);36323632 return -EINVAL;36333633 }36343634 num_routes /= 2;