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

Merge branch 'for-arm-soc-next' of git://git.linaro.org/people/ljones/linux-3.0-ux500 into next/dt

* 'for-arm-soc-next' of git://git.linaro.org/people/ljones/linux-3.0-ux500:
ARM: ux500: Fix SSP register address format
ARM: ux500: Apply tc3589x's GPIO/IRQ properties to HREF's DT
ARM: ux500: Remove redundant #gpio-cell properties from Snowball DT
ARM: ux500: Add all encompassing sound node to the HREF Device Tree
ARM: ux500: Add nodes for the MSP into the HREF Device Tree
ARM: ux500: Add all known I2C sub-device nodes to the HREF DT
ARM: ux500: Stop registering I2C sub-devices for HREF when DT is enabled
ARM: ux500: Stop registering Audio devices for HREF when DT is enabled
ARM: ux500: Add all encompassing sound node to the Snowball Device Tree
ARM: ux500: Add nodes for the MSP into Device Tree
ARM: ux500: Rename MSP board file to something more meaningful
ARM: ux500: Remove platform registration of MSP devices
ARM: ux500: Stop registering the MOP500 Audio driver from platform code
ARM: ux500: Pass MSP DMA platform data though AUXDATA
ARM: ux500: Fork MSP platform registration for step-by-step DT enablement
ARM: ux500: Add AB8500 CODEC node to DB8500 Device Tree
ARM: ux500: Clean-up MSP platform code
ARM: ux500: Pass SDI DMA information though AUX_DATA to MMCI
ARM: ux500: Add UART support to the HREF Device Tree
ARM: ux500: Add skeleton Device Tree for the HREF reference board
...
+ sync to v3.6-rc6

+3760 -1859
+15
Documentation/devicetree/bindings/mfd/ab8500.txt
··· 23 23 ab8500-bm : : : Battery Manager 24 24 ab8500-btemp : : : Battery Temperature 25 25 ab8500-charger : : : Battery Charger 26 + ab8500-codec : : : Audio Codec 26 27 ab8500-fg : : : Fuel Gauge 27 28 ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter 28 29 SW_CONV_END : : ··· 52 51 - interrupt-names : contains names of IRQ resource in the order in which they were 53 52 supplied in the interrupts property 54 53 - <supply_name>-supply : contains a phandle to the regulator supply node in Device Tree 54 + 55 + Non-standard child device properties: 56 + - Audio CODEC: 57 + - stericsson,amic[1|2]-type-single-ended : Single-ended Analoge Mic (default: differential) 58 + - stericsson,amic1a-bias-vamic2 : Analoge Mic wishes to use a non-standard Vamic 59 + - stericsson,amic1b-bias-vamic2 : Analoge Mic wishes to use a non-standard Vamic 60 + - stericsson,amic2-bias-vamic1 : Analoge Mic wishes to use a non-standard Vamic 61 + - stericsson,earpeice-cmv : Earpeice voltage (only: 950 | 1100 | 1270 | 1580) 55 62 56 63 ab8500@5 { 57 64 compatible = "stericsson,ab8500"; ··· 118 109 ab8500-pwm { 119 110 compatible = "stericsson,ab8500-pwm"; 120 111 }; 112 + 113 + codec: ab8500-codec { 114 + compatible = "stericsson,ab8500-codec"; 115 + 116 + stericsson,earpeice-cmv = <950>; /* Units in mV. */ 117 + }; 121 118 122 119 ab8500-regulators { 123 120 compatible = "stericsson,ab8500-regulator";
+39
Documentation/devicetree/bindings/sound/ux500-mop500.txt
··· 1 + * MOP500 Audio Machine Driver 2 + 3 + This node is responsible for linking together all ux500 Audio Driver components. 4 + 5 + Required properties: 6 + - compatible : "stericsson,snd-soc-mop500" 7 + 8 + Non-standard properties: 9 + - stericsson,cpu-dai : Phandle to the CPU-side DAI 10 + - stericsson,audio-codec : Phandle to the Audio CODEC 11 + - stericsson,card-name : Over-ride default card name 12 + 13 + Example: 14 + 15 + sound { 16 + compatible = "stericsson,snd-soc-mop500"; 17 + 18 + stericsson,cpu-dai = <&msp1 &msp3>; 19 + stericsson,audio-codec = <&codec>; 20 + }; 21 + 22 + msp1: msp@80124000 { 23 + compatible = "stericsson,ux500-msp-i2s"; 24 + reg = <0x80124000 0x1000>; 25 + interrupts = <0 62 0x4>; 26 + v-ape-supply = <&db8500_vape_reg>; 27 + }; 28 + 29 + msp3: msp@80125000 { 30 + compatible = "stericsson,ux500-msp-i2s"; 31 + reg = <0x80125000 0x1000>; 32 + interrupts = <0 62 0x4>; 33 + v-ape-supply = <&db8500_vape_reg>; 34 + }; 35 + 36 + codec: ab8500-codec { 37 + compatible = "stericsson,ab8500-codec"; 38 + stericsson,earpeice-cmv = <950>; /* Units in mV. */ 39 + };
+43
Documentation/devicetree/bindings/sound/ux500-msp.txt
··· 1 + * ux500 MSP (CPU-side Digital Audio Interface) 2 + 3 + Required properties: 4 + - compatible :"stericsson,ux500-msp-i2s" 5 + - reg : Physical base address and length of the device's registers. 6 + 7 + Optional properties: 8 + - interrupts : The interrupt output from the device. 9 + - interrupt-parent : The parent interrupt controller. 10 + - <name>-supply : Phandle to the regulator <name> supply 11 + 12 + Example: 13 + 14 + sound { 15 + compatible = "stericsson,snd-soc-mop500"; 16 + 17 + stericsson,platform-pcm-dma = <&pcm>; 18 + stericsson,cpu-dai = <&msp1 &msp3>; 19 + stericsson,audio-codec = <&codec>; 20 + }; 21 + 22 + pcm: ux500-pcm { 23 + compatible = "stericsson,ux500-pcm"; 24 + }; 25 + 26 + msp1: msp@80124000 { 27 + compatible = "stericsson,ux500-msp-i2s"; 28 + reg = <0x80124000 0x1000>; 29 + interrupts = <0 62 0x4>; 30 + v-ape-supply = <&db8500_vape_reg>; 31 + }; 32 + 33 + msp3: msp@80125000 { 34 + compatible = "stericsson,ux500-msp-i2s"; 35 + reg = <0x80125000 0x1000>; 36 + interrupts = <0 62 0x4>; 37 + v-ape-supply = <&db8500_vape_reg>; 38 + }; 39 + 40 + codec: ab8500-codec { 41 + compatible = "stericsson,ab8500-codec"; 42 + stericsson,earpeice-cmv = <950>; /* Units in mV. */ 43 + };
+1
Documentation/i2c/busses/i2c-i801
··· 21 21 * Intel DH89xxCC (PCH) 22 22 * Intel Panther Point (PCH) 23 23 * Intel Lynx Point (PCH) 24 + * Intel Lynx Point-LP (PCH) 24 25 Datasheets: Publicly available at the Intel website 25 26 26 27 On Intel Patsburg and later chipsets, both the normal host SMBus controller
+1 -1
MAINTAINERS
··· 3388 3388 L: linux-i2c@vger.kernel.org 3389 3389 W: http://i2c.wiki.kernel.org/ 3390 3390 T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ 3391 - T: git git://git.fluff.org/bjdooks/linux.git 3391 + T: git git://git.pengutronix.de/git/wsa/linux.git 3392 3392 S: Maintained 3393 3393 F: Documentation/i2c/ 3394 3394 F: drivers/i2c/
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc5 4 + EXTRAVERSION = -rc6 5 5 NAME = Saber-toothed Squirrel 6 6 7 7 # *DOCUMENTATION*
+3 -3
arch/arm/Kconfig.debug
··· 356 356 is nothing connected to read from the DCC. 357 357 358 358 config DEBUG_SEMIHOSTING 359 - bool "Kernel low-level debug output via semihosting I" 359 + bool "Kernel low-level debug output via semihosting I/O" 360 360 help 361 361 Semihosting enables code running on an ARM target to use 362 362 the I/O facilities on a host debugger/emulator through a 363 - simple SVC calls. The host debugger or emulator must have 363 + simple SVC call. The host debugger or emulator must have 364 364 semihosting enabled for the special svc call to be trapped 365 365 otherwise the kernel will crash. 366 366 367 - This is known to work with OpenOCD, as wellas 367 + This is known to work with OpenOCD, as well as 368 368 ARM's Fast Models, or any other controlling environment 369 369 that implements semihosting. 370 370
+2 -2
arch/arm/Makefile
··· 284 284 zinstall uinstall install: vmlinux 285 285 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ 286 286 287 - %.dtb: 287 + %.dtb: scripts 288 288 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 289 289 290 - dtbs: 290 + dtbs: scripts 291 291 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 292 292 293 293 # We use MRPROPER_FILES and CLEAN_FILES now
+4
arch/arm/boot/compressed/head.S
··· 659 659 #ifdef CONFIG_CPU_ENDIAN_BE8 660 660 orr r0, r0, #1 << 25 @ big-endian page tables 661 661 #endif 662 + mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg 662 663 orrne r0, r0, #1 @ MMU enabled 663 664 movne r1, #0xfffffffd @ domain 0 = client 665 + bic r6, r6, #1 << 31 @ 32-bit translation system 666 + bic r6, r6, #3 << 0 @ use only ttbr0 664 667 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer 665 668 mcrne p15, 0, r1, c3, c0, 0 @ load domain access control 669 + mcrne p15, 0, r6, c2, c0, 2 @ load ttb control 666 670 #endif 667 671 mcr p15, 0, r0, c7, c5, 4 @ ISB 668 672 mcr p15, 0, r0, c1, c0, 0 @ load control register
+64 -7
arch/arm/boot/dts/db8500.dtsi arch/arm/boot/dts/dbx5x0.dtsi
··· 194 194 interrupts = <0 47 0x4>; 195 195 #address-cells = <1>; 196 196 #size-cells = <1>; 197 + interrupt-controller; 198 + #interrupt-cells = <2>; 197 199 ranges; 198 200 199 201 prcmu-timer-4@80157450 { ··· 332 330 ab8500@5 { 333 331 compatible = "stericsson,ab8500"; 334 332 reg = <5>; /* mailbox 5 is i2c */ 333 + interrupt-parent = <&intc>; 335 334 interrupts = <0 40 0x4>; 336 335 interrupt-controller; 337 336 #interrupt-cells = <2>; ··· 374 371 }; 375 372 376 373 ab8500-ponkey { 377 - compatible = "stericsson,ab8500-ponkey"; 374 + compatible = "stericsson,ab8500-poweron-key"; 378 375 interrupts = <6 0x4 379 376 7 0x4>; 380 377 interrupt-names = "ONKEY_DBF", "ONKEY_DBR"; ··· 390 387 391 388 ab8500-debugfs { 392 389 compatible = "stericsson,ab8500-debug"; 390 + }; 391 + 392 + codec: ab8500-codec { 393 + compatible = "stericsson,ab8500-codec"; 394 + 395 + stericsson,earpeice-cmv = <950>; /* Units in mV. */ 393 396 }; 394 397 395 398 ab8500-regulators { ··· 480 471 }; 481 472 482 473 i2c@80004000 { 483 - compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 474 + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; 484 475 reg = <0x80004000 0x1000>; 485 476 interrupts = <0 21 0x4>; 486 477 #address-cells = <1>; 487 478 #size-cells = <0>; 479 + v-i2c-supply = <&db8500_vape_reg>; 480 + 481 + clock-frequency = <400000>; 488 482 }; 489 483 490 484 i2c@80122000 { 491 - compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 485 + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; 492 486 reg = <0x80122000 0x1000>; 493 487 interrupts = <0 22 0x4>; 494 488 #address-cells = <1>; 495 489 #size-cells = <0>; 490 + v-i2c-supply = <&db8500_vape_reg>; 491 + 492 + clock-frequency = <400000>; 496 493 }; 497 494 498 495 i2c@80128000 { 499 - compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 496 + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; 500 497 reg = <0x80128000 0x1000>; 501 498 interrupts = <0 55 0x4>; 502 499 #address-cells = <1>; 503 500 #size-cells = <0>; 501 + v-i2c-supply = <&db8500_vape_reg>; 502 + 503 + clock-frequency = <400000>; 504 504 }; 505 505 506 506 i2c@80110000 { 507 - compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 507 + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; 508 508 reg = <0x80110000 0x1000>; 509 509 interrupts = <0 12 0x4>; 510 510 #address-cells = <1>; 511 511 #size-cells = <0>; 512 + v-i2c-supply = <&db8500_vape_reg>; 513 + 514 + clock-frequency = <400000>; 512 515 }; 513 516 514 517 i2c@8012a000 { 515 - compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 518 + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; 516 519 reg = <0x8012a000 0x1000>; 517 520 interrupts = <0 51 0x4>; 518 521 #address-cells = <1>; 519 522 #size-cells = <0>; 523 + v-i2c-supply = <&db8500_vape_reg>; 524 + 525 + clock-frequency = <400000>; 520 526 }; 521 527 522 528 ssp@80002000 { 523 529 compatible = "arm,pl022", "arm,primecell"; 524 - reg = <80002000 0x1000>; 530 + reg = <0x80002000 0x1000>; 525 531 interrupts = <0 14 0x4>; 526 532 #address-cells = <1>; 527 533 #size-cells = <0>; ··· 601 577 compatible = "arm,pl18x", "arm,primecell"; 602 578 reg = <0x80114000 0x1000>; 603 579 interrupts = <0 100 0x4>; 580 + status = "disabled"; 581 + }; 582 + 583 + msp0: msp@80123000 { 584 + compatible = "stericsson,ux500-msp-i2s"; 585 + reg = <0x80123000 0x1000>; 586 + interrupts = <0 31 0x4>; 587 + v-ape-supply = <&db8500_vape_reg>; 588 + status = "disabled"; 589 + }; 590 + 591 + msp1: msp@80124000 { 592 + compatible = "stericsson,ux500-msp-i2s"; 593 + reg = <0x80124000 0x1000>; 594 + interrupts = <0 62 0x4>; 595 + v-ape-supply = <&db8500_vape_reg>; 596 + status = "disabled"; 597 + }; 598 + 599 + // HDMI sound 600 + msp2: msp@80117000 { 601 + compatible = "stericsson,ux500-msp-i2s"; 602 + reg = <0x80117000 0x1000>; 603 + interrupts = <0 98 0x4>; 604 + v-ape-supply = <&db8500_vape_reg>; 605 + status = "disabled"; 606 + }; 607 + 608 + msp3: msp@80125000 { 609 + compatible = "stericsson,ux500-msp-i2s"; 610 + reg = <0x80125000 0x1000>; 611 + interrupts = <0 62 0x4>; 612 + v-ape-supply = <&db8500_vape_reg>; 604 613 status = "disabled"; 605 614 }; 606 615
+95
arch/arm/boot/dts/hrefv60plus.dts
··· 1 + /* 2 + * Copyright 2012 ST-Ericsson AB 3 + * 4 + * The code contained herein is licensed under the GNU General Public 5 + * License. You may obtain a copy of the GNU General Public License 6 + * Version 2 or later at the following locations: 7 + * 8 + * http://www.opensource.org/licenses/gpl-license.html 9 + * http://www.gnu.org/copyleft/gpl.html 10 + */ 11 + 12 + /dts-v1/; 13 + /include/ "dbx5x0.dtsi" 14 + 15 + / { 16 + model = "ST-Ericsson HREF platform with Device Tree"; 17 + compatible = "st-ericsson,hrefv60+"; 18 + 19 + memory { 20 + reg = <0x00000000 0x20000000>; 21 + }; 22 + 23 + soc-u9500 { 24 + uart@80120000 { 25 + status = "okay"; 26 + }; 27 + 28 + uart@80121000 { 29 + status = "okay"; 30 + }; 31 + 32 + uart@80007000 { 33 + status = "okay"; 34 + }; 35 + 36 + i2c@80004000 { 37 + tc3589x@42 { 38 + compatible = "tc3589x"; 39 + reg = <0x42>; 40 + interrupt-parent = <&gpio6>; 41 + interrupts = <25 0x1>; 42 + 43 + interrupt-controller; 44 + #interrupt-cells = <2>; 45 + 46 + tc3589x_gpio: tc3589x_gpio { 47 + compatible = "tc3589x-gpio"; 48 + interrupts = <0 0x1>; 49 + 50 + interrupt-controller; 51 + #interrupt-cells = <2>; 52 + gpio-controller; 53 + #gpio-cells = <2>; 54 + }; 55 + }; 56 + 57 + tps61052@33 { 58 + compatible = "tps61052"; 59 + reg = <0x33>; 60 + }; 61 + }; 62 + 63 + i2c@80128000 { 64 + lp5521@0x33 { 65 + compatible = "lp5521"; 66 + reg = <0x33>; 67 + }; 68 + 69 + lp5521@0x34 { 70 + compatible = "lp5521"; 71 + reg = <0x34>; 72 + }; 73 + 74 + bh1780@0x29 { 75 + compatible = "rohm,bh1780gli"; 76 + reg = <0x33>; 77 + }; 78 + }; 79 + 80 + sound { 81 + compatible = "stericsson,snd-soc-mop500"; 82 + 83 + stericsson,cpu-dai = <&msp1 &msp3>; 84 + stericsson,audio-codec = <&codec>; 85 + }; 86 + 87 + msp1: msp@80124000 { 88 + status = "okay"; 89 + }; 90 + 91 + msp3: msp@80125000 { 92 + status = "okay"; 93 + }; 94 + }; 95 + };
+17 -2
arch/arm/boot/dts/snowball.dts
··· 10 10 */ 11 11 12 12 /dts-v1/; 13 - /include/ "db8500.dtsi" 13 + /include/ "dbx5x0.dtsi" 14 14 15 15 / { 16 16 model = "Calao Systems Snowball platform with device tree"; ··· 83 83 }; 84 84 85 85 soc-u9500 { 86 + 87 + sound { 88 + compatible = "stericsson,snd-soc-mop500"; 89 + 90 + stericsson,cpu-dai = <&msp1 &msp3>; 91 + stericsson,audio-codec = <&codec>; 92 + }; 93 + 94 + msp1: msp@80124000 { 95 + status = "okay"; 96 + }; 97 + 98 + msp3: msp@80125000 { 99 + status = "okay"; 100 + }; 101 + 86 102 external-bus@50000000 { 87 103 status = "okay"; 88 104 ··· 127 111 mmc-cap-mmc-highspeed; 128 112 vmmc-supply = <&ab8500_ldo_aux3_reg>; 129 113 130 - #gpio-cells = <1>; 131 114 cd-gpios = <&gpio6 26 0x4>; // 218 132 115 cd-inverted; 133 116
+8
arch/arm/include/asm/assembler.h
··· 320 320 .size \name , . - \name 321 321 .endm 322 322 323 + .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req 324 + #ifndef CONFIG_CPU_USE_DOMAINS 325 + adds \tmp, \addr, #\size - 1 326 + sbcccs \tmp, \tmp, \limit 327 + bcs \bad 328 + #endif 329 + .endm 330 + 323 331 #endif /* __ASM_ASSEMBLER_H__ */
+3
arch/arm/include/asm/memory.h
··· 187 187 #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) 188 188 #endif 189 189 #endif 190 + #endif /* __ASSEMBLY__ */ 190 191 191 192 #ifndef PHYS_OFFSET 192 193 #ifdef PLAT_PHYS_OFFSET ··· 196 195 #define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET) 197 196 #endif 198 197 #endif 198 + 199 + #ifndef __ASSEMBLY__ 199 200 200 201 /* 201 202 * PFNs are used to describe any physical page; this means
+4
arch/arm/include/asm/tlb.h
··· 199 199 { 200 200 pgtable_page_dtor(pte); 201 201 202 + #ifdef CONFIG_ARM_LPAE 203 + tlb_add_flush(tlb, addr); 204 + #else 202 205 /* 203 206 * With the classic ARM MMU, a pte page has two corresponding pmd 204 207 * entries, each covering 1MB. ··· 209 206 addr &= PMD_MASK; 210 207 tlb_add_flush(tlb, addr + SZ_1M - PAGE_SIZE); 211 208 tlb_add_flush(tlb, addr + SZ_1M); 209 + #endif 212 210 213 211 tlb_remove_page(tlb, pte); 214 212 }
+43 -15
arch/arm/include/asm/uaccess.h
··· 101 101 extern int __get_user_2(void *); 102 102 extern int __get_user_4(void *); 103 103 104 - #define __get_user_x(__r2,__p,__e,__s,__i...) \ 104 + #define __GUP_CLOBBER_1 "lr", "cc" 105 + #ifdef CONFIG_CPU_USE_DOMAINS 106 + #define __GUP_CLOBBER_2 "ip", "lr", "cc" 107 + #else 108 + #define __GUP_CLOBBER_2 "lr", "cc" 109 + #endif 110 + #define __GUP_CLOBBER_4 "lr", "cc" 111 + 112 + #define __get_user_x(__r2,__p,__e,__l,__s) \ 105 113 __asm__ __volatile__ ( \ 106 114 __asmeq("%0", "r0") __asmeq("%1", "r2") \ 115 + __asmeq("%3", "r1") \ 107 116 "bl __get_user_" #__s \ 108 117 : "=&r" (__e), "=r" (__r2) \ 109 - : "0" (__p) \ 110 - : __i, "cc") 118 + : "0" (__p), "r" (__l) \ 119 + : __GUP_CLOBBER_##__s) 111 120 112 - #define get_user(x,p) \ 121 + #define __get_user_check(x,p) \ 113 122 ({ \ 123 + unsigned long __limit = current_thread_info()->addr_limit - 1; \ 114 124 register const typeof(*(p)) __user *__p asm("r0") = (p);\ 115 125 register unsigned long __r2 asm("r2"); \ 126 + register unsigned long __l asm("r1") = __limit; \ 116 127 register int __e asm("r0"); \ 117 128 switch (sizeof(*(__p))) { \ 118 129 case 1: \ 119 - __get_user_x(__r2, __p, __e, 1, "lr"); \ 120 - break; \ 130 + __get_user_x(__r2, __p, __e, __l, 1); \ 131 + break; \ 121 132 case 2: \ 122 - __get_user_x(__r2, __p, __e, 2, "r3", "lr"); \ 133 + __get_user_x(__r2, __p, __e, __l, 2); \ 123 134 break; \ 124 135 case 4: \ 125 - __get_user_x(__r2, __p, __e, 4, "lr"); \ 136 + __get_user_x(__r2, __p, __e, __l, 4); \ 126 137 break; \ 127 138 default: __e = __get_user_bad(); break; \ 128 139 } \ ··· 141 130 __e; \ 142 131 }) 143 132 133 + #define get_user(x,p) \ 134 + ({ \ 135 + might_fault(); \ 136 + __get_user_check(x,p); \ 137 + }) 138 + 144 139 extern int __put_user_1(void *, unsigned int); 145 140 extern int __put_user_2(void *, unsigned int); 146 141 extern int __put_user_4(void *, unsigned int); 147 142 extern int __put_user_8(void *, unsigned long long); 148 143 149 - #define __put_user_x(__r2,__p,__e,__s) \ 144 + #define __put_user_x(__r2,__p,__e,__l,__s) \ 150 145 __asm__ __volatile__ ( \ 151 146 __asmeq("%0", "r0") __asmeq("%2", "r2") \ 147 + __asmeq("%3", "r1") \ 152 148 "bl __put_user_" #__s \ 153 149 : "=&r" (__e) \ 154 - : "0" (__p), "r" (__r2) \ 150 + : "0" (__p), "r" (__r2), "r" (__l) \ 155 151 : "ip", "lr", "cc") 156 152 157 - #define put_user(x,p) \ 153 + #define __put_user_check(x,p) \ 158 154 ({ \ 155 + unsigned long __limit = current_thread_info()->addr_limit - 1; \ 159 156 register const typeof(*(p)) __r2 asm("r2") = (x); \ 160 157 register const typeof(*(p)) __user *__p asm("r0") = (p);\ 158 + register unsigned long __l asm("r1") = __limit; \ 161 159 register int __e asm("r0"); \ 162 160 switch (sizeof(*(__p))) { \ 163 161 case 1: \ 164 - __put_user_x(__r2, __p, __e, 1); \ 162 + __put_user_x(__r2, __p, __e, __l, 1); \ 165 163 break; \ 166 164 case 2: \ 167 - __put_user_x(__r2, __p, __e, 2); \ 165 + __put_user_x(__r2, __p, __e, __l, 2); \ 168 166 break; \ 169 167 case 4: \ 170 - __put_user_x(__r2, __p, __e, 4); \ 168 + __put_user_x(__r2, __p, __e, __l, 4); \ 171 169 break; \ 172 170 case 8: \ 173 - __put_user_x(__r2, __p, __e, 8); \ 171 + __put_user_x(__r2, __p, __e, __l, 8); \ 174 172 break; \ 175 173 default: __e = __put_user_bad(); break; \ 176 174 } \ 177 175 __e; \ 178 176 }) 177 + 178 + #define put_user(x,p) \ 179 + ({ \ 180 + might_fault(); \ 181 + __put_user_check(x,p); \ 182 + }) 179 183 180 184 #else /* CONFIG_MMU */ 181 185 ··· 245 219 unsigned long __gu_addr = (unsigned long)(ptr); \ 246 220 unsigned long __gu_val; \ 247 221 __chk_user_ptr(ptr); \ 222 + might_fault(); \ 248 223 switch (sizeof(*(ptr))) { \ 249 224 case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \ 250 225 case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \ ··· 327 300 unsigned long __pu_addr = (unsigned long)(ptr); \ 328 301 __typeof__(*(ptr)) __pu_val = (x); \ 329 302 __chk_user_ptr(ptr); \ 303 + might_fault(); \ 330 304 switch (sizeof(*(ptr))) { \ 331 305 case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \ 332 306 case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \
+44 -18
arch/arm/kernel/hw_breakpoint.c
··· 159 159 arch >= ARM_DEBUG_ARCH_V7_1; 160 160 } 161 161 162 + /* Can we determine the watchpoint access type from the fsr? */ 163 + static int debug_exception_updates_fsr(void) 164 + { 165 + return 0; 166 + } 167 + 162 168 /* Determine number of WRP registers available. */ 163 169 static int get_num_wrp_resources(void) 164 170 { ··· 610 604 /* Aligned */ 611 605 break; 612 606 case 1: 613 - /* Allow single byte watchpoint. */ 614 - if (info->ctrl.len == ARM_BREAKPOINT_LEN_1) 615 - break; 616 607 case 2: 617 608 /* Allow halfword watchpoints and breakpoints. */ 618 609 if (info->ctrl.len == ARM_BREAKPOINT_LEN_2) 610 + break; 611 + case 3: 612 + /* Allow single byte watchpoint. */ 613 + if (info->ctrl.len == ARM_BREAKPOINT_LEN_1) 619 614 break; 620 615 default: 621 616 ret = -EINVAL; ··· 626 619 info->address &= ~alignment_mask; 627 620 info->ctrl.len <<= offset; 628 621 629 - /* 630 - * Currently we rely on an overflow handler to take 631 - * care of single-stepping the breakpoint when it fires. 632 - * In the case of userspace breakpoints on a core with V7 debug, 633 - * we can use the mismatch feature as a poor-man's hardware 634 - * single-step, but this only works for per-task breakpoints. 635 - */ 636 - if (!bp->overflow_handler && (arch_check_bp_in_kernelspace(bp) || 637 - !core_has_mismatch_brps() || !bp->hw.bp_target)) { 638 - pr_warning("overflow handler required but none found\n"); 639 - ret = -EINVAL; 622 + if (!bp->overflow_handler) { 623 + /* 624 + * Mismatch breakpoints are required for single-stepping 625 + * breakpoints. 626 + */ 627 + if (!core_has_mismatch_brps()) 628 + return -EINVAL; 629 + 630 + /* We don't allow mismatch breakpoints in kernel space. */ 631 + if (arch_check_bp_in_kernelspace(bp)) 632 + return -EPERM; 633 + 634 + /* 635 + * Per-cpu breakpoints are not supported by our stepping 636 + * mechanism. 637 + */ 638 + if (!bp->hw.bp_target) 639 + return -EINVAL; 640 + 641 + /* 642 + * We only support specific access types if the fsr 643 + * reports them. 644 + */ 645 + if (!debug_exception_updates_fsr() && 646 + (info->ctrl.type == ARM_BREAKPOINT_LOAD || 647 + info->ctrl.type == ARM_BREAKPOINT_STORE)) 648 + return -EINVAL; 640 649 } 650 + 641 651 out: 642 652 return ret; 643 653 } ··· 730 706 goto unlock; 731 707 732 708 /* Check that the access type matches. */ 733 - access = (fsr & ARM_FSR_ACCESS_MASK) ? HW_BREAKPOINT_W : 734 - HW_BREAKPOINT_R; 735 - if (!(access & hw_breakpoint_type(wp))) 736 - goto unlock; 709 + if (debug_exception_updates_fsr()) { 710 + access = (fsr & ARM_FSR_ACCESS_MASK) ? 711 + HW_BREAKPOINT_W : HW_BREAKPOINT_R; 712 + if (!(access & hw_breakpoint_type(wp))) 713 + goto unlock; 714 + } 737 715 738 716 /* We have a winner. */ 739 717 info->trigger = addr;
+7 -4
arch/arm/kernel/traps.c
··· 420 420 #endif 421 421 instr = *(u32 *) pc; 422 422 } else if (thumb_mode(regs)) { 423 - get_user(instr, (u16 __user *)pc); 423 + if (get_user(instr, (u16 __user *)pc)) 424 + goto die_sig; 424 425 if (is_wide_instruction(instr)) { 425 426 unsigned int instr2; 426 - get_user(instr2, (u16 __user *)pc+1); 427 + if (get_user(instr2, (u16 __user *)pc+1)) 428 + goto die_sig; 427 429 instr <<= 16; 428 430 instr |= instr2; 429 431 } 430 - } else { 431 - get_user(instr, (u32 __user *)pc); 432 + } else if (get_user(instr, (u32 __user *)pc)) { 433 + goto die_sig; 432 434 } 433 435 434 436 if (call_undef_hook(regs, instr) == 0) 435 437 return; 436 438 439 + die_sig: 437 440 #ifdef CONFIG_DEBUG_USER 438 441 if (user_debug & UDBG_UNDEFINED) { 439 442 printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",
+1
arch/arm/lib/delay.c
··· 59 59 { 60 60 pr_info("Switching to timer-based delay loop\n"); 61 61 lpj_fine = freq / HZ; 62 + loops_per_jiffy = lpj_fine; 62 63 arm_delay_ops.delay = __timer_delay; 63 64 arm_delay_ops.const_udelay = __timer_const_udelay; 64 65 arm_delay_ops.udelay = __timer_udelay;
+15 -8
arch/arm/lib/getuser.S
··· 16 16 * __get_user_X 17 17 * 18 18 * Inputs: r0 contains the address 19 + * r1 contains the address limit, which must be preserved 19 20 * Outputs: r0 is the error code 20 - * r2, r3 contains the zero-extended value 21 + * r2 contains the zero-extended value 21 22 * lr corrupted 22 23 * 23 24 * No other registers must be altered. (see <asm/uaccess.h> ··· 28 27 * Note also that it is intended that __get_user_bad is not global. 29 28 */ 30 29 #include <linux/linkage.h> 30 + #include <asm/assembler.h> 31 31 #include <asm/errno.h> 32 32 #include <asm/domain.h> 33 33 34 34 ENTRY(__get_user_1) 35 + check_uaccess r0, 1, r1, r2, __get_user_bad 35 36 1: TUSER(ldrb) r2, [r0] 36 37 mov r0, #0 37 38 mov pc, lr 38 39 ENDPROC(__get_user_1) 39 40 40 41 ENTRY(__get_user_2) 41 - #ifdef CONFIG_THUMB2_KERNEL 42 - 2: TUSER(ldrb) r2, [r0] 43 - 3: TUSER(ldrb) r3, [r0, #1] 42 + check_uaccess r0, 2, r1, r2, __get_user_bad 43 + #ifdef CONFIG_CPU_USE_DOMAINS 44 + rb .req ip 45 + 2: ldrbt r2, [r0], #1 46 + 3: ldrbt rb, [r0], #0 44 47 #else 45 - 2: TUSER(ldrb) r2, [r0], #1 46 - 3: TUSER(ldrb) r3, [r0] 48 + rb .req r0 49 + 2: ldrb r2, [r0] 50 + 3: ldrb rb, [r0, #1] 47 51 #endif 48 52 #ifndef __ARMEB__ 49 - orr r2, r2, r3, lsl #8 53 + orr r2, r2, rb, lsl #8 50 54 #else 51 - orr r2, r3, r2, lsl #8 55 + orr r2, rb, r2, lsl #8 52 56 #endif 53 57 mov r0, #0 54 58 mov pc, lr 55 59 ENDPROC(__get_user_2) 56 60 57 61 ENTRY(__get_user_4) 62 + check_uaccess r0, 4, r1, r2, __get_user_bad 58 63 4: TUSER(ldr) r2, [r0] 59 64 mov r0, #0 60 65 mov pc, lr
+6
arch/arm/lib/putuser.S
··· 16 16 * __put_user_X 17 17 * 18 18 * Inputs: r0 contains the address 19 + * r1 contains the address limit, which must be preserved 19 20 * r2, r3 contains the value 20 21 * Outputs: r0 is the error code 21 22 * lr corrupted ··· 28 27 * Note also that it is intended that __put_user_bad is not global. 29 28 */ 30 29 #include <linux/linkage.h> 30 + #include <asm/assembler.h> 31 31 #include <asm/errno.h> 32 32 #include <asm/domain.h> 33 33 34 34 ENTRY(__put_user_1) 35 + check_uaccess r0, 1, r1, ip, __put_user_bad 35 36 1: TUSER(strb) r2, [r0] 36 37 mov r0, #0 37 38 mov pc, lr 38 39 ENDPROC(__put_user_1) 39 40 40 41 ENTRY(__put_user_2) 42 + check_uaccess r0, 2, r1, ip, __put_user_bad 41 43 mov ip, r2, lsr #8 42 44 #ifdef CONFIG_THUMB2_KERNEL 43 45 #ifndef __ARMEB__ ··· 64 60 ENDPROC(__put_user_2) 65 61 66 62 ENTRY(__put_user_4) 63 + check_uaccess r0, 4, r1, ip, __put_user_bad 67 64 4: TUSER(str) r2, [r0] 68 65 mov r0, #0 69 66 mov pc, lr 70 67 ENDPROC(__put_user_4) 71 68 72 69 ENTRY(__put_user_8) 70 + check_uaccess r0, 8, r1, ip, __put_user_bad 73 71 #ifdef CONFIG_THUMB2_KERNEL 74 72 5: TUSER(str) r2, [r0] 75 73 6: TUSER(str) r3, [r0, #4]
+2 -4
arch/arm/mach-imx/clk-imx25.c
··· 222 222 clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx-fb.0"); 223 223 clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx-fb.0"); 224 224 clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0"); 225 - clk_register_clkdev(clk[ssi1_ipg_per], "per", "imx-ssi.0"); 226 - clk_register_clkdev(clk[ssi1_ipg], "ipg", "imx-ssi.0"); 227 - clk_register_clkdev(clk[ssi2_ipg_per], "per", "imx-ssi.1"); 228 - clk_register_clkdev(clk[ssi2_ipg], "ipg", "imx-ssi.1"); 225 + clk_register_clkdev(clk[ssi1_ipg], NULL, "imx-ssi.0"); 226 + clk_register_clkdev(clk[ssi2_ipg], NULL, "imx-ssi.1"); 229 227 clk_register_clkdev(clk[esdhc1_ipg_per], "per", "sdhci-esdhc-imx25.0"); 230 228 clk_register_clkdev(clk[esdhc1_ipg], "ipg", "sdhci-esdhc-imx25.0"); 231 229 clk_register_clkdev(clk[esdhc1_ahb], "ahb", "sdhci-esdhc-imx25.0");
+2 -4
arch/arm/mach-imx/clk-imx35.c
··· 230 230 clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb"); 231 231 clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1"); 232 232 clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); 233 - clk_register_clkdev(clk[ipg], "ipg", "imx-ssi.0"); 234 - clk_register_clkdev(clk[ssi1_div_post], "per", "imx-ssi.0"); 235 - clk_register_clkdev(clk[ipg], "ipg", "imx-ssi.1"); 236 - clk_register_clkdev(clk[ssi2_div_post], "per", "imx-ssi.1"); 233 + clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0"); 234 + clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1"); 237 235 /* i.mx35 has the i.mx21 type uart */ 238 236 clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0"); 239 237 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
+2 -1
arch/arm/mach-omap2/Kconfig
··· 233 233 select OMAP_PACKAGE_CBB 234 234 select REGULATOR_FIXED_VOLTAGE if REGULATOR 235 235 236 - config MACH_OMAP3_TOUCHBOOK 236 + config MACH_TOUCHBOOK 237 237 bool "OMAP3 Touch Book" 238 238 depends on ARCH_OMAP3 239 239 default y 240 + select OMAP_PACKAGE_CBB 240 241 241 242 config MACH_OMAP_3430SDP 242 243 bool "OMAP 3430 SDP board"
+1 -1
arch/arm/mach-omap2/Makefile
··· 255 255 obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o 256 256 obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o 257 257 obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o 258 - obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o 258 + obj-$(CONFIG_MACH_TOUCHBOOK) += board-omap3touchbook.o 259 259 obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o 260 260 obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o 261 261
+7 -7
arch/arm/mach-omap2/clock33xx_data.c
··· 1036 1036 CLK(NULL, "mmu_fck", &mmu_fck, CK_AM33XX), 1037 1037 CLK(NULL, "smartreflex0_fck", &smartreflex0_fck, CK_AM33XX), 1038 1038 CLK(NULL, "smartreflex1_fck", &smartreflex1_fck, CK_AM33XX), 1039 - CLK(NULL, "gpt1_fck", &timer1_fck, CK_AM33XX), 1040 - CLK(NULL, "gpt2_fck", &timer2_fck, CK_AM33XX), 1041 - CLK(NULL, "gpt3_fck", &timer3_fck, CK_AM33XX), 1042 - CLK(NULL, "gpt4_fck", &timer4_fck, CK_AM33XX), 1043 - CLK(NULL, "gpt5_fck", &timer5_fck, CK_AM33XX), 1044 - CLK(NULL, "gpt6_fck", &timer6_fck, CK_AM33XX), 1045 - CLK(NULL, "gpt7_fck", &timer7_fck, CK_AM33XX), 1039 + CLK(NULL, "timer1_fck", &timer1_fck, CK_AM33XX), 1040 + CLK(NULL, "timer2_fck", &timer2_fck, CK_AM33XX), 1041 + CLK(NULL, "timer3_fck", &timer3_fck, CK_AM33XX), 1042 + CLK(NULL, "timer4_fck", &timer4_fck, CK_AM33XX), 1043 + CLK(NULL, "timer5_fck", &timer5_fck, CK_AM33XX), 1044 + CLK(NULL, "timer6_fck", &timer6_fck, CK_AM33XX), 1045 + CLK(NULL, "timer7_fck", &timer7_fck, CK_AM33XX), 1046 1046 CLK(NULL, "usbotg_fck", &usbotg_fck, CK_AM33XX), 1047 1047 CLK(NULL, "ieee5000_fck", &ieee5000_fck, CK_AM33XX), 1048 1048 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_AM33XX),
+48 -2
arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
··· 241 241 _clkdm_del_autodeps(clkdm); 242 242 } 243 243 244 + static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm) 245 + { 246 + bool hwsup = false; 247 + 248 + if (!clkdm->clktrctrl_mask) 249 + return 0; 250 + 251 + hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, 252 + clkdm->clktrctrl_mask); 253 + 254 + if (hwsup) { 255 + /* Disable HW transitions when we are changing deps */ 256 + _disable_hwsup(clkdm); 257 + _clkdm_add_autodeps(clkdm); 258 + _enable_hwsup(clkdm); 259 + } else { 260 + if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) 261 + omap3_clkdm_wakeup(clkdm); 262 + } 263 + 264 + return 0; 265 + } 266 + 267 + static int omap3xxx_clkdm_clk_disable(struct clockdomain *clkdm) 268 + { 269 + bool hwsup = false; 270 + 271 + if (!clkdm->clktrctrl_mask) 272 + return 0; 273 + 274 + hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, 275 + clkdm->clktrctrl_mask); 276 + 277 + if (hwsup) { 278 + /* Disable HW transitions when we are changing deps */ 279 + _disable_hwsup(clkdm); 280 + _clkdm_del_autodeps(clkdm); 281 + _enable_hwsup(clkdm); 282 + } else { 283 + if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP) 284 + omap3_clkdm_sleep(clkdm); 285 + } 286 + 287 + return 0; 288 + } 289 + 244 290 struct clkdm_ops omap2_clkdm_operations = { 245 291 .clkdm_add_wkdep = omap2_clkdm_add_wkdep, 246 292 .clkdm_del_wkdep = omap2_clkdm_del_wkdep, ··· 313 267 .clkdm_wakeup = omap3_clkdm_wakeup, 314 268 .clkdm_allow_idle = omap3_clkdm_allow_idle, 315 269 .clkdm_deny_idle = omap3_clkdm_deny_idle, 316 - .clkdm_clk_enable = omap2_clkdm_clk_enable, 317 - .clkdm_clk_disable = omap2_clkdm_clk_disable, 270 + .clkdm_clk_enable = omap3xxx_clkdm_clk_enable, 271 + .clkdm_clk_disable = omap3xxx_clkdm_clk_disable, 318 272 };
+1
arch/arm/mach-omap2/cm-regbits-34xx.h
··· 67 67 #define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0) 68 68 69 69 /* CM_IDLEST_IVA2 */ 70 + #define OMAP3430_ST_IVA2_SHIFT 0 70 71 #define OMAP3430_ST_IVA2_MASK (1 << 0) 71 72 72 73 /* CM_IDLEST_PLL_IVA2 */
+1 -1
arch/arm/mach-omap2/omap-wakeupgen.c
··· 47 47 static void __iomem *wakeupgen_base; 48 48 static void __iomem *sar_base; 49 49 static DEFINE_SPINLOCK(wakeupgen_lock); 50 - static unsigned int irq_target_cpu[NR_IRQS]; 50 + static unsigned int irq_target_cpu[MAX_IRQS]; 51 51 static unsigned int irq_banks = MAX_NR_REG_BANKS; 52 52 static unsigned int max_irqs = MAX_IRQS; 53 53 static unsigned int omap_secure_apis;
+1
arch/arm/mach-omap2/omap_hwmod.c
··· 1889 1889 _enable_sysc(oh); 1890 1890 } 1891 1891 } else { 1892 + _omap4_disable_module(oh); 1892 1893 _disable_clocks(oh); 1893 1894 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", 1894 1895 oh->name, r);
+12 -3
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
··· 100 100 101 101 /* IVA2 (IVA2) */ 102 102 static struct omap_hwmod_rst_info omap3xxx_iva_resets[] = { 103 - { .name = "logic", .rst_shift = 0 }, 104 - { .name = "seq0", .rst_shift = 1 }, 105 - { .name = "seq1", .rst_shift = 2 }, 103 + { .name = "logic", .rst_shift = 0, .st_shift = 8 }, 104 + { .name = "seq0", .rst_shift = 1, .st_shift = 9 }, 105 + { .name = "seq1", .rst_shift = 2, .st_shift = 10 }, 106 106 }; 107 107 108 108 static struct omap_hwmod omap3xxx_iva_hwmod = { ··· 112 112 .rst_lines = omap3xxx_iva_resets, 113 113 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_iva_resets), 114 114 .main_clk = "iva2_ck", 115 + .prcm = { 116 + .omap2 = { 117 + .module_offs = OMAP3430_IVA2_MOD, 118 + .prcm_reg_id = 1, 119 + .module_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT, 120 + .idlest_reg_id = 1, 121 + .idlest_idle_bit = OMAP3430_ST_IVA2_SHIFT, 122 + } 123 + }, 115 124 }; 116 125 117 126 /* timer class */
+6 -6
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
··· 4209 4209 }; 4210 4210 4211 4211 /* dsp -> sl2if */ 4212 - static struct omap_hwmod_ocp_if omap44xx_dsp__sl2if = { 4212 + static struct omap_hwmod_ocp_if __maybe_unused omap44xx_dsp__sl2if = { 4213 4213 .master = &omap44xx_dsp_hwmod, 4214 4214 .slave = &omap44xx_sl2if_hwmod, 4215 4215 .clk = "dpll_iva_m5x2_ck", ··· 4827 4827 }; 4828 4828 4829 4829 /* iva -> sl2if */ 4830 - static struct omap_hwmod_ocp_if omap44xx_iva__sl2if = { 4830 + static struct omap_hwmod_ocp_if __maybe_unused omap44xx_iva__sl2if = { 4831 4831 .master = &omap44xx_iva_hwmod, 4832 4832 .slave = &omap44xx_sl2if_hwmod, 4833 4833 .clk = "dpll_iva_m5x2_ck", ··· 5361 5361 }; 5362 5362 5363 5363 /* l3_main_2 -> sl2if */ 5364 - static struct omap_hwmod_ocp_if omap44xx_l3_main_2__sl2if = { 5364 + static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l3_main_2__sl2if = { 5365 5365 .master = &omap44xx_l3_main_2_hwmod, 5366 5366 .slave = &omap44xx_sl2if_hwmod, 5367 5367 .clk = "l3_div_ck", ··· 6031 6031 &omap44xx_l4_abe__dmic, 6032 6032 &omap44xx_l4_abe__dmic_dma, 6033 6033 &omap44xx_dsp__iva, 6034 - &omap44xx_dsp__sl2if, 6034 + /* &omap44xx_dsp__sl2if, */ 6035 6035 &omap44xx_l4_cfg__dsp, 6036 6036 &omap44xx_l3_main_2__dss, 6037 6037 &omap44xx_l4_per__dss, ··· 6067 6067 &omap44xx_l4_per__i2c4, 6068 6068 &omap44xx_l3_main_2__ipu, 6069 6069 &omap44xx_l3_main_2__iss, 6070 - &omap44xx_iva__sl2if, 6070 + /* &omap44xx_iva__sl2if, */ 6071 6071 &omap44xx_l3_main_2__iva, 6072 6072 &omap44xx_l4_wkup__kbd, 6073 6073 &omap44xx_l4_cfg__mailbox, ··· 6098 6098 &omap44xx_l4_cfg__cm_core, 6099 6099 &omap44xx_l4_wkup__prm, 6100 6100 &omap44xx_l4_wkup__scrm, 6101 - &omap44xx_l3_main_2__sl2if, 6101 + /* &omap44xx_l3_main_2__sl2if, */ 6102 6102 &omap44xx_l4_abe__slimbus1, 6103 6103 &omap44xx_l4_abe__slimbus1_dma, 6104 6104 &omap44xx_l4_per__slimbus2,
+7
arch/arm/mach-omap2/timer.c
··· 263 263 return 0; 264 264 } 265 265 266 + #ifdef CONFIG_OMAP_32K_TIMER 266 267 /* Setup free-running counter for clocksource */ 267 268 static int __init omap2_sync32k_clocksource_init(void) 268 269 { ··· 303 302 304 303 return ret; 305 304 } 305 + #else 306 + static inline int omap2_sync32k_clocksource_init(void) 307 + { 308 + return -ENODEV; 309 + } 310 + #endif 306 311 307 312 static void __init omap2_gptimer_clocksource_init(int gptimer_id, 308 313 const char *fck_source)
+1 -1
arch/arm/mach-ux500/Makefile
··· 12 12 board-mop500-uib.o board-mop500-stuib.o \ 13 13 board-mop500-u8500uib.o \ 14 14 board-mop500-pins.o \ 15 - board-mop500-msp.o 15 + board-mop500-audio.o 16 16 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 17 17 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
+15 -87
arch/arm/mach-ux500/board-mop500-msp.c arch/arm/mach-ux500/board-mop500-audio.c
··· 7 7 #include <linux/platform_device.h> 8 8 #include <linux/init.h> 9 9 #include <linux/gpio.h> 10 - #include <linux/pinctrl/consumer.h> 11 10 12 11 #include <plat/gpio-nomadik.h> 13 12 #include <plat/pincfg.h> ··· 21 22 #include "board-mop500.h" 22 23 #include "devices-db8500.h" 23 24 #include "pins-db8500.h" 24 - 25 - /* MSP1/3 Tx/Rx usage protection */ 26 - static DEFINE_SPINLOCK(msp_rxtx_lock); 27 - 28 - /* Reference Count */ 29 - static int msp_rxtx_ref; 30 - 31 - /* Pin modes */ 32 - struct pinctrl *msp1_p; 33 - struct pinctrl_state *msp1_def; 34 - struct pinctrl_state *msp1_sleep; 35 - 36 - int msp13_i2s_init(void) 37 - { 38 - int retval = 0; 39 - unsigned long flags; 40 - 41 - spin_lock_irqsave(&msp_rxtx_lock, flags); 42 - if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_def))) { 43 - retval = pinctrl_select_state(msp1_p, msp1_def); 44 - if (retval) 45 - pr_err("could not set MSP1 defstate\n"); 46 - } 47 - if (!retval) 48 - msp_rxtx_ref++; 49 - spin_unlock_irqrestore(&msp_rxtx_lock, flags); 50 - 51 - return retval; 52 - } 53 - 54 - int msp13_i2s_exit(void) 55 - { 56 - int retval = 0; 57 - unsigned long flags; 58 - 59 - spin_lock_irqsave(&msp_rxtx_lock, flags); 60 - WARN_ON(!msp_rxtx_ref); 61 - msp_rxtx_ref--; 62 - if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_sleep))) { 63 - retval = pinctrl_select_state(msp1_p, msp1_sleep); 64 - if (retval) 65 - pr_err("could not set MSP1 sleepstate\n"); 66 - } 67 - spin_unlock_irqrestore(&msp_rxtx_lock, flags); 68 - 69 - return retval; 70 - } 71 25 72 26 static struct stedma40_chan_cfg msp0_dma_rx = { 73 27 .high_priority = true, ··· 48 96 /* data_width is set during configuration */ 49 97 }; 50 98 51 - static struct msp_i2s_platform_data msp0_platform_data = { 99 + struct msp_i2s_platform_data msp0_platform_data = { 52 100 .id = MSP_I2S_0, 53 101 .msp_i2s_dma_rx = &msp0_dma_rx, 54 102 .msp_i2s_dma_tx = &msp0_dma_tx, ··· 80 128 /* data_width is set during configuration */ 81 129 }; 82 130 83 - static struct msp_i2s_platform_data msp1_platform_data = { 131 + struct msp_i2s_platform_data msp1_platform_data = { 84 132 .id = MSP_I2S_1, 85 133 .msp_i2s_dma_rx = NULL, 86 134 .msp_i2s_dma_tx = &msp1_dma_tx, 87 - .msp_i2s_init = msp13_i2s_init, 88 - .msp_i2s_exit = msp13_i2s_exit, 89 135 }; 90 136 91 137 static struct stedma40_chan_cfg msp2_dma_rx = { ··· 143 193 144 194 /* Platform device for ASoC MOP500 machine */ 145 195 static struct platform_device snd_soc_mop500 = { 146 - .name = "snd-soc-mop500", 147 - .id = 0, 148 - .dev = { 149 - .platform_data = NULL, 150 - }, 196 + .name = "snd-soc-mop500", 197 + .id = 0, 198 + .dev = { 199 + .platform_data = NULL, 200 + }, 151 201 }; 152 202 153 203 /* Platform device for Ux500-PCM */ ··· 159 209 }, 160 210 }; 161 211 162 - static struct msp_i2s_platform_data msp2_platform_data = { 212 + struct msp_i2s_platform_data msp2_platform_data = { 163 213 .id = MSP_I2S_2, 164 214 .msp_i2s_dma_rx = &msp2_dma_rx, 165 215 .msp_i2s_dma_tx = &msp2_dma_tx, 166 216 }; 167 217 168 - static struct msp_i2s_platform_data msp3_platform_data = { 218 + struct msp_i2s_platform_data msp3_platform_data = { 169 219 .id = MSP_I2S_3, 170 220 .msp_i2s_dma_rx = &msp1_dma_rx, 171 221 .msp_i2s_dma_tx = NULL, 172 - .msp_i2s_init = msp13_i2s_init, 173 - .msp_i2s_exit = msp13_i2s_exit, 174 222 }; 175 223 176 - int mop500_msp_init(struct device *parent) 224 + void mop500_audio_init(struct device *parent) 177 225 { 178 - struct platform_device *msp1; 179 - 180 226 pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__); 181 227 platform_device_register(&snd_soc_mop500); 182 228 183 229 pr_info("Initialize MSP I2S-devices.\n"); 184 230 db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, 185 231 &msp0_platform_data); 186 - msp1 = db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, 232 + db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, 187 233 &msp1_platform_data); 188 234 db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, 189 235 &msp2_platform_data); 190 236 db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, 191 237 &msp3_platform_data); 238 + } 192 239 193 - /* Get the pinctrl handle for MSP1 */ 194 - if (msp1) { 195 - msp1_p = pinctrl_get(&msp1->dev); 196 - if (IS_ERR(msp1_p)) 197 - dev_err(&msp1->dev, "could not get MSP1 pinctrl\n"); 198 - else { 199 - msp1_def = pinctrl_lookup_state(msp1_p, 200 - PINCTRL_STATE_DEFAULT); 201 - if (IS_ERR(msp1_def)) { 202 - dev_err(&msp1->dev, 203 - "could not get MSP1 defstate\n"); 204 - } 205 - msp1_sleep = pinctrl_lookup_state(msp1_p, 206 - PINCTRL_STATE_SLEEP); 207 - if (IS_ERR(msp1_sleep)) 208 - dev_err(&msp1->dev, 209 - "could not get MSP1 idlestate\n"); 210 - } 211 - } 212 - 240 + /* Due for removal once the MSP driver has been fully DT:ed. */ 241 + void mop500_of_audio_init(struct device *parent) 242 + { 213 243 pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); 214 244 platform_device_register(&ux500_pcm); 215 - 216 - return 0; 217 245 }
-14
arch/arm/mach-ux500/board-mop500-msp.h
··· 1 - /* 2 - * Copyright (C) ST-Ericsson SA 2012 3 - * 4 - * Author: Ola Lilja <ola.o.lilja@stericsson.com>, 5 - * for ST-Ericsson. 6 - * 7 - * License terms: 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License version 2 as published 11 - * by the Free Software Foundation. 12 - */ 13 - 14 - void mop500_msp_init(struct device *parent);
+2 -2
arch/arm/mach-ux500/board-mop500-sdi.c
··· 152 152 }; 153 153 #endif 154 154 155 - static struct mmci_platform_data mop500_sdi1_data = { 155 + struct mmci_platform_data mop500_sdi1_data = { 156 156 .ocr_mask = MMC_VDD_29_30, 157 157 .f_max = 50000000, 158 158 .capabilities = MMC_CAP_4_BIT_DATA, ··· 189 189 }; 190 190 #endif 191 191 192 - static struct mmci_platform_data mop500_sdi2_data = { 192 + struct mmci_platform_data mop500_sdi2_data = { 193 193 .ocr_mask = MMC_VDD_165_195, 194 194 .f_max = 50000000, 195 195 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
+18 -21
arch/arm/mach-ux500/board-mop500.c
··· 54 54 #include "devices-db8500.h" 55 55 #include "board-mop500.h" 56 56 #include "board-mop500-regulators.h" 57 - #include "board-mop500-msp.h" 58 57 59 58 static struct gpio_led snowball_led_array[] = { 60 59 { ··· 586 587 mop500_i2c_init(parent); 587 588 mop500_sdi_init(parent); 588 589 mop500_spi_init(parent); 589 - mop500_msp_init(parent); 590 + mop500_audio_init(parent); 590 591 mop500_uart_init(parent); 591 592 592 593 u8500_cryp1_hash1_init(parent); ··· 620 621 mop500_i2c_init(parent); 621 622 snowball_sdi_init(parent); 622 623 mop500_spi_init(parent); 623 - mop500_msp_init(parent); 624 + mop500_audio_init(parent); 624 625 mop500_uart_init(parent); 625 626 626 627 /* This board has full regulator constraints */ ··· 652 653 mop500_i2c_init(parent); 653 654 hrefv60_sdi_init(parent); 654 655 mop500_spi_init(parent); 655 - mop500_msp_init(parent); 656 + mop500_audio_init(parent); 656 657 mop500_uart_init(parent); 657 658 658 659 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); ··· 704 705 705 706 #ifdef CONFIG_MACH_UX500_DT 706 707 707 - static struct platform_device *snowball_of_platform_devs[] __initdata = { 708 - &snowball_led_dev, 709 - &snowball_key_dev, 710 - }; 711 - 712 708 struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { 709 + /* Requires call-back bindings. */ 710 + OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), 713 711 /* Requires DMA and call-back bindings. */ 714 712 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), 715 713 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat), ··· 714 718 /* Requires DMA bindings. */ 715 719 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), 716 720 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), 721 + OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data), 722 + OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data), 717 723 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data), 718 724 /* Requires clock name bindings. */ 719 725 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL), ··· 734 736 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL), 735 737 /* Requires device name bindings. */ 736 738 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), 739 + /* Requires clock name and DMA bindings. */ 740 + OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000, 741 + "ux500-msp-i2s.0", &msp0_platform_data), 742 + OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000, 743 + "ux500-msp-i2s.1", &msp1_platform_data), 744 + OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000, 745 + "ux500-msp-i2s.2", &msp2_platform_data), 746 + OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000, 747 + "ux500-msp-i2s.3", &msp3_platform_data), 737 748 {}, 738 749 }; 739 750 ··· 783 776 ARRAY_SIZE(mop500_platform_devs)); 784 777 785 778 mop500_sdi_init(parent); 786 - mop500_msp_init(parent); 779 + mop500_audio_init(parent); 787 780 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 788 781 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); 789 782 i2c_register_board_info(2, mop500_i2c2_devices, ··· 792 785 mop500_uib_init(); 793 786 794 787 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { 795 - mop500_msp_init(parent); 788 + mop500_of_audio_init(parent); 796 789 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { 797 790 /* 798 791 * The HREFv60 board removed a GPIO expander and routed ··· 802 795 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; 803 796 platform_add_devices(mop500_platform_devs, 804 797 ARRAY_SIZE(mop500_platform_devs)); 805 - 806 - hrefv60_sdi_init(parent); 807 - mop500_msp_init(parent); 808 - 809 - i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 810 - i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; 811 - 812 - i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); 813 - i2c_register_board_info(2, mop500_i2c2_devices, 814 - ARRAY_SIZE(mop500_i2c2_devices)); 815 798 816 799 mop500_uib_init(); 817 800 }
+11
arch/arm/mach-ux500/board-mop500.h
··· 9 9 10 10 /* For NOMADIK_NR_GPIO */ 11 11 #include <mach/irqs.h> 12 + #include <mach/msp.h> 12 13 #include <linux/amba/mmci.h> 13 14 14 15 /* Snowball specific GPIO assignments, this board has no GPIO expander */ ··· 81 80 struct device; 82 81 struct i2c_board_info; 83 82 extern struct mmci_platform_data mop500_sdi0_data; 83 + extern struct mmci_platform_data mop500_sdi1_data; 84 + extern struct mmci_platform_data mop500_sdi2_data; 84 85 extern struct mmci_platform_data mop500_sdi4_data; 86 + extern struct msp_i2s_platform_data msp0_platform_data; 87 + extern struct msp_i2s_platform_data msp1_platform_data; 88 + extern struct msp_i2s_platform_data msp2_platform_data; 89 + extern struct msp_i2s_platform_data msp3_platform_data; 90 + extern struct arm_pmu_platdata db8500_pmu_platdata; 85 91 86 92 extern void mop500_sdi_init(struct device *parent); 87 93 extern void snowball_sdi_init(struct device *parent); ··· 99 91 void __init mop500_pinmaps_init(void); 100 92 void __init snowball_pinmaps_init(void); 101 93 void __init hrefv60_pinmaps_init(void); 94 + void mop500_audio_init(struct device *parent); 95 + /* Due for removal once the MSP driver has been fully DT:ed. */ 96 + void mop500_of_audio_init(struct device *parent); 102 97 103 98 int __init mop500_uib_init(void); 104 99 void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
+2 -8
arch/arm/mach-ux500/cpu-db8500.c
··· 138 138 &db8500_prcmu_device, 139 139 }; 140 140 141 - static struct platform_device *of_platform_devs[] __initdata = { 142 - &u8500_dma40_device, 143 - }; 144 - 145 141 static resource_size_t __initdata db8500_gpio_base[] = { 146 142 U8500_GPIOBANK0_BASE, 147 143 U8500_GPIOBANK1_BASE, ··· 231 235 struct device * __init u8500_of_init_devices(void) 232 236 { 233 237 struct device *parent; 234 - int i; 235 238 236 239 parent = db8500_soc_device_init(); 237 240 ··· 239 244 platform_device_register_data(parent, 240 245 "cpufreq-u8500", -1, NULL, 0); 241 246 242 - for (i = 0; i < ARRAY_SIZE(of_platform_devs); i++) 243 - of_platform_devs[i]->dev.parent = parent; 247 + u8500_dma40_device.dev.parent = parent; 244 248 245 249 /* 246 250 * Devices to be DT:ed: ··· 247 253 * db8500_pmu_device = done 248 254 * db8500_prcmu_device = done 249 255 */ 250 - platform_add_devices(of_platform_devs, ARRAY_SIZE(of_platform_devs)); 256 + platform_device_register(&u8500_dma40_device); 251 257 252 258 return parent; 253 259 }
-2
arch/arm/mach-ux500/include/mach/msp.h
··· 22 22 enum msp_i2s_id id; 23 23 struct stedma40_chan_cfg *msp_i2s_dma_rx; 24 24 struct stedma40_chan_cfg *msp_i2s_dma_tx; 25 - int (*msp_i2s_init) (void); 26 - int (*msp_i2s_exit) (void); 27 25 }; 28 26 29 27 #endif
+4 -3
arch/arm/mm/context.c
··· 63 63 pid = task_pid_nr(thread->task) << ASID_BITS; 64 64 asm volatile( 65 65 " mrc p15, 0, %0, c13, c0, 1\n" 66 - " bfi %1, %0, #0, %2\n" 67 - " mcr p15, 0, %1, c13, c0, 1\n" 66 + " and %0, %0, %2\n" 67 + " orr %0, %0, %1\n" 68 + " mcr p15, 0, %0, c13, c0, 1\n" 68 69 : "=r" (contextidr), "+r" (pid) 69 - : "I" (ASID_BITS)); 70 + : "I" (~ASID_MASK)); 70 71 isb(); 71 72 72 73 return NOTIFY_OK;
+1 -1
arch/arm/mm/dma-mapping.c
··· 489 489 void *pool_start = pool->vaddr; 490 490 void *pool_end = pool->vaddr + pool->size; 491 491 492 - if (start < pool_start || start > pool_end) 492 + if (start < pool_start || start >= pool_end) 493 493 return false; 494 494 495 495 if (end <= pool_end)
+3
arch/arm/mm/mm.h
··· 55 55 /* permanent static mappings from iotable_init() */ 56 56 #define VM_ARM_STATIC_MAPPING 0x40000000 57 57 58 + /* empty mapping */ 59 + #define VM_ARM_EMPTY_MAPPING 0x20000000 60 + 58 61 /* mapping type (attributes) for permanent static mappings */ 59 62 #define VM_ARM_MTYPE(mt) ((mt) << 20) 60 63 #define VM_ARM_MTYPE_MASK (0x1f << 20)
+4 -4
arch/arm/mm/mmu.c
··· 807 807 vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm)); 808 808 vm->addr = (void *)addr; 809 809 vm->size = SECTION_SIZE; 810 - vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; 810 + vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING; 811 811 vm->caller = pmd_empty_section_gap; 812 812 vm_area_add_early(vm); 813 813 } ··· 820 820 821 821 /* we're still single threaded hence no lock needed here */ 822 822 for (vm = vmlist; vm; vm = vm->next) { 823 - if (!(vm->flags & VM_ARM_STATIC_MAPPING)) 823 + if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING))) 824 824 continue; 825 825 addr = (unsigned long)vm->addr; 826 826 if (addr < next) ··· 961 961 * Check whether this memory bank would partially overlap 962 962 * the vmalloc area. 963 963 */ 964 - if (__va(bank->start + bank->size) > vmalloc_min || 965 - __va(bank->start + bank->size) < __va(bank->start)) { 964 + if (__va(bank->start + bank->size - 1) >= vmalloc_min || 965 + __va(bank->start + bank->size - 1) <= __va(bank->start)) { 966 966 unsigned long newsize = vmalloc_min - __va(bank->start); 967 967 printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx " 968 968 "to -%.8llx (vmalloc region overlap).\n",
+8 -3
arch/arm/plat-omap/sram.c
··· 67 67 68 68 static unsigned long omap_sram_start; 69 69 static void __iomem *omap_sram_base; 70 + static unsigned long omap_sram_skip; 70 71 static unsigned long omap_sram_size; 71 72 static void __iomem *omap_sram_ceil; 72 73 ··· 106 105 */ 107 106 static void __init omap_detect_sram(void) 108 107 { 108 + omap_sram_skip = SRAM_BOOTLOADER_SZ; 109 109 if (cpu_class_is_omap2()) { 110 110 if (is_sram_locked()) { 111 111 if (cpu_is_omap34xx()) { ··· 114 112 if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || 115 113 (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { 116 114 omap_sram_size = 0x7000; /* 28K */ 115 + omap_sram_skip += SZ_16K; 117 116 } else { 118 117 omap_sram_size = 0x8000; /* 32K */ 119 118 } ··· 177 174 return; 178 175 179 176 #ifdef CONFIG_OMAP4_ERRATA_I688 177 + if (cpu_is_omap44xx()) { 180 178 omap_sram_start += PAGE_SIZE; 181 179 omap_sram_size -= SZ_16K; 180 + } 182 181 #endif 183 182 if (cpu_is_omap34xx()) { 184 183 /* ··· 207 202 * Looks like we need to preserve some bootloader code at the 208 203 * beginning of SRAM for jumping to flash for reboot to work... 209 204 */ 210 - memset_io(omap_sram_base + SRAM_BOOTLOADER_SZ, 0, 211 - omap_sram_size - SRAM_BOOTLOADER_SZ); 205 + memset_io(omap_sram_base + omap_sram_skip, 0, 206 + omap_sram_size - omap_sram_skip); 212 207 } 213 208 214 209 /* ··· 222 217 { 223 218 unsigned long available, new_ceil = (unsigned long)omap_sram_ceil; 224 219 225 - available = omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ); 220 + available = omap_sram_ceil - (omap_sram_base + omap_sram_skip); 226 221 227 222 if (size > available) { 228 223 pr_err("Not enough space in SRAM\n");
+1
arch/blackfin/Kconfig
··· 38 38 select GENERIC_ATOMIC64 39 39 select GENERIC_IRQ_PROBE 40 40 select IRQ_PER_CPU if SMP 41 + select USE_GENERIC_SMP_HELPERS if SMP 41 42 select HAVE_NMI_WATCHDOG if NMI_WATCHDOG 42 43 select GENERIC_SMP_IDLE_THREAD 43 44 select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
-1
arch/blackfin/Makefile
··· 20 20 KBUILD_AFLAGS += $(call cc-option,-mno-fdpic) 21 21 KBUILD_CFLAGS_MODULE += -mlong-calls 22 22 LDFLAGS += -m elf32bfin 23 - KALLSYMS += --symbol-prefix=_ 24 23 25 24 KBUILD_DEFCONFIG := BF537-STAMP_defconfig 26 25
+2
arch/blackfin/include/asm/smp.h
··· 18 18 #define raw_smp_processor_id() blackfin_core_id() 19 19 20 20 extern void bfin_relocate_coreb_l1_mem(void); 21 + extern void arch_send_call_function_single_ipi(int cpu); 22 + extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 21 23 22 24 #if defined(CONFIG_SMP) && defined(CONFIG_ICACHE_FLUSH_L1) 23 25 asmlinkage void blackfin_icache_flush_range_l1(unsigned long *ptr);
+63 -154
arch/blackfin/mach-common/smp.c
··· 48 48 49 49 struct blackfin_initial_pda __cpuinitdata initial_pda_coreb; 50 50 51 - #define BFIN_IPI_TIMER 0 52 - #define BFIN_IPI_RESCHEDULE 1 53 - #define BFIN_IPI_CALL_FUNC 2 54 - #define BFIN_IPI_CPU_STOP 3 51 + enum ipi_message_type { 52 + BFIN_IPI_TIMER, 53 + BFIN_IPI_RESCHEDULE, 54 + BFIN_IPI_CALL_FUNC, 55 + BFIN_IPI_CALL_FUNC_SINGLE, 56 + BFIN_IPI_CPU_STOP, 57 + }; 55 58 56 59 struct blackfin_flush_data { 57 60 unsigned long start; ··· 63 60 64 61 void *secondary_stack; 65 62 66 - 67 - struct smp_call_struct { 68 - void (*func)(void *info); 69 - void *info; 70 - int wait; 71 - cpumask_t *waitmask; 72 - }; 73 - 74 63 static struct blackfin_flush_data smp_flush_data; 75 64 76 65 static DEFINE_SPINLOCK(stop_lock); 77 - 78 - struct ipi_message { 79 - unsigned long type; 80 - struct smp_call_struct call_struct; 81 - }; 82 66 83 67 /* A magic number - stress test shows this is safe for common cases */ 84 68 #define BFIN_IPI_MSGQ_LEN 5 85 69 86 70 /* Simple FIFO buffer, overflow leads to panic */ 87 - struct ipi_message_queue { 88 - spinlock_t lock; 71 + struct ipi_data { 89 72 unsigned long count; 90 - unsigned long head; /* head of the queue */ 91 - struct ipi_message ipi_message[BFIN_IPI_MSGQ_LEN]; 73 + unsigned long bits; 92 74 }; 93 75 94 - static DEFINE_PER_CPU(struct ipi_message_queue, ipi_msg_queue); 76 + static DEFINE_PER_CPU(struct ipi_data, bfin_ipi); 95 77 96 78 static void ipi_cpu_stop(unsigned int cpu) 97 79 { ··· 117 129 blackfin_icache_flush_range(fdata->start, fdata->end); 118 130 } 119 131 120 - static void ipi_call_function(unsigned int cpu, struct ipi_message *msg) 121 - { 122 - int wait; 123 - void (*func)(void *info); 124 - void *info; 125 - func = msg->call_struct.func; 126 - info = msg->call_struct.info; 127 - wait = msg->call_struct.wait; 128 - func(info); 129 - if (wait) { 130 - #ifdef __ARCH_SYNC_CORE_DCACHE 131 - /* 132 - * 'wait' usually means synchronization between CPUs. 133 - * Invalidate D cache in case shared data was changed 134 - * by func() to ensure cache coherence. 135 - */ 136 - resync_core_dcache(); 137 - #endif 138 - cpumask_clear_cpu(cpu, msg->call_struct.waitmask); 139 - } 140 - } 141 - 142 132 /* Use IRQ_SUPPLE_0 to request reschedule. 143 133 * When returning from interrupt to user space, 144 134 * there is chance to reschedule */ ··· 138 172 139 173 static irqreturn_t ipi_handler_int1(int irq, void *dev_instance) 140 174 { 141 - struct ipi_message *msg; 142 - struct ipi_message_queue *msg_queue; 175 + struct ipi_data *bfin_ipi_data; 143 176 unsigned int cpu = smp_processor_id(); 144 - unsigned long flags; 177 + unsigned long pending; 178 + unsigned long msg; 145 179 146 180 platform_clear_ipi(cpu, IRQ_SUPPLE_1); 147 181 148 - msg_queue = &__get_cpu_var(ipi_msg_queue); 182 + bfin_ipi_data = &__get_cpu_var(bfin_ipi); 149 183 150 - spin_lock_irqsave(&msg_queue->lock, flags); 184 + while ((pending = xchg(&bfin_ipi_data->bits, 0)) != 0) { 185 + msg = 0; 186 + do { 187 + msg = find_next_bit(&pending, BITS_PER_LONG, msg + 1); 188 + switch (msg) { 189 + case BFIN_IPI_TIMER: 190 + ipi_timer(); 191 + break; 192 + case BFIN_IPI_RESCHEDULE: 193 + scheduler_ipi(); 194 + break; 195 + case BFIN_IPI_CALL_FUNC: 196 + generic_smp_call_function_interrupt(); 197 + break; 151 198 152 - while (msg_queue->count) { 153 - msg = &msg_queue->ipi_message[msg_queue->head]; 154 - switch (msg->type) { 155 - case BFIN_IPI_TIMER: 156 - ipi_timer(); 157 - break; 158 - case BFIN_IPI_RESCHEDULE: 159 - scheduler_ipi(); 160 - break; 161 - case BFIN_IPI_CALL_FUNC: 162 - ipi_call_function(cpu, msg); 163 - break; 164 - case BFIN_IPI_CPU_STOP: 165 - ipi_cpu_stop(cpu); 166 - break; 167 - default: 168 - printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%lx\n", 169 - cpu, msg->type); 170 - break; 171 - } 172 - msg_queue->head++; 173 - msg_queue->head %= BFIN_IPI_MSGQ_LEN; 174 - msg_queue->count--; 199 + case BFIN_IPI_CALL_FUNC_SINGLE: 200 + generic_smp_call_function_single_interrupt(); 201 + break; 202 + 203 + case BFIN_IPI_CPU_STOP: 204 + ipi_cpu_stop(cpu); 205 + break; 206 + } 207 + } while (msg < BITS_PER_LONG); 208 + 209 + smp_mb(); 175 210 } 176 - spin_unlock_irqrestore(&msg_queue->lock, flags); 177 211 return IRQ_HANDLED; 178 212 } 179 213 180 - static void ipi_queue_init(void) 214 + static void bfin_ipi_init(void) 181 215 { 182 216 unsigned int cpu; 183 - struct ipi_message_queue *msg_queue; 217 + struct ipi_data *bfin_ipi_data; 184 218 for_each_possible_cpu(cpu) { 185 - msg_queue = &per_cpu(ipi_msg_queue, cpu); 186 - spin_lock_init(&msg_queue->lock); 187 - msg_queue->count = 0; 188 - msg_queue->head = 0; 219 + bfin_ipi_data = &per_cpu(bfin_ipi, cpu); 220 + bfin_ipi_data->bits = 0; 221 + bfin_ipi_data->count = 0; 189 222 } 190 223 } 191 224 192 - static inline void smp_send_message(cpumask_t callmap, unsigned long type, 193 - void (*func) (void *info), void *info, int wait) 225 + void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg) 194 226 { 195 227 unsigned int cpu; 196 - struct ipi_message_queue *msg_queue; 197 - struct ipi_message *msg; 198 - unsigned long flags, next_msg; 199 - cpumask_t waitmask; /* waitmask is shared by all cpus */ 228 + struct ipi_data *bfin_ipi_data; 229 + unsigned long flags; 200 230 201 - cpumask_copy(&waitmask, &callmap); 202 - for_each_cpu(cpu, &callmap) { 203 - msg_queue = &per_cpu(ipi_msg_queue, cpu); 204 - spin_lock_irqsave(&msg_queue->lock, flags); 205 - if (msg_queue->count < BFIN_IPI_MSGQ_LEN) { 206 - next_msg = (msg_queue->head + msg_queue->count) 207 - % BFIN_IPI_MSGQ_LEN; 208 - msg = &msg_queue->ipi_message[next_msg]; 209 - msg->type = type; 210 - if (type == BFIN_IPI_CALL_FUNC) { 211 - msg->call_struct.func = func; 212 - msg->call_struct.info = info; 213 - msg->call_struct.wait = wait; 214 - msg->call_struct.waitmask = &waitmask; 215 - } 216 - msg_queue->count++; 217 - } else 218 - panic("IPI message queue overflow\n"); 219 - spin_unlock_irqrestore(&msg_queue->lock, flags); 231 + local_irq_save(flags); 232 + 233 + for_each_cpu(cpu, cpumask) { 234 + bfin_ipi_data = &per_cpu(bfin_ipi, cpu); 235 + smp_mb(); 236 + set_bit(msg, &bfin_ipi_data->bits); 237 + bfin_ipi_data->count++; 220 238 platform_send_ipi_cpu(cpu, IRQ_SUPPLE_1); 221 239 } 222 240 223 - if (wait) { 224 - while (!cpumask_empty(&waitmask)) 225 - blackfin_dcache_invalidate_range( 226 - (unsigned long)(&waitmask), 227 - (unsigned long)(&waitmask)); 228 - #ifdef __ARCH_SYNC_CORE_DCACHE 229 - /* 230 - * Invalidate D cache in case shared data was changed by 231 - * other processors to ensure cache coherence. 232 - */ 233 - resync_core_dcache(); 234 - #endif 235 - } 241 + local_irq_restore(flags); 236 242 } 237 243 238 - int smp_call_function(void (*func)(void *info), void *info, int wait) 244 + void arch_send_call_function_single_ipi(int cpu) 239 245 { 240 - cpumask_t callmap; 241 - 242 - preempt_disable(); 243 - cpumask_copy(&callmap, cpu_online_mask); 244 - cpumask_clear_cpu(smp_processor_id(), &callmap); 245 - if (!cpumask_empty(&callmap)) 246 - smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); 247 - 248 - preempt_enable(); 249 - 250 - return 0; 246 + send_ipi(cpumask_of(cpu), BFIN_IPI_CALL_FUNC_SINGLE); 251 247 } 252 - EXPORT_SYMBOL_GPL(smp_call_function); 253 248 254 - int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, 255 - int wait) 249 + void arch_send_call_function_ipi_mask(const struct cpumask *mask) 256 250 { 257 - unsigned int cpu = cpuid; 258 - cpumask_t callmap; 259 - 260 - if (cpu_is_offline(cpu)) 261 - return 0; 262 - cpumask_clear(&callmap); 263 - cpumask_set_cpu(cpu, &callmap); 264 - 265 - smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); 266 - 267 - return 0; 251 + send_ipi(mask, BFIN_IPI_CALL_FUNC); 268 252 } 269 - EXPORT_SYMBOL_GPL(smp_call_function_single); 270 253 271 254 void smp_send_reschedule(int cpu) 272 255 { 273 - cpumask_t callmap; 274 - /* simply trigger an ipi */ 275 - 276 - cpumask_clear(&callmap); 277 - cpumask_set_cpu(cpu, &callmap); 278 - 279 - smp_send_message(callmap, BFIN_IPI_RESCHEDULE, NULL, NULL, 0); 256 + send_ipi(cpumask_of(cpu), BFIN_IPI_RESCHEDULE); 280 257 281 258 return; 282 259 } 283 260 284 261 void smp_send_msg(const struct cpumask *mask, unsigned long type) 285 262 { 286 - smp_send_message(*mask, type, NULL, NULL, 0); 263 + send_ipi(mask, type); 287 264 } 288 265 289 266 void smp_timer_broadcast(const struct cpumask *mask) ··· 242 333 cpumask_copy(&callmap, cpu_online_mask); 243 334 cpumask_clear_cpu(smp_processor_id(), &callmap); 244 335 if (!cpumask_empty(&callmap)) 245 - smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); 336 + send_ipi(&callmap, BFIN_IPI_CPU_STOP); 246 337 247 338 preempt_enable(); 248 339 ··· 345 436 void __init smp_prepare_cpus(unsigned int max_cpus) 346 437 { 347 438 platform_prepare_cpus(max_cpus); 348 - ipi_queue_init(); 439 + bfin_ipi_init(); 349 440 platform_request_ipi(IRQ_SUPPLE_0, ipi_handler_int0); 350 441 platform_request_ipi(IRQ_SUPPLE_1, ipi_handler_int1); 351 442 }
+5 -5
arch/s390/oprofile/init.c
··· 169 169 if (*offset) 170 170 return -EINVAL; 171 171 retval = oprofilefs_ulong_from_user(&val, buf, count); 172 - if (retval) 172 + if (retval <= 0) 173 173 return retval; 174 174 if (val < oprofile_min_interval) 175 175 oprofile_hw_interval = oprofile_min_interval; ··· 212 212 return -EINVAL; 213 213 214 214 retval = oprofilefs_ulong_from_user(&val, buf, count); 215 - if (retval) 215 + if (retval <= 0) 216 216 return retval; 217 217 if (val != 0) 218 218 return -EINVAL; ··· 243 243 return -EINVAL; 244 244 245 245 retval = oprofilefs_ulong_from_user(&val, buf, count); 246 - if (retval) 246 + if (retval <= 0) 247 247 return retval; 248 248 249 249 if (val != 0 && val != 1) ··· 278 278 return -EINVAL; 279 279 280 280 retval = oprofilefs_ulong_from_user(&val, buf, count); 281 - if (retval) 281 + if (retval <= 0) 282 282 return retval; 283 283 284 284 if (val != 0 && val != 1) ··· 317 317 return -EINVAL; 318 318 319 319 retval = oprofilefs_ulong_from_user(&val, buf, count); 320 - if (retval) 320 + if (retval <= 0) 321 321 return retval; 322 322 323 323 if (val != 0 && val != 1)
+1
arch/x86/kernel/cpu/perf_event_intel.c
··· 2008 2008 break; 2009 2009 2010 2010 case 28: /* Atom */ 2011 + case 54: /* Cedariew */ 2011 2012 memcpy(hw_cache_event_ids, atom_hw_cache_event_ids, 2012 2013 sizeof(hw_cache_event_ids)); 2013 2014
+2 -1
arch/x86/kernel/cpu/perf_event_intel_lbr.c
··· 686 686 * to have an operational LBR which can freeze 687 687 * on PMU interrupt 688 688 */ 689 - if (boot_cpu_data.x86_mask < 10) { 689 + if (boot_cpu_data.x86_model == 28 690 + && boot_cpu_data.x86_mask < 10) { 690 691 pr_cont("LBR disabled due to erratum"); 691 692 return; 692 693 }
+3
arch/x86/kernel/microcode_core.c
··· 225 225 if (do_microcode_update(buf, len) == 0) 226 226 ret = (ssize_t)len; 227 227 228 + if (ret > 0) 229 + perf_check_microcode(); 230 + 228 231 mutex_unlock(&microcode_mutex); 229 232 put_online_cpus(); 230 233
+1 -1
arch/x86/kvm/i8259.c
··· 318 318 if (val & 0x10) { 319 319 u8 edge_irr = s->irr & ~s->elcr; 320 320 int i; 321 - bool found; 321 + bool found = false; 322 322 struct kvm_vcpu *vcpu; 323 323 324 324 s->init4 = val & 1;
+18 -5
arch/x86/kvm/vmx.c
··· 3619 3619 3620 3620 static int alloc_apic_access_page(struct kvm *kvm) 3621 3621 { 3622 + struct page *page; 3622 3623 struct kvm_userspace_memory_region kvm_userspace_mem; 3623 3624 int r = 0; 3624 3625 ··· 3634 3633 if (r) 3635 3634 goto out; 3636 3635 3637 - kvm->arch.apic_access_page = gfn_to_page(kvm, 0xfee00); 3636 + page = gfn_to_page(kvm, 0xfee00); 3637 + if (is_error_page(page)) { 3638 + r = -EFAULT; 3639 + goto out; 3640 + } 3641 + 3642 + kvm->arch.apic_access_page = page; 3638 3643 out: 3639 3644 mutex_unlock(&kvm->slots_lock); 3640 3645 return r; ··· 3648 3641 3649 3642 static int alloc_identity_pagetable(struct kvm *kvm) 3650 3643 { 3644 + struct page *page; 3651 3645 struct kvm_userspace_memory_region kvm_userspace_mem; 3652 3646 int r = 0; 3653 3647 ··· 3664 3656 if (r) 3665 3657 goto out; 3666 3658 3667 - kvm->arch.ept_identity_pagetable = gfn_to_page(kvm, 3668 - kvm->arch.ept_identity_map_addr >> PAGE_SHIFT); 3659 + page = gfn_to_page(kvm, kvm->arch.ept_identity_map_addr >> PAGE_SHIFT); 3660 + if (is_error_page(page)) { 3661 + r = -EFAULT; 3662 + goto out; 3663 + } 3664 + 3665 + kvm->arch.ept_identity_pagetable = page; 3669 3666 out: 3670 3667 mutex_unlock(&kvm->slots_lock); 3671 3668 return r; ··· 6588 6575 /* Exposing INVPCID only when PCID is exposed */ 6589 6576 best = kvm_find_cpuid_entry(vcpu, 0x7, 0); 6590 6577 if (vmx_invpcid_supported() && 6591 - best && (best->ecx & bit(X86_FEATURE_INVPCID)) && 6578 + best && (best->ebx & bit(X86_FEATURE_INVPCID)) && 6592 6579 guest_cpuid_has_pcid(vcpu)) { 6593 6580 exec_control |= SECONDARY_EXEC_ENABLE_INVPCID; 6594 6581 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, ··· 6598 6585 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, 6599 6586 exec_control); 6600 6587 if (best) 6601 - best->ecx &= ~bit(X86_FEATURE_INVPCID); 6588 + best->ebx &= ~bit(X86_FEATURE_INVPCID); 6602 6589 } 6603 6590 } 6604 6591
+10 -3
arch/x86/kvm/x86.c
··· 5113 5113 !kvm_event_needs_reinjection(vcpu); 5114 5114 } 5115 5115 5116 - static void vapic_enter(struct kvm_vcpu *vcpu) 5116 + static int vapic_enter(struct kvm_vcpu *vcpu) 5117 5117 { 5118 5118 struct kvm_lapic *apic = vcpu->arch.apic; 5119 5119 struct page *page; 5120 5120 5121 5121 if (!apic || !apic->vapic_addr) 5122 - return; 5122 + return 0; 5123 5123 5124 5124 page = gfn_to_page(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT); 5125 + if (is_error_page(page)) 5126 + return -EFAULT; 5125 5127 5126 5128 vcpu->arch.apic->vapic_page = page; 5129 + return 0; 5127 5130 } 5128 5131 5129 5132 static void vapic_exit(struct kvm_vcpu *vcpu) ··· 5433 5430 } 5434 5431 5435 5432 vcpu->srcu_idx = srcu_read_lock(&kvm->srcu); 5436 - vapic_enter(vcpu); 5433 + r = vapic_enter(vcpu); 5434 + if (r) { 5435 + srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx); 5436 + return r; 5437 + } 5437 5438 5438 5439 r = 1; 5439 5440 while (r > 0) {
+2 -2
crypto/authenc.c
··· 336 336 cryptlen += ivsize; 337 337 } 338 338 339 - if (sg_is_last(assoc)) { 339 + if (req->assoclen && sg_is_last(assoc)) { 340 340 authenc_ahash_fn = crypto_authenc_ahash; 341 341 sg_init_table(asg, 2); 342 342 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset); ··· 490 490 cryptlen += ivsize; 491 491 } 492 492 493 - if (sg_is_last(assoc)) { 493 + if (req->assoclen && sg_is_last(assoc)) { 494 494 authenc_ahash_fn = crypto_authenc_ahash; 495 495 sg_init_table(asg, 2); 496 496 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset);
+10
drivers/acpi/bus.c
··· 237 237 } else if (result == ACPI_STATE_D3_HOT) { 238 238 result = ACPI_STATE_D3; 239 239 } 240 + 241 + /* 242 + * If we were unsure about the device parent's power state up to this 243 + * point, the fact that the device is in D0 implies that the parent has 244 + * to be in D0 too. 245 + */ 246 + if (device->parent && device->parent->power.state == ACPI_STATE_UNKNOWN 247 + && result == ACPI_STATE_D0) 248 + device->parent->power.state = ACPI_STATE_D0; 249 + 240 250 *state = result; 241 251 242 252 out:
+24 -12
drivers/acpi/power.c
··· 107 107 108 108 /* List of devices relying on this power resource */ 109 109 struct acpi_power_resource_device *devices; 110 + struct mutex devices_lock; 110 111 }; 111 112 112 113 static struct list_head acpi_power_resource_list; ··· 226 225 227 226 static int __acpi_power_on(struct acpi_power_resource *resource) 228 227 { 229 - struct acpi_power_resource_device *device_list = resource->devices; 230 228 acpi_status status = AE_OK; 231 229 232 230 status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL); ··· 238 238 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n", 239 239 resource->name)); 240 240 241 - while (device_list) { 242 - acpi_power_on_device(device_list->device); 243 - 244 - device_list = device_list->next; 245 - } 246 - 247 241 return 0; 248 242 } 249 243 250 244 static int acpi_power_on(acpi_handle handle) 251 245 { 252 246 int result = 0; 247 + bool resume_device = false; 253 248 struct acpi_power_resource *resource = NULL; 249 + struct acpi_power_resource_device *device_list; 254 250 255 251 result = acpi_power_get_context(handle, &resource); 256 252 if (result) ··· 262 266 result = __acpi_power_on(resource); 263 267 if (result) 264 268 resource->ref_count--; 269 + else 270 + resume_device = true; 265 271 } 266 272 267 273 mutex_unlock(&resource->resource_lock); 274 + 275 + if (!resume_device) 276 + return result; 277 + 278 + mutex_lock(&resource->devices_lock); 279 + 280 + device_list = resource->devices; 281 + while (device_list) { 282 + acpi_power_on_device(device_list->device); 283 + device_list = device_list->next; 284 + } 285 + 286 + mutex_unlock(&resource->devices_lock); 268 287 269 288 return result; 270 289 } ··· 366 355 if (acpi_power_get_context(res_handle, &resource)) 367 356 return; 368 357 369 - mutex_lock(&resource->resource_lock); 358 + mutex_lock(&resource->devices_lock); 370 359 prev = NULL; 371 360 curr = resource->devices; 372 361 while (curr) { ··· 383 372 prev = curr; 384 373 curr = curr->next; 385 374 } 386 - mutex_unlock(&resource->resource_lock); 375 + mutex_unlock(&resource->devices_lock); 387 376 } 388 377 389 378 /* Unlink dev from all power resources in _PR0 */ ··· 425 414 426 415 power_resource_device->device = powered_device; 427 416 428 - mutex_lock(&resource->resource_lock); 417 + mutex_lock(&resource->devices_lock); 429 418 power_resource_device->next = resource->devices; 430 419 resource->devices = power_resource_device; 431 - mutex_unlock(&resource->resource_lock); 420 + mutex_unlock(&resource->devices_lock); 432 421 433 422 return 0; 434 423 } ··· 473 462 return ret; 474 463 475 464 no_power_resource: 476 - printk(KERN_WARNING PREFIX "Invalid Power Resource to register!"); 465 + printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!"); 477 466 return -ENODEV; 478 467 } 479 468 EXPORT_SYMBOL_GPL(acpi_power_resource_register_device); ··· 732 721 733 722 resource->device = device; 734 723 mutex_init(&resource->resource_lock); 724 + mutex_init(&resource->devices_lock); 735 725 strcpy(resource->name, device->pnp.bus_id); 736 726 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); 737 727 strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
+9 -1
drivers/ata/ahci.c
··· 268 268 /* JMicron 360/1/3/5/6, match class to avoid IDE function */ 269 269 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 270 270 PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr }, 271 + /* JMicron 362B and 362C have an AHCI function with IDE class code */ 272 + { PCI_VDEVICE(JMICRON, 0x2362), board_ahci_ign_iferr }, 273 + { PCI_VDEVICE(JMICRON, 0x236f), board_ahci_ign_iferr }, 271 274 272 275 /* ATI */ 273 276 { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */ ··· 396 393 .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ 397 394 { PCI_DEVICE(0x1b4b, 0x917a), 398 395 .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ 396 + { PCI_DEVICE(0x1b4b, 0x9192), 397 + .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */ 399 398 { PCI_DEVICE(0x1b4b, 0x91a3), 400 399 .driver_data = board_ahci_yes_fbs }, 401 400 ··· 405 400 { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ 406 401 407 402 /* Asmedia */ 408 - { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1061 */ 403 + { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ 404 + { PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci }, /* ASM1060 */ 405 + { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ 406 + { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ 409 407 410 408 /* Generic, PCI class code for AHCI */ 411 409 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+2
drivers/bluetooth/ath3k.c
··· 86 86 87 87 /* Atheros AR5BBU22 with sflash firmware */ 88 88 { USB_DEVICE(0x0489, 0xE03C) }, 89 + { USB_DEVICE(0x0489, 0xE036) }, 89 90 90 91 { } /* Terminating entry */ 91 92 }; ··· 110 109 111 110 /* Atheros AR5BBU22 with sflash firmware */ 112 111 { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, 112 + { USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 }, 113 113 114 114 { } /* Terminating entry */ 115 115 };
+7 -5
drivers/bluetooth/btusb.c
··· 52 52 /* Generic Bluetooth USB device */ 53 53 { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, 54 54 55 + /* Apple-specific (Broadcom) devices */ 56 + { USB_VENDOR_AND_INTERFACE_INFO(0x05ac, 0xff, 0x01, 0x01) }, 57 + 55 58 /* Broadcom SoftSailing reporting vendor specific */ 56 59 { USB_DEVICE(0x0a5c, 0x21e1) }, 57 60 ··· 97 94 98 95 /* Broadcom BCM20702A0 */ 99 96 { USB_DEVICE(0x0489, 0xe042) }, 100 - { USB_DEVICE(0x0a5c, 0x21e3) }, 101 - { USB_DEVICE(0x0a5c, 0x21e6) }, 102 - { USB_DEVICE(0x0a5c, 0x21e8) }, 103 - { USB_DEVICE(0x0a5c, 0x21f3) }, 104 - { USB_DEVICE(0x0a5c, 0x21f4) }, 105 97 { USB_DEVICE(0x413c, 0x8197) }, 106 98 107 99 /* Foxconn - Hon Hai */ 108 100 { USB_DEVICE(0x0489, 0xe033) }, 101 + 102 + /*Broadcom devices with vendor specific id */ 103 + { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) }, 109 104 110 105 { } /* Terminating entry */ 111 106 }; ··· 142 141 143 142 /* Atheros AR5BBU12 with sflash firmware */ 144 143 { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, 144 + { USB_DEVICE(0x0489, 0xe036), .driver_info = BTUSB_ATH3012 }, 145 145 146 146 /* Broadcom BCM2035 */ 147 147 { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
+1
drivers/crypto/caam/key_gen.c
··· 120 120 121 121 return ret; 122 122 } 123 + EXPORT_SYMBOL(gen_split_key);
+12 -7
drivers/extcon/extcon-max77693.c
··· 669 669 } 670 670 info->dev = &pdev->dev; 671 671 info->max77693 = max77693; 672 - info->max77693->regmap_muic = regmap_init_i2c(info->max77693->muic, 673 - &max77693_muic_regmap_config); 674 - if (IS_ERR(info->max77693->regmap_muic)) { 675 - ret = PTR_ERR(info->max77693->regmap_muic); 676 - dev_err(max77693->dev, 677 - "failed to allocate register map: %d\n", ret); 678 - goto err_regmap; 672 + if (info->max77693->regmap_muic) 673 + dev_dbg(&pdev->dev, "allocate register map\n"); 674 + else { 675 + info->max77693->regmap_muic = devm_regmap_init_i2c( 676 + info->max77693->muic, 677 + &max77693_muic_regmap_config); 678 + if (IS_ERR(info->max77693->regmap_muic)) { 679 + ret = PTR_ERR(info->max77693->regmap_muic); 680 + dev_err(max77693->dev, 681 + "failed to allocate register map: %d\n", ret); 682 + goto err_regmap; 683 + } 679 684 } 680 685 platform_set_drvdata(pdev, info); 681 686 mutex_init(&info->mutex);
+3
drivers/gpu/drm/ast/ast_drv.c
··· 193 193 .mmap = ast_mmap, 194 194 .poll = drm_poll, 195 195 .fasync = drm_fasync, 196 + #ifdef CONFIG_COMPAT 197 + .compat_ioctl = drm_compat_ioctl, 198 + #endif 196 199 .read = drm_read, 197 200 }; 198 201
+1 -1
drivers/gpu/drm/ast/ast_mode.c
··· 841 841 842 842 ast->cursor_cache = obj; 843 843 ast->cursor_cache_gpu_addr = gpu_addr; 844 - DRM_ERROR("pinned cursor cache at %llx\n", ast->cursor_cache_gpu_addr); 844 + DRM_DEBUG_KMS("pinned cursor cache at %llx\n", ast->cursor_cache_gpu_addr); 845 845 return 0; 846 846 fail: 847 847 return ret;
+3
drivers/gpu/drm/cirrus/cirrus_drv.c
··· 74 74 .unlocked_ioctl = drm_ioctl, 75 75 .mmap = cirrus_mmap, 76 76 .poll = drm_poll, 77 + #ifdef CONFIG_COMPAT 78 + .compat_ioctl = drm_compat_ioctl, 79 + #endif 77 80 .fasync = drm_fasync, 78 81 }; 79 82 static struct drm_driver driver = {
+1 -1
drivers/gpu/drm/exynos/Kconfig
··· 36 36 37 37 config DRM_EXYNOS_G2D 38 38 bool "Exynos DRM G2D" 39 - depends on DRM_EXYNOS 39 + depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_G2D 40 40 help 41 41 Choose this option if you want to use Exynos G2D for DRM.
+7
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
··· 163 163 /* TODO */ 164 164 } 165 165 166 + static int exynos_gem_dmabuf_mmap(struct dma_buf *dma_buf, 167 + struct vm_area_struct *vma) 168 + { 169 + return -ENOTTY; 170 + } 171 + 166 172 static struct dma_buf_ops exynos_dmabuf_ops = { 167 173 .map_dma_buf = exynos_gem_map_dma_buf, 168 174 .unmap_dma_buf = exynos_gem_unmap_dma_buf, ··· 176 170 .kmap_atomic = exynos_gem_dmabuf_kmap_atomic, 177 171 .kunmap = exynos_gem_dmabuf_kunmap, 178 172 .kunmap_atomic = exynos_gem_dmabuf_kunmap_atomic, 173 + .mmap = exynos_gem_dmabuf_mmap, 179 174 .release = exynos_dmabuf_release, 180 175 }; 181 176
+3 -2
drivers/gpu/drm/exynos/exynos_drm_drv.c
··· 160 160 if (!file_priv) 161 161 return -ENOMEM; 162 162 163 - drm_prime_init_file_private(&file->prime); 164 163 file->driver_priv = file_priv; 165 164 166 165 return exynos_drm_subdrv_open(dev, file); ··· 183 184 e->base.destroy(&e->base); 184 185 } 185 186 } 186 - drm_prime_destroy_file_private(&file->prime); 187 187 spin_unlock_irqrestore(&dev->event_lock, flags); 188 188 189 189 exynos_drm_subdrv_close(dev, file); ··· 239 241 .poll = drm_poll, 240 242 .read = drm_read, 241 243 .unlocked_ioctl = drm_ioctl, 244 + #ifdef CONFIG_COMPAT 245 + .compat_ioctl = drm_compat_ioctl, 246 + #endif 242 247 .release = drm_release, 243 248 }; 244 249
-5
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 831 831 } 832 832 833 833 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 834 - if (!res) { 835 - dev_err(dev, "failed to find registers\n"); 836 - ret = -ENOENT; 837 - goto err_clk; 838 - } 839 834 840 835 ctx->regs = devm_request_and_ioremap(&pdev->dev, res); 841 836 if (!ctx->regs) {
+11 -41
drivers/gpu/drm/exynos/exynos_drm_g2d.c
··· 129 129 struct g2d_data { 130 130 struct device *dev; 131 131 struct clk *gate_clk; 132 - struct resource *regs_res; 133 132 void __iomem *regs; 134 133 int irq; 135 134 struct workqueue_struct *g2d_workq; ··· 750 751 struct exynos_drm_subdrv *subdrv; 751 752 int ret; 752 753 753 - g2d = kzalloc(sizeof(*g2d), GFP_KERNEL); 754 + g2d = devm_kzalloc(&pdev->dev, sizeof(*g2d), GFP_KERNEL); 754 755 if (!g2d) { 755 756 dev_err(dev, "failed to allocate driver data\n"); 756 757 return -ENOMEM; ··· 758 759 759 760 g2d->runqueue_slab = kmem_cache_create("g2d_runqueue_slab", 760 761 sizeof(struct g2d_runqueue_node), 0, 0, NULL); 761 - if (!g2d->runqueue_slab) { 762 - ret = -ENOMEM; 763 - goto err_free_mem; 764 - } 762 + if (!g2d->runqueue_slab) 763 + return -ENOMEM; 765 764 766 765 g2d->dev = dev; 767 766 ··· 791 794 pm_runtime_enable(dev); 792 795 793 796 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 794 - if (!res) { 795 - dev_err(dev, "failed to get I/O memory\n"); 796 - ret = -ENOENT; 797 - goto err_put_clk; 798 - } 799 797 800 - g2d->regs_res = request_mem_region(res->start, resource_size(res), 801 - dev_name(dev)); 802 - if (!g2d->regs_res) { 803 - dev_err(dev, "failed to request I/O memory\n"); 804 - ret = -ENOENT; 805 - goto err_put_clk; 806 - } 807 - 808 - g2d->regs = ioremap(res->start, resource_size(res)); 798 + g2d->regs = devm_request_and_ioremap(&pdev->dev, res); 809 799 if (!g2d->regs) { 810 800 dev_err(dev, "failed to remap I/O memory\n"); 811 801 ret = -ENXIO; 812 - goto err_release_res; 802 + goto err_put_clk; 813 803 } 814 804 815 805 g2d->irq = platform_get_irq(pdev, 0); 816 806 if (g2d->irq < 0) { 817 807 dev_err(dev, "failed to get irq\n"); 818 808 ret = g2d->irq; 819 - goto err_unmap_base; 809 + goto err_put_clk; 820 810 } 821 811 822 - ret = request_irq(g2d->irq, g2d_irq_handler, 0, "drm_g2d", g2d); 812 + ret = devm_request_irq(&pdev->dev, g2d->irq, g2d_irq_handler, 0, 813 + "drm_g2d", g2d); 823 814 if (ret < 0) { 824 815 dev_err(dev, "irq request failed\n"); 825 - goto err_unmap_base; 816 + goto err_put_clk; 826 817 } 827 818 828 819 platform_set_drvdata(pdev, g2d); ··· 823 838 ret = exynos_drm_subdrv_register(subdrv); 824 839 if (ret < 0) { 825 840 dev_err(dev, "failed to register drm g2d device\n"); 826 - goto err_free_irq; 841 + goto err_put_clk; 827 842 } 828 843 829 844 dev_info(dev, "The exynos g2d(ver %d.%d) successfully probed\n", ··· 831 846 832 847 return 0; 833 848 834 - err_free_irq: 835 - free_irq(g2d->irq, g2d); 836 - err_unmap_base: 837 - iounmap(g2d->regs); 838 - err_release_res: 839 - release_resource(g2d->regs_res); 840 - kfree(g2d->regs_res); 841 849 err_put_clk: 842 850 pm_runtime_disable(dev); 843 851 clk_put(g2d->gate_clk); ··· 840 862 destroy_workqueue(g2d->g2d_workq); 841 863 err_destroy_slab: 842 864 kmem_cache_destroy(g2d->runqueue_slab); 843 - err_free_mem: 844 - kfree(g2d); 845 865 return ret; 846 866 } 847 867 ··· 849 873 850 874 cancel_work_sync(&g2d->runqueue_work); 851 875 exynos_drm_subdrv_unregister(&g2d->subdrv); 852 - free_irq(g2d->irq, g2d); 853 876 854 877 while (g2d->runqueue_node) { 855 878 g2d_free_runqueue_node(g2d, g2d->runqueue_node); 856 879 g2d->runqueue_node = g2d_get_runqueue_node(g2d); 857 880 } 858 - 859 - iounmap(g2d->regs); 860 - release_resource(g2d->regs_res); 861 - kfree(g2d->regs_res); 862 881 863 882 pm_runtime_disable(&pdev->dev); 864 883 clk_put(g2d->gate_clk); ··· 861 890 g2d_fini_cmdlist(g2d); 862 891 destroy_workqueue(g2d->g2d_workq); 863 892 kmem_cache_destroy(g2d->runqueue_slab); 864 - kfree(g2d); 865 893 866 894 return 0; 867 895 } ··· 894 924 } 895 925 #endif 896 926 897 - SIMPLE_DEV_PM_OPS(g2d_pm_ops, g2d_suspend, g2d_resume); 927 + static SIMPLE_DEV_PM_OPS(g2d_pm_ops, g2d_suspend, g2d_resume); 898 928 899 929 struct platform_driver g2d_driver = { 900 930 .probe = g2d_probe,
+2 -2
drivers/gpu/drm/exynos/exynos_drm_gem.c
··· 122 122 __free_page(pages[i]); 123 123 124 124 drm_free_large(pages); 125 - return ERR_PTR(PTR_ERR(p)); 125 + return ERR_CAST(p); 126 126 } 127 127 128 128 static void exynos_gem_put_pages(struct drm_gem_object *obj, ··· 662 662 */ 663 663 664 664 args->pitch = args->width * ((args->bpp + 7) / 8); 665 - args->size = PAGE_ALIGN(args->pitch * args->height); 665 + args->size = args->pitch * args->height; 666 666 667 667 exynos_gem_obj = exynos_drm_gem_create(dev, args->flags, args->size); 668 668 if (IS_ERR(exynos_gem_obj))
+1 -2
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
··· 345 345 346 346 DRM_DEBUG_KMS("%s\n", __FILE__); 347 347 348 - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 348 + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 349 349 if (!ctx) { 350 350 DRM_LOG_KMS("failed to alloc common hdmi context.\n"); 351 351 return -ENOMEM; ··· 371 371 DRM_DEBUG_KMS("%s\n", __FILE__); 372 372 373 373 exynos_drm_subdrv_unregister(&ctx->subdrv); 374 - kfree(ctx); 375 374 376 375 return 0; 377 376 }
-1
drivers/gpu/drm/exynos/exynos_drm_plane.c
··· 29 29 DRM_FORMAT_XRGB8888, 30 30 DRM_FORMAT_ARGB8888, 31 31 DRM_FORMAT_NV12, 32 - DRM_FORMAT_NV12M, 33 32 DRM_FORMAT_NV12MT, 34 33 }; 35 34
+1 -3
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 633 633 634 634 DRM_DEBUG_KMS("%s\n", __FILE__); 635 635 636 - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 636 + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 637 637 if (!ctx) 638 638 return -ENOMEM; 639 639 ··· 672 672 kfree(ctx->raw_edid); 673 673 ctx->raw_edid = NULL; 674 674 } 675 - 676 - kfree(ctx); 677 675 678 676 return 0; 679 677 }
+3 -8
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 2172 2172 2173 2173 DRM_DEBUG_KMS("HDMI resource init\n"); 2174 2174 2175 - memset(res, 0, sizeof *res); 2175 + memset(res, 0, sizeof(*res)); 2176 2176 2177 2177 /* get clocks, power */ 2178 2178 res->hdmi = clk_get(dev, "hdmi"); ··· 2204 2204 clk_set_parent(res->sclk_hdmi, res->sclk_pixel); 2205 2205 2206 2206 res->regul_bulk = kzalloc(ARRAY_SIZE(supply) * 2207 - sizeof res->regul_bulk[0], GFP_KERNEL); 2207 + sizeof(res->regul_bulk[0]), GFP_KERNEL); 2208 2208 if (!res->regul_bulk) { 2209 2209 DRM_ERROR("failed to get memory for regulators\n"); 2210 2210 goto fail; ··· 2243 2243 clk_put(res->sclk_hdmi); 2244 2244 if (!IS_ERR_OR_NULL(res->hdmi)) 2245 2245 clk_put(res->hdmi); 2246 - memset(res, 0, sizeof *res); 2246 + memset(res, 0, sizeof(*res)); 2247 2247 2248 2248 return 0; 2249 2249 } ··· 2312 2312 } 2313 2313 2314 2314 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2315 - if (!res) { 2316 - DRM_ERROR("failed to find registers\n"); 2317 - ret = -ENOENT; 2318 - goto err_resource; 2319 - } 2320 2315 2321 2316 hdata->regs = devm_request_and_ioremap(&pdev->dev, res); 2322 2317 if (!hdata->regs) {
+3 -3
drivers/gpu/drm/exynos/exynos_mixer.c
··· 236 236 static void vp_default_filter(struct mixer_resources *res) 237 237 { 238 238 vp_filter_set(res, VP_POLY8_Y0_LL, 239 - filter_y_horiz_tap8, sizeof filter_y_horiz_tap8); 239 + filter_y_horiz_tap8, sizeof(filter_y_horiz_tap8)); 240 240 vp_filter_set(res, VP_POLY4_Y0_LL, 241 - filter_y_vert_tap4, sizeof filter_y_vert_tap4); 241 + filter_y_vert_tap4, sizeof(filter_y_vert_tap4)); 242 242 vp_filter_set(res, VP_POLY4_C0_LL, 243 - filter_cr_horiz_tap4, sizeof filter_cr_horiz_tap4); 243 + filter_cr_horiz_tap4, sizeof(filter_cr_horiz_tap4)); 244 244 } 245 245 246 246 static void mixer_vsync_set_update(struct mixer_context *ctx, bool enable)
+2
drivers/gpu/drm/gma500/oaktrail_device.c
··· 476 476 .pos = DSPAPOS, 477 477 .surf = DSPASURF, 478 478 .addr = MRST_DSPABASE, 479 + .base = MRST_DSPABASE, 479 480 .status = PIPEASTAT, 480 481 .linoff = DSPALINOFF, 481 482 .tileoff = DSPATILEOFF, ··· 500 499 .pos = DSPBPOS, 501 500 .surf = DSPBSURF, 502 501 .addr = DSPBBASE, 502 + .base = DSPBBASE, 503 503 .status = PIPEBSTAT, 504 504 .linoff = DSPBLINOFF, 505 505 .tileoff = DSPBTILEOFF,
+3
drivers/gpu/drm/i810/i810_dma.c
··· 115 115 .unlocked_ioctl = drm_ioctl, 116 116 .mmap = i810_mmap_buffers, 117 117 .fasync = drm_fasync, 118 + #ifdef CONFIG_COMPAT 119 + .compat_ioctl = drm_compat_ioctl, 120 + #endif 118 121 .llseek = noop_llseek, 119 122 }; 120 123
+3
drivers/gpu/drm/i810/i810_drv.c
··· 51 51 .mmap = drm_mmap, 52 52 .poll = drm_poll, 53 53 .fasync = drm_fasync, 54 + #ifdef CONFIG_COMPAT 55 + .compat_ioctl = drm_compat_ioctl, 56 + #endif 54 57 .llseek = noop_llseek, 55 58 }; 56 59
+1
drivers/gpu/drm/i915/i915_dma.c
··· 1587 1587 spin_lock_init(&dev_priv->irq_lock); 1588 1588 spin_lock_init(&dev_priv->error_lock); 1589 1589 spin_lock_init(&dev_priv->rps_lock); 1590 + spin_lock_init(&dev_priv->dpio_lock); 1590 1591 1591 1592 if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) 1592 1593 dev_priv->num_pipe = 3;
-3
drivers/gpu/drm/i915/i915_irq.c
··· 2700 2700 dev->driver->irq_handler = i8xx_irq_handler; 2701 2701 dev->driver->irq_uninstall = i8xx_irq_uninstall; 2702 2702 } else if (INTEL_INFO(dev)->gen == 3) { 2703 - /* IIR "flip pending" means done if this bit is set */ 2704 - I915_WRITE(ECOSKPD, _MASKED_BIT_DISABLE(ECO_FLIP_DONE)); 2705 - 2706 2703 dev->driver->irq_preinstall = i915_irq_preinstall; 2707 2704 dev->driver->irq_postinstall = i915_irq_postinstall; 2708 2705 dev->driver->irq_uninstall = i915_irq_uninstall;
+4 -2
drivers/gpu/drm/i915/intel_display.c
··· 1376 1376 "PCH DP (0x%08x) enabled on transcoder %c, should be disabled\n", 1377 1377 reg, pipe_name(pipe)); 1378 1378 1379 - WARN(HAS_PCH_IBX(dev_priv->dev) && (val & SDVO_PIPE_B_SELECT), 1379 + WARN(HAS_PCH_IBX(dev_priv->dev) && (val & DP_PORT_EN) == 0 1380 + && (val & DP_PIPEB_SELECT), 1380 1381 "IBX PCH dp port still using transcoder B\n"); 1381 1382 } 1382 1383 ··· 1389 1388 "PCH HDMI (0x%08x) enabled on transcoder %c, should be disabled\n", 1390 1389 reg, pipe_name(pipe)); 1391 1390 1392 - WARN(HAS_PCH_IBX(dev_priv->dev) && (val & SDVO_PIPE_B_SELECT), 1391 + WARN(HAS_PCH_IBX(dev_priv->dev) && (val & PORT_ENABLE) == 0 1392 + && (val & SDVO_PIPE_B_SELECT), 1393 1393 "IBX PCH hdmi port still using transcoder B\n"); 1394 1394 } 1395 1395
+7 -4
drivers/gpu/drm/i915/intel_dp.c
··· 2533 2533 break; 2534 2534 } 2535 2535 2536 - intel_dp_i2c_init(intel_dp, intel_connector, name); 2537 - 2538 2536 /* Cache some DPCD data in the eDP case */ 2539 2537 if (is_edp(intel_dp)) { 2540 - bool ret; 2541 2538 struct edp_power_seq cur, vbt; 2542 2539 u32 pp_on, pp_off, pp_div; 2543 - struct edid *edid; 2544 2540 2545 2541 pp_on = I915_READ(PCH_PP_ON_DELAYS); 2546 2542 pp_off = I915_READ(PCH_PP_OFF_DELAYS); ··· 2587 2591 2588 2592 DRM_DEBUG_KMS("backlight on delay %d, off delay %d\n", 2589 2593 intel_dp->backlight_on_delay, intel_dp->backlight_off_delay); 2594 + } 2595 + 2596 + intel_dp_i2c_init(intel_dp, intel_connector, name); 2597 + 2598 + if (is_edp(intel_dp)) { 2599 + bool ret; 2600 + struct edid *edid; 2590 2601 2591 2602 ironlake_edp_panel_vdd_on(intel_dp); 2592 2603 ret = intel_dp_get_dpcd(intel_dp);
+22 -9
drivers/gpu/drm/i915/intel_panel.c
··· 162 162 return val; 163 163 } 164 164 165 - u32 intel_panel_get_max_backlight(struct drm_device *dev) 165 + static u32 _intel_panel_get_max_backlight(struct drm_device *dev) 166 166 { 167 167 struct drm_i915_private *dev_priv = dev->dev_private; 168 168 u32 max; 169 169 170 170 max = i915_read_blc_pwm_ctl(dev_priv); 171 - if (max == 0) { 172 - /* XXX add code here to query mode clock or hardware clock 173 - * and program max PWM appropriately. 174 - */ 175 - pr_warn_once("fixme: max PWM is zero\n"); 176 - return 1; 177 - } 178 171 179 172 if (HAS_PCH_SPLIT(dev)) { 180 173 max >>= 16; ··· 179 186 180 187 if (is_backlight_combination_mode(dev)) 181 188 max *= 0xff; 189 + } 190 + 191 + return max; 192 + } 193 + 194 + u32 intel_panel_get_max_backlight(struct drm_device *dev) 195 + { 196 + u32 max; 197 + 198 + max = _intel_panel_get_max_backlight(dev); 199 + if (max == 0) { 200 + /* XXX add code here to query mode clock or hardware clock 201 + * and program max PWM appropriately. 202 + */ 203 + pr_warn_once("fixme: max PWM is zero\n"); 204 + return 1; 182 205 } 183 206 184 207 DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max); ··· 433 424 434 425 memset(&props, 0, sizeof(props)); 435 426 props.type = BACKLIGHT_RAW; 436 - props.max_brightness = intel_panel_get_max_backlight(dev); 427 + props.max_brightness = _intel_panel_get_max_backlight(dev); 428 + if (props.max_brightness == 0) { 429 + DRM_ERROR("Failed to get maximum backlight value\n"); 430 + return -ENODEV; 431 + } 437 432 dev_priv->backlight = 438 433 backlight_device_register("intel_backlight", 439 434 &connector->kdev, dev,
+3
drivers/gpu/drm/i915/intel_pm.c
··· 3672 3672 3673 3673 if (IS_PINEVIEW(dev)) 3674 3674 I915_WRITE(ECOSKPD, _MASKED_BIT_ENABLE(ECO_GATING_CX_ONLY)); 3675 + 3676 + /* IIR "flip pending" means done if this bit is set */ 3677 + I915_WRITE(ECOSKPD, _MASKED_BIT_DISABLE(ECO_FLIP_DONE)); 3675 3678 } 3676 3679 3677 3680 static void i85x_init_clock_gating(struct drm_device *dev)
+6 -9
drivers/gpu/drm/i915/intel_sdvo.c
··· 2573 2573 hotplug_mask = intel_sdvo->is_sdvob ? 2574 2574 SDVOB_HOTPLUG_INT_STATUS_I915 : SDVOC_HOTPLUG_INT_STATUS_I915; 2575 2575 } 2576 - dev_priv->hotplug_supported_mask |= hotplug_mask; 2577 2576 2578 2577 drm_encoder_helper_add(&intel_encoder->base, &intel_sdvo_helper_funcs); 2579 2578 ··· 2580 2581 if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) 2581 2582 goto err; 2582 2583 2583 - /* Set up hotplug command - note paranoia about contents of reply. 2584 - * We assume that the hardware is in a sane state, and only touch 2585 - * the bits we think we understand. 2586 - */ 2587 - intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, 2588 - &intel_sdvo->hotplug_active, 2); 2589 - intel_sdvo->hotplug_active[0] &= ~0x3; 2590 - 2591 2584 if (intel_sdvo_output_setup(intel_sdvo, 2592 2585 intel_sdvo->caps.output_flags) != true) { 2593 2586 DRM_DEBUG_KMS("SDVO output failed to setup on %s\n", 2594 2587 SDVO_NAME(intel_sdvo)); 2595 2588 goto err; 2596 2589 } 2590 + 2591 + /* Only enable the hotplug irq if we need it, to work around noisy 2592 + * hotplug lines. 2593 + */ 2594 + if (intel_sdvo->hotplug_active[0]) 2595 + dev_priv->hotplug_supported_mask |= hotplug_mask; 2597 2596 2598 2597 intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo, sdvo_reg); 2599 2598
+3
drivers/gpu/drm/mgag200/mgag200_drv.c
··· 84 84 .mmap = mgag200_mmap, 85 85 .poll = drm_poll, 86 86 .fasync = drm_fasync, 87 + #ifdef CONFIG_COMPAT 88 + .compat_ioctl = drm_compat_ioctl, 89 + #endif 87 90 .read = drm_read, 88 91 }; 89 92
+1 -1
drivers/gpu/drm/nouveau/nouveau_display.c
··· 598 598 args->size = args->pitch * args->height; 599 599 args->size = roundup(args->size, PAGE_SIZE); 600 600 601 - ret = nouveau_gem_new(dev, args->size, 0, TTM_PL_FLAG_VRAM, 0, 0, &bo); 601 + ret = nouveau_gem_new(dev, args->size, 0, NOUVEAU_GEM_DOMAIN_VRAM, 0, 0, &bo); 602 602 if (ret) 603 603 return ret; 604 604
+3
drivers/gpu/drm/nouveau/nv50_gpio.c
··· 115 115 { 116 116 struct drm_nouveau_private *dev_priv = dev->dev_private; 117 117 118 + /* initialise gpios and routing to vbios defaults */ 119 + nouveau_gpio_reset(dev); 120 + 118 121 /* disable, and ack any pending gpio interrupts */ 119 122 nv_wr32(dev, 0xe050, 0x00000000); 120 123 nv_wr32(dev, 0xe054, 0xffffffff);
+2 -2
drivers/gpu/drm/nouveau/nvd0_display.c
··· 1510 1510 case OUTPUT_DP: 1511 1511 if (nv_connector->base.display_info.bpc == 6) { 1512 1512 nv_encoder->dp.datarate = mode->clock * 18 / 8; 1513 - syncs |= 0x00000140; 1513 + syncs |= 0x00000002 << 6; 1514 1514 } else { 1515 1515 nv_encoder->dp.datarate = mode->clock * 24 / 8; 1516 - syncs |= 0x00000180; 1516 + syncs |= 0x00000005 << 6; 1517 1517 } 1518 1518 1519 1519 if (nv_encoder->dcb->sorconf.link & 1)
+129 -34
drivers/gpu/drm/radeon/atombios_crtc.c
··· 1479 1479 } 1480 1480 } 1481 1481 1482 + /** 1483 + * radeon_get_pll_use_mask - look up a mask of which pplls are in use 1484 + * 1485 + * @crtc: drm crtc 1486 + * 1487 + * Returns the mask of which PPLLs (Pixel PLLs) are in use. 1488 + */ 1489 + static u32 radeon_get_pll_use_mask(struct drm_crtc *crtc) 1490 + { 1491 + struct drm_device *dev = crtc->dev; 1492 + struct drm_crtc *test_crtc; 1493 + struct radeon_crtc *radeon_test_crtc; 1494 + u32 pll_in_use = 0; 1495 + 1496 + list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { 1497 + if (crtc == test_crtc) 1498 + continue; 1499 + 1500 + radeon_test_crtc = to_radeon_crtc(test_crtc); 1501 + if (radeon_test_crtc->pll_id != ATOM_PPLL_INVALID) 1502 + pll_in_use |= (1 << radeon_test_crtc->pll_id); 1503 + } 1504 + return pll_in_use; 1505 + } 1506 + 1507 + /** 1508 + * radeon_get_shared_dp_ppll - return the PPLL used by another crtc for DP 1509 + * 1510 + * @crtc: drm crtc 1511 + * 1512 + * Returns the PPLL (Pixel PLL) used by another crtc/encoder which is 1513 + * also in DP mode. For DP, a single PPLL can be used for all DP 1514 + * crtcs/encoders. 1515 + */ 1516 + static int radeon_get_shared_dp_ppll(struct drm_crtc *crtc) 1517 + { 1518 + struct drm_device *dev = crtc->dev; 1519 + struct drm_encoder *test_encoder; 1520 + struct radeon_crtc *radeon_test_crtc; 1521 + 1522 + list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { 1523 + if (test_encoder->crtc && (test_encoder->crtc != crtc)) { 1524 + if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { 1525 + /* for DP use the same PLL for all */ 1526 + radeon_test_crtc = to_radeon_crtc(test_encoder->crtc); 1527 + if (radeon_test_crtc->pll_id != ATOM_PPLL_INVALID) 1528 + return radeon_test_crtc->pll_id; 1529 + } 1530 + } 1531 + } 1532 + return ATOM_PPLL_INVALID; 1533 + } 1534 + 1535 + /** 1536 + * radeon_atom_pick_pll - Allocate a PPLL for use by the crtc. 1537 + * 1538 + * @crtc: drm crtc 1539 + * 1540 + * Returns the PPLL (Pixel PLL) to be used by the crtc. For DP monitors 1541 + * a single PPLL can be used for all DP crtcs/encoders. For non-DP 1542 + * monitors a dedicated PPLL must be used. If a particular board has 1543 + * an external DP PLL, return ATOM_PPLL_INVALID to skip PLL programming 1544 + * as there is no need to program the PLL itself. If we are not able to 1545 + * allocate a PLL, return ATOM_PPLL_INVALID to skip PLL programming to 1546 + * avoid messing up an existing monitor. 1547 + * 1548 + * Asic specific PLL information 1549 + * 1550 + * DCE 6.1 1551 + * - PPLL2 is only available to UNIPHYA (both DP and non-DP) 1552 + * - PPLL0, PPLL1 are available for UNIPHYB/C/D/E/F (both DP and non-DP) 1553 + * 1554 + * DCE 6.0 1555 + * - PPLL0 is available to all UNIPHY (DP only) 1556 + * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC 1557 + * 1558 + * DCE 5.0 1559 + * - DCPLL is available to all UNIPHY (DP only) 1560 + * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC 1561 + * 1562 + * DCE 3.0/4.0/4.1 1563 + * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC 1564 + * 1565 + */ 1482 1566 static int radeon_atom_pick_pll(struct drm_crtc *crtc) 1483 1567 { 1484 1568 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 1485 1569 struct drm_device *dev = crtc->dev; 1486 1570 struct radeon_device *rdev = dev->dev_private; 1487 1571 struct drm_encoder *test_encoder; 1488 - struct drm_crtc *test_crtc; 1489 - uint32_t pll_in_use = 0; 1572 + u32 pll_in_use; 1573 + int pll; 1490 1574 1491 1575 if (ASIC_IS_DCE61(rdev)) { 1492 1576 list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { ··· 1582 1498 1583 1499 if ((test_radeon_encoder->encoder_id == 1584 1500 ENCODER_OBJECT_ID_INTERNAL_UNIPHY) && 1585 - (dig->linkb == false)) /* UNIPHY A uses PPLL2 */ 1501 + (dig->linkb == false)) 1502 + /* UNIPHY A uses PPLL2 */ 1586 1503 return ATOM_PPLL2; 1504 + else if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { 1505 + /* UNIPHY B/C/D/E/F */ 1506 + if (rdev->clock.dp_extclk) 1507 + /* skip PPLL programming if using ext clock */ 1508 + return ATOM_PPLL_INVALID; 1509 + else { 1510 + /* use the same PPLL for all DP monitors */ 1511 + pll = radeon_get_shared_dp_ppll(crtc); 1512 + if (pll != ATOM_PPLL_INVALID) 1513 + return pll; 1514 + } 1515 + } 1516 + break; 1587 1517 } 1588 1518 } 1589 1519 /* UNIPHY B/C/D/E/F */ 1590 - list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { 1591 - struct radeon_crtc *radeon_test_crtc; 1592 - 1593 - if (crtc == test_crtc) 1594 - continue; 1595 - 1596 - radeon_test_crtc = to_radeon_crtc(test_crtc); 1597 - if ((radeon_test_crtc->pll_id == ATOM_PPLL0) || 1598 - (radeon_test_crtc->pll_id == ATOM_PPLL1)) 1599 - pll_in_use |= (1 << radeon_test_crtc->pll_id); 1600 - } 1601 - if (!(pll_in_use & 4)) 1520 + pll_in_use = radeon_get_pll_use_mask(crtc); 1521 + if (!(pll_in_use & (1 << ATOM_PPLL0))) 1602 1522 return ATOM_PPLL0; 1603 - return ATOM_PPLL1; 1523 + if (!(pll_in_use & (1 << ATOM_PPLL1))) 1524 + return ATOM_PPLL1; 1525 + DRM_ERROR("unable to allocate a PPLL\n"); 1526 + return ATOM_PPLL_INVALID; 1604 1527 } else if (ASIC_IS_DCE4(rdev)) { 1605 1528 list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { 1606 1529 if (test_encoder->crtc && (test_encoder->crtc == crtc)) { 1607 1530 /* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock, 1608 1531 * depending on the asic: 1609 1532 * DCE4: PPLL or ext clock 1610 - * DCE5: DCPLL or ext clock 1533 + * DCE5: PPLL, DCPLL, or ext clock 1534 + * DCE6: PPLL, PPLL0, or ext clock 1611 1535 * 1612 1536 * Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip 1613 1537 * PPLL/DCPLL programming and only program the DP DTO for the ··· 1623 1531 */ 1624 1532 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { 1625 1533 if (rdev->clock.dp_extclk) 1534 + /* skip PPLL programming if using ext clock */ 1626 1535 return ATOM_PPLL_INVALID; 1627 1536 else if (ASIC_IS_DCE6(rdev)) 1537 + /* use PPLL0 for all DP */ 1628 1538 return ATOM_PPLL0; 1629 1539 else if (ASIC_IS_DCE5(rdev)) 1540 + /* use DCPLL for all DP */ 1630 1541 return ATOM_DCPLL; 1542 + else { 1543 + /* use the same PPLL for all DP monitors */ 1544 + pll = radeon_get_shared_dp_ppll(crtc); 1545 + if (pll != ATOM_PPLL_INVALID) 1546 + return pll; 1547 + } 1631 1548 } 1549 + break; 1632 1550 } 1633 1551 } 1634 - 1635 - /* otherwise, pick one of the plls */ 1636 - list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { 1637 - struct radeon_crtc *radeon_test_crtc; 1638 - 1639 - if (crtc == test_crtc) 1640 - continue; 1641 - 1642 - radeon_test_crtc = to_radeon_crtc(test_crtc); 1643 - if ((radeon_test_crtc->pll_id >= ATOM_PPLL1) && 1644 - (radeon_test_crtc->pll_id <= ATOM_PPLL2)) 1645 - pll_in_use |= (1 << radeon_test_crtc->pll_id); 1646 - } 1647 - if (!(pll_in_use & 1)) 1552 + /* all other cases */ 1553 + pll_in_use = radeon_get_pll_use_mask(crtc); 1554 + if (!(pll_in_use & (1 << ATOM_PPLL2))) 1555 + return ATOM_PPLL2; 1556 + if (!(pll_in_use & (1 << ATOM_PPLL1))) 1648 1557 return ATOM_PPLL1; 1649 - return ATOM_PPLL2; 1558 + DRM_ERROR("unable to allocate a PPLL\n"); 1559 + return ATOM_PPLL_INVALID; 1650 1560 } else 1561 + /* use PPLL1 or PPLL2 */ 1651 1562 return radeon_crtc->crtc_id; 1652 1563 1653 1564 } ··· 1792 1697 break; 1793 1698 } 1794 1699 done: 1795 - radeon_crtc->pll_id = -1; 1700 + radeon_crtc->pll_id = ATOM_PPLL_INVALID; 1796 1701 } 1797 1702 1798 1703 static const struct drm_crtc_helper_funcs atombios_helper_funcs = { ··· 1841 1746 else 1842 1747 radeon_crtc->crtc_offset = 0; 1843 1748 } 1844 - radeon_crtc->pll_id = -1; 1749 + radeon_crtc->pll_id = ATOM_PPLL_INVALID; 1845 1750 drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs); 1846 1751 }
+5 -3
drivers/gpu/drm/radeon/radeon_fence.c
··· 131 131 */ 132 132 void radeon_fence_process(struct radeon_device *rdev, int ring) 133 133 { 134 - uint64_t seq, last_seq; 134 + uint64_t seq, last_seq, last_emitted; 135 135 unsigned count_loop = 0; 136 136 bool wake = false; 137 137 ··· 158 158 */ 159 159 last_seq = atomic64_read(&rdev->fence_drv[ring].last_seq); 160 160 do { 161 + last_emitted = rdev->fence_drv[ring].sync_seq[ring]; 161 162 seq = radeon_fence_read(rdev, ring); 162 163 seq |= last_seq & 0xffffffff00000000LL; 163 164 if (seq < last_seq) { 164 - seq += 0x100000000LL; 165 + seq &= 0xffffffff; 166 + seq |= last_emitted & 0xffffffff00000000LL; 165 167 } 166 168 167 - if (seq == last_seq) { 169 + if (seq <= last_seq || seq > last_emitted) { 168 170 break; 169 171 } 170 172 /* If we loop over we don't want to return without
+3
drivers/gpu/drm/savage/savage_drv.c
··· 43 43 .mmap = drm_mmap, 44 44 .poll = drm_poll, 45 45 .fasync = drm_fasync, 46 + #ifdef CONFIG_COMPAT 47 + .compat_ioctl = drm_compat_ioctl, 48 + #endif 46 49 .llseek = noop_llseek, 47 50 }; 48 51
+3
drivers/gpu/drm/sis/sis_drv.c
··· 74 74 .mmap = drm_mmap, 75 75 .poll = drm_poll, 76 76 .fasync = drm_fasync, 77 + #ifdef CONFIG_COMPAT 78 + .compat_ioctl = drm_compat_ioctl, 79 + #endif 77 80 .llseek = noop_llseek, 78 81 }; 79 82
+3
drivers/gpu/drm/tdfx/tdfx_drv.c
··· 49 49 .mmap = drm_mmap, 50 50 .poll = drm_poll, 51 51 .fasync = drm_fasync, 52 + #ifdef CONFIG_COMPAT 53 + .compat_ioctl = drm_compat_ioctl, 54 + #endif 52 55 .llseek = noop_llseek, 53 56 }; 54 57
+3
drivers/gpu/drm/udl/udl_drv.c
··· 66 66 .unlocked_ioctl = drm_ioctl, 67 67 .release = drm_release, 68 68 .fasync = drm_fasync, 69 + #ifdef CONFIG_COMPAT 70 + .compat_ioctl = drm_compat_ioctl, 71 + #endif 69 72 .llseek = noop_llseek, 70 73 }; 71 74
+3
drivers/gpu/drm/via/via_drv.c
··· 65 65 .mmap = drm_mmap, 66 66 .poll = drm_poll, 67 67 .fasync = drm_fasync, 68 + #ifdef CONFIG_COMPAT 69 + .compat_ioctl = drm_compat_ioctl, 70 + #endif 68 71 .llseek = noop_llseek, 69 72 }; 70 73
+8
drivers/gpu/drm/vmwgfx/Kconfig
··· 12 12 This is a KMS enabled DRM driver for the VMware SVGA2 13 13 virtual hardware. 14 14 The compiled module will be called "vmwgfx.ko". 15 + 16 + config DRM_VMWGFX_FBCON 17 + depends on DRM_VMWGFX 18 + bool "Enable framebuffer console under vmwgfx by default" 19 + help 20 + Choose this option if you are shipping a new vmwgfx 21 + userspace driver that supports using the kernel driver. 22 +
+7 -1
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
··· 182 182 {0x15ad, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VMWGFX_CHIP_SVGAII}, 183 183 {0, 0, 0} 184 184 }; 185 + MODULE_DEVICE_TABLE(pci, vmw_pci_id_list); 185 186 186 - static int enable_fbdev; 187 + static int enable_fbdev = IS_ENABLED(CONFIG_DRM_VMWGFX_FBCON); 187 188 188 189 static int vmw_probe(struct pci_dev *, const struct pci_device_id *); 189 190 static void vmw_master_init(struct vmw_master *); ··· 1155 1154 .open = vmw_driver_open, 1156 1155 .preclose = vmw_preclose, 1157 1156 .postclose = vmw_postclose, 1157 + 1158 + .dumb_create = vmw_dumb_create, 1159 + .dumb_map_offset = vmw_dumb_map_offset, 1160 + .dumb_destroy = vmw_dumb_destroy, 1161 + 1158 1162 .fops = &vmwgfx_driver_fops, 1159 1163 .name = VMWGFX_DRIVER_NAME, 1160 1164 .desc = VMWGFX_DRIVER_DESC,
+10
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
··· 645 645 int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, 646 646 struct drm_file *file_priv); 647 647 648 + int vmw_dumb_create(struct drm_file *file_priv, 649 + struct drm_device *dev, 650 + struct drm_mode_create_dumb *args); 651 + 652 + int vmw_dumb_map_offset(struct drm_file *file_priv, 653 + struct drm_device *dev, uint32_t handle, 654 + uint64_t *offset); 655 + int vmw_dumb_destroy(struct drm_file *file_priv, 656 + struct drm_device *dev, 657 + uint32_t handle); 648 658 /** 649 659 * Overlay control - vmwgfx_overlay.c 650 660 */
+73
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
··· 1917 1917 vmw_resource_unreference(&res); 1918 1918 return ret; 1919 1919 } 1920 + 1921 + 1922 + int vmw_dumb_create(struct drm_file *file_priv, 1923 + struct drm_device *dev, 1924 + struct drm_mode_create_dumb *args) 1925 + { 1926 + struct vmw_private *dev_priv = vmw_priv(dev); 1927 + struct vmw_master *vmaster = vmw_master(file_priv->master); 1928 + struct vmw_user_dma_buffer *vmw_user_bo; 1929 + struct ttm_buffer_object *tmp; 1930 + int ret; 1931 + 1932 + args->pitch = args->width * ((args->bpp + 7) / 8); 1933 + args->size = args->pitch * args->height; 1934 + 1935 + vmw_user_bo = kzalloc(sizeof(*vmw_user_bo), GFP_KERNEL); 1936 + if (vmw_user_bo == NULL) 1937 + return -ENOMEM; 1938 + 1939 + ret = ttm_read_lock(&vmaster->lock, true); 1940 + if (ret != 0) { 1941 + kfree(vmw_user_bo); 1942 + return ret; 1943 + } 1944 + 1945 + ret = vmw_dmabuf_init(dev_priv, &vmw_user_bo->dma, args->size, 1946 + &vmw_vram_sys_placement, true, 1947 + &vmw_user_dmabuf_destroy); 1948 + if (ret != 0) 1949 + goto out_no_dmabuf; 1950 + 1951 + tmp = ttm_bo_reference(&vmw_user_bo->dma.base); 1952 + ret = ttm_base_object_init(vmw_fpriv(file_priv)->tfile, 1953 + &vmw_user_bo->base, 1954 + false, 1955 + ttm_buffer_type, 1956 + &vmw_user_dmabuf_release, NULL); 1957 + if (unlikely(ret != 0)) 1958 + goto out_no_base_object; 1959 + 1960 + args->handle = vmw_user_bo->base.hash.key; 1961 + 1962 + out_no_base_object: 1963 + ttm_bo_unref(&tmp); 1964 + out_no_dmabuf: 1965 + ttm_read_unlock(&vmaster->lock); 1966 + return ret; 1967 + } 1968 + 1969 + int vmw_dumb_map_offset(struct drm_file *file_priv, 1970 + struct drm_device *dev, uint32_t handle, 1971 + uint64_t *offset) 1972 + { 1973 + struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile; 1974 + struct vmw_dma_buffer *out_buf; 1975 + int ret; 1976 + 1977 + ret = vmw_user_dmabuf_lookup(tfile, handle, &out_buf); 1978 + if (ret != 0) 1979 + return -EINVAL; 1980 + 1981 + *offset = out_buf->base.addr_space_offset; 1982 + vmw_dmabuf_unreference(&out_buf); 1983 + return 0; 1984 + } 1985 + 1986 + int vmw_dumb_destroy(struct drm_file *file_priv, 1987 + struct drm_device *dev, 1988 + uint32_t handle) 1989 + { 1990 + return ttm_ref_object_base_unref(vmw_fpriv(file_priv)->tfile, 1991 + handle, TTM_REF_USAGE); 1992 + }
+9 -21
drivers/hwmon/ina2xx.c
··· 69 69 u16 regs[INA2XX_MAX_REGISTERS]; 70 70 }; 71 71 72 - int ina2xx_read_word(struct i2c_client *client, int reg) 73 - { 74 - int val = i2c_smbus_read_word_data(client, reg); 75 - if (unlikely(val < 0)) { 76 - dev_dbg(&client->dev, 77 - "Failed to read register: %d\n", reg); 78 - return val; 79 - } 80 - return be16_to_cpu(val); 81 - } 82 - 83 - void ina2xx_write_word(struct i2c_client *client, int reg, int data) 84 - { 85 - i2c_smbus_write_word_data(client, reg, cpu_to_be16(data)); 86 - } 87 - 88 72 static struct ina2xx_data *ina2xx_update_device(struct device *dev) 89 73 { 90 74 struct i2c_client *client = to_i2c_client(dev); ··· 86 102 87 103 /* Read all registers */ 88 104 for (i = 0; i < data->registers; i++) { 89 - int rv = ina2xx_read_word(client, i); 105 + int rv = i2c_smbus_read_word_swapped(client, i); 90 106 if (rv < 0) { 91 107 ret = ERR_PTR(rv); 92 108 goto abort; ··· 263 279 switch (data->kind) { 264 280 case ina219: 265 281 /* device configuration */ 266 - ina2xx_write_word(client, INA2XX_CONFIG, INA219_CONFIG_DEFAULT); 282 + i2c_smbus_write_word_swapped(client, INA2XX_CONFIG, 283 + INA219_CONFIG_DEFAULT); 267 284 268 285 /* set current LSB to 1mA, shunt is in uOhms */ 269 286 /* (equation 13 in datasheet) */ 270 - ina2xx_write_word(client, INA2XX_CALIBRATION, 40960000 / shunt); 287 + i2c_smbus_write_word_swapped(client, INA2XX_CALIBRATION, 288 + 40960000 / shunt); 271 289 dev_info(&client->dev, 272 290 "power monitor INA219 (Rshunt = %li uOhm)\n", shunt); 273 291 data->registers = INA219_REGISTERS; 274 292 break; 275 293 case ina226: 276 294 /* device configuration */ 277 - ina2xx_write_word(client, INA2XX_CONFIG, INA226_CONFIG_DEFAULT); 295 + i2c_smbus_write_word_swapped(client, INA2XX_CONFIG, 296 + INA226_CONFIG_DEFAULT); 278 297 279 298 /* set current LSB to 1mA, shunt is in uOhms */ 280 299 /* (equation 1 in datasheet)*/ 281 - ina2xx_write_word(client, INA2XX_CALIBRATION, 5120000 / shunt); 300 + i2c_smbus_write_word_swapped(client, INA2XX_CALIBRATION, 301 + 5120000 / shunt); 282 302 dev_info(&client->dev, 283 303 "power monitor INA226 (Rshunt = %li uOhm)\n", shunt); 284 304 data->registers = INA226_REGISTERS;
+5 -4
drivers/hwmon/twl4030-madc-hwmon.c
··· 44 44 struct device_attribute *devattr, char *buf) 45 45 { 46 46 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 47 - struct twl4030_madc_request req; 47 + struct twl4030_madc_request req = { 48 + .channels = 1 << attr->index, 49 + .method = TWL4030_MADC_SW2, 50 + .type = TWL4030_MADC_WAIT, 51 + }; 48 52 long val; 49 53 50 - req.channels = (1 << attr->index); 51 - req.method = TWL4030_MADC_SW2; 52 - req.func_cb = NULL; 53 54 val = twl4030_madc_conversion(&req); 54 55 if (val < 0) 55 56 return val;
+3 -3
drivers/i2c/algos/i2c-algo-pca.c
··· 476 476 /* To avoid integer overflow, use clock/100 for calculations */ 477 477 clock = pca_clock(pca_data) / 100; 478 478 479 - if (pca_data->i2c_clock > 10000) { 479 + if (pca_data->i2c_clock > 1000000) { 480 480 mode = I2C_PCA_MODE_TURBO; 481 481 min_tlow = 14; 482 482 min_thi = 5; 483 483 raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */ 484 - } else if (pca_data->i2c_clock > 4000) { 484 + } else if (pca_data->i2c_clock > 400000) { 485 485 mode = I2C_PCA_MODE_FASTP; 486 486 min_tlow = 17; 487 487 min_thi = 9; 488 488 raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */ 489 - } else if (pca_data->i2c_clock > 1000) { 489 + } else if (pca_data->i2c_clock > 100000) { 490 490 mode = I2C_PCA_MODE_FAST; 491 491 min_tlow = 44; 492 492 min_thi = 20;
+6
drivers/i2c/busses/Kconfig
··· 104 104 DH89xxCC (PCH) 105 105 Panther Point (PCH) 106 106 Lynx Point (PCH) 107 + Lynx Point-LP (PCH) 107 108 108 109 This driver can also be built as a module. If so, the module 109 110 will be called i2c-i801. ··· 355 354 devices such as DaVinci NIC. 356 355 For details please see http://www.ti.com/davinci 357 356 357 + config I2C_DESIGNWARE_CORE 358 + tristate 359 + 358 360 config I2C_DESIGNWARE_PLATFORM 359 361 tristate "Synopsys DesignWare Platform" 360 362 depends on HAVE_CLK 363 + select I2C_DESIGNWARE_CORE 361 364 help 362 365 If you say yes to this option, support will be included for the 363 366 Synopsys DesignWare I2C adapter. Only master mode is supported. ··· 372 367 config I2C_DESIGNWARE_PCI 373 368 tristate "Synopsys DesignWare PCI" 374 369 depends on PCI 370 + select I2C_DESIGNWARE_CORE 375 371 help 376 372 If you say yes to this option, support will be included for the 377 373 Synopsys DesignWare I2C adapter. Only master mode is supported.
+3 -2
drivers/i2c/busses/Makefile
··· 33 33 obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o 34 34 obj-$(CONFIG_I2C_CPM) += i2c-cpm.o 35 35 obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o 36 + obj-$(CONFIG_I2C_DESIGNWARE_CORE) += i2c-designware-core.o 36 37 obj-$(CONFIG_I2C_DESIGNWARE_PLATFORM) += i2c-designware-platform.o 37 - i2c-designware-platform-objs := i2c-designware-platdrv.o i2c-designware-core.o 38 + i2c-designware-platform-objs := i2c-designware-platdrv.o 38 39 obj-$(CONFIG_I2C_DESIGNWARE_PCI) += i2c-designware-pci.o 39 - i2c-designware-pci-objs := i2c-designware-pcidrv.o i2c-designware-core.o 40 + i2c-designware-pci-objs := i2c-designware-pcidrv.o 40 41 obj-$(CONFIG_I2C_EG20T) += i2c-eg20t.o 41 42 obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o 42 43 obj-$(CONFIG_I2C_HIGHLANDER) += i2c-highlander.o
+11
drivers/i2c/busses/i2c-designware-core.c
··· 25 25 * ---------------------------------------------------------------------------- 26 26 * 27 27 */ 28 + #include <linux/export.h> 28 29 #include <linux/clk.h> 29 30 #include <linux/errno.h> 30 31 #include <linux/err.h> ··· 317 316 dw_writel(dev, dev->master_cfg , DW_IC_CON); 318 317 return 0; 319 318 } 319 + EXPORT_SYMBOL_GPL(i2c_dw_init); 320 320 321 321 /* 322 322 * Waiting for bus not busy ··· 570 568 571 569 return ret; 572 570 } 571 + EXPORT_SYMBOL_GPL(i2c_dw_xfer); 573 572 574 573 u32 i2c_dw_func(struct i2c_adapter *adap) 575 574 { 576 575 struct dw_i2c_dev *dev = i2c_get_adapdata(adap); 577 576 return dev->functionality; 578 577 } 578 + EXPORT_SYMBOL_GPL(i2c_dw_func); 579 579 580 580 static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev) 581 581 { ··· 682 678 683 679 return IRQ_HANDLED; 684 680 } 681 + EXPORT_SYMBOL_GPL(i2c_dw_isr); 685 682 686 683 void i2c_dw_enable(struct dw_i2c_dev *dev) 687 684 { 688 685 /* Enable the adapter */ 689 686 dw_writel(dev, 1, DW_IC_ENABLE); 690 687 } 688 + EXPORT_SYMBOL_GPL(i2c_dw_enable); 691 689 692 690 u32 i2c_dw_is_enabled(struct dw_i2c_dev *dev) 693 691 { 694 692 return dw_readl(dev, DW_IC_ENABLE); 695 693 } 694 + EXPORT_SYMBOL_GPL(i2c_dw_is_enabled); 696 695 697 696 void i2c_dw_disable(struct dw_i2c_dev *dev) 698 697 { ··· 706 699 dw_writel(dev, 0, DW_IC_INTR_MASK); 707 700 dw_readl(dev, DW_IC_CLR_INTR); 708 701 } 702 + EXPORT_SYMBOL_GPL(i2c_dw_disable); 709 703 710 704 void i2c_dw_clear_int(struct dw_i2c_dev *dev) 711 705 { 712 706 dw_readl(dev, DW_IC_CLR_INTR); 713 707 } 708 + EXPORT_SYMBOL_GPL(i2c_dw_clear_int); 714 709 715 710 void i2c_dw_disable_int(struct dw_i2c_dev *dev) 716 711 { 717 712 dw_writel(dev, 0, DW_IC_INTR_MASK); 718 713 } 714 + EXPORT_SYMBOL_GPL(i2c_dw_disable_int); 719 715 720 716 u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev) 721 717 { 722 718 return dw_readl(dev, DW_IC_COMP_PARAM_1); 723 719 } 720 + EXPORT_SYMBOL_GPL(i2c_dw_read_comp_param);
+3
drivers/i2c/busses/i2c-i801.c
··· 52 52 DH89xxCC (PCH) 0x2330 32 hard yes yes yes 53 53 Panther Point (PCH) 0x1e22 32 hard yes yes yes 54 54 Lynx Point (PCH) 0x8c22 32 hard yes yes yes 55 + Lynx Point-LP (PCH) 0x9c22 32 hard yes yes yes 55 56 56 57 Features supported by this driver: 57 58 Software PEC no ··· 156 155 #define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS 0x2330 157 156 #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30 158 157 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS 0x8c22 158 + #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS 0x9c22 159 159 160 160 struct i801_priv { 161 161 struct i2c_adapter adapter; ··· 773 771 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS) }, 774 772 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS) }, 775 773 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS) }, 774 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS) }, 776 775 { 0, } 777 776 }; 778 777
+6 -7
drivers/i2c/busses/i2c-mxs.c
··· 365 365 struct device_node *node = dev->of_node; 366 366 int ret; 367 367 368 - if (!node) 369 - return -EINVAL; 370 - 371 - i2c->speed = &mxs_i2c_95kHz_config; 372 368 ret = of_property_read_u32(node, "clock-frequency", &speed); 373 369 if (ret) 374 370 dev_warn(dev, "No I2C speed selected, using 100kHz\n"); ··· 415 419 return err; 416 420 417 421 i2c->dev = dev; 422 + i2c->speed = &mxs_i2c_95kHz_config; 418 423 419 - err = mxs_i2c_get_ofdata(i2c); 420 - if (err) 421 - return err; 424 + if (dev->of_node) { 425 + err = mxs_i2c_get_ofdata(i2c); 426 + if (err) 427 + return err; 428 + } 422 429 423 430 platform_set_drvdata(pdev, i2c); 424 431
+31 -22
drivers/i2c/busses/i2c-pnx.c
··· 48 48 mcntrl_afie = 0x00000002, 49 49 mcntrl_naie = 0x00000004, 50 50 mcntrl_drmie = 0x00000008, 51 - mcntrl_daie = 0x00000020, 52 - mcntrl_rffie = 0x00000040, 51 + mcntrl_drsie = 0x00000010, 52 + mcntrl_rffie = 0x00000020, 53 + mcntrl_daie = 0x00000040, 53 54 mcntrl_tffie = 0x00000080, 54 55 mcntrl_reset = 0x00000100, 55 56 mcntrl_cdbmode = 0x00000400, ··· 291 290 * or we didn't 'ask' for it yet. 292 291 */ 293 292 if (ioread32(I2C_REG_STS(alg_data)) & mstatus_rfe) { 294 - dev_dbg(&alg_data->adapter.dev, 295 - "%s(): Write dummy data to fill Rx-fifo...\n", 296 - __func__); 293 + /* 'Asking' is done asynchronously, e.g. dummy TX of several 294 + * bytes is done before the first actual RX arrives in FIFO. 295 + * Therefore, ordered bytes (via TX) are counted separately. 296 + */ 297 + if (alg_data->mif.order) { 298 + dev_dbg(&alg_data->adapter.dev, 299 + "%s(): Write dummy data to fill Rx-fifo...\n", 300 + __func__); 297 301 298 - if (alg_data->mif.len == 1) { 299 - /* Last byte, do not acknowledge next rcv. */ 300 - val |= stop_bit; 302 + if (alg_data->mif.order == 1) { 303 + /* Last byte, do not acknowledge next rcv. */ 304 + val |= stop_bit; 305 + 306 + /* 307 + * Enable interrupt RFDAIE (data in Rx fifo), 308 + * and disable DRMIE (need data for Tx) 309 + */ 310 + ctl = ioread32(I2C_REG_CTL(alg_data)); 311 + ctl |= mcntrl_rffie | mcntrl_daie; 312 + ctl &= ~mcntrl_drmie; 313 + iowrite32(ctl, I2C_REG_CTL(alg_data)); 314 + } 301 315 302 316 /* 303 - * Enable interrupt RFDAIE (data in Rx fifo), 304 - * and disable DRMIE (need data for Tx) 317 + * Now we'll 'ask' for data: 318 + * For each byte we want to receive, we must 319 + * write a (dummy) byte to the Tx-FIFO. 305 320 */ 306 - ctl = ioread32(I2C_REG_CTL(alg_data)); 307 - ctl |= mcntrl_rffie | mcntrl_daie; 308 - ctl &= ~mcntrl_drmie; 309 - iowrite32(ctl, I2C_REG_CTL(alg_data)); 321 + iowrite32(val, I2C_REG_TX(alg_data)); 322 + alg_data->mif.order--; 310 323 } 311 - 312 - /* 313 - * Now we'll 'ask' for data: 314 - * For each byte we want to receive, we must 315 - * write a (dummy) byte to the Tx-FIFO. 316 - */ 317 - iowrite32(val, I2C_REG_TX(alg_data)); 318 - 319 324 return 0; 320 325 } 321 326 ··· 521 514 522 515 alg_data->mif.buf = pmsg->buf; 523 516 alg_data->mif.len = pmsg->len; 517 + alg_data->mif.order = pmsg->len; 524 518 alg_data->mif.mode = (pmsg->flags & I2C_M_RD) ? 525 519 I2C_SMBUS_READ : I2C_SMBUS_WRITE; 526 520 alg_data->mif.ret = 0; ··· 574 566 /* Cleanup to be sure... */ 575 567 alg_data->mif.buf = NULL; 576 568 alg_data->mif.len = 0; 569 + alg_data->mif.order = 0; 577 570 578 571 dev_dbg(&alg_data->adapter.dev, "%s(): exiting, stat = %x\n", 579 572 __func__, ioread32(I2C_REG_STS(alg_data)));
+20 -2
drivers/i2c/i2c-core.c
··· 637 637 } 638 638 639 639 /* 640 + * This function is only needed for mutex_lock_nested, so it is never 641 + * called unless locking correctness checking is enabled. Thus we 642 + * make it inline to avoid a compiler warning. That's what gcc ends up 643 + * doing anyway. 644 + */ 645 + static inline unsigned int i2c_adapter_depth(struct i2c_adapter *adapter) 646 + { 647 + unsigned int depth = 0; 648 + 649 + while ((adapter = i2c_parent_is_i2c_adapter(adapter))) 650 + depth++; 651 + 652 + return depth; 653 + } 654 + 655 + /* 640 656 * Let users instantiate I2C devices through sysfs. This can be used when 641 657 * platform initialization code doesn't contain the proper data for 642 658 * whatever reason. Also useful for drivers that do device detection and ··· 742 726 743 727 /* Make sure the device was added through sysfs */ 744 728 res = -ENOENT; 745 - mutex_lock(&adap->userspace_clients_lock); 729 + mutex_lock_nested(&adap->userspace_clients_lock, 730 + i2c_adapter_depth(adap)); 746 731 list_for_each_entry_safe(client, next, &adap->userspace_clients, 747 732 detected) { 748 733 if (client->addr == addr) { ··· 1090 1073 return res; 1091 1074 1092 1075 /* Remove devices instantiated from sysfs */ 1093 - mutex_lock(&adap->userspace_clients_lock); 1076 + mutex_lock_nested(&adap->userspace_clients_lock, 1077 + i2c_adapter_depth(adap)); 1094 1078 list_for_each_entry_safe(client, next, &adap->userspace_clients, 1095 1079 detected) { 1096 1080 dev_dbg(&adap->dev, "Removing %s at 0x%x\n", client->name,
+1 -1
drivers/iio/adc/at91_adc.c
··· 617 617 st->adc_clk = clk_get(&pdev->dev, "adc_op_clk"); 618 618 if (IS_ERR(st->adc_clk)) { 619 619 dev_err(&pdev->dev, "Failed to get the ADC clock.\n"); 620 - ret = PTR_ERR(st->clk); 620 + ret = PTR_ERR(st->adc_clk); 621 621 goto error_disable_clk; 622 622 } 623 623
+2 -2
drivers/input/misc/ab8500-ponkey.c
··· 74 74 75 75 ponkey->idev = input; 76 76 ponkey->ab8500 = ab8500; 77 - ponkey->irq_dbf = ab8500_irq_get_virq(ab8500, irq_dbf); 78 - ponkey->irq_dbr = ab8500_irq_get_virq(ab8500, irq_dbr); 77 + ponkey->irq_dbf = irq_dbf; 78 + ponkey->irq_dbr = irq_dbr; 79 79 80 80 input->name = "AB8500 POn(PowerOn) Key"; 81 81 input->dev.parent = &pdev->dev;
+2 -1
drivers/isdn/hardware/mISDN/avmfritz.c
··· 857 857 switch (cmd) { 858 858 case CLOSE_CHANNEL: 859 859 test_and_clear_bit(FLG_OPEN, &bch->Flags); 860 + cancel_work_sync(&bch->workq); 860 861 spin_lock_irqsave(&fc->lock, flags); 861 - mISDN_freebchannel(bch); 862 + mISDN_clear_bchannel(bch); 862 863 modehdlc(bch, ISDN_P_NONE); 863 864 spin_unlock_irqrestore(&fc->lock, flags); 864 865 ch->protocol = ISDN_P_NONE;
+2
drivers/isdn/hardware/mISDN/hfcmulti.c
··· 5059 5059 printk(KERN_INFO 5060 5060 "HFC-E1 #%d has overlapping B-channels on fragment #%d\n", 5061 5061 E1_cnt + 1, pt); 5062 + kfree(hc); 5062 5063 return -EINVAL; 5063 5064 } 5064 5065 maskcheck |= hc->bmask[pt]; ··· 5087 5086 if ((poll >> 1) > sizeof(hc->silence_data)) { 5088 5087 printk(KERN_ERR "HFCMULTI error: silence_data too small, " 5089 5088 "please fix\n"); 5089 + kfree(hc); 5090 5090 return -EINVAL; 5091 5091 } 5092 5092 for (i = 0; i < (poll >> 1); i++)
+2 -1
drivers/isdn/hardware/mISDN/mISDNipac.c
··· 1406 1406 switch (cmd) { 1407 1407 case CLOSE_CHANNEL: 1408 1408 test_and_clear_bit(FLG_OPEN, &bch->Flags); 1409 + cancel_work_sync(&bch->workq); 1409 1410 spin_lock_irqsave(hx->ip->hwlock, flags); 1410 - mISDN_freebchannel(bch); 1411 + mISDN_clear_bchannel(bch); 1411 1412 hscx_mode(hx, ISDN_P_NONE); 1412 1413 spin_unlock_irqrestore(hx->ip->hwlock, flags); 1413 1414 ch->protocol = ISDN_P_NONE;
+2 -1
drivers/isdn/hardware/mISDN/mISDNisar.c
··· 1588 1588 switch (cmd) { 1589 1589 case CLOSE_CHANNEL: 1590 1590 test_and_clear_bit(FLG_OPEN, &bch->Flags); 1591 + cancel_work_sync(&bch->workq); 1591 1592 spin_lock_irqsave(ich->is->hwlock, flags); 1592 - mISDN_freebchannel(bch); 1593 + mISDN_clear_bchannel(bch); 1593 1594 modeisar(ich, ISDN_P_NONE); 1594 1595 spin_unlock_irqrestore(ich->is->hwlock, flags); 1595 1596 ch->protocol = ISDN_P_NONE;
+2 -1
drivers/isdn/hardware/mISDN/netjet.c
··· 812 812 switch (cmd) { 813 813 case CLOSE_CHANNEL: 814 814 test_and_clear_bit(FLG_OPEN, &bch->Flags); 815 + cancel_work_sync(&bch->workq); 815 816 spin_lock_irqsave(&card->lock, flags); 816 - mISDN_freebchannel(bch); 817 + mISDN_clear_bchannel(bch); 817 818 mode_tiger(bc, ISDN_P_NONE); 818 819 spin_unlock_irqrestore(&card->lock, flags); 819 820 ch->protocol = ISDN_P_NONE;
+2 -1
drivers/isdn/hardware/mISDN/w6692.c
··· 1054 1054 switch (cmd) { 1055 1055 case CLOSE_CHANNEL: 1056 1056 test_and_clear_bit(FLG_OPEN, &bch->Flags); 1057 + cancel_work_sync(&bch->workq); 1057 1058 spin_lock_irqsave(&card->lock, flags); 1058 - mISDN_freebchannel(bch); 1059 + mISDN_clear_bchannel(bch); 1059 1060 w6692_mode(bc, ISDN_P_NONE); 1060 1061 spin_unlock_irqrestore(&card->lock, flags); 1061 1062 ch->protocol = ISDN_P_NONE;
+4 -5
drivers/isdn/mISDN/hwchannel.c
··· 148 148 ch->next_minlen = ch->init_minlen; 149 149 ch->maxlen = ch->init_maxlen; 150 150 ch->next_maxlen = ch->init_maxlen; 151 + skb_queue_purge(&ch->rqueue); 152 + ch->rcount = 0; 151 153 } 152 154 EXPORT_SYMBOL(mISDN_clear_bchannel); 153 155 154 - int 156 + void 155 157 mISDN_freebchannel(struct bchannel *ch) 156 158 { 159 + cancel_work_sync(&ch->workq); 157 160 mISDN_clear_bchannel(ch); 158 - skb_queue_purge(&ch->rqueue); 159 - ch->rcount = 0; 160 - flush_work_sync(&ch->workq); 161 - return 0; 162 161 } 163 162 EXPORT_SYMBOL(mISDN_freebchannel); 164 163
+3 -2
drivers/mfd/88pm800.c
··· 470 470 471 471 ret = 472 472 mfd_add_devices(chip->dev, 0, &onkey_devs[0], 473 - ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0); 473 + ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0, 474 + NULL); 474 475 if (ret < 0) { 475 476 dev_err(chip->dev, "Failed to add onkey subdev\n"); 476 477 goto out_dev; ··· 482 481 rtc_devs[0].platform_data = pdata->rtc; 483 482 rtc_devs[0].pdata_size = sizeof(struct pm80x_rtc_pdata); 484 483 ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 485 - ARRAY_SIZE(rtc_devs), NULL, 0); 484 + ARRAY_SIZE(rtc_devs), NULL, 0, NULL); 486 485 if (ret < 0) { 487 486 dev_err(chip->dev, "Failed to add rtc subdev\n"); 488 487 goto out_dev;
+2 -1
drivers/mfd/88pm805.c
··· 216 216 } 217 217 218 218 ret = mfd_add_devices(chip->dev, 0, &codec_devs[0], 219 - ARRAY_SIZE(codec_devs), &codec_resources[0], 0); 219 + ARRAY_SIZE(codec_devs), &codec_resources[0], 0, 220 + NULL); 220 221 if (ret < 0) { 221 222 dev_err(chip->dev, "Failed to add codec subdev\n"); 222 223 goto out_codec;
+11 -10
drivers/mfd/88pm860x-core.c
··· 637 637 bk_devs[i].resources = &bk_resources[j]; 638 638 ret = mfd_add_devices(chip->dev, 0, 639 639 &bk_devs[i], 1, 640 - &bk_resources[j], 0); 640 + &bk_resources[j], 0, NULL); 641 641 if (ret < 0) { 642 642 dev_err(chip->dev, "Failed to add " 643 643 "backlight subdev\n"); ··· 672 672 led_devs[i].resources = &led_resources[j], 673 673 ret = mfd_add_devices(chip->dev, 0, 674 674 &led_devs[i], 1, 675 - &led_resources[j], 0); 675 + &led_resources[j], 0, NULL); 676 676 if (ret < 0) { 677 677 dev_err(chip->dev, "Failed to add " 678 678 "led subdev\n"); ··· 709 709 regulator_devs[i].resources = &regulator_resources[seq]; 710 710 711 711 ret = mfd_add_devices(chip->dev, 0, &regulator_devs[i], 1, 712 - &regulator_resources[seq], 0); 712 + &regulator_resources[seq], 0, NULL); 713 713 if (ret < 0) { 714 714 dev_err(chip->dev, "Failed to add regulator subdev\n"); 715 715 goto out; ··· 733 733 rtc_devs[0].resources = &rtc_resources[0]; 734 734 ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 735 735 ARRAY_SIZE(rtc_devs), &rtc_resources[0], 736 - chip->irq_base); 736 + chip->irq_base, NULL); 737 737 if (ret < 0) 738 738 dev_err(chip->dev, "Failed to add rtc subdev\n"); 739 739 } ··· 752 752 touch_devs[0].resources = &touch_resources[0]; 753 753 ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], 754 754 ARRAY_SIZE(touch_devs), &touch_resources[0], 755 - chip->irq_base); 755 + chip->irq_base, NULL); 756 756 if (ret < 0) 757 757 dev_err(chip->dev, "Failed to add touch subdev\n"); 758 758 } ··· 770 770 power_devs[0].num_resources = ARRAY_SIZE(battery_resources); 771 771 power_devs[0].resources = &battery_resources[0], 772 772 ret = mfd_add_devices(chip->dev, 0, &power_devs[0], 1, 773 - &battery_resources[0], chip->irq_base); 773 + &battery_resources[0], chip->irq_base, NULL); 774 774 if (ret < 0) 775 775 dev_err(chip->dev, "Failed to add battery subdev\n"); 776 776 ··· 779 779 power_devs[1].num_resources = ARRAY_SIZE(charger_resources); 780 780 power_devs[1].resources = &charger_resources[0], 781 781 ret = mfd_add_devices(chip->dev, 0, &power_devs[1], 1, 782 - &charger_resources[0], chip->irq_base); 782 + &charger_resources[0], chip->irq_base, NULL); 783 783 if (ret < 0) 784 784 dev_err(chip->dev, "Failed to add charger subdev\n"); 785 785 ··· 788 788 power_devs[2].num_resources = ARRAY_SIZE(preg_resources); 789 789 power_devs[2].resources = &preg_resources[0], 790 790 ret = mfd_add_devices(chip->dev, 0, &power_devs[2], 1, 791 - &preg_resources[0], chip->irq_base); 791 + &preg_resources[0], chip->irq_base, NULL); 792 792 if (ret < 0) 793 793 dev_err(chip->dev, "Failed to add preg subdev\n"); 794 794 } ··· 802 802 onkey_devs[0].resources = &onkey_resources[0], 803 803 ret = mfd_add_devices(chip->dev, 0, &onkey_devs[0], 804 804 ARRAY_SIZE(onkey_devs), &onkey_resources[0], 805 - chip->irq_base); 805 + chip->irq_base, NULL); 806 806 if (ret < 0) 807 807 dev_err(chip->dev, "Failed to add onkey subdev\n"); 808 808 } ··· 815 815 codec_devs[0].num_resources = ARRAY_SIZE(codec_resources); 816 816 codec_devs[0].resources = &codec_resources[0], 817 817 ret = mfd_add_devices(chip->dev, 0, &codec_devs[0], 818 - ARRAY_SIZE(codec_devs), &codec_resources[0], 0); 818 + ARRAY_SIZE(codec_devs), &codec_resources[0], 0, 819 + NULL); 819 820 if (ret < 0) 820 821 dev_err(chip->dev, "Failed to add codec subdev\n"); 821 822 }
+1 -1
drivers/mfd/aat2870-core.c
··· 424 424 } 425 425 426 426 ret = mfd_add_devices(aat2870->dev, 0, aat2870_devs, 427 - ARRAY_SIZE(aat2870_devs), NULL, 0); 427 + ARRAY_SIZE(aat2870_devs), NULL, 0, NULL); 428 428 if (ret != 0) { 429 429 dev_err(aat2870->dev, "Failed to add subdev: %d\n", ret); 430 430 goto out_disable;
+1 -1
drivers/mfd/ab3100-core.c
··· 946 946 } 947 947 948 948 err = mfd_add_devices(&client->dev, 0, ab3100_devs, 949 - ARRAY_SIZE(ab3100_devs), NULL, 0); 949 + ARRAY_SIZE(ab3100_devs), NULL, 0, NULL); 950 950 951 951 ab3100_setup_debugfs(ab3100); 952 952
+5 -5
drivers/mfd/ab8500-core.c
··· 1418 1418 1419 1419 ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs, 1420 1420 ARRAY_SIZE(abx500_common_devs), NULL, 1421 - ab8500->irq_base); 1421 + ab8500->irq_base, ab8500->domain); 1422 1422 if (ret) 1423 1423 goto out_freeirq; 1424 1424 1425 1425 if (is_ab9540(ab8500)) 1426 1426 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1427 1427 ARRAY_SIZE(ab9540_devs), NULL, 1428 - ab8500->irq_base); 1428 + ab8500->irq_base, ab8500->domain); 1429 1429 else 1430 1430 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 1431 1431 ARRAY_SIZE(ab8500_devs), NULL, 1432 - ab8500->irq_base); 1432 + ab8500->irq_base, ab8500->domain); 1433 1433 if (ret) 1434 1434 goto out_freeirq; 1435 1435 1436 1436 if (is_ab9540(ab8500) || is_ab8505(ab8500)) 1437 1437 ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs, 1438 1438 ARRAY_SIZE(ab9540_ab8505_devs), NULL, 1439 - ab8500->irq_base); 1439 + ab8500->irq_base, ab8500->domain); 1440 1440 if (ret) 1441 1441 goto out_freeirq; 1442 1442 ··· 1444 1444 /* Add battery management devices */ 1445 1445 ret = mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs, 1446 1446 ARRAY_SIZE(ab8500_bm_devs), NULL, 1447 - ab8500->irq_base); 1447 + ab8500->irq_base, ab8500->domain); 1448 1448 if (ret) 1449 1449 dev_err(ab8500->dev, "error adding bm devices\n"); 1450 1450 }
+3 -3
drivers/mfd/arizona-core.c
··· 316 316 } 317 317 318 318 ret = mfd_add_devices(arizona->dev, -1, early_devs, 319 - ARRAY_SIZE(early_devs), NULL, 0); 319 + ARRAY_SIZE(early_devs), NULL, 0, NULL); 320 320 if (ret != 0) { 321 321 dev_err(dev, "Failed to add early children: %d\n", ret); 322 322 return ret; ··· 516 516 switch (arizona->type) { 517 517 case WM5102: 518 518 ret = mfd_add_devices(arizona->dev, -1, wm5102_devs, 519 - ARRAY_SIZE(wm5102_devs), NULL, 0); 519 + ARRAY_SIZE(wm5102_devs), NULL, 0, NULL); 520 520 break; 521 521 case WM5110: 522 522 ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, 523 - ARRAY_SIZE(wm5102_devs), NULL, 0); 523 + ARRAY_SIZE(wm5102_devs), NULL, 0, NULL); 524 524 break; 525 525 } 526 526
+3 -3
drivers/mfd/asic3.c
··· 913 913 if (pdata->clock_rate) { 914 914 ds1wm_pdata.clock_rate = pdata->clock_rate; 915 915 ret = mfd_add_devices(&pdev->dev, pdev->id, 916 - &asic3_cell_ds1wm, 1, mem, asic->irq_base); 916 + &asic3_cell_ds1wm, 1, mem, asic->irq_base, NULL); 917 917 if (ret < 0) 918 918 goto out; 919 919 } 920 920 921 921 if (mem_sdio && (irq >= 0)) { 922 922 ret = mfd_add_devices(&pdev->dev, pdev->id, 923 - &asic3_cell_mmc, 1, mem_sdio, irq); 923 + &asic3_cell_mmc, 1, mem_sdio, irq, NULL); 924 924 if (ret < 0) 925 925 goto out; 926 926 } ··· 934 934 asic3_cell_leds[i].pdata_size = sizeof(pdata->leds[i]); 935 935 } 936 936 ret = mfd_add_devices(&pdev->dev, 0, 937 - asic3_cell_leds, ASIC3_NUM_LEDS, NULL, 0); 937 + asic3_cell_leds, ASIC3_NUM_LEDS, NULL, 0, NULL); 938 938 } 939 939 940 940 out:
+1 -1
drivers/mfd/cs5535-mfd.c
··· 149 149 } 150 150 151 151 err = mfd_add_devices(&pdev->dev, -1, cs5535_mfd_cells, 152 - ARRAY_SIZE(cs5535_mfd_cells), NULL, 0); 152 + ARRAY_SIZE(cs5535_mfd_cells), NULL, 0, NULL); 153 153 if (err) { 154 154 dev_err(&pdev->dev, "MFD add devices failed: %d\n", err); 155 155 goto err_disable;
+1 -1
drivers/mfd/da9052-core.c
··· 803 803 dev_err(da9052->dev, "DA9052 ADC IRQ failed ret=%d\n", ret); 804 804 805 805 ret = mfd_add_devices(da9052->dev, -1, da9052_subdev_info, 806 - ARRAY_SIZE(da9052_subdev_info), NULL, 0); 806 + ARRAY_SIZE(da9052_subdev_info), NULL, 0, NULL); 807 807 if (ret) 808 808 goto err; 809 809
+1 -1
drivers/mfd/davinci_voicecodec.c
··· 129 129 cell->pdata_size = sizeof(*davinci_vc); 130 130 131 131 ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, 132 - DAVINCI_VC_CELLS, NULL, 0); 132 + DAVINCI_VC_CELLS, NULL, 0, NULL); 133 133 if (ret != 0) { 134 134 dev_err(&pdev->dev, "fail to register client devices\n"); 135 135 goto fail4;
+1 -1
drivers/mfd/db8500-prcmu.c
··· 3052 3052 prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); 3053 3053 3054 3054 err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, 3055 - ARRAY_SIZE(db8500_prcmu_devs), NULL, 0); 3055 + ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL); 3056 3056 if (err) { 3057 3057 pr_err("prcmu: Failed to add subdevices\n"); 3058 3058 return err;
+3 -2
drivers/mfd/htc-pasic3.c
··· 168 168 /* the first 5 PASIC3 registers control the DS1WM */ 169 169 ds1wm_resources[0].end = (5 << asic->bus_shift) - 1; 170 170 ret = mfd_add_devices(&pdev->dev, pdev->id, 171 - &ds1wm_cell, 1, r, irq); 171 + &ds1wm_cell, 1, r, irq, NULL); 172 172 if (ret < 0) 173 173 dev_warn(dev, "failed to register DS1WM\n"); 174 174 } ··· 176 176 if (pdata && pdata->led_pdata) { 177 177 led_cell.platform_data = pdata->led_pdata; 178 178 led_cell.pdata_size = sizeof(struct pasic3_leds_machinfo); 179 - ret = mfd_add_devices(&pdev->dev, pdev->id, &led_cell, 1, r, 0); 179 + ret = mfd_add_devices(&pdev->dev, pdev->id, &led_cell, 1, r, 180 + 0, NULL); 180 181 if (ret < 0) 181 182 dev_warn(dev, "failed to register LED device\n"); 182 183 }
+2 -2
drivers/mfd/intel_msic.c
··· 344 344 continue; 345 345 346 346 ret = mfd_add_devices(&pdev->dev, -1, &msic_devs[i], 1, NULL, 347 - pdata->irq[i]); 347 + pdata->irq[i], NULL); 348 348 if (ret) 349 349 goto fail; 350 350 } 351 351 352 352 ret = mfd_add_devices(&pdev->dev, 0, msic_other_devs, 353 - ARRAY_SIZE(msic_other_devs), NULL, 0); 353 + ARRAY_SIZE(msic_other_devs), NULL, 0, NULL); 354 354 if (ret) 355 355 goto fail; 356 356
+1 -1
drivers/mfd/janz-cmodio.c
··· 147 147 } 148 148 149 149 return mfd_add_devices(&pdev->dev, 0, priv->cells, 150 - num_probed, NULL, pdev->irq); 150 + num_probed, NULL, pdev->irq, NULL); 151 151 } 152 152 153 153 /*
+2 -1
drivers/mfd/jz4740-adc.c
··· 287 287 writeb(0xff, adc->base + JZ_REG_ADC_CTRL); 288 288 289 289 ret = mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells, 290 - ARRAY_SIZE(jz4740_adc_cells), mem_base, irq_base); 290 + ARRAY_SIZE(jz4740_adc_cells), mem_base, 291 + irq_base, NULL); 291 292 if (ret < 0) 292 293 goto err_clk_put; 293 294
+4 -3
drivers/mfd/lm3533-core.c
··· 393 393 lm3533_als_devs[0].platform_data = pdata->als; 394 394 lm3533_als_devs[0].pdata_size = sizeof(*pdata->als); 395 395 396 - ret = mfd_add_devices(lm3533->dev, 0, lm3533_als_devs, 1, NULL, 0); 396 + ret = mfd_add_devices(lm3533->dev, 0, lm3533_als_devs, 1, NULL, 397 + 0, NULL); 397 398 if (ret) { 398 399 dev_err(lm3533->dev, "failed to add ALS device\n"); 399 400 return ret; ··· 423 422 } 424 423 425 424 ret = mfd_add_devices(lm3533->dev, 0, lm3533_bl_devs, 426 - pdata->num_backlights, NULL, 0); 425 + pdata->num_backlights, NULL, 0, NULL); 427 426 if (ret) { 428 427 dev_err(lm3533->dev, "failed to add backlight devices\n"); 429 428 return ret; ··· 452 451 } 453 452 454 453 ret = mfd_add_devices(lm3533->dev, 0, lm3533_led_devs, 455 - pdata->num_leds, NULL, 0); 454 + pdata->num_leds, NULL, 0, NULL); 456 455 if (ret) { 457 456 dev_err(lm3533->dev, "failed to add LED devices\n"); 458 457 return ret;
+3 -21
drivers/mfd/lpc_ich.c
··· 750 750 751 751 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_GPIO], id); 752 752 ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_GPIO], 753 - 1, NULL, 0); 753 + 1, NULL, 0, NULL); 754 754 755 755 gpio_done: 756 756 if (acpi_conflict) ··· 765 765 u32 base_addr_cfg; 766 766 u32 base_addr; 767 767 int ret; 768 - bool acpi_conflict = false; 769 768 struct resource *res; 770 769 771 770 /* Setup power management base register */ ··· 779 780 res = wdt_io_res(ICH_RES_IO_TCO); 780 781 res->start = base_addr + ACPIBASE_TCO_OFF; 781 782 res->end = base_addr + ACPIBASE_TCO_END; 782 - ret = acpi_check_resource_conflict(res); 783 - if (ret) { 784 - acpi_conflict = true; 785 - goto wdt_done; 786 - } 787 783 788 784 res = wdt_io_res(ICH_RES_IO_SMI); 789 785 res->start = base_addr + ACPIBASE_SMI_OFF; 790 786 res->end = base_addr + ACPIBASE_SMI_END; 791 - ret = acpi_check_resource_conflict(res); 792 - if (ret) { 793 - acpi_conflict = true; 794 - goto wdt_done; 795 - } 787 + 796 788 lpc_ich_enable_acpi_space(dev); 797 789 798 790 /* ··· 803 813 res = wdt_mem_res(ICH_RES_MEM_GCS); 804 814 res->start = base_addr + ACPIBASE_GCS_OFF; 805 815 res->end = base_addr + ACPIBASE_GCS_END; 806 - ret = acpi_check_resource_conflict(res); 807 - if (ret) { 808 - acpi_conflict = true; 809 - goto wdt_done; 810 - } 811 816 } 812 817 813 818 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_WDT], id); 814 819 ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_WDT], 815 - 1, NULL, 0); 820 + 1, NULL, 0, NULL); 816 821 817 822 wdt_done: 818 - if (acpi_conflict) 819 - pr_warn("Resource conflict(s) found affecting %s\n", 820 - lpc_ich_cells[LPC_WDT].name); 821 823 return ret; 822 824 } 823 825
+4 -2
drivers/mfd/lpc_sch.c
··· 127 127 lpc_sch_cells[i].id = id->device; 128 128 129 129 ret = mfd_add_devices(&dev->dev, 0, 130 - lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 0); 130 + lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 131 + 0, NULL); 131 132 if (ret) 132 133 goto out_dev; 133 134 ··· 154 153 tunnelcreek_cells[i].id = id->device; 155 154 156 155 ret = mfd_add_devices(&dev->dev, 0, tunnelcreek_cells, 157 - ARRAY_SIZE(tunnelcreek_cells), NULL, 0); 156 + ARRAY_SIZE(tunnelcreek_cells), NULL, 157 + 0, NULL); 158 158 } 159 159 160 160 return ret;
+1 -1
drivers/mfd/max77686.c
··· 126 126 max77686_irq_init(max77686); 127 127 128 128 ret = mfd_add_devices(max77686->dev, -1, max77686_devs, 129 - ARRAY_SIZE(max77686_devs), NULL, 0); 129 + ARRAY_SIZE(max77686_devs), NULL, 0, NULL); 130 130 131 131 if (ret < 0) 132 132 goto err_mfd;
+31 -5
drivers/mfd/max77693-irq.c
··· 137 137 const struct max77693_irq_data *irq_data = 138 138 irq_to_max77693_irq(max77693, data->irq); 139 139 140 + if (irq_data->group >= MAX77693_IRQ_GROUP_NR) 141 + return; 142 + 140 143 if (irq_data->group >= MUIC_INT1 && irq_data->group <= MUIC_INT3) 141 144 max77693->irq_masks_cur[irq_data->group] &= ~irq_data->mask; 142 145 else ··· 151 148 struct max77693_dev *max77693 = irq_get_chip_data(data->irq); 152 149 const struct max77693_irq_data *irq_data = 153 150 irq_to_max77693_irq(max77693, data->irq); 151 + 152 + if (irq_data->group >= MAX77693_IRQ_GROUP_NR) 153 + return; 154 154 155 155 if (irq_data->group >= MUIC_INT1 && irq_data->group <= MUIC_INT3) 156 156 max77693->irq_masks_cur[irq_data->group] |= irq_data->mask; ··· 206 200 207 201 if (irq_src & MAX77693_IRQSRC_MUIC) 208 202 /* MUIC INT1 ~ INT3 */ 209 - max77693_bulk_read(max77693->regmap, MAX77693_MUIC_REG_INT1, 203 + max77693_bulk_read(max77693->regmap_muic, MAX77693_MUIC_REG_INT1, 210 204 MAX77693_NUM_IRQ_MUIC_REGS, &irq_reg[MUIC_INT1]); 211 205 212 206 /* Apply masking */ ··· 261 255 { 262 256 struct irq_domain *domain; 263 257 int i; 264 - int ret; 258 + int ret = 0; 259 + u8 intsrc_mask; 265 260 266 261 mutex_init(&max77693->irqlock); 267 262 ··· 294 287 &max77693_irq_domain_ops, max77693); 295 288 if (!domain) { 296 289 dev_err(max77693->dev, "could not create irq domain\n"); 297 - return -ENODEV; 290 + ret = -ENODEV; 291 + goto err_irq; 298 292 } 299 293 max77693->irq_domain = domain; 294 + 295 + /* Unmask max77693 interrupt */ 296 + ret = max77693_read_reg(max77693->regmap, 297 + MAX77693_PMIC_REG_INTSRC_MASK, &intsrc_mask); 298 + if (ret < 0) { 299 + dev_err(max77693->dev, "fail to read PMIC register\n"); 300 + goto err_irq; 301 + } 302 + 303 + intsrc_mask &= ~(MAX77693_IRQSRC_CHG); 304 + intsrc_mask &= ~(MAX77693_IRQSRC_FLASH); 305 + intsrc_mask &= ~(MAX77693_IRQSRC_MUIC); 306 + ret = max77693_write_reg(max77693->regmap, 307 + MAX77693_PMIC_REG_INTSRC_MASK, intsrc_mask); 308 + if (ret < 0) { 309 + dev_err(max77693->dev, "fail to write PMIC register\n"); 310 + goto err_irq; 311 + } 300 312 301 313 ret = request_threaded_irq(max77693->irq, NULL, max77693_irq_thread, 302 314 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 303 315 "max77693-irq", max77693); 304 - 305 316 if (ret) 306 317 dev_err(max77693->dev, "Failed to request IRQ %d: %d\n", 307 318 max77693->irq, ret); 308 319 309 - return 0; 320 + err_irq: 321 + return ret; 310 322 } 311 323 312 324 void max77693_irq_exit(struct max77693_dev *max77693)
+15 -1
drivers/mfd/max77693.c
··· 152 152 max77693->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC); 153 153 i2c_set_clientdata(max77693->haptic, max77693); 154 154 155 + /* 156 + * Initialize register map for MUIC device because use regmap-muic 157 + * instance of MUIC device when irq of max77693 is initialized 158 + * before call max77693-muic probe() function. 159 + */ 160 + max77693->regmap_muic = devm_regmap_init_i2c(max77693->muic, 161 + &max77693_regmap_config); 162 + if (IS_ERR(max77693->regmap_muic)) { 163 + ret = PTR_ERR(max77693->regmap_muic); 164 + dev_err(max77693->dev, 165 + "failed to allocate register map: %d\n", ret); 166 + goto err_regmap; 167 + } 168 + 155 169 ret = max77693_irq_init(max77693); 156 170 if (ret < 0) 157 171 goto err_irq; ··· 173 159 pm_runtime_set_active(max77693->dev); 174 160 175 161 ret = mfd_add_devices(max77693->dev, -1, max77693_devs, 176 - ARRAY_SIZE(max77693_devs), NULL, 0); 162 + ARRAY_SIZE(max77693_devs), NULL, 0, NULL); 177 163 if (ret < 0) 178 164 goto err_mfd; 179 165
+6 -6
drivers/mfd/max8925-core.c
··· 598 598 599 599 ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], 600 600 ARRAY_SIZE(rtc_devs), 601 - &rtc_resources[0], chip->irq_base); 601 + &rtc_resources[0], chip->irq_base, NULL); 602 602 if (ret < 0) { 603 603 dev_err(chip->dev, "Failed to add rtc subdev\n"); 604 604 goto out; ··· 606 606 607 607 ret = mfd_add_devices(chip->dev, 0, &onkey_devs[0], 608 608 ARRAY_SIZE(onkey_devs), 609 - &onkey_resources[0], 0); 609 + &onkey_resources[0], 0, NULL); 610 610 if (ret < 0) { 611 611 dev_err(chip->dev, "Failed to add onkey subdev\n"); 612 612 goto out_dev; ··· 615 615 if (pdata) { 616 616 ret = mfd_add_devices(chip->dev, 0, &regulator_devs[0], 617 617 ARRAY_SIZE(regulator_devs), 618 - &regulator_resources[0], 0); 618 + &regulator_resources[0], 0, NULL); 619 619 if (ret < 0) { 620 620 dev_err(chip->dev, "Failed to add regulator subdev\n"); 621 621 goto out_dev; ··· 625 625 if (pdata && pdata->backlight) { 626 626 ret = mfd_add_devices(chip->dev, 0, &backlight_devs[0], 627 627 ARRAY_SIZE(backlight_devs), 628 - &backlight_resources[0], 0); 628 + &backlight_resources[0], 0, NULL); 629 629 if (ret < 0) { 630 630 dev_err(chip->dev, "Failed to add backlight subdev\n"); 631 631 goto out_dev; ··· 635 635 if (pdata && pdata->power) { 636 636 ret = mfd_add_devices(chip->dev, 0, &power_devs[0], 637 637 ARRAY_SIZE(power_devs), 638 - &power_supply_resources[0], 0); 638 + &power_supply_resources[0], 0, NULL); 639 639 if (ret < 0) { 640 640 dev_err(chip->dev, "Failed to add power supply " 641 641 "subdev\n"); ··· 646 646 if (pdata && pdata->touch) { 647 647 ret = mfd_add_devices(chip->dev, 0, &touch_devs[0], 648 648 ARRAY_SIZE(touch_devs), 649 - &touch_resources[0], 0); 649 + &touch_resources[0], 0, NULL); 650 650 if (ret < 0) { 651 651 dev_err(chip->dev, "Failed to add touch subdev\n"); 652 652 goto out_dev;
+1 -1
drivers/mfd/max8997.c
··· 160 160 161 161 mfd_add_devices(max8997->dev, -1, max8997_devs, 162 162 ARRAY_SIZE(max8997_devs), 163 - NULL, 0); 163 + NULL, 0, NULL); 164 164 165 165 /* 166 166 * TODO: enable others (flash, muic, rtc, battery, ...) and
+4 -4
drivers/mfd/max8998.c
··· 161 161 switch (id->driver_data) { 162 162 case TYPE_LP3974: 163 163 ret = mfd_add_devices(max8998->dev, -1, 164 - lp3974_devs, ARRAY_SIZE(lp3974_devs), 165 - NULL, 0); 164 + lp3974_devs, ARRAY_SIZE(lp3974_devs), 165 + NULL, 0, NULL); 166 166 break; 167 167 case TYPE_MAX8998: 168 168 ret = mfd_add_devices(max8998->dev, -1, 169 - max8998_devs, ARRAY_SIZE(max8998_devs), 170 - NULL, 0); 169 + max8998_devs, ARRAY_SIZE(max8998_devs), 170 + NULL, 0, NULL); 171 171 break; 172 172 default: 173 173 ret = -EINVAL;
+1 -1
drivers/mfd/mc13xxx-core.c
··· 612 612 if (!cell.name) 613 613 return -ENOMEM; 614 614 615 - return mfd_add_devices(mc13xxx->dev, -1, &cell, 1, NULL, 0); 615 + return mfd_add_devices(mc13xxx->dev, -1, &cell, 1, NULL, 0, NULL); 616 616 } 617 617 618 618 static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format)
+6 -6
drivers/mfd/mfd-core.c
··· 74 74 static int mfd_add_device(struct device *parent, int id, 75 75 const struct mfd_cell *cell, 76 76 struct resource *mem_base, 77 - int irq_base) 77 + int irq_base, struct irq_domain *domain) 78 78 { 79 79 struct resource *res; 80 80 struct platform_device *pdev; 81 81 struct device_node *np = NULL; 82 - struct irq_domain *domain = NULL; 83 82 int ret = -ENOMEM; 84 83 int r; 85 84 ··· 96 97 for_each_child_of_node(parent->of_node, np) { 97 98 if (of_device_is_compatible(np, cell->of_compatible)) { 98 99 pdev->dev.of_node = np; 99 - domain = irq_find_host(parent->of_node); 100 100 break; 101 101 } 102 102 } ··· 175 177 int mfd_add_devices(struct device *parent, int id, 176 178 struct mfd_cell *cells, int n_devs, 177 179 struct resource *mem_base, 178 - int irq_base) 180 + int irq_base, struct irq_domain *domain) 179 181 { 180 182 int i; 181 183 int ret = 0; ··· 189 191 for (i = 0; i < n_devs; i++) { 190 192 atomic_set(&cnts[i], 0); 191 193 cells[i].usage_count = &cnts[i]; 192 - ret = mfd_add_device(parent, id, cells + i, mem_base, irq_base); 194 + ret = mfd_add_device(parent, id, cells + i, mem_base, 195 + irq_base, domain); 193 196 if (ret) 194 197 break; 195 198 } ··· 246 247 for (i = 0; i < n_clones; i++) { 247 248 cell_entry.name = clones[i]; 248 249 /* don't give up if a single call fails; just report error */ 249 - if (mfd_add_device(pdev->dev.parent, -1, &cell_entry, NULL, 0)) 250 + if (mfd_add_device(pdev->dev.parent, -1, &cell_entry, NULL, 0, 251 + NULL)) 250 252 dev_err(dev, "failed to create platform device '%s'\n", 251 253 clones[i]); 252 254 }
+2 -1
drivers/mfd/palmas.c
··· 453 453 454 454 ret = mfd_add_devices(palmas->dev, -1, 455 455 children, ARRAY_SIZE(palmas_children), 456 - NULL, regmap_irq_chip_get_base(palmas->irq_data)); 456 + NULL, regmap_irq_chip_get_base(palmas->irq_data), 457 + NULL); 457 458 kfree(children); 458 459 459 460 if (ret < 0)
+1 -1
drivers/mfd/rc5t583.c
··· 289 289 } 290 290 291 291 ret = mfd_add_devices(rc5t583->dev, -1, rc5t583_subdevs, 292 - ARRAY_SIZE(rc5t583_subdevs), NULL, 0); 292 + ARRAY_SIZE(rc5t583_subdevs), NULL, 0, NULL); 293 293 if (ret) { 294 294 dev_err(&i2c->dev, "add mfd devices failed: %d\n", ret); 295 295 goto err_add_devs;
+2 -1
drivers/mfd/rdc321x-southbridge.c
··· 87 87 rdc321x_wdt_pdata.sb_pdev = pdev; 88 88 89 89 return mfd_add_devices(&pdev->dev, -1, 90 - rdc321x_sb_cells, ARRAY_SIZE(rdc321x_sb_cells), NULL, 0); 90 + rdc321x_sb_cells, ARRAY_SIZE(rdc321x_sb_cells), 91 + NULL, 0, NULL); 91 92 } 92 93 93 94 static void __devexit rdc321x_sb_remove(struct pci_dev *pdev)
+4 -4
drivers/mfd/sec-core.c
··· 141 141 switch (sec_pmic->device_type) { 142 142 case S5M8751X: 143 143 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8751_devs, 144 - ARRAY_SIZE(s5m8751_devs), NULL, 0); 144 + ARRAY_SIZE(s5m8751_devs), NULL, 0, NULL); 145 145 break; 146 146 case S5M8763X: 147 147 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8763_devs, 148 - ARRAY_SIZE(s5m8763_devs), NULL, 0); 148 + ARRAY_SIZE(s5m8763_devs), NULL, 0, NULL); 149 149 break; 150 150 case S5M8767X: 151 151 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs, 152 - ARRAY_SIZE(s5m8767_devs), NULL, 0); 152 + ARRAY_SIZE(s5m8767_devs), NULL, 0, NULL); 153 153 break; 154 154 case S2MPS11X: 155 155 ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs, 156 - ARRAY_SIZE(s2mps11_devs), NULL, 0); 156 + ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL); 157 157 break; 158 158 default: 159 159 /* If this happens the probe function is problem */
+2 -2
drivers/mfd/sta2x11-mfd.c
··· 407 407 sta2x11_mfd_bar0, 408 408 ARRAY_SIZE(sta2x11_mfd_bar0), 409 409 &pdev->resource[0], 410 - 0); 410 + 0, NULL); 411 411 if (err) { 412 412 dev_err(&pdev->dev, "mfd_add_devices[0] failed: %d\n", err); 413 413 goto err_disable; ··· 417 417 sta2x11_mfd_bar1, 418 418 ARRAY_SIZE(sta2x11_mfd_bar1), 419 419 &pdev->resource[1], 420 - 0); 420 + 0, NULL); 421 421 if (err) { 422 422 dev_err(&pdev->dev, "mfd_add_devices[1] failed: %d\n", err); 423 423 goto err_disable;
+1 -1
drivers/mfd/stmpe.c
··· 962 962 struct mfd_cell *cell, int irq) 963 963 { 964 964 return mfd_add_devices(stmpe->dev, stmpe->pdata->id, cell, 1, 965 - NULL, stmpe->irq_base + irq); 965 + NULL, stmpe->irq_base + irq, NULL); 966 966 } 967 967 968 968 static int __devinit stmpe_devices_init(struct stmpe *stmpe)
+1 -1
drivers/mfd/t7l66xb.c
··· 388 388 389 389 ret = mfd_add_devices(&dev->dev, dev->id, 390 390 t7l66xb_cells, ARRAY_SIZE(t7l66xb_cells), 391 - iomem, t7l66xb->irq_base); 391 + iomem, t7l66xb->irq_base, NULL); 392 392 393 393 if (!ret) 394 394 return 0;
+4 -4
drivers/mfd/tc3589x.c
··· 262 262 263 263 if (blocks & TC3589x_BLOCK_GPIO) { 264 264 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio, 265 - ARRAY_SIZE(tc3589x_dev_gpio), NULL, 266 - tc3589x->irq_base); 265 + ARRAY_SIZE(tc3589x_dev_gpio), NULL, 266 + tc3589x->irq_base, NULL); 267 267 if (ret) { 268 268 dev_err(tc3589x->dev, "failed to add gpio child\n"); 269 269 return ret; ··· 273 273 274 274 if (blocks & TC3589x_BLOCK_KEYPAD) { 275 275 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad, 276 - ARRAY_SIZE(tc3589x_dev_keypad), NULL, 277 - tc3589x->irq_base); 276 + ARRAY_SIZE(tc3589x_dev_keypad), NULL, 277 + tc3589x->irq_base, NULL); 278 278 if (ret) { 279 279 dev_err(tc3589x->dev, "failed to keypad child\n"); 280 280 return ret;
+1 -1
drivers/mfd/tc6387xb.c
··· 192 192 printk(KERN_INFO "Toshiba tc6387xb initialised\n"); 193 193 194 194 ret = mfd_add_devices(&dev->dev, dev->id, tc6387xb_cells, 195 - ARRAY_SIZE(tc6387xb_cells), iomem, irq); 195 + ARRAY_SIZE(tc6387xb_cells), iomem, irq, NULL); 196 196 197 197 if (!ret) 198 198 return 0;
+2 -2
drivers/mfd/tc6393xb.c
··· 700 700 tc6393xb_cells[TC6393XB_CELL_FB].pdata_size = sizeof(*tcpd->fb_data); 701 701 702 702 ret = mfd_add_devices(&dev->dev, dev->id, 703 - tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells), 704 - iomem, tcpd->irq_base); 703 + tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells), 704 + iomem, tcpd->irq_base, NULL); 705 705 706 706 if (!ret) 707 707 return 0;
+1 -1
drivers/mfd/ti-ssp.c
··· 412 412 cells[id].data_size = data->pdata_size; 413 413 } 414 414 415 - error = mfd_add_devices(dev, 0, cells, 2, NULL, 0); 415 + error = mfd_add_devices(dev, 0, cells, 2, NULL, 0, NULL); 416 416 if (error < 0) { 417 417 dev_err(dev, "cannot add mfd cells\n"); 418 418 goto error_enable;
+6 -6
drivers/mfd/timberdale.c
··· 757 757 err = mfd_add_devices(&dev->dev, -1, 758 758 timberdale_cells_bar0_cfg0, 759 759 ARRAY_SIZE(timberdale_cells_bar0_cfg0), 760 - &dev->resource[0], msix_entries[0].vector); 760 + &dev->resource[0], msix_entries[0].vector, NULL); 761 761 break; 762 762 case TIMB_HW_VER1: 763 763 err = mfd_add_devices(&dev->dev, -1, 764 764 timberdale_cells_bar0_cfg1, 765 765 ARRAY_SIZE(timberdale_cells_bar0_cfg1), 766 - &dev->resource[0], msix_entries[0].vector); 766 + &dev->resource[0], msix_entries[0].vector, NULL); 767 767 break; 768 768 case TIMB_HW_VER2: 769 769 err = mfd_add_devices(&dev->dev, -1, 770 770 timberdale_cells_bar0_cfg2, 771 771 ARRAY_SIZE(timberdale_cells_bar0_cfg2), 772 - &dev->resource[0], msix_entries[0].vector); 772 + &dev->resource[0], msix_entries[0].vector, NULL); 773 773 break; 774 774 case TIMB_HW_VER3: 775 775 err = mfd_add_devices(&dev->dev, -1, 776 776 timberdale_cells_bar0_cfg3, 777 777 ARRAY_SIZE(timberdale_cells_bar0_cfg3), 778 - &dev->resource[0], msix_entries[0].vector); 778 + &dev->resource[0], msix_entries[0].vector, NULL); 779 779 break; 780 780 default: 781 781 dev_err(&dev->dev, "Uknown IP setup: %d.%d.%d\n", ··· 792 792 793 793 err = mfd_add_devices(&dev->dev, 0, 794 794 timberdale_cells_bar1, ARRAY_SIZE(timberdale_cells_bar1), 795 - &dev->resource[1], msix_entries[0].vector); 795 + &dev->resource[1], msix_entries[0].vector, NULL); 796 796 if (err) { 797 797 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); 798 798 goto err_mfd2; ··· 803 803 ((priv->fw.config & TIMB_HW_VER_MASK) == TIMB_HW_VER3)) { 804 804 err = mfd_add_devices(&dev->dev, 1, timberdale_cells_bar2, 805 805 ARRAY_SIZE(timberdale_cells_bar2), 806 - &dev->resource[2], msix_entries[0].vector); 806 + &dev->resource[2], msix_entries[0].vector, NULL); 807 807 if (err) { 808 808 dev_err(&dev->dev, "mfd_add_devices failed: %d\n", err); 809 809 goto err_mfd2;
+1 -1
drivers/mfd/tps6105x.c
··· 188 188 } 189 189 190 190 ret = mfd_add_devices(&client->dev, 0, tps6105x_cells, 191 - ARRAY_SIZE(tps6105x_cells), NULL, 0); 191 + ARRAY_SIZE(tps6105x_cells), NULL, 0, NULL); 192 192 if (ret) 193 193 goto fail; 194 194
+1 -1
drivers/mfd/tps6507x.c
··· 100 100 101 101 ret = mfd_add_devices(tps6507x->dev, -1, 102 102 tps6507x_devs, ARRAY_SIZE(tps6507x_devs), 103 - NULL, 0); 103 + NULL, 0, NULL); 104 104 105 105 if (ret < 0) 106 106 goto err;
+1 -1
drivers/mfd/tps65090.c
··· 292 292 } 293 293 294 294 ret = mfd_add_devices(tps65090->dev, -1, tps65090s, 295 - ARRAY_SIZE(tps65090s), NULL, 0); 295 + ARRAY_SIZE(tps65090s), NULL, 0, NULL); 296 296 if (ret) { 297 297 dev_err(&client->dev, "add mfd devices failed with err: %d\n", 298 298 ret);
+43 -87
drivers/mfd/tps65217.c
··· 24 24 #include <linux/slab.h> 25 25 #include <linux/regmap.h> 26 26 #include <linux/err.h> 27 - #include <linux/regulator/of_regulator.h> 27 + #include <linux/of.h> 28 + #include <linux/of_device.h> 28 29 29 30 #include <linux/mfd/core.h> 30 31 #include <linux/mfd/tps65217.h> 32 + 33 + static struct mfd_cell tps65217s[] = { 34 + { 35 + .name = "tps65217-pmic", 36 + }, 37 + }; 31 38 32 39 /** 33 40 * tps65217_reg_read: Read a single tps65217 register. ··· 140 133 } 141 134 EXPORT_SYMBOL_GPL(tps65217_clear_bits); 142 135 143 - #ifdef CONFIG_OF 144 - static struct of_regulator_match reg_matches[] = { 145 - { .name = "dcdc1", .driver_data = (void *)TPS65217_DCDC_1 }, 146 - { .name = "dcdc2", .driver_data = (void *)TPS65217_DCDC_2 }, 147 - { .name = "dcdc3", .driver_data = (void *)TPS65217_DCDC_3 }, 148 - { .name = "ldo1", .driver_data = (void *)TPS65217_LDO_1 }, 149 - { .name = "ldo2", .driver_data = (void *)TPS65217_LDO_2 }, 150 - { .name = "ldo3", .driver_data = (void *)TPS65217_LDO_3 }, 151 - { .name = "ldo4", .driver_data = (void *)TPS65217_LDO_4 }, 152 - }; 153 - 154 - static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client) 155 - { 156 - struct device_node *node = client->dev.of_node; 157 - struct tps65217_board *pdata; 158 - struct device_node *regs; 159 - int count = ARRAY_SIZE(reg_matches); 160 - int ret, i; 161 - 162 - regs = of_find_node_by_name(node, "regulators"); 163 - if (!regs) 164 - return NULL; 165 - 166 - ret = of_regulator_match(&client->dev, regs, reg_matches, count); 167 - of_node_put(regs); 168 - if ((ret < 0) || (ret > count)) 169 - return NULL; 170 - 171 - count = ret; 172 - pdata = devm_kzalloc(&client->dev, count * sizeof(*pdata), GFP_KERNEL); 173 - if (!pdata) 174 - return NULL; 175 - 176 - for (i = 0; i < count; i++) { 177 - if (!reg_matches[i].init_data || !reg_matches[i].of_node) 178 - continue; 179 - 180 - pdata->tps65217_init_data[i] = reg_matches[i].init_data; 181 - pdata->of_node[i] = reg_matches[i].of_node; 182 - } 183 - 184 - return pdata; 185 - } 186 - 187 - static struct of_device_id tps65217_of_match[] = { 188 - { .compatible = "ti,tps65217", }, 189 - { }, 190 - }; 191 - #else 192 - static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client) 193 - { 194 - return NULL; 195 - } 196 - #endif 197 - 198 136 static struct regmap_config tps65217_regmap_config = { 199 137 .reg_bits = 8, 200 138 .val_bits = 8, 139 + }; 140 + 141 + static const struct of_device_id tps65217_of_match[] = { 142 + { .compatible = "ti,tps65217", .data = (void *)TPS65217 }, 143 + { /* sentinel */ }, 201 144 }; 202 145 203 146 static int __devinit tps65217_probe(struct i2c_client *client, 204 147 const struct i2c_device_id *ids) 205 148 { 206 149 struct tps65217 *tps; 207 - struct regulator_init_data *reg_data; 208 - struct tps65217_board *pdata = client->dev.platform_data; 209 - int i, ret; 210 150 unsigned int version; 151 + unsigned int chip_id = ids->driver_data; 152 + const struct of_device_id *match; 153 + int ret; 211 154 212 - if (!pdata && client->dev.of_node) 213 - pdata = tps65217_parse_dt(client); 155 + if (client->dev.of_node) { 156 + match = of_match_device(tps65217_of_match, &client->dev); 157 + if (!match) { 158 + dev_err(&client->dev, 159 + "Failed to find matching dt id\n"); 160 + return -EINVAL; 161 + } 162 + chip_id = (unsigned int)match->data; 163 + } 164 + 165 + if (!chip_id) { 166 + dev_err(&client->dev, "id is null.\n"); 167 + return -ENODEV; 168 + } 214 169 215 170 tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); 216 171 if (!tps) 217 172 return -ENOMEM; 218 173 219 - tps->pdata = pdata; 174 + i2c_set_clientdata(client, tps); 175 + tps->dev = &client->dev; 176 + tps->id = chip_id; 177 + 220 178 tps->regmap = devm_regmap_init_i2c(client, &tps65217_regmap_config); 221 179 if (IS_ERR(tps->regmap)) { 222 180 ret = PTR_ERR(tps->regmap); ··· 190 218 return ret; 191 219 } 192 220 193 - i2c_set_clientdata(client, tps); 194 - tps->dev = &client->dev; 221 + ret = mfd_add_devices(tps->dev, -1, tps65217s, 222 + ARRAY_SIZE(tps65217s), NULL, 0, NULL); 223 + if (ret < 0) { 224 + dev_err(tps->dev, "mfd_add_devices failed: %d\n", ret); 225 + return ret; 226 + } 195 227 196 228 ret = tps65217_reg_read(tps, TPS65217_REG_CHIPID, &version); 197 229 if (ret < 0) { ··· 208 232 (version & TPS65217_CHIPID_CHIP_MASK) >> 4, 209 233 version & TPS65217_CHIPID_REV_MASK); 210 234 211 - for (i = 0; i < TPS65217_NUM_REGULATOR; i++) { 212 - struct platform_device *pdev; 213 - 214 - pdev = platform_device_alloc("tps65217-pmic", i); 215 - if (!pdev) { 216 - dev_err(tps->dev, "Cannot create regulator %d\n", i); 217 - continue; 218 - } 219 - 220 - pdev->dev.parent = tps->dev; 221 - pdev->dev.of_node = pdata->of_node[i]; 222 - reg_data = pdata->tps65217_init_data[i]; 223 - platform_device_add_data(pdev, reg_data, sizeof(*reg_data)); 224 - tps->regulator_pdev[i] = pdev; 225 - 226 - platform_device_add(pdev); 227 - } 228 - 229 235 return 0; 230 236 } 231 237 232 238 static int __devexit tps65217_remove(struct i2c_client *client) 233 239 { 234 240 struct tps65217 *tps = i2c_get_clientdata(client); 235 - int i; 236 241 237 - for (i = 0; i < TPS65217_NUM_REGULATOR; i++) 238 - platform_device_unregister(tps->regulator_pdev[i]); 242 + mfd_remove_devices(tps->dev); 239 243 240 244 return 0; 241 245 } 242 246 243 247 static const struct i2c_device_id tps65217_id_table[] = { 244 - {"tps65217", 0xF0}, 245 - {/* end of list */} 248 + {"tps65217", TPS65217}, 249 + { /* sentinel */ } 246 250 }; 247 251 MODULE_DEVICE_TABLE(i2c, tps65217_id_table); 248 252
+2 -1
drivers/mfd/tps6586x.c
··· 493 493 } 494 494 495 495 ret = mfd_add_devices(tps6586x->dev, -1, 496 - tps6586x_cell, ARRAY_SIZE(tps6586x_cell), NULL, 0); 496 + tps6586x_cell, ARRAY_SIZE(tps6586x_cell), 497 + NULL, 0, NULL); 497 498 if (ret < 0) { 498 499 dev_err(&client->dev, "mfd_add_devices failed: %d\n", ret); 499 500 goto err_mfd_add;
+1 -1
drivers/mfd/tps65910.c
··· 254 254 255 255 ret = mfd_add_devices(tps65910->dev, -1, 256 256 tps65910s, ARRAY_SIZE(tps65910s), 257 - NULL, 0); 257 + NULL, 0, NULL); 258 258 if (ret < 0) { 259 259 dev_err(&i2c->dev, "mfd_add_devices failed: %d\n", ret); 260 260 return ret;
+1 -1
drivers/mfd/tps65912-core.c
··· 146 146 147 147 ret = mfd_add_devices(tps65912->dev, -1, 148 148 tps65912s, ARRAY_SIZE(tps65912s), 149 - NULL, 0); 149 + NULL, 0, NULL); 150 150 if (ret < 0) 151 151 goto err; 152 152
+1 -1
drivers/mfd/twl4030-audio.c
··· 223 223 224 224 if (childs) 225 225 ret = mfd_add_devices(&pdev->dev, pdev->id, audio->cells, 226 - childs, NULL, 0); 226 + childs, NULL, 0, NULL); 227 227 else { 228 228 dev_err(&pdev->dev, "No platform data found for childs\n"); 229 229 ret = -ENODEV;
+1 -1
drivers/mfd/twl6040-core.c
··· 632 632 } 633 633 634 634 ret = mfd_add_devices(&client->dev, -1, twl6040->cells, children, 635 - NULL, 0); 635 + NULL, 0, NULL); 636 636 if (ret) 637 637 goto mfd_err; 638 638
+1 -1
drivers/mfd/vx855.c
··· 102 102 vx855_gpio_resources[1].end = vx855_gpio_resources[1].start + 3; 103 103 104 104 ret = mfd_add_devices(&pdev->dev, -1, vx855_cells, ARRAY_SIZE(vx855_cells), 105 - NULL, 0); 105 + NULL, 0, NULL); 106 106 107 107 /* we always return -ENODEV here in order to enable other 108 108 * drivers like old, not-yet-platform_device ported i2c-viapro */
+1 -1
drivers/mfd/wl1273-core.c
··· 241 241 __func__, children); 242 242 243 243 r = mfd_add_devices(&client->dev, -1, core->cells, 244 - children, NULL, 0); 244 + children, NULL, 0, NULL); 245 245 if (r) 246 246 goto err; 247 247
+8 -8
drivers/mfd/wm831x-core.c
··· 1813 1813 case WM8310: 1814 1814 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1815 1815 wm8310_devs, ARRAY_SIZE(wm8310_devs), 1816 - NULL, 0); 1816 + NULL, 0, NULL); 1817 1817 break; 1818 1818 1819 1819 case WM8311: 1820 1820 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1821 1821 wm8311_devs, ARRAY_SIZE(wm8311_devs), 1822 - NULL, 0); 1822 + NULL, 0, NULL); 1823 1823 if (!pdata || !pdata->disable_touch) 1824 1824 mfd_add_devices(wm831x->dev, wm831x_num, 1825 1825 touch_devs, ARRAY_SIZE(touch_devs), 1826 - NULL, 0); 1826 + NULL, 0, NULL); 1827 1827 break; 1828 1828 1829 1829 case WM8312: 1830 1830 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1831 1831 wm8312_devs, ARRAY_SIZE(wm8312_devs), 1832 - NULL, 0); 1832 + NULL, 0, NULL); 1833 1833 if (!pdata || !pdata->disable_touch) 1834 1834 mfd_add_devices(wm831x->dev, wm831x_num, 1835 1835 touch_devs, ARRAY_SIZE(touch_devs), 1836 - NULL, 0); 1836 + NULL, 0, NULL); 1837 1837 break; 1838 1838 1839 1839 case WM8320: ··· 1842 1842 case WM8326: 1843 1843 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1844 1844 wm8320_devs, ARRAY_SIZE(wm8320_devs), 1845 - NULL, 0); 1845 + NULL, 0, NULL); 1846 1846 break; 1847 1847 1848 1848 default: ··· 1867 1867 if (ret & WM831X_XTAL_ENA) { 1868 1868 ret = mfd_add_devices(wm831x->dev, wm831x_num, 1869 1869 rtc_devs, ARRAY_SIZE(rtc_devs), 1870 - NULL, 0); 1870 + NULL, 0, NULL); 1871 1871 if (ret != 0) { 1872 1872 dev_err(wm831x->dev, "Failed to add RTC: %d\n", ret); 1873 1873 goto err_irq; ··· 1880 1880 /* Treat errors as non-critical */ 1881 1881 ret = mfd_add_devices(wm831x->dev, wm831x_num, backlight_devs, 1882 1882 ARRAY_SIZE(backlight_devs), NULL, 1883 - 0); 1883 + 0, NULL); 1884 1884 if (ret < 0) 1885 1885 dev_err(wm831x->dev, "Failed to add backlight: %d\n", 1886 1886 ret);
+1 -1
drivers/mfd/wm8400-core.c
··· 70 70 .pdata_size = sizeof(*wm8400), 71 71 }; 72 72 73 - return mfd_add_devices(wm8400->dev, -1, &cell, 1, NULL, 0); 73 + return mfd_add_devices(wm8400->dev, -1, &cell, 1, NULL, 0, NULL); 74 74 } 75 75 76 76 /*
+2 -2
drivers/mfd/wm8994-core.c
··· 414 414 ret = mfd_add_devices(wm8994->dev, -1, 415 415 wm8994_regulator_devs, 416 416 ARRAY_SIZE(wm8994_regulator_devs), 417 - NULL, 0); 417 + NULL, 0, NULL); 418 418 if (ret != 0) { 419 419 dev_err(wm8994->dev, "Failed to add children: %d\n", ret); 420 420 goto err; ··· 648 648 649 649 ret = mfd_add_devices(wm8994->dev, -1, 650 650 wm8994_devs, ARRAY_SIZE(wm8994_devs), 651 - NULL, 0); 651 + NULL, 0, NULL); 652 652 if (ret != 0) { 653 653 dev_err(wm8994->dev, "Failed to add children: %d\n", ret); 654 654 goto err_irq;
+10 -1
drivers/net/can/mcp251x.c
··· 83 83 #define INSTRUCTION_LOAD_TXB(n) (0x40 + 2 * (n)) 84 84 #define INSTRUCTION_READ_RXB(n) (((n) == 0) ? 0x90 : 0x94) 85 85 #define INSTRUCTION_RESET 0xC0 86 + #define RTS_TXB0 0x01 87 + #define RTS_TXB1 0x02 88 + #define RTS_TXB2 0x04 89 + #define INSTRUCTION_RTS(n) (0x80 | ((n) & 0x07)) 90 + 86 91 87 92 /* MPC251x registers */ 88 93 #define CANSTAT 0x0e ··· 402 397 static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame, 403 398 int tx_buf_idx) 404 399 { 400 + struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev); 405 401 u32 sid, eid, exide, rtr; 406 402 u8 buf[SPI_TRANSFER_BUF_LEN]; 407 403 ··· 424 418 buf[TXBDLC_OFF] = (rtr << DLC_RTR_SHIFT) | frame->can_dlc; 425 419 memcpy(buf + TXBDAT_OFF, frame->data, frame->can_dlc); 426 420 mcp251x_hw_tx_frame(spi, buf, frame->can_dlc, tx_buf_idx); 427 - mcp251x_write_reg(spi, TXBCTRL(tx_buf_idx), TXBCTRL_TXREQ); 421 + 422 + /* use INSTRUCTION_RTS, to avoid "repeated frame problem" */ 423 + priv->spi_tx_buf[0] = INSTRUCTION_RTS(1 << tx_buf_idx); 424 + mcp251x_spi_trans(priv->spi, 1); 428 425 } 429 426 430 427 static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf,
+5 -6
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
··· 710 710 prod = txdata->tx_bd_prod; 711 711 cons = txdata->tx_bd_cons; 712 712 713 - /* NUM_TX_RINGS = number of "next-page" entries 714 - It will be used as a threshold */ 715 - used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS; 713 + used = SUB_S16(prod, cons); 716 714 717 715 #ifdef BNX2X_STOP_ON_ERROR 718 716 WARN_ON(used < 0); 719 - WARN_ON(used > bp->tx_ring_size); 720 - WARN_ON((bp->tx_ring_size - used) > MAX_TX_AVAIL); 717 + WARN_ON(used > txdata->tx_ring_size); 718 + WARN_ON((txdata->tx_ring_size - used) > MAX_TX_AVAIL); 721 719 #endif 722 720 723 - return (s16)(bp->tx_ring_size) - used; 721 + return (s16)(txdata->tx_ring_size) - used; 724 722 } 725 723 726 724 static inline int bnx2x_tx_queue_has_work(struct bnx2x_fp_txdata *txdata) ··· 1086 1088 txdata->txq_index = txq_index; 1087 1089 txdata->tx_cons_sb = tx_cons_sb; 1088 1090 txdata->parent_fp = fp; 1091 + txdata->tx_ring_size = IS_FCOE_FP(fp) ? MAX_TX_AVAIL : bp->tx_ring_size; 1089 1092 1090 1093 DP(NETIF_MSG_IFUP, "created tx data cid %d, txq %d\n", 1091 1094 txdata->cid, txdata->txq_index);
+8 -17
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
··· 401 401 { 0x70000, 8, RI_ALL_ONLINE }, 402 402 { 0x70020, 8184, RI_ALL_OFFLINE }, 403 403 { 0x78000, 8192, RI_E3E3B0_OFFLINE }, 404 - { 0x85000, 3, RI_ALL_ONLINE }, 405 - { 0x8501c, 7, RI_ALL_ONLINE }, 406 - { 0x85048, 1, RI_ALL_ONLINE }, 407 - { 0x85200, 32, RI_ALL_ONLINE }, 408 - { 0xb0000, 16384, RI_E1H_ONLINE }, 404 + { 0x85000, 3, RI_ALL_OFFLINE }, 405 + { 0x8501c, 7, RI_ALL_OFFLINE }, 406 + { 0x85048, 1, RI_ALL_OFFLINE }, 407 + { 0x85200, 32, RI_ALL_OFFLINE }, 408 + { 0xb0000, 16384, RI_E1H_OFFLINE }, 409 409 { 0xc1000, 7, RI_ALL_ONLINE }, 410 410 { 0xc103c, 2, RI_E2E3E3B0_ONLINE }, 411 411 { 0xc1800, 2, RI_ALL_ONLINE }, ··· 581 581 { 0x140188, 3, RI_E1E1HE2E3_ONLINE }, 582 582 { 0x140194, 13, RI_ALL_ONLINE }, 583 583 { 0x140200, 6, RI_E1E1HE2E3_ONLINE }, 584 - { 0x140220, 4, RI_E2E3_ONLINE }, 585 - { 0x140240, 4, RI_E2E3_ONLINE }, 586 584 { 0x140260, 4, RI_E2E3_ONLINE }, 587 585 { 0x140280, 4, RI_E2E3_ONLINE }, 588 - { 0x1402a0, 4, RI_E2E3_ONLINE }, 589 - { 0x1402c0, 4, RI_E2E3_ONLINE }, 590 586 { 0x1402e0, 2, RI_E2E3_ONLINE }, 591 587 { 0x1402e8, 2, RI_E2E3E3B0_ONLINE }, 592 588 { 0x1402f0, 9, RI_E2E3_ONLINE }, 593 589 { 0x140314, 44, RI_E3B0_ONLINE }, 594 - { 0x1403d0, 70, RI_E3B0_ONLINE }, 595 590 { 0x144000, 4, RI_E1E1H_ONLINE }, 596 591 { 0x148000, 4, RI_E1E1H_ONLINE }, 597 592 { 0x14c000, 4, RI_E1E1H_ONLINE }, ··· 699 704 { 0x180398, 1, RI_E2E3E3B0_ONLINE }, 700 705 { 0x1803a0, 5, RI_E2E3E3B0_ONLINE }, 701 706 { 0x1803b4, 2, RI_E3E3B0_ONLINE }, 702 - { 0x180400, 1, RI_ALL_ONLINE }, 703 707 { 0x180404, 255, RI_E1E1H_OFFLINE }, 704 708 { 0x181000, 4, RI_ALL_ONLINE }, 705 709 { 0x181010, 1020, RI_ALL_OFFLINE }, ··· 794 800 { 0x1b905c, 1, RI_E3E3B0_ONLINE }, 795 801 { 0x1b9064, 1, RI_E3B0_ONLINE }, 796 802 { 0x1b9080, 10, RI_E3B0_ONLINE }, 797 - { 0x1b9400, 14, RI_E2E3E3B0_ONLINE }, 798 - { 0x1b943c, 19, RI_E2E3E3B0_ONLINE }, 799 - { 0x1b9490, 10, RI_E2E3E3B0_ONLINE }, 803 + { 0x1b9400, 14, RI_E2E3E3B0_OFFLINE }, 804 + { 0x1b943c, 19, RI_E2E3E3B0_OFFLINE }, 805 + { 0x1b9490, 10, RI_E2E3E3B0_OFFLINE }, 800 806 { 0x1c0000, 2, RI_ALL_ONLINE }, 801 807 { 0x200000, 65, RI_ALL_ONLINE }, 802 808 { 0x20014c, 2, RI_E1HE2E3E3B0_ONLINE }, ··· 808 814 { 0x200398, 1, RI_E2E3E3B0_ONLINE }, 809 815 { 0x2003a0, 1, RI_E2E3E3B0_ONLINE }, 810 816 { 0x2003a8, 2, RI_E2E3E3B0_ONLINE }, 811 - { 0x200400, 1, RI_ALL_ONLINE }, 812 817 { 0x200404, 255, RI_E1E1H_OFFLINE }, 813 818 { 0x202000, 4, RI_ALL_ONLINE }, 814 819 { 0x202010, 2044, RI_ALL_OFFLINE }, ··· 914 921 { 0x280398, 1, RI_E2E3E3B0_ONLINE }, 915 922 { 0x2803a0, 1, RI_E2E3E3B0_ONLINE }, 916 923 { 0x2803a8, 2, RI_E2E3E3B0_ONLINE }, 917 - { 0x280400, 1, RI_ALL_ONLINE }, 918 924 { 0x280404, 255, RI_E1E1H_OFFLINE }, 919 925 { 0x282000, 4, RI_ALL_ONLINE }, 920 926 { 0x282010, 2044, RI_ALL_OFFLINE }, ··· 1023 1031 { 0x300398, 1, RI_E2E3E3B0_ONLINE }, 1024 1032 { 0x3003a0, 1, RI_E2E3E3B0_ONLINE }, 1025 1033 { 0x3003a8, 2, RI_E2E3E3B0_ONLINE }, 1026 - { 0x300400, 1, RI_ALL_ONLINE }, 1027 1034 { 0x300404, 255, RI_E1E1H_OFFLINE }, 1028 1035 { 0x302000, 4, RI_ALL_ONLINE }, 1029 1036 { 0x302010, 2044, RI_ALL_OFFLINE },
+7 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
··· 775 775 struct bnx2x *bp = netdev_priv(dev); 776 776 struct dump_hdr dump_hdr = {0}; 777 777 778 - regs->version = 0; 778 + regs->version = 1; 779 779 memset(p, 0, regs->len); 780 780 781 781 if (!netif_running(bp->dev)) ··· 1587 1587 bp->link_params.req_flow_ctrl[cfg_idx] = 1588 1588 BNX2X_FLOW_CTRL_AUTO; 1589 1589 } 1590 + bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_NONE; 1591 + if (epause->rx_pause) 1592 + bp->link_params.req_fc_auto_adv |= BNX2X_FLOW_CTRL_RX; 1593 + 1594 + if (epause->tx_pause) 1595 + bp->link_params.req_fc_auto_adv |= BNX2X_FLOW_CTRL_TX; 1590 1596 } 1591 1597 1592 1598 DP(BNX2X_MSG_ETHTOOL,
+11 -7
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
··· 2667 2667 return bnx2x_status; 2668 2668 2669 2669 DP(NETIF_MSG_LINK, "About to update PFC in BMAC\n"); 2670 - if (CHIP_IS_E3(bp)) 2671 - bnx2x_update_pfc_xmac(params, vars, 0); 2672 - else { 2670 + 2671 + if (CHIP_IS_E3(bp)) { 2672 + if (vars->mac_type == MAC_TYPE_XMAC) 2673 + bnx2x_update_pfc_xmac(params, vars, 0); 2674 + } else { 2673 2675 val = REG_RD(bp, MISC_REG_RESET_REG_2); 2674 2676 if ((val & 2675 2677 (MISC_REGISTERS_RESET_REG_2_RST_BMAC0 << params->port)) ··· 5434 5432 switch (speed_mask) { 5435 5433 case GP_STATUS_10M: 5436 5434 vars->line_speed = SPEED_10; 5437 - if (vars->duplex == DUPLEX_FULL) 5435 + if (is_duplex == DUPLEX_FULL) 5438 5436 vars->link_status |= LINK_10TFD; 5439 5437 else 5440 5438 vars->link_status |= LINK_10THD; ··· 5442 5440 5443 5441 case GP_STATUS_100M: 5444 5442 vars->line_speed = SPEED_100; 5445 - if (vars->duplex == DUPLEX_FULL) 5443 + if (is_duplex == DUPLEX_FULL) 5446 5444 vars->link_status |= LINK_100TXFD; 5447 5445 else 5448 5446 vars->link_status |= LINK_100TXHD; ··· 5451 5449 case GP_STATUS_1G: 5452 5450 case GP_STATUS_1G_KX: 5453 5451 vars->line_speed = SPEED_1000; 5454 - if (vars->duplex == DUPLEX_FULL) 5452 + if (is_duplex == DUPLEX_FULL) 5455 5453 vars->link_status |= LINK_1000TFD; 5456 5454 else 5457 5455 vars->link_status |= LINK_1000THD; ··· 5459 5457 5460 5458 case GP_STATUS_2_5G: 5461 5459 vars->line_speed = SPEED_2500; 5462 - if (vars->duplex == DUPLEX_FULL) 5460 + if (is_duplex == DUPLEX_FULL) 5463 5461 vars->link_status |= LINK_2500TFD; 5464 5462 else 5465 5463 vars->link_status |= LINK_2500THD; ··· 5533 5531 5534 5532 if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS) { 5535 5533 if (SINGLE_MEDIA_DIRECT(params)) { 5534 + vars->duplex = duplex; 5536 5535 bnx2x_flow_ctrl_resolve(phy, params, vars, gp_status); 5537 5536 if (phy->req_line_speed == SPEED_AUTO_NEG) 5538 5537 bnx2x_xgxs_an_resolve(phy, params, vars, ··· 5628 5625 LINK_STATUS_PARALLEL_DETECTION_USED; 5629 5626 } 5630 5627 bnx2x_ext_phy_resolve_fc(phy, params, vars); 5628 + vars->duplex = duplex; 5631 5629 } 5632 5630 } 5633 5631
+16 -5
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 7561 7561 } 7562 7562 7563 7563 rc = bnx2x_config_vlan_mac(bp, &ramrod_param); 7564 - if (rc < 0) 7564 + 7565 + if (rc == -EEXIST) { 7566 + DP(BNX2X_MSG_SP, "Failed to schedule ADD operations: %d\n", rc); 7567 + /* do not treat adding same MAC as error */ 7568 + rc = 0; 7569 + } else if (rc < 0) 7565 7570 BNX2X_ERR("%s MAC failed\n", (set ? "Set" : "Del")); 7571 + 7566 7572 return rc; 7567 7573 } 7568 7574 ··· 10300 10294 dev_info.port_hw_config[port]. 10301 10295 fcoe_wwn_node_name_lower); 10302 10296 } else if (!IS_MF_SD(bp)) { 10303 - u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg); 10304 - 10305 10297 /* 10306 10298 * Read the WWN info only if the FCoE feature is enabled for 10307 10299 * this function. 10308 10300 */ 10309 - if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) 10301 + if (BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp)) 10310 10302 bnx2x_get_ext_wwn_info(bp, func); 10311 10303 10312 10304 } else if (IS_MF_FCOE_SD(bp)) ··· 11077 11073 netdev_for_each_uc_addr(ha, dev) { 11078 11074 rc = bnx2x_set_mac_one(bp, bnx2x_uc_addr(ha), mac_obj, true, 11079 11075 BNX2X_UC_LIST_MAC, &ramrod_flags); 11080 - if (rc < 0) { 11076 + if (rc == -EEXIST) { 11077 + DP(BNX2X_MSG_SP, 11078 + "Failed to schedule ADD operations: %d\n", rc); 11079 + /* do not treat adding same MAC as error */ 11080 + rc = 0; 11081 + 11082 + } else if (rc < 0) { 11083 + 11081 11084 BNX2X_ERR("Failed to schedule ADD operations: %d\n", 11082 11085 rc); 11083 11086 return rc;
+10 -5
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
··· 101 101 if (CHIP_REV_IS_SLOW(bp)) 102 102 return; 103 103 104 + /* Update MCP's statistics if possible */ 105 + if (bp->func_stx) 106 + memcpy(bnx2x_sp(bp, func_stats), &bp->func_stats, 107 + sizeof(bp->func_stats)); 108 + 104 109 /* loader */ 105 110 if (bp->executer_idx) { 106 111 int loader_idx = PMF_DMAE_C(bp); ··· 133 128 134 129 } else if (bp->func_stx) { 135 130 *stats_comp = 0; 136 - memcpy(bnx2x_sp(bp, func_stats), &bp->func_stats, 137 - sizeof(bp->func_stats)); 138 131 bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); 139 132 } 140 133 } ··· 1154 1151 if (bp->port.pmf) 1155 1152 bnx2x_hw_stats_update(bp); 1156 1153 1157 - if (bnx2x_storm_stats_update(bp) && (bp->stats_pending++ == 3)) { 1158 - BNX2X_ERR("storm stats were not updated for 3 times\n"); 1159 - bnx2x_panic(); 1154 + if (bnx2x_storm_stats_update(bp)) { 1155 + if (bp->stats_pending++ == 3) { 1156 + BNX2X_ERR("storm stats were not updated for 3 times\n"); 1157 + bnx2x_panic(); 1158 + } 1160 1159 return; 1161 1160 } 1162 1161
+9 -4
drivers/net/ethernet/i825xx/znet.c
··· 139 139 /* Only one can be built-in;-> */ 140 140 static struct net_device *znet_dev; 141 141 142 + #define NETIDBLK_MAGIC "NETIDBLK" 143 + #define NETIDBLK_MAGIC_SIZE 8 144 + 142 145 struct netidblk { 143 - char magic[8]; /* The magic number (string) "NETIDBLK" */ 146 + char magic[NETIDBLK_MAGIC_SIZE]; /* The magic number (string) "NETIDBLK" */ 144 147 unsigned char netid[8]; /* The physical station address */ 145 148 char nettype, globalopt; 146 149 char vendor[8]; /* The machine vendor and product name. */ ··· 376 373 struct znet_private *znet; 377 374 struct net_device *dev; 378 375 char *p; 376 + char *plast = phys_to_virt(0x100000 - NETIDBLK_MAGIC_SIZE); 379 377 int err = -ENOMEM; 380 378 381 379 /* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */ 382 - for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++) 383 - if (*p == 'N' && strncmp(p, "NETIDBLK", 8) == 0) 380 + for(p = (char *)phys_to_virt(0xf0000); p <= plast; p++) 381 + if (*p == 'N' && 382 + strncmp(p, NETIDBLK_MAGIC, NETIDBLK_MAGIC_SIZE) == 0) 384 383 break; 385 384 386 - if (p >= (char *)phys_to_virt(0x100000)) { 385 + if (p > plast) { 387 386 if (znet_debug > 1) 388 387 printk(KERN_INFO "No Z-Note ethernet adaptor found.\n"); 389 388 return -ENODEV;
+9 -17
drivers/net/ethernet/ibm/ibmveth.c
··· 472 472 } 473 473 474 474 if (adapter->rx_queue.queue_addr != NULL) { 475 - if (!dma_mapping_error(dev, adapter->rx_queue.queue_dma)) { 476 - dma_unmap_single(dev, 477 - adapter->rx_queue.queue_dma, 478 - adapter->rx_queue.queue_len, 479 - DMA_BIDIRECTIONAL); 480 - adapter->rx_queue.queue_dma = DMA_ERROR_CODE; 481 - } 482 - kfree(adapter->rx_queue.queue_addr); 475 + dma_free_coherent(dev, adapter->rx_queue.queue_len, 476 + adapter->rx_queue.queue_addr, 477 + adapter->rx_queue.queue_dma); 483 478 adapter->rx_queue.queue_addr = NULL; 484 479 } 485 480 ··· 551 556 goto err_out; 552 557 } 553 558 559 + dev = &adapter->vdev->dev; 560 + 554 561 adapter->rx_queue.queue_len = sizeof(struct ibmveth_rx_q_entry) * 555 562 rxq_entries; 556 - adapter->rx_queue.queue_addr = kmalloc(adapter->rx_queue.queue_len, 557 - GFP_KERNEL); 563 + adapter->rx_queue.queue_addr = 564 + dma_alloc_coherent(dev, adapter->rx_queue.queue_len, 565 + &adapter->rx_queue.queue_dma, GFP_KERNEL); 558 566 559 567 if (!adapter->rx_queue.queue_addr) { 560 568 netdev_err(netdev, "unable to allocate rx queue pages\n"); ··· 565 567 goto err_out; 566 568 } 567 569 568 - dev = &adapter->vdev->dev; 569 - 570 570 adapter->buffer_list_dma = dma_map_single(dev, 571 571 adapter->buffer_list_addr, 4096, DMA_BIDIRECTIONAL); 572 572 adapter->filter_list_dma = dma_map_single(dev, 573 573 adapter->filter_list_addr, 4096, DMA_BIDIRECTIONAL); 574 - adapter->rx_queue.queue_dma = dma_map_single(dev, 575 - adapter->rx_queue.queue_addr, 576 - adapter->rx_queue.queue_len, DMA_BIDIRECTIONAL); 577 574 578 575 if ((dma_mapping_error(dev, adapter->buffer_list_dma)) || 579 - (dma_mapping_error(dev, adapter->filter_list_dma)) || 580 - (dma_mapping_error(dev, adapter->rx_queue.queue_dma))) { 576 + (dma_mapping_error(dev, adapter->filter_list_dma))) { 581 577 netdev_err(netdev, "unable to map filter or buffer list " 582 578 "pages\n"); 583 579 rc = -ENOMEM;
+9 -7
drivers/net/ethernet/mellanox/mlx4/main.c
··· 1234 1234 mlx4_info(dev, "non-primary physical function, skipping.\n"); 1235 1235 else 1236 1236 mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); 1237 - goto unmap_bf; 1237 + return err; 1238 1238 } 1239 1239 1240 1240 err = mlx4_load_fw(dev); 1241 1241 if (err) { 1242 1242 mlx4_err(dev, "Failed to start FW, aborting.\n"); 1243 - goto unmap_bf; 1243 + return err; 1244 1244 } 1245 1245 1246 1246 mlx4_cfg.log_pg_sz_m = 1; ··· 1304 1304 err = mlx4_init_slave(dev); 1305 1305 if (err) { 1306 1306 mlx4_err(dev, "Failed to initialize slave\n"); 1307 - goto unmap_bf; 1307 + return err; 1308 1308 } 1309 1309 1310 1310 err = mlx4_slave_cap(dev); ··· 1324 1324 err = mlx4_QUERY_ADAPTER(dev, &adapter); 1325 1325 if (err) { 1326 1326 mlx4_err(dev, "QUERY_ADAPTER command failed, aborting.\n"); 1327 - goto err_close; 1327 + goto unmap_bf; 1328 1328 } 1329 1329 1330 1330 priv->eq_table.inta_pin = adapter.inta_pin; 1331 1331 memcpy(dev->board_id, adapter.board_id, sizeof dev->board_id); 1332 1332 1333 1333 return 0; 1334 + 1335 + unmap_bf: 1336 + unmap_bf_area(dev); 1334 1337 1335 1338 err_close: 1336 1339 mlx4_close_hca(dev); ··· 1347 1344 mlx4_UNMAP_FA(dev); 1348 1345 mlx4_free_icm(dev, priv->fw.fw_icm, 0); 1349 1346 } 1350 - unmap_bf: 1351 - unmap_bf_area(dev); 1352 1347 return err; 1353 1348 } 1354 1349 ··· 1997 1996 } 1998 1997 1999 1998 slave_start: 2000 - if (mlx4_cmd_init(dev)) { 1999 + err = mlx4_cmd_init(dev); 2000 + if (err) { 2001 2001 mlx4_err(dev, "Failed to init command interface, aborting.\n"); 2002 2002 goto err_sriov; 2003 2003 }
+15 -91
drivers/net/ethernet/mellanox/mlx4/mcg.c
··· 137 137 return err; 138 138 } 139 139 140 - static struct mlx4_promisc_qp *get_promisc_qp(struct mlx4_dev *dev, u8 pf_num, 140 + static struct mlx4_promisc_qp *get_promisc_qp(struct mlx4_dev *dev, u8 port, 141 141 enum mlx4_steer_type steer, 142 142 u32 qpn) 143 143 { 144 - struct mlx4_steer *s_steer = &mlx4_priv(dev)->steer[pf_num]; 144 + struct mlx4_steer *s_steer = &mlx4_priv(dev)->steer[port - 1]; 145 145 struct mlx4_promisc_qp *pqp; 146 146 147 147 list_for_each_entry(pqp, &s_steer->promisc_qps[steer], list) { ··· 182 182 /* If the given qpn is also a promisc qp, 183 183 * it should be inserted to duplicates list 184 184 */ 185 - pqp = get_promisc_qp(dev, 0, steer, qpn); 185 + pqp = get_promisc_qp(dev, port, steer, qpn); 186 186 if (pqp) { 187 187 dqp = kmalloc(sizeof *dqp, GFP_KERNEL); 188 188 if (!dqp) { ··· 256 256 257 257 s_steer = &mlx4_priv(dev)->steer[port - 1]; 258 258 259 - pqp = get_promisc_qp(dev, 0, steer, qpn); 259 + pqp = get_promisc_qp(dev, port, steer, qpn); 260 260 if (!pqp) 261 261 return 0; /* nothing to do */ 262 262 ··· 302 302 s_steer = &mlx4_priv(dev)->steer[port - 1]; 303 303 304 304 /* if qp is not promisc, it cannot be duplicated */ 305 - if (!get_promisc_qp(dev, 0, steer, qpn)) 305 + if (!get_promisc_qp(dev, port, steer, qpn)) 306 306 return false; 307 307 308 308 /* The qp is promisc qp so it is a duplicate on this index ··· 352 352 members_count = be32_to_cpu(mgm->members_count) & 0xffffff; 353 353 for (i = 0; i < members_count; i++) { 354 354 qpn = be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK; 355 - if (!get_promisc_qp(dev, 0, steer, qpn) && qpn != tqpn) { 355 + if (!get_promisc_qp(dev, port, steer, qpn) && qpn != tqpn) { 356 356 /* the qp is not promisc, the entry can't be removed */ 357 357 goto out; 358 358 } ··· 398 398 399 399 mutex_lock(&priv->mcg_table.mutex); 400 400 401 - if (get_promisc_qp(dev, 0, steer, qpn)) { 401 + if (get_promisc_qp(dev, port, steer, qpn)) { 402 402 err = 0; /* Noting to do, already exists */ 403 403 goto out_mutex; 404 404 } ··· 503 503 s_steer = &mlx4_priv(dev)->steer[port - 1]; 504 504 mutex_lock(&priv->mcg_table.mutex); 505 505 506 - pqp = get_promisc_qp(dev, 0, steer, qpn); 506 + pqp = get_promisc_qp(dev, port, steer, qpn); 507 507 if (unlikely(!pqp)) { 508 508 mlx4_warn(dev, "QP %x is not promiscuous QP\n", qpn); 509 509 /* nothing to do */ ··· 650 650 return err; 651 651 } 652 652 653 - struct mlx4_net_trans_rule_hw_ctrl { 654 - __be32 ctrl; 655 - __be32 vf_vep_port; 656 - __be32 qpn; 657 - __be32 reserved; 658 - }; 659 - 660 653 static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, 661 654 struct mlx4_net_trans_rule_hw_ctrl *hw) 662 655 { ··· 673 680 hw->qpn = cpu_to_be32(ctrl->qpn); 674 681 } 675 682 676 - struct mlx4_net_trans_rule_hw_ib { 677 - u8 size; 678 - u8 rsvd1; 679 - __be16 id; 680 - u32 rsvd2; 681 - __be32 qpn; 682 - __be32 qpn_mask; 683 - u8 dst_gid[16]; 684 - u8 dst_gid_msk[16]; 685 - } __packed; 686 - 687 - struct mlx4_net_trans_rule_hw_eth { 688 - u8 size; 689 - u8 rsvd; 690 - __be16 id; 691 - u8 rsvd1[6]; 692 - u8 dst_mac[6]; 693 - u16 rsvd2; 694 - u8 dst_mac_msk[6]; 695 - u16 rsvd3; 696 - u8 src_mac[6]; 697 - u16 rsvd4; 698 - u8 src_mac_msk[6]; 699 - u8 rsvd5; 700 - u8 ether_type_enable; 701 - __be16 ether_type; 702 - __be16 vlan_id_msk; 703 - __be16 vlan_id; 704 - } __packed; 705 - 706 - struct mlx4_net_trans_rule_hw_tcp_udp { 707 - u8 size; 708 - u8 rsvd; 709 - __be16 id; 710 - __be16 rsvd1[3]; 711 - __be16 dst_port; 712 - __be16 rsvd2; 713 - __be16 dst_port_msk; 714 - __be16 rsvd3; 715 - __be16 src_port; 716 - __be16 rsvd4; 717 - __be16 src_port_msk; 718 - } __packed; 719 - 720 - struct mlx4_net_trans_rule_hw_ipv4 { 721 - u8 size; 722 - u8 rsvd; 723 - __be16 id; 724 - __be32 rsvd1; 725 - __be32 dst_ip; 726 - __be32 dst_ip_msk; 727 - __be32 src_ip; 728 - __be32 src_ip_msk; 729 - } __packed; 730 - 731 - struct _rule_hw { 732 - union { 733 - struct { 734 - u8 size; 735 - u8 rsvd; 736 - __be16 id; 737 - }; 738 - struct mlx4_net_trans_rule_hw_eth eth; 739 - struct mlx4_net_trans_rule_hw_ib ib; 740 - struct mlx4_net_trans_rule_hw_ipv4 ipv4; 741 - struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; 742 - }; 683 + const u16 __sw_id_hw[] = { 684 + [MLX4_NET_TRANS_RULE_ID_ETH] = 0xE001, 685 + [MLX4_NET_TRANS_RULE_ID_IB] = 0xE005, 686 + [MLX4_NET_TRANS_RULE_ID_IPV6] = 0xE003, 687 + [MLX4_NET_TRANS_RULE_ID_IPV4] = 0xE002, 688 + [MLX4_NET_TRANS_RULE_ID_TCP] = 0xE004, 689 + [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006 743 690 }; 744 691 745 692 static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec, 746 693 struct _rule_hw *rule_hw) 747 694 { 748 - static const u16 __sw_id_hw[] = { 749 - [MLX4_NET_TRANS_RULE_ID_ETH] = 0xE001, 750 - [MLX4_NET_TRANS_RULE_ID_IB] = 0xE005, 751 - [MLX4_NET_TRANS_RULE_ID_IPV6] = 0xE003, 752 - [MLX4_NET_TRANS_RULE_ID_IPV4] = 0xE002, 753 - [MLX4_NET_TRANS_RULE_ID_TCP] = 0xE004, 754 - [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006 755 - }; 756 - 757 695 static const size_t __rule_hw_sz[] = { 758 696 [MLX4_NET_TRANS_RULE_ID_ETH] = 759 697 sizeof(struct mlx4_net_trans_rule_hw_eth),
+76
drivers/net/ethernet/mellanox/mlx4/mlx4.h
··· 690 690 struct list_head steer_entries[MLX4_NUM_STEERS]; 691 691 }; 692 692 693 + struct mlx4_net_trans_rule_hw_ctrl { 694 + __be32 ctrl; 695 + __be32 vf_vep_port; 696 + __be32 qpn; 697 + __be32 reserved; 698 + }; 699 + 700 + struct mlx4_net_trans_rule_hw_ib { 701 + u8 size; 702 + u8 rsvd1; 703 + __be16 id; 704 + u32 rsvd2; 705 + __be32 qpn; 706 + __be32 qpn_mask; 707 + u8 dst_gid[16]; 708 + u8 dst_gid_msk[16]; 709 + } __packed; 710 + 711 + struct mlx4_net_trans_rule_hw_eth { 712 + u8 size; 713 + u8 rsvd; 714 + __be16 id; 715 + u8 rsvd1[6]; 716 + u8 dst_mac[6]; 717 + u16 rsvd2; 718 + u8 dst_mac_msk[6]; 719 + u16 rsvd3; 720 + u8 src_mac[6]; 721 + u16 rsvd4; 722 + u8 src_mac_msk[6]; 723 + u8 rsvd5; 724 + u8 ether_type_enable; 725 + __be16 ether_type; 726 + __be16 vlan_id_msk; 727 + __be16 vlan_id; 728 + } __packed; 729 + 730 + struct mlx4_net_trans_rule_hw_tcp_udp { 731 + u8 size; 732 + u8 rsvd; 733 + __be16 id; 734 + __be16 rsvd1[3]; 735 + __be16 dst_port; 736 + __be16 rsvd2; 737 + __be16 dst_port_msk; 738 + __be16 rsvd3; 739 + __be16 src_port; 740 + __be16 rsvd4; 741 + __be16 src_port_msk; 742 + } __packed; 743 + 744 + struct mlx4_net_trans_rule_hw_ipv4 { 745 + u8 size; 746 + u8 rsvd; 747 + __be16 id; 748 + __be32 rsvd1; 749 + __be32 dst_ip; 750 + __be32 dst_ip_msk; 751 + __be32 src_ip; 752 + __be32 src_ip_msk; 753 + } __packed; 754 + 755 + struct _rule_hw { 756 + union { 757 + struct { 758 + u8 size; 759 + u8 rsvd; 760 + __be16 id; 761 + }; 762 + struct mlx4_net_trans_rule_hw_eth eth; 763 + struct mlx4_net_trans_rule_hw_ib ib; 764 + struct mlx4_net_trans_rule_hw_ipv4 ipv4; 765 + struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; 766 + }; 767 + }; 768 + 693 769 struct mlx4_priv { 694 770 struct mlx4_dev dev; 695 771
+116
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
··· 42 42 #include <linux/mlx4/cmd.h> 43 43 #include <linux/mlx4/qp.h> 44 44 #include <linux/if_ether.h> 45 + #include <linux/etherdevice.h> 45 46 46 47 #include "mlx4.h" 47 48 #include "fw.h" ··· 2777 2776 return err; 2778 2777 } 2779 2778 2779 + /* 2780 + * MAC validation for Flow Steering rules. 2781 + * VF can attach rules only with a mac address which is assigned to it. 2782 + */ 2783 + static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header, 2784 + struct list_head *rlist) 2785 + { 2786 + struct mac_res *res, *tmp; 2787 + __be64 be_mac; 2788 + 2789 + /* make sure it isn't multicast or broadcast mac*/ 2790 + if (!is_multicast_ether_addr(eth_header->eth.dst_mac) && 2791 + !is_broadcast_ether_addr(eth_header->eth.dst_mac)) { 2792 + list_for_each_entry_safe(res, tmp, rlist, list) { 2793 + be_mac = cpu_to_be64(res->mac << 16); 2794 + if (!memcmp(&be_mac, eth_header->eth.dst_mac, ETH_ALEN)) 2795 + return 0; 2796 + } 2797 + pr_err("MAC %pM doesn't belong to VF %d, Steering rule rejected\n", 2798 + eth_header->eth.dst_mac, slave); 2799 + return -EINVAL; 2800 + } 2801 + return 0; 2802 + } 2803 + 2804 + /* 2805 + * In case of missing eth header, append eth header with a MAC address 2806 + * assigned to the VF. 2807 + */ 2808 + static int add_eth_header(struct mlx4_dev *dev, int slave, 2809 + struct mlx4_cmd_mailbox *inbox, 2810 + struct list_head *rlist, int header_id) 2811 + { 2812 + struct mac_res *res, *tmp; 2813 + u8 port; 2814 + struct mlx4_net_trans_rule_hw_ctrl *ctrl; 2815 + struct mlx4_net_trans_rule_hw_eth *eth_header; 2816 + struct mlx4_net_trans_rule_hw_ipv4 *ip_header; 2817 + struct mlx4_net_trans_rule_hw_tcp_udp *l4_header; 2818 + __be64 be_mac = 0; 2819 + __be64 mac_msk = cpu_to_be64(MLX4_MAC_MASK << 16); 2820 + 2821 + ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; 2822 + port = be32_to_cpu(ctrl->vf_vep_port) & 0xff; 2823 + eth_header = (struct mlx4_net_trans_rule_hw_eth *)(ctrl + 1); 2824 + 2825 + /* Clear a space in the inbox for eth header */ 2826 + switch (header_id) { 2827 + case MLX4_NET_TRANS_RULE_ID_IPV4: 2828 + ip_header = 2829 + (struct mlx4_net_trans_rule_hw_ipv4 *)(eth_header + 1); 2830 + memmove(ip_header, eth_header, 2831 + sizeof(*ip_header) + sizeof(*l4_header)); 2832 + break; 2833 + case MLX4_NET_TRANS_RULE_ID_TCP: 2834 + case MLX4_NET_TRANS_RULE_ID_UDP: 2835 + l4_header = (struct mlx4_net_trans_rule_hw_tcp_udp *) 2836 + (eth_header + 1); 2837 + memmove(l4_header, eth_header, sizeof(*l4_header)); 2838 + break; 2839 + default: 2840 + return -EINVAL; 2841 + } 2842 + list_for_each_entry_safe(res, tmp, rlist, list) { 2843 + if (port == res->port) { 2844 + be_mac = cpu_to_be64(res->mac << 16); 2845 + break; 2846 + } 2847 + } 2848 + if (!be_mac) { 2849 + pr_err("Failed adding eth header to FS rule, Can't find matching MAC for port %d .\n", 2850 + port); 2851 + return -EINVAL; 2852 + } 2853 + 2854 + memset(eth_header, 0, sizeof(*eth_header)); 2855 + eth_header->size = sizeof(*eth_header) >> 2; 2856 + eth_header->id = cpu_to_be16(__sw_id_hw[MLX4_NET_TRANS_RULE_ID_ETH]); 2857 + memcpy(eth_header->dst_mac, &be_mac, ETH_ALEN); 2858 + memcpy(eth_header->dst_mac_msk, &mac_msk, ETH_ALEN); 2859 + 2860 + return 0; 2861 + 2862 + } 2863 + 2780 2864 int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, 2781 2865 struct mlx4_vhcr *vhcr, 2782 2866 struct mlx4_cmd_mailbox *inbox, 2783 2867 struct mlx4_cmd_mailbox *outbox, 2784 2868 struct mlx4_cmd_info *cmd) 2785 2869 { 2870 + 2871 + struct mlx4_priv *priv = mlx4_priv(dev); 2872 + struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker; 2873 + struct list_head *rlist = &tracker->slave_list[slave].res_list[RES_MAC]; 2786 2874 int err; 2875 + struct mlx4_net_trans_rule_hw_ctrl *ctrl; 2876 + struct _rule_hw *rule_header; 2877 + int header_id; 2787 2878 2788 2879 if (dev->caps.steering_mode != 2789 2880 MLX4_STEERING_MODE_DEVICE_MANAGED) 2790 2881 return -EOPNOTSUPP; 2882 + 2883 + ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; 2884 + rule_header = (struct _rule_hw *)(ctrl + 1); 2885 + header_id = map_hw_to_sw_id(be16_to_cpu(rule_header->id)); 2886 + 2887 + switch (header_id) { 2888 + case MLX4_NET_TRANS_RULE_ID_ETH: 2889 + if (validate_eth_header_mac(slave, rule_header, rlist)) 2890 + return -EINVAL; 2891 + break; 2892 + case MLX4_NET_TRANS_RULE_ID_IPV4: 2893 + case MLX4_NET_TRANS_RULE_ID_TCP: 2894 + case MLX4_NET_TRANS_RULE_ID_UDP: 2895 + pr_warn("Can't attach FS rule without L2 headers, adding L2 header.\n"); 2896 + if (add_eth_header(dev, slave, inbox, rlist, header_id)) 2897 + return -EINVAL; 2898 + vhcr->in_modifier += 2899 + sizeof(struct mlx4_net_trans_rule_hw_eth) >> 2; 2900 + break; 2901 + default: 2902 + pr_err("Corrupted mailbox.\n"); 2903 + return -EINVAL; 2904 + } 2791 2905 2792 2906 err = mlx4_cmd_imm(dev, inbox->dma, &vhcr->out_param, 2793 2907 vhcr->in_modifier, 0,
+1
drivers/net/ethernet/seeq/sgiseeq.c
··· 751 751 sp->srings = sr; 752 752 sp->rx_desc = sp->srings->rxvector; 753 753 sp->tx_desc = sp->srings->txvector; 754 + spin_lock_init(&sp->tx_lock); 754 755 755 756 /* A couple calculations now, saves many cycles later. */ 756 757 setup_rx_ring(dev, sp->rx_desc, SEEQ_RX_BUFFERS);
+5 -4
drivers/net/usb/qmi_wwan.c
··· 297 297 if (ret < 0) 298 298 goto err; 299 299 300 - if (info->subdriver && info->subdriver->suspend) 300 + if (intf == info->control && info->subdriver && info->subdriver->suspend) 301 301 ret = info->subdriver->suspend(intf, message); 302 302 if (ret < 0) 303 303 usbnet_resume(intf); ··· 310 310 struct usbnet *dev = usb_get_intfdata(intf); 311 311 struct qmi_wwan_state *info = (void *)&dev->data; 312 312 int ret = 0; 313 + bool callsub = (intf == info->control && info->subdriver && info->subdriver->resume); 313 314 314 - if (info->subdriver && info->subdriver->resume) 315 + if (callsub) 315 316 ret = info->subdriver->resume(intf); 316 317 if (ret < 0) 317 318 goto err; 318 319 ret = usbnet_resume(intf); 319 - if (ret < 0 && info->subdriver && info->subdriver->resume && info->subdriver->suspend) 320 + if (ret < 0 && callsub && info->subdriver->suspend) 320 321 info->subdriver->suspend(intf, PMSG_SUSPEND); 321 322 err: 322 323 return ret; ··· 399 398 /* 4. Gobi 1000 devices */ 400 399 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ 401 400 {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ 402 - {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ 403 401 {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ 404 402 {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ 405 403 {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ ··· 440 440 {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ 441 441 {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ 442 442 {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ 443 + {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ 443 444 {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ 444 445 {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ 445 446 {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
+1 -1
drivers/net/usb/sierra_net.c
··· 656 656 return -EIO; 657 657 } 658 658 659 - *datap = *attrdata; 659 + *datap = le16_to_cpu(*attrdata); 660 660 661 661 kfree(attrdata); 662 662 return result;
+12 -4
drivers/net/usb/usbnet.c
··· 1201 1201 } 1202 1202 EXPORT_SYMBOL_GPL(usbnet_start_xmit); 1203 1203 1204 - static void rx_alloc_submit(struct usbnet *dev, gfp_t flags) 1204 + static int rx_alloc_submit(struct usbnet *dev, gfp_t flags) 1205 1205 { 1206 1206 struct urb *urb; 1207 1207 int i; 1208 + int ret = 0; 1208 1209 1209 1210 /* don't refill the queue all at once */ 1210 1211 for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) { 1211 1212 urb = usb_alloc_urb(0, flags); 1212 1213 if (urb != NULL) { 1213 - if (rx_submit(dev, urb, flags) == -ENOLINK) 1214 - return; 1214 + ret = rx_submit(dev, urb, flags); 1215 + if (ret) 1216 + goto err; 1217 + } else { 1218 + ret = -ENOMEM; 1219 + goto err; 1215 1220 } 1216 1221 } 1222 + err: 1223 + return ret; 1217 1224 } 1218 1225 1219 1226 /*-------------------------------------------------------------------------*/ ··· 1264 1257 int temp = dev->rxq.qlen; 1265 1258 1266 1259 if (temp < RX_QLEN(dev)) { 1267 - rx_alloc_submit(dev, GFP_ATOMIC); 1260 + if (rx_alloc_submit(dev, GFP_ATOMIC) == -ENOLINK) 1261 + return; 1268 1262 if (temp != dev->rxq.qlen) 1269 1263 netif_dbg(dev, link, dev->net, 1270 1264 "rxqlen %d --> %d\n",
+1
drivers/net/wan/ixp4xx_hss.c
··· 10 10 11 11 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 12 12 13 + #include <linux/module.h> 13 14 #include <linux/bitops.h> 14 15 #include <linux/cdev.h> 15 16 #include <linux/dma-mapping.h>
+104 -1
drivers/net/wireless/ath/ath9k/ar9003_paprd.c
··· 142 142 }; 143 143 int training_power; 144 144 int i, val; 145 + u32 am2pm_mask = ah->paprd_ratemask; 145 146 146 147 if (IS_CHAN_2GHZ(ah->curchan)) 147 148 training_power = ar9003_get_training_power_2g(ah); ··· 159 158 } 160 159 ah->paprd_training_power = training_power; 161 160 161 + if (AR_SREV_9330(ah)) 162 + am2pm_mask = 0; 163 + 162 164 REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, 163 165 ah->paprd_ratemask); 164 166 REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, 165 - ah->paprd_ratemask); 167 + am2pm_mask); 166 168 REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, 167 169 ah->paprd_ratemask_ht40); 168 170 ··· 786 782 } 787 783 EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); 788 784 785 + static bool ar9003_paprd_retrain_pa_in(struct ath_hw *ah, 786 + struct ath9k_hw_cal_data *caldata, 787 + int chain) 788 + { 789 + u32 *pa_in = caldata->pa_table[chain]; 790 + int capdiv_offset, quick_drop_offset; 791 + int capdiv2g, quick_drop; 792 + int count = 0; 793 + int i; 794 + 795 + if (!AR_SREV_9485(ah) && !AR_SREV_9330(ah)) 796 + return false; 797 + 798 + capdiv2g = REG_READ_FIELD(ah, AR_PHY_65NM_CH0_TXRF3, 799 + AR_PHY_65NM_CH0_TXRF3_CAPDIV2G); 800 + 801 + quick_drop = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, 802 + AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP); 803 + 804 + if (quick_drop) 805 + quick_drop -= 0x40; 806 + 807 + for (i = 0; i < NUM_BIN + 1; i++) { 808 + if (pa_in[i] == 1400) 809 + count++; 810 + } 811 + 812 + if (AR_SREV_9485(ah)) { 813 + if (pa_in[23] < 800) { 814 + capdiv_offset = (int)((1000 - pa_in[23] + 75) / 150); 815 + capdiv2g += capdiv_offset; 816 + if (capdiv2g > 7) { 817 + capdiv2g = 7; 818 + if (pa_in[23] < 600) { 819 + quick_drop++; 820 + if (quick_drop > 0) 821 + quick_drop = 0; 822 + } 823 + } 824 + } else if (pa_in[23] == 1400) { 825 + quick_drop_offset = min_t(int, count / 3, 2); 826 + quick_drop += quick_drop_offset; 827 + capdiv2g += quick_drop_offset / 2; 828 + 829 + if (capdiv2g > 7) 830 + capdiv2g = 7; 831 + 832 + if (quick_drop > 0) { 833 + quick_drop = 0; 834 + capdiv2g -= quick_drop_offset; 835 + if (capdiv2g < 0) 836 + capdiv2g = 0; 837 + } 838 + } else { 839 + return false; 840 + } 841 + } else if (AR_SREV_9330(ah)) { 842 + if (pa_in[23] < 1000) { 843 + capdiv_offset = (1000 - pa_in[23]) / 100; 844 + capdiv2g += capdiv_offset; 845 + if (capdiv_offset > 3) { 846 + capdiv_offset = 1; 847 + quick_drop--; 848 + } 849 + 850 + capdiv2g += capdiv_offset; 851 + if (capdiv2g > 6) 852 + capdiv2g = 6; 853 + if (quick_drop < -4) 854 + quick_drop = -4; 855 + } else if (pa_in[23] == 1400) { 856 + if (count > 3) { 857 + quick_drop++; 858 + capdiv2g -= count / 4; 859 + if (quick_drop > -2) 860 + quick_drop = -2; 861 + } else { 862 + capdiv2g--; 863 + } 864 + 865 + if (capdiv2g < 0) 866 + capdiv2g = 0; 867 + } else { 868 + return false; 869 + } 870 + } 871 + 872 + REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_TXRF3, 873 + AR_PHY_65NM_CH0_TXRF3_CAPDIV2G, capdiv2g); 874 + REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, 875 + AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, 876 + quick_drop); 877 + 878 + return true; 879 + } 880 + 789 881 int ar9003_paprd_create_curve(struct ath_hw *ah, 790 882 struct ath9k_hw_cal_data *caldata, int chain) 791 883 { ··· 916 816 917 817 if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain)) 918 818 status = -2; 819 + 820 + if (ar9003_paprd_retrain_pa_in(ah, caldata, chain)) 821 + status = -EINPROGRESS; 919 822 920 823 REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, 921 824 AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE);
+4
drivers/net/wireless/ath/ath9k/ar9003_phy.h
··· 625 625 #define AR_PHY_AIC_CTRL_4_B0 (AR_SM_BASE + 0x4c0) 626 626 #define AR_PHY_AIC_STAT_2_B0 (AR_SM_BASE + 0x4cc) 627 627 628 + #define AR_PHY_65NM_CH0_TXRF3 0x16048 629 + #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G 0x0000001e 630 + #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G_S 1 631 + 628 632 #define AR_PHY_65NM_CH0_SYNTH4 0x1608c 629 633 #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002) 630 634 #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1)
+2 -1
drivers/net/wireless/ath/ath9k/gpio.c
··· 341 341 { 342 342 struct ath_btcoex *btcoex = &sc->btcoex; 343 343 344 - ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); 344 + if (btcoex->hw_timer_enabled) 345 + ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); 345 346 } 346 347 347 348 u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen)
+4 -7
drivers/net/wireless/ath/ath9k/hw.c
··· 463 463 ah->config.spurchans[i][1] = AR_NO_SPUR; 464 464 } 465 465 466 - /* PAPRD needs some more work to be enabled */ 467 - ah->config.paprd_disable = 1; 468 - 469 466 ah->config.rx_intr_mitigation = true; 470 467 ah->config.pcieSerDesWrite = true; 471 468 ··· 974 977 imr_reg |= AR_IMR_TXINTM | AR_IMR_TXMINTR; 975 978 else 976 979 imr_reg |= AR_IMR_TXOK; 977 - 978 - if (opmode == NL80211_IFTYPE_AP) 979 - imr_reg |= AR_IMR_MIB; 980 980 981 981 ENABLE_REGWRITE_BUFFER(ah); 982 982 ··· 1772 1778 /* Operating channel changed, reset channel calibration data */ 1773 1779 memset(caldata, 0, sizeof(*caldata)); 1774 1780 ath9k_init_nfcal_hist_buffer(ah, chan); 1781 + } else if (caldata) { 1782 + caldata->paprd_packet_sent = false; 1775 1783 } 1776 1784 ah->noise = ath9k_hw_getchan_noise(ah, chan); 1777 1785 ··· 2498 2502 pCap->tx_desc_len = sizeof(struct ar9003_txc); 2499 2503 pCap->txs_len = sizeof(struct ar9003_txs); 2500 2504 if (!ah->config.paprd_disable && 2501 - ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) 2505 + ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && 2506 + !AR_SREV_9462(ah)) 2502 2507 pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; 2503 2508 } else { 2504 2509 pCap->tx_desc_len = sizeof(struct ath_desc);
+1
drivers/net/wireless/ath/ath9k/hw.h
··· 405 405 int8_t iCoff; 406 406 int8_t qCoff; 407 407 bool rtt_done; 408 + bool paprd_packet_sent; 408 409 bool paprd_done; 409 410 bool nfcal_pending; 410 411 bool nfcal_interference;
+9 -9
drivers/net/wireless/ath/ath9k/link.c
··· 254 254 int chain_ok = 0; 255 255 int chain; 256 256 int len = 1800; 257 + int ret; 257 258 258 - if (!caldata) 259 + if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done) 259 260 return; 260 261 261 262 ath9k_ps_wakeup(sc); ··· 283 282 continue; 284 283 285 284 chain_ok = 0; 286 - 287 - ath_dbg(common, CALIBRATE, 288 - "Sending PAPRD frame for thermal measurement on chain %d\n", 289 - chain); 290 - if (!ath_paprd_send_frame(sc, skb, chain)) 291 - goto fail_paprd; 292 - 293 285 ar9003_paprd_setup_gain_table(ah, chain); 294 286 295 287 ath_dbg(common, CALIBRATE, ··· 296 302 break; 297 303 } 298 304 299 - if (ar9003_paprd_create_curve(ah, caldata, chain)) { 305 + ret = ar9003_paprd_create_curve(ah, caldata, chain); 306 + if (ret == -EINPROGRESS) { 307 + ath_dbg(common, CALIBRATE, 308 + "PAPRD curve on chain %d needs to be re-trained\n", 309 + chain); 310 + break; 311 + } else if (ret) { 300 312 ath_dbg(common, CALIBRATE, 301 313 "PAPRD create curve failed on chain %d\n", 302 314 chain);
+3
drivers/net/wireless/ath/ath9k/xmit.c
··· 2018 2018 2019 2019 ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); 2020 2020 2021 + if (sc->sc_ah->caldata) 2022 + sc->sc_ah->caldata->paprd_packet_sent = true; 2023 + 2021 2024 if (!(tx_flags & ATH_TX_ERROR)) 2022 2025 /* Frame was ACKed */ 2023 2026 tx_info->flags |= IEEE80211_TX_STAT_ACK;
+15 -15
drivers/net/wireless/brcm80211/brcmfmac/usb.c
··· 519 519 else 520 520 devinfo->bus_pub.bus->dstats.tx_errors++; 521 521 522 - dev_kfree_skb(req->skb); 522 + brcmu_pkt_buf_free_skb(req->skb); 523 523 req->skb = NULL; 524 524 brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); 525 525 ··· 540 540 devinfo->bus_pub.bus->dstats.rx_packets++; 541 541 } else { 542 542 devinfo->bus_pub.bus->dstats.rx_errors++; 543 - dev_kfree_skb(skb); 543 + brcmu_pkt_buf_free_skb(skb); 544 544 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); 545 545 return; 546 546 } ··· 550 550 if (brcmf_proto_hdrpull(devinfo->dev, &ifidx, skb) != 0) { 551 551 brcmf_dbg(ERROR, "rx protocol error\n"); 552 552 brcmu_pkt_buf_free_skb(skb); 553 + brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); 553 554 devinfo->bus_pub.bus->dstats.rx_errors++; 554 555 } else { 555 556 brcmf_rx_packet(devinfo->dev, ifidx, skb); 556 557 brcmf_usb_rx_refill(devinfo, req); 557 558 } 558 559 } else { 559 - dev_kfree_skb(skb); 560 + brcmu_pkt_buf_free_skb(skb); 561 + brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); 560 562 } 561 563 return; 562 564 ··· 583 581 usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->rx_pipe, 584 582 skb->data, skb_tailroom(skb), brcmf_usb_rx_complete, 585 583 req); 586 - req->urb->transfer_flags |= URB_ZERO_PACKET; 587 584 req->devinfo = devinfo; 585 + brcmf_usb_enq(devinfo, &devinfo->rx_postq, req); 588 586 589 587 ret = usb_submit_urb(req->urb, GFP_ATOMIC); 590 - if (ret == 0) { 591 - brcmf_usb_enq(devinfo, &devinfo->rx_postq, req); 592 - } else { 593 - dev_kfree_skb(req->skb); 588 + if (ret) { 589 + brcmf_usb_del_fromq(devinfo, req); 590 + brcmu_pkt_buf_free_skb(req->skb); 594 591 req->skb = NULL; 595 592 brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); 596 593 } ··· 684 683 685 684 req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq); 686 685 if (!req) { 686 + brcmu_pkt_buf_free_skb(skb); 687 687 brcmf_dbg(ERROR, "no req to send\n"); 688 688 return -ENOMEM; 689 - } 690 - if (!req->urb) { 691 - brcmf_dbg(ERROR, "no urb for req %p\n", req); 692 - return -ENOBUFS; 693 689 } 694 690 695 691 req->skb = skb; ··· 694 696 usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->tx_pipe, 695 697 skb->data, skb->len, brcmf_usb_tx_complete, req); 696 698 req->urb->transfer_flags |= URB_ZERO_PACKET; 699 + brcmf_usb_enq(devinfo, &devinfo->tx_postq, req); 697 700 ret = usb_submit_urb(req->urb, GFP_ATOMIC); 698 - if (!ret) { 699 - brcmf_usb_enq(devinfo, &devinfo->tx_postq, req); 700 - } else { 701 + if (ret) { 702 + brcmf_dbg(ERROR, "brcmf_usb_tx usb_submit_urb FAILED\n"); 703 + brcmf_usb_del_fromq(devinfo, req); 704 + brcmu_pkt_buf_free_skb(req->skb); 701 705 req->skb = NULL; 702 706 brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); 703 707 }
+8 -7
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 1876 1876 } 1877 1877 1878 1878 if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) { 1879 - scb_val.val = cpu_to_le32(0); 1879 + memset(&scb_val, 0, sizeof(scb_val)); 1880 1880 err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val, 1881 1881 sizeof(struct brcmf_scb_val_le)); 1882 - if (err) 1882 + if (err) { 1883 1883 WL_ERR("Could not get rssi (%d)\n", err); 1884 - 1885 - rssi = le32_to_cpu(scb_val.val); 1886 - sinfo->filled |= STATION_INFO_SIGNAL; 1887 - sinfo->signal = rssi; 1888 - WL_CONN("RSSI %d dBm\n", rssi); 1884 + } else { 1885 + rssi = le32_to_cpu(scb_val.val); 1886 + sinfo->filled |= STATION_INFO_SIGNAL; 1887 + sinfo->signal = rssi; 1888 + WL_CONN("RSSI %d dBm\n", rssi); 1889 + } 1889 1890 } 1890 1891 1891 1892 done:
+5
drivers/net/wireless/libertas/if_sdio.c
··· 1326 1326 1327 1327 mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); 1328 1328 1329 + /* If we're powered off anyway, just let the mmc layer remove the 1330 + * card. */ 1331 + if (!lbs_iface_active(card->priv)) 1332 + return -ENOSYS; 1333 + 1329 1334 dev_info(dev, "%s: suspend: PM flags = 0x%x\n", 1330 1335 sdio_func_id(func), flags); 1331 1336
+14 -1
drivers/net/wireless/mwifiex/cmdevt.c
··· 170 170 cmd_code = le16_to_cpu(host_cmd->command); 171 171 cmd_size = le16_to_cpu(host_cmd->size); 172 172 173 - skb_trim(cmd_node->cmd_skb, cmd_size); 173 + /* Adjust skb length */ 174 + if (cmd_node->cmd_skb->len > cmd_size) 175 + /* 176 + * cmd_size is less than sizeof(struct host_cmd_ds_command). 177 + * Trim off the unused portion. 178 + */ 179 + skb_trim(cmd_node->cmd_skb, cmd_size); 180 + else if (cmd_node->cmd_skb->len < cmd_size) 181 + /* 182 + * cmd_size is larger than sizeof(struct host_cmd_ds_command) 183 + * because we have appended custom IE TLV. Increase skb length 184 + * accordingly. 185 + */ 186 + skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len); 174 187 175 188 do_gettimeofday(&tstamp); 176 189 dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d,"
+9
drivers/net/wireless/rt2x00/rt2400pci.c
··· 1611 1611 static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) 1612 1612 { 1613 1613 int retval; 1614 + u32 reg; 1614 1615 1615 1616 /* 1616 1617 * Allocate eeprom data. ··· 1623 1622 retval = rt2400pci_init_eeprom(rt2x00dev); 1624 1623 if (retval) 1625 1624 return retval; 1625 + 1626 + /* 1627 + * Enable rfkill polling by setting GPIO direction of the 1628 + * rfkill switch GPIO pin correctly. 1629 + */ 1630 + rt2x00pci_register_read(rt2x00dev, GPIOCSR, &reg); 1631 + rt2x00_set_field32(&reg, GPIOCSR_BIT8, 1); 1632 + rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg); 1626 1633 1627 1634 /* 1628 1635 * Initialize hw specifications.
+1
drivers/net/wireless/rt2x00/rt2400pci.h
··· 670 670 #define GPIOCSR_BIT5 FIELD32(0x00000020) 671 671 #define GPIOCSR_BIT6 FIELD32(0x00000040) 672 672 #define GPIOCSR_BIT7 FIELD32(0x00000080) 673 + #define GPIOCSR_BIT8 FIELD32(0x00000100) 673 674 674 675 /* 675 676 * BBPPCSR: BBP Pin control register.
+9
drivers/net/wireless/rt2x00/rt2500pci.c
··· 1929 1929 static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) 1930 1930 { 1931 1931 int retval; 1932 + u32 reg; 1932 1933 1933 1934 /* 1934 1935 * Allocate eeprom data. ··· 1941 1940 retval = rt2500pci_init_eeprom(rt2x00dev); 1942 1941 if (retval) 1943 1942 return retval; 1943 + 1944 + /* 1945 + * Enable rfkill polling by setting GPIO direction of the 1946 + * rfkill switch GPIO pin correctly. 1947 + */ 1948 + rt2x00pci_register_read(rt2x00dev, GPIOCSR, &reg); 1949 + rt2x00_set_field32(&reg, GPIOCSR_DIR0, 1); 1950 + rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg); 1944 1951 1945 1952 /* 1946 1953 * Initialize hw specifications.
+10 -1
drivers/net/wireless/rt2x00/rt2500usb.c
··· 283 283 u16 reg; 284 284 285 285 rt2500usb_register_read(rt2x00dev, MAC_CSR19, &reg); 286 - return rt2x00_get_field32(reg, MAC_CSR19_BIT7); 286 + return rt2x00_get_field16(reg, MAC_CSR19_BIT7); 287 287 } 288 288 289 289 #ifdef CONFIG_RT2X00_LIB_LEDS ··· 1768 1768 static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) 1769 1769 { 1770 1770 int retval; 1771 + u16 reg; 1771 1772 1772 1773 /* 1773 1774 * Allocate eeprom data. ··· 1780 1779 retval = rt2500usb_init_eeprom(rt2x00dev); 1781 1780 if (retval) 1782 1781 return retval; 1782 + 1783 + /* 1784 + * Enable rfkill polling by setting GPIO direction of the 1785 + * rfkill switch GPIO pin correctly. 1786 + */ 1787 + rt2500usb_register_read(rt2x00dev, MAC_CSR19, &reg); 1788 + rt2x00_set_field16(&reg, MAC_CSR19_BIT8, 0); 1789 + rt2500usb_register_write(rt2x00dev, MAC_CSR19, reg); 1783 1790 1784 1791 /* 1785 1792 * Initialize hw specifications.
+9 -8
drivers/net/wireless/rt2x00/rt2500usb.h
··· 189 189 * MAC_CSR19: GPIO control register. 190 190 */ 191 191 #define MAC_CSR19 0x0426 192 - #define MAC_CSR19_BIT0 FIELD32(0x0001) 193 - #define MAC_CSR19_BIT1 FIELD32(0x0002) 194 - #define MAC_CSR19_BIT2 FIELD32(0x0004) 195 - #define MAC_CSR19_BIT3 FIELD32(0x0008) 196 - #define MAC_CSR19_BIT4 FIELD32(0x0010) 197 - #define MAC_CSR19_BIT5 FIELD32(0x0020) 198 - #define MAC_CSR19_BIT6 FIELD32(0x0040) 199 - #define MAC_CSR19_BIT7 FIELD32(0x0080) 192 + #define MAC_CSR19_BIT0 FIELD16(0x0001) 193 + #define MAC_CSR19_BIT1 FIELD16(0x0002) 194 + #define MAC_CSR19_BIT2 FIELD16(0x0004) 195 + #define MAC_CSR19_BIT3 FIELD16(0x0008) 196 + #define MAC_CSR19_BIT4 FIELD16(0x0010) 197 + #define MAC_CSR19_BIT5 FIELD16(0x0020) 198 + #define MAC_CSR19_BIT6 FIELD16(0x0040) 199 + #define MAC_CSR19_BIT7 FIELD16(0x0080) 200 + #define MAC_CSR19_BIT8 FIELD16(0x0100) 200 201 201 202 /* 202 203 * MAC_CSR20: LED control register.
+1
drivers/net/wireless/rt2x00/rt2800lib.c
··· 4089 4089 rt2800_register_write(rt2x00dev, LDO_CFG0, reg); 4090 4090 msleep(1); 4091 4091 rt2800_register_read(rt2x00dev, LDO_CFG0, &reg); 4092 + rt2x00_set_field32(&reg, LDO_CFG0_LDO_CORE_VLEVEL, 0); 4092 4093 rt2x00_set_field32(&reg, LDO_CFG0_BGSEL, 1); 4093 4094 rt2800_register_write(rt2x00dev, LDO_CFG0, reg); 4094 4095 }
+9
drivers/net/wireless/rt2x00/rt2800pci.c
··· 983 983 static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) 984 984 { 985 985 int retval; 986 + u32 reg; 986 987 987 988 /* 988 989 * Allocate eeprom data. ··· 995 994 retval = rt2800_init_eeprom(rt2x00dev); 996 995 if (retval) 997 996 return retval; 997 + 998 + /* 999 + * Enable rfkill polling by setting GPIO direction of the 1000 + * rfkill switch GPIO pin correctly. 1001 + */ 1002 + rt2x00pci_register_read(rt2x00dev, GPIO_CTRL_CFG, &reg); 1003 + rt2x00_set_field32(&reg, GPIO_CTRL_CFG_GPIOD_BIT2, 1); 1004 + rt2x00pci_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); 998 1005 999 1006 /* 1000 1007 * Initialize hw specifications.
+20 -2
drivers/net/wireless/rt2x00/rt2800usb.c
··· 667 667 skb_pull(entry->skb, RXINFO_DESC_SIZE); 668 668 669 669 /* 670 - * FIXME: we need to check for rx_pkt_len validity 670 + * Check for rx_pkt_len validity. Return if invalid, leaving 671 + * rxdesc->size zeroed out by the upper level. 671 672 */ 673 + if (unlikely(rx_pkt_len == 0 || 674 + rx_pkt_len > entry->queue->data_size)) { 675 + ERROR(entry->queue->rt2x00dev, 676 + "Bad frame size %d, forcing to 0\n", rx_pkt_len); 677 + return; 678 + } 679 + 672 680 rxd = (__le32 *)(entry->skb->data + rx_pkt_len); 673 681 674 682 /* ··· 744 736 static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) 745 737 { 746 738 int retval; 739 + u32 reg; 747 740 748 741 /* 749 742 * Allocate eeprom data. ··· 756 747 retval = rt2800_init_eeprom(rt2x00dev); 757 748 if (retval) 758 749 return retval; 750 + 751 + /* 752 + * Enable rfkill polling by setting GPIO direction of the 753 + * rfkill switch GPIO pin correctly. 754 + */ 755 + rt2x00usb_register_read(rt2x00dev, GPIO_CTRL_CFG, &reg); 756 + rt2x00_set_field32(&reg, GPIO_CTRL_CFG_GPIOD_BIT2, 1); 757 + rt2x00usb_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); 759 758 760 759 /* 761 760 * Initialize hw specifications. ··· 1174 1157 { USB_DEVICE(0x1690, 0x0744) }, 1175 1158 { USB_DEVICE(0x1690, 0x0761) }, 1176 1159 { USB_DEVICE(0x1690, 0x0764) }, 1160 + /* ASUS */ 1161 + { USB_DEVICE(0x0b05, 0x179d) }, 1177 1162 /* Cisco */ 1178 1163 { USB_DEVICE(0x167b, 0x4001) }, 1179 1164 /* EnGenius */ ··· 1241 1222 { USB_DEVICE(0x0b05, 0x1760) }, 1242 1223 { USB_DEVICE(0x0b05, 0x1761) }, 1243 1224 { USB_DEVICE(0x0b05, 0x1790) }, 1244 - { USB_DEVICE(0x0b05, 0x179d) }, 1245 1225 /* AzureWave */ 1246 1226 { USB_DEVICE(0x13d3, 0x3262) }, 1247 1227 { USB_DEVICE(0x13d3, 0x3284) },
+1 -1
drivers/net/wireless/rt2x00/rt2x00dev.c
··· 629 629 */ 630 630 if (unlikely(rxdesc.size == 0 || 631 631 rxdesc.size > entry->queue->data_size)) { 632 - WARNING(rt2x00dev, "Wrong frame size %d max %d.\n", 632 + ERROR(rt2x00dev, "Wrong frame size %d max %d.\n", 633 633 rxdesc.size, entry->queue->data_size); 634 634 dev_kfree_skb(entry->skb); 635 635 goto renew_skb;
+9
drivers/net/wireless/rt2x00/rt61pci.c
··· 2832 2832 static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) 2833 2833 { 2834 2834 int retval; 2835 + u32 reg; 2835 2836 2836 2837 /* 2837 2838 * Disable power saving. ··· 2849 2848 retval = rt61pci_init_eeprom(rt2x00dev); 2850 2849 if (retval) 2851 2850 return retval; 2851 + 2852 + /* 2853 + * Enable rfkill polling by setting GPIO direction of the 2854 + * rfkill switch GPIO pin correctly. 2855 + */ 2856 + rt2x00pci_register_read(rt2x00dev, MAC_CSR13, &reg); 2857 + rt2x00_set_field32(&reg, MAC_CSR13_BIT13, 1); 2858 + rt2x00pci_register_write(rt2x00dev, MAC_CSR13, reg); 2852 2859 2853 2860 /* 2854 2861 * Initialize hw specifications.
+1
drivers/net/wireless/rt2x00/rt61pci.h
··· 372 372 #define MAC_CSR13_BIT10 FIELD32(0x00000400) 373 373 #define MAC_CSR13_BIT11 FIELD32(0x00000800) 374 374 #define MAC_CSR13_BIT12 FIELD32(0x00001000) 375 + #define MAC_CSR13_BIT13 FIELD32(0x00002000) 375 376 376 377 /* 377 378 * MAC_CSR14: LED control register.
+9
drivers/net/wireless/rt2x00/rt73usb.c
··· 2177 2177 static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) 2178 2178 { 2179 2179 int retval; 2180 + u32 reg; 2180 2181 2181 2182 /* 2182 2183 * Allocate eeprom data. ··· 2189 2188 retval = rt73usb_init_eeprom(rt2x00dev); 2190 2189 if (retval) 2191 2190 return retval; 2191 + 2192 + /* 2193 + * Enable rfkill polling by setting GPIO direction of the 2194 + * rfkill switch GPIO pin correctly. 2195 + */ 2196 + rt2x00usb_register_read(rt2x00dev, MAC_CSR13, &reg); 2197 + rt2x00_set_field32(&reg, MAC_CSR13_BIT15, 0); 2198 + rt2x00usb_register_write(rt2x00dev, MAC_CSR13, reg); 2192 2199 2193 2200 /* 2194 2201 * Initialize hw specifications.
+3
drivers/net/wireless/rt2x00/rt73usb.h
··· 282 282 #define MAC_CSR13_BIT10 FIELD32(0x00000400) 283 283 #define MAC_CSR13_BIT11 FIELD32(0x00000800) 284 284 #define MAC_CSR13_BIT12 FIELD32(0x00001000) 285 + #define MAC_CSR13_BIT13 FIELD32(0x00002000) 286 + #define MAC_CSR13_BIT14 FIELD32(0x00004000) 287 + #define MAC_CSR13_BIT15 FIELD32(0x00008000) 285 288 286 289 /* 287 290 * MAC_CSR14: LED control register.
-2
drivers/platform/x86/acer-wmi.c
··· 2196 2196 interface->capability &= ~ACER_CAP_BRIGHTNESS; 2197 2197 pr_info("Brightness must be controlled by acpi video driver\n"); 2198 2198 } else { 2199 - #ifdef CONFIG_ACPI_VIDEO 2200 2199 pr_info("Disabling ACPI video driver\n"); 2201 2200 acpi_video_unregister(); 2202 - #endif 2203 2201 } 2204 2202 2205 2203 if (wmi_has_guid(WMID_GUID3)) {
+13 -11
drivers/platform/x86/apple-gmux.c
··· 101 101 102 102 for (i = 0; i < 4; i++) { 103 103 tmpval = (val >> (i * 8)) & 0xff; 104 - outb(tmpval, port + i); 104 + outb(tmpval, gmux_data->iostart + port + i); 105 105 } 106 106 } 107 107 ··· 142 142 u8 val; 143 143 144 144 mutex_lock(&gmux_data->index_lock); 145 - outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); 146 145 gmux_index_wait_ready(gmux_data); 146 + outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); 147 + gmux_index_wait_complete(gmux_data); 147 148 val = inb(gmux_data->iostart + GMUX_PORT_VALUE); 148 149 mutex_unlock(&gmux_data->index_lock); 149 150 ··· 167 166 u32 val; 168 167 169 168 mutex_lock(&gmux_data->index_lock); 170 - outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); 171 169 gmux_index_wait_ready(gmux_data); 170 + outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ); 171 + gmux_index_wait_complete(gmux_data); 172 172 val = inl(gmux_data->iostart + GMUX_PORT_VALUE); 173 173 mutex_unlock(&gmux_data->index_lock); 174 174 ··· 463 461 ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE); 464 462 if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) { 465 463 if (gmux_is_indexed(gmux_data)) { 464 + u32 version; 466 465 mutex_init(&gmux_data->index_lock); 467 466 gmux_data->indexed = true; 467 + version = gmux_read32(gmux_data, 468 + GMUX_PORT_VERSION_MAJOR); 469 + ver_major = (version >> 24) & 0xff; 470 + ver_minor = (version >> 16) & 0xff; 471 + ver_release = (version >> 8) & 0xff; 468 472 } else { 469 473 pr_info("gmux device not present\n"); 470 474 ret = -ENODEV; 471 475 goto err_release; 472 476 } 473 - pr_info("Found indexed gmux\n"); 474 - } else { 475 - pr_info("Found gmux version %d.%d.%d\n", ver_major, ver_minor, 476 - ver_release); 477 477 } 478 + pr_info("Found gmux version %d.%d.%d [%s]\n", ver_major, ver_minor, 479 + ver_release, (gmux_data->indexed ? "indexed" : "classic")); 478 480 479 481 memset(&props, 0, sizeof(props)); 480 482 props.type = BACKLIGHT_PLATFORM; ··· 511 505 * Disable the other backlight choices. 512 506 */ 513 507 acpi_video_dmi_promote_vendor(); 514 - #if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE) 515 508 acpi_video_unregister(); 516 - #endif 517 509 apple_bl_unregister(); 518 510 519 511 gmux_data->power_state = VGA_SWITCHEROO_ON; ··· 597 593 kfree(gmux_data); 598 594 599 595 acpi_video_dmi_demote_vendor(); 600 - #if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE) 601 596 acpi_video_register(); 602 - #endif 603 597 apple_bl_register(); 604 598 } 605 599
+5 -5
drivers/platform/x86/asus-laptop.c
··· 85 85 static char *bled_type = "unknown"; 86 86 87 87 module_param(wled_type, charp, 0444); 88 - MODULE_PARM_DESC(wlan_status, "Set the wled type on boot " 88 + MODULE_PARM_DESC(wled_type, "Set the wled type on boot " 89 89 "(unknown, led or rfkill). " 90 90 "default is unknown"); 91 91 ··· 863 863 * The significance of others is yet to be found. 864 864 * If we don't find the method, we assume the device are present. 865 865 */ 866 - rv = acpi_evaluate_integer(asus->handle, "HRWS", NULL, &temp); 866 + rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp); 867 867 if (!ACPI_FAILURE(rv)) 868 - len += sprintf(page + len, "HRWS value : %#x\n", 868 + len += sprintf(page + len, "HWRS value : %#x\n", 869 869 (uint) temp); 870 870 /* 871 871 * Another value for userspace: the ASYM method returns 0x02 for ··· 1751 1751 * The significance of others is yet to be found. 1752 1752 */ 1753 1753 status = 1754 - acpi_evaluate_integer(asus->handle, "HRWS", NULL, &hwrs_result); 1754 + acpi_evaluate_integer(asus->handle, "HWRS", NULL, &hwrs_result); 1755 1755 if (!ACPI_FAILURE(status)) 1756 - pr_notice(" HRWS returned %x", (int)hwrs_result); 1756 + pr_notice(" HWRS returned %x", (int)hwrs_result); 1757 1757 1758 1758 if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL)) 1759 1759 asus->have_rsts = true;
-4
drivers/platform/x86/asus-wmi.c
··· 47 47 #include <linux/thermal.h> 48 48 #include <acpi/acpi_bus.h> 49 49 #include <acpi/acpi_drivers.h> 50 - #ifdef CONFIG_ACPI_VIDEO 51 50 #include <acpi/video.h> 52 - #endif 53 51 54 52 #include "asus-wmi.h" 55 53 ··· 1702 1704 if (asus->driver->quirks->wmi_backlight_power) 1703 1705 acpi_video_dmi_promote_vendor(); 1704 1706 if (!acpi_video_backlight_support()) { 1705 - #ifdef CONFIG_ACPI_VIDEO 1706 1707 pr_info("Disabling ACPI video driver\n"); 1707 1708 acpi_video_unregister(); 1708 - #endif 1709 1709 err = asus_wmi_backlight_init(asus); 1710 1710 if (err && err != -ENODEV) 1711 1711 goto fail_backlight;
+6 -4
drivers/platform/x86/eeepc-laptop.c
··· 610 610 611 611 if (!bus) { 612 612 pr_warn("Unable to find PCI bus 1?\n"); 613 - goto out_unlock; 613 + goto out_put_dev; 614 614 } 615 615 616 616 if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) { 617 617 pr_err("Unable to read PCI config space?\n"); 618 - goto out_unlock; 618 + goto out_put_dev; 619 619 } 620 620 621 621 absent = (l == 0xffffffff); ··· 627 627 absent ? "absent" : "present"); 628 628 pr_warn("skipped wireless hotplug as probably " 629 629 "inappropriate for this model\n"); 630 - goto out_unlock; 630 + goto out_put_dev; 631 631 } 632 632 633 633 if (!blocked) { ··· 635 635 if (dev) { 636 636 /* Device already present */ 637 637 pci_dev_put(dev); 638 - goto out_unlock; 638 + goto out_put_dev; 639 639 } 640 640 dev = pci_scan_single_device(bus, 0); 641 641 if (dev) { ··· 650 650 pci_dev_put(dev); 651 651 } 652 652 } 653 + out_put_dev: 654 + pci_dev_put(port); 653 655 } 654 656 655 657 out_unlock:
-4
drivers/platform/x86/samsung-laptop.c
··· 26 26 #include <linux/seq_file.h> 27 27 #include <linux/debugfs.h> 28 28 #include <linux/ctype.h> 29 - #ifdef CONFIG_ACPI_VIDEO 30 29 #include <acpi/video.h> 31 - #endif 32 30 33 31 /* 34 32 * This driver is needed because a number of Samsung laptops do not hook ··· 1556 1558 samsung->handle_backlight = false; 1557 1559 } else if (samsung->quirks->broken_acpi_video) { 1558 1560 pr_info("Disabling ACPI video driver\n"); 1559 - #ifdef CONFIG_ACPI_VIDEO 1560 1561 acpi_video_unregister(); 1561 - #endif 1562 1562 } 1563 1563 #endif 1564 1564
+7 -6
drivers/platform/x86/thinkpad_acpi.c
··· 545 545 */ 546 546 547 547 static int acpi_evalf(acpi_handle handle, 548 - void *res, char *method, char *fmt, ...) 548 + int *res, char *method, char *fmt, ...) 549 549 { 550 550 char *fmt0 = fmt; 551 551 struct acpi_object_list params; ··· 606 606 success = (status == AE_OK && 607 607 out_obj.type == ACPI_TYPE_INTEGER); 608 608 if (success && res) 609 - *(int *)res = out_obj.integer.value; 609 + *res = out_obj.integer.value; 610 610 break; 611 611 case 'v': /* void */ 612 612 success = status == AE_OK; ··· 7386 7386 * Add TPACPI_FAN_RD_ACPI_FANS ? */ 7387 7387 7388 7388 switch (fan_status_access_mode) { 7389 - case TPACPI_FAN_RD_ACPI_GFAN: 7389 + case TPACPI_FAN_RD_ACPI_GFAN: { 7390 7390 /* 570, 600e/x, 770e, 770x */ 7391 + int res; 7391 7392 7392 - if (unlikely(!acpi_evalf(gfan_handle, &s, NULL, "d"))) 7393 + if (unlikely(!acpi_evalf(gfan_handle, &res, NULL, "d"))) 7393 7394 return -EIO; 7394 7395 7395 7396 if (likely(status)) 7396 - *status = s & 0x07; 7397 + *status = res & 0x07; 7397 7398 7398 7399 break; 7399 - 7400 + } 7400 7401 case TPACPI_FAN_RD_TPEC: 7401 7402 /* all except 570, 600e/x, 770e, 770x */ 7402 7403 if (unlikely(!acpi_ec_read(fan_status_offset, &s)))
+7
drivers/pwm/pwm-tiecap.c
··· 100 100 writel(period_cycles, pc->mmio_base + CAP3); 101 101 } 102 102 103 + if (!test_bit(PWMF_ENABLED, &pwm->flags)) { 104 + reg_val = readw(pc->mmio_base + ECCTL2); 105 + /* Disable APWM mode to put APWM output Low */ 106 + reg_val &= ~ECCTL2_APWM_MODE; 107 + writew(reg_val, pc->mmio_base + ECCTL2); 108 + } 109 + 103 110 pm_runtime_put_sync(pc->chip.dev); 104 111 return 0; 105 112 }
+29
drivers/pwm/pwm-tiehrpwm.c
··· 104 104 struct pwm_chip chip; 105 105 unsigned int clk_rate; 106 106 void __iomem *mmio_base; 107 + unsigned long period_cycles[NUM_PWM_CHANNEL]; 107 108 }; 108 109 109 110 static inline struct ehrpwm_pwm_chip *to_ehrpwm_pwm_chip(struct pwm_chip *chip) ··· 211 210 unsigned long long c; 212 211 unsigned long period_cycles, duty_cycles; 213 212 unsigned short ps_divval, tb_divval; 213 + int i; 214 214 215 215 if (period_ns < 0 || duty_ns < 0 || period_ns > NSEC_PER_SEC) 216 216 return -ERANGE; ··· 230 228 do_div(c, NSEC_PER_SEC); 231 229 duty_cycles = (unsigned long)c; 232 230 } 231 + 232 + /* 233 + * Period values should be same for multiple PWM channels as IP uses 234 + * same period register for multiple channels. 235 + */ 236 + for (i = 0; i < NUM_PWM_CHANNEL; i++) { 237 + if (pc->period_cycles[i] && 238 + (pc->period_cycles[i] != period_cycles)) { 239 + /* 240 + * Allow channel to reconfigure period if no other 241 + * channels being configured. 242 + */ 243 + if (i == pwm->hwpwm) 244 + continue; 245 + 246 + dev_err(chip->dev, "Period value conflicts with channel %d\n", 247 + i); 248 + return -EINVAL; 249 + } 250 + } 251 + 252 + pc->period_cycles[pwm->hwpwm] = period_cycles; 233 253 234 254 /* Configure clock prescaler to support Low frequency PWM wave */ 235 255 if (set_prescale_div(period_cycles/PERIOD_MAX, &ps_divval, ··· 344 320 345 321 static void ehrpwm_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) 346 322 { 323 + struct ehrpwm_pwm_chip *pc = to_ehrpwm_pwm_chip(chip); 324 + 347 325 if (test_bit(PWMF_ENABLED, &pwm->flags)) { 348 326 dev_warn(chip->dev, "Removing PWM device without disabling\n"); 349 327 pm_runtime_put_sync(chip->dev); 350 328 } 329 + 330 + /* set period value to zero on free */ 331 + pc->period_cycles[pwm->hwpwm] = 0; 351 332 } 352 333 353 334 static const struct pwm_ops ehrpwm_pwm_ops = {
+109 -15
drivers/regulator/tps65217-regulator.c
··· 22 22 #include <linux/err.h> 23 23 #include <linux/platform_device.h> 24 24 25 + #include <linux/regulator/of_regulator.h> 25 26 #include <linux/regulator/driver.h> 26 27 #include <linux/regulator/machine.h> 27 28 #include <linux/mfd/tps65217.h> ··· 282 281 NULL), 283 282 }; 284 283 284 + #ifdef CONFIG_OF 285 + static struct of_regulator_match reg_matches[] = { 286 + { .name = "dcdc1", .driver_data = (void *)TPS65217_DCDC_1 }, 287 + { .name = "dcdc2", .driver_data = (void *)TPS65217_DCDC_2 }, 288 + { .name = "dcdc3", .driver_data = (void *)TPS65217_DCDC_3 }, 289 + { .name = "ldo1", .driver_data = (void *)TPS65217_LDO_1 }, 290 + { .name = "ldo2", .driver_data = (void *)TPS65217_LDO_2 }, 291 + { .name = "ldo3", .driver_data = (void *)TPS65217_LDO_3 }, 292 + { .name = "ldo4", .driver_data = (void *)TPS65217_LDO_4 }, 293 + }; 294 + 295 + static struct tps65217_board *tps65217_parse_dt(struct platform_device *pdev) 296 + { 297 + struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); 298 + struct device_node *node = tps->dev->of_node; 299 + struct tps65217_board *pdata; 300 + struct device_node *regs; 301 + int i, count; 302 + 303 + regs = of_find_node_by_name(node, "regulators"); 304 + if (!regs) 305 + return NULL; 306 + 307 + count = of_regulator_match(pdev->dev.parent, regs, 308 + reg_matches, TPS65217_NUM_REGULATOR); 309 + of_node_put(regs); 310 + if ((count < 0) || (count > TPS65217_NUM_REGULATOR)) 311 + return NULL; 312 + 313 + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 314 + if (!pdata) 315 + return NULL; 316 + 317 + for (i = 0; i < count; i++) { 318 + if (!reg_matches[i].init_data || !reg_matches[i].of_node) 319 + continue; 320 + 321 + pdata->tps65217_init_data[i] = reg_matches[i].init_data; 322 + pdata->of_node[i] = reg_matches[i].of_node; 323 + } 324 + 325 + return pdata; 326 + } 327 + #else 328 + static struct tps65217_board *tps65217_parse_dt(struct platform_device *pdev) 329 + { 330 + return NULL; 331 + } 332 + #endif 333 + 285 334 static int __devinit tps65217_regulator_probe(struct platform_device *pdev) 286 335 { 336 + struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); 337 + struct tps65217_board *pdata = dev_get_platdata(tps->dev); 338 + struct regulator_init_data *reg_data; 287 339 struct regulator_dev *rdev; 288 - struct tps65217 *tps; 289 - struct tps_info *info = &tps65217_pmic_regs[pdev->id]; 290 340 struct regulator_config config = { }; 341 + int i, ret; 291 342 292 - /* Already set by core driver */ 293 - tps = dev_to_tps65217(pdev->dev.parent); 294 - tps->info[pdev->id] = info; 343 + if (tps->dev->of_node) 344 + pdata = tps65217_parse_dt(pdev); 295 345 296 - config.dev = &pdev->dev; 297 - config.of_node = pdev->dev.of_node; 298 - config.init_data = pdev->dev.platform_data; 299 - config.driver_data = tps; 346 + if (!pdata) { 347 + dev_err(&pdev->dev, "Platform data not found\n"); 348 + return -EINVAL; 349 + } 300 350 301 - rdev = regulator_register(&regulators[pdev->id], &config); 302 - if (IS_ERR(rdev)) 303 - return PTR_ERR(rdev); 351 + if (tps65217_chip_id(tps) != TPS65217) { 352 + dev_err(&pdev->dev, "Invalid tps chip version\n"); 353 + return -ENODEV; 354 + } 304 355 305 - platform_set_drvdata(pdev, rdev); 356 + platform_set_drvdata(pdev, tps); 306 357 358 + for (i = 0; i < TPS65217_NUM_REGULATOR; i++) { 359 + 360 + reg_data = pdata->tps65217_init_data[i]; 361 + 362 + /* 363 + * Regulator API handles empty constraints but not NULL 364 + * constraints 365 + */ 366 + if (!reg_data) 367 + continue; 368 + 369 + /* Register the regulators */ 370 + tps->info[i] = &tps65217_pmic_regs[i]; 371 + 372 + config.dev = tps->dev; 373 + config.init_data = reg_data; 374 + config.driver_data = tps; 375 + config.regmap = tps->regmap; 376 + if (tps->dev->of_node) 377 + config.of_node = pdata->of_node[i]; 378 + 379 + rdev = regulator_register(&regulators[i], &config); 380 + if (IS_ERR(rdev)) { 381 + dev_err(tps->dev, "failed to register %s regulator\n", 382 + pdev->name); 383 + ret = PTR_ERR(rdev); 384 + goto err_unregister_regulator; 385 + } 386 + 387 + /* Save regulator for cleanup */ 388 + tps->rdev[i] = rdev; 389 + } 307 390 return 0; 391 + 392 + err_unregister_regulator: 393 + while (--i >= 0) 394 + regulator_unregister(tps->rdev[i]); 395 + 396 + return ret; 308 397 } 309 398 310 399 static int __devexit tps65217_regulator_remove(struct platform_device *pdev) 311 400 { 312 - struct regulator_dev *rdev = platform_get_drvdata(pdev); 401 + struct tps65217 *tps = platform_get_drvdata(pdev); 402 + unsigned int i; 403 + 404 + for (i = 0; i < TPS65217_NUM_REGULATOR; i++) 405 + regulator_unregister(tps->rdev[i]); 313 406 314 407 platform_set_drvdata(pdev, NULL); 315 - regulator_unregister(rdev); 316 408 317 409 return 0; 318 410 }
-6
drivers/rtc/rtc-ab8500.c
··· 462 462 return 0; 463 463 } 464 464 465 - static const struct of_device_id ab8500_rtc_match[] = { 466 - { .compatible = "stericsson,ab8500-rtc", }, 467 - {} 468 - }; 469 - 470 465 static struct platform_driver ab8500_rtc_driver = { 471 466 .driver = { 472 467 .name = "ab8500-rtc", 473 468 .owner = THIS_MODULE, 474 - .of_match_table = ab8500_rtc_match, 475 469 }, 476 470 .probe = ab8500_rtc_probe, 477 471 .remove = __devexit_p(ab8500_rtc_remove),
+2 -1
drivers/scsi/megaraid/megaraid_sas_base.c
··· 4066 4066 spin_lock_init(&instance->cmd_pool_lock); 4067 4067 spin_lock_init(&instance->hba_lock); 4068 4068 spin_lock_init(&instance->completion_lock); 4069 - spin_lock_init(&poll_aen_lock); 4070 4069 4071 4070 mutex_init(&instance->aen_mutex); 4072 4071 mutex_init(&instance->reset_mutex); ··· 5390 5391 */ 5391 5392 printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION, 5392 5393 MEGASAS_EXT_VERSION); 5394 + 5395 + spin_lock_init(&poll_aen_lock); 5393 5396 5394 5397 support_poll_for_event = 2; 5395 5398 support_device_change = 1;
+8 -5
drivers/scsi/mpt2sas/mpt2sas_base.c
··· 2424 2424 } 2425 2425 2426 2426 /* command line tunables for max controller queue depth */ 2427 - if (max_queue_depth != -1) 2428 - max_request_credit = (max_queue_depth < facts->RequestCredit) 2429 - ? max_queue_depth : facts->RequestCredit; 2430 - else 2427 + if (max_queue_depth != -1 && max_queue_depth != 0) { 2428 + max_request_credit = min_t(u16, max_queue_depth + 2429 + ioc->hi_priority_depth + ioc->internal_depth, 2430 + facts->RequestCredit); 2431 + if (max_request_credit > MAX_HBA_QUEUE_DEPTH) 2432 + max_request_credit = MAX_HBA_QUEUE_DEPTH; 2433 + } else 2431 2434 max_request_credit = min_t(u16, facts->RequestCredit, 2432 2435 MAX_HBA_QUEUE_DEPTH); 2433 2436 ··· 2505 2502 /* set the scsi host can_queue depth 2506 2503 * with some internal commands that could be outstanding 2507 2504 */ 2508 - ioc->shost->can_queue = ioc->scsiio_depth - (2); 2505 + ioc->shost->can_queue = ioc->scsiio_depth; 2509 2506 dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scsi host: " 2510 2507 "can_queue depth (%d)\n", ioc->name, ioc->shost->can_queue)); 2511 2508
+10
drivers/scsi/scsi_error.c
··· 42 42 43 43 #include <trace/events/scsi.h> 44 44 45 + static void scsi_eh_done(struct scsi_cmnd *scmd); 46 + 45 47 #define SENSE_TIMEOUT (10*HZ) 46 48 47 49 /* ··· 242 240 243 241 if (! scsi_command_normalize_sense(scmd, &sshdr)) 244 242 return FAILED; /* no valid sense data */ 243 + 244 + if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done) 245 + /* 246 + * nasty: for mid-layer issued TURs, we need to return the 247 + * actual sense data without any recovery attempt. For eh 248 + * issued ones, we need to try to recover and interpret 249 + */ 250 + return SUCCESS; 245 251 246 252 if (scsi_sense_is_deferred(&sshdr)) 247 253 return NEEDS_RETRY;
+4 -1
drivers/scsi/scsi_lib.c
··· 776 776 } 777 777 778 778 if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */ 779 - req->errors = result; 780 779 if (result) { 781 780 if (sense_valid && req->sense) { 782 781 /* ··· 791 792 if (!sense_deferred) 792 793 error = __scsi_error_from_host_byte(cmd, result); 793 794 } 795 + /* 796 + * __scsi_error_from_host_byte may have reset the host_byte 797 + */ 798 + req->errors = cmd->result; 794 799 795 800 req->resid_len = scsi_get_resid(cmd); 796 801
+10
drivers/scsi/scsi_scan.c
··· 764 764 sdev->model = (char *) (sdev->inquiry + 16); 765 765 sdev->rev = (char *) (sdev->inquiry + 32); 766 766 767 + if (strncmp(sdev->vendor, "ATA ", 8) == 0) { 768 + /* 769 + * sata emulation layer device. This is a hack to work around 770 + * the SATL power management specifications which state that 771 + * when the SATL detects the device has gone into standby 772 + * mode, it shall respond with NOT READY. 773 + */ 774 + sdev->allow_restart = 1; 775 + } 776 + 767 777 if (*bflags & BLIST_ISROM) { 768 778 sdev->type = TYPE_ROM; 769 779 sdev->removable = 1;
+3 -1
drivers/staging/android/android_alarm.h
··· 51 51 #define ANDROID_ALARM_WAIT _IO('a', 1) 52 52 53 53 #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) 54 + #define ALARM_IOR(c, type, size) _IOR('a', (c) | ((type) << 4), size) 55 + 54 56 /* Set alarm */ 55 57 #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) 56 58 #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) 57 - #define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec) 59 + #define ANDROID_ALARM_GET_TIME(type) ALARM_IOR(4, type, struct timespec) 58 60 #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) 59 61 #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) 60 62 #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)
+7
drivers/staging/comedi/drivers/amplc_dio200.c
··· 1412 1412 dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); 1413 1413 return -EINVAL; 1414 1414 } 1415 + /* 1416 + * Need to 'get' the PCI device to match the 'put' in dio200_detach(). 1417 + * TODO: Remove the pci_dev_get() and matching pci_dev_put() once 1418 + * support for manual attachment of PCI devices via dio200_attach() 1419 + * has been removed. 1420 + */ 1421 + pci_dev_get(pci_dev); 1415 1422 return dio200_pci_common_attach(dev, pci_dev); 1416 1423 } 1417 1424
+7
drivers/staging/comedi/drivers/amplc_pc236.c
··· 565 565 dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); 566 566 return -EINVAL; 567 567 } 568 + /* 569 + * Need to 'get' the PCI device to match the 'put' in pc236_detach(). 570 + * TODO: Remove the pci_dev_get() and matching pci_dev_put() once 571 + * support for manual attachment of PCI devices via pc236_attach() 572 + * has been removed. 573 + */ 574 + pci_dev_get(pci_dev); 568 575 return pc236_pci_common_attach(dev, pci_dev); 569 576 } 570 577
+7
drivers/staging/comedi/drivers/amplc_pc263.c
··· 298 298 dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); 299 299 return -EINVAL; 300 300 } 301 + /* 302 + * Need to 'get' the PCI device to match the 'put' in pc263_detach(). 303 + * TODO: Remove the pci_dev_get() and matching pci_dev_put() once 304 + * support for manual attachment of PCI devices via pc263_attach() 305 + * has been removed. 306 + */ 307 + pci_dev_get(pci_dev); 301 308 return pc263_pci_common_attach(dev, pci_dev); 302 309 } 303 310
+7
drivers/staging/comedi/drivers/amplc_pci224.c
··· 1503 1503 DRIVER_NAME ": BUG! cannot determine board type!\n"); 1504 1504 return -EINVAL; 1505 1505 } 1506 + /* 1507 + * Need to 'get' the PCI device to match the 'put' in pci224_detach(). 1508 + * TODO: Remove the pci_dev_get() and matching pci_dev_put() once 1509 + * support for manual attachment of PCI devices via pci224_attach() 1510 + * has been removed. 1511 + */ 1512 + pci_dev_get(pci_dev); 1506 1513 return pci224_attach_common(dev, pci_dev, NULL); 1507 1514 } 1508 1515
+7
drivers/staging/comedi/drivers/amplc_pci230.c
··· 2925 2925 "amplc_pci230: BUG! cannot determine board type!\n"); 2926 2926 return -EINVAL; 2927 2927 } 2928 + /* 2929 + * Need to 'get' the PCI device to match the 'put' in pci230_detach(). 2930 + * TODO: Remove the pci_dev_get() and matching pci_dev_put() once 2931 + * support for manual attachment of PCI devices via pci230_attach() 2932 + * has been removed. 2933 + */ 2934 + pci_dev_get(pci_dev); 2928 2935 return pci230_attach_common(dev, pci_dev); 2929 2936 } 2930 2937
+9 -2
drivers/staging/comedi/drivers/das08.c
··· 378 378 int chan; 379 379 380 380 lsb = data[0] & 0xff; 381 - msb = (data[0] >> 8) & 0xf; 381 + msb = (data[0] >> 8) & 0xff; 382 382 383 383 chan = CR_CHAN(insn->chanspec); 384 384 ··· 623 623 .ai = das08_ai_rinsn, 624 624 .ai_nbits = 16, 625 625 .ai_pg = das08_pg_none, 626 - .ai_encoding = das08_encode12, 626 + .ai_encoding = das08_encode16, 627 627 .ao = das08jr_ao_winsn, 628 628 .ao_nbits = 16, 629 629 .di = das08jr_di_rbits, ··· 922 922 dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); 923 923 return -EINVAL; 924 924 } 925 + /* 926 + * Need to 'get' the PCI device to match the 'put' in das08_detach(). 927 + * TODO: Remove the pci_dev_get() and matching pci_dev_put() once 928 + * support for manual attachment of PCI devices via das08_attach() 929 + * has been removed. 930 + */ 931 + pci_dev_get(pdev); 925 932 return das08_pci_attach_common(dev, pdev); 926 933 } 927 934
+3 -1
drivers/staging/iio/accel/lis3l02dq_ring.c
··· 121 121 if (rx_array == NULL) 122 122 return -ENOMEM; 123 123 ret = lis3l02dq_read_all(indio_dev, rx_array); 124 - if (ret < 0) 124 + if (ret < 0) { 125 + kfree(rx_array); 125 126 return ret; 127 + } 126 128 for (i = 0; i < scan_count; i++) 127 129 data[i] = combine_8_to_16(rx_array[i*4+1], 128 130 rx_array[i*4+3]);
+2
drivers/staging/iio/adc/ad7192.c
··· 647 647 ret = strict_strtoul(buf, 10, &lval); 648 648 if (ret) 649 649 return ret; 650 + if (lval == 0) 651 + return -EINVAL; 650 652 651 653 mutex_lock(&indio_dev->mlock); 652 654 if (iio_buffer_enabled(indio_dev)) {
+2
drivers/staging/iio/gyro/adis16260_core.c
··· 195 195 ret = strict_strtol(buf, 10, &val); 196 196 if (ret) 197 197 return ret; 198 + if (val == 0) 199 + return -EINVAL; 198 200 199 201 mutex_lock(&indio_dev->mlock); 200 202 if (spi_get_device_id(st->us)) {
+2
drivers/staging/iio/imu/adis16400_core.c
··· 234 234 ret = strict_strtol(buf, 10, &val); 235 235 if (ret) 236 236 return ret; 237 + if (val == 0) 238 + return -EINVAL; 237 239 238 240 mutex_lock(&indio_dev->mlock); 239 241
+2
drivers/staging/iio/meter/ade7753.c
··· 425 425 ret = strict_strtol(buf, 10, &val); 426 426 if (ret) 427 427 return ret; 428 + if (val == 0) 429 + return -EINVAL; 428 430 429 431 mutex_lock(&indio_dev->mlock); 430 432
+2
drivers/staging/iio/meter/ade7754.c
··· 445 445 ret = strict_strtol(buf, 10, &val); 446 446 if (ret) 447 447 return ret; 448 + if (val == 0) 449 + return -EINVAL; 448 450 449 451 mutex_lock(&indio_dev->mlock); 450 452
+2
drivers/staging/iio/meter/ade7759.c
··· 385 385 ret = strict_strtol(buf, 10, &val); 386 386 if (ret) 387 387 return ret; 388 + if (val == 0) 389 + return -EINVAL; 388 390 389 391 mutex_lock(&indio_dev->mlock); 390 392
+1 -1
drivers/staging/nvec/nvec.c
··· 837 837 } 838 838 839 839 ret = mfd_add_devices(nvec->dev, -1, nvec_devices, 840 - ARRAY_SIZE(nvec_devices), base, 0); 840 + ARRAY_SIZE(nvec_devices), base, 0, NULL); 841 841 if (ret) 842 842 dev_err(nvec->dev, "error adding subdevices\n"); 843 843
+32 -9
drivers/staging/omapdrm/omap_connector.c
··· 48 48 mode->vsync_end = mode->vsync_start + timings->vsw; 49 49 mode->vtotal = mode->vsync_end + timings->vbp; 50 50 51 - /* note: whether or not it is interlaced, +/- h/vsync, etc, 52 - * which should be set in the mode flags, is not exposed in 53 - * the omap_video_timings struct.. but hdmi driver tracks 54 - * those separately so all we have to have to set the mode 55 - * is the way to recover these timings values, and the 56 - * omap_dss_driver would do the rest. 57 - */ 51 + mode->flags = 0; 52 + 53 + if (timings->interlace) 54 + mode->flags |= DRM_MODE_FLAG_INTERLACE; 55 + 56 + if (timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH) 57 + mode->flags |= DRM_MODE_FLAG_PHSYNC; 58 + else 59 + mode->flags |= DRM_MODE_FLAG_NHSYNC; 60 + 61 + if (timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH) 62 + mode->flags |= DRM_MODE_FLAG_PVSYNC; 63 + else 64 + mode->flags |= DRM_MODE_FLAG_NVSYNC; 58 65 } 59 66 60 67 static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings, ··· 78 71 timings->vfp = mode->vsync_start - mode->vdisplay; 79 72 timings->vsw = mode->vsync_end - mode->vsync_start; 80 73 timings->vbp = mode->vtotal - mode->vsync_end; 74 + 75 + timings->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); 76 + 77 + if (mode->flags & DRM_MODE_FLAG_PHSYNC) 78 + timings->hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; 79 + else 80 + timings->hsync_level = OMAPDSS_SIG_ACTIVE_LOW; 81 + 82 + if (mode->flags & DRM_MODE_FLAG_PVSYNC) 83 + timings->vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; 84 + else 85 + timings->vsync_level = OMAPDSS_SIG_ACTIVE_LOW; 86 + 87 + timings->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; 88 + timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH; 89 + timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES; 81 90 } 82 91 83 92 static void omap_connector_dpms(struct drm_connector *connector, int mode) ··· 210 187 } 211 188 } else { 212 189 struct drm_display_mode *mode = drm_mode_create(dev); 213 - struct omap_video_timings timings; 190 + struct omap_video_timings timings = {0}; 214 191 215 192 dssdrv->get_timings(dssdev, &timings); 216 193 ··· 314 291 struct omap_connector *omap_connector = to_omap_connector(connector); 315 292 struct omap_dss_device *dssdev = omap_connector->dssdev; 316 293 struct omap_dss_driver *dssdrv = dssdev->driver; 317 - struct omap_video_timings timings; 294 + struct omap_video_timings timings = {0}; 318 295 319 296 copy_timings_drm_to_omap(&timings, mode); 320 297
+2 -1
drivers/staging/ozwpan/ozcdev.c
··· 8 8 #include <linux/cdev.h> 9 9 #include <linux/uaccess.h> 10 10 #include <linux/netdevice.h> 11 + #include <linux/etherdevice.h> 11 12 #include <linux/poll.h> 12 13 #include <linux/sched.h> 13 14 #include "ozconfig.h" ··· 214 213 if (old_pd) 215 214 oz_pd_put(old_pd); 216 215 } else { 217 - if (!memcmp(addr, "\0\0\0\0\0\0", sizeof(addr))) { 216 + if (is_zero_ether_addr(addr)) { 218 217 spin_lock_bh(&g_cdev.lock); 219 218 pd = g_cdev.active_pd; 220 219 g_cdev.active_pd = 0;
+1 -6
drivers/staging/rtl8712/recv_linux.c
··· 117 117 if (skb == NULL) 118 118 goto _recv_indicatepkt_drop; 119 119 skb->data = precv_frame->u.hdr.rx_data; 120 - #ifdef NET_SKBUFF_DATA_USES_OFFSET 121 - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail - 122 - precv_frame->u.hdr.rx_head); 123 - #else 124 - skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail; 125 - #endif 126 120 skb->len = precv_frame->u.hdr.len; 121 + skb_set_tail_pointer(skb, skb->len); 127 122 if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1)) 128 123 skb->ip_summed = CHECKSUM_UNNECESSARY; 129 124 else
+1 -1
drivers/staging/vt6656/dpc.c
··· 200 200 } else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) { 201 201 cbHeaderSize += 6; 202 202 pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); 203 - if ((*pwType == cpu_to_le16(ETH_P_IPX)) || 203 + if ((*pwType == cpu_to_be16(ETH_P_IPX)) || 204 204 (*pwType == cpu_to_le16(0xF380))) { 205 205 cbHeaderSize -= 8; 206 206 pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize);
+19 -19
drivers/staging/vt6656/rxtx.c
··· 1699 1699 // 802.1H 1700 1700 if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { 1701 1701 if (pDevice->dwDiagRefCount == 0) { 1702 - if ((psEthHeader->wType == cpu_to_le16(ETH_P_IPX)) || 1702 + if ((psEthHeader->wType == cpu_to_be16(ETH_P_IPX)) || 1703 1703 (psEthHeader->wType == cpu_to_le16(0xF380))) { 1704 1704 memcpy((PBYTE) (pbyPayloadHead), 1705 1705 abySNAP_Bridgetunnel, 6); ··· 2838 2838 Packet_Type = skb->data[ETH_HLEN+1]; 2839 2839 Descriptor_type = skb->data[ETH_HLEN+1+1+2]; 2840 2840 Key_info = (skb->data[ETH_HLEN+1+1+2+1] << 8)|(skb->data[ETH_HLEN+1+1+2+2]); 2841 - if (pDevice->sTxEthHeader.wType == cpu_to_le16(ETH_P_PAE)) { 2842 - /* 802.1x OR eapol-key challenge frame transfer */ 2843 - if (((Protocol_Version == 1) || (Protocol_Version == 2)) && 2844 - (Packet_Type == 3)) { 2841 + if (pDevice->sTxEthHeader.wType == cpu_to_be16(ETH_P_PAE)) { 2842 + /* 802.1x OR eapol-key challenge frame transfer */ 2843 + if (((Protocol_Version == 1) || (Protocol_Version == 2)) && 2844 + (Packet_Type == 3)) { 2845 2845 bTxeapol_key = TRUE; 2846 2846 if(!(Key_info & BIT3) && //WPA or RSN group-key challenge 2847 2847 (Key_info & BIT8) && (Key_info & BIT9)) { //send 2/2 key ··· 2987 2987 } 2988 2988 } 2989 2989 2990 - if (pDevice->sTxEthHeader.wType == cpu_to_le16(ETH_P_PAE)) { 2991 - if (pDevice->byBBType != BB_TYPE_11A) { 2992 - pDevice->wCurrentRate = RATE_1M; 2993 - pDevice->byACKRate = RATE_1M; 2994 - pDevice->byTopCCKBasicRate = RATE_1M; 2995 - pDevice->byTopOFDMBasicRate = RATE_6M; 2996 - } else { 2997 - pDevice->wCurrentRate = RATE_6M; 2998 - pDevice->byACKRate = RATE_6M; 2999 - pDevice->byTopCCKBasicRate = RATE_1M; 3000 - pDevice->byTopOFDMBasicRate = RATE_6M; 3001 - } 3002 - } 2990 + if (pDevice->sTxEthHeader.wType == cpu_to_be16(ETH_P_PAE)) { 2991 + if (pDevice->byBBType != BB_TYPE_11A) { 2992 + pDevice->wCurrentRate = RATE_1M; 2993 + pDevice->byACKRate = RATE_1M; 2994 + pDevice->byTopCCKBasicRate = RATE_1M; 2995 + pDevice->byTopOFDMBasicRate = RATE_6M; 2996 + } else { 2997 + pDevice->wCurrentRate = RATE_6M; 2998 + pDevice->byACKRate = RATE_6M; 2999 + pDevice->byTopCCKBasicRate = RATE_1M; 3000 + pDevice->byTopOFDMBasicRate = RATE_6M; 3001 + } 3002 + } 3003 3003 3004 3004 DBG_PRT(MSG_LEVEL_DEBUG, 3005 3005 KERN_INFO "dma_tx: pDevice->wCurrentRate = %d\n", ··· 3015 3015 3016 3016 if (bNeedEncryption == TRUE) { 3017 3017 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType)); 3018 - if ((pDevice->sTxEthHeader.wType) == cpu_to_le16(ETH_P_PAE)) { 3018 + if ((pDevice->sTxEthHeader.wType) == cpu_to_be16(ETH_P_PAE)) { 3019 3019 bNeedEncryption = FALSE; 3020 3020 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Pkt Type=%04x\n", (pDevice->sTxEthHeader.wType)); 3021 3021 if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) {
+2 -2
drivers/staging/wlan-ng/cfg80211.c
··· 327 327 return result; 328 328 } 329 329 330 - int prism2_scan(struct wiphy *wiphy, struct net_device *dev, 331 - struct cfg80211_scan_request *request) 330 + int prism2_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) 332 331 { 332 + struct net_device *dev = request->wdev->netdev; 333 333 struct prism2_wiphy_private *priv = wiphy_priv(wiphy); 334 334 wlandevice_t *wlandev = dev->ml_priv; 335 335 struct p80211msg_dot11req_scan msg1;
+3 -4
drivers/staging/zcache/zcache-main.c
··· 1251 1251 void *pampd, struct tmem_pool *pool, 1252 1252 struct tmem_oid *oid, uint32_t index) 1253 1253 { 1254 - int ret = 0; 1255 - 1256 1254 BUG_ON(!is_ephemeral(pool)); 1257 - zbud_decompress((struct page *)(data), pampd); 1255 + if (zbud_decompress((struct page *)(data), pampd) < 0) 1256 + return -EINVAL; 1258 1257 zbud_free_and_delist((struct zbud_hdr *)pampd); 1259 1258 atomic_dec(&zcache_curr_eph_pampd_count); 1260 - return ret; 1259 + return 0; 1261 1260 } 1262 1261 1263 1262 /*
+10 -1
drivers/target/iscsi/iscsi_target_login.c
··· 221 221 { 222 222 struct iscsi_session *sess = NULL; 223 223 struct iscsi_login_req *pdu = (struct iscsi_login_req *)buf; 224 + int ret; 224 225 225 226 sess = kzalloc(sizeof(struct iscsi_session), GFP_KERNEL); 226 227 if (!sess) { ··· 258 257 return -ENOMEM; 259 258 } 260 259 spin_lock(&sess_idr_lock); 261 - idr_get_new(&sess_idr, NULL, &sess->session_index); 260 + ret = idr_get_new(&sess_idr, NULL, &sess->session_index); 262 261 spin_unlock(&sess_idr_lock); 262 + 263 + if (ret < 0) { 264 + pr_err("idr_get_new() for sess_idr failed\n"); 265 + iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, 266 + ISCSI_LOGIN_STATUS_NO_RESOURCES); 267 + kfree(sess); 268 + return -ENOMEM; 269 + } 263 270 264 271 sess->creation_time = get_jiffies_64(); 265 272 spin_lock_init(&sess->session_stats_lock);
+7
drivers/target/target_core_alua.c
··· 218 218 cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 219 219 return -EINVAL; 220 220 } 221 + if (cmd->data_length < 4) { 222 + pr_warn("SET TARGET PORT GROUPS parameter list length %u too" 223 + " small\n", cmd->data_length); 224 + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 225 + return -EINVAL; 226 + } 227 + 221 228 buf = transport_kmap_data_sg(cmd); 222 229 223 230 /*
+7
drivers/target/target_core_device.c
··· 669 669 unsigned char *buf; 670 670 u32 lun_count = 0, offset = 8, i; 671 671 672 + if (se_cmd->data_length < 16) { 673 + pr_warn("REPORT LUNS allocation length %u too small\n", 674 + se_cmd->data_length); 675 + se_cmd->scsi_sense_reason = TCM_INVALID_CDB_FIELD; 676 + return -EINVAL; 677 + } 678 + 672 679 buf = transport_kmap_data_sg(se_cmd); 673 680 if (!buf) 674 681 return -ENOMEM;
+15 -2
drivers/target/target_core_iblock.c
··· 325 325 struct iblock_dev *ibd = dev->dev_ptr; 326 326 unsigned char *buf, *ptr = NULL; 327 327 sector_t lba; 328 - int size = cmd->data_length; 328 + int size; 329 329 u32 range; 330 330 int ret = 0; 331 331 int dl, bd_dl; 332 + 333 + if (cmd->data_length < 8) { 334 + pr_warn("UNMAP parameter list length %u too small\n", 335 + cmd->data_length); 336 + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 337 + return -EINVAL; 338 + } 332 339 333 340 buf = transport_kmap_data_sg(cmd); 334 341 335 342 dl = get_unaligned_be16(&buf[0]); 336 343 bd_dl = get_unaligned_be16(&buf[2]); 337 344 338 - size = min(size - 8, bd_dl); 345 + size = cmd->data_length - 8; 346 + if (bd_dl > size) 347 + pr_warn("UNMAP parameter list length %u too small, ignoring bd_dl %u\n", 348 + cmd->data_length, bd_dl); 349 + else 350 + size = bd_dl; 351 + 339 352 if (size / 16 > dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count) { 340 353 cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 341 354 ret = -EINVAL;
+8
drivers/target/target_core_pr.c
··· 1540 1540 tidh_new->dest_local_nexus = 1; 1541 1541 list_add_tail(&tidh_new->dest_list, &tid_dest_list); 1542 1542 1543 + if (cmd->data_length < 28) { 1544 + pr_warn("SPC-PR: Received PR OUT parameter list" 1545 + " length too small: %u\n", cmd->data_length); 1546 + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; 1547 + ret = -EINVAL; 1548 + goto out; 1549 + } 1550 + 1543 1551 buf = transport_kmap_data_sg(cmd); 1544 1552 /* 1545 1553 * For a PERSISTENT RESERVE OUT specify initiator ports payload,
+11 -18
drivers/target/target_core_pscsi.c
··· 667 667 kfree(pdv); 668 668 } 669 669 670 - static int pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg) 670 + static void pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg, 671 + unsigned char *sense_buffer) 671 672 { 672 673 struct pscsi_dev_virt *pdv = cmd->se_dev->dev_ptr; 673 674 struct scsi_device *sd = pdv->pdv_sd; ··· 680 679 * not been allocated because TCM is handling the emulation directly. 681 680 */ 682 681 if (!pt) 683 - return 0; 682 + return; 684 683 685 684 cdb = &pt->pscsi_cdb[0]; 686 685 result = pt->pscsi_result; ··· 688 687 * Hack to make sure that Write-Protect modepage is set if R/O mode is 689 688 * forced. 690 689 */ 690 + if (!cmd->se_deve || !cmd->data_length) 691 + goto after_mode_sense; 692 + 691 693 if (((cdb[0] == MODE_SENSE) || (cdb[0] == MODE_SENSE_10)) && 692 694 (status_byte(result) << 1) == SAM_STAT_GOOD) { 693 - if (!cmd->se_deve) 694 - goto after_mode_sense; 695 - 696 695 if (cmd->se_deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY) { 697 696 unsigned char *buf = transport_kmap_data_sg(cmd); 698 697 ··· 709 708 } 710 709 after_mode_sense: 711 710 712 - if (sd->type != TYPE_TAPE) 711 + if (sd->type != TYPE_TAPE || !cmd->data_length) 713 712 goto after_mode_select; 714 713 715 714 /* ··· 751 750 } 752 751 after_mode_select: 753 752 754 - if (status_byte(result) & CHECK_CONDITION) 755 - return 1; 756 - 757 - return 0; 753 + if (sense_buffer && (status_byte(result) & CHECK_CONDITION)) { 754 + memcpy(sense_buffer, pt->pscsi_sense, TRANSPORT_SENSE_BUFFER); 755 + cmd->se_cmd_flags |= SCF_TRANSPORT_TASK_SENSE; 756 + } 758 757 } 759 758 760 759 enum { ··· 1185 1184 return -ENOMEM; 1186 1185 } 1187 1186 1188 - static unsigned char *pscsi_get_sense_buffer(struct se_cmd *cmd) 1189 - { 1190 - struct pscsi_plugin_task *pt = cmd->priv; 1191 - 1192 - return pt->pscsi_sense; 1193 - } 1194 - 1195 1187 /* pscsi_get_device_rev(): 1196 1188 * 1197 1189 * ··· 1267 1273 .check_configfs_dev_params = pscsi_check_configfs_dev_params, 1268 1274 .set_configfs_dev_params = pscsi_set_configfs_dev_params, 1269 1275 .show_configfs_dev_params = pscsi_show_configfs_dev_params, 1270 - .get_sense_buffer = pscsi_get_sense_buffer, 1271 1276 .get_device_rev = pscsi_get_device_rev, 1272 1277 .get_device_type = pscsi_get_device_type, 1273 1278 .get_blocks = pscsi_get_blocks,
+18 -17
drivers/target/target_core_spc.c
··· 877 877 static int spc_emulate_request_sense(struct se_cmd *cmd) 878 878 { 879 879 unsigned char *cdb = cmd->t_task_cdb; 880 - unsigned char *buf; 880 + unsigned char *rbuf; 881 881 u8 ua_asc = 0, ua_ascq = 0; 882 - int err = 0; 882 + unsigned char buf[SE_SENSE_BUF]; 883 + 884 + memset(buf, 0, SE_SENSE_BUF); 883 885 884 886 if (cdb[1] & 0x01) { 885 887 pr_err("REQUEST_SENSE description emulation not" ··· 890 888 return -ENOSYS; 891 889 } 892 890 893 - buf = transport_kmap_data_sg(cmd); 894 - 895 - if (!core_scsi3_ua_clear_for_request_sense(cmd, &ua_asc, &ua_ascq)) { 891 + rbuf = transport_kmap_data_sg(cmd); 892 + if (cmd->scsi_sense_reason != 0) { 893 + /* 894 + * Out of memory. We will fail with CHECK CONDITION, so 895 + * we must not clear the unit attention condition. 896 + */ 897 + target_complete_cmd(cmd, CHECK_CONDITION); 898 + return 0; 899 + } else if (!core_scsi3_ua_clear_for_request_sense(cmd, &ua_asc, &ua_ascq)) { 896 900 /* 897 901 * CURRENT ERROR, UNIT ATTENTION 898 902 */ 899 903 buf[0] = 0x70; 900 904 buf[SPC_SENSE_KEY_OFFSET] = UNIT_ATTENTION; 901 905 902 - if (cmd->data_length < 18) { 903 - buf[7] = 0x00; 904 - err = -EINVAL; 905 - goto end; 906 - } 907 906 /* 908 907 * The Additional Sense Code (ASC) from the UNIT ATTENTION 909 908 */ ··· 918 915 buf[0] = 0x70; 919 916 buf[SPC_SENSE_KEY_OFFSET] = NO_SENSE; 920 917 921 - if (cmd->data_length < 18) { 922 - buf[7] = 0x00; 923 - err = -EINVAL; 924 - goto end; 925 - } 926 918 /* 927 919 * NO ADDITIONAL SENSE INFORMATION 928 920 */ ··· 925 927 buf[7] = 0x0A; 926 928 } 927 929 928 - end: 929 - transport_kunmap_data_sg(cmd); 930 + if (rbuf) { 931 + memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); 932 + transport_kunmap_data_sg(cmd); 933 + } 934 + 930 935 target_complete_cmd(cmd, GOOD); 931 936 return 0; 932 937 }
+61 -87
drivers/target/target_core_transport.c
··· 567 567 transport_generic_request_failure(cmd); 568 568 } 569 569 570 + /* 571 + * Used when asking transport to copy Sense Data from the underlying 572 + * Linux/SCSI struct scsi_cmnd 573 + */ 574 + static unsigned char *transport_get_sense_buffer(struct se_cmd *cmd) 575 + { 576 + unsigned char *buffer = cmd->sense_buffer; 577 + struct se_device *dev = cmd->se_dev; 578 + u32 offset = 0; 579 + 580 + WARN_ON(!cmd->se_lun); 581 + 582 + if (!dev) 583 + return NULL; 584 + 585 + if (cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) 586 + return NULL; 587 + 588 + offset = cmd->se_tfo->set_fabric_sense_len(cmd, TRANSPORT_SENSE_BUFFER); 589 + 590 + /* Automatically padded */ 591 + cmd->scsi_sense_length = TRANSPORT_SENSE_BUFFER + offset; 592 + 593 + pr_debug("HBA_[%u]_PLUG[%s]: Requesting sense for SAM STATUS: 0x%02x\n", 594 + dev->se_hba->hba_id, dev->transport->name, cmd->scsi_status); 595 + return &buffer[offset]; 596 + } 597 + 570 598 void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status) 571 599 { 572 600 struct se_device *dev = cmd->se_dev; ··· 608 580 cmd->transport_state &= ~CMD_T_BUSY; 609 581 610 582 if (dev && dev->transport->transport_complete) { 611 - if (dev->transport->transport_complete(cmd, 612 - cmd->t_data_sg) != 0) { 613 - cmd->se_cmd_flags |= SCF_TRANSPORT_TASK_SENSE; 583 + dev->transport->transport_complete(cmd, 584 + cmd->t_data_sg, 585 + transport_get_sense_buffer(cmd)); 586 + if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) 614 587 success = 1; 615 - } 616 588 } 617 589 618 590 /* ··· 1209 1181 /* Returns CHECK_CONDITION + INVALID_CDB_FIELD */ 1210 1182 goto out_invalid_cdb_field; 1211 1183 } 1212 - 1184 + /* 1185 + * For the overflow case keep the existing fabric provided 1186 + * ->data_length. Otherwise for the underflow case, reset 1187 + * ->data_length to the smaller SCSI expected data transfer 1188 + * length. 1189 + */ 1213 1190 if (size > cmd->data_length) { 1214 1191 cmd->se_cmd_flags |= SCF_OVERFLOW_BIT; 1215 1192 cmd->residual_count = (size - cmd->data_length); 1216 1193 } else { 1217 1194 cmd->se_cmd_flags |= SCF_UNDERFLOW_BIT; 1218 1195 cmd->residual_count = (cmd->data_length - size); 1196 + cmd->data_length = size; 1219 1197 } 1220 - cmd->data_length = size; 1221 1198 } 1222 1199 1223 1200 return 0; ··· 1849 1816 EXPORT_SYMBOL(target_execute_cmd); 1850 1817 1851 1818 /* 1852 - * Used to obtain Sense Data from underlying Linux/SCSI struct scsi_cmnd 1853 - */ 1854 - static int transport_get_sense_data(struct se_cmd *cmd) 1855 - { 1856 - unsigned char *buffer = cmd->sense_buffer, *sense_buffer = NULL; 1857 - struct se_device *dev = cmd->se_dev; 1858 - unsigned long flags; 1859 - u32 offset = 0; 1860 - 1861 - WARN_ON(!cmd->se_lun); 1862 - 1863 - if (!dev) 1864 - return 0; 1865 - 1866 - spin_lock_irqsave(&cmd->t_state_lock, flags); 1867 - if (cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) { 1868 - spin_unlock_irqrestore(&cmd->t_state_lock, flags); 1869 - return 0; 1870 - } 1871 - 1872 - if (!(cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)) 1873 - goto out; 1874 - 1875 - if (!dev->transport->get_sense_buffer) { 1876 - pr_err("dev->transport->get_sense_buffer is NULL\n"); 1877 - goto out; 1878 - } 1879 - 1880 - sense_buffer = dev->transport->get_sense_buffer(cmd); 1881 - if (!sense_buffer) { 1882 - pr_err("ITT 0x%08x cmd %p: Unable to locate" 1883 - " sense buffer for task with sense\n", 1884 - cmd->se_tfo->get_task_tag(cmd), cmd); 1885 - goto out; 1886 - } 1887 - 1888 - spin_unlock_irqrestore(&cmd->t_state_lock, flags); 1889 - 1890 - offset = cmd->se_tfo->set_fabric_sense_len(cmd, TRANSPORT_SENSE_BUFFER); 1891 - 1892 - memcpy(&buffer[offset], sense_buffer, TRANSPORT_SENSE_BUFFER); 1893 - 1894 - /* Automatically padded */ 1895 - cmd->scsi_sense_length = TRANSPORT_SENSE_BUFFER + offset; 1896 - 1897 - pr_debug("HBA_[%u]_PLUG[%s]: Set SAM STATUS: 0x%02x and sense\n", 1898 - dev->se_hba->hba_id, dev->transport->name, cmd->scsi_status); 1899 - return 0; 1900 - 1901 - out: 1902 - spin_unlock_irqrestore(&cmd->t_state_lock, flags); 1903 - return -1; 1904 - } 1905 - 1906 - /* 1907 1819 * Process all commands up to the last received ORDERED task attribute which 1908 1820 * requires another blocking boundary 1909 1821 */ ··· 1963 1985 static void target_complete_ok_work(struct work_struct *work) 1964 1986 { 1965 1987 struct se_cmd *cmd = container_of(work, struct se_cmd, work); 1966 - int reason = 0, ret; 1988 + int ret; 1967 1989 1968 1990 /* 1969 1991 * Check if we need to move delayed/dormant tasks from cmds on the ··· 1980 2002 schedule_work(&cmd->se_dev->qf_work_queue); 1981 2003 1982 2004 /* 1983 - * Check if we need to retrieve a sense buffer from 2005 + * Check if we need to send a sense buffer from 1984 2006 * the struct se_cmd in question. 1985 2007 */ 1986 2008 if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) { 1987 - if (transport_get_sense_data(cmd) < 0) 1988 - reason = TCM_NON_EXISTENT_LUN; 2009 + WARN_ON(!cmd->scsi_status); 2010 + ret = transport_send_check_condition_and_sense( 2011 + cmd, 0, 1); 2012 + if (ret == -EAGAIN || ret == -ENOMEM) 2013 + goto queue_full; 1989 2014 1990 - if (cmd->scsi_status) { 1991 - ret = transport_send_check_condition_and_sense( 1992 - cmd, reason, 1); 1993 - if (ret == -EAGAIN || ret == -ENOMEM) 1994 - goto queue_full; 1995 - 1996 - transport_lun_remove_cmd(cmd); 1997 - transport_cmd_check_stop_to_fabric(cmd); 1998 - return; 1999 - } 2015 + transport_lun_remove_cmd(cmd); 2016 + transport_cmd_check_stop_to_fabric(cmd); 2017 + return; 2000 2018 } 2001 2019 /* 2002 2020 * Check for a callback, used by amongst other things ··· 2190 2216 struct page **pages; 2191 2217 int i; 2192 2218 2193 - BUG_ON(!sg); 2194 2219 /* 2195 2220 * We need to take into account a possible offset here for fabrics like 2196 2221 * tcm_loop who may be using a contig buffer from the SCSI midlayer for ··· 2197 2224 */ 2198 2225 if (!cmd->t_data_nents) 2199 2226 return NULL; 2200 - else if (cmd->t_data_nents == 1) 2227 + 2228 + BUG_ON(!sg); 2229 + if (cmd->t_data_nents == 1) 2201 2230 return kmap(sg_page(sg)) + sg->offset; 2202 2231 2203 2232 /* >1 page. use vmap */ 2204 2233 pages = kmalloc(sizeof(*pages) * cmd->t_data_nents, GFP_KERNEL); 2205 - if (!pages) 2234 + if (!pages) { 2235 + cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 2206 2236 return NULL; 2237 + } 2207 2238 2208 2239 /* convert sg[] to pages[] */ 2209 2240 for_each_sg(cmd->t_data_sg, sg, cmd->t_data_nents, i) { ··· 2216 2239 2217 2240 cmd->t_data_vmap = vmap(pages, cmd->t_data_nents, VM_MAP, PAGE_KERNEL); 2218 2241 kfree(pages); 2219 - if (!cmd->t_data_vmap) 2242 + if (!cmd->t_data_vmap) { 2243 + cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 2220 2244 return NULL; 2245 + } 2221 2246 2222 2247 return cmd->t_data_vmap + cmd->t_data_sg[0].offset; 2223 2248 } ··· 2305 2326 * into the fabric for data transfers, go ahead and complete it right 2306 2327 * away. 2307 2328 */ 2308 - if (!cmd->data_length) { 2329 + if (!cmd->data_length && 2330 + cmd->t_task_cdb[0] != REQUEST_SENSE && 2331 + cmd->se_dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV) { 2309 2332 spin_lock_irq(&cmd->t_state_lock); 2310 2333 cmd->t_state = TRANSPORT_COMPLETE; 2311 2334 cmd->transport_state |= CMD_T_ACTIVE; 2312 2335 spin_unlock_irq(&cmd->t_state_lock); 2313 - 2314 - if (cmd->t_task_cdb[0] == REQUEST_SENSE) { 2315 - u8 ua_asc = 0, ua_ascq = 0; 2316 - 2317 - core_scsi3_ua_clear_for_request_sense(cmd, 2318 - &ua_asc, &ua_ascq); 2319 - } 2320 2336 2321 2337 INIT_WORK(&cmd->work, target_complete_ok_work); 2322 2338 queue_work(target_completion_wq, &cmd->work);
+15 -15
drivers/tty/serial/imx.c
··· 132 132 #define UCR4_OREN (1<<1) /* Receiver overrun interrupt enable */ 133 133 #define UCR4_DREN (1<<0) /* Recv data ready interrupt enable */ 134 134 #define UFCR_RXTL_SHF 0 /* Receiver trigger level shift */ 135 + #define UFCR_DCEDTE (1<<6) /* DCE/DTE mode select */ 135 136 #define UFCR_RFDIV (7<<7) /* Reference freq divider mask */ 136 137 #define UFCR_RFDIV_REG(x) (((x) < 7 ? 6 - (x) : 6) << 7) 137 138 #define UFCR_TXTL_SHF 10 /* Transmitter trigger level shift */ ··· 668 667 static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode) 669 668 { 670 669 unsigned int val; 671 - unsigned int ufcr_rfdiv; 672 670 673 - /* set receiver / transmitter trigger level. 674 - * RFDIV is set such way to satisfy requested uartclk value 675 - */ 676 - val = TXTL << 10 | RXTL; 677 - ufcr_rfdiv = (clk_get_rate(sport->clk_per) + sport->port.uartclk / 2) 678 - / sport->port.uartclk; 679 - 680 - if(!ufcr_rfdiv) 681 - ufcr_rfdiv = 1; 682 - 683 - val |= UFCR_RFDIV_REG(ufcr_rfdiv); 684 - 671 + /* set receiver / transmitter trigger level */ 672 + val = readl(sport->port.membase + UFCR) & (UFCR_RFDIV | UFCR_DCEDTE); 673 + val |= TXTL << UFCR_TXTL_SHF | RXTL; 685 674 writel(val, sport->port.membase + UFCR); 686 - 687 675 return 0; 688 676 } 689 677 ··· 744 754 } 745 755 } 746 756 757 + spin_lock_irqsave(&sport->port.lock, flags); 747 758 /* 748 759 * Finally, clear and enable interrupts 749 760 */ ··· 798 807 /* 799 808 * Enable modem status interrupts 800 809 */ 801 - spin_lock_irqsave(&sport->port.lock,flags); 802 810 imx_enable_ms(&sport->port); 803 811 spin_unlock_irqrestore(&sport->port.lock,flags); 804 812 ··· 827 837 { 828 838 struct imx_port *sport = (struct imx_port *)port; 829 839 unsigned long temp; 840 + unsigned long flags; 830 841 842 + spin_lock_irqsave(&sport->port.lock, flags); 831 843 temp = readl(sport->port.membase + UCR2); 832 844 temp &= ~(UCR2_TXEN); 833 845 writel(temp, sport->port.membase + UCR2); 846 + spin_unlock_irqrestore(&sport->port.lock, flags); 834 847 835 848 if (USE_IRDA(sport)) { 836 849 struct imxuart_platform_data *pdata; ··· 862 869 * Disable all interrupts, port and break condition. 863 870 */ 864 871 872 + spin_lock_irqsave(&sport->port.lock, flags); 865 873 temp = readl(sport->port.membase + UCR1); 866 874 temp &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN); 867 875 if (USE_IRDA(sport)) 868 876 temp &= ~(UCR1_IREN); 869 877 870 878 writel(temp, sport->port.membase + UCR1); 879 + spin_unlock_irqrestore(&sport->port.lock, flags); 871 880 } 872 881 873 882 static void ··· 1212 1217 struct imx_port *sport = imx_ports[co->index]; 1213 1218 struct imx_port_ucrs old_ucr; 1214 1219 unsigned int ucr1; 1220 + unsigned long flags; 1221 + 1222 + spin_lock_irqsave(&sport->port.lock, flags); 1215 1223 1216 1224 /* 1217 1225 * First, save UCR1/2/3 and then disable interrupts ··· 1240 1242 while (!(readl(sport->port.membase + USR2) & USR2_TXDC)); 1241 1243 1242 1244 imx_port_ucrs_restore(&sport->port, &old_ucr); 1245 + 1246 + spin_unlock_irqrestore(&sport->port.lock, flags); 1243 1247 } 1244 1248 1245 1249 /*
+41 -18
drivers/usb/chipidea/udc.c
··· 78 78 } 79 79 80 80 /** 81 - * hw_device_state: enables/disables interrupts & starts/stops device (execute 82 - * without interruption) 81 + * hw_device_state: enables/disables interrupts (execute without interruption) 83 82 * @dma: 0 => disable, !0 => enable and set dma engine 84 83 * 85 84 * This function returns an error code ··· 90 91 /* interrupt, error, port change, reset, sleep/suspend */ 91 92 hw_write(ci, OP_USBINTR, ~0, 92 93 USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); 93 - hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); 94 94 } else { 95 - hw_write(ci, OP_USBCMD, USBCMD_RS, 0); 96 95 hw_write(ci, OP_USBINTR, ~0, 0); 97 96 } 98 97 return 0; ··· 771 774 { 772 775 struct ci13xxx_req *mReq, *mReqTemp; 773 776 struct ci13xxx_ep *mEpTemp = mEp; 774 - int uninitialized_var(retval); 775 - 776 - if (list_empty(&mEp->qh.queue)) 777 - return -EINVAL; 777 + int retval = 0; 778 778 779 779 list_for_each_entry_safe(mReq, mReqTemp, &mEp->qh.queue, 780 780 queue) { ··· 1414 1420 return -ENOTSUPP; 1415 1421 } 1416 1422 1423 + /* Change Data+ pullup status 1424 + * this func is used by usb_gadget_connect/disconnet 1425 + */ 1426 + static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on) 1427 + { 1428 + struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget); 1429 + 1430 + if (is_on) 1431 + hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); 1432 + else 1433 + hw_write(ci, OP_USBCMD, USBCMD_RS, 0); 1434 + 1435 + return 0; 1436 + } 1437 + 1417 1438 static int ci13xxx_start(struct usb_gadget *gadget, 1418 1439 struct usb_gadget_driver *driver); 1419 1440 static int ci13xxx_stop(struct usb_gadget *gadget, ··· 1441 1432 static const struct usb_gadget_ops usb_gadget_ops = { 1442 1433 .vbus_session = ci13xxx_vbus_session, 1443 1434 .wakeup = ci13xxx_wakeup, 1435 + .pullup = ci13xxx_pullup, 1444 1436 .vbus_draw = ci13xxx_vbus_draw, 1445 1437 .udc_start = ci13xxx_start, 1446 1438 .udc_stop = ci13xxx_stop, ··· 1465 1455 1466 1456 mEp->ep.name = mEp->name; 1467 1457 mEp->ep.ops = &usb_ep_ops; 1468 - mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; 1458 + /* 1459 + * for ep0: maxP defined in desc, for other 1460 + * eps, maxP is set by epautoconfig() called 1461 + * by gadget layer 1462 + */ 1463 + mEp->ep.maxpacket = (unsigned short)~0; 1469 1464 1470 1465 INIT_LIST_HEAD(&mEp->qh.queue); 1471 1466 mEp->qh.ptr = dma_pool_alloc(ci->qh_pool, GFP_KERNEL, ··· 1490 1475 else 1491 1476 ci->ep0in = mEp; 1492 1477 1478 + mEp->ep.maxpacket = CTRL_PAYLOAD_MAX; 1493 1479 continue; 1494 1480 } 1495 1481 ··· 1498 1482 } 1499 1483 1500 1484 return retval; 1485 + } 1486 + 1487 + static void destroy_eps(struct ci13xxx *ci) 1488 + { 1489 + int i; 1490 + 1491 + for (i = 0; i < ci->hw_ep_max; i++) { 1492 + struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i]; 1493 + 1494 + dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma); 1495 + } 1501 1496 } 1502 1497 1503 1498 /** ··· 1718 1691 if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) { 1719 1692 if (ci->transceiver == NULL) { 1720 1693 retval = -ENODEV; 1721 - goto free_pools; 1694 + goto destroy_eps; 1722 1695 } 1723 1696 } 1724 1697 ··· 1756 1729 1757 1730 remove_trans: 1758 1731 if (!IS_ERR_OR_NULL(ci->transceiver)) { 1759 - otg_set_peripheral(ci->transceiver->otg, &ci->gadget); 1732 + otg_set_peripheral(ci->transceiver->otg, NULL); 1760 1733 if (ci->global_phy) 1761 1734 usb_put_phy(ci->transceiver); 1762 1735 } ··· 1769 1742 put_transceiver: 1770 1743 if (!IS_ERR_OR_NULL(ci->transceiver) && ci->global_phy) 1771 1744 usb_put_phy(ci->transceiver); 1745 + destroy_eps: 1746 + destroy_eps(ci); 1772 1747 free_pools: 1773 1748 dma_pool_destroy(ci->td_pool); 1774 1749 free_qh_pool: ··· 1785 1756 */ 1786 1757 static void udc_stop(struct ci13xxx *ci) 1787 1758 { 1788 - int i; 1789 - 1790 1759 if (ci == NULL) 1791 1760 return; 1792 1761 1793 1762 usb_del_gadget_udc(&ci->gadget); 1794 1763 1795 - for (i = 0; i < ci->hw_ep_max; i++) { 1796 - struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i]; 1797 - 1798 - dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma); 1799 - } 1764 + destroy_eps(ci); 1800 1765 1801 1766 dma_pool_destroy(ci->td_pool); 1802 1767 dma_pool_destroy(ci->qh_pool);
+8 -4
drivers/usb/class/cdc-wdm.c
··· 109 109 /* return intfdata if we own the interface, else look up intf in the list */ 110 110 static struct wdm_device *wdm_find_device(struct usb_interface *intf) 111 111 { 112 - struct wdm_device *desc = NULL; 112 + struct wdm_device *desc; 113 113 114 114 spin_lock(&wdm_device_list_lock); 115 115 list_for_each_entry(desc, &wdm_device_list, device_list) 116 116 if (desc->intf == intf) 117 - break; 117 + goto found; 118 + desc = NULL; 119 + found: 118 120 spin_unlock(&wdm_device_list_lock); 119 121 120 122 return desc; ··· 124 122 125 123 static struct wdm_device *wdm_find_device_by_minor(int minor) 126 124 { 127 - struct wdm_device *desc = NULL; 125 + struct wdm_device *desc; 128 126 129 127 spin_lock(&wdm_device_list_lock); 130 128 list_for_each_entry(desc, &wdm_device_list, device_list) 131 129 if (desc->intf->minor == minor) 132 - break; 130 + goto found; 131 + desc = NULL; 132 + found: 133 133 spin_unlock(&wdm_device_list_lock); 134 134 135 135 return desc;
+4
drivers/usb/core/quirks.c
··· 71 71 { USB_DEVICE(0x04b4, 0x0526), .driver_info = 72 72 USB_QUIRK_CONFIG_INTF_STRINGS }, 73 73 74 + /* Microchip Joss Optical infrared touchboard device */ 75 + { USB_DEVICE(0x04d8, 0x000c), .driver_info = 76 + USB_QUIRK_CONFIG_INTF_STRINGS }, 77 + 74 78 /* Samsung Android phone modem - ID conflict with SPH-I500 */ 75 79 { USB_DEVICE(0x04e8, 0x6601), .driver_info = 76 80 USB_QUIRK_CONFIG_INTF_STRINGS },
+7 -2
drivers/usb/dwc3/core.c
··· 436 436 dev_err(dev, "missing IRQ\n"); 437 437 return -ENODEV; 438 438 } 439 - dwc->xhci_resources[1] = *res; 439 + dwc->xhci_resources[1].start = res->start; 440 + dwc->xhci_resources[1].end = res->end; 441 + dwc->xhci_resources[1].flags = res->flags; 442 + dwc->xhci_resources[1].name = res->name; 440 443 441 444 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 442 445 if (!res) { 443 446 dev_err(dev, "missing memory resource\n"); 444 447 return -ENODEV; 445 448 } 446 - dwc->xhci_resources[0] = *res; 449 + dwc->xhci_resources[0].start = res->start; 447 450 dwc->xhci_resources[0].end = dwc->xhci_resources[0].start + 448 451 DWC3_XHCI_REGS_END; 452 + dwc->xhci_resources[0].flags = res->flags; 453 + dwc->xhci_resources[0].name = res->name; 449 454 450 455 /* 451 456 * Request memory region but exclude xHCI regs,
-1
drivers/usb/dwc3/ep0.c
··· 720 720 transferred = min_t(u32, ur->length, 721 721 transfer_size - length); 722 722 memcpy(ur->buf, dwc->ep0_bounce, transferred); 723 - dwc->ep0_bounced = false; 724 723 } else { 725 724 transferred = ur->length - length; 726 725 }
+17 -2
drivers/usb/dwc3/gadget.c
··· 263 263 if (req->request.status == -EINPROGRESS) 264 264 req->request.status = status; 265 265 266 - usb_gadget_unmap_request(&dwc->gadget, &req->request, 267 - req->direction); 266 + if (dwc->ep0_bounced && dep->number == 0) 267 + dwc->ep0_bounced = false; 268 + else 269 + usb_gadget_unmap_request(&dwc->gadget, &req->request, 270 + req->direction); 268 271 269 272 dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n", 270 273 req, dep->name, req->request.actual, ··· 1029 1026 if (list_empty(&dep->request_list)) { 1030 1027 dev_vdbg(dwc->dev, "ISOC ep %s run out for requests.\n", 1031 1028 dep->name); 1029 + dep->flags |= DWC3_EP_PENDING_REQUEST; 1032 1030 return; 1033 1031 } 1034 1032 ··· 1092 1088 */ 1093 1089 if (dep->flags & DWC3_EP_PENDING_REQUEST) { 1094 1090 int ret; 1091 + 1092 + /* 1093 + * If xfernotready is already elapsed and it is a case 1094 + * of isoc transfer, then issue END TRANSFER, so that 1095 + * you can receive xfernotready again and can have 1096 + * notion of current microframe. 1097 + */ 1098 + if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { 1099 + dwc3_stop_active_transfer(dwc, dep->number); 1100 + return 0; 1101 + } 1095 1102 1096 1103 ret = __dwc3_gadget_kick_transfer(dep, 0, true); 1097 1104 if (ret && ret != -EBUSY) {
+1 -5
drivers/usb/gadget/at91_udc.c
··· 475 475 unsigned long flags; 476 476 477 477 if (!_ep || !ep 478 - || !desc || ep->ep.desc 479 - || _ep->name == ep0name 478 + || !desc || _ep->name == ep0name 480 479 || desc->bDescriptorType != USB_DT_ENDPOINT 481 480 || (maxpacket = usb_endpoint_maxp(desc)) == 0 482 481 || maxpacket > ep->maxpacket) { ··· 529 530 tmp |= AT91_UDP_EPEDS; 530 531 __raw_writel(tmp, ep->creg); 531 532 532 - ep->ep.desc = desc; 533 533 ep->ep.maxpacket = maxpacket; 534 534 535 535 /* ··· 1633 1635 udc->driver = driver; 1634 1636 udc->gadget.dev.driver = &driver->driver; 1635 1637 udc->gadget.dev.of_node = udc->pdev->dev.of_node; 1636 - dev_set_drvdata(&udc->gadget.dev, &driver->driver); 1637 1638 udc->enabled = 1; 1638 1639 udc->selfpowered = 1; 1639 1640 ··· 1653 1656 spin_unlock_irqrestore(&udc->lock, flags); 1654 1657 1655 1658 udc->gadget.dev.driver = NULL; 1656 - dev_set_drvdata(&udc->gadget.dev, NULL); 1657 1659 udc->driver = NULL; 1658 1660 1659 1661 DBG("unbound from %s\n", driver->driver.name);
+37 -4
drivers/usb/gadget/dummy_hcd.c
··· 1916 1916 return retval; 1917 1917 } 1918 1918 1919 + /* usb 3.0 root hub device descriptor */ 1920 + struct { 1921 + struct usb_bos_descriptor bos; 1922 + struct usb_ss_cap_descriptor ss_cap; 1923 + } __packed usb3_bos_desc = { 1924 + 1925 + .bos = { 1926 + .bLength = USB_DT_BOS_SIZE, 1927 + .bDescriptorType = USB_DT_BOS, 1928 + .wTotalLength = cpu_to_le16(sizeof(usb3_bos_desc)), 1929 + .bNumDeviceCaps = 1, 1930 + }, 1931 + .ss_cap = { 1932 + .bLength = USB_DT_USB_SS_CAP_SIZE, 1933 + .bDescriptorType = USB_DT_DEVICE_CAPABILITY, 1934 + .bDevCapabilityType = USB_SS_CAP_TYPE, 1935 + .wSpeedSupported = cpu_to_le16(USB_5GBPS_OPERATION), 1936 + .bFunctionalitySupport = ilog2(USB_5GBPS_OPERATION), 1937 + }, 1938 + }; 1939 + 1919 1940 static inline void 1920 1941 ss_hub_descriptor(struct usb_hub_descriptor *desc) 1921 1942 { ··· 2027 2006 else 2028 2007 hub_descriptor((struct usb_hub_descriptor *) buf); 2029 2008 break; 2009 + 2010 + case DeviceRequest | USB_REQ_GET_DESCRIPTOR: 2011 + if (hcd->speed != HCD_USB3) 2012 + goto error; 2013 + 2014 + if ((wValue >> 8) != USB_DT_BOS) 2015 + goto error; 2016 + 2017 + memcpy(buf, &usb3_bos_desc, sizeof(usb3_bos_desc)); 2018 + retval = sizeof(usb3_bos_desc); 2019 + break; 2020 + 2030 2021 case GetHubStatus: 2031 2022 *(__le32 *) buf = cpu_to_le32(0); 2032 2023 break; ··· 2536 2503 hs_hcd->has_tt = 1; 2537 2504 2538 2505 retval = usb_add_hcd(hs_hcd, 0, 0); 2539 - if (retval != 0) { 2540 - usb_put_hcd(hs_hcd); 2541 - return retval; 2542 - } 2506 + if (retval) 2507 + goto put_usb2_hcd; 2543 2508 2544 2509 if (mod_data.is_super_speed) { 2545 2510 ss_hcd = usb_create_shared_hcd(&dummy_hcd, &pdev->dev, ··· 2556 2525 put_usb3_hcd: 2557 2526 usb_put_hcd(ss_hcd); 2558 2527 dealloc_usb2_hcd: 2528 + usb_remove_hcd(hs_hcd); 2529 + put_usb2_hcd: 2559 2530 usb_put_hcd(hs_hcd); 2560 2531 the_controller.hs_hcd = the_controller.ss_hcd = NULL; 2561 2532 return retval;
+4
drivers/usb/gadget/f_fs.c
··· 34 34 /* Debugging ****************************************************************/ 35 35 36 36 #ifdef VERBOSE_DEBUG 37 + #ifndef pr_vdebug 37 38 # define pr_vdebug pr_debug 39 + #endif /* pr_vdebug */ 38 40 # define ffs_dump_mem(prefix, ptr, len) \ 39 41 print_hex_dump_bytes(pr_fmt(prefix ": "), DUMP_PREFIX_NONE, ptr, len) 40 42 #else 43 + #ifndef pr_vdebug 41 44 # define pr_vdebug(...) do { } while (0) 45 + #endif /* pr_vdebug */ 42 46 # define ffs_dump_mem(prefix, ptr, len) do { } while (0) 43 47 #endif /* VERBOSE_DEBUG */ 44 48
+3
drivers/usb/gadget/s3c-hsotg.c
··· 3599 3599 3600 3600 if (hsotg->num_of_eps == 0) { 3601 3601 dev_err(dev, "wrong number of EPs (zero)\n"); 3602 + ret = -EINVAL; 3602 3603 goto err_supplies; 3603 3604 } 3604 3605 ··· 3607 3606 GFP_KERNEL); 3608 3607 if (!eps) { 3609 3608 dev_err(dev, "cannot get memory\n"); 3609 + ret = -ENOMEM; 3610 3610 goto err_supplies; 3611 3611 } 3612 3612 ··· 3624 3622 GFP_KERNEL); 3625 3623 if (!hsotg->ctrl_req) { 3626 3624 dev_err(dev, "failed to allocate ctrl req\n"); 3625 + ret = -ENOMEM; 3627 3626 goto err_ep_mem; 3628 3627 } 3629 3628
+4
drivers/usb/gadget/u_serial.c
··· 132 132 133 133 134 134 #ifdef VERBOSE_DEBUG 135 + #ifndef pr_vdebug 135 136 #define pr_vdebug(fmt, arg...) \ 136 137 pr_debug(fmt, ##arg) 138 + #endif /* pr_vdebug */ 137 139 #else 140 + #ifndef pr_vdebig 138 141 #define pr_vdebug(fmt, arg...) \ 139 142 ({ if (0) pr_debug(fmt, ##arg); }) 143 + #endif /* pr_vdebug */ 140 144 #endif 141 145 142 146 /*-------------------------------------------------------------------------*/
+10 -2
drivers/usb/host/ehci-q.c
··· 128 128 else { 129 129 qtd = list_entry (qh->qtd_list.next, 130 130 struct ehci_qtd, qtd_list); 131 - /* first qtd may already be partially processed */ 132 - if (cpu_to_hc32(ehci, qtd->qtd_dma) == qh->hw->hw_current) 131 + /* 132 + * first qtd may already be partially processed. 133 + * If we come here during unlink, the QH overlay region 134 + * might have reference to the just unlinked qtd. The 135 + * qtd is updated in qh_completions(). Update the QH 136 + * overlay here. 137 + */ 138 + if (cpu_to_hc32(ehci, qtd->qtd_dma) == qh->hw->hw_current) { 139 + qh->hw->hw_qtd_next = qtd->hw_next; 133 140 qtd = NULL; 141 + } 134 142 } 135 143 136 144 if (qtd)
+10
drivers/usb/host/ohci-at91.c
··· 570 570 571 571 if (pdata) { 572 572 at91_for_each_port(i) { 573 + /* 574 + * do not configure PIO if not in relation with 575 + * real USB port on board 576 + */ 577 + if (i >= pdata->ports) { 578 + pdata->vbus_pin[i] = -EINVAL; 579 + pdata->overcurrent_pin[i] = -EINVAL; 580 + break; 581 + } 582 + 573 583 if (!gpio_is_valid(pdata->vbus_pin[i])) 574 584 continue; 575 585 gpio = pdata->vbus_pin[i];
+35 -7
drivers/usb/host/pci-quirks.c
··· 75 75 #define NB_PIF0_PWRDOWN_1 0x01100013 76 76 77 77 #define USB_INTEL_XUSB2PR 0xD0 78 + #define USB_INTEL_USB2PRM 0xD4 78 79 #define USB_INTEL_USB3_PSSEN 0xD8 80 + #define USB_INTEL_USB3PRM 0xDC 79 81 80 82 static struct amd_chipset_info { 81 83 struct pci_dev *nb_dev; ··· 774 772 return; 775 773 } 776 774 777 - ports_available = 0xffffffff; 775 + /* Read USB3PRM, the USB 3.0 Port Routing Mask Register 776 + * Indicate the ports that can be changed from OS. 777 + */ 778 + pci_read_config_dword(xhci_pdev, USB_INTEL_USB3PRM, 779 + &ports_available); 780 + 781 + dev_dbg(&xhci_pdev->dev, "Configurable ports to enable SuperSpeed: 0x%x\n", 782 + ports_available); 783 + 778 784 /* Write USB3_PSSEN, the USB 3.0 Port SuperSpeed Enable 779 - * Register, to turn on SuperSpeed terminations for all 780 - * available ports. 785 + * Register, to turn on SuperSpeed terminations for the 786 + * switchable ports. 781 787 */ 782 788 pci_write_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN, 783 789 cpu_to_le32(ports_available)); ··· 795 785 dev_dbg(&xhci_pdev->dev, "USB 3.0 ports that are now enabled " 796 786 "under xHCI: 0x%x\n", ports_available); 797 787 798 - ports_available = 0xffffffff; 788 + /* Read XUSB2PRM, xHCI USB 2.0 Port Routing Mask Register 789 + * Indicate the USB 2.0 ports to be controlled by the xHCI host. 790 + */ 791 + 792 + pci_read_config_dword(xhci_pdev, USB_INTEL_USB2PRM, 793 + &ports_available); 794 + 795 + dev_dbg(&xhci_pdev->dev, "Configurable USB 2.0 ports to hand over to xCHI: 0x%x\n", 796 + ports_available); 797 + 799 798 /* Write XUSB2PR, the xHC USB 2.0 Port Routing Register, to 800 799 * switch the USB 2.0 power and data lines over to the xHCI 801 800 * host. ··· 841 822 void __iomem *op_reg_base; 842 823 u32 val; 843 824 int timeout; 825 + int len = pci_resource_len(pdev, 0); 844 826 845 827 if (!mmio_resource_enabled(pdev, 0)) 846 828 return; 847 829 848 - base = ioremap_nocache(pci_resource_start(pdev, 0), 849 - pci_resource_len(pdev, 0)); 830 + base = ioremap_nocache(pci_resource_start(pdev, 0), len); 850 831 if (base == NULL) 851 832 return; 852 833 ··· 856 837 */ 857 838 ext_cap_offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET); 858 839 do { 840 + if ((ext_cap_offset + sizeof(val)) > len) { 841 + /* We're reading garbage from the controller */ 842 + dev_warn(&pdev->dev, 843 + "xHCI controller failing to respond"); 844 + return; 845 + } 846 + 859 847 if (!ext_cap_offset) 860 848 /* We've reached the end of the extended capabilities */ 861 849 goto hc_init; 850 + 862 851 val = readl(base + ext_cap_offset); 863 852 if (XHCI_EXT_CAPS_ID(val) == XHCI_EXT_CAPS_LEGACY) 864 853 break; ··· 897 870 /* Disable any BIOS SMIs and clear all SMI events*/ 898 871 writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET); 899 872 873 + hc_init: 900 874 if (usb_is_intel_switchable_xhci(pdev)) 901 875 usb_enable_xhci_ports(pdev); 902 - hc_init: 876 + 903 877 op_reg_base = base + XHCI_HC_LENGTH(readl(base)); 904 878 905 879 /* Wait for the host controller to be ready before writing any
+1
drivers/usb/host/pci-quirks.h
··· 15 15 static inline void usb_amd_quirk_pll_disable(void) {} 16 16 static inline void usb_amd_quirk_pll_enable(void) {} 17 17 static inline void usb_amd_dev_put(void) {} 18 + static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} 18 19 #endif /* CONFIG_PCI */ 19 20 20 21 #endif /* __LINUX_USB_PCI_QUIRKS_H */
+42
drivers/usb/host/xhci-hub.c
··· 493 493 * when this bit is set. 494 494 */ 495 495 pls |= USB_PORT_STAT_CONNECTION; 496 + } else { 497 + /* 498 + * If CAS bit isn't set but the Port is already at 499 + * Compliance Mode, fake a connection so the USB core 500 + * notices the Compliance state and resets the port. 501 + * This resolves an issue generated by the SN65LVPE502CP 502 + * in which sometimes the port enters compliance mode 503 + * caused by a delay on the host-device negotiation. 504 + */ 505 + if (pls == USB_SS_PORT_LS_COMP_MOD) 506 + pls |= USB_PORT_STAT_CONNECTION; 496 507 } 508 + 497 509 /* update status field */ 498 510 *status |= pls; 511 + } 512 + 513 + /* 514 + * Function for Compliance Mode Quirk. 515 + * 516 + * This Function verifies if all xhc USB3 ports have entered U0, if so, 517 + * the compliance mode timer is deleted. A port won't enter 518 + * compliance mode if it has previously entered U0. 519 + */ 520 + void xhci_del_comp_mod_timer(struct xhci_hcd *xhci, u32 status, u16 wIndex) 521 + { 522 + u32 all_ports_seen_u0 = ((1 << xhci->num_usb3_ports)-1); 523 + bool port_in_u0 = ((status & PORT_PLS_MASK) == XDEV_U0); 524 + 525 + if (!(xhci->quirks & XHCI_COMP_MODE_QUIRK)) 526 + return; 527 + 528 + if ((xhci->port_status_u0 != all_ports_seen_u0) && port_in_u0) { 529 + xhci->port_status_u0 |= 1 << wIndex; 530 + if (xhci->port_status_u0 == all_ports_seen_u0) { 531 + del_timer_sync(&xhci->comp_mode_recovery_timer); 532 + xhci_dbg(xhci, "All USB3 ports have entered U0 already!\n"); 533 + xhci_dbg(xhci, "Compliance Mode Recovery Timer Deleted.\n"); 534 + } 535 + } 499 536 } 500 537 501 538 int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ··· 688 651 /* Update Port Link State for super speed ports*/ 689 652 if (hcd->speed == HCD_USB3) { 690 653 xhci_hub_report_link_state(&status, temp); 654 + /* 655 + * Verify if all USB3 Ports Have entered U0 already. 656 + * Delete Compliance Mode Timer if so. 657 + */ 658 + xhci_del_comp_mod_timer(xhci, temp, wIndex); 691 659 } 692 660 if (bus_state->port_c_suspend & (1 << wIndex)) 693 661 status |= 1 << USB_PORT_FEAT_C_SUSPEND;
+1 -1
drivers/usb/host/xhci-plat.c
··· 118 118 goto put_hcd; 119 119 } 120 120 121 - hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); 121 + hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); 122 122 if (!hcd->regs) { 123 123 dev_dbg(&pdev->dev, "error mapping memory\n"); 124 124 ret = -EFAULT;
+122 -1
drivers/usb/host/xhci.c
··· 26 26 #include <linux/module.h> 27 27 #include <linux/moduleparam.h> 28 28 #include <linux/slab.h> 29 + #include <linux/dmi.h> 29 30 30 31 #include "xhci.h" 31 32 ··· 399 398 400 399 #endif 401 400 401 + static void compliance_mode_recovery(unsigned long arg) 402 + { 403 + struct xhci_hcd *xhci; 404 + struct usb_hcd *hcd; 405 + u32 temp; 406 + int i; 407 + 408 + xhci = (struct xhci_hcd *)arg; 409 + 410 + for (i = 0; i < xhci->num_usb3_ports; i++) { 411 + temp = xhci_readl(xhci, xhci->usb3_ports[i]); 412 + if ((temp & PORT_PLS_MASK) == USB_SS_PORT_LS_COMP_MOD) { 413 + /* 414 + * Compliance Mode Detected. Letting USB Core 415 + * handle the Warm Reset 416 + */ 417 + xhci_dbg(xhci, "Compliance Mode Detected->Port %d!\n", 418 + i + 1); 419 + xhci_dbg(xhci, "Attempting Recovery routine!\n"); 420 + hcd = xhci->shared_hcd; 421 + 422 + if (hcd->state == HC_STATE_SUSPENDED) 423 + usb_hcd_resume_root_hub(hcd); 424 + 425 + usb_hcd_poll_rh_status(hcd); 426 + } 427 + } 428 + 429 + if (xhci->port_status_u0 != ((1 << xhci->num_usb3_ports)-1)) 430 + mod_timer(&xhci->comp_mode_recovery_timer, 431 + jiffies + msecs_to_jiffies(COMP_MODE_RCVRY_MSECS)); 432 + } 433 + 434 + /* 435 + * Quirk to work around issue generated by the SN65LVPE502CP USB3.0 re-driver 436 + * that causes ports behind that hardware to enter compliance mode sometimes. 437 + * The quirk creates a timer that polls every 2 seconds the link state of 438 + * each host controller's port and recovers it by issuing a Warm reset 439 + * if Compliance mode is detected, otherwise the port will become "dead" (no 440 + * device connections or disconnections will be detected anymore). Becasue no 441 + * status event is generated when entering compliance mode (per xhci spec), 442 + * this quirk is needed on systems that have the failing hardware installed. 443 + */ 444 + static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci) 445 + { 446 + xhci->port_status_u0 = 0; 447 + init_timer(&xhci->comp_mode_recovery_timer); 448 + 449 + xhci->comp_mode_recovery_timer.data = (unsigned long) xhci; 450 + xhci->comp_mode_recovery_timer.function = compliance_mode_recovery; 451 + xhci->comp_mode_recovery_timer.expires = jiffies + 452 + msecs_to_jiffies(COMP_MODE_RCVRY_MSECS); 453 + 454 + set_timer_slack(&xhci->comp_mode_recovery_timer, 455 + msecs_to_jiffies(COMP_MODE_RCVRY_MSECS)); 456 + add_timer(&xhci->comp_mode_recovery_timer); 457 + xhci_dbg(xhci, "Compliance Mode Recovery Timer Initialized.\n"); 458 + } 459 + 460 + /* 461 + * This function identifies the systems that have installed the SN65LVPE502CP 462 + * USB3.0 re-driver and that need the Compliance Mode Quirk. 463 + * Systems: 464 + * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 465 + */ 466 + static bool compliance_mode_recovery_timer_quirk_check(void) 467 + { 468 + const char *dmi_product_name, *dmi_sys_vendor; 469 + 470 + dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME); 471 + dmi_sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR); 472 + 473 + if (!(strstr(dmi_sys_vendor, "Hewlett-Packard"))) 474 + return false; 475 + 476 + if (strstr(dmi_product_name, "Z420") || 477 + strstr(dmi_product_name, "Z620") || 478 + strstr(dmi_product_name, "Z820")) 479 + return true; 480 + 481 + return false; 482 + } 483 + 484 + static int xhci_all_ports_seen_u0(struct xhci_hcd *xhci) 485 + { 486 + return (xhci->port_status_u0 == ((1 << xhci->num_usb3_ports)-1)); 487 + } 488 + 489 + 402 490 /* 403 491 * Initialize memory for HCD and xHC (one-time init). 404 492 * ··· 510 420 } 511 421 retval = xhci_mem_init(xhci, GFP_KERNEL); 512 422 xhci_dbg(xhci, "Finished xhci_init\n"); 423 + 424 + /* Initializing Compliance Mode Recovery Data If Needed */ 425 + if (compliance_mode_recovery_timer_quirk_check()) { 426 + xhci->quirks |= XHCI_COMP_MODE_QUIRK; 427 + compliance_mode_recovery_timer_init(xhci); 428 + } 513 429 514 430 return retval; 515 431 } ··· 725 629 del_timer_sync(&xhci->event_ring_timer); 726 630 #endif 727 631 632 + /* Deleting Compliance Mode Recovery Timer */ 633 + if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && 634 + (!(xhci_all_ports_seen_u0(xhci)))) 635 + del_timer_sync(&xhci->comp_mode_recovery_timer); 636 + 728 637 if (xhci->quirks & XHCI_AMD_PLL_FIX) 729 638 usb_amd_dev_put(); 730 639 ··· 760 659 { 761 660 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 762 661 763 - if (xhci->quirks && XHCI_SPURIOUS_REBOOT) 662 + if (xhci->quirks & XHCI_SPURIOUS_REBOOT) 764 663 usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); 765 664 766 665 spin_lock_irq(&xhci->lock); ··· 907 806 } 908 807 spin_unlock_irq(&xhci->lock); 909 808 809 + /* 810 + * Deleting Compliance Mode Recovery Timer because the xHCI Host 811 + * is about to be suspended. 812 + */ 813 + if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && 814 + (!(xhci_all_ports_seen_u0(xhci)))) { 815 + del_timer_sync(&xhci->comp_mode_recovery_timer); 816 + xhci_dbg(xhci, "Compliance Mode Recovery Timer Deleted!\n"); 817 + } 818 + 910 819 /* step 5: remove core well power */ 911 820 /* synchronize irq when using MSI-X */ 912 821 xhci_msix_sync_irqs(xhci); ··· 1049 938 usb_hcd_resume_root_hub(hcd); 1050 939 usb_hcd_resume_root_hub(xhci->shared_hcd); 1051 940 } 941 + 942 + /* 943 + * If system is subject to the Quirk, Compliance Mode Timer needs to 944 + * be re-initialized Always after a system resume. Ports are subject 945 + * to suffer the Compliance Mode issue again. It doesn't matter if 946 + * ports have entered previously to U0 before system's suspension. 947 + */ 948 + if (xhci->quirks & XHCI_COMP_MODE_QUIRK) 949 + compliance_mode_recovery_timer_init(xhci); 950 + 1052 951 return retval; 1053 952 } 1054 953 #endif /* CONFIG_PM */
+6
drivers/usb/host/xhci.h
··· 1495 1495 #define XHCI_LPM_SUPPORT (1 << 11) 1496 1496 #define XHCI_INTEL_HOST (1 << 12) 1497 1497 #define XHCI_SPURIOUS_REBOOT (1 << 13) 1498 + #define XHCI_COMP_MODE_QUIRK (1 << 14) 1498 1499 unsigned int num_active_eps; 1499 1500 unsigned int limit_active_eps; 1500 1501 /* There are two roothubs to keep track of bus suspend info for */ ··· 1512 1511 unsigned sw_lpm_support:1; 1513 1512 /* support xHCI 1.0 spec USB2 hardware LPM */ 1514 1513 unsigned hw_lpm_support:1; 1514 + /* Compliance Mode Recovery Data */ 1515 + struct timer_list comp_mode_recovery_timer; 1516 + u32 port_status_u0; 1517 + /* Compliance Mode Timer Triggered every 2 seconds */ 1518 + #define COMP_MODE_RCVRY_MSECS 2000 1515 1519 }; 1516 1520 1517 1521 /* convert between an HCD pointer and the corresponding EHCI_HCD */
+1 -1
drivers/usb/musb/musb_host.c
··· 2049 2049 * we only have work to do in the former case. 2050 2050 */ 2051 2051 spin_lock_irqsave(&musb->lock, flags); 2052 - if (hep->hcpriv) { 2052 + if (hep->hcpriv || !next_urb(qh)) { 2053 2053 /* some concurrent activity submitted another urb to hep... 2054 2054 * odd, rare, error prone, but legal. 2055 2055 */
+1 -1
drivers/usb/musb/musbhsdma.c
··· 388 388 struct platform_device *pdev = to_platform_device(dev); 389 389 int irq = platform_get_irq_byname(pdev, "dma"); 390 390 391 - if (irq == 0) { 391 + if (irq <= 0) { 392 392 dev_err(dev, "No DMA interrupt line!\n"); 393 393 return NULL; 394 394 }
+1 -1
drivers/usb/musb/tusb6010.c
··· 1215 1215 ret = platform_device_add(musb); 1216 1216 if (ret) { 1217 1217 dev_err(&pdev->dev, "failed to register musb device\n"); 1218 - goto err1; 1218 + goto err2; 1219 1219 } 1220 1220 1221 1221 return 0;
+2 -2
drivers/usb/renesas_usbhs/fifo.c
··· 818 818 usbhs_pipe_is_dcp(pipe)) 819 819 goto usbhsf_pio_prepare_push; 820 820 821 - if (len % 4) /* 32bit alignment */ 821 + if (len & 0x7) /* 8byte alignment */ 822 822 goto usbhsf_pio_prepare_push; 823 823 824 824 if ((uintptr_t)(pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */ ··· 905 905 /* use PIO if packet is less than pio_dma_border */ 906 906 len = usbhsf_fifo_rcv_len(priv, fifo); 907 907 len = min(pkt->length - pkt->actual, len); 908 - if (len % 4) /* 32bit alignment */ 908 + if (len & 0x7) /* 8byte alignment */ 909 909 goto usbhsf_pio_prepare_pop_unselect; 910 910 911 911 if (len < usbhs_get_dparam(priv, pio_dma_border))
+21 -1
drivers/usb/serial/ftdi_sio.c
··· 704 704 { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 705 705 { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 706 706 { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 707 + { USB_DEVICE(FTDI_VID, FTDI_NZR_SEM_USB_PID) }, 707 708 { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, 708 709 { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, 709 710 { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, ··· 805 804 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 806 805 { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), 807 806 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 808 - { USB_DEVICE(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID) }, 807 + { USB_DEVICE_AND_INTERFACE_INFO(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID, 808 + USB_CLASS_VENDOR_SPEC, 809 + USB_SUBCLASS_VENDOR_SPEC, 0x00) }, 809 810 { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 810 811 { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 811 812 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 812 813 { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 813 814 { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, 815 + { USB_DEVICE(FTDI_VID, PI_C865_PID) }, 816 + { USB_DEVICE(FTDI_VID, PI_C857_PID) }, 817 + { USB_DEVICE(PI_VID, PI_C866_PID) }, 818 + { USB_DEVICE(PI_VID, PI_C663_PID) }, 819 + { USB_DEVICE(PI_VID, PI_C725_PID) }, 820 + { USB_DEVICE(PI_VID, PI_E517_PID) }, 821 + { USB_DEVICE(PI_VID, PI_C863_PID) }, 814 822 { USB_DEVICE(PI_VID, PI_E861_PID) }, 823 + { USB_DEVICE(PI_VID, PI_C867_PID) }, 824 + { USB_DEVICE(PI_VID, PI_E609_PID) }, 825 + { USB_DEVICE(PI_VID, PI_E709_PID) }, 826 + { USB_DEVICE(PI_VID, PI_100F_PID) }, 827 + { USB_DEVICE(PI_VID, PI_1011_PID) }, 828 + { USB_DEVICE(PI_VID, PI_1012_PID) }, 829 + { USB_DEVICE(PI_VID, PI_1013_PID) }, 830 + { USB_DEVICE(PI_VID, PI_1014_PID) }, 831 + { USB_DEVICE(PI_VID, PI_1015_PID) }, 832 + { USB_DEVICE(PI_VID, PI_1016_PID) }, 815 833 { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, 816 834 { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, 817 835 { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID),
+27 -2
drivers/usb/serial/ftdi_sio_ids.h
··· 75 75 #define FTDI_OPENDCC_GATEWAY_PID 0xBFDB 76 76 #define FTDI_OPENDCC_GBM_PID 0xBFDC 77 77 78 + /* NZR SEM 16+ USB (http://www.nzr.de) */ 79 + #define FTDI_NZR_SEM_USB_PID 0xC1E0 /* NZR SEM-LOG16+ */ 80 + 78 81 /* 79 82 * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com) 80 83 */ ··· 542 539 /* 543 540 * Microchip Technology, Inc. 544 541 * 545 - * MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are also used by: 542 + * MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are 543 + * used by single function CDC ACM class based firmware demo 544 + * applications. The VID/PID has also been used in firmware 545 + * emulating FTDI serial chips by: 546 546 * Hornby Elite - Digital Command Control Console 547 547 * http://www.hornby.com/hornby-dcc/controllers/ 548 548 */ ··· 797 791 * Physik Instrumente 798 792 * http://www.physikinstrumente.com/en/products/ 799 793 */ 794 + /* These two devices use the VID of FTDI */ 795 + #define PI_C865_PID 0xe0a0 /* PI C-865 Piezomotor Controller */ 796 + #define PI_C857_PID 0xe0a1 /* PI Encoder Trigger Box */ 797 + 800 798 #define PI_VID 0x1a72 /* Vendor ID */ 801 - #define PI_E861_PID 0x1008 /* E-861 piezo controller USB connection */ 799 + #define PI_C866_PID 0x1000 /* PI C-866 Piezomotor Controller */ 800 + #define PI_C663_PID 0x1001 /* PI C-663 Mercury-Step */ 801 + #define PI_C725_PID 0x1002 /* PI C-725 Piezomotor Controller */ 802 + #define PI_E517_PID 0x1005 /* PI E-517 Digital Piezo Controller Operation Module */ 803 + #define PI_C863_PID 0x1007 /* PI C-863 */ 804 + #define PI_E861_PID 0x1008 /* PI E-861 Piezomotor Controller */ 805 + #define PI_C867_PID 0x1009 /* PI C-867 Piezomotor Controller */ 806 + #define PI_E609_PID 0x100D /* PI E-609 Digital Piezo Controller */ 807 + #define PI_E709_PID 0x100E /* PI E-709 Digital Piezo Controller */ 808 + #define PI_100F_PID 0x100F /* PI Digital Piezo Controller */ 809 + #define PI_1011_PID 0x1011 /* PI Digital Piezo Controller */ 810 + #define PI_1012_PID 0x1012 /* PI Motion Controller */ 811 + #define PI_1013_PID 0x1013 /* PI Motion Controller */ 812 + #define PI_1014_PID 0x1014 /* PI Device */ 813 + #define PI_1015_PID 0x1015 /* PI Device */ 814 + #define PI_1016_PID 0x1016 /* PI Digital Servo Module */ 802 815 803 816 /* 804 817 * Kondo Kagaku Co.Ltd.
+4 -2
drivers/usb/serial/option.c
··· 886 886 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), 887 887 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 888 888 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, 889 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1018, 0xff, 0xff, 0xff), 890 - .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, 891 889 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) }, 892 890 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) }, 893 891 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) }, ··· 1090 1092 .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, 1091 1093 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), 1092 1094 .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, 1095 + { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, 1096 + { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, 1097 + { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, 1098 + 1093 1099 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, 1094 1100 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, 1095 1101 { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */
+2 -6
fs/btrfs/qgroup.c
··· 1371 1371 1372 1372 if (srcid) { 1373 1373 srcgroup = find_qgroup_rb(fs_info, srcid); 1374 - if (!srcgroup) { 1375 - ret = -EINVAL; 1374 + if (!srcgroup) 1376 1375 goto unlock; 1377 - } 1378 1376 dstgroup->rfer = srcgroup->rfer - level_size; 1379 1377 dstgroup->rfer_cmpr = srcgroup->rfer_cmpr - level_size; 1380 1378 srcgroup->excl = level_size; ··· 1381 1383 qgroup_dirty(fs_info, srcgroup); 1382 1384 } 1383 1385 1384 - if (!inherit) { 1385 - ret = -EINVAL; 1386 + if (!inherit) 1386 1387 goto unlock; 1387 - } 1388 1388 1389 1389 i_qgroups = (u64 *)(inherit + 1); 1390 1390 for (i = 0; i < inherit->num_qgroups; ++i) {
+1 -1
fs/cifs/file.c
··· 917 917 if (!buf) { 918 918 mutex_unlock(&cinode->lock_mutex); 919 919 free_xid(xid); 920 - return rc; 920 + return -ENOMEM; 921 921 } 922 922 923 923 for (i = 0; i < 2; i++) {
+2 -2
fs/cifs/smb2pdu.h
··· 96 96 * 97 97 */ 98 98 99 - #define SMB2_HEADER_STRUCTURE_SIZE __constant_le16_to_cpu(64) 99 + #define SMB2_HEADER_STRUCTURE_SIZE __constant_cpu_to_le16(64) 100 100 101 101 struct smb2_hdr { 102 102 __be32 smb2_buf_length; /* big endian on wire */ ··· 140 140 * 141 141 */ 142 142 143 - #define SMB2_ERROR_STRUCTURE_SIZE2 __constant_le16_to_cpu(9) 143 + #define SMB2_ERROR_STRUCTURE_SIZE2 __constant_cpu_to_le16(9) 144 144 145 145 struct smb2_err_rsp { 146 146 struct smb2_hdr hdr;
+8 -2
fs/ecryptfs/file.c
··· 275 275 276 276 static int ecryptfs_flush(struct file *file, fl_owner_t td) 277 277 { 278 - return file->f_mode & FMODE_WRITE 279 - ? filemap_write_and_wait(file->f_mapping) : 0; 278 + struct file *lower_file = ecryptfs_file_to_lower(file); 279 + 280 + if (lower_file->f_op && lower_file->f_op->flush) { 281 + filemap_write_and_wait(file->f_mapping); 282 + return lower_file->f_op->flush(lower_file, td); 283 + } 284 + 285 + return 0; 280 286 } 281 287 282 288 static int ecryptfs_release(struct inode *inode, struct file *file)
+5
fs/ecryptfs/inode.c
··· 619 619 struct dentry *lower_old_dir_dentry; 620 620 struct dentry *lower_new_dir_dentry; 621 621 struct dentry *trap = NULL; 622 + struct inode *target_inode; 622 623 623 624 lower_old_dentry = ecryptfs_dentry_to_lower(old_dentry); 624 625 lower_new_dentry = ecryptfs_dentry_to_lower(new_dentry); ··· 627 626 dget(lower_new_dentry); 628 627 lower_old_dir_dentry = dget_parent(lower_old_dentry); 629 628 lower_new_dir_dentry = dget_parent(lower_new_dentry); 629 + target_inode = new_dentry->d_inode; 630 630 trap = lock_rename(lower_old_dir_dentry, lower_new_dir_dentry); 631 631 /* source should not be ancestor of target */ 632 632 if (trap == lower_old_dentry) { ··· 643 641 lower_new_dir_dentry->d_inode, lower_new_dentry); 644 642 if (rc) 645 643 goto out_lock; 644 + if (target_inode) 645 + fsstack_copy_attr_all(target_inode, 646 + ecryptfs_inode_to_lower(target_inode)); 646 647 fsstack_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode); 647 648 if (new_dir != old_dir) 648 649 fsstack_copy_attr_all(old_dir, lower_old_dir_dentry->d_inode);
+1
fs/ecryptfs/main.c
··· 162 162 inode_info = ecryptfs_inode_to_private(inode); 163 163 if (atomic_dec_and_mutex_lock(&inode_info->lower_file_count, 164 164 &inode_info->lower_file_mutex)) { 165 + filemap_write_and_wait(inode->i_mapping); 165 166 fput(inode_info->lower_file); 166 167 inode_info->lower_file = NULL; 167 168 mutex_unlock(&inode_info->lower_file_mutex);
+14 -3
fs/ext3/inode.c
··· 3072 3072 struct ext3_inode_info *ei = EXT3_I(inode); 3073 3073 struct buffer_head *bh = iloc->bh; 3074 3074 int err = 0, rc, block; 3075 + int need_datasync = 0; 3076 + __le32 disksize; 3075 3077 uid_t i_uid; 3076 3078 gid_t i_gid; 3077 3079 ··· 3115 3113 raw_inode->i_gid_high = 0; 3116 3114 } 3117 3115 raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); 3118 - raw_inode->i_size = cpu_to_le32(ei->i_disksize); 3116 + disksize = cpu_to_le32(ei->i_disksize); 3117 + if (disksize != raw_inode->i_size) { 3118 + need_datasync = 1; 3119 + raw_inode->i_size = disksize; 3120 + } 3119 3121 raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec); 3120 3122 raw_inode->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec); 3121 3123 raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); ··· 3135 3129 if (!S_ISREG(inode->i_mode)) { 3136 3130 raw_inode->i_dir_acl = cpu_to_le32(ei->i_dir_acl); 3137 3131 } else { 3138 - raw_inode->i_size_high = 3139 - cpu_to_le32(ei->i_disksize >> 32); 3132 + disksize = cpu_to_le32(ei->i_disksize >> 32); 3133 + if (disksize != raw_inode->i_size_high) { 3134 + raw_inode->i_size_high = disksize; 3135 + need_datasync = 1; 3136 + } 3140 3137 if (ei->i_disksize > 0x7fffffffULL) { 3141 3138 struct super_block *sb = inode->i_sb; 3142 3139 if (!EXT3_HAS_RO_COMPAT_FEATURE(sb, ··· 3192 3183 ext3_clear_inode_state(inode, EXT3_STATE_NEW); 3193 3184 3194 3185 atomic_set(&ei->i_sync_tid, handle->h_transaction->t_tid); 3186 + if (need_datasync) 3187 + atomic_set(&ei->i_datasync_tid, handle->h_transaction->t_tid); 3195 3188 out_brelse: 3196 3189 brelse (bh); 3197 3190 ext3_std_error(inode->i_sb, err);
+2 -2
fs/fuse/control.c
··· 117 117 const char __user *buf, 118 118 size_t count, loff_t *ppos) 119 119 { 120 - unsigned val; 120 + unsigned uninitialized_var(val); 121 121 ssize_t ret; 122 122 123 123 ret = fuse_conn_limit_write(file, buf, count, ppos, &val, ··· 154 154 const char __user *buf, 155 155 size_t count, loff_t *ppos) 156 156 { 157 - unsigned val; 157 + unsigned uninitialized_var(val); 158 158 ssize_t ret; 159 159 160 160 ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
+1 -3
fs/fuse/cuse.c
··· 396 396 err_region: 397 397 unregister_chrdev_region(devt, 1); 398 398 err: 399 - fc->conn_error = 1; 399 + fuse_conn_kill(fc); 400 400 goto out; 401 401 } 402 402 ··· 532 532 cdev_del(cc->cdev); 533 533 } 534 534 535 - /* kill connection and shutdown channel */ 536 - fuse_conn_kill(&cc->fc); 537 535 rc = fuse_dev_release(inode, file); /* puts the base reference */ 538 536 539 537 return rc;
+1
fs/fuse/dev.c
··· 1576 1576 req->pages[req->num_pages] = page; 1577 1577 req->num_pages++; 1578 1578 1579 + offset = 0; 1579 1580 num -= this_num; 1580 1581 total_len += this_num; 1581 1582 index++;
+7 -5
fs/fuse/inode.c
··· 367 367 wake_up_all(&fc->waitq); 368 368 wake_up_all(&fc->blocked_waitq); 369 369 wake_up_all(&fc->reserved_req_waitq); 370 - mutex_lock(&fuse_mutex); 371 - list_del(&fc->entry); 372 - fuse_ctl_remove_conn(fc); 373 - mutex_unlock(&fuse_mutex); 374 - fuse_bdi_destroy(fc); 375 370 } 376 371 EXPORT_SYMBOL_GPL(fuse_conn_kill); 377 372 ··· 375 380 struct fuse_conn *fc = get_fuse_conn_super(sb); 376 381 377 382 fuse_send_destroy(fc); 383 + 378 384 fuse_conn_kill(fc); 385 + mutex_lock(&fuse_mutex); 386 + list_del(&fc->entry); 387 + fuse_ctl_remove_conn(fc); 388 + mutex_unlock(&fuse_mutex); 389 + fuse_bdi_destroy(fc); 390 + 379 391 fuse_conn_put(fc); 380 392 } 381 393
+27 -4
fs/gfs2/file.c
··· 323 323 } 324 324 325 325 /** 326 + * gfs2_size_hint - Give a hint to the size of a write request 327 + * @file: The struct file 328 + * @offset: The file offset of the write 329 + * @size: The length of the write 330 + * 331 + * When we are about to do a write, this function records the total 332 + * write size in order to provide a suitable hint to the lower layers 333 + * about how many blocks will be required. 334 + * 335 + */ 336 + 337 + static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size) 338 + { 339 + struct inode *inode = filep->f_dentry->d_inode; 340 + struct gfs2_sbd *sdp = GFS2_SB(inode); 341 + struct gfs2_inode *ip = GFS2_I(inode); 342 + size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift; 343 + int hint = min_t(size_t, INT_MAX, blks); 344 + 345 + atomic_set(&ip->i_res->rs_sizehint, hint); 346 + } 347 + 348 + /** 326 349 * gfs2_allocate_page_backing - Use bmap to allocate blocks 327 350 * @page: The (locked) page to allocate backing for 328 351 * ··· 405 382 if (ret) 406 383 return ret; 407 384 408 - atomic_set(&ip->i_res->rs_sizehint, 409 - PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift); 385 + gfs2_size_hint(vma->vm_file, pos, PAGE_CACHE_SIZE); 410 386 411 387 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 412 388 ret = gfs2_glock_nq(&gh); ··· 685 663 if (ret) 686 664 return ret; 687 665 688 - atomic_set(&ip->i_res->rs_sizehint, writesize >> sdp->sd_sb.sb_bsize_shift); 666 + gfs2_size_hint(file, pos, writesize); 667 + 689 668 if (file->f_flags & O_APPEND) { 690 669 struct gfs2_holder gh; 691 670 ··· 812 789 if (unlikely(error)) 813 790 goto out_uninit; 814 791 815 - atomic_set(&ip->i_res->rs_sizehint, len >> sdp->sd_sb.sb_bsize_shift); 792 + gfs2_size_hint(file, offset, len); 816 793 817 794 while (len > 0) { 818 795 if (len < bytes)
+6 -2
fs/gfs2/inode.c
··· 1722 1722 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 1723 1723 ret = gfs2_glock_nq(&gh); 1724 1724 if (ret == 0) { 1725 - ret = generic_setxattr(dentry, name, data, size, flags); 1725 + ret = gfs2_rs_alloc(ip); 1726 + if (ret == 0) 1727 + ret = generic_setxattr(dentry, name, data, size, flags); 1726 1728 gfs2_glock_dq(&gh); 1727 1729 } 1728 1730 gfs2_holder_uninit(&gh); ··· 1759 1757 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 1760 1758 ret = gfs2_glock_nq(&gh); 1761 1759 if (ret == 0) { 1762 - ret = generic_removexattr(dentry, name); 1760 + ret = gfs2_rs_alloc(ip); 1761 + if (ret == 0) 1762 + ret = generic_removexattr(dentry, name); 1763 1763 gfs2_glock_dq(&gh); 1764 1764 } 1765 1765 gfs2_holder_uninit(&gh);
+30 -40
fs/gfs2/rgrp.c
··· 1961 1961 * @dinode: 1 if this block is a dinode block, otherwise data block 1962 1962 * @nblocks: desired extent length 1963 1963 * 1964 - * Lay claim to previously allocated block reservation blocks. 1964 + * Lay claim to previously reserved blocks. 1965 1965 * Returns: Starting block number of the blocks claimed. 1966 1966 * Sets *nblocks to the actual extent length allocated. 1967 1967 */ ··· 1970 1970 { 1971 1971 struct gfs2_blkreserv *rs = ip->i_res; 1972 1972 struct gfs2_rgrpd *rgd = rs->rs_rgd; 1973 - struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1974 1973 struct gfs2_bitmap *bi; 1975 1974 u64 start_block = gfs2_rs_startblk(rs); 1976 1975 const unsigned int elen = *nblocks; 1977 1976 1978 - /*BUG_ON(!gfs2_glock_is_locked_by_me(ip->i_gl));*/ 1979 - gfs2_assert_withdraw(sdp, rgd); 1980 - /*BUG_ON(!gfs2_glock_is_locked_by_me(rgd->rd_gl));*/ 1981 1977 bi = rs->rs_bi; 1982 1978 gfs2_trans_add_bh(rgd->rd_gl, bi->bi_bh, 1); 1983 1979 1984 1980 for (*nblocks = 0; *nblocks < elen && rs->rs_free; (*nblocks)++) { 1985 - /* Make sure the bitmap hasn't changed */ 1981 + if (gfs2_testbit(rgd, bi->bi_bh->b_data + bi->bi_offset, 1982 + bi->bi_len, rs->rs_biblk) != GFS2_BLKST_FREE) 1983 + break; 1986 1984 gfs2_setbit(rgd, bi->bi_clone, bi, rs->rs_biblk, 1987 1985 dinode ? GFS2_BLKST_DINODE : GFS2_BLKST_USED); 1988 1986 rs->rs_biblk++; ··· 1989 1991 BUG_ON(!rgd->rd_reserved); 1990 1992 rgd->rd_reserved--; 1991 1993 dinode = false; 1992 - trace_gfs2_rs(ip, rs, TRACE_RS_CLAIM); 1993 1994 } 1994 1995 1995 - if (!rs->rs_free) { 1996 - struct gfs2_rgrpd *rgd = ip->i_res->rs_rgd; 1997 - 1996 + trace_gfs2_rs(ip, rs, TRACE_RS_CLAIM); 1997 + if (!rs->rs_free || *nblocks != elen) 1998 1998 gfs2_rs_deltree(rs); 1999 - /* -nblocks because we haven't returned to do the math yet. 2000 - I'm doing the math backwards to prevent negative numbers, 2001 - but think of it as: 2002 - if (unclaimed_blocks(rgd) - *nblocks >= RGRP_RSRV_MINBLKS */ 2003 - if (unclaimed_blocks(rgd) >= RGRP_RSRV_MINBLKS + *nblocks) 2004 - rg_mblk_search(rgd, ip); 2005 - } 1999 + 2006 2000 return start_block; 2007 2001 } 2008 2002 ··· 2027 2037 if (ip->i_res->rs_requested == 0) 2028 2038 return -ECANCELED; 2029 2039 2030 - /* Check if we have a multi-block reservation, and if so, claim the 2031 - next free block from it. */ 2040 + /* If we have a reservation, claim blocks from it. */ 2032 2041 if (gfs2_rs_active(ip->i_res)) { 2033 2042 BUG_ON(!ip->i_res->rs_free); 2034 2043 rgd = ip->i_res->rs_rgd; 2035 2044 block = claim_reserved_blks(ip, dinode, nblocks); 2036 - } else { 2037 - rgd = ip->i_rgd; 2038 - 2039 - if (!dinode && rgrp_contains_block(rgd, ip->i_goal)) 2040 - goal = ip->i_goal - rgd->rd_data0; 2041 - else 2042 - goal = rgd->rd_last_alloc; 2043 - 2044 - blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, &bi); 2045 - 2046 - /* Since all blocks are reserved in advance, this shouldn't 2047 - happen */ 2048 - if (blk == BFITNOENT) { 2049 - printk(KERN_WARNING "BFITNOENT, nblocks=%u\n", 2050 - *nblocks); 2051 - printk(KERN_WARNING "FULL=%d\n", 2052 - test_bit(GBF_FULL, &rgd->rd_bits->bi_flags)); 2053 - goto rgrp_error; 2054 - } 2055 - 2056 - block = gfs2_alloc_extent(rgd, bi, blk, dinode, nblocks); 2045 + if (*nblocks) 2046 + goto found_blocks; 2057 2047 } 2048 + 2049 + rgd = ip->i_rgd; 2050 + 2051 + if (!dinode && rgrp_contains_block(rgd, ip->i_goal)) 2052 + goal = ip->i_goal - rgd->rd_data0; 2053 + else 2054 + goal = rgd->rd_last_alloc; 2055 + 2056 + blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, &bi); 2057 + 2058 + /* Since all blocks are reserved in advance, this shouldn't happen */ 2059 + if (blk == BFITNOENT) { 2060 + printk(KERN_WARNING "BFITNOENT, nblocks=%u\n", *nblocks); 2061 + printk(KERN_WARNING "FULL=%d\n", 2062 + test_bit(GBF_FULL, &rgd->rd_bits->bi_flags)); 2063 + goto rgrp_error; 2064 + } 2065 + 2066 + block = gfs2_alloc_extent(rgd, bi, blk, dinode, nblocks); 2067 + found_blocks: 2058 2068 ndata = *nblocks; 2059 2069 if (dinode) 2060 2070 ndata--;
+3 -1
fs/nfs/file.c
··· 287 287 struct inode *inode = file->f_path.dentry->d_inode; 288 288 289 289 ret = filemap_write_and_wait_range(inode->i_mapping, start, end); 290 + if (ret != 0) 291 + goto out; 290 292 mutex_lock(&inode->i_mutex); 291 293 ret = nfs_file_fsync_commit(file, start, end, datasync); 292 294 mutex_unlock(&inode->i_mutex); 293 - 295 + out: 294 296 return ret; 295 297 } 296 298
+1 -1
fs/nfs/inode.c
··· 154 154 nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); 155 155 nfsi->attrtimeo_timestamp = jiffies; 156 156 157 - memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); 157 + memset(NFS_I(inode)->cookieverf, 0, sizeof(NFS_I(inode)->cookieverf)); 158 158 if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) 159 159 nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; 160 160 else
+1 -1
fs/nfs/nfs3proc.c
··· 643 643 u64 cookie, struct page **pages, unsigned int count, int plus) 644 644 { 645 645 struct inode *dir = dentry->d_inode; 646 - __be32 *verf = NFS_COOKIEVERF(dir); 646 + __be32 *verf = NFS_I(dir)->cookieverf; 647 647 struct nfs3_readdirargs arg = { 648 648 .fh = NFS_FH(dir), 649 649 .cookie = cookie,
+3 -1
fs/nfs/nfs4file.c
··· 96 96 struct inode *inode = file->f_path.dentry->d_inode; 97 97 98 98 ret = filemap_write_and_wait_range(inode->i_mapping, start, end); 99 + if (ret != 0) 100 + goto out; 99 101 mutex_lock(&inode->i_mutex); 100 102 ret = nfs_file_fsync_commit(file, start, end, datasync); 101 103 if (!ret && !datasync) 102 104 /* application has asked for meta-data sync */ 103 105 ret = pnfs_layoutcommit_inode(inode, true); 104 106 mutex_unlock(&inode->i_mutex); 105 - 107 + out: 106 108 return ret; 107 109 } 108 110
+25 -30
fs/nfs/nfs4proc.c
··· 3215 3215 dentry->d_parent->d_name.name, 3216 3216 dentry->d_name.name, 3217 3217 (unsigned long long)cookie); 3218 - nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args); 3218 + nfs4_setup_readdir(cookie, NFS_I(dir)->cookieverf, dentry, &args); 3219 3219 res.pgbase = args.pgbase; 3220 3220 status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); 3221 3221 if (status >= 0) { 3222 - memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE); 3222 + memcpy(NFS_I(dir)->cookieverf, res.verifier.data, NFS4_VERIFIER_SIZE); 3223 3223 status += args.pgbase; 3224 3224 } 3225 3225 ··· 3653 3653 && (server->acl_bitmask & ACL4_SUPPORT_DENY_ACL); 3654 3654 } 3655 3655 3656 - /* Assuming that XATTR_SIZE_MAX is a multiple of PAGE_CACHE_SIZE, and that 3657 - * it's OK to put sizeof(void) * (XATTR_SIZE_MAX/PAGE_CACHE_SIZE) bytes on 3656 + /* Assuming that XATTR_SIZE_MAX is a multiple of PAGE_SIZE, and that 3657 + * it's OK to put sizeof(void) * (XATTR_SIZE_MAX/PAGE_SIZE) bytes on 3658 3658 * the stack. 3659 3659 */ 3660 - #define NFS4ACL_MAXPAGES (XATTR_SIZE_MAX >> PAGE_CACHE_SHIFT) 3660 + #define NFS4ACL_MAXPAGES DIV_ROUND_UP(XATTR_SIZE_MAX, PAGE_SIZE) 3661 3661 3662 3662 static int buf_to_pages_noslab(const void *buf, size_t buflen, 3663 3663 struct page **pages, unsigned int *pgbase) ··· 3668 3668 spages = pages; 3669 3669 3670 3670 do { 3671 - len = min_t(size_t, PAGE_CACHE_SIZE, buflen); 3671 + len = min_t(size_t, PAGE_SIZE, buflen); 3672 3672 newpage = alloc_page(GFP_KERNEL); 3673 3673 3674 3674 if (newpage == NULL) ··· 3739 3739 struct nfs4_cached_acl *acl; 3740 3740 size_t buflen = sizeof(*acl) + acl_len; 3741 3741 3742 - if (pages && buflen <= PAGE_SIZE) { 3742 + if (buflen <= PAGE_SIZE) { 3743 3743 acl = kmalloc(buflen, GFP_KERNEL); 3744 3744 if (acl == NULL) 3745 3745 goto out; ··· 3782 3782 .rpc_argp = &args, 3783 3783 .rpc_resp = &res, 3784 3784 }; 3785 - int ret = -ENOMEM, npages, i; 3786 - size_t acl_len = 0; 3785 + unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE); 3786 + int ret = -ENOMEM, i; 3787 3787 3788 - npages = (buflen + PAGE_SIZE - 1) >> PAGE_SHIFT; 3789 3788 /* As long as we're doing a round trip to the server anyway, 3790 3789 * let's be prepared for a page of acl data. */ 3791 3790 if (npages == 0) 3792 3791 npages = 1; 3793 - 3794 - /* Add an extra page to handle the bitmap returned */ 3795 - npages++; 3792 + if (npages > ARRAY_SIZE(pages)) 3793 + return -ERANGE; 3796 3794 3797 3795 for (i = 0; i < npages; i++) { 3798 3796 pages[i] = alloc_page(GFP_KERNEL); ··· 3806 3808 args.acl_len = npages * PAGE_SIZE; 3807 3809 args.acl_pgbase = 0; 3808 3810 3809 - /* Let decode_getfacl know not to fail if the ACL data is larger than 3810 - * the page we send as a guess */ 3811 - if (buf == NULL) 3812 - res.acl_flags |= NFS4_ACL_LEN_REQUEST; 3813 - 3814 3811 dprintk("%s buf %p buflen %zu npages %d args.acl_len %zu\n", 3815 3812 __func__, buf, buflen, npages, args.acl_len); 3816 3813 ret = nfs4_call_sync(NFS_SERVER(inode)->client, NFS_SERVER(inode), ··· 3813 3820 if (ret) 3814 3821 goto out_free; 3815 3822 3816 - acl_len = res.acl_len; 3817 - if (acl_len > args.acl_len) 3818 - nfs4_write_cached_acl(inode, NULL, 0, acl_len); 3819 - else 3820 - nfs4_write_cached_acl(inode, pages, res.acl_data_offset, 3821 - acl_len); 3822 - if (buf) { 3823 + /* Handle the case where the passed-in buffer is too short */ 3824 + if (res.acl_flags & NFS4_ACL_TRUNC) { 3825 + /* Did the user only issue a request for the acl length? */ 3826 + if (buf == NULL) 3827 + goto out_ok; 3823 3828 ret = -ERANGE; 3824 - if (acl_len > buflen) 3825 - goto out_free; 3826 - _copy_from_pages(buf, pages, res.acl_data_offset, 3827 - acl_len); 3829 + goto out_free; 3828 3830 } 3829 - ret = acl_len; 3831 + nfs4_write_cached_acl(inode, pages, res.acl_data_offset, res.acl_len); 3832 + if (buf) 3833 + _copy_from_pages(buf, pages, res.acl_data_offset, res.acl_len); 3834 + out_ok: 3835 + ret = res.acl_len; 3830 3836 out_free: 3831 3837 for (i = 0; i < npages; i++) 3832 3838 if (pages[i]) ··· 3883 3891 .rpc_argp = &arg, 3884 3892 .rpc_resp = &res, 3885 3893 }; 3894 + unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE); 3886 3895 int ret, i; 3887 3896 3888 3897 if (!nfs4_server_supports_acls(server)) 3889 3898 return -EOPNOTSUPP; 3899 + if (npages > ARRAY_SIZE(pages)) 3900 + return -ERANGE; 3890 3901 i = buf_to_pages_noslab(buf, buflen, arg.acl_pages, &arg.acl_pgbase); 3891 3902 if (i < 0) 3892 3903 return i;
+7 -10
fs/nfs/nfs4xdr.c
··· 5072 5072 * are stored with the acl data to handle the problem of 5073 5073 * variable length bitmaps.*/ 5074 5074 res->acl_data_offset = xdr_stream_pos(xdr) - pg_offset; 5075 - 5076 - /* We ignore &savep and don't do consistency checks on 5077 - * the attr length. Let userspace figure it out.... */ 5078 5075 res->acl_len = attrlen; 5079 - if (attrlen > (xdr->nwords << 2)) { 5080 - if (res->acl_flags & NFS4_ACL_LEN_REQUEST) { 5081 - /* getxattr interface called with a NULL buf */ 5082 - goto out; 5083 - } 5076 + 5077 + /* Check for receive buffer overflow */ 5078 + if (res->acl_len > (xdr->nwords << 2) || 5079 + res->acl_len + res->acl_data_offset > xdr->buf->page_len) { 5080 + res->acl_flags |= NFS4_ACL_TRUNC; 5084 5081 dprintk("NFS: acl reply: attrlen %u > page_len %u\n", 5085 5082 attrlen, xdr->nwords << 2); 5086 - return -EINVAL; 5087 5083 } 5088 5084 } else 5089 5085 status = -EOPNOTSUPP; ··· 6225 6229 status = decode_open(xdr, res); 6226 6230 if (status) 6227 6231 goto out; 6228 - if (decode_getfh(xdr, &res->fh) != 0) 6232 + status = decode_getfh(xdr, &res->fh); 6233 + if (status) 6229 6234 goto out; 6230 6235 decode_getfattr(xdr, res->f_attr, res->server); 6231 6236 out:
+2
fs/nfs/super.c
··· 1867 1867 1868 1868 memcpy(sap, &data->addr, sizeof(data->addr)); 1869 1869 args->nfs_server.addrlen = sizeof(data->addr); 1870 + args->nfs_server.port = ntohs(data->addr.sin_port); 1870 1871 if (!nfs_verify_server_address(sap)) 1871 1872 goto out_no_address; 1872 1873 ··· 2565 2564 return -EFAULT; 2566 2565 if (!nfs_verify_server_address(sap)) 2567 2566 goto out_no_address; 2567 + args->nfs_server.port = ntohs(((struct sockaddr_in *)sap)->sin_port); 2568 2568 2569 2569 if (data->auth_flavourlen) { 2570 2570 if (data->auth_flavourlen > 1)
+1 -1
fs/stat.c
··· 58 58 int vfs_fstat(unsigned int fd, struct kstat *stat) 59 59 { 60 60 int fput_needed; 61 - struct file *f = fget_light(fd, &fput_needed); 61 + struct file *f = fget_raw_light(fd, &fput_needed); 62 62 int error = -EBADF; 63 63 64 64 if (f) {
+29 -6
fs/udf/file.c
··· 39 39 #include "udf_i.h" 40 40 #include "udf_sb.h" 41 41 42 - static int udf_adinicb_readpage(struct file *file, struct page *page) 42 + static void __udf_adinicb_readpage(struct page *page) 43 43 { 44 44 struct inode *inode = page->mapping->host; 45 45 char *kaddr; 46 46 struct udf_inode_info *iinfo = UDF_I(inode); 47 47 48 - BUG_ON(!PageLocked(page)); 49 - 50 48 kaddr = kmap(page); 51 - memset(kaddr, 0, PAGE_CACHE_SIZE); 52 49 memcpy(kaddr, iinfo->i_ext.i_data + iinfo->i_lenEAttr, inode->i_size); 50 + memset(kaddr + inode->i_size, 0, PAGE_CACHE_SIZE - inode->i_size); 53 51 flush_dcache_page(page); 54 52 SetPageUptodate(page); 55 53 kunmap(page); 54 + } 55 + 56 + static int udf_adinicb_readpage(struct file *file, struct page *page) 57 + { 58 + BUG_ON(!PageLocked(page)); 59 + __udf_adinicb_readpage(page); 56 60 unlock_page(page); 57 61 58 62 return 0; ··· 81 77 return 0; 82 78 } 83 79 80 + static int udf_adinicb_write_begin(struct file *file, 81 + struct address_space *mapping, loff_t pos, 82 + unsigned len, unsigned flags, struct page **pagep, 83 + void **fsdata) 84 + { 85 + struct page *page; 86 + 87 + if (WARN_ON_ONCE(pos >= PAGE_CACHE_SIZE)) 88 + return -EIO; 89 + page = grab_cache_page_write_begin(mapping, 0, flags); 90 + if (!page) 91 + return -ENOMEM; 92 + *pagep = page; 93 + 94 + if (!PageUptodate(page) && len != PAGE_CACHE_SIZE) 95 + __udf_adinicb_readpage(page); 96 + return 0; 97 + } 98 + 84 99 static int udf_adinicb_write_end(struct file *file, 85 100 struct address_space *mapping, 86 101 loff_t pos, unsigned len, unsigned copied, ··· 121 98 const struct address_space_operations udf_adinicb_aops = { 122 99 .readpage = udf_adinicb_readpage, 123 100 .writepage = udf_adinicb_writepage, 124 - .write_begin = simple_write_begin, 125 - .write_end = udf_adinicb_write_end, 101 + .write_begin = udf_adinicb_write_begin, 102 + .write_end = udf_adinicb_write_end, 126 103 }; 127 104 128 105 static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
+1 -5
include/drm/drm_fourcc.h
··· 107 107 #define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ 108 108 #define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ 109 109 110 - /* 2 non contiguous plane YCbCr */ 111 - #define DRM_FORMAT_NV12M fourcc_code('N', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane */ 110 + /* special NV12 tiled format */ 112 111 #define DRM_FORMAT_NV12MT fourcc_code('T', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane 64x32 macroblocks */ 113 112 114 113 /* ··· 129 130 #define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ 130 131 #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ 131 132 #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ 132 - 133 - /* 3 non contiguous plane YCbCr */ 134 - #define DRM_FORMAT_YUV420M fourcc_code('Y', 'M', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ 135 133 136 134 #endif /* DRM_FOURCC_H */
+1
include/linux/atmel-ssc.h
··· 3 3 4 4 #include <linux/platform_device.h> 5 5 #include <linux/list.h> 6 + #include <linux/io.h> 6 7 7 8 struct ssc_device { 8 9 struct list_head list;
+1
include/linux/i2c-pnx.h
··· 22 22 struct timer_list timer; /* Timeout */ 23 23 u8 * buf; /* Data buffer */ 24 24 int len; /* Length of data buffer */ 25 + int order; /* RX Bytes to order via TX */ 25 26 }; 26 27 27 28 struct i2c_pnx_algo_data {
+1 -1
include/linux/kobject.h
··· 224 224 225 225 static inline __printf(2, 3) 226 226 int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) 227 - { return 0; } 227 + { return -ENOMEM; } 228 228 229 229 static inline int kobject_action_type(const char *buf, size_t count, 230 230 enum kobject_action *type)
+1 -1
include/linux/mISDNhw.h
··· 183 183 unsigned short); 184 184 extern int mISDN_freedchannel(struct dchannel *); 185 185 extern void mISDN_clear_bchannel(struct bchannel *); 186 - extern int mISDN_freebchannel(struct bchannel *); 186 + extern void mISDN_freebchannel(struct bchannel *); 187 187 extern int mISDN_ctrl_bchannel(struct bchannel *, struct mISDN_ctrl_req *); 188 188 extern void queue_ch_frame(struct mISDNchannel *, u_int, 189 189 int, struct sk_buff *);
+4 -2
include/linux/mfd/abx500/ab8500-codec.h
··· 23 23 /* Mic-biases */ 24 24 enum amic_micbias { 25 25 AMIC_MICBIAS_VAMIC1, 26 - AMIC_MICBIAS_VAMIC2 26 + AMIC_MICBIAS_VAMIC2, 27 + AMIC_MICBIAS_UNKNOWN 27 28 }; 28 29 29 30 /* Bias-voltage */ ··· 32 31 EAR_CMV_0_95V, 33 32 EAR_CMV_1_10V, 34 33 EAR_CMV_1_27V, 35 - EAR_CMV_1_58V 34 + EAR_CMV_1_58V, 35 + EAR_CMV_UNKNOWN 36 36 }; 37 37 38 38 /* Analog microphone settings */
+3 -1
include/linux/mfd/core.h
··· 16 16 17 17 #include <linux/platform_device.h> 18 18 19 + struct irq_domain; 20 + 19 21 /* 20 22 * This struct describes the MFD part ("cell"). 21 23 * After registration the copy of this structure will become the platform data ··· 100 98 extern int mfd_add_devices(struct device *parent, int id, 101 99 struct mfd_cell *cells, int n_devs, 102 100 struct resource *mem_base, 103 - int irq_base); 101 + int irq_base, struct irq_domain *irq_domain); 104 102 105 103 extern void mfd_remove_devices(struct device *parent); 106 104
+9 -3
include/linux/mfd/tps65217.h
··· 22 22 #include <linux/regulator/driver.h> 23 23 #include <linux/regulator/machine.h> 24 24 25 + /* TPS chip id list */ 26 + #define TPS65217 0xF0 27 + 25 28 /* I2C ID for TPS65217 part */ 26 29 #define TPS65217_I2C_ID 0x24 27 30 ··· 251 248 struct tps65217 { 252 249 struct device *dev; 253 250 struct tps65217_board *pdata; 251 + unsigned int id; 254 252 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 255 253 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 256 254 struct tps_info *info[TPS65217_NUM_REGULATOR]; 257 255 struct regmap *regmap; 258 - 259 - /* Client devices */ 260 - struct platform_device *regulator_pdev[TPS65217_NUM_REGULATOR]; 261 256 }; 262 257 263 258 static inline struct tps65217 *dev_to_tps65217(struct device *dev) 264 259 { 265 260 return dev_get_drvdata(dev); 261 + } 262 + 263 + static inline int tps65217_chip_id(struct tps65217 *tps65217) 264 + { 265 + return tps65217->id; 266 266 } 267 267 268 268 int tps65217_reg_read(struct tps65217 *tps, unsigned int reg,
+13
include/linux/mlx4/device.h
··· 796 796 MLX4_NET_TRANS_RULE_NUM, /* should be last */ 797 797 }; 798 798 799 + extern const u16 __sw_id_hw[]; 800 + 801 + static inline int map_hw_to_sw_id(u16 header_id) 802 + { 803 + 804 + int i; 805 + for (i = 0; i < MLX4_NET_TRANS_RULE_NUM; i++) { 806 + if (header_id == __sw_id_hw[i]) 807 + return i; 808 + } 809 + return -EINVAL; 810 + } 811 + 799 812 enum mlx4_net_trans_promisc_mode { 800 813 MLX4_FS_PROMISC_NONE = 0, 801 814 MLX4_FS_PROMISC_UPLINK,
-5
include/linux/nfs_fs.h
··· 265 265 return NFS_SERVER(inode)->nfs_client->rpc_ops; 266 266 } 267 267 268 - static inline __be32 *NFS_COOKIEVERF(const struct inode *inode) 269 - { 270 - return NFS_I(inode)->cookieverf; 271 - } 272 - 273 268 static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) 274 269 { 275 270 struct nfs_server *nfss = NFS_SERVER(inode);
+1 -1
include/linux/nfs_xdr.h
··· 652 652 }; 653 653 654 654 /* getxattr ACL interface flags */ 655 - #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */ 655 + #define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */ 656 656 struct nfs_getaclres { 657 657 size_t acl_len; 658 658 size_t acl_data_offset;
+5
include/linux/of_irq.h
··· 83 83 { 84 84 return 0; 85 85 } 86 + 87 + static inline void *of_irq_find_parent(struct device_node *child) 88 + { 89 + return NULL; 90 + } 86 91 #endif /* !CONFIG_OF */ 87 92 88 93 #endif /* __OF_IRQ_H */
+3 -1
include/linux/perf_event.h
··· 926 926 struct hw_perf_event hw; 927 927 928 928 struct perf_event_context *ctx; 929 - struct file *filp; 929 + atomic_long_t refcount; 930 930 931 931 /* 932 932 * These accumulate total time (in nanoseconds) that children ··· 1296 1296 extern void perf_swevent_put_recursion_context(int rctx); 1297 1297 extern void perf_event_enable(struct perf_event *event); 1298 1298 extern void perf_event_disable(struct perf_event *event); 1299 + extern int __perf_event_disable(void *info); 1299 1300 extern void perf_event_task_tick(void); 1300 1301 #else 1301 1302 static inline void ··· 1335 1334 static inline void perf_swevent_put_recursion_context(int rctx) { } 1336 1335 static inline void perf_event_enable(struct perf_event *event) { } 1337 1336 static inline void perf_event_disable(struct perf_event *event) { } 1337 + static inline int __perf_event_disable(void *info) { return -1; } 1338 1338 static inline void perf_event_task_tick(void) { } 1339 1339 #endif 1340 1340
-1
include/linux/sched.h
··· 954 954 unsigned int smt_gain; 955 955 int flags; /* See SD_* */ 956 956 int level; 957 - int idle_buddy; /* cpu assigned to select_idle_sibling() */ 958 957 959 958 /* Runtime fields. */ 960 959 unsigned long last_balance; /* init to jiffies. units in jiffies */
+3
include/linux/sunrpc/xprt.h
··· 114 114 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 115 115 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 116 116 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 117 + void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task); 117 118 void (*rpcbind)(struct rpc_task *task); 118 119 void (*set_port)(struct rpc_xprt *xprt, unsigned short port); 119 120 void (*connect)(struct rpc_task *task); ··· 282 281 void xprt_reserve(struct rpc_task *task); 283 282 int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); 284 283 int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); 284 + void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); 285 + void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); 285 286 int xprt_prepare_transmit(struct rpc_task *task); 286 287 void xprt_transmit(struct rpc_task *task); 287 288 void xprt_end_transmit(struct rpc_task *task);
+1 -1
include/net/bluetooth/smp.h
··· 136 136 }; 137 137 138 138 /* SMP Commands */ 139 - int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); 139 + int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); 140 140 int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); 141 141 int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); 142 142 int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey);
+3
include/net/xfrm.h
··· 273 273 int (*check)(struct xfrm_state *x, 274 274 struct sk_buff *skb, 275 275 __be32 net_seq); 276 + int (*recheck)(struct xfrm_state *x, 277 + struct sk_buff *skb, 278 + __be32 net_seq); 276 279 void (*notify)(struct xfrm_state *x, int event); 277 280 int (*overflow)(struct xfrm_state *x, struct sk_buff *skb); 278 281 };
+3 -1
include/target/target_core_backend.h
··· 23 23 struct se_device *(*create_virtdevice)(struct se_hba *, 24 24 struct se_subsystem_dev *, void *); 25 25 void (*free_device)(void *); 26 - int (*transport_complete)(struct se_cmd *cmd, struct scatterlist *); 26 + void (*transport_complete)(struct se_cmd *cmd, 27 + struct scatterlist *, 28 + unsigned char *); 27 29 28 30 int (*parse_cdb)(struct se_cmd *cmd); 29 31 ssize_t (*check_configfs_dev_params)(struct se_hba *,
+1
include/target/target_core_base.h
··· 121 121 122 122 #define SE_INQUIRY_BUF 512 123 123 #define SE_MODE_PAGE_BUF 512 124 + #define SE_SENSE_BUF 96 124 125 125 126 /* struct se_hba->hba_flags */ 126 127 enum hba_flags_table {
+34 -30
kernel/events/core.c
··· 1253 1253 /* 1254 1254 * Cross CPU call to disable a performance event 1255 1255 */ 1256 - static int __perf_event_disable(void *info) 1256 + int __perf_event_disable(void *info) 1257 1257 { 1258 1258 struct perf_event *event = info; 1259 1259 struct perf_event_context *ctx = event->ctx; ··· 2935 2935 /* 2936 2936 * Called when the last reference to the file is gone. 2937 2937 */ 2938 - static int perf_release(struct inode *inode, struct file *file) 2938 + static void put_event(struct perf_event *event) 2939 2939 { 2940 - struct perf_event *event = file->private_data; 2941 2940 struct task_struct *owner; 2942 2941 2943 - file->private_data = NULL; 2942 + if (!atomic_long_dec_and_test(&event->refcount)) 2943 + return; 2944 2944 2945 2945 rcu_read_lock(); 2946 2946 owner = ACCESS_ONCE(event->owner); ··· 2975 2975 put_task_struct(owner); 2976 2976 } 2977 2977 2978 - return perf_event_release_kernel(event); 2978 + perf_event_release_kernel(event); 2979 + } 2980 + 2981 + static int perf_release(struct inode *inode, struct file *file) 2982 + { 2983 + put_event(file->private_data); 2984 + return 0; 2979 2985 } 2980 2986 2981 2987 u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running) ··· 3233 3227 3234 3228 static const struct file_operations perf_fops; 3235 3229 3236 - static struct perf_event *perf_fget_light(int fd, int *fput_needed) 3230 + static struct file *perf_fget_light(int fd, int *fput_needed) 3237 3231 { 3238 3232 struct file *file; 3239 3233 ··· 3247 3241 return ERR_PTR(-EBADF); 3248 3242 } 3249 3243 3250 - return file->private_data; 3244 + return file; 3251 3245 } 3252 3246 3253 3247 static int perf_event_set_output(struct perf_event *event, ··· 3279 3273 3280 3274 case PERF_EVENT_IOC_SET_OUTPUT: 3281 3275 { 3276 + struct file *output_file = NULL; 3282 3277 struct perf_event *output_event = NULL; 3283 3278 int fput_needed = 0; 3284 3279 int ret; 3285 3280 3286 3281 if (arg != -1) { 3287 - output_event = perf_fget_light(arg, &fput_needed); 3288 - if (IS_ERR(output_event)) 3289 - return PTR_ERR(output_event); 3282 + output_file = perf_fget_light(arg, &fput_needed); 3283 + if (IS_ERR(output_file)) 3284 + return PTR_ERR(output_file); 3285 + output_event = output_file->private_data; 3290 3286 } 3291 3287 3292 3288 ret = perf_event_set_output(event, output_event); 3293 3289 if (output_event) 3294 - fput_light(output_event->filp, fput_needed); 3290 + fput_light(output_file, fput_needed); 3295 3291 3296 3292 return ret; 3297 3293 } ··· 5958 5950 5959 5951 mutex_init(&event->mmap_mutex); 5960 5952 5953 + atomic_long_set(&event->refcount, 1); 5961 5954 event->cpu = cpu; 5962 5955 event->attr = *attr; 5963 5956 event->group_leader = group_leader; ··· 6269 6260 return event_fd; 6270 6261 6271 6262 if (group_fd != -1) { 6272 - group_leader = perf_fget_light(group_fd, &fput_needed); 6273 - if (IS_ERR(group_leader)) { 6274 - err = PTR_ERR(group_leader); 6263 + group_file = perf_fget_light(group_fd, &fput_needed); 6264 + if (IS_ERR(group_file)) { 6265 + err = PTR_ERR(group_file); 6275 6266 goto err_fd; 6276 6267 } 6277 - group_file = group_leader->filp; 6268 + group_leader = group_file->private_data; 6278 6269 if (flags & PERF_FLAG_FD_OUTPUT) 6279 6270 output_event = group_leader; 6280 6271 if (flags & PERF_FLAG_FD_NO_GROUP) ··· 6411 6402 put_ctx(gctx); 6412 6403 } 6413 6404 6414 - event->filp = event_file; 6415 6405 WARN_ON_ONCE(ctx->parent_ctx); 6416 6406 mutex_lock(&ctx->mutex); 6417 6407 ··· 6504 6496 goto err_free; 6505 6497 } 6506 6498 6507 - event->filp = NULL; 6508 6499 WARN_ON_ONCE(ctx->parent_ctx); 6509 6500 mutex_lock(&ctx->mutex); 6510 6501 perf_install_in_context(ctx, event, cpu); ··· 6585 6578 * Release the parent event, if this was the last 6586 6579 * reference to it. 6587 6580 */ 6588 - fput(parent_event->filp); 6581 + put_event(parent_event); 6589 6582 } 6590 6583 6591 6584 static void ··· 6661 6654 * 6662 6655 * __perf_event_exit_task() 6663 6656 * sync_child_event() 6664 - * fput(parent_event->filp) 6665 - * perf_release() 6666 - * mutex_lock(&ctx->mutex) 6657 + * put_event() 6658 + * mutex_lock(&ctx->mutex) 6667 6659 * 6668 6660 * But since its the parent context it won't be the same instance. 6669 6661 */ ··· 6730 6724 list_del_init(&event->child_list); 6731 6725 mutex_unlock(&parent->child_mutex); 6732 6726 6733 - fput(parent->filp); 6727 + put_event(parent); 6734 6728 6735 6729 perf_group_detach(event); 6736 6730 list_del_event(event, ctx); ··· 6810 6804 NULL, NULL); 6811 6805 if (IS_ERR(child_event)) 6812 6806 return child_event; 6807 + 6808 + if (!atomic_long_inc_not_zero(&parent_event->refcount)) { 6809 + free_event(child_event); 6810 + return NULL; 6811 + } 6812 + 6813 6813 get_ctx(child_ctx); 6814 6814 6815 6815 /* ··· 6855 6843 raw_spin_lock_irqsave(&child_ctx->lock, flags); 6856 6844 add_event_to_ctx(child_event, child_ctx); 6857 6845 raw_spin_unlock_irqrestore(&child_ctx->lock, flags); 6858 - 6859 - /* 6860 - * Get a reference to the parent filp - we will fput it 6861 - * when the child event exits. This is safe to do because 6862 - * we are in the parent and we know that the filp still 6863 - * exists and has a nonzero count: 6864 - */ 6865 - atomic_long_inc(&parent_event->filp->f_count); 6866 6846 6867 6847 /* 6868 6848 * Link this into the parent event's child list
+10 -1
kernel/events/hw_breakpoint.c
··· 453 453 int old_type = bp->attr.bp_type; 454 454 int err = 0; 455 455 456 - perf_event_disable(bp); 456 + /* 457 + * modify_user_hw_breakpoint can be invoked with IRQs disabled and hence it 458 + * will not be possible to raise IPIs that invoke __perf_event_disable. 459 + * So call the function directly after making sure we are targeting the 460 + * current task. 461 + */ 462 + if (irqs_disabled() && bp->ctx && bp->ctx->task == current) 463 + __perf_event_disable(bp); 464 + else 465 + perf_event_disable(bp); 457 466 458 467 bp->attr.bp_addr = attr->bp_addr; 459 468 bp->attr.bp_type = attr->bp_type;
+11 -62
kernel/sched/core.c
··· 5304 5304 } 5305 5305 5306 5306 /* 5307 - * While a dead CPU has no uninterruptible tasks queued at this point, 5308 - * it might still have a nonzero ->nr_uninterruptible counter, because 5309 - * for performance reasons the counter is not stricly tracking tasks to 5310 - * their home CPUs. So we just add the counter to another CPU's counter, 5311 - * to keep the global sum constant after CPU-down: 5307 + * Since this CPU is going 'away' for a while, fold any nr_active delta 5308 + * we might have. Assumes we're called after migrate_tasks() so that the 5309 + * nr_active count is stable. 5310 + * 5311 + * Also see the comment "Global load-average calculations". 5312 5312 */ 5313 - static void migrate_nr_uninterruptible(struct rq *rq_src) 5313 + static void calc_load_migrate(struct rq *rq) 5314 5314 { 5315 - struct rq *rq_dest = cpu_rq(cpumask_any(cpu_active_mask)); 5316 - 5317 - rq_dest->nr_uninterruptible += rq_src->nr_uninterruptible; 5318 - rq_src->nr_uninterruptible = 0; 5319 - } 5320 - 5321 - /* 5322 - * remove the tasks which were accounted by rq from calc_load_tasks. 5323 - */ 5324 - static void calc_global_load_remove(struct rq *rq) 5325 - { 5326 - atomic_long_sub(rq->calc_load_active, &calc_load_tasks); 5327 - rq->calc_load_active = 0; 5315 + long delta = calc_load_fold_active(rq); 5316 + if (delta) 5317 + atomic_long_add(delta, &calc_load_tasks); 5328 5318 } 5329 5319 5330 5320 /* ··· 5341 5351 * done here. 5342 5352 */ 5343 5353 rq->stop = NULL; 5344 - 5345 - /* Ensure any throttled groups are reachable by pick_next_task */ 5346 - unthrottle_offline_cfs_rqs(rq); 5347 5354 5348 5355 for ( ; ; ) { 5349 5356 /* ··· 5605 5618 BUG_ON(rq->nr_running != 1); /* the migration thread */ 5606 5619 raw_spin_unlock_irqrestore(&rq->lock, flags); 5607 5620 5608 - migrate_nr_uninterruptible(rq); 5609 - calc_global_load_remove(rq); 5621 + calc_load_migrate(rq); 5610 5622 break; 5611 5623 #endif 5612 5624 } ··· 6014 6028 * SD_SHARE_PKG_RESOURCE set (Last Level Cache Domain) for this 6015 6029 * allows us to avoid some pointer chasing select_idle_sibling(). 6016 6030 * 6017 - * Iterate domains and sched_groups downward, assigning CPUs to be 6018 - * select_idle_sibling() hw buddy. Cross-wiring hw makes bouncing 6019 - * due to random perturbation self canceling, ie sw buddies pull 6020 - * their counterpart to their CPU's hw counterpart. 6021 - * 6022 6031 * Also keep a unique ID per domain (we use the first cpu number in 6023 6032 * the cpumask of the domain), this allows us to quickly tell if 6024 6033 * two cpus are in the same cache domain, see cpus_share_cache(). ··· 6027 6046 int id = cpu; 6028 6047 6029 6048 sd = highest_flag_domain(cpu, SD_SHARE_PKG_RESOURCES); 6030 - if (sd) { 6031 - struct sched_domain *tmp = sd; 6032 - struct sched_group *sg, *prev; 6033 - bool right; 6034 - 6035 - /* 6036 - * Traverse to first CPU in group, and count hops 6037 - * to cpu from there, switching direction on each 6038 - * hop, never ever pointing the last CPU rightward. 6039 - */ 6040 - do { 6041 - id = cpumask_first(sched_domain_span(tmp)); 6042 - prev = sg = tmp->groups; 6043 - right = 1; 6044 - 6045 - while (cpumask_first(sched_group_cpus(sg)) != id) 6046 - sg = sg->next; 6047 - 6048 - while (!cpumask_test_cpu(cpu, sched_group_cpus(sg))) { 6049 - prev = sg; 6050 - sg = sg->next; 6051 - right = !right; 6052 - } 6053 - 6054 - /* A CPU went down, never point back to domain start. */ 6055 - if (right && cpumask_first(sched_group_cpus(sg->next)) == id) 6056 - right = false; 6057 - 6058 - sg = right ? sg->next : prev; 6059 - tmp->idle_buddy = cpumask_first(sched_group_cpus(sg)); 6060 - } while ((tmp = tmp->child)); 6061 - 6049 + if (sd) 6062 6050 id = cpumask_first(sched_domain_span(sd)); 6063 - } 6064 6051 6065 6052 rcu_assign_pointer(per_cpu(sd_llc, cpu), sd); 6066 6053 per_cpu(sd_llc_id, cpu) = id;
+26 -11
kernel/sched/fair.c
··· 2052 2052 hrtimer_cancel(&cfs_b->slack_timer); 2053 2053 } 2054 2054 2055 - void unthrottle_offline_cfs_rqs(struct rq *rq) 2055 + static void unthrottle_offline_cfs_rqs(struct rq *rq) 2056 2056 { 2057 2057 struct cfs_rq *cfs_rq; 2058 2058 ··· 2106 2106 return NULL; 2107 2107 } 2108 2108 static inline void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} 2109 - void unthrottle_offline_cfs_rqs(struct rq *rq) {} 2109 + static inline void unthrottle_offline_cfs_rqs(struct rq *rq) {} 2110 2110 2111 2111 #endif /* CONFIG_CFS_BANDWIDTH */ 2112 2112 ··· 2637 2637 int cpu = smp_processor_id(); 2638 2638 int prev_cpu = task_cpu(p); 2639 2639 struct sched_domain *sd; 2640 + struct sched_group *sg; 2641 + int i; 2640 2642 2641 2643 /* 2642 2644 * If the task is going to be woken-up on this cpu and if it is ··· 2655 2653 return prev_cpu; 2656 2654 2657 2655 /* 2658 - * Otherwise, check assigned siblings to find an elegible idle cpu. 2656 + * Otherwise, iterate the domains and find an elegible idle cpu. 2659 2657 */ 2660 2658 sd = rcu_dereference(per_cpu(sd_llc, target)); 2661 - 2662 2659 for_each_lower_domain(sd) { 2663 - if (!cpumask_test_cpu(sd->idle_buddy, tsk_cpus_allowed(p))) 2664 - continue; 2665 - if (idle_cpu(sd->idle_buddy)) 2666 - return sd->idle_buddy; 2667 - } 2660 + sg = sd->groups; 2661 + do { 2662 + if (!cpumask_intersects(sched_group_cpus(sg), 2663 + tsk_cpus_allowed(p))) 2664 + goto next; 2668 2665 2666 + for_each_cpu(i, sched_group_cpus(sg)) { 2667 + if (!idle_cpu(i)) 2668 + goto next; 2669 + } 2670 + 2671 + target = cpumask_first_and(sched_group_cpus(sg), 2672 + tsk_cpus_allowed(p)); 2673 + goto done; 2674 + next: 2675 + sg = sg->next; 2676 + } while (sg != sd->groups); 2677 + } 2678 + done: 2669 2679 return target; 2670 2680 } 2671 2681 ··· 3672 3658 * @group: sched_group whose statistics are to be updated. 3673 3659 * @load_idx: Load index of sched_domain of this_cpu for load calc. 3674 3660 * @local_group: Does group contain this_cpu. 3675 - * @cpus: Set of cpus considered for load balancing. 3676 3661 * @balance: Should we balance. 3677 3662 * @sgs: variable to hold the statistics for this group. 3678 3663 */ ··· 3818 3805 /** 3819 3806 * update_sd_lb_stats - Update sched_domain's statistics for load balancing. 3820 3807 * @env: The load balancing environment. 3821 - * @cpus: Set of cpus considered for load balancing. 3822 3808 * @balance: Should we balance. 3823 3809 * @sds: variable to hold the statistics for this sched_domain. 3824 3810 */ ··· 4968 4956 static void rq_offline_fair(struct rq *rq) 4969 4957 { 4970 4958 update_sysctl(); 4959 + 4960 + /* Ensure any throttled groups are reachable by pick_next_task */ 4961 + unthrottle_offline_cfs_rqs(rq); 4971 4962 } 4972 4963 4973 4964 #endif /* CONFIG_SMP */
+1
kernel/sched/rt.c
··· 691 691 * runtime - in which case borrowing doesn't make sense. 692 692 */ 693 693 rt_rq->rt_runtime = RUNTIME_INF; 694 + rt_rq->rt_throttled = 0; 694 695 raw_spin_unlock(&rt_rq->rt_runtime_lock); 695 696 raw_spin_unlock(&rt_b->rt_runtime_lock); 696 697 }
-1
kernel/sched/sched.h
··· 1144 1144 1145 1145 extern void init_cfs_rq(struct cfs_rq *cfs_rq); 1146 1146 extern void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq); 1147 - extern void unthrottle_offline_cfs_rqs(struct rq *rq); 1148 1147 1149 1148 extern void account_cfs_bandwidth_used(int enabled, int was_enabled); 1150 1149
+1
kernel/time/tick-sched.c
··· 573 573 tick_do_update_jiffies64(now); 574 574 update_cpu_load_nohz(); 575 575 576 + calc_load_exit_idle(); 576 577 touch_softlockup_watchdog(); 577 578 /* 578 579 * Cancel the scheduled timer and restore the tick
+89 -21
kernel/workqueue.c
··· 66 66 67 67 /* pool flags */ 68 68 POOL_MANAGE_WORKERS = 1 << 0, /* need to manage workers */ 69 + POOL_MANAGING_WORKERS = 1 << 1, /* managing workers */ 69 70 70 71 /* worker flags */ 71 72 WORKER_STARTED = 1 << 0, /* started */ ··· 653 652 /* Do we have too many workers and should some go away? */ 654 653 static bool too_many_workers(struct worker_pool *pool) 655 654 { 656 - bool managing = mutex_is_locked(&pool->manager_mutex); 655 + bool managing = pool->flags & POOL_MANAGING_WORKERS; 657 656 int nr_idle = pool->nr_idle + managing; /* manager is considered idle */ 658 657 int nr_busy = pool->nr_workers - nr_idle; 659 658 ··· 1327 1326 1328 1327 /* we did our part, wait for rebind_workers() to finish up */ 1329 1328 wait_event(gcwq->rebind_hold, !(worker->flags & WORKER_REBIND)); 1329 + 1330 + /* 1331 + * rebind_workers() shouldn't finish until all workers passed the 1332 + * above WORKER_REBIND wait. Tell it when done. 1333 + */ 1334 + spin_lock_irq(&worker->pool->gcwq->lock); 1335 + if (!--worker->idle_rebind->cnt) 1336 + complete(&worker->idle_rebind->done); 1337 + spin_unlock_irq(&worker->pool->gcwq->lock); 1330 1338 } 1331 1339 1332 1340 /* ··· 1406 1396 /* set REBIND and kick idle ones, we'll wait for these later */ 1407 1397 for_each_worker_pool(pool, gcwq) { 1408 1398 list_for_each_entry(worker, &pool->idle_list, entry) { 1399 + unsigned long worker_flags = worker->flags; 1400 + 1409 1401 if (worker->flags & WORKER_REBIND) 1410 1402 continue; 1411 1403 1412 - /* morph UNBOUND to REBIND */ 1413 - worker->flags &= ~WORKER_UNBOUND; 1414 - worker->flags |= WORKER_REBIND; 1404 + /* morph UNBOUND to REBIND atomically */ 1405 + worker_flags &= ~WORKER_UNBOUND; 1406 + worker_flags |= WORKER_REBIND; 1407 + ACCESS_ONCE(worker->flags) = worker_flags; 1415 1408 1416 1409 idle_rebind.cnt++; 1417 1410 worker->idle_rebind = &idle_rebind; ··· 1432 1419 goto retry; 1433 1420 } 1434 1421 1435 - /* 1436 - * All idle workers are rebound and waiting for %WORKER_REBIND to 1437 - * be cleared inside idle_worker_rebind(). Clear and release. 1438 - * Clearing %WORKER_REBIND from this foreign context is safe 1439 - * because these workers are still guaranteed to be idle. 1440 - */ 1441 - for_each_worker_pool(pool, gcwq) 1442 - list_for_each_entry(worker, &pool->idle_list, entry) 1443 - worker->flags &= ~WORKER_REBIND; 1444 - 1445 - wake_up_all(&gcwq->rebind_hold); 1446 - 1447 - /* rebind busy workers */ 1422 + /* all idle workers are rebound, rebind busy workers */ 1448 1423 for_each_busy_worker(worker, i, pos, gcwq) { 1449 1424 struct work_struct *rebind_work = &worker->rebind_work; 1425 + unsigned long worker_flags = worker->flags; 1450 1426 1451 - /* morph UNBOUND to REBIND */ 1452 - worker->flags &= ~WORKER_UNBOUND; 1453 - worker->flags |= WORKER_REBIND; 1427 + /* morph UNBOUND to REBIND atomically */ 1428 + worker_flags &= ~WORKER_UNBOUND; 1429 + worker_flags |= WORKER_REBIND; 1430 + ACCESS_ONCE(worker->flags) = worker_flags; 1454 1431 1455 1432 if (test_and_set_bit(WORK_STRUCT_PENDING_BIT, 1456 1433 work_data_bits(rebind_work))) ··· 1451 1448 insert_work(get_cwq(gcwq->cpu, system_wq), rebind_work, 1452 1449 worker->scheduled.next, 1453 1450 work_color_to_flags(WORK_NO_COLOR)); 1451 + } 1452 + 1453 + /* 1454 + * All idle workers are rebound and waiting for %WORKER_REBIND to 1455 + * be cleared inside idle_worker_rebind(). Clear and release. 1456 + * Clearing %WORKER_REBIND from this foreign context is safe 1457 + * because these workers are still guaranteed to be idle. 1458 + * 1459 + * We need to make sure all idle workers passed WORKER_REBIND wait 1460 + * in idle_worker_rebind() before returning; otherwise, workers can 1461 + * get stuck at the wait if hotplug cycle repeats. 1462 + */ 1463 + idle_rebind.cnt = 1; 1464 + INIT_COMPLETION(idle_rebind.done); 1465 + 1466 + for_each_worker_pool(pool, gcwq) { 1467 + list_for_each_entry(worker, &pool->idle_list, entry) { 1468 + worker->flags &= ~WORKER_REBIND; 1469 + idle_rebind.cnt++; 1470 + } 1471 + } 1472 + 1473 + wake_up_all(&gcwq->rebind_hold); 1474 + 1475 + if (--idle_rebind.cnt) { 1476 + spin_unlock_irq(&gcwq->lock); 1477 + wait_for_completion(&idle_rebind.done); 1478 + spin_lock_irq(&gcwq->lock); 1454 1479 } 1455 1480 } 1456 1481 ··· 1825 1794 struct worker_pool *pool = worker->pool; 1826 1795 bool ret = false; 1827 1796 1828 - if (!mutex_trylock(&pool->manager_mutex)) 1797 + if (pool->flags & POOL_MANAGING_WORKERS) 1829 1798 return ret; 1799 + 1800 + pool->flags |= POOL_MANAGING_WORKERS; 1801 + 1802 + /* 1803 + * To simplify both worker management and CPU hotplug, hold off 1804 + * management while hotplug is in progress. CPU hotplug path can't 1805 + * grab %POOL_MANAGING_WORKERS to achieve this because that can 1806 + * lead to idle worker depletion (all become busy thinking someone 1807 + * else is managing) which in turn can result in deadlock under 1808 + * extreme circumstances. Use @pool->manager_mutex to synchronize 1809 + * manager against CPU hotplug. 1810 + * 1811 + * manager_mutex would always be free unless CPU hotplug is in 1812 + * progress. trylock first without dropping @gcwq->lock. 1813 + */ 1814 + if (unlikely(!mutex_trylock(&pool->manager_mutex))) { 1815 + spin_unlock_irq(&pool->gcwq->lock); 1816 + mutex_lock(&pool->manager_mutex); 1817 + /* 1818 + * CPU hotplug could have happened while we were waiting 1819 + * for manager_mutex. Hotplug itself can't handle us 1820 + * because manager isn't either on idle or busy list, and 1821 + * @gcwq's state and ours could have deviated. 1822 + * 1823 + * As hotplug is now excluded via manager_mutex, we can 1824 + * simply try to bind. It will succeed or fail depending 1825 + * on @gcwq's current state. Try it and adjust 1826 + * %WORKER_UNBOUND accordingly. 1827 + */ 1828 + if (worker_maybe_bind_and_lock(worker)) 1829 + worker->flags &= ~WORKER_UNBOUND; 1830 + else 1831 + worker->flags |= WORKER_UNBOUND; 1832 + 1833 + ret = true; 1834 + } 1830 1835 1831 1836 pool->flags &= ~POOL_MANAGE_WORKERS; 1832 1837 ··· 1873 1806 ret |= maybe_destroy_workers(pool); 1874 1807 ret |= maybe_create_worker(pool); 1875 1808 1809 + pool->flags &= ~POOL_MANAGING_WORKERS; 1876 1810 mutex_unlock(&pool->manager_mutex); 1877 1811 return ret; 1878 1812 }
+4 -2
lib/digsig.c
··· 163 163 memcpy(out1 + head, p, l); 164 164 165 165 err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); 166 + if (err) 167 + goto err; 166 168 167 - if (!err && len == hlen) 168 - err = memcmp(out2, h, hlen); 169 + if (len != hlen || memcmp(out2, h, hlen)) 170 + err = -EINVAL; 169 171 170 172 err: 171 173 mpi_free(in);
+1 -1
mm/memblock.c
··· 246 246 min(new_area_start, memblock.current_limit), 247 247 new_alloc_size, PAGE_SIZE); 248 248 249 - new_array = addr ? __va(addr) : 0; 249 + new_array = addr ? __va(addr) : NULL; 250 250 } 251 251 if (!addr) { 252 252 pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n",
+4
net/bluetooth/hci_conn.c
··· 29 29 #include <net/bluetooth/bluetooth.h> 30 30 #include <net/bluetooth/hci_core.h> 31 31 #include <net/bluetooth/a2mp.h> 32 + #include <net/bluetooth/smp.h> 32 33 33 34 static void hci_le_connect(struct hci_conn *conn) 34 35 { ··· 619 618 int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) 620 619 { 621 620 BT_DBG("hcon %p", conn); 621 + 622 + if (conn->type == LE_LINK) 623 + return smp_conn_security(conn, sec_level); 622 624 623 625 /* For sdp we don't need the link key. */ 624 626 if (sec_level == BT_SECURITY_SDP)
+6 -5
net/bluetooth/l2cap_core.c
··· 1199 1199 static void l2cap_conn_ready(struct l2cap_conn *conn) 1200 1200 { 1201 1201 struct l2cap_chan *chan; 1202 + struct hci_conn *hcon = conn->hcon; 1202 1203 1203 1204 BT_DBG("conn %p", conn); 1204 1205 1205 - if (!conn->hcon->out && conn->hcon->type == LE_LINK) 1206 + if (!hcon->out && hcon->type == LE_LINK) 1206 1207 l2cap_le_conn_ready(conn); 1207 1208 1208 - if (conn->hcon->out && conn->hcon->type == LE_LINK) 1209 - smp_conn_security(conn, conn->hcon->pending_sec_level); 1209 + if (hcon->out && hcon->type == LE_LINK) 1210 + smp_conn_security(hcon, hcon->pending_sec_level); 1210 1211 1211 1212 mutex_lock(&conn->chan_lock); 1212 1213 ··· 1220 1219 continue; 1221 1220 } 1222 1221 1223 - if (conn->hcon->type == LE_LINK) { 1224 - if (smp_conn_security(conn, chan->sec_level)) 1222 + if (hcon->type == LE_LINK) { 1223 + if (smp_conn_security(hcon, chan->sec_level)) 1225 1224 l2cap_chan_ready(chan); 1226 1225 1227 1226 } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {
+1 -1
net/bluetooth/l2cap_sock.c
··· 616 616 break; 617 617 } 618 618 619 - if (smp_conn_security(conn, sec.level)) 619 + if (smp_conn_security(conn->hcon, sec.level)) 620 620 break; 621 621 sk->sk_state = BT_CONFIG; 622 622 chan->state = BT_CONFIG;
+5 -5
net/bluetooth/smp.c
··· 267 267 mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, 268 268 hcon->dst_type, reason); 269 269 270 - if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { 271 - cancel_delayed_work_sync(&conn->security_timer); 270 + cancel_delayed_work_sync(&conn->security_timer); 271 + 272 + if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) 272 273 smp_chan_destroy(conn); 273 - } 274 274 } 275 275 276 276 #define JUST_WORKS 0x00 ··· 760 760 return 0; 761 761 } 762 762 763 - int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level) 763 + int smp_conn_security(struct hci_conn *hcon, __u8 sec_level) 764 764 { 765 - struct hci_conn *hcon = conn->hcon; 765 + struct l2cap_conn *conn = hcon->l2cap_data; 766 766 struct smp_chan *smp = conn->smp_chan; 767 767 __u8 authreq; 768 768
+1 -1
net/bridge/netfilter/ebt_log.c
··· 80 80 unsigned int bitmask; 81 81 82 82 spin_lock_bh(&ebt_log_lock); 83 - printk("<%c>%s IN=%s OUT=%s MAC source = %pM MAC dest = %pM proto = 0x%04x", 83 + printk(KERN_SOH "%c%s IN=%s OUT=%s MAC source = %pM MAC dest = %pM proto = 0x%04x", 84 84 '0' + loginfo->u.log.level, prefix, 85 85 in ? in->name : "", out ? out->name : "", 86 86 eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest,
+3 -2
net/caif/cfsrvl.c
··· 211 211 void (*put)(struct cflayer *lyr)) 212 212 { 213 213 struct cfsrvl *service; 214 - service = container_of(adapt_layer->dn, struct cfsrvl, layer); 215 214 216 - WARN_ON(adapt_layer == NULL || adapt_layer->dn == NULL); 215 + if (WARN_ON(adapt_layer == NULL || adapt_layer->dn == NULL)) 216 + return; 217 + service = container_of(adapt_layer->dn, struct cfsrvl, layer); 217 218 service->hold = hold; 218 219 service->put = put; 219 220 }
+6 -5
net/core/dev.c
··· 2647 2647 if (!skb_flow_dissect(skb, &keys)) 2648 2648 return; 2649 2649 2650 - if (keys.ports) { 2651 - if ((__force u16)keys.port16[1] < (__force u16)keys.port16[0]) 2652 - swap(keys.port16[0], keys.port16[1]); 2650 + if (keys.ports) 2653 2651 skb->l4_rxhash = 1; 2654 - } 2655 2652 2656 2653 /* get a consistent hash (same value on both flow directions) */ 2657 - if ((__force u32)keys.dst < (__force u32)keys.src) 2654 + if (((__force u32)keys.dst < (__force u32)keys.src) || 2655 + (((__force u32)keys.dst == (__force u32)keys.src) && 2656 + ((__force u16)keys.port16[1] < (__force u16)keys.port16[0]))) { 2658 2657 swap(keys.dst, keys.src); 2658 + swap(keys.port16[0], keys.port16[1]); 2659 + } 2659 2660 2660 2661 hash = jhash_3words((__force u32)keys.dst, 2661 2662 (__force u32)keys.src,
+1 -1
net/core/pktgen.c
··· 2721 2721 /* Eth + IPh + UDPh + mpls */ 2722 2722 datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 - 2723 2723 pkt_dev->pkt_overhead; 2724 - if (datalen < sizeof(struct pktgen_hdr)) 2724 + if (datalen < 0 || datalen < sizeof(struct pktgen_hdr)) 2725 2725 datalen = sizeof(struct pktgen_hdr); 2726 2726 2727 2727 udph->source = htons(pkt_dev->cur_udp_src);
+8 -1
net/core/sock.c
··· 1523 1523 1524 1524 void sock_edemux(struct sk_buff *skb) 1525 1525 { 1526 - sock_put(skb->sk); 1526 + struct sock *sk = skb->sk; 1527 + 1528 + #ifdef CONFIG_INET 1529 + if (sk->sk_state == TCP_TIME_WAIT) 1530 + inet_twsk_put(inet_twsk(sk)); 1531 + else 1532 + #endif 1533 + sock_put(sk); 1527 1534 } 1528 1535 EXPORT_SYMBOL(sock_edemux); 1529 1536
+5
net/ipv4/udp.c
··· 1226 1226 1227 1227 if (unlikely(err)) { 1228 1228 trace_kfree_skb(skb, udp_recvmsg); 1229 + if (!peeked) { 1230 + atomic_inc(&sk->sk_drops); 1231 + UDP_INC_STATS_USER(sock_net(sk), 1232 + UDP_MIB_INERRORS, is_udplite); 1233 + } 1229 1234 goto out_free; 1230 1235 } 1231 1236
+3 -2
net/ipv6/tcp_ipv6.c
··· 403 403 tp->mtu_info = ntohl(info); 404 404 if (!sock_owned_by_user(sk)) 405 405 tcp_v6_mtu_reduced(sk); 406 - else 407 - set_bit(TCP_MTU_REDUCED_DEFERRED, &tp->tsq_flags); 406 + else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, 407 + &tp->tsq_flags)) 408 + sock_hold(sk); 408 409 goto out; 409 410 } 410 411
+11
net/ipv6/udp.c
··· 394 394 } 395 395 if (unlikely(err)) { 396 396 trace_kfree_skb(skb, udpv6_recvmsg); 397 + if (!peeked) { 398 + atomic_inc(&sk->sk_drops); 399 + if (is_udp4) 400 + UDP_INC_STATS_USER(sock_net(sk), 401 + UDP_MIB_INERRORS, 402 + is_udplite); 403 + else 404 + UDP6_INC_STATS_USER(sock_net(sk), 405 + UDP_MIB_INERRORS, 406 + is_udplite); 407 + } 397 408 goto out_free; 398 409 } 399 410 if (!peeked) {
+4
net/l2tp/l2tp_core.c
··· 1501 1501 return err; 1502 1502 } 1503 1503 1504 + static struct lock_class_key l2tp_socket_class; 1505 + 1504 1506 int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, struct l2tp_tunnel_cfg *cfg, struct l2tp_tunnel **tunnelp) 1505 1507 { 1506 1508 struct l2tp_tunnel *tunnel = NULL; ··· 1607 1605 tunnel->old_sk_destruct = sk->sk_destruct; 1608 1606 sk->sk_destruct = &l2tp_tunnel_destruct; 1609 1607 tunnel->sock = sk; 1608 + lockdep_set_class_and_name(&sk->sk_lock.slock, &l2tp_socket_class, "l2tp_sock"); 1609 + 1610 1610 sk->sk_allocation = GFP_ATOMIC; 1611 1611 1612 1612 /* Add tunnel to our list */
+1 -1
net/l2tp/l2tp_eth.c
··· 153 153 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length); 154 154 } 155 155 156 - if (!pskb_may_pull(skb, sizeof(ETH_HLEN))) 156 + if (!pskb_may_pull(skb, ETH_HLEN)) 157 157 goto error; 158 158 159 159 secpath_reset(skb);
+4 -5
net/mac80211/cfg.c
··· 1378 1378 else 1379 1379 memset(next_hop, 0, ETH_ALEN); 1380 1380 1381 + memset(pinfo, 0, sizeof(*pinfo)); 1382 + 1381 1383 pinfo->generation = mesh_paths_generation; 1382 1384 1383 1385 pinfo->filled = MPATH_INFO_FRAME_QLEN | ··· 1398 1396 pinfo->discovery_timeout = 1399 1397 jiffies_to_msecs(mpath->discovery_timeout); 1400 1398 pinfo->discovery_retries = mpath->discovery_retries; 1401 - pinfo->flags = 0; 1402 1399 if (mpath->flags & MESH_PATH_ACTIVE) 1403 1400 pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; 1404 1401 if (mpath->flags & MESH_PATH_RESOLVING) ··· 1406 1405 pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID; 1407 1406 if (mpath->flags & MESH_PATH_FIXED) 1408 1407 pinfo->flags |= NL80211_MPATH_FLAG_FIXED; 1409 - if (mpath->flags & MESH_PATH_RESOLVING) 1410 - pinfo->flags |= NL80211_MPATH_FLAG_RESOLVING; 1411 - 1412 - pinfo->flags = mpath->flags; 1408 + if (mpath->flags & MESH_PATH_RESOLVED) 1409 + pinfo->flags |= NL80211_MPATH_FLAG_RESOLVED; 1413 1410 } 1414 1411 1415 1412 static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev,
+4
net/mac80211/mlme.c
··· 3248 3248 goto out_unlock; 3249 3249 3250 3250 err_clear: 3251 + memset(ifmgd->bssid, 0, ETH_ALEN); 3252 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); 3251 3253 ifmgd->auth_data = NULL; 3252 3254 err_free: 3253 3255 kfree(auth_data); ··· 3441 3439 err = 0; 3442 3440 goto out; 3443 3441 err_clear: 3442 + memset(ifmgd->bssid, 0, ETH_ALEN); 3443 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); 3444 3444 ifmgd->assoc_data = NULL; 3445 3445 err_free: 3446 3446 kfree(assoc_data);
+10 -19
net/netfilter/nf_conntrack_proto_tcp.c
··· 158 158 * sCL -> sSS 159 159 */ 160 160 /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sS2 */ 161 - /*synack*/ { sIV, sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG, sSR }, 161 + /*synack*/ { sIV, sIV, sSR, sIV, sIV, sIV, sIV, sIV, sIV, sSR }, 162 162 /* 163 163 * sNO -> sIV Too late and no reason to do anything 164 164 * sSS -> sIV Client can't send SYN and then SYN/ACK 165 165 * sS2 -> sSR SYN/ACK sent to SYN2 in simultaneous open 166 - * sSR -> sIG 167 - * sES -> sIG Error: SYNs in window outside the SYN_SENT state 168 - * are errors. Receiver will reply with RST 169 - * and close the connection. 170 - * Or we are not in sync and hold a dead connection. 171 - * sFW -> sIG 172 - * sCW -> sIG 173 - * sLA -> sIG 174 - * sTW -> sIG 175 - * sCL -> sIG 166 + * sSR -> sSR Late retransmitted SYN/ACK in simultaneous open 167 + * sES -> sIV Invalid SYN/ACK packets sent by the client 168 + * sFW -> sIV 169 + * sCW -> sIV 170 + * sLA -> sIV 171 + * sTW -> sIV 172 + * sCL -> sIV 176 173 */ 177 174 /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sS2 */ 178 175 /*fin*/ { sIV, sIV, sFW, sFW, sLA, sLA, sLA, sTW, sCL, sIV }, ··· 630 633 ack = sack = receiver->td_end; 631 634 } 632 635 633 - if (seq == end 634 - && (!tcph->rst 635 - || (seq == 0 && state->state == TCP_CONNTRACK_SYN_SENT))) 636 + if (tcph->rst && seq == 0 && state->state == TCP_CONNTRACK_SYN_SENT) 636 637 /* 637 - * Packets contains no data: we assume it is valid 638 - * and check the ack value only. 639 - * However RST segments are always validated by their 640 - * SEQ number, except when seq == 0 (reset sent answering 641 - * SYN. 638 + * RST sent answering SYN. 642 639 */ 643 640 seq = end = sender->td_end; 644 641
+19 -18
net/netfilter/xt_LOG.c
··· 145 145 return 0; 146 146 } 147 147 148 + static void dump_sk_uid_gid(struct sbuff *m, struct sock *sk) 149 + { 150 + if (!sk || sk->sk_state == TCP_TIME_WAIT) 151 + return; 152 + 153 + read_lock_bh(&sk->sk_callback_lock); 154 + if (sk->sk_socket && sk->sk_socket->file) 155 + sb_add(m, "UID=%u GID=%u ", 156 + sk->sk_socket->file->f_cred->fsuid, 157 + sk->sk_socket->file->f_cred->fsgid); 158 + read_unlock_bh(&sk->sk_callback_lock); 159 + } 160 + 148 161 /* One level of recursion won't kill us */ 149 162 static void dump_ipv4_packet(struct sbuff *m, 150 163 const struct nf_loginfo *info, ··· 374 361 } 375 362 376 363 /* Max length: 15 "UID=4294967295 " */ 377 - if ((logflags & XT_LOG_UID) && !iphoff && skb->sk) { 378 - read_lock_bh(&skb->sk->sk_callback_lock); 379 - if (skb->sk->sk_socket && skb->sk->sk_socket->file) 380 - sb_add(m, "UID=%u GID=%u ", 381 - skb->sk->sk_socket->file->f_cred->fsuid, 382 - skb->sk->sk_socket->file->f_cred->fsgid); 383 - read_unlock_bh(&skb->sk->sk_callback_lock); 384 - } 364 + if ((logflags & XT_LOG_UID) && !iphoff) 365 + dump_sk_uid_gid(m, skb->sk); 385 366 386 367 /* Max length: 16 "MARK=0xFFFFFFFF " */ 387 368 if (!iphoff && skb->mark) ··· 443 436 const struct nf_loginfo *loginfo, 444 437 const char *prefix) 445 438 { 446 - sb_add(m, "<%d>%sIN=%s OUT=%s ", loginfo->u.log.level, 447 - prefix, 439 + sb_add(m, KERN_SOH "%c%sIN=%s OUT=%s ", 440 + '0' + loginfo->u.log.level, prefix, 448 441 in ? in->name : "", 449 442 out ? out->name : ""); 450 443 #ifdef CONFIG_BRIDGE_NETFILTER ··· 724 717 } 725 718 726 719 /* Max length: 15 "UID=4294967295 " */ 727 - if ((logflags & XT_LOG_UID) && recurse && skb->sk) { 728 - read_lock_bh(&skb->sk->sk_callback_lock); 729 - if (skb->sk->sk_socket && skb->sk->sk_socket->file) 730 - sb_add(m, "UID=%u GID=%u ", 731 - skb->sk->sk_socket->file->f_cred->fsuid, 732 - skb->sk->sk_socket->file->f_cred->fsgid); 733 - read_unlock_bh(&skb->sk->sk_callback_lock); 734 - } 720 + if ((logflags & XT_LOG_UID) && recurse) 721 + dump_sk_uid_gid(m, skb->sk); 735 722 736 723 /* Max length: 16 "MARK=0xFFFFFFFF " */ 737 724 if (!recurse && skb->mark)
+6 -1
net/netrom/af_netrom.c
··· 1169 1169 msg->msg_flags |= MSG_TRUNC; 1170 1170 } 1171 1171 1172 - skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); 1172 + er = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); 1173 + if (er < 0) { 1174 + skb_free_datagram(sk, skb); 1175 + release_sock(sk); 1176 + return er; 1177 + } 1173 1178 1174 1179 if (sax != NULL) { 1175 1180 sax->sax25_family = AF_NETROM;
+1 -1
net/openvswitch/actions.c
··· 45 45 return pskb_expand_head(skb, 0, 0, GFP_ATOMIC); 46 46 } 47 47 48 - /* remove VLAN header from packet and update csum accrodingly. */ 48 + /* remove VLAN header from packet and update csum accordingly. */ 49 49 static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci) 50 50 { 51 51 struct vlan_hdr *vhdr;
+3 -3
net/openvswitch/datapath.c
··· 425 425 static int validate_tp_port(const struct sw_flow_key *flow_key) 426 426 { 427 427 if (flow_key->eth.type == htons(ETH_P_IP)) { 428 - if (flow_key->ipv4.tp.src && flow_key->ipv4.tp.dst) 428 + if (flow_key->ipv4.tp.src || flow_key->ipv4.tp.dst) 429 429 return 0; 430 430 } else if (flow_key->eth.type == htons(ETH_P_IPV6)) { 431 - if (flow_key->ipv6.tp.src && flow_key->ipv6.tp.dst) 431 + if (flow_key->ipv6.tp.src || flow_key->ipv6.tp.dst) 432 432 return 0; 433 433 } 434 434 ··· 460 460 if (flow_key->eth.type != htons(ETH_P_IP)) 461 461 return -EINVAL; 462 462 463 - if (!flow_key->ipv4.addr.src || !flow_key->ipv4.addr.dst) 463 + if (!flow_key->ip.proto) 464 464 return -EINVAL; 465 465 466 466 ipv4_key = nla_data(ovs_key);
+5 -3
net/openvswitch/flow.h
··· 145 145 * OVS_KEY_ATTR_PRIORITY 4 -- 4 8 146 146 * OVS_KEY_ATTR_IN_PORT 4 -- 4 8 147 147 * OVS_KEY_ATTR_ETHERNET 12 -- 4 16 148 + * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (outer VLAN ethertype) 148 149 * OVS_KEY_ATTR_8021Q 4 -- 4 8 149 - * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 150 + * OVS_KEY_ATTR_ENCAP 0 -- 4 4 (VLAN encapsulation) 151 + * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (inner VLAN ethertype) 150 152 * OVS_KEY_ATTR_IPV6 40 -- 4 44 151 153 * OVS_KEY_ATTR_ICMPV6 2 2 4 8 152 154 * OVS_KEY_ATTR_ND 28 -- 4 32 153 155 * ------------------------------------------------- 154 - * total 132 156 + * total 144 155 157 */ 156 - #define FLOW_BUFSIZE 132 158 + #define FLOW_BUFSIZE 144 157 159 158 160 int ovs_flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *); 159 161 int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
+3 -2
net/sched/sch_cbq.c
··· 250 250 else if ((cl = defmap[res.classid & TC_PRIO_MAX]) == NULL) 251 251 cl = defmap[TC_PRIO_BESTEFFORT]; 252 252 253 - if (cl == NULL || cl->level >= head->level) 253 + if (cl == NULL) 254 254 goto fallback; 255 255 } 256 - 256 + if (cl->level >= head->level) 257 + goto fallback; 257 258 #ifdef CONFIG_NET_CLS_ACT 258 259 switch (result) { 259 260 case TC_ACT_QUEUED:
+1 -1
net/sched/sch_fq_codel.c
··· 191 191 192 192 if (list_empty(&flow->flowchain)) { 193 193 list_add_tail(&flow->flowchain, &q->new_flows); 194 - codel_vars_init(&flow->cvars); 195 194 q->new_flow_count++; 196 195 flow->deficit = q->quantum; 197 196 flow->dropped = 0; ··· 417 418 struct fq_codel_flow *flow = q->flows + i; 418 419 419 420 INIT_LIST_HEAD(&flow->flowchain); 421 + codel_vars_init(&flow->cvars); 420 422 } 421 423 } 422 424 if (sch->limit >= 1)
+22 -16
net/sched/sch_gred.c
··· 102 102 if (q == NULL) 103 103 continue; 104 104 105 - for (n = 0; n < table->DPs; n++) 106 - if (table->tab[n] && table->tab[n] != q && 107 - table->tab[n]->prio == q->prio) 105 + for (n = i + 1; n < table->DPs; n++) 106 + if (table->tab[n] && table->tab[n]->prio == q->prio) 108 107 return 1; 109 108 } 110 109 ··· 136 137 struct gred_sched_data *q) 137 138 { 138 139 table->wred_set.qavg = q->vars.qavg; 140 + table->wred_set.qidlestart = q->vars.qidlestart; 139 141 } 140 142 141 143 static inline int gred_use_ecn(struct gred_sched *t) ··· 176 176 skb->tc_index = (skb->tc_index & ~GRED_VQ_MASK) | dp; 177 177 } 178 178 179 - /* sum up all the qaves of prios <= to ours to get the new qave */ 179 + /* sum up all the qaves of prios < ours to get the new qave */ 180 180 if (!gred_wred_mode(t) && gred_rio_mode(t)) { 181 181 int i; 182 182 ··· 260 260 } else { 261 261 q->backlog -= qdisc_pkt_len(skb); 262 262 263 - if (!q->backlog && !gred_wred_mode(t)) 264 - red_start_of_idle_period(&q->vars); 263 + if (gred_wred_mode(t)) { 264 + if (!sch->qstats.backlog) 265 + red_start_of_idle_period(&t->wred_set); 266 + } else { 267 + if (!q->backlog) 268 + red_start_of_idle_period(&q->vars); 269 + } 265 270 } 266 271 267 272 return skb; 268 273 } 269 - 270 - if (gred_wred_mode(t) && !red_is_idling(&t->wred_set)) 271 - red_start_of_idle_period(&t->wred_set); 272 274 273 275 return NULL; 274 276 } ··· 293 291 q->backlog -= len; 294 292 q->stats.other++; 295 293 296 - if (!q->backlog && !gred_wred_mode(t)) 297 - red_start_of_idle_period(&q->vars); 294 + if (gred_wred_mode(t)) { 295 + if (!sch->qstats.backlog) 296 + red_start_of_idle_period(&t->wred_set); 297 + } else { 298 + if (!q->backlog) 299 + red_start_of_idle_period(&q->vars); 300 + } 298 301 } 299 302 300 303 qdisc_drop(skb, sch); 301 304 return len; 302 305 } 303 306 304 - if (gred_wred_mode(t) && !red_is_idling(&t->wred_set)) 305 - red_start_of_idle_period(&t->wred_set); 306 - 307 307 return 0; 308 - 309 308 } 310 309 311 310 static void gred_reset(struct Qdisc *sch) ··· 538 535 for (i = 0; i < MAX_DPs; i++) { 539 536 struct gred_sched_data *q = table->tab[i]; 540 537 struct tc_gred_qopt opt; 538 + unsigned long qavg; 541 539 542 540 memset(&opt, 0, sizeof(opt)); 543 541 ··· 570 566 if (gred_wred_mode(table)) 571 567 gred_load_wred_set(table, q); 572 568 573 - opt.qave = red_calc_qavg(&q->parms, &q->vars, q->vars.qavg); 569 + qavg = red_calc_qavg(&q->parms, &q->vars, 570 + q->vars.qavg >> q->parms.Wlog); 571 + opt.qave = qavg >> q->parms.Wlog; 574 572 575 573 append_opt: 576 574 if (nla_append(skb, sizeof(opt), &opt) < 0)
+20 -1
net/sctp/output.c
··· 364 364 return retval; 365 365 } 366 366 367 + static void sctp_packet_release_owner(struct sk_buff *skb) 368 + { 369 + sk_free(skb->sk); 370 + } 371 + 372 + static void sctp_packet_set_owner_w(struct sk_buff *skb, struct sock *sk) 373 + { 374 + skb_orphan(skb); 375 + skb->sk = sk; 376 + skb->destructor = sctp_packet_release_owner; 377 + 378 + /* 379 + * The data chunks have already been accounted for in sctp_sendmsg(), 380 + * therefore only reserve a single byte to keep socket around until 381 + * the packet has been transmitted. 382 + */ 383 + atomic_inc(&sk->sk_wmem_alloc); 384 + } 385 + 367 386 /* All packets are sent to the network through this function from 368 387 * sctp_outq_tail(). 369 388 * ··· 424 405 /* Set the owning socket so that we know where to get the 425 406 * destination IP address. 426 407 */ 427 - skb_set_owner_w(nskb, sk); 408 + sctp_packet_set_owner_w(nskb, sk); 428 409 429 410 if (!sctp_transport_dst_check(tp)) { 430 411 sctp_transport_route(tp, NULL, sctp_sk(sk));
+20 -14
net/sunrpc/xprt.c
··· 969 969 return false; 970 970 } 971 971 972 - static void xprt_alloc_slot(struct rpc_task *task) 972 + void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task) 973 973 { 974 - struct rpc_xprt *xprt = task->tk_xprt; 975 974 struct rpc_rqst *req; 976 975 976 + spin_lock(&xprt->reserve_lock); 977 977 if (!list_empty(&xprt->free)) { 978 978 req = list_entry(xprt->free.next, struct rpc_rqst, rq_list); 979 979 list_del(&req->rq_list); ··· 994 994 default: 995 995 task->tk_status = -EAGAIN; 996 996 } 997 + spin_unlock(&xprt->reserve_lock); 997 998 return; 998 999 out_init_req: 999 1000 task->tk_status = 0; 1000 1001 task->tk_rqstp = req; 1001 1002 xprt_request_init(task, xprt); 1003 + spin_unlock(&xprt->reserve_lock); 1002 1004 } 1005 + EXPORT_SYMBOL_GPL(xprt_alloc_slot); 1006 + 1007 + void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task) 1008 + { 1009 + /* Note: grabbing the xprt_lock_write() ensures that we throttle 1010 + * new slot allocation if the transport is congested (i.e. when 1011 + * reconnecting a stream transport or when out of socket write 1012 + * buffer space). 1013 + */ 1014 + if (xprt_lock_write(xprt, task)) { 1015 + xprt_alloc_slot(xprt, task); 1016 + xprt_release_write(xprt, task); 1017 + } 1018 + } 1019 + EXPORT_SYMBOL_GPL(xprt_lock_and_alloc_slot); 1003 1020 1004 1021 static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) 1005 1022 { ··· 1100 1083 if (task->tk_rqstp != NULL) 1101 1084 return; 1102 1085 1103 - /* Note: grabbing the xprt_lock_write() here is not strictly needed, 1104 - * but ensures that we throttle new slot allocation if the transport 1105 - * is congested (e.g. if reconnecting or if we're out of socket 1106 - * write buffer space). 1107 - */ 1108 1086 task->tk_timeout = 0; 1109 1087 task->tk_status = -EAGAIN; 1110 - if (!xprt_lock_write(xprt, task)) 1111 - return; 1112 - 1113 - spin_lock(&xprt->reserve_lock); 1114 - xprt_alloc_slot(task); 1115 - spin_unlock(&xprt->reserve_lock); 1116 - xprt_release_write(xprt, task); 1088 + xprt->ops->alloc_slot(xprt, task); 1117 1089 } 1118 1090 1119 1091 static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt)
+1
net/sunrpc/xprtrdma/transport.c
··· 713 713 static struct rpc_xprt_ops xprt_rdma_procs = { 714 714 .reserve_xprt = xprt_rdma_reserve_xprt, 715 715 .release_xprt = xprt_release_xprt_cong, /* sunrpc/xprt.c */ 716 + .alloc_slot = xprt_alloc_slot, 716 717 .release_request = xprt_release_rqst_cong, /* ditto */ 717 718 .set_retrans_timeout = xprt_set_retrans_timeout_def, /* ditto */ 718 719 .rpcbind = rpcb_getport_async, /* sunrpc/rpcb_clnt.c */
+3
net/sunrpc/xprtsock.c
··· 2473 2473 static struct rpc_xprt_ops xs_local_ops = { 2474 2474 .reserve_xprt = xprt_reserve_xprt, 2475 2475 .release_xprt = xs_tcp_release_xprt, 2476 + .alloc_slot = xprt_alloc_slot, 2476 2477 .rpcbind = xs_local_rpcbind, 2477 2478 .set_port = xs_local_set_port, 2478 2479 .connect = xs_connect, ··· 2490 2489 .set_buffer_size = xs_udp_set_buffer_size, 2491 2490 .reserve_xprt = xprt_reserve_xprt_cong, 2492 2491 .release_xprt = xprt_release_xprt_cong, 2492 + .alloc_slot = xprt_alloc_slot, 2493 2493 .rpcbind = rpcb_getport_async, 2494 2494 .set_port = xs_set_port, 2495 2495 .connect = xs_connect, ··· 2508 2506 static struct rpc_xprt_ops xs_tcp_ops = { 2509 2507 .reserve_xprt = xprt_reserve_xprt, 2510 2508 .release_xprt = xs_tcp_release_xprt, 2509 + .alloc_slot = xprt_lock_and_alloc_slot, 2511 2510 .rpcbind = rpcb_getport_async, 2512 2511 .set_port = xs_set_port, 2513 2512 .connect = xs_connect,
+3 -1
net/wireless/nl80211.c
··· 5633 5633 sizeof(connect.ht_capa_mask)); 5634 5634 5635 5635 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { 5636 - if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) 5636 + if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) { 5637 + kfree(connkeys); 5637 5638 return -EINVAL; 5639 + } 5638 5640 memcpy(&connect.ht_capa, 5639 5641 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), 5640 5642 sizeof(connect.ht_capa));
+1 -1
net/xfrm/xfrm_input.c
··· 212 212 /* only the first xfrm gets the encap type */ 213 213 encap_type = 0; 214 214 215 - if (async && x->repl->check(x, skb, seq)) { 215 + if (async && x->repl->recheck(x, skb, seq)) { 216 216 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR); 217 217 goto drop_unlock; 218 218 }
+15
net/xfrm/xfrm_replay.c
··· 420 420 return -EINVAL; 421 421 } 422 422 423 + static int xfrm_replay_recheck_esn(struct xfrm_state *x, 424 + struct sk_buff *skb, __be32 net_seq) 425 + { 426 + if (unlikely(XFRM_SKB_CB(skb)->seq.input.hi != 427 + htonl(xfrm_replay_seqhi(x, net_seq)))) { 428 + x->stats.replay_window++; 429 + return -EINVAL; 430 + } 431 + 432 + return xfrm_replay_check_esn(x, skb, net_seq); 433 + } 434 + 423 435 static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq) 424 436 { 425 437 unsigned int bitnr, nr, i; ··· 491 479 static struct xfrm_replay xfrm_replay_legacy = { 492 480 .advance = xfrm_replay_advance, 493 481 .check = xfrm_replay_check, 482 + .recheck = xfrm_replay_check, 494 483 .notify = xfrm_replay_notify, 495 484 .overflow = xfrm_replay_overflow, 496 485 }; ··· 499 486 static struct xfrm_replay xfrm_replay_bmp = { 500 487 .advance = xfrm_replay_advance_bmp, 501 488 .check = xfrm_replay_check_bmp, 489 + .recheck = xfrm_replay_check_bmp, 502 490 .notify = xfrm_replay_notify_bmp, 503 491 .overflow = xfrm_replay_overflow_bmp, 504 492 }; ··· 507 493 static struct xfrm_replay xfrm_replay_esn = { 508 494 .advance = xfrm_replay_advance_esn, 509 495 .check = xfrm_replay_check_esn, 496 + .recheck = xfrm_replay_recheck_esn, 510 497 .notify = xfrm_replay_notify_bmp, 511 498 .overflow = xfrm_replay_overflow_esn, 512 499 };
+3 -5
sound/core/compress_offload.c
··· 80 80 int maj = imajor(inode); 81 81 int ret; 82 82 83 - if (f->f_flags & O_WRONLY) 83 + if ((f->f_flags & O_ACCMODE) == O_WRONLY) 84 84 dirn = SND_COMPRESS_PLAYBACK; 85 - else if (f->f_flags & O_RDONLY) 85 + else if ((f->f_flags & O_ACCMODE) == O_RDONLY) 86 86 dirn = SND_COMPRESS_CAPTURE; 87 - else { 88 - pr_err("invalid direction\n"); 87 + else 89 88 return -EINVAL; 90 - } 91 89 92 90 if (maj == snd_major) 93 91 compr = snd_lookup_minor_data(iminor(inode),
+1 -1
sound/pci/hda/hda_codec.c
··· 2353 2353 } 2354 2354 if (codec->patch_ops.free) 2355 2355 codec->patch_ops.free(codec); 2356 + memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); 2356 2357 snd_hda_jack_tbl_clear(codec); 2357 2358 codec->proc_widget_hook = NULL; 2358 2359 codec->spec = NULL; ··· 2369 2368 codec->num_pcms = 0; 2370 2369 codec->pcm_info = NULL; 2371 2370 codec->preset = NULL; 2372 - memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); 2373 2371 codec->slave_dig_outs = NULL; 2374 2372 codec->spdif_status_reset = 0; 2375 2373 module_put(codec->owner);
+2
sound/pci/hda/hda_intel.c
··· 2701 2701 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2702 2702 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), 2703 2703 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), 2704 + SND_PCI_QUIRK(0x1043, 0x1ac3, "ASUS X53S", POS_FIX_POSBUF), 2705 + SND_PCI_QUIRK(0x1043, 0x1b43, "ASUS K53E", POS_FIX_POSBUF), 2704 2706 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), 2705 2707 SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB), 2706 2708 SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
+1 -1
sound/pci/hda/patch_sigmatel.c
··· 1075 1075 1076 1076 static const char * const slave_pfxs[] = { 1077 1077 "Front", "Surround", "Center", "LFE", "Side", 1078 - "Headphone", "Speaker", "IEC958", 1078 + "Headphone", "Speaker", "IEC958", "PCM", 1079 1079 NULL 1080 1080 }; 1081 1081
+2 -1
sound/pci/ice1712/prodigy_hifi.c
··· 297 297 } 298 298 299 299 static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); 300 + static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); 300 301 301 302 static struct snd_kcontrol_new prodigy_hd2_controls[] __devinitdata = { 302 303 { ··· 308 307 .info = ak4396_dac_vol_info, 309 308 .get = ak4396_dac_vol_get, 310 309 .put = ak4396_dac_vol_put, 311 - .tlv = { .p = db_scale_wm_dac }, 310 + .tlv = { .p = ak4396_db_scale }, 312 311 }, 313 312 }; 314 313
+81
sound/soc/codecs/ab8500-codec.c
··· 34 34 #include <linux/mfd/abx500/ab8500-sysctrl.h> 35 35 #include <linux/mfd/abx500/ab8500-codec.h> 36 36 #include <linux/regulator/consumer.h> 37 + #include <linux/of.h> 37 38 38 39 #include <sound/core.h> 39 40 #include <sound/pcm.h> ··· 2395 2394 } 2396 2395 }; 2397 2396 2397 + static void ab8500_codec_of_probe(struct device *dev, struct device_node *np, 2398 + struct ab8500_codec_platform_data *codec) 2399 + { 2400 + u32 value; 2401 + 2402 + if (of_get_property(np, "stericsson,amic1-type-single-ended", NULL)) 2403 + codec->amics.mic1_type = AMIC_TYPE_SINGLE_ENDED; 2404 + else 2405 + codec->amics.mic1_type = AMIC_TYPE_DIFFERENTIAL; 2406 + 2407 + if (of_get_property(np, "stericsson,amic2-type-single-ended", NULL)) 2408 + codec->amics.mic2_type = AMIC_TYPE_SINGLE_ENDED; 2409 + else 2410 + codec->amics.mic2_type = AMIC_TYPE_DIFFERENTIAL; 2411 + 2412 + /* Has a non-standard Vamic been requested? */ 2413 + if (of_get_property(np, "stericsson,amic1a-bias-vamic2", NULL)) 2414 + codec->amics.mic1a_micbias = AMIC_MICBIAS_VAMIC2; 2415 + else 2416 + codec->amics.mic1a_micbias = AMIC_MICBIAS_VAMIC1; 2417 + 2418 + if (of_get_property(np, "stericsson,amic1b-bias-vamic2", NULL)) 2419 + codec->amics.mic1b_micbias = AMIC_MICBIAS_VAMIC2; 2420 + else 2421 + codec->amics.mic1b_micbias = AMIC_MICBIAS_VAMIC1; 2422 + 2423 + if (of_get_property(np, "stericsson,amic2-bias-vamic1", NULL)) 2424 + codec->amics.mic2_micbias = AMIC_MICBIAS_VAMIC1; 2425 + else 2426 + codec->amics.mic2_micbias = AMIC_MICBIAS_VAMIC2; 2427 + 2428 + if (!of_property_read_u32(np, "stericsson,earpeice-cmv", &value)) { 2429 + switch (value) { 2430 + case 950 : 2431 + codec->ear_cmv = EAR_CMV_0_95V; 2432 + break; 2433 + case 1100 : 2434 + codec->ear_cmv = EAR_CMV_1_10V; 2435 + break; 2436 + case 1270 : 2437 + codec->ear_cmv = EAR_CMV_1_27V; 2438 + break; 2439 + case 1580 : 2440 + codec->ear_cmv = EAR_CMV_1_58V; 2441 + break; 2442 + default : 2443 + codec->ear_cmv = EAR_CMV_UNKNOWN; 2444 + dev_err(dev, "Unsuitable earpiece voltage found in DT\n"); 2445 + } 2446 + } else { 2447 + dev_warn(dev, "No earpiece voltage found in DT - using default\n"); 2448 + codec->ear_cmv = EAR_CMV_0_95V; 2449 + } 2450 + } 2451 + 2398 2452 static int ab8500_codec_probe(struct snd_soc_codec *codec) 2399 2453 { 2400 2454 struct device *dev = codec->dev; 2455 + struct device_node *np = dev->of_node; 2401 2456 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(dev); 2402 2457 struct ab8500_platform_data *pdata; 2403 2458 struct filter_control *fc; ··· 2466 2409 2467 2410 /* Inform SoC Core that we have our own I/O arrangements. */ 2468 2411 codec->control_data = (void *)true; 2412 + 2413 + if (np) { 2414 + if (!pdata) 2415 + pdata = devm_kzalloc(dev, 2416 + sizeof(struct ab8500_platform_data), 2417 + GFP_KERNEL); 2418 + 2419 + if (pdata && !pdata->codec) 2420 + pdata->codec 2421 + = devm_kzalloc(dev, 2422 + sizeof(struct ab8500_codec_platform_data), 2423 + GFP_KERNEL); 2424 + 2425 + if (!(pdata && pdata->codec)) 2426 + return -ENOMEM; 2427 + 2428 + ab8500_codec_of_probe(dev, np, pdata->codec); 2429 + 2430 + } else { 2431 + if (!(pdata && pdata->codec)) { 2432 + dev_err(dev, "No codec platform data or DT found\n"); 2433 + return -EINVAL; 2434 + } 2435 + } 2469 2436 2470 2437 status = ab8500_audio_setup_mics(codec, &pdata->codec->amics); 2471 2438 if (status < 0) {
+1 -1
sound/soc/codecs/arizona.c
··· 426 426 940800, 427 427 1411200, 428 428 1881600, 429 - 2882400, 429 + 2822400, 430 430 3763200, 431 431 5644800, 432 432 7526400,
+4 -4
sound/soc/codecs/mc13783.c
··· 659 659 .id = MC13783_ID_STEREO_DAC, 660 660 .playback = { 661 661 .stream_name = "Playback", 662 - .channels_min = 1, 662 + .channels_min = 2, 663 663 .channels_max = 2, 664 664 .rates = SNDRV_PCM_RATE_8000_96000, 665 665 .formats = MC13783_FORMATS, ··· 670 670 .id = MC13783_ID_STEREO_CODEC, 671 671 .capture = { 672 672 .stream_name = "Capture", 673 - .channels_min = 1, 673 + .channels_min = 2, 674 674 .channels_max = 2, 675 675 .rates = MC13783_RATES_RECORD, 676 676 .formats = MC13783_FORMATS, ··· 692 692 .id = MC13783_ID_SYNC, 693 693 .playback = { 694 694 .stream_name = "Playback", 695 - .channels_min = 1, 695 + .channels_min = 2, 696 696 .channels_max = 2, 697 697 .rates = SNDRV_PCM_RATE_8000_96000, 698 698 .formats = MC13783_FORMATS, 699 699 }, 700 700 .capture = { 701 701 .stream_name = "Capture", 702 - .channels_min = 1, 702 + .channels_min = 2, 703 703 .channels_max = 2, 704 704 .rates = MC13783_RATES_RECORD, 705 705 .formats = MC13783_FORMATS,
+1 -1
sound/soc/codecs/wm8904.c
··· 100 100 { 14, 0x0000 }, /* R14 - Power Management 2 */ 101 101 { 15, 0x0000 }, /* R15 - Power Management 3 */ 102 102 { 18, 0x0000 }, /* R18 - Power Management 6 */ 103 - { 19, 0x945E }, /* R20 - Clock Rates 0 */ 103 + { 20, 0x945E }, /* R20 - Clock Rates 0 */ 104 104 { 21, 0x0C05 }, /* R21 - Clock Rates 1 */ 105 105 { 22, 0x0006 }, /* R22 - Clock Rates 2 */ 106 106 { 24, 0x0050 }, /* R24 - Audio Interface 0 */
+1 -1
sound/soc/fsl/imx-sgtl5000.c
··· 94 94 dev_err(&pdev->dev, "audmux internal port setup failed\n"); 95 95 return ret; 96 96 } 97 - imx_audmux_v2_configure_port(ext_port, 97 + ret = imx_audmux_v2_configure_port(ext_port, 98 98 IMX_AUDMUX_V2_PTCR_SYN, 99 99 IMX_AUDMUX_V2_PDCR_RXDSEL(int_port)); 100 100 if (ret) {
+1 -1
sound/soc/omap/am3517evm.c
··· 59 59 return ret; 60 60 } 61 61 62 - snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0, 62 + ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0, 63 63 SND_SOC_CLOCK_IN); 64 64 if (ret < 0) { 65 65 printk(KERN_ERR "can't set CPU system clock OMAP_MCBSP_FSR_SRC_FSX\n");
+1 -7
sound/soc/samsung/dma.c
··· 34 34 .info = SNDRV_PCM_INFO_INTERLEAVED | 35 35 SNDRV_PCM_INFO_BLOCK_TRANSFER | 36 36 SNDRV_PCM_INFO_MMAP | 37 - SNDRV_PCM_INFO_MMAP_VALID | 38 - SNDRV_PCM_INFO_PAUSE | 39 - SNDRV_PCM_INFO_RESUME, 37 + SNDRV_PCM_INFO_MMAP_VALID, 40 38 .formats = SNDRV_PCM_FMTBIT_S16_LE | 41 39 SNDRV_PCM_FMTBIT_U16_LE | 42 40 SNDRV_PCM_FMTBIT_U8 | ··· 246 248 247 249 switch (cmd) { 248 250 case SNDRV_PCM_TRIGGER_START: 249 - case SNDRV_PCM_TRIGGER_RESUME: 250 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 251 251 prtd->state |= ST_RUNNING; 252 252 prtd->params->ops->trigger(prtd->params->ch); 253 253 break; 254 254 255 255 case SNDRV_PCM_TRIGGER_STOP: 256 - case SNDRV_PCM_TRIGGER_SUSPEND: 257 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 258 256 prtd->state &= ~ST_RUNNING; 259 257 prtd->params->ops->stop(prtd->params->ch); 260 258 break;
+4 -1
sound/soc/soc-dapm.c
··· 291 291 if (dapm->codec->driver->set_bias_level) 292 292 ret = dapm->codec->driver->set_bias_level(dapm->codec, 293 293 level); 294 - } else 294 + else 295 + dapm->bias_level = level; 296 + } else if (!card || dapm != &card->dapm) { 295 297 dapm->bias_level = level; 298 + } 296 299 297 300 if (ret != 0) 298 301 goto out;
+1 -1
sound/soc/spear/spear_pcm.c
··· 138 138 continue; 139 139 140 140 buf = &substream->dma_buffer; 141 - if (!buf && !buf->area) 141 + if (!buf || !buf->area) 142 142 continue; 143 143 144 144 dma_free_writecombine(pcm->card->dev, buf->bytes,
-1
sound/soc/tegra/tegra_alc5632.c
··· 89 89 .name = "Headset detection", 90 90 .report = SND_JACK_HEADSET, 91 91 .debounce_time = 150, 92 - .invert = 1, 93 92 }; 94 93 95 94 static const struct snd_soc_dapm_widget tegra_alc5632_dapm_widgets[] = {
+2 -2
sound/soc/tegra/tegra_pcm.c
··· 334 334 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 335 335 slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 336 336 slave_config.dst_addr = dmap->addr; 337 - slave_config.src_maxburst = 0; 337 + slave_config.dst_maxburst = 4; 338 338 } else { 339 339 slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 340 340 slave_config.src_addr = dmap->addr; 341 - slave_config.dst_maxburst = 0; 341 + slave_config.src_maxburst = 4; 342 342 } 343 343 slave_config.slave_id = dmap->req_sel; 344 344
+42 -5
sound/soc/ux500/mop500.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/io.h> 18 18 #include <linux/spi/spi.h> 19 + #include <linux/of.h> 19 20 20 21 #include <sound/soc.h> 21 22 #include <sound/initval.h> ··· 57 56 .num_links = ARRAY_SIZE(mop500_dai_links), 58 57 }; 59 58 59 + static int __devinit mop500_of_probe(struct platform_device *pdev, 60 + struct device_node *np) 61 + { 62 + struct device_node *codec_np, *msp_np[2]; 63 + int i; 64 + 65 + msp_np[0] = of_parse_phandle(np, "stericsson,cpu-dai", 0); 66 + msp_np[1] = of_parse_phandle(np, "stericsson,cpu-dai", 1); 67 + codec_np = of_parse_phandle(np, "stericsson,audio-codec", 0); 68 + 69 + if (!(msp_np[0] && msp_np[1] && codec_np)) { 70 + dev_err(&pdev->dev, "Phandle missing or invalid\n"); 71 + return -EINVAL; 72 + } 73 + 74 + for (i = 0; i < 2; i++) { 75 + mop500_dai_links[i].cpu_of_node = msp_np[i]; 76 + mop500_dai_links[i].cpu_dai_name = NULL; 77 + mop500_dai_links[i].codec_of_node = codec_np; 78 + mop500_dai_links[i].codec_name = NULL; 79 + } 80 + 81 + snd_soc_of_parse_card_name(&mop500_card, "stericsson,card-name"); 82 + 83 + return 0; 84 + } 60 85 static int __devinit mop500_probe(struct platform_device *pdev) 61 86 { 87 + struct device_node *np = pdev->dev.of_node; 62 88 int ret; 63 - 64 - pr_debug("%s: Enter.\n", __func__); 65 89 66 90 dev_dbg(&pdev->dev, "%s: Enter.\n", __func__); 67 91 68 92 mop500_card.dev = &pdev->dev; 93 + 94 + if (np) { 95 + ret = mop500_of_probe(pdev, np); 96 + if (ret) 97 + return ret; 98 + } 69 99 70 100 dev_dbg(&pdev->dev, "%s: Card %s: Set platform drvdata.\n", 71 101 __func__, mop500_card.name); ··· 115 83 ret = snd_soc_register_card(&mop500_card); 116 84 if (ret) 117 85 dev_err(&pdev->dev, 118 - "Error: snd_soc_register_card failed (%d)!\n", 119 - ret); 86 + "Error: snd_soc_register_card failed (%d)!\n", ret); 120 87 121 88 return ret; 122 89 } ··· 128 97 129 98 snd_soc_unregister_card(mop500_card); 130 99 mop500_ab8500_remove(mop500_card); 131 - 100 + 132 101 return 0; 133 102 } 103 + 104 + static const struct of_device_id snd_soc_mop500_match[] = { 105 + { .compatible = "stericsson,snd-soc-mop500", }, 106 + {}, 107 + }; 134 108 135 109 static struct platform_driver snd_soc_mop500_driver = { 136 110 .driver = { 137 111 .owner = THIS_MODULE, 138 112 .name = "snd-soc-mop500", 113 + .of_match_table = snd_soc_mop500_match, 139 114 }, 140 115 .probe = mop500_probe, 141 116 .remove = __devexit_p(mop500_remove),
+6
sound/soc/ux500/ux500_msp_dai.c
··· 830 830 return 0; 831 831 } 832 832 833 + static const struct of_device_id ux500_msp_i2s_match[] = { 834 + { .compatible = "stericsson,ux500-msp-i2s", }, 835 + {}, 836 + }; 837 + 833 838 static struct platform_driver msp_i2s_driver = { 834 839 .driver = { 835 840 .name = "ux500-msp-i2s", 836 841 .owner = THIS_MODULE, 842 + .of_match_table = ux500_msp_i2s_match, 837 843 }, 838 844 .probe = ux500_msp_drv_probe, 839 845 .remove = ux500_msp_drv_remove,
+75 -39
sound/soc/ux500/ux500_msp_i2s.c
··· 15 15 16 16 #include <linux/module.h> 17 17 #include <linux/platform_device.h> 18 + #include <linux/pinctrl/consumer.h> 18 19 #include <linux/delay.h> 19 20 #include <linux/slab.h> 21 + #include <linux/of.h> 20 22 21 23 #include <mach/hardware.h> 22 24 #include <mach/msp.h> ··· 26 24 #include <sound/soc.h> 27 25 28 26 #include "ux500_msp_i2s.h" 27 + 28 + /* MSP1/3 Tx/Rx usage protection */ 29 + static DEFINE_SPINLOCK(msp_rxtx_lock); 29 30 30 31 /* Protocol desciptors */ 31 32 static const struct msp_protdesc prot_descs[] = { ··· 357 352 358 353 static int enable_msp(struct ux500_msp *msp, struct ux500_msp_config *config) 359 354 { 360 - int status = 0; 355 + int status = 0, retval = 0; 361 356 u32 reg_val_DMACR, reg_val_GCR; 357 + unsigned long flags; 362 358 363 359 /* Check msp state whether in RUN or CONFIGURED Mode */ 364 - if ((msp->msp_state == MSP_STATE_IDLE) && (msp->plat_init)) { 365 - status = msp->plat_init(); 366 - if (status) { 367 - dev_err(msp->dev, "%s: ERROR: Failed to init MSP (%d)!\n", 368 - __func__, status); 369 - return status; 360 + if (msp->msp_state == MSP_STATE_IDLE) { 361 + spin_lock_irqsave(&msp_rxtx_lock, flags); 362 + if (msp->pinctrl_rxtx_ref == 0 && 363 + !(IS_ERR(msp->pinctrl_p) || IS_ERR(msp->pinctrl_def))) { 364 + retval = pinctrl_select_state(msp->pinctrl_p, 365 + msp->pinctrl_def); 366 + if (retval) 367 + pr_err("could not set MSP defstate\n"); 370 368 } 369 + if (!retval) 370 + msp->pinctrl_rxtx_ref++; 371 + spin_unlock_irqrestore(&msp_rxtx_lock, flags); 371 372 } 372 373 373 374 /* Configure msp with protocol dependent settings */ ··· 631 620 632 621 int ux500_msp_i2s_close(struct ux500_msp *msp, unsigned int dir) 633 622 { 634 - int status = 0; 623 + int status = 0, retval = 0; 624 + unsigned long flags; 635 625 636 626 dev_dbg(msp->dev, "%s: Enter (dir = 0x%01x).\n", __func__, dir); 637 627 ··· 643 631 writel((readl(msp->registers + MSP_GCR) & 644 632 (~(FRAME_GEN_ENABLE | SRG_ENABLE))), 645 633 msp->registers + MSP_GCR); 646 - if (msp->plat_exit) 647 - status = msp->plat_exit(); 648 - if (status) 649 - dev_warn(msp->dev, 650 - "%s: WARN: ux500_msp_i2s_exit failed (%d)!\n", 651 - __func__, status); 634 + 635 + spin_lock_irqsave(&msp_rxtx_lock, flags); 636 + WARN_ON(!msp->pinctrl_rxtx_ref); 637 + msp->pinctrl_rxtx_ref--; 638 + if (msp->pinctrl_rxtx_ref == 0 && 639 + !(IS_ERR(msp->pinctrl_p) || IS_ERR(msp->pinctrl_sleep))) { 640 + retval = pinctrl_select_state(msp->pinctrl_p, 641 + msp->pinctrl_sleep); 642 + if (retval) 643 + pr_err("could not set MSP sleepstate\n"); 644 + } 645 + spin_unlock_irqrestore(&msp_rxtx_lock, flags); 646 + 652 647 writel(0, msp->registers + MSP_GCR); 653 648 writel(0, msp->registers + MSP_TCF); 654 649 writel(0, msp->registers + MSP_RCF); ··· 682 663 struct ux500_msp **msp_p, 683 664 struct msp_i2s_platform_data *platform_data) 684 665 { 685 - int ret = 0; 686 666 struct resource *res = NULL; 687 667 struct i2s_controller *i2s_cont; 668 + struct device_node *np = pdev->dev.of_node; 688 669 struct ux500_msp *msp; 689 - 690 - dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__, 691 - pdev->name, platform_data->id); 692 670 693 671 *msp_p = devm_kzalloc(&pdev->dev, sizeof(struct ux500_msp), GFP_KERNEL); 694 672 msp = *msp_p; 695 673 674 + if (np) { 675 + if (!platform_data) { 676 + platform_data = devm_kzalloc(&pdev->dev, 677 + sizeof(struct msp_i2s_platform_data), GFP_KERNEL); 678 + if (!platform_data) 679 + ret = -ENOMEM; 680 + } 681 + } else 682 + if (!platform_data) 683 + ret = -EINVAL; 684 + 685 + if (ret) 686 + goto err_res; 687 + 688 + dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__, 689 + pdev->name, platform_data->id); 690 + 696 691 msp->id = platform_data->id; 697 692 msp->dev = &pdev->dev; 698 - msp->plat_init = platform_data->msp_i2s_init; 699 - msp->plat_exit = platform_data->msp_i2s_exit; 700 693 msp->dma_cfg_rx = platform_data->msp_i2s_dma_rx; 701 694 msp->dma_cfg_tx = platform_data->msp_i2s_dma_tx; 702 695 ··· 716 685 if (res == NULL) { 717 686 dev_err(&pdev->dev, "%s: ERROR: Unable to get resource!\n", 718 687 __func__); 719 - ret = -ENOMEM; 720 - goto err_res; 688 + return -ENOMEM; 721 689 } 722 690 723 - msp->registers = ioremap(res->start, (res->end - res->start + 1)); 691 + msp->registers = devm_ioremap(&pdev->dev, res->start, 692 + resource_size(res)); 724 693 if (msp->registers == NULL) { 725 694 dev_err(&pdev->dev, "%s: ERROR: ioremap failed!\n", __func__); 726 - ret = -ENOMEM; 727 - goto err_res; 695 + return -ENOMEM; 728 696 } 729 697 730 698 msp->msp_state = MSP_STATE_IDLE; ··· 735 705 dev_err(&pdev->dev, 736 706 "%s: ERROR: Failed to allocate I2S-controller!\n", 737 707 __func__); 738 - goto err_i2s_cont; 708 + return -ENOMEM; 739 709 } 740 710 i2s_cont->dev.parent = &pdev->dev; 741 711 i2s_cont->data = (void *)msp; ··· 745 715 dev_dbg(&pdev->dev, "I2S device-name: '%s'\n", i2s_cont->name); 746 716 msp->i2s_cont = i2s_cont; 747 717 718 + msp->pinctrl_p = pinctrl_get(msp->dev); 719 + if (IS_ERR(msp->pinctrl_p)) 720 + dev_err(&pdev->dev, "could not get MSP pinctrl\n"); 721 + else { 722 + msp->pinctrl_def = pinctrl_lookup_state(msp->pinctrl_p, 723 + PINCTRL_STATE_DEFAULT); 724 + if (IS_ERR(msp->pinctrl_def)) { 725 + dev_err(&pdev->dev, 726 + "could not get MSP defstate (%li)\n", 727 + PTR_ERR(msp->pinctrl_def)); 728 + } 729 + msp->pinctrl_sleep = pinctrl_lookup_state(msp->pinctrl_p, 730 + PINCTRL_STATE_SLEEP); 731 + if (IS_ERR(msp->pinctrl_sleep)) 732 + dev_err(&pdev->dev, 733 + "could not get MSP idlestate (%li)\n", 734 + PTR_ERR(msp->pinctrl_def)); 735 + } 736 + 748 737 return 0; 749 - 750 - err_i2s_cont: 751 - iounmap(msp->registers); 752 - 753 - err_res: 754 - devm_kfree(&pdev->dev, msp); 755 - 756 - return ret; 757 738 } 758 739 759 740 void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev, ··· 773 732 dev_dbg(msp->dev, "%s: Enter (id = %d).\n", __func__, msp->id); 774 733 775 734 device_unregister(&msp->i2s_cont->dev); 776 - devm_kfree(&pdev->dev, msp->i2s_cont); 777 - 778 - iounmap(msp->registers); 779 - 780 - devm_kfree(&pdev->dev, msp); 781 735 } 782 736 783 737 MODULE_LICENSE("GPL v2");
+6 -2
sound/soc/ux500/ux500_msp_i2s.h
··· 524 524 struct dma_chan *rx_pipeid; 525 525 enum msp_state msp_state; 526 526 int (*transfer) (struct ux500_msp *msp, struct i2s_message *message); 527 - int (*plat_init) (void); 528 - int (*plat_exit) (void); 529 527 struct timer_list notify_timer; 530 528 int def_elem_len; 531 529 unsigned int dir_busy; 532 530 int loopback_enable; 533 531 u32 backup_regs[MAX_MSP_BACKUP_REGS]; 534 532 unsigned int f_bitclk; 533 + /* Pin modes */ 534 + struct pinctrl *pinctrl_p; 535 + struct pinctrl_state *pinctrl_def; 536 + struct pinctrl_state *pinctrl_sleep; 537 + /* Reference Count */ 538 + int pinctrl_rxtx_ref; 535 539 }; 536 540 537 541 struct ux500_msp_dma_params {
+6
sound/usb/pcm.c
··· 1140 1140 int processed = urb->transfer_buffer_length / stride; 1141 1141 int est_delay; 1142 1142 1143 + /* ignore the delay accounting when procssed=0 is given, i.e. 1144 + * silent payloads are procssed before handling the actual data 1145 + */ 1146 + if (!processed) 1147 + return; 1148 + 1143 1149 spin_lock_irqsave(&subs->lock, flags); 1144 1150 est_delay = snd_usb_pcm_delay(subs, runtime->rate); 1145 1151 /* update delay with exact number of samples played */