···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 */
+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",
···11-#ifndef _ASM_IA64_COMPAT_H22-#define _ASM_IA64_COMPAT_H33-/*44- * Architecture specific compatibility types55- */66-#include <linux/types.h>77-88-#define COMPAT_USER_HZ 10099-#define COMPAT_UTS_MACHINE "i686\0\0\0"1010-1111-typedef u32 compat_size_t;1212-typedef s32 compat_ssize_t;1313-typedef s32 compat_time_t;1414-typedef s32 compat_clock_t;1515-typedef s32 compat_key_t;1616-typedef s32 compat_pid_t;1717-typedef u16 __compat_uid_t;1818-typedef u16 __compat_gid_t;1919-typedef u32 __compat_uid32_t;2020-typedef u32 __compat_gid32_t;2121-typedef u16 compat_mode_t;2222-typedef u32 compat_ino_t;2323-typedef u16 compat_dev_t;2424-typedef s32 compat_off_t;2525-typedef s64 compat_loff_t;2626-typedef u16 compat_nlink_t;2727-typedef u16 compat_ipc_pid_t;2828-typedef s32 compat_daddr_t;2929-typedef u32 compat_caddr_t;3030-typedef __kernel_fsid_t compat_fsid_t;3131-typedef s32 compat_timer_t;3232-3333-typedef s32 compat_int_t;3434-typedef s32 compat_long_t;3535-typedef s64 __attribute__((aligned(4))) compat_s64;3636-typedef u32 compat_uint_t;3737-typedef u32 compat_ulong_t;3838-typedef u64 __attribute__((aligned(4))) compat_u64;3939-4040-struct compat_timespec {4141- compat_time_t tv_sec;4242- s32 tv_nsec;4343-};4444-4545-struct compat_timeval {4646- compat_time_t tv_sec;4747- s32 tv_usec;4848-};4949-5050-struct compat_stat {5151- compat_dev_t st_dev;5252- u16 __pad1;5353- compat_ino_t st_ino;5454- compat_mode_t st_mode;5555- compat_nlink_t st_nlink;5656- __compat_uid_t st_uid;5757- __compat_gid_t st_gid;5858- compat_dev_t st_rdev;5959- u16 __pad2;6060- u32 st_size;6161- u32 st_blksize;6262- u32 st_blocks;6363- u32 st_atime;6464- u32 st_atime_nsec;6565- u32 st_mtime;6666- u32 st_mtime_nsec;6767- u32 st_ctime;6868- u32 st_ctime_nsec;6969- u32 __unused4;7070- u32 __unused5;7171-};7272-7373-struct compat_flock {7474- short l_type;7575- short l_whence;7676- compat_off_t l_start;7777- compat_off_t l_len;7878- compat_pid_t l_pid;7979-};8080-8181-#define F_GETLK64 128282-#define F_SETLK64 138383-#define F_SETLKW64 148484-8585-/*8686- * IA32 uses 4 byte alignment for 64 bit quantities,8787- * so we need to pack this structure.8888- */8989-struct compat_flock64 {9090- short l_type;9191- short l_whence;9292- compat_loff_t l_start;9393- compat_loff_t l_len;9494- compat_pid_t l_pid;9595-} __attribute__((packed));9696-9797-struct compat_statfs {9898- int f_type;9999- int f_bsize;100100- int f_blocks;101101- int f_bfree;102102- int f_bavail;103103- int f_files;104104- int f_ffree;105105- compat_fsid_t f_fsid;106106- int f_namelen; /* SunOS ignores this field. */107107- int f_frsize;108108- int f_spare[5];109109-};110110-111111-#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff112112-#define COMPAT_RLIM_INFINITY 0xffffffff113113-114114-typedef u32 compat_old_sigset_t; /* at least 32 bits */115115-116116-#define _COMPAT_NSIG 64117117-#define _COMPAT_NSIG_BPW 32118118-119119-typedef u32 compat_sigset_word;120120-121121-#define COMPAT_OFF_T_MAX 0x7fffffff122122-#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL123123-124124-struct compat_ipc64_perm {125125- compat_key_t key;126126- __compat_uid32_t uid;127127- __compat_gid32_t gid;128128- __compat_uid32_t cuid;129129- __compat_gid32_t cgid;130130- unsigned short mode;131131- unsigned short __pad1;132132- unsigned short seq;133133- unsigned short __pad2;134134- compat_ulong_t unused1;135135- compat_ulong_t unused2;136136-};137137-138138-struct compat_semid64_ds {139139- struct compat_ipc64_perm sem_perm;140140- compat_time_t sem_otime;141141- compat_ulong_t __unused1;142142- compat_time_t sem_ctime;143143- compat_ulong_t __unused2;144144- compat_ulong_t sem_nsems;145145- compat_ulong_t __unused3;146146- compat_ulong_t __unused4;147147-};148148-149149-struct compat_msqid64_ds {150150- struct compat_ipc64_perm msg_perm;151151- compat_time_t msg_stime;152152- compat_ulong_t __unused1;153153- compat_time_t msg_rtime;154154- compat_ulong_t __unused2;155155- compat_time_t msg_ctime;156156- compat_ulong_t __unused3;157157- compat_ulong_t msg_cbytes;158158- compat_ulong_t msg_qnum;159159- compat_ulong_t msg_qbytes;160160- compat_pid_t msg_lspid;161161- compat_pid_t msg_lrpid;162162- compat_ulong_t __unused4;163163- compat_ulong_t __unused5;164164-};165165-166166-struct compat_shmid64_ds {167167- struct compat_ipc64_perm shm_perm;168168- compat_size_t shm_segsz;169169- compat_time_t shm_atime;170170- compat_ulong_t __unused1;171171- compat_time_t shm_dtime;172172- compat_ulong_t __unused2;173173- compat_time_t shm_ctime;174174- compat_ulong_t __unused3;175175- compat_pid_t shm_cpid;176176- compat_pid_t shm_lpid;177177- compat_ulong_t shm_nattch;178178- compat_ulong_t __unused4;179179- compat_ulong_t __unused5;180180-};181181-182182-/*183183- * A pointer passed in from user mode. This should not be used for syscall parameters,184184- * just declare them as pointers because the syscall entry code will have appropriately185185- * converted them already.186186- */187187-typedef u32 compat_uptr_t;188188-189189-static inline void __user *190190-compat_ptr (compat_uptr_t uptr)191191-{192192- return (void __user *) (unsigned long) uptr;193193-}194194-195195-static inline compat_uptr_t196196-ptr_to_compat(void __user *uptr)197197-{198198- return (u32)(unsigned long)uptr;199199-}200200-201201-static __inline__ void __user *202202-arch_compat_alloc_user_space (long len)203203-{204204- struct pt_regs *regs = task_pt_regs(current);205205- return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len);206206-}207207-208208-#endif /* _ASM_IA64_COMPAT_H */
+5-6
arch/ia64/include/asm/hardirq.h
···66 * David Mosberger-Tang <davidm@hpl.hp.com>77 */8899-1010-#include <linux/threads.h>1111-#include <linux/irq.h>1212-1313-#include <asm/processor.h>1414-159/*1610 * No irq_cpustat_t for IA-64. The data is held in the per-CPU data structure.1711 */···1319#define __ARCH_IRQ_STAT 114201521#define local_softirq_pending() (local_cpu_data->softirq_pending)2222+2323+#include <linux/threads.h>2424+#include <linux/irq.h>2525+2626+#include <asm/processor.h>16271728extern void __iomem *ipi_base_addr;1829
···2055205520562056 IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __func__);2057205720582058- /*20592059- * Configure the CMCI/P vector and handler. Interrupts for CMC are20602060- * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c).20612061- */20622062- register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction);20632063- register_percpu_irq(IA64_CMCP_VECTOR, &cmcp_irqaction);20642064- ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */20652065-20662066- /* Setup the MCA rendezvous interrupt vector */20672067- register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, &mca_rdzv_irqaction);20682068-20692069- /* Setup the MCA wakeup interrupt vector */20702070- register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);20712071-20722072-#ifdef CONFIG_ACPI20732073- /* Setup the CPEI/P handler */20742074- register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);20752075-#endif20762076-20772058 /* Initialize the areas set aside by the OS to buffer the20782059 * platform/processor error states for MCA/INIT/CMC20792060 * handling.···20832102{20842103 if (!mca_init)20852104 return 0;21052105+21062106+ /*21072107+ * Configure the CMCI/P vector and handler. Interrupts for CMC are21082108+ * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c).21092109+ */21102110+ register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction);21112111+ register_percpu_irq(IA64_CMCP_VECTOR, &cmcp_irqaction);21122112+ ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */21132113+21142114+ /* Setup the MCA rendezvous interrupt vector */21152115+ register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, &mca_rdzv_irqaction);21162116+21172117+ /* Setup the MCA wakeup interrupt vector */21182118+ register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);21192119+21202120+#ifdef CONFIG_ACPI21212121+ /* Setup the CPEI/P handler */21222122+ register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);21232123+#endif2086212420872125 register_hotcpu_notifier(&mca_cpu_notifier);20882126
+1-1
arch/ia64/kernel/palinfo.c
···434434 unsigned long phys_stacked;435435 pal_hints_u_t hints;436436 unsigned long iregs, dregs;437437- char *info_type[]={437437+ static const char * const info_type[] = {438438 "Implemented AR(s)",439439 "AR(s) with read side-effects",440440 "Implemented CR(s)",
···642642 for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) {643643 data = salinfo_data + i;644644 data->type = i;645645- init_MUTEX(&data->mutex);645645+ sema_init(&data->mutex, 1);646646 dir = proc_mkdir(salinfo_log_name[i], salinfo_dir);647647 if (!dir)648648 continue;
-4
arch/ia64/kernel/setup.c
···594594 cpu_init(); /* initialize the bootstrap CPU */595595 mmu_context_init(); /* initialize context_id bitmap */596596597597-#ifdef CONFIG_ACPI598598- acpi_boot_init();599599-#endif600600-601597 paravirt_banner();602598 paravirt_arch_setup_console(cmdline_p);603599
+39
arch/ia64/kernel/stacktrace.c
···11+/*22+ * arch/ia64/kernel/stacktrace.c33+ *44+ * Stack trace management functions55+ *66+ */77+#include <linux/sched.h>88+#include <linux/stacktrace.h>99+#include <linux/module.h>1010+1111+static void1212+ia64_do_save_stack(struct unw_frame_info *info, void *arg)1313+{1414+ struct stack_trace *trace = arg;1515+ unsigned long ip;1616+ int skip = trace->skip;1717+1818+ trace->nr_entries = 0;1919+ do {2020+ unw_get_ip(info, &ip);2121+ if (ip == 0)2222+ break;2323+ if (skip == 0) {2424+ trace->entries[trace->nr_entries++] = ip;2525+ if (trace->nr_entries == trace->max_entries)2626+ break;2727+ } else2828+ skip--;2929+ } while (unw_unwind(info) >= 0);3030+}3131+3232+/*3333+ * Save stack-backtrace addresses into a stack_trace buffer.3434+ */3535+void save_stack_trace(struct stack_trace *trace)3636+{3737+ unw_init_running(ia64_do_save_stack, trace);3838+}3939+EXPORT_SYMBOL(save_stack_trace);
+19-4
arch/ia64/kernel/unwind.c
···12041204static inline unw_hash_index_t12051205hash (unsigned long ip)12061206{12071207-# define hashmagic 0x9e3779b97f4a7c16UL /* based on (sqrt(5)/2-1)*2^64 */12071207+ /* magic number = ((sqrt(5)-1)/2)*2^64 */12081208+ static const unsigned long hashmagic = 0x9e3779b97f4a7c16UL;1208120912091209- return (ip >> 4)*hashmagic >> (64 - UNW_LOG_HASH_SIZE);12101210-#undef hashmagic12101210+ return (ip >> 4) * hashmagic >> (64 - UNW_LOG_HASH_SIZE);12111211}1212121212131213static inline long···15311531 struct unw_labeled_state *ls, *next;15321532 unsigned long ip = info->ip;15331533 struct unw_state_record sr;15341534- struct unw_table *table;15341534+ struct unw_table *table, *prev;15351535 struct unw_reg_info *r;15361536 struct unw_insn insn;15371537 u8 *dp, *desc_end;···1560156015611561 STAT(parse_start = ia64_get_itc());1562156215631563+ prev = NULL;15631564 for (table = unw.tables; table; table = table->next) {15641565 if (ip >= table->start && ip < table->end) {15661566+ /*15671567+ * Leave the kernel unwind table at the very front,15681568+ * lest moving it breaks some assumption elsewhere.15691569+ * Otherwise, move the matching table to the second15701570+ * position in the list so that traversals can benefit15711571+ * from commonality in backtrace paths.15721572+ */15731573+ if (prev && prev != unw.tables) {15741574+ /* unw is safe - we're already spinlocked */15751575+ prev->next = table->next;15761576+ table->next = unw.tables->next;15771577+ unw.tables->next = table;15781578+ }15651579 e = lookup(table, ip - table->segment_base);15661580 break;15671581 }15821582+ prev = table;15681583 }15691584 if (!e) {15701585 /* no info, return default unwinder (leaf proc, no mem stack, no saved regs) */
+2-3
arch/ia64/xen/xen_pv_ops.c
···11361136static void __init11371137xen_patch_branch(unsigned long tag, unsigned long type)11381138{11391139- const unsigned long nelem =11401140- sizeof(xen_branch_target) / sizeof(xen_branch_target[0]);11411141- __paravirt_patch_apply_branch(tag, type, xen_branch_target, nelem);11391139+ __paravirt_patch_apply_branch(tag, type, xen_branch_target,11401140+ ARRAY_SIZE(xen_branch_target));11421141}
+1-1
arch/mn10300/Kconfig.debug
···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.
+20-15
arch/mn10300/kernel/signal.c
···6565 old_sigset_t mask;6666 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||6767 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||6868- __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))6868+ __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||6969+ __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||7070+ __get_user(mask, &act->sa_mask))6971 return -EFAULT;7070- __get_user(new_ka.sa.sa_flags, &act->sa_flags);7171- __get_user(mask, &act->sa_mask);7272 siginitset(&new_ka.sa.sa_mask, mask);7373 }7474···7777 if (!ret && oact) {7878 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||7979 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||8080- __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))8080+ __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||8181+ __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||8282+ __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))8183 return -EFAULT;8282- __put_user(old_ka.sa.sa_flags, &oact->sa_flags);8383- __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);8484 }85858686 return ret;···101101 struct sigcontext __user *sc, long *_d0)102102{103103 unsigned int err = 0;104104+105105+ /* Always make any pending restarted system calls return -EINTR */106106+ current_thread_info()->restart_block.fn = do_no_restart_syscall;104107105108 if (is_using_fpu(current))106109 fpu_kill_state(current);···333330 regs->d0 = sig;334331 regs->d1 = (unsigned long) &frame->sc;335332336336- set_fs(USER_DS);337337-338333 /* the tracer may want to single-step inside the handler */339334 if (test_thread_flag(TIF_SINGLESTEP))340335 ptrace_notify(SIGTRAP);···346345 return 0;347346348347give_sigsegv:349349- force_sig(SIGSEGV, current);348348+ force_sigsegv(sig, current);350349 return -EFAULT;351350}352351···414413 regs->d0 = sig;415414 regs->d1 = (long) &frame->info;416415417417- set_fs(USER_DS);418418-419416 /* the tracer may want to single-step inside the handler */420417 if (test_thread_flag(TIF_SINGLESTEP))421418 ptrace_notify(SIGTRAP);···427428 return 0;428429429430give_sigsegv:430430- force_sig(SIGSEGV, current);431431+ force_sigsegv(sig, current);431432 return -EFAULT;433433+}434434+435435+static inline void stepback(struct pt_regs *regs)436436+{437437+ regs->pc -= 2;438438+ regs->orig_d0 = -1;432439}433440434441/*···464459 /* fallthrough */465460 case -ERESTARTNOINTR:466461 regs->d0 = regs->orig_d0;467467- regs->pc -= 2;462462+ stepback(regs);468463 }469464 }470465···532527 case -ERESTARTSYS:533528 case -ERESTARTNOINTR:534529 regs->d0 = regs->orig_d0;535535- regs->pc -= 2;530530+ stepback(regs);536531 break;537532538533 case -ERESTART_RESTARTBLOCK:539534 regs->d0 = __NR_restart_syscall;540540- regs->pc -= 2;535535+ stepback(regs);541536 break;542537 }543538 }
···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+}
+13-1
arch/x86/boot/early_serial_console.c
···5858 if (arg[pos] == ',')5959 pos++;60606161- if (!strncmp(arg, "ttyS", 4)) {6161+ /*6262+ * make sure we have6363+ * "serial,0x3f8,115200"6464+ * "serial,ttyS0,115200"6565+ * "ttyS0,115200"6666+ */6767+ if (pos == 7 && !strncmp(arg + pos, "0x", 2)) {6868+ port = simple_strtoull(arg + pos, &e, 16);6969+ if (port == 0 || arg + pos == e)7070+ port = DEFAULT_SERIAL_PORT;7171+ else7272+ pos = e - arg;7373+ } else if (!strncmp(arg + pos, "ttyS", 4)) {6274 static const int bases[] = { 0x3f8, 0x2f8 };6375 int idx = 0;6476
···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)
···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",
+1-1
drivers/gpu/drm/i915/i915_gem.c
···24002400 I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0);24012401 break;24022402 case 3:24032403- if (obj_priv->fence_reg > 8)24032403+ if (obj_priv->fence_reg >= 8)24042404 fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4;24052405 else24062406 case 2:
···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}
···58585959MODULE_LICENSE("GPL");6060MODULE_VERSION(SMSC_DRV_VERSION);6161+MODULE_ALIAS("platform:smsc911x");61626263#if USE_DEBUG > 06364static int debug = 16;
+38-5
drivers/net/tulip/de2104x.c
···243243 NWayState = (1 << 14) | (1 << 13) | (1 << 12),244244 NWayRestart = (1 << 12),245245 NonselPortActive = (1 << 9),246246+ SelPortActive = (1 << 8),246247 LinkFailStatus = (1 << 2),247248 NetCxnErr = (1 << 1),248249};···364363365364/* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/366365static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, };367367-static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };366366+static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };367367+/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */368368+static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };368369static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };369370370371···10671064 unsigned int carrier;10681065 unsigned long flags;1069106610671067+ /* clear port active bits */10681068+ dw32(SIAStatus, NonselPortActive | SelPortActive);10691069+10701070 carrier = (status & NetCxnErr) ? 0 : 1;1071107110721072 if (carrier) {···11641158static void de_media_interrupt (struct de_private *de, u32 status)11651159{11661160 if (status & LinkPass) {11611161+ /* Ignore if current media is AUI or BNC and we can't use TP */11621162+ if ((de->media_type == DE_MEDIA_AUI ||11631163+ de->media_type == DE_MEDIA_BNC) &&11641164+ (de->media_lock ||11651165+ !de_ok_to_advertise(de, DE_MEDIA_TP_AUTO)))11661166+ return;11671167+ /* If current media is not TP, change it to TP */11681168+ if ((de->media_type == DE_MEDIA_AUI ||11691169+ de->media_type == DE_MEDIA_BNC)) {11701170+ de->media_type = DE_MEDIA_TP_AUTO;11711171+ de_stop_rxtx(de);11721172+ de_set_media(de);11731173+ de_start_rxtx(de);11741174+ }11671175 de_link_up(de);11681176 mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK);11691177 return;11701178 }1171117911721180 BUG_ON(!(status & LinkFail));11731173-11741174- if (netif_carrier_ok(de->dev)) {11811181+ /* Mark the link as down only if current media is TP */11821182+ if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI &&11831183+ de->media_type != DE_MEDIA_BNC) {11751184 de_link_down(de);11761185 mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);11771186 }···12501229 if (de->de21040)12511230 return;1252123112321232+ dw32(CSR13, 0); /* Reset phy */12531233 pci_read_config_dword(de->pdev, PCIPM, &pmctl);12541234 pmctl |= PM_Sleep;12551235 pci_write_config_dword(de->pdev, PCIPM, pmctl);···15961574 return 0; /* nothing to change */1597157515981576 de_link_down(de);15771577+ mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);15991578 de_stop_rxtx(de);1600157916011580 de->media_type = new_media;16021581 de->media_lock = media_lock;16031582 de->media_advertise = ecmd->advertising;16041583 de_set_media(de);15841584+ if (netif_running(de->dev))15851585+ de_start_rxtx(de);1605158616061587 return 0;16071588}···19361911 for (i = 0; i < DE_MAX_MEDIA; i++) {19371912 if (de->media[i].csr13 == 0xffff)19381913 de->media[i].csr13 = t21041_csr13[i];19391939- if (de->media[i].csr14 == 0xffff)19401940- de->media[i].csr14 = t21041_csr14[i];19141914+ if (de->media[i].csr14 == 0xffff) {19151915+ /* autonegotiation is broken at least on some chip19161916+ revisions - rev. 0x21 works, 0x11 does not */19171917+ if (de->pdev->revision < 0x20)19181918+ de->media[i].csr14 = t21041_csr14_brk[i];19191919+ else19201920+ de->media[i].csr14 = t21041_csr14[i];19211921+ }19411922 if (de->media[i].csr15 == 0xffff)19421923 de->media[i].csr15 = t21041_csr15[i];19431924 }···21892158 dev_err(&dev->dev, "pci_enable_device failed in resume\n");21902159 goto out;21912160 }21612161+ pci_set_master(pdev);21622162+ de_init_rings(de);21922163 de_init_hw(de);21932164out_attach:21942165 netif_device_attach(dev);
+5
drivers/net/wireless/iwlwifi/iwl-core.c
···26132613 if (test_bit(STATUS_EXIT_PENDING, &priv->status))26142614 return -EINVAL;2615261526162616+ if (test_bit(STATUS_SCANNING, &priv->status)) {26172617+ IWL_DEBUG_INFO(priv, "scan in progress.\n");26182618+ return -EINVAL;26192619+ }26202620+26162621 if (mode >= IWL_MAX_FORCE_RESET) {26172622 IWL_DEBUG_INFO(priv, "invalid reset request.\n");26182623 return -EINVAL;
+27
drivers/pci/intel-iommu.c
···3757375737583758DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);3759375937603760+#define GGC 0x5237613761+#define GGC_MEMORY_SIZE_MASK (0xf << 8)37623762+#define GGC_MEMORY_SIZE_NONE (0x0 << 8)37633763+#define GGC_MEMORY_SIZE_1M (0x1 << 8)37643764+#define GGC_MEMORY_SIZE_2M (0x3 << 8)37653765+#define GGC_MEMORY_VT_ENABLED (0x8 << 8)37663766+#define GGC_MEMORY_SIZE_2M_VT (0x9 << 8)37673767+#define GGC_MEMORY_SIZE_3M_VT (0xa << 8)37683768+#define GGC_MEMORY_SIZE_4M_VT (0xb << 8)37693769+37703770+static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev)37713771+{37723772+ unsigned short ggc;37733773+37743774+ if (pci_read_config_word(dev, GGC, &ggc))37753775+ return;37763776+37773777+ if (!(ggc & GGC_MEMORY_VT_ENABLED)) {37783778+ printk(KERN_INFO "DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics\n");37793779+ dmar_map_gfx = 0;37803780+ }37813781+}37823782+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt);37833783+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt);37843784+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt);37853785+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt);37863786+37603787/* On Tylersburg chipsets, some BIOSes have been known to enable the37613788 ISOCH DMAR unit for the Azalia sound device, but not give it any37623789 TLB entries, which causes it to deadlock. Check for that. We do
+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
+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 "
···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;
+2-2
drivers/video/pxa168fb.c
···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
···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);
···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) {
···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;
···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. */