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

Merge tag 'v3.15-rc4' into devel

Linux 3.15-rc4

+1224 -707
+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 {
+3
Documentation/devicetree/bindings/ata/apm-xgene.txt
··· 24 24 * "sata-phy" for the SATA 6.0Gbps PHY 25 25 26 26 Optional properties: 27 + - dma-coherent : Present if dma operations are coherent 27 28 - status : Shall be "ok" if enabled or "disabled" if disabled. 28 29 Default is "ok". 29 30 ··· 56 55 <0x0 0x1f22e000 0x0 0x1000>, 57 56 <0x0 0x1f227000 0x0 0x1000>; 58 57 interrupts = <0x0 0x87 0x4>; 58 + dma-coherent; 59 59 status = "ok"; 60 60 clocks = <&sataclk 0>; 61 61 phys = <&phy2 0>; ··· 71 69 <0x0 0x1f23e000 0x0 0x1000>, 72 70 <0x0 0x1f237000 0x0 0x1000>; 73 71 interrupts = <0x0 0x88 0x4>; 72 + dma-coherent; 74 73 status = "ok"; 75 74 clocks = <&sataclk 0>; 76 75 phys = <&phy3 0>;
+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
+12 -1
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> ··· 3556 3550 F: include/uapi/scsi/fc/ 3557 3551 3558 3552 FILE LOCKING (flock() and fcntl()/lockf()) 3559 - M: Jeff Layton <jlayton@redhat.com> 3553 + M: Jeff Layton <jlayton@poochiereds.net> 3560 3554 M: J. Bruce Fields <bfields@fieldses.org> 3561 3555 L: linux-fsdevel@vger.kernel.org 3562 3556 S: Maintained ··· 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 = -rc3 4 + EXTRAVERSION = -rc4 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
+2 -2
arch/arm/boot/dts/am33xx.dtsi
··· 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>;
+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 {
+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;
+3
arch/arm64/boot/dts/apm-storm.dtsi
··· 307 307 <0x0 0x1f21e000 0x0 0x1000>, 308 308 <0x0 0x1f217000 0x0 0x1000>; 309 309 interrupts = <0x0 0x86 0x4>; 310 + dma-coherent; 310 311 status = "disabled"; 311 312 clocks = <&sata01clk 0>; 312 313 phys = <&phy1 0>; ··· 322 321 <0x0 0x1f22e000 0x0 0x1000>, 323 322 <0x0 0x1f227000 0x0 0x1000>; 324 323 interrupts = <0x0 0x87 0x4>; 324 + dma-coherent; 325 325 status = "ok"; 326 326 clocks = <&sata23clk 0>; 327 327 phys = <&phy2 0>; ··· 336 334 <0x0 0x1f23d000 0x0 0x1000>, 337 335 <0x0 0x1f23e000 0x0 0x1000>; 338 336 interrupts = <0x0 0x88 0x4>; 337 + dma-coherent; 339 338 status = "ok"; 340 339 clocks = <&sata45clk 0>; 341 340 phys = <&phy3 0>;
+2 -4
arch/arm64/kernel/early_printk.c
··· 143 143 } 144 144 /* no options parsing yet */ 145 145 146 - if (paddr) { 147 - set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr); 148 - early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE); 149 - } 146 + if (paddr) 147 + early_base = (void __iomem *)set_fixmap_offset_io(FIX_EARLYCON_MEM_BASE, paddr); 150 148 151 149 printch = match->printch; 152 150 early_console = &early_console_dev;
+1 -1
arch/arm64/kernel/setup.c
··· 396 396 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 397 397 return 0; 398 398 } 399 - arch_initcall(arm64_device_init); 399 + arch_initcall_sync(arm64_device_init); 400 400 401 401 static DEFINE_PER_CPU(struct cpu, cpu_data); 402 402
+33 -2
arch/arm64/mm/dma-mapping.c
··· 22 22 #include <linux/slab.h> 23 23 #include <linux/dma-mapping.h> 24 24 #include <linux/dma-contiguous.h> 25 + #include <linux/of.h> 26 + #include <linux/platform_device.h> 25 27 #include <linux/vmalloc.h> 26 28 #include <linux/swiotlb.h> 29 + #include <linux/amba/bus.h> 27 30 28 31 #include <asm/cacheflush.h> 29 32 ··· 308 305 }; 309 306 EXPORT_SYMBOL(coherent_swiotlb_dma_ops); 310 307 308 + static int dma_bus_notifier(struct notifier_block *nb, 309 + unsigned long event, void *_dev) 310 + { 311 + struct device *dev = _dev; 312 + 313 + if (event != BUS_NOTIFY_ADD_DEVICE) 314 + return NOTIFY_DONE; 315 + 316 + if (of_property_read_bool(dev->of_node, "dma-coherent")) 317 + set_dma_ops(dev, &coherent_swiotlb_dma_ops); 318 + 319 + return NOTIFY_OK; 320 + } 321 + 322 + static struct notifier_block platform_bus_nb = { 323 + .notifier_call = dma_bus_notifier, 324 + }; 325 + 326 + static struct notifier_block amba_bus_nb = { 327 + .notifier_call = dma_bus_notifier, 328 + }; 329 + 311 330 extern int swiotlb_late_init_with_default_size(size_t default_size); 312 331 313 332 static int __init swiotlb_late_init(void) 314 333 { 315 334 size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); 316 335 317 - dma_ops = &coherent_swiotlb_dma_ops; 336 + /* 337 + * These must be registered before of_platform_populate(). 338 + */ 339 + bus_register_notifier(&platform_bus_type, &platform_bus_nb); 340 + bus_register_notifier(&amba_bustype, &amba_bus_nb); 341 + 342 + dma_ops = &noncoherent_swiotlb_dma_ops; 318 343 319 344 return swiotlb_late_init_with_default_size(swiotlb_size); 320 345 } 321 - subsys_initcall(swiotlb_late_init); 346 + arch_initcall(swiotlb_late_init); 322 347 323 348 #define PREALLOC_DMA_DEBUG_ENTRIES 4096 324 349
+3
arch/arm64/mm/mmu.c
··· 374 374 if (pmd_none(*pmd)) 375 375 return 0; 376 376 377 + if (pmd_sect(*pmd)) 378 + return pfn_valid(pmd_pfn(*pmd)); 379 + 377 380 pte = pte_offset_kernel(pmd, addr); 378 381 if (pte_none(*pte)) 379 382 return 0;
-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 */
+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
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:
+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
+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);
+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
+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
+2
drivers/clk/versatile/clk-vexpress-osc.c
··· 100 100 struct clk *clk; 101 101 u32 range[2]; 102 102 103 + vexpress_sysreg_of_early_init(); 104 + 103 105 osc = kzalloc(sizeof(*osc), GFP_KERNEL); 104 106 if (!osc) 105 107 return;
+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();
+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);
+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 }
+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 - (12ULL * 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
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 -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/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_ */
+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;
+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 };
+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
+2 -2
drivers/pnp/quirks.c
··· 335 335 } 336 336 #endif 337 337 338 - #ifdef CONFIG_X86 338 + #ifdef CONFIG_PCI 339 339 /* Device IDs of parts that have 32KB MCH space */ 340 340 static const unsigned int mch_quirk_devices[] = { 341 341 0x0154, /* Ivy Bridge */ ··· 440 440 #ifdef CONFIG_AMD_NB 441 441 {"PNP0c01", quirk_amd_mmconfig_area}, 442 442 #endif 443 - #ifdef CONFIG_X86 443 + #ifdef CONFIG_PCI 444 444 {"PNP0c02", quirk_intel_mch}, 445 445 #endif 446 446 {""}
+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 /*
-1
drivers/scsi/mpt2sas/mpt2sas_scsih.c
··· 8293 8293 8294 8294 mpt2sas_base_free_resources(ioc); 8295 8295 pci_save_state(pdev); 8296 - pci_disable_device(pdev); 8297 8296 pci_set_power_state(pdev, device_state); 8298 8297 return 0; 8299 8298 }
+5 -1
drivers/scsi/virtio_scsi.c
··· 750 750 751 751 vscsi->affinity_hint_set = true; 752 752 } else { 753 - for (i = 0; i < vscsi->num_queues; i++) 753 + for (i = 0; i < vscsi->num_queues; i++) { 754 + if (!vscsi->req_vqs[i].vq) 755 + continue; 756 + 754 757 virtqueue_set_affinity(vscsi->req_vqs[i].vq, -1); 758 + } 755 759 756 760 vscsi->affinity_hint_set = false; 757 761 }
+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);
+3
include/asm-generic/fixmap.h
··· 93 93 #define set_fixmap_io(idx, phys) \ 94 94 __set_fixmap(idx, phys, FIXMAP_PAGE_IO) 95 95 96 + #define set_fixmap_offset_io(idx, phys) \ 97 + __set_fixmap_offset(idx, phys, FIXMAP_PAGE_IO) 98 + 96 99 #endif /* __ASSEMBLY__ */ 97 100 #endif /* __ASM_GENERIC_FIXMAP_H */
+1 -1
include/asm-generic/word-at-a-time.h
··· 50 50 } 51 51 52 52 #ifndef zero_bytemask 53 - #define zero_bytemask(mask) (~0ul << __fls(mask) << 1) 53 + #define zero_bytemask(mask) (~1ul << __fls(mask)) 54 54 #endif 55 55 56 56 #endif /* _ASM_WORD_AT_A_TIME_H */
+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;
+2 -2
include/linux/interrupt.h
··· 210 210 /** 211 211 * irq_set_affinity - Set the irq affinity of a given irq 212 212 * @irq: Interrupt to set affinity 213 - * @mask: cpumask 213 + * @cpumask: cpumask 214 214 * 215 215 * Fails if cpumask does not contain an online CPU 216 216 */ ··· 223 223 /** 224 224 * irq_force_affinity - Force the irq affinity of a given irq 225 225 * @irq: Interrupt to set affinity 226 - * @mask: cpumask 226 + * @cpumask: cpumask 227 227 * 228 228 * Same as irq_set_affinity, but without checking the mask against 229 229 * online cpus.
+2
include/linux/irq.h
··· 603 603 return d ? irqd_get_trigger_type(d) : 0; 604 604 } 605 605 606 + unsigned int arch_dynirq_lower_bound(unsigned int from); 607 + 606 608 int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, 607 609 struct module *owner); 608 610
+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 }
+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
+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);
+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);
+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) {
+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;
+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)
+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 }