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

Merge 4.3-rc7 into staging-next

We want the other staging patches in this branch as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+3016 -1581
+1
.mailmap
··· 59 59 James Bottomley <jejb@titanic.il.steeleye.com> 60 60 James E Wilson <wilson@specifix.com> 61 61 James Ketrenos <jketreno@io.(none)> 62 + <javier@osg.samsung.com> <javier.martinez@collabora.co.uk> 62 63 Jean Tourrilhes <jt@hpl.hp.com> 63 64 Jeff Garzik <jgarzik@pretzel.yyz.us> 64 65 Jens Axboe <axboe@suse.de>
+7
Documentation/arm/OMAP/README
··· 1 + This file contains documentation for running mainline 2 + kernel on omaps. 3 + 4 + KERNEL NEW DEPENDENCIES 5 + v4.3+ Update is needed for custom .config files to make sure 6 + CONFIG_REGULATOR_PBIAS is enabled for MMC1 to work 7 + properly.
+28 -3
MAINTAINERS
··· 894 894 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 895 895 S: Maintained 896 896 897 - ARM/Allwinner A1X SoC support 897 + ARM/Allwinner sunXi SoC support 898 898 M: Maxime Ripard <maxime.ripard@free-electrons.com> 899 + M: Chen-Yu Tsai <wens@csie.org> 899 900 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 900 901 S: Maintained 901 - N: sun[x4567]i 902 + N: sun[x456789]i 902 903 903 904 ARM/Allwinner SoC Clock Support 904 905 M: Emilio López <emilio@elopez.com.ar> ··· 3592 3591 F: include/drm/i915* 3593 3592 F: include/uapi/drm/i915* 3594 3593 3594 + DRM DRIVERS FOR ATMEL HLCDC 3595 + M: Boris Brezillon <boris.brezillon@free-electrons.com> 3596 + L: dri-devel@lists.freedesktop.org 3597 + S: Supported 3598 + F: drivers/gpu/drm/atmel-hlcdc/ 3599 + F: Documentation/devicetree/bindings/drm/atmel/ 3600 + 3595 3601 DRM DRIVERS FOR EXYNOS 3596 3602 M: Inki Dae <inki.dae@samsung.com> 3597 3603 M: Joonyoung Shim <jy0922.shim@samsung.com> ··· 3626 3618 S: Maintained 3627 3619 F: drivers/gpu/drm/imx/ 3628 3620 F: Documentation/devicetree/bindings/drm/imx/ 3621 + 3622 + DRM DRIVERS FOR GMA500 (Poulsbo, Moorestown and derivative chipsets) 3623 + M: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> 3624 + L: dri-devel@lists.freedesktop.org 3625 + T: git git://github.com/patjak/drm-gma500 3626 + S: Maintained 3627 + F: drivers/gpu/drm/gma500 3628 + F: include/drm/gma500* 3629 3629 3630 3630 DRM DRIVERS FOR NVIDIA TEGRA 3631 3631 M: Thierry Reding <thierry.reding@gmail.com> ··· 6800 6784 6801 6785 MELLANOX ETHERNET DRIVER (mlx4_en) 6802 6786 M: Amir Vadai <amirv@mellanox.com> 6803 - M: Ido Shamay <idos@mellanox.com> 6804 6787 L: netdev@vger.kernel.org 6805 6788 S: Supported 6806 6789 W: http://www.mellanox.com ··· 9128 9113 S: Supported 9129 9114 F: Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt 9130 9115 F: drivers/net/ethernet/synopsys/dwc_eth_qos.c 9116 + 9117 + SYNOPSYS DESIGNWARE I2C DRIVER 9118 + M: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 9119 + M: Jarkko Nikula <jarkko.nikula@linux.intel.com> 9120 + M: Mika Westerberg <mika.westerberg@linux.intel.com> 9121 + L: linux-i2c@vger.kernel.org 9122 + S: Maintained 9123 + F: drivers/i2c/busses/i2c-designware-* 9124 + F: include/linux/platform_data/i2c-designware.h 9131 9125 9132 9126 SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER 9133 9127 M: Seungwon Jeon <tgih.jun@samsung.com> ··· 11690 11666 ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR 11691 11667 M: Minchan Kim <minchan@kernel.org> 11692 11668 M: Nitin Gupta <ngupta@vflare.org> 11669 + R: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> 11693 11670 L: linux-mm@kvack.org 11694 11671 S: Maintained 11695 11672 F: mm/zsmalloc.c
+1 -1
Makefile
··· 1 1 VERSION = 4 2 2 PATCHLEVEL = 3 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc5 4 + EXTRAVERSION = -rc7 5 5 NAME = Blurry Fish Butt 6 6 7 7 # *DOCUMENTATION*
+2 -1
arch/arm/boot/dts/am57xx-beagle-x15.dts
··· 402 402 /* SMPS9 unused */ 403 403 404 404 ldo1_reg: ldo1 { 405 - /* VDD_SD */ 405 + /* VDD_SD / VDDSHV8 */ 406 406 regulator-name = "ldo1"; 407 407 regulator-min-microvolt = <1800000>; 408 408 regulator-max-microvolt = <3300000>; 409 409 regulator-boot-on; 410 + regulator-always-on; 410 411 }; 411 412 412 413 ldo2_reg: ldo2 {
+1 -1
arch/arm/boot/dts/armada-385-db-ap.dts
··· 46 46 47 47 / { 48 48 model = "Marvell Armada 385 Access Point Development Board"; 49 - compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada38x"; 49 + compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada380"; 50 50 51 51 chosen { 52 52 stdout-path = "serial1:115200n8";
+3 -3
arch/arm/boot/dts/berlin2q.dtsi
··· 152 152 }; 153 153 154 154 usb_phy2: phy@a2f400 { 155 - compatible = "marvell,berlin2-usb-phy"; 155 + compatible = "marvell,berlin2cd-usb-phy"; 156 156 reg = <0xa2f400 0x128>; 157 157 #phy-cells = <0>; 158 158 resets = <&chip_rst 0x104 14>; ··· 170 170 }; 171 171 172 172 usb_phy0: phy@b74000 { 173 - compatible = "marvell,berlin2-usb-phy"; 173 + compatible = "marvell,berlin2cd-usb-phy"; 174 174 reg = <0xb74000 0x128>; 175 175 #phy-cells = <0>; 176 176 resets = <&chip_rst 0x104 12>; ··· 178 178 }; 179 179 180 180 usb_phy1: phy@b78000 { 181 - compatible = "marvell,berlin2-usb-phy"; 181 + compatible = "marvell,berlin2cd-usb-phy"; 182 182 reg = <0xb78000 0x128>; 183 183 #phy-cells = <0>; 184 184 resets = <&chip_rst 0x104 13>;
+5
arch/arm/boot/dts/exynos5420-peach-pit.dts
··· 915 915 }; 916 916 }; 917 917 918 + &pmu_system_controller { 919 + assigned-clocks = <&pmu_system_controller 0>; 920 + assigned-clock-parents = <&clock CLK_FIN_PLL>; 921 + }; 922 + 918 923 &rtc { 919 924 status = "okay"; 920 925 clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>;
+5
arch/arm/boot/dts/exynos5800-peach-pi.dts
··· 878 878 }; 879 879 }; 880 880 881 + &pmu_system_controller { 882 + assigned-clocks = <&pmu_system_controller 0>; 883 + assigned-clock-parents = <&clock CLK_FIN_PLL>; 884 + }; 885 + 881 886 &rtc { 882 887 status = "okay"; 883 888 clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>;
+2 -2
arch/arm/boot/dts/imx7d.dtsi
··· 588 588 status = "disabled"; 589 589 }; 590 590 591 - uart2: serial@30870000 { 591 + uart2: serial@30890000 { 592 592 compatible = "fsl,imx7d-uart", 593 593 "fsl,imx6q-uart"; 594 - reg = <0x30870000 0x10000>; 594 + reg = <0x30890000 0x10000>; 595 595 interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; 596 596 clocks = <&clks IMX7D_UART2_ROOT_CLK>, 597 597 <&clks IMX7D_UART2_ROOT_CLK>;
+1 -1
arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts
··· 12 12 13 13 / { 14 14 model = "LogicPD Zoom DM3730 Torpedo Development Kit"; 15 - compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap36xx"; 15 + compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap3630", "ti,omap3"; 16 16 17 17 gpio_keys { 18 18 compatible = "gpio-keys";
+12 -11
arch/arm/boot/dts/meson.dtsi
··· 67 67 68 68 timer@c1109940 { 69 69 compatible = "amlogic,meson6-timer"; 70 - reg = <0xc1109940 0x14>; 70 + reg = <0xc1109940 0x18>; 71 71 interrupts = <0 10 1>; 72 72 }; 73 73 ··· 80 80 wdt: watchdog@c1109900 { 81 81 compatible = "amlogic,meson6-wdt"; 82 82 reg = <0xc1109900 0x8>; 83 + interrupts = <0 0 1>; 83 84 }; 84 85 85 86 uart_AO: serial@c81004c0 { 86 87 compatible = "amlogic,meson-uart"; 87 - reg = <0xc81004c0 0x14>; 88 + reg = <0xc81004c0 0x18>; 88 89 interrupts = <0 90 1>; 89 90 clocks = <&clk81>; 90 91 status = "disabled"; 91 92 }; 92 93 93 - uart_A: serial@c81084c0 { 94 + uart_A: serial@c11084c0 { 94 95 compatible = "amlogic,meson-uart"; 95 - reg = <0xc81084c0 0x14>; 96 - interrupts = <0 90 1>; 96 + reg = <0xc11084c0 0x18>; 97 + interrupts = <0 26 1>; 97 98 clocks = <&clk81>; 98 99 status = "disabled"; 99 100 }; 100 101 101 - uart_B: serial@c81084dc { 102 + uart_B: serial@c11084dc { 102 103 compatible = "amlogic,meson-uart"; 103 - reg = <0xc81084dc 0x14>; 104 - interrupts = <0 90 1>; 104 + reg = <0xc11084dc 0x18>; 105 + interrupts = <0 75 1>; 105 106 clocks = <&clk81>; 106 107 status = "disabled"; 107 108 }; 108 109 109 - uart_C: serial@c8108700 { 110 + uart_C: serial@c1108700 { 110 111 compatible = "amlogic,meson-uart"; 111 - reg = <0xc8108700 0x14>; 112 - interrupts = <0 90 1>; 112 + reg = <0xc1108700 0x18>; 113 + interrupts = <0 93 1>; 113 114 clocks = <&clk81>; 114 115 status = "disabled"; 115 116 };
+1 -1
arch/arm/boot/dts/omap3-evm-37xx.dts
··· 13 13 14 14 / { 15 15 model = "TI OMAP37XX EVM (TMDSEVM3730)"; 16 - compatible = "ti,omap3-evm-37xx", "ti,omap36xx"; 16 + compatible = "ti,omap3-evm-37xx", "ti,omap3630", "ti,omap3"; 17 17 18 18 memory { 19 19 device_type = "memory";
+1 -1
arch/arm/boot/dts/ste-hrefv60plus.dtsi
··· 56 56 /* VMMCI level-shifter enable */ 57 57 default_hrefv60_cfg2 { 58 58 pins = "GPIO169_D22"; 59 - ste,config = <&gpio_out_lo>; 59 + ste,config = <&gpio_out_hi>; 60 60 }; 61 61 /* VMMCI level-shifter voltage select */ 62 62 default_hrefv60_cfg3 {
+2
arch/arm/boot/dts/tegra114.dtsi
··· 234 234 gpio-controller; 235 235 #interrupt-cells = <2>; 236 236 interrupt-controller; 237 + /* 237 238 gpio-ranges = <&pinmux 0 0 246>; 239 + */ 238 240 }; 239 241 240 242 apbmisc@70000800 {
+2
arch/arm/boot/dts/tegra124.dtsi
··· 258 258 gpio-controller; 259 259 #interrupt-cells = <2>; 260 260 interrupt-controller; 261 + /* 261 262 gpio-ranges = <&pinmux 0 0 251>; 263 + */ 262 264 }; 263 265 264 266 apbdma: dma@0,60020000 {
+2
arch/arm/boot/dts/tegra20.dtsi
··· 244 244 gpio-controller; 245 245 #interrupt-cells = <2>; 246 246 interrupt-controller; 247 + /* 247 248 gpio-ranges = <&pinmux 0 0 224>; 249 + */ 248 250 }; 249 251 250 252 apbmisc@70000800 {
+2
arch/arm/boot/dts/tegra30.dtsi
··· 349 349 gpio-controller; 350 350 #interrupt-cells = <2>; 351 351 interrupt-controller; 352 + /* 352 353 gpio-ranges = <&pinmux 0 0 248>; 354 + */ 353 355 }; 354 356 355 357 apbmisc@70000800 {
+1 -1
arch/arm/boot/dts/uniphier-ph1-ld6b-ref.dts
··· 85 85 }; 86 86 87 87 &ethsc { 88 - interrupts = <0 50 4>; 88 + interrupts = <0 52 4>; 89 89 }; 90 90 91 91 &serial0 {
+1
arch/arm/kvm/Kconfig
··· 21 21 depends on MMU && OF 22 22 select PREEMPT_NOTIFIERS 23 23 select ANON_INODES 24 + select ARM_GIC 24 25 select HAVE_KVM_CPU_RELAX_INTERCEPT 25 26 select HAVE_KVM_ARCH_TLB_FLUSH_ALL 26 27 select KVM_MMIO
+1 -1
arch/arm/kvm/arm.c
··· 1080 1080 */ 1081 1081 err = kvm_timer_hyp_init(); 1082 1082 if (err) 1083 - goto out_free_mappings; 1083 + goto out_free_context; 1084 1084 1085 1085 #ifndef CONFIG_HOTPLUG_CPU 1086 1086 free_boot_hyp_pgd();
+3 -5
arch/arm/mach-exynos/pm_domains.c
··· 200 200 args.args_count = 0; 201 201 child_domain = of_genpd_get_from_provider(&args); 202 202 if (IS_ERR(child_domain)) 203 - goto next_pd; 203 + continue; 204 204 205 205 if (of_parse_phandle_with_args(np, "power-domains", 206 206 "#power-domain-cells", 0, &args) != 0) 207 - goto next_pd; 207 + continue; 208 208 209 209 parent_domain = of_genpd_get_from_provider(&args); 210 210 if (IS_ERR(parent_domain)) 211 - goto next_pd; 211 + continue; 212 212 213 213 if (pm_genpd_add_subdomain(parent_domain, child_domain)) 214 214 pr_warn("%s failed to add subdomain: %s\n", ··· 216 216 else 217 217 pr_info("%s has as child subdomain: %s.\n", 218 218 parent_domain->name, child_domain->name); 219 - next_pd: 220 - of_node_put(np); 221 219 } 222 220 223 221 return 0;
+2
arch/arm/mach-omap2/Kconfig
··· 49 49 select OMAP_INTERCONNECT 50 50 select OMAP_INTERCONNECT_BARRIER 51 51 select PM_OPP if PM 52 + select ZONE_DMA if ARM_LPAE 52 53 53 54 config SOC_AM33XX 54 55 bool "TI AM33XX" ··· 79 78 select OMAP_INTERCONNECT 80 79 select OMAP_INTERCONNECT_BARRIER 81 80 select PM_OPP if PM 81 + select ZONE_DMA if ARM_LPAE 82 82 83 83 config ARCH_OMAP2PLUS 84 84 bool
+10
arch/arm/mach-omap2/board-generic.c
··· 106 106 MACHINE_END 107 107 108 108 static const char *const omap36xx_boards_compat[] __initconst = { 109 + "ti,omap3630", 109 110 "ti,omap36xx", 110 111 NULL, 111 112 }; ··· 244 243 }; 245 244 246 245 DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") 246 + #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) 247 + .dma_zone_size = SZ_2G, 248 + #endif 247 249 .reserve = omap_reserve, 248 250 .smp = smp_ops(omap4_smp_ops), 249 251 .map_io = omap5_map_io, ··· 292 288 }; 293 289 294 290 DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)") 291 + #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) 292 + .dma_zone_size = SZ_2G, 293 + #endif 295 294 .reserve = omap_reserve, 296 295 .smp = smp_ops(omap4_smp_ops), 297 296 .map_io = dra7xx_map_io, ··· 315 308 }; 316 309 317 310 DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)") 311 + #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) 312 + .dma_zone_size = SZ_2G, 313 + #endif 318 314 .reserve = omap_reserve, 319 315 .map_io = dra7xx_map_io, 320 316 .init_early = dra7xx_init_early,
+8 -1
arch/arm/mach-omap2/pdata-quirks.c
··· 559 559 560 560 void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table) 561 561 { 562 - omap_sdrc_init(NULL, NULL); 562 + /* 563 + * We still need this for omap2420 and omap3 PM to work, others are 564 + * using drivers/misc/sram.c already. 565 + */ 566 + if (of_machine_is_compatible("ti,omap2420") || 567 + of_machine_is_compatible("ti,omap3")) 568 + omap_sdrc_init(NULL, NULL); 569 + 563 570 pdata_quirks_check(auxdata_quirks); 564 571 of_platform_populate(NULL, omap_dt_match_table, 565 572 omap_auxdata_lookup, NULL);
+5 -4
arch/arm/mach-pxa/pxa3xx.c
··· 42 42 #define PECR_IS(n) ((1 << ((n) * 2)) << 29) 43 43 44 44 extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)); 45 - #ifdef CONFIG_PM 46 - 47 - #define ISRAM_START 0x5c000000 48 - #define ISRAM_SIZE SZ_256K 49 45 50 46 /* 51 47 * NAND NFC: DFI bus arbitration subset ··· 49 53 #define NDCR (*(volatile u32 __iomem*)(NAND_VIRT + 0)) 50 54 #define NDCR_ND_ARB_EN (1 << 12) 51 55 #define NDCR_ND_ARB_CNTL (1 << 19) 56 + 57 + #ifdef CONFIG_PM 58 + 59 + #define ISRAM_START 0x5c000000 60 + #define ISRAM_SIZE SZ_256K 52 61 53 62 static void __iomem *sram; 54 63 static unsigned long wakeup_src;
+1
arch/arm/net/bpf_jit_32.c
··· 614 614 case BPF_LD | BPF_B | BPF_IND: 615 615 load_order = 0; 616 616 load_ind: 617 + update_on_xread(ctx); 617 618 OP_IMM3(ARM_ADD, r_off, r_X, k, ctx); 618 619 goto load_common; 619 620 case BPF_LDX | BPF_IMM:
+1 -1
arch/arm/plat-orion/common.c
··· 495 495 496 496 d->netdev = &orion_ge00.dev; 497 497 for (i = 0; i < d->nr_chips; i++) 498 - d->chip[i].host_dev = &orion_ge00_shared.dev; 498 + d->chip[i].host_dev = &orion_ge_mvmdio.dev; 499 499 orion_switch_device.dev.platform_data = d; 500 500 501 501 platform_device_register(&orion_switch_device);
+1 -1
arch/arm64/Makefile
··· 42 42 CHECKFLAGS += -D__aarch64__ 43 43 44 44 ifeq ($(CONFIG_ARM64_ERRATUM_843419), y) 45 - CFLAGS_MODULE += -mcmodel=large 45 + KBUILD_CFLAGS_MODULE += -mcmodel=large 46 46 endif 47 47 48 48 # Default value
+1 -1
arch/arm64/include/asm/unistd.h
··· 44 44 #define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2) 45 45 #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5) 46 46 47 - #define __NR_compat_syscalls 388 47 + #define __NR_compat_syscalls 390 48 48 #endif 49 49 50 50 #define __ARCH_WANT_SYS_CLONE
+9
arch/arm64/include/asm/unistd32.h
··· 797 797 __SYSCALL(__NR_bpf, sys_bpf) 798 798 #define __NR_execveat 387 799 799 __SYSCALL(__NR_execveat, compat_sys_execveat) 800 + #define __NR_userfaultfd 388 801 + __SYSCALL(__NR_userfaultfd, sys_userfaultfd) 802 + #define __NR_membarrier 389 803 + __SYSCALL(__NR_membarrier, sys_membarrier) 804 + 805 + /* 806 + * Please add new compat syscalls above this comment and update 807 + * __NR_compat_syscalls in asm/unistd.h. 808 + */
+3
arch/arm64/include/uapi/asm/signal.h
··· 19 19 /* Required for AArch32 compatibility. */ 20 20 #define SA_RESTORER 0x04000000 21 21 22 + #define MINSIGSTKSZ 5120 23 + #define SIGSTKSZ 16384 24 + 22 25 #include <asm-generic/signal.h> 23 26 24 27 #endif
+1 -1
arch/powerpc/configs/ppc64_defconfig
··· 111 111 CONFIG_SCSI_QLA_ISCSI=m 112 112 CONFIG_SCSI_LPFC=m 113 113 CONFIG_SCSI_VIRTIO=m 114 - CONFIG_SCSI_DH=m 114 + CONFIG_SCSI_DH=y 115 115 CONFIG_SCSI_DH_RDAC=m 116 116 CONFIG_SCSI_DH_ALUA=m 117 117 CONFIG_ATA=y
+1 -1
arch/powerpc/configs/pseries_defconfig
··· 114 114 CONFIG_SCSI_QLA_ISCSI=m 115 115 CONFIG_SCSI_LPFC=m 116 116 CONFIG_SCSI_VIRTIO=m 117 - CONFIG_SCSI_DH=m 117 + CONFIG_SCSI_DH=y 118 118 CONFIG_SCSI_DH_RDAC=m 119 119 CONFIG_SCSI_DH_ALUA=m 120 120 CONFIG_ATA=y
-7
arch/powerpc/include/asm/cache.h
··· 3 3 4 4 #ifdef __KERNEL__ 5 5 6 - #include <asm/reg.h> 7 6 8 7 /* bytes per L1 cache line */ 9 8 #if defined(CONFIG_8xx) || defined(CONFIG_403GCX) ··· 39 40 }; 40 41 41 42 extern struct ppc64_caches ppc64_caches; 42 - 43 - static inline void logmpp(u64 x) 44 - { 45 - asm volatile(PPC_LOGMPP(R1) : : "r" (x)); 46 - } 47 - 48 43 #endif /* __powerpc64__ && ! __ASSEMBLY__ */ 49 44 50 45 #if defined(__ASSEMBLY__)
-2
arch/powerpc/include/asm/kvm_host.h
··· 297 297 u32 arch_compat; 298 298 ulong pcr; 299 299 ulong dpdes; /* doorbell state (POWER8) */ 300 - void *mpp_buffer; /* Micro Partition Prefetch buffer */ 301 - bool mpp_buffer_is_valid; 302 300 ulong conferring_threads; 303 301 }; 304 302
+7 -2
arch/powerpc/include/asm/machdep.h
··· 61 61 unsigned long addr, 62 62 unsigned char *hpte_slot_array, 63 63 int psize, int ssize, int local); 64 - /* special for kexec, to be called in real mode, linear mapping is 65 - * destroyed as well */ 64 + /* 65 + * Special for kexec. 66 + * To be called in real mode with interrupts disabled. No locks are 67 + * taken as such, concurrent access on pre POWER5 hardware could result 68 + * in a deadlock. 69 + * The linear mapping is destroyed as well. 70 + */ 66 71 void (*hpte_clear_all)(void); 67 72 68 73 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size,
-17
arch/powerpc/include/asm/ppc-opcode.h
··· 141 141 #define PPC_INST_ISEL 0x7c00001e 142 142 #define PPC_INST_ISEL_MASK 0xfc00003e 143 143 #define PPC_INST_LDARX 0x7c0000a8 144 - #define PPC_INST_LOGMPP 0x7c0007e4 145 144 #define PPC_INST_LSWI 0x7c0004aa 146 145 #define PPC_INST_LSWX 0x7c00042a 147 146 #define PPC_INST_LWARX 0x7c000028 ··· 284 285 #define __PPC_EH(eh) 0 285 286 #endif 286 287 287 - /* POWER8 Micro Partition Prefetch (MPP) parameters */ 288 - /* Address mask is common for LOGMPP instruction and MPPR SPR */ 289 - #define PPC_MPPE_ADDRESS_MASK 0xffffffffc000ULL 290 - 291 - /* Bits 60 and 61 of MPP SPR should be set to one of the following */ 292 - /* Aborting the fetch is indeed setting 00 in the table size bits */ 293 - #define PPC_MPPR_FETCH_ABORT (0x0ULL << 60) 294 - #define PPC_MPPR_FETCH_WHOLE_TABLE (0x2ULL << 60) 295 - 296 - /* Bits 54 and 55 of register for LOGMPP instruction should be set to: */ 297 - #define PPC_LOGMPP_LOG_L2 (0x02ULL << 54) 298 - #define PPC_LOGMPP_LOG_L2L3 (0x01ULL << 54) 299 - #define PPC_LOGMPP_LOG_ABORT (0x03ULL << 54) 300 - 301 288 /* Deal with instructions that older assemblers aren't aware of */ 302 289 #define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ 303 290 __PPC_RA(a) | __PPC_RB(b)) ··· 292 307 #define PPC_LDARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LDARX | \ 293 308 ___PPC_RT(t) | ___PPC_RA(a) | \ 294 309 ___PPC_RB(b) | __PPC_EH(eh)) 295 - #define PPC_LOGMPP(b) stringify_in_c(.long PPC_INST_LOGMPP | \ 296 - __PPC_RB(b)) 297 310 #define PPC_LWARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LWARX | \ 298 311 ___PPC_RT(t) | ___PPC_RA(a) | \ 299 312 ___PPC_RB(b) | __PPC_EH(eh))
-1
arch/powerpc/include/asm/reg.h
··· 226 226 #define CTRL_TE 0x00c00000 /* thread enable */ 227 227 #define CTRL_RUNLATCH 0x1 228 228 #define SPRN_DAWR 0xB4 229 - #define SPRN_MPPR 0xB8 /* Micro Partition Prefetch Register */ 230 229 #define SPRN_RPR 0xBA /* Relative Priority Register */ 231 230 #define SPRN_CIABR 0xBB 232 231 #define CIABR_PRIV 0x3
+3
arch/powerpc/kernel/rtas.c
··· 1043 1043 if (!capable(CAP_SYS_ADMIN)) 1044 1044 return -EPERM; 1045 1045 1046 + if (!rtas.entry) 1047 + return -EINVAL; 1048 + 1046 1049 if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0) 1047 1050 return -EFAULT; 1048 1051
+1 -54
arch/powerpc/kvm/book3s_hv.c
··· 36 36 37 37 #include <asm/reg.h> 38 38 #include <asm/cputable.h> 39 - #include <asm/cache.h> 40 39 #include <asm/cacheflush.h> 41 40 #include <asm/tlbflush.h> 42 41 #include <asm/uaccess.h> ··· 73 74 #define TB_NIL (~(u64)0) 74 75 75 76 static DECLARE_BITMAP(default_enabled_hcalls, MAX_HCALL_OPCODE/4 + 1); 76 - 77 - #if defined(CONFIG_PPC_64K_PAGES) 78 - #define MPP_BUFFER_ORDER 0 79 - #elif defined(CONFIG_PPC_4K_PAGES) 80 - #define MPP_BUFFER_ORDER 3 81 - #endif 82 77 83 78 static int dynamic_mt_modes = 6; 84 79 module_param(dynamic_mt_modes, int, S_IRUGO | S_IWUSR); ··· 1448 1455 vcore->kvm = kvm; 1449 1456 INIT_LIST_HEAD(&vcore->preempt_list); 1450 1457 1451 - vcore->mpp_buffer_is_valid = false; 1452 - 1453 - if (cpu_has_feature(CPU_FTR_ARCH_207S)) 1454 - vcore->mpp_buffer = (void *)__get_free_pages( 1455 - GFP_KERNEL|__GFP_ZERO, 1456 - MPP_BUFFER_ORDER); 1457 - 1458 1458 return vcore; 1459 1459 } 1460 1460 ··· 1878 1892 } 1879 1893 } 1880 1894 return 1; 1881 - } 1882 - 1883 - static void kvmppc_start_saving_l2_cache(struct kvmppc_vcore *vc) 1884 - { 1885 - phys_addr_t phy_addr, mpp_addr; 1886 - 1887 - phy_addr = (phys_addr_t)virt_to_phys(vc->mpp_buffer); 1888 - mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK; 1889 - 1890 - mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_ABORT); 1891 - logmpp(mpp_addr | PPC_LOGMPP_LOG_L2); 1892 - 1893 - vc->mpp_buffer_is_valid = true; 1894 - } 1895 - 1896 - static void kvmppc_start_restoring_l2_cache(const struct kvmppc_vcore *vc) 1897 - { 1898 - phys_addr_t phy_addr, mpp_addr; 1899 - 1900 - phy_addr = virt_to_phys(vc->mpp_buffer); 1901 - mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK; 1902 - 1903 - /* We must abort any in-progress save operations to ensure 1904 - * the table is valid so that prefetch engine knows when to 1905 - * stop prefetching. */ 1906 - logmpp(mpp_addr | PPC_LOGMPP_LOG_ABORT); 1907 - mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_WHOLE_TABLE); 1908 1895 } 1909 1896 1910 1897 /* ··· 2430 2471 2431 2472 srcu_idx = srcu_read_lock(&vc->kvm->srcu); 2432 2473 2433 - if (vc->mpp_buffer_is_valid) 2434 - kvmppc_start_restoring_l2_cache(vc); 2435 - 2436 2474 __kvmppc_vcore_entry(); 2437 - 2438 - if (vc->mpp_buffer) 2439 - kvmppc_start_saving_l2_cache(vc); 2440 2475 2441 2476 srcu_read_unlock(&vc->kvm->srcu, srcu_idx); 2442 2477 ··· 3026 3073 { 3027 3074 long int i; 3028 3075 3029 - for (i = 0; i < KVM_MAX_VCORES; ++i) { 3030 - if (kvm->arch.vcores[i] && kvm->arch.vcores[i]->mpp_buffer) { 3031 - struct kvmppc_vcore *vc = kvm->arch.vcores[i]; 3032 - free_pages((unsigned long)vc->mpp_buffer, 3033 - MPP_BUFFER_ORDER); 3034 - } 3076 + for (i = 0; i < KVM_MAX_VCORES; ++i) 3035 3077 kfree(kvm->arch.vcores[i]); 3036 - } 3037 3078 kvm->arch.online_vcores = 0; 3038 3079 } 3039 3080
+11 -12
arch/powerpc/mm/hash_native_64.c
··· 582 582 * be when they isi), and we are the only one left. We rely on our kernel 583 583 * mapping being 0xC0's and the hardware ignoring those two real bits. 584 584 * 585 + * This must be called with interrupts disabled. 586 + * 587 + * Taking the native_tlbie_lock is unsafe here due to the possibility of 588 + * lockdep being on. On pre POWER5 hardware, not taking the lock could 589 + * cause deadlock. POWER5 and newer not taking the lock is fine. This only 590 + * gets called during boot before secondary CPUs have come up and during 591 + * crashdump and all bets are off anyway. 592 + * 585 593 * TODO: add batching support when enabled. remember, no dynamic memory here, 586 594 * athough there is the control page available... 587 595 */ 588 596 static void native_hpte_clear(void) 589 597 { 590 598 unsigned long vpn = 0; 591 - unsigned long slot, slots, flags; 599 + unsigned long slot, slots; 592 600 struct hash_pte *hptep = htab_address; 593 601 unsigned long hpte_v; 594 602 unsigned long pteg_count; 595 603 int psize, apsize, ssize; 596 604 597 605 pteg_count = htab_hash_mask + 1; 598 - 599 - local_irq_save(flags); 600 - 601 - /* we take the tlbie lock and hold it. Some hardware will 602 - * deadlock if we try to tlbie from two processors at once. 603 - */ 604 - raw_spin_lock(&native_tlbie_lock); 605 606 606 607 slots = pteg_count * HPTES_PER_GROUP; 607 608 ··· 615 614 hpte_v = be64_to_cpu(hptep->v); 616 615 617 616 /* 618 - * Call __tlbie() here rather than tlbie() since we 619 - * already hold the native_tlbie_lock. 617 + * Call __tlbie() here rather than tlbie() since we can't take the 618 + * native_tlbie_lock. 620 619 */ 621 620 if (hpte_v & HPTE_V_VALID) { 622 621 hpte_decode(hptep, slot, &psize, &apsize, &ssize, &vpn); ··· 626 625 } 627 626 628 627 asm volatile("eieio; tlbsync; ptesync":::"memory"); 629 - raw_spin_unlock(&native_tlbie_lock); 630 - local_irq_restore(flags); 631 628 } 632 629 633 630 /*
+5 -2
arch/powerpc/platforms/powernv/opal.c
··· 487 487 * PRD component would have already got notified about this 488 488 * error through other channels. 489 489 * 490 - * In any case, let us just fall through. We anyway heading 491 - * down to panic path. 490 + * If hardware marked this as an unrecoverable MCE, we are 491 + * going to panic anyway. Even if it didn't, it's not safe to 492 + * continue at this point, so we should explicitly panic. 492 493 */ 494 + 495 + panic("PowerNV Unrecovered Machine Check"); 493 496 return 0; 494 497 } 495 498
+24 -5
arch/powerpc/platforms/powernv/smp.c
··· 171 171 * so clear LPCR:PECE1. We keep PECE2 enabled. 172 172 */ 173 173 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); 174 + 175 + /* 176 + * Hard-disable interrupts, and then clear irq_happened flags 177 + * that we can safely ignore while off-line, since they 178 + * are for things for which we do no processing when off-line 179 + * (or in the case of HMI, all the processing we need to do 180 + * is done in lower-level real-mode code). 181 + */ 182 + hard_irq_disable(); 183 + local_paca->irq_happened &= ~(PACA_IRQ_DEC | PACA_IRQ_HMI); 184 + 174 185 while (!generic_check_cpu_restart(cpu)) { 186 + /* 187 + * Clear IPI flag, since we don't handle IPIs while 188 + * offline, except for those when changing micro-threading 189 + * mode, which are handled explicitly below, and those 190 + * for coming online, which are handled via 191 + * generic_check_cpu_restart() calls. 192 + */ 193 + kvmppc_set_host_ipi(cpu, 0); 175 194 176 195 ppc64_runlatch_off(); 177 196 ··· 215 196 * having finished executing in a KVM guest, then srr1 216 197 * contains 0. 217 198 */ 218 - if ((srr1 & wmask) == SRR1_WAKEEE) { 199 + if (((srr1 & wmask) == SRR1_WAKEEE) || 200 + (local_paca->irq_happened & PACA_IRQ_EE)) { 219 201 icp_native_flush_interrupt(); 220 - local_paca->irq_happened &= PACA_IRQ_HARD_DIS; 221 - smp_mb(); 222 202 } else if ((srr1 & wmask) == SRR1_WAKEHDBELL) { 223 203 unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER); 224 204 asm volatile(PPC_MSGCLR(%0) : : "r" (msg)); 225 - kvmppc_set_host_ipi(cpu, 0); 226 205 } 206 + local_paca->irq_happened &= ~(PACA_IRQ_EE | PACA_IRQ_DBELL); 207 + smp_mb(); 227 208 228 209 if (cpu_core_split_required()) 229 210 continue; 230 211 231 - if (!generic_check_cpu_restart(cpu)) 212 + if (srr1 && !generic_check_cpu_restart(cpu)) 232 213 DBG("CPU%d Unexpected exit while offline !\n", cpu); 233 214 } 234 215 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_PECE1);
-5
arch/powerpc/platforms/ps3/os-area.c
··· 194 194 .key = OS_AREA_DB_KEY_RTC_DIFF 195 195 }; 196 196 197 - static const struct os_area_db_id os_area_db_id_video_mode = { 198 - .owner = OS_AREA_DB_OWNER_LINUX, 199 - .key = OS_AREA_DB_KEY_VIDEO_MODE 200 - }; 201 - 202 197 #define SECONDS_FROM_1970_TO_2000 946684800LL 203 198 204 199 /**
+1
arch/sh/include/asm/page.h
··· 59 59 60 60 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) 61 61 extern void copy_page(void *to, void *from); 62 + #define copy_user_page(to, from, vaddr, pg) __copy_user(to, from, PAGE_SIZE) 62 63 63 64 struct page; 64 65 struct vm_area_struct;
+2
arch/sparc/crypto/aes_glue.c
··· 433 433 .blkcipher = { 434 434 .min_keysize = AES_MIN_KEY_SIZE, 435 435 .max_keysize = AES_MAX_KEY_SIZE, 436 + .ivsize = AES_BLOCK_SIZE, 436 437 .setkey = aes_set_key, 437 438 .encrypt = cbc_encrypt, 438 439 .decrypt = cbc_decrypt, ··· 453 452 .blkcipher = { 454 453 .min_keysize = AES_MIN_KEY_SIZE, 455 454 .max_keysize = AES_MAX_KEY_SIZE, 455 + .ivsize = AES_BLOCK_SIZE, 456 456 .setkey = aes_set_key, 457 457 .encrypt = ctr_crypt, 458 458 .decrypt = ctr_crypt,
+1
arch/sparc/crypto/camellia_glue.c
··· 274 274 .blkcipher = { 275 275 .min_keysize = CAMELLIA_MIN_KEY_SIZE, 276 276 .max_keysize = CAMELLIA_MAX_KEY_SIZE, 277 + .ivsize = CAMELLIA_BLOCK_SIZE, 277 278 .setkey = camellia_set_key, 278 279 .encrypt = cbc_encrypt, 279 280 .decrypt = cbc_decrypt,
+2
arch/sparc/crypto/des_glue.c
··· 429 429 .blkcipher = { 430 430 .min_keysize = DES_KEY_SIZE, 431 431 .max_keysize = DES_KEY_SIZE, 432 + .ivsize = DES_BLOCK_SIZE, 432 433 .setkey = des_set_key, 433 434 .encrypt = cbc_encrypt, 434 435 .decrypt = cbc_decrypt, ··· 486 485 .blkcipher = { 487 486 .min_keysize = DES3_EDE_KEY_SIZE, 488 487 .max_keysize = DES3_EDE_KEY_SIZE, 488 + .ivsize = DES3_EDE_BLOCK_SIZE, 489 489 .setkey = des3_ede_set_key, 490 490 .encrypt = cbc3_encrypt, 491 491 .decrypt = cbc3_decrypt,
+2 -2
arch/um/Makefile
··· 70 70 71 71 USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \ 72 72 $(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \ 73 - -D_FILE_OFFSET_BITS=64 -idirafter include \ 74 - -D__KERNEL__ -D__UM_HOST__ 73 + -D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \ 74 + -idirafter $(obj)/include -D__KERNEL__ -D__UM_HOST__ 75 75 76 76 #This will adjust *FLAGS accordingly to the platform. 77 77 include $(ARCH_DIR)/Makefile-os-$(OS)
+1 -1
arch/um/kernel/trap.c
··· 220 220 show_regs(container_of(regs, struct pt_regs, regs)); 221 221 panic("Segfault with no mm"); 222 222 } 223 - else if (!is_user && address < TASK_SIZE) { 223 + else if (!is_user && address > PAGE_SIZE && address < TASK_SIZE) { 224 224 show_regs(container_of(regs, struct pt_regs, regs)); 225 225 panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx", 226 226 address, ip);
+3 -3
arch/um/os-Linux/helper.c
··· 96 96 "ret = %d\n", -n); 97 97 ret = n; 98 98 } 99 - CATCH_EINTR(waitpid(pid, NULL, __WCLONE)); 99 + CATCH_EINTR(waitpid(pid, NULL, __WALL)); 100 100 } 101 101 102 102 out_free2: ··· 129 129 return err; 130 130 } 131 131 if (stack_out == NULL) { 132 - CATCH_EINTR(pid = waitpid(pid, &status, __WCLONE)); 132 + CATCH_EINTR(pid = waitpid(pid, &status, __WALL)); 133 133 if (pid < 0) { 134 134 err = -errno; 135 135 printk(UM_KERN_ERR "run_helper_thread - wait failed, " ··· 148 148 int helper_wait(int pid) 149 149 { 150 150 int ret, status; 151 - int wflags = __WCLONE; 151 + int wflags = __WALL; 152 152 153 153 CATCH_EINTR(ret = waitpid(pid, &status, wflags)); 154 154 if (ret < 0) {
+6 -2
arch/x86/boot/compressed/eboot.c
··· 667 667 bool conout_found = false; 668 668 void *dummy = NULL; 669 669 u32 h = handles[i]; 670 + u32 current_fb_base; 670 671 671 672 status = efi_call_early(handle_protocol, h, 672 673 proto, (void **)&gop32); ··· 679 678 if (status == EFI_SUCCESS) 680 679 conout_found = true; 681 680 682 - status = __gop_query32(gop32, &info, &size, &fb_base); 681 + status = __gop_query32(gop32, &info, &size, &current_fb_base); 683 682 if (status == EFI_SUCCESS && (!first_gop || conout_found)) { 684 683 /* 685 684 * Systems that use the UEFI Console Splitter may ··· 693 692 pixel_format = info->pixel_format; 694 693 pixel_info = info->pixel_information; 695 694 pixels_per_scan_line = info->pixels_per_scan_line; 695 + fb_base = current_fb_base; 696 696 697 697 /* 698 698 * Once we've found a GOP supporting ConOut, ··· 772 770 bool conout_found = false; 773 771 void *dummy = NULL; 774 772 u64 h = handles[i]; 773 + u32 current_fb_base; 775 774 776 775 status = efi_call_early(handle_protocol, h, 777 776 proto, (void **)&gop64); ··· 784 781 if (status == EFI_SUCCESS) 785 782 conout_found = true; 786 783 787 - status = __gop_query64(gop64, &info, &size, &fb_base); 784 + status = __gop_query64(gop64, &info, &size, &current_fb_base); 788 785 if (status == EFI_SUCCESS && (!first_gop || conout_found)) { 789 786 /* 790 787 * Systems that use the UEFI Console Splitter may ··· 798 795 pixel_format = info->pixel_format; 799 796 pixel_info = info->pixel_information; 800 797 pixels_per_scan_line = info->pixels_per_scan_line; 798 + fb_base = current_fb_base; 801 799 802 800 /* 803 801 * Once we've found a GOP supporting ConOut,
+5
arch/x86/crypto/camellia_aesni_avx_glue.c
··· 554 554 { 555 555 const char *feature_name; 556 556 557 + if (!cpu_has_avx || !cpu_has_aes || !cpu_has_osxsave) { 558 + pr_info("AVX or AES-NI instructions are not detected.\n"); 559 + return -ENODEV; 560 + } 561 + 557 562 if (!cpu_has_xfeatures(XSTATE_SSE | XSTATE_YMM, &feature_name)) { 558 563 pr_info("CPU feature '%s' is not supported.\n", feature_name); 559 564 return -ENODEV;
+2 -4
arch/x86/include/asm/kvm_host.h
··· 1226 1226 1227 1227 int kvm_is_in_guest(void); 1228 1228 1229 - int __x86_set_memory_region(struct kvm *kvm, 1230 - const struct kvm_userspace_memory_region *mem); 1231 - int x86_set_memory_region(struct kvm *kvm, 1232 - const struct kvm_userspace_memory_region *mem); 1229 + int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size); 1230 + int x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size); 1233 1231 bool kvm_vcpu_is_reset_bsp(struct kvm_vcpu *vcpu); 1234 1232 bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu); 1235 1233
+2 -3
arch/x86/include/asm/string_64.h
··· 27 27 function. */ 28 28 29 29 #define __HAVE_ARCH_MEMCPY 1 30 + extern void *memcpy(void *to, const void *from, size_t len); 30 31 extern void *__memcpy(void *to, const void *from, size_t len); 31 32 32 33 #ifndef CONFIG_KMEMCHECK 33 - #if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 34 - extern void *memcpy(void *to, const void *from, size_t len); 35 - #else 34 + #if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4 36 35 #define memcpy(dst, src, len) \ 37 36 ({ \ 38 37 size_t __len = (len); \
+4
arch/x86/kernel/apic/io_apic.c
··· 2907 2907 struct irq_data *irq_data; 2908 2908 struct mp_chip_data *data; 2909 2909 struct irq_alloc_info *info = arg; 2910 + unsigned long flags; 2910 2911 2911 2912 if (!info || nr_irqs > 1) 2912 2913 return -EINVAL; ··· 2940 2939 2941 2940 cfg = irqd_cfg(irq_data); 2942 2941 add_pin_to_irq_node(data, ioapic_alloc_attr_node(info), ioapic, pin); 2942 + 2943 + local_irq_save(flags); 2943 2944 if (info->ioapic_entry) 2944 2945 mp_setup_entry(cfg, data, info->ioapic_entry); 2945 2946 mp_register_handler(virq, data->trigger); 2946 2947 if (virq < nr_legacy_irqs()) 2947 2948 legacy_pic->mask(virq); 2949 + local_irq_restore(flags); 2948 2950 2949 2951 apic_printk(APIC_VERBOSE, KERN_DEBUG 2950 2952 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i Dest:%d)\n",
+3 -3
arch/x86/kernel/process.c
··· 550 550 if (sp < bottom || sp > top) 551 551 return 0; 552 552 553 - fp = READ_ONCE(*(unsigned long *)sp); 553 + fp = READ_ONCE_NOCHECK(*(unsigned long *)sp); 554 554 do { 555 555 if (fp < bottom || fp > top) 556 556 return 0; 557 - ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long))); 557 + ip = READ_ONCE_NOCHECK(*(unsigned long *)(fp + sizeof(unsigned long))); 558 558 if (!in_sched_functions(ip)) 559 559 return ip; 560 - fp = READ_ONCE(*(unsigned long *)fp); 560 + fp = READ_ONCE_NOCHECK(*(unsigned long *)fp); 561 561 } while (count++ < 16 && p->state != TASK_RUNNING); 562 562 return 0; 563 563 }
+8
arch/x86/kernel/setup.c
··· 1173 1173 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY, 1174 1174 swapper_pg_dir + KERNEL_PGD_BOUNDARY, 1175 1175 KERNEL_PGD_PTRS); 1176 + 1177 + /* 1178 + * sync back low identity map too. It is used for example 1179 + * in the 32-bit EFI stub. 1180 + */ 1181 + clone_pgd_range(initial_page_table, 1182 + swapper_pg_dir + KERNEL_PGD_BOUNDARY, 1183 + KERNEL_PGD_PTRS); 1176 1184 #endif 1177 1185 1178 1186 tboot_probe();
+11 -4
arch/x86/kernel/smpboot.c
··· 509 509 */ 510 510 #define UDELAY_10MS_DEFAULT 10000 511 511 512 - static unsigned int init_udelay = UDELAY_10MS_DEFAULT; 512 + static unsigned int init_udelay = INT_MAX; 513 513 514 514 static int __init cpu_init_udelay(char *str) 515 515 { ··· 522 522 static void __init smp_quirk_init_udelay(void) 523 523 { 524 524 /* if cmdline changed it from default, leave it alone */ 525 - if (init_udelay != UDELAY_10MS_DEFAULT) 525 + if (init_udelay != INT_MAX) 526 526 return; 527 527 528 528 /* if modern processor, use no delay */ 529 529 if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) || 530 530 ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF))) 531 531 init_udelay = 0; 532 + 533 + /* else, use legacy delay */ 534 + init_udelay = UDELAY_10MS_DEFAULT; 532 535 } 533 536 534 537 /* ··· 660 657 /* 661 658 * Give the other CPU some time to accept the IPI. 662 659 */ 663 - if (init_udelay) 660 + if (init_udelay == 0) 661 + udelay(10); 662 + else 664 663 udelay(300); 665 664 666 665 pr_debug("Startup point 1\n"); ··· 673 668 /* 674 669 * Give the other CPU some time to accept the IPI. 675 670 */ 676 - if (init_udelay) 671 + if (init_udelay == 0) 672 + udelay(10); 673 + else 677 674 udelay(200); 678 675 679 676 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
+7 -3
arch/x86/kvm/emulate.c
··· 2418 2418 u64 val, cr0, cr4; 2419 2419 u32 base3; 2420 2420 u16 selector; 2421 - int i; 2421 + int i, r; 2422 2422 2423 2423 for (i = 0; i < 16; i++) 2424 2424 *reg_write(ctxt, i) = GET_SMSTATE(u64, smbase, 0x7ff8 - i * 8); ··· 2460 2460 dt.address = GET_SMSTATE(u64, smbase, 0x7e68); 2461 2461 ctxt->ops->set_gdt(ctxt, &dt); 2462 2462 2463 + r = rsm_enter_protected_mode(ctxt, cr0, cr4); 2464 + if (r != X86EMUL_CONTINUE) 2465 + return r; 2466 + 2463 2467 for (i = 0; i < 6; i++) { 2464 - int r = rsm_load_seg_64(ctxt, smbase, i); 2468 + r = rsm_load_seg_64(ctxt, smbase, i); 2465 2469 if (r != X86EMUL_CONTINUE) 2466 2470 return r; 2467 2471 } 2468 2472 2469 - return rsm_enter_protected_mode(ctxt, cr0, cr4); 2473 + return X86EMUL_CONTINUE; 2470 2474 } 2471 2475 2472 2476 static int em_rsm(struct x86_emulate_ctxt *ctxt)
+6 -20
arch/x86/kvm/vmx.c
··· 4105 4105 static int alloc_apic_access_page(struct kvm *kvm) 4106 4106 { 4107 4107 struct page *page; 4108 - struct kvm_userspace_memory_region kvm_userspace_mem; 4109 4108 int r = 0; 4110 4109 4111 4110 mutex_lock(&kvm->slots_lock); 4112 4111 if (kvm->arch.apic_access_page_done) 4113 4112 goto out; 4114 - kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT; 4115 - kvm_userspace_mem.flags = 0; 4116 - kvm_userspace_mem.guest_phys_addr = APIC_DEFAULT_PHYS_BASE; 4117 - kvm_userspace_mem.memory_size = PAGE_SIZE; 4118 - r = __x86_set_memory_region(kvm, &kvm_userspace_mem); 4113 + r = __x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, 4114 + APIC_DEFAULT_PHYS_BASE, PAGE_SIZE); 4119 4115 if (r) 4120 4116 goto out; 4121 4117 ··· 4136 4140 { 4137 4141 /* Called with kvm->slots_lock held. */ 4138 4142 4139 - struct kvm_userspace_memory_region kvm_userspace_mem; 4140 4143 int r = 0; 4141 4144 4142 4145 BUG_ON(kvm->arch.ept_identity_pagetable_done); 4143 4146 4144 - kvm_userspace_mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT; 4145 - kvm_userspace_mem.flags = 0; 4146 - kvm_userspace_mem.guest_phys_addr = 4147 - kvm->arch.ept_identity_map_addr; 4148 - kvm_userspace_mem.memory_size = PAGE_SIZE; 4149 - r = __x86_set_memory_region(kvm, &kvm_userspace_mem); 4147 + r = __x86_set_memory_region(kvm, IDENTITY_PAGETABLE_PRIVATE_MEMSLOT, 4148 + kvm->arch.ept_identity_map_addr, PAGE_SIZE); 4150 4149 4151 4150 return r; 4152 4151 } ··· 4940 4949 static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr) 4941 4950 { 4942 4951 int ret; 4943 - struct kvm_userspace_memory_region tss_mem = { 4944 - .slot = TSS_PRIVATE_MEMSLOT, 4945 - .guest_phys_addr = addr, 4946 - .memory_size = PAGE_SIZE * 3, 4947 - .flags = 0, 4948 - }; 4949 4952 4950 - ret = x86_set_memory_region(kvm, &tss_mem); 4953 + ret = x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, addr, 4954 + PAGE_SIZE * 3); 4951 4955 if (ret) 4952 4956 return ret; 4953 4957 kvm->arch.tss_addr = addr;
+75 -60
arch/x86/kvm/x86.c
··· 6453 6453 return 1; 6454 6454 } 6455 6455 6456 + static inline bool kvm_vcpu_running(struct kvm_vcpu *vcpu) 6457 + { 6458 + return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && 6459 + !vcpu->arch.apf.halted); 6460 + } 6461 + 6456 6462 static int vcpu_run(struct kvm_vcpu *vcpu) 6457 6463 { 6458 6464 int r; ··· 6467 6461 vcpu->srcu_idx = srcu_read_lock(&kvm->srcu); 6468 6462 6469 6463 for (;;) { 6470 - if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && 6471 - !vcpu->arch.apf.halted) 6464 + if (kvm_vcpu_running(vcpu)) 6472 6465 r = vcpu_enter_guest(vcpu); 6473 6466 else 6474 6467 r = vcpu_block(kvm, vcpu); ··· 7479 7474 kvm_free_pit(kvm); 7480 7475 } 7481 7476 7482 - int __x86_set_memory_region(struct kvm *kvm, 7483 - const struct kvm_userspace_memory_region *mem) 7477 + int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size) 7484 7478 { 7485 7479 int i, r; 7480 + unsigned long hva; 7481 + struct kvm_memslots *slots = kvm_memslots(kvm); 7482 + struct kvm_memory_slot *slot, old; 7486 7483 7487 7484 /* Called with kvm->slots_lock held. */ 7488 - BUG_ON(mem->slot >= KVM_MEM_SLOTS_NUM); 7485 + if (WARN_ON(id >= KVM_MEM_SLOTS_NUM)) 7486 + return -EINVAL; 7489 7487 7488 + slot = id_to_memslot(slots, id); 7489 + if (size) { 7490 + if (WARN_ON(slot->npages)) 7491 + return -EEXIST; 7492 + 7493 + /* 7494 + * MAP_SHARED to prevent internal slot pages from being moved 7495 + * by fork()/COW. 7496 + */ 7497 + hva = vm_mmap(NULL, 0, size, PROT_READ | PROT_WRITE, 7498 + MAP_SHARED | MAP_ANONYMOUS, 0); 7499 + if (IS_ERR((void *)hva)) 7500 + return PTR_ERR((void *)hva); 7501 + } else { 7502 + if (!slot->npages) 7503 + return 0; 7504 + 7505 + hva = 0; 7506 + } 7507 + 7508 + old = *slot; 7490 7509 for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++) { 7491 - struct kvm_userspace_memory_region m = *mem; 7510 + struct kvm_userspace_memory_region m; 7492 7511 7493 - m.slot |= i << 16; 7512 + m.slot = id | (i << 16); 7513 + m.flags = 0; 7514 + m.guest_phys_addr = gpa; 7515 + m.userspace_addr = hva; 7516 + m.memory_size = size; 7494 7517 r = __kvm_set_memory_region(kvm, &m); 7495 7518 if (r < 0) 7496 7519 return r; 7520 + } 7521 + 7522 + if (!size) { 7523 + r = vm_munmap(old.userspace_addr, old.npages * PAGE_SIZE); 7524 + WARN_ON(r < 0); 7497 7525 } 7498 7526 7499 7527 return 0; 7500 7528 } 7501 7529 EXPORT_SYMBOL_GPL(__x86_set_memory_region); 7502 7530 7503 - int x86_set_memory_region(struct kvm *kvm, 7504 - const struct kvm_userspace_memory_region *mem) 7531 + int x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size) 7505 7532 { 7506 7533 int r; 7507 7534 7508 7535 mutex_lock(&kvm->slots_lock); 7509 - r = __x86_set_memory_region(kvm, mem); 7536 + r = __x86_set_memory_region(kvm, id, gpa, size); 7510 7537 mutex_unlock(&kvm->slots_lock); 7511 7538 7512 7539 return r; ··· 7553 7516 * unless the the memory map has changed due to process exit 7554 7517 * or fd copying. 7555 7518 */ 7556 - struct kvm_userspace_memory_region mem; 7557 - memset(&mem, 0, sizeof(mem)); 7558 - mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT; 7559 - x86_set_memory_region(kvm, &mem); 7560 - 7561 - mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT; 7562 - x86_set_memory_region(kvm, &mem); 7563 - 7564 - mem.slot = TSS_PRIVATE_MEMSLOT; 7565 - x86_set_memory_region(kvm, &mem); 7519 + x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, 0, 0); 7520 + x86_set_memory_region(kvm, IDENTITY_PAGETABLE_PRIVATE_MEMSLOT, 0, 0); 7521 + x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, 0, 0); 7566 7522 } 7567 7523 kvm_iommu_unmap_guest(kvm); 7568 7524 kfree(kvm->arch.vpic); ··· 7658 7628 const struct kvm_userspace_memory_region *mem, 7659 7629 enum kvm_mr_change change) 7660 7630 { 7661 - /* 7662 - * Only private memory slots need to be mapped here since 7663 - * KVM_SET_MEMORY_REGION ioctl is no longer supported. 7664 - */ 7665 - if ((memslot->id >= KVM_USER_MEM_SLOTS) && (change == KVM_MR_CREATE)) { 7666 - unsigned long userspace_addr; 7667 - 7668 - /* 7669 - * MAP_SHARED to prevent internal slot pages from being moved 7670 - * by fork()/COW. 7671 - */ 7672 - userspace_addr = vm_mmap(NULL, 0, memslot->npages * PAGE_SIZE, 7673 - PROT_READ | PROT_WRITE, 7674 - MAP_SHARED | MAP_ANONYMOUS, 0); 7675 - 7676 - if (IS_ERR((void *)userspace_addr)) 7677 - return PTR_ERR((void *)userspace_addr); 7678 - 7679 - memslot->userspace_addr = userspace_addr; 7680 - } 7681 - 7682 7631 return 0; 7683 7632 } 7684 7633 ··· 7719 7710 { 7720 7711 int nr_mmu_pages = 0; 7721 7712 7722 - if (change == KVM_MR_DELETE && old->id >= KVM_USER_MEM_SLOTS) { 7723 - int ret; 7724 - 7725 - ret = vm_munmap(old->userspace_addr, 7726 - old->npages * PAGE_SIZE); 7727 - if (ret < 0) 7728 - printk(KERN_WARNING 7729 - "kvm_vm_ioctl_set_memory_region: " 7730 - "failed to munmap memory\n"); 7731 - } 7732 - 7733 7713 if (!kvm->arch.n_requested_mmu_pages) 7734 7714 nr_mmu_pages = kvm_mmu_calculate_mmu_pages(kvm); 7735 7715 ··· 7767 7769 kvm_mmu_invalidate_zap_all_pages(kvm); 7768 7770 } 7769 7771 7772 + static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu) 7773 + { 7774 + if (!list_empty_careful(&vcpu->async_pf.done)) 7775 + return true; 7776 + 7777 + if (kvm_apic_has_events(vcpu)) 7778 + return true; 7779 + 7780 + if (vcpu->arch.pv.pv_unhalted) 7781 + return true; 7782 + 7783 + if (atomic_read(&vcpu->arch.nmi_queued)) 7784 + return true; 7785 + 7786 + if (test_bit(KVM_REQ_SMI, &vcpu->requests)) 7787 + return true; 7788 + 7789 + if (kvm_arch_interrupt_allowed(vcpu) && 7790 + kvm_cpu_has_interrupt(vcpu)) 7791 + return true; 7792 + 7793 + return false; 7794 + } 7795 + 7770 7796 int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) 7771 7797 { 7772 7798 if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events) 7773 7799 kvm_x86_ops->check_nested_events(vcpu, false); 7774 7800 7775 - return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && 7776 - !vcpu->arch.apf.halted) 7777 - || !list_empty_careful(&vcpu->async_pf.done) 7778 - || kvm_apic_has_events(vcpu) 7779 - || vcpu->arch.pv.pv_unhalted 7780 - || atomic_read(&vcpu->arch.nmi_queued) || 7781 - (kvm_arch_interrupt_allowed(vcpu) && 7782 - kvm_cpu_has_interrupt(vcpu)); 7801 + return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu); 7783 7802 } 7784 7803 7785 7804 int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
+4 -1
arch/x86/um/ldt.c
··· 12 12 #include <skas.h> 13 13 #include <sysdep/tls.h> 14 14 15 - extern int modify_ldt(int func, void *ptr, unsigned long bytecount); 15 + static inline int modify_ldt (int func, void *ptr, unsigned long bytecount) 16 + { 17 + return syscall(__NR_modify_ldt, func, ptr, bytecount); 18 + } 16 19 17 20 static long write_ldt_entry(struct mm_id *mm_idp, int func, 18 21 struct user_desc *desc, void **addr, int done)
+1 -1
block/blk-core.c
··· 576 576 q->queue_lock = &q->__queue_lock; 577 577 spin_unlock_irq(lock); 578 578 579 - bdi_destroy(&q->backing_dev_info); 579 + bdi_unregister(&q->backing_dev_info); 580 580 581 581 /* @q is and will stay empty, shutdown and put */ 582 582 blk_put_queue(q);
+1
block/blk-mq-tag.c
··· 641 641 { 642 642 bt_free(&tags->bitmap_tags); 643 643 bt_free(&tags->breserved_tags); 644 + free_cpumask_var(tags->cpumask); 644 645 kfree(tags); 645 646 } 646 647
+1 -3
block/blk-mq.c
··· 2296 2296 int i; 2297 2297 2298 2298 for (i = 0; i < set->nr_hw_queues; i++) { 2299 - if (set->tags[i]) { 2299 + if (set->tags[i]) 2300 2300 blk_mq_free_rq_map(set, set->tags[i], i); 2301 - free_cpumask_var(set->tags[i]->cpumask); 2302 - } 2303 2301 } 2304 2302 2305 2303 kfree(set->tags);
+1
block/blk-sysfs.c
··· 540 540 struct request_queue *q = 541 541 container_of(kobj, struct request_queue, kobj); 542 542 543 + bdi_exit(&q->backing_dev_info); 543 544 blkcg_exit_queue(q); 544 545 545 546 if (q->elevator) {
+2 -1
crypto/ahash.c
··· 544 544 struct crypto_alg *base = &alg->halg.base; 545 545 546 546 if (alg->halg.digestsize > PAGE_SIZE / 8 || 547 - alg->halg.statesize > PAGE_SIZE / 8) 547 + alg->halg.statesize > PAGE_SIZE / 8 || 548 + alg->halg.statesize == 0) 548 549 return -EINVAL; 549 550 550 551 base->cra_type = &crypto_ahash_type;
+1
drivers/acpi/acpica/acglobal.h
··· 61 61 ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX); 62 62 ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX); 63 63 ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX); 64 + ACPI_INIT_GLOBAL(u32, acpi_gbl_fadt_index, ACPI_INVALID_TABLE_INDEX); 64 65 65 66 #if (!ACPI_REDUCED_HARDWARE) 66 67 ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
+1 -3
drivers/acpi/acpica/actables.h
··· 85 85 /* 86 86 * tbfadt - FADT parse/convert/validate 87 87 */ 88 - void acpi_tb_parse_fadt(u32 table_index); 88 + void acpi_tb_parse_fadt(void); 89 89 90 90 void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length); 91 91 ··· 137 137 * tbutils - table manager utilities 138 138 */ 139 139 acpi_status acpi_tb_initialize_facs(void); 140 - 141 - u8 acpi_tb_tables_loaded(void); 142 140 143 141 void 144 142 acpi_tb_print_table_header(acpi_physical_address address,
+1 -1
drivers/acpi/acpica/evxfevnt.c
··· 71 71 72 72 /* ACPI tables must be present */ 73 73 74 - if (!acpi_tb_tables_loaded()) { 74 + if (acpi_gbl_fadt_index == ACPI_INVALID_TABLE_INDEX) { 75 75 return_ACPI_STATUS(AE_NO_ACPI_TABLES); 76 76 } 77 77
+5 -5
drivers/acpi/acpica/tbfadt.c
··· 298 298 * 299 299 * FUNCTION: acpi_tb_parse_fadt 300 300 * 301 - * PARAMETERS: table_index - Index for the FADT 301 + * PARAMETERS: None 302 302 * 303 303 * RETURN: None 304 304 * ··· 307 307 * 308 308 ******************************************************************************/ 309 309 310 - void acpi_tb_parse_fadt(u32 table_index) 310 + void acpi_tb_parse_fadt(void) 311 311 { 312 312 u32 length; 313 313 struct acpi_table_header *table; ··· 319 319 * Get a local copy of the FADT and convert it to a common format 320 320 * Map entire FADT, assumed to be smaller than one page. 321 321 */ 322 - length = acpi_gbl_root_table_list.tables[table_index].length; 322 + length = acpi_gbl_root_table_list.tables[acpi_gbl_fadt_index].length; 323 323 324 324 table = 325 - acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index]. 326 - address, length); 325 + acpi_os_map_memory(acpi_gbl_root_table_list. 326 + tables[acpi_gbl_fadt_index].address, length); 327 327 if (!table) { 328 328 return; 329 329 }
+2 -24
drivers/acpi/acpica/tbutils.c
··· 99 99 100 100 /******************************************************************************* 101 101 * 102 - * FUNCTION: acpi_tb_tables_loaded 103 - * 104 - * PARAMETERS: None 105 - * 106 - * RETURN: TRUE if required ACPI tables are loaded 107 - * 108 - * DESCRIPTION: Determine if the minimum required ACPI tables are present 109 - * (FADT, FACS, DSDT) 110 - * 111 - ******************************************************************************/ 112 - 113 - u8 acpi_tb_tables_loaded(void) 114 - { 115 - 116 - if (acpi_gbl_root_table_list.current_table_count >= 4) { 117 - return (TRUE); 118 - } 119 - 120 - return (FALSE); 121 - } 122 - 123 - /******************************************************************************* 124 - * 125 102 * FUNCTION: acpi_tb_check_dsdt_header 126 103 * 127 104 * PARAMETERS: None ··· 369 392 ACPI_COMPARE_NAME(&acpi_gbl_root_table_list. 370 393 tables[table_index].signature, 371 394 ACPI_SIG_FADT)) { 372 - acpi_tb_parse_fadt(table_index); 395 + acpi_gbl_fadt_index = table_index; 396 + acpi_tb_parse_fadt(); 373 397 } 374 398 375 399 next_table:
+1 -1
drivers/base/dma-contiguous.c
··· 187 187 * global one. Requires architecture specific dev_get_cma_area() helper 188 188 * function. 189 189 */ 190 - struct page *dma_alloc_from_contiguous(struct device *dev, int count, 190 + struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, 191 191 unsigned int align) 192 192 { 193 193 if (align > CONFIG_CMA_ALIGNMENT)
+6 -16
drivers/base/power/domain_governor.c
··· 77 77 dev_update_qos_constraint); 78 78 79 79 if (constraint_ns > 0) { 80 - constraint_ns -= td->start_latency_ns; 80 + constraint_ns -= td->save_state_latency_ns + 81 + td->stop_latency_ns + 82 + td->start_latency_ns + 83 + td->restore_state_latency_ns; 81 84 if (constraint_ns == 0) 82 85 return false; 83 86 } 84 87 td->effective_constraint_ns = constraint_ns; 85 - td->cached_stop_ok = constraint_ns > td->stop_latency_ns || 86 - constraint_ns == 0; 88 + td->cached_stop_ok = constraint_ns >= 0; 89 + 87 90 /* 88 91 * The children have been suspended already, so we don't need to take 89 92 * their stop latencies into account here. ··· 129 126 130 127 off_on_time_ns = genpd->power_off_latency_ns + 131 128 genpd->power_on_latency_ns; 132 - /* 133 - * It doesn't make sense to remove power from the domain if saving 134 - * the state of all devices in it and the power off/power on operations 135 - * take too much time. 136 - * 137 - * All devices in this domain have been stopped already at this point. 138 - */ 139 - list_for_each_entry(pdd, &genpd->dev_list, list_node) { 140 - if (pdd->dev->driver) 141 - off_on_time_ns += 142 - to_gpd_data(pdd)->td.save_state_latency_ns; 143 - } 144 129 145 130 min_off_time_ns = -1; 146 131 /* ··· 184 193 * constraint_ns cannot be negative here, because the device has 185 194 * been suspended. 186 195 */ 187 - constraint_ns -= td->restore_state_latency_ns; 188 196 if (constraint_ns <= off_on_time_ns) 189 197 return false; 190 198
+30 -6
drivers/block/nbd.c
··· 60 60 bool disconnect; /* a disconnect has been requested by user */ 61 61 62 62 struct timer_list timeout_timer; 63 + spinlock_t tasks_lock; 63 64 struct task_struct *task_recv; 64 65 struct task_struct *task_send; 65 66 ··· 141 140 static void nbd_xmit_timeout(unsigned long arg) 142 141 { 143 142 struct nbd_device *nbd = (struct nbd_device *)arg; 144 - struct task_struct *task; 143 + unsigned long flags; 145 144 146 145 if (list_empty(&nbd->queue_head)) 147 146 return; 148 147 149 148 nbd->disconnect = true; 150 149 151 - task = READ_ONCE(nbd->task_recv); 152 - if (task) 153 - force_sig(SIGKILL, task); 150 + spin_lock_irqsave(&nbd->tasks_lock, flags); 154 151 155 - task = READ_ONCE(nbd->task_send); 156 - if (task) 152 + if (nbd->task_recv) 153 + force_sig(SIGKILL, nbd->task_recv); 154 + 155 + if (nbd->task_send) 157 156 force_sig(SIGKILL, nbd->task_send); 157 + 158 + spin_unlock_irqrestore(&nbd->tasks_lock, flags); 158 159 159 160 dev_err(nbd_to_dev(nbd), "Connection timed out, killed receiver and sender, shutting down connection\n"); 160 161 } ··· 406 403 { 407 404 struct request *req; 408 405 int ret; 406 + unsigned long flags; 409 407 410 408 BUG_ON(nbd->magic != NBD_MAGIC); 411 409 412 410 sk_set_memalloc(nbd->sock->sk); 413 411 412 + spin_lock_irqsave(&nbd->tasks_lock, flags); 414 413 nbd->task_recv = current; 414 + spin_unlock_irqrestore(&nbd->tasks_lock, flags); 415 415 416 416 ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr); 417 417 if (ret) { 418 418 dev_err(disk_to_dev(nbd->disk), "device_create_file failed!\n"); 419 + 420 + spin_lock_irqsave(&nbd->tasks_lock, flags); 419 421 nbd->task_recv = NULL; 422 + spin_unlock_irqrestore(&nbd->tasks_lock, flags); 423 + 420 424 return ret; 421 425 } 422 426 ··· 439 429 440 430 device_remove_file(disk_to_dev(nbd->disk), &pid_attr); 441 431 432 + spin_lock_irqsave(&nbd->tasks_lock, flags); 442 433 nbd->task_recv = NULL; 434 + spin_unlock_irqrestore(&nbd->tasks_lock, flags); 443 435 444 436 if (signal_pending(current)) { 445 437 siginfo_t info; ··· 546 534 { 547 535 struct nbd_device *nbd = data; 548 536 struct request *req; 537 + unsigned long flags; 549 538 539 + spin_lock_irqsave(&nbd->tasks_lock, flags); 550 540 nbd->task_send = current; 541 + spin_unlock_irqrestore(&nbd->tasks_lock, flags); 551 542 552 543 set_user_nice(current, MIN_NICE); 553 544 while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) { ··· 587 572 nbd_handle_req(nbd, req); 588 573 } 589 574 575 + spin_lock_irqsave(&nbd->tasks_lock, flags); 590 576 nbd->task_send = NULL; 577 + spin_unlock_irqrestore(&nbd->tasks_lock, flags); 578 + 579 + /* Clear maybe pending signals */ 580 + if (signal_pending(current)) { 581 + siginfo_t info; 582 + dequeue_signal_lock(current, &current->blocked, &info); 583 + } 591 584 592 585 return 0; 593 586 } ··· 1075 1052 nbd_dev[i].magic = NBD_MAGIC; 1076 1053 INIT_LIST_HEAD(&nbd_dev[i].waiting_queue); 1077 1054 spin_lock_init(&nbd_dev[i].queue_lock); 1055 + spin_lock_init(&nbd_dev[i].tasks_lock); 1078 1056 INIT_LIST_HEAD(&nbd_dev[i].queue_head); 1079 1057 mutex_init(&nbd_dev[i].tx_lock); 1080 1058 init_timer(&nbd_dev[i].timeout_timer);
+15 -9
drivers/block/nvme-core.c
··· 603 603 struct nvme_iod *iod = ctx; 604 604 struct request *req = iod_get_private(iod); 605 605 struct nvme_cmd_info *cmd_rq = blk_mq_rq_to_pdu(req); 606 - 607 606 u16 status = le16_to_cpup(&cqe->status) >> 1; 607 + bool requeue = false; 608 + int error = 0; 608 609 609 610 if (unlikely(status)) { 610 611 if (!(status & NVME_SC_DNR || blk_noretry_request(req)) 611 612 && (jiffies - req->start_time) < req->timeout) { 612 613 unsigned long flags; 613 614 615 + requeue = true; 614 616 blk_mq_requeue_request(req); 615 617 spin_lock_irqsave(req->q->queue_lock, flags); 616 618 if (!blk_queue_stopped(req->q)) 617 619 blk_mq_kick_requeue_list(req->q); 618 620 spin_unlock_irqrestore(req->q->queue_lock, flags); 619 - return; 621 + goto release_iod; 620 622 } 621 623 622 624 if (req->cmd_type == REQ_TYPE_DRV_PRIV) { 623 625 if (cmd_rq->ctx == CMD_CTX_CANCELLED) 624 - status = -EINTR; 626 + error = -EINTR; 627 + else 628 + error = status; 625 629 } else { 626 - status = nvme_error_status(status); 630 + error = nvme_error_status(status); 627 631 } 628 632 } 629 633 ··· 639 635 if (cmd_rq->aborted) 640 636 dev_warn(nvmeq->dev->dev, 641 637 "completing aborted command with status:%04x\n", 642 - status); 638 + error); 643 639 640 + release_iod: 644 641 if (iod->nents) { 645 642 dma_unmap_sg(nvmeq->dev->dev, iod->sg, iod->nents, 646 643 rq_data_dir(req) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); ··· 654 649 } 655 650 nvme_free_iod(nvmeq->dev, iod); 656 651 657 - blk_mq_complete_request(req, status); 652 + if (likely(!requeue)) 653 + blk_mq_complete_request(req, error); 658 654 } 659 655 660 656 /* length is in bytes. gfp flags indicates whether we may sleep. */ ··· 1810 1804 1811 1805 length = (io.nblocks + 1) << ns->lba_shift; 1812 1806 meta_len = (io.nblocks + 1) * ns->ms; 1813 - metadata = (void __user *)(unsigned long)io.metadata; 1807 + metadata = (void __user *)(uintptr_t)io.metadata; 1814 1808 write = io.opcode & 1; 1815 1809 1816 1810 if (ns->ext) { ··· 1850 1844 c.rw.metadata = cpu_to_le64(meta_dma); 1851 1845 1852 1846 status = __nvme_submit_sync_cmd(ns->queue, &c, NULL, 1853 - (void __user *)io.addr, length, NULL, 0); 1847 + (void __user *)(uintptr_t)io.addr, length, NULL, 0); 1854 1848 unmap: 1855 1849 if (meta) { 1856 1850 if (status == NVME_SC_SUCCESS && !write) { ··· 1892 1886 timeout = msecs_to_jiffies(cmd.timeout_ms); 1893 1887 1894 1888 status = __nvme_submit_sync_cmd(ns ? ns->queue : dev->admin_q, &c, 1895 - NULL, (void __user *)cmd.addr, cmd.data_len, 1889 + NULL, (void __user *)(uintptr_t)cmd.addr, cmd.data_len, 1896 1890 &cmd.result, timeout); 1897 1891 if (status >= 0) { 1898 1892 if (put_user(cmd.result, &ucmd->result))
+53 -38
drivers/block/rbd.c
··· 96 96 #define RBD_MINORS_PER_MAJOR 256 97 97 #define RBD_SINGLE_MAJOR_PART_SHIFT 4 98 98 99 + #define RBD_MAX_PARENT_CHAIN_LEN 16 100 + 99 101 #define RBD_SNAP_DEV_NAME_PREFIX "snap_" 100 102 #define RBD_MAX_SNAP_NAME_LEN \ 101 103 (NAME_MAX - (sizeof (RBD_SNAP_DEV_NAME_PREFIX) - 1)) ··· 428 426 size_t count); 429 427 static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf, 430 428 size_t count); 431 - static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping); 429 + static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth); 432 430 static void rbd_spec_put(struct rbd_spec *spec); 433 431 434 432 static int rbd_dev_id_to_minor(int dev_id) ··· 1865 1863 rbd_osd_read_callback(obj_request); 1866 1864 break; 1867 1865 case CEPH_OSD_OP_SETALLOCHINT: 1868 - rbd_assert(osd_req->r_ops[1].op == CEPH_OSD_OP_WRITE); 1866 + rbd_assert(osd_req->r_ops[1].op == CEPH_OSD_OP_WRITE || 1867 + osd_req->r_ops[1].op == CEPH_OSD_OP_WRITEFULL); 1869 1868 /* fall through */ 1870 1869 case CEPH_OSD_OP_WRITE: 1870 + case CEPH_OSD_OP_WRITEFULL: 1871 1871 rbd_osd_write_callback(obj_request); 1872 1872 break; 1873 1873 case CEPH_OSD_OP_STAT: ··· 2405 2401 opcode = CEPH_OSD_OP_ZERO; 2406 2402 } 2407 2403 } else if (op_type == OBJ_OP_WRITE) { 2408 - opcode = CEPH_OSD_OP_WRITE; 2404 + if (!offset && length == object_size) 2405 + opcode = CEPH_OSD_OP_WRITEFULL; 2406 + else 2407 + opcode = CEPH_OSD_OP_WRITE; 2409 2408 osd_req_op_alloc_hint_init(osd_request, num_ops, 2410 2409 object_size, object_size); 2411 2410 num_ops++; ··· 3767 3760 /* set io sizes to object size */ 3768 3761 segment_size = rbd_obj_bytes(&rbd_dev->header); 3769 3762 blk_queue_max_hw_sectors(q, segment_size / SECTOR_SIZE); 3763 + q->limits.max_sectors = queue_max_hw_sectors(q); 3770 3764 blk_queue_max_segments(q, segment_size / SECTOR_SIZE); 3771 3765 blk_queue_max_segment_size(q, segment_size); 3772 3766 blk_queue_io_min(q, segment_size); ··· 5133 5125 return ret; 5134 5126 } 5135 5127 5136 - static int rbd_dev_probe_parent(struct rbd_device *rbd_dev) 5128 + /* 5129 + * @depth is rbd_dev_image_probe() -> rbd_dev_probe_parent() -> 5130 + * rbd_dev_image_probe() recursion depth, which means it's also the 5131 + * length of the already discovered part of the parent chain. 5132 + */ 5133 + static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth) 5137 5134 { 5138 5135 struct rbd_device *parent = NULL; 5139 - struct rbd_spec *parent_spec; 5140 - struct rbd_client *rbdc; 5141 5136 int ret; 5142 5137 5143 5138 if (!rbd_dev->parent_spec) 5144 5139 return 0; 5145 - /* 5146 - * We need to pass a reference to the client and the parent 5147 - * spec when creating the parent rbd_dev. Images related by 5148 - * parent/child relationships always share both. 5149 - */ 5150 - parent_spec = rbd_spec_get(rbd_dev->parent_spec); 5151 - rbdc = __rbd_get_client(rbd_dev->rbd_client); 5152 5140 5153 - ret = -ENOMEM; 5154 - parent = rbd_dev_create(rbdc, parent_spec, NULL); 5155 - if (!parent) 5141 + if (++depth > RBD_MAX_PARENT_CHAIN_LEN) { 5142 + pr_info("parent chain is too long (%d)\n", depth); 5143 + ret = -EINVAL; 5156 5144 goto out_err; 5157 - 5158 - ret = rbd_dev_image_probe(parent, false); 5159 - if (ret < 0) 5160 - goto out_err; 5161 - rbd_dev->parent = parent; 5162 - atomic_set(&rbd_dev->parent_ref, 1); 5163 - 5164 - return 0; 5165 - out_err: 5166 - if (parent) { 5167 - rbd_dev_unparent(rbd_dev); 5168 - rbd_dev_destroy(parent); 5169 - } else { 5170 - rbd_put_client(rbdc); 5171 - rbd_spec_put(parent_spec); 5172 5145 } 5173 5146 5147 + parent = rbd_dev_create(rbd_dev->rbd_client, rbd_dev->parent_spec, 5148 + NULL); 5149 + if (!parent) { 5150 + ret = -ENOMEM; 5151 + goto out_err; 5152 + } 5153 + 5154 + /* 5155 + * Images related by parent/child relationships always share 5156 + * rbd_client and spec/parent_spec, so bump their refcounts. 5157 + */ 5158 + __rbd_get_client(rbd_dev->rbd_client); 5159 + rbd_spec_get(rbd_dev->parent_spec); 5160 + 5161 + ret = rbd_dev_image_probe(parent, depth); 5162 + if (ret < 0) 5163 + goto out_err; 5164 + 5165 + rbd_dev->parent = parent; 5166 + atomic_set(&rbd_dev->parent_ref, 1); 5167 + return 0; 5168 + 5169 + out_err: 5170 + rbd_dev_unparent(rbd_dev); 5171 + if (parent) 5172 + rbd_dev_destroy(parent); 5174 5173 return ret; 5175 5174 } 5176 5175 ··· 5295 5280 * parent), initiate a watch on its header object before using that 5296 5281 * object to get detailed information about the rbd image. 5297 5282 */ 5298 - static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping) 5283 + static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth) 5299 5284 { 5300 5285 int ret; 5301 5286 ··· 5313 5298 if (ret) 5314 5299 goto err_out_format; 5315 5300 5316 - if (mapping) { 5301 + if (!depth) { 5317 5302 ret = rbd_dev_header_watch_sync(rbd_dev); 5318 5303 if (ret) { 5319 5304 if (ret == -ENOENT) ··· 5334 5319 * Otherwise this is a parent image, identified by pool, image 5335 5320 * and snap ids - need to fill in names for those ids. 5336 5321 */ 5337 - if (mapping) 5322 + if (!depth) 5338 5323 ret = rbd_spec_fill_snap_id(rbd_dev); 5339 5324 else 5340 5325 ret = rbd_spec_fill_names(rbd_dev); ··· 5356 5341 * Need to warn users if this image is the one being 5357 5342 * mapped and has a parent. 5358 5343 */ 5359 - if (mapping && rbd_dev->parent_spec) 5344 + if (!depth && rbd_dev->parent_spec) 5360 5345 rbd_warn(rbd_dev, 5361 5346 "WARNING: kernel layering is EXPERIMENTAL!"); 5362 5347 } 5363 5348 5364 - ret = rbd_dev_probe_parent(rbd_dev); 5349 + ret = rbd_dev_probe_parent(rbd_dev, depth); 5365 5350 if (ret) 5366 5351 goto err_out_probe; 5367 5352 ··· 5372 5357 err_out_probe: 5373 5358 rbd_dev_unprobe(rbd_dev); 5374 5359 err_out_watch: 5375 - if (mapping) 5360 + if (!depth) 5376 5361 rbd_dev_header_unwatch_sync(rbd_dev); 5377 5362 out_header_name: 5378 5363 kfree(rbd_dev->header_name); ··· 5435 5420 spec = NULL; /* rbd_dev now owns this */ 5436 5421 rbd_opts = NULL; /* rbd_dev now owns this */ 5437 5422 5438 - rc = rbd_dev_image_probe(rbd_dev, true); 5423 + rc = rbd_dev_image_probe(rbd_dev, 0); 5439 5424 if (rc < 0) 5440 5425 goto err_out_rbd_dev; 5441 5426
+2 -1
drivers/block/xen-blkfront.c
··· 1956 1956 break; 1957 1957 /* Missed the backend's Closing state -- fallthrough */ 1958 1958 case XenbusStateClosing: 1959 - blkfront_closing(info); 1959 + if (info) 1960 + blkfront_closing(info); 1960 1961 break; 1961 1962 } 1962 1963 }
+3 -2
drivers/bus/arm-ccn.c
··· 1184 1184 if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu)) 1185 1185 break; 1186 1186 target = cpumask_any_but(cpu_online_mask, cpu); 1187 - if (target < 0) 1187 + if (target >= nr_cpu_ids) 1188 1188 break; 1189 1189 perf_pmu_migrate_context(&dt->pmu, cpu, target); 1190 1190 cpumask_set_cpu(target, &dt->cpu); 1191 - WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0); 1191 + if (ccn->irq) 1192 + WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0); 1192 1193 default: 1193 1194 break; 1194 1195 }
+3 -1
drivers/clk/mvebu/clk-cpu.c
··· 197 197 for_each_node_by_type(dn, "cpu") { 198 198 struct clk_init_data init; 199 199 struct clk *clk; 200 + struct clk *parent_clk; 200 201 char *clk_name = kzalloc(5, GFP_KERNEL); 201 202 int cpu, err; 202 203 ··· 209 208 goto bail_out; 210 209 211 210 sprintf(clk_name, "cpu%d", cpu); 211 + parent_clk = of_clk_get(node, 0); 212 212 213 - cpuclk[cpu].parent_name = of_clk_get_parent_name(node, 0); 213 + cpuclk[cpu].parent_name = __clk_get_name(parent_clk); 214 214 cpuclk[cpu].clk_name = clk_name; 215 215 cpuclk[cpu].cpu = cpu; 216 216 cpuclk[cpu].reg_base = clock_complex_base;
+5
drivers/cpufreq/intel_pstate.c
··· 776 776 local_irq_save(flags); 777 777 rdmsrl(MSR_IA32_APERF, aperf); 778 778 rdmsrl(MSR_IA32_MPERF, mperf); 779 + if (cpu->prev_mperf == mperf) { 780 + local_irq_restore(flags); 781 + return; 782 + } 783 + 779 784 tsc = rdtsc(); 780 785 local_irq_restore(flags); 781 786
+6 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
··· 672 672 /* disp clock */ 673 673 adev->clock.default_dispclk = 674 674 le32_to_cpu(firmware_info->info_21.ulDefaultDispEngineClkFreq); 675 - if (adev->clock.default_dispclk == 0) 676 - adev->clock.default_dispclk = 54000; /* 540 Mhz */ 675 + /* set a reasonable default for DP */ 676 + if (adev->clock.default_dispclk < 53900) { 677 + DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n", 678 + adev->clock.default_dispclk / 100); 679 + adev->clock.default_dispclk = 60000; 680 + } 677 681 adev->clock.dp_extclk = 678 682 le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq); 679 683 adev->clock.current_dispclk = adev->clock.default_dispclk;
+3 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
··· 177 177 178 178 /* get chunks */ 179 179 INIT_LIST_HEAD(&p->validated); 180 - chunk_array_user = (uint64_t __user *)(cs->in.chunks); 180 + chunk_array_user = (uint64_t __user *)(unsigned long)(cs->in.chunks); 181 181 if (copy_from_user(chunk_array, chunk_array_user, 182 182 sizeof(uint64_t)*cs->in.num_chunks)) { 183 183 ret = -EFAULT; ··· 197 197 struct drm_amdgpu_cs_chunk user_chunk; 198 198 uint32_t __user *cdata; 199 199 200 - chunk_ptr = (void __user *)chunk_array[i]; 200 + chunk_ptr = (void __user *)(unsigned long)chunk_array[i]; 201 201 if (copy_from_user(&user_chunk, chunk_ptr, 202 202 sizeof(struct drm_amdgpu_cs_chunk))) { 203 203 ret = -EFAULT; ··· 208 208 p->chunks[i].length_dw = user_chunk.length_dw; 209 209 210 210 size = p->chunks[i].length_dw; 211 - cdata = (void __user *)user_chunk.chunk_data; 211 + cdata = (void __user *)(unsigned long)user_chunk.chunk_data; 212 212 p->chunks[i].user_ptr = cdata; 213 213 214 214 p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t));
-2
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 85 85 /* We borrow the event spin lock for protecting flip_status */ 86 86 spin_lock_irqsave(&crtc->dev->event_lock, flags); 87 87 88 - /* set the proper interrupt */ 89 - amdgpu_irq_get(adev, &adev->pageflip_irq, work->crtc_id); 90 88 /* do the flip (mmio) */ 91 89 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base); 92 90 /* set the flip status */
+5 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 242 242 {0x1002, 0x985F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU}, 243 243 #endif 244 244 /* topaz */ 245 - {0x1002, 0x6900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 246 - {0x1002, 0x6901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 247 - {0x1002, 0x6902, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 248 - {0x1002, 0x6903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 249 - {0x1002, 0x6907, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ}, 245 + {0x1002, 0x6900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT}, 246 + {0x1002, 0x6901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT}, 247 + {0x1002, 0x6902, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT}, 248 + {0x1002, 0x6903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT}, 249 + {0x1002, 0x6907, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT}, 250 250 /* tonga */ 251 251 {0x1002, 0x6920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA}, 252 252 {0x1002, 0x6921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},
+16
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
··· 402 402 return true; 403 403 return false; 404 404 } 405 + 406 + void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev) 407 + { 408 + struct amdgpu_fbdev *afbdev = adev->mode_info.rfbdev; 409 + struct drm_fb_helper *fb_helper; 410 + int ret; 411 + 412 + if (!afbdev) 413 + return; 414 + 415 + fb_helper = &afbdev->helper; 416 + 417 + ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper); 418 + if (ret) 419 + DRM_DEBUG("failed to restore crtc mode\n"); 420 + }
+4 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 485 485 * Outdated mess for old drm with Xorg being in charge (void function now). 486 486 */ 487 487 /** 488 - * amdgpu_driver_firstopen_kms - drm callback for last close 488 + * amdgpu_driver_lastclose_kms - drm callback for last close 489 489 * 490 490 * @dev: drm dev pointer 491 491 * ··· 493 493 */ 494 494 void amdgpu_driver_lastclose_kms(struct drm_device *dev) 495 495 { 496 + struct amdgpu_device *adev = dev->dev_private; 497 + 498 + amdgpu_fbdev_restore_mode(adev); 496 499 vga_switcheroo_process_delayed_switch(); 497 500 } 498 501
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
··· 567 567 void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state); 568 568 int amdgpu_fbdev_total_size(struct amdgpu_device *adev); 569 569 bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj); 570 + void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev); 570 571 571 572 void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev); 572 573
+6 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
··· 294 294 struct amdgpu_device *adev = dev_get_drvdata(dev); 295 295 umode_t effective_mode = attr->mode; 296 296 297 - /* Skip limit attributes if DPM is not enabled */ 297 + /* Skip attributes if DPM is not enabled */ 298 298 if (!adev->pm.dpm_enabled && 299 299 (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || 300 - attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr)) 300 + attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr || 301 + attr == &sensor_dev_attr_pwm1.dev_attr.attr || 302 + attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr || 303 + attr == &sensor_dev_attr_pwm1_max.dev_attr.attr || 304 + attr == &sensor_dev_attr_pwm1_min.dev_attr.attr)) 301 305 return 0; 302 306 303 307 /* Skip fan attributes if fan is not present */
+3 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 455 455 return -ENOMEM; 456 456 457 457 r = amdgpu_ib_get(ring, NULL, ndw * 4, ib); 458 - if (r) 458 + if (r) { 459 + kfree(ib); 459 460 return r; 461 + } 460 462 ib->length_dw = 0; 461 463 462 464 /* walk over the address space and update the page directory */
+5 -3
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
··· 6185 6185 if (!amdgpu_dpm) 6186 6186 return 0; 6187 6187 6188 + /* init the sysfs and debugfs files late */ 6189 + ret = amdgpu_pm_sysfs_init(adev); 6190 + if (ret) 6191 + return ret; 6192 + 6188 6193 ret = ci_set_temperature_range(adev); 6189 6194 if (ret) 6190 6195 return ret; ··· 6237 6232 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps; 6238 6233 if (amdgpu_dpm == 1) 6239 6234 amdgpu_pm_print_power_states(adev); 6240 - ret = amdgpu_pm_sysfs_init(adev); 6241 - if (ret) 6242 - goto dpm_failed; 6243 6235 mutex_unlock(&adev->pm.mutex); 6244 6236 DRM_INFO("amdgpu: dpm initialized\n"); 6245 6237
+3
drivers/gpu/drm/amd/amdgpu/cik.c
··· 1567 1567 int ret, i; 1568 1568 u16 tmp16; 1569 1569 1570 + if (pci_is_root_bus(adev->pdev->bus)) 1571 + return; 1572 + 1570 1573 if (amdgpu_pcie_gen2 == 0) 1571 1574 return; 1572 1575
+6 -4
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
··· 596 596 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 597 597 598 598 if (amdgpu_dpm) { 599 + int ret; 600 + /* init the sysfs and debugfs files late */ 601 + ret = amdgpu_pm_sysfs_init(adev); 602 + if (ret) 603 + return ret; 604 + 599 605 /* powerdown unused blocks for now */ 600 606 cz_dpm_powergate_uvd(adev, true); 601 607 cz_dpm_powergate_vce(adev, true); ··· 637 631 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps; 638 632 if (amdgpu_dpm == 1) 639 633 amdgpu_pm_print_power_states(adev); 640 - 641 - ret = amdgpu_pm_sysfs_init(adev); 642 - if (ret) 643 - goto dpm_init_failed; 644 634 645 635 mutex_unlock(&adev->pm.mutex); 646 636 DRM_INFO("amdgpu: dpm initialized\n");
+28 -2
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
··· 255 255 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]); 256 256 } 257 257 258 + static void dce_v10_0_pageflip_interrupt_init(struct amdgpu_device *adev) 259 + { 260 + unsigned i; 261 + 262 + /* Enable pflip interrupts */ 263 + for (i = 0; i < adev->mode_info.num_crtc; i++) 264 + amdgpu_irq_get(adev, &adev->pageflip_irq, i); 265 + } 266 + 267 + static void dce_v10_0_pageflip_interrupt_fini(struct amdgpu_device *adev) 268 + { 269 + unsigned i; 270 + 271 + /* Disable pflip interrupts */ 272 + for (i = 0; i < adev->mode_info.num_crtc; i++) 273 + amdgpu_irq_put(adev, &adev->pageflip_irq, i); 274 + } 275 + 258 276 /** 259 277 * dce_v10_0_page_flip - pageflip callback. 260 278 * ··· 2681 2663 dce_v10_0_vga_enable(crtc, true); 2682 2664 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE); 2683 2665 dce_v10_0_vga_enable(crtc, false); 2684 - /* Make sure VBLANK interrupt is still enabled */ 2666 + /* Make sure VBLANK and PFLIP interrupts are still enabled */ 2685 2667 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id); 2686 2668 amdgpu_irq_update(adev, &adev->crtc_irq, type); 2669 + amdgpu_irq_update(adev, &adev->pageflip_irq, type); 2687 2670 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id); 2688 2671 dce_v10_0_crtc_load_lut(crtc); 2689 2672 break; ··· 3044 3025 dce_v10_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false); 3045 3026 } 3046 3027 3028 + dce_v10_0_pageflip_interrupt_init(adev); 3029 + 3047 3030 return 0; 3048 3031 } 3049 3032 ··· 3060 3039 dce_v10_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false); 3061 3040 } 3062 3041 3042 + dce_v10_0_pageflip_interrupt_fini(adev); 3043 + 3063 3044 return 0; 3064 3045 } 3065 3046 ··· 3072 3049 amdgpu_atombios_scratch_regs_save(adev); 3073 3050 3074 3051 dce_v10_0_hpd_fini(adev); 3052 + 3053 + dce_v10_0_pageflip_interrupt_fini(adev); 3075 3054 3076 3055 return 0; 3077 3056 } ··· 3099 3074 3100 3075 /* initialize hpd */ 3101 3076 dce_v10_0_hpd_init(adev); 3077 + 3078 + dce_v10_0_pageflip_interrupt_init(adev); 3102 3079 3103 3080 return 0; 3104 3081 } ··· 3396 3369 spin_unlock_irqrestore(&adev->ddev->event_lock, flags); 3397 3370 3398 3371 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id); 3399 - amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id); 3400 3372 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work); 3401 3373 3402 3374 return 0;
+29 -3
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
··· 233 233 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]); 234 234 } 235 235 236 + static void dce_v11_0_pageflip_interrupt_init(struct amdgpu_device *adev) 237 + { 238 + unsigned i; 239 + 240 + /* Enable pflip interrupts */ 241 + for (i = 0; i < adev->mode_info.num_crtc; i++) 242 + amdgpu_irq_get(adev, &adev->pageflip_irq, i); 243 + } 244 + 245 + static void dce_v11_0_pageflip_interrupt_fini(struct amdgpu_device *adev) 246 + { 247 + unsigned i; 248 + 249 + /* Disable pflip interrupts */ 250 + for (i = 0; i < adev->mode_info.num_crtc; i++) 251 + amdgpu_irq_put(adev, &adev->pageflip_irq, i); 252 + } 253 + 236 254 /** 237 255 * dce_v11_0_page_flip - pageflip callback. 238 256 * ··· 2658 2640 dce_v11_0_vga_enable(crtc, true); 2659 2641 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE); 2660 2642 dce_v11_0_vga_enable(crtc, false); 2661 - /* Make sure VBLANK interrupt is still enabled */ 2643 + /* Make sure VBLANK and PFLIP interrupts are still enabled */ 2662 2644 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id); 2663 2645 amdgpu_irq_update(adev, &adev->crtc_irq, type); 2646 + amdgpu_irq_update(adev, &adev->pageflip_irq, type); 2664 2647 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id); 2665 2648 dce_v11_0_crtc_load_lut(crtc); 2666 2649 break; ··· 2907 2888 2908 2889 switch (adev->asic_type) { 2909 2890 case CHIP_CARRIZO: 2910 - adev->mode_info.num_crtc = 4; 2891 + adev->mode_info.num_crtc = 3; 2911 2892 adev->mode_info.num_hpd = 6; 2912 2893 adev->mode_info.num_dig = 9; 2913 2894 break; ··· 3019 3000 dce_v11_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false); 3020 3001 } 3021 3002 3003 + dce_v11_0_pageflip_interrupt_init(adev); 3004 + 3022 3005 return 0; 3023 3006 } 3024 3007 ··· 3035 3014 dce_v11_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false); 3036 3015 } 3037 3016 3017 + dce_v11_0_pageflip_interrupt_fini(adev); 3018 + 3038 3019 return 0; 3039 3020 } 3040 3021 ··· 3047 3024 amdgpu_atombios_scratch_regs_save(adev); 3048 3025 3049 3026 dce_v11_0_hpd_fini(adev); 3027 + 3028 + dce_v11_0_pageflip_interrupt_fini(adev); 3050 3029 3051 3030 return 0; 3052 3031 } ··· 3075 3050 3076 3051 /* initialize hpd */ 3077 3052 dce_v11_0_hpd_init(adev); 3053 + 3054 + dce_v11_0_pageflip_interrupt_init(adev); 3078 3055 3079 3056 return 0; 3080 3057 } ··· 3372 3345 spin_unlock_irqrestore(&adev->ddev->event_lock, flags); 3373 3346 3374 3347 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id); 3375 - amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id); 3376 3348 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work); 3377 3349 3378 3350 return 0;
+28 -2
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
··· 204 204 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]); 205 205 } 206 206 207 + static void dce_v8_0_pageflip_interrupt_init(struct amdgpu_device *adev) 208 + { 209 + unsigned i; 210 + 211 + /* Enable pflip interrupts */ 212 + for (i = 0; i < adev->mode_info.num_crtc; i++) 213 + amdgpu_irq_get(adev, &adev->pageflip_irq, i); 214 + } 215 + 216 + static void dce_v8_0_pageflip_interrupt_fini(struct amdgpu_device *adev) 217 + { 218 + unsigned i; 219 + 220 + /* Disable pflip interrupts */ 221 + for (i = 0; i < adev->mode_info.num_crtc; i++) 222 + amdgpu_irq_put(adev, &adev->pageflip_irq, i); 223 + } 224 + 207 225 /** 208 226 * dce_v8_0_page_flip - pageflip callback. 209 227 * ··· 2593 2575 dce_v8_0_vga_enable(crtc, true); 2594 2576 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE); 2595 2577 dce_v8_0_vga_enable(crtc, false); 2596 - /* Make sure VBLANK interrupt is still enabled */ 2578 + /* Make sure VBLANK and PFLIP interrupts are still enabled */ 2597 2579 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id); 2598 2580 amdgpu_irq_update(adev, &adev->crtc_irq, type); 2581 + amdgpu_irq_update(adev, &adev->pageflip_irq, type); 2599 2582 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id); 2600 2583 dce_v8_0_crtc_load_lut(crtc); 2601 2584 break; ··· 2952 2933 dce_v8_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false); 2953 2934 } 2954 2935 2936 + dce_v8_0_pageflip_interrupt_init(adev); 2937 + 2955 2938 return 0; 2956 2939 } 2957 2940 ··· 2968 2947 dce_v8_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false); 2969 2948 } 2970 2949 2950 + dce_v8_0_pageflip_interrupt_fini(adev); 2951 + 2971 2952 return 0; 2972 2953 } 2973 2954 ··· 2980 2957 amdgpu_atombios_scratch_regs_save(adev); 2981 2958 2982 2959 dce_v8_0_hpd_fini(adev); 2960 + 2961 + dce_v8_0_pageflip_interrupt_fini(adev); 2983 2962 2984 2963 return 0; 2985 2964 } ··· 3005 2980 3006 2981 /* initialize hpd */ 3007 2982 dce_v8_0_hpd_init(adev); 2983 + 2984 + dce_v8_0_pageflip_interrupt_init(adev); 3008 2985 3009 2986 return 0; 3010 2987 } ··· 3403 3376 spin_unlock_irqrestore(&adev->ddev->event_lock, flags); 3404 3377 3405 3378 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id); 3406 - amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id); 3407 3379 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work); 3408 3380 3409 3381 return 0;
+9 -3
drivers/gpu/drm/amd/amdgpu/kv_dpm.c
··· 2995 2995 { 2996 2996 /* powerdown unused blocks for now */ 2997 2997 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 2998 + int ret; 2999 + 3000 + if (!amdgpu_dpm) 3001 + return 0; 3002 + 3003 + /* init the sysfs and debugfs files late */ 3004 + ret = amdgpu_pm_sysfs_init(adev); 3005 + if (ret) 3006 + return ret; 2998 3007 2999 3008 kv_dpm_powergate_acp(adev, true); 3000 3009 kv_dpm_powergate_samu(adev, true); ··· 3047 3038 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps; 3048 3039 if (amdgpu_dpm == 1) 3049 3040 amdgpu_pm_print_power_states(adev); 3050 - ret = amdgpu_pm_sysfs_init(adev); 3051 - if (ret) 3052 - goto dpm_failed; 3053 3041 mutex_unlock(&adev->pm.mutex); 3054 3042 DRM_INFO("amdgpu: dpm initialized\n"); 3055 3043
+3
drivers/gpu/drm/amd/amdgpu/vi.c
··· 1005 1005 u32 mask; 1006 1006 int ret; 1007 1007 1008 + if (pci_is_root_bus(adev->pdev->bus)) 1009 + return; 1010 + 1008 1011 if (amdgpu_pcie_gen2 == 0) 1009 1012 return; 1010 1013
+6 -4
drivers/gpu/drm/drm_dp_mst_topology.c
··· 1194 1194 1195 1195 list_for_each_entry(port, &mstb->ports, next) { 1196 1196 if (port->port_num == port_num) { 1197 - if (!port->mstb) { 1197 + mstb = port->mstb; 1198 + if (!mstb) { 1198 1199 DRM_ERROR("failed to lookup MSTB with lct %d, rad %02x\n", lct, rad[0]); 1199 - return NULL; 1200 + goto out; 1200 1201 } 1201 1202 1202 - mstb = port->mstb; 1203 1203 break; 1204 1204 } 1205 1205 } 1206 1206 } 1207 1207 kref_get(&mstb->kref); 1208 + out: 1208 1209 mutex_unlock(&mgr->lock); 1209 1210 return mstb; 1210 1211 } ··· 2802 2801 if (msgs[num - 1].flags & I2C_M_RD) 2803 2802 reading = true; 2804 2803 2805 - if (!reading) { 2804 + if (!reading || (num - 1 > DP_REMOTE_I2C_READ_MAX_TRANSACTIONS)) { 2806 2805 DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n"); 2807 2806 ret = -EIO; 2808 2807 goto out; 2809 2808 } 2810 2809 2810 + memset(&msg, 0, sizeof(msg)); 2811 2811 msg.req_type = DP_REMOTE_I2C_READ; 2812 2812 msg.u.i2c_read.num_transactions = num - 1; 2813 2813 msg.u.i2c_read.port_number = port->port_num;
+3 -9
drivers/gpu/drm/drm_sysfs.c
··· 235 235 char *buf) 236 236 { 237 237 struct drm_connector *connector = to_drm_connector(device); 238 - struct drm_device *dev = connector->dev; 239 - uint64_t dpms_status; 240 - int ret; 238 + int dpms; 241 239 242 - ret = drm_object_property_get_value(&connector->base, 243 - dev->mode_config.dpms_property, 244 - &dpms_status); 245 - if (ret) 246 - return 0; 240 + dpms = READ_ONCE(connector->dpms); 247 241 248 242 return snprintf(buf, PAGE_SIZE, "%s\n", 249 - drm_get_dpms_name((int)dpms_status)); 243 + drm_get_dpms_name(dpms)); 250 244 } 251 245 252 246 static ssize_t enabled_show(struct device *device,
+1 -1
drivers/gpu/drm/i915/i915_gem_shrinker.c
··· 143 143 } 144 144 145 145 /** 146 - * i915_gem_shrink - Shrink buffer object caches completely 146 + * i915_gem_shrink_all - Shrink buffer object caches completely 147 147 * @dev_priv: i915 device 148 148 * 149 149 * This is a simple wraper around i915_gem_shrink() to aggressively shrink all
+4 -1
drivers/gpu/drm/i915/i915_gem_userptr.c
··· 804 804 * Also note, that the object created here is not currently a "first class" 805 805 * object, in that several ioctls are banned. These are the CPU access 806 806 * ioctls: mmap(), pwrite and pread. In practice, you are expected to use 807 - * direct access via your pointer rather than use those ioctls. 807 + * direct access via your pointer rather than use those ioctls. Another 808 + * restriction is that we do not allow userptr surfaces to be pinned to the 809 + * hardware and so we reject any attempt to create a framebuffer out of a 810 + * userptr. 808 811 * 809 812 * If you think this is a good interface to use to pass GPU memory between 810 813 * drivers, please use dma-buf instead. In fact, wherever possible use
+67 -53
drivers/gpu/drm/i915/intel_display.c
··· 1724 1724 I915_READ(DPLL(!crtc->pipe)) | DPLL_DVO_2X_MODE); 1725 1725 } 1726 1726 1727 + /* 1728 + * Apparently we need to have VGA mode enabled prior to changing 1729 + * the P1/P2 dividers. Otherwise the DPLL will keep using the old 1730 + * dividers, even though the register value does change. 1731 + */ 1732 + I915_WRITE(reg, 0); 1733 + 1734 + I915_WRITE(reg, dpll); 1735 + 1727 1736 /* Wait for the clocks to stabilize. */ 1728 1737 POSTING_READ(reg); 1729 1738 udelay(150); ··· 14116 14107 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); 14117 14108 struct drm_i915_gem_object *obj = intel_fb->obj; 14118 14109 14110 + if (obj->userptr.mm) { 14111 + DRM_DEBUG("attempting to use a userptr for a framebuffer, denied\n"); 14112 + return -EINVAL; 14113 + } 14114 + 14119 14115 return drm_gem_handle_create(file, &obj->base, handle); 14120 14116 } 14121 14117 ··· 14911 14897 /* restore vblank interrupts to correct state */ 14912 14898 drm_crtc_vblank_reset(&crtc->base); 14913 14899 if (crtc->active) { 14900 + struct intel_plane *plane; 14901 + 14914 14902 drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode); 14915 14903 update_scanline_offset(crtc); 14916 14904 drm_crtc_vblank_on(&crtc->base); 14905 + 14906 + /* Disable everything but the primary plane */ 14907 + for_each_intel_plane_on_crtc(dev, crtc, plane) { 14908 + if (plane->base.type == DRM_PLANE_TYPE_PRIMARY) 14909 + continue; 14910 + 14911 + plane->disable_plane(&plane->base, &crtc->base); 14912 + } 14917 14913 } 14918 14914 14919 14915 /* We need to sanitize the plane -> pipe mapping first because this will ··· 15091 15067 i915_redisable_vga_power_on(dev); 15092 15068 } 15093 15069 15094 - static bool primary_get_hw_state(struct intel_crtc *crtc) 15070 + static bool primary_get_hw_state(struct intel_plane *plane) 15095 15071 { 15096 - struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; 15072 + struct drm_i915_private *dev_priv = to_i915(plane->base.dev); 15097 15073 15098 - return !!(I915_READ(DSPCNTR(crtc->plane)) & DISPLAY_PLANE_ENABLE); 15074 + return I915_READ(DSPCNTR(plane->plane)) & DISPLAY_PLANE_ENABLE; 15099 15075 } 15100 15076 15101 - static void readout_plane_state(struct intel_crtc *crtc, 15102 - struct intel_crtc_state *crtc_state) 15077 + /* FIXME read out full plane state for all planes */ 15078 + static void readout_plane_state(struct intel_crtc *crtc) 15103 15079 { 15104 - struct intel_plane *p; 15105 - struct intel_plane_state *plane_state; 15106 - bool active = crtc_state->base.active; 15080 + struct drm_plane *primary = crtc->base.primary; 15081 + struct intel_plane_state *plane_state = 15082 + to_intel_plane_state(primary->state); 15107 15083 15108 - for_each_intel_plane(crtc->base.dev, p) { 15109 - if (crtc->pipe != p->pipe) 15110 - continue; 15084 + plane_state->visible = 15085 + primary_get_hw_state(to_intel_plane(primary)); 15111 15086 15112 - plane_state = to_intel_plane_state(p->base.state); 15113 - 15114 - if (p->base.type == DRM_PLANE_TYPE_PRIMARY) { 15115 - plane_state->visible = primary_get_hw_state(crtc); 15116 - if (plane_state->visible) 15117 - crtc->base.state->plane_mask |= 15118 - 1 << drm_plane_index(&p->base); 15119 - } else { 15120 - if (active) 15121 - p->disable_plane(&p->base, &crtc->base); 15122 - 15123 - plane_state->visible = false; 15124 - } 15125 - } 15087 + if (plane_state->visible) 15088 + crtc->base.state->plane_mask |= 1 << drm_plane_index(primary); 15126 15089 } 15127 15090 15128 15091 static void intel_modeset_readout_hw_state(struct drm_device *dev) ··· 15132 15121 crtc->base.state->active = crtc->active; 15133 15122 crtc->base.enabled = crtc->active; 15134 15123 15135 - memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); 15136 - if (crtc->base.state->active) { 15137 - intel_mode_from_pipe_config(&crtc->base.mode, crtc->config); 15138 - intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config); 15139 - WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode)); 15140 - 15141 - /* 15142 - * The initial mode needs to be set in order to keep 15143 - * the atomic core happy. It wants a valid mode if the 15144 - * crtc's enabled, so we do the above call. 15145 - * 15146 - * At this point some state updated by the connectors 15147 - * in their ->detect() callback has not run yet, so 15148 - * no recalculation can be done yet. 15149 - * 15150 - * Even if we could do a recalculation and modeset 15151 - * right now it would cause a double modeset if 15152 - * fbdev or userspace chooses a different initial mode. 15153 - * 15154 - * If that happens, someone indicated they wanted a 15155 - * mode change, which means it's safe to do a full 15156 - * recalculation. 15157 - */ 15158 - crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED; 15159 - } 15160 - 15161 - crtc->base.hwmode = crtc->config->base.adjusted_mode; 15162 - readout_plane_state(crtc, to_intel_crtc_state(crtc->base.state)); 15124 + readout_plane_state(crtc); 15163 15125 15164 15126 DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n", 15165 15127 crtc->base.base.id, ··· 15190 15206 connector->base.base.id, 15191 15207 connector->base.name, 15192 15208 connector->base.encoder ? "enabled" : "disabled"); 15209 + } 15210 + 15211 + for_each_intel_crtc(dev, crtc) { 15212 + crtc->base.hwmode = crtc->config->base.adjusted_mode; 15213 + 15214 + memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); 15215 + if (crtc->base.state->active) { 15216 + intel_mode_from_pipe_config(&crtc->base.mode, crtc->config); 15217 + intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config); 15218 + WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode)); 15219 + 15220 + /* 15221 + * The initial mode needs to be set in order to keep 15222 + * the atomic core happy. It wants a valid mode if the 15223 + * crtc's enabled, so we do the above call. 15224 + * 15225 + * At this point some state updated by the connectors 15226 + * in their ->detect() callback has not run yet, so 15227 + * no recalculation can be done yet. 15228 + * 15229 + * Even if we could do a recalculation and modeset 15230 + * right now it would cause a double modeset if 15231 + * fbdev or userspace chooses a different initial mode. 15232 + * 15233 + * If that happens, someone indicated they wanted a 15234 + * mode change, which means it's safe to do a full 15235 + * recalculation. 15236 + */ 15237 + crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED; 15238 + } 15193 15239 } 15194 15240 } 15195 15241
+1
drivers/gpu/drm/i915/intel_lrc.c
··· 1659 1659 if (flush_domains) { 1660 1660 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; 1661 1661 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; 1662 + flags |= PIPE_CONTROL_FLUSH_ENABLE; 1662 1663 } 1663 1664 1664 1665 if (invalidate_domains) {
+2
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 347 347 if (flush_domains) { 348 348 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; 349 349 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; 350 + flags |= PIPE_CONTROL_FLUSH_ENABLE; 350 351 } 351 352 if (invalidate_domains) { 352 353 flags |= PIPE_CONTROL_TLB_INVALIDATE; ··· 419 418 if (flush_domains) { 420 419 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; 421 420 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; 421 + flags |= PIPE_CONTROL_FLUSH_ENABLE; 422 422 } 423 423 if (invalidate_domains) { 424 424 flags |= PIPE_CONTROL_TLB_INVALIDATE;
+5 -1
drivers/gpu/drm/nouveau/nouveau_display.c
··· 469 469 if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { 470 470 dev->mode_config.max_width = 4096; 471 471 dev->mode_config.max_height = 4096; 472 - } else { 472 + } else 473 + if (drm->device.info.family < NV_DEVICE_INFO_V0_FERMI) { 473 474 dev->mode_config.max_width = 8192; 474 475 dev->mode_config.max_height = 8192; 476 + } else { 477 + dev->mode_config.max_width = 16384; 478 + dev->mode_config.max_height = 16384; 475 479 } 476 480 477 481 dev->mode_config.preferred_depth = 24;
+24
drivers/gpu/drm/nouveau/nouveau_fbcon.c
··· 178 178 return 0; 179 179 } 180 180 181 + static int 182 + nouveau_fbcon_open(struct fb_info *info, int user) 183 + { 184 + struct nouveau_fbdev *fbcon = info->par; 185 + struct nouveau_drm *drm = nouveau_drm(fbcon->dev); 186 + int ret = pm_runtime_get_sync(drm->dev->dev); 187 + if (ret < 0 && ret != -EACCES) 188 + return ret; 189 + return 0; 190 + } 191 + 192 + static int 193 + nouveau_fbcon_release(struct fb_info *info, int user) 194 + { 195 + struct nouveau_fbdev *fbcon = info->par; 196 + struct nouveau_drm *drm = nouveau_drm(fbcon->dev); 197 + pm_runtime_put(drm->dev->dev); 198 + return 0; 199 + } 200 + 181 201 static struct fb_ops nouveau_fbcon_ops = { 182 202 .owner = THIS_MODULE, 203 + .fb_open = nouveau_fbcon_open, 204 + .fb_release = nouveau_fbcon_release, 183 205 .fb_check_var = drm_fb_helper_check_var, 184 206 .fb_set_par = drm_fb_helper_set_par, 185 207 .fb_fillrect = nouveau_fbcon_fillrect, ··· 217 195 218 196 static struct fb_ops nouveau_fbcon_sw_ops = { 219 197 .owner = THIS_MODULE, 198 + .fb_open = nouveau_fbcon_open, 199 + .fb_release = nouveau_fbcon_release, 220 200 .fb_check_var = drm_fb_helper_check_var, 221 201 .fb_set_par = drm_fb_helper_set_par, 222 202 .fb_fillrect = drm_fb_helper_cfb_fillrect,
+3 -2
drivers/gpu/drm/nouveau/nouveau_gem.c
··· 227 227 struct nouveau_bo *nvbo = nouveau_gem_object(gem); 228 228 struct nvkm_vma *vma; 229 229 230 - if (nvbo->bo.mem.mem_type == TTM_PL_TT) 230 + if (is_power_of_2(nvbo->valid_domains)) 231 + rep->domain = nvbo->valid_domains; 232 + else if (nvbo->bo.mem.mem_type == TTM_PL_TT) 231 233 rep->domain = NOUVEAU_GEM_DOMAIN_GART; 232 234 else 233 235 rep->domain = NOUVEAU_GEM_DOMAIN_VRAM; 234 - 235 236 rep->offset = nvbo->bo.offset; 236 237 if (cli->vm) { 237 238 vma = nouveau_bo_vma_find(nvbo, cli->vm);
+6
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
··· 267 267 index = NVKM_I2C_BUS_PRI; 268 268 if (init->outp && init->outp->i2c_upper_default) 269 269 index = NVKM_I2C_BUS_SEC; 270 + } else 271 + if (index == 0x80) { 272 + index = NVKM_I2C_BUS_PRI; 273 + } else 274 + if (index == 0x81) { 275 + index = NVKM_I2C_BUS_SEC; 270 276 } 271 277 272 278 bus = nvkm_i2c_bus_find(i2c, index);
+3
drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
··· 8 8 void *(*init)(struct nvkm_bios *, const char *); 9 9 void (*fini)(void *); 10 10 u32 (*read)(void *, u32 offset, u32 length, struct nvkm_bios *); 11 + u32 (*size)(void *); 11 12 bool rw; 13 + bool ignore_checksum; 14 + bool no_pcir; 12 15 }; 13 16 14 17 int nvbios_extend(struct nvkm_bios *, u32 length);
+18 -9
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
··· 45 45 u32 read = mthd->func->read(data, start, limit - start, bios); 46 46 bios->size = start + read; 47 47 } 48 - return bios->size >= limit; 48 + return bios->size >= upto; 49 49 } 50 50 51 51 static int ··· 55 55 struct nvbios_image image; 56 56 int score = 1; 57 57 58 - if (!shadow_fetch(bios, mthd, offset + 0x1000)) { 59 - nvkm_debug(subdev, "%08x: header fetch failed\n", offset); 60 - return 0; 61 - } 58 + if (mthd->func->no_pcir) { 59 + image.base = 0; 60 + image.type = 0; 61 + image.size = mthd->func->size(mthd->data); 62 + image.last = 1; 63 + } else { 64 + if (!shadow_fetch(bios, mthd, offset + 0x1000)) { 65 + nvkm_debug(subdev, "%08x: header fetch failed\n", 66 + offset); 67 + return 0; 68 + } 62 69 63 - if (!nvbios_image(bios, idx, &image)) { 64 - nvkm_debug(subdev, "image %d invalid\n", idx); 65 - return 0; 70 + if (!nvbios_image(bios, idx, &image)) { 71 + nvkm_debug(subdev, "image %d invalid\n", idx); 72 + return 0; 73 + } 66 74 } 67 75 nvkm_debug(subdev, "%08x: type %02x, %d bytes\n", 68 76 image.base, image.type, image.size); ··· 82 74 83 75 switch (image.type) { 84 76 case 0x00: 85 - if (nvbios_checksum(&bios->data[image.base], image.size)) { 77 + if (!mthd->func->ignore_checksum && 78 + nvbios_checksum(&bios->data[image.base], image.size)) { 86 79 nvkm_debug(subdev, "%08x: checksum failed\n", 87 80 image.base); 88 81 if (mthd->func->rw)
+15 -2
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c
··· 21 21 * 22 22 */ 23 23 #include "priv.h" 24 + 24 25 #include <core/pci.h> 25 26 26 27 #if defined(__powerpc__) ··· 34 33 of_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios) 35 34 { 36 35 struct priv *priv = data; 37 - if (offset + length <= priv->size) { 36 + if (offset < priv->size) { 37 + length = min_t(u32, length, priv->size - offset); 38 38 memcpy_fromio(bios->data + offset, priv->data + offset, length); 39 39 return length; 40 40 } 41 41 return 0; 42 42 } 43 43 44 + static u32 45 + of_size(void *data) 46 + { 47 + struct priv *priv = data; 48 + return priv->size; 49 + } 50 + 44 51 static void * 45 52 of_init(struct nvkm_bios *bios, const char *name) 46 53 { 47 - struct pci_dev *pdev = bios->subdev.device->func->pci(bios->subdev.device)->pdev; 54 + struct nvkm_device *device = bios->subdev.device; 55 + struct pci_dev *pdev = device->func->pci(device)->pdev; 48 56 struct device_node *dn; 49 57 struct priv *priv; 50 58 if (!(dn = pci_device_to_OF_node(pdev))) ··· 72 62 .init = of_init, 73 63 .fini = (void(*)(void *))kfree, 74 64 .read = of_read, 65 + .size = of_size, 75 66 .rw = false, 67 + .ignore_checksum = true, 68 + .no_pcir = true, 76 69 }; 77 70 #else 78 71 const struct nvbios_source
+6 -2
drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c
··· 35 35 nvkm_device_agp_quirks[] = { 36 36 /* VIA Apollo PRO133x / GeForce FX 5600 Ultra - fdo#20341 */ 37 37 { PCI_VENDOR_ID_VIA, 0x0691, PCI_VENDOR_ID_NVIDIA, 0x0311, 2 }, 38 + /* SiS 761 does not support AGP cards, use PCI mode */ 39 + { PCI_VENDOR_ID_SI, 0x0761, PCI_ANY_ID, PCI_ANY_ID, 0 }, 38 40 {}, 39 41 }; 40 42 ··· 139 137 while (quirk->hostbridge_vendor) { 140 138 if (info.device->vendor == quirk->hostbridge_vendor && 141 139 info.device->device == quirk->hostbridge_device && 142 - pci->pdev->vendor == quirk->chip_vendor && 143 - pci->pdev->device == quirk->chip_device) { 140 + (quirk->chip_vendor == (u16)PCI_ANY_ID || 141 + pci->pdev->vendor == quirk->chip_vendor) && 142 + (quirk->chip_device == (u16)PCI_ANY_ID || 143 + pci->pdev->device == quirk->chip_device)) { 144 144 nvkm_info(subdev, "forcing default agp mode to %dX, " 145 145 "use NvAGP=<mode> to override\n", 146 146 quirk->mode);
+9 -1
drivers/gpu/drm/qxl/qxl_display.c
··· 244 244 ret = qxl_bo_reserve(bo, false); 245 245 if (ret) 246 246 return ret; 247 + ret = qxl_bo_pin(bo, bo->type, NULL); 248 + qxl_bo_unreserve(bo); 249 + if (ret) 250 + return ret; 247 251 248 252 qxl_draw_dirty_fb(qdev, qfb_src, bo, 0, 0, 249 253 &norect, one_clip_rect, inc); ··· 261 257 } 262 258 drm_vblank_put(dev, qcrtc->index); 263 259 264 - qxl_bo_unreserve(bo); 260 + ret = qxl_bo_reserve(bo, false); 261 + if (!ret) { 262 + qxl_bo_unpin(bo); 263 + qxl_bo_unreserve(bo); 264 + } 265 265 266 266 return 0; 267 267 }
+11 -8
drivers/gpu/drm/qxl/qxl_fb.c
··· 144 144 145 145 spin_lock_irqsave(&qfbdev->dirty.lock, flags); 146 146 147 - if (qfbdev->dirty.y1 < y) 148 - y = qfbdev->dirty.y1; 149 - if (qfbdev->dirty.y2 > y2) 150 - y2 = qfbdev->dirty.y2; 151 - if (qfbdev->dirty.x1 < x) 152 - x = qfbdev->dirty.x1; 153 - if (qfbdev->dirty.x2 > x2) 154 - x2 = qfbdev->dirty.x2; 147 + if ((qfbdev->dirty.y2 - qfbdev->dirty.y1) && 148 + (qfbdev->dirty.x2 - qfbdev->dirty.x1)) { 149 + if (qfbdev->dirty.y1 < y) 150 + y = qfbdev->dirty.y1; 151 + if (qfbdev->dirty.y2 > y2) 152 + y2 = qfbdev->dirty.y2; 153 + if (qfbdev->dirty.x1 < x) 154 + x = qfbdev->dirty.x1; 155 + if (qfbdev->dirty.x2 > x2) 156 + x2 = qfbdev->dirty.x2; 157 + } 155 158 156 159 qfbdev->dirty.x1 = x; 157 160 qfbdev->dirty.x2 = x2;
+1 -3
drivers/gpu/drm/qxl/qxl_release.c
··· 307 307 idr_ret = qxl_release_alloc(qdev, QXL_RELEASE_SURFACE_CMD, release); 308 308 if (idr_ret < 0) 309 309 return idr_ret; 310 - bo = qxl_bo_ref(to_qxl_bo(entry->tv.bo)); 310 + bo = to_qxl_bo(entry->tv.bo); 311 311 312 312 (*release)->release_offset = create_rel->release_offset + 64; 313 313 ··· 316 316 info = qxl_release_map(qdev, *release); 317 317 info->id = idr_ret; 318 318 qxl_release_unmap(qdev, *release, info); 319 - 320 - qxl_bo_unref(&bo); 321 319 return 0; 322 320 } 323 321
+2 -12
drivers/gpu/drm/radeon/radeon_display.c
··· 1633 1633 radeon_fbdev_init(rdev); 1634 1634 drm_kms_helper_poll_init(rdev->ddev); 1635 1635 1636 - if (rdev->pm.dpm_enabled) { 1637 - /* do dpm late init */ 1638 - ret = radeon_pm_late_init(rdev); 1639 - if (ret) { 1640 - rdev->pm.dpm_enabled = false; 1641 - DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n"); 1642 - } 1643 - /* set the dpm state for PX since there won't be 1644 - * a modeset to call this. 1645 - */ 1646 - radeon_pm_compute_clocks(rdev); 1647 - } 1636 + /* do pm late init */ 1637 + ret = radeon_pm_late_init(rdev); 1648 1638 1649 1639 return 0; 1650 1640 }
+1
drivers/gpu/drm/radeon/radeon_dp_mst.c
··· 283 283 radeon_connector->mst_encoder = radeon_dp_create_fake_mst_encoder(master); 284 284 285 285 drm_object_attach_property(&connector->base, dev->mode_config.path_property, 0); 286 + drm_object_attach_property(&connector->base, dev->mode_config.tile_property, 0); 286 287 drm_mode_connector_set_path_property(connector, pathprop); 287 288 288 289 return connector;
+16
drivers/gpu/drm/radeon/radeon_fb.c
··· 397 397 { 398 398 drm_fb_helper_remove_one_connector(&rdev->mode_info.rfbdev->helper, connector); 399 399 } 400 + 401 + void radeon_fbdev_restore_mode(struct radeon_device *rdev) 402 + { 403 + struct radeon_fbdev *rfbdev = rdev->mode_info.rfbdev; 404 + struct drm_fb_helper *fb_helper; 405 + int ret; 406 + 407 + if (!rfbdev) 408 + return; 409 + 410 + fb_helper = &rfbdev->helper; 411 + 412 + ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper); 413 + if (ret) 414 + DRM_DEBUG("failed to restore crtc mode\n"); 415 + }
+4 -1
drivers/gpu/drm/radeon/radeon_kms.c
··· 598 598 * Outdated mess for old drm with Xorg being in charge (void function now). 599 599 */ 600 600 /** 601 - * radeon_driver_firstopen_kms - drm callback for last close 601 + * radeon_driver_lastclose_kms - drm callback for last close 602 602 * 603 603 * @dev: drm dev pointer 604 604 * ··· 606 606 */ 607 607 void radeon_driver_lastclose_kms(struct drm_device *dev) 608 608 { 609 + struct radeon_device *rdev = dev->dev_private; 610 + 611 + radeon_fbdev_restore_mode(rdev); 609 612 vga_switcheroo_process_delayed_switch(); 610 613 } 611 614
+1
drivers/gpu/drm/radeon/radeon_mode.h
··· 980 980 void radeon_fbdev_fini(struct radeon_device *rdev); 981 981 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state); 982 982 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj); 983 + void radeon_fbdev_restore_mode(struct radeon_device *rdev); 983 984 984 985 void radeon_fb_output_poll_changed(struct radeon_device *rdev); 985 986
+44 -27
drivers/gpu/drm/radeon/radeon_pm.c
··· 717 717 struct radeon_device *rdev = dev_get_drvdata(dev); 718 718 umode_t effective_mode = attr->mode; 719 719 720 - /* Skip limit attributes if DPM is not enabled */ 720 + /* Skip attributes if DPM is not enabled */ 721 721 if (rdev->pm.pm_method != PM_METHOD_DPM && 722 722 (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || 723 - attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr)) 723 + attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr || 724 + attr == &sensor_dev_attr_pwm1.dev_attr.attr || 725 + attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr || 726 + attr == &sensor_dev_attr_pwm1_max.dev_attr.attr || 727 + attr == &sensor_dev_attr_pwm1_min.dev_attr.attr)) 724 728 return 0; 725 729 726 730 /* Skip fan attributes if fan is not present */ ··· 1330 1326 INIT_DELAYED_WORK(&rdev->pm.dynpm_idle_work, radeon_dynpm_idle_work_handler); 1331 1327 1332 1328 if (rdev->pm.num_power_states > 1) { 1333 - /* where's the best place to put these? */ 1334 - ret = device_create_file(rdev->dev, &dev_attr_power_profile); 1335 - if (ret) 1336 - DRM_ERROR("failed to create device file for power profile\n"); 1337 - ret = device_create_file(rdev->dev, &dev_attr_power_method); 1338 - if (ret) 1339 - DRM_ERROR("failed to create device file for power method\n"); 1340 - 1341 1329 if (radeon_debugfs_pm_init(rdev)) { 1342 1330 DRM_ERROR("Failed to register debugfs file for PM!\n"); 1343 1331 } ··· 1386 1390 if (ret) 1387 1391 goto dpm_failed; 1388 1392 rdev->pm.dpm_enabled = true; 1389 - 1390 - ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state); 1391 - if (ret) 1392 - DRM_ERROR("failed to create device file for dpm state\n"); 1393 - ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level); 1394 - if (ret) 1395 - DRM_ERROR("failed to create device file for dpm state\n"); 1396 - /* XXX: these are noops for dpm but are here for backwards compat */ 1397 - ret = device_create_file(rdev->dev, &dev_attr_power_profile); 1398 - if (ret) 1399 - DRM_ERROR("failed to create device file for power profile\n"); 1400 - ret = device_create_file(rdev->dev, &dev_attr_power_method); 1401 - if (ret) 1402 - DRM_ERROR("failed to create device file for power method\n"); 1403 1393 1404 1394 if (radeon_debugfs_pm_init(rdev)) { 1405 1395 DRM_ERROR("Failed to register debugfs file for dpm!\n"); ··· 1527 1545 int ret = 0; 1528 1546 1529 1547 if (rdev->pm.pm_method == PM_METHOD_DPM) { 1530 - mutex_lock(&rdev->pm.mutex); 1531 - ret = radeon_dpm_late_enable(rdev); 1532 - mutex_unlock(&rdev->pm.mutex); 1548 + if (rdev->pm.dpm_enabled) { 1549 + ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state); 1550 + if (ret) 1551 + DRM_ERROR("failed to create device file for dpm state\n"); 1552 + ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level); 1553 + if (ret) 1554 + DRM_ERROR("failed to create device file for dpm state\n"); 1555 + /* XXX: these are noops for dpm but are here for backwards compat */ 1556 + ret = device_create_file(rdev->dev, &dev_attr_power_profile); 1557 + if (ret) 1558 + DRM_ERROR("failed to create device file for power profile\n"); 1559 + ret = device_create_file(rdev->dev, &dev_attr_power_method); 1560 + if (ret) 1561 + DRM_ERROR("failed to create device file for power method\n"); 1562 + 1563 + mutex_lock(&rdev->pm.mutex); 1564 + ret = radeon_dpm_late_enable(rdev); 1565 + mutex_unlock(&rdev->pm.mutex); 1566 + if (ret) { 1567 + rdev->pm.dpm_enabled = false; 1568 + DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n"); 1569 + } else { 1570 + /* set the dpm state for PX since there won't be 1571 + * a modeset to call this. 1572 + */ 1573 + radeon_pm_compute_clocks(rdev); 1574 + } 1575 + } 1576 + } else { 1577 + if (rdev->pm.num_power_states > 1) { 1578 + /* where's the best place to put these? */ 1579 + ret = device_create_file(rdev->dev, &dev_attr_power_profile); 1580 + if (ret) 1581 + DRM_ERROR("failed to create device file for power profile\n"); 1582 + ret = device_create_file(rdev->dev, &dev_attr_power_method); 1583 + if (ret) 1584 + DRM_ERROR("failed to create device file for power method\n"); 1585 + } 1533 1586 } 1534 1587 return ret; 1535 1588 }
+1
drivers/gpu/drm/radeon/si_dpm.c
··· 2928 2928 { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 }, 2929 2929 { PCI_VENDOR_ID_ATI, 0x6810, 0x174b, 0xe271, 85000, 90000 }, 2930 2930 { PCI_VENDOR_ID_ATI, 0x6811, 0x1762, 0x2015, 0, 120000 }, 2931 + { PCI_VENDOR_ID_ATI, 0x6811, 0x1043, 0x2015, 0, 120000 }, 2931 2932 { 0, 0, 0, 0 }, 2932 2933 }; 2933 2934
+2 -2
drivers/gpu/drm/virtio/virtgpu_debugfs.c
··· 34 34 struct drm_info_node *node = (struct drm_info_node *) m->private; 35 35 struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; 36 36 37 - seq_printf(m, "fence %ld %lld\n", 38 - atomic64_read(&vgdev->fence_drv.last_seq), 37 + seq_printf(m, "fence %llu %lld\n", 38 + (u64)atomic64_read(&vgdev->fence_drv.last_seq), 39 39 vgdev->fence_drv.sync_seq); 40 40 return 0; 41 41 }
+1 -1
drivers/gpu/drm/virtio/virtgpu_fence.c
··· 61 61 { 62 62 struct virtio_gpu_fence *fence = to_virtio_fence(f); 63 63 64 - snprintf(str, size, "%lu", atomic64_read(&fence->drv->last_seq)); 64 + snprintf(str, size, "%llu", (u64)atomic64_read(&fence->drv->last_seq)); 65 65 } 66 66 67 67 static const struct fence_ops virtio_fence_ops = {
+2 -1
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
··· 657 657 struct vmw_resource *res = &user_srf->srf.res; 658 658 659 659 *p_base = NULL; 660 - ttm_base_object_unref(&user_srf->backup_base); 660 + if (user_srf->backup_base) 661 + ttm_base_object_unref(&user_srf->backup_base); 661 662 vmw_resource_unreference(&res); 662 663 } 663 664
+27 -6
drivers/i2c/busses/i2c-designware-platdrv.c
··· 24 24 #include <linux/kernel.h> 25 25 #include <linux/module.h> 26 26 #include <linux/delay.h> 27 + #include <linux/dmi.h> 27 28 #include <linux/i2c.h> 28 29 #include <linux/clk.h> 29 30 #include <linux/clk-provider.h> ··· 52 51 } 53 52 54 53 #ifdef CONFIG_ACPI 54 + /* 55 + * The HCNT/LCNT information coming from ACPI should be the most accurate 56 + * for given platform. However, some systems get it wrong. On such systems 57 + * we get better results by calculating those based on the input clock. 58 + */ 59 + static const struct dmi_system_id dw_i2c_no_acpi_params[] = { 60 + { 61 + .ident = "Dell Inspiron 7348", 62 + .matches = { 63 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 64 + DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"), 65 + }, 66 + }, 67 + { } 68 + }; 69 + 55 70 static void dw_i2c_acpi_params(struct platform_device *pdev, char method[], 56 71 u16 *hcnt, u16 *lcnt, u32 *sda_hold) 57 72 { 58 73 struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER }; 59 74 acpi_handle handle = ACPI_HANDLE(&pdev->dev); 60 75 union acpi_object *obj; 76 + 77 + if (dmi_check_system(dw_i2c_no_acpi_params)) 78 + return; 61 79 62 80 if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf))) 63 81 return; ··· 273 253 adap->dev.parent = &pdev->dev; 274 254 adap->dev.of_node = pdev->dev.of_node; 275 255 276 - r = i2c_add_numbered_adapter(adap); 277 - if (r) { 278 - dev_err(&pdev->dev, "failure adding adapter\n"); 279 - return r; 280 - } 281 - 282 256 if (dev->pm_runtime_disabled) { 283 257 pm_runtime_forbid(&pdev->dev); 284 258 } else { ··· 280 266 pm_runtime_use_autosuspend(&pdev->dev); 281 267 pm_runtime_set_active(&pdev->dev); 282 268 pm_runtime_enable(&pdev->dev); 269 + } 270 + 271 + r = i2c_add_numbered_adapter(adap); 272 + if (r) { 273 + dev_err(&pdev->dev, "failure adding adapter\n"); 274 + pm_runtime_disable(&pdev->dev); 275 + return r; 283 276 } 284 277 285 278 return 0;
+4 -3
drivers/i2c/busses/i2c-rcar.c
··· 690 690 return ret; 691 691 } 692 692 693 + pm_runtime_enable(dev); 694 + platform_set_drvdata(pdev, priv); 695 + 693 696 ret = i2c_add_numbered_adapter(adap); 694 697 if (ret < 0) { 695 698 dev_err(dev, "reg adap failed: %d\n", ret); 699 + pm_runtime_disable(dev); 696 700 return ret; 697 701 } 698 - 699 - pm_runtime_enable(dev); 700 - platform_set_drvdata(pdev, priv); 701 702 702 703 dev_info(dev, "probed\n"); 703 704
+5 -3
drivers/i2c/busses/i2c-s3c2410.c
··· 1243 1243 i2c->adap.nr = i2c->pdata->bus_num; 1244 1244 i2c->adap.dev.of_node = pdev->dev.of_node; 1245 1245 1246 + platform_set_drvdata(pdev, i2c); 1247 + 1248 + pm_runtime_enable(&pdev->dev); 1249 + 1246 1250 ret = i2c_add_numbered_adapter(&i2c->adap); 1247 1251 if (ret < 0) { 1248 1252 dev_err(&pdev->dev, "failed to add bus to i2c core\n"); 1253 + pm_runtime_disable(&pdev->dev); 1249 1254 s3c24xx_i2c_deregister_cpufreq(i2c); 1250 1255 clk_unprepare(i2c->clk); 1251 1256 return ret; 1252 1257 } 1253 1258 1254 - platform_set_drvdata(pdev, i2c); 1255 - 1256 - pm_runtime_enable(&pdev->dev); 1257 1259 pm_runtime_enable(&i2c->adap.dev); 1258 1260 1259 1261 dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
+6 -6
drivers/i2c/i2c-core.c
··· 694 694 goto err_clear_wakeup_irq; 695 695 696 696 status = dev_pm_domain_attach(&client->dev, true); 697 - if (status != -EPROBE_DEFER) { 698 - status = driver->probe(client, i2c_match_id(driver->id_table, 699 - client)); 700 - if (status) 701 - goto err_detach_pm_domain; 702 - } 697 + if (status == -EPROBE_DEFER) 698 + goto err_clear_wakeup_irq; 699 + 700 + status = driver->probe(client, i2c_match_id(driver->id_table, client)); 701 + if (status) 702 + goto err_detach_pm_domain; 703 703 704 704 return 0; 705 705
-6
drivers/iio/accel/st_accel_core.c
··· 149 149 #define ST_ACCEL_4_BDU_MASK 0x40 150 150 #define ST_ACCEL_4_DRDY_IRQ_ADDR 0x21 151 151 #define ST_ACCEL_4_DRDY_IRQ_INT1_MASK 0x04 152 - #define ST_ACCEL_4_IG1_EN_ADDR 0x21 153 - #define ST_ACCEL_4_IG1_EN_MASK 0x08 154 152 #define ST_ACCEL_4_MULTIREAD_BIT true 155 153 156 154 /* CUSTOM VALUES FOR SENSOR 5 */ ··· 487 489 .drdy_irq = { 488 490 .addr = ST_ACCEL_4_DRDY_IRQ_ADDR, 489 491 .mask_int1 = ST_ACCEL_4_DRDY_IRQ_INT1_MASK, 490 - .ig1 = { 491 - .en_addr = ST_ACCEL_4_IG1_EN_ADDR, 492 - .en_mask = ST_ACCEL_4_IG1_EN_MASK, 493 - }, 494 492 }, 495 493 .multi_read_bit = ST_ACCEL_4_MULTIREAD_BIT, 496 494 .bootime = 2, /* guess */
+34
drivers/iio/adc/twl4030-madc.c
··· 45 45 #include <linux/types.h> 46 46 #include <linux/gfp.h> 47 47 #include <linux/err.h> 48 + #include <linux/regulator/consumer.h> 48 49 49 50 #include <linux/iio/iio.h> 51 + 52 + #define TWL4030_USB_SEL_MADC_MCPC (1<<3) 53 + #define TWL4030_USB_CARKIT_ANA_CTRL 0xBB 50 54 51 55 /** 52 56 * struct twl4030_madc_data - a container for madc info 53 57 * @dev: Pointer to device structure for madc 54 58 * @lock: Mutex protecting this data structure 59 + * @regulator: Pointer to bias regulator for madc 55 60 * @requests: Array of request struct corresponding to SW1, SW2 and RT 56 61 * @use_second_irq: IRQ selection (main or co-processor) 57 62 * @imr: Interrupt mask register of MADC ··· 65 60 struct twl4030_madc_data { 66 61 struct device *dev; 67 62 struct mutex lock; /* mutex protecting this data structure */ 63 + struct regulator *usb3v1; 68 64 struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS]; 69 65 bool use_second_irq; 70 66 u8 imr; ··· 847 841 } 848 842 twl4030_madc = madc; 849 843 844 + /* Configure MADC[3:6] */ 845 + ret = twl_i2c_read_u8(TWL_MODULE_USB, &regval, 846 + TWL4030_USB_CARKIT_ANA_CTRL); 847 + if (ret) { 848 + dev_err(&pdev->dev, "unable to read reg CARKIT_ANA_CTRL 0x%X\n", 849 + TWL4030_USB_CARKIT_ANA_CTRL); 850 + goto err_i2c; 851 + } 852 + regval |= TWL4030_USB_SEL_MADC_MCPC; 853 + ret = twl_i2c_write_u8(TWL_MODULE_USB, regval, 854 + TWL4030_USB_CARKIT_ANA_CTRL); 855 + if (ret) { 856 + dev_err(&pdev->dev, "unable to write reg CARKIT_ANA_CTRL 0x%X\n", 857 + TWL4030_USB_CARKIT_ANA_CTRL); 858 + goto err_i2c; 859 + } 860 + 861 + /* Enable 3v1 bias regulator for MADC[3:6] */ 862 + madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1"); 863 + if (IS_ERR(madc->usb3v1)) 864 + return -ENODEV; 865 + 866 + ret = regulator_enable(madc->usb3v1); 867 + if (ret) 868 + dev_err(madc->dev, "could not enable 3v1 bias regulator\n"); 869 + 850 870 ret = iio_device_register(iio_dev); 851 871 if (ret) { 852 872 dev_err(&pdev->dev, "could not register iio device\n"); ··· 897 865 898 866 twl4030_madc_set_current_generator(madc, 0, 0); 899 867 twl4030_madc_set_power(madc, 0); 868 + 869 + regulator_disable(madc->usb3v1); 900 870 901 871 return 0; 902 872 }
+1 -1
drivers/infiniband/core/cache.c
··· 508 508 memset(&gid_attr, 0, sizeof(gid_attr)); 509 509 gid_attr.ndev = ndev; 510 510 511 + mutex_lock(&table->lock); 511 512 ix = find_gid(table, NULL, NULL, true, GID_ATTR_FIND_MASK_DEFAULT); 512 513 513 514 /* Coudn't find default GID location */ 514 515 WARN_ON(ix < 0); 515 516 516 - mutex_lock(&table->lock); 517 517 if (!__ib_cache_gid_get(ib_dev, port, ix, 518 518 &current_gid, &current_gid_attr) && 519 519 mode == IB_CACHE_GID_DEFAULT_MODE_SET &&
+9 -1
drivers/infiniband/core/cm.c
··· 835 835 case IB_CM_SIDR_REQ_RCVD: 836 836 spin_unlock_irq(&cm_id_priv->lock); 837 837 cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); 838 + spin_lock_irq(&cm.lock); 839 + if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) 840 + rb_erase(&cm_id_priv->sidr_id_node, 841 + &cm.remote_sidr_table); 842 + spin_unlock_irq(&cm.lock); 838 843 break; 839 844 case IB_CM_REQ_SENT: 840 845 case IB_CM_MRA_REQ_RCVD: ··· 3177 3172 spin_unlock_irqrestore(&cm_id_priv->lock, flags); 3178 3173 3179 3174 spin_lock_irqsave(&cm.lock, flags); 3180 - rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table); 3175 + if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) { 3176 + rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table); 3177 + RB_CLEAR_NODE(&cm_id_priv->sidr_id_node); 3178 + } 3181 3179 spin_unlock_irqrestore(&cm.lock, flags); 3182 3180 return 0; 3183 3181
+43 -17
drivers/infiniband/core/cma.c
··· 1067 1067 sizeof(req->local_gid)); 1068 1068 req->has_gid = true; 1069 1069 req->service_id = req_param->primary_path->service_id; 1070 - req->pkey = req_param->bth_pkey; 1070 + req->pkey = be16_to_cpu(req_param->primary_path->pkey); 1071 1071 break; 1072 1072 case IB_CM_SIDR_REQ_RECEIVED: 1073 1073 req->device = sidr_param->listen_id->device; 1074 1074 req->port = sidr_param->port; 1075 1075 req->has_gid = false; 1076 1076 req->service_id = sidr_param->service_id; 1077 - req->pkey = sidr_param->bth_pkey; 1077 + req->pkey = sidr_param->pkey; 1078 1078 break; 1079 1079 default: 1080 1080 return -EINVAL; ··· 1232 1232 return true; 1233 1233 } 1234 1234 1235 + static bool cma_protocol_roce_dev_port(struct ib_device *device, int port_num) 1236 + { 1237 + enum rdma_link_layer ll = rdma_port_get_link_layer(device, port_num); 1238 + enum rdma_transport_type transport = 1239 + rdma_node_get_transport(device->node_type); 1240 + 1241 + return ll == IB_LINK_LAYER_ETHERNET && transport == RDMA_TRANSPORT_IB; 1242 + } 1243 + 1244 + static bool cma_protocol_roce(const struct rdma_cm_id *id) 1245 + { 1246 + struct ib_device *device = id->device; 1247 + const int port_num = id->port_num ?: rdma_start_port(device); 1248 + 1249 + return cma_protocol_roce_dev_port(device, port_num); 1250 + } 1251 + 1235 1252 static bool cma_match_net_dev(const struct rdma_id_private *id_priv, 1236 1253 const struct net_device *net_dev) 1237 1254 { 1238 1255 const struct rdma_addr *addr = &id_priv->id.route.addr; 1239 1256 1240 1257 if (!net_dev) 1241 - /* This request is an AF_IB request */ 1242 - return addr->src_addr.ss_family == AF_IB; 1258 + /* This request is an AF_IB request or a RoCE request */ 1259 + return addr->src_addr.ss_family == AF_IB || 1260 + cma_protocol_roce(&id_priv->id); 1243 1261 1244 1262 return !addr->dev_addr.bound_dev_if || 1245 1263 (net_eq(dev_net(net_dev), &init_net) && ··· 1312 1294 if (PTR_ERR(*net_dev) == -EAFNOSUPPORT) { 1313 1295 /* Assuming the protocol is AF_IB */ 1314 1296 *net_dev = NULL; 1297 + } else if (cma_protocol_roce_dev_port(req.device, req.port)) { 1298 + /* TODO find the net dev matching the request parameters 1299 + * through the RoCE GID table */ 1300 + *net_dev = NULL; 1315 1301 } else { 1316 1302 return ERR_CAST(*net_dev); 1317 1303 } ··· 1324 1302 bind_list = cma_ps_find(rdma_ps_from_service_id(req.service_id), 1325 1303 cma_port_from_service_id(req.service_id)); 1326 1304 id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); 1327 - if (IS_ERR(id_priv)) { 1305 + if (IS_ERR(id_priv) && *net_dev) { 1328 1306 dev_put(*net_dev); 1329 1307 *net_dev = NULL; 1330 1308 } ··· 1615 1593 if (ret) 1616 1594 goto err; 1617 1595 } else { 1618 - /* An AF_IB connection */ 1619 - WARN_ON_ONCE(ss_family != AF_IB); 1620 - 1621 - cma_translate_ib((struct sockaddr_ib *)cma_src_addr(id_priv), 1622 - &rt->addr.dev_addr); 1596 + if (!cma_protocol_roce(listen_id) && 1597 + cma_any_addr(cma_src_addr(id_priv))) { 1598 + rt->addr.dev_addr.dev_type = ARPHRD_INFINIBAND; 1599 + rdma_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid); 1600 + ib_addr_set_pkey(&rt->addr.dev_addr, be16_to_cpu(rt->path_rec[0].pkey)); 1601 + } else if (!cma_any_addr(cma_src_addr(id_priv))) { 1602 + ret = cma_translate_addr(cma_src_addr(id_priv), &rt->addr.dev_addr); 1603 + if (ret) 1604 + goto err; 1605 + } 1623 1606 } 1624 1607 rdma_addr_set_dgid(&rt->addr.dev_addr, &rt->path_rec[0].dgid); 1625 1608 ··· 1662 1635 if (ret) 1663 1636 goto err; 1664 1637 } else { 1665 - /* An AF_IB connection */ 1666 - WARN_ON_ONCE(ss_family != AF_IB); 1667 - 1668 - if (!cma_any_addr(cma_src_addr(id_priv))) 1669 - cma_translate_ib((struct sockaddr_ib *) 1670 - cma_src_addr(id_priv), 1671 - &id->route.addr.dev_addr); 1638 + if (!cma_any_addr(cma_src_addr(id_priv))) { 1639 + ret = cma_translate_addr(cma_src_addr(id_priv), 1640 + &id->route.addr.dev_addr); 1641 + if (ret) 1642 + goto err; 1643 + } 1672 1644 } 1673 1645 1674 1646 id_priv->state = RDMA_CM_CONNECT;
+27 -8
drivers/infiniband/core/roce_gid_mgmt.c
··· 250 250 u8 port, struct net_device *ndev) 251 251 { 252 252 struct in_device *in_dev; 253 + struct sin_list { 254 + struct list_head list; 255 + struct sockaddr_in ip; 256 + }; 257 + struct sin_list *sin_iter; 258 + struct sin_list *sin_temp; 253 259 260 + LIST_HEAD(sin_list); 254 261 if (ndev->reg_state >= NETREG_UNREGISTERING) 255 262 return; 256 263 257 - in_dev = in_dev_get(ndev); 258 - if (!in_dev) 264 + rcu_read_lock(); 265 + in_dev = __in_dev_get_rcu(ndev); 266 + if (!in_dev) { 267 + rcu_read_unlock(); 259 268 return; 269 + } 260 270 261 271 for_ifa(in_dev) { 262 - struct sockaddr_in ip; 272 + struct sin_list *entry = kzalloc(sizeof(*entry), GFP_ATOMIC); 263 273 264 - ip.sin_family = AF_INET; 265 - ip.sin_addr.s_addr = ifa->ifa_address; 266 - update_gid_ip(GID_ADD, ib_dev, port, ndev, 267 - (struct sockaddr *)&ip); 274 + if (!entry) { 275 + pr_warn("roce_gid_mgmt: couldn't allocate entry for IPv4 update\n"); 276 + continue; 277 + } 278 + entry->ip.sin_family = AF_INET; 279 + entry->ip.sin_addr.s_addr = ifa->ifa_address; 280 + list_add_tail(&entry->list, &sin_list); 268 281 } 269 282 endfor_ifa(in_dev); 283 + rcu_read_unlock(); 270 284 271 - in_dev_put(in_dev); 285 + list_for_each_entry_safe(sin_iter, sin_temp, &sin_list, list) { 286 + update_gid_ip(GID_ADD, ib_dev, port, ndev, 287 + (struct sockaddr *)&sin_iter->ip); 288 + list_del(&sin_iter->list); 289 + kfree(sin_iter); 290 + } 272 291 } 273 292 274 293 static void enum_netdev_ipv6_ips(struct ib_device *ib_dev,
+6 -1
drivers/infiniband/core/ucma.c
··· 1624 1624 if (!file) 1625 1625 return -ENOMEM; 1626 1626 1627 + file->close_wq = create_singlethread_workqueue("ucma_close_id"); 1628 + if (!file->close_wq) { 1629 + kfree(file); 1630 + return -ENOMEM; 1631 + } 1632 + 1627 1633 INIT_LIST_HEAD(&file->event_list); 1628 1634 INIT_LIST_HEAD(&file->ctx_list); 1629 1635 init_waitqueue_head(&file->poll_wait); 1630 1636 mutex_init(&file->mut); 1631 - file->close_wq = create_singlethread_workqueue("ucma_close_id"); 1632 1637 1633 1638 filp->private_data = file; 1634 1639 file->filp = filp;
+18 -3
drivers/infiniband/hw/usnic/usnic.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_abi.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_common_pkt_hdr.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_common_util.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_debugfs.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_debugfs.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_fwd.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_fwd.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib_main.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib_sysfs.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib_sysfs.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib_verbs.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_ib_verbs.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_log.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_transport.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_transport.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+1 -1
drivers/infiniband/hw/usnic/usnic_uiom.c
··· 7 7 * licenses. You may choose to be licensed under the terms of the GNU 8 8 * General Public License (GPL) Version 2, available from the file 9 9 * COPYING in the main directory of this source tree, or the 10 - * OpenIB.org BSD license below: 10 + * BSD license below: 11 11 * 12 12 * Redistribution and use in source and binary forms, with or 13 13 * without modification, are permitted provided that the following
+18 -3
drivers/infiniband/hw/usnic/usnic_uiom.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c
··· 1 1 /* 2 2 * Copyright (c) 2014, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_vnic.c
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+18 -3
drivers/infiniband/hw/usnic/usnic_vnic.h
··· 1 1 /* 2 2 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. 3 3 * 4 - * This program is free software; you may redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; version 2 of the License. 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 7 22 * 8 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+1
drivers/infiniband/ulp/ipoib/ipoib.h
··· 495 495 void ipoib_mcast_join_task(struct work_struct *work); 496 496 void ipoib_mcast_carrier_on_task(struct work_struct *work); 497 497 void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb); 498 + void ipoib_mcast_free(struct ipoib_mcast *mc); 498 499 499 500 void ipoib_mcast_restart_task(struct work_struct *work); 500 501 int ipoib_mcast_start_thread(struct net_device *dev);
+3 -1
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 1207 1207 1208 1208 out_unlock: 1209 1209 spin_unlock_irqrestore(&priv->lock, flags); 1210 - list_for_each_entry_safe(mcast, tmcast, &remove_list, list) 1210 + list_for_each_entry_safe(mcast, tmcast, &remove_list, list) { 1211 1211 ipoib_mcast_leave(dev, mcast); 1212 + ipoib_mcast_free(mcast); 1213 + } 1212 1214 } 1213 1215 1214 1216 static void ipoib_reap_neigh(struct work_struct *work)
+1 -1
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 106 106 queue_delayed_work(priv->wq, &priv->mcast_task, 0); 107 107 } 108 108 109 - static void ipoib_mcast_free(struct ipoib_mcast *mcast) 109 + void ipoib_mcast_free(struct ipoib_mcast *mcast) 110 110 { 111 111 struct net_device *dev = mcast->dev; 112 112 int tx_dropped = 0;
+3 -7
drivers/input/mouse/cyapa_gen6.c
··· 241 241 memcpy(&cyapa->product_id[13], &resp_data[62], 2); 242 242 cyapa->product_id[15] = '\0'; 243 243 244 + /* Get the number of Rx electrodes. */ 244 245 rotat_align = resp_data[68]; 245 - if (rotat_align) { 246 - cyapa->electrodes_rx = cyapa->electrodes_y; 247 - cyapa->electrodes_rx = cyapa->electrodes_y; 248 - } else { 249 - cyapa->electrodes_rx = cyapa->electrodes_x; 250 - cyapa->electrodes_rx = cyapa->electrodes_y; 251 - } 246 + cyapa->electrodes_rx = 247 + rotat_align ? cyapa->electrodes_y : cyapa->electrodes_x; 252 248 cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u; 253 249 254 250 if (!cyapa->electrodes_x || !cyapa->electrodes_y ||
+6 -2
drivers/input/touchscreen/ads7846.c
··· 668 668 669 669 static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m) 670 670 { 671 + int value; 671 672 struct spi_transfer *t = 672 673 list_entry(m->transfers.prev, struct spi_transfer, transfer_list); 673 674 674 675 if (ts->model == 7845) { 675 - return be16_to_cpup((__be16 *)&(((char*)t->rx_buf)[1])) >> 3; 676 + value = be16_to_cpup((__be16 *)&(((char *)t->rx_buf)[1])); 676 677 } else { 677 678 /* 678 679 * adjust: on-wire is a must-ignore bit, a BE12 value, then 679 680 * padding; built from two 8 bit values written msb-first. 680 681 */ 681 - return be16_to_cpup((__be16 *)t->rx_buf) >> 3; 682 + value = be16_to_cpup((__be16 *)t->rx_buf); 682 683 } 684 + 685 + /* enforce ADC output is 12 bits width */ 686 + return (value >> 3) & 0xfff; 683 687 } 684 688 685 689 static void ads7846_update_value(struct spi_message *m, int val)
+1 -2
drivers/iommu/Kconfig
··· 23 23 config IOMMU_IO_PGTABLE_LPAE 24 24 bool "ARMv7/v8 Long Descriptor Format" 25 25 select IOMMU_IO_PGTABLE 26 - # SWIOTLB guarantees a dma_to_phys() implementation 27 - depends on ARM || ARM64 || (COMPILE_TEST && SWIOTLB) 26 + depends on HAS_DMA && (ARM || ARM64 || COMPILE_TEST) 28 27 help 29 28 Enable support for the ARM long descriptor pagetable format. 30 29 This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
+9
drivers/iommu/amd_iommu.c
··· 2006 2006 { 2007 2007 struct amd_iommu *iommu; 2008 2008 2009 + /* 2010 + * First check if the device is still attached. It might already 2011 + * be detached from its domain because the generic 2012 + * iommu_detach_group code detached it and we try again here in 2013 + * our alias handling. 2014 + */ 2015 + if (!dev_data->domain) 2016 + return; 2017 + 2009 2018 iommu = amd_iommu_rlookup_table[dev_data->devid]; 2010 2019 2011 2020 /* decrease reference counters */
+3
drivers/iommu/amd_iommu_init.c
··· 1256 1256 if (!iommu->dev) 1257 1257 return -ENODEV; 1258 1258 1259 + /* Prevent binding other PCI device drivers to IOMMU devices */ 1260 + iommu->dev->match_driver = false; 1261 + 1259 1262 pci_read_config_dword(iommu->dev, cap_ptr + MMIO_CAP_HDR_OFFSET, 1260 1263 &iommu->cap); 1261 1264 pci_read_config_dword(iommu->dev, cap_ptr + MMIO_RANGE_OFFSET,
+15 -6
drivers/iommu/arm-smmu-v3.c
··· 56 56 #define IDR0_TTF_SHIFT 2 57 57 #define IDR0_TTF_MASK 0x3 58 58 #define IDR0_TTF_AARCH64 (2 << IDR0_TTF_SHIFT) 59 + #define IDR0_TTF_AARCH32_64 (3 << IDR0_TTF_SHIFT) 59 60 #define IDR0_S1P (1 << 1) 60 61 #define IDR0_S2P (1 << 0) 61 62 ··· 343 342 #define CMDQ_TLBI_0_VMID_SHIFT 32 344 343 #define CMDQ_TLBI_0_ASID_SHIFT 48 345 344 #define CMDQ_TLBI_1_LEAF (1UL << 0) 346 - #define CMDQ_TLBI_1_ADDR_MASK ~0xfffUL 345 + #define CMDQ_TLBI_1_VA_MASK ~0xfffUL 346 + #define CMDQ_TLBI_1_IPA_MASK 0xfffffffff000UL 347 347 348 348 #define CMDQ_PRI_0_SSID_SHIFT 12 349 349 #define CMDQ_PRI_0_SSID_MASK 0xfffffUL ··· 772 770 break; 773 771 case CMDQ_OP_TLBI_NH_VA: 774 772 cmd[0] |= (u64)ent->tlbi.asid << CMDQ_TLBI_0_ASID_SHIFT; 775 - /* Fallthrough */ 773 + cmd[1] |= ent->tlbi.leaf ? CMDQ_TLBI_1_LEAF : 0; 774 + cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_VA_MASK; 775 + break; 776 776 case CMDQ_OP_TLBI_S2_IPA: 777 777 cmd[0] |= (u64)ent->tlbi.vmid << CMDQ_TLBI_0_VMID_SHIFT; 778 778 cmd[1] |= ent->tlbi.leaf ? CMDQ_TLBI_1_LEAF : 0; 779 - cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_ADDR_MASK; 779 + cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_IPA_MASK; 780 780 break; 781 781 case CMDQ_OP_TLBI_NH_ASID: 782 782 cmd[0] |= (u64)ent->tlbi.asid << CMDQ_TLBI_0_ASID_SHIFT; ··· 2464 2460 } 2465 2461 2466 2462 /* We only support the AArch64 table format at present */ 2467 - if ((reg & IDR0_TTF_MASK << IDR0_TTF_SHIFT) < IDR0_TTF_AARCH64) { 2463 + switch (reg & IDR0_TTF_MASK << IDR0_TTF_SHIFT) { 2464 + case IDR0_TTF_AARCH32_64: 2465 + smmu->ias = 40; 2466 + /* Fallthrough */ 2467 + case IDR0_TTF_AARCH64: 2468 + break; 2469 + default: 2468 2470 dev_err(smmu->dev, "AArch64 table format not supported!\n"); 2469 2471 return -ENXIO; 2470 2472 } ··· 2551 2541 dev_warn(smmu->dev, 2552 2542 "failed to set DMA mask for table walker\n"); 2553 2543 2554 - if (!smmu->ias) 2555 - smmu->ias = smmu->oas; 2544 + smmu->ias = max(smmu->ias, smmu->oas); 2556 2545 2557 2546 dev_info(smmu->dev, "ias %lu-bit, oas %lu-bit (features 0x%08x)\n", 2558 2547 smmu->ias, smmu->oas, smmu->features);
+9 -4
drivers/iommu/intel-iommu.c
··· 2115 2115 return -ENOMEM; 2116 2116 /* It is large page*/ 2117 2117 if (largepage_lvl > 1) { 2118 + unsigned long nr_superpages, end_pfn; 2119 + 2118 2120 pteval |= DMA_PTE_LARGE_PAGE; 2119 2121 lvl_pages = lvl_to_nr_pages(largepage_lvl); 2122 + 2123 + nr_superpages = sg_res / lvl_pages; 2124 + end_pfn = iov_pfn + nr_superpages * lvl_pages - 1; 2125 + 2120 2126 /* 2121 2127 * Ensure that old small page tables are 2122 - * removed to make room for superpage, 2123 - * if they exist. 2128 + * removed to make room for superpage(s). 2124 2129 */ 2125 - dma_pte_free_pagetable(domain, iov_pfn, 2126 - iov_pfn + lvl_pages - 1); 2130 + dma_pte_free_pagetable(domain, iov_pfn, end_pfn); 2127 2131 } else { 2128 2132 pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE; 2129 2133 } ··· 2305 2301 2306 2302 if (ret) { 2307 2303 spin_unlock_irqrestore(&device_domain_lock, flags); 2304 + free_devinfo_mem(info); 2308 2305 return NULL; 2309 2306 } 2310 2307
+13 -11
drivers/iommu/io-pgtable-arm.c
··· 202 202 203 203 static bool selftest_running = false; 204 204 205 - static dma_addr_t __arm_lpae_dma_addr(struct device *dev, void *pages) 205 + static dma_addr_t __arm_lpae_dma_addr(void *pages) 206 206 { 207 - return phys_to_dma(dev, virt_to_phys(pages)); 207 + return (dma_addr_t)virt_to_phys(pages); 208 208 } 209 209 210 210 static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp, ··· 223 223 goto out_free; 224 224 /* 225 225 * We depend on the IOMMU being able to work with any physical 226 - * address directly, so if the DMA layer suggests it can't by 227 - * giving us back some translation, that bodes very badly... 226 + * address directly, so if the DMA layer suggests otherwise by 227 + * translating or truncating them, that bodes very badly... 228 228 */ 229 - if (dma != __arm_lpae_dma_addr(dev, pages)) 229 + if (dma != virt_to_phys(pages)) 230 230 goto out_unmap; 231 231 } 232 232 ··· 243 243 static void __arm_lpae_free_pages(void *pages, size_t size, 244 244 struct io_pgtable_cfg *cfg) 245 245 { 246 - struct device *dev = cfg->iommu_dev; 247 - 248 246 if (!selftest_running) 249 - dma_unmap_single(dev, __arm_lpae_dma_addr(dev, pages), 247 + dma_unmap_single(cfg->iommu_dev, __arm_lpae_dma_addr(pages), 250 248 size, DMA_TO_DEVICE); 251 249 free_pages_exact(pages, size); 252 250 } ··· 252 254 static void __arm_lpae_set_pte(arm_lpae_iopte *ptep, arm_lpae_iopte pte, 253 255 struct io_pgtable_cfg *cfg) 254 256 { 255 - struct device *dev = cfg->iommu_dev; 256 - 257 257 *ptep = pte; 258 258 259 259 if (!selftest_running) 260 - dma_sync_single_for_device(dev, __arm_lpae_dma_addr(dev, ptep), 260 + dma_sync_single_for_device(cfg->iommu_dev, 261 + __arm_lpae_dma_addr(ptep), 261 262 sizeof(pte), DMA_TO_DEVICE); 262 263 } 263 264 ··· 625 628 626 629 if (cfg->oas > ARM_LPAE_MAX_ADDR_BITS) 627 630 return NULL; 631 + 632 + if (!selftest_running && cfg->iommu_dev->dma_pfn_offset) { 633 + dev_err(cfg->iommu_dev, "Cannot accommodate DMA offset for IOMMU page tables\n"); 634 + return NULL; 635 + } 628 636 629 637 data = kmalloc(sizeof(*data), GFP_KERNEL); 630 638 if (!data)
+1 -1
drivers/md/dm-cache-metadata.c
··· 634 634 635 635 disk_super = dm_block_data(sblock); 636 636 637 + disk_super->flags = cpu_to_le32(cmd->flags); 637 638 if (mutator) 638 639 update_flags(disk_super, mutator); 639 640 640 - disk_super->flags = cpu_to_le32(cmd->flags); 641 641 disk_super->mapping_root = cpu_to_le64(cmd->root); 642 642 disk_super->hint_root = cpu_to_le64(cmd->hint_root); 643 643 disk_super->discard_root = cpu_to_le64(cmd->discard_root);
+12 -3
drivers/md/dm-snap-persistent.c
··· 847 847 static int persistent_ctr(struct dm_exception_store *store, char *options) 848 848 { 849 849 struct pstore *ps; 850 + int r; 850 851 851 852 /* allocate the pstore */ 852 853 ps = kzalloc(sizeof(*ps), GFP_KERNEL); ··· 869 868 870 869 ps->metadata_wq = alloc_workqueue("ksnaphd", WQ_MEM_RECLAIM, 0); 871 870 if (!ps->metadata_wq) { 872 - kfree(ps); 873 871 DMERR("couldn't start header metadata update thread"); 874 - return -ENOMEM; 872 + r = -ENOMEM; 873 + goto err_workqueue; 875 874 } 876 875 877 876 if (options) { ··· 880 879 store->userspace_supports_overflow = true; 881 880 else { 882 881 DMERR("Unsupported persistent store option: %s", options); 883 - return -EINVAL; 882 + r = -EINVAL; 883 + goto err_options; 884 884 } 885 885 } 886 886 887 887 store->context = ps; 888 888 889 889 return 0; 890 + 891 + err_options: 892 + destroy_workqueue(ps->metadata_wq); 893 + err_workqueue: 894 + kfree(ps); 895 + 896 + return r; 890 897 } 891 898 892 899 static unsigned persistent_status(struct dm_exception_store *store,
+1 -1
drivers/md/dm-thin.c
··· 3201 3201 metadata_low_callback, 3202 3202 pool); 3203 3203 if (r) 3204 - goto out_free_pt; 3204 + goto out_flags_changed; 3205 3205 3206 3206 pt->callbacks.congested_fn = pool_is_congested; 3207 3207 dm_table_add_target_callbacks(ti->table, &pt->callbacks);
+11 -6
drivers/md/persistent-data/dm-btree-remove.c
··· 301 301 { 302 302 int s; 303 303 uint32_t max_entries = le32_to_cpu(left->header.max_entries); 304 - unsigned target = (nr_left + nr_center + nr_right) / 3; 305 - BUG_ON(target > max_entries); 304 + unsigned total = nr_left + nr_center + nr_right; 305 + unsigned target_right = total / 3; 306 + unsigned remainder = (target_right * 3) != total; 307 + unsigned target_left = target_right + remainder; 308 + 309 + BUG_ON(target_left > max_entries); 310 + BUG_ON(target_right > max_entries); 306 311 307 312 if (nr_left < nr_right) { 308 - s = nr_left - target; 313 + s = nr_left - target_left; 309 314 310 315 if (s < 0 && nr_center < -s) { 311 316 /* not enough in central node */ ··· 321 316 } else 322 317 shift(left, center, s); 323 318 324 - shift(center, right, target - nr_right); 319 + shift(center, right, target_right - nr_right); 325 320 326 321 } else { 327 - s = target - nr_right; 322 + s = target_right - nr_right; 328 323 if (s > 0 && nr_center < s) { 329 324 /* not enough in central node */ 330 325 shift(center, right, nr_center); ··· 334 329 } else 335 330 shift(center, right, s); 336 331 337 - shift(left, center, nr_left - target); 332 + shift(left, center, nr_left - target_left); 338 333 } 339 334 340 335 *key_ptr(parent, c->index) = center->keys[0];
+1 -1
drivers/md/persistent-data/dm-btree.c
··· 523 523 524 524 r = new_block(s->info, &right); 525 525 if (r < 0) { 526 - /* FIXME: put left */ 526 + unlock_block(s->info, left); 527 527 return r; 528 528 } 529 529
+2 -2
drivers/media/dvb-frontends/horus3a.h
··· 46 46 const struct horus3a_config *config, 47 47 struct i2c_adapter *i2c); 48 48 #else 49 - static inline struct dvb_frontend *horus3a_attach( 50 - const struct cxd2820r_config *config, 49 + static inline struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe, 50 + const struct horus3a_config *config, 51 51 struct i2c_adapter *i2c) 52 52 { 53 53 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
+1 -1
drivers/media/dvb-frontends/lnbh25.h
··· 43 43 struct lnbh25_config *cfg, 44 44 struct i2c_adapter *i2c); 45 45 #else 46 - static inline dvb_frontend *lnbh25_attach( 46 + static inline struct dvb_frontend *lnbh25_attach( 47 47 struct dvb_frontend *fe, 48 48 struct lnbh25_config *cfg, 49 49 struct i2c_adapter *i2c)
+47 -26
drivers/media/dvb-frontends/m88ds3103.c
··· 18 18 19 19 static struct dvb_frontend_ops m88ds3103_ops; 20 20 21 + /* write single register with mask */ 22 + static int m88ds3103_update_bits(struct m88ds3103_dev *dev, 23 + u8 reg, u8 mask, u8 val) 24 + { 25 + int ret; 26 + u8 tmp; 27 + 28 + /* no need for read if whole reg is written */ 29 + if (mask != 0xff) { 30 + ret = regmap_bulk_read(dev->regmap, reg, &tmp, 1); 31 + if (ret) 32 + return ret; 33 + 34 + val &= mask; 35 + tmp &= ~mask; 36 + val |= tmp; 37 + } 38 + 39 + return regmap_bulk_write(dev->regmap, reg, &val, 1); 40 + } 41 + 21 42 /* write reg val table using reg addr auto increment */ 22 43 static int m88ds3103_wr_reg_val_tab(struct m88ds3103_dev *dev, 23 44 const struct m88ds3103_reg_val *tab, int tab_len) ··· 415 394 u8tmp2 = 0x00; /* 0b00 */ 416 395 break; 417 396 } 418 - ret = regmap_update_bits(dev->regmap, 0x22, 0xc0, u8tmp1 << 6); 397 + ret = m88ds3103_update_bits(dev, 0x22, 0xc0, u8tmp1 << 6); 419 398 if (ret) 420 399 goto err; 421 - ret = regmap_update_bits(dev->regmap, 0x24, 0xc0, u8tmp2 << 6); 400 + ret = m88ds3103_update_bits(dev, 0x24, 0xc0, u8tmp2 << 6); 422 401 if (ret) 423 402 goto err; 424 403 } ··· 476 455 if (ret) 477 456 goto err; 478 457 } 479 - ret = regmap_update_bits(dev->regmap, 0x9d, 0x08, 0x08); 458 + ret = m88ds3103_update_bits(dev, 0x9d, 0x08, 0x08); 480 459 if (ret) 481 460 goto err; 482 461 ret = regmap_write(dev->regmap, 0xf1, 0x01); 483 462 if (ret) 484 463 goto err; 485 - ret = regmap_update_bits(dev->regmap, 0x30, 0x80, 0x80); 464 + ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80); 486 465 if (ret) 487 466 goto err; 488 467 } ··· 519 498 switch (dev->cfg->ts_mode) { 520 499 case M88DS3103_TS_SERIAL: 521 500 case M88DS3103_TS_SERIAL_D7: 522 - ret = regmap_update_bits(dev->regmap, 0x29, 0x20, u8tmp1); 501 + ret = m88ds3103_update_bits(dev, 0x29, 0x20, u8tmp1); 523 502 if (ret) 524 503 goto err; 525 504 u8tmp1 = 0; ··· 588 567 if (ret) 589 568 goto err; 590 569 591 - ret = regmap_update_bits(dev->regmap, 0x4d, 0x02, dev->cfg->spec_inv << 1); 570 + ret = m88ds3103_update_bits(dev, 0x4d, 0x02, dev->cfg->spec_inv << 1); 592 571 if (ret) 593 572 goto err; 594 573 595 - ret = regmap_update_bits(dev->regmap, 0x30, 0x10, dev->cfg->agc_inv << 4); 574 + ret = m88ds3103_update_bits(dev, 0x30, 0x10, dev->cfg->agc_inv << 4); 596 575 if (ret) 597 576 goto err; 598 577 ··· 646 625 dev->warm = false; 647 626 648 627 /* wake up device from sleep */ 649 - ret = regmap_update_bits(dev->regmap, 0x08, 0x01, 0x01); 628 + ret = m88ds3103_update_bits(dev, 0x08, 0x01, 0x01); 650 629 if (ret) 651 630 goto err; 652 - ret = regmap_update_bits(dev->regmap, 0x04, 0x01, 0x00); 631 + ret = m88ds3103_update_bits(dev, 0x04, 0x01, 0x00); 653 632 if (ret) 654 633 goto err; 655 - ret = regmap_update_bits(dev->regmap, 0x23, 0x10, 0x00); 634 + ret = m88ds3103_update_bits(dev, 0x23, 0x10, 0x00); 656 635 if (ret) 657 636 goto err; 658 637 ··· 770 749 utmp = 0x29; 771 750 else 772 751 utmp = 0x27; 773 - ret = regmap_update_bits(dev->regmap, utmp, 0x01, 0x00); 752 + ret = m88ds3103_update_bits(dev, utmp, 0x01, 0x00); 774 753 if (ret) 775 754 goto err; 776 755 777 756 /* sleep */ 778 - ret = regmap_update_bits(dev->regmap, 0x08, 0x01, 0x00); 757 + ret = m88ds3103_update_bits(dev, 0x08, 0x01, 0x00); 779 758 if (ret) 780 759 goto err; 781 - ret = regmap_update_bits(dev->regmap, 0x04, 0x01, 0x01); 760 + ret = m88ds3103_update_bits(dev, 0x04, 0x01, 0x01); 782 761 if (ret) 783 762 goto err; 784 - ret = regmap_update_bits(dev->regmap, 0x23, 0x10, 0x10); 763 + ret = m88ds3103_update_bits(dev, 0x23, 0x10, 0x10); 785 764 if (ret) 786 765 goto err; 787 766 ··· 1013 992 } 1014 993 1015 994 utmp = tone << 7 | dev->cfg->envelope_mode << 5; 1016 - ret = regmap_update_bits(dev->regmap, 0xa2, 0xe0, utmp); 995 + ret = m88ds3103_update_bits(dev, 0xa2, 0xe0, utmp); 1017 996 if (ret) 1018 997 goto err; 1019 998 1020 999 utmp = 1 << 2; 1021 - ret = regmap_update_bits(dev->regmap, 0xa1, reg_a1_mask, utmp); 1000 + ret = m88ds3103_update_bits(dev, 0xa1, reg_a1_mask, utmp); 1022 1001 if (ret) 1023 1002 goto err; 1024 1003 ··· 1068 1047 voltage_dis ^= dev->cfg->lnb_en_pol; 1069 1048 1070 1049 utmp = voltage_dis << 1 | voltage_sel << 0; 1071 - ret = regmap_update_bits(dev->regmap, 0xa2, 0x03, utmp); 1050 + ret = m88ds3103_update_bits(dev, 0xa2, 0x03, utmp); 1072 1051 if (ret) 1073 1052 goto err; 1074 1053 ··· 1101 1080 } 1102 1081 1103 1082 utmp = dev->cfg->envelope_mode << 5; 1104 - ret = regmap_update_bits(dev->regmap, 0xa2, 0xe0, utmp); 1083 + ret = m88ds3103_update_bits(dev, 0xa2, 0xe0, utmp); 1105 1084 if (ret) 1106 1085 goto err; 1107 1086 ··· 1136 1115 } else { 1137 1116 dev_dbg(&client->dev, "diseqc tx timeout\n"); 1138 1117 1139 - ret = regmap_update_bits(dev->regmap, 0xa1, 0xc0, 0x40); 1118 + ret = m88ds3103_update_bits(dev, 0xa1, 0xc0, 0x40); 1140 1119 if (ret) 1141 1120 goto err; 1142 1121 } 1143 1122 1144 - ret = regmap_update_bits(dev->regmap, 0xa2, 0xc0, 0x80); 1123 + ret = m88ds3103_update_bits(dev, 0xa2, 0xc0, 0x80); 1145 1124 if (ret) 1146 1125 goto err; 1147 1126 ··· 1173 1152 } 1174 1153 1175 1154 utmp = dev->cfg->envelope_mode << 5; 1176 - ret = regmap_update_bits(dev->regmap, 0xa2, 0xe0, utmp); 1155 + ret = m88ds3103_update_bits(dev, 0xa2, 0xe0, utmp); 1177 1156 if (ret) 1178 1157 goto err; 1179 1158 ··· 1215 1194 } else { 1216 1195 dev_dbg(&client->dev, "diseqc tx timeout\n"); 1217 1196 1218 - ret = regmap_update_bits(dev->regmap, 0xa1, 0xc0, 0x40); 1197 + ret = m88ds3103_update_bits(dev, 0xa1, 0xc0, 0x40); 1219 1198 if (ret) 1220 1199 goto err; 1221 1200 } 1222 1201 1223 - ret = regmap_update_bits(dev->regmap, 0xa2, 0xc0, 0x80); 1202 + ret = m88ds3103_update_bits(dev, 0xa2, 0xc0, 0x80); 1224 1203 if (ret) 1225 1204 goto err; 1226 1205 ··· 1456 1435 goto err_kfree; 1457 1436 1458 1437 /* sleep */ 1459 - ret = regmap_update_bits(dev->regmap, 0x08, 0x01, 0x00); 1438 + ret = m88ds3103_update_bits(dev, 0x08, 0x01, 0x00); 1460 1439 if (ret) 1461 1440 goto err_kfree; 1462 - ret = regmap_update_bits(dev->regmap, 0x04, 0x01, 0x01); 1441 + ret = m88ds3103_update_bits(dev, 0x04, 0x01, 0x01); 1463 1442 if (ret) 1464 1443 goto err_kfree; 1465 - ret = regmap_update_bits(dev->regmap, 0x23, 0x10, 0x10); 1444 + ret = m88ds3103_update_bits(dev, 0x23, 0x10, 0x10); 1466 1445 if (ret) 1467 1446 goto err_kfree; 1468 1447
+4
drivers/media/dvb-frontends/si2168.c
··· 502 502 /* firmware is in the new format */ 503 503 for (remaining = fw->size; remaining > 0; remaining -= 17) { 504 504 len = fw->data[fw->size - remaining]; 505 + if (len > SI2168_ARGLEN) { 506 + ret = -EINVAL; 507 + break; 508 + } 505 509 memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len); 506 510 cmd.wlen = len; 507 511 cmd.rlen = 1;
+4 -8
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c
··· 80 80 u16 reg; 81 81 unsigned long flags; 82 82 83 - if (!spi) { 84 - dev_dbg(&spi->master->dev, 85 - "%s(): SPI not initialized\n", __func__); 83 + if (!spi) 86 84 return IRQ_NONE; 87 - } 85 + 88 86 spin_lock_irqsave(&spi->lock, flags); 89 87 reg = readw(&spi->regs->control_stat); 90 88 if (!(reg & NETUP_SPI_CTRL_IRQ)) { ··· 232 234 unsigned long flags; 233 235 struct netup_spi *spi = ndev->spi; 234 236 235 - if (!spi) { 236 - dev_dbg(&spi->master->dev, 237 - "%s(): SPI not initialized\n", __func__); 237 + if (!spi) 238 238 return; 239 - } 239 + 240 240 spin_lock_irqsave(&spi->lock, flags); 241 241 reg = readw(&spi->regs->control_stat); 242 242 writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat);
+3 -4
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
··· 1097 1097 Elf32_Ehdr *ehdr; 1098 1098 Elf32_Phdr *phdr; 1099 1099 u8 __iomem *dst; 1100 - int err, i; 1100 + int err = 0, i; 1101 1101 1102 1102 if (!fw || !context) 1103 1103 return -EINVAL; ··· 1106 1106 phdr = (Elf32_Phdr *)(fw->data + ehdr->e_phoff); 1107 1107 1108 1108 /* go through the available ELF segments */ 1109 - for (i = 0; i < ehdr->e_phnum && !err; i++, phdr++) { 1109 + for (i = 0; i < ehdr->e_phnum; i++, phdr++) { 1110 1110 1111 1111 /* Only consider LOAD segments */ 1112 1112 if (phdr->p_type != PT_LOAD) ··· 1192 1192 1193 1193 static int load_c8sectpfe_fw_step1(struct c8sectpfei *fei) 1194 1194 { 1195 - int ret; 1196 1195 int err; 1197 1196 1198 1197 dev_info(fei->dev, "Loading firmware: %s\n", FIRMWARE_MEMDMA); ··· 1206 1207 if (err) { 1207 1208 dev_err(fei->dev, "request_firmware_nowait err: %d.\n", err); 1208 1209 complete_all(&fei->fw_ack); 1209 - return ret; 1210 + return err; 1210 1211 } 1211 1212 1212 1213 return 0;
+1 -1
drivers/media/rc/ir-hix5hd2.c
··· 257 257 goto clkerr; 258 258 259 259 if (devm_request_irq(dev, priv->irq, hix5hd2_ir_rx_interrupt, 260 - IRQF_NO_SUSPEND, pdev->name, priv) < 0) { 260 + 0, pdev->name, priv) < 0) { 261 261 dev_err(dev, "IRQ %d register failed\n", priv->irq); 262 262 ret = -EINVAL; 263 263 goto regerr;
+4
drivers/media/tuners/si2157.c
··· 166 166 167 167 for (remaining = fw->size; remaining > 0; remaining -= 17) { 168 168 len = fw->data[fw->size - remaining]; 169 + if (len > SI2157_ARGLEN) { 170 + dev_err(&client->dev, "Bad firmware length\n"); 171 + goto err_release_firmware; 172 + } 169 173 memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len); 170 174 cmd.wlen = len; 171 175 cmd.rlen = 1;
+13 -2
drivers/media/usb/dvb-usb-v2/rtl28xxu.c
··· 34 34 unsigned int pipe; 35 35 u8 requesttype; 36 36 37 + mutex_lock(&d->usb_mutex); 38 + 39 + if (req->size > sizeof(dev->buf)) { 40 + dev_err(&d->intf->dev, "too large message %u\n", req->size); 41 + ret = -EINVAL; 42 + goto err_mutex_unlock; 43 + } 44 + 37 45 if (req->index & CMD_WR_FLAG) { 38 46 /* write */ 39 47 memcpy(dev->buf, req->data, req->size); ··· 58 50 dvb_usb_dbg_usb_control_msg(d->udev, 0, requesttype, req->value, 59 51 req->index, dev->buf, req->size); 60 52 if (ret < 0) 61 - goto err; 53 + goto err_mutex_unlock; 62 54 63 55 /* read request, copy returned data to return buf */ 64 56 if (requesttype == (USB_TYPE_VENDOR | USB_DIR_IN)) 65 57 memcpy(req->data, dev->buf, req->size); 66 58 59 + mutex_unlock(&d->usb_mutex); 60 + 67 61 return 0; 68 - err: 62 + err_mutex_unlock: 63 + mutex_unlock(&d->usb_mutex); 69 64 dev_dbg(&d->intf->dev, "failed=%d\n", ret); 70 65 return ret; 71 66 }
+1 -1
drivers/media/usb/dvb-usb-v2/rtl28xxu.h
··· 71 71 72 72 73 73 struct rtl28xxu_dev { 74 - u8 buf[28]; 74 + u8 buf[128]; 75 75 u8 chip_id; 76 76 u8 tuner; 77 77 char *tuner_name;
+1 -1
drivers/media/v4l2-core/Kconfig
··· 47 47 # Used by LED subsystem flash drivers 48 48 config V4L2_FLASH_LED_CLASS 49 49 tristate "V4L2 flash API for LED flash class devices" 50 - depends on VIDEO_V4L2_SUBDEV_API 50 + depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API 51 51 depends on LEDS_CLASS_FLASH 52 52 ---help--- 53 53 Say Y here to enable V4L2 flash API support for LED flash
+9 -3
drivers/memory/Kconfig
··· 58 58 memory drives like NOR, NAND, OneNAND, SRAM. 59 59 60 60 config OMAP_GPMC_DEBUG 61 - bool 61 + bool "Enable GPMC debug output and skip reset of GPMC during init" 62 62 depends on OMAP_GPMC 63 63 help 64 64 Enables verbose debugging mostly to decode the bootloader provided 65 - timings. Enable this during development to configure devices 66 - connected to the GPMC bus. 65 + timings. To preserve the bootloader provided timings, the reset 66 + of GPMC is skipped during init. Enable this during development to 67 + configure devices connected to the GPMC bus. 68 + 69 + NOTE: In addition to matching the register setup with the bootloader 70 + you also need to match the GPMC FCLK frequency used by the 71 + bootloader or else the GPMC timings won't be identical with the 72 + bootloader timings. 67 73 68 74 config MVEBU_DEVBUS 69 75 bool "Marvell EBU Device Bus Controller"
+1 -1
drivers/memory/omap-gpmc.c
··· 696 696 int div; 697 697 u32 l; 698 698 699 - gpmc_cs_show_timings(cs, "before gpmc_cs_set_timings"); 700 699 div = gpmc_calc_divider(t->sync_clk); 701 700 if (div < 0) 702 701 return div; ··· 1987 1988 if (ret < 0) 1988 1989 goto err; 1989 1990 1991 + gpmc_cs_show_timings(cs, "before gpmc_cs_program_settings"); 1990 1992 ret = gpmc_cs_program_settings(cs, &gpmc_s); 1991 1993 if (ret < 0) 1992 1994 goto err;
+2
drivers/mfd/intel-lpss.h
··· 42 42 .thaw = intel_lpss_resume, \ 43 43 .poweroff = intel_lpss_suspend, \ 44 44 .restore = intel_lpss_resume, 45 + #else 46 + #define INTEL_LPSS_SLEEP_PM_OPS 45 47 #endif 46 48 47 49 #define INTEL_LPSS_RUNTIME_PM_OPS \
+1 -1
drivers/mfd/max77843.c
··· 80 80 if (!max77843->i2c_chg) { 81 81 dev_err(&max77843->i2c->dev, 82 82 "Cannot allocate I2C device for Charger\n"); 83 - return PTR_ERR(max77843->i2c_chg); 83 + return -ENODEV; 84 84 } 85 85 i2c_set_clientdata(max77843->i2c_chg, max77843); 86 86
+1
drivers/misc/cxl/api.c
··· 105 105 106 106 void cxl_free_afu_irqs(struct cxl_context *ctx) 107 107 { 108 + afu_irq_name_free(ctx); 108 109 cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter); 109 110 } 110 111 EXPORT_SYMBOL_GPL(cxl_free_afu_irqs);
+3
drivers/misc/cxl/context.c
··· 275 275 if (ctx->kernelapi) 276 276 kfree(ctx->mapping); 277 277 278 + if (ctx->irq_bitmap) 279 + kfree(ctx->irq_bitmap); 280 + 278 281 kfree(ctx); 279 282 } 280 283
+1
drivers/misc/cxl/cxl.h
··· 677 677 void cxl_release_serr_irq(struct cxl_afu *afu); 678 678 int afu_register_irqs(struct cxl_context *ctx, u32 count); 679 679 void afu_release_irqs(struct cxl_context *ctx, void *cookie); 680 + void afu_irq_name_free(struct cxl_context *ctx); 680 681 irqreturn_t cxl_slice_irq_err(int irq, void *data); 681 682 682 683 int cxl_debugfs_init(void);
+10 -3
drivers/misc/cxl/file.c
··· 120 120 __func__, ctx->pe); 121 121 cxl_context_detach(ctx); 122 122 123 - mutex_lock(&ctx->mapping_lock); 124 - ctx->mapping = NULL; 125 - mutex_unlock(&ctx->mapping_lock); 123 + 124 + /* 125 + * Delete the context's mapping pointer, unless it's created by the 126 + * kernel API, in which case leave it so it can be freed by reclaim_ctx() 127 + */ 128 + if (!ctx->kernelapi) { 129 + mutex_lock(&ctx->mapping_lock); 130 + ctx->mapping = NULL; 131 + mutex_unlock(&ctx->mapping_lock); 132 + } 126 133 127 134 put_device(&ctx->afu->dev); 128 135
+1 -3
drivers/misc/cxl/irq.c
··· 414 414 kfree(afu->psl_irq_name); 415 415 } 416 416 417 - static void afu_irq_name_free(struct cxl_context *ctx) 417 + void afu_irq_name_free(struct cxl_context *ctx) 418 418 { 419 419 struct cxl_irq_name *irq_name, *tmp; 420 420 ··· 524 524 afu_irq_name_free(ctx); 525 525 cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter); 526 526 527 - kfree(ctx->irq_bitmap); 528 - ctx->irq_bitmap = NULL; 529 527 ctx->irq_count = 0; 530 528 }
+1 -1
drivers/misc/cxl/native.c
··· 457 457 458 458 dev_info(&afu->dev, "Activating AFU directed mode\n"); 459 459 460 + afu->num_procs = afu->max_procs_virtualised; 460 461 if (afu->spa == NULL) { 461 462 if (cxl_alloc_spa(afu)) 462 463 return -ENOMEM; ··· 469 468 cxl_p1n_write(afu, CXL_PSL_ID_An, CXL_PSL_ID_An_F | CXL_PSL_ID_An_L); 470 469 471 470 afu->current_mode = CXL_MODE_DIRECTED; 472 - afu->num_procs = afu->max_procs_virtualised; 473 471 474 472 if ((rc = cxl_chardev_m_afu_add(afu))) 475 473 return rc;
+28
drivers/misc/cxl/pci.c
··· 1035 1035 return 0; 1036 1036 } 1037 1037 1038 + /* 1039 + * Workaround a PCIe Host Bridge defect on some cards, that can cause 1040 + * malformed Transaction Layer Packet (TLP) errors to be erroneously 1041 + * reported. Mask this error in the Uncorrectable Error Mask Register. 1042 + * 1043 + * The upper nibble of the PSL revision is used to distinguish between 1044 + * different cards. The affected ones have it set to 0. 1045 + */ 1046 + static void cxl_fixup_malformed_tlp(struct cxl *adapter, struct pci_dev *dev) 1047 + { 1048 + int aer; 1049 + u32 data; 1050 + 1051 + if (adapter->psl_rev & 0xf000) 1052 + return; 1053 + if (!(aer = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR))) 1054 + return; 1055 + pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, &data); 1056 + if (data & PCI_ERR_UNC_MALF_TLP) 1057 + if (data & PCI_ERR_UNC_INTN) 1058 + return; 1059 + data |= PCI_ERR_UNC_MALF_TLP; 1060 + data |= PCI_ERR_UNC_INTN; 1061 + pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, data); 1062 + } 1063 + 1038 1064 static int cxl_vsec_looks_ok(struct cxl *adapter, struct pci_dev *dev) 1039 1065 { 1040 1066 if (adapter->vsec_status & CXL_STATUS_SECOND_PORT) ··· 1159 1133 1160 1134 if ((rc = cxl_vsec_looks_ok(adapter, dev))) 1161 1135 return rc; 1136 + 1137 + cxl_fixup_malformed_tlp(adapter, dev); 1162 1138 1163 1139 if ((rc = setup_cxl_bars(dev))) 1164 1140 return rc;
+3 -6
drivers/mmc/card/mmc_test.c
··· 2263 2263 /* 2264 2264 * eMMC hardware reset. 2265 2265 */ 2266 - static int mmc_test_hw_reset(struct mmc_test_card *test) 2266 + static int mmc_test_reset(struct mmc_test_card *test) 2267 2267 { 2268 2268 struct mmc_card *card = test->card; 2269 2269 struct mmc_host *host = card->host; 2270 2270 int err; 2271 - 2272 - if (!mmc_card_mmc(card) || !mmc_can_reset(card)) 2273 - return RESULT_UNSUP_CARD; 2274 2271 2275 2272 err = mmc_hw_reset(host); 2276 2273 if (!err) ··· 2602 2605 }, 2603 2606 2604 2607 { 2605 - .name = "eMMC hardware reset", 2606 - .run = mmc_test_hw_reset, 2608 + .name = "Reset test", 2609 + .run = mmc_test_reset, 2607 2610 }, 2608 2611 }; 2609 2612
-7
drivers/mmc/core/mmc.c
··· 1924 1924 static int mmc_reset(struct mmc_host *host) 1925 1925 { 1926 1926 struct mmc_card *card = host->card; 1927 - u32 status; 1928 1927 1929 1928 if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) 1930 1929 return -EOPNOTSUPP; ··· 1935 1936 mmc_set_clock(host, host->f_init); 1936 1937 1937 1938 host->ops->hw_reset(host); 1938 - 1939 - /* If the reset has happened, then a status command will fail */ 1940 - if (!mmc_send_status(card, &status)) { 1941 - mmc_host_clk_release(host); 1942 - return -ENOSYS; 1943 - } 1944 1939 1945 1940 /* Set initial state and call mmc_set_ios */ 1946 1941 mmc_set_initial_state(host);
+1
drivers/net/can/sja1000/peak_pci.c
··· 87 87 {PEAK_PCI_VENDOR_ID, PEAK_PC_104P_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 88 88 {PEAK_PCI_VENDOR_ID, PEAK_PCI_104E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 89 89 {PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 90 + {PEAK_PCI_VENDOR_ID, PEAK_PCIE_OEM_ID, PCI_ANY_ID, PCI_ANY_ID,}, 90 91 #ifdef CONFIG_CAN_PEAK_PCIEC 91 92 {PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 92 93 {PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+4
drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
··· 327 327 pdata->debugfs_xpcs_reg = 0; 328 328 329 329 buf = kasprintf(GFP_KERNEL, "amd-xgbe-%s", pdata->netdev->name); 330 + if (!buf) 331 + return; 332 + 330 333 pdata->xgbe_debugfs = debugfs_create_dir(buf, NULL); 331 334 if (!pdata->xgbe_debugfs) { 332 335 netdev_err(pdata->netdev, "debugfs_create_dir failed\n"); 336 + kfree(buf); 333 337 return; 334 338 } 335 339
+7
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
··· 3351 3351 udp_rss_requested = 0; 3352 3352 else 3353 3353 return -EINVAL; 3354 + 3355 + if (CHIP_IS_E1x(bp) && udp_rss_requested) { 3356 + DP(BNX2X_MSG_ETHTOOL, 3357 + "57710, 57711 boards don't support RSS according to UDP 4-tuple\n"); 3358 + return -EINVAL; 3359 + } 3360 + 3354 3361 if ((info->flow_type == UDP_V4_FLOW) && 3355 3362 (bp->rss_conf_obj.udp_rss_v4 != udp_rss_requested)) { 3356 3363 bp->rss_conf_obj.udp_rss_v4 = udp_rss_requested;
+23 -9
drivers/net/ethernet/broadcom/genet/bcmgenet.c
··· 1683 1683 bcmgenet_intrl2_1_writel(priv, 0, INTRL2_CPU_MASK_CLEAR); 1684 1684 } 1685 1685 1686 + static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv) 1687 + { 1688 + u32 int0_enable = 0; 1689 + 1690 + /* Monitor cable plug/unplugged event for internal PHY, external PHY 1691 + * and MoCA PHY 1692 + */ 1693 + if (priv->internal_phy) { 1694 + int0_enable |= UMAC_IRQ_LINK_EVENT; 1695 + } else if (priv->ext_phy) { 1696 + int0_enable |= UMAC_IRQ_LINK_EVENT; 1697 + } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { 1698 + if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET) 1699 + int0_enable |= UMAC_IRQ_LINK_EVENT; 1700 + } 1701 + bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR); 1702 + } 1703 + 1686 1704 static int init_umac(struct bcmgenet_priv *priv) 1687 1705 { 1688 1706 struct device *kdev = &priv->pdev->dev; ··· 1741 1723 /* Enable Tx default queue 16 interrupts */ 1742 1724 int0_enable |= UMAC_IRQ_TXDMA_DONE; 1743 1725 1744 - /* Monitor cable plug/unplugged event for internal PHY */ 1745 - if (priv->internal_phy) { 1746 - int0_enable |= UMAC_IRQ_LINK_EVENT; 1747 - } else if (priv->ext_phy) { 1748 - int0_enable |= UMAC_IRQ_LINK_EVENT; 1749 - } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { 1750 - if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET) 1751 - int0_enable |= UMAC_IRQ_LINK_EVENT; 1752 - 1726 + /* Configure backpressure vectors for MoCA */ 1727 + if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { 1753 1728 reg = bcmgenet_bp_mc_get(priv); 1754 1729 reg |= BIT(priv->hw_params->bp_in_en_shift); 1755 1730 ··· 2655 2644 umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true); 2656 2645 2657 2646 netif_tx_start_all_queues(dev); 2647 + 2648 + /* Monitor link interrupts now */ 2649 + bcmgenet_link_intr_enable(priv); 2658 2650 2659 2651 phy_start(priv->phydev); 2660 2652 }
+1
drivers/net/ethernet/emulex/benet/be.h
··· 592 592 int be_get_temp_freq; 593 593 struct be_hwmon hwmon_info; 594 594 u8 pf_number; 595 + u8 pci_func_num; 595 596 struct rss_info rss_info; 596 597 /* Filters for packets that need to be sent to BMC */ 597 598 u32 bmc_filt_mask;
+24 -7
drivers/net/ethernet/emulex/benet/be_cmds.c
··· 851 851 return status; 852 852 853 853 dest_wrb = be_cmd_copy(adapter, wrb); 854 - if (!dest_wrb) 855 - return -EBUSY; 854 + if (!dest_wrb) { 855 + status = -EBUSY; 856 + goto unlock; 857 + } 856 858 857 859 if (use_mcc(adapter)) 858 860 status = be_mcc_notify_wait(adapter); ··· 864 862 if (!status) 865 863 memcpy(wrb, dest_wrb, sizeof(*wrb)); 866 864 865 + unlock: 867 866 be_cmd_unlock(adapter); 868 867 return status; 869 868 } ··· 1987 1984 be_if_cap_flags(adapter)); 1988 1985 } 1989 1986 flags &= be_if_cap_flags(adapter); 1987 + if (!flags) 1988 + return -ENOTSUPP; 1990 1989 1991 1990 return __be_cmd_rx_filter(adapter, flags, value); 1992 1991 } ··· 2892 2887 if (!status) { 2893 2888 attribs = attribs_cmd.va + sizeof(struct be_cmd_resp_hdr); 2894 2889 adapter->hba_port_num = attribs->hba_attribs.phy_port; 2890 + adapter->pci_func_num = attribs->pci_func_num; 2895 2891 serial_num = attribs->hba_attribs.controller_serial_number; 2896 2892 for (i = 0; i < CNTL_SERIAL_NUM_WORDS; i++) 2897 2893 adapter->serial_num[i] = le32_to_cpu(serial_num[i]) & ··· 3715 3709 status = -EINVAL; 3716 3710 goto err; 3717 3711 } 3718 - 3719 3712 adapter->pf_number = desc->pf_num; 3720 3713 be_copy_nic_desc(res, desc); 3721 3714 } ··· 3726 3721 return status; 3727 3722 } 3728 3723 3729 - /* Will use MBOX only if MCCQ has not been created */ 3724 + /* Will use MBOX only if MCCQ has not been created 3725 + * non-zero domain => a PF is querying this on behalf of a VF 3726 + * zero domain => a PF or a VF is querying this for itself 3727 + */ 3730 3728 int be_cmd_get_profile_config(struct be_adapter *adapter, 3731 3729 struct be_resources *res, u8 query, u8 domain) 3732 3730 { ··· 3756 3748 OPCODE_COMMON_GET_PROFILE_CONFIG, 3757 3749 cmd.size, &wrb, &cmd); 3758 3750 3759 - req->hdr.domain = domain; 3760 3751 if (!lancer_chip(adapter)) 3761 3752 req->hdr.version = 1; 3762 3753 req->type = ACTIVE_PROFILE_TYPE; 3754 + /* When a function is querying profile information relating to 3755 + * itself hdr.pf_number must be set to it's pci_func_num + 1 3756 + */ 3757 + req->hdr.domain = domain; 3758 + if (domain == 0) 3759 + req->hdr.pf_num = adapter->pci_func_num + 1; 3763 3760 3764 3761 /* When QUERY_MODIFIABLE_FIELDS_TYPE bit is set, cmd returns the 3765 3762 * descriptors with all bits set to "1" for the fields which can be ··· 3934 3921 vf_if_cap_flags &= ~(BE_IF_FLAGS_RSS | 3935 3922 BE_IF_FLAGS_DEFQ_RSS); 3936 3923 } 3937 - 3938 - nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags); 3939 3924 } else { 3940 3925 num_vf_qs = 1; 3941 3926 } 3942 3927 3928 + if (res_mod.vf_if_cap_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) { 3929 + nic_vft->flags |= BIT(IF_CAPS_FLAGS_VALID_SHIFT); 3930 + vf_if_cap_flags &= ~BE_IF_FLAGS_VLAN_PROMISCUOUS; 3931 + } 3932 + 3933 + nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags); 3943 3934 nic_vft->rq_count = cpu_to_le16(num_vf_qs); 3944 3935 nic_vft->txq_count = cpu_to_le16(num_vf_qs); 3945 3936 nic_vft->rssq_count = cpu_to_le16(num_vf_qs);
+8 -2
drivers/net/ethernet/emulex/benet/be_cmds.h
··· 289 289 u32 timeout; /* dword 1 */ 290 290 u32 request_length; /* dword 2 */ 291 291 u8 version; /* dword 3 */ 292 - u8 rsvd[3]; /* dword 3 */ 292 + u8 rsvd1; /* dword 3 */ 293 + u8 pf_num; /* dword 3 */ 294 + u8 rsvd2; /* dword 3 */ 293 295 }; 294 296 295 297 #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */ ··· 1654 1652 1655 1653 struct mgmt_controller_attrib { 1656 1654 struct mgmt_hba_attribs hba_attribs; 1657 - u32 rsvd0[10]; 1655 + u32 rsvd0[2]; 1656 + u16 rsvd1; 1657 + u8 pci_func_num; 1658 + u8 rsvd2; 1659 + u32 rsvd3[7]; 1658 1660 } __packed; 1659 1661 1660 1662 struct be_cmd_req_cntl_attribs {
+19 -9
drivers/net/ethernet/emulex/benet/be_main.c
··· 1123 1123 struct sk_buff *skb, 1124 1124 struct be_wrb_params *wrb_params) 1125 1125 { 1126 - /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or 1127 - * less may cause a transmit stall on that port. So the work-around is 1128 - * to pad short packets (<= 32 bytes) to a 36-byte length. 1126 + /* Lancer, SH and BE3 in SRIOV mode have a bug wherein 1127 + * packets that are 32b or less may cause a transmit stall 1128 + * on that port. The workaround is to pad such packets 1129 + * (len <= 32 bytes) to a minimum length of 36b. 1129 1130 */ 1130 - if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) { 1131 + if (skb->len <= 32) { 1131 1132 if (skb_put_padto(skb, 36)) 1132 1133 return NULL; 1133 1134 } ··· 4206 4205 int status, level; 4207 4206 u16 profile_id; 4208 4207 4209 - status = be_cmd_get_cntl_attributes(adapter); 4210 - if (status) 4211 - return status; 4212 - 4213 4208 status = be_cmd_query_fw_cfg(adapter); 4214 4209 if (status) 4215 4210 return status; ··· 4403 4406 4404 4407 if (!lancer_chip(adapter)) 4405 4408 be_cmd_req_native_mode(adapter); 4409 + 4410 + /* Need to invoke this cmd first to get the PCI Function Number */ 4411 + status = be_cmd_get_cntl_attributes(adapter); 4412 + if (status) 4413 + return status; 4406 4414 4407 4415 if (!BE2_chip(adapter) && be_physfn(adapter)) 4408 4416 be_alloc_sriov_res(adapter); ··· 5001 4999 return false; 5002 5000 } 5003 5001 5004 - return (fhdr->asic_type_rev >= adapter->asic_rev); 5002 + /* In BE3 FW images the "asic_type_rev" field doesn't track the 5003 + * asic_rev of the chips it is compatible with. 5004 + * When asic_type_rev is 0 the image is compatible only with 5005 + * pre-BE3-R chips (asic_rev < 0x10) 5006 + */ 5007 + if (BEx_chip(adapter) && fhdr->asic_type_rev == 0) 5008 + return adapter->asic_rev < 0x10; 5009 + else 5010 + return (fhdr->asic_type_rev >= adapter->asic_rev); 5005 5011 } 5006 5012 5007 5013 static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
+28 -6
drivers/net/ethernet/freescale/fsl_pq_mdio.c
··· 198 198 199 199 #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE) 200 200 /* 201 + * Return the TBIPA address, starting from the address 202 + * of the mapped GFAR MDIO registers (struct gfar) 201 203 * This is mildly evil, but so is our hardware for doing this. 202 204 * Also, we have to cast back to struct gfar because of 203 205 * definition weirdness done in gianfar.h. 204 206 */ 205 - static uint32_t __iomem *get_gfar_tbipa(void __iomem *p) 207 + static uint32_t __iomem *get_gfar_tbipa_from_mdio(void __iomem *p) 206 208 { 207 209 struct gfar __iomem *enet_regs = p; 208 210 209 211 return &enet_regs->tbipa; 212 + } 213 + 214 + /* 215 + * Return the TBIPA address, starting from the address 216 + * of the mapped GFAR MII registers (gfar_mii_regs[] within struct gfar) 217 + */ 218 + static uint32_t __iomem *get_gfar_tbipa_from_mii(void __iomem *p) 219 + { 220 + return get_gfar_tbipa_from_mdio(container_of(p, struct gfar, gfar_mii_regs)); 210 221 } 211 222 212 223 /* ··· 231 220 232 221 #if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE) 233 222 /* 234 - * Return the TBIPAR address for a QE MDIO node 223 + * Return the TBIPAR address for a QE MDIO node, starting from the address 224 + * of the mapped MII registers (struct fsl_pq_mii) 235 225 */ 236 226 static uint32_t __iomem *get_ucc_tbipa(void __iomem *p) 237 227 { 238 - struct fsl_pq_mdio __iomem *mdio = p; 228 + struct fsl_pq_mdio __iomem *mdio = container_of(p, struct fsl_pq_mdio, mii); 239 229 240 230 return &mdio->utbipar; 241 231 } ··· 312 300 .compatible = "fsl,gianfar-tbi", 313 301 .data = &(struct fsl_pq_mdio_data) { 314 302 .mii_offset = 0, 315 - .get_tbipa = get_gfar_tbipa, 303 + .get_tbipa = get_gfar_tbipa_from_mii, 316 304 }, 317 305 }, 318 306 { 319 307 .compatible = "fsl,gianfar-mdio", 320 308 .data = &(struct fsl_pq_mdio_data) { 321 309 .mii_offset = 0, 322 - .get_tbipa = get_gfar_tbipa, 310 + .get_tbipa = get_gfar_tbipa_from_mii, 323 311 }, 324 312 }, 325 313 { ··· 327 315 .compatible = "gianfar", 328 316 .data = &(struct fsl_pq_mdio_data) { 329 317 .mii_offset = offsetof(struct fsl_pq_mdio, mii), 330 - .get_tbipa = get_gfar_tbipa, 318 + .get_tbipa = get_gfar_tbipa_from_mdio, 331 319 }, 332 320 }, 333 321 { ··· 456 444 } 457 445 458 446 tbipa = data->get_tbipa(priv->map); 447 + 448 + /* 449 + * Add consistency check to make sure TBI is contained 450 + * within the mapped range (not because we would get a 451 + * segfault, rather to catch bugs in computing TBI 452 + * address). Print error message but continue anyway. 453 + */ 454 + if ((void *)tbipa > priv->map + resource_size(&res) - 4) 455 + dev_err(&pdev->dev, "invalid register map (should be at least 0x%04x to contain TBI address)\n", 456 + ((void *)tbipa - priv->map) + 4); 459 457 460 458 iowrite32be(be32_to_cpup(prop), tbipa); 461 459 }
+2 -2
drivers/net/ethernet/intel/i40e/i40e_adminq.c
··· 386 386 387 387 hw->aq.asq.next_to_use = 0; 388 388 hw->aq.asq.next_to_clean = 0; 389 - hw->aq.asq.count = hw->aq.num_asq_entries; 390 389 391 390 /* allocate the ring memory */ 392 391 ret_code = i40e_alloc_adminq_asq_ring(hw); ··· 403 404 goto init_adminq_free_rings; 404 405 405 406 /* success! */ 407 + hw->aq.asq.count = hw->aq.num_asq_entries; 406 408 goto init_adminq_exit; 407 409 408 410 init_adminq_free_rings: ··· 445 445 446 446 hw->aq.arq.next_to_use = 0; 447 447 hw->aq.arq.next_to_clean = 0; 448 - hw->aq.arq.count = hw->aq.num_arq_entries; 449 448 450 449 /* allocate the ring memory */ 451 450 ret_code = i40e_alloc_adminq_arq_ring(hw); ··· 462 463 goto init_adminq_free_rings; 463 464 464 465 /* success! */ 466 + hw->aq.arq.count = hw->aq.num_arq_entries; 465 467 goto init_adminq_exit; 466 468 467 469 init_adminq_free_rings:
+2
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 8389 8389 8390 8390 netdev->hw_enc_features |= NETIF_F_IP_CSUM | 8391 8391 NETIF_F_GSO_UDP_TUNNEL | 8392 + NETIF_F_GSO_GRE | 8392 8393 NETIF_F_TSO; 8393 8394 8394 8395 netdev->features = NETIF_F_SG | ··· 8397 8396 NETIF_F_SCTP_CSUM | 8398 8397 NETIF_F_HIGHDMA | 8399 8398 NETIF_F_GSO_UDP_TUNNEL | 8399 + NETIF_F_GSO_GRE | 8400 8400 NETIF_F_HW_VLAN_CTAG_TX | 8401 8401 NETIF_F_HW_VLAN_CTAG_RX | 8402 8402 NETIF_F_HW_VLAN_CTAG_FILTER |
+2 -2
drivers/net/ethernet/intel/i40evf/i40e_adminq.c
··· 373 373 374 374 hw->aq.asq.next_to_use = 0; 375 375 hw->aq.asq.next_to_clean = 0; 376 - hw->aq.asq.count = hw->aq.num_asq_entries; 377 376 378 377 /* allocate the ring memory */ 379 378 ret_code = i40e_alloc_adminq_asq_ring(hw); ··· 390 391 goto init_adminq_free_rings; 391 392 392 393 /* success! */ 394 + hw->aq.asq.count = hw->aq.num_asq_entries; 393 395 goto init_adminq_exit; 394 396 395 397 init_adminq_free_rings: ··· 432 432 433 433 hw->aq.arq.next_to_use = 0; 434 434 hw->aq.arq.next_to_clean = 0; 435 - hw->aq.arq.count = hw->aq.num_arq_entries; 436 435 437 436 /* allocate the ring memory */ 438 437 ret_code = i40e_alloc_adminq_arq_ring(hw); ··· 449 450 goto init_adminq_free_rings; 450 451 451 452 /* success! */ 453 + hw->aq.arq.count = hw->aq.num_arq_entries; 452 454 goto init_adminq_exit; 453 455 454 456 init_adminq_free_rings:
+4
drivers/net/ethernet/mellanox/mlx4/eq.c
··· 1364 1364 * and performing a NOP command 1365 1365 */ 1366 1366 for(i = 0; !err && (i < dev->caps.num_comp_vectors); ++i) { 1367 + /* Make sure request_irq was called */ 1368 + if (!priv->eq_table.eq[i].have_irq) 1369 + continue; 1370 + 1367 1371 /* Temporary use polling for command completions */ 1368 1372 mlx4_cmd_use_polling(dev); 1369 1373
+2 -8
drivers/net/ethernet/mellanox/mlx4/main.c
··· 2669 2669 2670 2670 if (msi_x) { 2671 2671 int nreq = dev->caps.num_ports * num_online_cpus() + 1; 2672 - bool shared_ports = false; 2673 2672 2674 2673 nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, 2675 2674 nreq); 2676 - if (nreq > MAX_MSIX) { 2675 + if (nreq > MAX_MSIX) 2677 2676 nreq = MAX_MSIX; 2678 - shared_ports = true; 2679 - } 2680 2677 2681 2678 entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); 2682 2679 if (!entries) ··· 2696 2699 bitmap_zero(priv->eq_table.eq[MLX4_EQ_ASYNC].actv_ports.ports, 2697 2700 dev->caps.num_ports); 2698 2701 2699 - if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) 2700 - shared_ports = true; 2701 - 2702 2702 for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) { 2703 2703 if (i == MLX4_EQ_ASYNC) 2704 2704 continue; ··· 2703 2709 priv->eq_table.eq[i].irq = 2704 2710 entries[i + 1 - !!(i > MLX4_EQ_ASYNC)].vector; 2705 2711 2706 - if (shared_ports) { 2712 + if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) { 2707 2713 bitmap_fill(priv->eq_table.eq[i].actv_ports.ports, 2708 2714 dev->caps.num_ports); 2709 2715 /* We don't set affinity hint when there
+14 -2
drivers/net/ethernet/mellanox/mlx5/core/en_flow_table.c
··· 598 598 return; 599 599 600 600 priv->vlan.filter_disabled = false; 601 + if (priv->netdev->flags & IFF_PROMISC) 602 + return; 601 603 mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 0); 602 604 } 603 605 ··· 609 607 return; 610 608 611 609 priv->vlan.filter_disabled = true; 610 + if (priv->netdev->flags & IFF_PROMISC) 611 + return; 612 612 mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 0); 613 613 } 614 614 ··· 721 717 bool enable_broadcast = !ea->broadcast_enabled && broadcast_enabled; 722 718 bool disable_broadcast = ea->broadcast_enabled && !broadcast_enabled; 723 719 724 - if (enable_promisc) 720 + if (enable_promisc) { 725 721 mlx5e_add_eth_addr_rule(priv, &ea->promisc, MLX5E_PROMISC); 722 + if (!priv->vlan.filter_disabled) 723 + mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 724 + 0); 725 + } 726 726 if (enable_allmulti) 727 727 mlx5e_add_eth_addr_rule(priv, &ea->allmulti, MLX5E_ALLMULTI); 728 728 if (enable_broadcast) ··· 738 730 mlx5e_del_eth_addr_from_flow_table(priv, &ea->broadcast); 739 731 if (disable_allmulti) 740 732 mlx5e_del_eth_addr_from_flow_table(priv, &ea->allmulti); 741 - if (disable_promisc) 733 + if (disable_promisc) { 734 + if (!priv->vlan.filter_disabled) 735 + mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 736 + 0); 742 737 mlx5e_del_eth_addr_from_flow_table(priv, &ea->promisc); 738 + } 743 739 744 740 ea->promisc_enabled = promisc_enabled; 745 741 ea->allmulti_enabled = allmulti_enabled;
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/port.c
··· 311 311 int err; 312 312 313 313 memset(in, 0, sizeof(in)); 314 - MLX5_SET(ptys_reg, in, local_port, local_port); 314 + MLX5_SET(pvlc_reg, in, local_port, local_port); 315 315 316 316 err = mlx5_core_access_reg(dev, in, sizeof(in), pvlc, 317 317 pvlc_size, MLX5_REG_PVLC, 0, 0);
+9 -4
drivers/net/ethernet/mellanox/mlxsw/core.c
··· 374 374 int err; 375 375 int ret; 376 376 377 + mlxsw_core->emad.trans_active = true; 378 + 377 379 err = mlxsw_core_skb_transmit(mlxsw_core->driver_priv, skb, tx_info); 378 380 if (err) { 379 381 dev_err(mlxsw_core->bus_info->dev, "Failed to transmit EMAD (tid=%llx)\n", 380 382 mlxsw_core->emad.tid); 381 383 dev_kfree_skb(skb); 382 - return err; 384 + goto trans_inactive_out; 383 385 } 384 386 385 - mlxsw_core->emad.trans_active = true; 386 387 ret = wait_event_timeout(mlxsw_core->emad.wait, 387 388 !(mlxsw_core->emad.trans_active), 388 389 msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_MS)); 389 390 if (!ret) { 390 391 dev_warn(mlxsw_core->bus_info->dev, "EMAD timed-out (tid=%llx)\n", 391 392 mlxsw_core->emad.tid); 392 - mlxsw_core->emad.trans_active = false; 393 - return -EIO; 393 + err = -EIO; 394 + goto trans_inactive_out; 394 395 } 395 396 396 397 return 0; 398 + 399 + trans_inactive_out: 400 + mlxsw_core->emad.trans_active = false; 401 + return err; 397 402 } 398 403 399 404 static int mlxsw_emad_process_status(struct mlxsw_core *mlxsw_core,
+3 -1
drivers/net/ethernet/mellanox/mlxsw/item.h
··· 187 187 { 188 188 u16 max_index, be_index; 189 189 u16 offset; /* byte offset inside the array */ 190 + u8 in_byte_index; 190 191 191 192 BUG_ON(index && !item->element_size); 192 193 if (item->offset % sizeof(u32) != 0 || ··· 200 199 max_index = (item->size.bytes << 3) / item->element_size - 1; 201 200 be_index = max_index - index; 202 201 offset = be_index * item->element_size >> 3; 203 - *shift = index % (BITS_PER_BYTE / item->element_size) << 1; 202 + in_byte_index = index % (BITS_PER_BYTE / item->element_size); 203 + *shift = in_byte_index * item->element_size; 204 204 205 205 return item->offset + offset; 206 206 }
+4 -4
drivers/net/ethernet/mellanox/mlxsw/pci.c
··· 1582 1582 1583 1583 if (in_mbox) 1584 1584 memcpy(mlxsw_pci->cmd.in_mbox.buf, in_mbox, in_mbox_size); 1585 - mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_HI, in_mapaddr >> 32); 1586 - mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_LO, in_mapaddr); 1585 + mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_HI, upper_32_bits(in_mapaddr)); 1586 + mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_LO, lower_32_bits(in_mapaddr)); 1587 1587 1588 - mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_HI, out_mapaddr >> 32); 1589 - mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_LO, out_mapaddr); 1588 + mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_HI, upper_32_bits(out_mapaddr)); 1589 + mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_LO, lower_32_bits(out_mapaddr)); 1590 1590 1591 1591 mlxsw_pci_write32(mlxsw_pci, CIR_IN_MODIFIER, in_mod); 1592 1592 mlxsw_pci_write32(mlxsw_pci, CIR_TOKEN, 0);
+1 -1
drivers/net/ethernet/mellanox/mlxsw/switchx2.c
··· 1069 1069 return 0; 1070 1070 1071 1071 err_register_netdev: 1072 - err_port_admin_status_set: 1073 1072 err_port_mac_learning_mode_set: 1074 1073 err_port_stp_state_set: 1074 + err_port_admin_status_set: 1075 1075 err_port_mtu_set: 1076 1076 err_port_speed_set: 1077 1077 err_port_swid_set:
+6 -7
drivers/net/ethernet/nxp/lpc_eth.c
··· 476 476 mac[5] = tmp >> 8; 477 477 } 478 478 479 - static void __lpc_eth_clock_enable(struct netdata_local *pldat, 480 - bool enable) 479 + static void __lpc_eth_clock_enable(struct netdata_local *pldat, bool enable) 481 480 { 482 481 if (enable) 483 - clk_enable(pldat->clk); 482 + clk_prepare_enable(pldat->clk); 484 483 else 485 - clk_disable(pldat->clk); 484 + clk_disable_unprepare(pldat->clk); 486 485 } 487 486 488 487 static void __lpc_params_setup(struct netdata_local *pldat) ··· 1493 1494 err_out_iounmap: 1494 1495 iounmap(pldat->net_base); 1495 1496 err_out_disable_clocks: 1496 - clk_disable(pldat->clk); 1497 + clk_disable_unprepare(pldat->clk); 1497 1498 clk_put(pldat->clk); 1498 1499 err_out_free_dev: 1499 1500 free_netdev(ndev); ··· 1518 1519 iounmap(pldat->net_base); 1519 1520 mdiobus_unregister(pldat->mii_bus); 1520 1521 mdiobus_free(pldat->mii_bus); 1521 - clk_disable(pldat->clk); 1522 + clk_disable_unprepare(pldat->clk); 1522 1523 clk_put(pldat->clk); 1523 1524 free_netdev(ndev); 1524 1525 ··· 1539 1540 if (netif_running(ndev)) { 1540 1541 netif_device_detach(ndev); 1541 1542 __lpc_eth_shutdown(pldat); 1542 - clk_disable(pldat->clk); 1543 + clk_disable_unprepare(pldat->clk); 1543 1544 1544 1545 /* 1545 1546 * Reset again now clock is disable to be sure
+2 -1
drivers/net/ethernet/via/via-rhine.c
··· 2134 2134 } 2135 2135 2136 2136 skb_put(skb, pkt_len); 2137 - skb->protocol = eth_type_trans(skb, dev); 2138 2137 2139 2138 rhine_rx_vlan_tag(skb, desc, data_size); 2139 + 2140 + skb->protocol = eth_type_trans(skb, dev); 2140 2141 2141 2142 netif_receive_skb(skb); 2142 2143
+6 -6
drivers/net/geneve.c
··· 870 870 __be16 dst_port = htons(GENEVE_UDP_PORT); 871 871 __u8 ttl = 0, tos = 0; 872 872 bool metadata = false; 873 - __be32 rem_addr; 874 - __u32 vni; 873 + __be32 rem_addr = 0; 874 + __u32 vni = 0; 875 875 876 - if (!data[IFLA_GENEVE_ID] || !data[IFLA_GENEVE_REMOTE]) 877 - return -EINVAL; 876 + if (data[IFLA_GENEVE_ID]) 877 + vni = nla_get_u32(data[IFLA_GENEVE_ID]); 878 878 879 - vni = nla_get_u32(data[IFLA_GENEVE_ID]); 880 - rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]); 879 + if (data[IFLA_GENEVE_REMOTE]) 880 + rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]); 881 881 882 882 if (data[IFLA_GENEVE_TTL]) 883 883 ttl = nla_get_u8(data[IFLA_GENEVE_TTL]);
-2
drivers/net/phy/Kconfig
··· 168 168 busses. It is required by the Octeon and ThunderX ethernet device 169 169 drivers. 170 170 171 - If in doubt, say Y. 172 - 173 171 config MDIO_SUN4I 174 172 tristate "Allwinner sun4i MDIO interface support" 175 173 depends on ARCH_SUNXI
-1
drivers/net/ppp/pppoe.c
··· 313 313 if (po->pppoe_dev == dev && 314 314 sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) { 315 315 pppox_unbind_sock(sk); 316 - sk->sk_state = PPPOX_ZOMBIE; 317 316 sk->sk_state_change(sk); 318 317 po->pppoe_dev = NULL; 319 318 dev_put(dev);
+1
drivers/net/usb/Kconfig
··· 164 164 * Aten UC210T 165 165 * ASIX AX88172 166 166 * Billionton Systems, USB2AR 167 + * Billionton Systems, GUSB2AM-1G-B 167 168 * Buffalo LUA-U2-KTX 168 169 * Corega FEther USB2-TX 169 170 * D-Link DUB-E100
+3 -1
drivers/net/usb/asix_common.c
··· 91 91 } 92 92 rx->ax_skb = netdev_alloc_skb_ip_align(dev->net, 93 93 rx->size); 94 - if (!rx->ax_skb) 94 + if (!rx->ax_skb) { 95 + rx->size = 0; 95 96 return 0; 97 + } 96 98 } 97 99 98 100 if (rx->size > dev->net->mtu + ETH_HLEN + VLAN_HLEN) {
+4
drivers/net/usb/asix_devices.c
··· 959 959 USB_DEVICE (0x08dd, 0x90ff), 960 960 .driver_info = (unsigned long) &ax8817x_info, 961 961 }, { 962 + // Billionton Systems, GUSB2AM-1G-B 963 + USB_DEVICE(0x08dd, 0x0114), 964 + .driver_info = (unsigned long) &ax88178_info, 965 + }, { 962 966 // ATEN UC210T 963 967 USB_DEVICE (0x0557, 0x2009), 964 968 .driver_info = (unsigned long) &ax8817x_info,
+3 -4
drivers/net/vxlan.c
··· 2745 2745 struct vxlan_config conf; 2746 2746 int err; 2747 2747 2748 - if (!data[IFLA_VXLAN_ID]) 2749 - return -EINVAL; 2750 - 2751 2748 memset(&conf, 0, sizeof(conf)); 2752 - conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]); 2749 + 2750 + if (data[IFLA_VXLAN_ID]) 2751 + conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]); 2753 2752 2754 2753 if (data[IFLA_VXLAN_GROUP]) { 2755 2754 conf.remote_ip.sin.sin_addr.s_addr = nla_get_in_addr(data[IFLA_VXLAN_GROUP]);
+2 -2
drivers/net/wireless/ath/ath10k/hw.h
··· 337 337 #define TARGET_10X_MAX_FRAG_ENTRIES 0 338 338 339 339 /* 10.2 parameters */ 340 - #define TARGET_10_2_DMA_BURST_SIZE 1 340 + #define TARGET_10_2_DMA_BURST_SIZE 0 341 341 342 342 /* Target specific defines for WMI-TLV firmware */ 343 343 #define TARGET_TLV_NUM_VDEVS 4 ··· 391 391 392 392 #define TARGET_10_4_TX_DBG_LOG_SIZE 1024 393 393 #define TARGET_10_4_NUM_WDS_ENTRIES 32 394 - #define TARGET_10_4_DMA_BURST_SIZE 1 394 + #define TARGET_10_4_DMA_BURST_SIZE 0 395 395 #define TARGET_10_4_MAC_AGGR_DELIM 0 396 396 #define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1 397 397 #define TARGET_10_4_VOW_CONFIG 0
+1
drivers/net/wireless/ath/ath9k/init.c
··· 880 880 hw->max_rate_tries = 10; 881 881 hw->sta_data_size = sizeof(struct ath_node); 882 882 hw->vif_data_size = sizeof(struct ath_vif); 883 + hw->extra_tx_headroom = 4; 883 884 884 885 hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1; 885 886 hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1;
+1
drivers/net/wireless/b43/main.c
··· 120 120 #ifdef CONFIG_B43_BCMA 121 121 static const struct bcma_device_id b43_bcma_tbl[] = { 122 122 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x11, BCMA_ANY_CLASS), 123 + BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x15, BCMA_ANY_CLASS), 123 124 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x17, BCMA_ANY_CLASS), 124 125 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x18, BCMA_ANY_CLASS), 125 126 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1C, BCMA_ANY_CLASS),
+1 -1
drivers/net/wireless/iwlwifi/dvm/lib.c
··· 1020 1020 u8 *pn = seq.ccmp.pn; 1021 1021 1022 1022 ieee80211_get_key_rx_seq(key, i, &seq); 1023 - aes_sc->pn = cpu_to_le64( 1023 + aes_sc[i].pn = cpu_to_le64( 1024 1024 (u64)pn[5] | 1025 1025 ((u64)pn[4] << 8) | 1026 1026 ((u64)pn[3] << 16) |
+1 -1
drivers/net/wireless/iwlwifi/iwl-7000.c
··· 348 348 }; 349 349 350 350 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 351 - MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); 351 + MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 352 352 MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 353 353 MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
+11 -16
drivers/net/wireless/iwlwifi/mvm/d3.c
··· 274 274 break; 275 275 case WLAN_CIPHER_SUITE_CCMP: 276 276 if (sta) { 277 - u8 *pn = seq.ccmp.pn; 277 + u64 pn64; 278 278 279 279 aes_sc = data->rsc_tsc->all_tsc_rsc.aes.unicast_rsc; 280 280 aes_tx_sc = &data->rsc_tsc->all_tsc_rsc.aes.tsc; 281 281 282 - ieee80211_get_key_tx_seq(key, &seq); 283 - aes_tx_sc->pn = cpu_to_le64((u64)pn[5] | 284 - ((u64)pn[4] << 8) | 285 - ((u64)pn[3] << 16) | 286 - ((u64)pn[2] << 24) | 287 - ((u64)pn[1] << 32) | 288 - ((u64)pn[0] << 40)); 282 + pn64 = atomic64_read(&key->tx_pn); 283 + aes_tx_sc->pn = cpu_to_le64(pn64); 289 284 } else { 290 285 aes_sc = data->rsc_tsc->all_tsc_rsc.aes.multicast_rsc; 291 286 } ··· 293 298 u8 *pn = seq.ccmp.pn; 294 299 295 300 ieee80211_get_key_rx_seq(key, i, &seq); 296 - aes_sc->pn = cpu_to_le64((u64)pn[5] | 297 - ((u64)pn[4] << 8) | 298 - ((u64)pn[3] << 16) | 299 - ((u64)pn[2] << 24) | 300 - ((u64)pn[1] << 32) | 301 - ((u64)pn[0] << 40)); 301 + aes_sc[i].pn = cpu_to_le64((u64)pn[5] | 302 + ((u64)pn[4] << 8) | 303 + ((u64)pn[3] << 16) | 304 + ((u64)pn[2] << 24) | 305 + ((u64)pn[1] << 32) | 306 + ((u64)pn[0] << 40)); 302 307 } 303 308 data->use_rsc_tsc = true; 304 309 break; ··· 1448 1453 1449 1454 switch (key->cipher) { 1450 1455 case WLAN_CIPHER_SUITE_CCMP: 1451 - iwl_mvm_aes_sc_to_seq(&sc->aes.tsc, &seq); 1452 1456 iwl_mvm_set_aes_rx_seq(sc->aes.unicast_rsc, key); 1457 + atomic64_set(&key->tx_pn, le64_to_cpu(sc->aes.tsc.pn)); 1453 1458 break; 1454 1459 case WLAN_CIPHER_SUITE_TKIP: 1455 1460 iwl_mvm_tkip_sc_to_seq(&sc->tkip.tsc, &seq); 1456 1461 iwl_mvm_set_tkip_rx_seq(sc->tkip.unicast_rsc, key); 1462 + ieee80211_set_key_tx_seq(key, &seq); 1457 1463 break; 1458 1464 } 1459 - ieee80211_set_key_tx_seq(key, &seq); 1460 1465 1461 1466 /* that's it for this key */ 1462 1467 return;
+2 -2
drivers/net/wireless/iwlwifi/mvm/fw.c
··· 703 703 * abort after reading the nvm in case RF Kill is on, we will complete 704 704 * the init seq later when RF kill will switch to off 705 705 */ 706 - if (iwl_mvm_is_radio_killed(mvm)) { 706 + if (iwl_mvm_is_radio_hw_killed(mvm)) { 707 707 IWL_DEBUG_RF_KILL(mvm, 708 708 "jump over all phy activities due to RF kill\n"); 709 709 iwl_remove_notification(&mvm->notif_wait, &calib_wait); ··· 736 736 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait, 737 737 MVM_UCODE_CALIB_TIMEOUT); 738 738 739 - if (ret && iwl_mvm_is_radio_killed(mvm)) { 739 + if (ret && iwl_mvm_is_radio_hw_killed(mvm)) { 740 740 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n"); 741 741 ret = 1; 742 742 }
+1
drivers/net/wireless/iwlwifi/mvm/mac80211.c
··· 2388 2388 iwl_mvm_remove_time_event(mvm, mvmvif, 2389 2389 &mvmvif->time_event_data); 2390 2390 RCU_INIT_POINTER(mvm->csa_vif, NULL); 2391 + mvmvif->csa_countdown = false; 2391 2392 } 2392 2393 2393 2394 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) {
+5
drivers/net/wireless/iwlwifi/mvm/mvm.h
··· 860 860 test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status); 861 861 } 862 862 863 + static inline bool iwl_mvm_is_radio_hw_killed(struct iwl_mvm *mvm) 864 + { 865 + return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status); 866 + } 867 + 863 868 /* Must be called with rcu_read_lock() held and it can only be 864 869 * released when mvmsta is not needed anymore. 865 870 */
+1
drivers/net/wireless/iwlwifi/mvm/ops.c
··· 590 590 ieee80211_unregister_hw(mvm->hw); 591 591 iwl_mvm_leds_exit(mvm); 592 592 out_free: 593 + flush_delayed_work(&mvm->fw_dump_wk); 593 594 iwl_phy_db_free(mvm->phy_db); 594 595 kfree(mvm->scan_cmd); 595 596 if (!cfg->no_power_up_nic_in_init || !mvm->nvm_file_name)
+5
drivers/net/wireless/iwlwifi/pcie/drv.c
··· 414 414 {IWL_PCI_DEVICE(0x095A, 0x5590, iwl7265_2ac_cfg)}, 415 415 {IWL_PCI_DEVICE(0x095B, 0x5290, iwl7265_2ac_cfg)}, 416 416 {IWL_PCI_DEVICE(0x095A, 0x5490, iwl7265_2ac_cfg)}, 417 + {IWL_PCI_DEVICE(0x095A, 0x5F10, iwl7265_2ac_cfg)}, 418 + {IWL_PCI_DEVICE(0x095B, 0x5212, iwl7265_2ac_cfg)}, 419 + {IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)}, 420 + {IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)}, 421 + {IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)}, 417 422 418 423 /* 8000 Series */ 419 424 {IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)},
+1
drivers/net/wireless/rt2x00/rt2800usb.c
··· 1114 1114 { USB_DEVICE(0x0db0, 0x871c) }, 1115 1115 { USB_DEVICE(0x0db0, 0x899a) }, 1116 1116 /* Ovislink */ 1117 + { USB_DEVICE(0x1b75, 0x3070) }, 1117 1118 { USB_DEVICE(0x1b75, 0x3071) }, 1118 1119 { USB_DEVICE(0x1b75, 0x3072) }, 1119 1120 { USB_DEVICE(0x1b75, 0xa200) },
+2
drivers/net/wireless/rtlwifi/pci.h
··· 247 247 /* MSI support */ 248 248 bool msi_support; 249 249 bool using_msi; 250 + /* interrupt clear before set */ 251 + bool int_clear; 250 252 }; 251 253 252 254 struct mp_adapter {
+17
drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
··· 2253 2253 } 2254 2254 } 2255 2255 2256 + static void rtl8821ae_clear_interrupt(struct ieee80211_hw *hw) 2257 + { 2258 + struct rtl_priv *rtlpriv = rtl_priv(hw); 2259 + u32 tmp = rtl_read_dword(rtlpriv, REG_HISR); 2260 + 2261 + rtl_write_dword(rtlpriv, REG_HISR, tmp); 2262 + 2263 + tmp = rtl_read_dword(rtlpriv, REG_HISRE); 2264 + rtl_write_dword(rtlpriv, REG_HISRE, tmp); 2265 + 2266 + tmp = rtl_read_dword(rtlpriv, REG_HSISR); 2267 + rtl_write_dword(rtlpriv, REG_HSISR, tmp); 2268 + } 2269 + 2256 2270 void rtl8821ae_enable_interrupt(struct ieee80211_hw *hw) 2257 2271 { 2258 2272 struct rtl_priv *rtlpriv = rtl_priv(hw); 2259 2273 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 2274 + 2275 + if (!rtlpci->int_clear) 2276 + rtl8821ae_clear_interrupt(hw);/*clear it here first*/ 2260 2277 2261 2278 rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF); 2262 2279 rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF);
+5
drivers/net/wireless/rtlwifi/rtl8821ae/sw.c
··· 96 96 97 97 rtl8821ae_bt_reg_init(hw); 98 98 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support; 99 + rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear; 99 100 rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer(); 100 101 101 102 rtlpriv->dm.dm_initialgain_enable = 1; ··· 168 167 rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; 169 168 rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; 170 169 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support; 170 + rtlpci->msi_support = rtlpriv->cfg->mod_params->int_clear; 171 171 if (rtlpriv->cfg->mod_params->disable_watchdog) 172 172 pr_info("watchdog disabled\n"); 173 173 rtlpriv->psc.reg_fwctrl_lps = 3; ··· 310 308 .swctrl_lps = false, 311 309 .fwctrl_lps = true, 312 310 .msi_support = true, 311 + .int_clear = true, 313 312 .debug = DBG_EMERG, 314 313 .disable_watchdog = 0, 315 314 }; ··· 440 437 module_param_named(msi, rtl8821ae_mod_params.msi_support, bool, 0444); 441 438 module_param_named(disable_watchdog, rtl8821ae_mod_params.disable_watchdog, 442 439 bool, 0444); 440 + module_param_named(int_clear, rtl8821ae_mod_params.int_clear, bool, 0444); 443 441 MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); 444 442 MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); 445 443 MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); ··· 448 444 MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n"); 449 445 MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); 450 446 MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n"); 447 + MODULE_PARM_DESC(int_clear, "Set to 1 to disable interrupt clear before set (default 0)\n"); 451 448 452 449 static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); 453 450
+3
drivers/net/wireless/rtlwifi/wifi.h
··· 2249 2249 2250 2250 /* default 0: 1 means disable */ 2251 2251 bool disable_watchdog; 2252 + 2253 + /* default 0: 1 means do not disable interrupts */ 2254 + bool int_clear; 2252 2255 }; 2253 2256 2254 2257 struct rtl_hal_usbint_cfg {
+6
drivers/net/xen-netback/xenbus.c
··· 788 788 /* Use the number of queues requested by the frontend */ 789 789 be->vif->queues = vzalloc(requested_num_queues * 790 790 sizeof(struct xenvif_queue)); 791 + if (!be->vif->queues) { 792 + xenbus_dev_fatal(dev, -ENOMEM, 793 + "allocating queues"); 794 + return; 795 + } 796 + 791 797 be->vif->num_queues = requested_num_queues; 792 798 be->vif->stalled_queues = requested_num_queues; 793 799
+4
drivers/pci/msi.c
··· 1243 1243 BUG_ON(!chip); 1244 1244 if (!chip->irq_write_msi_msg) 1245 1245 chip->irq_write_msi_msg = pci_msi_domain_write_msg; 1246 + if (!chip->irq_mask) 1247 + chip->irq_mask = pci_msi_mask_irq; 1248 + if (!chip->irq_unmask) 1249 + chip->irq_unmask = pci_msi_unmask_irq; 1246 1250 } 1247 1251 1248 1252 /**
+8 -2
drivers/perf/arm_pmu.c
··· 823 823 } 824 824 825 825 /* Now look up the logical CPU number */ 826 - for_each_possible_cpu(cpu) 827 - if (dn == of_cpu_device_node_get(cpu)) 826 + for_each_possible_cpu(cpu) { 827 + struct device_node *cpu_dn; 828 + 829 + cpu_dn = of_cpu_device_node_get(cpu); 830 + of_node_put(cpu_dn); 831 + 832 + if (dn == cpu_dn) 828 833 break; 834 + } 829 835 830 836 if (cpu >= nr_cpu_ids) { 831 837 pr_warn("Failed to find logical CPU for %s\n",
+3 -1
drivers/pinctrl/freescale/pinctrl-imx25.c
··· 26 26 #include "pinctrl-imx.h" 27 27 28 28 enum imx25_pads { 29 - MX25_PAD_RESERVE0 = 1, 29 + MX25_PAD_RESERVE0 = 0, 30 + MX25_PAD_RESERVE1 = 1, 30 31 MX25_PAD_A10 = 2, 31 32 MX25_PAD_A13 = 3, 32 33 MX25_PAD_A14 = 4, ··· 170 169 /* Pad names for the pinmux subsystem */ 171 170 static const struct pinctrl_pin_desc imx25_pinctrl_pads[] = { 172 171 IMX_PINCTRL_PIN(MX25_PAD_RESERVE0), 172 + IMX_PINCTRL_PIN(MX25_PAD_RESERVE1), 173 173 IMX_PINCTRL_PIN(MX25_PAD_A10), 174 174 IMX_PINCTRL_PIN(MX25_PAD_A13), 175 175 IMX_PINCTRL_PIN(MX25_PAD_A14),
+1 -1
drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c
··· 653 653 SUNXI_FUNCTION(0x0, "gpio_in"), 654 654 SUNXI_FUNCTION(0x1, "gpio_out"), 655 655 SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */ 656 - SUNXI_FUNCTION(0x3, "uart3"), /* PWM1 */ 656 + SUNXI_FUNCTION(0x3, "pwm"), /* PWM1 */ 657 657 SUNXI_FUNCTION(0x5, "uart2"), /* CTS */ 658 658 SUNXI_FUNCTION_IRQ(0x6, 13)), /* EINT13 */ 659 659 };
+113 -113
drivers/pinctrl/uniphier/pinctrl-ph1-sld8.c
··· 22 22 #define DRIVER_NAME "ph1-sld8-pinctrl" 23 23 24 24 static const struct pinctrl_pin_desc ph1_sld8_pins[] = { 25 - UNIPHIER_PINCTRL_PIN(0, "PCA00", UNIPHIER_PIN_IECTRL_NONE, 25 + UNIPHIER_PINCTRL_PIN(0, "PCA00", 0, 26 26 15, UNIPHIER_PIN_DRV_4_8, 27 27 15, UNIPHIER_PIN_PULL_DOWN), 28 - UNIPHIER_PINCTRL_PIN(1, "PCA01", UNIPHIER_PIN_IECTRL_NONE, 28 + UNIPHIER_PINCTRL_PIN(1, "PCA01", 0, 29 29 16, UNIPHIER_PIN_DRV_4_8, 30 30 16, UNIPHIER_PIN_PULL_DOWN), 31 - UNIPHIER_PINCTRL_PIN(2, "PCA02", UNIPHIER_PIN_IECTRL_NONE, 31 + UNIPHIER_PINCTRL_PIN(2, "PCA02", 0, 32 32 17, UNIPHIER_PIN_DRV_4_8, 33 33 17, UNIPHIER_PIN_PULL_DOWN), 34 - UNIPHIER_PINCTRL_PIN(3, "PCA03", UNIPHIER_PIN_IECTRL_NONE, 34 + UNIPHIER_PINCTRL_PIN(3, "PCA03", 0, 35 35 18, UNIPHIER_PIN_DRV_4_8, 36 36 18, UNIPHIER_PIN_PULL_DOWN), 37 - UNIPHIER_PINCTRL_PIN(4, "PCA04", UNIPHIER_PIN_IECTRL_NONE, 37 + UNIPHIER_PINCTRL_PIN(4, "PCA04", 0, 38 38 19, UNIPHIER_PIN_DRV_4_8, 39 39 19, UNIPHIER_PIN_PULL_DOWN), 40 - UNIPHIER_PINCTRL_PIN(5, "PCA05", UNIPHIER_PIN_IECTRL_NONE, 40 + UNIPHIER_PINCTRL_PIN(5, "PCA05", 0, 41 41 20, UNIPHIER_PIN_DRV_4_8, 42 42 20, UNIPHIER_PIN_PULL_DOWN), 43 - UNIPHIER_PINCTRL_PIN(6, "PCA06", UNIPHIER_PIN_IECTRL_NONE, 43 + UNIPHIER_PINCTRL_PIN(6, "PCA06", 0, 44 44 21, UNIPHIER_PIN_DRV_4_8, 45 45 21, UNIPHIER_PIN_PULL_DOWN), 46 - UNIPHIER_PINCTRL_PIN(7, "PCA07", UNIPHIER_PIN_IECTRL_NONE, 46 + UNIPHIER_PINCTRL_PIN(7, "PCA07", 0, 47 47 22, UNIPHIER_PIN_DRV_4_8, 48 48 22, UNIPHIER_PIN_PULL_DOWN), 49 - UNIPHIER_PINCTRL_PIN(8, "PCA08", UNIPHIER_PIN_IECTRL_NONE, 49 + UNIPHIER_PINCTRL_PIN(8, "PCA08", 0, 50 50 23, UNIPHIER_PIN_DRV_4_8, 51 51 23, UNIPHIER_PIN_PULL_DOWN), 52 - UNIPHIER_PINCTRL_PIN(9, "PCA09", UNIPHIER_PIN_IECTRL_NONE, 52 + UNIPHIER_PINCTRL_PIN(9, "PCA09", 0, 53 53 24, UNIPHIER_PIN_DRV_4_8, 54 54 24, UNIPHIER_PIN_PULL_DOWN), 55 - UNIPHIER_PINCTRL_PIN(10, "PCA10", UNIPHIER_PIN_IECTRL_NONE, 55 + UNIPHIER_PINCTRL_PIN(10, "PCA10", 0, 56 56 25, UNIPHIER_PIN_DRV_4_8, 57 57 25, UNIPHIER_PIN_PULL_DOWN), 58 - UNIPHIER_PINCTRL_PIN(11, "PCA11", UNIPHIER_PIN_IECTRL_NONE, 58 + UNIPHIER_PINCTRL_PIN(11, "PCA11", 0, 59 59 26, UNIPHIER_PIN_DRV_4_8, 60 60 26, UNIPHIER_PIN_PULL_DOWN), 61 - UNIPHIER_PINCTRL_PIN(12, "PCA12", UNIPHIER_PIN_IECTRL_NONE, 61 + UNIPHIER_PINCTRL_PIN(12, "PCA12", 0, 62 62 27, UNIPHIER_PIN_DRV_4_8, 63 63 27, UNIPHIER_PIN_PULL_DOWN), 64 - UNIPHIER_PINCTRL_PIN(13, "PCA13", UNIPHIER_PIN_IECTRL_NONE, 64 + UNIPHIER_PINCTRL_PIN(13, "PCA13", 0, 65 65 28, UNIPHIER_PIN_DRV_4_8, 66 66 28, UNIPHIER_PIN_PULL_DOWN), 67 - UNIPHIER_PINCTRL_PIN(14, "PCA14", UNIPHIER_PIN_IECTRL_NONE, 67 + UNIPHIER_PINCTRL_PIN(14, "PCA14", 0, 68 68 29, UNIPHIER_PIN_DRV_4_8, 69 69 29, UNIPHIER_PIN_PULL_DOWN), 70 70 UNIPHIER_PINCTRL_PIN(15, "XNFRE_GB", UNIPHIER_PIN_IECTRL_NONE, ··· 118 118 UNIPHIER_PINCTRL_PIN(31, "NFD7_GB", UNIPHIER_PIN_IECTRL_NONE, 119 119 36, UNIPHIER_PIN_DRV_8_12_16_20, 120 120 128, UNIPHIER_PIN_PULL_UP), 121 - UNIPHIER_PINCTRL_PIN(32, "SDCLK", UNIPHIER_PIN_IECTRL_NONE, 121 + UNIPHIER_PINCTRL_PIN(32, "SDCLK", 8, 122 122 40, UNIPHIER_PIN_DRV_8_12_16_20, 123 123 -1, UNIPHIER_PIN_PULL_NONE), 124 - UNIPHIER_PINCTRL_PIN(33, "SDCMD", UNIPHIER_PIN_IECTRL_NONE, 124 + UNIPHIER_PINCTRL_PIN(33, "SDCMD", 8, 125 125 44, UNIPHIER_PIN_DRV_8_12_16_20, 126 126 -1, UNIPHIER_PIN_PULL_NONE), 127 - UNIPHIER_PINCTRL_PIN(34, "SDDAT0", UNIPHIER_PIN_IECTRL_NONE, 127 + UNIPHIER_PINCTRL_PIN(34, "SDDAT0", 8, 128 128 48, UNIPHIER_PIN_DRV_8_12_16_20, 129 129 -1, UNIPHIER_PIN_PULL_NONE), 130 - UNIPHIER_PINCTRL_PIN(35, "SDDAT1", UNIPHIER_PIN_IECTRL_NONE, 130 + UNIPHIER_PINCTRL_PIN(35, "SDDAT1", 8, 131 131 52, UNIPHIER_PIN_DRV_8_12_16_20, 132 132 -1, UNIPHIER_PIN_PULL_NONE), 133 - UNIPHIER_PINCTRL_PIN(36, "SDDAT2", UNIPHIER_PIN_IECTRL_NONE, 133 + UNIPHIER_PINCTRL_PIN(36, "SDDAT2", 8, 134 134 56, UNIPHIER_PIN_DRV_8_12_16_20, 135 135 -1, UNIPHIER_PIN_PULL_NONE), 136 - UNIPHIER_PINCTRL_PIN(37, "SDDAT3", UNIPHIER_PIN_IECTRL_NONE, 136 + UNIPHIER_PINCTRL_PIN(37, "SDDAT3", 8, 137 137 60, UNIPHIER_PIN_DRV_8_12_16_20, 138 138 -1, UNIPHIER_PIN_PULL_NONE), 139 - UNIPHIER_PINCTRL_PIN(38, "SDCD", UNIPHIER_PIN_IECTRL_NONE, 139 + UNIPHIER_PINCTRL_PIN(38, "SDCD", 8, 140 140 -1, UNIPHIER_PIN_DRV_FIXED_4, 141 141 129, UNIPHIER_PIN_PULL_DOWN), 142 - UNIPHIER_PINCTRL_PIN(39, "SDWP", UNIPHIER_PIN_IECTRL_NONE, 142 + UNIPHIER_PINCTRL_PIN(39, "SDWP", 8, 143 143 -1, UNIPHIER_PIN_DRV_FIXED_4, 144 144 130, UNIPHIER_PIN_PULL_DOWN), 145 - UNIPHIER_PINCTRL_PIN(40, "SDVOLC", UNIPHIER_PIN_IECTRL_NONE, 145 + UNIPHIER_PINCTRL_PIN(40, "SDVOLC", 9, 146 146 -1, UNIPHIER_PIN_DRV_FIXED_4, 147 147 131, UNIPHIER_PIN_PULL_DOWN), 148 - UNIPHIER_PINCTRL_PIN(41, "USB0VBUS", UNIPHIER_PIN_IECTRL_NONE, 148 + UNIPHIER_PINCTRL_PIN(41, "USB0VBUS", 0, 149 149 37, UNIPHIER_PIN_DRV_4_8, 150 150 37, UNIPHIER_PIN_PULL_DOWN), 151 - UNIPHIER_PINCTRL_PIN(42, "USB0OD", UNIPHIER_PIN_IECTRL_NONE, 151 + UNIPHIER_PINCTRL_PIN(42, "USB0OD", 0, 152 152 38, UNIPHIER_PIN_DRV_4_8, 153 153 38, UNIPHIER_PIN_PULL_DOWN), 154 - UNIPHIER_PINCTRL_PIN(43, "USB1VBUS", UNIPHIER_PIN_IECTRL_NONE, 154 + UNIPHIER_PINCTRL_PIN(43, "USB1VBUS", 0, 155 155 39, UNIPHIER_PIN_DRV_4_8, 156 156 39, UNIPHIER_PIN_PULL_DOWN), 157 - UNIPHIER_PINCTRL_PIN(44, "USB1OD", UNIPHIER_PIN_IECTRL_NONE, 157 + UNIPHIER_PINCTRL_PIN(44, "USB1OD", 0, 158 158 40, UNIPHIER_PIN_DRV_4_8, 159 159 40, UNIPHIER_PIN_PULL_DOWN), 160 - UNIPHIER_PINCTRL_PIN(45, "PCRESET", UNIPHIER_PIN_IECTRL_NONE, 160 + UNIPHIER_PINCTRL_PIN(45, "PCRESET", 0, 161 161 41, UNIPHIER_PIN_DRV_4_8, 162 162 41, UNIPHIER_PIN_PULL_DOWN), 163 - UNIPHIER_PINCTRL_PIN(46, "PCREG", UNIPHIER_PIN_IECTRL_NONE, 163 + UNIPHIER_PINCTRL_PIN(46, "PCREG", 0, 164 164 42, UNIPHIER_PIN_DRV_4_8, 165 165 42, UNIPHIER_PIN_PULL_DOWN), 166 - UNIPHIER_PINCTRL_PIN(47, "PCCE2", UNIPHIER_PIN_IECTRL_NONE, 166 + UNIPHIER_PINCTRL_PIN(47, "PCCE2", 0, 167 167 43, UNIPHIER_PIN_DRV_4_8, 168 168 43, UNIPHIER_PIN_PULL_DOWN), 169 - UNIPHIER_PINCTRL_PIN(48, "PCVS1", UNIPHIER_PIN_IECTRL_NONE, 169 + UNIPHIER_PINCTRL_PIN(48, "PCVS1", 0, 170 170 44, UNIPHIER_PIN_DRV_4_8, 171 171 44, UNIPHIER_PIN_PULL_DOWN), 172 - UNIPHIER_PINCTRL_PIN(49, "PCCD2", UNIPHIER_PIN_IECTRL_NONE, 172 + UNIPHIER_PINCTRL_PIN(49, "PCCD2", 0, 173 173 45, UNIPHIER_PIN_DRV_4_8, 174 174 45, UNIPHIER_PIN_PULL_DOWN), 175 - UNIPHIER_PINCTRL_PIN(50, "PCCD1", UNIPHIER_PIN_IECTRL_NONE, 175 + UNIPHIER_PINCTRL_PIN(50, "PCCD1", 0, 176 176 46, UNIPHIER_PIN_DRV_4_8, 177 177 46, UNIPHIER_PIN_PULL_DOWN), 178 - UNIPHIER_PINCTRL_PIN(51, "PCREADY", UNIPHIER_PIN_IECTRL_NONE, 178 + UNIPHIER_PINCTRL_PIN(51, "PCREADY", 0, 179 179 47, UNIPHIER_PIN_DRV_4_8, 180 180 47, UNIPHIER_PIN_PULL_DOWN), 181 - UNIPHIER_PINCTRL_PIN(52, "PCDOE", UNIPHIER_PIN_IECTRL_NONE, 181 + UNIPHIER_PINCTRL_PIN(52, "PCDOE", 0, 182 182 48, UNIPHIER_PIN_DRV_4_8, 183 183 48, UNIPHIER_PIN_PULL_DOWN), 184 - UNIPHIER_PINCTRL_PIN(53, "PCCE1", UNIPHIER_PIN_IECTRL_NONE, 184 + UNIPHIER_PINCTRL_PIN(53, "PCCE1", 0, 185 185 49, UNIPHIER_PIN_DRV_4_8, 186 186 49, UNIPHIER_PIN_PULL_DOWN), 187 - UNIPHIER_PINCTRL_PIN(54, "PCWE", UNIPHIER_PIN_IECTRL_NONE, 187 + UNIPHIER_PINCTRL_PIN(54, "PCWE", 0, 188 188 50, UNIPHIER_PIN_DRV_4_8, 189 189 50, UNIPHIER_PIN_PULL_DOWN), 190 - UNIPHIER_PINCTRL_PIN(55, "PCOE", UNIPHIER_PIN_IECTRL_NONE, 190 + UNIPHIER_PINCTRL_PIN(55, "PCOE", 0, 191 191 51, UNIPHIER_PIN_DRV_4_8, 192 192 51, UNIPHIER_PIN_PULL_DOWN), 193 - UNIPHIER_PINCTRL_PIN(56, "PCWAIT", UNIPHIER_PIN_IECTRL_NONE, 193 + UNIPHIER_PINCTRL_PIN(56, "PCWAIT", 0, 194 194 52, UNIPHIER_PIN_DRV_4_8, 195 195 52, UNIPHIER_PIN_PULL_DOWN), 196 - UNIPHIER_PINCTRL_PIN(57, "PCIOWR", UNIPHIER_PIN_IECTRL_NONE, 196 + UNIPHIER_PINCTRL_PIN(57, "PCIOWR", 0, 197 197 53, UNIPHIER_PIN_DRV_4_8, 198 198 53, UNIPHIER_PIN_PULL_DOWN), 199 - UNIPHIER_PINCTRL_PIN(58, "PCIORD", UNIPHIER_PIN_IECTRL_NONE, 199 + UNIPHIER_PINCTRL_PIN(58, "PCIORD", 0, 200 200 54, UNIPHIER_PIN_DRV_4_8, 201 201 54, UNIPHIER_PIN_PULL_DOWN), 202 - UNIPHIER_PINCTRL_PIN(59, "HS0DIN0", UNIPHIER_PIN_IECTRL_NONE, 202 + UNIPHIER_PINCTRL_PIN(59, "HS0DIN0", 0, 203 203 55, UNIPHIER_PIN_DRV_4_8, 204 204 55, UNIPHIER_PIN_PULL_DOWN), 205 - UNIPHIER_PINCTRL_PIN(60, "HS0DIN1", UNIPHIER_PIN_IECTRL_NONE, 205 + UNIPHIER_PINCTRL_PIN(60, "HS0DIN1", 0, 206 206 56, UNIPHIER_PIN_DRV_4_8, 207 207 56, UNIPHIER_PIN_PULL_DOWN), 208 - UNIPHIER_PINCTRL_PIN(61, "HS0DIN2", UNIPHIER_PIN_IECTRL_NONE, 208 + UNIPHIER_PINCTRL_PIN(61, "HS0DIN2", 0, 209 209 57, UNIPHIER_PIN_DRV_4_8, 210 210 57, UNIPHIER_PIN_PULL_DOWN), 211 - UNIPHIER_PINCTRL_PIN(62, "HS0DIN3", UNIPHIER_PIN_IECTRL_NONE, 211 + UNIPHIER_PINCTRL_PIN(62, "HS0DIN3", 0, 212 212 58, UNIPHIER_PIN_DRV_4_8, 213 213 58, UNIPHIER_PIN_PULL_DOWN), 214 - UNIPHIER_PINCTRL_PIN(63, "HS0DIN4", UNIPHIER_PIN_IECTRL_NONE, 214 + UNIPHIER_PINCTRL_PIN(63, "HS0DIN4", 0, 215 215 59, UNIPHIER_PIN_DRV_4_8, 216 216 59, UNIPHIER_PIN_PULL_DOWN), 217 - UNIPHIER_PINCTRL_PIN(64, "HS0DIN5", UNIPHIER_PIN_IECTRL_NONE, 217 + UNIPHIER_PINCTRL_PIN(64, "HS0DIN5", 0, 218 218 60, UNIPHIER_PIN_DRV_4_8, 219 219 60, UNIPHIER_PIN_PULL_DOWN), 220 - UNIPHIER_PINCTRL_PIN(65, "HS0DIN6", UNIPHIER_PIN_IECTRL_NONE, 220 + UNIPHIER_PINCTRL_PIN(65, "HS0DIN6", 0, 221 221 61, UNIPHIER_PIN_DRV_4_8, 222 222 61, UNIPHIER_PIN_PULL_DOWN), 223 - UNIPHIER_PINCTRL_PIN(66, "HS0DIN7", UNIPHIER_PIN_IECTRL_NONE, 223 + UNIPHIER_PINCTRL_PIN(66, "HS0DIN7", 0, 224 224 62, UNIPHIER_PIN_DRV_4_8, 225 225 62, UNIPHIER_PIN_PULL_DOWN), 226 - UNIPHIER_PINCTRL_PIN(67, "HS0BCLKIN", UNIPHIER_PIN_IECTRL_NONE, 226 + UNIPHIER_PINCTRL_PIN(67, "HS0BCLKIN", 0, 227 227 63, UNIPHIER_PIN_DRV_4_8, 228 228 63, UNIPHIER_PIN_PULL_DOWN), 229 - UNIPHIER_PINCTRL_PIN(68, "HS0VALIN", UNIPHIER_PIN_IECTRL_NONE, 229 + UNIPHIER_PINCTRL_PIN(68, "HS0VALIN", 0, 230 230 64, UNIPHIER_PIN_DRV_4_8, 231 231 64, UNIPHIER_PIN_PULL_DOWN), 232 - UNIPHIER_PINCTRL_PIN(69, "HS0SYNCIN", UNIPHIER_PIN_IECTRL_NONE, 232 + UNIPHIER_PINCTRL_PIN(69, "HS0SYNCIN", 0, 233 233 65, UNIPHIER_PIN_DRV_4_8, 234 234 65, UNIPHIER_PIN_PULL_DOWN), 235 - UNIPHIER_PINCTRL_PIN(70, "HSDOUT0", UNIPHIER_PIN_IECTRL_NONE, 235 + UNIPHIER_PINCTRL_PIN(70, "HSDOUT0", 0, 236 236 66, UNIPHIER_PIN_DRV_4_8, 237 237 66, UNIPHIER_PIN_PULL_DOWN), 238 - UNIPHIER_PINCTRL_PIN(71, "HSDOUT1", UNIPHIER_PIN_IECTRL_NONE, 238 + UNIPHIER_PINCTRL_PIN(71, "HSDOUT1", 0, 239 239 67, UNIPHIER_PIN_DRV_4_8, 240 240 67, UNIPHIER_PIN_PULL_DOWN), 241 - UNIPHIER_PINCTRL_PIN(72, "HSDOUT2", UNIPHIER_PIN_IECTRL_NONE, 241 + UNIPHIER_PINCTRL_PIN(72, "HSDOUT2", 0, 242 242 68, UNIPHIER_PIN_DRV_4_8, 243 243 68, UNIPHIER_PIN_PULL_DOWN), 244 - UNIPHIER_PINCTRL_PIN(73, "HSDOUT3", UNIPHIER_PIN_IECTRL_NONE, 244 + UNIPHIER_PINCTRL_PIN(73, "HSDOUT3", 0, 245 245 69, UNIPHIER_PIN_DRV_4_8, 246 246 69, UNIPHIER_PIN_PULL_DOWN), 247 - UNIPHIER_PINCTRL_PIN(74, "HSDOUT4", UNIPHIER_PIN_IECTRL_NONE, 247 + UNIPHIER_PINCTRL_PIN(74, "HSDOUT4", 0, 248 248 70, UNIPHIER_PIN_DRV_4_8, 249 249 70, UNIPHIER_PIN_PULL_DOWN), 250 - UNIPHIER_PINCTRL_PIN(75, "HSDOUT5", UNIPHIER_PIN_IECTRL_NONE, 250 + UNIPHIER_PINCTRL_PIN(75, "HSDOUT5", 0, 251 251 71, UNIPHIER_PIN_DRV_4_8, 252 252 71, UNIPHIER_PIN_PULL_DOWN), 253 - UNIPHIER_PINCTRL_PIN(76, "HSDOUT6", UNIPHIER_PIN_IECTRL_NONE, 253 + UNIPHIER_PINCTRL_PIN(76, "HSDOUT6", 0, 254 254 72, UNIPHIER_PIN_DRV_4_8, 255 255 72, UNIPHIER_PIN_PULL_DOWN), 256 - UNIPHIER_PINCTRL_PIN(77, "HSDOUT7", UNIPHIER_PIN_IECTRL_NONE, 256 + UNIPHIER_PINCTRL_PIN(77, "HSDOUT7", 0, 257 257 73, UNIPHIER_PIN_DRV_4_8, 258 258 73, UNIPHIER_PIN_PULL_DOWN), 259 - UNIPHIER_PINCTRL_PIN(78, "HSBCLKOUT", UNIPHIER_PIN_IECTRL_NONE, 259 + UNIPHIER_PINCTRL_PIN(78, "HSBCLKOUT", 0, 260 260 74, UNIPHIER_PIN_DRV_4_8, 261 261 74, UNIPHIER_PIN_PULL_DOWN), 262 - UNIPHIER_PINCTRL_PIN(79, "HSVALOUT", UNIPHIER_PIN_IECTRL_NONE, 262 + UNIPHIER_PINCTRL_PIN(79, "HSVALOUT", 0, 263 263 75, UNIPHIER_PIN_DRV_4_8, 264 264 75, UNIPHIER_PIN_PULL_DOWN), 265 - UNIPHIER_PINCTRL_PIN(80, "HSSYNCOUT", UNIPHIER_PIN_IECTRL_NONE, 265 + UNIPHIER_PINCTRL_PIN(80, "HSSYNCOUT", 0, 266 266 76, UNIPHIER_PIN_DRV_4_8, 267 267 76, UNIPHIER_PIN_PULL_DOWN), 268 - UNIPHIER_PINCTRL_PIN(81, "HS1DIN0", UNIPHIER_PIN_IECTRL_NONE, 268 + UNIPHIER_PINCTRL_PIN(81, "HS1DIN0", 0, 269 269 77, UNIPHIER_PIN_DRV_4_8, 270 270 77, UNIPHIER_PIN_PULL_DOWN), 271 - UNIPHIER_PINCTRL_PIN(82, "HS1DIN1", UNIPHIER_PIN_IECTRL_NONE, 271 + UNIPHIER_PINCTRL_PIN(82, "HS1DIN1", 0, 272 272 78, UNIPHIER_PIN_DRV_4_8, 273 273 78, UNIPHIER_PIN_PULL_DOWN), 274 - UNIPHIER_PINCTRL_PIN(83, "HS1DIN2", UNIPHIER_PIN_IECTRL_NONE, 274 + UNIPHIER_PINCTRL_PIN(83, "HS1DIN2", 0, 275 275 79, UNIPHIER_PIN_DRV_4_8, 276 276 79, UNIPHIER_PIN_PULL_DOWN), 277 - UNIPHIER_PINCTRL_PIN(84, "HS1DIN3", UNIPHIER_PIN_IECTRL_NONE, 277 + UNIPHIER_PINCTRL_PIN(84, "HS1DIN3", 0, 278 278 80, UNIPHIER_PIN_DRV_4_8, 279 279 80, UNIPHIER_PIN_PULL_DOWN), 280 - UNIPHIER_PINCTRL_PIN(85, "HS1DIN4", UNIPHIER_PIN_IECTRL_NONE, 280 + UNIPHIER_PINCTRL_PIN(85, "HS1DIN4", 0, 281 281 81, UNIPHIER_PIN_DRV_4_8, 282 282 81, UNIPHIER_PIN_PULL_DOWN), 283 - UNIPHIER_PINCTRL_PIN(86, "HS1DIN5", UNIPHIER_PIN_IECTRL_NONE, 283 + UNIPHIER_PINCTRL_PIN(86, "HS1DIN5", 0, 284 284 82, UNIPHIER_PIN_DRV_4_8, 285 285 82, UNIPHIER_PIN_PULL_DOWN), 286 - UNIPHIER_PINCTRL_PIN(87, "HS1DIN6", UNIPHIER_PIN_IECTRL_NONE, 286 + UNIPHIER_PINCTRL_PIN(87, "HS1DIN6", 0, 287 287 83, UNIPHIER_PIN_DRV_4_8, 288 288 83, UNIPHIER_PIN_PULL_DOWN), 289 - UNIPHIER_PINCTRL_PIN(88, "HS1DIN7", UNIPHIER_PIN_IECTRL_NONE, 289 + UNIPHIER_PINCTRL_PIN(88, "HS1DIN7", 0, 290 290 84, UNIPHIER_PIN_DRV_4_8, 291 291 84, UNIPHIER_PIN_PULL_DOWN), 292 - UNIPHIER_PINCTRL_PIN(89, "HS1BCLKIN", UNIPHIER_PIN_IECTRL_NONE, 292 + UNIPHIER_PINCTRL_PIN(89, "HS1BCLKIN", 0, 293 293 85, UNIPHIER_PIN_DRV_4_8, 294 294 85, UNIPHIER_PIN_PULL_DOWN), 295 - UNIPHIER_PINCTRL_PIN(90, "HS1VALIN", UNIPHIER_PIN_IECTRL_NONE, 295 + UNIPHIER_PINCTRL_PIN(90, "HS1VALIN", 0, 296 296 86, UNIPHIER_PIN_DRV_4_8, 297 297 86, UNIPHIER_PIN_PULL_DOWN), 298 - UNIPHIER_PINCTRL_PIN(91, "HS1SYNCIN", UNIPHIER_PIN_IECTRL_NONE, 298 + UNIPHIER_PINCTRL_PIN(91, "HS1SYNCIN", 0, 299 299 87, UNIPHIER_PIN_DRV_4_8, 300 300 87, UNIPHIER_PIN_PULL_DOWN), 301 - UNIPHIER_PINCTRL_PIN(92, "AGCI", UNIPHIER_PIN_IECTRL_NONE, 301 + UNIPHIER_PINCTRL_PIN(92, "AGCI", 3, 302 302 -1, UNIPHIER_PIN_DRV_FIXED_4, 303 303 132, UNIPHIER_PIN_PULL_DOWN), 304 - UNIPHIER_PINCTRL_PIN(93, "AGCR", UNIPHIER_PIN_IECTRL_NONE, 304 + UNIPHIER_PINCTRL_PIN(93, "AGCR", 4, 305 305 -1, UNIPHIER_PIN_DRV_FIXED_4, 306 306 133, UNIPHIER_PIN_PULL_DOWN), 307 - UNIPHIER_PINCTRL_PIN(94, "AGCBS", UNIPHIER_PIN_IECTRL_NONE, 307 + UNIPHIER_PINCTRL_PIN(94, "AGCBS", 5, 308 308 -1, UNIPHIER_PIN_DRV_FIXED_4, 309 309 134, UNIPHIER_PIN_PULL_DOWN), 310 - UNIPHIER_PINCTRL_PIN(95, "IECOUT", UNIPHIER_PIN_IECTRL_NONE, 310 + UNIPHIER_PINCTRL_PIN(95, "IECOUT", 0, 311 311 88, UNIPHIER_PIN_DRV_4_8, 312 312 88, UNIPHIER_PIN_PULL_DOWN), 313 - UNIPHIER_PINCTRL_PIN(96, "ASMCK", UNIPHIER_PIN_IECTRL_NONE, 313 + UNIPHIER_PINCTRL_PIN(96, "ASMCK", 0, 314 314 89, UNIPHIER_PIN_DRV_4_8, 315 315 89, UNIPHIER_PIN_PULL_DOWN), 316 316 UNIPHIER_PINCTRL_PIN(97, "ABCKO", UNIPHIER_PIN_IECTRL_NONE, ··· 325 325 UNIPHIER_PINCTRL_PIN(100, "ASDOUT1", UNIPHIER_PIN_IECTRL_NONE, 326 326 93, UNIPHIER_PIN_DRV_4_8, 327 327 93, UNIPHIER_PIN_PULL_UP), 328 - UNIPHIER_PINCTRL_PIN(101, "ARCOUT", UNIPHIER_PIN_IECTRL_NONE, 328 + UNIPHIER_PINCTRL_PIN(101, "ARCOUT", 0, 329 329 94, UNIPHIER_PIN_DRV_4_8, 330 330 94, UNIPHIER_PIN_PULL_DOWN), 331 - UNIPHIER_PINCTRL_PIN(102, "SDA0", UNIPHIER_PIN_IECTRL_NONE, 331 + UNIPHIER_PINCTRL_PIN(102, "SDA0", 10, 332 332 -1, UNIPHIER_PIN_DRV_FIXED_4, 333 333 -1, UNIPHIER_PIN_PULL_NONE), 334 - UNIPHIER_PINCTRL_PIN(103, "SCL0", UNIPHIER_PIN_IECTRL_NONE, 334 + UNIPHIER_PINCTRL_PIN(103, "SCL0", 10, 335 335 -1, UNIPHIER_PIN_DRV_FIXED_4, 336 336 -1, UNIPHIER_PIN_PULL_NONE), 337 - UNIPHIER_PINCTRL_PIN(104, "SDA1", UNIPHIER_PIN_IECTRL_NONE, 337 + UNIPHIER_PINCTRL_PIN(104, "SDA1", 11, 338 338 -1, UNIPHIER_PIN_DRV_FIXED_4, 339 339 -1, UNIPHIER_PIN_PULL_NONE), 340 - UNIPHIER_PINCTRL_PIN(105, "SCL1", UNIPHIER_PIN_IECTRL_NONE, 340 + UNIPHIER_PINCTRL_PIN(105, "SCL1", 11, 341 341 -1, UNIPHIER_PIN_DRV_FIXED_4, 342 342 -1, UNIPHIER_PIN_PULL_NONE), 343 - UNIPHIER_PINCTRL_PIN(106, "DMDSDA0", UNIPHIER_PIN_IECTRL_NONE, 343 + UNIPHIER_PINCTRL_PIN(106, "DMDSDA0", 12, 344 344 -1, UNIPHIER_PIN_DRV_FIXED_4, 345 345 -1, UNIPHIER_PIN_PULL_NONE), 346 - UNIPHIER_PINCTRL_PIN(107, "DMDSCL0", UNIPHIER_PIN_IECTRL_NONE, 346 + UNIPHIER_PINCTRL_PIN(107, "DMDSCL0", 12, 347 347 -1, UNIPHIER_PIN_DRV_FIXED_4, 348 348 -1, UNIPHIER_PIN_PULL_NONE), 349 - UNIPHIER_PINCTRL_PIN(108, "DMDSDA1", UNIPHIER_PIN_IECTRL_NONE, 349 + UNIPHIER_PINCTRL_PIN(108, "DMDSDA1", 13, 350 350 -1, UNIPHIER_PIN_DRV_FIXED_4, 351 351 -1, UNIPHIER_PIN_PULL_NONE), 352 - UNIPHIER_PINCTRL_PIN(109, "DMDSCL1", UNIPHIER_PIN_IECTRL_NONE, 352 + UNIPHIER_PINCTRL_PIN(109, "DMDSCL1", 13, 353 353 -1, UNIPHIER_PIN_DRV_FIXED_4, 354 354 -1, UNIPHIER_PIN_PULL_NONE), 355 355 UNIPHIER_PINCTRL_PIN(110, "SBO0", UNIPHIER_PIN_IECTRL_NONE, ··· 358 358 UNIPHIER_PINCTRL_PIN(111, "SBI0", UNIPHIER_PIN_IECTRL_NONE, 359 359 96, UNIPHIER_PIN_DRV_4_8, 360 360 96, UNIPHIER_PIN_PULL_UP), 361 - UNIPHIER_PINCTRL_PIN(112, "SBO1", UNIPHIER_PIN_IECTRL_NONE, 361 + UNIPHIER_PINCTRL_PIN(112, "SBO1", 0, 362 362 97, UNIPHIER_PIN_DRV_4_8, 363 363 97, UNIPHIER_PIN_PULL_UP), 364 - UNIPHIER_PINCTRL_PIN(113, "SBI1", UNIPHIER_PIN_IECTRL_NONE, 364 + UNIPHIER_PINCTRL_PIN(113, "SBI1", 0, 365 365 98, UNIPHIER_PIN_DRV_4_8, 366 366 98, UNIPHIER_PIN_PULL_UP), 367 - UNIPHIER_PINCTRL_PIN(114, "TXD1", UNIPHIER_PIN_IECTRL_NONE, 367 + UNIPHIER_PINCTRL_PIN(114, "TXD1", 0, 368 368 99, UNIPHIER_PIN_DRV_4_8, 369 369 99, UNIPHIER_PIN_PULL_UP), 370 - UNIPHIER_PINCTRL_PIN(115, "RXD1", UNIPHIER_PIN_IECTRL_NONE, 370 + UNIPHIER_PINCTRL_PIN(115, "RXD1", 0, 371 371 100, UNIPHIER_PIN_DRV_4_8, 372 372 100, UNIPHIER_PIN_PULL_UP), 373 - UNIPHIER_PINCTRL_PIN(116, "HIN", UNIPHIER_PIN_IECTRL_NONE, 373 + UNIPHIER_PINCTRL_PIN(116, "HIN", 1, 374 374 -1, UNIPHIER_PIN_DRV_FIXED_5, 375 375 -1, UNIPHIER_PIN_PULL_NONE), 376 - UNIPHIER_PINCTRL_PIN(117, "VIN", UNIPHIER_PIN_IECTRL_NONE, 376 + UNIPHIER_PINCTRL_PIN(117, "VIN", 2, 377 377 -1, UNIPHIER_PIN_DRV_FIXED_5, 378 378 -1, UNIPHIER_PIN_PULL_NONE), 379 - UNIPHIER_PINCTRL_PIN(118, "TCON0", UNIPHIER_PIN_IECTRL_NONE, 379 + UNIPHIER_PINCTRL_PIN(118, "TCON0", 0, 380 380 101, UNIPHIER_PIN_DRV_4_8, 381 381 101, UNIPHIER_PIN_PULL_DOWN), 382 - UNIPHIER_PINCTRL_PIN(119, "TCON1", UNIPHIER_PIN_IECTRL_NONE, 382 + UNIPHIER_PINCTRL_PIN(119, "TCON1", 0, 383 383 102, UNIPHIER_PIN_DRV_4_8, 384 384 102, UNIPHIER_PIN_PULL_DOWN), 385 - UNIPHIER_PINCTRL_PIN(120, "TCON2", UNIPHIER_PIN_IECTRL_NONE, 385 + UNIPHIER_PINCTRL_PIN(120, "TCON2", 0, 386 386 103, UNIPHIER_PIN_DRV_4_8, 387 387 103, UNIPHIER_PIN_PULL_DOWN), 388 - UNIPHIER_PINCTRL_PIN(121, "TCON3", UNIPHIER_PIN_IECTRL_NONE, 388 + UNIPHIER_PINCTRL_PIN(121, "TCON3", 0, 389 389 104, UNIPHIER_PIN_DRV_4_8, 390 390 104, UNIPHIER_PIN_PULL_DOWN), 391 - UNIPHIER_PINCTRL_PIN(122, "TCON4", UNIPHIER_PIN_IECTRL_NONE, 391 + UNIPHIER_PINCTRL_PIN(122, "TCON4", 0, 392 392 105, UNIPHIER_PIN_DRV_4_8, 393 393 105, UNIPHIER_PIN_PULL_DOWN), 394 - UNIPHIER_PINCTRL_PIN(123, "TCON5", UNIPHIER_PIN_IECTRL_NONE, 394 + UNIPHIER_PINCTRL_PIN(123, "TCON5", 0, 395 395 106, UNIPHIER_PIN_DRV_4_8, 396 396 106, UNIPHIER_PIN_PULL_DOWN), 397 - UNIPHIER_PINCTRL_PIN(124, "TCON6", UNIPHIER_PIN_IECTRL_NONE, 397 + UNIPHIER_PINCTRL_PIN(124, "TCON6", 0, 398 398 107, UNIPHIER_PIN_DRV_4_8, 399 399 107, UNIPHIER_PIN_PULL_DOWN), 400 - UNIPHIER_PINCTRL_PIN(125, "TCON7", UNIPHIER_PIN_IECTRL_NONE, 400 + UNIPHIER_PINCTRL_PIN(125, "TCON7", 0, 401 401 108, UNIPHIER_PIN_DRV_4_8, 402 402 108, UNIPHIER_PIN_PULL_DOWN), 403 - UNIPHIER_PINCTRL_PIN(126, "TCON8", UNIPHIER_PIN_IECTRL_NONE, 403 + UNIPHIER_PINCTRL_PIN(126, "TCON8", 0, 404 404 109, UNIPHIER_PIN_DRV_4_8, 405 405 109, UNIPHIER_PIN_PULL_DOWN), 406 - UNIPHIER_PINCTRL_PIN(127, "PWMA", UNIPHIER_PIN_IECTRL_NONE, 406 + UNIPHIER_PINCTRL_PIN(127, "PWMA", 0, 407 407 110, UNIPHIER_PIN_DRV_4_8, 408 408 110, UNIPHIER_PIN_PULL_DOWN), 409 - UNIPHIER_PINCTRL_PIN(128, "XIRQ0", UNIPHIER_PIN_IECTRL_NONE, 409 + UNIPHIER_PINCTRL_PIN(128, "XIRQ0", 0, 410 410 111, UNIPHIER_PIN_DRV_4_8, 411 411 111, UNIPHIER_PIN_PULL_DOWN), 412 - UNIPHIER_PINCTRL_PIN(129, "XIRQ1", UNIPHIER_PIN_IECTRL_NONE, 412 + UNIPHIER_PINCTRL_PIN(129, "XIRQ1", 0, 413 413 112, UNIPHIER_PIN_DRV_4_8, 414 414 112, UNIPHIER_PIN_PULL_DOWN), 415 - UNIPHIER_PINCTRL_PIN(130, "XIRQ2", UNIPHIER_PIN_IECTRL_NONE, 415 + UNIPHIER_PINCTRL_PIN(130, "XIRQ2", 0, 416 416 113, UNIPHIER_PIN_DRV_4_8, 417 417 113, UNIPHIER_PIN_PULL_DOWN), 418 - UNIPHIER_PINCTRL_PIN(131, "XIRQ3", UNIPHIER_PIN_IECTRL_NONE, 418 + UNIPHIER_PINCTRL_PIN(131, "XIRQ3", 0, 419 419 114, UNIPHIER_PIN_DRV_4_8, 420 420 114, UNIPHIER_PIN_PULL_DOWN), 421 - UNIPHIER_PINCTRL_PIN(132, "XIRQ4", UNIPHIER_PIN_IECTRL_NONE, 421 + UNIPHIER_PINCTRL_PIN(132, "XIRQ4", 0, 422 422 115, UNIPHIER_PIN_DRV_4_8, 423 423 115, UNIPHIER_PIN_PULL_DOWN), 424 - UNIPHIER_PINCTRL_PIN(133, "XIRQ5", UNIPHIER_PIN_IECTRL_NONE, 424 + UNIPHIER_PINCTRL_PIN(133, "XIRQ5", 0, 425 425 116, UNIPHIER_PIN_DRV_4_8, 426 426 116, UNIPHIER_PIN_PULL_DOWN), 427 - UNIPHIER_PINCTRL_PIN(134, "XIRQ6", UNIPHIER_PIN_IECTRL_NONE, 427 + UNIPHIER_PINCTRL_PIN(134, "XIRQ6", 0, 428 428 117, UNIPHIER_PIN_DRV_4_8, 429 429 117, UNIPHIER_PIN_PULL_DOWN), 430 - UNIPHIER_PINCTRL_PIN(135, "XIRQ7", UNIPHIER_PIN_IECTRL_NONE, 430 + UNIPHIER_PINCTRL_PIN(135, "XIRQ7", 0, 431 431 118, UNIPHIER_PIN_DRV_4_8, 432 432 118, UNIPHIER_PIN_PULL_DOWN), 433 433 };
+1 -1
drivers/staging/iio/accel/sca3000_ring.c
··· 116 116 if (ret) 117 117 goto error_ret; 118 118 119 - for (i = 0; i < num_read; i++) 119 + for (i = 0; i < num_read / sizeof(u16); i++) 120 120 *(((u16 *)rx) + i) = be16_to_cpup((__be16 *)rx + i); 121 121 122 122 if (copy_to_user(buf, rx, num_read))
+5 -4
drivers/staging/iio/adc/mxs-lradc.c
··· 930 930 case IIO_CHAN_INFO_OFFSET: 931 931 if (chan->type == IIO_TEMP) { 932 932 /* The calculated value from the ADC is in Kelvin, we 933 - * want Celsius for hwmon so the offset is 934 - * -272.15 * scale 933 + * want Celsius for hwmon so the offset is -273.15 934 + * The offset is applied before scaling so it is 935 + * actually -213.15 * 4 / 1.012 = -1079.644268 935 936 */ 936 - *val = -1075; 937 - *val2 = 691699; 937 + *val = -1079; 938 + *val2 = 644268; 938 939 939 940 return IIO_VAL_INT_PLUS_MICRO; 940 941 }
+1 -1
drivers/staging/lustre/lustre/llite/dir.c
··· 224 224 225 225 prefetchw(&page->flags); 226 226 ret = add_to_page_cache_lru(page, inode->i_mapping, offset, 227 - GFP_KERNEL); 227 + GFP_NOFS); 228 228 if (ret == 0) { 229 229 unlock_page(page); 230 230 } else {
+1 -1
drivers/thermal/samsung/exynos_tmu.c
··· 932 932 933 933 if (data->soc == SOC_ARCH_EXYNOS5260) 934 934 emul_con = EXYNOS5260_EMUL_CON; 935 - if (data->soc == SOC_ARCH_EXYNOS5433) 935 + else if (data->soc == SOC_ARCH_EXYNOS5433) 936 936 emul_con = EXYNOS5433_TMU_EMUL_CON; 937 937 else if (data->soc == SOC_ARCH_EXYNOS7) 938 938 emul_con = EXYNOS7_TMU_REG_EMUL_CON;
-4
drivers/tty/serial/8250/8250_dma.c
··· 80 80 return 0; 81 81 82 82 dma->tx_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); 83 - if (dma->tx_size < p->port.fifosize) { 84 - ret = -EINVAL; 85 - goto err; 86 - } 87 83 88 84 desc = dmaengine_prep_slave_single(dma->txchan, 89 85 dma->tx_addr + xmit->tail,
+1
drivers/usb/host/xhci-pci.c
··· 147 147 if (pdev->vendor == PCI_VENDOR_ID_INTEL && 148 148 pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) { 149 149 xhci->quirks |= XHCI_SPURIOUS_REBOOT; 150 + xhci->quirks |= XHCI_SPURIOUS_WAKEUP; 150 151 } 151 152 if (pdev->vendor == PCI_VENDOR_ID_INTEL && 152 153 (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
+25 -5
drivers/usb/host/xhci-ring.c
··· 2191 2191 } 2192 2192 /* Fast path - was this the last TRB in the TD for this URB? */ 2193 2193 } else if (event_trb == td->last_trb) { 2194 + if (td->urb_length_set && trb_comp_code == COMP_SHORT_TX) 2195 + return finish_td(xhci, td, event_trb, event, ep, 2196 + status, false); 2197 + 2194 2198 if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { 2195 2199 td->urb->actual_length = 2196 2200 td->urb->transfer_buffer_length - ··· 2246 2242 td->urb->actual_length += 2247 2243 TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) - 2248 2244 EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); 2245 + 2246 + if (trb_comp_code == COMP_SHORT_TX) { 2247 + xhci_dbg(xhci, "mid bulk/intr SP, wait for last TRB event\n"); 2248 + td->urb_length_set = true; 2249 + return 0; 2250 + } 2249 2251 } 2250 2252 2251 2253 return finish_td(xhci, td, event_trb, event, ep, status, false); ··· 2284 2274 u32 trb_comp_code; 2285 2275 int ret = 0; 2286 2276 int td_num = 0; 2277 + bool handling_skipped_tds = false; 2287 2278 2288 2279 slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags)); 2289 2280 xdev = xhci->devs[slot_id]; ··· 2420 2409 */ 2421 2410 ep->skip = true; 2422 2411 xhci_dbg(xhci, "Miss service interval error, set skip flag\n"); 2412 + goto cleanup; 2413 + case COMP_PING_ERR: 2414 + ep->skip = true; 2415 + xhci_dbg(xhci, "No Ping response error, Skip one Isoc TD\n"); 2423 2416 goto cleanup; 2424 2417 default: 2425 2418 if (xhci_is_vendor_info_code(xhci, trb_comp_code)) { ··· 2561 2546 ep, &status); 2562 2547 2563 2548 cleanup: 2549 + 2550 + 2551 + handling_skipped_tds = ep->skip && 2552 + trb_comp_code != COMP_MISSED_INT && 2553 + trb_comp_code != COMP_PING_ERR; 2554 + 2564 2555 /* 2565 - * Do not update event ring dequeue pointer if ep->skip is set. 2566 - * Will roll back to continue process missed tds. 2556 + * Do not update event ring dequeue pointer if we're in a loop 2557 + * processing missed tds. 2567 2558 */ 2568 - if (trb_comp_code == COMP_MISSED_INT || !ep->skip) { 2559 + if (!handling_skipped_tds) 2569 2560 inc_deq(xhci, xhci->event_ring); 2570 - } 2571 2561 2572 2562 if (ret) { 2573 2563 urb = td->urb; ··· 2607 2587 * Process them as short transfer until reach the td pointed by 2608 2588 * the event. 2609 2589 */ 2610 - } while (ep->skip && trb_comp_code != COMP_MISSED_INT); 2590 + } while (handling_skipped_tds); 2611 2591 2612 2592 return 0; 2613 2593 }
+1
drivers/video/console/fbcon.c
··· 1093 1093 con_copy_unimap(vc, svc); 1094 1094 1095 1095 ops = info->fbcon_par; 1096 + ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms); 1096 1097 p->con_rotate = initial_rotation; 1097 1098 set_blitting_type(vc, info); 1098 1099
+3 -5
fs/btrfs/backref.c
··· 1828 1828 int found = 0; 1829 1829 struct extent_buffer *eb; 1830 1830 struct btrfs_inode_extref *extref; 1831 - struct extent_buffer *leaf; 1832 1831 u32 item_size; 1833 1832 u32 cur_offset; 1834 1833 unsigned long ptr; ··· 1855 1856 btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); 1856 1857 btrfs_release_path(path); 1857 1858 1858 - leaf = path->nodes[0]; 1859 - item_size = btrfs_item_size_nr(leaf, slot); 1860 - ptr = btrfs_item_ptr_offset(leaf, slot); 1859 + item_size = btrfs_item_size_nr(eb, slot); 1860 + ptr = btrfs_item_ptr_offset(eb, slot); 1861 1861 cur_offset = 0; 1862 1862 1863 1863 while (cur_offset < item_size) { ··· 1870 1872 if (ret) 1871 1873 break; 1872 1874 1873 - cur_offset += btrfs_inode_extref_name_len(leaf, extref); 1875 + cur_offset += btrfs_inode_extref_name_len(eb, extref); 1874 1876 cur_offset += sizeof(*extref); 1875 1877 } 1876 1878 btrfs_tree_read_unlock_blocking(eb);
+1 -1
fs/btrfs/file.c
··· 2584 2584 alloc_start); 2585 2585 if (ret) 2586 2586 goto out; 2587 - } else { 2587 + } else if (offset + len > inode->i_size) { 2588 2588 /* 2589 2589 * If we are fallocating from the end of the file onward we 2590 2590 * need to zero out the end of the page if i_size lands in the
+8
fs/btrfs/ioctl.c
··· 4639 4639 bctl->flags |= BTRFS_BALANCE_TYPE_MASK; 4640 4640 } 4641 4641 4642 + if (bctl->flags & ~(BTRFS_BALANCE_ARGS_MASK | BTRFS_BALANCE_TYPE_MASK)) { 4643 + ret = -EINVAL; 4644 + goto out_bctl; 4645 + } 4646 + 4642 4647 do_balance: 4643 4648 /* 4644 4649 * Ownership of bctl and mutually_exclusive_operation_running ··· 4655 4650 need_unlock = false; 4656 4651 4657 4652 ret = btrfs_balance(bctl, bargs); 4653 + bctl = NULL; 4658 4654 4659 4655 if (arg) { 4660 4656 if (copy_to_user(arg, bargs, sizeof(*bargs))) 4661 4657 ret = -EFAULT; 4662 4658 } 4663 4659 4660 + out_bctl: 4661 + kfree(bctl); 4664 4662 out_bargs: 4665 4663 kfree(bargs); 4666 4664 out_unlock:
+8
fs/btrfs/volumes.h
··· 376 376 #define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4) 377 377 #define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5) 378 378 379 + #define BTRFS_BALANCE_ARGS_MASK \ 380 + (BTRFS_BALANCE_ARGS_PROFILES | \ 381 + BTRFS_BALANCE_ARGS_USAGE | \ 382 + BTRFS_BALANCE_ARGS_DEVID | \ 383 + BTRFS_BALANCE_ARGS_DRANGE | \ 384 + BTRFS_BALANCE_ARGS_VRANGE | \ 385 + BTRFS_BALANCE_ARGS_LIMIT) 386 + 379 387 /* 380 388 * Profile changing flags. When SOFT is set we won't relocate chunk if 381 389 * it already has the target profile (even though it may be
+3 -3
fs/cifs/file.c
··· 3380 3380 struct page *page, *tpage; 3381 3381 unsigned int expected_index; 3382 3382 int rc; 3383 + gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(mapping); 3383 3384 3384 3385 INIT_LIST_HEAD(tmplist); 3385 3386 ··· 3393 3392 */ 3394 3393 __set_page_locked(page); 3395 3394 rc = add_to_page_cache_locked(page, mapping, 3396 - page->index, GFP_KERNEL); 3395 + page->index, gfp); 3397 3396 3398 3397 /* give up if we can't stick it in the cache */ 3399 3398 if (rc) { ··· 3419 3418 break; 3420 3419 3421 3420 __set_page_locked(page); 3422 - if (add_to_page_cache_locked(page, mapping, page->index, 3423 - GFP_KERNEL)) { 3421 + if (add_to_page_cache_locked(page, mapping, page->index, gfp)) { 3424 3422 __clear_page_locked(page); 3425 3423 break; 3426 3424 }
+29 -41
fs/dax.c
··· 285 285 static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh, 286 286 struct vm_area_struct *vma, struct vm_fault *vmf) 287 287 { 288 + struct address_space *mapping = inode->i_mapping; 288 289 sector_t sector = bh->b_blocknr << (inode->i_blkbits - 9); 289 290 unsigned long vaddr = (unsigned long)vmf->virtual_address; 290 291 void __pmem *addr; 291 292 unsigned long pfn; 292 293 pgoff_t size; 293 294 int error; 295 + 296 + i_mmap_lock_read(mapping); 294 297 295 298 /* 296 299 * Check truncate didn't happen while we were allocating a block. ··· 324 321 error = vm_insert_mixed(vma, vaddr, pfn); 325 322 326 323 out: 324 + i_mmap_unlock_read(mapping); 325 + 327 326 return error; 328 327 } 329 328 ··· 387 382 * from a read fault and we've raced with a truncate 388 383 */ 389 384 error = -EIO; 390 - goto unlock; 385 + goto unlock_page; 391 386 } 392 - } else { 393 - i_mmap_lock_write(mapping); 394 387 } 395 388 396 389 error = get_block(inode, block, &bh, 0); 397 390 if (!error && (bh.b_size < PAGE_SIZE)) 398 391 error = -EIO; /* fs corruption? */ 399 392 if (error) 400 - goto unlock; 393 + goto unlock_page; 401 394 402 395 if (!buffer_mapped(&bh) && !buffer_unwritten(&bh) && !vmf->cow_page) { 403 396 if (vmf->flags & FAULT_FLAG_WRITE) { ··· 406 403 if (!error && (bh.b_size < PAGE_SIZE)) 407 404 error = -EIO; 408 405 if (error) 409 - goto unlock; 406 + goto unlock_page; 410 407 } else { 411 - i_mmap_unlock_write(mapping); 412 408 return dax_load_hole(mapping, page, vmf); 413 409 } 414 410 } ··· 419 417 else 420 418 clear_user_highpage(new_page, vaddr); 421 419 if (error) 422 - goto unlock; 420 + goto unlock_page; 423 421 vmf->page = page; 424 422 if (!page) { 423 + i_mmap_lock_read(mapping); 425 424 /* Check we didn't race with truncate */ 426 425 size = (i_size_read(inode) + PAGE_SIZE - 1) >> 427 426 PAGE_SHIFT; 428 427 if (vmf->pgoff >= size) { 428 + i_mmap_unlock_read(mapping); 429 429 error = -EIO; 430 - goto unlock; 430 + goto out; 431 431 } 432 432 } 433 433 return VM_FAULT_LOCKED; ··· 465 461 WARN_ON_ONCE(!(vmf->flags & FAULT_FLAG_WRITE)); 466 462 } 467 463 468 - if (!page) 469 - i_mmap_unlock_write(mapping); 470 464 out: 471 465 if (error == -ENOMEM) 472 466 return VM_FAULT_OOM | major; ··· 473 471 return VM_FAULT_SIGBUS | major; 474 472 return VM_FAULT_NOPAGE | major; 475 473 476 - unlock: 474 + unlock_page: 477 475 if (page) { 478 476 unlock_page(page); 479 477 page_cache_release(page); 480 - } else { 481 - i_mmap_unlock_write(mapping); 482 478 } 483 - 484 479 goto out; 485 480 } 486 481 EXPORT_SYMBOL(__dax_fault); ··· 555 556 block = (sector_t)pgoff << (PAGE_SHIFT - blkbits); 556 557 557 558 bh.b_size = PMD_SIZE; 558 - i_mmap_lock_write(mapping); 559 559 length = get_block(inode, block, &bh, write); 560 560 if (length) 561 561 return VM_FAULT_SIGBUS; 562 + i_mmap_lock_read(mapping); 562 563 563 564 /* 564 565 * If the filesystem isn't willing to tell us the length of a hole, ··· 568 569 if (!buffer_size_valid(&bh) || bh.b_size < PMD_SIZE) 569 570 goto fallback; 570 571 571 - sector = bh.b_blocknr << (blkbits - 9); 572 - 573 - if (buffer_unwritten(&bh) || buffer_new(&bh)) { 574 - int i; 575 - 576 - length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn, 577 - bh.b_size); 578 - if (length < 0) { 579 - result = VM_FAULT_SIGBUS; 580 - goto out; 581 - } 582 - if ((length < PMD_SIZE) || (pfn & PG_PMD_COLOUR)) 583 - goto fallback; 584 - 585 - for (i = 0; i < PTRS_PER_PMD; i++) 586 - clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE); 587 - wmb_pmem(); 588 - count_vm_event(PGMAJFAULT); 589 - mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT); 590 - result |= VM_FAULT_MAJOR; 591 - } 592 - 593 572 /* 594 573 * If we allocated new storage, make sure no process has any 595 574 * zero pages covering this hole 596 575 */ 597 576 if (buffer_new(&bh)) { 598 - i_mmap_unlock_write(mapping); 577 + i_mmap_unlock_read(mapping); 599 578 unmap_mapping_range(mapping, pgoff << PAGE_SHIFT, PMD_SIZE, 0); 600 - i_mmap_lock_write(mapping); 579 + i_mmap_lock_read(mapping); 601 580 } 602 581 603 582 /* ··· 612 635 result = VM_FAULT_NOPAGE; 613 636 spin_unlock(ptl); 614 637 } else { 638 + sector = bh.b_blocknr << (blkbits - 9); 615 639 length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn, 616 640 bh.b_size); 617 641 if (length < 0) { ··· 622 644 if ((length < PMD_SIZE) || (pfn & PG_PMD_COLOUR)) 623 645 goto fallback; 624 646 647 + if (buffer_unwritten(&bh) || buffer_new(&bh)) { 648 + int i; 649 + for (i = 0; i < PTRS_PER_PMD; i++) 650 + clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE); 651 + wmb_pmem(); 652 + count_vm_event(PGMAJFAULT); 653 + mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT); 654 + result |= VM_FAULT_MAJOR; 655 + } 656 + 625 657 result |= vmf_insert_pfn_pmd(vma, address, pmd, pfn, write); 626 658 } 627 659 628 660 out: 661 + i_mmap_unlock_read(mapping); 662 + 629 663 if (buffer_unwritten(&bh)) 630 664 complete_unwritten(&bh, !(result & VM_FAULT_ERROR)); 631 - 632 - i_mmap_unlock_write(mapping); 633 665 634 666 return result; 635 667
+1 -1
fs/ext4/Kconfig
··· 63 63 If unsure, say N. 64 64 65 65 config EXT4_USE_FOR_EXT2 66 - bool "Use ext4 for ext2/ext3 file systems" 66 + bool "Use ext4 for ext2 file systems" 67 67 depends on EXT4_FS 68 68 depends on EXT2_FS=n 69 69 default y
+2 -2
fs/ext4/readpage.c
··· 165 165 if (pages) { 166 166 page = list_entry(pages->prev, struct page, lru); 167 167 list_del(&page->lru); 168 - if (add_to_page_cache_lru(page, mapping, 169 - page->index, GFP_KERNEL)) 168 + if (add_to_page_cache_lru(page, mapping, page->index, 169 + GFP_KERNEL & mapping_gfp_mask(mapping))) 170 170 goto next_page; 171 171 } 172 172
+24 -11
fs/fs-writeback.c
··· 778 778 struct wb_writeback_work *base_work, 779 779 bool skip_if_busy) 780 780 { 781 - int next_memcg_id = 0; 782 - struct bdi_writeback *wb; 783 - struct wb_iter iter; 781 + struct bdi_writeback *last_wb = NULL; 782 + struct bdi_writeback *wb = list_entry_rcu(&bdi->wb_list, 783 + struct bdi_writeback, bdi_node); 784 784 785 785 might_sleep(); 786 786 restart: 787 787 rcu_read_lock(); 788 - bdi_for_each_wb(wb, bdi, &iter, next_memcg_id) { 788 + list_for_each_entry_continue_rcu(wb, &bdi->wb_list, bdi_node) { 789 789 DEFINE_WB_COMPLETION_ONSTACK(fallback_work_done); 790 790 struct wb_writeback_work fallback_work; 791 791 struct wb_writeback_work *work; 792 792 long nr_pages; 793 + 794 + if (last_wb) { 795 + wb_put(last_wb); 796 + last_wb = NULL; 797 + } 793 798 794 799 /* SYNC_ALL writes out I_DIRTY_TIME too */ 795 800 if (!wb_has_dirty_io(wb) && ··· 824 819 825 820 wb_queue_work(wb, work); 826 821 827 - next_memcg_id = wb->memcg_css->id + 1; 822 + /* 823 + * Pin @wb so that it stays on @bdi->wb_list. This allows 824 + * continuing iteration from @wb after dropping and 825 + * regrabbing rcu read lock. 826 + */ 827 + wb_get(wb); 828 + last_wb = wb; 829 + 828 830 rcu_read_unlock(); 829 831 wb_wait_for_completion(bdi, &fallback_work_done); 830 832 goto restart; 831 833 } 832 834 rcu_read_unlock(); 835 + 836 + if (last_wb) 837 + wb_put(last_wb); 833 838 } 834 839 835 840 #else /* CONFIG_CGROUP_WRITEBACK */ ··· 1872 1857 rcu_read_lock(); 1873 1858 list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) { 1874 1859 struct bdi_writeback *wb; 1875 - struct wb_iter iter; 1876 1860 1877 1861 if (!bdi_has_dirty_io(bdi)) 1878 1862 continue; 1879 1863 1880 - bdi_for_each_wb(wb, bdi, &iter, 0) 1864 + list_for_each_entry_rcu(wb, &bdi->wb_list, bdi_node) 1881 1865 wb_start_writeback(wb, wb_split_bdi_pages(wb, nr_pages), 1882 1866 false, reason); 1883 1867 } ··· 1908 1894 rcu_read_lock(); 1909 1895 list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) { 1910 1896 struct bdi_writeback *wb; 1911 - struct wb_iter iter; 1912 1897 1913 - bdi_for_each_wb(wb, bdi, &iter, 0) 1914 - if (!list_empty(&bdi->wb.b_dirty_time)) 1915 - wb_wakeup(&bdi->wb); 1898 + list_for_each_entry_rcu(wb, &bdi->wb_list, bdi_node) 1899 + if (!list_empty(&wb->b_dirty_time)) 1900 + wb_wakeup(wb); 1916 1901 } 1917 1902 rcu_read_unlock(); 1918 1903 schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
+9 -6
fs/mpage.c
··· 139 139 static struct bio * 140 140 do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages, 141 141 sector_t *last_block_in_bio, struct buffer_head *map_bh, 142 - unsigned long *first_logical_block, get_block_t get_block) 142 + unsigned long *first_logical_block, get_block_t get_block, 143 + gfp_t gfp) 143 144 { 144 145 struct inode *inode = page->mapping->host; 145 146 const unsigned blkbits = inode->i_blkbits; ··· 278 277 goto out; 279 278 } 280 279 bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9), 281 - min_t(int, nr_pages, BIO_MAX_PAGES), 282 - GFP_KERNEL); 280 + min_t(int, nr_pages, BIO_MAX_PAGES), gfp); 283 281 if (bio == NULL) 284 282 goto confused; 285 283 } ··· 361 361 sector_t last_block_in_bio = 0; 362 362 struct buffer_head map_bh; 363 363 unsigned long first_logical_block = 0; 364 + gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(mapping); 364 365 365 366 map_bh.b_state = 0; 366 367 map_bh.b_size = 0; ··· 371 370 prefetchw(&page->flags); 372 371 list_del(&page->lru); 373 372 if (!add_to_page_cache_lru(page, mapping, 374 - page->index, GFP_KERNEL)) { 373 + page->index, 374 + gfp)) { 375 375 bio = do_mpage_readpage(bio, page, 376 376 nr_pages - page_idx, 377 377 &last_block_in_bio, &map_bh, 378 378 &first_logical_block, 379 - get_block); 379 + get_block, gfp); 380 380 } 381 381 page_cache_release(page); 382 382 } ··· 397 395 sector_t last_block_in_bio = 0; 398 396 struct buffer_head map_bh; 399 397 unsigned long first_logical_block = 0; 398 + gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(page->mapping); 400 399 401 400 map_bh.b_state = 0; 402 401 map_bh.b_size = 0; 403 402 bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio, 404 - &map_bh, &first_logical_block, get_block); 403 + &map_bh, &first_logical_block, get_block, gfp); 405 404 if (bio) 406 405 mpage_bio_submit(READ, bio); 407 406 return 0;
-8
fs/nfsd/blocklayout.c
··· 56 56 u32 device_generation = 0; 57 57 int error; 58 58 59 - /* 60 - * We do not attempt to support I/O smaller than the fs block size, 61 - * or not aligned to it. 62 - */ 63 - if (args->lg_minlength < block_size) { 64 - dprintk("pnfsd: I/O too small\n"); 65 - goto out_layoutunavailable; 66 - } 67 59 if (seg->offset & (block_size - 1)) { 68 60 dprintk("pnfsd: I/O misaligned\n"); 69 61 goto out_layoutunavailable;
+2 -1
fs/ocfs2/dlm/dlmmaster.c
··· 1658 1658 if (ret < 0) { 1659 1659 mlog(ML_ERROR, "failed to dispatch assert master work\n"); 1660 1660 response = DLM_MASTER_RESP_ERROR; 1661 + spin_unlock(&res->spinlock); 1661 1662 dlm_lockres_put(res); 1662 1663 } else { 1663 1664 dispatched = 1; 1664 1665 __dlm_lockres_grab_inflight_worker(dlm, res); 1666 + spin_unlock(&res->spinlock); 1665 1667 } 1666 - spin_unlock(&res->spinlock); 1667 1668 } else { 1668 1669 if (res) 1669 1670 dlm_lockres_put(res);
+1 -1
fs/ocfs2/dlm/dlmrecovery.c
··· 1723 1723 } else { 1724 1724 dispatched = 1; 1725 1725 __dlm_lockres_grab_inflight_worker(dlm, res); 1726 + spin_unlock(&res->spinlock); 1726 1727 } 1727 - spin_unlock(&res->spinlock); 1728 1728 } else { 1729 1729 /* put.. incase we are not the master */ 1730 1730 spin_unlock(&res->spinlock);
+3 -2
fs/ramfs/file-nommu.c
··· 70 70 unsigned order; 71 71 void *data; 72 72 int ret; 73 + gfp_t gfp = mapping_gfp_mask(inode->i_mapping); 73 74 74 75 /* make various checks */ 75 76 order = get_order(newsize); ··· 85 84 86 85 /* allocate enough contiguous pages to be able to satisfy the 87 86 * request */ 88 - pages = alloc_pages(mapping_gfp_mask(inode->i_mapping), order); 87 + pages = alloc_pages(gfp, order); 89 88 if (!pages) 90 89 return -ENOMEM; 91 90 ··· 109 108 struct page *page = pages + loop; 110 109 111 110 ret = add_to_page_cache_lru(page, inode->i_mapping, loop, 112 - GFP_KERNEL); 111 + gfp); 113 112 if (ret < 0) 114 113 goto add_error; 115 114
+2 -1
include/drm/drm_dp_mst_helper.h
··· 253 253 u8 *bytes; 254 254 }; 255 255 256 + #define DP_REMOTE_I2C_READ_MAX_TRANSACTIONS 4 256 257 struct drm_dp_remote_i2c_read { 257 258 u8 num_transactions; 258 259 u8 port_number; ··· 263 262 u8 *bytes; 264 263 u8 no_stop_bit; 265 264 u8 i2c_transaction_delay; 266 - } transactions[4]; 265 + } transactions[DP_REMOTE_I2C_READ_MAX_TRANSACTIONS]; 267 266 u8 read_i2c_device_id; 268 267 u8 num_bytes_read; 269 268 };
+3
include/linux/backing-dev-defs.h
··· 116 116 struct list_head work_list; 117 117 struct delayed_work dwork; /* work item used for writeback */ 118 118 119 + struct list_head bdi_node; /* anchored at bdi->wb_list */ 120 + 119 121 #ifdef CONFIG_CGROUP_WRITEBACK 120 122 struct percpu_ref refcnt; /* used only for !root wb's */ 121 123 struct fprop_local_percpu memcg_completions; ··· 152 150 atomic_long_t tot_write_bandwidth; 153 151 154 152 struct bdi_writeback wb; /* the root writeback info for this bdi */ 153 + struct list_head wb_list; /* list of all wbs */ 155 154 #ifdef CONFIG_CGROUP_WRITEBACK 156 155 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */ 157 156 struct rb_root cgwb_congested_tree; /* their congested states */
+5 -64
include/linux/backing-dev.h
··· 19 19 #include <linux/slab.h> 20 20 21 21 int __must_check bdi_init(struct backing_dev_info *bdi); 22 - void bdi_destroy(struct backing_dev_info *bdi); 22 + void bdi_exit(struct backing_dev_info *bdi); 23 23 24 24 __printf(3, 4) 25 25 int bdi_register(struct backing_dev_info *bdi, struct device *parent, 26 26 const char *fmt, ...); 27 27 int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 28 + void bdi_unregister(struct backing_dev_info *bdi); 29 + 28 30 int __must_check bdi_setup_and_register(struct backing_dev_info *, char *); 31 + void bdi_destroy(struct backing_dev_info *bdi); 32 + 29 33 void wb_start_writeback(struct bdi_writeback *wb, long nr_pages, 30 34 bool range_cyclic, enum wb_reason reason); 31 35 void wb_start_background_writeback(struct bdi_writeback *wb); ··· 412 408 rcu_read_unlock(); 413 409 } 414 410 415 - struct wb_iter { 416 - int start_memcg_id; 417 - struct radix_tree_iter tree_iter; 418 - void **slot; 419 - }; 420 - 421 - static inline struct bdi_writeback *__wb_iter_next(struct wb_iter *iter, 422 - struct backing_dev_info *bdi) 423 - { 424 - struct radix_tree_iter *titer = &iter->tree_iter; 425 - 426 - WARN_ON_ONCE(!rcu_read_lock_held()); 427 - 428 - if (iter->start_memcg_id >= 0) { 429 - iter->slot = radix_tree_iter_init(titer, iter->start_memcg_id); 430 - iter->start_memcg_id = -1; 431 - } else { 432 - iter->slot = radix_tree_next_slot(iter->slot, titer, 0); 433 - } 434 - 435 - if (!iter->slot) 436 - iter->slot = radix_tree_next_chunk(&bdi->cgwb_tree, titer, 0); 437 - if (iter->slot) 438 - return *iter->slot; 439 - return NULL; 440 - } 441 - 442 - static inline struct bdi_writeback *__wb_iter_init(struct wb_iter *iter, 443 - struct backing_dev_info *bdi, 444 - int start_memcg_id) 445 - { 446 - iter->start_memcg_id = start_memcg_id; 447 - 448 - if (start_memcg_id) 449 - return __wb_iter_next(iter, bdi); 450 - else 451 - return &bdi->wb; 452 - } 453 - 454 - /** 455 - * bdi_for_each_wb - walk all wb's of a bdi in ascending memcg ID order 456 - * @wb_cur: cursor struct bdi_writeback pointer 457 - * @bdi: bdi to walk wb's of 458 - * @iter: pointer to struct wb_iter to be used as iteration buffer 459 - * @start_memcg_id: memcg ID to start iteration from 460 - * 461 - * Iterate @wb_cur through the wb's (bdi_writeback's) of @bdi in ascending 462 - * memcg ID order starting from @start_memcg_id. @iter is struct wb_iter 463 - * to be used as temp storage during iteration. rcu_read_lock() must be 464 - * held throughout iteration. 465 - */ 466 - #define bdi_for_each_wb(wb_cur, bdi, iter, start_memcg_id) \ 467 - for ((wb_cur) = __wb_iter_init(iter, bdi, start_memcg_id); \ 468 - (wb_cur); (wb_cur) = __wb_iter_next(iter, bdi)) 469 - 470 411 #else /* CONFIG_CGROUP_WRITEBACK */ 471 412 472 413 static inline bool inode_cgwb_enabled(struct inode *inode) ··· 470 521 static inline void wb_blkcg_offline(struct blkcg *blkcg) 471 522 { 472 523 } 473 - 474 - struct wb_iter { 475 - int next_id; 476 - }; 477 - 478 - #define bdi_for_each_wb(wb_cur, bdi, iter, start_blkcg_id) \ 479 - for ((iter)->next_id = (start_blkcg_id); \ 480 - ({ (wb_cur) = !(iter)->next_id++ ? &(bdi)->wb : NULL; }); ) 481 524 482 525 static inline int inode_congested(struct inode *inode, int cong_bits) 483 526 {
+1 -1
include/linux/cma.h
··· 26 26 extern int cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, 27 27 unsigned int order_per_bit, 28 28 struct cma **res_cma); 29 - extern struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align); 29 + extern struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align); 30 30 extern bool cma_release(struct cma *cma, const struct page *pages, unsigned int count); 31 31 #endif
+13
include/linux/compiler-gcc.h
··· 237 237 #define KASAN_ABI_VERSION 3 238 238 #endif 239 239 240 + #if GCC_VERSION >= 40902 241 + /* 242 + * Tell the compiler that address safety instrumentation (KASAN) 243 + * should not be applied to that function. 244 + * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 245 + */ 246 + #define __no_sanitize_address __attribute__((no_sanitize_address)) 247 + #endif 248 + 240 249 #endif /* gcc version >= 40000 specific checks */ 241 250 242 251 #if !defined(__noclone) 243 252 #define __noclone /* not needed */ 253 + #endif 254 + 255 + #if !defined(__no_sanitize_address) 256 + #define __no_sanitize_address 244 257 #endif 245 258 246 259 /*
+53 -13
include/linux/compiler.h
··· 198 198 199 199 #include <uapi/linux/types.h> 200 200 201 - static __always_inline void __read_once_size(const volatile void *p, void *res, int size) 201 + #define __READ_ONCE_SIZE \ 202 + ({ \ 203 + switch (size) { \ 204 + case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \ 205 + case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \ 206 + case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \ 207 + case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \ 208 + default: \ 209 + barrier(); \ 210 + __builtin_memcpy((void *)res, (const void *)p, size); \ 211 + barrier(); \ 212 + } \ 213 + }) 214 + 215 + static __always_inline 216 + void __read_once_size(const volatile void *p, void *res, int size) 202 217 { 203 - switch (size) { 204 - case 1: *(__u8 *)res = *(volatile __u8 *)p; break; 205 - case 2: *(__u16 *)res = *(volatile __u16 *)p; break; 206 - case 4: *(__u32 *)res = *(volatile __u32 *)p; break; 207 - case 8: *(__u64 *)res = *(volatile __u64 *)p; break; 208 - default: 209 - barrier(); 210 - __builtin_memcpy((void *)res, (const void *)p, size); 211 - barrier(); 212 - } 218 + __READ_ONCE_SIZE; 213 219 } 220 + 221 + #ifdef CONFIG_KASAN 222 + /* 223 + * This function is not 'inline' because __no_sanitize_address confilcts 224 + * with inlining. Attempt to inline it may cause a build failure. 225 + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 226 + * '__maybe_unused' allows us to avoid defined-but-not-used warnings. 227 + */ 228 + static __no_sanitize_address __maybe_unused 229 + void __read_once_size_nocheck(const volatile void *p, void *res, int size) 230 + { 231 + __READ_ONCE_SIZE; 232 + } 233 + #else 234 + static __always_inline 235 + void __read_once_size_nocheck(const volatile void *p, void *res, int size) 236 + { 237 + __READ_ONCE_SIZE; 238 + } 239 + #endif 214 240 215 241 static __always_inline void __write_once_size(volatile void *p, void *res, int size) 216 242 { ··· 274 248 * required ordering. 275 249 */ 276 250 277 - #define READ_ONCE(x) \ 278 - ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) 251 + #define __READ_ONCE(x, check) \ 252 + ({ \ 253 + union { typeof(x) __val; char __c[1]; } __u; \ 254 + if (check) \ 255 + __read_once_size(&(x), __u.__c, sizeof(x)); \ 256 + else \ 257 + __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ 258 + __u.__val; \ 259 + }) 260 + #define READ_ONCE(x) __READ_ONCE(x, 1) 261 + 262 + /* 263 + * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need 264 + * to hide memory access from KASAN. 265 + */ 266 + #define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0) 279 267 280 268 #define WRITE_ONCE(x, val) \ 281 269 ({ \
+2 -2
include/linux/dma-contiguous.h
··· 111 111 return ret; 112 112 } 113 113 114 - struct page *dma_alloc_from_contiguous(struct device *dev, int count, 114 + struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, 115 115 unsigned int order); 116 116 bool dma_release_from_contiguous(struct device *dev, struct page *pages, 117 117 int count); ··· 144 144 } 145 145 146 146 static inline 147 - struct page *dma_alloc_from_contiguous(struct device *dev, int count, 147 + struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, 148 148 unsigned int order) 149 149 { 150 150 return NULL;
+5 -3
include/linux/memcontrol.h
··· 676 676 677 677 struct list_head *mem_cgroup_cgwb_list(struct mem_cgroup *memcg); 678 678 struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb); 679 - void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pavail, 680 - unsigned long *pdirty, unsigned long *pwriteback); 679 + void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages, 680 + unsigned long *pheadroom, unsigned long *pdirty, 681 + unsigned long *pwriteback); 681 682 682 683 #else /* CONFIG_CGROUP_WRITEBACK */ 683 684 ··· 688 687 } 689 688 690 689 static inline void mem_cgroup_wb_stats(struct bdi_writeback *wb, 691 - unsigned long *pavail, 690 + unsigned long *pfilepages, 691 + unsigned long *pheadroom, 692 692 unsigned long *pdirty, 693 693 unsigned long *pwriteback) 694 694 {
+1 -1
include/net/af_unix.h
··· 64 64 struct socket_wq peer_wq; 65 65 }; 66 66 67 - static inline struct unix_sock *unix_sk(struct sock *sk) 67 + static inline struct unix_sock *unix_sk(const struct sock *sk) 68 68 { 69 69 return (struct unix_sock *)sk; 70 70 }
+2 -2
include/net/inet_timewait_sock.h
··· 113 113 void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo, 114 114 bool rearm); 115 115 116 - static void inline inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo) 116 + static inline void inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo) 117 117 { 118 118 __inet_twsk_schedule(tw, timeo, false); 119 119 } 120 120 121 - static void inline inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo) 121 + static inline void inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo) 122 122 { 123 123 __inet_twsk_schedule(tw, timeo, true); 124 124 }
+8
include/net/sock.h
··· 828 828 if (sk_rcvqueues_full(sk, limit)) 829 829 return -ENOBUFS; 830 830 831 + /* 832 + * If the skb was allocated from pfmemalloc reserves, only 833 + * allow SOCK_MEMALLOC sockets to use it as this socket is 834 + * helping free memory 835 + */ 836 + if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC)) 837 + return -ENOMEM; 838 + 831 839 __sk_add_backlog(sk, skb); 832 840 sk->sk_backlog.len += skb->truesize; 833 841 return 0;
+4 -2
include/sound/soc.h
··· 86 86 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 87 87 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 88 88 .tlv.p = (tlv_array),\ 89 - .info = snd_soc_info_volsw, \ 89 + .info = snd_soc_info_volsw_sx, \ 90 90 .get = snd_soc_get_volsw_sx,\ 91 91 .put = snd_soc_put_volsw_sx, \ 92 92 .private_value = (unsigned long)&(struct soc_mixer_control) \ ··· 156 156 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 157 157 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 158 158 .tlv.p = (tlv_array), \ 159 - .info = snd_soc_info_volsw, \ 159 + .info = snd_soc_info_volsw_sx, \ 160 160 .get = snd_soc_get_volsw_sx, \ 161 161 .put = snd_soc_put_volsw_sx, \ 162 162 .private_value = (unsigned long)&(struct soc_mixer_control) \ ··· 574 574 struct snd_ctl_elem_value *ucontrol); 575 575 int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, 576 576 struct snd_ctl_elem_info *uinfo); 577 + int snd_soc_info_volsw_sx(struct snd_kcontrol *kcontrol, 578 + struct snd_ctl_elem_info *uinfo); 577 579 #define snd_soc_info_bool_ext snd_ctl_boolean_mono_info 578 580 int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, 579 581 struct snd_ctl_elem_value *ucontrol);
+1 -1
include/sound/wm8904.h
··· 119 119 #define WM8904_MIC_REGS 2 120 120 #define WM8904_GPIO_REGS 4 121 121 #define WM8904_DRC_REGS 4 122 - #define WM8904_EQ_REGS 25 122 + #define WM8904_EQ_REGS 24 123 123 124 124 /** 125 125 * DRC configurations are specified with a label and a set of register
+2
include/uapi/asm-generic/signal.h
··· 80 80 * SA_RESTORER 0x04000000 81 81 */ 82 82 83 + #if !defined MINSIGSTKSZ || !defined SIGSTKSZ 83 84 #define MINSIGSTKSZ 2048 84 85 #define SIGSTKSZ 8192 86 + #endif 85 87 86 88 #ifndef __ASSEMBLY__ 87 89 typedef struct {
+15 -21
include/uapi/linux/openvswitch.h
··· 323 323 OVS_KEY_ATTR_MPLS, /* array of struct ovs_key_mpls. 324 324 * The implementation may restrict 325 325 * the accepted length of the array. */ 326 - OVS_KEY_ATTR_CT_STATE, /* u8 bitmask of OVS_CS_F_* */ 326 + OVS_KEY_ATTR_CT_STATE, /* u32 bitmask of OVS_CS_F_* */ 327 327 OVS_KEY_ATTR_CT_ZONE, /* u16 connection tracking zone. */ 328 328 OVS_KEY_ATTR_CT_MARK, /* u32 connection tracking mark */ 329 - OVS_KEY_ATTR_CT_LABEL, /* 16-octet connection tracking label */ 329 + OVS_KEY_ATTR_CT_LABELS, /* 16-octet connection tracking label */ 330 330 331 331 #ifdef __KERNEL__ 332 332 OVS_KEY_ATTR_TUNNEL_INFO, /* struct ip_tunnel_info */ ··· 439 439 __u8 nd_tll[ETH_ALEN]; 440 440 }; 441 441 442 - #define OVS_CT_LABEL_LEN 16 443 - struct ovs_key_ct_label { 444 - __u8 ct_label[OVS_CT_LABEL_LEN]; 442 + #define OVS_CT_LABELS_LEN 16 443 + struct ovs_key_ct_labels { 444 + __u8 ct_labels[OVS_CT_LABELS_LEN]; 445 445 }; 446 446 447 447 /* OVS_KEY_ATTR_CT_STATE flags */ ··· 449 449 #define OVS_CS_F_ESTABLISHED 0x02 /* Part of an existing connection. */ 450 450 #define OVS_CS_F_RELATED 0x04 /* Related to an established 451 451 * connection. */ 452 - #define OVS_CS_F_INVALID 0x20 /* Could not track connection. */ 453 - #define OVS_CS_F_REPLY_DIR 0x40 /* Flow is in the reply direction. */ 454 - #define OVS_CS_F_TRACKED 0x80 /* Conntrack has occurred. */ 452 + #define OVS_CS_F_REPLY_DIR 0x08 /* Flow is in the reply direction. */ 453 + #define OVS_CS_F_INVALID 0x10 /* Could not track connection. */ 454 + #define OVS_CS_F_TRACKED 0x20 /* Conntrack has occurred. */ 455 455 456 456 /** 457 457 * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands. ··· 618 618 619 619 /** 620 620 * enum ovs_ct_attr - Attributes for %OVS_ACTION_ATTR_CT action. 621 - * @OVS_CT_ATTR_FLAGS: u32 connection tracking flags. 621 + * @OVS_CT_ATTR_COMMIT: If present, commits the connection to the conntrack 622 + * table. This allows future packets for the same connection to be identified 623 + * as 'established' or 'related'. 622 624 * @OVS_CT_ATTR_ZONE: u16 connection tracking zone. 623 625 * @OVS_CT_ATTR_MARK: u32 value followed by u32 mask. For each bit set in the 624 626 * mask, the corresponding bit in the value is copied to the connection 625 627 * tracking mark field in the connection. 626 - * @OVS_CT_ATTR_LABEL: %OVS_CT_LABEL_LEN value followed by %OVS_CT_LABEL_LEN 628 + * @OVS_CT_ATTR_LABEL: %OVS_CT_LABELS_LEN value followed by %OVS_CT_LABELS_LEN 627 629 * mask. For each bit set in the mask, the corresponding bit in the value is 628 630 * copied to the connection tracking label field in the connection. 629 631 * @OVS_CT_ATTR_HELPER: variable length string defining conntrack ALG. 630 632 */ 631 633 enum ovs_ct_attr { 632 634 OVS_CT_ATTR_UNSPEC, 633 - OVS_CT_ATTR_FLAGS, /* u8 bitmask of OVS_CT_F_*. */ 635 + OVS_CT_ATTR_COMMIT, /* No argument, commits connection. */ 634 636 OVS_CT_ATTR_ZONE, /* u16 zone id. */ 635 637 OVS_CT_ATTR_MARK, /* mark to associate with this connection. */ 636 - OVS_CT_ATTR_LABEL, /* label to associate with this connection. */ 638 + OVS_CT_ATTR_LABELS, /* labels to associate with this connection. */ 637 639 OVS_CT_ATTR_HELPER, /* netlink helper to assist detection of 638 640 related connections. */ 639 641 __OVS_CT_ATTR_MAX 640 642 }; 641 643 642 644 #define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1) 643 - 644 - /* 645 - * OVS_CT_ATTR_FLAGS flags - bitmask of %OVS_CT_F_* 646 - * @OVS_CT_F_COMMIT: Commits the flow to the conntrack table. This allows 647 - * future packets for the same connection to be identified as 'established' 648 - * or 'related'. 649 - */ 650 - #define OVS_CT_F_COMMIT 0x01 651 645 652 646 /** 653 647 * enum ovs_action_attr - Action types. ··· 699 705 * data immediately followed by a mask. 700 706 * The data must be zero for the unmasked 701 707 * bits. */ 702 - OVS_ACTION_ATTR_CT, /* One nested OVS_CT_ATTR_* . */ 708 + OVS_ACTION_ATTR_CT, /* Nested OVS_CT_ATTR_* . */ 703 709 704 710 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted 705 711 * from userspace. */
+1 -1
include/uapi/linux/rtnetlink.h
··· 160 160 161 161 /* Macros to handle rtattributes */ 162 162 163 - #define RTA_ALIGNTO 4 163 + #define RTA_ALIGNTO 4U 164 164 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) ) 165 165 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ 166 166 (rta)->rta_len >= sizeof(struct rtattr) && \
+1 -5
kernel/irq/msi.c
··· 228 228 { 229 229 struct irq_chip *chip = info->chip; 230 230 231 - BUG_ON(!chip); 232 - if (!chip->irq_mask) 233 - chip->irq_mask = pci_msi_mask_irq; 234 - if (!chip->irq_unmask) 235 - chip->irq_unmask = pci_msi_unmask_irq; 231 + BUG_ON(!chip || !chip->irq_mask || !chip->irq_unmask); 236 232 if (!chip->irq_set_affinity) 237 233 chip->irq_set_affinity = msi_domain_set_affinity; 238 234 }
+6 -2
kernel/kmod.c
··· 327 327 call_usermodehelper_exec_sync(sub_info); 328 328 } else { 329 329 pid_t pid; 330 - 330 + /* 331 + * Use CLONE_PARENT to reparent it to kthreadd; we do not 332 + * want to pollute current->children, and we need a parent 333 + * that always ignores SIGCHLD to ensure auto-reaping. 334 + */ 331 335 pid = kernel_thread(call_usermodehelper_exec_async, sub_info, 332 - SIGCHLD); 336 + CLONE_PARENT | SIGCHLD); 333 337 if (pid < 0) { 334 338 sub_info->retval = pid; 335 339 umh_complete(sub_info);
+8 -4
kernel/sched/core.c
··· 2366 2366 trace_sched_wakeup_new(p); 2367 2367 check_preempt_curr(rq, p, WF_FORK); 2368 2368 #ifdef CONFIG_SMP 2369 - if (p->sched_class->task_woken) 2369 + if (p->sched_class->task_woken) { 2370 + /* 2371 + * Nothing relies on rq->lock after this, so its fine to 2372 + * drop it. 2373 + */ 2374 + lockdep_unpin_lock(&rq->lock); 2370 2375 p->sched_class->task_woken(rq, p); 2376 + lockdep_pin_lock(&rq->lock); 2377 + } 2371 2378 #endif 2372 2379 task_rq_unlock(rq, p, &flags); 2373 2380 } ··· 7244 7237 7245 7238 alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL); 7246 7239 alloc_cpumask_var(&fallback_doms, GFP_KERNEL); 7247 - 7248 - /* nohz_full won't take effect without isolating the cpus. */ 7249 - tick_nohz_full_add_cpus_to(cpu_isolated_map); 7250 7240 7251 7241 sched_init_numa(); 7252 7242
+13 -4
kernel/sched/deadline.c
··· 668 668 * Queueing this task back might have overloaded rq, check if we need 669 669 * to kick someone away. 670 670 */ 671 - if (has_pushable_dl_tasks(rq)) 671 + if (has_pushable_dl_tasks(rq)) { 672 + /* 673 + * Nothing relies on rq->lock after this, so its safe to drop 674 + * rq->lock. 675 + */ 676 + lockdep_unpin_lock(&rq->lock); 672 677 push_dl_task(rq); 678 + lockdep_pin_lock(&rq->lock); 679 + } 673 680 #endif 674 681 675 682 unlock: ··· 1073 1066 int target = find_later_rq(p); 1074 1067 1075 1068 if (target != -1 && 1076 - dl_time_before(p->dl.deadline, 1077 - cpu_rq(target)->dl.earliest_dl.curr)) 1069 + (dl_time_before(p->dl.deadline, 1070 + cpu_rq(target)->dl.earliest_dl.curr) || 1071 + (cpu_rq(target)->dl.dl_nr_running == 0))) 1078 1072 cpu = target; 1079 1073 } 1080 1074 rcu_read_unlock(); ··· 1425 1417 1426 1418 later_rq = cpu_rq(cpu); 1427 1419 1428 - if (!dl_time_before(task->dl.deadline, 1420 + if (later_rq->dl.dl_nr_running && 1421 + !dl_time_before(task->dl.deadline, 1429 1422 later_rq->dl.earliest_dl.curr)) { 1430 1423 /* 1431 1424 * Target rq has tasks of equal or earlier deadline,
+5 -4
kernel/sched/fair.c
··· 2363 2363 */ 2364 2364 tg_weight = atomic_long_read(&tg->load_avg); 2365 2365 tg_weight -= cfs_rq->tg_load_avg_contrib; 2366 - tg_weight += cfs_rq_load_avg(cfs_rq); 2366 + tg_weight += cfs_rq->load.weight; 2367 2367 2368 2368 return tg_weight; 2369 2369 } ··· 2373 2373 long tg_weight, load, shares; 2374 2374 2375 2375 tg_weight = calc_tg_weight(tg, cfs_rq); 2376 - load = cfs_rq_load_avg(cfs_rq); 2376 + load = cfs_rq->load.weight; 2377 2377 2378 2378 shares = (tg->shares * load); 2379 2379 if (tg_weight) ··· 2664 2664 /* Group cfs_rq's load_avg is used for task_h_load and update_cfs_share */ 2665 2665 static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq) 2666 2666 { 2667 - int decayed; 2668 2667 struct sched_avg *sa = &cfs_rq->avg; 2668 + int decayed, removed = 0; 2669 2669 2670 2670 if (atomic_long_read(&cfs_rq->removed_load_avg)) { 2671 2671 long r = atomic_long_xchg(&cfs_rq->removed_load_avg, 0); 2672 2672 sa->load_avg = max_t(long, sa->load_avg - r, 0); 2673 2673 sa->load_sum = max_t(s64, sa->load_sum - r * LOAD_AVG_MAX, 0); 2674 + removed = 1; 2674 2675 } 2675 2676 2676 2677 if (atomic_long_read(&cfs_rq->removed_util_avg)) { ··· 2689 2688 cfs_rq->load_last_update_time_copy = sa->last_update_time; 2690 2689 #endif 2691 2690 2692 - return decayed; 2691 + return decayed || removed; 2693 2692 } 2694 2693 2695 2694 /* Update task and its cfs_rq load average */
+2
kernel/sched/idle.c
··· 57 57 rcu_idle_enter(); 58 58 trace_cpu_idle_rcuidle(0, smp_processor_id()); 59 59 local_irq_enable(); 60 + stop_critical_timings(); 60 61 while (!tif_need_resched() && 61 62 (cpu_idle_force_poll || tick_check_broadcast_expired())) 62 63 cpu_relax(); 64 + start_critical_timings(); 63 65 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); 64 66 rcu_idle_exit(); 65 67 return 1;
+1 -1
kernel/time/timekeeping.c
··· 1251 1251 set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec); 1252 1252 tk_set_wall_to_mono(tk, tmp); 1253 1253 1254 - timekeeping_update(tk, TK_MIRROR); 1254 + timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); 1255 1255 1256 1256 write_seqcount_end(&tk_core.seq); 1257 1257 raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+11
kernel/trace/trace_stack.c
··· 85 85 if (!object_is_on_stack(stack)) 86 86 return; 87 87 88 + /* Can't do this from NMI context (can cause deadlocks) */ 89 + if (in_nmi()) 90 + return; 91 + 88 92 local_irq_save(flags); 89 93 arch_spin_lock(&max_stack_lock); 94 + 95 + /* 96 + * RCU may not be watching, make it see us. 97 + * The stack trace code uses rcu_sched. 98 + */ 99 + rcu_irq_enter(); 90 100 91 101 /* In case another CPU set the tracer_frame on us */ 92 102 if (unlikely(!frame_size)) ··· 179 169 } 180 170 181 171 out: 172 + rcu_irq_exit(); 182 173 arch_spin_unlock(&max_stack_lock); 183 174 local_irq_restore(flags); 184 175 }
+4 -4
kernel/workqueue.c
··· 1458 1458 timer_stats_timer_set_start_info(&dwork->timer); 1459 1459 1460 1460 dwork->wq = wq; 1461 + /* timer isn't guaranteed to run in this cpu, record earlier */ 1462 + if (cpu == WORK_CPU_UNBOUND) 1463 + cpu = raw_smp_processor_id(); 1461 1464 dwork->cpu = cpu; 1462 1465 timer->expires = jiffies + delay; 1463 1466 1464 - if (unlikely(cpu != WORK_CPU_UNBOUND)) 1465 - add_timer_on(timer, cpu); 1466 - else 1467 - add_timer(timer); 1467 + add_timer_on(timer, cpu); 1468 1468 } 1469 1469 1470 1470 /**
+1
lib/Kconfig
··· 220 220 221 221 config ZLIB_DEFLATE 222 222 tristate 223 + select BITREVERSE 223 224 224 225 config LZO_COMPRESS 225 226 tristate
+1
lib/Kconfig.debug
··· 197 197 config FRAME_WARN 198 198 int "Warn for stack frames larger than (needs gcc 4.4)" 199 199 range 0 8192 200 + default 0 if KASAN 200 201 default 1024 if !64BIT 201 202 default 2048 if 64BIT 202 203 help
+1 -1
lib/fault-inject.c
··· 44 44 printk(KERN_NOTICE "FAULT_INJECTION: forcing a failure.\n" 45 45 "name %pd, interval %lu, probability %lu, " 46 46 "space %d, times %d\n", attr->dname, 47 - attr->probability, attr->interval, 47 + attr->interval, attr->probability, 48 48 atomic_read(&attr->space), 49 49 atomic_read(&attr->times)); 50 50 if (attr->verbose > 1)
+30 -6
mm/backing-dev.c
··· 480 480 release_work); 481 481 struct backing_dev_info *bdi = wb->bdi; 482 482 483 + spin_lock_irq(&cgwb_lock); 484 + list_del_rcu(&wb->bdi_node); 485 + spin_unlock_irq(&cgwb_lock); 486 + 483 487 wb_shutdown(wb); 484 488 485 489 css_put(wb->memcg_css); ··· 579 575 ret = radix_tree_insert(&bdi->cgwb_tree, memcg_css->id, wb); 580 576 if (!ret) { 581 577 atomic_inc(&bdi->usage_cnt); 578 + list_add_tail_rcu(&wb->bdi_node, &bdi->wb_list); 582 579 list_add(&wb->memcg_node, memcg_cgwb_list); 583 580 list_add(&wb->blkcg_node, blkcg_cgwb_list); 584 581 css_get(memcg_css); ··· 681 676 static void cgwb_bdi_destroy(struct backing_dev_info *bdi) 682 677 { 683 678 struct radix_tree_iter iter; 684 - struct bdi_writeback_congested *congested, *congested_n; 679 + struct rb_node *rbn; 685 680 void **slot; 686 681 687 682 WARN_ON(test_bit(WB_registered, &bdi->wb.state)); ··· 691 686 radix_tree_for_each_slot(slot, &bdi->cgwb_tree, &iter, 0) 692 687 cgwb_kill(*slot); 693 688 694 - rbtree_postorder_for_each_entry_safe(congested, congested_n, 695 - &bdi->cgwb_congested_tree, rb_node) { 696 - rb_erase(&congested->rb_node, &bdi->cgwb_congested_tree); 689 + while ((rbn = rb_first(&bdi->cgwb_congested_tree))) { 690 + struct bdi_writeback_congested *congested = 691 + rb_entry(rbn, struct bdi_writeback_congested, rb_node); 692 + 693 + rb_erase(rbn, &bdi->cgwb_congested_tree); 697 694 congested->bdi = NULL; /* mark @congested unlinked */ 698 695 } 699 696 ··· 771 764 772 765 int bdi_init(struct backing_dev_info *bdi) 773 766 { 767 + int ret; 768 + 774 769 bdi->dev = NULL; 775 770 776 771 bdi->min_ratio = 0; 777 772 bdi->max_ratio = 100; 778 773 bdi->max_prop_frac = FPROP_FRAC_BASE; 779 774 INIT_LIST_HEAD(&bdi->bdi_list); 775 + INIT_LIST_HEAD(&bdi->wb_list); 780 776 init_waitqueue_head(&bdi->wb_waitq); 781 777 782 - return cgwb_bdi_init(bdi); 778 + ret = cgwb_bdi_init(bdi); 779 + 780 + list_add_tail_rcu(&bdi->wb.bdi_node, &bdi->wb_list); 781 + 782 + return ret; 783 783 } 784 784 EXPORT_SYMBOL(bdi_init); 785 785 ··· 837 823 synchronize_rcu_expedited(); 838 824 } 839 825 840 - void bdi_destroy(struct backing_dev_info *bdi) 826 + void bdi_unregister(struct backing_dev_info *bdi) 841 827 { 842 828 /* make sure nobody finds us on the bdi_list anymore */ 843 829 bdi_remove_from_list(bdi); ··· 849 835 device_unregister(bdi->dev); 850 836 bdi->dev = NULL; 851 837 } 838 + } 852 839 840 + void bdi_exit(struct backing_dev_info *bdi) 841 + { 842 + WARN_ON_ONCE(bdi->dev); 853 843 wb_exit(&bdi->wb); 844 + } 845 + 846 + void bdi_destroy(struct backing_dev_info *bdi) 847 + { 848 + bdi_unregister(bdi); 849 + bdi_exit(bdi); 854 850 } 855 851 EXPORT_SYMBOL(bdi_destroy); 856 852
+2 -2
mm/cma.c
··· 361 361 * This function allocates part of contiguous memory on specific 362 362 * contiguous memory area. 363 363 */ 364 - struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align) 364 + struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align) 365 365 { 366 366 unsigned long mask, offset, pfn, start = 0; 367 367 unsigned long bitmap_maxno, bitmap_no, bitmap_count; ··· 371 371 if (!cma || !cma->count) 372 372 return NULL; 373 373 374 - pr_debug("%s(cma %p, count %d, align %d)\n", __func__, (void *)cma, 374 + pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma, 375 375 count, align); 376 376 377 377 if (!count)
+5 -4
mm/filemap.c
··· 2488 2488 break; 2489 2489 } 2490 2490 2491 + if (fatal_signal_pending(current)) { 2492 + status = -EINTR; 2493 + break; 2494 + } 2495 + 2491 2496 status = a_ops->write_begin(file, mapping, pos, bytes, flags, 2492 2497 &page, &fsdata); 2493 2498 if (unlikely(status < 0)) ··· 2530 2525 written += copied; 2531 2526 2532 2527 balance_dirty_pages_ratelimited(mapping); 2533 - if (fatal_signal_pending(current)) { 2534 - status = -EINTR; 2535 - break; 2536 - } 2537 2528 } while (iov_iter_count(i)); 2538 2529 2539 2530 return written ? written : status;
+2 -1
mm/huge_memory.c
··· 2206 2206 for (_pte = pte; _pte < pte+HPAGE_PMD_NR; 2207 2207 _pte++, address += PAGE_SIZE) { 2208 2208 pte_t pteval = *_pte; 2209 - if (pte_none(pteval) || is_zero_pfn(pte_pfn(pteval))) { 2209 + if (pte_none(pteval) || (pte_present(pteval) && 2210 + is_zero_pfn(pte_pfn(pteval)))) { 2210 2211 if (!userfaultfd_armed(vma) && 2211 2212 ++none_or_zero <= khugepaged_max_ptes_none) 2212 2213 continue;
+18 -18
mm/memcontrol.c
··· 3387 3387 ret = page_counter_memparse(args, "-1", &threshold); 3388 3388 if (ret) 3389 3389 return ret; 3390 + threshold <<= PAGE_SHIFT; 3390 3391 3391 3392 mutex_lock(&memcg->thresholds_lock); 3392 3393 ··· 3741 3740 /** 3742 3741 * mem_cgroup_wb_stats - retrieve writeback related stats from its memcg 3743 3742 * @wb: bdi_writeback in question 3744 - * @pavail: out parameter for number of available pages 3743 + * @pfilepages: out parameter for number of file pages 3744 + * @pheadroom: out parameter for number of allocatable pages according to memcg 3745 3745 * @pdirty: out parameter for number of dirty pages 3746 3746 * @pwriteback: out parameter for number of pages under writeback 3747 3747 * 3748 - * Determine the numbers of available, dirty, and writeback pages in @wb's 3749 - * memcg. Dirty and writeback are self-explanatory. Available is a bit 3750 - * more involved. 3748 + * Determine the numbers of file, headroom, dirty, and writeback pages in 3749 + * @wb's memcg. File, dirty and writeback are self-explanatory. Headroom 3750 + * is a bit more involved. 3751 3751 * 3752 - * A memcg's headroom is "min(max, high) - used". The available memory is 3753 - * calculated as the lowest headroom of itself and the ancestors plus the 3754 - * number of pages already being used for file pages. Note that this 3755 - * doesn't consider the actual amount of available memory in the system. 3756 - * The caller should further cap *@pavail accordingly. 3752 + * A memcg's headroom is "min(max, high) - used". In the hierarchy, the 3753 + * headroom is calculated as the lowest headroom of itself and the 3754 + * ancestors. Note that this doesn't consider the actual amount of 3755 + * available memory in the system. The caller should further cap 3756 + * *@pheadroom accordingly. 3757 3757 */ 3758 - void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pavail, 3759 - unsigned long *pdirty, unsigned long *pwriteback) 3758 + void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages, 3759 + unsigned long *pheadroom, unsigned long *pdirty, 3760 + unsigned long *pwriteback) 3760 3761 { 3761 3762 struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css); 3762 3763 struct mem_cgroup *parent; 3763 - unsigned long head_room = PAGE_COUNTER_MAX; 3764 - unsigned long file_pages; 3765 3764 3766 3765 *pdirty = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_DIRTY); 3767 3766 3768 3767 /* this should eventually include NR_UNSTABLE_NFS */ 3769 3768 *pwriteback = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_WRITEBACK); 3769 + *pfilepages = mem_cgroup_nr_lru_pages(memcg, (1 << LRU_INACTIVE_FILE) | 3770 + (1 << LRU_ACTIVE_FILE)); 3771 + *pheadroom = PAGE_COUNTER_MAX; 3770 3772 3771 - file_pages = mem_cgroup_nr_lru_pages(memcg, (1 << LRU_INACTIVE_FILE) | 3772 - (1 << LRU_ACTIVE_FILE)); 3773 3773 while ((parent = parent_mem_cgroup(memcg))) { 3774 3774 unsigned long ceiling = min(memcg->memory.limit, memcg->high); 3775 3775 unsigned long used = page_counter_read(&memcg->memory); 3776 3776 3777 - head_room = min(head_room, ceiling - min(ceiling, used)); 3777 + *pheadroom = min(*pheadroom, ceiling - min(ceiling, used)); 3778 3778 memcg = parent; 3779 3779 } 3780 - 3781 - *pavail = file_pages + head_room; 3782 3780 } 3783 3781 3784 3782 #else /* CONFIG_CGROUP_WRITEBACK */
+2
mm/memory.c
··· 2426 2426 if (details.last_index < details.first_index) 2427 2427 details.last_index = ULONG_MAX; 2428 2428 2429 + 2430 + /* DAX uses i_mmap_lock to serialise file truncate vs page fault */ 2429 2431 i_mmap_lock_write(mapping); 2430 2432 if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap))) 2431 2433 unmap_mapping_range_tree(&mapping->i_mmap, &details);
+32 -22
mm/page-writeback.c
··· 145 145 unsigned long pos_ratio; 146 146 }; 147 147 148 - #define DTC_INIT_COMMON(__wb) .wb = (__wb), \ 149 - .wb_completions = &(__wb)->completions 150 - 151 148 /* 152 149 * Length of period for aging writeout fractions of bdis. This is an 153 150 * arbitrarily chosen number. The longer the period, the slower fractions will ··· 154 157 155 158 #ifdef CONFIG_CGROUP_WRITEBACK 156 159 157 - #define GDTC_INIT(__wb) .dom = &global_wb_domain, \ 158 - DTC_INIT_COMMON(__wb) 160 + #define GDTC_INIT(__wb) .wb = (__wb), \ 161 + .dom = &global_wb_domain, \ 162 + .wb_completions = &(__wb)->completions 163 + 159 164 #define GDTC_INIT_NO_WB .dom = &global_wb_domain 160 - #define MDTC_INIT(__wb, __gdtc) .dom = mem_cgroup_wb_domain(__wb), \ 161 - .gdtc = __gdtc, \ 162 - DTC_INIT_COMMON(__wb) 165 + 166 + #define MDTC_INIT(__wb, __gdtc) .wb = (__wb), \ 167 + .dom = mem_cgroup_wb_domain(__wb), \ 168 + .wb_completions = &(__wb)->memcg_completions, \ 169 + .gdtc = __gdtc 163 170 164 171 static bool mdtc_valid(struct dirty_throttle_control *dtc) 165 172 { ··· 214 213 215 214 #else /* CONFIG_CGROUP_WRITEBACK */ 216 215 217 - #define GDTC_INIT(__wb) DTC_INIT_COMMON(__wb) 216 + #define GDTC_INIT(__wb) .wb = (__wb), \ 217 + .wb_completions = &(__wb)->completions 218 218 #define GDTC_INIT_NO_WB 219 219 #define MDTC_INIT(__wb, __gdtc) 220 220 ··· 684 682 return max(thresh, dom->dirty_limit); 685 683 } 686 684 687 - /* memory available to a memcg domain is capped by system-wide clean memory */ 688 - static void mdtc_cap_avail(struct dirty_throttle_control *mdtc) 685 + /* 686 + * Memory which can be further allocated to a memcg domain is capped by 687 + * system-wide clean memory excluding the amount being used in the domain. 688 + */ 689 + static void mdtc_calc_avail(struct dirty_throttle_control *mdtc, 690 + unsigned long filepages, unsigned long headroom) 689 691 { 690 692 struct dirty_throttle_control *gdtc = mdtc_gdtc(mdtc); 691 - unsigned long clean = gdtc->avail - min(gdtc->avail, gdtc->dirty); 693 + unsigned long clean = filepages - min(filepages, mdtc->dirty); 694 + unsigned long global_clean = gdtc->avail - min(gdtc->avail, gdtc->dirty); 695 + unsigned long other_clean = global_clean - min(global_clean, clean); 692 696 693 - mdtc->avail = min(mdtc->avail, clean); 697 + mdtc->avail = filepages + min(headroom, other_clean); 694 698 } 695 699 696 700 /** ··· 1570 1562 } 1571 1563 1572 1564 if (mdtc) { 1573 - unsigned long writeback; 1565 + unsigned long filepages, headroom, writeback; 1574 1566 1575 1567 /* 1576 1568 * If @wb belongs to !root memcg, repeat the same 1577 1569 * basic calculations for the memcg domain. 1578 1570 */ 1579 - mem_cgroup_wb_stats(wb, &mdtc->avail, &mdtc->dirty, 1580 - &writeback); 1581 - mdtc_cap_avail(mdtc); 1571 + mem_cgroup_wb_stats(wb, &filepages, &headroom, 1572 + &mdtc->dirty, &writeback); 1582 1573 mdtc->dirty += writeback; 1574 + mdtc_calc_avail(mdtc, filepages, headroom); 1583 1575 1584 1576 domain_dirty_limits(mdtc); 1585 1577 ··· 1901 1893 return true; 1902 1894 1903 1895 if (mdtc) { 1904 - unsigned long writeback; 1896 + unsigned long filepages, headroom, writeback; 1905 1897 1906 - mem_cgroup_wb_stats(wb, &mdtc->avail, &mdtc->dirty, &writeback); 1907 - mdtc_cap_avail(mdtc); 1898 + mem_cgroup_wb_stats(wb, &filepages, &headroom, &mdtc->dirty, 1899 + &writeback); 1900 + mdtc_calc_avail(mdtc, filepages, headroom); 1908 1901 domain_dirty_limits(mdtc); /* ditto, ignore writeback */ 1909 1902 1910 1903 if (mdtc->dirty > mdtc->bg_thresh) ··· 1965 1956 int nr_pages = global_page_state(NR_FILE_DIRTY) + 1966 1957 global_page_state(NR_UNSTABLE_NFS); 1967 1958 struct bdi_writeback *wb; 1968 - struct wb_iter iter; 1969 1959 1970 1960 /* 1971 1961 * We want to write everything out, not just down to the dirty ··· 1973 1965 if (!bdi_has_dirty_io(&q->backing_dev_info)) 1974 1966 return; 1975 1967 1976 - bdi_for_each_wb(wb, &q->backing_dev_info, &iter, 0) 1968 + rcu_read_lock(); 1969 + list_for_each_entry_rcu(wb, &q->backing_dev_info.wb_list, bdi_node) 1977 1970 if (wb_has_dirty_io(wb)) 1978 1971 wb_start_writeback(wb, nr_pages, true, 1979 1972 WB_REASON_LAPTOP_TIMER); 1973 + rcu_read_unlock(); 1980 1974 } 1981 1975 1982 1976 /*
+4 -4
mm/readahead.c
··· 89 89 while (!list_empty(pages)) { 90 90 page = list_to_page(pages); 91 91 list_del(&page->lru); 92 - if (add_to_page_cache_lru(page, mapping, 93 - page->index, GFP_KERNEL)) { 92 + if (add_to_page_cache_lru(page, mapping, page->index, 93 + GFP_KERNEL & mapping_gfp_mask(mapping))) { 94 94 read_cache_pages_invalidate_page(mapping, page); 95 95 continue; 96 96 } ··· 127 127 for (page_idx = 0; page_idx < nr_pages; page_idx++) { 128 128 struct page *page = list_to_page(pages); 129 129 list_del(&page->lru); 130 - if (!add_to_page_cache_lru(page, mapping, 131 - page->index, GFP_KERNEL)) { 130 + if (!add_to_page_cache_lru(page, mapping, page->index, 131 + GFP_KERNEL & mapping_gfp_mask(mapping))) { 132 132 mapping->a_ops->readpage(filp, page); 133 133 } 134 134 page_cache_release(page);
+4 -3
mm/vmstat.c
··· 1363 1363 1364 1364 static void vmstat_update(struct work_struct *w) 1365 1365 { 1366 - if (refresh_cpu_vm_stats()) 1366 + if (refresh_cpu_vm_stats()) { 1367 1367 /* 1368 1368 * Counters were updated so we expect more updates 1369 1369 * to occur in the future. Keep on running the 1370 1370 * update worker thread. 1371 1371 */ 1372 - schedule_delayed_work(this_cpu_ptr(&vmstat_work), 1372 + schedule_delayed_work_on(smp_processor_id(), 1373 + this_cpu_ptr(&vmstat_work), 1373 1374 round_jiffies_relative(sysctl_stat_interval)); 1374 - else { 1375 + } else { 1375 1376 /* 1376 1377 * We did not update any counters so the app may be in 1377 1378 * a mode where it does not cause counter updates.
+71 -28
net/bluetooth/hci_conn.c
··· 91 91 * autoconnect action, remove them completely. If they are, just unmark 92 92 * them as waiting for connection, by clearing explicit_connect field. 93 93 */ 94 - if (params->auto_connect == HCI_AUTO_CONN_EXPLICIT) 94 + params->explicit_connect = false; 95 + 96 + list_del_init(&params->action); 97 + 98 + switch (params->auto_connect) { 99 + case HCI_AUTO_CONN_EXPLICIT: 95 100 hci_conn_params_del(conn->hdev, bdaddr, bdaddr_type); 96 - else 97 - params->explicit_connect = false; 101 + /* return instead of break to avoid duplicate scan update */ 102 + return; 103 + case HCI_AUTO_CONN_DIRECT: 104 + case HCI_AUTO_CONN_ALWAYS: 105 + list_add(&params->action, &conn->hdev->pend_le_conns); 106 + break; 107 + case HCI_AUTO_CONN_REPORT: 108 + list_add(&params->action, &conn->hdev->pend_le_reports); 109 + break; 110 + default: 111 + break; 112 + } 113 + 114 + hci_update_background_scan(conn->hdev); 115 + } 116 + 117 + static void hci_conn_cleanup(struct hci_conn *conn) 118 + { 119 + struct hci_dev *hdev = conn->hdev; 120 + 121 + if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags)) 122 + hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type); 123 + 124 + hci_chan_list_flush(conn); 125 + 126 + hci_conn_hash_del(hdev, conn); 127 + 128 + if (hdev->notify) 129 + hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); 130 + 131 + hci_conn_del_sysfs(conn); 132 + 133 + debugfs_remove_recursive(conn->debugfs); 134 + 135 + hci_dev_put(hdev); 136 + 137 + hci_conn_put(conn); 98 138 } 99 139 100 140 /* This function requires the caller holds hdev->lock */ ··· 142 102 { 143 103 hci_connect_le_scan_cleanup(conn); 144 104 145 - hci_conn_hash_del(conn->hdev, conn); 146 - hci_update_background_scan(conn->hdev); 105 + /* We can't call hci_conn_del here since that would deadlock 106 + * with trying to call cancel_delayed_work_sync(&conn->disc_work). 107 + * Instead, call just hci_conn_cleanup() which contains the bare 108 + * minimum cleanup operations needed for a connection in this 109 + * state. 110 + */ 111 + hci_conn_cleanup(conn); 147 112 } 148 113 149 114 static void hci_acl_create_connection(struct hci_conn *conn) ··· 626 581 } 627 582 } 628 583 629 - hci_chan_list_flush(conn); 630 - 631 584 if (conn->amp_mgr) 632 585 amp_mgr_put(conn->amp_mgr); 633 586 634 - hci_conn_hash_del(hdev, conn); 635 - if (hdev->notify) 636 - hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); 637 - 638 587 skb_queue_purge(&conn->data_q); 639 588 640 - hci_conn_del_sysfs(conn); 641 - 642 - debugfs_remove_recursive(conn->debugfs); 643 - 644 - if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags)) 645 - hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type); 646 - 647 - hci_dev_put(hdev); 648 - 649 - hci_conn_put(conn); 589 + /* Remove the connection from the list and cleanup its remaining 590 + * state. This is a separate function since for some cases like 591 + * BT_CONNECT_SCAN we *only* want the cleanup part without the 592 + * rest of hci_conn_del. 593 + */ 594 + hci_conn_cleanup(conn); 650 595 651 596 return 0; 652 597 } ··· 1008 973 if (is_connected(hdev, addr, addr_type)) 1009 974 return -EISCONN; 1010 975 1011 - params = hci_conn_params_add(hdev, addr, addr_type); 1012 - if (!params) 1013 - return -EIO; 976 + params = hci_conn_params_lookup(hdev, addr, addr_type); 977 + if (!params) { 978 + params = hci_conn_params_add(hdev, addr, addr_type); 979 + if (!params) 980 + return -ENOMEM; 1014 981 1015 - /* If we created new params, or existing params were marked as disabled, 1016 - * mark them to be used just once to connect. 1017 - */ 1018 - if (params->auto_connect == HCI_AUTO_CONN_DISABLED) { 982 + /* If we created new params, mark them to be deleted in 983 + * hci_connect_le_scan_cleanup. It's different case than 984 + * existing disabled params, those will stay after cleanup. 985 + */ 1019 986 params->auto_connect = HCI_AUTO_CONN_EXPLICIT; 987 + } 988 + 989 + /* We're trying to connect, so make sure params are at pend_le_conns */ 990 + if (params->auto_connect == HCI_AUTO_CONN_DISABLED || 991 + params->auto_connect == HCI_AUTO_CONN_REPORT || 992 + params->auto_connect == HCI_AUTO_CONN_EXPLICIT) { 1020 993 list_del_init(&params->action); 1021 994 list_add(&params->action, &hdev->pend_le_conns); 1022 995 }
-7
net/bluetooth/hci_core.c
··· 2861 2861 return param; 2862 2862 } 2863 2863 2864 - list_for_each_entry(param, &hdev->pend_le_reports, action) { 2865 - if (bacmp(&param->addr, addr) == 0 && 2866 - param->addr_type == addr_type && 2867 - param->explicit_connect) 2868 - return param; 2869 - } 2870 - 2871 2864 return NULL; 2872 2865 } 2873 2866
+8 -3
net/bluetooth/hci_event.c
··· 55 55 wake_up_bit(&hdev->flags, HCI_INQUIRY); 56 56 57 57 hci_dev_lock(hdev); 58 - hci_discovery_set_state(hdev, DISCOVERY_STOPPED); 58 + /* Set discovery state to stopped if we're not doing LE active 59 + * scanning. 60 + */ 61 + if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || 62 + hdev->le_scan_type != LE_SCAN_ACTIVE) 63 + hci_discovery_set_state(hdev, DISCOVERY_STOPPED); 59 64 hci_dev_unlock(hdev); 60 65 61 66 hci_conn_check_pending(hdev); ··· 4653 4648 /* If we're not connectable only connect devices that we have in 4654 4649 * our pend_le_conns list. 4655 4650 */ 4656 - params = hci_explicit_connect_lookup(hdev, addr, addr_type); 4657 - 4651 + params = hci_pend_le_action_lookup(&hdev->pend_le_conns, addr, 4652 + addr_type); 4658 4653 if (!params) 4659 4654 return NULL; 4660 4655
+20 -4
net/bluetooth/mgmt.c
··· 3545 3545 auth_type); 3546 3546 } else { 3547 3547 u8 addr_type; 3548 + struct hci_conn_params *p; 3548 3549 3549 3550 /* Convert from L2CAP channel address type to HCI address type 3550 3551 */ ··· 3563 3562 * If connection parameters already exist, then they 3564 3563 * will be kept and this function does nothing. 3565 3564 */ 3566 - hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type); 3565 + p = hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type); 3566 + 3567 + if (p->auto_connect == HCI_AUTO_CONN_EXPLICIT) 3568 + p->auto_connect = HCI_AUTO_CONN_DISABLED; 3567 3569 3568 3570 conn = hci_connect_le_scan(hdev, &cp->addr.bdaddr, 3569 3571 addr_type, sec_level, ··· 6121 6117 __hci_update_background_scan(req); 6122 6118 break; 6123 6119 case HCI_AUTO_CONN_REPORT: 6124 - list_add(&params->action, &hdev->pend_le_reports); 6120 + if (params->explicit_connect) 6121 + list_add(&params->action, &hdev->pend_le_conns); 6122 + else 6123 + list_add(&params->action, &hdev->pend_le_reports); 6125 6124 __hci_update_background_scan(req); 6126 6125 break; 6127 6126 case HCI_AUTO_CONN_DIRECT: 6128 6127 case HCI_AUTO_CONN_ALWAYS: 6129 6128 if (!is_connected(hdev, addr, addr_type)) { 6130 6129 list_add(&params->action, &hdev->pend_le_conns); 6131 - __hci_update_background_scan(req); 6130 + /* If we are in scan phase of connecting, we were 6131 + * already added to pend_le_conns and scanning. 6132 + */ 6133 + if (params->auto_connect != HCI_AUTO_CONN_EXPLICIT) 6134 + __hci_update_background_scan(req); 6132 6135 } 6133 6136 break; 6134 6137 } ··· 6390 6379 goto unlock; 6391 6380 } 6392 6381 6393 - if (params->auto_connect == HCI_AUTO_CONN_DISABLED) { 6382 + if (params->auto_connect == HCI_AUTO_CONN_DISABLED || 6383 + params->auto_connect == HCI_AUTO_CONN_EXPLICIT) { 6394 6384 err = cmd->cmd_complete(cmd, 6395 6385 MGMT_STATUS_INVALID_PARAMS); 6396 6386 mgmt_pending_remove(cmd); ··· 6427 6415 if (p->auto_connect == HCI_AUTO_CONN_DISABLED) 6428 6416 continue; 6429 6417 device_removed(sk, hdev, &p->addr, p->addr_type); 6418 + if (p->explicit_connect) { 6419 + p->auto_connect = HCI_AUTO_CONN_EXPLICIT; 6420 + continue; 6421 + } 6430 6422 list_del(&p->action); 6431 6423 list_del(&p->list); 6432 6424 kfree(p);
+9 -4
net/ceph/osd_client.c
··· 285 285 switch (op->op) { 286 286 case CEPH_OSD_OP_READ: 287 287 case CEPH_OSD_OP_WRITE: 288 + case CEPH_OSD_OP_WRITEFULL: 288 289 ceph_osd_data_release(&op->extent.osd_data); 289 290 break; 290 291 case CEPH_OSD_OP_CALL: ··· 486 485 size_t payload_len = 0; 487 486 488 487 BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE && 489 - opcode != CEPH_OSD_OP_ZERO && opcode != CEPH_OSD_OP_TRUNCATE); 488 + opcode != CEPH_OSD_OP_WRITEFULL && opcode != CEPH_OSD_OP_ZERO && 489 + opcode != CEPH_OSD_OP_TRUNCATE); 490 490 491 491 op->extent.offset = offset; 492 492 op->extent.length = length; 493 493 op->extent.truncate_size = truncate_size; 494 494 op->extent.truncate_seq = truncate_seq; 495 - if (opcode == CEPH_OSD_OP_WRITE) 495 + if (opcode == CEPH_OSD_OP_WRITE || opcode == CEPH_OSD_OP_WRITEFULL) 496 496 payload_len += length; 497 497 498 498 op->payload_len = payload_len; ··· 672 670 break; 673 671 case CEPH_OSD_OP_READ: 674 672 case CEPH_OSD_OP_WRITE: 673 + case CEPH_OSD_OP_WRITEFULL: 675 674 case CEPH_OSD_OP_ZERO: 676 675 case CEPH_OSD_OP_TRUNCATE: 677 - if (src->op == CEPH_OSD_OP_WRITE) 676 + if (src->op == CEPH_OSD_OP_WRITE || 677 + src->op == CEPH_OSD_OP_WRITEFULL) 678 678 request_data_len = src->extent.length; 679 679 dst->extent.offset = cpu_to_le64(src->extent.offset); 680 680 dst->extent.length = cpu_to_le64(src->extent.length); ··· 685 681 dst->extent.truncate_seq = 686 682 cpu_to_le32(src->extent.truncate_seq); 687 683 osd_data = &src->extent.osd_data; 688 - if (src->op == CEPH_OSD_OP_WRITE) 684 + if (src->op == CEPH_OSD_OP_WRITE || 685 + src->op == CEPH_OSD_OP_WRITEFULL) 689 686 ceph_osdc_msg_data_add(req->r_request, osd_data); 690 687 else 691 688 ceph_osdc_msg_data_add(req->r_reply, osd_data);
+1 -1
net/core/ethtool.c
··· 1284 1284 1285 1285 gstrings.len = ret; 1286 1286 1287 - data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); 1287 + data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER); 1288 1288 if (!data) 1289 1289 return -ENOMEM; 1290 1290
+6 -1
net/core/filter.c
··· 1415 1415 return dev_forward_skb(dev, skb2); 1416 1416 1417 1417 skb2->dev = dev; 1418 + skb_sender_cpu_clear(skb2); 1418 1419 return dev_queue_xmit(skb2); 1419 1420 } 1420 1421 ··· 1855 1854 goto out; 1856 1855 1857 1856 /* We're copying the filter that has been originally attached, 1858 - * so no conversion/decode needed anymore. 1857 + * so no conversion/decode needed anymore. eBPF programs that 1858 + * have no original program cannot be dumped through this. 1859 1859 */ 1860 + ret = -EACCES; 1860 1861 fprog = filter->prog->orig_prog; 1862 + if (!fprog) 1863 + goto out; 1861 1864 1862 1865 ret = fprog->len; 1863 1866 if (!len)
+59 -11
net/dsa/dsa.c
··· 22 22 #include <linux/of_platform.h> 23 23 #include <linux/of_net.h> 24 24 #include <linux/sysfs.h> 25 + #include <linux/phy_fixed.h> 25 26 #include "dsa_priv.h" 26 27 27 28 char dsa_driver_version[] = "0.1"; ··· 306 305 if (ret < 0) 307 306 goto out; 308 307 309 - ds->slave_mii_bus = mdiobus_alloc(); 308 + ds->slave_mii_bus = devm_mdiobus_alloc(parent); 310 309 if (ds->slave_mii_bus == NULL) { 311 310 ret = -ENOMEM; 312 311 goto out; ··· 315 314 316 315 ret = mdiobus_register(ds->slave_mii_bus); 317 316 if (ret < 0) 318 - goto out_free; 317 + goto out; 319 318 320 319 321 320 /* ··· 368 367 369 368 return ret; 370 369 371 - out_free: 372 - mdiobus_free(ds->slave_mii_bus); 373 370 out: 374 - kfree(ds); 375 371 return ret; 376 372 } 377 373 ··· 398 400 /* 399 401 * Allocate and initialise switch state. 400 402 */ 401 - ds = kzalloc(sizeof(*ds) + drv->priv_size, GFP_KERNEL); 403 + ds = devm_kzalloc(parent, sizeof(*ds) + drv->priv_size, GFP_KERNEL); 402 404 if (ds == NULL) 403 405 return ERR_PTR(-ENOMEM); 404 406 ··· 418 420 419 421 static void dsa_switch_destroy(struct dsa_switch *ds) 420 422 { 423 + struct device_node *port_dn; 424 + struct phy_device *phydev; 425 + struct dsa_chip_data *cd = ds->pd; 426 + int port; 427 + 421 428 #ifdef CONFIG_NET_DSA_HWMON 422 429 if (ds->hwmon_dev) 423 430 hwmon_device_unregister(ds->hwmon_dev); 424 431 #endif 432 + 433 + /* Disable configuration of the CPU and DSA ports */ 434 + for (port = 0; port < DSA_MAX_PORTS; port++) { 435 + if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))) 436 + continue; 437 + 438 + port_dn = cd->port_dn[port]; 439 + if (of_phy_is_fixed_link(port_dn)) { 440 + phydev = of_phy_find_device(port_dn); 441 + if (phydev) { 442 + int addr = phydev->addr; 443 + 444 + phy_device_free(phydev); 445 + of_node_put(port_dn); 446 + fixed_phy_del(addr); 447 + } 448 + } 449 + } 450 + 451 + /* Destroy network devices for physical switch ports. */ 452 + for (port = 0; port < DSA_MAX_PORTS; port++) { 453 + if (!(ds->phys_port_mask & (1 << port))) 454 + continue; 455 + 456 + if (!ds->ports[port]) 457 + continue; 458 + 459 + unregister_netdev(ds->ports[port]); 460 + free_netdev(ds->ports[port]); 461 + } 462 + 463 + mdiobus_unregister(ds->slave_mii_bus); 425 464 } 426 465 427 466 #ifdef CONFIG_PM_SLEEP ··· 837 802 } 838 803 #endif 839 804 840 - static void dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, 841 - struct device *parent, struct dsa_platform_data *pd) 805 + static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, 806 + struct device *parent, struct dsa_platform_data *pd) 842 807 { 843 808 int i; 809 + unsigned configured = 0; 844 810 845 811 dst->pd = pd; 846 812 dst->master_netdev = dev; ··· 861 825 dst->ds[i] = ds; 862 826 if (ds->drv->poll_link != NULL) 863 827 dst->link_poll_needed = 1; 828 + 829 + ++configured; 864 830 } 831 + 832 + /* 833 + * If no switch was found, exit cleanly 834 + */ 835 + if (!configured) 836 + return -EPROBE_DEFER; 865 837 866 838 /* 867 839 * If we use a tagging format that doesn't have an ethertype ··· 887 843 dst->link_poll_timer.expires = round_jiffies(jiffies + HZ); 888 844 add_timer(&dst->link_poll_timer); 889 845 } 846 + 847 + return 0; 890 848 } 891 849 892 850 static int dsa_probe(struct platform_device *pdev) ··· 929 883 goto out; 930 884 } 931 885 932 - dst = kzalloc(sizeof(*dst), GFP_KERNEL); 886 + dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); 933 887 if (dst == NULL) { 934 888 dev_put(dev); 935 889 ret = -ENOMEM; ··· 938 892 939 893 platform_set_drvdata(pdev, dst); 940 894 941 - dsa_setup_dst(dst, dev, &pdev->dev, pd); 895 + ret = dsa_setup_dst(dst, dev, &pdev->dev, pd); 896 + if (ret) 897 + goto out; 942 898 943 899 return 0; 944 900 ··· 962 914 for (i = 0; i < dst->pd->nr_chips; i++) { 963 915 struct dsa_switch *ds = dst->ds[i]; 964 916 965 - if (ds != NULL) 917 + if (ds) 966 918 dsa_switch_destroy(ds); 967 919 } 968 920 }
+5 -3
net/ipv4/arp.c
··· 312 312 if (!skb) 313 313 return; 314 314 315 - skb_dst_set(skb, dst); 315 + skb_dst_set(skb, dst_clone(dst)); 316 316 arp_xmit(skb); 317 317 } 318 318 ··· 384 384 } 385 385 386 386 if (skb && !(dev->priv_flags & IFF_XMIT_DST_RELEASE)) 387 - dst = dst_clone(skb_dst(skb)); 387 + dst = skb_dst(skb); 388 388 arp_send_dst(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, 389 389 dst_hw, dev->dev_addr, NULL, dst); 390 390 } ··· 811 811 } else { 812 812 pneigh_enqueue(&arp_tbl, 813 813 in_dev->arp_parms, skb); 814 - return 0; 814 + goto out_free_dst; 815 815 } 816 816 goto out; 817 817 } ··· 865 865 866 866 out: 867 867 consume_skb(skb); 868 + out_free_dst: 869 + dst_release(reply_dst); 868 870 return 0; 869 871 } 870 872
+10 -9
net/ipv4/inet_connection_sock.c
··· 577 577 static bool reqsk_queue_unlink(struct request_sock_queue *queue, 578 578 struct request_sock *req) 579 579 { 580 - struct listen_sock *lopt = queue->listen_opt; 581 580 struct request_sock **prev; 581 + struct listen_sock *lopt; 582 582 bool found = false; 583 583 584 584 spin_lock(&queue->syn_wait_lock); 585 - 586 - for (prev = &lopt->syn_table[req->rsk_hash]; *prev != NULL; 587 - prev = &(*prev)->dl_next) { 588 - if (*prev == req) { 589 - *prev = req->dl_next; 590 - found = true; 591 - break; 585 + lopt = queue->listen_opt; 586 + if (lopt) { 587 + for (prev = &lopt->syn_table[req->rsk_hash]; *prev != NULL; 588 + prev = &(*prev)->dl_next) { 589 + if (*prev == req) { 590 + *prev = req->dl_next; 591 + found = true; 592 + break; 593 + } 592 594 } 593 595 } 594 - 595 596 spin_unlock(&queue->syn_wait_lock); 596 597 if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer)) 597 598 reqsk_put(req);
+2
net/ipv6/addrconf.c
··· 3119 3119 } 3120 3120 3121 3121 addrconf_addr_gen(idev, true); 3122 + if (dev->flags & IFF_POINTOPOINT) 3123 + addrconf_add_mroute(dev); 3122 3124 } 3123 3125 #endif 3124 3126
+3
net/ipv6/ip6_output.c
··· 376 376 if (skb->pkt_type != PACKET_HOST) 377 377 goto drop; 378 378 379 + if (unlikely(skb->sk)) 380 + goto drop; 381 + 379 382 if (skb_warn_if_lro(skb)) 380 383 goto drop; 381 384
+23 -26
net/ipv6/route.c
··· 142 142 struct net_device *loopback_dev = net->loopback_dev; 143 143 int cpu; 144 144 145 + if (dev == loopback_dev) 146 + return; 147 + 145 148 for_each_possible_cpu(cpu) { 146 149 struct uncached_list *ul = per_cpu_ptr(&rt6_uncached_list, cpu); 147 150 struct rt6_info *rt; ··· 154 151 struct inet6_dev *rt_idev = rt->rt6i_idev; 155 152 struct net_device *rt_dev = rt->dst.dev; 156 153 157 - if (rt_idev && (rt_idev->dev == dev || !dev) && 158 - rt_idev->dev != loopback_dev) { 154 + if (rt_idev->dev == dev) { 159 155 rt->rt6i_idev = in6_dev_get(loopback_dev); 160 156 in6_dev_put(rt_idev); 161 157 } 162 158 163 - if (rt_dev && (rt_dev == dev || !dev) && 164 - rt_dev != loopback_dev) { 159 + if (rt_dev == dev) { 165 160 rt->dst.dev = loopback_dev; 166 161 dev_hold(rt->dst.dev); 167 162 dev_put(rt_dev); ··· 248 247 { 249 248 } 250 249 251 - static u32 *ip6_rt_blackhole_cow_metrics(struct dst_entry *dst, 252 - unsigned long old) 253 - { 254 - return NULL; 255 - } 256 - 257 250 static struct dst_ops ip6_dst_blackhole_ops = { 258 251 .family = AF_INET6, 259 252 .destroy = ip6_dst_destroy, ··· 256 261 .default_advmss = ip6_default_advmss, 257 262 .update_pmtu = ip6_rt_blackhole_update_pmtu, 258 263 .redirect = ip6_rt_blackhole_redirect, 259 - .cow_metrics = ip6_rt_blackhole_cow_metrics, 264 + .cow_metrics = dst_cow_metrics_generic, 260 265 .neigh_lookup = ip6_neigh_lookup, 261 266 }; 262 267 ··· 313 318 314 319 #endif 315 320 321 + static void rt6_info_init(struct rt6_info *rt) 322 + { 323 + struct dst_entry *dst = &rt->dst; 324 + 325 + memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); 326 + INIT_LIST_HEAD(&rt->rt6i_siblings); 327 + INIT_LIST_HEAD(&rt->rt6i_uncached); 328 + } 329 + 316 330 /* allocate dst with ip6_dst_ops */ 317 331 static struct rt6_info *__ip6_dst_alloc(struct net *net, 318 332 struct net_device *dev, ··· 330 326 struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, 331 327 0, DST_OBSOLETE_FORCE_CHK, flags); 332 328 333 - if (rt) { 334 - struct dst_entry *dst = &rt->dst; 329 + if (rt) 330 + rt6_info_init(rt); 335 331 336 - memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); 337 - INIT_LIST_HEAD(&rt->rt6i_siblings); 338 - INIT_LIST_HEAD(&rt->rt6i_uncached); 339 - } 340 332 return rt; 341 333 } 342 334 ··· 1213 1213 1214 1214 rt = dst_alloc(&ip6_dst_blackhole_ops, ort->dst.dev, 1, DST_OBSOLETE_NONE, 0); 1215 1215 if (rt) { 1216 + rt6_info_init(rt); 1217 + 1216 1218 new = &rt->dst; 1217 - 1218 - memset(new + 1, 0, sizeof(*rt) - sizeof(*new)); 1219 - 1220 1219 new->__use = 1; 1221 1220 new->input = dst_discard; 1222 1221 new->output = dst_discard_sk; 1223 1222 1224 - if (dst_metrics_read_only(&ort->dst)) 1225 - new->_metrics = ort->dst._metrics; 1226 - else 1227 - dst_copy_metrics(new, &ort->dst); 1223 + dst_copy_metrics(new, &ort->dst); 1228 1224 rt->rt6i_idev = ort->rt6i_idev; 1229 1225 if (rt->rt6i_idev) 1230 1226 in6_dev_hold(rt->rt6i_idev); 1231 1227 1232 1228 rt->rt6i_gateway = ort->rt6i_gateway; 1233 - rt->rt6i_flags = ort->rt6i_flags; 1229 + rt->rt6i_flags = ort->rt6i_flags & ~RTF_PCPU; 1234 1230 rt->rt6i_metric = 0; 1235 1231 1236 1232 memcpy(&rt->rt6i_dst, &ort->rt6i_dst, sizeof(struct rt6key)); ··· 2618 2622 2619 2623 fib6_clean_all(net, fib6_ifdown, &adn); 2620 2624 icmp6_clean_all(fib6_ifdown, &adn); 2621 - rt6_uncached_list_flush_dev(net, dev); 2625 + if (dev) 2626 + rt6_uncached_list_flush_dev(net, dev); 2622 2627 } 2623 2628 2624 2629 struct rt6_mtu_change_arg {
+1
net/ipv6/xfrm6_policy.c
··· 37 37 38 38 memset(&fl6, 0, sizeof(fl6)); 39 39 fl6.flowi6_oif = oif; 40 + fl6.flowi6_flags = FLOWI_FLAG_SKIP_NH_OIF; 40 41 memcpy(&fl6.daddr, daddr, sizeof(fl6.daddr)); 41 42 if (saddr) 42 43 memcpy(&fl6.saddr, saddr, sizeof(fl6.saddr));
+1 -1
net/mac80211/debugfs.c
··· 149 149 150 150 for (i = 0; i < NUM_IEEE80211_HW_FLAGS; i++) { 151 151 if (test_bit(i, local->hw.flags)) 152 - pos += scnprintf(pos, end - pos, "%s", 152 + pos += scnprintf(pos, end - pos, "%s\n", 153 153 hw_flag_names[i]); 154 154 } 155 155
+1
net/mac80211/status.c
··· 101 101 * when it wakes up for the next time. 102 102 */ 103 103 set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT); 104 + ieee80211_clear_fast_xmit(sta); 104 105 105 106 /* 106 107 * This code races in the following way:
+5 -2
net/mac80211/tx.c
··· 1218 1218 1219 1219 if (!tx->sta) 1220 1220 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; 1221 - else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) 1221 + else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { 1222 1222 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; 1223 + ieee80211_check_fast_xmit(tx->sta); 1224 + } 1223 1225 1224 1226 info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT; 1225 1227 ··· 2453 2451 2454 2452 if (test_sta_flag(sta, WLAN_STA_PS_STA) || 2455 2453 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || 2456 - test_sta_flag(sta, WLAN_STA_PS_DELIVER)) 2454 + test_sta_flag(sta, WLAN_STA_PS_DELIVER) || 2455 + test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) 2457 2456 goto out; 2458 2457 2459 2458 if (sdata->noack_map)
+22 -12
net/netlink/af_netlink.c
··· 2785 2785 struct sk_buff *skb = NULL; 2786 2786 struct nlmsghdr *nlh; 2787 2787 int len, err = -ENOBUFS; 2788 + int alloc_min_size; 2788 2789 int alloc_size; 2789 2790 2790 2791 mutex_lock(nlk->cb_mutex); ··· 2793 2792 err = -EINVAL; 2794 2793 goto errout_skb; 2795 2794 } 2796 - 2797 - cb = &nlk->cb; 2798 - alloc_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE); 2799 2795 2800 2796 if (!netlink_rx_is_mmaped(sk) && 2801 2797 atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) ··· 2803 2805 * to reduce number of system calls on dump operations, if user 2804 2806 * ever provided a big enough buffer. 2805 2807 */ 2806 - if (alloc_size < nlk->max_recvmsg_len) { 2807 - skb = netlink_alloc_skb(sk, 2808 - nlk->max_recvmsg_len, 2809 - nlk->portid, 2808 + cb = &nlk->cb; 2809 + alloc_min_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE); 2810 + 2811 + if (alloc_min_size < nlk->max_recvmsg_len) { 2812 + alloc_size = nlk->max_recvmsg_len; 2813 + skb = netlink_alloc_skb(sk, alloc_size, nlk->portid, 2810 2814 GFP_KERNEL | 2811 2815 __GFP_NOWARN | 2812 2816 __GFP_NORETRY); 2813 - /* available room should be exact amount to avoid MSG_TRUNC */ 2814 - if (skb) 2815 - skb_reserve(skb, skb_tailroom(skb) - 2816 - nlk->max_recvmsg_len); 2817 2817 } 2818 - if (!skb) 2818 + if (!skb) { 2819 + alloc_size = alloc_min_size; 2819 2820 skb = netlink_alloc_skb(sk, alloc_size, nlk->portid, 2820 2821 GFP_KERNEL); 2822 + } 2821 2823 if (!skb) 2822 2824 goto errout_skb; 2825 + 2826 + /* Trim skb to allocated size. User is expected to provide buffer as 2827 + * large as max(min_dump_alloc, 16KiB (mac_recvmsg_len capped at 2828 + * netlink_recvmsg())). dump will pack as many smaller messages as 2829 + * could fit within the allocated skb. skb is typically allocated 2830 + * with larger space than required (could be as much as near 2x the 2831 + * requested size with align to next power of 2 approach). Allowing 2832 + * dump to use the excess space makes it difficult for a user to have a 2833 + * reasonable static buffer based on the expected largest dump of a 2834 + * single netdev. The outcome is MSG_TRUNC error. 2835 + */ 2836 + skb_reserve(skb, skb_tailroom(skb) - alloc_size); 2823 2837 netlink_skb_set_owner_r(skb, sk); 2824 2838 2825 2839 len = cb->dump(skb, cb);
+14 -5
net/openvswitch/actions.c
··· 684 684 { 685 685 if (skb_network_offset(skb) > MAX_L2_LEN) { 686 686 OVS_NLERR(1, "L2 header too long to fragment"); 687 - return; 687 + goto err; 688 688 } 689 689 690 690 if (ethertype == htons(ETH_P_IP)) { ··· 708 708 struct rt6_info ovs_rt; 709 709 710 710 if (!v6ops) { 711 - kfree_skb(skb); 712 - return; 711 + goto err; 713 712 } 714 713 715 714 prepare_frag(vport, skb); ··· 727 728 WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.", 728 729 ovs_vport_name(vport), ntohs(ethertype), mru, 729 730 vport->dev->mtu); 730 - kfree_skb(skb); 731 + goto err; 731 732 } 733 + 734 + return; 735 + err: 736 + kfree_skb(skb); 732 737 } 733 738 734 739 static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port, ··· 971 968 case OVS_KEY_ATTR_CT_STATE: 972 969 case OVS_KEY_ATTR_CT_ZONE: 973 970 case OVS_KEY_ATTR_CT_MARK: 974 - case OVS_KEY_ATTR_CT_LABEL: 971 + case OVS_KEY_ATTR_CT_LABELS: 975 972 err = -EINVAL; 976 973 break; 977 974 } ··· 1102 1099 break; 1103 1100 1104 1101 case OVS_ACTION_ATTR_CT: 1102 + if (!is_flow_key_valid(key)) { 1103 + err = ovs_flow_key_update(skb, key); 1104 + if (err) 1105 + return err; 1106 + } 1107 + 1105 1108 err = ovs_ct_execute(ovs_dp_get_net(dp), skb, key, 1106 1109 nla_data(a)); 1107 1110
+44 -45
net/openvswitch/conntrack.c
··· 37 37 }; 38 38 39 39 /* Metadata label for masked write to conntrack label. */ 40 - struct md_label { 41 - struct ovs_key_ct_label value; 42 - struct ovs_key_ct_label mask; 40 + struct md_labels { 41 + struct ovs_key_ct_labels value; 42 + struct ovs_key_ct_labels mask; 43 43 }; 44 44 45 45 /* Conntrack action context for execution. */ ··· 47 47 struct nf_conntrack_helper *helper; 48 48 struct nf_conntrack_zone zone; 49 49 struct nf_conn *ct; 50 - u32 flags; 50 + u8 commit : 1; 51 51 u16 family; 52 52 struct md_mark mark; 53 - struct md_label label; 53 + struct md_labels labels; 54 54 }; 55 55 56 56 static u16 key_to_nfproto(const struct sw_flow_key *key) ··· 109 109 #endif 110 110 } 111 111 112 - static void ovs_ct_get_label(const struct nf_conn *ct, 113 - struct ovs_key_ct_label *label) 112 + static void ovs_ct_get_labels(const struct nf_conn *ct, 113 + struct ovs_key_ct_labels *labels) 114 114 { 115 115 struct nf_conn_labels *cl = ct ? nf_ct_labels_find(ct) : NULL; 116 116 117 117 if (cl) { 118 118 size_t len = cl->words * sizeof(long); 119 119 120 - if (len > OVS_CT_LABEL_LEN) 121 - len = OVS_CT_LABEL_LEN; 122 - else if (len < OVS_CT_LABEL_LEN) 123 - memset(label, 0, OVS_CT_LABEL_LEN); 124 - memcpy(label, cl->bits, len); 120 + if (len > OVS_CT_LABELS_LEN) 121 + len = OVS_CT_LABELS_LEN; 122 + else if (len < OVS_CT_LABELS_LEN) 123 + memset(labels, 0, OVS_CT_LABELS_LEN); 124 + memcpy(labels, cl->bits, len); 125 125 } else { 126 - memset(label, 0, OVS_CT_LABEL_LEN); 126 + memset(labels, 0, OVS_CT_LABELS_LEN); 127 127 } 128 128 } 129 129 ··· 134 134 key->ct.state = state; 135 135 key->ct.zone = zone->id; 136 136 key->ct.mark = ovs_ct_get_mark(ct); 137 - ovs_ct_get_label(ct, &key->ct.label); 137 + ovs_ct_get_labels(ct, &key->ct.labels); 138 138 } 139 139 140 140 /* Update 'key' based on skb->nfct. If 'post_ct' is true, then OVS has ··· 167 167 168 168 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb) 169 169 { 170 - if (nla_put_u8(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state)) 170 + if (nla_put_u32(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state)) 171 171 return -EMSGSIZE; 172 172 173 173 if (IS_ENABLED(CONFIG_NF_CONNTRACK_ZONES) && ··· 179 179 return -EMSGSIZE; 180 180 181 181 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && 182 - nla_put(skb, OVS_KEY_ATTR_CT_LABEL, sizeof(key->ct.label), 183 - &key->ct.label)) 182 + nla_put(skb, OVS_KEY_ATTR_CT_LABELS, sizeof(key->ct.labels), 183 + &key->ct.labels)) 184 184 return -EMSGSIZE; 185 185 186 186 return 0; ··· 213 213 #endif 214 214 } 215 215 216 - static int ovs_ct_set_label(struct sk_buff *skb, struct sw_flow_key *key, 217 - const struct ovs_key_ct_label *label, 218 - const struct ovs_key_ct_label *mask) 216 + static int ovs_ct_set_labels(struct sk_buff *skb, struct sw_flow_key *key, 217 + const struct ovs_key_ct_labels *labels, 218 + const struct ovs_key_ct_labels *mask) 219 219 { 220 220 enum ip_conntrack_info ctinfo; 221 221 struct nf_conn_labels *cl; ··· 235 235 nf_ct_labels_ext_add(ct); 236 236 cl = nf_ct_labels_find(ct); 237 237 } 238 - if (!cl || cl->words * sizeof(long) < OVS_CT_LABEL_LEN) 238 + if (!cl || cl->words * sizeof(long) < OVS_CT_LABELS_LEN) 239 239 return -ENOSPC; 240 240 241 - err = nf_connlabels_replace(ct, (u32 *)label, (u32 *)mask, 242 - OVS_CT_LABEL_LEN / sizeof(u32)); 241 + err = nf_connlabels_replace(ct, (u32 *)labels, (u32 *)mask, 242 + OVS_CT_LABELS_LEN / sizeof(u32)); 243 243 if (err) 244 244 return err; 245 245 246 - ovs_ct_get_label(ct, &key->ct.label); 246 + ovs_ct_get_labels(ct, &key->ct.labels); 247 247 return 0; 248 248 } 249 249 ··· 465 465 return 0; 466 466 } 467 467 468 - static bool label_nonzero(const struct ovs_key_ct_label *label) 468 + static bool labels_nonzero(const struct ovs_key_ct_labels *labels) 469 469 { 470 470 size_t i; 471 471 472 - for (i = 0; i < sizeof(*label); i++) 473 - if (label->ct_label[i]) 472 + for (i = 0; i < sizeof(*labels); i++) 473 + if (labels->ct_labels[i]) 474 474 return true; 475 475 476 476 return false; ··· 493 493 return err; 494 494 } 495 495 496 - if (info->flags & OVS_CT_F_COMMIT) 496 + if (info->commit) 497 497 err = ovs_ct_commit(net, key, info, skb); 498 498 else 499 499 err = ovs_ct_lookup(net, key, info, skb); ··· 506 506 if (err) 507 507 goto err; 508 508 } 509 - if (label_nonzero(&info->label.mask)) 510 - err = ovs_ct_set_label(skb, key, &info->label.value, 511 - &info->label.mask); 509 + if (labels_nonzero(&info->labels.mask)) 510 + err = ovs_ct_set_labels(skb, key, &info->labels.value, 511 + &info->labels.mask); 512 512 err: 513 513 skb_push(skb, nh_ofs); 514 514 return err; ··· 539 539 } 540 540 541 541 static const struct ovs_ct_len_tbl ovs_ct_attr_lens[OVS_CT_ATTR_MAX + 1] = { 542 - [OVS_CT_ATTR_FLAGS] = { .minlen = sizeof(u32), 543 - .maxlen = sizeof(u32) }, 542 + [OVS_CT_ATTR_COMMIT] = { .minlen = 0, .maxlen = 0 }, 544 543 [OVS_CT_ATTR_ZONE] = { .minlen = sizeof(u16), 545 544 .maxlen = sizeof(u16) }, 546 545 [OVS_CT_ATTR_MARK] = { .minlen = sizeof(struct md_mark), 547 546 .maxlen = sizeof(struct md_mark) }, 548 - [OVS_CT_ATTR_LABEL] = { .minlen = sizeof(struct md_label), 549 - .maxlen = sizeof(struct md_label) }, 547 + [OVS_CT_ATTR_LABELS] = { .minlen = sizeof(struct md_labels), 548 + .maxlen = sizeof(struct md_labels) }, 550 549 [OVS_CT_ATTR_HELPER] = { .minlen = 1, 551 550 .maxlen = NF_CT_HELPER_NAME_LEN } 552 551 }; ··· 575 576 } 576 577 577 578 switch (type) { 578 - case OVS_CT_ATTR_FLAGS: 579 - info->flags = nla_get_u32(a); 579 + case OVS_CT_ATTR_COMMIT: 580 + info->commit = true; 580 581 break; 581 582 #ifdef CONFIG_NF_CONNTRACK_ZONES 582 583 case OVS_CT_ATTR_ZONE: ··· 592 593 } 593 594 #endif 594 595 #ifdef CONFIG_NF_CONNTRACK_LABELS 595 - case OVS_CT_ATTR_LABEL: { 596 - struct md_label *label = nla_data(a); 596 + case OVS_CT_ATTR_LABELS: { 597 + struct md_labels *labels = nla_data(a); 597 598 598 - info->label = *label; 599 + info->labels = *labels; 599 600 break; 600 601 } 601 602 #endif ··· 632 633 attr == OVS_KEY_ATTR_CT_MARK) 633 634 return true; 634 635 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && 635 - attr == OVS_KEY_ATTR_CT_LABEL) { 636 + attr == OVS_KEY_ATTR_CT_LABELS) { 636 637 struct ovs_net *ovs_net = net_generic(net, ovs_net_id); 637 638 638 639 return ovs_net->xt_label; ··· 700 701 if (!start) 701 702 return -EMSGSIZE; 702 703 703 - if (nla_put_u32(skb, OVS_CT_ATTR_FLAGS, ct_info->flags)) 704 + if (ct_info->commit && nla_put_flag(skb, OVS_CT_ATTR_COMMIT)) 704 705 return -EMSGSIZE; 705 706 if (IS_ENABLED(CONFIG_NF_CONNTRACK_ZONES) && 706 707 nla_put_u16(skb, OVS_CT_ATTR_ZONE, ct_info->zone.id)) ··· 710 711 &ct_info->mark)) 711 712 return -EMSGSIZE; 712 713 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && 713 - nla_put(skb, OVS_CT_ATTR_LABEL, sizeof(ct_info->label), 714 - &ct_info->label)) 714 + nla_put(skb, OVS_CT_ATTR_LABELS, sizeof(ct_info->labels), 715 + &ct_info->labels)) 715 716 return -EMSGSIZE; 716 717 if (ct_info->helper) { 717 718 if (nla_put_string(skb, OVS_CT_ATTR_HELPER, ··· 736 737 737 738 void ovs_ct_init(struct net *net) 738 739 { 739 - unsigned int n_bits = sizeof(struct ovs_key_ct_label) * BITS_PER_BYTE; 740 + unsigned int n_bits = sizeof(struct ovs_key_ct_labels) * BITS_PER_BYTE; 740 741 struct ovs_net *ovs_net = net_generic(net, ovs_net_id); 741 742 742 743 if (nf_connlabels_get(net, n_bits)) {
+13 -1
net/openvswitch/conntrack.h
··· 34 34 void ovs_ct_fill_key(const struct sk_buff *skb, struct sw_flow_key *key); 35 35 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb); 36 36 void ovs_ct_free_action(const struct nlattr *a); 37 + 38 + static inline bool ovs_ct_state_supported(u32 state) 39 + { 40 + return !(state & ~(OVS_CS_F_NEW | OVS_CS_F_ESTABLISHED | 41 + OVS_CS_F_RELATED | OVS_CS_F_REPLY_DIR | 42 + OVS_CS_F_INVALID | OVS_CS_F_TRACKED)); 43 + } 37 44 #else 38 45 #include <linux/errno.h> 39 46 ··· 49 42 static inline void ovs_ct_exit(struct net *net) { } 50 43 51 44 static inline bool ovs_ct_verify(struct net *net, int attr) 45 + { 46 + return false; 47 + } 48 + 49 + static inline bool ovs_ct_state_supported(u32 state) 52 50 { 53 51 return false; 54 52 } ··· 84 72 key->ct.state = 0; 85 73 key->ct.zone = 0; 86 74 key->ct.mark = 0; 87 - memset(&key->ct.label, 0, sizeof(key->ct.label)); 75 + memset(&key->ct.labels, 0, sizeof(key->ct.labels)); 88 76 } 89 77 90 78 static inline int ovs_ct_put_key(const struct sw_flow_key *key,
+1 -1
net/openvswitch/flow.h
··· 116 116 u16 zone; 117 117 u32 mark; 118 118 u8 state; 119 - struct ovs_key_ct_label label; 119 + struct ovs_key_ct_labels labels; 120 120 } ct; 121 121 122 122 } __aligned(BITS_PER_LONG/8); /* Ensure that we can do comparisons as longs. */
+18 -12
net/openvswitch/flow_netlink.c
··· 291 291 + nla_total_size(4) /* OVS_KEY_ATTR_SKB_MARK */ 292 292 + nla_total_size(4) /* OVS_KEY_ATTR_DP_HASH */ 293 293 + nla_total_size(4) /* OVS_KEY_ATTR_RECIRC_ID */ 294 - + nla_total_size(1) /* OVS_KEY_ATTR_CT_STATE */ 294 + + nla_total_size(4) /* OVS_KEY_ATTR_CT_STATE */ 295 295 + nla_total_size(2) /* OVS_KEY_ATTR_CT_ZONE */ 296 296 + nla_total_size(4) /* OVS_KEY_ATTR_CT_MARK */ 297 - + nla_total_size(16) /* OVS_KEY_ATTR_CT_LABEL */ 297 + + nla_total_size(16) /* OVS_KEY_ATTR_CT_LABELS */ 298 298 + nla_total_size(12) /* OVS_KEY_ATTR_ETHERNET */ 299 299 + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */ 300 300 + nla_total_size(4) /* OVS_KEY_ATTR_VLAN */ ··· 349 349 [OVS_KEY_ATTR_TUNNEL] = { .len = OVS_ATTR_NESTED, 350 350 .next = ovs_tunnel_key_lens, }, 351 351 [OVS_KEY_ATTR_MPLS] = { .len = sizeof(struct ovs_key_mpls) }, 352 - [OVS_KEY_ATTR_CT_STATE] = { .len = sizeof(u8) }, 352 + [OVS_KEY_ATTR_CT_STATE] = { .len = sizeof(u32) }, 353 353 [OVS_KEY_ATTR_CT_ZONE] = { .len = sizeof(u16) }, 354 354 [OVS_KEY_ATTR_CT_MARK] = { .len = sizeof(u32) }, 355 - [OVS_KEY_ATTR_CT_LABEL] = { .len = sizeof(struct ovs_key_ct_label) }, 355 + [OVS_KEY_ATTR_CT_LABELS] = { .len = sizeof(struct ovs_key_ct_labels) }, 356 356 }; 357 357 358 358 static bool check_attr_len(unsigned int attr_len, unsigned int expected_len) ··· 814 814 815 815 if (*attrs & (1 << OVS_KEY_ATTR_CT_STATE) && 816 816 ovs_ct_verify(net, OVS_KEY_ATTR_CT_STATE)) { 817 - u8 ct_state = nla_get_u8(a[OVS_KEY_ATTR_CT_STATE]); 817 + u32 ct_state = nla_get_u32(a[OVS_KEY_ATTR_CT_STATE]); 818 + 819 + if (!is_mask && !ovs_ct_state_supported(ct_state)) { 820 + OVS_NLERR(log, "ct_state flags %08x unsupported", 821 + ct_state); 822 + return -EINVAL; 823 + } 818 824 819 825 SW_FLOW_KEY_PUT(match, ct.state, ct_state, is_mask); 820 826 *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_STATE); ··· 839 833 SW_FLOW_KEY_PUT(match, ct.mark, mark, is_mask); 840 834 *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_MARK); 841 835 } 842 - if (*attrs & (1 << OVS_KEY_ATTR_CT_LABEL) && 843 - ovs_ct_verify(net, OVS_KEY_ATTR_CT_LABEL)) { 844 - const struct ovs_key_ct_label *cl; 836 + if (*attrs & (1 << OVS_KEY_ATTR_CT_LABELS) && 837 + ovs_ct_verify(net, OVS_KEY_ATTR_CT_LABELS)) { 838 + const struct ovs_key_ct_labels *cl; 845 839 846 - cl = nla_data(a[OVS_KEY_ATTR_CT_LABEL]); 847 - SW_FLOW_KEY_MEMCPY(match, ct.label, cl->ct_label, 840 + cl = nla_data(a[OVS_KEY_ATTR_CT_LABELS]); 841 + SW_FLOW_KEY_MEMCPY(match, ct.labels, cl->ct_labels, 848 842 sizeof(*cl), is_mask); 849 - *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_LABEL); 843 + *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_LABELS); 850 844 } 851 845 return 0; 852 846 } ··· 1979 1973 case OVS_KEY_ATTR_PRIORITY: 1980 1974 case OVS_KEY_ATTR_SKB_MARK: 1981 1975 case OVS_KEY_ATTR_CT_MARK: 1982 - case OVS_KEY_ATTR_CT_LABEL: 1976 + case OVS_KEY_ATTR_CT_LABELS: 1983 1977 case OVS_KEY_ATTR_ETHERNET: 1984 1978 break; 1985 1979
+2 -1
net/openvswitch/flow_table.c
··· 93 93 94 94 /* Initialize the default stat node. */ 95 95 stats = kmem_cache_alloc_node(flow_stats_cache, 96 - GFP_KERNEL | __GFP_ZERO, 0); 96 + GFP_KERNEL | __GFP_ZERO, 97 + node_online(0) ? 0 : NUMA_NO_NODE); 97 98 if (!stats) 98 99 goto err; 99 100
+20 -27
net/openvswitch/vport.c
··· 280 280 */ 281 281 void ovs_vport_get_stats(struct vport *vport, struct ovs_vport_stats *stats) 282 282 { 283 - struct net_device *dev = vport->dev; 284 - int i; 283 + const struct rtnl_link_stats64 *dev_stats; 284 + struct rtnl_link_stats64 temp; 285 285 286 - memset(stats, 0, sizeof(*stats)); 287 - stats->rx_errors = dev->stats.rx_errors; 288 - stats->tx_errors = dev->stats.tx_errors; 289 - stats->tx_dropped = dev->stats.tx_dropped; 290 - stats->rx_dropped = dev->stats.rx_dropped; 286 + dev_stats = dev_get_stats(vport->dev, &temp); 287 + stats->rx_errors = dev_stats->rx_errors; 288 + stats->tx_errors = dev_stats->tx_errors; 289 + stats->tx_dropped = dev_stats->tx_dropped; 290 + stats->rx_dropped = dev_stats->rx_dropped; 291 291 292 - stats->rx_dropped += atomic_long_read(&dev->rx_dropped); 293 - stats->tx_dropped += atomic_long_read(&dev->tx_dropped); 294 - 295 - for_each_possible_cpu(i) { 296 - const struct pcpu_sw_netstats *percpu_stats; 297 - struct pcpu_sw_netstats local_stats; 298 - unsigned int start; 299 - 300 - percpu_stats = per_cpu_ptr(dev->tstats, i); 301 - 302 - do { 303 - start = u64_stats_fetch_begin_irq(&percpu_stats->syncp); 304 - local_stats = *percpu_stats; 305 - } while (u64_stats_fetch_retry_irq(&percpu_stats->syncp, start)); 306 - 307 - stats->rx_bytes += local_stats.rx_bytes; 308 - stats->rx_packets += local_stats.rx_packets; 309 - stats->tx_bytes += local_stats.tx_bytes; 310 - stats->tx_packets += local_stats.tx_packets; 311 - } 292 + stats->rx_bytes = dev_stats->rx_bytes; 293 + stats->rx_packets = dev_stats->rx_packets; 294 + stats->tx_bytes = dev_stats->tx_bytes; 295 + stats->tx_packets = dev_stats->tx_packets; 312 296 } 313 297 314 298 /** ··· 444 460 445 461 OVS_CB(skb)->input_vport = vport; 446 462 OVS_CB(skb)->mru = 0; 463 + if (unlikely(dev_net(skb->dev) != ovs_dp_get_net(vport->dp))) { 464 + u32 mark; 465 + 466 + mark = skb->mark; 467 + skb_scrub_packet(skb, true); 468 + skb->mark = mark; 469 + tun_info = NULL; 470 + } 471 + 447 472 /* Extract flow from 'skb' into 'key'. */ 448 473 error = ovs_flow_key_extract(tun_info, skb, &key); 449 474 if (unlikely(error)) {
+14 -4
net/sched/act_mirred.c
··· 31 31 32 32 #define MIRRED_TAB_MASK 7 33 33 static LIST_HEAD(mirred_list); 34 + static DEFINE_SPINLOCK(mirred_list_lock); 34 35 35 36 static void tcf_mirred_release(struct tc_action *a, int bind) 36 37 { 37 38 struct tcf_mirred *m = to_mirred(a); 38 39 struct net_device *dev = rcu_dereference_protected(m->tcfm_dev, 1); 39 40 41 + /* We could be called either in a RCU callback or with RTNL lock held. */ 42 + spin_lock_bh(&mirred_list_lock); 40 43 list_del(&m->tcfm_list); 44 + spin_unlock_bh(&mirred_list_lock); 41 45 if (dev) 42 46 dev_put(dev); 43 47 } ··· 107 103 } else { 108 104 if (bind) 109 105 return 0; 110 - if (!ovr) { 111 - tcf_hash_release(a, bind); 106 + 107 + tcf_hash_release(a, bind); 108 + if (!ovr) 112 109 return -EEXIST; 113 - } 114 110 } 115 111 m = to_mirred(a); 116 112 ··· 127 123 } 128 124 129 125 if (ret == ACT_P_CREATED) { 126 + spin_lock_bh(&mirred_list_lock); 130 127 list_add(&m->tcfm_list, &mirred_list); 128 + spin_unlock_bh(&mirred_list_lock); 131 129 tcf_hash_insert(a); 132 130 } 133 131 ··· 179 173 180 174 skb2->skb_iif = skb->dev->ifindex; 181 175 skb2->dev = dev; 176 + skb_sender_cpu_clear(skb2); 182 177 err = dev_queue_xmit(skb2); 183 178 184 179 if (err) { ··· 228 221 struct tcf_mirred *m; 229 222 230 223 ASSERT_RTNL(); 231 - if (event == NETDEV_UNREGISTER) 224 + if (event == NETDEV_UNREGISTER) { 225 + spin_lock_bh(&mirred_list_lock); 232 226 list_for_each_entry(m, &mirred_list, tcfm_list) { 233 227 if (rcu_access_pointer(m->tcfm_dev) == dev) { 234 228 dev_put(dev); ··· 239 231 RCU_INIT_POINTER(m->tcfm_dev, NULL); 240 232 } 241 233 } 234 + spin_unlock_bh(&mirred_list_lock); 235 + } 242 236 243 237 return NOTIFY_DONE; 244 238 }
+10 -1
net/sched/sch_hhf.c
··· 368 368 return bucket - q->buckets; 369 369 } 370 370 371 + static unsigned int hhf_qdisc_drop(struct Qdisc *sch) 372 + { 373 + unsigned int prev_backlog; 374 + 375 + prev_backlog = sch->qstats.backlog; 376 + hhf_drop(sch); 377 + return prev_backlog - sch->qstats.backlog; 378 + } 379 + 371 380 static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch) 372 381 { 373 382 struct hhf_sched_data *q = qdisc_priv(sch); ··· 705 696 .enqueue = hhf_enqueue, 706 697 .dequeue = hhf_dequeue, 707 698 .peek = qdisc_peek_dequeued, 708 - .drop = hhf_drop, 699 + .drop = hhf_qdisc_drop, 709 700 .init = hhf_init, 710 701 .reset = hhf_reset, 711 702 .destroy = hhf_destroy,
+1 -1
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
··· 533 533 rqstp->rq_arg.page_base = head->arg.page_base; 534 534 535 535 /* rq_respages starts after the last arg page */ 536 - rqstp->rq_respages = &rqstp->rq_arg.pages[page_no]; 536 + rqstp->rq_respages = &rqstp->rq_pages[page_no]; 537 537 rqstp->rq_next_page = rqstp->rq_respages + 1; 538 538 539 539 /* Rebuild rq_arg head and tail. */
+3 -5
net/sunrpc/xprtrdma/verbs.c
··· 543 543 } 544 544 545 545 if (memreg == RPCRDMA_FRMR) { 546 - /* Requires both frmr reg and local dma lkey */ 547 - if (((devattr->device_cap_flags & 548 - (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) != 549 - (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) || 550 - (devattr->max_fast_reg_page_list_len == 0)) { 546 + if (!(devattr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) || 547 + (devattr->max_fast_reg_page_list_len == 0)) { 551 548 dprintk("RPC: %s: FRMR registration " 552 549 "not supported by HCA\n", __func__); 553 550 memreg = RPCRDMA_MTHCAFMR; ··· 554 557 if (!ia->ri_device->alloc_fmr) { 555 558 dprintk("RPC: %s: MTHCAFMR registration " 556 559 "not supported by HCA\n", __func__); 560 + rc = -EINVAL; 557 561 goto out3; 558 562 } 559 563 }
+3
net/switchdev/switchdev.c
··· 16 16 #include <linux/notifier.h> 17 17 #include <linux/netdevice.h> 18 18 #include <linux/if_bridge.h> 19 + #include <linux/if_vlan.h> 19 20 #include <net/ip_fib.h> 20 21 #include <net/switchdev.h> 21 22 ··· 635 634 if (nla_len(attr) != sizeof(struct bridge_vlan_info)) 636 635 return -EINVAL; 637 636 vinfo = nla_data(attr); 637 + if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK) 638 + return -EINVAL; 638 639 vlan->flags = vinfo->flags; 639 640 if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) { 640 641 if (vlan->vid_begin)
+2 -2
net/tipc/msg.h
··· 357 357 if (likely((usr <= TIPC_CRITICAL_IMPORTANCE) && !msg_errcode(m))) 358 358 return usr; 359 359 if ((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER)) 360 - return msg_bits(m, 5, 13, 0x7); 360 + return msg_bits(m, 9, 0, 0x7); 361 361 return TIPC_SYSTEM_IMPORTANCE; 362 362 } 363 363 ··· 366 366 int usr = msg_user(m); 367 367 368 368 if (likely((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER))) 369 - msg_set_bits(m, 5, 13, 0x7, i); 369 + msg_set_bits(m, 9, 0, 0x7, i); 370 370 else if (i < TIPC_SYSTEM_IMPORTANCE) 371 371 msg_set_user(m, i); 372 372 else
+3 -3
net/tipc/node.c
··· 1116 1116 } 1117 1117 1118 1118 /* Ignore duplicate packets */ 1119 - if (less(oseqno, rcv_nxt)) 1119 + if ((usr != LINK_PROTOCOL) && less(oseqno, rcv_nxt)) 1120 1120 return true; 1121 1121 1122 1122 /* Initiate or update failover mode if applicable */ ··· 1146 1146 if (!pl || !tipc_link_is_up(pl)) 1147 1147 return true; 1148 1148 1149 - /* Initiate or update synch mode if applicable */ 1150 - if ((usr == TUNNEL_PROTOCOL) && (mtyp == SYNCH_MSG)) { 1149 + /* Initiate synch mode if applicable */ 1150 + if ((usr == TUNNEL_PROTOCOL) && (mtyp == SYNCH_MSG) && (oseqno == 1)) { 1151 1151 syncpt = iseqno + exp_pkts - 1; 1152 1152 if (!tipc_link_is_up(l)) { 1153 1153 tipc_link_fsm_evt(l, LINK_ESTABLISH_EVT);
+7 -5
net/unix/af_unix.c
··· 2064 2064 goto out; 2065 2065 } 2066 2066 2067 + if (flags & MSG_PEEK) 2068 + skip = sk_peek_offset(sk, flags); 2069 + else 2070 + skip = 0; 2071 + 2067 2072 do { 2068 2073 int chunk; 2069 2074 struct sk_buff *skb, *last; ··· 2117 2112 break; 2118 2113 } 2119 2114 2120 - skip = sk_peek_offset(sk, flags); 2121 2115 while (skip >= unix_skb_len(skb)) { 2122 2116 skip -= unix_skb_len(skb); 2123 2117 last = skb; ··· 2183 2179 if (UNIXCB(skb).fp) 2184 2180 scm.fp = scm_fp_dup(UNIXCB(skb).fp); 2185 2181 2186 - if (skip) { 2187 - sk_peek_offset_fwd(sk, chunk); 2188 - skip -= chunk; 2189 - } 2182 + sk_peek_offset_fwd(sk, chunk); 2190 2183 2191 2184 if (UNIXCB(skb).fp) 2192 2185 break; 2193 2186 2187 + skip = 0; 2194 2188 last = skb; 2195 2189 last_len = skb->len; 2196 2190 unix_state_lock(sk);
+2 -2
scripts/package/builddeb
··· 115 115 BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)" 116 116 117 117 # Setup the directory structure 118 - rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" 118 + rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files 119 119 mkdir -m 755 -p "$tmpdir/DEBIAN" 120 120 mkdir -p "$tmpdir/lib" "$tmpdir/boot" 121 121 mkdir -p "$fwdir/lib/firmware/$version/" ··· 408 408 \$(MAKE) KDEB_SOURCENAME=${sourcename} KDEB_PKGVERSION=${packageversion} bindeb-pkg 409 409 410 410 clean: 411 - rm -rf debian/*tmp 411 + rm -rf debian/*tmp debian/files 412 412 mv debian/ debian.backup # debian/ might be cleaned away 413 413 \$(MAKE) clean 414 414 mv debian.backup debian
+4 -2
security/keys/gc.c
··· 134 134 kdebug("- %u", key->serial); 135 135 key_check(key); 136 136 137 - /* Throw away the key data */ 138 - if (key->type->destroy) 137 + /* Throw away the key data if the key is instantiated */ 138 + if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags) && 139 + !test_bit(KEY_FLAG_NEGATIVE, &key->flags) && 140 + key->type->destroy) 139 141 key->type->destroy(key); 140 142 141 143 security_key_free(key);
+3
security/keys/request_key.c
··· 440 440 441 441 kenter(""); 442 442 443 + if (ctx->index_key.type == &key_type_keyring) 444 + return ERR_PTR(-EPERM); 445 + 443 446 user = key_user_lookup(current_fsuid()); 444 447 if (!user) 445 448 return ERR_PTR(-ENOMEM);
+1
sound/hda/ext/hdac_ext_bus.c
··· 19 19 20 20 #include <linux/module.h> 21 21 #include <linux/slab.h> 22 + #include <linux/io.h> 22 23 #include <sound/hdaudio_ext.h> 23 24 24 25 MODULE_DESCRIPTION("HDA extended core");
+1 -3
sound/pci/hda/hda_codec.c
··· 3367 3367 int dev, err; 3368 3368 3369 3369 err = snd_hda_codec_parse_pcms(codec); 3370 - if (err < 0) { 3371 - snd_hda_codec_reset(codec); 3370 + if (err < 0) 3372 3371 return err; 3373 - } 3374 3372 3375 3373 /* attach a new PCM streams */ 3376 3374 list_for_each_entry(cpcm, &codec->pcm_list_head, list) {
+1
sound/pci/hda/patch_conexant.c
··· 819 819 SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT_PINCFG_LENOVO_TP410), 820 820 SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT_PINCFG_LENOVO_TP410), 821 821 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo IdeaPad Z560", CXT_FIXUP_MUTE_LED_EAPD), 822 + SND_PCI_QUIRK(0x17aa, 0x390b, "Lenovo G50-80", CXT_FIXUP_STEREO_DMIC), 822 823 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC), 823 824 SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC), 824 825 SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
+13 -13
sound/soc/codecs/rt298.c
··· 50 50 }; 51 51 52 52 static struct reg_default rt298_index_def[] = { 53 - { 0x01, 0xaaaa }, 54 - { 0x02, 0x8aaa }, 53 + { 0x01, 0xa5a8 }, 54 + { 0x02, 0x8e95 }, 55 55 { 0x03, 0x0002 }, 56 - { 0x04, 0xaf01 }, 57 - { 0x08, 0x000d }, 58 - { 0x09, 0xd810 }, 59 - { 0x0a, 0x0120 }, 56 + { 0x04, 0xaf67 }, 57 + { 0x08, 0x200f }, 58 + { 0x09, 0xd010 }, 59 + { 0x0a, 0x0100 }, 60 60 { 0x0b, 0x0000 }, 61 61 { 0x0d, 0x2800 }, 62 - { 0x0f, 0x0000 }, 63 - { 0x19, 0x0a17 }, 62 + { 0x0f, 0x0022 }, 63 + { 0x19, 0x0217 }, 64 64 { 0x20, 0x0020 }, 65 65 { 0x33, 0x0208 }, 66 66 { 0x46, 0x0300 }, 67 - { 0x49, 0x0004 }, 68 - { 0x4f, 0x50e9 }, 69 - { 0x50, 0x2000 }, 70 - { 0x63, 0x2902 }, 67 + { 0x49, 0x4004 }, 68 + { 0x4f, 0x50c9 }, 69 + { 0x50, 0x3000 }, 70 + { 0x63, 0x1b02 }, 71 71 { 0x67, 0x1111 }, 72 72 { 0x68, 0x1016 }, 73 73 { 0x69, 0x273f }, ··· 1214 1214 mdelay(10); 1215 1215 1216 1216 if (!rt298->pdata.gpio2_en) 1217 - regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0x4000); 1217 + regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0x40); 1218 1218 else 1219 1219 regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0); 1220 1220
+2
sound/soc/codecs/wm8962.c
··· 3808 3808 3809 3809 wm8962_reset(wm8962); 3810 3810 3811 + regcache_mark_dirty(wm8962->regmap); 3812 + 3811 3813 /* SYSCLK defaults to on; make sure it is off so we can safely 3812 3814 * write to registers if the device is declocked. 3813 3815 */
+28
sound/soc/soc-ops.c
··· 207 207 EXPORT_SYMBOL_GPL(snd_soc_info_volsw); 208 208 209 209 /** 210 + * snd_soc_info_volsw_sx - Mixer info callback for SX TLV controls 211 + * @kcontrol: mixer control 212 + * @uinfo: control element information 213 + * 214 + * Callback to provide information about a single mixer control, or a double 215 + * mixer control that spans 2 registers of the SX TLV type. SX TLV controls 216 + * have a range that represents both positive and negative values either side 217 + * of zero but without a sign bit. 218 + * 219 + * Returns 0 for success. 220 + */ 221 + int snd_soc_info_volsw_sx(struct snd_kcontrol *kcontrol, 222 + struct snd_ctl_elem_info *uinfo) 223 + { 224 + struct soc_mixer_control *mc = 225 + (struct soc_mixer_control *)kcontrol->private_value; 226 + 227 + snd_soc_info_volsw(kcontrol, uinfo); 228 + /* Max represents the number of levels in an SX control not the 229 + * maximum value, so add the minimum value back on 230 + */ 231 + uinfo->value.integer.max += mc->min; 232 + 233 + return 0; 234 + } 235 + EXPORT_SYMBOL_GPL(snd_soc_info_volsw_sx); 236 + 237 + /** 210 238 * snd_soc_get_volsw - single mixer get callback 211 239 * @kcontrol: mixer control 212 240 * @ucontrol: control element information
+9
tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
··· 25 25 26 26 #define FIXUP_SECTION ".ex_fixup" 27 27 28 + static inline unsigned long __fls(unsigned long x); 29 + 28 30 #include "word-at-a-time.h" 29 31 30 32 #include "utils.h" 31 33 34 + static inline unsigned long __fls(unsigned long x) 35 + { 36 + int lz; 37 + 38 + asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x)); 39 + return sizeof(unsigned long) - 1 - lz; 40 + } 32 41 33 42 static int page_size; 34 43 static char *mem_region;
+19
virt/kvm/arm/arch_timer.c
··· 137 137 void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu) 138 138 { 139 139 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; 140 + bool phys_active; 141 + int ret; 140 142 141 143 /* 142 144 * We're about to run this vcpu again, so there is no need to ··· 153 151 */ 154 152 if (kvm_timer_should_fire(vcpu)) 155 153 kvm_timer_inject_irq(vcpu); 154 + 155 + /* 156 + * We keep track of whether the edge-triggered interrupt has been 157 + * signalled to the vgic/guest, and if so, we mask the interrupt and 158 + * the physical distributor to prevent the timer from raising a 159 + * physical interrupt whenever we run a guest, preventing forward 160 + * VCPU progress. 161 + */ 162 + if (kvm_vgic_get_phys_irq_active(timer->map)) 163 + phys_active = true; 164 + else 165 + phys_active = false; 166 + 167 + ret = irq_set_irqchip_state(timer->map->irq, 168 + IRQCHIP_STATE_ACTIVE, 169 + phys_active); 170 + WARN_ON(ret); 156 171 } 157 172 158 173 /**
+55 -40
virt/kvm/arm/vgic.c
··· 531 531 return false; 532 532 } 533 533 534 + /* 535 + * If a mapped interrupt's state has been modified by the guest such that it 536 + * is no longer active or pending, without it have gone through the sync path, 537 + * then the map->active field must be cleared so the interrupt can be taken 538 + * again. 539 + */ 540 + static void vgic_handle_clear_mapped_irq(struct kvm_vcpu *vcpu) 541 + { 542 + struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; 543 + struct list_head *root; 544 + struct irq_phys_map_entry *entry; 545 + struct irq_phys_map *map; 546 + 547 + rcu_read_lock(); 548 + 549 + /* Check for PPIs */ 550 + root = &vgic_cpu->irq_phys_map_list; 551 + list_for_each_entry_rcu(entry, root, entry) { 552 + map = &entry->map; 553 + 554 + if (!vgic_dist_irq_is_pending(vcpu, map->virt_irq) && 555 + !vgic_irq_is_active(vcpu, map->virt_irq)) 556 + map->active = false; 557 + } 558 + 559 + rcu_read_unlock(); 560 + } 561 + 534 562 bool vgic_handle_clear_pending_reg(struct kvm *kvm, 535 563 struct kvm_exit_mmio *mmio, 536 564 phys_addr_t offset, int vcpu_id) ··· 589 561 vcpu_id, offset); 590 562 vgic_reg_access(mmio, reg, offset, mode); 591 563 564 + vgic_handle_clear_mapped_irq(kvm_get_vcpu(kvm, vcpu_id)); 592 565 vgic_update_state(kvm); 593 566 return true; 594 567 } ··· 627 598 ACCESS_READ_VALUE | ACCESS_WRITE_CLEARBIT); 628 599 629 600 if (mmio->is_write) { 601 + vgic_handle_clear_mapped_irq(kvm_get_vcpu(kvm, vcpu_id)); 630 602 vgic_update_state(kvm); 631 603 return true; 632 604 } ··· 1012 982 pend_percpu = vcpu->arch.vgic_cpu.pending_percpu; 1013 983 pend_shared = vcpu->arch.vgic_cpu.pending_shared; 1014 984 985 + if (!dist->enabled) { 986 + bitmap_zero(pend_percpu, VGIC_NR_PRIVATE_IRQS); 987 + bitmap_zero(pend_shared, nr_shared); 988 + return 0; 989 + } 990 + 1015 991 pending = vgic_bitmap_get_cpu_map(&dist->irq_pending, vcpu_id); 1016 992 enabled = vgic_bitmap_get_cpu_map(&dist->irq_enabled, vcpu_id); 1017 993 bitmap_and(pend_percpu, pending, enabled, VGIC_NR_PRIVATE_IRQS); ··· 1044 1008 struct vgic_dist *dist = &kvm->arch.vgic; 1045 1009 struct kvm_vcpu *vcpu; 1046 1010 int c; 1047 - 1048 - if (!dist->enabled) { 1049 - set_bit(0, dist->irq_pending_on_cpu); 1050 - return; 1051 - } 1052 1011 1053 1012 kvm_for_each_vcpu(c, vcpu, kvm) { 1054 1013 if (compute_pending_for_cpu(vcpu)) ··· 1123 1092 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; 1124 1093 struct vgic_lr vlr = vgic_get_lr(vcpu, lr_nr); 1125 1094 1095 + /* 1096 + * We must transfer the pending state back to the distributor before 1097 + * retiring the LR, otherwise we may loose edge-triggered interrupts. 1098 + */ 1099 + if (vlr.state & LR_STATE_PENDING) { 1100 + vgic_dist_irq_set_pending(vcpu, irq); 1101 + vlr.hwirq = 0; 1102 + } 1103 + 1126 1104 vlr.state = 0; 1127 1105 vgic_set_lr(vcpu, lr_nr, vlr); 1128 1106 clear_bit(lr_nr, vgic_cpu->lr_used); ··· 1172 1132 kvm_debug("Set active, clear distributor: 0x%x\n", vlr.state); 1173 1133 vgic_irq_clear_active(vcpu, irq); 1174 1134 vgic_update_state(vcpu->kvm); 1175 - } else if (vgic_dist_irq_is_pending(vcpu, irq)) { 1135 + } else { 1136 + WARN_ON(!vgic_dist_irq_is_pending(vcpu, irq)); 1176 1137 vlr.state |= LR_STATE_PENDING; 1177 1138 kvm_debug("Set pending: 0x%x\n", vlr.state); 1178 1139 } ··· 1281 1240 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; 1282 1241 struct vgic_dist *dist = &vcpu->kvm->arch.vgic; 1283 1242 unsigned long *pa_percpu, *pa_shared; 1284 - int i, vcpu_id, lr, ret; 1243 + int i, vcpu_id; 1285 1244 int overflow = 0; 1286 1245 int nr_shared = vgic_nr_shared_irqs(dist); 1287 1246 ··· 1335 1294 * adjust that if needed while exiting. 1336 1295 */ 1337 1296 clear_bit(vcpu_id, dist->irq_pending_on_cpu); 1338 - } 1339 - 1340 - for (lr = 0; lr < vgic->nr_lr; lr++) { 1341 - struct vgic_lr vlr; 1342 - 1343 - if (!test_bit(lr, vgic_cpu->lr_used)) 1344 - continue; 1345 - 1346 - vlr = vgic_get_lr(vcpu, lr); 1347 - 1348 - /* 1349 - * If we have a mapping, and the virtual interrupt is 1350 - * presented to the guest (as pending or active), then we must 1351 - * set the state to active in the physical world. See 1352 - * Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt. 1353 - */ 1354 - if (vlr.state & LR_HW) { 1355 - struct irq_phys_map *map; 1356 - map = vgic_irq_map_search(vcpu, vlr.irq); 1357 - 1358 - ret = irq_set_irqchip_state(map->irq, 1359 - IRQCHIP_STATE_ACTIVE, 1360 - true); 1361 - WARN_ON(ret); 1362 - } 1363 1297 } 1364 1298 } 1365 1299 ··· 1437 1421 return 0; 1438 1422 1439 1423 map = vgic_irq_map_search(vcpu, vlr.irq); 1440 - BUG_ON(!map || !map->active); 1424 + BUG_ON(!map); 1441 1425 1442 1426 ret = irq_get_irqchip_state(map->irq, 1443 1427 IRQCHIP_STATE_ACTIVE, ··· 1445 1429 1446 1430 WARN_ON(ret); 1447 1431 1448 - if (map->active) { 1449 - ret = irq_set_irqchip_state(map->irq, 1450 - IRQCHIP_STATE_ACTIVE, 1451 - false); 1452 - WARN_ON(ret); 1432 + if (map->active) 1453 1433 return 0; 1454 - } 1455 1434 1456 1435 return 1; 1457 1436 } ··· 1618 1607 } else { 1619 1608 if (level_triggered) { 1620 1609 vgic_dist_irq_clear_level(vcpu, irq_num); 1621 - if (!vgic_dist_irq_soft_pend(vcpu, irq_num)) 1610 + if (!vgic_dist_irq_soft_pend(vcpu, irq_num)) { 1622 1611 vgic_dist_irq_clear_pending(vcpu, irq_num); 1612 + vgic_cpu_irq_clear(vcpu, irq_num); 1613 + if (!compute_pending_for_cpu(vcpu)) 1614 + clear_bit(cpuid, dist->irq_pending_on_cpu); 1615 + } 1623 1616 } 1624 1617 1625 1618 ret = false;