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

Merge remote-tracking branch 'tip/timers/core/timers/core' into clockevents/3.16

+3483 -2141
+3
Documentation/devicetree/bindings/arm/arch_timer.txt
··· 19 19 20 20 - clock-frequency : The frequency of the main counter, in Hz. Optional. 21 21 22 + - always-on : a boolean property. If present, the timer is powered through an 23 + always-on power domain, therefore it never loses context. 24 + 22 25 Example: 23 26 24 27 timer {
+1 -1
Documentation/devicetree/bindings/net/socfpga-dwmac.txt
··· 23 23 interrupt-names = "macirq"; 24 24 mac-address = [00 00 00 00 00 00];/* Filled in by U-Boot */ 25 25 clocks = <&emac_0_clk>; 26 - clocks-names = "stmmaceth"; 26 + clock-names = "stmmaceth"; 27 27 };
+1 -1
Documentation/devicetree/bindings/net/stmmac.txt
··· 33 33 - max-frame-size: See ethernet.txt file in the same directory 34 34 - clocks: If present, the first clock should be the GMAC main clock, 35 35 further clocks may be specified in derived bindings. 36 - - clocks-names: One name for each entry in the clocks property, the 36 + - clock-names: One name for each entry in the clocks property, the 37 37 first one should be "stmmaceth". 38 38 39 39 Examples:
+2 -2
Documentation/devicetree/bindings/pinctrl/pinctrl-st.txt
··· 83 83 reg = <0xfe61f080 0x4>; 84 84 reg-names = "irqmux"; 85 85 interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>; 86 - interrupts-names = "irqmux"; 86 + interrupt-names = "irqmux"; 87 87 ranges = <0 0xfe610000 0x5000>; 88 88 89 89 PIO0: gpio@fe610000 { ··· 165 165 interrupt-parent = <&PIO3>; 166 166 #interrupt-cells = <2>; 167 167 interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; /* Interrupt line via PIO3-3 */ 168 - interrupts-names = "card-detect"; 168 + interrupt-names = "card-detect"; 169 169 pinctrl-names = "default"; 170 170 pinctrl-0 = <&pinctrl_mmc>; 171 171 };
+1 -1
Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
··· 47 47 reg = <0x100000 0x3000>; 48 48 reg-names "mpu"; 49 49 interrupts = <82>, <83>; 50 - interrupts-names = "tx", "rx"; 50 + interrupt-names = "tx", "rx"; 51 51 op-mode = <0>; /* MCASP_IIS_MODE */ 52 52 tdm-slots = <2>; 53 53 serial-dir = <
+3 -3
Documentation/devicetree/bindings/sound/tlv320aic31xx.txt
··· 13 13 "ti,tlv320aic3111" - TLV320AIC3111 (stereo speaker amp, MiniDSP) 14 14 15 15 - reg - <int> - I2C slave address 16 + - HPVDD-supply, SPRVDD-supply, SPLVDD-supply, AVDD-supply, IOVDD-supply, 17 + DVDD-supply : power supplies for the device as covered in 18 + Documentation/devicetree/bindings/regulator/regulator.txt 16 19 17 20 18 21 Optional properties: ··· 27 24 3 or MICBIAS_AVDD - MICBIAS output is connected to AVDD 28 25 If this node is not mentioned or if the value is unknown, then 29 26 micbias is set to 2.0V. 30 - - HPVDD-supply, SPRVDD-supply, SPLVDD-supply, AVDD-supply, IOVDD-supply, 31 - DVDD-supply : power supplies for the device as covered in 32 - Documentation/devicetree/bindings/regulator/regulator.txt 33 27 34 28 CODEC output pins: 35 29 * HPL
+3 -3
Documentation/timers/timer_stats.txt
··· 39 39 The statistics can be retrieved by: 40 40 # cat /proc/timer_stats 41 41 42 - The readout of /proc/timer_stats automatically disables sampling. The sampled 43 - information is kept until a new sample period is started. This allows multiple 44 - readouts. 42 + While sampling is enabled, each readout from /proc/timer_stats will see 43 + newly updated statistics. Once sampling is disabled, the sampled information 44 + is kept until a new sample period is started. This allows multiple readouts. 45 45 46 46 Sample output of /proc/timer_stats: 47 47
+11
MAINTAINERS
··· 3485 3485 F: drivers/extcon/ 3486 3486 F: Documentation/extcon/ 3487 3487 3488 + EXYNOS DP DRIVER 3489 + M: Jingoo Han <jg1.han@samsung.com> 3490 + L: dri-devel@lists.freedesktop.org 3491 + S: Maintained 3492 + F: drivers/gpu/drm/exynos/exynos_dp* 3493 + 3488 3494 EXYNOS MIPI DISPLAY DRIVERS 3489 3495 M: Inki Dae <inki.dae@samsung.com> 3490 3496 M: Donghwa Lee <dh09.lee@samsung.com> ··· 5114 5108 5115 5109 KERNEL VIRTUAL MACHINE (KVM) FOR ARM 5116 5110 M: Christoffer Dall <christoffer.dall@linaro.org> 5111 + M: Marc Zyngier <marc.zyngier@arm.com> 5112 + L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 5117 5113 L: kvmarm@lists.cs.columbia.edu 5118 5114 W: http://systems.cs.columbia.edu/projects/kvm-arm 5119 5115 S: Supported 5120 5116 F: arch/arm/include/uapi/asm/kvm* 5121 5117 F: arch/arm/include/asm/kvm* 5122 5118 F: arch/arm/kvm/ 5119 + F: virt/kvm/arm/ 5120 + F: include/kvm/arm_* 5123 5121 5124 5122 KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64) 5123 + M: Christoffer Dall <christoffer.dall@linaro.org> 5125 5124 M: Marc Zyngier <marc.zyngier@arm.com> 5126 5125 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 5127 5126 L: kvmarm@lists.cs.columbia.edu
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 15 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc2 4 + EXTRAVERSION = -rc3 5 5 NAME = Shuffling Zombie Juror 6 6 7 7 # *DOCUMENTATION*
+5 -3
arch/arc/kernel/entry.S
··· 614 614 615 615 resume_kernel_mode: 616 616 617 - #ifdef CONFIG_PREEMPT 618 - 619 - ; This is a must for preempt_schedule_irq() 617 + ; Disable Interrupts from this point on 618 + ; CONFIG_PREEMPT: This is a must for preempt_schedule_irq() 619 + ; !CONFIG_PREEMPT: To ensure restore_regs is intr safe 620 620 IRQ_DISABLE r9 621 + 622 + #ifdef CONFIG_PREEMPT 621 623 622 624 ; Can't preempt if preemption disabled 623 625 GET_CURR_THR_INFO_FROM_SP r10
+9 -8
arch/arm/Kconfig
··· 30 30 select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) 31 31 select HAVE_ARCH_TRACEHOOK 32 32 select HAVE_BPF_JIT 33 + select HAVE_CC_STACKPROTECTOR 33 34 select HAVE_CONTEXT_TRACKING 34 35 select HAVE_C_RECORDMCOUNT 35 - select HAVE_CC_STACKPROTECTOR 36 36 select HAVE_DEBUG_KMEMLEAK 37 37 select HAVE_DMA_API_DEBUG 38 38 select HAVE_DMA_ATTRS ··· 311 311 select ARM_HAS_SG_CHAIN 312 312 select ARM_PATCH_PHYS_VIRT 313 313 select AUTO_ZRELADDR 314 + select CLKSRC_OF 314 315 select COMMON_CLK 315 316 select GENERIC_CLOCKEVENTS 316 317 select MULTI_IRQ_HANDLER ··· 423 422 bool "Energy Micro efm32" 424 423 depends on !MMU 425 424 select ARCH_REQUIRE_GPIOLIB 426 - select AUTO_ZRELADDR 427 425 select ARM_NVIC 426 + select AUTO_ZRELADDR 428 427 select CLKSRC_OF 429 428 select COMMON_CLK 430 429 select CPU_V7M ··· 512 511 bool "IXP4xx-based" 513 512 depends on MMU 514 513 select ARCH_HAS_DMA_SET_COHERENT_MASK 515 - select ARCH_SUPPORTS_BIG_ENDIAN 516 514 select ARCH_REQUIRE_GPIOLIB 515 + select ARCH_SUPPORTS_BIG_ENDIAN 517 516 select CLKSRC_MMIO 518 517 select CPU_XSCALE 519 518 select DMABOUNCE if PCI ··· 1111 1110 default 8 1112 1111 1113 1112 config IWMMXT 1114 - bool "Enable iWMMXt support" if !CPU_PJ4 1115 - depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 1116 - default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 1113 + bool "Enable iWMMXt support" 1114 + depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B 1115 + default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 || CPU_PJ4B 1117 1116 help 1118 1117 Enable support for iWMMXt context switching at run time if 1119 1118 running on a CPU that supports it. ··· 1576 1575 config BL_SWITCHER 1577 1576 bool "big.LITTLE switcher support" 1578 1577 depends on BIG_LITTLE && MCPM && HOTPLUG_CPU 1579 - select CPU_PM 1580 1578 select ARM_CPU_SUSPEND 1579 + select CPU_PM 1581 1580 help 1582 1581 The big.LITTLE "switcher" provides the core functionality to 1583 1582 transparently handle transition between a cluster of A15's ··· 1921 1920 depends on CPU_V7 && !CPU_V6 1922 1921 depends on !GENERIC_ATOMIC64 1923 1922 depends on MMU 1923 + select ARCH_DMA_ADDR_T_64BIT 1924 1924 select ARM_PSCI 1925 1925 select SWIOTLB_XEN 1926 - select ARCH_DMA_ADDR_T_64BIT 1927 1926 help 1928 1927 Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. 1929 1928
+6 -6
arch/arm/Kconfig.debug
··· 1030 1030 default 0x40100000 if DEBUG_PXA_UART1 1031 1031 default 0x42000000 if ARCH_GEMINI 1032 1032 default 0x7c0003f8 if FOOTBRIDGE 1033 - default 0x80230000 if DEBUG_PICOXCELL_UART 1034 1033 default 0x80070000 if DEBUG_IMX23_UART 1035 1034 default 0x80074000 if DEBUG_IMX28_UART 1035 + default 0x80230000 if DEBUG_PICOXCELL_UART 1036 1036 default 0x808c0000 if ARCH_EP93XX 1037 1037 default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART 1038 1038 default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX ··· 1096 1096 default 0xfeb26000 if DEBUG_RK3X_UART1 1097 1097 default 0xfeb30c00 if DEBUG_KEYSTONE_UART0 1098 1098 default 0xfeb31000 if DEBUG_KEYSTONE_UART1 1099 - default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE 1100 - default 0xfed60000 if DEBUG_RK29_UART0 1101 - default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 1102 - default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 1103 1099 default 0xfec02000 if DEBUG_SOCFPGA_UART 1100 + default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE 1104 1101 default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0 1105 1102 default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1 1106 1103 default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2 1107 1104 default 0xfed12000 if ARCH_KIRKWOOD 1105 + default 0xfed60000 if DEBUG_RK29_UART0 1106 + default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 1107 + default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 1108 1108 default 0xfedc0000 if ARCH_EP93XX 1109 1109 default 0xfee003f8 if FOOTBRIDGE 1110 1110 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART 1111 - default 0xfef36000 if DEBUG_HIGHBANK_UART 1112 1111 default 0xfee82340 if ARCH_IOP13XX 1113 1112 default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1114 1113 default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1114 + default 0xfef36000 if DEBUG_HIGHBANK_UART 1115 1115 default 0xfefff700 if ARCH_IOP33X 1116 1116 default 0xff003000 if DEBUG_U300_UART 1117 1117 default DEBUG_UART_PHYS if !MMU
+10 -10
arch/arm/boot/dts/Makefile
··· 51 51 52 52 dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb 53 53 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb 54 + dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb 54 55 dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb \ 55 56 bcm21664-garnet.dtb 56 - dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb 57 - dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb 58 57 dtb-$(CONFIG_ARCH_BERLIN) += \ 59 58 berlin2-sony-nsz-gs7.dtb \ 60 59 berlin2cd-google-chromecast.dtb ··· 245 246 omap3-sbc-t3730.dtb \ 246 247 omap3-devkit8000.dtb \ 247 248 omap3-beagle-xm.dtb \ 249 + omap3-beagle-xm-ab.dtb \ 248 250 omap3-evm.dtb \ 249 251 omap3-evm-37xx.dtb \ 250 252 omap3-ldp.dtb \ ··· 294 294 dtb-$(CONFIG_ARCH_QCOM) += qcom-msm8660-surf.dtb \ 295 295 qcom-msm8960-cdp.dtb \ 296 296 qcom-apq8074-dragonboard.dtb 297 - dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \ 298 - ste-hrefprev60-stuib.dtb \ 299 - ste-hrefprev60-tvk.dtb \ 300 - ste-hrefv60plus-stuib.dtb \ 301 - ste-hrefv60plus-tvk.dtb \ 302 - ste-ccu8540.dtb \ 303 - ste-ccu9540.dtb 304 297 dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb 305 298 dtb-$(CONFIG_ARCH_S3C64XX) += s3c6410-mini6410.dtb \ 306 299 s3c6410-smdk6410.dtb ··· 362 369 tegra30-cardhu-a04.dtb \ 363 370 tegra114-dalmore.dtb \ 364 371 tegra124-venice2.dtb 372 + dtb-$(CONFIG_ARCH_U300) += ste-u300.dtb 373 + dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \ 374 + ste-hrefprev60-stuib.dtb \ 375 + ste-hrefprev60-tvk.dtb \ 376 + ste-hrefv60plus-stuib.dtb \ 377 + ste-hrefv60plus-tvk.dtb \ 378 + ste-ccu8540.dtb \ 379 + ste-ccu9540.dtb 365 380 dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \ 366 381 versatile-pb.dtb 367 - dtb-$(CONFIG_ARCH_U300) += ste-u300.dtb 368 382 dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ 369 383 vexpress-v2p-ca9.dtb \ 370 384 vexpress-v2p-ca15-tc1.dtb \
+2 -2
arch/arm/boot/dts/am335x-bone-common.dtsi
··· 183 183 &usb { 184 184 status = "okay"; 185 185 186 - control@44e10000 { 186 + control@44e10620 { 187 187 status = "okay"; 188 188 }; 189 189 ··· 204 204 dr_mode = "host"; 205 205 }; 206 206 207 - dma-controller@07402000 { 207 + dma-controller@47402000 { 208 208 status = "okay"; 209 209 }; 210 210 };
+4 -4
arch/arm/boot/dts/am335x-evm.dts
··· 301 301 302 302 am335x_evm_audio_pins: am335x_evm_audio_pins { 303 303 pinctrl-single,pins = < 304 - 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rx_dv.mcasp1_aclkx */ 305 - 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_txd3.mcasp1_fsx */ 304 + 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */ 305 + 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */ 306 306 0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */ 307 307 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */ 308 308 >; ··· 331 331 &usb { 332 332 status = "okay"; 333 333 334 - control@44e10000 { 334 + control@44e10620 { 335 335 status = "okay"; 336 336 }; 337 337 ··· 352 352 dr_mode = "host"; 353 353 }; 354 354 355 - dma-controller@07402000 { 355 + dma-controller@47402000 { 356 356 status = "okay"; 357 357 }; 358 358 };
+2 -2
arch/arm/boot/dts/am335x-evmsk.dts
··· 364 364 &usb { 365 365 status = "okay"; 366 366 367 - control@44e10000 { 367 + control@44e10620 { 368 368 status = "okay"; 369 369 }; 370 370 ··· 385 385 dr_mode = "host"; 386 386 }; 387 387 388 - dma-controller@07402000 { 388 + dma-controller@47402000 { 389 389 status = "okay"; 390 390 }; 391 391 };
+2 -3
arch/arm/boot/dts/am335x-igep0033.dtsi
··· 118 118 reg = <0 0 0>; /* CS0, offset 0 */ 119 119 nand-bus-width = <8>; 120 120 ti,nand-ecc-opt = "bch8"; 121 - gpmc,device-nand = "true"; 122 121 gpmc,device-width = <1>; 123 122 gpmc,sync-clk-ps = <0>; 124 123 gpmc,cs-on-ns = <0>; ··· 201 202 &usb { 202 203 status = "okay"; 203 204 204 - control@44e10000 { 205 + control@44e10620 { 205 206 status = "okay"; 206 207 }; 207 208 ··· 222 223 dr_mode = "host"; 223 224 }; 224 225 225 - dma-controller@07402000 { 226 + dma-controller@47402000 { 226 227 status = "okay"; 227 228 }; 228 229 };
+5 -5
arch/arm/boot/dts/am33xx.dtsi
··· 72 72 }; 73 73 74 74 /* 75 - * The soc node represents the soc top level view. It is uses for IPs 75 + * The soc node represents the soc top level view. It is used for IPs 76 76 * that are not memory mapped in the MPU view or for the MPU itself. 77 77 */ 78 78 soc { ··· 94 94 95 95 /* 96 96 * XXX: Use a flat representation of the AM33XX interconnect. 97 - * The real AM33XX interconnect network is quite complex.Since 98 - * that will not bring real advantage to represent that in DT 97 + * The real AM33XX interconnect network is quite complex. Since 98 + * it will not bring real advantage to represent that in DT 99 99 * for the moment, just use a fake OCP bus entry to represent 100 100 * the whole bus hierarchy. 101 101 */ ··· 802 802 <0x46000000 0x400000>; 803 803 reg-names = "mpu", "dat"; 804 804 interrupts = <80>, <81>; 805 - interrupts-names = "tx", "rx"; 805 + interrupt-names = "tx", "rx"; 806 806 status = "disabled"; 807 807 dmas = <&edma 8>, 808 808 <&edma 9>; ··· 816 816 <0x46400000 0x400000>; 817 817 reg-names = "mpu", "dat"; 818 818 interrupts = <82>, <83>; 819 - interrupts-names = "tx", "rx"; 819 + interrupt-names = "tx", "rx"; 820 820 status = "disabled"; 821 821 dmas = <&edma 10>, 822 822 <&edma 11>;
+2 -2
arch/arm/boot/dts/am4372.dtsi
··· 691 691 <0x46000000 0x400000>; 692 692 reg-names = "mpu", "dat"; 693 693 interrupts = <80>, <81>; 694 - interrupts-names = "tx", "rx"; 694 + interrupt-names = "tx", "rx"; 695 695 status = "disabled"; 696 696 dmas = <&edma 8>, 697 697 <&edma 9>; ··· 705 705 <0x46400000 0x400000>; 706 706 reg-names = "mpu", "dat"; 707 707 interrupts = <82>, <83>; 708 - interrupts-names = "tx", "rx"; 708 + interrupt-names = "tx", "rx"; 709 709 status = "disabled"; 710 710 dmas = <&edma 10>, 711 711 <&edma 11>;
+1
arch/arm/boot/dts/armada-370-xp.dtsi
··· 230 230 #size-cells = <0>; 231 231 compatible = "marvell,orion-mdio"; 232 232 reg = <0x72004 0x4>; 233 + clocks = <&gateclk 4>; 233 234 }; 234 235 235 236 eth1: ethernet@74000 {
+1
arch/arm/boot/dts/armada-38x.dtsi
··· 336 336 #size-cells = <0>; 337 337 compatible = "marvell,orion-mdio"; 338 338 reg = <0x72004 0x4>; 339 + clocks = <&gateclk 4>; 339 340 }; 340 341 341 342 coredivclk: clock@e4250 {
+2 -2
arch/arm/boot/dts/dra7.dtsi
··· 80 80 }; 81 81 82 82 /* 83 - * The soc node represents the soc top level view. It is uses for IPs 83 + * The soc node represents the soc top level view. It is used for IPs 84 84 * that are not memory mapped in the MPU view or for the MPU itself. 85 85 */ 86 86 soc { ··· 94 94 /* 95 95 * XXX: Use a flat representation of the SOC interconnect. 96 96 * The real OMAP interconnect network is quite complex. 97 - * Since that will not bring real advantage to represent that in DT for 97 + * Since it will not bring real advantage to represent that in DT for 98 98 * the moment, just use a fake OCP bus entry to represent the whole bus 99 99 * hierarchy. 100 100 */
+1 -1
arch/arm/boot/dts/dra7xx-clocks.dtsi
··· 1640 1640 #clock-cells = <0>; 1641 1641 compatible = "ti,mux-clock"; 1642 1642 clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; 1643 - ti,bit-shift = <28>; 1643 + ti,bit-shift = <24>; 1644 1644 reg = <0x1860>; 1645 1645 }; 1646 1646
+1
arch/arm/boot/dts/imx25.dtsi
··· 56 56 57 57 osc { 58 58 compatible = "fsl,imx-osc", "fixed-clock"; 59 + #clock-cells = <0>; 59 60 clock-frequency = <24000000>; 60 61 }; 61 62 };
+1
arch/arm/boot/dts/imx27-apf27.dts
··· 29 29 30 30 osc26m { 31 31 compatible = "fsl,imx-osc26m", "fixed-clock"; 32 + #clock-cells = <0>; 32 33 clock-frequency = <0>; 33 34 }; 34 35 };
+1
arch/arm/boot/dts/imx27.dtsi
··· 48 48 49 49 osc26m { 50 50 compatible = "fsl,imx-osc26m", "fixed-clock"; 51 + #clock-cells = <0>; 51 52 clock-frequency = <26000000>; 52 53 }; 53 54 };
+4
arch/arm/boot/dts/imx50.dtsi
··· 53 53 54 54 ckil { 55 55 compatible = "fsl,imx-ckil", "fixed-clock"; 56 + #clock-cells = <0>; 56 57 clock-frequency = <32768>; 57 58 }; 58 59 59 60 ckih1 { 60 61 compatible = "fsl,imx-ckih1", "fixed-clock"; 62 + #clock-cells = <0>; 61 63 clock-frequency = <22579200>; 62 64 }; 63 65 64 66 ckih2 { 65 67 compatible = "fsl,imx-ckih2", "fixed-clock"; 68 + #clock-cells = <0>; 66 69 clock-frequency = <0>; 67 70 }; 68 71 69 72 osc { 70 73 compatible = "fsl,imx-osc", "fixed-clock"; 74 + #clock-cells = <0>; 71 75 clock-frequency = <24000000>; 72 76 }; 73 77 };
+4
arch/arm/boot/dts/imx51.dtsi
··· 50 50 51 51 ckil { 52 52 compatible = "fsl,imx-ckil", "fixed-clock"; 53 + #clock-cells = <0>; 53 54 clock-frequency = <32768>; 54 55 }; 55 56 56 57 ckih1 { 57 58 compatible = "fsl,imx-ckih1", "fixed-clock"; 59 + #clock-cells = <0>; 58 60 clock-frequency = <0>; 59 61 }; 60 62 61 63 ckih2 { 62 64 compatible = "fsl,imx-ckih2", "fixed-clock"; 65 + #clock-cells = <0>; 63 66 clock-frequency = <0>; 64 67 }; 65 68 66 69 osc { 67 70 compatible = "fsl,imx-osc", "fixed-clock"; 71 + #clock-cells = <0>; 68 72 clock-frequency = <24000000>; 69 73 }; 70 74 };
+12 -11
arch/arm/boot/dts/imx53-m53evk.dts
··· 17 17 compatible = "denx,imx53-m53evk", "fsl,imx53"; 18 18 19 19 memory { 20 - reg = <0x70000000 0x20000000>; 20 + reg = <0x70000000 0x20000000>, 21 + <0xb0000000 0x20000000>; 21 22 }; 22 23 23 24 soc { ··· 194 193 irq-trigger = <0x1>; 195 194 196 195 stmpe_touchscreen { 197 - compatible = "stmpe,ts"; 196 + compatible = "st,stmpe-ts"; 198 197 reg = <0>; 199 - ts,sample-time = <4>; 200 - ts,mod-12b = <1>; 201 - ts,ref-sel = <0>; 202 - ts,adc-freq = <1>; 203 - ts,ave-ctrl = <3>; 204 - ts,touch-det-delay = <3>; 205 - ts,settling = <4>; 206 - ts,fraction-z = <7>; 207 - ts,i-drive = <1>; 198 + st,sample-time = <4>; 199 + st,mod-12b = <1>; 200 + st,ref-sel = <0>; 201 + st,adc-freq = <1>; 202 + st,ave-ctrl = <3>; 203 + st,touch-det-delay = <3>; 204 + st,settling = <4>; 205 + st,fraction-z = <7>; 206 + st,i-drive = <1>; 208 207 }; 209 208 }; 210 209
+2 -1
arch/arm/boot/dts/imx53-qsb-common.dtsi
··· 14 14 15 15 / { 16 16 memory { 17 - reg = <0x70000000 0x40000000>; 17 + reg = <0x70000000 0x20000000>, 18 + <0xb0000000 0x20000000>; 18 19 }; 19 20 20 21 display0: display@di0 {
+10 -1
arch/arm/boot/dts/imx53-tx53-x03x.dts
··· 25 25 soc { 26 26 display: display@di0 { 27 27 compatible = "fsl,imx-parallel-display"; 28 - crtcs = <&ipu 0>; 29 28 interface-pix-fmt = "rgb24"; 30 29 pinctrl-names = "default"; 31 30 pinctrl-0 = <&pinctrl_rgb24_vga1>; 32 31 status = "okay"; 32 + 33 + port { 34 + display0_in: endpoint { 35 + remote-endpoint = <&ipu_di0_disp0>; 36 + }; 37 + }; 33 38 34 39 display-timings { 35 40 VGA { ··· 296 291 >; 297 292 }; 298 293 }; 294 + }; 295 + 296 + &ipu_di0_disp0 { 297 + remote-endpoint = <&display0_in>; 299 298 }; 300 299 301 300 &kpp {
+5 -1
arch/arm/boot/dts/imx53.dtsi
··· 70 70 71 71 ckil { 72 72 compatible = "fsl,imx-ckil", "fixed-clock"; 73 + #clock-cells = <0>; 73 74 clock-frequency = <32768>; 74 75 }; 75 76 76 77 ckih1 { 77 78 compatible = "fsl,imx-ckih1", "fixed-clock"; 79 + #clock-cells = <0>; 78 80 clock-frequency = <22579200>; 79 81 }; 80 82 81 83 ckih2 { 82 84 compatible = "fsl,imx-ckih2", "fixed-clock"; 85 + #clock-cells = <0>; 83 86 clock-frequency = <0>; 84 87 }; 85 88 86 89 osc { 87 90 compatible = "fsl,imx-osc", "fixed-clock"; 91 + #clock-cells = <0>; 88 92 clock-frequency = <24000000>; 89 93 }; 90 94 }; ··· 434 430 435 431 port { 436 432 lvds1_in: endpoint { 437 - remote-endpoint = <&ipu_di0_lvds0>; 433 + remote-endpoint = <&ipu_di1_lvds1>; 438 434 }; 439 435 }; 440 436 };
+35 -13
arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
··· 19 19 compatible = "dmo,imx6q-edmqmx6", "fsl,imx6q"; 20 20 21 21 aliases { 22 - gpio7 = &stmpe_gpio; 22 + gpio7 = &stmpe_gpio1; 23 + gpio8 = &stmpe_gpio2; 24 + stmpe-i2c0 = &stmpe1; 25 + stmpe-i2c1 = &stmpe2; 23 26 }; 24 27 25 28 memory { ··· 43 40 regulator-always-on; 44 41 }; 45 42 46 - reg_usb_otg_vbus: regulator@1 { 43 + reg_usb_otg_switch: regulator@1 { 47 44 compatible = "regulator-fixed"; 48 45 reg = <1>; 49 - regulator-name = "usb_otg_vbus"; 46 + regulator-name = "usb_otg_switch"; 50 47 regulator-min-microvolt = <5000000>; 51 48 regulator-max-microvolt = <5000000>; 52 49 gpio = <&gpio7 12 0>; 50 + regulator-boot-on; 51 + regulator-always-on; 53 52 }; 54 53 55 54 reg_usb_host1: regulator@2 { ··· 70 65 71 66 led-blue { 72 67 label = "blue"; 73 - gpios = <&stmpe_gpio 8 GPIO_ACTIVE_HIGH>; 68 + gpios = <&stmpe_gpio1 8 GPIO_ACTIVE_HIGH>; 74 69 linux,default-trigger = "heartbeat"; 75 70 }; 76 71 77 72 led-green { 78 73 label = "green"; 79 - gpios = <&stmpe_gpio 9 GPIO_ACTIVE_HIGH>; 74 + gpios = <&stmpe_gpio1 9 GPIO_ACTIVE_HIGH>; 80 75 }; 81 76 82 77 led-pink { 83 78 label = "pink"; 84 - gpios = <&stmpe_gpio 10 GPIO_ACTIVE_HIGH>; 79 + gpios = <&stmpe_gpio1 10 GPIO_ACTIVE_HIGH>; 85 80 }; 86 81 87 82 led-red { 88 83 label = "red"; 89 - gpios = <&stmpe_gpio 11 GPIO_ACTIVE_HIGH>; 84 + gpios = <&stmpe_gpio1 11 GPIO_ACTIVE_HIGH>; 90 85 }; 91 86 }; 92 87 }; ··· 104 99 clock-frequency = <100000>; 105 100 pinctrl-names = "default"; 106 101 pinctrl-0 = <&pinctrl_i2c2 107 - &pinctrl_stmpe>; 102 + &pinctrl_stmpe1 103 + &pinctrl_stmpe2>; 108 104 status = "okay"; 109 105 110 106 pmic: pfuze100@08 { ··· 211 205 }; 212 206 }; 213 207 214 - stmpe: stmpe1601@40 { 208 + stmpe1: stmpe1601@40 { 215 209 compatible = "st,stmpe1601"; 216 210 reg = <0x40>; 217 211 interrupts = <30 0>; 218 212 interrupt-parent = <&gpio3>; 219 213 220 - stmpe_gpio: stmpe_gpio { 214 + stmpe_gpio1: stmpe_gpio { 215 + #gpio-cells = <2>; 216 + compatible = "st,stmpe-gpio"; 217 + }; 218 + }; 219 + 220 + stmpe2: stmpe1601@44 { 221 + compatible = "st,stmpe1601"; 222 + reg = <0x44>; 223 + interrupts = <2 0>; 224 + interrupt-parent = <&gpio5>; 225 + 226 + stmpe_gpio2: stmpe_gpio { 221 227 #gpio-cells = <2>; 222 228 compatible = "st,stmpe-gpio"; 223 229 }; ··· 291 273 >; 292 274 }; 293 275 294 - pinctrl_stmpe: stmpegrp { 276 + pinctrl_stmpe1: stmpe1grp { 295 277 fsl,pins = <MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x80000000>; 278 + }; 279 + 280 + pinctrl_stmpe2: stmpe2grp { 281 + fsl,pins = <MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x80000000>; 296 282 }; 297 283 298 284 pinctrl_uart1: uart1grp { ··· 315 293 316 294 pinctrl_usbotg: usbotggrp { 317 295 fsl,pins = < 318 - MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059 296 + MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059 319 297 >; 320 298 }; 321 299 ··· 366 344 &usbh1 { 367 345 vbus-supply = <&reg_usb_host1>; 368 346 disable-over-current; 347 + dr_mode = "host"; 369 348 status = "okay"; 370 349 }; 371 350 372 351 &usbotg { 373 - vbus-supply = <&reg_usb_otg_vbus>; 374 352 pinctrl-names = "default"; 375 353 pinctrl-0 = <&pinctrl_usbotg>; 376 354 disable-over-current;
-3
arch/arm/boot/dts/imx6q-gw5400-a.dts
··· 487 487 488 488 &ldb { 489 489 status = "okay"; 490 - lvds-channel@0 { 491 - crtcs = <&ipu1 0>, <&ipu1 1>, <&ipu2 0>, <&ipu2 1>; 492 - }; 493 490 }; 494 491 495 492 &pcie {
-3
arch/arm/boot/dts/imx6qdl-gw52xx.dtsi
··· 436 436 437 437 &ldb { 438 438 status = "okay"; 439 - lvds-channel@0 { 440 - crtcs = <&ipu1 0>, <&ipu1 1>; 441 - }; 442 439 }; 443 440 444 441 &pcie {
+11 -11
arch/arm/boot/dts/imx6qdl-microsom-ar8035.dtsi
··· 26 26 /* GPIO16 -> AR8035 25MHz */ 27 27 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0xc0000000 28 28 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x80000000 29 - MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0 30 - MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0 31 - MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0 32 - MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0 33 - MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0 29 + MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b030 30 + MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b030 31 + MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b030 32 + MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b030 33 + MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b030 34 34 /* AR8035 CLK_25M --> ENET_REF_CLK (V22) */ 35 35 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x0a0b1 36 36 /* AR8035 pin strapping: IO voltage: pull up */ 37 - MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0 37 + MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b030 38 38 /* AR8035 pin strapping: PHYADDR#0: pull down */ 39 - MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x130b0 39 + MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x13030 40 40 /* AR8035 pin strapping: PHYADDR#1: pull down */ 41 - MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x130b0 41 + MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x13030 42 42 /* AR8035 pin strapping: MODE#1: pull up */ 43 - MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0 43 + MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b030 44 44 /* AR8035 pin strapping: MODE#3: pull up */ 45 - MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0 45 + MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b030 46 46 /* AR8035 pin strapping: MODE#0: pull down */ 47 - MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x130b0 47 + MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x13030 48 48 49 49 /* 50 50 * As the RMII pins are also connected to RGMII
+11 -2
arch/arm/boot/dts/imx6qdl.dtsi
··· 10 10 * http://www.gnu.org/copyleft/gpl.html 11 11 */ 12 12 13 + #include <dt-bindings/interrupt-controller/arm-gic.h> 14 + 13 15 #include "skeleton.dtsi" 14 16 15 17 / { ··· 48 46 intc: interrupt-controller@00a01000 { 49 47 compatible = "arm,cortex-a9-gic"; 50 48 #interrupt-cells = <3>; 51 - #address-cells = <1>; 52 - #size-cells = <1>; 53 49 interrupt-controller; 54 50 reg = <0x00a01000 0x1000>, 55 51 <0x00a00100 0x100>; ··· 59 59 60 60 ckil { 61 61 compatible = "fsl,imx-ckil", "fixed-clock"; 62 + #clock-cells = <0>; 62 63 clock-frequency = <32768>; 63 64 }; 64 65 65 66 ckih1 { 66 67 compatible = "fsl,imx-ckih1", "fixed-clock"; 68 + #clock-cells = <0>; 67 69 clock-frequency = <0>; 68 70 }; 69 71 70 72 osc { 71 73 compatible = "fsl,imx-osc", "fixed-clock"; 74 + #clock-cells = <0>; 72 75 clock-frequency = <24000000>; 73 76 }; 74 77 }; ··· 141 138 0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */ 142 139 num-lanes = <1>; 143 140 interrupts = <0 123 IRQ_TYPE_LEVEL_HIGH>; 141 + #interrupt-cells = <1>; 142 + interrupt-map-mask = <0 0 0 0x7>; 143 + interrupt-map = <0 0 0 1 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 144 + <0 0 0 2 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 145 + <0 0 0 3 &intc GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 146 + <0 0 0 4 &intc GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; 144 147 clocks = <&clks 189>, <&clks 187>, <&clks 206>, <&clks 144>; 145 148 clock-names = "pcie_ref_125m", "sata_ref_100m", "lvds_gate", "pcie_axi"; 146 149 status = "disabled";
+1
arch/arm/boot/dts/imx6sl-evk.dts
··· 282 282 MX6SL_PAD_ECSPI1_MISO__ECSPI1_MISO 0x100b1 283 283 MX6SL_PAD_ECSPI1_MOSI__ECSPI1_MOSI 0x100b1 284 284 MX6SL_PAD_ECSPI1_SCLK__ECSPI1_SCLK 0x100b1 285 + MX6SL_PAD_ECSPI1_SS0__GPIO4_IO11 0x80000000 285 286 >; 286 287 }; 287 288
+2 -2
arch/arm/boot/dts/imx6sl.dtsi
··· 68 68 intc: interrupt-controller@00a01000 { 69 69 compatible = "arm,cortex-a9-gic"; 70 70 #interrupt-cells = <3>; 71 - #address-cells = <1>; 72 - #size-cells = <1>; 73 71 interrupt-controller; 74 72 reg = <0x00a01000 0x1000>, 75 73 <0x00a00100 0x100>; ··· 79 81 80 82 ckil { 81 83 compatible = "fixed-clock"; 84 + #clock-cells = <0>; 82 85 clock-frequency = <32768>; 83 86 }; 84 87 85 88 osc { 86 89 compatible = "fixed-clock"; 90 + #clock-cells = <0>; 87 91 clock-frequency = <24000000>; 88 92 }; 89 93 };
+1 -1
arch/arm/boot/dts/kirkwood-b3.dts
··· 75 75 m25p16@0 { 76 76 #address-cells = <1>; 77 77 #size-cells = <1>; 78 - compatible = "m25p16"; 78 + compatible = "st,m25p16"; 79 79 reg = <0>; 80 80 spi-max-frequency = <40000000>; 81 81 mode = <0>;
+1 -1
arch/arm/boot/dts/kirkwood-cloudbox.dts
··· 46 46 flash@0 { 47 47 #address-cells = <1>; 48 48 #size-cells = <1>; 49 - compatible = "mx25l4005a"; 49 + compatible = "mxicy,mx25l4005a"; 50 50 reg = <0>; 51 51 spi-max-frequency = <20000000>; 52 52 mode = <0>;
+1 -1
arch/arm/boot/dts/kirkwood-dreamplug.dts
··· 43 43 m25p40@0 { 44 44 #address-cells = <1>; 45 45 #size-cells = <1>; 46 - compatible = "mx25l1606e"; 46 + compatible = "mxicy,mx25l1606e"; 47 47 reg = <0>; 48 48 spi-max-frequency = <50000000>; 49 49 mode = <0>;
+1 -1
arch/arm/boot/dts/kirkwood-laplug.dts
··· 48 48 status = "okay"; 49 49 50 50 eeprom@50 { 51 - compatible = "at,24c04"; 51 + compatible = "atmel,24c04"; 52 52 pagesize = <16>; 53 53 reg = <0x50>; 54 54 };
+1 -1
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
··· 56 56 flash@0 { 57 57 #address-cells = <1>; 58 58 #size-cells = <1>; 59 - compatible = "mx25l12805d"; 59 + compatible = "mxicy,mx25l12805d"; 60 60 reg = <0>; 61 61 spi-max-frequency = <50000000>; 62 62 mode = <0>;
+2 -2
arch/arm/boot/dts/kirkwood-ns2-common.dtsi
··· 32 32 flash@0 { 33 33 #address-cells = <1>; 34 34 #size-cells = <1>; 35 - compatible = "mx25l4005a"; 35 + compatible = "mxicy,mx25l4005a"; 36 36 reg = <0>; 37 37 spi-max-frequency = <20000000>; 38 38 mode = <0>; ··· 50 50 status = "okay"; 51 51 52 52 eeprom@50 { 53 - compatible = "at,24c04"; 53 + compatible = "atmel,24c04"; 54 54 pagesize = <16>; 55 55 reg = <0x50>; 56 56 };
+1 -1
arch/arm/boot/dts/kirkwood-nsa310.dts
··· 104 104 status = "okay"; 105 105 106 106 adt7476: adt7476a@2e { 107 - compatible = "adt7476"; 107 + compatible = "adi,adt7476"; 108 108 reg = <0x2e>; 109 109 }; 110 110 };
+1 -1
arch/arm/boot/dts/kirkwood-nsa310a.dts
··· 94 94 status = "okay"; 95 95 96 96 lm85: lm85@2e { 97 - compatible = "lm85"; 97 + compatible = "national,lm85"; 98 98 reg = <0x2e>; 99 99 }; 100 100 };
+1 -1
arch/arm/boot/dts/kirkwood-openblocks_a6.dts
··· 40 40 pinctrl-names = "default"; 41 41 42 42 s35390a: s35390a@30 { 43 - compatible = "s35390a"; 43 + compatible = "sii,s35390a"; 44 44 reg = <0x30>; 45 45 }; 46 46 };
+1 -1
arch/arm/boot/dts/kirkwood-openblocks_a7.dts
··· 52 52 pinctrl-names = "default"; 53 53 54 54 s24c02: s24c02@50 { 55 - compatible = "24c02"; 55 + compatible = "atmel,24c02"; 56 56 reg = <0x50>; 57 57 }; 58 58 };
+16
arch/arm/boot/dts/omap3-beagle-xm-ab.dts
··· 1 + /* 2 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #include "omap3-beagle-xm.dts" 10 + 11 + / { 12 + /* HS USB Port 2 Power enable was inverted with the xM C */ 13 + hsusb2_power: hsusb2_power_reg { 14 + enable-active-high; 15 + }; 16 + };
-1
arch/arm/boot/dts/omap3-devkit8000.dts
··· 112 112 reg = <0 0 0>; /* CS0, offset 0 */ 113 113 nand-bus-width = <16>; 114 114 115 - gpmc,device-nand; 116 115 gpmc,sync-clk-ps = <0>; 117 116 gpmc,cs-on-ns = <0>; 118 117 gpmc,cs-rd-off-ns = <44>;
-1
arch/arm/boot/dts/omap3-lilly-a83x.dtsi
··· 368 368 /* no elm on omap3 */ 369 369 370 370 gpmc,mux-add-data = <0>; 371 - gpmc,device-nand; 372 371 gpmc,device-width = <2>; 373 372 gpmc,wait-pin = <0>; 374 373 gpmc,wait-monitoring-ns = <0>;
+1 -1
arch/arm/boot/dts/omap3.dtsi
··· 74 74 /* 75 75 * XXX: Use a flat representation of the OMAP3 interconnect. 76 76 * The real OMAP interconnect network is quite complex. 77 - * Since that will not bring real advantage to represent that in DT for 77 + * Since it will not bring real advantage to represent that in DT for 78 78 * the moment, just use a fake OCP bus entry to represent the whole bus 79 79 * hierarchy. 80 80 */
+2 -2
arch/arm/boot/dts/omap4.dtsi
··· 72 72 }; 73 73 74 74 /* 75 - * The soc node represents the soc top level view. It is uses for IPs 75 + * The soc node represents the soc top level view. It is used for IPs 76 76 * that are not memory mapped in the MPU view or for the MPU itself. 77 77 */ 78 78 soc { ··· 96 96 /* 97 97 * XXX: Use a flat representation of the OMAP4 interconnect. 98 98 * The real OMAP interconnect network is quite complex. 99 - * Since that will not bring real advantage to represent that in DT for 99 + * Since it will not bring real advantage to represent that in DT for 100 100 * the moment, just use a fake OCP bus entry to represent the whole bus 101 101 * hierarchy. 102 102 */
+8 -2
arch/arm/boot/dts/omap5.dtsi
··· 93 93 }; 94 94 95 95 /* 96 - * The soc node represents the soc top level view. It is uses for IPs 96 + * The soc node represents the soc top level view. It is used for IPs 97 97 * that are not memory mapped in the MPU view or for the MPU itself. 98 98 */ 99 99 soc { ··· 107 107 /* 108 108 * XXX: Use a flat representation of the OMAP3 interconnect. 109 109 * The real OMAP interconnect network is quite complex. 110 - * Since that will not bring real advantage to represent that in DT for 110 + * Since it will not bring real advantage to represent that in DT for 111 111 * the moment, just use a fake OCP bus entry to represent the whole bus 112 112 * hierarchy. 113 113 */ ··· 813 813 <0x4a084c00 0x40>; 814 814 reg-names = "phy_rx", "phy_tx", "pll_ctrl"; 815 815 ctrl-module = <&omap_control_usb3phy>; 816 + clocks = <&usb_phy_cm_clk32k>, 817 + <&sys_clkin>, 818 + <&usb_otg_ss_refclk960m>; 819 + clock-names = "wkupclk", 820 + "sysclk", 821 + "refclk"; 816 822 #phy-cells = <0>; 817 823 }; 818 824 };
-1
arch/arm/boot/dts/r8a7740.dtsi
··· 28 28 gic: interrupt-controller@c2800000 { 29 29 compatible = "arm,cortex-a9-gic"; 30 30 #interrupt-cells = <3>; 31 - #address-cells = <1>; 32 31 interrupt-controller; 33 32 reg = <0xc2800000 0x1000>, 34 33 <0xc2000000 0x1000>;
+2 -2
arch/arm/boot/dts/r8a7790-lager.dts
··· 141 141 }; 142 142 143 143 sdhi0_pins: sd0 { 144 - renesas,gpios = "sdhi0_data4", "sdhi0_ctrl"; 144 + renesas,groups = "sdhi0_data4", "sdhi0_ctrl"; 145 145 renesas,function = "sdhi0"; 146 146 }; 147 147 148 148 sdhi2_pins: sd2 { 149 - renesas,gpios = "sdhi2_data4", "sdhi2_ctrl"; 149 + renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; 150 150 renesas,function = "sdhi2"; 151 151 }; 152 152
+3 -3
arch/arm/boot/dts/r8a7791-koelsch.dts
··· 230 230 }; 231 231 232 232 sdhi0_pins: sd0 { 233 - renesas,gpios = "sdhi0_data4", "sdhi0_ctrl"; 233 + renesas,groups = "sdhi0_data4", "sdhi0_ctrl"; 234 234 renesas,function = "sdhi0"; 235 235 }; 236 236 237 237 sdhi1_pins: sd1 { 238 - renesas,gpios = "sdhi1_data4", "sdhi1_ctrl"; 238 + renesas,groups = "sdhi1_data4", "sdhi1_ctrl"; 239 239 renesas,function = "sdhi1"; 240 240 }; 241 241 242 242 sdhi2_pins: sd2 { 243 - renesas,gpios = "sdhi2_data4", "sdhi2_ctrl"; 243 + renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; 244 244 renesas,function = "sdhi2"; 245 245 }; 246 246
+4 -4
arch/arm/boot/dts/rk3188.dtsi
··· 149 149 150 150 uart0 { 151 151 uart0_xfer: uart0-xfer { 152 - rockchip,pins = <RK_GPIO1 0 RK_FUNC_1 &pcfg_pull_none>, 152 + rockchip,pins = <RK_GPIO1 0 RK_FUNC_1 &pcfg_pull_up>, 153 153 <RK_GPIO1 1 RK_FUNC_1 &pcfg_pull_none>; 154 154 }; 155 155 ··· 164 164 165 165 uart1 { 166 166 uart1_xfer: uart1-xfer { 167 - rockchip,pins = <RK_GPIO1 4 RK_FUNC_1 &pcfg_pull_none>, 167 + rockchip,pins = <RK_GPIO1 4 RK_FUNC_1 &pcfg_pull_up>, 168 168 <RK_GPIO1 5 RK_FUNC_1 &pcfg_pull_none>; 169 169 }; 170 170 ··· 179 179 180 180 uart2 { 181 181 uart2_xfer: uart2-xfer { 182 - rockchip,pins = <RK_GPIO1 8 RK_FUNC_1 &pcfg_pull_none>, 182 + rockchip,pins = <RK_GPIO1 8 RK_FUNC_1 &pcfg_pull_up>, 183 183 <RK_GPIO1 9 RK_FUNC_1 &pcfg_pull_none>; 184 184 }; 185 185 /* no rts / cts for uart2 */ ··· 187 187 188 188 uart3 { 189 189 uart3_xfer: uart3-xfer { 190 - rockchip,pins = <RK_GPIO1 10 RK_FUNC_1 &pcfg_pull_none>, 190 + rockchip,pins = <RK_GPIO1 10 RK_FUNC_1 &pcfg_pull_up>, 191 191 <RK_GPIO1 11 RK_FUNC_1 &pcfg_pull_none>; 192 192 }; 193 193
-1
arch/arm/boot/dts/sh73a0.dtsi
··· 34 34 gic: interrupt-controller@f0001000 { 35 35 compatible = "arm,cortex-a9-gic"; 36 36 #interrupt-cells = <3>; 37 - #address-cells = <1>; 38 37 interrupt-controller; 39 38 reg = <0xf0001000 0x1000>, 40 39 <0xf0000100 0x100>;
+5 -5
arch/arm/boot/dts/stih415-pinctrl.dtsi
··· 49 49 reg = <0xfe61f080 0x4>; 50 50 reg-names = "irqmux"; 51 51 interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>; 52 - interrupts-names = "irqmux"; 52 + interrupt-names = "irqmux"; 53 53 ranges = <0 0xfe610000 0x5000>; 54 54 55 55 PIO0: gpio@fe610000 { ··· 187 187 reg = <0xfee0f080 0x4>; 188 188 reg-names = "irqmux"; 189 189 interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>; 190 - interrupts-names = "irqmux"; 190 + interrupt-names = "irqmux"; 191 191 ranges = <0 0xfee00000 0x8000>; 192 192 193 193 PIO5: gpio@fee00000 { ··· 282 282 reg = <0xfe82f080 0x4>; 283 283 reg-names = "irqmux"; 284 284 interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>; 285 - interrupts-names = "irqmux"; 285 + interrupt-names = "irqmux"; 286 286 ranges = <0 0xfe820000 0x8000>; 287 287 288 288 PIO13: gpio@fe820000 { ··· 423 423 reg = <0xfd6bf080 0x4>; 424 424 reg-names = "irqmux"; 425 425 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; 426 - interrupts-names = "irqmux"; 426 + interrupt-names = "irqmux"; 427 427 ranges = <0 0xfd6b0000 0x3000>; 428 428 429 429 PIO100: gpio@fd6b0000 { ··· 460 460 reg = <0xfd33f080 0x4>; 461 461 reg-names = "irqmux"; 462 462 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; 463 - interrupts-names = "irqmux"; 463 + interrupt-names = "irqmux"; 464 464 ranges = <0 0xfd330000 0x5000>; 465 465 466 466 PIO103: gpio@fd330000 {
+5 -5
arch/arm/boot/dts/stih416-pinctrl.dtsi
··· 53 53 reg = <0xfe61f080 0x4>; 54 54 reg-names = "irqmux"; 55 55 interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>; 56 - interrupts-names = "irqmux"; 56 + interrupt-names = "irqmux"; 57 57 ranges = <0 0xfe610000 0x6000>; 58 58 59 59 PIO0: gpio@fe610000 { ··· 201 201 reg = <0xfee0f080 0x4>; 202 202 reg-names = "irqmux"; 203 203 interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>; 204 - interrupts-names = "irqmux"; 204 + interrupt-names = "irqmux"; 205 205 ranges = <0 0xfee00000 0x10000>; 206 206 207 207 PIO5: gpio@fee00000 { ··· 333 333 reg = <0xfe82f080 0x4>; 334 334 reg-names = "irqmux"; 335 335 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; 336 - interrupts-names = "irqmux"; 336 + interrupt-names = "irqmux"; 337 337 ranges = <0 0xfe820000 0x6000>; 338 338 339 339 PIO13: gpio@fe820000 { ··· 461 461 reg = <0xfd6bf080 0x4>; 462 462 reg-names = "irqmux"; 463 463 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; 464 - interrupts-names = "irqmux"; 464 + interrupt-names = "irqmux"; 465 465 ranges = <0 0xfd6b0000 0x3000>; 466 466 467 467 PIO100: gpio@fd6b0000 { ··· 498 498 reg = <0xfd33f080 0x4>; 499 499 reg-names = "irqmux"; 500 500 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; 501 - interrupts-names = "irqmux"; 501 + interrupt-names = "irqmux"; 502 502 ranges = <0 0xfd330000 0x5000>; 503 503 504 504 PIO103: gpio@fd330000 {
-13
arch/arm/boot/dts/tegra124.dtsi
··· 233 233 status = "disabled"; 234 234 }; 235 235 236 - serial@0,70006400 { 237 - compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; 238 - reg = <0x0 0x70006400 0x0 0x40>; 239 - reg-shift = <2>; 240 - interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; 241 - clocks = <&tegra_car TEGRA124_CLK_UARTE>; 242 - resets = <&tegra_car 66>; 243 - reset-names = "serial"; 244 - dmas = <&apbdma 20>, <&apbdma 20>; 245 - dma-names = "rx", "tx"; 246 - status = "disabled"; 247 - }; 248 - 249 236 pwm@0,7000a000 { 250 237 compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm"; 251 238 reg = <0x0 0x7000a000 0x0 0x100>;
+2
arch/arm/boot/dts/vf610-twr.dts
··· 25 25 clocks { 26 26 audio_ext { 27 27 compatible = "fixed-clock"; 28 + #clock-cells = <0>; 28 29 clock-frequency = <24576000>; 29 30 }; 30 31 31 32 enet_ext { 32 33 compatible = "fixed-clock"; 34 + #clock-cells = <0>; 33 35 clock-frequency = <50000000>; 34 36 }; 35 37 };
+2 -2
arch/arm/boot/dts/vf610.dtsi
··· 45 45 46 46 sxosc { 47 47 compatible = "fixed-clock"; 48 + #clock-cells = <0>; 48 49 clock-frequency = <32768>; 49 50 }; 50 51 51 52 fxosc { 52 53 compatible = "fixed-clock"; 54 + #clock-cells = <0>; 53 55 clock-frequency = <24000000>; 54 56 }; 55 57 }; ··· 74 72 intc: interrupt-controller@40002000 { 75 73 compatible = "arm,cortex-a9-gic"; 76 74 #interrupt-cells = <3>; 77 - #address-cells = <1>; 78 - #size-cells = <1>; 79 75 interrupt-controller; 80 76 reg = <0x40003000 0x1000>, 81 77 <0x40002100 0x100>;
+23
arch/arm/boot/dts/zynq-7000.dtsi
··· 24 24 device_type = "cpu"; 25 25 reg = <0>; 26 26 clocks = <&clkc 3>; 27 + clock-latency = <1000>; 27 28 operating-points = < 28 29 /* kHz uV */ 29 30 666667 1000000 ··· 54 53 #size-cells = <1>; 55 54 interrupt-parent = <&intc>; 56 55 ranges; 56 + 57 + i2c0: zynq-i2c@e0004000 { 58 + compatible = "cdns,i2c-r1p10"; 59 + status = "disabled"; 60 + clocks = <&clkc 38>; 61 + interrupt-parent = <&intc>; 62 + interrupts = <0 25 4>; 63 + reg = <0xe0004000 0x1000>; 64 + #address-cells = <1>; 65 + #size-cells = <0>; 66 + }; 67 + 68 + i2c1: zynq-i2c@e0005000 { 69 + compatible = "cdns,i2c-r1p10"; 70 + status = "disabled"; 71 + clocks = <&clkc 39>; 72 + interrupt-parent = <&intc>; 73 + interrupts = <0 48 4>; 74 + reg = <0xe0005000 0x1000>; 75 + #address-cells = <1>; 76 + #size-cells = <0>; 77 + }; 57 78 58 79 intc: interrupt-controller@f8f01000 { 59 80 compatible = "arm,cortex-a9-gic";
+76
arch/arm/boot/dts/zynq-zc702.dts
··· 34 34 phy-mode = "rgmii"; 35 35 }; 36 36 37 + &i2c0 { 38 + status = "okay"; 39 + clock-frequency = <400000>; 40 + 41 + i2cswitch@74 { 42 + compatible = "nxp,pca9548"; 43 + #address-cells = <1>; 44 + #size-cells = <0>; 45 + reg = <0x74>; 46 + 47 + i2c@0 { 48 + #address-cells = <1>; 49 + #size-cells = <0>; 50 + reg = <0>; 51 + si570: clock-generator@5d { 52 + #clock-cells = <0>; 53 + compatible = "silabs,si570"; 54 + temperature-stability = <50>; 55 + reg = <0x5d>; 56 + factory-fout = <156250000>; 57 + clock-frequency = <148500000>; 58 + }; 59 + }; 60 + 61 + i2c@2 { 62 + #address-cells = <1>; 63 + #size-cells = <0>; 64 + reg = <2>; 65 + eeprom@54 { 66 + compatible = "at,24c08"; 67 + reg = <0x54>; 68 + }; 69 + }; 70 + 71 + i2c@3 { 72 + #address-cells = <1>; 73 + #size-cells = <0>; 74 + reg = <3>; 75 + gpio@21 { 76 + compatible = "ti,tca6416"; 77 + reg = <0x21>; 78 + gpio-controller; 79 + #gpio-cells = <2>; 80 + }; 81 + }; 82 + 83 + i2c@4 { 84 + #address-cells = <1>; 85 + #size-cells = <0>; 86 + reg = <4>; 87 + rtc@51 { 88 + compatible = "nxp,pcf8563"; 89 + reg = <0x51>; 90 + }; 91 + }; 92 + 93 + i2c@7 { 94 + #address-cells = <1>; 95 + #size-cells = <0>; 96 + reg = <7>; 97 + hwmon@52 { 98 + compatible = "ti,ucd9248"; 99 + reg = <52>; 100 + }; 101 + hwmon@53 { 102 + compatible = "ti,ucd9248"; 103 + reg = <53>; 104 + }; 105 + hwmon@54 { 106 + compatible = "ti,ucd9248"; 107 + reg = <54>; 108 + }; 109 + }; 110 + }; 111 + }; 112 + 37 113 &sdhci0 { 38 114 status = "okay"; 39 115 };
+68
arch/arm/boot/dts/zynq-zc706.dts
··· 35 35 phy-mode = "rgmii"; 36 36 }; 37 37 38 + &i2c0 { 39 + status = "okay"; 40 + clock-frequency = <400000>; 41 + 42 + i2cswitch@74 { 43 + compatible = "nxp,pca9548"; 44 + #address-cells = <1>; 45 + #size-cells = <0>; 46 + reg = <0x74>; 47 + 48 + i2c@0 { 49 + #address-cells = <1>; 50 + #size-cells = <0>; 51 + reg = <0>; 52 + si570: clock-generator@5d { 53 + #clock-cells = <0>; 54 + compatible = "silabs,si570"; 55 + temperature-stability = <50>; 56 + reg = <0x5d>; 57 + factory-fout = <156250000>; 58 + clock-frequency = <148500000>; 59 + }; 60 + }; 61 + 62 + i2c@2 { 63 + #address-cells = <1>; 64 + #size-cells = <0>; 65 + reg = <2>; 66 + eeprom@54 { 67 + compatible = "at,24c08"; 68 + reg = <0x54>; 69 + }; 70 + }; 71 + 72 + i2c@3 { 73 + #address-cells = <1>; 74 + #size-cells = <0>; 75 + reg = <3>; 76 + gpio@21 { 77 + compatible = "ti,tca6416"; 78 + reg = <0x21>; 79 + gpio-controller; 80 + #gpio-cells = <2>; 81 + }; 82 + }; 83 + 84 + i2c@4 { 85 + #address-cells = <1>; 86 + #size-cells = <0>; 87 + reg = <4>; 88 + rtc@51 { 89 + compatible = "nxp,pcf8563"; 90 + reg = <0x51>; 91 + }; 92 + }; 93 + 94 + i2c@7 { 95 + #address-cells = <1>; 96 + #size-cells = <0>; 97 + reg = <7>; 98 + ucd90120@65 { 99 + compatible = "ti,ucd90120"; 100 + reg = <0x65>; 101 + }; 102 + }; 103 + }; 104 + }; 105 + 38 106 &sdhci0 { 39 107 status = "okay"; 40 108 };
+2 -4
arch/arm/common/bL_switcher.c
··· 797 797 { 798 798 int ret; 799 799 800 - if (MAX_NR_CLUSTERS != 2) { 801 - pr_err("%s: only dual cluster systems are supported\n", __func__); 802 - return -EINVAL; 803 - } 800 + if (!mcpm_is_available()) 801 + return -ENODEV; 804 802 805 803 cpu_notifier(bL_switcher_hotplug_callback, 0); 806 804
+5
arch/arm/common/mcpm_entry.c
··· 48 48 return 0; 49 49 } 50 50 51 + bool mcpm_is_available(void) 52 + { 53 + return (platform_ops) ? true : false; 54 + } 55 + 51 56 int mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster) 52 57 { 53 58 if (!platform_ops)
+1 -1
arch/arm/configs/omap2plus_defconfig
··· 226 226 CONFIG_USB_TEST=y 227 227 CONFIG_NOP_USB_XCEIV=y 228 228 CONFIG_OMAP_USB2=y 229 - CONFIG_OMAP_USB3=y 229 + CONFIG_TI_PIPE3=y 230 230 CONFIG_AM335X_PHY_USB=y 231 231 CONFIG_USB_GADGET=y 232 232 CONFIG_USB_GADGET_DEBUG=y
+2 -2
arch/arm/configs/u300_defconfig
··· 11 11 CONFIG_MODULE_UNLOAD=y 12 12 # CONFIG_LBDAF is not set 13 13 # CONFIG_BLK_DEV_BSG is not set 14 + CONFIG_PARTITION_ADVANCED=y 14 15 # CONFIG_IOSCHED_CFQ is not set 15 16 # CONFIG_ARCH_MULTI_V7 is not set 16 17 CONFIG_ARCH_U300=y ··· 22 21 CONFIG_ZBOOT_ROM_BSS=0x0 23 22 CONFIG_CMDLINE="root=/dev/ram0 rw rootfstype=rootfs console=ttyAMA0,115200n8 lpj=515072" 24 23 CONFIG_CPU_IDLE=y 25 - CONFIG_FPE_NWFPE=y 26 24 # CONFIG_SUSPEND is not set 27 25 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 28 26 # CONFIG_PREVENT_FIRMWARE_BUILD is not set ··· 64 64 CONFIG_NLS_CODEPAGE_437=y 65 65 CONFIG_NLS_ISO8859_1=y 66 66 CONFIG_PRINTK_TIME=y 67 + CONFIG_DEBUG_INFO=y 67 68 CONFIG_DEBUG_FS=y 68 69 # CONFIG_SCHED_DEBUG is not set 69 70 CONFIG_TIMER_STATS=y 70 71 # CONFIG_DEBUG_PREEMPT is not set 71 - CONFIG_DEBUG_INFO=y
+15 -9
arch/arm/configs/u8500_defconfig
··· 1 1 # CONFIG_SWAP is not set 2 2 CONFIG_SYSVIPC=y 3 - CONFIG_NO_HZ=y 3 + CONFIG_NO_HZ_IDLE=y 4 4 CONFIG_HIGH_RES_TIMERS=y 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 CONFIG_KALLSYMS_ALL=y 7 7 CONFIG_MODULES=y 8 8 CONFIG_MODULE_UNLOAD=y 9 9 # CONFIG_BLK_DEV_BSG is not set 10 + CONFIG_PARTITION_ADVANCED=y 10 11 CONFIG_ARCH_U8500=y 11 12 CONFIG_MACH_HREFV60=y 12 13 CONFIG_MACH_SNOWBALL=y 13 - CONFIG_MACH_UX500_DT=y 14 14 CONFIG_SMP=y 15 15 CONFIG_NR_CPUS=2 16 16 CONFIG_PREEMPT=y ··· 34 34 CONFIG_IP_PNP_DHCP=y 35 35 CONFIG_NETFILTER=y 36 36 CONFIG_PHONET=y 37 - # CONFIG_WIRELESS is not set 37 + CONFIG_CFG80211=y 38 + CONFIG_CFG80211_DEBUGFS=y 39 + CONFIG_MAC80211=y 40 + CONFIG_MAC80211_LEDS=y 38 41 CONFIG_CAIF=y 39 42 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 43 + CONFIG_DEVTMPFS=y 44 + CONFIG_DEVTMPFS_MOUNT=y 40 45 CONFIG_BLK_DEV_RAM=y 41 46 CONFIG_BLK_DEV_RAM_SIZE=65536 42 47 CONFIG_SENSORS_BH1780=y 43 48 CONFIG_NETDEVICES=y 44 49 CONFIG_SMSC911X=y 45 50 CONFIG_SMSC_PHY=y 46 - # CONFIG_WLAN is not set 51 + CONFIG_CW1200=y 52 + CONFIG_CW1200_WLAN_SDIO=y 47 53 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set 48 54 CONFIG_INPUT_EVDEV=y 49 55 # CONFIG_KEYBOARD_ATKBD is not set ··· 91 85 CONFIG_USB_GADGET=y 92 86 CONFIG_USB_ETH=m 93 87 CONFIG_MMC=y 94 - CONFIG_MMC_UNSAFE_RESUME=y 95 - # CONFIG_MMC_BLOCK_BOUNCE is not set 96 88 CONFIG_MMC_ARMMMCI=y 97 89 CONFIG_NEW_LEDS=y 98 90 CONFIG_LEDS_CLASS=y 99 91 CONFIG_LEDS_LM3530=y 100 92 CONFIG_LEDS_GPIO=y 101 93 CONFIG_LEDS_LP5521=y 102 - CONFIG_LEDS_TRIGGERS=y 103 94 CONFIG_LEDS_TRIGGER_HEARTBEAT=y 104 95 CONFIG_RTC_CLASS=y 105 96 CONFIG_RTC_DRV_AB8500=y ··· 106 103 CONFIG_STAGING=y 107 104 CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y 108 105 CONFIG_HSEM_U8500=y 106 + CONFIG_IIO=y 107 + CONFIG_IIO_ST_ACCEL_3AXIS=y 108 + CONFIG_IIO_ST_GYRO_3AXIS=y 109 + CONFIG_IIO_ST_MAGN_3AXIS=y 110 + CONFIG_IIO_ST_PRESS=y 109 111 CONFIG_EXT2_FS=y 110 112 CONFIG_EXT2_FS_XATTR=y 111 113 CONFIG_EXT2_FS_POSIX_ACL=y ··· 118 110 CONFIG_EXT3_FS=y 119 111 CONFIG_EXT4_FS=y 120 112 CONFIG_VFAT_FS=y 121 - CONFIG_DEVTMPFS=y 122 - CONFIG_DEVTMPFS_MOUNT=y 123 113 CONFIG_TMPFS=y 124 114 CONFIG_TMPFS_POSIX_ACL=y 125 115 # CONFIG_MISC_FILESYSTEMS is not set
+7 -7
arch/arm/include/asm/cputype.h
··· 222 222 #endif 223 223 224 224 /* 225 - * Marvell's PJ4 core is based on V7 version. It has some modification 226 - * for coprocessor setting. For this reason, we need a way to distinguish 227 - * it. 225 + * Marvell's PJ4 and PJ4B cores are based on V7 version, 226 + * but require a specical sequence for enabling coprocessors. 227 + * For this reason, we need a way to distinguish them. 228 228 */ 229 - #ifndef CONFIG_CPU_PJ4 230 - #define cpu_is_pj4() 0 231 - #else 229 + #if defined(CONFIG_CPU_PJ4) || defined(CONFIG_CPU_PJ4B) 232 230 static inline int cpu_is_pj4(void) 233 231 { 234 232 unsigned int id; 235 233 236 234 id = read_cpuid_id(); 237 - if ((id & 0xfffffff0) == 0x562f5840) 235 + if ((id & 0xff0fff00) == 0x560f5800) 238 236 return 1; 239 237 240 238 return 0; 241 239 } 240 + #else 241 + #define cpu_is_pj4() 0 242 242 #endif 243 243 #endif
+1 -1
arch/arm/include/asm/div64.h
··· 156 156 /* Select the best insn combination to perform the */ \ 157 157 /* actual __m * __n / (__p << 64) operation. */ \ 158 158 if (!__c) { \ 159 - asm ( "umull %Q0, %R0, %1, %Q2\n\t" \ 159 + asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" \ 160 160 "mov %Q0, #0" \ 161 161 : "=&r" (__res) \ 162 162 : "r" (__m), "r" (__n) \
+7
arch/arm/include/asm/mcpm.h
··· 54 54 */ 55 55 56 56 /** 57 + * mcpm_is_available - returns whether MCPM is initialized and available 58 + * 59 + * This returns true or false accordingly. 60 + */ 61 + bool mcpm_is_available(void); 62 + 63 + /** 57 64 * mcpm_cpu_power_up - make given CPU in given cluster runable 58 65 * 59 66 * @cpu: CPU number within given cluster
+11 -1
arch/arm/include/asm/tlb.h
··· 98 98 } 99 99 } 100 100 101 - static inline void tlb_flush_mmu(struct mmu_gather *tlb) 101 + static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) 102 102 { 103 103 tlb_flush(tlb); 104 + } 105 + 106 + static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) 107 + { 104 108 free_pages_and_swap_cache(tlb->pages, tlb->nr); 105 109 tlb->nr = 0; 106 110 if (tlb->pages == tlb->local) 107 111 __tlb_alloc_page(tlb); 112 + } 113 + 114 + static inline void tlb_flush_mmu(struct mmu_gather *tlb) 115 + { 116 + tlb_flush_mmu_tlbonly(tlb); 117 + tlb_flush_mmu_free(tlb); 108 118 } 109 119 110 120 static inline void
+1
arch/arm/include/uapi/asm/unistd.h
··· 408 408 #define __NR_finit_module (__NR_SYSCALL_BASE+379) 409 409 #define __NR_sched_setattr (__NR_SYSCALL_BASE+380) 410 410 #define __NR_sched_getattr (__NR_SYSCALL_BASE+381) 411 + #define __NR_renameat2 (__NR_SYSCALL_BASE+382) 411 412 412 413 /* 413 414 * This may need to be greater than __NR_last_syscall+1 in order to
+1
arch/arm/kernel/Makefile
··· 79 79 obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o 80 80 obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o 81 81 obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o 82 + obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o 82 83 obj-$(CONFIG_IWMMXT) += iwmmxt.o 83 84 obj-$(CONFIG_PERF_EVENTS) += perf_regs.o 84 85 obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o
+1
arch/arm/kernel/calls.S
··· 391 391 CALL(sys_finit_module) 392 392 /* 380 */ CALL(sys_sched_setattr) 393 393 CALL(sys_sched_getattr) 394 + CALL(sys_renameat2) 394 395 #ifndef syscalls_counted 395 396 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 396 397 #define syscalls_counted
+1 -1
arch/arm/kernel/head.S
··· 587 587 add r6, r6, r3 @ adjust __pv_phys_pfn_offset address 588 588 add r7, r7, r3 @ adjust __pv_offset address 589 589 mov r0, r8, lsr #12 @ convert to PFN 590 - str r0, [r6, #LOW_OFFSET] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset 590 + str r0, [r6] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset 591 591 strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits 592 592 mov r6, r3, lsr #24 @ constant for add/sub instructions 593 593 teq r3, r6, lsl #24 @ must be 16MiB aligned
+6 -2
arch/arm/kernel/iwmmxt.S
··· 19 19 #include <asm/thread_info.h> 20 20 #include <asm/asm-offsets.h> 21 21 22 - #if defined(CONFIG_CPU_PJ4) 22 + #if defined(CONFIG_CPU_PJ4) || defined(CONFIG_CPU_PJ4B) 23 23 #define PJ4(code...) code 24 24 #define XSC(code...) 25 - #else 25 + #elif defined(CONFIG_CPU_MOHAWK) || \ 26 + defined(CONFIG_CPU_XSC3) || \ 27 + defined(CONFIG_CPU_XSCALE) 26 28 #define PJ4(code...) 27 29 #define XSC(code...) code 30 + #else 31 + #error "Unsupported iWMMXt architecture" 28 32 #endif 29 33 30 34 #define MMX_WR0 (0x00)
+7
arch/arm/kernel/machine_kexec.c
··· 184 184 185 185 soft_restart(reboot_entry_phys); 186 186 } 187 + 188 + void arch_crash_save_vmcoreinfo(void) 189 + { 190 + #ifdef CONFIG_ARM_LPAE 191 + VMCOREINFO_CONFIG(ARM_LPAE); 192 + #endif 193 + }
+39 -3
arch/arm/kernel/pj4-cp0.c
··· 45 45 return NOTIFY_DONE; 46 46 } 47 47 48 - static struct notifier_block iwmmxt_notifier_block = { 48 + static struct notifier_block __maybe_unused iwmmxt_notifier_block = { 49 49 .notifier_call = iwmmxt_do, 50 50 }; 51 51 ··· 72 72 : "=r" (temp) : "r" (value)); 73 73 } 74 74 75 + static int __init pj4_get_iwmmxt_version(void) 76 + { 77 + u32 cp_access, wcid; 78 + 79 + cp_access = pj4_cp_access_read(); 80 + pj4_cp_access_write(cp_access | 0xf); 81 + 82 + /* check if coprocessor 0 and 1 are available */ 83 + if ((pj4_cp_access_read() & 0xf) != 0xf) { 84 + pj4_cp_access_write(cp_access); 85 + return -ENODEV; 86 + } 87 + 88 + /* read iWMMXt coprocessor id register p1, c0 */ 89 + __asm__ __volatile__ ("mrc p1, 0, %0, c0, c0, 0\n" : "=r" (wcid)); 90 + 91 + pj4_cp_access_write(cp_access); 92 + 93 + /* iWMMXt v1 */ 94 + if ((wcid & 0xffffff00) == 0x56051000) 95 + return 1; 96 + /* iWMMXt v2 */ 97 + if ((wcid & 0xffffff00) == 0x56052000) 98 + return 2; 99 + 100 + return -EINVAL; 101 + } 75 102 76 103 /* 77 104 * Disable CP0/CP1 on boot, and let call_fpe() and the iWMMXt lazy ··· 106 79 */ 107 80 static int __init pj4_cp0_init(void) 108 81 { 109 - u32 cp_access; 82 + u32 __maybe_unused cp_access; 83 + int vers; 110 84 111 85 if (!cpu_is_pj4()) 112 86 return 0; 113 87 88 + vers = pj4_get_iwmmxt_version(); 89 + if (vers < 0) 90 + return 0; 91 + 92 + #ifndef CONFIG_IWMMXT 93 + pr_info("PJ4 iWMMXt coprocessor detected, but kernel support is missing.\n"); 94 + #else 114 95 cp_access = pj4_cp_access_read() & ~0xf; 115 96 pj4_cp_access_write(cp_access); 116 97 117 - printk(KERN_INFO "PJ4 iWMMXt coprocessor enabled.\n"); 98 + pr_info("PJ4 iWMMXt v%d coprocessor enabled.\n", vers); 118 99 elf_hwcap |= HWCAP_IWMMXT; 119 100 thread_register_notifier(&iwmmxt_notifier_block); 101 + #endif 120 102 121 103 return 0; 122 104 }
+3 -3
arch/arm/kernel/sys_oabi-compat.c
··· 203 203 int ret; 204 204 205 205 switch (cmd) { 206 - case F_GETLKP: 207 - case F_SETLKP: 208 - case F_SETLKPW: 206 + case F_OFD_GETLK: 207 + case F_OFD_SETLK: 208 + case F_OFD_SETLKW: 209 209 case F_GETLK64: 210 210 case F_SETLK64: 211 211 case F_SETLKW64:
+1 -1
arch/arm/kvm/Kconfig
··· 23 23 select HAVE_KVM_CPU_RELAX_INTERCEPT 24 24 select KVM_MMIO 25 25 select KVM_ARM_HOST 26 - depends on ARM_VIRT_EXT && ARM_LPAE 26 + depends on ARM_VIRT_EXT && ARM_LPAE && !CPU_BIG_ENDIAN 27 27 ---help--- 28 28 Support hosting virtualized guest machines. You will also 29 29 need to select one or more of the processor modules below.
+9 -6
arch/arm/kvm/mmu.c
··· 42 42 static unsigned long hyp_idmap_end; 43 43 static phys_addr_t hyp_idmap_vector; 44 44 45 + #define pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t)) 46 + 45 47 #define kvm_pmd_huge(_x) (pmd_huge(_x) || pmd_trans_huge(_x)) 46 48 47 49 static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) ··· 295 293 if (boot_hyp_pgd) { 296 294 unmap_range(NULL, boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE); 297 295 unmap_range(NULL, boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); 298 - kfree(boot_hyp_pgd); 296 + free_pages((unsigned long)boot_hyp_pgd, pgd_order); 299 297 boot_hyp_pgd = NULL; 300 298 } 301 299 302 300 if (hyp_pgd) 303 301 unmap_range(NULL, hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); 304 302 305 - kfree(init_bounce_page); 303 + free_page((unsigned long)init_bounce_page); 306 304 init_bounce_page = NULL; 307 305 308 306 mutex_unlock(&kvm_hyp_pgd_mutex); ··· 332 330 for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE) 333 331 unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); 334 332 335 - kfree(hyp_pgd); 333 + free_pages((unsigned long)hyp_pgd, pgd_order); 336 334 hyp_pgd = NULL; 337 335 } 338 336 ··· 1026 1024 size_t len = __hyp_idmap_text_end - __hyp_idmap_text_start; 1027 1025 phys_addr_t phys_base; 1028 1026 1029 - init_bounce_page = kmalloc(PAGE_SIZE, GFP_KERNEL); 1027 + init_bounce_page = (void *)__get_free_page(GFP_KERNEL); 1030 1028 if (!init_bounce_page) { 1031 1029 kvm_err("Couldn't allocate HYP init bounce page\n"); 1032 1030 err = -ENOMEM; ··· 1052 1050 (unsigned long)phys_base); 1053 1051 } 1054 1052 1055 - hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL); 1056 - boot_hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL); 1053 + hyp_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, pgd_order); 1054 + boot_hyp_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, pgd_order); 1055 + 1057 1056 if (!hyp_pgd || !boot_hyp_pgd) { 1058 1057 kvm_err("Hyp mode PGD not allocated\n"); 1059 1058 err = -ENOMEM;
+1 -1
arch/arm/mach-at91/at91sam9260_devices.c
··· 1296 1296 }; 1297 1297 1298 1298 static struct platform_device at91_adc_device = { 1299 - .name = "at91_adc", 1299 + .name = "at91sam9260-adc", 1300 1300 .id = -1, 1301 1301 .dev = { 1302 1302 .platform_data = &adc_data,
+1 -1
arch/arm/mach-at91/at91sam9g45_devices.c
··· 1204 1204 }; 1205 1205 1206 1206 static struct platform_device at91_adc_device = { 1207 - .name = "at91_adc", 1207 + .name = "at91sam9g45-adc", 1208 1208 .id = -1, 1209 1209 .dev = { 1210 1210 .platform_data = &adc_data,
+19 -10
arch/arm/mach-imx/clk-imx6q.c
··· 208 208 * the "output_enable" bit as a gate, even though it's really just 209 209 * enabling clock output. 210 210 */ 211 - clk[lvds1_gate] = imx_clk_gate("lvds1_gate", "dummy", base + 0x160, 10); 212 - clk[lvds2_gate] = imx_clk_gate("lvds2_gate", "dummy", base + 0x160, 11); 211 + clk[lvds1_gate] = imx_clk_gate("lvds1_gate", "lvds1_sel", base + 0x160, 10); 212 + clk[lvds2_gate] = imx_clk_gate("lvds2_gate", "lvds2_sel", base + 0x160, 11); 213 213 214 214 /* name parent_name reg idx */ 215 215 clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus", base + 0x100, 0); ··· 258 258 clk[ipu2_sel] = imx_clk_mux("ipu2_sel", base + 0x3c, 14, 2, ipu_sels, ARRAY_SIZE(ipu_sels)); 259 259 clk[ldb_di0_sel] = imx_clk_mux_flags("ldb_di0_sel", base + 0x2c, 9, 3, ldb_di_sels, ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT); 260 260 clk[ldb_di1_sel] = imx_clk_mux_flags("ldb_di1_sel", base + 0x2c, 12, 3, ldb_di_sels, ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT); 261 - clk[ipu1_di0_pre_sel] = imx_clk_mux("ipu1_di0_pre_sel", base + 0x34, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); 262 - clk[ipu1_di1_pre_sel] = imx_clk_mux("ipu1_di1_pre_sel", base + 0x34, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); 263 - clk[ipu2_di0_pre_sel] = imx_clk_mux("ipu2_di0_pre_sel", base + 0x38, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); 264 - clk[ipu2_di1_pre_sel] = imx_clk_mux("ipu2_di1_pre_sel", base + 0x38, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); 265 - clk[ipu1_di0_sel] = imx_clk_mux("ipu1_di0_sel", base + 0x34, 0, 3, ipu1_di0_sels, ARRAY_SIZE(ipu1_di0_sels)); 266 - clk[ipu1_di1_sel] = imx_clk_mux("ipu1_di1_sel", base + 0x34, 9, 3, ipu1_di1_sels, ARRAY_SIZE(ipu1_di1_sels)); 267 - clk[ipu2_di0_sel] = imx_clk_mux("ipu2_di0_sel", base + 0x38, 0, 3, ipu2_di0_sels, ARRAY_SIZE(ipu2_di0_sels)); 268 - clk[ipu2_di1_sel] = imx_clk_mux("ipu2_di1_sel", base + 0x38, 9, 3, ipu2_di1_sels, ARRAY_SIZE(ipu2_di1_sels)); 261 + clk[ipu1_di0_pre_sel] = imx_clk_mux_flags("ipu1_di0_pre_sel", base + 0x34, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); 262 + clk[ipu1_di1_pre_sel] = imx_clk_mux_flags("ipu1_di1_pre_sel", base + 0x34, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); 263 + clk[ipu2_di0_pre_sel] = imx_clk_mux_flags("ipu2_di0_pre_sel", base + 0x38, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); 264 + clk[ipu2_di1_pre_sel] = imx_clk_mux_flags("ipu2_di1_pre_sel", base + 0x38, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); 265 + clk[ipu1_di0_sel] = imx_clk_mux_flags("ipu1_di0_sel", base + 0x34, 0, 3, ipu1_di0_sels, ARRAY_SIZE(ipu1_di0_sels), CLK_SET_RATE_PARENT); 266 + clk[ipu1_di1_sel] = imx_clk_mux_flags("ipu1_di1_sel", base + 0x34, 9, 3, ipu1_di1_sels, ARRAY_SIZE(ipu1_di1_sels), CLK_SET_RATE_PARENT); 267 + clk[ipu2_di0_sel] = imx_clk_mux_flags("ipu2_di0_sel", base + 0x38, 0, 3, ipu2_di0_sels, ARRAY_SIZE(ipu2_di0_sels), CLK_SET_RATE_PARENT); 268 + clk[ipu2_di1_sel] = imx_clk_mux_flags("ipu2_di1_sel", base + 0x38, 9, 3, ipu2_di1_sels, ARRAY_SIZE(ipu2_di1_sels), CLK_SET_RATE_PARENT); 269 269 clk[hsi_tx_sel] = imx_clk_mux("hsi_tx_sel", base + 0x30, 28, 1, hsi_tx_sels, ARRAY_SIZE(hsi_tx_sels)); 270 270 clk[pcie_axi_sel] = imx_clk_mux("pcie_axi_sel", base + 0x18, 10, 1, pcie_axi_sels, ARRAY_SIZE(pcie_axi_sels)); 271 271 clk[ssi1_sel] = imx_clk_fixup_mux("ssi1_sel", base + 0x1c, 10, 2, ssi_sels, ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup); ··· 444 444 clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]); 445 445 clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]); 446 446 } 447 + 448 + clk_set_parent(clk[ipu1_di0_pre_sel], clk[pll5_video_div]); 449 + clk_set_parent(clk[ipu1_di1_pre_sel], clk[pll5_video_div]); 450 + clk_set_parent(clk[ipu2_di0_pre_sel], clk[pll5_video_div]); 451 + clk_set_parent(clk[ipu2_di1_pre_sel], clk[pll5_video_div]); 452 + clk_set_parent(clk[ipu1_di0_sel], clk[ipu1_di0_pre]); 453 + clk_set_parent(clk[ipu1_di1_sel], clk[ipu1_di1_pre]); 454 + clk_set_parent(clk[ipu2_di0_sel], clk[ipu2_di0_pre]); 455 + clk_set_parent(clk[ipu2_di1_sel], clk[ipu2_di1_pre]); 447 456 448 457 /* 449 458 * The gpmi needs 100MHz frequency in the EDO/Sync mode,
+1 -1
arch/arm/mach-omap2/board-rx51-video.c
··· 48 48 49 49 static int __init rx51_video_init(void) 50 50 { 51 - if (!machine_is_nokia_rx51() && !of_machine_is_compatible("nokia,omap3-n900")) 51 + if (!machine_is_nokia_rx51()) 52 52 return 0; 53 53 54 54 if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) {
+2 -2
arch/arm/mach-omap2/clkt_dpll.c
··· 209 209 if (v == OMAP3XXX_EN_DPLL_LPBYPASS || 210 210 v == OMAP3XXX_EN_DPLL_FRBYPASS) 211 211 return 1; 212 - } else if (soc_is_am33xx() || cpu_is_omap44xx()) { 212 + } else if (soc_is_am33xx() || cpu_is_omap44xx() || soc_is_am43xx()) { 213 213 if (v == OMAP4XXX_EN_DPLL_LPBYPASS || 214 214 v == OMAP4XXX_EN_DPLL_FRBYPASS || 215 215 v == OMAP4XXX_EN_DPLL_MNBYPASS) ··· 255 255 if (v == OMAP3XXX_EN_DPLL_LPBYPASS || 256 256 v == OMAP3XXX_EN_DPLL_FRBYPASS) 257 257 return __clk_get_rate(dd->clk_bypass); 258 - } else if (soc_is_am33xx() || cpu_is_omap44xx()) { 258 + } else if (soc_is_am33xx() || cpu_is_omap44xx() || soc_is_am43xx()) { 259 259 if (v == OMAP4XXX_EN_DPLL_LPBYPASS || 260 260 v == OMAP4XXX_EN_DPLL_FRBYPASS || 261 261 v == OMAP4XXX_EN_DPLL_MNBYPASS)
+13 -2
arch/arm/mach-omap2/gpmc.c
··· 501 501 int r; 502 502 503 503 spin_lock(&gpmc_mem_lock); 504 - r = release_resource(&gpmc_cs_mem[cs]); 504 + r = release_resource(res); 505 505 res->start = 0; 506 506 res->end = 0; 507 507 spin_unlock(&gpmc_mem_lock); ··· 527 527 pr_err("%s: requested chip-select is disabled\n", __func__); 528 528 return -ENODEV; 529 529 } 530 + 531 + /* 532 + * Make sure we ignore any device offsets from the GPMC partition 533 + * allocated for the chip select and that the new base confirms 534 + * to the GPMC 16MB minimum granularity. 535 + */ 536 + base &= ~(SZ_16M - 1); 537 + 530 538 gpmc_cs_get_memconf(cs, &old_base, &size); 531 539 if (base == old_base) 532 540 return 0; ··· 594 586 595 587 void gpmc_cs_free(int cs) 596 588 { 589 + struct resource *res = &gpmc_cs_mem[cs]; 590 + 597 591 spin_lock(&gpmc_mem_lock); 598 592 if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) { 599 593 printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); ··· 604 594 return; 605 595 } 606 596 gpmc_cs_disable_mem(cs); 607 - release_resource(&gpmc_cs_mem[cs]); 597 + if (res->flags) 598 + release_resource(res); 608 599 gpmc_cs_set_reserved(cs, 0); 609 600 spin_unlock(&gpmc_mem_lock); 610 601 }
+2 -1
arch/arm/mach-omap2/omap_hwmod.c
··· 2546 2546 return -EINVAL; 2547 2547 } 2548 2548 2549 - if (np) 2549 + if (np) { 2550 2550 if (of_find_property(np, "ti,no-reset-on-init", NULL)) 2551 2551 oh->flags |= HWMOD_INIT_NO_RESET; 2552 2552 if (of_find_property(np, "ti,no-idle-on-init", NULL)) 2553 2553 oh->flags |= HWMOD_INIT_NO_IDLE; 2554 + } 2554 2555 2555 2556 oh->_state = _HWMOD_STATE_INITIALIZED; 2556 2557
+2 -2
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
··· 1964 1964 static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = { 1965 1965 .name = "usb_host_hs", 1966 1966 .class = &omap3xxx_usb_host_hs_hwmod_class, 1967 - .clkdm_name = "l3_init_clkdm", 1967 + .clkdm_name = "usbhost_clkdm", 1968 1968 .mpu_irqs = omap3xxx_usb_host_hs_irqs, 1969 1969 .main_clk = "usbhost_48m_fck", 1970 1970 .prcm = { ··· 2047 2047 static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = { 2048 2048 .name = "usb_tll_hs", 2049 2049 .class = &omap3xxx_usb_tll_hs_hwmod_class, 2050 - .clkdm_name = "l3_init_clkdm", 2050 + .clkdm_name = "core_l4_clkdm", 2051 2051 .mpu_irqs = omap3xxx_usb_tll_hs_irqs, 2052 2052 .main_clk = "usbtll_fck", 2053 2053 .prcm = {
-4
arch/arm/mach-omap2/pm34xx.c
··· 330 330 omap3_sram_restore_context(); 331 331 omap2_sms_restore_context(); 332 332 } 333 - if (core_next_state == PWRDM_POWER_OFF) 334 - omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, 335 - OMAP3430_GR_MOD, 336 - OMAP3_PRM_VOLTCTRL_OFFSET); 337 333 } 338 334 omap3_intc_resume_idle(); 339 335
+1
arch/arm/mach-pxa/include/mach/hx4700.h
··· 14 14 15 15 #include <linux/gpio.h> 16 16 #include <linux/mfd/asic3.h> 17 + #include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ 17 18 18 19 #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO 19 20 #define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
+1 -1
arch/arm/mach-rockchip/platsmp.c
··· 152 152 153 153 node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-pmu"); 154 154 if (!node) { 155 - pr_err("%s: could not find sram dt node\n", __func__); 155 + pr_err("%s: could not find pmu dt node\n", __func__); 156 156 return; 157 157 } 158 158
+1
arch/arm/mach-shmobile/board-armadillo800eva.c
··· 992 992 .platform = "sh_fsi2", 993 993 .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM, 994 994 .cpu_dai = { 995 + .fmt = SND_SOC_DAIFMT_IB_NF, 995 996 .name = "fsia-dai", 996 997 }, 997 998 .codec_dai = {
+1 -3
arch/arm/mach-shmobile/board-lager.c
··· 588 588 .card = "SSI01-AK4643", 589 589 .codec = "ak4642-codec.2-0012", 590 590 .platform = "rcar_sound", 591 - .daifmt = SND_SOC_DAIFMT_LEFT_J, 591 + .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM, 592 592 .cpu_dai = { 593 593 .name = "rcar_sound", 594 - .fmt = SND_SOC_DAIFMT_CBS_CFS, 595 594 }, 596 595 .codec_dai = { 597 596 .name = "ak4642-hifi", 598 - .fmt = SND_SOC_DAIFMT_CBM_CFM, 599 597 .sysclk = 11289600, 600 598 }, 601 599 };
+1 -1
arch/arm/mach-shmobile/clock-r8a7778.c
··· 170 170 [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */ 171 171 [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 9, 0), /* SSI3 */ 172 172 [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 8, 0), /* SRU */ 173 - [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */ 173 + [MSTP007] = SH_CLK_MSTP32(&s_clk, MSTPCR0, 7, 0), /* HSPI */ 174 174 }; 175 175 176 176 static struct clk_lookup lookups[] = {
+1 -1
arch/arm/mach-spear/time.c
··· 71 71 static int clockevent_next_event(unsigned long evt, 72 72 struct clock_event_device *clk_event_dev); 73 73 74 - static void spear_clocksource_init(void) 74 + static void __init spear_clocksource_init(void) 75 75 { 76 76 u32 tick_rate; 77 77 u16 val;
-3
arch/arm/mach-tegra/Kconfig
··· 70 70 which controls AHB bus master arbitration and some 71 71 performance parameters(priority, prefech size). 72 72 73 - config TEGRA_EMC_SCALING_ENABLE 74 - bool "Enable scaling the memory frequency" 75 - 76 73 endmenu
+5 -2
arch/arm/mach-vexpress/dcscb.c
··· 51 51 static int dcscb_power_up(unsigned int cpu, unsigned int cluster) 52 52 { 53 53 unsigned int rst_hold, cpumask = (1 << cpu); 54 - unsigned int all_mask = dcscb_allcpus_mask[cluster]; 54 + unsigned int all_mask; 55 55 56 56 pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); 57 57 if (cpu >= 4 || cluster >= 2) 58 58 return -EINVAL; 59 + 60 + all_mask = dcscb_allcpus_mask[cluster]; 59 61 60 62 /* 61 63 * Since this is called with IRQs enabled, and no arch_spin_lock_irq ··· 103 101 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 104 102 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 105 103 cpumask = (1 << cpu); 106 - all_mask = dcscb_allcpus_mask[cluster]; 107 104 108 105 pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); 109 106 BUG_ON(cpu >= 4 || cluster >= 2); 107 + 108 + all_mask = dcscb_allcpus_mask[cluster]; 110 109 111 110 __mcpm_cpu_going_down(cpu, cluster); 112 111
+2 -2
arch/arm/mach-vexpress/spc.c
··· 392 392 * +--------------------------+ 393 393 * | 31 20 | 19 0 | 394 394 * +--------------------------+ 395 - * | u_volt | freq(kHz) | 395 + * | m_volt | freq(kHz) | 396 396 * +--------------------------+ 397 397 */ 398 398 #define MULT_FACTOR 20 ··· 414 414 ret = ve_spc_read_sys_cfg(SYSCFG_SCC, off, &data); 415 415 if (!ret) { 416 416 opps->freq = (data & FREQ_MASK) * MULT_FACTOR; 417 - opps->u_volt = data >> VOLT_SHIFT; 417 + opps->u_volt = (data >> VOLT_SHIFT) * 1000; 418 418 } else { 419 419 break; 420 420 }
+4 -4
arch/arm/mm/Kconfig
··· 420 420 bool 421 421 select CPU_USE_DOMAINS if MMU 422 422 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 423 - select TLS_REG_EMUL if SMP || !MMU 424 423 select NEED_KUSER_HELPERS 424 + select TLS_REG_EMUL if SMP || !MMU 425 425 426 426 config CPU_32v4 427 427 bool 428 428 select CPU_USE_DOMAINS if MMU 429 429 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 430 - select TLS_REG_EMUL if SMP || !MMU 431 430 select NEED_KUSER_HELPERS 431 + select TLS_REG_EMUL if SMP || !MMU 432 432 433 433 config CPU_32v4T 434 434 bool 435 435 select CPU_USE_DOMAINS if MMU 436 436 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 437 - select TLS_REG_EMUL if SMP || !MMU 438 437 select NEED_KUSER_HELPERS 438 + select TLS_REG_EMUL if SMP || !MMU 439 439 440 440 config CPU_32v5 441 441 bool 442 442 select CPU_USE_DOMAINS if MMU 443 443 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 444 - select TLS_REG_EMUL if SMP || !MMU 445 444 select NEED_KUSER_HELPERS 445 + select TLS_REG_EMUL if SMP || !MMU 446 446 447 447 config CPU_32v6 448 448 bool
+1 -1
arch/arm/mm/dma-mapping.c
··· 1963 1963 mapping->nr_bitmaps = 1; 1964 1964 mapping->extensions = extensions; 1965 1965 mapping->base = base; 1966 - mapping->size = bitmap_size << PAGE_SHIFT; 1967 1966 mapping->bits = BITS_PER_BYTE * bitmap_size; 1967 + mapping->size = mapping->bits << PAGE_SHIFT; 1968 1968 1969 1969 spin_lock_init(&mapping->lock); 1970 1970
+2
arch/arm/vfp/vfpdouble.c
··· 866 866 vdp.sign = vfp_sign_negate(vdp.sign); 867 867 868 868 vfp_double_unpack(&vdn, vfp_get_double(dd)); 869 + if (vdn.exponent == 0 && vdn.significand) 870 + vfp_double_normalise_denormal(&vdn); 869 871 if (negate & NEG_SUBTRACT) 870 872 vdn.sign = vfp_sign_negate(vdn.sign); 871 873
+2
arch/arm/vfp/vfpsingle.c
··· 915 915 v = vfp_get_float(sd); 916 916 pr_debug("VFP: s%u = %08x\n", sd, v); 917 917 vfp_single_unpack(&vsn, v); 918 + if (vsn.exponent == 0 && vsn.significand) 919 + vfp_single_normalise_denormal(&vsn); 918 920 if (negate & NEG_SUBTRACT) 919 921 vsn.sign = vfp_sign_negate(vsn.sign); 920 922
-2
arch/arm64/Kconfig
··· 323 323 324 324 source "drivers/cpuidle/Kconfig" 325 325 326 - source "kernel/power/Kconfig" 327 - 328 326 source "drivers/cpufreq/Kconfig" 329 327 330 328 endmenu
+3
arch/arm64/include/asm/mmu.h
··· 22 22 void *vdso; 23 23 } mm_context_t; 24 24 25 + #define INIT_MM_CONTEXT(name) \ 26 + .context.id_lock = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock), 27 + 25 28 #define ASID(mm) ((mm)->context.id & 0xffff) 26 29 27 30 extern void paging_init(void);
+6
arch/arm64/include/asm/tlb.h
··· 19 19 #ifndef __ASM_TLB_H 20 20 #define __ASM_TLB_H 21 21 22 + #define __tlb_remove_pmd_tlb_entry __tlb_remove_pmd_tlb_entry 22 23 23 24 #include <asm-generic/tlb.h> 24 25 ··· 100 99 } 101 100 #endif 102 101 102 + static inline void __tlb_remove_pmd_tlb_entry(struct mmu_gather *tlb, pmd_t *pmdp, 103 + unsigned long address) 104 + { 105 + tlb_add_flush(tlb, address); 106 + } 103 107 104 108 #endif
+2 -1
arch/arm64/include/asm/unistd32.h
··· 403 403 __SYSCALL(379, sys_finit_module) 404 404 __SYSCALL(380, sys_sched_setattr) 405 405 __SYSCALL(381, sys_sched_getattr) 406 + __SYSCALL(382, sys_renameat2) 406 407 407 - #define __NR_compat_syscalls 379 408 + #define __NR_compat_syscalls 383 408 409 409 410 /* 410 411 * Compat syscall numbers used by the AArch64 kernel.
-3
arch/arm64/kernel/debug-monitors.c
··· 318 318 if (call_break_hook(regs, esr) == DBG_HOOK_HANDLED) 319 319 return 0; 320 320 321 - pr_warn("unexpected brk exception at %lx, esr=0x%x\n", 322 - (long)instruction_pointer(regs), esr); 323 - 324 321 if (!user_mode(regs)) 325 322 return -EFAULT; 326 323
-1
arch/arm64/kernel/setup.c
··· 393 393 394 394 static int __init arm64_device_init(void) 395 395 { 396 - of_clk_init(NULL); 397 396 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 398 397 return 0; 399 398 }
+2
arch/arm64/kernel/time.c
··· 33 33 #include <linux/irq.h> 34 34 #include <linux/delay.h> 35 35 #include <linux/clocksource.h> 36 + #include <linux/clk-provider.h> 36 37 37 38 #include <clocksource/arm_arch_timer.h> 38 39 ··· 66 65 { 67 66 u32 arch_timer_rate; 68 67 68 + of_clk_init(NULL); 69 69 clocksource_of_init(); 70 70 71 71 arch_timer_rate = arch_timer_get_rate();
-37
arch/hexagon/include/asm/barrier.h
··· 1 - /* 2 - * Memory barrier definitions for the Hexagon architecture 3 - * 4 - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 and 8 - * only version 2 as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, write to the Free Software 17 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 - * 02110-1301, USA. 19 - */ 20 - 21 - #ifndef _ASM_BARRIER_H 22 - #define _ASM_BARRIER_H 23 - 24 - #define rmb() barrier() 25 - #define read_barrier_depends() barrier() 26 - #define wmb() barrier() 27 - #define mb() barrier() 28 - #define smp_rmb() barrier() 29 - #define smp_read_barrier_depends() barrier() 30 - #define smp_wmb() barrier() 31 - #define smp_mb() barrier() 32 - 33 - /* Set a value and use a memory barrier. Used by the scheduler somewhere. */ 34 - #define set_mb(var, value) \ 35 - do { var = value; mb(); } while (0) 36 - 37 - #endif /* _ASM_BARRIER_H */
+32 -10
arch/ia64/include/asm/tlb.h
··· 91 91 #define RR_RID_MASK 0x00000000ffffff00L 92 92 #define RR_TO_RID(val) ((val >> 8) & 0xffffff) 93 93 94 - /* 95 - * Flush the TLB for address range START to END and, if not in fast mode, release the 96 - * freed pages that where gathered up to this point. 97 - */ 98 94 static inline void 99 - ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) 95 + ia64_tlb_flush_mmu_tlbonly(struct mmu_gather *tlb, unsigned long start, unsigned long end) 100 96 { 101 - unsigned long i; 102 - unsigned int nr; 103 - 104 - if (!tlb->need_flush) 105 - return; 106 97 tlb->need_flush = 0; 107 98 108 99 if (tlb->fullmm) { ··· 126 135 flush_tlb_range(&vma, ia64_thash(start), ia64_thash(end)); 127 136 } 128 137 138 + } 139 + 140 + static inline void 141 + ia64_tlb_flush_mmu_free(struct mmu_gather *tlb) 142 + { 143 + unsigned long i; 144 + unsigned int nr; 145 + 129 146 /* lastly, release the freed pages */ 130 147 nr = tlb->nr; 131 148 ··· 141 142 tlb->start_addr = ~0UL; 142 143 for (i = 0; i < nr; ++i) 143 144 free_page_and_swap_cache(tlb->pages[i]); 145 + } 146 + 147 + /* 148 + * Flush the TLB for address range START to END and, if not in fast mode, release the 149 + * freed pages that where gathered up to this point. 150 + */ 151 + static inline void 152 + ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) 153 + { 154 + if (!tlb->need_flush) 155 + return; 156 + ia64_tlb_flush_mmu_tlbonly(tlb, start, end); 157 + ia64_tlb_flush_mmu_free(tlb); 144 158 } 145 159 146 160 static inline void __tlb_alloc_page(struct mmu_gather *tlb) ··· 216 204 VM_BUG_ON(tlb->nr > tlb->max); 217 205 218 206 return tlb->max - tlb->nr; 207 + } 208 + 209 + static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) 210 + { 211 + ia64_tlb_flush_mmu_tlbonly(tlb, tlb->start_addr, tlb->end_addr); 212 + } 213 + 214 + static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) 215 + { 216 + ia64_tlb_flush_mmu_free(tlb); 219 217 } 220 218 221 219 static inline void tlb_flush_mmu(struct mmu_gather *tlb)
+1 -1
arch/mips/cavium-octeon/octeon-irq.c
··· 635 635 cpumask_clear(&new_affinity); 636 636 cpumask_set_cpu(cpumask_first(cpu_online_mask), &new_affinity); 637 637 } 638 - __irq_set_affinity_locked(data, &new_affinity); 638 + irq_set_affinity_locked(data, &new_affinity, false); 639 639 } 640 640 641 641 static int octeon_irq_ciu_set_affinity(struct irq_data *data,
+2 -1
arch/parisc/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 + generic-y += resource.h 5 + 4 6 header-y += bitsperlong.h 5 7 header-y += byteorder.h 6 8 header-y += errno.h ··· 15 13 header-y += pdc.h 16 14 header-y += posix_types.h 17 15 header-y += ptrace.h 18 - header-y += resource.h 19 16 header-y += sembuf.h 20 17 header-y += setup.h 21 18 header-y += shmbuf.h
-7
arch/parisc/include/uapi/asm/resource.h
··· 1 - #ifndef _ASM_PARISC_RESOURCE_H 2 - #define _ASM_PARISC_RESOURCE_H 3 - 4 - #define _STK_LIM_MAX 10 * _STK_LIM 5 - #include <asm-generic/resource.h> 6 - 7 - #endif
+4 -4
arch/powerpc/boot/main.c
··· 139 139 * edit the command line passed to vmlinux (by setting /chosen/bootargs). 140 140 * The buffer is put in it's own section so that tools may locate it easier. 141 141 */ 142 - static char cmdline[COMMAND_LINE_SIZE] 142 + static char cmdline[BOOT_COMMAND_LINE_SIZE] 143 143 __attribute__((__section__("__builtin_cmdline"))); 144 144 145 145 static void prep_cmdline(void *chosen) 146 146 { 147 147 if (cmdline[0] == '\0') 148 - getprop(chosen, "bootargs", cmdline, COMMAND_LINE_SIZE-1); 148 + getprop(chosen, "bootargs", cmdline, BOOT_COMMAND_LINE_SIZE-1); 149 149 150 150 printf("\n\rLinux/PowerPC load: %s", cmdline); 151 151 /* If possible, edit the command line */ 152 152 if (console_ops.edit_cmdline) 153 - console_ops.edit_cmdline(cmdline, COMMAND_LINE_SIZE); 153 + console_ops.edit_cmdline(cmdline, BOOT_COMMAND_LINE_SIZE); 154 154 printf("\n\r"); 155 155 156 156 /* Put the command line back into the devtree for the kernel */ ··· 174 174 * built-in command line wasn't set by an external tool */ 175 175 if ((loader_info.cmdline_len > 0) && (cmdline[0] == '\0')) 176 176 memmove(cmdline, loader_info.cmdline, 177 - min(loader_info.cmdline_len, COMMAND_LINE_SIZE-1)); 177 + min(loader_info.cmdline_len, BOOT_COMMAND_LINE_SIZE-1)); 178 178 179 179 if (console_ops.open && (console_ops.open() < 0)) 180 180 exit();
+1 -1
arch/powerpc/boot/ops.h
··· 15 15 #include "types.h" 16 16 #include "string.h" 17 17 18 - #define COMMAND_LINE_SIZE 512 18 + #define BOOT_COMMAND_LINE_SIZE 2048 19 19 #define MAX_PATH_LEN 256 20 20 #define MAX_PROP_LEN 256 /* What should this be? */ 21 21
+2 -2
arch/powerpc/boot/ps3.c
··· 47 47 * The buffer is put in it's own section so that tools may locate it easier. 48 48 */ 49 49 50 - static char cmdline[COMMAND_LINE_SIZE] 50 + static char cmdline[BOOT_COMMAND_LINE_SIZE] 51 51 __attribute__((__section__("__builtin_cmdline"))); 52 52 53 53 static void prep_cmdline(void *chosen) 54 54 { 55 55 if (cmdline[0] == '\0') 56 - getprop(chosen, "bootargs", cmdline, COMMAND_LINE_SIZE-1); 56 + getprop(chosen, "bootargs", cmdline, BOOT_COMMAND_LINE_SIZE-1); 57 57 else 58 58 setprop_str(chosen, "bootargs", cmdline); 59 59
+19 -23
arch/powerpc/include/asm/opal.h
··· 41 41 * size except the last one in the list to be as well. 42 42 */ 43 43 struct opal_sg_entry { 44 - void *data; 45 - long length; 44 + __be64 data; 45 + __be64 length; 46 46 }; 47 47 48 - /* sg list */ 48 + /* SG list */ 49 49 struct opal_sg_list { 50 - unsigned long num_entries; 51 - struct opal_sg_list *next; 50 + __be64 length; 51 + __be64 next; 52 52 struct opal_sg_entry entry[]; 53 53 }; 54 54 ··· 858 858 int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, 859 859 uint32_t addr, __be32 *data, uint32_t sz); 860 860 861 - int64_t opal_read_elog(uint64_t buffer, size_t size, uint64_t log_id); 862 - int64_t opal_get_elog_size(uint64_t *log_id, size_t *size, uint64_t *elog_type); 861 + int64_t opal_read_elog(uint64_t buffer, uint64_t size, uint64_t log_id); 862 + int64_t opal_get_elog_size(__be64 *log_id, __be64 *size, __be64 *elog_type); 863 863 int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset); 864 864 int64_t opal_send_ack_elog(uint64_t log_id); 865 865 void opal_resend_pending_logs(void); ··· 868 868 int64_t opal_manage_flash(uint8_t op); 869 869 int64_t opal_update_flash(uint64_t blk_list); 870 870 int64_t opal_dump_init(uint8_t dump_type); 871 - int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size); 872 - int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type); 871 + int64_t opal_dump_info(__be32 *dump_id, __be32 *dump_size); 872 + int64_t opal_dump_info2(__be32 *dump_id, __be32 *dump_size, __be32 *dump_type); 873 873 int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer); 874 874 int64_t opal_dump_ack(uint32_t dump_id); 875 875 int64_t opal_dump_resend_notification(void); 876 876 877 - int64_t opal_get_msg(uint64_t buffer, size_t size); 878 - int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token); 877 + int64_t opal_get_msg(uint64_t buffer, uint64_t size); 878 + int64_t opal_check_completion(uint64_t buffer, uint64_t size, uint64_t token); 879 879 int64_t opal_sync_host_reboot(void); 880 880 int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer, 881 - size_t length); 881 + uint64_t length); 882 882 int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer, 883 - size_t length); 883 + uint64_t length); 884 884 int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data); 885 885 886 886 /* Internal functions */ 887 - extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data); 887 + extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 888 + int depth, void *data); 888 889 extern int early_init_dt_scan_recoverable_ranges(unsigned long node, 889 890 const char *uname, int depth, void *data); 890 891 ··· 893 892 extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); 894 893 895 894 extern void hvc_opal_init_early(void); 896 - 897 - /* Internal functions */ 898 - extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 899 - int depth, void *data); 900 895 901 896 extern int opal_notifier_register(struct notifier_block *nb); 902 897 extern int opal_notifier_unregister(struct notifier_block *nb); ··· 903 906 extern void opal_notifier_disable(void); 904 907 extern void opal_notifier_update_evt(uint64_t evt_mask, uint64_t evt_val); 905 908 906 - extern int opal_get_chars(uint32_t vtermno, char *buf, int count); 907 - extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); 908 - 909 909 extern int __opal_async_get_token(void); 910 910 extern int opal_async_get_token_interruptible(void); 911 911 extern int __opal_async_release_token(int token); 912 912 extern int opal_async_release_token(int token); 913 913 extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg); 914 914 extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data); 915 - 916 - extern void hvc_opal_init_early(void); 917 915 918 916 struct rtc_time; 919 917 extern int opal_set_rtc_time(struct rtc_time *tm); ··· 928 936 extern int opal_resync_timebase(void); 929 937 930 938 extern void opal_lpc_init(void); 939 + 940 + struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr, 941 + unsigned long vmalloc_size); 942 + void opal_free_sg_list(struct opal_sg_list *sg); 931 943 932 944 #endif /* __ASSEMBLY__ */ 933 945
+6 -1
arch/powerpc/include/uapi/asm/setup.h
··· 1 - #include <asm-generic/setup.h> 1 + #ifndef _UAPI_ASM_POWERPC_SETUP_H 2 + #define _UAPI_ASM_POWERPC_SETUP_H 3 + 4 + #define COMMAND_LINE_SIZE 2048 5 + 6 + #endif /* _UAPI_ASM_POWERPC_SETUP_H */
+1
arch/powerpc/kernel/ppc_ksyms.c
··· 120 120 EXPORT_SYMBOL(flush_instruction_cache); 121 121 #endif 122 122 EXPORT_SYMBOL(flush_dcache_range); 123 + EXPORT_SYMBOL(flush_icache_range); 123 124 124 125 #ifdef CONFIG_SMP 125 126 #ifdef CONFIG_PPC32
+1 -1
arch/powerpc/kernel/rtas_flash.c
··· 705 705 if (rtas_token("ibm,update-flash-64-and-reboot") == 706 706 RTAS_UNKNOWN_SERVICE) { 707 707 pr_info("rtas_flash: no firmware flash support\n"); 708 - return 1; 708 + return -EINVAL; 709 709 } 710 710 711 711 rtas_validate_flash_data.buf = kzalloc(VALIDATE_BUF_SIZE, GFP_KERNEL);
+17 -1
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 242 242 */ 243 243 .globl kvm_start_guest 244 244 kvm_start_guest: 245 + 246 + /* Set runlatch bit the minute you wake up from nap */ 247 + mfspr r1, SPRN_CTRLF 248 + ori r1, r1, 1 249 + mtspr SPRN_CTRLT, r1 250 + 245 251 ld r2,PACATOC(r13) 246 252 247 253 li r0,KVM_HWTHREAD_IN_KVM ··· 315 309 li r0, KVM_HWTHREAD_IN_NAP 316 310 stb r0, HSTATE_HWTHREAD_STATE(r13) 317 311 kvm_do_nap: 312 + /* Clear the runlatch bit before napping */ 313 + mfspr r2, SPRN_CTRLF 314 + clrrdi r2, r2, 1 315 + mtspr SPRN_CTRLT, r2 316 + 318 317 li r3, LPCR_PECE0 319 318 mfspr r4, SPRN_LPCR 320 319 rlwimi r4, r3, 0, LPCR_PECE0 | LPCR_PECE1 ··· 2010 1999 2011 2000 /* 2012 2001 * Take a nap until a decrementer or external or doobell interrupt 2013 - * occurs, with PECE1, PECE0 and PECEDP set in LPCR 2002 + * occurs, with PECE1, PECE0 and PECEDP set in LPCR. Also clear the 2003 + * runlatch bit before napping. 2014 2004 */ 2005 + mfspr r2, SPRN_CTRLF 2006 + clrrdi r2, r2, 1 2007 + mtspr SPRN_CTRLT, r2 2008 + 2015 2009 li r0,1 2016 2010 stb r0,HSTATE_HWTHREAD_REQ(r13) 2017 2011 mfspr r5,SPRN_LPCR
+16 -22
arch/powerpc/mm/hash_native_64.c
··· 82 82 va &= ~((1ul << mmu_psize_defs[apsize].shift) - 1); 83 83 va |= penc << 12; 84 84 va |= ssize << 8; 85 - /* Add AVAL part */ 86 - if (psize != apsize) { 87 - /* 88 - * MPSS, 64K base page size and 16MB parge page size 89 - * We don't need all the bits, but rest of the bits 90 - * must be ignored by the processor. 91 - * vpn cover upto 65 bits of va. (0...65) and we need 92 - * 58..64 bits of va. 93 - */ 94 - va |= (vpn & 0xfe); 95 - } 85 + /* 86 + * AVAL bits: 87 + * We don't need all the bits, but rest of the bits 88 + * must be ignored by the processor. 89 + * vpn cover upto 65 bits of va. (0...65) and we need 90 + * 58..64 bits of va. 91 + */ 92 + va |= (vpn & 0xfe); /* AVAL */ 96 93 va |= 1; /* L */ 97 94 asm volatile(ASM_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), %2) 98 95 : : "r" (va), "r"(0), "i" (CPU_FTR_ARCH_206) ··· 130 133 va &= ~((1ul << mmu_psize_defs[apsize].shift) - 1); 131 134 va |= penc << 12; 132 135 va |= ssize << 8; 133 - /* Add AVAL part */ 134 - if (psize != apsize) { 135 - /* 136 - * MPSS, 64K base page size and 16MB parge page size 137 - * We don't need all the bits, but rest of the bits 138 - * must be ignored by the processor. 139 - * vpn cover upto 65 bits of va. (0...65) and we need 140 - * 58..64 bits of va. 141 - */ 142 - va |= (vpn & 0xfe); 143 - } 136 + /* 137 + * AVAL bits: 138 + * We don't need all the bits, but rest of the bits 139 + * must be ignored by the processor. 140 + * vpn cover upto 65 bits of va. (0...65) and we need 141 + * 58..64 bits of va. 142 + */ 143 + va |= (vpn & 0xfe); 144 144 va |= 1; /* L */ 145 145 asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)" 146 146 : : "r"(va) : "memory");
+25 -12
arch/powerpc/perf/hv-24x7.c
··· 155 155 return copy_len; 156 156 } 157 157 158 - static unsigned long h_get_24x7_catalog_page(char page[static 4096], 159 - u32 version, u32 index) 158 + static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096, 159 + unsigned long version, 160 + unsigned long index) 160 161 { 161 - WARN_ON(!IS_ALIGNED((unsigned long)page, 4096)); 162 - return plpar_hcall_norets(H_GET_24X7_CATALOG_PAGE, 163 - virt_to_phys(page), 162 + pr_devel("h_get_24x7_catalog_page(0x%lx, %lu, %lu)", 163 + phys_4096, 164 164 version, 165 165 index); 166 + WARN_ON(!IS_ALIGNED(phys_4096, 4096)); 167 + return plpar_hcall_norets(H_GET_24X7_CATALOG_PAGE, 168 + phys_4096, 169 + version, 170 + index); 171 + } 172 + 173 + static unsigned long h_get_24x7_catalog_page(char page[], 174 + u64 version, u32 index) 175 + { 176 + return h_get_24x7_catalog_page_(virt_to_phys(page), 177 + version, index); 166 178 } 167 179 168 180 static ssize_t catalog_read(struct file *filp, struct kobject *kobj, ··· 185 173 ssize_t ret = 0; 186 174 size_t catalog_len = 0, catalog_page_len = 0, page_count = 0; 187 175 loff_t page_offset = 0; 188 - uint32_t catalog_version_num = 0; 176 + uint64_t catalog_version_num = 0; 189 177 void *page = kmem_cache_alloc(hv_page_cache, GFP_USER); 190 178 struct hv_24x7_catalog_page_0 *page_0 = page; 191 179 if (!page) ··· 197 185 goto e_free; 198 186 } 199 187 200 - catalog_version_num = be32_to_cpu(page_0->version); 188 + catalog_version_num = be64_to_cpu(page_0->version); 201 189 catalog_page_len = be32_to_cpu(page_0->length); 202 190 catalog_len = catalog_page_len * 4096; 203 191 ··· 220 208 page, 4096, page_offset * 4096); 221 209 e_free: 222 210 if (hret) 223 - pr_err("h_get_24x7_catalog_page(ver=%d, page=%lld) failed: rc=%ld\n", 224 - catalog_version_num, page_offset, hret); 211 + pr_err("h_get_24x7_catalog_page(ver=%lld, page=%lld) failed:" 212 + " rc=%ld\n", 213 + catalog_version_num, page_offset, hret); 225 214 kfree(page); 226 215 227 216 pr_devel("catalog_read: offset=%lld(%lld) count=%zu(%zu) catalog_len=%zu(%zu) => %zd\n", ··· 256 243 static DEVICE_ATTR_RO(_name) 257 244 258 245 PAGE_0_ATTR(catalog_version, "%lld\n", 259 - (unsigned long long)be32_to_cpu(page_0->version)); 246 + (unsigned long long)be64_to_cpu(page_0->version)); 260 247 PAGE_0_ATTR(catalog_len, "%lld\n", 261 248 (unsigned long long)be32_to_cpu(page_0->length) * 4096); 262 249 static BIN_ATTR_RO(catalog, 0/* real length varies */); ··· 498 485 struct hv_perf_caps caps; 499 486 500 487 if (!firmware_has_feature(FW_FEATURE_LPAR)) { 501 - pr_info("not a virtualized system, not enabling\n"); 488 + pr_debug("not a virtualized system, not enabling\n"); 502 489 return -ENODEV; 503 490 } 504 491 505 492 hret = hv_perf_caps_get(&caps); 506 493 if (hret) { 507 - pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n", 494 + pr_debug("could not obtain capabilities, not enabling, rc=%ld\n", 508 495 hret); 509 496 return -ENODEV; 510 497 }
+3 -3
arch/powerpc/perf/hv-gpci.c
··· 78 78 return sprintf(page, "0x%x\n", COUNTER_INFO_VERSION_CURRENT); 79 79 } 80 80 81 - DEVICE_ATTR_RO(kernel_version); 81 + static DEVICE_ATTR_RO(kernel_version); 82 82 HV_CAPS_ATTR(version, "0x%x\n"); 83 83 HV_CAPS_ATTR(ga, "%d\n"); 84 84 HV_CAPS_ATTR(expanded, "%d\n"); ··· 273 273 struct hv_perf_caps caps; 274 274 275 275 if (!firmware_has_feature(FW_FEATURE_LPAR)) { 276 - pr_info("not a virtualized system, not enabling\n"); 276 + pr_debug("not a virtualized system, not enabling\n"); 277 277 return -ENODEV; 278 278 } 279 279 280 280 hret = hv_perf_caps_get(&caps); 281 281 if (hret) { 282 - pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n", 282 + pr_debug("could not obtain capabilities, not enabling, rc=%ld\n", 283 283 hret); 284 284 return -ENODEV; 285 285 }
+11 -83
arch/powerpc/platforms/powernv/opal-dump.c
··· 209 209 .default_attrs = dump_default_attrs, 210 210 }; 211 211 212 - static void free_dump_sg_list(struct opal_sg_list *list) 212 + static int64_t dump_read_info(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type) 213 213 { 214 - struct opal_sg_list *sg1; 215 - while (list) { 216 - sg1 = list->next; 217 - kfree(list); 218 - list = sg1; 219 - } 220 - list = NULL; 221 - } 222 - 223 - static struct opal_sg_list *dump_data_to_sglist(struct dump_obj *dump) 224 - { 225 - struct opal_sg_list *sg1, *list = NULL; 226 - void *addr; 227 - int64_t size; 228 - 229 - addr = dump->buffer; 230 - size = dump->size; 231 - 232 - sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL); 233 - if (!sg1) 234 - goto nomem; 235 - 236 - list = sg1; 237 - sg1->num_entries = 0; 238 - while (size > 0) { 239 - /* Translate virtual address to physical address */ 240 - sg1->entry[sg1->num_entries].data = 241 - (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT); 242 - 243 - if (size > PAGE_SIZE) 244 - sg1->entry[sg1->num_entries].length = PAGE_SIZE; 245 - else 246 - sg1->entry[sg1->num_entries].length = size; 247 - 248 - sg1->num_entries++; 249 - if (sg1->num_entries >= SG_ENTRIES_PER_NODE) { 250 - sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL); 251 - if (!sg1->next) 252 - goto nomem; 253 - 254 - sg1 = sg1->next; 255 - sg1->num_entries = 0; 256 - } 257 - addr += PAGE_SIZE; 258 - size -= PAGE_SIZE; 259 - } 260 - return list; 261 - 262 - nomem: 263 - pr_err("%s : Failed to allocate memory\n", __func__); 264 - free_dump_sg_list(list); 265 - return NULL; 266 - } 267 - 268 - static void sglist_to_phy_addr(struct opal_sg_list *list) 269 - { 270 - struct opal_sg_list *sg, *next; 271 - 272 - for (sg = list; sg; sg = next) { 273 - next = sg->next; 274 - /* Don't translate NULL pointer for last entry */ 275 - if (sg->next) 276 - sg->next = (struct opal_sg_list *)__pa(sg->next); 277 - else 278 - sg->next = NULL; 279 - 280 - /* Convert num_entries to length */ 281 - sg->num_entries = 282 - sg->num_entries * sizeof(struct opal_sg_entry) + 16; 283 - } 284 - } 285 - 286 - static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type) 287 - { 214 + __be32 id, size, type; 288 215 int rc; 289 - *type = 0xffffffff; 290 216 291 - rc = opal_dump_info2(id, size, type); 217 + type = cpu_to_be32(0xffffffff); 292 218 219 + rc = opal_dump_info2(&id, &size, &type); 293 220 if (rc == OPAL_PARAMETER) 294 - rc = opal_dump_info(id, size); 221 + rc = opal_dump_info(&id, &size); 222 + 223 + *dump_id = be32_to_cpu(id); 224 + *dump_size = be32_to_cpu(size); 225 + *dump_type = be32_to_cpu(type); 295 226 296 227 if (rc) 297 228 pr_warn("%s: Failed to get dump info (%d)\n", ··· 245 314 } 246 315 247 316 /* Generate SG list */ 248 - list = dump_data_to_sglist(dump); 317 + list = opal_vmalloc_to_sg_list(dump->buffer, dump->size); 249 318 if (!list) { 250 319 rc = -ENOMEM; 251 320 goto out; 252 321 } 253 - 254 - /* Translate sg list addr to real address */ 255 - sglist_to_phy_addr(list); 256 322 257 323 /* First entry address */ 258 324 addr = __pa(list); ··· 269 341 __func__, dump->id); 270 342 271 343 /* Free SG list */ 272 - free_dump_sg_list(list); 344 + opal_free_sg_list(list); 273 345 274 346 out: 275 347 return rc;
+9 -2
arch/powerpc/platforms/powernv/opal-elog.c
··· 238 238 239 239 static void elog_work_fn(struct work_struct *work) 240 240 { 241 - size_t elog_size; 241 + __be64 size; 242 + __be64 id; 243 + __be64 type; 244 + uint64_t elog_size; 242 245 uint64_t log_id; 243 246 uint64_t elog_type; 244 247 int rc; 245 248 char name[2+16+1]; 246 249 247 - rc = opal_get_elog_size(&log_id, &elog_size, &elog_type); 250 + rc = opal_get_elog_size(&id, &size, &type); 248 251 if (rc != OPAL_SUCCESS) { 249 252 pr_err("ELOG: Opal log read failed\n"); 250 253 return; 251 254 } 255 + 256 + elog_size = be64_to_cpu(size); 257 + log_id = be64_to_cpu(id); 258 + elog_type = be64_to_cpu(type); 252 259 253 260 BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE); 254 261
+10 -108
arch/powerpc/platforms/powernv/opal-flash.c
··· 79 79 /* XXX: Assume candidate image size is <= 1GB */ 80 80 #define MAX_IMAGE_SIZE 0x40000000 81 81 82 - /* Flash sg list version */ 83 - #define SG_LIST_VERSION (1UL) 84 - 85 82 /* Image status */ 86 83 enum { 87 84 IMAGE_INVALID, ··· 128 131 */ 129 132 static inline void opal_flash_validate(void) 130 133 { 131 - struct validate_flash_t *args_buf = &validate_flash_data; 134 + long ret; 135 + void *buf = validate_flash_data.buf; 136 + __be32 size, result; 132 137 133 - args_buf->status = opal_validate_flash(__pa(args_buf->buf), 134 - &(args_buf->buf_size), 135 - &(args_buf->result)); 138 + ret = opal_validate_flash(__pa(buf), &size, &result); 139 + 140 + validate_flash_data.status = ret; 141 + validate_flash_data.buf_size = be32_to_cpu(size); 142 + validate_flash_data.result = be32_to_cpu(result); 136 143 } 137 144 138 145 /* ··· 269 268 } 270 269 271 270 /* 272 - * Free sg list 273 - */ 274 - static void free_sg_list(struct opal_sg_list *list) 275 - { 276 - struct opal_sg_list *sg1; 277 - while (list) { 278 - sg1 = list->next; 279 - kfree(list); 280 - list = sg1; 281 - } 282 - list = NULL; 283 - } 284 - 285 - /* 286 - * Build candidate image scatter gather list 287 - * 288 - * list format: 289 - * ----------------------------------- 290 - * | VER (8) | Entry length in bytes | 291 - * ----------------------------------- 292 - * | Pointer to next entry | 293 - * ----------------------------------- 294 - * | Address of memory area 1 | 295 - * ----------------------------------- 296 - * | Length of memory area 1 | 297 - * ----------------------------------- 298 - * | ......... | 299 - * ----------------------------------- 300 - * | ......... | 301 - * ----------------------------------- 302 - * | Address of memory area N | 303 - * ----------------------------------- 304 - * | Length of memory area N | 305 - * ----------------------------------- 306 - */ 307 - static struct opal_sg_list *image_data_to_sglist(void) 308 - { 309 - struct opal_sg_list *sg1, *list = NULL; 310 - void *addr; 311 - int size; 312 - 313 - addr = image_data.data; 314 - size = image_data.size; 315 - 316 - sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL); 317 - if (!sg1) 318 - return NULL; 319 - 320 - list = sg1; 321 - sg1->num_entries = 0; 322 - while (size > 0) { 323 - /* Translate virtual address to physical address */ 324 - sg1->entry[sg1->num_entries].data = 325 - (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT); 326 - 327 - if (size > PAGE_SIZE) 328 - sg1->entry[sg1->num_entries].length = PAGE_SIZE; 329 - else 330 - sg1->entry[sg1->num_entries].length = size; 331 - 332 - sg1->num_entries++; 333 - if (sg1->num_entries >= SG_ENTRIES_PER_NODE) { 334 - sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL); 335 - if (!sg1->next) { 336 - pr_err("%s : Failed to allocate memory\n", 337 - __func__); 338 - goto nomem; 339 - } 340 - 341 - sg1 = sg1->next; 342 - sg1->num_entries = 0; 343 - } 344 - addr += PAGE_SIZE; 345 - size -= PAGE_SIZE; 346 - } 347 - return list; 348 - nomem: 349 - free_sg_list(list); 350 - return NULL; 351 - } 352 - 353 - /* 354 271 * OPAL update flash 355 272 */ 356 273 static int opal_flash_update(int op) 357 274 { 358 - struct opal_sg_list *sg, *list, *next; 275 + struct opal_sg_list *list; 359 276 unsigned long addr; 360 277 int64_t rc = OPAL_PARAMETER; 361 278 ··· 283 364 goto flash; 284 365 } 285 366 286 - list = image_data_to_sglist(); 367 + list = opal_vmalloc_to_sg_list(image_data.data, image_data.size); 287 368 if (!list) 288 369 goto invalid_img; 289 370 290 371 /* First entry address */ 291 372 addr = __pa(list); 292 - 293 - /* Translate sg list address to absolute */ 294 - for (sg = list; sg; sg = next) { 295 - next = sg->next; 296 - /* Don't translate NULL pointer for last entry */ 297 - if (sg->next) 298 - sg->next = (struct opal_sg_list *)__pa(sg->next); 299 - else 300 - sg->next = NULL; 301 - 302 - /* 303 - * Convert num_entries to version/length format 304 - * to satisfy OPAL. 305 - */ 306 - sg->num_entries = (SG_LIST_VERSION << 56) | 307 - (sg->num_entries * sizeof(struct opal_sg_entry) + 16); 308 - } 309 373 310 374 pr_alert("FLASH: Image is %u bytes\n", image_data.size); 311 375 pr_alert("FLASH: Image update requested\n");
+23 -9
arch/powerpc/platforms/powernv/opal-sysparam.c
··· 39 39 struct kobj_attribute kobj_attr; 40 40 }; 41 41 42 - static int opal_get_sys_param(u32 param_id, u32 length, void *buffer) 42 + static ssize_t opal_get_sys_param(u32 param_id, u32 length, void *buffer) 43 43 { 44 44 struct opal_msg msg; 45 - int ret, token; 45 + ssize_t ret; 46 + int token; 46 47 47 48 token = opal_async_get_token_interruptible(); 48 49 if (token < 0) { ··· 60 59 61 60 ret = opal_async_wait_response(token, &msg); 62 61 if (ret) { 63 - pr_err("%s: Failed to wait for the async response, %d\n", 62 + pr_err("%s: Failed to wait for the async response, %zd\n", 64 63 __func__, ret); 65 64 goto out_token; 66 65 } ··· 112 111 { 113 112 struct param_attr *attr = container_of(kobj_attr, struct param_attr, 114 113 kobj_attr); 115 - int ret; 114 + ssize_t ret; 116 115 117 116 mutex_lock(&opal_sysparam_mutex); 118 117 ret = opal_get_sys_param(attr->param_id, attr->param_size, ··· 122 121 123 122 memcpy(buf, param_data_buf, attr->param_size); 124 123 124 + ret = attr->param_size; 125 125 out: 126 126 mutex_unlock(&opal_sysparam_mutex); 127 - return ret ? ret : attr->param_size; 127 + return ret; 128 128 } 129 129 130 130 static ssize_t sys_param_store(struct kobject *kobj, ··· 133 131 { 134 132 struct param_attr *attr = container_of(kobj_attr, struct param_attr, 135 133 kobj_attr); 136 - int ret; 134 + ssize_t ret; 135 + 136 + /* MAX_PARAM_DATA_LEN is sizeof(param_data_buf) */ 137 + if (count > MAX_PARAM_DATA_LEN) 138 + count = MAX_PARAM_DATA_LEN; 137 139 138 140 mutex_lock(&opal_sysparam_mutex); 139 141 memcpy(param_data_buf, buf, count); 140 142 ret = opal_set_sys_param(attr->param_id, attr->param_size, 141 143 param_data_buf); 142 144 mutex_unlock(&opal_sysparam_mutex); 143 - return ret ? ret : count; 145 + if (!ret) 146 + ret = count; 147 + return ret; 144 148 } 145 149 146 150 void __init opal_sys_param_init(void) ··· 222 214 } 223 215 224 216 if (of_property_read_u32_array(sysparam, "param-len", size, count)) { 225 - pr_err("SYSPARAM: Missing propery param-len in the DT\n"); 217 + pr_err("SYSPARAM: Missing property param-len in the DT\n"); 226 218 goto out_free_perm; 227 219 } 228 220 229 221 230 222 if (of_property_read_u8_array(sysparam, "param-perm", perm, count)) { 231 - pr_err("SYSPARAM: Missing propery param-perm in the DT\n"); 223 + pr_err("SYSPARAM: Missing property param-perm in the DT\n"); 232 224 goto out_free_perm; 233 225 } 234 226 ··· 241 233 242 234 /* For each of the parameters, populate the parameter attributes */ 243 235 for (i = 0; i < count; i++) { 236 + if (size[i] > MAX_PARAM_DATA_LEN) { 237 + pr_warn("SYSPARAM: Not creating parameter %d as size " 238 + "exceeds buffer length\n", i); 239 + continue; 240 + } 241 + 244 242 sysfs_attr_init(&attr[i].kobj_attr.attr); 245 243 attr[i].param_id = id[i]; 246 244 attr[i].param_size = size[i];
+66 -3
arch/powerpc/platforms/powernv/opal.c
··· 242 242 void opal_notifier_enable(void) 243 243 { 244 244 int64_t rc; 245 - uint64_t evt = 0; 245 + __be64 evt = 0; 246 246 247 247 atomic_set(&opal_notifier_hold, 0); 248 248 249 249 /* Process pending events */ 250 250 rc = opal_poll_events(&evt); 251 251 if (rc == OPAL_SUCCESS && evt) 252 - opal_do_notifier(evt); 252 + opal_do_notifier(be64_to_cpu(evt)); 253 253 } 254 254 255 255 void opal_notifier_disable(void) ··· 529 529 530 530 opal_handle_interrupt(virq_to_hw(irq), &events); 531 531 532 - opal_do_notifier(events); 532 + opal_do_notifier(be64_to_cpu(events)); 533 533 534 534 return IRQ_HANDLED; 535 535 } ··· 638 638 639 639 /* Export this so that test modules can use it */ 640 640 EXPORT_SYMBOL_GPL(opal_invalid_call); 641 + 642 + /* Convert a region of vmalloc memory to an opal sg list */ 643 + struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr, 644 + unsigned long vmalloc_size) 645 + { 646 + struct opal_sg_list *sg, *first = NULL; 647 + unsigned long i = 0; 648 + 649 + sg = kzalloc(PAGE_SIZE, GFP_KERNEL); 650 + if (!sg) 651 + goto nomem; 652 + 653 + first = sg; 654 + 655 + while (vmalloc_size > 0) { 656 + uint64_t data = vmalloc_to_pfn(vmalloc_addr) << PAGE_SHIFT; 657 + uint64_t length = min(vmalloc_size, PAGE_SIZE); 658 + 659 + sg->entry[i].data = cpu_to_be64(data); 660 + sg->entry[i].length = cpu_to_be64(length); 661 + i++; 662 + 663 + if (i >= SG_ENTRIES_PER_NODE) { 664 + struct opal_sg_list *next; 665 + 666 + next = kzalloc(PAGE_SIZE, GFP_KERNEL); 667 + if (!next) 668 + goto nomem; 669 + 670 + sg->length = cpu_to_be64( 671 + i * sizeof(struct opal_sg_entry) + 16); 672 + i = 0; 673 + sg->next = cpu_to_be64(__pa(next)); 674 + sg = next; 675 + } 676 + 677 + vmalloc_addr += length; 678 + vmalloc_size -= length; 679 + } 680 + 681 + sg->length = cpu_to_be64(i * sizeof(struct opal_sg_entry) + 16); 682 + 683 + return first; 684 + 685 + nomem: 686 + pr_err("%s : Failed to allocate memory\n", __func__); 687 + opal_free_sg_list(first); 688 + return NULL; 689 + } 690 + 691 + void opal_free_sg_list(struct opal_sg_list *sg) 692 + { 693 + while (sg) { 694 + uint64_t next = be64_to_cpu(sg->next); 695 + 696 + kfree(sg); 697 + 698 + if (next) 699 + sg = __va(next); 700 + else 701 + sg = NULL; 702 + } 703 + }
+1 -2
arch/powerpc/platforms/powernv/pci-ioda.c
··· 343 343 pci_name(dev)); 344 344 continue; 345 345 } 346 - pci_dev_get(dev); 347 346 pdn->pcidev = dev; 348 347 pdn->pe_number = pe->pe_number; 349 348 pe->dma_weight += pnv_ioda_dma_weight(dev); ··· 461 462 462 463 pe = &phb->ioda.pe_array[pdn->pe_number]; 463 464 WARN_ON(get_dma_ops(&pdev->dev) != &dma_iommu_ops); 464 - set_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table); 465 + set_iommu_table_base(&pdev->dev, &pe->tce32_table); 465 466 } 466 467 467 468 static int pnv_pci_ioda_dma_set_mask(struct pnv_phb *phb,
+46 -2
arch/powerpc/platforms/powernv/setup.c
··· 162 162 } 163 163 164 164 #ifdef CONFIG_KEXEC 165 + static void pnv_kexec_wait_secondaries_down(void) 166 + { 167 + int my_cpu, i, notified = -1; 168 + 169 + my_cpu = get_cpu(); 170 + 171 + for_each_online_cpu(i) { 172 + uint8_t status; 173 + int64_t rc; 174 + 175 + if (i == my_cpu) 176 + continue; 177 + 178 + for (;;) { 179 + rc = opal_query_cpu_status(get_hard_smp_processor_id(i), 180 + &status); 181 + if (rc != OPAL_SUCCESS || status != OPAL_THREAD_STARTED) 182 + break; 183 + barrier(); 184 + if (i != notified) { 185 + printk(KERN_INFO "kexec: waiting for cpu %d " 186 + "(physical %d) to enter OPAL\n", 187 + i, paca[i].hw_cpu_id); 188 + notified = i; 189 + } 190 + } 191 + } 192 + } 193 + 165 194 static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) 166 195 { 167 196 xics_kexec_teardown_cpu(secondary); 168 197 169 - /* Return secondary CPUs to firmware on OPAL v3 */ 170 - if (firmware_has_feature(FW_FEATURE_OPALv3) && secondary) { 198 + /* On OPAL v3, we return all CPUs to firmware */ 199 + 200 + if (!firmware_has_feature(FW_FEATURE_OPALv3)) 201 + return; 202 + 203 + if (secondary) { 204 + /* Return secondary CPUs to firmware on OPAL v3 */ 171 205 mb(); 172 206 get_paca()->kexec_state = KEXEC_STATE_REAL_MODE; 173 207 mb(); 174 208 175 209 /* Return the CPU to OPAL */ 176 210 opal_return_cpu(); 211 + } else if (crash_shutdown) { 212 + /* 213 + * On crash, we don't wait for secondaries to go 214 + * down as they might be unreachable or hung, so 215 + * instead we just wait a bit and move on. 216 + */ 217 + mdelay(1); 218 + } else { 219 + /* Primary waits for the secondaries to have reached OPAL */ 220 + pnv_kexec_wait_secondaries_down(); 177 221 } 178 222 } 179 223 #endif /* CONFIG_KEXEC */
+3
arch/powerpc/platforms/powernv/smp.c
··· 30 30 #include <asm/cputhreads.h> 31 31 #include <asm/xics.h> 32 32 #include <asm/opal.h> 33 + #include <asm/runlatch.h> 33 34 34 35 #include "powernv.h" 35 36 ··· 157 156 */ 158 157 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); 159 158 while (!generic_check_cpu_restart(cpu)) { 159 + ppc64_runlatch_off(); 160 160 power7_nap(); 161 + ppc64_runlatch_on(); 161 162 if (!generic_check_cpu_restart(cpu)) { 162 163 DBG("CPU%d Unexpected exit while offline !\n", cpu); 163 164 /* We may be getting an IPI, so we re-enable
+3 -2
arch/powerpc/platforms/pseries/hotplug-cpu.c
··· 88 88 89 89 static void rtas_stop_self(void) 90 90 { 91 - struct rtas_args args = { 92 - .token = cpu_to_be32(rtas_stop_self_token), 91 + static struct rtas_args args = { 93 92 .nargs = 0, 94 93 .nret = 1, 95 94 .rets = &args.args[0], 96 95 }; 96 + 97 + args.token = cpu_to_be32(rtas_stop_self_token); 97 98 98 99 local_irq_disable(); 99 100
+6 -4
arch/powerpc/platforms/pseries/hotplug-memory.c
··· 100 100 101 101 start_pfn = base >> PAGE_SHIFT; 102 102 103 - if (!pfn_valid(start_pfn)) { 104 - memblock_remove(base, memblock_size); 105 - return 0; 106 - } 103 + lock_device_hotplug(); 104 + 105 + if (!pfn_valid(start_pfn)) 106 + goto out; 107 107 108 108 block_sz = memory_block_size_bytes(); 109 109 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE; ··· 114 114 base += MIN_MEMORY_BLOCK_SIZE; 115 115 } 116 116 117 + out: 117 118 /* Update memory regions for memory remove */ 118 119 memblock_remove(base, memblock_size); 120 + unlock_device_hotplug(); 119 121 return 0; 120 122 } 121 123
+1 -1
arch/powerpc/sysdev/ppc4xx_pci.c
··· 1058 1058 return 1; 1059 1059 } 1060 1060 1061 - static int apm821xx_pciex_init_port_hw(struct ppc4xx_pciex_port *port) 1061 + static int __init apm821xx_pciex_init_port_hw(struct ppc4xx_pciex_port *port) 1062 1062 { 1063 1063 u32 val; 1064 1064
+1 -1
arch/s390/include/asm/ccwgroup.h
··· 22 22 /* public: */ 23 23 unsigned int count; 24 24 struct device dev; 25 - struct ccw_device *cdev[0]; 26 25 struct work_struct ungroup_work; 26 + struct ccw_device *cdev[0]; 27 27 }; 28 28 29 29 /**
+12 -1
arch/s390/include/asm/tlb.h
··· 59 59 tlb->batch = NULL; 60 60 } 61 61 62 - static inline void tlb_flush_mmu(struct mmu_gather *tlb) 62 + static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) 63 63 { 64 64 __tlb_flush_mm_lazy(tlb->mm); 65 + } 66 + 67 + static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) 68 + { 65 69 tlb_table_flush(tlb); 70 + } 71 + 72 + 73 + static inline void tlb_flush_mmu(struct mmu_gather *tlb) 74 + { 75 + tlb_flush_mmu_tlbonly(tlb); 76 + tlb_flush_mmu_free(tlb); 66 77 } 67 78 68 79 static inline void tlb_finish_mmu(struct mmu_gather *tlb,
-1
arch/s390/net/bpf_jit_comp.c
··· 276 276 case BPF_S_LD_W_IND: 277 277 case BPF_S_LD_H_IND: 278 278 case BPF_S_LD_B_IND: 279 - case BPF_S_LDX_B_MSH: 280 279 case BPF_S_LD_IMM: 281 280 case BPF_S_LD_MEM: 282 281 case BPF_S_MISC_TXA:
+8
arch/sh/include/asm/tlb.h
··· 86 86 } 87 87 } 88 88 89 + static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) 90 + { 91 + } 92 + 93 + static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) 94 + { 95 + } 96 + 89 97 static inline void tlb_flush_mmu(struct mmu_gather *tlb) 90 98 { 91 99 }
+14 -2
arch/um/include/asm/tlb.h
··· 59 59 unsigned long end); 60 60 61 61 static inline void 62 + tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) 63 + { 64 + flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end); 65 + } 66 + 67 + static inline void 68 + tlb_flush_mmu_free(struct mmu_gather *tlb) 69 + { 70 + init_tlb_gather(tlb); 71 + } 72 + 73 + static inline void 62 74 tlb_flush_mmu(struct mmu_gather *tlb) 63 75 { 64 76 if (!tlb->need_flush) 65 77 return; 66 78 67 - flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end); 68 - init_tlb_gather(tlb); 79 + tlb_flush_mmu_tlbonly(tlb); 80 + tlb_flush_mmu_free(tlb); 69 81 } 70 82 71 83 /* tlb_finish_mmu
+1
arch/um/include/shared/os.h
··· 136 136 extern int os_get_ifname(int fd, char *namebuf); 137 137 extern int os_set_slip(int fd); 138 138 extern int os_mode_fd(int fd, int mode); 139 + extern int os_fsync_file(int fd); 139 140 140 141 extern int os_seek_file(int fd, unsigned long long offset); 141 142 extern int os_open_file(const char *file, struct openflags flags, int mode);
+1
arch/um/kernel/physmem.c
··· 103 103 */ 104 104 os_seek_file(physmem_fd, __pa(&__syscall_stub_start)); 105 105 os_write_file(physmem_fd, &__syscall_stub_start, PAGE_SIZE); 106 + os_fsync_file(physmem_fd); 106 107 107 108 bootmap_size = init_bootmem(pfn, pfn + delta); 108 109 free_bootmem(__pa(reserve_end) + bootmap_size,
+6
arch/um/os-Linux/file.c
··· 237 237 { 238 238 close(fd); 239 239 } 240 + int os_fsync_file(int fd) 241 + { 242 + if (fsync(fd) < 0) 243 + return -errno; 244 + return 0; 245 + } 240 246 241 247 int os_seek_file(int fd, unsigned long long offset) 242 248 {
+1
arch/um/os-Linux/main.c
··· 151 151 #endif 152 152 153 153 do_uml_initcalls(); 154 + change_sig(SIGPIPE, 0); 154 155 ret = linux_main(argc, argv); 155 156 156 157 /*
+89 -311
arch/um/os-Linux/mem.c
··· 12 12 #include <string.h> 13 13 #include <sys/stat.h> 14 14 #include <sys/mman.h> 15 - #include <sys/param.h> 15 + #include <sys/vfs.h> 16 + #include <linux/magic.h> 16 17 #include <init.h> 17 18 #include <os.h> 18 19 19 - /* Modified by which_tmpdir, which is called during early boot */ 20 - static char *default_tmpdir = "/tmp"; 21 - 22 - /* 23 - * Modified when creating the physical memory file and when checking 24 - * the tmp filesystem for usability, both happening during early boot. 25 - */ 20 + /* Set by make_tempfile() during early boot. */ 26 21 static char *tempdir = NULL; 27 22 28 - static void __init find_tempdir(void) 23 + /* Check if dir is on tmpfs. Return 0 if yes, -1 if no or error. */ 24 + static int __init check_tmpfs(const char *dir) 29 25 { 30 - const char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL }; 31 - int i; 32 - char *dir = NULL; 26 + struct statfs st; 33 27 34 - if (tempdir != NULL) 35 - /* We've already been called */ 36 - return; 37 - for (i = 0; dirs[i]; i++) { 38 - dir = getenv(dirs[i]); 39 - if ((dir != NULL) && (*dir != '\0')) 40 - break; 41 - } 42 - if ((dir == NULL) || (*dir == '\0')) 43 - dir = default_tmpdir; 44 - 45 - tempdir = malloc(strlen(dir) + 2); 46 - if (tempdir == NULL) { 47 - fprintf(stderr, "Failed to malloc tempdir, " 48 - "errno = %d\n", errno); 49 - return; 50 - } 51 - strcpy(tempdir, dir); 52 - strcat(tempdir, "/"); 53 - } 54 - 55 - /* 56 - * Remove bytes from the front of the buffer and refill it so that if there's a 57 - * partial string that we care about, it will be completed, and we can recognize 58 - * it. 59 - */ 60 - static int pop(int fd, char *buf, size_t size, size_t npop) 61 - { 62 - ssize_t n; 63 - size_t len = strlen(&buf[npop]); 64 - 65 - memmove(buf, &buf[npop], len + 1); 66 - n = read(fd, &buf[len], size - len - 1); 67 - if (n < 0) 68 - return -errno; 69 - 70 - buf[len + n] = '\0'; 71 - return 1; 72 - } 73 - 74 - /* 75 - * This will return 1, with the first character in buf being the 76 - * character following the next instance of c in the file. This will 77 - * read the file as needed. If there's an error, -errno is returned; 78 - * if the end of the file is reached, 0 is returned. 79 - */ 80 - static int next(int fd, char *buf, size_t size, char c) 81 - { 82 - ssize_t n; 83 - char *ptr; 84 - 85 - while ((ptr = strchr(buf, c)) == NULL) { 86 - n = read(fd, buf, size - 1); 87 - if (n == 0) 88 - return 0; 89 - else if (n < 0) 90 - return -errno; 91 - 92 - buf[n] = '\0'; 93 - } 94 - 95 - return pop(fd, buf, size, ptr - buf + 1); 96 - } 97 - 98 - /* 99 - * Decode an octal-escaped and space-terminated path of the form used by 100 - * /proc/mounts. May be used to decode a path in-place. "out" must be at least 101 - * as large as the input. The output is always null-terminated. "len" gets the 102 - * length of the output, excluding the trailing null. Returns 0 if a full path 103 - * was successfully decoded, otherwise an error. 104 - */ 105 - static int decode_path(const char *in, char *out, size_t *len) 106 - { 107 - char *first = out; 108 - int c; 109 - int i; 110 - int ret = -EINVAL; 111 - while (1) { 112 - switch (*in) { 113 - case '\0': 114 - goto out; 115 - 116 - case ' ': 117 - ret = 0; 118 - goto out; 119 - 120 - case '\\': 121 - in++; 122 - c = 0; 123 - for (i = 0; i < 3; i++) { 124 - if (*in < '0' || *in > '7') 125 - goto out; 126 - c = (c << 3) | (*in++ - '0'); 127 - } 128 - *(unsigned char *)out++ = (unsigned char) c; 129 - break; 130 - 131 - default: 132 - *out++ = *in++; 133 - break; 134 - } 135 - } 136 - 137 - out: 138 - *out = '\0'; 139 - *len = out - first; 140 - return ret; 141 - } 142 - 143 - /* 144 - * Computes the length of s when encoded with three-digit octal escape sequences 145 - * for the characters in chars. 146 - */ 147 - static size_t octal_encoded_length(const char *s, const char *chars) 148 - { 149 - size_t len = strlen(s); 150 - while ((s = strpbrk(s, chars)) != NULL) { 151 - len += 3; 152 - s++; 153 - } 154 - 155 - return len; 156 - } 157 - 158 - enum { 159 - OUTCOME_NOTHING_MOUNTED, 160 - OUTCOME_TMPFS_MOUNT, 161 - OUTCOME_NON_TMPFS_MOUNT, 162 - }; 163 - 164 - /* Read a line of /proc/mounts data looking for a tmpfs mount at "path". */ 165 - static int read_mount(int fd, char *buf, size_t bufsize, const char *path, 166 - int *outcome) 167 - { 168 - int found; 169 - int match; 170 - char *space; 171 - size_t len; 172 - 173 - enum { 174 - MATCH_NONE, 175 - MATCH_EXACT, 176 - MATCH_PARENT, 177 - }; 178 - 179 - found = next(fd, buf, bufsize, ' '); 180 - if (found != 1) 181 - return found; 182 - 183 - /* 184 - * If there's no following space in the buffer, then this path is 185 - * truncated, so it can't be the one we're looking for. 186 - */ 187 - space = strchr(buf, ' '); 188 - if (space) { 189 - match = MATCH_NONE; 190 - if (!decode_path(buf, buf, &len)) { 191 - if (!strcmp(buf, path)) 192 - match = MATCH_EXACT; 193 - else if (!strncmp(buf, path, len) 194 - && (path[len] == '/' || !strcmp(buf, "/"))) 195 - match = MATCH_PARENT; 196 - } 197 - 198 - found = pop(fd, buf, bufsize, space - buf + 1); 199 - if (found != 1) 200 - return found; 201 - 202 - switch (match) { 203 - case MATCH_EXACT: 204 - if (!strncmp(buf, "tmpfs", strlen("tmpfs"))) 205 - *outcome = OUTCOME_TMPFS_MOUNT; 206 - else 207 - *outcome = OUTCOME_NON_TMPFS_MOUNT; 208 - break; 209 - 210 - case MATCH_PARENT: 211 - /* This mount obscures any previous ones. */ 212 - *outcome = OUTCOME_NOTHING_MOUNTED; 213 - break; 214 - } 215 - } 216 - 217 - return next(fd, buf, bufsize, '\n'); 218 - } 219 - 220 - /* which_tmpdir is called only during early boot */ 221 - static int checked_tmpdir = 0; 222 - 223 - /* 224 - * Look for a tmpfs mounted at /dev/shm. I couldn't find a cleaner 225 - * way to do this than to parse /proc/mounts. statfs will return the 226 - * same filesystem magic number and fs id for both /dev and /dev/shm 227 - * when they are both tmpfs, so you can't tell if they are different 228 - * filesystems. Also, there seems to be no other way of finding the 229 - * mount point of a filesystem from within it. 230 - * 231 - * If a /dev/shm tmpfs entry is found, then we switch to using it. 232 - * Otherwise, we stay with the default /tmp. 233 - */ 234 - static void which_tmpdir(void) 235 - { 236 - int fd; 237 - int found; 238 - int outcome; 239 - char *path; 240 - char *buf; 241 - size_t bufsize; 242 - 243 - if (checked_tmpdir) 244 - return; 245 - 246 - checked_tmpdir = 1; 247 - 248 - printf("Checking for tmpfs mount on /dev/shm..."); 249 - 250 - path = realpath("/dev/shm", NULL); 251 - if (!path) { 252 - printf("failed to check real path, errno = %d\n", errno); 253 - return; 254 - } 255 - printf("%s...", path); 256 - 257 - /* 258 - * The buffer needs to be able to fit the full octal-escaped path, a 259 - * space, and a trailing null in order to successfully decode it. 260 - */ 261 - bufsize = octal_encoded_length(path, " \t\n\\") + 2; 262 - 263 - if (bufsize < 128) 264 - bufsize = 128; 265 - 266 - buf = malloc(bufsize); 267 - if (!buf) { 268 - printf("malloc failed, errno = %d\n", errno); 269 - goto out; 270 - } 271 - buf[0] = '\0'; 272 - 273 - fd = open("/proc/mounts", O_RDONLY); 274 - if (fd < 0) { 275 - printf("failed to open /proc/mounts, errno = %d\n", errno); 276 - goto out1; 277 - } 278 - 279 - outcome = OUTCOME_NOTHING_MOUNTED; 280 - while (1) { 281 - found = read_mount(fd, buf, bufsize, path, &outcome); 282 - if (found != 1) 283 - break; 284 - } 285 - 286 - if (found < 0) { 287 - printf("read returned errno %d\n", -found); 28 + printf("Checking if %s is on tmpfs...", dir); 29 + if (statfs(dir, &st) < 0) { 30 + printf("%s\n", strerror(errno)); 31 + } else if (st.f_type != TMPFS_MAGIC) { 32 + printf("no\n"); 288 33 } else { 289 - switch (outcome) { 290 - case OUTCOME_TMPFS_MOUNT: 291 - printf("OK\n"); 292 - default_tmpdir = "/dev/shm"; 293 - break; 294 - 295 - case OUTCOME_NON_TMPFS_MOUNT: 296 - printf("not tmpfs\n"); 297 - break; 298 - 299 - default: 300 - printf("nothing mounted on /dev/shm\n"); 301 - break; 302 - } 34 + printf("OK\n"); 35 + return 0; 303 36 } 304 - 305 - close(fd); 306 - out1: 307 - free(buf); 308 - out: 309 - free(path); 37 + return -1; 310 38 } 311 39 312 - static int __init make_tempfile(const char *template, char **out_tempname, 313 - int do_unlink) 40 + /* 41 + * Choose the tempdir to use. We want something on tmpfs so that our memory is 42 + * not subject to the host's vm.dirty_ratio. If a tempdir is specified in the 43 + * environment, we use that even if it's not on tmpfs, but we warn the user. 44 + * Otherwise, we try common tmpfs locations, and if no tmpfs directory is found 45 + * then we fall back to /tmp. 46 + */ 47 + static char * __init choose_tempdir(void) 48 + { 49 + static const char * const vars[] = { 50 + "TMPDIR", 51 + "TMP", 52 + "TEMP", 53 + NULL 54 + }; 55 + static const char fallback_dir[] = "/tmp"; 56 + static const char * const tmpfs_dirs[] = { 57 + "/dev/shm", 58 + fallback_dir, 59 + NULL 60 + }; 61 + int i; 62 + const char *dir; 63 + 64 + printf("Checking environment variables for a tempdir..."); 65 + for (i = 0; vars[i]; i++) { 66 + dir = getenv(vars[i]); 67 + if ((dir != NULL) && (*dir != '\0')) { 68 + printf("%s\n", dir); 69 + if (check_tmpfs(dir) >= 0) 70 + goto done; 71 + else 72 + goto warn; 73 + } 74 + } 75 + printf("none found\n"); 76 + 77 + for (i = 0; tmpfs_dirs[i]; i++) { 78 + dir = tmpfs_dirs[i]; 79 + if (check_tmpfs(dir) >= 0) 80 + goto done; 81 + } 82 + 83 + dir = fallback_dir; 84 + warn: 85 + printf("Warning: tempdir %s is not on tmpfs\n", dir); 86 + done: 87 + /* Make a copy since getenv results may not remain valid forever. */ 88 + return strdup(dir); 89 + } 90 + 91 + /* 92 + * Create an unlinked tempfile in a suitable tempdir. template must be the 93 + * basename part of the template with a leading '/'. 94 + */ 95 + static int __init make_tempfile(const char *template) 314 96 { 315 97 char *tempname; 316 98 int fd; 317 99 318 - which_tmpdir(); 319 - tempname = malloc(MAXPATHLEN); 100 + if (tempdir == NULL) { 101 + tempdir = choose_tempdir(); 102 + if (tempdir == NULL) { 103 + fprintf(stderr, "Failed to choose tempdir: %s\n", 104 + strerror(errno)); 105 + return -1; 106 + } 107 + } 108 + 109 + tempname = malloc(strlen(tempdir) + strlen(template) + 1); 320 110 if (tempname == NULL) 321 111 return -1; 322 112 323 - find_tempdir(); 324 - if ((tempdir == NULL) || (strlen(tempdir) >= MAXPATHLEN)) 325 - goto out; 326 - 327 - if (template[0] != '/') 328 - strcpy(tempname, tempdir); 329 - else 330 - tempname[0] = '\0'; 331 - strncat(tempname, template, MAXPATHLEN-1-strlen(tempname)); 113 + strcpy(tempname, tempdir); 114 + strcat(tempname, template); 332 115 fd = mkstemp(tempname); 333 116 if (fd < 0) { 334 117 fprintf(stderr, "open - cannot create %s: %s\n", tempname, 335 118 strerror(errno)); 336 119 goto out; 337 120 } 338 - if (do_unlink && (unlink(tempname) < 0)) { 121 + if (unlink(tempname) < 0) { 339 122 perror("unlink"); 340 123 goto close; 341 124 } 342 - if (out_tempname) { 343 - *out_tempname = tempname; 344 - } else 345 - free(tempname); 125 + free(tempname); 346 126 return fd; 347 127 close: 348 128 close(fd); ··· 131 351 return -1; 132 352 } 133 353 134 - #define TEMPNAME_TEMPLATE "vm_file-XXXXXX" 354 + #define TEMPNAME_TEMPLATE "/vm_file-XXXXXX" 135 355 136 356 static int __init create_tmp_file(unsigned long long len) 137 357 { 138 358 int fd, err; 139 359 char zero; 140 360 141 - fd = make_tempfile(TEMPNAME_TEMPLATE, NULL, 1); 361 + fd = make_tempfile(TEMPNAME_TEMPLATE); 142 362 if (fd < 0) 143 363 exit(1); 144 364 ··· 182 402 return fd; 183 403 } 184 404 185 - 186 405 void __init check_tmpexec(void) 187 406 { 188 407 void *addr; ··· 189 410 190 411 addr = mmap(NULL, UM_KERN_PAGE_SIZE, 191 412 PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); 192 - printf("Checking PROT_EXEC mmap in %s...",tempdir); 193 - fflush(stdout); 413 + printf("Checking PROT_EXEC mmap in %s...", tempdir); 194 414 if (addr == MAP_FAILED) { 195 415 err = errno; 196 - perror("failed"); 416 + printf("%s\n", strerror(err)); 197 417 close(fd); 198 418 if (err == EPERM) 199 - printf("%s must be not mounted noexec\n",tempdir); 419 + printf("%s must be not mounted noexec\n", tempdir); 200 420 exit(1); 201 421 } 202 422 printf("OK\n");
+3 -1
arch/x86/Makefile
··· 83 83 KBUILD_CFLAGS += -m64 84 84 85 85 # Don't autogenerate traditional x87, MMX or SSE instructions 86 - KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 86 + KBUILD_CFLAGS += -mno-mmx -mno-sse 87 + KBUILD_CFLAGS += $(call cc-option,-mno-80387) 88 + KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387) 87 89 88 90 # Use -mpreferred-stack-boundary=3 if supported. 89 91 KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+5
arch/x86/kernel/apic/io_apic.c
··· 3425 3425 return nr_irqs_gsi; 3426 3426 } 3427 3427 3428 + unsigned int arch_dynirq_lower_bound(unsigned int from) 3429 + { 3430 + return from < nr_irqs_gsi ? nr_irqs_gsi : from; 3431 + } 3432 + 3428 3433 int __init arch_probe_nr_irqs(void) 3429 3434 { 3430 3435 int nr;
+2 -1
arch/x86/kernel/cpu/perf_event_intel_rapl.c
··· 543 543 if (phys_id < 0) 544 544 return -1; 545 545 546 - if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) 546 + /* protect rdmsrl() to handle virtualization */ 547 + if (rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) 547 548 return -1; 548 549 549 550 pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu));
+10 -1
arch/x86/kernel/vsmp_64.c
··· 26 26 27 27 #define TOPOLOGY_REGISTER_OFFSET 0x10 28 28 29 + /* Flag below is initialized once during vSMP PCI initialization. */ 30 + static int irq_routing_comply = 1; 31 + 29 32 #if defined CONFIG_PCI && defined CONFIG_PARAVIRT 30 33 /* 31 34 * Interrupt control on vSMPowered systems: ··· 104 101 #ifdef CONFIG_SMP 105 102 if (cap & ctl & BIT(8)) { 106 103 ctl &= ~BIT(8); 104 + 105 + /* Interrupt routing set to ignore */ 106 + irq_routing_comply = 0; 107 + 107 108 #ifdef CONFIG_PROC_FS 108 109 /* Don't let users change irq affinity via procfs */ 109 110 no_irq_affinity = 1; ··· 225 218 { 226 219 /* need to update phys_pkg_id */ 227 220 apic->phys_pkg_id = apicid_phys_pkg_id; 228 - apic->vector_allocation_domain = fill_vector_allocation_domain; 221 + 222 + if (!irq_routing_comply) 223 + apic->vector_allocation_domain = fill_vector_allocation_domain; 229 224 } 230 225 231 226 void __init vsmp_init(void)
+41 -12
arch/x86/kvm/vmx.c
··· 503 503 [number##_HIGH] = VMCS12_OFFSET(name)+4 504 504 505 505 506 - static const unsigned long shadow_read_only_fields[] = { 506 + static unsigned long shadow_read_only_fields[] = { 507 507 /* 508 508 * We do NOT shadow fields that are modified when L0 509 509 * traps and emulates any vmx instruction (e.g. VMPTRLD, ··· 526 526 GUEST_LINEAR_ADDRESS, 527 527 GUEST_PHYSICAL_ADDRESS 528 528 }; 529 - static const int max_shadow_read_only_fields = 529 + static int max_shadow_read_only_fields = 530 530 ARRAY_SIZE(shadow_read_only_fields); 531 531 532 - static const unsigned long shadow_read_write_fields[] = { 532 + static unsigned long shadow_read_write_fields[] = { 533 533 GUEST_RIP, 534 534 GUEST_RSP, 535 535 GUEST_CR0, ··· 558 558 HOST_FS_SELECTOR, 559 559 HOST_GS_SELECTOR 560 560 }; 561 - static const int max_shadow_read_write_fields = 561 + static int max_shadow_read_write_fields = 562 562 ARRAY_SIZE(shadow_read_write_fields); 563 563 564 564 static const unsigned short vmcs_field_to_offset_table[] = { ··· 3009 3009 } 3010 3010 } 3011 3011 3012 + static void init_vmcs_shadow_fields(void) 3013 + { 3014 + int i, j; 3015 + 3016 + /* No checks for read only fields yet */ 3017 + 3018 + for (i = j = 0; i < max_shadow_read_write_fields; i++) { 3019 + switch (shadow_read_write_fields[i]) { 3020 + case GUEST_BNDCFGS: 3021 + if (!vmx_mpx_supported()) 3022 + continue; 3023 + break; 3024 + default: 3025 + break; 3026 + } 3027 + 3028 + if (j < i) 3029 + shadow_read_write_fields[j] = 3030 + shadow_read_write_fields[i]; 3031 + j++; 3032 + } 3033 + max_shadow_read_write_fields = j; 3034 + 3035 + /* shadowed fields guest access without vmexit */ 3036 + for (i = 0; i < max_shadow_read_write_fields; i++) { 3037 + clear_bit(shadow_read_write_fields[i], 3038 + vmx_vmwrite_bitmap); 3039 + clear_bit(shadow_read_write_fields[i], 3040 + vmx_vmread_bitmap); 3041 + } 3042 + for (i = 0; i < max_shadow_read_only_fields; i++) 3043 + clear_bit(shadow_read_only_fields[i], 3044 + vmx_vmread_bitmap); 3045 + } 3046 + 3012 3047 static __init int alloc_kvm_area(void) 3013 3048 { 3014 3049 int cpu; ··· 3074 3039 enable_vpid = 0; 3075 3040 if (!cpu_has_vmx_shadow_vmcs()) 3076 3041 enable_shadow_vmcs = 0; 3042 + if (enable_shadow_vmcs) 3043 + init_vmcs_shadow_fields(); 3077 3044 3078 3045 if (!cpu_has_vmx_ept() || 3079 3046 !cpu_has_vmx_ept_4levels()) { ··· 8840 8803 8841 8804 memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE); 8842 8805 memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE); 8843 - /* shadowed read/write fields */ 8844 - for (i = 0; i < max_shadow_read_write_fields; i++) { 8845 - clear_bit(shadow_read_write_fields[i], vmx_vmwrite_bitmap); 8846 - clear_bit(shadow_read_write_fields[i], vmx_vmread_bitmap); 8847 - } 8848 - /* shadowed read only fields */ 8849 - for (i = 0; i < max_shadow_read_only_fields; i++) 8850 - clear_bit(shadow_read_only_fields[i], vmx_vmread_bitmap); 8851 8806 8852 8807 /* 8853 8808 * Allow direct access to the PC debug port (it is often used for I/O
+8 -11
arch/x86/vdso/vdso-layout.lds.S
··· 9 9 #ifdef BUILD_VDSO32 10 10 #include <asm/vdso32.h> 11 11 12 - .hpet_sect : { 13 - hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); 14 - } :text :hpet_sect 12 + hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); 15 13 16 - .vvar_sect : { 17 - vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); 14 + vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); 18 15 19 16 /* Place all vvars at the offsets in asm/vvar.h. */ 20 17 #define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset; ··· 19 22 #include <asm/vvar.h> 20 23 #undef __VVAR_KERNEL_LDS 21 24 #undef EMIT_VVAR 22 - } :text :vvar_sect 23 25 #endif 24 26 . = SIZEOF_HEADERS; 25 27 ··· 57 61 */ 58 62 . = ALIGN(0x100); 59 63 60 - .text : { *(.text*) } :text =0x90909090 64 + .text : { *(.text*) } :text =0x90909090, 65 + 66 + /* 67 + * The comma above works around a bug in gold: 68 + * https://sourceware.org/bugzilla/show_bug.cgi?id=16804 69 + */ 61 70 62 71 /DISCARD/ : { 63 72 *(.discard) ··· 85 84 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ 86 85 note PT_NOTE FLAGS(4); /* PF_R */ 87 86 eh_frame_hdr PT_GNU_EH_FRAME; 88 - #ifdef BUILD_VDSO32 89 - vvar_sect PT_NULL FLAGS(4); /* PF_R */ 90 - hpet_sect PT_NULL FLAGS(4); /* PF_R */ 91 - #endif 92 87 }
+4 -3
drivers/acpi/acpi_processor.c
··· 170 170 acpi_status status; 171 171 int ret; 172 172 173 + if (pr->apic_id == -1) 174 + return -ENODEV; 175 + 173 176 status = acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta); 174 177 if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_PRESENT)) 175 178 return -ENODEV; ··· 263 260 } 264 261 265 262 apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id); 266 - if (apic_id < 0) { 263 + if (apic_id < 0) 267 264 acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n"); 268 - return -ENODEV; 269 - } 270 265 pr->apic_id = apic_id; 271 266 272 267 cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id);
+97 -7
drivers/acpi/acpica/exfield.c
··· 45 45 #include "accommon.h" 46 46 #include "acdispat.h" 47 47 #include "acinterp.h" 48 + #include "amlcode.h" 48 49 49 50 #define _COMPONENT ACPI_EXECUTER 50 51 ACPI_MODULE_NAME("exfield") 52 + 53 + /* Local prototypes */ 54 + static u32 55 + acpi_ex_get_serial_access_length(u32 accessor_type, u32 access_length); 56 + 57 + /******************************************************************************* 58 + * 59 + * FUNCTION: acpi_get_serial_access_bytes 60 + * 61 + * PARAMETERS: accessor_type - The type of the protocol indicated by region 62 + * field access attributes 63 + * access_length - The access length of the region field 64 + * 65 + * RETURN: Decoded access length 66 + * 67 + * DESCRIPTION: This routine returns the length of the generic_serial_bus 68 + * protocol bytes 69 + * 70 + ******************************************************************************/ 71 + 72 + static u32 73 + acpi_ex_get_serial_access_length(u32 accessor_type, u32 access_length) 74 + { 75 + u32 length; 76 + 77 + switch (accessor_type) { 78 + case AML_FIELD_ATTRIB_QUICK: 79 + 80 + length = 0; 81 + break; 82 + 83 + case AML_FIELD_ATTRIB_SEND_RCV: 84 + case AML_FIELD_ATTRIB_BYTE: 85 + 86 + length = 1; 87 + break; 88 + 89 + case AML_FIELD_ATTRIB_WORD: 90 + case AML_FIELD_ATTRIB_WORD_CALL: 91 + 92 + length = 2; 93 + break; 94 + 95 + case AML_FIELD_ATTRIB_MULTIBYTE: 96 + case AML_FIELD_ATTRIB_RAW_BYTES: 97 + case AML_FIELD_ATTRIB_RAW_PROCESS: 98 + 99 + length = access_length; 100 + break; 101 + 102 + case AML_FIELD_ATTRIB_BLOCK: 103 + case AML_FIELD_ATTRIB_BLOCK_CALL: 104 + default: 105 + 106 + length = ACPI_GSBUS_BUFFER_SIZE; 107 + break; 108 + } 109 + 110 + return (length); 111 + } 51 112 52 113 /******************************************************************************* 53 114 * ··· 124 63 * Buffer, depending on the size of the field. 125 64 * 126 65 ******************************************************************************/ 66 + 127 67 acpi_status 128 - acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, 68 + acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, 129 69 union acpi_operand_object *obj_desc, 130 70 union acpi_operand_object **ret_buffer_desc) 131 71 { ··· 135 73 acpi_size length; 136 74 void *buffer; 137 75 u32 function; 76 + u16 accessor_type; 138 77 139 78 ACPI_FUNCTION_TRACE_PTR(ex_read_data_from_field, obj_desc); 140 79 ··· 179 116 ACPI_READ | (obj_desc->field.attribute << 16); 180 117 } else if (obj_desc->field.region_obj->region.space_id == 181 118 ACPI_ADR_SPACE_GSBUS) { 182 - length = ACPI_GSBUS_BUFFER_SIZE; 183 - function = 184 - ACPI_READ | (obj_desc->field.attribute << 16); 119 + accessor_type = obj_desc->field.attribute; 120 + length = acpi_ex_get_serial_access_length(accessor_type, 121 + obj_desc-> 122 + field. 123 + access_length); 124 + 125 + /* 126 + * Add additional 2 bytes for modeled generic_serial_bus data buffer: 127 + * typedef struct { 128 + * BYTEStatus; // Byte 0 of the data buffer 129 + * BYTELength; // Byte 1 of the data buffer 130 + * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, 131 + * } 132 + */ 133 + length += 2; 134 + function = ACPI_READ | (accessor_type << 16); 185 135 } else { /* IPMI */ 186 136 187 137 length = ACPI_IPMI_BUFFER_SIZE; ··· 307 231 void *buffer; 308 232 union acpi_operand_object *buffer_desc; 309 233 u32 function; 234 + u16 accessor_type; 310 235 311 236 ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc); 312 237 ··· 361 284 ACPI_WRITE | (obj_desc->field.attribute << 16); 362 285 } else if (obj_desc->field.region_obj->region.space_id == 363 286 ACPI_ADR_SPACE_GSBUS) { 364 - length = ACPI_GSBUS_BUFFER_SIZE; 365 - function = 366 - ACPI_WRITE | (obj_desc->field.attribute << 16); 287 + accessor_type = obj_desc->field.attribute; 288 + length = acpi_ex_get_serial_access_length(accessor_type, 289 + obj_desc-> 290 + field. 291 + access_length); 292 + 293 + /* 294 + * Add additional 2 bytes for modeled generic_serial_bus data buffer: 295 + * typedef struct { 296 + * BYTEStatus; // Byte 0 of the data buffer 297 + * BYTELength; // Byte 1 of the data buffer 298 + * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, 299 + * } 300 + */ 301 + length += 2; 302 + function = ACPI_WRITE | (accessor_type << 16); 367 303 } else { /* IPMI */ 368 304 369 305 length = ACPI_IPMI_BUFFER_SIZE;
+2 -3
drivers/acpi/bus.c
··· 380 380 break; 381 381 382 382 default: 383 - acpi_handle_warn(handle, "Unsupported event type 0x%x\n", type); 384 - ost_code = ACPI_OST_SC_UNRECOGNIZED_NOTIFY; 385 - goto err; 383 + acpi_handle_debug(handle, "Unknown event type 0x%x\n", type); 384 + break; 386 385 } 387 386 388 387 adev = acpi_bus_get_acpi_device(handle);
+12 -9
drivers/acpi/ec.c
··· 206 206 spin_unlock_irqrestore(&ec->lock, flags); 207 207 } 208 208 209 - static int acpi_ec_sync_query(struct acpi_ec *ec); 209 + static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data); 210 210 211 211 static int ec_check_sci_sync(struct acpi_ec *ec, u8 state) 212 212 { 213 213 if (state & ACPI_EC_FLAG_SCI) { 214 214 if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) 215 - return acpi_ec_sync_query(ec); 215 + return acpi_ec_sync_query(ec, NULL); 216 216 } 217 217 return 0; 218 218 } ··· 443 443 444 444 EXPORT_SYMBOL(ec_get_handle); 445 445 446 - static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 *data); 447 - 448 446 /* 449 - * Clears stale _Q events that might have accumulated in the EC. 447 + * Process _Q events that might have accumulated in the EC. 450 448 * Run with locked ec mutex. 451 449 */ 452 450 static void acpi_ec_clear(struct acpi_ec *ec) ··· 453 455 u8 value = 0; 454 456 455 457 for (i = 0; i < ACPI_EC_CLEAR_MAX; i++) { 456 - status = acpi_ec_query_unlocked(ec, &value); 458 + status = acpi_ec_sync_query(ec, &value); 457 459 if (status || !value) 458 460 break; 459 461 } ··· 580 582 kfree(handler); 581 583 } 582 584 583 - static int acpi_ec_sync_query(struct acpi_ec *ec) 585 + static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data) 584 586 { 585 587 u8 value = 0; 586 588 int status; 587 589 struct acpi_ec_query_handler *handler, *copy; 588 - if ((status = acpi_ec_query_unlocked(ec, &value))) 590 + 591 + status = acpi_ec_query_unlocked(ec, &value); 592 + if (data) 593 + *data = value; 594 + if (status) 589 595 return status; 596 + 590 597 list_for_each_entry(handler, &ec->list, node) { 591 598 if (value == handler->query_bit) { 592 599 /* have custom handler for this bit */ ··· 615 612 if (!ec) 616 613 return; 617 614 mutex_lock(&ec->mutex); 618 - acpi_ec_sync_query(ec); 615 + acpi_ec_sync_query(ec, NULL); 619 616 mutex_unlock(&ec->mutex); 620 617 } 621 618
+2 -3
drivers/ata/Kconfig
··· 116 116 117 117 config AHCI_IMX 118 118 tristate "Freescale i.MX AHCI SATA support" 119 - depends on MFD_SYSCON 119 + depends on MFD_SYSCON && (ARCH_MXC || COMPILE_TEST) 120 120 help 121 121 This option enables support for the Freescale i.MX SoC's 122 122 onboard AHCI SATA. ··· 134 134 135 135 config AHCI_XGENE 136 136 tristate "APM X-Gene 6.0Gbps AHCI SATA host controller support" 137 - depends on ARM64 || COMPILE_TEST 138 - select PHY_XGENE 137 + depends on PHY_XGENE 139 138 help 140 139 This option enables support for APM X-Gene SoC SATA host controller. 141 140
+21 -14
drivers/ata/ahci.c
··· 1164 1164 #endif 1165 1165 1166 1166 static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports, 1167 - struct ahci_host_priv *hpriv) 1167 + struct ahci_host_priv *hpriv) 1168 1168 { 1169 - int nvec; 1169 + int rc, nvec; 1170 1170 1171 1171 if (hpriv->flags & AHCI_HFLAG_NO_MSI) 1172 1172 goto intx; ··· 1183 1183 if (nvec < n_ports) 1184 1184 goto single_msi; 1185 1185 1186 - nvec = pci_enable_msi_range(pdev, nvec, nvec); 1187 - if (nvec == -ENOSPC) 1186 + rc = pci_enable_msi_exact(pdev, nvec); 1187 + if (rc == -ENOSPC) 1188 1188 goto single_msi; 1189 - else if (nvec < 0) 1189 + else if (rc < 0) 1190 1190 goto intx; 1191 + 1192 + /* fallback to single MSI mode if the controller enforced MRSM mode */ 1193 + if (readl(hpriv->mmio + HOST_CTL) & HOST_MRSM) { 1194 + pci_disable_msi(pdev); 1195 + printk(KERN_INFO "ahci: MRSM is on, fallback to single MSI\n"); 1196 + goto single_msi; 1197 + } 1191 1198 1192 1199 return nvec; 1193 1200 ··· 1239 1232 return rc; 1240 1233 1241 1234 for (i = 0; i < host->n_ports; i++) { 1242 - const char* desc; 1243 1235 struct ahci_port_priv *pp = host->ports[i]->private_data; 1244 1236 1245 - /* pp is NULL for dummy ports */ 1246 - if (pp) 1247 - desc = pp->irq_desc; 1248 - else 1249 - desc = dev_driver_string(host->dev); 1237 + /* Do not receive interrupts sent by dummy ports */ 1238 + if (!pp) { 1239 + disable_irq(irq + i); 1240 + continue; 1241 + } 1250 1242 1251 - rc = devm_request_threaded_irq(host->dev, 1252 - irq + i, ahci_hw_interrupt, ahci_thread_fn, IRQF_SHARED, 1253 - desc, host->ports[i]); 1243 + rc = devm_request_threaded_irq(host->dev, irq + i, 1244 + ahci_hw_interrupt, 1245 + ahci_thread_fn, IRQF_SHARED, 1246 + pp->irq_desc, host->ports[i]); 1254 1247 if (rc) 1255 1248 goto out_free_irqs; 1256 1249 }
+1
drivers/ata/ahci.h
··· 94 94 /* HOST_CTL bits */ 95 95 HOST_RESET = (1 << 0), /* reset controller; self-clear */ 96 96 HOST_IRQ_EN = (1 << 1), /* global IRQ enable */ 97 + HOST_MRSM = (1 << 2), /* MSI Revert to Single Message */ 97 98 HOST_AHCI_EN = (1 << 31), /* AHCI enabled */ 98 99 99 100 /* HOST_CAP bits */
+17 -10
drivers/ata/libata-core.c
··· 4224 4224 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, 4225 4225 4226 4226 /* devices that don't properly handle queued TRIM commands */ 4227 - { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4228 - { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4227 + { "Micron_M500*", "MU0[1-4]*", ATA_HORKAGE_NO_NCQ_TRIM, }, 4228 + { "Crucial_CT???M500SSD*", "MU0[1-4]*", ATA_HORKAGE_NO_NCQ_TRIM, }, 4229 + { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4230 + { "Crucial_CT???M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4229 4231 4230 4232 /* 4231 4233 * Some WD SATA-I drives spin up and down erratically when the link ··· 4794 4792 static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) 4795 4793 { 4796 4794 struct ata_queued_cmd *qc = NULL; 4797 - unsigned int i; 4795 + unsigned int i, tag; 4798 4796 4799 4797 /* no command while frozen */ 4800 4798 if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) 4801 4799 return NULL; 4802 4800 4803 - /* the last tag is reserved for internal command. */ 4804 - for (i = 0; i < ATA_MAX_QUEUE - 1; i++) 4805 - if (!test_and_set_bit(i, &ap->qc_allocated)) { 4806 - qc = __ata_qc_from_tag(ap, i); 4801 + for (i = 0; i < ATA_MAX_QUEUE; i++) { 4802 + tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE; 4803 + 4804 + /* the last tag is reserved for internal command. */ 4805 + if (tag == ATA_TAG_INTERNAL) 4806 + continue; 4807 + 4808 + if (!test_and_set_bit(tag, &ap->qc_allocated)) { 4809 + qc = __ata_qc_from_tag(ap, tag); 4810 + qc->tag = tag; 4811 + ap->last_tag = tag; 4807 4812 break; 4808 4813 } 4809 - 4810 - if (qc) 4811 - qc->tag = i; 4814 + } 4812 4815 4813 4816 return qc; 4814 4817 }
+5 -2
drivers/ata/pata_arasan_cf.c
··· 898 898 899 899 cf_card_detect(acdev, 0); 900 900 901 - return ata_host_activate(host, acdev->irq, irq_handler, 0, 902 - &arasan_cf_sht); 901 + ret = ata_host_activate(host, acdev->irq, irq_handler, 0, 902 + &arasan_cf_sht); 903 + if (!ret) 904 + return 0; 903 905 906 + cf_exit(acdev); 904 907 free_clk: 905 908 clk_put(acdev->clk); 906 909 return ret;
+6 -5
drivers/ata/pata_at91.c
··· 407 407 408 408 host->private_data = info; 409 409 410 - return ata_host_activate(host, gpio_is_valid(irq) ? gpio_to_irq(irq) : 0, 411 - gpio_is_valid(irq) ? ata_sff_interrupt : NULL, 412 - irq_flags, &pata_at91_sht); 410 + ret = ata_host_activate(host, gpio_is_valid(irq) ? gpio_to_irq(irq) : 0, 411 + gpio_is_valid(irq) ? ata_sff_interrupt : NULL, 412 + irq_flags, &pata_at91_sht); 413 + if (ret) 414 + goto err_put; 413 415 414 - if (!ret) 415 - return 0; 416 + return 0; 416 417 417 418 err_put: 418 419 clk_put(info->mck);
+7 -3
drivers/ata/pata_samsung_cf.c
··· 594 594 595 595 platform_set_drvdata(pdev, host); 596 596 597 - return ata_host_activate(host, info->irq, 598 - info->irq ? pata_s3c_irq : NULL, 599 - 0, &pata_s3c_sht); 597 + ret = ata_host_activate(host, info->irq, 598 + info->irq ? pata_s3c_irq : NULL, 599 + 0, &pata_s3c_sht); 600 + if (ret) 601 + goto stop_clk; 602 + 603 + return 0; 600 604 601 605 stop_clk: 602 606 clk_disable(info->clk);
+17
drivers/base/dd.c
··· 52 52 static LIST_HEAD(deferred_probe_pending_list); 53 53 static LIST_HEAD(deferred_probe_active_list); 54 54 static struct workqueue_struct *deferred_wq; 55 + static atomic_t deferred_trigger_count = ATOMIC_INIT(0); 55 56 56 57 /** 57 58 * deferred_probe_work_func() - Retry probing devices in the active list. ··· 136 135 * This functions moves all devices from the pending list to the active 137 136 * list and schedules the deferred probe workqueue to process them. It 138 137 * should be called anytime a driver is successfully bound to a device. 138 + * 139 + * Note, there is a race condition in multi-threaded probe. In the case where 140 + * more than one device is probing at the same time, it is possible for one 141 + * probe to complete successfully while another is about to defer. If the second 142 + * depends on the first, then it will get put on the pending list after the 143 + * trigger event has already occured and will be stuck there. 144 + * 145 + * The atomic 'deferred_trigger_count' is used to determine if a successful 146 + * trigger has occurred in the midst of probing a driver. If the trigger count 147 + * changes in the midst of a probe, then deferred processing should be triggered 148 + * again. 139 149 */ 140 150 static void driver_deferred_probe_trigger(void) 141 151 { ··· 159 147 * into the active list so they can be retried by the workqueue 160 148 */ 161 149 mutex_lock(&deferred_probe_mutex); 150 + atomic_inc(&deferred_trigger_count); 162 151 list_splice_tail_init(&deferred_probe_pending_list, 163 152 &deferred_probe_active_list); 164 153 mutex_unlock(&deferred_probe_mutex); ··· 278 265 static int really_probe(struct device *dev, struct device_driver *drv) 279 266 { 280 267 int ret = 0; 268 + int local_trigger_count = atomic_read(&deferred_trigger_count); 281 269 282 270 atomic_inc(&probe_count); 283 271 pr_debug("bus: '%s': %s: probing driver %s with device %s\n", ··· 324 310 /* Driver requested deferred probing */ 325 311 dev_info(dev, "Driver %s requests probe deferral\n", drv->name); 326 312 driver_deferred_probe_add(dev); 313 + /* Did a trigger occur while probing? Need to re-trigger if yes */ 314 + if (local_trigger_count != atomic_read(&deferred_trigger_count)) 315 + driver_deferred_probe_trigger(); 327 316 } else if (ret != -ENODEV && ret != -ENXIO) { 328 317 /* driver matched but the probe failed */ 329 318 printk(KERN_WARNING
+6 -1
drivers/base/platform.c
··· 13 13 #include <linux/string.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of_device.h> 16 + #include <linux/of_irq.h> 16 17 #include <linux/module.h> 17 18 #include <linux/init.h> 18 19 #include <linux/dma-mapping.h> ··· 88 87 return -ENXIO; 89 88 return dev->archdata.irqs[num]; 90 89 #else 91 - struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); 90 + struct resource *r; 91 + if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) 92 + return of_irq_get(dev->dev.of_node, num); 93 + 94 + r = platform_get_resource(dev, IORESOURCE_IRQ, num); 92 95 93 96 return r ? r->start : -ENXIO; 94 97 #endif
-3
drivers/clk/tegra/clk-tegra124.c
··· 764 764 [tegra_clk_sdmmc2_8] = { .dt_id = TEGRA124_CLK_SDMMC2, .present = true }, 765 765 [tegra_clk_i2s1] = { .dt_id = TEGRA124_CLK_I2S1, .present = true }, 766 766 [tegra_clk_i2c1] = { .dt_id = TEGRA124_CLK_I2C1, .present = true }, 767 - [tegra_clk_ndflash] = { .dt_id = TEGRA124_CLK_NDFLASH, .present = true }, 768 767 [tegra_clk_sdmmc1_8] = { .dt_id = TEGRA124_CLK_SDMMC1, .present = true }, 769 768 [tegra_clk_sdmmc4_8] = { .dt_id = TEGRA124_CLK_SDMMC4, .present = true }, 770 769 [tegra_clk_pwm] = { .dt_id = TEGRA124_CLK_PWM, .present = true }, ··· 808 809 [tegra_clk_trace] = { .dt_id = TEGRA124_CLK_TRACE, .present = true }, 809 810 [tegra_clk_soc_therm] = { .dt_id = TEGRA124_CLK_SOC_THERM, .present = true }, 810 811 [tegra_clk_dtv] = { .dt_id = TEGRA124_CLK_DTV, .present = true }, 811 - [tegra_clk_ndspeed] = { .dt_id = TEGRA124_CLK_NDSPEED, .present = true }, 812 812 [tegra_clk_i2cslow] = { .dt_id = TEGRA124_CLK_I2CSLOW, .present = true }, 813 813 [tegra_clk_dsib] = { .dt_id = TEGRA124_CLK_DSIB, .present = true }, 814 814 [tegra_clk_tsec] = { .dt_id = TEGRA124_CLK_TSEC, .present = true }, ··· 950 952 [tegra_clk_clk_out_3_mux] = { .dt_id = TEGRA124_CLK_CLK_OUT_3_MUX, .present = true }, 951 953 [tegra_clk_dsia_mux] = { .dt_id = TEGRA124_CLK_DSIA_MUX, .present = true }, 952 954 [tegra_clk_dsib_mux] = { .dt_id = TEGRA124_CLK_DSIB_MUX, .present = true }, 953 - [tegra_clk_uarte] = { .dt_id = TEGRA124_CLK_UARTE, .present = true }, 954 955 }; 955 956 956 957 static struct tegra_devclk devclks[] __initdata = {
+1 -1
drivers/clk/versatile/clk-vexpress-osc.c
··· 102 102 103 103 osc = kzalloc(sizeof(*osc), GFP_KERNEL); 104 104 if (!osc) 105 - goto error; 105 + return; 106 106 107 107 osc->func = vexpress_config_func_get_by_node(node); 108 108 if (!osc->func) {
+5 -1
drivers/clocksource/arm_arch_timer.c
··· 66 66 static struct clock_event_device __percpu *arch_timer_evt; 67 67 68 68 static bool arch_timer_use_virtual = true; 69 + static bool arch_timer_c3stop; 69 70 static bool arch_timer_mem_use_virtual; 70 71 71 72 /* ··· 264 263 clk->features = CLOCK_EVT_FEAT_ONESHOT; 265 264 266 265 if (type == ARCH_CP15_TIMER) { 267 - clk->features |= CLOCK_EVT_FEAT_C3STOP; 266 + if (arch_timer_c3stop) 267 + clk->features |= CLOCK_EVT_FEAT_C3STOP; 268 268 clk->name = "arch_sys_timer"; 269 269 clk->rating = 450; 270 270 clk->cpumask = cpumask_of(smp_processor_id()); ··· 666 664 return; 667 665 } 668 666 } 667 + 668 + arch_timer_c3stop = !of_property_read_bool(np, "always-on"); 669 669 670 670 arch_timer_register(); 671 671 arch_timer_common_init();
+3 -9
drivers/clocksource/exynos_mct.c
··· 416 416 evt->set_mode = exynos4_tick_set_mode; 417 417 evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; 418 418 evt->rating = 450; 419 - clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1), 420 - 0xf, 0x7fffffff); 421 419 422 420 exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); 423 421 ··· 428 430 evt->irq); 429 431 return -EIO; 430 432 } 433 + irq_force_affinity(mct_irqs[MCT_L0_IRQ + cpu], cpumask_of(cpu)); 431 434 } else { 432 435 enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0); 433 436 } 437 + clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1), 438 + 0xf, 0x7fffffff); 434 439 435 440 return 0; 436 441 } ··· 451 450 unsigned long action, void *hcpu) 452 451 { 453 452 struct mct_clock_event_device *mevt; 454 - unsigned int cpu; 455 453 456 454 /* 457 455 * Grab cpu pointer in each case to avoid spurious ··· 460 460 case CPU_STARTING: 461 461 mevt = this_cpu_ptr(&percpu_mct_tick); 462 462 exynos4_local_timer_setup(&mevt->evt); 463 - break; 464 - case CPU_ONLINE: 465 - cpu = (unsigned long)hcpu; 466 - if (mct_int_type == MCT_INT_SPI) 467 - irq_set_affinity(mct_irqs[MCT_L0_IRQ + cpu], 468 - cpumask_of(cpu)); 469 463 break; 470 464 case CPU_DYING: 471 465 mevt = this_cpu_ptr(&percpu_mct_tick);
+6 -1
drivers/clocksource/zevio-timer.c
··· 212 212 return ret; 213 213 } 214 214 215 - CLOCKSOURCE_OF_DECLARE(zevio_timer, "lsi,zevio-timer", zevio_timer_add); 215 + static void __init zevio_timer_init(struct device_node *node) 216 + { 217 + BUG_ON(zevio_timer_add(node)); 218 + } 219 + 220 + CLOCKSOURCE_OF_DECLARE(zevio_timer, "lsi,zevio-timer", zevio_timer_init);
+1 -5
drivers/cpufreq/Kconfig.arm
··· 92 92 93 93 config ARM_HIGHBANK_CPUFREQ 94 94 tristate "Calxeda Highbank-based" 95 - depends on ARCH_HIGHBANK 96 - select GENERIC_CPUFREQ_CPU0 97 - select PM_OPP 98 - select REGULATOR 99 - 95 + depends on ARCH_HIGHBANK && GENERIC_CPUFREQ_CPU0 && REGULATOR 100 96 default m 101 97 help 102 98 This adds the CPUFreq driver for Calxeda Highbank SoC
+24 -12
drivers/cpufreq/longhaul.c
··· 242 242 * Sets a new clock ratio. 243 243 */ 244 244 245 - static void longhaul_setstate(struct cpufreq_policy *policy, 245 + static int longhaul_setstate(struct cpufreq_policy *policy, 246 246 unsigned int table_index) 247 247 { 248 248 unsigned int mults_index; ··· 258 258 /* Safety precautions */ 259 259 mult = mults[mults_index & 0x1f]; 260 260 if (mult == -1) 261 - return; 261 + return -EINVAL; 262 + 262 263 speed = calc_speed(mult); 263 264 if ((speed > highest_speed) || (speed < lowest_speed)) 264 - return; 265 + return -EINVAL; 266 + 265 267 /* Voltage transition before frequency transition? */ 266 268 if (can_scale_voltage && longhaul_index < table_index) 267 269 dir = 1; 268 270 269 271 freqs.old = calc_speed(longhaul_get_cpu_mult()); 270 272 freqs.new = speed; 271 - 272 - cpufreq_freq_transition_begin(policy, &freqs); 273 273 274 274 pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", 275 275 fsb, mult/10, mult%10, print_speed(speed/1000)); ··· 385 385 goto retry_loop; 386 386 } 387 387 } 388 - /* Report true CPU frequency */ 389 - cpufreq_freq_transition_end(policy, &freqs, 0); 390 388 391 - if (!bm_timeout) 389 + if (!bm_timeout) { 392 390 printk(KERN_INFO PFX "Warning: Timeout while waiting for " 393 391 "idle PCI bus.\n"); 392 + return -EBUSY; 393 + } 394 + 395 + return 0; 394 396 } 395 397 396 398 /* ··· 633 631 unsigned int i; 634 632 unsigned int dir = 0; 635 633 u8 vid, current_vid; 634 + int retval = 0; 636 635 637 636 if (!can_scale_voltage) 638 - longhaul_setstate(policy, table_index); 637 + retval = longhaul_setstate(policy, table_index); 639 638 else { 640 639 /* On test system voltage transitions exceeding single 641 640 * step up or down were turning motherboard off. Both ··· 651 648 while (i != table_index) { 652 649 vid = (longhaul_table[i].driver_data >> 8) & 0x1f; 653 650 if (vid != current_vid) { 654 - longhaul_setstate(policy, i); 651 + retval = longhaul_setstate(policy, i); 655 652 current_vid = vid; 656 653 msleep(200); 657 654 } ··· 660 657 else 661 658 i--; 662 659 } 663 - longhaul_setstate(policy, table_index); 660 + retval = longhaul_setstate(policy, table_index); 664 661 } 662 + 665 663 longhaul_index = table_index; 666 - return 0; 664 + return retval; 667 665 } 668 666 669 667 ··· 972 968 973 969 for (i = 0; i < numscales; i++) { 974 970 if (mults[i] == maxmult) { 971 + struct cpufreq_freqs freqs; 972 + 973 + freqs.old = policy->cur; 974 + freqs.new = longhaul_table[i].frequency; 975 + freqs.flags = 0; 976 + 977 + cpufreq_freq_transition_begin(policy, &freqs); 975 978 longhaul_setstate(policy, i); 979 + cpufreq_freq_transition_end(policy, &freqs, 0); 976 980 break; 977 981 } 978 982 }
+13 -10
drivers/cpufreq/powernow-k6.c
··· 138 138 static int powernow_k6_target(struct cpufreq_policy *policy, 139 139 unsigned int best_i) 140 140 { 141 - struct cpufreq_freqs freqs; 142 141 143 142 if (clock_ratio[best_i].driver_data > max_multiplier) { 144 143 printk(KERN_ERR PFX "invalid target frequency\n"); 145 144 return -EINVAL; 146 145 } 147 146 148 - freqs.old = busfreq * powernow_k6_get_cpu_multiplier(); 149 - freqs.new = busfreq * clock_ratio[best_i].driver_data; 150 - 151 - cpufreq_freq_transition_begin(policy, &freqs); 152 - 153 147 powernow_k6_set_cpu_multiplier(best_i); 154 - 155 - cpufreq_freq_transition_end(policy, &freqs, 0); 156 148 157 149 return 0; 158 150 } ··· 219 227 static int powernow_k6_cpu_exit(struct cpufreq_policy *policy) 220 228 { 221 229 unsigned int i; 222 - for (i = 0; i < 8; i++) { 223 - if (i == max_multiplier) 230 + 231 + for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) { 232 + if (clock_ratio[i].driver_data == max_multiplier) { 233 + struct cpufreq_freqs freqs; 234 + 235 + freqs.old = policy->cur; 236 + freqs.new = clock_ratio[i].frequency; 237 + freqs.flags = 0; 238 + 239 + cpufreq_freq_transition_begin(policy, &freqs); 224 240 powernow_k6_target(policy, i); 241 + cpufreq_freq_transition_end(policy, &freqs, 0); 242 + break; 243 + } 225 244 } 226 245 return 0; 227 246 }
-4
drivers/cpufreq/powernow-k7.c
··· 269 269 270 270 freqs.new = powernow_table[index].frequency; 271 271 272 - cpufreq_freq_transition_begin(policy, &freqs); 273 - 274 272 /* Now do the magic poking into the MSRs. */ 275 273 276 274 if (have_a0 == 1) /* A0 errata 5 */ ··· 287 289 288 290 if (have_a0 == 1) 289 291 local_irq_enable(); 290 - 291 - cpufreq_freq_transition_end(policy, &freqs, 0); 292 292 293 293 return 0; 294 294 }
+1
drivers/cpufreq/powernv-cpufreq.c
··· 29 29 30 30 #include <asm/cputhreads.h> 31 31 #include <asm/reg.h> 32 + #include <asm/smp.h> /* Required for cpu_sibling_mask() in UP configs */ 32 33 33 34 #define POWERNV_MAX_PSTATES 256 34 35
+4 -1
drivers/cpufreq/ppc-corenet-cpufreq.c
··· 138 138 struct cpufreq_frequency_table *table; 139 139 struct cpu_data *data; 140 140 unsigned int cpu = policy->cpu; 141 + u64 transition_latency_hz; 141 142 142 143 np = of_get_cpu_node(cpu, NULL); 143 144 if (!np) ··· 206 205 for_each_cpu(i, per_cpu(cpu_mask, cpu)) 207 206 per_cpu(cpu_data, i) = data; 208 207 208 + transition_latency_hz = 12ULL * NSEC_PER_SEC; 209 209 policy->cpuinfo.transition_latency = 210 - (12 * NSEC_PER_SEC) / fsl_get_sys_freq(); 210 + do_div(transition_latency_hz, fsl_get_sys_freq()); 211 + 211 212 of_node_put(np); 212 213 213 214 return 0;
+1 -3
drivers/cpufreq/unicore2-cpufreq.c
··· 60 60 policy->max = policy->cpuinfo.max_freq = 1000000; 61 61 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 62 62 policy->clk = clk_get(NULL, "MAIN_CLK"); 63 - if (IS_ERR(policy->clk)) 64 - return PTR_ERR(policy->clk); 65 - return 0; 63 + return PTR_ERR_OR_ZERO(policy->clk); 66 64 } 67 65 68 66 static struct cpufreq_driver ucv2_driver = {
+9 -3
drivers/gpio/gpiolib-acpi.c
··· 233 233 { 234 234 struct gpio_chip *chip = acpi_gpio->chip; 235 235 236 - if (!chip->dev || !chip->to_irq) 236 + if (!chip->to_irq) 237 237 return; 238 238 239 239 INIT_LIST_HEAD(&acpi_gpio->events); ··· 253 253 struct acpi_gpio_event *event, *ep; 254 254 struct gpio_chip *chip = acpi_gpio->chip; 255 255 256 - if (!chip->dev || !chip->to_irq) 256 + if (!chip->to_irq) 257 257 return; 258 258 259 259 list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) { ··· 451 451 if (function == ACPI_WRITE) 452 452 gpiod_set_raw_value(desc, !!((1 << i) & *value)); 453 453 else 454 - *value |= gpiod_get_raw_value(desc) << i; 454 + *value |= (u64)gpiod_get_raw_value(desc) << i; 455 455 } 456 456 457 457 out: ··· 501 501 acpi_handle handle; 502 502 acpi_status status; 503 503 504 + if (!chip || !chip->dev) 505 + return; 506 + 504 507 handle = ACPI_HANDLE(chip->dev); 505 508 if (!handle) 506 509 return; ··· 533 530 struct acpi_gpio_chip *acpi_gpio; 534 531 acpi_handle handle; 535 532 acpi_status status; 533 + 534 + if (!chip || !chip->dev) 535 + return; 536 536 537 537 handle = ACPI_HANDLE(chip->dev); 538 538 if (!handle)
+1 -1
drivers/gpio/gpiolib.c
··· 1387 1387 { 1388 1388 struct gpio_chip *chip = d->host_data; 1389 1389 1390 - irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler); 1391 1390 irq_set_chip_data(irq, chip); 1391 + irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler); 1392 1392 #ifdef CONFIG_ARM 1393 1393 set_irq_flags(irq, IRQF_VALID); 1394 1394 #else
+1
drivers/gpu/drm/exynos/exynos_drm_crtc.c
··· 145 145 146 146 plane->crtc = crtc; 147 147 plane->fb = crtc->primary->fb; 148 + drm_framebuffer_reference(plane->fb); 148 149 149 150 return 0; 150 151 }
+1 -1
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
··· 263 263 buffer->sgt = sgt; 264 264 exynos_gem_obj->base.import_attach = attach; 265 265 266 - DRM_DEBUG_PRIME("dma_addr = 0x%x, size = 0x%lx\n", buffer->dma_addr, 266 + DRM_DEBUG_PRIME("dma_addr = %pad, size = 0x%lx\n", &buffer->dma_addr, 267 267 buffer->size); 268 268 269 269 return &exynos_gem_obj->base;
+2 -2
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1426 1426 1427 1427 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1428 1428 dsi->reg_base = devm_ioremap_resource(&pdev->dev, res); 1429 - if (!dsi->reg_base) { 1429 + if (IS_ERR(dsi->reg_base)) { 1430 1430 dev_err(&pdev->dev, "failed to remap io region\n"); 1431 - return -EADDRNOTAVAIL; 1431 + return PTR_ERR(dsi->reg_base); 1432 1432 } 1433 1433 1434 1434 dsi->phy = devm_phy_get(&pdev->dev, "dsim");
+1 -1
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 220 220 221 221 win_data->enabled = true; 222 222 223 - DRM_DEBUG_KMS("dma_addr = 0x%x\n", win_data->dma_addr); 223 + DRM_DEBUG_KMS("dma_addr = %pad\n", &win_data->dma_addr); 224 224 225 225 if (ctx->vblank_on) 226 226 schedule_work(&ctx->work);
+1 -1
drivers/gpu/drm/i915/i915_gem_gtt.c
··· 50 50 51 51 /* Full ppgtt disabled by default for now due to issues. */ 52 52 if (full) 53 - return false; /* HAS_PPGTT(dev) */ 53 + return HAS_PPGTT(dev) && (i915.enable_ppgtt == 2); 54 54 else 55 55 return HAS_ALIASING_PPGTT(dev); 56 56 }
+14 -4
drivers/gpu/drm/i915/i915_irq.c
··· 1362 1362 spin_lock(&dev_priv->irq_lock); 1363 1363 for (i = 1; i < HPD_NUM_PINS; i++) { 1364 1364 1365 - WARN_ONCE(hpd[i] & hotplug_trigger && 1366 - dev_priv->hpd_stats[i].hpd_mark == HPD_DISABLED, 1367 - "Received HPD interrupt (0x%08x) on pin %d (0x%08x) although disabled\n", 1368 - hotplug_trigger, i, hpd[i]); 1365 + if (hpd[i] & hotplug_trigger && 1366 + dev_priv->hpd_stats[i].hpd_mark == HPD_DISABLED) { 1367 + /* 1368 + * On GMCH platforms the interrupt mask bits only 1369 + * prevent irq generation, not the setting of the 1370 + * hotplug bits itself. So only WARN about unexpected 1371 + * interrupts on saner platforms. 1372 + */ 1373 + WARN_ONCE(INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev), 1374 + "Received HPD interrupt (0x%08x) on pin %d (0x%08x) although disabled\n", 1375 + hotplug_trigger, i, hpd[i]); 1376 + 1377 + continue; 1378 + } 1369 1379 1370 1380 if (!(hpd[i] & hotplug_trigger) || 1371 1381 dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
+1
drivers/gpu/drm/i915/i915_reg.h
··· 827 827 # define MI_FLUSH_ENABLE (1 << 12) 828 828 # define ASYNC_FLIP_PERF_DISABLE (1 << 14) 829 829 # define MODE_IDLE (1 << 9) 830 + # define STOP_RING (1 << 8) 830 831 831 832 #define GEN6_GT_MODE 0x20d0 832 833 #define GEN7_GT_MODE 0x7008
+18 -5
drivers/gpu/drm/i915/intel_display.c
··· 9654 9654 PIPE_CONF_CHECK_I(pipe_src_w); 9655 9655 PIPE_CONF_CHECK_I(pipe_src_h); 9656 9656 9657 - PIPE_CONF_CHECK_I(gmch_pfit.control); 9658 - /* pfit ratios are autocomputed by the hw on gen4+ */ 9659 - if (INTEL_INFO(dev)->gen < 4) 9660 - PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); 9661 - PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); 9657 + /* 9658 + * FIXME: BIOS likes to set up a cloned config with lvds+external 9659 + * screen. Since we don't yet re-compute the pipe config when moving 9660 + * just the lvds port away to another pipe the sw tracking won't match. 9661 + * 9662 + * Proper atomic modesets with recomputed global state will fix this. 9663 + * Until then just don't check gmch state for inherited modes. 9664 + */ 9665 + if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_INHERITED_MODE)) { 9666 + PIPE_CONF_CHECK_I(gmch_pfit.control); 9667 + /* pfit ratios are autocomputed by the hw on gen4+ */ 9668 + if (INTEL_INFO(dev)->gen < 4) 9669 + PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); 9670 + PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); 9671 + } 9672 + 9662 9673 PIPE_CONF_CHECK_I(pch_pfit.enabled); 9663 9674 if (current_config->pch_pfit.enabled) { 9664 9675 PIPE_CONF_CHECK_I(pch_pfit.pos); ··· 11626 11615 list_for_each_entry(crtc, &dev->mode_config.crtc_list, 11627 11616 base.head) { 11628 11617 memset(&crtc->config, 0, sizeof(crtc->config)); 11618 + 11619 + crtc->config.quirks |= PIPE_CONFIG_QUIRK_INHERITED_MODE; 11629 11620 11630 11621 crtc->active = dev_priv->display.get_pipe_config(crtc, 11631 11622 &crtc->config);
+10 -1
drivers/gpu/drm/i915/intel_dp.c
··· 3619 3619 { 3620 3620 struct drm_connector *connector = &intel_connector->base; 3621 3621 struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); 3622 - struct drm_device *dev = intel_dig_port->base.base.dev; 3622 + struct intel_encoder *intel_encoder = &intel_dig_port->base; 3623 + struct drm_device *dev = intel_encoder->base.dev; 3623 3624 struct drm_i915_private *dev_priv = dev->dev_private; 3624 3625 struct drm_display_mode *fixed_mode = NULL; 3625 3626 bool has_dpcd; ··· 3629 3628 3630 3629 if (!is_edp(intel_dp)) 3631 3630 return true; 3631 + 3632 + /* The VDD bit needs a power domain reference, so if the bit is already 3633 + * enabled when we boot, grab this reference. */ 3634 + if (edp_have_panel_vdd(intel_dp)) { 3635 + enum intel_display_power_domain power_domain; 3636 + power_domain = intel_display_port_power_domain(intel_encoder); 3637 + intel_display_power_get(dev_priv, power_domain); 3638 + } 3632 3639 3633 3640 /* Cache DPCD and EDID for edp. */ 3634 3641 intel_edp_panel_vdd_on(intel_dp);
+2 -1
drivers/gpu/drm/i915/intel_drv.h
··· 236 236 * tracked with quirk flags so that fastboot and state checker can act 237 237 * accordingly. 238 238 */ 239 - #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */ 239 + #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */ 240 + #define PIPE_CONFIG_QUIRK_INHERITED_MODE (1<<1) /* mode inherited from firmware */ 240 241 unsigned long quirks; 241 242 242 243 /* User requested mode, only valid as a starting point to
+10
drivers/gpu/drm/i915/intel_fbdev.c
··· 132 132 133 133 mutex_lock(&dev->struct_mutex); 134 134 135 + if (intel_fb && 136 + (sizes->fb_width > intel_fb->base.width || 137 + sizes->fb_height > intel_fb->base.height)) { 138 + DRM_DEBUG_KMS("BIOS fb too small (%dx%d), we require (%dx%d)," 139 + " releasing it\n", 140 + intel_fb->base.width, intel_fb->base.height, 141 + sizes->fb_width, sizes->fb_height); 142 + drm_framebuffer_unreference(&intel_fb->base); 143 + intel_fb = ifbdev->fb = NULL; 144 + } 135 145 if (!intel_fb || WARN_ON(!intel_fb->obj)) { 136 146 DRM_DEBUG_KMS("no BIOS fb, allocating a new one\n"); 137 147 ret = intelfb_alloc(helper, sizes);
+5 -4
drivers/gpu/drm/i915/intel_hdmi.c
··· 821 821 } 822 822 } 823 823 824 - static int hdmi_portclock_limit(struct intel_hdmi *hdmi) 824 + static int hdmi_portclock_limit(struct intel_hdmi *hdmi, bool respect_dvi_limit) 825 825 { 826 826 struct drm_device *dev = intel_hdmi_to_dev(hdmi); 827 827 828 - if (!hdmi->has_hdmi_sink || IS_G4X(dev)) 828 + if ((respect_dvi_limit && !hdmi->has_hdmi_sink) || IS_G4X(dev)) 829 829 return 165000; 830 830 else if (IS_HASWELL(dev) || INTEL_INFO(dev)->gen >= 8) 831 831 return 300000; ··· 837 837 intel_hdmi_mode_valid(struct drm_connector *connector, 838 838 struct drm_display_mode *mode) 839 839 { 840 - if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector))) 840 + if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector), 841 + true)) 841 842 return MODE_CLOCK_HIGH; 842 843 if (mode->clock < 20000) 843 844 return MODE_CLOCK_LOW; ··· 880 879 struct drm_device *dev = encoder->base.dev; 881 880 struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; 882 881 int clock_12bpc = pipe_config->adjusted_mode.crtc_clock * 3 / 2; 883 - int portclock_limit = hdmi_portclock_limit(intel_hdmi); 882 + int portclock_limit = hdmi_portclock_limit(intel_hdmi, false); 884 883 int desired_bpp; 885 884 886 885 if (intel_hdmi->color_range_auto) {
+34 -20
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 437 437 I915_WRITE(HWS_PGA, addr); 438 438 } 439 439 440 + static bool stop_ring(struct intel_ring_buffer *ring) 441 + { 442 + struct drm_i915_private *dev_priv = to_i915(ring->dev); 443 + 444 + if (!IS_GEN2(ring->dev)) { 445 + I915_WRITE_MODE(ring, _MASKED_BIT_ENABLE(STOP_RING)); 446 + if (wait_for_atomic((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) { 447 + DRM_ERROR("%s :timed out trying to stop ring\n", ring->name); 448 + return false; 449 + } 450 + } 451 + 452 + I915_WRITE_CTL(ring, 0); 453 + I915_WRITE_HEAD(ring, 0); 454 + ring->write_tail(ring, 0); 455 + 456 + if (!IS_GEN2(ring->dev)) { 457 + (void)I915_READ_CTL(ring); 458 + I915_WRITE_MODE(ring, _MASKED_BIT_DISABLE(STOP_RING)); 459 + } 460 + 461 + return (I915_READ_HEAD(ring) & HEAD_ADDR) == 0; 462 + } 463 + 440 464 static int init_ring_common(struct intel_ring_buffer *ring) 441 465 { 442 466 struct drm_device *dev = ring->dev; 443 467 struct drm_i915_private *dev_priv = dev->dev_private; 444 468 struct drm_i915_gem_object *obj = ring->obj; 445 469 int ret = 0; 446 - u32 head; 447 470 448 471 gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL); 449 472 450 - /* Stop the ring if it's running. */ 451 - I915_WRITE_CTL(ring, 0); 452 - I915_WRITE_HEAD(ring, 0); 453 - ring->write_tail(ring, 0); 454 - if (wait_for_atomic((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) 455 - DRM_ERROR("%s :timed out trying to stop ring\n", ring->name); 456 - 457 - if (I915_NEED_GFX_HWS(dev)) 458 - intel_ring_setup_status_page(ring); 459 - else 460 - ring_setup_phys_status_page(ring); 461 - 462 - head = I915_READ_HEAD(ring) & HEAD_ADDR; 463 - 464 - /* G45 ring initialization fails to reset head to zero */ 465 - if (head != 0) { 473 + if (!stop_ring(ring)) { 474 + /* G45 ring initialization often fails to reset head to zero */ 466 475 DRM_DEBUG_KMS("%s head not reset to zero " 467 476 "ctl %08x head %08x tail %08x start %08x\n", 468 477 ring->name, ··· 480 471 I915_READ_TAIL(ring), 481 472 I915_READ_START(ring)); 482 473 483 - I915_WRITE_HEAD(ring, 0); 484 - 485 - if (I915_READ_HEAD(ring) & HEAD_ADDR) { 474 + if (!stop_ring(ring)) { 486 475 DRM_ERROR("failed to set %s head to zero " 487 476 "ctl %08x head %08x tail %08x start %08x\n", 488 477 ring->name, ··· 488 481 I915_READ_HEAD(ring), 489 482 I915_READ_TAIL(ring), 490 483 I915_READ_START(ring)); 484 + ret = -EIO; 485 + goto out; 491 486 } 492 487 } 488 + 489 + if (I915_NEED_GFX_HWS(dev)) 490 + intel_ring_setup_status_page(ring); 491 + else 492 + ring_setup_phys_status_page(ring); 493 493 494 494 /* Initialize the ring. This must happen _after_ we've cleared the ring 495 495 * registers with the above sequence (the readback of the HEAD registers
+1
drivers/gpu/drm/i915/intel_ringbuffer.h
··· 34 34 #define I915_WRITE_IMR(ring, val) I915_WRITE(RING_IMR((ring)->mmio_base), val) 35 35 36 36 #define I915_READ_MODE(ring) I915_READ(RING_MI_MODE((ring)->mmio_base)) 37 + #define I915_WRITE_MODE(ring, val) I915_WRITE(RING_MI_MODE((ring)->mmio_base), val) 37 38 38 39 enum intel_ring_hangcheck_action { 39 40 HANGCHECK_IDLE = 0,
+3 -6
drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
··· 510 510 MDP4_DMA_CURSOR_BLEND_CONFIG_CURSOR_EN); 511 511 } else { 512 512 /* disable cursor: */ 513 - mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_BASE(dma), 0); 514 - mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_BLEND_CONFIG(dma), 515 - MDP4_DMA_CURSOR_BLEND_CONFIG_FORMAT(CURSOR_ARGB)); 513 + mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_BASE(dma), 514 + mdp4_kms->blank_cursor_iova); 516 515 } 517 516 518 517 /* and drop the iova ref + obj rev when done scanning out: */ ··· 573 574 574 575 if (old_bo) { 575 576 /* drop our previous reference: */ 576 - msm_gem_put_iova(old_bo, mdp4_kms->id); 577 - drm_gem_object_unreference_unlocked(old_bo); 577 + drm_flip_work_queue(&mdp4_crtc->unref_cursor_work, old_bo); 578 578 } 579 579 580 - crtc_flush(crtc); 581 580 request_pending(crtc, PENDING_CURSOR); 582 581 583 582 return 0;
+2 -2
drivers/gpu/drm/msm/mdp/mdp4/mdp4_irq.c
··· 70 70 71 71 VERB("status=%08x", status); 72 72 73 + mdp_dispatch_irqs(mdp_kms, status); 74 + 73 75 for (id = 0; id < priv->num_crtcs; id++) 74 76 if (status & mdp4_crtc_vblank(priv->crtcs[id])) 75 77 drm_handle_vblank(dev, id); 76 - 77 - mdp_dispatch_irqs(mdp_kms, status); 78 78 79 79 return IRQ_HANDLED; 80 80 }
+21
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
··· 144 144 static void mdp4_destroy(struct msm_kms *kms) 145 145 { 146 146 struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms)); 147 + if (mdp4_kms->blank_cursor_iova) 148 + msm_gem_put_iova(mdp4_kms->blank_cursor_bo, mdp4_kms->id); 149 + if (mdp4_kms->blank_cursor_bo) 150 + drm_gem_object_unreference(mdp4_kms->blank_cursor_bo); 147 151 kfree(mdp4_kms); 148 152 } 149 153 ··· 373 369 ret = modeset_init(mdp4_kms); 374 370 if (ret) { 375 371 dev_err(dev->dev, "modeset_init failed: %d\n", ret); 372 + goto fail; 373 + } 374 + 375 + mutex_lock(&dev->struct_mutex); 376 + mdp4_kms->blank_cursor_bo = msm_gem_new(dev, SZ_16K, MSM_BO_WC); 377 + mutex_unlock(&dev->struct_mutex); 378 + if (IS_ERR(mdp4_kms->blank_cursor_bo)) { 379 + ret = PTR_ERR(mdp4_kms->blank_cursor_bo); 380 + dev_err(dev->dev, "could not allocate blank-cursor bo: %d\n", ret); 381 + mdp4_kms->blank_cursor_bo = NULL; 382 + goto fail; 383 + } 384 + 385 + ret = msm_gem_get_iova(mdp4_kms->blank_cursor_bo, mdp4_kms->id, 386 + &mdp4_kms->blank_cursor_iova); 387 + if (ret) { 388 + dev_err(dev->dev, "could not pin blank-cursor bo: %d\n", ret); 376 389 goto fail; 377 390 } 378 391
+4
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
··· 44 44 struct clk *lut_clk; 45 45 46 46 struct mdp_irq error_handler; 47 + 48 + /* empty/blank cursor bo to use when cursor is "disabled" */ 49 + struct drm_gem_object *blank_cursor_bo; 50 + uint32_t blank_cursor_iova; 47 51 }; 48 52 #define to_mdp4_kms(x) container_of(x, struct mdp4_kms, base) 49 53
+2 -2
drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c
··· 71 71 72 72 VERB("status=%08x", status); 73 73 74 + mdp_dispatch_irqs(mdp_kms, status); 75 + 74 76 for (id = 0; id < priv->num_crtcs; id++) 75 77 if (status & mdp5_crtc_vblank(priv->crtcs[id])) 76 78 drm_handle_vblank(dev, id); 77 - 78 - mdp_dispatch_irqs(mdp_kms, status); 79 79 } 80 80 81 81 irqreturn_t mdp5_irq(struct msm_kms *kms)
+1 -4
drivers/gpu/drm/msm/msm_fbdev.c
··· 62 62 dma_addr_t paddr; 63 63 int ret, size; 64 64 65 - /* only doing ARGB32 since this is what is needed to alpha-blend 66 - * with video overlays: 67 - */ 68 65 sizes->surface_bpp = 32; 69 - sizes->surface_depth = 32; 66 + sizes->surface_depth = 24; 70 67 71 68 DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width, 72 69 sizes->surface_height, sizes->surface_bpp,
+3 -1
drivers/gpu/drm/msm/msm_gem.c
··· 118 118 119 119 if (iommu_present(&platform_bus_type)) 120 120 drm_gem_put_pages(obj, msm_obj->pages, true, false); 121 - else 121 + else { 122 122 drm_mm_remove_node(msm_obj->vram_node); 123 + drm_free_large(msm_obj->pages); 124 + } 123 125 124 126 msm_obj->pages = NULL; 125 127 }
+1
drivers/gpu/drm/radeon/atombios_dp.c
··· 209 209 { 210 210 int ret; 211 211 212 + radeon_connector->ddc_bus->rec.hpd = radeon_connector->hpd.hpd; 212 213 radeon_connector->ddc_bus->aux.dev = radeon_connector->base.kdev; 213 214 radeon_connector->ddc_bus->aux.transfer = radeon_dp_aux_transfer; 214 215 ret = drm_dp_aux_register_i2c_bus(&radeon_connector->ddc_bus->aux);
+1 -1
drivers/gpu/drm/radeon/cik_sdma.c
··· 597 597 tmp = 0xCAFEDEAD; 598 598 writel(tmp, ptr); 599 599 600 - r = radeon_ring_lock(rdev, ring, 4); 600 + r = radeon_ring_lock(rdev, ring, 5); 601 601 if (r) { 602 602 DRM_ERROR("radeon: dma failed to lock ring %d (%d).\n", ring->idx, r); 603 603 return r;
+19 -16
drivers/gpu/drm/radeon/r600_dpm.c
··· 158 158 u32 line_time_us, vblank_lines; 159 159 u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */ 160 160 161 - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 162 - radeon_crtc = to_radeon_crtc(crtc); 163 - if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { 164 - line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) / 165 - radeon_crtc->hw_mode.clock; 166 - vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end - 167 - radeon_crtc->hw_mode.crtc_vdisplay + 168 - (radeon_crtc->v_border * 2); 169 - vblank_time_us = vblank_lines * line_time_us; 170 - break; 161 + if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { 162 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 163 + radeon_crtc = to_radeon_crtc(crtc); 164 + if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { 165 + line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) / 166 + radeon_crtc->hw_mode.clock; 167 + vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end - 168 + radeon_crtc->hw_mode.crtc_vdisplay + 169 + (radeon_crtc->v_border * 2); 170 + vblank_time_us = vblank_lines * line_time_us; 171 + break; 172 + } 171 173 } 172 174 } 173 175 ··· 183 181 struct radeon_crtc *radeon_crtc; 184 182 u32 vrefresh = 0; 185 183 186 - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 187 - radeon_crtc = to_radeon_crtc(crtc); 188 - if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { 189 - vrefresh = radeon_crtc->hw_mode.vrefresh; 190 - break; 184 + if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { 185 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 186 + radeon_crtc = to_radeon_crtc(crtc); 187 + if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { 188 + vrefresh = radeon_crtc->hw_mode.vrefresh; 189 + break; 190 + } 191 191 } 192 192 } 193 - 194 193 return vrefresh; 195 194 } 196 195
+7
drivers/gpu/drm/radeon/radeon_atpx_handler.c
··· 528 528 has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); 529 529 } 530 530 531 + /* some newer PX laptops mark the dGPU as a non-VGA display device */ 532 + while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) { 533 + vga_count++; 534 + 535 + has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); 536 + } 537 + 531 538 if (has_atpx && vga_count == 2) { 532 539 acpi_get_name(radeon_atpx_priv.atpx.handle, ACPI_FULL_PATHNAME, &buffer); 533 540 printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
+57 -27
drivers/gpu/drm/radeon/radeon_display.c
··· 840 840 } 841 841 842 842 /** 843 + * avivo_get_fb_ref_div - feedback and ref divider calculation 844 + * 845 + * @nom: nominator 846 + * @den: denominator 847 + * @post_div: post divider 848 + * @fb_div_max: feedback divider maximum 849 + * @ref_div_max: reference divider maximum 850 + * @fb_div: resulting feedback divider 851 + * @ref_div: resulting reference divider 852 + * 853 + * Calculate feedback and reference divider for a given post divider. Makes 854 + * sure we stay within the limits. 855 + */ 856 + static void avivo_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_div, 857 + unsigned fb_div_max, unsigned ref_div_max, 858 + unsigned *fb_div, unsigned *ref_div) 859 + { 860 + /* limit reference * post divider to a maximum */ 861 + ref_div_max = min(210 / post_div, ref_div_max); 862 + 863 + /* get matching reference and feedback divider */ 864 + *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u), ref_div_max); 865 + *fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den); 866 + 867 + /* limit fb divider to its maximum */ 868 + if (*fb_div > fb_div_max) { 869 + *ref_div = DIV_ROUND_CLOSEST(*ref_div * fb_div_max, *fb_div); 870 + *fb_div = fb_div_max; 871 + } 872 + } 873 + 874 + /** 843 875 * radeon_compute_pll_avivo - compute PLL paramaters 844 876 * 845 877 * @pll: information about the PLL ··· 892 860 u32 *ref_div_p, 893 861 u32 *post_div_p) 894 862 { 863 + unsigned target_clock = pll->flags & RADEON_PLL_USE_FRAC_FB_DIV ? 864 + freq : freq / 10; 865 + 895 866 unsigned fb_div_min, fb_div_max, fb_div; 896 867 unsigned post_div_min, post_div_max, post_div; 897 868 unsigned ref_div_min, ref_div_max, ref_div; ··· 915 880 ref_div_min = pll->reference_div; 916 881 else 917 882 ref_div_min = pll->min_ref_div; 918 - ref_div_max = pll->max_ref_div; 883 + 884 + if (pll->flags & RADEON_PLL_USE_FRAC_FB_DIV && 885 + pll->flags & RADEON_PLL_USE_REF_DIV) 886 + ref_div_max = pll->reference_div; 887 + else 888 + ref_div_max = pll->max_ref_div; 919 889 920 890 /* determine allowed post divider range */ 921 891 if (pll->flags & RADEON_PLL_USE_POST_DIV) { 922 892 post_div_min = pll->post_div; 923 893 post_div_max = pll->post_div; 924 894 } else { 925 - unsigned target_clock = freq / 10; 926 895 unsigned vco_min, vco_max; 927 896 928 897 if (pll->flags & RADEON_PLL_IS_LCD) { ··· 935 896 } else { 936 897 vco_min = pll->pll_out_min; 937 898 vco_max = pll->pll_out_max; 899 + } 900 + 901 + if (pll->flags & RADEON_PLL_USE_FRAC_FB_DIV) { 902 + vco_min *= 10; 903 + vco_max *= 10; 938 904 } 939 905 940 906 post_div_min = vco_min / target_clock; ··· 956 912 } 957 913 958 914 /* represent the searched ratio as fractional number */ 959 - nom = pll->flags & RADEON_PLL_USE_FRAC_FB_DIV ? freq : freq / 10; 915 + nom = target_clock; 960 916 den = pll->reference_freq; 961 917 962 918 /* reduce the numbers to a simpler ratio */ ··· 970 926 diff_best = ~0; 971 927 972 928 for (post_div = post_div_min; post_div <= post_div_max; ++post_div) { 973 - unsigned diff = abs(den - den / post_div * post_div); 929 + unsigned diff; 930 + avivo_get_fb_ref_div(nom, den, post_div, fb_div_max, 931 + ref_div_max, &fb_div, &ref_div); 932 + diff = abs(target_clock - (pll->reference_freq * fb_div) / 933 + (ref_div * post_div)); 934 + 974 935 if (diff < diff_best || (diff == diff_best && 975 936 !(pll->flags & RADEON_PLL_PREFER_MINM_OVER_MAXP))) { 976 937 ··· 985 936 } 986 937 post_div = post_div_best; 987 938 988 - /* limit reference * post divider to a maximum */ 989 - ref_div_max = min(210 / post_div, ref_div_max); 990 - 991 - /* get matching reference and feedback divider */ 992 - ref_div = max(DIV_ROUND_CLOSEST(den, post_div), 1u); 993 - fb_div = DIV_ROUND_CLOSEST(nom * ref_div * post_div, den); 994 - 995 - /* we're almost done, but reference and feedback 996 - divider might be to large now */ 997 - 998 - nom = fb_div; 999 - den = ref_div; 1000 - 1001 - if (fb_div > fb_div_max) { 1002 - ref_div = DIV_ROUND_CLOSEST(den * fb_div_max, nom); 1003 - fb_div = fb_div_max; 1004 - } 1005 - 1006 - if (ref_div > ref_div_max) { 1007 - ref_div = ref_div_max; 1008 - fb_div = DIV_ROUND_CLOSEST(nom * ref_div_max, den); 1009 - } 939 + /* get the feedback and reference divider for the optimal value */ 940 + avivo_get_fb_ref_div(nom, den, post_div, fb_div_max, ref_div_max, 941 + &fb_div, &ref_div); 1010 942 1011 943 /* reduce the numbers to a simpler ratio once more */ 1012 944 /* this also makes sure that the reference divider is large enough */ ··· 1009 979 *post_div_p = post_div; 1010 980 1011 981 DRM_DEBUG_KMS("%d - %d, pll dividers - fb: %d.%d ref: %d, post %d\n", 1012 - freq, *dot_clock_p, *fb_div_p, *frac_fb_div_p, 982 + freq, *dot_clock_p * 10, *fb_div_p, *frac_fb_div_p, 1013 983 ref_div, post_div); 1014 984 } 1015 985
+3 -5
drivers/gpu/drm/radeon/radeon_kms.c
··· 107 107 flags |= RADEON_IS_PCI; 108 108 } 109 109 110 - if (radeon_runtime_pm == 1) 111 - flags |= RADEON_IS_PX; 112 - else if ((radeon_runtime_pm == -1) && 113 - radeon_has_atpx() && 114 - ((flags & RADEON_IS_IGP) == 0)) 110 + if ((radeon_runtime_pm != 0) && 111 + radeon_has_atpx() && 112 + ((flags & RADEON_IS_IGP) == 0)) 115 113 flags |= RADEON_IS_PX; 116 114 117 115 /* radeon_device_init should report only fatal error
+32 -19
drivers/gpu/drm/radeon/radeon_pm.c
··· 603 603 static int radeon_hwmon_init(struct radeon_device *rdev) 604 604 { 605 605 int err = 0; 606 - struct device *hwmon_dev; 607 606 608 607 switch (rdev->pm.int_thermal_type) { 609 608 case THERMAL_TYPE_RV6XX: ··· 615 616 case THERMAL_TYPE_KV: 616 617 if (rdev->asic->pm.get_temperature == NULL) 617 618 return err; 618 - hwmon_dev = hwmon_device_register_with_groups(rdev->dev, 619 - "radeon", rdev, 620 - hwmon_groups); 621 - if (IS_ERR(hwmon_dev)) { 622 - err = PTR_ERR(hwmon_dev); 619 + rdev->pm.int_hwmon_dev = hwmon_device_register_with_groups(rdev->dev, 620 + "radeon", rdev, 621 + hwmon_groups); 622 + if (IS_ERR(rdev->pm.int_hwmon_dev)) { 623 + err = PTR_ERR(rdev->pm.int_hwmon_dev); 623 624 dev_err(rdev->dev, 624 625 "Unable to register hwmon device: %d\n", err); 625 626 } ··· 629 630 } 630 631 631 632 return err; 633 + } 634 + 635 + static void radeon_hwmon_fini(struct radeon_device *rdev) 636 + { 637 + if (rdev->pm.int_hwmon_dev) 638 + hwmon_device_unregister(rdev->pm.int_hwmon_dev); 632 639 } 633 640 634 641 static void radeon_dpm_thermal_work_handler(struct work_struct *work) ··· 1262 1257 case CHIP_RV670: 1263 1258 case CHIP_RS780: 1264 1259 case CHIP_RS880: 1260 + case CHIP_RV770: 1265 1261 case CHIP_BARTS: 1266 1262 case CHIP_TURKS: 1267 1263 case CHIP_CAICOS: ··· 1279 1273 else 1280 1274 rdev->pm.pm_method = PM_METHOD_PROFILE; 1281 1275 break; 1282 - case CHIP_RV770: 1283 1276 case CHIP_RV730: 1284 1277 case CHIP_RV710: 1285 1278 case CHIP_RV740: ··· 1358 1353 device_remove_file(rdev->dev, &dev_attr_power_method); 1359 1354 } 1360 1355 1356 + radeon_hwmon_fini(rdev); 1357 + 1361 1358 if (rdev->pm.power_state) 1362 1359 kfree(rdev->pm.power_state); 1363 1360 } ··· 1378 1371 device_remove_file(rdev->dev, &dev_attr_power_method); 1379 1372 } 1380 1373 radeon_dpm_fini(rdev); 1374 + 1375 + radeon_hwmon_fini(rdev); 1381 1376 1382 1377 if (rdev->pm.power_state) 1383 1378 kfree(rdev->pm.power_state); ··· 1406 1397 1407 1398 rdev->pm.active_crtcs = 0; 1408 1399 rdev->pm.active_crtc_count = 0; 1409 - list_for_each_entry(crtc, 1410 - &ddev->mode_config.crtc_list, head) { 1411 - radeon_crtc = to_radeon_crtc(crtc); 1412 - if (radeon_crtc->enabled) { 1413 - rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id); 1414 - rdev->pm.active_crtc_count++; 1400 + if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { 1401 + list_for_each_entry(crtc, 1402 + &ddev->mode_config.crtc_list, head) { 1403 + radeon_crtc = to_radeon_crtc(crtc); 1404 + if (radeon_crtc->enabled) { 1405 + rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id); 1406 + rdev->pm.active_crtc_count++; 1407 + } 1415 1408 } 1416 1409 } 1417 1410 ··· 1480 1469 /* update active crtc counts */ 1481 1470 rdev->pm.dpm.new_active_crtcs = 0; 1482 1471 rdev->pm.dpm.new_active_crtc_count = 0; 1483 - list_for_each_entry(crtc, 1484 - &ddev->mode_config.crtc_list, head) { 1485 - radeon_crtc = to_radeon_crtc(crtc); 1486 - if (crtc->enabled) { 1487 - rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id); 1488 - rdev->pm.dpm.new_active_crtc_count++; 1472 + if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { 1473 + list_for_each_entry(crtc, 1474 + &ddev->mode_config.crtc_list, head) { 1475 + radeon_crtc = to_radeon_crtc(crtc); 1476 + if (crtc->enabled) { 1477 + rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id); 1478 + rdev->pm.dpm.new_active_crtc_count++; 1479 + } 1489 1480 } 1490 1481 } 1491 1482
+1 -1
drivers/gpu/drm/tegra/dc.c
··· 312 312 struct drm_device *drm = crtc->dev; 313 313 struct drm_plane *plane; 314 314 315 - list_for_each_entry(plane, &drm->mode_config.plane_list, head) { 315 + drm_for_each_legacy_plane(plane, &drm->mode_config.plane_list) { 316 316 if (plane->crtc == crtc) { 317 317 tegra_plane_disable(plane); 318 318 plane->crtc = NULL;
+22
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
··· 1214 1214 SVGA3dCmdSurfaceDMA dma; 1215 1215 } *cmd; 1216 1216 int ret; 1217 + SVGA3dCmdSurfaceDMASuffix *suffix; 1218 + uint32_t bo_size; 1217 1219 1218 1220 cmd = container_of(header, struct vmw_dma_cmd, header); 1221 + suffix = (SVGA3dCmdSurfaceDMASuffix *)((unsigned long) &cmd->dma + 1222 + header->size - sizeof(*suffix)); 1223 + 1224 + /* Make sure device and verifier stays in sync. */ 1225 + if (unlikely(suffix->suffixSize != sizeof(*suffix))) { 1226 + DRM_ERROR("Invalid DMA suffix size.\n"); 1227 + return -EINVAL; 1228 + } 1229 + 1219 1230 ret = vmw_translate_guest_ptr(dev_priv, sw_context, 1220 1231 &cmd->dma.guest.ptr, 1221 1232 &vmw_bo); 1222 1233 if (unlikely(ret != 0)) 1223 1234 return ret; 1235 + 1236 + /* Make sure DMA doesn't cross BO boundaries. */ 1237 + bo_size = vmw_bo->base.num_pages * PAGE_SIZE; 1238 + if (unlikely(cmd->dma.guest.ptr.offset > bo_size)) { 1239 + DRM_ERROR("Invalid DMA offset.\n"); 1240 + return -EINVAL; 1241 + } 1242 + 1243 + bo_size -= cmd->dma.guest.ptr.offset; 1244 + if (unlikely(suffix->maximumOffset > bo_size)) 1245 + suffix->maximumOffset = bo_size; 1224 1246 1225 1247 ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, 1226 1248 user_surface_converter, &cmd->dma.host.sid,
+2 -2
drivers/hwmon/coretemp.c
··· 365 365 if (cpu_has_tjmax(c)) 366 366 dev_warn(dev, "Unable to read TjMax from CPU %u\n", id); 367 367 } else { 368 - val = (eax >> 16) & 0x7f; 368 + val = (eax >> 16) & 0xff; 369 369 /* 370 370 * If the TjMax is not plausible, an assumption 371 371 * will be used 372 372 */ 373 - if (val >= 85) { 373 + if (val) { 374 374 dev_dbg(dev, "TjMax is %d degrees C\n", val); 375 375 return val * 1000; 376 376 }
+3 -3
drivers/hwmon/ltc2945.c
··· 1 - /* 1 + /* 2 2 * Driver for Linear Technology LTC2945 I2C Power Monitor 3 3 * 4 4 * Copyright (c) 2014 Guenter Roeck ··· 314 314 reg = LTC2945_MAX_ADIN_H; 315 315 break; 316 316 default: 317 - BUG(); 318 - break; 317 + WARN_ONCE(1, "Bad register: 0x%x\n", reg); 318 + return -EINVAL; 319 319 } 320 320 /* Reset maximum */ 321 321 ret = regmap_bulk_write(regmap, reg, buf_max, num_regs);
+71 -12
drivers/hwmon/vexpress.c
··· 27 27 struct vexpress_hwmon_data { 28 28 struct device *hwmon_dev; 29 29 struct vexpress_config_func *func; 30 + const char *name; 30 31 }; 31 32 32 33 static ssize_t vexpress_hwmon_name_show(struct device *dev, 33 34 struct device_attribute *dev_attr, char *buffer) 34 35 { 35 - const char *compatible = of_get_property(dev->of_node, "compatible", 36 - NULL); 36 + struct vexpress_hwmon_data *data = dev_get_drvdata(dev); 37 37 38 - return sprintf(buffer, "%s\n", compatible); 38 + return sprintf(buffer, "%s\n", data->name); 39 39 } 40 40 41 41 static ssize_t vexpress_hwmon_label_show(struct device *dev, 42 42 struct device_attribute *dev_attr, char *buffer) 43 43 { 44 44 const char *label = of_get_property(dev->of_node, "label", NULL); 45 - 46 - if (!label) 47 - return -ENOENT; 48 45 49 46 return snprintf(buffer, PAGE_SIZE, "%s\n", label); 50 47 } ··· 81 84 to_sensor_dev_attr(dev_attr)->index)); 82 85 } 83 86 87 + static umode_t vexpress_hwmon_attr_is_visible(struct kobject *kobj, 88 + struct attribute *attr, int index) 89 + { 90 + struct device *dev = kobj_to_dev(kobj); 91 + struct device_attribute *dev_attr = container_of(attr, 92 + struct device_attribute, attr); 93 + 94 + if (dev_attr->show == vexpress_hwmon_label_show && 95 + !of_get_property(dev->of_node, "label", NULL)) 96 + return 0; 97 + 98 + return attr->mode; 99 + } 100 + 84 101 static DEVICE_ATTR(name, S_IRUGO, vexpress_hwmon_name_show, NULL); 85 102 86 103 #define VEXPRESS_HWMON_ATTRS(_name, _label_attr, _input_attr) \ ··· 105 94 NULL \ 106 95 } 107 96 97 + struct vexpress_hwmon_type { 98 + const char *name; 99 + const struct attribute_group **attr_groups; 100 + }; 101 + 108 102 #if !defined(CONFIG_REGULATOR_VEXPRESS) 109 103 static DEVICE_ATTR(in1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); 110 104 static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, vexpress_hwmon_u32_show, 111 105 NULL, 1000); 112 106 static VEXPRESS_HWMON_ATTRS(volt, in1_label, in1_input); 113 107 static struct attribute_group vexpress_hwmon_group_volt = { 108 + .is_visible = vexpress_hwmon_attr_is_visible, 114 109 .attrs = vexpress_hwmon_attrs_volt, 110 + }; 111 + static struct vexpress_hwmon_type vexpress_hwmon_volt = { 112 + .name = "vexpress_volt", 113 + .attr_groups = (const struct attribute_group *[]) { 114 + &vexpress_hwmon_group_volt, 115 + NULL, 116 + }, 115 117 }; 116 118 #endif 117 119 ··· 133 109 NULL, 1000); 134 110 static VEXPRESS_HWMON_ATTRS(amp, curr1_label, curr1_input); 135 111 static struct attribute_group vexpress_hwmon_group_amp = { 112 + .is_visible = vexpress_hwmon_attr_is_visible, 136 113 .attrs = vexpress_hwmon_attrs_amp, 114 + }; 115 + static struct vexpress_hwmon_type vexpress_hwmon_amp = { 116 + .name = "vexpress_amp", 117 + .attr_groups = (const struct attribute_group *[]) { 118 + &vexpress_hwmon_group_amp, 119 + NULL 120 + }, 137 121 }; 138 122 139 123 static DEVICE_ATTR(temp1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); ··· 149 117 NULL, 1000); 150 118 static VEXPRESS_HWMON_ATTRS(temp, temp1_label, temp1_input); 151 119 static struct attribute_group vexpress_hwmon_group_temp = { 120 + .is_visible = vexpress_hwmon_attr_is_visible, 152 121 .attrs = vexpress_hwmon_attrs_temp, 122 + }; 123 + static struct vexpress_hwmon_type vexpress_hwmon_temp = { 124 + .name = "vexpress_temp", 125 + .attr_groups = (const struct attribute_group *[]) { 126 + &vexpress_hwmon_group_temp, 127 + NULL 128 + }, 153 129 }; 154 130 155 131 static DEVICE_ATTR(power1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); ··· 165 125 NULL, 1); 166 126 static VEXPRESS_HWMON_ATTRS(power, power1_label, power1_input); 167 127 static struct attribute_group vexpress_hwmon_group_power = { 128 + .is_visible = vexpress_hwmon_attr_is_visible, 168 129 .attrs = vexpress_hwmon_attrs_power, 130 + }; 131 + static struct vexpress_hwmon_type vexpress_hwmon_power = { 132 + .name = "vexpress_power", 133 + .attr_groups = (const struct attribute_group *[]) { 134 + &vexpress_hwmon_group_power, 135 + NULL 136 + }, 169 137 }; 170 138 171 139 static DEVICE_ATTR(energy1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); ··· 181 133 NULL, 1); 182 134 static VEXPRESS_HWMON_ATTRS(energy, energy1_label, energy1_input); 183 135 static struct attribute_group vexpress_hwmon_group_energy = { 136 + .is_visible = vexpress_hwmon_attr_is_visible, 184 137 .attrs = vexpress_hwmon_attrs_energy, 138 + }; 139 + static struct vexpress_hwmon_type vexpress_hwmon_energy = { 140 + .name = "vexpress_energy", 141 + .attr_groups = (const struct attribute_group *[]) { 142 + &vexpress_hwmon_group_energy, 143 + NULL 144 + }, 185 145 }; 186 146 187 147 static struct of_device_id vexpress_hwmon_of_match[] = { 188 148 #if !defined(CONFIG_REGULATOR_VEXPRESS) 189 149 { 190 150 .compatible = "arm,vexpress-volt", 191 - .data = &vexpress_hwmon_group_volt, 151 + .data = &vexpress_hwmon_volt, 192 152 }, 193 153 #endif 194 154 { 195 155 .compatible = "arm,vexpress-amp", 196 - .data = &vexpress_hwmon_group_amp, 156 + .data = &vexpress_hwmon_amp, 197 157 }, { 198 158 .compatible = "arm,vexpress-temp", 199 - .data = &vexpress_hwmon_group_temp, 159 + .data = &vexpress_hwmon_temp, 200 160 }, { 201 161 .compatible = "arm,vexpress-power", 202 - .data = &vexpress_hwmon_group_power, 162 + .data = &vexpress_hwmon_power, 203 163 }, { 204 164 .compatible = "arm,vexpress-energy", 205 - .data = &vexpress_hwmon_group_energy, 165 + .data = &vexpress_hwmon_energy, 206 166 }, 207 167 {} 208 168 }; ··· 221 165 int err; 222 166 const struct of_device_id *match; 223 167 struct vexpress_hwmon_data *data; 168 + const struct vexpress_hwmon_type *type; 224 169 225 170 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 226 171 if (!data) ··· 231 174 match = of_match_device(vexpress_hwmon_of_match, &pdev->dev); 232 175 if (!match) 233 176 return -ENODEV; 177 + type = match->data; 178 + data->name = type->name; 234 179 235 180 data->func = vexpress_config_func_get_by_dev(&pdev->dev); 236 181 if (!data->func) 237 182 return -ENODEV; 238 183 239 - err = sysfs_create_group(&pdev->dev.kobj, match->data); 184 + err = sysfs_create_groups(&pdev->dev.kobj, type->attr_groups); 240 185 if (err) 241 186 goto error; 242 187
+2 -1
drivers/idle/intel_idle.c
··· 750 750 if (package_num + 1 > num_sockets) { 751 751 num_sockets = package_num + 1; 752 752 753 - if (num_sockets > 4) 753 + if (num_sockets > 4) { 754 754 cpuidle_state_table = ivt_cstates_8s; 755 755 return; 756 + } 756 757 } 757 758 } 758 759
+27 -6
drivers/iio/adc/at91_adc.c
··· 765 765 if (!pdata) 766 766 return -EINVAL; 767 767 768 + st->caps = (struct at91_adc_caps *) 769 + platform_get_device_id(pdev)->driver_data; 770 + 768 771 st->use_external = pdata->use_external_triggers; 769 772 st->vref_mv = pdata->vref; 770 773 st->channels_mask = pdata->channels_used; 771 - st->num_channels = pdata->num_channels; 774 + st->num_channels = st->caps->num_channels; 772 775 st->startup_time = pdata->startup_time; 773 776 st->trigger_number = pdata->trigger_number; 774 777 st->trigger_list = pdata->trigger_list; 775 - st->registers = pdata->registers; 778 + st->registers = &st->caps->registers; 776 779 777 780 return 0; 778 781 } ··· 1007 1004 * the best converted final value between two channels selection 1008 1005 * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock 1009 1006 */ 1010 - shtim = round_up((st->sample_hold_time * adc_clk_khz / 1011 - 1000) - 1, 1); 1007 + if (st->sample_hold_time > 0) 1008 + shtim = round_up((st->sample_hold_time * adc_clk_khz / 1000) 1009 + - 1, 1); 1010 + else 1011 + shtim = 0; 1012 1012 1013 1013 reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask; 1014 1014 reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask; ··· 1107 1101 return 0; 1108 1102 } 1109 1103 1110 - #ifdef CONFIG_OF 1111 1104 static struct at91_adc_caps at91sam9260_caps = { 1112 1105 .calc_startup_ticks = calc_startup_ticks_9260, 1113 1106 .num_channels = 4, ··· 1159 1154 {}, 1160 1155 }; 1161 1156 MODULE_DEVICE_TABLE(of, at91_adc_dt_ids); 1162 - #endif 1157 + 1158 + static const struct platform_device_id at91_adc_ids[] = { 1159 + { 1160 + .name = "at91sam9260-adc", 1161 + .driver_data = (unsigned long)&at91sam9260_caps, 1162 + }, { 1163 + .name = "at91sam9g45-adc", 1164 + .driver_data = (unsigned long)&at91sam9g45_caps, 1165 + }, { 1166 + .name = "at91sam9x5-adc", 1167 + .driver_data = (unsigned long)&at91sam9x5_caps, 1168 + }, { 1169 + /* terminator */ 1170 + } 1171 + }; 1172 + MODULE_DEVICE_TABLE(platform, at91_adc_ids); 1163 1173 1164 1174 static struct platform_driver at91_adc_driver = { 1165 1175 .probe = at91_adc_probe, 1166 1176 .remove = at91_adc_remove, 1177 + .id_table = at91_adc_ids, 1167 1178 .driver = { 1168 1179 .name = DRIVER_NAME, 1169 1180 .of_match_table = of_match_ptr(at91_adc_dt_ids),
+4 -2
drivers/iio/industrialio-buffer.c
··· 165 165 int ret; 166 166 struct iio_dev *indio_dev = dev_to_iio_dev(dev); 167 167 168 - ret = test_bit(to_iio_dev_attr(attr)->address, 168 + /* Ensure ret is 0 or 1. */ 169 + ret = !!test_bit(to_iio_dev_attr(attr)->address, 169 170 indio_dev->buffer->scan_mask); 170 171 171 172 return sprintf(buf, "%d\n", ret); ··· 863 862 if (!buffer->scan_mask) 864 863 return 0; 865 864 866 - return test_bit(bit, buffer->scan_mask); 865 + /* Ensure return value is 0 or 1. */ 866 + return !!test_bit(bit, buffer->scan_mask); 867 867 }; 868 868 EXPORT_SYMBOL_GPL(iio_scan_mask_query); 869 869
+1
drivers/iio/light/cm32181.c
··· 221 221 *val = cm32181->calibscale; 222 222 return IIO_VAL_INT; 223 223 case IIO_CHAN_INFO_INT_TIME: 224 + *val = 0; 224 225 ret = cm32181_read_als_it(cm32181, val2); 225 226 return ret; 226 227 }
+20 -2
drivers/iio/light/cm36651.c
··· 652 652 cm36651->client = client; 653 653 cm36651->ps_client = i2c_new_dummy(client->adapter, 654 654 CM36651_I2C_ADDR_PS); 655 + if (!cm36651->ps_client) { 656 + dev_err(&client->dev, "%s: new i2c device failed\n", __func__); 657 + ret = -ENODEV; 658 + goto error_disable_reg; 659 + } 660 + 655 661 cm36651->ara_client = i2c_new_dummy(client->adapter, CM36651_ARA); 662 + if (!cm36651->ara_client) { 663 + dev_err(&client->dev, "%s: new i2c device failed\n", __func__); 664 + ret = -ENODEV; 665 + goto error_i2c_unregister_ps; 666 + } 667 + 656 668 mutex_init(&cm36651->lock); 657 669 indio_dev->dev.parent = &client->dev; 658 670 indio_dev->channels = cm36651_channels; ··· 676 664 ret = cm36651_setup_reg(cm36651); 677 665 if (ret) { 678 666 dev_err(&client->dev, "%s: register setup failed\n", __func__); 679 - goto error_disable_reg; 667 + goto error_i2c_unregister_ara; 680 668 } 681 669 682 670 ret = request_threaded_irq(client->irq, NULL, cm36651_irq_handler, ··· 684 672 "cm36651", indio_dev); 685 673 if (ret) { 686 674 dev_err(&client->dev, "%s: request irq failed\n", __func__); 687 - goto error_disable_reg; 675 + goto error_i2c_unregister_ara; 688 676 } 689 677 690 678 ret = iio_device_register(indio_dev); ··· 697 685 698 686 error_free_irq: 699 687 free_irq(client->irq, indio_dev); 688 + error_i2c_unregister_ara: 689 + i2c_unregister_device(cm36651->ara_client); 690 + error_i2c_unregister_ps: 691 + i2c_unregister_device(cm36651->ps_client); 700 692 error_disable_reg: 701 693 regulator_disable(cm36651->vled_reg); 702 694 return ret; ··· 714 698 iio_device_unregister(indio_dev); 715 699 regulator_disable(cm36651->vled_reg); 716 700 free_irq(client->irq, indio_dev); 701 + i2c_unregister_device(cm36651->ps_client); 702 + i2c_unregister_device(cm36651->ara_client); 717 703 718 704 return 0; 719 705 }
+3 -3
drivers/infiniband/hw/cxgb4/Kconfig
··· 1 1 config INFINIBAND_CXGB4 2 - tristate "Chelsio T4 RDMA Driver" 2 + tristate "Chelsio T4/T5 RDMA Driver" 3 3 depends on CHELSIO_T4 && INET && (IPV6 || IPV6=n) 4 4 select GENERIC_ALLOCATOR 5 5 ---help--- 6 - This is an iWARP/RDMA driver for the Chelsio T4 1GbE and 7 - 10GbE adapters. 6 + This is an iWARP/RDMA driver for the Chelsio T4 and T5 7 + 1GbE, 10GbE adapters and T5 40GbE adapter. 8 8 9 9 For general information about Chelsio and our products, visit 10 10 our website at <http://www.chelsio.com>.
+28 -11
drivers/infiniband/hw/cxgb4/cm.c
··· 587 587 opt2 |= SACK_EN(1); 588 588 if (wscale && enable_tcp_window_scaling) 589 589 opt2 |= WND_SCALE_EN(1); 590 + if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { 591 + opt2 |= T5_OPT_2_VALID; 592 + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); 593 + } 590 594 t4_set_arp_err_handler(skb, NULL, act_open_req_arp_failure); 591 595 592 596 if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { ··· 1000 996 static int abort_connection(struct c4iw_ep *ep, struct sk_buff *skb, gfp_t gfp) 1001 997 { 1002 998 PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); 1003 - state_set(&ep->com, ABORTING); 999 + __state_set(&ep->com, ABORTING); 1004 1000 set_bit(ABORT_CONN, &ep->com.history); 1005 1001 return send_abort(ep, skb, gfp); 1006 1002 } ··· 1158 1154 return credits; 1159 1155 } 1160 1156 1161 - static void process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb) 1157 + static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb) 1162 1158 { 1163 1159 struct mpa_message *mpa; 1164 1160 struct mpa_v2_conn_params *mpa_v2_params; ··· 1168 1164 struct c4iw_qp_attributes attrs; 1169 1165 enum c4iw_qp_attr_mask mask; 1170 1166 int err; 1167 + int disconnect = 0; 1171 1168 1172 1169 PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); 1173 1170 ··· 1178 1173 * will abort the connection. 1179 1174 */ 1180 1175 if (stop_ep_timer(ep)) 1181 - return; 1176 + return 0; 1182 1177 1183 1178 /* 1184 1179 * If we get more than the supported amount of private data ··· 1200 1195 * if we don't even have the mpa message, then bail. 1201 1196 */ 1202 1197 if (ep->mpa_pkt_len < sizeof(*mpa)) 1203 - return; 1198 + return 0; 1204 1199 mpa = (struct mpa_message *) ep->mpa_pkt; 1205 1200 1206 1201 /* Validate MPA header. */ ··· 1240 1235 * We'll continue process when more data arrives. 1241 1236 */ 1242 1237 if (ep->mpa_pkt_len < (sizeof(*mpa) + plen)) 1243 - return; 1238 + return 0; 1244 1239 1245 1240 if (mpa->flags & MPA_REJECT) { 1246 1241 err = -ECONNREFUSED; ··· 1342 1337 attrs.layer_etype = LAYER_MPA | DDP_LLP; 1343 1338 attrs.ecode = MPA_NOMATCH_RTR; 1344 1339 attrs.next_state = C4IW_QP_STATE_TERMINATE; 1340 + attrs.send_term = 1; 1345 1341 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, 1346 - C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); 1342 + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); 1347 1343 err = -ENOMEM; 1344 + disconnect = 1; 1348 1345 goto out; 1349 1346 } 1350 1347 ··· 1362 1355 attrs.layer_etype = LAYER_MPA | DDP_LLP; 1363 1356 attrs.ecode = MPA_INSUFF_IRD; 1364 1357 attrs.next_state = C4IW_QP_STATE_TERMINATE; 1358 + attrs.send_term = 1; 1365 1359 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, 1366 - C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); 1360 + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); 1367 1361 err = -ENOMEM; 1362 + disconnect = 1; 1368 1363 goto out; 1369 1364 } 1370 1365 goto out; ··· 1375 1366 send_abort(ep, skb, GFP_KERNEL); 1376 1367 out: 1377 1368 connect_reply_upcall(ep, err); 1378 - return; 1369 + return disconnect; 1379 1370 } 1380 1371 1381 1372 static void process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb) ··· 1533 1524 unsigned int tid = GET_TID(hdr); 1534 1525 struct tid_info *t = dev->rdev.lldi.tids; 1535 1526 __u8 status = hdr->status; 1527 + int disconnect = 0; 1536 1528 1537 1529 ep = lookup_tid(t, tid); 1538 1530 if (!ep) ··· 1549 1539 switch (ep->com.state) { 1550 1540 case MPA_REQ_SENT: 1551 1541 ep->rcv_seq += dlen; 1552 - process_mpa_reply(ep, skb); 1542 + disconnect = process_mpa_reply(ep, skb); 1553 1543 break; 1554 1544 case MPA_REQ_WAIT: 1555 1545 ep->rcv_seq += dlen; ··· 1565 1555 ep->com.state, ep->hwtid, status); 1566 1556 attrs.next_state = C4IW_QP_STATE_TERMINATE; 1567 1557 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, 1568 - C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); 1558 + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); 1559 + disconnect = 1; 1569 1560 break; 1570 1561 } 1571 1562 default: 1572 1563 break; 1573 1564 } 1574 1565 mutex_unlock(&ep->com.mutex); 1566 + if (disconnect) 1567 + c4iw_ep_disconnect(ep, 0, GFP_KERNEL); 1575 1568 return 0; 1576 1569 } 1577 1570 ··· 2021 2008 G_IP_HDR_LEN(hlen); 2022 2009 if (tcph->ece && tcph->cwr) 2023 2010 opt2 |= CCTRL_ECN(1); 2011 + } 2012 + if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { 2013 + opt2 |= T5_OPT_2_VALID; 2014 + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); 2024 2015 } 2025 2016 2026 2017 rpl = cplhdr(skb); ··· 3499 3482 __func__, ep, ep->hwtid, ep->com.state); 3500 3483 abort = 0; 3501 3484 } 3502 - mutex_unlock(&ep->com.mutex); 3503 3485 if (abort) 3504 3486 abort_connection(ep, NULL, GFP_KERNEL); 3487 + mutex_unlock(&ep->com.mutex); 3505 3488 c4iw_put_ep(&ep->com); 3506 3489 } 3507 3490
+1
drivers/infiniband/hw/cxgb4/iw_cxgb4.h
··· 435 435 u8 ecode; 436 436 u16 sq_db_inc; 437 437 u16 rq_db_inc; 438 + u8 send_term; 438 439 }; 439 440 440 441 struct c4iw_qp {
+9 -4
drivers/infiniband/hw/cxgb4/qp.c
··· 1388 1388 qhp->attr.layer_etype = attrs->layer_etype; 1389 1389 qhp->attr.ecode = attrs->ecode; 1390 1390 ep = qhp->ep; 1391 - disconnect = 1; 1392 - c4iw_get_ep(&qhp->ep->com); 1393 - if (!internal) 1391 + if (!internal) { 1392 + c4iw_get_ep(&qhp->ep->com); 1394 1393 terminate = 1; 1395 - else { 1394 + disconnect = 1; 1395 + } else { 1396 + terminate = qhp->attr.send_term; 1396 1397 ret = rdma_fini(rhp, qhp, ep); 1397 1398 if (ret) 1398 1399 goto err; ··· 1777 1776 /* 1778 1777 * Use SQ_PSN and RQ_PSN to pass in IDX_INC values for 1779 1778 * ringing the queue db when we're in DB_FULL mode. 1779 + * Only allow this on T4 devices. 1780 1780 */ 1781 1781 attrs.sq_db_inc = attr->sq_psn; 1782 1782 attrs.rq_db_inc = attr->rq_psn; 1783 1783 mask |= (attr_mask & IB_QP_SQ_PSN) ? C4IW_QP_ATTR_SQ_DB : 0; 1784 1784 mask |= (attr_mask & IB_QP_RQ_PSN) ? C4IW_QP_ATTR_RQ_DB : 0; 1785 + if (is_t5(to_c4iw_qp(ibqp)->rhp->rdev.lldi.adapter_type) && 1786 + (mask & (C4IW_QP_ATTR_SQ_DB|C4IW_QP_ATTR_RQ_DB))) 1787 + return -EINVAL; 1785 1788 1786 1789 return c4iw_modify_qp(rhp, qhp, mask, &attrs, 0); 1787 1790 }
+14
drivers/infiniband/hw/cxgb4/t4fw_ri_api.h
··· 836 836 #define V_RX_DACK_CHANGE(x) ((x) << S_RX_DACK_CHANGE) 837 837 #define F_RX_DACK_CHANGE V_RX_DACK_CHANGE(1U) 838 838 839 + enum { /* TCP congestion control algorithms */ 840 + CONG_ALG_RENO, 841 + CONG_ALG_TAHOE, 842 + CONG_ALG_NEWRENO, 843 + CONG_ALG_HIGHSPEED 844 + }; 845 + 846 + #define S_CONG_CNTRL 14 847 + #define M_CONG_CNTRL 0x3 848 + #define V_CONG_CNTRL(x) ((x) << S_CONG_CNTRL) 849 + #define G_CONG_CNTRL(x) (((x) >> S_CONG_CNTRL) & M_CONG_CNTRL) 850 + 851 + #define T5_OPT_2_VALID (1 << 31) 852 + 839 853 #endif /* _T4FW_RI_API_H_ */
-1
drivers/input/misc/da9055_onkey.c
··· 109 109 110 110 INIT_DELAYED_WORK(&onkey->work, da9055_onkey_work); 111 111 112 - irq = regmap_irq_get_virq(da9055->irq_data, irq); 113 112 err = request_threaded_irq(irq, NULL, da9055_onkey_irq, 114 113 IRQF_TRIGGER_HIGH | IRQF_ONESHOT, 115 114 "ONKEY", onkey);
+1
drivers/input/misc/soc_button_array.c
··· 169 169 soc_button_remove(pdev); 170 170 return error; 171 171 } 172 + continue; 172 173 } 173 174 174 175 priv->children[i] = pd;
+1
drivers/input/mouse/elantech.c
··· 1353 1353 case 6: 1354 1354 case 7: 1355 1355 case 8: 1356 + case 9: 1356 1357 etd->hw_version = 4; 1357 1358 break; 1358 1359 default:
+95 -2
drivers/input/mouse/synaptics.c
··· 117 117 } 118 118 119 119 #ifdef CONFIG_MOUSE_PS2_SYNAPTICS 120 + /* This list has been kindly provided by Synaptics. */ 121 + static const char * const topbuttonpad_pnp_ids[] = { 122 + "LEN0017", 123 + "LEN0018", 124 + "LEN0019", 125 + "LEN0023", 126 + "LEN002A", 127 + "LEN002B", 128 + "LEN002C", 129 + "LEN002D", 130 + "LEN002E", 131 + "LEN0033", /* Helix */ 132 + "LEN0034", /* T431s, T540, X1 Carbon 2nd */ 133 + "LEN0035", /* X240 */ 134 + "LEN0036", /* T440 */ 135 + "LEN0037", 136 + "LEN0038", 137 + "LEN0041", 138 + "LEN0042", /* Yoga */ 139 + "LEN0045", 140 + "LEN0046", 141 + "LEN0047", 142 + "LEN0048", 143 + "LEN0049", 144 + "LEN2000", 145 + "LEN2001", 146 + "LEN2002", 147 + "LEN2003", 148 + "LEN2004", /* L440 */ 149 + "LEN2005", 150 + "LEN2006", 151 + "LEN2007", 152 + "LEN2008", 153 + "LEN2009", 154 + "LEN200A", 155 + "LEN200B", 156 + NULL 157 + }; 120 158 121 159 /***************************************************************************** 122 160 * Synaptics communications functions ··· 1293 1255 input_abs_set_res(dev, y_code, priv->y_res); 1294 1256 } 1295 1257 1296 - static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) 1258 + static void set_input_params(struct psmouse *psmouse, 1259 + struct synaptics_data *priv) 1297 1260 { 1261 + struct input_dev *dev = psmouse->dev; 1298 1262 int i; 1299 1263 1300 1264 /* Things that apply to both modes */ ··· 1365 1325 1366 1326 if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { 1367 1327 __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); 1328 + /* See if this buttonpad has a top button area */ 1329 + if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) { 1330 + for (i = 0; topbuttonpad_pnp_ids[i]; i++) { 1331 + if (strstr(psmouse->ps2dev.serio->firmware_id, 1332 + topbuttonpad_pnp_ids[i])) { 1333 + __set_bit(INPUT_PROP_TOPBUTTONPAD, 1334 + dev->propbit); 1335 + break; 1336 + } 1337 + } 1338 + } 1368 1339 /* Clickpads report only left button */ 1369 1340 __clear_bit(BTN_RIGHT, dev->keybit); 1370 1341 __clear_bit(BTN_MIDDLE, dev->keybit); ··· 1566 1515 .driver_data = (int []){1232, 5710, 1156, 4696}, 1567 1516 }, 1568 1517 { 1518 + /* Lenovo ThinkPad T431s */ 1519 + .matches = { 1520 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1521 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T431"), 1522 + }, 1523 + .driver_data = (int []){1024, 5112, 2024, 4832}, 1524 + }, 1525 + { 1569 1526 /* Lenovo ThinkPad T440s */ 1570 1527 .matches = { 1571 1528 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1572 1529 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T440"), 1530 + }, 1531 + .driver_data = (int []){1024, 5112, 2024, 4832}, 1532 + }, 1533 + { 1534 + /* Lenovo ThinkPad L440 */ 1535 + .matches = { 1536 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1537 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L440"), 1573 1538 }, 1574 1539 .driver_data = (int []){1024, 5112, 2024, 4832}, 1575 1540 }, ··· 1596 1529 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T540"), 1597 1530 }, 1598 1531 .driver_data = (int []){1024, 5056, 2058, 4832}, 1532 + }, 1533 + { 1534 + /* Lenovo ThinkPad L540 */ 1535 + .matches = { 1536 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1537 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L540"), 1538 + }, 1539 + .driver_data = (int []){1024, 5112, 2024, 4832}, 1540 + }, 1541 + { 1542 + /* Lenovo Yoga S1 */ 1543 + .matches = { 1544 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1545 + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, 1546 + "ThinkPad S1 Yoga"), 1547 + }, 1548 + .driver_data = (int []){1232, 5710, 1156, 4696}, 1549 + }, 1550 + { 1551 + /* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */ 1552 + .matches = { 1553 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1554 + DMI_MATCH(DMI_PRODUCT_VERSION, 1555 + "ThinkPad X1 Carbon 2nd"), 1556 + }, 1557 + .driver_data = (int []){1024, 5112, 2024, 4832}, 1599 1558 }, 1600 1559 #endif 1601 1560 { } ··· 1686 1593 priv->capabilities, priv->ext_cap, priv->ext_cap_0c, 1687 1594 priv->board_id, priv->firmware_id); 1688 1595 1689 - set_input_params(psmouse->dev, priv); 1596 + set_input_params(psmouse, priv); 1690 1597 1691 1598 /* 1692 1599 * Encode touchpad model so that it can be used to set
+15
drivers/input/serio/i8042-x86ia64io.h
··· 702 702 static char i8042_pnp_kbd_name[32]; 703 703 static char i8042_pnp_aux_name[32]; 704 704 705 + static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size) 706 + { 707 + strlcpy(dst, "PNP:", dst_size); 708 + 709 + while (id) { 710 + strlcat(dst, " ", dst_size); 711 + strlcat(dst, id->id, dst_size); 712 + id = id->next; 713 + } 714 + } 715 + 705 716 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did) 706 717 { 707 718 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1) ··· 729 718 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name)); 730 719 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name)); 731 720 } 721 + i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id, 722 + sizeof(i8042_kbd_firmware_id)); 732 723 733 724 /* Keyboard ports are always supposed to be wakeup-enabled */ 734 725 device_set_wakeup_enable(&dev->dev, true); ··· 755 742 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name)); 756 743 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name)); 757 744 } 745 + i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id, 746 + sizeof(i8042_aux_firmware_id)); 758 747 759 748 i8042_pnp_aux_devices++; 760 749 return 0;
+6
drivers/input/serio/i8042.c
··· 87 87 #endif 88 88 89 89 static bool i8042_bypass_aux_irq_test; 90 + static char i8042_kbd_firmware_id[128]; 91 + static char i8042_aux_firmware_id[128]; 90 92 91 93 #include "i8042.h" 92 94 ··· 1220 1218 serio->dev.parent = &i8042_platform_device->dev; 1221 1219 strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name)); 1222 1220 strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys)); 1221 + strlcpy(serio->firmware_id, i8042_kbd_firmware_id, 1222 + sizeof(serio->firmware_id)); 1223 1223 1224 1224 port->serio = serio; 1225 1225 port->irq = I8042_KBD_IRQ; ··· 1248 1244 if (idx < 0) { 1249 1245 strlcpy(serio->name, "i8042 AUX port", sizeof(serio->name)); 1250 1246 strlcpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys)); 1247 + strlcpy(serio->firmware_id, i8042_aux_firmware_id, 1248 + sizeof(serio->firmware_id)); 1251 1249 serio->close = i8042_port_close; 1252 1250 } else { 1253 1251 snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx);
+14
drivers/input/serio/serio.c
··· 451 451 return retval; 452 452 } 453 453 454 + static ssize_t firmware_id_show(struct device *dev, struct device_attribute *attr, char *buf) 455 + { 456 + struct serio *serio = to_serio_port(dev); 457 + 458 + return sprintf(buf, "%s\n", serio->firmware_id); 459 + } 460 + 454 461 static DEVICE_ATTR_RO(type); 455 462 static DEVICE_ATTR_RO(proto); 456 463 static DEVICE_ATTR_RO(id); ··· 480 473 static DEVICE_ATTR_WO(drvctl); 481 474 static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL); 482 475 static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode); 476 + static DEVICE_ATTR_RO(firmware_id); 483 477 484 478 static struct attribute *serio_device_attrs[] = { 485 479 &dev_attr_modalias.attr, 486 480 &dev_attr_description.attr, 487 481 &dev_attr_drvctl.attr, 488 482 &dev_attr_bind_mode.attr, 483 + &dev_attr_firmware_id.attr, 489 484 NULL 490 485 }; 491 486 ··· 930 921 SERIO_ADD_UEVENT_VAR("SERIO_PROTO=%02x", serio->id.proto); 931 922 SERIO_ADD_UEVENT_VAR("SERIO_ID=%02x", serio->id.id); 932 923 SERIO_ADD_UEVENT_VAR("SERIO_EXTRA=%02x", serio->id.extra); 924 + 933 925 SERIO_ADD_UEVENT_VAR("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X", 934 926 serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); 927 + 928 + if (serio->firmware_id[0]) 929 + SERIO_ADD_UEVENT_VAR("SERIO_FIRMWARE_ID=%s", 930 + serio->firmware_id); 935 931 936 932 return 0; 937 933 }
+112 -122
drivers/input/tablet/wacom_sys.c
··· 22 22 #define HID_USAGE_PAGE_DIGITIZER 0x0d 23 23 #define HID_USAGE_PAGE_DESKTOP 0x01 24 24 #define HID_USAGE 0x09 25 - #define HID_USAGE_X 0x30 26 - #define HID_USAGE_Y 0x31 27 - #define HID_USAGE_X_TILT 0x3d 28 - #define HID_USAGE_Y_TILT 0x3e 29 - #define HID_USAGE_FINGER 0x22 30 - #define HID_USAGE_STYLUS 0x20 31 - #define HID_USAGE_CONTACTMAX 0x55 25 + #define HID_USAGE_X ((HID_USAGE_PAGE_DESKTOP << 16) | 0x30) 26 + #define HID_USAGE_Y ((HID_USAGE_PAGE_DESKTOP << 16) | 0x31) 27 + #define HID_USAGE_PRESSURE ((HID_USAGE_PAGE_DIGITIZER << 16) | 0x30) 28 + #define HID_USAGE_X_TILT ((HID_USAGE_PAGE_DIGITIZER << 16) | 0x3d) 29 + #define HID_USAGE_Y_TILT ((HID_USAGE_PAGE_DIGITIZER << 16) | 0x3e) 30 + #define HID_USAGE_FINGER ((HID_USAGE_PAGE_DIGITIZER << 16) | 0x22) 31 + #define HID_USAGE_STYLUS ((HID_USAGE_PAGE_DIGITIZER << 16) | 0x20) 32 + #define HID_USAGE_CONTACTMAX ((HID_USAGE_PAGE_DIGITIZER << 16) | 0x55) 32 33 #define HID_COLLECTION 0xa1 33 34 #define HID_COLLECTION_LOGICAL 0x02 34 35 #define HID_COLLECTION_END 0xc0 35 - 36 - enum { 37 - WCM_UNDEFINED = 0, 38 - WCM_DESKTOP, 39 - WCM_DIGITIZER, 40 - }; 41 36 42 37 struct hid_descriptor { 43 38 struct usb_descriptor_header header; ··· 300 305 char limit = 0; 301 306 /* result has to be defined as int for some devices */ 302 307 int result = 0, touch_max = 0; 303 - int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; 308 + int i = 0, page = 0, finger = 0, pen = 0; 304 309 unsigned char *report; 305 310 306 311 report = kzalloc(hid_desc->wDescriptorLength, GFP_KERNEL); ··· 327 332 328 333 switch (report[i]) { 329 334 case HID_USAGE_PAGE: 330 - switch (report[i + 1]) { 331 - case HID_USAGE_PAGE_DIGITIZER: 332 - usage = WCM_DIGITIZER; 333 - i++; 334 - break; 335 - 336 - case HID_USAGE_PAGE_DESKTOP: 337 - usage = WCM_DESKTOP; 338 - i++; 339 - break; 340 - } 335 + page = report[i + 1]; 336 + i++; 341 337 break; 342 338 343 339 case HID_USAGE: 344 - switch (report[i + 1]) { 340 + switch (page << 16 | report[i + 1]) { 345 341 case HID_USAGE_X: 346 - if (usage == WCM_DESKTOP) { 347 - if (finger) { 348 - features->device_type = BTN_TOOL_FINGER; 349 - /* touch device at least supports one touch point */ 350 - touch_max = 1; 351 - switch (features->type) { 352 - case TABLETPC2FG: 353 - features->pktlen = WACOM_PKGLEN_TPC2FG; 354 - break; 342 + if (finger) { 343 + features->device_type = BTN_TOOL_FINGER; 344 + /* touch device at least supports one touch point */ 345 + touch_max = 1; 346 + switch (features->type) { 347 + case TABLETPC2FG: 348 + features->pktlen = WACOM_PKGLEN_TPC2FG; 349 + break; 355 350 356 - case MTSCREEN: 357 - case WACOM_24HDT: 358 - features->pktlen = WACOM_PKGLEN_MTOUCH; 359 - break; 351 + case MTSCREEN: 352 + case WACOM_24HDT: 353 + features->pktlen = WACOM_PKGLEN_MTOUCH; 354 + break; 360 355 361 - case MTTPC: 362 - features->pktlen = WACOM_PKGLEN_MTTPC; 363 - break; 356 + case MTTPC: 357 + features->pktlen = WACOM_PKGLEN_MTTPC; 358 + break; 364 359 365 - case BAMBOO_PT: 366 - features->pktlen = WACOM_PKGLEN_BBTOUCH; 367 - break; 360 + case BAMBOO_PT: 361 + features->pktlen = WACOM_PKGLEN_BBTOUCH; 362 + break; 368 363 369 - default: 370 - features->pktlen = WACOM_PKGLEN_GRAPHIRE; 371 - break; 372 - } 364 + default: 365 + features->pktlen = WACOM_PKGLEN_GRAPHIRE; 366 + break; 367 + } 373 368 374 - switch (features->type) { 375 - case BAMBOO_PT: 376 - features->x_phy = 377 - get_unaligned_le16(&report[i + 5]); 378 - features->x_max = 379 - get_unaligned_le16(&report[i + 8]); 380 - i += 15; 381 - break; 369 + switch (features->type) { 370 + case BAMBOO_PT: 371 + features->x_phy = 372 + get_unaligned_le16(&report[i + 5]); 373 + features->x_max = 374 + get_unaligned_le16(&report[i + 8]); 375 + i += 15; 376 + break; 382 377 383 - case WACOM_24HDT: 384 - features->x_max = 385 - get_unaligned_le16(&report[i + 3]); 386 - features->x_phy = 387 - get_unaligned_le16(&report[i + 8]); 388 - features->unit = report[i - 1]; 389 - features->unitExpo = report[i - 3]; 390 - i += 12; 391 - break; 392 - 393 - default: 394 - features->x_max = 395 - get_unaligned_le16(&report[i + 3]); 396 - features->x_phy = 397 - get_unaligned_le16(&report[i + 6]); 398 - features->unit = report[i + 9]; 399 - features->unitExpo = report[i + 11]; 400 - i += 12; 401 - break; 402 - } 403 - } else if (pen) { 404 - /* penabled only accepts exact bytes of data */ 405 - if (features->type >= TABLETPC) 406 - features->pktlen = WACOM_PKGLEN_GRAPHIRE; 407 - features->device_type = BTN_TOOL_PEN; 378 + case WACOM_24HDT: 408 379 features->x_max = 409 380 get_unaligned_le16(&report[i + 3]); 410 - i += 4; 381 + features->x_phy = 382 + get_unaligned_le16(&report[i + 8]); 383 + features->unit = report[i - 1]; 384 + features->unitExpo = report[i - 3]; 385 + i += 12; 386 + break; 387 + 388 + default: 389 + features->x_max = 390 + get_unaligned_le16(&report[i + 3]); 391 + features->x_phy = 392 + get_unaligned_le16(&report[i + 6]); 393 + features->unit = report[i + 9]; 394 + features->unitExpo = report[i + 11]; 395 + i += 12; 396 + break; 411 397 } 398 + } else if (pen) { 399 + /* penabled only accepts exact bytes of data */ 400 + if (features->type >= TABLETPC) 401 + features->pktlen = WACOM_PKGLEN_GRAPHIRE; 402 + features->device_type = BTN_TOOL_PEN; 403 + features->x_max = 404 + get_unaligned_le16(&report[i + 3]); 405 + i += 4; 412 406 } 413 407 break; 414 408 415 409 case HID_USAGE_Y: 416 - if (usage == WCM_DESKTOP) { 417 - if (finger) { 418 - switch (features->type) { 419 - case TABLETPC2FG: 420 - case MTSCREEN: 421 - case MTTPC: 422 - features->y_max = 423 - get_unaligned_le16(&report[i + 3]); 424 - features->y_phy = 425 - get_unaligned_le16(&report[i + 6]); 426 - i += 7; 427 - break; 428 - 429 - case WACOM_24HDT: 430 - features->y_max = 431 - get_unaligned_le16(&report[i + 3]); 432 - features->y_phy = 433 - get_unaligned_le16(&report[i - 2]); 434 - i += 7; 435 - break; 436 - 437 - case BAMBOO_PT: 438 - features->y_phy = 439 - get_unaligned_le16(&report[i + 3]); 440 - features->y_max = 441 - get_unaligned_le16(&report[i + 6]); 442 - i += 12; 443 - break; 444 - 445 - default: 446 - features->y_max = 447 - features->x_max; 448 - features->y_phy = 449 - get_unaligned_le16(&report[i + 3]); 450 - i += 4; 451 - break; 452 - } 453 - } else if (pen) { 410 + if (finger) { 411 + switch (features->type) { 412 + case TABLETPC2FG: 413 + case MTSCREEN: 414 + case MTTPC: 454 415 features->y_max = 455 416 get_unaligned_le16(&report[i + 3]); 417 + features->y_phy = 418 + get_unaligned_le16(&report[i + 6]); 419 + i += 7; 420 + break; 421 + 422 + case WACOM_24HDT: 423 + features->y_max = 424 + get_unaligned_le16(&report[i + 3]); 425 + features->y_phy = 426 + get_unaligned_le16(&report[i - 2]); 427 + i += 7; 428 + break; 429 + 430 + case BAMBOO_PT: 431 + features->y_phy = 432 + get_unaligned_le16(&report[i + 3]); 433 + features->y_max = 434 + get_unaligned_le16(&report[i + 6]); 435 + i += 12; 436 + break; 437 + 438 + default: 439 + features->y_max = 440 + features->x_max; 441 + features->y_phy = 442 + get_unaligned_le16(&report[i + 3]); 456 443 i += 4; 444 + break; 457 445 } 446 + } else if (pen) { 447 + features->y_max = 448 + get_unaligned_le16(&report[i + 3]); 449 + i += 4; 458 450 } 459 451 break; 460 452 ··· 466 484 wacom_retrieve_report_data(intf, features); 467 485 i++; 468 486 break; 487 + 488 + case HID_USAGE_PRESSURE: 489 + if (pen) { 490 + features->pressure_max = 491 + get_unaligned_le16(&report[i + 3]); 492 + i += 4; 493 + } 494 + break; 469 495 } 470 496 break; 471 497 472 498 case HID_COLLECTION_END: 473 499 /* reset UsagePage and Finger */ 474 - finger = usage = 0; 500 + finger = page = 0; 475 501 break; 476 502 477 503 case HID_COLLECTION:
+10 -19
drivers/input/tablet/wacom_wac.c
··· 178 178 179 179 static int wacom_dtu_irq(struct wacom_wac *wacom) 180 180 { 181 - struct wacom_features *features = &wacom->features; 182 - char *data = wacom->data; 181 + unsigned char *data = wacom->data; 183 182 struct input_dev *input = wacom->input; 184 - int prox = data[1] & 0x20, pressure; 183 + int prox = data[1] & 0x20; 185 184 186 185 dev_dbg(input->dev.parent, 187 186 "%s: received report #%d", __func__, data[0]); ··· 197 198 input_report_key(input, BTN_STYLUS2, data[1] & 0x10); 198 199 input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); 199 200 input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); 200 - pressure = ((data[7] & 0x01) << 8) | data[6]; 201 - if (pressure < 0) 202 - pressure = features->pressure_max + pressure + 1; 203 - input_report_abs(input, ABS_PRESSURE, pressure); 201 + input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x01) << 8) | data[6]); 204 202 input_report_key(input, BTN_TOUCH, data[1] & 0x05); 205 203 if (!prox) /* out-prox */ 206 204 wacom->id[0] = 0; ··· 902 906 static int wacom_24hdt_irq(struct wacom_wac *wacom) 903 907 { 904 908 struct input_dev *input = wacom->input; 905 - char *data = wacom->data; 909 + unsigned char *data = wacom->data; 906 910 int i; 907 911 int current_num_contacts = data[61]; 908 912 int contacts_to_send = 0; ··· 955 959 static int wacom_mt_touch(struct wacom_wac *wacom) 956 960 { 957 961 struct input_dev *input = wacom->input; 958 - char *data = wacom->data; 962 + unsigned char *data = wacom->data; 959 963 int i; 960 964 int current_num_contacts = data[2]; 961 965 int contacts_to_send = 0; ··· 1034 1038 1035 1039 static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len) 1036 1040 { 1037 - char *data = wacom->data; 1041 + unsigned char *data = wacom->data; 1038 1042 struct input_dev *input = wacom->input; 1039 1043 bool prox; 1040 1044 int x = 0, y = 0; ··· 1070 1074 1071 1075 static int wacom_tpc_pen(struct wacom_wac *wacom) 1072 1076 { 1073 - struct wacom_features *features = &wacom->features; 1074 - char *data = wacom->data; 1077 + unsigned char *data = wacom->data; 1075 1078 struct input_dev *input = wacom->input; 1076 - int pressure; 1077 1079 bool prox = data[1] & 0x20; 1078 1080 1079 1081 if (!wacom->shared->stylus_in_proximity) /* first in prox */ ··· 1087 1093 input_report_key(input, BTN_STYLUS2, data[1] & 0x10); 1088 1094 input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); 1089 1095 input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); 1090 - pressure = ((data[7] & 0x01) << 8) | data[6]; 1091 - if (pressure < 0) 1092 - pressure = features->pressure_max + pressure + 1; 1093 - input_report_abs(input, ABS_PRESSURE, pressure); 1096 + input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x03) << 8) | data[6]); 1094 1097 input_report_key(input, BTN_TOUCH, data[1] & 0x05); 1095 1098 input_report_key(input, wacom->tool[0], prox); 1096 1099 return 1; ··· 1098 1107 1099 1108 static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) 1100 1109 { 1101 - char *data = wacom->data; 1110 + unsigned char *data = wacom->data; 1102 1111 1103 1112 dev_dbg(wacom->input->dev.parent, 1104 1113 "%s: received report #%d\n", __func__, data[0]); ··· 1829 1838 case DTU: 1830 1839 if (features->type == DTUS) { 1831 1840 input_set_capability(input_dev, EV_MSC, MSC_SERIAL); 1832 - for (i = 0; i < 3; i++) 1841 + for (i = 0; i < 4; i++) 1833 1842 __set_bit(BTN_0 + i, input_dev->keybit); 1834 1843 } 1835 1844 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
+1 -1
drivers/input/touchscreen/ads7846.c
··· 425 425 name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \ 426 426 { \ 427 427 struct ads7846 *ts = dev_get_drvdata(dev); \ 428 - ssize_t v = ads7846_read12_ser(dev, \ 428 + ssize_t v = ads7846_read12_ser(&ts->spi->dev, \ 429 429 READ_12BIT_SER(var)); \ 430 430 if (v < 0) \ 431 431 return v; \
+20 -34
drivers/irqchip/irq-armada-370-xp.c
··· 41 41 #define ARMADA_370_XP_INT_SET_ENABLE_OFFS (0x30) 42 42 #define ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS (0x34) 43 43 #define ARMADA_370_XP_INT_SOURCE_CTL(irq) (0x100 + irq*4) 44 + #define ARMADA_370_XP_INT_SOURCE_CPU_MASK 0xF 44 45 45 46 #define ARMADA_370_XP_CPU_INTACK_OFFS (0x44) 46 47 #define ARMADA_375_PPI_CAUSE (0x10) ··· 133 132 struct msi_desc *desc) 134 133 { 135 134 struct msi_msg msg; 136 - irq_hw_number_t hwirq; 137 - int virq; 135 + int virq, hwirq; 138 136 139 137 hwirq = armada_370_xp_alloc_msi(); 140 138 if (hwirq < 0) ··· 159 159 unsigned int irq) 160 160 { 161 161 struct irq_data *d = irq_get_irq_data(irq); 162 + unsigned long hwirq = d->hwirq; 163 + 162 164 irq_dispose_mapping(irq); 163 - armada_370_xp_free_msi(d->hwirq); 165 + armada_370_xp_free_msi(hwirq); 166 + } 167 + 168 + static int armada_370_xp_check_msi_device(struct msi_chip *chip, struct pci_dev *dev, 169 + int nvec, int type) 170 + { 171 + /* We support MSI, but not MSI-X */ 172 + if (type == PCI_CAP_ID_MSI) 173 + return 0; 174 + return -EINVAL; 164 175 } 165 176 166 177 static struct irq_chip armada_370_xp_msi_irq_chip = { ··· 212 201 213 202 msi_chip->setup_irq = armada_370_xp_setup_msi_irq; 214 203 msi_chip->teardown_irq = armada_370_xp_teardown_msi_irq; 204 + msi_chip->check_device = armada_370_xp_check_msi_device; 215 205 msi_chip->of_node = node; 216 206 217 207 armada_370_xp_msi_domain = ··· 256 244 static int armada_xp_set_affinity(struct irq_data *d, 257 245 const struct cpumask *mask_val, bool force) 258 246 { 259 - unsigned long reg; 260 - unsigned long new_mask = 0; 261 - unsigned long online_mask = 0; 262 - unsigned long count = 0; 263 247 irq_hw_number_t hwirq = irqd_to_hwirq(d); 248 + unsigned long reg, mask; 264 249 int cpu; 265 250 266 - for_each_cpu(cpu, mask_val) { 267 - new_mask |= 1 << cpu_logical_map(cpu); 268 - count++; 269 - } 270 - 271 - /* 272 - * Forbid mutlicore interrupt affinity 273 - * This is required since the MPIC HW doesn't limit 274 - * several CPUs from acknowledging the same interrupt. 275 - */ 276 - if (count > 1) 277 - return -EINVAL; 278 - 279 - for_each_cpu(cpu, cpu_online_mask) 280 - online_mask |= 1 << cpu_logical_map(cpu); 251 + /* Select a single core from the affinity mask which is online */ 252 + cpu = cpumask_any_and(mask_val, cpu_online_mask); 253 + mask = 1UL << cpu_logical_map(cpu); 281 254 282 255 raw_spin_lock(&irq_controller_lock); 283 - 284 256 reg = readl(main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq)); 285 - reg = (reg & (~online_mask)) | new_mask; 257 + reg = (reg & (~ARMADA_370_XP_INT_SOURCE_CPU_MASK)) | mask; 286 258 writel(reg, main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq)); 287 - 288 259 raw_spin_unlock(&irq_controller_lock); 289 260 290 261 return 0; ··· 489 494 490 495 #ifdef CONFIG_SMP 491 496 armada_xp_mpic_smp_cpu_init(); 492 - 493 - /* 494 - * Set the default affinity from all CPUs to the boot cpu. 495 - * This is required since the MPIC doesn't limit several CPUs 496 - * from acknowledging the same interrupt. 497 - */ 498 - cpumask_clear(irq_default_affinity); 499 - cpumask_set_cpu(smp_processor_id(), irq_default_affinity); 500 - 501 497 #endif 502 498 503 499 armada_370_xp_msi_init(node, main_int_res.start);
+1 -1
drivers/irqchip/irq-crossbar.c
··· 107 107 int i, size, max, reserved = 0, entry; 108 108 const __be32 *irqsr; 109 109 110 - cb = kzalloc(sizeof(struct cb_device *), GFP_KERNEL); 110 + cb = kzalloc(sizeof(*cb), GFP_KERNEL); 111 111 112 112 if (!cb) 113 113 return -ENOMEM;
+6 -2
drivers/irqchip/irq-gic.c
··· 246 246 bool force) 247 247 { 248 248 void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); 249 - unsigned int shift = (gic_irq(d) % 4) * 8; 250 - unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); 249 + unsigned int cpu, shift = (gic_irq(d) % 4) * 8; 251 250 u32 val, mask, bit; 251 + 252 + if (!force) 253 + cpu = cpumask_any_and(mask_val, cpu_online_mask); 254 + else 255 + cpu = cpumask_first(mask_val); 252 256 253 257 if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids) 254 258 return -EINVAL;
+1
drivers/md/dm-cache-target.c
··· 2488 2488 2489 2489 } else { 2490 2490 inc_hit_counter(cache, bio); 2491 + pb->all_io_entry = dm_deferred_entry_inc(cache->all_io_ds); 2491 2492 2492 2493 if (bio_data_dir(bio) == WRITE && writethrough_mode(&cache->features) && 2493 2494 !is_dirty(cache, lookup_result.cblock))
+71 -6
drivers/md/dm-thin.c
··· 232 232 struct bio_list deferred_bio_list; 233 233 struct bio_list retry_on_resume_list; 234 234 struct rb_root sort_bio_list; /* sorted list of deferred bios */ 235 + 236 + /* 237 + * Ensures the thin is not destroyed until the worker has finished 238 + * iterating the active_thins list. 239 + */ 240 + atomic_t refcount; 241 + struct completion can_destroy; 235 242 }; 236 243 237 244 /*----------------------------------------------------------------*/ ··· 1493 1486 blk_finish_plug(&plug); 1494 1487 } 1495 1488 1489 + static void thin_get(struct thin_c *tc); 1490 + static void thin_put(struct thin_c *tc); 1491 + 1492 + /* 1493 + * We can't hold rcu_read_lock() around code that can block. So we 1494 + * find a thin with the rcu lock held; bump a refcount; then drop 1495 + * the lock. 1496 + */ 1497 + static struct thin_c *get_first_thin(struct pool *pool) 1498 + { 1499 + struct thin_c *tc = NULL; 1500 + 1501 + rcu_read_lock(); 1502 + if (!list_empty(&pool->active_thins)) { 1503 + tc = list_entry_rcu(pool->active_thins.next, struct thin_c, list); 1504 + thin_get(tc); 1505 + } 1506 + rcu_read_unlock(); 1507 + 1508 + return tc; 1509 + } 1510 + 1511 + static struct thin_c *get_next_thin(struct pool *pool, struct thin_c *tc) 1512 + { 1513 + struct thin_c *old_tc = tc; 1514 + 1515 + rcu_read_lock(); 1516 + list_for_each_entry_continue_rcu(tc, &pool->active_thins, list) { 1517 + thin_get(tc); 1518 + thin_put(old_tc); 1519 + rcu_read_unlock(); 1520 + return tc; 1521 + } 1522 + thin_put(old_tc); 1523 + rcu_read_unlock(); 1524 + 1525 + return NULL; 1526 + } 1527 + 1496 1528 static void process_deferred_bios(struct pool *pool) 1497 1529 { 1498 1530 unsigned long flags; ··· 1539 1493 struct bio_list bios; 1540 1494 struct thin_c *tc; 1541 1495 1542 - rcu_read_lock(); 1543 - list_for_each_entry_rcu(tc, &pool->active_thins, list) 1496 + tc = get_first_thin(pool); 1497 + while (tc) { 1544 1498 process_thin_deferred_bios(tc); 1545 - rcu_read_unlock(); 1499 + tc = get_next_thin(pool, tc); 1500 + } 1546 1501 1547 1502 /* 1548 1503 * If there are any deferred flush bios, we must commit ··· 1625 1578 { 1626 1579 struct noflush_work w; 1627 1580 1628 - INIT_WORK(&w.worker, fn); 1581 + INIT_WORK_ONSTACK(&w.worker, fn); 1629 1582 w.tc = tc; 1630 1583 atomic_set(&w.complete, 0); 1631 1584 init_waitqueue_head(&w.wait); ··· 3108 3061 /*---------------------------------------------------------------- 3109 3062 * Thin target methods 3110 3063 *--------------------------------------------------------------*/ 3064 + static void thin_get(struct thin_c *tc) 3065 + { 3066 + atomic_inc(&tc->refcount); 3067 + } 3068 + 3069 + static void thin_put(struct thin_c *tc) 3070 + { 3071 + if (atomic_dec_and_test(&tc->refcount)) 3072 + complete(&tc->can_destroy); 3073 + } 3074 + 3111 3075 static void thin_dtr(struct dm_target *ti) 3112 3076 { 3113 3077 struct thin_c *tc = ti->private; 3114 3078 unsigned long flags; 3079 + 3080 + thin_put(tc); 3081 + wait_for_completion(&tc->can_destroy); 3115 3082 3116 3083 spin_lock_irqsave(&tc->pool->lock, flags); 3117 3084 list_del_rcu(&tc->list); ··· 3162 3101 struct thin_c *tc; 3163 3102 struct dm_dev *pool_dev, *origin_dev; 3164 3103 struct mapped_device *pool_md; 3104 + unsigned long flags; 3165 3105 3166 3106 mutex_lock(&dm_thin_pool_table.mutex); 3167 3107 ··· 3253 3191 3254 3192 mutex_unlock(&dm_thin_pool_table.mutex); 3255 3193 3256 - spin_lock(&tc->pool->lock); 3194 + atomic_set(&tc->refcount, 1); 3195 + init_completion(&tc->can_destroy); 3196 + 3197 + spin_lock_irqsave(&tc->pool->lock, flags); 3257 3198 list_add_tail_rcu(&tc->list, &tc->pool->active_thins); 3258 - spin_unlock(&tc->pool->lock); 3199 + spin_unlock_irqrestore(&tc->pool->lock, flags); 3259 3200 /* 3260 3201 * This synchronize_rcu() call is needed here otherwise we risk a 3261 3202 * wake_worker() call finding no bios to process (because the newly
+9 -6
drivers/md/dm-verity.c
··· 330 330 return r; 331 331 } 332 332 } 333 - 334 333 todo = 1 << v->data_dev_block_bits; 335 - while (io->iter.bi_size) { 334 + do { 336 335 u8 *page; 336 + unsigned len; 337 337 struct bio_vec bv = bio_iter_iovec(bio, io->iter); 338 338 339 339 page = kmap_atomic(bv.bv_page); 340 - r = crypto_shash_update(desc, page + bv.bv_offset, 341 - bv.bv_len); 340 + len = bv.bv_len; 341 + if (likely(len >= todo)) 342 + len = todo; 343 + r = crypto_shash_update(desc, page + bv.bv_offset, len); 342 344 kunmap_atomic(page); 343 345 344 346 if (r < 0) { ··· 348 346 return r; 349 347 } 350 348 351 - bio_advance_iter(bio, &io->iter, bv.bv_len); 352 - } 349 + bio_advance_iter(bio, &io->iter, len); 350 + todo -= len; 351 + } while (todo); 353 352 354 353 if (!v->version) { 355 354 r = crypto_shash_update(desc, v->salt, v->salt_size);
+27 -1
drivers/of/irq.c
··· 364 364 365 365 memset(r, 0, sizeof(*r)); 366 366 /* 367 - * Get optional "interrupts-names" property to add a name 367 + * Get optional "interrupt-names" property to add a name 368 368 * to the resource. 369 369 */ 370 370 of_property_read_string_index(dev, "interrupt-names", index, ··· 378 378 return irq; 379 379 } 380 380 EXPORT_SYMBOL_GPL(of_irq_to_resource); 381 + 382 + /** 383 + * of_irq_get - Decode a node's IRQ and return it as a Linux irq number 384 + * @dev: pointer to device tree node 385 + * @index: zero-based index of the irq 386 + * 387 + * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain 388 + * is not yet created. 389 + * 390 + */ 391 + int of_irq_get(struct device_node *dev, int index) 392 + { 393 + int rc; 394 + struct of_phandle_args oirq; 395 + struct irq_domain *domain; 396 + 397 + rc = of_irq_parse_one(dev, index, &oirq); 398 + if (rc) 399 + return rc; 400 + 401 + domain = irq_find_host(oirq.np); 402 + if (!domain) 403 + return -EPROBE_DEFER; 404 + 405 + return irq_create_of_mapping(&oirq); 406 + } 381 407 382 408 /** 383 409 * of_irq_count - Count the number of IRQs a node uses
+3 -1
drivers/of/platform.c
··· 168 168 rc = of_address_to_resource(np, i, res); 169 169 WARN_ON(rc); 170 170 } 171 - WARN_ON(of_irq_to_resource_table(np, res, num_irq) != num_irq); 171 + if (of_irq_to_resource_table(np, res, num_irq) != num_irq) 172 + pr_debug("not all legacy IRQ resources mapped for %s\n", 173 + np->name); 172 174 } 173 175 174 176 dev->dev.of_node = of_node_get(np);
+32
drivers/of/selftest.c
··· 10 10 #include <linux/module.h> 11 11 #include <linux/of.h> 12 12 #include <linux/of_irq.h> 13 + #include <linux/of_platform.h> 13 14 #include <linux/list.h> 14 15 #include <linux/mutex.h> 15 16 #include <linux/slab.h> ··· 428 427 } 429 428 } 430 429 430 + static void __init of_selftest_platform_populate(void) 431 + { 432 + int irq; 433 + struct device_node *np; 434 + struct platform_device *pdev; 435 + 436 + np = of_find_node_by_path("/testcase-data"); 437 + of_platform_populate(np, of_default_bus_match_table, NULL, NULL); 438 + 439 + /* Test that a missing irq domain returns -EPROBE_DEFER */ 440 + np = of_find_node_by_path("/testcase-data/testcase-device1"); 441 + pdev = of_find_device_by_node(np); 442 + if (!pdev) 443 + selftest(0, "device 1 creation failed\n"); 444 + irq = platform_get_irq(pdev, 0); 445 + if (irq != -EPROBE_DEFER) 446 + selftest(0, "device deferred probe failed - %d\n", irq); 447 + 448 + /* Test that a parsing failure does not return -EPROBE_DEFER */ 449 + np = of_find_node_by_path("/testcase-data/testcase-device2"); 450 + pdev = of_find_device_by_node(np); 451 + if (!pdev) 452 + selftest(0, "device 2 creation failed\n"); 453 + irq = platform_get_irq(pdev, 0); 454 + if (irq >= 0 || irq == -EPROBE_DEFER) 455 + selftest(0, "device parsing error failed - %d\n", irq); 456 + 457 + selftest(1, "passed"); 458 + } 459 + 431 460 static int __init of_selftest(void) 432 461 { 433 462 struct device_node *np; ··· 476 445 of_selftest_parse_interrupts(); 477 446 of_selftest_parse_interrupts_extended(); 478 447 of_selftest_match_node(); 448 + of_selftest_platform_populate(); 479 449 pr_info("end of selftest - %i passed, %i failed\n", 480 450 selftest_results.passed, selftest_results.failed); 481 451 return 0;
+13
drivers/of/testcase-data/tests-interrupts.dtsi
··· 54 54 <&test_intmap1 1 2>; 55 55 }; 56 56 }; 57 + 58 + testcase-device1 { 59 + compatible = "testcase-device"; 60 + interrupt-parent = <&test_intc0>; 61 + interrupts = <1>; 62 + }; 63 + 64 + testcase-device2 { 65 + compatible = "testcase-device"; 66 + interrupt-parent = <&test_intc2>; 67 + interrupts = <1>; /* invalid specifier - too short */ 68 + }; 57 69 }; 70 + 58 71 };
+1
drivers/phy/Kconfig
··· 33 33 34 34 config OMAP_CONTROL_PHY 35 35 tristate "OMAP CONTROL PHY Driver" 36 + depends on ARCH_OMAP2PLUS || COMPILE_TEST 36 37 help 37 38 Enable this to add support for the PHY part present in the control 38 39 module. This driver has API to power on the USB2 PHY and to write to
+5 -4
drivers/phy/Makefile
··· 13 13 obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o 14 14 obj-$(CONFIG_PHY_EXYNOS5250_SATA) += phy-exynos5250-sata.o 15 15 obj-$(CONFIG_PHY_SUN4I_USB) += phy-sun4i-usb.o 16 - obj-$(CONFIG_PHY_SAMSUNG_USB2) += phy-samsung-usb2.o 17 - obj-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o 18 - obj-$(CONFIG_PHY_EXYNOS4X12_USB2) += phy-exynos4x12-usb2.o 19 - obj-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o 16 + obj-$(CONFIG_PHY_SAMSUNG_USB2) += phy-exynos-usb2.o 17 + phy-exynos-usb2-y += phy-samsung-usb2.o 18 + phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o 19 + phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4X12_USB2) += phy-exynos4x12-usb2.o 20 + phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o 20 21 obj-$(CONFIG_PHY_XGENE) += phy-xgene.o
+3
drivers/phy/phy-core.c
··· 64 64 class_dev_iter_init(&iter, phy_class, NULL, NULL); 65 65 while ((dev = class_dev_iter_next(&iter))) { 66 66 phy = to_phy(dev); 67 + 68 + if (!phy->init_data) 69 + continue; 67 70 count = phy->init_data->num_consumers; 68 71 consumers = phy->init_data->consumers; 69 72 while (count--) {
+11 -6
drivers/pinctrl/pinctrl-as3722.c
··· 64 64 }; 65 65 66 66 struct as3722_gpio_pin_control { 67 - bool enable_gpio_invert; 68 67 unsigned mode_prop; 69 68 int io_function; 70 69 }; ··· 319 320 return mode; 320 321 } 321 322 322 - if (as_pci->gpio_control[offset].enable_gpio_invert) 323 - mode |= AS3722_GPIO_INV; 324 - 325 - return as3722_write(as3722, AS3722_GPIOn_CONTROL_REG(offset), mode); 323 + return as3722_update_bits(as3722, AS3722_GPIOn_CONTROL_REG(offset), 324 + AS3722_GPIO_MODE_MASK, mode); 326 325 } 327 326 328 327 static const struct pinmux_ops as3722_pinmux_ops = { ··· 493 496 { 494 497 struct as3722_pctrl_info *as_pci = to_as_pci(chip); 495 498 struct as3722 *as3722 = as_pci->as3722; 496 - int en_invert = as_pci->gpio_control[offset].enable_gpio_invert; 499 + int en_invert; 497 500 u32 val; 498 501 int ret; 502 + 503 + ret = as3722_read(as3722, AS3722_GPIOn_CONTROL_REG(offset), &val); 504 + if (ret < 0) { 505 + dev_err(as_pci->dev, 506 + "GPIO_CONTROL%d_REG read failed: %d\n", offset, ret); 507 + return; 508 + } 509 + en_invert = !!(val & AS3722_GPIO_INV); 499 510 500 511 if (value) 501 512 val = (en_invert) ? 0 : AS3722_GPIOn_SIGNAL(offset);
+13
drivers/pinctrl/pinctrl-single.c
··· 810 810 static int pcs_add_pin(struct pcs_device *pcs, unsigned offset, 811 811 unsigned pin_pos) 812 812 { 813 + struct pcs_soc_data *pcs_soc = &pcs->socdata; 813 814 struct pinctrl_pin_desc *pin; 814 815 struct pcs_name *pn; 815 816 int i; ··· 820 819 dev_err(pcs->dev, "too many pins, max %i\n", 821 820 pcs->desc.npins); 822 821 return -ENOMEM; 822 + } 823 + 824 + if (pcs_soc->irq_enable_mask) { 825 + unsigned val; 826 + 827 + val = pcs->read(pcs->base + offset); 828 + if (val & pcs_soc->irq_enable_mask) { 829 + dev_dbg(pcs->dev, "irq enabled at boot for pin at %lx (%x), clearing\n", 830 + (unsigned long)pcs->res->start + offset, val); 831 + val &= ~pcs_soc->irq_enable_mask; 832 + pcs->write(val, pcs->base + offset); 833 + } 823 834 } 824 835 825 836 pin = &pcs->pins.pa[i];
+1 -2
drivers/pinctrl/pinctrl-tb10x.c
··· 629 629 */ 630 630 for (i = 0; i < state->pinfuncgrpcnt; i++) { 631 631 const struct tb10x_pinfuncgrp *pfg = &state->pingroups[i]; 632 - unsigned int port = pfg->port; 633 632 unsigned int mode = pfg->mode; 634 - int j; 633 + int j, port = pfg->port; 635 634 636 635 /* 637 636 * Skip pin groups which are always mapped and don't need
+1 -2
drivers/pinctrl/sh-pfc/pfc-r8a7790.c
··· 4794 4794 FN_MSIOF0_SCK_B, 0, 4795 4795 /* IP5_23_21 [3] */ 4796 4796 FN_WE1_N, FN_IERX, FN_CAN1_RX, FN_VI1_G4, 4797 - FN_VI1_G4_B, FN_VI2_R6, FN_SCIFA0_CTS_N_B, 4798 - FN_IERX_C, 0, 4797 + FN_VI1_G4_B, FN_VI2_R6, FN_SCIFA0_CTS_N_B, FN_IERX_C, 4799 4798 /* IP5_20_18 [3] */ 4800 4799 FN_WE0_N, FN_IECLK, FN_CAN_CLK, 4801 4800 FN_VI2_VSYNC_N, FN_SCIFA0_TXD_B, FN_VI2_VSYNC_N_B, 0, 0,
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a7791.c
··· 5288 5288 /* SEL_SCIF3 [2] */ 5289 5289 FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, FN_SEL_SCIF3_3, 5290 5290 /* SEL_IEB [2] */ 5291 - FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2, 5291 + FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2, 0, 5292 5292 /* SEL_MMC [1] */ 5293 5293 FN_SEL_MMC_0, FN_SEL_MMC_1, 5294 5294 /* SEL_SCIF5 [1] */
+26 -18
drivers/pnp/pnpacpi/core.c
··· 83 83 { 84 84 struct acpi_device *acpi_dev; 85 85 acpi_handle handle; 86 - struct acpi_buffer buffer; 87 - int ret; 86 + int ret = 0; 88 87 89 88 pnp_dbg(&dev->dev, "set resources\n"); 90 89 ··· 96 97 if (WARN_ON_ONCE(acpi_dev != dev->data)) 97 98 dev->data = acpi_dev; 98 99 99 - ret = pnpacpi_build_resource_template(dev, &buffer); 100 - if (ret) 101 - return ret; 102 - ret = pnpacpi_encode_resources(dev, &buffer); 103 - if (ret) { 100 + if (acpi_has_method(handle, METHOD_NAME__SRS)) { 101 + struct acpi_buffer buffer; 102 + 103 + ret = pnpacpi_build_resource_template(dev, &buffer); 104 + if (ret) 105 + return ret; 106 + 107 + ret = pnpacpi_encode_resources(dev, &buffer); 108 + if (!ret) { 109 + acpi_status status; 110 + 111 + status = acpi_set_current_resources(handle, &buffer); 112 + if (ACPI_FAILURE(status)) 113 + ret = -EIO; 114 + } 104 115 kfree(buffer.pointer); 105 - return ret; 106 116 } 107 - if (ACPI_FAILURE(acpi_set_current_resources(handle, &buffer))) 108 - ret = -EINVAL; 109 - else if (acpi_bus_power_manageable(handle)) 117 + if (!ret && acpi_bus_power_manageable(handle)) 110 118 ret = acpi_bus_set_power(handle, ACPI_STATE_D0); 111 - kfree(buffer.pointer); 119 + 112 120 return ret; 113 121 } 114 122 ··· 123 117 { 124 118 struct acpi_device *acpi_dev; 125 119 acpi_handle handle; 126 - int ret; 120 + acpi_status status; 127 121 128 122 dev_dbg(&dev->dev, "disable resources\n"); 129 123 ··· 134 128 } 135 129 136 130 /* acpi_unregister_gsi(pnp_irq(dev, 0)); */ 137 - ret = 0; 138 131 if (acpi_bus_power_manageable(handle)) 139 132 acpi_bus_set_power(handle, ACPI_STATE_D3_COLD); 140 - /* continue even if acpi_bus_set_power() fails */ 141 - if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL))) 142 - ret = -ENODEV; 143 - return ret; 133 + 134 + /* continue even if acpi_bus_set_power() fails */ 135 + status = acpi_evaluate_object(handle, "_DIS", NULL, NULL); 136 + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) 137 + return -ENODEV; 138 + 139 + return 0; 144 140 } 145 141 146 142 #ifdef CONFIG_ACPI_SLEEP
+79
drivers/pnp/quirks.c
··· 15 15 16 16 #include <linux/types.h> 17 17 #include <linux/kernel.h> 18 + #include <linux/pci.h> 18 19 #include <linux/string.h> 19 20 #include <linux/slab.h> 20 21 #include <linux/pnp.h> ··· 335 334 } 336 335 #endif 337 336 337 + #ifdef CONFIG_PCI 338 + /* Device IDs of parts that have 32KB MCH space */ 339 + static const unsigned int mch_quirk_devices[] = { 340 + 0x0154, /* Ivy Bridge */ 341 + 0x0c00, /* Haswell */ 342 + }; 343 + 344 + static struct pci_dev *get_intel_host(void) 345 + { 346 + int i; 347 + struct pci_dev *host; 348 + 349 + for (i = 0; i < ARRAY_SIZE(mch_quirk_devices); i++) { 350 + host = pci_get_device(PCI_VENDOR_ID_INTEL, mch_quirk_devices[i], 351 + NULL); 352 + if (host) 353 + return host; 354 + } 355 + return NULL; 356 + } 357 + 358 + static void quirk_intel_mch(struct pnp_dev *dev) 359 + { 360 + struct pci_dev *host; 361 + u32 addr_lo, addr_hi; 362 + struct pci_bus_region region; 363 + struct resource mch; 364 + struct pnp_resource *pnp_res; 365 + struct resource *res; 366 + 367 + host = get_intel_host(); 368 + if (!host) 369 + return; 370 + 371 + /* 372 + * MCHBAR is not an architected PCI BAR, so MCH space is usually 373 + * reported as a PNP0C02 resource. The MCH space was originally 374 + * 16KB, but is 32KB in newer parts. Some BIOSes still report a 375 + * PNP0C02 resource that is only 16KB, which means the rest of the 376 + * MCH space is consumed but unreported. 377 + */ 378 + 379 + /* 380 + * Read MCHBAR for Host Member Mapped Register Range Base 381 + * https://www-ssl.intel.com/content/www/us/en/processors/core/4th-gen-core-family-desktop-vol-2-datasheet 382 + * Sec 3.1.12. 383 + */ 384 + pci_read_config_dword(host, 0x48, &addr_lo); 385 + region.start = addr_lo & ~0x7fff; 386 + pci_read_config_dword(host, 0x4c, &addr_hi); 387 + region.start |= (u64) addr_hi << 32; 388 + region.end = region.start + 32*1024 - 1; 389 + 390 + memset(&mch, 0, sizeof(mch)); 391 + mch.flags = IORESOURCE_MEM; 392 + pcibios_bus_to_resource(host->bus, &mch, &region); 393 + 394 + list_for_each_entry(pnp_res, &dev->resources, list) { 395 + res = &pnp_res->res; 396 + if (res->end < mch.start || res->start > mch.end) 397 + continue; /* no overlap */ 398 + if (res->start == mch.start && res->end == mch.end) 399 + continue; /* exact match */ 400 + 401 + dev_info(&dev->dev, FW_BUG "PNP resource %pR covers only part of %s Intel MCH; extending to %pR\n", 402 + res, pci_name(host), &mch); 403 + res->start = mch.start; 404 + res->end = mch.end; 405 + break; 406 + } 407 + 408 + pci_dev_put(host); 409 + } 410 + #endif 411 + 338 412 /* 339 413 * PnP Quirks 340 414 * Cards or devices that need some tweaking due to incomplete resource info ··· 439 363 {"PNP0c02", quirk_system_pci_resources}, 440 364 #ifdef CONFIG_AMD_NB 441 365 {"PNP0c01", quirk_amd_mmconfig_area}, 366 + #endif 367 + #ifdef CONFIG_PCI 368 + {"PNP0c02", quirk_intel_mch}, 442 369 #endif 443 370 {""} 444 371 };
+10 -9
drivers/power/reset/vexpress-poweroff.c
··· 11 11 * Copyright (C) 2012 ARM Limited 12 12 */ 13 13 14 - #include <linux/jiffies.h> 14 + #include <linux/delay.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> 17 17 #include <linux/platform_device.h> ··· 23 23 static void vexpress_reset_do(struct device *dev, const char *what) 24 24 { 25 25 int err = -ENOENT; 26 - struct vexpress_config_func *func = 27 - vexpress_config_func_get_by_dev(dev); 26 + struct vexpress_config_func *func = dev_get_drvdata(dev); 28 27 29 28 if (func) { 30 - unsigned long timeout; 31 - 32 29 err = vexpress_config_write(func, 0, 0); 33 - 34 - timeout = jiffies + HZ; 35 - while (time_before(jiffies, timeout)) 36 - cpu_relax(); 30 + if (!err) 31 + mdelay(1000); 37 32 } 38 33 39 34 dev_emerg(dev, "Unable to %s (%d)\n", what, err); ··· 91 96 enum vexpress_reset_func func; 92 97 const struct of_device_id *match = 93 98 of_match_device(vexpress_reset_of_match, &pdev->dev); 99 + struct vexpress_config_func *config_func; 94 100 95 101 if (match) 96 102 func = (enum vexpress_reset_func)match->data; 97 103 else 98 104 func = pdev->id_entry->driver_data; 105 + 106 + config_func = vexpress_config_func_get_by_dev(&pdev->dev); 107 + if (!config_func) 108 + return -EINVAL; 109 + dev_set_drvdata(&pdev->dev, config_func); 99 110 100 111 switch (func) { 101 112 case FUNC_SHUTDOWN:
+20 -56
drivers/regulator/pbias-regulator.c
··· 38 38 struct pbias_regulator_data { 39 39 struct regulator_desc desc; 40 40 void __iomem *pbias_addr; 41 - unsigned int pbias_reg; 42 41 struct regulator_dev *dev; 43 42 struct regmap *syscon; 44 43 const struct pbias_reg_info *info; 45 44 int voltage; 46 45 }; 47 46 48 - static int pbias_regulator_set_voltage(struct regulator_dev *dev, 49 - int min_uV, int max_uV, unsigned *selector) 50 - { 51 - struct pbias_regulator_data *data = rdev_get_drvdata(dev); 52 - const struct pbias_reg_info *info = data->info; 53 - int ret, vmode; 54 - 55 - if (min_uV <= 1800000) 56 - vmode = 0; 57 - else if (min_uV > 1800000) 58 - vmode = info->vmode; 59 - 60 - ret = regmap_update_bits(data->syscon, data->pbias_reg, 61 - info->vmode, vmode); 62 - 63 - return ret; 64 - } 65 - 66 - static int pbias_regulator_get_voltage(struct regulator_dev *rdev) 67 - { 68 - struct pbias_regulator_data *data = rdev_get_drvdata(rdev); 69 - const struct pbias_reg_info *info = data->info; 70 - int value, voltage; 71 - 72 - regmap_read(data->syscon, data->pbias_reg, &value); 73 - value &= info->vmode; 74 - 75 - voltage = value ? 3000000 : 1800000; 76 - 77 - return voltage; 78 - } 47 + static const unsigned int pbias_volt_table[] = { 48 + 1800000, 49 + 3000000 50 + }; 79 51 80 52 static int pbias_regulator_enable(struct regulator_dev *rdev) 81 53 { 82 54 struct pbias_regulator_data *data = rdev_get_drvdata(rdev); 83 55 const struct pbias_reg_info *info = data->info; 84 - int ret; 85 56 86 - ret = regmap_update_bits(data->syscon, data->pbias_reg, 87 - info->enable_mask, info->enable); 88 - 89 - return ret; 90 - } 91 - 92 - static int pbias_regulator_disable(struct regulator_dev *rdev) 93 - { 94 - struct pbias_regulator_data *data = rdev_get_drvdata(rdev); 95 - const struct pbias_reg_info *info = data->info; 96 - int ret; 97 - 98 - ret = regmap_update_bits(data->syscon, data->pbias_reg, 99 - info->enable_mask, 0); 100 - return ret; 57 + return regmap_update_bits(data->syscon, rdev->desc->enable_reg, 58 + info->enable_mask, info->enable); 101 59 } 102 60 103 61 static int pbias_regulator_is_enable(struct regulator_dev *rdev) ··· 64 106 const struct pbias_reg_info *info = data->info; 65 107 int value; 66 108 67 - regmap_read(data->syscon, data->pbias_reg, &value); 109 + regmap_read(data->syscon, rdev->desc->enable_reg, &value); 68 110 69 - return (value & info->enable_mask) == info->enable_mask; 111 + return (value & info->enable_mask) == info->enable; 70 112 } 71 113 72 114 static struct regulator_ops pbias_regulator_voltage_ops = { 73 - .set_voltage = pbias_regulator_set_voltage, 74 - .get_voltage = pbias_regulator_get_voltage, 75 - .enable = pbias_regulator_enable, 76 - .disable = pbias_regulator_disable, 77 - .is_enabled = pbias_regulator_is_enable, 115 + .list_voltage = regulator_list_voltage_table, 116 + .get_voltage_sel = regulator_get_voltage_sel_regmap, 117 + .set_voltage_sel = regulator_set_voltage_sel_regmap, 118 + .enable = pbias_regulator_enable, 119 + .disable = regulator_disable_regmap, 120 + .is_enabled = pbias_regulator_is_enable, 78 121 }; 79 122 80 123 static const struct pbias_reg_info pbias_mmc_omap2430 = { ··· 151 192 if (IS_ERR(syscon)) 152 193 return PTR_ERR(syscon); 153 194 195 + cfg.regmap = syscon; 154 196 cfg.dev = &pdev->dev; 155 197 156 198 for (idx = 0; idx < PBIAS_NUM_REGS && data_idx < count; idx++) { ··· 167 207 if (!res) 168 208 return -EINVAL; 169 209 170 - drvdata[data_idx].pbias_reg = res->start; 171 210 drvdata[data_idx].syscon = syscon; 172 211 drvdata[data_idx].info = info; 173 212 drvdata[data_idx].desc.name = info->name; 174 213 drvdata[data_idx].desc.owner = THIS_MODULE; 175 214 drvdata[data_idx].desc.type = REGULATOR_VOLTAGE; 176 215 drvdata[data_idx].desc.ops = &pbias_regulator_voltage_ops; 216 + drvdata[data_idx].desc.volt_table = pbias_volt_table; 177 217 drvdata[data_idx].desc.n_voltages = 2; 178 218 drvdata[data_idx].desc.enable_time = info->enable_time; 219 + drvdata[data_idx].desc.vsel_reg = res->start; 220 + drvdata[data_idx].desc.vsel_mask = info->vmode; 221 + drvdata[data_idx].desc.enable_reg = res->start; 222 + drvdata[data_idx].desc.enable_mask = info->enable_mask; 179 223 180 224 cfg.init_data = pbias_matches[idx].init_data; 181 225 cfg.driver_data = &drvdata[data_idx];
+17 -5
drivers/s390/cio/chsc.c
··· 541 541 542 542 static void chsc_process_event_information(struct chsc_sei *sei, u64 ntsm) 543 543 { 544 - do { 544 + static int ntsm_unsupported; 545 + 546 + while (true) { 545 547 memset(sei, 0, sizeof(*sei)); 546 548 sei->request.length = 0x0010; 547 549 sei->request.code = 0x000e; 548 - sei->ntsm = ntsm; 550 + if (!ntsm_unsupported) 551 + sei->ntsm = ntsm; 549 552 550 553 if (chsc(sei)) 551 554 break; 552 555 553 556 if (sei->response.code != 0x0001) { 554 - CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x)\n", 555 - sei->response.code); 557 + CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x, ntsm=%llx)\n", 558 + sei->response.code, sei->ntsm); 559 + 560 + if (sei->response.code == 3 && sei->ntsm) { 561 + /* Fallback for old firmware. */ 562 + ntsm_unsupported = 1; 563 + continue; 564 + } 556 565 break; 557 566 } 558 567 ··· 577 568 CIO_CRW_EVENT(2, "chsc: unhandled nt: %d\n", sei->nt); 578 569 break; 579 570 } 580 - } while (sei->u.nt0_area.flags & 0x80); 571 + 572 + if (!(sei->u.nt0_area.flags & 0x80)) 573 + break; 574 + } 581 575 } 582 576 583 577 /*
+4 -4
drivers/scsi/hpsa.c
··· 7463 7463 if (hpsa_simple_mode) 7464 7464 return; 7465 7465 7466 + trans_support = readl(&(h->cfgtable->TransportSupport)); 7467 + if (!(trans_support & PERFORMANT_MODE)) 7468 + return; 7469 + 7466 7470 /* Check for I/O accelerator mode support */ 7467 7471 if (trans_support & CFGTBL_Trans_io_accel1) { 7468 7472 transMethod |= CFGTBL_Trans_io_accel1 | ··· 7483 7479 } 7484 7480 7485 7481 /* TODO, check that this next line h->nreply_queues is correct */ 7486 - trans_support = readl(&(h->cfgtable->TransportSupport)); 7487 - if (!(trans_support & PERFORMANT_MODE)) 7488 - return; 7489 - 7490 7482 h->nreply_queues = h->msix_vector > 0 ? h->msix_vector : 1; 7491 7483 hpsa_get_max_perf_mode_cmds(h); 7492 7484 /* Performant mode ring buffer and supporting data structures */
+12
drivers/scsi/scsi_error.c
··· 189 189 /* 190 190 * Retry after abort failed, escalate to next level. 191 191 */ 192 + scmd->eh_eflags &= ~SCSI_EH_ABORT_SCHEDULED; 192 193 SCSI_LOG_ERROR_RECOVERY(3, 193 194 scmd_printk(KERN_INFO, scmd, 194 195 "scmd %p previous abort failed\n", scmd)); ··· 921 920 ses->prot_op = scmd->prot_op; 922 921 923 922 scmd->prot_op = SCSI_PROT_NORMAL; 923 + scmd->eh_eflags = 0; 924 924 scmd->cmnd = ses->eh_cmnd; 925 925 memset(scmd->cmnd, 0, BLK_MAX_CDB); 926 926 memset(&scmd->sdb, 0, sizeof(scmd->sdb)); 927 927 scmd->request->next_rq = NULL; 928 + scmd->result = 0; 928 929 929 930 if (sense_bytes) { 930 931 scmd->sdb.length = min_t(unsigned, SCSI_SENSE_BUFFERSIZE, ··· 1160 1157 __func__)); 1161 1158 break; 1162 1159 } 1160 + if (status_byte(scmd->result) != CHECK_CONDITION) 1161 + /* 1162 + * don't request sense if there's no check condition 1163 + * status because the error we're processing isn't one 1164 + * that has a sense code (and some devices get 1165 + * confused by sense requests out of the blue) 1166 + */ 1167 + continue; 1168 + 1163 1169 SCSI_LOG_ERROR_RECOVERY(2, scmd_printk(KERN_INFO, scmd, 1164 1170 "%s: requesting sense\n", 1165 1171 current->comm));
+4 -2
drivers/scsi/scsi_lib.c
··· 137 137 * lock such that the kblockd_schedule_work() call happens 138 138 * before blk_cleanup_queue() finishes. 139 139 */ 140 + cmd->result = 0; 140 141 spin_lock_irqsave(q->queue_lock, flags); 141 142 blk_requeue_request(q, cmd->request); 142 143 kblockd_schedule_work(q, &device->requeue_work); ··· 1045 1044 */ 1046 1045 int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask) 1047 1046 { 1047 + struct scsi_device *sdev = cmd->device; 1048 1048 struct request *rq = cmd->request; 1049 1049 1050 1050 int error = scsi_init_sgtable(rq, &cmd->sdb, gfp_mask); ··· 1093 1091 scsi_release_buffers(cmd); 1094 1092 cmd->request->special = NULL; 1095 1093 scsi_put_command(cmd); 1096 - put_device(&cmd->device->sdev_gendev); 1094 + put_device(&sdev->sdev_gendev); 1097 1095 return error; 1098 1096 } 1099 1097 EXPORT_SYMBOL(scsi_init_io); ··· 1275 1273 struct scsi_cmnd *cmd = req->special; 1276 1274 scsi_release_buffers(cmd); 1277 1275 scsi_put_command(cmd); 1278 - put_device(&cmd->device->sdev_gendev); 1276 + put_device(&sdev->sdev_gendev); 1279 1277 req->special = NULL; 1280 1278 } 1281 1279 break;
+3
drivers/spi/spi-atmel.c
··· 1115 1115 atmel_spi_next_xfer_pio(master, xfer); 1116 1116 } 1117 1117 1118 + /* interrupts are disabled, so free the lock for schedule */ 1119 + atmel_spi_unlock(as); 1118 1120 ret = wait_for_completion_timeout(&as->xfer_completion, 1119 1121 SPI_DMA_TIMEOUT); 1122 + atmel_spi_lock(as); 1120 1123 if (WARN_ON(ret == 0)) { 1121 1124 dev_err(&spi->dev, 1122 1125 "spi trasfer timeout, err %d\n", ret);
+1
drivers/spi/spi-bfin5xx.c
··· 12 12 #include <linux/module.h> 13 13 #include <linux/delay.h> 14 14 #include <linux/device.h> 15 + #include <linux/gpio.h> 15 16 #include <linux/slab.h> 16 17 #include <linux/io.h> 17 18 #include <linux/ioport.h>
+2 -2
drivers/spi/spi-sh-hspi.c
··· 244 244 return -ENOMEM; 245 245 } 246 246 247 - clk = clk_get(NULL, "shyway_clk"); 247 + clk = clk_get(&pdev->dev, NULL); 248 248 if (IS_ERR(clk)) { 249 - dev_err(&pdev->dev, "shyway_clk is required\n"); 249 + dev_err(&pdev->dev, "couldn't get clock\n"); 250 250 ret = -EINVAL; 251 251 goto error0; 252 252 }
+17 -3
drivers/spi/spi-sirf.c
··· 287 287 sspi->left_rx_word) 288 288 sspi->rx_word(sspi); 289 289 290 - if (spi_stat & (SIRFSOC_SPI_FIFO_EMPTY 291 - | SIRFSOC_SPI_TXFIFO_THD_REACH)) 290 + if (spi_stat & (SIRFSOC_SPI_TXFIFO_EMPTY | 291 + SIRFSOC_SPI_TXFIFO_THD_REACH)) 292 292 while (!((readl(sspi->base + SIRFSOC_SPI_TXFIFO_STATUS) 293 293 & SIRFSOC_SPI_FIFO_FULL)) && 294 294 sspi->left_tx_word) ··· 470 470 writel(regval, sspi->base + SIRFSOC_SPI_CTRL); 471 471 } else { 472 472 int gpio = sspi->chipselect[spi->chip_select]; 473 - gpio_direction_output(gpio, spi->mode & SPI_CS_HIGH ? 0 : 1); 473 + switch (value) { 474 + case BITBANG_CS_ACTIVE: 475 + gpio_direction_output(gpio, 476 + spi->mode & SPI_CS_HIGH ? 1 : 0); 477 + break; 478 + case BITBANG_CS_INACTIVE: 479 + gpio_direction_output(gpio, 480 + spi->mode & SPI_CS_HIGH ? 0 : 1); 481 + break; 482 + } 474 483 } 475 484 } 476 485 ··· 568 559 regval &= ~SIRFSOC_SPI_CMD_MODE; 569 560 sspi->tx_by_cmd = false; 570 561 } 562 + /* 563 + * set spi controller in RISC chipselect mode, we are controlling CS by 564 + * software BITBANG_CS_ACTIVE and BITBANG_CS_INACTIVE. 565 + */ 566 + regval |= SIRFSOC_SPI_CS_IO_MODE; 571 567 writel(regval, sspi->base + SIRFSOC_SPI_CTRL); 572 568 573 569 if (IS_DMA_VALID(t)) {
+3 -6
drivers/staging/comedi/drivers/usbdux.c
··· 493 493 /* pointer to the DA */ 494 494 *datap++ = val & 0xff; 495 495 *datap++ = (val >> 8) & 0xff; 496 - *datap++ = chan; 496 + *datap++ = chan << 6; 497 497 devpriv->ao_readback[chan] = val; 498 498 499 499 s->async->events |= COMEDI_CB_BLOCK; ··· 1040 1040 /* set current channel of the running acquisition to zero */ 1041 1041 s->async->cur_chan = 0; 1042 1042 1043 - for (i = 0; i < cmd->chanlist_len; ++i) { 1044 - unsigned int chan = CR_CHAN(cmd->chanlist[i]); 1045 - 1046 - devpriv->ao_chanlist[i] = chan << 6; 1047 - } 1043 + for (i = 0; i < cmd->chanlist_len; ++i) 1044 + devpriv->ao_chanlist[i] = CR_CHAN(cmd->chanlist[i]); 1048 1045 1049 1046 /* we count in steps of 1ms (125us) */ 1050 1047 /* 125us mode not used yet */
+1 -1
drivers/staging/iio/adc/mxs-lradc.c
··· 1526 1526 struct resource *iores; 1527 1527 int ret = 0, touch_ret; 1528 1528 int i, s; 1529 - unsigned int scale_uv; 1529 + uint64_t scale_uv; 1530 1530 1531 1531 /* Allocate the IIO device. */ 1532 1532 iio = devm_iio_device_alloc(dev, sizeof(*lradc));
+1
drivers/staging/iio/resolver/ad2s1200.c
··· 70 70 vel = (((s16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4); 71 71 vel = (vel << 4) >> 4; 72 72 *val = vel; 73 + break; 73 74 default: 74 75 mutex_unlock(&st->lock); 75 76 return -EINVAL;
+1 -1
drivers/tty/serial/8250/8250_core.c
··· 1520 1520 status = serial8250_rx_chars(up, status); 1521 1521 } 1522 1522 serial8250_modem_status(up); 1523 - if (status & UART_LSR_THRE) 1523 + if (!up->dma && (status & UART_LSR_THRE)) 1524 1524 serial8250_tx_chars(up); 1525 1525 1526 1526 spin_unlock_irqrestore(&port->lock, flags);
+7 -2
drivers/tty/serial/8250/8250_dma.c
··· 20 20 struct uart_8250_port *p = param; 21 21 struct uart_8250_dma *dma = p->dma; 22 22 struct circ_buf *xmit = &p->port.state->xmit; 23 - 24 - dma->tx_running = 0; 23 + unsigned long flags; 25 24 26 25 dma_sync_single_for_cpu(dma->txchan->device->dev, dma->tx_addr, 27 26 UART_XMIT_SIZE, DMA_TO_DEVICE); 27 + 28 + spin_lock_irqsave(&p->port.lock, flags); 29 + 30 + dma->tx_running = 0; 28 31 29 32 xmit->tail += dma->tx_size; 30 33 xmit->tail &= UART_XMIT_SIZE - 1; ··· 38 35 39 36 if (!uart_circ_empty(xmit) && !uart_tx_stopped(&p->port)) 40 37 serial8250_tx_dma(p); 38 + 39 + spin_unlock_irqrestore(&p->port.lock, flags); 41 40 } 42 41 43 42 static void __dma_rx_complete(void *param)
+12 -11
drivers/tty/serial/samsung.c
··· 1446 1446 static void s3c24xx_serial_put_poll_char(struct uart_port *port, 1447 1447 unsigned char c) 1448 1448 { 1449 - unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON); 1450 - unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); 1449 + unsigned int ufcon = rd_regl(port, S3C2410_UFCON); 1450 + unsigned int ucon = rd_regl(port, S3C2410_UCON); 1451 1451 1452 1452 /* not possible to xmit on unconfigured port */ 1453 1453 if (!s3c24xx_port_configured(ucon)) ··· 1455 1455 1456 1456 while (!s3c24xx_serial_console_txrdy(port, ufcon)) 1457 1457 cpu_relax(); 1458 - wr_regb(cons_uart, S3C2410_UTXH, c); 1458 + wr_regb(port, S3C2410_UTXH, c); 1459 1459 } 1460 1460 1461 1461 #endif /* CONFIG_CONSOLE_POLL */ ··· 1463 1463 static void 1464 1464 s3c24xx_serial_console_putchar(struct uart_port *port, int ch) 1465 1465 { 1466 - unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON); 1467 - unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); 1468 - 1469 - /* not possible to xmit on unconfigured port */ 1470 - if (!s3c24xx_port_configured(ucon)) 1471 - return; 1466 + unsigned int ufcon = rd_regl(port, S3C2410_UFCON); 1472 1467 1473 1468 while (!s3c24xx_serial_console_txrdy(port, ufcon)) 1474 - barrier(); 1475 - wr_regb(cons_uart, S3C2410_UTXH, ch); 1469 + cpu_relax(); 1470 + wr_regb(port, S3C2410_UTXH, ch); 1476 1471 } 1477 1472 1478 1473 static void 1479 1474 s3c24xx_serial_console_write(struct console *co, const char *s, 1480 1475 unsigned int count) 1481 1476 { 1477 + unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); 1478 + 1479 + /* not possible to xmit on unconfigured port */ 1480 + if (!s3c24xx_port_configured(ucon)) 1481 + return; 1482 + 1482 1483 uart_console_write(cons_uart, s, count, s3c24xx_serial_console_putchar); 1483 1484 } 1484 1485
+21 -18
drivers/tty/serial/serial_core.c
··· 137 137 return 1; 138 138 139 139 /* 140 + * Make sure the device is in D0 state. 141 + */ 142 + uart_change_pm(state, UART_PM_STATE_ON); 143 + 144 + /* 140 145 * Initialise and allocate the transmit and temporary 141 146 * buffer. 142 147 */ ··· 830 825 * If we fail to request resources for the 831 826 * new port, try to restore the old settings. 832 827 */ 833 - if (retval && old_type != PORT_UNKNOWN) { 828 + if (retval) { 834 829 uport->iobase = old_iobase; 835 830 uport->type = old_type; 836 831 uport->hub6 = old_hub6; 837 832 uport->iotype = old_iotype; 838 833 uport->regshift = old_shift; 839 834 uport->mapbase = old_mapbase; 840 - retval = uport->ops->request_port(uport); 841 - /* 842 - * If we failed to restore the old settings, 843 - * we fail like this. 844 - */ 845 - if (retval) 846 - uport->type = PORT_UNKNOWN; 847 835 848 - /* 849 - * We failed anyway. 850 - */ 851 - retval = -EBUSY; 836 + if (old_type != PORT_UNKNOWN) { 837 + retval = uport->ops->request_port(uport); 838 + /* 839 + * If we failed to restore the old settings, 840 + * we fail like this. 841 + */ 842 + if (retval) 843 + uport->type = PORT_UNKNOWN; 844 + 845 + /* 846 + * We failed anyway. 847 + */ 848 + retval = -EBUSY; 849 + } 850 + 852 851 /* Added to return the correct error -Ram Gupta */ 853 852 goto exit; 854 853 } ··· 1578 1569 retval = -EAGAIN; 1579 1570 goto err_dec_count; 1580 1571 } 1581 - 1582 - /* 1583 - * Make sure the device is in D0 state. 1584 - */ 1585 - if (port->count == 1) 1586 - uart_change_pm(state, UART_PM_STATE_ON); 1587 1572 1588 1573 /* 1589 1574 * Start up the serial port.
+14 -2
drivers/tty/tty_buffer.c
··· 255 255 if (change || left < size) { 256 256 /* This is the slow path - looking for new buffers to use */ 257 257 if ((n = tty_buffer_alloc(port, size)) != NULL) { 258 + unsigned long iflags; 259 + 258 260 n->flags = flags; 259 261 buf->tail = n; 262 + 263 + spin_lock_irqsave(&buf->flush_lock, iflags); 260 264 b->commit = b->used; 261 - smp_mb(); 262 265 b->next = n; 266 + spin_unlock_irqrestore(&buf->flush_lock, iflags); 267 + 263 268 } else if (change) 264 269 size = 0; 265 270 else ··· 448 443 mutex_lock(&buf->lock); 449 444 450 445 while (1) { 446 + unsigned long flags; 451 447 struct tty_buffer *head = buf->head; 452 448 int count; 453 449 ··· 456 450 if (atomic_read(&buf->priority)) 457 451 break; 458 452 453 + spin_lock_irqsave(&buf->flush_lock, flags); 459 454 count = head->commit - head->read; 460 455 if (!count) { 461 - if (head->next == NULL) 456 + if (head->next == NULL) { 457 + spin_unlock_irqrestore(&buf->flush_lock, flags); 462 458 break; 459 + } 463 460 buf->head = head->next; 461 + spin_unlock_irqrestore(&buf->flush_lock, flags); 464 462 tty_buffer_free(port, head); 465 463 continue; 466 464 } 465 + spin_unlock_irqrestore(&buf->flush_lock, flags); 467 466 468 467 count = receive_buf(tty, head, count); 469 468 if (!count) ··· 523 512 struct tty_bufhead *buf = &port->buf; 524 513 525 514 mutex_init(&buf->lock); 515 + spin_lock_init(&buf->flush_lock); 526 516 tty_buffer_reset(&buf->sentinel, 0); 527 517 buf->head = &buf->sentinel; 528 518 buf->tail = &buf->sentinel;
+34 -3
drivers/usb/chipidea/core.c
··· 277 277 } 278 278 279 279 /** 280 + * ci_usb_phy_init: initialize phy according to different phy type 281 + * @ci: the controller 282 + * 283 + * This function returns an error code if usb_phy_init has failed 284 + */ 285 + static int ci_usb_phy_init(struct ci_hdrc *ci) 286 + { 287 + int ret; 288 + 289 + switch (ci->platdata->phy_mode) { 290 + case USBPHY_INTERFACE_MODE_UTMI: 291 + case USBPHY_INTERFACE_MODE_UTMIW: 292 + case USBPHY_INTERFACE_MODE_HSIC: 293 + ret = usb_phy_init(ci->transceiver); 294 + if (ret) 295 + return ret; 296 + hw_phymode_configure(ci); 297 + break; 298 + case USBPHY_INTERFACE_MODE_ULPI: 299 + case USBPHY_INTERFACE_MODE_SERIAL: 300 + hw_phymode_configure(ci); 301 + ret = usb_phy_init(ci->transceiver); 302 + if (ret) 303 + return ret; 304 + break; 305 + default: 306 + ret = usb_phy_init(ci->transceiver); 307 + } 308 + 309 + return ret; 310 + } 311 + 312 + /** 280 313 * hw_device_reset: resets chip (execute without interruption) 281 314 * @ci: the controller 282 315 * ··· 576 543 return -ENODEV; 577 544 } 578 545 579 - hw_phymode_configure(ci); 580 - 581 546 if (ci->platdata->phy) 582 547 ci->transceiver = ci->platdata->phy; 583 548 else ··· 595 564 return -EPROBE_DEFER; 596 565 } 597 566 598 - ret = usb_phy_init(ci->transceiver); 567 + ret = ci_usb_phy_init(ci); 599 568 if (ret) { 600 569 dev_err(dev, "unable to init phy: %d\n", ret); 601 570 return ret;
+1 -1
drivers/usb/dwc3/core.c
··· 821 821 822 822 spin_lock_irqsave(&dwc->lock, flags); 823 823 824 + dwc3_event_buffers_setup(dwc); 824 825 switch (dwc->dr_mode) { 825 826 case USB_DR_MODE_PERIPHERAL: 826 827 case USB_DR_MODE_OTG: ··· 829 828 /* FALLTHROUGH */ 830 829 case USB_DR_MODE_HOST: 831 830 default: 832 - dwc3_event_buffers_setup(dwc); 833 831 break; 834 832 } 835 833
+4 -8
drivers/usb/dwc3/gadget.c
··· 187 187 * improve this algorithm so that we better use the internal 188 188 * FIFO space 189 189 */ 190 - for (num = 0; num < DWC3_ENDPOINTS_NUM; num++) { 191 - struct dwc3_ep *dep = dwc->eps[num]; 192 - int fifo_number = dep->number >> 1; 190 + for (num = 0; num < dwc->num_in_eps; num++) { 191 + /* bit0 indicates direction; 1 means IN ep */ 192 + struct dwc3_ep *dep = dwc->eps[(num << 1) | 1]; 193 193 int mult = 1; 194 194 int tmp; 195 - 196 - if (!(dep->number & 1)) 197 - continue; 198 195 199 196 if (!(dep->flags & DWC3_EP_ENABLED)) 200 197 continue; ··· 221 224 dev_vdbg(dwc->dev, "%s: Fifo Addr %04x Size %d\n", 222 225 dep->name, last_fifo_depth, fifo_size & 0xffff); 223 226 224 - dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(fifo_number), 225 - fifo_size); 227 + dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(num), fifo_size); 226 228 227 229 last_fifo_depth += (fifo_size & 0xffff); 228 230 }
+7
drivers/usb/gadget/f_fs.c
··· 745 745 */ 746 746 struct usb_gadget *gadget = epfile->ffs->gadget; 747 747 748 + spin_lock_irq(&epfile->ffs->eps_lock); 749 + /* In the meantime, endpoint got disabled or changed. */ 750 + if (epfile->ep != ep) { 751 + spin_unlock_irq(&epfile->ffs->eps_lock); 752 + return -ESHUTDOWN; 753 + } 748 754 /* 749 755 * Controller may require buffer size to be aligned to 750 756 * maxpacketsize of an out endpoint. ··· 758 752 data_len = io_data->read ? 759 753 usb_ep_align_maybe(gadget, ep->ep, io_data->len) : 760 754 io_data->len; 755 + spin_unlock_irq(&epfile->ffs->eps_lock); 761 756 762 757 data = kmalloc(data_len, GFP_KERNEL); 763 758 if (unlikely(!data))
+1 -1
drivers/usb/gadget/f_rndis.c
··· 377 377 if (skb2) 378 378 rndis_add_hdr(skb2); 379 379 380 - dev_kfree_skb_any(skb); 380 + dev_kfree_skb(skb); 381 381 return skb2; 382 382 } 383 383
+5 -1
drivers/usb/gadget/fsl_udc_core.c
··· 1219 1219 struct fsl_udc *udc; 1220 1220 1221 1221 udc = container_of(gadget, struct fsl_udc, gadget); 1222 + 1223 + if (!udc->vbus_active) 1224 + return -EOPNOTSUPP; 1225 + 1222 1226 udc->softconnect = (is_on != 0); 1223 1227 if (can_pullup(udc)) 1224 1228 fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP), ··· 2536 2532 if (!udc_controller) 2537 2533 return -ENODEV; 2538 2534 2539 - usb_del_gadget_udc(&udc_controller->gadget); 2540 2535 udc_controller->done = &done; 2536 + usb_del_gadget_udc(&udc_controller->gadget); 2541 2537 2542 2538 fsl_udc_clk_release(); 2543 2539
+1
drivers/usb/gadget/inode.c
··· 2043 2043 return -ESRCH; 2044 2044 2045 2045 /* fake probe to determine $CHIP */ 2046 + CHIP = NULL; 2046 2047 usb_gadget_probe_driver(&probe_driver); 2047 2048 if (!CHIP) 2048 2049 return -ENODEV;
+1
drivers/usb/gadget/rndis.c
··· 35 35 #include <asm/byteorder.h> 36 36 #include <asm/unaligned.h> 37 37 38 + #include "u_rndis.h" 38 39 39 40 #undef VERBOSE_DEBUG 40 41
+35 -66
drivers/usb/gadget/u_ether.c
··· 48 48 49 49 #define UETH__VERSION "29-May-2008" 50 50 51 - #define GETHER_NAPI_WEIGHT 32 52 - 53 51 struct eth_dev { 54 52 /* lock is held while accessing port_usb 55 53 */ ··· 72 74 struct sk_buff_head *list); 73 75 74 76 struct work_struct work; 75 - struct napi_struct rx_napi; 76 77 77 78 unsigned long todo; 78 79 #define WORK_RX_MEMORY 0 ··· 253 256 DBG(dev, "rx submit --> %d\n", retval); 254 257 if (skb) 255 258 dev_kfree_skb_any(skb); 259 + spin_lock_irqsave(&dev->req_lock, flags); 260 + list_add(&req->list, &dev->rx_reqs); 261 + spin_unlock_irqrestore(&dev->req_lock, flags); 256 262 } 257 263 return retval; 258 264 } 259 265 260 266 static void rx_complete(struct usb_ep *ep, struct usb_request *req) 261 267 { 262 - struct sk_buff *skb = req->context; 268 + struct sk_buff *skb = req->context, *skb2; 263 269 struct eth_dev *dev = ep->driver_data; 264 270 int status = req->status; 265 - bool rx_queue = 0; 266 271 267 272 switch (status) { 268 273 ··· 288 289 } else { 289 290 skb_queue_tail(&dev->rx_frames, skb); 290 291 } 291 - if (!status) 292 - rx_queue = 1; 292 + skb = NULL; 293 + 294 + skb2 = skb_dequeue(&dev->rx_frames); 295 + while (skb2) { 296 + if (status < 0 297 + || ETH_HLEN > skb2->len 298 + || skb2->len > VLAN_ETH_FRAME_LEN) { 299 + dev->net->stats.rx_errors++; 300 + dev->net->stats.rx_length_errors++; 301 + DBG(dev, "rx length %d\n", skb2->len); 302 + dev_kfree_skb_any(skb2); 303 + goto next_frame; 304 + } 305 + skb2->protocol = eth_type_trans(skb2, dev->net); 306 + dev->net->stats.rx_packets++; 307 + dev->net->stats.rx_bytes += skb2->len; 308 + 309 + /* no buffer copies needed, unless hardware can't 310 + * use skb buffers. 311 + */ 312 + status = netif_rx(skb2); 313 + next_frame: 314 + skb2 = skb_dequeue(&dev->rx_frames); 315 + } 293 316 break; 294 317 295 318 /* software-driven interface shutdown */ ··· 334 313 /* FALLTHROUGH */ 335 314 336 315 default: 337 - rx_queue = 1; 338 - dev_kfree_skb_any(skb); 339 316 dev->net->stats.rx_errors++; 340 317 DBG(dev, "rx status %d\n", status); 341 318 break; 342 319 } 343 320 321 + if (skb) 322 + dev_kfree_skb_any(skb); 323 + if (!netif_running(dev->net)) { 344 324 clean: 345 325 spin_lock(&dev->req_lock); 346 326 list_add(&req->list, &dev->rx_reqs); 347 327 spin_unlock(&dev->req_lock); 348 - 349 - if (rx_queue && likely(napi_schedule_prep(&dev->rx_napi))) 350 - __napi_schedule(&dev->rx_napi); 328 + req = NULL; 329 + } 330 + if (req) 331 + rx_submit(dev, req, GFP_ATOMIC); 351 332 } 352 333 353 334 static int prealloc(struct list_head *list, struct usb_ep *ep, unsigned n) ··· 414 391 { 415 392 struct usb_request *req; 416 393 unsigned long flags; 417 - int rx_counts = 0; 418 394 419 395 /* fill unused rxq slots with some skb */ 420 396 spin_lock_irqsave(&dev->req_lock, flags); 421 397 while (!list_empty(&dev->rx_reqs)) { 422 - 423 - if (++rx_counts > qlen(dev->gadget, dev->qmult)) 424 - break; 425 - 426 398 req = container_of(dev->rx_reqs.next, 427 399 struct usb_request, list); 428 400 list_del_init(&req->list); 429 401 spin_unlock_irqrestore(&dev->req_lock, flags); 430 402 431 403 if (rx_submit(dev, req, gfp_flags) < 0) { 432 - spin_lock_irqsave(&dev->req_lock, flags); 433 - list_add(&req->list, &dev->rx_reqs); 434 - spin_unlock_irqrestore(&dev->req_lock, flags); 435 404 defer_kevent(dev, WORK_RX_MEMORY); 436 405 return; 437 406 } ··· 431 416 spin_lock_irqsave(&dev->req_lock, flags); 432 417 } 433 418 spin_unlock_irqrestore(&dev->req_lock, flags); 434 - } 435 - 436 - static int gether_poll(struct napi_struct *napi, int budget) 437 - { 438 - struct eth_dev *dev = container_of(napi, struct eth_dev, rx_napi); 439 - struct sk_buff *skb; 440 - unsigned int work_done = 0; 441 - int status = 0; 442 - 443 - while ((skb = skb_dequeue(&dev->rx_frames))) { 444 - if (status < 0 445 - || ETH_HLEN > skb->len 446 - || skb->len > VLAN_ETH_FRAME_LEN) { 447 - dev->net->stats.rx_errors++; 448 - dev->net->stats.rx_length_errors++; 449 - DBG(dev, "rx length %d\n", skb->len); 450 - dev_kfree_skb_any(skb); 451 - continue; 452 - } 453 - skb->protocol = eth_type_trans(skb, dev->net); 454 - dev->net->stats.rx_packets++; 455 - dev->net->stats.rx_bytes += skb->len; 456 - 457 - status = netif_rx_ni(skb); 458 - } 459 - 460 - if (netif_running(dev->net)) { 461 - rx_fill(dev, GFP_KERNEL); 462 - work_done++; 463 - } 464 - 465 - if (work_done < budget) 466 - napi_complete(&dev->rx_napi); 467 - 468 - return work_done; 469 419 } 470 420 471 421 static void eth_work(struct work_struct *work) ··· 625 645 /* and open the tx floodgates */ 626 646 atomic_set(&dev->tx_qlen, 0); 627 647 netif_wake_queue(dev->net); 628 - napi_enable(&dev->rx_napi); 629 648 } 630 649 631 650 static int eth_open(struct net_device *net) ··· 651 672 unsigned long flags; 652 673 653 674 VDBG(dev, "%s\n", __func__); 654 - napi_disable(&dev->rx_napi); 655 675 netif_stop_queue(net); 656 676 657 677 DBG(dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", ··· 768 790 return ERR_PTR(-ENOMEM); 769 791 770 792 dev = netdev_priv(net); 771 - netif_napi_add(net, &dev->rx_napi, gether_poll, GETHER_NAPI_WEIGHT); 772 793 spin_lock_init(&dev->lock); 773 794 spin_lock_init(&dev->req_lock); 774 795 INIT_WORK(&dev->work, eth_work); ··· 830 853 return ERR_PTR(-ENOMEM); 831 854 832 855 dev = netdev_priv(net); 833 - netif_napi_add(net, &dev->rx_napi, gether_poll, GETHER_NAPI_WEIGHT); 834 856 spin_lock_init(&dev->lock); 835 857 spin_lock_init(&dev->req_lock); 836 858 INIT_WORK(&dev->work, eth_work); ··· 1113 1137 { 1114 1138 struct eth_dev *dev = link->ioport; 1115 1139 struct usb_request *req; 1116 - struct sk_buff *skb; 1117 1140 1118 1141 WARN_ON(!dev); 1119 1142 if (!dev) ··· 1139 1164 spin_lock(&dev->req_lock); 1140 1165 } 1141 1166 spin_unlock(&dev->req_lock); 1142 - 1143 - spin_lock(&dev->rx_frames.lock); 1144 - while ((skb = __skb_dequeue(&dev->rx_frames))) 1145 - dev_kfree_skb_any(skb); 1146 - spin_unlock(&dev->rx_frames.lock); 1147 - 1148 1167 link->in_ep->driver_data = NULL; 1149 1168 link->in_ep->desc = NULL; 1150 1169
+1 -1
drivers/usb/gadget/zero.c
··· 300 300 ss_opts->isoc_interval = gzero_options.isoc_interval; 301 301 ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket; 302 302 ss_opts->isoc_mult = gzero_options.isoc_mult; 303 - ss_opts->isoc_maxburst = gzero_options.isoc_maxpacket; 303 + ss_opts->isoc_maxburst = gzero_options.isoc_maxburst; 304 304 ss_opts->bulk_buflen = gzero_options.bulk_buflen; 305 305 306 306 func_ss = usb_get_function(func_inst_ss);
+3 -3
drivers/usb/host/xhci-pci.c
··· 134 134 */ 135 135 if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP) 136 136 xhci->quirks |= XHCI_SPURIOUS_WAKEUP; 137 + 138 + xhci->quirks |= XHCI_SPURIOUS_REBOOT; 137 139 } 138 140 if (pdev->vendor == PCI_VENDOR_ID_ETRON && 139 141 pdev->device == PCI_DEVICE_ID_ASROCK_P67) { ··· 145 143 xhci->quirks |= XHCI_TRUST_TX_LENGTH; 146 144 } 147 145 if (pdev->vendor == PCI_VENDOR_ID_RENESAS && 148 - pdev->device == 0x0015 && 149 - pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG && 150 - pdev->subsystem_device == 0xc0cd) 146 + pdev->device == 0x0015) 151 147 xhci->quirks |= XHCI_RESET_ON_RESUME; 152 148 if (pdev->vendor == PCI_VENDOR_ID_VIA) 153 149 xhci->quirks |= XHCI_RESET_ON_RESUME;
+31 -36
drivers/usb/host/xhci-ring.c
··· 550 550 struct xhci_ring *ep_ring; 551 551 struct xhci_generic_trb *trb; 552 552 dma_addr_t addr; 553 + u64 hw_dequeue; 553 554 554 555 ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id, 555 556 ep_index, stream_id); ··· 558 557 xhci_warn(xhci, "WARN can't find new dequeue state " 559 558 "for invalid stream ID %u.\n", 560 559 stream_id); 561 - return; 562 - } 563 - state->new_cycle_state = 0; 564 - xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 565 - "Finding segment containing stopped TRB."); 566 - state->new_deq_seg = find_trb_seg(cur_td->start_seg, 567 - dev->eps[ep_index].stopped_trb, 568 - &state->new_cycle_state); 569 - if (!state->new_deq_seg) { 570 - WARN_ON(1); 571 560 return; 572 561 } 573 562 ··· 568 577 if (ep->ep_state & EP_HAS_STREAMS) { 569 578 struct xhci_stream_ctx *ctx = 570 579 &ep->stream_info->stream_ctx_array[stream_id]; 571 - state->new_cycle_state = 0x1 & le64_to_cpu(ctx->stream_ring); 580 + hw_dequeue = le64_to_cpu(ctx->stream_ring); 572 581 } else { 573 582 struct xhci_ep_ctx *ep_ctx 574 583 = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); 575 - state->new_cycle_state = 0x1 & le64_to_cpu(ep_ctx->deq); 584 + hw_dequeue = le64_to_cpu(ep_ctx->deq); 576 585 } 586 + 587 + /* Find virtual address and segment of hardware dequeue pointer */ 588 + state->new_deq_seg = ep_ring->deq_seg; 589 + state->new_deq_ptr = ep_ring->dequeue; 590 + while (xhci_trb_virt_to_dma(state->new_deq_seg, state->new_deq_ptr) 591 + != (dma_addr_t)(hw_dequeue & ~0xf)) { 592 + next_trb(xhci, ep_ring, &state->new_deq_seg, 593 + &state->new_deq_ptr); 594 + if (state->new_deq_ptr == ep_ring->dequeue) { 595 + WARN_ON(1); 596 + return; 597 + } 598 + } 599 + /* 600 + * Find cycle state for last_trb, starting at old cycle state of 601 + * hw_dequeue. If there is only one segment ring, find_trb_seg() will 602 + * return immediately and cannot toggle the cycle state if this search 603 + * wraps around, so add one more toggle manually in that case. 604 + */ 605 + state->new_cycle_state = hw_dequeue & 0x1; 606 + if (ep_ring->first_seg == ep_ring->first_seg->next && 607 + cur_td->last_trb < state->new_deq_ptr) 608 + state->new_cycle_state ^= 0x1; 577 609 578 610 state->new_deq_ptr = cur_td->last_trb; 579 611 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 580 612 "Finding segment containing last TRB in TD."); 581 613 state->new_deq_seg = find_trb_seg(state->new_deq_seg, 582 - state->new_deq_ptr, 583 - &state->new_cycle_state); 614 + state->new_deq_ptr, &state->new_cycle_state); 584 615 if (!state->new_deq_seg) { 585 616 WARN_ON(1); 586 617 return; 587 618 } 588 619 620 + /* Increment to find next TRB after last_trb. Cycle if appropriate. */ 589 621 trb = &state->new_deq_ptr->generic; 590 622 if (TRB_TYPE_LINK_LE32(trb->field[3]) && 591 623 (trb->field[3] & cpu_to_le32(LINK_TOGGLE))) 592 624 state->new_cycle_state ^= 0x1; 593 625 next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); 594 626 595 - /* 596 - * If there is only one segment in a ring, find_trb_seg()'s while loop 597 - * will not run, and it will return before it has a chance to see if it 598 - * needs to toggle the cycle bit. It can't tell if the stalled transfer 599 - * ended just before the link TRB on a one-segment ring, or if the TD 600 - * wrapped around the top of the ring, because it doesn't have the TD in 601 - * question. Look for the one-segment case where stalled TRB's address 602 - * is greater than the new dequeue pointer address. 603 - */ 604 - if (ep_ring->first_seg == ep_ring->first_seg->next && 605 - state->new_deq_ptr < dev->eps[ep_index].stopped_trb) 606 - state->new_cycle_state ^= 0x1; 627 + /* Don't update the ring cycle state for the producer (us). */ 607 628 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 608 629 "Cycle state = 0x%x", state->new_cycle_state); 609 630 610 - /* Don't update the ring cycle state for the producer (us). */ 611 631 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 612 632 "New dequeue segment = %p (virtual)", 613 633 state->new_deq_seg); ··· 801 799 if (list_empty(&ep->cancelled_td_list)) { 802 800 xhci_stop_watchdog_timer_in_irq(xhci, ep); 803 801 ep->stopped_td = NULL; 804 - ep->stopped_trb = NULL; 805 802 ring_doorbell_for_active_rings(xhci, slot_id, ep_index); 806 803 return; 807 804 } ··· 868 867 ring_doorbell_for_active_rings(xhci, slot_id, ep_index); 869 868 } 870 869 871 - /* Clear stopped_td and stopped_trb if endpoint is not halted */ 872 - if (!(ep->ep_state & EP_HALTED)) { 870 + /* Clear stopped_td if endpoint is not halted */ 871 + if (!(ep->ep_state & EP_HALTED)) 873 872 ep->stopped_td = NULL; 874 - ep->stopped_trb = NULL; 875 - } 876 873 877 874 /* 878 875 * Drop the lock and complete the URBs in the cancelled TD list. ··· 1940 1941 struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; 1941 1942 ep->ep_state |= EP_HALTED; 1942 1943 ep->stopped_td = td; 1943 - ep->stopped_trb = event_trb; 1944 1944 ep->stopped_stream = stream_id; 1945 1945 1946 1946 xhci_queue_reset_ep(xhci, slot_id, ep_index); 1947 1947 xhci_cleanup_stalled_ring(xhci, td->urb->dev, ep_index); 1948 1948 1949 1949 ep->stopped_td = NULL; 1950 - ep->stopped_trb = NULL; 1951 1950 ep->stopped_stream = 0; 1952 1951 1953 1952 xhci_ring_cmd_db(xhci); ··· 2027 2030 * the ring dequeue pointer or take this TD off any lists yet. 2028 2031 */ 2029 2032 ep->stopped_td = td; 2030 - ep->stopped_trb = event_trb; 2031 2033 return 0; 2032 2034 } else { 2033 2035 if (trb_comp_code == COMP_STALL) { ··· 2038 2042 * USB class driver clear the stall later. 2039 2043 */ 2040 2044 ep->stopped_td = td; 2041 - ep->stopped_trb = event_trb; 2042 2045 ep->stopped_stream = ep_ring->stream_id; 2043 2046 } else if (xhci_requires_manual_halt_cleanup(xhci, 2044 2047 ep_ctx, trb_comp_code)) {
+3 -4
drivers/usb/host/xhci.c
··· 408 408 409 409 #else 410 410 411 - static int xhci_try_enable_msi(struct usb_hcd *hcd) 411 + static inline int xhci_try_enable_msi(struct usb_hcd *hcd) 412 412 { 413 413 return 0; 414 414 } 415 415 416 - static void xhci_cleanup_msix(struct xhci_hcd *xhci) 416 + static inline void xhci_cleanup_msix(struct xhci_hcd *xhci) 417 417 { 418 418 } 419 419 420 - static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) 420 + static inline void xhci_msix_sync_irqs(struct xhci_hcd *xhci) 421 421 { 422 422 } 423 423 ··· 2954 2954 xhci_ring_cmd_db(xhci); 2955 2955 } 2956 2956 virt_ep->stopped_td = NULL; 2957 - virt_ep->stopped_trb = NULL; 2958 2957 virt_ep->stopped_stream = 0; 2959 2958 spin_unlock_irqrestore(&xhci->lock, flags); 2960 2959
-2
drivers/usb/host/xhci.h
··· 865 865 #define EP_GETTING_NO_STREAMS (1 << 5) 866 866 /* ---- Related to URB cancellation ---- */ 867 867 struct list_head cancelled_td_list; 868 - /* The TRB that was last reported in a stopped endpoint ring */ 869 - union xhci_trb *stopped_trb; 870 868 struct xhci_td *stopped_td; 871 869 unsigned int stopped_stream; 872 870 /* Watchdog timer for stop endpoint command to cancel URBs */
+2 -3
drivers/usb/musb/musb_dsps.c
··· 470 470 struct dsps_glue *glue = dev_get_drvdata(dev->parent); 471 471 472 472 del_timer_sync(&glue->timer); 473 - 474 473 usb_phy_shutdown(musb->xceiv); 474 + debugfs_remove_recursive(glue->dbgfs_root); 475 + 475 476 return 0; 476 477 } 477 478 ··· 708 707 /* disable usbss clocks */ 709 708 pm_runtime_put(&pdev->dev); 710 709 pm_runtime_disable(&pdev->dev); 711 - 712 - debugfs_remove_recursive(glue->dbgfs_root); 713 710 714 711 return 0; 715 712 }
+8
drivers/usb/musb/omap2430.c
··· 316 316 { 317 317 struct omap2430_glue *glue = container_of(mailbox_work, 318 318 struct omap2430_glue, omap_musb_mailbox_work); 319 + struct musb *musb = glue_to_musb(glue); 320 + struct device *dev = musb->controller; 321 + 322 + pm_runtime_get_sync(dev); 319 323 omap_musb_set_mailbox(glue); 324 + pm_runtime_mark_last_busy(dev); 325 + pm_runtime_put_autosuspend(dev); 320 326 } 321 327 322 328 static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci) ··· 422 416 omap_musb_set_mailbox(glue); 423 417 424 418 phy_init(musb->phy); 419 + phy_power_on(musb->phy); 425 420 426 421 pm_runtime_put_noidle(musb->controller); 427 422 return 0; ··· 485 478 del_timer_sync(&musb_idle_timer); 486 479 487 480 omap2430_low_level_exit(musb); 481 + phy_power_off(musb->phy); 488 482 phy_exit(musb->phy); 489 483 490 484 return 0;
+9
drivers/usb/phy/phy-am335x-control.c
··· 3 3 #include <linux/err.h> 4 4 #include <linux/of.h> 5 5 #include <linux/io.h> 6 + #include <linux/delay.h> 6 7 #include "am35x-phy-control.h" 7 8 8 9 struct am335x_control_usb { ··· 87 86 } 88 87 89 88 writel(val, usb_ctrl->phy_reg + reg); 89 + 90 + /* 91 + * Give the PHY ~1ms to complete the power up operation. 92 + * Tests have shown unstable behaviour if other USB PHY related 93 + * registers are written too shortly after such a transition. 94 + */ 95 + if (on) 96 + mdelay(1); 90 97 } 91 98 92 99 static const struct phy_control ctrl_am335x = {
+3
drivers/usb/phy/phy.c
··· 132 132 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 133 133 pr_debug("PHY: unable to find transceiver of type %s\n", 134 134 usb_phy_type_string(type)); 135 + if (!IS_ERR(phy)) 136 + phy = ERR_PTR(-ENODEV); 137 + 135 138 goto err0; 136 139 } 137 140
+33 -17
drivers/usb/serial/io_ti.c
··· 28 28 #include <linux/spinlock.h> 29 29 #include <linux/mutex.h> 30 30 #include <linux/serial.h> 31 + #include <linux/swab.h> 31 32 #include <linux/kfifo.h> 32 33 #include <linux/ioctl.h> 33 34 #include <linux/firmware.h> ··· 281 280 { 282 281 int status = 0; 283 282 __u8 read_length; 284 - __be16 be_start_address; 283 + u16 be_start_address; 285 284 286 285 dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, length); 287 286 ··· 297 296 if (read_length > 1) { 298 297 dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, read_length); 299 298 } 300 - be_start_address = cpu_to_be16(start_address); 299 + /* 300 + * NOTE: Must use swab as wIndex is sent in little-endian 301 + * byte order regardless of host byte order. 302 + */ 303 + be_start_address = swab16((u16)start_address); 301 304 status = ti_vread_sync(dev, UMPC_MEMORY_READ, 302 305 (__u16)address_type, 303 - (__force __u16)be_start_address, 306 + be_start_address, 304 307 buffer, read_length); 305 308 306 309 if (status) { ··· 399 394 struct device *dev = &serial->serial->dev->dev; 400 395 int status = 0; 401 396 int write_length; 402 - __be16 be_start_address; 397 + u16 be_start_address; 403 398 404 399 /* We can only send a maximum of 1 aligned byte page at a time */ 405 400 ··· 414 409 __func__, start_address, write_length); 415 410 usb_serial_debug_data(dev, __func__, write_length, buffer); 416 411 417 - /* Write first page */ 418 - be_start_address = cpu_to_be16(start_address); 412 + /* 413 + * Write first page. 414 + * 415 + * NOTE: Must use swab as wIndex is sent in little-endian byte order 416 + * regardless of host byte order. 417 + */ 418 + be_start_address = swab16((u16)start_address); 419 419 status = ti_vsend_sync(serial->serial->dev, 420 420 UMPC_MEMORY_WRITE, (__u16)address_type, 421 - (__force __u16)be_start_address, 421 + be_start_address, 422 422 buffer, write_length); 423 423 if (status) { 424 424 dev_dbg(dev, "%s - ERROR %d\n", __func__, status); ··· 446 436 __func__, start_address, write_length); 447 437 usb_serial_debug_data(dev, __func__, write_length, buffer); 448 438 449 - /* Write next page */ 450 - be_start_address = cpu_to_be16(start_address); 439 + /* 440 + * Write next page. 441 + * 442 + * NOTE: Must use swab as wIndex is sent in little-endian byte 443 + * order regardless of host byte order. 444 + */ 445 + be_start_address = swab16((u16)start_address); 451 446 status = ti_vsend_sync(serial->serial->dev, UMPC_MEMORY_WRITE, 452 447 (__u16)address_type, 453 - (__force __u16)be_start_address, 448 + be_start_address, 454 449 buffer, write_length); 455 450 if (status) { 456 451 dev_err(dev, "%s - ERROR %d\n", __func__, status); ··· 600 585 if (rom_desc->Type == desc_type) 601 586 return start_address; 602 587 603 - start_address = start_address + sizeof(struct ti_i2c_desc) 604 - + rom_desc->Size; 588 + start_address = start_address + sizeof(struct ti_i2c_desc) + 589 + le16_to_cpu(rom_desc->Size); 605 590 606 591 } while ((start_address < TI_MAX_I2C_SIZE) && rom_desc->Type); 607 592 ··· 614 599 __u16 i; 615 600 __u8 cs = 0; 616 601 617 - for (i = 0; i < rom_desc->Size; i++) 602 + for (i = 0; i < le16_to_cpu(rom_desc->Size); i++) 618 603 cs = (__u8)(cs + buffer[i]); 619 604 620 605 if (cs != rom_desc->CheckSum) { ··· 665 650 break; 666 651 667 652 if ((start_address + sizeof(struct ti_i2c_desc) + 668 - rom_desc->Size) > TI_MAX_I2C_SIZE) { 653 + le16_to_cpu(rom_desc->Size)) > TI_MAX_I2C_SIZE) { 669 654 status = -ENODEV; 670 655 dev_dbg(dev, "%s - structure too big, erroring out.\n", __func__); 671 656 break; ··· 680 665 /* Read the descriptor data */ 681 666 status = read_rom(serial, start_address + 682 667 sizeof(struct ti_i2c_desc), 683 - rom_desc->Size, buffer); 668 + le16_to_cpu(rom_desc->Size), 669 + buffer); 684 670 if (status) 685 671 break; 686 672 ··· 690 674 break; 691 675 } 692 676 start_address = start_address + sizeof(struct ti_i2c_desc) + 693 - rom_desc->Size; 677 + le16_to_cpu(rom_desc->Size); 694 678 695 679 } while ((rom_desc->Type != I2C_DESC_TYPE_ION) && 696 680 (start_address < TI_MAX_I2C_SIZE)); ··· 728 712 729 713 /* Read the descriptor data */ 730 714 status = read_rom(serial, start_address+sizeof(struct ti_i2c_desc), 731 - rom_desc->Size, buffer); 715 + le16_to_cpu(rom_desc->Size), buffer); 732 716 if (status) 733 717 goto exit; 734 718
+77 -4
drivers/usb/serial/option.c
··· 234 234 #define QUALCOMM_VENDOR_ID 0x05C6 235 235 236 236 #define CMOTECH_VENDOR_ID 0x16d8 237 - #define CMOTECH_PRODUCT_6008 0x6008 238 - #define CMOTECH_PRODUCT_6280 0x6280 237 + #define CMOTECH_PRODUCT_6001 0x6001 238 + #define CMOTECH_PRODUCT_CMU_300 0x6002 239 + #define CMOTECH_PRODUCT_6003 0x6003 240 + #define CMOTECH_PRODUCT_6004 0x6004 241 + #define CMOTECH_PRODUCT_6005 0x6005 242 + #define CMOTECH_PRODUCT_CGU_628A 0x6006 243 + #define CMOTECH_PRODUCT_CHE_628S 0x6007 244 + #define CMOTECH_PRODUCT_CMU_301 0x6008 245 + #define CMOTECH_PRODUCT_CHU_628 0x6280 246 + #define CMOTECH_PRODUCT_CHU_628S 0x6281 247 + #define CMOTECH_PRODUCT_CDU_680 0x6803 248 + #define CMOTECH_PRODUCT_CDU_685A 0x6804 249 + #define CMOTECH_PRODUCT_CHU_720S 0x7001 250 + #define CMOTECH_PRODUCT_7002 0x7002 251 + #define CMOTECH_PRODUCT_CHU_629K 0x7003 252 + #define CMOTECH_PRODUCT_7004 0x7004 253 + #define CMOTECH_PRODUCT_7005 0x7005 254 + #define CMOTECH_PRODUCT_CGU_629 0x7006 255 + #define CMOTECH_PRODUCT_CHU_629S 0x700a 256 + #define CMOTECH_PRODUCT_CHU_720I 0x7211 257 + #define CMOTECH_PRODUCT_7212 0x7212 258 + #define CMOTECH_PRODUCT_7213 0x7213 259 + #define CMOTECH_PRODUCT_7251 0x7251 260 + #define CMOTECH_PRODUCT_7252 0x7252 261 + #define CMOTECH_PRODUCT_7253 0x7253 239 262 240 263 #define TELIT_VENDOR_ID 0x1bc7 241 264 #define TELIT_PRODUCT_UC864E 0x1003 ··· 310 287 #define ALCATEL_PRODUCT_X060S_X200 0x0000 311 288 #define ALCATEL_PRODUCT_X220_X500D 0x0017 312 289 #define ALCATEL_PRODUCT_L100V 0x011e 290 + #define ALCATEL_PRODUCT_L800MA 0x0203 313 291 314 292 #define PIRELLI_VENDOR_ID 0x1266 315 293 #define PIRELLI_PRODUCT_C100_1 0x1002 ··· 373 349 #define OLIVETTI_PRODUCT_OLICARD100 0xc000 374 350 #define OLIVETTI_PRODUCT_OLICARD145 0xc003 375 351 #define OLIVETTI_PRODUCT_OLICARD200 0xc005 352 + #define OLIVETTI_PRODUCT_OLICARD500 0xc00b 376 353 377 354 /* Celot products */ 378 355 #define CELOT_VENDOR_ID 0x211f ··· 525 500 526 501 static const struct option_blacklist_info huawei_cdc12_blacklist = { 527 502 .reserved = BIT(1) | BIT(2), 503 + }; 504 + 505 + static const struct option_blacklist_info net_intf0_blacklist = { 506 + .reserved = BIT(0), 528 507 }; 529 508 530 509 static const struct option_blacklist_info net_intf1_blacklist = { ··· 1064 1035 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 1065 1036 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ 1066 1037 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ 1067 - { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ 1068 - { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, 1038 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 1039 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, 1040 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), 1041 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1042 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6004) }, 1043 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6005) }, 1044 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CGU_628A) }, 1045 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHE_628S), 1046 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1047 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_301), 1048 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1049 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_628), 1050 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1051 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_628S) }, 1052 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU_680) }, 1053 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU_685A) }, 1054 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_720S), 1055 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1056 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7002), 1057 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1058 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_629K), 1059 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1060 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7004), 1061 + .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, 1062 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7005) }, 1063 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CGU_629), 1064 + .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, 1065 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_629S), 1066 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1067 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_720I), 1068 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1069 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7212), 1070 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1071 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7213), 1072 + .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, 1073 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7251), 1074 + .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, 1075 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7252), 1076 + .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, 1077 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7253), 1078 + .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, 1069 1079 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, 1070 1080 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, 1071 1081 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, ··· 1568 1500 .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, 1569 1501 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V), 1570 1502 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1503 + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L800MA), 1504 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, 1571 1505 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 1572 1506 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 1573 1507 { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), ··· 1614 1544 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, 1615 1545 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), 1616 1546 .driver_info = (kernel_ulong_t)&net_intf6_blacklist 1547 + }, 1548 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500), 1549 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist 1617 1550 }, 1618 1551 { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ 1619 1552 { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
+9
drivers/usb/serial/qcserial.c
··· 136 136 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 0)}, /* Sierra Wireless MC7710 Device Management */ 137 137 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 2)}, /* Sierra Wireless MC7710 NMEA */ 138 138 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 3)}, /* Sierra Wireless MC7710 Modem */ 139 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68c0, 0)}, /* Sierra Wireless MC73xx Device Management */ 140 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68c0, 2)}, /* Sierra Wireless MC73xx NMEA */ 141 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68c0, 3)}, /* Sierra Wireless MC73xx Modem */ 139 142 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 0)}, /* Sierra Wireless EM7700 Device Management */ 140 143 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 2)}, /* Sierra Wireless EM7700 NMEA */ 141 144 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 3)}, /* Sierra Wireless EM7700 Modem */ 145 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901f, 0)}, /* Sierra Wireless EM7355 Device Management */ 146 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901f, 2)}, /* Sierra Wireless EM7355 NMEA */ 147 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901f, 3)}, /* Sierra Wireless EM7355 Modem */ 148 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9041, 0)}, /* Sierra Wireless MC7305/MC7355 Device Management */ 149 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9041, 2)}, /* Sierra Wireless MC7305/MC7355 NMEA */ 150 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9041, 3)}, /* Sierra Wireless MC7305/MC7355 Modem */ 142 151 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 0)}, /* Netgear AirCard 340U Device Management */ 143 152 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 2)}, /* Netgear AirCard 340U NMEA */ 144 153 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 3)}, /* Netgear AirCard 340U Modem */
+3 -1
drivers/usb/serial/usb-serial.c
··· 1347 1347 static void usb_serial_deregister(struct usb_serial_driver *device) 1348 1348 { 1349 1349 pr_info("USB Serial deregistering driver %s\n", device->description); 1350 + 1350 1351 mutex_lock(&table_lock); 1351 1352 list_del(&device->driver_list); 1352 - usb_serial_bus_deregister(device); 1353 1353 mutex_unlock(&table_lock); 1354 + 1355 + usb_serial_bus_deregister(device); 1354 1356 } 1355 1357 1356 1358 /**
+1 -1
drivers/usb/wusbcore/mmc.c
··· 301 301 302 302 if (chid) 303 303 result = uwb_radio_start(&wusbhc->pal); 304 - else 304 + else if (wusbhc->uwb_rc) 305 305 uwb_radio_stop(&wusbhc->pal); 306 306 307 307 return result;
+2 -2
drivers/usb/wusbcore/wa-xfer.c
··· 2390 2390 done) { 2391 2391 2392 2392 dev_info(dev, "Control EP stall. Queue delayed work.\n"); 2393 - spin_lock_irq(&wa->xfer_list_lock); 2393 + spin_lock(&wa->xfer_list_lock); 2394 2394 /* move xfer from xfer_list to xfer_errored_list. */ 2395 2395 list_move_tail(&xfer->list_node, &wa->xfer_errored_list); 2396 - spin_unlock_irq(&wa->xfer_list_lock); 2396 + spin_unlock(&wa->xfer_list_lock); 2397 2397 spin_unlock_irqrestore(&xfer->lock, flags); 2398 2398 queue_work(wusbd, &wa->xfer_error_work); 2399 2399 } else {
+5 -4
drivers/uwb/drp.c
··· 59 59 struct uwb_rceb *reply, ssize_t reply_size) 60 60 { 61 61 struct uwb_rc_evt_set_drp_ie *r = (struct uwb_rc_evt_set_drp_ie *)reply; 62 + unsigned long flags; 62 63 63 64 if (r != NULL) { 64 65 if (r->bResultCode != UWB_RC_RES_SUCCESS) ··· 68 67 } else 69 68 dev_err(&rc->uwb_dev.dev, "SET-DRP-IE: timeout\n"); 70 69 71 - spin_lock_irq(&rc->rsvs_lock); 70 + spin_lock_irqsave(&rc->rsvs_lock, flags); 72 71 if (rc->set_drp_ie_pending > 1) { 73 72 rc->set_drp_ie_pending = 0; 74 - uwb_rsv_queue_update(rc); 73 + uwb_rsv_queue_update(rc); 75 74 } else { 76 - rc->set_drp_ie_pending = 0; 75 + rc->set_drp_ie_pending = 0; 77 76 } 78 - spin_unlock_irq(&rc->rsvs_lock); 77 + spin_unlock_irqrestore(&rc->rsvs_lock, flags); 79 78 } 80 79 81 80 /**
+34 -8
fs/aio.c
··· 112 112 113 113 struct work_struct free_work; 114 114 115 + /* 116 + * signals when all in-flight requests are done 117 + */ 118 + struct completion *requests_done; 119 + 115 120 struct { 116 121 /* 117 122 * This counts the number of available slots in the ringbuffer, ··· 513 508 { 514 509 struct kioctx *ctx = container_of(ref, struct kioctx, reqs); 515 510 511 + /* At this point we know that there are no any in-flight requests */ 512 + if (ctx->requests_done) 513 + complete(ctx->requests_done); 514 + 516 515 INIT_WORK(&ctx->free_work, free_ioctx); 517 516 schedule_work(&ctx->free_work); 518 517 } ··· 727 718 * when the processes owning a context have all exited to encourage 728 719 * the rapid destruction of the kioctx. 729 720 */ 730 - static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx) 721 + static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx, 722 + struct completion *requests_done) 731 723 { 732 724 if (!atomic_xchg(&ctx->dead, 1)) { 733 725 struct kioctx_table *table; ··· 757 747 if (ctx->mmap_size) 758 748 vm_munmap(ctx->mmap_base, ctx->mmap_size); 759 749 750 + ctx->requests_done = requests_done; 760 751 percpu_ref_kill(&ctx->users); 752 + } else { 753 + if (requests_done) 754 + complete(requests_done); 761 755 } 762 756 } 763 757 ··· 823 809 */ 824 810 ctx->mmap_size = 0; 825 811 826 - kill_ioctx(mm, ctx); 812 + kill_ioctx(mm, ctx, NULL); 827 813 } 828 814 } 829 815 ··· 1199 1185 if (!IS_ERR(ioctx)) { 1200 1186 ret = put_user(ioctx->user_id, ctxp); 1201 1187 if (ret) 1202 - kill_ioctx(current->mm, ioctx); 1188 + kill_ioctx(current->mm, ioctx, NULL); 1203 1189 percpu_ref_put(&ioctx->users); 1204 1190 } 1205 1191 ··· 1217 1203 { 1218 1204 struct kioctx *ioctx = lookup_ioctx(ctx); 1219 1205 if (likely(NULL != ioctx)) { 1220 - kill_ioctx(current->mm, ioctx); 1206 + struct completion requests_done = 1207 + COMPLETION_INITIALIZER_ONSTACK(requests_done); 1208 + 1209 + /* Pass requests_done to kill_ioctx() where it can be set 1210 + * in a thread-safe way. If we try to set it here then we have 1211 + * a race condition if two io_destroy() called simultaneously. 1212 + */ 1213 + kill_ioctx(current->mm, ioctx, &requests_done); 1221 1214 percpu_ref_put(&ioctx->users); 1215 + 1216 + /* Wait until all IO for the context are done. Otherwise kernel 1217 + * keep using user-space buffers even if user thinks the context 1218 + * is destroyed. 1219 + */ 1220 + wait_for_completion(&requests_done); 1221 + 1222 1222 return 0; 1223 1223 } 1224 1224 pr_debug("EINVAL: io_destroy: invalid context id\n"); ··· 1327 1299 &iovec, compat) 1328 1300 : aio_setup_single_vector(req, rw, buf, &nr_segs, 1329 1301 iovec); 1330 - if (ret) 1331 - return ret; 1332 - 1333 - ret = rw_verify_area(rw, file, &req->ki_pos, req->ki_nbytes); 1302 + if (!ret) 1303 + ret = rw_verify_area(rw, file, &req->ki_pos, req->ki_nbytes); 1334 1304 if (ret < 0) { 1335 1305 if (iovec != &inline_vec) 1336 1306 kfree(iovec);
+14
fs/btrfs/ctree.h
··· 2058 2058 #define btrfs_raw_test_opt(o, opt) ((o) & BTRFS_MOUNT_##opt) 2059 2059 #define btrfs_test_opt(root, opt) ((root)->fs_info->mount_opt & \ 2060 2060 BTRFS_MOUNT_##opt) 2061 + #define btrfs_set_and_info(root, opt, fmt, args...) \ 2062 + { \ 2063 + if (!btrfs_test_opt(root, opt)) \ 2064 + btrfs_info(root->fs_info, fmt, ##args); \ 2065 + btrfs_set_opt(root->fs_info->mount_opt, opt); \ 2066 + } 2067 + 2068 + #define btrfs_clear_and_info(root, opt, fmt, args...) \ 2069 + { \ 2070 + if (btrfs_test_opt(root, opt)) \ 2071 + btrfs_info(root->fs_info, fmt, ##args); \ 2072 + btrfs_clear_opt(root->fs_info->mount_opt, opt); \ 2073 + } 2074 + 2061 2075 /* 2062 2076 * Inode flags 2063 2077 */
+5 -5
fs/btrfs/disk-io.c
··· 2861 2861 printk(KERN_ERR "BTRFS: failed to read log tree\n"); 2862 2862 free_extent_buffer(log_tree_root->node); 2863 2863 kfree(log_tree_root); 2864 - goto fail_trans_kthread; 2864 + goto fail_qgroup; 2865 2865 } 2866 2866 /* returns with log_tree_root freed on success */ 2867 2867 ret = btrfs_recover_log_trees(log_tree_root); ··· 2870 2870 "Failed to recover log tree"); 2871 2871 free_extent_buffer(log_tree_root->node); 2872 2872 kfree(log_tree_root); 2873 - goto fail_trans_kthread; 2873 + goto fail_qgroup; 2874 2874 } 2875 2875 2876 2876 if (sb->s_flags & MS_RDONLY) { 2877 2877 ret = btrfs_commit_super(tree_root); 2878 2878 if (ret) 2879 - goto fail_trans_kthread; 2879 + goto fail_qgroup; 2880 2880 } 2881 2881 } 2882 2882 2883 2883 ret = btrfs_find_orphan_roots(tree_root); 2884 2884 if (ret) 2885 - goto fail_trans_kthread; 2885 + goto fail_qgroup; 2886 2886 2887 2887 if (!(sb->s_flags & MS_RDONLY)) { 2888 2888 ret = btrfs_cleanup_fs_roots(fs_info); 2889 2889 if (ret) 2890 - goto fail_trans_kthread; 2890 + goto fail_qgroup; 2891 2891 2892 2892 ret = btrfs_recover_relocation(tree_root); 2893 2893 if (ret < 0) {
+5 -1
fs/btrfs/extent-tree.c
··· 1542 1542 ret = 0; 1543 1543 } 1544 1544 if (ret) { 1545 + key.objectid = bytenr; 1545 1546 key.type = BTRFS_EXTENT_ITEM_KEY; 1546 1547 key.offset = num_bytes; 1547 1548 btrfs_release_path(path); ··· 3543 3542 return extended_to_chunk(flags | tmp); 3544 3543 } 3545 3544 3546 - static u64 get_alloc_profile(struct btrfs_root *root, u64 flags) 3545 + static u64 get_alloc_profile(struct btrfs_root *root, u64 orig_flags) 3547 3546 { 3548 3547 unsigned seq; 3548 + u64 flags; 3549 3549 3550 3550 do { 3551 + flags = orig_flags; 3551 3552 seq = read_seqbegin(&root->fs_info->profiles_lock); 3552 3553 3553 3554 if (flags & BTRFS_BLOCK_GROUP_DATA) ··· 5722 5719 5723 5720 if (ret > 0 && skinny_metadata) { 5724 5721 skinny_metadata = false; 5722 + key.objectid = bytenr; 5725 5723 key.type = BTRFS_EXTENT_ITEM_KEY; 5726 5724 key.offset = num_bytes; 5727 5725 btrfs_release_path(path);
+4 -4
fs/btrfs/file.c
··· 800 800 if (start > key.offset && end < extent_end) { 801 801 BUG_ON(del_nr > 0); 802 802 if (extent_type == BTRFS_FILE_EXTENT_INLINE) { 803 - ret = -EINVAL; 803 + ret = -EOPNOTSUPP; 804 804 break; 805 805 } 806 806 ··· 846 846 */ 847 847 if (start <= key.offset && end < extent_end) { 848 848 if (extent_type == BTRFS_FILE_EXTENT_INLINE) { 849 - ret = -EINVAL; 849 + ret = -EOPNOTSUPP; 850 850 break; 851 851 } 852 852 ··· 872 872 if (start > key.offset && end >= extent_end) { 873 873 BUG_ON(del_nr > 0); 874 874 if (extent_type == BTRFS_FILE_EXTENT_INLINE) { 875 - ret = -EINVAL; 875 + ret = -EOPNOTSUPP; 876 876 break; 877 877 } 878 878 ··· 1777 1777 start_pos = round_down(pos, root->sectorsize); 1778 1778 if (start_pos > i_size_read(inode)) { 1779 1779 /* Expand hole size to cover write data, preventing empty gap */ 1780 - end_pos = round_up(pos + iov->iov_len, root->sectorsize); 1780 + end_pos = round_up(pos + count, root->sectorsize); 1781 1781 err = btrfs_cont_expand(inode, i_size_read(inode), end_pos); 1782 1782 if (err) { 1783 1783 mutex_unlock(&inode->i_mutex);
+7 -17
fs/btrfs/inode-map.c
··· 176 176 177 177 tsk = kthread_run(caching_kthread, root, "btrfs-ino-cache-%llu\n", 178 178 root->root_key.objectid); 179 - BUG_ON(IS_ERR(tsk)); /* -ENOMEM */ 179 + if (IS_ERR(tsk)) { 180 + btrfs_warn(root->fs_info, "failed to start inode caching task"); 181 + btrfs_clear_and_info(root, CHANGE_INODE_CACHE, 182 + "disabling inode map caching"); 183 + } 180 184 } 181 185 182 186 int btrfs_find_free_ino(struct btrfs_root *root, u64 *objectid) ··· 209 205 210 206 void btrfs_return_ino(struct btrfs_root *root, u64 objectid) 211 207 { 212 - struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; 213 208 struct btrfs_free_space_ctl *pinned = root->free_ino_pinned; 214 209 215 210 if (!btrfs_test_opt(root, INODE_MAP_CACHE)) 216 211 return; 217 - 218 212 again: 219 213 if (root->cached == BTRFS_CACHE_FINISHED) { 220 - __btrfs_add_free_space(ctl, objectid, 1); 214 + __btrfs_add_free_space(pinned, objectid, 1); 221 215 } else { 222 - /* 223 - * If we are in the process of caching free ino chunks, 224 - * to avoid adding the same inode number to the free_ino 225 - * tree twice due to cross transaction, we'll leave it 226 - * in the pinned tree until a transaction is committed 227 - * or the caching work is done. 228 - */ 229 - 230 216 down_write(&root->fs_info->commit_root_sem); 231 217 spin_lock(&root->cache_lock); 232 218 if (root->cached == BTRFS_CACHE_FINISHED) { ··· 228 234 229 235 start_caching(root); 230 236 231 - if (objectid <= root->cache_progress || 232 - objectid >= root->highest_objectid) 233 - __btrfs_add_free_space(ctl, objectid, 1); 234 - else 235 - __btrfs_add_free_space(pinned, objectid, 1); 237 + __btrfs_add_free_space(pinned, objectid, 1); 236 238 237 239 up_write(&root->fs_info->commit_root_sem); 238 240 }
+2 -2
fs/btrfs/ioctl.c
··· 3066 3066 new_key.offset + datal, 3067 3067 1); 3068 3068 if (ret) { 3069 - if (ret != -EINVAL) 3069 + if (ret != -EOPNOTSUPP) 3070 3070 btrfs_abort_transaction(trans, 3071 3071 root, ret); 3072 3072 btrfs_end_transaction(trans, root); ··· 3141 3141 new_key.offset + datal, 3142 3142 1); 3143 3143 if (ret) { 3144 - if (ret != -EINVAL) 3144 + if (ret != -EOPNOTSUPP) 3145 3145 btrfs_abort_transaction(trans, 3146 3146 root, ret); 3147 3147 btrfs_end_transaction(trans, root);
+5
fs/btrfs/send.c
··· 349 349 if (p->buf_len >= len) 350 350 return 0; 351 351 352 + if (len > PATH_MAX) { 353 + WARN_ON(1); 354 + return -ENOMEM; 355 + } 356 + 352 357 path_len = p->end - p->start; 353 358 old_buf_len = p->buf_len; 354 359
+6 -16
fs/btrfs/super.c
··· 385 385 {Opt_err, NULL}, 386 386 }; 387 387 388 - #define btrfs_set_and_info(root, opt, fmt, args...) \ 389 - { \ 390 - if (!btrfs_test_opt(root, opt)) \ 391 - btrfs_info(root->fs_info, fmt, ##args); \ 392 - btrfs_set_opt(root->fs_info->mount_opt, opt); \ 393 - } 394 - 395 - #define btrfs_clear_and_info(root, opt, fmt, args...) \ 396 - { \ 397 - if (btrfs_test_opt(root, opt)) \ 398 - btrfs_info(root->fs_info, fmt, ##args); \ 399 - btrfs_clear_opt(root->fs_info->mount_opt, opt); \ 400 - } 401 - 402 388 /* 403 389 * Regular mount options parser. Everything that is needed only when 404 390 * reading in a new superblock is parsed here. ··· 1172 1186 return ERR_PTR(-ENOMEM); 1173 1187 mnt = vfs_kern_mount(&btrfs_fs_type, flags, device_name, 1174 1188 newargs); 1175 - kfree(newargs); 1176 1189 1177 1190 if (PTR_RET(mnt) == -EBUSY) { 1178 1191 if (flags & MS_RDONLY) { ··· 1181 1196 int r; 1182 1197 mnt = vfs_kern_mount(&btrfs_fs_type, flags | MS_RDONLY, device_name, 1183 1198 newargs); 1184 - if (IS_ERR(mnt)) 1199 + if (IS_ERR(mnt)) { 1200 + kfree(newargs); 1185 1201 return ERR_CAST(mnt); 1202 + } 1186 1203 1187 1204 r = btrfs_remount(mnt->mnt_sb, &flags, NULL); 1188 1205 if (r < 0) { 1189 1206 /* FIXME: release vfsmount mnt ??*/ 1207 + kfree(newargs); 1190 1208 return ERR_PTR(r); 1191 1209 } 1192 1210 } 1193 1211 } 1212 + 1213 + kfree(newargs); 1194 1214 1195 1215 if (IS_ERR(mnt)) 1196 1216 return ERR_CAST(mnt);
-3
fs/ceph/file.c
··· 1221 1221 if (!S_ISREG(inode->i_mode)) 1222 1222 return -EOPNOTSUPP; 1223 1223 1224 - if (IS_SWAPFILE(inode)) 1225 - return -ETXTBSY; 1226 - 1227 1224 mutex_lock(&inode->i_mutex); 1228 1225 1229 1226 if (ceph_snap(inode) != CEPH_NOSNAP) {
+7 -7
fs/compat.c
··· 457 457 case F_GETLK64: 458 458 case F_SETLK64: 459 459 case F_SETLKW64: 460 - case F_GETLKP: 461 - case F_SETLKP: 462 - case F_SETLKPW: 460 + case F_OFD_GETLK: 461 + case F_OFD_SETLK: 462 + case F_OFD_SETLKW: 463 463 ret = get_compat_flock64(&f, compat_ptr(arg)); 464 464 if (ret != 0) 465 465 break; ··· 468 468 conv_cmd = convert_fcntl_cmd(cmd); 469 469 ret = sys_fcntl(fd, conv_cmd, (unsigned long)&f); 470 470 set_fs(old_fs); 471 - if ((conv_cmd == F_GETLK || conv_cmd == F_GETLKP) && ret == 0) { 471 + if ((conv_cmd == F_GETLK || conv_cmd == F_OFD_GETLK) && ret == 0) { 472 472 /* need to return lock information - see above for commentary */ 473 473 if (f.l_start > COMPAT_LOFF_T_MAX) 474 474 ret = -EOVERFLOW; ··· 493 493 case F_GETLK64: 494 494 case F_SETLK64: 495 495 case F_SETLKW64: 496 - case F_GETLKP: 497 - case F_SETLKP: 498 - case F_SETLKPW: 496 + case F_OFD_GETLK: 497 + case F_OFD_SETLK: 498 + case F_OFD_SETLKW: 499 499 return -EINVAL; 500 500 } 501 501 return compat_sys_fcntl64(fd, cmd, arg);
+1 -1
fs/ext4/balloc.c
··· 667 667 continue; 668 668 669 669 x = ext4_count_free(bitmap_bh->b_data, 670 - EXT4_BLOCKS_PER_GROUP(sb) / 8); 670 + EXT4_CLUSTERS_PER_GROUP(sb) / 8); 671 671 printk(KERN_DEBUG "group %u: stored = %d, counted = %u\n", 672 672 i, ext4_free_group_clusters(sb, gdp), x); 673 673 bitmap_count += x;
-17
fs/ext4/ext4.h
··· 2466 2466 up_write(&EXT4_I(inode)->i_data_sem); 2467 2467 } 2468 2468 2469 - /* 2470 - * Update i_disksize after writeback has been started. Races with truncate 2471 - * are avoided by checking i_size under i_data_sem. 2472 - */ 2473 - static inline void ext4_wb_update_i_disksize(struct inode *inode, loff_t newsize) 2474 - { 2475 - loff_t i_size; 2476 - 2477 - down_write(&EXT4_I(inode)->i_data_sem); 2478 - i_size = i_size_read(inode); 2479 - if (newsize > i_size) 2480 - newsize = i_size; 2481 - if (newsize > EXT4_I(inode)->i_disksize) 2482 - EXT4_I(inode)->i_disksize = newsize; 2483 - up_write(&EXT4_I(inode)->i_data_sem); 2484 - } 2485 - 2486 2469 struct ext4_group_info { 2487 2470 unsigned long bb_state; 2488 2471 struct rb_root bb_free_root;
+76 -33
fs/ext4/extents.c
··· 3313 3313 return PTR_ERR(path); 3314 3314 depth = ext_depth(inode); 3315 3315 ex = path[depth].p_ext; 3316 + if (!ex) { 3317 + EXT4_ERROR_INODE(inode, "unexpected hole at %lu", 3318 + (unsigned long) map->m_lblk); 3319 + return -EIO; 3320 + } 3316 3321 uninitialized = ext4_ext_is_uninitialized(ex); 3317 3322 split_flag1 = 0; 3318 3323 ··· 3699 3694 } 3700 3695 depth = ext_depth(inode); 3701 3696 ex = path[depth].p_ext; 3697 + if (!ex) { 3698 + EXT4_ERROR_INODE(inode, "unexpected hole at %lu", 3699 + (unsigned long) map->m_lblk); 3700 + err = -EIO; 3701 + goto out; 3702 + } 3702 3703 } 3703 3704 3704 3705 err = ext4_ext_get_access(handle, inode, path + depth); ··· 4741 4730 4742 4731 trace_ext4_zero_range(inode, offset, len, mode); 4743 4732 4733 + if (!S_ISREG(inode->i_mode)) 4734 + return -EINVAL; 4735 + 4744 4736 /* 4745 4737 * Write out all dirty pages to avoid race conditions 4746 4738 * Then release them. ··· 4892 4878 if (mode & FALLOC_FL_PUNCH_HOLE) 4893 4879 return ext4_punch_hole(inode, offset, len); 4894 4880 4895 - if (mode & FALLOC_FL_COLLAPSE_RANGE) 4896 - return ext4_collapse_range(inode, offset, len); 4897 - 4898 4881 ret = ext4_convert_inline_data(inode); 4899 4882 if (ret) 4900 4883 return ret; ··· 4902 4891 */ 4903 4892 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) 4904 4893 return -EOPNOTSUPP; 4894 + 4895 + if (mode & FALLOC_FL_COLLAPSE_RANGE) 4896 + return ext4_collapse_range(inode, offset, len); 4905 4897 4906 4898 if (mode & FALLOC_FL_ZERO_RANGE) 4907 4899 return ext4_zero_range(file, offset, len, mode); ··· 5243 5229 if (ex_start == EXT_FIRST_EXTENT(path[depth].p_hdr)) 5244 5230 update = 1; 5245 5231 5246 - *start = ex_last->ee_block + 5232 + *start = le32_to_cpu(ex_last->ee_block) + 5247 5233 ext4_ext_get_actual_len(ex_last); 5248 5234 5249 5235 while (ex_start <= ex_last) { 5250 - ex_start->ee_block -= shift; 5251 - if (ex_start > 5252 - EXT_FIRST_EXTENT(path[depth].p_hdr)) { 5253 - if (ext4_ext_try_to_merge_right(inode, 5254 - path, ex_start - 1)) 5255 - ex_last--; 5256 - } 5257 - ex_start++; 5236 + le32_add_cpu(&ex_start->ee_block, -shift); 5237 + /* Try to merge to the left. */ 5238 + if ((ex_start > 5239 + EXT_FIRST_EXTENT(path[depth].p_hdr)) && 5240 + ext4_ext_try_to_merge_right(inode, 5241 + path, ex_start - 1)) 5242 + ex_last--; 5243 + else 5244 + ex_start++; 5258 5245 } 5259 5246 err = ext4_ext_dirty(handle, inode, path + depth); 5260 5247 if (err) ··· 5270 5255 if (err) 5271 5256 goto out; 5272 5257 5273 - path[depth].p_idx->ei_block -= shift; 5258 + le32_add_cpu(&path[depth].p_idx->ei_block, -shift); 5274 5259 err = ext4_ext_dirty(handle, inode, path + depth); 5275 5260 if (err) 5276 5261 goto out; ··· 5315 5300 return ret; 5316 5301 } 5317 5302 5318 - stop_block = extent->ee_block + ext4_ext_get_actual_len(extent); 5303 + stop_block = le32_to_cpu(extent->ee_block) + 5304 + ext4_ext_get_actual_len(extent); 5319 5305 ext4_ext_drop_refs(path); 5320 5306 kfree(path); 5321 5307 ··· 5329 5313 * enough to accomodate the shift. 5330 5314 */ 5331 5315 path = ext4_ext_find_extent(inode, start - 1, NULL, 0); 5316 + if (IS_ERR(path)) 5317 + return PTR_ERR(path); 5332 5318 depth = path->p_depth; 5333 5319 extent = path[depth].p_ext; 5334 - ex_start = extent->ee_block; 5335 - ex_end = extent->ee_block + ext4_ext_get_actual_len(extent); 5320 + if (extent) { 5321 + ex_start = le32_to_cpu(extent->ee_block); 5322 + ex_end = le32_to_cpu(extent->ee_block) + 5323 + ext4_ext_get_actual_len(extent); 5324 + } else { 5325 + ex_start = 0; 5326 + ex_end = 0; 5327 + } 5336 5328 ext4_ext_drop_refs(path); 5337 5329 kfree(path); 5338 5330 ··· 5355 5331 return PTR_ERR(path); 5356 5332 depth = path->p_depth; 5357 5333 extent = path[depth].p_ext; 5358 - current_block = extent->ee_block; 5334 + if (!extent) { 5335 + EXT4_ERROR_INODE(inode, "unexpected hole at %lu", 5336 + (unsigned long) start); 5337 + return -EIO; 5338 + } 5339 + 5340 + current_block = le32_to_cpu(extent->ee_block); 5359 5341 if (start > current_block) { 5360 5342 /* Hole, move to the next extent */ 5361 5343 ret = mext_next_extent(inode, path, &extent); ··· 5395 5365 ext4_lblk_t punch_start, punch_stop; 5396 5366 handle_t *handle; 5397 5367 unsigned int credits; 5398 - loff_t new_size; 5368 + loff_t new_size, ioffset; 5399 5369 int ret; 5400 - 5401 - BUG_ON(offset + len > i_size_read(inode)); 5402 5370 5403 5371 /* Collapse range works only on fs block size aligned offsets. */ 5404 5372 if (offset & (EXT4_BLOCK_SIZE(sb) - 1) || ··· 5404 5376 return -EINVAL; 5405 5377 5406 5378 if (!S_ISREG(inode->i_mode)) 5379 + return -EINVAL; 5380 + 5381 + if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1) 5407 5382 return -EOPNOTSUPP; 5408 5383 5409 5384 trace_ext4_collapse_range(inode, offset, len); ··· 5414 5383 punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb); 5415 5384 punch_stop = (offset + len) >> EXT4_BLOCK_SIZE_BITS(sb); 5416 5385 5386 + /* Call ext4_force_commit to flush all data in case of data=journal. */ 5387 + if (ext4_should_journal_data(inode)) { 5388 + ret = ext4_force_commit(inode->i_sb); 5389 + if (ret) 5390 + return ret; 5391 + } 5392 + 5393 + /* 5394 + * Need to round down offset to be aligned with page size boundary 5395 + * for page size > block size. 5396 + */ 5397 + ioffset = round_down(offset, PAGE_SIZE); 5398 + 5417 5399 /* Write out all dirty pages */ 5418 - ret = filemap_write_and_wait_range(inode->i_mapping, offset, -1); 5400 + ret = filemap_write_and_wait_range(inode->i_mapping, ioffset, 5401 + LLONG_MAX); 5419 5402 if (ret) 5420 5403 return ret; 5421 5404 5422 5405 /* Take mutex lock */ 5423 5406 mutex_lock(&inode->i_mutex); 5424 5407 5425 - /* It's not possible punch hole on append only file */ 5426 - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) { 5427 - ret = -EPERM; 5428 - goto out_mutex; 5429 - } 5430 - 5431 - if (IS_SWAPFILE(inode)) { 5432 - ret = -ETXTBSY; 5408 + /* 5409 + * There is no need to overlap collapse range with EOF, in which case 5410 + * it is effectively a truncate operation 5411 + */ 5412 + if (offset + len >= i_size_read(inode)) { 5413 + ret = -EINVAL; 5433 5414 goto out_mutex; 5434 5415 } 5435 5416 ··· 5451 5408 goto out_mutex; 5452 5409 } 5453 5410 5454 - truncate_pagecache_range(inode, offset, -1); 5411 + truncate_pagecache(inode, ioffset); 5455 5412 5456 5413 /* Wait for existing dio to complete */ 5457 5414 ext4_inode_block_unlocked_dio(inode); ··· 5468 5425 ext4_discard_preallocations(inode); 5469 5426 5470 5427 ret = ext4_es_remove_extent(inode, punch_start, 5471 - EXT_MAX_BLOCKS - punch_start - 1); 5428 + EXT_MAX_BLOCKS - punch_start); 5472 5429 if (ret) { 5473 5430 up_write(&EXT4_I(inode)->i_data_sem); 5474 5431 goto out_stop; ··· 5479 5436 up_write(&EXT4_I(inode)->i_data_sem); 5480 5437 goto out_stop; 5481 5438 } 5439 + ext4_discard_preallocations(inode); 5482 5440 5483 5441 ret = ext4_ext_shift_extents(inode, handle, punch_stop, 5484 5442 punch_stop - punch_start); ··· 5489 5445 } 5490 5446 5491 5447 new_size = i_size_read(inode) - len; 5492 - truncate_setsize(inode, new_size); 5448 + i_size_write(inode, new_size); 5493 5449 EXT4_I(inode)->i_disksize = new_size; 5494 5450 5495 - ext4_discard_preallocations(inode); 5496 5451 up_write(&EXT4_I(inode)->i_data_sem); 5497 5452 if (IS_SYNC(inode)) 5498 5453 ext4_handle_sync(handle);
+1 -1
fs/ext4/extents_status.c
··· 810 810 811 811 newes.es_lblk = end + 1; 812 812 newes.es_len = len2; 813 - block = 0x7FDEADBEEF; 813 + block = 0x7FDEADBEEFULL; 814 814 if (ext4_es_is_written(&orig_es) || 815 815 ext4_es_is_unwritten(&orig_es)) 816 816 block = ext4_es_pblock(&orig_es) +
+1 -1
fs/ext4/file.c
··· 82 82 size_t count = iov_length(iov, nr_segs); 83 83 loff_t final_size = pos + count; 84 84 85 - if (pos >= inode->i_size) 85 + if (pos >= i_size_read(inode)) 86 86 return 0; 87 87 88 88 if ((pos & blockmask) || (final_size & blockmask))
+27 -24
fs/ext4/inode.c
··· 522 522 if (unlikely(map->m_len > INT_MAX)) 523 523 map->m_len = INT_MAX; 524 524 525 + /* We can handle the block number less than EXT_MAX_BLOCKS */ 526 + if (unlikely(map->m_lblk >= EXT_MAX_BLOCKS)) 527 + return -EIO; 528 + 525 529 /* Lookup extent status tree firstly */ 526 530 if (ext4_es_lookup_extent(inode, map->m_lblk, &es)) { 527 531 ext4_es_lru_add(inode); ··· 2247 2243 return err; 2248 2244 } while (map->m_len); 2249 2245 2250 - /* Update on-disk size after IO is submitted */ 2246 + /* 2247 + * Update on-disk size after IO is submitted. Races with 2248 + * truncate are avoided by checking i_size under i_data_sem. 2249 + */ 2251 2250 disksize = ((loff_t)mpd->first_page) << PAGE_CACHE_SHIFT; 2252 2251 if (disksize > EXT4_I(inode)->i_disksize) { 2253 2252 int err2; 2253 + loff_t i_size; 2254 2254 2255 - ext4_wb_update_i_disksize(inode, disksize); 2255 + down_write(&EXT4_I(inode)->i_data_sem); 2256 + i_size = i_size_read(inode); 2257 + if (disksize > i_size) 2258 + disksize = i_size; 2259 + if (disksize > EXT4_I(inode)->i_disksize) 2260 + EXT4_I(inode)->i_disksize = disksize; 2256 2261 err2 = ext4_mark_inode_dirty(handle, inode); 2262 + up_write(&EXT4_I(inode)->i_data_sem); 2257 2263 if (err2) 2258 2264 ext4_error(inode->i_sb, 2259 2265 "Failed to mark inode %lu dirty", ··· 3541 3527 } 3542 3528 3543 3529 mutex_lock(&inode->i_mutex); 3544 - /* It's not possible punch hole on append only file */ 3545 - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) { 3546 - ret = -EPERM; 3547 - goto out_mutex; 3548 - } 3549 - if (IS_SWAPFILE(inode)) { 3550 - ret = -ETXTBSY; 3551 - goto out_mutex; 3552 - } 3553 3530 3554 3531 /* No need to punch hole beyond i_size */ 3555 3532 if (offset >= inode->i_size) ··· 3621 3616 ret = ext4_free_hole_blocks(handle, inode, first_block, 3622 3617 stop_block); 3623 3618 3624 - ext4_discard_preallocations(inode); 3625 3619 up_write(&EXT4_I(inode)->i_data_sem); 3626 3620 if (IS_SYNC(inode)) 3627 3621 ext4_handle_sync(handle); ··· 4427 4423 * 4428 4424 * We are called from a few places: 4429 4425 * 4430 - * - Within generic_file_write() for O_SYNC files. 4426 + * - Within generic_file_aio_write() -> generic_write_sync() for O_SYNC files. 4431 4427 * Here, there will be no transaction running. We wait for any running 4432 4428 * transaction to commit. 4433 4429 * 4434 - * - Within sys_sync(), kupdate and such. 4435 - * We wait on commit, if tol to. 4430 + * - Within flush work (sys_sync(), kupdate and such). 4431 + * We wait on commit, if told to. 4436 4432 * 4437 - * - Within prune_icache() (PF_MEMALLOC == true) 4438 - * Here we simply return. We can't afford to block kswapd on the 4439 - * journal commit. 4433 + * - Within iput_final() -> write_inode_now() 4434 + * We wait on commit, if told to. 4440 4435 * 4441 4436 * In all cases it is actually safe for us to return without doing anything, 4442 4437 * because the inode has been copied into a raw inode buffer in 4443 - * ext4_mark_inode_dirty(). This is a correctness thing for O_SYNC and for 4444 - * knfsd. 4438 + * ext4_mark_inode_dirty(). This is a correctness thing for WB_SYNC_ALL 4439 + * writeback. 4445 4440 * 4446 4441 * Note that we are absolutely dependent upon all inode dirtiers doing the 4447 4442 * right thing: they *must* call mark_inode_dirty() after dirtying info in ··· 4452 4449 * stuff(); 4453 4450 * inode->i_size = expr; 4454 4451 * 4455 - * is in error because a kswapd-driven write_inode() could occur while 4456 - * `stuff()' is running, and the new i_size will be lost. Plus the inode 4457 - * will no longer be on the superblock's dirty inode list. 4452 + * is in error because write_inode() could occur while `stuff()' is running, 4453 + * and the new i_size will be lost. Plus the inode will no longer be on the 4454 + * superblock's dirty inode list. 4458 4455 */ 4459 4456 int ext4_write_inode(struct inode *inode, struct writeback_control *wbc) 4460 4457 { 4461 4458 int err; 4462 4459 4463 - if (current->flags & PF_MEMALLOC) 4460 + if (WARN_ON_ONCE(current->flags & PF_MEMALLOC)) 4464 4461 return 0; 4465 4462 4466 4463 if (EXT4_SB(inode->i_sb)->s_journal) {
+14 -4
fs/ext4/mballoc.c
··· 989 989 poff = block % blocks_per_page; 990 990 page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS); 991 991 if (!page) 992 - return -EIO; 992 + return -ENOMEM; 993 993 BUG_ON(page->mapping != inode->i_mapping); 994 994 e4b->bd_bitmap_page = page; 995 995 e4b->bd_bitmap = page_address(page) + (poff * sb->s_blocksize); ··· 1003 1003 pnum = block / blocks_per_page; 1004 1004 page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS); 1005 1005 if (!page) 1006 - return -EIO; 1006 + return -ENOMEM; 1007 1007 BUG_ON(page->mapping != inode->i_mapping); 1008 1008 e4b->bd_buddy_page = page; 1009 1009 return 0; ··· 1168 1168 unlock_page(page); 1169 1169 } 1170 1170 } 1171 - if (page == NULL || !PageUptodate(page)) { 1171 + if (page == NULL) { 1172 + ret = -ENOMEM; 1173 + goto err; 1174 + } 1175 + if (!PageUptodate(page)) { 1172 1176 ret = -EIO; 1173 1177 goto err; 1174 1178 } ··· 1201 1197 unlock_page(page); 1202 1198 } 1203 1199 } 1204 - if (page == NULL || !PageUptodate(page)) { 1200 + if (page == NULL) { 1201 + ret = -ENOMEM; 1202 + goto err; 1203 + } 1204 + if (!PageUptodate(page)) { 1205 1205 ret = -EIO; 1206 1206 goto err; 1207 1207 } ··· 5016 5008 */ 5017 5009 static int ext4_trim_extent(struct super_block *sb, int start, int count, 5018 5010 ext4_group_t group, struct ext4_buddy *e4b) 5011 + __releases(bitlock) 5012 + __acquires(bitlock) 5019 5013 { 5020 5014 struct ext4_free_extent ex; 5021 5015 int ret = 0;
+3 -2
fs/ext4/page-io.c
··· 308 308 if (error) { 309 309 struct inode *inode = io_end->inode; 310 310 311 - ext4_warning(inode->i_sb, "I/O error writing to inode %lu " 311 + ext4_warning(inode->i_sb, "I/O error %d writing to inode %lu " 312 312 "(offset %llu size %ld starting block %llu)", 313 - inode->i_ino, 313 + error, inode->i_ino, 314 314 (unsigned long long) io_end->offset, 315 315 (long) io_end->size, 316 316 (unsigned long long) 317 317 bi_sector >> (inode->i_blkbits - 9)); 318 + mapping_set_error(inode->i_mapping, error); 318 319 } 319 320 320 321 if (io_end->flag & EXT4_IO_END_UNWRITTEN) {
+27 -24
fs/ext4/super.c
··· 3869 3869 goto failed_mount2; 3870 3870 } 3871 3871 } 3872 + 3873 + /* 3874 + * set up enough so that it can read an inode, 3875 + * and create new inode for buddy allocator 3876 + */ 3877 + sbi->s_gdb_count = db_count; 3878 + if (!test_opt(sb, NOLOAD) && 3879 + EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) 3880 + sb->s_op = &ext4_sops; 3881 + else 3882 + sb->s_op = &ext4_nojournal_sops; 3883 + 3884 + ext4_ext_init(sb); 3885 + err = ext4_mb_init(sb); 3886 + if (err) { 3887 + ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)", 3888 + err); 3889 + goto failed_mount2; 3890 + } 3891 + 3872 3892 if (!ext4_check_descriptors(sb, &first_not_zeroed)) { 3873 3893 ext4_msg(sb, KERN_ERR, "group descriptors corrupted!"); 3874 - goto failed_mount2; 3894 + goto failed_mount2a; 3875 3895 } 3876 3896 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) 3877 3897 if (!ext4_fill_flex_info(sb)) { 3878 3898 ext4_msg(sb, KERN_ERR, 3879 3899 "unable to initialize " 3880 3900 "flex_bg meta info!"); 3881 - goto failed_mount2; 3901 + goto failed_mount2a; 3882 3902 } 3883 3903 3884 - sbi->s_gdb_count = db_count; 3885 3904 get_random_bytes(&sbi->s_next_generation, sizeof(u32)); 3886 3905 spin_lock_init(&sbi->s_next_gen_lock); 3887 3906 ··· 3935 3916 sbi->s_stripe = ext4_get_stripe_size(sbi); 3936 3917 sbi->s_extent_max_zeroout_kb = 32; 3937 3918 3938 - /* 3939 - * set up enough so that it can read an inode 3940 - */ 3941 - if (!test_opt(sb, NOLOAD) && 3942 - EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) 3943 - sb->s_op = &ext4_sops; 3944 - else 3945 - sb->s_op = &ext4_nojournal_sops; 3946 3919 sb->s_export_op = &ext4_export_ops; 3947 3920 sb->s_xattr = ext4_xattr_handlers; 3948 3921 #ifdef CONFIG_QUOTA ··· 4124 4113 if (err) { 4125 4114 ext4_msg(sb, KERN_ERR, "failed to reserve %llu clusters for " 4126 4115 "reserved pool", ext4_calculate_resv_clusters(sb)); 4127 - goto failed_mount4a; 4116 + goto failed_mount5; 4128 4117 } 4129 4118 4130 4119 err = ext4_setup_system_zone(sb); 4131 4120 if (err) { 4132 4121 ext4_msg(sb, KERN_ERR, "failed to initialize system " 4133 4122 "zone (%d)", err); 4134 - goto failed_mount4a; 4135 - } 4136 - 4137 - ext4_ext_init(sb); 4138 - err = ext4_mb_init(sb); 4139 - if (err) { 4140 - ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)", 4141 - err); 4142 4123 goto failed_mount5; 4143 4124 } 4144 4125 ··· 4207 4204 failed_mount7: 4208 4205 ext4_unregister_li_request(sb); 4209 4206 failed_mount6: 4210 - ext4_mb_release(sb); 4211 - failed_mount5: 4212 - ext4_ext_release(sb); 4213 4207 ext4_release_system_zone(sb); 4214 - failed_mount4a: 4208 + failed_mount5: 4215 4209 dput(sb->s_root); 4216 4210 sb->s_root = NULL; 4217 4211 failed_mount4: ··· 4232 4232 percpu_counter_destroy(&sbi->s_extent_cache_cnt); 4233 4233 if (sbi->s_mmp_tsk) 4234 4234 kthread_stop(sbi->s_mmp_tsk); 4235 + failed_mount2a: 4236 + ext4_mb_release(sb); 4235 4237 failed_mount2: 4236 4238 for (i = 0; i < db_count; i++) 4237 4239 brelse(sbi->s_group_desc[i]); 4238 4240 ext4_kvfree(sbi->s_group_desc); 4239 4241 failed_mount: 4242 + ext4_ext_release(sb); 4240 4243 if (sbi->s_chksum_driver) 4241 4244 crypto_free_shash(sbi->s_chksum_driver); 4242 4245 if (sbi->s_proc) {
+19 -4
fs/ext4/xattr.c
··· 520 520 } 521 521 522 522 /* 523 - * Release the xattr block BH: If the reference count is > 1, decrement 524 - * it; otherwise free the block. 523 + * Release the xattr block BH: If the reference count is > 1, decrement it; 524 + * otherwise free the block. 525 525 */ 526 526 static void 527 527 ext4_xattr_release_block(handle_t *handle, struct inode *inode, ··· 542 542 if (ce) 543 543 mb_cache_entry_free(ce); 544 544 get_bh(bh); 545 + unlock_buffer(bh); 545 546 ext4_free_blocks(handle, inode, bh, 0, 1, 546 547 EXT4_FREE_BLOCKS_METADATA | 547 548 EXT4_FREE_BLOCKS_FORGET); 548 - unlock_buffer(bh); 549 549 } else { 550 550 le32_add_cpu(&BHDR(bh)->h_refcount, -1); 551 551 if (ce) 552 552 mb_cache_entry_release(ce); 553 + /* 554 + * Beware of this ugliness: Releasing of xattr block references 555 + * from different inodes can race and so we have to protect 556 + * from a race where someone else frees the block (and releases 557 + * its journal_head) before we are done dirtying the buffer. In 558 + * nojournal mode this race is harmless and we actually cannot 559 + * call ext4_handle_dirty_xattr_block() with locked buffer as 560 + * that function can call sync_dirty_buffer() so for that case 561 + * we handle the dirtying after unlocking the buffer. 562 + */ 563 + if (ext4_handle_valid(handle)) 564 + error = ext4_handle_dirty_xattr_block(handle, inode, 565 + bh); 553 566 unlock_buffer(bh); 554 - error = ext4_handle_dirty_xattr_block(handle, inode, bh); 567 + if (!ext4_handle_valid(handle)) 568 + error = ext4_handle_dirty_xattr_block(handle, inode, 569 + bh); 555 570 if (IS_SYNC(inode)) 556 571 ext4_handle_sync(handle); 557 572 dquot_free_block(inode, EXT4_C2B(EXT4_SB(inode->i_sb), 1));
+6 -6
fs/fcntl.c
··· 274 274 break; 275 275 #if BITS_PER_LONG != 32 276 276 /* 32-bit arches must use fcntl64() */ 277 - case F_GETLKP: 277 + case F_OFD_GETLK: 278 278 #endif 279 279 case F_GETLK: 280 280 err = fcntl_getlk(filp, cmd, (struct flock __user *) arg); 281 281 break; 282 282 #if BITS_PER_LONG != 32 283 283 /* 32-bit arches must use fcntl64() */ 284 - case F_SETLKP: 285 - case F_SETLKPW: 284 + case F_OFD_SETLK: 285 + case F_OFD_SETLKW: 286 286 #endif 287 287 /* Fallthrough */ 288 288 case F_SETLK: ··· 399 399 400 400 switch (cmd) { 401 401 case F_GETLK64: 402 - case F_GETLKP: 402 + case F_OFD_GETLK: 403 403 err = fcntl_getlk64(f.file, cmd, (struct flock64 __user *) arg); 404 404 break; 405 405 case F_SETLK64: 406 406 case F_SETLKW64: 407 - case F_SETLKP: 408 - case F_SETLKPW: 407 + case F_OFD_SETLK: 408 + case F_OFD_SETLKW: 409 409 err = fcntl_setlk64(fd, f.file, cmd, 410 410 (struct flock64 __user *) arg); 411 411 break;
+6 -3
fs/kernfs/dir.c
··· 232 232 struct rb_node **node = &kn->parent->dir.children.rb_node; 233 233 struct rb_node *parent = NULL; 234 234 235 - if (kernfs_type(kn) == KERNFS_DIR) 236 - kn->parent->dir.subdirs++; 237 - 238 235 while (*node) { 239 236 struct kernfs_node *pos; 240 237 int result; ··· 246 249 else 247 250 return -EEXIST; 248 251 } 252 + 249 253 /* add new node and rebalance the tree */ 250 254 rb_link_node(&kn->rb, parent, node); 251 255 rb_insert_color(&kn->rb, &kn->parent->dir.children); 256 + 257 + /* successfully added, account subdir number */ 258 + if (kernfs_type(kn) == KERNFS_DIR) 259 + kn->parent->dir.subdirs++; 260 + 252 261 return 0; 253 262 } 254 263
+2
fs/kernfs/file.c
··· 484 484 485 485 ops = kernfs_ops(of->kn); 486 486 rc = ops->mmap(of, vma); 487 + if (rc) 488 + goto out_put; 487 489 488 490 /* 489 491 * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()
+27 -28
fs/locks.c
··· 135 135 #define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) 136 136 #define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) 137 137 #define IS_LEASE(fl) (fl->fl_flags & (FL_LEASE|FL_DELEG)) 138 - #define IS_FILE_PVT(fl) (fl->fl_flags & FL_FILE_PVT) 138 + #define IS_OFDLCK(fl) (fl->fl_flags & FL_OFDLCK) 139 139 140 140 static bool lease_breaking(struct file_lock *fl) 141 141 { ··· 564 564 BUG_ON(!list_empty(&waiter->fl_block)); 565 565 waiter->fl_next = blocker; 566 566 list_add_tail(&waiter->fl_block, &blocker->fl_block); 567 - if (IS_POSIX(blocker) && !IS_FILE_PVT(blocker)) 567 + if (IS_POSIX(blocker) && !IS_OFDLCK(blocker)) 568 568 locks_insert_global_blocked(waiter); 569 569 } 570 570 ··· 759 759 * of tasks (such as posix threads) sharing the same open file table. 760 760 * To handle those cases, we just bail out after a few iterations. 761 761 * 762 - * For FL_FILE_PVT locks, the owner is the filp, not the files_struct. 762 + * For FL_OFDLCK locks, the owner is the filp, not the files_struct. 763 763 * Because the owner is not even nominally tied to a thread of 764 764 * execution, the deadlock detection below can't reasonably work well. Just 765 765 * skip it for those. 766 766 * 767 - * In principle, we could do a more limited deadlock detection on FL_FILE_PVT 767 + * In principle, we could do a more limited deadlock detection on FL_OFDLCK 768 768 * locks that just checks for the case where two tasks are attempting to 769 769 * upgrade from read to write locks on the same inode. 770 770 */ ··· 791 791 792 792 /* 793 793 * This deadlock detector can't reasonably detect deadlocks with 794 - * FL_FILE_PVT locks, since they aren't owned by a process, per-se. 794 + * FL_OFDLCK locks, since they aren't owned by a process, per-se. 795 795 */ 796 - if (IS_FILE_PVT(caller_fl)) 796 + if (IS_OFDLCK(caller_fl)) 797 797 return 0; 798 798 799 799 while ((block_fl = what_owner_is_waiting_for(block_fl))) { ··· 1391 1391 1392 1392 restart: 1393 1393 break_time = flock->fl_break_time; 1394 - if (break_time != 0) { 1394 + if (break_time != 0) 1395 1395 break_time -= jiffies; 1396 - if (break_time == 0) 1397 - break_time++; 1398 - } 1396 + if (break_time == 0) 1397 + break_time++; 1399 1398 locks_insert_block(flock, new_fl); 1400 1399 spin_unlock(&inode->i_lock); 1401 1400 error = wait_event_interruptible_timeout(new_fl->fl_wait, ··· 1890 1891 1891 1892 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) 1892 1893 { 1893 - flock->l_pid = IS_FILE_PVT(fl) ? -1 : fl->fl_pid; 1894 + flock->l_pid = IS_OFDLCK(fl) ? -1 : fl->fl_pid; 1894 1895 #if BITS_PER_LONG == 32 1895 1896 /* 1896 1897 * Make sure we can represent the posix lock via ··· 1912 1913 #if BITS_PER_LONG == 32 1913 1914 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) 1914 1915 { 1915 - flock->l_pid = IS_FILE_PVT(fl) ? -1 : fl->fl_pid; 1916 + flock->l_pid = IS_OFDLCK(fl) ? -1 : fl->fl_pid; 1916 1917 flock->l_start = fl->fl_start; 1917 1918 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 : 1918 1919 fl->fl_end - fl->fl_start + 1; ··· 1941 1942 if (error) 1942 1943 goto out; 1943 1944 1944 - if (cmd == F_GETLKP) { 1945 + if (cmd == F_OFD_GETLK) { 1945 1946 error = -EINVAL; 1946 1947 if (flock.l_pid != 0) 1947 1948 goto out; 1948 1949 1949 1950 cmd = F_GETLK; 1950 - file_lock.fl_flags |= FL_FILE_PVT; 1951 + file_lock.fl_flags |= FL_OFDLCK; 1951 1952 file_lock.fl_owner = (fl_owner_t)filp; 1952 1953 } 1953 1954 ··· 2073 2074 2074 2075 /* 2075 2076 * If the cmd is requesting file-private locks, then set the 2076 - * FL_FILE_PVT flag and override the owner. 2077 + * FL_OFDLCK flag and override the owner. 2077 2078 */ 2078 2079 switch (cmd) { 2079 - case F_SETLKP: 2080 + case F_OFD_SETLK: 2080 2081 error = -EINVAL; 2081 2082 if (flock.l_pid != 0) 2082 2083 goto out; 2083 2084 2084 2085 cmd = F_SETLK; 2085 - file_lock->fl_flags |= FL_FILE_PVT; 2086 + file_lock->fl_flags |= FL_OFDLCK; 2086 2087 file_lock->fl_owner = (fl_owner_t)filp; 2087 2088 break; 2088 - case F_SETLKPW: 2089 + case F_OFD_SETLKW: 2089 2090 error = -EINVAL; 2090 2091 if (flock.l_pid != 0) 2091 2092 goto out; 2092 2093 2093 2094 cmd = F_SETLKW; 2094 - file_lock->fl_flags |= FL_FILE_PVT; 2095 + file_lock->fl_flags |= FL_OFDLCK; 2095 2096 file_lock->fl_owner = (fl_owner_t)filp; 2096 2097 /* Fallthrough */ 2097 2098 case F_SETLKW: ··· 2143 2144 if (error) 2144 2145 goto out; 2145 2146 2146 - if (cmd == F_GETLKP) { 2147 + if (cmd == F_OFD_GETLK) { 2147 2148 error = -EINVAL; 2148 2149 if (flock.l_pid != 0) 2149 2150 goto out; 2150 2151 2151 2152 cmd = F_GETLK64; 2152 - file_lock.fl_flags |= FL_FILE_PVT; 2153 + file_lock.fl_flags |= FL_OFDLCK; 2153 2154 file_lock.fl_owner = (fl_owner_t)filp; 2154 2155 } 2155 2156 ··· 2208 2209 2209 2210 /* 2210 2211 * If the cmd is requesting file-private locks, then set the 2211 - * FL_FILE_PVT flag and override the owner. 2212 + * FL_OFDLCK flag and override the owner. 2212 2213 */ 2213 2214 switch (cmd) { 2214 - case F_SETLKP: 2215 + case F_OFD_SETLK: 2215 2216 error = -EINVAL; 2216 2217 if (flock.l_pid != 0) 2217 2218 goto out; 2218 2219 2219 2220 cmd = F_SETLK64; 2220 - file_lock->fl_flags |= FL_FILE_PVT; 2221 + file_lock->fl_flags |= FL_OFDLCK; 2221 2222 file_lock->fl_owner = (fl_owner_t)filp; 2222 2223 break; 2223 - case F_SETLKPW: 2224 + case F_OFD_SETLKW: 2224 2225 error = -EINVAL; 2225 2226 if (flock.l_pid != 0) 2226 2227 goto out; 2227 2228 2228 2229 cmd = F_SETLKW64; 2229 - file_lock->fl_flags |= FL_FILE_PVT; 2230 + file_lock->fl_flags |= FL_OFDLCK; 2230 2231 file_lock->fl_owner = (fl_owner_t)filp; 2231 2232 /* Fallthrough */ 2232 2233 case F_SETLKW64: ··· 2412 2413 if (IS_POSIX(fl)) { 2413 2414 if (fl->fl_flags & FL_ACCESS) 2414 2415 seq_printf(f, "ACCESS"); 2415 - else if (IS_FILE_PVT(fl)) 2416 - seq_printf(f, "FLPVT "); 2416 + else if (IS_OFDLCK(fl)) 2417 + seq_printf(f, "OFDLCK"); 2417 2418 else 2418 2419 seq_printf(f, "POSIX "); 2419 2420
+3 -1
fs/nfsd/nfs4callback.c
··· 654 654 655 655 static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_session *ses) 656 656 { 657 + int maxtime = max_cb_time(clp->net); 657 658 struct rpc_timeout timeparms = { 658 - .to_initval = max_cb_time(clp->net), 659 + .to_initval = maxtime, 659 660 .to_retries = 0, 661 + .to_maxval = maxtime, 660 662 }; 661 663 struct rpc_create_args args = { 662 664 .net = clp->net,
-8
fs/nfsd/nfs4xdr.c
··· 3627 3627 /* nfsd4_check_resp_size guarantees enough room for error status */ 3628 3628 if (!op->status) 3629 3629 op->status = nfsd4_check_resp_size(resp, 0); 3630 - if (op->status == nfserr_resource && nfsd4_has_session(&resp->cstate)) { 3631 - struct nfsd4_slot *slot = resp->cstate.slot; 3632 - 3633 - if (slot->sl_flags & NFSD4_SLOT_CACHETHIS) 3634 - op->status = nfserr_rep_too_big_to_cache; 3635 - else 3636 - op->status = nfserr_rep_too_big; 3637 - } 3638 3630 if (so) { 3639 3631 so->so_replay.rp_status = op->status; 3640 3632 so->so_replay.rp_buflen = (char *)resp->p - (char *)(statp+1);
+9 -12
fs/open.c
··· 254 254 return -EBADF; 255 255 256 256 /* 257 - * It's not possible to punch hole or perform collapse range 258 - * on append only file 257 + * We can only allow pure fallocate on append only files 259 258 */ 260 - if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE) 261 - && IS_APPEND(inode)) 259 + if ((mode & ~FALLOC_FL_KEEP_SIZE) && IS_APPEND(inode)) 262 260 return -EPERM; 263 261 264 262 if (IS_IMMUTABLE(inode)) 265 263 return -EPERM; 264 + 265 + /* 266 + * We can not allow to do any fallocate operation on an active 267 + * swapfile 268 + */ 269 + if (IS_SWAPFILE(inode)) 270 + ret = -ETXTBSY; 266 271 267 272 /* 268 273 * Revalidate the write permissions, in case security policy has ··· 290 285 /* Check for wrap through zero too */ 291 286 if (((offset + len) > inode->i_sb->s_maxbytes) || ((offset + len) < 0)) 292 287 return -EFBIG; 293 - 294 - /* 295 - * There is no need to overlap collapse range with EOF, in which case 296 - * it is effectively a truncate operation 297 - */ 298 - if ((mode & FALLOC_FL_COLLAPSE_RANGE) && 299 - (offset + len >= i_size_read(inode))) 300 - return -EINVAL; 301 288 302 289 if (!file->f_op->fallocate) 303 290 return -EOPNOTSUPP;
+9 -1
fs/xfs/xfs_file.c
··· 841 841 goto out_unlock; 842 842 } 843 843 844 - ASSERT(offset + len < i_size_read(inode)); 844 + /* 845 + * There is no need to overlap collapse range with EOF, 846 + * in which case it is effectively a truncate operation 847 + */ 848 + if (offset + len >= i_size_read(inode)) { 849 + error = -EINVAL; 850 + goto out_unlock; 851 + } 852 + 845 853 new_size = i_size_read(inode) - len; 846 854 847 855 error = xfs_collapse_file_space(ip, offset, len);
+2 -6
include/asm-generic/word-at-a-time.h
··· 50 50 } 51 51 52 52 #ifndef zero_bytemask 53 - #ifdef CONFIG_64BIT 54 - #define zero_bytemask(mask) (~0ul << fls64(mask)) 55 - #else 56 - #define zero_bytemask(mask) (~0ul << fls(mask)) 57 - #endif /* CONFIG_64BIT */ 58 - #endif /* zero_bytemask */ 53 + #define zero_bytemask(mask) (~1ul << __fls(mask)) 54 + #endif 59 55 60 56 #endif /* _ASM_WORD_AT_A_TIME_H */
+3 -3
include/dt-bindings/clock/tegra124-car.h
··· 29 29 /* 10 (register bit affects spdif_in and spdif_out) */ 30 30 #define TEGRA124_CLK_I2S1 11 31 31 #define TEGRA124_CLK_I2C1 12 32 - #define TEGRA124_CLK_NDFLASH 13 32 + /* 13 */ 33 33 #define TEGRA124_CLK_SDMMC1 14 34 34 #define TEGRA124_CLK_SDMMC4 15 35 35 /* 16 */ ··· 83 83 84 84 /* 64 */ 85 85 #define TEGRA124_CLK_UARTD 65 86 - #define TEGRA124_CLK_UARTE 66 86 + /* 66 */ 87 87 #define TEGRA124_CLK_I2C3 67 88 88 #define TEGRA124_CLK_SBC4 68 89 89 #define TEGRA124_CLK_SDMMC3 69 ··· 97 97 #define TEGRA124_CLK_TRACE 77 98 98 #define TEGRA124_CLK_SOC_THERM 78 99 99 #define TEGRA124_CLK_DTV 79 100 - #define TEGRA124_CLK_NDSPEED 80 100 + /* 80 */ 101 101 #define TEGRA124_CLK_I2CSLOW 81 102 102 #define TEGRA124_CLK_DSIB 82 103 103 #define TEGRA124_CLK_TSEC 83
+1 -1
include/linux/fs.h
··· 815 815 #define FL_SLEEP 128 /* A blocking lock */ 816 816 #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ 817 817 #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ 818 - #define FL_FILE_PVT 1024 /* lock is private to the file */ 818 + #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ 819 819 820 820 /* 821 821 * Special return value from posix_lock_file() and vfs_lock_file() for
+2
include/linux/ftrace.h
··· 535 535 extern int ftrace_arch_read_dyn_info(char *buf, int size); 536 536 537 537 extern int skip_trace(unsigned long ip); 538 + extern void ftrace_module_init(struct module *mod); 538 539 539 540 extern void ftrace_disable_daemon(void); 540 541 extern void ftrace_enable_daemon(void); ··· 545 544 static inline void ftrace_disable_daemon(void) { } 546 545 static inline void ftrace_enable_daemon(void) { } 547 546 static inline void ftrace_release_mod(struct module *mod) {} 547 + static inline void ftrace_module_init(struct module *mod) {} 548 548 static inline __init int register_ftrace_command(struct ftrace_func_command *cmd) 549 549 { 550 550 return -EINVAL;
+34 -1
include/linux/interrupt.h
··· 203 203 204 204 extern cpumask_var_t irq_default_affinity; 205 205 206 - extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask); 206 + /* Internal implementation. Use the helpers below */ 207 + extern int __irq_set_affinity(unsigned int irq, const struct cpumask *cpumask, 208 + bool force); 209 + 210 + /** 211 + * irq_set_affinity - Set the irq affinity of a given irq 212 + * @irq: Interrupt to set affinity 213 + * @cpumask: cpumask 214 + * 215 + * Fails if cpumask does not contain an online CPU 216 + */ 217 + static inline int 218 + irq_set_affinity(unsigned int irq, const struct cpumask *cpumask) 219 + { 220 + return __irq_set_affinity(irq, cpumask, false); 221 + } 222 + 223 + /** 224 + * irq_force_affinity - Force the irq affinity of a given irq 225 + * @irq: Interrupt to set affinity 226 + * @cpumask: cpumask 227 + * 228 + * Same as irq_set_affinity, but without checking the mask against 229 + * online cpus. 230 + * 231 + * Solely for low level cpu hotplug code, where we need to make per 232 + * cpu interrupts affine before the cpu becomes online. 233 + */ 234 + static inline int 235 + irq_force_affinity(unsigned int irq, const struct cpumask *cpumask) 236 + { 237 + return __irq_set_affinity(irq, cpumask, true); 238 + } 239 + 207 240 extern int irq_can_set_affinity(unsigned int irq); 208 241 extern int irq_select_affinity(unsigned int irq); 209 242
+4 -1
include/linux/irq.h
··· 394 394 395 395 extern void irq_cpu_online(void); 396 396 extern void irq_cpu_offline(void); 397 - extern int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *cpumask); 397 + extern int irq_set_affinity_locked(struct irq_data *data, 398 + const struct cpumask *cpumask, bool force); 398 399 399 400 #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ) 400 401 void irq_move_irq(struct irq_data *data); ··· 602 601 struct irq_data *d = irq_get_irq_data(irq); 603 602 return d ? irqd_get_trigger_type(d) : 0; 604 603 } 604 + 605 + unsigned int arch_dynirq_lower_bound(unsigned int from); 605 606 606 607 int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, 607 608 struct module *owner);
+1
include/linux/libata.h
··· 822 822 unsigned long qc_allocated; 823 823 unsigned int qc_active; 824 824 int nr_active_links; /* #links with active qcs */ 825 + unsigned int last_tag; /* track next tag hw expects */ 825 826 826 827 struct ata_link link; /* host default link */ 827 828 struct ata_link *slave_link; /* see ata_slave_link_init() */
+5
include/linux/of_irq.h
··· 44 44 45 45 #ifdef CONFIG_OF_IRQ 46 46 extern int of_irq_count(struct device_node *dev); 47 + extern int of_irq_get(struct device_node *dev, int index); 47 48 #else 48 49 static inline int of_irq_count(struct device_node *dev) 50 + { 51 + return 0; 52 + } 53 + static inline int of_irq_get(struct device_node *dev, int index) 49 54 { 50 55 return 0; 51 56 }
+16
include/linux/phy/phy.h
··· 174 174 #else 175 175 static inline int phy_pm_runtime_get(struct phy *phy) 176 176 { 177 + if (!phy) 178 + return 0; 177 179 return -ENOSYS; 178 180 } 179 181 180 182 static inline int phy_pm_runtime_get_sync(struct phy *phy) 181 183 { 184 + if (!phy) 185 + return 0; 182 186 return -ENOSYS; 183 187 } 184 188 185 189 static inline int phy_pm_runtime_put(struct phy *phy) 186 190 { 191 + if (!phy) 192 + return 0; 187 193 return -ENOSYS; 188 194 } 189 195 190 196 static inline int phy_pm_runtime_put_sync(struct phy *phy) 191 197 { 198 + if (!phy) 199 + return 0; 192 200 return -ENOSYS; 193 201 } 194 202 ··· 212 204 213 205 static inline int phy_init(struct phy *phy) 214 206 { 207 + if (!phy) 208 + return 0; 215 209 return -ENOSYS; 216 210 } 217 211 218 212 static inline int phy_exit(struct phy *phy) 219 213 { 214 + if (!phy) 215 + return 0; 220 216 return -ENOSYS; 221 217 } 222 218 223 219 static inline int phy_power_on(struct phy *phy) 224 220 { 221 + if (!phy) 222 + return 0; 225 223 return -ENOSYS; 226 224 } 227 225 228 226 static inline int phy_power_off(struct phy *phy) 229 227 { 228 + if (!phy) 229 + return 0; 230 230 return -ENOSYS; 231 231 } 232 232
+2 -2
include/linux/regulator/consumer.h
··· 258 258 static inline struct regulator *__must_check 259 259 regulator_get_optional(struct device *dev, const char *id) 260 260 { 261 - return NULL; 261 + return ERR_PTR(-ENODEV); 262 262 } 263 263 264 264 265 265 static inline struct regulator *__must_check 266 266 devm_regulator_get_optional(struct device *dev, const char *id) 267 267 { 268 - return NULL; 268 + return ERR_PTR(-ENODEV); 269 269 } 270 270 271 271 static inline void regulator_put(struct regulator *regulator)
+1
include/linux/serio.h
··· 23 23 24 24 char name[32]; 25 25 char phys[32]; 26 + char firmware_id[128]; 26 27 27 28 bool manual_bind; 28 29
+1
include/linux/tty.h
··· 61 61 struct tty_buffer *head; /* Queue head */ 62 62 struct work_struct work; 63 63 struct mutex lock; 64 + spinlock_t flush_lock; 64 65 atomic_t priority; 65 66 struct tty_buffer sentinel; 66 67 struct llist_head free; /* Free queue head */
-9
include/trace/events/ext4.h
··· 16 16 struct ext4_map_blocks; 17 17 struct extent_status; 18 18 19 - /* shim until we merge in the xfs_collapse_range branch */ 20 - #ifndef FALLOC_FL_COLLAPSE_RANGE 21 - #define FALLOC_FL_COLLAPSE_RANGE 0x08 22 - #endif 23 - 24 - #ifndef FALLOC_FL_ZERO_RANGE 25 - #define FALLOC_FL_ZERO_RANGE 0x10 26 - #endif 27 - 28 19 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 29 20 30 21 #define show_mballoc_flags(flags) __print_flags(flags, "|", \
+1 -1
include/trace/events/module.h
··· 25 25 { (1UL << TAINT_OOT_MODULE), "O" }, \ 26 26 { (1UL << TAINT_FORCED_MODULE), "F" }, \ 27 27 { (1UL << TAINT_CRAP), "C" }, \ 28 - { (1UL << TAINT_UNSIGNED_MODULE), "X" }) 28 + { (1UL << TAINT_UNSIGNED_MODULE), "E" }) 29 29 30 30 TRACE_EVENT(module_load, 31 31
+10 -10
include/uapi/asm-generic/fcntl.h
··· 133 133 #endif 134 134 135 135 /* 136 - * fd "private" POSIX locks. 136 + * Open File Description Locks 137 137 * 138 - * Usually POSIX locks held by a process are released on *any* close and are 138 + * Usually record locks held by a process are released on *any* close and are 139 139 * not inherited across a fork(). 140 140 * 141 - * These cmd values will set locks that conflict with normal POSIX locks, but 142 - * are "owned" by the opened file, not the process. This means that they are 143 - * inherited across fork() like BSD (flock) locks, and they are only released 144 - * automatically when the last reference to the the open file against which 145 - * they were acquired is put. 141 + * These cmd values will set locks that conflict with process-associated 142 + * record locks, but are "owned" by the open file description, not the 143 + * process. This means that they are inherited across fork() like BSD (flock) 144 + * locks, and they are only released automatically when the last reference to 145 + * the the open file against which they were acquired is put. 146 146 */ 147 - #define F_GETLKP 36 148 - #define F_SETLKP 37 149 - #define F_SETLKPW 38 147 + #define F_OFD_GETLK 36 148 + #define F_OFD_SETLK 37 149 + #define F_OFD_SETLKW 38 150 150 151 151 #define F_OWNER_TID 0 152 152 #define F_OWNER_PID 1
+1
include/uapi/linux/input.h
··· 164 164 #define INPUT_PROP_DIRECT 0x01 /* direct input devices */ 165 165 #define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ 166 166 #define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ 167 + #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ 167 168 168 169 #define INPUT_PROP_MAX 0x1f 169 170 #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
+22
kernel/hrtimer.c
··· 234 234 goto again; 235 235 } 236 236 timer->base = new_base; 237 + } else { 238 + if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) { 239 + cpu = this_cpu; 240 + goto again; 241 + } 237 242 } 238 243 return new_base; 239 244 } ··· 573 568 return; 574 569 575 570 cpu_base->expires_next.tv64 = expires_next.tv64; 571 + 572 + /* 573 + * If a hang was detected in the last timer interrupt then we 574 + * leave the hang delay active in the hardware. We want the 575 + * system to make progress. That also prevents the following 576 + * scenario: 577 + * T1 expires 50ms from now 578 + * T2 expires 5s from now 579 + * 580 + * T1 is removed, so this code is called and would reprogram 581 + * the hardware to 5s from now. Any hrtimer_start after that 582 + * will not reprogram the hardware due to hang_detected being 583 + * set. So we'd effectivly block all timers until the T2 event 584 + * fires. 585 + */ 586 + if (cpu_base->hang_detected) 587 + return; 576 588 577 589 if (cpu_base->expires_next.tv64 != KTIME_MAX) 578 590 tick_program_event(cpu_base->expires_next, 1);
+7
kernel/irq/irqdesc.c
··· 363 363 if (from > irq) 364 364 return -EINVAL; 365 365 from = irq; 366 + } else { 367 + /* 368 + * For interrupts which are freely allocated the 369 + * architecture can force a lower bound to the @from 370 + * argument. x86 uses this to exclude the GSI space. 371 + */ 372 + from = arch_dynirq_lower_bound(from); 366 373 } 367 374 368 375 mutex_lock(&sparse_irq_lock);
+6 -11
kernel/irq/manage.c
··· 180 180 struct irq_chip *chip = irq_data_get_irq_chip(data); 181 181 int ret; 182 182 183 - ret = chip->irq_set_affinity(data, mask, false); 183 + ret = chip->irq_set_affinity(data, mask, force); 184 184 switch (ret) { 185 185 case IRQ_SET_MASK_OK: 186 186 cpumask_copy(data->affinity, mask); ··· 192 192 return ret; 193 193 } 194 194 195 - int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask) 195 + int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, 196 + bool force) 196 197 { 197 198 struct irq_chip *chip = irq_data_get_irq_chip(data); 198 199 struct irq_desc *desc = irq_data_to_desc(data); ··· 203 202 return -EINVAL; 204 203 205 204 if (irq_can_move_pcntxt(data)) { 206 - ret = irq_do_set_affinity(data, mask, false); 205 + ret = irq_do_set_affinity(data, mask, force); 207 206 } else { 208 207 irqd_set_move_pending(data); 209 208 irq_copy_pending(desc, mask); ··· 218 217 return ret; 219 218 } 220 219 221 - /** 222 - * irq_set_affinity - Set the irq affinity of a given irq 223 - * @irq: Interrupt to set affinity 224 - * @mask: cpumask 225 - * 226 - */ 227 - int irq_set_affinity(unsigned int irq, const struct cpumask *mask) 220 + int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force) 228 221 { 229 222 struct irq_desc *desc = irq_to_desc(irq); 230 223 unsigned long flags; ··· 228 233 return -EINVAL; 229 234 230 235 raw_spin_lock_irqsave(&desc->lock, flags); 231 - ret = __irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask); 236 + ret = irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask, force); 232 237 raw_spin_unlock_irqrestore(&desc->lock, flags); 233 238 return ret; 234 239 }
+3 -3
kernel/module.c
··· 815 815 return -EFAULT; 816 816 name[MODULE_NAME_LEN-1] = '\0'; 817 817 818 - if (!(flags & O_NONBLOCK)) 819 - pr_warn("waiting module removal not supported: please upgrade\n"); 820 - 821 818 if (mutex_lock_interruptible(&module_mutex) != 0) 822 819 return -EINTR; 823 820 ··· 3267 3270 } 3268 3271 3269 3272 dynamic_debug_setup(info->debug, info->num_debug); 3273 + 3274 + /* Ftrace init must be called in the MODULE_STATE_UNFORMED state */ 3275 + ftrace_module_init(mod); 3270 3276 3271 3277 /* Finally it's fully formed, ready to start executing. */ 3272 3278 err = complete_formation(mod, info);
+3
kernel/power/suspend.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/console.h> 16 16 #include <linux/cpu.h> 17 + #include <linux/cpuidle.h> 17 18 #include <linux/syscalls.h> 18 19 #include <linux/gfp.h> 19 20 #include <linux/io.h> ··· 54 53 55 54 static void freeze_enter(void) 56 55 { 56 + cpuidle_resume(); 57 57 wait_event(suspend_freeze_wait_head, suspend_freeze_wake); 58 + cpuidle_pause(); 58 59 } 59 60 60 61 void freeze_wake(void)
+5
kernel/softirq.c
··· 779 779 { 780 780 return 0; 781 781 } 782 + 783 + unsigned int __weak arch_dynirq_lower_bound(unsigned int from) 784 + { 785 + return from; 786 + }
+1 -1
kernel/timer.c
··· 838 838 839 839 bit = find_last_bit(&mask, BITS_PER_LONG); 840 840 841 - mask = (1 << bit) - 1; 841 + mask = (1UL << bit) - 1; 842 842 843 843 expires_limit = expires_limit & ~(mask); 844 844
+4 -23
kernel/trace/ftrace.c
··· 4330 4330 ftrace_process_locs(mod, start, end); 4331 4331 } 4332 4332 4333 - static int ftrace_module_notify_enter(struct notifier_block *self, 4334 - unsigned long val, void *data) 4333 + void ftrace_module_init(struct module *mod) 4335 4334 { 4336 - struct module *mod = data; 4337 - 4338 - if (val == MODULE_STATE_COMING) 4339 - ftrace_init_module(mod, mod->ftrace_callsites, 4340 - mod->ftrace_callsites + 4341 - mod->num_ftrace_callsites); 4342 - return 0; 4335 + ftrace_init_module(mod, mod->ftrace_callsites, 4336 + mod->ftrace_callsites + 4337 + mod->num_ftrace_callsites); 4343 4338 } 4344 4339 4345 4340 static int ftrace_module_notify_exit(struct notifier_block *self, ··· 4348 4353 return 0; 4349 4354 } 4350 4355 #else 4351 - static int ftrace_module_notify_enter(struct notifier_block *self, 4352 - unsigned long val, void *data) 4353 - { 4354 - return 0; 4355 - } 4356 4356 static int ftrace_module_notify_exit(struct notifier_block *self, 4357 4357 unsigned long val, void *data) 4358 4358 { 4359 4359 return 0; 4360 4360 } 4361 4361 #endif /* CONFIG_MODULES */ 4362 - 4363 - struct notifier_block ftrace_module_enter_nb = { 4364 - .notifier_call = ftrace_module_notify_enter, 4365 - .priority = INT_MAX, /* Run before anything that can use kprobes */ 4366 - }; 4367 4362 4368 4363 struct notifier_block ftrace_module_exit_nb = { 4369 4364 .notifier_call = ftrace_module_notify_exit, ··· 4387 4402 ret = ftrace_process_locs(NULL, 4388 4403 __start_mcount_loc, 4389 4404 __stop_mcount_loc); 4390 - 4391 - ret = register_module_notifier(&ftrace_module_enter_nb); 4392 - if (ret) 4393 - pr_warning("Failed to register trace ftrace module enter notifier\n"); 4394 4405 4395 4406 ret = register_module_notifier(&ftrace_module_exit_nb); 4396 4407 if (ret)
+1 -1
kernel/trace/trace_events_trigger.c
··· 77 77 data->ops->func(data); 78 78 continue; 79 79 } 80 - filter = rcu_dereference(data->filter); 80 + filter = rcu_dereference_sched(data->filter); 81 81 if (filter && !filter_match_preds(filter, rec)) 82 82 continue; 83 83 if (data->cmd_ops->post_trigger) {
+39 -19
mm/memory.c
··· 232 232 #endif 233 233 } 234 234 235 - void tlb_flush_mmu(struct mmu_gather *tlb) 235 + static void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) 236 236 { 237 - struct mmu_gather_batch *batch; 238 - 239 - if (!tlb->need_flush) 240 - return; 241 237 tlb->need_flush = 0; 242 238 tlb_flush(tlb); 243 239 #ifdef CONFIG_HAVE_RCU_TABLE_FREE 244 240 tlb_table_flush(tlb); 245 241 #endif 242 + } 243 + 244 + static void tlb_flush_mmu_free(struct mmu_gather *tlb) 245 + { 246 + struct mmu_gather_batch *batch; 246 247 247 248 for (batch = &tlb->local; batch; batch = batch->next) { 248 249 free_pages_and_swap_cache(batch->pages, batch->nr); 249 250 batch->nr = 0; 250 251 } 251 252 tlb->active = &tlb->local; 253 + } 254 + 255 + void tlb_flush_mmu(struct mmu_gather *tlb) 256 + { 257 + if (!tlb->need_flush) 258 + return; 259 + tlb_flush_mmu_tlbonly(tlb); 260 + tlb_flush_mmu_free(tlb); 252 261 } 253 262 254 263 /* tlb_finish_mmu ··· 1136 1127 if (PageAnon(page)) 1137 1128 rss[MM_ANONPAGES]--; 1138 1129 else { 1139 - if (pte_dirty(ptent)) 1130 + if (pte_dirty(ptent)) { 1131 + force_flush = 1; 1140 1132 set_page_dirty(page); 1133 + } 1141 1134 if (pte_young(ptent) && 1142 1135 likely(!(vma->vm_flags & VM_SEQ_READ))) 1143 1136 mark_page_accessed(page); ··· 1148 1137 page_remove_rmap(page); 1149 1138 if (unlikely(page_mapcount(page) < 0)) 1150 1139 print_bad_pte(vma, addr, ptent, page); 1151 - force_flush = !__tlb_remove_page(tlb, page); 1152 - if (force_flush) 1140 + if (unlikely(!__tlb_remove_page(tlb, page))) { 1141 + force_flush = 1; 1153 1142 break; 1143 + } 1154 1144 continue; 1155 1145 } 1156 1146 /* ··· 1186 1174 1187 1175 add_mm_rss_vec(mm, rss); 1188 1176 arch_leave_lazy_mmu_mode(); 1189 - pte_unmap_unlock(start_pte, ptl); 1190 1177 1191 - /* 1192 - * mmu_gather ran out of room to batch pages, we break out of 1193 - * the PTE lock to avoid doing the potential expensive TLB invalidate 1194 - * and page-free while holding it. 1195 - */ 1178 + /* Do the actual TLB flush before dropping ptl */ 1196 1179 if (force_flush) { 1197 1180 unsigned long old_end; 1198 - 1199 - force_flush = 0; 1200 1181 1201 1182 /* 1202 1183 * Flush the TLB just for the previous segment, ··· 1198 1193 */ 1199 1194 old_end = tlb->end; 1200 1195 tlb->end = addr; 1201 - 1202 - tlb_flush_mmu(tlb); 1203 - 1196 + tlb_flush_mmu_tlbonly(tlb); 1204 1197 tlb->start = addr; 1205 1198 tlb->end = old_end; 1199 + } 1200 + pte_unmap_unlock(start_pte, ptl); 1201 + 1202 + /* 1203 + * If we forced a TLB flush (either due to running out of 1204 + * batch buffers or because we needed to flush dirty TLB 1205 + * entries before releasing the ptl), free the batched 1206 + * memory too. Restart if we didn't do everything. 1207 + */ 1208 + if (force_flush) { 1209 + force_flush = 0; 1210 + tlb_flush_mmu_free(tlb); 1206 1211 1207 1212 if (addr != end) 1208 1213 goto again; ··· 1970 1955 unsigned long address, unsigned int fault_flags) 1971 1956 { 1972 1957 struct vm_area_struct *vma; 1958 + vm_flags_t vm_flags; 1973 1959 int ret; 1974 1960 1975 1961 vma = find_extend_vma(mm, address); 1976 1962 if (!vma || address < vma->vm_start) 1963 + return -EFAULT; 1964 + 1965 + vm_flags = (fault_flags & FAULT_FLAG_WRITE) ? VM_WRITE : VM_READ; 1966 + if (!(vm_flags & vma->vm_flags)) 1977 1967 return -EFAULT; 1978 1968 1979 1969 ret = handle_mm_fault(mm, vma, address, fault_flags);
+5 -3
mm/vmacache.c
··· 81 81 for (i = 0; i < VMACACHE_SIZE; i++) { 82 82 struct vm_area_struct *vma = current->vmacache[i]; 83 83 84 - if (vma && vma->vm_start <= addr && vma->vm_end > addr) { 85 - BUG_ON(vma->vm_mm != mm); 84 + if (!vma) 85 + continue; 86 + if (WARN_ON_ONCE(vma->vm_mm != mm)) 87 + break; 88 + if (vma->vm_start <= addr && vma->vm_end > addr) 86 89 return vma; 87 - } 88 90 } 89 91 90 92 return NULL;
+3 -3
security/selinux/hooks.c
··· 3317 3317 case F_GETLK: 3318 3318 case F_SETLK: 3319 3319 case F_SETLKW: 3320 - case F_GETLKP: 3321 - case F_SETLKP: 3322 - case F_SETLKPW: 3320 + case F_OFD_GETLK: 3321 + case F_OFD_SETLK: 3322 + case F_OFD_SETLKW: 3323 3323 #if BITS_PER_LONG == 32 3324 3324 case F_GETLK64: 3325 3325 case F_SETLK64:
+18 -16
sound/pci/hda/hda_controller.c
··· 1059 1059 1060 1060 /* reset the corb hw read pointer */ 1061 1061 azx_writew(chip, CORBRP, ICH6_CORBRP_RST); 1062 - for (timeout = 1000; timeout > 0; timeout--) { 1063 - if ((azx_readw(chip, CORBRP) & ICH6_CORBRP_RST) == ICH6_CORBRP_RST) 1064 - break; 1065 - udelay(1); 1066 - } 1067 - if (timeout <= 0) 1068 - dev_err(chip->card->dev, "CORB reset timeout#1, CORBRP = %d\n", 1069 - azx_readw(chip, CORBRP)); 1062 + if (!(chip->driver_caps & AZX_DCAPS_CORBRP_SELF_CLEAR)) { 1063 + for (timeout = 1000; timeout > 0; timeout--) { 1064 + if ((azx_readw(chip, CORBRP) & ICH6_CORBRP_RST) == ICH6_CORBRP_RST) 1065 + break; 1066 + udelay(1); 1067 + } 1068 + if (timeout <= 0) 1069 + dev_err(chip->card->dev, "CORB reset timeout#1, CORBRP = %d\n", 1070 + azx_readw(chip, CORBRP)); 1070 1071 1071 - azx_writew(chip, CORBRP, 0); 1072 - for (timeout = 1000; timeout > 0; timeout--) { 1073 - if (azx_readw(chip, CORBRP) == 0) 1074 - break; 1075 - udelay(1); 1072 + azx_writew(chip, CORBRP, 0); 1073 + for (timeout = 1000; timeout > 0; timeout--) { 1074 + if (azx_readw(chip, CORBRP) == 0) 1075 + break; 1076 + udelay(1); 1077 + } 1078 + if (timeout <= 0) 1079 + dev_err(chip->card->dev, "CORB reset timeout#2, CORBRP = %d\n", 1080 + azx_readw(chip, CORBRP)); 1076 1081 } 1077 - if (timeout <= 0) 1078 - dev_err(chip->card->dev, "CORB reset timeout#2, CORBRP = %d\n", 1079 - azx_readw(chip, CORBRP)); 1080 1082 1081 1083 /* enable corb dma */ 1082 1084 azx_writeb(chip, CORBCTL, ICH6_CORBCTL_RUN);
+2 -1
sound/pci/hda/hda_intel.c
··· 249 249 /* quirks for Nvidia */ 250 250 #define AZX_DCAPS_PRESET_NVIDIA \ 251 251 (AZX_DCAPS_NVIDIA_SNOOP | AZX_DCAPS_RIRB_DELAY | AZX_DCAPS_NO_MSI |\ 252 - AZX_DCAPS_ALIGN_BUFSIZE | AZX_DCAPS_NO_64BIT) 252 + AZX_DCAPS_ALIGN_BUFSIZE | AZX_DCAPS_NO_64BIT |\ 253 + AZX_DCAPS_CORBRP_SELF_CLEAR) 253 254 254 255 #define AZX_DCAPS_PRESET_CTHDA \ 255 256 (AZX_DCAPS_NO_MSI | AZX_DCAPS_POSFIX_LPIB | AZX_DCAPS_4K_BDLE_BOUNDARY)
+1
sound/pci/hda/hda_priv.h
··· 189 189 #define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */ 190 190 #define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */ 191 191 #define AZX_DCAPS_I915_POWERWELL (1 << 27) /* HSW i915 powerwell support */ 192 + #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28) /* CORBRP clears itself after reset */ 192 193 193 194 /* position fix mode */ 194 195 enum {
+1
sound/pci/hda/patch_realtek.c
··· 4621 4621 SND_PCI_QUIRK(0x1028, 0x0667, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4622 4622 SND_PCI_QUIRK(0x1028, 0x0668, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), 4623 4623 SND_PCI_QUIRK(0x1028, 0x0669, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), 4624 + SND_PCI_QUIRK(0x1028, 0x0674, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4624 4625 SND_PCI_QUIRK(0x1028, 0x067f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4625 4626 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4626 4627 SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
+1 -1
sound/soc/codecs/alc5623.c
··· 1018 1018 dev_err(&client->dev, "failed to read vendor ID1: %d\n", ret); 1019 1019 return ret; 1020 1020 } 1021 - vid1 = ((vid1 & 0xff) << 8) | (vid1 >> 8); 1022 1021 1023 1022 ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID2, &vid2); 1024 1023 if (ret < 0) { 1025 1024 dev_err(&client->dev, "failed to read vendor ID2: %d\n", ret); 1026 1025 return ret; 1027 1026 } 1027 + vid2 >>= 8; 1028 1028 1029 1029 if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) { 1030 1030 dev_err(&client->dev, "unknown or wrong codec\n");
+4 -2
sound/soc/codecs/cs42l52.c
··· 1229 1229 } 1230 1230 1231 1231 if (cs42l52->pdata.reset_gpio) { 1232 - ret = gpio_request_one(cs42l52->pdata.reset_gpio, 1233 - GPIOF_OUT_INIT_HIGH, "CS42L52 /RST"); 1232 + ret = devm_gpio_request_one(&i2c_client->dev, 1233 + cs42l52->pdata.reset_gpio, 1234 + GPIOF_OUT_INIT_HIGH, 1235 + "CS42L52 /RST"); 1234 1236 if (ret < 0) { 1235 1237 dev_err(&i2c_client->dev, "Failed to request /RST %d: %d\n", 1236 1238 cs42l52->pdata.reset_gpio, ret);
+4 -2
sound/soc/codecs/cs42l73.c
··· 1443 1443 i2c_set_clientdata(i2c_client, cs42l73); 1444 1444 1445 1445 if (cs42l73->pdata.reset_gpio) { 1446 - ret = gpio_request_one(cs42l73->pdata.reset_gpio, 1447 - GPIOF_OUT_INIT_HIGH, "CS42L73 /RST"); 1446 + ret = devm_gpio_request_one(&i2c_client->dev, 1447 + cs42l73->pdata.reset_gpio, 1448 + GPIOF_OUT_INIT_HIGH, 1449 + "CS42L73 /RST"); 1448 1450 if (ret < 0) { 1449 1451 dev_err(&i2c_client->dev, "Failed to request /RST %d: %d\n", 1450 1452 cs42l73->pdata.reset_gpio, ret);
+7 -2
sound/soc/codecs/tlv320aic3x.c
··· 1399 1399 } 1400 1400 1401 1401 aic3x_add_widgets(codec); 1402 - list_add(&aic3x->list, &reset_list); 1403 1402 1404 1403 return 0; 1405 1404 ··· 1568 1569 1569 1570 ret = snd_soc_register_codec(&i2c->dev, 1570 1571 &soc_codec_dev_aic3x, &aic3x_dai, 1); 1571 - return ret; 1572 + 1573 + if (ret != 0) 1574 + goto err_gpio; 1575 + 1576 + list_add(&aic3x->list, &reset_list); 1577 + 1578 + return 0; 1572 1579 1573 1580 err_gpio: 1574 1581 if (gpio_is_valid(aic3x->gpio_reset) &&
+2 -2
sound/soc/fsl/fsl_spdif.h
··· 144 144 145 145 /* SPDIF Clock register */ 146 146 #define STC_SYSCLK_DIV_OFFSET 11 147 - #define STC_SYSCLK_DIV_MASK (0x1ff << STC_TXCLK_SRC_OFFSET) 148 - #define STC_SYSCLK_DIV(x) ((((x) - 1) << STC_TXCLK_DIV_OFFSET) & STC_SYSCLK_DIV_MASK) 147 + #define STC_SYSCLK_DIV_MASK (0x1ff << STC_SYSCLK_DIV_OFFSET) 148 + #define STC_SYSCLK_DIV(x) ((((x) - 1) << STC_SYSCLK_DIV_OFFSET) & STC_SYSCLK_DIV_MASK) 149 149 #define STC_TXCLK_SRC_OFFSET 8 150 150 #define STC_TXCLK_SRC_MASK (0x7 << STC_TXCLK_SRC_OFFSET) 151 151 #define STC_TXCLK_SRC_SET(x) ((x << STC_TXCLK_SRC_OFFSET) & STC_TXCLK_SRC_MASK)
+1 -1
sound/soc/intel/sst-dsp-priv.h
··· 136 136 enum sst_data_type data_type; /* type of module data */ 137 137 138 138 u32 size; /* size in bytes */ 139 - u32 offset; /* offset in FW file */ 139 + int32_t offset; /* offset in FW file */ 140 140 u32 data_offset; /* offset in ADSP memory space */ 141 141 void *data; /* module data */ 142 142 };
+4 -3
sound/soc/intel/sst-haswell-ipc.c
··· 617 617 case IPC_POSITION_CHANGED: 618 618 trace_ipc_notification("DSP stream position changed for", 619 619 stream->reply.stream_hw_id); 620 - sst_dsp_inbox_read(hsw->dsp, pos, sizeof(pos)); 620 + sst_dsp_inbox_read(hsw->dsp, pos, sizeof(*pos)); 621 621 622 622 if (stream->notify_position) 623 623 stream->notify_position(stream, stream->pdata); ··· 991 991 return -EINVAL; 992 992 993 993 sst_dsp_read(hsw->dsp, volume, 994 - stream->reply.volume_register_address[channel], sizeof(volume)); 994 + stream->reply.volume_register_address[channel], 995 + sizeof(*volume)); 995 996 996 997 return 0; 997 998 } ··· 1610 1609 trace_ipc_request("PM enter Dx state", state); 1611 1610 1612 1611 ret = ipc_tx_message_wait(hsw, header, &state_, sizeof(state_), 1613 - dx, sizeof(dx)); 1612 + dx, sizeof(*dx)); 1614 1613 if (ret < 0) { 1615 1614 dev_err(hsw->dev, "ipc: error set dx state %d failed\n", state); 1616 1615 return ret;
-2
sound/soc/jz4740/Makefile
··· 1 1 # 2 2 # Jz4740 Platform Support 3 3 # 4 - snd-soc-jz4740-objs := jz4740-pcm.o 5 4 snd-soc-jz4740-i2s-objs := jz4740-i2s.o 6 5 7 - obj-$(CONFIG_SND_JZ4740_SOC) += snd-soc-jz4740.o 8 6 obj-$(CONFIG_SND_JZ4740_SOC_I2S) += snd-soc-jz4740-i2s.o 9 7 10 8 # Jz4740 Machine Support
+2 -2
sound/soc/sh/rcar/src.c
··· 258 258 { 259 259 struct rsnd_src *src = rsnd_mod_to_src(mod); 260 260 261 - clk_enable(src->clk); 261 + clk_prepare_enable(src->clk); 262 262 263 263 return 0; 264 264 } ··· 269 269 { 270 270 struct rsnd_src *src = rsnd_mod_to_src(mod); 271 271 272 - clk_disable(src->clk); 272 + clk_disable_unprepare(src->clk); 273 273 274 274 return 0; 275 275 }
+2 -2
sound/soc/sh/rcar/ssi.c
··· 171 171 u32 cr; 172 172 173 173 if (0 == ssi->usrcnt) { 174 - clk_enable(ssi->clk); 174 + clk_prepare_enable(ssi->clk); 175 175 176 176 if (rsnd_dai_is_clk_master(rdai)) { 177 177 if (rsnd_ssi_clk_from_parent(ssi)) ··· 230 230 rsnd_ssi_master_clk_stop(ssi); 231 231 } 232 232 233 - clk_disable(ssi->clk); 233 + clk_disable_unprepare(ssi->clk); 234 234 } 235 235 236 236 dev_dbg(dev, "ssi%d hw stopped\n", rsnd_mod_id(&ssi->mod));
-1
sound/soc/soc-dapm.c
··· 254 254 static void dapm_kcontrol_free(struct snd_kcontrol *kctl) 255 255 { 256 256 struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl); 257 - kfree(data->widget); 258 257 kfree(data->wlist); 259 258 kfree(data); 260 259 }
+2 -2
tools/lib/api/fs/debugfs.c
··· 12 12 char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug"; 13 13 14 14 static const char * const debugfs_known_mountpoints[] = { 15 - "/sys/kernel/debug/", 16 - "/debug/", 15 + "/sys/kernel/debug", 16 + "/debug", 17 17 0, 18 18 }; 19 19
+1
tools/lib/traceevent/event-parse.c
··· 4344 4344 format, len_arg, arg); 4345 4345 trace_seq_terminate(&p); 4346 4346 trace_seq_puts(s, p.buffer); 4347 + trace_seq_destroy(&p); 4347 4348 arg = arg->next; 4348 4349 break; 4349 4350 default:
+2 -2
tools/lib/traceevent/event-parse.h
··· 876 876 struct event_filter *pevent_filter_alloc(struct pevent *pevent); 877 877 878 878 /* for backward compatibility */ 879 - #define FILTER_NONE PEVENT_ERRNO__FILTER_NOT_FOUND 880 - #define FILTER_NOEXIST PEVENT_ERRNO__NO_FILTER 879 + #define FILTER_NONE PEVENT_ERRNO__NO_FILTER 880 + #define FILTER_NOEXIST PEVENT_ERRNO__FILTER_NOT_FOUND 881 881 #define FILTER_MISS PEVENT_ERRNO__FILTER_MISS 882 882 #define FILTER_MATCH PEVENT_ERRNO__FILTER_MATCH 883 883
+1 -1
tools/perf/Makefile.perf
··· 589 589 $(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $< 590 590 591 591 $(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS) 592 - $(QUIET_LINK)$(CC) -o $@ -shared $(ALL_LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) 592 + $(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) 593 593 594 594 $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS 595 595 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
+2 -1
tools/perf/arch/x86/tests/dwarf-unwind.c
··· 23 23 24 24 sp = (unsigned long) regs[PERF_REG_X86_SP]; 25 25 26 - map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp); 26 + map = map_groups__find(&thread->mg, MAP__VARIABLE, (u64) sp); 27 27 if (!map) { 28 28 pr_debug("failed to get stack map\n"); 29 + free(buf); 29 30 return -1; 30 31 } 31 32
+7 -1
tools/perf/arch/x86/tests/regs_load.S
··· 1 - 2 1 #include <linux/linkage.h> 3 2 4 3 #define AX 0 ··· 89 90 ret 90 91 ENDPROC(perf_regs_load) 91 92 #endif 93 + 94 + /* 95 + * We need to provide note.GNU-stack section, saying that we want 96 + * NOT executable stack. Otherwise the final linking will assume that 97 + * the ELF stack should not be restricted at all and set it RWX. 98 + */ 99 + .section .note.GNU-stack,"",@progbits
+35 -11
tools/perf/config/Makefile
··· 34 34 LIBUNWIND_LIBS = -lunwind -lunwind-arm 35 35 endif 36 36 37 + # So far there's only x86 libdw unwind support merged in perf. 38 + # Disable it on all other architectures in case libdw unwind 39 + # support is detected in system. Add supported architectures 40 + # to the check. 41 + ifneq ($(ARCH),x86) 42 + NO_LIBDW_DWARF_UNWIND := 1 43 + endif 44 + 37 45 ifeq ($(LIBUNWIND_LIBS),) 38 46 NO_LIBUNWIND := 1 39 47 else ··· 116 108 CFLAGS += -Wall 117 109 CFLAGS += -Wextra 118 110 CFLAGS += -std=gnu99 111 + 112 + # Enforce a non-executable stack, as we may regress (again) in the future by 113 + # adding assembler files missing the .GNU-stack linker note. 114 + LDFLAGS += -Wl,-z,noexecstack 119 115 120 116 EXTLIBS = -lelf -lpthread -lrt -lm -ldl 121 117 ··· 198 186 stackprotector-all \ 199 187 timerfd \ 200 188 libunwind-debug-frame \ 201 - bionic 189 + bionic \ 190 + liberty \ 191 + liberty-z \ 192 + cplus-demangle 202 193 203 194 # Set FEATURE_CHECK_(C|LD)FLAGS-all for all CORE_FEATURE_TESTS features. 204 195 # If in the future we need per-feature checks/flags for features not ··· 519 504 endif 520 505 521 506 ifeq ($(feature-libbfd), 1) 522 - EXTLIBS += -lbfd -lz -liberty 507 + EXTLIBS += -lbfd 508 + 509 + # call all detections now so we get correct 510 + # status in VF output 511 + $(call feature_check,liberty) 512 + $(call feature_check,liberty-z) 513 + $(call feature_check,cplus-demangle) 514 + 515 + ifeq ($(feature-liberty), 1) 516 + EXTLIBS += -liberty 517 + else 518 + ifeq ($(feature-liberty-z), 1) 519 + EXTLIBS += -liberty -lz 520 + endif 521 + endif 523 522 endif 524 523 525 524 ifdef NO_DEMANGLE ··· 544 515 CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT 545 516 else 546 517 ifneq ($(feature-libbfd), 1) 547 - $(call feature_check,liberty) 548 - ifeq ($(feature-liberty), 1) 549 - EXTLIBS += -lbfd -liberty 550 - else 551 - $(call feature_check,liberty-z) 552 - ifeq ($(feature-liberty-z), 1) 553 - EXTLIBS += -lbfd -liberty -lz 554 - else 555 - $(call feature_check,cplus-demangle) 518 + ifneq ($(feature-liberty), 1) 519 + ifneq ($(feature-liberty-z), 1) 520 + # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT 521 + # or any of 'bfd iberty z' trinity 556 522 ifeq ($(feature-cplus-demangle), 1) 557 523 EXTLIBS += -liberty 558 524 CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
+2
tools/perf/tests/make
··· 46 46 make_install_html := install-html 47 47 make_install_info := install-info 48 48 make_install_pdf := install-pdf 49 + make_static := LDFLAGS=-static 49 50 50 51 # all the NO_* variable combined 51 52 make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 ··· 88 87 # run += make_install_info 89 88 # run += make_install_pdf 90 89 run += make_minimal 90 + run += make_static 91 91 92 92 ifneq ($(call has,ctags),) 93 93 run += make_tags
+12 -4
tools/perf/util/machine.c
··· 717 717 } 718 718 719 719 static int map_groups__set_modules_path_dir(struct map_groups *mg, 720 - const char *dir_name) 720 + const char *dir_name, int depth) 721 721 { 722 722 struct dirent *dent; 723 723 DIR *dir = opendir(dir_name); ··· 742 742 !strcmp(dent->d_name, "..")) 743 743 continue; 744 744 745 - ret = map_groups__set_modules_path_dir(mg, path); 745 + /* Do not follow top-level source and build symlinks */ 746 + if (depth == 0) { 747 + if (!strcmp(dent->d_name, "source") || 748 + !strcmp(dent->d_name, "build")) 749 + continue; 750 + } 751 + 752 + ret = map_groups__set_modules_path_dir(mg, path, 753 + depth + 1); 746 754 if (ret < 0) 747 755 goto out; 748 756 } else { ··· 794 786 if (!version) 795 787 return -1; 796 788 797 - snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s/kernel", 789 + snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s", 798 790 machine->root_dir, version); 799 791 free(version); 800 792 801 - return map_groups__set_modules_path_dir(&machine->kmaps, modules_path); 793 + return map_groups__set_modules_path_dir(&machine->kmaps, modules_path, 0); 802 794 } 803 795 804 796 static int machine__create_module(void *arg, const char *name, u64 start)
+1 -10
tools/power/acpi/Makefile
··· 89 89 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment 90 90 endif 91 91 92 - # if DEBUG is enabled, then we do not strip or optimize 93 - ifeq ($(strip $(DEBUG)),true) 94 - CFLAGS += -O1 -g -DDEBUG 95 - STRIPCMD = /bin/true -Since_we_are_debugging 96 - else 97 - CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer 98 - STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment 99 - endif 100 - 101 92 # --- ACPIDUMP BEGIN --- 102 93 103 94 vpath %.c \ ··· 119 128 -rm -f $(OUTPUT)acpidump 120 129 121 130 install-tools: 122 - $(INSTALL) -d $(DESTDIR)${bindir} 131 + $(INSTALL) -d $(DESTDIR)${sbindir} 123 132 $(INSTALL_PROGRAM) $(OUTPUT)acpidump $(DESTDIR)${sbindir} 124 133 125 134 install-man:
+8 -7
virt/kvm/arm/vgic.c
··· 548 548 u32 val; 549 549 u32 *reg; 550 550 551 - offset >>= 1; 552 551 reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_cfg, 553 - vcpu->vcpu_id, offset); 552 + vcpu->vcpu_id, offset >> 1); 554 553 555 - if (offset & 2) 554 + if (offset & 4) 556 555 val = *reg >> 16; 557 556 else 558 557 val = *reg & 0xffff; ··· 560 561 vgic_reg_access(mmio, &val, offset, 561 562 ACCESS_READ_VALUE | ACCESS_WRITE_VALUE); 562 563 if (mmio->is_write) { 563 - if (offset < 4) { 564 + if (offset < 8) { 564 565 *reg = ~0U; /* Force PPIs/SGIs to 1 */ 565 566 return false; 566 567 } 567 568 568 569 val = vgic_cfg_compress(val); 569 - if (offset & 2) { 570 + if (offset & 4) { 570 571 *reg &= 0xffff; 571 572 *reg |= val << 16; 572 573 } else { ··· 915 916 case 0: 916 917 if (!target_cpus) 917 918 return; 919 + break; 918 920 919 921 case 1: 920 922 target_cpus = ((1 << nrcpus) - 1) & ~(1 << vcpu_id) & 0xff; ··· 1667 1667 if (addr + size < addr) 1668 1668 return -EINVAL; 1669 1669 1670 + *ioaddr = addr; 1670 1671 ret = vgic_ioaddr_overlap(kvm); 1671 1672 if (ret) 1672 - return ret; 1673 - *ioaddr = addr; 1673 + *ioaddr = VGIC_ADDR_UNDEF; 1674 + 1674 1675 return ret; 1675 1676 } 1676 1677
+2 -1
virt/kvm/assigned-dev.c
··· 395 395 if (dev->entries_nr == 0) 396 396 return r; 397 397 398 - r = pci_enable_msix(dev->dev, dev->host_msix_entries, dev->entries_nr); 398 + r = pci_enable_msix_exact(dev->dev, 399 + dev->host_msix_entries, dev->entries_nr); 399 400 if (r) 400 401 return r; 401 402
+4 -4
virt/kvm/async_pf.c
··· 101 101 if (waitqueue_active(&vcpu->wq)) 102 102 wake_up_interruptible(&vcpu->wq); 103 103 104 - mmdrop(mm); 104 + mmput(mm); 105 105 kvm_put_kvm(vcpu->kvm); 106 106 } 107 107 ··· 118 118 flush_work(&work->work); 119 119 #else 120 120 if (cancel_work_sync(&work->work)) { 121 - mmdrop(work->mm); 121 + mmput(work->mm); 122 122 kvm_put_kvm(vcpu->kvm); /* == work->vcpu->kvm */ 123 123 kmem_cache_free(async_pf_cache, work); 124 124 } ··· 183 183 work->addr = hva; 184 184 work->arch = *arch; 185 185 work->mm = current->mm; 186 - atomic_inc(&work->mm->mm_count); 186 + atomic_inc(&work->mm->mm_users); 187 187 kvm_get_kvm(work->vcpu->kvm); 188 188 189 189 /* this can't really happen otherwise gfn_to_pfn_async ··· 201 201 return 1; 202 202 retry_sync: 203 203 kvm_put_kvm(work->vcpu->kvm); 204 - mmdrop(work->mm); 204 + mmput(work->mm); 205 205 kmem_cache_free(async_pf_cache, work); 206 206 return 0; 207 207 }