···271 bool "Atmel AT91"272 select ARCH_REQUIRE_GPIOLIB273 select HAVE_CLK274- select ARCH_USES_GETTIMEOFFSET275 help276 This enables support for systems based on the Atmel AT91RM9200,277 AT91SAM9 and AT91CAP9 processors.···1049 workaround disables the write-allocate mode for the L2 cache via the1050 ACTLR register. Note that setting specific bits in the ACTLR register1051 may not be available in non-secure mode.0000000000000000000000000010521053config PL310_ERRATA_5883691054 bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
···271 bool "Atmel AT91"272 select ARCH_REQUIRE_GPIOLIB273 select HAVE_CLK0274 help275 This enables support for systems based on the Atmel AT91RM9200,276 AT91SAM9 and AT91CAP9 processors.···1050 workaround disables the write-allocate mode for the L2 cache via the1051 ACTLR register. Note that setting specific bits in the ACTLR register1052 may not be available in non-secure mode.1053+1054+config ARM_ERRATA_7422301055+ bool "ARM errata: DMB operation may be faulty"1056+ depends on CPU_V7 && SMP1057+ help1058+ This option enables the workaround for the 742230 Cortex-A91059+ (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction1060+ between two write operations may not ensure the correct visibility1061+ ordering of the two writes. This workaround sets a specific bit in1062+ the diagnostic register of the Cortex-A9 which causes the DMB1063+ instruction to behave as a DSB, ensuring the correct behaviour of1064+ the two writes.1065+1066+config ARM_ERRATA_7422311067+ bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption"1068+ depends on CPU_V7 && SMP1069+ help1070+ This option enables the workaround for the 742231 Cortex-A91071+ (r2p0..r2p2) erratum. Under certain conditions, specific to the1072+ Cortex-A9 MPCore micro-architecture, two CPUs working in SMP mode,1073+ accessing some data located in the same cache line, may get corrupted1074+ data due to bad handling of the address hazard when the line gets1075+ replaced from one of the CPUs at the same time as another CPU is1076+ accessing it. This workaround sets specific bits in the diagnostic1077+ register of the Cortex-A9 which reduces the linefill issuing1078+ capabilities of the processor.10791080config PL310_ERRATA_5883691081 bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
···273extern int gpio_get_value(unsigned gpio);274extern void gpio_set_value(unsigned gpio, int value);275000276/* wrappers to sleep-enable the previous two functions */277static inline unsigned gpio_to_irq(unsigned gpio)278{
···273extern int gpio_get_value(unsigned gpio);274extern void gpio_set_value(unsigned gpio, int value);275276+#define gpio_get_value_cansleep gpio_get_value277+#define gpio_set_value_cansleep gpio_set_value278+279/* wrappers to sleep-enable the previous two functions */280static inline unsigned gpio_to_irq(unsigned gpio)281{
+7-1
arch/arm/mach-vexpress/ct-ca9x4.c
···227 int i;228229#ifdef CONFIG_CACHE_L2X0230- l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff);000000231#endif232233 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
···227 int i;228229#ifdef CONFIG_CACHE_L2X0230+ void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC);231+232+ /* set RAM latencies to 1 cycle for this core tile. */233+ writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL);234+ writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL);235+236+ l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff);237#endif238239 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
···885886 if (ai_usermode & UM_SIGNAL)887 force_sig(SIGBUS, current);888+ else {889+ /*890+ * We're about to disable the alignment trap and return to891+ * user space. But if an interrupt occurs before actually892+ * reaching user space, then the IRQ vector entry code will893+ * notice that we were still in kernel space and therefore894+ * the alignment trap won't be re-enabled in that case as it895+ * is presumed to be always on from kernel space.896+ * Let's prevent that race by disabling interrupts here (they897+ * are disabled on the way back to user space anyway in898+ * entry-common.S) and disable the alignment trap only if899+ * there is no work pending for this thread.900+ */901+ raw_local_irq_disable();902+ if (!(current_thread_info()->flags & _TIF_WORK_MASK))903+ set_cr(cr_no_alignment);904+ }905906 return 0;907}
···186 * It is assumed that:187 * - cache type register is implemented188 */189-__v7_setup:190#ifdef CONFIG_SMP191 mrc p15, 0, r0, c1, c0, 1192 tst r0, #(1 << 6) @ SMP/nAMP mode enabled?193 orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and194 mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting195#endif0196 adr r12, __v7_setup_stack @ the local stack197 stmia r12, {r0-r5, r7, r9, r11, lr}198 bl v7_flush_dcache_all···202 mrc p15, 0, r0, c0, c0, 0 @ read main ID register203 and r10, r0, #0xff000000 @ ARM?204 teq r10, #0x41000000205- bne 2f206 and r5, r0, #0x00f00000 @ variant207 and r6, r0, #0x0000000f @ revision208- orr r0, r6, r5, lsr #20-4 @ combine variant and revision02090000210#ifdef CONFIG_ARM_ERRATA_430973211 teq r5, #0x00100000 @ only present in r1p*212 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register···219 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register220#endif221#ifdef CONFIG_ARM_ERRATA_458693222- teq r0, #0x20 @ only present in r2p0223 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register224 orreq r10, r10, #(1 << 5) @ set L1NEON to 1225 orreq r10, r10, #(1 << 9) @ set PLDNOP to 1226 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register227#endif228#ifdef CONFIG_ARM_ERRATA_460075229- teq r0, #0x20 @ only present in r2p0230 mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register231 tsteq r10, #1 << 22232 orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit233 mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register234#endif0235236-2: mov r10, #000000000000000000000237#ifdef HARVARD_CACHE238 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate239#endif···349 .align350351 .section ".proc.info.init", #alloc, #execinstr00000000000000000000000352353 /*354 * Match any ARMv7 processor core.
···186 * It is assumed that:187 * - cache type register is implemented188 */189+__v7_ca9mp_setup:190#ifdef CONFIG_SMP191 mrc p15, 0, r0, c1, c0, 1192 tst r0, #(1 << 6) @ SMP/nAMP mode enabled?193 orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and194 mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting195#endif196+__v7_setup:197 adr r12, __v7_setup_stack @ the local stack198 stmia r12, {r0-r5, r7, r9, r11, lr}199 bl v7_flush_dcache_all···201 mrc p15, 0, r0, c0, c0, 0 @ read main ID register202 and r10, r0, #0xff000000 @ ARM?203 teq r10, #0x41000000204+ bne 3f205 and r5, r0, #0x00f00000 @ variant206 and r6, r0, #0x0000000f @ revision207+ orr r6, r6, r5, lsr #20-4 @ combine variant and revision208+ ubfx r0, r0, #4, #12 @ primary part number209210+ /* Cortex-A8 Errata */211+ ldr r10, =0x00000c08 @ Cortex-A8 primary part number212+ teq r0, r10213+ bne 2f214#ifdef CONFIG_ARM_ERRATA_430973215 teq r5, #0x00100000 @ only present in r1p*216 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register···213 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register214#endif215#ifdef CONFIG_ARM_ERRATA_458693216+ teq r6, #0x20 @ only present in r2p0217 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register218 orreq r10, r10, #(1 << 5) @ set L1NEON to 1219 orreq r10, r10, #(1 << 9) @ set PLDNOP to 1220 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register221#endif222#ifdef CONFIG_ARM_ERRATA_460075223+ teq r6, #0x20 @ only present in r2p0224 mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register225 tsteq r10, #1 << 22226 orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit227 mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register228#endif229+ b 3f230231+ /* Cortex-A9 Errata */232+2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number233+ teq r0, r10234+ bne 3f235+#ifdef CONFIG_ARM_ERRATA_742230236+ cmp r6, #0x22 @ only present up to r2p2237+ mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register238+ orrle r10, r10, #1 << 4 @ set bit #4239+ mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register240+#endif241+#ifdef CONFIG_ARM_ERRATA_742231242+ teq r6, #0x20 @ present in r2p0243+ teqne r6, #0x21 @ present in r2p1244+ teqne r6, #0x22 @ present in r2p2245+ mrceq p15, 0, r10, c15, c0, 1 @ read diagnostic register246+ orreq r10, r10, #1 << 12 @ set bit #12247+ orreq r10, r10, #1 << 22 @ set bit #22248+ mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register249+#endif250+251+3: mov r10, #0252#ifdef HARVARD_CACHE253 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate254#endif···322 .align323324 .section ".proc.info.init", #alloc, #execinstr325+326+ .type __v7_ca9mp_proc_info, #object327+__v7_ca9mp_proc_info:328+ .long 0x410fc090 @ Required ID value329+ .long 0xff0ffff0 @ Mask for ID330+ .long PMD_TYPE_SECT | \331+ PMD_SECT_AP_WRITE | \332+ PMD_SECT_AP_READ | \333+ PMD_FLAGS334+ .long PMD_TYPE_SECT | \335+ PMD_SECT_XN | \336+ PMD_SECT_AP_WRITE | \337+ PMD_SECT_AP_READ338+ b __v7_ca9mp_setup339+ .long cpu_arch_name340+ .long cpu_elf_name341+ .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP342+ .long cpu_v7_name343+ .long v7_processor_functions344+ .long v7wbi_tlb_fns345+ .long v6_user_fns346+ .long v7_cache_fns347+ .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info348349 /*350 * Match any ARMv7 processor core.
+12-21
arch/arm/plat-nomadik/timer.c
···1/*2- * linux/arch/arm/mach-nomadik/timer.c3 *4 * Copyright (C) 2008 STMicroelectronics5 * Copyright (C) 2010 Alessandro Rubini···75 cr = readl(mtu_base + MTU_CR(1));76 writel(0, mtu_base + MTU_LR(1));77 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1));78- writel(0x2, mtu_base + MTU_IMSC);79 break;80 case CLOCK_EVT_MODE_SHUTDOWN:81 case CLOCK_EVT_MODE_UNUSED:···131{132 unsigned long rate;133 struct clk *clk0;134- struct clk *clk1;135- u32 cr;136137 clk0 = clk_get_sys("mtu0", NULL);138 BUG_ON(IS_ERR(clk0));139140- clk1 = clk_get_sys("mtu1", NULL);141- BUG_ON(IS_ERR(clk1));142-143 clk_enable(clk0);144- clk_enable(clk1);145146 /*147- * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500:148- * use a divide-by-16 counter if it's more than 16MHz0000149 */150- cr = MTU_CRn_32BITS;;151 rate = clk_get_rate(clk0);152- if (rate > 16 << 20) {153 rate /= 16;154 cr |= MTU_CRn_PRESCALE_16;155 } else {···168 pr_err("timer: failed to initialize clock source %s\n",169 nmdk_clksrc.name);170171- /* Timer 1 is used for events, fix according to rate */172- cr = MTU_CRn_32BITS;173- rate = clk_get_rate(clk1);174- if (rate > 16 << 20) {175- rate /= 16;176- cr |= MTU_CRn_PRESCALE_16;177- } else {178- cr |= MTU_CRn_PRESCALE_1;179- }180 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);181182 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
···1/*2+ * linux/arch/arm/plat-nomadik/timer.c3 *4 * Copyright (C) 2008 STMicroelectronics5 * Copyright (C) 2010 Alessandro Rubini···75 cr = readl(mtu_base + MTU_CR(1));76 writel(0, mtu_base + MTU_LR(1));77 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1));78+ writel(1 << 1, mtu_base + MTU_IMSC);79 break;80 case CLOCK_EVT_MODE_SHUTDOWN:81 case CLOCK_EVT_MODE_UNUSED:···131{132 unsigned long rate;133 struct clk *clk0;134+ u32 cr = MTU_CRn_32BITS;0135136 clk0 = clk_get_sys("mtu0", NULL);137 BUG_ON(IS_ERR(clk0));138000139 clk_enable(clk0);0140141 /*142+ * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz143+ * for ux500.144+ * Use a divide-by-16 counter if the tick rate is more than 32MHz.145+ * At 32 MHz, the timer (with 32 bit counter) can be programmed146+ * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer147+ * with 16 gives too low timer resolution.148 */0149 rate = clk_get_rate(clk0);150+ if (rate > 32000000) {151 rate /= 16;152 cr |= MTU_CRn_PRESCALE_16;153 } else {···170 pr_err("timer: failed to initialize clock source %s\n",171 nmdk_clksrc.name);172173+ /* Timer 1 is used for events */174+0000000175 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);176177 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
+5-20
arch/arm/plat-omap/sram.c
···220 if (omap_sram_size == 0)221 return;222223- if (cpu_is_omap24xx()) {224- omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA;225-226- base = OMAP2_SRAM_PA;227- base = ROUND_DOWN(base, PAGE_SIZE);228- omap_sram_io_desc[0].pfn = __phys_to_pfn(base);229- }230-231 if (cpu_is_omap34xx()) {232- omap_sram_io_desc[0].virtual = OMAP3_SRAM_VA;233- base = OMAP3_SRAM_PA;234- base = ROUND_DOWN(base, PAGE_SIZE);235- omap_sram_io_desc[0].pfn = __phys_to_pfn(base);236-237 /*238 * SRAM must be marked as non-cached on OMAP3 since the239 * CORE DPLL M2 divider change code (in SRAM) runs with the···231 omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED;232 }233234- if (cpu_is_omap44xx()) {235- omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA;236- base = OMAP4_SRAM_PA;237- base = ROUND_DOWN(base, PAGE_SIZE);238- omap_sram_io_desc[0].pfn = __phys_to_pfn(base);239- }240- omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */241 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));242243 printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
···220 if (omap_sram_size == 0)221 return;22200000000223 if (cpu_is_omap34xx()) {00000224 /*225 * SRAM must be marked as non-cached on OMAP3 since the226 * CORE DPLL M2 divider change code (in SRAM) runs with the···244 omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED;245 }246247+ omap_sram_io_desc[0].virtual = omap_sram_base;248+ base = omap_sram_start;249+ base = ROUND_DOWN(base, PAGE_SIZE);250+ omap_sram_io_desc[0].pfn = __phys_to_pfn(base);251+ omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE);00252 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));253254 printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
···6 * David Mosberger-Tang <davidm@hpl.hp.com>7 */89-10-#include <linux/threads.h>11-#include <linux/irq.h>12-13-#include <asm/processor.h>14-15/*16 * No irq_cpustat_t for IA-64. The data is held in the per-CPU data structure.17 */···13#define __ARCH_IRQ_STAT 11415#define local_softirq_pending() (local_cpu_data->softirq_pending)000001617extern void __iomem *ipi_base_addr;18
···6 * David Mosberger-Tang <davidm@hpl.hp.com>7 */80000009/*10 * No irq_cpustat_t for IA-64. The data is held in the per-CPU data structure.11 */···19#define __ARCH_IRQ_STAT 12021#define local_softirq_pending() (local_cpu_data->softirq_pending)22+23+#include <linux/threads.h>24+#include <linux/irq.h>25+26+#include <asm/processor.h>2728extern void __iomem *ipi_base_addr;29
···20552056 IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __func__);20572058- /*2059- * Configure the CMCI/P vector and handler. Interrupts for CMC are2060- * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c).2061- */2062- register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction);2063- register_percpu_irq(IA64_CMCP_VECTOR, &cmcp_irqaction);2064- ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */2065-2066- /* Setup the MCA rendezvous interrupt vector */2067- register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, &mca_rdzv_irqaction);2068-2069- /* Setup the MCA wakeup interrupt vector */2070- register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);2071-2072-#ifdef CONFIG_ACPI2073- /* Setup the CPEI/P handler */2074- register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);2075-#endif2076-2077 /* Initialize the areas set aside by the OS to buffer the2078 * platform/processor error states for MCA/INIT/CMC2079 * handling.···2083{2084 if (!mca_init)2085 return 0;000000000000000000020862087 register_hotcpu_notifier(&mca_cpu_notifier);2088
···20552056 IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __func__);205700000000000000000002058 /* Initialize the areas set aside by the OS to buffer the2059 * platform/processor error states for MCA/INIT/CMC2060 * handling.···2102{2103 if (!mca_init)2104 return 0;2105+2106+ /*2107+ * Configure the CMCI/P vector and handler. Interrupts for CMC are2108+ * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c).2109+ */2110+ register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction);2111+ register_percpu_irq(IA64_CMCP_VECTOR, &cmcp_irqaction);2112+ ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */2113+2114+ /* Setup the MCA rendezvous interrupt vector */2115+ register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, &mca_rdzv_irqaction);2116+2117+ /* Setup the MCA wakeup interrupt vector */2118+ register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);2119+2120+#ifdef CONFIG_ACPI2121+ /* Setup the CPEI/P handler */2122+ register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);2123+#endif21242125 register_hotcpu_notifier(&mca_cpu_notifier);2126
+1-1
arch/ia64/kernel/palinfo.c
···434 unsigned long phys_stacked;435 pal_hints_u_t hints;436 unsigned long iregs, dregs;437- char *info_type[]={438 "Implemented AR(s)",439 "AR(s) with read side-effects",440 "Implemented CR(s)",
···434 unsigned long phys_stacked;435 pal_hints_u_t hints;436 unsigned long iregs, dregs;437+ static const char * const info_type[] = {438 "Implemented AR(s)",439 "AR(s) with read side-effects",440 "Implemented CR(s)",
···642 for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) {643 data = salinfo_data + i;644 data->type = i;645- init_MUTEX(&data->mutex);646 dir = proc_mkdir(salinfo_log_name[i], salinfo_dir);647 if (!dir)648 continue;
···642 for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) {643 data = salinfo_data + i;644 data->type = i;645+ sema_init(&data->mutex, 1);646 dir = proc_mkdir(salinfo_log_name[i], salinfo_dir);647 if (!dir)648 continue;
-4
arch/ia64/kernel/setup.c
···594 cpu_init(); /* initialize the bootstrap CPU */595 mmu_context_init(); /* initialize context_id bitmap */596597-#ifdef CONFIG_ACPI598- acpi_boot_init();599-#endif600-601 paravirt_banner();602 paravirt_arch_setup_console(cmdline_p);603
···594 cpu_init(); /* initialize the bootstrap CPU */595 mmu_context_init(); /* initialize context_id bitmap */5960000597 paravirt_banner();598 paravirt_arch_setup_console(cmdline_p);599
+39
arch/ia64/kernel/stacktrace.c
···000000000000000000000000000000000000000
···1+/*2+ * arch/ia64/kernel/stacktrace.c3+ *4+ * Stack trace management functions5+ *6+ */7+#include <linux/sched.h>8+#include <linux/stacktrace.h>9+#include <linux/module.h>10+11+static void12+ia64_do_save_stack(struct unw_frame_info *info, void *arg)13+{14+ struct stack_trace *trace = arg;15+ unsigned long ip;16+ int skip = trace->skip;17+18+ trace->nr_entries = 0;19+ do {20+ unw_get_ip(info, &ip);21+ if (ip == 0)22+ break;23+ if (skip == 0) {24+ trace->entries[trace->nr_entries++] = ip;25+ if (trace->nr_entries == trace->max_entries)26+ break;27+ } else28+ skip--;29+ } while (unw_unwind(info) >= 0);30+}31+32+/*33+ * Save stack-backtrace addresses into a stack_trace buffer.34+ */35+void save_stack_trace(struct stack_trace *trace)36+{37+ unw_init_running(ia64_do_save_stack, trace);38+}39+EXPORT_SYMBOL(save_stack_trace);
+19-4
arch/ia64/kernel/unwind.c
···1204static inline unw_hash_index_t1205hash (unsigned long ip)1206{1207-# define hashmagic 0x9e3779b97f4a7c16UL /* based on (sqrt(5)/2-1)*2^64 */012081209- return (ip >> 4)*hashmagic >> (64 - UNW_LOG_HASH_SIZE);1210-#undef hashmagic1211}12121213static inline long···1531 struct unw_labeled_state *ls, *next;1532 unsigned long ip = info->ip;1533 struct unw_state_record sr;1534- struct unw_table *table;1535 struct unw_reg_info *r;1536 struct unw_insn insn;1537 u8 *dp, *desc_end;···15601561 STAT(parse_start = ia64_get_itc());156201563 for (table = unw.tables; table; table = table->next) {1564 if (ip >= table->start && ip < table->end) {00000000000001565 e = lookup(table, ip - table->segment_base);1566 break;1567 }01568 }1569 if (!e) {1570 /* no info, return default unwinder (leaf proc, no mem stack, no saved regs) */
···1204static inline unw_hash_index_t1205hash (unsigned long ip)1206{1207+ /* magic number = ((sqrt(5)-1)/2)*2^64 */1208+ static const unsigned long hashmagic = 0x9e3779b97f4a7c16UL;12091210+ return (ip >> 4) * hashmagic >> (64 - UNW_LOG_HASH_SIZE);01211}12121213static inline long···1531 struct unw_labeled_state *ls, *next;1532 unsigned long ip = info->ip;1533 struct unw_state_record sr;1534+ struct unw_table *table, *prev;1535 struct unw_reg_info *r;1536 struct unw_insn insn;1537 u8 *dp, *desc_end;···15601561 STAT(parse_start = ia64_get_itc());15621563+ prev = NULL;1564 for (table = unw.tables; table; table = table->next) {1565 if (ip >= table->start && ip < table->end) {1566+ /*1567+ * Leave the kernel unwind table at the very front,1568+ * lest moving it breaks some assumption elsewhere.1569+ * Otherwise, move the matching table to the second1570+ * position in the list so that traversals can benefit1571+ * from commonality in backtrace paths.1572+ */1573+ if (prev && prev != unw.tables) {1574+ /* unw is safe - we're already spinlocked */1575+ prev->next = table->next;1576+ table->next = unw.tables->next;1577+ unw.tables->next = table;1578+ }1579 e = lookup(table, ip - table->segment_base);1580 break;1581 }1582+ prev = table;1583 }1584 if (!e) {1585 /* no info, return default unwinder (leaf proc, no mem stack, no saved regs) */
+2-3
arch/ia64/xen/xen_pv_ops.c
···1136static void __init1137xen_patch_branch(unsigned long tag, unsigned long type)1138{1139- const unsigned long nelem =1140- sizeof(xen_branch_target) / sizeof(xen_branch_target[0]);1141- __paravirt_patch_apply_branch(tag, type, xen_branch_target, nelem);1142}
···1136static void __init1137xen_patch_branch(unsigned long tag, unsigned long type)1138{1139+ __paravirt_patch_apply_branch(tag, type, xen_branch_target,1140+ ARRAY_SIZE(xen_branch_target));01141}
+1-1
arch/mn10300/Kconfig.debug
···101102choice103 prompt "GDB stub port"104- default GDBSTUB_TTYSM0105 depends on GDBSTUB106 help107 Select the serial port used for GDB-stub.
···101102choice103 prompt "GDB stub port"104+ default GDBSTUB_ON_TTYSM0105 depends on GDBSTUB106 help107 Select the serial port used for GDB-stub.
+20-15
arch/mn10300/kernel/signal.c
···65 old_sigset_t mask;66 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||67 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||68- __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))0069 return -EFAULT;70- __get_user(new_ka.sa.sa_flags, &act->sa_flags);71- __get_user(mask, &act->sa_mask);72 siginitset(&new_ka.sa.sa_mask, mask);73 }74···77 if (!ret && oact) {78 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||79 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||80- __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))0081 return -EFAULT;82- __put_user(old_ka.sa.sa_flags, &oact->sa_flags);83- __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);84 }8586 return ret;···101 struct sigcontext __user *sc, long *_d0)102{103 unsigned int err = 0;000104105 if (is_using_fpu(current))106 fpu_kill_state(current);···333 regs->d0 = sig;334 regs->d1 = (unsigned long) &frame->sc;335336- set_fs(USER_DS);337-338 /* the tracer may want to single-step inside the handler */339 if (test_thread_flag(TIF_SINGLESTEP))340 ptrace_notify(SIGTRAP);···346 return 0;347348give_sigsegv:349- force_sig(SIGSEGV, current);350 return -EFAULT;351}352···414 regs->d0 = sig;415 regs->d1 = (long) &frame->info;416417- set_fs(USER_DS);418-419 /* the tracer may want to single-step inside the handler */420 if (test_thread_flag(TIF_SINGLESTEP))421 ptrace_notify(SIGTRAP);···427 return 0;428429give_sigsegv:430- force_sig(SIGSEGV, current);431 return -EFAULT;000000432}433434/*···464 /* fallthrough */465 case -ERESTARTNOINTR:466 regs->d0 = regs->orig_d0;467- regs->pc -= 2;468 }469 }470···532 case -ERESTARTSYS:533 case -ERESTARTNOINTR:534 regs->d0 = regs->orig_d0;535- regs->pc -= 2;536 break;537538 case -ERESTART_RESTARTBLOCK:539 regs->d0 = __NR_restart_syscall;540- regs->pc -= 2;541 break;542 }543 }
···65 old_sigset_t mask;66 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||67 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||68+ __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||69+ __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||70+ __get_user(mask, &act->sa_mask))71 return -EFAULT;0072 siginitset(&new_ka.sa.sa_mask, mask);73 }74···77 if (!ret && oact) {78 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||79 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||80+ __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||81+ __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||82+ __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))83 return -EFAULT;0084 }8586 return ret;···101 struct sigcontext __user *sc, long *_d0)102{103 unsigned int err = 0;104+105+ /* Always make any pending restarted system calls return -EINTR */106+ current_thread_info()->restart_block.fn = do_no_restart_syscall;107108 if (is_using_fpu(current))109 fpu_kill_state(current);···330 regs->d0 = sig;331 regs->d1 = (unsigned long) &frame->sc;33200333 /* the tracer may want to single-step inside the handler */334 if (test_thread_flag(TIF_SINGLESTEP))335 ptrace_notify(SIGTRAP);···345 return 0;346347give_sigsegv:348+ force_sigsegv(sig, current);349 return -EFAULT;350}351···413 regs->d0 = sig;414 regs->d1 = (long) &frame->info;41500416 /* the tracer may want to single-step inside the handler */417 if (test_thread_flag(TIF_SINGLESTEP))418 ptrace_notify(SIGTRAP);···428 return 0;429430give_sigsegv:431+ force_sigsegv(sig, current);432 return -EFAULT;433+}434+435+static inline void stepback(struct pt_regs *regs)436+{437+ regs->pc -= 2;438+ regs->orig_d0 = -1;439}440441/*···459 /* fallthrough */460 case -ERESTARTNOINTR:461 regs->d0 = regs->orig_d0;462+ stepback(regs);463 }464 }465···527 case -ERESTARTSYS:528 case -ERESTARTNOINTR:529 regs->d0 = regs->orig_d0;530+ stepback(regs);531 break;532533 case -ERESTART_RESTARTBLOCK:534 regs->d0 = __NR_restart_syscall;535+ stepback(regs);536 break;537 }538 }
···1+/* Handle the cache being disabled2+ *3+ * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.4+ * Written by David Howells (dhowells@redhat.com)5+ *6+ * This program is free software; you can redistribute it and/or7+ * modify it under the terms of the GNU General Public Licence8+ * as published by the Free Software Foundation; either version9+ * 2 of the Licence, or (at your option) any later version.10+ */11+#include <linux/mm.h>12+13+/*14+ * allow userspace to flush the instruction cache15+ */16+asmlinkage long sys_cacheflush(unsigned long start, unsigned long end)17+{18+ if (end < start)19+ return -EINVAL;20+ return 0;21+}
+13-1
arch/x86/boot/early_serial_console.c
···58 if (arg[pos] == ',')59 pos++;6061- if (!strncmp(arg, "ttyS", 4)) {00000000000062 static const int bases[] = { 0x3f8, 0x2f8 };63 int idx = 0;64
···58 if (arg[pos] == ',')59 pos++;6061+ /*62+ * make sure we have63+ * "serial,0x3f8,115200"64+ * "serial,ttyS0,115200"65+ * "ttyS0,115200"66+ */67+ if (pos == 7 && !strncmp(arg + pos, "0x", 2)) {68+ port = simple_strtoull(arg + pos, &e, 16);69+ if (port == 0 || arg + pos == e)70+ port = DEFAULT_SERIAL_PORT;71+ else72+ pos = e - arg;73+ } else if (!strncmp(arg + pos, "ttyS", 4)) {74 static const int bases[] = { 0x3f8, 0x2f8 };75 int idx = 0;76
···368 /* capabilities of that IOMMU read from ACPI */369 u32 cap;370000371 /*372 * Capability pointer. There could be more than one IOMMU per PCI373 * device function if there are more than one AMD IOMMU capability···414415 /* default dma_ops domain for that IOMMU */416 struct dma_ops_domain *default_dom;000000000417};418419/*
···368 /* capabilities of that IOMMU read from ACPI */369 u32 cap;370371+ /* flags read from acpi table */372+ u8 acpi_flags;373+374 /*375 * Capability pointer. There could be more than one IOMMU per PCI376 * device function if there are more than one AMD IOMMU capability···411412 /* default dma_ops domain for that IOMMU */413 struct dma_ops_domain *default_dom;414+415+ /*416+ * This array is required to work around a potential BIOS bug.417+ * The BIOS may miss to restore parts of the PCI configuration418+ * space when the system resumes from S3. The result is that the419+ * IOMMU does not execute commands anymore which leads to system420+ * failure.421+ */422+ u32 cache_cfg[4];423};424425/*
+1-1
arch/x86/include/asm/bitops.h
···309static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)310{311 return ((1UL << (nr % BITS_PER_LONG)) &312- (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;313}314315static inline int variable_test_bit(int nr, volatile const unsigned long *addr)
···309static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)310{311 return ((1UL << (nr % BITS_PER_LONG)) &312+ (addr[nr / BITS_PER_LONG])) != 0;313}314315static inline int variable_test_bit(int nr, volatile const unsigned long *addr)
···339{340 int status;341000342 status = cancel_delayed_work(&mci->work);343 if (status == 0) {344 debugf0("%s() not canceled, flush the queue\n",
···339{340 int status;341342+ if (mci->op_state != OP_RUNNING_POLL)343+ return;344+345 status = cancel_delayed_work(&mci->work);346 if (status == 0) {347 debugf0("%s() not canceled, flush the queue\n",
+1-1
drivers/gpu/drm/i915/i915_gem.c
···2400 I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0);2401 break;2402 case 3:2403- if (obj_priv->fence_reg > 8)2404 fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4;2405 else2406 case 2:
···2400 I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0);2401 break;2402 case 3:2403+ if (obj_priv->fence_reg >= 8)2404 fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4;2405 else2406 case 2:
···2704 u32 psrctl = 0;2705 u32 pages = 0;27062707+ /* Workaround Si errata on 82579 - configure jumbo frame flow */2708+ if (hw->mac.type == e1000_pch2lan) {2709+ s32 ret_val;2710+2711+ if (adapter->netdev->mtu > ETH_DATA_LEN)2712+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);2713+ else2714+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);2715+ }2716+2717 /* Program MC offset vector base */2718 rctl = er32(RCTL);2719 rctl &= ~(3 << E1000_RCTL_MO_SHIFT);···2742 e1e_wphy(hw, 0x10, 0x2823);2743 e1e_wphy(hw, 0x11, 0x0003);2744 e1e_wphy(hw, 22, phy_data);00000000002745 }27462747 /* Setup buffer sizes */···4830 if ((new_mtu < ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) ||4831 (max_frame > adapter->max_hw_frame_size)) {4832 e_err("Unsupported MTU setting\n");4833+ return -EINVAL;4834+ }4835+4836+ /* Jumbo frame workaround on 82579 requires CRC be stripped */4837+ if ((adapter->hw.mac.type == e1000_pch2lan) &&4838+ !(adapter->flags2 & FLAG2_CRC_STRIPPING) &&4839+ (new_mtu > ETH_DATA_LEN)) {4840+ e_err("Jumbo Frames not supported on 82579 when CRC "4841+ "stripping is disabled.\n");4842 return -EINVAL;4843 }4844
+2-2
drivers/net/ibm_newemac/core.c
···2928 if (dev->emac_irq != NO_IRQ)2929 irq_dispose_mapping(dev->emac_irq);2930 err_free:2931- kfree(ndev);2932 err_gone:2933 /* if we were on the bootlist, remove us as we won't show up and2934 * wake up all waiters to notify them in case they were waiting···2971 if (dev->emac_irq != NO_IRQ)2972 irq_dispose_mapping(dev->emac_irq);29732974- kfree(dev->ndev);29752976 return 0;2977}
···2928 if (dev->emac_irq != NO_IRQ)2929 irq_dispose_mapping(dev->emac_irq);2930 err_free:2931+ free_netdev(ndev);2932 err_gone:2933 /* if we were on the bootlist, remove us as we won't show up and2934 * wake up all waiters to notify them in case they were waiting···2971 if (dev->emac_irq != NO_IRQ)2972 irq_dispose_mapping(dev->emac_irq);29732974+ free_netdev(dev->ndev);29752976 return 0;2977}
···243 NWayState = (1 << 14) | (1 << 13) | (1 << 12),244 NWayRestart = (1 << 12),245 NonselPortActive = (1 << 9),246+ SelPortActive = (1 << 8),247 LinkFailStatus = (1 << 2),248 NetCxnErr = (1 << 1),249};···363364/* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/365static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, };366+static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };367+/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */368+static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };369static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };370371···1064 unsigned int carrier;1065 unsigned long flags;10661067+ /* clear port active bits */1068+ dw32(SIAStatus, NonselPortActive | SelPortActive);1069+1070 carrier = (status & NetCxnErr) ? 0 : 1;10711072 if (carrier) {···1158static void de_media_interrupt (struct de_private *de, u32 status)1159{1160 if (status & LinkPass) {1161+ /* Ignore if current media is AUI or BNC and we can't use TP */1162+ if ((de->media_type == DE_MEDIA_AUI ||1163+ de->media_type == DE_MEDIA_BNC) &&1164+ (de->media_lock ||1165+ !de_ok_to_advertise(de, DE_MEDIA_TP_AUTO)))1166+ return;1167+ /* If current media is not TP, change it to TP */1168+ if ((de->media_type == DE_MEDIA_AUI ||1169+ de->media_type == DE_MEDIA_BNC)) {1170+ de->media_type = DE_MEDIA_TP_AUTO;1171+ de_stop_rxtx(de);1172+ de_set_media(de);1173+ de_start_rxtx(de);1174+ }1175 de_link_up(de);1176 mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK);1177 return;1178 }11791180 BUG_ON(!(status & LinkFail));1181+ /* Mark the link as down only if current media is TP */1182+ if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI &&1183+ de->media_type != DE_MEDIA_BNC) {1184 de_link_down(de);1185 mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);1186 }···1229 if (de->de21040)1230 return;12311232+ dw32(CSR13, 0); /* Reset phy */1233 pci_read_config_dword(de->pdev, PCIPM, &pmctl);1234 pmctl |= PM_Sleep;1235 pci_write_config_dword(de->pdev, PCIPM, pmctl);···1574 return 0; /* nothing to change */15751576 de_link_down(de);1577+ mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);1578 de_stop_rxtx(de);15791580 de->media_type = new_media;1581 de->media_lock = media_lock;1582 de->media_advertise = ecmd->advertising;1583 de_set_media(de);1584+ if (netif_running(de->dev))1585+ de_start_rxtx(de);15861587 return 0;1588}···1911 for (i = 0; i < DE_MAX_MEDIA; i++) {1912 if (de->media[i].csr13 == 0xffff)1913 de->media[i].csr13 = t21041_csr13[i];1914+ if (de->media[i].csr14 == 0xffff) {1915+ /* autonegotiation is broken at least on some chip1916+ revisions - rev. 0x21 works, 0x11 does not */1917+ if (de->pdev->revision < 0x20)1918+ de->media[i].csr14 = t21041_csr14_brk[i];1919+ else1920+ de->media[i].csr14 = t21041_csr14[i];1921+ }1922 if (de->media[i].csr15 == 0xffff)1923 de->media[i].csr15 = t21041_csr15[i];1924 }···2158 dev_err(&dev->dev, "pci_enable_device failed in resume\n");2159 goto out;2160 }2161+ pci_set_master(pdev);2162+ de_init_rings(de);2163 de_init_hw(de);2164out_attach:2165 netif_device_attach(dev);
+5
drivers/net/wireless/iwlwifi/iwl-core.c
···2613 if (test_bit(STATUS_EXIT_PENDING, &priv->status))2614 return -EINVAL;2615000002616 if (mode >= IWL_MAX_FORCE_RESET) {2617 IWL_DEBUG_INFO(priv, "invalid reset request.\n");2618 return -EINVAL;
···2613 if (test_bit(STATUS_EXIT_PENDING, &priv->status))2614 return -EINVAL;26152616+ if (test_bit(STATUS_SCANNING, &priv->status)) {2617+ IWL_DEBUG_INFO(priv, "scan in progress.\n");2618+ return -EINVAL;2619+ }2620+2621 if (mode >= IWL_MAX_FORCE_RESET) {2622 IWL_DEBUG_INFO(priv, "invalid reset request.\n");2623 return -EINVAL;
+27
drivers/pci/intel-iommu.c
···37573758DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);37590000000000000000000000000003760/* On Tylersburg chipsets, some BIOSes have been known to enable the3761 ISOCH DMAR unit for the Azalia sound device, but not give it any3762 TLB entries, which causes it to deadlock. Check for that. We do
···37573758DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);37593760+#define GGC 0x523761+#define GGC_MEMORY_SIZE_MASK (0xf << 8)3762+#define GGC_MEMORY_SIZE_NONE (0x0 << 8)3763+#define GGC_MEMORY_SIZE_1M (0x1 << 8)3764+#define GGC_MEMORY_SIZE_2M (0x3 << 8)3765+#define GGC_MEMORY_VT_ENABLED (0x8 << 8)3766+#define GGC_MEMORY_SIZE_2M_VT (0x9 << 8)3767+#define GGC_MEMORY_SIZE_3M_VT (0xa << 8)3768+#define GGC_MEMORY_SIZE_4M_VT (0xb << 8)3769+3770+static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev)3771+{3772+ unsigned short ggc;3773+3774+ if (pci_read_config_word(dev, GGC, &ggc))3775+ return;3776+3777+ if (!(ggc & GGC_MEMORY_VT_ENABLED)) {3778+ printk(KERN_INFO "DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics\n");3779+ dmar_map_gfx = 0;3780+ }3781+}3782+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt);3783+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt);3784+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt);3785+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt);3786+3787/* On Tylersburg chipsets, some BIOSes have been known to enable the3788 ISOCH DMAR unit for the Azalia sound device, but not give it any3789 TLB entries, which causes it to deadlock. Check for that. We do
+1-1
drivers/pci/iov.c
···608 * the VF BAR size multiplied by the number of VFs. The alignment609 * is just the VF BAR size.610 */611-int pci_sriov_resource_alignment(struct pci_dev *dev, int resno)612{613 struct resource tmp;614 enum pci_bar_type type;
···608 * the VF BAR size multiplied by the number of VFs. The alignment609 * is just the VF BAR size.610 */611+resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)612{613 struct resource tmp;614 enum pci_bar_type type;
+3-2
drivers/pci/pci.h
···264extern void pci_iov_release(struct pci_dev *dev);265extern int pci_iov_resource_bar(struct pci_dev *dev, int resno,266 enum pci_bar_type *type);267-extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno);0268extern void pci_restore_iov_state(struct pci_dev *dev);269extern int pci_iov_bus_range(struct pci_bus *bus);270···321}322#endif /* CONFIG_PCI_IOV */323324-static inline int pci_resource_alignment(struct pci_dev *dev,325 struct resource *res)326{327#ifdef CONFIG_PCI_IOV
···264extern void pci_iov_release(struct pci_dev *dev);265extern int pci_iov_resource_bar(struct pci_dev *dev, int resno,266 enum pci_bar_type *type);267+extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev,268+ int resno);269extern void pci_restore_iov_state(struct pci_dev *dev);270extern int pci_iov_bus_range(struct pci_bus *bus);271···320}321#endif /* CONFIG_PCI_IOV */322323+static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,324 struct resource *res)325{326#ifdef CONFIG_PCI_IOV
+6
drivers/pcmcia/pcmcia_resource.c
···595 if (c->io[1].end) {596 ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);597 if (ret) {00598 release_io_space(s, &c->io[0]);0000599 goto out;600 }601 } else
···595 if (c->io[1].end) {596 ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);597 if (ret) {598+ struct resource tmp = c->io[0];599+ /* release the previously allocated resource */600 release_io_space(s, &c->io[0]);601+ /* but preserve the settings, for they worked... */602+ c->io[0].end = resource_size(&tmp);603+ c->io[0].start = tmp.start;604+ c->io[0].flags = tmp.flags;605 goto out;606 }607 } else
+1-1
drivers/pcmcia/pd6729.c
···646 if (!pci_resource_start(dev, 0)) {647 dev_warn(&dev->dev, "refusing to load the driver as the "648 "io_base is NULL.\n");649- goto err_out_free_mem;650 }651652 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
···646 if (!pci_resource_start(dev, 0)) {647 dev_warn(&dev->dev, "refusing to load the driver as the "648 "io_base is NULL.\n");649+ goto err_out_disable;650 }651652 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
···2017 struct ioc3_port *port;2018 struct ioc3_port *ports[PORTS_PER_CARD];2019 int phys_port;020202021 DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __func__, is, idd));2022···21472148 /* error exits that give back resources */2149out4:0002150 kfree(card_ptr);2151 return ret;2152}
···2017 struct ioc3_port *port;2018 struct ioc3_port *ports[PORTS_PER_CARD];2019 int phys_port;2020+ int cnt;20212022 DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __func__, is, idd));2023···21462147 /* error exits that give back resources */2148out4:2149+ for (cnt = 0; cnt < phys_port; cnt++)2150+ kfree(ports[cnt]);2151+2152 kfree(card_ptr);2153 return ret;2154}
+1-1
drivers/vhost/net.c
···243 int r, nlogs = 0;244245 while (datalen > 0) {246- if (unlikely(headcount >= VHOST_NET_MAX_SG)) {247 r = -ENOBUFS;248 goto err;249 }
···243 int r, nlogs = 0;244245 while (datalen > 0) {246+ if (unlikely(seg >= VHOST_NET_MAX_SG)) {247 r = -ENOBUFS;248 goto err;249 }
+4-3
drivers/vhost/vhost.c
···858 if (r < 0)859 return r;860 len -= l;861- if (!len)00862 return 0;0863 }864- if (vq->log_ctx)865- eventfd_signal(vq->log_ctx, 1);866 /* Length written exceeds what we have stored. This is a bug. */867 BUG();868 return 0;
···858 if (r < 0)859 return r;860 len -= l;861+ if (!len) {862+ if (vq->log_ctx)863+ eventfd_signal(vq->log_ctx, 1);864 return 0;865+ }866 }00867 /* Length written exceeds what we have stored. This is a bug. */868 BUG();869 return 0;
+2-2
drivers/video/pxa168fb.c
···298 * Set bit to enable graphics DMA.299 */300 x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0);301- x |= fbi->active ? 0x00000100 : 0;302- fbi->active = 0;303304 /*305 * If we are in a pseudo-color mode, we need to enable
···298 * Set bit to enable graphics DMA.299 */300 x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0);301+ x &= ~CFG_GRA_ENA_MASK;302+ x |= fbi->active ? CFG_GRA_ENA(1) : CFG_GRA_ENA(0);303304 /*305 * If we are in a pseudo-color mode, we need to enable
···322 int offset, 323 unsigned int len, __wsum *csump);324325-extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,328 int offset, int len);
···322 int offset, 323 unsigned int len, __wsum *csump);324325+extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,328 int offset, int len);
+1
include/net/addrconf.h
···121 * IPv6 Address Label subsystem (addrlabel.c)122 */123extern int ipv6_addr_label_init(void);0124extern void ipv6_addr_label_rtnl_register(void);125extern u32 ipv6_addr_label(struct net *net,126 const struct in6_addr *addr,
···35 * in any case.36 */3738-int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)39{40- int size, err, ct;04142 if (m->msg_namelen) {43 if (mode == VERIFY_READ) {
···35 * in any case.36 */3738+long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)39{40+ int size, ct;41+ long err;4243 if (m->msg_namelen) {44 if (mode == VERIFY_READ) {
···488 * we can switch to copy when see the first bad fragment.489 */490 if (skb_has_frags(skb)) {491- struct sk_buff *frag;492 int first_len = skb_pagelen(skb);493- int truesizes = 0;494495 if (first_len - hlen > mtu ||496 ((first_len - hlen) & 7) ||···502 if (frag->len > mtu ||503 ((frag->len & 7) && frag->next) ||504 skb_headroom(frag) < hlen)505- goto slow_path;506507 /* Partially cloned skb? */508 if (skb_shared(frag))509- goto slow_path;510511 BUG_ON(frag->sk);512 if (skb->sk) {513 frag->sk = skb->sk;514 frag->destructor = sock_wfree;515 }516- truesizes += frag->truesize;517 }518519 /* Everything is OK. Generate! */···523 frag = skb_shinfo(skb)->frag_list;524 skb_frag_list_init(skb);525 skb->data_len = first_len - skb_headlen(skb);526- skb->truesize -= truesizes;527 skb->len = first_len;528 iph->tot_len = htons(first_len);529 iph->frag_off = htons(IP_MF);···574 }575 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);576 return err;000000000577 }578579slow_path:
···488 * we can switch to copy when see the first bad fragment.489 */490 if (skb_has_frags(skb)) {491+ struct sk_buff *frag, *frag2;492 int first_len = skb_pagelen(skb);0493494 if (first_len - hlen > mtu ||495 ((first_len - hlen) & 7) ||···503 if (frag->len > mtu ||504 ((frag->len & 7) && frag->next) ||505 skb_headroom(frag) < hlen)506+ goto slow_path_clean;507508 /* Partially cloned skb? */509 if (skb_shared(frag))510+ goto slow_path_clean;511512 BUG_ON(frag->sk);513 if (skb->sk) {514 frag->sk = skb->sk;515 frag->destructor = sock_wfree;516 }517+ skb->truesize -= frag->truesize;518 }519520 /* Everything is OK. Generate! */···524 frag = skb_shinfo(skb)->frag_list;525 skb_frag_list_init(skb);526 skb->data_len = first_len - skb_headlen(skb);0527 skb->len = first_len;528 iph->tot_len = htons(first_len);529 iph->frag_off = htons(IP_MF);···576 }577 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);578 return err;579+580+slow_path_clean:581+ skb_walk_frags(skb, frag2) {582+ if (frag2 == frag)583+ break;584+ frag2->sk = NULL;585+ frag2->destructor = NULL;586+ skb->truesize += frag2->truesize;587+ }588 }589590slow_path:
+1
net/ipv4/netfilter/ipt_REJECT.c
···112 /* ip_route_me_harder expects skb->dst to be set */113 skb_dst_set_noref(nskb, skb_dst(oldskb));1140115 if (ip_route_me_harder(nskb, addr_type))116 goto free_nskb;117
···112 /* ip_route_me_harder expects skb->dst to be set */113 skb_dst_set_noref(nskb, skb_dst(oldskb));114115+ nskb->protocol = htons(ETH_P_IP);116 if (ip_route_me_harder(nskb, addr_type))117 goto free_nskb;118
···689690/********** Function prototypes. **********/691692-extern asmlinkage long sys_getpid(void);693-extern asmlinkage long sys_getppid(void);694-695/* Check whether the given string starts with the given keyword. */696bool tomoyo_str_starts(char **src, const char *find);697/* Get tomoyo_realpath() of current process. */
···689690/********** Function prototypes. **********/691000692/* Check whether the given string starts with the given keyword. */693bool tomoyo_str_starts(char **src, const char *find);694/* Get tomoyo_realpath() of current process. */