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

Merge tag 'asoc-v3.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Final updates for v3.15 merge window

A few more updates from last week - use of the tdm_slot mapping from
Xiubo plus a few smaller fixes and cleanups.

+1131 -837
+1
Documentation/devicetree/bindings/net/micrel-ks8851.txt
··· 7 7 8 8 Optional properties: 9 9 - local-mac-address : Ethernet mac address to use 10 + - vdd-supply: supply for Ethernet mac
+12 -3
Documentation/devicetree/bindings/sound/renesas,rsnd.txt
··· 7 7 required register is 8 8 SRU/ADG/SSI if generation1 9 9 SRU/ADG/SSIU/SSI if generation2 10 - - rcar_sound,ssi : SSI subnode 11 - - rcar_sound,scu : SCU subnode 12 - - rcar_sound,dai : DAI subnode 10 + - rcar_sound,ssi : Should contain SSI feature. 11 + The number of SSI subnode should be same as HW. 12 + see below for detail. 13 + - rcar_sound,src : Should contain SRC feature. 14 + The number of SRC subnode should be same as HW. 15 + see below for detail. 16 + - rcar_sound,dai : DAI contents. 17 + The number of DAI subnode should be same as HW. 18 + see below for detail. 13 19 14 20 SSI subnode properties: 15 21 - interrupts : Should contain SSI interrupt for PIO transfer 16 22 - shared-pin : if shared clock pin 23 + 24 + SRC subnode properties: 25 + no properties at this point 17 26 18 27 DAI subnode properties: 19 28 - playback : list of playback modules
+41 -1
Documentation/devicetree/bindings/sound/simple-card.txt
··· 23 23 24 24 Required subnodes: 25 25 26 + - simple-audio-card,dai-link : container for the CPU and CODEC sub-nodes 27 + This container may be omitted when the 28 + card has only one DAI link. 29 + See the examples. 30 + 26 31 - simple-audio-card,cpu : CPU sub-node 27 32 - simple-audio-card,codec : CODEC sub-node 28 33 ··· 54 49 CPU and CODEC sides as we need to keep the settings identical for both ends 55 50 of the link. 56 51 57 - Example: 52 + Example 1 - single DAI link: 58 53 59 54 sound { 60 55 compatible = "simple-audio-card"; ··· 98 93 reg = <0xec230000 0x400>; 99 94 interrupt-parent = <&gic>; 100 95 interrupts = <0 146 0x4>; 96 + }; 97 + 98 + Example 2 - many DAI links: 99 + 100 + sound { 101 + compatible = "simple-audio-card"; 102 + simple-audio-card,name = "Cubox Audio"; 103 + simple-audio-card,format = "i2s"; 104 + 105 + simple-audio-card,dai-link@0 { /* I2S - HDMI */ 106 + simple-audio-card,cpu { 107 + sound-dai = <&audio1 0>; 108 + }; 109 + simple-audio-card,codec { 110 + sound-dai = <&tda998x 0>; 111 + }; 112 + }; 113 + 114 + simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */ 115 + simple-audio-card,cpu { 116 + sound-dai = <&audio1 1>; 117 + }; 118 + simple-audio-card,codec { 119 + sound-dai = <&tda998x 1>; 120 + }; 121 + }; 122 + 123 + simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */ 124 + simple-audio-card,cpu { 125 + sound-dai = <&audio1 1>; 126 + }; 127 + simple-audio-card,codec { 128 + sound-dai = <&spdif_codec>; 129 + }; 130 + }; 101 131 };
+3 -2
MAINTAINERS
··· 911 911 F: arch/arm/mach-footbridge/ 912 912 913 913 ARM/FREESCALE IMX / MXC ARM ARCHITECTURE 914 - M: Shawn Guo <shawn.guo@linaro.org> 914 + M: Shawn Guo <shawn.guo@freescale.com> 915 915 M: Sascha Hauer <kernel@pengutronix.de> 916 916 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 917 917 S: Maintained 918 - T: git git://git.linaro.org/people/shawnguo/linux-2.6.git 918 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git 919 919 F: arch/arm/mach-imx/ 920 920 F: arch/arm/boot/dts/imx* 921 921 F: arch/arm/configs/imx*_defconfig ··· 4552 4552 M: Alex Duyck <alexander.h.duyck@intel.com> 4553 4553 M: John Ronciak <john.ronciak@intel.com> 4554 4554 M: Mitch Williams <mitch.a.williams@intel.com> 4555 + M: Linux NICS <linux.nics@intel.com> 4555 4556 L: e1000-devel@lists.sourceforge.net 4556 4557 W: http://www.intel.com/support/feedback.htm 4557 4558 W: http://e1000.sourceforge.net/
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 14 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc7 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"
+5 -11
arch/arm/mach-shmobile/board-bockw.c
··· 429 429 .card = "SSI56-AK4643", 430 430 .codec = "ak4642-codec.0-0012", 431 431 .platform = "rcar_sound", 432 - .daifmt = SND_SOC_DAIFMT_LEFT_J, 432 + .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM, 433 433 .cpu_dai = { 434 434 .name = "rsnd-dai.0", 435 - .fmt = SND_SOC_DAIFMT_CBS_CFS, 436 435 }, 437 436 .codec_dai = { 438 437 .name = "ak4642-hifi", 439 - .fmt = SND_SOC_DAIFMT_CBM_CFM, 440 438 .sysclk = 11289600, 441 439 }, 442 440 }, ··· 444 446 .card = "SSI3-AK4554(playback)", 445 447 .codec = "ak4554-adc-dac.0", 446 448 .platform = "rcar_sound", 449 + .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J, 447 450 .cpu_dai = { 448 451 .name = "rsnd-dai.1", 449 - .fmt = SND_SOC_DAIFMT_CBM_CFM | 450 - SND_SOC_DAIFMT_RIGHT_J, 451 452 }, 452 453 .codec_dai = { 453 454 .name = "ak4554-hifi", ··· 458 461 .card = "SSI4-AK4554(capture)", 459 462 .codec = "ak4554-adc-dac.0", 460 463 .platform = "rcar_sound", 464 + .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J, 461 465 .cpu_dai = { 462 466 .name = "rsnd-dai.2", 463 - .fmt = SND_SOC_DAIFMT_CBM_CFM | 464 - SND_SOC_DAIFMT_LEFT_J, 465 467 }, 466 468 .codec_dai = { 467 469 .name = "ak4554-hifi", ··· 472 476 .card = "SSI7-AK4554(playback)", 473 477 .codec = "ak4554-adc-dac.1", 474 478 .platform = "rcar_sound", 479 + .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J, 475 480 .cpu_dai = { 476 481 .name = "rsnd-dai.3", 477 - .fmt = SND_SOC_DAIFMT_CBM_CFM | 478 - SND_SOC_DAIFMT_RIGHT_J, 479 482 }, 480 483 .codec_dai = { 481 484 .name = "ak4554-hifi", ··· 486 491 .card = "SSI8-AK4554(capture)", 487 492 .codec = "ak4554-adc-dac.1", 488 493 .platform = "rcar_sound", 494 + .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J, 489 495 .cpu_dai = { 490 496 .name = "rsnd-dai.4", 491 - .fmt = SND_SOC_DAIFMT_CBM_CFM | 492 - SND_SOC_DAIFMT_LEFT_J, 493 497 }, 494 498 .codec_dai = { 495 499 .name = "ak4554-hifi",
+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
+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
··· 2229 2229 goto clean_ale_ret; 2230 2230 } 2231 2231 2232 - if (cpts_register(&pdev->dev, priv->cpts, 2233 - data->cpts_clock_mult, data->cpts_clock_shift)) 2234 - dev_err(priv->dev, "error registering cpts device\n"); 2235 - 2236 2232 cpsw_notice(priv, probe, "initialized device (regs %pa, irq %d)\n", 2237 2233 &ss_res->start, ndev->irq); 2238 2234
+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
··· 683 683 int phy_suspend(struct phy_device *phydev) 684 684 { 685 685 struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); 686 - struct ethtool_wolinfo wol; 686 + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; 687 687 688 688 /* If the device has WOL enabled, we cannot suspend the PHY */ 689 - wol.cmd = ETHTOOL_GWOL; 690 689 phy_ethtool_get_wol(phydev, &wol); 691 690 if (wol.wolopts) 692 691 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; ··· 81 82 err = usbnet_read_cmd(dev, USB_CDC_GET_NTB_PARAMETERS, 82 83 USB_TYPE_CLASS | USB_DIR_IN 83 84 |USB_RECIP_INTERFACE, 84 - 0, iface_no, &ncm_parm, 85 - sizeof(ncm_parm)); 85 + 0, iface_no, &ctx->ncm_parm, 86 + sizeof(ctx->ncm_parm)); 86 87 if (err < 0) { 87 88 dev_err(&dev->intf->dev, "failed GET_NTB_PARAMETERS\n"); 88 89 return err; /* GET_NTB_PARAMETERS is required */ 89 90 } 90 91 91 92 /* read correct set of parameters according to device mode */ 92 - ctx->rx_max = le32_to_cpu(ncm_parm.dwNtbInMaxSize); 93 - ctx->tx_max = le32_to_cpu(ncm_parm.dwNtbOutMaxSize); 94 - ctx->tx_remainder = le16_to_cpu(ncm_parm.wNdpOutPayloadRemainder); 95 - ctx->tx_modulus = le16_to_cpu(ncm_parm.wNdpOutDivisor); 96 - ctx->tx_ndp_modulus = le16_to_cpu(ncm_parm.wNdpOutAlignment); 93 + ctx->rx_max = le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize); 94 + ctx->tx_max = le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize); 95 + ctx->tx_remainder = le16_to_cpu(ctx->ncm_parm.wNdpOutPayloadRemainder); 96 + ctx->tx_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutDivisor); 97 + ctx->tx_ndp_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutAlignment); 97 98 /* devices prior to NCM Errata shall set this field to zero */ 98 - ctx->tx_max_datagrams = le16_to_cpu(ncm_parm.wNtbOutMaxDatagrams); 99 - ntb_fmt_supported = le16_to_cpu(ncm_parm.bmNtbFormatsSupported); 99 + ctx->tx_max_datagrams = le16_to_cpu(ctx->ncm_parm.wNtbOutMaxDatagrams); 100 + ntb_fmt_supported = le16_to_cpu(ctx->ncm_parm.bmNtbFormatsSupported); 100 101 101 102 /* there are some minor differences in NCM and MBIM defaults */ 102 103 if (cdc_ncm_comm_intf_is_mbim(ctx->control->cur_altsetting)) { ··· 145 146 } 146 147 147 148 /* inform device about NTB input size changes */ 148 - if (ctx->rx_max != le32_to_cpu(ncm_parm.dwNtbInMaxSize)) { 149 + if (ctx->rx_max != le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)) { 149 150 __le32 dwNtbInMaxSize = cpu_to_le32(ctx->rx_max); 150 151 151 152 err = usbnet_write_cmd(dev, USB_CDC_SET_NTB_INPUT_SIZE, ··· 161 162 dev_dbg(&dev->intf->dev, "Using default maximum transmit length=%d\n", 162 163 CDC_NCM_NTB_MAX_SIZE_TX); 163 164 ctx->tx_max = CDC_NCM_NTB_MAX_SIZE_TX; 164 - 165 - /* Adding a pad byte here simplifies the handling in 166 - * cdc_ncm_fill_tx_frame, by making tx_max always 167 - * represent the real skb max size. 168 - */ 169 - if (ctx->tx_max % usb_maxpacket(dev->udev, dev->out, 1) == 0) 170 - ctx->tx_max++; 171 - 172 165 } 173 166 174 167 /* ··· 430 439 goto error2; 431 440 } 432 441 442 + /* initialize data interface */ 443 + if (cdc_ncm_setup(dev)) 444 + goto error2; 445 + 433 446 /* configure data interface */ 434 447 temp = usb_set_interface(dev->udev, iface_no, data_altsetting); 435 448 if (temp) { ··· 445 450 cdc_ncm_find_endpoints(dev, ctx->control); 446 451 if (!dev->in || !dev->out || !dev->status) { 447 452 dev_dbg(&intf->dev, "failed to collect endpoints\n"); 448 - goto error2; 449 - } 450 - 451 - /* initialize data interface */ 452 - if (cdc_ncm_setup(dev)) { 453 - dev_dbg(&intf->dev, "cdc_ncm_setup() failed\n"); 454 453 goto error2; 455 454 } 456 455 ··· 463 474 /* usbnet use these values for sizing tx/rx queues */ 464 475 dev->hard_mtu = ctx->tx_max; 465 476 dev->rx_urb_size = ctx->rx_max; 477 + 478 + /* cdc_ncm_setup will override dwNtbOutMaxSize if it is 479 + * outside the sane range. Adding a pad byte here if necessary 480 + * simplifies the handling in cdc_ncm_fill_tx_frame, making 481 + * tx_max always represent the real skb max size. 482 + */ 483 + if (ctx->tx_max != le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize) && 484 + ctx->tx_max % usb_maxpacket(dev->udev, dev->out, 1) == 0) 485 + ctx->tx_max++; 466 486 467 487 return 0; 468 488
+116 -14
drivers/net/vxlan.c
··· 1318 1318 1319 1319 neigh_release(n); 1320 1320 1321 + if (reply == NULL) 1322 + goto out; 1323 + 1321 1324 skb_reset_mac_header(reply); 1322 1325 __skb_pull(reply, skb_network_offset(reply)); 1323 1326 reply->ip_summed = CHECKSUM_UNNECESSARY; ··· 1342 1339 } 1343 1340 1344 1341 #if IS_ENABLED(CONFIG_IPV6) 1342 + 1343 + static struct sk_buff *vxlan_na_create(struct sk_buff *request, 1344 + struct neighbour *n, bool isrouter) 1345 + { 1346 + struct net_device *dev = request->dev; 1347 + struct sk_buff *reply; 1348 + struct nd_msg *ns, *na; 1349 + struct ipv6hdr *pip6; 1350 + u8 *daddr; 1351 + int na_olen = 8; /* opt hdr + ETH_ALEN for target */ 1352 + int ns_olen; 1353 + int i, len; 1354 + 1355 + if (dev == NULL) 1356 + return NULL; 1357 + 1358 + len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) + 1359 + sizeof(*na) + na_olen + dev->needed_tailroom; 1360 + reply = alloc_skb(len, GFP_ATOMIC); 1361 + if (reply == NULL) 1362 + return NULL; 1363 + 1364 + reply->protocol = htons(ETH_P_IPV6); 1365 + reply->dev = dev; 1366 + skb_reserve(reply, LL_RESERVED_SPACE(request->dev)); 1367 + skb_push(reply, sizeof(struct ethhdr)); 1368 + skb_set_mac_header(reply, 0); 1369 + 1370 + ns = (struct nd_msg *)skb_transport_header(request); 1371 + 1372 + daddr = eth_hdr(request)->h_source; 1373 + ns_olen = request->len - skb_transport_offset(request) - sizeof(*ns); 1374 + for (i = 0; i < ns_olen-1; i += (ns->opt[i+1]<<3)) { 1375 + if (ns->opt[i] == ND_OPT_SOURCE_LL_ADDR) { 1376 + daddr = ns->opt + i + sizeof(struct nd_opt_hdr); 1377 + break; 1378 + } 1379 + } 1380 + 1381 + /* Ethernet header */ 1382 + ether_addr_copy(eth_hdr(reply)->h_dest, daddr); 1383 + ether_addr_copy(eth_hdr(reply)->h_source, n->ha); 1384 + eth_hdr(reply)->h_proto = htons(ETH_P_IPV6); 1385 + reply->protocol = htons(ETH_P_IPV6); 1386 + 1387 + skb_pull(reply, sizeof(struct ethhdr)); 1388 + skb_set_network_header(reply, 0); 1389 + skb_put(reply, sizeof(struct ipv6hdr)); 1390 + 1391 + /* IPv6 header */ 1392 + 1393 + pip6 = ipv6_hdr(reply); 1394 + memset(pip6, 0, sizeof(struct ipv6hdr)); 1395 + pip6->version = 6; 1396 + pip6->priority = ipv6_hdr(request)->priority; 1397 + pip6->nexthdr = IPPROTO_ICMPV6; 1398 + pip6->hop_limit = 255; 1399 + pip6->daddr = ipv6_hdr(request)->saddr; 1400 + pip6->saddr = *(struct in6_addr *)n->primary_key; 1401 + 1402 + skb_pull(reply, sizeof(struct ipv6hdr)); 1403 + skb_set_transport_header(reply, 0); 1404 + 1405 + na = (struct nd_msg *)skb_put(reply, sizeof(*na) + na_olen); 1406 + 1407 + /* Neighbor Advertisement */ 1408 + memset(na, 0, sizeof(*na)+na_olen); 1409 + na->icmph.icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT; 1410 + na->icmph.icmp6_router = isrouter; 1411 + na->icmph.icmp6_override = 1; 1412 + na->icmph.icmp6_solicited = 1; 1413 + na->target = ns->target; 1414 + ether_addr_copy(&na->opt[2], n->ha); 1415 + na->opt[0] = ND_OPT_TARGET_LL_ADDR; 1416 + na->opt[1] = na_olen >> 3; 1417 + 1418 + na->icmph.icmp6_cksum = csum_ipv6_magic(&pip6->saddr, 1419 + &pip6->daddr, sizeof(*na)+na_olen, IPPROTO_ICMPV6, 1420 + csum_partial(na, sizeof(*na)+na_olen, 0)); 1421 + 1422 + pip6->payload_len = htons(sizeof(*na)+na_olen); 1423 + 1424 + skb_push(reply, sizeof(struct ipv6hdr)); 1425 + 1426 + reply->ip_summed = CHECKSUM_UNNECESSARY; 1427 + 1428 + return reply; 1429 + } 1430 + 1345 1431 static int neigh_reduce(struct net_device *dev, struct sk_buff *skb) 1346 1432 { 1347 1433 struct vxlan_dev *vxlan = netdev_priv(dev); 1348 - struct neighbour *n; 1349 - union vxlan_addr ipa; 1434 + struct nd_msg *msg; 1350 1435 const struct ipv6hdr *iphdr; 1351 1436 const struct in6_addr *saddr, *daddr; 1352 - struct nd_msg *msg; 1353 - struct inet6_dev *in6_dev = NULL; 1437 + struct neighbour *n; 1438 + struct inet6_dev *in6_dev; 1354 1439 1355 1440 in6_dev = __in6_dev_get(dev); 1356 1441 if (!in6_dev) ··· 1451 1360 saddr = &iphdr->saddr; 1452 1361 daddr = &iphdr->daddr; 1453 1362 1454 - if (ipv6_addr_loopback(daddr) || 1455 - ipv6_addr_is_multicast(daddr)) 1456 - goto out; 1457 - 1458 1363 msg = (struct nd_msg *)skb_transport_header(skb); 1459 1364 if (msg->icmph.icmp6_code != 0 || 1460 1365 msg->icmph.icmp6_type != NDISC_NEIGHBOUR_SOLICITATION) 1461 1366 goto out; 1462 1367 1463 - n = neigh_lookup(ipv6_stub->nd_tbl, daddr, dev); 1368 + if (ipv6_addr_loopback(daddr) || 1369 + ipv6_addr_is_multicast(&msg->target)) 1370 + goto out; 1371 + 1372 + n = neigh_lookup(ipv6_stub->nd_tbl, &msg->target, dev); 1464 1373 1465 1374 if (n) { 1466 1375 struct vxlan_fdb *f; 1376 + struct sk_buff *reply; 1467 1377 1468 1378 if (!(n->nud_state & NUD_CONNECTED)) { 1469 1379 neigh_release(n); ··· 1478 1386 goto out; 1479 1387 } 1480 1388 1481 - ipv6_stub->ndisc_send_na(dev, n, saddr, &msg->target, 1482 - !!in6_dev->cnf.forwarding, 1483 - true, false, false); 1389 + reply = vxlan_na_create(skb, n, 1390 + !!(f ? f->flags & NTF_ROUTER : 0)); 1391 + 1484 1392 neigh_release(n); 1393 + 1394 + if (reply == NULL) 1395 + goto out; 1396 + 1397 + if (netif_rx_ni(reply) == NET_RX_DROP) 1398 + dev->stats.rx_dropped++; 1399 + 1485 1400 } else if (vxlan->flags & VXLAN_F_L3MISS) { 1486 - ipa.sin6.sin6_addr = *daddr; 1487 - ipa.sa.sa_family = AF_INET6; 1401 + union vxlan_addr ipa = { 1402 + .sin6.sin6_addr = msg->target, 1403 + .sa.sa_family = AF_INET6, 1404 + }; 1405 + 1488 1406 vxlan_ip_miss(dev, &ipa); 1489 1407 } 1490 1408
+1 -2
drivers/net/wireless/ath/ath9k/hw.c
··· 1548 1548 if (reg != last_val) 1549 1549 return true; 1550 1550 1551 + udelay(1); 1551 1552 last_val = reg; 1552 1553 if ((reg & 0x7E7FFFEF) == 0x00702400) 1553 1554 continue; ··· 1561 1560 default: 1562 1561 return true; 1563 1562 } 1564 - 1565 - udelay(1); 1566 1563 } while (count-- > 0); 1567 1564 1568 1565 return false;
+2 -2
drivers/net/wireless/ath/ath9k/xmit.c
··· 2063 2063 2064 2064 ATH_TXBUF_RESET(bf); 2065 2065 2066 - if (tid) { 2066 + if (tid && ieee80211_is_data_present(hdr->frame_control)) { 2067 2067 fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; 2068 2068 seqno = tid->seq_next; 2069 2069 hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); ··· 2186 2186 txq->stopped = true; 2187 2187 } 2188 2188 2189 - if (txctl->an) 2189 + if (txctl->an && ieee80211_is_data_present(hdr->frame_control)) 2190 2190 tid = ath_get_skb_tid(sc, txctl->an, skb); 2191 2191 2192 2192 if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
+3 -1
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
··· 1948 1948 if (pkt_pad == NULL) 1949 1949 return -ENOMEM; 1950 1950 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad); 1951 - if (unlikely(ret < 0)) 1951 + if (unlikely(ret < 0)) { 1952 + kfree_skb(pkt_pad); 1952 1953 return ret; 1954 + } 1953 1955 memcpy(pkt_pad->data, 1954 1956 pkt->data + pkt->len - tail_chop, 1955 1957 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);
+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;
+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)
-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 #ifdef CONFIG_SYN_COOKIES 481 481 #include <linux/ktime.h> 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,
+1 -1
include/sound/soc-dai.h
··· 142 142 * Called by soc_card drivers, normally in their hw_params. 143 143 */ 144 144 int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); 145 - int (*of_xlate_tdm_slot_mask)(unsigned int slots, 145 + int (*xlate_tdm_slot_mask)(unsigned int slots, 146 146 unsigned int *tx_mask, unsigned int *rx_mask); 147 147 int (*set_tdm_slot)(struct snd_soc_dai *dai, 148 148 unsigned int tx_mask, unsigned int rx_mask,
+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);
+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 }
-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);
+1 -1
net/core/netpoll.c
··· 742 742 struct nd_msg *msg; 743 743 struct ipv6hdr *hdr; 744 744 745 - if (skb->protocol != htons(ETH_P_ARP)) 745 + if (skb->protocol != htons(ETH_P_IPV6)) 746 746 return false; 747 747 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + sizeof(struct nd_msg))) 748 748 return false;
+6 -4
net/core/rtnetlink.c
··· 2121 2121 static int nlmsg_populate_fdb_fill(struct sk_buff *skb, 2122 2122 struct net_device *dev, 2123 2123 u8 *addr, u32 pid, u32 seq, 2124 - int type, unsigned int flags) 2124 + int type, unsigned int flags, 2125 + int nlflags) 2125 2126 { 2126 2127 struct nlmsghdr *nlh; 2127 2128 struct ndmsg *ndm; 2128 2129 2129 - nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), NLM_F_MULTI); 2130 + nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags); 2130 2131 if (!nlh) 2131 2132 return -EMSGSIZE; 2132 2133 ··· 2165 2164 if (!skb) 2166 2165 goto errout; 2167 2166 2168 - err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF); 2167 + err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF, 0); 2169 2168 if (err < 0) { 2170 2169 kfree_skb(skb); 2171 2170 goto errout; ··· 2390 2389 2391 2390 err = nlmsg_populate_fdb_fill(skb, dev, ha->addr, 2392 2391 portid, seq, 2393 - RTM_NEWNEIGH, NTF_SELF); 2392 + RTM_NEWNEIGH, NTF_SELF, 2393 + NLM_F_MULTI); 2394 2394 if (err < 0) 2395 2395 return err; 2396 2396 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 ··· 1310 1311 if (skb == NULL || skb_prev == NULL) 1311 1312 ip6_append_data_mtu(&mtu, &maxfraglen, 1312 1313 fragheaderlen, skb, rt, 1313 - np->pmtudisc >= 1314 - IPV6_PMTUDISC_PROBE); 1314 + orig_mtu); 1315 1315 1316 1316 skb_prev = skb; 1317 1317
+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
··· 433 433 return 0; 434 434 } 435 435 436 - static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx) 436 + static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx, 437 + gfp_t gfp) 437 438 { 438 439 struct xfrm_user_sec_ctx *uctx = NULL; 439 440 int ctx_size = sec_ctx->sadb_x_ctx_len; 440 441 441 - uctx = kmalloc((sizeof(*uctx)+ctx_size), GFP_KERNEL); 442 + uctx = kmalloc((sizeof(*uctx)+ctx_size), gfp); 442 443 443 444 if (!uctx) 444 445 return NULL; ··· 1125 1124 1126 1125 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 1127 1126 if (sec_ctx != NULL) { 1128 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 1127 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 1129 1128 1130 1129 if (!uctx) 1131 1130 goto out; ··· 2232 2231 2233 2232 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 2234 2233 if (sec_ctx != NULL) { 2235 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 2234 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 2236 2235 2237 2236 if (!uctx) { 2238 2237 err = -ENOBUFS; 2239 2238 goto out; 2240 2239 } 2241 2240 2242 - err = security_xfrm_policy_alloc(&xp->security, uctx); 2241 + err = security_xfrm_policy_alloc(&xp->security, uctx, GFP_KERNEL); 2243 2242 kfree(uctx); 2244 2243 2245 2244 if (err) ··· 2336 2335 2337 2336 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 2338 2337 if (sec_ctx != NULL) { 2339 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 2338 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 2340 2339 2341 2340 if (!uctx) 2342 2341 return -ENOMEM; 2343 2342 2344 - err = security_xfrm_policy_alloc(&pol_ctx, uctx); 2343 + err = security_xfrm_policy_alloc(&pol_ctx, uctx, GFP_KERNEL); 2345 2344 kfree(uctx); 2346 2345 if (err) 2347 2346 return err; ··· 3240 3239 } 3241 3240 if ((*dir = verify_sec_ctx_len(p))) 3242 3241 goto out; 3243 - uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 3244 - *dir = security_xfrm_policy_alloc(&xp->security, uctx); 3242 + uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_ATOMIC); 3243 + *dir = security_xfrm_policy_alloc(&xp->security, uctx, GFP_ATOMIC); 3245 3244 kfree(uctx); 3246 3245 3247 3246 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"); ··· 1762 1762 int bucket = cb->args[0], skip = cb->args[1]; 1763 1763 int i, j = 0; 1764 1764 1765 - dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); 1766 - if (!dp) 1767 - return -ENODEV; 1768 - 1769 1765 rcu_read_lock(); 1766 + dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); 1767 + if (!dp) { 1768 + rcu_read_unlock(); 1769 + return -ENODEV; 1770 + } 1770 1771 for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) { 1771 1772 struct vport *vport; 1772 1773
+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
··· 1221 1221 return 0; 1222 1222 1223 1223 uctx = nla_data(rt); 1224 - return security_xfrm_policy_alloc(&pol->security, uctx); 1224 + return security_xfrm_policy_alloc(&pol->security, uctx, GFP_KERNEL); 1225 1225 } 1226 1226 1227 1227 static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, ··· 1626 1626 if (rt) { 1627 1627 struct xfrm_user_sec_ctx *uctx = nla_data(rt); 1628 1628 1629 - err = security_xfrm_policy_alloc(&ctx, uctx); 1629 + err = security_xfrm_policy_alloc(&ctx, uctx, GFP_KERNEL); 1630 1630 if (err) 1631 1631 return err; 1632 1632 } ··· 1928 1928 if (rt) { 1929 1929 struct xfrm_user_sec_ctx *uctx = nla_data(rt); 1930 1930 1931 - err = security_xfrm_policy_alloc(&ctx, uctx); 1931 + err = security_xfrm_policy_alloc(&ctx, uctx, GFP_KERNEL); 1932 1932 if (err) 1933 1933 return err; 1934 1934 }
+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 /*
+2
sound/soc/fsl/Kconfig
··· 13 13 config SND_SOC_FSL_ESAI 14 14 tristate 15 15 select REGMAP_MMIO 16 + select SND_SOC_FSL_UTILS 16 17 17 18 config SND_SOC_FSL_UTILS 18 19 tristate ··· 121 120 122 121 config SND_SOC_IMX_SSI 123 122 tristate 123 + select SND_SOC_FSL_UTILS 124 124 125 125 config SND_SOC_IMX_PCM_FIQ 126 126 tristate
+2
sound/soc/fsl/fsl_esai.c
··· 18 18 19 19 #include "fsl_esai.h" 20 20 #include "imx-pcm.h" 21 + #include "fsl_utils.h" 21 22 22 23 #define FSL_ESAI_RATES SNDRV_PCM_RATE_8000_192000 23 24 #define FSL_ESAI_FORMATS (SNDRV_PCM_FMTBIT_S8 | \ ··· 582 581 .hw_params = fsl_esai_hw_params, 583 582 .set_sysclk = fsl_esai_set_dai_sysclk, 584 583 .set_fmt = fsl_esai_set_dai_fmt, 584 + .xlate_tdm_slot_mask = fsl_asoc_xlate_tdm_slot_mask, 585 585 .set_tdm_slot = fsl_esai_set_dai_tdm_slot, 586 586 }; 587 587
+27
sound/soc/fsl/fsl_utils.c
··· 86 86 } 87 87 EXPORT_SYMBOL(fsl_asoc_get_dma_channel); 88 88 89 + /** 90 + * fsl_asoc_xlate_tdm_slot_mask - generate TDM slot TX/RX mask. 91 + * 92 + * @slots: Number of slots in use. 93 + * @tx_mask: bitmask representing active TX slots. 94 + * @rx_mask: bitmask representing active RX slots. 95 + * 96 + * This function used to generate the TDM slot TX/RX mask. And the TX/RX 97 + * mask will use a 0 bit for an active slot as default, and the default 98 + * active bits are at the LSB of the mask value. 99 + */ 100 + int fsl_asoc_xlate_tdm_slot_mask(unsigned int slots, 101 + unsigned int *tx_mask, 102 + unsigned int *rx_mask) 103 + { 104 + if (!slots) 105 + return -EINVAL; 106 + 107 + if (tx_mask) 108 + *tx_mask = ~((1 << slots) - 1); 109 + if (rx_mask) 110 + *rx_mask = ~((1 << slots) - 1); 111 + 112 + return 0; 113 + } 114 + EXPORT_SYMBOL_GPL(fsl_asoc_xlate_tdm_slot_mask); 115 + 89 116 MODULE_AUTHOR("Timur Tabi <timur@freescale.com>"); 90 117 MODULE_DESCRIPTION("Freescale ASoC utility code"); 91 118 MODULE_LICENSE("GPL v2");
+3 -1
sound/soc/fsl/fsl_utils.h
··· 22 22 struct snd_soc_dai_link *dai, 23 23 unsigned int *dma_channel_id, 24 24 unsigned int *dma_id); 25 - 25 + int fsl_asoc_xlate_tdm_slot_mask(unsigned int slots, 26 + unsigned int *tx_mask, 27 + unsigned int *rx_mask); 26 28 #endif /* _FSL_UTILS_H */
+2
sound/soc/fsl/imx-ssi.c
··· 50 50 #include <linux/platform_data/asoc-imx-ssi.h> 51 51 52 52 #include "imx-ssi.h" 53 + #include "fsl_utils.h" 53 54 54 55 #define SSI_SACNT_DEFAULT (SSI_SACNT_AC97EN | SSI_SACNT_FV) 55 56 ··· 340 339 .set_fmt = imx_ssi_set_dai_fmt, 341 340 .set_clkdiv = imx_ssi_set_dai_clkdiv, 342 341 .set_sysclk = imx_ssi_set_dai_sysclk, 342 + .xlate_tdm_slot_mask = fsl_asoc_xlate_tdm_slot_mask, 343 343 .set_tdm_slot = imx_ssi_set_dai_tdm_slot, 344 344 .trigger = imx_ssi_trigger, 345 345 };
+144 -80
sound/soc/generic/simple-card.c
··· 20 20 21 21 struct simple_card_data { 22 22 struct snd_soc_card snd_card; 23 - struct asoc_simple_dai cpu_dai; 24 - struct asoc_simple_dai codec_dai; 25 - struct snd_soc_dai_link snd_link; 23 + struct simple_dai_props { 24 + struct asoc_simple_dai cpu_dai; 25 + struct asoc_simple_dai codec_dai; 26 + } *dai_props; 27 + struct snd_soc_dai_link dai_link[]; /* dynamically allocated */ 26 28 }; 27 29 28 30 static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, ··· 70 68 snd_soc_card_get_drvdata(rtd->card); 71 69 struct snd_soc_dai *codec = rtd->codec_dai; 72 70 struct snd_soc_dai *cpu = rtd->cpu_dai; 73 - int ret; 71 + struct simple_dai_props *dai_props; 72 + int num, ret; 74 73 75 - ret = __asoc_simple_card_dai_init(codec, &priv->codec_dai); 74 + num = rtd - rtd->card->rtd; 75 + dai_props = &priv->dai_props[num]; 76 + ret = __asoc_simple_card_dai_init(codec, &dai_props->codec_dai); 76 77 if (ret < 0) 77 78 return ret; 78 79 79 - ret = __asoc_simple_card_dai_init(cpu, &priv->cpu_dai); 80 + ret = __asoc_simple_card_dai_init(cpu, &dai_props->cpu_dai); 80 81 if (ret < 0) 81 82 return ret; 82 83 ··· 151 146 return 0; 152 147 } 153 148 149 + static int simple_card_cpu_codec_of(struct device_node *node, 150 + int daifmt, 151 + struct snd_soc_dai_link *dai_link, 152 + struct simple_dai_props *dai_props) 153 + { 154 + struct device_node *np; 155 + int ret; 156 + 157 + /* CPU sub-node */ 158 + ret = -EINVAL; 159 + np = of_get_child_by_name(node, "simple-audio-card,cpu"); 160 + if (np) { 161 + ret = asoc_simple_card_sub_parse_of(np, daifmt, 162 + &dai_props->cpu_dai, 163 + &dai_link->cpu_of_node, 164 + &dai_link->cpu_dai_name); 165 + of_node_put(np); 166 + } 167 + if (ret < 0) 168 + return ret; 169 + 170 + /* CODEC sub-node */ 171 + ret = -EINVAL; 172 + np = of_get_child_by_name(node, "simple-audio-card,codec"); 173 + if (np) { 174 + ret = asoc_simple_card_sub_parse_of(np, daifmt, 175 + &dai_props->codec_dai, 176 + &dai_link->codec_of_node, 177 + &dai_link->codec_dai_name); 178 + of_node_put(np); 179 + } 180 + return ret; 181 + } 182 + 154 183 static int asoc_simple_card_parse_of(struct device_node *node, 155 184 struct simple_card_data *priv, 156 - struct device *dev) 185 + struct device *dev, 186 + int multi) 157 187 { 158 188 struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link; 159 - struct asoc_simple_dai *codec_dai = &priv->codec_dai; 160 - struct asoc_simple_dai *cpu_dai = &priv->cpu_dai; 189 + struct simple_dai_props *dai_props = priv->dai_props; 161 190 struct device_node *np; 162 191 char *name; 163 192 unsigned int daifmt; ··· 220 181 return ret; 221 182 } 222 183 223 - /* CPU sub-node */ 224 - ret = -EINVAL; 225 - np = of_get_child_by_name(node, "simple-audio-card,cpu"); 226 - if (np) { 227 - ret = asoc_simple_card_sub_parse_of(np, daifmt, 228 - cpu_dai, 229 - &dai_link->cpu_of_node, 230 - &dai_link->cpu_dai_name); 231 - of_node_put(np); 184 + /* loop on the DAI links */ 185 + np = NULL; 186 + for (;;) { 187 + if (multi) { 188 + np = of_get_next_child(node, np); 189 + if (!np) 190 + break; 191 + } 192 + 193 + ret = simple_card_cpu_codec_of(multi ? np : node, 194 + daifmt, dai_link, dai_props); 195 + if (ret < 0) 196 + goto err; 197 + 198 + /* 199 + * overwrite cpu_dai->fmt as its DAIFMT_MASTER bit is based on CODEC 200 + * while the other bits should be identical unless buggy SW/HW design. 201 + */ 202 + dai_props->cpu_dai.fmt = dai_props->codec_dai.fmt; 203 + 204 + if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name) { 205 + ret = -EINVAL; 206 + goto err; 207 + } 208 + 209 + /* simple-card assumes platform == cpu */ 210 + dai_link->platform_of_node = dai_link->cpu_of_node; 211 + 212 + name = devm_kzalloc(dev, 213 + strlen(dai_link->cpu_dai_name) + 214 + strlen(dai_link->codec_dai_name) + 2, 215 + GFP_KERNEL); 216 + sprintf(name, "%s-%s", dai_link->cpu_dai_name, 217 + dai_link->codec_dai_name); 218 + dai_link->name = dai_link->stream_name = name; 219 + 220 + if (!multi) 221 + break; 222 + 223 + dai_link++; 224 + dai_props++; 232 225 } 233 - if (ret < 0) 234 - return ret; 235 - 236 - /* CODEC sub-node */ 237 - ret = -EINVAL; 238 - np = of_get_child_by_name(node, "simple-audio-card,codec"); 239 - if (np) { 240 - ret = asoc_simple_card_sub_parse_of(np, daifmt, 241 - codec_dai, 242 - &dai_link->codec_of_node, 243 - &dai_link->codec_dai_name); 244 - of_node_put(np); 245 - } 246 - if (ret < 0) 247 - return ret; 248 - 249 - /* 250 - * overwrite cpu_dai->fmt as its DAIFMT_MASTER bit is based on CODEC 251 - * while the other bits should be identical unless buggy SW/HW design. 252 - */ 253 - cpu_dai->fmt = codec_dai->fmt; 254 - 255 - if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name) 256 - return -EINVAL; 257 226 258 227 /* card name is created from CPU/CODEC dai name */ 259 - name = devm_kzalloc(dev, 260 - strlen(dai_link->cpu_dai_name) + 261 - strlen(dai_link->codec_dai_name) + 2, 262 - GFP_KERNEL); 263 - sprintf(name, "%s-%s", dai_link->cpu_dai_name, 264 - dai_link->codec_dai_name); 228 + dai_link = priv->snd_card.dai_link; 265 229 if (!priv->snd_card.name) 266 - priv->snd_card.name = name; 267 - dai_link->name = dai_link->stream_name = name; 230 + priv->snd_card.name = dai_link->name; 268 231 269 - /* simple-card assumes platform == cpu */ 270 - dai_link->platform_of_node = dai_link->cpu_of_node; 271 - 272 - dev_dbg(dev, "card-name : %s\n", name); 232 + dev_dbg(dev, "card-name : %s\n", priv->snd_card.name); 273 233 dev_dbg(dev, "platform : %04x\n", daifmt); 234 + dai_props = priv->dai_props; 274 235 dev_dbg(dev, "cpu : %s / %04x / %d\n", 275 236 dai_link->cpu_dai_name, 276 - cpu_dai->fmt, 277 - cpu_dai->sysclk); 237 + dai_props->cpu_dai.fmt, 238 + dai_props->cpu_dai.sysclk); 278 239 dev_dbg(dev, "codec : %s / %04x / %d\n", 279 240 dai_link->codec_dai_name, 280 - codec_dai->fmt, 281 - codec_dai->sysclk); 282 - 283 - /* 284 - * soc_bind_dai_link() will check cpu name 285 - * after of_node matching if dai_link has cpu_dai_name. 286 - * but, it will never match if name was created by fmt_single_name() 287 - * remove cpu_dai_name to escape name matching. 288 - * see 289 - * fmt_single_name() 290 - * fmt_multiple_name() 291 - */ 292 - dai_link->cpu_dai_name = NULL; 241 + dai_props->codec_dai.fmt, 242 + dai_props->codec_dai.sysclk); 293 243 294 244 return 0; 245 + 246 + err: 247 + of_node_put(np); 248 + return ret; 295 249 } 296 250 297 251 /* update the reference count of the devices nodes at end of probe */ ··· 314 282 struct snd_soc_dai_link *dai_link; 315 283 struct device_node *np = pdev->dev.of_node; 316 284 struct device *dev = &pdev->dev; 317 - int ret; 285 + int num_links, multi, ret; 318 286 319 - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 287 + /* get the number of DAI links */ 288 + if (np && of_get_child_by_name(np, "simple-audio-card,dai-link")) { 289 + num_links = of_get_child_count(np); 290 + multi = 1; 291 + } else { 292 + num_links = 1; 293 + multi = 0; 294 + } 295 + 296 + /* allocate the private data and the DAI link array */ 297 + priv = devm_kzalloc(dev, 298 + sizeof(*priv) + sizeof(*dai_link) * num_links, 299 + GFP_KERNEL); 320 300 if (!priv) 321 301 return -ENOMEM; 322 302 ··· 337 293 */ 338 294 priv->snd_card.owner = THIS_MODULE; 339 295 priv->snd_card.dev = dev; 340 - dai_link = &priv->snd_link; 296 + dai_link = priv->dai_link; 341 297 priv->snd_card.dai_link = dai_link; 342 - priv->snd_card.num_links = 1; 298 + priv->snd_card.num_links = num_links; 299 + 300 + /* get room for the other properties */ 301 + priv->dai_props = devm_kzalloc(dev, 302 + sizeof(*priv->dai_props) * num_links, 303 + GFP_KERNEL); 304 + if (!priv->dai_props) 305 + return -ENOMEM; 343 306 344 307 if (np && of_device_is_available(np)) { 345 308 346 - ret = asoc_simple_card_parse_of(np, priv, dev); 309 + ret = asoc_simple_card_parse_of(np, priv, dev, multi); 347 310 if (ret < 0) { 348 311 if (ret != -EPROBE_DEFER) 349 312 dev_err(dev, "parse error %d\n", ret); 350 313 goto err; 351 314 } 315 + 316 + /* 317 + * soc_bind_dai_link() will check cpu name 318 + * after of_node matching if dai_link has cpu_dai_name. 319 + * but, it will never match if name was created by fmt_single_name() 320 + * remove cpu_dai_name to escape name matching. 321 + * see 322 + * fmt_single_name() 323 + * fmt_multiple_name() 324 + */ 325 + if (num_links == 1) 326 + dai_link->cpu_dai_name = NULL; 327 + 352 328 } else { 353 329 struct asoc_simple_card_info *cinfo; 354 330 ··· 394 330 dai_link->codec_name = cinfo->codec; 395 331 dai_link->cpu_dai_name = cinfo->cpu_dai.name; 396 332 dai_link->codec_dai_name = cinfo->codec_dai.name; 397 - memcpy(&priv->cpu_dai, &cinfo->cpu_dai, 398 - sizeof(priv->cpu_dai)); 399 - memcpy(&priv->codec_dai, &cinfo->codec_dai, 400 - sizeof(priv->codec_dai)); 333 + memcpy(&priv->dai_props->cpu_dai, &cinfo->cpu_dai, 334 + sizeof(priv->dai_props->cpu_dai)); 335 + memcpy(&priv->dai_props->codec_dai, &cinfo->codec_dai, 336 + sizeof(priv->dai_props->codec_dai)); 401 337 402 - priv->cpu_dai.fmt |= cinfo->daifmt; 403 - priv->codec_dai.fmt |= cinfo->daifmt; 338 + priv->dai_props->cpu_dai.fmt |= cinfo->daifmt; 339 + priv->dai_props->codec_dai.fmt |= cinfo->daifmt; 404 340 } 405 341 406 342 /*
+11 -7
sound/soc/sh/rcar/src.c
··· 182 182 struct rsnd_dai_stream *io, 183 183 struct snd_pcm_runtime *runtime) 184 184 { 185 + struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io); 185 186 struct rsnd_src *src; 186 - unsigned int rate; 187 + unsigned int rate = 0; 187 188 188 - src = rsnd_mod_to_src(rsnd_io_to_mod_src(io)); 189 + if (src_mod) { 190 + src = rsnd_mod_to_src(src_mod); 189 191 190 - /* 191 - * return convert rate if SRC is used, 192 - * otherwise, return runtime->rate as usual 193 - */ 194 - rate = rsnd_src_convert_rate(src); 192 + /* 193 + * return convert rate if SRC is used, 194 + * otherwise, return runtime->rate as usual 195 + */ 196 + rate = rsnd_src_convert_rate(src); 197 + } 198 + 195 199 if (!rate) 196 200 rate = runtime->rate; 197 201
+6 -11
sound/soc/soc-core.c
··· 1253 1253 struct snd_soc_dai_link *dai_link = NULL; 1254 1254 struct snd_soc_aux_dev *aux_dev = NULL; 1255 1255 struct snd_soc_pcm_runtime *rtd; 1256 - const char *temp, *name; 1256 + const char *name; 1257 1257 int ret = 0; 1258 1258 1259 1259 if (!dailess) { ··· 1267 1267 } 1268 1268 rtd->card = card; 1269 1269 1270 - /* machine controls, routes and widgets are not prefixed */ 1271 - temp = codec->name_prefix; 1272 - codec->name_prefix = NULL; 1273 - 1274 1270 /* do machine specific initialization */ 1275 1271 if (!dailess && dai_link->init) 1276 1272 ret = dai_link->init(rtd); ··· 1276 1280 dev_err(card->dev, "ASoC: failed to init %s: %d\n", name, ret); 1277 1281 return ret; 1278 1282 } 1279 - codec->name_prefix = temp; 1280 1283 1281 1284 /* register the rtd device */ 1282 1285 rtd->codec = codec; ··· 3619 3624 EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt); 3620 3625 3621 3626 /** 3622 - * snd_soc_of_xlate_tdm_slot - generate tx/rx slot mask. 3627 + * snd_soc_xlate_tdm_slot - generate tx/rx slot mask. 3623 3628 * @slots: Number of slots in use. 3624 3629 * @tx_mask: bitmask representing active TX slots. 3625 3630 * @rx_mask: bitmask representing active RX slots. 3626 3631 * 3627 3632 * Generates the TDM tx and rx slot default masks for DAI. 3628 3633 */ 3629 - static int snd_soc_of_xlate_tdm_slot_mask(unsigned int slots, 3634 + static int snd_soc_xlate_tdm_slot_mask(unsigned int slots, 3630 3635 unsigned int *tx_mask, 3631 3636 unsigned int *rx_mask) 3632 3637 { ··· 3656 3661 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, 3657 3662 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) 3658 3663 { 3659 - if (dai->driver && dai->driver->ops->of_xlate_tdm_slot_mask) 3660 - dai->driver->ops->of_xlate_tdm_slot_mask(slots, 3664 + if (dai->driver && dai->driver->ops->xlate_tdm_slot_mask) 3665 + dai->driver->ops->xlate_tdm_slot_mask(slots, 3661 3666 &tx_mask, &rx_mask); 3662 3667 else 3663 - snd_soc_of_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); 3668 + snd_soc_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); 3664 3669 3665 3670 if (dai->driver && dai->driver->ops->set_tdm_slot) 3666 3671 return dai->driver->ops->set_tdm_slot(dai, tx_mask, rx_mask,
+1 -14
sound/soc/tegra/tegra20_ac97.c
··· 37 37 #include <sound/soc.h> 38 38 #include <sound/dmaengine_pcm.h> 39 39 40 - #include "tegra_asoc_utils.h" 41 40 #include "tegra20_ac97.h" 42 41 43 42 #define DRV_NAME "tegra20-ac97" ··· 375 376 ac97->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 376 377 ac97->playback_dma_data.maxburst = 4; 377 378 378 - ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev); 379 - if (ret) 380 - goto err_clk_put; 381 - 382 - ret = tegra_asoc_utils_set_ac97_rate(&ac97->util_data); 383 - if (ret) 384 - goto err_asoc_utils_fini; 385 - 386 379 ret = clk_prepare_enable(ac97->clk_ac97); 387 380 if (ret) { 388 381 dev_err(&pdev->dev, "clk_enable failed: %d\n", ret); 389 - goto err_asoc_utils_fini; 382 + goto err; 390 383 } 391 384 392 385 ret = snd_soc_set_ac97_ops(&tegra20_ac97_ops); ··· 410 419 snd_soc_unregister_component(&pdev->dev); 411 420 err_clk_disable_unprepare: 412 421 clk_disable_unprepare(ac97->clk_ac97); 413 - err_asoc_utils_fini: 414 - tegra_asoc_utils_fini(&ac97->util_data); 415 422 err_clk_put: 416 423 err: 417 424 snd_soc_set_ac97_ops(NULL); ··· 422 433 423 434 tegra_pcm_platform_unregister(&pdev->dev); 424 435 snd_soc_unregister_component(&pdev->dev); 425 - 426 - tegra_asoc_utils_fini(&ac97->util_data); 427 436 428 437 clk_disable_unprepare(ac97->clk_ac97); 429 438
-1
sound/soc/tegra/tegra20_ac97.h
··· 90 90 struct regmap *regmap; 91 91 int reset_gpio; 92 92 int sync_gpio; 93 - struct tegra_asoc_utils_data util_data; 94 93 }; 95 94 #endif /* __TEGRA20_AC97_H__ */
+16 -1
sound/soc/tegra/tegra_wm9712.c
··· 29 29 #include <sound/pcm_params.h> 30 30 #include <sound/soc.h> 31 31 32 + #include "tegra_asoc_utils.h" 33 + 32 34 #define DRV_NAME "tegra-snd-wm9712" 33 35 34 36 struct tegra_wm9712 { 35 37 struct platform_device *codec; 38 + struct tegra_asoc_utils_data util_data; 36 39 }; 37 40 38 41 static const struct snd_soc_dapm_widget tegra_wm9712_dapm_widgets[] = { ··· 121 118 122 119 tegra_wm9712_dai.platform_of_node = tegra_wm9712_dai.cpu_of_node; 123 120 121 + ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev); 122 + if (ret) 123 + goto codec_unregister; 124 + 125 + ret = tegra_asoc_utils_set_ac97_rate(&machine->util_data); 126 + if (ret) 127 + goto asoc_utils_fini; 128 + 124 129 ret = snd_soc_register_card(card); 125 130 if (ret) { 126 131 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", 127 132 ret); 128 - goto codec_unregister; 133 + goto asoc_utils_fini; 129 134 } 130 135 131 136 return 0; 132 137 138 + asoc_utils_fini: 139 + tegra_asoc_utils_fini(&machine->util_data); 133 140 codec_unregister: 134 141 platform_device_del(machine->codec); 135 142 codec_put: ··· 153 140 struct tegra_wm9712 *machine = snd_soc_card_get_drvdata(card); 154 141 155 142 snd_soc_unregister_card(card); 143 + 144 + tegra_asoc_utils_fini(&machine->util_data); 156 145 157 146 platform_device_unregister(machine->codec); 158 147
+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 {