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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts were two cases of simple overlapping changes,
nothing serious.

In the UDP case, we need to add a hlist_add_tail_rcu()
to linux/rculist.h, because we've moved UDP socket handling
away from using nulls lists.

Signed-off-by: David S. Miller <davem@davemloft.net>

+2917 -1788
+12 -17
Documentation/ABI/testing/sysfs-platform-i2c-demux-pinctrl
··· 1 - What: /sys/devices/platform/<i2c-demux-name>/cur_master 1 + What: /sys/devices/platform/<i2c-demux-name>/available_masters 2 2 Date: January 2016 3 3 KernelVersion: 4.6 4 4 Contact: Wolfram Sang <wsa@the-dreams.de> 5 5 Description: 6 + Reading the file will give you a list of masters which can be 7 + selected for a demultiplexed bus. The format is 8 + "<index>:<name>". Example from a Renesas Lager board: 6 9 7 - This file selects the active I2C master for a demultiplexed bus. 10 + 0:/i2c@e6500000 1:/i2c@e6508000 8 11 9 - Write 0 there for the first master, 1 for the second etc. Reading the file will 10 - give you a list with the active master marked. Example from a Renesas Lager 11 - board: 12 - 13 - root@Lager:~# cat /sys/devices/platform/i2c@8/cur_master 14 - * 0 - /i2c@9 15 - 1 - /i2c@e6520000 16 - 2 - /i2c@e6530000 17 - 18 - root@Lager:~# echo 2 > /sys/devices/platform/i2c@8/cur_master 19 - 20 - root@Lager:~# cat /sys/devices/platform/i2c@8/cur_master 21 - 0 - /i2c@9 22 - 1 - /i2c@e6520000 23 - * 2 - /i2c@e6530000 12 + What: /sys/devices/platform/<i2c-demux-name>/current_master 13 + Date: January 2016 14 + KernelVersion: 4.6 15 + Contact: Wolfram Sang <wsa@the-dreams.de> 16 + Description: 17 + This file selects/shows the active I2C master for a demultiplexed 18 + bus. It uses the <index> value from the file 'available_masters'.
+5 -2
Documentation/devicetree/bindings/net/mediatek-net.txt
··· 9 9 Required properties: 10 10 - compatible: Should be "mediatek,mt7623-eth" 11 11 - reg: Address and length of the register set for the device 12 - - interrupts: Should contain the frame engines interrupt 12 + - interrupts: Should contain the three frame engines interrupts in numeric 13 + order. These are fe_int0, fe_int1 and fe_int2. 13 14 - clocks: the clock used by the core 14 15 - clock-names: the names of the clock listed in the clocks property. These are 15 16 "ethif", "esw", "gp2", "gp1" ··· 43 42 <&ethsys CLK_ETHSYS_GP2>, 44 43 <&ethsys CLK_ETHSYS_GP1>; 45 44 clock-names = "ethif", "esw", "gp2", "gp1"; 46 - interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW>; 45 + interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW 46 + GIC_SPI 199 IRQ_TYPE_LEVEL_LOW 47 + GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>; 47 48 power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>; 48 49 resets = <&ethsys MT2701_ETHSYS_ETH_RST>; 49 50 reset-names = "eth";
+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 };
+4 -3
Documentation/devicetree/bindings/rtc/s3c-rtc.txt
··· 15 15 is the rtc tick interrupt. The number of cells representing a interrupt 16 16 depends on the parent interrupt controller. 17 17 - clocks: Must contain a list of phandle and clock specifier for the rtc 18 - and source clocks. 19 - - clock-names: Must contain "rtc" and "rtc_src" entries sorted in the 20 - same order as the clocks property. 18 + clock and in the case of a s3c6410 compatible controller, also 19 + a source clock. 20 + - clock-names: Must contain "rtc" and for a s3c6410 compatible controller, 21 + a "rtc_src" sorted in the same order as the clocks property. 21 22 22 23 Example: 23 24
+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
··· 6253 6253 F: tools/testing/selftests 6254 6254 6255 6255 KERNEL VIRTUAL MACHINE (KVM) 6256 - M: Gleb Natapov <gleb@kernel.org> 6257 6256 M: Paolo Bonzini <pbonzini@redhat.com> 6257 + M: Radim Krčmář <rkrcmar@redhat.com> 6258 6258 L: kvm@vger.kernel.org 6259 6259 W: http://www.linux-kvm.org 6260 6260 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 = -rc2 4 + EXTRAVERSION = -rc4 5 5 NAME = Blurry Fish Butt 6 6 7 7 # *DOCUMENTATION*
-1
arch/arc/Kconfig
··· 593 593 def_bool PCI 594 594 595 595 source "drivers/pci/Kconfig" 596 - source "drivers/pci/pcie/Kconfig" 597 596 598 597 endmenu 599 598
-8
arch/arc/boot/dts/axs10x_mb.dtsi
··· 47 47 clocks = <&apbclk>; 48 48 clock-names = "stmmaceth"; 49 49 max-speed = <100>; 50 - mdio0 { 51 - #address-cells = <1>; 52 - #size-cells = <0>; 53 - compatible = "snps,dwmac-mdio"; 54 - phy1: ethernet-phy@1 { 55 - reg = <1>; 56 - }; 57 - }; 58 50 }; 59 51 60 52 ehci@0x40000 {
+1
arch/arc/configs/axs103_defconfig
··· 42 42 # CONFIG_STANDALONE is not set 43 43 # CONFIG_PREVENT_FIRMWARE_BUILD is not set 44 44 # CONFIG_FIRMWARE_IN_KERNEL is not set 45 + CONFIG_BLK_DEV_LOOP=y 45 46 CONFIG_SCSI=y 46 47 CONFIG_BLK_DEV_SD=y 47 48 CONFIG_NETDEVICES=y
+1
arch/arc/configs/axs103_smp_defconfig
··· 43 43 # CONFIG_STANDALONE is not set 44 44 # CONFIG_PREVENT_FIRMWARE_BUILD is not set 45 45 # CONFIG_FIRMWARE_IN_KERNEL is not set 46 + CONFIG_BLK_DEV_LOOP=y 46 47 CONFIG_SCSI=y 47 48 CONFIG_BLK_DEV_SD=y 48 49 CONFIG_NETDEVICES=y
+19
arch/arc/include/asm/fb.h
··· 1 + #ifndef _ASM_FB_H_ 2 + #define _ASM_FB_H_ 3 + 4 + #include <linux/fb.h> 5 + #include <linux/fs.h> 6 + #include <asm/page.h> 7 + 8 + static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 9 + unsigned long off) 10 + { 11 + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 12 + } 13 + 14 + static inline int fb_is_primary_device(struct fb_info *info) 15 + { 16 + return 0; 17 + } 18 + 19 + #endif /* _ASM_FB_H_ */
+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
+1 -1
arch/arm/include/asm/cputype.h
··· 276 276 int feature = (features >> field) & 15; 277 277 278 278 /* feature registers are signed values */ 279 - if (feature > 8) 279 + if (feature > 7) 280 280 feature -= 16; 281 281 282 282 return feature;
+1 -1
arch/arm/include/asm/unistd.h
··· 19 19 * This may need to be greater than __NR_last_syscall+1 in order to 20 20 * account for the padding in the syscall table 21 21 */ 22 - #define __NR_syscalls (392) 22 + #define __NR_syscalls (396) 23 23 24 24 #define __ARCH_WANT_STAT64 25 25 #define __ARCH_WANT_SYS_GETHOSTNAME
+2
arch/arm/include/uapi/asm/unistd.h
··· 418 418 #define __NR_membarrier (__NR_SYSCALL_BASE+389) 419 419 #define __NR_mlock2 (__NR_SYSCALL_BASE+390) 420 420 #define __NR_copy_file_range (__NR_SYSCALL_BASE+391) 421 + #define __NR_preadv2 (__NR_SYSCALL_BASE+392) 422 + #define __NR_pwritev2 (__NR_SYSCALL_BASE+393) 421 423 422 424 /* 423 425 * The following SWIs are ARM private.
+3 -1
arch/arm/kernel/calls.S
··· 399 399 CALL(sys_execveat) 400 400 CALL(sys_userfaultfd) 401 401 CALL(sys_membarrier) 402 - CALL(sys_mlock2) 402 + /* 390 */ CALL(sys_mlock2) 403 403 CALL(sys_copy_file_range) 404 + CALL(sys_preadv2) 405 + CALL(sys_pwritev2) 404 406 #ifndef syscalls_counted 405 407 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 406 408 #define syscalls_counted
+3 -1
arch/arm/kernel/setup.c
··· 430 430 pr_info("CPU: div instructions available: patching division code\n"); 431 431 432 432 fn_addr = ((uintptr_t)&__aeabi_uidiv) & ~1; 433 + asm ("" : "+g" (fn_addr)); 433 434 ((u32 *)fn_addr)[0] = udiv_instruction(); 434 435 ((u32 *)fn_addr)[1] = bx_lr_instruction(); 435 436 flush_icache_range(fn_addr, fn_addr + 8); 436 437 437 438 fn_addr = ((uintptr_t)&__aeabi_idiv) & ~1; 439 + asm ("" : "+g" (fn_addr)); 438 440 ((u32 *)fn_addr)[0] = sdiv_instruction(); 439 441 ((u32 *)fn_addr)[1] = bx_lr_instruction(); 440 442 flush_icache_range(fn_addr, fn_addr + 8); ··· 512 510 */ 513 511 if (cpuid_feature_extract(CPUID_EXT_ISAR3, 12) > 1 || 514 512 (cpuid_feature_extract(CPUID_EXT_ISAR3, 12) == 1 && 515 - cpuid_feature_extract(CPUID_EXT_ISAR3, 20) >= 3)) 513 + cpuid_feature_extract(CPUID_EXT_ISAR4, 20) >= 3)) 516 514 elf_hwcap &= ~HWCAP_SWP; 517 515 } 518 516
+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;
+2 -1
arch/arm/mm/dma-mapping.c
··· 762 762 if (!mask) 763 763 return NULL; 764 764 765 - buf = kzalloc(sizeof(*buf), gfp); 765 + buf = kzalloc(sizeof(*buf), 766 + gfp & ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM)); 766 767 if (!buf) 767 768 return NULL; 768 769
+5 -5
arch/arm/mm/proc-v7.S
··· 281 281 bl v7_invalidate_l1 282 282 ldmia r12, {r1-r6, lr} 283 283 #ifdef CONFIG_SMP 284 + orr r10, r10, #(1 << 6) @ Enable SMP/nAMP mode 284 285 ALT_SMP(mrc p15, 0, r0, c1, c0, 1) 285 - ALT_UP(mov r0, #(1 << 6)) @ fake it for UP 286 - tst r0, #(1 << 6) @ SMP/nAMP mode enabled? 287 - orreq r0, r0, #(1 << 6) @ Enable SMP/nAMP mode 288 - orreq r0, r0, r10 @ Enable CPU-specific SMP bits 289 - mcreq p15, 0, r0, c1, c0, 1 286 + ALT_UP(mov r0, r10) @ fake it for UP 287 + orr r10, r10, r0 @ Set required bits 288 + teq r10, r0 @ Were they already set? 289 + mcrne p15, 0, r10, c1, c0, 1 @ No, update register 290 290 #endif 291 291 b __v7_setup_cont 292 292
+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);
+6 -7
arch/m68k/configs/amiga_defconfig
··· 1 1 CONFIG_LOCALVERSION="-amiga" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 63 64 CONFIG_INET_XFRM_MODE_TRANSPORT=m 64 65 CONFIG_INET_XFRM_MODE_TUNNEL=m 65 66 CONFIG_INET_XFRM_MODE_BEET=m 66 - # CONFIG_INET_LRO is not set 67 67 CONFIG_INET_DIAG=m 68 68 CONFIG_INET_UDP_DIAG=m 69 69 CONFIG_IPV6=m ··· 283 285 CONFIG_MPLS_ROUTING=m 284 286 CONFIG_MPLS_IPTUNNEL=m 285 287 CONFIG_NET_L3_MASTER_DEV=y 288 + CONFIG_AF_KCM=m 286 289 # CONFIG_WIRELESS is not set 290 + CONFIG_NET_DEVLINK=m 287 291 # CONFIG_UEVENT_HELPER is not set 288 292 CONFIG_DEVTMPFS=y 289 293 CONFIG_DEVTMPFS_MOUNT=y ··· 359 359 CONFIG_IPVLAN=m 360 360 CONFIG_VXLAN=m 361 361 CONFIG_GENEVE=m 362 + CONFIG_MACSEC=m 362 363 CONFIG_NETCONSOLE=m 363 364 CONFIG_NETCONSOLE_DYNAMIC=y 364 365 CONFIG_VETH=m ··· 453 452 CONFIG_XFS_FS=m 454 453 CONFIG_OCFS2_FS=m 455 454 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 455 + CONFIG_FS_ENCRYPTION=m 456 456 CONFIG_FANOTIFY=y 457 457 CONFIG_QUOTA_NETLINK_INTERFACE=y 458 458 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 470 468 CONFIG_PROC_KCORE=y 471 469 CONFIG_PROC_CHILDREN=y 472 470 CONFIG_TMPFS=y 471 + CONFIG_ORANGEFS_FS=m 473 472 CONFIG_AFFS_FS=m 474 473 CONFIG_ECRYPT_FS=m 475 474 CONFIG_ECRYPT_FS_MESSAGING=y ··· 552 549 CONFIG_TEST_STRING_HELPERS=m 553 550 CONFIG_TEST_KSTRTOX=m 554 551 CONFIG_TEST_PRINTF=m 552 + CONFIG_TEST_BITMAP=m 555 553 CONFIG_TEST_RHASHTABLE=m 556 554 CONFIG_TEST_LKM=m 557 555 CONFIG_TEST_USER_COPY=m ··· 561 557 CONFIG_TEST_UDELAY=m 562 558 CONFIG_TEST_STATIC_KEYS=m 563 559 CONFIG_EARLY_PRINTK=y 564 - CONFIG_ENCRYPTED_KEYS=m 565 560 CONFIG_CRYPTO_RSA=m 566 561 CONFIG_CRYPTO_MANAGER=y 567 562 CONFIG_CRYPTO_USER=m ··· 568 565 CONFIG_CRYPTO_MCRYPTD=m 569 566 CONFIG_CRYPTO_TEST=m 570 567 CONFIG_CRYPTO_CCM=m 571 - CONFIG_CRYPTO_GCM=m 572 568 CONFIG_CRYPTO_CHACHA20POLY1305=m 573 - CONFIG_CRYPTO_CTS=m 574 569 CONFIG_CRYPTO_LRW=m 575 570 CONFIG_CRYPTO_PCBC=m 576 - CONFIG_CRYPTO_XTS=m 577 571 CONFIG_CRYPTO_KEYWRAP=m 578 572 CONFIG_CRYPTO_XCBC=m 579 573 CONFIG_CRYPTO_VMAC=m ··· 594 594 CONFIG_CRYPTO_SERPENT=m 595 595 CONFIG_CRYPTO_TEA=m 596 596 CONFIG_CRYPTO_TWOFISH=m 597 - CONFIG_CRYPTO_ZLIB=m 598 597 CONFIG_CRYPTO_LZO=m 599 598 CONFIG_CRYPTO_842=m 600 599 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/apollo_defconfig
··· 1 1 CONFIG_LOCALVERSION="-apollo" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 61 62 CONFIG_INET_XFRM_MODE_TRANSPORT=m 62 63 CONFIG_INET_XFRM_MODE_TUNNEL=m 63 64 CONFIG_INET_XFRM_MODE_BEET=m 64 - # CONFIG_INET_LRO is not set 65 65 CONFIG_INET_DIAG=m 66 66 CONFIG_INET_UDP_DIAG=m 67 67 CONFIG_IPV6=m ··· 281 283 CONFIG_MPLS_ROUTING=m 282 284 CONFIG_MPLS_IPTUNNEL=m 283 285 CONFIG_NET_L3_MASTER_DEV=y 286 + CONFIG_AF_KCM=m 284 287 # CONFIG_WIRELESS is not set 288 + CONFIG_NET_DEVLINK=m 285 289 # CONFIG_UEVENT_HELPER is not set 286 290 CONFIG_DEVTMPFS=y 287 291 CONFIG_DEVTMPFS_MOUNT=y ··· 341 341 CONFIG_IPVLAN=m 342 342 CONFIG_VXLAN=m 343 343 CONFIG_GENEVE=m 344 + CONFIG_MACSEC=m 344 345 CONFIG_NETCONSOLE=m 345 346 CONFIG_NETCONSOLE_DYNAMIC=y 346 347 CONFIG_VETH=m ··· 412 411 CONFIG_XFS_FS=m 413 412 CONFIG_OCFS2_FS=m 414 413 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 414 + CONFIG_FS_ENCRYPTION=m 415 415 CONFIG_FANOTIFY=y 416 416 CONFIG_QUOTA_NETLINK_INTERFACE=y 417 417 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 429 427 CONFIG_PROC_KCORE=y 430 428 CONFIG_PROC_CHILDREN=y 431 429 CONFIG_TMPFS=y 430 + CONFIG_ORANGEFS_FS=m 432 431 CONFIG_AFFS_FS=m 433 432 CONFIG_ECRYPT_FS=m 434 433 CONFIG_ECRYPT_FS_MESSAGING=y ··· 511 508 CONFIG_TEST_STRING_HELPERS=m 512 509 CONFIG_TEST_KSTRTOX=m 513 510 CONFIG_TEST_PRINTF=m 511 + CONFIG_TEST_BITMAP=m 514 512 CONFIG_TEST_RHASHTABLE=m 515 513 CONFIG_TEST_LKM=m 516 514 CONFIG_TEST_USER_COPY=m ··· 520 516 CONFIG_TEST_UDELAY=m 521 517 CONFIG_TEST_STATIC_KEYS=m 522 518 CONFIG_EARLY_PRINTK=y 523 - CONFIG_ENCRYPTED_KEYS=m 524 519 CONFIG_CRYPTO_RSA=m 525 520 CONFIG_CRYPTO_MANAGER=y 526 521 CONFIG_CRYPTO_USER=m ··· 527 524 CONFIG_CRYPTO_MCRYPTD=m 528 525 CONFIG_CRYPTO_TEST=m 529 526 CONFIG_CRYPTO_CCM=m 530 - CONFIG_CRYPTO_GCM=m 531 527 CONFIG_CRYPTO_CHACHA20POLY1305=m 532 - CONFIG_CRYPTO_CTS=m 533 528 CONFIG_CRYPTO_LRW=m 534 529 CONFIG_CRYPTO_PCBC=m 535 - CONFIG_CRYPTO_XTS=m 536 530 CONFIG_CRYPTO_KEYWRAP=m 537 531 CONFIG_CRYPTO_XCBC=m 538 532 CONFIG_CRYPTO_VMAC=m ··· 553 553 CONFIG_CRYPTO_SERPENT=m 554 554 CONFIG_CRYPTO_TEA=m 555 555 CONFIG_CRYPTO_TWOFISH=m 556 - CONFIG_CRYPTO_ZLIB=m 557 556 CONFIG_CRYPTO_LZO=m 558 557 CONFIG_CRYPTO_842=m 559 558 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/atari_defconfig
··· 1 1 CONFIG_LOCALVERSION="-atari" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 61 62 CONFIG_INET_XFRM_MODE_TRANSPORT=m 62 63 CONFIG_INET_XFRM_MODE_TUNNEL=m 63 64 CONFIG_INET_XFRM_MODE_BEET=m 64 - # CONFIG_INET_LRO is not set 65 65 CONFIG_INET_DIAG=m 66 66 CONFIG_INET_UDP_DIAG=m 67 67 CONFIG_IPV6=m ··· 281 283 CONFIG_MPLS_ROUTING=m 282 284 CONFIG_MPLS_IPTUNNEL=m 283 285 CONFIG_NET_L3_MASTER_DEV=y 286 + CONFIG_AF_KCM=m 284 287 # CONFIG_WIRELESS is not set 288 + CONFIG_NET_DEVLINK=m 285 289 # CONFIG_UEVENT_HELPER is not set 286 290 CONFIG_DEVTMPFS=y 287 291 CONFIG_DEVTMPFS_MOUNT=y ··· 350 350 CONFIG_IPVLAN=m 351 351 CONFIG_VXLAN=m 352 352 CONFIG_GENEVE=m 353 + CONFIG_MACSEC=m 353 354 CONFIG_NETCONSOLE=m 354 355 CONFIG_NETCONSOLE_DYNAMIC=y 355 356 CONFIG_VETH=m ··· 433 432 CONFIG_XFS_FS=m 434 433 CONFIG_OCFS2_FS=m 435 434 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 435 + CONFIG_FS_ENCRYPTION=m 436 436 CONFIG_FANOTIFY=y 437 437 CONFIG_QUOTA_NETLINK_INTERFACE=y 438 438 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 450 448 CONFIG_PROC_KCORE=y 451 449 CONFIG_PROC_CHILDREN=y 452 450 CONFIG_TMPFS=y 451 + CONFIG_ORANGEFS_FS=m 453 452 CONFIG_AFFS_FS=m 454 453 CONFIG_ECRYPT_FS=m 455 454 CONFIG_ECRYPT_FS_MESSAGING=y ··· 532 529 CONFIG_TEST_STRING_HELPERS=m 533 530 CONFIG_TEST_KSTRTOX=m 534 531 CONFIG_TEST_PRINTF=m 532 + CONFIG_TEST_BITMAP=m 535 533 CONFIG_TEST_RHASHTABLE=m 536 534 CONFIG_TEST_LKM=m 537 535 CONFIG_TEST_USER_COPY=m ··· 541 537 CONFIG_TEST_UDELAY=m 542 538 CONFIG_TEST_STATIC_KEYS=m 543 539 CONFIG_EARLY_PRINTK=y 544 - CONFIG_ENCRYPTED_KEYS=m 545 540 CONFIG_CRYPTO_RSA=m 546 541 CONFIG_CRYPTO_MANAGER=y 547 542 CONFIG_CRYPTO_USER=m ··· 548 545 CONFIG_CRYPTO_MCRYPTD=m 549 546 CONFIG_CRYPTO_TEST=m 550 547 CONFIG_CRYPTO_CCM=m 551 - CONFIG_CRYPTO_GCM=m 552 548 CONFIG_CRYPTO_CHACHA20POLY1305=m 553 - CONFIG_CRYPTO_CTS=m 554 549 CONFIG_CRYPTO_LRW=m 555 550 CONFIG_CRYPTO_PCBC=m 556 - CONFIG_CRYPTO_XTS=m 557 551 CONFIG_CRYPTO_KEYWRAP=m 558 552 CONFIG_CRYPTO_XCBC=m 559 553 CONFIG_CRYPTO_VMAC=m ··· 574 574 CONFIG_CRYPTO_SERPENT=m 575 575 CONFIG_CRYPTO_TEA=m 576 576 CONFIG_CRYPTO_TWOFISH=m 577 - CONFIG_CRYPTO_ZLIB=m 578 577 CONFIG_CRYPTO_LZO=m 579 578 CONFIG_CRYPTO_842=m 580 579 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/bvme6000_defconfig
··· 1 1 CONFIG_LOCALVERSION="-bvme6000" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 59 60 CONFIG_INET_XFRM_MODE_TRANSPORT=m 60 61 CONFIG_INET_XFRM_MODE_TUNNEL=m 61 62 CONFIG_INET_XFRM_MODE_BEET=m 62 - # CONFIG_INET_LRO is not set 63 63 CONFIG_INET_DIAG=m 64 64 CONFIG_INET_UDP_DIAG=m 65 65 CONFIG_IPV6=m ··· 279 281 CONFIG_MPLS_ROUTING=m 280 282 CONFIG_MPLS_IPTUNNEL=m 281 283 CONFIG_NET_L3_MASTER_DEV=y 284 + CONFIG_AF_KCM=m 282 285 # CONFIG_WIRELESS is not set 286 + CONFIG_NET_DEVLINK=m 283 287 # CONFIG_UEVENT_HELPER is not set 284 288 CONFIG_DEVTMPFS=y 285 289 CONFIG_DEVTMPFS_MOUNT=y ··· 340 340 CONFIG_IPVLAN=m 341 341 CONFIG_VXLAN=m 342 342 CONFIG_GENEVE=m 343 + CONFIG_MACSEC=m 343 344 CONFIG_NETCONSOLE=m 344 345 CONFIG_NETCONSOLE_DYNAMIC=y 345 346 CONFIG_VETH=m ··· 404 403 CONFIG_XFS_FS=m 405 404 CONFIG_OCFS2_FS=m 406 405 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 406 + CONFIG_FS_ENCRYPTION=m 407 407 CONFIG_FANOTIFY=y 408 408 CONFIG_QUOTA_NETLINK_INTERFACE=y 409 409 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 421 419 CONFIG_PROC_KCORE=y 422 420 CONFIG_PROC_CHILDREN=y 423 421 CONFIG_TMPFS=y 422 + CONFIG_ORANGEFS_FS=m 424 423 CONFIG_AFFS_FS=m 425 424 CONFIG_ECRYPT_FS=m 426 425 CONFIG_ECRYPT_FS_MESSAGING=y ··· 503 500 CONFIG_TEST_STRING_HELPERS=m 504 501 CONFIG_TEST_KSTRTOX=m 505 502 CONFIG_TEST_PRINTF=m 503 + CONFIG_TEST_BITMAP=m 506 504 CONFIG_TEST_RHASHTABLE=m 507 505 CONFIG_TEST_LKM=m 508 506 CONFIG_TEST_USER_COPY=m ··· 512 508 CONFIG_TEST_UDELAY=m 513 509 CONFIG_TEST_STATIC_KEYS=m 514 510 CONFIG_EARLY_PRINTK=y 515 - CONFIG_ENCRYPTED_KEYS=m 516 511 CONFIG_CRYPTO_RSA=m 517 512 CONFIG_CRYPTO_MANAGER=y 518 513 CONFIG_CRYPTO_USER=m ··· 519 516 CONFIG_CRYPTO_MCRYPTD=m 520 517 CONFIG_CRYPTO_TEST=m 521 518 CONFIG_CRYPTO_CCM=m 522 - CONFIG_CRYPTO_GCM=m 523 519 CONFIG_CRYPTO_CHACHA20POLY1305=m 524 - CONFIG_CRYPTO_CTS=m 525 520 CONFIG_CRYPTO_LRW=m 526 521 CONFIG_CRYPTO_PCBC=m 527 - CONFIG_CRYPTO_XTS=m 528 522 CONFIG_CRYPTO_KEYWRAP=m 529 523 CONFIG_CRYPTO_XCBC=m 530 524 CONFIG_CRYPTO_VMAC=m ··· 545 545 CONFIG_CRYPTO_SERPENT=m 546 546 CONFIG_CRYPTO_TEA=m 547 547 CONFIG_CRYPTO_TWOFISH=m 548 - CONFIG_CRYPTO_ZLIB=m 549 548 CONFIG_CRYPTO_LZO=m 550 549 CONFIG_CRYPTO_842=m 551 550 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/hp300_defconfig
··· 1 1 CONFIG_LOCALVERSION="-hp300" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 61 62 CONFIG_INET_XFRM_MODE_TRANSPORT=m 62 63 CONFIG_INET_XFRM_MODE_TUNNEL=m 63 64 CONFIG_INET_XFRM_MODE_BEET=m 64 - # CONFIG_INET_LRO is not set 65 65 CONFIG_INET_DIAG=m 66 66 CONFIG_INET_UDP_DIAG=m 67 67 CONFIG_IPV6=m ··· 281 283 CONFIG_MPLS_ROUTING=m 282 284 CONFIG_MPLS_IPTUNNEL=m 283 285 CONFIG_NET_L3_MASTER_DEV=y 286 + CONFIG_AF_KCM=m 284 287 # CONFIG_WIRELESS is not set 288 + CONFIG_NET_DEVLINK=m 285 289 # CONFIG_UEVENT_HELPER is not set 286 290 CONFIG_DEVTMPFS=y 287 291 CONFIG_DEVTMPFS_MOUNT=y ··· 341 341 CONFIG_IPVLAN=m 342 342 CONFIG_VXLAN=m 343 343 CONFIG_GENEVE=m 344 + CONFIG_MACSEC=m 344 345 CONFIG_NETCONSOLE=m 345 346 CONFIG_NETCONSOLE_DYNAMIC=y 346 347 CONFIG_VETH=m ··· 414 413 CONFIG_XFS_FS=m 415 414 CONFIG_OCFS2_FS=m 416 415 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 416 + CONFIG_FS_ENCRYPTION=m 417 417 CONFIG_FANOTIFY=y 418 418 CONFIG_QUOTA_NETLINK_INTERFACE=y 419 419 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 431 429 CONFIG_PROC_KCORE=y 432 430 CONFIG_PROC_CHILDREN=y 433 431 CONFIG_TMPFS=y 432 + CONFIG_ORANGEFS_FS=m 434 433 CONFIG_AFFS_FS=m 435 434 CONFIG_ECRYPT_FS=m 436 435 CONFIG_ECRYPT_FS_MESSAGING=y ··· 513 510 CONFIG_TEST_STRING_HELPERS=m 514 511 CONFIG_TEST_KSTRTOX=m 515 512 CONFIG_TEST_PRINTF=m 513 + CONFIG_TEST_BITMAP=m 516 514 CONFIG_TEST_RHASHTABLE=m 517 515 CONFIG_TEST_LKM=m 518 516 CONFIG_TEST_USER_COPY=m ··· 522 518 CONFIG_TEST_UDELAY=m 523 519 CONFIG_TEST_STATIC_KEYS=m 524 520 CONFIG_EARLY_PRINTK=y 525 - CONFIG_ENCRYPTED_KEYS=m 526 521 CONFIG_CRYPTO_RSA=m 527 522 CONFIG_CRYPTO_MANAGER=y 528 523 CONFIG_CRYPTO_USER=m ··· 529 526 CONFIG_CRYPTO_MCRYPTD=m 530 527 CONFIG_CRYPTO_TEST=m 531 528 CONFIG_CRYPTO_CCM=m 532 - CONFIG_CRYPTO_GCM=m 533 529 CONFIG_CRYPTO_CHACHA20POLY1305=m 534 - CONFIG_CRYPTO_CTS=m 535 530 CONFIG_CRYPTO_LRW=m 536 531 CONFIG_CRYPTO_PCBC=m 537 - CONFIG_CRYPTO_XTS=m 538 532 CONFIG_CRYPTO_KEYWRAP=m 539 533 CONFIG_CRYPTO_XCBC=m 540 534 CONFIG_CRYPTO_VMAC=m ··· 555 555 CONFIG_CRYPTO_SERPENT=m 556 556 CONFIG_CRYPTO_TEA=m 557 557 CONFIG_CRYPTO_TWOFISH=m 558 - CONFIG_CRYPTO_ZLIB=m 559 558 CONFIG_CRYPTO_LZO=m 560 559 CONFIG_CRYPTO_842=m 561 560 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/mac_defconfig
··· 1 1 CONFIG_LOCALVERSION="-mac" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 60 61 CONFIG_INET_XFRM_MODE_TRANSPORT=m 61 62 CONFIG_INET_XFRM_MODE_TUNNEL=m 62 63 CONFIG_INET_XFRM_MODE_BEET=m 63 - # CONFIG_INET_LRO is not set 64 64 CONFIG_INET_DIAG=m 65 65 CONFIG_INET_UDP_DIAG=m 66 66 CONFIG_IPV6=m ··· 283 285 CONFIG_MPLS_ROUTING=m 284 286 CONFIG_MPLS_IPTUNNEL=m 285 287 CONFIG_NET_L3_MASTER_DEV=y 288 + CONFIG_AF_KCM=m 286 289 # CONFIG_WIRELESS is not set 290 + CONFIG_NET_DEVLINK=m 287 291 # CONFIG_UEVENT_HELPER is not set 288 292 CONFIG_DEVTMPFS=y 289 293 CONFIG_DEVTMPFS_MOUNT=y ··· 357 357 CONFIG_IPVLAN=m 358 358 CONFIG_VXLAN=m 359 359 CONFIG_GENEVE=m 360 + CONFIG_MACSEC=m 360 361 CONFIG_NETCONSOLE=m 361 362 CONFIG_NETCONSOLE_DYNAMIC=y 362 363 CONFIG_VETH=m ··· 436 435 CONFIG_XFS_FS=m 437 436 CONFIG_OCFS2_FS=m 438 437 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 438 + CONFIG_FS_ENCRYPTION=m 439 439 CONFIG_FANOTIFY=y 440 440 CONFIG_QUOTA_NETLINK_INTERFACE=y 441 441 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 453 451 CONFIG_PROC_KCORE=y 454 452 CONFIG_PROC_CHILDREN=y 455 453 CONFIG_TMPFS=y 454 + CONFIG_ORANGEFS_FS=m 456 455 CONFIG_AFFS_FS=m 457 456 CONFIG_ECRYPT_FS=m 458 457 CONFIG_ECRYPT_FS_MESSAGING=y ··· 535 532 CONFIG_TEST_STRING_HELPERS=m 536 533 CONFIG_TEST_KSTRTOX=m 537 534 CONFIG_TEST_PRINTF=m 535 + CONFIG_TEST_BITMAP=m 538 536 CONFIG_TEST_RHASHTABLE=m 539 537 CONFIG_TEST_LKM=m 540 538 CONFIG_TEST_USER_COPY=m ··· 544 540 CONFIG_TEST_UDELAY=m 545 541 CONFIG_TEST_STATIC_KEYS=m 546 542 CONFIG_EARLY_PRINTK=y 547 - CONFIG_ENCRYPTED_KEYS=m 548 543 CONFIG_CRYPTO_RSA=m 549 544 CONFIG_CRYPTO_MANAGER=y 550 545 CONFIG_CRYPTO_USER=m ··· 551 548 CONFIG_CRYPTO_MCRYPTD=m 552 549 CONFIG_CRYPTO_TEST=m 553 550 CONFIG_CRYPTO_CCM=m 554 - CONFIG_CRYPTO_GCM=m 555 551 CONFIG_CRYPTO_CHACHA20POLY1305=m 556 - CONFIG_CRYPTO_CTS=m 557 552 CONFIG_CRYPTO_LRW=m 558 553 CONFIG_CRYPTO_PCBC=m 559 - CONFIG_CRYPTO_XTS=m 560 554 CONFIG_CRYPTO_KEYWRAP=m 561 555 CONFIG_CRYPTO_XCBC=m 562 556 CONFIG_CRYPTO_VMAC=m ··· 577 577 CONFIG_CRYPTO_SERPENT=m 578 578 CONFIG_CRYPTO_TEA=m 579 579 CONFIG_CRYPTO_TWOFISH=m 580 - CONFIG_CRYPTO_ZLIB=m 581 580 CONFIG_CRYPTO_LZO=m 582 581 CONFIG_CRYPTO_842=m 583 582 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/multi_defconfig
··· 1 1 CONFIG_LOCALVERSION="-multi" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 70 71 CONFIG_INET_XFRM_MODE_TRANSPORT=m 71 72 CONFIG_INET_XFRM_MODE_TUNNEL=m 72 73 CONFIG_INET_XFRM_MODE_BEET=m 73 - # CONFIG_INET_LRO is not set 74 74 CONFIG_INET_DIAG=m 75 75 CONFIG_INET_UDP_DIAG=m 76 76 CONFIG_IPV6=m ··· 293 295 CONFIG_MPLS_ROUTING=m 294 296 CONFIG_MPLS_IPTUNNEL=m 295 297 CONFIG_NET_L3_MASTER_DEV=y 298 + CONFIG_AF_KCM=m 296 299 # CONFIG_WIRELESS is not set 300 + CONFIG_NET_DEVLINK=m 297 301 # CONFIG_UEVENT_HELPER is not set 298 302 CONFIG_DEVTMPFS=y 299 303 CONFIG_DEVTMPFS_MOUNT=y ··· 390 390 CONFIG_IPVLAN=m 391 391 CONFIG_VXLAN=m 392 392 CONFIG_GENEVE=m 393 + CONFIG_MACSEC=m 393 394 CONFIG_NETCONSOLE=m 394 395 CONFIG_NETCONSOLE_DYNAMIC=y 395 396 CONFIG_VETH=m ··· 516 515 CONFIG_XFS_FS=m 517 516 CONFIG_OCFS2_FS=m 518 517 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 518 + CONFIG_FS_ENCRYPTION=m 519 519 CONFIG_FANOTIFY=y 520 520 CONFIG_QUOTA_NETLINK_INTERFACE=y 521 521 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 533 531 CONFIG_PROC_KCORE=y 534 532 CONFIG_PROC_CHILDREN=y 535 533 CONFIG_TMPFS=y 534 + CONFIG_ORANGEFS_FS=m 536 535 CONFIG_AFFS_FS=m 537 536 CONFIG_ECRYPT_FS=m 538 537 CONFIG_ECRYPT_FS_MESSAGING=y ··· 615 612 CONFIG_TEST_STRING_HELPERS=m 616 613 CONFIG_TEST_KSTRTOX=m 617 614 CONFIG_TEST_PRINTF=m 615 + CONFIG_TEST_BITMAP=m 618 616 CONFIG_TEST_RHASHTABLE=m 619 617 CONFIG_TEST_LKM=m 620 618 CONFIG_TEST_USER_COPY=m ··· 624 620 CONFIG_TEST_UDELAY=m 625 621 CONFIG_TEST_STATIC_KEYS=m 626 622 CONFIG_EARLY_PRINTK=y 627 - CONFIG_ENCRYPTED_KEYS=m 628 623 CONFIG_CRYPTO_RSA=m 629 624 CONFIG_CRYPTO_MANAGER=y 630 625 CONFIG_CRYPTO_USER=m ··· 631 628 CONFIG_CRYPTO_MCRYPTD=m 632 629 CONFIG_CRYPTO_TEST=m 633 630 CONFIG_CRYPTO_CCM=m 634 - CONFIG_CRYPTO_GCM=m 635 631 CONFIG_CRYPTO_CHACHA20POLY1305=m 636 - CONFIG_CRYPTO_CTS=m 637 632 CONFIG_CRYPTO_LRW=m 638 633 CONFIG_CRYPTO_PCBC=m 639 - CONFIG_CRYPTO_XTS=m 640 634 CONFIG_CRYPTO_KEYWRAP=m 641 635 CONFIG_CRYPTO_XCBC=m 642 636 CONFIG_CRYPTO_VMAC=m ··· 657 657 CONFIG_CRYPTO_SERPENT=m 658 658 CONFIG_CRYPTO_TEA=m 659 659 CONFIG_CRYPTO_TWOFISH=m 660 - CONFIG_CRYPTO_ZLIB=m 661 660 CONFIG_CRYPTO_LZO=m 662 661 CONFIG_CRYPTO_842=m 663 662 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/mvme147_defconfig
··· 1 1 CONFIG_LOCALVERSION="-mvme147" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 58 59 CONFIG_INET_XFRM_MODE_TRANSPORT=m 59 60 CONFIG_INET_XFRM_MODE_TUNNEL=m 60 61 CONFIG_INET_XFRM_MODE_BEET=m 61 - # CONFIG_INET_LRO is not set 62 62 CONFIG_INET_DIAG=m 63 63 CONFIG_INET_UDP_DIAG=m 64 64 CONFIG_IPV6=m ··· 278 280 CONFIG_MPLS_ROUTING=m 279 281 CONFIG_MPLS_IPTUNNEL=m 280 282 CONFIG_NET_L3_MASTER_DEV=y 283 + CONFIG_AF_KCM=m 281 284 # CONFIG_WIRELESS is not set 285 + CONFIG_NET_DEVLINK=m 282 286 # CONFIG_UEVENT_HELPER is not set 283 287 CONFIG_DEVTMPFS=y 284 288 CONFIG_DEVTMPFS_MOUNT=y ··· 339 339 CONFIG_IPVLAN=m 340 340 CONFIG_VXLAN=m 341 341 CONFIG_GENEVE=m 342 + CONFIG_MACSEC=m 342 343 CONFIG_NETCONSOLE=m 343 344 CONFIG_NETCONSOLE_DYNAMIC=y 344 345 CONFIG_VETH=m ··· 404 403 CONFIG_XFS_FS=m 405 404 CONFIG_OCFS2_FS=m 406 405 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 406 + CONFIG_FS_ENCRYPTION=m 407 407 CONFIG_FANOTIFY=y 408 408 CONFIG_QUOTA_NETLINK_INTERFACE=y 409 409 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 421 419 CONFIG_PROC_KCORE=y 422 420 CONFIG_PROC_CHILDREN=y 423 421 CONFIG_TMPFS=y 422 + CONFIG_ORANGEFS_FS=m 424 423 CONFIG_AFFS_FS=m 425 424 CONFIG_ECRYPT_FS=m 426 425 CONFIG_ECRYPT_FS_MESSAGING=y ··· 503 500 CONFIG_TEST_STRING_HELPERS=m 504 501 CONFIG_TEST_KSTRTOX=m 505 502 CONFIG_TEST_PRINTF=m 503 + CONFIG_TEST_BITMAP=m 506 504 CONFIG_TEST_RHASHTABLE=m 507 505 CONFIG_TEST_LKM=m 508 506 CONFIG_TEST_USER_COPY=m ··· 512 508 CONFIG_TEST_UDELAY=m 513 509 CONFIG_TEST_STATIC_KEYS=m 514 510 CONFIG_EARLY_PRINTK=y 515 - CONFIG_ENCRYPTED_KEYS=m 516 511 CONFIG_CRYPTO_RSA=m 517 512 CONFIG_CRYPTO_MANAGER=y 518 513 CONFIG_CRYPTO_USER=m ··· 519 516 CONFIG_CRYPTO_MCRYPTD=m 520 517 CONFIG_CRYPTO_TEST=m 521 518 CONFIG_CRYPTO_CCM=m 522 - CONFIG_CRYPTO_GCM=m 523 519 CONFIG_CRYPTO_CHACHA20POLY1305=m 524 - CONFIG_CRYPTO_CTS=m 525 520 CONFIG_CRYPTO_LRW=m 526 521 CONFIG_CRYPTO_PCBC=m 527 - CONFIG_CRYPTO_XTS=m 528 522 CONFIG_CRYPTO_KEYWRAP=m 529 523 CONFIG_CRYPTO_XCBC=m 530 524 CONFIG_CRYPTO_VMAC=m ··· 545 545 CONFIG_CRYPTO_SERPENT=m 546 546 CONFIG_CRYPTO_TEA=m 547 547 CONFIG_CRYPTO_TWOFISH=m 548 - CONFIG_CRYPTO_ZLIB=m 549 548 CONFIG_CRYPTO_LZO=m 550 549 CONFIG_CRYPTO_842=m 551 550 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/mvme16x_defconfig
··· 1 1 CONFIG_LOCALVERSION="-mvme16x" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 59 60 CONFIG_INET_XFRM_MODE_TRANSPORT=m 60 61 CONFIG_INET_XFRM_MODE_TUNNEL=m 61 62 CONFIG_INET_XFRM_MODE_BEET=m 62 - # CONFIG_INET_LRO is not set 63 63 CONFIG_INET_DIAG=m 64 64 CONFIG_INET_UDP_DIAG=m 65 65 CONFIG_IPV6=m ··· 279 281 CONFIG_MPLS_ROUTING=m 280 282 CONFIG_MPLS_IPTUNNEL=m 281 283 CONFIG_NET_L3_MASTER_DEV=y 284 + CONFIG_AF_KCM=m 282 285 # CONFIG_WIRELESS is not set 286 + CONFIG_NET_DEVLINK=m 283 287 # CONFIG_UEVENT_HELPER is not set 284 288 CONFIG_DEVTMPFS=y 285 289 CONFIG_DEVTMPFS_MOUNT=y ··· 340 340 CONFIG_IPVLAN=m 341 341 CONFIG_VXLAN=m 342 342 CONFIG_GENEVE=m 343 + CONFIG_MACSEC=m 343 344 CONFIG_NETCONSOLE=m 344 345 CONFIG_NETCONSOLE_DYNAMIC=y 345 346 CONFIG_VETH=m ··· 404 403 CONFIG_XFS_FS=m 405 404 CONFIG_OCFS2_FS=m 406 405 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 406 + CONFIG_FS_ENCRYPTION=m 407 407 CONFIG_FANOTIFY=y 408 408 CONFIG_QUOTA_NETLINK_INTERFACE=y 409 409 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 421 419 CONFIG_PROC_KCORE=y 422 420 CONFIG_PROC_CHILDREN=y 423 421 CONFIG_TMPFS=y 422 + CONFIG_ORANGEFS_FS=m 424 423 CONFIG_AFFS_FS=m 425 424 CONFIG_ECRYPT_FS=m 426 425 CONFIG_ECRYPT_FS_MESSAGING=y ··· 503 500 CONFIG_TEST_STRING_HELPERS=m 504 501 CONFIG_TEST_KSTRTOX=m 505 502 CONFIG_TEST_PRINTF=m 503 + CONFIG_TEST_BITMAP=m 506 504 CONFIG_TEST_RHASHTABLE=m 507 505 CONFIG_TEST_LKM=m 508 506 CONFIG_TEST_USER_COPY=m ··· 512 508 CONFIG_TEST_UDELAY=m 513 509 CONFIG_TEST_STATIC_KEYS=m 514 510 CONFIG_EARLY_PRINTK=y 515 - CONFIG_ENCRYPTED_KEYS=m 516 511 CONFIG_CRYPTO_RSA=m 517 512 CONFIG_CRYPTO_MANAGER=y 518 513 CONFIG_CRYPTO_USER=m ··· 519 516 CONFIG_CRYPTO_MCRYPTD=m 520 517 CONFIG_CRYPTO_TEST=m 521 518 CONFIG_CRYPTO_CCM=m 522 - CONFIG_CRYPTO_GCM=m 523 519 CONFIG_CRYPTO_CHACHA20POLY1305=m 524 - CONFIG_CRYPTO_CTS=m 525 520 CONFIG_CRYPTO_LRW=m 526 521 CONFIG_CRYPTO_PCBC=m 527 - CONFIG_CRYPTO_XTS=m 528 522 CONFIG_CRYPTO_KEYWRAP=m 529 523 CONFIG_CRYPTO_XCBC=m 530 524 CONFIG_CRYPTO_VMAC=m ··· 545 545 CONFIG_CRYPTO_SERPENT=m 546 546 CONFIG_CRYPTO_TEA=m 547 547 CONFIG_CRYPTO_TWOFISH=m 548 - CONFIG_CRYPTO_ZLIB=m 549 548 CONFIG_CRYPTO_LZO=m 550 549 CONFIG_CRYPTO_842=m 551 550 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/q40_defconfig
··· 1 1 CONFIG_LOCALVERSION="-q40" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 59 60 CONFIG_INET_XFRM_MODE_TRANSPORT=m 60 61 CONFIG_INET_XFRM_MODE_TUNNEL=m 61 62 CONFIG_INET_XFRM_MODE_BEET=m 62 - # CONFIG_INET_LRO is not set 63 63 CONFIG_INET_DIAG=m 64 64 CONFIG_INET_UDP_DIAG=m 65 65 CONFIG_IPV6=m ··· 279 281 CONFIG_MPLS_ROUTING=m 280 282 CONFIG_MPLS_IPTUNNEL=m 281 283 CONFIG_NET_L3_MASTER_DEV=y 284 + CONFIG_AF_KCM=m 282 285 # CONFIG_WIRELESS is not set 286 + CONFIG_NET_DEVLINK=m 283 287 # CONFIG_UEVENT_HELPER is not set 284 288 CONFIG_DEVTMPFS=y 285 289 CONFIG_DEVTMPFS_MOUNT=y ··· 346 346 CONFIG_IPVLAN=m 347 347 CONFIG_VXLAN=m 348 348 CONFIG_GENEVE=m 349 + CONFIG_MACSEC=m 349 350 CONFIG_NETCONSOLE=m 350 351 CONFIG_NETCONSOLE_DYNAMIC=y 351 352 CONFIG_VETH=m ··· 427 426 CONFIG_XFS_FS=m 428 427 CONFIG_OCFS2_FS=m 429 428 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 429 + CONFIG_FS_ENCRYPTION=m 430 430 CONFIG_FANOTIFY=y 431 431 CONFIG_QUOTA_NETLINK_INTERFACE=y 432 432 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 444 442 CONFIG_PROC_KCORE=y 445 443 CONFIG_PROC_CHILDREN=y 446 444 CONFIG_TMPFS=y 445 + CONFIG_ORANGEFS_FS=m 447 446 CONFIG_AFFS_FS=m 448 447 CONFIG_ECRYPT_FS=m 449 448 CONFIG_ECRYPT_FS_MESSAGING=y ··· 526 523 CONFIG_TEST_STRING_HELPERS=m 527 524 CONFIG_TEST_KSTRTOX=m 528 525 CONFIG_TEST_PRINTF=m 526 + CONFIG_TEST_BITMAP=m 529 527 CONFIG_TEST_RHASHTABLE=m 530 528 CONFIG_TEST_LKM=m 531 529 CONFIG_TEST_USER_COPY=m ··· 535 531 CONFIG_TEST_UDELAY=m 536 532 CONFIG_TEST_STATIC_KEYS=m 537 533 CONFIG_EARLY_PRINTK=y 538 - CONFIG_ENCRYPTED_KEYS=m 539 534 CONFIG_CRYPTO_RSA=m 540 535 CONFIG_CRYPTO_MANAGER=y 541 536 CONFIG_CRYPTO_USER=m ··· 542 539 CONFIG_CRYPTO_MCRYPTD=m 543 540 CONFIG_CRYPTO_TEST=m 544 541 CONFIG_CRYPTO_CCM=m 545 - CONFIG_CRYPTO_GCM=m 546 542 CONFIG_CRYPTO_CHACHA20POLY1305=m 547 - CONFIG_CRYPTO_CTS=m 548 543 CONFIG_CRYPTO_LRW=m 549 544 CONFIG_CRYPTO_PCBC=m 550 - CONFIG_CRYPTO_XTS=m 551 545 CONFIG_CRYPTO_KEYWRAP=m 552 546 CONFIG_CRYPTO_XCBC=m 553 547 CONFIG_CRYPTO_VMAC=m ··· 568 568 CONFIG_CRYPTO_SERPENT=m 569 569 CONFIG_CRYPTO_TEA=m 570 570 CONFIG_CRYPTO_TWOFISH=m 571 - CONFIG_CRYPTO_ZLIB=m 572 571 CONFIG_CRYPTO_LZO=m 573 572 CONFIG_CRYPTO_842=m 574 573 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/sun3_defconfig
··· 1 1 CONFIG_LOCALVERSION="-sun3" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 56 57 CONFIG_INET_XFRM_MODE_TRANSPORT=m 57 58 CONFIG_INET_XFRM_MODE_TUNNEL=m 58 59 CONFIG_INET_XFRM_MODE_BEET=m 59 - # CONFIG_INET_LRO is not set 60 60 CONFIG_INET_DIAG=m 61 61 CONFIG_INET_UDP_DIAG=m 62 62 CONFIG_IPV6=m ··· 276 278 CONFIG_MPLS_ROUTING=m 277 279 CONFIG_MPLS_IPTUNNEL=m 278 280 CONFIG_NET_L3_MASTER_DEV=y 281 + CONFIG_AF_KCM=m 279 282 # CONFIG_WIRELESS is not set 283 + CONFIG_NET_DEVLINK=m 280 284 # CONFIG_UEVENT_HELPER is not set 281 285 CONFIG_DEVTMPFS=y 282 286 CONFIG_DEVTMPFS_MOUNT=y ··· 337 337 CONFIG_IPVLAN=m 338 338 CONFIG_VXLAN=m 339 339 CONFIG_GENEVE=m 340 + CONFIG_MACSEC=m 340 341 CONFIG_NETCONSOLE=m 341 342 CONFIG_NETCONSOLE_DYNAMIC=y 342 343 CONFIG_VETH=m ··· 406 405 CONFIG_XFS_FS=m 407 406 CONFIG_OCFS2_FS=m 408 407 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 408 + CONFIG_FS_ENCRYPTION=m 409 409 CONFIG_FANOTIFY=y 410 410 CONFIG_QUOTA_NETLINK_INTERFACE=y 411 411 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 423 421 CONFIG_PROC_KCORE=y 424 422 CONFIG_PROC_CHILDREN=y 425 423 CONFIG_TMPFS=y 424 + CONFIG_ORANGEFS_FS=m 426 425 CONFIG_AFFS_FS=m 427 426 CONFIG_ECRYPT_FS=m 428 427 CONFIG_ECRYPT_FS_MESSAGING=y ··· 505 502 CONFIG_TEST_STRING_HELPERS=m 506 503 CONFIG_TEST_KSTRTOX=m 507 504 CONFIG_TEST_PRINTF=m 505 + CONFIG_TEST_BITMAP=m 508 506 CONFIG_TEST_RHASHTABLE=m 509 507 CONFIG_TEST_LKM=m 510 508 CONFIG_TEST_USER_COPY=m ··· 513 509 CONFIG_TEST_FIRMWARE=m 514 510 CONFIG_TEST_UDELAY=m 515 511 CONFIG_TEST_STATIC_KEYS=m 516 - CONFIG_ENCRYPTED_KEYS=m 517 512 CONFIG_CRYPTO_RSA=m 518 513 CONFIG_CRYPTO_MANAGER=y 519 514 CONFIG_CRYPTO_USER=m ··· 520 517 CONFIG_CRYPTO_MCRYPTD=m 521 518 CONFIG_CRYPTO_TEST=m 522 519 CONFIG_CRYPTO_CCM=m 523 - CONFIG_CRYPTO_GCM=m 524 520 CONFIG_CRYPTO_CHACHA20POLY1305=m 525 - CONFIG_CRYPTO_CTS=m 526 521 CONFIG_CRYPTO_LRW=m 527 522 CONFIG_CRYPTO_PCBC=m 528 - CONFIG_CRYPTO_XTS=m 529 523 CONFIG_CRYPTO_KEYWRAP=m 530 524 CONFIG_CRYPTO_XCBC=m 531 525 CONFIG_CRYPTO_VMAC=m ··· 546 546 CONFIG_CRYPTO_SERPENT=m 547 547 CONFIG_CRYPTO_TEA=m 548 548 CONFIG_CRYPTO_TWOFISH=m 549 - CONFIG_CRYPTO_ZLIB=m 550 549 CONFIG_CRYPTO_LZO=m 551 550 CONFIG_CRYPTO_842=m 552 551 CONFIG_CRYPTO_LZ4=m
+6 -7
arch/m68k/configs/sun3x_defconfig
··· 1 1 CONFIG_LOCALVERSION="-sun3x" 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_BSD_PROCESS_ACCT=y 6 5 CONFIG_BSD_PROCESS_ACCT_V3=y 7 6 CONFIG_LOG_BUF_SHIFT=16 ··· 56 57 CONFIG_INET_XFRM_MODE_TRANSPORT=m 57 58 CONFIG_INET_XFRM_MODE_TUNNEL=m 58 59 CONFIG_INET_XFRM_MODE_BEET=m 59 - # CONFIG_INET_LRO is not set 60 60 CONFIG_INET_DIAG=m 61 61 CONFIG_INET_UDP_DIAG=m 62 62 CONFIG_IPV6=m ··· 276 278 CONFIG_MPLS_ROUTING=m 277 279 CONFIG_MPLS_IPTUNNEL=m 278 280 CONFIG_NET_L3_MASTER_DEV=y 281 + CONFIG_AF_KCM=m 279 282 # CONFIG_WIRELESS is not set 283 + CONFIG_NET_DEVLINK=m 280 284 # CONFIG_UEVENT_HELPER is not set 281 285 CONFIG_DEVTMPFS=y 282 286 CONFIG_DEVTMPFS_MOUNT=y ··· 337 337 CONFIG_IPVLAN=m 338 338 CONFIG_VXLAN=m 339 339 CONFIG_GENEVE=m 340 + CONFIG_MACSEC=m 340 341 CONFIG_NETCONSOLE=m 341 342 CONFIG_NETCONSOLE_DYNAMIC=y 342 343 CONFIG_VETH=m ··· 406 405 CONFIG_XFS_FS=m 407 406 CONFIG_OCFS2_FS=m 408 407 # CONFIG_OCFS2_DEBUG_MASKLOG is not set 408 + CONFIG_FS_ENCRYPTION=m 409 409 CONFIG_FANOTIFY=y 410 410 CONFIG_QUOTA_NETLINK_INTERFACE=y 411 411 # CONFIG_PRINT_QUOTA_WARNING is not set ··· 423 421 CONFIG_PROC_KCORE=y 424 422 CONFIG_PROC_CHILDREN=y 425 423 CONFIG_TMPFS=y 424 + CONFIG_ORANGEFS_FS=m 426 425 CONFIG_AFFS_FS=m 427 426 CONFIG_ECRYPT_FS=m 428 427 CONFIG_ECRYPT_FS_MESSAGING=y ··· 505 502 CONFIG_TEST_STRING_HELPERS=m 506 503 CONFIG_TEST_KSTRTOX=m 507 504 CONFIG_TEST_PRINTF=m 505 + CONFIG_TEST_BITMAP=m 508 506 CONFIG_TEST_RHASHTABLE=m 509 507 CONFIG_TEST_LKM=m 510 508 CONFIG_TEST_USER_COPY=m ··· 514 510 CONFIG_TEST_UDELAY=m 515 511 CONFIG_TEST_STATIC_KEYS=m 516 512 CONFIG_EARLY_PRINTK=y 517 - CONFIG_ENCRYPTED_KEYS=m 518 513 CONFIG_CRYPTO_RSA=m 519 514 CONFIG_CRYPTO_MANAGER=y 520 515 CONFIG_CRYPTO_USER=m ··· 521 518 CONFIG_CRYPTO_MCRYPTD=m 522 519 CONFIG_CRYPTO_TEST=m 523 520 CONFIG_CRYPTO_CCM=m 524 - CONFIG_CRYPTO_GCM=m 525 521 CONFIG_CRYPTO_CHACHA20POLY1305=m 526 - CONFIG_CRYPTO_CTS=m 527 522 CONFIG_CRYPTO_LRW=m 528 523 CONFIG_CRYPTO_PCBC=m 529 - CONFIG_CRYPTO_XTS=m 530 524 CONFIG_CRYPTO_KEYWRAP=m 531 525 CONFIG_CRYPTO_XCBC=m 532 526 CONFIG_CRYPTO_VMAC=m ··· 547 547 CONFIG_CRYPTO_SERPENT=m 548 548 CONFIG_CRYPTO_TEA=m 549 549 CONFIG_CRYPTO_TWOFISH=m 550 - CONFIG_CRYPTO_ZLIB=m 551 550 CONFIG_CRYPTO_LZO=m 552 551 CONFIG_CRYPTO_842=m 553 552 CONFIG_CRYPTO_LZ4=m
+1 -1
arch/m68k/include/asm/unistd.h
··· 4 4 #include <uapi/asm/unistd.h> 5 5 6 6 7 - #define NR_syscalls 377 7 + #define NR_syscalls 379 8 8 9 9 #define __ARCH_WANT_OLD_READDIR 10 10 #define __ARCH_WANT_OLD_STAT
+2
arch/m68k/include/uapi/asm/unistd.h
··· 382 382 #define __NR_membarrier 374 383 383 #define __NR_mlock2 375 384 384 #define __NR_copy_file_range 376 385 + #define __NR_preadv2 377 386 + #define __NR_pwritev2 378 385 387 386 388 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
+2
arch/m68k/kernel/syscalltable.S
··· 397 397 .long sys_membarrier 398 398 .long sys_mlock2 /* 375 */ 399 399 .long sys_copy_file_range 400 + .long sys_preadv2 401 + .long sys_pwritev2
+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
+5 -6
arch/parisc/include/asm/uaccess.h
··· 44 44 #define LDD_USER(ptr) BUILD_BUG() 45 45 #define STD_KERNEL(x, ptr) __put_kernel_asm64(x, ptr) 46 46 #define STD_USER(x, ptr) __put_user_asm64(x, ptr) 47 - #define ASM_WORD_INSN ".word\t" 48 47 #else 49 48 #define LDD_KERNEL(ptr) __get_kernel_asm("ldd", ptr) 50 49 #define LDD_USER(ptr) __get_user_asm("ldd", ptr) 51 50 #define STD_KERNEL(x, ptr) __put_kernel_asm("std", x, ptr) 52 51 #define STD_USER(x, ptr) __put_user_asm("std", x, ptr) 53 - #define ASM_WORD_INSN ".dword\t" 54 52 #endif 55 53 56 54 /* 57 - * The exception table contains two values: the first is an address 58 - * for an instruction that is allowed to fault, and the second is 59 - * the address to the fixup routine. Even on a 64bit kernel we could 60 - * use a 32bit (unsigned int) address here. 55 + * The exception table contains two values: the first is the relative offset to 56 + * the address of the instruction that is allowed to fault, and the second is 57 + * the relative offset to the address of the fixup routine. Since relative 58 + * addresses are used, 32bit values are sufficient even on 64bit kernel. 61 59 */ 62 60 63 61 #define ARCH_HAS_RELATIVE_EXTABLE ··· 75 77 */ 76 78 struct exception_data { 77 79 unsigned long fault_ip; 80 + unsigned long fault_gp; 78 81 unsigned long fault_space; 79 82 unsigned long fault_addr; 80 83 };
-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
+1
arch/parisc/kernel/asm-offsets.c
··· 299 299 #endif 300 300 BLANK(); 301 301 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); 302 + DEFINE(EXCDATA_GP, offsetof(struct exception_data, fault_gp)); 302 303 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); 303 304 DEFINE(EXCDATA_ADDR, offsetof(struct exception_data, fault_addr)); 304 305 BLANK();
+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
+8
arch/parisc/kernel/module.c
··· 660 660 } 661 661 *loc = (*loc & ~0x3ff1ffd) | reassemble_22(val); 662 662 break; 663 + case R_PARISC_PCREL32: 664 + /* 32-bit PC relative address */ 665 + *loc = val - dot - 8 + addend; 666 + break; 663 667 664 668 default: 665 669 printk(KERN_ERR "module %s: Unknown relocation: %u\n", ··· 791 787 val = (val - dot - 8)/4; 792 788 CHECK_RELOC(val, 22); 793 789 *loc = (*loc & ~0x3ff1ffd) | reassemble_22(val); 790 + break; 791 + case R_PARISC_PCREL32: 792 + /* 32-bit PC relative address */ 793 + *loc = val - dot - 8 + addend; 794 794 break; 795 795 case R_PARISC_DIR64: 796 796 /* 64-bit effective address */
+5 -5
arch/parisc/kernel/parisc_ksyms.c
··· 47 47 EXPORT_SYMBOL(lclear_user); 48 48 EXPORT_SYMBOL(lstrnlen_user); 49 49 50 - /* Global fixups */ 51 - extern void fixup_get_user_skip_1(void); 52 - extern void fixup_get_user_skip_2(void); 53 - extern void fixup_put_user_skip_1(void); 54 - extern void fixup_put_user_skip_2(void); 50 + /* Global fixups - defined as int to avoid creation of function pointers */ 51 + extern int fixup_get_user_skip_1; 52 + extern int fixup_get_user_skip_2; 53 + extern int fixup_put_user_skip_1; 54 + extern int fixup_put_user_skip_2; 55 55 EXPORT_SYMBOL(fixup_get_user_skip_1); 56 56 EXPORT_SYMBOL(fixup_get_user_skip_2); 57 57 EXPORT_SYMBOL(fixup_put_user_skip_1);
+3
arch/parisc/kernel/traps.c
··· 795 795 796 796 if (fault_space == 0 && !faulthandler_disabled()) 797 797 { 798 + /* Clean up and return if in exception table. */ 799 + if (fixup_exception(regs)) 800 + return; 798 801 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); 799 802 parisc_terminate("Kernel Fault", regs, code, fault_address); 800 803 }
+6
arch/parisc/lib/fixup.S
··· 26 26 27 27 #ifdef CONFIG_SMP 28 28 .macro get_fault_ip t1 t2 29 + loadgp 29 30 addil LT%__per_cpu_offset,%r27 30 31 LDREG RT%__per_cpu_offset(%r1),\t1 31 32 /* t2 = smp_processor_id() */ ··· 41 40 LDREG RT%exception_data(%r1),\t1 42 41 /* t1 = this_cpu_ptr(&exception_data) */ 43 42 add,l \t1,\t2,\t1 43 + /* %r27 = t1->fault_gp - restore gp */ 44 + LDREG EXCDATA_GP(\t1), %r27 44 45 /* t1 = t1->fault_ip */ 45 46 LDREG EXCDATA_IP(\t1), \t1 46 47 .endm 47 48 #else 48 49 .macro get_fault_ip t1 t2 50 + loadgp 49 51 /* t1 = this_cpu_ptr(&exception_data) */ 50 52 addil LT%exception_data,%r27 51 53 LDREG RT%exception_data(%r1),\t2 54 + /* %r27 = t2->fault_gp - restore gp */ 55 + LDREG EXCDATA_GP(\t2), %r27 52 56 /* t1 = t2->fault_ip */ 53 57 LDREG EXCDATA_IP(\t2), \t1 54 58 .endm
+1
arch/parisc/mm/fault.c
··· 145 145 struct exception_data *d; 146 146 d = this_cpu_ptr(&exception_data); 147 147 d->fault_ip = regs->iaoq[0]; 148 + d->fault_gp = regs->gr[27]; 148 149 d->fault_space = regs->isr; 149 150 d->fault_addr = regs->ior; 150 151
+3
arch/s390/Kconfig
··· 4 4 config ZONE_DMA 5 5 def_bool y 6 6 7 + config CPU_BIG_ENDIAN 8 + def_bool y 9 + 7 10 config LOCKDEP_SUPPORT 8 11 def_bool y 9 12
+2 -1
arch/s390/include/asm/pci.h
··· 44 44 u64 rpcit_ops; 45 45 u64 dma_rbytes; 46 46 u64 dma_wbytes; 47 - } __packed __aligned(64); 47 + u64 pad[2]; 48 + } __packed __aligned(128); 48 49 49 50 enum zpci_state { 50 51 ZPCI_FN_STATE_RESERVED,
+2
arch/s390/include/asm/seccomp.h
··· 13 13 #define __NR_seccomp_exit_32 __NR_exit 14 14 #define __NR_seccomp_sigreturn_32 __NR_sigreturn 15 15 16 + #include <asm-generic/seccomp.h> 17 + 16 18 #endif /* _ASM_S390_SECCOMP_H */
+1
arch/s390/lib/spinlock.c
··· 105 105 if (_raw_compare_and_swap(&lp->lock, 0, cpu)) 106 106 return; 107 107 local_irq_restore(flags); 108 + continue; 108 109 } 109 110 /* Check if the lock owner is running. */ 110 111 if (first_diag && cpu_is_preempted(~owner)) {
-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/crypto/sha-mb/sha1_mb.c
··· 453 453 454 454 req = cast_mcryptd_ctx_to_req(req_ctx); 455 455 if (irqs_disabled()) 456 - rctx->complete(&req->base, ret); 456 + req_ctx->complete(&req->base, ret); 457 457 else { 458 458 local_bh_disable(); 459 - rctx->complete(&req->base, ret); 459 + req_ctx->complete(&req->base, ret); 460 460 local_bh_enable(); 461 461 } 462 462 }
+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 -6
crypto/rsa-pkcs1pad.c
··· 387 387 req_ctx->child_req.src = req->src; 388 388 req_ctx->child_req.src_len = req->src_len; 389 389 req_ctx->child_req.dst = req_ctx->out_sg; 390 - req_ctx->child_req.dst_len = ctx->key_size - 1; 390 + req_ctx->child_req.dst_len = ctx->key_size ; 391 391 392 - req_ctx->out_buf = kmalloc(ctx->key_size - 1, 392 + req_ctx->out_buf = kmalloc(ctx->key_size, 393 393 (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? 394 394 GFP_KERNEL : GFP_ATOMIC); 395 395 if (!req_ctx->out_buf) 396 396 return -ENOMEM; 397 397 398 398 pkcs1pad_sg_set_buf(req_ctx->out_sg, req_ctx->out_buf, 399 - ctx->key_size - 1, NULL); 399 + ctx->key_size, NULL); 400 400 401 401 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child); 402 402 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, ··· 595 595 req_ctx->child_req.src = req->src; 596 596 req_ctx->child_req.src_len = req->src_len; 597 597 req_ctx->child_req.dst = req_ctx->out_sg; 598 - req_ctx->child_req.dst_len = ctx->key_size - 1; 598 + req_ctx->child_req.dst_len = ctx->key_size; 599 599 600 - req_ctx->out_buf = kmalloc(ctx->key_size - 1, 600 + req_ctx->out_buf = kmalloc(ctx->key_size, 601 601 (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? 602 602 GFP_KERNEL : GFP_ATOMIC); 603 603 if (!req_ctx->out_buf) 604 604 return -ENOMEM; 605 605 606 606 pkcs1pad_sg_set_buf(req_ctx->out_sg, req_ctx->out_buf, 607 - ctx->key_size - 1, NULL); 607 + ctx->key_size, NULL); 608 608 609 609 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child); 610 610 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags,
+4 -13
drivers/bcma/main.c
··· 136 136 return false; 137 137 } 138 138 139 - #if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS) 140 139 static struct device_node *bcma_of_find_child_device(struct platform_device *parent, 141 140 struct bcma_device *core) 142 141 { ··· 183 184 struct of_phandle_args out_irq; 184 185 int ret; 185 186 186 - if (!parent || !parent->dev.of_node) 187 + if (!IS_ENABLED(CONFIG_OF_IRQ) || !parent || !parent->dev.of_node) 187 188 return 0; 188 189 189 190 ret = bcma_of_irq_parse(parent, core, &out_irq, num); ··· 201 202 { 202 203 struct device_node *node; 203 204 205 + if (!IS_ENABLED(CONFIG_OF_IRQ)) 206 + return; 207 + 204 208 node = bcma_of_find_child_device(parent, core); 205 209 if (node) 206 210 core->dev.of_node = node; 207 211 208 212 core->irq = bcma_of_get_irq(parent, core, 0); 209 213 } 210 - #else 211 - static void bcma_of_fill_device(struct platform_device *parent, 212 - struct bcma_device *core) 213 - { 214 - } 215 - static inline unsigned int bcma_of_get_irq(struct platform_device *parent, 216 - struct bcma_device *core, int num) 217 - { 218 - return 0; 219 - } 220 - #endif /* CONFIG_OF */ 221 214 222 215 unsigned int bcma_core_irq(struct bcma_device *core, int num) 223 216 {
+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)
+3
drivers/cpufreq/cpufreq.c
··· 1491 1491 { 1492 1492 unsigned int new_freq; 1493 1493 1494 + if (cpufreq_suspended) 1495 + return 0; 1496 + 1494 1497 new_freq = cpufreq_driver->get(policy->cpu); 1495 1498 if (!new_freq) 1496 1499 return 0;
+4
drivers/cpufreq/intel_pstate.c
··· 1130 1130 sample_ratio = div_fp(int_tofp(pid_params.sample_rate_ns), 1131 1131 int_tofp(duration_ns)); 1132 1132 core_busy = mul_fp(core_busy, sample_ratio); 1133 + } else { 1134 + sample_ratio = div_fp(100 * cpu->sample.mperf, cpu->sample.tsc); 1135 + if (sample_ratio < int_tofp(1)) 1136 + core_busy = 0; 1133 1137 } 1134 1138 1135 1139 cpu->sample.busy_scaled = core_busy;
+3
drivers/crypto/ccp/ccp-crypto-aes-cmac.c
··· 225 225 struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); 226 226 struct ccp_aes_cmac_exp_ctx state; 227 227 228 + /* Don't let anything leak to 'out' */ 229 + memset(&state, 0, sizeof(state)); 230 + 228 231 state.null_msg = rctx->null_msg; 229 232 memcpy(state.iv, rctx->iv, sizeof(state.iv)); 230 233 state.buf_count = rctx->buf_count;
+3
drivers/crypto/ccp/ccp-crypto-sha.c
··· 212 212 struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); 213 213 struct ccp_sha_exp_ctx state; 214 214 215 + /* Don't let anything leak to 'out' */ 216 + memset(&state, 0, sizeof(state)); 217 + 215 218 state.type = rctx->type; 216 219 state.msg_bits = rctx->msg_bits; 217 220 state.first = rctx->first;
+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 }
+2 -1
drivers/gpio/gpio-pca953x.c
··· 18 18 #include <linux/i2c.h> 19 19 #include <linux/platform_data/pca953x.h> 20 20 #include <linux/slab.h> 21 + #include <asm/unaligned.h> 21 22 #include <linux/of_platform.h> 22 23 #include <linux/acpi.h> 23 24 ··· 160 159 switch (chip->chip_type) { 161 160 case PCA953X_TYPE: 162 161 ret = i2c_smbus_write_word_data(chip->client, 163 - reg << 1, (u16) *val); 162 + reg << 1, cpu_to_le16(get_unaligned((u16 *)val))); 164 163 break; 165 164 case PCA957X_TYPE: 166 165 ret = i2c_smbus_write_byte_data(chip->client, reg << 1,
+2 -2
drivers/gpio/gpio-pxa.c
··· 283 283 writel_relaxed(mask, base + (value ? GPSR_OFFSET : GPCR_OFFSET)); 284 284 285 285 ret = pinctrl_gpio_direction_output(chip->base + offset); 286 - if (!ret) 287 - return 0; 286 + if (ret) 287 + return ret; 288 288 289 289 spin_lock_irqsave(&gpio_lock, flags); 290 290
+91 -42
drivers/gpio/gpiolib.c
··· 68 68 static void gpiochip_free_hogs(struct gpio_chip *chip); 69 69 static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip); 70 70 71 + static bool gpiolib_initialized; 71 72 72 73 static inline void desc_set_label(struct gpio_desc *d, const char *label) 73 74 { ··· 441 440 cdev_del(&gdev->chrdev); 442 441 list_del(&gdev->list); 443 442 ida_simple_remove(&gpio_ida, gdev->id); 443 + kfree(gdev->label); 444 + kfree(gdev->descs); 444 445 kfree(gdev); 446 + } 447 + 448 + static int gpiochip_setup_dev(struct gpio_device *gdev) 449 + { 450 + int status; 451 + 452 + cdev_init(&gdev->chrdev, &gpio_fileops); 453 + gdev->chrdev.owner = THIS_MODULE; 454 + gdev->chrdev.kobj.parent = &gdev->dev.kobj; 455 + gdev->dev.devt = MKDEV(MAJOR(gpio_devt), gdev->id); 456 + status = cdev_add(&gdev->chrdev, gdev->dev.devt, 1); 457 + if (status < 0) 458 + chip_warn(gdev->chip, "failed to add char device %d:%d\n", 459 + MAJOR(gpio_devt), gdev->id); 460 + else 461 + chip_dbg(gdev->chip, "added GPIO chardev (%d:%d)\n", 462 + MAJOR(gpio_devt), gdev->id); 463 + status = device_add(&gdev->dev); 464 + if (status) 465 + goto err_remove_chardev; 466 + 467 + status = gpiochip_sysfs_register(gdev); 468 + if (status) 469 + goto err_remove_device; 470 + 471 + /* From this point, the .release() function cleans up gpio_device */ 472 + gdev->dev.release = gpiodevice_release; 473 + get_device(&gdev->dev); 474 + pr_debug("%s: registered GPIOs %d to %d on device: %s (%s)\n", 475 + __func__, gdev->base, gdev->base + gdev->ngpio - 1, 476 + dev_name(&gdev->dev), gdev->chip->label ? : "generic"); 477 + 478 + return 0; 479 + 480 + err_remove_device: 481 + device_del(&gdev->dev); 482 + err_remove_chardev: 483 + cdev_del(&gdev->chrdev); 484 + return status; 485 + } 486 + 487 + static void gpiochip_setup_devs(void) 488 + { 489 + struct gpio_device *gdev; 490 + int err; 491 + 492 + list_for_each_entry(gdev, &gpio_devices, list) { 493 + err = gpiochip_setup_dev(gdev); 494 + if (err) 495 + pr_err("%s: Failed to initialize gpio device (%d)\n", 496 + dev_name(&gdev->dev), err); 497 + } 445 498 } 446 499 447 500 /** ··· 511 456 * can be freely used, the chip->parent device must be registered before 512 457 * the gpio framework's arch_initcall(). Otherwise sysfs initialization 513 458 * for GPIOs will fail rudely. 459 + * 460 + * gpiochip_add_data() must only be called after gpiolib initialization, 461 + * ie after core_initcall(). 514 462 * 515 463 * If chip->base is negative, this requests dynamic assignment of 516 464 * a range of valid GPIOs. ··· 562 504 else 563 505 gdev->owner = THIS_MODULE; 564 506 565 - gdev->descs = devm_kcalloc(&gdev->dev, chip->ngpio, 566 - sizeof(gdev->descs[0]), GFP_KERNEL); 507 + gdev->descs = kcalloc(chip->ngpio, sizeof(gdev->descs[0]), GFP_KERNEL); 567 508 if (!gdev->descs) { 568 509 status = -ENOMEM; 569 510 goto err_free_gdev; ··· 571 514 if (chip->ngpio == 0) { 572 515 chip_err(chip, "tried to insert a GPIO chip with zero lines\n"); 573 516 status = -EINVAL; 574 - goto err_free_gdev; 517 + goto err_free_descs; 575 518 } 576 519 577 520 if (chip->label) 578 - gdev->label = devm_kstrdup(&gdev->dev, chip->label, GFP_KERNEL); 521 + gdev->label = kstrdup(chip->label, GFP_KERNEL); 579 522 else 580 - gdev->label = devm_kstrdup(&gdev->dev, "unknown", GFP_KERNEL); 523 + gdev->label = kstrdup("unknown", GFP_KERNEL); 581 524 if (!gdev->label) { 582 525 status = -ENOMEM; 583 - goto err_free_gdev; 526 + goto err_free_descs; 584 527 } 585 528 586 529 gdev->ngpio = chip->ngpio; ··· 600 543 if (base < 0) { 601 544 status = base; 602 545 spin_unlock_irqrestore(&gpio_lock, flags); 603 - goto err_free_gdev; 546 + goto err_free_label; 604 547 } 605 548 /* 606 549 * TODO: it should not be necessary to reflect the assigned ··· 615 558 status = gpiodev_add_to_list(gdev); 616 559 if (status) { 617 560 spin_unlock_irqrestore(&gpio_lock, flags); 618 - goto err_free_gdev; 561 + goto err_free_label; 619 562 } 620 563 621 564 for (i = 0; i < chip->ngpio; i++) { ··· 653 596 * we get a device node entry in sysfs under 654 597 * /sys/bus/gpio/devices/gpiochipN/dev that can be used for 655 598 * coldplug of device nodes and other udev business. 599 + * We can do this only if gpiolib has been initialized. 600 + * Otherwise, defer until later. 656 601 */ 657 - cdev_init(&gdev->chrdev, &gpio_fileops); 658 - gdev->chrdev.owner = THIS_MODULE; 659 - gdev->chrdev.kobj.parent = &gdev->dev.kobj; 660 - gdev->dev.devt = MKDEV(MAJOR(gpio_devt), gdev->id); 661 - status = cdev_add(&gdev->chrdev, gdev->dev.devt, 1); 662 - if (status < 0) 663 - chip_warn(chip, "failed to add char device %d:%d\n", 664 - MAJOR(gpio_devt), gdev->id); 665 - else 666 - chip_dbg(chip, "added GPIO chardev (%d:%d)\n", 667 - MAJOR(gpio_devt), gdev->id); 668 - status = device_add(&gdev->dev); 669 - if (status) 670 - goto err_remove_chardev; 671 - 672 - status = gpiochip_sysfs_register(gdev); 673 - if (status) 674 - goto err_remove_device; 675 - 676 - /* From this point, the .release() function cleans up gpio_device */ 677 - gdev->dev.release = gpiodevice_release; 678 - get_device(&gdev->dev); 679 - pr_debug("%s: registered GPIOs %d to %d on device: %s (%s)\n", 680 - __func__, gdev->base, gdev->base + gdev->ngpio - 1, 681 - dev_name(&gdev->dev), chip->label ? : "generic"); 682 - 602 + if (gpiolib_initialized) { 603 + status = gpiochip_setup_dev(gdev); 604 + if (status) 605 + goto err_remove_chip; 606 + } 683 607 return 0; 684 608 685 - err_remove_device: 686 - device_del(&gdev->dev); 687 - err_remove_chardev: 688 - cdev_del(&gdev->chrdev); 689 609 err_remove_chip: 690 610 acpi_gpiochip_remove(chip); 691 611 gpiochip_free_hogs(chip); ··· 671 637 spin_lock_irqsave(&gpio_lock, flags); 672 638 list_del(&gdev->list); 673 639 spin_unlock_irqrestore(&gpio_lock, flags); 640 + err_free_label: 641 + kfree(gdev->label); 642 + err_free_descs: 643 + kfree(gdev->descs); 674 644 err_free_gdev: 675 645 ida_simple_remove(&gpio_ida, gdev->id); 676 646 /* failures here can mean systems won't boot... */ ··· 2269 2231 return desc; 2270 2232 } 2271 2233 2272 - static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id, 2234 + static struct gpio_desc *acpi_find_gpio(struct device *dev, 2235 + const char *con_id, 2273 2236 unsigned int idx, 2274 - enum gpio_lookup_flags *flags) 2237 + enum gpiod_flags flags, 2238 + enum gpio_lookup_flags *lookupflags) 2275 2239 { 2276 2240 struct acpi_device *adev = ACPI_COMPANION(dev); 2277 2241 struct acpi_gpio_info info; ··· 2304 2264 desc = acpi_get_gpiod_by_index(adev, NULL, idx, &info); 2305 2265 if (IS_ERR(desc)) 2306 2266 return desc; 2267 + 2268 + if ((flags == GPIOD_OUT_LOW || flags == GPIOD_OUT_HIGH) && 2269 + info.gpioint) { 2270 + dev_dbg(dev, "refusing GpioInt() entry when doing GPIOD_OUT_* lookup\n"); 2271 + return ERR_PTR(-ENOENT); 2272 + } 2307 2273 } 2308 2274 2309 2275 if (info.polarity == GPIO_ACTIVE_LOW) 2310 - *flags |= GPIO_ACTIVE_LOW; 2276 + *lookupflags |= GPIO_ACTIVE_LOW; 2311 2277 2312 2278 return desc; 2313 2279 } ··· 2576 2530 desc = of_find_gpio(dev, con_id, idx, &lookupflags); 2577 2531 } else if (ACPI_COMPANION(dev)) { 2578 2532 dev_dbg(dev, "using ACPI for GPIO lookup\n"); 2579 - desc = acpi_find_gpio(dev, con_id, idx, &lookupflags); 2533 + desc = acpi_find_gpio(dev, con_id, idx, flags, &lookupflags); 2580 2534 } 2581 2535 } 2582 2536 ··· 2875 2829 if (ret < 0) { 2876 2830 pr_err("gpiolib: failed to allocate char dev region\n"); 2877 2831 bus_unregister(&gpio_bus_type); 2832 + } else { 2833 + gpiolib_initialized = true; 2834 + gpiochip_setup_devs(); 2878 2835 } 2879 2836 return ret; 2880 2837 }
+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);
+3
drivers/hid/hid-core.c
··· 1979 1979 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2) }, 1980 1980 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP) }, 1981 1981 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3) }, 1982 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_7K) }, 1983 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_600) }, 1984 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1) }, 1982 1985 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER) }, 1983 1986 { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, 1984 1987 { HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
+3
drivers/hid/hid-ids.h
··· 676 676 #define USB_DEVICE_ID_SIDEWINDER_GV 0x003b 677 677 #define USB_DEVICE_ID_MS_OFFICE_KB 0x0048 678 678 #define USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0 0x009d 679 + #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_7K 0x00b4 679 680 #define USB_DEVICE_ID_MS_NE4K 0x00db 680 681 #define USB_DEVICE_ID_MS_NE4K_JP 0x00dc 681 682 #define USB_DEVICE_ID_MS_LK6K 0x00f9 ··· 684 683 #define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713 685 684 #define USB_DEVICE_ID_MS_NE7K 0x071d 686 685 #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K 0x0730 686 + #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1 0x0732 687 + #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_600 0x0750 687 688 #define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500 0x076c 688 689 #define USB_DEVICE_ID_MS_COMFORT_KEYBOARD 0x00e3 689 690 #define USB_DEVICE_ID_MS_SURFACE_PRO_2 0x0799
+13 -3
drivers/hid/hid-lenovo.c
··· 184 184 unsigned char byte2, unsigned char byte3) 185 185 { 186 186 int ret; 187 - unsigned char buf[] = {0x18, byte2, byte3}; 187 + unsigned char *buf; 188 + 189 + buf = kzalloc(3, GFP_KERNEL); 190 + if (!buf) 191 + return -ENOMEM; 192 + 193 + buf[0] = 0x18; 194 + buf[1] = byte2; 195 + buf[2] = byte3; 188 196 189 197 switch (hdev->product) { 190 198 case USB_DEVICE_ID_LENOVO_CUSBKBD: 191 - ret = hid_hw_raw_request(hdev, 0x13, buf, sizeof(buf), 199 + ret = hid_hw_raw_request(hdev, 0x13, buf, 3, 192 200 HID_FEATURE_REPORT, HID_REQ_SET_REPORT); 193 201 break; 194 202 case USB_DEVICE_ID_LENOVO_CBTKBD: 195 - ret = hid_hw_output_report(hdev, buf, sizeof(buf)); 203 + ret = hid_hw_output_report(hdev, buf, 3); 196 204 break; 197 205 default: 198 206 ret = -EINVAL; 199 207 break; 200 208 } 209 + 210 + kfree(buf); 201 211 202 212 return ret < 0 ? ret : 0; /* BT returns 0, USB returns sizeof(buf) */ 203 213 }
+6
drivers/hid/hid-microsoft.c
··· 272 272 .driver_data = MS_PRESENTER }, 273 273 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K), 274 274 .driver_data = MS_ERGONOMY | MS_RDESC_3K }, 275 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_7K), 276 + .driver_data = MS_ERGONOMY }, 277 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_600), 278 + .driver_data = MS_ERGONOMY }, 279 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1), 280 + .driver_data = MS_ERGONOMY }, 275 281 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0), 276 282 .driver_data = MS_NOGET }, 277 283 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),
+1
drivers/hid/hid-multitouch.c
··· 1169 1169 MT_TOOL_FINGER, 1170 1170 false); 1171 1171 } 1172 + input_mt_sync_frame(input_dev); 1172 1173 input_sync(input_dev); 1173 1174 } 1174 1175 }
+8 -6
drivers/hid/hid-wiimote-modules.c
··· 2049 2049 * -----+------------------------------+-----+-----+ 2050 2050 * The single bits Yaw, Roll, Pitch in the lower right corner specify 2051 2051 * whether the wiimote is rotating fast (0) or slow (1). Speed for slow 2052 - * roation is 440 deg/s and for fast rotation 2000 deg/s. To get a 2053 - * linear scale we multiply by 2000/440 = ~4.5454 which is 18 for fast 2054 - * and 9 for slow. 2052 + * roation is 8192/440 units / deg/s and for fast rotation 8192/2000 2053 + * units / deg/s. To get a linear scale for fast rotation we multiply 2054 + * by 2000/440 = ~4.5454 and scale both fast and slow by 9 to match the 2055 + * previous scale reported by this driver. 2056 + * This leaves a linear scale with 8192*9/440 (~167.564) units / deg/s. 2055 2057 * If the wiimote is not rotating the sensor reports 2^13 = 8192. 2056 2058 * Ext specifies whether an extension is connected to the motionp. 2057 2059 * which is parsed by wiimote-core. ··· 2072 2070 z -= 8192; 2073 2071 2074 2072 if (!(ext[3] & 0x02)) 2075 - x *= 18; 2073 + x = (x * 2000 * 9) / 440; 2076 2074 else 2077 2075 x *= 9; 2078 2076 if (!(ext[4] & 0x02)) 2079 - y *= 18; 2077 + y = (y * 2000 * 9) / 440; 2080 2078 else 2081 2079 y *= 9; 2082 2080 if (!(ext[3] & 0x01)) 2083 - z *= 18; 2081 + z = (z * 2000 * 9) / 440; 2084 2082 else 2085 2083 z *= 9; 2086 2084
+37 -36
drivers/hid/usbhid/hid-core.c
··· 951 951 return ret; 952 952 } 953 953 954 - static void usbhid_restart_queues(struct usbhid_device *usbhid) 955 - { 956 - if (usbhid->urbout && !test_bit(HID_OUT_RUNNING, &usbhid->iofl)) 957 - usbhid_restart_out_queue(usbhid); 958 - if (!test_bit(HID_CTRL_RUNNING, &usbhid->iofl)) 959 - usbhid_restart_ctrl_queue(usbhid); 960 - } 961 - 962 954 static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid) 963 955 { 964 956 struct usbhid_device *usbhid = hid->driver_data; ··· 1396 1404 usb_kill_urb(usbhid->urbout); 1397 1405 } 1398 1406 1407 + static void hid_restart_io(struct hid_device *hid) 1408 + { 1409 + struct usbhid_device *usbhid = hid->driver_data; 1410 + int clear_halt = test_bit(HID_CLEAR_HALT, &usbhid->iofl); 1411 + int reset_pending = test_bit(HID_RESET_PENDING, &usbhid->iofl); 1412 + 1413 + spin_lock_irq(&usbhid->lock); 1414 + clear_bit(HID_SUSPENDED, &usbhid->iofl); 1415 + usbhid_mark_busy(usbhid); 1416 + 1417 + if (clear_halt || reset_pending) 1418 + schedule_work(&usbhid->reset_work); 1419 + usbhid->retry_delay = 0; 1420 + spin_unlock_irq(&usbhid->lock); 1421 + 1422 + if (reset_pending || !test_bit(HID_STARTED, &usbhid->iofl)) 1423 + return; 1424 + 1425 + if (!clear_halt) { 1426 + if (hid_start_in(hid) < 0) 1427 + hid_io_error(hid); 1428 + } 1429 + 1430 + spin_lock_irq(&usbhid->lock); 1431 + if (usbhid->urbout && !test_bit(HID_OUT_RUNNING, &usbhid->iofl)) 1432 + usbhid_restart_out_queue(usbhid); 1433 + if (!test_bit(HID_CTRL_RUNNING, &usbhid->iofl)) 1434 + usbhid_restart_ctrl_queue(usbhid); 1435 + spin_unlock_irq(&usbhid->lock); 1436 + } 1437 + 1399 1438 /* Treat USB reset pretty much the same as suspend/resume */ 1400 1439 static int hid_pre_reset(struct usb_interface *intf) 1401 1440 { ··· 1476 1453 return 1; 1477 1454 } 1478 1455 1456 + /* No need to do another reset or clear a halted endpoint */ 1479 1457 spin_lock_irq(&usbhid->lock); 1480 1458 clear_bit(HID_RESET_PENDING, &usbhid->iofl); 1459 + clear_bit(HID_CLEAR_HALT, &usbhid->iofl); 1481 1460 spin_unlock_irq(&usbhid->lock); 1482 1461 hid_set_idle(dev, intf->cur_altsetting->desc.bInterfaceNumber, 0, 0); 1483 - status = hid_start_in(hid); 1484 - if (status < 0) 1485 - hid_io_error(hid); 1486 - usbhid_restart_queues(usbhid); 1462 + 1463 + hid_restart_io(hid); 1487 1464 1488 1465 return 0; 1489 1466 } ··· 1506 1483 #ifdef CONFIG_PM 1507 1484 static int hid_resume_common(struct hid_device *hid, bool driver_suspended) 1508 1485 { 1509 - struct usbhid_device *usbhid = hid->driver_data; 1510 - int status; 1486 + int status = 0; 1511 1487 1512 - spin_lock_irq(&usbhid->lock); 1513 - clear_bit(HID_SUSPENDED, &usbhid->iofl); 1514 - usbhid_mark_busy(usbhid); 1515 - 1516 - if (test_bit(HID_CLEAR_HALT, &usbhid->iofl) || 1517 - test_bit(HID_RESET_PENDING, &usbhid->iofl)) 1518 - schedule_work(&usbhid->reset_work); 1519 - usbhid->retry_delay = 0; 1520 - 1521 - usbhid_restart_queues(usbhid); 1522 - spin_unlock_irq(&usbhid->lock); 1523 - 1524 - status = hid_start_in(hid); 1525 - if (status < 0) 1526 - hid_io_error(hid); 1527 - 1488 + hid_restart_io(hid); 1528 1489 if (driver_suspended && hid->driver && hid->driver->resume) 1529 1490 status = hid->driver->resume(hid); 1530 1491 return status; ··· 1577 1570 static int hid_resume(struct usb_interface *intf) 1578 1571 { 1579 1572 struct hid_device *hid = usb_get_intfdata (intf); 1580 - struct usbhid_device *usbhid = hid->driver_data; 1581 1573 int status; 1582 - 1583 - if (!test_bit(HID_STARTED, &usbhid->iofl)) 1584 - return 0; 1585 1574 1586 1575 status = hid_resume_common(hid, true); 1587 1576 dev_dbg(&intf->dev, "resume status %d\n", status); ··· 1587 1584 static int hid_reset_resume(struct usb_interface *intf) 1588 1585 { 1589 1586 struct hid_device *hid = usb_get_intfdata(intf); 1590 - struct usbhid_device *usbhid = hid->driver_data; 1591 1587 int status; 1592 1588 1593 - clear_bit(HID_SUSPENDED, &usbhid->iofl); 1594 1589 status = hid_post_reset(intf); 1595 1590 if (status >= 0 && hid->driver && hid->driver->reset_resume) { 1596 1591 int ret = hid->driver->reset_resume(hid);
+74 -28
drivers/hid/wacom_sys.c
··· 152 152 hid_data->inputmode = field->report->id; 153 153 hid_data->inputmode_index = usage->usage_index; 154 154 break; 155 + 156 + case HID_UP_DIGITIZER: 157 + if (field->report->id == 0x0B && 158 + (field->application == WACOM_G9_DIGITIZER || 159 + field->application == WACOM_G11_DIGITIZER)) { 160 + wacom->wacom_wac.mode_report = field->report->id; 161 + wacom->wacom_wac.mode_value = 0; 162 + } 163 + break; 164 + 165 + case WACOM_G9_PAGE: 166 + case WACOM_G11_PAGE: 167 + if (field->report->id == 0x03 && 168 + (field->application == WACOM_G9_TOUCHSCREEN || 169 + field->application == WACOM_G11_TOUCHSCREEN)) { 170 + wacom->wacom_wac.mode_report = field->report->id; 171 + wacom->wacom_wac.mode_value = 0; 172 + } 173 + break; 155 174 } 156 175 } 157 176 ··· 341 322 return 0; 342 323 } 343 324 344 - static int wacom_set_device_mode(struct hid_device *hdev, int report_id, 345 - int length, int mode) 325 + static int wacom_set_device_mode(struct hid_device *hdev, 326 + struct wacom_wac *wacom_wac) 346 327 { 347 - unsigned char *rep_data; 328 + u8 *rep_data; 329 + struct hid_report *r; 330 + struct hid_report_enum *re; 331 + int length; 348 332 int error = -ENOMEM, limit = 0; 349 333 350 - rep_data = kzalloc(length, GFP_KERNEL); 334 + if (wacom_wac->mode_report < 0) 335 + return 0; 336 + 337 + re = &(hdev->report_enum[HID_FEATURE_REPORT]); 338 + r = re->report_id_hash[wacom_wac->mode_report]; 339 + if (!r) 340 + return -EINVAL; 341 + 342 + rep_data = hid_alloc_report_buf(r, GFP_KERNEL); 351 343 if (!rep_data) 352 - return error; 344 + return -ENOMEM; 345 + 346 + length = hid_report_len(r); 353 347 354 348 do { 355 - rep_data[0] = report_id; 356 - rep_data[1] = mode; 349 + rep_data[0] = wacom_wac->mode_report; 350 + rep_data[1] = wacom_wac->mode_value; 357 351 358 352 error = wacom_set_report(hdev, HID_FEATURE_REPORT, rep_data, 359 353 length, 1); 360 354 if (error >= 0) 361 355 error = wacom_get_report(hdev, HID_FEATURE_REPORT, 362 356 rep_data, length, 1); 363 - } while (error >= 0 && rep_data[1] != mode && limit++ < WAC_MSG_RETRIES); 357 + } while (error >= 0 && 358 + rep_data[1] != wacom_wac->mode_report && 359 + limit++ < WAC_MSG_RETRIES); 364 360 365 361 kfree(rep_data); 366 362 ··· 445 411 static int wacom_query_tablet_data(struct hid_device *hdev, 446 412 struct wacom_features *features) 447 413 { 414 + struct wacom *wacom = hid_get_drvdata(hdev); 415 + struct wacom_wac *wacom_wac = &wacom->wacom_wac; 416 + 448 417 if (hdev->bus == BUS_BLUETOOTH) 449 418 return wacom_bt_query_tablet_data(hdev, 1, features); 450 419 451 - if (features->type == HID_GENERIC) 452 - return wacom_hid_set_device_mode(hdev); 453 - 454 - if (features->device_type & WACOM_DEVICETYPE_TOUCH) { 455 - if (features->type > TABLETPC) { 456 - /* MT Tablet PC touch */ 457 - return wacom_set_device_mode(hdev, 3, 4, 4); 458 - } 459 - else if (features->type == WACOM_24HDT) { 460 - return wacom_set_device_mode(hdev, 18, 3, 2); 461 - } 462 - else if (features->type == WACOM_27QHDT) { 463 - return wacom_set_device_mode(hdev, 131, 3, 2); 464 - } 465 - else if (features->type == BAMBOO_PAD) { 466 - return wacom_set_device_mode(hdev, 2, 2, 2); 467 - } 468 - } else if (features->device_type & WACOM_DEVICETYPE_PEN) { 469 - if (features->type <= BAMBOO_PT) { 470 - return wacom_set_device_mode(hdev, 2, 2, 2); 420 + if (features->type != HID_GENERIC) { 421 + if (features->device_type & WACOM_DEVICETYPE_TOUCH) { 422 + if (features->type > TABLETPC) { 423 + /* MT Tablet PC touch */ 424 + wacom_wac->mode_report = 3; 425 + wacom_wac->mode_value = 4; 426 + } else if (features->type == WACOM_24HDT) { 427 + wacom_wac->mode_report = 18; 428 + wacom_wac->mode_value = 2; 429 + } else if (features->type == WACOM_27QHDT) { 430 + wacom_wac->mode_report = 131; 431 + wacom_wac->mode_value = 2; 432 + } else if (features->type == BAMBOO_PAD) { 433 + wacom_wac->mode_report = 2; 434 + wacom_wac->mode_value = 2; 435 + } 436 + } else if (features->device_type & WACOM_DEVICETYPE_PEN) { 437 + if (features->type <= BAMBOO_PT) { 438 + wacom_wac->mode_report = 2; 439 + wacom_wac->mode_value = 2; 440 + } 471 441 } 472 442 } 443 + 444 + wacom_set_device_mode(hdev, wacom_wac); 445 + 446 + if (features->type == HID_GENERIC) 447 + return wacom_hid_set_device_mode(hdev); 473 448 474 449 return 0; 475 450 } ··· 1859 1816 error = -ENODEV; 1860 1817 goto fail_type; 1861 1818 } 1819 + 1820 + wacom_wac->hid_data.inputmode = -1; 1821 + wacom_wac->mode_report = -1; 1862 1822 1863 1823 wacom->usbdev = dev; 1864 1824 wacom->intf = intf;
+11
drivers/hid/wacom_wac.c
··· 2426 2426 } 2427 2427 2428 2428 /* 2429 + * Hack for the Bamboo One: 2430 + * the device presents a PAD/Touch interface as most Bamboos and even 2431 + * sends ghosts PAD data on it. However, later, we must disable this 2432 + * ghost interface, and we can not detect it unless we set it here 2433 + * to WACOM_DEVICETYPE_PAD or WACOM_DEVICETYPE_TOUCH. 2434 + */ 2435 + if (features->type == BAMBOO_PEN && 2436 + features->pktlen == WACOM_PKGLEN_BBTOUCH3) 2437 + features->device_type |= WACOM_DEVICETYPE_PAD; 2438 + 2439 + /* 2429 2440 * Raw Wacom-mode pen and touch events both come from interface 2430 2441 * 0, whose HID descriptor has an application usage of 0xFF0D 2431 2442 * (i.e., WACOM_VENDORDEFINED_PEN). We route pen packets back
+8
drivers/hid/wacom_wac.h
··· 84 84 #define WACOM_DEVICETYPE_WL_MONITOR 0x0008 85 85 86 86 #define WACOM_VENDORDEFINED_PEN 0xff0d0001 87 + #define WACOM_G9_PAGE 0xff090000 88 + #define WACOM_G9_DIGITIZER (WACOM_G9_PAGE | 0x02) 89 + #define WACOM_G9_TOUCHSCREEN (WACOM_G9_PAGE | 0x11) 90 + #define WACOM_G11_PAGE 0xff110000 91 + #define WACOM_G11_DIGITIZER (WACOM_G11_PAGE | 0x02) 92 + #define WACOM_G11_TOUCHSCREEN (WACOM_G11_PAGE | 0x11) 87 93 88 94 #define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \ 89 95 ((f)->physical == HID_DG_STYLUS) || \ ··· 244 238 int ps_connected; 245 239 u8 bt_features; 246 240 u8 bt_high_speed; 241 + int mode_report; 242 + int mode_value; 247 243 struct hid_data hid_data; 248 244 }; 249 245
+6 -1
drivers/i2c/busses/i2c-jz4780.c
··· 771 771 ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency", 772 772 &clk_freq); 773 773 if (ret) { 774 - dev_err(&pdev->dev, "clock-frequency not specified in DT"); 774 + dev_err(&pdev->dev, "clock-frequency not specified in DT\n"); 775 775 goto err; 776 776 } 777 777 778 778 i2c->speed = clk_freq / 1000; 779 + if (i2c->speed == 0) { 780 + ret = -EINVAL; 781 + dev_err(&pdev->dev, "clock-frequency minimum is 1000\n"); 782 + goto err; 783 + } 779 784 jz4780_i2c_set_speed(i2c); 780 785 781 786 dev_info(&pdev->dev, "Bus frequency is %d KHz\n", i2c->speed);
+2 -8
drivers/i2c/i2c-core.c
··· 525 525 return 0; 526 526 } 527 527 528 - 529 - /* uevent helps with hotplug: modprobe -q $(MODALIAS) */ 530 528 static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env) 531 529 { 532 - struct i2c_client *client = to_i2c_client(dev); 530 + struct i2c_client *client = to_i2c_client(dev); 533 531 int rc; 534 532 535 533 rc = acpi_device_uevent_modalias(dev, env); 536 534 if (rc != -ENODEV) 537 535 return rc; 538 536 539 - if (add_uevent_var(env, "MODALIAS=%s%s", 540 - I2C_MODULE_PREFIX, client->name)) 541 - return -ENOMEM; 542 - dev_dbg(dev, "uevent\n"); 543 - return 0; 537 + return add_uevent_var(env, "MODALIAS=%s%s", I2C_MODULE_PREFIX, client->name); 544 538 } 545 539 546 540 /* i2c bus recovery routines */
+29 -10
drivers/i2c/muxes/i2c-demux-pinctrl.c
··· 140 140 return i2c_demux_activate_master(priv, new_chan); 141 141 } 142 142 143 - static ssize_t cur_master_show(struct device *dev, struct device_attribute *attr, 144 - char *buf) 143 + static ssize_t available_masters_show(struct device *dev, 144 + struct device_attribute *attr, 145 + char *buf) 145 146 { 146 147 struct i2c_demux_pinctrl_priv *priv = dev_get_drvdata(dev); 147 148 int count = 0, i; 148 149 149 150 for (i = 0; i < priv->num_chan && count < PAGE_SIZE; i++) 150 - count += scnprintf(buf + count, PAGE_SIZE - count, "%c %d - %s\n", 151 - i == priv->cur_chan ? '*' : ' ', i, 152 - priv->chan[i].parent_np->full_name); 151 + count += scnprintf(buf + count, PAGE_SIZE - count, "%d:%s%c", 152 + i, priv->chan[i].parent_np->full_name, 153 + i == priv->num_chan - 1 ? '\n' : ' '); 153 154 154 155 return count; 155 156 } 157 + static DEVICE_ATTR_RO(available_masters); 156 158 157 - static ssize_t cur_master_store(struct device *dev, struct device_attribute *attr, 158 - const char *buf, size_t count) 159 + static ssize_t current_master_show(struct device *dev, 160 + struct device_attribute *attr, 161 + char *buf) 162 + { 163 + struct i2c_demux_pinctrl_priv *priv = dev_get_drvdata(dev); 164 + 165 + return sprintf(buf, "%d\n", priv->cur_chan); 166 + } 167 + 168 + static ssize_t current_master_store(struct device *dev, 169 + struct device_attribute *attr, 170 + const char *buf, size_t count) 159 171 { 160 172 struct i2c_demux_pinctrl_priv *priv = dev_get_drvdata(dev); 161 173 unsigned int val; ··· 184 172 185 173 return ret < 0 ? ret : count; 186 174 } 187 - static DEVICE_ATTR_RW(cur_master); 175 + static DEVICE_ATTR_RW(current_master); 188 176 189 177 static int i2c_demux_pinctrl_probe(struct platform_device *pdev) 190 178 { ··· 230 218 /* switch to first parent as active master */ 231 219 i2c_demux_activate_master(priv, 0); 232 220 233 - err = device_create_file(&pdev->dev, &dev_attr_cur_master); 221 + err = device_create_file(&pdev->dev, &dev_attr_available_masters); 234 222 if (err) 235 223 goto err_rollback; 236 224 225 + err = device_create_file(&pdev->dev, &dev_attr_current_master); 226 + if (err) 227 + goto err_rollback_available; 228 + 237 229 return 0; 238 230 231 + err_rollback_available: 232 + device_remove_file(&pdev->dev, &dev_attr_available_masters); 239 233 err_rollback: 240 234 for (j = 0; j < i; j++) { 241 235 of_node_put(priv->chan[j].parent_np); ··· 256 238 struct i2c_demux_pinctrl_priv *priv = platform_get_drvdata(pdev); 257 239 int i; 258 240 259 - device_remove_file(&pdev->dev, &dev_attr_cur_master); 241 + device_remove_file(&pdev->dev, &dev_attr_current_master); 242 + device_remove_file(&pdev->dev, &dev_attr_available_masters); 260 243 261 244 i2c_demux_deactivate_master(priv); 262 245
+3
drivers/isdn/mISDN/socket.c
··· 715 715 if (!maddr || maddr->family != AF_ISDN) 716 716 return -EINVAL; 717 717 718 + if (addr_len < sizeof(struct sockaddr_mISDN)) 719 + return -EINVAL; 720 + 718 721 lock_sock(sk); 719 722 720 723 if (_pms(sk)->dev) {
+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);
+25
drivers/mmc/host/sdhci-pci-core.c
··· 390 390 slot->cd_idx = 0; 391 391 slot->cd_override_level = true; 392 392 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || 393 + slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || 393 394 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD) 394 395 slot->host->mmc_host_ops.get_cd = bxt_get_cd; 395 396 ··· 1167 1166 { 1168 1167 .vendor = PCI_VENDOR_ID_INTEL, 1169 1168 .device = PCI_DEVICE_ID_INTEL_BXT_SD, 1169 + .subvendor = PCI_ANY_ID, 1170 + .subdevice = PCI_ANY_ID, 1171 + .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sd, 1172 + }, 1173 + 1174 + { 1175 + .vendor = PCI_VENDOR_ID_INTEL, 1176 + .device = PCI_DEVICE_ID_INTEL_BXTM_EMMC, 1177 + .subvendor = PCI_ANY_ID, 1178 + .subdevice = PCI_ANY_ID, 1179 + .driver_data = (kernel_ulong_t)&sdhci_intel_byt_emmc, 1180 + }, 1181 + 1182 + { 1183 + .vendor = PCI_VENDOR_ID_INTEL, 1184 + .device = PCI_DEVICE_ID_INTEL_BXTM_SDIO, 1185 + .subvendor = PCI_ANY_ID, 1186 + .subdevice = PCI_ANY_ID, 1187 + .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sdio, 1188 + }, 1189 + 1190 + { 1191 + .vendor = PCI_VENDOR_ID_INTEL, 1192 + .device = PCI_DEVICE_ID_INTEL_BXTM_SD, 1170 1193 .subvendor = PCI_ANY_ID, 1171 1194 .subdevice = PCI_ANY_ID, 1172 1195 .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sd,
+3
drivers/mmc/host/sdhci-pci.h
··· 28 28 #define PCI_DEVICE_ID_INTEL_BXT_SD 0x0aca 29 29 #define PCI_DEVICE_ID_INTEL_BXT_EMMC 0x0acc 30 30 #define PCI_DEVICE_ID_INTEL_BXT_SDIO 0x0ad0 31 + #define PCI_DEVICE_ID_INTEL_BXTM_SD 0x1aca 32 + #define PCI_DEVICE_ID_INTEL_BXTM_EMMC 0x1acc 33 + #define PCI_DEVICE_ID_INTEL_BXTM_SDIO 0x1ad0 31 34 #define PCI_DEVICE_ID_INTEL_APL_SD 0x5aca 32 35 #define PCI_DEVICE_ID_INTEL_APL_EMMC 0x5acc 33 36 #define PCI_DEVICE_ID_INTEL_APL_SDIO 0x5ad0
+22
drivers/mmc/host/sdhci-pxav3.c
··· 309 309 __func__, uhs, ctrl_2); 310 310 } 311 311 312 + static void pxav3_set_power(struct sdhci_host *host, unsigned char mode, 313 + unsigned short vdd) 314 + { 315 + struct mmc_host *mmc = host->mmc; 316 + u8 pwr = host->pwr; 317 + 318 + sdhci_set_power(host, mode, vdd); 319 + 320 + if (host->pwr == pwr) 321 + return; 322 + 323 + if (host->pwr == 0) 324 + vdd = 0; 325 + 326 + if (!IS_ERR(mmc->supply.vmmc)) { 327 + spin_unlock_irq(&host->lock); 328 + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); 329 + spin_lock_irq(&host->lock); 330 + } 331 + } 332 + 312 333 static const struct sdhci_ops pxav3_sdhci_ops = { 313 334 .set_clock = sdhci_set_clock, 335 + .set_power = pxav3_set_power, 314 336 .platform_send_init_74_clocks = pxav3_gen_init_74_clocks, 315 337 .get_max_clock = sdhci_pltfm_clk_get_max_clock, 316 338 .set_bus_width = sdhci_set_bus_width,
+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 },
+30 -9
drivers/mmc/host/sdhci.c
··· 1210 1210 } 1211 1211 EXPORT_SYMBOL_GPL(sdhci_set_clock); 1212 1212 1213 - static void sdhci_set_power(struct sdhci_host *host, unsigned char mode, 1214 - unsigned short vdd) 1213 + static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, 1214 + unsigned short vdd) 1215 1215 { 1216 1216 struct mmc_host *mmc = host->mmc; 1217 + 1218 + spin_unlock_irq(&host->lock); 1219 + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); 1220 + spin_lock_irq(&host->lock); 1221 + 1222 + if (mode != MMC_POWER_OFF) 1223 + sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); 1224 + else 1225 + sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); 1226 + } 1227 + 1228 + void sdhci_set_power(struct sdhci_host *host, unsigned char mode, 1229 + unsigned short vdd) 1230 + { 1217 1231 u8 pwr = 0; 1218 1232 1219 1233 if (mode != MMC_POWER_OFF) { ··· 1259 1245 sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); 1260 1246 if (host->quirks2 & SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON) 1261 1247 sdhci_runtime_pm_bus_off(host); 1262 - vdd = 0; 1263 1248 } else { 1264 1249 /* 1265 1250 * Spec says that we should clear the power reg before setting ··· 1289 1276 if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER) 1290 1277 mdelay(10); 1291 1278 } 1279 + } 1280 + EXPORT_SYMBOL_GPL(sdhci_set_power); 1292 1281 1293 - if (!IS_ERR(mmc->supply.vmmc)) { 1294 - spin_unlock_irq(&host->lock); 1295 - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); 1296 - spin_lock_irq(&host->lock); 1297 - } 1282 + static void __sdhci_set_power(struct sdhci_host *host, unsigned char mode, 1283 + unsigned short vdd) 1284 + { 1285 + struct mmc_host *mmc = host->mmc; 1286 + 1287 + if (host->ops->set_power) 1288 + host->ops->set_power(host, mode, vdd); 1289 + else if (!IS_ERR(mmc->supply.vmmc)) 1290 + sdhci_set_power_reg(host, mode, vdd); 1291 + else 1292 + sdhci_set_power(host, mode, vdd); 1298 1293 } 1299 1294 1300 1295 /*****************************************************************************\ ··· 1452 1431 } 1453 1432 } 1454 1433 1455 - sdhci_set_power(host, ios->power_mode, ios->vdd); 1434 + __sdhci_set_power(host, ios->power_mode, ios->vdd); 1456 1435 1457 1436 if (host->ops->platform_send_init_74_clocks) 1458 1437 host->ops->platform_send_init_74_clocks(host, ios->power_mode);
+4
drivers/mmc/host/sdhci.h
··· 529 529 #endif 530 530 531 531 void (*set_clock)(struct sdhci_host *host, unsigned int clock); 532 + void (*set_power)(struct sdhci_host *host, unsigned char mode, 533 + unsigned short vdd); 532 534 533 535 int (*enable_dma)(struct sdhci_host *host); 534 536 unsigned int (*get_max_clock)(struct sdhci_host *host); ··· 662 660 } 663 661 664 662 void sdhci_set_clock(struct sdhci_host *host, unsigned int clock); 663 + void sdhci_set_power(struct sdhci_host *host, unsigned char mode, 664 + unsigned short vdd); 665 665 void sdhci_set_bus_width(struct sdhci_host *host, int width); 666 666 void sdhci_reset(struct sdhci_host *host, u8 mask); 667 667 void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing);
+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)
+1
drivers/net/Kconfig
··· 195 195 196 196 config MACSEC 197 197 tristate "IEEE 802.1AE MAC-level encryption (MACsec)" 198 + select CRYPTO 198 199 select CRYPTO_AES 199 200 select CRYPTO_GCM 200 201 ---help---
+5 -29
drivers/net/dsa/mv88e6xxx.c
··· 2207 2207 struct net_device *bridge) 2208 2208 { 2209 2209 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); 2210 - u16 fid; 2211 2210 int i, err; 2212 2211 2213 2212 mutex_lock(&ps->smi_mutex); 2214 - 2215 - /* Get or create the bridge FID and assign it to the port */ 2216 - for (i = 0; i < ps->info->num_ports; ++i) 2217 - if (ps->ports[i].bridge_dev == bridge) 2218 - break; 2219 - 2220 - if (i < ps->info->num_ports) 2221 - err = _mv88e6xxx_port_fid_get(ds, i, &fid); 2222 - else 2223 - err = _mv88e6xxx_fid_new(ds, &fid); 2224 - if (err) 2225 - goto unlock; 2226 - 2227 - err = _mv88e6xxx_port_fid_set(ds, port, fid); 2228 - if (err) 2229 - goto unlock; 2230 2213 2231 2214 /* Assign the bridge and remap each port's VLANTable */ 2232 2215 ps->ports[port].bridge_dev = bridge; ··· 2222 2239 } 2223 2240 } 2224 2241 2225 - unlock: 2226 2242 mutex_unlock(&ps->smi_mutex); 2227 2243 2228 2244 return err; ··· 2231 2249 { 2232 2250 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); 2233 2251 struct net_device *bridge = ps->ports[port].bridge_dev; 2234 - u16 fid; 2235 2252 int i; 2236 2253 2237 2254 mutex_lock(&ps->smi_mutex); 2238 - 2239 - /* Give the port a fresh Filtering Information Database */ 2240 - if (_mv88e6xxx_fid_new(ds, &fid) || 2241 - _mv88e6xxx_port_fid_set(ds, port, fid)) 2242 - netdev_warn(ds->ports[port], "failed to assign a new FID\n"); 2243 2255 2244 2256 /* Unassign the bridge and remap each port's VLANTable */ 2245 2257 ps->ports[port].bridge_dev = NULL; ··· 2479 2503 * the other bits clear. 2480 2504 */ 2481 2505 reg = 1 << port; 2482 - /* Disable learning for DSA and CPU ports */ 2483 - if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) 2484 - reg = PORT_ASSOC_VECTOR_LOCKED_PORT; 2506 + /* Disable learning for CPU port */ 2507 + if (dsa_is_cpu_port(ds, port)) 2508 + reg = 0; 2485 2509 2486 2510 ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_ASSOC_VECTOR, reg); 2487 2511 if (ret) ··· 2561 2585 if (ret) 2562 2586 goto abort; 2563 2587 2564 - /* Port based VLAN map: give each port its own address 2588 + /* Port based VLAN map: give each port the same default address 2565 2589 * database, and allow bidirectional communication between the 2566 2590 * CPU and DSA port(s), and the other ports. 2567 2591 */ 2568 - ret = _mv88e6xxx_port_fid_set(ds, port, port + 1); 2592 + ret = _mv88e6xxx_port_fid_set(ds, port, 0); 2569 2593 if (ret) 2570 2594 goto abort; 2571 2595
+1 -1
drivers/net/ethernet/atheros/atlx/atl2.c
··· 1412 1412 1413 1413 err = -EIO; 1414 1414 1415 - netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_RX; 1415 + netdev->hw_features = NETIF_F_HW_VLAN_CTAG_RX; 1416 1416 netdev->features |= (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX); 1417 1417 1418 1418 /* Init PHY as early as possible due to power saving issue */
+5
drivers/net/ethernet/broadcom/bgmac.c
··· 1572 1572 dev_warn(&core->dev, "Using random MAC: %pM\n", mac); 1573 1573 } 1574 1574 1575 + /* This (reset &) enable is not preset in specs or reference driver but 1576 + * Broadcom does it in arch PCI code when enabling fake PCI device. 1577 + */ 1578 + bcma_core_enable(core, 0); 1579 + 1575 1580 /* Allocation and references */ 1576 1581 net_dev = alloc_etherdev(sizeof(*bgmac)); 1577 1582 if (!net_dev)
+3 -3
drivers/net/ethernet/broadcom/bgmac.h
··· 199 199 #define BGMAC_CMDCFG_TAI 0x00000200 200 200 #define BGMAC_CMDCFG_HD 0x00000400 /* Set if in half duplex mode */ 201 201 #define BGMAC_CMDCFG_HD_SHIFT 10 202 - #define BGMAC_CMDCFG_SR_REV0 0x00000800 /* Set to reset mode, for other revs */ 203 - #define BGMAC_CMDCFG_SR_REV4 0x00002000 /* Set to reset mode, only for core rev 4 */ 204 - #define BGMAC_CMDCFG_SR(rev) ((rev == 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0) 202 + #define BGMAC_CMDCFG_SR_REV0 0x00000800 /* Set to reset mode, for core rev 0-3 */ 203 + #define BGMAC_CMDCFG_SR_REV4 0x00002000 /* Set to reset mode, for core rev >= 4 */ 204 + #define BGMAC_CMDCFG_SR(rev) ((rev >= 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0) 205 205 #define BGMAC_CMDCFG_ML 0x00008000 /* Set to activate mac loopback mode */ 206 206 #define BGMAC_CMDCFG_AE 0x00400000 207 207 #define BGMAC_CMDCFG_CFE 0x00800000
+5 -1
drivers/net/ethernet/broadcom/genet/bcmgenet.c
··· 878 878 else 879 879 p = (char *)priv; 880 880 p += s->stat_offset; 881 - data[i] = *(u32 *)p; 881 + if (sizeof(unsigned long) != sizeof(u32) && 882 + s->stat_sizeof == sizeof(unsigned long)) 883 + data[i] = *(unsigned long *)p; 884 + else 885 + data[i] = *(u32 *)p; 882 886 } 883 887 } 884 888
+3 -2
drivers/net/ethernet/cavium/thunder/thunder_bgx.c
··· 1011 1011 } 1012 1012 1013 1013 lmac++; 1014 - if (lmac == MAX_LMAC_PER_BGX) 1014 + if (lmac == MAX_LMAC_PER_BGX) { 1015 + of_node_put(node); 1015 1016 break; 1017 + } 1016 1018 } 1017 - of_node_put(node); 1018 1019 return 0; 1019 1020 1020 1021 defer:
+3
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
··· 1451 1451 unsigned int mmd, unsigned int reg, u16 *valp); 1452 1452 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, 1453 1453 unsigned int mmd, unsigned int reg, u16 val); 1454 + int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf, 1455 + unsigned int vf, unsigned int iqtype, unsigned int iqid, 1456 + unsigned int fl0id, unsigned int fl1id); 1454 1457 int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 1455 1458 unsigned int vf, unsigned int iqtype, unsigned int iqid, 1456 1459 unsigned int fl0id, unsigned int fl1id);
+17 -3
drivers/net/ethernet/chelsio/cxgb4/sge.c
··· 2981 2981 void t4_free_sge_resources(struct adapter *adap) 2982 2982 { 2983 2983 int i; 2984 - struct sge_eth_rxq *eq = adap->sge.ethrxq; 2985 - struct sge_eth_txq *etq = adap->sge.ethtxq; 2984 + struct sge_eth_rxq *eq; 2985 + struct sge_eth_txq *etq; 2986 + 2987 + /* stop all Rx queues in order to start them draining */ 2988 + for (i = 0; i < adap->sge.ethqsets; i++) { 2989 + eq = &adap->sge.ethrxq[i]; 2990 + if (eq->rspq.desc) 2991 + t4_iq_stop(adap, adap->mbox, adap->pf, 0, 2992 + FW_IQ_TYPE_FL_INT_CAP, 2993 + eq->rspq.cntxt_id, 2994 + eq->fl.size ? eq->fl.cntxt_id : 0xffff, 2995 + 0xffff); 2996 + } 2986 2997 2987 2998 /* clean up Ethernet Tx/Rx queues */ 2988 - for (i = 0; i < adap->sge.ethqsets; i++, eq++, etq++) { 2999 + for (i = 0; i < adap->sge.ethqsets; i++) { 3000 + eq = &adap->sge.ethrxq[i]; 2989 3001 if (eq->rspq.desc) 2990 3002 free_rspq_fl(adap, &eq->rspq, 2991 3003 eq->fl.size ? &eq->fl : NULL); 3004 + 3005 + etq = &adap->sge.ethtxq[i]; 2992 3006 if (etq->q.desc) { 2993 3007 t4_eth_eq_free(adap, adap->mbox, adap->pf, 0, 2994 3008 etq->q.cntxt_id);
+43
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
··· 2557 2557 } 2558 2558 2559 2559 #define EEPROM_STAT_ADDR 0x7bfc 2560 + #define VPD_SIZE 0x800 2560 2561 #define VPD_BASE 0x400 2561 2562 #define VPD_BASE_OLD 0 2562 2563 #define VPD_LEN 1024 ··· 2594 2593 vpd = vmalloc(VPD_LEN); 2595 2594 if (!vpd) 2596 2595 return -ENOMEM; 2596 + 2597 + /* We have two VPD data structures stored in the adapter VPD area. 2598 + * By default, Linux calculates the size of the VPD area by traversing 2599 + * the first VPD area at offset 0x0, so we need to tell the OS what 2600 + * our real VPD size is. 2601 + */ 2602 + ret = pci_set_vpd_size(adapter->pdev, VPD_SIZE); 2603 + if (ret < 0) 2604 + goto out; 2597 2605 2598 2606 /* Card information normally starts at VPD_BASE but early cards had 2599 2607 * it at 0. ··· 6946 6936 FW_VI_ENABLE_CMD_VIID_V(viid)); 6947 6937 c.ien_to_len16 = cpu_to_be32(FW_VI_ENABLE_CMD_LED_F | FW_LEN16(c)); 6948 6938 c.blinkdur = cpu_to_be16(nblinks); 6939 + return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); 6940 + } 6941 + 6942 + /** 6943 + * t4_iq_stop - stop an ingress queue and its FLs 6944 + * @adap: the adapter 6945 + * @mbox: mailbox to use for the FW command 6946 + * @pf: the PF owning the queues 6947 + * @vf: the VF owning the queues 6948 + * @iqtype: the ingress queue type (FW_IQ_TYPE_FL_INT_CAP, etc.) 6949 + * @iqid: ingress queue id 6950 + * @fl0id: FL0 queue id or 0xffff if no attached FL0 6951 + * @fl1id: FL1 queue id or 0xffff if no attached FL1 6952 + * 6953 + * Stops an ingress queue and its associated FLs, if any. This causes 6954 + * any current or future data/messages destined for these queues to be 6955 + * tossed. 6956 + */ 6957 + int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf, 6958 + unsigned int vf, unsigned int iqtype, unsigned int iqid, 6959 + unsigned int fl0id, unsigned int fl1id) 6960 + { 6961 + struct fw_iq_cmd c; 6962 + 6963 + memset(&c, 0, sizeof(c)); 6964 + c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_IQ_CMD) | FW_CMD_REQUEST_F | 6965 + FW_CMD_EXEC_F | FW_IQ_CMD_PFN_V(pf) | 6966 + FW_IQ_CMD_VFN_V(vf)); 6967 + c.alloc_to_len16 = cpu_to_be32(FW_IQ_CMD_IQSTOP_F | FW_LEN16(c)); 6968 + c.type_to_iqandstindex = cpu_to_be32(FW_IQ_CMD_TYPE_V(iqtype)); 6969 + c.iqid = cpu_to_be16(iqid); 6970 + c.fl0id = cpu_to_be16(fl0id); 6971 + c.fl1id = cpu_to_be16(fl1id); 6949 6972 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); 6950 6973 } 6951 6974
+22 -8
drivers/net/ethernet/intel/fm10k/fm10k_pf.c
··· 1218 1218 if (err) 1219 1219 return err; 1220 1220 1221 - /* verify upper 16 bits are zero */ 1222 - if (vid >> 16) 1223 - return FM10K_ERR_PARAM; 1224 - 1225 1221 set = !(vid & FM10K_VLAN_CLEAR); 1226 1222 vid &= ~FM10K_VLAN_CLEAR; 1227 1223 1228 - err = fm10k_iov_select_vid(vf_info, (u16)vid); 1229 - if (err < 0) 1230 - return err; 1224 + /* if the length field has been set, this is a multi-bit 1225 + * update request. For multi-bit requests, simply disallow 1226 + * them when the pf_vid has been set. In this case, the PF 1227 + * should have already cleared the VLAN_TABLE, and if we 1228 + * allowed them, it could allow a rogue VF to receive traffic 1229 + * on a VLAN it was not assigned. In the single-bit case, we 1230 + * need to modify requests for VLAN 0 to use the default PF or 1231 + * SW vid when assigned. 1232 + */ 1231 1233 1232 - vid = err; 1234 + if (vid >> 16) { 1235 + /* prevent multi-bit requests when PF has 1236 + * administratively set the VLAN for this VF 1237 + */ 1238 + if (vf_info->pf_vid) 1239 + return FM10K_ERR_PARAM; 1240 + } else { 1241 + err = fm10k_iov_select_vid(vf_info, (u16)vid); 1242 + if (err < 0) 1243 + return err; 1244 + 1245 + vid = err; 1246 + } 1233 1247 1234 1248 /* update VSI info for VF in regards to VLAN table */ 1235 1249 err = hw->mac.ops.update_vlan(hw, vid, vf_info->vsi, set);
+24 -25
drivers/net/ethernet/intel/i40e/i40e_txrx.c
··· 2600 2600 } 2601 2601 2602 2602 /** 2603 - * __i40e_chk_linearize - Check if there are more than 8 fragments per packet 2603 + * __i40e_chk_linearize - Check if there are more than 8 buffers per packet 2604 2604 * @skb: send buffer 2605 2605 * 2606 - * Note: Our HW can't scatter-gather more than 8 fragments to build 2607 - * a packet on the wire and so we need to figure out the cases where we 2608 - * need to linearize the skb. 2606 + * Note: Our HW can't DMA more than 8 buffers to build a packet on the wire 2607 + * and so we need to figure out the cases where we need to linearize the skb. 2608 + * 2609 + * For TSO we need to count the TSO header and segment payload separately. 2610 + * As such we need to check cases where we have 7 fragments or more as we 2611 + * can potentially require 9 DMA transactions, 1 for the TSO header, 1 for 2612 + * the segment payload in the first descriptor, and another 7 for the 2613 + * fragments. 2609 2614 **/ 2610 2615 bool __i40e_chk_linearize(struct sk_buff *skb) 2611 2616 { 2612 2617 const struct skb_frag_struct *frag, *stale; 2613 - int gso_size, nr_frags, sum; 2618 + int nr_frags, sum; 2614 2619 2615 - /* check to see if TSO is enabled, if so we may get a repreive */ 2616 - gso_size = skb_shinfo(skb)->gso_size; 2617 - if (unlikely(!gso_size)) 2618 - return true; 2619 - 2620 - /* no need to check if number of frags is less than 8 */ 2620 + /* no need to check if number of frags is less than 7 */ 2621 2621 nr_frags = skb_shinfo(skb)->nr_frags; 2622 - if (nr_frags < I40E_MAX_BUFFER_TXD) 2622 + if (nr_frags < (I40E_MAX_BUFFER_TXD - 1)) 2623 2623 return false; 2624 2624 2625 2625 /* We need to walk through the list and validate that each group 2626 2626 * of 6 fragments totals at least gso_size. However we don't need 2627 - * to perform such validation on the first or last 6 since the first 2628 - * 6 cannot inherit any data from a descriptor before them, and the 2629 - * last 6 cannot inherit any data from a descriptor after them. 2627 + * to perform such validation on the last 6 since the last 6 cannot 2628 + * inherit any data from a descriptor after them. 2630 2629 */ 2631 - nr_frags -= I40E_MAX_BUFFER_TXD - 1; 2630 + nr_frags -= I40E_MAX_BUFFER_TXD - 2; 2632 2631 frag = &skb_shinfo(skb)->frags[0]; 2633 2632 2634 2633 /* Initialize size to the negative value of gso_size minus 1. We ··· 2636 2637 * descriptors for a single transmit as the header and previous 2637 2638 * fragment are already consuming 2 descriptors. 2638 2639 */ 2639 - sum = 1 - gso_size; 2640 + sum = 1 - skb_shinfo(skb)->gso_size; 2640 2641 2641 - /* Add size of frags 1 through 5 to create our initial sum */ 2642 - sum += skb_frag_size(++frag); 2643 - sum += skb_frag_size(++frag); 2644 - sum += skb_frag_size(++frag); 2645 - sum += skb_frag_size(++frag); 2646 - sum += skb_frag_size(++frag); 2642 + /* Add size of frags 0 through 4 to create our initial sum */ 2643 + sum += skb_frag_size(frag++); 2644 + sum += skb_frag_size(frag++); 2645 + sum += skb_frag_size(frag++); 2646 + sum += skb_frag_size(frag++); 2647 + sum += skb_frag_size(frag++); 2647 2648 2648 2649 /* Walk through fragments adding latest fragment, testing it, and 2649 2650 * then removing stale fragments from the sum. 2650 2651 */ 2651 2652 stale = &skb_shinfo(skb)->frags[0]; 2652 2653 for (;;) { 2653 - sum += skb_frag_size(++frag); 2654 + sum += skb_frag_size(frag++); 2654 2655 2655 2656 /* if sum is negative we failed to make sufficient progress */ 2656 2657 if (sum < 0) ··· 2660 2661 if (!--nr_frags) 2661 2662 break; 2662 2663 2663 - sum -= skb_frag_size(++stale); 2664 + sum -= skb_frag_size(stale++); 2664 2665 } 2665 2666 2666 2667 return false;
+7 -3
drivers/net/ethernet/intel/i40e/i40e_txrx.h
··· 442 442 **/ 443 443 static inline bool i40e_chk_linearize(struct sk_buff *skb, int count) 444 444 { 445 - /* we can only support up to 8 data buffers for a single send */ 446 - if (likely(count <= I40E_MAX_BUFFER_TXD)) 445 + /* Both TSO and single send will work if count is less than 8 */ 446 + if (likely(count < I40E_MAX_BUFFER_TXD)) 447 447 return false; 448 448 449 - return __i40e_chk_linearize(skb); 449 + if (skb_is_gso(skb)) 450 + return __i40e_chk_linearize(skb); 451 + 452 + /* we can support up to 8 data buffers for a single send */ 453 + return count != I40E_MAX_BUFFER_TXD; 450 454 } 451 455 452 456 /**
+24 -25
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
··· 1800 1800 } 1801 1801 1802 1802 /** 1803 - * __i40evf_chk_linearize - Check if there are more than 8 fragments per packet 1803 + * __i40evf_chk_linearize - Check if there are more than 8 buffers per packet 1804 1804 * @skb: send buffer 1805 1805 * 1806 - * Note: Our HW can't scatter-gather more than 8 fragments to build 1807 - * a packet on the wire and so we need to figure out the cases where we 1808 - * need to linearize the skb. 1806 + * Note: Our HW can't DMA more than 8 buffers to build a packet on the wire 1807 + * and so we need to figure out the cases where we need to linearize the skb. 1808 + * 1809 + * For TSO we need to count the TSO header and segment payload separately. 1810 + * As such we need to check cases where we have 7 fragments or more as we 1811 + * can potentially require 9 DMA transactions, 1 for the TSO header, 1 for 1812 + * the segment payload in the first descriptor, and another 7 for the 1813 + * fragments. 1809 1814 **/ 1810 1815 bool __i40evf_chk_linearize(struct sk_buff *skb) 1811 1816 { 1812 1817 const struct skb_frag_struct *frag, *stale; 1813 - int gso_size, nr_frags, sum; 1818 + int nr_frags, sum; 1814 1819 1815 - /* check to see if TSO is enabled, if so we may get a repreive */ 1816 - gso_size = skb_shinfo(skb)->gso_size; 1817 - if (unlikely(!gso_size)) 1818 - return true; 1819 - 1820 - /* no need to check if number of frags is less than 8 */ 1820 + /* no need to check if number of frags is less than 7 */ 1821 1821 nr_frags = skb_shinfo(skb)->nr_frags; 1822 - if (nr_frags < I40E_MAX_BUFFER_TXD) 1822 + if (nr_frags < (I40E_MAX_BUFFER_TXD - 1)) 1823 1823 return false; 1824 1824 1825 1825 /* We need to walk through the list and validate that each group 1826 1826 * of 6 fragments totals at least gso_size. However we don't need 1827 - * to perform such validation on the first or last 6 since the first 1828 - * 6 cannot inherit any data from a descriptor before them, and the 1829 - * last 6 cannot inherit any data from a descriptor after them. 1827 + * to perform such validation on the last 6 since the last 6 cannot 1828 + * inherit any data from a descriptor after them. 1830 1829 */ 1831 - nr_frags -= I40E_MAX_BUFFER_TXD - 1; 1830 + nr_frags -= I40E_MAX_BUFFER_TXD - 2; 1832 1831 frag = &skb_shinfo(skb)->frags[0]; 1833 1832 1834 1833 /* Initialize size to the negative value of gso_size minus 1. We ··· 1836 1837 * descriptors for a single transmit as the header and previous 1837 1838 * fragment are already consuming 2 descriptors. 1838 1839 */ 1839 - sum = 1 - gso_size; 1840 + sum = 1 - skb_shinfo(skb)->gso_size; 1840 1841 1841 - /* Add size of frags 1 through 5 to create our initial sum */ 1842 - sum += skb_frag_size(++frag); 1843 - sum += skb_frag_size(++frag); 1844 - sum += skb_frag_size(++frag); 1845 - sum += skb_frag_size(++frag); 1846 - sum += skb_frag_size(++frag); 1842 + /* Add size of frags 0 through 4 to create our initial sum */ 1843 + sum += skb_frag_size(frag++); 1844 + sum += skb_frag_size(frag++); 1845 + sum += skb_frag_size(frag++); 1846 + sum += skb_frag_size(frag++); 1847 + sum += skb_frag_size(frag++); 1847 1848 1848 1849 /* Walk through fragments adding latest fragment, testing it, and 1849 1850 * then removing stale fragments from the sum. 1850 1851 */ 1851 1852 stale = &skb_shinfo(skb)->frags[0]; 1852 1853 for (;;) { 1853 - sum += skb_frag_size(++frag); 1854 + sum += skb_frag_size(frag++); 1854 1855 1855 1856 /* if sum is negative we failed to make sufficient progress */ 1856 1857 if (sum < 0) ··· 1860 1861 if (!--nr_frags) 1861 1862 break; 1862 1863 1863 - sum -= skb_frag_size(++stale); 1864 + sum -= skb_frag_size(stale++); 1864 1865 } 1865 1866 1866 1867 return false;
+7 -3
drivers/net/ethernet/intel/i40evf/i40e_txrx.h
··· 424 424 **/ 425 425 static inline bool i40e_chk_linearize(struct sk_buff *skb, int count) 426 426 { 427 - /* we can only support up to 8 data buffers for a single send */ 428 - if (likely(count <= I40E_MAX_BUFFER_TXD)) 427 + /* Both TSO and single send will work if count is less than 8 */ 428 + if (likely(count < I40E_MAX_BUFFER_TXD)) 429 429 return false; 430 430 431 - return __i40evf_chk_linearize(skb); 431 + if (skb_is_gso(skb)) 432 + return __i40evf_chk_linearize(skb); 433 + 434 + /* we can support up to 8 data buffers for a single send */ 435 + return count != I40E_MAX_BUFFER_TXD; 432 436 } 433 437 434 438 /**
+4 -1
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
··· 337 337 case ETH_SS_STATS: 338 338 return bitmap_iterator_count(&it) + 339 339 (priv->tx_ring_num * 2) + 340 - (priv->rx_ring_num * 2); 340 + (priv->rx_ring_num * 3); 341 341 case ETH_SS_TEST: 342 342 return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags 343 343 & MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2; ··· 404 404 for (i = 0; i < priv->rx_ring_num; i++) { 405 405 data[index++] = priv->rx_ring[i]->packets; 406 406 data[index++] = priv->rx_ring[i]->bytes; 407 + data[index++] = priv->rx_ring[i]->dropped; 407 408 } 408 409 spin_unlock_bh(&priv->stats_lock); 409 410 ··· 478 477 "rx%d_packets", i); 479 478 sprintf(data + (index++) * ETH_GSTRING_LEN, 480 479 "rx%d_bytes", i); 480 + sprintf(data + (index++) * ETH_GSTRING_LEN, 481 + "rx%d_dropped", i); 481 482 } 482 483 break; 483 484 case ETH_SS_PRIV_FLAGS:
+4 -1
drivers/net/ethernet/mellanox/mlx4/en_port.c
··· 158 158 u64 in_mod = reset << 8 | port; 159 159 int err; 160 160 int i, counter_index; 161 + unsigned long sw_rx_dropped = 0; 161 162 162 163 mailbox = mlx4_alloc_cmd_mailbox(mdev->dev); 163 164 if (IS_ERR(mailbox)) ··· 181 180 for (i = 0; i < priv->rx_ring_num; i++) { 182 181 stats->rx_packets += priv->rx_ring[i]->packets; 183 182 stats->rx_bytes += priv->rx_ring[i]->bytes; 183 + sw_rx_dropped += priv->rx_ring[i]->dropped; 184 184 priv->port_stats.rx_chksum_good += priv->rx_ring[i]->csum_ok; 185 185 priv->port_stats.rx_chksum_none += priv->rx_ring[i]->csum_none; 186 186 priv->port_stats.rx_chksum_complete += priv->rx_ring[i]->csum_complete; ··· 238 236 &mlx4_en_stats->MCAST_prio_1, 239 237 NUM_PRIORITIES); 240 238 stats->collisions = 0; 241 - stats->rx_dropped = be32_to_cpu(mlx4_en_stats->RDROP); 239 + stats->rx_dropped = be32_to_cpu(mlx4_en_stats->RDROP) + 240 + sw_rx_dropped; 242 241 stats->rx_length_errors = be32_to_cpu(mlx4_en_stats->RdropLength); 243 242 stats->rx_over_errors = 0; 244 243 stats->rx_crc_errors = be32_to_cpu(mlx4_en_stats->RCRC);
+8 -4
drivers/net/ethernet/mellanox/mlx4/en_rx.c
··· 61 61 gfp_t gfp = _gfp; 62 62 63 63 if (order) 64 - gfp |= __GFP_COMP | __GFP_NOWARN; 64 + gfp |= __GFP_COMP | __GFP_NOWARN | __GFP_NOMEMALLOC; 65 65 page = alloc_pages(gfp, order); 66 66 if (likely(page)) 67 67 break; ··· 126 126 dma_unmap_page(priv->ddev, page_alloc[i].dma, 127 127 page_alloc[i].page_size, PCI_DMA_FROMDEVICE); 128 128 page = page_alloc[i].page; 129 - set_page_count(page, 1); 129 + /* Revert changes done by mlx4_alloc_pages */ 130 + page_ref_sub(page, page_alloc[i].page_size / 131 + priv->frag_info[i].frag_stride - 1); 130 132 put_page(page); 131 133 } 132 134 } ··· 178 176 dma_unmap_page(priv->ddev, page_alloc->dma, 179 177 page_alloc->page_size, PCI_DMA_FROMDEVICE); 180 178 page = page_alloc->page; 181 - set_page_count(page, 1); 179 + /* Revert changes done by mlx4_alloc_pages */ 180 + page_ref_sub(page, page_alloc->page_size / 181 + priv->frag_info[i].frag_stride - 1); 182 182 put_page(page); 183 183 page_alloc->page = NULL; 184 184 } ··· 943 939 /* GRO not possible, complete processing here */ 944 940 skb = mlx4_en_rx_skb(priv, rx_desc, frags, length); 945 941 if (!skb) { 946 - priv->stats.rx_dropped++; 942 + ring->dropped++; 947 943 goto next; 948 944 } 949 945
+57 -19
drivers/net/ethernet/mellanox/mlx4/main.c
··· 3172 3172 return 0; 3173 3173 } 3174 3174 3175 + static int mlx4_pci_enable_device(struct mlx4_dev *dev) 3176 + { 3177 + struct pci_dev *pdev = dev->persist->pdev; 3178 + int err = 0; 3179 + 3180 + mutex_lock(&dev->persist->pci_status_mutex); 3181 + if (dev->persist->pci_status == MLX4_PCI_STATUS_DISABLED) { 3182 + err = pci_enable_device(pdev); 3183 + if (!err) 3184 + dev->persist->pci_status = MLX4_PCI_STATUS_ENABLED; 3185 + } 3186 + mutex_unlock(&dev->persist->pci_status_mutex); 3187 + 3188 + return err; 3189 + } 3190 + 3191 + static void mlx4_pci_disable_device(struct mlx4_dev *dev) 3192 + { 3193 + struct pci_dev *pdev = dev->persist->pdev; 3194 + 3195 + mutex_lock(&dev->persist->pci_status_mutex); 3196 + if (dev->persist->pci_status == MLX4_PCI_STATUS_ENABLED) { 3197 + pci_disable_device(pdev); 3198 + dev->persist->pci_status = MLX4_PCI_STATUS_DISABLED; 3199 + } 3200 + mutex_unlock(&dev->persist->pci_status_mutex); 3201 + } 3202 + 3175 3203 static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data, 3176 3204 int total_vfs, int *nvfs, struct mlx4_priv *priv, 3177 3205 int reset_flow) ··· 3610 3582 3611 3583 pr_info(DRV_NAME ": Initializing %s\n", pci_name(pdev)); 3612 3584 3613 - err = pci_enable_device(pdev); 3585 + err = mlx4_pci_enable_device(&priv->dev); 3614 3586 if (err) { 3615 3587 dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n"); 3616 3588 return err; ··· 3743 3715 pci_release_regions(pdev); 3744 3716 3745 3717 err_disable_pdev: 3746 - pci_disable_device(pdev); 3718 + mlx4_pci_disable_device(&priv->dev); 3747 3719 pci_set_drvdata(pdev, NULL); 3748 3720 return err; 3749 3721 } ··· 3803 3775 priv->pci_dev_data = id->driver_data; 3804 3776 mutex_init(&dev->persist->device_state_mutex); 3805 3777 mutex_init(&dev->persist->interface_state_mutex); 3778 + mutex_init(&dev->persist->pci_status_mutex); 3806 3779 3807 3780 ret = devlink_register(devlink, &pdev->dev); 3808 3781 if (ret) ··· 3952 3923 } 3953 3924 3954 3925 pci_release_regions(pdev); 3955 - pci_disable_device(pdev); 3926 + mlx4_pci_disable_device(dev); 3956 3927 devlink_unregister(devlink); 3957 3928 kfree(dev->persist); 3958 3929 devlink_free(devlink); ··· 4071 4042 if (state == pci_channel_io_perm_failure) 4072 4043 return PCI_ERS_RESULT_DISCONNECT; 4073 4044 4074 - pci_disable_device(pdev); 4045 + mlx4_pci_disable_device(persist->dev); 4075 4046 return PCI_ERS_RESULT_NEED_RESET; 4076 4047 } 4077 4048 ··· 4079 4050 { 4080 4051 struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); 4081 4052 struct mlx4_dev *dev = persist->dev; 4082 - struct mlx4_priv *priv = mlx4_priv(dev); 4083 - int ret; 4084 - int nvfs[MLX4_MAX_PORTS + 1] = {0, 0, 0}; 4085 - int total_vfs; 4053 + int err; 4086 4054 4087 4055 mlx4_err(dev, "mlx4_pci_slot_reset was called\n"); 4088 - ret = pci_enable_device(pdev); 4089 - if (ret) { 4090 - mlx4_err(dev, "Can not re-enable device, ret=%d\n", ret); 4056 + err = mlx4_pci_enable_device(dev); 4057 + if (err) { 4058 + mlx4_err(dev, "Can not re-enable device, err=%d\n", err); 4091 4059 return PCI_ERS_RESULT_DISCONNECT; 4092 4060 } 4093 4061 4094 4062 pci_set_master(pdev); 4095 4063 pci_restore_state(pdev); 4096 4064 pci_save_state(pdev); 4065 + return PCI_ERS_RESULT_RECOVERED; 4066 + } 4097 4067 4068 + static void mlx4_pci_resume(struct pci_dev *pdev) 4069 + { 4070 + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); 4071 + struct mlx4_dev *dev = persist->dev; 4072 + struct mlx4_priv *priv = mlx4_priv(dev); 4073 + int nvfs[MLX4_MAX_PORTS + 1] = {0, 0, 0}; 4074 + int total_vfs; 4075 + int err; 4076 + 4077 + mlx4_err(dev, "%s was called\n", __func__); 4098 4078 total_vfs = dev->persist->num_vfs; 4099 4079 memcpy(nvfs, dev->persist->nvfs, sizeof(dev->persist->nvfs)); 4100 4080 4101 4081 mutex_lock(&persist->interface_state_mutex); 4102 4082 if (!(persist->interface_state & MLX4_INTERFACE_STATE_UP)) { 4103 - ret = mlx4_load_one(pdev, priv->pci_dev_data, total_vfs, nvfs, 4083 + err = mlx4_load_one(pdev, priv->pci_dev_data, total_vfs, nvfs, 4104 4084 priv, 1); 4105 - if (ret) { 4106 - mlx4_err(dev, "%s: mlx4_load_one failed, ret=%d\n", 4107 - __func__, ret); 4085 + if (err) { 4086 + mlx4_err(dev, "%s: mlx4_load_one failed, err=%d\n", 4087 + __func__, err); 4108 4088 goto end; 4109 4089 } 4110 4090 4111 - ret = restore_current_port_types(dev, dev->persist-> 4091 + err = restore_current_port_types(dev, dev->persist-> 4112 4092 curr_port_type, dev->persist-> 4113 4093 curr_port_poss_type); 4114 - if (ret) 4115 - mlx4_err(dev, "could not restore original port types (%d)\n", ret); 4094 + if (err) 4095 + mlx4_err(dev, "could not restore original port types (%d)\n", err); 4116 4096 } 4117 4097 end: 4118 4098 mutex_unlock(&persist->interface_state_mutex); 4119 4099 4120 - return ret ? PCI_ERS_RESULT_DISCONNECT : PCI_ERS_RESULT_RECOVERED; 4121 4100 } 4122 4101 4123 4102 static void mlx4_shutdown(struct pci_dev *pdev) ··· 4142 4105 static const struct pci_error_handlers mlx4_err_handler = { 4143 4106 .error_detected = mlx4_pci_err_detected, 4144 4107 .slot_reset = mlx4_pci_slot_reset, 4108 + .resume = mlx4_pci_resume, 4145 4109 }; 4146 4110 4147 4111 static struct pci_driver mlx4_driver = {
+2
drivers/net/ethernet/mellanox/mlx4/mlx4.h
··· 586 586 struct mlx4_master_qp0_state qp0_state[MLX4_MAX_PORTS + 1]; 587 587 int init_port_ref[MLX4_MAX_PORTS + 1]; 588 588 u16 max_mtu[MLX4_MAX_PORTS + 1]; 589 + u8 pptx; 590 + u8 pprx; 589 591 int disable_mcast_ref[MLX4_MAX_PORTS + 1]; 590 592 struct mlx4_resource_tracker res_tracker; 591 593 struct workqueue_struct *comm_wq;
+1
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
··· 323 323 unsigned long csum_ok; 324 324 unsigned long csum_none; 325 325 unsigned long csum_complete; 326 + unsigned long dropped; 326 327 int hwtstamp_rx_filter; 327 328 cpumask_var_t affinity_mask; 328 329 };
+13
drivers/net/ethernet/mellanox/mlx4/port.c
··· 1317 1317 } 1318 1318 1319 1319 gen_context->mtu = cpu_to_be16(master->max_mtu[port]); 1320 + /* Slave cannot change Global Pause configuration */ 1321 + if (slave != mlx4_master_func_num(dev) && 1322 + ((gen_context->pptx != master->pptx) || 1323 + (gen_context->pprx != master->pprx))) { 1324 + gen_context->pptx = master->pptx; 1325 + gen_context->pprx = master->pprx; 1326 + mlx4_warn(dev, 1327 + "denying Global Pause change for slave:%d\n", 1328 + slave); 1329 + } else { 1330 + master->pptx = gen_context->pptx; 1331 + master->pprx = gen_context->pprx; 1332 + } 1320 1333 break; 1321 1334 case MLX4_SET_PORT_GID_TABLE: 1322 1335 /* change to MULTIPLE entries: number of guest's gids
+101 -58
drivers/net/ethernet/qlogic/qede/qede_main.c
··· 774 774 return false; 775 775 } 776 776 777 + static inline void qede_rx_bd_ring_consume(struct qede_rx_queue *rxq) 778 + { 779 + qed_chain_consume(&rxq->rx_bd_ring); 780 + rxq->sw_rx_cons++; 781 + } 782 + 777 783 /* This function reuses the buffer(from an offset) from 778 784 * consumer index to producer index in the bd ring 779 785 */ ··· 803 797 curr_cons->data = NULL; 804 798 } 805 799 800 + /* In case of allocation failures reuse buffers 801 + * from consumer index to produce buffers for firmware 802 + */ 803 + static void qede_recycle_rx_bd_ring(struct qede_rx_queue *rxq, 804 + struct qede_dev *edev, u8 count) 805 + { 806 + struct sw_rx_data *curr_cons; 807 + 808 + for (; count > 0; count--) { 809 + curr_cons = &rxq->sw_rx_ring[rxq->sw_rx_cons & NUM_RX_BDS_MAX]; 810 + qede_reuse_page(edev, rxq, curr_cons); 811 + qede_rx_bd_ring_consume(rxq); 812 + } 813 + } 814 + 806 815 static inline int qede_realloc_rx_buffer(struct qede_dev *edev, 807 816 struct qede_rx_queue *rxq, 808 817 struct sw_rx_data *curr_cons) ··· 826 805 curr_cons->page_offset += rxq->rx_buf_seg_size; 827 806 828 807 if (curr_cons->page_offset == PAGE_SIZE) { 829 - if (unlikely(qede_alloc_rx_buffer(edev, rxq))) 808 + if (unlikely(qede_alloc_rx_buffer(edev, rxq))) { 809 + /* Since we failed to allocate new buffer 810 + * current buffer can be used again. 811 + */ 812 + curr_cons->page_offset -= rxq->rx_buf_seg_size; 813 + 830 814 return -ENOMEM; 815 + } 831 816 832 817 dma_unmap_page(&edev->pdev->dev, curr_cons->mapping, 833 818 PAGE_SIZE, DMA_FROM_DEVICE); ··· 955 928 len_on_bd); 956 929 957 930 if (unlikely(qede_realloc_rx_buffer(edev, rxq, current_bd))) { 958 - tpa_info->agg_state = QEDE_AGG_STATE_ERROR; 931 + /* Incr page ref count to reuse on allocation failure 932 + * so that it doesn't get freed while freeing SKB. 933 + */ 934 + atomic_inc(&current_bd->data->_count); 959 935 goto out; 960 936 } 961 937 ··· 972 942 return 0; 973 943 974 944 out: 945 + tpa_info->agg_state = QEDE_AGG_STATE_ERROR; 946 + qede_recycle_rx_bd_ring(rxq, edev, 1); 975 947 return -ENOMEM; 976 948 } 977 949 ··· 1025 993 tpa_info->skb = netdev_alloc_skb(edev->ndev, 1026 994 le16_to_cpu(cqe->len_on_first_bd)); 1027 995 if (unlikely(!tpa_info->skb)) { 996 + DP_NOTICE(edev, "Failed to allocate SKB for gro\n"); 1028 997 tpa_info->agg_state = QEDE_AGG_STATE_ERROR; 1029 - return; 998 + goto cons_buf; 1030 999 } 1031 1000 1032 1001 skb_put(tpa_info->skb, le16_to_cpu(cqe->len_on_first_bd)); ··· 1050 1017 /* This is needed in order to enable forwarding support */ 1051 1018 qede_set_gro_params(edev, tpa_info->skb, cqe); 1052 1019 1020 + cons_buf: /* We still need to handle bd_len_list to consume buffers */ 1053 1021 if (likely(cqe->ext_bd_len_list[0])) 1054 1022 qede_fill_frag_skb(edev, rxq, cqe->tpa_agg_index, 1055 1023 le16_to_cpu(cqe->ext_bd_len_list[0])); ··· 1068 1034 const struct iphdr *iph = ip_hdr(skb); 1069 1035 struct tcphdr *th; 1070 1036 1071 - skb_set_network_header(skb, 0); 1072 1037 skb_set_transport_header(skb, sizeof(struct iphdr)); 1073 1038 th = tcp_hdr(skb); 1074 1039 ··· 1082 1049 struct ipv6hdr *iph = ipv6_hdr(skb); 1083 1050 struct tcphdr *th; 1084 1051 1085 - skb_set_network_header(skb, 0); 1086 1052 skb_set_transport_header(skb, sizeof(struct ipv6hdr)); 1087 1053 th = tcp_hdr(skb); 1088 1054 ··· 1096 1064 struct sk_buff *skb, 1097 1065 u16 vlan_tag) 1098 1066 { 1067 + /* FW can send a single MTU sized packet from gro flow 1068 + * due to aggregation timeout/last segment etc. which 1069 + * is not expected to be a gro packet. If a skb has zero 1070 + * frags then simply push it in the stack as non gso skb. 1071 + */ 1072 + if (unlikely(!skb->data_len)) { 1073 + skb_shinfo(skb)->gso_type = 0; 1074 + skb_shinfo(skb)->gso_size = 0; 1075 + goto send_skb; 1076 + } 1077 + 1099 1078 #ifdef CONFIG_INET 1100 1079 if (skb_shinfo(skb)->gso_size) { 1080 + skb_set_network_header(skb, 0); 1081 + 1101 1082 switch (skb->protocol) { 1102 1083 case htons(ETH_P_IP): 1103 1084 qede_gro_ip_csum(skb); ··· 1125 1080 } 1126 1081 } 1127 1082 #endif 1083 + 1084 + send_skb: 1128 1085 skb_record_rx_queue(skb, fp->rss_id); 1129 1086 qede_skb_receive(edev, fp, skb, vlan_tag); 1130 1087 } ··· 1360 1313 "CQE in CONS = %u has error, flags = %x, dropping incoming packet\n", 1361 1314 sw_comp_cons, parse_flag); 1362 1315 rxq->rx_hw_errors++; 1363 - qede_reuse_page(edev, rxq, sw_rx_data); 1364 - goto next_rx; 1316 + qede_recycle_rx_bd_ring(rxq, edev, fp_cqe->bd_num); 1317 + goto next_cqe; 1365 1318 } 1366 1319 1367 1320 skb = netdev_alloc_skb(edev->ndev, QEDE_RX_HDR_SIZE); 1368 1321 if (unlikely(!skb)) { 1369 1322 DP_NOTICE(edev, 1370 1323 "Build_skb failed, dropping incoming packet\n"); 1371 - qede_reuse_page(edev, rxq, sw_rx_data); 1324 + qede_recycle_rx_bd_ring(rxq, edev, fp_cqe->bd_num); 1372 1325 rxq->rx_alloc_errors++; 1373 - goto next_rx; 1326 + goto next_cqe; 1374 1327 } 1375 1328 1376 1329 /* Copy data into SKB */ ··· 1404 1357 if (unlikely(qede_realloc_rx_buffer(edev, rxq, 1405 1358 sw_rx_data))) { 1406 1359 DP_ERR(edev, "Failed to allocate rx buffer\n"); 1360 + /* Incr page ref count to reuse on allocation 1361 + * failure so that it doesn't get freed while 1362 + * freeing SKB. 1363 + */ 1364 + 1365 + atomic_inc(&sw_rx_data->data->_count); 1407 1366 rxq->rx_alloc_errors++; 1367 + qede_recycle_rx_bd_ring(rxq, edev, 1368 + fp_cqe->bd_num); 1369 + dev_kfree_skb_any(skb); 1408 1370 goto next_cqe; 1409 1371 } 1410 1372 } 1373 + 1374 + qede_rx_bd_ring_consume(rxq); 1411 1375 1412 1376 if (fp_cqe->bd_num != 1) { 1413 1377 u16 pkt_len = le16_to_cpu(fp_cqe->pkt_len); ··· 1430 1372 num_frags--) { 1431 1373 u16 cur_size = pkt_len > rxq->rx_buf_size ? 1432 1374 rxq->rx_buf_size : pkt_len; 1433 - 1434 - WARN_ONCE(!cur_size, 1435 - "Still got %d BDs for mapping jumbo, but length became 0\n", 1436 - num_frags); 1437 - 1438 - if (unlikely(qede_alloc_rx_buffer(edev, rxq))) 1375 + if (unlikely(!cur_size)) { 1376 + DP_ERR(edev, 1377 + "Still got %d BDs for mapping jumbo, but length became 0\n", 1378 + num_frags); 1379 + qede_recycle_rx_bd_ring(rxq, edev, 1380 + num_frags); 1381 + dev_kfree_skb_any(skb); 1439 1382 goto next_cqe; 1383 + } 1440 1384 1441 - rxq->sw_rx_cons++; 1385 + if (unlikely(qede_alloc_rx_buffer(edev, rxq))) { 1386 + qede_recycle_rx_bd_ring(rxq, edev, 1387 + num_frags); 1388 + dev_kfree_skb_any(skb); 1389 + goto next_cqe; 1390 + } 1391 + 1442 1392 sw_rx_index = rxq->sw_rx_cons & NUM_RX_BDS_MAX; 1443 1393 sw_rx_data = &rxq->sw_rx_ring[sw_rx_index]; 1444 - qed_chain_consume(&rxq->rx_bd_ring); 1394 + qede_rx_bd_ring_consume(rxq); 1395 + 1445 1396 dma_unmap_page(&edev->pdev->dev, 1446 1397 sw_rx_data->mapping, 1447 1398 PAGE_SIZE, DMA_FROM_DEVICE); ··· 1466 1399 pkt_len -= cur_size; 1467 1400 } 1468 1401 1469 - if (pkt_len) 1402 + if (unlikely(pkt_len)) 1470 1403 DP_ERR(edev, 1471 1404 "Mapped all BDs of jumbo, but still have %d bytes\n", 1472 1405 pkt_len); ··· 1485 1418 skb_record_rx_queue(skb, fp->rss_id); 1486 1419 1487 1420 qede_skb_receive(edev, fp, skb, le16_to_cpu(fp_cqe->vlan_tag)); 1488 - 1489 - qed_chain_consume(&rxq->rx_bd_ring); 1490 - next_rx: 1491 - rxq->sw_rx_cons++; 1492 1421 next_rx_only: 1493 1422 rx_pkt++; 1494 1423 ··· 2495 2432 struct qede_agg_info *tpa_info = &rxq->tpa_info[i]; 2496 2433 struct sw_rx_data *replace_buf = &tpa_info->replace_buf; 2497 2434 2498 - if (replace_buf) { 2435 + if (replace_buf->data) { 2499 2436 dma_unmap_page(&edev->pdev->dev, 2500 2437 dma_unmap_addr(replace_buf, mapping), 2501 2438 PAGE_SIZE, DMA_FROM_DEVICE); ··· 2615 2552 static int qede_alloc_mem_rxq(struct qede_dev *edev, 2616 2553 struct qede_rx_queue *rxq) 2617 2554 { 2618 - int i, rc, size, num_allocated; 2555 + int i, rc, size; 2619 2556 2620 2557 rxq->num_rx_buffers = edev->q_num_rx_buffers; 2621 2558 ··· 2632 2569 rxq->sw_rx_ring = kzalloc(size, GFP_KERNEL); 2633 2570 if (!rxq->sw_rx_ring) { 2634 2571 DP_ERR(edev, "Rx buffers ring allocation failed\n"); 2572 + rc = -ENOMEM; 2635 2573 goto err; 2636 2574 } 2637 2575 ··· 2660 2596 /* Allocate buffers for the Rx ring */ 2661 2597 for (i = 0; i < rxq->num_rx_buffers; i++) { 2662 2598 rc = qede_alloc_rx_buffer(edev, rxq); 2663 - if (rc) 2664 - break; 2665 - } 2666 - num_allocated = i; 2667 - if (!num_allocated) { 2668 - DP_ERR(edev, "Rx buffers allocation failed\n"); 2669 - goto err; 2670 - } else if (num_allocated < rxq->num_rx_buffers) { 2671 - DP_NOTICE(edev, 2672 - "Allocated less buffers than desired (%d allocated)\n", 2673 - num_allocated); 2599 + if (rc) { 2600 + DP_ERR(edev, 2601 + "Rx buffers allocation failed at index %d\n", i); 2602 + goto err; 2603 + } 2674 2604 } 2675 2605 2676 - qede_alloc_sge_mem(edev, rxq); 2677 - 2678 - return 0; 2679 - 2606 + rc = qede_alloc_sge_mem(edev, rxq); 2680 2607 err: 2681 - qede_free_mem_rxq(edev, rxq); 2682 - return -ENOMEM; 2608 + return rc; 2683 2609 } 2684 2610 2685 2611 static void qede_free_mem_txq(struct qede_dev *edev, ··· 2752 2698 } 2753 2699 2754 2700 return 0; 2755 - 2756 2701 err: 2757 - qede_free_mem_fp(edev, fp); 2758 - return -ENOMEM; 2702 + return rc; 2759 2703 } 2760 2704 2761 2705 static void qede_free_mem_load(struct qede_dev *edev) ··· 2776 2724 struct qede_fastpath *fp = &edev->fp_array[rss_id]; 2777 2725 2778 2726 rc = qede_alloc_mem_fp(edev, fp); 2779 - if (rc) 2780 - break; 2781 - } 2782 - 2783 - if (rss_id != QEDE_RSS_CNT(edev)) { 2784 - /* Failed allocating memory for all the queues */ 2785 - if (!rss_id) { 2727 + if (rc) { 2786 2728 DP_ERR(edev, 2787 - "Failed to allocate memory for the leading queue\n"); 2788 - rc = -ENOMEM; 2789 - } else { 2790 - DP_NOTICE(edev, 2791 - "Failed to allocate memory for all of RSS queues\n Desired: %d queues, allocated: %d queues\n", 2792 - QEDE_RSS_CNT(edev), rss_id); 2729 + "Failed to allocate memory for fastpath - rss id = %d\n", 2730 + rss_id); 2731 + qede_free_mem_load(edev); 2732 + return rc; 2793 2733 } 2794 - edev->num_rss = rss_id; 2795 2734 } 2796 2735 2797 2736 return 0;
+3
drivers/net/ethernet/renesas/ravb_main.c
··· 1854 1854 rate = clk_get_rate(clk); 1855 1855 clk_put(clk); 1856 1856 1857 + if (!rate) 1858 + return -EINVAL; 1859 + 1857 1860 inc = 1000000000ULL << 20; 1858 1861 do_div(inc, rate); 1859 1862
+1 -5
drivers/net/ethernet/renesas/sh_eth.c
··· 2194 2194 __func__); 2195 2195 return ret; 2196 2196 } 2197 - ret = sh_eth_dev_init(ndev, false); 2197 + ret = sh_eth_dev_init(ndev, true); 2198 2198 if (ret < 0) { 2199 2199 netdev_err(ndev, "%s: sh_eth_dev_init failed.\n", 2200 2200 __func__); 2201 2201 return ret; 2202 2202 } 2203 2203 2204 - mdp->irq_enabled = true; 2205 - sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); 2206 - /* Setting the Rx mode will start the Rx process. */ 2207 - sh_eth_write(ndev, EDRRR_R, EDRRR); 2208 2204 netif_device_attach(ndev); 2209 2205 } 2210 2206
+13 -3
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
··· 34 34 #define SYSMGR_EMACGRP_CTRL_PHYSEL_MASK 0x00000003 35 35 #define SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK 0x00000010 36 36 37 + #define SYSMGR_FPGAGRP_MODULE_REG 0x00000028 38 + #define SYSMGR_FPGAGRP_MODULE_EMAC 0x00000004 39 + 37 40 #define EMAC_SPLITTER_CTRL_REG 0x0 38 41 #define EMAC_SPLITTER_CTRL_SPEED_MASK 0x3 39 42 #define EMAC_SPLITTER_CTRL_SPEED_10 0x2 ··· 151 148 int phymode = dwmac->interface; 152 149 u32 reg_offset = dwmac->reg_offset; 153 150 u32 reg_shift = dwmac->reg_shift; 154 - u32 ctrl, val; 151 + u32 ctrl, val, module; 155 152 156 153 switch (phymode) { 157 154 case PHY_INTERFACE_MODE_RGMII: ··· 178 175 ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift); 179 176 ctrl |= val << reg_shift; 180 177 181 - if (dwmac->f2h_ptp_ref_clk) 178 + if (dwmac->f2h_ptp_ref_clk) { 182 179 ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); 183 - else 180 + regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, 181 + &module); 182 + module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift / 2)); 183 + regmap_write(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, 184 + module); 185 + } else { 184 186 ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2)); 187 + } 185 188 186 189 regmap_write(sys_mgr_base_addr, reg_offset, ctrl); 190 + 187 191 return 0; 188 192 } 189 193
+2 -2
drivers/net/ethernet/ti/cpsw.c
··· 1244 1244 int i, ret; 1245 1245 u32 reg; 1246 1246 1247 + pm_runtime_get_sync(&priv->pdev->dev); 1248 + 1247 1249 if (!cpsw_common_res_usage_state(priv)) 1248 1250 cpsw_intr_disable(priv); 1249 1251 netif_carrier_off(ndev); 1250 - 1251 - pm_runtime_get_sync(&priv->pdev->dev); 1252 1252 1253 1253 reg = priv->version; 1254 1254
+1 -2
drivers/net/ethernet/ti/davinci_emac.c
··· 1878 1878 pdata->hw_ram_addr = auxdata->hw_ram_addr; 1879 1879 } 1880 1880 1881 - pdev->dev.platform_data = pdata; 1882 - 1883 1881 return pdata; 1884 1882 } 1885 1883 ··· 2099 2101 cpdma_ctlr_destroy(priv->dma); 2100 2102 2101 2103 unregister_netdev(ndev); 2104 + pm_runtime_disable(&pdev->dev); 2102 2105 free_netdev(ndev); 2103 2106 2104 2107 return 0;
+1 -1
drivers/net/phy/spi_ks8995.c
··· 441 441 return -ENOMEM; 442 442 443 443 mutex_init(&ks->lock); 444 - ks->spi = spi_dev_get(spi); 444 + ks->spi = spi; 445 445 ks->chip = &ks8995_chip[variant]; 446 446 447 447 if (ks->spi->dev.of_node) {
+7 -2
drivers/net/usb/cdc_mbim.c
··· 617 617 { USB_VENDOR_AND_INTERFACE_INFO(0x0bdb, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), 618 618 .driver_info = (unsigned long)&cdc_mbim_info, 619 619 }, 620 - /* Huawei E3372 fails unless NDP comes after the IP packets */ 621 - { USB_DEVICE_AND_INTERFACE_INFO(0x12d1, 0x157d, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), 620 + 621 + /* Some Huawei devices, ME906s-158 (12d1:15c1) and E3372 622 + * (12d1:157d), are known to fail unless the NDP is placed 623 + * after the IP packets. Applying the quirk to all Huawei 624 + * devices is broader than necessary, but harmless. 625 + */ 626 + { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), 622 627 .driver_info = (unsigned long)&cdc_mbim_info_ndp_to_end, 623 628 }, 624 629 /* default entry */
+8 -4
drivers/net/vmxnet3/vmxnet3_drv.c
··· 1152 1152 union Vmxnet3_GenericDesc *gdesc) 1153 1153 { 1154 1154 if (!gdesc->rcd.cnc && adapter->netdev->features & NETIF_F_RXCSUM) { 1155 - /* typical case: TCP/UDP over IP and both csums are correct */ 1156 - if ((le32_to_cpu(gdesc->dword[3]) & VMXNET3_RCD_CSUM_OK) == 1157 - VMXNET3_RCD_CSUM_OK) { 1155 + if (gdesc->rcd.v4 && 1156 + (le32_to_cpu(gdesc->dword[3]) & 1157 + VMXNET3_RCD_CSUM_OK) == VMXNET3_RCD_CSUM_OK) { 1158 1158 skb->ip_summed = CHECKSUM_UNNECESSARY; 1159 1159 BUG_ON(!(gdesc->rcd.tcp || gdesc->rcd.udp)); 1160 - BUG_ON(!(gdesc->rcd.v4 || gdesc->rcd.v6)); 1160 + BUG_ON(gdesc->rcd.frg); 1161 + } else if (gdesc->rcd.v6 && (le32_to_cpu(gdesc->dword[3]) & 1162 + (1 << VMXNET3_RCD_TUC_SHIFT))) { 1163 + skb->ip_summed = CHECKSUM_UNNECESSARY; 1164 + BUG_ON(!(gdesc->rcd.tcp || gdesc->rcd.udp)); 1161 1165 BUG_ON(gdesc->rcd.frg); 1162 1166 } else { 1163 1167 if (gdesc->rcd.csum) {
+2 -2
drivers/net/vmxnet3/vmxnet3_int.h
··· 69 69 /* 70 70 * Version numbers 71 71 */ 72 - #define VMXNET3_DRIVER_VERSION_STRING "1.4.6.0-k" 72 + #define VMXNET3_DRIVER_VERSION_STRING "1.4.7.0-k" 73 73 74 74 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ 75 - #define VMXNET3_DRIVER_VERSION_NUM 0x01040600 75 + #define VMXNET3_DRIVER_VERSION_NUM 0x01040700 76 76 77 77 #if defined(CONFIG_PCI_MSI) 78 78 /* RSS only makes sense if MSI-X is supported. */
+16 -161
drivers/net/vrf.c
··· 60 60 struct u64_stats_sync syncp; 61 61 }; 62 62 63 - static struct dst_entry *vrf_ip_check(struct dst_entry *dst, u32 cookie) 64 - { 65 - return dst; 66 - } 67 - 68 - static int vrf_ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb) 69 - { 70 - return ip_local_out(net, sk, skb); 71 - } 72 - 73 - static unsigned int vrf_v4_mtu(const struct dst_entry *dst) 74 - { 75 - /* TO-DO: return max ethernet size? */ 76 - return dst->dev->mtu; 77 - } 78 - 79 - static void vrf_dst_destroy(struct dst_entry *dst) 80 - { 81 - /* our dst lives forever - or until the device is closed */ 82 - } 83 - 84 - static unsigned int vrf_default_advmss(const struct dst_entry *dst) 85 - { 86 - return 65535 - 40; 87 - } 88 - 89 - static struct dst_ops vrf_dst_ops = { 90 - .family = AF_INET, 91 - .local_out = vrf_ip_local_out, 92 - .check = vrf_ip_check, 93 - .mtu = vrf_v4_mtu, 94 - .destroy = vrf_dst_destroy, 95 - .default_advmss = vrf_default_advmss, 96 - }; 97 - 98 63 /* neighbor handling is done with actual device; do not want 99 64 * to flip skb->dev for those ndisc packets. This really fails 100 65 * for multiple next protocols (e.g., NEXTHDR_HOP). But it is ··· 314 349 } 315 350 316 351 #if IS_ENABLED(CONFIG_IPV6) 317 - static struct dst_entry *vrf_ip6_check(struct dst_entry *dst, u32 cookie) 318 - { 319 - return dst; 320 - } 321 - 322 - static struct dst_ops vrf_dst_ops6 = { 323 - .family = AF_INET6, 324 - .local_out = ip6_local_out, 325 - .check = vrf_ip6_check, 326 - .mtu = vrf_v4_mtu, 327 - .destroy = vrf_dst_destroy, 328 - .default_advmss = vrf_default_advmss, 329 - }; 330 - 331 - static int init_dst_ops6_kmem_cachep(void) 332 - { 333 - vrf_dst_ops6.kmem_cachep = kmem_cache_create("vrf_ip6_dst_cache", 334 - sizeof(struct rt6_info), 335 - 0, 336 - SLAB_HWCACHE_ALIGN, 337 - NULL); 338 - 339 - if (!vrf_dst_ops6.kmem_cachep) 340 - return -ENOMEM; 341 - 342 - return 0; 343 - } 344 - 345 - static void free_dst_ops6_kmem_cachep(void) 346 - { 347 - kmem_cache_destroy(vrf_dst_ops6.kmem_cachep); 348 - } 349 - 350 - static int vrf_input6(struct sk_buff *skb) 351 - { 352 - skb->dev->stats.rx_errors++; 353 - kfree_skb(skb); 354 - return 0; 355 - } 356 - 357 352 /* modelled after ip6_finish_output2 */ 358 353 static int vrf_finish_output6(struct net *net, struct sock *sk, 359 354 struct sk_buff *skb) ··· 354 429 !(IP6CB(skb)->flags & IP6SKB_REROUTED)); 355 430 } 356 431 357 - static void vrf_rt6_destroy(struct net_vrf *vrf) 432 + static void vrf_rt6_release(struct net_vrf *vrf) 358 433 { 359 - dst_destroy(&vrf->rt6->dst); 360 - free_percpu(vrf->rt6->rt6i_pcpu); 434 + dst_release(&vrf->rt6->dst); 361 435 vrf->rt6 = NULL; 362 436 } 363 437 364 438 static int vrf_rt6_create(struct net_device *dev) 365 439 { 366 440 struct net_vrf *vrf = netdev_priv(dev); 367 - struct dst_entry *dst; 441 + struct net *net = dev_net(dev); 368 442 struct rt6_info *rt6; 369 - int cpu; 370 443 int rc = -ENOMEM; 371 444 372 - rt6 = dst_alloc(&vrf_dst_ops6, dev, 0, 373 - DST_OBSOLETE_NONE, 374 - (DST_HOST | DST_NOPOLICY | DST_NOXFRM)); 445 + rt6 = ip6_dst_alloc(net, dev, 446 + DST_HOST | DST_NOPOLICY | DST_NOXFRM | DST_NOCACHE); 375 447 if (!rt6) 376 448 goto out; 377 449 378 - dst = &rt6->dst; 379 - 380 - rt6->rt6i_pcpu = alloc_percpu_gfp(struct rt6_info *, GFP_KERNEL); 381 - if (!rt6->rt6i_pcpu) { 382 - dst_destroy(dst); 383 - goto out; 384 - } 385 - for_each_possible_cpu(cpu) { 386 - struct rt6_info **p = per_cpu_ptr(rt6->rt6i_pcpu, cpu); 387 - *p = NULL; 388 - } 389 - 390 - memset(dst + 1, 0, sizeof(*rt6) - sizeof(*dst)); 391 - 392 - INIT_LIST_HEAD(&rt6->rt6i_siblings); 393 - INIT_LIST_HEAD(&rt6->rt6i_uncached); 394 - 395 - rt6->dst.input = vrf_input6; 396 450 rt6->dst.output = vrf_output6; 397 - 398 - rt6->rt6i_table = fib6_get_table(dev_net(dev), vrf->tb_id); 399 - 400 - atomic_set(&rt6->dst.__refcnt, 2); 401 - 451 + rt6->rt6i_table = fib6_get_table(net, vrf->tb_id); 452 + dst_hold(&rt6->dst); 402 453 vrf->rt6 = rt6; 403 454 rc = 0; 404 455 out: 405 456 return rc; 406 457 } 407 458 #else 408 - static int init_dst_ops6_kmem_cachep(void) 409 - { 410 - return 0; 411 - } 412 - 413 - static void free_dst_ops6_kmem_cachep(void) 414 - { 415 - } 416 - 417 - static void vrf_rt6_destroy(struct net_vrf *vrf) 459 + static void vrf_rt6_release(struct net_vrf *vrf) 418 460 { 419 461 } 420 462 ··· 449 557 !(IPCB(skb)->flags & IPSKB_REROUTED)); 450 558 } 451 559 452 - static void vrf_rtable_destroy(struct net_vrf *vrf) 560 + static void vrf_rtable_release(struct net_vrf *vrf) 453 561 { 454 562 struct dst_entry *dst = (struct dst_entry *)vrf->rth; 455 563 456 - dst_destroy(dst); 564 + dst_release(dst); 457 565 vrf->rth = NULL; 458 566 } 459 567 ··· 462 570 struct net_vrf *vrf = netdev_priv(dev); 463 571 struct rtable *rth; 464 572 465 - rth = dst_alloc(&vrf_dst_ops, dev, 2, 466 - DST_OBSOLETE_NONE, 467 - (DST_HOST | DST_NOPOLICY | DST_NOXFRM)); 573 + rth = rt_dst_alloc(dev, 0, RTN_UNICAST, 1, 1, 0); 468 574 if (rth) { 469 575 rth->dst.output = vrf_output; 470 - rth->rt_genid = rt_genid_ipv4(dev_net(dev)); 471 - rth->rt_flags = 0; 472 - rth->rt_type = RTN_UNICAST; 473 - rth->rt_is_input = 0; 474 - rth->rt_iif = 0; 475 - rth->rt_pmtu = 0; 476 - rth->rt_gateway = 0; 477 - rth->rt_uses_gateway = 0; 478 576 rth->rt_table_id = vrf->tb_id; 479 - INIT_LIST_HEAD(&rth->rt_uncached); 480 - rth->rt_uncached_list = NULL; 481 577 } 482 578 483 579 return rth; ··· 553 673 struct net_device *port_dev; 554 674 struct list_head *iter; 555 675 556 - vrf_rtable_destroy(vrf); 557 - vrf_rt6_destroy(vrf); 676 + vrf_rtable_release(vrf); 677 + vrf_rt6_release(vrf); 558 678 559 679 netdev_for_each_lower_dev(dev, port_dev, iter) 560 680 vrf_del_slave(dev, port_dev); ··· 584 704 return 0; 585 705 586 706 out_rth: 587 - vrf_rtable_destroy(vrf); 707 + vrf_rtable_release(vrf); 588 708 out_stats: 589 709 free_percpu(dev->dstats); 590 710 dev->dstats = NULL; ··· 617 737 struct net_vrf *vrf = netdev_priv(dev); 618 738 619 739 rth = vrf->rth; 620 - atomic_inc(&rth->dst.__refcnt); 740 + dst_hold(&rth->dst); 621 741 } 622 742 623 743 return rth; ··· 668 788 struct net_vrf *vrf = netdev_priv(dev); 669 789 670 790 rt = vrf->rt6; 671 - atomic_inc(&rt->dst.__refcnt); 791 + dst_hold(&rt->dst); 672 792 } 673 793 674 794 return (struct dst_entry *)rt; ··· 826 946 { 827 947 int rc; 828 948 829 - vrf_dst_ops.kmem_cachep = 830 - kmem_cache_create("vrf_ip_dst_cache", 831 - sizeof(struct rtable), 0, 832 - SLAB_HWCACHE_ALIGN, 833 - NULL); 834 - 835 - if (!vrf_dst_ops.kmem_cachep) 836 - return -ENOMEM; 837 - 838 - rc = init_dst_ops6_kmem_cachep(); 839 - if (rc != 0) 840 - goto error2; 841 - 842 949 register_netdevice_notifier(&vrf_notifier_block); 843 950 844 951 rc = rtnl_link_register(&vrf_link_ops); ··· 836 969 837 970 error: 838 971 unregister_netdevice_notifier(&vrf_notifier_block); 839 - free_dst_ops6_kmem_cachep(); 840 - error2: 841 - kmem_cache_destroy(vrf_dst_ops.kmem_cachep); 842 972 return rc; 843 973 } 844 974 845 - static void __exit vrf_cleanup_module(void) 846 - { 847 - rtnl_link_unregister(&vrf_link_ops); 848 - unregister_netdevice_notifier(&vrf_notifier_block); 849 - kmem_cache_destroy(vrf_dst_ops.kmem_cachep); 850 - free_dst_ops6_kmem_cachep(); 851 - } 852 - 853 975 module_init(vrf_init_module); 854 - module_exit(vrf_cleanup_module); 855 976 MODULE_AUTHOR("Shrijeet Mukherjee, David Ahern"); 856 977 MODULE_DESCRIPTION("Device driver to instantiate VRF domains"); 857 978 MODULE_LICENSE("GPL");
+2
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 1149 1149 /* the fw is stopped, the aux sta is dead: clean up driver state */ 1150 1150 iwl_mvm_del_aux_sta(mvm); 1151 1151 1152 + iwl_free_fw_paging(mvm); 1153 + 1152 1154 /* 1153 1155 * Clear IN_HW_RESTART flag when stopping the hw (as restart_complete() 1154 1156 * won't be called in this case).
-2
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
··· 782 782 for (i = 0; i < NVM_MAX_NUM_SECTIONS; i++) 783 783 kfree(mvm->nvm_sections[i].data); 784 784 785 - iwl_free_fw_paging(mvm); 786 - 787 785 iwl_mvm_tof_clean(mvm); 788 786 789 787 del_timer_sync(&mvm->scan_timer);
+2 -2
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
··· 732 732 */ 733 733 val = iwl_read_prph(trans, PREG_AUX_BUS_WPROT_0); 734 734 if (val & (BIT(1) | BIT(17))) { 735 - IWL_INFO(trans, 736 - "can't access the RSA semaphore it is write protected\n"); 735 + IWL_DEBUG_INFO(trans, 736 + "can't access the RSA semaphore it is write protected\n"); 737 737 return 0; 738 738 } 739 739
+3 -3
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
··· 2488 2488 for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++) 2489 2489 rtldm->swing_idx_ofdm_base[p] = rtldm->swing_idx_ofdm[p]; 2490 2490 2491 - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 2492 - "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n", 2493 - rtldm->thermalvalue, thermal_value); 2491 + RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 2492 + "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n", 2493 + rtldm->thermalvalue, thermal_value); 2494 2494 /*Record last Power Tracking Thermal Value*/ 2495 2495 rtldm->thermalvalue = thermal_value; 2496 2496 }
+1 -1
drivers/nvdimm/bus.c
··· 407 407 [ND_CMD_IMPLEMENTED] = { }, 408 408 [ND_CMD_SMART] = { 409 409 .out_num = 2, 410 - .out_sizes = { 4, 8, }, 410 + .out_sizes = { 4, 128, }, 411 411 }, 412 412 [ND_CMD_SMART_THRESHOLD] = { 413 413 .out_num = 2,
+20 -21
drivers/nvdimm/core.c
··· 417 417 set_badblock(bb, start_sector, num_sectors); 418 418 } 419 419 420 - static void namespace_add_poison(struct list_head *poison_list, 421 - struct badblocks *bb, struct resource *res) 420 + static void badblocks_populate(struct list_head *poison_list, 421 + struct badblocks *bb, const struct resource *res) 422 422 { 423 423 struct nd_poison *pl; 424 424 ··· 460 460 } 461 461 462 462 /** 463 - * nvdimm_namespace_add_poison() - Convert a list of poison ranges to badblocks 464 - * @ndns: the namespace containing poison ranges 465 - * @bb: badblocks instance to populate 466 - * @offset: offset at the start of the namespace before 'sector 0' 463 + * nvdimm_badblocks_populate() - Convert a list of poison ranges to badblocks 464 + * @region: parent region of the range to interrogate 465 + * @bb: badblocks instance to populate 466 + * @res: resource range to consider 467 467 * 468 - * The poison list generated during NFIT initialization may contain multiple, 469 - * possibly overlapping ranges in the SPA (System Physical Address) space. 470 - * Compare each of these ranges to the namespace currently being initialized, 471 - * and add badblocks to the gendisk for all matching sub-ranges 468 + * The poison list generated during bus initialization may contain 469 + * multiple, possibly overlapping physical address ranges. Compare each 470 + * of these ranges to the resource range currently being initialized, 471 + * and add badblocks entries for all matching sub-ranges 472 472 */ 473 - void nvdimm_namespace_add_poison(struct nd_namespace_common *ndns, 474 - struct badblocks *bb, resource_size_t offset) 473 + void nvdimm_badblocks_populate(struct nd_region *nd_region, 474 + struct badblocks *bb, const struct resource *res) 475 475 { 476 - struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev); 477 - struct nd_region *nd_region = to_nd_region(ndns->dev.parent); 478 476 struct nvdimm_bus *nvdimm_bus; 479 477 struct list_head *poison_list; 480 - struct resource res = { 481 - .start = nsio->res.start + offset, 482 - .end = nsio->res.end, 483 - }; 484 478 485 - nvdimm_bus = to_nvdimm_bus(nd_region->dev.parent); 479 + if (!is_nd_pmem(&nd_region->dev)) { 480 + dev_WARN_ONCE(&nd_region->dev, 1, 481 + "%s only valid for pmem regions\n", __func__); 482 + return; 483 + } 484 + nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); 486 485 poison_list = &nvdimm_bus->poison_list; 487 486 488 487 nvdimm_bus_lock(&nvdimm_bus->dev); 489 - namespace_add_poison(poison_list, bb, &res); 488 + badblocks_populate(poison_list, bb, res); 490 489 nvdimm_bus_unlock(&nvdimm_bus->dev); 491 490 } 492 - EXPORT_SYMBOL_GPL(nvdimm_namespace_add_poison); 491 + EXPORT_SYMBOL_GPL(nvdimm_badblocks_populate); 493 492 494 493 static int add_poison(struct nvdimm_bus *nvdimm_bus, u64 addr, u64 length) 495 494 {
+2 -2
drivers/nvdimm/nd.h
··· 266 266 int nvdimm_namespace_detach_btt(struct nd_namespace_common *ndns); 267 267 const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, 268 268 char *name); 269 - void nvdimm_namespace_add_poison(struct nd_namespace_common *ndns, 270 - struct badblocks *bb, resource_size_t offset); 269 + void nvdimm_badblocks_populate(struct nd_region *nd_region, 270 + struct badblocks *bb, const struct resource *res); 271 271 int nd_blk_region_init(struct nd_region *nd_region); 272 272 void __nd_iostat_start(struct bio *bio, unsigned long *start); 273 273 static inline bool nd_iostat_start(struct bio *bio, unsigned long *start)
+1 -1
drivers/nvdimm/pfn_devs.c
··· 376 376 } else { 377 377 /* from init we validate */ 378 378 if (memcmp(nd_pfn->uuid, pfn_sb->uuid, 16) != 0) 379 - return -EINVAL; 379 + return -ENODEV; 380 380 } 381 381 382 382 if (nd_pfn->align > nvdimm_namespace_capacity(ndns)) {
+42 -6
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)) { ··· 258 244 static int pmem_attach_disk(struct device *dev, 259 245 struct nd_namespace_common *ndns, struct pmem_device *pmem) 260 246 { 247 + struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev); 261 248 int nid = dev_to_node(dev); 249 + struct resource bb_res; 262 250 struct gendisk *disk; 263 251 264 252 blk_queue_make_request(pmem->pmem_queue, pmem_make_request); ··· 287 271 devm_exit_badblocks(dev, &pmem->bb); 288 272 if (devm_init_badblocks(dev, &pmem->bb)) 289 273 return -ENOMEM; 290 - nvdimm_namespace_add_poison(ndns, &pmem->bb, pmem->data_offset); 274 + bb_res.start = nsio->res.start + pmem->data_offset; 275 + bb_res.end = nsio->res.end; 276 + if (is_nd_pfn(dev)) { 277 + struct nd_pfn *nd_pfn = to_nd_pfn(dev); 278 + struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; 291 279 280 + bb_res.start += __le32_to_cpu(pfn_sb->start_pad); 281 + bb_res.end -= __le32_to_cpu(pfn_sb->end_trunc); 282 + } 283 + nvdimm_badblocks_populate(to_nd_region(dev->parent), &pmem->bb, 284 + &bb_res); 292 285 disk->bb = &pmem->bb; 293 286 add_disk(disk); 294 287 revalidate_disk(disk); ··· 578 553 ndns->rw_bytes = pmem_rw_bytes; 579 554 if (devm_init_badblocks(dev, &pmem->bb)) 580 555 return -ENOMEM; 581 - nvdimm_namespace_add_poison(ndns, &pmem->bb, 0); 556 + nvdimm_badblocks_populate(nd_region, &pmem->bb, &nsio->res); 582 557 583 558 if (is_nd_btt(dev)) { 584 559 /* btt allocates its own request_queue */ ··· 620 595 { 621 596 struct pmem_device *pmem = dev_get_drvdata(dev); 622 597 struct nd_namespace_common *ndns = pmem->ndns; 598 + struct nd_region *nd_region = to_nd_region(dev->parent); 599 + struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev); 600 + struct resource res = { 601 + .start = nsio->res.start + pmem->data_offset, 602 + .end = nsio->res.end, 603 + }; 623 604 624 605 if (event != NVDIMM_REVALIDATE_POISON) 625 606 return; 626 607 627 - if (is_nd_btt(dev)) 628 - nvdimm_namespace_add_poison(ndns, &pmem->bb, 0); 629 - else 630 - nvdimm_namespace_add_poison(ndns, &pmem->bb, pmem->data_offset); 608 + if (is_nd_pfn(dev)) { 609 + struct nd_pfn *nd_pfn = to_nd_pfn(dev); 610 + struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; 611 + 612 + res.start += __le32_to_cpu(pfn_sb->start_pad); 613 + res.end -= __le32_to_cpu(pfn_sb->end_trunc); 614 + } 615 + 616 + nvdimm_badblocks_populate(nd_region, &pmem->bb, &res); 631 617 } 632 618 633 619 MODULE_ALIAS("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);
+42
drivers/pci/access.c
··· 275 275 } 276 276 EXPORT_SYMBOL(pci_write_vpd); 277 277 278 + /** 279 + * pci_set_vpd_size - Set size of Vital Product Data space 280 + * @dev: pci device struct 281 + * @len: size of vpd space 282 + */ 283 + int pci_set_vpd_size(struct pci_dev *dev, size_t len) 284 + { 285 + if (!dev->vpd || !dev->vpd->ops) 286 + return -ENODEV; 287 + return dev->vpd->ops->set_size(dev, len); 288 + } 289 + EXPORT_SYMBOL(pci_set_vpd_size); 290 + 278 291 #define PCI_VPD_MAX_SIZE (PCI_VPD_ADDR_MASK + 1) 279 292 280 293 /** ··· 511 498 return ret ? ret : count; 512 499 } 513 500 501 + static int pci_vpd_set_size(struct pci_dev *dev, size_t len) 502 + { 503 + struct pci_vpd *vpd = dev->vpd; 504 + 505 + if (len == 0 || len > PCI_VPD_MAX_SIZE) 506 + return -EIO; 507 + 508 + vpd->valid = 1; 509 + vpd->len = len; 510 + 511 + return 0; 512 + } 513 + 514 514 static const struct pci_vpd_ops pci_vpd_ops = { 515 515 .read = pci_vpd_read, 516 516 .write = pci_vpd_write, 517 + .set_size = pci_vpd_set_size, 517 518 }; 518 519 519 520 static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count, ··· 560 533 return ret; 561 534 } 562 535 536 + static int pci_vpd_f0_set_size(struct pci_dev *dev, size_t len) 537 + { 538 + struct pci_dev *tdev = pci_get_slot(dev->bus, 539 + PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); 540 + int ret; 541 + 542 + if (!tdev) 543 + return -ENODEV; 544 + 545 + ret = pci_set_vpd_size(tdev, len); 546 + pci_dev_put(tdev); 547 + return ret; 548 + } 549 + 563 550 static const struct pci_vpd_ops pci_vpd_f0_ops = { 564 551 .read = pci_vpd_f0_read, 565 552 .write = pci_vpd_f0_write, 553 + .set_size = pci_vpd_f0_set_size, 566 554 }; 567 555 568 556 int pci_vpd_init(struct pci_dev *dev)
+14 -6
drivers/pci/host/pci-imx6.c
··· 32 32 #define to_imx6_pcie(x) container_of(x, struct imx6_pcie, pp) 33 33 34 34 struct imx6_pcie { 35 - struct gpio_desc *reset_gpio; 35 + int reset_gpio; 36 36 struct clk *pcie_bus; 37 37 struct clk *pcie_phy; 38 38 struct clk *pcie; ··· 309 309 usleep_range(200, 500); 310 310 311 311 /* Some boards don't have PCIe reset GPIO. */ 312 - if (imx6_pcie->reset_gpio) { 313 - gpiod_set_value_cansleep(imx6_pcie->reset_gpio, 0); 312 + if (gpio_is_valid(imx6_pcie->reset_gpio)) { 313 + gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0); 314 314 msleep(100); 315 - gpiod_set_value_cansleep(imx6_pcie->reset_gpio, 1); 315 + gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1); 316 316 } 317 317 return 0; 318 318 ··· 523 523 { 524 524 struct imx6_pcie *imx6_pcie; 525 525 struct pcie_port *pp; 526 + struct device_node *np = pdev->dev.of_node; 526 527 struct resource *dbi_base; 527 528 struct device_node *node = pdev->dev.of_node; 528 529 int ret; ··· 545 544 return PTR_ERR(pp->dbi_base); 546 545 547 546 /* Fetch GPIOs */ 548 - imx6_pcie->reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", 549 - GPIOD_OUT_LOW); 547 + imx6_pcie->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0); 548 + if (gpio_is_valid(imx6_pcie->reset_gpio)) { 549 + ret = devm_gpio_request_one(&pdev->dev, imx6_pcie->reset_gpio, 550 + GPIOF_OUT_INIT_LOW, "PCIe reset"); 551 + if (ret) { 552 + dev_err(&pdev->dev, "unable to get reset gpio\n"); 553 + return ret; 554 + } 555 + } 550 556 551 557 /* Fetch clocks */ 552 558 imx6_pcie->pcie_phy = devm_clk_get(&pdev->dev, "pcie_phy");
+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
drivers/pci/pci.h
··· 97 97 struct pci_vpd_ops { 98 98 ssize_t (*read)(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 99 99 ssize_t (*write)(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); 100 + int (*set_size)(struct pci_dev *dev, size_t len); 100 101 }; 101 102 102 103 struct pci_vpd {
+5 -1
drivers/platform/x86/hp_accel.c
··· 127 127 arg0.integer.value = reg; 128 128 129 129 status = acpi_evaluate_integer(dev->handle, "ALRD", &args, &lret); 130 + if (ACPI_FAILURE(status)) 131 + return -EINVAL; 130 132 *ret = lret; 131 - return (status != AE_OK) ? -EINVAL : 0; 133 + return 0; 132 134 } 133 135 134 136 /** ··· 175 173 DEFINE_CONV(normal, 1, 2, 3); 176 174 DEFINE_CONV(y_inverted, 1, -2, 3); 177 175 DEFINE_CONV(x_inverted, -1, 2, 3); 176 + DEFINE_CONV(x_inverted_usd, -1, 2, -3); 178 177 DEFINE_CONV(z_inverted, 1, 2, -3); 179 178 DEFINE_CONV(xy_swap, 2, 1, 3); 180 179 DEFINE_CONV(xy_rotated_left, -2, 1, 3); ··· 239 236 AXIS_DMI_MATCH("HP8710", "HP Compaq 8710", y_inverted), 240 237 AXIS_DMI_MATCH("HDX18", "HP HDX 18", x_inverted), 241 238 AXIS_DMI_MATCH("HPB432x", "HP ProBook 432", xy_rotated_left), 239 + AXIS_DMI_MATCH("HPB440G3", "HP ProBook 440 G3", x_inverted_usd), 242 240 AXIS_DMI_MATCH("HPB442x", "HP ProBook 442", xy_rotated_left), 243 241 AXIS_DMI_MATCH("HPB452x", "HP ProBook 452", y_inverted), 244 242 AXIS_DMI_MATCH("HPB522x", "HP ProBook 522", xy_swap),
+2
drivers/platform/x86/intel-hid.c
··· 91 91 } 92 92 93 93 static const struct dev_pm_ops intel_hid_pl_pm_ops = { 94 + .freeze = intel_hid_pl_suspend_handler, 95 + .restore = intel_hid_pl_resume_handler, 94 96 .suspend = intel_hid_pl_suspend_handler, 95 97 .resume = intel_hid_pl_resume_handler, 96 98 };
+22 -26
drivers/platform/x86/intel_pmc_ipc.c
··· 687 687 ipcdev.acpi_io_size = size; 688 688 dev_info(&pdev->dev, "io res: %pR\n", res); 689 689 690 - /* This is index 0 to cover BIOS data register */ 691 690 punit_res = punit_res_array; 691 + /* This is index 0 to cover BIOS data register */ 692 692 res = platform_get_resource(pdev, IORESOURCE_MEM, 693 693 PLAT_RESOURCE_BIOS_DATA_INDEX); 694 694 if (!res) { ··· 698 698 *punit_res = *res; 699 699 dev_info(&pdev->dev, "punit BIOS data res: %pR\n", res); 700 700 701 + /* This is index 1 to cover BIOS interface register */ 701 702 res = platform_get_resource(pdev, IORESOURCE_MEM, 702 703 PLAT_RESOURCE_BIOS_IFACE_INDEX); 703 704 if (!res) { 704 705 dev_err(&pdev->dev, "Failed to get res of punit BIOS iface\n"); 705 706 return -ENXIO; 706 707 } 707 - /* This is index 1 to cover BIOS interface register */ 708 708 *++punit_res = *res; 709 709 dev_info(&pdev->dev, "punit BIOS interface res: %pR\n", res); 710 710 711 + /* This is index 2 to cover ISP data register, optional */ 711 712 res = platform_get_resource(pdev, IORESOURCE_MEM, 712 713 PLAT_RESOURCE_ISP_DATA_INDEX); 713 - if (!res) { 714 - dev_err(&pdev->dev, "Failed to get res of punit ISP data\n"); 715 - return -ENXIO; 714 + ++punit_res; 715 + if (res) { 716 + *punit_res = *res; 717 + dev_info(&pdev->dev, "punit ISP data res: %pR\n", res); 716 718 } 717 - /* This is index 2 to cover ISP data register */ 718 - *++punit_res = *res; 719 - dev_info(&pdev->dev, "punit ISP data res: %pR\n", res); 720 719 720 + /* This is index 3 to cover ISP interface register, optional */ 721 721 res = platform_get_resource(pdev, IORESOURCE_MEM, 722 722 PLAT_RESOURCE_ISP_IFACE_INDEX); 723 - if (!res) { 724 - dev_err(&pdev->dev, "Failed to get res of punit ISP iface\n"); 725 - return -ENXIO; 723 + ++punit_res; 724 + if (res) { 725 + *punit_res = *res; 726 + dev_info(&pdev->dev, "punit ISP interface res: %pR\n", res); 726 727 } 727 - /* This is index 3 to cover ISP interface register */ 728 - *++punit_res = *res; 729 - dev_info(&pdev->dev, "punit ISP interface res: %pR\n", res); 730 728 729 + /* This is index 4 to cover GTD data register, optional */ 731 730 res = platform_get_resource(pdev, IORESOURCE_MEM, 732 731 PLAT_RESOURCE_GTD_DATA_INDEX); 733 - if (!res) { 734 - dev_err(&pdev->dev, "Failed to get res of punit GTD data\n"); 735 - return -ENXIO; 732 + ++punit_res; 733 + if (res) { 734 + *punit_res = *res; 735 + dev_info(&pdev->dev, "punit GTD data res: %pR\n", res); 736 736 } 737 - /* This is index 4 to cover GTD data register */ 738 - *++punit_res = *res; 739 - dev_info(&pdev->dev, "punit GTD data res: %pR\n", res); 740 737 738 + /* This is index 5 to cover GTD interface register, optional */ 741 739 res = platform_get_resource(pdev, IORESOURCE_MEM, 742 740 PLAT_RESOURCE_GTD_IFACE_INDEX); 743 - if (!res) { 744 - dev_err(&pdev->dev, "Failed to get res of punit GTD iface\n"); 745 - return -ENXIO; 741 + ++punit_res; 742 + if (res) { 743 + *punit_res = *res; 744 + dev_info(&pdev->dev, "punit GTD interface res: %pR\n", res); 746 745 } 747 - /* This is index 5 to cover GTD interface register */ 748 - *++punit_res = *res; 749 - dev_info(&pdev->dev, "punit GTD interface res: %pR\n", res); 750 746 751 747 res = platform_get_resource(pdev, IORESOURCE_MEM, 752 748 PLAT_RESOURCE_IPC_INDEX);
+32 -16
drivers/platform/x86/intel_punit_ipc.c
··· 227 227 struct resource *res; 228 228 void __iomem *addr; 229 229 230 + /* 231 + * The following resources are required 232 + * - BIOS_IPC BASE_DATA 233 + * - BIOS_IPC BASE_IFACE 234 + */ 230 235 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 231 236 addr = devm_ioremap_resource(&pdev->dev, res); 232 237 if (IS_ERR(addr)) ··· 244 239 return PTR_ERR(addr); 245 240 punit_ipcdev->base[BIOS_IPC][BASE_IFACE] = addr; 246 241 242 + /* 243 + * The following resources are optional 244 + * - ISPDRIVER_IPC BASE_DATA 245 + * - ISPDRIVER_IPC BASE_IFACE 246 + * - GTDRIVER_IPC BASE_DATA 247 + * - GTDRIVER_IPC BASE_IFACE 248 + */ 247 249 res = platform_get_resource(pdev, IORESOURCE_MEM, 2); 248 - addr = devm_ioremap_resource(&pdev->dev, res); 249 - if (IS_ERR(addr)) 250 - return PTR_ERR(addr); 251 - punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr; 250 + if (res) { 251 + addr = devm_ioremap_resource(&pdev->dev, res); 252 + if (!IS_ERR(addr)) 253 + punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr; 254 + } 252 255 253 256 res = platform_get_resource(pdev, IORESOURCE_MEM, 3); 254 - addr = devm_ioremap_resource(&pdev->dev, res); 255 - if (IS_ERR(addr)) 256 - return PTR_ERR(addr); 257 - punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr; 257 + if (res) { 258 + addr = devm_ioremap_resource(&pdev->dev, res); 259 + if (!IS_ERR(addr)) 260 + punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr; 261 + } 258 262 259 263 res = platform_get_resource(pdev, IORESOURCE_MEM, 4); 260 - addr = devm_ioremap_resource(&pdev->dev, res); 261 - if (IS_ERR(addr)) 262 - return PTR_ERR(addr); 263 - punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr; 264 + if (res) { 265 + addr = devm_ioremap_resource(&pdev->dev, res); 266 + if (!IS_ERR(addr)) 267 + punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr; 268 + } 264 269 265 270 res = platform_get_resource(pdev, IORESOURCE_MEM, 5); 266 - addr = devm_ioremap_resource(&pdev->dev, res); 267 - if (IS_ERR(addr)) 268 - return PTR_ERR(addr); 269 - punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr; 271 + if (res) { 272 + addr = devm_ioremap_resource(&pdev->dev, res); 273 + if (!IS_ERR(addr)) 274 + punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr; 275 + } 270 276 271 277 return 0; 272 278 }
+1 -1
drivers/platform/x86/intel_telemetry_pltdrv.c
··· 659 659 static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period) 660 660 { 661 661 u32 telem_ctrl = 0; 662 - int ret; 662 + int ret = 0; 663 663 664 664 mutex_lock(&(telm_conf->telem_lock)); 665 665 if (ioss_period) {
+3 -1
drivers/platform/x86/thinkpad_acpi.c
··· 7972 7972 fan_update_desired_level(s); 7973 7973 mutex_unlock(&fan_mutex); 7974 7974 7975 + if (rc) 7976 + return rc; 7975 7977 if (status) 7976 7978 *status = s; 7977 7979 7978 - return rc; 7980 + return 0; 7979 7981 } 7980 7982 7981 7983 static int fan_get_speed(unsigned int *speed)
+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)
+3 -3
drivers/rtc/rtc-ds1307.c
··· 863 863 * A user-initiated temperature conversion is not started by this function, 864 864 * so the temperature is updated once every 64 seconds. 865 865 */ 866 - static int ds3231_hwmon_read_temp(struct device *dev, s16 *mC) 866 + static int ds3231_hwmon_read_temp(struct device *dev, s32 *mC) 867 867 { 868 868 struct ds1307 *ds1307 = dev_get_drvdata(dev); 869 869 u8 temp_buf[2]; ··· 892 892 struct device_attribute *attr, char *buf) 893 893 { 894 894 int ret; 895 - s16 temp; 895 + s32 temp; 896 896 897 897 ret = ds3231_hwmon_read_temp(dev, &temp); 898 898 if (ret) ··· 1531 1531 return PTR_ERR(ds1307->rtc); 1532 1532 } 1533 1533 1534 - if (ds1307_can_wakeup_device) { 1534 + if (ds1307_can_wakeup_device && ds1307->client->irq <= 0) { 1535 1535 /* Disable request for an IRQ */ 1536 1536 want_irq = false; 1537 1537 dev_info(&client->dev, "'wakeup-source' is set, request for an IRQ is disabled!\n");
+3 -2
drivers/s390/block/dcssblk.c
··· 756 756 blk_cleanup_queue(dev_info->dcssblk_queue); 757 757 dev_info->gd->queue = NULL; 758 758 put_disk(dev_info->gd); 759 - device_unregister(&dev_info->dev); 760 759 761 760 /* unload all related segments */ 762 761 list_for_each_entry(entry, &dev_info->seg_list, lh) 763 762 segment_unload(entry->segment_name); 764 763 765 - put_device(&dev_info->dev); 766 764 up_write(&dcssblk_devices_sem); 765 + 766 + device_unregister(&dev_info->dev); 767 + put_device(&dev_info->dev); 767 768 768 769 rc = count; 769 770 out_buf:
+1 -1
drivers/s390/block/scm_blk.c
··· 303 303 if (req->cmd_type != REQ_TYPE_FS) { 304 304 blk_start_request(req); 305 305 blk_dump_rq_flags(req, KMSG_COMPONENT " bad request"); 306 - blk_end_request_all(req, -EIO); 306 + __blk_end_request_all(req, -EIO); 307 307 continue; 308 308 } 309 309
+30 -33
drivers/tty/pty.c
··· 663 663 /* this is called once with whichever end is closed last */ 664 664 static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) 665 665 { 666 - struct inode *ptmx_inode; 666 + struct pts_fs_info *fsi; 667 667 668 668 if (tty->driver->subtype == PTY_TYPE_MASTER) 669 - ptmx_inode = tty->driver_data; 669 + fsi = tty->driver_data; 670 670 else 671 - ptmx_inode = tty->link->driver_data; 672 - devpts_kill_index(ptmx_inode, tty->index); 673 - devpts_del_ref(ptmx_inode); 671 + fsi = tty->link->driver_data; 672 + devpts_kill_index(fsi, tty->index); 673 + devpts_put_ref(fsi); 674 674 } 675 675 676 676 static const struct tty_operations ptm_unix98_ops = { ··· 720 720 721 721 static int ptmx_open(struct inode *inode, struct file *filp) 722 722 { 723 + struct pts_fs_info *fsi; 723 724 struct tty_struct *tty; 724 725 struct inode *slave_inode; 725 726 int retval; ··· 735 734 if (retval) 736 735 return retval; 737 736 737 + fsi = devpts_get_ref(inode, filp); 738 + retval = -ENODEV; 739 + if (!fsi) 740 + goto out_free_file; 741 + 738 742 /* find a device that is not in use. */ 739 743 mutex_lock(&devpts_mutex); 740 - index = devpts_new_index(inode); 741 - if (index < 0) { 742 - retval = index; 743 - mutex_unlock(&devpts_mutex); 744 - goto err_file; 745 - } 746 - 744 + index = devpts_new_index(fsi); 747 745 mutex_unlock(&devpts_mutex); 746 + 747 + retval = index; 748 + if (index < 0) 749 + goto out_put_ref; 750 + 748 751 749 752 mutex_lock(&tty_mutex); 750 753 tty = tty_init_dev(ptm_driver, index); 751 - 752 - if (IS_ERR(tty)) { 753 - retval = PTR_ERR(tty); 754 - goto out; 755 - } 756 - 757 754 /* The tty returned here is locked so we can safely 758 755 drop the mutex */ 759 756 mutex_unlock(&tty_mutex); 760 757 761 - set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ 762 - tty->driver_data = inode; 758 + retval = PTR_ERR(tty); 759 + if (IS_ERR(tty)) 760 + goto out; 763 761 764 762 /* 765 - * In the case where all references to ptmx inode are dropped and we 766 - * still have /dev/tty opened pointing to the master/slave pair (ptmx 767 - * is closed/released before /dev/tty), we must make sure that the inode 768 - * is still valid when we call the final pty_unix98_shutdown, thus we 769 - * hold an additional reference to the ptmx inode. For the same /dev/tty 770 - * last close case, we also need to make sure the super_block isn't 771 - * destroyed (devpts instance unmounted), before /dev/tty is closed and 772 - * on its release devpts_kill_index is called. 763 + * From here on out, the tty is "live", and the index and 764 + * fsi will be killed/put by the tty_release() 773 765 */ 774 - devpts_add_ref(inode); 766 + set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ 767 + tty->driver_data = fsi; 775 768 776 769 tty_add_file(tty, filp); 777 770 778 - slave_inode = devpts_pty_new(inode, 771 + slave_inode = devpts_pty_new(fsi, 779 772 MKDEV(UNIX98_PTY_SLAVE_MAJOR, index), index, 780 773 tty->link); 781 774 if (IS_ERR(slave_inode)) { ··· 788 793 return 0; 789 794 err_release: 790 795 tty_unlock(tty); 796 + // This will also put-ref the fsi 791 797 tty_release(inode, filp); 792 798 return retval; 793 799 out: 794 - mutex_unlock(&tty_mutex); 795 - devpts_kill_index(inode, index); 796 - err_file: 800 + devpts_kill_index(fsi, index); 801 + out_put_ref: 802 + devpts_put_ref(fsi); 803 + out_free_file: 797 804 tty_free_file(filp); 798 805 return retval; 799 806 }
+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;
+8 -7
drivers/video/fbdev/amba-clcd.c
··· 440 440 fb->off_ienb = CLCD_PL111_IENB; 441 441 fb->off_cntl = CLCD_PL111_CNTL; 442 442 } else { 443 - #ifdef CONFIG_ARCH_VERSATILE 444 - fb->off_ienb = CLCD_PL111_IENB; 445 - fb->off_cntl = CLCD_PL111_CNTL; 446 - #else 447 - fb->off_ienb = CLCD_PL110_IENB; 448 - fb->off_cntl = CLCD_PL110_CNTL; 449 - #endif 443 + if (of_machine_is_compatible("arm,versatile-ab") || 444 + of_machine_is_compatible("arm,versatile-pb")) { 445 + fb->off_ienb = CLCD_PL111_IENB; 446 + fb->off_cntl = CLCD_PL111_CNTL; 447 + } else { 448 + fb->off_ienb = CLCD_PL110_IENB; 449 + fb->off_cntl = CLCD_PL110_CNTL; 450 + } 450 451 } 451 452 452 453 fb->clk = clk_get(&fb->dev->dev, NULL);
+4 -8
drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c
··· 200 200 static int sharp_ls_get_gpio(struct device *dev, int gpio, unsigned long flags, 201 201 char *desc, struct gpio_desc **gpiod) 202 202 { 203 - struct gpio_desc *gd; 204 203 int r; 205 204 206 - *gpiod = NULL; 207 - 208 205 r = devm_gpio_request_one(dev, gpio, flags, desc); 209 - if (r) 206 + if (r) { 207 + *gpiod = NULL; 210 208 return r == -ENOENT ? 0 : r; 209 + } 211 210 212 - gd = gpio_to_desc(gpio); 213 - if (IS_ERR(gd)) 214 - return PTR_ERR(gd) == -ENOENT ? 0 : PTR_ERR(gd); 211 + *gpiod = gpio_to_desc(gpio); 215 212 216 - *gpiod = gd; 217 213 return 0; 218 214 } 219 215
+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;
+24 -25
fs/devpts/inode.c
··· 128 128 struct pts_fs_info { 129 129 struct ida allocated_ptys; 130 130 struct pts_mount_opts mount_opts; 131 + struct super_block *sb; 131 132 struct dentry *ptmx_dentry; 132 133 }; 133 134 ··· 359 358 .show_options = devpts_show_options, 360 359 }; 361 360 362 - static void *new_pts_fs_info(void) 361 + static void *new_pts_fs_info(struct super_block *sb) 363 362 { 364 363 struct pts_fs_info *fsi; 365 364 ··· 370 369 ida_init(&fsi->allocated_ptys); 371 370 fsi->mount_opts.mode = DEVPTS_DEFAULT_MODE; 372 371 fsi->mount_opts.ptmxmode = DEVPTS_DEFAULT_PTMX_MODE; 372 + fsi->sb = sb; 373 373 374 374 return fsi; 375 375 } ··· 386 384 s->s_op = &devpts_sops; 387 385 s->s_time_gran = 1; 388 386 389 - s->s_fs_info = new_pts_fs_info(); 387 + s->s_fs_info = new_pts_fs_info(s); 390 388 if (!s->s_fs_info) 391 389 goto fail; 392 390 ··· 526 524 * to the System V naming convention 527 525 */ 528 526 529 - int devpts_new_index(struct inode *ptmx_inode) 527 + int devpts_new_index(struct pts_fs_info *fsi) 530 528 { 531 - struct super_block *sb = pts_sb_from_inode(ptmx_inode); 532 - struct pts_fs_info *fsi; 533 529 int index; 534 530 int ida_ret; 535 531 536 - if (!sb) 532 + if (!fsi) 537 533 return -ENODEV; 538 534 539 - fsi = DEVPTS_SB(sb); 540 535 retry: 541 536 if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL)) 542 537 return -ENOMEM; ··· 563 564 return index; 564 565 } 565 566 566 - void devpts_kill_index(struct inode *ptmx_inode, int idx) 567 + void devpts_kill_index(struct pts_fs_info *fsi, int idx) 567 568 { 568 - struct super_block *sb = pts_sb_from_inode(ptmx_inode); 569 - struct pts_fs_info *fsi = DEVPTS_SB(sb); 570 - 571 569 mutex_lock(&allocated_ptys_lock); 572 570 ida_remove(&fsi->allocated_ptys, idx); 573 571 pty_count--; ··· 574 578 /* 575 579 * pty code needs to hold extra references in case of last /dev/tty close 576 580 */ 577 - 578 - void devpts_add_ref(struct inode *ptmx_inode) 581 + struct pts_fs_info *devpts_get_ref(struct inode *ptmx_inode, struct file *file) 579 582 { 580 - struct super_block *sb = pts_sb_from_inode(ptmx_inode); 583 + struct super_block *sb; 584 + struct pts_fs_info *fsi; 585 + 586 + sb = pts_sb_from_inode(ptmx_inode); 587 + if (!sb) 588 + return NULL; 589 + fsi = DEVPTS_SB(sb); 590 + if (!fsi) 591 + return NULL; 581 592 582 593 atomic_inc(&sb->s_active); 583 - ihold(ptmx_inode); 594 + return fsi; 584 595 } 585 596 586 - void devpts_del_ref(struct inode *ptmx_inode) 597 + void devpts_put_ref(struct pts_fs_info *fsi) 587 598 { 588 - struct super_block *sb = pts_sb_from_inode(ptmx_inode); 589 - 590 - iput(ptmx_inode); 591 - deactivate_super(sb); 599 + deactivate_super(fsi->sb); 592 600 } 593 601 594 602 /** ··· 604 604 * 605 605 * The created inode is returned. Remove it from /dev/pts/ by devpts_pty_kill. 606 606 */ 607 - struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, 607 + struct inode *devpts_pty_new(struct pts_fs_info *fsi, dev_t device, int index, 608 608 void *priv) 609 609 { 610 610 struct dentry *dentry; 611 - struct super_block *sb = pts_sb_from_inode(ptmx_inode); 611 + struct super_block *sb; 612 612 struct inode *inode; 613 613 struct dentry *root; 614 - struct pts_fs_info *fsi; 615 614 struct pts_mount_opts *opts; 616 615 char s[12]; 617 616 618 - if (!sb) 617 + if (!fsi) 619 618 return ERR_PTR(-ENODEV); 620 619 620 + sb = fsi->sb; 621 621 root = sb->s_root; 622 - fsi = DEVPTS_SB(sb); 623 622 opts = &fsi->mount_opts; 624 623 625 624 inode = new_inode(sb);
+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))) {
-5
fs/ext4/dir.c
··· 150 150 while (ctx->pos < inode->i_size) { 151 151 struct ext4_map_blocks map; 152 152 153 - if (fatal_signal_pending(current)) { 154 - err = -ERESTARTSYS; 155 - goto errout; 156 - } 157 - cond_resched(); 158 153 map.m_lblk = ctx->pos >> EXT4_BLOCK_SIZE_BITS(sb); 159 154 map.m_len = 1; 160 155 err = ext4_map_blocks(NULL, inode, &map, 0);
-5
fs/ext4/namei.c
··· 1107 1107 } 1108 1108 1109 1109 while (1) { 1110 - if (signal_pending(current)) { 1111 - err = -ERESTARTSYS; 1112 - goto errout; 1113 - } 1114 - cond_resched(); 1115 1110 block = dx_get_block(frame->at); 1116 1111 ret = htree_dirblock_to_tree(dir_file, dir, block, &hinfo, 1117 1112 start_hash, start_minor_hash);
+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
+10 -24
include/linux/devpts_fs.h
··· 15 15 16 16 #include <linux/errno.h> 17 17 18 + struct pts_fs_info; 19 + 18 20 #ifdef CONFIG_UNIX98_PTYS 19 21 20 - int devpts_new_index(struct inode *ptmx_inode); 21 - void devpts_kill_index(struct inode *ptmx_inode, int idx); 22 - void devpts_add_ref(struct inode *ptmx_inode); 23 - void devpts_del_ref(struct inode *ptmx_inode); 22 + /* Look up a pts fs info and get a ref to it */ 23 + struct pts_fs_info *devpts_get_ref(struct inode *, struct file *); 24 + void devpts_put_ref(struct pts_fs_info *); 25 + 26 + int devpts_new_index(struct pts_fs_info *); 27 + void devpts_kill_index(struct pts_fs_info *, int); 28 + 24 29 /* mknod in devpts */ 25 - struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, 26 - void *priv); 30 + struct inode *devpts_pty_new(struct pts_fs_info *, dev_t, int, void *); 27 31 /* get private structure */ 28 32 void *devpts_get_priv(struct inode *pts_inode); 29 33 /* unlink */ 30 34 void devpts_pty_kill(struct inode *inode); 31 - 32 - #else 33 - 34 - /* Dummy stubs in the no-pty case */ 35 - static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } 36 - static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } 37 - static inline void devpts_add_ref(struct inode *ptmx_inode) { } 38 - static inline void devpts_del_ref(struct inode *ptmx_inode) { } 39 - static inline struct inode *devpts_pty_new(struct inode *ptmx_inode, 40 - dev_t device, int index, void *priv) 41 - { 42 - return ERR_PTR(-EINVAL); 43 - } 44 - static inline void *devpts_get_priv(struct inode *pts_inode) 45 - { 46 - return NULL; 47 - } 48 - static inline void devpts_pty_kill(struct inode *inode) { } 49 35 50 36 #endif 51 37
+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 }
+7
include/linux/mlx4/device.h
··· 828 828 u8 n_ports; 829 829 }; 830 830 831 + enum mlx4_pci_status { 832 + MLX4_PCI_STATUS_DISABLED, 833 + MLX4_PCI_STATUS_ENABLED, 834 + }; 835 + 831 836 struct mlx4_dev_persistent { 832 837 struct pci_dev *pdev; 833 838 struct mlx4_dev *dev; ··· 846 841 u8 state; 847 842 struct mutex interface_state_mutex; /* protect SW state */ 848 843 u8 interface_state; 844 + struct mutex pci_status_mutex; /* sync pci state */ 845 + enum mlx4_pci_status pci_status; 849 846 }; 850 847 851 848 struct mlx4_dev {
+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 {
+1
include/linux/pci.h
··· 1111 1111 /* Vital product data routines */ 1112 1112 ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 1113 1113 ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); 1114 + int pci_set_vpd_size(struct pci_dev *dev, size_t len); 1114 1115 1115 1116 /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ 1116 1117 resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx);
+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 /**
+36
include/linux/rculist.h
··· 488 488 } 489 489 490 490 /** 491 + * hlist_add_tail_rcu 492 + * @n: the element to add to the hash list. 493 + * @h: the list to add to. 494 + * 495 + * Description: 496 + * Adds the specified element to the specified hlist, 497 + * while permitting racing traversals. 498 + * 499 + * The caller must take whatever precautions are necessary 500 + * (such as holding appropriate locks) to avoid racing 501 + * with another list-mutation primitive, such as hlist_add_head_rcu() 502 + * or hlist_del_rcu(), running on this same list. 503 + * However, it is perfectly legal to run concurrently with 504 + * the _rcu list-traversal primitives, such as 505 + * hlist_for_each_entry_rcu(), used to prevent memory-consistency 506 + * problems on Alpha CPUs. Regardless of the type of CPU, the 507 + * list-traversal primitive must be guarded by rcu_read_lock(). 508 + */ 509 + static inline void hlist_add_tail_rcu(struct hlist_node *n, 510 + struct hlist_head *h) 511 + { 512 + struct hlist_node *i, *last = NULL; 513 + 514 + for (i = hlist_first_rcu(h); i; i = hlist_next_rcu(i)) 515 + last = i; 516 + 517 + if (last) { 518 + n->next = last->next; 519 + n->pprev = &last->next; 520 + rcu_assign_pointer(hlist_next_rcu(last), n); 521 + } else { 522 + hlist_add_head_rcu(n, h); 523 + } 524 + } 525 + 526 + /** 491 527 * hlist_add_before_rcu 492 528 * @n: the new element to add to the hash list. 493 529 * @next: the existing element to add the new element before.
+39
include/linux/rculist_nulls.h
··· 98 98 if (!is_a_nulls(first)) 99 99 first->pprev = &n->next; 100 100 } 101 + 102 + /** 103 + * hlist_nulls_add_tail_rcu 104 + * @n: the element to add to the hash list. 105 + * @h: the list to add to. 106 + * 107 + * Description: 108 + * Adds the specified element to the end of the specified hlist_nulls, 109 + * while permitting racing traversals. NOTE: tail insertion requires 110 + * list traversal. 111 + * 112 + * The caller must take whatever precautions are necessary 113 + * (such as holding appropriate locks) to avoid racing 114 + * with another list-mutation primitive, such as hlist_nulls_add_head_rcu() 115 + * or hlist_nulls_del_rcu(), running on this same list. 116 + * However, it is perfectly legal to run concurrently with 117 + * the _rcu list-traversal primitives, such as 118 + * hlist_nulls_for_each_entry_rcu(), used to prevent memory-consistency 119 + * problems on Alpha CPUs. Regardless of the type of CPU, the 120 + * list-traversal primitive must be guarded by rcu_read_lock(). 121 + */ 122 + static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n, 123 + struct hlist_nulls_head *h) 124 + { 125 + struct hlist_nulls_node *i, *last = NULL; 126 + 127 + for (i = hlist_nulls_first_rcu(h); !is_a_nulls(i); 128 + i = hlist_nulls_next_rcu(i)) 129 + last = i; 130 + 131 + if (last) { 132 + n->next = last->next; 133 + n->pprev = &last->next; 134 + rcu_assign_pointer(hlist_nulls_next_rcu(last), n); 135 + } else { 136 + hlist_nulls_add_head_rcu(n, h); 137 + } 138 + } 139 + 101 140 /** 102 141 * hlist_nulls_for_each_entry_rcu - iterate over rcu list of given type 103 142 * @tpos: the type * to use as a loop cursor.
+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 };
+5 -2
include/net/cls_cgroup.h
··· 17 17 #include <linux/hardirq.h> 18 18 #include <linux/rcupdate.h> 19 19 #include <net/sock.h> 20 + #include <net/inet_sock.h> 20 21 21 22 #ifdef CONFIG_CGROUP_NET_CLASSID 22 23 struct cgroup_cls_state { ··· 64 63 * softirqs always disables bh. 65 64 */ 66 65 if (in_serving_softirq()) { 66 + struct sock *sk = skb_to_full_sk(skb); 67 + 67 68 /* If there is an sock_cgroup_classid we'll use that. */ 68 - if (!skb->sk) 69 + if (!sk || !sk_fullsock(sk)) 69 70 return 0; 70 71 71 - classid = sock_cgroup_classid(&skb->sk->sk_cgrp_data); 72 + classid = sock_cgroup_classid(&sk->sk_cgrp_data); 72 73 } 73 74 74 75 return classid;
+3
include/net/ip6_route.h
··· 101 101 struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, 102 102 const struct in6_addr *addr, bool anycast); 103 103 104 + struct rt6_info *ip6_dst_alloc(struct net *net, struct net_device *dev, 105 + int flags); 106 + 104 107 /* 105 108 * support functions for ND 106 109 *
+2
include/net/ipv6.h
··· 961 961 int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); 962 962 int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr, 963 963 int addr_len); 964 + int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr); 965 + void ip6_datagram_release_cb(struct sock *sk); 964 966 965 967 int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, 966 968 int *addr_len);
+3
include/net/route.h
··· 209 209 void ip_rt_multicast_event(struct in_device *); 210 210 int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); 211 211 void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); 212 + struct rtable *rt_dst_alloc(struct net_device *dev, 213 + unsigned int flags, u16 type, 214 + bool nopolicy, bool noxfrm, bool will_cache); 212 215 213 216 struct in_ifaddr; 214 217 void fib_add_ifaddr(struct in_ifaddr *);
+7 -1
include/net/sctp/structs.h
··· 848 848 */ 849 849 ktime_t last_time_heard; 850 850 851 + /* When was the last time that we sent a chunk using this 852 + * transport? We use this to check for idle transports 853 + */ 854 + unsigned long last_time_sent; 855 + 851 856 /* Last time(in jiffies) when cwnd is reduced due to the congestion 852 857 * indication based on ECNE chunk. 853 858 */ ··· 958 953 struct sctp_sock *); 959 954 void sctp_transport_pmtu(struct sctp_transport *, struct sock *sk); 960 955 void sctp_transport_free(struct sctp_transport *); 961 - void sctp_transport_reset_timers(struct sctp_transport *); 956 + void sctp_transport_reset_t3_rtx(struct sctp_transport *); 957 + void sctp_transport_reset_hb_timer(struct sctp_transport *); 962 958 int sctp_transport_hold(struct sctp_transport *); 963 959 void sctp_transport_put(struct sctp_transport *); 964 960 void sctp_transport_update_rto(struct sctp_transport *, __u32);
+5 -1
include/net/sock.h
··· 635 635 636 636 static inline void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) 637 637 { 638 - hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list); 638 + if (IS_ENABLED(CONFIG_IPV6) && sk->sk_reuseport && 639 + sk->sk_family == AF_INET6) 640 + hlist_nulls_add_tail_rcu(&sk->sk_nulls_node, list); 641 + else 642 + hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list); 639 643 } 640 644 641 645 static inline void sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
+2
include/net/tcp.h
··· 557 557 void tcp_send_delayed_ack(struct sock *sk); 558 558 void tcp_send_loss_probe(struct sock *sk); 559 559 bool tcp_schedule_loss_probe(struct sock *sk); 560 + void tcp_skb_collapse_tstamp(struct sk_buff *skb, 561 + const struct sk_buff *next_skb); 560 562 561 563 /* tcp_input.c */ 562 564 void tcp_resume_early_retransmit(struct sock *sk);
+1
include/uapi/linux/Kbuild
··· 96 96 header-y += cycx_cfm.h 97 97 header-y += dcbnl.h 98 98 header-y += dccp.h 99 + header-y += devlink.h 99 100 header-y += dlmconstants.h 100 101 header-y += dlm_device.h 101 102 header-y += dlm.h
+1
kernel/bpf/verifier.c
··· 1434 1434 } 1435 1435 1436 1436 if (insn->dst_reg != BPF_REG_0 || insn->off != 0 || 1437 + BPF_SIZE(insn->code) == BPF_DW || 1437 1438 (mode == BPF_ABS && insn->src_reg != BPF_REG_0)) { 1438 1439 verbose("BPF_LD_ABS uses reserved fields\n"); 1439 1440 return -EINVAL;
+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 -
+5 -1
net/bridge/netfilter/ebtables.c
··· 370 370 left - sizeof(struct ebt_entry_match) < m->match_size) 371 371 return -EINVAL; 372 372 373 - match = xt_request_find_match(NFPROTO_BRIDGE, m->u.name, 0); 373 + match = xt_find_match(NFPROTO_BRIDGE, m->u.name, 0); 374 + if (IS_ERR(match) || match->family != NFPROTO_BRIDGE) { 375 + request_module("ebt_%s", m->u.name); 376 + match = xt_find_match(NFPROTO_BRIDGE, m->u.name, 0); 377 + } 374 378 if (IS_ERR(match)) 375 379 return PTR_ERR(match); 376 380 m->u.match = match;
+5 -2
net/core/skbuff.c
··· 4529 4529 __skb_push(skb, offset); 4530 4530 err = __vlan_insert_tag(skb, skb->vlan_proto, 4531 4531 skb_vlan_tag_get(skb)); 4532 - if (err) 4532 + if (err) { 4533 + __skb_pull(skb, offset); 4533 4534 return err; 4535 + } 4536 + 4534 4537 skb->protocol = skb->vlan_proto; 4535 4538 skb->mac_len += VLAN_HLEN; 4536 - __skb_pull(skb, offset); 4537 4539 4538 4540 skb_postpush_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN); 4541 + __skb_pull(skb, offset); 4539 4542 } 4540 4543 __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci); 4541 4544 return 0;
+8 -1
net/decnet/dn_route.c
··· 1034 1034 if (!fld.daddr) { 1035 1035 fld.daddr = fld.saddr; 1036 1036 1037 - err = -EADDRNOTAVAIL; 1038 1037 if (dev_out) 1039 1038 dev_put(dev_out); 1039 + err = -EINVAL; 1040 1040 dev_out = init_net.loopback_dev; 1041 + if (!dev_out->dn_ptr) 1042 + goto out; 1043 + err = -EADDRNOTAVAIL; 1041 1044 dev_hold(dev_out); 1042 1045 if (!fld.daddr) { 1043 1046 fld.daddr = ··· 1113 1110 if (dev_out == NULL) 1114 1111 goto out; 1115 1112 dn_db = rcu_dereference_raw(dev_out->dn_ptr); 1113 + if (!dn_db) 1114 + goto e_inval; 1116 1115 /* Possible improvement - check all devices for local addr */ 1117 1116 if (dn_dev_islocal(dev_out, fld.daddr)) { 1118 1117 dev_put(dev_out); ··· 1156 1151 dev_put(dev_out); 1157 1152 dev_out = init_net.loopback_dev; 1158 1153 dev_hold(dev_out); 1154 + if (!dev_out->dn_ptr) 1155 + goto e_inval; 1159 1156 fld.flowidn_oif = dev_out->ifindex; 1160 1157 if (res.fi) 1161 1158 dn_fib_info_put(res.fi);
+6
net/ipv4/netfilter/arptable_filter.c
··· 81 81 return ret; 82 82 } 83 83 84 + ret = arptable_filter_table_init(&init_net); 85 + if (ret) { 86 + unregister_pernet_subsys(&arptable_filter_net_ops); 87 + kfree(arpfilter_ops); 88 + } 89 + 84 90 return ret; 85 91 } 86 92
+16 -3
net/ipv4/route.c
··· 1438 1438 #endif 1439 1439 } 1440 1440 1441 - static struct rtable *rt_dst_alloc(struct net_device *dev, 1442 - unsigned int flags, u16 type, 1443 - bool nopolicy, bool noxfrm, bool will_cache) 1441 + struct rtable *rt_dst_alloc(struct net_device *dev, 1442 + unsigned int flags, u16 type, 1443 + bool nopolicy, bool noxfrm, bool will_cache) 1444 1444 { 1445 1445 struct rtable *rt; 1446 1446 ··· 1468 1468 1469 1469 return rt; 1470 1470 } 1471 + EXPORT_SYMBOL(rt_dst_alloc); 1471 1472 1472 1473 /* called in rcu_read_lock() section */ 1473 1474 static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, ··· 2046 2045 */ 2047 2046 if (fi && res->prefixlen < 4) 2048 2047 fi = NULL; 2048 + } else if ((type == RTN_LOCAL) && (orig_oif != 0) && 2049 + (orig_oif != dev_out->ifindex)) { 2050 + /* For local routes that require a particular output interface 2051 + * we do not want to cache the result. Caching the result 2052 + * causes incorrect behaviour when there are multiple source 2053 + * addresses on the interface, the end result being that if the 2054 + * intended recipient is waiting on that interface for the 2055 + * packet he won't receive it because it will be delivered on 2056 + * the loopback interface and the IP_PKTINFO ipi_ifindex will 2057 + * be set to the loopback interface as well. 2058 + */ 2059 + fi = NULL; 2049 2060 } 2050 2061 2051 2062 fnhe = NULL;
+3 -1
net/ipv4/tcp_input.c
··· 1309 1309 if (skb == tcp_highest_sack(sk)) 1310 1310 tcp_advance_highest_sack(sk, skb); 1311 1311 1312 + tcp_skb_collapse_tstamp(prev, skb); 1312 1313 tcp_unlink_write_queue(skb, sk); 1313 1314 sk_wmem_free_skb(sk, skb); 1314 1315 ··· 3088 3087 3089 3088 shinfo = skb_shinfo(skb); 3090 3089 if ((shinfo->tx_flags & SKBTX_ACK_TSTAMP) && 3091 - between(shinfo->tskey, prior_snd_una, tcp_sk(sk)->snd_una - 1)) 3090 + !before(shinfo->tskey, prior_snd_una) && 3091 + before(shinfo->tskey, tcp_sk(sk)->snd_una)) 3092 3092 __skb_tstamp_tx(skb, NULL, sk, SCM_TSTAMP_ACK); 3093 3093 } 3094 3094
+16
net/ipv4/tcp_output.c
··· 2441 2441 return window; 2442 2442 } 2443 2443 2444 + void tcp_skb_collapse_tstamp(struct sk_buff *skb, 2445 + const struct sk_buff *next_skb) 2446 + { 2447 + const struct skb_shared_info *next_shinfo = skb_shinfo(next_skb); 2448 + u8 tsflags = next_shinfo->tx_flags & SKBTX_ANY_TSTAMP; 2449 + 2450 + if (unlikely(tsflags)) { 2451 + struct skb_shared_info *shinfo = skb_shinfo(skb); 2452 + 2453 + shinfo->tx_flags |= tsflags; 2454 + shinfo->tskey = next_shinfo->tskey; 2455 + } 2456 + } 2457 + 2444 2458 /* Collapses two adjacent SKB's during retransmission. */ 2445 2459 static void tcp_collapse_retrans(struct sock *sk, struct sk_buff *skb) 2446 2460 { ··· 2497 2483 tp->retransmit_skb_hint = skb; 2498 2484 2499 2485 tcp_adjust_pcount(sk, next_skb, tcp_skb_pcount(next_skb)); 2486 + 2487 + tcp_skb_collapse_tstamp(skb, next_skb); 2500 2488 2501 2489 sk_wmem_free_skb(sk, next_skb); 2502 2490 }
+7 -2
net/ipv4/udp.c
··· 336 336 337 337 hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash); 338 338 spin_lock(&hslot2->lock); 339 - hlist_add_head_rcu(&udp_sk(sk)->udp_portaddr_node, 340 - &hslot2->head); 339 + if (IS_ENABLED(CONFIG_IPV6) && sk->sk_reuseport && 340 + sk->sk_family == AF_INET6) 341 + hlist_add_tail_rcu(&udp_sk(sk)->udp_portaddr_node, 342 + &hslot2->head); 343 + else 344 + hlist_add_head_rcu(&udp_sk(sk)->udp_portaddr_node, 345 + &hslot2->head); 341 346 hslot2->count++; 342 347 spin_unlock(&hslot2->lock); 343 348 }
+20 -2
net/ipv6/addrconf.c
··· 3254 3254 void *ptr) 3255 3255 { 3256 3256 struct net_device *dev = netdev_notifier_info_to_dev(ptr); 3257 + struct netdev_notifier_changeupper_info *info; 3257 3258 struct inet6_dev *idev = __in6_dev_get(dev); 3258 3259 int run_pending = 0; 3259 3260 int err; ··· 3413 3412 if (idev) 3414 3413 addrconf_type_change(dev, event); 3415 3414 break; 3415 + 3416 + case NETDEV_CHANGEUPPER: 3417 + info = ptr; 3418 + 3419 + /* flush all routes if dev is linked to or unlinked from 3420 + * an L3 master device (e.g., VRF) 3421 + */ 3422 + if (info->upper_dev && netif_is_l3_master(info->upper_dev)) 3423 + addrconf_ifdown(dev, 0); 3416 3424 } 3417 3425 3418 3426 return NOTIFY_OK; ··· 3445 3435 ipv6_mc_remap(idev); 3446 3436 else if (event == NETDEV_PRE_TYPE_CHANGE) 3447 3437 ipv6_mc_unmap(idev); 3438 + } 3439 + 3440 + static bool addr_is_local(const struct in6_addr *addr) 3441 + { 3442 + return ipv6_addr_type(addr) & 3443 + (IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK); 3448 3444 } 3449 3445 3450 3446 static int addrconf_ifdown(struct net_device *dev, int how) ··· 3510 3494 * address is retained on a down event 3511 3495 */ 3512 3496 if (!keep_addr || 3513 - !(ifa->flags & IFA_F_PERMANENT)) { 3497 + !(ifa->flags & IFA_F_PERMANENT) || 3498 + addr_is_local(&ifa->addr)) { 3514 3499 hlist_del_init_rcu(&ifa->addr_lst); 3515 3500 goto restart; 3516 3501 } ··· 3560 3543 write_unlock_bh(&idev->lock); 3561 3544 spin_lock_bh(&ifa->lock); 3562 3545 3563 - if (keep_addr && (ifa->flags & IFA_F_PERMANENT)) { 3546 + if (keep_addr && (ifa->flags & IFA_F_PERMANENT) && 3547 + !addr_is_local(&ifa->addr)) { 3564 3548 /* set state to skip the notifier below */ 3565 3549 state = INET6_IFADDR_STATE_DEAD; 3566 3550 ifa->state = 0;
+106 -63
net/ipv6/datagram.c
··· 40 40 return ipv6_addr_v4mapped(a) && (a->s6_addr32[3] == 0); 41 41 } 42 42 43 + static void ip6_datagram_flow_key_init(struct flowi6 *fl6, struct sock *sk) 44 + { 45 + struct inet_sock *inet = inet_sk(sk); 46 + struct ipv6_pinfo *np = inet6_sk(sk); 47 + 48 + memset(fl6, 0, sizeof(*fl6)); 49 + fl6->flowi6_proto = sk->sk_protocol; 50 + fl6->daddr = sk->sk_v6_daddr; 51 + fl6->saddr = np->saddr; 52 + fl6->flowi6_oif = sk->sk_bound_dev_if; 53 + fl6->flowi6_mark = sk->sk_mark; 54 + fl6->fl6_dport = inet->inet_dport; 55 + fl6->fl6_sport = inet->inet_sport; 56 + fl6->flowlabel = np->flow_label; 57 + 58 + if (!fl6->flowi6_oif) 59 + fl6->flowi6_oif = np->sticky_pktinfo.ipi6_ifindex; 60 + 61 + if (!fl6->flowi6_oif && ipv6_addr_is_multicast(&fl6->daddr)) 62 + fl6->flowi6_oif = np->mcast_oif; 63 + 64 + security_sk_classify_flow(sk, flowi6_to_flowi(fl6)); 65 + } 66 + 67 + int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr) 68 + { 69 + struct ip6_flowlabel *flowlabel = NULL; 70 + struct in6_addr *final_p, final; 71 + struct ipv6_txoptions *opt; 72 + struct dst_entry *dst; 73 + struct inet_sock *inet = inet_sk(sk); 74 + struct ipv6_pinfo *np = inet6_sk(sk); 75 + struct flowi6 fl6; 76 + int err = 0; 77 + 78 + if (np->sndflow && (np->flow_label & IPV6_FLOWLABEL_MASK)) { 79 + flowlabel = fl6_sock_lookup(sk, np->flow_label); 80 + if (!flowlabel) 81 + return -EINVAL; 82 + } 83 + ip6_datagram_flow_key_init(&fl6, sk); 84 + 85 + rcu_read_lock(); 86 + opt = flowlabel ? flowlabel->opt : rcu_dereference(np->opt); 87 + final_p = fl6_update_dst(&fl6, opt, &final); 88 + rcu_read_unlock(); 89 + 90 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p); 91 + if (IS_ERR(dst)) { 92 + err = PTR_ERR(dst); 93 + goto out; 94 + } 95 + 96 + if (fix_sk_saddr) { 97 + if (ipv6_addr_any(&np->saddr)) 98 + np->saddr = fl6.saddr; 99 + 100 + if (ipv6_addr_any(&sk->sk_v6_rcv_saddr)) { 101 + sk->sk_v6_rcv_saddr = fl6.saddr; 102 + inet->inet_rcv_saddr = LOOPBACK4_IPV6; 103 + if (sk->sk_prot->rehash) 104 + sk->sk_prot->rehash(sk); 105 + } 106 + } 107 + 108 + ip6_dst_store(sk, dst, 109 + ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ? 110 + &sk->sk_v6_daddr : NULL, 111 + #ifdef CONFIG_IPV6_SUBTREES 112 + ipv6_addr_equal(&fl6.saddr, &np->saddr) ? 113 + &np->saddr : 114 + #endif 115 + NULL); 116 + 117 + out: 118 + fl6_sock_release(flowlabel); 119 + return err; 120 + } 121 + 122 + void ip6_datagram_release_cb(struct sock *sk) 123 + { 124 + struct dst_entry *dst; 125 + 126 + if (ipv6_addr_v4mapped(&sk->sk_v6_daddr)) 127 + return; 128 + 129 + rcu_read_lock(); 130 + dst = __sk_dst_get(sk); 131 + if (!dst || !dst->obsolete || 132 + dst->ops->check(dst, inet6_sk(sk)->dst_cookie)) { 133 + rcu_read_unlock(); 134 + return; 135 + } 136 + rcu_read_unlock(); 137 + 138 + ip6_datagram_dst_update(sk, false); 139 + } 140 + EXPORT_SYMBOL_GPL(ip6_datagram_release_cb); 141 + 43 142 static int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) 44 143 { 45 144 struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; 46 145 struct inet_sock *inet = inet_sk(sk); 47 146 struct ipv6_pinfo *np = inet6_sk(sk); 48 - struct in6_addr *daddr, *final_p, final; 49 - struct dst_entry *dst; 50 - struct flowi6 fl6; 51 - struct ip6_flowlabel *flowlabel = NULL; 52 - struct ipv6_txoptions *opt; 147 + struct in6_addr *daddr; 53 148 int addr_type; 54 149 int err; 150 + __be32 fl6_flowlabel = 0; 55 151 56 152 if (usin->sin6_family == AF_INET) { 57 153 if (__ipv6_only_sock(sk)) ··· 162 66 if (usin->sin6_family != AF_INET6) 163 67 return -EAFNOSUPPORT; 164 68 165 - memset(&fl6, 0, sizeof(fl6)); 166 - if (np->sndflow) { 167 - fl6.flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK; 168 - if (fl6.flowlabel&IPV6_FLOWLABEL_MASK) { 169 - flowlabel = fl6_sock_lookup(sk, fl6.flowlabel); 170 - if (!flowlabel) 171 - return -EINVAL; 172 - } 173 - } 69 + if (np->sndflow) 70 + fl6_flowlabel = usin->sin6_flowinfo & IPV6_FLOWINFO_MASK; 174 71 175 72 addr_type = ipv6_addr_type(&usin->sin6_addr); 176 73 ··· 234 145 } 235 146 236 147 sk->sk_v6_daddr = *daddr; 237 - np->flow_label = fl6.flowlabel; 148 + np->flow_label = fl6_flowlabel; 238 149 239 150 inet->inet_dport = usin->sin6_port; 240 151 ··· 243 154 * destination cache for it. 244 155 */ 245 156 246 - fl6.flowi6_proto = sk->sk_protocol; 247 - fl6.daddr = sk->sk_v6_daddr; 248 - fl6.saddr = np->saddr; 249 - fl6.flowi6_oif = sk->sk_bound_dev_if; 250 - fl6.flowi6_mark = sk->sk_mark; 251 - fl6.fl6_dport = inet->inet_dport; 252 - fl6.fl6_sport = inet->inet_sport; 253 - 254 - if (!fl6.flowi6_oif) 255 - fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex; 256 - 257 - if (!fl6.flowi6_oif && (addr_type&IPV6_ADDR_MULTICAST)) 258 - fl6.flowi6_oif = np->mcast_oif; 259 - 260 - security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); 261 - 262 - rcu_read_lock(); 263 - opt = flowlabel ? flowlabel->opt : rcu_dereference(np->opt); 264 - final_p = fl6_update_dst(&fl6, opt, &final); 265 - rcu_read_unlock(); 266 - 267 - dst = ip6_dst_lookup_flow(sk, &fl6, final_p); 268 - err = 0; 269 - if (IS_ERR(dst)) { 270 - err = PTR_ERR(dst); 157 + err = ip6_datagram_dst_update(sk, true); 158 + if (err) 271 159 goto out; 272 - } 273 - 274 - /* source address lookup done in ip6_dst_lookup */ 275 - 276 - if (ipv6_addr_any(&np->saddr)) 277 - np->saddr = fl6.saddr; 278 - 279 - if (ipv6_addr_any(&sk->sk_v6_rcv_saddr)) { 280 - sk->sk_v6_rcv_saddr = fl6.saddr; 281 - inet->inet_rcv_saddr = LOOPBACK4_IPV6; 282 - if (sk->sk_prot->rehash) 283 - sk->sk_prot->rehash(sk); 284 - } 285 - 286 - ip6_dst_store(sk, dst, 287 - ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ? 288 - &sk->sk_v6_daddr : NULL, 289 - #ifdef CONFIG_IPV6_SUBTREES 290 - ipv6_addr_equal(&fl6.saddr, &np->saddr) ? 291 - &np->saddr : 292 - #endif 293 - NULL); 294 160 295 161 sk->sk_state = TCP_ESTABLISHED; 296 162 sk_set_txhash(sk); 297 163 out: 298 - fl6_sock_release(flowlabel); 299 164 return err; 300 165 } 301 166
+16 -3
net/ipv6/route.c
··· 338 338 return rt; 339 339 } 340 340 341 - static struct rt6_info *ip6_dst_alloc(struct net *net, 342 - struct net_device *dev, 343 - int flags) 341 + struct rt6_info *ip6_dst_alloc(struct net *net, 342 + struct net_device *dev, 343 + int flags) 344 344 { 345 345 struct rt6_info *rt = __ip6_dst_alloc(net, dev, flags); 346 346 ··· 364 364 365 365 return rt; 366 366 } 367 + EXPORT_SYMBOL(ip6_dst_alloc); 367 368 368 369 static void ip6_dst_destroy(struct dst_entry *dst) 369 370 { ··· 1418 1417 1419 1418 void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu) 1420 1419 { 1420 + struct dst_entry *dst; 1421 + 1421 1422 ip6_update_pmtu(skb, sock_net(sk), mtu, 1422 1423 sk->sk_bound_dev_if, sk->sk_mark); 1424 + 1425 + dst = __sk_dst_get(sk); 1426 + if (!dst || !dst->obsolete || 1427 + dst->ops->check(dst, inet6_sk(sk)->dst_cookie)) 1428 + return; 1429 + 1430 + bh_lock_sock(sk); 1431 + if (!sock_owned_by_user(sk) && !ipv6_addr_v4mapped(&sk->sk_v6_daddr)) 1432 + ip6_datagram_dst_update(sk, false); 1433 + bh_unlock_sock(sk); 1423 1434 } 1424 1435 EXPORT_SYMBOL_GPL(ip6_sk_update_pmtu); 1425 1436
+1
net/ipv6/udp.c
··· 1490 1490 .sendmsg = udpv6_sendmsg, 1491 1491 .recvmsg = udpv6_recvmsg, 1492 1492 .backlog_rcv = __udpv6_queue_rcv_skb, 1493 + .release_cb = ip6_datagram_release_cb, 1493 1494 .hash = udp_lib_hash, 1494 1495 .unhash = udp_lib_unhash, 1495 1496 .rehash = udp_v6_rehash,
+4
net/netfilter/nf_conntrack_proto_tcp.c
··· 410 410 length--; 411 411 continue; 412 412 default: 413 + if (length < 2) 414 + return; 413 415 opsize=*ptr++; 414 416 if (opsize < 2) /* "silly options" */ 415 417 return; ··· 472 470 length--; 473 471 continue; 474 472 default: 473 + if (length < 2) 474 + return; 475 475 opsize = *ptr++; 476 476 if (opsize < 2) /* "silly options" */ 477 477 return;
+1 -1
net/netlink/af_netlink.c
··· 688 688 689 689 skb_queue_purge(&sk->sk_write_queue); 690 690 691 - if (nlk->portid) { 691 + if (nlk->portid && nlk->bound) { 692 692 struct netlink_notify n = { 693 693 .net = sock_net(sk), 694 694 .protocol = sk->sk_protocol,
+2 -2
net/openvswitch/actions.c
··· 461 461 mask_ipv6_addr(saddr, key->ipv6_src, mask->ipv6_src, masked); 462 462 463 463 if (unlikely(memcmp(saddr, masked, sizeof(masked)))) { 464 - set_ipv6_addr(skb, key->ipv6_proto, saddr, masked, 464 + set_ipv6_addr(skb, flow_key->ip.proto, saddr, masked, 465 465 true); 466 466 memcpy(&flow_key->ipv6.addr.src, masked, 467 467 sizeof(flow_key->ipv6.addr.src)); ··· 483 483 NULL, &flags) 484 484 != NEXTHDR_ROUTING); 485 485 486 - set_ipv6_addr(skb, key->ipv6_proto, daddr, masked, 486 + set_ipv6_addr(skb, flow_key->ip.proto, daddr, masked, 487 487 recalc_csum); 488 488 memcpy(&flow_key->ipv6.addr.dst, masked, 489 489 sizeof(flow_key->ipv6.addr.dst));
+1
net/openvswitch/conntrack.c
··· 367 367 } else if (key->eth.type == htons(ETH_P_IPV6)) { 368 368 enum ip6_defrag_users user = IP6_DEFRAG_CONNTRACK_IN + zone; 369 369 370 + skb_orphan(skb); 370 371 memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm)); 371 372 err = nf_ct_frag6_gather(net, skb, user); 372 373 if (err)
+1
net/packet/af_packet.c
··· 3551 3551 i->ifindex = mreq->mr_ifindex; 3552 3552 i->alen = mreq->mr_alen; 3553 3553 memcpy(i->addr, mreq->mr_address, i->alen); 3554 + memset(i->addr + i->alen, 0, sizeof(i->addr) - i->alen); 3554 3555 i->count = 1; 3555 3556 i->next = po->mclist; 3556 3557 po->mclist = i;
+2 -2
net/rds/cong.c
··· 299 299 i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS; 300 300 off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS; 301 301 302 - __set_bit_le(off, (void *)map->m_page_addrs[i]); 302 + set_bit_le(off, (void *)map->m_page_addrs[i]); 303 303 } 304 304 305 305 void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port) ··· 313 313 i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS; 314 314 off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS; 315 315 316 - __clear_bit_le(off, (void *)map->m_page_addrs[i]); 316 + clear_bit_le(off, (void *)map->m_page_addrs[i]); 317 317 } 318 318 319 319 static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
+1 -1
net/rds/ib_cm.c
··· 194 194 dp->dp_protocol_major = RDS_PROTOCOL_MAJOR(protocol_version); 195 195 dp->dp_protocol_minor = RDS_PROTOCOL_MINOR(protocol_version); 196 196 dp->dp_protocol_minor_mask = cpu_to_be16(RDS_IB_SUPPORTED_PROTOCOLS); 197 - dp->dp_ack_seq = rds_ib_piggyb_ack(ic); 197 + dp->dp_ack_seq = cpu_to_be64(rds_ib_piggyb_ack(ic)); 198 198 199 199 /* Advertise flow control */ 200 200 if (ic->i_flowctl) {
+4 -1
net/sched/sch_generic.c
··· 159 159 if (validate) 160 160 skb = validate_xmit_skb_list(skb, dev); 161 161 162 - if (skb) { 162 + if (likely(skb)) { 163 163 HARD_TX_LOCK(dev, txq, smp_processor_id()); 164 164 if (!netif_xmit_frozen_or_stopped(txq)) 165 165 skb = dev_hard_start_xmit(skb, dev, txq, &ret); 166 166 167 167 HARD_TX_UNLOCK(dev, txq); 168 + } else { 169 + spin_lock(root_lock); 170 + return qdisc_qlen(q); 168 171 } 169 172 spin_lock(root_lock); 170 173
+10 -5
net/sctp/outqueue.c
··· 866 866 * sender MUST assure that at least one T3-rtx 867 867 * timer is running. 868 868 */ 869 - if (chunk->chunk_hdr->type == SCTP_CID_FWD_TSN) 870 - sctp_transport_reset_timers(transport); 869 + if (chunk->chunk_hdr->type == SCTP_CID_FWD_TSN) { 870 + sctp_transport_reset_t3_rtx(transport); 871 + transport->last_time_sent = jiffies; 872 + } 871 873 } 872 874 break; 873 875 ··· 926 924 error = sctp_outq_flush_rtx(q, packet, 927 925 rtx_timeout, &start_timer); 928 926 929 - if (start_timer) 930 - sctp_transport_reset_timers(transport); 927 + if (start_timer) { 928 + sctp_transport_reset_t3_rtx(transport); 929 + transport->last_time_sent = jiffies; 930 + } 931 931 932 932 /* This can happen on COOKIE-ECHO resend. Only 933 933 * one chunk can get bundled with a COOKIE-ECHO. ··· 1066 1062 list_add_tail(&chunk->transmitted_list, 1067 1063 &transport->transmitted); 1068 1064 1069 - sctp_transport_reset_timers(transport); 1065 + sctp_transport_reset_t3_rtx(transport); 1066 + transport->last_time_sent = jiffies; 1070 1067 1071 1068 /* Only let one DATA chunk get bundled with a 1072 1069 * COOKIE-ECHO chunk.
+1 -2
net/sctp/sm_make_chunk.c
··· 3080 3080 return SCTP_ERROR_RSRC_LOW; 3081 3081 3082 3082 /* Start the heartbeat timer. */ 3083 - if (!mod_timer(&peer->hb_timer, sctp_transport_timeout(peer))) 3084 - sctp_transport_hold(peer); 3083 + sctp_transport_reset_hb_timer(peer); 3085 3084 asoc->new_transport = peer; 3086 3085 break; 3087 3086 case SCTP_PARAM_DEL_IP:
+16 -20
net/sctp/sm_sideeffect.c
··· 69 69 sctp_cmd_seq_t *commands, 70 70 gfp_t gfp); 71 71 72 - static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds, 73 - struct sctp_transport *t); 74 72 /******************************************************************** 75 73 * Helper functions 76 74 ********************************************************************/ ··· 365 367 struct sctp_association *asoc = transport->asoc; 366 368 struct sock *sk = asoc->base.sk; 367 369 struct net *net = sock_net(sk); 370 + u32 elapsed, timeout; 368 371 369 372 bh_lock_sock(sk); 370 373 if (sock_owned_by_user(sk)) { ··· 373 374 374 375 /* Try again later. */ 375 376 if (!mod_timer(&transport->hb_timer, jiffies + (HZ/20))) 377 + sctp_transport_hold(transport); 378 + goto out_unlock; 379 + } 380 + 381 + /* Check if we should still send the heartbeat or reschedule */ 382 + elapsed = jiffies - transport->last_time_sent; 383 + timeout = sctp_transport_timeout(transport); 384 + if (elapsed < timeout) { 385 + elapsed = timeout - elapsed; 386 + if (!mod_timer(&transport->hb_timer, jiffies + elapsed)) 376 387 sctp_transport_hold(transport); 377 388 goto out_unlock; 378 389 } ··· 516 507 0); 517 508 518 509 /* Update the hb timer to resend a heartbeat every rto */ 519 - sctp_cmd_hb_timer_update(commands, transport); 510 + sctp_transport_reset_hb_timer(transport); 520 511 } 521 512 522 513 if (transport->state != SCTP_INACTIVE && ··· 643 634 * hold a reference on the transport to make sure none of 644 635 * the needed data structures go away. 645 636 */ 646 - list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { 647 - 648 - if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t))) 649 - sctp_transport_hold(t); 650 - } 637 + list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) 638 + sctp_transport_reset_hb_timer(t); 651 639 } 652 640 653 641 static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds, ··· 674 668 } 675 669 } 676 670 677 - 678 - /* Helper function to update the heartbeat timer. */ 679 - static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds, 680 - struct sctp_transport *t) 681 - { 682 - /* Update the heartbeat timer. */ 683 - if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t))) 684 - sctp_transport_hold(t); 685 - } 686 671 687 672 /* Helper function to handle the reception of an HEARTBEAT ACK. */ 688 673 static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, ··· 739 742 sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at)); 740 743 741 744 /* Update the heartbeat timer. */ 742 - if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t))) 743 - sctp_transport_hold(t); 745 + sctp_transport_reset_hb_timer(t); 744 746 745 747 if (was_unconfirmed && asoc->peer.transport_count == 1) 746 748 sctp_transport_immediate_rtx(t); ··· 1612 1616 1613 1617 case SCTP_CMD_HB_TIMER_UPDATE: 1614 1618 t = cmd->obj.transport; 1615 - sctp_cmd_hb_timer_update(commands, t); 1619 + sctp_transport_reset_hb_timer(t); 1616 1620 break; 1617 1621 1618 1622 case SCTP_CMD_HB_TIMERS_STOP:
+13 -6
net/sctp/transport.c
··· 183 183 /* Start T3_rtx timer if it is not already running and update the heartbeat 184 184 * timer. This routine is called every time a DATA chunk is sent. 185 185 */ 186 - void sctp_transport_reset_timers(struct sctp_transport *transport) 186 + void sctp_transport_reset_t3_rtx(struct sctp_transport *transport) 187 187 { 188 188 /* RFC 2960 6.3.2 Retransmission Timer Rules 189 189 * ··· 197 197 if (!mod_timer(&transport->T3_rtx_timer, 198 198 jiffies + transport->rto)) 199 199 sctp_transport_hold(transport); 200 + } 201 + 202 + void sctp_transport_reset_hb_timer(struct sctp_transport *transport) 203 + { 204 + unsigned long expires; 200 205 201 206 /* When a data chunk is sent, reset the heartbeat interval. */ 202 - if (!mod_timer(&transport->hb_timer, 203 - sctp_transport_timeout(transport))) 204 - sctp_transport_hold(transport); 207 + expires = jiffies + sctp_transport_timeout(transport); 208 + if (time_before(transport->hb_timer.expires, expires) && 209 + !mod_timer(&transport->hb_timer, 210 + expires + prandom_u32_max(transport->rto))) 211 + sctp_transport_hold(transport); 205 212 } 206 213 207 214 /* This transport has been assigned to an association. ··· 602 595 unsigned long sctp_transport_timeout(struct sctp_transport *trans) 603 596 { 604 597 /* RTO + timer slack +/- 50% of RTO */ 605 - unsigned long timeout = (trans->rto >> 1) + prandom_u32_max(trans->rto); 598 + unsigned long timeout = trans->rto >> 1; 606 599 607 600 if (trans->state != SCTP_UNCONFIRMED && 608 601 trans->state != SCTP_PF) 609 602 timeout += trans->hbinterval; 610 603 611 - return timeout + jiffies; 604 + return timeout; 612 605 } 613 606 614 607 /* Reset transport variables to their initial values */
+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
net/tipc/core.c
··· 69 69 if (err) 70 70 goto out_nametbl; 71 71 72 + INIT_LIST_HEAD(&tn->dist_queue); 72 73 err = tipc_topsrv_start(net); 73 74 if (err) 74 75 goto out_subscr;
+3
net/tipc/core.h
··· 103 103 spinlock_t nametbl_lock; 104 104 struct name_table *nametbl; 105 105 106 + /* Name dist queue */ 107 + struct list_head dist_queue; 108 + 106 109 /* Topology subscription server */ 107 110 struct tipc_server *topsrv; 108 111 atomic_t subscription_count;
+26 -9
net/tipc/name_distr.c
··· 40 40 41 41 int sysctl_tipc_named_timeout __read_mostly = 2000; 42 42 43 - /** 44 - * struct tipc_dist_queue - queue holding deferred name table updates 45 - */ 46 - static struct list_head tipc_dist_queue = LIST_HEAD_INIT(tipc_dist_queue); 47 - 48 43 struct distr_queue_item { 49 44 struct distr_item i; 50 45 u32 dtype; ··· 224 229 kfree_rcu(p, rcu); 225 230 } 226 231 232 + /** 233 + * tipc_dist_queue_purge - remove deferred updates from a node that went down 234 + */ 235 + static void tipc_dist_queue_purge(struct net *net, u32 addr) 236 + { 237 + struct tipc_net *tn = net_generic(net, tipc_net_id); 238 + struct distr_queue_item *e, *tmp; 239 + 240 + spin_lock_bh(&tn->nametbl_lock); 241 + list_for_each_entry_safe(e, tmp, &tn->dist_queue, next) { 242 + if (e->node != addr) 243 + continue; 244 + list_del(&e->next); 245 + kfree(e); 246 + } 247 + spin_unlock_bh(&tn->nametbl_lock); 248 + } 249 + 227 250 void tipc_publ_notify(struct net *net, struct list_head *nsub_list, u32 addr) 228 251 { 229 252 struct publication *publ, *tmp; 230 253 231 254 list_for_each_entry_safe(publ, tmp, nsub_list, nodesub_list) 232 255 tipc_publ_purge(net, publ, addr); 256 + tipc_dist_queue_purge(net, addr); 233 257 } 234 258 235 259 /** ··· 293 279 * tipc_named_add_backlog - add a failed name table update to the backlog 294 280 * 295 281 */ 296 - static void tipc_named_add_backlog(struct distr_item *i, u32 type, u32 node) 282 + static void tipc_named_add_backlog(struct net *net, struct distr_item *i, 283 + u32 type, u32 node) 297 284 { 298 285 struct distr_queue_item *e; 286 + struct tipc_net *tn = net_generic(net, tipc_net_id); 299 287 unsigned long now = get_jiffies_64(); 300 288 301 289 e = kzalloc(sizeof(*e), GFP_ATOMIC); ··· 307 291 e->node = node; 308 292 e->expires = now + msecs_to_jiffies(sysctl_tipc_named_timeout); 309 293 memcpy(e, i, sizeof(*i)); 310 - list_add_tail(&e->next, &tipc_dist_queue); 294 + list_add_tail(&e->next, &tn->dist_queue); 311 295 } 312 296 313 297 /** ··· 317 301 void tipc_named_process_backlog(struct net *net) 318 302 { 319 303 struct distr_queue_item *e, *tmp; 304 + struct tipc_net *tn = net_generic(net, tipc_net_id); 320 305 char addr[16]; 321 306 unsigned long now = get_jiffies_64(); 322 307 323 - list_for_each_entry_safe(e, tmp, &tipc_dist_queue, next) { 308 + list_for_each_entry_safe(e, tmp, &tn->dist_queue, next) { 324 309 if (time_after(e->expires, now)) { 325 310 if (!tipc_update_nametbl(net, &e->i, e->node, e->dtype)) 326 311 continue; ··· 361 344 node = msg_orignode(msg); 362 345 while (count--) { 363 346 if (!tipc_update_nametbl(net, item, node, mtype)) 364 - tipc_named_add_backlog(item, mtype, node); 347 + tipc_named_add_backlog(net, item, mtype, node); 365 348 item++; 366 349 } 367 350 kfree_skb(skb);
+2 -5
net/vmw_vsock/vmci_transport.c
··· 1735 1735 /* Retrieve the head sk_buff from the socket's receive queue. */ 1736 1736 err = 0; 1737 1737 skb = skb_recv_datagram(&vsk->sk, flags, noblock, &err); 1738 - if (err) 1739 - return err; 1740 - 1741 1738 if (!skb) 1742 - return -EAGAIN; 1739 + return err; 1743 1740 1744 1741 dg = (struct vmci_datagram *)skb->data; 1745 1742 if (!dg) ··· 2151 2154 2152 2155 MODULE_AUTHOR("VMware, Inc."); 2153 2156 MODULE_DESCRIPTION("VMCI transport for Virtual Sockets"); 2154 - MODULE_VERSION("1.0.3.0-k"); 2157 + MODULE_VERSION("1.0.4.0-k"); 2155 2158 MODULE_LICENSE("GPL v2"); 2156 2159 MODULE_ALIAS("vmware_vsock"); 2157 2160 MODULE_ALIAS_NETPROTO(PF_VSOCK);
+1 -1
net/wireless/nl80211.c
··· 13372 13372 struct wireless_dev *wdev; 13373 13373 struct cfg80211_beacon_registration *reg, *tmp; 13374 13374 13375 - if (state != NETLINK_URELEASE) 13375 + if (state != NETLINK_URELEASE || notify->protocol != NETLINK_GENERIC) 13376 13376 return NOTIFY_DONE; 13377 13377 13378 13378 rcu_read_lock();
+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 }
+1
tools/testing/selftests/net/.gitignore
··· 3 3 psock_tpacket 4 4 reuseport_bpf 5 5 reuseport_bpf_cpu 6 + reuseport_dualstack
+1 -1
tools/testing/selftests/net/Makefile
··· 4 4 5 5 CFLAGS += -I../../../../usr/include/ 6 6 7 - NET_PROGS = socket psock_fanout psock_tpacket reuseport_bpf reuseport_bpf_cpu 7 + NET_PROGS = socket psock_fanout psock_tpacket reuseport_bpf reuseport_bpf_cpu reuseport_dualstack 8 8 9 9 all: $(NET_PROGS) 10 10 %: %.c
+208
tools/testing/selftests/net/reuseport_dualstack.c
··· 1 + /* 2 + * It is possible to use SO_REUSEPORT to open multiple sockets bound to 3 + * equivalent local addresses using AF_INET and AF_INET6 at the same time. If 4 + * the AF_INET6 socket has IPV6_V6ONLY set, it's clear which socket should 5 + * receive a given incoming packet. However, when it is not set, incoming v4 6 + * packets should prefer the AF_INET socket(s). This behavior was defined with 7 + * the original SO_REUSEPORT implementation, but broke with 8 + * e32ea7e74727 ("soreuseport: fast reuseport UDP socket selection") 9 + * This test creates these mixed AF_INET/AF_INET6 sockets and asserts the 10 + * AF_INET preference for v4 packets. 11 + */ 12 + 13 + #define _GNU_SOURCE 14 + 15 + #include <arpa/inet.h> 16 + #include <errno.h> 17 + #include <error.h> 18 + #include <linux/in.h> 19 + #include <linux/unistd.h> 20 + #include <stdio.h> 21 + #include <stdlib.h> 22 + #include <string.h> 23 + #include <sys/epoll.h> 24 + #include <sys/types.h> 25 + #include <sys/socket.h> 26 + #include <unistd.h> 27 + 28 + static const int PORT = 8888; 29 + 30 + static void build_rcv_fd(int family, int proto, int *rcv_fds, int count) 31 + { 32 + struct sockaddr_storage addr; 33 + struct sockaddr_in *addr4; 34 + struct sockaddr_in6 *addr6; 35 + int opt, i; 36 + 37 + switch (family) { 38 + case AF_INET: 39 + addr4 = (struct sockaddr_in *)&addr; 40 + addr4->sin_family = AF_INET; 41 + addr4->sin_addr.s_addr = htonl(INADDR_ANY); 42 + addr4->sin_port = htons(PORT); 43 + break; 44 + case AF_INET6: 45 + addr6 = (struct sockaddr_in6 *)&addr; 46 + addr6->sin6_family = AF_INET6; 47 + addr6->sin6_addr = in6addr_any; 48 + addr6->sin6_port = htons(PORT); 49 + break; 50 + default: 51 + error(1, 0, "Unsupported family %d", family); 52 + } 53 + 54 + for (i = 0; i < count; ++i) { 55 + rcv_fds[i] = socket(family, proto, 0); 56 + if (rcv_fds[i] < 0) 57 + error(1, errno, "failed to create receive socket"); 58 + 59 + opt = 1; 60 + if (setsockopt(rcv_fds[i], SOL_SOCKET, SO_REUSEPORT, &opt, 61 + sizeof(opt))) 62 + error(1, errno, "failed to set SO_REUSEPORT"); 63 + 64 + if (bind(rcv_fds[i], (struct sockaddr *)&addr, sizeof(addr))) 65 + error(1, errno, "failed to bind receive socket"); 66 + 67 + if (proto == SOCK_STREAM && listen(rcv_fds[i], 10)) 68 + error(1, errno, "failed to listen on receive port"); 69 + } 70 + } 71 + 72 + static void send_from_v4(int proto) 73 + { 74 + struct sockaddr_in saddr, daddr; 75 + int fd; 76 + 77 + saddr.sin_family = AF_INET; 78 + saddr.sin_addr.s_addr = htonl(INADDR_ANY); 79 + saddr.sin_port = 0; 80 + 81 + daddr.sin_family = AF_INET; 82 + daddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); 83 + daddr.sin_port = htons(PORT); 84 + 85 + fd = socket(AF_INET, proto, 0); 86 + if (fd < 0) 87 + error(1, errno, "failed to create send socket"); 88 + 89 + if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr))) 90 + error(1, errno, "failed to bind send socket"); 91 + 92 + if (connect(fd, (struct sockaddr *)&daddr, sizeof(daddr))) 93 + error(1, errno, "failed to connect send socket"); 94 + 95 + if (send(fd, "a", 1, 0) < 0) 96 + error(1, errno, "failed to send message"); 97 + 98 + close(fd); 99 + } 100 + 101 + static int receive_once(int epfd, int proto) 102 + { 103 + struct epoll_event ev; 104 + int i, fd; 105 + char buf[8]; 106 + 107 + i = epoll_wait(epfd, &ev, 1, -1); 108 + if (i < 0) 109 + error(1, errno, "epoll_wait failed"); 110 + 111 + if (proto == SOCK_STREAM) { 112 + fd = accept(ev.data.fd, NULL, NULL); 113 + if (fd < 0) 114 + error(1, errno, "failed to accept"); 115 + i = recv(fd, buf, sizeof(buf), 0); 116 + close(fd); 117 + } else { 118 + i = recv(ev.data.fd, buf, sizeof(buf), 0); 119 + } 120 + 121 + if (i < 0) 122 + error(1, errno, "failed to recv"); 123 + 124 + return ev.data.fd; 125 + } 126 + 127 + static void test(int *rcv_fds, int count, int proto) 128 + { 129 + struct epoll_event ev; 130 + int epfd, i, test_fd; 131 + uint16_t test_family; 132 + socklen_t len; 133 + 134 + epfd = epoll_create(1); 135 + if (epfd < 0) 136 + error(1, errno, "failed to create epoll"); 137 + 138 + ev.events = EPOLLIN; 139 + for (i = 0; i < count; ++i) { 140 + ev.data.fd = rcv_fds[i]; 141 + if (epoll_ctl(epfd, EPOLL_CTL_ADD, rcv_fds[i], &ev)) 142 + error(1, errno, "failed to register sock epoll"); 143 + } 144 + 145 + send_from_v4(proto); 146 + 147 + test_fd = receive_once(epfd, proto); 148 + if (getsockopt(test_fd, SOL_SOCKET, SO_DOMAIN, &test_family, &len)) 149 + error(1, errno, "failed to read socket domain"); 150 + if (test_family != AF_INET) 151 + error(1, 0, "expected to receive on v4 socket but got v6 (%d)", 152 + test_family); 153 + 154 + close(epfd); 155 + } 156 + 157 + int main(void) 158 + { 159 + int rcv_fds[32], i; 160 + 161 + fprintf(stderr, "---- UDP IPv4 created before IPv6 ----\n"); 162 + build_rcv_fd(AF_INET, SOCK_DGRAM, rcv_fds, 5); 163 + build_rcv_fd(AF_INET6, SOCK_DGRAM, &(rcv_fds[5]), 5); 164 + test(rcv_fds, 10, SOCK_DGRAM); 165 + for (i = 0; i < 10; ++i) 166 + close(rcv_fds[i]); 167 + 168 + fprintf(stderr, "---- UDP IPv6 created before IPv4 ----\n"); 169 + build_rcv_fd(AF_INET6, SOCK_DGRAM, rcv_fds, 5); 170 + build_rcv_fd(AF_INET, SOCK_DGRAM, &(rcv_fds[5]), 5); 171 + test(rcv_fds, 10, SOCK_DGRAM); 172 + for (i = 0; i < 10; ++i) 173 + close(rcv_fds[i]); 174 + 175 + /* NOTE: UDP socket lookups traverse a different code path when there 176 + * are > 10 sockets in a group. 177 + */ 178 + fprintf(stderr, "---- UDP IPv4 created before IPv6 (large) ----\n"); 179 + build_rcv_fd(AF_INET, SOCK_DGRAM, rcv_fds, 16); 180 + build_rcv_fd(AF_INET6, SOCK_DGRAM, &(rcv_fds[16]), 16); 181 + test(rcv_fds, 32, SOCK_DGRAM); 182 + for (i = 0; i < 32; ++i) 183 + close(rcv_fds[i]); 184 + 185 + fprintf(stderr, "---- UDP IPv6 created before IPv4 (large) ----\n"); 186 + build_rcv_fd(AF_INET6, SOCK_DGRAM, rcv_fds, 16); 187 + build_rcv_fd(AF_INET, SOCK_DGRAM, &(rcv_fds[16]), 16); 188 + test(rcv_fds, 32, SOCK_DGRAM); 189 + for (i = 0; i < 32; ++i) 190 + close(rcv_fds[i]); 191 + 192 + fprintf(stderr, "---- TCP IPv4 created before IPv6 ----\n"); 193 + build_rcv_fd(AF_INET, SOCK_STREAM, rcv_fds, 5); 194 + build_rcv_fd(AF_INET6, SOCK_STREAM, &(rcv_fds[5]), 5); 195 + test(rcv_fds, 10, SOCK_STREAM); 196 + for (i = 0; i < 10; ++i) 197 + close(rcv_fds[i]); 198 + 199 + fprintf(stderr, "---- TCP IPv6 created before IPv4 ----\n"); 200 + build_rcv_fd(AF_INET6, SOCK_STREAM, rcv_fds, 5); 201 + build_rcv_fd(AF_INET, SOCK_STREAM, &(rcv_fds[5]), 5); 202 + test(rcv_fds, 10, SOCK_STREAM); 203 + for (i = 0; i < 10; ++i) 204 + close(rcv_fds[i]); 205 + 206 + fprintf(stderr, "SUCCESS\n"); 207 + return 0; 208 + }
+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 }