diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-12-11 07:05:59 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-12-11 07:05:59 -0500 |
commit | 6de75a37b8e82e3e6bbc773c1fbc7df8338efb90 (patch) | |
tree | c2dcd32fbc0e404367c77116412ca526a3b03ce0 | |
parent | 080c25914e6db40c5d7606d22fd592ae3d8c3e59 (diff) | |
parent | 045169816b31b10faed984b01c390db1b32ee4c1 (diff) |
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
118 files changed, 1074 insertions, 399 deletions
diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi index 0d7d5ac6257b..2b6cb05bc01a 100644 --- a/arch/arm/boot/dts/imx7s.dtsi +++ b/arch/arm/boot/dts/imx7s.dtsi | |||
@@ -643,9 +643,8 @@ | |||
643 | reg = <0x30730000 0x10000>; | 643 | reg = <0x30730000 0x10000>; |
644 | interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; | 644 | interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; |
645 | clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>, | 645 | clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>, |
646 | <&clks IMX7D_CLK_DUMMY>, | 646 | <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>; |
647 | <&clks IMX7D_CLK_DUMMY>; | 647 | clock-names = "pix", "axi"; |
648 | clock-names = "pix", "axi", "disp_axi"; | ||
649 | status = "disabled"; | 648 | status = "disabled"; |
650 | }; | 649 | }; |
651 | }; | 650 | }; |
diff --git a/arch/arm/boot/dts/orion5x-linkstation-lsgl.dts b/arch/arm/boot/dts/orion5x-linkstation-lsgl.dts index 1cf644bfd7ea..51dc734cd5b9 100644 --- a/arch/arm/boot/dts/orion5x-linkstation-lsgl.dts +++ b/arch/arm/boot/dts/orion5x-linkstation-lsgl.dts | |||
@@ -82,6 +82,10 @@ | |||
82 | gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; | 82 | gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | &sata { | ||
86 | nr-ports = <2>; | ||
87 | }; | ||
88 | |||
85 | &ehci1 { | 89 | &ehci1 { |
86 | status = "okay"; | 90 | status = "okay"; |
87 | }; | 91 | }; |
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index 75a865406d3e..f4ba088b225e 100644 --- a/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi | |||
@@ -410,7 +410,7 @@ | |||
410 | }; | 410 | }; |
411 | 411 | ||
412 | uart3_pins: uart3 { | 412 | uart3_pins: uart3 { |
413 | allwinner,pins = "PG13", "PG14"; | 413 | allwinner,pins = "PA13", "PA14"; |
414 | allwinner,function = "uart3"; | 414 | allwinner,function = "uart3"; |
415 | allwinner,drive = <SUN4I_PINCTRL_10_MA>; | 415 | allwinner,drive = <SUN4I_PINCTRL_10_MA>; |
416 | allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; | 416 | allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; |
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index 55be7e3ff109..b98acd15ca22 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig | |||
@@ -95,9 +95,10 @@ CONFIG_NF_TABLES_INET=m | |||
95 | CONFIG_NF_TABLES_NETDEV=m | 95 | CONFIG_NF_TABLES_NETDEV=m |
96 | CONFIG_NFT_EXTHDR=m | 96 | CONFIG_NFT_EXTHDR=m |
97 | CONFIG_NFT_META=m | 97 | CONFIG_NFT_META=m |
98 | CONFIG_NFT_NUMGEN=m | ||
98 | CONFIG_NFT_CT=m | 99 | CONFIG_NFT_CT=m |
99 | CONFIG_NFT_RBTREE=m | 100 | CONFIG_NFT_SET_RBTREE=m |
100 | CONFIG_NFT_HASH=m | 101 | CONFIG_NFT_SET_HASH=m |
101 | CONFIG_NFT_COUNTER=m | 102 | CONFIG_NFT_COUNTER=m |
102 | CONFIG_NFT_LOG=m | 103 | CONFIG_NFT_LOG=m |
103 | CONFIG_NFT_LIMIT=m | 104 | CONFIG_NFT_LIMIT=m |
@@ -105,8 +106,10 @@ CONFIG_NFT_MASQ=m | |||
105 | CONFIG_NFT_REDIR=m | 106 | CONFIG_NFT_REDIR=m |
106 | CONFIG_NFT_NAT=m | 107 | CONFIG_NFT_NAT=m |
107 | CONFIG_NFT_QUEUE=m | 108 | CONFIG_NFT_QUEUE=m |
109 | CONFIG_NFT_QUOTA=m | ||
108 | CONFIG_NFT_REJECT=m | 110 | CONFIG_NFT_REJECT=m |
109 | CONFIG_NFT_COMPAT=m | 111 | CONFIG_NFT_COMPAT=m |
112 | CONFIG_NFT_HASH=m | ||
110 | CONFIG_NFT_DUP_NETDEV=m | 113 | CONFIG_NFT_DUP_NETDEV=m |
111 | CONFIG_NFT_FWD_NETDEV=m | 114 | CONFIG_NFT_FWD_NETDEV=m |
112 | CONFIG_NETFILTER_XT_SET=m | 115 | CONFIG_NETFILTER_XT_SET=m |
@@ -366,6 +369,7 @@ CONFIG_NETCONSOLE=m | |||
366 | CONFIG_NETCONSOLE_DYNAMIC=y | 369 | CONFIG_NETCONSOLE_DYNAMIC=y |
367 | CONFIG_VETH=m | 370 | CONFIG_VETH=m |
368 | # CONFIG_NET_VENDOR_3COM is not set | 371 | # CONFIG_NET_VENDOR_3COM is not set |
372 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
369 | CONFIG_A2065=y | 373 | CONFIG_A2065=y |
370 | CONFIG_ARIADNE=y | 374 | CONFIG_ARIADNE=y |
371 | # CONFIG_NET_VENDOR_ARC is not set | 375 | # CONFIG_NET_VENDOR_ARC is not set |
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index 365dda66b0e6..f80dc57e6374 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig | |||
@@ -93,9 +93,10 @@ CONFIG_NF_TABLES_INET=m | |||
93 | CONFIG_NF_TABLES_NETDEV=m | 93 | CONFIG_NF_TABLES_NETDEV=m |
94 | CONFIG_NFT_EXTHDR=m | 94 | CONFIG_NFT_EXTHDR=m |
95 | CONFIG_NFT_META=m | 95 | CONFIG_NFT_META=m |
96 | CONFIG_NFT_NUMGEN=m | ||
96 | CONFIG_NFT_CT=m | 97 | CONFIG_NFT_CT=m |
97 | CONFIG_NFT_RBTREE=m | 98 | CONFIG_NFT_SET_RBTREE=m |
98 | CONFIG_NFT_HASH=m | 99 | CONFIG_NFT_SET_HASH=m |
99 | CONFIG_NFT_COUNTER=m | 100 | CONFIG_NFT_COUNTER=m |
100 | CONFIG_NFT_LOG=m | 101 | CONFIG_NFT_LOG=m |
101 | CONFIG_NFT_LIMIT=m | 102 | CONFIG_NFT_LIMIT=m |
@@ -103,8 +104,10 @@ CONFIG_NFT_MASQ=m | |||
103 | CONFIG_NFT_REDIR=m | 104 | CONFIG_NFT_REDIR=m |
104 | CONFIG_NFT_NAT=m | 105 | CONFIG_NFT_NAT=m |
105 | CONFIG_NFT_QUEUE=m | 106 | CONFIG_NFT_QUEUE=m |
107 | CONFIG_NFT_QUOTA=m | ||
106 | CONFIG_NFT_REJECT=m | 108 | CONFIG_NFT_REJECT=m |
107 | CONFIG_NFT_COMPAT=m | 109 | CONFIG_NFT_COMPAT=m |
110 | CONFIG_NFT_HASH=m | ||
108 | CONFIG_NFT_DUP_NETDEV=m | 111 | CONFIG_NFT_DUP_NETDEV=m |
109 | CONFIG_NFT_FWD_NETDEV=m | 112 | CONFIG_NFT_FWD_NETDEV=m |
110 | CONFIG_NETFILTER_XT_SET=m | 113 | CONFIG_NETFILTER_XT_SET=m |
@@ -347,6 +350,7 @@ CONFIG_MACSEC=m | |||
347 | CONFIG_NETCONSOLE=m | 350 | CONFIG_NETCONSOLE=m |
348 | CONFIG_NETCONSOLE_DYNAMIC=y | 351 | CONFIG_NETCONSOLE_DYNAMIC=y |
349 | CONFIG_VETH=m | 352 | CONFIG_VETH=m |
353 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
350 | # CONFIG_NET_VENDOR_ARC is not set | 354 | # CONFIG_NET_VENDOR_ARC is not set |
351 | # CONFIG_NET_CADENCE is not set | 355 | # CONFIG_NET_CADENCE is not set |
352 | # CONFIG_NET_VENDOR_BROADCOM is not set | 356 | # CONFIG_NET_VENDOR_BROADCOM is not set |
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index ce3cbfd16fcd..4e16b1821fbb 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig | |||
@@ -93,9 +93,10 @@ CONFIG_NF_TABLES_INET=m | |||
93 | CONFIG_NF_TABLES_NETDEV=m | 93 | CONFIG_NF_TABLES_NETDEV=m |
94 | CONFIG_NFT_EXTHDR=m | 94 | CONFIG_NFT_EXTHDR=m |
95 | CONFIG_NFT_META=m | 95 | CONFIG_NFT_META=m |
96 | CONFIG_NFT_NUMGEN=m | ||
96 | CONFIG_NFT_CT=m | 97 | CONFIG_NFT_CT=m |
97 | CONFIG_NFT_RBTREE=m | 98 | CONFIG_NFT_SET_RBTREE=m |
98 | CONFIG_NFT_HASH=m | 99 | CONFIG_NFT_SET_HASH=m |
99 | CONFIG_NFT_COUNTER=m | 100 | CONFIG_NFT_COUNTER=m |
100 | CONFIG_NFT_LOG=m | 101 | CONFIG_NFT_LOG=m |
101 | CONFIG_NFT_LIMIT=m | 102 | CONFIG_NFT_LIMIT=m |
@@ -103,8 +104,10 @@ CONFIG_NFT_MASQ=m | |||
103 | CONFIG_NFT_REDIR=m | 104 | CONFIG_NFT_REDIR=m |
104 | CONFIG_NFT_NAT=m | 105 | CONFIG_NFT_NAT=m |
105 | CONFIG_NFT_QUEUE=m | 106 | CONFIG_NFT_QUEUE=m |
107 | CONFIG_NFT_QUOTA=m | ||
106 | CONFIG_NFT_REJECT=m | 108 | CONFIG_NFT_REJECT=m |
107 | CONFIG_NFT_COMPAT=m | 109 | CONFIG_NFT_COMPAT=m |
110 | CONFIG_NFT_HASH=m | ||
108 | CONFIG_NFT_DUP_NETDEV=m | 111 | CONFIG_NFT_DUP_NETDEV=m |
109 | CONFIG_NFT_FWD_NETDEV=m | 112 | CONFIG_NFT_FWD_NETDEV=m |
110 | CONFIG_NETFILTER_XT_SET=m | 113 | CONFIG_NETFILTER_XT_SET=m |
@@ -356,6 +359,7 @@ CONFIG_MACSEC=m | |||
356 | CONFIG_NETCONSOLE=m | 359 | CONFIG_NETCONSOLE=m |
357 | CONFIG_NETCONSOLE_DYNAMIC=y | 360 | CONFIG_NETCONSOLE_DYNAMIC=y |
358 | CONFIG_VETH=m | 361 | CONFIG_VETH=m |
362 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
359 | CONFIG_ATARILANCE=y | 363 | CONFIG_ATARILANCE=y |
360 | # CONFIG_NET_VENDOR_ARC is not set | 364 | # CONFIG_NET_VENDOR_ARC is not set |
361 | # CONFIG_NET_CADENCE is not set | 365 | # CONFIG_NET_CADENCE is not set |
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index 8db496a9797d..2767bbf5ad61 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_defconfig | |||
@@ -91,9 +91,10 @@ CONFIG_NF_TABLES_INET=m | |||
91 | CONFIG_NF_TABLES_NETDEV=m | 91 | CONFIG_NF_TABLES_NETDEV=m |
92 | CONFIG_NFT_EXTHDR=m | 92 | CONFIG_NFT_EXTHDR=m |
93 | CONFIG_NFT_META=m | 93 | CONFIG_NFT_META=m |
94 | CONFIG_NFT_NUMGEN=m | ||
94 | CONFIG_NFT_CT=m | 95 | CONFIG_NFT_CT=m |
95 | CONFIG_NFT_RBTREE=m | 96 | CONFIG_NFT_SET_RBTREE=m |
96 | CONFIG_NFT_HASH=m | 97 | CONFIG_NFT_SET_HASH=m |
97 | CONFIG_NFT_COUNTER=m | 98 | CONFIG_NFT_COUNTER=m |
98 | CONFIG_NFT_LOG=m | 99 | CONFIG_NFT_LOG=m |
99 | CONFIG_NFT_LIMIT=m | 100 | CONFIG_NFT_LIMIT=m |
@@ -101,8 +102,10 @@ CONFIG_NFT_MASQ=m | |||
101 | CONFIG_NFT_REDIR=m | 102 | CONFIG_NFT_REDIR=m |
102 | CONFIG_NFT_NAT=m | 103 | CONFIG_NFT_NAT=m |
103 | CONFIG_NFT_QUEUE=m | 104 | CONFIG_NFT_QUEUE=m |
105 | CONFIG_NFT_QUOTA=m | ||
104 | CONFIG_NFT_REJECT=m | 106 | CONFIG_NFT_REJECT=m |
105 | CONFIG_NFT_COMPAT=m | 107 | CONFIG_NFT_COMPAT=m |
108 | CONFIG_NFT_HASH=m | ||
106 | CONFIG_NFT_DUP_NETDEV=m | 109 | CONFIG_NFT_DUP_NETDEV=m |
107 | CONFIG_NFT_FWD_NETDEV=m | 110 | CONFIG_NFT_FWD_NETDEV=m |
108 | CONFIG_NETFILTER_XT_SET=m | 111 | CONFIG_NETFILTER_XT_SET=m |
@@ -346,6 +349,7 @@ CONFIG_MACSEC=m | |||
346 | CONFIG_NETCONSOLE=m | 349 | CONFIG_NETCONSOLE=m |
347 | CONFIG_NETCONSOLE_DYNAMIC=y | 350 | CONFIG_NETCONSOLE_DYNAMIC=y |
348 | CONFIG_VETH=m | 351 | CONFIG_VETH=m |
352 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
349 | # CONFIG_NET_VENDOR_ARC is not set | 353 | # CONFIG_NET_VENDOR_ARC is not set |
350 | # CONFIG_NET_CADENCE is not set | 354 | # CONFIG_NET_CADENCE is not set |
351 | # CONFIG_NET_VENDOR_BROADCOM is not set | 355 | # CONFIG_NET_VENDOR_BROADCOM is not set |
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index 8314156f7149..d13ba309265e 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_defconfig | |||
@@ -93,9 +93,10 @@ CONFIG_NF_TABLES_INET=m | |||
93 | CONFIG_NF_TABLES_NETDEV=m | 93 | CONFIG_NF_TABLES_NETDEV=m |
94 | CONFIG_NFT_EXTHDR=m | 94 | CONFIG_NFT_EXTHDR=m |
95 | CONFIG_NFT_META=m | 95 | CONFIG_NFT_META=m |
96 | CONFIG_NFT_NUMGEN=m | ||
96 | CONFIG_NFT_CT=m | 97 | CONFIG_NFT_CT=m |
97 | CONFIG_NFT_RBTREE=m | 98 | CONFIG_NFT_SET_RBTREE=m |
98 | CONFIG_NFT_HASH=m | 99 | CONFIG_NFT_SET_HASH=m |
99 | CONFIG_NFT_COUNTER=m | 100 | CONFIG_NFT_COUNTER=m |
100 | CONFIG_NFT_LOG=m | 101 | CONFIG_NFT_LOG=m |
101 | CONFIG_NFT_LIMIT=m | 102 | CONFIG_NFT_LIMIT=m |
@@ -103,8 +104,10 @@ CONFIG_NFT_MASQ=m | |||
103 | CONFIG_NFT_REDIR=m | 104 | CONFIG_NFT_REDIR=m |
104 | CONFIG_NFT_NAT=m | 105 | CONFIG_NFT_NAT=m |
105 | CONFIG_NFT_QUEUE=m | 106 | CONFIG_NFT_QUEUE=m |
107 | CONFIG_NFT_QUOTA=m | ||
106 | CONFIG_NFT_REJECT=m | 108 | CONFIG_NFT_REJECT=m |
107 | CONFIG_NFT_COMPAT=m | 109 | CONFIG_NFT_COMPAT=m |
110 | CONFIG_NFT_HASH=m | ||
108 | CONFIG_NFT_DUP_NETDEV=m | 111 | CONFIG_NFT_DUP_NETDEV=m |
109 | CONFIG_NFT_FWD_NETDEV=m | 112 | CONFIG_NFT_FWD_NETDEV=m |
110 | CONFIG_NETFILTER_XT_SET=m | 113 | CONFIG_NETFILTER_XT_SET=m |
@@ -347,6 +350,7 @@ CONFIG_MACSEC=m | |||
347 | CONFIG_NETCONSOLE=m | 350 | CONFIG_NETCONSOLE=m |
348 | CONFIG_NETCONSOLE_DYNAMIC=y | 351 | CONFIG_NETCONSOLE_DYNAMIC=y |
349 | CONFIG_VETH=m | 352 | CONFIG_VETH=m |
353 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
350 | CONFIG_HPLANCE=y | 354 | CONFIG_HPLANCE=y |
351 | # CONFIG_NET_VENDOR_ARC is not set | 355 | # CONFIG_NET_VENDOR_ARC is not set |
352 | # CONFIG_NET_CADENCE is not set | 356 | # CONFIG_NET_CADENCE is not set |
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 6600270b9622..78b5101c1aa6 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig | |||
@@ -92,9 +92,10 @@ CONFIG_NF_TABLES_INET=m | |||
92 | CONFIG_NF_TABLES_NETDEV=m | 92 | CONFIG_NF_TABLES_NETDEV=m |
93 | CONFIG_NFT_EXTHDR=m | 93 | CONFIG_NFT_EXTHDR=m |
94 | CONFIG_NFT_META=m | 94 | CONFIG_NFT_META=m |
95 | CONFIG_NFT_NUMGEN=m | ||
95 | CONFIG_NFT_CT=m | 96 | CONFIG_NFT_CT=m |
96 | CONFIG_NFT_RBTREE=m | 97 | CONFIG_NFT_SET_RBTREE=m |
97 | CONFIG_NFT_HASH=m | 98 | CONFIG_NFT_SET_HASH=m |
98 | CONFIG_NFT_COUNTER=m | 99 | CONFIG_NFT_COUNTER=m |
99 | CONFIG_NFT_LOG=m | 100 | CONFIG_NFT_LOG=m |
100 | CONFIG_NFT_LIMIT=m | 101 | CONFIG_NFT_LIMIT=m |
@@ -102,8 +103,10 @@ CONFIG_NFT_MASQ=m | |||
102 | CONFIG_NFT_REDIR=m | 103 | CONFIG_NFT_REDIR=m |
103 | CONFIG_NFT_NAT=m | 104 | CONFIG_NFT_NAT=m |
104 | CONFIG_NFT_QUEUE=m | 105 | CONFIG_NFT_QUEUE=m |
106 | CONFIG_NFT_QUOTA=m | ||
105 | CONFIG_NFT_REJECT=m | 107 | CONFIG_NFT_REJECT=m |
106 | CONFIG_NFT_COMPAT=m | 108 | CONFIG_NFT_COMPAT=m |
109 | CONFIG_NFT_HASH=m | ||
107 | CONFIG_NFT_DUP_NETDEV=m | 110 | CONFIG_NFT_DUP_NETDEV=m |
108 | CONFIG_NFT_FWD_NETDEV=m | 111 | CONFIG_NFT_FWD_NETDEV=m |
109 | CONFIG_NETFILTER_XT_SET=m | 112 | CONFIG_NETFILTER_XT_SET=m |
@@ -363,6 +366,7 @@ CONFIG_MACSEC=m | |||
363 | CONFIG_NETCONSOLE=m | 366 | CONFIG_NETCONSOLE=m |
364 | CONFIG_NETCONSOLE_DYNAMIC=y | 367 | CONFIG_NETCONSOLE_DYNAMIC=y |
365 | CONFIG_VETH=m | 368 | CONFIG_VETH=m |
369 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
366 | CONFIG_MACMACE=y | 370 | CONFIG_MACMACE=y |
367 | # CONFIG_NET_VENDOR_ARC is not set | 371 | # CONFIG_NET_VENDOR_ARC is not set |
368 | # CONFIG_NET_CADENCE is not set | 372 | # CONFIG_NET_CADENCE is not set |
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index 90abfe9eabba..38e5bcbd0d62 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig | |||
@@ -102,9 +102,10 @@ CONFIG_NF_TABLES_INET=m | |||
102 | CONFIG_NF_TABLES_NETDEV=m | 102 | CONFIG_NF_TABLES_NETDEV=m |
103 | CONFIG_NFT_EXTHDR=m | 103 | CONFIG_NFT_EXTHDR=m |
104 | CONFIG_NFT_META=m | 104 | CONFIG_NFT_META=m |
105 | CONFIG_NFT_NUMGEN=m | ||
105 | CONFIG_NFT_CT=m | 106 | CONFIG_NFT_CT=m |
106 | CONFIG_NFT_RBTREE=m | 107 | CONFIG_NFT_SET_RBTREE=m |
107 | CONFIG_NFT_HASH=m | 108 | CONFIG_NFT_SET_HASH=m |
108 | CONFIG_NFT_COUNTER=m | 109 | CONFIG_NFT_COUNTER=m |
109 | CONFIG_NFT_LOG=m | 110 | CONFIG_NFT_LOG=m |
110 | CONFIG_NFT_LIMIT=m | 111 | CONFIG_NFT_LIMIT=m |
@@ -112,8 +113,10 @@ CONFIG_NFT_MASQ=m | |||
112 | CONFIG_NFT_REDIR=m | 113 | CONFIG_NFT_REDIR=m |
113 | CONFIG_NFT_NAT=m | 114 | CONFIG_NFT_NAT=m |
114 | CONFIG_NFT_QUEUE=m | 115 | CONFIG_NFT_QUEUE=m |
116 | CONFIG_NFT_QUOTA=m | ||
115 | CONFIG_NFT_REJECT=m | 117 | CONFIG_NFT_REJECT=m |
116 | CONFIG_NFT_COMPAT=m | 118 | CONFIG_NFT_COMPAT=m |
119 | CONFIG_NFT_HASH=m | ||
117 | CONFIG_NFT_DUP_NETDEV=m | 120 | CONFIG_NFT_DUP_NETDEV=m |
118 | CONFIG_NFT_FWD_NETDEV=m | 121 | CONFIG_NFT_FWD_NETDEV=m |
119 | CONFIG_NETFILTER_XT_SET=m | 122 | CONFIG_NETFILTER_XT_SET=m |
@@ -397,6 +400,7 @@ CONFIG_NETCONSOLE=m | |||
397 | CONFIG_NETCONSOLE_DYNAMIC=y | 400 | CONFIG_NETCONSOLE_DYNAMIC=y |
398 | CONFIG_VETH=m | 401 | CONFIG_VETH=m |
399 | # CONFIG_NET_VENDOR_3COM is not set | 402 | # CONFIG_NET_VENDOR_3COM is not set |
403 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
400 | CONFIG_A2065=y | 404 | CONFIG_A2065=y |
401 | CONFIG_ARIADNE=y | 405 | CONFIG_ARIADNE=y |
402 | CONFIG_ATARILANCE=y | 406 | CONFIG_ATARILANCE=y |
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index 0d502c2f73d5..28687192b68e 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_defconfig | |||
@@ -90,9 +90,10 @@ CONFIG_NF_TABLES_INET=m | |||
90 | CONFIG_NF_TABLES_NETDEV=m | 90 | CONFIG_NF_TABLES_NETDEV=m |
91 | CONFIG_NFT_EXTHDR=m | 91 | CONFIG_NFT_EXTHDR=m |
92 | CONFIG_NFT_META=m | 92 | CONFIG_NFT_META=m |
93 | CONFIG_NFT_NUMGEN=m | ||
93 | CONFIG_NFT_CT=m | 94 | CONFIG_NFT_CT=m |
94 | CONFIG_NFT_RBTREE=m | 95 | CONFIG_NFT_SET_RBTREE=m |
95 | CONFIG_NFT_HASH=m | 96 | CONFIG_NFT_SET_HASH=m |
96 | CONFIG_NFT_COUNTER=m | 97 | CONFIG_NFT_COUNTER=m |
97 | CONFIG_NFT_LOG=m | 98 | CONFIG_NFT_LOG=m |
98 | CONFIG_NFT_LIMIT=m | 99 | CONFIG_NFT_LIMIT=m |
@@ -100,8 +101,10 @@ CONFIG_NFT_MASQ=m | |||
100 | CONFIG_NFT_REDIR=m | 101 | CONFIG_NFT_REDIR=m |
101 | CONFIG_NFT_NAT=m | 102 | CONFIG_NFT_NAT=m |
102 | CONFIG_NFT_QUEUE=m | 103 | CONFIG_NFT_QUEUE=m |
104 | CONFIG_NFT_QUOTA=m | ||
103 | CONFIG_NFT_REJECT=m | 105 | CONFIG_NFT_REJECT=m |
104 | CONFIG_NFT_COMPAT=m | 106 | CONFIG_NFT_COMPAT=m |
107 | CONFIG_NFT_HASH=m | ||
105 | CONFIG_NFT_DUP_NETDEV=m | 108 | CONFIG_NFT_DUP_NETDEV=m |
106 | CONFIG_NFT_FWD_NETDEV=m | 109 | CONFIG_NFT_FWD_NETDEV=m |
107 | CONFIG_NETFILTER_XT_SET=m | 110 | CONFIG_NETFILTER_XT_SET=m |
@@ -345,6 +348,7 @@ CONFIG_MACSEC=m | |||
345 | CONFIG_NETCONSOLE=m | 348 | CONFIG_NETCONSOLE=m |
346 | CONFIG_NETCONSOLE_DYNAMIC=y | 349 | CONFIG_NETCONSOLE_DYNAMIC=y |
347 | CONFIG_VETH=m | 350 | CONFIG_VETH=m |
351 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
348 | CONFIG_MVME147_NET=y | 352 | CONFIG_MVME147_NET=y |
349 | # CONFIG_NET_VENDOR_ARC is not set | 353 | # CONFIG_NET_VENDOR_ARC is not set |
350 | # CONFIG_NET_CADENCE is not set | 354 | # CONFIG_NET_CADENCE is not set |
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 5930e91fc710..5a5f109ab3cd 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig | |||
@@ -91,9 +91,10 @@ CONFIG_NF_TABLES_INET=m | |||
91 | CONFIG_NF_TABLES_NETDEV=m | 91 | CONFIG_NF_TABLES_NETDEV=m |
92 | CONFIG_NFT_EXTHDR=m | 92 | CONFIG_NFT_EXTHDR=m |
93 | CONFIG_NFT_META=m | 93 | CONFIG_NFT_META=m |
94 | CONFIG_NFT_NUMGEN=m | ||
94 | CONFIG_NFT_CT=m | 95 | CONFIG_NFT_CT=m |
95 | CONFIG_NFT_RBTREE=m | 96 | CONFIG_NFT_SET_RBTREE=m |
96 | CONFIG_NFT_HASH=m | 97 | CONFIG_NFT_SET_HASH=m |
97 | CONFIG_NFT_COUNTER=m | 98 | CONFIG_NFT_COUNTER=m |
98 | CONFIG_NFT_LOG=m | 99 | CONFIG_NFT_LOG=m |
99 | CONFIG_NFT_LIMIT=m | 100 | CONFIG_NFT_LIMIT=m |
@@ -101,8 +102,10 @@ CONFIG_NFT_MASQ=m | |||
101 | CONFIG_NFT_REDIR=m | 102 | CONFIG_NFT_REDIR=m |
102 | CONFIG_NFT_NAT=m | 103 | CONFIG_NFT_NAT=m |
103 | CONFIG_NFT_QUEUE=m | 104 | CONFIG_NFT_QUEUE=m |
105 | CONFIG_NFT_QUOTA=m | ||
104 | CONFIG_NFT_REJECT=m | 106 | CONFIG_NFT_REJECT=m |
105 | CONFIG_NFT_COMPAT=m | 107 | CONFIG_NFT_COMPAT=m |
108 | CONFIG_NFT_HASH=m | ||
106 | CONFIG_NFT_DUP_NETDEV=m | 109 | CONFIG_NFT_DUP_NETDEV=m |
107 | CONFIG_NFT_FWD_NETDEV=m | 110 | CONFIG_NFT_FWD_NETDEV=m |
108 | CONFIG_NETFILTER_XT_SET=m | 111 | CONFIG_NETFILTER_XT_SET=m |
@@ -346,6 +349,7 @@ CONFIG_MACSEC=m | |||
346 | CONFIG_NETCONSOLE=m | 349 | CONFIG_NETCONSOLE=m |
347 | CONFIG_NETCONSOLE_DYNAMIC=y | 350 | CONFIG_NETCONSOLE_DYNAMIC=y |
348 | CONFIG_VETH=m | 351 | CONFIG_VETH=m |
352 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
349 | # CONFIG_NET_VENDOR_ARC is not set | 353 | # CONFIG_NET_VENDOR_ARC is not set |
350 | # CONFIG_NET_CADENCE is not set | 354 | # CONFIG_NET_CADENCE is not set |
351 | # CONFIG_NET_VENDOR_BROADCOM is not set | 355 | # CONFIG_NET_VENDOR_BROADCOM is not set |
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index 74e3ad82eca9..e557c9de3fbc 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_defconfig | |||
@@ -91,9 +91,10 @@ CONFIG_NF_TABLES_INET=m | |||
91 | CONFIG_NF_TABLES_NETDEV=m | 91 | CONFIG_NF_TABLES_NETDEV=m |
92 | CONFIG_NFT_EXTHDR=m | 92 | CONFIG_NFT_EXTHDR=m |
93 | CONFIG_NFT_META=m | 93 | CONFIG_NFT_META=m |
94 | CONFIG_NFT_NUMGEN=m | ||
94 | CONFIG_NFT_CT=m | 95 | CONFIG_NFT_CT=m |
95 | CONFIG_NFT_RBTREE=m | 96 | CONFIG_NFT_SET_RBTREE=m |
96 | CONFIG_NFT_HASH=m | 97 | CONFIG_NFT_SET_HASH=m |
97 | CONFIG_NFT_COUNTER=m | 98 | CONFIG_NFT_COUNTER=m |
98 | CONFIG_NFT_LOG=m | 99 | CONFIG_NFT_LOG=m |
99 | CONFIG_NFT_LIMIT=m | 100 | CONFIG_NFT_LIMIT=m |
@@ -101,8 +102,10 @@ CONFIG_NFT_MASQ=m | |||
101 | CONFIG_NFT_REDIR=m | 102 | CONFIG_NFT_REDIR=m |
102 | CONFIG_NFT_NAT=m | 103 | CONFIG_NFT_NAT=m |
103 | CONFIG_NFT_QUEUE=m | 104 | CONFIG_NFT_QUEUE=m |
105 | CONFIG_NFT_QUOTA=m | ||
104 | CONFIG_NFT_REJECT=m | 106 | CONFIG_NFT_REJECT=m |
105 | CONFIG_NFT_COMPAT=m | 107 | CONFIG_NFT_COMPAT=m |
108 | CONFIG_NFT_HASH=m | ||
106 | CONFIG_NFT_DUP_NETDEV=m | 109 | CONFIG_NFT_DUP_NETDEV=m |
107 | CONFIG_NFT_FWD_NETDEV=m | 110 | CONFIG_NFT_FWD_NETDEV=m |
108 | CONFIG_NETFILTER_XT_SET=m | 111 | CONFIG_NETFILTER_XT_SET=m |
@@ -353,6 +356,7 @@ CONFIG_NETCONSOLE=m | |||
353 | CONFIG_NETCONSOLE_DYNAMIC=y | 356 | CONFIG_NETCONSOLE_DYNAMIC=y |
354 | CONFIG_VETH=m | 357 | CONFIG_VETH=m |
355 | # CONFIG_NET_VENDOR_3COM is not set | 358 | # CONFIG_NET_VENDOR_3COM is not set |
359 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
356 | # CONFIG_NET_VENDOR_AMD is not set | 360 | # CONFIG_NET_VENDOR_AMD is not set |
357 | # CONFIG_NET_VENDOR_ARC is not set | 361 | # CONFIG_NET_VENDOR_ARC is not set |
358 | # CONFIG_NET_CADENCE is not set | 362 | # CONFIG_NET_CADENCE is not set |
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index 4ba8606a4e69..c6a748a36daf 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_defconfig | |||
@@ -88,9 +88,10 @@ CONFIG_NF_TABLES_INET=m | |||
88 | CONFIG_NF_TABLES_NETDEV=m | 88 | CONFIG_NF_TABLES_NETDEV=m |
89 | CONFIG_NFT_EXTHDR=m | 89 | CONFIG_NFT_EXTHDR=m |
90 | CONFIG_NFT_META=m | 90 | CONFIG_NFT_META=m |
91 | CONFIG_NFT_NUMGEN=m | ||
91 | CONFIG_NFT_CT=m | 92 | CONFIG_NFT_CT=m |
92 | CONFIG_NFT_RBTREE=m | 93 | CONFIG_NFT_SET_RBTREE=m |
93 | CONFIG_NFT_HASH=m | 94 | CONFIG_NFT_SET_HASH=m |
94 | CONFIG_NFT_COUNTER=m | 95 | CONFIG_NFT_COUNTER=m |
95 | CONFIG_NFT_LOG=m | 96 | CONFIG_NFT_LOG=m |
96 | CONFIG_NFT_LIMIT=m | 97 | CONFIG_NFT_LIMIT=m |
@@ -98,8 +99,10 @@ CONFIG_NFT_MASQ=m | |||
98 | CONFIG_NFT_REDIR=m | 99 | CONFIG_NFT_REDIR=m |
99 | CONFIG_NFT_NAT=m | 100 | CONFIG_NFT_NAT=m |
100 | CONFIG_NFT_QUEUE=m | 101 | CONFIG_NFT_QUEUE=m |
102 | CONFIG_NFT_QUOTA=m | ||
101 | CONFIG_NFT_REJECT=m | 103 | CONFIG_NFT_REJECT=m |
102 | CONFIG_NFT_COMPAT=m | 104 | CONFIG_NFT_COMPAT=m |
105 | CONFIG_NFT_HASH=m | ||
103 | CONFIG_NFT_DUP_NETDEV=m | 106 | CONFIG_NFT_DUP_NETDEV=m |
104 | CONFIG_NFT_FWD_NETDEV=m | 107 | CONFIG_NFT_FWD_NETDEV=m |
105 | CONFIG_NETFILTER_XT_SET=m | 108 | CONFIG_NETFILTER_XT_SET=m |
@@ -343,6 +346,7 @@ CONFIG_MACSEC=m | |||
343 | CONFIG_NETCONSOLE=m | 346 | CONFIG_NETCONSOLE=m |
344 | CONFIG_NETCONSOLE_DYNAMIC=y | 347 | CONFIG_NETCONSOLE_DYNAMIC=y |
345 | CONFIG_VETH=m | 348 | CONFIG_VETH=m |
349 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
346 | CONFIG_SUN3LANCE=y | 350 | CONFIG_SUN3LANCE=y |
347 | # CONFIG_NET_VENDOR_ARC is not set | 351 | # CONFIG_NET_VENDOR_ARC is not set |
348 | # CONFIG_NET_CADENCE is not set | 352 | # CONFIG_NET_CADENCE is not set |
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index c6f49726a6c9..10d60857b9a6 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_defconfig | |||
@@ -88,9 +88,10 @@ CONFIG_NF_TABLES_INET=m | |||
88 | CONFIG_NF_TABLES_NETDEV=m | 88 | CONFIG_NF_TABLES_NETDEV=m |
89 | CONFIG_NFT_EXTHDR=m | 89 | CONFIG_NFT_EXTHDR=m |
90 | CONFIG_NFT_META=m | 90 | CONFIG_NFT_META=m |
91 | CONFIG_NFT_NUMGEN=m | ||
91 | CONFIG_NFT_CT=m | 92 | CONFIG_NFT_CT=m |
92 | CONFIG_NFT_RBTREE=m | 93 | CONFIG_NFT_SET_RBTREE=m |
93 | CONFIG_NFT_HASH=m | 94 | CONFIG_NFT_SET_HASH=m |
94 | CONFIG_NFT_COUNTER=m | 95 | CONFIG_NFT_COUNTER=m |
95 | CONFIG_NFT_LOG=m | 96 | CONFIG_NFT_LOG=m |
96 | CONFIG_NFT_LIMIT=m | 97 | CONFIG_NFT_LIMIT=m |
@@ -98,8 +99,10 @@ CONFIG_NFT_MASQ=m | |||
98 | CONFIG_NFT_REDIR=m | 99 | CONFIG_NFT_REDIR=m |
99 | CONFIG_NFT_NAT=m | 100 | CONFIG_NFT_NAT=m |
100 | CONFIG_NFT_QUEUE=m | 101 | CONFIG_NFT_QUEUE=m |
102 | CONFIG_NFT_QUOTA=m | ||
101 | CONFIG_NFT_REJECT=m | 103 | CONFIG_NFT_REJECT=m |
102 | CONFIG_NFT_COMPAT=m | 104 | CONFIG_NFT_COMPAT=m |
105 | CONFIG_NFT_HASH=m | ||
103 | CONFIG_NFT_DUP_NETDEV=m | 106 | CONFIG_NFT_DUP_NETDEV=m |
104 | CONFIG_NFT_FWD_NETDEV=m | 107 | CONFIG_NFT_FWD_NETDEV=m |
105 | CONFIG_NETFILTER_XT_SET=m | 108 | CONFIG_NETFILTER_XT_SET=m |
@@ -343,6 +346,7 @@ CONFIG_MACSEC=m | |||
343 | CONFIG_NETCONSOLE=m | 346 | CONFIG_NETCONSOLE=m |
344 | CONFIG_NETCONSOLE_DYNAMIC=y | 347 | CONFIG_NETCONSOLE_DYNAMIC=y |
345 | CONFIG_VETH=m | 348 | CONFIG_VETH=m |
349 | # CONFIG_NET_VENDOR_AMAZON is not set | ||
346 | CONFIG_SUN3LANCE=y | 350 | CONFIG_SUN3LANCE=y |
347 | # CONFIG_NET_VENDOR_ARC is not set | 351 | # CONFIG_NET_VENDOR_ARC is not set |
348 | # CONFIG_NET_CADENCE is not set | 352 | # CONFIG_NET_CADENCE is not set |
diff --git a/arch/m68k/include/asm/delay.h b/arch/m68k/include/asm/delay.h index d28fa8fe26fe..c598d847d56b 100644 --- a/arch/m68k/include/asm/delay.h +++ b/arch/m68k/include/asm/delay.h | |||
@@ -114,6 +114,6 @@ static inline void __udelay(unsigned long usecs) | |||
114 | */ | 114 | */ |
115 | #define HZSCALE (268435456 / (1000000 / HZ)) | 115 | #define HZSCALE (268435456 / (1000000 / HZ)) |
116 | 116 | ||
117 | #define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000)); | 117 | #define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000)) |
118 | 118 | ||
119 | #endif /* defined(_M68K_DELAY_H) */ | 119 | #endif /* defined(_M68K_DELAY_H) */ |
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index c2c43f714684..3a4ed9f91d57 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h | |||
@@ -65,9 +65,9 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) | |||
65 | unsigned long flags; \ | 65 | unsigned long flags; \ |
66 | spin_lock_irqsave(&pa_tlb_lock, flags); \ | 66 | spin_lock_irqsave(&pa_tlb_lock, flags); \ |
67 | old_pte = *ptep; \ | 67 | old_pte = *ptep; \ |
68 | set_pte(ptep, pteval); \ | ||
69 | if (pte_inserted(old_pte)) \ | 68 | if (pte_inserted(old_pte)) \ |
70 | purge_tlb_entries(mm, addr); \ | 69 | purge_tlb_entries(mm, addr); \ |
70 | set_pte(ptep, pteval); \ | ||
71 | spin_unlock_irqrestore(&pa_tlb_lock, flags); \ | 71 | spin_unlock_irqrestore(&pa_tlb_lock, flags); \ |
72 | } while (0) | 72 | } while (0) |
73 | 73 | ||
@@ -478,8 +478,8 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned | |||
478 | spin_unlock_irqrestore(&pa_tlb_lock, flags); | 478 | spin_unlock_irqrestore(&pa_tlb_lock, flags); |
479 | return 0; | 479 | return 0; |
480 | } | 480 | } |
481 | set_pte(ptep, pte_mkold(pte)); | ||
482 | purge_tlb_entries(vma->vm_mm, addr); | 481 | purge_tlb_entries(vma->vm_mm, addr); |
482 | set_pte(ptep, pte_mkold(pte)); | ||
483 | spin_unlock_irqrestore(&pa_tlb_lock, flags); | 483 | spin_unlock_irqrestore(&pa_tlb_lock, flags); |
484 | return 1; | 484 | return 1; |
485 | } | 485 | } |
@@ -492,9 +492,9 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | |||
492 | 492 | ||
493 | spin_lock_irqsave(&pa_tlb_lock, flags); | 493 | spin_lock_irqsave(&pa_tlb_lock, flags); |
494 | old_pte = *ptep; | 494 | old_pte = *ptep; |
495 | set_pte(ptep, __pte(0)); | ||
496 | if (pte_inserted(old_pte)) | 495 | if (pte_inserted(old_pte)) |
497 | purge_tlb_entries(mm, addr); | 496 | purge_tlb_entries(mm, addr); |
497 | set_pte(ptep, __pte(0)); | ||
498 | spin_unlock_irqrestore(&pa_tlb_lock, flags); | 498 | spin_unlock_irqrestore(&pa_tlb_lock, flags); |
499 | 499 | ||
500 | return old_pte; | 500 | return old_pte; |
@@ -504,8 +504,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
504 | { | 504 | { |
505 | unsigned long flags; | 505 | unsigned long flags; |
506 | spin_lock_irqsave(&pa_tlb_lock, flags); | 506 | spin_lock_irqsave(&pa_tlb_lock, flags); |
507 | set_pte(ptep, pte_wrprotect(*ptep)); | ||
508 | purge_tlb_entries(mm, addr); | 507 | purge_tlb_entries(mm, addr); |
508 | set_pte(ptep, pte_wrprotect(*ptep)); | ||
509 | spin_unlock_irqrestore(&pa_tlb_lock, flags); | 509 | spin_unlock_irqrestore(&pa_tlb_lock, flags); |
510 | } | 510 | } |
511 | 511 | ||
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index c263301648f3..977f0a4f5ecf 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
@@ -393,6 +393,15 @@ void __init parisc_setup_cache_timing(void) | |||
393 | 393 | ||
394 | /* calculate TLB flush threshold */ | 394 | /* calculate TLB flush threshold */ |
395 | 395 | ||
396 | /* On SMP machines, skip the TLB measure of kernel text which | ||
397 | * has been mapped as huge pages. */ | ||
398 | if (num_online_cpus() > 1 && !parisc_requires_coherency()) { | ||
399 | threshold = max(cache_info.it_size, cache_info.dt_size); | ||
400 | threshold *= PAGE_SIZE; | ||
401 | threshold /= num_online_cpus(); | ||
402 | goto set_tlb_threshold; | ||
403 | } | ||
404 | |||
396 | alltime = mfctl(16); | 405 | alltime = mfctl(16); |
397 | flush_tlb_all(); | 406 | flush_tlb_all(); |
398 | alltime = mfctl(16) - alltime; | 407 | alltime = mfctl(16) - alltime; |
@@ -411,6 +420,8 @@ void __init parisc_setup_cache_timing(void) | |||
411 | alltime, size, rangetime); | 420 | alltime, size, rangetime); |
412 | 421 | ||
413 | threshold = PAGE_ALIGN(num_online_cpus() * size * alltime / rangetime); | 422 | threshold = PAGE_ALIGN(num_online_cpus() * size * alltime / rangetime); |
423 | |||
424 | set_tlb_threshold: | ||
414 | if (threshold) | 425 | if (threshold) |
415 | parisc_tlb_flush_threshold = threshold; | 426 | parisc_tlb_flush_threshold = threshold; |
416 | printk(KERN_INFO "TLB flush threshold set to %lu KiB\n", | 427 | printk(KERN_INFO "TLB flush threshold set to %lu KiB\n", |
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S index 1b39a2acaadf..adf7187f8951 100644 --- a/arch/parisc/kernel/pacache.S +++ b/arch/parisc/kernel/pacache.S | |||
@@ -892,19 +892,10 @@ ENTRY_CFI(flush_dcache_page_asm) | |||
892 | fdc,m r31(%r28) | 892 | fdc,m r31(%r28) |
893 | fdc,m r31(%r28) | 893 | fdc,m r31(%r28) |
894 | fdc,m r31(%r28) | 894 | fdc,m r31(%r28) |
895 | cmpb,COND(<<) %r28, %r25,1b | 895 | cmpb,COND(<<) %r28, %r25,1b |
896 | fdc,m r31(%r28) | 896 | fdc,m r31(%r28) |
897 | 897 | ||
898 | sync | 898 | sync |
899 | |||
900 | #ifdef CONFIG_PA20 | ||
901 | pdtlb,l %r0(%r25) | ||
902 | #else | ||
903 | tlb_lock %r20,%r21,%r22 | ||
904 | pdtlb %r0(%r25) | ||
905 | tlb_unlock %r20,%r21,%r22 | ||
906 | #endif | ||
907 | |||
908 | bv %r0(%r2) | 899 | bv %r0(%r2) |
909 | nop | 900 | nop |
910 | .exit | 901 | .exit |
@@ -979,17 +970,6 @@ ENTRY_CFI(flush_icache_page_asm) | |||
979 | fic,m %r31(%sr4,%r28) | 970 | fic,m %r31(%sr4,%r28) |
980 | 971 | ||
981 | sync | 972 | sync |
982 | |||
983 | #ifdef CONFIG_PA20 | ||
984 | pdtlb,l %r0(%r28) | ||
985 | pitlb,l %r0(%sr4,%r25) | ||
986 | #else | ||
987 | tlb_lock %r20,%r21,%r22 | ||
988 | pdtlb %r0(%r28) | ||
989 | pitlb %r0(%sr4,%r25) | ||
990 | tlb_unlock %r20,%r21,%r22 | ||
991 | #endif | ||
992 | |||
993 | bv %r0(%r2) | 973 | bv %r0(%r2) |
994 | nop | 974 | nop |
995 | .exit | 975 | .exit |
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 9d4bf3ab049e..6e395c996900 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c | |||
@@ -69,7 +69,7 @@ u64 x86_perf_event_update(struct perf_event *event) | |||
69 | int shift = 64 - x86_pmu.cntval_bits; | 69 | int shift = 64 - x86_pmu.cntval_bits; |
70 | u64 prev_raw_count, new_raw_count; | 70 | u64 prev_raw_count, new_raw_count; |
71 | int idx = hwc->idx; | 71 | int idx = hwc->idx; |
72 | s64 delta; | 72 | u64 delta; |
73 | 73 | ||
74 | if (idx == INTEL_PMC_IDX_FIXED_BTS) | 74 | if (idx == INTEL_PMC_IDX_FIXED_BTS) |
75 | return 0; | 75 | return 0; |
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index a74a2dbc0180..cb8522290e6a 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c | |||
@@ -4034,7 +4034,7 @@ __init int intel_pmu_init(void) | |||
4034 | 4034 | ||
4035 | /* Support full width counters using alternative MSR range */ | 4035 | /* Support full width counters using alternative MSR range */ |
4036 | if (x86_pmu.intel_cap.full_width_write) { | 4036 | if (x86_pmu.intel_cap.full_width_write) { |
4037 | x86_pmu.max_period = x86_pmu.cntval_mask; | 4037 | x86_pmu.max_period = x86_pmu.cntval_mask >> 1; |
4038 | x86_pmu.perfctr = MSR_IA32_PMC0; | 4038 | x86_pmu.perfctr = MSR_IA32_PMC0; |
4039 | pr_cont("full-width counters, "); | 4039 | pr_cont("full-width counters, "); |
4040 | } | 4040 | } |
diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index 4f5ac726335f..da51e5a3e2ff 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c | |||
@@ -540,6 +540,7 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { | |||
540 | X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_DESKTOP, snb_cstates), | 540 | X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_DESKTOP, snb_cstates), |
541 | 541 | ||
542 | X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNL, knl_cstates), | 542 | X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNL, knl_cstates), |
543 | X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNM, knl_cstates), | ||
543 | { }, | 544 | { }, |
544 | }; | 545 | }; |
545 | MODULE_DEVICE_TABLE(x86cpu, intel_cstates_match); | 546 | MODULE_DEVICE_TABLE(x86cpu, intel_cstates_match); |
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index 03d269bed941..24118c0b4640 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h | |||
@@ -272,7 +272,6 @@ struct compat_shmid64_ds { | |||
272 | /* | 272 | /* |
273 | * The type of struct elf_prstatus.pr_reg in compatible core dumps. | 273 | * The type of struct elf_prstatus.pr_reg in compatible core dumps. |
274 | */ | 274 | */ |
275 | #ifdef CONFIG_X86_X32_ABI | ||
276 | typedef struct user_regs_struct compat_elf_gregset_t; | 275 | typedef struct user_regs_struct compat_elf_gregset_t; |
277 | 276 | ||
278 | /* Full regset -- prstatus on x32, otherwise on ia32 */ | 277 | /* Full regset -- prstatus on x32, otherwise on ia32 */ |
@@ -281,10 +280,9 @@ typedef struct user_regs_struct compat_elf_gregset_t; | |||
281 | do { *(int *) (((void *) &((S)->pr_reg)) + R) = (V); } \ | 280 | do { *(int *) (((void *) &((S)->pr_reg)) + R) = (V); } \ |
282 | while (0) | 281 | while (0) |
283 | 282 | ||
283 | #ifdef CONFIG_X86_X32_ABI | ||
284 | #define COMPAT_USE_64BIT_TIME \ | 284 | #define COMPAT_USE_64BIT_TIME \ |
285 | (!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT)) | 285 | (!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT)) |
286 | #else | ||
287 | typedef struct user_regs_struct32 compat_elf_gregset_t; | ||
288 | #endif | 286 | #endif |
289 | 287 | ||
290 | /* | 288 | /* |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index aeef53ce93e1..35690a168cf7 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -815,9 +815,9 @@ static __init void map_mmioh_high_uv3(int index, int min_pnode, int max_pnode) | |||
815 | l = li; | 815 | l = li; |
816 | } | 816 | } |
817 | addr1 = (base << shift) + | 817 | addr1 = (base << shift) + |
818 | f * (unsigned long)(1 << m_io); | 818 | f * (1ULL << m_io); |
819 | addr2 = (base << shift) + | 819 | addr2 = (base << shift) + |
820 | (l + 1) * (unsigned long)(1 << m_io); | 820 | (l + 1) * (1ULL << m_io); |
821 | pr_info("UV: %s[%03d..%03d] NASID 0x%04x ADDR 0x%016lx - 0x%016lx\n", | 821 | pr_info("UV: %s[%03d..%03d] NASID 0x%04x ADDR 0x%016lx - 0x%016lx\n", |
822 | id, fi, li, lnasid, addr1, addr2); | 822 | id, fi, li, lnasid, addr1, addr2); |
823 | if (max_io < l) | 823 | if (max_io < l) |
diff --git a/arch/x86/kernel/unwind_guess.c b/arch/x86/kernel/unwind_guess.c index b80e8bf43cc6..22881ddcbb9f 100644 --- a/arch/x86/kernel/unwind_guess.c +++ b/arch/x86/kernel/unwind_guess.c | |||
@@ -7,11 +7,13 @@ | |||
7 | 7 | ||
8 | unsigned long unwind_get_return_address(struct unwind_state *state) | 8 | unsigned long unwind_get_return_address(struct unwind_state *state) |
9 | { | 9 | { |
10 | unsigned long addr = READ_ONCE_NOCHECK(*state->sp); | 10 | unsigned long addr; |
11 | 11 | ||
12 | if (unwind_done(state)) | 12 | if (unwind_done(state)) |
13 | return 0; | 13 | return 0; |
14 | 14 | ||
15 | addr = READ_ONCE_NOCHECK(*state->sp); | ||
16 | |||
15 | return ftrace_graph_ret_addr(state->task, &state->graph_idx, | 17 | return ftrace_graph_ret_addr(state->task, &state->graph_idx, |
16 | addr, state->sp); | 18 | addr, state->sp); |
17 | } | 19 | } |
@@ -25,11 +27,12 @@ bool unwind_next_frame(struct unwind_state *state) | |||
25 | return false; | 27 | return false; |
26 | 28 | ||
27 | do { | 29 | do { |
28 | unsigned long addr = READ_ONCE_NOCHECK(*state->sp); | 30 | for (state->sp++; state->sp < info->end; state->sp++) { |
31 | unsigned long addr = READ_ONCE_NOCHECK(*state->sp); | ||
29 | 32 | ||
30 | for (state->sp++; state->sp < info->end; state->sp++) | ||
31 | if (__kernel_text_address(addr)) | 33 | if (__kernel_text_address(addr)) |
32 | return true; | 34 | return true; |
35 | } | ||
33 | 36 | ||
34 | state->sp = info->next_sp; | 37 | state->sp = info->next_sp; |
35 | 38 | ||
diff --git a/arch/x86/platform/olpc/olpc-xo15-sci.c b/arch/x86/platform/olpc/olpc-xo15-sci.c index 55130846ac87..c0533fbc39e3 100644 --- a/arch/x86/platform/olpc/olpc-xo15-sci.c +++ b/arch/x86/platform/olpc/olpc-xo15-sci.c | |||
@@ -196,6 +196,7 @@ static int xo15_sci_remove(struct acpi_device *device) | |||
196 | return 0; | 196 | return 0; |
197 | } | 197 | } |
198 | 198 | ||
199 | #ifdef CONFIG_PM_SLEEP | ||
199 | static int xo15_sci_resume(struct device *dev) | 200 | static int xo15_sci_resume(struct device *dev) |
200 | { | 201 | { |
201 | /* Enable all EC events */ | 202 | /* Enable all EC events */ |
@@ -207,6 +208,7 @@ static int xo15_sci_resume(struct device *dev) | |||
207 | 208 | ||
208 | return 0; | 209 | return 0; |
209 | } | 210 | } |
211 | #endif | ||
210 | 212 | ||
211 | static SIMPLE_DEV_PM_OPS(xo15_sci_pm, NULL, xo15_sci_resume); | 213 | static SIMPLE_DEV_PM_OPS(xo15_sci_pm, NULL, xo15_sci_resume); |
212 | 214 | ||
diff --git a/arch/x86/tools/relocs.h b/arch/x86/tools/relocs.h index f59590645b68..1d23bf953a4a 100644 --- a/arch/x86/tools/relocs.h +++ b/arch/x86/tools/relocs.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <regex.h> | 16 | #include <regex.h> |
17 | #include <tools/le_byteshift.h> | 17 | #include <tools/le_byteshift.h> |
18 | 18 | ||
19 | void die(char *fmt, ...); | 19 | void die(char *fmt, ...) __attribute__((noreturn)); |
20 | 20 | ||
21 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 21 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
22 | 22 | ||
diff --git a/block/blk-map.c b/block/blk-map.c index b8657fa8dc9a..27fd8d92892d 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -118,6 +118,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
118 | struct iov_iter i; | 118 | struct iov_iter i; |
119 | int ret; | 119 | int ret; |
120 | 120 | ||
121 | if (!iter_is_iovec(iter)) | ||
122 | goto fail; | ||
123 | |||
121 | if (map_data) | 124 | if (map_data) |
122 | copy = true; | 125 | copy = true; |
123 | else if (iov_iter_alignment(iter) & align) | 126 | else if (iov_iter_alignment(iter) & align) |
@@ -140,6 +143,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
140 | 143 | ||
141 | unmap_rq: | 144 | unmap_rq: |
142 | __blk_rq_unmap_user(bio); | 145 | __blk_rq_unmap_user(bio); |
146 | fail: | ||
143 | rq->bio = NULL; | 147 | rq->bio = NULL; |
144 | return -EINVAL; | 148 | return -EINVAL; |
145 | } | 149 | } |
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index 80a0f1a78551..e9c0993b131d 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c | |||
@@ -81,7 +81,11 @@ static inline bool aead_sufficient_data(struct aead_ctx *ctx) | |||
81 | { | 81 | { |
82 | unsigned as = crypto_aead_authsize(crypto_aead_reqtfm(&ctx->aead_req)); | 82 | unsigned as = crypto_aead_authsize(crypto_aead_reqtfm(&ctx->aead_req)); |
83 | 83 | ||
84 | return ctx->used >= ctx->aead_assoclen + as; | 84 | /* |
85 | * The minimum amount of memory needed for an AEAD cipher is | ||
86 | * the AAD and in case of decryption the tag. | ||
87 | */ | ||
88 | return ctx->used >= ctx->aead_assoclen + (ctx->enc ? 0 : as); | ||
85 | } | 89 | } |
86 | 90 | ||
87 | static void aead_reset_ctx(struct aead_ctx *ctx) | 91 | static void aead_reset_ctx(struct aead_ctx *ctx) |
@@ -416,7 +420,7 @@ static int aead_recvmsg_async(struct socket *sock, struct msghdr *msg, | |||
416 | unsigned int i, reqlen = GET_REQ_SIZE(tfm); | 420 | unsigned int i, reqlen = GET_REQ_SIZE(tfm); |
417 | int err = -ENOMEM; | 421 | int err = -ENOMEM; |
418 | unsigned long used; | 422 | unsigned long used; |
419 | size_t outlen; | 423 | size_t outlen = 0; |
420 | size_t usedpages = 0; | 424 | size_t usedpages = 0; |
421 | 425 | ||
422 | lock_sock(sk); | 426 | lock_sock(sk); |
@@ -426,12 +430,15 @@ static int aead_recvmsg_async(struct socket *sock, struct msghdr *msg, | |||
426 | goto unlock; | 430 | goto unlock; |
427 | } | 431 | } |
428 | 432 | ||
429 | used = ctx->used; | ||
430 | outlen = used; | ||
431 | |||
432 | if (!aead_sufficient_data(ctx)) | 433 | if (!aead_sufficient_data(ctx)) |
433 | goto unlock; | 434 | goto unlock; |
434 | 435 | ||
436 | used = ctx->used; | ||
437 | if (ctx->enc) | ||
438 | outlen = used + as; | ||
439 | else | ||
440 | outlen = used - as; | ||
441 | |||
435 | req = sock_kmalloc(sk, reqlen, GFP_KERNEL); | 442 | req = sock_kmalloc(sk, reqlen, GFP_KERNEL); |
436 | if (unlikely(!req)) | 443 | if (unlikely(!req)) |
437 | goto unlock; | 444 | goto unlock; |
@@ -445,7 +452,7 @@ static int aead_recvmsg_async(struct socket *sock, struct msghdr *msg, | |||
445 | aead_request_set_ad(req, ctx->aead_assoclen); | 452 | aead_request_set_ad(req, ctx->aead_assoclen); |
446 | aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, | 453 | aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, |
447 | aead_async_cb, sk); | 454 | aead_async_cb, sk); |
448 | used -= ctx->aead_assoclen + (ctx->enc ? as : 0); | 455 | used -= ctx->aead_assoclen; |
449 | 456 | ||
450 | /* take over all tx sgls from ctx */ | 457 | /* take over all tx sgls from ctx */ |
451 | areq->tsgl = sock_kmalloc(sk, sizeof(*areq->tsgl) * sgl->cur, | 458 | areq->tsgl = sock_kmalloc(sk, sizeof(*areq->tsgl) * sgl->cur, |
@@ -461,7 +468,7 @@ static int aead_recvmsg_async(struct socket *sock, struct msghdr *msg, | |||
461 | areq->tsgls = sgl->cur; | 468 | areq->tsgls = sgl->cur; |
462 | 469 | ||
463 | /* create rx sgls */ | 470 | /* create rx sgls */ |
464 | while (iov_iter_count(&msg->msg_iter)) { | 471 | while (outlen > usedpages && iov_iter_count(&msg->msg_iter)) { |
465 | size_t seglen = min_t(size_t, iov_iter_count(&msg->msg_iter), | 472 | size_t seglen = min_t(size_t, iov_iter_count(&msg->msg_iter), |
466 | (outlen - usedpages)); | 473 | (outlen - usedpages)); |
467 | 474 | ||
@@ -491,16 +498,14 @@ static int aead_recvmsg_async(struct socket *sock, struct msghdr *msg, | |||
491 | 498 | ||
492 | last_rsgl = rsgl; | 499 | last_rsgl = rsgl; |
493 | 500 | ||
494 | /* we do not need more iovecs as we have sufficient memory */ | ||
495 | if (outlen <= usedpages) | ||
496 | break; | ||
497 | |||
498 | iov_iter_advance(&msg->msg_iter, err); | 501 | iov_iter_advance(&msg->msg_iter, err); |
499 | } | 502 | } |
500 | err = -EINVAL; | 503 | |
501 | /* ensure output buffer is sufficiently large */ | 504 | /* ensure output buffer is sufficiently large */ |
502 | if (usedpages < outlen) | 505 | if (usedpages < outlen) { |
503 | goto free; | 506 | err = -EINVAL; |
507 | goto unlock; | ||
508 | } | ||
504 | 509 | ||
505 | aead_request_set_crypt(req, areq->tsgl, areq->first_rsgl.sgl.sg, used, | 510 | aead_request_set_crypt(req, areq->tsgl, areq->first_rsgl.sgl.sg, used, |
506 | areq->iv); | 511 | areq->iv); |
@@ -571,6 +576,7 @@ static int aead_recvmsg_sync(struct socket *sock, struct msghdr *msg, int flags) | |||
571 | goto unlock; | 576 | goto unlock; |
572 | } | 577 | } |
573 | 578 | ||
579 | /* data length provided by caller via sendmsg/sendpage */ | ||
574 | used = ctx->used; | 580 | used = ctx->used; |
575 | 581 | ||
576 | /* | 582 | /* |
@@ -585,16 +591,27 @@ static int aead_recvmsg_sync(struct socket *sock, struct msghdr *msg, int flags) | |||
585 | if (!aead_sufficient_data(ctx)) | 591 | if (!aead_sufficient_data(ctx)) |
586 | goto unlock; | 592 | goto unlock; |
587 | 593 | ||
588 | outlen = used; | 594 | /* |
595 | * Calculate the minimum output buffer size holding the result of the | ||
596 | * cipher operation. When encrypting data, the receiving buffer is | ||
597 | * larger by the tag length compared to the input buffer as the | ||
598 | * encryption operation generates the tag. For decryption, the input | ||
599 | * buffer provides the tag which is consumed resulting in only the | ||
600 | * plaintext without a buffer for the tag returned to the caller. | ||
601 | */ | ||
602 | if (ctx->enc) | ||
603 | outlen = used + as; | ||
604 | else | ||
605 | outlen = used - as; | ||
589 | 606 | ||
590 | /* | 607 | /* |
591 | * The cipher operation input data is reduced by the associated data | 608 | * The cipher operation input data is reduced by the associated data |
592 | * length as this data is processed separately later on. | 609 | * length as this data is processed separately later on. |
593 | */ | 610 | */ |
594 | used -= ctx->aead_assoclen + (ctx->enc ? as : 0); | 611 | used -= ctx->aead_assoclen; |
595 | 612 | ||
596 | /* convert iovecs of output buffers into scatterlists */ | 613 | /* convert iovecs of output buffers into scatterlists */ |
597 | while (iov_iter_count(&msg->msg_iter)) { | 614 | while (outlen > usedpages && iov_iter_count(&msg->msg_iter)) { |
598 | size_t seglen = min_t(size_t, iov_iter_count(&msg->msg_iter), | 615 | size_t seglen = min_t(size_t, iov_iter_count(&msg->msg_iter), |
599 | (outlen - usedpages)); | 616 | (outlen - usedpages)); |
600 | 617 | ||
@@ -621,16 +638,14 @@ static int aead_recvmsg_sync(struct socket *sock, struct msghdr *msg, int flags) | |||
621 | 638 | ||
622 | last_rsgl = rsgl; | 639 | last_rsgl = rsgl; |
623 | 640 | ||
624 | /* we do not need more iovecs as we have sufficient memory */ | ||
625 | if (outlen <= usedpages) | ||
626 | break; | ||
627 | iov_iter_advance(&msg->msg_iter, err); | 641 | iov_iter_advance(&msg->msg_iter, err); |
628 | } | 642 | } |
629 | 643 | ||
630 | err = -EINVAL; | ||
631 | /* ensure output buffer is sufficiently large */ | 644 | /* ensure output buffer is sufficiently large */ |
632 | if (usedpages < outlen) | 645 | if (usedpages < outlen) { |
646 | err = -EINVAL; | ||
633 | goto unlock; | 647 | goto unlock; |
648 | } | ||
634 | 649 | ||
635 | sg_mark_end(sgl->sg + sgl->cur - 1); | 650 | sg_mark_end(sgl->sg + sgl->cur - 1); |
636 | aead_request_set_crypt(&ctx->aead_req, sgl->sg, ctx->first_rsgl.sgl.sg, | 651 | aead_request_set_crypt(&ctx->aead_req, sgl->sg, ctx->first_rsgl.sgl.sg, |
diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c index 94ee44acd465..c207458d6299 100644 --- a/crypto/mcryptd.c +++ b/crypto/mcryptd.c | |||
@@ -254,18 +254,22 @@ out_free_inst: | |||
254 | goto out; | 254 | goto out; |
255 | } | 255 | } |
256 | 256 | ||
257 | static inline void mcryptd_check_internal(struct rtattr **tb, u32 *type, | 257 | static inline bool mcryptd_check_internal(struct rtattr **tb, u32 *type, |
258 | u32 *mask) | 258 | u32 *mask) |
259 | { | 259 | { |
260 | struct crypto_attr_type *algt; | 260 | struct crypto_attr_type *algt; |
261 | 261 | ||
262 | algt = crypto_get_attr_type(tb); | 262 | algt = crypto_get_attr_type(tb); |
263 | if (IS_ERR(algt)) | 263 | if (IS_ERR(algt)) |
264 | return; | 264 | return false; |
265 | if ((algt->type & CRYPTO_ALG_INTERNAL)) | 265 | |
266 | *type |= CRYPTO_ALG_INTERNAL; | 266 | *type |= algt->type & CRYPTO_ALG_INTERNAL; |
267 | if ((algt->mask & CRYPTO_ALG_INTERNAL)) | 267 | *mask |= algt->mask & CRYPTO_ALG_INTERNAL; |
268 | *mask |= CRYPTO_ALG_INTERNAL; | 268 | |
269 | if (*type & *mask & CRYPTO_ALG_INTERNAL) | ||
270 | return true; | ||
271 | else | ||
272 | return false; | ||
269 | } | 273 | } |
270 | 274 | ||
271 | static int mcryptd_hash_init_tfm(struct crypto_tfm *tfm) | 275 | static int mcryptd_hash_init_tfm(struct crypto_tfm *tfm) |
@@ -492,7 +496,8 @@ static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, | |||
492 | u32 mask = 0; | 496 | u32 mask = 0; |
493 | int err; | 497 | int err; |
494 | 498 | ||
495 | mcryptd_check_internal(tb, &type, &mask); | 499 | if (!mcryptd_check_internal(tb, &type, &mask)) |
500 | return -EINVAL; | ||
496 | 501 | ||
497 | halg = ahash_attr_alg(tb[1], type, mask); | 502 | halg = ahash_attr_alg(tb[1], type, mask); |
498 | if (IS_ERR(halg)) | 503 | if (IS_ERR(halg)) |
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 71a7d07c28c9..312c4b4dc363 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
@@ -94,7 +94,7 @@ static struct acpi_device *to_acpi_dev(struct acpi_nfit_desc *acpi_desc) | |||
94 | return to_acpi_device(acpi_desc->dev); | 94 | return to_acpi_device(acpi_desc->dev); |
95 | } | 95 | } |
96 | 96 | ||
97 | static int xlat_status(void *buf, unsigned int cmd, u32 status) | 97 | static int xlat_bus_status(void *buf, unsigned int cmd, u32 status) |
98 | { | 98 | { |
99 | struct nd_cmd_clear_error *clear_err; | 99 | struct nd_cmd_clear_error *clear_err; |
100 | struct nd_cmd_ars_status *ars_status; | 100 | struct nd_cmd_ars_status *ars_status; |
@@ -113,7 +113,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status) | |||
113 | flags = ND_ARS_PERSISTENT | ND_ARS_VOLATILE; | 113 | flags = ND_ARS_PERSISTENT | ND_ARS_VOLATILE; |
114 | if ((status >> 16 & flags) == 0) | 114 | if ((status >> 16 & flags) == 0) |
115 | return -ENOTTY; | 115 | return -ENOTTY; |
116 | break; | 116 | return 0; |
117 | case ND_CMD_ARS_START: | 117 | case ND_CMD_ARS_START: |
118 | /* ARS is in progress */ | 118 | /* ARS is in progress */ |
119 | if ((status & 0xffff) == NFIT_ARS_START_BUSY) | 119 | if ((status & 0xffff) == NFIT_ARS_START_BUSY) |
@@ -122,7 +122,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status) | |||
122 | /* Command failed */ | 122 | /* Command failed */ |
123 | if (status & 0xffff) | 123 | if (status & 0xffff) |
124 | return -EIO; | 124 | return -EIO; |
125 | break; | 125 | return 0; |
126 | case ND_CMD_ARS_STATUS: | 126 | case ND_CMD_ARS_STATUS: |
127 | ars_status = buf; | 127 | ars_status = buf; |
128 | /* Command failed */ | 128 | /* Command failed */ |
@@ -146,7 +146,8 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status) | |||
146 | * then just continue with the returned results. | 146 | * then just continue with the returned results. |
147 | */ | 147 | */ |
148 | if (status == NFIT_ARS_STATUS_INTR) { | 148 | if (status == NFIT_ARS_STATUS_INTR) { |
149 | if (ars_status->flags & NFIT_ARS_F_OVERFLOW) | 149 | if (ars_status->out_length >= 40 && (ars_status->flags |
150 | & NFIT_ARS_F_OVERFLOW)) | ||
150 | return -ENOSPC; | 151 | return -ENOSPC; |
151 | return 0; | 152 | return 0; |
152 | } | 153 | } |
@@ -154,7 +155,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status) | |||
154 | /* Unknown status */ | 155 | /* Unknown status */ |
155 | if (status >> 16) | 156 | if (status >> 16) |
156 | return -EIO; | 157 | return -EIO; |
157 | break; | 158 | return 0; |
158 | case ND_CMD_CLEAR_ERROR: | 159 | case ND_CMD_CLEAR_ERROR: |
159 | clear_err = buf; | 160 | clear_err = buf; |
160 | if (status & 0xffff) | 161 | if (status & 0xffff) |
@@ -163,7 +164,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status) | |||
163 | return -EIO; | 164 | return -EIO; |
164 | if (clear_err->length > clear_err->cleared) | 165 | if (clear_err->length > clear_err->cleared) |
165 | return clear_err->cleared; | 166 | return clear_err->cleared; |
166 | break; | 167 | return 0; |
167 | default: | 168 | default: |
168 | break; | 169 | break; |
169 | } | 170 | } |
@@ -174,9 +175,18 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status) | |||
174 | return 0; | 175 | return 0; |
175 | } | 176 | } |
176 | 177 | ||
177 | static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, | 178 | static int xlat_status(struct nvdimm *nvdimm, void *buf, unsigned int cmd, |
178 | struct nvdimm *nvdimm, unsigned int cmd, void *buf, | 179 | u32 status) |
179 | unsigned int buf_len, int *cmd_rc) | 180 | { |
181 | if (!nvdimm) | ||
182 | return xlat_bus_status(buf, cmd, status); | ||
183 | if (status) | ||
184 | return -EIO; | ||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | ||
189 | unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc) | ||
180 | { | 190 | { |
181 | struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); | 191 | struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); |
182 | union acpi_object in_obj, in_buf, *out_obj; | 192 | union acpi_object in_obj, in_buf, *out_obj; |
@@ -298,7 +308,8 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, | |||
298 | 308 | ||
299 | for (i = 0, offset = 0; i < desc->out_num; i++) { | 309 | for (i = 0, offset = 0; i < desc->out_num; i++) { |
300 | u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, buf, | 310 | u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, buf, |
301 | (u32 *) out_obj->buffer.pointer); | 311 | (u32 *) out_obj->buffer.pointer, |
312 | out_obj->buffer.length - offset); | ||
302 | 313 | ||
303 | if (offset + out_size > out_obj->buffer.length) { | 314 | if (offset + out_size > out_obj->buffer.length) { |
304 | dev_dbg(dev, "%s:%s output object underflow cmd: %s field: %d\n", | 315 | dev_dbg(dev, "%s:%s output object underflow cmd: %s field: %d\n", |
@@ -333,7 +344,8 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, | |||
333 | */ | 344 | */ |
334 | rc = buf_len - offset - in_buf.buffer.length; | 345 | rc = buf_len - offset - in_buf.buffer.length; |
335 | if (cmd_rc) | 346 | if (cmd_rc) |
336 | *cmd_rc = xlat_status(buf, cmd, fw_status); | 347 | *cmd_rc = xlat_status(nvdimm, buf, cmd, |
348 | fw_status); | ||
337 | } else { | 349 | } else { |
338 | dev_err(dev, "%s:%s underrun cmd: %s buf_len: %d out_len: %d\n", | 350 | dev_err(dev, "%s:%s underrun cmd: %s buf_len: %d out_len: %d\n", |
339 | __func__, dimm_name, cmd_name, buf_len, | 351 | __func__, dimm_name, cmd_name, buf_len, |
@@ -343,7 +355,7 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, | |||
343 | } else { | 355 | } else { |
344 | rc = 0; | 356 | rc = 0; |
345 | if (cmd_rc) | 357 | if (cmd_rc) |
346 | *cmd_rc = xlat_status(buf, cmd, fw_status); | 358 | *cmd_rc = xlat_status(nvdimm, buf, cmd, fw_status); |
347 | } | 359 | } |
348 | 360 | ||
349 | out: | 361 | out: |
@@ -351,6 +363,7 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, | |||
351 | 363 | ||
352 | return rc; | 364 | return rc; |
353 | } | 365 | } |
366 | EXPORT_SYMBOL_GPL(acpi_nfit_ctl); | ||
354 | 367 | ||
355 | static const char *spa_type_name(u16 type) | 368 | static const char *spa_type_name(u16 type) |
356 | { | 369 | { |
@@ -2001,19 +2014,32 @@ static int ars_get_status(struct acpi_nfit_desc *acpi_desc) | |||
2001 | return cmd_rc; | 2014 | return cmd_rc; |
2002 | } | 2015 | } |
2003 | 2016 | ||
2004 | static int ars_status_process_records(struct nvdimm_bus *nvdimm_bus, | 2017 | static int ars_status_process_records(struct acpi_nfit_desc *acpi_desc, |
2005 | struct nd_cmd_ars_status *ars_status) | 2018 | struct nd_cmd_ars_status *ars_status) |
2006 | { | 2019 | { |
2020 | struct nvdimm_bus *nvdimm_bus = acpi_desc->nvdimm_bus; | ||
2007 | int rc; | 2021 | int rc; |
2008 | u32 i; | 2022 | u32 i; |
2009 | 2023 | ||
2024 | /* | ||
2025 | * First record starts at 44 byte offset from the start of the | ||
2026 | * payload. | ||
2027 | */ | ||
2028 | if (ars_status->out_length < 44) | ||
2029 | return 0; | ||
2010 | for (i = 0; i < ars_status->num_records; i++) { | 2030 | for (i = 0; i < ars_status->num_records; i++) { |
2031 | /* only process full records */ | ||
2032 | if (ars_status->out_length | ||
2033 | < 44 + sizeof(struct nd_ars_record) * (i + 1)) | ||
2034 | break; | ||
2011 | rc = nvdimm_bus_add_poison(nvdimm_bus, | 2035 | rc = nvdimm_bus_add_poison(nvdimm_bus, |
2012 | ars_status->records[i].err_address, | 2036 | ars_status->records[i].err_address, |
2013 | ars_status->records[i].length); | 2037 | ars_status->records[i].length); |
2014 | if (rc) | 2038 | if (rc) |
2015 | return rc; | 2039 | return rc; |
2016 | } | 2040 | } |
2041 | if (i < ars_status->num_records) | ||
2042 | dev_warn(acpi_desc->dev, "detected truncated ars results\n"); | ||
2017 | 2043 | ||
2018 | return 0; | 2044 | return 0; |
2019 | } | 2045 | } |
@@ -2266,8 +2292,7 @@ static int acpi_nfit_query_poison(struct acpi_nfit_desc *acpi_desc, | |||
2266 | if (rc < 0 && rc != -ENOSPC) | 2292 | if (rc < 0 && rc != -ENOSPC) |
2267 | return rc; | 2293 | return rc; |
2268 | 2294 | ||
2269 | if (ars_status_process_records(acpi_desc->nvdimm_bus, | 2295 | if (ars_status_process_records(acpi_desc, acpi_desc->ars_status)) |
2270 | acpi_desc->ars_status)) | ||
2271 | return -ENOMEM; | 2296 | return -ENOMEM; |
2272 | 2297 | ||
2273 | return 0; | 2298 | return 0; |
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h index 14296f5267c8..fc29c2e9832e 100644 --- a/drivers/acpi/nfit/nfit.h +++ b/drivers/acpi/nfit/nfit.h | |||
@@ -240,5 +240,7 @@ const u8 *to_nfit_uuid(enum nfit_uuids id); | |||
240 | int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, void *nfit, acpi_size sz); | 240 | int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, void *nfit, acpi_size sz); |
241 | void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event); | 241 | void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event); |
242 | void __acpi_nvdimm_notify(struct device *dev, u32 event); | 242 | void __acpi_nvdimm_notify(struct device *dev, u32 event); |
243 | int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | ||
244 | unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc); | ||
243 | void acpi_nfit_desc_init(struct acpi_nfit_desc *acpi_desc, struct device *dev); | 245 | void acpi_nfit_desc_init(struct acpi_nfit_desc *acpi_desc, struct device *dev); |
244 | #endif /* __NFIT_H__ */ | 246 | #endif /* __NFIT_H__ */ |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index c4eb4ae9c3aa..8e575fbdf31d 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1159,6 +1159,7 @@ static void ata_scsi_sdev_config(struct scsi_device *sdev) | |||
1159 | { | 1159 | { |
1160 | sdev->use_10_for_rw = 1; | 1160 | sdev->use_10_for_rw = 1; |
1161 | sdev->use_10_for_ms = 1; | 1161 | sdev->use_10_for_ms = 1; |
1162 | sdev->no_write_same = 1; | ||
1162 | 1163 | ||
1163 | /* Schedule policy is determined by ->qc_defer() callback and | 1164 | /* Schedule policy is determined by ->qc_defer() callback and |
1164 | * it needs to see every deferred qc. Set dev_blocked to 1 to | 1165 | * it needs to see every deferred qc. Set dev_blocked to 1 to |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index efc48bf89d51..823e938c9a78 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -4090,7 +4090,20 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
4090 | 4090 | ||
4091 | /* allocate host */ | 4091 | /* allocate host */ |
4092 | if (pdev->dev.of_node) { | 4092 | if (pdev->dev.of_node) { |
4093 | of_property_read_u32(pdev->dev.of_node, "nr-ports", &n_ports); | 4093 | rc = of_property_read_u32(pdev->dev.of_node, "nr-ports", |
4094 | &n_ports); | ||
4095 | if (rc) { | ||
4096 | dev_err(&pdev->dev, | ||
4097 | "error parsing nr-ports property: %d\n", rc); | ||
4098 | return rc; | ||
4099 | } | ||
4100 | |||
4101 | if (n_ports <= 0) { | ||
4102 | dev_err(&pdev->dev, "nr-ports must be positive: %d\n", | ||
4103 | n_ports); | ||
4104 | return -EINVAL; | ||
4105 | } | ||
4106 | |||
4094 | irq = irq_of_parse_and_map(pdev->dev.of_node, 0); | 4107 | irq = irq_of_parse_and_map(pdev->dev.of_node, 0); |
4095 | } else { | 4108 | } else { |
4096 | mv_platform_data = dev_get_platdata(&pdev->dev); | 4109 | mv_platform_data = dev_get_platdata(&pdev->dev); |
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index f2aaf9e32a36..40c2d561417b 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c | |||
@@ -1727,7 +1727,7 @@ static int eni_do_init(struct atm_dev *dev) | |||
1727 | printk("\n"); | 1727 | printk("\n"); |
1728 | printk(KERN_ERR DEV_LABEL "(itf %d): can't set up page " | 1728 | printk(KERN_ERR DEV_LABEL "(itf %d): can't set up page " |
1729 | "mapping\n",dev->number); | 1729 | "mapping\n",dev->number); |
1730 | return error; | 1730 | return -ENOMEM; |
1731 | } | 1731 | } |
1732 | eni_dev->ioaddr = base; | 1732 | eni_dev->ioaddr = base; |
1733 | eni_dev->base_diff = real_base - (unsigned long) base; | 1733 | eni_dev->base_diff = real_base - (unsigned long) base; |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index ce43ae3e87b3..445505d9ea07 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -2143,6 +2143,7 @@ static int lanai_dev_open(struct atm_dev *atmdev) | |||
2143 | lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE); | 2143 | lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE); |
2144 | if (lanai->base == NULL) { | 2144 | if (lanai->base == NULL) { |
2145 | printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n"); | 2145 | printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n"); |
2146 | result = -ENOMEM; | ||
2146 | goto error_pci; | 2147 | goto error_pci; |
2147 | } | 2148 | } |
2148 | /* 3.3: Reset lanai and PHY */ | 2149 | /* 3.3: Reset lanai and PHY */ |
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 5163c8f918cb..5497f7fc44d0 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c | |||
@@ -1413,8 +1413,14 @@ static ssize_t hot_remove_store(struct class *class, | |||
1413 | return ret ? ret : count; | 1413 | return ret ? ret : count; |
1414 | } | 1414 | } |
1415 | 1415 | ||
1416 | /* | ||
1417 | * NOTE: hot_add attribute is not the usual read-only sysfs attribute. In a | ||
1418 | * sense that reading from this file does alter the state of your system -- it | ||
1419 | * creates a new un-initialized zram device and returns back this device's | ||
1420 | * device_id (or an error code if it fails to create a new device). | ||
1421 | */ | ||
1416 | static struct class_attribute zram_control_class_attrs[] = { | 1422 | static struct class_attribute zram_control_class_attrs[] = { |
1417 | __ATTR_RO(hot_add), | 1423 | __ATTR(hot_add, 0400, hot_add_show, NULL), |
1418 | __ATTR_WO(hot_remove), | 1424 | __ATTR_WO(hot_remove), |
1419 | __ATTR_NULL, | 1425 | __ATTR_NULL, |
1420 | }; | 1426 | }; |
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 72ff19658985..e483b78c6343 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c | |||
@@ -558,8 +558,9 @@ static int caam_probe(struct platform_device *pdev) | |||
558 | * Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel, | 558 | * Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel, |
559 | * long pointers in master configuration register | 559 | * long pointers in master configuration register |
560 | */ | 560 | */ |
561 | clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK, MCFGR_AWCACHE_CACH | | 561 | clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK | MCFGR_LONG_PTR, |
562 | MCFGR_AWCACHE_BUFF | MCFGR_WDENABLE | MCFGR_LARGE_BURST | | 562 | MCFGR_AWCACHE_CACH | MCFGR_AWCACHE_BUFF | |
563 | MCFGR_WDENABLE | MCFGR_LARGE_BURST | | ||
563 | (sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0)); | 564 | (sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0)); |
564 | 565 | ||
565 | /* | 566 | /* |
diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c index 9f284682c091..77712b375b84 100644 --- a/drivers/crypto/marvell/hash.c +++ b/drivers/crypto/marvell/hash.c | |||
@@ -168,12 +168,11 @@ static void mv_cesa_ahash_std_step(struct ahash_request *req) | |||
168 | mv_cesa_adjust_op(engine, &creq->op_tmpl); | 168 | mv_cesa_adjust_op(engine, &creq->op_tmpl); |
169 | memcpy_toio(engine->sram, &creq->op_tmpl, sizeof(creq->op_tmpl)); | 169 | memcpy_toio(engine->sram, &creq->op_tmpl, sizeof(creq->op_tmpl)); |
170 | 170 | ||
171 | digsize = crypto_ahash_digestsize(crypto_ahash_reqtfm(req)); | 171 | if (!sreq->offset) { |
172 | for (i = 0; i < digsize / 4; i++) | 172 | digsize = crypto_ahash_digestsize(crypto_ahash_reqtfm(req)); |
173 | writel_relaxed(creq->state[i], engine->regs + CESA_IVDIG(i)); | 173 | for (i = 0; i < digsize / 4; i++) |
174 | 174 | writel_relaxed(creq->state[i], engine->regs + CESA_IVDIG(i)); | |
175 | mv_cesa_adjust_op(engine, &creq->op_tmpl); | 175 | } |
176 | memcpy_toio(engine->sram, &creq->op_tmpl, sizeof(creq->op_tmpl)); | ||
177 | 176 | ||
178 | if (creq->cache_ptr) | 177 | if (creq->cache_ptr) |
179 | memcpy_toio(engine->sram + CESA_SA_DATA_SRAM_OFFSET, | 178 | memcpy_toio(engine->sram + CESA_SA_DATA_SRAM_OFFSET, |
diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c index 3d94ff20fdca..286447a83dab 100644 --- a/drivers/dax/dax.c +++ b/drivers/dax/dax.c | |||
@@ -271,7 +271,7 @@ static int check_vma(struct dax_dev *dax_dev, struct vm_area_struct *vma, | |||
271 | return -ENXIO; | 271 | return -ENXIO; |
272 | 272 | ||
273 | /* prevent private mappings from being established */ | 273 | /* prevent private mappings from being established */ |
274 | if ((vma->vm_flags & VM_SHARED) != VM_SHARED) { | 274 | if ((vma->vm_flags & VM_MAYSHARE) != VM_MAYSHARE) { |
275 | dev_info(dev, "%s: %s: fail, attempted private mapping\n", | 275 | dev_info(dev, "%s: %s: fail, attempted private mapping\n", |
276 | current->comm, func); | 276 | current->comm, func); |
277 | return -EINVAL; | 277 | return -EINVAL; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 496f72b134eb..05c2850c04b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -2472,6 +2472,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, | |||
2472 | struct drm_file *file_priv); | 2472 | struct drm_file *file_priv); |
2473 | void amdgpu_driver_preclose_kms(struct drm_device *dev, | 2473 | void amdgpu_driver_preclose_kms(struct drm_device *dev, |
2474 | struct drm_file *file_priv); | 2474 | struct drm_file *file_priv); |
2475 | int amdgpu_suspend(struct amdgpu_device *adev); | ||
2475 | int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon); | 2476 | int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon); |
2476 | int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon); | 2477 | int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon); |
2477 | u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); | 2478 | u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 3161d77bf299..e41d4baebf86 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -1493,7 +1493,7 @@ static int amdgpu_fini(struct amdgpu_device *adev) | |||
1493 | return 0; | 1493 | return 0; |
1494 | } | 1494 | } |
1495 | 1495 | ||
1496 | static int amdgpu_suspend(struct amdgpu_device *adev) | 1496 | int amdgpu_suspend(struct amdgpu_device *adev) |
1497 | { | 1497 | { |
1498 | int i, r; | 1498 | int i, r; |
1499 | 1499 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 02ff0747197c..e0890deccb2f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
@@ -479,12 +479,15 @@ amdgpu_pci_remove(struct pci_dev *pdev) | |||
479 | static void | 479 | static void |
480 | amdgpu_pci_shutdown(struct pci_dev *pdev) | 480 | amdgpu_pci_shutdown(struct pci_dev *pdev) |
481 | { | 481 | { |
482 | struct drm_device *dev = pci_get_drvdata(pdev); | ||
483 | struct amdgpu_device *adev = dev->dev_private; | ||
484 | |||
482 | /* if we are running in a VM, make sure the device | 485 | /* if we are running in a VM, make sure the device |
483 | * torn down properly on reboot/shutdown. | 486 | * torn down properly on reboot/shutdown. |
484 | * unfortunately we can't detect certain | 487 | * unfortunately we can't detect certain |
485 | * hypervisors so just do this all the time. | 488 | * hypervisors so just do this all the time. |
486 | */ | 489 | */ |
487 | amdgpu_pci_remove(pdev); | 490 | amdgpu_suspend(adev); |
488 | } | 491 | } |
489 | 492 | ||
490 | static int amdgpu_pmops_suspend(struct device *dev) | 493 | static int amdgpu_pmops_suspend(struct device *dev) |
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index d1f8ab915b15..b90776ef56ec 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c | |||
@@ -755,8 +755,10 @@ static int __init ser_gigaset_init(void) | |||
755 | driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS, | 755 | driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS, |
756 | GIGASET_MODULENAME, GIGASET_DEVNAME, | 756 | GIGASET_MODULENAME, GIGASET_DEVNAME, |
757 | &ops, THIS_MODULE); | 757 | &ops, THIS_MODULE); |
758 | if (!driver) | 758 | if (!driver) { |
759 | rc = -ENOMEM; | ||
759 | goto error; | 760 | goto error; |
761 | } | ||
760 | 762 | ||
761 | rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc); | 763 | rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc); |
762 | if (rc != 0) { | 764 | if (rc != 0) { |
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c index 9600cd771f1a..e034ed847ff3 100644 --- a/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/drivers/isdn/hisax/hfc4s8s_l1.c | |||
@@ -1499,6 +1499,7 @@ hfc4s8s_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1499 | printk(KERN_INFO | 1499 | printk(KERN_INFO |
1500 | "HFC-4S/8S: failed to request address space at 0x%04x\n", | 1500 | "HFC-4S/8S: failed to request address space at 0x%04x\n", |
1501 | hw->iobase); | 1501 | hw->iobase); |
1502 | err = -EBUSY; | ||
1502 | goto out; | 1503 | goto out; |
1503 | } | 1504 | } |
1504 | 1505 | ||
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c index f3141ca56bc3..0b0302af3bd2 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c | |||
@@ -870,23 +870,25 @@ lbl_free_candev: | |||
870 | static void peak_usb_disconnect(struct usb_interface *intf) | 870 | static void peak_usb_disconnect(struct usb_interface *intf) |
871 | { | 871 | { |
872 | struct peak_usb_device *dev; | 872 | struct peak_usb_device *dev; |
873 | struct peak_usb_device *dev_prev_siblings; | ||
873 | 874 | ||
874 | /* unregister as many netdev devices as siblings */ | 875 | /* unregister as many netdev devices as siblings */ |
875 | for (dev = usb_get_intfdata(intf); dev; dev = dev->prev_siblings) { | 876 | for (dev = usb_get_intfdata(intf); dev; dev = dev_prev_siblings) { |
876 | struct net_device *netdev = dev->netdev; | 877 | struct net_device *netdev = dev->netdev; |
877 | char name[IFNAMSIZ]; | 878 | char name[IFNAMSIZ]; |
878 | 879 | ||
880 | dev_prev_siblings = dev->prev_siblings; | ||
879 | dev->state &= ~PCAN_USB_STATE_CONNECTED; | 881 | dev->state &= ~PCAN_USB_STATE_CONNECTED; |
880 | strncpy(name, netdev->name, IFNAMSIZ); | 882 | strncpy(name, netdev->name, IFNAMSIZ); |
881 | 883 | ||
882 | unregister_netdev(netdev); | 884 | unregister_netdev(netdev); |
883 | free_candev(netdev); | ||
884 | 885 | ||
885 | kfree(dev->cmd_buf); | 886 | kfree(dev->cmd_buf); |
886 | dev->next_siblings = NULL; | 887 | dev->next_siblings = NULL; |
887 | if (dev->adapter->dev_free) | 888 | if (dev->adapter->dev_free) |
888 | dev->adapter->dev_free(dev); | 889 | dev->adapter->dev_free(dev); |
889 | 890 | ||
891 | free_candev(netdev); | ||
890 | dev_info(&intf->dev, "%s removed\n", name); | 892 | dev_info(&intf->dev, "%s removed\n", name); |
891 | } | 893 | } |
892 | 894 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 85a7800bfc12..5f19427c7b27 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -1872,8 +1872,16 @@ static void bnx2x_get_ringparam(struct net_device *dev, | |||
1872 | 1872 | ||
1873 | ering->rx_max_pending = MAX_RX_AVAIL; | 1873 | ering->rx_max_pending = MAX_RX_AVAIL; |
1874 | 1874 | ||
1875 | /* If size isn't already set, we give an estimation of the number | ||
1876 | * of buffers we'll have. We're neglecting some possible conditions | ||
1877 | * [we couldn't know for certain at this point if number of queues | ||
1878 | * might shrink] but the number would be correct for the likely | ||
1879 | * scenario. | ||
1880 | */ | ||
1875 | if (bp->rx_ring_size) | 1881 | if (bp->rx_ring_size) |
1876 | ering->rx_pending = bp->rx_ring_size; | 1882 | ering->rx_pending = bp->rx_ring_size; |
1883 | else if (BNX2X_NUM_RX_QUEUES(bp)) | ||
1884 | ering->rx_pending = MAX_RX_AVAIL / BNX2X_NUM_RX_QUEUES(bp); | ||
1877 | else | 1885 | else |
1878 | ering->rx_pending = MAX_RX_AVAIL; | 1886 | ering->rx_pending = MAX_RX_AVAIL; |
1879 | 1887 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 0cee4c0283f9..4febe60eadc2 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -10138,7 +10138,7 @@ static void __bnx2x_add_udp_port(struct bnx2x *bp, u16 port, | |||
10138 | { | 10138 | { |
10139 | struct bnx2x_udp_tunnel *udp_port = &bp->udp_tunnel_ports[type]; | 10139 | struct bnx2x_udp_tunnel *udp_port = &bp->udp_tunnel_ports[type]; |
10140 | 10140 | ||
10141 | if (!netif_running(bp->dev) || !IS_PF(bp)) | 10141 | if (!netif_running(bp->dev) || !IS_PF(bp) || CHIP_IS_E1x(bp)) |
10142 | return; | 10142 | return; |
10143 | 10143 | ||
10144 | if (udp_port->count && udp_port->dst_port == port) { | 10144 | if (udp_port->count && udp_port->dst_port == port) { |
@@ -10163,7 +10163,7 @@ static void __bnx2x_del_udp_port(struct bnx2x *bp, u16 port, | |||
10163 | { | 10163 | { |
10164 | struct bnx2x_udp_tunnel *udp_port = &bp->udp_tunnel_ports[type]; | 10164 | struct bnx2x_udp_tunnel *udp_port = &bp->udp_tunnel_ports[type]; |
10165 | 10165 | ||
10166 | if (!IS_PF(bp)) | 10166 | if (!IS_PF(bp) || CHIP_IS_E1x(bp)) |
10167 | return; | 10167 | return; |
10168 | 10168 | ||
10169 | if (!udp_port->count || udp_port->dst_port != port) { | 10169 | if (!udp_port->count || udp_port->dst_port != port) { |
@@ -13505,6 +13505,7 @@ static int bnx2x_init_firmware(struct bnx2x *bp) | |||
13505 | 13505 | ||
13506 | /* Initialize the pointers to the init arrays */ | 13506 | /* Initialize the pointers to the init arrays */ |
13507 | /* Blob */ | 13507 | /* Blob */ |
13508 | rc = -ENOMEM; | ||
13508 | BNX2X_ALLOC_AND_SET(init_data, request_firmware_exit, be32_to_cpu_n); | 13509 | BNX2X_ALLOC_AND_SET(init_data, request_firmware_exit, be32_to_cpu_n); |
13509 | 13510 | ||
13510 | /* Opcodes */ | 13511 | /* Opcodes */ |
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index ee1a803aa11a..f08a20b921e7 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -4120,7 +4120,7 @@ static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp) | |||
4120 | bp->grp_info[i].fw_stats_ctx = cpr->hw_stats_ctx_id; | 4120 | bp->grp_info[i].fw_stats_ctx = cpr->hw_stats_ctx_id; |
4121 | } | 4121 | } |
4122 | mutex_unlock(&bp->hwrm_cmd_lock); | 4122 | mutex_unlock(&bp->hwrm_cmd_lock); |
4123 | return 0; | 4123 | return rc; |
4124 | } | 4124 | } |
4125 | 4125 | ||
4126 | static int bnxt_hwrm_func_qcfg(struct bnxt *bp) | 4126 | static int bnxt_hwrm_func_qcfg(struct bnxt *bp) |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 57eb4e1345cb..19dc9e25aa72 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -4931,6 +4931,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
4931 | */ | 4931 | */ |
4932 | for_each_port(adapter, i) { | 4932 | for_each_port(adapter, i) { |
4933 | pi = adap2pinfo(adapter, i); | 4933 | pi = adap2pinfo(adapter, i); |
4934 | adapter->port[i]->dev_port = pi->lport; | ||
4934 | netif_set_real_num_tx_queues(adapter->port[i], pi->nqsets); | 4935 | netif_set_real_num_tx_queues(adapter->port[i], pi->nqsets); |
4935 | netif_set_real_num_rx_queues(adapter->port[i], pi->nqsets); | 4936 | netif_set_real_num_rx_queues(adapter->port[i], pi->nqsets); |
4936 | 4937 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index 20dec85da63d..e8139514d32c 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | |||
@@ -7851,7 +7851,6 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf) | |||
7851 | return ret; | 7851 | return ret; |
7852 | 7852 | ||
7853 | memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN); | 7853 | memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN); |
7854 | adap->port[i]->dev_port = j; | ||
7855 | j++; | 7854 | j++; |
7856 | } | 7855 | } |
7857 | return 0; | 7856 | return 0; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 100b2cc064a3..a37481c04a87 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -2969,6 +2969,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, | |||
2969 | 2969 | ||
2970 | netdev->netdev_ops = &cxgb4vf_netdev_ops; | 2970 | netdev->netdev_ops = &cxgb4vf_netdev_ops; |
2971 | netdev->ethtool_ops = &cxgb4vf_ethtool_ops; | 2971 | netdev->ethtool_ops = &cxgb4vf_ethtool_ops; |
2972 | netdev->dev_port = pi->port_id; | ||
2972 | 2973 | ||
2973 | /* | 2974 | /* |
2974 | * Initialize the hardware/software state for the port. | 2975 | * Initialize the hardware/software state for the port. |
diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c b/drivers/net/ethernet/cirrus/ep93xx_eth.c index de9f7c97d916..9a161e981529 100644 --- a/drivers/net/ethernet/cirrus/ep93xx_eth.c +++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c | |||
@@ -468,6 +468,9 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep) | |||
468 | struct device *dev = ep->dev->dev.parent; | 468 | struct device *dev = ep->dev->dev.parent; |
469 | int i; | 469 | int i; |
470 | 470 | ||
471 | if (!ep->descs) | ||
472 | return; | ||
473 | |||
471 | for (i = 0; i < RX_QUEUE_ENTRIES; i++) { | 474 | for (i = 0; i < RX_QUEUE_ENTRIES; i++) { |
472 | dma_addr_t d; | 475 | dma_addr_t d; |
473 | 476 | ||
@@ -490,6 +493,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep) | |||
490 | 493 | ||
491 | dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs, | 494 | dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs, |
492 | ep->descs_dma_addr); | 495 | ep->descs_dma_addr); |
496 | ep->descs = NULL; | ||
493 | } | 497 | } |
494 | 498 | ||
495 | static int ep93xx_alloc_buffers(struct ep93xx_priv *ep) | 499 | static int ep93xx_alloc_buffers(struct ep93xx_priv *ep) |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 1fb5d7239254..0e74529a4209 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -90,7 +90,8 @@ static struct be_cmd_priv_map cmd_priv_map[] = { | |||
90 | { | 90 | { |
91 | OPCODE_COMMON_SET_HSW_CONFIG, | 91 | OPCODE_COMMON_SET_HSW_CONFIG, |
92 | CMD_SUBSYSTEM_COMMON, | 92 | CMD_SUBSYSTEM_COMMON, |
93 | BE_PRIV_DEVCFG | BE_PRIV_VHADM | 93 | BE_PRIV_DEVCFG | BE_PRIV_VHADM | |
94 | BE_PRIV_DEVSEC | ||
94 | }, | 95 | }, |
95 | { | 96 | { |
96 | OPCODE_COMMON_GET_EXT_FAT_CAPABILITIES, | 97 | OPCODE_COMMON_GET_EXT_FAT_CAPABILITIES, |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 5f77caa59534..12aef1b15356 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -2313,6 +2313,8 @@ static const struct fec_stat { | |||
2313 | { "IEEE_rx_octets_ok", IEEE_R_OCTETS_OK }, | 2313 | { "IEEE_rx_octets_ok", IEEE_R_OCTETS_OK }, |
2314 | }; | 2314 | }; |
2315 | 2315 | ||
2316 | #define FEC_STATS_SIZE (ARRAY_SIZE(fec_stats) * sizeof(u64)) | ||
2317 | |||
2316 | static void fec_enet_update_ethtool_stats(struct net_device *dev) | 2318 | static void fec_enet_update_ethtool_stats(struct net_device *dev) |
2317 | { | 2319 | { |
2318 | struct fec_enet_private *fep = netdev_priv(dev); | 2320 | struct fec_enet_private *fep = netdev_priv(dev); |
@@ -2330,7 +2332,7 @@ static void fec_enet_get_ethtool_stats(struct net_device *dev, | |||
2330 | if (netif_running(dev)) | 2332 | if (netif_running(dev)) |
2331 | fec_enet_update_ethtool_stats(dev); | 2333 | fec_enet_update_ethtool_stats(dev); |
2332 | 2334 | ||
2333 | memcpy(data, fep->ethtool_stats, ARRAY_SIZE(fec_stats) * sizeof(u64)); | 2335 | memcpy(data, fep->ethtool_stats, FEC_STATS_SIZE); |
2334 | } | 2336 | } |
2335 | 2337 | ||
2336 | static void fec_enet_get_strings(struct net_device *netdev, | 2338 | static void fec_enet_get_strings(struct net_device *netdev, |
@@ -2355,6 +2357,12 @@ static int fec_enet_get_sset_count(struct net_device *dev, int sset) | |||
2355 | return -EOPNOTSUPP; | 2357 | return -EOPNOTSUPP; |
2356 | } | 2358 | } |
2357 | } | 2359 | } |
2360 | |||
2361 | #else /* !defined(CONFIG_M5272) */ | ||
2362 | #define FEC_STATS_SIZE 0 | ||
2363 | static inline void fec_enet_update_ethtool_stats(struct net_device *dev) | ||
2364 | { | ||
2365 | } | ||
2358 | #endif /* !defined(CONFIG_M5272) */ | 2366 | #endif /* !defined(CONFIG_M5272) */ |
2359 | 2367 | ||
2360 | static int fec_enet_nway_reset(struct net_device *dev) | 2368 | static int fec_enet_nway_reset(struct net_device *dev) |
@@ -3293,8 +3301,7 @@ fec_probe(struct platform_device *pdev) | |||
3293 | 3301 | ||
3294 | /* Init network device */ | 3302 | /* Init network device */ |
3295 | ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) + | 3303 | ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) + |
3296 | ARRAY_SIZE(fec_stats) * sizeof(u64), | 3304 | FEC_STATS_SIZE, num_tx_qs, num_rx_qs); |
3297 | num_tx_qs, num_rx_qs); | ||
3298 | if (!ndev) | 3305 | if (!ndev) |
3299 | return -ENOMEM; | 3306 | return -ENOMEM; |
3300 | 3307 | ||
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index ebe60719e489..a36022ba4e42 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c | |||
@@ -58,7 +58,7 @@ static struct kobj_type ktype_veth_pool; | |||
58 | 58 | ||
59 | static const char ibmveth_driver_name[] = "ibmveth"; | 59 | static const char ibmveth_driver_name[] = "ibmveth"; |
60 | static const char ibmveth_driver_string[] = "IBM Power Virtual Ethernet Driver"; | 60 | static const char ibmveth_driver_string[] = "IBM Power Virtual Ethernet Driver"; |
61 | #define ibmveth_driver_version "1.05" | 61 | #define ibmveth_driver_version "1.06" |
62 | 62 | ||
63 | MODULE_AUTHOR("Santiago Leon <santil@linux.vnet.ibm.com>"); | 63 | MODULE_AUTHOR("Santiago Leon <santil@linux.vnet.ibm.com>"); |
64 | MODULE_DESCRIPTION("IBM Power Virtual Ethernet Driver"); | 64 | MODULE_DESCRIPTION("IBM Power Virtual Ethernet Driver"); |
@@ -137,6 +137,11 @@ static inline int ibmveth_rxq_frame_offset(struct ibmveth_adapter *adapter) | |||
137 | return ibmveth_rxq_flags(adapter) & IBMVETH_RXQ_OFF_MASK; | 137 | return ibmveth_rxq_flags(adapter) & IBMVETH_RXQ_OFF_MASK; |
138 | } | 138 | } |
139 | 139 | ||
140 | static inline int ibmveth_rxq_large_packet(struct ibmveth_adapter *adapter) | ||
141 | { | ||
142 | return ibmveth_rxq_flags(adapter) & IBMVETH_RXQ_LRG_PKT; | ||
143 | } | ||
144 | |||
140 | static inline int ibmveth_rxq_frame_length(struct ibmveth_adapter *adapter) | 145 | static inline int ibmveth_rxq_frame_length(struct ibmveth_adapter *adapter) |
141 | { | 146 | { |
142 | return be32_to_cpu(adapter->rx_queue.queue_addr[adapter->rx_queue.index].length); | 147 | return be32_to_cpu(adapter->rx_queue.queue_addr[adapter->rx_queue.index].length); |
@@ -1174,6 +1179,45 @@ map_failed: | |||
1174 | goto retry_bounce; | 1179 | goto retry_bounce; |
1175 | } | 1180 | } |
1176 | 1181 | ||
1182 | static void ibmveth_rx_mss_helper(struct sk_buff *skb, u16 mss, int lrg_pkt) | ||
1183 | { | ||
1184 | int offset = 0; | ||
1185 | |||
1186 | /* only TCP packets will be aggregated */ | ||
1187 | if (skb->protocol == htons(ETH_P_IP)) { | ||
1188 | struct iphdr *iph = (struct iphdr *)skb->data; | ||
1189 | |||
1190 | if (iph->protocol == IPPROTO_TCP) { | ||
1191 | offset = iph->ihl * 4; | ||
1192 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | ||
1193 | } else { | ||
1194 | return; | ||
1195 | } | ||
1196 | } else if (skb->protocol == htons(ETH_P_IPV6)) { | ||
1197 | struct ipv6hdr *iph6 = (struct ipv6hdr *)skb->data; | ||
1198 | |||
1199 | if (iph6->nexthdr == IPPROTO_TCP) { | ||
1200 | offset = sizeof(struct ipv6hdr); | ||
1201 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; | ||
1202 | } else { | ||
1203 | return; | ||
1204 | } | ||
1205 | } else { | ||
1206 | return; | ||
1207 | } | ||
1208 | /* if mss is not set through Large Packet bit/mss in rx buffer, | ||
1209 | * expect that the mss will be written to the tcp header checksum. | ||
1210 | */ | ||
1211 | if (lrg_pkt) { | ||
1212 | skb_shinfo(skb)->gso_size = mss; | ||
1213 | } else if (offset) { | ||
1214 | struct tcphdr *tcph = (struct tcphdr *)(skb->data + offset); | ||
1215 | |||
1216 | skb_shinfo(skb)->gso_size = ntohs(tcph->check); | ||
1217 | tcph->check = 0; | ||
1218 | } | ||
1219 | } | ||
1220 | |||
1177 | static int ibmveth_poll(struct napi_struct *napi, int budget) | 1221 | static int ibmveth_poll(struct napi_struct *napi, int budget) |
1178 | { | 1222 | { |
1179 | struct ibmveth_adapter *adapter = | 1223 | struct ibmveth_adapter *adapter = |
@@ -1182,6 +1226,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget) | |||
1182 | int frames_processed = 0; | 1226 | int frames_processed = 0; |
1183 | unsigned long lpar_rc; | 1227 | unsigned long lpar_rc; |
1184 | struct iphdr *iph; | 1228 | struct iphdr *iph; |
1229 | u16 mss = 0; | ||
1185 | 1230 | ||
1186 | restart_poll: | 1231 | restart_poll: |
1187 | while (frames_processed < budget) { | 1232 | while (frames_processed < budget) { |
@@ -1199,9 +1244,21 @@ restart_poll: | |||
1199 | int length = ibmveth_rxq_frame_length(adapter); | 1244 | int length = ibmveth_rxq_frame_length(adapter); |
1200 | int offset = ibmveth_rxq_frame_offset(adapter); | 1245 | int offset = ibmveth_rxq_frame_offset(adapter); |
1201 | int csum_good = ibmveth_rxq_csum_good(adapter); | 1246 | int csum_good = ibmveth_rxq_csum_good(adapter); |
1247 | int lrg_pkt = ibmveth_rxq_large_packet(adapter); | ||
1202 | 1248 | ||
1203 | skb = ibmveth_rxq_get_buffer(adapter); | 1249 | skb = ibmveth_rxq_get_buffer(adapter); |
1204 | 1250 | ||
1251 | /* if the large packet bit is set in the rx queue | ||
1252 | * descriptor, the mss will be written by PHYP eight | ||
1253 | * bytes from the start of the rx buffer, which is | ||
1254 | * skb->data at this stage | ||
1255 | */ | ||
1256 | if (lrg_pkt) { | ||
1257 | __be64 *rxmss = (__be64 *)(skb->data + 8); | ||
1258 | |||
1259 | mss = (u16)be64_to_cpu(*rxmss); | ||
1260 | } | ||
1261 | |||
1205 | new_skb = NULL; | 1262 | new_skb = NULL; |
1206 | if (length < rx_copybreak) | 1263 | if (length < rx_copybreak) |
1207 | new_skb = netdev_alloc_skb(netdev, length); | 1264 | new_skb = netdev_alloc_skb(netdev, length); |
@@ -1235,11 +1292,15 @@ restart_poll: | |||
1235 | if (iph->check == 0xffff) { | 1292 | if (iph->check == 0xffff) { |
1236 | iph->check = 0; | 1293 | iph->check = 0; |
1237 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | 1294 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); |
1238 | adapter->rx_large_packets++; | ||
1239 | } | 1295 | } |
1240 | } | 1296 | } |
1241 | } | 1297 | } |
1242 | 1298 | ||
1299 | if (length > netdev->mtu + ETH_HLEN) { | ||
1300 | ibmveth_rx_mss_helper(skb, mss, lrg_pkt); | ||
1301 | adapter->rx_large_packets++; | ||
1302 | } | ||
1303 | |||
1243 | napi_gro_receive(napi, skb); /* send it up */ | 1304 | napi_gro_receive(napi, skb); /* send it up */ |
1244 | 1305 | ||
1245 | netdev->stats.rx_packets++; | 1306 | netdev->stats.rx_packets++; |
diff --git a/drivers/net/ethernet/ibm/ibmveth.h b/drivers/net/ethernet/ibm/ibmveth.h index 4eade67fe30c..7acda04d034e 100644 --- a/drivers/net/ethernet/ibm/ibmveth.h +++ b/drivers/net/ethernet/ibm/ibmveth.h | |||
@@ -209,6 +209,7 @@ struct ibmveth_rx_q_entry { | |||
209 | #define IBMVETH_RXQ_TOGGLE 0x80000000 | 209 | #define IBMVETH_RXQ_TOGGLE 0x80000000 |
210 | #define IBMVETH_RXQ_TOGGLE_SHIFT 31 | 210 | #define IBMVETH_RXQ_TOGGLE_SHIFT 31 |
211 | #define IBMVETH_RXQ_VALID 0x40000000 | 211 | #define IBMVETH_RXQ_VALID 0x40000000 |
212 | #define IBMVETH_RXQ_LRG_PKT 0x04000000 | ||
212 | #define IBMVETH_RXQ_NO_CSUM 0x02000000 | 213 | #define IBMVETH_RXQ_NO_CSUM 0x02000000 |
213 | #define IBMVETH_RXQ_CSUM_GOOD 0x01000000 | 214 | #define IBMVETH_RXQ_CSUM_GOOD 0x01000000 |
214 | #define IBMVETH_RXQ_OFF_MASK 0x0000FFFF | 215 | #define IBMVETH_RXQ_OFF_MASK 0x0000FFFF |
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c index 91e09d68b7e2..a167fd7ee13e 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c | |||
@@ -704,6 +704,7 @@ ltq_etop_probe(struct platform_device *pdev) | |||
704 | priv->pldata = dev_get_platdata(&pdev->dev); | 704 | priv->pldata = dev_get_platdata(&pdev->dev); |
705 | priv->netdev = dev; | 705 | priv->netdev = dev; |
706 | spin_lock_init(&priv->lock); | 706 | spin_lock_init(&priv->lock); |
707 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
707 | 708 | ||
708 | for (i = 0; i < MAX_DMA_CHAN; i++) { | 709 | for (i = 0; i < MAX_DMA_CHAN; i++) { |
709 | if (IS_TX(i)) | 710 | if (IS_TX(i)) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig index aae46884bf93..521cfdb7d11e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig | |||
@@ -18,8 +18,6 @@ config MLX5_CORE_EN | |||
18 | default n | 18 | default n |
19 | ---help--- | 19 | ---help--- |
20 | Ethernet support in Mellanox Technologies ConnectX-4 NIC. | 20 | Ethernet support in Mellanox Technologies ConnectX-4 NIC. |
21 | Ethernet and Infiniband support in ConnectX-4 are currently mutually | ||
22 | exclusive. | ||
23 | 21 | ||
24 | config MLX5_CORE_EN_DCB | 22 | config MLX5_CORE_EN_DCB |
25 | bool "Data Center Bridging (DCB) Support" | 23 | bool "Data Center Bridging (DCB) Support" |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 1e639f886021..bfe410e8a469 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c | |||
@@ -268,11 +268,6 @@ static void dump_buf(void *buf, int size, int data_only, int offset) | |||
268 | pr_debug("\n"); | 268 | pr_debug("\n"); |
269 | } | 269 | } |
270 | 270 | ||
271 | enum { | ||
272 | MLX5_DRIVER_STATUS_ABORTED = 0xfe, | ||
273 | MLX5_DRIVER_SYND = 0xbadd00de, | ||
274 | }; | ||
275 | |||
276 | static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, | 271 | static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, |
277 | u32 *synd, u8 *status) | 272 | u32 *synd, u8 *status) |
278 | { | 273 | { |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index 7a43502a89cc..71382df59fc0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h | |||
@@ -241,7 +241,7 @@ struct mlx5e_tstamp { | |||
241 | }; | 241 | }; |
242 | 242 | ||
243 | enum { | 243 | enum { |
244 | MLX5E_RQ_STATE_FLUSH, | 244 | MLX5E_RQ_STATE_ENABLED, |
245 | MLX5E_RQ_STATE_UMR_WQE_IN_PROGRESS, | 245 | MLX5E_RQ_STATE_UMR_WQE_IN_PROGRESS, |
246 | MLX5E_RQ_STATE_AM, | 246 | MLX5E_RQ_STATE_AM, |
247 | }; | 247 | }; |
@@ -394,7 +394,7 @@ struct mlx5e_sq_dma { | |||
394 | }; | 394 | }; |
395 | 395 | ||
396 | enum { | 396 | enum { |
397 | MLX5E_SQ_STATE_FLUSH, | 397 | MLX5E_SQ_STATE_ENABLED, |
398 | MLX5E_SQ_STATE_BF_ENABLE, | 398 | MLX5E_SQ_STATE_BF_ENABLE, |
399 | }; | 399 | }; |
400 | 400 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 84e8b250e2af..246d98ebb588 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
@@ -759,6 +759,7 @@ static int mlx5e_open_rq(struct mlx5e_channel *c, | |||
759 | if (err) | 759 | if (err) |
760 | goto err_destroy_rq; | 760 | goto err_destroy_rq; |
761 | 761 | ||
762 | set_bit(MLX5E_RQ_STATE_ENABLED, &rq->state); | ||
762 | err = mlx5e_modify_rq_state(rq, MLX5_RQC_STATE_RST, MLX5_RQC_STATE_RDY); | 763 | err = mlx5e_modify_rq_state(rq, MLX5_RQC_STATE_RST, MLX5_RQC_STATE_RDY); |
763 | if (err) | 764 | if (err) |
764 | goto err_disable_rq; | 765 | goto err_disable_rq; |
@@ -773,6 +774,7 @@ static int mlx5e_open_rq(struct mlx5e_channel *c, | |||
773 | return 0; | 774 | return 0; |
774 | 775 | ||
775 | err_disable_rq: | 776 | err_disable_rq: |
777 | clear_bit(MLX5E_RQ_STATE_ENABLED, &rq->state); | ||
776 | mlx5e_disable_rq(rq); | 778 | mlx5e_disable_rq(rq); |
777 | err_destroy_rq: | 779 | err_destroy_rq: |
778 | mlx5e_destroy_rq(rq); | 780 | mlx5e_destroy_rq(rq); |
@@ -782,7 +784,7 @@ err_destroy_rq: | |||
782 | 784 | ||
783 | static void mlx5e_close_rq(struct mlx5e_rq *rq) | 785 | static void mlx5e_close_rq(struct mlx5e_rq *rq) |
784 | { | 786 | { |
785 | set_bit(MLX5E_RQ_STATE_FLUSH, &rq->state); | 787 | clear_bit(MLX5E_RQ_STATE_ENABLED, &rq->state); |
786 | napi_synchronize(&rq->channel->napi); /* prevent mlx5e_post_rx_wqes */ | 788 | napi_synchronize(&rq->channel->napi); /* prevent mlx5e_post_rx_wqes */ |
787 | cancel_work_sync(&rq->am.work); | 789 | cancel_work_sync(&rq->am.work); |
788 | 790 | ||
@@ -1006,7 +1008,6 @@ static int mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param) | |||
1006 | MLX5_SET(sqc, sqc, min_wqe_inline_mode, sq->min_inline_mode); | 1008 | MLX5_SET(sqc, sqc, min_wqe_inline_mode, sq->min_inline_mode); |
1007 | MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); | 1009 | MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); |
1008 | MLX5_SET(sqc, sqc, tis_lst_sz, param->type == MLX5E_SQ_ICO ? 0 : 1); | 1010 | MLX5_SET(sqc, sqc, tis_lst_sz, param->type == MLX5E_SQ_ICO ? 0 : 1); |
1009 | MLX5_SET(sqc, sqc, flush_in_error_en, 1); | ||
1010 | 1011 | ||
1011 | MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_CYCLIC); | 1012 | MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_CYCLIC); |
1012 | MLX5_SET(wq, wq, uar_page, sq->uar.index); | 1013 | MLX5_SET(wq, wq, uar_page, sq->uar.index); |
@@ -1083,6 +1084,7 @@ static int mlx5e_open_sq(struct mlx5e_channel *c, | |||
1083 | if (err) | 1084 | if (err) |
1084 | goto err_destroy_sq; | 1085 | goto err_destroy_sq; |
1085 | 1086 | ||
1087 | set_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); | ||
1086 | err = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RST, MLX5_SQC_STATE_RDY, | 1088 | err = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RST, MLX5_SQC_STATE_RDY, |
1087 | false, 0); | 1089 | false, 0); |
1088 | if (err) | 1090 | if (err) |
@@ -1096,6 +1098,7 @@ static int mlx5e_open_sq(struct mlx5e_channel *c, | |||
1096 | return 0; | 1098 | return 0; |
1097 | 1099 | ||
1098 | err_disable_sq: | 1100 | err_disable_sq: |
1101 | clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); | ||
1099 | mlx5e_disable_sq(sq); | 1102 | mlx5e_disable_sq(sq); |
1100 | err_destroy_sq: | 1103 | err_destroy_sq: |
1101 | mlx5e_destroy_sq(sq); | 1104 | mlx5e_destroy_sq(sq); |
@@ -1112,7 +1115,7 @@ static inline void netif_tx_disable_queue(struct netdev_queue *txq) | |||
1112 | 1115 | ||
1113 | static void mlx5e_close_sq(struct mlx5e_sq *sq) | 1116 | static void mlx5e_close_sq(struct mlx5e_sq *sq) |
1114 | { | 1117 | { |
1115 | set_bit(MLX5E_SQ_STATE_FLUSH, &sq->state); | 1118 | clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); |
1116 | /* prevent netif_tx_wake_queue */ | 1119 | /* prevent netif_tx_wake_queue */ |
1117 | napi_synchronize(&sq->channel->napi); | 1120 | napi_synchronize(&sq->channel->napi); |
1118 | 1121 | ||
@@ -3092,7 +3095,7 @@ static void mlx5e_tx_timeout(struct net_device *dev) | |||
3092 | if (!netif_xmit_stopped(netdev_get_tx_queue(dev, i))) | 3095 | if (!netif_xmit_stopped(netdev_get_tx_queue(dev, i))) |
3093 | continue; | 3096 | continue; |
3094 | sched_work = true; | 3097 | sched_work = true; |
3095 | set_bit(MLX5E_SQ_STATE_FLUSH, &sq->state); | 3098 | clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); |
3096 | netdev_err(dev, "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x\n", | 3099 | netdev_err(dev, "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x\n", |
3097 | i, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc); | 3100 | i, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc); |
3098 | } | 3101 | } |
@@ -3147,13 +3150,13 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog) | |||
3147 | for (i = 0; i < priv->params.num_channels; i++) { | 3150 | for (i = 0; i < priv->params.num_channels; i++) { |
3148 | struct mlx5e_channel *c = priv->channel[i]; | 3151 | struct mlx5e_channel *c = priv->channel[i]; |
3149 | 3152 | ||
3150 | set_bit(MLX5E_RQ_STATE_FLUSH, &c->rq.state); | 3153 | clear_bit(MLX5E_RQ_STATE_ENABLED, &c->rq.state); |
3151 | napi_synchronize(&c->napi); | 3154 | napi_synchronize(&c->napi); |
3152 | /* prevent mlx5e_poll_rx_cq from accessing rq->xdp_prog */ | 3155 | /* prevent mlx5e_poll_rx_cq from accessing rq->xdp_prog */ |
3153 | 3156 | ||
3154 | old_prog = xchg(&c->rq.xdp_prog, prog); | 3157 | old_prog = xchg(&c->rq.xdp_prog, prog); |
3155 | 3158 | ||
3156 | clear_bit(MLX5E_RQ_STATE_FLUSH, &c->rq.state); | 3159 | set_bit(MLX5E_RQ_STATE_ENABLED, &c->rq.state); |
3157 | /* napi_schedule in case we have missed anything */ | 3160 | /* napi_schedule in case we have missed anything */ |
3158 | set_bit(MLX5E_CHANNEL_NAPI_SCHED, &c->flags); | 3161 | set_bit(MLX5E_CHANNEL_NAPI_SCHED, &c->flags); |
3159 | napi_schedule(&c->napi); | 3162 | napi_schedule(&c->napi); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index c6de6fba5843..33495d88aeb2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | |||
@@ -340,7 +340,7 @@ static inline void mlx5e_post_umr_wqe(struct mlx5e_rq *rq, u16 ix) | |||
340 | while ((pi = (sq->pc & wq->sz_m1)) > sq->edge) { | 340 | while ((pi = (sq->pc & wq->sz_m1)) > sq->edge) { |
341 | sq->db.ico_wqe[pi].opcode = MLX5_OPCODE_NOP; | 341 | sq->db.ico_wqe[pi].opcode = MLX5_OPCODE_NOP; |
342 | sq->db.ico_wqe[pi].num_wqebbs = 1; | 342 | sq->db.ico_wqe[pi].num_wqebbs = 1; |
343 | mlx5e_send_nop(sq, true); | 343 | mlx5e_send_nop(sq, false); |
344 | } | 344 | } |
345 | 345 | ||
346 | wqe = mlx5_wq_cyc_get_wqe(wq, pi); | 346 | wqe = mlx5_wq_cyc_get_wqe(wq, pi); |
@@ -412,7 +412,7 @@ void mlx5e_post_rx_mpwqe(struct mlx5e_rq *rq) | |||
412 | 412 | ||
413 | clear_bit(MLX5E_RQ_STATE_UMR_WQE_IN_PROGRESS, &rq->state); | 413 | clear_bit(MLX5E_RQ_STATE_UMR_WQE_IN_PROGRESS, &rq->state); |
414 | 414 | ||
415 | if (unlikely(test_bit(MLX5E_RQ_STATE_FLUSH, &rq->state))) { | 415 | if (unlikely(!test_bit(MLX5E_RQ_STATE_ENABLED, &rq->state))) { |
416 | mlx5e_free_rx_mpwqe(rq, &rq->mpwqe.info[wq->head]); | 416 | mlx5e_free_rx_mpwqe(rq, &rq->mpwqe.info[wq->head]); |
417 | return; | 417 | return; |
418 | } | 418 | } |
@@ -445,7 +445,7 @@ void mlx5e_dealloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix) | |||
445 | } | 445 | } |
446 | 446 | ||
447 | #define RQ_CANNOT_POST(rq) \ | 447 | #define RQ_CANNOT_POST(rq) \ |
448 | (test_bit(MLX5E_RQ_STATE_FLUSH, &rq->state) || \ | 448 | (!test_bit(MLX5E_RQ_STATE_ENABLED, &rq->state) || \ |
449 | test_bit(MLX5E_RQ_STATE_UMR_WQE_IN_PROGRESS, &rq->state)) | 449 | test_bit(MLX5E_RQ_STATE_UMR_WQE_IN_PROGRESS, &rq->state)) |
450 | 450 | ||
451 | bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq) | 451 | bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq) |
@@ -924,7 +924,7 @@ int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget) | |||
924 | struct mlx5e_sq *xdp_sq = &rq->channel->xdp_sq; | 924 | struct mlx5e_sq *xdp_sq = &rq->channel->xdp_sq; |
925 | int work_done = 0; | 925 | int work_done = 0; |
926 | 926 | ||
927 | if (unlikely(test_bit(MLX5E_RQ_STATE_FLUSH, &rq->state))) | 927 | if (unlikely(!test_bit(MLX5E_RQ_STATE_ENABLED, &rq->state))) |
928 | return 0; | 928 | return 0; |
929 | 929 | ||
930 | if (cq->decmprs_left) | 930 | if (cq->decmprs_left) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index 70a717382357..cfb68371c397 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | |||
@@ -409,7 +409,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget) | |||
409 | 409 | ||
410 | sq = container_of(cq, struct mlx5e_sq, cq); | 410 | sq = container_of(cq, struct mlx5e_sq, cq); |
411 | 411 | ||
412 | if (unlikely(test_bit(MLX5E_SQ_STATE_FLUSH, &sq->state))) | 412 | if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &sq->state))) |
413 | return false; | 413 | return false; |
414 | 414 | ||
415 | npkts = 0; | 415 | npkts = 0; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c index 5703f19a6a24..e5c12a732aa1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | |||
@@ -56,7 +56,7 @@ static void mlx5e_poll_ico_cq(struct mlx5e_cq *cq) | |||
56 | struct mlx5_cqe64 *cqe; | 56 | struct mlx5_cqe64 *cqe; |
57 | u16 sqcc; | 57 | u16 sqcc; |
58 | 58 | ||
59 | if (unlikely(test_bit(MLX5E_SQ_STATE_FLUSH, &sq->state))) | 59 | if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &sq->state))) |
60 | return; | 60 | return; |
61 | 61 | ||
62 | cqe = mlx5e_get_cqe(cq); | 62 | cqe = mlx5e_get_cqe(cq); |
@@ -113,7 +113,7 @@ static inline bool mlx5e_poll_xdp_tx_cq(struct mlx5e_cq *cq) | |||
113 | 113 | ||
114 | sq = container_of(cq, struct mlx5e_sq, cq); | 114 | sq = container_of(cq, struct mlx5e_sq, cq); |
115 | 115 | ||
116 | if (unlikely(test_bit(MLX5E_SQ_STATE_FLUSH, &sq->state))) | 116 | if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &sq->state))) |
117 | return false; | 117 | return false; |
118 | 118 | ||
119 | /* sq->cc must be updated only after mlx5_cqwq_update_db_record(), | 119 | /* sq->cc must be updated only after mlx5_cqwq_update_db_record(), |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 3b7c6a9f2b5f..ada24e103b02 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -62,13 +62,13 @@ MODULE_DESCRIPTION("Mellanox Connect-IB, ConnectX-4 core driver"); | |||
62 | MODULE_LICENSE("Dual BSD/GPL"); | 62 | MODULE_LICENSE("Dual BSD/GPL"); |
63 | MODULE_VERSION(DRIVER_VERSION); | 63 | MODULE_VERSION(DRIVER_VERSION); |
64 | 64 | ||
65 | int mlx5_core_debug_mask; | 65 | unsigned int mlx5_core_debug_mask; |
66 | module_param_named(debug_mask, mlx5_core_debug_mask, int, 0644); | 66 | module_param_named(debug_mask, mlx5_core_debug_mask, uint, 0644); |
67 | MODULE_PARM_DESC(debug_mask, "debug mask: 1 = dump cmd data, 2 = dump cmd exec time, 3 = both. Default=0"); | 67 | MODULE_PARM_DESC(debug_mask, "debug mask: 1 = dump cmd data, 2 = dump cmd exec time, 3 = both. Default=0"); |
68 | 68 | ||
69 | #define MLX5_DEFAULT_PROF 2 | 69 | #define MLX5_DEFAULT_PROF 2 |
70 | static int prof_sel = MLX5_DEFAULT_PROF; | 70 | static unsigned int prof_sel = MLX5_DEFAULT_PROF; |
71 | module_param_named(prof_sel, prof_sel, int, 0444); | 71 | module_param_named(prof_sel, prof_sel, uint, 0444); |
72 | MODULE_PARM_DESC(prof_sel, "profile selector. Valid range 0 - 2"); | 72 | MODULE_PARM_DESC(prof_sel, "profile selector. Valid range 0 - 2"); |
73 | 73 | ||
74 | enum { | 74 | enum { |
@@ -732,13 +732,15 @@ static int mlx5_core_set_issi(struct mlx5_core_dev *dev) | |||
732 | u8 status; | 732 | u8 status; |
733 | 733 | ||
734 | mlx5_cmd_mbox_status(query_out, &status, &syndrome); | 734 | mlx5_cmd_mbox_status(query_out, &status, &syndrome); |
735 | if (status == MLX5_CMD_STAT_BAD_OP_ERR) { | 735 | if (!status || syndrome == MLX5_DRIVER_SYND) { |
736 | pr_debug("Only ISSI 0 is supported\n"); | 736 | mlx5_core_err(dev, "Failed to query ISSI err(%d) status(%d) synd(%d)\n", |
737 | return 0; | 737 | err, status, syndrome); |
738 | return err; | ||
738 | } | 739 | } |
739 | 740 | ||
740 | pr_err("failed to query ISSI err(%d)\n", err); | 741 | mlx5_core_warn(dev, "Query ISSI is not supported by FW, ISSI is 0\n"); |
741 | return err; | 742 | dev->issi = 0; |
743 | return 0; | ||
742 | } | 744 | } |
743 | 745 | ||
744 | sup_issi = MLX5_GET(query_issi_out, query_out, supported_issi_dw0); | 746 | sup_issi = MLX5_GET(query_issi_out, query_out, supported_issi_dw0); |
@@ -752,7 +754,8 @@ static int mlx5_core_set_issi(struct mlx5_core_dev *dev) | |||
752 | err = mlx5_cmd_exec(dev, set_in, sizeof(set_in), | 754 | err = mlx5_cmd_exec(dev, set_in, sizeof(set_in), |
753 | set_out, sizeof(set_out)); | 755 | set_out, sizeof(set_out)); |
754 | if (err) { | 756 | if (err) { |
755 | pr_err("failed to set ISSI=1 err(%d)\n", err); | 757 | mlx5_core_err(dev, "Failed to set ISSI to 1 err(%d)\n", |
758 | err); | ||
756 | return err; | 759 | return err; |
757 | } | 760 | } |
758 | 761 | ||
@@ -1227,13 +1230,6 @@ static int init_one(struct pci_dev *pdev, | |||
1227 | 1230 | ||
1228 | dev->pdev = pdev; | 1231 | dev->pdev = pdev; |
1229 | dev->event = mlx5_core_event; | 1232 | dev->event = mlx5_core_event; |
1230 | |||
1231 | if (prof_sel < 0 || prof_sel >= ARRAY_SIZE(profile)) { | ||
1232 | mlx5_core_warn(dev, | ||
1233 | "selected profile out of range, selecting default (%d)\n", | ||
1234 | MLX5_DEFAULT_PROF); | ||
1235 | prof_sel = MLX5_DEFAULT_PROF; | ||
1236 | } | ||
1237 | dev->profile = &profile[prof_sel]; | 1233 | dev->profile = &profile[prof_sel]; |
1238 | 1234 | ||
1239 | INIT_LIST_HEAD(&priv->ctx_list); | 1235 | INIT_LIST_HEAD(&priv->ctx_list); |
@@ -1450,10 +1446,22 @@ static struct pci_driver mlx5_core_driver = { | |||
1450 | .sriov_configure = mlx5_core_sriov_configure, | 1446 | .sriov_configure = mlx5_core_sriov_configure, |
1451 | }; | 1447 | }; |
1452 | 1448 | ||
1449 | static void mlx5_core_verify_params(void) | ||
1450 | { | ||
1451 | if (prof_sel >= ARRAY_SIZE(profile)) { | ||
1452 | pr_warn("mlx5_core: WARNING: Invalid module parameter prof_sel %d, valid range 0-%zu, changing back to default(%d)\n", | ||
1453 | prof_sel, | ||
1454 | ARRAY_SIZE(profile) - 1, | ||
1455 | MLX5_DEFAULT_PROF); | ||
1456 | prof_sel = MLX5_DEFAULT_PROF; | ||
1457 | } | ||
1458 | } | ||
1459 | |||
1453 | static int __init init(void) | 1460 | static int __init init(void) |
1454 | { | 1461 | { |
1455 | int err; | 1462 | int err; |
1456 | 1463 | ||
1464 | mlx5_core_verify_params(); | ||
1457 | mlx5_register_debugfs(); | 1465 | mlx5_register_debugfs(); |
1458 | 1466 | ||
1459 | err = pci_register_driver(&mlx5_core_driver); | 1467 | err = pci_register_driver(&mlx5_core_driver); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h index 187662c8ea96..63b9a0dba885 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | |||
@@ -44,11 +44,11 @@ | |||
44 | 44 | ||
45 | #define MLX5_TOTAL_VPORTS(mdev) (1 + pci_sriov_get_totalvfs(mdev->pdev)) | 45 | #define MLX5_TOTAL_VPORTS(mdev) (1 + pci_sriov_get_totalvfs(mdev->pdev)) |
46 | 46 | ||
47 | extern int mlx5_core_debug_mask; | 47 | extern uint mlx5_core_debug_mask; |
48 | 48 | ||
49 | #define mlx5_core_dbg(__dev, format, ...) \ | 49 | #define mlx5_core_dbg(__dev, format, ...) \ |
50 | dev_dbg(&(__dev)->pdev->dev, "%s:%s:%d:(pid %d): " format, \ | 50 | dev_dbg(&(__dev)->pdev->dev, "%s:%d:(pid %d): " format, \ |
51 | (__dev)->priv.name, __func__, __LINE__, current->pid, \ | 51 | __func__, __LINE__, current->pid, \ |
52 | ##__VA_ARGS__) | 52 | ##__VA_ARGS__) |
53 | 53 | ||
54 | #define mlx5_core_dbg_mask(__dev, mask, format, ...) \ | 54 | #define mlx5_core_dbg_mask(__dev, mask, format, ...) \ |
@@ -63,8 +63,8 @@ do { \ | |||
63 | ##__VA_ARGS__) | 63 | ##__VA_ARGS__) |
64 | 64 | ||
65 | #define mlx5_core_warn(__dev, format, ...) \ | 65 | #define mlx5_core_warn(__dev, format, ...) \ |
66 | dev_warn(&(__dev)->pdev->dev, "%s:%s:%d:(pid %d): " format, \ | 66 | dev_warn(&(__dev)->pdev->dev, "%s:%d:(pid %d): " format, \ |
67 | (__dev)->priv.name, __func__, __LINE__, current->pid, \ | 67 | __func__, __LINE__, current->pid, \ |
68 | ##__VA_ARGS__) | 68 | ##__VA_ARGS__) |
69 | 69 | ||
70 | #define mlx5_core_info(__dev, format, ...) \ | 70 | #define mlx5_core_info(__dev, format, ...) \ |
@@ -75,6 +75,11 @@ enum { | |||
75 | MLX5_CMD_TIME, /* print command execution time */ | 75 | MLX5_CMD_TIME, /* print command execution time */ |
76 | }; | 76 | }; |
77 | 77 | ||
78 | enum { | ||
79 | MLX5_DRIVER_STATUS_ABORTED = 0xfe, | ||
80 | MLX5_DRIVER_SYND = 0xbadd00de, | ||
81 | }; | ||
82 | |||
78 | int mlx5_query_hca_caps(struct mlx5_core_dev *dev); | 83 | int mlx5_query_hca_caps(struct mlx5_core_dev *dev); |
79 | int mlx5_query_board_id(struct mlx5_core_dev *dev); | 84 | int mlx5_query_board_id(struct mlx5_core_dev *dev); |
80 | int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); | 85 | int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index f95385cbbd40..62ae55bd81b8 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c | |||
@@ -1730,6 +1730,7 @@ static int qed_ll2_start_xmit(struct qed_dev *cdev, struct sk_buff *skb) | |||
1730 | mapping))) { | 1730 | mapping))) { |
1731 | DP_NOTICE(cdev, | 1731 | DP_NOTICE(cdev, |
1732 | "Unable to map frag - dropping packet\n"); | 1732 | "Unable to map frag - dropping packet\n"); |
1733 | rc = -ENOMEM; | ||
1733 | goto err; | 1734 | goto err; |
1734 | } | 1735 | } |
1735 | } else { | 1736 | } else { |
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index e9b8579e6241..8b0016a785c0 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c | |||
@@ -438,9 +438,16 @@ static int smsc911x_request_resources(struct platform_device *pdev) | |||
438 | ret = regulator_bulk_get(&pdev->dev, | 438 | ret = regulator_bulk_get(&pdev->dev, |
439 | ARRAY_SIZE(pdata->supplies), | 439 | ARRAY_SIZE(pdata->supplies), |
440 | pdata->supplies); | 440 | pdata->supplies); |
441 | if (ret) | 441 | if (ret) { |
442 | /* | ||
443 | * Retry on deferrals, else just report the error | ||
444 | * and try to continue. | ||
445 | */ | ||
446 | if (ret == -EPROBE_DEFER) | ||
447 | return ret; | ||
442 | netdev_err(ndev, "couldn't get regulators %d\n", | 448 | netdev_err(ndev, "couldn't get regulators %d\n", |
443 | ret); | 449 | ret); |
450 | } | ||
444 | 451 | ||
445 | /* Request optional RESET GPIO */ | 452 | /* Request optional RESET GPIO */ |
446 | pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev, | 453 | pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev, |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c index 990746955216..f35385266fbf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c | |||
@@ -43,9 +43,11 @@ static void dwmac1000_dma_axi(void __iomem *ioaddr, struct stmmac_axi *axi) | |||
43 | if (axi->axi_xit_frm) | 43 | if (axi->axi_xit_frm) |
44 | value |= DMA_AXI_LPI_XIT_FRM; | 44 | value |= DMA_AXI_LPI_XIT_FRM; |
45 | 45 | ||
46 | value &= ~DMA_AXI_WR_OSR_LMT; | ||
46 | value |= (axi->axi_wr_osr_lmt & DMA_AXI_WR_OSR_LMT_MASK) << | 47 | value |= (axi->axi_wr_osr_lmt & DMA_AXI_WR_OSR_LMT_MASK) << |
47 | DMA_AXI_WR_OSR_LMT_SHIFT; | 48 | DMA_AXI_WR_OSR_LMT_SHIFT; |
48 | 49 | ||
50 | value &= ~DMA_AXI_RD_OSR_LMT; | ||
49 | value |= (axi->axi_rd_osr_lmt & DMA_AXI_RD_OSR_LMT_MASK) << | 51 | value |= (axi->axi_rd_osr_lmt & DMA_AXI_RD_OSR_LMT_MASK) << |
50 | DMA_AXI_RD_OSR_LMT_SHIFT; | 52 | DMA_AXI_RD_OSR_LMT_SHIFT; |
51 | 53 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c index 116151cd6a95..32bc2fc73cdc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | |||
@@ -30,9 +30,11 @@ static void dwmac4_dma_axi(void __iomem *ioaddr, struct stmmac_axi *axi) | |||
30 | if (axi->axi_xit_frm) | 30 | if (axi->axi_xit_frm) |
31 | value |= DMA_AXI_LPI_XIT_FRM; | 31 | value |= DMA_AXI_LPI_XIT_FRM; |
32 | 32 | ||
33 | value &= ~DMA_AXI_WR_OSR_LMT; | ||
33 | value |= (axi->axi_wr_osr_lmt & DMA_AXI_OSR_MAX) << | 34 | value |= (axi->axi_wr_osr_lmt & DMA_AXI_OSR_MAX) << |
34 | DMA_AXI_WR_OSR_LMT_SHIFT; | 35 | DMA_AXI_WR_OSR_LMT_SHIFT; |
35 | 36 | ||
37 | value &= ~DMA_AXI_RD_OSR_LMT; | ||
36 | value |= (axi->axi_rd_osr_lmt & DMA_AXI_OSR_MAX) << | 38 | value |= (axi->axi_rd_osr_lmt & DMA_AXI_OSR_MAX) << |
37 | DMA_AXI_RD_OSR_LMT_SHIFT; | 39 | DMA_AXI_RD_OSR_LMT_SHIFT; |
38 | 40 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index a840818bf4df..ac3d39c69509 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -126,8 +126,10 @@ static struct stmmac_axi *stmmac_axi_setup(struct platform_device *pdev) | |||
126 | axi->axi_mb = of_property_read_bool(np, "snps,axi_mb"); | 126 | axi->axi_mb = of_property_read_bool(np, "snps,axi_mb"); |
127 | axi->axi_rb = of_property_read_bool(np, "snps,axi_rb"); | 127 | axi->axi_rb = of_property_read_bool(np, "snps,axi_rb"); |
128 | 128 | ||
129 | of_property_read_u32(np, "snps,wr_osr_lmt", &axi->axi_wr_osr_lmt); | 129 | if (of_property_read_u32(np, "snps,wr_osr_lmt", &axi->axi_wr_osr_lmt)) |
130 | of_property_read_u32(np, "snps,rd_osr_lmt", &axi->axi_rd_osr_lmt); | 130 | axi->axi_wr_osr_lmt = 1; |
131 | if (of_property_read_u32(np, "snps,rd_osr_lmt", &axi->axi_rd_osr_lmt)) | ||
132 | axi->axi_rd_osr_lmt = 1; | ||
131 | of_property_read_u32_array(np, "snps,blen", axi->axi_blen, AXI_BLEN); | 133 | of_property_read_u32_array(np, "snps,blen", axi->axi_blen, AXI_BLEN); |
132 | of_node_put(np); | 134 | of_node_put(np); |
133 | 135 | ||
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c index fa0cfda24fd9..28097be2ff28 100644 --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c | |||
@@ -1113,6 +1113,7 @@ static int cpmac_probe(struct platform_device *pdev) | |||
1113 | if (!dev) | 1113 | if (!dev) |
1114 | return -ENOMEM; | 1114 | return -ENOMEM; |
1115 | 1115 | ||
1116 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
1116 | platform_set_drvdata(pdev, dev); | 1117 | platform_set_drvdata(pdev, dev); |
1117 | priv = netdev_priv(dev); | 1118 | priv = netdev_priv(dev); |
1118 | 1119 | ||
diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c b/drivers/net/ethernet/ti/cpsw-phy-sel.c index ba1e45ff6aae..18013645e76c 100644 --- a/drivers/net/ethernet/ti/cpsw-phy-sel.c +++ b/drivers/net/ethernet/ti/cpsw-phy-sel.c | |||
@@ -81,6 +81,7 @@ static void cpsw_gmii_sel_am3352(struct cpsw_phy_sel_priv *priv, | |||
81 | }; | 81 | }; |
82 | 82 | ||
83 | mask = GMII_SEL_MODE_MASK << (slave * 2) | BIT(slave + 6); | 83 | mask = GMII_SEL_MODE_MASK << (slave * 2) | BIT(slave + 6); |
84 | mask |= BIT(slave + 4); | ||
84 | mode <<= slave * 2; | 85 | mode <<= slave * 2; |
85 | 86 | ||
86 | if (priv->rmii_clock_external) { | 87 | if (priv->rmii_clock_external) { |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f6382150b16a..c9140c3aeb67 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -47,6 +47,10 @@ | |||
47 | NETIF_F_TSO | \ | 47 | NETIF_F_TSO | \ |
48 | NETIF_F_TSO6 | \ | 48 | NETIF_F_TSO6 | \ |
49 | NETIF_F_HW_CSUM) | 49 | NETIF_F_HW_CSUM) |
50 | |||
51 | /* Restrict GSO size to account for NVGRE */ | ||
52 | #define NETVSC_GSO_MAX_SIZE 62768 | ||
53 | |||
50 | static int ring_size = 128; | 54 | static int ring_size = 128; |
51 | module_param(ring_size, int, S_IRUGO); | 55 | module_param(ring_size, int, S_IRUGO); |
52 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); | 56 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); |
@@ -1400,6 +1404,7 @@ static int netvsc_probe(struct hv_device *dev, | |||
1400 | nvdev = net_device_ctx->nvdev; | 1404 | nvdev = net_device_ctx->nvdev; |
1401 | netif_set_real_num_tx_queues(net, nvdev->num_chn); | 1405 | netif_set_real_num_tx_queues(net, nvdev->num_chn); |
1402 | netif_set_real_num_rx_queues(net, nvdev->num_chn); | 1406 | netif_set_real_num_rx_queues(net, nvdev->num_chn); |
1407 | netif_set_gso_max_size(net, NETVSC_GSO_MAX_SIZE); | ||
1403 | 1408 | ||
1404 | ret = register_netdev(net); | 1409 | ret = register_netdev(net); |
1405 | if (ret != 0) { | 1410 | if (ret != 0) { |
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 0fef17874d50..dfbc4ef6d507 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -546,13 +546,15 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev, | |||
546 | } | 546 | } |
547 | err = ipvlan_set_port_mode(port, mode); | 547 | err = ipvlan_set_port_mode(port, mode); |
548 | if (err) { | 548 | if (err) { |
549 | goto unregister_netdev; | 549 | goto unlink_netdev; |
550 | } | 550 | } |
551 | 551 | ||
552 | list_add_tail_rcu(&ipvlan->pnode, &port->ipvlans); | 552 | list_add_tail_rcu(&ipvlan->pnode, &port->ipvlans); |
553 | netif_stacked_transfer_operstate(phy_dev, dev); | 553 | netif_stacked_transfer_operstate(phy_dev, dev); |
554 | return 0; | 554 | return 0; |
555 | 555 | ||
556 | unlink_netdev: | ||
557 | netdev_upper_dev_unlink(phy_dev, dev); | ||
556 | unregister_netdev: | 558 | unregister_netdev: |
557 | unregister_netdevice(dev); | 559 | unregister_netdevice(dev); |
558 | destroy_ipvlan_port: | 560 | destroy_ipvlan_port: |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index a198946bc54f..8716b8c07feb 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1723,6 +1723,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1723 | /* Don't change this buffer size and allocation without doing | 1723 | /* Don't change this buffer size and allocation without doing |
1724 | * some heavy and complete testing. Don't ask why :-( | 1724 | * some heavy and complete testing. Don't ask why :-( |
1725 | * Jean II */ | 1725 | * Jean II */ |
1726 | ret = -ENOMEM; | ||
1726 | self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); | 1727 | self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); |
1727 | if (!self->speed_buff) | 1728 | if (!self->speed_buff) |
1728 | goto err_out_3; | 1729 | goto err_out_3; |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 1a4bf8acad78..c4ceb082e970 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -857,11 +857,17 @@ EXPORT_SYMBOL(phy_attached_print); | |||
857 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | 857 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, |
858 | u32 flags, phy_interface_t interface) | 858 | u32 flags, phy_interface_t interface) |
859 | { | 859 | { |
860 | struct module *ndev_owner = dev->dev.parent->driver->owner; | ||
860 | struct mii_bus *bus = phydev->mdio.bus; | 861 | struct mii_bus *bus = phydev->mdio.bus; |
861 | struct device *d = &phydev->mdio.dev; | 862 | struct device *d = &phydev->mdio.dev; |
862 | int err; | 863 | int err; |
863 | 864 | ||
864 | if (!try_module_get(bus->owner)) { | 865 | /* For Ethernet device drivers that register their own MDIO bus, we |
866 | * will have bus->owner match ndev_mod, so we do not want to increment | ||
867 | * our own module->refcnt here, otherwise we would not be able to | ||
868 | * unload later on. | ||
869 | */ | ||
870 | if (ndev_owner != bus->owner && !try_module_get(bus->owner)) { | ||
865 | dev_err(&dev->dev, "failed to get the bus module\n"); | 871 | dev_err(&dev->dev, "failed to get the bus module\n"); |
866 | return -EIO; | 872 | return -EIO; |
867 | } | 873 | } |
@@ -921,7 +927,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
921 | 927 | ||
922 | error: | 928 | error: |
923 | put_device(d); | 929 | put_device(d); |
924 | module_put(bus->owner); | 930 | if (ndev_owner != bus->owner) |
931 | module_put(bus->owner); | ||
925 | return err; | 932 | return err; |
926 | } | 933 | } |
927 | EXPORT_SYMBOL(phy_attach_direct); | 934 | EXPORT_SYMBOL(phy_attach_direct); |
@@ -971,6 +978,8 @@ EXPORT_SYMBOL(phy_attach); | |||
971 | */ | 978 | */ |
972 | void phy_detach(struct phy_device *phydev) | 979 | void phy_detach(struct phy_device *phydev) |
973 | { | 980 | { |
981 | struct net_device *dev = phydev->attached_dev; | ||
982 | struct module *ndev_owner = dev->dev.parent->driver->owner; | ||
974 | struct mii_bus *bus; | 983 | struct mii_bus *bus; |
975 | int i; | 984 | int i; |
976 | 985 | ||
@@ -998,7 +1007,8 @@ void phy_detach(struct phy_device *phydev) | |||
998 | bus = phydev->mdio.bus; | 1007 | bus = phydev->mdio.bus; |
999 | 1008 | ||
1000 | put_device(&phydev->mdio.dev); | 1009 | put_device(&phydev->mdio.dev); |
1001 | module_put(bus->owner); | 1010 | if (ndev_owner != bus->owner) |
1011 | module_put(bus->owner); | ||
1002 | } | 1012 | } |
1003 | EXPORT_SYMBOL(phy_detach); | 1013 | EXPORT_SYMBOL(phy_detach); |
1004 | 1014 | ||
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c index 96a5028621c8..3a98f3762a4c 100644 --- a/drivers/net/usb/cdc_mbim.c +++ b/drivers/net/usb/cdc_mbim.c | |||
@@ -602,6 +602,21 @@ static const struct driver_info cdc_mbim_info_ndp_to_end = { | |||
602 | .data = CDC_NCM_FLAG_NDP_TO_END, | 602 | .data = CDC_NCM_FLAG_NDP_TO_END, |
603 | }; | 603 | }; |
604 | 604 | ||
605 | /* Some modems (e.g. Telit LE922A6) do not work properly with altsetting | ||
606 | * toggle done in cdc_ncm_bind_common. CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE | ||
607 | * flag is used to avoid this procedure. | ||
608 | */ | ||
609 | static const struct driver_info cdc_mbim_info_avoid_altsetting_toggle = { | ||
610 | .description = "CDC MBIM", | ||
611 | .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN, | ||
612 | .bind = cdc_mbim_bind, | ||
613 | .unbind = cdc_mbim_unbind, | ||
614 | .manage_power = cdc_mbim_manage_power, | ||
615 | .rx_fixup = cdc_mbim_rx_fixup, | ||
616 | .tx_fixup = cdc_mbim_tx_fixup, | ||
617 | .data = CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE, | ||
618 | }; | ||
619 | |||
605 | static const struct usb_device_id mbim_devs[] = { | 620 | static const struct usb_device_id mbim_devs[] = { |
606 | /* This duplicate NCM entry is intentional. MBIM devices can | 621 | /* This duplicate NCM entry is intentional. MBIM devices can |
607 | * be disguised as NCM by default, and this is necessary to | 622 | * be disguised as NCM by default, and this is necessary to |
@@ -626,6 +641,12 @@ static const struct usb_device_id mbim_devs[] = { | |||
626 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | 641 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), |
627 | .driver_info = (unsigned long)&cdc_mbim_info_ndp_to_end, | 642 | .driver_info = (unsigned long)&cdc_mbim_info_ndp_to_end, |
628 | }, | 643 | }, |
644 | |||
645 | /* Telit LE922A6 in MBIM composition */ | ||
646 | { USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x1041, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | ||
647 | .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle, | ||
648 | }, | ||
649 | |||
629 | /* default entry */ | 650 | /* default entry */ |
630 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | 651 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), |
631 | .driver_info = (unsigned long)&cdc_mbim_info_zlp, | 652 | .driver_info = (unsigned long)&cdc_mbim_info_zlp, |
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 877c9516e781..afbfc0f656f3 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -839,11 +839,18 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ | |||
839 | 839 | ||
840 | iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber; | 840 | iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber; |
841 | 841 | ||
842 | /* Device-specific flags */ | ||
843 | ctx->drvflags = drvflags; | ||
844 | |||
842 | /* Reset data interface. Some devices will not reset properly | 845 | /* Reset data interface. Some devices will not reset properly |
843 | * unless they are configured first. Toggle the altsetting to | 846 | * unless they are configured first. Toggle the altsetting to |
844 | * force a reset | 847 | * force a reset. |
848 | * Some other devices do not work properly with this procedure | ||
849 | * that can be avoided using quirk CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE | ||
845 | */ | 850 | */ |
846 | usb_set_interface(dev->udev, iface_no, data_altsetting); | 851 | if (!(ctx->drvflags & CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE)) |
852 | usb_set_interface(dev->udev, iface_no, data_altsetting); | ||
853 | |||
847 | temp = usb_set_interface(dev->udev, iface_no, 0); | 854 | temp = usb_set_interface(dev->udev, iface_no, 0); |
848 | if (temp) { | 855 | if (temp) { |
849 | dev_dbg(&intf->dev, "set interface failed\n"); | 856 | dev_dbg(&intf->dev, "set interface failed\n"); |
@@ -890,9 +897,6 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ | |||
890 | /* finish setting up the device specific data */ | 897 | /* finish setting up the device specific data */ |
891 | cdc_ncm_setup(dev); | 898 | cdc_ncm_setup(dev); |
892 | 899 | ||
893 | /* Device-specific flags */ | ||
894 | ctx->drvflags = drvflags; | ||
895 | |||
896 | /* Allocate the delayed NDP if needed. */ | 900 | /* Allocate the delayed NDP if needed. */ |
897 | if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) { | 901 | if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) { |
898 | ctx->delayed_ndp16 = kzalloc(ctx->max_ndp_size, GFP_KERNEL); | 902 | ctx->delayed_ndp16 = kzalloc(ctx->max_ndp_size, GFP_KERNEL); |
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index db558b8b32fe..f33460cec79f 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c | |||
@@ -3395,6 +3395,7 @@ static int lan78xx_probe(struct usb_interface *intf, | |||
3395 | if (buf) { | 3395 | if (buf) { |
3396 | dev->urb_intr = usb_alloc_urb(0, GFP_KERNEL); | 3396 | dev->urb_intr = usb_alloc_urb(0, GFP_KERNEL); |
3397 | if (!dev->urb_intr) { | 3397 | if (!dev->urb_intr) { |
3398 | ret = -ENOMEM; | ||
3398 | kfree(buf); | 3399 | kfree(buf); |
3399 | goto out3; | 3400 | goto out3; |
3400 | } else { | 3401 | } else { |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7276d5a95bd0..cbf1c613c67a 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -969,12 +969,17 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p) | |||
969 | struct virtnet_info *vi = netdev_priv(dev); | 969 | struct virtnet_info *vi = netdev_priv(dev); |
970 | struct virtio_device *vdev = vi->vdev; | 970 | struct virtio_device *vdev = vi->vdev; |
971 | int ret; | 971 | int ret; |
972 | struct sockaddr *addr = p; | 972 | struct sockaddr *addr; |
973 | struct scatterlist sg; | 973 | struct scatterlist sg; |
974 | 974 | ||
975 | ret = eth_prepare_mac_addr_change(dev, p); | 975 | addr = kmalloc(sizeof(*addr), GFP_KERNEL); |
976 | if (!addr) | ||
977 | return -ENOMEM; | ||
978 | memcpy(addr, p, sizeof(*addr)); | ||
979 | |||
980 | ret = eth_prepare_mac_addr_change(dev, addr); | ||
976 | if (ret) | 981 | if (ret) |
977 | return ret; | 982 | goto out; |
978 | 983 | ||
979 | if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR)) { | 984 | if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR)) { |
980 | sg_init_one(&sg, addr->sa_data, dev->addr_len); | 985 | sg_init_one(&sg, addr->sa_data, dev->addr_len); |
@@ -982,7 +987,8 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p) | |||
982 | VIRTIO_NET_CTRL_MAC_ADDR_SET, &sg)) { | 987 | VIRTIO_NET_CTRL_MAC_ADDR_SET, &sg)) { |
983 | dev_warn(&vdev->dev, | 988 | dev_warn(&vdev->dev, |
984 | "Failed to set mac address by vq command.\n"); | 989 | "Failed to set mac address by vq command.\n"); |
985 | return -EINVAL; | 990 | ret = -EINVAL; |
991 | goto out; | ||
986 | } | 992 | } |
987 | } else if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC) && | 993 | } else if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC) && |
988 | !virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { | 994 | !virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { |
@@ -996,8 +1002,11 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p) | |||
996 | } | 1002 | } |
997 | 1003 | ||
998 | eth_commit_mac_addr_change(dev, p); | 1004 | eth_commit_mac_addr_change(dev, p); |
1005 | ret = 0; | ||
999 | 1006 | ||
1000 | return 0; | 1007 | out: |
1008 | kfree(addr); | ||
1009 | return ret; | ||
1001 | } | 1010 | } |
1002 | 1011 | ||
1003 | static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev, | 1012 | static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev, |
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index a8b6949a8778..23d4a1728cdf 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c | |||
@@ -715,7 +715,7 @@ EXPORT_SYMBOL_GPL(nd_cmd_in_size); | |||
715 | 715 | ||
716 | u32 nd_cmd_out_size(struct nvdimm *nvdimm, int cmd, | 716 | u32 nd_cmd_out_size(struct nvdimm *nvdimm, int cmd, |
717 | const struct nd_cmd_desc *desc, int idx, const u32 *in_field, | 717 | const struct nd_cmd_desc *desc, int idx, const u32 *in_field, |
718 | const u32 *out_field) | 718 | const u32 *out_field, unsigned long remainder) |
719 | { | 719 | { |
720 | if (idx >= desc->out_num) | 720 | if (idx >= desc->out_num) |
721 | return UINT_MAX; | 721 | return UINT_MAX; |
@@ -727,9 +727,24 @@ u32 nd_cmd_out_size(struct nvdimm *nvdimm, int cmd, | |||
727 | return in_field[1]; | 727 | return in_field[1]; |
728 | else if (nvdimm && cmd == ND_CMD_VENDOR && idx == 2) | 728 | else if (nvdimm && cmd == ND_CMD_VENDOR && idx == 2) |
729 | return out_field[1]; | 729 | return out_field[1]; |
730 | else if (!nvdimm && cmd == ND_CMD_ARS_STATUS && idx == 2) | 730 | else if (!nvdimm && cmd == ND_CMD_ARS_STATUS && idx == 2) { |
731 | return out_field[1] - 8; | 731 | /* |
732 | else if (cmd == ND_CMD_CALL) { | 732 | * Per table 9-276 ARS Data in ACPI 6.1, out_field[1] is |
733 | * "Size of Output Buffer in bytes, including this | ||
734 | * field." | ||
735 | */ | ||
736 | if (out_field[1] < 4) | ||
737 | return 0; | ||
738 | /* | ||
739 | * ACPI 6.1 is ambiguous if 'status' is included in the | ||
740 | * output size. If we encounter an output size that | ||
741 | * overshoots the remainder by 4 bytes, assume it was | ||
742 | * including 'status'. | ||
743 | */ | ||
744 | if (out_field[1] - 8 == remainder) | ||
745 | return remainder; | ||
746 | return out_field[1] - 4; | ||
747 | } else if (cmd == ND_CMD_CALL) { | ||
733 | struct nd_cmd_pkg *pkg = (struct nd_cmd_pkg *) in_field; | 748 | struct nd_cmd_pkg *pkg = (struct nd_cmd_pkg *) in_field; |
734 | 749 | ||
735 | return pkg->nd_size_out; | 750 | return pkg->nd_size_out; |
@@ -876,7 +891,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
876 | /* process an output envelope */ | 891 | /* process an output envelope */ |
877 | for (i = 0; i < desc->out_num; i++) { | 892 | for (i = 0; i < desc->out_num; i++) { |
878 | u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, | 893 | u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, |
879 | (u32 *) in_env, (u32 *) out_env); | 894 | (u32 *) in_env, (u32 *) out_env, 0); |
880 | u32 copy; | 895 | u32 copy; |
881 | 896 | ||
882 | if (out_size == UINT_MAX) { | 897 | if (out_size == UINT_MAX) { |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c5326055beee..f4f77c5b0c83 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -1323,18 +1323,20 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
1323 | { | 1323 | { |
1324 | lockdep_assert_held(&phba->hbalock); | 1324 | lockdep_assert_held(&phba->hbalock); |
1325 | 1325 | ||
1326 | BUG_ON(!piocb || !piocb->vport); | 1326 | BUG_ON(!piocb); |
1327 | 1327 | ||
1328 | list_add_tail(&piocb->list, &pring->txcmplq); | 1328 | list_add_tail(&piocb->list, &pring->txcmplq); |
1329 | piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ; | 1329 | piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ; |
1330 | 1330 | ||
1331 | if ((unlikely(pring->ringno == LPFC_ELS_RING)) && | 1331 | if ((unlikely(pring->ringno == LPFC_ELS_RING)) && |
1332 | (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) && | 1332 | (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) && |
1333 | (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) && | 1333 | (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) { |
1334 | (!(piocb->vport->load_flag & FC_UNLOADING))) | 1334 | BUG_ON(!piocb->vport); |
1335 | mod_timer(&piocb->vport->els_tmofunc, | 1335 | if (!(piocb->vport->load_flag & FC_UNLOADING)) |
1336 | jiffies + | 1336 | mod_timer(&piocb->vport->els_tmofunc, |
1337 | msecs_to_jiffies(1000 * (phba->fc_ratov << 1))); | 1337 | jiffies + |
1338 | msecs_to_jiffies(1000 * (phba->fc_ratov << 1))); | ||
1339 | } | ||
1338 | 1340 | ||
1339 | return 0; | 1341 | return 0; |
1340 | } | 1342 | } |
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index e3b30ea9ece5..a504e2e003da 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c | |||
@@ -506,7 +506,7 @@ static void vhost_vsock_reset_orphans(struct sock *sk) | |||
506 | * executing. | 506 | * executing. |
507 | */ | 507 | */ |
508 | 508 | ||
509 | if (!vhost_vsock_get(vsk->local_addr.svm_cid)) { | 509 | if (!vhost_vsock_get(vsk->remote_addr.svm_cid)) { |
510 | sock_set_flag(sk, SOCK_DONE); | 510 | sock_set_flag(sk, SOCK_DONE); |
511 | vsk->peer_shutdown = SHUTDOWN_MASK; | 511 | vsk->peer_shutdown = SHUTDOWN_MASK; |
512 | sk->sk_state = SS_UNCONNECTED; | 512 | sk->sk_state = SS_UNCONNECTED; |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 78180d151730..a594c7879cc2 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -1261,26 +1261,30 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags) | |||
1261 | return -ECHILD; | 1261 | return -ECHILD; |
1262 | 1262 | ||
1263 | op = ceph_snap(dir) == CEPH_SNAPDIR ? | 1263 | op = ceph_snap(dir) == CEPH_SNAPDIR ? |
1264 | CEPH_MDS_OP_LOOKUPSNAP : CEPH_MDS_OP_LOOKUP; | 1264 | CEPH_MDS_OP_LOOKUPSNAP : CEPH_MDS_OP_GETATTR; |
1265 | req = ceph_mdsc_create_request(mdsc, op, USE_ANY_MDS); | 1265 | req = ceph_mdsc_create_request(mdsc, op, USE_ANY_MDS); |
1266 | if (!IS_ERR(req)) { | 1266 | if (!IS_ERR(req)) { |
1267 | req->r_dentry = dget(dentry); | 1267 | req->r_dentry = dget(dentry); |
1268 | req->r_num_caps = 2; | 1268 | req->r_num_caps = op == CEPH_MDS_OP_GETATTR ? 1 : 2; |
1269 | 1269 | ||
1270 | mask = CEPH_STAT_CAP_INODE | CEPH_CAP_AUTH_SHARED; | 1270 | mask = CEPH_STAT_CAP_INODE | CEPH_CAP_AUTH_SHARED; |
1271 | if (ceph_security_xattr_wanted(dir)) | 1271 | if (ceph_security_xattr_wanted(dir)) |
1272 | mask |= CEPH_CAP_XATTR_SHARED; | 1272 | mask |= CEPH_CAP_XATTR_SHARED; |
1273 | req->r_args.getattr.mask = mask; | 1273 | req->r_args.getattr.mask = mask; |
1274 | 1274 | ||
1275 | req->r_locked_dir = dir; | ||
1276 | err = ceph_mdsc_do_request(mdsc, NULL, req); | 1275 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
1277 | if (err == 0 || err == -ENOENT) { | 1276 | switch (err) { |
1278 | if (dentry == req->r_dentry) { | 1277 | case 0: |
1279 | valid = !d_unhashed(dentry); | 1278 | if (d_really_is_positive(dentry) && |
1280 | } else { | 1279 | d_inode(dentry) == req->r_target_inode) |
1281 | d_invalidate(req->r_dentry); | 1280 | valid = 1; |
1282 | err = -EAGAIN; | 1281 | break; |
1283 | } | 1282 | case -ENOENT: |
1283 | if (d_really_is_negative(dentry)) | ||
1284 | valid = 1; | ||
1285 | /* Fallthrough */ | ||
1286 | default: | ||
1287 | break; | ||
1284 | } | 1288 | } |
1285 | ceph_mdsc_put_request(req); | 1289 | ceph_mdsc_put_request(req); |
1286 | dout("d_revalidate %p lookup result=%d\n", | 1290 | dout("d_revalidate %p lookup result=%d\n", |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index b3ebe512d64c..096f79997f75 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1739,8 +1739,6 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) | |||
1739 | * This should be done on write(), truncate() and chown(). | 1739 | * This should be done on write(), truncate() and chown(). |
1740 | */ | 1740 | */ |
1741 | if (!fc->handle_killpriv) { | 1741 | if (!fc->handle_killpriv) { |
1742 | int kill; | ||
1743 | |||
1744 | /* | 1742 | /* |
1745 | * ia_mode calculation may have used stale i_mode. | 1743 | * ia_mode calculation may have used stale i_mode. |
1746 | * Refresh and recalculate. | 1744 | * Refresh and recalculate. |
@@ -1750,12 +1748,11 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) | |||
1750 | return ret; | 1748 | return ret; |
1751 | 1749 | ||
1752 | attr->ia_mode = inode->i_mode; | 1750 | attr->ia_mode = inode->i_mode; |
1753 | kill = should_remove_suid(entry); | 1751 | if (inode->i_mode & S_ISUID) { |
1754 | if (kill & ATTR_KILL_SUID) { | ||
1755 | attr->ia_valid |= ATTR_MODE; | 1752 | attr->ia_valid |= ATTR_MODE; |
1756 | attr->ia_mode &= ~S_ISUID; | 1753 | attr->ia_mode &= ~S_ISUID; |
1757 | } | 1754 | } |
1758 | if (kill & ATTR_KILL_SGID) { | 1755 | if ((inode->i_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { |
1759 | attr->ia_valid |= ATTR_MODE; | 1756 | attr->ia_valid |= ATTR_MODE; |
1760 | attr->ia_mode &= ~S_ISGID; | 1757 | attr->ia_mode &= ~S_ISGID; |
1761 | } | 1758 | } |
diff --git a/include/asm-generic/export.h b/include/asm-generic/export.h index 59a3b2f58c22..63554e9f6e0c 100644 --- a/include/asm-generic/export.h +++ b/include/asm-generic/export.h | |||
@@ -54,7 +54,6 @@ KSYM(__kstrtab_\name): | |||
54 | KSYM(__kcrctab_\name): | 54 | KSYM(__kcrctab_\name): |
55 | __put KSYM(__crc_\name) | 55 | __put KSYM(__crc_\name) |
56 | .weak KSYM(__crc_\name) | 56 | .weak KSYM(__crc_\name) |
57 | .set KSYM(__crc_\name), 0 | ||
58 | .previous | 57 | .previous |
59 | #endif | 58 | #endif |
60 | #endif | 59 | #endif |
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h index f4947fda11e7..8458c5351e56 100644 --- a/include/linux/libnvdimm.h +++ b/include/linux/libnvdimm.h | |||
@@ -143,7 +143,7 @@ u32 nd_cmd_in_size(struct nvdimm *nvdimm, int cmd, | |||
143 | const struct nd_cmd_desc *desc, int idx, void *buf); | 143 | const struct nd_cmd_desc *desc, int idx, void *buf); |
144 | u32 nd_cmd_out_size(struct nvdimm *nvdimm, int cmd, | 144 | u32 nd_cmd_out_size(struct nvdimm *nvdimm, int cmd, |
145 | const struct nd_cmd_desc *desc, int idx, const u32 *in_field, | 145 | const struct nd_cmd_desc *desc, int idx, const u32 *in_field, |
146 | const u32 *out_field); | 146 | const u32 *out_field, unsigned long remainder); |
147 | int nvdimm_bus_check_dimm_count(struct nvdimm_bus *nvdimm_bus, int dimm_count); | 147 | int nvdimm_bus_check_dimm_count(struct nvdimm_bus *nvdimm_bus, int dimm_count); |
148 | struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus, | 148 | struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus, |
149 | struct nd_region_desc *ndr_desc); | 149 | struct nd_region_desc *ndr_desc); |
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index 3a375d07d0dc..00d232406f18 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h | |||
@@ -81,7 +81,8 @@ | |||
81 | #define CDC_NCM_TIMER_INTERVAL_MAX (U32_MAX / NSEC_PER_USEC) | 81 | #define CDC_NCM_TIMER_INTERVAL_MAX (U32_MAX / NSEC_PER_USEC) |
82 | 82 | ||
83 | /* Driver flags */ | 83 | /* Driver flags */ |
84 | #define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */ | 84 | #define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */ |
85 | #define CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE 0x04 /* Avoid altsetting toggle during init */ | ||
85 | 86 | ||
86 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ | 87 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ |
87 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) | 88 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) |
diff --git a/include/uapi/linux/can.h b/include/uapi/linux/can.h index 9692cda5f8fc..c48d93a28d1a 100644 --- a/include/uapi/linux/can.h +++ b/include/uapi/linux/can.h | |||
@@ -196,5 +196,6 @@ struct can_filter { | |||
196 | }; | 196 | }; |
197 | 197 | ||
198 | #define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */ | 198 | #define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */ |
199 | #define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */ | ||
199 | 200 | ||
200 | #endif /* !_UAPI_CAN_H */ | 201 | #endif /* !_UAPI_CAN_H */ |
diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h index e601c8c3bdc7..1158a043342a 100644 --- a/include/uapi/linux/if.h +++ b/include/uapi/linux/if.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <linux/hdlc/ioctl.h> | 31 | #include <linux/hdlc/ioctl.h> |
32 | 32 | ||
33 | /* For glibc compatibility. An empty enum does not compile. */ | 33 | /* For glibc compatibility. An empty enum does not compile. */ |
34 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && \ | 34 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \ |
35 | __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 | 35 | __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 |
36 | /** | 36 | /** |
37 | * enum net_device_flags - &struct net_device flags | 37 | * enum net_device_flags - &struct net_device flags |
@@ -99,7 +99,7 @@ enum net_device_flags { | |||
99 | IFF_ECHO = 1<<18, /* volatile */ | 99 | IFF_ECHO = 1<<18, /* volatile */ |
100 | #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ | 100 | #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ |
101 | }; | 101 | }; |
102 | #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */ | 102 | #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */ |
103 | 103 | ||
104 | /* for compatibility with glibc net/if.h */ | 104 | /* for compatibility with glibc net/if.h */ |
105 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS | 105 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS |
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild index cd26d7a0fd07..03f194aeadc5 100644 --- a/include/uapi/linux/netfilter/Kbuild +++ b/include/uapi/linux/netfilter/Kbuild | |||
@@ -5,6 +5,7 @@ header-y += nf_conntrack_ftp.h | |||
5 | header-y += nf_conntrack_sctp.h | 5 | header-y += nf_conntrack_sctp.h |
6 | header-y += nf_conntrack_tcp.h | 6 | header-y += nf_conntrack_tcp.h |
7 | header-y += nf_conntrack_tuple_common.h | 7 | header-y += nf_conntrack_tuple_common.h |
8 | header-y += nf_log.h | ||
8 | header-y += nf_tables.h | 9 | header-y += nf_tables.h |
9 | header-y += nf_tables_compat.h | 10 | header-y += nf_tables_compat.h |
10 | header-y += nf_nat.h | 11 | header-y += nf_nat.h |
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild index 9611c7b6c18f..e3db7403296f 100644 --- a/include/uapi/linux/tc_act/Kbuild +++ b/include/uapi/linux/tc_act/Kbuild | |||
@@ -12,3 +12,4 @@ header-y += tc_bpf.h | |||
12 | header-y += tc_connmark.h | 12 | header-y += tc_connmark.h |
13 | header-y += tc_ife.h | 13 | header-y += tc_ife.h |
14 | header-y += tc_tunnel_key.h | 14 | header-y += tc_tunnel_key.h |
15 | header-y += tc_skbmod.h | ||
diff --git a/kernel/events/core.c b/kernel/events/core.c index 6ee1febdf6ff..02c8421f8c01 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -903,17 +903,14 @@ list_update_cgroup_event(struct perf_event *event, | |||
903 | */ | 903 | */ |
904 | cpuctx = __get_cpu_context(ctx); | 904 | cpuctx = __get_cpu_context(ctx); |
905 | 905 | ||
906 | /* Only set/clear cpuctx->cgrp if current task uses event->cgrp. */ | 906 | /* |
907 | if (perf_cgroup_from_task(current, ctx) != event->cgrp) { | 907 | * cpuctx->cgrp is NULL until a cgroup event is sched in or |
908 | /* | 908 | * ctx->nr_cgroup == 0 . |
909 | * We are removing the last cpu event in this context. | 909 | */ |
910 | * If that event is not active in this cpu, cpuctx->cgrp | 910 | if (add && perf_cgroup_from_task(current, ctx) == event->cgrp) |
911 | * should've been cleared by perf_cgroup_switch. | 911 | cpuctx->cgrp = event->cgrp; |
912 | */ | 912 | else if (!add) |
913 | WARN_ON_ONCE(!add && cpuctx->cgrp); | 913 | cpuctx->cgrp = NULL; |
914 | return; | ||
915 | } | ||
916 | cpuctx->cgrp = add ? event->cgrp : NULL; | ||
917 | } | 914 | } |
918 | 915 | ||
919 | #else /* !CONFIG_CGROUP_PERF */ | 916 | #else /* !CONFIG_CGROUP_PERF */ |
diff --git a/kernel/kcov.c b/kernel/kcov.c index 30e6d05aa5a9..3cbb0c879705 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/fs.h> | 7 | #include <linux/fs.h> |
8 | #include <linux/mm.h> | 8 | #include <linux/mm.h> |
9 | #include <linux/printk.h> | 9 | #include <linux/printk.h> |
10 | #include <linux/sched.h> | ||
10 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
11 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
12 | #include <linux/vmalloc.h> | 13 | #include <linux/vmalloc.h> |
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 589d763a49b3..4d7ffc0a0d00 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
@@ -506,13 +506,13 @@ static void __print_lock_name(struct lock_class *class) | |||
506 | name = class->name; | 506 | name = class->name; |
507 | if (!name) { | 507 | if (!name) { |
508 | name = __get_key_name(class->key, str); | 508 | name = __get_key_name(class->key, str); |
509 | printk("%s", name); | 509 | printk(KERN_CONT "%s", name); |
510 | } else { | 510 | } else { |
511 | printk("%s", name); | 511 | printk(KERN_CONT "%s", name); |
512 | if (class->name_version > 1) | 512 | if (class->name_version > 1) |
513 | printk("#%d", class->name_version); | 513 | printk(KERN_CONT "#%d", class->name_version); |
514 | if (class->subclass) | 514 | if (class->subclass) |
515 | printk("/%d", class->subclass); | 515 | printk(KERN_CONT "/%d", class->subclass); |
516 | } | 516 | } |
517 | } | 517 | } |
518 | 518 | ||
@@ -522,9 +522,9 @@ static void print_lock_name(struct lock_class *class) | |||
522 | 522 | ||
523 | get_usage_chars(class, usage); | 523 | get_usage_chars(class, usage); |
524 | 524 | ||
525 | printk(" ("); | 525 | printk(KERN_CONT " ("); |
526 | __print_lock_name(class); | 526 | __print_lock_name(class); |
527 | printk("){%s}", usage); | 527 | printk(KERN_CONT "){%s}", usage); |
528 | } | 528 | } |
529 | 529 | ||
530 | static void print_lockdep_cache(struct lockdep_map *lock) | 530 | static void print_lockdep_cache(struct lockdep_map *lock) |
@@ -536,7 +536,7 @@ static void print_lockdep_cache(struct lockdep_map *lock) | |||
536 | if (!name) | 536 | if (!name) |
537 | name = __get_key_name(lock->key->subkeys, str); | 537 | name = __get_key_name(lock->key->subkeys, str); |
538 | 538 | ||
539 | printk("%s", name); | 539 | printk(KERN_CONT "%s", name); |
540 | } | 540 | } |
541 | 541 | ||
542 | static void print_lock(struct held_lock *hlock) | 542 | static void print_lock(struct held_lock *hlock) |
@@ -551,13 +551,13 @@ static void print_lock(struct held_lock *hlock) | |||
551 | barrier(); | 551 | barrier(); |
552 | 552 | ||
553 | if (!class_idx || (class_idx - 1) >= MAX_LOCKDEP_KEYS) { | 553 | if (!class_idx || (class_idx - 1) >= MAX_LOCKDEP_KEYS) { |
554 | printk("<RELEASED>\n"); | 554 | printk(KERN_CONT "<RELEASED>\n"); |
555 | return; | 555 | return; |
556 | } | 556 | } |
557 | 557 | ||
558 | print_lock_name(lock_classes + class_idx - 1); | 558 | print_lock_name(lock_classes + class_idx - 1); |
559 | printk(", at: "); | 559 | printk(KERN_CONT ", at: [<%p>] %pS\n", |
560 | print_ip_sym(hlock->acquire_ip); | 560 | (void *)hlock->acquire_ip, (void *)hlock->acquire_ip); |
561 | } | 561 | } |
562 | 562 | ||
563 | static void lockdep_print_held_locks(struct task_struct *curr) | 563 | static void lockdep_print_held_locks(struct task_struct *curr) |
@@ -792,8 +792,8 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) | |||
792 | 792 | ||
793 | printk("\nnew class %p: %s", class->key, class->name); | 793 | printk("\nnew class %p: %s", class->key, class->name); |
794 | if (class->name_version > 1) | 794 | if (class->name_version > 1) |
795 | printk("#%d", class->name_version); | 795 | printk(KERN_CONT "#%d", class->name_version); |
796 | printk("\n"); | 796 | printk(KERN_CONT "\n"); |
797 | dump_stack(); | 797 | dump_stack(); |
798 | 798 | ||
799 | if (!graph_lock()) { | 799 | if (!graph_lock()) { |
@@ -1071,7 +1071,7 @@ print_circular_bug_entry(struct lock_list *target, int depth) | |||
1071 | return 0; | 1071 | return 0; |
1072 | printk("\n-> #%u", depth); | 1072 | printk("\n-> #%u", depth); |
1073 | print_lock_name(target->class); | 1073 | print_lock_name(target->class); |
1074 | printk(":\n"); | 1074 | printk(KERN_CONT ":\n"); |
1075 | print_stack_trace(&target->trace, 6); | 1075 | print_stack_trace(&target->trace, 6); |
1076 | 1076 | ||
1077 | return 0; | 1077 | return 0; |
@@ -1102,11 +1102,11 @@ print_circular_lock_scenario(struct held_lock *src, | |||
1102 | if (parent != source) { | 1102 | if (parent != source) { |
1103 | printk("Chain exists of:\n "); | 1103 | printk("Chain exists of:\n "); |
1104 | __print_lock_name(source); | 1104 | __print_lock_name(source); |
1105 | printk(" --> "); | 1105 | printk(KERN_CONT " --> "); |
1106 | __print_lock_name(parent); | 1106 | __print_lock_name(parent); |
1107 | printk(" --> "); | 1107 | printk(KERN_CONT " --> "); |
1108 | __print_lock_name(target); | 1108 | __print_lock_name(target); |
1109 | printk("\n\n"); | 1109 | printk(KERN_CONT "\n\n"); |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | printk(" Possible unsafe locking scenario:\n\n"); | 1112 | printk(" Possible unsafe locking scenario:\n\n"); |
@@ -1114,16 +1114,16 @@ print_circular_lock_scenario(struct held_lock *src, | |||
1114 | printk(" ---- ----\n"); | 1114 | printk(" ---- ----\n"); |
1115 | printk(" lock("); | 1115 | printk(" lock("); |
1116 | __print_lock_name(target); | 1116 | __print_lock_name(target); |
1117 | printk(");\n"); | 1117 | printk(KERN_CONT ");\n"); |
1118 | printk(" lock("); | 1118 | printk(" lock("); |
1119 | __print_lock_name(parent); | 1119 | __print_lock_name(parent); |
1120 | printk(");\n"); | 1120 | printk(KERN_CONT ");\n"); |
1121 | printk(" lock("); | 1121 | printk(" lock("); |
1122 | __print_lock_name(target); | 1122 | __print_lock_name(target); |
1123 | printk(");\n"); | 1123 | printk(KERN_CONT ");\n"); |
1124 | printk(" lock("); | 1124 | printk(" lock("); |
1125 | __print_lock_name(source); | 1125 | __print_lock_name(source); |
1126 | printk(");\n"); | 1126 | printk(KERN_CONT ");\n"); |
1127 | printk("\n *** DEADLOCK ***\n\n"); | 1127 | printk("\n *** DEADLOCK ***\n\n"); |
1128 | } | 1128 | } |
1129 | 1129 | ||
@@ -1359,22 +1359,22 @@ static void print_lock_class_header(struct lock_class *class, int depth) | |||
1359 | 1359 | ||
1360 | printk("%*s->", depth, ""); | 1360 | printk("%*s->", depth, ""); |
1361 | print_lock_name(class); | 1361 | print_lock_name(class); |
1362 | printk(" ops: %lu", class->ops); | 1362 | printk(KERN_CONT " ops: %lu", class->ops); |
1363 | printk(" {\n"); | 1363 | printk(KERN_CONT " {\n"); |
1364 | 1364 | ||
1365 | for (bit = 0; bit < LOCK_USAGE_STATES; bit++) { | 1365 | for (bit = 0; bit < LOCK_USAGE_STATES; bit++) { |
1366 | if (class->usage_mask & (1 << bit)) { | 1366 | if (class->usage_mask & (1 << bit)) { |
1367 | int len = depth; | 1367 | int len = depth; |
1368 | 1368 | ||
1369 | len += printk("%*s %s", depth, "", usage_str[bit]); | 1369 | len += printk("%*s %s", depth, "", usage_str[bit]); |
1370 | len += printk(" at:\n"); | 1370 | len += printk(KERN_CONT " at:\n"); |
1371 | print_stack_trace(class->usage_traces + bit, len); | 1371 | print_stack_trace(class->usage_traces + bit, len); |
1372 | } | 1372 | } |
1373 | } | 1373 | } |
1374 | printk("%*s }\n", depth, ""); | 1374 | printk("%*s }\n", depth, ""); |
1375 | 1375 | ||
1376 | printk("%*s ... key at: ",depth,""); | 1376 | printk("%*s ... key at: [<%p>] %pS\n", |
1377 | print_ip_sym((unsigned long)class->key); | 1377 | depth, "", class->key, class->key); |
1378 | } | 1378 | } |
1379 | 1379 | ||
1380 | /* | 1380 | /* |
@@ -1437,11 +1437,11 @@ print_irq_lock_scenario(struct lock_list *safe_entry, | |||
1437 | if (middle_class != unsafe_class) { | 1437 | if (middle_class != unsafe_class) { |
1438 | printk("Chain exists of:\n "); | 1438 | printk("Chain exists of:\n "); |
1439 | __print_lock_name(safe_class); | 1439 | __print_lock_name(safe_class); |
1440 | printk(" --> "); | 1440 | printk(KERN_CONT " --> "); |
1441 | __print_lock_name(middle_class); | 1441 | __print_lock_name(middle_class); |
1442 | printk(" --> "); | 1442 | printk(KERN_CONT " --> "); |
1443 | __print_lock_name(unsafe_class); | 1443 | __print_lock_name(unsafe_class); |
1444 | printk("\n\n"); | 1444 | printk(KERN_CONT "\n\n"); |
1445 | } | 1445 | } |
1446 | 1446 | ||
1447 | printk(" Possible interrupt unsafe locking scenario:\n\n"); | 1447 | printk(" Possible interrupt unsafe locking scenario:\n\n"); |
@@ -1449,18 +1449,18 @@ print_irq_lock_scenario(struct lock_list *safe_entry, | |||
1449 | printk(" ---- ----\n"); | 1449 | printk(" ---- ----\n"); |
1450 | printk(" lock("); | 1450 | printk(" lock("); |
1451 | __print_lock_name(unsafe_class); | 1451 | __print_lock_name(unsafe_class); |
1452 | printk(");\n"); | 1452 | printk(KERN_CONT ");\n"); |
1453 | printk(" local_irq_disable();\n"); | 1453 | printk(" local_irq_disable();\n"); |
1454 | printk(" lock("); | 1454 | printk(" lock("); |
1455 | __print_lock_name(safe_class); | 1455 | __print_lock_name(safe_class); |
1456 | printk(");\n"); | 1456 | printk(KERN_CONT ");\n"); |
1457 | printk(" lock("); | 1457 | printk(" lock("); |
1458 | __print_lock_name(middle_class); | 1458 | __print_lock_name(middle_class); |
1459 | printk(");\n"); | 1459 | printk(KERN_CONT ");\n"); |
1460 | printk(" <Interrupt>\n"); | 1460 | printk(" <Interrupt>\n"); |
1461 | printk(" lock("); | 1461 | printk(" lock("); |
1462 | __print_lock_name(safe_class); | 1462 | __print_lock_name(safe_class); |
1463 | printk(");\n"); | 1463 | printk(KERN_CONT ");\n"); |
1464 | printk("\n *** DEADLOCK ***\n\n"); | 1464 | printk("\n *** DEADLOCK ***\n\n"); |
1465 | } | 1465 | } |
1466 | 1466 | ||
@@ -1497,9 +1497,9 @@ print_bad_irq_dependency(struct task_struct *curr, | |||
1497 | print_lock(prev); | 1497 | print_lock(prev); |
1498 | printk("which would create a new lock dependency:\n"); | 1498 | printk("which would create a new lock dependency:\n"); |
1499 | print_lock_name(hlock_class(prev)); | 1499 | print_lock_name(hlock_class(prev)); |
1500 | printk(" ->"); | 1500 | printk(KERN_CONT " ->"); |
1501 | print_lock_name(hlock_class(next)); | 1501 | print_lock_name(hlock_class(next)); |
1502 | printk("\n"); | 1502 | printk(KERN_CONT "\n"); |
1503 | 1503 | ||
1504 | printk("\nbut this new dependency connects a %s-irq-safe lock:\n", | 1504 | printk("\nbut this new dependency connects a %s-irq-safe lock:\n", |
1505 | irqclass); | 1505 | irqclass); |
@@ -1521,8 +1521,7 @@ print_bad_irq_dependency(struct task_struct *curr, | |||
1521 | 1521 | ||
1522 | lockdep_print_held_locks(curr); | 1522 | lockdep_print_held_locks(curr); |
1523 | 1523 | ||
1524 | printk("\nthe dependencies between %s-irq-safe lock", irqclass); | 1524 | printk("\nthe dependencies between %s-irq-safe lock and the holding lock:\n", irqclass); |
1525 | printk(" and the holding lock:\n"); | ||
1526 | if (!save_trace(&prev_root->trace)) | 1525 | if (!save_trace(&prev_root->trace)) |
1527 | return 0; | 1526 | return 0; |
1528 | print_shortest_lock_dependencies(backwards_entry, prev_root); | 1527 | print_shortest_lock_dependencies(backwards_entry, prev_root); |
@@ -1694,10 +1693,10 @@ print_deadlock_scenario(struct held_lock *nxt, | |||
1694 | printk(" ----\n"); | 1693 | printk(" ----\n"); |
1695 | printk(" lock("); | 1694 | printk(" lock("); |
1696 | __print_lock_name(prev); | 1695 | __print_lock_name(prev); |
1697 | printk(");\n"); | 1696 | printk(KERN_CONT ");\n"); |
1698 | printk(" lock("); | 1697 | printk(" lock("); |
1699 | __print_lock_name(next); | 1698 | __print_lock_name(next); |
1700 | printk(");\n"); | 1699 | printk(KERN_CONT ");\n"); |
1701 | printk("\n *** DEADLOCK ***\n\n"); | 1700 | printk("\n *** DEADLOCK ***\n\n"); |
1702 | printk(" May be due to missing lock nesting notation\n\n"); | 1701 | printk(" May be due to missing lock nesting notation\n\n"); |
1703 | } | 1702 | } |
@@ -1891,9 +1890,9 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, | |||
1891 | graph_unlock(); | 1890 | graph_unlock(); |
1892 | printk("\n new dependency: "); | 1891 | printk("\n new dependency: "); |
1893 | print_lock_name(hlock_class(prev)); | 1892 | print_lock_name(hlock_class(prev)); |
1894 | printk(" => "); | 1893 | printk(KERN_CONT " => "); |
1895 | print_lock_name(hlock_class(next)); | 1894 | print_lock_name(hlock_class(next)); |
1896 | printk("\n"); | 1895 | printk(KERN_CONT "\n"); |
1897 | dump_stack(); | 1896 | dump_stack(); |
1898 | return graph_lock(); | 1897 | return graph_lock(); |
1899 | } | 1898 | } |
@@ -2343,11 +2342,11 @@ print_usage_bug_scenario(struct held_lock *lock) | |||
2343 | printk(" ----\n"); | 2342 | printk(" ----\n"); |
2344 | printk(" lock("); | 2343 | printk(" lock("); |
2345 | __print_lock_name(class); | 2344 | __print_lock_name(class); |
2346 | printk(");\n"); | 2345 | printk(KERN_CONT ");\n"); |
2347 | printk(" <Interrupt>\n"); | 2346 | printk(" <Interrupt>\n"); |
2348 | printk(" lock("); | 2347 | printk(" lock("); |
2349 | __print_lock_name(class); | 2348 | __print_lock_name(class); |
2350 | printk(");\n"); | 2349 | printk(KERN_CONT ");\n"); |
2351 | printk("\n *** DEADLOCK ***\n\n"); | 2350 | printk("\n *** DEADLOCK ***\n\n"); |
2352 | } | 2351 | } |
2353 | 2352 | ||
@@ -2522,14 +2521,18 @@ check_usage_backwards(struct task_struct *curr, struct held_lock *this, | |||
2522 | void print_irqtrace_events(struct task_struct *curr) | 2521 | void print_irqtrace_events(struct task_struct *curr) |
2523 | { | 2522 | { |
2524 | printk("irq event stamp: %u\n", curr->irq_events); | 2523 | printk("irq event stamp: %u\n", curr->irq_events); |
2525 | printk("hardirqs last enabled at (%u): ", curr->hardirq_enable_event); | 2524 | printk("hardirqs last enabled at (%u): [<%p>] %pS\n", |
2526 | print_ip_sym(curr->hardirq_enable_ip); | 2525 | curr->hardirq_enable_event, (void *)curr->hardirq_enable_ip, |
2527 | printk("hardirqs last disabled at (%u): ", curr->hardirq_disable_event); | 2526 | (void *)curr->hardirq_enable_ip); |
2528 | print_ip_sym(curr->hardirq_disable_ip); | 2527 | printk("hardirqs last disabled at (%u): [<%p>] %pS\n", |
2529 | printk("softirqs last enabled at (%u): ", curr->softirq_enable_event); | 2528 | curr->hardirq_disable_event, (void *)curr->hardirq_disable_ip, |
2530 | print_ip_sym(curr->softirq_enable_ip); | 2529 | (void *)curr->hardirq_disable_ip); |
2531 | printk("softirqs last disabled at (%u): ", curr->softirq_disable_event); | 2530 | printk("softirqs last enabled at (%u): [<%p>] %pS\n", |
2532 | print_ip_sym(curr->softirq_disable_ip); | 2531 | curr->softirq_enable_event, (void *)curr->softirq_enable_ip, |
2532 | (void *)curr->softirq_enable_ip); | ||
2533 | printk("softirqs last disabled at (%u): [<%p>] %pS\n", | ||
2534 | curr->softirq_disable_event, (void *)curr->softirq_disable_ip, | ||
2535 | (void *)curr->softirq_disable_ip); | ||
2533 | } | 2536 | } |
2534 | 2537 | ||
2535 | static int HARDIRQ_verbose(struct lock_class *class) | 2538 | static int HARDIRQ_verbose(struct lock_class *class) |
@@ -3235,8 +3238,8 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
3235 | if (very_verbose(class)) { | 3238 | if (very_verbose(class)) { |
3236 | printk("\nacquire class [%p] %s", class->key, class->name); | 3239 | printk("\nacquire class [%p] %s", class->key, class->name); |
3237 | if (class->name_version > 1) | 3240 | if (class->name_version > 1) |
3238 | printk("#%d", class->name_version); | 3241 | printk(KERN_CONT "#%d", class->name_version); |
3239 | printk("\n"); | 3242 | printk(KERN_CONT "\n"); |
3240 | dump_stack(); | 3243 | dump_stack(); |
3241 | } | 3244 | } |
3242 | 3245 | ||
@@ -3378,7 +3381,7 @@ print_unlock_imbalance_bug(struct task_struct *curr, struct lockdep_map *lock, | |||
3378 | printk("%s/%d is trying to release lock (", | 3381 | printk("%s/%d is trying to release lock (", |
3379 | curr->comm, task_pid_nr(curr)); | 3382 | curr->comm, task_pid_nr(curr)); |
3380 | print_lockdep_cache(lock); | 3383 | print_lockdep_cache(lock); |
3381 | printk(") at:\n"); | 3384 | printk(KERN_CONT ") at:\n"); |
3382 | print_ip_sym(ip); | 3385 | print_ip_sym(ip); |
3383 | printk("but there are no more locks to release!\n"); | 3386 | printk("but there are no more locks to release!\n"); |
3384 | printk("\nother info that might help us debug this:\n"); | 3387 | printk("\nother info that might help us debug this:\n"); |
@@ -3871,7 +3874,7 @@ print_lock_contention_bug(struct task_struct *curr, struct lockdep_map *lock, | |||
3871 | printk("%s/%d is trying to contend lock (", | 3874 | printk("%s/%d is trying to contend lock (", |
3872 | curr->comm, task_pid_nr(curr)); | 3875 | curr->comm, task_pid_nr(curr)); |
3873 | print_lockdep_cache(lock); | 3876 | print_lockdep_cache(lock); |
3874 | printk(") at:\n"); | 3877 | printk(KERN_CONT ") at:\n"); |
3875 | print_ip_sym(ip); | 3878 | print_ip_sym(ip); |
3876 | printk("but there are no locks held!\n"); | 3879 | printk("but there are no locks held!\n"); |
3877 | printk("\nother info that might help us debug this:\n"); | 3880 | printk("\nother info that might help us debug this:\n"); |
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 1ec0f48962b3..2c49d76f96c3 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c | |||
@@ -65,8 +65,72 @@ static inline void clear_rt_mutex_waiters(struct rt_mutex *lock) | |||
65 | 65 | ||
66 | static void fixup_rt_mutex_waiters(struct rt_mutex *lock) | 66 | static void fixup_rt_mutex_waiters(struct rt_mutex *lock) |
67 | { | 67 | { |
68 | if (!rt_mutex_has_waiters(lock)) | 68 | unsigned long owner, *p = (unsigned long *) &lock->owner; |
69 | clear_rt_mutex_waiters(lock); | 69 | |
70 | if (rt_mutex_has_waiters(lock)) | ||
71 | return; | ||
72 | |||
73 | /* | ||
74 | * The rbtree has no waiters enqueued, now make sure that the | ||
75 | * lock->owner still has the waiters bit set, otherwise the | ||
76 | * following can happen: | ||
77 | * | ||
78 | * CPU 0 CPU 1 CPU2 | ||
79 | * l->owner=T1 | ||
80 | * rt_mutex_lock(l) | ||
81 | * lock(l->lock) | ||
82 | * l->owner = T1 | HAS_WAITERS; | ||
83 | * enqueue(T2) | ||
84 | * boost() | ||
85 | * unlock(l->lock) | ||
86 | * block() | ||
87 | * | ||
88 | * rt_mutex_lock(l) | ||
89 | * lock(l->lock) | ||
90 | * l->owner = T1 | HAS_WAITERS; | ||
91 | * enqueue(T3) | ||
92 | * boost() | ||
93 | * unlock(l->lock) | ||
94 | * block() | ||
95 | * signal(->T2) signal(->T3) | ||
96 | * lock(l->lock) | ||
97 | * dequeue(T2) | ||
98 | * deboost() | ||
99 | * unlock(l->lock) | ||
100 | * lock(l->lock) | ||
101 | * dequeue(T3) | ||
102 | * ==> wait list is empty | ||
103 | * deboost() | ||
104 | * unlock(l->lock) | ||
105 | * lock(l->lock) | ||
106 | * fixup_rt_mutex_waiters() | ||
107 | * if (wait_list_empty(l) { | ||
108 | * l->owner = owner | ||
109 | * owner = l->owner & ~HAS_WAITERS; | ||
110 | * ==> l->owner = T1 | ||
111 | * } | ||
112 | * lock(l->lock) | ||
113 | * rt_mutex_unlock(l) fixup_rt_mutex_waiters() | ||
114 | * if (wait_list_empty(l) { | ||
115 | * owner = l->owner & ~HAS_WAITERS; | ||
116 | * cmpxchg(l->owner, T1, NULL) | ||
117 | * ===> Success (l->owner = NULL) | ||
118 | * | ||
119 | * l->owner = owner | ||
120 | * ==> l->owner = T1 | ||
121 | * } | ||
122 | * | ||
123 | * With the check for the waiter bit in place T3 on CPU2 will not | ||
124 | * overwrite. All tasks fiddling with the waiters bit are | ||
125 | * serialized by l->lock, so nothing else can modify the waiters | ||
126 | * bit. If the bit is set then nothing can change l->owner either | ||
127 | * so the simple RMW is safe. The cmpxchg() will simply fail if it | ||
128 | * happens in the middle of the RMW because the waiters bit is | ||
129 | * still set. | ||
130 | */ | ||
131 | owner = READ_ONCE(*p); | ||
132 | if (owner & RT_MUTEX_HAS_WAITERS) | ||
133 | WRITE_ONCE(*p, owner & ~RT_MUTEX_HAS_WAITERS); | ||
70 | } | 134 | } |
71 | 135 | ||
72 | /* | 136 | /* |
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h index 4f5f83c7d2d3..e317e1cbb3eb 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h | |||
@@ -75,8 +75,9 @@ task_top_pi_waiter(struct task_struct *p) | |||
75 | 75 | ||
76 | static inline struct task_struct *rt_mutex_owner(struct rt_mutex *lock) | 76 | static inline struct task_struct *rt_mutex_owner(struct rt_mutex *lock) |
77 | { | 77 | { |
78 | return (struct task_struct *) | 78 | unsigned long owner = (unsigned long) READ_ONCE(lock->owner); |
79 | ((unsigned long)lock->owner & ~RT_MUTEX_OWNER_MASKALL); | 79 | |
80 | return (struct task_struct *) (owner & ~RT_MUTEX_OWNER_MASKALL); | ||
80 | } | 81 | } |
81 | 82 | ||
82 | /* | 83 | /* |
diff --git a/kernel/sched/auto_group.c b/kernel/sched/auto_group.c index f1c8fd566246..da39489d2d80 100644 --- a/kernel/sched/auto_group.c +++ b/kernel/sched/auto_group.c | |||
@@ -212,6 +212,7 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice) | |||
212 | { | 212 | { |
213 | static unsigned long next = INITIAL_JIFFIES; | 213 | static unsigned long next = INITIAL_JIFFIES; |
214 | struct autogroup *ag; | 214 | struct autogroup *ag; |
215 | unsigned long shares; | ||
215 | int err; | 216 | int err; |
216 | 217 | ||
217 | if (nice < MIN_NICE || nice > MAX_NICE) | 218 | if (nice < MIN_NICE || nice > MAX_NICE) |
@@ -230,9 +231,10 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice) | |||
230 | 231 | ||
231 | next = HZ / 10 + jiffies; | 232 | next = HZ / 10 + jiffies; |
232 | ag = autogroup_task_get(p); | 233 | ag = autogroup_task_get(p); |
234 | shares = scale_load(sched_prio_to_weight[nice + 20]); | ||
233 | 235 | ||
234 | down_write(&ag->lock); | 236 | down_write(&ag->lock); |
235 | err = sched_group_set_shares(ag->tg, sched_prio_to_weight[nice + 20]); | 237 | err = sched_group_set_shares(ag->tg, shares); |
236 | if (!err) | 238 | if (!err) |
237 | ag->nice = nice; | 239 | ag->nice = nice; |
238 | up_write(&ag->lock); | 240 | up_write(&ag->lock); |
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c index 872a15a2a637..f3a217ea0388 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c | |||
@@ -980,23 +980,23 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask) | |||
980 | #ifndef CONFIG_PROVE_LOCKING | 980 | #ifndef CONFIG_PROVE_LOCKING |
981 | if (expected == FAILURE && debug_locks) { | 981 | if (expected == FAILURE && debug_locks) { |
982 | expected_testcase_failures++; | 982 | expected_testcase_failures++; |
983 | printk("failed|"); | 983 | pr_cont("failed|"); |
984 | } | 984 | } |
985 | else | 985 | else |
986 | #endif | 986 | #endif |
987 | if (debug_locks != expected) { | 987 | if (debug_locks != expected) { |
988 | unexpected_testcase_failures++; | 988 | unexpected_testcase_failures++; |
989 | printk("FAILED|"); | 989 | pr_cont("FAILED|"); |
990 | 990 | ||
991 | dump_stack(); | 991 | dump_stack(); |
992 | } else { | 992 | } else { |
993 | testcase_successes++; | 993 | testcase_successes++; |
994 | printk(" ok |"); | 994 | pr_cont(" ok |"); |
995 | } | 995 | } |
996 | testcase_total++; | 996 | testcase_total++; |
997 | 997 | ||
998 | if (debug_locks_verbose) | 998 | if (debug_locks_verbose) |
999 | printk(" lockclass mask: %x, debug_locks: %d, expected: %d\n", | 999 | pr_cont(" lockclass mask: %x, debug_locks: %d, expected: %d\n", |
1000 | lockclass_mask, debug_locks, expected); | 1000 | lockclass_mask, debug_locks, expected); |
1001 | /* | 1001 | /* |
1002 | * Some tests (e.g. double-unlock) might corrupt the preemption | 1002 | * Some tests (e.g. double-unlock) might corrupt the preemption |
@@ -1021,26 +1021,26 @@ static inline void print_testname(const char *testname) | |||
1021 | #define DO_TESTCASE_1(desc, name, nr) \ | 1021 | #define DO_TESTCASE_1(desc, name, nr) \ |
1022 | print_testname(desc"/"#nr); \ | 1022 | print_testname(desc"/"#nr); \ |
1023 | dotest(name##_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ | 1023 | dotest(name##_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ |
1024 | printk("\n"); | 1024 | pr_cont("\n"); |
1025 | 1025 | ||
1026 | #define DO_TESTCASE_1B(desc, name, nr) \ | 1026 | #define DO_TESTCASE_1B(desc, name, nr) \ |
1027 | print_testname(desc"/"#nr); \ | 1027 | print_testname(desc"/"#nr); \ |
1028 | dotest(name##_##nr, FAILURE, LOCKTYPE_RWLOCK); \ | 1028 | dotest(name##_##nr, FAILURE, LOCKTYPE_RWLOCK); \ |
1029 | printk("\n"); | 1029 | pr_cont("\n"); |
1030 | 1030 | ||
1031 | #define DO_TESTCASE_3(desc, name, nr) \ | 1031 | #define DO_TESTCASE_3(desc, name, nr) \ |
1032 | print_testname(desc"/"#nr); \ | 1032 | print_testname(desc"/"#nr); \ |
1033 | dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN); \ | 1033 | dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN); \ |
1034 | dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ | 1034 | dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ |
1035 | dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ | 1035 | dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ |
1036 | printk("\n"); | 1036 | pr_cont("\n"); |
1037 | 1037 | ||
1038 | #define DO_TESTCASE_3RW(desc, name, nr) \ | 1038 | #define DO_TESTCASE_3RW(desc, name, nr) \ |
1039 | print_testname(desc"/"#nr); \ | 1039 | print_testname(desc"/"#nr); \ |
1040 | dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN|LOCKTYPE_RWLOCK);\ | 1040 | dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN|LOCKTYPE_RWLOCK);\ |
1041 | dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ | 1041 | dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ |
1042 | dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ | 1042 | dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ |
1043 | printk("\n"); | 1043 | pr_cont("\n"); |
1044 | 1044 | ||
1045 | #define DO_TESTCASE_6(desc, name) \ | 1045 | #define DO_TESTCASE_6(desc, name) \ |
1046 | print_testname(desc); \ | 1046 | print_testname(desc); \ |
@@ -1050,7 +1050,7 @@ static inline void print_testname(const char *testname) | |||
1050 | dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX); \ | 1050 | dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX); \ |
1051 | dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM); \ | 1051 | dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM); \ |
1052 | dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM); \ | 1052 | dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM); \ |
1053 | printk("\n"); | 1053 | pr_cont("\n"); |
1054 | 1054 | ||
1055 | #define DO_TESTCASE_6_SUCCESS(desc, name) \ | 1055 | #define DO_TESTCASE_6_SUCCESS(desc, name) \ |
1056 | print_testname(desc); \ | 1056 | print_testname(desc); \ |
@@ -1060,7 +1060,7 @@ static inline void print_testname(const char *testname) | |||
1060 | dotest(name##_mutex, SUCCESS, LOCKTYPE_MUTEX); \ | 1060 | dotest(name##_mutex, SUCCESS, LOCKTYPE_MUTEX); \ |
1061 | dotest(name##_wsem, SUCCESS, LOCKTYPE_RWSEM); \ | 1061 | dotest(name##_wsem, SUCCESS, LOCKTYPE_RWSEM); \ |
1062 | dotest(name##_rsem, SUCCESS, LOCKTYPE_RWSEM); \ | 1062 | dotest(name##_rsem, SUCCESS, LOCKTYPE_RWSEM); \ |
1063 | printk("\n"); | 1063 | pr_cont("\n"); |
1064 | 1064 | ||
1065 | /* | 1065 | /* |
1066 | * 'read' variant: rlocks must not trigger. | 1066 | * 'read' variant: rlocks must not trigger. |
@@ -1073,7 +1073,7 @@ static inline void print_testname(const char *testname) | |||
1073 | dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX); \ | 1073 | dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX); \ |
1074 | dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM); \ | 1074 | dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM); \ |
1075 | dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM); \ | 1075 | dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM); \ |
1076 | printk("\n"); | 1076 | pr_cont("\n"); |
1077 | 1077 | ||
1078 | #define DO_TESTCASE_2I(desc, name, nr) \ | 1078 | #define DO_TESTCASE_2I(desc, name, nr) \ |
1079 | DO_TESTCASE_1("hard-"desc, name##_hard, nr); \ | 1079 | DO_TESTCASE_1("hard-"desc, name##_hard, nr); \ |
@@ -1726,25 +1726,25 @@ static void ww_tests(void) | |||
1726 | dotest(ww_test_fail_acquire, SUCCESS, LOCKTYPE_WW); | 1726 | dotest(ww_test_fail_acquire, SUCCESS, LOCKTYPE_WW); |
1727 | dotest(ww_test_normal, SUCCESS, LOCKTYPE_WW); | 1727 | dotest(ww_test_normal, SUCCESS, LOCKTYPE_WW); |
1728 | dotest(ww_test_unneeded_slow, FAILURE, LOCKTYPE_WW); | 1728 | dotest(ww_test_unneeded_slow, FAILURE, LOCKTYPE_WW); |
1729 | printk("\n"); | 1729 | pr_cont("\n"); |
1730 | 1730 | ||
1731 | print_testname("ww contexts mixing"); | 1731 | print_testname("ww contexts mixing"); |
1732 | dotest(ww_test_two_contexts, FAILURE, LOCKTYPE_WW); | 1732 | dotest(ww_test_two_contexts, FAILURE, LOCKTYPE_WW); |
1733 | dotest(ww_test_diff_class, FAILURE, LOCKTYPE_WW); | 1733 | dotest(ww_test_diff_class, FAILURE, LOCKTYPE_WW); |
1734 | printk("\n"); | 1734 | pr_cont("\n"); |
1735 | 1735 | ||
1736 | print_testname("finishing ww context"); | 1736 | print_testname("finishing ww context"); |
1737 | dotest(ww_test_context_done_twice, FAILURE, LOCKTYPE_WW); | 1737 | dotest(ww_test_context_done_twice, FAILURE, LOCKTYPE_WW); |
1738 | dotest(ww_test_context_unlock_twice, FAILURE, LOCKTYPE_WW); | 1738 | dotest(ww_test_context_unlock_twice, FAILURE, LOCKTYPE_WW); |
1739 | dotest(ww_test_context_fini_early, FAILURE, LOCKTYPE_WW); | 1739 | dotest(ww_test_context_fini_early, FAILURE, LOCKTYPE_WW); |
1740 | dotest(ww_test_context_lock_after_done, FAILURE, LOCKTYPE_WW); | 1740 | dotest(ww_test_context_lock_after_done, FAILURE, LOCKTYPE_WW); |
1741 | printk("\n"); | 1741 | pr_cont("\n"); |
1742 | 1742 | ||
1743 | print_testname("locking mismatches"); | 1743 | print_testname("locking mismatches"); |
1744 | dotest(ww_test_object_unlock_twice, FAILURE, LOCKTYPE_WW); | 1744 | dotest(ww_test_object_unlock_twice, FAILURE, LOCKTYPE_WW); |
1745 | dotest(ww_test_object_lock_unbalanced, FAILURE, LOCKTYPE_WW); | 1745 | dotest(ww_test_object_lock_unbalanced, FAILURE, LOCKTYPE_WW); |
1746 | dotest(ww_test_object_lock_stale_context, FAILURE, LOCKTYPE_WW); | 1746 | dotest(ww_test_object_lock_stale_context, FAILURE, LOCKTYPE_WW); |
1747 | printk("\n"); | 1747 | pr_cont("\n"); |
1748 | 1748 | ||
1749 | print_testname("EDEADLK handling"); | 1749 | print_testname("EDEADLK handling"); |
1750 | dotest(ww_test_edeadlk_normal, SUCCESS, LOCKTYPE_WW); | 1750 | dotest(ww_test_edeadlk_normal, SUCCESS, LOCKTYPE_WW); |
@@ -1757,11 +1757,11 @@ static void ww_tests(void) | |||
1757 | dotest(ww_test_edeadlk_acquire_more_edeadlk_slow, FAILURE, LOCKTYPE_WW); | 1757 | dotest(ww_test_edeadlk_acquire_more_edeadlk_slow, FAILURE, LOCKTYPE_WW); |
1758 | dotest(ww_test_edeadlk_acquire_wrong, FAILURE, LOCKTYPE_WW); | 1758 | dotest(ww_test_edeadlk_acquire_wrong, FAILURE, LOCKTYPE_WW); |
1759 | dotest(ww_test_edeadlk_acquire_wrong_slow, FAILURE, LOCKTYPE_WW); | 1759 | dotest(ww_test_edeadlk_acquire_wrong_slow, FAILURE, LOCKTYPE_WW); |
1760 | printk("\n"); | 1760 | pr_cont("\n"); |
1761 | 1761 | ||
1762 | print_testname("spinlock nest unlocked"); | 1762 | print_testname("spinlock nest unlocked"); |
1763 | dotest(ww_test_spin_nest_unlocked, FAILURE, LOCKTYPE_WW); | 1763 | dotest(ww_test_spin_nest_unlocked, FAILURE, LOCKTYPE_WW); |
1764 | printk("\n"); | 1764 | pr_cont("\n"); |
1765 | 1765 | ||
1766 | printk(" -----------------------------------------------------\n"); | 1766 | printk(" -----------------------------------------------------\n"); |
1767 | printk(" |block | try |context|\n"); | 1767 | printk(" |block | try |context|\n"); |
@@ -1771,25 +1771,25 @@ static void ww_tests(void) | |||
1771 | dotest(ww_test_context_block, FAILURE, LOCKTYPE_WW); | 1771 | dotest(ww_test_context_block, FAILURE, LOCKTYPE_WW); |
1772 | dotest(ww_test_context_try, SUCCESS, LOCKTYPE_WW); | 1772 | dotest(ww_test_context_try, SUCCESS, LOCKTYPE_WW); |
1773 | dotest(ww_test_context_context, SUCCESS, LOCKTYPE_WW); | 1773 | dotest(ww_test_context_context, SUCCESS, LOCKTYPE_WW); |
1774 | printk("\n"); | 1774 | pr_cont("\n"); |
1775 | 1775 | ||
1776 | print_testname("try"); | 1776 | print_testname("try"); |
1777 | dotest(ww_test_try_block, FAILURE, LOCKTYPE_WW); | 1777 | dotest(ww_test_try_block, FAILURE, LOCKTYPE_WW); |
1778 | dotest(ww_test_try_try, SUCCESS, LOCKTYPE_WW); | 1778 | dotest(ww_test_try_try, SUCCESS, LOCKTYPE_WW); |
1779 | dotest(ww_test_try_context, FAILURE, LOCKTYPE_WW); | 1779 | dotest(ww_test_try_context, FAILURE, LOCKTYPE_WW); |
1780 | printk("\n"); | 1780 | pr_cont("\n"); |
1781 | 1781 | ||
1782 | print_testname("block"); | 1782 | print_testname("block"); |
1783 | dotest(ww_test_block_block, FAILURE, LOCKTYPE_WW); | 1783 | dotest(ww_test_block_block, FAILURE, LOCKTYPE_WW); |
1784 | dotest(ww_test_block_try, SUCCESS, LOCKTYPE_WW); | 1784 | dotest(ww_test_block_try, SUCCESS, LOCKTYPE_WW); |
1785 | dotest(ww_test_block_context, FAILURE, LOCKTYPE_WW); | 1785 | dotest(ww_test_block_context, FAILURE, LOCKTYPE_WW); |
1786 | printk("\n"); | 1786 | pr_cont("\n"); |
1787 | 1787 | ||
1788 | print_testname("spinlock"); | 1788 | print_testname("spinlock"); |
1789 | dotest(ww_test_spin_block, FAILURE, LOCKTYPE_WW); | 1789 | dotest(ww_test_spin_block, FAILURE, LOCKTYPE_WW); |
1790 | dotest(ww_test_spin_try, SUCCESS, LOCKTYPE_WW); | 1790 | dotest(ww_test_spin_try, SUCCESS, LOCKTYPE_WW); |
1791 | dotest(ww_test_spin_context, FAILURE, LOCKTYPE_WW); | 1791 | dotest(ww_test_spin_context, FAILURE, LOCKTYPE_WW); |
1792 | printk("\n"); | 1792 | pr_cont("\n"); |
1793 | } | 1793 | } |
1794 | 1794 | ||
1795 | void locking_selftest(void) | 1795 | void locking_selftest(void) |
@@ -1829,32 +1829,32 @@ void locking_selftest(void) | |||
1829 | 1829 | ||
1830 | printk(" --------------------------------------------------------------------------\n"); | 1830 | printk(" --------------------------------------------------------------------------\n"); |
1831 | print_testname("recursive read-lock"); | 1831 | print_testname("recursive read-lock"); |
1832 | printk(" |"); | 1832 | pr_cont(" |"); |
1833 | dotest(rlock_AA1, SUCCESS, LOCKTYPE_RWLOCK); | 1833 | dotest(rlock_AA1, SUCCESS, LOCKTYPE_RWLOCK); |
1834 | printk(" |"); | 1834 | pr_cont(" |"); |
1835 | dotest(rsem_AA1, FAILURE, LOCKTYPE_RWSEM); | 1835 | dotest(rsem_AA1, FAILURE, LOCKTYPE_RWSEM); |
1836 | printk("\n"); | 1836 | pr_cont("\n"); |
1837 | 1837 | ||
1838 | print_testname("recursive read-lock #2"); | 1838 | print_testname("recursive read-lock #2"); |
1839 | printk(" |"); | 1839 | pr_cont(" |"); |
1840 | dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK); | 1840 | dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK); |
1841 | printk(" |"); | 1841 | pr_cont(" |"); |
1842 | dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM); | 1842 | dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM); |
1843 | printk("\n"); | 1843 | pr_cont("\n"); |
1844 | 1844 | ||
1845 | print_testname("mixed read-write-lock"); | 1845 | print_testname("mixed read-write-lock"); |
1846 | printk(" |"); | 1846 | pr_cont(" |"); |
1847 | dotest(rlock_AA2, FAILURE, LOCKTYPE_RWLOCK); | 1847 | dotest(rlock_AA2, FAILURE, LOCKTYPE_RWLOCK); |
1848 | printk(" |"); | 1848 | pr_cont(" |"); |
1849 | dotest(rsem_AA2, FAILURE, LOCKTYPE_RWSEM); | 1849 | dotest(rsem_AA2, FAILURE, LOCKTYPE_RWSEM); |
1850 | printk("\n"); | 1850 | pr_cont("\n"); |
1851 | 1851 | ||
1852 | print_testname("mixed write-read-lock"); | 1852 | print_testname("mixed write-read-lock"); |
1853 | printk(" |"); | 1853 | pr_cont(" |"); |
1854 | dotest(rlock_AA3, FAILURE, LOCKTYPE_RWLOCK); | 1854 | dotest(rlock_AA3, FAILURE, LOCKTYPE_RWLOCK); |
1855 | printk(" |"); | 1855 | pr_cont(" |"); |
1856 | dotest(rsem_AA3, FAILURE, LOCKTYPE_RWSEM); | 1856 | dotest(rsem_AA3, FAILURE, LOCKTYPE_RWSEM); |
1857 | printk("\n"); | 1857 | pr_cont("\n"); |
1858 | 1858 | ||
1859 | printk(" --------------------------------------------------------------------------\n"); | 1859 | printk(" --------------------------------------------------------------------------\n"); |
1860 | 1860 | ||
diff --git a/mm/shmem.c b/mm/shmem.c index 166ebf5d2bce..9d32e1cb9f38 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -1848,6 +1848,18 @@ unlock: | |||
1848 | return error; | 1848 | return error; |
1849 | } | 1849 | } |
1850 | 1850 | ||
1851 | /* | ||
1852 | * This is like autoremove_wake_function, but it removes the wait queue | ||
1853 | * entry unconditionally - even if something else had already woken the | ||
1854 | * target. | ||
1855 | */ | ||
1856 | static int synchronous_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key) | ||
1857 | { | ||
1858 | int ret = default_wake_function(wait, mode, sync, key); | ||
1859 | list_del_init(&wait->task_list); | ||
1860 | return ret; | ||
1861 | } | ||
1862 | |||
1851 | static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | 1863 | static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) |
1852 | { | 1864 | { |
1853 | struct inode *inode = file_inode(vma->vm_file); | 1865 | struct inode *inode = file_inode(vma->vm_file); |
@@ -1883,7 +1895,7 @@ static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1883 | vmf->pgoff >= shmem_falloc->start && | 1895 | vmf->pgoff >= shmem_falloc->start && |
1884 | vmf->pgoff < shmem_falloc->next) { | 1896 | vmf->pgoff < shmem_falloc->next) { |
1885 | wait_queue_head_t *shmem_falloc_waitq; | 1897 | wait_queue_head_t *shmem_falloc_waitq; |
1886 | DEFINE_WAIT(shmem_fault_wait); | 1898 | DEFINE_WAIT_FUNC(shmem_fault_wait, synchronous_wake_function); |
1887 | 1899 | ||
1888 | ret = VM_FAULT_NOPAGE; | 1900 | ret = VM_FAULT_NOPAGE; |
1889 | if ((vmf->flags & FAULT_FLAG_ALLOW_RETRY) && | 1901 | if ((vmf->flags & FAULT_FLAG_ALLOW_RETRY) && |
@@ -2665,6 +2677,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, | |||
2665 | spin_lock(&inode->i_lock); | 2677 | spin_lock(&inode->i_lock); |
2666 | inode->i_private = NULL; | 2678 | inode->i_private = NULL; |
2667 | wake_up_all(&shmem_falloc_waitq); | 2679 | wake_up_all(&shmem_falloc_waitq); |
2680 | WARN_ON_ONCE(!list_empty(&shmem_falloc_waitq.task_list)); | ||
2668 | spin_unlock(&inode->i_lock); | 2681 | spin_unlock(&inode->i_lock); |
2669 | error = 0; | 2682 | error = 0; |
2670 | goto out; | 2683 | goto out; |
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 7f663092f6de..0dc85eb1cb7a 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -3282,7 +3282,7 @@ static bool batadv_send_my_tt_response(struct batadv_priv *bat_priv, | |||
3282 | &tvlv_tt_data, | 3282 | &tvlv_tt_data, |
3283 | &tt_change, | 3283 | &tt_change, |
3284 | &tt_len); | 3284 | &tt_len); |
3285 | if (!tt_len) | 3285 | if (!tt_len || !tvlv_len) |
3286 | goto unlock; | 3286 | goto unlock; |
3287 | 3287 | ||
3288 | /* Copy the last orig_node's OGM buffer */ | 3288 | /* Copy the last orig_node's OGM buffer */ |
@@ -3300,7 +3300,7 @@ static bool batadv_send_my_tt_response(struct batadv_priv *bat_priv, | |||
3300 | &tvlv_tt_data, | 3300 | &tvlv_tt_data, |
3301 | &tt_change, | 3301 | &tt_change, |
3302 | &tt_len); | 3302 | &tt_len); |
3303 | if (!tt_len) | 3303 | if (!tt_len || !tvlv_len) |
3304 | goto out; | 3304 | goto out; |
3305 | 3305 | ||
3306 | /* fill the rest of the tvlv with the real TT entries */ | 3306 | /* fill the rest of the tvlv with the real TT entries */ |
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index e120307c6e36..f88c4df3f91e 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -898,6 +898,7 @@ int br_sysfs_addbr(struct net_device *dev) | |||
898 | if (!br->ifobj) { | 898 | if (!br->ifobj) { |
899 | pr_info("%s: can't add kobject (directory) %s/%s\n", | 899 | pr_info("%s: can't add kobject (directory) %s/%s\n", |
900 | __func__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR); | 900 | __func__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR); |
901 | err = -ENOMEM; | ||
901 | goto out3; | 902 | goto out3; |
902 | } | 903 | } |
903 | return 0; | 904 | return 0; |
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index aa209b1066c9..92cbbd2afddb 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -1107,10 +1107,7 @@ static struct net_proto_family caif_family_ops = { | |||
1107 | 1107 | ||
1108 | static int __init caif_sktinit_module(void) | 1108 | static int __init caif_sktinit_module(void) |
1109 | { | 1109 | { |
1110 | int err = sock_register(&caif_family_ops); | 1110 | return sock_register(&caif_family_ops); |
1111 | if (!err) | ||
1112 | return err; | ||
1113 | return 0; | ||
1114 | } | 1111 | } |
1115 | 1112 | ||
1116 | static void __exit caif_sktexit_module(void) | 1113 | static void __exit caif_sktexit_module(void) |
diff --git a/net/can/raw.c b/net/can/raw.c index 972c187d40ab..b075f028d7e2 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -499,6 +499,9 @@ static int raw_setsockopt(struct socket *sock, int level, int optname, | |||
499 | if (optlen % sizeof(struct can_filter) != 0) | 499 | if (optlen % sizeof(struct can_filter) != 0) |
500 | return -EINVAL; | 500 | return -EINVAL; |
501 | 501 | ||
502 | if (optlen > CAN_RAW_FILTER_MAX * sizeof(struct can_filter)) | ||
503 | return -EINVAL; | ||
504 | |||
502 | count = optlen / sizeof(struct can_filter); | 505 | count = optlen / sizeof(struct can_filter); |
503 | 506 | ||
504 | if (count > 1) { | 507 | if (count > 1) { |
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 4f6c1862dfd2..3202d75329b5 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c | |||
@@ -1353,6 +1353,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev) | |||
1353 | dcb_unlock: | 1353 | dcb_unlock: |
1354 | spin_unlock_bh(&dcb_lock); | 1354 | spin_unlock_bh(&dcb_lock); |
1355 | nla_put_failure: | 1355 | nla_put_failure: |
1356 | err = -EMSGSIZE; | ||
1356 | return err; | 1357 | return err; |
1357 | } | 1358 | } |
1358 | 1359 | ||
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 026f309c51e9..e3665bf7a7f3 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -719,6 +719,13 @@ static unsigned char update_suffix(struct key_vector *tn) | |||
719 | { | 719 | { |
720 | unsigned char slen = tn->pos; | 720 | unsigned char slen = tn->pos; |
721 | unsigned long stride, i; | 721 | unsigned long stride, i; |
722 | unsigned char slen_max; | ||
723 | |||
724 | /* only vector 0 can have a suffix length greater than or equal to | ||
725 | * tn->pos + tn->bits, the second highest node will have a suffix | ||
726 | * length at most of tn->pos + tn->bits - 1 | ||
727 | */ | ||
728 | slen_max = min_t(unsigned char, tn->pos + tn->bits - 1, tn->slen); | ||
722 | 729 | ||
723 | /* search though the list of children looking for nodes that might | 730 | /* search though the list of children looking for nodes that might |
724 | * have a suffix greater than the one we currently have. This is | 731 | * have a suffix greater than the one we currently have. This is |
@@ -736,12 +743,8 @@ static unsigned char update_suffix(struct key_vector *tn) | |||
736 | slen = n->slen; | 743 | slen = n->slen; |
737 | i &= ~(stride - 1); | 744 | i &= ~(stride - 1); |
738 | 745 | ||
739 | /* if slen covers all but the last bit we can stop here | 746 | /* stop searching if we have hit the maximum possible value */ |
740 | * there will be nothing longer than that since only node | 747 | if (slen >= slen_max) |
741 | * 0 and 1 << (bits - 1) could have that as their suffix | ||
742 | * length. | ||
743 | */ | ||
744 | if ((slen + 1) >= (tn->pos + tn->bits)) | ||
745 | break; | 748 | break; |
746 | } | 749 | } |
747 | 750 | ||
@@ -913,39 +916,27 @@ static struct key_vector *resize(struct trie *t, struct key_vector *tn) | |||
913 | return collapse(t, tn); | 916 | return collapse(t, tn); |
914 | 917 | ||
915 | /* update parent in case halve failed */ | 918 | /* update parent in case halve failed */ |
916 | tp = node_parent(tn); | 919 | return node_parent(tn); |
917 | |||
918 | /* Return if at least one deflate was run */ | ||
919 | if (max_work != MAX_WORK) | ||
920 | return tp; | ||
921 | |||
922 | /* push the suffix length to the parent node */ | ||
923 | if (tn->slen > tn->pos) { | ||
924 | unsigned char slen = update_suffix(tn); | ||
925 | |||
926 | if (slen > tp->slen) | ||
927 | tp->slen = slen; | ||
928 | } | ||
929 | |||
930 | return tp; | ||
931 | } | 920 | } |
932 | 921 | ||
933 | static void leaf_pull_suffix(struct key_vector *tp, struct key_vector *l) | 922 | static void node_pull_suffix(struct key_vector *tn, unsigned char slen) |
934 | { | 923 | { |
935 | while ((tp->slen > tp->pos) && (tp->slen > l->slen)) { | 924 | unsigned char node_slen = tn->slen; |
936 | if (update_suffix(tp) > l->slen) | 925 | |
926 | while ((node_slen > tn->pos) && (node_slen > slen)) { | ||
927 | slen = update_suffix(tn); | ||
928 | if (node_slen == slen) | ||
937 | break; | 929 | break; |
938 | tp = node_parent(tp); | 930 | |
931 | tn = node_parent(tn); | ||
932 | node_slen = tn->slen; | ||
939 | } | 933 | } |
940 | } | 934 | } |
941 | 935 | ||
942 | static void leaf_push_suffix(struct key_vector *tn, struct key_vector *l) | 936 | static void node_push_suffix(struct key_vector *tn, unsigned char slen) |
943 | { | 937 | { |
944 | /* if this is a new leaf then tn will be NULL and we can sort | 938 | while (tn->slen < slen) { |
945 | * out parent suffix lengths as a part of trie_rebalance | 939 | tn->slen = slen; |
946 | */ | ||
947 | while (tn->slen < l->slen) { | ||
948 | tn->slen = l->slen; | ||
949 | tn = node_parent(tn); | 940 | tn = node_parent(tn); |
950 | } | 941 | } |
951 | } | 942 | } |
@@ -1066,6 +1057,7 @@ static int fib_insert_node(struct trie *t, struct key_vector *tp, | |||
1066 | } | 1057 | } |
1067 | 1058 | ||
1068 | /* Case 3: n is NULL, and will just insert a new leaf */ | 1059 | /* Case 3: n is NULL, and will just insert a new leaf */ |
1060 | node_push_suffix(tp, new->fa_slen); | ||
1069 | NODE_INIT_PARENT(l, tp); | 1061 | NODE_INIT_PARENT(l, tp); |
1070 | put_child_root(tp, key, l); | 1062 | put_child_root(tp, key, l); |
1071 | trie_rebalance(t, tp); | 1063 | trie_rebalance(t, tp); |
@@ -1107,7 +1099,7 @@ static int fib_insert_alias(struct trie *t, struct key_vector *tp, | |||
1107 | /* if we added to the tail node then we need to update slen */ | 1099 | /* if we added to the tail node then we need to update slen */ |
1108 | if (l->slen < new->fa_slen) { | 1100 | if (l->slen < new->fa_slen) { |
1109 | l->slen = new->fa_slen; | 1101 | l->slen = new->fa_slen; |
1110 | leaf_push_suffix(tp, l); | 1102 | node_push_suffix(tp, new->fa_slen); |
1111 | } | 1103 | } |
1112 | 1104 | ||
1113 | return 0; | 1105 | return 0; |
@@ -1499,6 +1491,8 @@ static void fib_remove_alias(struct trie *t, struct key_vector *tp, | |||
1499 | * out parent suffix lengths as a part of trie_rebalance | 1491 | * out parent suffix lengths as a part of trie_rebalance |
1500 | */ | 1492 | */ |
1501 | if (hlist_empty(&l->leaf)) { | 1493 | if (hlist_empty(&l->leaf)) { |
1494 | if (tp->slen == l->slen) | ||
1495 | node_pull_suffix(tp, tp->pos); | ||
1502 | put_child_root(tp, l->key, NULL); | 1496 | put_child_root(tp, l->key, NULL); |
1503 | node_free(l); | 1497 | node_free(l); |
1504 | trie_rebalance(t, tp); | 1498 | trie_rebalance(t, tp); |
@@ -1511,7 +1505,7 @@ static void fib_remove_alias(struct trie *t, struct key_vector *tp, | |||
1511 | 1505 | ||
1512 | /* update the trie with the latest suffix length */ | 1506 | /* update the trie with the latest suffix length */ |
1513 | l->slen = fa->fa_slen; | 1507 | l->slen = fa->fa_slen; |
1514 | leaf_pull_suffix(tp, l); | 1508 | node_pull_suffix(tp, fa->fa_slen); |
1515 | } | 1509 | } |
1516 | 1510 | ||
1517 | /* Caller must hold RTNL. */ | 1511 | /* Caller must hold RTNL. */ |
@@ -1783,6 +1777,10 @@ void fib_table_flush_external(struct fib_table *tb) | |||
1783 | if (IS_TRIE(pn)) | 1777 | if (IS_TRIE(pn)) |
1784 | break; | 1778 | break; |
1785 | 1779 | ||
1780 | /* update the suffix to address pulled leaves */ | ||
1781 | if (pn->slen > pn->pos) | ||
1782 | update_suffix(pn); | ||
1783 | |||
1786 | /* resize completed node */ | 1784 | /* resize completed node */ |
1787 | pn = resize(t, pn); | 1785 | pn = resize(t, pn); |
1788 | cindex = get_index(pkey, pn); | 1786 | cindex = get_index(pkey, pn); |
@@ -1849,6 +1847,10 @@ int fib_table_flush(struct net *net, struct fib_table *tb) | |||
1849 | if (IS_TRIE(pn)) | 1847 | if (IS_TRIE(pn)) |
1850 | break; | 1848 | break; |
1851 | 1849 | ||
1850 | /* update the suffix to address pulled leaves */ | ||
1851 | if (pn->slen > pn->pos) | ||
1852 | update_suffix(pn); | ||
1853 | |||
1852 | /* resize completed node */ | 1854 | /* resize completed node */ |
1853 | pn = resize(t, pn); | 1855 | pn = resize(t, pn); |
1854 | cindex = get_index(pkey, pn); | 1856 | cindex = get_index(pkey, pn); |
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 205e2000d395..96b8e2b95731 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -657,6 +657,10 @@ int ping_common_sendmsg(int family, struct msghdr *msg, size_t len, | |||
657 | if (len > 0xFFFF) | 657 | if (len > 0xFFFF) |
658 | return -EMSGSIZE; | 658 | return -EMSGSIZE; |
659 | 659 | ||
660 | /* Must have at least a full ICMP header. */ | ||
661 | if (len < icmph_len) | ||
662 | return -EINVAL; | ||
663 | |||
660 | /* | 664 | /* |
661 | * Check the flags. | 665 | * Check the flags. |
662 | */ | 666 | */ |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a27b9c0e27c0..c71d49ce0c93 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -128,6 +128,23 @@ int sysctl_tcp_invalid_ratelimit __read_mostly = HZ/2; | |||
128 | #define REXMIT_LOST 1 /* retransmit packets marked lost */ | 128 | #define REXMIT_LOST 1 /* retransmit packets marked lost */ |
129 | #define REXMIT_NEW 2 /* FRTO-style transmit of unsent/new packets */ | 129 | #define REXMIT_NEW 2 /* FRTO-style transmit of unsent/new packets */ |
130 | 130 | ||
131 | static void tcp_gro_dev_warn(struct sock *sk, const struct sk_buff *skb) | ||
132 | { | ||
133 | static bool __once __read_mostly; | ||
134 | |||
135 | if (!__once) { | ||
136 | struct net_device *dev; | ||
137 | |||
138 | __once = true; | ||
139 | |||
140 | rcu_read_lock(); | ||
141 | dev = dev_get_by_index_rcu(sock_net(sk), skb->skb_iif); | ||
142 | pr_warn("%s: Driver has suspect GRO implementation, TCP performance may be compromised.\n", | ||
143 | dev ? dev->name : "Unknown driver"); | ||
144 | rcu_read_unlock(); | ||
145 | } | ||
146 | } | ||
147 | |||
131 | /* Adapt the MSS value used to make delayed ack decision to the | 148 | /* Adapt the MSS value used to make delayed ack decision to the |
132 | * real world. | 149 | * real world. |
133 | */ | 150 | */ |
@@ -144,7 +161,10 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb) | |||
144 | */ | 161 | */ |
145 | len = skb_shinfo(skb)->gso_size ? : skb->len; | 162 | len = skb_shinfo(skb)->gso_size ? : skb->len; |
146 | if (len >= icsk->icsk_ack.rcv_mss) { | 163 | if (len >= icsk->icsk_ack.rcv_mss) { |
147 | icsk->icsk_ack.rcv_mss = len; | 164 | icsk->icsk_ack.rcv_mss = min_t(unsigned int, len, |
165 | tcp_sk(sk)->advmss); | ||
166 | if (unlikely(icsk->icsk_ack.rcv_mss != len)) | ||
167 | tcp_gro_dev_warn(sk, skb); | ||
148 | } else { | 168 | } else { |
149 | /* Otherwise, we make more careful check taking into account, | 169 | /* Otherwise, we make more careful check taking into account, |
150 | * that SACKs block is variable. | 170 | * that SACKs block is variable. |
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 0e4334cbde17..15fe97644ffe 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c | |||
@@ -1252,7 +1252,7 @@ static int rtm_to_route_config(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1252 | if (!nla) | 1252 | if (!nla) |
1253 | continue; | 1253 | continue; |
1254 | 1254 | ||
1255 | switch(index) { | 1255 | switch (index) { |
1256 | case RTA_OIF: | 1256 | case RTA_OIF: |
1257 | cfg->rc_ifindex = nla_get_u32(nla); | 1257 | cfg->rc_ifindex = nla_get_u32(nla); |
1258 | break; | 1258 | break; |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 602e5ebe9db3..246f29d365c0 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -322,11 +322,13 @@ static void netlink_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
322 | sk_mem_charge(sk, skb->truesize); | 322 | sk_mem_charge(sk, skb->truesize); |
323 | } | 323 | } |
324 | 324 | ||
325 | static void __netlink_sock_destruct(struct sock *sk) | 325 | static void netlink_sock_destruct(struct sock *sk) |
326 | { | 326 | { |
327 | struct netlink_sock *nlk = nlk_sk(sk); | 327 | struct netlink_sock *nlk = nlk_sk(sk); |
328 | 328 | ||
329 | if (nlk->cb_running) { | 329 | if (nlk->cb_running) { |
330 | if (nlk->cb.done) | ||
331 | nlk->cb.done(&nlk->cb); | ||
330 | module_put(nlk->cb.module); | 332 | module_put(nlk->cb.module); |
331 | kfree_skb(nlk->cb.skb); | 333 | kfree_skb(nlk->cb.skb); |
332 | } | 334 | } |
@@ -348,21 +350,7 @@ static void netlink_sock_destruct_work(struct work_struct *work) | |||
348 | struct netlink_sock *nlk = container_of(work, struct netlink_sock, | 350 | struct netlink_sock *nlk = container_of(work, struct netlink_sock, |
349 | work); | 351 | work); |
350 | 352 | ||
351 | nlk->cb.done(&nlk->cb); | 353 | sk_free(&nlk->sk); |
352 | __netlink_sock_destruct(&nlk->sk); | ||
353 | } | ||
354 | |||
355 | static void netlink_sock_destruct(struct sock *sk) | ||
356 | { | ||
357 | struct netlink_sock *nlk = nlk_sk(sk); | ||
358 | |||
359 | if (nlk->cb_running && nlk->cb.done) { | ||
360 | INIT_WORK(&nlk->work, netlink_sock_destruct_work); | ||
361 | schedule_work(&nlk->work); | ||
362 | return; | ||
363 | } | ||
364 | |||
365 | __netlink_sock_destruct(sk); | ||
366 | } | 354 | } |
367 | 355 | ||
368 | /* This lock without WQ_FLAG_EXCLUSIVE is good on UP and it is _very_ bad on | 356 | /* This lock without WQ_FLAG_EXCLUSIVE is good on UP and it is _very_ bad on |
@@ -667,8 +655,18 @@ out_module: | |||
667 | static void deferred_put_nlk_sk(struct rcu_head *head) | 655 | static void deferred_put_nlk_sk(struct rcu_head *head) |
668 | { | 656 | { |
669 | struct netlink_sock *nlk = container_of(head, struct netlink_sock, rcu); | 657 | struct netlink_sock *nlk = container_of(head, struct netlink_sock, rcu); |
658 | struct sock *sk = &nlk->sk; | ||
659 | |||
660 | if (!atomic_dec_and_test(&sk->sk_refcnt)) | ||
661 | return; | ||
662 | |||
663 | if (nlk->cb_running && nlk->cb.done) { | ||
664 | INIT_WORK(&nlk->work, netlink_sock_destruct_work); | ||
665 | schedule_work(&nlk->work); | ||
666 | return; | ||
667 | } | ||
670 | 668 | ||
671 | sock_put(&nlk->sk); | 669 | sk_free(sk); |
672 | } | 670 | } |
673 | 671 | ||
674 | static int netlink_release(struct socket *sock) | 672 | static int netlink_release(struct socket *sock) |
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index 3fe4468ea2c5..52063b262667 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -1702,7 +1702,7 @@ interrupts are disabled. | |||
1702 | static void xmit_descs(struct snd_dbri *dbri) | 1702 | static void xmit_descs(struct snd_dbri *dbri) |
1703 | { | 1703 | { |
1704 | struct dbri_streaminfo *info; | 1704 | struct dbri_streaminfo *info; |
1705 | u32 dvma_addr = (u32)dbri->dma_dvma; | 1705 | u32 dvma_addr; |
1706 | s32 *cmd; | 1706 | s32 *cmd; |
1707 | unsigned long flags; | 1707 | unsigned long flags; |
1708 | int first_td; | 1708 | int first_td; |
@@ -1710,6 +1710,7 @@ static void xmit_descs(struct snd_dbri *dbri) | |||
1710 | if (dbri == NULL) | 1710 | if (dbri == NULL) |
1711 | return; /* Disabled */ | 1711 | return; /* Disabled */ |
1712 | 1712 | ||
1713 | dvma_addr = (u32)dbri->dma_dvma; | ||
1713 | info = &dbri->stream_info[DBRI_REC]; | 1714 | info = &dbri->stream_info[DBRI_REC]; |
1714 | spin_lock_irqsave(&dbri->lock, flags); | 1715 | spin_lock_irqsave(&dbri->lock, flags); |
1715 | 1716 | ||
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index b63a31be1218..5e0dea2cdc01 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c | |||
@@ -99,7 +99,7 @@ int arch_decode_instruction(struct elf *elf, struct section *sec, | |||
99 | break; | 99 | break; |
100 | 100 | ||
101 | case 0x8d: | 101 | case 0x8d: |
102 | if (insn.rex_prefix.bytes && | 102 | if (insn.rex_prefix.nbytes && |
103 | insn.rex_prefix.bytes[0] == 0x48 && | 103 | insn.rex_prefix.bytes[0] == 0x48 && |
104 | insn.modrm.nbytes && insn.modrm.bytes[0] == 0x2c && | 104 | insn.modrm.nbytes && insn.modrm.bytes[0] == 0x2c && |
105 | insn.sib.nbytes && insn.sib.bytes[0] == 0x24) | 105 | insn.sib.nbytes && insn.sib.bytes[0] == 0x24) |
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild index 582db95127ed..405212be044a 100644 --- a/tools/testing/nvdimm/Kbuild +++ b/tools/testing/nvdimm/Kbuild | |||
@@ -14,6 +14,7 @@ ldflags-y += --wrap=devm_memremap_pages | |||
14 | ldflags-y += --wrap=insert_resource | 14 | ldflags-y += --wrap=insert_resource |
15 | ldflags-y += --wrap=remove_resource | 15 | ldflags-y += --wrap=remove_resource |
16 | ldflags-y += --wrap=acpi_evaluate_object | 16 | ldflags-y += --wrap=acpi_evaluate_object |
17 | ldflags-y += --wrap=acpi_evaluate_dsm | ||
17 | 18 | ||
18 | DRIVERS := ../../../drivers | 19 | DRIVERS := ../../../drivers |
19 | NVDIMM_SRC := $(DRIVERS)/nvdimm | 20 | NVDIMM_SRC := $(DRIVERS)/nvdimm |
diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c index 3ccef732fce9..64cae1a5deff 100644 --- a/tools/testing/nvdimm/test/iomap.c +++ b/tools/testing/nvdimm/test/iomap.c | |||
@@ -26,14 +26,17 @@ static LIST_HEAD(iomap_head); | |||
26 | 26 | ||
27 | static struct iomap_ops { | 27 | static struct iomap_ops { |
28 | nfit_test_lookup_fn nfit_test_lookup; | 28 | nfit_test_lookup_fn nfit_test_lookup; |
29 | nfit_test_evaluate_dsm_fn evaluate_dsm; | ||
29 | struct list_head list; | 30 | struct list_head list; |
30 | } iomap_ops = { | 31 | } iomap_ops = { |
31 | .list = LIST_HEAD_INIT(iomap_ops.list), | 32 | .list = LIST_HEAD_INIT(iomap_ops.list), |
32 | }; | 33 | }; |
33 | 34 | ||
34 | void nfit_test_setup(nfit_test_lookup_fn lookup) | 35 | void nfit_test_setup(nfit_test_lookup_fn lookup, |
36 | nfit_test_evaluate_dsm_fn evaluate) | ||
35 | { | 37 | { |
36 | iomap_ops.nfit_test_lookup = lookup; | 38 | iomap_ops.nfit_test_lookup = lookup; |
39 | iomap_ops.evaluate_dsm = evaluate; | ||
37 | list_add_rcu(&iomap_ops.list, &iomap_head); | 40 | list_add_rcu(&iomap_ops.list, &iomap_head); |
38 | } | 41 | } |
39 | EXPORT_SYMBOL(nfit_test_setup); | 42 | EXPORT_SYMBOL(nfit_test_setup); |
@@ -367,4 +370,22 @@ acpi_status __wrap_acpi_evaluate_object(acpi_handle handle, acpi_string path, | |||
367 | } | 370 | } |
368 | EXPORT_SYMBOL(__wrap_acpi_evaluate_object); | 371 | EXPORT_SYMBOL(__wrap_acpi_evaluate_object); |
369 | 372 | ||
373 | union acpi_object * __wrap_acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, | ||
374 | u64 rev, u64 func, union acpi_object *argv4) | ||
375 | { | ||
376 | union acpi_object *obj = ERR_PTR(-ENXIO); | ||
377 | struct iomap_ops *ops; | ||
378 | |||
379 | rcu_read_lock(); | ||
380 | ops = list_first_or_null_rcu(&iomap_head, typeof(*ops), list); | ||
381 | if (ops) | ||
382 | obj = ops->evaluate_dsm(handle, uuid, rev, func, argv4); | ||
383 | rcu_read_unlock(); | ||
384 | |||
385 | if (IS_ERR(obj)) | ||
386 | return acpi_evaluate_dsm(handle, uuid, rev, func, argv4); | ||
387 | return obj; | ||
388 | } | ||
389 | EXPORT_SYMBOL(__wrap_acpi_evaluate_dsm); | ||
390 | |||
370 | MODULE_LICENSE("GPL v2"); | 391 | MODULE_LICENSE("GPL v2"); |
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index c9a6458cb63e..71620fa95953 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/sizes.h> | 23 | #include <linux/sizes.h> |
24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <nd-core.h> | ||
26 | #include <nfit.h> | 27 | #include <nfit.h> |
27 | #include <nd.h> | 28 | #include <nd.h> |
28 | #include "nfit_test.h" | 29 | #include "nfit_test.h" |
@@ -1506,6 +1507,225 @@ static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa, | |||
1506 | return 0; | 1507 | return 0; |
1507 | } | 1508 | } |
1508 | 1509 | ||
1510 | static unsigned long nfit_ctl_handle; | ||
1511 | |||
1512 | union acpi_object *result; | ||
1513 | |||
1514 | static union acpi_object *nfit_test_evaluate_dsm(acpi_handle handle, | ||
1515 | const u8 *uuid, u64 rev, u64 func, union acpi_object *argv4) | ||
1516 | { | ||
1517 | if (handle != &nfit_ctl_handle) | ||
1518 | return ERR_PTR(-ENXIO); | ||
1519 | |||
1520 | return result; | ||
1521 | } | ||
1522 | |||
1523 | static int setup_result(void *buf, size_t size) | ||
1524 | { | ||
1525 | result = kmalloc(sizeof(union acpi_object) + size, GFP_KERNEL); | ||
1526 | if (!result) | ||
1527 | return -ENOMEM; | ||
1528 | result->package.type = ACPI_TYPE_BUFFER, | ||
1529 | result->buffer.pointer = (void *) (result + 1); | ||
1530 | result->buffer.length = size; | ||
1531 | memcpy(result->buffer.pointer, buf, size); | ||
1532 | memset(buf, 0, size); | ||
1533 | return 0; | ||
1534 | } | ||
1535 | |||
1536 | static int nfit_ctl_test(struct device *dev) | ||
1537 | { | ||
1538 | int rc, cmd_rc; | ||
1539 | struct nvdimm *nvdimm; | ||
1540 | struct acpi_device *adev; | ||
1541 | struct nfit_mem *nfit_mem; | ||
1542 | struct nd_ars_record *record; | ||
1543 | struct acpi_nfit_desc *acpi_desc; | ||
1544 | const u64 test_val = 0x0123456789abcdefULL; | ||
1545 | unsigned long mask, cmd_size, offset; | ||
1546 | union { | ||
1547 | struct nd_cmd_get_config_size cfg_size; | ||
1548 | struct nd_cmd_ars_status ars_stat; | ||
1549 | struct nd_cmd_ars_cap ars_cap; | ||
1550 | char buf[sizeof(struct nd_cmd_ars_status) | ||
1551 | + sizeof(struct nd_ars_record)]; | ||
1552 | } cmds; | ||
1553 | |||
1554 | adev = devm_kzalloc(dev, sizeof(*adev), GFP_KERNEL); | ||
1555 | if (!adev) | ||
1556 | return -ENOMEM; | ||
1557 | *adev = (struct acpi_device) { | ||
1558 | .handle = &nfit_ctl_handle, | ||
1559 | .dev = { | ||
1560 | .init_name = "test-adev", | ||
1561 | }, | ||
1562 | }; | ||
1563 | |||
1564 | acpi_desc = devm_kzalloc(dev, sizeof(*acpi_desc), GFP_KERNEL); | ||
1565 | if (!acpi_desc) | ||
1566 | return -ENOMEM; | ||
1567 | *acpi_desc = (struct acpi_nfit_desc) { | ||
1568 | .nd_desc = { | ||
1569 | .cmd_mask = 1UL << ND_CMD_ARS_CAP | ||
1570 | | 1UL << ND_CMD_ARS_START | ||
1571 | | 1UL << ND_CMD_ARS_STATUS | ||
1572 | | 1UL << ND_CMD_CLEAR_ERROR, | ||
1573 | .module = THIS_MODULE, | ||
1574 | .provider_name = "ACPI.NFIT", | ||
1575 | .ndctl = acpi_nfit_ctl, | ||
1576 | }, | ||
1577 | .dev = &adev->dev, | ||
1578 | }; | ||
1579 | |||
1580 | nfit_mem = devm_kzalloc(dev, sizeof(*nfit_mem), GFP_KERNEL); | ||
1581 | if (!nfit_mem) | ||
1582 | return -ENOMEM; | ||
1583 | |||
1584 | mask = 1UL << ND_CMD_SMART | 1UL << ND_CMD_SMART_THRESHOLD | ||
1585 | | 1UL << ND_CMD_DIMM_FLAGS | 1UL << ND_CMD_GET_CONFIG_SIZE | ||
1586 | | 1UL << ND_CMD_GET_CONFIG_DATA | 1UL << ND_CMD_SET_CONFIG_DATA | ||
1587 | | 1UL << ND_CMD_VENDOR; | ||
1588 | *nfit_mem = (struct nfit_mem) { | ||
1589 | .adev = adev, | ||
1590 | .family = NVDIMM_FAMILY_INTEL, | ||
1591 | .dsm_mask = mask, | ||
1592 | }; | ||
1593 | |||
1594 | nvdimm = devm_kzalloc(dev, sizeof(*nvdimm), GFP_KERNEL); | ||
1595 | if (!nvdimm) | ||
1596 | return -ENOMEM; | ||
1597 | *nvdimm = (struct nvdimm) { | ||
1598 | .provider_data = nfit_mem, | ||
1599 | .cmd_mask = mask, | ||
1600 | .dev = { | ||
1601 | .init_name = "test-dimm", | ||
1602 | }, | ||
1603 | }; | ||
1604 | |||
1605 | |||
1606 | /* basic checkout of a typical 'get config size' command */ | ||
1607 | cmd_size = sizeof(cmds.cfg_size); | ||
1608 | cmds.cfg_size = (struct nd_cmd_get_config_size) { | ||
1609 | .status = 0, | ||
1610 | .config_size = SZ_128K, | ||
1611 | .max_xfer = SZ_4K, | ||
1612 | }; | ||
1613 | rc = setup_result(cmds.buf, cmd_size); | ||
1614 | if (rc) | ||
1615 | return rc; | ||
1616 | rc = acpi_nfit_ctl(&acpi_desc->nd_desc, nvdimm, ND_CMD_GET_CONFIG_SIZE, | ||
1617 | cmds.buf, cmd_size, &cmd_rc); | ||
1618 | |||
1619 | if (rc < 0 || cmd_rc || cmds.cfg_size.status != 0 | ||
1620 | || cmds.cfg_size.config_size != SZ_128K | ||
1621 | || cmds.cfg_size.max_xfer != SZ_4K) { | ||
1622 | dev_dbg(dev, "%s: failed at: %d rc: %d cmd_rc: %d\n", | ||
1623 | __func__, __LINE__, rc, cmd_rc); | ||
1624 | return -EIO; | ||
1625 | } | ||
1626 | |||
1627 | |||
1628 | /* test ars_status with zero output */ | ||
1629 | cmd_size = offsetof(struct nd_cmd_ars_status, address); | ||
1630 | cmds.ars_stat = (struct nd_cmd_ars_status) { | ||
1631 | .out_length = 0, | ||
1632 | }; | ||
1633 | rc = setup_result(cmds.buf, cmd_size); | ||
1634 | if (rc) | ||
1635 | return rc; | ||
1636 | rc = acpi_nfit_ctl(&acpi_desc->nd_desc, NULL, ND_CMD_ARS_STATUS, | ||
1637 | cmds.buf, cmd_size, &cmd_rc); | ||
1638 | |||
1639 | if (rc < 0 || cmd_rc) { | ||
1640 | dev_dbg(dev, "%s: failed at: %d rc: %d cmd_rc: %d\n", | ||
1641 | __func__, __LINE__, rc, cmd_rc); | ||
1642 | return -EIO; | ||
1643 | } | ||
1644 | |||
1645 | |||
1646 | /* test ars_cap with benign extended status */ | ||
1647 | cmd_size = sizeof(cmds.ars_cap); | ||
1648 | cmds.ars_cap = (struct nd_cmd_ars_cap) { | ||
1649 | .status = ND_ARS_PERSISTENT << 16, | ||
1650 | }; | ||
1651 | offset = offsetof(struct nd_cmd_ars_cap, status); | ||
1652 | rc = setup_result(cmds.buf + offset, cmd_size - offset); | ||
1653 | if (rc) | ||
1654 | return rc; | ||
1655 | rc = acpi_nfit_ctl(&acpi_desc->nd_desc, NULL, ND_CMD_ARS_CAP, | ||
1656 | cmds.buf, cmd_size, &cmd_rc); | ||
1657 | |||
1658 | if (rc < 0 || cmd_rc) { | ||
1659 | dev_dbg(dev, "%s: failed at: %d rc: %d cmd_rc: %d\n", | ||
1660 | __func__, __LINE__, rc, cmd_rc); | ||
1661 | return -EIO; | ||
1662 | } | ||
1663 | |||
1664 | |||
1665 | /* test ars_status with 'status' trimmed from 'out_length' */ | ||
1666 | cmd_size = sizeof(cmds.ars_stat) + sizeof(struct nd_ars_record); | ||
1667 | cmds.ars_stat = (struct nd_cmd_ars_status) { | ||
1668 | .out_length = cmd_size - 4, | ||
1669 | }; | ||
1670 | record = &cmds.ars_stat.records[0]; | ||
1671 | *record = (struct nd_ars_record) { | ||
1672 | .length = test_val, | ||
1673 | }; | ||
1674 | rc = setup_result(cmds.buf, cmd_size); | ||
1675 | if (rc) | ||
1676 | return rc; | ||
1677 | rc = acpi_nfit_ctl(&acpi_desc->nd_desc, NULL, ND_CMD_ARS_STATUS, | ||
1678 | cmds.buf, cmd_size, &cmd_rc); | ||
1679 | |||
1680 | if (rc < 0 || cmd_rc || record->length != test_val) { | ||
1681 | dev_dbg(dev, "%s: failed at: %d rc: %d cmd_rc: %d\n", | ||
1682 | __func__, __LINE__, rc, cmd_rc); | ||
1683 | return -EIO; | ||
1684 | } | ||
1685 | |||
1686 | |||
1687 | /* test ars_status with 'Output (Size)' including 'status' */ | ||
1688 | cmd_size = sizeof(cmds.ars_stat) + sizeof(struct nd_ars_record); | ||
1689 | cmds.ars_stat = (struct nd_cmd_ars_status) { | ||
1690 | .out_length = cmd_size, | ||
1691 | }; | ||
1692 | record = &cmds.ars_stat.records[0]; | ||
1693 | *record = (struct nd_ars_record) { | ||
1694 | .length = test_val, | ||
1695 | }; | ||
1696 | rc = setup_result(cmds.buf, cmd_size); | ||
1697 | if (rc) | ||
1698 | return rc; | ||
1699 | rc = acpi_nfit_ctl(&acpi_desc->nd_desc, NULL, ND_CMD_ARS_STATUS, | ||
1700 | cmds.buf, cmd_size, &cmd_rc); | ||
1701 | |||
1702 | if (rc < 0 || cmd_rc || record->length != test_val) { | ||
1703 | dev_dbg(dev, "%s: failed at: %d rc: %d cmd_rc: %d\n", | ||
1704 | __func__, __LINE__, rc, cmd_rc); | ||
1705 | return -EIO; | ||
1706 | } | ||
1707 | |||
1708 | |||
1709 | /* test extended status for get_config_size results in failure */ | ||
1710 | cmd_size = sizeof(cmds.cfg_size); | ||
1711 | cmds.cfg_size = (struct nd_cmd_get_config_size) { | ||
1712 | .status = 1 << 16, | ||
1713 | }; | ||
1714 | rc = setup_result(cmds.buf, cmd_size); | ||
1715 | if (rc) | ||
1716 | return rc; | ||
1717 | rc = acpi_nfit_ctl(&acpi_desc->nd_desc, nvdimm, ND_CMD_GET_CONFIG_SIZE, | ||
1718 | cmds.buf, cmd_size, &cmd_rc); | ||
1719 | |||
1720 | if (rc < 0 || cmd_rc >= 0) { | ||
1721 | dev_dbg(dev, "%s: failed at: %d rc: %d cmd_rc: %d\n", | ||
1722 | __func__, __LINE__, rc, cmd_rc); | ||
1723 | return -EIO; | ||
1724 | } | ||
1725 | |||
1726 | return 0; | ||
1727 | } | ||
1728 | |||
1509 | static int nfit_test_probe(struct platform_device *pdev) | 1729 | static int nfit_test_probe(struct platform_device *pdev) |
1510 | { | 1730 | { |
1511 | struct nvdimm_bus_descriptor *nd_desc; | 1731 | struct nvdimm_bus_descriptor *nd_desc; |
@@ -1516,6 +1736,12 @@ static int nfit_test_probe(struct platform_device *pdev) | |||
1516 | union acpi_object *obj; | 1736 | union acpi_object *obj; |
1517 | int rc; | 1737 | int rc; |
1518 | 1738 | ||
1739 | if (strcmp(dev_name(&pdev->dev), "nfit_test.0") == 0) { | ||
1740 | rc = nfit_ctl_test(&pdev->dev); | ||
1741 | if (rc) | ||
1742 | return rc; | ||
1743 | } | ||
1744 | |||
1519 | nfit_test = to_nfit_test(&pdev->dev); | 1745 | nfit_test = to_nfit_test(&pdev->dev); |
1520 | 1746 | ||
1521 | /* common alloc */ | 1747 | /* common alloc */ |
@@ -1639,11 +1865,13 @@ static __init int nfit_test_init(void) | |||
1639 | { | 1865 | { |
1640 | int rc, i; | 1866 | int rc, i; |
1641 | 1867 | ||
1642 | nfit_test_dimm = class_create(THIS_MODULE, "nfit_test_dimm"); | 1868 | nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm); |
1643 | if (IS_ERR(nfit_test_dimm)) | ||
1644 | return PTR_ERR(nfit_test_dimm); | ||
1645 | 1869 | ||
1646 | nfit_test_setup(nfit_test_lookup); | 1870 | nfit_test_dimm = class_create(THIS_MODULE, "nfit_test_dimm"); |
1871 | if (IS_ERR(nfit_test_dimm)) { | ||
1872 | rc = PTR_ERR(nfit_test_dimm); | ||
1873 | goto err_register; | ||
1874 | } | ||
1647 | 1875 | ||
1648 | for (i = 0; i < NUM_NFITS; i++) { | 1876 | for (i = 0; i < NUM_NFITS; i++) { |
1649 | struct nfit_test *nfit_test; | 1877 | struct nfit_test *nfit_test; |
diff --git a/tools/testing/nvdimm/test/nfit_test.h b/tools/testing/nvdimm/test/nfit_test.h index c281dd2e5e2d..f54c0032c6ff 100644 --- a/tools/testing/nvdimm/test/nfit_test.h +++ b/tools/testing/nvdimm/test/nfit_test.h | |||
@@ -31,11 +31,17 @@ struct nfit_test_resource { | |||
31 | void *buf; | 31 | void *buf; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | union acpi_object; | ||
35 | typedef void *acpi_handle; | ||
36 | |||
34 | typedef struct nfit_test_resource *(*nfit_test_lookup_fn)(resource_size_t); | 37 | typedef struct nfit_test_resource *(*nfit_test_lookup_fn)(resource_size_t); |
38 | typedef union acpi_object *(*nfit_test_evaluate_dsm_fn)(acpi_handle handle, | ||
39 | const u8 *uuid, u64 rev, u64 func, union acpi_object *argv4); | ||
35 | void __iomem *__wrap_ioremap_nocache(resource_size_t offset, | 40 | void __iomem *__wrap_ioremap_nocache(resource_size_t offset, |
36 | unsigned long size); | 41 | unsigned long size); |
37 | void __wrap_iounmap(volatile void __iomem *addr); | 42 | void __wrap_iounmap(volatile void __iomem *addr); |
38 | void nfit_test_setup(nfit_test_lookup_fn lookup); | 43 | void nfit_test_setup(nfit_test_lookup_fn lookup, |
44 | nfit_test_evaluate_dsm_fn evaluate); | ||
39 | void nfit_test_teardown(void); | 45 | void nfit_test_teardown(void); |
40 | struct nfit_test_resource *get_nfit_res(resource_size_t resource); | 46 | struct nfit_test_resource *get_nfit_res(resource_size_t resource); |
41 | #endif | 47 | #endif |