aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/networking/switchdev.txt4
-rw-r--r--Documentation/sysctl/net.txt47
-rw-r--r--arch/arc/Kconfig1
-rw-r--r--arch/arc/Makefile2
-rw-r--r--arch/arc/boot/dts/axc001.dtsi20
-rw-r--r--arch/arc/boot/dts/axc003.dtsi21
-rw-r--r--arch/arc/boot/dts/axc003_idu.dtsi21
-rw-r--r--arch/arc/boot/dts/axs10x_mb.dtsi2
-rw-r--r--arch/arc/configs/haps_hs_defconfig1
-rw-r--r--arch/arc/configs/haps_hs_smp_defconfig1
-rw-r--r--arch/arc/configs/nps_defconfig1
-rw-r--r--arch/arc/configs/nsim_700_defconfig1
-rw-r--r--arch/arc/configs/nsim_hs_defconfig1
-rw-r--r--arch/arc/configs/nsim_hs_smp_defconfig1
-rw-r--r--arch/arc/configs/nsimosci_defconfig1
-rw-r--r--arch/arc/configs/nsimosci_hs_defconfig1
-rw-r--r--arch/arc/configs/nsimosci_hs_smp_defconfig1
-rw-r--r--arch/arc/configs/tb10x_defconfig1
-rw-r--r--arch/arc/include/asm/cache.h2
-rw-r--r--arch/arc/include/asm/mmu.h2
-rw-r--r--arch/arc/kernel/intc-arcv2.c3
-rw-r--r--arch/arc/kernel/intc-compact.c14
-rw-r--r--arch/arc/mm/cache.c50
-rw-r--r--arch/arc/mm/dma.c45
-rw-r--r--arch/arc/mm/tlb.c12
-rw-r--r--arch/arc/plat-sim/Kconfig13
-rw-r--r--arch/arc/plat-sim/platform.c5
-rw-r--r--arch/sparc/include/asm/page_32.h2
-rw-r--r--arch/sparc/kernel/pci_sun4v.c2
-rw-r--r--arch/sparc/kernel/pcic.c2
-rw-r--r--arch/sparc/lib/multi3.S24
-rw-r--r--drivers/gpio/gpio-mvebu.c2
-rw-r--r--drivers/gpio/gpiolib-sysfs.c10
-rw-r--r--drivers/mfd/da9062-core.c6
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c4
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_common.c3
-rw-r--r--drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c2
-rw-r--r--drivers/net/tun.c3
-rw-r--r--drivers/pci/pci.c9
-rw-r--r--drivers/rtc/rtc-ds1307.c1
-rw-r--r--drivers/scsi/Kconfig11
-rw-r--r--drivers/scsi/aacraid/aachba.c9
-rw-r--r--drivers/scsi/aacraid/aacraid.h2
-rw-r--r--drivers/scsi/csiostor/csio_hw.c4
-rw-r--r--drivers/scsi/csiostor/csio_init.c12
-rw-r--r--drivers/scsi/cxgbi/cxgb4i/cxgb4i.c3
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c2
-rw-r--r--drivers/scsi/scsi.c4
-rw-r--r--drivers/scsi/sd.c3
-rw-r--r--drivers/scsi/sd_zbc.c9
-rw-r--r--fs/ext4/mballoc.c7
-rw-r--r--fs/ext4/xattr.c6
-rw-r--r--include/linux/pid.h4
-rw-r--r--include/linux/ptr_ring.h9
-rw-r--r--include/linux/sched.h51
-rw-r--r--include/linux/skb_array.h3
-rw-r--r--include/net/ip.h4
-rw-r--r--include/net/sch_generic.h5
-rw-r--r--include/net/sock.h4
-rw-r--r--include/scsi/scsi_cmnd.h1
-rw-r--r--kernel/pid.c11
-rw-r--r--net/core/datagram.c12
-rw-r--r--net/dccp/proto.c14
-rw-r--r--net/ipv4/igmp.c10
-rw-r--r--net/ipv4/route.c13
-rw-r--r--net/ipv4/tcp_input.c3
-rw-r--r--net/ipv4/udp.c3
-rw-r--r--net/ipv6/ip6_fib.c28
-rw-r--r--net/ipv6/udp.c3
-rw-r--r--net/irda/af_irda.c2
-rw-r--r--net/openvswitch/actions.c1
-rw-r--r--net/openvswitch/datapath.c7
-rw-r--r--net/openvswitch/datapath.h2
-rw-r--r--net/rxrpc/call_accept.c1
-rw-r--r--net/sched/act_ipt.c2
-rw-r--r--net/sched/cls_api.c2
-rw-r--r--net/sctp/ipv6.c2
-rw-r--r--net/tipc/netlink_compat.c6
-rw-r--r--net/unix/af_unix.c5
-rw-r--r--tools/lib/bpf/libbpf.c3
80 files changed, 417 insertions, 210 deletions
diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt
index 3e7b946dea27..5e40e1f68873 100644
--- a/Documentation/networking/switchdev.txt
+++ b/Documentation/networking/switchdev.txt
@@ -228,7 +228,7 @@ Learning on the device port should be enabled, as well as learning_sync:
228 bridge link set dev DEV learning on self 228 bridge link set dev DEV learning on self
229 bridge link set dev DEV learning_sync on self 229 bridge link set dev DEV learning_sync on self
230 230
231Learning_sync attribute enables syncing of the learned/forgotton FDB entry to 231Learning_sync attribute enables syncing of the learned/forgotten FDB entry to
232the bridge's FDB. It's possible, but not optimal, to enable learning on the 232the bridge's FDB. It's possible, but not optimal, to enable learning on the
233device port and on the bridge port, and disable learning_sync. 233device port and on the bridge port, and disable learning_sync.
234 234
@@ -245,7 +245,7 @@ the responsibility of the port driver/device to age out these entries. If the
245port device supports ageing, when the FDB entry expires, it will notify the 245port device supports ageing, when the FDB entry expires, it will notify the
246driver which in turn will notify the bridge with SWITCHDEV_FDB_DEL. If the 246driver which in turn will notify the bridge with SWITCHDEV_FDB_DEL. If the
247device does not support ageing, the driver can simulate ageing using a 247device does not support ageing, the driver can simulate ageing using a
248garbage collection timer to monitor FBD entries. Expired entries will be 248garbage collection timer to monitor FDB entries. Expired entries will be
249notified to the bridge using SWITCHDEV_FDB_DEL. See rocker driver for 249notified to the bridge using SWITCHDEV_FDB_DEL. See rocker driver for
250example of driver running ageing timer. 250example of driver running ageing timer.
251 251
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt
index 14db18c970b1..28596e03220b 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/sysctl/net.txt
@@ -35,9 +35,34 @@ Table : Subdirectories in /proc/sys/net
35bpf_jit_enable 35bpf_jit_enable
36-------------- 36--------------
37 37
38This enables Berkeley Packet Filter Just in Time compiler. 38This enables the BPF Just in Time (JIT) compiler. BPF is a flexible
39Currently supported on x86_64 architecture, bpf_jit provides a framework 39and efficient infrastructure allowing to execute bytecode at various
40to speed packet filtering, the one used by tcpdump/libpcap for example. 40hook points. It is used in a number of Linux kernel subsystems such
41as networking (e.g. XDP, tc), tracing (e.g. kprobes, uprobes, tracepoints)
42and security (e.g. seccomp). LLVM has a BPF back end that can compile
43restricted C into a sequence of BPF instructions. After program load
44through bpf(2) and passing a verifier in the kernel, a JIT will then
45translate these BPF proglets into native CPU instructions. There are
46two flavors of JITs, the newer eBPF JIT currently supported on:
47 - x86_64
48 - arm64
49 - ppc64
50 - sparc64
51 - mips64
52 - s390x
53
54And the older cBPF JIT supported on the following archs:
55 - arm
56 - mips
57 - ppc
58 - sparc
59
60eBPF JITs are a superset of cBPF JITs, meaning the kernel will
61migrate cBPF instructions into eBPF instructions and then JIT
62compile them transparently. Older cBPF JITs can only translate
63tcpdump filters, seccomp rules, etc, but not mentioned eBPF
64programs loaded through bpf(2).
65
41Values : 66Values :
42 0 - disable the JIT (default value) 67 0 - disable the JIT (default value)
43 1 - enable the JIT 68 1 - enable the JIT
@@ -46,9 +71,9 @@ Values :
46bpf_jit_harden 71bpf_jit_harden
47-------------- 72--------------
48 73
49This enables hardening for the Berkeley Packet Filter Just in Time compiler. 74This enables hardening for the BPF JIT compiler. Supported are eBPF
50Supported are eBPF JIT backends. Enabling hardening trades off performance, 75JIT backends. Enabling hardening trades off performance, but can
51but can mitigate JIT spraying. 76mitigate JIT spraying.
52Values : 77Values :
53 0 - disable JIT hardening (default value) 78 0 - disable JIT hardening (default value)
54 1 - enable JIT hardening for unprivileged users only 79 1 - enable JIT hardening for unprivileged users only
@@ -57,11 +82,11 @@ Values :
57bpf_jit_kallsyms 82bpf_jit_kallsyms
58---------------- 83----------------
59 84
60When Berkeley Packet Filter Just in Time compiler is enabled, then compiled 85When BPF JIT compiler is enabled, then compiled images are unknown
61images are unknown addresses to the kernel, meaning they neither show up in 86addresses to the kernel, meaning they neither show up in traces nor
62traces nor in /proc/kallsyms. This enables export of these addresses, which 87in /proc/kallsyms. This enables export of these addresses, which can
63can be used for debugging/tracing. If bpf_jit_harden is enabled, this feature 88be used for debugging/tracing. If bpf_jit_harden is enabled, this
64is disabled. 89feature is disabled.
65Values : 90Values :
66 0 - disable JIT kallsyms export (default value) 91 0 - disable JIT kallsyms export (default value)
67 1 - enable JIT kallsyms export for privileged users only 92 1 - enable JIT kallsyms export for privileged users only
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index a5459698f0ee..7db85ab00c52 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -96,7 +96,6 @@ menu "ARC Architecture Configuration"
96 96
97menu "ARC Platform/SoC/Board" 97menu "ARC Platform/SoC/Board"
98 98
99source "arch/arc/plat-sim/Kconfig"
100source "arch/arc/plat-tb10x/Kconfig" 99source "arch/arc/plat-tb10x/Kconfig"
101source "arch/arc/plat-axs10x/Kconfig" 100source "arch/arc/plat-axs10x/Kconfig"
102#New platform adds here 101#New platform adds here
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 44ef35d33956..3a61cfcc38c0 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -107,7 +107,7 @@ core-y += arch/arc/
107# w/o this dtb won't embed into kernel binary 107# w/o this dtb won't embed into kernel binary
108core-y += arch/arc/boot/dts/ 108core-y += arch/arc/boot/dts/
109 109
110core-$(CONFIG_ARC_PLAT_SIM) += arch/arc/plat-sim/ 110core-y += arch/arc/plat-sim/
111core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/ 111core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/
112core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/ 112core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/
113core-$(CONFIG_ARC_PLAT_EZNPS) += arch/arc/plat-eznps/ 113core-$(CONFIG_ARC_PLAT_EZNPS) += arch/arc/plat-eznps/
diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
index 53ce226f77a5..a380ffa1a458 100644
--- a/arch/arc/boot/dts/axc001.dtsi
+++ b/arch/arc/boot/dts/axc001.dtsi
@@ -15,15 +15,15 @@
15 15
16/ { 16/ {
17 compatible = "snps,arc"; 17 compatible = "snps,arc";
18 #address-cells = <1>; 18 #address-cells = <2>;
19 #size-cells = <1>; 19 #size-cells = <2>;
20 20
21 cpu_card { 21 cpu_card {
22 compatible = "simple-bus"; 22 compatible = "simple-bus";
23 #address-cells = <1>; 23 #address-cells = <1>;
24 #size-cells = <1>; 24 #size-cells = <1>;
25 25
26 ranges = <0x00000000 0xf0000000 0x10000000>; 26 ranges = <0x00000000 0x0 0xf0000000 0x10000000>;
27 27
28 core_clk: core_clk { 28 core_clk: core_clk {
29 #clock-cells = <0>; 29 #clock-cells = <0>;
@@ -91,23 +91,21 @@
91 mb_intc: dw-apb-ictl@0xe0012000 { 91 mb_intc: dw-apb-ictl@0xe0012000 {
92 #interrupt-cells = <1>; 92 #interrupt-cells = <1>;
93 compatible = "snps,dw-apb-ictl"; 93 compatible = "snps,dw-apb-ictl";
94 reg = < 0xe0012000 0x200 >; 94 reg = < 0x0 0xe0012000 0x0 0x200 >;
95 interrupt-controller; 95 interrupt-controller;
96 interrupt-parent = <&core_intc>; 96 interrupt-parent = <&core_intc>;
97 interrupts = < 7 >; 97 interrupts = < 7 >;
98 }; 98 };
99 99
100 memory { 100 memory {
101 #address-cells = <1>;
102 #size-cells = <1>;
103 ranges = <0x00000000 0x80000000 0x20000000>;
104 device_type = "memory"; 101 device_type = "memory";
105 reg = <0x80000000 0x1b000000>; /* (512 - 32) MiB */ 102 /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */
103 reg = <0x0 0x80000000 0x0 0x1b000000>; /* (512 - 32) MiB */
106 }; 104 };
107 105
108 reserved-memory { 106 reserved-memory {
109 #address-cells = <1>; 107 #address-cells = <2>;
110 #size-cells = <1>; 108 #size-cells = <2>;
111 ranges; 109 ranges;
112 /* 110 /*
113 * We just move frame buffer area to the very end of 111 * We just move frame buffer area to the very end of
@@ -118,7 +116,7 @@
118 */ 116 */
119 frame_buffer: frame_buffer@9e000000 { 117 frame_buffer: frame_buffer@9e000000 {
120 compatible = "shared-dma-pool"; 118 compatible = "shared-dma-pool";
121 reg = <0x9e000000 0x2000000>; 119 reg = <0x0 0x9e000000 0x0 0x2000000>;
122 no-map; 120 no-map;
123 }; 121 };
124 }; 122 };
diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
index 14df46f141bf..cc9239ef8d08 100644
--- a/arch/arc/boot/dts/axc003.dtsi
+++ b/arch/arc/boot/dts/axc003.dtsi
@@ -14,15 +14,15 @@
14 14
15/ { 15/ {
16 compatible = "snps,arc"; 16 compatible = "snps,arc";
17 #address-cells = <1>; 17 #address-cells = <2>;
18 #size-cells = <1>; 18 #size-cells = <2>;
19 19
20 cpu_card { 20 cpu_card {
21 compatible = "simple-bus"; 21 compatible = "simple-bus";
22 #address-cells = <1>; 22 #address-cells = <1>;
23 #size-cells = <1>; 23 #size-cells = <1>;
24 24
25 ranges = <0x00000000 0xf0000000 0x10000000>; 25 ranges = <0x00000000 0x0 0xf0000000 0x10000000>;
26 26
27 core_clk: core_clk { 27 core_clk: core_clk {
28 #clock-cells = <0>; 28 #clock-cells = <0>;
@@ -94,30 +94,29 @@
94 mb_intc: dw-apb-ictl@0xe0012000 { 94 mb_intc: dw-apb-ictl@0xe0012000 {
95 #interrupt-cells = <1>; 95 #interrupt-cells = <1>;
96 compatible = "snps,dw-apb-ictl"; 96 compatible = "snps,dw-apb-ictl";
97 reg = < 0xe0012000 0x200 >; 97 reg = < 0x0 0xe0012000 0x0 0x200 >;
98 interrupt-controller; 98 interrupt-controller;
99 interrupt-parent = <&core_intc>; 99 interrupt-parent = <&core_intc>;
100 interrupts = < 24 >; 100 interrupts = < 24 >;
101 }; 101 };
102 102
103 memory { 103 memory {
104 #address-cells = <1>;
105 #size-cells = <1>;
106 ranges = <0x00000000 0x80000000 0x40000000>;
107 device_type = "memory"; 104 device_type = "memory";
108 reg = <0x80000000 0x20000000>; /* 512MiB */ 105 /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */
106 reg = <0x0 0x80000000 0x0 0x20000000 /* 512 MiB low mem */
107 0x1 0xc0000000 0x0 0x40000000>; /* 1 GiB highmem */
109 }; 108 };
110 109
111 reserved-memory { 110 reserved-memory {
112 #address-cells = <1>; 111 #address-cells = <2>;
113 #size-cells = <1>; 112 #size-cells = <2>;
114 ranges; 113 ranges;
115 /* 114 /*
116 * Move frame buffer out of IOC aperture (0x8z-0xAz). 115 * Move frame buffer out of IOC aperture (0x8z-0xAz).
117 */ 116 */
118 frame_buffer: frame_buffer@be000000 { 117 frame_buffer: frame_buffer@be000000 {
119 compatible = "shared-dma-pool"; 118 compatible = "shared-dma-pool";
120 reg = <0xbe000000 0x2000000>; 119 reg = <0x0 0xbe000000 0x0 0x2000000>;
121 no-map; 120 no-map;
122 }; 121 };
123 }; 122 };
diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
index 695f9fa1996b..4ebb2170abec 100644
--- a/arch/arc/boot/dts/axc003_idu.dtsi
+++ b/arch/arc/boot/dts/axc003_idu.dtsi
@@ -14,15 +14,15 @@
14 14
15/ { 15/ {
16 compatible = "snps,arc"; 16 compatible = "snps,arc";
17 #address-cells = <1>; 17 #address-cells = <2>;
18 #size-cells = <1>; 18 #size-cells = <2>;
19 19
20 cpu_card { 20 cpu_card {
21 compatible = "simple-bus"; 21 compatible = "simple-bus";
22 #address-cells = <1>; 22 #address-cells = <1>;
23 #size-cells = <1>; 23 #size-cells = <1>;
24 24
25 ranges = <0x00000000 0xf0000000 0x10000000>; 25 ranges = <0x00000000 0x0 0xf0000000 0x10000000>;
26 26
27 core_clk: core_clk { 27 core_clk: core_clk {
28 #clock-cells = <0>; 28 #clock-cells = <0>;
@@ -100,30 +100,29 @@
100 mb_intc: dw-apb-ictl@0xe0012000 { 100 mb_intc: dw-apb-ictl@0xe0012000 {
101 #interrupt-cells = <1>; 101 #interrupt-cells = <1>;
102 compatible = "snps,dw-apb-ictl"; 102 compatible = "snps,dw-apb-ictl";
103 reg = < 0xe0012000 0x200 >; 103 reg = < 0x0 0xe0012000 0x0 0x200 >;
104 interrupt-controller; 104 interrupt-controller;
105 interrupt-parent = <&idu_intc>; 105 interrupt-parent = <&idu_intc>;
106 interrupts = <0>; 106 interrupts = <0>;
107 }; 107 };
108 108
109 memory { 109 memory {
110 #address-cells = <1>;
111 #size-cells = <1>;
112 ranges = <0x00000000 0x80000000 0x40000000>;
113 device_type = "memory"; 110 device_type = "memory";
114 reg = <0x80000000 0x20000000>; /* 512MiB */ 111 /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */
112 reg = <0x0 0x80000000 0x0 0x20000000 /* 512 MiB low mem */
113 0x1 0xc0000000 0x0 0x40000000>; /* 1 GiB highmem */
115 }; 114 };
116 115
117 reserved-memory { 116 reserved-memory {
118 #address-cells = <1>; 117 #address-cells = <2>;
119 #size-cells = <1>; 118 #size-cells = <2>;
120 ranges; 119 ranges;
121 /* 120 /*
122 * Move frame buffer out of IOC aperture (0x8z-0xAz). 121 * Move frame buffer out of IOC aperture (0x8z-0xAz).
123 */ 122 */
124 frame_buffer: frame_buffer@be000000 { 123 frame_buffer: frame_buffer@be000000 {
125 compatible = "shared-dma-pool"; 124 compatible = "shared-dma-pool";
126 reg = <0xbe000000 0x2000000>; 125 reg = <0x0 0xbe000000 0x0 0x2000000>;
127 no-map; 126 no-map;
128 }; 127 };
129 }; 128 };
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 41cfb29b62c1..0ff7e07edcd4 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -13,7 +13,7 @@
13 compatible = "simple-bus"; 13 compatible = "simple-bus";
14 #address-cells = <1>; 14 #address-cells = <1>;
15 #size-cells = <1>; 15 #size-cells = <1>;
16 ranges = <0x00000000 0xe0000000 0x10000000>; 16 ranges = <0x00000000 0x0 0xe0000000 0x10000000>;
17 interrupt-parent = <&mb_intc>; 17 interrupt-parent = <&mb_intc>;
18 18
19 i2sclk: i2sclk@100a0 { 19 i2sclk: i2sclk@100a0 {
diff --git a/arch/arc/configs/haps_hs_defconfig b/arch/arc/configs/haps_hs_defconfig
index 57b3e599322f..db04ea4dd2d9 100644
--- a/arch/arc/configs/haps_hs_defconfig
+++ b/arch/arc/configs/haps_hs_defconfig
@@ -21,7 +21,6 @@ CONFIG_MODULES=y
21# CONFIG_BLK_DEV_BSG is not set 21# CONFIG_BLK_DEV_BSG is not set
22# CONFIG_IOSCHED_DEADLINE is not set 22# CONFIG_IOSCHED_DEADLINE is not set
23# CONFIG_IOSCHED_CFQ is not set 23# CONFIG_IOSCHED_CFQ is not set
24CONFIG_ARC_PLAT_SIM=y
25CONFIG_ISA_ARCV2=y 24CONFIG_ISA_ARCV2=y
26CONFIG_ARC_BUILTIN_DTB_NAME="haps_hs" 25CONFIG_ARC_BUILTIN_DTB_NAME="haps_hs"
27CONFIG_PREEMPT=y 26CONFIG_PREEMPT=y
diff --git a/arch/arc/configs/haps_hs_smp_defconfig b/arch/arc/configs/haps_hs_smp_defconfig
index f85985adebb2..821a2e562f3f 100644
--- a/arch/arc/configs/haps_hs_smp_defconfig
+++ b/arch/arc/configs/haps_hs_smp_defconfig
@@ -23,7 +23,6 @@ CONFIG_MODULES=y
23# CONFIG_BLK_DEV_BSG is not set 23# CONFIG_BLK_DEV_BSG is not set
24# CONFIG_IOSCHED_DEADLINE is not set 24# CONFIG_IOSCHED_DEADLINE is not set
25# CONFIG_IOSCHED_CFQ is not set 25# CONFIG_IOSCHED_CFQ is not set
26CONFIG_ARC_PLAT_SIM=y
27CONFIG_ISA_ARCV2=y 26CONFIG_ISA_ARCV2=y
28CONFIG_SMP=y 27CONFIG_SMP=y
29CONFIG_ARC_BUILTIN_DTB_NAME="haps_hs_idu" 28CONFIG_ARC_BUILTIN_DTB_NAME="haps_hs_idu"
diff --git a/arch/arc/configs/nps_defconfig b/arch/arc/configs/nps_defconfig
index ede625c76216..7c9c706ae7f6 100644
--- a/arch/arc/configs/nps_defconfig
+++ b/arch/arc/configs/nps_defconfig
@@ -39,7 +39,6 @@ CONFIG_IP_PNP=y
39# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 39# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
40# CONFIG_INET_XFRM_MODE_TUNNEL is not set 40# CONFIG_INET_XFRM_MODE_TUNNEL is not set
41# CONFIG_INET_XFRM_MODE_BEET is not set 41# CONFIG_INET_XFRM_MODE_BEET is not set
42# CONFIG_INET_LRO is not set
43# CONFIG_INET_DIAG is not set 42# CONFIG_INET_DIAG is not set
44# CONFIG_IPV6 is not set 43# CONFIG_IPV6 is not set
45# CONFIG_WIRELESS is not set 44# CONFIG_WIRELESS is not set
diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig
index b0066a749d4c..6dff83a238b8 100644
--- a/arch/arc/configs/nsim_700_defconfig
+++ b/arch/arc/configs/nsim_700_defconfig
@@ -23,7 +23,6 @@ CONFIG_MODULES=y
23# CONFIG_BLK_DEV_BSG is not set 23# CONFIG_BLK_DEV_BSG is not set
24# CONFIG_IOSCHED_DEADLINE is not set 24# CONFIG_IOSCHED_DEADLINE is not set
25# CONFIG_IOSCHED_CFQ is not set 25# CONFIG_IOSCHED_CFQ is not set
26CONFIG_ARC_PLAT_SIM=y
27CONFIG_ARC_BUILTIN_DTB_NAME="nsim_700" 26CONFIG_ARC_BUILTIN_DTB_NAME="nsim_700"
28CONFIG_PREEMPT=y 27CONFIG_PREEMPT=y
29# CONFIG_COMPACTION is not set 28# CONFIG_COMPACTION is not set
diff --git a/arch/arc/configs/nsim_hs_defconfig b/arch/arc/configs/nsim_hs_defconfig
index ebe9ebb92933..31ee51b987e7 100644
--- a/arch/arc/configs/nsim_hs_defconfig
+++ b/arch/arc/configs/nsim_hs_defconfig
@@ -26,7 +26,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
26# CONFIG_BLK_DEV_BSG is not set 26# CONFIG_BLK_DEV_BSG is not set
27# CONFIG_IOSCHED_DEADLINE is not set 27# CONFIG_IOSCHED_DEADLINE is not set
28# CONFIG_IOSCHED_CFQ is not set 28# CONFIG_IOSCHED_CFQ is not set
29CONFIG_ARC_PLAT_SIM=y
30CONFIG_ISA_ARCV2=y 29CONFIG_ISA_ARCV2=y
31CONFIG_ARC_BUILTIN_DTB_NAME="nsim_hs" 30CONFIG_ARC_BUILTIN_DTB_NAME="nsim_hs"
32CONFIG_PREEMPT=y 31CONFIG_PREEMPT=y
diff --git a/arch/arc/configs/nsim_hs_smp_defconfig b/arch/arc/configs/nsim_hs_smp_defconfig
index 4bde43278be6..8d3b1f67cae4 100644
--- a/arch/arc/configs/nsim_hs_smp_defconfig
+++ b/arch/arc/configs/nsim_hs_smp_defconfig
@@ -24,7 +24,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
24# CONFIG_BLK_DEV_BSG is not set 24# CONFIG_BLK_DEV_BSG is not set
25# CONFIG_IOSCHED_DEADLINE is not set 25# CONFIG_IOSCHED_DEADLINE is not set
26# CONFIG_IOSCHED_CFQ is not set 26# CONFIG_IOSCHED_CFQ is not set
27CONFIG_ARC_PLAT_SIM=y
28CONFIG_ISA_ARCV2=y 27CONFIG_ISA_ARCV2=y
29CONFIG_SMP=y 28CONFIG_SMP=y
30CONFIG_ARC_BUILTIN_DTB_NAME="nsim_hs_idu" 29CONFIG_ARC_BUILTIN_DTB_NAME="nsim_hs_idu"
diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig
index f6fb3d26557e..6168ce2ac2ef 100644
--- a/arch/arc/configs/nsimosci_defconfig
+++ b/arch/arc/configs/nsimosci_defconfig
@@ -23,7 +23,6 @@ CONFIG_MODULES=y
23# CONFIG_BLK_DEV_BSG is not set 23# CONFIG_BLK_DEV_BSG is not set
24# CONFIG_IOSCHED_DEADLINE is not set 24# CONFIG_IOSCHED_DEADLINE is not set
25# CONFIG_IOSCHED_CFQ is not set 25# CONFIG_IOSCHED_CFQ is not set
26CONFIG_ARC_PLAT_SIM=y
27CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci" 26CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci"
28# CONFIG_COMPACTION is not set 27# CONFIG_COMPACTION is not set
29CONFIG_NET=y 28CONFIG_NET=y
diff --git a/arch/arc/configs/nsimosci_hs_defconfig b/arch/arc/configs/nsimosci_hs_defconfig
index b9f0fe00044b..a70bdeb2b3fd 100644
--- a/arch/arc/configs/nsimosci_hs_defconfig
+++ b/arch/arc/configs/nsimosci_hs_defconfig
@@ -23,7 +23,6 @@ CONFIG_MODULES=y
23# CONFIG_BLK_DEV_BSG is not set 23# CONFIG_BLK_DEV_BSG is not set
24# CONFIG_IOSCHED_DEADLINE is not set 24# CONFIG_IOSCHED_DEADLINE is not set
25# CONFIG_IOSCHED_CFQ is not set 25# CONFIG_IOSCHED_CFQ is not set
26CONFIG_ARC_PLAT_SIM=y
27CONFIG_ISA_ARCV2=y 26CONFIG_ISA_ARCV2=y
28CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs" 27CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs"
29# CONFIG_COMPACTION is not set 28# CONFIG_COMPACTION is not set
diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig
index 155add7761ed..ef96406c446e 100644
--- a/arch/arc/configs/nsimosci_hs_smp_defconfig
+++ b/arch/arc/configs/nsimosci_hs_smp_defconfig
@@ -18,7 +18,6 @@ CONFIG_MODULES=y
18# CONFIG_BLK_DEV_BSG is not set 18# CONFIG_BLK_DEV_BSG is not set
19# CONFIG_IOSCHED_DEADLINE is not set 19# CONFIG_IOSCHED_DEADLINE is not set
20# CONFIG_IOSCHED_CFQ is not set 20# CONFIG_IOSCHED_CFQ is not set
21CONFIG_ARC_PLAT_SIM=y
22CONFIG_ISA_ARCV2=y 21CONFIG_ISA_ARCV2=y
23CONFIG_SMP=y 22CONFIG_SMP=y
24# CONFIG_ARC_TIMERS_64BIT is not set 23# CONFIG_ARC_TIMERS_64BIT is not set
diff --git a/arch/arc/configs/tb10x_defconfig b/arch/arc/configs/tb10x_defconfig
index 4c5118384eb5..f30182549395 100644
--- a/arch/arc/configs/tb10x_defconfig
+++ b/arch/arc/configs/tb10x_defconfig
@@ -38,7 +38,6 @@ CONFIG_IP_MULTICAST=y
38# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 38# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
39# CONFIG_INET_XFRM_MODE_TUNNEL is not set 39# CONFIG_INET_XFRM_MODE_TUNNEL is not set
40# CONFIG_INET_XFRM_MODE_BEET is not set 40# CONFIG_INET_XFRM_MODE_BEET is not set
41# CONFIG_INET_LRO is not set
42# CONFIG_INET_DIAG is not set 41# CONFIG_INET_DIAG is not set
43# CONFIG_IPV6 is not set 42# CONFIG_IPV6 is not set
44# CONFIG_WIRELESS is not set 43# CONFIG_WIRELESS is not set
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 19ebddffb279..02fd1cece6ef 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -96,7 +96,9 @@ extern unsigned long perip_base, perip_end;
96#define ARC_REG_SLC_FLUSH 0x904 96#define ARC_REG_SLC_FLUSH 0x904
97#define ARC_REG_SLC_INVALIDATE 0x905 97#define ARC_REG_SLC_INVALIDATE 0x905
98#define ARC_REG_SLC_RGN_START 0x914 98#define ARC_REG_SLC_RGN_START 0x914
99#define ARC_REG_SLC_RGN_START1 0x915
99#define ARC_REG_SLC_RGN_END 0x916 100#define ARC_REG_SLC_RGN_END 0x916
101#define ARC_REG_SLC_RGN_END1 0x917
100 102
101/* Bit val in SLC_CONTROL */ 103/* Bit val in SLC_CONTROL */
102#define SLC_CTRL_DIS 0x001 104#define SLC_CTRL_DIS 0x001
diff --git a/arch/arc/include/asm/mmu.h b/arch/arc/include/asm/mmu.h
index db7319e9b506..efb79fafff1d 100644
--- a/arch/arc/include/asm/mmu.h
+++ b/arch/arc/include/asm/mmu.h
@@ -94,6 +94,8 @@ static inline int is_pae40_enabled(void)
94 return IS_ENABLED(CONFIG_ARC_HAS_PAE40); 94 return IS_ENABLED(CONFIG_ARC_HAS_PAE40);
95} 95}
96 96
97extern int pae40_exist_but_not_enab(void);
98
97#endif /* !__ASSEMBLY__ */ 99#endif /* !__ASSEMBLY__ */
98 100
99#endif 101#endif
diff --git a/arch/arc/kernel/intc-arcv2.c b/arch/arc/kernel/intc-arcv2.c
index f928795fd07a..cf90714a676d 100644
--- a/arch/arc/kernel/intc-arcv2.c
+++ b/arch/arc/kernel/intc-arcv2.c
@@ -75,10 +75,13 @@ void arc_init_IRQ(void)
75 * Set a default priority for all available interrupts to prevent 75 * Set a default priority for all available interrupts to prevent
76 * switching of register banks if Fast IRQ and multiple register banks 76 * switching of register banks if Fast IRQ and multiple register banks
77 * are supported by CPU. 77 * are supported by CPU.
78 * Also disable all IRQ lines so faulty external hardware won't
79 * trigger interrupt that kernel is not ready to handle.
78 */ 80 */
79 for (i = NR_EXCEPTIONS; i < irq_bcr.irqs + NR_EXCEPTIONS; i++) { 81 for (i = NR_EXCEPTIONS; i < irq_bcr.irqs + NR_EXCEPTIONS; i++) {
80 write_aux_reg(AUX_IRQ_SELECT, i); 82 write_aux_reg(AUX_IRQ_SELECT, i);
81 write_aux_reg(AUX_IRQ_PRIORITY, ARCV2_IRQ_DEF_PRIO); 83 write_aux_reg(AUX_IRQ_PRIORITY, ARCV2_IRQ_DEF_PRIO);
84 write_aux_reg(AUX_IRQ_ENABLE, 0);
82 } 85 }
83 86
84 /* setup status32, don't enable intr yet as kernel doesn't want */ 87 /* setup status32, don't enable intr yet as kernel doesn't want */
diff --git a/arch/arc/kernel/intc-compact.c b/arch/arc/kernel/intc-compact.c
index 7e608c6b0a01..cef388025adf 100644
--- a/arch/arc/kernel/intc-compact.c
+++ b/arch/arc/kernel/intc-compact.c
@@ -27,7 +27,7 @@
27 */ 27 */
28void arc_init_IRQ(void) 28void arc_init_IRQ(void)
29{ 29{
30 int level_mask = 0; 30 int level_mask = 0, i;
31 31
32 /* Is timer high priority Interrupt (Level2 in ARCompact jargon) */ 32 /* Is timer high priority Interrupt (Level2 in ARCompact jargon) */
33 level_mask |= IS_ENABLED(CONFIG_ARC_COMPACT_IRQ_LEVELS) << TIMER0_IRQ; 33 level_mask |= IS_ENABLED(CONFIG_ARC_COMPACT_IRQ_LEVELS) << TIMER0_IRQ;
@@ -40,6 +40,18 @@ void arc_init_IRQ(void)
40 40
41 if (level_mask) 41 if (level_mask)
42 pr_info("Level-2 interrupts bitset %x\n", level_mask); 42 pr_info("Level-2 interrupts bitset %x\n", level_mask);
43
44 /*
45 * Disable all IRQ lines so faulty external hardware won't
46 * trigger interrupt that kernel is not ready to handle.
47 */
48 for (i = TIMER0_IRQ; i < NR_CPU_IRQS; i++) {
49 unsigned int ienb;
50
51 ienb = read_aux_reg(AUX_IENABLE);
52 ienb &= ~(1 << i);
53 write_aux_reg(AUX_IENABLE, ienb);
54 }
43} 55}
44 56
45/* 57/*
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
index a867575a758b..7db283b46ebd 100644
--- a/arch/arc/mm/cache.c
+++ b/arch/arc/mm/cache.c
@@ -665,6 +665,7 @@ noinline void slc_op(phys_addr_t paddr, unsigned long sz, const int op)
665 static DEFINE_SPINLOCK(lock); 665 static DEFINE_SPINLOCK(lock);
666 unsigned long flags; 666 unsigned long flags;
667 unsigned int ctrl; 667 unsigned int ctrl;
668 phys_addr_t end;
668 669
669 spin_lock_irqsave(&lock, flags); 670 spin_lock_irqsave(&lock, flags);
670 671
@@ -694,8 +695,19 @@ noinline void slc_op(phys_addr_t paddr, unsigned long sz, const int op)
694 * END needs to be setup before START (latter triggers the operation) 695 * END needs to be setup before START (latter triggers the operation)
695 * END can't be same as START, so add (l2_line_sz - 1) to sz 696 * END can't be same as START, so add (l2_line_sz - 1) to sz
696 */ 697 */
697 write_aux_reg(ARC_REG_SLC_RGN_END, (paddr + sz + l2_line_sz - 1)); 698 end = paddr + sz + l2_line_sz - 1;
698 write_aux_reg(ARC_REG_SLC_RGN_START, paddr); 699 if (is_pae40_enabled())
700 write_aux_reg(ARC_REG_SLC_RGN_END1, upper_32_bits(end));
701
702 write_aux_reg(ARC_REG_SLC_RGN_END, lower_32_bits(end));
703
704 if (is_pae40_enabled())
705 write_aux_reg(ARC_REG_SLC_RGN_START1, upper_32_bits(paddr));
706
707 write_aux_reg(ARC_REG_SLC_RGN_START, lower_32_bits(paddr));
708
709 /* Make sure "busy" bit reports correct stataus, see STAR 9001165532 */
710 read_aux_reg(ARC_REG_SLC_CTRL);
699 711
700 while (read_aux_reg(ARC_REG_SLC_CTRL) & SLC_CTRL_BUSY); 712 while (read_aux_reg(ARC_REG_SLC_CTRL) & SLC_CTRL_BUSY);
701 713
@@ -1111,6 +1123,13 @@ noinline void __init arc_ioc_setup(void)
1111 __dc_enable(); 1123 __dc_enable();
1112} 1124}
1113 1125
1126/*
1127 * Cache related boot time checks/setups only needed on master CPU:
1128 * - Geometry checks (kernel build and hardware agree: e.g. L1_CACHE_BYTES)
1129 * Assume SMP only, so all cores will have same cache config. A check on
1130 * one core suffices for all
1131 * - IOC setup / dma callbacks only need to be done once
1132 */
1114void __init arc_cache_init_master(void) 1133void __init arc_cache_init_master(void)
1115{ 1134{
1116 unsigned int __maybe_unused cpu = smp_processor_id(); 1135 unsigned int __maybe_unused cpu = smp_processor_id();
@@ -1190,12 +1209,27 @@ void __ref arc_cache_init(void)
1190 1209
1191 printk(arc_cache_mumbojumbo(0, str, sizeof(str))); 1210 printk(arc_cache_mumbojumbo(0, str, sizeof(str)));
1192 1211
1193 /*
1194 * Only master CPU needs to execute rest of function:
1195 * - Assume SMP so all cores will have same cache config so
1196 * any geomtry checks will be same for all
1197 * - IOC setup / dma callbacks only need to be setup once
1198 */
1199 if (!cpu) 1212 if (!cpu)
1200 arc_cache_init_master(); 1213 arc_cache_init_master();
1214
1215 /*
1216 * In PAE regime, TLB and cache maintenance ops take wider addresses
1217 * And even if PAE is not enabled in kernel, the upper 32-bits still need
1218 * to be zeroed to keep the ops sane.
1219 * As an optimization for more common !PAE enabled case, zero them out
1220 * once at init, rather than checking/setting to 0 for every runtime op
1221 */
1222 if (is_isa_arcv2() && pae40_exist_but_not_enab()) {
1223
1224 if (IS_ENABLED(CONFIG_ARC_HAS_ICACHE))
1225 write_aux_reg(ARC_REG_IC_PTAG_HI, 0);
1226
1227 if (IS_ENABLED(CONFIG_ARC_HAS_DCACHE))
1228 write_aux_reg(ARC_REG_DC_PTAG_HI, 0);
1229
1230 if (l2_line_sz) {
1231 write_aux_reg(ARC_REG_SLC_RGN_END1, 0);
1232 write_aux_reg(ARC_REG_SLC_RGN_START1, 0);
1233 }
1234 }
1201} 1235}
diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c
index 71d3efff99d3..e9d93604ad0f 100644
--- a/arch/arc/mm/dma.c
+++ b/arch/arc/mm/dma.c
@@ -153,6 +153,19 @@ static void _dma_cache_sync(phys_addr_t paddr, size_t size,
153 } 153 }
154} 154}
155 155
156/*
157 * arc_dma_map_page - map a portion of a page for streaming DMA
158 *
159 * Ensure that any data held in the cache is appropriately discarded
160 * or written back.
161 *
162 * The device owns this memory once this call has completed. The CPU
163 * can regain ownership by calling dma_unmap_page().
164 *
165 * Note: while it takes struct page as arg, caller can "abuse" it to pass
166 * a region larger than PAGE_SIZE, provided it is physically contiguous
167 * and this still works correctly
168 */
156static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page, 169static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page,
157 unsigned long offset, size_t size, enum dma_data_direction dir, 170 unsigned long offset, size_t size, enum dma_data_direction dir,
158 unsigned long attrs) 171 unsigned long attrs)
@@ -165,6 +178,24 @@ static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page,
165 return plat_phys_to_dma(dev, paddr); 178 return plat_phys_to_dma(dev, paddr);
166} 179}
167 180
181/*
182 * arc_dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
183 *
184 * After this call, reads by the CPU to the buffer are guaranteed to see
185 * whatever the device wrote there.
186 *
187 * Note: historically this routine was not implemented for ARC
188 */
189static void arc_dma_unmap_page(struct device *dev, dma_addr_t handle,
190 size_t size, enum dma_data_direction dir,
191 unsigned long attrs)
192{
193 phys_addr_t paddr = plat_dma_to_phys(dev, handle);
194
195 if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
196 _dma_cache_sync(paddr, size, dir);
197}
198
168static int arc_dma_map_sg(struct device *dev, struct scatterlist *sg, 199static int arc_dma_map_sg(struct device *dev, struct scatterlist *sg,
169 int nents, enum dma_data_direction dir, unsigned long attrs) 200 int nents, enum dma_data_direction dir, unsigned long attrs)
170{ 201{
@@ -178,6 +209,18 @@ static int arc_dma_map_sg(struct device *dev, struct scatterlist *sg,
178 return nents; 209 return nents;
179} 210}
180 211
212static void arc_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
213 int nents, enum dma_data_direction dir,
214 unsigned long attrs)
215{
216 struct scatterlist *s;
217 int i;
218
219 for_each_sg(sg, s, nents, i)
220 arc_dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir,
221 attrs);
222}
223
181static void arc_dma_sync_single_for_cpu(struct device *dev, 224static void arc_dma_sync_single_for_cpu(struct device *dev,
182 dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) 225 dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
183{ 226{
@@ -223,7 +266,9 @@ const struct dma_map_ops arc_dma_ops = {
223 .free = arc_dma_free, 266 .free = arc_dma_free,
224 .mmap = arc_dma_mmap, 267 .mmap = arc_dma_mmap,
225 .map_page = arc_dma_map_page, 268 .map_page = arc_dma_map_page,
269 .unmap_page = arc_dma_unmap_page,
226 .map_sg = arc_dma_map_sg, 270 .map_sg = arc_dma_map_sg,
271 .unmap_sg = arc_dma_unmap_sg,
227 .sync_single_for_device = arc_dma_sync_single_for_device, 272 .sync_single_for_device = arc_dma_sync_single_for_device,
228 .sync_single_for_cpu = arc_dma_sync_single_for_cpu, 273 .sync_single_for_cpu = arc_dma_sync_single_for_cpu,
229 .sync_sg_for_cpu = arc_dma_sync_sg_for_cpu, 274 .sync_sg_for_cpu = arc_dma_sync_sg_for_cpu,
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c
index d0126fdfe2d8..b181f3ee38aa 100644
--- a/arch/arc/mm/tlb.c
+++ b/arch/arc/mm/tlb.c
@@ -104,6 +104,8 @@
104/* A copy of the ASID from the PID reg is kept in asid_cache */ 104/* A copy of the ASID from the PID reg is kept in asid_cache */
105DEFINE_PER_CPU(unsigned int, asid_cache) = MM_CTXT_FIRST_CYCLE; 105DEFINE_PER_CPU(unsigned int, asid_cache) = MM_CTXT_FIRST_CYCLE;
106 106
107static int __read_mostly pae_exists;
108
107/* 109/*
108 * Utility Routine to erase a J-TLB entry 110 * Utility Routine to erase a J-TLB entry
109 * Caller needs to setup Index Reg (manually or via getIndex) 111 * Caller needs to setup Index Reg (manually or via getIndex)
@@ -784,7 +786,7 @@ void read_decode_mmu_bcr(void)
784 mmu->u_dtlb = mmu4->u_dtlb * 4; 786 mmu->u_dtlb = mmu4->u_dtlb * 4;
785 mmu->u_itlb = mmu4->u_itlb * 4; 787 mmu->u_itlb = mmu4->u_itlb * 4;
786 mmu->sasid = mmu4->sasid; 788 mmu->sasid = mmu4->sasid;
787 mmu->pae = mmu4->pae; 789 pae_exists = mmu->pae = mmu4->pae;
788 } 790 }
789} 791}
790 792
@@ -809,6 +811,11 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len)
809 return buf; 811 return buf;
810} 812}
811 813
814int pae40_exist_but_not_enab(void)
815{
816 return pae_exists && !is_pae40_enabled();
817}
818
812void arc_mmu_init(void) 819void arc_mmu_init(void)
813{ 820{
814 char str[256]; 821 char str[256];
@@ -859,6 +866,9 @@ void arc_mmu_init(void)
859 /* swapper_pg_dir is the pgd for the kernel, used by vmalloc */ 866 /* swapper_pg_dir is the pgd for the kernel, used by vmalloc */
860 write_aux_reg(ARC_REG_SCRATCH_DATA0, swapper_pg_dir); 867 write_aux_reg(ARC_REG_SCRATCH_DATA0, swapper_pg_dir);
861#endif 868#endif
869
870 if (pae40_exist_but_not_enab())
871 write_aux_reg(ARC_REG_TLBPD1HI, 0);
862} 872}
863 873
864/* 874/*
diff --git a/arch/arc/plat-sim/Kconfig b/arch/arc/plat-sim/Kconfig
deleted file mode 100644
index ac6af96a82f3..000000000000
--- a/arch/arc/plat-sim/Kconfig
+++ /dev/null
@@ -1,13 +0,0 @@
1#
2# Copyright (C) 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License version 2 as
6# published by the Free Software Foundation.
7#
8
9menuconfig ARC_PLAT_SIM
10 bool "ARC nSIM based simulation virtual platforms"
11 help
12 Support for nSIM based ARC simulation platforms
13 This includes the standalone nSIM (uart only) vs. System C OSCI VP
diff --git a/arch/arc/plat-sim/platform.c b/arch/arc/plat-sim/platform.c
index aea87389e44b..5cda56b1a2ea 100644
--- a/arch/arc/plat-sim/platform.c
+++ b/arch/arc/plat-sim/platform.c
@@ -20,11 +20,14 @@
20 */ 20 */
21 21
22static const char *simulation_compat[] __initconst = { 22static const char *simulation_compat[] __initconst = {
23#ifdef CONFIG_ISA_ARCOMPACT
23 "snps,nsim", 24 "snps,nsim",
24 "snps,nsim_hs",
25 "snps,nsimosci", 25 "snps,nsimosci",
26#else
27 "snps,nsim_hs",
26 "snps,nsimosci_hs", 28 "snps,nsimosci_hs",
27 "snps,zebu_hs", 29 "snps,zebu_hs",
30#endif
28 NULL, 31 NULL,
29}; 32};
30 33
diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_32.h
index 0efd0583a8c9..6249214148c2 100644
--- a/arch/sparc/include/asm/page_32.h
+++ b/arch/sparc/include/asm/page_32.h
@@ -68,6 +68,7 @@ typedef struct { unsigned long iopgprot; } iopgprot_t;
68#define iopgprot_val(x) ((x).iopgprot) 68#define iopgprot_val(x) ((x).iopgprot)
69 69
70#define __pte(x) ((pte_t) { (x) } ) 70#define __pte(x) ((pte_t) { (x) } )
71#define __pmd(x) ((pmd_t) { { (x) }, })
71#define __iopte(x) ((iopte_t) { (x) } ) 72#define __iopte(x) ((iopte_t) { (x) } )
72#define __pgd(x) ((pgd_t) { (x) } ) 73#define __pgd(x) ((pgd_t) { (x) } )
73#define __ctxd(x) ((ctxd_t) { (x) } ) 74#define __ctxd(x) ((ctxd_t) { (x) } )
@@ -95,6 +96,7 @@ typedef unsigned long iopgprot_t;
95#define iopgprot_val(x) (x) 96#define iopgprot_val(x) (x)
96 97
97#define __pte(x) (x) 98#define __pte(x) (x)
99#define __pmd(x) ((pmd_t) { { (x) }, })
98#define __iopte(x) (x) 100#define __iopte(x) (x)
99#define __pgd(x) (x) 101#define __pgd(x) (x)
100#define __ctxd(x) (x) 102#define __ctxd(x) (x)
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index f10e2f712394..9ebebf1fd93d 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -1266,8 +1266,6 @@ static int pci_sun4v_probe(struct platform_device *op)
1266 * ATU group, but ATU hcalls won't be available. 1266 * ATU group, but ATU hcalls won't be available.
1267 */ 1267 */
1268 hv_atu = false; 1268 hv_atu = false;
1269 pr_err(PFX "Could not register hvapi ATU err=%d\n",
1270 err);
1271 } else { 1269 } else {
1272 pr_info(PFX "Registered hvapi ATU major[%lu] minor[%lu]\n", 1270 pr_info(PFX "Registered hvapi ATU major[%lu] minor[%lu]\n",
1273 vatu_major, vatu_minor); 1271 vatu_major, vatu_minor);
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index a38787b84322..732af9a9f6dd 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -602,7 +602,7 @@ void pcibios_fixup_bus(struct pci_bus *bus)
602{ 602{
603 struct pci_dev *dev; 603 struct pci_dev *dev;
604 int i, has_io, has_mem; 604 int i, has_io, has_mem;
605 unsigned int cmd; 605 unsigned int cmd = 0;
606 struct linux_pcic *pcic; 606 struct linux_pcic *pcic;
607 /* struct linux_pbm_info* pbm = &pcic->pbm; */ 607 /* struct linux_pbm_info* pbm = &pcic->pbm; */
608 int node; 608 int node;
diff --git a/arch/sparc/lib/multi3.S b/arch/sparc/lib/multi3.S
index d6b6c97fe3c7..703127aaf4a5 100644
--- a/arch/sparc/lib/multi3.S
+++ b/arch/sparc/lib/multi3.S
@@ -5,26 +5,26 @@
5 .align 4 5 .align 4
6ENTRY(__multi3) /* %o0 = u, %o1 = v */ 6ENTRY(__multi3) /* %o0 = u, %o1 = v */
7 mov %o1, %g1 7 mov %o1, %g1
8 srl %o3, 0, %g4 8 srl %o3, 0, %o4
9 mulx %g4, %g1, %o1 9 mulx %o4, %g1, %o1
10 srlx %g1, 0x20, %g3 10 srlx %g1, 0x20, %g3
11 mulx %g3, %g4, %g5 11 mulx %g3, %o4, %g7
12 sllx %g5, 0x20, %o5 12 sllx %g7, 0x20, %o5
13 srl %g1, 0, %g4 13 srl %g1, 0, %o4
14 sub %o1, %o5, %o5 14 sub %o1, %o5, %o5
15 srlx %o5, 0x20, %o5 15 srlx %o5, 0x20, %o5
16 addcc %g5, %o5, %g5 16 addcc %g7, %o5, %g7
17 srlx %o3, 0x20, %o5 17 srlx %o3, 0x20, %o5
18 mulx %g4, %o5, %g4 18 mulx %o4, %o5, %o4
19 mulx %g3, %o5, %o5 19 mulx %g3, %o5, %o5
20 sethi %hi(0x80000000), %g3 20 sethi %hi(0x80000000), %g3
21 addcc %g5, %g4, %g5 21 addcc %g7, %o4, %g7
22 srlx %g5, 0x20, %g5 22 srlx %g7, 0x20, %g7
23 add %g3, %g3, %g3 23 add %g3, %g3, %g3
24 movcc %xcc, %g0, %g3 24 movcc %xcc, %g0, %g3
25 addcc %o5, %g5, %o5 25 addcc %o5, %g7, %o5
26 sllx %g4, 0x20, %g4 26 sllx %o4, 0x20, %o4
27 add %o1, %g4, %o1 27 add %o1, %o4, %o1
28 add %o5, %g3, %g2 28 add %o5, %g3, %g2
29 mulx %g1, %o2, %g1 29 mulx %g1, %o2, %g1
30 add %g1, %g2, %g1 30 add %g1, %g2, %g1
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index e338c3743562..45c65f805fd6 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -557,7 +557,7 @@ static void mvebu_gpio_irq_handler(struct irq_desc *desc)
557 edge_cause = mvebu_gpio_read_edge_cause(mvchip); 557 edge_cause = mvebu_gpio_read_edge_cause(mvchip);
558 edge_mask = mvebu_gpio_read_edge_mask(mvchip); 558 edge_mask = mvebu_gpio_read_edge_mask(mvchip);
559 559
560 cause = (data_in ^ level_mask) | (edge_cause & edge_mask); 560 cause = (data_in & level_mask) | (edge_cause & edge_mask);
561 561
562 for (i = 0; i < mvchip->chip.ngpio; i++) { 562 for (i = 0; i < mvchip->chip.ngpio; i++) {
563 int irq; 563 int irq;
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 16fe9742597b..fc80add5fedb 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -2,6 +2,7 @@
2#include <linux/mutex.h> 2#include <linux/mutex.h>
3#include <linux/device.h> 3#include <linux/device.h>
4#include <linux/sysfs.h> 4#include <linux/sysfs.h>
5#include <linux/gpio.h>
5#include <linux/gpio/consumer.h> 6#include <linux/gpio/consumer.h>
6#include <linux/gpio/driver.h> 7#include <linux/gpio/driver.h>
7#include <linux/interrupt.h> 8#include <linux/interrupt.h>
@@ -432,6 +433,11 @@ static struct attribute *gpiochip_attrs[] = {
432}; 433};
433ATTRIBUTE_GROUPS(gpiochip); 434ATTRIBUTE_GROUPS(gpiochip);
434 435
436static struct gpio_desc *gpio_to_valid_desc(int gpio)
437{
438 return gpio_is_valid(gpio) ? gpio_to_desc(gpio) : NULL;
439}
440
435/* 441/*
436 * /sys/class/gpio/export ... write-only 442 * /sys/class/gpio/export ... write-only
437 * integer N ... number of GPIO to export (full access) 443 * integer N ... number of GPIO to export (full access)
@@ -450,7 +456,7 @@ static ssize_t export_store(struct class *class,
450 if (status < 0) 456 if (status < 0)
451 goto done; 457 goto done;
452 458
453 desc = gpio_to_desc(gpio); 459 desc = gpio_to_valid_desc(gpio);
454 /* reject invalid GPIOs */ 460 /* reject invalid GPIOs */
455 if (!desc) { 461 if (!desc) {
456 pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); 462 pr_warn("%s: invalid GPIO %ld\n", __func__, gpio);
@@ -493,7 +499,7 @@ static ssize_t unexport_store(struct class *class,
493 if (status < 0) 499 if (status < 0)
494 goto done; 500 goto done;
495 501
496 desc = gpio_to_desc(gpio); 502 desc = gpio_to_valid_desc(gpio);
497 /* reject bogus commands (gpio_unexport ignores them) */ 503 /* reject bogus commands (gpio_unexport ignores them) */
498 if (!desc) { 504 if (!desc) {
499 pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); 505 pr_warn("%s: invalid GPIO %ld\n", __func__, gpio);
diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c
index fbe0f245ce8e..fe1811523e4a 100644
--- a/drivers/mfd/da9062-core.c
+++ b/drivers/mfd/da9062-core.c
@@ -645,6 +645,9 @@ static const struct regmap_range da9062_aa_readable_ranges[] = {
645 .range_min = DA9062AA_VLDO1_B, 645 .range_min = DA9062AA_VLDO1_B,
646 .range_max = DA9062AA_VLDO4_B, 646 .range_max = DA9062AA_VLDO4_B,
647 }, { 647 }, {
648 .range_min = DA9062AA_BBAT_CONT,
649 .range_max = DA9062AA_BBAT_CONT,
650 }, {
648 .range_min = DA9062AA_INTERFACE, 651 .range_min = DA9062AA_INTERFACE,
649 .range_max = DA9062AA_CONFIG_E, 652 .range_max = DA9062AA_CONFIG_E,
650 }, { 653 }, {
@@ -721,6 +724,9 @@ static const struct regmap_range da9062_aa_writeable_ranges[] = {
721 .range_min = DA9062AA_VLDO1_B, 724 .range_min = DA9062AA_VLDO1_B,
722 .range_max = DA9062AA_VLDO4_B, 725 .range_max = DA9062AA_VLDO4_B,
723 }, { 726 }, {
727 .range_min = DA9062AA_BBAT_CONT,
728 .range_max = DA9062AA_BBAT_CONT,
729 }, {
724 .range_min = DA9062AA_GP_ID_0, 730 .range_min = DA9062AA_GP_ID_0,
725 .range_max = DA9062AA_GP_ID_19, 731 .range_max = DA9062AA_GP_ID_19,
726 }, 732 },
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 09b9bc17bce9..5fe5cdc51357 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -432,7 +432,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
432 /* Virtual PCI function needs to determine UAR page size from 432 /* Virtual PCI function needs to determine UAR page size from
433 * firmware. Only master PCI function can set the uar page size 433 * firmware. Only master PCI function can set the uar page size
434 */ 434 */
435 if (enable_4k_uar) 435 if (enable_4k_uar || !dev->persist->num_vfs)
436 dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT; 436 dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT;
437 else 437 else
438 dev->uar_page_shift = PAGE_SHIFT; 438 dev->uar_page_shift = PAGE_SHIFT;
@@ -2277,7 +2277,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
2277 2277
2278 dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; 2278 dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1;
2279 2279
2280 if (enable_4k_uar) { 2280 if (enable_4k_uar || !dev->persist->num_vfs) {
2281 init_hca.log_uar_sz = ilog2(dev->caps.num_uars) + 2281 init_hca.log_uar_sz = ilog2(dev->caps.num_uars) +
2282 PAGE_SHIFT - DEFAULT_UAR_PAGE_SHIFT; 2282 PAGE_SHIFT - DEFAULT_UAR_PAGE_SHIFT;
2283 init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12; 2283 init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 4631ca8b8eb2..9f77ce038a4a 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -908,8 +908,7 @@ static int nfp_net_tx(struct sk_buff *skb, struct net_device *netdev)
908 return NETDEV_TX_OK; 908 return NETDEV_TX_OK;
909 909
910err_unmap: 910err_unmap:
911 --f; 911 while (--f >= 0) {
912 while (f >= 0) {
913 frag = &skb_shinfo(skb)->frags[f]; 912 frag = &skb_shinfo(skb)->frags[f];
914 dma_unmap_page(dp->dev, tx_ring->txbufs[wr_idx].dma_addr, 913 dma_unmap_page(dp->dev, tx_ring->txbufs[wr_idx].dma_addr,
915 skb_frag_size(frag), DMA_TO_DEVICE); 914 skb_frag_size(frag), DMA_TO_DEVICE);
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
index 66ff15d08bad..0a66389c06c2 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
@@ -2311,7 +2311,7 @@ netxen_md_rdqueue(struct netxen_adapter *adapter,
2311 loop_cnt++) { 2311 loop_cnt++) {
2312 NX_WR_DUMP_REG(select_addr, adapter->ahw.pci_base0, queue_id); 2312 NX_WR_DUMP_REG(select_addr, adapter->ahw.pci_base0, queue_id);
2313 read_addr = queueEntry->read_addr; 2313 read_addr = queueEntry->read_addr;
2314 for (k = 0; k < read_cnt; k--) { 2314 for (k = 0; k < read_cnt; k++) {
2315 NX_RD_DUMP_REG(read_addr, adapter->ahw.pci_base0, 2315 NX_RD_DUMP_REG(read_addr, adapter->ahw.pci_base0,
2316 &read_value); 2316 &read_value);
2317 *data_buff++ = read_value; 2317 *data_buff++ = read_value;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 32ad87345f57..0a2c0a42283f 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1879,6 +1879,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1879 1879
1880err_detach: 1880err_detach:
1881 tun_detach_all(dev); 1881 tun_detach_all(dev);
1882 /* register_netdevice() already called tun_free_netdev() */
1883 goto err_free_dev;
1884
1882err_free_flow: 1885err_free_flow:
1883 tun_flow_uninit(tun); 1886 tun_flow_uninit(tun);
1884 security_tun_dev_free_security(tun->security); 1887 security_tun_dev_free_security(tun->security);
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index da5570cf5c6a..fdf65a6c13f6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -514,7 +514,7 @@ EXPORT_SYMBOL(pci_find_resource);
514 */ 514 */
515struct pci_dev *pci_find_pcie_root_port(struct pci_dev *dev) 515struct pci_dev *pci_find_pcie_root_port(struct pci_dev *dev)
516{ 516{
517 struct pci_dev *bridge, *highest_pcie_bridge = NULL; 517 struct pci_dev *bridge, *highest_pcie_bridge = dev;
518 518
519 bridge = pci_upstream_bridge(dev); 519 bridge = pci_upstream_bridge(dev);
520 while (bridge && pci_is_pcie(bridge)) { 520 while (bridge && pci_is_pcie(bridge)) {
@@ -522,11 +522,10 @@ struct pci_dev *pci_find_pcie_root_port(struct pci_dev *dev)
522 bridge = pci_upstream_bridge(bridge); 522 bridge = pci_upstream_bridge(bridge);
523 } 523 }
524 524
525 if (highest_pcie_bridge && 525 if (pci_pcie_type(highest_pcie_bridge) != PCI_EXP_TYPE_ROOT_PORT)
526 pci_pcie_type(highest_pcie_bridge) == PCI_EXP_TYPE_ROOT_PORT) 526 return NULL;
527 return highest_pcie_bridge;
528 527
529 return NULL; 528 return highest_pcie_bridge;
530} 529}
531EXPORT_SYMBOL(pci_find_pcie_root_port); 530EXPORT_SYMBOL(pci_find_pcie_root_port);
532 531
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 4fac49e55d47..4b43aa62fbc7 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -1301,7 +1301,6 @@ static void ds1307_clks_register(struct ds1307 *ds1307)
1301static const struct regmap_config regmap_config = { 1301static const struct regmap_config regmap_config = {
1302 .reg_bits = 8, 1302 .reg_bits = 8,
1303 .val_bits = 8, 1303 .val_bits = 8,
1304 .max_register = 0x12,
1305}; 1304};
1306 1305
1307static int ds1307_probe(struct i2c_client *client, 1306static int ds1307_probe(struct i2c_client *client,
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index f4538d7a3016..d145e0d90227 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -47,6 +47,17 @@ config SCSI_NETLINK
47 default n 47 default n
48 depends on NET 48 depends on NET
49 49
50config SCSI_MQ_DEFAULT
51 bool "SCSI: use blk-mq I/O path by default"
52 depends on SCSI
53 ---help---
54 This option enables the new blk-mq based I/O path for SCSI
55 devices by default. With the option the scsi_mod.use_blk_mq
56 module/boot option defaults to Y, without it to N, but it can
57 still be overridden either way.
58
59 If unsure say N.
60
50config SCSI_PROC_FS 61config SCSI_PROC_FS
51 bool "legacy /proc/scsi/ support" 62 bool "legacy /proc/scsi/ support"
52 depends on SCSI && PROC_FS 63 depends on SCSI && PROC_FS
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 4591113c49de..a1a2c71e1626 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -549,7 +549,9 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
549 if ((le32_to_cpu(get_name_reply->status) == CT_OK) 549 if ((le32_to_cpu(get_name_reply->status) == CT_OK)
550 && (get_name_reply->data[0] != '\0')) { 550 && (get_name_reply->data[0] != '\0')) {
551 char *sp = get_name_reply->data; 551 char *sp = get_name_reply->data;
552 sp[sizeof(((struct aac_get_name_resp *)NULL)->data)] = '\0'; 552 int data_size = FIELD_SIZEOF(struct aac_get_name_resp, data);
553
554 sp[data_size - 1] = '\0';
553 while (*sp == ' ') 555 while (*sp == ' ')
554 ++sp; 556 ++sp;
555 if (*sp) { 557 if (*sp) {
@@ -579,12 +581,15 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
579static int aac_get_container_name(struct scsi_cmnd * scsicmd) 581static int aac_get_container_name(struct scsi_cmnd * scsicmd)
580{ 582{
581 int status; 583 int status;
584 int data_size;
582 struct aac_get_name *dinfo; 585 struct aac_get_name *dinfo;
583 struct fib * cmd_fibcontext; 586 struct fib * cmd_fibcontext;
584 struct aac_dev * dev; 587 struct aac_dev * dev;
585 588
586 dev = (struct aac_dev *)scsicmd->device->host->hostdata; 589 dev = (struct aac_dev *)scsicmd->device->host->hostdata;
587 590
591 data_size = FIELD_SIZEOF(struct aac_get_name_resp, data);
592
588 cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); 593 cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
589 594
590 aac_fib_init(cmd_fibcontext); 595 aac_fib_init(cmd_fibcontext);
@@ -593,7 +598,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
593 dinfo->command = cpu_to_le32(VM_ContainerConfig); 598 dinfo->command = cpu_to_le32(VM_ContainerConfig);
594 dinfo->type = cpu_to_le32(CT_READ_NAME); 599 dinfo->type = cpu_to_le32(CT_READ_NAME);
595 dinfo->cid = cpu_to_le32(scmd_id(scsicmd)); 600 dinfo->cid = cpu_to_le32(scmd_id(scsicmd));
596 dinfo->count = cpu_to_le32(sizeof(((struct aac_get_name_resp *)NULL)->data)); 601 dinfo->count = cpu_to_le32(data_size - 1);
597 602
598 status = aac_fib_send(ContainerCommand, 603 status = aac_fib_send(ContainerCommand,
599 cmd_fibcontext, 604 cmd_fibcontext,
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index d31a9bc2ba69..ee2667e20e42 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -2274,7 +2274,7 @@ struct aac_get_name_resp {
2274 __le32 parm3; 2274 __le32 parm3;
2275 __le32 parm4; 2275 __le32 parm4;
2276 __le32 parm5; 2276 __le32 parm5;
2277 u8 data[16]; 2277 u8 data[17];
2278}; 2278};
2279 2279
2280#define CT_CID_TO_32BITS_UID 165 2280#define CT_CID_TO_32BITS_UID 165
diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index 2029ad225121..5be0086142ca 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -3845,8 +3845,10 @@ csio_hw_start(struct csio_hw *hw)
3845 3845
3846 if (csio_is_hw_ready(hw)) 3846 if (csio_is_hw_ready(hw))
3847 return 0; 3847 return 0;
3848 else 3848 else if (csio_match_state(hw, csio_hws_uninit))
3849 return -EINVAL; 3849 return -EINVAL;
3850 else
3851 return -ENODEV;
3850} 3852}
3851 3853
3852int 3854int
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index ea0c31086cc6..dcd074169aa9 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -969,10 +969,14 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
969 969
970 pci_set_drvdata(pdev, hw); 970 pci_set_drvdata(pdev, hw);
971 971
972 if (csio_hw_start(hw) != 0) { 972 rv = csio_hw_start(hw);
973 dev_err(&pdev->dev, 973 if (rv) {
974 "Failed to start FW, continuing in debug mode.\n"); 974 if (rv == -EINVAL) {
975 return 0; 975 dev_err(&pdev->dev,
976 "Failed to start FW, continuing in debug mode.\n");
977 return 0;
978 }
979 goto err_lnode_exit;
976 } 980 }
977 981
978 sprintf(hw->fwrev_str, "%u.%u.%u.%u\n", 982 sprintf(hw->fwrev_str, "%u.%u.%u.%u\n",
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index a69a9ac836f5..1d02cf9fe06c 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -1635,6 +1635,9 @@ static int init_act_open(struct cxgbi_sock *csk)
1635 goto rel_resource; 1635 goto rel_resource;
1636 } 1636 }
1637 1637
1638 if (!(n->nud_state & NUD_VALID))
1639 neigh_event_send(n, NULL);
1640
1638 csk->atid = cxgb4_alloc_atid(lldi->tids, csk); 1641 csk->atid = cxgb4_alloc_atid(lldi->tids, csk);
1639 if (csk->atid < 0) { 1642 if (csk->atid < 0) {
1640 pr_err("%s, NO atid available.\n", ndev->name); 1643 pr_err("%s, NO atid available.\n", ndev->name);
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 316c3df0c3fd..71c4746341ea 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6228,8 +6228,8 @@ static int megasas_probe_one(struct pci_dev *pdev,
6228fail_start_aen: 6228fail_start_aen:
6229fail_io_attach: 6229fail_io_attach:
6230 megasas_mgmt_info.count--; 6230 megasas_mgmt_info.count--;
6231 megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
6232 megasas_mgmt_info.max_index--; 6231 megasas_mgmt_info.max_index--;
6232 megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
6233 6233
6234 instance->instancet->disable_intr(instance); 6234 instance->instancet->disable_intr(instance);
6235 megasas_destroy_irqs(instance); 6235 megasas_destroy_irqs(instance);
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 3d38c6d463b8..1bf274e3b2b6 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -800,7 +800,11 @@ MODULE_LICENSE("GPL");
800module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR); 800module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR);
801MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels"); 801MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");
802 802
803#ifdef CONFIG_SCSI_MQ_DEFAULT
803bool scsi_use_blk_mq = true; 804bool scsi_use_blk_mq = true;
805#else
806bool scsi_use_blk_mq = false;
807#endif
804module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO); 808module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);
805 809
806static int __init init_scsi(void) 810static int __init init_scsi(void)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index bea36adeee17..e2647f2d4430 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1277,6 +1277,9 @@ static void sd_uninit_command(struct scsi_cmnd *SCpnt)
1277{ 1277{
1278 struct request *rq = SCpnt->request; 1278 struct request *rq = SCpnt->request;
1279 1279
1280 if (SCpnt->flags & SCMD_ZONE_WRITE_LOCK)
1281 sd_zbc_write_unlock_zone(SCpnt);
1282
1280 if (rq->rq_flags & RQF_SPECIAL_PAYLOAD) 1283 if (rq->rq_flags & RQF_SPECIAL_PAYLOAD)
1281 __free_page(rq->special_vec.bv_page); 1284 __free_page(rq->special_vec.bv_page);
1282 1285
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index 96855df9f49d..8aa54779aac1 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -294,6 +294,9 @@ int sd_zbc_write_lock_zone(struct scsi_cmnd *cmd)
294 test_and_set_bit(zno, sdkp->zones_wlock)) 294 test_and_set_bit(zno, sdkp->zones_wlock))
295 return BLKPREP_DEFER; 295 return BLKPREP_DEFER;
296 296
297 WARN_ON_ONCE(cmd->flags & SCMD_ZONE_WRITE_LOCK);
298 cmd->flags |= SCMD_ZONE_WRITE_LOCK;
299
297 return BLKPREP_OK; 300 return BLKPREP_OK;
298} 301}
299 302
@@ -302,9 +305,10 @@ void sd_zbc_write_unlock_zone(struct scsi_cmnd *cmd)
302 struct request *rq = cmd->request; 305 struct request *rq = cmd->request;
303 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); 306 struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
304 307
305 if (sdkp->zones_wlock) { 308 if (sdkp->zones_wlock && cmd->flags & SCMD_ZONE_WRITE_LOCK) {
306 unsigned int zno = sd_zbc_zone_no(sdkp, blk_rq_pos(rq)); 309 unsigned int zno = sd_zbc_zone_no(sdkp, blk_rq_pos(rq));
307 WARN_ON_ONCE(!test_bit(zno, sdkp->zones_wlock)); 310 WARN_ON_ONCE(!test_bit(zno, sdkp->zones_wlock));
311 cmd->flags &= ~SCMD_ZONE_WRITE_LOCK;
308 clear_bit_unlock(zno, sdkp->zones_wlock); 312 clear_bit_unlock(zno, sdkp->zones_wlock);
309 smp_mb__after_atomic(); 313 smp_mb__after_atomic();
310 } 314 }
@@ -335,9 +339,6 @@ void sd_zbc_complete(struct scsi_cmnd *cmd,
335 case REQ_OP_WRITE_ZEROES: 339 case REQ_OP_WRITE_ZEROES:
336 case REQ_OP_WRITE_SAME: 340 case REQ_OP_WRITE_SAME:
337 341
338 /* Unlock the zone */
339 sd_zbc_write_unlock_zone(cmd);
340
341 if (result && 342 if (result &&
342 sshdr->sense_key == ILLEGAL_REQUEST && 343 sshdr->sense_key == ILLEGAL_REQUEST &&
343 sshdr->asc == 0x21) 344 sshdr->asc == 0x21)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 5a1052627a81..701085620cd8 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2300,7 +2300,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
2300 EXT4_MAX_BLOCK_LOG_SIZE); 2300 EXT4_MAX_BLOCK_LOG_SIZE);
2301 struct sg { 2301 struct sg {
2302 struct ext4_group_info info; 2302 struct ext4_group_info info;
2303 ext4_grpblk_t counters[blocksize_bits + 2]; 2303 ext4_grpblk_t counters[EXT4_MAX_BLOCK_LOG_SIZE + 2];
2304 } sg; 2304 } sg;
2305 2305
2306 group--; 2306 group--;
@@ -2309,6 +2309,9 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
2309 " 2^0 2^1 2^2 2^3 2^4 2^5 2^6 " 2309 " 2^0 2^1 2^2 2^3 2^4 2^5 2^6 "
2310 " 2^7 2^8 2^9 2^10 2^11 2^12 2^13 ]\n"); 2310 " 2^7 2^8 2^9 2^10 2^11 2^12 2^13 ]\n");
2311 2311
2312 i = (blocksize_bits + 2) * sizeof(sg.info.bb_counters[0]) +
2313 sizeof(struct ext4_group_info);
2314
2312 grinfo = ext4_get_group_info(sb, group); 2315 grinfo = ext4_get_group_info(sb, group);
2313 /* Load the group info in memory only if not already loaded. */ 2316 /* Load the group info in memory only if not already loaded. */
2314 if (unlikely(EXT4_MB_GRP_NEED_INIT(grinfo))) { 2317 if (unlikely(EXT4_MB_GRP_NEED_INIT(grinfo))) {
@@ -2320,7 +2323,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
2320 buddy_loaded = 1; 2323 buddy_loaded = 1;
2321 } 2324 }
2322 2325
2323 memcpy(&sg, ext4_get_group_info(sb, group), sizeof(sg)); 2326 memcpy(&sg, ext4_get_group_info(sb, group), i);
2324 2327
2325 if (buddy_loaded) 2328 if (buddy_loaded)
2326 ext4_mb_unload_buddy(&e4b); 2329 ext4_mb_unload_buddy(&e4b);
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 82a5af9f6668..3dd970168448 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1543,7 +1543,7 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i,
1543 /* Clear padding bytes. */ 1543 /* Clear padding bytes. */
1544 memset(val + i->value_len, 0, new_size - i->value_len); 1544 memset(val + i->value_len, 0, new_size - i->value_len);
1545 } 1545 }
1546 return 0; 1546 goto update_hash;
1547 } 1547 }
1548 1548
1549 /* Compute min_offs and last. */ 1549 /* Compute min_offs and last. */
@@ -1707,6 +1707,7 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i,
1707 here->e_value_size = cpu_to_le32(i->value_len); 1707 here->e_value_size = cpu_to_le32(i->value_len);
1708 } 1708 }
1709 1709
1710update_hash:
1710 if (i->value) { 1711 if (i->value) {
1711 __le32 hash = 0; 1712 __le32 hash = 0;
1712 1713
@@ -1725,7 +1726,8 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i,
1725 here->e_name_len, 1726 here->e_name_len,
1726 &crc32c_hash, 1); 1727 &crc32c_hash, 1);
1727 } else if (is_block) { 1728 } else if (is_block) {
1728 __le32 *value = s->base + min_offs - new_size; 1729 __le32 *value = s->base + le16_to_cpu(
1730 here->e_value_offs);
1729 1731
1730 hash = ext4_xattr_hash_entry(here->e_name, 1732 hash = ext4_xattr_hash_entry(here->e_name,
1731 here->e_name_len, value, 1733 here->e_name_len, value,
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 4d179316e431..719582744a2e 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -8,7 +8,9 @@ enum pid_type
8 PIDTYPE_PID, 8 PIDTYPE_PID,
9 PIDTYPE_PGID, 9 PIDTYPE_PGID,
10 PIDTYPE_SID, 10 PIDTYPE_SID,
11 PIDTYPE_MAX 11 PIDTYPE_MAX,
12 /* only valid to __task_pid_nr_ns() */
13 __PIDTYPE_TGID
12}; 14};
13 15
14/* 16/*
diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
index d8c97ec8a8e6..37b4bb2545b3 100644
--- a/include/linux/ptr_ring.h
+++ b/include/linux/ptr_ring.h
@@ -436,9 +436,9 @@ static inline int ptr_ring_consume_batched_bh(struct ptr_ring *r,
436 __PTR_RING_PEEK_CALL_v; \ 436 __PTR_RING_PEEK_CALL_v; \
437}) 437})
438 438
439static inline void **__ptr_ring_init_queue_alloc(int size, gfp_t gfp) 439static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp)
440{ 440{
441 return kzalloc(ALIGN(size * sizeof(void *), SMP_CACHE_BYTES), gfp); 441 return kcalloc(size, sizeof(void *), gfp);
442} 442}
443 443
444static inline void __ptr_ring_set_size(struct ptr_ring *r, int size) 444static inline void __ptr_ring_set_size(struct ptr_ring *r, int size)
@@ -582,7 +582,8 @@ static inline int ptr_ring_resize(struct ptr_ring *r, int size, gfp_t gfp,
582 * In particular if you consume ring in interrupt or BH context, you must 582 * In particular if you consume ring in interrupt or BH context, you must
583 * disable interrupts/BH when doing so. 583 * disable interrupts/BH when doing so.
584 */ 584 */
585static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, int nrings, 585static inline int ptr_ring_resize_multiple(struct ptr_ring **rings,
586 unsigned int nrings,
586 int size, 587 int size,
587 gfp_t gfp, void (*destroy)(void *)) 588 gfp_t gfp, void (*destroy)(void *))
588{ 589{
@@ -590,7 +591,7 @@ static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, int nrings,
590 void ***queues; 591 void ***queues;
591 int i; 592 int i;
592 593
593 queues = kmalloc(nrings * sizeof *queues, gfp); 594 queues = kmalloc_array(nrings, sizeof(*queues), gfp);
594 if (!queues) 595 if (!queues)
595 goto noqueues; 596 goto noqueues;
596 597
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8337e2db0bb2..c05ac5f5aa03 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1163,13 +1163,6 @@ static inline pid_t task_tgid_nr(struct task_struct *tsk)
1163 return tsk->tgid; 1163 return tsk->tgid;
1164} 1164}
1165 1165
1166extern pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns);
1167
1168static inline pid_t task_tgid_vnr(struct task_struct *tsk)
1169{
1170 return pid_vnr(task_tgid(tsk));
1171}
1172
1173/** 1166/**
1174 * pid_alive - check that a task structure is not stale 1167 * pid_alive - check that a task structure is not stale
1175 * @p: Task structure to be checked. 1168 * @p: Task structure to be checked.
@@ -1185,23 +1178,6 @@ static inline int pid_alive(const struct task_struct *p)
1185 return p->pids[PIDTYPE_PID].pid != NULL; 1178 return p->pids[PIDTYPE_PID].pid != NULL;
1186} 1179}
1187 1180
1188static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
1189{
1190 pid_t pid = 0;
1191
1192 rcu_read_lock();
1193 if (pid_alive(tsk))
1194 pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns);
1195 rcu_read_unlock();
1196
1197 return pid;
1198}
1199
1200static inline pid_t task_ppid_nr(const struct task_struct *tsk)
1201{
1202 return task_ppid_nr_ns(tsk, &init_pid_ns);
1203}
1204
1205static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) 1181static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1206{ 1182{
1207 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns); 1183 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
@@ -1223,6 +1199,33 @@ static inline pid_t task_session_vnr(struct task_struct *tsk)
1223 return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL); 1199 return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL);
1224} 1200}
1225 1201
1202static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1203{
1204 return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns);
1205}
1206
1207static inline pid_t task_tgid_vnr(struct task_struct *tsk)
1208{
1209 return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, NULL);
1210}
1211
1212static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
1213{
1214 pid_t pid = 0;
1215
1216 rcu_read_lock();
1217 if (pid_alive(tsk))
1218 pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns);
1219 rcu_read_unlock();
1220
1221 return pid;
1222}
1223
1224static inline pid_t task_ppid_nr(const struct task_struct *tsk)
1225{
1226 return task_ppid_nr_ns(tsk, &init_pid_ns);
1227}
1228
1226/* Obsolete, do not use: */ 1229/* Obsolete, do not use: */
1227static inline pid_t task_pgrp_nr(struct task_struct *tsk) 1230static inline pid_t task_pgrp_nr(struct task_struct *tsk)
1228{ 1231{
diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h
index 35226cd4efb0..8621ffdeecbf 100644
--- a/include/linux/skb_array.h
+++ b/include/linux/skb_array.h
@@ -193,7 +193,8 @@ static inline int skb_array_resize(struct skb_array *a, int size, gfp_t gfp)
193} 193}
194 194
195static inline int skb_array_resize_multiple(struct skb_array **rings, 195static inline int skb_array_resize_multiple(struct skb_array **rings,
196 int nrings, int size, gfp_t gfp) 196 int nrings, unsigned int size,
197 gfp_t gfp)
197{ 198{
198 BUILD_BUG_ON(offsetof(struct skb_array, ring)); 199 BUILD_BUG_ON(offsetof(struct skb_array, ring));
199 return ptr_ring_resize_multiple((struct ptr_ring **)rings, 200 return ptr_ring_resize_multiple((struct ptr_ring **)rings,
diff --git a/include/net/ip.h b/include/net/ip.h
index 821cedcc8e73..0cf7f5a65fe6 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -352,7 +352,7 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
352 !forwarding) 352 !forwarding)
353 return dst_mtu(dst); 353 return dst_mtu(dst);
354 354
355 return min(dst->dev->mtu, IP_MAX_MTU); 355 return min(READ_ONCE(dst->dev->mtu), IP_MAX_MTU);
356} 356}
357 357
358static inline unsigned int ip_skb_dst_mtu(struct sock *sk, 358static inline unsigned int ip_skb_dst_mtu(struct sock *sk,
@@ -364,7 +364,7 @@ static inline unsigned int ip_skb_dst_mtu(struct sock *sk,
364 return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding); 364 return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
365 } 365 }
366 366
367 return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU); 367 return min(READ_ONCE(skb_dst(skb)->dev->mtu), IP_MAX_MTU);
368} 368}
369 369
370u32 ip_idents_reserve(u32 hash, int segs); 370u32 ip_idents_reserve(u32 hash, int segs);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 1c123e2b2415..67f815e5d525 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -806,8 +806,11 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
806 old = *pold; 806 old = *pold;
807 *pold = new; 807 *pold = new;
808 if (old != NULL) { 808 if (old != NULL) {
809 qdisc_tree_reduce_backlog(old, old->q.qlen, old->qstats.backlog); 809 unsigned int qlen = old->q.qlen;
810 unsigned int backlog = old->qstats.backlog;
811
810 qdisc_reset(old); 812 qdisc_reset(old);
813 qdisc_tree_reduce_backlog(old, qlen, backlog);
811 } 814 }
812 sch_tree_unlock(sch); 815 sch_tree_unlock(sch);
813 816
diff --git a/include/net/sock.h b/include/net/sock.h
index 7c0632c7e870..aeeec62992ca 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -507,9 +507,7 @@ int sk_set_peek_off(struct sock *sk, int val);
507static inline int sk_peek_offset(struct sock *sk, int flags) 507static inline int sk_peek_offset(struct sock *sk, int flags)
508{ 508{
509 if (unlikely(flags & MSG_PEEK)) { 509 if (unlikely(flags & MSG_PEEK)) {
510 s32 off = READ_ONCE(sk->sk_peek_off); 510 return READ_ONCE(sk->sk_peek_off);
511 if (off >= 0)
512 return off;
513 } 511 }
514 512
515 return 0; 513 return 0;
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index a1266d318c85..6af198d8120b 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -57,6 +57,7 @@ struct scsi_pointer {
57/* for scmd->flags */ 57/* for scmd->flags */
58#define SCMD_TAGGED (1 << 0) 58#define SCMD_TAGGED (1 << 0)
59#define SCMD_UNCHECKED_ISA_DMA (1 << 1) 59#define SCMD_UNCHECKED_ISA_DMA (1 << 1)
60#define SCMD_ZONE_WRITE_LOCK (1 << 2)
60 61
61struct scsi_cmnd { 62struct scsi_cmnd {
62 struct scsi_request req; 63 struct scsi_request req;
diff --git a/kernel/pid.c b/kernel/pid.c
index c69c30d827e5..020dedbdf066 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -527,8 +527,11 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
527 if (!ns) 527 if (!ns)
528 ns = task_active_pid_ns(current); 528 ns = task_active_pid_ns(current);
529 if (likely(pid_alive(task))) { 529 if (likely(pid_alive(task))) {
530 if (type != PIDTYPE_PID) 530 if (type != PIDTYPE_PID) {
531 if (type == __PIDTYPE_TGID)
532 type = PIDTYPE_PID;
531 task = task->group_leader; 533 task = task->group_leader;
534 }
532 nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns); 535 nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns);
533 } 536 }
534 rcu_read_unlock(); 537 rcu_read_unlock();
@@ -537,12 +540,6 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
537} 540}
538EXPORT_SYMBOL(__task_pid_nr_ns); 541EXPORT_SYMBOL(__task_pid_nr_ns);
539 542
540pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
541{
542 return pid_nr_ns(task_tgid(tsk), ns);
543}
544EXPORT_SYMBOL(task_tgid_nr_ns);
545
546struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) 543struct pid_namespace *task_active_pid_ns(struct task_struct *tsk)
547{ 544{
548 return ns_of_pid(task_pid(tsk)); 545 return ns_of_pid(task_pid(tsk));
diff --git a/net/core/datagram.c b/net/core/datagram.c
index ee5647bd91b3..a21ca8dee5ea 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -169,14 +169,20 @@ struct sk_buff *__skb_try_recv_from_queue(struct sock *sk,
169 int *peeked, int *off, int *err, 169 int *peeked, int *off, int *err,
170 struct sk_buff **last) 170 struct sk_buff **last)
171{ 171{
172 bool peek_at_off = false;
172 struct sk_buff *skb; 173 struct sk_buff *skb;
173 int _off = *off; 174 int _off = 0;
175
176 if (unlikely(flags & MSG_PEEK && *off >= 0)) {
177 peek_at_off = true;
178 _off = *off;
179 }
174 180
175 *last = queue->prev; 181 *last = queue->prev;
176 skb_queue_walk(queue, skb) { 182 skb_queue_walk(queue, skb) {
177 if (flags & MSG_PEEK) { 183 if (flags & MSG_PEEK) {
178 if (_off >= skb->len && (skb->len || _off || 184 if (peek_at_off && _off >= skb->len &&
179 skb->peeked)) { 185 (_off || skb->peeked)) {
180 _off -= skb->len; 186 _off -= skb->len;
181 continue; 187 continue;
182 } 188 }
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 86bc40ba6ba5..b68168fcc06a 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -24,6 +24,7 @@
24#include <net/checksum.h> 24#include <net/checksum.h>
25 25
26#include <net/inet_sock.h> 26#include <net/inet_sock.h>
27#include <net/inet_common.h>
27#include <net/sock.h> 28#include <net/sock.h>
28#include <net/xfrm.h> 29#include <net/xfrm.h>
29 30
@@ -170,6 +171,15 @@ const char *dccp_packet_name(const int type)
170 171
171EXPORT_SYMBOL_GPL(dccp_packet_name); 172EXPORT_SYMBOL_GPL(dccp_packet_name);
172 173
174static void dccp_sk_destruct(struct sock *sk)
175{
176 struct dccp_sock *dp = dccp_sk(sk);
177
178 ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
179 dp->dccps_hc_tx_ccid = NULL;
180 inet_sock_destruct(sk);
181}
182
173int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized) 183int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
174{ 184{
175 struct dccp_sock *dp = dccp_sk(sk); 185 struct dccp_sock *dp = dccp_sk(sk);
@@ -179,6 +189,7 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
179 icsk->icsk_syn_retries = sysctl_dccp_request_retries; 189 icsk->icsk_syn_retries = sysctl_dccp_request_retries;
180 sk->sk_state = DCCP_CLOSED; 190 sk->sk_state = DCCP_CLOSED;
181 sk->sk_write_space = dccp_write_space; 191 sk->sk_write_space = dccp_write_space;
192 sk->sk_destruct = dccp_sk_destruct;
182 icsk->icsk_sync_mss = dccp_sync_mss; 193 icsk->icsk_sync_mss = dccp_sync_mss;
183 dp->dccps_mss_cache = 536; 194 dp->dccps_mss_cache = 536;
184 dp->dccps_rate_last = jiffies; 195 dp->dccps_rate_last = jiffies;
@@ -219,8 +230,7 @@ void dccp_destroy_sock(struct sock *sk)
219 dp->dccps_hc_rx_ackvec = NULL; 230 dp->dccps_hc_rx_ackvec = NULL;
220 } 231 }
221 ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); 232 ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
222 ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); 233 dp->dccps_hc_rx_ccid = NULL;
223 dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;
224 234
225 /* clean up feature negotiation state */ 235 /* clean up feature negotiation state */
226 dccp_feat_list_purge(&dp->dccps_featneg); 236 dccp_feat_list_purge(&dp->dccps_featneg);
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 498706b072fb..caf2f1101d02 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1007,10 +1007,18 @@ int igmp_rcv(struct sk_buff *skb)
1007{ 1007{
1008 /* This basically follows the spec line by line -- see RFC1112 */ 1008 /* This basically follows the spec line by line -- see RFC1112 */
1009 struct igmphdr *ih; 1009 struct igmphdr *ih;
1010 struct in_device *in_dev = __in_dev_get_rcu(skb->dev); 1010 struct net_device *dev = skb->dev;
1011 struct in_device *in_dev;
1011 int len = skb->len; 1012 int len = skb->len;
1012 bool dropped = true; 1013 bool dropped = true;
1013 1014
1015 if (netif_is_l3_master(dev)) {
1016 dev = dev_get_by_index_rcu(dev_net(dev), IPCB(skb)->iif);
1017 if (!dev)
1018 goto drop;
1019 }
1020
1021 in_dev = __in_dev_get_rcu(dev);
1014 if (!in_dev) 1022 if (!in_dev)
1015 goto drop; 1023 goto drop;
1016 1024
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 7effa62beed3..2331de20ca50 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1267,7 +1267,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
1267 if (mtu) 1267 if (mtu)
1268 return mtu; 1268 return mtu;
1269 1269
1270 mtu = dst->dev->mtu; 1270 mtu = READ_ONCE(dst->dev->mtu);
1271 1271
1272 if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { 1272 if (unlikely(dst_metric_locked(dst, RTAX_MTU))) {
1273 if (rt->rt_uses_gateway && mtu > 576) 1273 if (rt->rt_uses_gateway && mtu > 576)
@@ -2763,14 +2763,21 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
2763 if (rtm->rtm_flags & RTM_F_LOOKUP_TABLE) 2763 if (rtm->rtm_flags & RTM_F_LOOKUP_TABLE)
2764 table_id = rt->rt_table_id; 2764 table_id = rt->rt_table_id;
2765 2765
2766 if (rtm->rtm_flags & RTM_F_FIB_MATCH) 2766 if (rtm->rtm_flags & RTM_F_FIB_MATCH) {
2767 if (!res.fi) {
2768 err = fib_props[res.type].error;
2769 if (!err)
2770 err = -EHOSTUNREACH;
2771 goto errout_free;
2772 }
2767 err = fib_dump_info(skb, NETLINK_CB(in_skb).portid, 2773 err = fib_dump_info(skb, NETLINK_CB(in_skb).portid,
2768 nlh->nlmsg_seq, RTM_NEWROUTE, table_id, 2774 nlh->nlmsg_seq, RTM_NEWROUTE, table_id,
2769 rt->rt_type, res.prefix, res.prefixlen, 2775 rt->rt_type, res.prefix, res.prefixlen,
2770 fl4.flowi4_tos, res.fi, 0); 2776 fl4.flowi4_tos, res.fi, 0);
2771 else 2777 } else {
2772 err = rt_fill_info(net, dst, src, table_id, &fl4, skb, 2778 err = rt_fill_info(net, dst, src, table_id, &fl4, skb,
2773 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq); 2779 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq);
2780 }
2774 if (err < 0) 2781 if (err < 0)
2775 goto errout_free; 2782 goto errout_free;
2776 2783
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 53de1424c13c..bab7f0493098 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3009,8 +3009,7 @@ void tcp_rearm_rto(struct sock *sk)
3009 /* delta_us may not be positive if the socket is locked 3009 /* delta_us may not be positive if the socket is locked
3010 * when the retrans timer fires and is rescheduled. 3010 * when the retrans timer fires and is rescheduled.
3011 */ 3011 */
3012 if (delta_us > 0) 3012 rto = usecs_to_jiffies(max_t(int, delta_us, 1));
3013 rto = usecs_to_jiffies(delta_us);
3014 } 3013 }
3015 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto, 3014 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
3016 TCP_RTO_MAX); 3015 TCP_RTO_MAX);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index a7c804f73990..cd1d044a7fa5 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1574,7 +1574,8 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
1574 return ip_recv_error(sk, msg, len, addr_len); 1574 return ip_recv_error(sk, msg, len, addr_len);
1575 1575
1576try_again: 1576try_again:
1577 peeking = off = sk_peek_offset(sk, flags); 1577 peeking = flags & MSG_PEEK;
1578 off = sk_peek_offset(sk, flags);
1578 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err); 1579 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err);
1579 if (!skb) 1580 if (!skb)
1580 return err; 1581 return err;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index ebb299cf72b7..5cc0ea038198 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -914,6 +914,8 @@ add:
914 } 914 }
915 nsiblings = iter->rt6i_nsiblings; 915 nsiblings = iter->rt6i_nsiblings;
916 fib6_purge_rt(iter, fn, info->nl_net); 916 fib6_purge_rt(iter, fn, info->nl_net);
917 if (fn->rr_ptr == iter)
918 fn->rr_ptr = NULL;
917 rt6_release(iter); 919 rt6_release(iter);
918 920
919 if (nsiblings) { 921 if (nsiblings) {
@@ -926,6 +928,8 @@ add:
926 if (rt6_qualify_for_ecmp(iter)) { 928 if (rt6_qualify_for_ecmp(iter)) {
927 *ins = iter->dst.rt6_next; 929 *ins = iter->dst.rt6_next;
928 fib6_purge_rt(iter, fn, info->nl_net); 930 fib6_purge_rt(iter, fn, info->nl_net);
931 if (fn->rr_ptr == iter)
932 fn->rr_ptr = NULL;
929 rt6_release(iter); 933 rt6_release(iter);
930 nsiblings--; 934 nsiblings--;
931 } else { 935 } else {
@@ -1014,7 +1018,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1014 /* Create subtree root node */ 1018 /* Create subtree root node */
1015 sfn = node_alloc(); 1019 sfn = node_alloc();
1016 if (!sfn) 1020 if (!sfn)
1017 goto st_failure; 1021 goto failure;
1018 1022
1019 sfn->leaf = info->nl_net->ipv6.ip6_null_entry; 1023 sfn->leaf = info->nl_net->ipv6.ip6_null_entry;
1020 atomic_inc(&info->nl_net->ipv6.ip6_null_entry->rt6i_ref); 1024 atomic_inc(&info->nl_net->ipv6.ip6_null_entry->rt6i_ref);
@@ -1031,12 +1035,12 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1031 1035
1032 if (IS_ERR(sn)) { 1036 if (IS_ERR(sn)) {
1033 /* If it is failed, discard just allocated 1037 /* If it is failed, discard just allocated
1034 root, and then (in st_failure) stale node 1038 root, and then (in failure) stale node
1035 in main tree. 1039 in main tree.
1036 */ 1040 */
1037 node_free(sfn); 1041 node_free(sfn);
1038 err = PTR_ERR(sn); 1042 err = PTR_ERR(sn);
1039 goto st_failure; 1043 goto failure;
1040 } 1044 }
1041 1045
1042 /* Now link new subtree to main tree */ 1046 /* Now link new subtree to main tree */
@@ -1051,7 +1055,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1051 1055
1052 if (IS_ERR(sn)) { 1056 if (IS_ERR(sn)) {
1053 err = PTR_ERR(sn); 1057 err = PTR_ERR(sn);
1054 goto st_failure; 1058 goto failure;
1055 } 1059 }
1056 } 1060 }
1057 1061
@@ -1092,18 +1096,17 @@ out:
1092 atomic_inc(&pn->leaf->rt6i_ref); 1096 atomic_inc(&pn->leaf->rt6i_ref);
1093 } 1097 }
1094#endif 1098#endif
1095 /* Always release dst as dst->__refcnt is guaranteed 1099 goto failure;
1096 * to be taken before entering this function
1097 */
1098 dst_release_immediate(&rt->dst);
1099 } 1100 }
1100 return err; 1101 return err;
1101 1102
1102#ifdef CONFIG_IPV6_SUBTREES 1103failure:
1103 /* Subtree creation failed, probably main tree node 1104 /* fn->leaf could be NULL if fn is an intermediate node and we
1104 is orphan. If it is, shoot it. 1105 * failed to add the new route to it in both subtree creation
1106 * failure and fib6_add_rt2node() failure case.
1107 * In both cases, fib6_repair_tree() should be called to fix
1108 * fn->leaf.
1105 */ 1109 */
1106st_failure:
1107 if (fn && !(fn->fn_flags & (RTN_RTINFO|RTN_ROOT))) 1110 if (fn && !(fn->fn_flags & (RTN_RTINFO|RTN_ROOT)))
1108 fib6_repair_tree(info->nl_net, fn); 1111 fib6_repair_tree(info->nl_net, fn);
1109 /* Always release dst as dst->__refcnt is guaranteed 1112 /* Always release dst as dst->__refcnt is guaranteed
@@ -1111,7 +1114,6 @@ st_failure:
1111 */ 1114 */
1112 dst_release_immediate(&rt->dst); 1115 dst_release_immediate(&rt->dst);
1113 return err; 1116 return err;
1114#endif
1115} 1117}
1116 1118
1117/* 1119/*
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 578142b7ca3e..20039c8501eb 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -362,7 +362,8 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
362 return ipv6_recv_rxpmtu(sk, msg, len, addr_len); 362 return ipv6_recv_rxpmtu(sk, msg, len, addr_len);
363 363
364try_again: 364try_again:
365 peeking = off = sk_peek_offset(sk, flags); 365 peeking = flags & MSG_PEEK;
366 off = sk_peek_offset(sk, flags);
366 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err); 367 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err);
367 if (!skb) 368 if (!skb)
368 return err; 369 return err;
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 2e6990f8b80b..23fa7c8b09a5 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2213,7 +2213,7 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
2213{ 2213{
2214 struct sock *sk = sock->sk; 2214 struct sock *sk = sock->sk;
2215 struct irda_sock *self = irda_sk(sk); 2215 struct irda_sock *self = irda_sk(sk);
2216 struct irda_device_list list; 2216 struct irda_device_list list = { 0 };
2217 struct irda_device_info *discoveries; 2217 struct irda_device_info *discoveries;
2218 struct irda_ias_set * ias_opt; /* IAS get/query params */ 2218 struct irda_ias_set * ias_opt; /* IAS get/query params */
2219 struct ias_object * ias_obj; /* Object in IAS */ 2219 struct ias_object * ias_obj; /* Object in IAS */
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index e4610676299b..a54a556fcdb5 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -1337,6 +1337,7 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
1337 goto out; 1337 goto out;
1338 } 1338 }
1339 1339
1340 OVS_CB(skb)->acts_origlen = acts->orig_len;
1340 err = do_execute_actions(dp, skb, key, 1341 err = do_execute_actions(dp, skb, key,
1341 acts->actions, acts->actions_len); 1342 acts->actions, acts->actions_len);
1342 1343
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 45fe8c8a884d..6b44fe405282 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -381,7 +381,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
381} 381}
382 382
383static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info, 383static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,
384 unsigned int hdrlen) 384 unsigned int hdrlen, int actions_attrlen)
385{ 385{
386 size_t size = NLMSG_ALIGN(sizeof(struct ovs_header)) 386 size_t size = NLMSG_ALIGN(sizeof(struct ovs_header))
387 + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */ 387 + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */
@@ -398,7 +398,7 @@ static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,
398 398
399 /* OVS_PACKET_ATTR_ACTIONS */ 399 /* OVS_PACKET_ATTR_ACTIONS */
400 if (upcall_info->actions_len) 400 if (upcall_info->actions_len)
401 size += nla_total_size(upcall_info->actions_len); 401 size += nla_total_size(actions_attrlen);
402 402
403 /* OVS_PACKET_ATTR_MRU */ 403 /* OVS_PACKET_ATTR_MRU */
404 if (upcall_info->mru) 404 if (upcall_info->mru)
@@ -465,7 +465,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
465 else 465 else
466 hlen = skb->len; 466 hlen = skb->len;
467 467
468 len = upcall_msg_size(upcall_info, hlen - cutlen); 468 len = upcall_msg_size(upcall_info, hlen - cutlen,
469 OVS_CB(skb)->acts_origlen);
469 user_skb = genlmsg_new(len, GFP_ATOMIC); 470 user_skb = genlmsg_new(len, GFP_ATOMIC);
470 if (!user_skb) { 471 if (!user_skb) {
471 err = -ENOMEM; 472 err = -ENOMEM;
diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h
index 5d8dcd88815f..480600649d0b 100644
--- a/net/openvswitch/datapath.h
+++ b/net/openvswitch/datapath.h
@@ -99,11 +99,13 @@ struct datapath {
99 * when a packet is received by OVS. 99 * when a packet is received by OVS.
100 * @mru: The maximum received fragement size; 0 if the packet is not 100 * @mru: The maximum received fragement size; 0 if the packet is not
101 * fragmented. 101 * fragmented.
102 * @acts_origlen: The netlink size of the flow actions applied to this skb.
102 * @cutlen: The number of bytes from the packet end to be removed. 103 * @cutlen: The number of bytes from the packet end to be removed.
103 */ 104 */
104struct ovs_skb_cb { 105struct ovs_skb_cb {
105 struct vport *input_vport; 106 struct vport *input_vport;
106 u16 mru; 107 u16 mru;
108 u16 acts_origlen;
107 u32 cutlen; 109 u32 cutlen;
108}; 110};
109#define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb) 111#define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c
index dd30d74824b0..ec3383f97d4c 100644
--- a/net/rxrpc/call_accept.c
+++ b/net/rxrpc/call_accept.c
@@ -223,6 +223,7 @@ void rxrpc_discard_prealloc(struct rxrpc_sock *rx)
223 tail = b->call_backlog_tail; 223 tail = b->call_backlog_tail;
224 while (CIRC_CNT(head, tail, size) > 0) { 224 while (CIRC_CNT(head, tail, size) > 0) {
225 struct rxrpc_call *call = b->call_backlog[tail]; 225 struct rxrpc_call *call = b->call_backlog[tail];
226 call->socket = rx;
226 if (rx->discard_new_call) { 227 if (rx->discard_new_call) {
227 _debug("discard %lx", call->user_call_ID); 228 _debug("discard %lx", call->user_call_ID);
228 rx->discard_new_call(call, call->user_call_ID); 229 rx->discard_new_call(call, call->user_call_ID);
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index d516ba8178b8..541707802a23 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -41,6 +41,7 @@ static int ipt_init_target(struct net *net, struct xt_entry_target *t,
41{ 41{
42 struct xt_tgchk_param par; 42 struct xt_tgchk_param par;
43 struct xt_target *target; 43 struct xt_target *target;
44 struct ipt_entry e = {};
44 int ret = 0; 45 int ret = 0;
45 46
46 target = xt_request_find_target(AF_INET, t->u.user.name, 47 target = xt_request_find_target(AF_INET, t->u.user.name,
@@ -52,6 +53,7 @@ static int ipt_init_target(struct net *net, struct xt_entry_target *t,
52 memset(&par, 0, sizeof(par)); 53 memset(&par, 0, sizeof(par));
53 par.net = net; 54 par.net = net;
54 par.table = table; 55 par.table = table;
56 par.entryinfo = &e;
55 par.target = target; 57 par.target = target;
56 par.targinfo = t->data; 58 par.targinfo = t->data;
57 par.hook_mask = hook; 59 par.hook_mask = hook;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 39da0c5801c9..9fd44c221347 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -205,7 +205,7 @@ static void tcf_chain_flush(struct tcf_chain *chain)
205{ 205{
206 struct tcf_proto *tp; 206 struct tcf_proto *tp;
207 207
208 if (*chain->p_filter_chain) 208 if (chain->p_filter_chain)
209 RCU_INIT_POINTER(*chain->p_filter_chain, NULL); 209 RCU_INIT_POINTER(*chain->p_filter_chain, NULL);
210 while ((tp = rtnl_dereference(chain->filter_chain)) != NULL) { 210 while ((tp = rtnl_dereference(chain->filter_chain)) != NULL) {
211 RCU_INIT_POINTER(chain->filter_chain, tp->next); 211 RCU_INIT_POINTER(chain->filter_chain, tp->next);
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 2a186b201ad2..a4b6ffb61495 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -512,7 +512,9 @@ static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
512{ 512{
513 addr->sa.sa_family = AF_INET6; 513 addr->sa.sa_family = AF_INET6;
514 addr->v6.sin6_port = port; 514 addr->v6.sin6_port = port;
515 addr->v6.sin6_flowinfo = 0;
515 addr->v6.sin6_addr = *saddr; 516 addr->v6.sin6_addr = *saddr;
517 addr->v6.sin6_scope_id = 0;
516} 518}
517 519
518/* Compare addresses exactly. 520/* Compare addresses exactly.
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 9bfe886ab330..750949dfc1d7 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -258,13 +258,15 @@ static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
258 arg = nlmsg_new(0, GFP_KERNEL); 258 arg = nlmsg_new(0, GFP_KERNEL);
259 if (!arg) { 259 if (!arg) {
260 kfree_skb(msg->rep); 260 kfree_skb(msg->rep);
261 msg->rep = NULL;
261 return -ENOMEM; 262 return -ENOMEM;
262 } 263 }
263 264
264 err = __tipc_nl_compat_dumpit(cmd, msg, arg); 265 err = __tipc_nl_compat_dumpit(cmd, msg, arg);
265 if (err) 266 if (err) {
266 kfree_skb(msg->rep); 267 kfree_skb(msg->rep);
267 268 msg->rep = NULL;
269 }
268 kfree_skb(arg); 270 kfree_skb(arg);
269 271
270 return err; 272 return err;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 7b52a380d710..be8982b4f8c0 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2304,10 +2304,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state,
2304 */ 2304 */
2305 mutex_lock(&u->iolock); 2305 mutex_lock(&u->iolock);
2306 2306
2307 if (flags & MSG_PEEK) 2307 skip = max(sk_peek_offset(sk, flags), 0);
2308 skip = sk_peek_offset(sk, flags);
2309 else
2310 skip = 0;
2311 2308
2312 do { 2309 do {
2313 int chunk; 2310 int chunk;
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 1a2c07eb7795..8c67a90dbd82 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -879,7 +879,8 @@ bpf_object__create_maps(struct bpf_object *obj)
879 size_t j; 879 size_t j;
880 int err = *pfd; 880 int err = *pfd;
881 881
882 pr_warning("failed to create map: %s\n", 882 pr_warning("failed to create map (name: '%s'): %s\n",
883 obj->maps[i].name,
883 strerror(errno)); 884 strerror(errno));
884 for (j = 0; j < i; j++) 885 for (j = 0; j < i; j++)
885 zclose(obj->maps[j].fd); 886 zclose(obj->maps[j].fd);