···356356 dest[27] = pt->r27;357357 dest[28] = pt->r28;358358 dest[29] = pt->gp;359359- dest[30] = rdusp();359359+ dest[30] = ti == current_thread_info() ? rdusp() : ti->pcb.usp;360360 dest[31] = pt->pc;361361362362 /* Once upon a time this was the PS value. Which is stupid
+14-40
arch/alpha/kernel/signal.c
···4141/*4242 * The OSF/1 sigprocmask calling sequence is different from the4343 * C sigprocmask() sequence..4444- *4545- * how:4646- * 1 - SIG_BLOCK4747- * 2 - SIG_UNBLOCK4848- * 3 - SIG_SETMASK4949- *5050- * We change the range to -1 .. 1 in order to let gcc easily5151- * use the conditional move instructions.5252- *5353- * Note that we don't need to acquire the kernel lock for SMP5454- * operation, as all of this is local to this thread.5544 */5656-SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask,5757- struct pt_regs *, regs)4545+SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask)5846{5959- unsigned long oldmask = -EINVAL;4747+ sigset_t oldmask;4848+ sigset_t mask;4949+ unsigned long res;60506161- if ((unsigned long)how-1 <= 2) {6262- long sign = how-2; /* -1 .. 1 */6363- unsigned long block, unblock;6464-6565- newmask &= _BLOCKABLE;6666- spin_lock_irq(¤t->sighand->siglock);6767- oldmask = current->blocked.sig[0];6868-6969- unblock = oldmask & ~newmask;7070- block = oldmask | newmask;7171- if (!sign)7272- block = unblock;7373- if (sign <= 0)7474- newmask = block;7575- if (_NSIG_WORDS > 1 && sign > 0)7676- sigemptyset(¤t->blocked);7777- current->blocked.sig[0] = newmask;7878- recalc_sigpending();7979- spin_unlock_irq(¤t->sighand->siglock);8080-8181- regs->r0 = 0; /* special no error return */5151+ siginitset(&mask, newmask & _BLOCKABLE);5252+ res = sigprocmask(how, &mask, &oldmask);5353+ if (!res) {5454+ force_successful_syscall_return();5555+ res = oldmask.sig[0];8256 }8383- return oldmask;5757+ return res;8458}85598660SYSCALL_DEFINE3(osf_sigaction, int, sig,···6894 old_sigset_t mask;6995 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||7096 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||7171- __get_user(new_ka.sa.sa_flags, &act->sa_flags))9797+ __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||9898+ __get_user(mask, &act->sa_mask))7299 return -EFAULT;7373- __get_user(mask, &act->sa_mask);74100 siginitset(&new_ka.sa.sa_mask, mask);75101 new_ka.ka_restorer = NULL;76102 }···80106 if (!ret && oact) {81107 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||82108 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||8383- __put_user(old_ka.sa.sa_flags, &oact->sa_flags))109109+ __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||110110+ __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))84111 return -EFAULT;8585- __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);86112 }8711388114 return ret;
···271271 bool "Atmel AT91"272272 select ARCH_REQUIRE_GPIOLIB273273 select HAVE_CLK274274- select ARCH_USES_GETTIMEOFFSET275274 help276275 This enables support for systems based on the Atmel AT91RM9200,277276 AT91SAM9 and AT91CAP9 processors.···10491050 workaround disables the write-allocate mode for the L2 cache via the10501051 ACTLR register. Note that setting specific bits in the ACTLR register10511052 may not be available in non-secure mode.10531053+10541054+config ARM_ERRATA_74223010551055+ bool "ARM errata: DMB operation may be faulty"10561056+ depends on CPU_V7 && SMP10571057+ help10581058+ This option enables the workaround for the 742230 Cortex-A910591059+ (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction10601060+ between two write operations may not ensure the correct visibility10611061+ ordering of the two writes. This workaround sets a specific bit in10621062+ the diagnostic register of the Cortex-A9 which causes the DMB10631063+ instruction to behave as a DSB, ensuring the correct behaviour of10641064+ the two writes.10651065+10661066+config ARM_ERRATA_74223110671067+ bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption"10681068+ depends on CPU_V7 && SMP10691069+ help10701070+ This option enables the workaround for the 742231 Cortex-A910711071+ (r2p0..r2p2) erratum. Under certain conditions, specific to the10721072+ Cortex-A9 MPCore micro-architecture, two CPUs working in SMP mode,10731073+ accessing some data located in the same cache line, may get corrupted10741074+ data due to bad handling of the address hazard when the line gets10751075+ replaced from one of the CPUs at the same time as another CPU is10761076+ accessing it. This workaround sets specific bits in the diagnostic10771077+ register of the Cortex-A9 which reduces the linefill issuing10781078+ capabilities of the processor.1052107910531080config PL310_ERRATA_58836910541081 bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
···273273extern int gpio_get_value(unsigned gpio);274274extern void gpio_set_value(unsigned gpio, int value);275275276276+#define gpio_get_value_cansleep gpio_get_value277277+#define gpio_set_value_cansleep gpio_set_value278278+276279/* wrappers to sleep-enable the previous two functions */277280static inline unsigned gpio_to_irq(unsigned gpio)278281{
+7-1
arch/arm/mach-vexpress/ct-ca9x4.c
···227227 int i;228228229229#ifdef CONFIG_CACHE_L2X0230230- l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff);230230+ void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC);231231+232232+ /* set RAM latencies to 1 cycle for this core tile. */233233+ writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL);234234+ writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL);235235+236236+ l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff);231237#endif232238233239 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+17-2
arch/arm/mm/alignment.c
···885885886886 if (ai_usermode & UM_SIGNAL)887887 force_sig(SIGBUS, current);888888- else889889- set_cr(cr_no_alignment);888888+ else {889889+ /*890890+ * We're about to disable the alignment trap and return to891891+ * user space. But if an interrupt occurs before actually892892+ * reaching user space, then the IRQ vector entry code will893893+ * notice that we were still in kernel space and therefore894894+ * the alignment trap won't be re-enabled in that case as it895895+ * is presumed to be always on from kernel space.896896+ * Let's prevent that race by disabling interrupts here (they897897+ * are disabled on the way back to user space anyway in898898+ * entry-common.S) and disable the alignment trap only if899899+ * there is no work pending for this thread.900900+ */901901+ raw_local_irq_disable();902902+ if (!(current_thread_info()->flags & _TIF_WORK_MASK))903903+ set_cr(cr_no_alignment);904904+ }890905891906 return 0;892907}
···186186 * It is assumed that:187187 * - cache type register is implemented188188 */189189-__v7_setup:189189+__v7_ca9mp_setup:190190#ifdef CONFIG_SMP191191 mrc p15, 0, r0, c1, c0, 1192192 tst r0, #(1 << 6) @ SMP/nAMP mode enabled?193193 orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and194194 mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting195195#endif196196+__v7_setup:196197 adr r12, __v7_setup_stack @ the local stack197198 stmia r12, {r0-r5, r7, r9, r11, lr}198199 bl v7_flush_dcache_all···202201 mrc p15, 0, r0, c0, c0, 0 @ read main ID register203202 and r10, r0, #0xff000000 @ ARM?204203 teq r10, #0x41000000205205- bne 2f204204+ bne 3f206205 and r5, r0, #0x00f00000 @ variant207206 and r6, r0, #0x0000000f @ revision208208- orr r0, r6, r5, lsr #20-4 @ combine variant and revision207207+ orr r6, r6, r5, lsr #20-4 @ combine variant and revision208208+ ubfx r0, r0, #4, #12 @ primary part number209209210210+ /* Cortex-A8 Errata */211211+ ldr r10, =0x00000c08 @ Cortex-A8 primary part number212212+ teq r0, r10213213+ bne 2f210214#ifdef CONFIG_ARM_ERRATA_430973211215 teq r5, #0x00100000 @ only present in r1p*212216 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register···219213 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register220214#endif221215#ifdef CONFIG_ARM_ERRATA_458693222222- teq r0, #0x20 @ only present in r2p0216216+ teq r6, #0x20 @ only present in r2p0223217 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register224218 orreq r10, r10, #(1 << 5) @ set L1NEON to 1225219 orreq r10, r10, #(1 << 9) @ set PLDNOP to 1226220 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register227221#endif228222#ifdef CONFIG_ARM_ERRATA_460075229229- teq r0, #0x20 @ only present in r2p0223223+ teq r6, #0x20 @ only present in r2p0230224 mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register231225 tsteq r10, #1 << 22232226 orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit233227 mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register234228#endif229229+ b 3f235230236236-2: mov r10, #0231231+ /* Cortex-A9 Errata */232232+2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number233233+ teq r0, r10234234+ bne 3f235235+#ifdef CONFIG_ARM_ERRATA_742230236236+ cmp r6, #0x22 @ only present up to r2p2237237+ mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register238238+ orrle r10, r10, #1 << 4 @ set bit #4239239+ mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register240240+#endif241241+#ifdef CONFIG_ARM_ERRATA_742231242242+ teq r6, #0x20 @ present in r2p0243243+ teqne r6, #0x21 @ present in r2p1244244+ teqne r6, #0x22 @ present in r2p2245245+ mrceq p15, 0, r10, c15, c0, 1 @ read diagnostic register246246+ orreq r10, r10, #1 << 12 @ set bit #12247247+ orreq r10, r10, #1 << 22 @ set bit #22248248+ mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register249249+#endif250250+251251+3: mov r10, #0237252#ifdef HARVARD_CACHE238253 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate239254#endif···349322 .align350323351324 .section ".proc.info.init", #alloc, #execinstr325325+326326+ .type __v7_ca9mp_proc_info, #object327327+__v7_ca9mp_proc_info:328328+ .long 0x410fc090 @ Required ID value329329+ .long 0xff0ffff0 @ Mask for ID330330+ .long PMD_TYPE_SECT | \331331+ PMD_SECT_AP_WRITE | \332332+ PMD_SECT_AP_READ | \333333+ PMD_FLAGS334334+ .long PMD_TYPE_SECT | \335335+ PMD_SECT_XN | \336336+ PMD_SECT_AP_WRITE | \337337+ PMD_SECT_AP_READ338338+ b __v7_ca9mp_setup339339+ .long cpu_arch_name340340+ .long cpu_elf_name341341+ .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP342342+ .long cpu_v7_name343343+ .long v7_processor_functions344344+ .long v7wbi_tlb_fns345345+ .long v6_user_fns346346+ .long v7_cache_fns347347+ .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info352348353349 /*354350 * Match any ARMv7 processor core.
+12-21
arch/arm/plat-nomadik/timer.c
···11/*22- * linux/arch/arm/mach-nomadik/timer.c22+ * linux/arch/arm/plat-nomadik/timer.c33 *44 * Copyright (C) 2008 STMicroelectronics55 * Copyright (C) 2010 Alessandro Rubini···7575 cr = readl(mtu_base + MTU_CR(1));7676 writel(0, mtu_base + MTU_LR(1));7777 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1));7878- writel(0x2, mtu_base + MTU_IMSC);7878+ writel(1 << 1, mtu_base + MTU_IMSC);7979 break;8080 case CLOCK_EVT_MODE_SHUTDOWN:8181 case CLOCK_EVT_MODE_UNUSED:···131131{132132 unsigned long rate;133133 struct clk *clk0;134134- struct clk *clk1;135135- u32 cr;134134+ u32 cr = MTU_CRn_32BITS;136135137136 clk0 = clk_get_sys("mtu0", NULL);138137 BUG_ON(IS_ERR(clk0));139138140140- clk1 = clk_get_sys("mtu1", NULL);141141- BUG_ON(IS_ERR(clk1));142142-143139 clk_enable(clk0);144144- clk_enable(clk1);145140146141 /*147147- * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500:148148- * use a divide-by-16 counter if it's more than 16MHz142142+ * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz143143+ * for ux500.144144+ * Use a divide-by-16 counter if the tick rate is more than 32MHz.145145+ * At 32 MHz, the timer (with 32 bit counter) can be programmed146146+ * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer147147+ * with 16 gives too low timer resolution.149148 */150150- cr = MTU_CRn_32BITS;;151149 rate = clk_get_rate(clk0);152152- if (rate > 16 << 20) {150150+ if (rate > 32000000) {153151 rate /= 16;154152 cr |= MTU_CRn_PRESCALE_16;155153 } else {···168170 pr_err("timer: failed to initialize clock source %s\n",169171 nmdk_clksrc.name);170172171171- /* Timer 1 is used for events, fix according to rate */172172- cr = MTU_CRn_32BITS;173173- rate = clk_get_rate(clk1);174174- if (rate > 16 << 20) {175175- rate /= 16;176176- cr |= MTU_CRn_PRESCALE_16;177177- } else {178178- cr |= MTU_CRn_PRESCALE_1;179179- }173173+ /* Timer 1 is used for events */174174+180175 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);181176182177 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
+1-1
arch/arm/plat-omap/Kconfig
···3333config OMAP_DEBUG_LEDS3434 bool3535 depends on OMAP_DEBUG_DEVICES3636- default y if LEDS3636+ default y if LEDS_CLASS37373838config OMAP_RESET_CLOCKS3939 bool "Reset unused clocks during boot"
+1-1
arch/arm/plat-omap/mcbsp.c
···156156 /* Writing zero to RSYNC_ERR clears the IRQ */157157 MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1));158158 } else {159159- complete(&mcbsp_rx->tx_irq_completion);159159+ complete(&mcbsp_rx->rx_irq_completion);160160 }161161162162 return IRQ_HANDLED;
+5-20
arch/arm/plat-omap/sram.c
···220220 if (omap_sram_size == 0)221221 return;222222223223- if (cpu_is_omap24xx()) {224224- omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA;225225-226226- base = OMAP2_SRAM_PA;227227- base = ROUND_DOWN(base, PAGE_SIZE);228228- omap_sram_io_desc[0].pfn = __phys_to_pfn(base);229229- }230230-231223 if (cpu_is_omap34xx()) {232232- omap_sram_io_desc[0].virtual = OMAP3_SRAM_VA;233233- base = OMAP3_SRAM_PA;234234- base = ROUND_DOWN(base, PAGE_SIZE);235235- omap_sram_io_desc[0].pfn = __phys_to_pfn(base);236236-237224 /*238225 * SRAM must be marked as non-cached on OMAP3 since the239226 * CORE DPLL M2 divider change code (in SRAM) runs with the···231244 omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED;232245 }233246234234- if (cpu_is_omap44xx()) {235235- omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA;236236- base = OMAP4_SRAM_PA;237237- base = ROUND_DOWN(base, PAGE_SIZE);238238- omap_sram_io_desc[0].pfn = __phys_to_pfn(base);239239- }240240- omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */247247+ omap_sram_io_desc[0].virtual = omap_sram_base;248248+ base = omap_sram_start;249249+ base = ROUND_DOWN(base, PAGE_SIZE);250250+ omap_sram_io_desc[0].pfn = __phys_to_pfn(base);251251+ omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE);241252 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));242253243254 printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
···28282929#define DEBUG_SIG 030303131-#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))3232-3333-int do_signal(struct pt_regs *, sigset_t *);3434-3535-asmlinkage int3636-sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,3737- unsigned long r2, unsigned long r3, unsigned long r4,3838- unsigned long r5, unsigned long r6, struct pt_regs *regs)3939-{4040- sigset_t newset;4141-4242- /* XXX: Don't preclude handling different sized sigset_t's. */4343- if (sigsetsize != sizeof(sigset_t))4444- return -EINVAL;4545-4646- if (copy_from_user(&newset, unewset, sizeof(newset)))4747- return -EFAULT;4848- sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP));4949-5050- spin_lock_irq(¤t->sighand->siglock);5151- current->saved_sigmask = current->blocked;5252- current->blocked = newset;5353- recalc_sigpending();5454- spin_unlock_irq(¤t->sighand->siglock);5555-5656- current->state = TASK_INTERRUPTIBLE;5757- schedule();5858- set_thread_flag(TIF_RESTORE_SIGMASK);5959- return -ERESTARTNOHAND;6060-}6161-6231asmlinkage int6332sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,6433 unsigned long r2, unsigned long r3, unsigned long r4,···187218 return (void __user *)((sp - frame_size) & -8ul);188219}189220190190-static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,221221+static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,191222 sigset_t *set, struct pt_regs *regs)192223{193224 struct rt_sigframe __user *frame;···244275 current->comm, current->pid, frame, regs->pc);245276#endif246277247247- return;278278+ return 0;248279249280give_sigsegv:250281 force_sigsegv(sig, current);282282+ return -EFAULT;283283+}284284+285285+static int prev_insn(struct pt_regs *regs)286286+{287287+ u16 inst;288288+ if (get_user(&inst, (u16 __user *)(regs->bpc - 2)))289289+ return -EFAULT;290290+ if ((inst & 0xfff0) == 0x10f0) /* trap ? */291291+ regs->bpc -= 2;292292+ else293293+ regs->bpc -= 4;294294+ regs->syscall_nr = -1;295295+ return 0;251296}252297253298/*254299 * OK, we're invoking a handler255300 */256301257257-static void302302+static int258303handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,259304 sigset_t *oldset, struct pt_regs *regs)260305{261261- unsigned short inst;262262-263306 /* Are we from a system call? */264307 if (regs->syscall_nr >= 0) {265308 /* If so, check system call restarting.. */···289308 /* fallthrough */290309 case -ERESTARTNOINTR:291310 regs->r0 = regs->orig_r0;292292- inst = *(unsigned short *)(regs->bpc - 2);293293- if ((inst & 0xfff0) == 0x10f0) /* trap ? */294294- regs->bpc -= 2;295295- else296296- regs->bpc -= 4;311311+ if (prev_insn(regs) < 0)312312+ return -EFAULT;297313 }298314 }299315300316 /* Set up the stack frame */301301- setup_rt_frame(sig, ka, info, oldset, regs);317317+ if (setup_rt_frame(sig, ka, info, oldset, regs))318318+ return -EFAULT;302319303320 spin_lock_irq(¤t->sighand->siglock);304321 sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask);···304325 sigaddset(¤t->blocked,sig);305326 recalc_sigpending();306327 spin_unlock_irq(¤t->sighand->siglock);328328+ return 0;307329}308330309331/*···312332 * want to handle. Thus you cannot kill init even with a SIGKILL even by313333 * mistake.314334 */315315-int do_signal(struct pt_regs *regs, sigset_t *oldset)335335+static void do_signal(struct pt_regs *regs)316336{317337 siginfo_t info;318338 int signr;319339 struct k_sigaction ka;320320- unsigned short inst;340340+ sigset_t *oldset;321341322342 /*323343 * We want the common case to go fast, which···326346 * if so.327347 */328348 if (!user_mode(regs))329329- return 1;349349+ return;330350331351 if (try_to_freeze()) 332352 goto no_signal;333353334334- if (!oldset)354354+ if (test_thread_flag(TIF_RESTORE_SIGMASK))355355+ oldset = ¤t->saved_sigmask;356356+ else335357 oldset = ¤t->blocked;336358337359 signr = get_signal_to_deliver(&info, &ka, regs, NULL);···345363 */346364347365 /* Whee! Actually deliver the signal. */348348- handle_signal(signr, &ka, &info, oldset, regs);349349- return 1;366366+ if (handle_signal(signr, &ka, &info, oldset, regs) == 0)367367+ clear_thread_flag(TIF_RESTORE_SIGMASK);368368+369369+ return;350370 }351371352372 no_signal:···359375 regs->r0 == -ERESTARTSYS ||360376 regs->r0 == -ERESTARTNOINTR) {361377 regs->r0 = regs->orig_r0;362362- inst = *(unsigned short *)(regs->bpc - 2);363363- if ((inst & 0xfff0) == 0x10f0) /* trap ? */364364- regs->bpc -= 2;365365- else366366- regs->bpc -= 4;367367- }368368- if (regs->r0 == -ERESTART_RESTARTBLOCK){378378+ prev_insn(regs);379379+ } else if (regs->r0 == -ERESTART_RESTARTBLOCK){369380 regs->r0 = regs->orig_r0;370381 regs->r7 = __NR_restart_syscall;371371- inst = *(unsigned short *)(regs->bpc - 2);372372- if ((inst & 0xfff0) == 0x10f0) /* trap ? */373373- regs->bpc -= 2;374374- else375375- regs->bpc -= 4;382382+ prev_insn(regs);376383 }377384 }378378- return 0;385385+ if (test_thread_flag(TIF_RESTORE_SIGMASK)) {386386+ clear_thread_flag(TIF_RESTORE_SIGMASK);387387+ sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL);388388+ }379389}380390381391/*382392 * notification of userspace execution resumption383393 * - triggered by current->work.notify_resume384394 */385385-void do_notify_resume(struct pt_regs *regs, sigset_t *oldset,386386- __u32 thread_info_flags)395395+void do_notify_resume(struct pt_regs *regs, __u32 thread_info_flags)387396{388397 /* Pending single-step? */389398 if (thread_info_flags & _TIF_SINGLESTEP)···384407385408 /* deal with pending signal delivery */386409 if (thread_info_flags & _TIF_SIGPENDING)387387- do_signal(regs,oldset);410410+ do_signal(regs);388411389412 if (thread_info_flags & _TIF_NOTIFY_RESUME) {390413 clear_thread_flag(TIF_NOTIFY_RESUME);
+3-3
arch/m68k/mac/macboing.c
···162162void mac_mksound( unsigned int freq, unsigned int length )163163{164164 __u32 cfreq = ( freq << 5 ) / 468;165165- __u32 flags;165165+ unsigned long flags;166166 int i;167167168168 if ( mac_special_bell == NULL )···224224 */225225static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume )226226{227227- __u32 flags;227227+ unsigned long flags;228228229229 /* if the bell is already ringing, ring longer */230230 if ( mac_bell_duration > 0 )···271271static void mac_quadra_ring_bell( unsigned long ignored )272272{273273 int i, count = mac_asc_samplespersec / HZ;274274- __u32 flags;274274+ unsigned long flags;275275276276 /*277277 * we neither want a sound buffer overflow nor underflow, so we need to match
+19-2
arch/mips/Kconfig
···1313 select HAVE_KPROBES1414 select HAVE_KRETPROBES1515 select RTC_LIB if !MACH_LOONGSON1616+ select GENERIC_ATOMIC64 if !64BIT16171718mainmenu "Linux/MIPS Kernel Configuration"1819···16471646 select SYS_SUPPORTS_SMP16481647 select SMP_UP16491648 help16501650- This is a kernel model which is also known a VSMP or lately16511651- has been marketesed into SMVP.16491649+ This is a kernel model which is known a VSMP but lately has been16501650+ marketesed into SMVP.16511651+ Virtual SMP uses the processor's VPEs to implement virtual16521652+ processors. In currently available configuration of the 34K processor16531653+ this allows for a dual processor. Both processors will share the same16541654+ primary caches; each will obtain the half of the TLB for it's own16551655+ exclusive use. For a layman this model can be described as similar to16561656+ what Intel calls Hyperthreading.16571657+16581658+ For further information see http://www.linux-mips.org/wiki/34K#VSMP1652165916531660config MIPS_MT_SMTC16541661 bool "SMTC: Use all TCs on all VPEs for SMP"···16731664 help16741665 This is a kernel model which is known a SMTC or lately has been16751666 marketesed into SMVP.16671667+ is presenting the available TC's of the core as processors to Linux.16681668+ On currently available 34K processors this means a Linux system will16691669+ see up to 5 processors. The implementation of the SMTC kernel differs16701670+ significantly from VSMP and cannot efficiently coexist in the same16711671+ kernel binary so the choice between VSMP and SMTC is a compile time16721672+ decision.16731673+16741674+ For further information see http://www.linux-mips.org/wiki/34K#SMTC1676167516771676endchoice16781677
···321321 */322322struct gic_intr_map {323323 unsigned int cpunum; /* Directed to this CPU */324324+#define GIC_UNUSED 0xdead /* Dummy data */324325 unsigned int pin; /* Directed to this Pin */325326 unsigned int polarity; /* Polarity : +/- */326327 unsigned int trigtype; /* Trigger : Edge/Levl */
···88888989#define GIC_EXT_INTR(x) x90909191-/* Dummy data */9292-#define X 0xdead9393-9491/* External Interrupts used for IPI */9592#define GIC_IPI_EXT_INTR_RESCHED_VPE0 169693#define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17
+14
arch/mips/include/asm/page.h
···150150 ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)151151#endif152152#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))153153+154154+/*155155+ * RELOC_HIDE was originally added by 6007b903dfe5f1d13e0c711ac2894bdd4a61b1ad156156+ * (lmo) rsp. 8431fd094d625b94d364fe393076ccef88e6ce18 (kernel.org). The157157+ * discussion can be found in lkml posting158158+ * <a2ebde260608230500o3407b108hc03debb9da6e62c@mail.gmail.com> which is159159+ * archived at http://lists.linuxcoding.com/kernel/2006-q3/msg17360.html160160+ *161161+ * It is unclear if the misscompilations mentioned in162162+ * http://lkml.org/lkml/2010/8/8/138 also affect MIPS so we keep this one163163+ * until GCC 3.x has been retired before we can apply164164+ * https://patchwork.linux-mips.org/patch/1541/165165+ */166166+153167#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))154168155169#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
+2-1
arch/mips/include/asm/thread_info.h
···146146#define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH)147147148148/* work to do on interrupt/exception return */149149-#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)149149+#define _TIF_WORK_MASK (0x0000ffef & \150150+ ~(_TIF_SECCOMP | _TIF_SYSCALL_AUDIT))150151/* work to do on any return to u-space */151152#define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP)152153
···3030#define tc_lsize 3231313232extern unsigned long icache_way_size, dcache_way_size;3333-unsigned long tcache_size;3333+static unsigned long tcache_size;34343535#include <asm/r4kcache.h>3636
+3
arch/mips/mti-malta/malta-int.c
···385385 */386386387387#define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK388388+#define X GIC_UNUSED389389+388390static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {389391 { X, X, X, X, 0 },390392 { X, X, X, X, 0 },···406404 { X, X, X, X, 0 },407405 /* The remainder of this table is initialised by fill_ipi_map */408406};407407+#undef X409408410409/*411410 * GCMP needs to be detected before any SMP initialisation
···101101102102choice103103 prompt "GDB stub port"104104- default GDBSTUB_TTYSM0104104+ default GDBSTUB_ON_TTYSM0105105 depends on GDBSTUB106106 help107107 Select the serial port used for GDB-stub.
···78787979/* These should not be considered constants from userland. */8080#define SIGRTMIN 328181-#define SIGRTMAX (_NSIG-1)8181+#define SIGRTMAX _NSIG82828383/*8484 * SA_FLAGS values:
···11+/* Handle the cache being disabled22+ *33+ * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.44+ * Written by David Howells (dhowells@redhat.com)55+ *66+ * This program is free software; you can redistribute it and/or77+ * modify it under the terms of the GNU General Public Licence88+ * as published by the Free Software Foundation; either version99+ * 2 of the Licence, or (at your option) any later version.1010+ */1111+#include <linux/mm.h>1212+1313+/*1414+ * allow userspace to flush the instruction cache1515+ */1616+asmlinkage long sys_cacheflush(unsigned long start, unsigned long end)1717+{1818+ if (end < start)1919+ return -EINVAL;2020+ return 0;2121+}
+19-1
arch/mn10300/mm/cache.c
···5454void flush_icache_range(unsigned long start, unsigned long end)5555{5656#ifdef CONFIG_MN10300_CACHE_WBACK5757- unsigned long addr, size, off;5757+ unsigned long addr, size, base, off;5858 struct page *page;5959 pgd_t *pgd;6060 pud_t *pud;6161 pmd_t *pmd;6262 pte_t *ppte, pte;6363+6464+ if (end > 0x80000000UL) {6565+ /* addresses above 0xa0000000 do not go through the cache */6666+ if (end > 0xa0000000UL) {6767+ end = 0xa0000000UL;6868+ if (start >= end)6969+ return;7070+ }7171+7272+ /* kernel addresses between 0x80000000 and 0x9fffffff do not7373+ * require page tables, so we just map such addresses directly */7474+ base = (start >= 0x80000000UL) ? start : 0x80000000UL;7575+ mn10300_dcache_flush_range(base, end);7676+ if (base == start)7777+ goto invalidate;7878+ end = base;7979+ }63806481 for (; start < end; start += size) {6582 /* work out how much of the page to flush */···121104 }122105#endif123106107107+invalidate:124108 mn10300_icache_inv();125109}126110EXPORT_SYMBOL(flush_icache_range);
···368368 /* capabilities of that IOMMU read from ACPI */369369 u32 cap;370370371371+ /* flags read from acpi table */372372+ u8 acpi_flags;373373+371374 /*372375 * Capability pointer. There could be more than one IOMMU per PCI373376 * device function if there are more than one AMD IOMMU capability···414411415412 /* default dma_ops domain for that IOMMU */416413 struct dma_ops_domain *default_dom;414414+415415+ /*416416+ * This array is required to work around a potential BIOS bug.417417+ * The BIOS may miss to restore parts of the PCI configuration418418+ * space when the system resumes from S3. The result is that the419419+ * IOMMU does not execute commands anymore which leads to system420420+ * failure.421421+ */422422+ u32 cache_cfg[4];417423};418424419425/*
+1-1
arch/x86/include/asm/bitops.h
···309309static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)310310{311311 return ((1UL << (nr % BITS_PER_LONG)) &312312- (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;312312+ (addr[nr / BITS_PER_LONG])) != 0;313313}314314315315static inline int variable_test_bit(int nr, volatile const unsigned long *addr)
+1
arch/x86/include/asm/cpufeature.h
···168168#define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */169169#define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */170170#define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */171171+#define X86_FEATURE_DTS (7*32+ 7) /* Digital Thermal Sensor */171172172173/* Virtualization flags: Linux defined, word 8 */173174#define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */
+1-1
arch/x86/kernel/acpi/cstate.c
···6161 unsigned int ecx;6262 } states[ACPI_PROCESSOR_MAX_POWER];6363};6464-static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */6464+static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */65656666static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];6767
···489489__init void xen_hvm_init_time_ops(void)490490{491491 /* vector callback is needed otherwise we cannot receive interrupts492492- * on cpu > 0 */493493- if (!xen_have_vector_callback && num_present_cpus() > 1)492492+ * on cpu > 0 and at this point we don't know how many cpus are493493+ * available */494494+ if (!xen_have_vector_callback)494495 return;495496 if (!xen_feature(XENFEAT_hvm_safe_pvclock)) {496497 printk(KERN_INFO "Xen doesn't support pvclock on HVM,"
+12
block/blk-merge.c
···362362 return 0;363363364364 /*365365+ * Don't merge file system requests and discard requests366366+ */367367+ if ((req->cmd_flags & REQ_DISCARD) != (next->cmd_flags & REQ_DISCARD))368368+ return 0;369369+370370+ /*371371+ * Don't merge discard requests and secure discard requests372372+ */373373+ if ((req->cmd_flags & REQ_SECURE) != (next->cmd_flags & REQ_SECURE))374374+ return 0;375375+376376+ /*365377 * not contiguous366378 */367379 if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next))
+1-1
drivers/acpi/Kconfig
···105105106106 Be aware that using this interface can confuse your Embedded107107 Controller in a way that a normal reboot is not enough. You then108108- have to power of your system, and remove the laptop battery for108108+ have to power off your system, and remove the laptop battery for109109 some seconds.110110 An Embedded Controller typically is available on laptops and reads111111 sensor values like battery state and temperature.
+18-16
drivers/acpi/acpi_pad.c
···382382 device_remove_file(&device->dev, &dev_attr_rrtime);383383}384384385385-/* Query firmware how many CPUs should be idle */386386-static int acpi_pad_pur(acpi_handle handle, int *num_cpus)385385+/*386386+ * Query firmware how many CPUs should be idle387387+ * return -1 on failure388388+ */389389+static int acpi_pad_pur(acpi_handle handle)387390{388391 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};389392 union acpi_object *package;390390- int rev, num, ret = -EINVAL;393393+ int num = -1;391394392395 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))393393- return -EINVAL;396396+ return num;394397395398 if (!buffer.length || !buffer.pointer)396396- return -EINVAL;399399+ return num;397400398401 package = buffer.pointer;399399- if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2)400400- goto out;401401- rev = package->package.elements[0].integer.value;402402- num = package->package.elements[1].integer.value;403403- if (rev != 1 || num < 0)404404- goto out;405405- *num_cpus = num;406406- ret = 0;407407-out:402402+403403+ if (package->type == ACPI_TYPE_PACKAGE &&404404+ package->package.count == 2 &&405405+ package->package.elements[0].integer.value == 1) /* rev 1 */406406+407407+ num = package->package.elements[1].integer.value;408408+408409 kfree(buffer.pointer);409409- return ret;410410+ return num;410411}411412412413/* Notify firmware how many CPUs are idle */···434433 uint32_t idle_cpus;435434436435 mutex_lock(&isolated_cpus_lock);437437- if (acpi_pad_pur(handle, &num_cpus)) {436436+ num_cpus = acpi_pad_pur(handle);437437+ if (num_cpus < 0) {438438 mutex_unlock(&isolated_cpus_lock);439439 return;440440 }
···109109 *110110 * DESCRIPTION: Reacquire the interpreter execution region from within the111111 * interpreter code. Failure to enter the interpreter region is a112112- * fatal system error. Used in conjuction with112112+ * fatal system error. Used in conjunction with113113 * relinquish_interpreter114114 *115115 ******************************************************************************/
+1-1
drivers/acpi/acpica/rsutils.c
···149149150150 /*151151 * 16-, 32-, and 64-bit cases must use the move macros that perform152152- * endian conversion and/or accomodate hardware that cannot perform152152+ * endian conversion and/or accommodate hardware that cannot perform153153 * misaligned memory transfers154154 */155155 case ACPI_RSC_MOVE16:
+1-1
drivers/acpi/apei/Kconfig
···3434 depends on ACPI_APEI3535 help3636 ERST is a way provided by APEI to save and retrieve hardware3737- error infomation to and from a persistent store. Enable this3737+ error information to and from a persistent store. Enable this3838 if you want to debugging and testing the ERST kernel support3939 and firmware implementation.
···426426427427static int einj_check_table(struct acpi_table_einj *einj_tab)428428{429429- if (einj_tab->header_length != sizeof(struct acpi_table_einj))429429+ if ((einj_tab->header_length !=430430+ (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header)))431431+ && (einj_tab->header_length != sizeof(struct acpi_table_einj)))430432 return -EINVAL;431433 if (einj_tab->header.length < sizeof(struct acpi_table_einj))432434 return -EINVAL;
+11-7
drivers/acpi/apei/erst-dbg.c
···22 * APEI Error Record Serialization Table debug support33 *44 * ERST is a way provided by APEI to save and retrieve hardware error55- * infomation to and from a persistent store. This file provide the55+ * information to and from a persistent store. This file provide the66 * debugging/testing support for ERST kernel support and firmware77 * implementation.88 *···111111 goto out;112112 }113113 if (len > erst_dbg_buf_len) {114114- kfree(erst_dbg_buf);114114+ void *p;115115 rc = -ENOMEM;116116- erst_dbg_buf = kmalloc(len, GFP_KERNEL);117117- if (!erst_dbg_buf)116116+ p = kmalloc(len, GFP_KERNEL);117117+ if (!p)118118 goto out;119119+ kfree(erst_dbg_buf);120120+ erst_dbg_buf = p;119121 erst_dbg_buf_len = len;120122 goto retry;121123 }···152150 if (mutex_lock_interruptible(&erst_dbg_mutex))153151 return -EINTR;154152 if (usize > erst_dbg_buf_len) {155155- kfree(erst_dbg_buf);153153+ void *p;156154 rc = -ENOMEM;157157- erst_dbg_buf = kmalloc(usize, GFP_KERNEL);158158- if (!erst_dbg_buf)155155+ p = kmalloc(usize, GFP_KERNEL);156156+ if (!p)159157 goto out;158158+ kfree(erst_dbg_buf);159159+ erst_dbg_buf = p;160160 erst_dbg_buf_len = usize;161161 }162162 rc = copy_from_user(erst_dbg_buf, ubuf, usize);
+24-5
drivers/acpi/apei/erst.c
···22 * APEI Error Record Serialization Table support33 *44 * ERST is a way provided by APEI to save and retrieve hardware error55- * infomation to and from a persistent store.55+ * information to and from a persistent store.66 *77 * For more information about ERST, please refer to ACPI Specification88 * version 4.0, section 17.4.···266266{267267 int rc;268268 u64 offset;269269+ void *src, *dst;270270+271271+ /* ioremap does not work in interrupt context */272272+ if (in_interrupt()) {273273+ pr_warning(ERST_PFX274274+ "MOVE_DATA can not be used in interrupt context");275275+ return -EBUSY;276276+ }269277270278 rc = __apei_exec_read_register(entry, &offset);271279 if (rc)272280 return rc;273273- memmove((void *)ctx->dst_base + offset,274274- (void *)ctx->src_base + offset,275275- ctx->var2);281281+282282+ src = ioremap(ctx->src_base + offset, ctx->var2);283283+ if (!src)284284+ return -ENOMEM;285285+ dst = ioremap(ctx->dst_base + offset, ctx->var2);286286+ if (!dst)287287+ return -ENOMEM;288288+289289+ memmove(dst, src, ctx->var2);290290+291291+ iounmap(src);292292+ iounmap(dst);276293277294 return 0;278295}···767750768751static int erst_check_table(struct acpi_table_erst *erst_tab)769752{770770- if (erst_tab->header_length != sizeof(struct acpi_table_erst))753753+ if ((erst_tab->header_length !=754754+ (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header)))755755+ && (erst_tab->header_length != sizeof(struct acpi_table_einj)))771756 return -EINVAL;772757 if (erst_tab->header.length < sizeof(struct acpi_table_erst))773758 return -EINVAL;
···5555static int set_power_nocheck(const struct dmi_system_id *id)5656{5757 printk(KERN_NOTICE PREFIX "%s detected - "5858- "disable power check in power transistion\n", id->ident);5858+ "disable power check in power transition\n", id->ident);5959 acpi_power_nocheck = 1;6060 return 0;6161}···80808181static struct dmi_system_id dsdt_dmi_table[] __initdata = {8282 /*8383- * Insyde BIOS on some TOSHIBA machines corrupt the DSDT.8383+ * Invoke DSDT corruption work-around on all Toshiba Satellite.8484 * https://bugzilla.kernel.org/show_bug.cgi?id=146798585 */8686 {8787 .callback = set_copy_dsdt,8888- .ident = "TOSHIBA Satellite A505",8888+ .ident = "TOSHIBA Satellite",8989 .matches = {9090 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),9191- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A505"),9292- },9393- },9494- {9595- .callback = set_copy_dsdt,9696- .ident = "TOSHIBA Satellite L505D",9797- .matches = {9898- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),9999- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L505D"),9191+ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),10092 },10193 },10294 {}···1019102710201028 /*10211029 * If the laptop falls into the DMI check table, the power state check10221022- * will be disabled in the course of device power transistion.10301030+ * will be disabled in the course of device power transition.10231031 */10241032 dmi_check_system(power_nocheck_dmi_table);10251033
···850850 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",851851 acpi_idle_driver.name);852852 } else {853853- printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s",853853+ printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n",854854 cpuidle_get_driver()->name);855855 }856856
+2-2
drivers/acpi/processor_perflib.c
···447447 if (!try_module_get(calling_module))448448 return -EINVAL;449449450450- /* is_done is set to negative if an error occured,451451- * and to postitive if _no_ error occured, but SMM450450+ /* is_done is set to negative if an error occurred,451451+ * and to postitive if _no_ error occurred, but SMM452452 * was already notified. This avoids double notification453453 * which might lead to unexpected results...454454 */
···23692369 pkt_shrink_pktlist(pd);23702370}2371237123722372-static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor)23722372+static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor)23732373{23742374 if (dev_minor >= MAX_WRITERS)23752375 return NULL;
+11-6
drivers/char/ipmi/ipmi_si_intf.c
···305305#ifdef CONFIG_PCI306306static int pci_registered;307307#endif308308+#ifdef CONFIG_ACPI309309+static int pnp_registered;310310+#endif308311#ifdef CONFIG_PPC_OF309312static int of_registered;310313#endif···21292126{21302127 struct acpi_device *acpi_dev;21312128 struct smi_info *info;21322132- struct resource *res;21292129+ struct resource *res, *res_second;21332130 acpi_handle handle;21342131 acpi_status status;21352132 unsigned long long tmp;···21852182 info->io.addr_data = res->start;2186218321872184 info->io.regspacing = DEFAULT_REGSPACING;21882188- res = pnp_get_resource(dev,21852185+ res_second = pnp_get_resource(dev,21892186 (info->io.addr_type == IPMI_IO_ADDR_SPACE) ?21902187 IORESOURCE_IO : IORESOURCE_MEM,21912188 1);21922192- if (res) {21932193- if (res->start > info->io.addr_data)21942194- info->io.regspacing = res->start - info->io.addr_data;21892189+ if (res_second) {21902190+ if (res_second->start > info->io.addr_data)21912191+ info->io.regspacing = res_second->start - info->io.addr_data;21952192 }21962193 info->io.regsize = DEFAULT_REGSPACING;21972194 info->io.regshift = 0;···3362335933633360#ifdef CONFIG_ACPI33643361 pnp_register_driver(&ipmi_pnp_driver);33623362+ pnp_registered = 1;33653363#endif3366336433673365#ifdef CONFIG_DMI···35303526 pci_unregister_driver(&ipmi_pci_driver);35313527#endif35323528#ifdef CONFIG_ACPI35333533- pnp_unregister_driver(&ipmi_pnp_driver);35293529+ if (pnp_registered)35303530+ pnp_unregister_driver(&ipmi_pnp_driver);35343531#endif3535353235363533#ifdef CONFIG_PPC_OF
+1-1
drivers/cpuidle/governors/menu.c
···8080 * Limiting Performance Impact8181 * ---------------------------8282 * C states, especially those with large exit latencies, can have a real8383- * noticable impact on workloads, which is not acceptable for most sysadmins,8383+ * noticeable impact on workloads, which is not acceptable for most sysadmins,8484 * and in addition, less performance has a power price of its own.8585 *8686 * As a general rule of thumb, menu assumes that the following heuristic
···580580581581 sh_chan = to_sh_chan(chan);582582 param = chan->private;583583- slave_addr = param->config->addr;584583585584 /* Someone calling slave DMA on a public channel? */586585 if (!param || !sg_len) {···587588 __func__, param, sg_len, param ? param->slave_id : -1);588589 return NULL;589590 }591591+592592+ slave_addr = param->config->addr;590593591594 /*592595 * if (param != NULL), this is a successfully requested slave channel,
+3
drivers/edac/edac_mc.c
···339339{340340 int status;341341342342+ if (mci->op_state != OP_RUNNING_POLL)343343+ return;344344+342345 status = cancel_delayed_work(&mci->work);343346 if (status == 0) {344347 debugf0("%s() not canceled, flush the queue\n",
···9898 * user_data: A pointer the data that is copied to the buffer.9999 * size: The Number of bytes to copy.100100 */101101-extern int drm_buffer_copy_from_user(struct drm_buffer *buf,102102- void __user *user_data, int size)101101+int drm_buffer_copy_from_user(struct drm_buffer *buf,102102+ void __user *user_data, int size)103103{104104 int nr_pages = size / PAGE_SIZE + 1;105105 int idx;···163163{164164 int idx = drm_buffer_index(buf);165165 int page = drm_buffer_page(buf);166166- void *obj = 0;166166+ void *obj = NULL;167167168168 if (idx + objsize <= PAGE_SIZE) {169169 obj = &buf->data[page][idx];
+10-29
drivers/gpu/drm/drm_gem.c
···148148 return -ENOMEM;149149150150 kref_init(&obj->refcount);151151- kref_init(&obj->handlecount);151151+ atomic_set(&obj->handle_count, 0);152152 obj->size = size;153153154154 atomic_inc(&dev->object_count);···462462}463463EXPORT_SYMBOL(drm_gem_object_free);464464465465-/**466466- * Called after the last reference to the object has been lost.467467- * Must be called without holding struct_mutex468468- *469469- * Frees the object470470- */471471-void472472-drm_gem_object_free_unlocked(struct kref *kref)473473-{474474- struct drm_gem_object *obj = (struct drm_gem_object *) kref;475475- struct drm_device *dev = obj->dev;476476-477477- if (dev->driver->gem_free_object_unlocked != NULL)478478- dev->driver->gem_free_object_unlocked(obj);479479- else if (dev->driver->gem_free_object != NULL) {480480- mutex_lock(&dev->struct_mutex);481481- dev->driver->gem_free_object(obj);482482- mutex_unlock(&dev->struct_mutex);483483- }484484-}485485-EXPORT_SYMBOL(drm_gem_object_free_unlocked);486486-487465static void drm_gem_object_ref_bug(struct kref *list_kref)488466{489467 BUG();···474496 * called before drm_gem_object_free or we'll be touching475497 * freed memory476498 */477477-void478478-drm_gem_object_handle_free(struct kref *kref)499499+void drm_gem_object_handle_free(struct drm_gem_object *obj)479500{480480- struct drm_gem_object *obj = container_of(kref,481481- struct drm_gem_object,482482- handlecount);483501 struct drm_device *dev = obj->dev;484502485503 /* Remove any name for this object */···502528 struct drm_gem_object *obj = vma->vm_private_data;503529504530 drm_gem_object_reference(obj);531531+532532+ mutex_lock(&obj->dev->struct_mutex);533533+ drm_vm_open_locked(vma);534534+ mutex_unlock(&obj->dev->struct_mutex);505535}506536EXPORT_SYMBOL(drm_gem_vm_open);507537···513535{514536 struct drm_gem_object *obj = vma->vm_private_data;515537516516- drm_gem_object_unreference_unlocked(obj);538538+ mutex_lock(&obj->dev->struct_mutex);539539+ drm_vm_close_locked(vma);540540+ drm_gem_object_unreference(obj);541541+ mutex_unlock(&obj->dev->struct_mutex);517542}518543EXPORT_SYMBOL(drm_gem_vm_close);519544
···136136 return -ENOMEM;137137138138 ret = drm_gem_handle_create(file_priv, obj, &handle);139139+ /* drop reference from allocate - handle holds it now */140140+ drm_gem_object_unreference_unlocked(obj);139141 if (ret) {140140- drm_gem_object_unreference_unlocked(obj);141142 return ret;142143 }143143-144144- /* Sink the floating reference from kref_init(handlecount) */145145- drm_gem_object_handle_unreference_unlocked(obj);146144147145 args->handle = handle;148146 return 0;···469471 return -ENOENT;470472 obj_priv = to_intel_bo(obj);471473472472- /* Bounds check source.473473- *474474- * XXX: This could use review for overflow issues...475475- */476476- if (args->offset > obj->size || args->size > obj->size ||477477- args->offset + args->size > obj->size) {478478- drm_gem_object_unreference_unlocked(obj);479479- return -EINVAL;474474+ /* Bounds check source. */475475+ if (args->offset > obj->size || args->size > obj->size - args->offset) {476476+ ret = -EINVAL;477477+ goto err;478478+ }479479+480480+ if (!access_ok(VERIFY_WRITE,481481+ (char __user *)(uintptr_t)args->data_ptr,482482+ args->size)) {483483+ ret = -EFAULT;484484+ goto err;480485 }481486482487 if (i915_gem_object_needs_bit17_swizzle(obj)) {···491490 file_priv);492491 }493492493493+err:494494 drm_gem_object_unreference_unlocked(obj);495495-496495 return ret;497496}498497···581580582581 user_data = (char __user *) (uintptr_t) args->data_ptr;583582 remain = args->size;584584- if (!access_ok(VERIFY_READ, user_data, remain))585585- return -EFAULT;586583587584588585 mutex_lock(&dev->struct_mutex);···933934 return -ENOENT;934935 obj_priv = to_intel_bo(obj);935936936936- /* Bounds check destination.937937- *938938- * XXX: This could use review for overflow issues...939939- */940940- if (args->offset > obj->size || args->size > obj->size ||941941- args->offset + args->size > obj->size) {942942- drm_gem_object_unreference_unlocked(obj);943943- return -EINVAL;937937+ /* Bounds check destination. */938938+ if (args->offset > obj->size || args->size > obj->size - args->offset) {939939+ ret = -EINVAL;940940+ goto err;941941+ }942942+943943+ if (!access_ok(VERIFY_READ,944944+ (char __user *)(uintptr_t)args->data_ptr,945945+ args->size)) {946946+ ret = -EFAULT;947947+ goto err;944948 }945949946950 /* We can only do the GTT pwrite on untiled buffers, as otherwise···977975 DRM_INFO("pwrite failed %d\n", ret);978976#endif979977978978+err:980979 drm_gem_object_unreference_unlocked(obj);981981-982980 return ret;983981}984982···24022400 I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0);24032401 break;24042402 case 3:24052405- if (obj_priv->fence_reg > 8)24032403+ if (obj_priv->fence_reg >= 8)24062404 fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4;24072405 else24082406 case 2:···32603258 (int) reloc->offset,32613259 reloc->read_domains,32623260 reloc->write_domain);32613261+ drm_gem_object_unreference(target_obj);32623262+ i915_gem_object_unpin(obj);32633263 return -EINVAL;32643264 }32653265 if (reloc->write_domain & I915_GEM_DOMAIN_CPU ||
+22-27
drivers/gpu/drm/i915/i915_gem_evict.c
···9393{9494 drm_i915_private_t *dev_priv = dev->dev_private;9595 struct list_head eviction_list, unwind_list;9696- struct drm_i915_gem_object *obj_priv, *tmp_obj_priv;9696+ struct drm_i915_gem_object *obj_priv;9797 struct list_head *render_iter, *bsd_iter;9898 int ret = 0;9999···175175 return -ENOSPC;176176177177found:178178+ /* drm_mm doesn't allow any other other operations while179179+ * scanning, therefore store to be evicted objects on a180180+ * temporary list. */178181 INIT_LIST_HEAD(&eviction_list);179179- list_for_each_entry_safe(obj_priv, tmp_obj_priv,180180- &unwind_list, evict_list) {182182+ while (!list_empty(&unwind_list)) {183183+ obj_priv = list_first_entry(&unwind_list,184184+ struct drm_i915_gem_object,185185+ evict_list);181186 if (drm_mm_scan_remove_block(obj_priv->gtt_space)) {182182- /* drm_mm doesn't allow any other other operations while183183- * scanning, therefore store to be evicted objects on a184184- * temporary list. */185187 list_move(&obj_priv->evict_list, &eviction_list);186186- } else187187- drm_gem_object_unreference(&obj_priv->base);188188- }189189-190190- /* Unbinding will emit any required flushes */191191- list_for_each_entry_safe(obj_priv, tmp_obj_priv,192192- &eviction_list, evict_list) {193193-#if WATCH_LRU194194- DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base);195195-#endif196196- ret = i915_gem_object_unbind(&obj_priv->base);197197- if (ret)198198- return ret;199199-188188+ continue;189189+ }190190+ list_del(&obj_priv->evict_list);200191 drm_gem_object_unreference(&obj_priv->base);201192 }202193203203- /* The just created free hole should be on the top of the free stack204204- * maintained by drm_mm, so this BUG_ON actually executes in O(1).205205- * Furthermore all accessed data has just recently been used, so it206206- * should be really fast, too. */207207- BUG_ON(!drm_mm_search_free(&dev_priv->mm.gtt_space, min_size,208208- alignment, 0));194194+ /* Unbinding will emit any required flushes */195195+ while (!list_empty(&eviction_list)) {196196+ obj_priv = list_first_entry(&eviction_list,197197+ struct drm_i915_gem_object,198198+ evict_list);199199+ if (ret == 0)200200+ ret = i915_gem_object_unbind(&obj_priv->base);201201+ list_del(&obj_priv->evict_list);202202+ drm_gem_object_unreference(&obj_priv->base);203203+ }209204210210- return 0;205205+ return ret;211206}212207213208int
+36-22
drivers/gpu/drm/i915/intel_display.c
···10131013 DRM_DEBUG_KMS("vblank wait timed out\n");10141014}1015101510161016-/**10171017- * intel_wait_for_vblank_off - wait for vblank after disabling a pipe10161016+/*10171017+ * intel_wait_for_pipe_off - wait for pipe to turn off10181018 * @dev: drm device10191019 * @pipe: pipe to wait for10201020 *···10221022 * spinning on the vblank interrupt status bit, since we won't actually10231023 * see an interrupt when the pipe is disabled.10241024 *10251025- * So this function waits for the display line value to settle (it10261026- * usually ends up stopping at the start of the next frame).10251025+ * On Gen4 and above:10261026+ * wait for the pipe register state bit to turn off10271027+ *10281028+ * Otherwise:10291029+ * wait for the display line value to settle (it usually10301030+ * ends up stopping at the start of the next frame).10311031+ * 10271032 */10281028-void intel_wait_for_vblank_off(struct drm_device *dev, int pipe)10331033+static void intel_wait_for_pipe_off(struct drm_device *dev, int pipe)10291034{10301035 struct drm_i915_private *dev_priv = dev->dev_private;10311031- int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL);10321032- unsigned long timeout = jiffies + msecs_to_jiffies(100);10331033- u32 last_line;1034103610351035- /* Wait for the display line to settle */10361036- do {10371037- last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;10381038- mdelay(5);10391039- } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&10401040- time_after(timeout, jiffies));10371037+ if (INTEL_INFO(dev)->gen >= 4) {10381038+ int pipeconf_reg = (pipe == 0 ? PIPEACONF : PIPEBCONF);1041103910421042- if (time_after(jiffies, timeout))10431043- DRM_DEBUG_KMS("vblank wait timed out\n");10401040+ /* Wait for the Pipe State to go off */10411041+ if (wait_for((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) == 0,10421042+ 100, 0))10431043+ DRM_DEBUG_KMS("pipe_off wait timed out\n");10441044+ } else {10451045+ u32 last_line;10461046+ int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL);10471047+ unsigned long timeout = jiffies + msecs_to_jiffies(100);10481048+10491049+ /* Wait for the display line to settle */10501050+ do {10511051+ last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;10521052+ mdelay(5);10531053+ } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&10541054+ time_after(timeout, jiffies));10551055+ if (time_after(jiffies, timeout))10561056+ DRM_DEBUG_KMS("pipe_off wait timed out\n");10571057+ }10441058}1045105910461060/* Parameters have changed, update FBC info */···23422328 I915_READ(dspbase_reg);23432329 }2344233023452345- /* Wait for vblank for the disable to take effect */23462346- intel_wait_for_vblank_off(dev, pipe);23472347-23482331 /* Don't disable pipe A or pipe A PLLs if needed */23492332 if (pipeconf_reg == PIPEACONF &&23502350- (dev_priv->quirks & QUIRK_PIPEA_FORCE))23332333+ (dev_priv->quirks & QUIRK_PIPEA_FORCE)) {23342334+ /* Wait for vblank for the disable to take effect */23352335+ intel_wait_for_vblank(dev, pipe);23512336 goto skip_pipe_off;23372337+ }2352233823532339 /* Next, disable display pipes */23542340 temp = I915_READ(pipeconf_reg);···23572343 I915_READ(pipeconf_reg);23582344 }2359234523602360- /* Wait for vblank for the disable to take effect. */23612361- intel_wait_for_vblank_off(dev, pipe);23462346+ /* Wait for the pipe to turn off */23472347+ intel_wait_for_pipe_off(dev, pipe);2362234823632349 temp = I915_READ(dpll_reg);23642350 if ((temp & DPLL_VCO_ENABLE) != 0) {
+9-10
drivers/gpu/drm/i915/intel_dp.c
···11381138intel_dp_set_link_train(struct intel_dp *intel_dp,11391139 uint32_t dp_reg_value,11401140 uint8_t dp_train_pat,11411141- uint8_t train_set[4],11421142- bool first)11411141+ uint8_t train_set[4])11431142{11441143 struct drm_device *dev = intel_dp->base.enc.dev;11451144 struct drm_i915_private *dev_priv = dev->dev_private;11461146- struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc);11471145 int ret;1148114611491147 I915_WRITE(intel_dp->output_reg, dp_reg_value);11501148 POSTING_READ(intel_dp->output_reg);11511151- if (first)11521152- intel_wait_for_vblank(dev, intel_crtc->pipe);1153114911541150 intel_dp_aux_native_write_1(intel_dp,11551151 DP_TRAINING_PATTERN_SET,···11701174 uint8_t voltage;11711175 bool clock_recovery = false;11721176 bool channel_eq = false;11731173- bool first = true;11741177 int tries;11751178 u32 reg;11761179 uint32_t DP = intel_dp->DP;11801180+ struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc);11811181+11821182+ /* Enable output, wait for it to become active */11831183+ I915_WRITE(intel_dp->output_reg, intel_dp->DP);11841184+ POSTING_READ(intel_dp->output_reg);11851185+ intel_wait_for_vblank(dev, intel_crtc->pipe);1177118611781187 /* Write the link configuration data */11791188 intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,···12111210 reg = DP | DP_LINK_TRAIN_PAT_1;1212121112131212 if (!intel_dp_set_link_train(intel_dp, reg,12141214- DP_TRAINING_PATTERN_1, train_set, first))12131213+ DP_TRAINING_PATTERN_1, train_set))12151214 break;12161216- first = false;12171215 /* Set training pattern 1 */1218121612191217 udelay(100);···1266126612671267 /* channel eq pattern */12681268 if (!intel_dp_set_link_train(intel_dp, reg,12691269- DP_TRAINING_PATTERN_2, train_set,12701270- false))12691269+ DP_TRAINING_PATTERN_2, train_set))12711270 break;1272127112731272 udelay(400);
···558558 if (nv_encoder->dcb->type == OUTPUT_LVDS &&559559 (nv_encoder->dcb->lvdsconf.use_straps_for_mode ||560560 dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) {561561- nv_connector->native_mode = drm_mode_create(dev);562562- nouveau_bios_fp_mode(dev, nv_connector->native_mode);561561+ struct drm_display_mode mode;562562+563563+ nouveau_bios_fp_mode(dev, &mode);564564+ nv_connector->native_mode = drm_mode_duplicate(dev, &mode);563565 }564566565567 /* Find the native mode if this is a digital panel, if we didn't
···167167 goto out;168168169169 ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle);170170+ /* drop reference from allocate - handle holds it now */171171+ drm_gem_object_unreference_unlocked(nvbo->gem);170172out:171171- drm_gem_object_handle_unreference_unlocked(nvbo->gem);172172-173173- if (ret)174174- drm_gem_object_unreference_unlocked(nvbo->gem);175173 return ret;176174}177175
···6969 spinlock_t lock;7070 bool fill_lock;7171 struct list_head list;7272- int gfp_flags;7272+ gfp_t gfp_flags;7373 unsigned npages;7474 char *name;7575 unsigned long nfrees;···475475 * This function is reentrant if caller updates count depending on number of476476 * pages returned in pages array.477477 */478478-static int ttm_alloc_new_pages(struct list_head *pages, int gfp_flags,478478+static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,479479 int ttm_flags, enum ttm_caching_state cstate, unsigned count)480480{481481 struct page **caching_array;···666666{667667 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);668668 struct page *p = NULL;669669- int gfp_flags = GFP_USER;669669+ gfp_t gfp_flags = GFP_USER;670670 int r;671671672672 /* set zero flag for page allocation if required */···818818 return 0;819819}820820821821-void ttm_page_alloc_fini()821821+void ttm_page_alloc_fini(void)822822{823823 int i;824824
+110-35
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
···148148 {0, 0, 0}149149};150150151151-static char *vmw_devname = "vmwgfx";151151+static int enable_fbdev;152152153153static int vmw_probe(struct pci_dev *, const struct pci_device_id *);154154static void vmw_master_init(struct vmw_master *);155155static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,156156 void *ptr);157157+158158+MODULE_PARM_DESC(enable_fbdev, "Enable vmwgfx fbdev");159159+module_param_named(enable_fbdev, enable_fbdev, int, 0600);157160158161static void vmw_print_capabilities(uint32_t capabilities)159162{···195192{196193 int ret;197194198198- vmw_kms_save_vga(dev_priv);199199-200195 ret = vmw_fifo_init(dev_priv, &dev_priv->fifo);201196 if (unlikely(ret != 0)) {202197 DRM_ERROR("Unable to initialize FIFO.\n");···207206static void vmw_release_device(struct vmw_private *dev_priv)208207{209208 vmw_fifo_release(dev_priv, &dev_priv->fifo);210210- vmw_kms_restore_vga(dev_priv);211209}212210211211+int vmw_3d_resource_inc(struct vmw_private *dev_priv)212212+{213213+ int ret = 0;214214+215215+ mutex_lock(&dev_priv->release_mutex);216216+ if (unlikely(dev_priv->num_3d_resources++ == 0)) {217217+ ret = vmw_request_device(dev_priv);218218+ if (unlikely(ret != 0))219219+ --dev_priv->num_3d_resources;220220+ }221221+ mutex_unlock(&dev_priv->release_mutex);222222+ return ret;223223+}224224+225225+226226+void vmw_3d_resource_dec(struct vmw_private *dev_priv)227227+{228228+ int32_t n3d;229229+230230+ mutex_lock(&dev_priv->release_mutex);231231+ if (unlikely(--dev_priv->num_3d_resources == 0))232232+ vmw_release_device(dev_priv);233233+ n3d = (int32_t) dev_priv->num_3d_resources;234234+ mutex_unlock(&dev_priv->release_mutex);235235+236236+ BUG_ON(n3d < 0);237237+}213238214239static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)215240{···255228 dev_priv->last_read_sequence = (uint32_t) -100;256229 mutex_init(&dev_priv->hw_mutex);257230 mutex_init(&dev_priv->cmdbuf_mutex);231231+ mutex_init(&dev_priv->release_mutex);258232 rwlock_init(&dev_priv->resource_lock);259233 idr_init(&dev_priv->context_idr);260234 idr_init(&dev_priv->surface_idr);···271243 dev_priv->io_start = pci_resource_start(dev->pdev, 0);272244 dev_priv->vram_start = pci_resource_start(dev->pdev, 1);273245 dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);246246+247247+ dev_priv->enable_fb = enable_fbdev;274248275249 mutex_lock(&dev_priv->hw_mutex);276250···373343374344 dev->dev_private = dev_priv;375345376376- if (!dev->devname)377377- dev->devname = vmw_devname;378378-379379- if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {380380- ret = drm_irq_install(dev);381381- if (unlikely(ret != 0)) {382382- DRM_ERROR("Failed installing irq: %d\n", ret);383383- goto out_no_irq;384384- }385385- }386386-387346 ret = pci_request_regions(dev->pdev, "vmwgfx probe");388347 dev_priv->stealth = (ret != 0);389348 if (dev_priv->stealth) {···388369 goto out_no_device;389370 }390371 }391391- ret = vmw_request_device(dev_priv);372372+ ret = vmw_kms_init(dev_priv);392373 if (unlikely(ret != 0))393393- goto out_no_device;394394- vmw_kms_init(dev_priv);374374+ goto out_no_kms;395375 vmw_overlay_init(dev_priv);396396- vmw_fb_init(dev_priv);376376+ if (dev_priv->enable_fb) {377377+ ret = vmw_3d_resource_inc(dev_priv);378378+ if (unlikely(ret != 0))379379+ goto out_no_fifo;380380+ vmw_kms_save_vga(dev_priv);381381+ vmw_fb_init(dev_priv);382382+ DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ?383383+ "Detected device 3D availability.\n" :384384+ "Detected no device 3D availability.\n");385385+ } else {386386+ DRM_INFO("Delayed 3D detection since we're not "387387+ "running the device in SVGA mode yet.\n");388388+ }389389+390390+ if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {391391+ ret = drm_irq_install(dev);392392+ if (unlikely(ret != 0)) {393393+ DRM_ERROR("Failed installing irq: %d\n", ret);394394+ goto out_no_irq;395395+ }396396+ }397397398398 dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier;399399 register_pm_notifier(&dev_priv->pm_nb);400400401401- DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ? "Have 3D\n" : "No 3D\n");402402-403401 return 0;404402405405-out_no_device:406406- if (dev_priv->capabilities & SVGA_CAP_IRQMASK)407407- drm_irq_uninstall(dev_priv->dev);408408- if (dev->devname == vmw_devname)409409- dev->devname = NULL;410403out_no_irq:404404+ if (dev_priv->enable_fb) {405405+ vmw_fb_close(dev_priv);406406+ vmw_kms_restore_vga(dev_priv);407407+ vmw_3d_resource_dec(dev_priv);408408+ }409409+out_no_fifo:410410+ vmw_overlay_close(dev_priv);411411+ vmw_kms_close(dev_priv);412412+out_no_kms:413413+ if (dev_priv->stealth)414414+ pci_release_region(dev->pdev, 2);415415+ else416416+ pci_release_regions(dev->pdev);417417+out_no_device:411418 ttm_object_device_release(&dev_priv->tdev);412419out_err4:413420 iounmap(dev_priv->mmio_virt);···460415461416 unregister_pm_notifier(&dev_priv->pm_nb);462417463463- vmw_fb_close(dev_priv);418418+ if (dev_priv->capabilities & SVGA_CAP_IRQMASK)419419+ drm_irq_uninstall(dev_priv->dev);420420+ if (dev_priv->enable_fb) {421421+ vmw_fb_close(dev_priv);422422+ vmw_kms_restore_vga(dev_priv);423423+ vmw_3d_resource_dec(dev_priv);424424+ }464425 vmw_kms_close(dev_priv);465426 vmw_overlay_close(dev_priv);466466- vmw_release_device(dev_priv);467427 if (dev_priv->stealth)468428 pci_release_region(dev->pdev, 2);469429 else470430 pci_release_regions(dev->pdev);471431472472- if (dev_priv->capabilities & SVGA_CAP_IRQMASK)473473- drm_irq_uninstall(dev_priv->dev);474474- if (dev->devname == vmw_devname)475475- dev->devname = NULL;476432 ttm_object_device_release(&dev_priv->tdev);477433 iounmap(dev_priv->mmio_virt);478434 drm_mtrr_del(dev_priv->mmio_mtrr, dev_priv->mmio_start,···546500 struct drm_ioctl_desc *ioctl =547501 &vmw_ioctls[nr - DRM_COMMAND_BASE];548502549549- if (unlikely(ioctl->cmd != cmd)) {503503+ if (unlikely(ioctl->cmd_drv != cmd)) {550504 DRM_ERROR("Invalid command format, ioctl %d\n",551505 nr - DRM_COMMAND_BASE);552506 return -EINVAL;···635589 struct vmw_master *vmaster = vmw_master(file_priv->master);636590 int ret = 0;637591592592+ if (!dev_priv->enable_fb) {593593+ ret = vmw_3d_resource_inc(dev_priv);594594+ if (unlikely(ret != 0))595595+ return ret;596596+ vmw_kms_save_vga(dev_priv);597597+ mutex_lock(&dev_priv->hw_mutex);598598+ vmw_write(dev_priv, SVGA_REG_TRACES, 0);599599+ mutex_unlock(&dev_priv->hw_mutex);600600+ }601601+638602 if (active) {639603 BUG_ON(active != &dev_priv->fbdev_master);640604 ret = ttm_vt_lock(&active->lock, false, vmw_fp->tfile);···673617 return 0;674618675619out_no_active_lock:676676- vmw_release_device(dev_priv);620620+ if (!dev_priv->enable_fb) {621621+ mutex_lock(&dev_priv->hw_mutex);622622+ vmw_write(dev_priv, SVGA_REG_TRACES, 1);623623+ mutex_unlock(&dev_priv->hw_mutex);624624+ vmw_kms_restore_vga(dev_priv);625625+ vmw_3d_resource_dec(dev_priv);626626+ }677627 return ret;678628}679629···707645708646 ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);709647648648+ if (!dev_priv->enable_fb) {649649+ ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM);650650+ if (unlikely(ret != 0))651651+ DRM_ERROR("Unable to clean VRAM on master drop.\n");652652+ mutex_lock(&dev_priv->hw_mutex);653653+ vmw_write(dev_priv, SVGA_REG_TRACES, 1);654654+ mutex_unlock(&dev_priv->hw_mutex);655655+ vmw_kms_restore_vga(dev_priv);656656+ vmw_3d_resource_dec(dev_priv);657657+ }658658+710659 dev_priv->active_master = &dev_priv->fbdev_master;711660 ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM);712661 ttm_vt_unlock(&dev_priv->fbdev_master.lock);713662714714- vmw_fb_on(dev_priv);663663+ if (dev_priv->enable_fb)664664+ vmw_fb_on(dev_priv);715665}716666717667···796722 .irq_postinstall = vmw_irq_postinstall,797723 .irq_uninstall = vmw_irq_uninstall,798724 .irq_handler = vmw_irq_handler,725725+ .get_vblank_counter = vmw_get_vblank_counter,799726 .reclaim_buffers_locked = NULL,800727 .get_map_ofs = drm_core_get_map_ofs,801728 .get_reg_ofs = drm_core_get_reg_ofs,
···598598 pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count);599599}600600601601-void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace)601601+static void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace)602602{603603 struct vga_device *vgadev;604604 unsigned long flags;
+1-1
drivers/hwmon/Kconfig
···409409410410config SENSORS_PKGTEMP411411 tristate "Intel processor package temperature sensor"412412- depends on X86 && PCI && EXPERIMENTAL412412+ depends on X86 && EXPERIMENTAL413413 help414414 If you say yes here you get support for the package level temperature415415 sensor inside your CPU. Check documentation/driver for details.
+33-24
drivers/hwmon/coretemp.c
···3636#include <linux/pci.h>3737#include <asm/msr.h>3838#include <asm/processor.h>3939+#include <asm/smp.h>39404041#define DRVNAME "coretemp"4142···424423 int err;425424 struct platform_device *pdev;426425 struct pdev_entry *pdev_entry;427427-#ifdef CONFIG_SMP428426 struct cpuinfo_x86 *c = &cpu_data(cpu);429429-#endif427427+428428+ /*429429+ * CPUID.06H.EAX[0] indicates whether the CPU has thermal430430+ * sensors. We check this bit only, all the early CPUs431431+ * without thermal sensors will be filtered out.432432+ */433433+ if (!cpu_has(c, X86_FEATURE_DTS)) {434434+ printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"435435+ " has no thermal sensor.\n", c->x86_model);436436+ return 0;437437+ }430438431439 mutex_lock(&pdev_list_mutex);432440···492482493483static void coretemp_device_remove(unsigned int cpu)494484{495495- struct pdev_entry *p, *n;485485+ struct pdev_entry *p;486486+ unsigned int i;487487+496488 mutex_lock(&pdev_list_mutex);497497- list_for_each_entry_safe(p, n, &pdev_list, list) {498498- if (p->cpu == cpu) {499499- platform_device_unregister(p->pdev);500500- list_del(&p->list);501501- kfree(p);502502- }489489+ list_for_each_entry(p, &pdev_list, list) {490490+ if (p->cpu != cpu)491491+ continue;492492+493493+ platform_device_unregister(p->pdev);494494+ list_del(&p->list);495495+ mutex_unlock(&pdev_list_mutex);496496+ kfree(p);497497+ for_each_cpu(i, cpu_sibling_mask(cpu))498498+ if (i != cpu && !coretemp_device_add(i))499499+ break;500500+ return;503501 }504502 mutex_unlock(&pdev_list_mutex);505503}···545527 if (err)546528 goto exit;547529548548- for_each_online_cpu(i) {549549- struct cpuinfo_x86 *c = &cpu_data(i);550550- /*551551- * CPUID.06H.EAX[0] indicates whether the CPU has thermal552552- * sensors. We check this bit only, all the early CPUs553553- * without thermal sensors will be filtered out.554554- */555555- if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01))556556- coretemp_device_add(i);557557- else {558558- printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"559559- " has no thermal sensor.\n", c->x86_model);560560- }561561- }530530+ for_each_online_cpu(i)531531+ coretemp_device_add(i);532532+533533+#ifndef CONFIG_HOTPLUG_CPU562534 if (list_empty(&pdev_list)) {563535 err = -ENODEV;564536 goto exit_driver_unreg;565537 }538538+#endif566539567540 register_hotcpu_notifier(&coretemp_cpu_notifier);568541 return 0;569542570570-exit_driver_unreg:571543#ifndef CONFIG_HOTPLUG_CPU544544+exit_driver_unreg:572545 platform_driver_unregister(&coretemp_driver);573546#endif574547exit:
+19-13
drivers/hwmon/f71882fg.c
···111111/* Super-I/O Function prototypes */112112static inline int superio_inb(int base, int reg);113113static inline int superio_inw(int base, int reg);114114-static inline void superio_enter(int base);114114+static inline int superio_enter(int base);115115static inline void superio_select(int base, int ld);116116static inline void superio_exit(int base);117117···861861 return val;862862}863863864864-static inline void superio_enter(int base)864864+static inline int superio_enter(int base)865865{866866+ /* Don't step on other drivers' I/O space by accident */867867+ if (!request_muxed_region(base, 2, DRVNAME)) {868868+ printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",869869+ base);870870+ return -EBUSY;871871+ }872872+866873 /* according to the datasheet the key must be send twice! */867874 outb(SIO_UNLOCK_KEY, base);868875 outb(SIO_UNLOCK_KEY, base);876876+877877+ return 0;869878}870879871880static inline void superio_select(int base, int ld)···886877static inline void superio_exit(int base)887878{888879 outb(SIO_LOCK_KEY, base);880880+ release_region(base, 2);889881}890882891883static inline int fan_from_reg(u16 reg)···21852175static int __init f71882fg_find(int sioaddr, unsigned short *address,21862176 struct f71882fg_sio_data *sio_data)21872177{21882188- int err = -ENODEV;21892178 u16 devid;21902190-21912191- /* Don't step on other drivers' I/O space by accident */21922192- if (!request_region(sioaddr, 2, DRVNAME)) {21932193- printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",21942194- (int)sioaddr);21952195- return -EBUSY;21962196- }21972197-21982198- superio_enter(sioaddr);21792179+ int err = superio_enter(sioaddr);21802180+ if (err)21812181+ return err;2199218222002183 devid = superio_inw(sioaddr, SIO_REG_MANID);22012184 if (devid != SIO_FINTEK_ID) {22022185 pr_debug(DRVNAME ": Not a Fintek device\n");21862186+ err = -ENODEV;22032187 goto exit;22042188 }22052189···22172213 default:22182214 printk(KERN_INFO DRVNAME ": Unsupported Fintek device: %04x\n",22192215 (unsigned int)devid);22162216+ err = -ENODEV;22202217 goto exit;22212218 }22222219···2228222322292224 if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) {22302225 printk(KERN_WARNING DRVNAME ": Device not activated\n");22262226+ err = -ENODEV;22312227 goto exit;22322228 }2233222922342230 *address = superio_inw(sioaddr, SIO_REG_ADDR);22352231 if (*address == 0) {22362232 printk(KERN_WARNING DRVNAME ": Base address not set\n");22332233+ err = -ENODEV;22372234 goto exit;22382235 }22392236 *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */···22462239 (int)superio_inb(sioaddr, SIO_REG_DEVREV));22472240exit:22482241 superio_exit(sioaddr);22492249- release_region(sioaddr, 2);22502242 return err;22512243}22522244
+2-2
drivers/hwmon/lis3lv02d.c
···277277 wake_up_interruptible(&lis3_dev.misc_wait);278278 kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN);279279out:280280- if (lis3_dev.whoami == WAI_8B && lis3_dev.idev &&280280+ if (lis3_dev.pdata && lis3_dev.whoami == WAI_8B && lis3_dev.idev &&281281 lis3_dev.idev->input->users)282282 return IRQ_WAKE_THREAD;283283 return IRQ_HANDLED;···718718 * io-apic is not configurable (and generates a warning) but I keep it719719 * in case of support for other hardware.720720 */721721- if (dev->whoami == WAI_8B)721721+ if (dev->pdata && dev->whoami == WAI_8B)722722 thread_fn = lis302dl_interrupt_thread1_8b;723723 else724724 thread_fn = NULL;
+11-12
drivers/hwmon/pkgtemp.c
···3333#include <linux/list.h>3434#include <linux/platform_device.h>3535#include <linux/cpu.h>3636-#include <linux/pci.h>3736#include <asm/msr.h>3837#include <asm/processor.h>3938···223224224225 err = sysfs_create_group(&pdev->dev.kobj, &pkgtemp_group);225226 if (err)226226- goto exit_free;227227+ goto exit_dev;227228228229 data->hwmon_dev = hwmon_device_register(&pdev->dev);229230 if (IS_ERR(data->hwmon_dev)) {···237238238239exit_class:239240 sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group);241241+exit_dev:242242+ device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr);240243exit_free:241244 kfree(data);242245exit:···251250252251 hwmon_device_unregister(data->hwmon_dev);253252 sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group);253253+ device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr);254254 platform_set_drvdata(pdev, NULL);255255 kfree(data);256256 return 0;···283281 int err;284282 struct platform_device *pdev;285283 struct pdev_entry *pdev_entry;286286-#ifdef CONFIG_SMP287284 struct cpuinfo_x86 *c = &cpu_data(cpu);288288-#endif285285+286286+ if (!cpu_has(c, X86_FEATURE_PTS))287287+ return 0;289288290289 mutex_lock(&pdev_list_mutex);291290···342339#ifdef CONFIG_HOTPLUG_CPU343340static void pkgtemp_device_remove(unsigned int cpu)344341{345345- struct pdev_entry *p, *n;342342+ struct pdev_entry *p;346343 unsigned int i;347344 int err;348345349346 mutex_lock(&pdev_list_mutex);350350- list_for_each_entry_safe(p, n, &pdev_list, list) {347347+ list_for_each_entry(p, &pdev_list, list) {351348 if (p->cpu != cpu)352349 continue;353350354351 platform_device_unregister(p->pdev);355352 list_del(&p->list);353353+ mutex_unlock(&pdev_list_mutex);356354 kfree(p);357355 for_each_cpu(i, cpu_core_mask(cpu)) {358356 if (i != cpu) {···362358 break;363359 }364360 }365365- break;361361+ return;366362 }367363 mutex_unlock(&pdev_list_mutex);368364}···403399 goto exit;404400405401 for_each_online_cpu(i) {406406- struct cpuinfo_x86 *c = &cpu_data(i);407407-408408- if (!cpu_has(c, X86_FEATURE_PTS))409409- continue;410410-411402 err = pkgtemp_device_add(i);412403 if (err)413404 goto exit_devices_unreg;
+3-3
drivers/i2c/busses/i2c-davinci.c
···357357358358 dev->terminate = 0;359359360360- /* write the data into mode register */361361- davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);362362-363360 /*364361 * First byte should be set here, not after interrupt,365362 * because transmit-data-ready interrupt can come before···367370 davinci_i2c_write_reg(dev, DAVINCI_I2C_DXR_REG, *dev->buf++);368371 dev->buf_len--;369372 }373373+374374+ /* write the data into mode register; start transmitting */375375+ davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);370376371377 r = wait_for_completion_interruptible_timeout(&dev->cmd_complete,372378 dev->adapter.timeout);
···368368 If unsure, say N.369369370370 To compile this driver as a module, choose M here: the371371- module will be called vmware_balloon.371371+ module will be called vmw_balloon.372372373373config ARM_CHARLCD374374 bool "ARM Ltd. Character LCD Driver"
···105105#define E1000_FEXTNVM_SW_CONFIG 1106106#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */107107108108+#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7109109+#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7110110+#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3111111+108112#define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL109113110114#define E1000_ICH_RAR_ENTRIES 7···129125130126/* SMBus Address Phy Register */131127#define HV_SMB_ADDR PHY_REG(768, 26)128128+#define HV_SMB_ADDR_MASK 0x007F132129#define HV_SMB_ADDR_PEC_EN 0x0200133130#define HV_SMB_ADDR_VALID 0x0080134131···242237static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw);243238static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw);244239static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw);240240+static s32 e1000_k1_workaround_lv(struct e1000_hw *hw);241241+static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate);245242246243static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)247244{···279272static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)280273{281274 struct e1000_phy_info *phy = &hw->phy;282282- u32 ctrl;275275+ u32 ctrl, fwsm;283276 s32 ret_val = 0;284277285278 phy->addr = 1;···301294 * disabled, then toggle the LANPHYPC Value bit to force302295 * the interconnect to PCIe mode.303296 */304304- if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {297297+ fwsm = er32(FWSM);298298+ if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) {305299 ctrl = er32(CTRL);306300 ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE;307301 ctrl &= ~E1000_CTRL_LANPHYPC_VALUE;···311303 ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE;312304 ew32(CTRL, ctrl);313305 msleep(50);306306+307307+ /*308308+ * Gate automatic PHY configuration by hardware on309309+ * non-managed 82579310310+ */311311+ if (hw->mac.type == e1000_pch2lan)312312+ e1000_gate_hw_phy_config_ich8lan(hw, true);314313 }315314316315 /*···329314 ret_val = e1000e_phy_hw_reset_generic(hw);330315 if (ret_val)331316 goto out;317317+318318+ /* Ungate automatic PHY configuration on non-managed 82579 */319319+ if ((hw->mac.type == e1000_pch2lan) &&320320+ !(fwsm & E1000_ICH_FWSM_FW_VALID)) {321321+ msleep(10);322322+ e1000_gate_hw_phy_config_ich8lan(hw, false);323323+ }332324333325 phy->id = e1000_phy_unknown;334326 ret_val = e1000e_get_phy_id(hw);···583561 if (mac->type == e1000_ich8lan)584562 e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true);585563586586- /* Disable PHY configuration by hardware, config by software */587587- if (mac->type == e1000_pch2lan) {588588- u32 extcnf_ctrl = er32(EXTCNF_CTRL);589589-590590- extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;591591- ew32(EXTCNF_CTRL, extcnf_ctrl);592592- }564564+ /* Gate automatic PHY configuration by hardware on managed 82579 */565565+ if ((mac->type == e1000_pch2lan) &&566566+ (er32(FWSM) & E1000_ICH_FWSM_FW_VALID))567567+ e1000_gate_hw_phy_config_ich8lan(hw, true);593568594569 return 0;595570}···667648668649 if (hw->phy.type == e1000_phy_82578) {669650 ret_val = e1000_link_stall_workaround_hv(hw);651651+ if (ret_val)652652+ goto out;653653+ }654654+655655+ if (hw->mac.type == e1000_pch2lan) {656656+ ret_val = e1000_k1_workaround_lv(hw);670657 if (ret_val)671658 goto out;672659 }···920895}921896922897/**898898+ * e1000_write_smbus_addr - Write SMBus address to PHY needed during Sx states899899+ * @hw: pointer to the HW structure900900+ *901901+ * Assumes semaphore already acquired.902902+ *903903+ **/904904+static s32 e1000_write_smbus_addr(struct e1000_hw *hw)905905+{906906+ u16 phy_data;907907+ u32 strap = er32(STRAP);908908+ s32 ret_val = 0;909909+910910+ strap &= E1000_STRAP_SMBUS_ADDRESS_MASK;911911+912912+ ret_val = e1000_read_phy_reg_hv_locked(hw, HV_SMB_ADDR, &phy_data);913913+ if (ret_val)914914+ goto out;915915+916916+ phy_data &= ~HV_SMB_ADDR_MASK;917917+ phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT);918918+ phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;919919+ ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data);920920+921921+out:922922+ return ret_val;923923+}924924+925925+/**923926 * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration924927 * @hw: pointer to the HW structure925928 *···956903 **/957904static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)958905{959959- struct e1000_adapter *adapter = hw->adapter;960906 struct e1000_phy_info *phy = &hw->phy;961907 u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask;962908 s32 ret_val = 0;···973921 if (phy->type != e1000_phy_igp_3)974922 return ret_val;975923976976- if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) {924924+ if ((hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) ||925925+ (hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_C)) {977926 sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;978927 break;979928 }···1014961 cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;1015962 cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;101696310171017- if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&10181018- ((hw->mac.type == e1000_pchlan) ||10191019- (hw->mac.type == e1000_pch2lan))) {964964+ if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&965965+ (hw->mac.type == e1000_pchlan)) ||966966+ (hw->mac.type == e1000_pch2lan)) {1020967 /*1021968 * HW configures the SMBus address and LEDs when the1022969 * OEM and LCD Write Enable bits are set in the NVM.1023970 * When both NVM bits are cleared, SW will configure1024971 * them instead.1025972 */10261026- data = er32(STRAP);10271027- data &= E1000_STRAP_SMBUS_ADDRESS_MASK;10281028- reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT;10291029- reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;10301030- ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR,10311031- reg_data);973973+ ret_val = e1000_write_smbus_addr(hw);1032974 if (ret_val)1033975 goto out;1034976···14881440 goto out;1489144114901442 /* Enable jumbo frame workaround in the PHY */14911491- e1e_rphy(hw, PHY_REG(769, 20), &data);14921492- ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));14931493- if (ret_val)14941494- goto out;14951443 e1e_rphy(hw, PHY_REG(769, 23), &data);14961444 data &= ~(0x7F << 5);14971445 data |= (0x37 << 5);···14961452 goto out;14971453 e1e_rphy(hw, PHY_REG(769, 16), &data);14981454 data &= ~(1 << 13);14991499- data |= (1 << 12);15001455 ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);15011456 if (ret_val)15021457 goto out;···1520147715211478 mac_reg = er32(RCTL);15221479 mac_reg &= ~E1000_RCTL_SECRC;15231523- ew32(FFLT_DBG, mac_reg);14801480+ ew32(RCTL, mac_reg);1524148115251482 ret_val = e1000e_read_kmrn_reg(hw,15261483 E1000_KMRNCTRLSTA_CTRL_OFFSET,···15461503 goto out;1547150415481505 /* Write PHY register values back to h/w defaults */15491549- e1e_rphy(hw, PHY_REG(769, 20), &data);15501550- ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));15511551- if (ret_val)15521552- goto out;15531506 e1e_rphy(hw, PHY_REG(769, 23), &data);15541507 data &= ~(0x7F << 5);15551508 ret_val = e1e_wphy(hw, PHY_REG(769, 23), data);15561509 if (ret_val)15571510 goto out;15581511 e1e_rphy(hw, PHY_REG(769, 16), &data);15591559- data &= ~(1 << 12);15601512 data |= (1 << 13);15611513 ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);15621514 if (ret_val)···1594155615951557out:15961558 return ret_val;15591559+}15601560+15611561+/**15621562+ * e1000_k1_gig_workaround_lv - K1 Si workaround15631563+ * @hw: pointer to the HW structure15641564+ *15651565+ * Workaround to set the K1 beacon duration for 82579 parts15661566+ **/15671567+static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)15681568+{15691569+ s32 ret_val = 0;15701570+ u16 status_reg = 0;15711571+ u32 mac_reg;15721572+15731573+ if (hw->mac.type != e1000_pch2lan)15741574+ goto out;15751575+15761576+ /* Set K1 beacon duration based on 1Gbps speed or otherwise */15771577+ ret_val = e1e_rphy(hw, HV_M_STATUS, &status_reg);15781578+ if (ret_val)15791579+ goto out;15801580+15811581+ if ((status_reg & (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE))15821582+ == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) {15831583+ mac_reg = er32(FEXTNVM4);15841584+ mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK;15851585+15861586+ if (status_reg & HV_M_STATUS_SPEED_1000)15871587+ mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC;15881588+ else15891589+ mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC;15901590+15911591+ ew32(FEXTNVM4, mac_reg);15921592+ }15931593+15941594+out:15951595+ return ret_val;15961596+}15971597+15981598+/**15991599+ * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware16001600+ * @hw: pointer to the HW structure16011601+ * @gate: boolean set to true to gate, false to ungate16021602+ *16031603+ * Gate/ungate the automatic PHY configuration via hardware; perform16041604+ * the configuration via software instead.16051605+ **/16061606+static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate)16071607+{16081608+ u32 extcnf_ctrl;16091609+16101610+ if (hw->mac.type != e1000_pch2lan)16111611+ return;16121612+16131613+ extcnf_ctrl = er32(EXTCNF_CTRL);16141614+16151615+ if (gate)16161616+ extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;16171617+ else16181618+ extcnf_ctrl &= ~E1000_EXTCNF_CTRL_GATE_PHY_CFG;16191619+16201620+ ew32(EXTCNF_CTRL, extcnf_ctrl);16211621+ return;15971622}1598162315991624/**···17031602 if (e1000_check_reset_block(hw))17041603 goto out;1705160416051605+ /* Allow time for h/w to get to quiescent state after reset */16061606+ msleep(10);16071607+17061608 /* Perform any necessary post-reset workarounds */17071609 switch (hw->mac.type) {17081610 case e1000_pchlan:···17341630 /* Configure the LCD with the OEM bits in NVM */17351631 ret_val = e1000_oem_bits_config_ich8lan(hw, true);1736163216331633+ /* Ungate automatic PHY configuration on non-managed 82579 */16341634+ if ((hw->mac.type == e1000_pch2lan) &&16351635+ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {16361636+ msleep(10);16371637+ e1000_gate_hw_phy_config_ich8lan(hw, false);16381638+ }16391639+17371640out:17381641 return ret_val;17391642}···17561645static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)17571646{17581647 s32 ret_val = 0;16481648+16491649+ /* Gate automatic PHY configuration by hardware on non-managed 82579 */16501650+ if ((hw->mac.type == e1000_pch2lan) &&16511651+ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID))16521652+ e1000_gate_hw_phy_config_ich8lan(hw, true);1759165317601654 ret_val = e1000e_phy_hw_reset_generic(hw);17611655 if (ret_val)···30262910 * external PHY is reset.30272911 */30282912 ctrl |= E1000_CTRL_PHY_RST;29132913+29142914+ /*29152915+ * Gate automatic PHY configuration by hardware on29162916+ * non-managed 8257929172917+ */29182918+ if ((hw->mac.type == e1000_pch2lan) &&29192919+ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID))29202920+ e1000_gate_hw_phy_config_ich8lan(hw, true);30292921 }30302922 ret_val = e1000_acquire_swflag_ich8lan(hw);30312923 e_dbg("Issuing a global reset to ich8lan\n");···35843460void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw)35853461{35863462 u32 phy_ctrl;34633463+ s32 ret_val;3587346435883465 phy_ctrl = er32(PHY_CTRL);35893466 phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE;35903467 ew32(PHY_CTRL, phy_ctrl);3591346835923592- if (hw->mac.type >= e1000_pchlan)35933593- e1000_phy_hw_reset_ich8lan(hw);34693469+ if (hw->mac.type >= e1000_pchlan) {34703470+ e1000_oem_bits_config_ich8lan(hw, true);34713471+ ret_val = hw->phy.ops.acquire(hw);34723472+ if (ret_val)34733473+ return;34743474+ e1000_write_smbus_addr(hw);34753475+ hw->phy.ops.release(hw);34763476+ }35943477}3595347835963479/**
+19-10
drivers/net/e1000e/netdev.c
···27042704 u32 psrctl = 0;27052705 u32 pages = 0;2706270627072707+ /* Workaround Si errata on 82579 - configure jumbo frame flow */27082708+ if (hw->mac.type == e1000_pch2lan) {27092709+ s32 ret_val;27102710+27112711+ if (adapter->netdev->mtu > ETH_DATA_LEN)27122712+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);27132713+ else27142714+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);27152715+ }27162716+27072717 /* Program MC offset vector base */27082718 rctl = er32(RCTL);27092719 rctl &= ~(3 << E1000_RCTL_MO_SHIFT);···27522742 e1e_wphy(hw, 0x10, 0x2823);27532743 e1e_wphy(hw, 0x11, 0x0003);27542744 e1e_wphy(hw, 22, phy_data);27552755- }27562756-27572757- /* Workaround Si errata on 82579 - configure jumbo frame flow */27582758- if (hw->mac.type == e1000_pch2lan) {27592759- s32 ret_val;27602760-27612761- if (rctl & E1000_RCTL_LPE)27622762- ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);27632763- else27642764- ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);27652745 }2766274627672747 /* Setup buffer sizes */···48304830 if ((new_mtu < ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) ||48314831 (max_frame > adapter->max_hw_frame_size)) {48324832 e_err("Unsupported MTU setting\n");48334833+ return -EINVAL;48344834+ }48354835+48364836+ /* Jumbo frame workaround on 82579 requires CRC be stripped */48374837+ if ((adapter->hw.mac.type == e1000_pch2lan) &&48384838+ !(adapter->flags2 & FLAG2_CRC_STRIPPING) &&48394839+ (new_mtu > ETH_DATA_LEN)) {48404840+ e_err("Jumbo Frames not supported on 82579 when CRC "48414841+ "stripping is disabled.\n");48334842 return -EINVAL;48344843 }48354844
+2-2
drivers/net/ibm_newemac/core.c
···29282928 if (dev->emac_irq != NO_IRQ)29292929 irq_dispose_mapping(dev->emac_irq);29302930 err_free:29312931- kfree(ndev);29312931+ free_netdev(ndev);29322932 err_gone:29332933 /* if we were on the bootlist, remove us as we won't show up and29342934 * wake up all waiters to notify them in case they were waiting···29712971 if (dev->emac_irq != NO_IRQ)29722972 irq_dispose_mapping(dev->emac_irq);2973297329742974- kfree(dev->ndev);29742974+ free_netdev(dev->ndev);2975297529762976 return 0;29772977}
···7171#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32))7272#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64))73737474+/* page table handling */7575+#define LEVEL_STRIDE (9)7676+#define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1)7777+7878+static inline int agaw_to_level(int agaw)7979+{8080+ return agaw + 2;8181+}8282+8383+static inline int agaw_to_width(int agaw)8484+{8585+ return 30 + agaw * LEVEL_STRIDE;8686+}8787+8888+static inline int width_to_agaw(int width)8989+{9090+ return (width - 30) / LEVEL_STRIDE;9191+}9292+9393+static inline unsigned int level_to_offset_bits(int level)9494+{9595+ return (level - 1) * LEVEL_STRIDE;9696+}9797+9898+static inline int pfn_level_offset(unsigned long pfn, int level)9999+{100100+ return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK;101101+}102102+103103+static inline unsigned long level_mask(int level)104104+{105105+ return -1UL << level_to_offset_bits(level);106106+}107107+108108+static inline unsigned long level_size(int level)109109+{110110+ return 1UL << level_to_offset_bits(level);111111+}112112+113113+static inline unsigned long align_to_level(unsigned long pfn, int level)114114+{115115+ return (pfn + level_size(level) - 1) & level_mask(level);116116+}7411775118/* VT-d pages must always be _smaller_ than MM pages. Otherwise things76119 are never going to work. */···477434}478435479436480480-static inline int width_to_agaw(int width);481481-482437static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw)483438{484439 unsigned long sagaw;···685644 iommu->root_entry = NULL;686645out:687646 spin_unlock_irqrestore(&iommu->lock, flags);688688-}689689-690690-/* page table handling */691691-#define LEVEL_STRIDE (9)692692-#define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1)693693-694694-static inline int agaw_to_level(int agaw)695695-{696696- return agaw + 2;697697-}698698-699699-static inline int agaw_to_width(int agaw)700700-{701701- return 30 + agaw * LEVEL_STRIDE;702702-703703-}704704-705705-static inline int width_to_agaw(int width)706706-{707707- return (width - 30) / LEVEL_STRIDE;708708-}709709-710710-static inline unsigned int level_to_offset_bits(int level)711711-{712712- return (level - 1) * LEVEL_STRIDE;713713-}714714-715715-static inline int pfn_level_offset(unsigned long pfn, int level)716716-{717717- return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK;718718-}719719-720720-static inline unsigned long level_mask(int level)721721-{722722- return -1UL << level_to_offset_bits(level);723723-}724724-725725-static inline unsigned long level_size(int level)726726-{727727- return 1UL << level_to_offset_bits(level);728728-}729729-730730-static inline unsigned long align_to_level(unsigned long pfn, int level)731731-{732732- return (pfn + level_size(level) - 1) & level_mask(level);733647}734648735649static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,···37563760}3757376137583762DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);37633763+37643764+#define GGC 0x5237653765+#define GGC_MEMORY_SIZE_MASK (0xf << 8)37663766+#define GGC_MEMORY_SIZE_NONE (0x0 << 8)37673767+#define GGC_MEMORY_SIZE_1M (0x1 << 8)37683768+#define GGC_MEMORY_SIZE_2M (0x3 << 8)37693769+#define GGC_MEMORY_VT_ENABLED (0x8 << 8)37703770+#define GGC_MEMORY_SIZE_2M_VT (0x9 << 8)37713771+#define GGC_MEMORY_SIZE_3M_VT (0xa << 8)37723772+#define GGC_MEMORY_SIZE_4M_VT (0xb << 8)37733773+37743774+static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev)37753775+{37763776+ unsigned short ggc;37773777+37783778+ if (pci_read_config_word(dev, GGC, &ggc))37793779+ return;37803780+37813781+ if (!(ggc & GGC_MEMORY_VT_ENABLED)) {37823782+ printk(KERN_INFO "DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics\n");37833783+ dmar_map_gfx = 0;37843784+ }37853785+}37863786+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt);37873787+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt);37883788+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt);37893789+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt);3759379037603791/* On Tylersburg chipsets, some BIOSes have been known to enable the37613792 ISOCH DMAR unit for the Azalia sound device, but not give it any
+1-1
drivers/pci/iov.c
···608608 * the VF BAR size multiplied by the number of VFs. The alignment609609 * is just the VF BAR size.610610 */611611-int pci_sriov_resource_alignment(struct pci_dev *dev, int resno)611611+resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)612612{613613 struct resource tmp;614614 enum pci_bar_type type;
+3-2
drivers/pci/pci.h
···264264extern void pci_iov_release(struct pci_dev *dev);265265extern int pci_iov_resource_bar(struct pci_dev *dev, int resno,266266 enum pci_bar_type *type);267267-extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno);267267+extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev,268268+ int resno);268269extern void pci_restore_iov_state(struct pci_dev *dev);269270extern int pci_iov_bus_range(struct pci_bus *bus);270271···321320}322321#endif /* CONFIG_PCI_IOV */323322324324-static inline int pci_resource_alignment(struct pci_dev *dev,323323+static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,325324 struct resource *res)326325{327326#ifdef CONFIG_PCI_IOV
+20
drivers/pci/quirks.c
···163163DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs);164164165165/*166166+ * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear167167+ * for some HT machines to use C4 w/o hanging.168168+ */169169+static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev)170170+{171171+ u32 pmbase;172172+ u16 pm1a;173173+174174+ pci_read_config_dword(dev, 0x40, &pmbase);175175+ pmbase = pmbase & 0xff80;176176+ pm1a = inw(pmbase);177177+178178+ if (pm1a & 0x10) {179179+ dev_info(&dev->dev, FW_BUG "TigerPoint LPC.BM_STS cleared\n");180180+ outw(0x10, pmbase);181181+ }182182+}183183+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts);184184+185185+/*166186 * Chipsets where PCI->PCI transfers vanish or hang167187 */168188static void __devinit quirk_nopcipci(struct pci_dev *dev)
+6
drivers/pcmcia/pcmcia_resource.c
···595595 if (c->io[1].end) {596596 ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);597597 if (ret) {598598+ struct resource tmp = c->io[0];599599+ /* release the previously allocated resource */598600 release_io_space(s, &c->io[0]);601601+ /* but preserve the settings, for they worked... */602602+ c->io[0].end = resource_size(&tmp);603603+ c->io[0].start = tmp.start;604604+ c->io[0].flags = tmp.flags;599605 goto out;600606 }601607 } else
+1-1
drivers/pcmcia/pd6729.c
···646646 if (!pci_resource_start(dev, 0)) {647647 dev_warn(&dev->dev, "refusing to load the driver as the "648648 "io_base is NULL.\n");649649- goto err_out_free_mem;649649+ goto err_out_disable;650650 }651651652652 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
···8080extern long st_register(struct st_proto_s *);8181extern long st_unregister(enum proto_type);82828383-extern struct platform_device *st_get_plat_device(void);8483#endif /* ST_H */
+4-5
drivers/staging/ti-st/st_core.c
···3838#include "st_ll.h"3939#include "st.h"40404141-#define VERBOSE4241/* strings to be used for rfkill entries and by4342 * ST Core to be used for sysfs debug entry4443 */···580581 long err = 0;581582 unsigned long flags = 0;582583583583- st_kim_ref(&st_gdata);584584+ st_kim_ref(&st_gdata, 0);584585 pr_info("%s(%d) ", __func__, new_proto->type);585586 if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL586587 || new_proto->reg_complete_cb == NULL) {···712713713714 pr_debug("%s: %d ", __func__, type);714715715715- st_kim_ref(&st_gdata);716716+ st_kim_ref(&st_gdata, 0);716717 if (type < ST_BT || type >= ST_MAX) {717718 pr_err(" protocol %d not supported", type);718719 return -EPROTONOSUPPORT;···766767#endif767768 long len;768769769769- st_kim_ref(&st_gdata);770770+ st_kim_ref(&st_gdata, 0);770771 if (unlikely(skb == NULL || st_gdata == NULL771772 || st_gdata->tty == NULL)) {772773 pr_err("data/tty unavailable to perform write");···817818 struct st_data_s *st_gdata;818819 pr_info("%s ", __func__);819820820820- st_kim_ref(&st_gdata);821821+ st_kim_ref(&st_gdata, 0);821822 st_gdata->tty = tty;822823 tty->disc_data = st_gdata;823824
+1-1
drivers/staging/ti-st/st_core.h
···117117void st_core_exit(struct st_data_s *);118118119119/* ask for reference from KIM */120120-void st_kim_ref(struct st_data_s **);120120+void st_kim_ref(struct st_data_s **, int);121121122122#define GPS_STUB_TEST123123#ifdef GPS_STUB_TEST
+19-3
drivers/staging/ti-st/st_kim.c
···7272 PROTO_ENTRY(ST_GPS, "GPS"),7373};74747575+#define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */7676+struct platform_device *st_kim_devices[MAX_ST_DEVICES];75777678/**********************************************************************/7779/* internal functions */8080+8181+/**8282+ * st_get_plat_device -8383+ * function which returns the reference to the platform device8484+ * requested by id. As of now only 1 such device exists (id=0)8585+ * the context requesting for reference can get the id to be8686+ * requested by a. The protocol driver which is registering or8787+ * b. the tty device which is opened.8888+ */8989+static struct platform_device *st_get_plat_device(int id)9090+{9191+ return st_kim_devices[id];9292+}78937994/**8095 * validate_firmware_response -···368353 struct kim_data_s *kim_gdata;369354 pr_info(" %s ", __func__);370355371371- kim_pdev = st_get_plat_device();356356+ kim_pdev = st_get_plat_device(0);372357 kim_gdata = dev_get_drvdata(&kim_pdev->dev);373358374359 if (kim_gdata->gpios[type] == -1) {···589574 * This would enable multiple such platform devices to exist590575 * on a given platform591576 */592592-void st_kim_ref(struct st_data_s **core_data)577577+void st_kim_ref(struct st_data_s **core_data, int id)593578{594579 struct platform_device *pdev;595580 struct kim_data_s *kim_gdata;596581 /* get kim_gdata reference from platform device */597597- pdev = st_get_plat_device();582582+ pdev = st_get_plat_device(id);598583 kim_gdata = dev_get_drvdata(&pdev->dev);599584 *core_data = kim_gdata->core_data;600585}···638623 long *gpios = pdev->dev.platform_data;639624 struct kim_data_s *kim_gdata;640625626626+ st_kim_devices[pdev->id] = pdev;641627 kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC);642628 if (!kim_gdata) {643629 pr_err("no mem to allocate");
+3-3
drivers/usb/core/Kconfig
···9191 If you are unsure about this, say N here.92929393config USB_SUSPEND9494- bool "USB runtime power management (suspend/resume and wakeup)"9494+ bool "USB runtime power management (autosuspend) and wakeup"9595 depends on USB && PM_RUNTIME9696 help9797 If you say Y here, you can use driver calls or the sysfs9898- "power/level" file to suspend or resume individual USB9999- peripherals and to enable or disable autosuspend (see9898+ "power/control" file to enable or disable autosuspend for9999+ individual USB peripherals (see100100 Documentation/usb/power-management.txt for more details).101101102102 Also, USB "remote wakeup" signaling is supported, whereby some
+16-19
drivers/usb/core/file.c
···159159int usb_register_dev(struct usb_interface *intf,160160 struct usb_class_driver *class_driver)161161{162162- int retval = -EINVAL;162162+ int retval;163163 int minor_base = class_driver->minor_base;164164- int minor = 0;164164+ int minor;165165 char name[20];166166 char *temp;167167···173173 */174174 minor_base = 0;175175#endif176176- intf->minor = -1;177177-178178- dbg ("looking for a minor, starting at %d", minor_base);179176180177 if (class_driver->fops == NULL)181181- goto exit;178178+ return -EINVAL;179179+ if (intf->minor >= 0)180180+ return -EADDRINUSE;181181+182182+ retval = init_usb_class();183183+ if (retval)184184+ return retval;185185+186186+ dev_dbg(&intf->dev, "looking for a minor, starting at %d", minor_base);182187183188 down_write(&minor_rwsem);184189 for (minor = minor_base; minor < MAX_USB_MINORS; ++minor) {···191186 continue;192187193188 usb_minors[minor] = class_driver->fops;194194-195195- retval = 0;189189+ intf->minor = minor;196190 break;197191 }198192 up_write(&minor_rwsem);199199-200200- if (retval)201201- goto exit;202202-203203- retval = init_usb_class();204204- if (retval)205205- goto exit;206206-207207- intf->minor = minor;193193+ if (intf->minor < 0)194194+ return -EXFULL;208195209196 /* create a usb class device for this usb interface */210197 snprintf(name, sizeof(name), class_driver->name, minor - minor_base);···210213 "%s", temp);211214 if (IS_ERR(intf->usb_dev)) {212215 down_write(&minor_rwsem);213213- usb_minors[intf->minor] = NULL;216216+ usb_minors[minor] = NULL;217217+ intf->minor = -1;214218 up_write(&minor_rwsem);215219 retval = PTR_ERR(intf->usb_dev);216220 }217217-exit:218221 return retval;219222}220223EXPORT_SYMBOL_GPL(usb_register_dev);
···261261 ctrlrequest->wIndex & 0x0f;262262 struct musb_ep *musb_ep;263263 struct musb_hw_ep *ep;264264+ struct musb_request *request;264265 void __iomem *regs;265266 int is_in;266267 u16 csr;···301300 csr &= ~(MUSB_RXCSR_P_SENDSTALL |302301 MUSB_RXCSR_P_SENTSTALL);303302 musb_writew(regs, MUSB_RXCSR, csr);303303+ }304304+305305+ /* Maybe start the first request in the queue */306306+ request = to_musb_request(307307+ next_request(musb_ep));308308+ if (!musb_ep->busy && request) {309309+ DBG(3, "restarting the request\n");310310+ musb_ep_restart(musb, request);304311 }305312306313 /* select ep0 again */
+6
drivers/usb/musb/musb_host.c
···660660661661 qh->segsize = length;662662663663+ /*664664+ * Ensure the data reaches to main memory before starting665665+ * DMA transfer666666+ */667667+ wmb();668668+663669 if (!dma->channel_program(channel, pkt_size, mode,664670 urb->transfer_dma + offset, length)) {665671 dma->channel_release(channel);
+1-1
drivers/vhost/net.c
···243243 int r, nlogs = 0;244244245245 while (datalen > 0) {246246- if (unlikely(headcount >= VHOST_NET_MAX_SG)) {246246+ if (unlikely(seg >= VHOST_NET_MAX_SG)) {247247 r = -ENOBUFS;248248 goto err;249249 }
+4-3
drivers/vhost/vhost.c
···858858 if (r < 0)859859 return r;860860 len -= l;861861- if (!len)861861+ if (!len) {862862+ if (vq->log_ctx)863863+ eventfd_signal(vq->log_ctx, 1);862864 return 0;865865+ }863866 }864864- if (vq->log_ctx)865865- eventfd_signal(vq->log_ctx, 1);866867 /* Length written exceeds what we have stored. This is a bug. */867868 BUG();868869 return 0;
+3-2
drivers/video/console/fbcon.c
···35083508 softback_buf = 0UL;3509350935103510 for (i = 0; i < FB_MAX; i++) {35113511- int pending;35113511+ int pending = 0;3512351235133513 mapped = 0;35143514 info = registered_fb[i];···35163516 if (info == NULL)35173517 continue;3518351835193519- pending = cancel_work_sync(&info->queue);35193519+ if (info->queue.func)35203520+ pending = cancel_work_sync(&info->queue);35203521 DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :35213522 "no"));35223523
···298298 * Set bit to enable graphics DMA.299299 */300300 x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0);301301- x |= fbi->active ? 0x00000100 : 0;302302- fbi->active = 0;301301+ x &= ~CFG_GRA_ENA_MASK;302302+ x |= fbi->active ? CFG_GRA_ENA(1) : CFG_GRA_ENA(0);303303304304 /*305305 * If we are in a pseudo-color mode, we need to enable
···755755{756756 int ret = 0;757757758758- blocking_notifier_chain_register(&xenstore_chain, nb);758758+ if (xenstored_ready > 0)759759+ ret = nb->notifier_call(nb, 0, NULL);760760+ else761761+ blocking_notifier_chain_register(&xenstore_chain, nb);759762760763 return ret;761764}···772769773770void xenbus_probe(struct work_struct *unused)774771{775775- BUG_ON((xenstored_ready <= 0));772772+ xenstored_ready = 1;776773777774 /* Enumerate devices in xenstore and watch for changes. */778775 xenbus_probe_devices(&xenbus_frontend);···838835 xen_store_evtchn = xen_start_info->store_evtchn;839836 xen_store_mfn = xen_start_info->store_mfn;840837 xen_store_interface = mfn_to_virt(xen_store_mfn);838838+ xenstored_ready = 1;841839 }842842- xenstored_ready = 1;843840 }844841845842 /* Initialize the interface to xenstore. */
+9-1
fs/aio.c
···712712 */713713 ret = retry(iocb);714714715715- if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED)715715+ if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {716716+ /*717717+ * There's no easy way to restart the syscall since other AIO's718718+ * may be already running. Just fail this IO with EINTR.719719+ */720720+ if (unlikely(ret == -ERESTARTSYS || ret == -ERESTARTNOINTR ||721721+ ret == -ERESTARTNOHAND || ret == -ERESTART_RESTARTBLOCK))722722+ ret = -EINTR;716723 aio_complete(iocb, ret, 0);724724+ }717725out:718726 spin_lock_irq(&ctx->ctx_lock);719727
+33-16
fs/cifs/cifssmb.c
···232232small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,233233 void **request_buf)234234{235235- int rc = 0;235235+ int rc;236236237237 rc = cifs_reconnect_tcon(tcon, smb_command);238238 if (rc)···250250 if (tcon != NULL)251251 cifs_stats_inc(&tcon->num_smbs_sent);252252253253- return rc;253253+ return 0;254254}255255256256int···281281282282/* If the return code is zero, this function must fill in request_buf pointer */283283static int284284-smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,285285- void **request_buf /* returned */ ,286286- void **response_buf /* returned */ )284284+__smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,285285+ void **request_buf, void **response_buf)287286{288288- int rc = 0;289289-290290- rc = cifs_reconnect_tcon(tcon, smb_command);291291- if (rc)292292- return rc;293293-294287 *request_buf = cifs_buf_get();295288 if (*request_buf == NULL) {296289 /* BB should we add a retry in here if not a writepage? */···302309 if (tcon != NULL)303310 cifs_stats_inc(&tcon->num_smbs_sent);304311305305- return rc;312312+ return 0;313313+}314314+315315+/* If the return code is zero, this function must fill in request_buf pointer */316316+static int317317+smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,318318+ void **request_buf, void **response_buf)319319+{320320+ int rc;321321+322322+ rc = cifs_reconnect_tcon(tcon, smb_command);323323+ if (rc)324324+ return rc;325325+326326+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);327327+}328328+329329+static int330330+smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon,331331+ void **request_buf, void **response_buf)332332+{333333+ if (tcon->ses->need_reconnect || tcon->need_reconnect)334334+ return -EHOSTDOWN;335335+336336+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);306337}307338308339static int validate_t2(struct smb_t2_rsp *pSMB)···4551453445524535 cFYI(1, "In QFSUnixInfo");45534536QFSUnixRetry:45544554- rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,45554555- (void **) &pSMBr);45374537+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,45384538+ (void **) &pSMB, (void **) &pSMBr);45564539 if (rc)45574540 return rc;45584541···46214604 cFYI(1, "In SETFSUnixInfo");46224605SETFSUnixRetry:46234606 /* BB switch to small buf init to save memory */46244624- rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,46254625- (void **) &pSMBr);46074607+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,46084608+ (void **) &pSMB, (void **) &pSMBr);46264609 if (rc)46274610 return rc;46284611
···34333433 wake_up(&res->wq);34343434 wake_up(&dlm->migration_wq);34353435}34363436+34373437+void dlm_force_free_mles(struct dlm_ctxt *dlm)34383438+{34393439+ int i;34403440+ struct hlist_head *bucket;34413441+ struct dlm_master_list_entry *mle;34423442+ struct hlist_node *tmp, *list;34433443+34443444+ /*34453445+ * We notified all other nodes that we are exiting the domain and34463446+ * marked the dlm state to DLM_CTXT_LEAVING. If any mles are still34473447+ * around we force free them and wake any processes that are waiting34483448+ * on the mles34493449+ */34503450+ spin_lock(&dlm->spinlock);34513451+ spin_lock(&dlm->master_lock);34523452+34533453+ BUG_ON(dlm->dlm_state != DLM_CTXT_LEAVING);34543454+ BUG_ON((find_next_bit(dlm->domain_map, O2NM_MAX_NODES, 0) < O2NM_MAX_NODES));34553455+34563456+ for (i = 0; i < DLM_HASH_BUCKETS; i++) {34573457+ bucket = dlm_master_hash(dlm, i);34583458+ hlist_for_each_safe(list, tmp, bucket) {34593459+ mle = hlist_entry(list, struct dlm_master_list_entry,34603460+ master_hash_node);34613461+ if (mle->type != DLM_MLE_BLOCK) {34623462+ mlog(ML_ERROR, "bad mle: %p\n", mle);34633463+ dlm_print_one_mle(mle);34643464+ }34653465+ atomic_set(&mle->woken, 1);34663466+ wake_up(&mle->wq);34673467+34683468+ __dlm_unlink_mle(dlm, mle);34693469+ __dlm_mle_detach_hb_events(dlm, mle);34703470+ __dlm_put_mle(mle);34713471+ }34723472+ }34733473+ spin_unlock(&dlm->master_lock);34743474+ spin_unlock(&dlm->spinlock);34753475+}
···42014201 goto out;42024202 }4203420342044204- mutex_lock(&new_inode->i_mutex);42054205- ret = ocfs2_inode_lock(new_inode, &new_bh, 1);42044204+ mutex_lock_nested(&new_inode->i_mutex, I_MUTEX_CHILD);42054205+ ret = ocfs2_inode_lock_nested(new_inode, &new_bh, 1,42064206+ OI_LS_REFLINK_TARGET);42064207 if (ret) {42074208 mlog_errno(ret);42084209 goto out_unlock;
+10-12
fs/ocfs2/reservations.c
···732732 struct ocfs2_alloc_reservation *resv,733733 int *cstart, int *clen)734734{735735- unsigned int wanted = *clen;736736-737735 if (resv == NULL || ocfs2_resmap_disabled(resmap))738736 return -ENOSPC;739737740738 spin_lock(&resv_lock);741739742742- /*743743- * We don't want to over-allocate for temporary744744- * windows. Otherwise, we run the risk of fragmenting the745745- * allocation space.746746- */747747- wanted = ocfs2_resv_window_bits(resmap, resv);748748- if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen)749749- wanted = *clen;750750-751740 if (ocfs2_resv_empty(resv)) {752752- mlog(0, "empty reservation, find new window\n");741741+ /*742742+ * We don't want to over-allocate for temporary743743+ * windows. Otherwise, we run the risk of fragmenting the744744+ * allocation space.745745+ */746746+ unsigned int wanted = ocfs2_resv_window_bits(resmap, resv);753747748748+ if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen)749749+ wanted = *clen;750750+751751+ mlog(0, "empty reservation, find new window\n");754752 /*755753 * Try to get a window here. If it works, we must fall756754 * through and test the bitmap . This avoids some
···128128 }129129130130 /* Fast symlinks can't be large */131131- len = strlen(target);131131+ len = strnlen(target, ocfs2_fast_symlink_chars(inode->i_sb));132132 link = kzalloc(len + 1, GFP_NOFS);133133 if (!link) {134134 status = -ENOMEM;
···170170int reiserfs_unpack(struct inode *inode, struct file *filp)171171{172172 int retval = 0;173173+ int depth;173174 int index;174175 struct page *page;175176 struct address_space *mapping;···189188 /* we need to make sure nobody is changing the file size beneath190189 ** us191190 */192192- mutex_lock(&inode->i_mutex);193193- reiserfs_write_lock(inode->i_sb);191191+ reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb);192192+ depth = reiserfs_write_lock_once(inode->i_sb);194193195194 write_from = inode->i_size & (blocksize - 1);196195 /* if we are on a block boundary, we are already unpacked. */···225224226225 out:227226 mutex_unlock(&inode->i_mutex);228228- reiserfs_write_unlock(inode->i_sb);227227+ reiserfs_write_unlock_once(inode->i_sb, depth);229228 return retval;230229}
+9-3
fs/xfs/xfs_log_cil.c
···405405 new_ctx = kmem_zalloc(sizeof(*new_ctx), KM_SLEEP|KM_NOFS);406406 new_ctx->ticket = xlog_cil_ticket_alloc(log);407407408408- /* lock out transaction commit, but don't block on background push */408408+ /*409409+ * Lock out transaction commit, but don't block for background pushes410410+ * unless we are well over the CIL space limit. See the definition of411411+ * XLOG_CIL_HARD_SPACE_LIMIT() for the full explanation of the logic412412+ * used here.413413+ */409414 if (!down_write_trylock(&cil->xc_ctx_lock)) {410410- if (!push_seq)415415+ if (!push_seq &&416416+ cil->xc_ctx->space_used < XLOG_CIL_HARD_SPACE_LIMIT(log))411417 goto out_free_ticket;412418 down_write(&cil->xc_ctx_lock);413419 }···428422 goto out_skip;429423430424 /* check for a previously pushed seqeunce */431431- if (push_seq < cil->xc_ctx->sequence)425425+ if (push_seq && push_seq < cil->xc_ctx->sequence)432426 goto out_skip;433427434428 /*
+21-16
fs/xfs/xfs_log_priv.h
···426426};427427428428/*429429- * The amount of log space we should the CIL to aggregate is difficult to size.430430- * Whatever we chose we have to make we can get a reservation for the log space431431- * effectively, that it is large enough to capture sufficient relogging to432432- * reduce log buffer IO significantly, but it is not too large for the log or433433- * induces too much latency when writing out through the iclogs. We track both434434- * space consumed and the number of vectors in the checkpoint context, so we435435- * need to decide which to use for limiting.429429+ * The amount of log space we allow the CIL to aggregate is difficult to size.430430+ * Whatever we choose, we have to make sure we can get a reservation for the431431+ * log space effectively, that it is large enough to capture sufficient432432+ * relogging to reduce log buffer IO significantly, but it is not too large for433433+ * the log or induces too much latency when writing out through the iclogs. We434434+ * track both space consumed and the number of vectors in the checkpoint435435+ * context, so we need to decide which to use for limiting.436436 *437437 * Every log buffer we write out during a push needs a header reserved, which438438 * is at least one sector and more for v2 logs. Hence we need a reservation of···459459 * checkpoint transaction ticket is specific to the checkpoint context, rather460460 * than the CIL itself.461461 *462462- * With dynamic reservations, we can basically make up arbitrary limits for the463463- * checkpoint size so long as they don't violate any other size rules. Hence464464- * the initial maximum size for the checkpoint transaction will be set to a465465- * quarter of the log or 8MB, which ever is smaller. 8MB is an arbitrary limit466466- * right now based on the latency of writing out a large amount of data through467467- * the circular iclog buffers.462462+ * With dynamic reservations, we can effectively make up arbitrary limits for463463+ * the checkpoint size so long as they don't violate any other size rules.464464+ * Recovery imposes a rule that no transaction exceed half the log, so we are465465+ * limited by that. Furthermore, the log transaction reservation subsystem466466+ * tries to keep 25% of the log free, so we need to keep below that limit or we467467+ * risk running out of free log space to start any new transactions.468468+ *469469+ * In order to keep background CIL push efficient, we will set a lower470470+ * threshold at which background pushing is attempted without blocking current471471+ * transaction commits. A separate, higher bound defines when CIL pushes are472472+ * enforced to ensure we stay within our maximum checkpoint size bounds.473473+ * threshold, yet give us plenty of space for aggregation on large logs.468474 */469469-470470-#define XLOG_CIL_SPACE_LIMIT(log) \471471- (min((log->l_logsize >> 2), (8 * 1024 * 1024)))475475+#define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3)476476+#define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4))472477473478/*474479 * The reservation head lsn is not made up of a cycle number and block number.
+1-1
include/acpi/acpixf.h
···5555extern u8 acpi_gbl_permanent_mmap;56565757/*5858- * Globals that are publically available, allowing for5858+ * Globals that are publicly available, allowing for5959 * run time configuration6060 */6161extern u32 acpi_dbg_level;
+20-9
include/drm/drmP.h
···612612 struct kref refcount;613613614614 /** Handle count of this object. Each handle also holds a reference */615615- struct kref handlecount;615615+ atomic_t handle_count; /* number of handles on this object */616616617617 /** Related drm device */618618 struct drm_device *dev;···808808 */809809 int (*gem_init_object) (struct drm_gem_object *obj);810810 void (*gem_free_object) (struct drm_gem_object *obj);811811- void (*gem_free_object_unlocked) (struct drm_gem_object *obj);812811813812 /* vga arb irq handler */814813 void (*vgaarb_irq)(struct drm_device *dev, bool state);···11741175extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);11751176extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);11761177extern void drm_vm_open_locked(struct vm_area_struct *vma);11781178+extern void drm_vm_close_locked(struct vm_area_struct *vma);11771179extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);11781180extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);11791181extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);···14551455void drm_gem_destroy(struct drm_device *dev);14561456void drm_gem_object_release(struct drm_gem_object *obj);14571457void drm_gem_object_free(struct kref *kref);14581458-void drm_gem_object_free_unlocked(struct kref *kref);14591458struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,14601459 size_t size);14611460int drm_gem_object_init(struct drm_device *dev,14621461 struct drm_gem_object *obj, size_t size);14631463-void drm_gem_object_handle_free(struct kref *kref);14621462+void drm_gem_object_handle_free(struct drm_gem_object *obj);14641463void drm_gem_vm_open(struct vm_area_struct *vma);14651464void drm_gem_vm_close(struct vm_area_struct *vma);14661465int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);···14821483static inline void14831484drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)14841485{14851485- if (obj != NULL)14861486- kref_put(&obj->refcount, drm_gem_object_free_unlocked);14861486+ if (obj != NULL) {14871487+ struct drm_device *dev = obj->dev;14881488+ mutex_lock(&dev->struct_mutex);14891489+ kref_put(&obj->refcount, drm_gem_object_free);14901490+ mutex_unlock(&dev->struct_mutex);14911491+ }14871492}1488149314891494int drm_gem_handle_create(struct drm_file *file_priv,···14981495drm_gem_object_handle_reference(struct drm_gem_object *obj)14991496{15001497 drm_gem_object_reference(obj);15011501- kref_get(&obj->handlecount);14981498+ atomic_inc(&obj->handle_count);15021499}1503150015041501static inline void···15071504 if (obj == NULL)15081505 return;1509150615071507+ if (atomic_read(&obj->handle_count) == 0)15081508+ return;15101509 /*15111510 * Must bump handle count first as this may be the last15121511 * ref, in which case the object would disappear before we15131512 * checked for a name15141513 */15151515- kref_put(&obj->handlecount, drm_gem_object_handle_free);15141514+ if (atomic_dec_and_test(&obj->handle_count))15151515+ drm_gem_object_handle_free(obj);15161516 drm_gem_object_unreference(obj);15171517}15181518···15251519 if (obj == NULL)15261520 return;1527152115221522+ if (atomic_read(&obj->handle_count) == 0)15231523+ return;15241524+15281525 /*15291526 * Must bump handle count first as this may be the last15301527 * ref, in which case the object would disappear before we15311528 * checked for a name15321529 */15331533- kref_put(&obj->handlecount, drm_gem_object_handle_free);15301530+15311531+ if (atomic_dec_and_test(&obj->handle_count))15321532+ drm_gem_object_handle_free(obj);15341533 drm_gem_object_unreference_unlocked(obj);15351534}15361535
···5353#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */5454#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */5555#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */5656+#define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */56575758#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)5859
···454454 * Makes rcu_dereference_check() do the dirty work.455455 */456456#define rcu_dereference_bh(p) \457457- rcu_dereference_check(p, rcu_read_lock_bh_held())457457+ rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled())458458459459/**460460 * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched
+1-1
include/linux/socket.h
···322322 int offset, 323323 unsigned int len, __wsum *csump);324324325325-extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);325325+extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);326326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);327327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,328328 int offset, int len);
···365365 n = setup_sgl_buf(sgl, fifo->data + off, nents, l);366366 n += setup_sgl_buf(sgl + n, fifo->data, nents - n, len - l);367367368368- if (n)369369- sg_mark_end(sgl + n - 1);370368 return n;371369}372370
···365365EXPORT_SYMBOL_GPL(smp_call_function_any);366366367367/**368368- * __smp_call_function_single(): Run a function on another CPU368368+ * __smp_call_function_single(): Run a function on a specific CPU369369 * @cpu: The CPU to run on.370370 * @data: Pre-allocated and setup data structure371371+ * @wait: If true, wait until function has completed on specified CPU.371372 *372373 * Like smp_call_function_single(), but allow caller to pass in a373374 * pre-allocated data structure. Useful for embedding @data inside···377376void __smp_call_function_single(int cpu, struct call_single_data *data,378377 int wait)379378{380380- csd_lock(data);379379+ unsigned int this_cpu;380380+ unsigned long flags;381381382382+ this_cpu = get_cpu();382383 /*383384 * Can deadlock when called with interrupts disabled.384385 * We allow cpu's that are not yet online though, as no one else can···390387 WARN_ON_ONCE(cpu_online(smp_processor_id()) && wait && irqs_disabled()391388 && !oops_in_progress);392389393393- generic_exec_single(cpu, data, wait);390390+ if (cpu == this_cpu) {391391+ local_irq_save(flags);392392+ data->func(data->info);393393+ local_irq_restore(flags);394394+ } else {395395+ csd_lock(data);396396+ generic_exec_single(cpu, data, wait);397397+ }398398+ put_cpu();394399}395400396401/**
+2-4
lib/bug.c
···7272 return NULL;7373}74747575-int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,7676- struct module *mod)7575+void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,7676+ struct module *mod)7777{7878 char *secstrings;7979 unsigned int i;···9797 * could potentially lead to deadlock and thus be counter-productive.9898 */9999 list_add(&mod->bug_list, &module_bug_list);100100-101101- return 0;102100}103101104102void module_bug_cleanup(struct module *mod)
+1-1
lib/list_sort.c
···7070 * element comparison is needed, so the client's cmp()7171 * routine can invoke cond_resched() periodically.7272 */7373- (*cmp)(priv, tail, tail);7373+ (*cmp)(priv, tail->next, tail->next);74747575 tail->next->prev = tail;7676 tail = tail->next;
+5-2
mm/fremap.c
···125125{126126 struct mm_struct *mm = current->mm;127127 struct address_space *mapping;128128- unsigned long end = start + size;129128 struct vm_area_struct *vma;130129 int err = -EINVAL;131130 int has_write_lock = 0;···139140140141 /* Does the address range wrap, or is the span zero-sized? */141142 if (start + size <= start)143143+ return err;144144+145145+ /* Does pgoff wrap? */146146+ if (pgoff + (size >> PAGE_SHIFT) < pgoff)142147 return err;143148144149 /* Can we represent this offset inside this architecture's pte's? */···171168 if (!(vma->vm_flags & VM_CAN_NONLINEAR))172169 goto out;173170174174- if (end <= start || start < vma->vm_start || end > vma->vm_end)171171+ if (start < vma->vm_start || start + size > vma->vm_end)175172 goto out;176173177174 /* Must set VM_NONLINEAR before any pages are populated. */
+13-11
mm/hugetlb.c
···23242324 * and just make the page writable */23252325 avoidcopy = (page_mapcount(old_page) == 1);23262326 if (avoidcopy) {23272327- if (!trylock_page(old_page)) {23282328- if (PageAnon(old_page))23292329- page_move_anon_rmap(old_page, vma, address);23302330- } else23312331- unlock_page(old_page);23272327+ if (PageAnon(old_page))23282328+ page_move_anon_rmap(old_page, vma, address);23322329 set_huge_ptep_writable(vma, address, ptep);23332330 return 0;23342331 }···24012404 set_huge_pte_at(mm, address, ptep,24022405 make_huge_pte(vma, new_page, 1));24032406 page_remove_rmap(old_page);24042404- hugepage_add_anon_rmap(new_page, vma, address);24072407+ hugepage_add_new_anon_rmap(new_page, vma, address);24052408 /* Make the old page be freed below */24062409 new_page = old_page;24072410 mmu_notifier_invalidate_range_end(mm,···26282631 vma, address);26292632 }2630263326312631- if (!pagecache_page) {26322632- page = pte_page(entry);26342634+ /*26352635+ * hugetlb_cow() requires page locks of pte_page(entry) and26362636+ * pagecache_page, so here we need take the former one26372637+ * when page != pagecache_page or !pagecache_page.26382638+ * Note that locking order is always pagecache_page -> page,26392639+ * so no worry about deadlock.26402640+ */26412641+ page = pte_page(entry);26422642+ if (page != pagecache_page)26332643 lock_page(page);26342634- }2635264426362645 spin_lock(&mm->page_table_lock);26372646 /* Check for a racing update before calling hugetlb_cow */···26642661 if (pagecache_page) {26652662 unlock_page(pagecache_page);26662663 put_page(pagecache_page);26672667- } else {26682668- unlock_page(page);26692664 }26652665+ unlock_page(page);2670266626712667out_mutex:26722668 mutex_unlock(&hugetlb_instantiation_mutex);
···121121}122122123123/* return true if the task is not adequate as candidate victim task. */124124-static bool oom_unkillable_task(struct task_struct *p, struct mem_cgroup *mem,125125- const nodemask_t *nodemask)124124+static bool oom_unkillable_task(struct task_struct *p,125125+ const struct mem_cgroup *mem, const nodemask_t *nodemask)126126{127127 if (is_global_init(p))128128 return true;···208208 */209209 points += p->signal->oom_score_adj;210210211211- if (points < 0)212212- return 0;211211+ /*212212+ * Never return 0 for an eligible task that may be killed since it's213213+ * possible that no single user task uses more than 0.1% of memory and214214+ * no single admin tasks uses more than 3.0%.215215+ */216216+ if (points <= 0)217217+ return 1;213218 return (points < 1000) ? points : 1000;214219}215220···344339/**345340 * dump_tasks - dump current memory state of all system tasks346341 * @mem: current's memory controller, if constrained342342+ * @nodemask: nodemask passed to page allocator for mempolicy ooms347343 *348348- * Dumps the current memory state of all system tasks, excluding kernel threads.344344+ * Dumps the current memory state of all eligible tasks. Tasks not in the same345345+ * memcg, not in the same cpuset, or bound to a disjoint set of mempolicy nodes346346+ * are not shown.349347 * State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj350348 * value, oom_score_adj value, and name.351349 *352352- * If the actual is non-NULL, only tasks that are a member of the mem_cgroup are353353- * shown.354354- *355350 * Call with tasklist_lock read-locked.356351 */357357-static void dump_tasks(const struct mem_cgroup *mem)352352+static void dump_tasks(const struct mem_cgroup *mem, const nodemask_t *nodemask)358353{359354 struct task_struct *p;360355 struct task_struct *task;361356362357 pr_info("[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name\n");363358 for_each_process(p) {364364- if (p->flags & PF_KTHREAD)365365- continue;366366- if (mem && !task_in_mem_cgroup(p, mem))359359+ if (oom_unkillable_task(p, mem, nodemask))367360 continue;368361369362 task = find_lock_task_mm(p);···384381}385382386383static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order,387387- struct mem_cgroup *mem)384384+ struct mem_cgroup *mem, const nodemask_t *nodemask)388385{389386 task_lock(current);390387 pr_warning("%s invoked oom-killer: gfp_mask=0x%x, order=%d, "···397394 mem_cgroup_print_oom_info(mem, p);398395 show_mem();399396 if (sysctl_oom_dump_tasks)400400- dump_tasks(mem);397397+ dump_tasks(mem, nodemask);401398}402399403400#define K(x) ((x) << (PAGE_SHIFT-10))···439436 unsigned int victim_points = 0;440437441438 if (printk_ratelimit())442442- dump_header(p, gfp_mask, order, mem);439439+ dump_header(p, gfp_mask, order, mem, nodemask);443440444441 /*445442 * If the task is already exiting, don't alarm the sysadmin or kill···485482 * Determines whether the kernel must panic because of the panic_on_oom sysctl.486483 */487484static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,488488- int order)485485+ int order, const nodemask_t *nodemask)489486{490487 if (likely(!sysctl_panic_on_oom))491488 return;···499496 return;500497 }501498 read_lock(&tasklist_lock);502502- dump_header(NULL, gfp_mask, order, NULL);499499+ dump_header(NULL, gfp_mask, order, NULL, nodemask);503500 read_unlock(&tasklist_lock);504501 panic("Out of memory: %s panic_on_oom is enabled\n",505502 sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide");···512509 unsigned int points = 0;513510 struct task_struct *p;514511515515- check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0);512512+ check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0, NULL);516513 limit = mem_cgroup_get_limit(mem) >> PAGE_SHIFT;517514 read_lock(&tasklist_lock);518515retry:···644641void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,645642 int order, nodemask_t *nodemask)646643{644644+ const nodemask_t *mpol_mask;647645 struct task_struct *p;648646 unsigned long totalpages;649647 unsigned long freed = 0;···674670 */675671 constraint = constrained_alloc(zonelist, gfp_mask, nodemask,676672 &totalpages);677677- check_panic_on_oom(constraint, gfp_mask, order);673673+ mpol_mask = (constraint == CONSTRAINT_MEMORY_POLICY) ? nodemask : NULL;674674+ check_panic_on_oom(constraint, gfp_mask, order, mpol_mask);678675679676 read_lock(&tasklist_lock);680677 if (sysctl_oom_kill_allocating_task &&···693688 }694689695690retry:696696- p = select_bad_process(&points, totalpages, NULL,697697- constraint == CONSTRAINT_MEMORY_POLICY ? nodemask :698698- NULL);691691+ p = select_bad_process(&points, totalpages, NULL, mpol_mask);699692 if (PTR_ERR(p) == -1UL)700693 goto out;701694702695 /* Found nothing?!?! Either we hang forever, or we panic. */703696 if (!p) {704704- dump_header(NULL, gfp_mask, order, NULL);697697+ dump_header(NULL, gfp_mask, order, NULL, mpol_mask);705698 read_unlock(&tasklist_lock);706699 panic("Out of memory and no killable processes...\n");707700 }
···381381unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma)382382{383383 if (PageAnon(page)) {384384- if (vma->anon_vma->root != page_anon_vma(page)->root)384384+ struct anon_vma *page__anon_vma = page_anon_vma(page);385385+ /*386386+ * Note: swapoff's unuse_vma() is more efficient with this387387+ * check, and needs it to match anon_vma when KSM is active.388388+ */389389+ if (!vma->anon_vma || !page__anon_vma ||390390+ vma->anon_vma->root != page__anon_vma->root)385391 return -EFAULT;386392 } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {387393 if (!vma->vm_file ||···15701564 struct vm_area_struct *vma, unsigned long address, int exclusive)15711565{15721566 struct anon_vma *anon_vma = vma->anon_vma;15671567+15731568 BUG_ON(!anon_vma);15741574- if (!exclusive) {15751575- struct anon_vma_chain *avc;15761576- avc = list_entry(vma->anon_vma_chain.prev,15771577- struct anon_vma_chain, same_vma);15781578- anon_vma = avc->anon_vma;15791579- }15691569+15701570+ if (PageAnon(page))15711571+ return;15721572+ if (!exclusive)15731573+ anon_vma = anon_vma->root;15741574+15801575 anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;15811576 page->mapping = (struct address_space *) anon_vma;15821577 page->index = linear_page_index(vma, address);···15881581{15891582 struct anon_vma *anon_vma = vma->anon_vma;15901583 int first;15841584+15851585+ BUG_ON(!PageLocked(page));15911586 BUG_ON(!anon_vma);15921587 BUG_ON(address < vma->vm_start || address >= vma->vm_end);15931588 first = atomic_inc_and_test(&page->_mapcount);
+35-8
mm/vmscan.c
···18041804 * If a zone is deemed to be full of pinned pages then just give it a light18051805 * scan then give up on it.18061806 */18071807-static bool shrink_zones(int priority, struct zonelist *zonelist,18071807+static void shrink_zones(int priority, struct zonelist *zonelist,18081808 struct scan_control *sc)18091809{18101810 struct zoneref *z;18111811 struct zone *zone;18121812- bool all_unreclaimable = true;1813181218141813 for_each_zone_zonelist_nodemask(zone, z, zonelist,18151814 gfp_zone(sc->gfp_mask), sc->nodemask) {···18261827 }1827182818281829 shrink_zone(priority, zone, sc);18291829- all_unreclaimable = false;18301830 }18311831+}18321832+18331833+static bool zone_reclaimable(struct zone *zone)18341834+{18351835+ return zone->pages_scanned < zone_reclaimable_pages(zone) * 6;18361836+}18371837+18381838+/*18391839+ * As hibernation is going on, kswapd is freezed so that it can't mark18401840+ * the zone into all_unreclaimable. It can't handle OOM during hibernation.18411841+ * So let's check zone's unreclaimable in direct reclaim as well as kswapd.18421842+ */18431843+static bool all_unreclaimable(struct zonelist *zonelist,18441844+ struct scan_control *sc)18451845+{18461846+ struct zoneref *z;18471847+ struct zone *zone;18481848+ bool all_unreclaimable = true;18491849+18501850+ for_each_zone_zonelist_nodemask(zone, z, zonelist,18511851+ gfp_zone(sc->gfp_mask), sc->nodemask) {18521852+ if (!populated_zone(zone))18531853+ continue;18541854+ if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))18551855+ continue;18561856+ if (zone_reclaimable(zone)) {18571857+ all_unreclaimable = false;18581858+ break;18591859+ }18601860+ }18611861+18311862 return all_unreclaimable;18321863}18331864···18811852 struct scan_control *sc)18821853{18831854 int priority;18841884- bool all_unreclaimable;18851855 unsigned long total_scanned = 0;18861856 struct reclaim_state *reclaim_state = current->reclaim_state;18871857 struct zoneref *z;···18971869 sc->nr_scanned = 0;18981870 if (!priority)18991871 disable_swap_token();19001900- all_unreclaimable = shrink_zones(priority, zonelist, sc);18721872+ shrink_zones(priority, zonelist, sc);19011873 /*19021874 * Don't shrink slabs when reclaiming memory from19031875 * over limit cgroups···19591931 return sc->nr_reclaimed;1960193219611933 /* top priority shrink_zones still had more to do? don't OOM, then */19621962- if (scanning_global_lru(sc) && !all_unreclaimable)19341934+ if (scanning_global_lru(sc) && !all_unreclaimable(zonelist, sc))19631935 return 1;1964193619651937 return 0;···22252197 total_scanned += sc.nr_scanned;22262198 if (zone->all_unreclaimable)22272199 continue;22282228- if (nr_slab == 0 &&22292229- zone->pages_scanned >= (zone_reclaimable_pages(zone) * 6))22002200+ if (nr_slab == 0 && !zone_reclaimable(zone))22302201 zone->all_unreclaimable = 1;22312202 /*22322203 * If we've done a decent amount of scanning and
+10-4
net/8021q/vlan_core.c
···24242525 if (vlan_dev)2626 skb->dev = vlan_dev;2727- else if (vlan_id)2828- goto drop;2727+ else if (vlan_id) {2828+ if (!(skb->dev->flags & IFF_PROMISC))2929+ goto drop;3030+ skb->pkt_type = PACKET_OTHERHOST;3131+ }29323033 return (polling ? netif_receive_skb(skb) : netif_rx(skb));3134···105102106103 if (vlan_dev)107104 skb->dev = vlan_dev;108108- else if (vlan_id)109109- goto drop;105105+ else if (vlan_id) {106106+ if (!(skb->dev->flags & IFF_PROMISC))107107+ goto drop;108108+ skb->pkt_type = PACKET_OTHERHOST;109109+ }110110111111 for (p = napi->gro_list; p; p = p->next) {112112 NAPI_GRO_CB(p)->same_flow =
+18-11
net/9p/trans_rdma.c
···426426427427 /* Allocate an fcall for the reply */428428 rpl_context = kmalloc(sizeof *rpl_context, GFP_KERNEL);429429- if (!rpl_context)429429+ if (!rpl_context) {430430+ err = -ENOMEM;430431 goto err_close;432432+ }431433432434 /*433435 * If the request has a buffer, steal it, otherwise···447445 }448446 rpl_context->rc = req->rc;449447 if (!rpl_context->rc) {450450- kfree(rpl_context);451451- goto err_close;448448+ err = -ENOMEM;449449+ goto err_free2;452450 }453451454452 /*···460458 */461459 if (atomic_inc_return(&rdma->rq_count) <= rdma->rq_depth) {462460 err = post_recv(client, rpl_context);463463- if (err) {464464- kfree(rpl_context->rc);465465- kfree(rpl_context);466466- goto err_close;467467- }461461+ if (err)462462+ goto err_free1;468463 } else469464 atomic_dec(&rdma->rq_count);470465···470471471472 /* Post the request */472473 c = kmalloc(sizeof *c, GFP_KERNEL);473473- if (!c)474474- goto err_close;474474+ if (!c) {475475+ err = -ENOMEM;476476+ goto err_free1;477477+ }475478 c->req = req;476479477480 c->busa = ib_dma_map_single(rdma->cm_id->device,···500499 return ib_post_send(rdma->qp, &wr, &bad_wr);501500502501 error:502502+ kfree(c);503503+ kfree(rpl_context->rc);504504+ kfree(rpl_context);503505 P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n");504506 return -EIO;505505-507507+ err_free1:508508+ kfree(rpl_context->rc);509509+ err_free2:510510+ kfree(rpl_context);506511 err_close:507512 spin_lock_irqsave(&rdma->req_lock, flags);508513 if (rdma->state < P9_RDMA_CLOSING) {
+2-1
net/9p/trans_virtio.c
···329329330330 mutex_lock(&virtio_9p_lock);331331 list_for_each_entry(chan, &virtio_chan_list, chan_list) {332332- if (!strncmp(devname, chan->tag, chan->tag_len)) {332332+ if (!strncmp(devname, chan->tag, chan->tag_len) &&333333+ strlen(devname) == chan->tag_len) {333334 if (!chan->inuse) {334335 chan->inuse = true;335336 found = 1;
+2-10
net/atm/br2684.c
···399399 unregister_netdev(net_dev);400400 free_netdev(net_dev);401401 }402402- read_lock_irq(&devs_lock);403403- if (list_empty(&br2684_devs)) {404404- /* last br2684 device */405405- unregister_atmdevice_notifier(&atm_dev_notifier);406406- }407407- read_unlock_irq(&devs_lock);408402 return;409403 }410404···669675670676 if (list_empty(&br2684_devs)) {671677 /* 1st br2684 device */672672- register_atmdevice_notifier(&atm_dev_notifier);673678 brdev->number = 1;674679 } else675680 brdev->number = BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1;···808815 return -ENOMEM;809816#endif810817 register_atm_ioctl(&br2684_ioctl_ops);818818+ register_atmdevice_notifier(&atm_dev_notifier);811819 return 0;812820}813821···824830#endif825831826832827827- /* if not already empty */828828- if (!list_empty(&br2684_devs))829829- unregister_atmdevice_notifier(&atm_dev_notifier);833833+ unregister_atmdevice_notifier(&atm_dev_notifier);830834831835 while (!list_empty(&br2684_devs)) {832836 net_dev = list_entry_brdev(br2684_devs.next);
+3-2
net/core/iovec.c
···3535 * in any case.3636 */37373838-int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)3838+long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)3939{4040- int size, err, ct;4040+ int size, ct;4141+ long err;41424243 if (m->msg_namelen) {4344 if (mode == VERIFY_READ) {
···217217218218config NET_IPGRE219219 tristate "IP: GRE tunnels over IP"220220+ depends on IPV6 || IPV6=n220221 help221222 Tunneling means encapsulating data of one protocol type within222223 another protocol and sending it over a channel that understands the
···488488 * we can switch to copy when see the first bad fragment.489489 */490490 if (skb_has_frags(skb)) {491491- struct sk_buff *frag;491491+ struct sk_buff *frag, *frag2;492492 int first_len = skb_pagelen(skb);493493- int truesizes = 0;494493495494 if (first_len - hlen > mtu ||496495 ((first_len - hlen) & 7) ||···502503 if (frag->len > mtu ||503504 ((frag->len & 7) && frag->next) ||504505 skb_headroom(frag) < hlen)505505- goto slow_path;506506+ goto slow_path_clean;506507507508 /* Partially cloned skb? */508509 if (skb_shared(frag))509509- goto slow_path;510510+ goto slow_path_clean;510511511512 BUG_ON(frag->sk);512513 if (skb->sk) {513514 frag->sk = skb->sk;514515 frag->destructor = sock_wfree;515516 }516516- truesizes += frag->truesize;517517+ skb->truesize -= frag->truesize;517518 }518519519520 /* Everything is OK. Generate! */···523524 frag = skb_shinfo(skb)->frag_list;524525 skb_frag_list_init(skb);525526 skb->data_len = first_len - skb_headlen(skb);526526- skb->truesize -= truesizes;527527 skb->len = first_len;528528 iph->tot_len = htons(first_len);529529 iph->frag_off = htons(IP_MF);···574576 }575577 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);576578 return err;579579+580580+slow_path_clean:581581+ skb_walk_frags(skb, frag2) {582582+ if (frag2 == frag)583583+ break;584584+ frag2->sk = NULL;585585+ frag2->destructor = NULL;586586+ skb->truesize += frag2->truesize;587587+ }577588 }578589579590slow_path:
+1
net/ipv4/netfilter/ipt_REJECT.c
···112112 /* ip_route_me_harder expects skb->dst to be set */113113 skb_dst_set_noref(nskb, skb_dst(oldskb));114114115115+ nskb->protocol = htons(ETH_P_IP);115116 if (ip_route_me_harder(nskb, addr_type))116117 goto free_nskb;117118
···152152 } else if (!iwp->pointer)153153 return -EFAULT;154154155155- extra = kmalloc(extra_size, GFP_KERNEL);155155+ extra = kzalloc(extra_size, GFP_KERNEL);156156 if (!extra)157157 return -ENOMEM;158158
+2-3
net/xfrm/xfrm_policy.c
···11751175 tmpl->mode == XFRM_MODE_BEET) {11761176 remote = &tmpl->id.daddr;11771177 local = &tmpl->saddr;11781178- family = tmpl->encap_family;11791179- if (xfrm_addr_any(local, family)) {11801180- error = xfrm_get_saddr(net, &tmp, remote, family);11781178+ if (xfrm_addr_any(local, tmpl->encap_family)) {11791179+ error = xfrm_get_saddr(net, &tmp, remote, tmpl->encap_family);11811180 if (error)11821181 goto fail;11831182 local = &tmp;
···2424{2525 int i;2626 unsigned int ret;2727+ unsigned int nents;2728 struct scatterlist sg[10];28292930 printk(KERN_INFO "DMA fifo test start\n");···6261 * byte at the beginning, after the kfifo_skip().6362 */6463 sg_init_table(sg, ARRAY_SIZE(sg));6565- ret = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE);6666- printk(KERN_INFO "DMA sgl entries: %d\n", ret);6767- if (!ret) {6464+ nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE);6565+ printk(KERN_INFO "DMA sgl entries: %d\n", nents);6666+ if (!nents) {6867 /* fifo is full and no sgl was created */6968 printk(KERN_WARNING "error kfifo_dma_in_prepare\n");7069 return -EIO;···72717372 /* receive data */7473 printk(KERN_INFO "scatterlist for receive:\n");7575- for (i = 0; i < ARRAY_SIZE(sg); i++) {7474+ for (i = 0; i < nents; i++) {7675 printk(KERN_INFO7776 "sg[%d] -> "7877 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n",···9291 kfifo_dma_in_finish(&fifo, ret);93929493 /* Prepare to transmit data, example: 8 bytes */9595- ret = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8);9696- printk(KERN_INFO "DMA sgl entries: %d\n", ret);9797- if (!ret) {9494+ nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8);9595+ printk(KERN_INFO "DMA sgl entries: %d\n", nents);9696+ if (!nents) {9897 /* no data was available and no sgl was created */9998 printk(KERN_WARNING "error kfifo_dma_out_prepare\n");10099 return -EIO;101100 }102101103102 printk(KERN_INFO "scatterlist for transmit:\n");104104- for (i = 0; i < ARRAY_SIZE(sg); i++) {103103+ for (i = 0; i < nents; i++) {105104 printk(KERN_INFO106105 "sg[%d] -> "107106 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n",
···689689690690/********** Function prototypes. **********/691691692692-extern asmlinkage long sys_getpid(void);693693-extern asmlinkage long sys_getppid(void);694694-695692/* Check whether the given string starts with the given keyword. */696693bool tomoyo_str_starts(char **src, const char *find);697694/* Get tomoyo_realpath() of current process. */
+5
sound/core/control.c
···31313232/* max number of user-defined controls */3333#define MAX_USER_CONTROLS 323434+#define MAX_CONTROL_COUNT 102834353536struct snd_kctl_ioctl {3637 struct list_head list; /* list of all ioctls */···196195197196 if (snd_BUG_ON(!control || !control->count))198197 return NULL;198198+199199+ if (control->count > MAX_CONTROL_COUNT)200200+ return NULL;201201+199202 kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL);200203 if (kctl == NULL) {201204 snd_printk(KERN_ERR "Cannot allocate control instance\n");
···1212#include <linux/firmware.h>1313#include <linux/module.h>14141515+#include <asm/clkdev.h>1516#include <asm/clock.h>16171718#include <cpu/sh7722.h>···4140};42414342static struct clk siumckb_clk = {4444- .name = "siumckb_clk",4545- .id = -1,4643 .ops = &siumckb_clk_ops,4744 .rate = 0, /* initialised at run-time */4845};4646+4747+static struct clk_lookup *siumckb_lookup;49485049static int migor_hw_params(struct snd_pcm_substream *substream,5150 struct snd_pcm_hw_params *params)···181180 if (ret < 0)182181 return ret;183182183183+ siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL);184184+ if (!siumckb_lookup) {185185+ ret = -ENOMEM;186186+ goto eclkdevalloc;187187+ }188188+ clkdev_add(siumckb_lookup);189189+184190 /* Port number used on this machine: port B */185191 migor_snd_device = platform_device_alloc("soc-audio", 1);186192 if (!migor_snd_device) {···208200epdevadd:209201 platform_device_put(migor_snd_device);210202epdevalloc:203203+ clkdev_drop(siumckb_lookup);204204+eclkdevalloc:211205 clk_unregister(&siumckb_clk);212206 return ret;213207}214208215209static void __exit migor_exit(void)216210{211211+ clkdev_drop(siumckb_lookup);217212 clk_unregister(&siumckb_clk);218213 platform_device_unregister(migor_snd_device);219214}
+3-2
sound/soc/soc-cache.c
···203203 data[1] = (value >> 8) & 0xff;204204 data[2] = value & 0xff;205205206206- if (!snd_soc_codec_volatile_register(codec, reg))207207- reg_cache[reg] = value;206206+ if (!snd_soc_codec_volatile_register(codec, reg)207207+ && reg < codec->reg_cache_size)208208+ reg_cache[reg] = value;208209209210 if (codec->cache_only) {210211 codec->cache_sync = 1;
+2-1
virt/kvm/eventfd.c
···218218 events = file->f_op->poll(file, &irqfd->pt);219219220220 list_add_tail(&irqfd->list, &kvm->irqfds.items);221221- spin_unlock_irq(&kvm->irqfds.lock);222221223222 /*224223 * Check if there was an event already pending on the eventfd···225226 */226227 if (events & POLLIN)227228 schedule_work(&irqfd->inject);229229+230230+ spin_unlock_irq(&kvm->irqfds.lock);228231229232 /*230233 * do not drop the file until the irqfd is fully initialized, otherwise