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

Merge branch 'fixes' into misc

+1044 -778
+7 -31
Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt
··· 1 1 == Amlogic Meson pinmux controller == 2 2 3 3 Required properties for the root node: 4 - - compatible: "amlogic,meson8-pinctrl" or "amlogic,meson8b-pinctrl" 4 + - compatible: one of "amlogic,meson8-cbus-pinctrl" 5 + "amlogic,meson8b-cbus-pinctrl" 6 + "amlogic,meson8-aobus-pinctrl" 7 + "amlogic,meson8b-aobus-pinctrl" 5 8 - reg: address and size of registers controlling irq functionality 6 9 7 10 === GPIO sub-nodes === 8 11 9 - The 2 power domains of the controller (regular and always-on) are 10 - represented as sub-nodes and each of them acts as a GPIO controller. 12 + The GPIO bank for the controller is represented as a sub-node and it acts as a 13 + GPIO controller. 11 14 12 15 Required properties for sub-nodes are: 13 16 - reg: should contain address and size for mux, pull-enable, pull and ··· 20 17 when it is missing the "pull" registers are used instead 21 18 - gpio-controller: identifies the node as a gpio controller 22 19 - #gpio-cells: must be 2 23 - 24 - Valid sub-node names are: 25 - - "banks" for the regular domain 26 - - "ao-bank" for the always-on domain 27 20 28 21 === Other sub-nodes === 29 22 ··· 44 45 === Example === 45 46 46 47 pinctrl: pinctrl@c1109880 { 47 - compatible = "amlogic,meson8-pinctrl"; 48 + compatible = "amlogic,meson8-cbus-pinctrl"; 48 49 reg = <0xc1109880 0x10>; 49 50 #address-cells = <1>; 50 51 #size-cells = <1>; ··· 60 61 #gpio-cells = <2>; 61 62 }; 62 63 63 - gpio_ao: ao-bank@c1108030 { 64 - reg = <0xc8100014 0x4>, 65 - <0xc810002c 0x4>, 66 - <0xc8100024 0x8>; 67 - reg-names = "mux", "pull", "gpio"; 68 - gpio-controller; 69 - #gpio-cells = <2>; 70 - }; 71 - 72 64 nand { 73 65 mux { 74 66 groups = "nand_io", "nand_io_ce0", "nand_io_ce1", ··· 67 77 "nand_wen_clk", "nand_ren_clk", "nand_dqs", 68 78 "nand_ce2", "nand_ce3"; 69 79 function = "nand"; 70 - }; 71 - }; 72 - 73 - uart_ao_a { 74 - mux { 75 - groups = "uart_tx_ao_a", "uart_rx_ao_a", 76 - "uart_cts_ao_a", "uart_rts_ao_a"; 77 - function = "uart_ao"; 78 - }; 79 - 80 - conf { 81 - pins = "GPIOAO_0", "GPIOAO_1", 82 - "GPIOAO_2", "GPIOAO_3"; 83 - bias-disable; 84 80 }; 85 81 }; 86 82 };
+2
Documentation/kernel-parameters.txt
··· 4077 4077 sector if the number is odd); 4078 4078 i = IGNORE_DEVICE (don't bind to this 4079 4079 device); 4080 + j = NO_REPORT_LUNS (don't use report luns 4081 + command, uas only); 4080 4082 l = NOT_LOCKABLE (don't try to lock and 4081 4083 unlock ejectable media); 4082 4084 m = MAX_SECTORS_64 (don't transfer more
+1 -1
Documentation/usb/gadget_multi.txt
··· 43 43 First of all, Windows need to detect the gadget as an USB composite 44 44 gadget which on its own have some conditions[4]. If they are met, 45 45 Windows lets USB Generic Parent Driver[5] handle the device which then 46 - tries to much drivers for each individual interface (sort of, don't 46 + tries to match drivers for each individual interface (sort of, don't 47 47 get into too many details). 48 48 49 49 The good news is: you do not have to worry about most of the
+27
Documentation/x86/protection-keys.txt
··· 1 + Memory Protection Keys for Userspace (PKU aka PKEYs) is a CPU feature 2 + which will be found on future Intel CPUs. 3 + 4 + Memory Protection Keys provides a mechanism for enforcing page-based 5 + protections, but without requiring modification of the page tables 6 + when an application changes protection domains. It works by 7 + dedicating 4 previously ignored bits in each page table entry to a 8 + "protection key", giving 16 possible keys. 9 + 10 + There is also a new user-accessible register (PKRU) with two separate 11 + bits (Access Disable and Write Disable) for each key. Being a CPU 12 + register, PKRU is inherently thread-local, potentially giving each 13 + thread a different set of protections from every other thread. 14 + 15 + There are two new instructions (RDPKRU/WRPKRU) for reading and writing 16 + to the new register. The feature is only available in 64-bit mode, 17 + even though there is theoretically space in the PAE PTEs. These 18 + permissions are enforced on data access only and have no effect on 19 + instruction fetches. 20 + 21 + =========================== Config Option =========================== 22 + 23 + This config option adds approximately 1.5kb of text. and 50 bytes of 24 + data to the executable. A workload which does large O_DIRECT reads 25 + of holes in XFS files was run to exercise get_user_pages_fast(). No 26 + performance delta was observed with the config option 27 + enabled or disabled.
+1 -1
MAINTAINERS
··· 6252 6252 F: tools/testing/selftests 6253 6253 6254 6254 KERNEL VIRTUAL MACHINE (KVM) 6255 - M: Gleb Natapov <gleb@kernel.org> 6256 6255 M: Paolo Bonzini <pbonzini@redhat.com> 6256 + M: Radim Krčmář <rkrcmar@redhat.com> 6257 6257 L: kvm@vger.kernel.org 6258 6258 W: http://www.linux-kvm.org 6259 6259 T: git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+1 -1
Makefile
··· 1 1 VERSION = 4 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc3 4 + EXTRAVERSION = -rc4 5 5 NAME = Blurry Fish Butt 6 6 7 7 # *DOCUMENTATION*
+4 -1
arch/arm/boot/dts/am335x-baltos-ir5221.dts
··· 470 470 }; 471 471 472 472 &cpsw_emac0 { 473 - phy_id = <&davinci_mdio>, <0>; 474 473 phy-mode = "rmii"; 475 474 dual_emac_res_vlan = <1>; 475 + fixed-link { 476 + speed = <100>; 477 + full-duplex; 478 + }; 476 479 }; 477 480 478 481 &cpsw_emac1 {
+1 -1
arch/arm/boot/dts/am4372.dtsi
··· 207 207 ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>, 208 208 <&edma_tptc2 0>; 209 209 210 - ti,edma-memcpy-channels = <32 33>; 210 + ti,edma-memcpy-channels = <58 59>; 211 211 }; 212 212 213 213 edma_tptc0: tptc@49800000 {
+5
arch/arm/boot/dts/am43x-epos-evm.dts
··· 794 794 tx-num-evt = <32>; 795 795 rx-num-evt = <32>; 796 796 }; 797 + 798 + &synctimer_32kclk { 799 + assigned-clocks = <&mux_synctimer32k_ck>; 800 + assigned-clock-parents = <&clkdiv32k_ick>; 801 + };
+1 -1
arch/arm/boot/dts/armada-385-linksys.dtsi
··· 117 117 }; 118 118 119 119 /* USB part of the eSATA/USB 2.0 port */ 120 - usb@50000 { 120 + usb@58000 { 121 121 status = "okay"; 122 122 }; 123 123
+32 -25
arch/arm/boot/dts/meson8.dtsi
··· 91 91 clock-frequency = <141666666>; 92 92 }; 93 93 94 - pinctrl: pinctrl@c1109880 { 95 - compatible = "amlogic,meson8-pinctrl"; 94 + pinctrl_cbus: pinctrl@c1109880 { 95 + compatible = "amlogic,meson8-cbus-pinctrl"; 96 96 reg = <0xc1109880 0x10>; 97 97 #address-cells = <1>; 98 98 #size-cells = <1>; ··· 106 106 reg-names = "mux", "pull", "pull-enable", "gpio"; 107 107 gpio-controller; 108 108 #gpio-cells = <2>; 109 - }; 110 - 111 - gpio_ao: ao-bank@c1108030 { 112 - reg = <0xc8100014 0x4>, 113 - <0xc810002c 0x4>, 114 - <0xc8100024 0x8>; 115 - reg-names = "mux", "pull", "gpio"; 116 - gpio-controller; 117 - #gpio-cells = <2>; 118 - }; 119 - 120 - uart_ao_a_pins: uart_ao_a { 121 - mux { 122 - groups = "uart_tx_ao_a", "uart_rx_ao_a"; 123 - function = "uart_ao"; 124 - }; 125 - }; 126 - 127 - i2c_ao_pins: i2c_mst_ao { 128 - mux { 129 - groups = "i2c_mst_sck_ao", "i2c_mst_sda_ao"; 130 - function = "i2c_mst_ao"; 131 - }; 132 109 }; 133 110 134 111 spi_nor_pins: nor { ··· 134 157 }; 135 158 }; 136 159 160 + pinctrl_aobus: pinctrl@c8100084 { 161 + compatible = "amlogic,meson8-aobus-pinctrl"; 162 + reg = <0xc8100084 0xc>; 163 + #address-cells = <1>; 164 + #size-cells = <1>; 165 + ranges; 166 + 167 + gpio_ao: ao-bank@c1108030 { 168 + reg = <0xc8100014 0x4>, 169 + <0xc810002c 0x4>, 170 + <0xc8100024 0x8>; 171 + reg-names = "mux", "pull", "gpio"; 172 + gpio-controller; 173 + #gpio-cells = <2>; 174 + }; 175 + 176 + uart_ao_a_pins: uart_ao_a { 177 + mux { 178 + groups = "uart_tx_ao_a", "uart_rx_ao_a"; 179 + function = "uart_ao"; 180 + }; 181 + }; 182 + 183 + i2c_ao_pins: i2c_mst_ao { 184 + mux { 185 + groups = "i2c_mst_sck_ao", "i2c_mst_sda_ao"; 186 + function = "i2c_mst_ao"; 187 + }; 188 + }; 189 + }; 137 190 }; /* end of / */
+10 -2
arch/arm/boot/dts/meson8b.dtsi
··· 155 155 reg = <0xc1108000 0x4>, <0xc1104000 0x460>; 156 156 }; 157 157 158 - pinctrl: pinctrl@c1109880 { 159 - compatible = "amlogic,meson8b-pinctrl"; 158 + pinctrl_cbus: pinctrl@c1109880 { 159 + compatible = "amlogic,meson8b-cbus-pinctrl"; 160 160 reg = <0xc1109880 0x10>; 161 161 #address-cells = <1>; 162 162 #size-cells = <1>; ··· 171 171 gpio-controller; 172 172 #gpio-cells = <2>; 173 173 }; 174 + }; 175 + 176 + pinctrl_aobus: pinctrl@c8100084 { 177 + compatible = "amlogic,meson8b-aobus-pinctrl"; 178 + reg = <0xc8100084 0xc>; 179 + #address-cells = <1>; 180 + #size-cells = <1>; 181 + ranges; 174 182 175 183 gpio_ao: ao-bank@c1108030 { 176 184 reg = <0xc8100014 0x4>,
+1 -1
arch/arm/boot/dts/omap4.dtsi
··· 70 70 compatible = "arm,cortex-a9-twd-timer"; 71 71 clocks = <&mpu_periphclk>; 72 72 reg = <0x48240600 0x20>; 73 - interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_HIGH)>; 73 + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_EDGE_RISING)>; 74 74 interrupt-parent = <&gic>; 75 75 }; 76 76
+3
arch/arm/configs/u8500_defconfig
··· 63 63 CONFIG_TOUCHSCREEN_BU21013=y 64 64 CONFIG_INPUT_MISC=y 65 65 CONFIG_INPUT_AB8500_PONKEY=y 66 + CONFIG_RMI4_CORE=y 67 + CONFIG_RMI4_I2C=y 68 + CONFIG_RMI4_F11=y 66 69 # CONFIG_SERIO is not set 67 70 CONFIG_VT_HW_CONSOLE_BINDING=y 68 71 # CONFIG_LEGACY_PTYS is not set
+10 -3
arch/arm/kvm/arm.c
··· 1112 1112 { 1113 1113 cpu_pm_register_notifier(&hyp_init_cpu_pm_nb); 1114 1114 } 1115 + static void __init hyp_cpu_pm_exit(void) 1116 + { 1117 + cpu_pm_unregister_notifier(&hyp_init_cpu_pm_nb); 1118 + } 1115 1119 #else 1116 1120 static inline void hyp_cpu_pm_init(void) 1121 + { 1122 + } 1123 + static inline void hyp_cpu_pm_exit(void) 1117 1124 { 1118 1125 } 1119 1126 #endif ··· 1148 1141 /* 1149 1142 * Register CPU Hotplug notifier 1150 1143 */ 1151 - cpu_notifier_register_begin(); 1152 - err = __register_cpu_notifier(&hyp_init_cpu_nb); 1153 - cpu_notifier_register_done(); 1144 + err = register_cpu_notifier(&hyp_init_cpu_nb); 1154 1145 if (err) { 1155 1146 kvm_err("Cannot register KVM init CPU notifier (%d)\n", err); 1156 1147 return err; ··· 1198 1193 free_hyp_pgds(); 1199 1194 for_each_possible_cpu(cpu) 1200 1195 free_page(per_cpu(kvm_arm_hyp_stack_page, cpu)); 1196 + unregister_cpu_notifier(&hyp_init_cpu_nb); 1197 + hyp_cpu_pm_exit(); 1201 1198 } 1202 1199 1203 1200 static int init_vhe_mode(void)
+2 -2
arch/arm/mach-omap2/id.c
··· 669 669 case 0: 670 670 omap_revision = DRA722_REV_ES1_0; 671 671 break; 672 + case 1: 672 673 default: 673 - /* If we have no new revisions */ 674 - omap_revision = DRA722_REV_ES1_0; 674 + omap_revision = DRA722_REV_ES2_0; 675 675 break; 676 676 } 677 677 break;
+1
arch/arm/mach-omap2/io.c
··· 368 368 void __init dra7xx_map_io(void) 369 369 { 370 370 iotable_init(dra7xx_io_desc, ARRAY_SIZE(dra7xx_io_desc)); 371 + omap_barriers_init(); 371 372 } 372 373 #endif 373 374 /*
+4 -4
arch/arm/mach-omap2/omap_hwmod.c
··· 1416 1416 (sf & SYSC_HAS_CLOCKACTIVITY)) 1417 1417 _set_clockactivity(oh, oh->class->sysc->clockact, &v); 1418 1418 1419 - /* If the cached value is the same as the new value, skip the write */ 1420 - if (oh->_sysc_cache != v) 1421 - _write_sysconfig(v, oh); 1419 + _write_sysconfig(v, oh); 1422 1420 1423 1421 /* 1424 1422 * Set the autoidle bit only after setting the smartidle bit ··· 1479 1481 _set_master_standbymode(oh, idlemode, &v); 1480 1482 } 1481 1483 1482 - _write_sysconfig(v, oh); 1484 + /* If the cached value is the same as the new value, skip the write */ 1485 + if (oh->_sysc_cache != v) 1486 + _write_sysconfig(v, oh); 1483 1487 } 1484 1488 1485 1489 /**
+2
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
··· 582 582 .user = OCP_USER_MPU, 583 583 }; 584 584 585 + /* USB needs udelay 1 after reset at least on hp t410, use 2 for margin */ 585 586 static struct omap_hwmod_class_sysconfig dm81xx_usbhsotg_sysc = { 586 587 .rev_offs = 0x0, 587 588 .sysc_offs = 0x10, 589 + .srst_udelay = 2, 588 590 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE | 589 591 SYSC_HAS_SOFTRESET, 590 592 .idlemodes = SIDLE_SMART | MSTANDBY_FORCE | MSTANDBY_SMART,
+1
arch/arm/mach-omap2/soc.h
··· 489 489 #define DRA752_REV_ES2_0 (DRA7XX_CLASS | (0x52 << 16) | (0x20 << 8)) 490 490 #define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8)) 491 491 #define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8)) 492 + #define DRA722_REV_ES2_0 (DRA7XX_CLASS | (0x22 << 16) | (0x20 << 8)) 492 493 493 494 void omap2xxx_check_revision(void); 494 495 void omap3xxx_check_revision(void);
+1
arch/arm/mach-pxa/devices.c
··· 1235 1235 void __init pxa2xx_set_dmac_info(int nb_channels, int nb_requestors) 1236 1236 { 1237 1237 pxa_dma_pdata.dma_channels = nb_channels; 1238 + pxa_dma_pdata.nb_requestors = nb_requestors; 1238 1239 pxa_register_device(&pxa2xx_pxa_dma, &pxa_dma_pdata); 1239 1240 }
+2 -8
arch/arm/mach-sa1100/Kconfig
··· 61 61 select MFD_IPAQ_MICRO 62 62 help 63 63 Say Y here if you intend to run this kernel on the Compaq iPAQ 64 - H3100 handheld computer. Information about this machine and the 65 - Linux port to this machine can be found at: 66 - 67 - <http://www.handhelds.org/Compaq/index.html#iPAQ_H3100> 64 + H3100 handheld computer. 68 65 69 66 config SA1100_H3600 70 67 bool "Compaq iPAQ H3600/H3700" ··· 70 73 select MFD_IPAQ_MICRO 71 74 help 72 75 Say Y here if you intend to run this kernel on the Compaq iPAQ 73 - H3600 handheld computer. Information about this machine and the 74 - Linux port to this machine can be found at: 75 - 76 - <http://www.handhelds.org/Compaq/index.html#iPAQ_H3600> 76 + H3600 and H3700 handheld computers. 77 77 78 78 config SA1100_BADGE4 79 79 bool "HP Labs BadgePAD 4"
+1 -1
arch/arm/mach-uniphier/platsmp.c
··· 120 120 if (ret) 121 121 return ret; 122 122 123 - uniphier_smp_rom_boot_rsv2 = ioremap(rom_rsv2_phys, sizeof(SZ_4)); 123 + uniphier_smp_rom_boot_rsv2 = ioremap(rom_rsv2_phys, SZ_4); 124 124 if (!uniphier_smp_rom_boot_rsv2) { 125 125 pr_err("failed to map ROM_BOOT_RSV2 register\n"); 126 126 return -ENOMEM;
+9 -6
arch/arm64/boot/dts/broadcom/vulcan.dtsi
··· 108 108 reg = <0x0 0x30000000 0x0 0x10000000>; 109 109 reg-names = "PCI ECAM"; 110 110 111 - /* IO 0x4000_0000 - 0x4001_0000 */ 112 - ranges = <0x01000000 0 0x40000000 0 0x40000000 0 0x00010000 113 - /* MEM 0x4800_0000 - 0x5000_0000 */ 114 - 0x02000000 0 0x48000000 0 0x48000000 0 0x08000000 115 - /* MEM64 pref 0x6_0000_0000 - 0x7_0000_0000 */ 116 - 0x43000000 6 0x00000000 6 0x00000000 1 0x00000000>; 111 + /* 112 + * PCI ranges: 113 + * IO no supported 114 + * MEM 0x4000_0000 - 0x6000_0000 115 + * MEM64 pref 0x40_0000_0000 - 0x60_0000_0000 116 + */ 117 + ranges = 118 + <0x02000000 0 0x40000000 0 0x40000000 0 0x20000000 119 + 0x43000000 0x40 0x00000000 0x40 0x00000000 0x20 0x00000000>; 117 120 interrupt-map-mask = <0 0 0 7>; 118 121 interrupt-map = 119 122 /* addr pin ic icaddr icintr */
+2 -4
arch/arm64/include/asm/kvm_arm.h
··· 151 151 */ 152 152 #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \ 153 153 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ 154 - VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \ 155 - VTCR_EL2_RES1) 154 + VTCR_EL2_SL0_LVL1 | VTCR_EL2_RES1) 156 155 #define VTTBR_X (38 - VTCR_EL2_T0SZ_40B) 157 156 #else 158 157 /* ··· 162 163 */ 163 164 #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \ 164 165 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ 165 - VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \ 166 - VTCR_EL2_RES1) 166 + VTCR_EL2_SL0_LVL1 | VTCR_EL2_RES1) 167 167 #define VTTBR_X (37 - VTCR_EL2_T0SZ_40B) 168 168 #endif 169 169
+1 -1
arch/arm64/include/asm/kvm_asm.h
··· 54 54 55 55 extern u32 __kvm_get_mdcr_el2(void); 56 56 57 - extern void __init_stage2_translation(void); 57 + extern u32 __init_stage2_translation(void); 58 58 59 59 #endif 60 60
+4 -3
arch/arm64/include/asm/kvm_host.h
··· 369 369 int kvm_arm_vcpu_arch_has_attr(struct kvm_vcpu *vcpu, 370 370 struct kvm_device_attr *attr); 371 371 372 - /* #define kvm_call_hyp(f, ...) __kvm_call_hyp(kvm_ksym_ref(f), ##__VA_ARGS__) */ 373 - 374 372 static inline void __cpu_init_stage2(void) 375 373 { 376 - kvm_call_hyp(__init_stage2_translation); 374 + u32 parange = kvm_call_hyp(__init_stage2_translation); 375 + 376 + WARN_ONCE(parange < 40, 377 + "PARange is %d bits, unsupported configuration!", parange); 377 378 } 378 379 379 380 #endif /* __ARM64_KVM_HOST_H__ */
+37 -2
arch/arm64/kvm/hyp/s2-setup.c
··· 20 20 #include <asm/kvm_asm.h> 21 21 #include <asm/kvm_hyp.h> 22 22 23 - void __hyp_text __init_stage2_translation(void) 23 + u32 __hyp_text __init_stage2_translation(void) 24 24 { 25 25 u64 val = VTCR_EL2_FLAGS; 26 + u64 parange; 26 27 u64 tmp; 27 28 28 29 /* ··· 31 30 * bits in VTCR_EL2. Amusingly, the PARange is 4 bits, while 32 31 * PS is only 3. Fortunately, bit 19 is RES0 in VTCR_EL2... 33 32 */ 34 - val |= (read_sysreg(id_aa64mmfr0_el1) & 7) << 16; 33 + parange = read_sysreg(id_aa64mmfr0_el1) & 7; 34 + val |= parange << 16; 35 + 36 + /* Compute the actual PARange... */ 37 + switch (parange) { 38 + case 0: 39 + parange = 32; 40 + break; 41 + case 1: 42 + parange = 36; 43 + break; 44 + case 2: 45 + parange = 40; 46 + break; 47 + case 3: 48 + parange = 42; 49 + break; 50 + case 4: 51 + parange = 44; 52 + break; 53 + case 5: 54 + default: 55 + parange = 48; 56 + break; 57 + } 58 + 59 + /* 60 + * ... and clamp it to 40 bits, unless we have some braindead 61 + * HW that implements less than that. In all cases, we'll 62 + * return that value for the rest of the kernel to decide what 63 + * to do. 64 + */ 65 + val |= 64 - (parange > 40 ? 40 : parange); 35 66 36 67 /* 37 68 * Read the VMIDBits bits from ID_AA64MMFR1_EL1 and set the VS ··· 75 42 VTCR_EL2_VS_8BIT; 76 43 77 44 write_sysreg(val, vtcr_el2); 45 + 46 + return parange; 78 47 }
+1 -7
arch/m68k/coldfire/gpio.c
··· 158 158 return -EINVAL; 159 159 } 160 160 161 - static struct bus_type mcfgpio_subsys = { 162 - .name = "gpio", 163 - .dev_name = "gpio", 164 - }; 165 - 166 161 static struct gpio_chip mcfgpio_chip = { 167 162 .label = "mcfgpio", 168 163 .request = mcfgpio_request, ··· 173 178 174 179 static int __init mcfgpio_sysinit(void) 175 180 { 176 - gpiochip_add_data(&mcfgpio_chip, NULL); 177 - return subsys_system_register(&mcfgpio_subsys, NULL); 181 + return gpiochip_add_data(&mcfgpio_chip, NULL); 178 182 } 179 183 180 184 core_initcall(mcfgpio_sysinit);
+2 -2
arch/parisc/Kconfig
··· 4 4 select ARCH_MIGHT_HAVE_PC_PARPORT 5 5 select HAVE_IDE 6 6 select HAVE_OPROFILE 7 - select HAVE_FUNCTION_TRACER if 64BIT 8 - select HAVE_FUNCTION_GRAPH_TRACER if 64BIT 7 + select HAVE_FUNCTION_TRACER 8 + select HAVE_FUNCTION_GRAPH_TRACER 9 9 select ARCH_WANT_FRAME_POINTERS 10 10 select RTC_CLASS 11 11 select RTC_DRV_GENERIC
+4
arch/parisc/Kconfig.debug
··· 2 2 3 3 source "lib/Kconfig.debug" 4 4 5 + config TRACE_IRQFLAGS_SUPPORT 6 + def_bool y 7 + 5 8 config DEBUG_RODATA 6 9 bool "Write protect kernel read-only data structures" 7 10 depends on DEBUG_KERNEL 11 + default y 8 12 help 9 13 Mark the kernel read-only data as write-protected in the pagetables, 10 14 in order to catch accidental (and incorrect) writes to such const
+1 -3
arch/parisc/Makefile
··· 62 62 63 63 # Without this, "ld -r" results in .text sections that are too big 64 64 # (> 0x40000) for branches to reach stubs. 65 - ifndef CONFIG_FUNCTION_TRACER 66 - cflags-y += -ffunction-sections 67 - endif 65 + cflags-y += -ffunction-sections 68 66 69 67 # Use long jumps instead of long branches (needed if your linker fails to 70 68 # link a too big vmlinux executable). Not enabled for building modules.
+1 -17
arch/parisc/include/asm/ftrace.h
··· 4 4 #ifndef __ASSEMBLY__ 5 5 extern void mcount(void); 6 6 7 - /* 8 - * Stack of return addresses for functions of a thread. 9 - * Used in struct thread_info 10 - */ 11 - struct ftrace_ret_stack { 12 - unsigned long ret; 13 - unsigned long func; 14 - unsigned long long calltime; 15 - }; 16 - 17 - /* 18 - * Primary handler of a function return. 19 - * It relays on ftrace_return_to_handler. 20 - * Defined in entry.S 21 - */ 22 - extern void return_to_handler(void); 23 - 7 + #define MCOUNT_INSN_SIZE 4 24 8 25 9 extern unsigned long return_address(unsigned int); 26 10
-4
arch/parisc/kernel/Makefile
··· 15 15 # Do not profile debug and lowlevel utilities 16 16 CFLAGS_REMOVE_ftrace.o = -pg 17 17 CFLAGS_REMOVE_cache.o = -pg 18 - CFLAGS_REMOVE_irq.o = -pg 19 - CFLAGS_REMOVE_pacache.o = -pg 20 18 CFLAGS_REMOVE_perf.o = -pg 21 - CFLAGS_REMOVE_traps.o = -pg 22 - CFLAGS_REMOVE_unaligned.o = -pg 23 19 CFLAGS_REMOVE_unwind.o = -pg 24 20 endif 25 21
+76 -21
arch/parisc/kernel/entry.S
··· 1970 1970 b intr_restore 1971 1971 copy %r25,%r16 1972 1972 1973 - .import schedule,code 1974 1973 syscall_do_resched: 1975 - BL schedule,%r2 1974 + load32 syscall_check_resched,%r2 /* if resched, we start over again */ 1975 + load32 schedule,%r19 1976 + bv %r0(%r19) /* jumps to schedule() */ 1976 1977 #ifdef CONFIG_64BIT 1977 1978 ldo -16(%r30),%r29 /* Reference param save area */ 1978 1979 #else 1979 1980 nop 1980 1981 #endif 1981 - b syscall_check_resched /* if resched, we start over again */ 1982 - nop 1983 1982 ENDPROC(syscall_exit) 1984 1983 1985 1984 1986 1985 #ifdef CONFIG_FUNCTION_TRACER 1986 + 1987 1987 .import ftrace_function_trampoline,code 1988 - ENTRY(_mcount) 1989 - copy %r3, %arg2 1988 + .align L1_CACHE_BYTES 1989 + .globl mcount 1990 + .type mcount, @function 1991 + ENTRY(mcount) 1992 + _mcount: 1993 + .export _mcount,data 1994 + .proc 1995 + .callinfo caller,frame=0 1996 + .entry 1997 + /* 1998 + * The 64bit mcount() function pointer needs 4 dwords, of which the 1999 + * first two are free. We optimize it here and put 2 instructions for 2000 + * calling mcount(), and 2 instructions for ftrace_stub(). That way we 2001 + * have all on one L1 cacheline. 2002 + */ 1990 2003 b ftrace_function_trampoline 1991 - nop 1992 - ENDPROC(_mcount) 1993 - 1994 - ENTRY(return_to_handler) 1995 - load32 return_trampoline, %rp 1996 - copy %ret0, %arg0 1997 - copy %ret1, %arg1 1998 - b ftrace_return_to_handler 1999 - nop 2000 - return_trampoline: 2001 - copy %ret0, %rp 2002 - copy %r23, %ret0 2003 - copy %r24, %ret1 2004 - 2005 - .globl ftrace_stub 2004 + copy %r3, %arg2 /* caller original %sp */ 2006 2005 ftrace_stub: 2006 + .globl ftrace_stub 2007 + .type ftrace_stub, @function 2008 + #ifdef CONFIG_64BIT 2009 + bve (%rp) 2010 + #else 2007 2011 bv %r0(%rp) 2012 + #endif 2008 2013 nop 2014 + #ifdef CONFIG_64BIT 2015 + .dword mcount 2016 + .dword 0 /* code in head.S puts value of global gp here */ 2017 + #endif 2018 + .exit 2019 + .procend 2020 + ENDPROC(mcount) 2021 + 2022 + .align 8 2023 + .globl return_to_handler 2024 + .type return_to_handler, @function 2025 + ENTRY(return_to_handler) 2026 + .proc 2027 + .callinfo caller,frame=FRAME_SIZE 2028 + .entry 2029 + .export parisc_return_to_handler,data 2030 + parisc_return_to_handler: 2031 + copy %r3,%r1 2032 + STREG %r0,-RP_OFFSET(%sp) /* store 0 as %rp */ 2033 + copy %sp,%r3 2034 + STREGM %r1,FRAME_SIZE(%sp) 2035 + STREG %ret0,8(%r3) 2036 + STREG %ret1,16(%r3) 2037 + 2038 + #ifdef CONFIG_64BIT 2039 + loadgp 2040 + #endif 2041 + 2042 + /* call ftrace_return_to_handler(0) */ 2043 + #ifdef CONFIG_64BIT 2044 + ldo -16(%sp),%ret1 /* Reference param save area */ 2045 + #endif 2046 + BL ftrace_return_to_handler,%r2 2047 + ldi 0,%r26 2048 + copy %ret0,%rp 2049 + 2050 + /* restore original return values */ 2051 + LDREG 8(%r3),%ret0 2052 + LDREG 16(%r3),%ret1 2053 + 2054 + /* return from function */ 2055 + #ifdef CONFIG_64BIT 2056 + bve (%rp) 2057 + #else 2058 + bv %r0(%rp) 2059 + #endif 2060 + LDREGM -FRAME_SIZE(%sp),%r3 2061 + .exit 2062 + .procend 2009 2063 ENDPROC(return_to_handler) 2064 + 2010 2065 #endif /* CONFIG_FUNCTION_TRACER */ 2011 2066 2012 2067 #ifdef CONFIG_IRQSTACKS
+24 -124
arch/parisc/kernel/ftrace.c
··· 1 1 /* 2 2 * Code for tracing calls in Linux kernel. 3 - * Copyright (C) 2009 Helge Deller <deller@gmx.de> 3 + * Copyright (C) 2009-2016 Helge Deller <deller@gmx.de> 4 4 * 5 5 * based on code for x86 which is: 6 6 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> ··· 13 13 #include <linux/init.h> 14 14 #include <linux/ftrace.h> 15 15 16 + #include <asm/assembly.h> 16 17 #include <asm/sections.h> 17 18 #include <asm/ftrace.h> 18 19 19 20 20 - 21 21 #ifdef CONFIG_FUNCTION_GRAPH_TRACER 22 - 23 - /* Add a function return address to the trace stack on thread info.*/ 24 - static int push_return_trace(unsigned long ret, unsigned long long time, 25 - unsigned long func, int *depth) 26 - { 27 - int index; 28 - 29 - if (!current->ret_stack) 30 - return -EBUSY; 31 - 32 - /* The return trace stack is full */ 33 - if (current->curr_ret_stack == FTRACE_RETFUNC_DEPTH - 1) { 34 - atomic_inc(&current->trace_overrun); 35 - return -EBUSY; 36 - } 37 - 38 - index = ++current->curr_ret_stack; 39 - barrier(); 40 - current->ret_stack[index].ret = ret; 41 - current->ret_stack[index].func = func; 42 - current->ret_stack[index].calltime = time; 43 - *depth = index; 44 - 45 - return 0; 46 - } 47 - 48 - /* Retrieve a function return address to the trace stack on thread info.*/ 49 - static void pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret) 50 - { 51 - int index; 52 - 53 - index = current->curr_ret_stack; 54 - 55 - if (unlikely(index < 0)) { 56 - ftrace_graph_stop(); 57 - WARN_ON(1); 58 - /* Might as well panic, otherwise we have no where to go */ 59 - *ret = (unsigned long) 60 - dereference_function_descriptor(&panic); 61 - return; 62 - } 63 - 64 - *ret = current->ret_stack[index].ret; 65 - trace->func = current->ret_stack[index].func; 66 - trace->calltime = current->ret_stack[index].calltime; 67 - trace->overrun = atomic_read(&current->trace_overrun); 68 - trace->depth = index; 69 - barrier(); 70 - current->curr_ret_stack--; 71 - 72 - } 73 - 74 - /* 75 - * Send the trace to the ring-buffer. 76 - * @return the original return address. 77 - */ 78 - unsigned long ftrace_return_to_handler(unsigned long retval0, 79 - unsigned long retval1) 80 - { 81 - struct ftrace_graph_ret trace; 82 - unsigned long ret; 83 - 84 - pop_return_trace(&trace, &ret); 85 - trace.rettime = local_clock(); 86 - ftrace_graph_return(&trace); 87 - 88 - if (unlikely(!ret)) { 89 - ftrace_graph_stop(); 90 - WARN_ON(1); 91 - /* Might as well panic. What else to do? */ 92 - ret = (unsigned long) 93 - dereference_function_descriptor(&panic); 94 - } 95 - 96 - /* HACK: we hand over the old functions' return values 97 - in %r23 and %r24. Assembly in entry.S will take care 98 - and move those to their final registers %ret0 and %ret1 */ 99 - asm( "copy %0, %%r23 \n\t" 100 - "copy %1, %%r24 \n" : : "r" (retval0), "r" (retval1) ); 101 - 102 - return ret; 103 - } 104 - 105 22 /* 106 23 * Hook the return address and push it in the stack of return addrs 107 24 * in current thread info. 108 25 */ 109 - void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) 26 + static void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) 110 27 { 111 28 unsigned long old; 112 - unsigned long long calltime; 113 29 struct ftrace_graph_ent trace; 30 + extern int parisc_return_to_handler; 114 31 115 32 if (unlikely(ftrace_graph_is_dead())) 116 33 return; ··· 36 119 return; 37 120 38 121 old = *parent; 39 - *parent = (unsigned long) 40 - dereference_function_descriptor(&return_to_handler); 41 - 42 - if (unlikely(!__kernel_text_address(old))) { 43 - ftrace_graph_stop(); 44 - *parent = old; 45 - WARN_ON(1); 46 - return; 47 - } 48 - 49 - calltime = local_clock(); 50 - 51 - if (push_return_trace(old, calltime, 52 - self_addr, &trace.depth) == -EBUSY) { 53 - *parent = old; 54 - return; 55 - } 56 122 57 123 trace.func = self_addr; 124 + trace.depth = current->curr_ret_stack + 1; 58 125 59 126 /* Only trace if the calling function expects to */ 60 - if (!ftrace_graph_entry(&trace)) { 61 - current->curr_ret_stack--; 62 - *parent = old; 63 - } 64 - } 127 + if (!ftrace_graph_entry(&trace)) 128 + return; 65 129 130 + if (ftrace_push_return_trace(old, self_addr, &trace.depth, 131 + 0 ) == -EBUSY) 132 + return; 133 + 134 + /* activate parisc_return_to_handler() as return point */ 135 + *parent = (unsigned long) &parisc_return_to_handler; 136 + } 66 137 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 67 138 68 - 69 - void ftrace_function_trampoline(unsigned long parent, 139 + void notrace ftrace_function_trampoline(unsigned long parent, 70 140 unsigned long self_addr, 71 141 unsigned long org_sp_gr3) 72 142 { 73 - extern ftrace_func_t ftrace_trace_function; 143 + extern ftrace_func_t ftrace_trace_function; /* depends on CONFIG_DYNAMIC_FTRACE */ 144 + extern int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace); 74 145 75 146 if (ftrace_trace_function != ftrace_stub) { 76 - ftrace_trace_function(parent, self_addr); 147 + /* struct ftrace_ops *op, struct pt_regs *regs); */ 148 + ftrace_trace_function(parent, self_addr, NULL, NULL); 77 149 return; 78 150 } 151 + 79 152 #ifdef CONFIG_FUNCTION_GRAPH_TRACER 80 - if (ftrace_graph_entry && ftrace_graph_return) { 81 - unsigned long sp; 153 + if (ftrace_graph_return != (trace_func_graph_ret_t) ftrace_stub || 154 + ftrace_graph_entry != ftrace_graph_entry_stub) { 82 155 unsigned long *parent_rp; 83 156 84 - asm volatile ("copy %%r30, %0" : "=r"(sp)); 85 - /* sanity check: is stack pointer which we got from 86 - assembler function in entry.S in a reasonable 87 - range compared to current stack pointer? */ 88 - if ((sp - org_sp_gr3) > 0x400) 89 - return; 90 - 91 157 /* calculate pointer to %rp in stack */ 92 - parent_rp = (unsigned long *) org_sp_gr3 - 0x10; 158 + parent_rp = (unsigned long *) (org_sp_gr3 - RP_OFFSET); 93 159 /* sanity check: parent_rp should hold parent */ 94 160 if (*parent_rp != parent) 95 161 return; 96 - 162 + 97 163 prepare_ftrace_return(parent_rp, self_addr); 98 164 return; 99 165 }
+9
arch/parisc/kernel/head.S
··· 129 129 /* And the stack pointer too */ 130 130 ldo THREAD_SZ_ALGN(%r6),%sp 131 131 132 + #if defined(CONFIG_64BIT) && defined(CONFIG_FUNCTION_TRACER) 133 + .import _mcount,data 134 + /* initialize mcount FPTR */ 135 + /* Get the global data pointer */ 136 + loadgp 137 + load32 PA(_mcount), %r10 138 + std %dp,0x18(%r10) 139 + #endif 140 + 132 141 #ifdef CONFIG_SMP 133 142 /* Set the smp rendezvous address into page zero. 134 143 ** It would be safer to do this in init_smp_config() but
-5
arch/sh/include/asm/smp.h
··· 34 34 DECLARE_PER_CPU(int, cpu_state); 35 35 36 36 void smp_message_recv(unsigned int msg); 37 - void smp_timer_broadcast(const struct cpumask *mask); 38 - 39 - void local_timer_interrupt(void); 40 - void local_timer_setup(unsigned int cpu); 41 - void local_timer_stop(unsigned int cpu); 42 37 43 38 void arch_send_call_function_single_ipi(int cpu); 44 39 void arch_send_call_function_ipi_mask(const struct cpumask *mask);
+1 -1
arch/sh/include/asm/topology.h
··· 17 17 18 18 #define mc_capable() (1) 19 19 20 - const struct cpumask *cpu_coregroup_mask(unsigned int cpu); 20 + const struct cpumask *cpu_coregroup_mask(int cpu); 21 21 22 22 extern cpumask_t cpu_core_map[NR_CPUS]; 23 23
-2
arch/sh/kernel/cpu/sh4a/smp-shx3.c
··· 73 73 { 74 74 int i; 75 75 76 - local_timer_setup(0); 77 - 78 76 BUILD_BUG_ON(SMP_MSG_NR >= 8); 79 77 80 78 for (i = 0; i < SMP_MSG_NR; i++)
+2 -2
arch/sh/kernel/topology.c
··· 21 21 cpumask_t cpu_core_map[NR_CPUS]; 22 22 EXPORT_SYMBOL(cpu_core_map); 23 23 24 - static cpumask_t cpu_coregroup_map(unsigned int cpu) 24 + static cpumask_t cpu_coregroup_map(int cpu) 25 25 { 26 26 /* 27 27 * Presently all SH-X3 SMP cores are multi-cores, so just keep it ··· 30 30 return *cpu_possible_mask; 31 31 } 32 32 33 - const struct cpumask *cpu_coregroup_mask(unsigned int cpu) 33 + const struct cpumask *cpu_coregroup_mask(int cpu) 34 34 { 35 35 return &cpu_core_map[cpu]; 36 36 }
+13 -1
arch/x86/boot/compressed/Makefile
··· 26 26 vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 27 27 28 28 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 29 - KBUILD_CFLAGS += -fno-strict-aliasing -fPIC 29 + KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC) 30 30 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING 31 31 cflags-$(CONFIG_X86_32) := -march=i386 32 32 cflags-$(CONFIG_X86_64) := -mcmodel=small ··· 40 40 UBSAN_SANITIZE :=n 41 41 42 42 LDFLAGS := -m elf_$(UTS_MACHINE) 43 + ifeq ($(CONFIG_RELOCATABLE),y) 44 + # If kernel is relocatable, build compressed kernel as PIE. 45 + ifeq ($(CONFIG_X86_32),y) 46 + LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker) 47 + else 48 + # To build 64-bit compressed kernel as PIE, we disable relocation 49 + # overflow check to avoid relocation overflow error with a new linker 50 + # command-line option, -z noreloc-overflow. 51 + LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ 52 + && echo "-z noreloc-overflow -pie --no-dynamic-linker") 53 + endif 54 + endif 43 55 LDFLAGS_vmlinux := -T 44 56 45 57 hostprogs-y := mkpiggy
+28
arch/x86/boot/compressed/head_32.S
··· 31 31 #include <asm/asm-offsets.h> 32 32 #include <asm/bootparam.h> 33 33 34 + /* 35 + * The 32-bit x86 assembler in binutils 2.26 will generate R_386_GOT32X 36 + * relocation to get the symbol address in PIC. When the compressed x86 37 + * kernel isn't built as PIC, the linker optimizes R_386_GOT32X 38 + * relocations to their fixed symbol addresses. However, when the 39 + * compressed x86 kernel is loaded at a different address, it leads 40 + * to the following load failure: 41 + * 42 + * Failed to allocate space for phdrs 43 + * 44 + * during the decompression stage. 45 + * 46 + * If the compressed x86 kernel is relocatable at run-time, it should be 47 + * compiled with -fPIE, instead of -fPIC, if possible and should be built as 48 + * Position Independent Executable (PIE) so that linker won't optimize 49 + * R_386_GOT32X relocation to its fixed symbol address. Older 50 + * linkers generate R_386_32 relocations against locally defined symbols, 51 + * _bss, _ebss, _got and _egot, in PIE. It isn't wrong, just less 52 + * optimal than R_386_RELATIVE. But the x86 kernel fails to properly handle 53 + * R_386_32 relocations when relocating the kernel. To generate 54 + * R_386_RELATIVE relocations, we mark _bss, _ebss, _got and _egot as 55 + * hidden: 56 + */ 57 + .hidden _bss 58 + .hidden _ebss 59 + .hidden _got 60 + .hidden _egot 61 + 34 62 __HEAD 35 63 ENTRY(startup_32) 36 64 #ifdef CONFIG_EFI_STUB
+8
arch/x86/boot/compressed/head_64.S
··· 33 33 #include <asm/asm-offsets.h> 34 34 #include <asm/bootparam.h> 35 35 36 + /* 37 + * Locally defined symbols should be marked hidden: 38 + */ 39 + .hidden _bss 40 + .hidden _ebss 41 + .hidden _got 42 + .hidden _egot 43 + 36 44 __HEAD 37 45 .code32 38 46 ENTRY(startup_32)
+2 -2
arch/x86/kernel/cpu/mcheck/mce-genpool.c
··· 29 29 void mce_gen_pool_process(void) 30 30 { 31 31 struct llist_node *head; 32 - struct mce_evt_llist *node; 32 + struct mce_evt_llist *node, *tmp; 33 33 struct mce *mce; 34 34 35 35 head = llist_del_all(&mce_event_llist); ··· 37 37 return; 38 38 39 39 head = llist_reverse_order(head); 40 - llist_for_each_entry(node, head, llnode) { 40 + llist_for_each_entry_safe(node, tmp, head, llnode) { 41 41 mce = &node->mce; 42 42 atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, mce); 43 43 gen_pool_free(mce_evt_pool, (unsigned long)node, sizeof(*node));
+37
arch/x86/kernel/setup.c
··· 146 146 147 147 struct boot_params boot_params; 148 148 149 + /* 150 + * Machine setup.. 151 + */ 152 + static struct resource data_resource = { 153 + .name = "Kernel data", 154 + .start = 0, 155 + .end = 0, 156 + .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM 157 + }; 158 + 159 + static struct resource code_resource = { 160 + .name = "Kernel code", 161 + .start = 0, 162 + .end = 0, 163 + .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM 164 + }; 165 + 166 + static struct resource bss_resource = { 167 + .name = "Kernel bss", 168 + .start = 0, 169 + .end = 0, 170 + .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM 171 + }; 172 + 173 + 149 174 #ifdef CONFIG_X86_32 150 175 /* cpu data as detected by the assembly code in head.S */ 151 176 struct cpuinfo_x86 new_cpu_data = { ··· 949 924 950 925 mpx_mm_init(&init_mm); 951 926 927 + code_resource.start = __pa_symbol(_text); 928 + code_resource.end = __pa_symbol(_etext)-1; 929 + data_resource.start = __pa_symbol(_etext); 930 + data_resource.end = __pa_symbol(_edata)-1; 931 + bss_resource.start = __pa_symbol(__bss_start); 932 + bss_resource.end = __pa_symbol(__bss_stop)-1; 933 + 952 934 #ifdef CONFIG_CMDLINE_BOOL 953 935 #ifdef CONFIG_CMDLINE_OVERRIDE 954 936 strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); ··· 1018 986 init_hypervisor_platform(); 1019 987 1020 988 x86_init.resources.probe_roms(); 989 + 990 + /* after parse_early_param, so could debug it */ 991 + insert_resource(&iomem_resource, &code_resource); 992 + insert_resource(&iomem_resource, &data_resource); 993 + insert_resource(&iomem_resource, &bss_resource); 1021 994 1022 995 e820_add_kernel_range(); 1023 996 trim_bios_range();
+1
arch/x86/kvm/cpuid.c
··· 534 534 do_cpuid_1_ent(&entry[i], function, idx); 535 535 if (idx == 1) { 536 536 entry[i].eax &= kvm_cpuid_D_1_eax_x86_features; 537 + cpuid_mask(&entry[i].eax, CPUID_D_1_EAX); 537 538 entry[i].ebx = 0; 538 539 if (entry[i].eax & (F(XSAVES)|F(XSAVEC))) 539 540 entry[i].ebx =
+4 -5
arch/x86/kvm/mmu.h
··· 173 173 int index = (pfec >> 1) + 174 174 (smap >> (X86_EFLAGS_AC_BIT - PFERR_RSVD_BIT + 1)); 175 175 bool fault = (mmu->permissions[index] >> pte_access) & 1; 176 + u32 errcode = PFERR_PRESENT_MASK; 176 177 177 178 WARN_ON(pfec & (PFERR_PK_MASK | PFERR_RSVD_MASK)); 178 - pfec |= PFERR_PRESENT_MASK; 179 - 180 179 if (unlikely(mmu->pkru_mask)) { 181 180 u32 pkru_bits, offset; 182 181 ··· 188 189 pkru_bits = (kvm_read_pkru(vcpu) >> (pte_pkey * 2)) & 3; 189 190 190 191 /* clear present bit, replace PFEC.RSVD with ACC_USER_MASK. */ 191 - offset = pfec - 1 + 192 + offset = (pfec & ~1) + 192 193 ((pte_access & PT_USER_MASK) << (PFERR_RSVD_BIT - PT_USER_SHIFT)); 193 194 194 195 pkru_bits &= mmu->pkru_mask >> offset; 195 - pfec |= -pkru_bits & PFERR_PK_MASK; 196 + errcode |= -pkru_bits & PFERR_PK_MASK; 196 197 fault |= (pkru_bits != 0); 197 198 } 198 199 199 - return -(uint32_t)fault & pfec; 200 + return -(u32)fault & errcode; 200 201 } 201 202 202 203 void kvm_mmu_invalidate_zap_all_pages(struct kvm *kvm);
+1 -1
arch/x86/kvm/paging_tmpl.h
··· 360 360 goto error; 361 361 362 362 if (unlikely(is_rsvd_bits_set(mmu, pte, walker->level))) { 363 - errcode |= PFERR_RSVD_MASK | PFERR_PRESENT_MASK; 363 + errcode = PFERR_RSVD_MASK | PFERR_PRESENT_MASK; 364 364 goto error; 365 365 } 366 366
+4 -6
arch/x86/kvm/x86.c
··· 700 700 if ((xcr0 & XFEATURE_MASK_AVX512) != XFEATURE_MASK_AVX512) 701 701 return 1; 702 702 } 703 - kvm_put_guest_xcr0(vcpu); 704 703 vcpu->arch.xcr0 = xcr0; 705 704 706 705 if ((xcr0 ^ old_xcr0) & XFEATURE_MASK_EXTEND) ··· 6589 6590 kvm_x86_ops->prepare_guest_switch(vcpu); 6590 6591 if (vcpu->fpu_active) 6591 6592 kvm_load_guest_fpu(vcpu); 6592 - kvm_load_guest_xcr0(vcpu); 6593 - 6594 6593 vcpu->mode = IN_GUEST_MODE; 6595 6594 6596 6595 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); ··· 6614 6617 r = 1; 6615 6618 goto cancel_injection; 6616 6619 } 6620 + 6621 + kvm_load_guest_xcr0(vcpu); 6617 6622 6618 6623 if (req_immediate_exit) 6619 6624 smp_send_reschedule(vcpu->cpu); ··· 6665 6666 6666 6667 vcpu->mode = OUTSIDE_GUEST_MODE; 6667 6668 smp_wmb(); 6669 + 6670 + kvm_put_guest_xcr0(vcpu); 6668 6671 6669 6672 /* Interrupt is enabled by handle_external_intr() */ 6670 6673 kvm_x86_ops->handle_external_intr(vcpu); ··· 7315 7314 * and assume host would use all available bits. 7316 7315 * Guest xcr0 would be loaded later. 7317 7316 */ 7318 - kvm_put_guest_xcr0(vcpu); 7319 7317 vcpu->guest_fpu_loaded = 1; 7320 7318 __kernel_fpu_begin(); 7321 7319 __copy_kernel_to_fpregs(&vcpu->arch.guest_fpu.state); ··· 7323 7323 7324 7324 void kvm_put_guest_fpu(struct kvm_vcpu *vcpu) 7325 7325 { 7326 - kvm_put_guest_xcr0(vcpu); 7327 - 7328 7326 if (!vcpu->guest_fpu_loaded) { 7329 7327 vcpu->fpu_counter = 0; 7330 7328 return;
+10 -3
block/partition-generic.c
··· 361 361 goto out_del; 362 362 } 363 363 364 + err = hd_ref_init(p); 365 + if (err) { 366 + if (flags & ADDPART_FLAG_WHOLEDISK) 367 + goto out_remove_file; 368 + goto out_del; 369 + } 370 + 364 371 /* everything is up and running, commence */ 365 372 rcu_assign_pointer(ptbl->part[partno], p); 366 373 367 374 /* suppress uevent if the disk suppresses it */ 368 375 if (!dev_get_uevent_suppress(ddev)) 369 376 kobject_uevent(&pdev->kobj, KOBJ_ADD); 370 - 371 - if (!hd_ref_init(p)) 372 - return p; 377 + return p; 373 378 374 379 out_free_info: 375 380 free_part_info(p); ··· 383 378 out_free: 384 379 kfree(p); 385 380 return ERR_PTR(err); 381 + out_remove_file: 382 + device_remove_file(pdev, &dev_attr_whole_disk); 386 383 out_del: 387 384 kobject_put(p->holder_dir); 388 385 device_del(pdev);
+6
drivers/block/loop.c
··· 488 488 bvec = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); 489 489 iov_iter_bvec(&iter, ITER_BVEC | rw, bvec, 490 490 bio_segments(bio), blk_rq_bytes(cmd->rq)); 491 + /* 492 + * This bio may be started from the middle of the 'bvec' 493 + * because of bio splitting, so offset from the bvec must 494 + * be passed to iov iterator 495 + */ 496 + iter.iov_offset = bio->bi_iter.bi_bvec_done; 491 497 492 498 cmd->iocb.ki_pos = pos; 493 499 cmd->iocb.ki_filp = file;
+1 -1
drivers/bus/mvebu-mbus.c
··· 972 972 } 973 973 } 974 974 975 - pr_err("invalid dram address 0x%x\n", phyaddr); 975 + pr_err("invalid dram address %pa\n", &phyaddr); 976 976 return -EINVAL; 977 977 } 978 978 EXPORT_SYMBOL_GPL(mvebu_mbus_get_dram_win_info);
+1 -1
drivers/bus/uniphier-system-bus.c
··· 108 108 109 109 for (i = 0; i < ARRAY_SIZE(priv->bank); i++) { 110 110 for (j = i + 1; j < ARRAY_SIZE(priv->bank); j++) { 111 - if (priv->bank[i].end > priv->bank[j].base || 111 + if (priv->bank[i].end > priv->bank[j].base && 112 112 priv->bank[i].base < priv->bank[j].end) { 113 113 dev_err(priv->dev, 114 114 "region overlap between bank%d and bank%d\n",
+1
drivers/char/hw_random/bcm63xx-rng.c
··· 12 12 #include <linux/clk.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/hw_random.h> 15 + #include <linux/of.h> 15 16 16 17 #define RNG_CTRL 0x00 17 18 #define RNG_EN (1 << 0)
+19 -15
drivers/dma/dw/core.c
··· 130 130 static void dwc_initialize(struct dw_dma_chan *dwc) 131 131 { 132 132 struct dw_dma *dw = to_dw_dma(dwc->chan.device); 133 - struct dw_dma_slave *dws = dwc->chan.private; 134 133 u32 cfghi = DWC_CFGH_FIFO_MODE; 135 134 u32 cfglo = DWC_CFGL_CH_PRIOR(dwc->priority); 136 135 137 136 if (dwc->initialized == true) 138 137 return; 139 138 140 - if (dws) { 141 - /* 142 - * We need controller-specific data to set up slave 143 - * transfers. 144 - */ 145 - BUG_ON(!dws->dma_dev || dws->dma_dev != dw->dma.dev); 146 - 147 - cfghi |= DWC_CFGH_DST_PER(dws->dst_id); 148 - cfghi |= DWC_CFGH_SRC_PER(dws->src_id); 149 - } else { 150 - cfghi |= DWC_CFGH_DST_PER(dwc->dst_id); 151 - cfghi |= DWC_CFGH_SRC_PER(dwc->src_id); 152 - } 139 + cfghi |= DWC_CFGH_DST_PER(dwc->dst_id); 140 + cfghi |= DWC_CFGH_SRC_PER(dwc->src_id); 153 141 154 142 channel_writel(dwc, CFG_LO, cfglo); 155 143 channel_writel(dwc, CFG_HI, cfghi); ··· 929 941 struct dw_dma_chan *dwc = to_dw_dma_chan(chan); 930 942 struct dw_dma_slave *dws = param; 931 943 932 - if (!dws || dws->dma_dev != chan->device->dev) 944 + if (dws->dma_dev != chan->device->dev) 933 945 return false; 934 946 935 947 /* We have to copy data since dws can be temporary storage */ ··· 1153 1165 * doesn't mean what you think it means), and status writeback. 1154 1166 */ 1155 1167 1168 + /* 1169 + * We need controller-specific data to set up slave transfers. 1170 + */ 1171 + if (chan->private && !dw_dma_filter(chan, chan->private)) { 1172 + dev_warn(chan2dev(chan), "Wrong controller-specific data\n"); 1173 + return -EINVAL; 1174 + } 1175 + 1156 1176 /* Enable controller here if needed */ 1157 1177 if (!dw->in_use) 1158 1178 dw_dma_on(dw); ··· 1222 1226 spin_lock_irqsave(&dwc->lock, flags); 1223 1227 list_splice_init(&dwc->free_list, &list); 1224 1228 dwc->descs_allocated = 0; 1229 + 1230 + /* Clear custom channel configuration */ 1231 + dwc->src_id = 0; 1232 + dwc->dst_id = 0; 1233 + 1234 + dwc->src_master = 0; 1235 + dwc->dst_master = 0; 1236 + 1225 1237 dwc->initialized = false; 1226 1238 1227 1239 /* Disable interrupts */
+25 -38
drivers/dma/edma.c
··· 1238 1238 struct edma_desc *edesc; 1239 1239 dma_addr_t src_addr, dst_addr; 1240 1240 enum dma_slave_buswidth dev_width; 1241 + bool use_intermediate = false; 1241 1242 u32 burst; 1242 1243 int i, ret, nslots; 1243 1244 ··· 1280 1279 * but the synchronization is difficult to achieve with Cyclic and 1281 1280 * cannot be guaranteed, so we error out early. 1282 1281 */ 1283 - if (nslots > MAX_NR_SG) 1284 - return NULL; 1282 + if (nslots > MAX_NR_SG) { 1283 + /* 1284 + * If the burst and period sizes are the same, we can put 1285 + * the full buffer into a single period and activate 1286 + * intermediate interrupts. This will produce interrupts 1287 + * after each burst, which is also after each desired period. 1288 + */ 1289 + if (burst == period_len) { 1290 + period_len = buf_len; 1291 + nslots = 2; 1292 + use_intermediate = true; 1293 + } else { 1294 + return NULL; 1295 + } 1296 + } 1285 1297 1286 1298 edesc = kzalloc(sizeof(*edesc) + nslots * sizeof(edesc->pset[0]), 1287 1299 GFP_ATOMIC); ··· 1372 1358 /* 1373 1359 * Enable period interrupt only if it is requested 1374 1360 */ 1375 - if (tx_flags & DMA_PREP_INTERRUPT) 1361 + if (tx_flags & DMA_PREP_INTERRUPT) { 1376 1362 edesc->pset[i].param.opt |= TCINTEN; 1363 + 1364 + /* Also enable intermediate interrupts if necessary */ 1365 + if (use_intermediate) 1366 + edesc->pset[i].param.opt |= ITCINTEN; 1367 + } 1377 1368 } 1378 1369 1379 1370 /* Place the cyclic channel to highest priority queue */ ··· 1589 1570 return IRQ_HANDLED; 1590 1571 } 1591 1572 1592 - static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable) 1593 - { 1594 - struct platform_device *tc_pdev; 1595 - int ret; 1596 - 1597 - if (!IS_ENABLED(CONFIG_OF) || !tc) 1598 - return; 1599 - 1600 - tc_pdev = of_find_device_by_node(tc->node); 1601 - if (!tc_pdev) { 1602 - pr_err("%s: TPTC device is not found\n", __func__); 1603 - return; 1604 - } 1605 - if (!pm_runtime_enabled(&tc_pdev->dev)) 1606 - pm_runtime_enable(&tc_pdev->dev); 1607 - 1608 - if (enable) 1609 - ret = pm_runtime_get_sync(&tc_pdev->dev); 1610 - else 1611 - ret = pm_runtime_put_sync(&tc_pdev->dev); 1612 - 1613 - if (ret < 0) 1614 - pr_err("%s: pm_runtime_%s_sync() failed for %s\n", __func__, 1615 - enable ? "get" : "put", dev_name(&tc_pdev->dev)); 1616 - } 1617 - 1618 1573 /* Alloc channel resources */ 1619 1574 static int edma_alloc_chan_resources(struct dma_chan *chan) 1620 1575 { ··· 1624 1631 dev_dbg(dev, "Got eDMA channel %d for virt channel %d (%s trigger)\n", 1625 1632 EDMA_CHAN_SLOT(echan->ch_num), chan->chan_id, 1626 1633 echan->hw_triggered ? "HW" : "SW"); 1627 - 1628 - edma_tc_set_pm_state(echan->tc, true); 1629 1634 1630 1635 return 0; 1631 1636 ··· 1661 1670 echan->alloced = false; 1662 1671 } 1663 1672 1664 - edma_tc_set_pm_state(echan->tc, false); 1665 1673 echan->tc = NULL; 1666 1674 echan->hw_triggered = false; 1667 1675 ··· 2407 2417 int i; 2408 2418 2409 2419 for (i = 0; i < ecc->num_channels; i++) { 2410 - if (echan[i].alloced) { 2420 + if (echan[i].alloced) 2411 2421 edma_setup_interrupt(&echan[i], false); 2412 - edma_tc_set_pm_state(echan[i].tc, false); 2413 - } 2414 2422 } 2415 2423 2416 2424 return 0; ··· 2438 2450 2439 2451 /* Set up channel -> slot mapping for the entry slot */ 2440 2452 edma_set_chmap(&echan[i], echan[i].slot[0]); 2441 - 2442 - edma_tc_set_pm_state(echan[i].tc, true); 2443 2453 } 2444 2454 } 2445 2455 ··· 2461 2475 2462 2476 static int edma_tptc_probe(struct platform_device *pdev) 2463 2477 { 2464 - return 0; 2478 + pm_runtime_enable(&pdev->dev); 2479 + return pm_runtime_get_sync(&pdev->dev); 2465 2480 } 2466 2481 2467 2482 static struct platform_driver edma_tptc_driver = {
+8 -5
drivers/dma/hsu/hsu.c
··· 64 64 65 65 if (hsuc->direction == DMA_MEM_TO_DEV) { 66 66 bsr = config->dst_maxburst; 67 - mtsr = config->dst_addr_width; 67 + mtsr = config->src_addr_width; 68 68 } else if (hsuc->direction == DMA_DEV_TO_MEM) { 69 69 bsr = config->src_maxburst; 70 - mtsr = config->src_addr_width; 70 + mtsr = config->dst_addr_width; 71 71 } 72 72 73 73 hsu_chan_disable(hsuc); ··· 135 135 sr = hsu_chan_readl(hsuc, HSU_CH_SR); 136 136 spin_unlock_irqrestore(&hsuc->vchan.lock, flags); 137 137 138 - return sr; 138 + return sr & ~(HSU_CH_SR_DESCE_ANY | HSU_CH_SR_CDESC_ANY); 139 139 } 140 140 141 141 irqreturn_t hsu_dma_irq(struct hsu_dma_chip *chip, unsigned short nr) ··· 254 254 static size_t hsu_dma_active_desc_size(struct hsu_dma_chan *hsuc) 255 255 { 256 256 struct hsu_dma_desc *desc = hsuc->desc; 257 - size_t bytes = desc->length; 257 + size_t bytes = 0; 258 258 int i; 259 259 260 - i = desc->active % HSU_DMA_CHAN_NR_DESC; 260 + for (i = desc->active; i < desc->nents; i++) 261 + bytes += desc->sg[i].len; 262 + 263 + i = HSU_DMA_CHAN_NR_DESC - 1; 261 264 do { 262 265 bytes += hsu_chan_readl(hsuc, HSU_CH_DxTSR(i)); 263 266 } while (--i >= 0);
+3
drivers/dma/hsu/hsu.h
··· 41 41 #define HSU_CH_SR_DESCTO(x) BIT(8 + (x)) 42 42 #define HSU_CH_SR_DESCTO_ANY (BIT(11) | BIT(10) | BIT(9) | BIT(8)) 43 43 #define HSU_CH_SR_CHE BIT(15) 44 + #define HSU_CH_SR_DESCE(x) BIT(16 + (x)) 45 + #define HSU_CH_SR_DESCE_ANY (BIT(19) | BIT(18) | BIT(17) | BIT(16)) 46 + #define HSU_CH_SR_CDESC_ANY (BIT(31) | BIT(30)) 44 47 45 48 /* Bits in HSU_CH_CR */ 46 49 #define HSU_CH_CR_CHA BIT(0)
+17 -9
drivers/dma/omap-dma.c
··· 48 48 unsigned dma_sig; 49 49 bool cyclic; 50 50 bool paused; 51 + bool running; 51 52 52 53 int dma_ch; 53 54 struct omap_desc *desc; ··· 295 294 296 295 /* Enable channel */ 297 296 omap_dma_chan_write(c, CCR, d->ccr | CCR_ENABLE); 297 + 298 + c->running = true; 298 299 } 299 300 300 301 static void omap_dma_stop(struct omap_chan *c) ··· 358 355 359 356 omap_dma_chan_write(c, CLNK_CTRL, val); 360 357 } 358 + 359 + c->running = false; 361 360 } 362 361 363 362 static void omap_dma_start_sg(struct omap_chan *c, struct omap_desc *d, ··· 678 673 struct omap_chan *c = to_omap_dma_chan(chan); 679 674 struct virt_dma_desc *vd; 680 675 enum dma_status ret; 681 - uint32_t ccr; 682 676 unsigned long flags; 683 677 684 - ccr = omap_dma_chan_read(c, CCR); 685 - /* The channel is no longer active, handle the completion right away */ 686 - if (!(ccr & CCR_ENABLE)) 687 - omap_dma_callback(c->dma_ch, 0, c); 688 - 689 678 ret = dma_cookie_status(chan, cookie, txstate); 679 + 680 + if (!c->paused && c->running) { 681 + uint32_t ccr = omap_dma_chan_read(c, CCR); 682 + /* 683 + * The channel is no longer active, set the return value 684 + * accordingly 685 + */ 686 + if (!(ccr & CCR_ENABLE)) 687 + ret = DMA_COMPLETE; 688 + } 689 + 690 690 if (ret == DMA_COMPLETE || !txstate) 691 691 return ret; 692 692 ··· 955 945 d->ccr = c->ccr; 956 946 d->ccr |= CCR_DST_AMODE_POSTINC | CCR_SRC_AMODE_POSTINC; 957 947 958 - d->cicr = CICR_DROP_IE; 959 - if (tx_flags & DMA_PREP_INTERRUPT) 960 - d->cicr |= CICR_FRAME_IE; 948 + d->cicr = CICR_DROP_IE | CICR_FRAME_IE; 961 949 962 950 d->csdp = data_type; 963 951
+1 -1
drivers/dma/xilinx/xilinx_vdma.c
··· 1236 1236 struct xilinx_vdma_device *xdev = ofdma->of_dma_data; 1237 1237 int chan_id = dma_spec->args[0]; 1238 1238 1239 - if (chan_id >= XILINX_VDMA_MAX_CHANS_PER_DEVICE) 1239 + if (chan_id >= XILINX_VDMA_MAX_CHANS_PER_DEVICE || !xdev->chan[chan_id]) 1240 1240 return NULL; 1241 1241 1242 1242 return dma_get_slave_channel(&xdev->chan[chan_id]->common);
+1 -2
drivers/extcon/extcon-palmas.c
··· 348 348 palmas_vbus_irq_handler, 349 349 IRQF_TRIGGER_FALLING | 350 350 IRQF_TRIGGER_RISING | 351 - IRQF_ONESHOT | 352 - IRQF_EARLY_RESUME, 351 + IRQF_ONESHOT, 353 352 "palmas_usb_vbus", 354 353 palmas_usb); 355 354 if (status < 0) {
+15 -3
drivers/firmware/efi/arm-init.c
··· 203 203 204 204 reserve_regions(); 205 205 early_memunmap(memmap.map, params.mmap_size); 206 - memblock_mark_nomap(params.mmap & PAGE_MASK, 207 - PAGE_ALIGN(params.mmap_size + 208 - (params.mmap & ~PAGE_MASK))); 206 + 207 + if (IS_ENABLED(CONFIG_ARM)) { 208 + /* 209 + * ARM currently does not allow ioremap_cache() to be called on 210 + * memory regions that are covered by struct page. So remove the 211 + * UEFI memory map from the linear mapping. 212 + */ 213 + memblock_mark_nomap(params.mmap & PAGE_MASK, 214 + PAGE_ALIGN(params.mmap_size + 215 + (params.mmap & ~PAGE_MASK))); 216 + } else { 217 + memblock_reserve(params.mmap & PAGE_MASK, 218 + PAGE_ALIGN(params.mmap_size + 219 + (params.mmap & ~PAGE_MASK))); 220 + } 209 221 }
+1
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 2034 2034 2035 2035 /* tracking pinned memory */ 2036 2036 u64 vram_pin_size; 2037 + u64 invisible_pin_size; 2037 2038 u64 gart_pin_size; 2038 2039 2039 2040 /* amdkfd interface */
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 384 384 vram_gtt.vram_size = adev->mc.real_vram_size; 385 385 vram_gtt.vram_size -= adev->vram_pin_size; 386 386 vram_gtt.vram_cpu_accessible_size = adev->mc.visible_vram_size; 387 - vram_gtt.vram_cpu_accessible_size -= adev->vram_pin_size; 387 + vram_gtt.vram_cpu_accessible_size -= (adev->vram_pin_size - adev->invisible_pin_size); 388 388 vram_gtt.gtt_size = adev->mc.gtt_size; 389 389 vram_gtt.gtt_size -= adev->gart_pin_size; 390 390 return copy_to_user(out, &vram_gtt,
+8 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 424 424 bo->pin_count = 1; 425 425 if (gpu_addr != NULL) 426 426 *gpu_addr = amdgpu_bo_gpu_offset(bo); 427 - if (domain == AMDGPU_GEM_DOMAIN_VRAM) 427 + if (domain == AMDGPU_GEM_DOMAIN_VRAM) { 428 428 bo->adev->vram_pin_size += amdgpu_bo_size(bo); 429 - else 429 + if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) 430 + bo->adev->invisible_pin_size += amdgpu_bo_size(bo); 431 + } else 430 432 bo->adev->gart_pin_size += amdgpu_bo_size(bo); 431 433 } else { 432 434 dev_err(bo->adev->dev, "%p pin failed\n", bo); ··· 458 456 } 459 457 r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); 460 458 if (likely(r == 0)) { 461 - if (bo->tbo.mem.mem_type == TTM_PL_VRAM) 459 + if (bo->tbo.mem.mem_type == TTM_PL_VRAM) { 462 460 bo->adev->vram_pin_size -= amdgpu_bo_size(bo); 463 - else 461 + if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) 462 + bo->adev->invisible_pin_size -= amdgpu_bo_size(bo); 463 + } else 464 464 bo->adev->gart_pin_size -= amdgpu_bo_size(bo); 465 465 } else { 466 466 dev_err(bo->adev->dev, "%p validate failed for unpin\n", bo);
+1 -1
drivers/gpu/drm/amd/amdgpu/tonga_ih.c
··· 307 307 308 308 amdgpu_irq_fini(adev); 309 309 amdgpu_ih_ring_fini(adev); 310 - amdgpu_irq_add_domain(adev); 310 + amdgpu_irq_remove_domain(adev); 311 311 312 312 return 0; 313 313 }
+5 -5
drivers/gpu/drm/drm_edid.c
··· 205 205 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, 206 206 /* 0x0f - 1024x768@43Hz, interlace */ 207 207 { DRM_MODE("1024x768i", DRM_MODE_TYPE_DRIVER, 44900, 1024, 1032, 208 - 1208, 1264, 0, 768, 768, 772, 817, 0, 208 + 1208, 1264, 0, 768, 768, 776, 817, 0, 209 209 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | 210 210 DRM_MODE_FLAG_INTERLACE) }, 211 211 /* 0x10 - 1024x768@60Hz */ ··· 522 522 720, 840, 0, 480, 481, 484, 500, 0, 523 523 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@75Hz */ 524 524 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 664, 525 - 704, 832, 0, 480, 489, 491, 520, 0, 525 + 704, 832, 0, 480, 489, 492, 520, 0, 526 526 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@72Hz */ 527 527 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 30240, 640, 704, 528 528 768, 864, 0, 480, 483, 486, 525, 0, 529 529 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@67Hz */ 530 - { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25200, 640, 656, 530 + { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656, 531 531 752, 800, 0, 480, 490, 492, 525, 0, 532 532 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@60Hz */ 533 533 { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 35500, 720, 738, ··· 539 539 { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 135000, 1280, 1296, 540 540 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, 541 541 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 1280x1024@75Hz */ 542 - { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 78800, 1024, 1040, 542 + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 78750, 1024, 1040, 543 543 1136, 1312, 0, 768, 769, 772, 800, 0, 544 544 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 1024x768@75Hz */ 545 545 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 75000, 1024, 1048, ··· 2241 2241 { 2242 2242 int i, j, m, modes = 0; 2243 2243 struct drm_display_mode *mode; 2244 - u8 *est = ((u8 *)timing) + 5; 2244 + u8 *est = ((u8 *)timing) + 6; 2245 2245 2246 2246 for (i = 0; i < 6; i++) { 2247 2247 for (j = 7; j >= 0; j--) {
+1 -1
drivers/gpu/drm/exynos/Kconfig
··· 94 94 95 95 config DRM_EXYNOS_G2D 96 96 bool "G2D" 97 - depends on !VIDEO_SAMSUNG_S5P_G2D 97 + depends on VIDEO_SAMSUNG_S5P_G2D=n 98 98 select FRAME_VECTOR 99 99 help 100 100 Choose this option if you want to use Exynos G2D for DRM.
+3 -3
drivers/gpu/drm/exynos/Makefile
··· 2 2 # Makefile for the drm device driver. This driver provides support for the 3 3 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. 4 4 5 - exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fbdev.o \ 6 - exynos_drm_fb.o exynos_drm_gem.o exynos_drm_core.o \ 7 - exynos_drm_plane.o 5 + exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fb.o \ 6 + exynos_drm_gem.o exynos_drm_core.o exynos_drm_plane.o 8 7 8 + exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION) += exynos_drm_fbdev.o 9 9 exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o 10 10 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o 11 11 exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON) += exynos5433_drm_decon.o
+1 -1
drivers/gpu/drm/exynos/exynos_drm_core.c
··· 101 101 return 0; 102 102 103 103 err: 104 - list_for_each_entry_reverse(subdrv, &subdrv->list, list) { 104 + list_for_each_entry_continue_reverse(subdrv, &exynos_drm_subdrv_list, list) { 105 105 if (subdrv->close) 106 106 subdrv->close(dev, subdrv->dev, file); 107 107 }
-11
drivers/gpu/drm/exynos/exynos_drm_fb.c
··· 199 199 return exynos_fb->dma_addr[index]; 200 200 } 201 201 202 - static void exynos_drm_output_poll_changed(struct drm_device *dev) 203 - { 204 - struct exynos_drm_private *private = dev->dev_private; 205 - struct drm_fb_helper *fb_helper = private->fb_helper; 206 - 207 - if (fb_helper) 208 - drm_fb_helper_hotplug_event(fb_helper); 209 - else 210 - exynos_drm_fbdev_init(dev); 211 - } 212 - 213 202 static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = { 214 203 .fb_create = exynos_user_fb_create, 215 204 .output_poll_changed = exynos_drm_output_poll_changed,
+11
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
··· 317 317 318 318 drm_fb_helper_restore_fbdev_mode_unlocked(private->fb_helper); 319 319 } 320 + 321 + void exynos_drm_output_poll_changed(struct drm_device *dev) 322 + { 323 + struct exynos_drm_private *private = dev->dev_private; 324 + struct drm_fb_helper *fb_helper = private->fb_helper; 325 + 326 + if (fb_helper) 327 + drm_fb_helper_hotplug_event(fb_helper); 328 + else 329 + exynos_drm_fbdev_init(dev); 330 + }
+22 -1
drivers/gpu/drm/exynos/exynos_drm_fbdev.h
··· 15 15 #ifndef _EXYNOS_DRM_FBDEV_H_ 16 16 #define _EXYNOS_DRM_FBDEV_H_ 17 17 18 + #ifdef CONFIG_DRM_FBDEV_EMULATION 19 + 18 20 int exynos_drm_fbdev_init(struct drm_device *dev); 19 - int exynos_drm_fbdev_reinit(struct drm_device *dev); 20 21 void exynos_drm_fbdev_fini(struct drm_device *dev); 21 22 void exynos_drm_fbdev_restore_mode(struct drm_device *dev); 23 + void exynos_drm_output_poll_changed(struct drm_device *dev); 24 + 25 + #else 26 + 27 + static inline int exynos_drm_fbdev_init(struct drm_device *dev) 28 + { 29 + return 0; 30 + } 31 + 32 + static inline void exynos_drm_fbdev_fini(struct drm_device *dev) 33 + { 34 + } 35 + 36 + static inline void exynos_drm_fbdev_restore_mode(struct drm_device *dev) 37 + { 38 + } 39 + 40 + #define exynos_drm_output_poll_changed (NULL) 41 + 42 + #endif 22 43 23 44 #endif
+1 -1
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 888 888 * clock. On these SoCs the bootloader may enable it but any 889 889 * power domain off/on will reset it to disable state. 890 890 */ 891 - if (ctx->driver_data != &exynos5_fimd_driver_data || 891 + if (ctx->driver_data != &exynos5_fimd_driver_data && 892 892 ctx->driver_data != &exynos5420_fimd_driver_data) 893 893 return; 894 894
+2 -1
drivers/gpu/drm/exynos/exynos_drm_mic.c
··· 129 129 } else 130 130 val &= ~(MIC0_RGB_MUX | MIC0_I80_MUX | MIC0_ON_MUX); 131 131 132 - regmap_write(mic->sysreg, DSD_CFG_MUX, val); 132 + ret = regmap_write(mic->sysreg, DSD_CFG_MUX, val); 133 133 if (ret) 134 134 DRM_ERROR("mic: Failed to read system register\n"); 135 135 } ··· 457 457 "samsung,disp-syscon"); 458 458 if (IS_ERR(mic->sysreg)) { 459 459 DRM_ERROR("mic: Failed to get system register.\n"); 460 + ret = PTR_ERR(mic->sysreg); 460 461 goto err; 461 462 } 462 463
+7 -5
drivers/gpu/drm/exynos/exynos_drm_plane.c
··· 11 11 12 12 #include <drm/drmP.h> 13 13 14 - #include <drm/exynos_drm.h> 15 - #include <drm/drm_plane_helper.h> 14 + #include <drm/drm_atomic.h> 16 15 #include <drm/drm_atomic_helper.h> 16 + #include <drm/drm_plane_helper.h> 17 + #include <drm/exynos_drm.h> 17 18 #include "exynos_drm_drv.h" 18 19 #include "exynos_drm_crtc.h" 19 20 #include "exynos_drm_fb.h" ··· 58 57 } 59 58 60 59 static void exynos_plane_mode_set(struct exynos_drm_plane_state *exynos_state) 61 - 62 60 { 63 61 struct drm_plane_state *state = &exynos_state->base; 64 - struct drm_crtc *crtc = exynos_state->base.crtc; 65 - struct drm_display_mode *mode = &crtc->state->adjusted_mode; 62 + struct drm_crtc *crtc = state->crtc; 63 + struct drm_crtc_state *crtc_state = 64 + drm_atomic_get_existing_crtc_state(state->state, crtc); 65 + struct drm_display_mode *mode = &crtc_state->adjusted_mode; 66 66 int crtc_x, crtc_y; 67 67 unsigned int crtc_w, crtc_h; 68 68 unsigned int src_x, src_y;
+2 -2
drivers/gpu/drm/i915/i915_drv.c
··· 758 758 dev_priv->display.hpd_irq_setup(dev); 759 759 spin_unlock_irq(&dev_priv->irq_lock); 760 760 761 - intel_display_resume(dev); 762 - 763 761 intel_dp_mst_resume(dev); 762 + 763 + intel_display_resume(dev); 764 764 765 765 /* 766 766 * ... but also need to make sure that hotplug processing
+2 -2
drivers/gpu/drm/i915/i915_irq.c
··· 1829 1829 /* IRQs are synced during runtime_suspend, we don't require a wakeref */ 1830 1830 disable_rpm_wakeref_asserts(dev_priv); 1831 1831 1832 - for (;;) { 1832 + do { 1833 1833 master_ctl = I915_READ(GEN8_MASTER_IRQ) & ~GEN8_MASTER_IRQ_CONTROL; 1834 1834 iir = I915_READ(VLV_IIR); 1835 1835 ··· 1857 1857 1858 1858 I915_WRITE(GEN8_MASTER_IRQ, DE_MASTER_IRQ_CONTROL); 1859 1859 POSTING_READ(GEN8_MASTER_IRQ); 1860 - } 1860 + } while (0); 1861 1861 1862 1862 enable_rpm_wakeref_asserts(dev_priv); 1863 1863
+2 -4
drivers/gpu/drm/i915/intel_dp_mst.c
··· 506 506 struct intel_connector *intel_connector = to_intel_connector(connector); 507 507 struct drm_device *dev = connector->dev; 508 508 509 + intel_connector->unregister(intel_connector); 510 + 509 511 /* need to nuke the connector */ 510 512 drm_modeset_lock_all(dev); 511 513 if (connector->state->crtc) { ··· 521 519 522 520 WARN(ret, "Disabling mst crtc failed with %i\n", ret); 523 521 } 524 - drm_modeset_unlock_all(dev); 525 522 526 - intel_connector->unregister(intel_connector); 527 - 528 - drm_modeset_lock_all(dev); 529 523 intel_connector_remove_from_fbdev(intel_connector); 530 524 drm_connector_cleanup(connector); 531 525 drm_modeset_unlock_all(dev);
+1 -4
drivers/gpu/drm/i915/intel_lvds.c
··· 478 478 * and as part of the cleanup in the hw state restore we also redisable 479 479 * the vga plane. 480 480 */ 481 - if (!HAS_PCH_SPLIT(dev)) { 482 - drm_modeset_lock_all(dev); 481 + if (!HAS_PCH_SPLIT(dev)) 483 482 intel_display_resume(dev); 484 - drm_modeset_unlock_all(dev); 485 - } 486 483 487 484 dev_priv->modeset_restore = MODESET_DONE; 488 485
+9 -4
drivers/gpu/drm/qxl/qxl_display.c
··· 375 375 376 376 qxl_bo_kunmap(user_bo); 377 377 378 + qcrtc->cur_x += qcrtc->hot_spot_x - hot_x; 379 + qcrtc->cur_y += qcrtc->hot_spot_y - hot_y; 380 + qcrtc->hot_spot_x = hot_x; 381 + qcrtc->hot_spot_y = hot_y; 382 + 378 383 cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release); 379 384 cmd->type = QXL_CURSOR_SET; 380 - cmd->u.set.position.x = qcrtc->cur_x; 381 - cmd->u.set.position.y = qcrtc->cur_y; 385 + cmd->u.set.position.x = qcrtc->cur_x + qcrtc->hot_spot_x; 386 + cmd->u.set.position.y = qcrtc->cur_y + qcrtc->hot_spot_y; 382 387 383 388 cmd->u.set.shape = qxl_bo_physical_address(qdev, cursor_bo, 0); 384 389 ··· 446 441 447 442 cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release); 448 443 cmd->type = QXL_CURSOR_MOVE; 449 - cmd->u.position.x = qcrtc->cur_x; 450 - cmd->u.position.y = qcrtc->cur_y; 444 + cmd->u.position.x = qcrtc->cur_x + qcrtc->hot_spot_x; 445 + cmd->u.position.y = qcrtc->cur_y + qcrtc->hot_spot_y; 451 446 qxl_release_unmap(qdev, release, &cmd->release_info); 452 447 453 448 qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
+2
drivers/gpu/drm/qxl/qxl_drv.h
··· 135 135 int index; 136 136 int cur_x; 137 137 int cur_y; 138 + int hot_spot_x; 139 + int hot_spot_y; 138 140 }; 139 141 140 142 struct qxl_output {
+2
drivers/gpu/drm/radeon/ni_reg.h
··· 109 109 #define NI_DP_MSE_SAT2 0x7398 110 110 111 111 #define NI_DP_MSE_SAT_UPDATE 0x739c 112 + # define NI_DP_MSE_SAT_UPDATE_MASK 0x3 113 + # define NI_DP_MSE_16_MTP_KEEPOUT 0x100 112 114 113 115 #define NI_DIG_BE_CNTL 0x7140 114 116 # define NI_DIG_FE_SOURCE_SELECT(x) (((x) & 0x7f) << 8)
+20 -11
drivers/gpu/drm/radeon/radeon_dp_mst.c
··· 89 89 WREG32(NI_DP_MSE_SAT_UPDATE + primary->offset, 1); 90 90 91 91 do { 92 + unsigned value1, value2; 93 + udelay(10); 92 94 temp = RREG32(NI_DP_MSE_SAT_UPDATE + primary->offset); 93 - } while ((temp & 0x1) && retries++ < 10000); 95 + 96 + value1 = temp & NI_DP_MSE_SAT_UPDATE_MASK; 97 + value2 = temp & NI_DP_MSE_16_MTP_KEEPOUT; 98 + 99 + if (!value1 && !value2) 100 + break; 101 + } while (retries++ < 50); 94 102 95 103 if (retries == 10000) 96 104 DRM_ERROR("timed out waitin for SAT update %d\n", primary->offset); ··· 158 150 return 0; 159 151 } 160 152 161 - static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, uint32_t x, uint32_t y) 153 + static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, s64 avg_time_slots_per_mtp) 162 154 { 163 155 struct drm_device *dev = mst->base.dev; 164 156 struct radeon_device *rdev = dev->dev_private; ··· 166 158 uint32_t val, temp; 167 159 uint32_t offset = radeon_atom_set_enc_offset(mst_enc->fe); 168 160 int retries = 0; 161 + uint32_t x = drm_fixp2int(avg_time_slots_per_mtp); 162 + uint32_t y = drm_fixp2int_ceil((avg_time_slots_per_mtp - x) << 26); 169 163 170 164 val = NI_DP_MSE_RATE_X(x) | NI_DP_MSE_RATE_Y(y); 171 165 ··· 175 165 176 166 do { 177 167 temp = RREG32(NI_DP_MSE_RATE_UPDATE + offset); 168 + udelay(10); 178 169 } while ((temp & 0x1) && (retries++ < 10000)); 179 170 180 171 if (retries >= 10000) ··· 257 246 kfree(radeon_connector); 258 247 } 259 248 260 - static int radeon_connector_dpms(struct drm_connector *connector, int mode) 261 - { 262 - DRM_DEBUG_KMS("\n"); 263 - return 0; 264 - } 265 - 266 249 static const struct drm_connector_funcs radeon_dp_mst_connector_funcs = { 267 - .dpms = radeon_connector_dpms, 250 + .dpms = drm_helper_connector_dpms, 268 251 .detect = radeon_dp_mst_detect, 269 252 .fill_modes = drm_helper_probe_single_connector_modes, 270 253 .destroy = radeon_dp_mst_connector_destroy, ··· 399 394 struct drm_crtc *crtc; 400 395 struct radeon_crtc *radeon_crtc; 401 396 int ret, slots; 402 - 397 + s64 fixed_pbn, fixed_pbn_per_slot, avg_time_slots_per_mtp; 403 398 if (!ASIC_IS_DCE5(rdev)) { 404 399 DRM_ERROR("got mst dpms on non-DCE5\n"); 405 400 return; ··· 461 456 462 457 mst_enc->enc_active = true; 463 458 radeon_dp_mst_update_stream_attribs(radeon_connector->mst_port, primary); 464 - radeon_dp_mst_set_vcp_size(radeon_encoder, slots, 0); 459 + 460 + fixed_pbn = drm_int2fixp(mst_enc->pbn); 461 + fixed_pbn_per_slot = drm_int2fixp(radeon_connector->mst_port->mst_mgr.pbn_div); 462 + avg_time_slots_per_mtp = drm_fixp_div(fixed_pbn, fixed_pbn_per_slot); 463 + radeon_dp_mst_set_vcp_size(radeon_encoder, avg_time_slots_per_mtp); 465 464 466 465 atombios_dig_encoder_setup2(&primary->base, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0, 467 466 mst_enc->fe);
+5 -1
drivers/lguest/interrupts_and_traps.c
··· 331 331 * Actually now I think of it, it's possible that Ron *is* half the Plan 9 332 332 * userbase. Oh well. 333 333 */ 334 - static bool could_be_syscall(unsigned int num) 334 + bool could_be_syscall(unsigned int num) 335 335 { 336 336 /* Normal Linux IA32_SYSCALL_VECTOR or reserved vector? */ 337 337 return num == IA32_SYSCALL_VECTOR || num == syscall_vector; ··· 416 416 * 417 417 * This routine indicates if a particular trap number could be delivered 418 418 * directly. 419 + * 420 + * Unfortunately, Linux 4.6 started using an interrupt gate instead of a 421 + * trap gate for syscalls, so this trick is ineffective. See Mastery for 422 + * how we could do this anyway... 419 423 */ 420 424 static bool direct_trap(unsigned int num) 421 425 {
+1
drivers/lguest/lg.h
··· 167 167 bool send_notify_to_eventfd(struct lg_cpu *cpu); 168 168 void init_clockdev(struct lg_cpu *cpu); 169 169 bool check_syscall_vector(struct lguest *lg); 170 + bool could_be_syscall(unsigned int num); 170 171 int init_interrupts(void); 171 172 void free_interrupts(void); 172 173
+5 -1
drivers/lguest/x86/core.c
··· 429 429 return; 430 430 break; 431 431 case 32 ... 255: 432 + /* This might be a syscall. */ 433 + if (could_be_syscall(cpu->regs->trapnum)) 434 + break; 435 + 432 436 /* 433 - * These values mean a real interrupt occurred, in which case 437 + * Other values mean a real interrupt occurred, in which case 434 438 * the Host handler has already been run. We just do a 435 439 * friendly check if another process should now be run, then 436 440 * return to run the Guest again.
+9 -7
drivers/mailbox/mailbox-test.c
··· 46 46 size_t count, loff_t *ppos) 47 47 { 48 48 struct mbox_test_device *tdev = filp->private_data; 49 - int ret; 50 49 51 50 if (!tdev->tx_channel) { 52 51 dev_err(tdev->dev, "Channel cannot do Tx\n"); ··· 59 60 return -EINVAL; 60 61 } 61 62 62 - tdev->signal = kzalloc(MBOX_MAX_SIG_LEN, GFP_KERNEL); 63 - if (!tdev->signal) 64 - return -ENOMEM; 63 + /* Only allocate memory if we need to */ 64 + if (!tdev->signal) { 65 + tdev->signal = kzalloc(MBOX_MAX_SIG_LEN, GFP_KERNEL); 66 + if (!tdev->signal) 67 + return -ENOMEM; 68 + } 65 69 66 - ret = copy_from_user(tdev->signal, userbuf, count); 67 - if (ret) { 70 + if (copy_from_user(tdev->signal, userbuf, count)) { 68 71 kfree(tdev->signal); 72 + tdev->signal = NULL; 69 73 return -EFAULT; 70 74 } 71 75 72 - return ret < 0 ? ret : count; 76 + return count; 73 77 } 74 78 75 79 static const struct file_operations mbox_test_signal_ops = {
+2 -2
drivers/mailbox/mailbox-xgene-slimpro.c
··· 189 189 int i; 190 190 191 191 ctx = devm_kzalloc(&pdev->dev, sizeof(struct slimpro_mbox), GFP_KERNEL); 192 - if (IS_ERR(ctx)) 193 - return PTR_ERR(ctx); 192 + if (!ctx) 193 + return -ENOMEM; 194 194 195 195 platform_set_drvdata(pdev, ctx); 196 196
+2 -2
drivers/mailbox/mailbox.c
··· 375 375 376 376 if (!np) { 377 377 dev_err(cl->dev, "%s() currently only supports DT\n", __func__); 378 - return ERR_PTR(-ENOSYS); 378 + return ERR_PTR(-EINVAL); 379 379 } 380 380 381 381 if (!of_get_property(np, "mbox-names", NULL)) { 382 382 dev_err(cl->dev, 383 383 "%s() requires an \"mbox-names\" property\n", __func__); 384 - return ERR_PTR(-ENOSYS); 384 + return ERR_PTR(-EINVAL); 385 385 } 386 386 387 387 of_property_for_each_string(np, "mbox-names", prop, mbox_name) {
+40 -24
drivers/md/dm-cache-metadata.c
··· 867 867 return 0; 868 868 } 869 869 870 - #define WRITE_LOCK(cmd) \ 871 - down_write(&cmd->root_lock); \ 872 - if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ 873 - up_write(&cmd->root_lock); \ 874 - return -EINVAL; \ 870 + static bool cmd_write_lock(struct dm_cache_metadata *cmd) 871 + { 872 + down_write(&cmd->root_lock); 873 + if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { 874 + up_write(&cmd->root_lock); 875 + return false; 875 876 } 877 + return true; 878 + } 876 879 877 - #define WRITE_LOCK_VOID(cmd) \ 878 - down_write(&cmd->root_lock); \ 879 - if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ 880 - up_write(&cmd->root_lock); \ 881 - return; \ 882 - } 880 + #define WRITE_LOCK(cmd) \ 881 + do { \ 882 + if (!cmd_write_lock((cmd))) \ 883 + return -EINVAL; \ 884 + } while(0) 885 + 886 + #define WRITE_LOCK_VOID(cmd) \ 887 + do { \ 888 + if (!cmd_write_lock((cmd))) \ 889 + return; \ 890 + } while(0) 883 891 884 892 #define WRITE_UNLOCK(cmd) \ 885 - up_write(&cmd->root_lock) 893 + up_write(&(cmd)->root_lock) 886 894 887 - #define READ_LOCK(cmd) \ 888 - down_read(&cmd->root_lock); \ 889 - if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ 890 - up_read(&cmd->root_lock); \ 891 - return -EINVAL; \ 895 + static bool cmd_read_lock(struct dm_cache_metadata *cmd) 896 + { 897 + down_read(&cmd->root_lock); 898 + if (cmd->fail_io) { 899 + up_read(&cmd->root_lock); 900 + return false; 892 901 } 902 + return true; 903 + } 893 904 894 - #define READ_LOCK_VOID(cmd) \ 895 - down_read(&cmd->root_lock); \ 896 - if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ 897 - up_read(&cmd->root_lock); \ 898 - return; \ 899 - } 905 + #define READ_LOCK(cmd) \ 906 + do { \ 907 + if (!cmd_read_lock((cmd))) \ 908 + return -EINVAL; \ 909 + } while(0) 910 + 911 + #define READ_LOCK_VOID(cmd) \ 912 + do { \ 913 + if (!cmd_read_lock((cmd))) \ 914 + return; \ 915 + } while(0) 900 916 901 917 #define READ_UNLOCK(cmd) \ 902 - up_read(&cmd->root_lock) 918 + up_read(&(cmd)->root_lock) 903 919 904 920 int dm_cache_resize(struct dm_cache_metadata *cmd, dm_cblock_t new_cache_size) 905 921 {
+3 -1
drivers/md/dm.c
··· 1662 1662 tio = alloc_tio(ci, ti, target_bio_nr); 1663 1663 tio->len_ptr = len; 1664 1664 r = clone_bio(tio, bio, sector, *len); 1665 - if (r < 0) 1665 + if (r < 0) { 1666 + free_tio(ci->md, tio); 1666 1667 break; 1668 + } 1667 1669 __map_bio(tio); 1668 1670 } 1669 1671
+8 -3
drivers/misc/lkdtm.c
··· 458 458 break; 459 459 460 460 val = kmalloc(len, GFP_KERNEL); 461 - if (!val) 461 + if (!val) { 462 + kfree(base); 462 463 break; 464 + } 463 465 464 466 *val = 0x12345678; 465 467 base[offset] = *val; ··· 500 498 } 501 499 case CT_READ_BUDDY_AFTER_FREE: { 502 500 unsigned long p = __get_free_page(GFP_KERNEL); 503 - int saw, *val = kmalloc(1024, GFP_KERNEL); 501 + int saw, *val; 504 502 int *base; 505 503 506 504 if (!p) 507 505 break; 508 506 509 - if (!val) 507 + val = kmalloc(1024, GFP_KERNEL); 508 + if (!val) { 509 + free_page(p); 510 510 break; 511 + } 511 512 512 513 base = (int *)p; 513 514
+1 -17
drivers/mmc/card/block.c
··· 86 86 87 87 /* TODO: Replace these with struct ida */ 88 88 static DECLARE_BITMAP(dev_use, MAX_DEVICES); 89 - static DECLARE_BITMAP(name_use, MAX_DEVICES); 90 89 91 90 /* 92 91 * There is one mmc_blk_data per slot. ··· 104 105 unsigned int usage; 105 106 unsigned int read_only; 106 107 unsigned int part_type; 107 - unsigned int name_idx; 108 108 unsigned int reset_done; 109 109 #define MMC_BLK_READ BIT(0) 110 110 #define MMC_BLK_WRITE BIT(1) ··· 2200 2202 goto out; 2201 2203 } 2202 2204 2203 - /* 2204 - * !subname implies we are creating main mmc_blk_data that will be 2205 - * associated with mmc_card with dev_set_drvdata. Due to device 2206 - * partitions, devidx will not coincide with a per-physical card 2207 - * index anymore so we keep track of a name index. 2208 - */ 2209 - if (!subname) { 2210 - md->name_idx = find_first_zero_bit(name_use, max_devices); 2211 - __set_bit(md->name_idx, name_use); 2212 - } else 2213 - md->name_idx = ((struct mmc_blk_data *) 2214 - dev_to_disk(parent)->private_data)->name_idx; 2215 - 2216 2205 md->area_type = area_type; 2217 2206 2218 2207 /* ··· 2249 2264 */ 2250 2265 2251 2266 snprintf(md->disk->disk_name, sizeof(md->disk->disk_name), 2252 - "mmcblk%u%s", md->name_idx, subname ? subname : ""); 2267 + "mmcblk%u%s", card->host->index, subname ? subname : ""); 2253 2268 2254 2269 if (mmc_card_mmc(card)) 2255 2270 blk_queue_logical_block_size(md->queue.queue, ··· 2403 2418 struct list_head *pos, *q; 2404 2419 struct mmc_blk_data *part_md; 2405 2420 2406 - __clear_bit(md->name_idx, name_use); 2407 2421 list_for_each_safe(pos, q, &md->part) { 2408 2422 part_md = list_entry(pos, struct mmc_blk_data, part); 2409 2423 list_del(pos);
+1 -9
drivers/mmc/host/sdhci-tegra.c
··· 382 382 .pdata = &sdhci_tegra114_pdata, 383 383 }; 384 384 385 - static const struct sdhci_tegra_soc_data soc_data_tegra124 = { 386 - .pdata = &sdhci_tegra114_pdata, 387 - .nvquirks = NVQUIRK_ENABLE_SDR50 | 388 - NVQUIRK_ENABLE_DDR50 | 389 - NVQUIRK_ENABLE_SDR104 | 390 - NVQUIRK_HAS_PADCALIB, 391 - }; 392 - 393 385 static const struct sdhci_pltfm_data sdhci_tegra210_pdata = { 394 386 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | 395 387 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | ··· 399 407 400 408 static const struct of_device_id sdhci_tegra_dt_match[] = { 401 409 { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 }, 402 - { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 }, 410 + { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 }, 403 411 { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 }, 404 412 { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 }, 405 413 { .compatible = "nvidia,tegra20-sdhci", .data = &soc_data_tegra20 },
+1 -9
drivers/mtd/nand/nand_base.c
··· 4009 4009 * This is the first phase of the normal nand_scan() function. It reads the 4010 4010 * flash ID and sets up MTD fields accordingly. 4011 4011 * 4012 - * The mtd->owner field must be set to the module of the caller. 4013 4012 */ 4014 4013 int nand_scan_ident(struct mtd_info *mtd, int maxchips, 4015 4014 struct nand_flash_dev *table) ··· 4428 4429 * 4429 4430 * This fills out all the uninitialized function pointers with the defaults. 4430 4431 * The flash ID is read and the mtd/chip structures are filled with the 4431 - * appropriate values. The mtd->owner field must be set to the module of the 4432 - * caller. 4432 + * appropriate values. 4433 4433 */ 4434 4434 int nand_scan(struct mtd_info *mtd, int maxchips) 4435 4435 { 4436 4436 int ret; 4437 - 4438 - /* Many callers got this wrong, so check for it for a while... */ 4439 - if (!mtd->owner && caller_is_module()) { 4440 - pr_crit("%s called with NULL mtd->owner!\n", __func__); 4441 - BUG(); 4442 - } 4443 4437 4444 4438 ret = nand_scan_ident(mtd, maxchips, NULL); 4445 4439 if (!ret)
+14
drivers/nvdimm/pmem.c
··· 103 103 flush_dcache_page(page); 104 104 } 105 105 } else { 106 + /* 107 + * Note that we write the data both before and after 108 + * clearing poison. The write before clear poison 109 + * handles situations where the latest written data is 110 + * preserved and the clear poison operation simply marks 111 + * the address range as valid without changing the data. 112 + * In this case application software can assume that an 113 + * interrupted write will either return the new good 114 + * data or an error. 115 + * 116 + * However, if pmem_clear_poison() leaves the data in an 117 + * indeterminate state we need to perform the write 118 + * after clear poison. 119 + */ 106 120 flush_dcache_page(page); 107 121 memcpy_to_pmem(pmem_addr, mem + off, len); 108 122 if (unlikely(bad_pmem)) {
+19 -12
drivers/nvme/host/pci.c
··· 1478 1478 if (result > 0) { 1479 1479 dev_err(dev->ctrl.device, 1480 1480 "Could not set queue count (%d)\n", result); 1481 - nr_io_queues = 0; 1482 - result = 0; 1481 + return 0; 1483 1482 } 1484 1483 1485 1484 if (dev->cmb && NVME_CMB_SQS(dev->cmbsz)) { ··· 1512 1513 * If we enable msix early due to not intx, disable it again before 1513 1514 * setting up the full range we need. 1514 1515 */ 1515 - if (!pdev->irq) 1516 + if (pdev->msi_enabled) 1517 + pci_disable_msi(pdev); 1518 + else if (pdev->msix_enabled) 1516 1519 pci_disable_msix(pdev); 1517 1520 1518 1521 for (i = 0; i < nr_io_queues; i++) ··· 1697 1696 if (pci_enable_device_mem(pdev)) 1698 1697 return result; 1699 1698 1700 - dev->entry[0].vector = pdev->irq; 1701 1699 pci_set_master(pdev); 1702 1700 1703 1701 if (dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64)) && ··· 1709 1709 } 1710 1710 1711 1711 /* 1712 - * Some devices don't advertse INTx interrupts, pre-enable a single 1713 - * MSIX vec for setup. We'll adjust this later. 1712 + * Some devices and/or platforms don't advertise or work with INTx 1713 + * interrupts. Pre-enable a single MSIX or MSI vec for setup. We'll 1714 + * adjust this later. 1714 1715 */ 1715 - if (!pdev->irq) { 1716 - result = pci_enable_msix(pdev, dev->entry, 1); 1717 - if (result < 0) 1718 - goto disable; 1716 + if (pci_enable_msix(pdev, dev->entry, 1)) { 1717 + pci_enable_msi(pdev); 1718 + dev->entry[0].vector = pdev->irq; 1719 + } 1720 + 1721 + if (!dev->entry[0].vector) { 1722 + result = -ENODEV; 1723 + goto disable; 1719 1724 } 1720 1725 1721 1726 cap = lo_hi_readq(dev->bar + NVME_REG_CAP); ··· 1863 1858 */ 1864 1859 if (dev->ctrl.ctrl_config & NVME_CC_ENABLE) 1865 1860 nvme_dev_disable(dev, false); 1861 + 1862 + if (test_bit(NVME_CTRL_REMOVING, &dev->flags)) 1863 + goto out; 1866 1864 1867 1865 set_bit(NVME_CTRL_RESETTING, &dev->flags); 1868 1866 ··· 2086 2078 { 2087 2079 struct nvme_dev *dev = pci_get_drvdata(pdev); 2088 2080 2089 - del_timer_sync(&dev->watchdog_timer); 2090 - 2091 2081 set_bit(NVME_CTRL_REMOVING, &dev->flags); 2092 2082 pci_set_drvdata(pdev, NULL); 2093 2083 flush_work(&dev->async_work); 2084 + flush_work(&dev->reset_work); 2094 2085 flush_work(&dev->scan_work); 2095 2086 nvme_remove_namespaces(&dev->ctrl); 2096 2087 nvme_uninit_ctrl(&dev->ctrl);
+1 -1
drivers/pci/pci-sysfs.c
··· 636 636 u8 *data = (u8 *) buf; 637 637 638 638 /* Several chips lock up trying to read undefined config space */ 639 - if (security_capable(filp->f_cred, &init_user_ns, CAP_SYS_ADMIN) == 0) 639 + if (file_ns_capable(filp, &init_user_ns, CAP_SYS_ADMIN)) 640 640 size = dev->cfg_size; 641 641 else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) 642 642 size = 128;
+1 -1
drivers/pwm/pwm-fsl-ftm.c
··· 392 392 393 393 .max_register = FTM_PWMLOAD, 394 394 .volatile_reg = fsl_pwm_volatile_reg, 395 - .cache_type = REGCACHE_RBTREE, 395 + .cache_type = REGCACHE_FLAT, 396 396 }; 397 397 398 398 static int fsl_pwm_probe(struct platform_device *pdev)
+1
drivers/scsi/device_handler/scsi_dh_alua.c
··· 541 541 return SCSI_DH_DEV_TEMP_BUSY; 542 542 543 543 retry: 544 + err = 0; 544 545 retval = submit_rtpg(sdev, buff, bufflen, &sense_hdr, pg->flags); 545 546 546 547 if (retval) {
+4 -2
drivers/scsi/lpfc/lpfc_mem.c
··· 231 231 if (phba->lpfc_hbq_pool) 232 232 pci_pool_destroy(phba->lpfc_hbq_pool); 233 233 phba->lpfc_hbq_pool = NULL; 234 - mempool_destroy(phba->rrq_pool); 234 + 235 + if (phba->rrq_pool) 236 + mempool_destroy(phba->rrq_pool); 235 237 phba->rrq_pool = NULL; 236 238 237 239 /* Free NLP memory pool */ 238 240 mempool_destroy(phba->nlp_mem_pool); 239 241 phba->nlp_mem_pool = NULL; 240 - if (phba->sli_rev == LPFC_SLI_REV4) { 242 + if (phba->sli_rev == LPFC_SLI_REV4 && phba->active_rrq_pool) { 241 243 mempool_destroy(phba->active_rrq_pool); 242 244 phba->active_rrq_pool = NULL; 243 245 }
+1 -1
drivers/scsi/qla1280.c
··· 4214 4214 .eh_bus_reset_handler = qla1280_eh_bus_reset, 4215 4215 .eh_host_reset_handler = qla1280_eh_adapter_reset, 4216 4216 .bios_param = qla1280_biosparam, 4217 - .can_queue = 0xfffff, 4217 + .can_queue = MAX_OUTSTANDING_COMMANDS, 4218 4218 .this_id = -1, 4219 4219 .sg_tablesize = SG_ALL, 4220 4220 .use_clustering = ENABLE_CLUSTERING,
+4
drivers/usb/class/cdc-acm.c
··· 744 744 int err; 745 745 unsigned long flags; 746 746 747 + if (!cur) /* nothing to do */ 748 + return; 749 + 747 750 acm->putbuffer = NULL; 748 751 err = usb_autopm_get_interface_async(acm->control); 749 752 spin_lock_irqsave(&acm->write_lock, flags); 750 753 if (err < 0) { 751 754 cur->use = 0; 755 + acm->putbuffer = cur; 752 756 goto out; 753 757 } 754 758
+9
drivers/usb/core/hcd-pci.c
··· 73 73 if (companion->bus != pdev->bus || 74 74 PCI_SLOT(companion->devfn) != slot) 75 75 continue; 76 + 77 + /* 78 + * Companion device should be either UHCI,OHCI or EHCI host 79 + * controller, otherwise skip. 80 + */ 81 + if (companion->class != CL_UHCI && companion->class != CL_OHCI && 82 + companion->class != CL_EHCI) 83 + continue; 84 + 76 85 companion_hcd = pci_get_drvdata(companion); 77 86 if (!companion_hcd || !companion_hcd->self.root_hub) 78 87 continue;
+6
drivers/usb/host/xhci-mem.c
··· 1861 1861 kfree(xhci->rh_bw); 1862 1862 kfree(xhci->ext_caps); 1863 1863 1864 + xhci->usb2_ports = NULL; 1865 + xhci->usb3_ports = NULL; 1866 + xhci->port_array = NULL; 1867 + xhci->rh_bw = NULL; 1868 + xhci->ext_caps = NULL; 1869 + 1864 1870 xhci->page_size = 0; 1865 1871 xhci->page_shift = 0; 1866 1872 xhci->bus_state[0].bus_suspended = 0;
+4 -1
drivers/usb/host/xhci-pci.c
··· 48 48 #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f 49 49 #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI 0x9d2f 50 50 #define PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI 0x0aa8 51 + #define PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI 0x1aa8 51 52 52 53 static const char hcd_name[] = "xhci_hcd"; 53 54 ··· 156 155 (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || 157 156 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || 158 157 pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || 159 - pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI)) { 158 + pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI || 159 + pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI)) { 160 160 xhci->quirks |= XHCI_PME_STUCK_QUIRK; 161 161 } 162 162 if (pdev->vendor == PCI_VENDOR_ID_INTEL && ··· 304 302 struct xhci_hcd *xhci; 305 303 306 304 xhci = hcd_to_xhci(pci_get_drvdata(dev)); 305 + xhci->xhc_state |= XHCI_STATE_REMOVING; 307 306 if (xhci->shared_hcd) { 308 307 usb_remove_hcd(xhci->shared_hcd); 309 308 usb_put_hcd(xhci->shared_hcd);
+13
drivers/usb/host/xhci-plat.c
··· 39 39 40 40 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) 41 41 { 42 + struct usb_hcd *hcd = xhci_to_hcd(xhci); 43 + 42 44 /* 43 45 * As of now platform drivers don't provide MSI support so we ensure 44 46 * here that the generic code does not try to make a pci_dev from our 45 47 * dev struct in order to setup MSI 46 48 */ 47 49 xhci->quirks |= XHCI_PLAT; 50 + 51 + /* 52 + * On R-Car Gen2 and Gen3, the AC64 bit (bit 0) of HCCPARAMS1 is set 53 + * to 1. However, these SoCs don't support 64-bit address memory 54 + * pointers. So, this driver clears the AC64 bit of xhci->hcc_params 55 + * to call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in 56 + * xhci_gen_setup(). 57 + */ 58 + if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) || 59 + xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3)) 60 + xhci->quirks |= XHCI_NO_64BIT_SUPPORT; 48 61 } 49 62 50 63 /* called during probe() after chip reset completes */
+1 -1
drivers/usb/host/xhci-plat.h
··· 14 14 #include "xhci.h" /* for hcd_to_xhci() */ 15 15 16 16 enum xhci_plat_type { 17 - XHCI_PLAT_TYPE_MARVELL_ARMADA, 17 + XHCI_PLAT_TYPE_MARVELL_ARMADA = 1, 18 18 XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2, 19 19 XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3, 20 20 };
+2 -1
drivers/usb/host/xhci-ring.c
··· 4004 4004 int reserved_trbs = xhci->cmd_ring_reserved_trbs; 4005 4005 int ret; 4006 4006 4007 - if (xhci->xhc_state) { 4007 + if ((xhci->xhc_state & XHCI_STATE_DYING) || 4008 + (xhci->xhc_state & XHCI_STATE_HALTED)) { 4008 4009 xhci_dbg(xhci, "xHCI dying or halted, can't queue_command\n"); 4009 4010 return -ESHUTDOWN; 4010 4011 }
+18 -6
drivers/usb/host/xhci.c
··· 147 147 "waited %u microseconds.\n", 148 148 XHCI_MAX_HALT_USEC); 149 149 if (!ret) 150 - xhci->xhc_state &= ~(XHCI_STATE_HALTED | XHCI_STATE_DYING); 150 + /* clear state flags. Including dying, halted or removing */ 151 + xhci->xhc_state = 0; 151 152 152 153 return ret; 153 154 } ··· 1109 1108 /* Resume root hubs only when have pending events. */ 1110 1109 status = readl(&xhci->op_regs->status); 1111 1110 if (status & STS_EINT) { 1112 - usb_hcd_resume_root_hub(hcd); 1113 1111 usb_hcd_resume_root_hub(xhci->shared_hcd); 1112 + usb_hcd_resume_root_hub(hcd); 1114 1113 } 1115 1114 } 1116 1115 ··· 1125 1124 1126 1125 /* Re-enable port polling. */ 1127 1126 xhci_dbg(xhci, "%s: starting port polling.\n", __func__); 1128 - set_bit(HCD_FLAG_POLL_RH, &hcd->flags); 1129 - usb_hcd_poll_rh_status(hcd); 1130 1127 set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); 1131 1128 usb_hcd_poll_rh_status(xhci->shared_hcd); 1129 + set_bit(HCD_FLAG_POLL_RH, &hcd->flags); 1130 + usb_hcd_poll_rh_status(hcd); 1132 1131 1133 1132 return retval; 1134 1133 } ··· 2774 2773 if (ret <= 0) 2775 2774 return ret; 2776 2775 xhci = hcd_to_xhci(hcd); 2777 - if (xhci->xhc_state & XHCI_STATE_DYING) 2776 + if ((xhci->xhc_state & XHCI_STATE_DYING) || 2777 + (xhci->xhc_state & XHCI_STATE_REMOVING)) 2778 2778 return -ENODEV; 2779 2779 2780 2780 xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev); ··· 3822 3820 3823 3821 mutex_lock(&xhci->mutex); 3824 3822 3825 - if (xhci->xhc_state) /* dying or halted */ 3823 + if (xhci->xhc_state) /* dying, removing or halted */ 3826 3824 goto out; 3827 3825 3828 3826 if (!udev->slot_id) { ··· 4949 4947 if (retval) 4950 4948 return retval; 4951 4949 xhci_dbg(xhci, "Reset complete\n"); 4950 + 4951 + /* 4952 + * On some xHCI controllers (e.g. R-Car SoCs), the AC64 bit (bit 0) 4953 + * of HCCPARAMS1 is set to 1. However, the xHCs don't support 64-bit 4954 + * address memory pointers actually. So, this driver clears the AC64 4955 + * bit of xhci->hcc_params to call dma_set_coherent_mask(dev, 4956 + * DMA_BIT_MASK(32)) in this xhci_gen_setup(). 4957 + */ 4958 + if (xhci->quirks & XHCI_NO_64BIT_SUPPORT) 4959 + xhci->hcc_params &= ~BIT(0); 4952 4960 4953 4961 /* Set dma_mask and coherent_dma_mask to 64-bits, 4954 4962 * if xHC supports 64-bit addressing */
+2
drivers/usb/host/xhci.h
··· 1605 1605 */ 1606 1606 #define XHCI_STATE_DYING (1 << 0) 1607 1607 #define XHCI_STATE_HALTED (1 << 1) 1608 + #define XHCI_STATE_REMOVING (1 << 2) 1608 1609 /* Statistics */ 1609 1610 int error_bitmask; 1610 1611 unsigned int quirks; ··· 1642 1641 #define XHCI_PME_STUCK_QUIRK (1 << 20) 1643 1642 #define XHCI_MTK_HOST (1 << 21) 1644 1643 #define XHCI_SSIC_PORT_UNUSED (1 << 22) 1644 + #define XHCI_NO_64BIT_SUPPORT (1 << 23) 1645 1645 unsigned int num_active_eps; 1646 1646 unsigned int limit_active_eps; 1647 1647 /* There are two roothubs to keep track of bus suspend info for */
+19 -2
drivers/usb/storage/uas.c
··· 2 2 * USB Attached SCSI 3 3 * Note that this is not the same as the USB Mass Storage driver 4 4 * 5 - * Copyright Hans de Goede <hdegoede@redhat.com> for Red Hat, Inc. 2013 - 2014 5 + * Copyright Hans de Goede <hdegoede@redhat.com> for Red Hat, Inc. 2013 - 2016 6 6 * Copyright Matthew Wilcox for Intel Corp, 2010 7 7 * Copyright Sarah Sharp for Intel Corp, 2010 8 8 * ··· 781 781 return SUCCESS; 782 782 } 783 783 784 + static int uas_target_alloc(struct scsi_target *starget) 785 + { 786 + struct uas_dev_info *devinfo = (struct uas_dev_info *) 787 + dev_to_shost(starget->dev.parent)->hostdata; 788 + 789 + if (devinfo->flags & US_FL_NO_REPORT_LUNS) 790 + starget->no_report_luns = 1; 791 + 792 + return 0; 793 + } 794 + 784 795 static int uas_slave_alloc(struct scsi_device *sdev) 785 796 { 786 797 struct uas_dev_info *devinfo = ··· 835 824 if (devinfo->flags & US_FL_BROKEN_FUA) 836 825 sdev->broken_fua = 1; 837 826 838 - scsi_change_queue_depth(sdev, devinfo->qdepth - 2); 839 827 return 0; 840 828 } 841 829 ··· 842 832 .module = THIS_MODULE, 843 833 .name = "uas", 844 834 .queuecommand = uas_queuecommand, 835 + .target_alloc = uas_target_alloc, 845 836 .slave_alloc = uas_slave_alloc, 846 837 .slave_configure = uas_slave_configure, 847 838 .eh_abort_handler = uas_eh_abort_handler, ··· 966 955 result = uas_configure_endpoints(devinfo); 967 956 if (result) 968 957 goto set_alt0; 958 + 959 + /* 960 + * 1 tag is reserved for untagged commands + 961 + * 1 tag to avoid off by one errors in some bridge firmwares 962 + */ 963 + shost->can_queue = devinfo->qdepth - 2; 969 964 970 965 usb_set_intfdata(intf, shost); 971 966 result = scsi_add_host(shost, &intf->dev);
+7
drivers/usb/storage/unusual_uas.h
··· 64 64 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 65 65 US_FL_NO_ATA_1X), 66 66 67 + /* Reported-by: David Webb <djw@noc.ac.uk> */ 68 + UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999, 69 + "Seagate", 70 + "Expansion Desk", 71 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 72 + US_FL_NO_REPORT_LUNS), 73 + 67 74 /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ 68 75 UNUSUAL_DEV(0x0bc2, 0x3320, 0x0000, 0x9999, 69 76 "Seagate",
+4 -1
drivers/usb/storage/usb.c
··· 482 482 US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 | 483 483 US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE | 484 484 US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES | 485 - US_FL_MAX_SECTORS_240); 485 + US_FL_MAX_SECTORS_240 | US_FL_NO_REPORT_LUNS); 486 486 487 487 p = quirks; 488 488 while (*p) { ··· 531 531 break; 532 532 case 'i': 533 533 f |= US_FL_IGNORE_DEVICE; 534 + break; 535 + case 'j': 536 + f |= US_FL_NO_REPORT_LUNS; 534 537 break; 535 538 case 'l': 536 539 f |= US_FL_NOT_LOCKABLE;
+33 -20
fs/crypto/crypto.c
··· 26 26 #include <linux/ratelimit.h> 27 27 #include <linux/bio.h> 28 28 #include <linux/dcache.h> 29 + #include <linux/namei.h> 29 30 #include <linux/fscrypto.h> 30 31 #include <linux/ecryptfs.h> 31 32 ··· 82 81 /** 83 82 * fscrypt_get_ctx() - Gets an encryption context 84 83 * @inode: The inode for which we are doing the crypto 84 + * @gfp_flags: The gfp flag for memory allocation 85 85 * 86 86 * Allocates and initializes an encryption context. 87 87 * 88 88 * Return: An allocated and initialized encryption context on success; error 89 89 * value or NULL otherwise. 90 90 */ 91 - struct fscrypt_ctx *fscrypt_get_ctx(struct inode *inode) 91 + struct fscrypt_ctx *fscrypt_get_ctx(struct inode *inode, gfp_t gfp_flags) 92 92 { 93 93 struct fscrypt_ctx *ctx = NULL; 94 94 struct fscrypt_info *ci = inode->i_crypt_info; ··· 115 113 list_del(&ctx->free_list); 116 114 spin_unlock_irqrestore(&fscrypt_ctx_lock, flags); 117 115 if (!ctx) { 118 - ctx = kmem_cache_zalloc(fscrypt_ctx_cachep, GFP_NOFS); 116 + ctx = kmem_cache_zalloc(fscrypt_ctx_cachep, gfp_flags); 119 117 if (!ctx) 120 118 return ERR_PTR(-ENOMEM); 121 119 ctx->flags |= FS_CTX_REQUIRES_FREE_ENCRYPT_FL; ··· 149 147 150 148 static int do_page_crypto(struct inode *inode, 151 149 fscrypt_direction_t rw, pgoff_t index, 152 - struct page *src_page, struct page *dest_page) 150 + struct page *src_page, struct page *dest_page, 151 + gfp_t gfp_flags) 153 152 { 154 153 u8 xts_tweak[FS_XTS_TWEAK_SIZE]; 155 154 struct skcipher_request *req = NULL; ··· 160 157 struct crypto_skcipher *tfm = ci->ci_ctfm; 161 158 int res = 0; 162 159 163 - req = skcipher_request_alloc(tfm, GFP_NOFS); 160 + req = skcipher_request_alloc(tfm, gfp_flags); 164 161 if (!req) { 165 162 printk_ratelimited(KERN_ERR 166 163 "%s: crypto_request_alloc() failed\n", ··· 202 199 return 0; 203 200 } 204 201 205 - static struct page *alloc_bounce_page(struct fscrypt_ctx *ctx) 202 + static struct page *alloc_bounce_page(struct fscrypt_ctx *ctx, gfp_t gfp_flags) 206 203 { 207 - ctx->w.bounce_page = mempool_alloc(fscrypt_bounce_page_pool, 208 - GFP_NOWAIT); 204 + ctx->w.bounce_page = mempool_alloc(fscrypt_bounce_page_pool, gfp_flags); 209 205 if (ctx->w.bounce_page == NULL) 210 206 return ERR_PTR(-ENOMEM); 211 207 ctx->flags |= FS_WRITE_PATH_FL; ··· 215 213 * fscypt_encrypt_page() - Encrypts a page 216 214 * @inode: The inode for which the encryption should take place 217 215 * @plaintext_page: The page to encrypt. Must be locked. 216 + * @gfp_flags: The gfp flag for memory allocation 218 217 * 219 218 * Allocates a ciphertext page and encrypts plaintext_page into it using the ctx 220 219 * encryption context. ··· 228 225 * error value or NULL. 229 226 */ 230 227 struct page *fscrypt_encrypt_page(struct inode *inode, 231 - struct page *plaintext_page) 228 + struct page *plaintext_page, gfp_t gfp_flags) 232 229 { 233 230 struct fscrypt_ctx *ctx; 234 231 struct page *ciphertext_page = NULL; ··· 236 233 237 234 BUG_ON(!PageLocked(plaintext_page)); 238 235 239 - ctx = fscrypt_get_ctx(inode); 236 + ctx = fscrypt_get_ctx(inode, gfp_flags); 240 237 if (IS_ERR(ctx)) 241 238 return (struct page *)ctx; 242 239 243 240 /* The encryption operation will require a bounce page. */ 244 - ciphertext_page = alloc_bounce_page(ctx); 241 + ciphertext_page = alloc_bounce_page(ctx, gfp_flags); 245 242 if (IS_ERR(ciphertext_page)) 246 243 goto errout; 247 244 248 245 ctx->w.control_page = plaintext_page; 249 246 err = do_page_crypto(inode, FS_ENCRYPT, plaintext_page->index, 250 - plaintext_page, ciphertext_page); 247 + plaintext_page, ciphertext_page, 248 + gfp_flags); 251 249 if (err) { 252 250 ciphertext_page = ERR_PTR(err); 253 251 goto errout; ··· 279 275 BUG_ON(!PageLocked(page)); 280 276 281 277 return do_page_crypto(page->mapping->host, 282 - FS_DECRYPT, page->index, page, page); 278 + FS_DECRYPT, page->index, page, page, GFP_NOFS); 283 279 } 284 280 EXPORT_SYMBOL(fscrypt_decrypt_page); 285 281 ··· 293 289 294 290 BUG_ON(inode->i_sb->s_blocksize != PAGE_SIZE); 295 291 296 - ctx = fscrypt_get_ctx(inode); 292 + ctx = fscrypt_get_ctx(inode, GFP_NOFS); 297 293 if (IS_ERR(ctx)) 298 294 return PTR_ERR(ctx); 299 295 300 - ciphertext_page = alloc_bounce_page(ctx); 296 + ciphertext_page = alloc_bounce_page(ctx, GFP_NOWAIT); 301 297 if (IS_ERR(ciphertext_page)) { 302 298 err = PTR_ERR(ciphertext_page); 303 299 goto errout; ··· 305 301 306 302 while (len--) { 307 303 err = do_page_crypto(inode, FS_ENCRYPT, lblk, 308 - ZERO_PAGE(0), ciphertext_page); 304 + ZERO_PAGE(0), ciphertext_page, 305 + GFP_NOFS); 309 306 if (err) 310 307 goto errout; 311 308 312 - bio = bio_alloc(GFP_KERNEL, 1); 309 + bio = bio_alloc(GFP_NOWAIT, 1); 313 310 if (!bio) { 314 311 err = -ENOMEM; 315 312 goto errout; ··· 350 345 */ 351 346 static int fscrypt_d_revalidate(struct dentry *dentry, unsigned int flags) 352 347 { 353 - struct inode *dir = d_inode(dentry->d_parent); 354 - struct fscrypt_info *ci = dir->i_crypt_info; 348 + struct dentry *dir; 349 + struct fscrypt_info *ci; 355 350 int dir_has_key, cached_with_key; 356 351 357 - if (!dir->i_sb->s_cop->is_encrypted(dir)) 358 - return 0; 352 + if (flags & LOOKUP_RCU) 353 + return -ECHILD; 359 354 355 + dir = dget_parent(dentry); 356 + if (!d_inode(dir)->i_sb->s_cop->is_encrypted(d_inode(dir))) { 357 + dput(dir); 358 + return 0; 359 + } 360 + 361 + ci = d_inode(dir)->i_crypt_info; 360 362 if (ci && ci->ci_keyring_key && 361 363 (ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) | 362 364 (1 << KEY_FLAG_REVOKED) | ··· 375 363 cached_with_key = dentry->d_flags & DCACHE_ENCRYPTED_WITH_KEY; 376 364 spin_unlock(&dentry->d_lock); 377 365 dir_has_key = (ci != NULL); 366 + dput(dir); 378 367 379 368 /* 380 369 * If the dentry was cached without the key, and it is a
+1 -1
fs/debugfs/inode.c
··· 457 457 if (unlikely(!inode)) 458 458 return failed_creating(dentry); 459 459 460 - inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO; 460 + make_empty_dir_inode(inode); 461 461 inode->i_flags |= S_AUTOMOUNT; 462 462 inode->i_private = data; 463 463 dentry->d_fsdata = (void *)f;
+4
fs/ext4/crypto.c
··· 32 32 #include <linux/random.h> 33 33 #include <linux/scatterlist.h> 34 34 #include <linux/spinlock_types.h> 35 + #include <linux/namei.h> 35 36 36 37 #include "ext4_extents.h" 37 38 #include "xattr.h" ··· 482 481 struct dentry *dir; 483 482 struct ext4_crypt_info *ci; 484 483 int dir_has_key, cached_with_key; 484 + 485 + if (flags & LOOKUP_RCU) 486 + return -ECHILD; 485 487 486 488 dir = dget_parent(dentry); 487 489 if (!ext4_encrypted_inode(d_inode(dir))) {
+13 -3
fs/f2fs/data.c
··· 992 992 if (f2fs_encrypted_inode(inode) && 993 993 S_ISREG(inode->i_mode)) { 994 994 995 - ctx = fscrypt_get_ctx(inode); 995 + ctx = fscrypt_get_ctx(inode, GFP_NOFS); 996 996 if (IS_ERR(ctx)) 997 997 goto set_error_page; 998 998 ··· 1092 1092 } 1093 1093 1094 1094 if (f2fs_encrypted_inode(inode) && S_ISREG(inode->i_mode)) { 1095 + gfp_t gfp_flags = GFP_NOFS; 1095 1096 1096 1097 /* wait for GCed encrypted page writeback */ 1097 1098 f2fs_wait_on_encrypted_page_writeback(F2FS_I_SB(inode), 1098 1099 fio->old_blkaddr); 1099 - 1100 - fio->encrypted_page = fscrypt_encrypt_page(inode, fio->page); 1100 + retry_encrypt: 1101 + fio->encrypted_page = fscrypt_encrypt_page(inode, fio->page, 1102 + gfp_flags); 1101 1103 if (IS_ERR(fio->encrypted_page)) { 1102 1104 err = PTR_ERR(fio->encrypted_page); 1105 + if (err == -ENOMEM) { 1106 + /* flush pending ios and wait for a while */ 1107 + f2fs_flush_merged_bios(F2FS_I_SB(inode)); 1108 + congestion_wait(BLK_RW_ASYNC, HZ/50); 1109 + gfp_flags |= __GFP_NOFAIL; 1110 + err = 0; 1111 + goto retry_encrypt; 1112 + } 1103 1113 goto out_writepage; 1104 1114 } 1105 1115 }
+7 -3
fs/f2fs/file.c
··· 441 441 static int f2fs_file_open(struct inode *inode, struct file *filp) 442 442 { 443 443 int ret = generic_file_open(inode, filp); 444 - struct inode *dir = filp->f_path.dentry->d_parent->d_inode; 444 + struct dentry *dir; 445 445 446 446 if (!ret && f2fs_encrypted_inode(inode)) { 447 447 ret = fscrypt_get_encryption_info(inode); ··· 450 450 if (!fscrypt_has_encryption_key(inode)) 451 451 return -ENOKEY; 452 452 } 453 - if (f2fs_encrypted_inode(dir) && 454 - !fscrypt_has_permitted_context(dir, inode)) 453 + dir = dget_parent(file_dentry(filp)); 454 + if (f2fs_encrypted_inode(d_inode(dir)) && 455 + !fscrypt_has_permitted_context(d_inode(dir), inode)) { 456 + dput(dir); 455 457 return -EPERM; 458 + } 459 + dput(dir); 456 460 return ret; 457 461 } 458 462
+4 -3
fs/seq_file.c
··· 72 72 73 73 mutex_init(&p->lock); 74 74 p->op = op; 75 - #ifdef CONFIG_USER_NS 76 - p->user_ns = file->f_cred->user_ns; 77 - #endif 75 + 76 + // No refcounting: the lifetime of 'p' is constrained 77 + // to the lifetime of the file. 78 + p->file = file; 78 79 79 80 /* 80 81 * Wrappers around seq_open(e.g. swaps_open) need to be
+5 -4
include/linux/fscrypto.h
··· 263 263 extern struct kmem_cache *fscrypt_info_cachep; 264 264 int fscrypt_initialize(void); 265 265 266 - extern struct fscrypt_ctx *fscrypt_get_ctx(struct inode *); 266 + extern struct fscrypt_ctx *fscrypt_get_ctx(struct inode *, gfp_t); 267 267 extern void fscrypt_release_ctx(struct fscrypt_ctx *); 268 - extern struct page *fscrypt_encrypt_page(struct inode *, struct page *); 268 + extern struct page *fscrypt_encrypt_page(struct inode *, struct page *, gfp_t); 269 269 extern int fscrypt_decrypt_page(struct page *); 270 270 extern void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *, struct bio *); 271 271 extern void fscrypt_pullback_bio_page(struct page **, bool); ··· 299 299 #endif 300 300 301 301 /* crypto.c */ 302 - static inline struct fscrypt_ctx *fscrypt_notsupp_get_ctx(struct inode *i) 302 + static inline struct fscrypt_ctx *fscrypt_notsupp_get_ctx(struct inode *i, 303 + gfp_t f) 303 304 { 304 305 return ERR_PTR(-EOPNOTSUPP); 305 306 } ··· 311 310 } 312 311 313 312 static inline struct page *fscrypt_notsupp_encrypt_page(struct inode *i, 314 - struct page *p) 313 + struct page *p, gfp_t f) 315 314 { 316 315 return ERR_PTR(-EOPNOTSUPP); 317 316 }
+3 -61
include/linux/mm.h
··· 1250 1250 unsigned long start, unsigned long nr_pages, 1251 1251 int write, int force, struct page **pages, 1252 1252 struct vm_area_struct **vmas); 1253 - long get_user_pages6(unsigned long start, unsigned long nr_pages, 1253 + long get_user_pages(unsigned long start, unsigned long nr_pages, 1254 1254 int write, int force, struct page **pages, 1255 1255 struct vm_area_struct **vmas); 1256 - long get_user_pages_locked6(unsigned long start, unsigned long nr_pages, 1256 + long get_user_pages_locked(unsigned long start, unsigned long nr_pages, 1257 1257 int write, int force, struct page **pages, int *locked); 1258 1258 long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, 1259 1259 unsigned long start, unsigned long nr_pages, 1260 1260 int write, int force, struct page **pages, 1261 1261 unsigned int gup_flags); 1262 - long get_user_pages_unlocked5(unsigned long start, unsigned long nr_pages, 1262 + long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, 1263 1263 int write, int force, struct page **pages); 1264 1264 int get_user_pages_fast(unsigned long start, int nr_pages, int write, 1265 1265 struct page **pages); 1266 - 1267 - /* suppress warnings from use in EXPORT_SYMBOL() */ 1268 - #ifndef __DISABLE_GUP_DEPRECATED 1269 - #define __gup_deprecated __deprecated 1270 - #else 1271 - #define __gup_deprecated 1272 - #endif 1273 - /* 1274 - * These macros provide backward-compatibility with the old 1275 - * get_user_pages() variants which took tsk/mm. These 1276 - * functions/macros provide both compile-time __deprecated so we 1277 - * can catch old-style use and not break the build. The actual 1278 - * functions also have WARN_ON()s to let us know at runtime if 1279 - * the get_user_pages() should have been the "remote" variant. 1280 - * 1281 - * These are hideous, but temporary. 1282 - * 1283 - * If you run into one of these __deprecated warnings, look 1284 - * at how you are calling get_user_pages(). If you are calling 1285 - * it with current/current->mm as the first two arguments, 1286 - * simply remove those arguments. The behavior will be the same 1287 - * as it is now. If you are calling it on another task, use 1288 - * get_user_pages_remote() instead. 1289 - * 1290 - * Any questions? Ask Dave Hansen <dave@sr71.net> 1291 - */ 1292 - long 1293 - __gup_deprecated 1294 - get_user_pages8(struct task_struct *tsk, struct mm_struct *mm, 1295 - unsigned long start, unsigned long nr_pages, 1296 - int write, int force, struct page **pages, 1297 - struct vm_area_struct **vmas); 1298 - #define GUP_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, get_user_pages, ...) \ 1299 - get_user_pages 1300 - #define get_user_pages(...) GUP_MACRO(__VA_ARGS__, \ 1301 - get_user_pages8, x, \ 1302 - get_user_pages6, x, x, x, x, x)(__VA_ARGS__) 1303 - 1304 - __gup_deprecated 1305 - long get_user_pages_locked8(struct task_struct *tsk, struct mm_struct *mm, 1306 - unsigned long start, unsigned long nr_pages, 1307 - int write, int force, struct page **pages, 1308 - int *locked); 1309 - #define GUPL_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, get_user_pages_locked, ...) \ 1310 - get_user_pages_locked 1311 - #define get_user_pages_locked(...) GUPL_MACRO(__VA_ARGS__, \ 1312 - get_user_pages_locked8, x, \ 1313 - get_user_pages_locked6, x, x, x, x)(__VA_ARGS__) 1314 - 1315 - __gup_deprecated 1316 - long get_user_pages_unlocked7(struct task_struct *tsk, struct mm_struct *mm, 1317 - unsigned long start, unsigned long nr_pages, 1318 - int write, int force, struct page **pages); 1319 - #define GUPU_MACRO(_1, _2, _3, _4, _5, _6, _7, get_user_pages_unlocked, ...) \ 1320 - get_user_pages_unlocked 1321 - #define get_user_pages_unlocked(...) GUPU_MACRO(__VA_ARGS__, \ 1322 - get_user_pages_unlocked7, x, \ 1323 - get_user_pages_unlocked5, x, x, x, x)(__VA_ARGS__) 1324 1266 1325 1267 /* Container for pinned pfns / pages */ 1326 1268 struct frame_vector {
+16 -6
include/linux/pmem.h
··· 72 72 } 73 73 #endif 74 74 75 + static inline bool arch_has_pmem_api(void) 76 + { 77 + return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API); 78 + } 79 + 80 + static inline int default_memcpy_from_pmem(void *dst, void __pmem const *src, 81 + size_t size) 82 + { 83 + memcpy(dst, (void __force *) src, size); 84 + return 0; 85 + } 86 + 75 87 /* 76 88 * memcpy_from_pmem - read from persistent memory with error handling 77 89 * @dst: destination buffer ··· 95 83 static inline int memcpy_from_pmem(void *dst, void __pmem const *src, 96 84 size_t size) 97 85 { 98 - return arch_memcpy_from_pmem(dst, src, size); 99 - } 100 - 101 - static inline bool arch_has_pmem_api(void) 102 - { 103 - return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API); 86 + if (arch_has_pmem_api()) 87 + return arch_memcpy_from_pmem(dst, src, size); 88 + else 89 + return default_memcpy_from_pmem(dst, src, size); 104 90 } 105 91 106 92 /**
+4 -9
include/linux/seq_file.h
··· 7 7 #include <linux/mutex.h> 8 8 #include <linux/cpumask.h> 9 9 #include <linux/nodemask.h> 10 + #include <linux/fs.h> 11 + #include <linux/cred.h> 10 12 11 13 struct seq_operations; 12 - struct file; 13 - struct path; 14 - struct inode; 15 - struct dentry; 16 - struct user_namespace; 17 14 18 15 struct seq_file { 19 16 char *buf; ··· 24 27 struct mutex lock; 25 28 const struct seq_operations *op; 26 29 int poll_event; 27 - #ifdef CONFIG_USER_NS 28 - struct user_namespace *user_ns; 29 - #endif 30 + const struct file *file; 30 31 void *private; 31 32 }; 32 33 ··· 142 147 static inline struct user_namespace *seq_user_ns(struct seq_file *seq) 143 148 { 144 149 #ifdef CONFIG_USER_NS 145 - return seq->user_ns; 150 + return seq->file->f_cred->user_ns; 146 151 #else 147 152 extern struct user_namespace init_user_ns; 148 153 return &init_user_ns;
+2
include/linux/usb_usual.h
··· 79 79 /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \ 80 80 US_FLAG(MAX_SECTORS_240, 0x08000000) \ 81 81 /* Sets max_sectors to 240 */ \ 82 + US_FLAG(NO_REPORT_LUNS, 0x10000000) \ 83 + /* Cannot handle REPORT_LUNS */ \ 82 84 83 85 #define US_FLAG(name, value) US_FL_##name = value , 84 86 enum { US_DO_ALL_FLAGS };
+2
kernel/locking/lockdep.c
··· 1999 1999 return ++i; 2000 2000 } 2001 2001 2002 + #ifdef CONFIG_DEBUG_LOCKDEP 2002 2003 /* 2003 2004 * Returns the next chain_key iteration 2004 2005 */ ··· 2070 2069 printk("\nstack backtrace:\n"); 2071 2070 dump_stack(); 2072 2071 } 2072 + #endif 2073 2073 2074 2074 /* 2075 2075 * Checks whether the chain and the current held locks are consistent
+11 -2
kernel/resource.c
··· 105 105 { 106 106 struct resource *root = m->private; 107 107 struct resource *r = v, *p; 108 + unsigned long long start, end; 108 109 int width = root->end < 0x10000 ? 4 : 8; 109 110 int depth; 110 111 111 112 for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent) 112 113 if (p->parent == root) 113 114 break; 115 + 116 + if (file_ns_capable(m->file, &init_user_ns, CAP_SYS_ADMIN)) { 117 + start = r->start; 118 + end = r->end; 119 + } else { 120 + start = end = 0; 121 + } 122 + 114 123 seq_printf(m, "%*s%0*llx-%0*llx : %s\n", 115 124 depth * 2, "", 116 - width, (unsigned long long) r->start, 117 - width, (unsigned long long) r->end, 125 + width, start, 126 + width, end, 118 127 r->name ? r->name : "<BAD>"); 119 128 return 0; 120 129 }
+3 -1
lib/assoc_array.c
··· 524 524 free_slot = i; 525 525 continue; 526 526 } 527 - if (ops->compare_object(assoc_array_ptr_to_leaf(ptr), index_key)) { 527 + if (assoc_array_ptr_is_leaf(ptr) && 528 + ops->compare_object(assoc_array_ptr_to_leaf(ptr), 529 + index_key)) { 528 530 pr_devel("replace in slot %d\n", i); 529 531 edit->leaf_p = &node->slots[i]; 530 532 edit->dead_leaf = node->slots[i];
+13 -12
lib/lz4/lz4defs.h
··· 11 11 /* 12 12 * Detects 64 bits mode 13 13 */ 14 - #if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) \ 15 - || defined(__ppc64__) || defined(__LP64__)) 14 + #if defined(CONFIG_64BIT) 16 15 #define LZ4_ARCH64 1 17 16 #else 18 17 #define LZ4_ARCH64 0 ··· 24 25 typedef struct _U16_S { u16 v; } U16_S; 25 26 typedef struct _U32_S { u32 v; } U32_S; 26 27 typedef struct _U64_S { u64 v; } U64_S; 27 - #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) \ 28 - || defined(CONFIG_ARM) && __LINUX_ARM_ARCH__ >= 6 \ 29 - && defined(ARM_EFFICIENT_UNALIGNED_ACCESS) 28 + #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) 30 29 31 30 #define A16(x) (((U16_S *)(x))->v) 32 31 #define A32(x) (((U32_S *)(x))->v) ··· 32 35 33 36 #define PUT4(s, d) (A32(d) = A32(s)) 34 37 #define PUT8(s, d) (A64(d) = A64(s)) 38 + 39 + #define LZ4_READ_LITTLEENDIAN_16(d, s, p) \ 40 + (d = s - A16(p)) 41 + 35 42 #define LZ4_WRITE_LITTLEENDIAN_16(p, v) \ 36 43 do { \ 37 44 A16(p) = v; \ ··· 52 51 #define PUT8(s, d) \ 53 52 put_unaligned(get_unaligned((const u64 *) s), (u64 *) d) 54 53 55 - #define LZ4_WRITE_LITTLEENDIAN_16(p, v) \ 56 - do { \ 57 - put_unaligned(v, (u16 *)(p)); \ 58 - p += 2; \ 54 + #define LZ4_READ_LITTLEENDIAN_16(d, s, p) \ 55 + (d = s - get_unaligned_le16(p)) 56 + 57 + #define LZ4_WRITE_LITTLEENDIAN_16(p, v) \ 58 + do { \ 59 + put_unaligned_le16(v, (u16 *)(p)); \ 60 + p += 2; \ 59 61 } while (0) 60 62 #endif 61 63 ··· 143 139 #endif 144 140 145 141 #endif 146 - 147 - #define LZ4_READ_LITTLEENDIAN_16(d, s, p) \ 148 - (d = s - get_unaligned_le16(p)) 149 142 150 143 #define LZ4_WILDCOPY(s, d, e) \ 151 144 do { \
+2 -2
mm/backing-dev.c
··· 898 898 void clear_wb_congested(struct bdi_writeback_congested *congested, int sync) 899 899 { 900 900 wait_queue_head_t *wqh = &congestion_wqh[sync]; 901 - enum wb_state bit; 901 + enum wb_congested_state bit; 902 902 903 903 bit = sync ? WB_sync_congested : WB_async_congested; 904 904 if (test_and_clear_bit(bit, &congested->state)) ··· 911 911 912 912 void set_wb_congested(struct bdi_writeback_congested *congested, int sync) 913 913 { 914 - enum wb_state bit; 914 + enum wb_congested_state bit; 915 915 916 916 bit = sync ? WB_sync_congested : WB_async_congested; 917 917 if (!test_and_set_bit(bit, &congested->state))
+7 -45
mm/gup.c
··· 1 - #define __DISABLE_GUP_DEPRECATED 1 2 1 #include <linux/kernel.h> 3 2 #include <linux/errno.h> 4 3 #include <linux/err.h> ··· 838 839 * if (locked) 839 840 * up_read(&mm->mmap_sem); 840 841 */ 841 - long get_user_pages_locked6(unsigned long start, unsigned long nr_pages, 842 + long get_user_pages_locked(unsigned long start, unsigned long nr_pages, 842 843 int write, int force, struct page **pages, 843 844 int *locked) 844 845 { ··· 846 847 write, force, pages, NULL, locked, true, 847 848 FOLL_TOUCH); 848 849 } 849 - EXPORT_SYMBOL(get_user_pages_locked6); 850 + EXPORT_SYMBOL(get_user_pages_locked); 850 851 851 852 /* 852 853 * Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows to ··· 891 892 * or if "force" shall be set to 1 (get_user_pages_fast misses the 892 893 * "force" parameter). 893 894 */ 894 - long get_user_pages_unlocked5(unsigned long start, unsigned long nr_pages, 895 + long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, 895 896 int write, int force, struct page **pages) 896 897 { 897 898 return __get_user_pages_unlocked(current, current->mm, start, nr_pages, 898 899 write, force, pages, FOLL_TOUCH); 899 900 } 900 - EXPORT_SYMBOL(get_user_pages_unlocked5); 901 + EXPORT_SYMBOL(get_user_pages_unlocked); 901 902 902 903 /* 903 904 * get_user_pages_remote() - pin user pages in memory ··· 971 972 * and mm being operated on are the current task's. We also 972 973 * obviously don't pass FOLL_REMOTE in here. 973 974 */ 974 - long get_user_pages6(unsigned long start, unsigned long nr_pages, 975 + long get_user_pages(unsigned long start, unsigned long nr_pages, 975 976 int write, int force, struct page **pages, 976 977 struct vm_area_struct **vmas) 977 978 { ··· 979 980 write, force, pages, vmas, NULL, false, 980 981 FOLL_TOUCH); 981 982 } 982 - EXPORT_SYMBOL(get_user_pages6); 983 + EXPORT_SYMBOL(get_user_pages); 983 984 984 985 /** 985 986 * populate_vma_page_range() - populate a range of pages in the vma. ··· 1490 1491 int get_user_pages_fast(unsigned long start, int nr_pages, int write, 1491 1492 struct page **pages) 1492 1493 { 1493 - struct mm_struct *mm = current->mm; 1494 1494 int nr, ret; 1495 1495 1496 1496 start &= PAGE_MASK; ··· 1501 1503 start += nr << PAGE_SHIFT; 1502 1504 pages += nr; 1503 1505 1504 - ret = get_user_pages_unlocked(current, mm, start, 1505 - nr_pages - nr, write, 0, pages); 1506 + ret = get_user_pages_unlocked(start, nr_pages - nr, write, 0, pages); 1506 1507 1507 1508 /* Have to be a bit careful with return values */ 1508 1509 if (nr > 0) { ··· 1516 1519 } 1517 1520 1518 1521 #endif /* CONFIG_HAVE_GENERIC_RCU_GUP */ 1519 - 1520 - long get_user_pages8(struct task_struct *tsk, struct mm_struct *mm, 1521 - unsigned long start, unsigned long nr_pages, 1522 - int write, int force, struct page **pages, 1523 - struct vm_area_struct **vmas) 1524 - { 1525 - WARN_ONCE(tsk != current, "get_user_pages() called on remote task"); 1526 - WARN_ONCE(mm != current->mm, "get_user_pages() called on remote mm"); 1527 - 1528 - return get_user_pages6(start, nr_pages, write, force, pages, vmas); 1529 - } 1530 - EXPORT_SYMBOL(get_user_pages8); 1531 - 1532 - long get_user_pages_locked8(struct task_struct *tsk, struct mm_struct *mm, 1533 - unsigned long start, unsigned long nr_pages, 1534 - int write, int force, struct page **pages, int *locked) 1535 - { 1536 - WARN_ONCE(tsk != current, "get_user_pages_locked() called on remote task"); 1537 - WARN_ONCE(mm != current->mm, "get_user_pages_locked() called on remote mm"); 1538 - 1539 - return get_user_pages_locked6(start, nr_pages, write, force, pages, locked); 1540 - } 1541 - EXPORT_SYMBOL(get_user_pages_locked8); 1542 - 1543 - long get_user_pages_unlocked7(struct task_struct *tsk, struct mm_struct *mm, 1544 - unsigned long start, unsigned long nr_pages, 1545 - int write, int force, struct page **pages) 1546 - { 1547 - WARN_ONCE(tsk != current, "get_user_pages_unlocked() called on remote task"); 1548 - WARN_ONCE(mm != current->mm, "get_user_pages_unlocked() called on remote mm"); 1549 - 1550 - return get_user_pages_unlocked5(start, nr_pages, write, force, pages); 1551 - } 1552 - EXPORT_SYMBOL(get_user_pages_unlocked7); 1553 -
+7 -37
mm/nommu.c
··· 15 15 16 16 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 17 17 18 - #define __DISABLE_GUP_DEPRECATED 19 - 20 18 #include <linux/export.h> 21 19 #include <linux/mm.h> 22 20 #include <linux/vmacache.h> ··· 159 161 * slab page or a secondary page from a compound page 160 162 * - don't permit access to VMAs that don't support it, such as I/O mappings 161 163 */ 162 - long get_user_pages6(unsigned long start, unsigned long nr_pages, 164 + long get_user_pages(unsigned long start, unsigned long nr_pages, 163 165 int write, int force, struct page **pages, 164 166 struct vm_area_struct **vmas) 165 167 { ··· 173 175 return __get_user_pages(current, current->mm, start, nr_pages, flags, 174 176 pages, vmas, NULL); 175 177 } 176 - EXPORT_SYMBOL(get_user_pages6); 178 + EXPORT_SYMBOL(get_user_pages); 177 179 178 - long get_user_pages_locked6(unsigned long start, unsigned long nr_pages, 180 + long get_user_pages_locked(unsigned long start, unsigned long nr_pages, 179 181 int write, int force, struct page **pages, 180 182 int *locked) 181 183 { 182 - return get_user_pages6(start, nr_pages, write, force, pages, NULL); 184 + return get_user_pages(start, nr_pages, write, force, pages, NULL); 183 185 } 184 - EXPORT_SYMBOL(get_user_pages_locked6); 186 + EXPORT_SYMBOL(get_user_pages_locked); 185 187 186 188 long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, 187 189 unsigned long start, unsigned long nr_pages, ··· 197 199 } 198 200 EXPORT_SYMBOL(__get_user_pages_unlocked); 199 201 200 - long get_user_pages_unlocked5(unsigned long start, unsigned long nr_pages, 202 + long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, 201 203 int write, int force, struct page **pages) 202 204 { 203 205 return __get_user_pages_unlocked(current, current->mm, start, nr_pages, 204 206 write, force, pages, 0); 205 207 } 206 - EXPORT_SYMBOL(get_user_pages_unlocked5); 208 + EXPORT_SYMBOL(get_user_pages_unlocked); 207 209 208 210 /** 209 211 * follow_pfn - look up PFN at a user virtual address ··· 1987 1989 return 0; 1988 1990 } 1989 1991 subsys_initcall(init_admin_reserve); 1990 - 1991 - long get_user_pages8(struct task_struct *tsk, struct mm_struct *mm, 1992 - unsigned long start, unsigned long nr_pages, 1993 - int write, int force, struct page **pages, 1994 - struct vm_area_struct **vmas) 1995 - { 1996 - return get_user_pages6(start, nr_pages, write, force, pages, vmas); 1997 - } 1998 - EXPORT_SYMBOL(get_user_pages8); 1999 - 2000 - long get_user_pages_locked8(struct task_struct *tsk, struct mm_struct *mm, 2001 - unsigned long start, unsigned long nr_pages, 2002 - int write, int force, struct page **pages, 2003 - int *locked) 2004 - { 2005 - return get_user_pages_locked6(start, nr_pages, write, 2006 - force, pages, locked); 2007 - } 2008 - EXPORT_SYMBOL(get_user_pages_locked8); 2009 - 2010 - long get_user_pages_unlocked7(struct task_struct *tsk, struct mm_struct *mm, 2011 - unsigned long start, unsigned long nr_pages, 2012 - int write, int force, struct page **pages) 2013 - { 2014 - return get_user_pages_unlocked5(start, nr_pages, write, force, pages); 2015 - } 2016 - EXPORT_SYMBOL(get_user_pages_unlocked7); 2017 -
+6 -2
net/sunrpc/auth_gss/gss_krb5_crypto.c
··· 78 78 memcpy(out, in, length); 79 79 sg_init_one(sg, out, length); 80 80 81 + skcipher_request_set_tfm(req, tfm); 81 82 skcipher_request_set_callback(req, 0, NULL, NULL); 82 83 skcipher_request_set_crypt(req, sg, sg, length, local_iv); 83 84 ··· 116 115 memcpy(out, in, length); 117 116 sg_init_one(sg, out, length); 118 117 118 + skcipher_request_set_tfm(req, tfm); 119 119 skcipher_request_set_callback(req, 0, NULL, NULL); 120 120 skcipher_request_set_crypt(req, sg, sg, length, local_iv); 121 121 ··· 948 946 return PTR_ERR(hmac); 949 947 } 950 948 951 - desc = kmalloc(sizeof(*desc), GFP_KERNEL); 949 + desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac), 950 + GFP_KERNEL); 952 951 if (!desc) { 953 952 dprintk("%s: failed to allocate shash descriptor for '%s'\n", 954 953 __func__, kctx->gk5e->cksum_name); ··· 1015 1012 return PTR_ERR(hmac); 1016 1013 } 1017 1014 1018 - desc = kmalloc(sizeof(*desc), GFP_KERNEL); 1015 + desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac), 1016 + GFP_KERNEL); 1019 1017 if (!desc) { 1020 1018 dprintk("%s: failed to allocate shash descriptor for '%s'\n", 1021 1019 __func__, kctx->gk5e->cksum_name);
+2 -1
net/sunrpc/auth_gss/gss_krb5_mech.c
··· 451 451 goto out_err_free_hmac; 452 452 453 453 454 - desc = kmalloc(sizeof(*desc), GFP_KERNEL); 454 + desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac), 455 + GFP_KERNEL); 455 456 if (!desc) { 456 457 dprintk("%s: failed to allocate hash descriptor for '%s'\n", 457 458 __func__, ctx->gk5e->cksum_name);
+1 -1
scripts/asn1_compiler.c
··· 650 650 } 651 651 652 652 hdr = fopen(headername, "w"); 653 - if (!out) { 653 + if (!hdr) { 654 654 perror(headername); 655 655 exit(1); 656 656 }
+15
sound/hda/hdac_i915.c
··· 267 267 } 268 268 EXPORT_SYMBOL_GPL(snd_hdac_i915_register_notifier); 269 269 270 + /* check whether intel graphics is present */ 271 + static bool i915_gfx_present(void) 272 + { 273 + static struct pci_device_id ids[] = { 274 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_ANY_ID), 275 + .class = PCI_BASE_CLASS_DISPLAY << 16, 276 + .class_mask = 0xff << 16 }, 277 + {} 278 + }; 279 + return pci_dev_present(ids); 280 + } 281 + 270 282 /** 271 283 * snd_hdac_i915_init - Initialize i915 audio component 272 284 * @bus: HDA core bus ··· 297 285 struct device *dev = bus->dev; 298 286 struct i915_audio_component *acomp; 299 287 int ret; 288 + 289 + if (!i915_gfx_present()) 290 + return -ENODEV; 300 291 301 292 acomp = kzalloc(sizeof(*acomp), GFP_KERNEL); 302 293 if (!acomp)
+1 -1
sound/isa/sscape.c
··· 591 591 } 592 592 err = upload_dma_data(sscape, init_fw->data, init_fw->size); 593 593 if (err == 0) 594 - snd_printk(KERN_INFO "sscape: MIDI firmware loaded %d KBs\n", 594 + snd_printk(KERN_INFO "sscape: MIDI firmware loaded %zu KBs\n", 595 595 init_fw->size >> 10); 596 596 597 597 release_firmware(init_fw);
+4 -5
sound/pci/hda/patch_hdmi.c
··· 1396 1396 struct hda_codec *codec = per_pin->codec; 1397 1397 struct hdmi_spec *spec = codec->spec; 1398 1398 struct hdmi_eld *eld = &spec->temp_eld; 1399 - struct hdmi_eld *pin_eld = &per_pin->sink_eld; 1400 1399 hda_nid_t pin_nid = per_pin->pin_nid; 1401 1400 /* 1402 1401 * Always execute a GetPinSense verb here, even when called from ··· 1412 1413 present = snd_hda_pin_sense(codec, pin_nid); 1413 1414 1414 1415 mutex_lock(&per_pin->lock); 1415 - pin_eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE); 1416 - if (pin_eld->monitor_present) 1416 + eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE); 1417 + if (eld->monitor_present) 1417 1418 eld->eld_valid = !!(present & AC_PINSENSE_ELDV); 1418 1419 else 1419 1420 eld->eld_valid = false; 1420 1421 1421 1422 codec_dbg(codec, 1422 1423 "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", 1423 - codec->addr, pin_nid, pin_eld->monitor_present, eld->eld_valid); 1424 + codec->addr, pin_nid, eld->monitor_present, eld->eld_valid); 1424 1425 1425 1426 if (eld->eld_valid) { 1426 1427 if (spec->ops.pin_get_eld(codec, pin_nid, eld->eld_buffer, ··· 1440 1441 else 1441 1442 update_eld(codec, per_pin, eld); 1442 1443 1443 - ret = !repoll || !pin_eld->monitor_present || pin_eld->eld_valid; 1444 + ret = !repoll || !eld->monitor_present || eld->eld_valid; 1444 1445 1445 1446 jack = snd_hda_jack_tbl_get(codec, pin_nid); 1446 1447 if (jack)
+9 -1
sound/pci/hda/patch_realtek.c
··· 4760 4760 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 4761 4761 ALC280_FIXUP_HP_HEADSET_MIC, 4762 4762 ALC221_FIXUP_HP_FRONT_MIC, 4763 + ALC292_FIXUP_TPT460, 4763 4764 }; 4764 4765 4765 4766 static const struct hda_fixup alc269_fixups[] = { ··· 5410 5409 { } 5411 5410 }, 5412 5411 }, 5412 + [ALC292_FIXUP_TPT460] = { 5413 + .type = HDA_FIXUP_FUNC, 5414 + .v.func = alc_fixup_tpt440_dock, 5415 + .chained = true, 5416 + .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, 5417 + }, 5413 5418 }; 5414 5419 5415 5420 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 5570 5563 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), 5571 5564 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), 5572 5565 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), 5573 - SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), 5566 + SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), 5574 5567 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 5575 5568 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 5576 5569 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), ··· 5665 5658 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, 5666 5659 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, 5667 5660 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, 5661 + {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, 5668 5662 {} 5669 5663 }; 5670 5664 #define ALC225_STANDARD_PINS \
+14
sound/usb/mixer_maps.c
··· 349 349 }; 350 350 351 351 /* 352 + * Dell usb dock with ALC4020 codec had a firmware problem where it got 353 + * screwed up when zero volume is passed; just skip it as a workaround 354 + */ 355 + static const struct usbmix_name_map dell_alc4020_map[] = { 356 + { 16, NULL }, 357 + { 19, NULL }, 358 + { 0 } 359 + }; 360 + 361 + /* 352 362 * Control map entries 353 363 */ 354 364 ··· 439 429 { 440 430 .id = USB_ID(0x0ccd, 0x0028), 441 431 .map = aureon_51_2_map, 432 + }, 433 + { 434 + .id = USB_ID(0x0bda, 0x4014), 435 + .map = dell_alc4020_map, 442 436 }, 443 437 { 444 438 .id = USB_ID(0x0dba, 0x1000),
+2
sound/usb/quirks.c
··· 1134 1134 case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ 1135 1135 case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ 1136 1136 case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ 1137 + case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */ 1137 1138 case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ 1138 1139 case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ 1139 1140 case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ 1141 + case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ 1140 1142 case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */ 1141 1143 return true; 1142 1144 }
+39 -10
virt/kvm/arm/arch_timer.c
··· 91 91 vcpu = container_of(work, struct kvm_vcpu, arch.timer_cpu.expired); 92 92 vcpu->arch.timer_cpu.armed = false; 93 93 94 + WARN_ON(!kvm_timer_should_fire(vcpu)); 95 + 94 96 /* 95 97 * If the vcpu is blocked we want to wake it up so that it will see 96 98 * the timer has expired when entering the guest. ··· 100 98 kvm_vcpu_kick(vcpu); 101 99 } 102 100 101 + static u64 kvm_timer_compute_delta(struct kvm_vcpu *vcpu) 102 + { 103 + cycle_t cval, now; 104 + 105 + cval = vcpu->arch.timer_cpu.cntv_cval; 106 + now = kvm_phys_timer_read() - vcpu->kvm->arch.timer.cntvoff; 107 + 108 + if (now < cval) { 109 + u64 ns; 110 + 111 + ns = cyclecounter_cyc2ns(timecounter->cc, 112 + cval - now, 113 + timecounter->mask, 114 + &timecounter->frac); 115 + return ns; 116 + } 117 + 118 + return 0; 119 + } 120 + 103 121 static enum hrtimer_restart kvm_timer_expire(struct hrtimer *hrt) 104 122 { 105 123 struct arch_timer_cpu *timer; 124 + struct kvm_vcpu *vcpu; 125 + u64 ns; 126 + 106 127 timer = container_of(hrt, struct arch_timer_cpu, timer); 128 + vcpu = container_of(timer, struct kvm_vcpu, arch.timer_cpu); 129 + 130 + /* 131 + * Check that the timer has really expired from the guest's 132 + * PoV (NTP on the host may have forced it to expire 133 + * early). If we should have slept longer, restart it. 134 + */ 135 + ns = kvm_timer_compute_delta(vcpu); 136 + if (unlikely(ns)) { 137 + hrtimer_forward_now(hrt, ns_to_ktime(ns)); 138 + return HRTIMER_RESTART; 139 + } 140 + 107 141 queue_work(wqueue, &timer->expired); 108 142 return HRTIMER_NORESTART; 109 143 } ··· 214 176 void kvm_timer_schedule(struct kvm_vcpu *vcpu) 215 177 { 216 178 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; 217 - u64 ns; 218 - cycle_t cval, now; 219 179 220 180 BUG_ON(timer_is_armed(timer)); 221 181 ··· 233 197 return; 234 198 235 199 /* The timer has not yet expired, schedule a background timer */ 236 - cval = timer->cntv_cval; 237 - now = kvm_phys_timer_read() - vcpu->kvm->arch.timer.cntvoff; 238 - 239 - ns = cyclecounter_cyc2ns(timecounter->cc, 240 - cval - now, 241 - timecounter->mask, 242 - &timecounter->frac); 243 - timer_arm(timer, ns); 200 + timer_arm(timer, kvm_timer_compute_delta(vcpu)); 244 201 } 245 202 246 203 void kvm_timer_unschedule(struct kvm_vcpu *vcpu)
+2 -1
virt/kvm/arm/pmu.c
··· 193 193 { 194 194 u64 reg = 0; 195 195 196 - if ((vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) 196 + if ((vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) { 197 197 reg = vcpu_sys_reg(vcpu, PMOVSSET_EL0); 198 198 reg &= vcpu_sys_reg(vcpu, PMCNTENSET_EL0); 199 199 reg &= vcpu_sys_reg(vcpu, PMINTENSET_EL1); 200 200 reg &= kvm_pmu_valid_counter_mask(vcpu); 201 + } 201 202 202 203 return reg; 203 204 }