Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts:
Documentation/devicetree/bindings/net/micrel-ks8851.txt
net/core/netpoll.c

The net/core/netpoll.c conflict is a bug fix in 'net' happening
to code which is completely removed in 'net-next'.

In micrel-ks8851.txt we simply have overlapping changes.

Signed-off-by: David S. Miller <davem@davemloft.net>

+973 -786
+3
Documentation/devicetree/bindings/net/micrel-ks8851.txt
··· 4 4 - compatible = "micrel,ks8851-ml" of parallel interface 5 5 - reg : 2 physical address and size of registers for data and command 6 6 - interrupts : interrupt connection 7 + 8 + Optional properties: 9 + - vdd-supply: supply for Ethernet mac
+3 -2
MAINTAINERS
··· 918 918 F: arch/arm/mach-footbridge/ 919 919 920 920 ARM/FREESCALE IMX / MXC ARM ARCHITECTURE 921 - M: Shawn Guo <shawn.guo@linaro.org> 921 + M: Shawn Guo <shawn.guo@freescale.com> 922 922 M: Sascha Hauer <kernel@pengutronix.de> 923 923 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 924 924 S: Maintained 925 - T: git git://git.linaro.org/people/shawnguo/linux-2.6.git 925 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git 926 926 F: arch/arm/mach-imx/ 927 927 F: arch/arm/boot/dts/imx* 928 928 F: arch/arm/configs/imx*_defconfig ··· 4558 4558 M: Alex Duyck <alexander.h.duyck@intel.com> 4559 4559 M: John Ronciak <john.ronciak@intel.com> 4560 4560 M: Mitch Williams <mitch.a.williams@intel.com> 4561 + M: Linux NICS <linux.nics@intel.com> 4561 4562 L: e1000-devel@lists.sourceforge.net 4562 4563 W: http://www.intel.com/support/feedback.htm 4563 4564 W: http://e1000.sourceforge.net/
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 14 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc6 4 + EXTRAVERSION = -rc8 5 5 NAME = Shuffling Zombie Juror 6 6 7 7 # *DOCUMENTATION*
+1 -1
arch/arm/boot/dts/sama5d36.dtsi
··· 8 8 */ 9 9 #include "sama5d3.dtsi" 10 10 #include "sama5d3_can.dtsi" 11 - #include "sama5d3_emac.dtsi" 12 11 #include "sama5d3_gmac.dtsi" 12 + #include "sama5d3_emac.dtsi" 13 13 #include "sama5d3_lcd.dtsi" 14 14 #include "sama5d3_mci2.dtsi" 15 15 #include "sama5d3_tcb1.dtsi"
+15 -9
arch/mips/Kconfig
··· 1776 1776 1777 1777 config FORCE_MAX_ZONEORDER 1778 1778 int "Maximum zone order" 1779 - range 14 64 if HUGETLB_PAGE && PAGE_SIZE_64KB 1780 - default "14" if HUGETLB_PAGE && PAGE_SIZE_64KB 1781 - range 13 64 if HUGETLB_PAGE && PAGE_SIZE_32KB 1782 - default "13" if HUGETLB_PAGE && PAGE_SIZE_32KB 1783 - range 12 64 if HUGETLB_PAGE && PAGE_SIZE_16KB 1784 - default "12" if HUGETLB_PAGE && PAGE_SIZE_16KB 1779 + range 14 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_64KB 1780 + default "14" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_64KB 1781 + range 13 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_32KB 1782 + default "13" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_32KB 1783 + range 12 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB 1784 + default "12" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB 1785 1785 range 11 64 1786 1786 default "11" 1787 1787 help ··· 2353 2353 If unsure, say Y. Only embedded should say N here. 2354 2354 2355 2355 config MIPS_O32_FP64_SUPPORT 2356 - bool "Support for O32 binaries using 64-bit FP" 2356 + bool "Support for O32 binaries using 64-bit FP (EXPERIMENTAL)" 2357 2357 depends on 32BIT || MIPS32_O32 2358 - default y 2359 2358 help 2360 2359 When this is enabled, the kernel will support use of 64-bit floating 2361 2360 point registers with binaries using the O32 ABI along with the ··· 2366 2367 of your kernel & potentially improve FP emulation performance by 2367 2368 saying N here. 2368 2369 2369 - If unsure, say Y. 2370 + Although binutils currently supports use of this flag the details 2371 + concerning its effect upon the O32 ABI in userland are still being 2372 + worked on. In order to avoid userland becoming dependant upon current 2373 + behaviour before the details have been finalised, this option should 2374 + be considered experimental and only enabled by those working upon 2375 + said details. 2376 + 2377 + If unsure, say N. 2370 2378 2371 2379 config USE_OF 2372 2380 bool
+1 -3
arch/mips/alchemy/board-gpr.c
··· 53 53 prom_init_cmdline(); 54 54 55 55 memsize_str = prom_getenv("memsize"); 56 - if (!memsize_str) 56 + if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 57 57 memsize = 0x04000000; 58 - else 59 - strict_strtoul(memsize_str, 0, &memsize); 60 58 add_memory_region(0, memsize, BOOT_MEM_RAM); 61 59 } 62 60
+1 -3
arch/mips/alchemy/board-mtx1.c
··· 52 52 prom_init_cmdline(); 53 53 54 54 memsize_str = prom_getenv("memsize"); 55 - if (!memsize_str) 55 + if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) 56 56 memsize = 0x04000000; 57 - else 58 - strict_strtoul(memsize_str, 0, &memsize); 59 57 add_memory_region(0, memsize, BOOT_MEM_RAM); 60 58 } 61 59
+1
arch/mips/bcm47xx/board.c
··· 1 + #include <linux/errno.h> 1 2 #include <linux/export.h> 2 3 #include <linux/string.h> 3 4 #include <bcm47xx_board.h>
+1 -1
arch/mips/bcm47xx/nvram.c
··· 196 196 char nvram_var[10]; 197 197 char buf[30]; 198 198 199 - for (i = 0; i < 16; i++) { 199 + for (i = 0; i < 32; i++) { 200 200 err = snprintf(nvram_var, sizeof(nvram_var), "gpio%i", i); 201 201 if (err <= 0) 202 202 continue;
+12 -10
arch/mips/cavium-octeon/octeon-irq.c
··· 975 975 if (ciu > 1 || bit > 63) 976 976 return -EINVAL; 977 977 978 - /* These are the GPIO lines */ 979 - if (ciu == 0 && bit >= 16 && bit < 32) 980 - return -EINVAL; 981 - 982 978 *out_hwirq = (ciu << 6) | bit; 983 979 *out_type = 0; 984 980 ··· 1002 1006 1003 1007 if (!octeon_irq_virq_in_range(virq)) 1004 1008 return -EINVAL; 1009 + 1010 + /* Don't map irq if it is reserved for GPIO. */ 1011 + if (line == 0 && bit >= 16 && bit <32) 1012 + return 0; 1005 1013 1006 1014 if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0) 1007 1015 return -EINVAL; ··· 1525 1525 ciu = intspec[0]; 1526 1526 bit = intspec[1]; 1527 1527 1528 - /* Line 7 are the GPIO lines */ 1529 - if (ciu > 6 || bit > 63) 1530 - return -EINVAL; 1531 - 1532 1528 *out_hwirq = (ciu << 6) | bit; 1533 1529 *out_type = 0; 1534 1530 ··· 1566 1570 if (!octeon_irq_virq_in_range(virq)) 1567 1571 return -EINVAL; 1568 1572 1569 - /* Line 7 are the GPIO lines */ 1570 - if (line > 6 || octeon_irq_ciu_to_irq[line][bit] != 0) 1573 + /* 1574 + * Don't map irq if it is reserved for GPIO. 1575 + * (Line 7 are the GPIO lines.) 1576 + */ 1577 + if (line == 7) 1578 + return 0; 1579 + 1580 + if (line > 7 || octeon_irq_ciu_to_irq[line][bit] != 0) 1571 1581 return -EINVAL; 1572 1582 1573 1583 if (octeon_irq_ciu2_is_edge(line, bit))
+13 -2
arch/mips/include/asm/asmmacro.h
··· 9 9 #define _ASM_ASMMACRO_H 10 10 11 11 #include <asm/hazards.h> 12 + #include <asm/asm-offsets.h> 12 13 13 14 #ifdef CONFIG_32BIT 14 15 #include <asm/asmmacro-32.h> ··· 55 54 .endm 56 55 57 56 .macro local_irq_disable reg=t0 57 + #ifdef CONFIG_PREEMPT 58 + lw \reg, TI_PRE_COUNT($28) 59 + addi \reg, \reg, 1 60 + sw \reg, TI_PRE_COUNT($28) 61 + #endif 58 62 mfc0 \reg, CP0_STATUS 59 63 ori \reg, \reg, 1 60 64 xori \reg, \reg, 1 61 65 mtc0 \reg, CP0_STATUS 62 66 irq_disable_hazard 67 + #ifdef CONFIG_PREEMPT 68 + lw \reg, TI_PRE_COUNT($28) 69 + addi \reg, \reg, -1 70 + sw \reg, TI_PRE_COUNT($28) 71 + #endif 63 72 .endm 64 73 #endif /* CONFIG_MIPS_MT_SMTC */ 65 74 ··· 117 106 .endm 118 107 119 108 .macro fpu_save_double thread status tmp 120 - #if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2) 109 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) 121 110 sll \tmp, \status, 5 122 111 bgez \tmp, 10f 123 112 fpu_save_16odd \thread ··· 170 159 .endm 171 160 172 161 .macro fpu_restore_double thread status tmp 173 - #if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2) 162 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) 174 163 sll \tmp, \status, 5 175 164 bgez \tmp, 10f # 16 register mode? 176 165
+1 -1
arch/mips/include/asm/fpu.h
··· 57 57 return 0; 58 58 59 59 case FPU_64BIT: 60 - #if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_MIPS64)) 60 + #if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_64BIT)) 61 61 /* we only have a 32-bit FPU */ 62 62 return SIGFPE; 63 63 #endif
+10 -10
arch/mips/include/asm/ftrace.h
··· 22 22 #define safe_load(load, src, dst, error) \ 23 23 do { \ 24 24 asm volatile ( \ 25 - "1: " load " %[" STR(dst) "], 0(%[" STR(src) "])\n"\ 26 - " li %[" STR(error) "], 0\n" \ 25 + "1: " load " %[tmp_dst], 0(%[tmp_src])\n" \ 26 + " li %[tmp_err], 0\n" \ 27 27 "2:\n" \ 28 28 \ 29 29 ".section .fixup, \"ax\"\n" \ 30 - "3: li %[" STR(error) "], 1\n" \ 30 + "3: li %[tmp_err], 1\n" \ 31 31 " j 2b\n" \ 32 32 ".previous\n" \ 33 33 \ ··· 35 35 STR(PTR) "\t1b, 3b\n\t" \ 36 36 ".previous\n" \ 37 37 \ 38 - : [dst] "=&r" (dst), [error] "=r" (error)\ 39 - : [src] "r" (src) \ 38 + : [tmp_dst] "=&r" (dst), [tmp_err] "=r" (error)\ 39 + : [tmp_src] "r" (src) \ 40 40 : "memory" \ 41 41 ); \ 42 42 } while (0) ··· 44 44 #define safe_store(store, src, dst, error) \ 45 45 do { \ 46 46 asm volatile ( \ 47 - "1: " store " %[" STR(src) "], 0(%[" STR(dst) "])\n"\ 48 - " li %[" STR(error) "], 0\n" \ 47 + "1: " store " %[tmp_src], 0(%[tmp_dst])\n"\ 48 + " li %[tmp_err], 0\n" \ 49 49 "2:\n" \ 50 50 \ 51 51 ".section .fixup, \"ax\"\n" \ 52 - "3: li %[" STR(error) "], 1\n" \ 52 + "3: li %[tmp_err], 1\n" \ 53 53 " j 2b\n" \ 54 54 ".previous\n" \ 55 55 \ ··· 57 57 STR(PTR) "\t1b, 3b\n\t" \ 58 58 ".previous\n" \ 59 59 \ 60 - : [error] "=r" (error) \ 61 - : [dst] "r" (dst), [src] "r" (src)\ 60 + : [tmp_err] "=r" (error) \ 61 + : [tmp_dst] "r" (dst), [tmp_src] "r" (src)\ 62 62 : "memory" \ 63 63 ); \ 64 64 } while (0)
+6 -4
arch/mips/include/asm/syscall.h
··· 13 13 #ifndef __ASM_MIPS_SYSCALL_H 14 14 #define __ASM_MIPS_SYSCALL_H 15 15 16 + #include <linux/compiler.h> 16 17 #include <linux/audit.h> 17 18 #include <linux/elf-em.h> 18 19 #include <linux/kernel.h> ··· 40 39 41 40 #ifdef CONFIG_32BIT 42 41 case 4: case 5: case 6: case 7: 43 - return get_user(*arg, (int *)usp + 4 * n); 42 + return get_user(*arg, (int *)usp + n); 44 43 #endif 45 44 46 45 #ifdef CONFIG_64BIT 47 46 case 4: case 5: case 6: case 7: 48 47 #ifdef CONFIG_MIPS32_O32 49 48 if (test_thread_flag(TIF_32BIT_REGS)) 50 - return get_user(*arg, (int *)usp + 4 * n); 49 + return get_user(*arg, (int *)usp + n); 51 50 else 52 51 #endif 53 52 *arg = regs->regs[4 + n]; ··· 58 57 default: 59 58 BUG(); 60 59 } 60 + 61 + unreachable(); 61 62 } 62 63 63 64 static inline long syscall_get_return_value(struct task_struct *task, ··· 86 83 unsigned int i, unsigned int n, 87 84 unsigned long *args) 88 85 { 89 - unsigned long arg; 90 86 int ret; 91 87 92 88 while (n--) 93 - ret |= mips_get_syscall_arg(&arg, task, regs, i++); 89 + ret |= mips_get_syscall_arg(args++, task, regs, i++); 94 90 95 91 /* 96 92 * No way to communicate an error because this is a void function.
+2 -2
arch/mips/include/uapi/asm/inst.h
··· 163 163 */ 164 164 enum cop1x_func { 165 165 lwxc1_op = 0x00, ldxc1_op = 0x01, 166 - pfetch_op = 0x07, swxc1_op = 0x08, 167 - sdxc1_op = 0x09, madd_s_op = 0x20, 166 + swxc1_op = 0x08, sdxc1_op = 0x09, 167 + pfetch_op = 0x0f, madd_s_op = 0x20, 168 168 madd_d_op = 0x21, madd_e_op = 0x22, 169 169 msub_s_op = 0x28, msub_d_op = 0x29, 170 170 msub_e_op = 0x2a, nmadd_s_op = 0x30,
+2 -3
arch/mips/kernel/ftrace.c
··· 111 111 safe_store_code(new_code1, ip, faulted); 112 112 if (unlikely(faulted)) 113 113 return -EFAULT; 114 - ip += 4; 115 - safe_store_code(new_code2, ip, faulted); 114 + safe_store_code(new_code2, ip + 4, faulted); 116 115 if (unlikely(faulted)) 117 116 return -EFAULT; 118 - flush_icache_range(ip, ip + 8); /* original ip + 12 */ 117 + flush_icache_range(ip, ip + 8); 119 118 return 0; 120 119 } 121 120 #endif
+8 -8
arch/mips/kernel/r4k_fpu.S
··· 35 35 LEAF(_save_fp_context) 36 36 cfc1 t1, fcr31 37 37 38 - #if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2) 38 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) 39 39 .set push 40 - #ifdef CONFIG_MIPS32_R2 40 + #ifdef CONFIG_CPU_MIPS32_R2 41 41 .set mips64r2 42 42 mfc0 t0, CP0_STATUS 43 43 sll t0, t0, 5 ··· 146 146 * - cp1 status/control register 147 147 */ 148 148 LEAF(_restore_fp_context) 149 - EX lw t0, SC_FPC_CSR(a0) 149 + EX lw t1, SC_FPC_CSR(a0) 150 150 151 - #if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2) 151 + #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) 152 152 .set push 153 - #ifdef CONFIG_MIPS32_R2 153 + #ifdef CONFIG_CPU_MIPS32_R2 154 154 .set mips64r2 155 155 mfc0 t0, CP0_STATUS 156 156 sll t0, t0, 5 ··· 191 191 EX ldc1 $f26, SC_FPREGS+208(a0) 192 192 EX ldc1 $f28, SC_FPREGS+224(a0) 193 193 EX ldc1 $f30, SC_FPREGS+240(a0) 194 - ctc1 t0, fcr31 194 + ctc1 t1, fcr31 195 195 jr ra 196 196 li v0, 0 # success 197 197 END(_restore_fp_context) ··· 199 199 #ifdef CONFIG_MIPS32_COMPAT 200 200 LEAF(_restore_fp_context32) 201 201 /* Restore an o32 sigcontext. */ 202 - EX lw t0, SC32_FPC_CSR(a0) 202 + EX lw t1, SC32_FPC_CSR(a0) 203 203 204 204 mfc0 t0, CP0_STATUS 205 205 sll t0, t0, 5 ··· 239 239 EX ldc1 $f26, SC32_FPREGS+208(a0) 240 240 EX ldc1 $f28, SC32_FPREGS+224(a0) 241 241 EX ldc1 $f30, SC32_FPREGS+240(a0) 242 - ctc1 t0, fcr31 242 + ctc1 t1, fcr31 243 243 jr ra 244 244 li v0, 0 # success 245 245 END(_restore_fp_context32)
+3
arch/mips/kernel/rtlx-cmp.c
··· 112 112 113 113 for (i = 0; i < RTLX_CHANNELS; i++) 114 114 device_destroy(mt_class, MKDEV(major, i)); 115 + 115 116 unregister_chrdev(major, RTLX_MODULE_NAME); 117 + 118 + aprp_hook = NULL; 116 119 }
+3
arch/mips/kernel/rtlx-mt.c
··· 144 144 145 145 for (i = 0; i < RTLX_CHANNELS; i++) 146 146 device_destroy(mt_class, MKDEV(major, i)); 147 + 147 148 unregister_chrdev(major, RTLX_MODULE_NAME); 149 + 150 + aprp_hook = NULL; 148 151 }
+3 -3
arch/mips/math-emu/cp1emu.c
··· 1538 1538 break; 1539 1539 } 1540 1540 1541 - case 0x7: /* 7 */ 1542 - if (MIPSInst_FUNC(ir) != pfetch_op) { 1541 + case 0x3: 1542 + if (MIPSInst_FUNC(ir) != pfetch_op) 1543 1543 return SIGILL; 1544 - } 1544 + 1545 1545 /* ignore prefx operation */ 1546 1546 break; 1547 1547
+1 -1
arch/mips/mti-malta/malta-amon.c
··· 72 72 return 0; 73 73 } 74 74 75 - #ifdef CONFIG_MIPS_VPE_LOADER 75 + #ifdef CONFIG_MIPS_VPE_LOADER_CMP 76 76 int vpe_run(struct vpe *v) 77 77 { 78 78 struct vpe_notifications *n;
+2 -2
arch/mips/mti-malta/malta-int.c
··· 119 119 120 120 do_IRQ(MALTA_INT_BASE + irq); 121 121 122 - #ifdef MIPS_VPE_APSP_API 122 + #ifdef CONFIG_MIPS_VPE_APSP_API_MT 123 123 if (aprp_hook) 124 124 aprp_hook(); 125 125 #endif ··· 310 310 311 311 static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) 312 312 { 313 - #ifdef MIPS_VPE_APSP_API 313 + #ifdef CONFIG_MIPS_VPE_APSP_API_CMP 314 314 if (aprp_hook) 315 315 aprp_hook(); 316 316 #endif
+1
arch/mips/pci/msi-octeon.c
··· 150 150 msg.address_lo = 151 151 ((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff; 152 152 msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32; 153 + break; 153 154 case OCTEON_DMA_BAR_TYPE_BIG: 154 155 /* When using big bar, Bar 0 is based at 0 */ 155 156 msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff;
-11
arch/parisc/include/asm/page.h
··· 32 32 void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, 33 33 struct page *pg); 34 34 35 - /* #define CONFIG_PARISC_TMPALIAS */ 36 - 37 - #ifdef CONFIG_PARISC_TMPALIAS 38 - void clear_user_highpage(struct page *page, unsigned long vaddr); 39 - #define clear_user_highpage clear_user_highpage 40 - struct vm_area_struct; 41 - void copy_user_highpage(struct page *to, struct page *from, 42 - unsigned long vaddr, struct vm_area_struct *vma); 43 - #define __HAVE_ARCH_COPY_USER_HIGHPAGE 44 - #endif 45 - 46 35 /* 47 36 * These are used to make use of C type-checking.. 48 37 */
-4
arch/parisc/include/asm/spinlock.h
··· 191 191 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) 192 192 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) 193 193 194 - #define arch_spin_relax(lock) cpu_relax() 195 - #define arch_read_relax(lock) cpu_relax() 196 - #define arch_write_relax(lock) cpu_relax() 197 - 198 194 #endif /* __ASM_SPINLOCK_H */
+2 -2
arch/parisc/include/uapi/asm/unistd.h
··· 828 828 #define __NR_finit_module (__NR_Linux + 333) 829 829 #define __NR_sched_setattr (__NR_Linux + 334) 830 830 #define __NR_sched_getattr (__NR_Linux + 335) 831 + #define __NR_utimes (__NR_Linux + 336) 831 832 832 - #define __NR_Linux_syscalls (__NR_sched_getattr + 1) 833 + #define __NR_Linux_syscalls (__NR_utimes + 1) 833 834 834 835 835 836 #define __IGNORE_select /* newselect */ 836 837 #define __IGNORE_fadvise64 /* fadvise64_64 */ 837 - #define __IGNORE_utimes /* utime */ 838 838 839 839 840 840 #define HPUX_GATEWAY_ADDR 0xC0000004
-64
arch/parisc/kernel/cache.c
··· 581 581 __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); 582 582 } 583 583 } 584 - 585 - #ifdef CONFIG_PARISC_TMPALIAS 586 - 587 - void clear_user_highpage(struct page *page, unsigned long vaddr) 588 - { 589 - void *vto; 590 - unsigned long flags; 591 - 592 - /* Clear using TMPALIAS region. The page doesn't need to 593 - be flushed but the kernel mapping needs to be purged. */ 594 - 595 - vto = kmap_atomic(page); 596 - 597 - /* The PA-RISC 2.0 Architecture book states on page F-6: 598 - "Before a write-capable translation is enabled, *all* 599 - non-equivalently-aliased translations must be removed 600 - from the page table and purged from the TLB. (Note 601 - that the caches are not required to be flushed at this 602 - time.) Before any non-equivalent aliased translation 603 - is re-enabled, the virtual address range for the writeable 604 - page (the entire page) must be flushed from the cache, 605 - and the write-capable translation removed from the page 606 - table and purged from the TLB." */ 607 - 608 - purge_kernel_dcache_page_asm((unsigned long)vto); 609 - purge_tlb_start(flags); 610 - pdtlb_kernel(vto); 611 - purge_tlb_end(flags); 612 - preempt_disable(); 613 - clear_user_page_asm(vto, vaddr); 614 - preempt_enable(); 615 - 616 - pagefault_enable(); /* kunmap_atomic(addr, KM_USER0); */ 617 - } 618 - 619 - void copy_user_highpage(struct page *to, struct page *from, 620 - unsigned long vaddr, struct vm_area_struct *vma) 621 - { 622 - void *vfrom, *vto; 623 - unsigned long flags; 624 - 625 - /* Copy using TMPALIAS region. This has the advantage 626 - that the `from' page doesn't need to be flushed. However, 627 - the `to' page must be flushed in copy_user_page_asm since 628 - it can be used to bring in executable code. */ 629 - 630 - vfrom = kmap_atomic(from); 631 - vto = kmap_atomic(to); 632 - 633 - purge_kernel_dcache_page_asm((unsigned long)vto); 634 - purge_tlb_start(flags); 635 - pdtlb_kernel(vto); 636 - pdtlb_kernel(vfrom); 637 - purge_tlb_end(flags); 638 - preempt_disable(); 639 - copy_user_page_asm(vto, vfrom, vaddr); 640 - flush_dcache_page_asm(__pa(vto), vaddr); 641 - preempt_enable(); 642 - 643 - pagefault_enable(); /* kunmap_atomic(addr, KM_USER1); */ 644 - pagefault_enable(); /* kunmap_atomic(addr, KM_USER0); */ 645 - } 646 - 647 - #endif /* CONFIG_PARISC_TMPALIAS */
+1
arch/parisc/kernel/syscall_table.S
··· 431 431 ENTRY_SAME(finit_module) 432 432 ENTRY_SAME(sched_setattr) 433 433 ENTRY_SAME(sched_getattr) /* 335 */ 434 + ENTRY_COMP(utimes) 434 435 435 436 /* Nothing yet */ 436 437
+2 -69
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 1504 1504 1: addi r8,r8,16 1505 1505 .endr 1506 1506 1507 - /* Save DEC */ 1508 - mfspr r5,SPRN_DEC 1509 - mftb r6 1510 - extsw r5,r5 1511 - add r5,r5,r6 1512 - std r5,VCPU_DEC_EXPIRES(r9) 1513 - 1514 - BEGIN_FTR_SECTION 1515 - b 8f 1516 - END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) 1517 - /* Turn on TM so we can access TFHAR/TFIAR/TEXASR */ 1518 - mfmsr r8 1519 - li r0, 1 1520 - rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG 1521 - mtmsrd r8 1522 - 1523 - /* Save POWER8-specific registers */ 1524 - mfspr r5, SPRN_IAMR 1525 - mfspr r6, SPRN_PSPB 1526 - mfspr r7, SPRN_FSCR 1527 - std r5, VCPU_IAMR(r9) 1528 - stw r6, VCPU_PSPB(r9) 1529 - std r7, VCPU_FSCR(r9) 1530 - mfspr r5, SPRN_IC 1531 - mfspr r6, SPRN_VTB 1532 - mfspr r7, SPRN_TAR 1533 - std r5, VCPU_IC(r9) 1534 - std r6, VCPU_VTB(r9) 1535 - std r7, VCPU_TAR(r9) 1536 - #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1537 - mfspr r5, SPRN_TFHAR 1538 - mfspr r6, SPRN_TFIAR 1539 - mfspr r7, SPRN_TEXASR 1540 - std r5, VCPU_TFHAR(r9) 1541 - std r6, VCPU_TFIAR(r9) 1542 - std r7, VCPU_TEXASR(r9) 1543 - #endif 1544 - mfspr r8, SPRN_EBBHR 1545 - std r8, VCPU_EBBHR(r9) 1546 - mfspr r5, SPRN_EBBRR 1547 - mfspr r6, SPRN_BESCR 1548 - mfspr r7, SPRN_CSIGR 1549 - mfspr r8, SPRN_TACR 1550 - std r5, VCPU_EBBRR(r9) 1551 - std r6, VCPU_BESCR(r9) 1552 - std r7, VCPU_CSIGR(r9) 1553 - std r8, VCPU_TACR(r9) 1554 - mfspr r5, SPRN_TCSCR 1555 - mfspr r6, SPRN_ACOP 1556 - mfspr r7, SPRN_PID 1557 - mfspr r8, SPRN_WORT 1558 - std r5, VCPU_TCSCR(r9) 1559 - std r6, VCPU_ACOP(r9) 1560 - stw r7, VCPU_GUEST_PID(r9) 1561 - std r8, VCPU_WORT(r9) 1562 - 8: 1563 - 1564 - /* Save and reset AMR and UAMOR before turning on the MMU */ 1565 - BEGIN_FTR_SECTION 1566 - mfspr r5,SPRN_AMR 1567 - mfspr r6,SPRN_UAMOR 1568 - std r5,VCPU_AMR(r9) 1569 - std r6,VCPU_UAMOR(r9) 1570 - li r6,0 1571 - mtspr SPRN_AMR,r6 1572 - END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) 1573 - 1574 1507 /* Unset guest mode */ 1575 1508 li r0, KVM_GUEST_MODE_NONE 1576 1509 stb r0, HSTATE_IN_GUEST(r13) ··· 2136 2203 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 2137 2204 #endif 2138 2205 mfspr r6,SPRN_VRSAVE 2139 - stw r6,VCPU_VRSAVE(r3) 2206 + stw r6,VCPU_VRSAVE(r31) 2140 2207 mtlr r30 2141 2208 mtmsrd r5 2142 2209 isync ··· 2173 2240 bl .load_vr_state 2174 2241 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 2175 2242 #endif 2176 - lwz r7,VCPU_VRSAVE(r4) 2243 + lwz r7,VCPU_VRSAVE(r31) 2177 2244 mtspr SPRN_VRSAVE,r7 2178 2245 mtlr r30 2179 2246 mr r4,r31
+3 -1
arch/sparc/kernel/process_64.c
··· 58 58 { 59 59 if (tlb_type != hypervisor) { 60 60 touch_nmi_watchdog(); 61 + local_irq_enable(); 61 62 } else { 62 63 unsigned long pstate; 64 + 65 + local_irq_enable(); 63 66 64 67 /* The sun4v sleeping code requires that we have PSTATE.IE cleared over 65 68 * the cpu sleep hypervisor call. ··· 85 82 : "=&r" (pstate) 86 83 : "i" (PSTATE_IE)); 87 84 } 88 - local_irq_enable(); 89 85 } 90 86 91 87 #ifdef CONFIG_HOTPLUG_CPU
+2 -2
arch/sparc/kernel/syscalls.S
··· 189 189 mov %i0, %l5 ! IEU1 190 190 5: call %l7 ! CTI Group brk forced 191 191 srl %i5, 0, %o5 ! IEU1 192 - ba,a,pt %xcc, 3f 192 + ba,pt %xcc, 3f 193 + sra %o0, 0, %o0 193 194 194 195 /* Linux native system calls enter here... */ 195 196 .align 32 ··· 218 217 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 219 218 ret_sys_call: 220 219 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 221 - sra %o0, 0, %o0 222 220 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 223 221 sllx %g2, 32, %g2 224 222
+1 -1
arch/sparc/mm/tsb.c
··· 273 273 prom_halt(); 274 274 } 275 275 276 - for (i = 0; i < 8; i++) { 276 + for (i = 0; i < ARRAY_SIZE(tsb_cache_names); i++) { 277 277 unsigned long size = 8192 << i; 278 278 const char *name = tsb_cache_names[i]; 279 279
+1 -19
arch/x86/kernel/aperture_64.c
··· 18 18 #include <linux/pci_ids.h> 19 19 #include <linux/pci.h> 20 20 #include <linux/bitops.h> 21 - #include <linux/ioport.h> 22 21 #include <linux/suspend.h> 23 22 #include <asm/e820.h> 24 23 #include <asm/io.h> ··· 53 54 54 55 int fix_aperture __initdata = 1; 55 56 56 - static struct resource gart_resource = { 57 - .name = "GART", 58 - .flags = IORESOURCE_MEM, 59 - }; 60 - 61 - static void __init insert_aperture_resource(u32 aper_base, u32 aper_size) 62 - { 63 - gart_resource.start = aper_base; 64 - gart_resource.end = aper_base + aper_size - 1; 65 - insert_resource(&iomem_resource, &gart_resource); 66 - } 67 - 68 57 /* This code runs before the PCI subsystem is initialized, so just 69 58 access the northbridge directly. */ 70 59 ··· 83 96 memblock_reserve(addr, aper_size); 84 97 printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", 85 98 aper_size >> 10, addr); 86 - insert_aperture_resource((u32)addr, aper_size); 87 99 register_nosave_region(addr >> PAGE_SHIFT, 88 100 (addr+aper_size) >> PAGE_SHIFT); 89 101 ··· 430 444 431 445 out: 432 446 if (!fix && !fallback_aper_force) { 433 - if (last_aper_base) { 434 - unsigned long n = (32 * 1024 * 1024) << last_aper_order; 435 - 436 - insert_aperture_resource((u32)last_aper_base, n); 447 + if (last_aper_base) 437 448 return 1; 438 - } 439 449 return 0; 440 450 } 441 451
+2 -1
arch/x86/kernel/cpu/perf_event_intel_uncore.c
··· 3334 3334 if (!pmus) 3335 3335 return -ENOMEM; 3336 3336 3337 + type->pmus = pmus; 3338 + 3337 3339 type->unconstrainted = (struct event_constraint) 3338 3340 __EVENT_CONSTRAINT(0, (1ULL << type->num_counters) - 1, 3339 3341 0, type->num_counters, 0, 0); ··· 3371 3369 } 3372 3370 3373 3371 type->pmu_group = &uncore_pmu_attr_group; 3374 - type->pmus = pmus; 3375 3372 return 0; 3376 3373 fail: 3377 3374 uncore_type_exit(type);
+12 -13
block/blk-core.c
··· 693 693 if (!uninit_q) 694 694 return NULL; 695 695 696 - uninit_q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL); 697 - if (!uninit_q->flush_rq) 698 - goto out_cleanup_queue; 699 - 700 696 q = blk_init_allocated_queue(uninit_q, rfn, lock); 701 697 if (!q) 702 - goto out_free_flush_rq; 703 - return q; 698 + blk_cleanup_queue(uninit_q); 704 699 705 - out_free_flush_rq: 706 - kfree(uninit_q->flush_rq); 707 - out_cleanup_queue: 708 - blk_cleanup_queue(uninit_q); 709 - return NULL; 700 + return q; 710 701 } 711 702 EXPORT_SYMBOL(blk_init_queue_node); 712 703 ··· 708 717 if (!q) 709 718 return NULL; 710 719 711 - if (blk_init_rl(&q->root_rl, q, GFP_KERNEL)) 720 + q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL); 721 + if (!q->flush_rq) 712 722 return NULL; 723 + 724 + if (blk_init_rl(&q->root_rl, q, GFP_KERNEL)) 725 + goto fail; 713 726 714 727 q->request_fn = rfn; 715 728 q->prep_rq_fn = NULL; ··· 737 742 /* init elevator */ 738 743 if (elevator_init(q, NULL)) { 739 744 mutex_unlock(&q->sysfs_lock); 740 - return NULL; 745 + goto fail; 741 746 } 742 747 743 748 mutex_unlock(&q->sysfs_lock); 744 749 745 750 return q; 751 + 752 + fail: 753 + kfree(q->flush_rq); 754 + return NULL; 746 755 } 747 756 EXPORT_SYMBOL(blk_init_allocated_queue); 748 757
+7 -4
block/blk-flush.c
··· 140 140 blk_mq_insert_request(rq, false, true, false); 141 141 } 142 142 143 - static bool blk_flush_queue_rq(struct request *rq) 143 + static bool blk_flush_queue_rq(struct request *rq, bool add_front) 144 144 { 145 145 if (rq->q->mq_ops) { 146 146 INIT_WORK(&rq->mq_flush_work, mq_flush_run); 147 147 kblockd_schedule_work(rq->q, &rq->mq_flush_work); 148 148 return false; 149 149 } else { 150 - list_add_tail(&rq->queuelist, &rq->q->queue_head); 150 + if (add_front) 151 + list_add(&rq->queuelist, &rq->q->queue_head); 152 + else 153 + list_add_tail(&rq->queuelist, &rq->q->queue_head); 151 154 return true; 152 155 } 153 156 } ··· 196 193 197 194 case REQ_FSEQ_DATA: 198 195 list_move_tail(&rq->flush.list, &q->flush_data_in_flight); 199 - queued = blk_flush_queue_rq(rq); 196 + queued = blk_flush_queue_rq(rq, true); 200 197 break; 201 198 202 199 case REQ_FSEQ_DONE: ··· 329 326 q->flush_rq->rq_disk = first_rq->rq_disk; 330 327 q->flush_rq->end_io = flush_end_io; 331 328 332 - return blk_flush_queue_rq(q->flush_rq); 329 + return blk_flush_queue_rq(q->flush_rq, false); 333 330 } 334 331 335 332 static void flush_data_end_io(struct request *rq, int error)
+1 -1
drivers/block/mtip32xx/mtip32xx.c
··· 4498 4498 } 4499 4499 dev_info(&pdev->dev, "NUMA node %d (closest: %d,%d, probe on %d:%d)\n", 4500 4500 my_node, pcibus_to_node(pdev->bus), dev_to_node(&pdev->dev), 4501 - cpu_to_node(smp_processor_id()), smp_processor_id()); 4501 + cpu_to_node(raw_smp_processor_id()), raw_smp_processor_id()); 4502 4502 4503 4503 dd = kzalloc_node(sizeof(struct driver_data), GFP_KERNEL, my_node); 4504 4504 if (dd == NULL) {
+1 -1
drivers/clocksource/vf_pit_timer.c
··· 54 54 55 55 static u64 pit_read_sched_clock(void) 56 56 { 57 - return __raw_readl(clksrc_base + PITCVAL); 57 + return ~__raw_readl(clksrc_base + PITCVAL); 58 58 } 59 59 60 60 static int __init pit_clocksource_init(unsigned long rate)
+1 -1
drivers/gpu/drm/drm_pci.c
··· 468 468 } else { 469 469 list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list, 470 470 legacy_dev_list) { 471 - drm_put_dev(dev); 472 471 list_del(&dev->legacy_dev_list); 472 + drm_put_dev(dev); 473 473 } 474 474 } 475 475 DRM_INFO("Module unloaded\n");
+7 -3
drivers/gpu/drm/exynos/exynos_drm_drv.c
··· 172 172 173 173 ret = exynos_drm_subdrv_open(dev, file); 174 174 if (ret) 175 - goto out; 175 + goto err_file_priv_free; 176 176 177 177 anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops, 178 178 NULL, 0); 179 179 if (IS_ERR(anon_filp)) { 180 180 ret = PTR_ERR(anon_filp); 181 - goto out; 181 + goto err_subdrv_close; 182 182 } 183 183 184 184 anon_filp->f_mode = FMODE_READ | FMODE_WRITE; 185 185 file_priv->anon_filp = anon_filp; 186 186 187 187 return ret; 188 - out: 188 + 189 + err_subdrv_close: 190 + exynos_drm_subdrv_close(dev, file); 191 + 192 + err_file_priv_free: 189 193 kfree(file_priv); 190 194 file->driver_priv = NULL; 191 195 return ret;
+7
drivers/gpu/drm/i915/i915_gem_stolen.c
··· 214 214 struct drm_i915_private *dev_priv = dev->dev_private; 215 215 int bios_reserved = 0; 216 216 217 + #ifdef CONFIG_INTEL_IOMMU 218 + if (intel_iommu_gfx_mapped) { 219 + DRM_INFO("DMAR active, disabling use of stolen memory\n"); 220 + return 0; 221 + } 222 + #endif 223 + 217 224 if (dev_priv->gtt.stolen_size == 0) 218 225 return 0; 219 226
+40 -29
drivers/gpu/drm/i915/i915_irq.c
··· 618 618 619 619 /* raw reads, only for fast reads of display block, no need for forcewake etc. */ 620 620 #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__)) 621 - #define __raw_i915_read16(dev_priv__, reg__) readw((dev_priv__)->regs + (reg__)) 622 621 623 622 static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) 624 623 { 625 624 struct drm_i915_private *dev_priv = dev->dev_private; 626 625 uint32_t status; 626 + int reg; 627 627 628 - if (INTEL_INFO(dev)->gen < 7) { 629 - status = pipe == PIPE_A ? 630 - DE_PIPEA_VBLANK : 631 - DE_PIPEB_VBLANK; 628 + if (INTEL_INFO(dev)->gen >= 8) { 629 + status = GEN8_PIPE_VBLANK; 630 + reg = GEN8_DE_PIPE_ISR(pipe); 631 + } else if (INTEL_INFO(dev)->gen >= 7) { 632 + status = DE_PIPE_VBLANK_IVB(pipe); 633 + reg = DEISR; 632 634 } else { 633 - switch (pipe) { 634 - default: 635 - case PIPE_A: 636 - status = DE_PIPEA_VBLANK_IVB; 637 - break; 638 - case PIPE_B: 639 - status = DE_PIPEB_VBLANK_IVB; 640 - break; 641 - case PIPE_C: 642 - status = DE_PIPEC_VBLANK_IVB; 643 - break; 644 - } 635 + status = DE_PIPE_VBLANK(pipe); 636 + reg = DEISR; 645 637 } 646 638 647 - return __raw_i915_read32(dev_priv, DEISR) & status; 639 + return __raw_i915_read32(dev_priv, reg) & status; 648 640 } 649 641 650 642 static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, ··· 694 702 else 695 703 position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3; 696 704 697 - if (HAS_PCH_SPLIT(dev)) { 705 + if (HAS_DDI(dev)) { 706 + /* 707 + * On HSW HDMI outputs there seems to be a 2 line 708 + * difference, whereas eDP has the normal 1 line 709 + * difference that earlier platforms have. External 710 + * DP is unknown. For now just check for the 2 line 711 + * difference case on all output types on HSW+. 712 + * 713 + * This might misinterpret the scanline counter being 714 + * one line too far along on eDP, but that's less 715 + * dangerous than the alternative since that would lead 716 + * the vblank timestamp code astray when it sees a 717 + * scanline count before vblank_start during a vblank 718 + * interrupt. 719 + */ 720 + in_vbl = ilk_pipe_in_vblank_locked(dev, pipe); 721 + if ((in_vbl && (position == vbl_start - 2 || 722 + position == vbl_start - 1)) || 723 + (!in_vbl && (position == vbl_end - 2 || 724 + position == vbl_end - 1))) 725 + position = (position + 2) % vtotal; 726 + } else if (HAS_PCH_SPLIT(dev)) { 698 727 /* 699 728 * The scanline counter increments at the leading edge 700 729 * of hsync, ie. it completely misses the active portion ··· 2782 2769 return; 2783 2770 2784 2771 if (HAS_PCH_IBX(dev)) { 2785 - mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER | 2786 - SDE_TRANSA_FIFO_UNDER | SDE_POISON; 2772 + mask = SDE_GMBUS | SDE_AUX_MASK | SDE_POISON; 2787 2773 } else { 2788 - mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT; 2774 + mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT; 2789 2775 2790 2776 I915_WRITE(SERR_INT, I915_READ(SERR_INT)); 2791 2777 } ··· 2844 2832 display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE_IVB | 2845 2833 DE_PCH_EVENT_IVB | DE_PLANEC_FLIP_DONE_IVB | 2846 2834 DE_PLANEB_FLIP_DONE_IVB | 2847 - DE_PLANEA_FLIP_DONE_IVB | DE_AUX_CHANNEL_A_IVB | 2848 - DE_ERR_INT_IVB); 2835 + DE_PLANEA_FLIP_DONE_IVB | DE_AUX_CHANNEL_A_IVB); 2849 2836 extra_mask = (DE_PIPEC_VBLANK_IVB | DE_PIPEB_VBLANK_IVB | 2850 - DE_PIPEA_VBLANK_IVB); 2837 + DE_PIPEA_VBLANK_IVB | DE_ERR_INT_IVB); 2851 2838 2852 2839 I915_WRITE(GEN7_ERR_INT, I915_READ(GEN7_ERR_INT)); 2853 2840 } else { 2854 2841 display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT | 2855 2842 DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE | 2856 2843 DE_AUX_CHANNEL_A | 2857 - DE_PIPEB_FIFO_UNDERRUN | DE_PIPEA_FIFO_UNDERRUN | 2858 2844 DE_PIPEB_CRC_DONE | DE_PIPEA_CRC_DONE | 2859 2845 DE_POISON); 2860 - extra_mask = DE_PIPEA_VBLANK | DE_PIPEB_VBLANK | DE_PCU_EVENT; 2846 + extra_mask = DE_PIPEA_VBLANK | DE_PIPEB_VBLANK | DE_PCU_EVENT | 2847 + DE_PIPEB_FIFO_UNDERRUN | DE_PIPEA_FIFO_UNDERRUN; 2861 2848 } 2862 2849 2863 2850 dev_priv->irq_mask = ~display_mask; ··· 2972 2961 struct drm_device *dev = dev_priv->dev; 2973 2962 uint32_t de_pipe_masked = GEN8_PIPE_FLIP_DONE | 2974 2963 GEN8_PIPE_CDCLK_CRC_DONE | 2975 - GEN8_PIPE_FIFO_UNDERRUN | 2976 2964 GEN8_DE_PIPE_IRQ_FAULT_ERRORS; 2977 - uint32_t de_pipe_enables = de_pipe_masked | GEN8_PIPE_VBLANK; 2965 + uint32_t de_pipe_enables = de_pipe_masked | GEN8_PIPE_VBLANK | 2966 + GEN8_PIPE_FIFO_UNDERRUN; 2978 2967 int pipe; 2979 2968 dev_priv->de_irq_mask[PIPE_A] = ~de_pipe_masked; 2980 2969 dev_priv->de_irq_mask[PIPE_B] = ~de_pipe_masked;
+1
drivers/gpu/drm/i915/intel_ddi.c
··· 1244 1244 if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { 1245 1245 struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 1246 1246 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); 1247 + ironlake_edp_panel_vdd_on(intel_dp); 1247 1248 ironlake_edp_panel_off(intel_dp); 1248 1249 } 1249 1250
+10 -2
drivers/gpu/drm/i915/intel_dp.c
··· 1249 1249 1250 1250 DRM_DEBUG_KMS("Turn eDP power off\n"); 1251 1251 1252 + WARN(!intel_dp->want_panel_vdd, "Need VDD to turn off panel\n"); 1253 + 1252 1254 pp = ironlake_get_pp_control(intel_dp); 1253 1255 /* We need to switch off panel power _and_ force vdd, for otherwise some 1254 1256 * panels get very unhappy and cease to work. */ 1255 - pp &= ~(POWER_TARGET_ON | PANEL_POWER_RESET | EDP_BLC_ENABLE); 1257 + pp &= ~(POWER_TARGET_ON | EDP_FORCE_VDD | PANEL_POWER_RESET | EDP_BLC_ENABLE); 1256 1258 1257 1259 pp_ctrl_reg = _pp_ctrl_reg(intel_dp); 1258 1260 1259 1261 I915_WRITE(pp_ctrl_reg, pp); 1260 1262 POSTING_READ(pp_ctrl_reg); 1261 1263 1264 + intel_dp->want_panel_vdd = false; 1265 + 1262 1266 ironlake_wait_panel_off(intel_dp); 1267 + 1268 + /* We got a reference when we enabled the VDD. */ 1269 + intel_runtime_pm_put(dev_priv); 1263 1270 } 1264 1271 1265 1272 void ironlake_edp_backlight_on(struct intel_dp *intel_dp) ··· 1646 1639 val |= EDP_PSR_LINK_DISABLE; 1647 1640 1648 1641 I915_WRITE(EDP_PSR_CTL(dev), val | 1649 - IS_BROADWELL(dev) ? 0 : link_entry_time | 1642 + (IS_BROADWELL(dev) ? 0 : link_entry_time) | 1650 1643 max_sleep_time << EDP_PSR_MAX_SLEEP_TIME_SHIFT | 1651 1644 idle_frames << EDP_PSR_IDLE_FRAME_SHIFT | 1652 1645 EDP_PSR_ENABLE); ··· 1791 1784 1792 1785 /* Make sure the panel is off before trying to change the mode. But also 1793 1786 * ensure that we have vdd while we switch off the panel. */ 1787 + ironlake_edp_panel_vdd_on(intel_dp); 1794 1788 ironlake_edp_backlight_off(intel_dp); 1795 1789 intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); 1796 1790 ironlake_edp_panel_off(intel_dp);
+2
drivers/hid/hid-lg4ff.c
··· 43 43 #define G25_REV_MIN 0x22 44 44 #define G27_REV_MAJ 0x12 45 45 #define G27_REV_MIN 0x38 46 + #define G27_2_REV_MIN 0x39 46 47 47 48 #define to_hid_device(pdev) container_of(pdev, struct hid_device, dev) 48 49 ··· 131 130 {DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */ 132 131 {G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */ 133 132 {G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */ 133 + {G27_REV_MAJ, G27_2_REV_MIN, &native_g27}, /* G27 v2 */ 134 134 }; 135 135 136 136 /* Recalculates X axis value accordingly to currently selected range */
+12 -15
drivers/hid/hid-sony.c
··· 42 42 #define DUALSHOCK4_CONTROLLER_BT BIT(6) 43 43 44 44 #define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER_USB | BUZZ_CONTROLLER | DUALSHOCK4_CONTROLLER_USB) 45 + #define SONY_FF_SUPPORT (SIXAXIS_CONTROLLER_USB | DUALSHOCK4_CONTROLLER_USB) 45 46 46 47 #define MAX_LEDS 4 47 48 ··· 500 499 __u8 right; 501 500 #endif 502 501 502 + __u8 worker_initialized; 503 503 __u8 led_state[MAX_LEDS]; 504 504 __u8 led_count; 505 505 }; ··· 995 993 return input_ff_create_memless(input_dev, NULL, sony_play_effect); 996 994 } 997 995 998 - static void sony_destroy_ff(struct hid_device *hdev) 999 - { 1000 - struct sony_sc *sc = hid_get_drvdata(hdev); 1001 - 1002 - cancel_work_sync(&sc->state_worker); 1003 - } 1004 - 1005 996 #else 1006 997 static int sony_init_ff(struct hid_device *hdev) 1007 998 { 1008 999 return 0; 1009 - } 1010 - 1011 - static void sony_destroy_ff(struct hid_device *hdev) 1012 - { 1013 1000 } 1014 1001 #endif 1015 1002 ··· 1068 1077 if (sc->quirks & SIXAXIS_CONTROLLER_USB) { 1069 1078 hdev->hid_output_raw_report = sixaxis_usb_output_raw_report; 1070 1079 ret = sixaxis_set_operational_usb(hdev); 1080 + 1081 + sc->worker_initialized = 1; 1071 1082 INIT_WORK(&sc->state_worker, sixaxis_state_worker); 1072 1083 } 1073 1084 else if (sc->quirks & SIXAXIS_CONTROLLER_BT) ··· 1080 1087 if (ret < 0) 1081 1088 goto err_stop; 1082 1089 1090 + sc->worker_initialized = 1; 1083 1091 INIT_WORK(&sc->state_worker, dualshock4_state_worker); 1084 1092 } else { 1085 1093 ret = 0; ··· 1095 1101 goto err_stop; 1096 1102 } 1097 1103 1098 - ret = sony_init_ff(hdev); 1099 - if (ret < 0) 1100 - goto err_stop; 1104 + if (sc->quirks & SONY_FF_SUPPORT) { 1105 + ret = sony_init_ff(hdev); 1106 + if (ret < 0) 1107 + goto err_stop; 1108 + } 1101 1109 1102 1110 return 0; 1103 1111 err_stop: ··· 1116 1120 if (sc->quirks & SONY_LED_SUPPORT) 1117 1121 sony_leds_remove(hdev); 1118 1122 1119 - sony_destroy_ff(hdev); 1123 + if (sc->worker_initialized) 1124 + cancel_work_sync(&sc->state_worker); 1120 1125 1121 1126 hid_hw_stop(hdev); 1122 1127 }
+2 -2
drivers/hid/hidraw.c
··· 320 320 hid_hw_close(hidraw->hid); 321 321 wake_up_interruptible(&hidraw->wait); 322 322 } 323 + device_destroy(hidraw_class, 324 + MKDEV(hidraw_major, hidraw->minor)); 323 325 } else { 324 326 --hidraw->open; 325 327 } 326 328 if (!hidraw->open) { 327 329 if (!hidraw->exist) { 328 - device_destroy(hidraw_class, 329 - MKDEV(hidraw_major, hidraw->minor)); 330 330 hidraw_table[hidraw->minor] = NULL; 331 331 kfree(hidraw); 332 332 } else {
+10 -10
drivers/isdn/capi/Kconfig
··· 16 16 This will increase the size of the kernelcapi module by 20 KB. 17 17 If unsure, say Y. 18 18 19 - config ISDN_CAPI_MIDDLEWARE 20 - bool "CAPI2.0 Middleware support" 21 - depends on TTY 22 - help 23 - This option will enhance the capabilities of the /dev/capi20 24 - interface. It will provide a means of moving a data connection, 25 - established via the usual /dev/capi20 interface to a special tty 26 - device. If you want to use pppd with pppdcapiplugin to dial up to 27 - your ISP, say Y here. 28 - 29 19 config ISDN_CAPI_CAPI20 30 20 tristate "CAPI2.0 /dev/capi support" 31 21 help ··· 23 33 applications via /dev/capi20. Applications should use the 24 34 standardized libcapi20 to access this functionality. You should say 25 35 Y/M here. 36 + 37 + config ISDN_CAPI_MIDDLEWARE 38 + bool "CAPI2.0 Middleware support" 39 + depends on ISDN_CAPI_CAPI20 && TTY 40 + help 41 + This option will enhance the capabilities of the /dev/capi20 42 + interface. It will provide a means of moving a data connection, 43 + established via the usual /dev/capi20 interface to a special tty 44 + device. If you want to use pppd with pppdcapiplugin to dial up to 45 + your ISP, say Y here. 26 46 27 47 config ISDN_CAPI_CAPIDRV 28 48 tristate "CAPI2.0 capidrv interface support"
+4 -10
drivers/net/ethernet/atheros/alx/main.c
··· 1248 1248 * shared register for the high 32 bits, so only a single, aligned, 1249 1249 * 4 GB physical address range can be used for descriptors. 1250 1250 */ 1251 - if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) && 1252 - !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { 1251 + if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) { 1253 1252 dev_dbg(&pdev->dev, "DMA to 64-BIT addresses\n"); 1254 1253 } else { 1255 - err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); 1254 + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); 1256 1255 if (err) { 1257 - err = dma_set_coherent_mask(&pdev->dev, 1258 - DMA_BIT_MASK(32)); 1259 - if (err) { 1260 - dev_err(&pdev->dev, 1261 - "No usable DMA config, aborting\n"); 1262 - goto out_pci_disable; 1263 - } 1256 + dev_err(&pdev->dev, "No usable DMA config, aborting\n"); 1257 + goto out_pci_disable; 1264 1258 } 1265 1259 } 1266 1260
+2 -2
drivers/net/ethernet/atheros/atl1e/atl1e_main.c
··· 2436 2436 err_register: 2437 2437 err_sw_init: 2438 2438 err_eeprom: 2439 - iounmap(adapter->hw.hw_addr); 2439 + pci_iounmap(pdev, adapter->hw.hw_addr); 2440 2440 err_init_netdev: 2441 2441 err_ioremap: 2442 2442 free_netdev(netdev); ··· 2474 2474 unregister_netdev(netdev); 2475 2475 atl1e_free_ring_resources(adapter); 2476 2476 atl1e_force_ps(&adapter->hw); 2477 - iounmap(adapter->hw.hw_addr); 2477 + pci_iounmap(pdev, adapter->hw.hw_addr); 2478 2478 pci_release_regions(pdev); 2479 2479 free_netdev(netdev); 2480 2480 pci_disable_device(pdev);
+56 -55
drivers/net/ethernet/broadcom/cnic.c
··· 1 1 /* cnic.c: Broadcom CNIC core network driver. 2 2 * 3 - * Copyright (c) 2006-2013 Broadcom Corporation 3 + * Copyright (c) 2006-2014 Broadcom Corporation 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify 6 6 * it under the terms of the GNU General Public License as published by ··· 342 342 while (retry < 3) { 343 343 rc = 0; 344 344 rcu_read_lock(); 345 - ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]); 345 + ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]); 346 346 if (ulp_ops) 347 347 rc = ulp_ops->iscsi_nl_send_msg( 348 348 cp->ulp_handle[CNIC_ULP_ISCSI], ··· 726 726 727 727 for (i = 0; i < dma->num_pages; i++) { 728 728 if (dma->pg_arr[i]) { 729 - dma_free_coherent(&dev->pcidev->dev, BNX2_PAGE_SIZE, 729 + dma_free_coherent(&dev->pcidev->dev, CNIC_PAGE_SIZE, 730 730 dma->pg_arr[i], dma->pg_map_arr[i]); 731 731 dma->pg_arr[i] = NULL; 732 732 } ··· 785 785 786 786 for (i = 0; i < pages; i++) { 787 787 dma->pg_arr[i] = dma_alloc_coherent(&dev->pcidev->dev, 788 - BNX2_PAGE_SIZE, 788 + CNIC_PAGE_SIZE, 789 789 &dma->pg_map_arr[i], 790 790 GFP_ATOMIC); 791 791 if (dma->pg_arr[i] == NULL) ··· 794 794 if (!use_pg_tbl) 795 795 return 0; 796 796 797 - dma->pgtbl_size = ((pages * 8) + BNX2_PAGE_SIZE - 1) & 798 - ~(BNX2_PAGE_SIZE - 1); 797 + dma->pgtbl_size = ((pages * 8) + CNIC_PAGE_SIZE - 1) & 798 + ~(CNIC_PAGE_SIZE - 1); 799 799 dma->pgtbl = dma_alloc_coherent(&dev->pcidev->dev, dma->pgtbl_size, 800 800 &dma->pgtbl_map, GFP_ATOMIC); 801 801 if (dma->pgtbl == NULL) ··· 900 900 if (BNX2_CHIP(cp) == BNX2_CHIP_5709) { 901 901 int i, k, arr_size; 902 902 903 - cp->ctx_blk_size = BNX2_PAGE_SIZE; 904 - cp->cids_per_blk = BNX2_PAGE_SIZE / 128; 903 + cp->ctx_blk_size = CNIC_PAGE_SIZE; 904 + cp->cids_per_blk = CNIC_PAGE_SIZE / 128; 905 905 arr_size = BNX2_MAX_CID / cp->cids_per_blk * 906 906 sizeof(struct cnic_ctx); 907 907 cp->ctx_arr = kzalloc(arr_size, GFP_KERNEL); ··· 933 933 for (i = 0; i < cp->ctx_blks; i++) { 934 934 cp->ctx_arr[i].ctx = 935 935 dma_alloc_coherent(&dev->pcidev->dev, 936 - BNX2_PAGE_SIZE, 936 + CNIC_PAGE_SIZE, 937 937 &cp->ctx_arr[i].mapping, 938 938 GFP_KERNEL); 939 939 if (cp->ctx_arr[i].ctx == NULL) ··· 1013 1013 if (udev->l2_ring) 1014 1014 return 0; 1015 1015 1016 - udev->l2_ring_size = pages * BNX2_PAGE_SIZE; 1016 + udev->l2_ring_size = pages * CNIC_PAGE_SIZE; 1017 1017 udev->l2_ring = dma_alloc_coherent(&udev->pdev->dev, udev->l2_ring_size, 1018 1018 &udev->l2_ring_map, 1019 1019 GFP_KERNEL | __GFP_COMP); ··· 1021 1021 return -ENOMEM; 1022 1022 1023 1023 udev->l2_buf_size = (cp->l2_rx_ring_size + 1) * cp->l2_single_buf_size; 1024 - udev->l2_buf_size = PAGE_ALIGN(udev->l2_buf_size); 1024 + udev->l2_buf_size = CNIC_PAGE_ALIGN(udev->l2_buf_size); 1025 1025 udev->l2_buf = dma_alloc_coherent(&udev->pdev->dev, udev->l2_buf_size, 1026 1026 &udev->l2_buf_map, 1027 1027 GFP_KERNEL | __GFP_COMP); ··· 1102 1102 uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID + 1103 1103 TX_MAX_TSS_RINGS + 1); 1104 1104 uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & 1105 - PAGE_MASK; 1105 + CNIC_PAGE_MASK; 1106 1106 if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) 1107 1107 uinfo->mem[1].size = BNX2_SBLK_MSIX_ALIGN_SIZE * 9; 1108 1108 else ··· 1113 1113 uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0); 1114 1114 1115 1115 uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & 1116 - PAGE_MASK; 1116 + CNIC_PAGE_MASK; 1117 1117 uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); 1118 1118 1119 1119 uinfo->name = "bnx2x_cnic"; ··· 1267 1267 for (i = MAX_ISCSI_TBL_SZ; i < cp->max_cid_space; i++) 1268 1268 cp->ctx_tbl[i].ulp_proto_id = CNIC_ULP_FCOE; 1269 1269 1270 - pages = PAGE_ALIGN(cp->max_cid_space * CNIC_KWQ16_DATA_SIZE) / 1271 - PAGE_SIZE; 1270 + pages = CNIC_PAGE_ALIGN(cp->max_cid_space * CNIC_KWQ16_DATA_SIZE) / 1271 + CNIC_PAGE_SIZE; 1272 1272 1273 1273 ret = cnic_alloc_dma(dev, kwq_16_dma, pages, 0); 1274 1274 if (ret) 1275 1275 return -ENOMEM; 1276 1276 1277 - n = PAGE_SIZE / CNIC_KWQ16_DATA_SIZE; 1277 + n = CNIC_PAGE_SIZE / CNIC_KWQ16_DATA_SIZE; 1278 1278 for (i = 0, j = 0; i < cp->max_cid_space; i++) { 1279 1279 long off = CNIC_KWQ16_DATA_SIZE * (i % n); 1280 1280 ··· 1296 1296 goto error; 1297 1297 } 1298 1298 1299 - pages = PAGE_ALIGN(BNX2X_ISCSI_GLB_BUF_SIZE) / PAGE_SIZE; 1299 + pages = CNIC_PAGE_ALIGN(BNX2X_ISCSI_GLB_BUF_SIZE) / CNIC_PAGE_SIZE; 1300 1300 ret = cnic_alloc_dma(dev, &cp->gbl_buf_info, pages, 0); 1301 1301 if (ret) 1302 1302 goto error; ··· 1466 1466 cp->r2tq_size = cp->num_iscsi_tasks * BNX2X_ISCSI_MAX_PENDING_R2TS * 1467 1467 BNX2X_ISCSI_R2TQE_SIZE; 1468 1468 cp->hq_size = cp->num_ccells * BNX2X_ISCSI_HQ_BD_SIZE; 1469 - pages = PAGE_ALIGN(cp->hq_size) / PAGE_SIZE; 1470 - hq_bds = pages * (PAGE_SIZE / BNX2X_ISCSI_HQ_BD_SIZE); 1469 + pages = CNIC_PAGE_ALIGN(cp->hq_size) / CNIC_PAGE_SIZE; 1470 + hq_bds = pages * (CNIC_PAGE_SIZE / BNX2X_ISCSI_HQ_BD_SIZE); 1471 1471 cp->num_cqs = req1->num_cqs; 1472 1472 1473 1473 if (!dev->max_iscsi_conn) ··· 1477 1477 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_RQ_SIZE_OFFSET(pfid), 1478 1478 req1->rq_num_wqes); 1479 1479 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1480 - PAGE_SIZE); 1480 + CNIC_PAGE_SIZE); 1481 1481 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1482 - TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1482 + TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1483 1483 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + 1484 1484 TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1485 1485 req1->num_tasks_per_conn); ··· 1489 1489 USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfid), 1490 1490 req1->rq_buffer_size); 1491 1491 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1492 - PAGE_SIZE); 1492 + CNIC_PAGE_SIZE); 1493 1493 CNIC_WR8(dev, BAR_USTRORM_INTMEM + 1494 - USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1494 + USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1495 1495 CNIC_WR16(dev, BAR_USTRORM_INTMEM + 1496 1496 USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1497 1497 req1->num_tasks_per_conn); ··· 1504 1504 1505 1505 /* init Xstorm RAM */ 1506 1506 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1507 - PAGE_SIZE); 1507 + CNIC_PAGE_SIZE); 1508 1508 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1509 - XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1509 + XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1510 1510 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + 1511 1511 XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1512 1512 req1->num_tasks_per_conn); ··· 1519 1519 1520 1520 /* init Cstorm RAM */ 1521 1521 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1522 - PAGE_SIZE); 1522 + CNIC_PAGE_SIZE); 1523 1523 CNIC_WR8(dev, BAR_CSTRORM_INTMEM + 1524 - CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1524 + CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1525 1525 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + 1526 1526 CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1527 1527 req1->num_tasks_per_conn); ··· 1623 1623 } 1624 1624 1625 1625 ctx->cid = cid; 1626 - pages = PAGE_ALIGN(cp->task_array_size) / PAGE_SIZE; 1626 + pages = CNIC_PAGE_ALIGN(cp->task_array_size) / CNIC_PAGE_SIZE; 1627 1627 1628 1628 ret = cnic_alloc_dma(dev, &iscsi->task_array_info, pages, 1); 1629 1629 if (ret) 1630 1630 goto error; 1631 1631 1632 - pages = PAGE_ALIGN(cp->r2tq_size) / PAGE_SIZE; 1632 + pages = CNIC_PAGE_ALIGN(cp->r2tq_size) / CNIC_PAGE_SIZE; 1633 1633 ret = cnic_alloc_dma(dev, &iscsi->r2tq_info, pages, 1); 1634 1634 if (ret) 1635 1635 goto error; 1636 1636 1637 - pages = PAGE_ALIGN(cp->hq_size) / PAGE_SIZE; 1637 + pages = CNIC_PAGE_ALIGN(cp->hq_size) / CNIC_PAGE_SIZE; 1638 1638 ret = cnic_alloc_dma(dev, &iscsi->hq_info, pages, 1); 1639 1639 if (ret) 1640 1640 goto error; ··· 1760 1760 ictx->tstorm_st_context.iscsi.hdr_bytes_2_fetch = ISCSI_HEADER_SIZE; 1761 1761 /* TSTORM requires the base address of RQ DB & not PTE */ 1762 1762 ictx->tstorm_st_context.iscsi.rq_db_phy_addr.lo = 1763 - req2->rq_page_table_addr_lo & PAGE_MASK; 1763 + req2->rq_page_table_addr_lo & CNIC_PAGE_MASK; 1764 1764 ictx->tstorm_st_context.iscsi.rq_db_phy_addr.hi = 1765 1765 req2->rq_page_table_addr_hi; 1766 1766 ictx->tstorm_st_context.iscsi.iscsi_conn_id = req1->iscsi_conn_id; ··· 1842 1842 /* CSTORM and USTORM initialization is different, CSTORM requires 1843 1843 * CQ DB base & not PTE addr */ 1844 1844 ictx->cstorm_st_context.cq_db_base.lo = 1845 - req1->cq_page_table_addr_lo & PAGE_MASK; 1845 + req1->cq_page_table_addr_lo & CNIC_PAGE_MASK; 1846 1846 ictx->cstorm_st_context.cq_db_base.hi = req1->cq_page_table_addr_hi; 1847 1847 ictx->cstorm_st_context.iscsi_conn_id = req1->iscsi_conn_id; 1848 1848 ictx->cstorm_st_context.cq_proc_en_bit_map = (1 << cp->num_cqs) - 1; ··· 2911 2911 u16 hw_cons, sw_cons; 2912 2912 struct cnic_uio_dev *udev = cp->udev; 2913 2913 union eth_rx_cqe *cqe, *cqe_ring = (union eth_rx_cqe *) 2914 - (udev->l2_ring + (2 * BNX2_PAGE_SIZE)); 2914 + (udev->l2_ring + (2 * CNIC_PAGE_SIZE)); 2915 2915 u32 cmd; 2916 2916 int comp = 0; 2917 2917 ··· 3244 3244 int rc; 3245 3245 3246 3246 mutex_lock(&cnic_lock); 3247 - ulp_ops = cnic_ulp_tbl_prot(ulp_type); 3247 + ulp_ops = rcu_dereference_protected(cp->ulp_ops[ulp_type], 3248 + lockdep_is_held(&cnic_lock)); 3248 3249 if (ulp_ops && ulp_ops->cnic_get_stats) 3249 3250 rc = ulp_ops->cnic_get_stats(cp->ulp_handle[ulp_type]); 3250 3251 else ··· 4385 4384 u32 idx = cp->ctx_arr[i].cid / cp->cids_per_blk; 4386 4385 u32 val; 4387 4386 4388 - memset(cp->ctx_arr[i].ctx, 0, BNX2_PAGE_SIZE); 4387 + memset(cp->ctx_arr[i].ctx, 0, CNIC_PAGE_SIZE); 4389 4388 4390 4389 CNIC_WR(dev, BNX2_CTX_HOST_PAGE_TBL_DATA0, 4391 4390 (cp->ctx_arr[i].mapping & 0xffffffff) | valid_bit); ··· 4629 4628 val = BNX2_L2CTX_L2_STATUSB_NUM(sb_id); 4630 4629 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_HOST_BDIDX, val); 4631 4630 4632 - rxbd = udev->l2_ring + BNX2_PAGE_SIZE; 4631 + rxbd = udev->l2_ring + CNIC_PAGE_SIZE; 4633 4632 for (i = 0; i < BNX2_MAX_RX_DESC_CNT; i++, rxbd++) { 4634 4633 dma_addr_t buf_map; 4635 4634 int n = (i % cp->l2_rx_ring_size) + 1; ··· 4640 4639 rxbd->rx_bd_haddr_hi = (u64) buf_map >> 32; 4641 4640 rxbd->rx_bd_haddr_lo = (u64) buf_map & 0xffffffff; 4642 4641 } 4643 - val = (u64) (ring_map + BNX2_PAGE_SIZE) >> 32; 4642 + val = (u64) (ring_map + CNIC_PAGE_SIZE) >> 32; 4644 4643 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_NX_BDHADDR_HI, val); 4645 4644 rxbd->rx_bd_haddr_hi = val; 4646 4645 4647 - val = (u64) (ring_map + BNX2_PAGE_SIZE) & 0xffffffff; 4646 + val = (u64) (ring_map + CNIC_PAGE_SIZE) & 0xffffffff; 4648 4647 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_NX_BDHADDR_LO, val); 4649 4648 rxbd->rx_bd_haddr_lo = val; 4650 4649 ··· 4710 4709 4711 4710 val = CNIC_RD(dev, BNX2_MQ_CONFIG); 4712 4711 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE; 4713 - if (BNX2_PAGE_BITS > 12) 4712 + if (CNIC_PAGE_BITS > 12) 4714 4713 val |= (12 - 8) << 4; 4715 4714 else 4716 - val |= (BNX2_PAGE_BITS - 8) << 4; 4715 + val |= (CNIC_PAGE_BITS - 8) << 4; 4717 4716 4718 4717 CNIC_WR(dev, BNX2_MQ_CONFIG, val); 4719 4718 ··· 4743 4742 4744 4743 /* Initialize the kernel work queue context. */ 4745 4744 val = KRNLQ_TYPE_TYPE_KRNLQ | KRNLQ_SIZE_TYPE_SIZE | 4746 - (BNX2_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4745 + (CNIC_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4747 4746 cnic_ctx_wr(dev, kwq_cid_addr, L5_KRNLQ_TYPE, val); 4748 4747 4749 - val = (BNX2_PAGE_SIZE / sizeof(struct kwqe) - 1) << 16; 4748 + val = (CNIC_PAGE_SIZE / sizeof(struct kwqe) - 1) << 16; 4750 4749 cnic_ctx_wr(dev, kwq_cid_addr, L5_KRNLQ_QE_SELF_SEQ_MAX, val); 4751 4750 4752 - val = ((BNX2_PAGE_SIZE / sizeof(struct kwqe)) << 16) | KWQ_PAGE_CNT; 4751 + val = ((CNIC_PAGE_SIZE / sizeof(struct kwqe)) << 16) | KWQ_PAGE_CNT; 4753 4752 cnic_ctx_wr(dev, kwq_cid_addr, L5_KRNLQ_PGTBL_NPAGES, val); 4754 4753 4755 4754 val = (u32) ((u64) cp->kwq_info.pgtbl_map >> 32); ··· 4769 4768 4770 4769 /* Initialize the kernel complete queue context. */ 4771 4770 val = KRNLQ_TYPE_TYPE_KRNLQ | KRNLQ_SIZE_TYPE_SIZE | 4772 - (BNX2_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4771 + (CNIC_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4773 4772 cnic_ctx_wr(dev, kcq_cid_addr, L5_KRNLQ_TYPE, val); 4774 4773 4775 - val = (BNX2_PAGE_SIZE / sizeof(struct kcqe) - 1) << 16; 4774 + val = (CNIC_PAGE_SIZE / sizeof(struct kcqe) - 1) << 16; 4776 4775 cnic_ctx_wr(dev, kcq_cid_addr, L5_KRNLQ_QE_SELF_SEQ_MAX, val); 4777 4776 4778 - val = ((BNX2_PAGE_SIZE / sizeof(struct kcqe)) << 16) | KCQ_PAGE_CNT; 4777 + val = ((CNIC_PAGE_SIZE / sizeof(struct kcqe)) << 16) | KCQ_PAGE_CNT; 4779 4778 cnic_ctx_wr(dev, kcq_cid_addr, L5_KRNLQ_PGTBL_NPAGES, val); 4780 4779 4781 4780 val = (u32) ((u64) cp->kcq1.dma.pgtbl_map >> 32); ··· 4919 4918 u32 cli = cp->ethdev->iscsi_l2_client_id; 4920 4919 u32 val; 4921 4920 4922 - memset(txbd, 0, BNX2_PAGE_SIZE); 4921 + memset(txbd, 0, CNIC_PAGE_SIZE); 4923 4922 4924 4923 buf_map = udev->l2_buf_map; 4925 4924 for (i = 0; i < BNX2_MAX_TX_DESC_CNT; i += 3, txbd += 3) { ··· 4979 4978 struct bnx2x *bp = netdev_priv(dev->netdev); 4980 4979 struct cnic_uio_dev *udev = cp->udev; 4981 4980 struct eth_rx_bd *rxbd = (struct eth_rx_bd *) (udev->l2_ring + 4982 - BNX2_PAGE_SIZE); 4981 + CNIC_PAGE_SIZE); 4983 4982 struct eth_rx_cqe_next_page *rxcqe = (struct eth_rx_cqe_next_page *) 4984 - (udev->l2_ring + (2 * BNX2_PAGE_SIZE)); 4983 + (udev->l2_ring + (2 * CNIC_PAGE_SIZE)); 4985 4984 struct host_sp_status_block *sb = cp->bnx2x_def_status_blk; 4986 4985 int i; 4987 4986 u32 cli = cp->ethdev->iscsi_l2_client_id; ··· 5005 5004 rxbd->addr_lo = cpu_to_le32(buf_map & 0xffffffff); 5006 5005 } 5007 5006 5008 - val = (u64) (ring_map + BNX2_PAGE_SIZE) >> 32; 5007 + val = (u64) (ring_map + CNIC_PAGE_SIZE) >> 32; 5009 5008 rxbd->addr_hi = cpu_to_le32(val); 5010 5009 data->rx.bd_page_base.hi = cpu_to_le32(val); 5011 5010 5012 - val = (u64) (ring_map + BNX2_PAGE_SIZE) & 0xffffffff; 5011 + val = (u64) (ring_map + CNIC_PAGE_SIZE) & 0xffffffff; 5013 5012 rxbd->addr_lo = cpu_to_le32(val); 5014 5013 data->rx.bd_page_base.lo = cpu_to_le32(val); 5015 5014 5016 5015 rxcqe += BNX2X_MAX_RCQ_DESC_CNT; 5017 - val = (u64) (ring_map + (2 * BNX2_PAGE_SIZE)) >> 32; 5016 + val = (u64) (ring_map + (2 * CNIC_PAGE_SIZE)) >> 32; 5018 5017 rxcqe->addr_hi = cpu_to_le32(val); 5019 5018 data->rx.cqe_page_base.hi = cpu_to_le32(val); 5020 5019 5021 - val = (u64) (ring_map + (2 * BNX2_PAGE_SIZE)) & 0xffffffff; 5020 + val = (u64) (ring_map + (2 * CNIC_PAGE_SIZE)) & 0xffffffff; 5022 5021 rxcqe->addr_lo = cpu_to_le32(val); 5023 5022 data->rx.cqe_page_base.lo = cpu_to_le32(val); 5024 5023 ··· 5266 5265 msleep(10); 5267 5266 } 5268 5267 clear_bit(CNIC_LCL_FL_RINGS_INITED, &cp->cnic_local_flags); 5269 - rx_ring = udev->l2_ring + BNX2_PAGE_SIZE; 5270 - memset(rx_ring, 0, BNX2_PAGE_SIZE); 5268 + rx_ring = udev->l2_ring + CNIC_PAGE_SIZE; 5269 + memset(rx_ring, 0, CNIC_PAGE_SIZE); 5271 5270 } 5272 5271 5273 5272 static int cnic_register_netdev(struct cnic_dev *dev)
+1 -1
drivers/net/ethernet/broadcom/cnic.h
··· 1 1 /* cnic.h: Broadcom CNIC core network driver. 2 2 * 3 - * Copyright (c) 2006-2013 Broadcom Corporation 3 + * Copyright (c) 2006-2014 Broadcom Corporation 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify 6 6 * it under the terms of the GNU General Public License as published by
+1 -1
drivers/net/ethernet/broadcom/cnic_defs.h
··· 1 1 2 2 /* cnic.c: Broadcom CNIC core network driver. 3 3 * 4 - * Copyright (c) 2006-2013 Broadcom Corporation 4 + * Copyright (c) 2006-2014 Broadcom Corporation 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by
+13 -3
drivers/net/ethernet/broadcom/cnic_if.h
··· 1 1 /* cnic_if.h: Broadcom CNIC core network driver. 2 2 * 3 - * Copyright (c) 2006-2013 Broadcom Corporation 3 + * Copyright (c) 2006-2014 Broadcom Corporation 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify 6 6 * it under the terms of the GNU General Public License as published by ··· 14 14 15 15 #include "bnx2x/bnx2x_mfw_req.h" 16 16 17 - #define CNIC_MODULE_VERSION "2.5.19" 18 - #define CNIC_MODULE_RELDATE "December 19, 2013" 17 + #define CNIC_MODULE_VERSION "2.5.20" 18 + #define CNIC_MODULE_RELDATE "March 14, 2014" 19 19 20 20 #define CNIC_ULP_RDMA 0 21 21 #define CNIC_ULP_ISCSI 1 ··· 23 23 #define CNIC_ULP_L4 3 24 24 #define MAX_CNIC_ULP_TYPE_EXT 3 25 25 #define MAX_CNIC_ULP_TYPE 4 26 + 27 + /* Use CPU native page size up to 16K for cnic ring sizes. */ 28 + #if (PAGE_SHIFT > 14) 29 + #define CNIC_PAGE_BITS 14 30 + #else 31 + #define CNIC_PAGE_BITS PAGE_SHIFT 32 + #endif 33 + #define CNIC_PAGE_SIZE (1 << (CNIC_PAGE_BITS)) 34 + #define CNIC_PAGE_ALIGN(addr) ALIGN(addr, CNIC_PAGE_SIZE) 35 + #define CNIC_PAGE_MASK (~((CNIC_PAGE_SIZE) - 1)) 26 36 27 37 struct kwqe { 28 38 u32 kwqe_op_flag;
+29 -1
drivers/net/ethernet/micrel/ks8851.c
··· 23 23 #include <linux/crc32.h> 24 24 #include <linux/mii.h> 25 25 #include <linux/eeprom_93cx6.h> 26 + #include <linux/regulator/consumer.h> 26 27 27 28 #include <linux/spi/spi.h> 28 29 ··· 84 83 * @rc_rxqcr: Cached copy of KS_RXQCR. 85 84 * @eeprom_size: Companion eeprom size in Bytes, 0 if no eeprom 86 85 * @eeprom: 93CX6 EEPROM state for accessing on-board EEPROM. 86 + * @vdd_reg: Optional regulator supplying the chip 87 87 * 88 88 * The @lock ensures that the chip is protected when certain operations are 89 89 * in progress. When the read or write packet transfer is in progress, most ··· 132 130 struct spi_transfer spi_xfer2[2]; 133 131 134 132 struct eeprom_93cx6 eeprom; 133 + struct regulator *vdd_reg; 135 134 }; 136 135 137 136 static int msg_enable; ··· 1417 1414 ks->spidev = spi; 1418 1415 ks->tx_space = 6144; 1419 1416 1417 + ks->vdd_reg = regulator_get_optional(&spi->dev, "vdd"); 1418 + if (IS_ERR(ks->vdd_reg)) { 1419 + ret = PTR_ERR(ks->vdd_reg); 1420 + if (ret == -EPROBE_DEFER) 1421 + goto err_reg; 1422 + } else { 1423 + ret = regulator_enable(ks->vdd_reg); 1424 + if (ret) { 1425 + dev_err(&spi->dev, "regulator enable fail: %d\n", 1426 + ret); 1427 + goto err_reg_en; 1428 + } 1429 + } 1430 + 1431 + 1420 1432 mutex_init(&ks->lock); 1421 1433 spin_lock_init(&ks->statelock); 1422 1434 ··· 1526 1508 err_netdev: 1527 1509 free_irq(ndev->irq, ks); 1528 1510 1529 - err_id: 1530 1511 err_irq: 1512 + err_id: 1513 + if (!IS_ERR(ks->vdd_reg)) 1514 + regulator_disable(ks->vdd_reg); 1515 + err_reg_en: 1516 + if (!IS_ERR(ks->vdd_reg)) 1517 + regulator_put(ks->vdd_reg); 1518 + err_reg: 1531 1519 free_netdev(ndev); 1532 1520 return ret; 1533 1521 } ··· 1547 1523 1548 1524 unregister_netdev(priv->netdev); 1549 1525 free_irq(spi->irq, priv); 1526 + if (!IS_ERR(priv->vdd_reg)) { 1527 + regulator_disable(priv->vdd_reg); 1528 + regulator_put(priv->vdd_reg); 1529 + } 1550 1530 free_netdev(priv->netdev); 1551 1531 1552 1532 return 0;
-4
drivers/net/ethernet/ti/cpsw.c
··· 2217 2217 goto clean_ale_ret; 2218 2218 } 2219 2219 2220 - if (cpts_register(&pdev->dev, priv->cpts, 2221 - data->cpts_clock_mult, data->cpts_clock_shift)) 2222 - dev_err(priv->dev, "error registering cpts device\n"); 2223 - 2224 2220 cpsw_notice(priv, probe, "initialized device (regs %pa, irq %d)\n", 2225 2221 &ss_res->start, ndev->irq); 2226 2222
+2 -2
drivers/net/ethernet/ti/davinci_cpdma.c
··· 355 355 int i; 356 356 357 357 spin_lock_irqsave(&ctlr->lock, flags); 358 - if (ctlr->state != CPDMA_STATE_ACTIVE) { 358 + if (ctlr->state == CPDMA_STATE_TEARDOWN) { 359 359 spin_unlock_irqrestore(&ctlr->lock, flags); 360 360 return -EINVAL; 361 361 } ··· 891 891 unsigned timeout; 892 892 893 893 spin_lock_irqsave(&chan->lock, flags); 894 - if (chan->state != CPDMA_STATE_ACTIVE) { 894 + if (chan->state == CPDMA_STATE_TEARDOWN) { 895 895 spin_unlock_irqrestore(&chan->lock, flags); 896 896 return -EINVAL; 897 897 }
+42 -11
drivers/net/ethernet/ti/davinci_emac.c
··· 1532 1532 struct device *emac_dev = &ndev->dev; 1533 1533 u32 cnt; 1534 1534 struct resource *res; 1535 - int ret; 1535 + int q, m, ret; 1536 + int res_num = 0, irq_num = 0; 1536 1537 int i = 0; 1537 - int k = 0; 1538 1538 struct emac_priv *priv = netdev_priv(ndev); 1539 1539 1540 1540 pm_runtime_get(&priv->pdev->dev); ··· 1564 1564 } 1565 1565 1566 1566 /* Request IRQ */ 1567 + while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, 1568 + res_num))) { 1569 + for (irq_num = res->start; irq_num <= res->end; irq_num++) { 1570 + dev_err(emac_dev, "Request IRQ %d\n", irq_num); 1571 + if (request_irq(irq_num, emac_irq, 0, ndev->name, 1572 + ndev)) { 1573 + dev_err(emac_dev, 1574 + "DaVinci EMAC: request_irq() failed\n"); 1575 + ret = -EBUSY; 1567 1576 1568 - while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) { 1569 - for (i = res->start; i <= res->end; i++) { 1570 - if (devm_request_irq(&priv->pdev->dev, i, emac_irq, 1571 - 0, ndev->name, ndev)) 1572 1577 goto rollback; 1578 + } 1573 1579 } 1574 - k++; 1580 + res_num++; 1575 1581 } 1582 + /* prepare counters for rollback in case of an error */ 1583 + res_num--; 1584 + irq_num--; 1576 1585 1577 1586 /* Start/Enable EMAC hardware */ 1578 1587 emac_hw_enable(priv); ··· 1648 1639 1649 1640 return 0; 1650 1641 1651 - rollback: 1652 - 1653 - dev_err(emac_dev, "DaVinci EMAC: devm_request_irq() failed"); 1654 - ret = -EBUSY; 1655 1642 err: 1643 + emac_int_disable(priv); 1644 + napi_disable(&priv->napi); 1645 + 1646 + rollback: 1647 + for (q = res_num; q >= 0; q--) { 1648 + res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, q); 1649 + /* at the first iteration, irq_num is already set to the 1650 + * right value 1651 + */ 1652 + if (q != res_num) 1653 + irq_num = res->end; 1654 + 1655 + for (m = irq_num; m >= res->start; m--) 1656 + free_irq(m, ndev); 1657 + } 1658 + cpdma_ctlr_stop(priv->dma); 1656 1659 pm_runtime_put(&priv->pdev->dev); 1657 1660 return ret; 1658 1661 } ··· 1680 1659 */ 1681 1660 static int emac_dev_stop(struct net_device *ndev) 1682 1661 { 1662 + struct resource *res; 1663 + int i = 0; 1664 + int irq_num; 1683 1665 struct emac_priv *priv = netdev_priv(ndev); 1684 1666 struct device *emac_dev = &ndev->dev; 1685 1667 ··· 1697 1673 1698 1674 if (priv->phydev) 1699 1675 phy_disconnect(priv->phydev); 1676 + 1677 + /* Free IRQ */ 1678 + while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, i))) { 1679 + for (irq_num = res->start; irq_num <= res->end; irq_num++) 1680 + free_irq(irq_num, priv->ndev); 1681 + i++; 1682 + } 1700 1683 1701 1684 if (netif_msg_drv(priv)) 1702 1685 dev_notice(emac_dev, "DaVinci EMAC: %s stopped\n", ndev->name);
+5 -3
drivers/net/ethernet/via/via-rhine.c
··· 923 923 if (rc) { 924 924 dev_err(&pdev->dev, 925 925 "32-bit PCI DMA addresses not supported by the card!?\n"); 926 - goto err_out; 926 + goto err_out_pci_disable; 927 927 } 928 928 929 929 /* sanity check */ ··· 931 931 (pci_resource_len(pdev, 1) < io_size)) { 932 932 rc = -EIO; 933 933 dev_err(&pdev->dev, "Insufficient PCI resources, aborting\n"); 934 - goto err_out; 934 + goto err_out_pci_disable; 935 935 } 936 936 937 937 pioaddr = pci_resource_start(pdev, 0); ··· 942 942 dev = alloc_etherdev(sizeof(struct rhine_private)); 943 943 if (!dev) { 944 944 rc = -ENOMEM; 945 - goto err_out; 945 + goto err_out_pci_disable; 946 946 } 947 947 SET_NETDEV_DEV(dev, &pdev->dev); 948 948 ··· 1084 1084 pci_release_regions(pdev); 1085 1085 err_out_free_netdev: 1086 1086 free_netdev(dev); 1087 + err_out_pci_disable: 1088 + pci_disable_device(pdev); 1087 1089 err_out: 1088 1090 return rc; 1089 1091 }
+1 -2
drivers/net/phy/phy_device.c
··· 684 684 int phy_suspend(struct phy_device *phydev) 685 685 { 686 686 struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); 687 - struct ethtool_wolinfo wol; 687 + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; 688 688 689 689 /* If the device has WOL enabled, we cannot suspend the PHY */ 690 - wol.cmd = ETHTOOL_GWOL; 691 690 phy_ethtool_get_wol(phydev, &wol); 692 691 if (wol.wolopts) 693 692 return -EBUSY;
+23 -25
drivers/net/usb/cdc_ncm.c
··· 68 68 static int cdc_ncm_setup(struct usbnet *dev) 69 69 { 70 70 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; 71 - struct usb_cdc_ncm_ntb_parameters ncm_parm; 72 71 u32 val; 73 72 u8 flags; 74 73 u8 iface_no; ··· 82 83 err = usbnet_read_cmd(dev, USB_CDC_GET_NTB_PARAMETERS, 83 84 USB_TYPE_CLASS | USB_DIR_IN 84 85 |USB_RECIP_INTERFACE, 85 - 0, iface_no, &ncm_parm, 86 - sizeof(ncm_parm)); 86 + 0, iface_no, &ctx->ncm_parm, 87 + sizeof(ctx->ncm_parm)); 87 88 if (err < 0) { 88 89 dev_err(&dev->intf->dev, "failed GET_NTB_PARAMETERS\n"); 89 90 return err; /* GET_NTB_PARAMETERS is required */ 90 91 } 91 92 92 93 /* read correct set of parameters according to device mode */ 93 - ctx->rx_max = le32_to_cpu(ncm_parm.dwNtbInMaxSize); 94 - ctx->tx_max = le32_to_cpu(ncm_parm.dwNtbOutMaxSize); 95 - ctx->tx_remainder = le16_to_cpu(ncm_parm.wNdpOutPayloadRemainder); 96 - ctx->tx_modulus = le16_to_cpu(ncm_parm.wNdpOutDivisor); 97 - ctx->tx_ndp_modulus = le16_to_cpu(ncm_parm.wNdpOutAlignment); 94 + ctx->rx_max = le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize); 95 + ctx->tx_max = le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize); 96 + ctx->tx_remainder = le16_to_cpu(ctx->ncm_parm.wNdpOutPayloadRemainder); 97 + ctx->tx_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutDivisor); 98 + ctx->tx_ndp_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutAlignment); 98 99 /* devices prior to NCM Errata shall set this field to zero */ 99 - ctx->tx_max_datagrams = le16_to_cpu(ncm_parm.wNtbOutMaxDatagrams); 100 - ntb_fmt_supported = le16_to_cpu(ncm_parm.bmNtbFormatsSupported); 100 + ctx->tx_max_datagrams = le16_to_cpu(ctx->ncm_parm.wNtbOutMaxDatagrams); 101 + ntb_fmt_supported = le16_to_cpu(ctx->ncm_parm.bmNtbFormatsSupported); 101 102 102 103 /* there are some minor differences in NCM and MBIM defaults */ 103 104 if (cdc_ncm_comm_intf_is_mbim(ctx->control->cur_altsetting)) { ··· 146 147 } 147 148 148 149 /* inform device about NTB input size changes */ 149 - if (ctx->rx_max != le32_to_cpu(ncm_parm.dwNtbInMaxSize)) { 150 + if (ctx->rx_max != le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)) { 150 151 __le32 dwNtbInMaxSize = cpu_to_le32(ctx->rx_max); 151 152 152 153 err = usbnet_write_cmd(dev, USB_CDC_SET_NTB_INPUT_SIZE, ··· 162 163 dev_dbg(&dev->intf->dev, "Using default maximum transmit length=%d\n", 163 164 CDC_NCM_NTB_MAX_SIZE_TX); 164 165 ctx->tx_max = CDC_NCM_NTB_MAX_SIZE_TX; 165 - 166 - /* Adding a pad byte here simplifies the handling in 167 - * cdc_ncm_fill_tx_frame, by making tx_max always 168 - * represent the real skb max size. 169 - */ 170 - if (ctx->tx_max % usb_maxpacket(dev->udev, dev->out, 1) == 0) 171 - ctx->tx_max++; 172 - 173 166 } 174 167 175 168 /* ··· 447 456 goto error2; 448 457 } 449 458 459 + /* initialize data interface */ 460 + if (cdc_ncm_setup(dev)) 461 + goto error2; 462 + 450 463 /* configure data interface */ 451 464 temp = usb_set_interface(dev->udev, iface_no, data_altsetting); 452 465 if (temp) { ··· 462 467 cdc_ncm_find_endpoints(dev, ctx->control); 463 468 if (!dev->in || !dev->out || !dev->status) { 464 469 dev_dbg(&intf->dev, "failed to collect endpoints\n"); 465 - goto error2; 466 - } 467 - 468 - /* initialize data interface */ 469 - if (cdc_ncm_setup(dev)) { 470 - dev_dbg(&intf->dev, "cdc_ncm_setup() failed\n"); 471 470 goto error2; 472 471 } 473 472 ··· 480 491 /* usbnet use these values for sizing tx/rx queues */ 481 492 dev->hard_mtu = ctx->tx_max; 482 493 dev->rx_urb_size = ctx->rx_max; 494 + 495 + /* cdc_ncm_setup will override dwNtbOutMaxSize if it is 496 + * outside the sane range. Adding a pad byte here if necessary 497 + * simplifies the handling in cdc_ncm_fill_tx_frame, making 498 + * tx_max always represent the real skb max size. 499 + */ 500 + if (ctx->tx_max != le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize) && 501 + ctx->tx_max % usb_maxpacket(dev->udev, dev->out, 1) == 0) 502 + ctx->tx_max++; 483 503 484 504 return 0; 485 505
+116 -14
drivers/net/vxlan.c
··· 1315 1315 1316 1316 neigh_release(n); 1317 1317 1318 + if (reply == NULL) 1319 + goto out; 1320 + 1318 1321 skb_reset_mac_header(reply); 1319 1322 __skb_pull(reply, skb_network_offset(reply)); 1320 1323 reply->ip_summed = CHECKSUM_UNNECESSARY; ··· 1339 1336 } 1340 1337 1341 1338 #if IS_ENABLED(CONFIG_IPV6) 1339 + 1340 + static struct sk_buff *vxlan_na_create(struct sk_buff *request, 1341 + struct neighbour *n, bool isrouter) 1342 + { 1343 + struct net_device *dev = request->dev; 1344 + struct sk_buff *reply; 1345 + struct nd_msg *ns, *na; 1346 + struct ipv6hdr *pip6; 1347 + u8 *daddr; 1348 + int na_olen = 8; /* opt hdr + ETH_ALEN for target */ 1349 + int ns_olen; 1350 + int i, len; 1351 + 1352 + if (dev == NULL) 1353 + return NULL; 1354 + 1355 + len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) + 1356 + sizeof(*na) + na_olen + dev->needed_tailroom; 1357 + reply = alloc_skb(len, GFP_ATOMIC); 1358 + if (reply == NULL) 1359 + return NULL; 1360 + 1361 + reply->protocol = htons(ETH_P_IPV6); 1362 + reply->dev = dev; 1363 + skb_reserve(reply, LL_RESERVED_SPACE(request->dev)); 1364 + skb_push(reply, sizeof(struct ethhdr)); 1365 + skb_set_mac_header(reply, 0); 1366 + 1367 + ns = (struct nd_msg *)skb_transport_header(request); 1368 + 1369 + daddr = eth_hdr(request)->h_source; 1370 + ns_olen = request->len - skb_transport_offset(request) - sizeof(*ns); 1371 + for (i = 0; i < ns_olen-1; i += (ns->opt[i+1]<<3)) { 1372 + if (ns->opt[i] == ND_OPT_SOURCE_LL_ADDR) { 1373 + daddr = ns->opt + i + sizeof(struct nd_opt_hdr); 1374 + break; 1375 + } 1376 + } 1377 + 1378 + /* Ethernet header */ 1379 + ether_addr_copy(eth_hdr(reply)->h_dest, daddr); 1380 + ether_addr_copy(eth_hdr(reply)->h_source, n->ha); 1381 + eth_hdr(reply)->h_proto = htons(ETH_P_IPV6); 1382 + reply->protocol = htons(ETH_P_IPV6); 1383 + 1384 + skb_pull(reply, sizeof(struct ethhdr)); 1385 + skb_set_network_header(reply, 0); 1386 + skb_put(reply, sizeof(struct ipv6hdr)); 1387 + 1388 + /* IPv6 header */ 1389 + 1390 + pip6 = ipv6_hdr(reply); 1391 + memset(pip6, 0, sizeof(struct ipv6hdr)); 1392 + pip6->version = 6; 1393 + pip6->priority = ipv6_hdr(request)->priority; 1394 + pip6->nexthdr = IPPROTO_ICMPV6; 1395 + pip6->hop_limit = 255; 1396 + pip6->daddr = ipv6_hdr(request)->saddr; 1397 + pip6->saddr = *(struct in6_addr *)n->primary_key; 1398 + 1399 + skb_pull(reply, sizeof(struct ipv6hdr)); 1400 + skb_set_transport_header(reply, 0); 1401 + 1402 + na = (struct nd_msg *)skb_put(reply, sizeof(*na) + na_olen); 1403 + 1404 + /* Neighbor Advertisement */ 1405 + memset(na, 0, sizeof(*na)+na_olen); 1406 + na->icmph.icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT; 1407 + na->icmph.icmp6_router = isrouter; 1408 + na->icmph.icmp6_override = 1; 1409 + na->icmph.icmp6_solicited = 1; 1410 + na->target = ns->target; 1411 + ether_addr_copy(&na->opt[2], n->ha); 1412 + na->opt[0] = ND_OPT_TARGET_LL_ADDR; 1413 + na->opt[1] = na_olen >> 3; 1414 + 1415 + na->icmph.icmp6_cksum = csum_ipv6_magic(&pip6->saddr, 1416 + &pip6->daddr, sizeof(*na)+na_olen, IPPROTO_ICMPV6, 1417 + csum_partial(na, sizeof(*na)+na_olen, 0)); 1418 + 1419 + pip6->payload_len = htons(sizeof(*na)+na_olen); 1420 + 1421 + skb_push(reply, sizeof(struct ipv6hdr)); 1422 + 1423 + reply->ip_summed = CHECKSUM_UNNECESSARY; 1424 + 1425 + return reply; 1426 + } 1427 + 1342 1428 static int neigh_reduce(struct net_device *dev, struct sk_buff *skb) 1343 1429 { 1344 1430 struct vxlan_dev *vxlan = netdev_priv(dev); 1345 - struct neighbour *n; 1346 - union vxlan_addr ipa; 1431 + struct nd_msg *msg; 1347 1432 const struct ipv6hdr *iphdr; 1348 1433 const struct in6_addr *saddr, *daddr; 1349 - struct nd_msg *msg; 1350 - struct inet6_dev *in6_dev = NULL; 1434 + struct neighbour *n; 1435 + struct inet6_dev *in6_dev; 1351 1436 1352 1437 in6_dev = __in6_dev_get(dev); 1353 1438 if (!in6_dev) ··· 1448 1357 saddr = &iphdr->saddr; 1449 1358 daddr = &iphdr->daddr; 1450 1359 1451 - if (ipv6_addr_loopback(daddr) || 1452 - ipv6_addr_is_multicast(daddr)) 1453 - goto out; 1454 - 1455 1360 msg = (struct nd_msg *)skb_transport_header(skb); 1456 1361 if (msg->icmph.icmp6_code != 0 || 1457 1362 msg->icmph.icmp6_type != NDISC_NEIGHBOUR_SOLICITATION) 1458 1363 goto out; 1459 1364 1460 - n = neigh_lookup(ipv6_stub->nd_tbl, daddr, dev); 1365 + if (ipv6_addr_loopback(daddr) || 1366 + ipv6_addr_is_multicast(&msg->target)) 1367 + goto out; 1368 + 1369 + n = neigh_lookup(ipv6_stub->nd_tbl, &msg->target, dev); 1461 1370 1462 1371 if (n) { 1463 1372 struct vxlan_fdb *f; 1373 + struct sk_buff *reply; 1464 1374 1465 1375 if (!(n->nud_state & NUD_CONNECTED)) { 1466 1376 neigh_release(n); ··· 1475 1383 goto out; 1476 1384 } 1477 1385 1478 - ipv6_stub->ndisc_send_na(dev, n, saddr, &msg->target, 1479 - !!in6_dev->cnf.forwarding, 1480 - true, false, false); 1386 + reply = vxlan_na_create(skb, n, 1387 + !!(f ? f->flags & NTF_ROUTER : 0)); 1388 + 1481 1389 neigh_release(n); 1390 + 1391 + if (reply == NULL) 1392 + goto out; 1393 + 1394 + if (netif_rx_ni(reply) == NET_RX_DROP) 1395 + dev->stats.rx_dropped++; 1396 + 1482 1397 } else if (vxlan->flags & VXLAN_F_L3MISS) { 1483 - ipa.sin6.sin6_addr = *daddr; 1484 - ipa.sa.sa_family = AF_INET6; 1398 + union vxlan_addr ipa = { 1399 + .sin6.sin6_addr = msg->target, 1400 + .sa.sa_family = AF_INET6, 1401 + }; 1402 + 1485 1403 vxlan_ip_miss(dev, &ipa); 1486 1404 } 1487 1405
+1 -2
drivers/net/wireless/ath/ath9k/hw.c
··· 1547 1547 if (reg != last_val) 1548 1548 return true; 1549 1549 1550 + udelay(1); 1550 1551 last_val = reg; 1551 1552 if ((reg & 0x7E7FFFEF) == 0x00702400) 1552 1553 continue; ··· 1560 1559 default: 1561 1560 return true; 1562 1561 } 1563 - 1564 - udelay(1); 1565 1562 } while (count-- > 0); 1566 1563 1567 1564 return false;
+2 -2
drivers/net/wireless/ath/ath9k/xmit.c
··· 2065 2065 2066 2066 ATH_TXBUF_RESET(bf); 2067 2067 2068 - if (tid) { 2068 + if (tid && ieee80211_is_data_present(hdr->frame_control)) { 2069 2069 fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; 2070 2070 seqno = tid->seq_next; 2071 2071 hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); ··· 2188 2188 txq->stopped = true; 2189 2189 } 2190 2190 2191 - if (txctl->an) 2191 + if (txctl->an && ieee80211_is_data_present(hdr->frame_control)) 2192 2192 tid = ath_get_skb_tid(sc, txctl->an, skb); 2193 2193 2194 2194 if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
+3 -1
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
··· 2140 2140 if (pkt_pad == NULL) 2141 2141 return -ENOMEM; 2142 2142 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad); 2143 - if (unlikely(ret < 0)) 2143 + if (unlikely(ret < 0)) { 2144 + kfree_skb(pkt_pad); 2144 2145 return ret; 2146 + } 2145 2147 memcpy(pkt_pad->data, 2146 2148 pkt->data + pkt->len - tail_chop, 2147 2149 tail_chop);
+3 -3
drivers/net/wireless/rt2x00/rt2800lib.c
··· 5460 5460 5461 5461 rt2800_bbp_write(rt2x00dev, 68, 0x0b); 5462 5462 5463 - rt2800_bbp_write(rt2x00dev, 69, 0x0d); 5464 - rt2800_bbp_write(rt2x00dev, 70, 0x06); 5463 + rt2800_bbp_write(rt2x00dev, 69, 0x12); 5465 5464 rt2800_bbp_write(rt2x00dev, 73, 0x13); 5466 5465 rt2800_bbp_write(rt2x00dev, 75, 0x46); 5467 5466 rt2800_bbp_write(rt2x00dev, 76, 0x28); 5468 5467 5469 5468 rt2800_bbp_write(rt2x00dev, 77, 0x59); 5469 + 5470 + rt2800_bbp_write(rt2x00dev, 70, 0x0a); 5470 5471 5471 5472 rt2800_bbp_write(rt2x00dev, 79, 0x13); 5472 5473 rt2800_bbp_write(rt2x00dev, 80, 0x05); ··· 5511 5510 if (rt2x00_rt(rt2x00dev, RT5392)) { 5512 5511 rt2800_bbp_write(rt2x00dev, 134, 0xd0); 5513 5512 rt2800_bbp_write(rt2x00dev, 135, 0xf6); 5514 - rt2800_bbp_write(rt2x00dev, 148, 0x84); 5515 5513 } 5516 5514 5517 5515 rt2800_disable_unused_dac_adc(rt2x00dev);
+1 -1
drivers/scsi/be2iscsi/be_main.c
··· 325 325 if (!abrt_task->sc || abrt_task->state == ISCSI_TASK_FREE) 326 326 continue; 327 327 328 - if (abrt_task->sc->device->lun != abrt_task->sc->device->lun) 328 + if (sc->device->lun != abrt_task->sc->device->lun) 329 329 continue; 330 330 331 331 /* Invalidate WRB Posted for this Task */
+8 -8
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 594 594 mp_req->mp_resp_bd = NULL; 595 595 } 596 596 if (mp_req->req_buf) { 597 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 597 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 598 598 mp_req->req_buf, 599 599 mp_req->req_buf_dma); 600 600 mp_req->req_buf = NULL; 601 601 } 602 602 if (mp_req->resp_buf) { 603 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 603 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 604 604 mp_req->resp_buf, 605 605 mp_req->resp_buf_dma); 606 606 mp_req->resp_buf = NULL; ··· 622 622 623 623 mp_req->req_len = sizeof(struct fcp_cmnd); 624 624 io_req->data_xfer_len = mp_req->req_len; 625 - mp_req->req_buf = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 625 + mp_req->req_buf = dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 626 626 &mp_req->req_buf_dma, 627 627 GFP_ATOMIC); 628 628 if (!mp_req->req_buf) { ··· 631 631 return FAILED; 632 632 } 633 633 634 - mp_req->resp_buf = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 634 + mp_req->resp_buf = dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 635 635 &mp_req->resp_buf_dma, 636 636 GFP_ATOMIC); 637 637 if (!mp_req->resp_buf) { ··· 639 639 bnx2fc_free_mp_resc(io_req); 640 640 return FAILED; 641 641 } 642 - memset(mp_req->req_buf, 0, PAGE_SIZE); 643 - memset(mp_req->resp_buf, 0, PAGE_SIZE); 642 + memset(mp_req->req_buf, 0, CNIC_PAGE_SIZE); 643 + memset(mp_req->resp_buf, 0, CNIC_PAGE_SIZE); 644 644 645 645 /* Allocate and map mp_req_bd and mp_resp_bd */ 646 646 sz = sizeof(struct fcoe_bd_ctx); ··· 665 665 mp_req_bd = mp_req->mp_req_bd; 666 666 mp_req_bd->buf_addr_lo = (u32)addr & 0xffffffff; 667 667 mp_req_bd->buf_addr_hi = (u32)((u64)addr >> 32); 668 - mp_req_bd->buf_len = PAGE_SIZE; 668 + mp_req_bd->buf_len = CNIC_PAGE_SIZE; 669 669 mp_req_bd->flags = 0; 670 670 671 671 /* ··· 677 677 addr = mp_req->resp_buf_dma; 678 678 mp_resp_bd->buf_addr_lo = (u32)addr & 0xffffffff; 679 679 mp_resp_bd->buf_addr_hi = (u32)((u64)addr >> 32); 680 - mp_resp_bd->buf_len = PAGE_SIZE; 680 + mp_resp_bd->buf_len = CNIC_PAGE_SIZE; 681 681 mp_resp_bd->flags = 0; 682 682 683 683 return SUCCESS;
+21 -17
drivers/scsi/bnx2fc/bnx2fc_tgt.c
··· 673 673 674 674 /* Allocate and map SQ */ 675 675 tgt->sq_mem_size = tgt->max_sqes * BNX2FC_SQ_WQE_SIZE; 676 - tgt->sq_mem_size = (tgt->sq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 676 + tgt->sq_mem_size = (tgt->sq_mem_size + (CNIC_PAGE_SIZE - 1)) & 677 + CNIC_PAGE_MASK; 677 678 678 679 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, 679 680 &tgt->sq_dma, GFP_KERNEL); ··· 687 686 688 687 /* Allocate and map CQ */ 689 688 tgt->cq_mem_size = tgt->max_cqes * BNX2FC_CQ_WQE_SIZE; 690 - tgt->cq_mem_size = (tgt->cq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 689 + tgt->cq_mem_size = (tgt->cq_mem_size + (CNIC_PAGE_SIZE - 1)) & 690 + CNIC_PAGE_MASK; 691 691 692 692 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, 693 693 &tgt->cq_dma, GFP_KERNEL); ··· 701 699 702 700 /* Allocate and map RQ and RQ PBL */ 703 701 tgt->rq_mem_size = tgt->max_rqes * BNX2FC_RQ_WQE_SIZE; 704 - tgt->rq_mem_size = (tgt->rq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 702 + tgt->rq_mem_size = (tgt->rq_mem_size + (CNIC_PAGE_SIZE - 1)) & 703 + CNIC_PAGE_MASK; 705 704 706 705 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, 707 706 &tgt->rq_dma, GFP_KERNEL); ··· 713 710 } 714 711 memset(tgt->rq, 0, tgt->rq_mem_size); 715 712 716 - tgt->rq_pbl_size = (tgt->rq_mem_size / PAGE_SIZE) * sizeof(void *); 717 - tgt->rq_pbl_size = (tgt->rq_pbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 713 + tgt->rq_pbl_size = (tgt->rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 714 + tgt->rq_pbl_size = (tgt->rq_pbl_size + (CNIC_PAGE_SIZE - 1)) & 715 + CNIC_PAGE_MASK; 718 716 719 717 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, 720 718 &tgt->rq_pbl_dma, GFP_KERNEL); ··· 726 722 } 727 723 728 724 memset(tgt->rq_pbl, 0, tgt->rq_pbl_size); 729 - num_pages = tgt->rq_mem_size / PAGE_SIZE; 725 + num_pages = tgt->rq_mem_size / CNIC_PAGE_SIZE; 730 726 page = tgt->rq_dma; 731 727 pbl = (u32 *)tgt->rq_pbl; 732 728 ··· 735 731 pbl++; 736 732 *pbl = (u32)((u64)page >> 32); 737 733 pbl++; 738 - page += PAGE_SIZE; 734 + page += CNIC_PAGE_SIZE; 739 735 } 740 736 741 737 /* Allocate and map XFERQ */ 742 738 tgt->xferq_mem_size = tgt->max_sqes * BNX2FC_XFERQ_WQE_SIZE; 743 - tgt->xferq_mem_size = (tgt->xferq_mem_size + (PAGE_SIZE - 1)) & 744 - PAGE_MASK; 739 + tgt->xferq_mem_size = (tgt->xferq_mem_size + (CNIC_PAGE_SIZE - 1)) & 740 + CNIC_PAGE_MASK; 745 741 746 742 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, 747 743 &tgt->xferq_dma, GFP_KERNEL); ··· 754 750 755 751 /* Allocate and map CONFQ & CONFQ PBL */ 756 752 tgt->confq_mem_size = tgt->max_sqes * BNX2FC_CONFQ_WQE_SIZE; 757 - tgt->confq_mem_size = (tgt->confq_mem_size + (PAGE_SIZE - 1)) & 758 - PAGE_MASK; 753 + tgt->confq_mem_size = (tgt->confq_mem_size + (CNIC_PAGE_SIZE - 1)) & 754 + CNIC_PAGE_MASK; 759 755 760 756 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, tgt->confq_mem_size, 761 757 &tgt->confq_dma, GFP_KERNEL); ··· 767 763 memset(tgt->confq, 0, tgt->confq_mem_size); 768 764 769 765 tgt->confq_pbl_size = 770 - (tgt->confq_mem_size / PAGE_SIZE) * sizeof(void *); 766 + (tgt->confq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 771 767 tgt->confq_pbl_size = 772 - (tgt->confq_pbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 768 + (tgt->confq_pbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 773 769 774 770 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, 775 771 tgt->confq_pbl_size, ··· 781 777 } 782 778 783 779 memset(tgt->confq_pbl, 0, tgt->confq_pbl_size); 784 - num_pages = tgt->confq_mem_size / PAGE_SIZE; 780 + num_pages = tgt->confq_mem_size / CNIC_PAGE_SIZE; 785 781 page = tgt->confq_dma; 786 782 pbl = (u32 *)tgt->confq_pbl; 787 783 ··· 790 786 pbl++; 791 787 *pbl = (u32)((u64)page >> 32); 792 788 pbl++; 793 - page += PAGE_SIZE; 789 + page += CNIC_PAGE_SIZE; 794 790 } 795 791 796 792 /* Allocate and map ConnDB */ ··· 809 805 810 806 /* Allocate and map LCQ */ 811 807 tgt->lcq_mem_size = (tgt->max_sqes + 8) * BNX2FC_SQ_WQE_SIZE; 812 - tgt->lcq_mem_size = (tgt->lcq_mem_size + (PAGE_SIZE - 1)) & 813 - PAGE_MASK; 808 + tgt->lcq_mem_size = (tgt->lcq_mem_size + (CNIC_PAGE_SIZE - 1)) & 809 + CNIC_PAGE_MASK; 814 810 815 811 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, 816 812 &tgt->lcq_dma, GFP_KERNEL);
+26 -26
drivers/scsi/bnx2i/bnx2i_hwi.c
··· 61 61 * yield integral num of page buffers 62 62 */ 63 63 /* adjust SQ */ 64 - num_elements_per_pg = PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 64 + num_elements_per_pg = CNIC_PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 65 65 if (hba->max_sqes < num_elements_per_pg) 66 66 hba->max_sqes = num_elements_per_pg; 67 67 else if (hba->max_sqes % num_elements_per_pg) ··· 69 69 ~(num_elements_per_pg - 1); 70 70 71 71 /* adjust CQ */ 72 - num_elements_per_pg = PAGE_SIZE / BNX2I_CQE_SIZE; 72 + num_elements_per_pg = CNIC_PAGE_SIZE / BNX2I_CQE_SIZE; 73 73 if (hba->max_cqes < num_elements_per_pg) 74 74 hba->max_cqes = num_elements_per_pg; 75 75 else if (hba->max_cqes % num_elements_per_pg) ··· 77 77 ~(num_elements_per_pg - 1); 78 78 79 79 /* adjust RQ */ 80 - num_elements_per_pg = PAGE_SIZE / BNX2I_RQ_WQE_SIZE; 80 + num_elements_per_pg = CNIC_PAGE_SIZE / BNX2I_RQ_WQE_SIZE; 81 81 if (hba->max_rqes < num_elements_per_pg) 82 82 hba->max_rqes = num_elements_per_pg; 83 83 else if (hba->max_rqes % num_elements_per_pg) ··· 959 959 960 960 /* SQ page table */ 961 961 memset(ep->qp.sq_pgtbl_virt, 0, ep->qp.sq_pgtbl_size); 962 - num_pages = ep->qp.sq_mem_size / PAGE_SIZE; 962 + num_pages = ep->qp.sq_mem_size / CNIC_PAGE_SIZE; 963 963 page = ep->qp.sq_phys; 964 964 965 965 if (cnic_dev_10g) ··· 973 973 ptbl++; 974 974 *ptbl = (u32) ((u64) page >> 32); 975 975 ptbl++; 976 - page += PAGE_SIZE; 976 + page += CNIC_PAGE_SIZE; 977 977 } else { 978 978 /* PTE is written in big endian format for 979 979 * 5706/5708/5709 devices */ ··· 981 981 ptbl++; 982 982 *ptbl = (u32) page; 983 983 ptbl++; 984 - page += PAGE_SIZE; 984 + page += CNIC_PAGE_SIZE; 985 985 } 986 986 } 987 987 988 988 /* RQ page table */ 989 989 memset(ep->qp.rq_pgtbl_virt, 0, ep->qp.rq_pgtbl_size); 990 - num_pages = ep->qp.rq_mem_size / PAGE_SIZE; 990 + num_pages = ep->qp.rq_mem_size / CNIC_PAGE_SIZE; 991 991 page = ep->qp.rq_phys; 992 992 993 993 if (cnic_dev_10g) ··· 1001 1001 ptbl++; 1002 1002 *ptbl = (u32) ((u64) page >> 32); 1003 1003 ptbl++; 1004 - page += PAGE_SIZE; 1004 + page += CNIC_PAGE_SIZE; 1005 1005 } else { 1006 1006 /* PTE is written in big endian format for 1007 1007 * 5706/5708/5709 devices */ ··· 1009 1009 ptbl++; 1010 1010 *ptbl = (u32) page; 1011 1011 ptbl++; 1012 - page += PAGE_SIZE; 1012 + page += CNIC_PAGE_SIZE; 1013 1013 } 1014 1014 } 1015 1015 1016 1016 /* CQ page table */ 1017 1017 memset(ep->qp.cq_pgtbl_virt, 0, ep->qp.cq_pgtbl_size); 1018 - num_pages = ep->qp.cq_mem_size / PAGE_SIZE; 1018 + num_pages = ep->qp.cq_mem_size / CNIC_PAGE_SIZE; 1019 1019 page = ep->qp.cq_phys; 1020 1020 1021 1021 if (cnic_dev_10g) ··· 1029 1029 ptbl++; 1030 1030 *ptbl = (u32) ((u64) page >> 32); 1031 1031 ptbl++; 1032 - page += PAGE_SIZE; 1032 + page += CNIC_PAGE_SIZE; 1033 1033 } else { 1034 1034 /* PTE is written in big endian format for 1035 1035 * 5706/5708/5709 devices */ ··· 1037 1037 ptbl++; 1038 1038 *ptbl = (u32) page; 1039 1039 ptbl++; 1040 - page += PAGE_SIZE; 1040 + page += CNIC_PAGE_SIZE; 1041 1041 } 1042 1042 } 1043 1043 } ··· 1064 1064 /* Allocate page table memory for SQ which is page aligned */ 1065 1065 ep->qp.sq_mem_size = hba->max_sqes * BNX2I_SQ_WQE_SIZE; 1066 1066 ep->qp.sq_mem_size = 1067 - (ep->qp.sq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1067 + (ep->qp.sq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1068 1068 ep->qp.sq_pgtbl_size = 1069 - (ep->qp.sq_mem_size / PAGE_SIZE) * sizeof(void *); 1069 + (ep->qp.sq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 1070 1070 ep->qp.sq_pgtbl_size = 1071 - (ep->qp.sq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1071 + (ep->qp.sq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1072 1072 1073 1073 ep->qp.sq_pgtbl_virt = 1074 1074 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, ··· 1101 1101 /* Allocate page table memory for CQ which is page aligned */ 1102 1102 ep->qp.cq_mem_size = hba->max_cqes * BNX2I_CQE_SIZE; 1103 1103 ep->qp.cq_mem_size = 1104 - (ep->qp.cq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1104 + (ep->qp.cq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1105 1105 ep->qp.cq_pgtbl_size = 1106 - (ep->qp.cq_mem_size / PAGE_SIZE) * sizeof(void *); 1106 + (ep->qp.cq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 1107 1107 ep->qp.cq_pgtbl_size = 1108 - (ep->qp.cq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1108 + (ep->qp.cq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1109 1109 1110 1110 ep->qp.cq_pgtbl_virt = 1111 1111 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, ··· 1144 1144 /* Allocate page table memory for RQ which is page aligned */ 1145 1145 ep->qp.rq_mem_size = hba->max_rqes * BNX2I_RQ_WQE_SIZE; 1146 1146 ep->qp.rq_mem_size = 1147 - (ep->qp.rq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1147 + (ep->qp.rq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1148 1148 ep->qp.rq_pgtbl_size = 1149 - (ep->qp.rq_mem_size / PAGE_SIZE) * sizeof(void *); 1149 + (ep->qp.rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 1150 1150 ep->qp.rq_pgtbl_size = 1151 - (ep->qp.rq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1151 + (ep->qp.rq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1152 1152 1153 1153 ep->qp.rq_pgtbl_virt = 1154 1154 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, ··· 1270 1270 bnx2i_adjust_qp_size(hba); 1271 1271 1272 1272 iscsi_init.flags = 1273 - ISCSI_PAGE_SIZE_4K << ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT; 1273 + (CNIC_PAGE_BITS - 8) << ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT; 1274 1274 if (en_tcp_dack) 1275 1275 iscsi_init.flags |= ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE; 1276 1276 iscsi_init.reserved0 = 0; ··· 1288 1288 ((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16)); 1289 1289 iscsi_init.num_ccells_per_conn = hba->num_ccell; 1290 1290 iscsi_init.num_tasks_per_conn = hba->max_sqes; 1291 - iscsi_init.sq_wqes_per_page = PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 1291 + iscsi_init.sq_wqes_per_page = CNIC_PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 1292 1292 iscsi_init.sq_num_wqes = hba->max_sqes; 1293 1293 iscsi_init.cq_log_wqes_per_page = 1294 - (u8) bnx2i_power_of2(PAGE_SIZE / BNX2I_CQE_SIZE); 1294 + (u8) bnx2i_power_of2(CNIC_PAGE_SIZE / BNX2I_CQE_SIZE); 1295 1295 iscsi_init.cq_num_wqes = hba->max_cqes; 1296 1296 iscsi_init.cq_num_pages = (hba->max_cqes * BNX2I_CQE_SIZE + 1297 - (PAGE_SIZE - 1)) / PAGE_SIZE; 1297 + (CNIC_PAGE_SIZE - 1)) / CNIC_PAGE_SIZE; 1298 1298 iscsi_init.sq_num_pages = (hba->max_sqes * BNX2I_SQ_WQE_SIZE + 1299 - (PAGE_SIZE - 1)) / PAGE_SIZE; 1299 + (CNIC_PAGE_SIZE - 1)) / CNIC_PAGE_SIZE; 1300 1300 iscsi_init.rq_buffer_size = BNX2I_RQ_WQE_SIZE; 1301 1301 iscsi_init.rq_num_wqes = hba->max_rqes; 1302 1302
+12 -11
drivers/scsi/bnx2i/bnx2i_iscsi.c
··· 525 525 struct iscsi_bd *mp_bdt; 526 526 u64 addr; 527 527 528 - hba->mp_bd_tbl = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 528 + hba->mp_bd_tbl = dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 529 529 &hba->mp_bd_dma, GFP_KERNEL); 530 530 if (!hba->mp_bd_tbl) { 531 531 printk(KERN_ERR "unable to allocate Middle Path BDT\n"); ··· 533 533 goto out; 534 534 } 535 535 536 - hba->dummy_buffer = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 536 + hba->dummy_buffer = dma_alloc_coherent(&hba->pcidev->dev, 537 + CNIC_PAGE_SIZE, 537 538 &hba->dummy_buf_dma, GFP_KERNEL); 538 539 if (!hba->dummy_buffer) { 539 540 printk(KERN_ERR "unable to alloc Middle Path Dummy Buffer\n"); 540 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 541 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 541 542 hba->mp_bd_tbl, hba->mp_bd_dma); 542 543 hba->mp_bd_tbl = NULL; 543 544 rc = -1; ··· 549 548 addr = (unsigned long) hba->dummy_buf_dma; 550 549 mp_bdt->buffer_addr_lo = addr & 0xffffffff; 551 550 mp_bdt->buffer_addr_hi = addr >> 32; 552 - mp_bdt->buffer_length = PAGE_SIZE; 551 + mp_bdt->buffer_length = CNIC_PAGE_SIZE; 553 552 mp_bdt->flags = ISCSI_BD_LAST_IN_BD_CHAIN | 554 553 ISCSI_BD_FIRST_IN_BD_CHAIN; 555 554 out: ··· 566 565 static void bnx2i_free_mp_bdt(struct bnx2i_hba *hba) 567 566 { 568 567 if (hba->mp_bd_tbl) { 569 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 568 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 570 569 hba->mp_bd_tbl, hba->mp_bd_dma); 571 570 hba->mp_bd_tbl = NULL; 572 571 } 573 572 if (hba->dummy_buffer) { 574 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 573 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 575 574 hba->dummy_buffer, hba->dummy_buf_dma); 576 575 hba->dummy_buffer = NULL; 577 576 } ··· 935 934 struct bnx2i_conn *bnx2i_conn) 936 935 { 937 936 if (bnx2i_conn->gen_pdu.resp_bd_tbl) { 938 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 937 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 939 938 bnx2i_conn->gen_pdu.resp_bd_tbl, 940 939 bnx2i_conn->gen_pdu.resp_bd_dma); 941 940 bnx2i_conn->gen_pdu.resp_bd_tbl = NULL; 942 941 } 943 942 944 943 if (bnx2i_conn->gen_pdu.req_bd_tbl) { 945 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 944 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 946 945 bnx2i_conn->gen_pdu.req_bd_tbl, 947 946 bnx2i_conn->gen_pdu.req_bd_dma); 948 947 bnx2i_conn->gen_pdu.req_bd_tbl = NULL; ··· 999 998 bnx2i_conn->gen_pdu.resp_wr_ptr = bnx2i_conn->gen_pdu.resp_buf; 1000 999 1001 1000 bnx2i_conn->gen_pdu.req_bd_tbl = 1002 - dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 1001 + dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 1003 1002 &bnx2i_conn->gen_pdu.req_bd_dma, GFP_KERNEL); 1004 1003 if (bnx2i_conn->gen_pdu.req_bd_tbl == NULL) 1005 1004 goto login_req_bd_tbl_failure; 1006 1005 1007 1006 bnx2i_conn->gen_pdu.resp_bd_tbl = 1008 - dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 1007 + dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 1009 1008 &bnx2i_conn->gen_pdu.resp_bd_dma, 1010 1009 GFP_KERNEL); 1011 1010 if (bnx2i_conn->gen_pdu.resp_bd_tbl == NULL) ··· 1014 1013 return 0; 1015 1014 1016 1015 login_resp_bd_tbl_failure: 1017 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 1016 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 1018 1017 bnx2i_conn->gen_pdu.req_bd_tbl, 1019 1018 bnx2i_conn->gen_pdu.req_bd_dma); 1020 1019 bnx2i_conn->gen_pdu.req_bd_tbl = NULL;
+2 -3
drivers/scsi/isci/host.h
··· 311 311 } 312 312 313 313 #define for_each_isci_host(id, ihost, pdev) \ 314 - for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ 315 - id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ 316 - ihost = to_pci_info(pdev)->hosts[++id]) 314 + for (id = 0; id < SCI_MAX_CONTROLLERS && \ 315 + (ihost = to_pci_info(pdev)->hosts[id]); id++) 317 316 318 317 static inline void wait_for_start(struct isci_host *ihost) 319 318 {
-7
drivers/scsi/isci/port_config.c
··· 615 615 SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION); 616 616 } else { 617 617 /* the phy is already the part of the port */ 618 - u32 port_state = iport->sm.current_state_id; 619 - 620 - /* if the PORT'S state is resetting then the link up is from 621 - * port hard reset in this case, we need to tell the port 622 - * that link up is recieved 623 - */ 624 - BUG_ON(port_state != SCI_PORT_RESETTING); 625 618 port_agent->phy_ready_mask |= 1 << phy_index; 626 619 sci_port_link_up(iport, iphy); 627 620 }
+1 -1
drivers/scsi/isci/task.c
··· 801 801 /* XXX: need to cleanup any ireqs targeting this 802 802 * domain_device 803 803 */ 804 - ret = TMF_RESP_FUNC_COMPLETE; 804 + ret = -ENODEV; 805 805 goto out; 806 806 } 807 807
+1 -2
drivers/scsi/qla2xxx/qla_def.h
··· 2996 2996 IS_QLA82XX(ha) || IS_QLA83XX(ha) || \ 2997 2997 IS_QLA8044(ha)) 2998 2998 #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) 2999 - #define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha) || \ 3000 - IS_QLA83XX(ha)) && (ha)->flags.msix_enabled) 2999 + #define IS_NOPOLLING_TYPE(ha) (IS_QLA81XX(ha) && (ha)->flags.msix_enabled) 3001 3000 #define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) 3002 3001 #define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) 3003 3002 #define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha))
+30 -16
drivers/scsi/qla2xxx/qla_isr.c
··· 2880 2880 qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) 2881 2881 { 2882 2882 #define MIN_MSIX_COUNT 2 2883 + #define ATIO_VECTOR 2 2883 2884 int i, ret; 2884 2885 struct msix_entry *entries; 2885 2886 struct qla_msix_entry *qentry; ··· 2937 2936 } 2938 2937 2939 2938 /* Enable MSI-X vectors for the base queue */ 2940 - for (i = 0; i < ha->msix_count; i++) { 2939 + for (i = 0; i < 2; i++) { 2941 2940 qentry = &ha->msix_entries[i]; 2942 - if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { 2943 - ret = request_irq(qentry->vector, 2944 - qla83xx_msix_entries[i].handler, 2945 - 0, qla83xx_msix_entries[i].name, rsp); 2946 - } else if (IS_P3P_TYPE(ha)) { 2941 + if (IS_P3P_TYPE(ha)) 2947 2942 ret = request_irq(qentry->vector, 2948 2943 qla82xx_msix_entries[i].handler, 2949 2944 0, qla82xx_msix_entries[i].name, rsp); 2950 - } else { 2945 + else 2951 2946 ret = request_irq(qentry->vector, 2952 2947 msix_entries[i].handler, 2953 2948 0, msix_entries[i].name, rsp); 2954 - } 2955 - if (ret) { 2956 - ql_log(ql_log_fatal, vha, 0x00cb, 2957 - "MSI-X: unable to register handler -- %x/%d.\n", 2958 - qentry->vector, ret); 2959 - qla24xx_disable_msix(ha); 2960 - ha->mqenable = 0; 2961 - goto msix_out; 2962 - } 2949 + if (ret) 2950 + goto msix_register_fail; 2963 2951 qentry->have_irq = 1; 2964 2952 qentry->rsp = rsp; 2965 2953 rsp->msix = qentry; 2954 + } 2955 + 2956 + /* 2957 + * If target mode is enable, also request the vector for the ATIO 2958 + * queue. 2959 + */ 2960 + if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { 2961 + qentry = &ha->msix_entries[ATIO_VECTOR]; 2962 + ret = request_irq(qentry->vector, 2963 + qla83xx_msix_entries[ATIO_VECTOR].handler, 2964 + 0, qla83xx_msix_entries[ATIO_VECTOR].name, rsp); 2965 + qentry->have_irq = 1; 2966 + qentry->rsp = rsp; 2967 + rsp->msix = qentry; 2968 + } 2969 + 2970 + msix_register_fail: 2971 + if (ret) { 2972 + ql_log(ql_log_fatal, vha, 0x00cb, 2973 + "MSI-X: unable to register handler -- %x/%d.\n", 2974 + qentry->vector, ret); 2975 + qla24xx_disable_msix(ha); 2976 + ha->mqenable = 0; 2977 + goto msix_out; 2966 2978 } 2967 2979 2968 2980 /* Enable MSI-X vector for response queue update for queue 0 */
+3
drivers/scsi/storvsc_drv.c
··· 1419 1419 { 1420 1420 struct stor_mem_pools *memp = sdevice->hostdata; 1421 1421 1422 + if (!memp) 1423 + return; 1424 + 1422 1425 mempool_destroy(memp->request_mempool); 1423 1426 kmem_cache_destroy(memp->request_pool); 1424 1427 kfree(memp);
+10 -12
drivers/tty/serial/sunhv.c
··· 433 433 unsigned long flags; 434 434 int locked = 1; 435 435 436 - local_irq_save(flags); 437 - if (port->sysrq) { 438 - locked = 0; 439 - } else if (oops_in_progress) { 440 - locked = spin_trylock(&port->lock); 441 - } else 442 - spin_lock(&port->lock); 436 + if (port->sysrq || oops_in_progress) 437 + locked = spin_trylock_irqsave(&port->lock, flags); 438 + else 439 + spin_lock_irqsave(&port->lock, flags); 443 440 444 441 while (n > 0) { 445 442 unsigned long ra = __pa(con_write_page); ··· 467 470 } 468 471 469 472 if (locked) 470 - spin_unlock(&port->lock); 471 - local_irq_restore(flags); 473 + spin_unlock_irqrestore(&port->lock, flags); 472 474 } 473 475 474 476 static inline void sunhv_console_putchar(struct uart_port *port, char c) ··· 488 492 unsigned long flags; 489 493 int i, locked = 1; 490 494 491 - local_irq_save(flags); 495 + if (port->sysrq || oops_in_progress) 496 + locked = spin_trylock_irqsave(&port->lock, flags); 497 + else 498 + spin_lock_irqsave(&port->lock, flags); 492 499 if (port->sysrq) { 493 500 locked = 0; 494 501 } else if (oops_in_progress) { ··· 506 507 } 507 508 508 509 if (locked) 509 - spin_unlock(&port->lock); 510 - local_irq_restore(flags); 510 + spin_unlock_irqrestore(&port->lock, flags); 511 511 } 512 512 513 513 static struct console sunhv_console = {
+5 -9
drivers/tty/serial/sunsab.c
··· 844 844 unsigned long flags; 845 845 int locked = 1; 846 846 847 - local_irq_save(flags); 848 - if (up->port.sysrq) { 849 - locked = 0; 850 - } else if (oops_in_progress) { 851 - locked = spin_trylock(&up->port.lock); 852 - } else 853 - spin_lock(&up->port.lock); 847 + if (up->port.sysrq || oops_in_progress) 848 + locked = spin_trylock_irqsave(&up->port.lock, flags); 849 + else 850 + spin_lock_irqsave(&up->port.lock, flags); 854 851 855 852 uart_console_write(&up->port, s, n, sunsab_console_putchar); 856 853 sunsab_tec_wait(up); 857 854 858 855 if (locked) 859 - spin_unlock(&up->port.lock); 860 - local_irq_restore(flags); 856 + spin_unlock_irqrestore(&up->port.lock, flags); 861 857 } 862 858 863 859 static int sunsab_console_setup(struct console *con, char *options)
+5 -9
drivers/tty/serial/sunsu.c
··· 1295 1295 unsigned int ier; 1296 1296 int locked = 1; 1297 1297 1298 - local_irq_save(flags); 1299 - if (up->port.sysrq) { 1300 - locked = 0; 1301 - } else if (oops_in_progress) { 1302 - locked = spin_trylock(&up->port.lock); 1303 - } else 1304 - spin_lock(&up->port.lock); 1298 + if (up->port.sysrq || oops_in_progress) 1299 + locked = spin_trylock_irqsave(&up->port.lock, flags); 1300 + else 1301 + spin_lock_irqsave(&up->port.lock, flags); 1305 1302 1306 1303 /* 1307 1304 * First save the UER then disable the interrupts ··· 1316 1319 serial_out(up, UART_IER, ier); 1317 1320 1318 1321 if (locked) 1319 - spin_unlock(&up->port.lock); 1320 - local_irq_restore(flags); 1322 + spin_unlock_irqrestore(&up->port.lock, flags); 1321 1323 } 1322 1324 1323 1325 /*
+5 -9
drivers/tty/serial/sunzilog.c
··· 1195 1195 unsigned long flags; 1196 1196 int locked = 1; 1197 1197 1198 - local_irq_save(flags); 1199 - if (up->port.sysrq) { 1200 - locked = 0; 1201 - } else if (oops_in_progress) { 1202 - locked = spin_trylock(&up->port.lock); 1203 - } else 1204 - spin_lock(&up->port.lock); 1198 + if (up->port.sysrq || oops_in_progress) 1199 + locked = spin_trylock_irqsave(&up->port.lock, flags); 1200 + else 1201 + spin_lock_irqsave(&up->port.lock, flags); 1205 1202 1206 1203 uart_console_write(&up->port, s, count, sunzilog_putchar); 1207 1204 udelay(2); 1208 1205 1209 1206 if (locked) 1210 - spin_unlock(&up->port.lock); 1211 - local_irq_restore(flags); 1207 + spin_unlock_irqrestore(&up->port.lock, flags); 1212 1208 } 1213 1209 1214 1210 static int __init sunzilog_console_setup(struct console *con, char *options)
+2 -2
fs/dcache.c
··· 2833 2833 u32 dlen = ACCESS_ONCE(name->len); 2834 2834 char *p; 2835 2835 2836 - if (*buflen < dlen + 1) 2837 - return -ENAMETOOLONG; 2838 2836 *buflen -= dlen + 1; 2837 + if (*buflen < 0) 2838 + return -ENAMETOOLONG; 2839 2839 p = *buffer -= dlen + 1; 2840 2840 *p++ = '/'; 2841 2841 while (dlen--) {
+4 -15
fs/file.c
··· 713 713 714 714 unsigned long __fdget_pos(unsigned int fd) 715 715 { 716 - struct files_struct *files = current->files; 717 - struct file *file; 718 - unsigned long v; 716 + unsigned long v = __fdget(fd); 717 + struct file *file = (struct file *)(v & ~3); 719 718 720 - if (atomic_read(&files->count) == 1) { 721 - file = __fcheck_files(files, fd); 722 - v = 0; 723 - } else { 724 - file = __fget(fd, 0); 725 - v = FDPUT_FPUT; 726 - } 727 - if (!file) 728 - return 0; 729 - 730 - if (file->f_mode & FMODE_ATOMIC_POS) { 719 + if (file && (file->f_mode & FMODE_ATOMIC_POS)) { 731 720 if (file_count(file) > 1) { 732 721 v |= FDPUT_POS_UNLOCK; 733 722 mutex_lock(&file->f_pos_lock); 734 723 } 735 724 } 736 - return v | (unsigned long)file; 725 + return v; 737 726 } 738 727 739 728 /*
+13 -16
fs/namei.c
··· 1109 1109 return false; 1110 1110 1111 1111 if (!d_mountpoint(path->dentry)) 1112 - break; 1112 + return true; 1113 1113 1114 1114 mounted = __lookup_mnt(path->mnt, path->dentry); 1115 1115 if (!mounted) ··· 1125 1125 */ 1126 1126 *inode = path->dentry->d_inode; 1127 1127 } 1128 - return true; 1129 - } 1130 - 1131 - static void follow_mount_rcu(struct nameidata *nd) 1132 - { 1133 - while (d_mountpoint(nd->path.dentry)) { 1134 - struct mount *mounted; 1135 - mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry); 1136 - if (!mounted) 1137 - break; 1138 - nd->path.mnt = &mounted->mnt; 1139 - nd->path.dentry = mounted->mnt.mnt_root; 1140 - nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); 1141 - } 1128 + return read_seqretry(&mount_lock, nd->m_seq); 1142 1129 } 1143 1130 1144 1131 static int follow_dotdot_rcu(struct nameidata *nd) ··· 1153 1166 break; 1154 1167 nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); 1155 1168 } 1156 - follow_mount_rcu(nd); 1169 + while (d_mountpoint(nd->path.dentry)) { 1170 + struct mount *mounted; 1171 + mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry); 1172 + if (!mounted) 1173 + break; 1174 + nd->path.mnt = &mounted->mnt; 1175 + nd->path.dentry = mounted->mnt.mnt_root; 1176 + nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); 1177 + if (!read_seqretry(&mount_lock, nd->m_seq)) 1178 + goto failed; 1179 + } 1157 1180 nd->inode = nd->path.dentry->d_inode; 1158 1181 return 0; 1159 1182
+1
fs/nfsd/vfs.c
··· 449 449 fh_lock(fhp); 450 450 host_err = notify_change(dentry, iap, NULL); 451 451 fh_unlock(fhp); 452 + err = nfserrno(host_err); 452 453 453 454 out_put_write_access: 454 455 if (size_change)
+2 -2
fs/read_write.c
··· 307 307 unsigned int, whence) 308 308 { 309 309 int retval; 310 - struct fd f = fdget(fd); 310 + struct fd f = fdget_pos(fd); 311 311 loff_t offset; 312 312 313 313 if (!f.file) ··· 327 327 retval = 0; 328 328 } 329 329 out_putf: 330 - fdput(f); 330 + fdput_pos(f); 331 331 return retval; 332 332 } 333 333 #endif
-4
include/linux/ftrace_event.h
··· 495 495 FILTER_TRACE_FN, 496 496 }; 497 497 498 - #define EVENT_STORAGE_SIZE 128 499 - extern struct mutex event_storage_mutex; 500 - extern char event_storage[EVENT_STORAGE_SIZE]; 501 - 502 498 extern int trace_event_raw_init(struct ftrace_event_call *call); 503 499 extern int trace_define_field(struct ftrace_event_call *call, const char *type, 504 500 const char *name, int offset, int size,
+1 -2
include/linux/rmap.h
··· 250 250 int (*rmap_one)(struct page *page, struct vm_area_struct *vma, 251 251 unsigned long addr, void *arg); 252 252 int (*done)(struct page *page); 253 - int (*file_nonlinear)(struct page *, struct address_space *, 254 - struct vm_area_struct *vma); 253 + int (*file_nonlinear)(struct page *, struct address_space *, void *arg); 255 254 struct anon_vma *(*anon_lock)(struct page *page); 256 255 bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); 257 256 };
+7 -3
include/linux/security.h
··· 1040 1040 * Allocate a security structure to the xp->security field; the security 1041 1041 * field is initialized to NULL when the xfrm_policy is allocated. 1042 1042 * Return 0 if operation was successful (memory to allocate, legal context) 1043 + * @gfp is to specify the context for the allocation 1043 1044 * @xfrm_policy_clone_security: 1044 1045 * @old_ctx contains an existing xfrm_sec_ctx. 1045 1046 * @new_ctxp contains a new xfrm_sec_ctx being cloned from old. ··· 1684 1683 1685 1684 #ifdef CONFIG_SECURITY_NETWORK_XFRM 1686 1685 int (*xfrm_policy_alloc_security) (struct xfrm_sec_ctx **ctxp, 1687 - struct xfrm_user_sec_ctx *sec_ctx); 1686 + struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp); 1688 1687 int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); 1689 1688 void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); 1690 1689 int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); ··· 2860 2859 2861 2860 #ifdef CONFIG_SECURITY_NETWORK_XFRM 2862 2861 2863 - int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx); 2862 + int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 2863 + struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp); 2864 2864 int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctxp); 2865 2865 void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx); 2866 2866 int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx); ··· 2879 2877 2880 2878 #else /* CONFIG_SECURITY_NETWORK_XFRM */ 2881 2879 2882 - static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx) 2880 + static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 2881 + struct xfrm_user_sec_ctx *sec_ctx, 2882 + gfp_t gfp) 2883 2883 { 2884 2884 return 0; 2885 2885 }
+1
include/linux/usb/cdc_ncm.h
··· 88 88 #define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB) 89 89 90 90 struct cdc_ncm_ctx { 91 + struct usb_cdc_ncm_ntb_parameters ncm_parm; 91 92 struct hrtimer tx_timer; 92 93 struct tasklet_struct bh; 93 94
+6 -5
include/net/tcp.h
··· 480 480 struct ip_options *opt); 481 481 #ifdef CONFIG_SYN_COOKIES 482 482 483 - /* Syncookies use a monotonic timer which increments every 64 seconds. 483 + /* Syncookies use a monotonic timer which increments every 60 seconds. 484 484 * This counter is used both as a hash input and partially encoded into 485 485 * the cookie value. A cookie is only validated further if the delta 486 486 * between the current counter value and the encoded one is less than this, 487 - * i.e. a sent cookie is valid only at most for 128 seconds (or less if 487 + * i.e. a sent cookie is valid only at most for 2*60 seconds (or less if 488 488 * the counter advances immediately after a cookie is generated). 489 489 */ 490 490 #define MAX_SYNCOOKIE_AGE 2 491 491 492 492 static inline u32 tcp_cookie_time(void) 493 493 { 494 - struct timespec now; 495 - getnstimeofday(&now); 496 - return now.tv_sec >> 6; /* 64 seconds granularity */ 494 + u64 val = get_jiffies_64(); 495 + 496 + do_div(val, 60 * HZ); 497 + return val; 497 498 } 498 499 499 500 u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th,
+2 -5
include/trace/ftrace.h
··· 310 310 #undef __array 311 311 #define __array(type, item, len) \ 312 312 do { \ 313 - mutex_lock(&event_storage_mutex); \ 313 + char *type_str = #type"["__stringify(len)"]"; \ 314 314 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ 315 - snprintf(event_storage, sizeof(event_storage), \ 316 - "%s[%d]", #type, len); \ 317 - ret = trace_define_field(event_call, event_storage, #item, \ 315 + ret = trace_define_field(event_call, type_str, #item, \ 318 316 offsetof(typeof(field), item), \ 319 317 sizeof(field.item), \ 320 318 is_signed_type(type), FILTER_OTHER); \ 321 - mutex_unlock(&event_storage_mutex); \ 322 319 if (ret) \ 323 320 return ret; \ 324 321 } while (0);
+2
ipc/msg.c
··· 901 901 return -EINVAL; 902 902 903 903 if (msgflg & MSG_COPY) { 904 + if ((msgflg & MSG_EXCEPT) || !(msgflg & IPC_NOWAIT)) 905 + return -EINVAL; 904 906 copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax)); 905 907 if (IS_ERR(copy)) 906 908 return PTR_ERR(copy);
+7 -4
kernel/cgroup.c
··· 4112 4112 4113 4113 err = percpu_ref_init(&css->refcnt, css_release); 4114 4114 if (err) 4115 - goto err_free; 4115 + goto err_free_css; 4116 4116 4117 4117 init_css(css, ss, cgrp); 4118 4118 4119 4119 err = cgroup_populate_dir(cgrp, 1 << ss->subsys_id); 4120 4120 if (err) 4121 - goto err_free; 4121 + goto err_free_percpu_ref; 4122 4122 4123 4123 err = online_css(css); 4124 4124 if (err) 4125 - goto err_free; 4125 + goto err_clear_dir; 4126 4126 4127 4127 dget(cgrp->dentry); 4128 4128 css_get(css->parent); ··· 4138 4138 4139 4139 return 0; 4140 4140 4141 - err_free: 4141 + err_clear_dir: 4142 + cgroup_clear_dir(css->cgroup, 1 << css->ss->subsys_id); 4143 + err_free_percpu_ref: 4142 4144 percpu_ref_cancel_init(&css->refcnt); 4145 + err_free_css: 4143 4146 ss->css_free(css); 4144 4147 return err; 4145 4148 }
+43 -10
kernel/futex.c
··· 234 234 * waiting on a futex. 235 235 */ 236 236 struct futex_hash_bucket { 237 + atomic_t waiters; 237 238 spinlock_t lock; 238 239 struct plist_head chain; 239 240 } ____cacheline_aligned_in_smp; ··· 254 253 smp_mb__after_atomic_inc(); 255 254 } 256 255 257 - static inline bool hb_waiters_pending(struct futex_hash_bucket *hb) 256 + /* 257 + * Reflects a new waiter being added to the waitqueue. 258 + */ 259 + static inline void hb_waiters_inc(struct futex_hash_bucket *hb) 258 260 { 259 261 #ifdef CONFIG_SMP 262 + atomic_inc(&hb->waiters); 260 263 /* 261 - * Tasks trying to enter the critical region are most likely 262 - * potential waiters that will be added to the plist. Ensure 263 - * that wakers won't miss to-be-slept tasks in the window between 264 - * the wait call and the actual plist_add. 264 + * Full barrier (A), see the ordering comment above. 265 265 */ 266 - if (spin_is_locked(&hb->lock)) 267 - return true; 268 - smp_rmb(); /* Make sure we check the lock state first */ 266 + smp_mb__after_atomic_inc(); 267 + #endif 268 + } 269 269 270 - return !plist_head_empty(&hb->chain); 270 + /* 271 + * Reflects a waiter being removed from the waitqueue by wakeup 272 + * paths. 273 + */ 274 + static inline void hb_waiters_dec(struct futex_hash_bucket *hb) 275 + { 276 + #ifdef CONFIG_SMP 277 + atomic_dec(&hb->waiters); 278 + #endif 279 + } 280 + 281 + static inline int hb_waiters_pending(struct futex_hash_bucket *hb) 282 + { 283 + #ifdef CONFIG_SMP 284 + return atomic_read(&hb->waiters); 271 285 #else 272 - return true; 286 + return 1; 273 287 #endif 274 288 } 275 289 ··· 970 954 971 955 hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock); 972 956 plist_del(&q->list, &hb->chain); 957 + hb_waiters_dec(hb); 973 958 } 974 959 975 960 /* ··· 1274 1257 */ 1275 1258 if (likely(&hb1->chain != &hb2->chain)) { 1276 1259 plist_del(&q->list, &hb1->chain); 1260 + hb_waiters_dec(hb1); 1277 1261 plist_add(&q->list, &hb2->chain); 1262 + hb_waiters_inc(hb2); 1278 1263 q->lock_ptr = &hb2->lock; 1279 1264 } 1280 1265 get_futex_key_refs(key2); ··· 1619 1600 struct futex_hash_bucket *hb; 1620 1601 1621 1602 hb = hash_futex(&q->key); 1603 + 1604 + /* 1605 + * Increment the counter before taking the lock so that 1606 + * a potential waker won't miss a to-be-slept task that is 1607 + * waiting for the spinlock. This is safe as all queue_lock() 1608 + * users end up calling queue_me(). Similarly, for housekeeping, 1609 + * decrement the counter at queue_unlock() when some error has 1610 + * occurred and we don't end up adding the task to the list. 1611 + */ 1612 + hb_waiters_inc(hb); 1613 + 1622 1614 q->lock_ptr = &hb->lock; 1623 1615 1624 1616 spin_lock(&hb->lock); /* implies MB (A) */ ··· 1641 1611 __releases(&hb->lock) 1642 1612 { 1643 1613 spin_unlock(&hb->lock); 1614 + hb_waiters_dec(hb); 1644 1615 } 1645 1616 1646 1617 /** ··· 2373 2342 * Unqueue the futex_q and determine which it was. 2374 2343 */ 2375 2344 plist_del(&q->list, &hb->chain); 2345 + hb_waiters_dec(hb); 2376 2346 2377 2347 /* Handle spurious wakeups gracefully */ 2378 2348 ret = -EWOULDBLOCK; ··· 2907 2875 futex_cmpxchg_enabled = 1; 2908 2876 2909 2877 for (i = 0; i < futex_hashsize; i++) { 2878 + atomic_set(&futex_queues[i].waiters, 0); 2910 2879 plist_head_init(&futex_queues[i].chain); 2911 2880 spin_lock_init(&futex_queues[i].lock); 2912 2881 }
+2 -2
kernel/sched/clock.c
··· 301 301 if (unlikely(!sched_clock_running)) 302 302 return 0ull; 303 303 304 - preempt_disable(); 304 + preempt_disable_notrace(); 305 305 scd = cpu_sdc(cpu); 306 306 307 307 if (cpu != smp_processor_id()) 308 308 clock = sched_clock_remote(scd); 309 309 else 310 310 clock = sched_clock_local(scd); 311 - preempt_enable(); 311 + preempt_enable_notrace(); 312 312 313 313 return clock; 314 314 }
+9
kernel/sched/core.c
··· 3338 3338 return -EPERM; 3339 3339 } 3340 3340 3341 + /* 3342 + * Can't set/change SCHED_DEADLINE policy at all for now 3343 + * (safest behavior); in the future we would like to allow 3344 + * unprivileged DL tasks to increase their relative deadline 3345 + * or reduce their runtime (both ways reducing utilization) 3346 + */ 3347 + if (dl_policy(policy)) 3348 + return -EPERM; 3349 + 3341 3350 /* 3342 3351 * Treat SCHED_IDLE as nice 20. Only allow a switch to 3343 3352 * SCHED_NORMAL if the RLIMIT_NICE would normally permit it.
+1 -1
kernel/stop_machine.c
··· 293 293 */ 294 294 smp_call_function_single(min(cpu1, cpu2), 295 295 &irq_cpu_stop_queue_work, 296 - &call_args, 0); 296 + &call_args, 1); 297 297 lg_local_unlock(&stop_cpus_lock); 298 298 preempt_enable(); 299 299
-6
kernel/trace/trace_events.c
··· 27 27 28 28 DEFINE_MUTEX(event_mutex); 29 29 30 - DEFINE_MUTEX(event_storage_mutex); 31 - EXPORT_SYMBOL_GPL(event_storage_mutex); 32 - 33 - char event_storage[EVENT_STORAGE_SIZE]; 34 - EXPORT_SYMBOL_GPL(event_storage); 35 - 36 30 LIST_HEAD(ftrace_events); 37 31 static LIST_HEAD(ftrace_common_fields); 38 32
+2 -5
kernel/trace/trace_export.c
··· 95 95 #undef __array 96 96 #define __array(type, item, len) \ 97 97 do { \ 98 + char *type_str = #type"["__stringify(len)"]"; \ 98 99 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ 99 - mutex_lock(&event_storage_mutex); \ 100 - snprintf(event_storage, sizeof(event_storage), \ 101 - "%s[%d]", #type, len); \ 102 - ret = trace_define_field(event_call, event_storage, #item, \ 100 + ret = trace_define_field(event_call, type_str, #item, \ 103 101 offsetof(typeof(field), item), \ 104 102 sizeof(field.item), \ 105 103 is_signed_type(type), filter_type); \ 106 - mutex_unlock(&event_storage_mutex); \ 107 104 if (ret) \ 108 105 return ret; \ 109 106 } while (0);
+3 -3
lib/fonts/Kconfig
··· 9 9 10 10 config FONTS 11 11 bool "Select compiled-in fonts" 12 - depends on FRAMEBUFFER_CONSOLE 12 + depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE 13 13 help 14 14 Say Y here if you would like to use fonts other than the default 15 15 your frame buffer console usually use. ··· 22 22 23 23 config FONT_8x8 24 24 bool "VGA 8x8 font" if FONTS 25 - depends on FRAMEBUFFER_CONSOLE 25 + depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE 26 26 default y if !SPARC && !FONTS 27 27 help 28 28 This is the "high resolution" font for the VGA frame buffer (the one ··· 45 45 46 46 config FONT_6x11 47 47 bool "Mac console 6x11 font (not supported by all drivers)" if FONTS 48 - depends on FRAMEBUFFER_CONSOLE 48 + depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE 49 49 default y if !SPARC && !FONTS && MAC 50 50 help 51 51 Small console font with Macintosh-style high-half glyphs. Some Mac
+23 -7
mm/fremap.c
··· 23 23 24 24 #include "internal.h" 25 25 26 + static int mm_counter(struct page *page) 27 + { 28 + return PageAnon(page) ? MM_ANONPAGES : MM_FILEPAGES; 29 + } 30 + 26 31 static void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma, 27 32 unsigned long addr, pte_t *ptep) 28 33 { 29 34 pte_t pte = *ptep; 35 + struct page *page; 36 + swp_entry_t entry; 30 37 31 38 if (pte_present(pte)) { 32 - struct page *page; 33 - 34 39 flush_cache_page(vma, addr, pte_pfn(pte)); 35 40 pte = ptep_clear_flush(vma, addr, ptep); 36 41 page = vm_normal_page(vma, addr, pte); 37 42 if (page) { 38 43 if (pte_dirty(pte)) 39 44 set_page_dirty(page); 45 + update_hiwater_rss(mm); 46 + dec_mm_counter(mm, mm_counter(page)); 40 47 page_remove_rmap(page); 41 48 page_cache_release(page); 42 - update_hiwater_rss(mm); 43 - dec_mm_counter(mm, MM_FILEPAGES); 44 49 } 45 - } else { 46 - if (!pte_file(pte)) 47 - free_swap_and_cache(pte_to_swp_entry(pte)); 50 + } else { /* zap_pte() is not called when pte_none() */ 51 + if (!pte_file(pte)) { 52 + update_hiwater_rss(mm); 53 + entry = pte_to_swp_entry(pte); 54 + if (non_swap_entry(entry)) { 55 + if (is_migration_entry(entry)) { 56 + page = migration_entry_to_page(entry); 57 + dec_mm_counter(mm, mm_counter(page)); 58 + } 59 + } else { 60 + free_swap_and_cache(entry); 61 + dec_mm_counter(mm, MM_SWAPENTS); 62 + } 63 + } 48 64 pte_clear_not_present_full(mm, addr, ptep, 0); 49 65 } 50 66 }
+32
mm/migrate.c
··· 178 178 } 179 179 180 180 /* 181 + * Congratulations to trinity for discovering this bug. 182 + * mm/fremap.c's remap_file_pages() accepts any range within a single vma to 183 + * convert that vma to VM_NONLINEAR; and generic_file_remap_pages() will then 184 + * replace the specified range by file ptes throughout (maybe populated after). 185 + * If page migration finds a page within that range, while it's still located 186 + * by vma_interval_tree rather than lost to i_mmap_nonlinear list, no problem: 187 + * zap_pte() clears the temporary migration entry before mmap_sem is dropped. 188 + * But if the migrating page is in a part of the vma outside the range to be 189 + * remapped, then it will not be cleared, and remove_migration_ptes() needs to 190 + * deal with it. Fortunately, this part of the vma is of course still linear, 191 + * so we just need to use linear location on the nonlinear list. 192 + */ 193 + static int remove_linear_migration_ptes_from_nonlinear(struct page *page, 194 + struct address_space *mapping, void *arg) 195 + { 196 + struct vm_area_struct *vma; 197 + /* hugetlbfs does not support remap_pages, so no huge pgoff worries */ 198 + pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); 199 + unsigned long addr; 200 + 201 + list_for_each_entry(vma, 202 + &mapping->i_mmap_nonlinear, shared.nonlinear) { 203 + 204 + addr = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); 205 + if (addr >= vma->vm_start && addr < vma->vm_end) 206 + remove_migration_pte(page, vma, addr, arg); 207 + } 208 + return SWAP_AGAIN; 209 + } 210 + 211 + /* 181 212 * Get rid of all migration entries and replace them by 182 213 * references to the indicated page. 183 214 */ ··· 217 186 struct rmap_walk_control rwc = { 218 187 .rmap_one = remove_migration_pte, 219 188 .arg = old, 189 + .file_nonlinear = remove_linear_migration_ptes_from_nonlinear, 220 190 }; 221 191 222 192 rmap_walk(new, &rwc);
+3 -2
mm/rmap.c
··· 1360 1360 } 1361 1361 1362 1362 static int try_to_unmap_nonlinear(struct page *page, 1363 - struct address_space *mapping, struct vm_area_struct *vma) 1363 + struct address_space *mapping, void *arg) 1364 1364 { 1365 + struct vm_area_struct *vma; 1365 1366 int ret = SWAP_AGAIN; 1366 1367 unsigned long cursor; 1367 1368 unsigned long max_nl_cursor = 0; ··· 1664 1663 if (list_empty(&mapping->i_mmap_nonlinear)) 1665 1664 goto done; 1666 1665 1667 - ret = rwc->file_nonlinear(page, mapping, vma); 1666 + ret = rwc->file_nonlinear(page, mapping, rwc->arg); 1668 1667 1669 1668 done: 1670 1669 mutex_unlock(&mapping->i_mmap_mutex);
+6 -4
net/core/rtnetlink.c
··· 2126 2126 static int nlmsg_populate_fdb_fill(struct sk_buff *skb, 2127 2127 struct net_device *dev, 2128 2128 u8 *addr, u32 pid, u32 seq, 2129 - int type, unsigned int flags) 2129 + int type, unsigned int flags, 2130 + int nlflags) 2130 2131 { 2131 2132 struct nlmsghdr *nlh; 2132 2133 struct ndmsg *ndm; 2133 2134 2134 - nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), NLM_F_MULTI); 2135 + nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags); 2135 2136 if (!nlh) 2136 2137 return -EMSGSIZE; 2137 2138 ··· 2170 2169 if (!skb) 2171 2170 goto errout; 2172 2171 2173 - err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF); 2172 + err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF, 0); 2174 2173 if (err < 0) { 2175 2174 kfree_skb(skb); 2176 2175 goto errout; ··· 2395 2394 2396 2395 err = nlmsg_populate_fdb_fill(skb, dev, ha->addr, 2397 2396 portid, seq, 2398 - RTM_NEWNEIGH, NTF_SELF); 2397 + RTM_NEWNEIGH, NTF_SELF, 2398 + NLM_F_MULTI); 2399 2399 if (err < 0) 2400 2400 return err; 2401 2401 skip:
+8 -5
net/ipv4/ipmr.c
··· 2255 2255 } 2256 2256 2257 2257 static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, 2258 - u32 portid, u32 seq, struct mfc_cache *c, int cmd) 2258 + u32 portid, u32 seq, struct mfc_cache *c, int cmd, 2259 + int flags) 2259 2260 { 2260 2261 struct nlmsghdr *nlh; 2261 2262 struct rtmsg *rtm; 2262 2263 int err; 2263 2264 2264 - nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI); 2265 + nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags); 2265 2266 if (nlh == NULL) 2266 2267 return -EMSGSIZE; 2267 2268 ··· 2330 2329 if (skb == NULL) 2331 2330 goto errout; 2332 2331 2333 - err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd); 2332 + err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0); 2334 2333 if (err < 0) 2335 2334 goto errout; 2336 2335 ··· 2369 2368 if (ipmr_fill_mroute(mrt, skb, 2370 2369 NETLINK_CB(cb->skb).portid, 2371 2370 cb->nlh->nlmsg_seq, 2372 - mfc, RTM_NEWROUTE) < 0) 2371 + mfc, RTM_NEWROUTE, 2372 + NLM_F_MULTI) < 0) 2373 2373 goto done; 2374 2374 next_entry: 2375 2375 e++; ··· 2384 2382 if (ipmr_fill_mroute(mrt, skb, 2385 2383 NETLINK_CB(cb->skb).portid, 2386 2384 cb->nlh->nlmsg_seq, 2387 - mfc, RTM_NEWROUTE) < 0) { 2385 + mfc, RTM_NEWROUTE, 2386 + NLM_F_MULTI) < 0) { 2388 2387 spin_unlock_bh(&mfc_unres_lock); 2389 2388 goto done; 2390 2389 }
+6 -8
net/ipv6/ip6_output.c
··· 1101 1101 unsigned int fragheaderlen, 1102 1102 struct sk_buff *skb, 1103 1103 struct rt6_info *rt, 1104 - bool pmtuprobe) 1104 + unsigned int orig_mtu) 1105 1105 { 1106 1106 if (!(rt->dst.flags & DST_XFRM_TUNNEL)) { 1107 1107 if (skb == NULL) { 1108 1108 /* first fragment, reserve header_len */ 1109 - *mtu = *mtu - rt->dst.header_len; 1109 + *mtu = orig_mtu - rt->dst.header_len; 1110 1110 1111 1111 } else { 1112 1112 /* 1113 1113 * this fragment is not first, the headers 1114 1114 * space is regarded as data space. 1115 1115 */ 1116 - *mtu = min(*mtu, pmtuprobe ? 1117 - rt->dst.dev->mtu : 1118 - dst_mtu(rt->dst.path)); 1116 + *mtu = orig_mtu; 1119 1117 } 1120 1118 *maxfraglen = ((*mtu - fragheaderlen) & ~7) 1121 1119 + fragheaderlen - sizeof(struct frag_hdr); ··· 1130 1132 struct ipv6_pinfo *np = inet6_sk(sk); 1131 1133 struct inet_cork *cork; 1132 1134 struct sk_buff *skb, *skb_prev = NULL; 1133 - unsigned int maxfraglen, fragheaderlen, mtu; 1135 + unsigned int maxfraglen, fragheaderlen, mtu, orig_mtu; 1134 1136 int exthdrlen; 1135 1137 int dst_exthdrlen; 1136 1138 int hh_len; ··· 1212 1214 dst_exthdrlen = 0; 1213 1215 mtu = cork->fragsize; 1214 1216 } 1217 + orig_mtu = mtu; 1215 1218 1216 1219 hh_len = LL_RESERVED_SPACE(rt->dst.dev); 1217 1220 ··· 1312 1313 if (skb == NULL || skb_prev == NULL) 1313 1314 ip6_append_data_mtu(&mtu, &maxfraglen, 1314 1315 fragheaderlen, skb, rt, 1315 - np->pmtudisc >= 1316 - IPV6_PMTUDISC_PROBE); 1316 + orig_mtu); 1317 1317 1318 1318 skb_prev = skb; 1319 1319
+8 -5
net/ipv6/ip6mr.c
··· 2349 2349 } 2350 2350 2351 2351 static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, 2352 - u32 portid, u32 seq, struct mfc6_cache *c, int cmd) 2352 + u32 portid, u32 seq, struct mfc6_cache *c, int cmd, 2353 + int flags) 2353 2354 { 2354 2355 struct nlmsghdr *nlh; 2355 2356 struct rtmsg *rtm; 2356 2357 int err; 2357 2358 2358 - nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI); 2359 + nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags); 2359 2360 if (nlh == NULL) 2360 2361 return -EMSGSIZE; 2361 2362 ··· 2424 2423 if (skb == NULL) 2425 2424 goto errout; 2426 2425 2427 - err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd); 2426 + err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0); 2428 2427 if (err < 0) 2429 2428 goto errout; 2430 2429 ··· 2463 2462 if (ip6mr_fill_mroute(mrt, skb, 2464 2463 NETLINK_CB(cb->skb).portid, 2465 2464 cb->nlh->nlmsg_seq, 2466 - mfc, RTM_NEWROUTE) < 0) 2465 + mfc, RTM_NEWROUTE, 2466 + NLM_F_MULTI) < 0) 2467 2467 goto done; 2468 2468 next_entry: 2469 2469 e++; ··· 2478 2476 if (ip6mr_fill_mroute(mrt, skb, 2479 2477 NETLINK_CB(cb->skb).portid, 2480 2478 cb->nlh->nlmsg_seq, 2481 - mfc, RTM_NEWROUTE) < 0) { 2479 + mfc, RTM_NEWROUTE, 2480 + NLM_F_MULTI) < 0) { 2482 2481 spin_unlock_bh(&mfc_unres_lock); 2483 2482 goto done; 2484 2483 }
+10 -9
net/key/af_key.c
··· 434 434 return 0; 435 435 } 436 436 437 - static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx) 437 + static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx, 438 + gfp_t gfp) 438 439 { 439 440 struct xfrm_user_sec_ctx *uctx = NULL; 440 441 int ctx_size = sec_ctx->sadb_x_ctx_len; 441 442 442 - uctx = kmalloc((sizeof(*uctx)+ctx_size), GFP_KERNEL); 443 + uctx = kmalloc((sizeof(*uctx)+ctx_size), gfp); 443 444 444 445 if (!uctx) 445 446 return NULL; ··· 1126 1125 1127 1126 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 1128 1127 if (sec_ctx != NULL) { 1129 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 1128 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 1130 1129 1131 1130 if (!uctx) 1132 1131 goto out; ··· 2250 2249 2251 2250 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 2252 2251 if (sec_ctx != NULL) { 2253 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 2252 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 2254 2253 2255 2254 if (!uctx) { 2256 2255 err = -ENOBUFS; 2257 2256 goto out; 2258 2257 } 2259 2258 2260 - err = security_xfrm_policy_alloc(&xp->security, uctx); 2259 + err = security_xfrm_policy_alloc(&xp->security, uctx, GFP_KERNEL); 2261 2260 kfree(uctx); 2262 2261 2263 2262 if (err) ··· 2354 2353 2355 2354 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 2356 2355 if (sec_ctx != NULL) { 2357 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 2356 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 2358 2357 2359 2358 if (!uctx) 2360 2359 return -ENOMEM; 2361 2360 2362 - err = security_xfrm_policy_alloc(&pol_ctx, uctx); 2361 + err = security_xfrm_policy_alloc(&pol_ctx, uctx, GFP_KERNEL); 2363 2362 kfree(uctx); 2364 2363 if (err) 2365 2364 return err; ··· 3276 3275 } 3277 3276 if ((*dir = verify_sec_ctx_len(p))) 3278 3277 goto out; 3279 - uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 3280 - *dir = security_xfrm_policy_alloc(&xp->security, uctx); 3278 + uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_ATOMIC); 3279 + *dir = security_xfrm_policy_alloc(&xp->security, uctx, GFP_ATOMIC); 3281 3280 kfree(uctx); 3282 3281 3283 3282 if (*dir)
+6 -5
net/openvswitch/datapath.c
··· 1174 1174 struct datapath *dp; 1175 1175 1176 1176 dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs); 1177 - if (!dp) 1177 + if (IS_ERR(dp)) 1178 1178 return; 1179 1179 1180 1180 WARN(dp->user_features, "Dropping previously announced user features\n"); ··· 1756 1756 int bucket = cb->args[0], skip = cb->args[1]; 1757 1757 int i, j = 0; 1758 1758 1759 - dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); 1760 - if (!dp) 1761 - return -ENODEV; 1762 - 1763 1759 rcu_read_lock(); 1760 + dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); 1761 + if (!dp) { 1762 + rcu_read_unlock(); 1763 + return -ENODEV; 1764 + } 1764 1765 for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) { 1765 1766 struct vport *vport; 1766 1767
+2 -1
net/openvswitch/flow.c
··· 73 73 74 74 if ((flow->key.eth.type == htons(ETH_P_IP) || 75 75 flow->key.eth.type == htons(ETH_P_IPV6)) && 76 + flow->key.ip.frag != OVS_FRAG_TYPE_LATER && 76 77 flow->key.ip.proto == IPPROTO_TCP && 77 78 likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { 78 79 tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb)); ··· 92 91 unsigned long *used, __be16 *tcp_flags) 93 92 { 94 93 spin_lock(&stats->lock); 95 - if (time_after(stats->used, *used)) 94 + if (!*used || time_after(stats->used, *used)) 96 95 *used = stats->used; 97 96 *tcp_flags |= stats->tcp_flags; 98 97 ovs_stats->n_packets += stats->packet_count;
+15 -14
net/tipc/subscr.c
··· 263 263 * 264 264 * Called with subscriber lock held. 265 265 */ 266 - static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s, 267 - struct tipc_subscriber *subscriber) 268 - { 266 + static int subscr_subscribe(struct tipc_subscr *s, 267 + struct tipc_subscriber *subscriber, 268 + struct tipc_subscription **sub_p) { 269 269 struct tipc_subscription *sub; 270 270 int swap; 271 271 ··· 276 276 if (s->filter & htohl(TIPC_SUB_CANCEL, swap)) { 277 277 s->filter &= ~htohl(TIPC_SUB_CANCEL, swap); 278 278 subscr_cancel(s, subscriber); 279 - return NULL; 279 + return 0; 280 280 } 281 281 282 282 /* Refuse subscription if global limit exceeded */ 283 283 if (atomic_read(&subscription_count) >= TIPC_MAX_SUBSCRIPTIONS) { 284 284 pr_warn("Subscription rejected, limit reached (%u)\n", 285 285 TIPC_MAX_SUBSCRIPTIONS); 286 - subscr_terminate(subscriber); 287 - return NULL; 286 + return -EINVAL; 288 287 } 289 288 290 289 /* Allocate subscription object */ 291 290 sub = kmalloc(sizeof(*sub), GFP_ATOMIC); 292 291 if (!sub) { 293 292 pr_warn("Subscription rejected, no memory\n"); 294 - subscr_terminate(subscriber); 295 - return NULL; 293 + return -ENOMEM; 296 294 } 297 295 298 296 /* Initialize subscription object */ ··· 304 306 (sub->seq.lower > sub->seq.upper)) { 305 307 pr_warn("Subscription rejected, illegal request\n"); 306 308 kfree(sub); 307 - subscr_terminate(subscriber); 308 - return NULL; 309 + return -EINVAL; 309 310 } 310 311 INIT_LIST_HEAD(&sub->nameseq_list); 311 312 list_add(&sub->subscription_list, &subscriber->subscription_list); ··· 317 320 (Handler)subscr_timeout, (unsigned long)sub); 318 321 k_start_timer(&sub->timer, sub->timeout); 319 322 } 320 - 321 - return sub; 323 + *sub_p = sub; 324 + return 0; 322 325 } 323 326 324 327 /* Handle one termination request for the subscriber */ ··· 332 335 void *usr_data, void *buf, size_t len) 333 336 { 334 337 struct tipc_subscriber *subscriber = usr_data; 335 - struct tipc_subscription *sub; 338 + struct tipc_subscription *sub = NULL; 336 339 337 340 spin_lock_bh(&subscriber->lock); 338 - sub = subscr_subscribe((struct tipc_subscr *)buf, subscriber); 341 + if (subscr_subscribe((struct tipc_subscr *)buf, subscriber, &sub) < 0) { 342 + spin_unlock_bh(&subscriber->lock); 343 + subscr_terminate(subscriber); 344 + return; 345 + } 339 346 if (sub) 340 347 tipc_nametbl_subscribe(sub); 341 348 spin_unlock_bh(&subscriber->lock);
+3 -3
net/xfrm/xfrm_user.c
··· 1246 1246 return 0; 1247 1247 1248 1248 uctx = nla_data(rt); 1249 - return security_xfrm_policy_alloc(&pol->security, uctx); 1249 + return security_xfrm_policy_alloc(&pol->security, uctx, GFP_KERNEL); 1250 1250 } 1251 1251 1252 1252 static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, ··· 1651 1651 if (rt) { 1652 1652 struct xfrm_user_sec_ctx *uctx = nla_data(rt); 1653 1653 1654 - err = security_xfrm_policy_alloc(&ctx, uctx); 1654 + err = security_xfrm_policy_alloc(&ctx, uctx, GFP_KERNEL); 1655 1655 if (err) 1656 1656 return err; 1657 1657 } ··· 1953 1953 if (rt) { 1954 1954 struct xfrm_user_sec_ctx *uctx = nla_data(rt); 1955 1955 1956 - err = security_xfrm_policy_alloc(&ctx, uctx); 1956 + err = security_xfrm_policy_alloc(&ctx, uctx, GFP_KERNEL); 1957 1957 if (err) 1958 1958 return err; 1959 1959 }
+2 -1
security/capability.c
··· 757 757 758 758 #ifdef CONFIG_SECURITY_NETWORK_XFRM 759 759 static int cap_xfrm_policy_alloc_security(struct xfrm_sec_ctx **ctxp, 760 - struct xfrm_user_sec_ctx *sec_ctx) 760 + struct xfrm_user_sec_ctx *sec_ctx, 761 + gfp_t gfp) 761 762 { 762 763 return 0; 763 764 }
+4 -2
security/security.c
··· 1317 1317 1318 1318 #ifdef CONFIG_SECURITY_NETWORK_XFRM 1319 1319 1320 - int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx) 1320 + int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 1321 + struct xfrm_user_sec_ctx *sec_ctx, 1322 + gfp_t gfp) 1321 1323 { 1322 - return security_ops->xfrm_policy_alloc_security(ctxp, sec_ctx); 1324 + return security_ops->xfrm_policy_alloc_security(ctxp, sec_ctx, gfp); 1323 1325 } 1324 1326 EXPORT_SYMBOL(security_xfrm_policy_alloc); 1325 1327
+7 -6
security/selinux/hooks.c
··· 668 668 if (flags[i] == SBLABEL_MNT) 669 669 continue; 670 670 rc = security_context_to_sid(mount_options[i], 671 - strlen(mount_options[i]), &sid); 671 + strlen(mount_options[i]), &sid, GFP_KERNEL); 672 672 if (rc) { 673 673 printk(KERN_WARNING "SELinux: security_context_to_sid" 674 674 "(%s) failed for (dev %s, type %s) errno=%d\n", ··· 2489 2489 if (flags[i] == SBLABEL_MNT) 2490 2490 continue; 2491 2491 len = strlen(mount_options[i]); 2492 - rc = security_context_to_sid(mount_options[i], len, &sid); 2492 + rc = security_context_to_sid(mount_options[i], len, &sid, 2493 + GFP_KERNEL); 2493 2494 if (rc) { 2494 2495 printk(KERN_WARNING "SELinux: security_context_to_sid" 2495 2496 "(%s) failed for (dev %s, type %s) errno=%d\n", ··· 2894 2893 if (rc) 2895 2894 return rc; 2896 2895 2897 - rc = security_context_to_sid(value, size, &newsid); 2896 + rc = security_context_to_sid(value, size, &newsid, GFP_KERNEL); 2898 2897 if (rc == -EINVAL) { 2899 2898 if (!capable(CAP_MAC_ADMIN)) { 2900 2899 struct audit_buffer *ab; ··· 3051 3050 if (!value || !size) 3052 3051 return -EACCES; 3053 3052 3054 - rc = security_context_to_sid((void *)value, size, &newsid); 3053 + rc = security_context_to_sid((void *)value, size, &newsid, GFP_KERNEL); 3055 3054 if (rc) 3056 3055 return rc; 3057 3056 ··· 5530 5529 str[size-1] = 0; 5531 5530 size--; 5532 5531 } 5533 - error = security_context_to_sid(value, size, &sid); 5532 + error = security_context_to_sid(value, size, &sid, GFP_KERNEL); 5534 5533 if (error == -EINVAL && !strcmp(name, "fscreate")) { 5535 5534 if (!capable(CAP_MAC_ADMIN)) { 5536 5535 struct audit_buffer *ab; ··· 5639 5638 5640 5639 static int selinux_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid) 5641 5640 { 5642 - return security_context_to_sid(secdata, seclen, secid); 5641 + return security_context_to_sid(secdata, seclen, secid, GFP_KERNEL); 5643 5642 } 5644 5643 5645 5644 static void selinux_release_secctx(char *secdata, u32 seclen)
+1 -1
security/selinux/include/security.h
··· 134 134 int security_sid_to_context_force(u32 sid, char **scontext, u32 *scontext_len); 135 135 136 136 int security_context_to_sid(const char *scontext, u32 scontext_len, 137 - u32 *out_sid); 137 + u32 *out_sid, gfp_t gfp); 138 138 139 139 int security_context_to_sid_default(const char *scontext, u32 scontext_len, 140 140 u32 *out_sid, u32 def_sid, gfp_t gfp_flags);
+2 -1
security/selinux/include/xfrm.h
··· 10 10 #include <net/flow.h> 11 11 12 12 int selinux_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 13 - struct xfrm_user_sec_ctx *uctx); 13 + struct xfrm_user_sec_ctx *uctx, 14 + gfp_t gfp); 14 15 int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, 15 16 struct xfrm_sec_ctx **new_ctxp); 16 17 void selinux_xfrm_policy_free(struct xfrm_sec_ctx *ctx);
+18 -10
security/selinux/selinuxfs.c
··· 576 576 if (length) 577 577 goto out; 578 578 579 - length = security_context_to_sid(buf, size, &sid); 579 + length = security_context_to_sid(buf, size, &sid, GFP_KERNEL); 580 580 if (length) 581 581 goto out; 582 582 ··· 731 731 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) 732 732 goto out; 733 733 734 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 734 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 735 + GFP_KERNEL); 735 736 if (length) 736 737 goto out; 737 738 738 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 739 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 740 + GFP_KERNEL); 739 741 if (length) 740 742 goto out; 741 743 ··· 819 817 objname = namebuf; 820 818 } 821 819 822 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 820 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 821 + GFP_KERNEL); 823 822 if (length) 824 823 goto out; 825 824 826 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 825 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 826 + GFP_KERNEL); 827 827 if (length) 828 828 goto out; 829 829 ··· 882 878 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) 883 879 goto out; 884 880 885 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 881 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 882 + GFP_KERNEL); 886 883 if (length) 887 884 goto out; 888 885 889 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 886 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 887 + GFP_KERNEL); 890 888 if (length) 891 889 goto out; 892 890 ··· 940 934 if (sscanf(buf, "%s %s", con, user) != 2) 941 935 goto out; 942 936 943 - length = security_context_to_sid(con, strlen(con) + 1, &sid); 937 + length = security_context_to_sid(con, strlen(con) + 1, &sid, GFP_KERNEL); 944 938 if (length) 945 939 goto out; 946 940 ··· 1000 994 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) 1001 995 goto out; 1002 996 1003 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 997 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 998 + GFP_KERNEL); 1004 999 if (length) 1005 1000 goto out; 1006 1001 1007 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 1002 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 1003 + GFP_KERNEL); 1008 1004 if (length) 1009 1005 goto out; 1010 1006
+4 -2
security/selinux/ss/services.c
··· 1289 1289 * @scontext: security context 1290 1290 * @scontext_len: length in bytes 1291 1291 * @sid: security identifier, SID 1292 + * @gfp: context for the allocation 1292 1293 * 1293 1294 * Obtains a SID associated with the security context that 1294 1295 * has the string representation specified by @scontext. 1295 1296 * Returns -%EINVAL if the context is invalid, -%ENOMEM if insufficient 1296 1297 * memory is available, or 0 on success. 1297 1298 */ 1298 - int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid) 1299 + int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid, 1300 + gfp_t gfp) 1299 1301 { 1300 1302 return security_context_to_sid_core(scontext, scontext_len, 1301 - sid, SECSID_NULL, GFP_KERNEL, 0); 1303 + sid, SECSID_NULL, gfp, 0); 1302 1304 } 1303 1305 1304 1306 /**
+8 -6
security/selinux/xfrm.c
··· 78 78 * xfrm_user_sec_ctx context. 79 79 */ 80 80 static int selinux_xfrm_alloc_user(struct xfrm_sec_ctx **ctxp, 81 - struct xfrm_user_sec_ctx *uctx) 81 + struct xfrm_user_sec_ctx *uctx, 82 + gfp_t gfp) 82 83 { 83 84 int rc; 84 85 const struct task_security_struct *tsec = current_security(); ··· 95 94 if (str_len >= PAGE_SIZE) 96 95 return -ENOMEM; 97 96 98 - ctx = kmalloc(sizeof(*ctx) + str_len + 1, GFP_KERNEL); 97 + ctx = kmalloc(sizeof(*ctx) + str_len + 1, gfp); 99 98 if (!ctx) 100 99 return -ENOMEM; 101 100 ··· 104 103 ctx->ctx_len = str_len; 105 104 memcpy(ctx->ctx_str, &uctx[1], str_len); 106 105 ctx->ctx_str[str_len] = '\0'; 107 - rc = security_context_to_sid(ctx->ctx_str, str_len, &ctx->ctx_sid); 106 + rc = security_context_to_sid(ctx->ctx_str, str_len, &ctx->ctx_sid, gfp); 108 107 if (rc) 109 108 goto err; 110 109 ··· 283 282 * LSM hook implementation that allocs and transfers uctx spec to xfrm_policy. 284 283 */ 285 284 int selinux_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 286 - struct xfrm_user_sec_ctx *uctx) 285 + struct xfrm_user_sec_ctx *uctx, 286 + gfp_t gfp) 287 287 { 288 - return selinux_xfrm_alloc_user(ctxp, uctx); 288 + return selinux_xfrm_alloc_user(ctxp, uctx, gfp); 289 289 } 290 290 291 291 /* ··· 334 332 int selinux_xfrm_state_alloc(struct xfrm_state *x, 335 333 struct xfrm_user_sec_ctx *uctx) 336 334 { 337 - return selinux_xfrm_alloc_user(&x->security, uctx); 335 + return selinux_xfrm_alloc_user(&x->security, uctx, GFP_KERNEL); 338 336 } 339 337 340 338 /*
+1 -1
sound/core/compress_offload.c
··· 133 133 kfree(data); 134 134 } 135 135 snd_card_unref(compr->card); 136 - return 0; 136 + return ret; 137 137 } 138 138 139 139 static int snd_compr_free(struct inode *inode, struct file *f)
+24 -6
sound/pci/oxygen/xonar_dg.c
··· 238 238 cs4245_write_spi(chip, CS4245_MCLK_FREQ); 239 239 } 240 240 241 + static inline unsigned int shift_bits(unsigned int value, 242 + unsigned int shift_from, 243 + unsigned int shift_to, 244 + unsigned int mask) 245 + { 246 + if (shift_from < shift_to) 247 + return (value << (shift_to - shift_from)) & mask; 248 + else 249 + return (value >> (shift_from - shift_to)) & mask; 250 + } 251 + 241 252 unsigned int adjust_dg_dac_routing(struct oxygen *chip, 242 253 unsigned int play_routing) 243 254 { 244 255 struct dg *data = chip->model_data; 245 - unsigned int routing = 0; 246 256 247 257 switch (data->output_sel) { 248 258 case PLAYBACK_DST_HP: ··· 262 252 OXYGEN_PLAY_MUTE67, OXYGEN_PLAY_MUTE_MASK); 263 253 break; 264 254 case PLAYBACK_DST_MULTICH: 265 - routing = (0 << OXYGEN_PLAY_DAC0_SOURCE_SHIFT) | 266 - (2 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | 267 - (1 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | 268 - (0 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); 269 255 oxygen_write8_masked(chip, OXYGEN_PLAY_ROUTING, 270 256 OXYGEN_PLAY_MUTE01, OXYGEN_PLAY_MUTE_MASK); 271 257 break; 272 258 } 273 - return routing; 259 + return (play_routing & OXYGEN_PLAY_DAC0_SOURCE_MASK) | 260 + shift_bits(play_routing, 261 + OXYGEN_PLAY_DAC2_SOURCE_SHIFT, 262 + OXYGEN_PLAY_DAC1_SOURCE_SHIFT, 263 + OXYGEN_PLAY_DAC1_SOURCE_MASK) | 264 + shift_bits(play_routing, 265 + OXYGEN_PLAY_DAC1_SOURCE_SHIFT, 266 + OXYGEN_PLAY_DAC2_SOURCE_SHIFT, 267 + OXYGEN_PLAY_DAC2_SOURCE_MASK) | 268 + shift_bits(play_routing, 269 + OXYGEN_PLAY_DAC0_SOURCE_SHIFT, 270 + OXYGEN_PLAY_DAC3_SOURCE_SHIFT, 271 + OXYGEN_PLAY_DAC3_SOURCE_MASK); 274 272 } 275 273 276 274 void dump_cs4245_registers(struct oxygen *chip,
+1
tools/perf/bench/numa.c
··· 1593 1593 p->data_rand_walk = true; 1594 1594 p->nr_loops = -1; 1595 1595 p->init_random = true; 1596 + p->run_all = argc == 1; 1596 1597 } 1597 1598 1598 1599 static int run_bench_numa(const char *name, const char **argv)
+1 -1
tools/perf/builtin-bench.c
··· 76 76 77 77 /* Iterate over all benchmarks within a collection: */ 78 78 #define for_each_bench(coll, bench) \ 79 - for (bench = coll->benchmarks; bench->name; bench++) 79 + for (bench = coll->benchmarks; bench && bench->name; bench++) 80 80 81 81 static void dump_benchmarks(struct collection *coll) 82 82 {
+9 -1
tools/perf/builtin-trace.c
··· 825 825 P_SIGNUM(PIPE); 826 826 P_SIGNUM(ALRM); 827 827 P_SIGNUM(TERM); 828 - P_SIGNUM(STKFLT); 829 828 P_SIGNUM(CHLD); 830 829 P_SIGNUM(CONT); 831 830 P_SIGNUM(STOP); ··· 840 841 P_SIGNUM(IO); 841 842 P_SIGNUM(PWR); 842 843 P_SIGNUM(SYS); 844 + #ifdef SIGEMT 845 + P_SIGNUM(EMT); 846 + #endif 847 + #ifdef SIGSTKFLT 848 + P_SIGNUM(STKFLT); 849 + #endif 850 + #ifdef SIGSWI 851 + P_SIGNUM(SWI); 852 + #endif 843 853 default: break; 844 854 } 845 855
+1 -1
tools/perf/util/machine.c
··· 1213 1213 */ 1214 1214 thread__find_addr_location(thread, machine, m, MAP__FUNCTION, 1215 1215 ip, &al); 1216 - if (al.sym) 1216 + if (al.map) 1217 1217 goto found; 1218 1218 } 1219 1219 found:
+3 -3
tools/perf/util/symbol-elf.c
··· 151 151 152 152 gelf_getshdr(sec, shp); 153 153 str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); 154 - if (!strcmp(name, str)) { 154 + if (str && !strcmp(name, str)) { 155 155 if (idx) 156 156 *idx = cnt; 157 - break; 157 + return sec; 158 158 } 159 159 ++cnt; 160 160 } 161 161 162 - return sec; 162 + return NULL; 163 163 } 164 164 165 165 #define elf_section__for_each_rel(reldata, pos, pos_mem, idx, nr_entries) \