diff options
author | David S. Miller <davem@davemloft.net> | 2016-07-23 19:31:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-24 00:53:32 -0400 |
commit | de0ba9a0d8909996f9e293d311c2cc459fa77d67 (patch) | |
tree | 199214afc477824bf431d11d08834ff7555c994b | |
parent | d95a93a9b71677a43f967a1b7986decab84b7765 (diff) | |
parent | 107df03203bb66de56e2caec3bde6d22b55480c5 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Just several instances of overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
276 files changed, 2475 insertions, 1313 deletions
diff --git a/Documentation/gdb-kernel-debugging.txt b/Documentation/gdb-kernel-debugging.txt index 4ab7d43d0754..7050ce8794b9 100644 --- a/Documentation/gdb-kernel-debugging.txt +++ b/Documentation/gdb-kernel-debugging.txt | |||
@@ -139,27 +139,6 @@ Examples of using the Linux-provided gdb helpers | |||
139 | start_comm = "swapper/2\000\000\000\000\000\000" | 139 | start_comm = "swapper/2\000\000\000\000\000\000" |
140 | } | 140 | } |
141 | 141 | ||
142 | o Dig into a radix tree data structure, such as the IRQ descriptors: | ||
143 | (gdb) print (struct irq_desc)$lx_radix_tree_lookup(irq_desc_tree, 18) | ||
144 | $6 = { | ||
145 | irq_common_data = { | ||
146 | state_use_accessors = 67584, | ||
147 | handler_data = 0x0 <__vectors_start>, | ||
148 | msi_desc = 0x0 <__vectors_start>, | ||
149 | affinity = {{ | ||
150 | bits = {65535} | ||
151 | }} | ||
152 | }, | ||
153 | irq_data = { | ||
154 | mask = 0, | ||
155 | irq = 18, | ||
156 | hwirq = 27, | ||
157 | common = 0xee803d80, | ||
158 | chip = 0xc0eb0854 <gic_data>, | ||
159 | domain = 0xee808000, | ||
160 | parent_data = 0x0 <__vectors_start>, | ||
161 | chip_data = 0xc0eb0854 <gic_data> | ||
162 | } <... trimmed ...> | ||
163 | 142 | ||
164 | List of commands and functions | 143 | List of commands and functions |
165 | ------------------------------ | 144 | ------------------------------ |
diff --git a/Documentation/x86/intel_mpx.txt b/Documentation/x86/intel_mpx.txt index 1a5a12184a35..85d0549ad846 100644 --- a/Documentation/x86/intel_mpx.txt +++ b/Documentation/x86/intel_mpx.txt | |||
@@ -45,7 +45,7 @@ is how we expect the compiler, application and kernel to work together. | |||
45 | MPX-instrumented. | 45 | MPX-instrumented. |
46 | 3) The kernel detects that the CPU has MPX, allows the new prctl() to | 46 | 3) The kernel detects that the CPU has MPX, allows the new prctl() to |
47 | succeed, and notes the location of the bounds directory. Userspace is | 47 | succeed, and notes the location of the bounds directory. Userspace is |
48 | expected to keep the bounds directory at that locationWe note it | 48 | expected to keep the bounds directory at that location. We note it |
49 | instead of reading it each time because the 'xsave' operation needed | 49 | instead of reading it each time because the 'xsave' operation needed |
50 | to access the bounds directory register is an expensive operation. | 50 | to access the bounds directory register is an expensive operation. |
51 | 4) If the application needs to spill bounds out of the 4 registers, it | 51 | 4) If the application needs to spill bounds out of the 4 registers, it |
@@ -167,7 +167,7 @@ If a #BR is generated due to a bounds violation caused by MPX. | |||
167 | We need to decode MPX instructions to get violation address and | 167 | We need to decode MPX instructions to get violation address and |
168 | set this address into extended struct siginfo. | 168 | set this address into extended struct siginfo. |
169 | 169 | ||
170 | The _sigfault feild of struct siginfo is extended as follow: | 170 | The _sigfault field of struct siginfo is extended as follow: |
171 | 171 | ||
172 | 87 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | 172 | 87 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ |
173 | 88 struct { | 173 | 88 struct { |
@@ -240,5 +240,5 @@ them at the same bounds table. | |||
240 | This is allowed architecturally. See more information "Intel(R) Architecture | 240 | This is allowed architecturally. See more information "Intel(R) Architecture |
241 | Instruction Set Extensions Programming Reference" (9.3.4). | 241 | Instruction Set Extensions Programming Reference" (9.3.4). |
242 | 242 | ||
243 | However, if users did this, the kernel might be fooled in to unmaping an | 243 | However, if users did this, the kernel might be fooled in to unmapping an |
244 | in-use bounds table since it does not recognize sharing. | 244 | in-use bounds table since it does not recognize sharing. |
diff --git a/Documentation/x86/tlb.txt b/Documentation/x86/tlb.txt index 39d172326703..6a0607b99ed8 100644 --- a/Documentation/x86/tlb.txt +++ b/Documentation/x86/tlb.txt | |||
@@ -5,7 +5,7 @@ memory, it has two choices: | |||
5 | from areas other than the one we are trying to flush will be | 5 | from areas other than the one we are trying to flush will be |
6 | destroyed and must be refilled later, at some cost. | 6 | destroyed and must be refilled later, at some cost. |
7 | 2. Use the invlpg instruction to invalidate a single page at a | 7 | 2. Use the invlpg instruction to invalidate a single page at a |
8 | time. This could potentialy cost many more instructions, but | 8 | time. This could potentially cost many more instructions, but |
9 | it is a much more precise operation, causing no collateral | 9 | it is a much more precise operation, causing no collateral |
10 | damage to other TLB entries. | 10 | damage to other TLB entries. |
11 | 11 | ||
@@ -19,7 +19,7 @@ Which method to do depends on a few things: | |||
19 | work. | 19 | work. |
20 | 3. The size of the TLB. The larger the TLB, the more collateral | 20 | 3. The size of the TLB. The larger the TLB, the more collateral |
21 | damage we do with a full flush. So, the larger the TLB, the | 21 | damage we do with a full flush. So, the larger the TLB, the |
22 | more attrative an individual flush looks. Data and | 22 | more attractive an individual flush looks. Data and |
23 | instructions have separate TLBs, as do different page sizes. | 23 | instructions have separate TLBs, as do different page sizes. |
24 | 4. The microarchitecture. The TLB has become a multi-level | 24 | 4. The microarchitecture. The TLB has become a multi-level |
25 | cache on modern CPUs, and the global flushes have become more | 25 | cache on modern CPUs, and the global flushes have become more |
diff --git a/Documentation/x86/x86_64/machinecheck b/Documentation/x86/x86_64/machinecheck index b1fb30273286..d0648a74fceb 100644 --- a/Documentation/x86/x86_64/machinecheck +++ b/Documentation/x86/x86_64/machinecheck | |||
@@ -36,7 +36,7 @@ between all CPUs. | |||
36 | 36 | ||
37 | check_interval | 37 | check_interval |
38 | How often to poll for corrected machine check errors, in seconds | 38 | How often to poll for corrected machine check errors, in seconds |
39 | (Note output is hexademical). Default 5 minutes. When the poller | 39 | (Note output is hexadecimal). Default 5 minutes. When the poller |
40 | finds MCEs it triggers an exponential speedup (poll more often) on | 40 | finds MCEs it triggers an exponential speedup (poll more often) on |
41 | the polling interval. When the poller stops finding MCEs, it | 41 | the polling interval. When the poller stops finding MCEs, it |
42 | triggers an exponential backoff (poll less often) on the polling | 42 | triggers an exponential backoff (poll less often) on the polling |
diff --git a/MAINTAINERS b/MAINTAINERS index 06e84119c690..dc3481d7c80d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1694,8 +1694,6 @@ S: Maintained | |||
1694 | F: drivers/edac/altera_edac. | 1694 | F: drivers/edac/altera_edac. |
1695 | 1695 | ||
1696 | ARM/STI ARCHITECTURE | 1696 | ARM/STI ARCHITECTURE |
1697 | M: Srinivas Kandagatla <srinivas.kandagatla@gmail.com> | ||
1698 | M: Maxime Coquelin <maxime.coquelin@st.com> | ||
1699 | M: Patrice Chotard <patrice.chotard@st.com> | 1697 | M: Patrice Chotard <patrice.chotard@st.com> |
1700 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1698 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1701 | L: kernel@stlinux.com | 1699 | L: kernel@stlinux.com |
@@ -1728,6 +1726,7 @@ F: drivers/ata/ahci_st.c | |||
1728 | 1726 | ||
1729 | ARM/STM32 ARCHITECTURE | 1727 | ARM/STM32 ARCHITECTURE |
1730 | M: Maxime Coquelin <mcoquelin.stm32@gmail.com> | 1728 | M: Maxime Coquelin <mcoquelin.stm32@gmail.com> |
1729 | M: Alexandre Torgue <alexandre.torgue@st.com> | ||
1731 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1730 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1732 | S: Maintained | 1731 | S: Maintained |
1733 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mcoquelin/stm32.git | 1732 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mcoquelin/stm32.git |
@@ -4486,7 +4485,7 @@ S: Orphan | |||
4486 | F: fs/efs/ | 4485 | F: fs/efs/ |
4487 | 4486 | ||
4488 | EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER | 4487 | EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER |
4489 | M: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> | 4488 | M: Douglas Miller <dougmill@linux.vnet.ibm.com> |
4490 | L: netdev@vger.kernel.org | 4489 | L: netdev@vger.kernel.org |
4491 | S: Maintained | 4490 | S: Maintained |
4492 | F: drivers/net/ethernet/ibm/ehea/ | 4491 | F: drivers/net/ethernet/ibm/ehea/ |
@@ -7502,6 +7501,7 @@ Q: http://patchwork.ozlabs.org/project/linux-mtd/list/ | |||
7502 | T: git git://git.infradead.org/linux-mtd.git | 7501 | T: git git://git.infradead.org/linux-mtd.git |
7503 | T: git git://git.infradead.org/l2-mtd.git | 7502 | T: git git://git.infradead.org/l2-mtd.git |
7504 | S: Maintained | 7503 | S: Maintained |
7504 | F: Documentation/devicetree/bindings/mtd/ | ||
7505 | F: drivers/mtd/ | 7505 | F: drivers/mtd/ |
7506 | F: include/linux/mtd/ | 7506 | F: include/linux/mtd/ |
7507 | F: include/uapi/mtd/ | 7507 | F: include/uapi/mtd/ |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 4 | 1 | VERSION = 4 |
2 | PATCHLEVEL = 7 | 2 | PATCHLEVEL = 7 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Psychotic Stoned Sheep | 5 | NAME = Psychotic Stoned Sheep |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/dts/armada-385-linksys.dtsi b/arch/arm/boot/dts/armada-385-linksys.dtsi index 8450944b28e6..22f7a13e20b4 100644 --- a/arch/arm/boot/dts/armada-385-linksys.dtsi +++ b/arch/arm/boot/dts/armada-385-linksys.dtsi | |||
@@ -58,8 +58,8 @@ | |||
58 | soc { | 58 | soc { |
59 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 | 59 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 |
60 | MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 | 60 | MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 |
61 | MBUS_ID(0x09, 0x09) 0 0xf1100000 0x10000 | 61 | MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000 |
62 | MBUS_ID(0x09, 0x05) 0 0xf1110000 0x10000>; | 62 | MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>; |
63 | 63 | ||
64 | internal-regs { | 64 | internal-regs { |
65 | 65 | ||
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index a03e56fb5dbc..ca58eb279d55 100644 --- a/arch/arm/boot/dts/sun4i-a10.dtsi +++ b/arch/arm/boot/dts/sun4i-a10.dtsi | |||
@@ -65,8 +65,9 @@ | |||
65 | compatible = "allwinner,simple-framebuffer", | 65 | compatible = "allwinner,simple-framebuffer", |
66 | "simple-framebuffer"; | 66 | "simple-framebuffer"; |
67 | allwinner,pipeline = "de_be0-lcd0-hdmi"; | 67 | allwinner,pipeline = "de_be0-lcd0-hdmi"; |
68 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, | 68 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 36>, |
69 | <&ahb_gates 44>, <&dram_gates 26>; | 69 | <&ahb_gates 43>, <&ahb_gates 44>, |
70 | <&dram_gates 26>; | ||
70 | status = "disabled"; | 71 | status = "disabled"; |
71 | }; | 72 | }; |
72 | 73 | ||
@@ -74,8 +75,9 @@ | |||
74 | compatible = "allwinner,simple-framebuffer", | 75 | compatible = "allwinner,simple-framebuffer", |
75 | "simple-framebuffer"; | 76 | "simple-framebuffer"; |
76 | allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; | 77 | allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; |
77 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, | 78 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 36>, |
78 | <&ahb_gates 44>, <&ahb_gates 46>, | 79 | <&ahb_gates 43>, <&ahb_gates 44>, |
80 | <&ahb_gates 46>, | ||
79 | <&dram_gates 25>, <&dram_gates 26>; | 81 | <&dram_gates 25>, <&dram_gates 26>; |
80 | status = "disabled"; | 82 | status = "disabled"; |
81 | }; | 83 | }; |
@@ -84,9 +86,9 @@ | |||
84 | compatible = "allwinner,simple-framebuffer", | 86 | compatible = "allwinner,simple-framebuffer", |
85 | "simple-framebuffer"; | 87 | "simple-framebuffer"; |
86 | allwinner,pipeline = "de_fe0-de_be0-lcd0"; | 88 | allwinner,pipeline = "de_fe0-de_be0-lcd0"; |
87 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, | 89 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 36>, |
88 | <&ahb_gates 46>, <&dram_gates 25>, | 90 | <&ahb_gates 44>, <&ahb_gates 46>, |
89 | <&dram_gates 26>; | 91 | <&dram_gates 25>, <&dram_gates 26>; |
90 | status = "disabled"; | 92 | status = "disabled"; |
91 | }; | 93 | }; |
92 | 94 | ||
@@ -94,8 +96,9 @@ | |||
94 | compatible = "allwinner,simple-framebuffer", | 96 | compatible = "allwinner,simple-framebuffer", |
95 | "simple-framebuffer"; | 97 | "simple-framebuffer"; |
96 | allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; | 98 | allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; |
97 | clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, | 99 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 34>, |
98 | <&ahb_gates 44>, <&ahb_gates 46>, | 100 | <&ahb_gates 36>, <&ahb_gates 44>, |
101 | <&ahb_gates 46>, | ||
99 | <&dram_gates 5>, <&dram_gates 25>, <&dram_gates 26>; | 102 | <&dram_gates 5>, <&dram_gates 25>, <&dram_gates 26>; |
100 | status = "disabled"; | 103 | status = "disabled"; |
101 | }; | 104 | }; |
diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi index bddd0de88af6..367f33012493 100644 --- a/arch/arm/boot/dts/sun5i-a10s.dtsi +++ b/arch/arm/boot/dts/sun5i-a10s.dtsi | |||
@@ -65,8 +65,8 @@ | |||
65 | compatible = "allwinner,simple-framebuffer", | 65 | compatible = "allwinner,simple-framebuffer", |
66 | "simple-framebuffer"; | 66 | "simple-framebuffer"; |
67 | allwinner,pipeline = "de_be0-lcd0-hdmi"; | 67 | allwinner,pipeline = "de_be0-lcd0-hdmi"; |
68 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, | 68 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 36>, |
69 | <&ahb_gates 44>; | 69 | <&ahb_gates 43>, <&ahb_gates 44>; |
70 | status = "disabled"; | 70 | status = "disabled"; |
71 | }; | 71 | }; |
72 | 72 | ||
@@ -74,7 +74,8 @@ | |||
74 | compatible = "allwinner,simple-framebuffer", | 74 | compatible = "allwinner,simple-framebuffer", |
75 | "simple-framebuffer"; | 75 | "simple-framebuffer"; |
76 | allwinner,pipeline = "de_be0-lcd0"; | 76 | allwinner,pipeline = "de_be0-lcd0"; |
77 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; | 77 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 36>, |
78 | <&ahb_gates 44>; | ||
78 | status = "disabled"; | 79 | status = "disabled"; |
79 | }; | 80 | }; |
80 | 81 | ||
@@ -82,8 +83,8 @@ | |||
82 | compatible = "allwinner,simple-framebuffer", | 83 | compatible = "allwinner,simple-framebuffer", |
83 | "simple-framebuffer"; | 84 | "simple-framebuffer"; |
84 | allwinner,pipeline = "de_be0-lcd0-tve0"; | 85 | allwinner,pipeline = "de_be0-lcd0-tve0"; |
85 | clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, | 86 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 34>, |
86 | <&ahb_gates 44>; | 87 | <&ahb_gates 36>, <&ahb_gates 44>; |
87 | status = "disabled"; | 88 | status = "disabled"; |
88 | }; | 89 | }; |
89 | }; | 90 | }; |
diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts index a8d8b4582397..f694482bdeb6 100644 --- a/arch/arm/boot/dts/sun5i-r8-chip.dts +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts | |||
@@ -52,7 +52,7 @@ | |||
52 | 52 | ||
53 | / { | 53 | / { |
54 | model = "NextThing C.H.I.P."; | 54 | model = "NextThing C.H.I.P."; |
55 | compatible = "nextthing,chip", "allwinner,sun5i-r8"; | 55 | compatible = "nextthing,chip", "allwinner,sun5i-r8", "allwinner,sun5i-a13"; |
56 | 56 | ||
57 | aliases { | 57 | aliases { |
58 | i2c0 = &i2c0; | 58 | i2c0 = &i2c0; |
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index febdf4c72fb0..2c34bbbb9570 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi | |||
@@ -67,8 +67,9 @@ | |||
67 | compatible = "allwinner,simple-framebuffer", | 67 | compatible = "allwinner,simple-framebuffer", |
68 | "simple-framebuffer"; | 68 | "simple-framebuffer"; |
69 | allwinner,pipeline = "de_be0-lcd0-hdmi"; | 69 | allwinner,pipeline = "de_be0-lcd0-hdmi"; |
70 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, | 70 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 36>, |
71 | <&ahb_gates 44>, <&dram_gates 26>; | 71 | <&ahb_gates 43>, <&ahb_gates 44>, |
72 | <&dram_gates 26>; | ||
72 | status = "disabled"; | 73 | status = "disabled"; |
73 | }; | 74 | }; |
74 | 75 | ||
@@ -76,8 +77,8 @@ | |||
76 | compatible = "allwinner,simple-framebuffer", | 77 | compatible = "allwinner,simple-framebuffer", |
77 | "simple-framebuffer"; | 78 | "simple-framebuffer"; |
78 | allwinner,pipeline = "de_be0-lcd0"; | 79 | allwinner,pipeline = "de_be0-lcd0"; |
79 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, | 80 | clocks = <&pll3>, <&pll5 1>, <&ahb_gates 36>, |
80 | <&dram_gates 26>; | 81 | <&ahb_gates 44>, <&dram_gates 26>; |
81 | status = "disabled"; | 82 | status = "disabled"; |
82 | }; | 83 | }; |
83 | 84 | ||
@@ -85,7 +86,7 @@ | |||
85 | compatible = "allwinner,simple-framebuffer", | 86 | compatible = "allwinner,simple-framebuffer", |
86 | "simple-framebuffer"; | 87 | "simple-framebuffer"; |
87 | allwinner,pipeline = "de_be0-lcd0-tve0"; | 88 | allwinner,pipeline = "de_be0-lcd0-tve0"; |
88 | clocks = <&pll5 1>, | 89 | clocks = <&pll3>, <&pll5 1>, |
89 | <&ahb_gates 34>, <&ahb_gates 36>, <&ahb_gates 44>, | 90 | <&ahb_gates 34>, <&ahb_gates 36>, <&ahb_gates 44>, |
90 | <&dram_gates 5>, <&dram_gates 26>; | 91 | <&dram_gates 5>, <&dram_gates 26>; |
91 | status = "disabled"; | 92 | status = "disabled"; |
@@ -231,6 +232,7 @@ | |||
231 | pll3x2: pll3x2_clk { | 232 | pll3x2: pll3x2_clk { |
232 | #clock-cells = <0>; | 233 | #clock-cells = <0>; |
233 | compatible = "fixed-factor-clock"; | 234 | compatible = "fixed-factor-clock"; |
235 | clocks = <&pll3>; | ||
234 | clock-div = <1>; | 236 | clock-div = <1>; |
235 | clock-mult = <2>; | 237 | clock-mult = <2>; |
236 | clock-output-names = "pll3-2x"; | 238 | clock-output-names = "pll3-2x"; |
@@ -272,6 +274,7 @@ | |||
272 | pll7x2: pll7x2_clk { | 274 | pll7x2: pll7x2_clk { |
273 | #clock-cells = <0>; | 275 | #clock-cells = <0>; |
274 | compatible = "fixed-factor-clock"; | 276 | compatible = "fixed-factor-clock"; |
277 | clocks = <&pll7>; | ||
275 | clock-div = <1>; | 278 | clock-div = <1>; |
276 | clock-mult = <2>; | 279 | clock-mult = <2>; |
277 | clock-output-names = "pll7-2x"; | 280 | clock-output-names = "pll7-2x"; |
diff --git a/arch/arm/boot/dts/tegra30-beaver.dts b/arch/arm/boot/dts/tegra30-beaver.dts index 1eca3b28ac64..b6da15d823a6 100644 --- a/arch/arm/boot/dts/tegra30-beaver.dts +++ b/arch/arm/boot/dts/tegra30-beaver.dts | |||
@@ -1843,7 +1843,7 @@ | |||
1843 | 1843 | ||
1844 | ldo5_reg: ldo5 { | 1844 | ldo5_reg: ldo5 { |
1845 | regulator-name = "vddio_sdmmc,avdd_vdac"; | 1845 | regulator-name = "vddio_sdmmc,avdd_vdac"; |
1846 | regulator-min-microvolt = <3300000>; | 1846 | regulator-min-microvolt = <1800000>; |
1847 | regulator-max-microvolt = <3300000>; | 1847 | regulator-max-microvolt = <3300000>; |
1848 | regulator-always-on; | 1848 | regulator-always-on; |
1849 | }; | 1849 | }; |
@@ -1914,6 +1914,7 @@ | |||
1914 | 1914 | ||
1915 | sdhci@78000000 { | 1915 | sdhci@78000000 { |
1916 | status = "okay"; | 1916 | status = "okay"; |
1917 | vqmmc-supply = <&ldo5_reg>; | ||
1917 | cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>; | 1918 | cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>; |
1918 | wp-gpios = <&gpio TEGRA_GPIO(T, 3) GPIO_ACTIVE_HIGH>; | 1919 | wp-gpios = <&gpio TEGRA_GPIO(T, 3) GPIO_ACTIVE_HIGH>; |
1919 | power-gpios = <&gpio TEGRA_GPIO(D, 7) GPIO_ACTIVE_HIGH>; | 1920 | power-gpios = <&gpio TEGRA_GPIO(D, 7) GPIO_ACTIVE_HIGH>; |
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index ecf9e0c3b107..e53c6cfcab51 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile | |||
@@ -7,9 +7,15 @@ CFLAGS_pmsu.o := -march=armv7-a | |||
7 | obj-$(CONFIG_MACH_MVEBU_ANY) += system-controller.o mvebu-soc-id.o | 7 | obj-$(CONFIG_MACH_MVEBU_ANY) += system-controller.o mvebu-soc-id.o |
8 | 8 | ||
9 | ifeq ($(CONFIG_MACH_MVEBU_V7),y) | 9 | ifeq ($(CONFIG_MACH_MVEBU_V7),y) |
10 | obj-y += cpu-reset.o board-v7.o coherency.o coherency_ll.o pmsu.o pmsu_ll.o pm.o pm-board.o | 10 | obj-y += cpu-reset.o board-v7.o coherency.o coherency_ll.o pmsu.o pmsu_ll.o |
11 | |||
12 | obj-$(CONFIG_PM) += pm.o pm-board.o | ||
11 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o platsmp-a9.o headsmp-a9.o | 13 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o platsmp-a9.o headsmp-a9.o |
12 | endif | 14 | endif |
13 | 15 | ||
14 | obj-$(CONFIG_MACH_DOVE) += dove.o | 16 | obj-$(CONFIG_MACH_DOVE) += dove.o |
15 | obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o | 17 | |
18 | ifeq ($(CONFIG_MACH_KIRKWOOD),y) | ||
19 | obj-y += kirkwood.o | ||
20 | obj-$(CONFIG_PM) += kirkwood-pm.o | ||
21 | endif | ||
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 7e989d61159c..e80f0dde2189 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c | |||
@@ -162,22 +162,16 @@ exit: | |||
162 | } | 162 | } |
163 | 163 | ||
164 | /* | 164 | /* |
165 | * This ioremap hook is used on Armada 375/38x to ensure that PCIe | 165 | * This ioremap hook is used on Armada 375/38x to ensure that all MMIO |
166 | * memory areas are mapped as MT_UNCACHED instead of MT_DEVICE. This | 166 | * areas are mapped as MT_UNCACHED instead of MT_DEVICE. This is |
167 | * is needed as a workaround for a deadlock issue between the PCIe | 167 | * needed for the HW I/O coherency mechanism to work properly without |
168 | * interface and the cache controller. | 168 | * deadlock. |
169 | */ | 169 | */ |
170 | static void __iomem * | 170 | static void __iomem * |
171 | armada_pcie_wa_ioremap_caller(phys_addr_t phys_addr, size_t size, | 171 | armada_wa_ioremap_caller(phys_addr_t phys_addr, size_t size, |
172 | unsigned int mtype, void *caller) | 172 | unsigned int mtype, void *caller) |
173 | { | 173 | { |
174 | struct resource pcie_mem; | 174 | mtype = MT_UNCACHED; |
175 | |||
176 | mvebu_mbus_get_pcie_mem_aperture(&pcie_mem); | ||
177 | |||
178 | if (pcie_mem.start <= phys_addr && (phys_addr + size) <= pcie_mem.end) | ||
179 | mtype = MT_UNCACHED; | ||
180 | |||
181 | return __arm_ioremap_caller(phys_addr, size, mtype, caller); | 175 | return __arm_ioremap_caller(phys_addr, size, mtype, caller); |
182 | } | 176 | } |
183 | 177 | ||
@@ -186,7 +180,8 @@ static void __init armada_375_380_coherency_init(struct device_node *np) | |||
186 | struct device_node *cache_dn; | 180 | struct device_node *cache_dn; |
187 | 181 | ||
188 | coherency_cpu_base = of_iomap(np, 0); | 182 | coherency_cpu_base = of_iomap(np, 0); |
189 | arch_ioremap_caller = armada_pcie_wa_ioremap_caller; | 183 | arch_ioremap_caller = armada_wa_ioremap_caller; |
184 | pci_ioremap_set_mem_type(MT_UNCACHED); | ||
190 | 185 | ||
191 | /* | 186 | /* |
192 | * We should switch the PL310 to I/O coherency mode only if | 187 | * We should switch the PL310 to I/O coherency mode only if |
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index 87e1985f3be8..9d9fd4b9a72e 100644 --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h | |||
@@ -80,12 +80,14 @@ | |||
80 | #define APM_CPU_PART_POTENZA 0x000 | 80 | #define APM_CPU_PART_POTENZA 0x000 |
81 | 81 | ||
82 | #define CAVIUM_CPU_PART_THUNDERX 0x0A1 | 82 | #define CAVIUM_CPU_PART_THUNDERX 0x0A1 |
83 | #define CAVIUM_CPU_PART_THUNDERX_81XX 0x0A2 | ||
83 | 84 | ||
84 | #define BRCM_CPU_PART_VULCAN 0x516 | 85 | #define BRCM_CPU_PART_VULCAN 0x516 |
85 | 86 | ||
86 | #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53) | 87 | #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53) |
87 | #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57) | 88 | #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57) |
88 | #define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX) | 89 | #define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX) |
90 | #define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX) | ||
89 | 91 | ||
90 | #ifndef __ASSEMBLY__ | 92 | #ifndef __ASSEMBLY__ |
91 | 93 | ||
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h index a307eb6e7fa8..7f94755089e2 100644 --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h | |||
@@ -117,6 +117,8 @@ struct pt_regs { | |||
117 | }; | 117 | }; |
118 | u64 orig_x0; | 118 | u64 orig_x0; |
119 | u64 syscallno; | 119 | u64 syscallno; |
120 | u64 orig_addr_limit; | ||
121 | u64 unused; // maintain 16 byte alignment | ||
120 | }; | 122 | }; |
121 | 123 | ||
122 | #define arch_has_single_step() (1) | 124 | #define arch_has_single_step() (1) |
diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c index f8e5d47f0880..2f4ba774488a 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c | |||
@@ -60,6 +60,7 @@ int main(void) | |||
60 | DEFINE(S_PC, offsetof(struct pt_regs, pc)); | 60 | DEFINE(S_PC, offsetof(struct pt_regs, pc)); |
61 | DEFINE(S_ORIG_X0, offsetof(struct pt_regs, orig_x0)); | 61 | DEFINE(S_ORIG_X0, offsetof(struct pt_regs, orig_x0)); |
62 | DEFINE(S_SYSCALLNO, offsetof(struct pt_regs, syscallno)); | 62 | DEFINE(S_SYSCALLNO, offsetof(struct pt_regs, syscallno)); |
63 | DEFINE(S_ORIG_ADDR_LIMIT, offsetof(struct pt_regs, orig_addr_limit)); | ||
63 | DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); | 64 | DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); |
64 | BLANK(); | 65 | BLANK(); |
65 | DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter)); | 66 | DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter)); |
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index d42789499f17..af716b65110d 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c | |||
@@ -98,6 +98,12 @@ const struct arm64_cpu_capabilities arm64_errata[] = { | |||
98 | MIDR_RANGE(MIDR_THUNDERX, 0x00, | 98 | MIDR_RANGE(MIDR_THUNDERX, 0x00, |
99 | (1 << MIDR_VARIANT_SHIFT) | 1), | 99 | (1 << MIDR_VARIANT_SHIFT) | 1), |
100 | }, | 100 | }, |
101 | { | ||
102 | /* Cavium ThunderX, T81 pass 1.0 */ | ||
103 | .desc = "Cavium erratum 27456", | ||
104 | .capability = ARM64_WORKAROUND_CAVIUM_27456, | ||
105 | MIDR_RANGE(MIDR_THUNDERX_81XX, 0x00, 0x00), | ||
106 | }, | ||
101 | #endif | 107 | #endif |
102 | { | 108 | { |
103 | } | 109 | } |
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 12e8d2bcb3f9..6c3b7345a6c4 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/errno.h> | 28 | #include <asm/errno.h> |
29 | #include <asm/esr.h> | 29 | #include <asm/esr.h> |
30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
31 | #include <asm/memory.h> | ||
31 | #include <asm/thread_info.h> | 32 | #include <asm/thread_info.h> |
32 | #include <asm/unistd.h> | 33 | #include <asm/unistd.h> |
33 | 34 | ||
@@ -97,7 +98,14 @@ | |||
97 | mov x29, xzr // fp pointed to user-space | 98 | mov x29, xzr // fp pointed to user-space |
98 | .else | 99 | .else |
99 | add x21, sp, #S_FRAME_SIZE | 100 | add x21, sp, #S_FRAME_SIZE |
100 | .endif | 101 | get_thread_info tsk |
102 | /* Save the task's original addr_limit and set USER_DS (TASK_SIZE_64) */ | ||
103 | ldr x20, [tsk, #TI_ADDR_LIMIT] | ||
104 | str x20, [sp, #S_ORIG_ADDR_LIMIT] | ||
105 | mov x20, #TASK_SIZE_64 | ||
106 | str x20, [tsk, #TI_ADDR_LIMIT] | ||
107 | ALTERNATIVE(nop, SET_PSTATE_UAO(0), ARM64_HAS_UAO, CONFIG_ARM64_UAO) | ||
108 | .endif /* \el == 0 */ | ||
101 | mrs x22, elr_el1 | 109 | mrs x22, elr_el1 |
102 | mrs x23, spsr_el1 | 110 | mrs x23, spsr_el1 |
103 | stp lr, x21, [sp, #S_LR] | 111 | stp lr, x21, [sp, #S_LR] |
@@ -128,6 +136,14 @@ | |||
128 | .endm | 136 | .endm |
129 | 137 | ||
130 | .macro kernel_exit, el | 138 | .macro kernel_exit, el |
139 | .if \el != 0 | ||
140 | /* Restore the task's original addr_limit. */ | ||
141 | ldr x20, [sp, #S_ORIG_ADDR_LIMIT] | ||
142 | str x20, [tsk, #TI_ADDR_LIMIT] | ||
143 | |||
144 | /* No need to restore UAO, it will be restored from SPSR_EL1 */ | ||
145 | .endif | ||
146 | |||
131 | ldp x21, x22, [sp, #S_PC] // load ELR, SPSR | 147 | ldp x21, x22, [sp, #S_PC] // load ELR, SPSR |
132 | .if \el == 0 | 148 | .if \el == 0 |
133 | ct_user_enter | 149 | ct_user_enter |
@@ -406,7 +422,6 @@ el1_irq: | |||
406 | bl trace_hardirqs_off | 422 | bl trace_hardirqs_off |
407 | #endif | 423 | #endif |
408 | 424 | ||
409 | get_thread_info tsk | ||
410 | irq_handler | 425 | irq_handler |
411 | 426 | ||
412 | #ifdef CONFIG_PREEMPT | 427 | #ifdef CONFIG_PREEMPT |
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 013e2cbe7924..b1166d1e5955 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c | |||
@@ -280,7 +280,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, | |||
280 | } | 280 | } |
281 | 281 | ||
282 | if (permission_fault(esr) && (addr < USER_DS)) { | 282 | if (permission_fault(esr) && (addr < USER_DS)) { |
283 | if (get_fs() == KERNEL_DS) | 283 | /* regs->orig_addr_limit may be 0 if we entered from EL0 */ |
284 | if (regs->orig_addr_limit == KERNEL_DS) | ||
284 | die("Accessing user space memory with fs=KERNEL_DS", regs, esr); | 285 | die("Accessing user space memory with fs=KERNEL_DS", regs, esr); |
285 | 286 | ||
286 | if (!search_exception_tables(regs->pc)) | 287 | if (!search_exception_tables(regs->pc)) |
diff --git a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c index 01d877c6868f..cf3023dced49 100644 --- a/arch/m32r/boot/compressed/m32r_sio.c +++ b/arch/m32r/boot/compressed/m32r_sio.c | |||
@@ -8,12 +8,13 @@ | |||
8 | 8 | ||
9 | #include <asm/processor.h> | 9 | #include <asm/processor.h> |
10 | 10 | ||
11 | static void putc(char c); | 11 | static void m32r_putc(char c); |
12 | 12 | ||
13 | static int puts(const char *s) | 13 | static int puts(const char *s) |
14 | { | 14 | { |
15 | char c; | 15 | char c; |
16 | while ((c = *s++)) putc(c); | 16 | while ((c = *s++)) |
17 | m32r_putc(c); | ||
17 | return 0; | 18 | return 0; |
18 | } | 19 | } |
19 | 20 | ||
@@ -41,7 +42,7 @@ static int puts(const char *s) | |||
41 | #define BOOT_SIO0TXB PLD_ESIO0TXB | 42 | #define BOOT_SIO0TXB PLD_ESIO0TXB |
42 | #endif | 43 | #endif |
43 | 44 | ||
44 | static void putc(char c) | 45 | static void m32r_putc(char c) |
45 | { | 46 | { |
46 | while ((*BOOT_SIO0STS & 0x3) != 0x3) | 47 | while ((*BOOT_SIO0STS & 0x3) != 0x3) |
47 | cpu_relax(); | 48 | cpu_relax(); |
@@ -61,7 +62,7 @@ static void putc(char c) | |||
61 | #define SIO0TXB (volatile unsigned short *)(0x00efd000 + 30) | 62 | #define SIO0TXB (volatile unsigned short *)(0x00efd000 + 30) |
62 | #endif | 63 | #endif |
63 | 64 | ||
64 | static void putc(char c) | 65 | static void m32r_putc(char c) |
65 | { | 66 | { |
66 | while ((*SIO0STS & 0x1) == 0) | 67 | while ((*SIO0STS & 0x1) == 0) |
67 | cpu_relax(); | 68 | cpu_relax(); |
diff --git a/arch/m68k/coldfire/head.S b/arch/m68k/coldfire/head.S index fa31be297b85..73d92ea0ce65 100644 --- a/arch/m68k/coldfire/head.S +++ b/arch/m68k/coldfire/head.S | |||
@@ -288,7 +288,7 @@ _clear_bss: | |||
288 | #endif | 288 | #endif |
289 | 289 | ||
290 | /* | 290 | /* |
291 | * Assember start up done, start code proper. | 291 | * Assembler start up done, start code proper. |
292 | */ | 292 | */ |
293 | jsr start_kernel /* start Linux kernel */ | 293 | jsr start_kernel /* start Linux kernel */ |
294 | 294 | ||
diff --git a/arch/m68k/coldfire/m5272.c b/arch/m68k/coldfire/m5272.c index c525e4c08f84..9abb1a441da0 100644 --- a/arch/m68k/coldfire/m5272.c +++ b/arch/m68k/coldfire/m5272.c | |||
@@ -111,7 +111,7 @@ void __init config_BSP(char *commandp, int size) | |||
111 | /***************************************************************************/ | 111 | /***************************************************************************/ |
112 | 112 | ||
113 | /* | 113 | /* |
114 | * Some 5272 based boards have the FEC ethernet diectly connected to | 114 | * Some 5272 based boards have the FEC ethernet directly connected to |
115 | * an ethernet switch. In this case we need to use the fixed phy type, | 115 | * an ethernet switch. In this case we need to use the fixed phy type, |
116 | * and we need to declare it early in boot. | 116 | * and we need to declare it early in boot. |
117 | */ | 117 | */ |
diff --git a/arch/m68k/coldfire/pci.c b/arch/m68k/coldfire/pci.c index 821de928dc3f..6a640be48568 100644 --- a/arch/m68k/coldfire/pci.c +++ b/arch/m68k/coldfire/pci.c | |||
@@ -42,7 +42,7 @@ static unsigned long iospace; | |||
42 | 42 | ||
43 | /* | 43 | /* |
44 | * We need to be carefull probing on bus 0 (directly connected to host | 44 | * We need to be carefull probing on bus 0 (directly connected to host |
45 | * bridge). We should only acccess the well defined possible devices in | 45 | * bridge). We should only access the well defined possible devices in |
46 | * use, ignore aliases and the like. | 46 | * use, ignore aliases and the like. |
47 | */ | 47 | */ |
48 | static unsigned char mcf_host_slot2sid[32] = { | 48 | static unsigned char mcf_host_slot2sid[32] = { |
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index 3ee6976f6088..8f5b6f7dd136 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -359,6 +360,7 @@ CONFIG_MACVTAP=m | |||
359 | CONFIG_IPVLAN=m | 360 | CONFIG_IPVLAN=m |
360 | CONFIG_VXLAN=m | 361 | CONFIG_VXLAN=m |
361 | CONFIG_GENEVE=m | 362 | CONFIG_GENEVE=m |
363 | CONFIG_GTP=m | ||
362 | CONFIG_MACSEC=m | 364 | CONFIG_MACSEC=m |
363 | CONFIG_NETCONSOLE=m | 365 | CONFIG_NETCONSOLE=m |
364 | CONFIG_NETCONSOLE_DYNAMIC=y | 366 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -553,7 +555,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
553 | CONFIG_TEST_KSTRTOX=m | 555 | CONFIG_TEST_KSTRTOX=m |
554 | CONFIG_TEST_PRINTF=m | 556 | CONFIG_TEST_PRINTF=m |
555 | CONFIG_TEST_BITMAP=m | 557 | CONFIG_TEST_BITMAP=m |
558 | CONFIG_TEST_UUID=m | ||
556 | CONFIG_TEST_RHASHTABLE=m | 559 | CONFIG_TEST_RHASHTABLE=m |
560 | CONFIG_TEST_HASH=m | ||
557 | CONFIG_TEST_LKM=m | 561 | CONFIG_TEST_LKM=m |
558 | CONFIG_TEST_USER_COPY=m | 562 | CONFIG_TEST_USER_COPY=m |
559 | CONFIG_TEST_BPF=m | 563 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index e96787ffcbce..31bded9c83d4 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -341,6 +342,7 @@ CONFIG_MACVTAP=m | |||
341 | CONFIG_IPVLAN=m | 342 | CONFIG_IPVLAN=m |
342 | CONFIG_VXLAN=m | 343 | CONFIG_VXLAN=m |
343 | CONFIG_GENEVE=m | 344 | CONFIG_GENEVE=m |
345 | CONFIG_GTP=m | ||
344 | CONFIG_MACSEC=m | 346 | CONFIG_MACSEC=m |
345 | CONFIG_NETCONSOLE=m | 347 | CONFIG_NETCONSOLE=m |
346 | CONFIG_NETCONSOLE_DYNAMIC=y | 348 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -512,7 +514,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
512 | CONFIG_TEST_KSTRTOX=m | 514 | CONFIG_TEST_KSTRTOX=m |
513 | CONFIG_TEST_PRINTF=m | 515 | CONFIG_TEST_PRINTF=m |
514 | CONFIG_TEST_BITMAP=m | 516 | CONFIG_TEST_BITMAP=m |
517 | CONFIG_TEST_UUID=m | ||
515 | CONFIG_TEST_RHASHTABLE=m | 518 | CONFIG_TEST_RHASHTABLE=m |
519 | CONFIG_TEST_HASH=m | ||
516 | CONFIG_TEST_LKM=m | 520 | CONFIG_TEST_LKM=m |
517 | CONFIG_TEST_USER_COPY=m | 521 | CONFIG_TEST_USER_COPY=m |
518 | CONFIG_TEST_BPF=m | 522 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index 083fe6beac14..0d7739e04ae2 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -350,6 +351,7 @@ CONFIG_MACVTAP=m | |||
350 | CONFIG_IPVLAN=m | 351 | CONFIG_IPVLAN=m |
351 | CONFIG_VXLAN=m | 352 | CONFIG_VXLAN=m |
352 | CONFIG_GENEVE=m | 353 | CONFIG_GENEVE=m |
354 | CONFIG_GTP=m | ||
353 | CONFIG_MACSEC=m | 355 | CONFIG_MACSEC=m |
354 | CONFIG_NETCONSOLE=m | 356 | CONFIG_NETCONSOLE=m |
355 | CONFIG_NETCONSOLE_DYNAMIC=y | 357 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -533,7 +535,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
533 | CONFIG_TEST_KSTRTOX=m | 535 | CONFIG_TEST_KSTRTOX=m |
534 | CONFIG_TEST_PRINTF=m | 536 | CONFIG_TEST_PRINTF=m |
535 | CONFIG_TEST_BITMAP=m | 537 | CONFIG_TEST_BITMAP=m |
538 | CONFIG_TEST_UUID=m | ||
536 | CONFIG_TEST_RHASHTABLE=m | 539 | CONFIG_TEST_RHASHTABLE=m |
540 | CONFIG_TEST_HASH=m | ||
537 | CONFIG_TEST_LKM=m | 541 | CONFIG_TEST_LKM=m |
538 | CONFIG_TEST_USER_COPY=m | 542 | CONFIG_TEST_USER_COPY=m |
539 | CONFIG_TEST_BPF=m | 543 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index 475130c06dcb..2cbb5c465fec 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -340,6 +341,7 @@ CONFIG_MACVTAP=m | |||
340 | CONFIG_IPVLAN=m | 341 | CONFIG_IPVLAN=m |
341 | CONFIG_VXLAN=m | 342 | CONFIG_VXLAN=m |
342 | CONFIG_GENEVE=m | 343 | CONFIG_GENEVE=m |
344 | CONFIG_GTP=m | ||
343 | CONFIG_MACSEC=m | 345 | CONFIG_MACSEC=m |
344 | CONFIG_NETCONSOLE=m | 346 | CONFIG_NETCONSOLE=m |
345 | CONFIG_NETCONSOLE_DYNAMIC=y | 347 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -504,7 +506,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
504 | CONFIG_TEST_KSTRTOX=m | 506 | CONFIG_TEST_KSTRTOX=m |
505 | CONFIG_TEST_PRINTF=m | 507 | CONFIG_TEST_PRINTF=m |
506 | CONFIG_TEST_BITMAP=m | 508 | CONFIG_TEST_BITMAP=m |
509 | CONFIG_TEST_UUID=m | ||
507 | CONFIG_TEST_RHASHTABLE=m | 510 | CONFIG_TEST_RHASHTABLE=m |
511 | CONFIG_TEST_HASH=m | ||
508 | CONFIG_TEST_LKM=m | 512 | CONFIG_TEST_LKM=m |
509 | CONFIG_TEST_USER_COPY=m | 513 | CONFIG_TEST_USER_COPY=m |
510 | CONFIG_TEST_BPF=m | 514 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index 4339658c200f..96102a42c156 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -341,6 +342,7 @@ CONFIG_MACVTAP=m | |||
341 | CONFIG_IPVLAN=m | 342 | CONFIG_IPVLAN=m |
342 | CONFIG_VXLAN=m | 343 | CONFIG_VXLAN=m |
343 | CONFIG_GENEVE=m | 344 | CONFIG_GENEVE=m |
345 | CONFIG_GTP=m | ||
344 | CONFIG_MACSEC=m | 346 | CONFIG_MACSEC=m |
345 | CONFIG_NETCONSOLE=m | 347 | CONFIG_NETCONSOLE=m |
346 | CONFIG_NETCONSOLE_DYNAMIC=y | 348 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -514,7 +516,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
514 | CONFIG_TEST_KSTRTOX=m | 516 | CONFIG_TEST_KSTRTOX=m |
515 | CONFIG_TEST_PRINTF=m | 517 | CONFIG_TEST_PRINTF=m |
516 | CONFIG_TEST_BITMAP=m | 518 | CONFIG_TEST_BITMAP=m |
519 | CONFIG_TEST_UUID=m | ||
517 | CONFIG_TEST_RHASHTABLE=m | 520 | CONFIG_TEST_RHASHTABLE=m |
521 | CONFIG_TEST_HASH=m | ||
518 | CONFIG_TEST_LKM=m | 522 | CONFIG_TEST_LKM=m |
519 | CONFIG_TEST_USER_COPY=m | 523 | CONFIG_TEST_USER_COPY=m |
520 | CONFIG_TEST_BPF=m | 524 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 831cc8c3a2e2..97d88f7dc5a7 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -357,6 +358,7 @@ CONFIG_MACVTAP=m | |||
357 | CONFIG_IPVLAN=m | 358 | CONFIG_IPVLAN=m |
358 | CONFIG_VXLAN=m | 359 | CONFIG_VXLAN=m |
359 | CONFIG_GENEVE=m | 360 | CONFIG_GENEVE=m |
361 | CONFIG_GTP=m | ||
360 | CONFIG_MACSEC=m | 362 | CONFIG_MACSEC=m |
361 | CONFIG_NETCONSOLE=m | 363 | CONFIG_NETCONSOLE=m |
362 | CONFIG_NETCONSOLE_DYNAMIC=y | 364 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -536,7 +538,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
536 | CONFIG_TEST_KSTRTOX=m | 538 | CONFIG_TEST_KSTRTOX=m |
537 | CONFIG_TEST_PRINTF=m | 539 | CONFIG_TEST_PRINTF=m |
538 | CONFIG_TEST_BITMAP=m | 540 | CONFIG_TEST_BITMAP=m |
541 | CONFIG_TEST_UUID=m | ||
539 | CONFIG_TEST_RHASHTABLE=m | 542 | CONFIG_TEST_RHASHTABLE=m |
543 | CONFIG_TEST_HASH=m | ||
540 | CONFIG_TEST_LKM=m | 544 | CONFIG_TEST_LKM=m |
541 | CONFIG_TEST_USER_COPY=m | 545 | CONFIG_TEST_USER_COPY=m |
542 | CONFIG_TEST_BPF=m | 546 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index 6377afeb522b..be25ef208f0f 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -390,6 +391,7 @@ CONFIG_MACVTAP=m | |||
390 | CONFIG_IPVLAN=m | 391 | CONFIG_IPVLAN=m |
391 | CONFIG_VXLAN=m | 392 | CONFIG_VXLAN=m |
392 | CONFIG_GENEVE=m | 393 | CONFIG_GENEVE=m |
394 | CONFIG_GTP=m | ||
393 | CONFIG_MACSEC=m | 395 | CONFIG_MACSEC=m |
394 | CONFIG_NETCONSOLE=m | 396 | CONFIG_NETCONSOLE=m |
395 | CONFIG_NETCONSOLE_DYNAMIC=y | 397 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -616,7 +618,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
616 | CONFIG_TEST_KSTRTOX=m | 618 | CONFIG_TEST_KSTRTOX=m |
617 | CONFIG_TEST_PRINTF=m | 619 | CONFIG_TEST_PRINTF=m |
618 | CONFIG_TEST_BITMAP=m | 620 | CONFIG_TEST_BITMAP=m |
621 | CONFIG_TEST_UUID=m | ||
619 | CONFIG_TEST_RHASHTABLE=m | 622 | CONFIG_TEST_RHASHTABLE=m |
623 | CONFIG_TEST_HASH=m | ||
620 | CONFIG_TEST_LKM=m | 624 | CONFIG_TEST_LKM=m |
621 | CONFIG_TEST_USER_COPY=m | 625 | CONFIG_TEST_USER_COPY=m |
622 | CONFIG_TEST_BPF=m | 626 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index 4304b3d56262..a008344360c9 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -339,6 +340,7 @@ CONFIG_MACVTAP=m | |||
339 | CONFIG_IPVLAN=m | 340 | CONFIG_IPVLAN=m |
340 | CONFIG_VXLAN=m | 341 | CONFIG_VXLAN=m |
341 | CONFIG_GENEVE=m | 342 | CONFIG_GENEVE=m |
343 | CONFIG_GTP=m | ||
342 | CONFIG_MACSEC=m | 344 | CONFIG_MACSEC=m |
343 | CONFIG_NETCONSOLE=m | 345 | CONFIG_NETCONSOLE=m |
344 | CONFIG_NETCONSOLE_DYNAMIC=y | 346 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -504,7 +506,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
504 | CONFIG_TEST_KSTRTOX=m | 506 | CONFIG_TEST_KSTRTOX=m |
505 | CONFIG_TEST_PRINTF=m | 507 | CONFIG_TEST_PRINTF=m |
506 | CONFIG_TEST_BITMAP=m | 508 | CONFIG_TEST_BITMAP=m |
509 | CONFIG_TEST_UUID=m | ||
507 | CONFIG_TEST_RHASHTABLE=m | 510 | CONFIG_TEST_RHASHTABLE=m |
511 | CONFIG_TEST_HASH=m | ||
508 | CONFIG_TEST_LKM=m | 512 | CONFIG_TEST_LKM=m |
509 | CONFIG_TEST_USER_COPY=m | 513 | CONFIG_TEST_USER_COPY=m |
510 | CONFIG_TEST_BPF=m | 514 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 074bda4094ff..6735a25f36d4 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -340,6 +341,7 @@ CONFIG_MACVTAP=m | |||
340 | CONFIG_IPVLAN=m | 341 | CONFIG_IPVLAN=m |
341 | CONFIG_VXLAN=m | 342 | CONFIG_VXLAN=m |
342 | CONFIG_GENEVE=m | 343 | CONFIG_GENEVE=m |
344 | CONFIG_GTP=m | ||
343 | CONFIG_MACSEC=m | 345 | CONFIG_MACSEC=m |
344 | CONFIG_NETCONSOLE=m | 346 | CONFIG_NETCONSOLE=m |
345 | CONFIG_NETCONSOLE_DYNAMIC=y | 347 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -504,7 +506,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
504 | CONFIG_TEST_KSTRTOX=m | 506 | CONFIG_TEST_KSTRTOX=m |
505 | CONFIG_TEST_PRINTF=m | 507 | CONFIG_TEST_PRINTF=m |
506 | CONFIG_TEST_BITMAP=m | 508 | CONFIG_TEST_BITMAP=m |
509 | CONFIG_TEST_UUID=m | ||
507 | CONFIG_TEST_RHASHTABLE=m | 510 | CONFIG_TEST_RHASHTABLE=m |
511 | CONFIG_TEST_HASH=m | ||
508 | CONFIG_TEST_LKM=m | 512 | CONFIG_TEST_LKM=m |
509 | CONFIG_TEST_USER_COPY=m | 513 | CONFIG_TEST_USER_COPY=m |
510 | CONFIG_TEST_BPF=m | 514 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index 07b9fa8d7f2e..780c6e9f6cf9 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -346,6 +347,7 @@ CONFIG_MACVTAP=m | |||
346 | CONFIG_IPVLAN=m | 347 | CONFIG_IPVLAN=m |
347 | CONFIG_VXLAN=m | 348 | CONFIG_VXLAN=m |
348 | CONFIG_GENEVE=m | 349 | CONFIG_GENEVE=m |
350 | CONFIG_GTP=m | ||
349 | CONFIG_MACSEC=m | 351 | CONFIG_MACSEC=m |
350 | CONFIG_NETCONSOLE=m | 352 | CONFIG_NETCONSOLE=m |
351 | CONFIG_NETCONSOLE_DYNAMIC=y | 353 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -527,7 +529,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
527 | CONFIG_TEST_KSTRTOX=m | 529 | CONFIG_TEST_KSTRTOX=m |
528 | CONFIG_TEST_PRINTF=m | 530 | CONFIG_TEST_PRINTF=m |
529 | CONFIG_TEST_BITMAP=m | 531 | CONFIG_TEST_BITMAP=m |
532 | CONFIG_TEST_UUID=m | ||
530 | CONFIG_TEST_RHASHTABLE=m | 533 | CONFIG_TEST_RHASHTABLE=m |
534 | CONFIG_TEST_HASH=m | ||
531 | CONFIG_TEST_LKM=m | 535 | CONFIG_TEST_LKM=m |
532 | CONFIG_TEST_USER_COPY=m | 536 | CONFIG_TEST_USER_COPY=m |
533 | CONFIG_TEST_BPF=m | 537 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index 36e6fae02d45..44693cf361e5 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -337,6 +338,7 @@ CONFIG_MACVTAP=m | |||
337 | CONFIG_IPVLAN=m | 338 | CONFIG_IPVLAN=m |
338 | CONFIG_VXLAN=m | 339 | CONFIG_VXLAN=m |
339 | CONFIG_GENEVE=m | 340 | CONFIG_GENEVE=m |
341 | CONFIG_GTP=m | ||
340 | CONFIG_MACSEC=m | 342 | CONFIG_MACSEC=m |
341 | CONFIG_NETCONSOLE=m | 343 | CONFIG_NETCONSOLE=m |
342 | CONFIG_NETCONSOLE_DYNAMIC=y | 344 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -506,7 +508,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
506 | CONFIG_TEST_KSTRTOX=m | 508 | CONFIG_TEST_KSTRTOX=m |
507 | CONFIG_TEST_PRINTF=m | 509 | CONFIG_TEST_PRINTF=m |
508 | CONFIG_TEST_BITMAP=m | 510 | CONFIG_TEST_BITMAP=m |
511 | CONFIG_TEST_UUID=m | ||
509 | CONFIG_TEST_RHASHTABLE=m | 512 | CONFIG_TEST_RHASHTABLE=m |
513 | CONFIG_TEST_HASH=m | ||
510 | CONFIG_TEST_LKM=m | 514 | CONFIG_TEST_LKM=m |
511 | CONFIG_TEST_USER_COPY=m | 515 | CONFIG_TEST_USER_COPY=m |
512 | CONFIG_TEST_BPF=m | 516 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index 903acf929511..ef0071d61158 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_defconfig | |||
@@ -9,6 +9,7 @@ CONFIG_LOG_BUF_SHIFT=16 | |||
9 | # CONFIG_PID_NS is not set | 9 | # CONFIG_PID_NS is not set |
10 | # CONFIG_NET_NS is not set | 10 | # CONFIG_NET_NS is not set |
11 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
12 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
12 | CONFIG_USERFAULTFD=y | 13 | CONFIG_USERFAULTFD=y |
13 | CONFIG_SLAB=y | 14 | CONFIG_SLAB=y |
14 | CONFIG_MODULES=y | 15 | CONFIG_MODULES=y |
@@ -337,6 +338,7 @@ CONFIG_MACVTAP=m | |||
337 | CONFIG_IPVLAN=m | 338 | CONFIG_IPVLAN=m |
338 | CONFIG_VXLAN=m | 339 | CONFIG_VXLAN=m |
339 | CONFIG_GENEVE=m | 340 | CONFIG_GENEVE=m |
341 | CONFIG_GTP=m | ||
340 | CONFIG_MACSEC=m | 342 | CONFIG_MACSEC=m |
341 | CONFIG_NETCONSOLE=m | 343 | CONFIG_NETCONSOLE=m |
342 | CONFIG_NETCONSOLE_DYNAMIC=y | 344 | CONFIG_NETCONSOLE_DYNAMIC=y |
@@ -506,7 +508,9 @@ CONFIG_TEST_STRING_HELPERS=m | |||
506 | CONFIG_TEST_KSTRTOX=m | 508 | CONFIG_TEST_KSTRTOX=m |
507 | CONFIG_TEST_PRINTF=m | 509 | CONFIG_TEST_PRINTF=m |
508 | CONFIG_TEST_BITMAP=m | 510 | CONFIG_TEST_BITMAP=m |
511 | CONFIG_TEST_UUID=m | ||
509 | CONFIG_TEST_RHASHTABLE=m | 512 | CONFIG_TEST_RHASHTABLE=m |
513 | CONFIG_TEST_HASH=m | ||
510 | CONFIG_TEST_LKM=m | 514 | CONFIG_TEST_LKM=m |
511 | CONFIG_TEST_USER_COPY=m | 515 | CONFIG_TEST_USER_COPY=m |
512 | CONFIG_TEST_BPF=m | 516 | CONFIG_TEST_BPF=m |
diff --git a/arch/m68k/ifpsp060/src/fpsp.S b/arch/m68k/ifpsp060/src/fpsp.S index 78cb60f5bb4d..9bbffebe3eb5 100644 --- a/arch/m68k/ifpsp060/src/fpsp.S +++ b/arch/m68k/ifpsp060/src/fpsp.S | |||
@@ -10191,7 +10191,7 @@ xdnrm_con: | |||
10191 | xdnrm_sd: | 10191 | xdnrm_sd: |
10192 | mov.l %a1,-(%sp) | 10192 | mov.l %a1,-(%sp) |
10193 | tst.b LOCAL_EX(%a0) # is denorm pos or neg? | 10193 | tst.b LOCAL_EX(%a0) # is denorm pos or neg? |
10194 | smi.b %d1 # set d0 accodingly | 10194 | smi.b %d1 # set d0 accordingly |
10195 | bsr.l unf_sub | 10195 | bsr.l unf_sub |
10196 | mov.l (%sp)+,%a1 | 10196 | mov.l (%sp)+,%a1 |
10197 | xdnrm_exit: | 10197 | xdnrm_exit: |
@@ -10990,7 +10990,7 @@ src_qnan_m: | |||
10990 | # routines where an instruction is selected by an index into | 10990 | # routines where an instruction is selected by an index into |
10991 | # a large jump table corresponding to a given instruction which | 10991 | # a large jump table corresponding to a given instruction which |
10992 | # has been decoded. Flow continues here where we now decode | 10992 | # has been decoded. Flow continues here where we now decode |
10993 | # further accoding to the source operand type. | 10993 | # further according to the source operand type. |
10994 | # | 10994 | # |
10995 | 10995 | ||
10996 | global fsinh | 10996 | global fsinh |
@@ -23196,14 +23196,14 @@ m_sign: | |||
23196 | # | 23196 | # |
23197 | # 1. Branch on the sign of the adjusted exponent. | 23197 | # 1. Branch on the sign of the adjusted exponent. |
23198 | # 2p.(positive exp) | 23198 | # 2p.(positive exp) |
23199 | # 2. Check M16 and the digits in lwords 2 and 3 in decending order. | 23199 | # 2. Check M16 and the digits in lwords 2 and 3 in descending order. |
23200 | # 3. Add one for each zero encountered until a non-zero digit. | 23200 | # 3. Add one for each zero encountered until a non-zero digit. |
23201 | # 4. Subtract the count from the exp. | 23201 | # 4. Subtract the count from the exp. |
23202 | # 5. Check if the exp has crossed zero in #3 above; make the exp abs | 23202 | # 5. Check if the exp has crossed zero in #3 above; make the exp abs |
23203 | # and set SE. | 23203 | # and set SE. |
23204 | # 6. Multiply the mantissa by 10**count. | 23204 | # 6. Multiply the mantissa by 10**count. |
23205 | # 2n.(negative exp) | 23205 | # 2n.(negative exp) |
23206 | # 2. Check the digits in lwords 3 and 2 in decending order. | 23206 | # 2. Check the digits in lwords 3 and 2 in descending order. |
23207 | # 3. Add one for each zero encountered until a non-zero digit. | 23207 | # 3. Add one for each zero encountered until a non-zero digit. |
23208 | # 4. Add the count to the exp. | 23208 | # 4. Add the count to the exp. |
23209 | # 5. Check if the exp has crossed zero in #3 above; clear SE. | 23209 | # 5. Check if the exp has crossed zero in #3 above; clear SE. |
diff --git a/arch/m68k/ifpsp060/src/pfpsp.S b/arch/m68k/ifpsp060/src/pfpsp.S index 4aedef973cf6..3535e6c87eec 100644 --- a/arch/m68k/ifpsp060/src/pfpsp.S +++ b/arch/m68k/ifpsp060/src/pfpsp.S | |||
@@ -13156,14 +13156,14 @@ m_sign: | |||
13156 | # | 13156 | # |
13157 | # 1. Branch on the sign of the adjusted exponent. | 13157 | # 1. Branch on the sign of the adjusted exponent. |
13158 | # 2p.(positive exp) | 13158 | # 2p.(positive exp) |
13159 | # 2. Check M16 and the digits in lwords 2 and 3 in decending order. | 13159 | # 2. Check M16 and the digits in lwords 2 and 3 in descending order. |
13160 | # 3. Add one for each zero encountered until a non-zero digit. | 13160 | # 3. Add one for each zero encountered until a non-zero digit. |
13161 | # 4. Subtract the count from the exp. | 13161 | # 4. Subtract the count from the exp. |
13162 | # 5. Check if the exp has crossed zero in #3 above; make the exp abs | 13162 | # 5. Check if the exp has crossed zero in #3 above; make the exp abs |
13163 | # and set SE. | 13163 | # and set SE. |
13164 | # 6. Multiply the mantissa by 10**count. | 13164 | # 6. Multiply the mantissa by 10**count. |
13165 | # 2n.(negative exp) | 13165 | # 2n.(negative exp) |
13166 | # 2. Check the digits in lwords 3 and 2 in decending order. | 13166 | # 2. Check the digits in lwords 3 and 2 in descending order. |
13167 | # 3. Add one for each zero encountered until a non-zero digit. | 13167 | # 3. Add one for each zero encountered until a non-zero digit. |
13168 | # 4. Add the count to the exp. | 13168 | # 4. Add the count to the exp. |
13169 | # 5. Check if the exp has crossed zero in #3 above; clear SE. | 13169 | # 5. Check if the exp has crossed zero in #3 above; clear SE. |
diff --git a/arch/m68k/include/asm/dma.h b/arch/m68k/include/asm/dma.h index 429fe26e320c..208b4daa14b3 100644 --- a/arch/m68k/include/asm/dma.h +++ b/arch/m68k/include/asm/dma.h | |||
@@ -18,7 +18,7 @@ | |||
18 | * AUG/22/2000 : added support for 32-bit Dual-Address-Mode (K) 2000 | 18 | * AUG/22/2000 : added support for 32-bit Dual-Address-Mode (K) 2000 |
19 | * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de) | 19 | * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de) |
20 | * | 20 | * |
21 | * AUG/25/2000 : addad support for 8, 16 and 32-bit Single-Address-Mode (K)2000 | 21 | * AUG/25/2000 : added support for 8, 16 and 32-bit Single-Address-Mode (K)2000 |
22 | * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de) | 22 | * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de) |
23 | * | 23 | * |
24 | * APR/18/2002 : added proper support for MCF5272 DMA controller. | 24 | * APR/18/2002 : added proper support for MCF5272 DMA controller. |
diff --git a/arch/m68k/include/asm/m525xsim.h b/arch/m68k/include/asm/m525xsim.h index f186459072e9..699f20c8a0fe 100644 --- a/arch/m68k/include/asm/m525xsim.h +++ b/arch/m68k/include/asm/m525xsim.h | |||
@@ -123,10 +123,10 @@ | |||
123 | /* | 123 | /* |
124 | * I2C module. | 124 | * I2C module. |
125 | */ | 125 | */ |
126 | #define MCFI2C_BASE0 (MCF_MBAR + 0x280) /* Base addreess I2C0 */ | 126 | #define MCFI2C_BASE0 (MCF_MBAR + 0x280) /* Base address I2C0 */ |
127 | #define MCFI2C_SIZE0 0x20 /* Register set size */ | 127 | #define MCFI2C_SIZE0 0x20 /* Register set size */ |
128 | 128 | ||
129 | #define MCFI2C_BASE1 (MCF_MBAR2 + 0x440) /* Base addreess I2C1 */ | 129 | #define MCFI2C_BASE1 (MCF_MBAR2 + 0x440) /* Base address I2C1 */ |
130 | #define MCFI2C_SIZE1 0x20 /* Register set size */ | 130 | #define MCFI2C_SIZE1 0x20 /* Register set size */ |
131 | 131 | ||
132 | /* | 132 | /* |
diff --git a/arch/m68k/include/asm/mcfmmu.h b/arch/m68k/include/asm/mcfmmu.h index 26cc3d5a63f8..8824236e303f 100644 --- a/arch/m68k/include/asm/mcfmmu.h +++ b/arch/m68k/include/asm/mcfmmu.h | |||
@@ -38,7 +38,7 @@ | |||
38 | /* | 38 | /* |
39 | * MMU Operation register. | 39 | * MMU Operation register. |
40 | */ | 40 | */ |
41 | #define MMUOR_UAA 0x00000001 /* Update allocatiom address */ | 41 | #define MMUOR_UAA 0x00000001 /* Update allocation address */ |
42 | #define MMUOR_ACC 0x00000002 /* TLB access */ | 42 | #define MMUOR_ACC 0x00000002 /* TLB access */ |
43 | #define MMUOR_RD 0x00000004 /* TLB access read */ | 43 | #define MMUOR_RD 0x00000004 /* TLB access read */ |
44 | #define MMUOR_WR 0x00000000 /* TLB access write */ | 44 | #define MMUOR_WR 0x00000000 /* TLB access write */ |
diff --git a/arch/m68k/include/asm/q40_master.h b/arch/m68k/include/asm/q40_master.h index fc5b36278d04..c48d21b68f04 100644 --- a/arch/m68k/include/asm/q40_master.h +++ b/arch/m68k/include/asm/q40_master.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Q40 master Chip Control | 2 | * Q40 master Chip Control |
3 | * RTC stuff merged for compactnes.. | 3 | * RTC stuff merged for compactness. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef _Q40_MASTER_H | 6 | #ifndef _Q40_MASTER_H |
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 4d2adfb32a2a..7990b6f50105 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c | |||
@@ -60,7 +60,7 @@ | |||
60 | * | 60 | * |
61 | * The host talks to the IOPs using a rather simple message-passing scheme via | 61 | * The host talks to the IOPs using a rather simple message-passing scheme via |
62 | * a shared memory area in the IOP RAM. Each IOP has seven "channels"; each | 62 | * a shared memory area in the IOP RAM. Each IOP has seven "channels"; each |
63 | * channel is conneced to a specific software driver on the IOP. For example | 63 | * channel is connected to a specific software driver on the IOP. For example |
64 | * on the SCC IOP there is one channel for each serial port. Each channel has | 64 | * on the SCC IOP there is one channel for each serial port. Each channel has |
65 | * an incoming and and outgoing message queue with a depth of one. | 65 | * an incoming and and outgoing message queue with a depth of one. |
66 | * | 66 | * |
diff --git a/arch/m68k/math-emu/fp_decode.h b/arch/m68k/math-emu/fp_decode.h index 759679d9ab96..6d1e760e2a0e 100644 --- a/arch/m68k/math-emu/fp_decode.h +++ b/arch/m68k/math-emu/fp_decode.h | |||
@@ -130,7 +130,7 @@ do_fscc=0 | |||
130 | bfextu %d2{#13,#3},%d0 | 130 | bfextu %d2{#13,#3},%d0 |
131 | .endm | 131 | .endm |
132 | 132 | ||
133 | | decode the 8bit diplacement from the brief extension word | 133 | | decode the 8bit displacement from the brief extension word |
134 | .macro fp_decode_disp8 | 134 | .macro fp_decode_disp8 |
135 | move.b %d2,%d0 | 135 | move.b %d2,%d0 |
136 | ext.w %d0 | 136 | ext.w %d0 |
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index f53816744d60..7d44e888134f 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h | |||
@@ -633,7 +633,7 @@ static inline struct page *pmd_page(pmd_t pmd) | |||
633 | 633 | ||
634 | static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) | 634 | static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) |
635 | { | 635 | { |
636 | pmd_val(pmd) = (pmd_val(pmd) & _PAGE_CHG_MASK) | | 636 | pmd_val(pmd) = (pmd_val(pmd) & (_PAGE_CHG_MASK | _PAGE_HUGE)) | |
637 | (pgprot_val(newprot) & ~_PAGE_CHG_MASK); | 637 | (pgprot_val(newprot) & ~_PAGE_CHG_MASK); |
638 | return pmd; | 638 | return pmd; |
639 | } | 639 | } |
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 33787ee817f0..91eac39625be 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c | |||
@@ -263,7 +263,7 @@ static bool check_hw_exists(void) | |||
263 | 263 | ||
264 | msr_fail: | 264 | msr_fail: |
265 | pr_cont("Broken PMU hardware detected, using software events only.\n"); | 265 | pr_cont("Broken PMU hardware detected, using software events only.\n"); |
266 | pr_info("%sFailed to access perfctr msr (MSR %x is %Lx)\n", | 266 | printk("%sFailed to access perfctr msr (MSR %x is %Lx)\n", |
267 | boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR, | 267 | boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR, |
268 | reg, val_new); | 268 | reg, val_new); |
269 | 269 | ||
@@ -2319,7 +2319,7 @@ void | |||
2319 | perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) | 2319 | perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) |
2320 | { | 2320 | { |
2321 | struct stack_frame frame; | 2321 | struct stack_frame frame; |
2322 | const void __user *fp; | 2322 | const unsigned long __user *fp; |
2323 | 2323 | ||
2324 | if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { | 2324 | if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
2325 | /* TODO: We don't support guest os callchain now */ | 2325 | /* TODO: We don't support guest os callchain now */ |
@@ -2332,7 +2332,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs | |||
2332 | if (regs->flags & (X86_VM_MASK | PERF_EFLAGS_VM)) | 2332 | if (regs->flags & (X86_VM_MASK | PERF_EFLAGS_VM)) |
2333 | return; | 2333 | return; |
2334 | 2334 | ||
2335 | fp = (void __user *)regs->bp; | 2335 | fp = (unsigned long __user *)regs->bp; |
2336 | 2336 | ||
2337 | perf_callchain_store(entry, regs->ip); | 2337 | perf_callchain_store(entry, regs->ip); |
2338 | 2338 | ||
@@ -2345,16 +2345,17 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs | |||
2345 | pagefault_disable(); | 2345 | pagefault_disable(); |
2346 | while (entry->nr < entry->max_stack) { | 2346 | while (entry->nr < entry->max_stack) { |
2347 | unsigned long bytes; | 2347 | unsigned long bytes; |
2348 | |||
2348 | frame.next_frame = NULL; | 2349 | frame.next_frame = NULL; |
2349 | frame.return_address = 0; | 2350 | frame.return_address = 0; |
2350 | 2351 | ||
2351 | if (!access_ok(VERIFY_READ, fp, 16)) | 2352 | if (!access_ok(VERIFY_READ, fp, sizeof(*fp) * 2)) |
2352 | break; | 2353 | break; |
2353 | 2354 | ||
2354 | bytes = __copy_from_user_nmi(&frame.next_frame, fp, 8); | 2355 | bytes = __copy_from_user_nmi(&frame.next_frame, fp, sizeof(*fp)); |
2355 | if (bytes != 0) | 2356 | if (bytes != 0) |
2356 | break; | 2357 | break; |
2357 | bytes = __copy_from_user_nmi(&frame.return_address, fp+8, 8); | 2358 | bytes = __copy_from_user_nmi(&frame.return_address, fp + 1, sizeof(*fp)); |
2358 | if (bytes != 0) | 2359 | if (bytes != 0) |
2359 | break; | 2360 | break; |
2360 | 2361 | ||
diff --git a/arch/x86/events/intel/Makefile b/arch/x86/events/intel/Makefile index 3660b2cf245a..06c2baa51814 100644 --- a/arch/x86/events/intel/Makefile +++ b/arch/x86/events/intel/Makefile | |||
@@ -1,8 +1,8 @@ | |||
1 | obj-$(CONFIG_CPU_SUP_INTEL) += core.o bts.o cqm.o | 1 | obj-$(CONFIG_CPU_SUP_INTEL) += core.o bts.o cqm.o |
2 | obj-$(CONFIG_CPU_SUP_INTEL) += ds.o knc.o | 2 | obj-$(CONFIG_CPU_SUP_INTEL) += ds.o knc.o |
3 | obj-$(CONFIG_CPU_SUP_INTEL) += lbr.o p4.o p6.o pt.o | 3 | obj-$(CONFIG_CPU_SUP_INTEL) += lbr.o p4.o p6.o pt.o |
4 | obj-$(CONFIG_PERF_EVENTS_INTEL_RAPL) += intel-rapl.o | 4 | obj-$(CONFIG_PERF_EVENTS_INTEL_RAPL) += intel-rapl-perf.o |
5 | intel-rapl-objs := rapl.o | 5 | intel-rapl-perf-objs := rapl.o |
6 | obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel-uncore.o | 6 | obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel-uncore.o |
7 | intel-uncore-objs := uncore.o uncore_nhmex.o uncore_snb.o uncore_snbep.o | 7 | intel-uncore-objs := uncore.o uncore_nhmex.o uncore_snb.o uncore_snbep.o |
8 | obj-$(CONFIG_PERF_EVENTS_INTEL_CSTATE) += intel-cstate.o | 8 | obj-$(CONFIG_PERF_EVENTS_INTEL_CSTATE) += intel-cstate.o |
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 7c666958a625..9b4f9d3ce465 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c | |||
@@ -115,6 +115,10 @@ static struct event_constraint intel_snb_event_constraints[] __read_mostly = | |||
115 | INTEL_UEVENT_CONSTRAINT(0x04a3, 0xf), /* CYCLE_ACTIVITY.CYCLES_NO_DISPATCH */ | 115 | INTEL_UEVENT_CONSTRAINT(0x04a3, 0xf), /* CYCLE_ACTIVITY.CYCLES_NO_DISPATCH */ |
116 | INTEL_UEVENT_CONSTRAINT(0x02a3, 0x4), /* CYCLE_ACTIVITY.CYCLES_L1D_PENDING */ | 116 | INTEL_UEVENT_CONSTRAINT(0x02a3, 0x4), /* CYCLE_ACTIVITY.CYCLES_L1D_PENDING */ |
117 | 117 | ||
118 | /* | ||
119 | * When HT is off these events can only run on the bottom 4 counters | ||
120 | * When HT is on, they are impacted by the HT bug and require EXCL access | ||
121 | */ | ||
118 | INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf), /* MEM_UOPS_RETIRED.* */ | 122 | INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf), /* MEM_UOPS_RETIRED.* */ |
119 | INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ | 123 | INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ |
120 | INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ | 124 | INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ |
@@ -139,6 +143,10 @@ static struct event_constraint intel_ivb_event_constraints[] __read_mostly = | |||
139 | INTEL_UEVENT_CONSTRAINT(0x0ca3, 0x4), /* CYCLE_ACTIVITY.STALLS_L1D_PENDING */ | 143 | INTEL_UEVENT_CONSTRAINT(0x0ca3, 0x4), /* CYCLE_ACTIVITY.STALLS_L1D_PENDING */ |
140 | INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PREC_DIST */ | 144 | INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PREC_DIST */ |
141 | 145 | ||
146 | /* | ||
147 | * When HT is off these events can only run on the bottom 4 counters | ||
148 | * When HT is on, they are impacted by the HT bug and require EXCL access | ||
149 | */ | ||
142 | INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf), /* MEM_UOPS_RETIRED.* */ | 150 | INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf), /* MEM_UOPS_RETIRED.* */ |
143 | INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ | 151 | INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ |
144 | INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ | 152 | INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ |
@@ -182,6 +190,16 @@ struct event_constraint intel_skl_event_constraints[] = { | |||
182 | FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ | 190 | FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ |
183 | FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */ | 191 | FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */ |
184 | INTEL_UEVENT_CONSTRAINT(0x1c0, 0x2), /* INST_RETIRED.PREC_DIST */ | 192 | INTEL_UEVENT_CONSTRAINT(0x1c0, 0x2), /* INST_RETIRED.PREC_DIST */ |
193 | |||
194 | /* | ||
195 | * when HT is off, these can only run on the bottom 4 counters | ||
196 | */ | ||
197 | INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_INST_RETIRED.* */ | ||
198 | INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_RETIRED.* */ | ||
199 | INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_L3_HIT_RETIRED.* */ | ||
200 | INTEL_EVENT_CONSTRAINT(0xcd, 0xf), /* MEM_TRANS_RETIRED.* */ | ||
201 | INTEL_EVENT_CONSTRAINT(0xc6, 0xf), /* FRONTEND_RETIRED.* */ | ||
202 | |||
185 | EVENT_CONSTRAINT_END | 203 | EVENT_CONSTRAINT_END |
186 | }; | 204 | }; |
187 | 205 | ||
@@ -250,6 +268,10 @@ static struct event_constraint intel_hsw_event_constraints[] = { | |||
250 | /* CYCLE_ACTIVITY.CYCLES_NO_EXECUTE */ | 268 | /* CYCLE_ACTIVITY.CYCLES_NO_EXECUTE */ |
251 | INTEL_UEVENT_CONSTRAINT(0x04a3, 0xf), | 269 | INTEL_UEVENT_CONSTRAINT(0x04a3, 0xf), |
252 | 270 | ||
271 | /* | ||
272 | * When HT is off these events can only run on the bottom 4 counters | ||
273 | * When HT is on, they are impacted by the HT bug and require EXCL access | ||
274 | */ | ||
253 | INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf), /* MEM_UOPS_RETIRED.* */ | 275 | INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf), /* MEM_UOPS_RETIRED.* */ |
254 | INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ | 276 | INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ |
255 | INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ | 277 | INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ |
@@ -264,6 +286,13 @@ struct event_constraint intel_bdw_event_constraints[] = { | |||
264 | FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */ | 286 | FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */ |
265 | INTEL_UEVENT_CONSTRAINT(0x148, 0x4), /* L1D_PEND_MISS.PENDING */ | 287 | INTEL_UEVENT_CONSTRAINT(0x148, 0x4), /* L1D_PEND_MISS.PENDING */ |
266 | INTEL_UBIT_EVENT_CONSTRAINT(0x8a3, 0x4), /* CYCLE_ACTIVITY.CYCLES_L1D_MISS */ | 288 | INTEL_UBIT_EVENT_CONSTRAINT(0x8a3, 0x4), /* CYCLE_ACTIVITY.CYCLES_L1D_MISS */ |
289 | /* | ||
290 | * when HT is off, these can only run on the bottom 4 counters | ||
291 | */ | ||
292 | INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_INST_RETIRED.* */ | ||
293 | INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_RETIRED.* */ | ||
294 | INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_L3_HIT_RETIRED.* */ | ||
295 | INTEL_EVENT_CONSTRAINT(0xcd, 0xf), /* MEM_TRANS_RETIRED.* */ | ||
267 | EVENT_CONSTRAINT_END | 296 | EVENT_CONSTRAINT_END |
268 | }; | 297 | }; |
269 | 298 | ||
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 4a413485f9eb..c64b1e9c5d1a 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h | |||
@@ -301,10 +301,6 @@ | |||
301 | #define X86_BUG_FXSAVE_LEAK X86_BUG(6) /* FXSAVE leaks FOP/FIP/FOP */ | 301 | #define X86_BUG_FXSAVE_LEAK X86_BUG(6) /* FXSAVE leaks FOP/FIP/FOP */ |
302 | #define X86_BUG_CLFLUSH_MONITOR X86_BUG(7) /* AAI65, CLFLUSH required before MONITOR */ | 302 | #define X86_BUG_CLFLUSH_MONITOR X86_BUG(7) /* AAI65, CLFLUSH required before MONITOR */ |
303 | #define X86_BUG_SYSRET_SS_ATTRS X86_BUG(8) /* SYSRET doesn't fix up SS attrs */ | 303 | #define X86_BUG_SYSRET_SS_ATTRS X86_BUG(8) /* SYSRET doesn't fix up SS attrs */ |
304 | #define X86_BUG_NULL_SEG X86_BUG(9) /* Nulling a selector preserves the base */ | ||
305 | #define X86_BUG_SWAPGS_FENCE X86_BUG(10) /* SWAPGS without input dep on GS */ | ||
306 | |||
307 | |||
308 | #ifdef CONFIG_X86_32 | 304 | #ifdef CONFIG_X86_32 |
309 | /* | 305 | /* |
310 | * 64-bit kernels don't use X86_BUG_ESPFIX. Make the define conditional | 306 | * 64-bit kernels don't use X86_BUG_ESPFIX. Make the define conditional |
@@ -312,5 +308,7 @@ | |||
312 | */ | 308 | */ |
313 | #define X86_BUG_ESPFIX X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */ | 309 | #define X86_BUG_ESPFIX X86_BUG(9) /* "" IRET to 16-bit SS corrupts ESP/RSP high bits */ |
314 | #endif | 310 | #endif |
311 | #define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */ | ||
312 | #define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */ | ||
315 | 313 | ||
316 | #endif /* _ASM_X86_CPUFEATURES_H */ | 314 | #endif /* _ASM_X86_CPUFEATURES_H */ |
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index a147e676fc7b..e991d5c8bb3a 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c | |||
@@ -71,8 +71,8 @@ int amd_cache_northbridges(void) | |||
71 | while ((misc = next_northbridge(misc, amd_nb_misc_ids)) != NULL) | 71 | while ((misc = next_northbridge(misc, amd_nb_misc_ids)) != NULL) |
72 | i++; | 72 | i++; |
73 | 73 | ||
74 | if (i == 0) | 74 | if (!i) |
75 | return 0; | 75 | return -ENODEV; |
76 | 76 | ||
77 | nb = kzalloc(i * sizeof(struct amd_northbridge), GFP_KERNEL); | 77 | nb = kzalloc(i * sizeof(struct amd_northbridge), GFP_KERNEL); |
78 | if (!nb) | 78 | if (!nb) |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index bca14c899137..57b71373bae3 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
@@ -11,7 +11,11 @@ | |||
11 | 11 | ||
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/acpi.h> | 13 | #include <linux/acpi.h> |
14 | #include <linux/delay.h> | ||
15 | #include <linux/dmi.h> | ||
14 | #include <linux/pci_ids.h> | 16 | #include <linux/pci_ids.h> |
17 | #include <linux/bcma/bcma.h> | ||
18 | #include <linux/bcma/bcma_regs.h> | ||
15 | #include <drm/i915_drm.h> | 19 | #include <drm/i915_drm.h> |
16 | #include <asm/pci-direct.h> | 20 | #include <asm/pci-direct.h> |
17 | #include <asm/dma.h> | 21 | #include <asm/dma.h> |
@@ -21,6 +25,9 @@ | |||
21 | #include <asm/iommu.h> | 25 | #include <asm/iommu.h> |
22 | #include <asm/gart.h> | 26 | #include <asm/gart.h> |
23 | #include <asm/irq_remapping.h> | 27 | #include <asm/irq_remapping.h> |
28 | #include <asm/early_ioremap.h> | ||
29 | |||
30 | #define dev_err(msg) pr_err("pci 0000:%02x:%02x.%d: %s", bus, slot, func, msg) | ||
24 | 31 | ||
25 | static void __init fix_hypertransport_config(int num, int slot, int func) | 32 | static void __init fix_hypertransport_config(int num, int slot, int func) |
26 | { | 33 | { |
@@ -76,6 +83,13 @@ static void __init nvidia_bugs(int num, int slot, int func) | |||
76 | #ifdef CONFIG_ACPI | 83 | #ifdef CONFIG_ACPI |
77 | #ifdef CONFIG_X86_IO_APIC | 84 | #ifdef CONFIG_X86_IO_APIC |
78 | /* | 85 | /* |
86 | * Only applies to Nvidia root ports (bus 0) and not to | ||
87 | * Nvidia graphics cards with PCI ports on secondary buses. | ||
88 | */ | ||
89 | if (num) | ||
90 | return; | ||
91 | |||
92 | /* | ||
79 | * All timer overrides on Nvidia are | 93 | * All timer overrides on Nvidia are |
80 | * wrong unless HPET is enabled. | 94 | * wrong unless HPET is enabled. |
81 | * Unfortunately that's not true on many Asus boards. | 95 | * Unfortunately that's not true on many Asus boards. |
@@ -590,6 +604,61 @@ static void __init force_disable_hpet(int num, int slot, int func) | |||
590 | #endif | 604 | #endif |
591 | } | 605 | } |
592 | 606 | ||
607 | #define BCM4331_MMIO_SIZE 16384 | ||
608 | #define BCM4331_PM_CAP 0x40 | ||
609 | #define bcma_aread32(reg) ioread32(mmio + 1 * BCMA_CORE_SIZE + reg) | ||
610 | #define bcma_awrite32(reg, val) iowrite32(val, mmio + 1 * BCMA_CORE_SIZE + reg) | ||
611 | |||
612 | static void __init apple_airport_reset(int bus, int slot, int func) | ||
613 | { | ||
614 | void __iomem *mmio; | ||
615 | u16 pmcsr; | ||
616 | u64 addr; | ||
617 | int i; | ||
618 | |||
619 | if (!dmi_match(DMI_SYS_VENDOR, "Apple Inc.")) | ||
620 | return; | ||
621 | |||
622 | /* Card may have been put into PCI_D3hot by grub quirk */ | ||
623 | pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL); | ||
624 | |||
625 | if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0) { | ||
626 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; | ||
627 | write_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL, pmcsr); | ||
628 | mdelay(10); | ||
629 | |||
630 | pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL); | ||
631 | if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0) { | ||
632 | dev_err("Cannot power up Apple AirPort card\n"); | ||
633 | return; | ||
634 | } | ||
635 | } | ||
636 | |||
637 | addr = read_pci_config(bus, slot, func, PCI_BASE_ADDRESS_0); | ||
638 | addr |= (u64)read_pci_config(bus, slot, func, PCI_BASE_ADDRESS_1) << 32; | ||
639 | addr &= PCI_BASE_ADDRESS_MEM_MASK; | ||
640 | |||
641 | mmio = early_ioremap(addr, BCM4331_MMIO_SIZE); | ||
642 | if (!mmio) { | ||
643 | dev_err("Cannot iomap Apple AirPort card\n"); | ||
644 | return; | ||
645 | } | ||
646 | |||
647 | pr_info("Resetting Apple AirPort card (left enabled by EFI)\n"); | ||
648 | |||
649 | for (i = 0; bcma_aread32(BCMA_RESET_ST) && i < 30; i++) | ||
650 | udelay(10); | ||
651 | |||
652 | bcma_awrite32(BCMA_RESET_CTL, BCMA_RESET_CTL_RESET); | ||
653 | bcma_aread32(BCMA_RESET_CTL); | ||
654 | udelay(1); | ||
655 | |||
656 | bcma_awrite32(BCMA_RESET_CTL, 0); | ||
657 | bcma_aread32(BCMA_RESET_CTL); | ||
658 | udelay(10); | ||
659 | |||
660 | early_iounmap(mmio, BCM4331_MMIO_SIZE); | ||
661 | } | ||
593 | 662 | ||
594 | #define QFLAG_APPLY_ONCE 0x1 | 663 | #define QFLAG_APPLY_ONCE 0x1 |
595 | #define QFLAG_APPLIED 0x2 | 664 | #define QFLAG_APPLIED 0x2 |
@@ -603,12 +672,6 @@ struct chipset { | |||
603 | void (*f)(int num, int slot, int func); | 672 | void (*f)(int num, int slot, int func); |
604 | }; | 673 | }; |
605 | 674 | ||
606 | /* | ||
607 | * Only works for devices on the root bus. If you add any devices | ||
608 | * not on bus 0 readd another loop level in early_quirks(). But | ||
609 | * be careful because at least the Nvidia quirk here relies on | ||
610 | * only matching on bus 0. | ||
611 | */ | ||
612 | static struct chipset early_qrk[] __initdata = { | 675 | static struct chipset early_qrk[] __initdata = { |
613 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, | 676 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, |
614 | PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs }, | 677 | PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs }, |
@@ -638,9 +701,13 @@ static struct chipset early_qrk[] __initdata = { | |||
638 | */ | 701 | */ |
639 | { PCI_VENDOR_ID_INTEL, 0x0f00, | 702 | { PCI_VENDOR_ID_INTEL, 0x0f00, |
640 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet}, | 703 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet}, |
704 | { PCI_VENDOR_ID_BROADCOM, 0x4331, | ||
705 | PCI_CLASS_NETWORK_OTHER, PCI_ANY_ID, 0, apple_airport_reset}, | ||
641 | {} | 706 | {} |
642 | }; | 707 | }; |
643 | 708 | ||
709 | static void __init early_pci_scan_bus(int bus); | ||
710 | |||
644 | /** | 711 | /** |
645 | * check_dev_quirk - apply early quirks to a given PCI device | 712 | * check_dev_quirk - apply early quirks to a given PCI device |
646 | * @num: bus number | 713 | * @num: bus number |
@@ -649,7 +716,7 @@ static struct chipset early_qrk[] __initdata = { | |||
649 | * | 716 | * |
650 | * Check the vendor & device ID against the early quirks table. | 717 | * Check the vendor & device ID against the early quirks table. |
651 | * | 718 | * |
652 | * If the device is single function, let early_quirks() know so we don't | 719 | * If the device is single function, let early_pci_scan_bus() know so we don't |
653 | * poke at this device again. | 720 | * poke at this device again. |
654 | */ | 721 | */ |
655 | static int __init check_dev_quirk(int num, int slot, int func) | 722 | static int __init check_dev_quirk(int num, int slot, int func) |
@@ -658,6 +725,7 @@ static int __init check_dev_quirk(int num, int slot, int func) | |||
658 | u16 vendor; | 725 | u16 vendor; |
659 | u16 device; | 726 | u16 device; |
660 | u8 type; | 727 | u8 type; |
728 | u8 sec; | ||
661 | int i; | 729 | int i; |
662 | 730 | ||
663 | class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE); | 731 | class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE); |
@@ -685,25 +753,36 @@ static int __init check_dev_quirk(int num, int slot, int func) | |||
685 | 753 | ||
686 | type = read_pci_config_byte(num, slot, func, | 754 | type = read_pci_config_byte(num, slot, func, |
687 | PCI_HEADER_TYPE); | 755 | PCI_HEADER_TYPE); |
756 | |||
757 | if ((type & 0x7f) == PCI_HEADER_TYPE_BRIDGE) { | ||
758 | sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS); | ||
759 | if (sec > num) | ||
760 | early_pci_scan_bus(sec); | ||
761 | } | ||
762 | |||
688 | if (!(type & 0x80)) | 763 | if (!(type & 0x80)) |
689 | return -1; | 764 | return -1; |
690 | 765 | ||
691 | return 0; | 766 | return 0; |
692 | } | 767 | } |
693 | 768 | ||
694 | void __init early_quirks(void) | 769 | static void __init early_pci_scan_bus(int bus) |
695 | { | 770 | { |
696 | int slot, func; | 771 | int slot, func; |
697 | 772 | ||
698 | if (!early_pci_allowed()) | ||
699 | return; | ||
700 | |||
701 | /* Poor man's PCI discovery */ | 773 | /* Poor man's PCI discovery */ |
702 | /* Only scan the root bus */ | ||
703 | for (slot = 0; slot < 32; slot++) | 774 | for (slot = 0; slot < 32; slot++) |
704 | for (func = 0; func < 8; func++) { | 775 | for (func = 0; func < 8; func++) { |
705 | /* Only probe function 0 on single fn devices */ | 776 | /* Only probe function 0 on single fn devices */ |
706 | if (check_dev_quirk(0, slot, func)) | 777 | if (check_dev_quirk(bus, slot, func)) |
707 | break; | 778 | break; |
708 | } | 779 | } |
709 | } | 780 | } |
781 | |||
782 | void __init early_quirks(void) | ||
783 | { | ||
784 | if (!early_pci_allowed()) | ||
785 | return; | ||
786 | |||
787 | early_pci_scan_bus(0); | ||
788 | } | ||
diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c index 1b1110fa0057..0493c17b8a51 100644 --- a/arch/x86/mm/kasan_init_64.c +++ b/arch/x86/mm/kasan_init_64.c | |||
@@ -54,8 +54,8 @@ static int kasan_die_handler(struct notifier_block *self, | |||
54 | void *data) | 54 | void *data) |
55 | { | 55 | { |
56 | if (val == DIE_GPF) { | 56 | if (val == DIE_GPF) { |
57 | pr_emerg("CONFIG_KASAN_INLINE enabled"); | 57 | pr_emerg("CONFIG_KASAN_INLINE enabled\n"); |
58 | pr_emerg("GPF could be caused by NULL-ptr deref or user memory access"); | 58 | pr_emerg("GPF could be caused by NULL-ptr deref or user memory access\n"); |
59 | } | 59 | } |
60 | return NOTIFY_OK; | 60 | return NOTIFY_OK; |
61 | } | 61 | } |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index b2a4e2a61f6b..3cd69832d7f4 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -396,6 +396,7 @@ int __init pci_acpi_init(void) | |||
396 | return -ENODEV; | 396 | return -ENODEV; |
397 | 397 | ||
398 | printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); | 398 | printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); |
399 | acpi_irq_penalty_init(); | ||
399 | pcibios_enable_irq = acpi_pci_irq_enable; | 400 | pcibios_enable_irq = acpi_pci_irq_enable; |
400 | pcibios_disable_irq = acpi_pci_irq_disable; | 401 | pcibios_disable_irq = acpi_pci_irq_disable; |
401 | x86_init.pci.init_irq = x86_init_noop; | 402 | x86_init.pci.init_irq = x86_init_noop; |
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c index 009947d419a6..f2b5e6a5cf95 100644 --- a/arch/x86/power/hibernate_64.c +++ b/arch/x86/power/hibernate_64.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/mtrr.h> | 19 | #include <asm/mtrr.h> |
20 | #include <asm/sections.h> | 20 | #include <asm/sections.h> |
21 | #include <asm/suspend.h> | 21 | #include <asm/suspend.h> |
22 | #include <asm/tlbflush.h> | ||
22 | 23 | ||
23 | /* Defined in hibernate_asm_64.S */ | 24 | /* Defined in hibernate_asm_64.S */ |
24 | extern asmlinkage __visible int restore_image(void); | 25 | extern asmlinkage __visible int restore_image(void); |
@@ -28,6 +29,7 @@ extern asmlinkage __visible int restore_image(void); | |||
28 | * kernel's text (this value is passed in the image header). | 29 | * kernel's text (this value is passed in the image header). |
29 | */ | 30 | */ |
30 | unsigned long restore_jump_address __visible; | 31 | unsigned long restore_jump_address __visible; |
32 | unsigned long jump_address_phys; | ||
31 | 33 | ||
32 | /* | 34 | /* |
33 | * Value of the cr3 register from before the hibernation (this value is passed | 35 | * Value of the cr3 register from before the hibernation (this value is passed |
@@ -37,7 +39,43 @@ unsigned long restore_cr3 __visible; | |||
37 | 39 | ||
38 | pgd_t *temp_level4_pgt __visible; | 40 | pgd_t *temp_level4_pgt __visible; |
39 | 41 | ||
40 | void *relocated_restore_code __visible; | 42 | unsigned long relocated_restore_code __visible; |
43 | |||
44 | static int set_up_temporary_text_mapping(void) | ||
45 | { | ||
46 | pmd_t *pmd; | ||
47 | pud_t *pud; | ||
48 | |||
49 | /* | ||
50 | * The new mapping only has to cover the page containing the image | ||
51 | * kernel's entry point (jump_address_phys), because the switch over to | ||
52 | * it is carried out by relocated code running from a page allocated | ||
53 | * specifically for this purpose and covered by the identity mapping, so | ||
54 | * the temporary kernel text mapping is only needed for the final jump. | ||
55 | * Moreover, in that mapping the virtual address of the image kernel's | ||
56 | * entry point must be the same as its virtual address in the image | ||
57 | * kernel (restore_jump_address), so the image kernel's | ||
58 | * restore_registers() code doesn't find itself in a different area of | ||
59 | * the virtual address space after switching over to the original page | ||
60 | * tables used by the image kernel. | ||
61 | */ | ||
62 | pud = (pud_t *)get_safe_page(GFP_ATOMIC); | ||
63 | if (!pud) | ||
64 | return -ENOMEM; | ||
65 | |||
66 | pmd = (pmd_t *)get_safe_page(GFP_ATOMIC); | ||
67 | if (!pmd) | ||
68 | return -ENOMEM; | ||
69 | |||
70 | set_pmd(pmd + pmd_index(restore_jump_address), | ||
71 | __pmd((jump_address_phys & PMD_MASK) | __PAGE_KERNEL_LARGE_EXEC)); | ||
72 | set_pud(pud + pud_index(restore_jump_address), | ||
73 | __pud(__pa(pmd) | _KERNPG_TABLE)); | ||
74 | set_pgd(temp_level4_pgt + pgd_index(restore_jump_address), | ||
75 | __pgd(__pa(pud) | _KERNPG_TABLE)); | ||
76 | |||
77 | return 0; | ||
78 | } | ||
41 | 79 | ||
42 | static void *alloc_pgt_page(void *context) | 80 | static void *alloc_pgt_page(void *context) |
43 | { | 81 | { |
@@ -59,9 +97,10 @@ static int set_up_temporary_mappings(void) | |||
59 | if (!temp_level4_pgt) | 97 | if (!temp_level4_pgt) |
60 | return -ENOMEM; | 98 | return -ENOMEM; |
61 | 99 | ||
62 | /* It is safe to reuse the original kernel mapping */ | 100 | /* Prepare a temporary mapping for the kernel text */ |
63 | set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map), | 101 | result = set_up_temporary_text_mapping(); |
64 | init_level4_pgt[pgd_index(__START_KERNEL_map)]); | 102 | if (result) |
103 | return result; | ||
65 | 104 | ||
66 | /* Set up the direct mapping from scratch */ | 105 | /* Set up the direct mapping from scratch */ |
67 | for (i = 0; i < nr_pfn_mapped; i++) { | 106 | for (i = 0; i < nr_pfn_mapped; i++) { |
@@ -78,19 +117,50 @@ static int set_up_temporary_mappings(void) | |||
78 | return 0; | 117 | return 0; |
79 | } | 118 | } |
80 | 119 | ||
120 | static int relocate_restore_code(void) | ||
121 | { | ||
122 | pgd_t *pgd; | ||
123 | pud_t *pud; | ||
124 | |||
125 | relocated_restore_code = get_safe_page(GFP_ATOMIC); | ||
126 | if (!relocated_restore_code) | ||
127 | return -ENOMEM; | ||
128 | |||
129 | memcpy((void *)relocated_restore_code, &core_restore_code, PAGE_SIZE); | ||
130 | |||
131 | /* Make the page containing the relocated code executable */ | ||
132 | pgd = (pgd_t *)__va(read_cr3()) + pgd_index(relocated_restore_code); | ||
133 | pud = pud_offset(pgd, relocated_restore_code); | ||
134 | if (pud_large(*pud)) { | ||
135 | set_pud(pud, __pud(pud_val(*pud) & ~_PAGE_NX)); | ||
136 | } else { | ||
137 | pmd_t *pmd = pmd_offset(pud, relocated_restore_code); | ||
138 | |||
139 | if (pmd_large(*pmd)) { | ||
140 | set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_NX)); | ||
141 | } else { | ||
142 | pte_t *pte = pte_offset_kernel(pmd, relocated_restore_code); | ||
143 | |||
144 | set_pte(pte, __pte(pte_val(*pte) & ~_PAGE_NX)); | ||
145 | } | ||
146 | } | ||
147 | __flush_tlb_all(); | ||
148 | |||
149 | return 0; | ||
150 | } | ||
151 | |||
81 | int swsusp_arch_resume(void) | 152 | int swsusp_arch_resume(void) |
82 | { | 153 | { |
83 | int error; | 154 | int error; |
84 | 155 | ||
85 | /* We have got enough memory and from now on we cannot recover */ | 156 | /* We have got enough memory and from now on we cannot recover */ |
86 | if ((error = set_up_temporary_mappings())) | 157 | error = set_up_temporary_mappings(); |
158 | if (error) | ||
87 | return error; | 159 | return error; |
88 | 160 | ||
89 | relocated_restore_code = (void *)get_safe_page(GFP_ATOMIC); | 161 | error = relocate_restore_code(); |
90 | if (!relocated_restore_code) | 162 | if (error) |
91 | return -ENOMEM; | 163 | return error; |
92 | memcpy(relocated_restore_code, &core_restore_code, | ||
93 | &restore_registers - &core_restore_code); | ||
94 | 164 | ||
95 | restore_image(); | 165 | restore_image(); |
96 | return 0; | 166 | return 0; |
@@ -109,11 +179,12 @@ int pfn_is_nosave(unsigned long pfn) | |||
109 | 179 | ||
110 | struct restore_data_record { | 180 | struct restore_data_record { |
111 | unsigned long jump_address; | 181 | unsigned long jump_address; |
182 | unsigned long jump_address_phys; | ||
112 | unsigned long cr3; | 183 | unsigned long cr3; |
113 | unsigned long magic; | 184 | unsigned long magic; |
114 | }; | 185 | }; |
115 | 186 | ||
116 | #define RESTORE_MAGIC 0x0123456789ABCDEFUL | 187 | #define RESTORE_MAGIC 0x123456789ABCDEF0UL |
117 | 188 | ||
118 | /** | 189 | /** |
119 | * arch_hibernation_header_save - populate the architecture specific part | 190 | * arch_hibernation_header_save - populate the architecture specific part |
@@ -126,7 +197,8 @@ int arch_hibernation_header_save(void *addr, unsigned int max_size) | |||
126 | 197 | ||
127 | if (max_size < sizeof(struct restore_data_record)) | 198 | if (max_size < sizeof(struct restore_data_record)) |
128 | return -EOVERFLOW; | 199 | return -EOVERFLOW; |
129 | rdr->jump_address = restore_jump_address; | 200 | rdr->jump_address = (unsigned long)&restore_registers; |
201 | rdr->jump_address_phys = __pa_symbol(&restore_registers); | ||
130 | rdr->cr3 = restore_cr3; | 202 | rdr->cr3 = restore_cr3; |
131 | rdr->magic = RESTORE_MAGIC; | 203 | rdr->magic = RESTORE_MAGIC; |
132 | return 0; | 204 | return 0; |
@@ -142,6 +214,7 @@ int arch_hibernation_header_restore(void *addr) | |||
142 | struct restore_data_record *rdr = addr; | 214 | struct restore_data_record *rdr = addr; |
143 | 215 | ||
144 | restore_jump_address = rdr->jump_address; | 216 | restore_jump_address = rdr->jump_address; |
217 | jump_address_phys = rdr->jump_address_phys; | ||
145 | restore_cr3 = rdr->cr3; | 218 | restore_cr3 = rdr->cr3; |
146 | return (rdr->magic == RESTORE_MAGIC) ? 0 : -EINVAL; | 219 | return (rdr->magic == RESTORE_MAGIC) ? 0 : -EINVAL; |
147 | } | 220 | } |
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S index 4400a43b9e28..3177c2bc26f6 100644 --- a/arch/x86/power/hibernate_asm_64.S +++ b/arch/x86/power/hibernate_asm_64.S | |||
@@ -44,9 +44,6 @@ ENTRY(swsusp_arch_suspend) | |||
44 | pushfq | 44 | pushfq |
45 | popq pt_regs_flags(%rax) | 45 | popq pt_regs_flags(%rax) |
46 | 46 | ||
47 | /* save the address of restore_registers */ | ||
48 | movq $restore_registers, %rax | ||
49 | movq %rax, restore_jump_address(%rip) | ||
50 | /* save cr3 */ | 47 | /* save cr3 */ |
51 | movq %cr3, %rax | 48 | movq %cr3, %rax |
52 | movq %rax, restore_cr3(%rip) | 49 | movq %rax, restore_cr3(%rip) |
@@ -57,31 +54,34 @@ ENTRY(swsusp_arch_suspend) | |||
57 | ENDPROC(swsusp_arch_suspend) | 54 | ENDPROC(swsusp_arch_suspend) |
58 | 55 | ||
59 | ENTRY(restore_image) | 56 | ENTRY(restore_image) |
60 | /* switch to temporary page tables */ | ||
61 | movq $__PAGE_OFFSET, %rdx | ||
62 | movq temp_level4_pgt(%rip), %rax | ||
63 | subq %rdx, %rax | ||
64 | movq %rax, %cr3 | ||
65 | /* Flush TLB */ | ||
66 | movq mmu_cr4_features(%rip), %rax | ||
67 | movq %rax, %rdx | ||
68 | andq $~(X86_CR4_PGE), %rdx | ||
69 | movq %rdx, %cr4; # turn off PGE | ||
70 | movq %cr3, %rcx; # flush TLB | ||
71 | movq %rcx, %cr3; | ||
72 | movq %rax, %cr4; # turn PGE back on | ||
73 | |||
74 | /* prepare to jump to the image kernel */ | 57 | /* prepare to jump to the image kernel */ |
75 | movq restore_jump_address(%rip), %rax | 58 | movq restore_jump_address(%rip), %r8 |
76 | movq restore_cr3(%rip), %rbx | 59 | movq restore_cr3(%rip), %r9 |
60 | |||
61 | /* prepare to switch to temporary page tables */ | ||
62 | movq temp_level4_pgt(%rip), %rax | ||
63 | movq mmu_cr4_features(%rip), %rbx | ||
77 | 64 | ||
78 | /* prepare to copy image data to their original locations */ | 65 | /* prepare to copy image data to their original locations */ |
79 | movq restore_pblist(%rip), %rdx | 66 | movq restore_pblist(%rip), %rdx |
67 | |||
68 | /* jump to relocated restore code */ | ||
80 | movq relocated_restore_code(%rip), %rcx | 69 | movq relocated_restore_code(%rip), %rcx |
81 | jmpq *%rcx | 70 | jmpq *%rcx |
82 | 71 | ||
83 | /* code below has been relocated to a safe page */ | 72 | /* code below has been relocated to a safe page */ |
84 | ENTRY(core_restore_code) | 73 | ENTRY(core_restore_code) |
74 | /* switch to temporary page tables */ | ||
75 | movq $__PAGE_OFFSET, %rcx | ||
76 | subq %rcx, %rax | ||
77 | movq %rax, %cr3 | ||
78 | /* flush TLB */ | ||
79 | movq %rbx, %rcx | ||
80 | andq $~(X86_CR4_PGE), %rcx | ||
81 | movq %rcx, %cr4; # turn off PGE | ||
82 | movq %cr3, %rcx; # flush TLB | ||
83 | movq %rcx, %cr3; | ||
84 | movq %rbx, %cr4; # turn PGE back on | ||
85 | .Lloop: | 85 | .Lloop: |
86 | testq %rdx, %rdx | 86 | testq %rdx, %rdx |
87 | jz .Ldone | 87 | jz .Ldone |
@@ -96,24 +96,17 @@ ENTRY(core_restore_code) | |||
96 | /* progress to the next pbe */ | 96 | /* progress to the next pbe */ |
97 | movq pbe_next(%rdx), %rdx | 97 | movq pbe_next(%rdx), %rdx |
98 | jmp .Lloop | 98 | jmp .Lloop |
99 | |||
99 | .Ldone: | 100 | .Ldone: |
100 | /* jump to the restore_registers address from the image header */ | 101 | /* jump to the restore_registers address from the image header */ |
101 | jmpq *%rax | 102 | jmpq *%r8 |
102 | /* | ||
103 | * NOTE: This assumes that the boot kernel's text mapping covers the | ||
104 | * image kernel's page containing restore_registers and the address of | ||
105 | * this page is the same as in the image kernel's text mapping (it | ||
106 | * should always be true, because the text mapping is linear, starting | ||
107 | * from 0, and is supposed to cover the entire kernel text for every | ||
108 | * kernel). | ||
109 | * | ||
110 | * code below belongs to the image kernel | ||
111 | */ | ||
112 | 103 | ||
104 | /* code below belongs to the image kernel */ | ||
105 | .align PAGE_SIZE | ||
113 | ENTRY(restore_registers) | 106 | ENTRY(restore_registers) |
114 | FRAME_BEGIN | 107 | FRAME_BEGIN |
115 | /* go back to the original page tables */ | 108 | /* go back to the original page tables */ |
116 | movq %rbx, %cr3 | 109 | movq %r9, %cr3 |
117 | 110 | ||
118 | /* Flush TLB, including "global" things (vmalloc) */ | 111 | /* Flush TLB, including "global" things (vmalloc) */ |
119 | movq mmu_cr4_features(%rip), %rax | 112 | movq mmu_cr4_features(%rip), %rax |
diff --git a/block/ioprio.c b/block/ioprio.c index cc7800e9eb44..01b8116298a1 100644 --- a/block/ioprio.c +++ b/block/ioprio.c | |||
@@ -150,8 +150,10 @@ static int get_task_ioprio(struct task_struct *p) | |||
150 | if (ret) | 150 | if (ret) |
151 | goto out; | 151 | goto out; |
152 | ret = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, IOPRIO_NORM); | 152 | ret = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, IOPRIO_NORM); |
153 | task_lock(p); | ||
153 | if (p->io_context) | 154 | if (p->io_context) |
154 | ret = p->io_context->ioprio; | 155 | ret = p->io_context->ioprio; |
156 | task_unlock(p); | ||
155 | out: | 157 | out: |
156 | return ret; | 158 | return ret; |
157 | } | 159 | } |
diff --git a/crypto/asymmetric_keys/mscode_parser.c b/crypto/asymmetric_keys/mscode_parser.c index 6a76d5c70ef6..9492e1c22d38 100644 --- a/crypto/asymmetric_keys/mscode_parser.c +++ b/crypto/asymmetric_keys/mscode_parser.c | |||
@@ -124,5 +124,10 @@ int mscode_note_digest(void *context, size_t hdrlen, | |||
124 | struct pefile_context *ctx = context; | 124 | struct pefile_context *ctx = context; |
125 | 125 | ||
126 | ctx->digest = kmemdup(value, vlen, GFP_KERNEL); | 126 | ctx->digest = kmemdup(value, vlen, GFP_KERNEL); |
127 | return ctx->digest ? 0 : -ENOMEM; | 127 | if (!ctx->digest) |
128 | return -ENOMEM; | ||
129 | |||
130 | ctx->digest_len = vlen; | ||
131 | |||
132 | return 0; | ||
128 | } | 133 | } |
diff --git a/crypto/asymmetric_keys/pkcs7_verify.c b/crypto/asymmetric_keys/pkcs7_verify.c index 44b746e9df1b..2ffd69769466 100644 --- a/crypto/asymmetric_keys/pkcs7_verify.c +++ b/crypto/asymmetric_keys/pkcs7_verify.c | |||
@@ -227,7 +227,7 @@ static int pkcs7_verify_sig_chain(struct pkcs7_message *pkcs7, | |||
227 | if (asymmetric_key_id_same(p->id, auth)) | 227 | if (asymmetric_key_id_same(p->id, auth)) |
228 | goto found_issuer_check_skid; | 228 | goto found_issuer_check_skid; |
229 | } | 229 | } |
230 | } else { | 230 | } else if (sig->auth_ids[1]) { |
231 | auth = sig->auth_ids[1]; | 231 | auth = sig->auth_ids[1]; |
232 | pr_debug("- want %*phN\n", auth->len, auth->data); | 232 | pr_debug("- want %*phN\n", auth->len, auth->data); |
233 | for (p = pkcs7->certs; p; p = p->next) { | 233 | for (p = pkcs7->certs; p; p = p->next) { |
diff --git a/crypto/asymmetric_keys/restrict.c b/crypto/asymmetric_keys/restrict.c index ac4bddf669de..19d1afb9890f 100644 --- a/crypto/asymmetric_keys/restrict.c +++ b/crypto/asymmetric_keys/restrict.c | |||
@@ -87,7 +87,7 @@ int restrict_link_by_signature(struct key *trust_keyring, | |||
87 | 87 | ||
88 | sig = payload->data[asym_auth]; | 88 | sig = payload->data[asym_auth]; |
89 | if (!sig->auth_ids[0] && !sig->auth_ids[1]) | 89 | if (!sig->auth_ids[0] && !sig->auth_ids[1]) |
90 | return 0; | 90 | return -ENOKEY; |
91 | 91 | ||
92 | if (ca_keyid && !asymmetric_key_id_partial(sig->auth_ids[1], ca_keyid)) | 92 | if (ca_keyid && !asymmetric_key_id_partial(sig->auth_ids[1], ca_keyid)) |
93 | return -EPERM; | 93 | return -EPERM; |
diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c index ead8dc0d084e..8ba426635b1b 100644 --- a/crypto/rsa-pkcs1pad.c +++ b/crypto/rsa-pkcs1pad.c | |||
@@ -102,10 +102,10 @@ struct pkcs1pad_inst_ctx { | |||
102 | }; | 102 | }; |
103 | 103 | ||
104 | struct pkcs1pad_request { | 104 | struct pkcs1pad_request { |
105 | struct akcipher_request child_req; | ||
106 | |||
107 | struct scatterlist in_sg[3], out_sg[2]; | 105 | struct scatterlist in_sg[3], out_sg[2]; |
108 | uint8_t *in_buf, *out_buf; | 106 | uint8_t *in_buf, *out_buf; |
107 | |||
108 | struct akcipher_request child_req; | ||
109 | }; | 109 | }; |
110 | 110 | ||
111 | static int pkcs1pad_set_pub_key(struct crypto_akcipher *tfm, const void *key, | 111 | static int pkcs1pad_set_pub_key(struct crypto_akcipher *tfm, const void *key, |
diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index 1f4128487dd4..dee86925a9a1 100644 --- a/drivers/acpi/acpi_dbg.c +++ b/drivers/acpi/acpi_dbg.c | |||
@@ -602,7 +602,7 @@ static int acpi_aml_read_user(char __user *buf, int len) | |||
602 | crc->tail = (crc->tail + n) & (ACPI_AML_BUF_SIZE - 1); | 602 | crc->tail = (crc->tail + n) & (ACPI_AML_BUF_SIZE - 1); |
603 | ret = n; | 603 | ret = n; |
604 | out: | 604 | out: |
605 | acpi_aml_unlock_fifo(ACPI_AML_OUT_USER, !ret); | 605 | acpi_aml_unlock_fifo(ACPI_AML_OUT_USER, ret >= 0); |
606 | return ret; | 606 | return ret; |
607 | } | 607 | } |
608 | 608 | ||
@@ -672,7 +672,7 @@ static int acpi_aml_write_user(const char __user *buf, int len) | |||
672 | crc->head = (crc->head + n) & (ACPI_AML_BUF_SIZE - 1); | 672 | crc->head = (crc->head + n) & (ACPI_AML_BUF_SIZE - 1); |
673 | ret = n; | 673 | ret = n; |
674 | out: | 674 | out: |
675 | acpi_aml_unlock_fifo(ACPI_AML_IN_USER, !ret); | 675 | acpi_aml_unlock_fifo(ACPI_AML_IN_USER, ret >= 0); |
676 | return n; | 676 | return n; |
677 | } | 677 | } |
678 | 678 | ||
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index 21932d640a41..a1d177d58254 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c | |||
@@ -108,9 +108,7 @@ acpi_ex_add_table(u32 table_index, | |||
108 | 108 | ||
109 | /* Add the table to the namespace */ | 109 | /* Add the table to the namespace */ |
110 | 110 | ||
111 | acpi_ex_exit_interpreter(); | ||
112 | status = acpi_ns_load_table(table_index, parent_node); | 111 | status = acpi_ns_load_table(table_index, parent_node); |
113 | acpi_ex_enter_interpreter(); | ||
114 | if (ACPI_FAILURE(status)) { | 112 | if (ACPI_FAILURE(status)) { |
115 | acpi_ut_remove_reference(obj_desc); | 113 | acpi_ut_remove_reference(obj_desc); |
116 | *ddb_handle = NULL; | 114 | *ddb_handle = NULL; |
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c index 1783cd7e1446..f631a47724f0 100644 --- a/drivers/acpi/acpica/nsparse.c +++ b/drivers/acpi/acpica/nsparse.c | |||
@@ -47,7 +47,6 @@ | |||
47 | #include "acparser.h" | 47 | #include "acparser.h" |
48 | #include "acdispat.h" | 48 | #include "acdispat.h" |
49 | #include "actables.h" | 49 | #include "actables.h" |
50 | #include "acinterp.h" | ||
51 | 50 | ||
52 | #define _COMPONENT ACPI_NAMESPACE | 51 | #define _COMPONENT ACPI_NAMESPACE |
53 | ACPI_MODULE_NAME("nsparse") | 52 | ACPI_MODULE_NAME("nsparse") |
@@ -171,8 +170,6 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node) | |||
171 | 170 | ||
172 | ACPI_FUNCTION_TRACE(ns_parse_table); | 171 | ACPI_FUNCTION_TRACE(ns_parse_table); |
173 | 172 | ||
174 | acpi_ex_enter_interpreter(); | ||
175 | |||
176 | /* | 173 | /* |
177 | * AML Parse, pass 1 | 174 | * AML Parse, pass 1 |
178 | * | 175 | * |
@@ -188,7 +185,7 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node) | |||
188 | status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, | 185 | status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, |
189 | table_index, start_node); | 186 | table_index, start_node); |
190 | if (ACPI_FAILURE(status)) { | 187 | if (ACPI_FAILURE(status)) { |
191 | goto error_exit; | 188 | return_ACPI_STATUS(status); |
192 | } | 189 | } |
193 | 190 | ||
194 | /* | 191 | /* |
@@ -204,10 +201,8 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node) | |||
204 | status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, | 201 | status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, |
205 | table_index, start_node); | 202 | table_index, start_node); |
206 | if (ACPI_FAILURE(status)) { | 203 | if (ACPI_FAILURE(status)) { |
207 | goto error_exit; | 204 | return_ACPI_STATUS(status); |
208 | } | 205 | } |
209 | 206 | ||
210 | error_exit: | ||
211 | acpi_ex_exit_interpreter(); | ||
212 | return_ACPI_STATUS(status); | 207 | return_ACPI_STATUS(status); |
213 | } | 208 | } |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 73c76d646064..290d6f5be44b 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -1331,8 +1331,6 @@ static int ec_install_handlers(struct acpi_ec *ec) | |||
1331 | 1331 | ||
1332 | static void ec_remove_handlers(struct acpi_ec *ec) | 1332 | static void ec_remove_handlers(struct acpi_ec *ec) |
1333 | { | 1333 | { |
1334 | acpi_ec_stop(ec, false); | ||
1335 | |||
1336 | if (test_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags)) { | 1334 | if (test_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags)) { |
1337 | if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, | 1335 | if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, |
1338 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) | 1336 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) |
@@ -1340,6 +1338,19 @@ static void ec_remove_handlers(struct acpi_ec *ec) | |||
1340 | clear_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags); | 1338 | clear_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags); |
1341 | } | 1339 | } |
1342 | 1340 | ||
1341 | /* | ||
1342 | * Stops handling the EC transactions after removing the operation | ||
1343 | * region handler. This is required because _REG(DISCONNECT) | ||
1344 | * invoked during the removal can result in new EC transactions. | ||
1345 | * | ||
1346 | * Flushes the EC requests and thus disables the GPE before | ||
1347 | * removing the GPE handler. This is required by the current ACPICA | ||
1348 | * GPE core. ACPICA GPE core will automatically disable a GPE when | ||
1349 | * it is indicated but there is no way to handle it. So the drivers | ||
1350 | * must disable the GPEs prior to removing the GPE handlers. | ||
1351 | */ | ||
1352 | acpi_ec_stop(ec, false); | ||
1353 | |||
1343 | if (test_bit(EC_FLAGS_GPE_HANDLER_INSTALLED, &ec->flags)) { | 1354 | if (test_bit(EC_FLAGS_GPE_HANDLER_INSTALLED, &ec->flags)) { |
1344 | if (ACPI_FAILURE(acpi_remove_gpe_handler(NULL, ec->gpe, | 1355 | if (ACPI_FAILURE(acpi_remove_gpe_handler(NULL, ec->gpe, |
1345 | &acpi_ec_gpe_handler))) | 1356 | &acpi_ec_gpe_handler))) |
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c index ac6ddcc080d4..1f0e06065ae6 100644 --- a/drivers/acpi/nfit.c +++ b/drivers/acpi/nfit.c | |||
@@ -1131,11 +1131,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, | |||
1131 | 1131 | ||
1132 | /* | 1132 | /* |
1133 | * Until standardization materializes we need to consider up to 3 | 1133 | * Until standardization materializes we need to consider up to 3 |
1134 | * different command sets. Note, that checking for zero functions | 1134 | * different command sets. Note, that checking for function0 (bit0) |
1135 | * tells us if any commands might be reachable through this uuid. | 1135 | * tells us if any commands are reachable through this uuid. |
1136 | */ | 1136 | */ |
1137 | for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++) | 1137 | for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++) |
1138 | if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 0)) | 1138 | if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1)) |
1139 | break; | 1139 | break; |
1140 | 1140 | ||
1141 | /* limit the supported commands to those that are publicly documented */ | 1141 | /* limit the supported commands to those that are publicly documented */ |
@@ -1151,9 +1151,10 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, | |||
1151 | if (disable_vendor_specific) | 1151 | if (disable_vendor_specific) |
1152 | dsm_mask &= ~(1 << 8); | 1152 | dsm_mask &= ~(1 << 8); |
1153 | } else { | 1153 | } else { |
1154 | dev_err(dev, "unknown dimm command family\n"); | 1154 | dev_dbg(dev, "unknown dimm command family\n"); |
1155 | nfit_mem->family = -1; | 1155 | nfit_mem->family = -1; |
1156 | return force_enable_dimms ? 0 : -ENODEV; | 1156 | /* DSMs are optional, continue loading the driver... */ |
1157 | return 0; | ||
1157 | } | 1158 | } |
1158 | 1159 | ||
1159 | uuid = to_nfit_uuid(nfit_mem->family); | 1160 | uuid = to_nfit_uuid(nfit_mem->family); |
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 4ed4061813e6..c983bf733ad3 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -470,6 +470,7 @@ static int acpi_irq_pci_sharing_penalty(int irq) | |||
470 | { | 470 | { |
471 | struct acpi_pci_link *link; | 471 | struct acpi_pci_link *link; |
472 | int penalty = 0; | 472 | int penalty = 0; |
473 | int i; | ||
473 | 474 | ||
474 | list_for_each_entry(link, &acpi_link_list, list) { | 475 | list_for_each_entry(link, &acpi_link_list, list) { |
475 | /* | 476 | /* |
@@ -478,18 +479,14 @@ static int acpi_irq_pci_sharing_penalty(int irq) | |||
478 | */ | 479 | */ |
479 | if (link->irq.active && link->irq.active == irq) | 480 | if (link->irq.active && link->irq.active == irq) |
480 | penalty += PIRQ_PENALTY_PCI_USING; | 481 | penalty += PIRQ_PENALTY_PCI_USING; |
481 | else { | 482 | |
482 | int i; | 483 | /* |
483 | 484 | * penalize the IRQs PCI might use, but not as severely. | |
484 | /* | 485 | */ |
485 | * If a link is inactive, penalize the IRQs it | 486 | for (i = 0; i < link->irq.possible_count; i++) |
486 | * might use, but not as severely. | 487 | if (link->irq.possible[i] == irq) |
487 | */ | 488 | penalty += PIRQ_PENALTY_PCI_POSSIBLE / |
488 | for (i = 0; i < link->irq.possible_count; i++) | 489 | link->irq.possible_count; |
489 | if (link->irq.possible[i] == irq) | ||
490 | penalty += PIRQ_PENALTY_PCI_POSSIBLE / | ||
491 | link->irq.possible_count; | ||
492 | } | ||
493 | } | 490 | } |
494 | 491 | ||
495 | return penalty; | 492 | return penalty; |
@@ -499,9 +496,6 @@ static int acpi_irq_get_penalty(int irq) | |||
499 | { | 496 | { |
500 | int penalty = 0; | 497 | int penalty = 0; |
501 | 498 | ||
502 | if (irq < ACPI_MAX_ISA_IRQS) | ||
503 | penalty += acpi_isa_irq_penalty[irq]; | ||
504 | |||
505 | /* | 499 | /* |
506 | * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict | 500 | * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict |
507 | * with PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be | 501 | * with PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be |
@@ -516,10 +510,49 @@ static int acpi_irq_get_penalty(int irq) | |||
516 | penalty += PIRQ_PENALTY_PCI_USING; | 510 | penalty += PIRQ_PENALTY_PCI_USING; |
517 | } | 511 | } |
518 | 512 | ||
513 | if (irq < ACPI_MAX_ISA_IRQS) | ||
514 | return penalty + acpi_isa_irq_penalty[irq]; | ||
515 | |||
519 | penalty += acpi_irq_pci_sharing_penalty(irq); | 516 | penalty += acpi_irq_pci_sharing_penalty(irq); |
520 | return penalty; | 517 | return penalty; |
521 | } | 518 | } |
522 | 519 | ||
520 | int __init acpi_irq_penalty_init(void) | ||
521 | { | ||
522 | struct acpi_pci_link *link; | ||
523 | int i; | ||
524 | |||
525 | /* | ||
526 | * Update penalties to facilitate IRQ balancing. | ||
527 | */ | ||
528 | list_for_each_entry(link, &acpi_link_list, list) { | ||
529 | |||
530 | /* | ||
531 | * reflect the possible and active irqs in the penalty table -- | ||
532 | * useful for breaking ties. | ||
533 | */ | ||
534 | if (link->irq.possible_count) { | ||
535 | int penalty = | ||
536 | PIRQ_PENALTY_PCI_POSSIBLE / | ||
537 | link->irq.possible_count; | ||
538 | |||
539 | for (i = 0; i < link->irq.possible_count; i++) { | ||
540 | if (link->irq.possible[i] < ACPI_MAX_ISA_IRQS) | ||
541 | acpi_isa_irq_penalty[link->irq. | ||
542 | possible[i]] += | ||
543 | penalty; | ||
544 | } | ||
545 | |||
546 | } else if (link->irq.active && | ||
547 | (link->irq.active < ACPI_MAX_ISA_IRQS)) { | ||
548 | acpi_isa_irq_penalty[link->irq.active] += | ||
549 | PIRQ_PENALTY_PCI_POSSIBLE; | ||
550 | } | ||
551 | } | ||
552 | |||
553 | return 0; | ||
554 | } | ||
555 | |||
523 | static int acpi_irq_balance = -1; /* 0: static, 1: balance */ | 556 | static int acpi_irq_balance = -1; /* 0: static, 1: balance */ |
524 | 557 | ||
525 | static int acpi_pci_link_allocate(struct acpi_pci_link *link) | 558 | static int acpi_pci_link_allocate(struct acpi_pci_link *link) |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index b4de130f2d57..22c09952e177 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -680,6 +680,9 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs) | |||
680 | u64 mask = 0; | 680 | u64 mask = 0; |
681 | union acpi_object *obj; | 681 | union acpi_object *obj; |
682 | 682 | ||
683 | if (funcs == 0) | ||
684 | return false; | ||
685 | |||
683 | obj = acpi_evaluate_dsm(handle, uuid, rev, 0, NULL); | 686 | obj = acpi_evaluate_dsm(handle, uuid, rev, 0, NULL); |
684 | if (!obj) | 687 | if (!obj) |
685 | return false; | 688 | return false; |
@@ -692,9 +695,6 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs) | |||
692 | mask |= (((u64)obj->buffer.pointer[i]) << (i * 8)); | 695 | mask |= (((u64)obj->buffer.pointer[i]) << (i * 8)); |
693 | ACPI_FREE(obj); | 696 | ACPI_FREE(obj); |
694 | 697 | ||
695 | if (funcs == 0) | ||
696 | return true; | ||
697 | |||
698 | /* | 698 | /* |
699 | * Bit 0 indicates whether there's support for any functions other than | 699 | * Bit 0 indicates whether there's support for any functions other than |
700 | * function 0 for the specified UUID and revision. | 700 | * function 0 for the specified UUID and revision. |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 6be7770f68e9..31c183aed368 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4314,6 +4314,12 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
4314 | */ | 4314 | */ |
4315 | { "ST380013AS", "3.20", ATA_HORKAGE_MAX_SEC_1024 }, | 4315 | { "ST380013AS", "3.20", ATA_HORKAGE_MAX_SEC_1024 }, |
4316 | 4316 | ||
4317 | /* | ||
4318 | * Device times out with higher max sects. | ||
4319 | * https://bugzilla.kernel.org/show_bug.cgi?id=121671 | ||
4320 | */ | ||
4321 | { "LITEON CX1-JB256-HP", NULL, ATA_HORKAGE_MAX_SEC_1024 }, | ||
4322 | |||
4317 | /* Devices we expect to fail diagnostics */ | 4323 | /* Devices we expect to fail diagnostics */ |
4318 | 4324 | ||
4319 | /* Devices where NCQ should be avoided */ | 4325 | /* Devices where NCQ should be avoided */ |
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h index eda09090cb52..f642c4264c27 100644 --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #include <linux/bcma/bcma.h> | 8 | #include <linux/bcma/bcma.h> |
9 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
10 | 10 | ||
11 | #define BCMA_CORE_SIZE 0x1000 | ||
12 | |||
13 | #define bcma_err(bus, fmt, ...) \ | 11 | #define bcma_err(bus, fmt, ...) \ |
14 | pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__) | 12 | pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__) |
15 | #define bcma_warn(bus, fmt, ...) \ | 13 | #define bcma_warn(bus, fmt, ...) \ |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 2e6d1e9c3345..fcc5b4e0aef2 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -207,6 +207,9 @@ struct blkfront_info | |||
207 | struct blk_mq_tag_set tag_set; | 207 | struct blk_mq_tag_set tag_set; |
208 | struct blkfront_ring_info *rinfo; | 208 | struct blkfront_ring_info *rinfo; |
209 | unsigned int nr_rings; | 209 | unsigned int nr_rings; |
210 | /* Save uncomplete reqs and bios for migration. */ | ||
211 | struct list_head requests; | ||
212 | struct bio_list bio_list; | ||
210 | }; | 213 | }; |
211 | 214 | ||
212 | static unsigned int nr_minors; | 215 | static unsigned int nr_minors; |
@@ -2002,69 +2005,22 @@ static int blkif_recover(struct blkfront_info *info) | |||
2002 | { | 2005 | { |
2003 | unsigned int i, r_index; | 2006 | unsigned int i, r_index; |
2004 | struct request *req, *n; | 2007 | struct request *req, *n; |
2005 | struct blk_shadow *copy; | ||
2006 | int rc; | 2008 | int rc; |
2007 | struct bio *bio, *cloned_bio; | 2009 | struct bio *bio, *cloned_bio; |
2008 | struct bio_list bio_list, merge_bio; | ||
2009 | unsigned int segs, offset; | 2010 | unsigned int segs, offset; |
2010 | int pending, size; | 2011 | int pending, size; |
2011 | struct split_bio *split_bio; | 2012 | struct split_bio *split_bio; |
2012 | struct list_head requests; | ||
2013 | 2013 | ||
2014 | blkfront_gather_backend_features(info); | 2014 | blkfront_gather_backend_features(info); |
2015 | segs = info->max_indirect_segments ? : BLKIF_MAX_SEGMENTS_PER_REQUEST; | 2015 | segs = info->max_indirect_segments ? : BLKIF_MAX_SEGMENTS_PER_REQUEST; |
2016 | blk_queue_max_segments(info->rq, segs); | 2016 | blk_queue_max_segments(info->rq, segs); |
2017 | bio_list_init(&bio_list); | ||
2018 | INIT_LIST_HEAD(&requests); | ||
2019 | 2017 | ||
2020 | for (r_index = 0; r_index < info->nr_rings; r_index++) { | 2018 | for (r_index = 0; r_index < info->nr_rings; r_index++) { |
2021 | struct blkfront_ring_info *rinfo; | 2019 | struct blkfront_ring_info *rinfo = &info->rinfo[r_index]; |
2022 | |||
2023 | rinfo = &info->rinfo[r_index]; | ||
2024 | /* Stage 1: Make a safe copy of the shadow state. */ | ||
2025 | copy = kmemdup(rinfo->shadow, sizeof(rinfo->shadow), | ||
2026 | GFP_NOIO | __GFP_REPEAT | __GFP_HIGH); | ||
2027 | if (!copy) | ||
2028 | return -ENOMEM; | ||
2029 | |||
2030 | /* Stage 2: Set up free list. */ | ||
2031 | memset(&rinfo->shadow, 0, sizeof(rinfo->shadow)); | ||
2032 | for (i = 0; i < BLK_RING_SIZE(info); i++) | ||
2033 | rinfo->shadow[i].req.u.rw.id = i+1; | ||
2034 | rinfo->shadow_free = rinfo->ring.req_prod_pvt; | ||
2035 | rinfo->shadow[BLK_RING_SIZE(info)-1].req.u.rw.id = 0x0fffffff; | ||
2036 | 2020 | ||
2037 | rc = blkfront_setup_indirect(rinfo); | 2021 | rc = blkfront_setup_indirect(rinfo); |
2038 | if (rc) { | 2022 | if (rc) |
2039 | kfree(copy); | ||
2040 | return rc; | 2023 | return rc; |
2041 | } | ||
2042 | |||
2043 | for (i = 0; i < BLK_RING_SIZE(info); i++) { | ||
2044 | /* Not in use? */ | ||
2045 | if (!copy[i].request) | ||
2046 | continue; | ||
2047 | |||
2048 | /* | ||
2049 | * Get the bios in the request so we can re-queue them. | ||
2050 | */ | ||
2051 | if (copy[i].request->cmd_flags & | ||
2052 | (REQ_FLUSH | REQ_FUA | REQ_DISCARD | REQ_SECURE)) { | ||
2053 | /* | ||
2054 | * Flush operations don't contain bios, so | ||
2055 | * we need to requeue the whole request | ||
2056 | */ | ||
2057 | list_add(©[i].request->queuelist, &requests); | ||
2058 | continue; | ||
2059 | } | ||
2060 | merge_bio.head = copy[i].request->bio; | ||
2061 | merge_bio.tail = copy[i].request->biotail; | ||
2062 | bio_list_merge(&bio_list, &merge_bio); | ||
2063 | copy[i].request->bio = NULL; | ||
2064 | blk_end_request_all(copy[i].request, 0); | ||
2065 | } | ||
2066 | |||
2067 | kfree(copy); | ||
2068 | } | 2024 | } |
2069 | xenbus_switch_state(info->xbdev, XenbusStateConnected); | 2025 | xenbus_switch_state(info->xbdev, XenbusStateConnected); |
2070 | 2026 | ||
@@ -2079,7 +2035,7 @@ static int blkif_recover(struct blkfront_info *info) | |||
2079 | kick_pending_request_queues(rinfo); | 2035 | kick_pending_request_queues(rinfo); |
2080 | } | 2036 | } |
2081 | 2037 | ||
2082 | list_for_each_entry_safe(req, n, &requests, queuelist) { | 2038 | list_for_each_entry_safe(req, n, &info->requests, queuelist) { |
2083 | /* Requeue pending requests (flush or discard) */ | 2039 | /* Requeue pending requests (flush or discard) */ |
2084 | list_del_init(&req->queuelist); | 2040 | list_del_init(&req->queuelist); |
2085 | BUG_ON(req->nr_phys_segments > segs); | 2041 | BUG_ON(req->nr_phys_segments > segs); |
@@ -2087,7 +2043,7 @@ static int blkif_recover(struct blkfront_info *info) | |||
2087 | } | 2043 | } |
2088 | blk_mq_kick_requeue_list(info->rq); | 2044 | blk_mq_kick_requeue_list(info->rq); |
2089 | 2045 | ||
2090 | while ((bio = bio_list_pop(&bio_list)) != NULL) { | 2046 | while ((bio = bio_list_pop(&info->bio_list)) != NULL) { |
2091 | /* Traverse the list of pending bios and re-queue them */ | 2047 | /* Traverse the list of pending bios and re-queue them */ |
2092 | if (bio_segments(bio) > segs) { | 2048 | if (bio_segments(bio) > segs) { |
2093 | /* | 2049 | /* |
@@ -2133,9 +2089,42 @@ static int blkfront_resume(struct xenbus_device *dev) | |||
2133 | { | 2089 | { |
2134 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); | 2090 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
2135 | int err = 0; | 2091 | int err = 0; |
2092 | unsigned int i, j; | ||
2136 | 2093 | ||
2137 | dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); | 2094 | dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); |
2138 | 2095 | ||
2096 | bio_list_init(&info->bio_list); | ||
2097 | INIT_LIST_HEAD(&info->requests); | ||
2098 | for (i = 0; i < info->nr_rings; i++) { | ||
2099 | struct blkfront_ring_info *rinfo = &info->rinfo[i]; | ||
2100 | struct bio_list merge_bio; | ||
2101 | struct blk_shadow *shadow = rinfo->shadow; | ||
2102 | |||
2103 | for (j = 0; j < BLK_RING_SIZE(info); j++) { | ||
2104 | /* Not in use? */ | ||
2105 | if (!shadow[j].request) | ||
2106 | continue; | ||
2107 | |||
2108 | /* | ||
2109 | * Get the bios in the request so we can re-queue them. | ||
2110 | */ | ||
2111 | if (shadow[j].request->cmd_flags & | ||
2112 | (REQ_FLUSH | REQ_FUA | REQ_DISCARD | REQ_SECURE)) { | ||
2113 | /* | ||
2114 | * Flush operations don't contain bios, so | ||
2115 | * we need to requeue the whole request | ||
2116 | */ | ||
2117 | list_add(&shadow[j].request->queuelist, &info->requests); | ||
2118 | continue; | ||
2119 | } | ||
2120 | merge_bio.head = shadow[j].request->bio; | ||
2121 | merge_bio.tail = shadow[j].request->biotail; | ||
2122 | bio_list_merge(&info->bio_list, &merge_bio); | ||
2123 | shadow[j].request->bio = NULL; | ||
2124 | blk_mq_end_request(shadow[j].request, 0); | ||
2125 | } | ||
2126 | } | ||
2127 | |||
2139 | blkif_free(info, info->connected == BLKIF_STATE_CONNECTED); | 2128 | blkif_free(info, info->connected == BLKIF_STATE_CONNECTED); |
2140 | 2129 | ||
2141 | err = negotiate_mq(info); | 2130 | err = negotiate_mq(info); |
diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index 10f846cc8db1..25d5906640c3 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c | |||
@@ -99,7 +99,7 @@ static int clk_programmable_set_parent(struct clk_hw *hw, u8 index) | |||
99 | struct clk_programmable *prog = to_clk_programmable(hw); | 99 | struct clk_programmable *prog = to_clk_programmable(hw); |
100 | const struct clk_programmable_layout *layout = prog->layout; | 100 | const struct clk_programmable_layout *layout = prog->layout; |
101 | unsigned int mask = layout->css_mask; | 101 | unsigned int mask = layout->css_mask; |
102 | unsigned int pckr = 0; | 102 | unsigned int pckr = index; |
103 | 103 | ||
104 | if (layout->have_slck_mck) | 104 | if (layout->have_slck_mck) |
105 | mask |= AT91_PMC_CSSMCK_MCK; | 105 | mask |= AT91_PMC_CSSMCK_MCK; |
diff --git a/drivers/clk/sunxi/clk-sun4i-display.c b/drivers/clk/sunxi/clk-sun4i-display.c index 445a7498d6df..9780fac6d029 100644 --- a/drivers/clk/sunxi/clk-sun4i-display.c +++ b/drivers/clk/sunxi/clk-sun4i-display.c | |||
@@ -33,6 +33,8 @@ struct sun4i_a10_display_clk_data { | |||
33 | 33 | ||
34 | u8 width_div; | 34 | u8 width_div; |
35 | u8 width_mux; | 35 | u8 width_mux; |
36 | |||
37 | u32 flags; | ||
36 | }; | 38 | }; |
37 | 39 | ||
38 | struct reset_data { | 40 | struct reset_data { |
@@ -166,7 +168,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, | |||
166 | data->has_div ? &div->hw : NULL, | 168 | data->has_div ? &div->hw : NULL, |
167 | data->has_div ? &clk_divider_ops : NULL, | 169 | data->has_div ? &clk_divider_ops : NULL, |
168 | &gate->hw, &clk_gate_ops, | 170 | &gate->hw, &clk_gate_ops, |
169 | 0); | 171 | data->flags); |
170 | if (IS_ERR(clk)) { | 172 | if (IS_ERR(clk)) { |
171 | pr_err("%s: Couldn't register the clock\n", clk_name); | 173 | pr_err("%s: Couldn't register the clock\n", clk_name); |
172 | goto free_div; | 174 | goto free_div; |
@@ -232,6 +234,7 @@ static const struct sun4i_a10_display_clk_data sun4i_a10_tcon_ch0_data __initcon | |||
232 | .offset_rst = 29, | 234 | .offset_rst = 29, |
233 | .offset_mux = 24, | 235 | .offset_mux = 24, |
234 | .width_mux = 2, | 236 | .width_mux = 2, |
237 | .flags = CLK_SET_RATE_PARENT, | ||
235 | }; | 238 | }; |
236 | 239 | ||
237 | static void __init sun4i_a10_tcon_ch0_setup(struct device_node *node) | 240 | static void __init sun4i_a10_tcon_ch0_setup(struct device_node *node) |
diff --git a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c index 98a4582de56a..b6d29d1bedca 100644 --- a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c +++ b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c | |||
@@ -79,15 +79,11 @@ static int tcon_ch1_is_enabled(struct clk_hw *hw) | |||
79 | static u8 tcon_ch1_get_parent(struct clk_hw *hw) | 79 | static u8 tcon_ch1_get_parent(struct clk_hw *hw) |
80 | { | 80 | { |
81 | struct tcon_ch1_clk *tclk = hw_to_tclk(hw); | 81 | struct tcon_ch1_clk *tclk = hw_to_tclk(hw); |
82 | int num_parents = clk_hw_get_num_parents(hw); | ||
83 | u32 reg; | 82 | u32 reg; |
84 | 83 | ||
85 | reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT; | 84 | reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT; |
86 | reg &= reg >> TCON_CH1_SCLK2_MUX_MASK; | 85 | reg &= reg >> TCON_CH1_SCLK2_MUX_MASK; |
87 | 86 | ||
88 | if (reg >= num_parents) | ||
89 | return -EINVAL; | ||
90 | |||
91 | return reg; | 87 | return reg; |
92 | } | 88 | } |
93 | 89 | ||
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index a4d0059e232c..c73207abb5a4 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -173,7 +173,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, | |||
173 | 173 | ||
174 | struct cpuidle_state *target_state = &drv->states[index]; | 174 | struct cpuidle_state *target_state = &drv->states[index]; |
175 | bool broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP); | 175 | bool broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP); |
176 | u64 time_start, time_end; | 176 | ktime_t time_start, time_end; |
177 | s64 diff; | 177 | s64 diff; |
178 | 178 | ||
179 | /* | 179 | /* |
@@ -195,13 +195,13 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, | |||
195 | sched_idle_set_state(target_state); | 195 | sched_idle_set_state(target_state); |
196 | 196 | ||
197 | trace_cpu_idle_rcuidle(index, dev->cpu); | 197 | trace_cpu_idle_rcuidle(index, dev->cpu); |
198 | time_start = local_clock(); | 198 | time_start = ns_to_ktime(local_clock()); |
199 | 199 | ||
200 | stop_critical_timings(); | 200 | stop_critical_timings(); |
201 | entered_state = target_state->enter(dev, drv, index); | 201 | entered_state = target_state->enter(dev, drv, index); |
202 | start_critical_timings(); | 202 | start_critical_timings(); |
203 | 203 | ||
204 | time_end = local_clock(); | 204 | time_end = ns_to_ktime(local_clock()); |
205 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); | 205 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); |
206 | 206 | ||
207 | /* The cpu is no longer idle or about to enter idle. */ | 207 | /* The cpu is no longer idle or about to enter idle. */ |
@@ -217,11 +217,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, | |||
217 | if (!cpuidle_state_is_coupled(drv, index)) | 217 | if (!cpuidle_state_is_coupled(drv, index)) |
218 | local_irq_enable(); | 218 | local_irq_enable(); |
219 | 219 | ||
220 | /* | 220 | diff = ktime_us_delta(time_end, time_start); |
221 | * local_clock() returns the time in nanosecond, let's shift | ||
222 | * by 10 (divide by 1024) to have microsecond based time. | ||
223 | */ | ||
224 | diff = (time_end - time_start) >> 10; | ||
225 | if (diff > INT_MAX) | 221 | if (diff > INT_MAX) |
226 | diff = INT_MAX; | 222 | diff = INT_MAX; |
227 | 223 | ||
diff --git a/drivers/crypto/qat/qat_common/Makefile b/drivers/crypto/qat/qat_common/Makefile index 6d74b91f2152..5fc3dbb9ada0 100644 --- a/drivers/crypto/qat/qat_common/Makefile +++ b/drivers/crypto/qat/qat_common/Makefile | |||
@@ -2,6 +2,7 @@ $(obj)/qat_rsapubkey-asn1.o: $(obj)/qat_rsapubkey-asn1.c \ | |||
2 | $(obj)/qat_rsapubkey-asn1.h | 2 | $(obj)/qat_rsapubkey-asn1.h |
3 | $(obj)/qat_rsaprivkey-asn1.o: $(obj)/qat_rsaprivkey-asn1.c \ | 3 | $(obj)/qat_rsaprivkey-asn1.o: $(obj)/qat_rsaprivkey-asn1.c \ |
4 | $(obj)/qat_rsaprivkey-asn1.h | 4 | $(obj)/qat_rsaprivkey-asn1.h |
5 | $(obj)/qat_asym_algs.o: $(obj)/qat_rsapubkey-asn1.h $(obj)/qat_rsaprivkey-asn1.h | ||
5 | 6 | ||
6 | clean-files += qat_rsapubkey-asn1.c qat_rsapubkey-asn1.h | 7 | clean-files += qat_rsapubkey-asn1.c qat_rsapubkey-asn1.h |
7 | clean-files += qat_rsaprivkey-asn1.c qat_rsaprivkey-asn1.h | 8 | clean-files += qat_rsaprivkey-asn1.c qat_rsaprivkey-asn1.h |
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 6744d88bdea8..4fb2eb7c800d 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -2378,22 +2378,19 @@ static int sbridge_get_onedevice(struct pci_dev **prev, | |||
2378 | * @num_mc: pointer to the memory controllers count, to be incremented in case | 2378 | * @num_mc: pointer to the memory controllers count, to be incremented in case |
2379 | * of success. | 2379 | * of success. |
2380 | * @table: model specific table | 2380 | * @table: model specific table |
2381 | * @allow_dups: allow for multiple devices to exist with the same device id | ||
2382 | * (as implemented, this isn't expected to work correctly in the | ||
2383 | * multi-socket case). | ||
2384 | * @multi_bus: don't assume devices on different buses belong to different | ||
2385 | * memory controllers. | ||
2386 | * | 2381 | * |
2387 | * returns 0 in case of success or error code | 2382 | * returns 0 in case of success or error code |
2388 | */ | 2383 | */ |
2389 | static int sbridge_get_all_devices_full(u8 *num_mc, | 2384 | static int sbridge_get_all_devices(u8 *num_mc, |
2390 | const struct pci_id_table *table, | 2385 | const struct pci_id_table *table) |
2391 | int allow_dups, | ||
2392 | int multi_bus) | ||
2393 | { | 2386 | { |
2394 | int i, rc; | 2387 | int i, rc; |
2395 | struct pci_dev *pdev = NULL; | 2388 | struct pci_dev *pdev = NULL; |
2389 | int allow_dups = 0; | ||
2390 | int multi_bus = 0; | ||
2396 | 2391 | ||
2392 | if (table->type == KNIGHTS_LANDING) | ||
2393 | allow_dups = multi_bus = 1; | ||
2397 | while (table && table->descr) { | 2394 | while (table && table->descr) { |
2398 | for (i = 0; i < table->n_devs; i++) { | 2395 | for (i = 0; i < table->n_devs; i++) { |
2399 | if (!allow_dups || i == 0 || | 2396 | if (!allow_dups || i == 0 || |
@@ -2420,11 +2417,6 @@ static int sbridge_get_all_devices_full(u8 *num_mc, | |||
2420 | return 0; | 2417 | return 0; |
2421 | } | 2418 | } |
2422 | 2419 | ||
2423 | #define sbridge_get_all_devices(num_mc, table) \ | ||
2424 | sbridge_get_all_devices_full(num_mc, table, 0, 0) | ||
2425 | #define sbridge_get_all_devices_knl(num_mc, table) \ | ||
2426 | sbridge_get_all_devices_full(num_mc, table, 1, 1) | ||
2427 | |||
2428 | static int sbridge_mci_bind_devs(struct mem_ctl_info *mci, | 2420 | static int sbridge_mci_bind_devs(struct mem_ctl_info *mci, |
2429 | struct sbridge_dev *sbridge_dev) | 2421 | struct sbridge_dev *sbridge_dev) |
2430 | { | 2422 | { |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index cebcb405812e..d7860614f87f 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -49,7 +49,7 @@ config GPIO_DEVRES | |||
49 | 49 | ||
50 | config OF_GPIO | 50 | config OF_GPIO |
51 | def_bool y | 51 | def_bool y |
52 | depends on OF || COMPILE_TEST | 52 | depends on OF |
53 | 53 | ||
54 | config GPIO_ACPI | 54 | config GPIO_ACPI |
55 | def_bool y | 55 | def_bool y |
@@ -402,9 +402,12 @@ config GPIO_TB10X | |||
402 | select OF_GPIO | 402 | select OF_GPIO |
403 | 403 | ||
404 | config GPIO_TEGRA | 404 | config GPIO_TEGRA |
405 | bool | 405 | bool "NVIDIA Tegra GPIO support" |
406 | default y | 406 | default ARCH_TEGRA |
407 | depends on ARCH_TEGRA || COMPILE_TEST | 407 | depends on ARCH_TEGRA || COMPILE_TEST |
408 | depends on OF | ||
409 | help | ||
410 | Say yes here to support GPIO pins on NVIDIA Tegra SoCs. | ||
408 | 411 | ||
409 | config GPIO_TS4800 | 412 | config GPIO_TS4800 |
410 | tristate "TS-4800 DIO blocks and compatibles" | 413 | tristate "TS-4800 DIO blocks and compatibles" |
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c index e85e7539cf5d..eb43ae4835c1 100644 --- a/drivers/gpio/gpio-sch.c +++ b/drivers/gpio/gpio-sch.c | |||
@@ -61,9 +61,8 @@ static unsigned sch_gpio_bit(struct sch_gpio *sch, unsigned gpio) | |||
61 | return gpio % 8; | 61 | return gpio % 8; |
62 | } | 62 | } |
63 | 63 | ||
64 | static int sch_gpio_reg_get(struct gpio_chip *gc, unsigned gpio, unsigned reg) | 64 | static int sch_gpio_reg_get(struct sch_gpio *sch, unsigned gpio, unsigned reg) |
65 | { | 65 | { |
66 | struct sch_gpio *sch = gpiochip_get_data(gc); | ||
67 | unsigned short offset, bit; | 66 | unsigned short offset, bit; |
68 | u8 reg_val; | 67 | u8 reg_val; |
69 | 68 | ||
@@ -75,10 +74,9 @@ static int sch_gpio_reg_get(struct gpio_chip *gc, unsigned gpio, unsigned reg) | |||
75 | return reg_val; | 74 | return reg_val; |
76 | } | 75 | } |
77 | 76 | ||
78 | static void sch_gpio_reg_set(struct gpio_chip *gc, unsigned gpio, unsigned reg, | 77 | static void sch_gpio_reg_set(struct sch_gpio *sch, unsigned gpio, unsigned reg, |
79 | int val) | 78 | int val) |
80 | { | 79 | { |
81 | struct sch_gpio *sch = gpiochip_get_data(gc); | ||
82 | unsigned short offset, bit; | 80 | unsigned short offset, bit; |
83 | u8 reg_val; | 81 | u8 reg_val; |
84 | 82 | ||
@@ -98,14 +96,15 @@ static int sch_gpio_direction_in(struct gpio_chip *gc, unsigned gpio_num) | |||
98 | struct sch_gpio *sch = gpiochip_get_data(gc); | 96 | struct sch_gpio *sch = gpiochip_get_data(gc); |
99 | 97 | ||
100 | spin_lock(&sch->lock); | 98 | spin_lock(&sch->lock); |
101 | sch_gpio_reg_set(gc, gpio_num, GIO, 1); | 99 | sch_gpio_reg_set(sch, gpio_num, GIO, 1); |
102 | spin_unlock(&sch->lock); | 100 | spin_unlock(&sch->lock); |
103 | return 0; | 101 | return 0; |
104 | } | 102 | } |
105 | 103 | ||
106 | static int sch_gpio_get(struct gpio_chip *gc, unsigned gpio_num) | 104 | static int sch_gpio_get(struct gpio_chip *gc, unsigned gpio_num) |
107 | { | 105 | { |
108 | return sch_gpio_reg_get(gc, gpio_num, GLV); | 106 | struct sch_gpio *sch = gpiochip_get_data(gc); |
107 | return sch_gpio_reg_get(sch, gpio_num, GLV); | ||
109 | } | 108 | } |
110 | 109 | ||
111 | static void sch_gpio_set(struct gpio_chip *gc, unsigned gpio_num, int val) | 110 | static void sch_gpio_set(struct gpio_chip *gc, unsigned gpio_num, int val) |
@@ -113,7 +112,7 @@ static void sch_gpio_set(struct gpio_chip *gc, unsigned gpio_num, int val) | |||
113 | struct sch_gpio *sch = gpiochip_get_data(gc); | 112 | struct sch_gpio *sch = gpiochip_get_data(gc); |
114 | 113 | ||
115 | spin_lock(&sch->lock); | 114 | spin_lock(&sch->lock); |
116 | sch_gpio_reg_set(gc, gpio_num, GLV, val); | 115 | sch_gpio_reg_set(sch, gpio_num, GLV, val); |
117 | spin_unlock(&sch->lock); | 116 | spin_unlock(&sch->lock); |
118 | } | 117 | } |
119 | 118 | ||
@@ -123,7 +122,7 @@ static int sch_gpio_direction_out(struct gpio_chip *gc, unsigned gpio_num, | |||
123 | struct sch_gpio *sch = gpiochip_get_data(gc); | 122 | struct sch_gpio *sch = gpiochip_get_data(gc); |
124 | 123 | ||
125 | spin_lock(&sch->lock); | 124 | spin_lock(&sch->lock); |
126 | sch_gpio_reg_set(gc, gpio_num, GIO, 0); | 125 | sch_gpio_reg_set(sch, gpio_num, GIO, 0); |
127 | spin_unlock(&sch->lock); | 126 | spin_unlock(&sch->lock); |
128 | 127 | ||
129 | /* | 128 | /* |
@@ -182,13 +181,13 @@ static int sch_gpio_probe(struct platform_device *pdev) | |||
182 | * GPIO7 is configured by the CMC as SLPIOVR | 181 | * GPIO7 is configured by the CMC as SLPIOVR |
183 | * Enable GPIO[9:8] core powered gpios explicitly | 182 | * Enable GPIO[9:8] core powered gpios explicitly |
184 | */ | 183 | */ |
185 | sch_gpio_reg_set(&sch->chip, 8, GEN, 1); | 184 | sch_gpio_reg_set(sch, 8, GEN, 1); |
186 | sch_gpio_reg_set(&sch->chip, 9, GEN, 1); | 185 | sch_gpio_reg_set(sch, 9, GEN, 1); |
187 | /* | 186 | /* |
188 | * SUS_GPIO[2:0] enabled by default | 187 | * SUS_GPIO[2:0] enabled by default |
189 | * Enable SUS_GPIO3 resume powered gpio explicitly | 188 | * Enable SUS_GPIO3 resume powered gpio explicitly |
190 | */ | 189 | */ |
191 | sch_gpio_reg_set(&sch->chip, 13, GEN, 1); | 190 | sch_gpio_reg_set(sch, 13, GEN, 1); |
192 | break; | 191 | break; |
193 | 192 | ||
194 | case PCI_DEVICE_ID_INTEL_ITC_LPC: | 193 | case PCI_DEVICE_ID_INTEL_ITC_LPC: |
diff --git a/drivers/gpio/gpiolib-legacy.c b/drivers/gpio/gpiolib-legacy.c index 3a5c7011ad3b..8b830996fe02 100644 --- a/drivers/gpio/gpiolib-legacy.c +++ b/drivers/gpio/gpiolib-legacy.c | |||
@@ -28,6 +28,10 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) | |||
28 | if (!desc && gpio_is_valid(gpio)) | 28 | if (!desc && gpio_is_valid(gpio)) |
29 | return -EPROBE_DEFER; | 29 | return -EPROBE_DEFER; |
30 | 30 | ||
31 | err = gpiod_request(desc, label); | ||
32 | if (err) | ||
33 | return err; | ||
34 | |||
31 | if (flags & GPIOF_OPEN_DRAIN) | 35 | if (flags & GPIOF_OPEN_DRAIN) |
32 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); | 36 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); |
33 | 37 | ||
@@ -37,10 +41,6 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) | |||
37 | if (flags & GPIOF_ACTIVE_LOW) | 41 | if (flags & GPIOF_ACTIVE_LOW) |
38 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); | 42 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); |
39 | 43 | ||
40 | err = gpiod_request(desc, label); | ||
41 | if (err) | ||
42 | return err; | ||
43 | |||
44 | if (flags & GPIOF_DIR_IN) | 44 | if (flags & GPIOF_DIR_IN) |
45 | err = gpiod_direction_input(desc); | 45 | err = gpiod_direction_input(desc); |
46 | else | 46 | else |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 570771ed19e6..be74bd370f1f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -1352,14 +1352,6 @@ static int __gpiod_request(struct gpio_desc *desc, const char *label) | |||
1352 | spin_lock_irqsave(&gpio_lock, flags); | 1352 | spin_lock_irqsave(&gpio_lock, flags); |
1353 | } | 1353 | } |
1354 | done: | 1354 | done: |
1355 | if (status < 0) { | ||
1356 | /* Clear flags that might have been set by the caller before | ||
1357 | * requesting the GPIO. | ||
1358 | */ | ||
1359 | clear_bit(FLAG_ACTIVE_LOW, &desc->flags); | ||
1360 | clear_bit(FLAG_OPEN_DRAIN, &desc->flags); | ||
1361 | clear_bit(FLAG_OPEN_SOURCE, &desc->flags); | ||
1362 | } | ||
1363 | spin_unlock_irqrestore(&gpio_lock, flags); | 1355 | spin_unlock_irqrestore(&gpio_lock, flags); |
1364 | return status; | 1356 | return status; |
1365 | } | 1357 | } |
@@ -2587,28 +2579,13 @@ struct gpio_desc *__must_check gpiod_get_optional(struct device *dev, | |||
2587 | } | 2579 | } |
2588 | EXPORT_SYMBOL_GPL(gpiod_get_optional); | 2580 | EXPORT_SYMBOL_GPL(gpiod_get_optional); |
2589 | 2581 | ||
2590 | /** | ||
2591 | * gpiod_parse_flags - helper function to parse GPIO lookup flags | ||
2592 | * @desc: gpio to be setup | ||
2593 | * @lflags: gpio_lookup_flags - returned from of_find_gpio() or | ||
2594 | * of_get_gpio_hog() | ||
2595 | * | ||
2596 | * Set the GPIO descriptor flags based on the given GPIO lookup flags. | ||
2597 | */ | ||
2598 | static void gpiod_parse_flags(struct gpio_desc *desc, unsigned long lflags) | ||
2599 | { | ||
2600 | if (lflags & GPIO_ACTIVE_LOW) | ||
2601 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); | ||
2602 | if (lflags & GPIO_OPEN_DRAIN) | ||
2603 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); | ||
2604 | if (lflags & GPIO_OPEN_SOURCE) | ||
2605 | set_bit(FLAG_OPEN_SOURCE, &desc->flags); | ||
2606 | } | ||
2607 | 2582 | ||
2608 | /** | 2583 | /** |
2609 | * gpiod_configure_flags - helper function to configure a given GPIO | 2584 | * gpiod_configure_flags - helper function to configure a given GPIO |
2610 | * @desc: gpio whose value will be assigned | 2585 | * @desc: gpio whose value will be assigned |
2611 | * @con_id: function within the GPIO consumer | 2586 | * @con_id: function within the GPIO consumer |
2587 | * @lflags: gpio_lookup_flags - returned from of_find_gpio() or | ||
2588 | * of_get_gpio_hog() | ||
2612 | * @dflags: gpiod_flags - optional GPIO initialization flags | 2589 | * @dflags: gpiod_flags - optional GPIO initialization flags |
2613 | * | 2590 | * |
2614 | * Return 0 on success, -ENOENT if no GPIO has been assigned to the | 2591 | * Return 0 on success, -ENOENT if no GPIO has been assigned to the |
@@ -2616,10 +2593,17 @@ static void gpiod_parse_flags(struct gpio_desc *desc, unsigned long lflags) | |||
2616 | * occurred while trying to acquire the GPIO. | 2593 | * occurred while trying to acquire the GPIO. |
2617 | */ | 2594 | */ |
2618 | static int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id, | 2595 | static int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id, |
2619 | enum gpiod_flags dflags) | 2596 | unsigned long lflags, enum gpiod_flags dflags) |
2620 | { | 2597 | { |
2621 | int status; | 2598 | int status; |
2622 | 2599 | ||
2600 | if (lflags & GPIO_ACTIVE_LOW) | ||
2601 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); | ||
2602 | if (lflags & GPIO_OPEN_DRAIN) | ||
2603 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); | ||
2604 | if (lflags & GPIO_OPEN_SOURCE) | ||
2605 | set_bit(FLAG_OPEN_SOURCE, &desc->flags); | ||
2606 | |||
2623 | /* No particular flag request, return here... */ | 2607 | /* No particular flag request, return here... */ |
2624 | if (!(dflags & GPIOD_FLAGS_BIT_DIR_SET)) { | 2608 | if (!(dflags & GPIOD_FLAGS_BIT_DIR_SET)) { |
2625 | pr_debug("no flags found for %s\n", con_id); | 2609 | pr_debug("no flags found for %s\n", con_id); |
@@ -2686,13 +2670,11 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | |||
2686 | return desc; | 2670 | return desc; |
2687 | } | 2671 | } |
2688 | 2672 | ||
2689 | gpiod_parse_flags(desc, lookupflags); | ||
2690 | |||
2691 | status = gpiod_request(desc, con_id); | 2673 | status = gpiod_request(desc, con_id); |
2692 | if (status < 0) | 2674 | if (status < 0) |
2693 | return ERR_PTR(status); | 2675 | return ERR_PTR(status); |
2694 | 2676 | ||
2695 | status = gpiod_configure_flags(desc, con_id, flags); | 2677 | status = gpiod_configure_flags(desc, con_id, lookupflags, flags); |
2696 | if (status < 0) { | 2678 | if (status < 0) { |
2697 | dev_dbg(dev, "setup of GPIO %s failed\n", con_id); | 2679 | dev_dbg(dev, "setup of GPIO %s failed\n", con_id); |
2698 | gpiod_put(desc); | 2680 | gpiod_put(desc); |
@@ -2748,6 +2730,10 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, | |||
2748 | if (IS_ERR(desc)) | 2730 | if (IS_ERR(desc)) |
2749 | return desc; | 2731 | return desc; |
2750 | 2732 | ||
2733 | ret = gpiod_request(desc, NULL); | ||
2734 | if (ret) | ||
2735 | return ERR_PTR(ret); | ||
2736 | |||
2751 | if (active_low) | 2737 | if (active_low) |
2752 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); | 2738 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); |
2753 | 2739 | ||
@@ -2758,10 +2744,6 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, | |||
2758 | set_bit(FLAG_OPEN_SOURCE, &desc->flags); | 2744 | set_bit(FLAG_OPEN_SOURCE, &desc->flags); |
2759 | } | 2745 | } |
2760 | 2746 | ||
2761 | ret = gpiod_request(desc, NULL); | ||
2762 | if (ret) | ||
2763 | return ERR_PTR(ret); | ||
2764 | |||
2765 | return desc; | 2747 | return desc; |
2766 | } | 2748 | } |
2767 | EXPORT_SYMBOL_GPL(fwnode_get_named_gpiod); | 2749 | EXPORT_SYMBOL_GPL(fwnode_get_named_gpiod); |
@@ -2814,8 +2796,6 @@ int gpiod_hog(struct gpio_desc *desc, const char *name, | |||
2814 | chip = gpiod_to_chip(desc); | 2796 | chip = gpiod_to_chip(desc); |
2815 | hwnum = gpio_chip_hwgpio(desc); | 2797 | hwnum = gpio_chip_hwgpio(desc); |
2816 | 2798 | ||
2817 | gpiod_parse_flags(desc, lflags); | ||
2818 | |||
2819 | local_desc = gpiochip_request_own_desc(chip, hwnum, name); | 2799 | local_desc = gpiochip_request_own_desc(chip, hwnum, name); |
2820 | if (IS_ERR(local_desc)) { | 2800 | if (IS_ERR(local_desc)) { |
2821 | status = PTR_ERR(local_desc); | 2801 | status = PTR_ERR(local_desc); |
@@ -2824,7 +2804,7 @@ int gpiod_hog(struct gpio_desc *desc, const char *name, | |||
2824 | return status; | 2804 | return status; |
2825 | } | 2805 | } |
2826 | 2806 | ||
2827 | status = gpiod_configure_flags(desc, name, dflags); | 2807 | status = gpiod_configure_flags(desc, name, lflags, dflags); |
2828 | if (status < 0) { | 2808 | if (status < 0) { |
2829 | pr_err("setup of hog GPIO %s (chip %s, offset %d) failed, %d\n", | 2809 | pr_err("setup of hog GPIO %s (chip %s, offset %d) failed, %d\n", |
2830 | name, chip->label, hwnum, status); | 2810 | name, chip->label, hwnum, status); |
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c index 13cdb01e9b45..bc56c8a181e6 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c | |||
@@ -156,3 +156,18 @@ u32 amdgpu_atombios_i2c_func(struct i2c_adapter *adap) | |||
156 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | 156 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; |
157 | } | 157 | } |
158 | 158 | ||
159 | void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device* adev, u8 slave_addr, u8 line_number, u8 offset, u8 data) | ||
160 | { | ||
161 | PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION args; | ||
162 | int index = GetIndexIntoMasterTable(COMMAND, ProcessI2cChannelTransaction); | ||
163 | |||
164 | args.ucRegIndex = offset; | ||
165 | args.lpI2CDataOut = data; | ||
166 | args.ucFlag = 1; | ||
167 | args.ucI2CSpeed = TARGET_HW_I2C_CLOCK; | ||
168 | args.ucTransBytes = 1; | ||
169 | args.ucSlaveAddr = slave_addr; | ||
170 | args.ucLineNumber = line_number; | ||
171 | |||
172 | amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args); | ||
173 | } | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h index d6128d9de56e..251aaf41f65d 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h | |||
@@ -27,5 +27,7 @@ | |||
27 | int amdgpu_atombios_i2c_xfer(struct i2c_adapter *i2c_adap, | 27 | int amdgpu_atombios_i2c_xfer(struct i2c_adapter *i2c_adap, |
28 | struct i2c_msg *msgs, int num); | 28 | struct i2c_msg *msgs, int num); |
29 | u32 amdgpu_atombios_i2c_func(struct i2c_adapter *adap); | 29 | u32 amdgpu_atombios_i2c_func(struct i2c_adapter *adap); |
30 | void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device* adev, | ||
31 | u8 slave_addr, u8 line_number, u8 offset, u8 data); | ||
30 | 32 | ||
31 | #endif | 33 | #endif |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index b2ebd4fef6cf..c2ef94511f70 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "vid.h" | 28 | #include "vid.h" |
29 | #include "amdgpu_ucode.h" | 29 | #include "amdgpu_ucode.h" |
30 | #include "amdgpu_atombios.h" | 30 | #include "amdgpu_atombios.h" |
31 | #include "atombios_i2c.h" | ||
31 | #include "clearstate_vi.h" | 32 | #include "clearstate_vi.h" |
32 | 33 | ||
33 | #include "gmc/gmc_8_2_d.h" | 34 | #include "gmc/gmc_8_2_d.h" |
@@ -284,6 +285,7 @@ static const u32 golden_settings_polaris11_a11[] = | |||
284 | mmTCP_ADDR_CONFIG, 0x000003ff, 0x000000f3, | 285 | mmTCP_ADDR_CONFIG, 0x000003ff, 0x000000f3, |
285 | mmTCP_CHAN_STEER_HI, 0xffffffff, 0x00000000, | 286 | mmTCP_CHAN_STEER_HI, 0xffffffff, 0x00000000, |
286 | mmTCP_CHAN_STEER_LO, 0xffffffff, 0x00003210, | 287 | mmTCP_CHAN_STEER_LO, 0xffffffff, 0x00003210, |
288 | mmVGT_RESET_DEBUG, 0x00000004, 0x00000004, | ||
287 | }; | 289 | }; |
288 | 290 | ||
289 | static const u32 polaris11_golden_common_all[] = | 291 | static const u32 polaris11_golden_common_all[] = |
@@ -314,6 +316,7 @@ static const u32 golden_settings_polaris10_a11[] = | |||
314 | mmTCC_CTRL, 0x00100000, 0xf31fff7f, | 316 | mmTCC_CTRL, 0x00100000, 0xf31fff7f, |
315 | mmTCP_ADDR_CONFIG, 0x000003ff, 0x000000f7, | 317 | mmTCP_ADDR_CONFIG, 0x000003ff, 0x000000f7, |
316 | mmTCP_CHAN_STEER_HI, 0xffffffff, 0x00000000, | 318 | mmTCP_CHAN_STEER_HI, 0xffffffff, 0x00000000, |
319 | mmVGT_RESET_DEBUG, 0x00000004, 0x00000004, | ||
317 | }; | 320 | }; |
318 | 321 | ||
319 | static const u32 polaris10_golden_common_all[] = | 322 | static const u32 polaris10_golden_common_all[] = |
@@ -696,6 +699,10 @@ static void gfx_v8_0_init_golden_registers(struct amdgpu_device *adev) | |||
696 | polaris10_golden_common_all, | 699 | polaris10_golden_common_all, |
697 | (const u32)ARRAY_SIZE(polaris10_golden_common_all)); | 700 | (const u32)ARRAY_SIZE(polaris10_golden_common_all)); |
698 | WREG32_SMC(ixCG_ACLK_CNTL, 0x0000001C); | 701 | WREG32_SMC(ixCG_ACLK_CNTL, 0x0000001C); |
702 | if (adev->pdev->revision == 0xc7) { | ||
703 | amdgpu_atombios_i2c_channel_trans(adev, 0x10, 0x96, 0x1E, 0xDD); | ||
704 | amdgpu_atombios_i2c_channel_trans(adev, 0x10, 0x96, 0x1F, 0xD0); | ||
705 | } | ||
699 | break; | 706 | break; |
700 | case CHIP_CARRIZO: | 707 | case CHIP_CARRIZO: |
701 | amdgpu_program_register_sequence(adev, | 708 | amdgpu_program_register_sequence(adev, |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c index ec2a7ada346a..91e25f942d90 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c | |||
@@ -98,7 +98,6 @@ | |||
98 | #define PCIE_BUS_CLK 10000 | 98 | #define PCIE_BUS_CLK 10000 |
99 | #define TCLK (PCIE_BUS_CLK / 10) | 99 | #define TCLK (PCIE_BUS_CLK / 10) |
100 | 100 | ||
101 | #define CEILING_UCHAR(double) ((double-(uint8_t)(double)) > 0 ? (uint8_t)(double+1) : (uint8_t)(double)) | ||
102 | 101 | ||
103 | static const uint16_t polaris10_clock_stretcher_lookup_table[2][4] = | 102 | static const uint16_t polaris10_clock_stretcher_lookup_table[2][4] = |
104 | { {600, 1050, 3, 0}, {600, 1050, 6, 1} }; | 103 | { {600, 1050, 3, 0}, {600, 1050, 6, 1} }; |
@@ -733,7 +732,7 @@ static int polaris10_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr, | |||
733 | table->Smio[level] |= | 732 | table->Smio[level] |= |
734 | data->mvdd_voltage_table.entries[level].smio_low; | 733 | data->mvdd_voltage_table.entries[level].smio_low; |
735 | } | 734 | } |
736 | table->SmioMask2 = data->vddci_voltage_table.mask_low; | 735 | table->SmioMask2 = data->mvdd_voltage_table.mask_low; |
737 | 736 | ||
738 | table->MvddLevelCount = (uint32_t) PP_HOST_TO_SMC_UL(count); | 737 | table->MvddLevelCount = (uint32_t) PP_HOST_TO_SMC_UL(count); |
739 | } | 738 | } |
@@ -1807,27 +1806,25 @@ static int polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr) | |||
1807 | 1806 | ||
1808 | ro = efuse * (max -min)/255 + min; | 1807 | ro = efuse * (max -min)/255 + min; |
1809 | 1808 | ||
1810 | /* Populate Sclk_CKS_masterEn0_7 and Sclk_voltageOffset | 1809 | /* Populate Sclk_CKS_masterEn0_7 and Sclk_voltageOffset */ |
1811 | * there is a little difference in calculating | ||
1812 | * volt_with_cks with windows */ | ||
1813 | for (i = 0; i < sclk_table->count; i++) { | 1810 | for (i = 0; i < sclk_table->count; i++) { |
1814 | data->smc_state_table.Sclk_CKS_masterEn0_7 |= | 1811 | data->smc_state_table.Sclk_CKS_masterEn0_7 |= |
1815 | sclk_table->entries[i].cks_enable << i; | 1812 | sclk_table->entries[i].cks_enable << i; |
1816 | if (hwmgr->chip_id == CHIP_POLARIS10) { | 1813 | if (hwmgr->chip_id == CHIP_POLARIS10) { |
1817 | volt_without_cks = (uint32_t)((2753594000 + (sclk_table->entries[i].clk/100) * 136418 -(ro - 70) * 1000000) / \ | 1814 | volt_without_cks = (uint32_t)((2753594000U + (sclk_table->entries[i].clk/100) * 136418 -(ro - 70) * 1000000) / \ |
1818 | (2424180 - (sclk_table->entries[i].clk/100) * 1132925/1000)); | 1815 | (2424180 - (sclk_table->entries[i].clk/100) * 1132925/1000)); |
1819 | volt_with_cks = (uint32_t)((279720200 + sclk_table->entries[i].clk * 3232 - (ro - 65) * 100000000) / \ | 1816 | volt_with_cks = (uint32_t)((2797202000U + sclk_table->entries[i].clk/100 * 3232 - (ro - 65) * 1000000) / \ |
1820 | (252248000 - sclk_table->entries[i].clk/100 * 115764)); | 1817 | (2522480 - sclk_table->entries[i].clk/100 * 115764/100)); |
1821 | } else { | 1818 | } else { |
1822 | volt_without_cks = (uint32_t)((2416794800 + (sclk_table->entries[i].clk/100) * 1476925/10 -(ro - 50) * 1000000) / \ | 1819 | volt_without_cks = (uint32_t)((2416794800U + (sclk_table->entries[i].clk/100) * 1476925/10 -(ro - 50) * 1000000) / \ |
1823 | (2625416 - (sclk_table->entries[i].clk/100) * 12586807/10000)); | 1820 | (2625416 - (sclk_table->entries[i].clk/100) * (12586807/10000))); |
1824 | volt_with_cks = (uint32_t)((2999656000 + sclk_table->entries[i].clk * 392803/100 - (ro - 44) * 1000000) / \ | 1821 | volt_with_cks = (uint32_t)((2999656000U - sclk_table->entries[i].clk/100 * 392803 - (ro - 44) * 1000000) / \ |
1825 | (3422454 - sclk_table->entries[i].clk/100 * 18886376/10000)); | 1822 | (3422454 - sclk_table->entries[i].clk/100 * (18886376/10000))); |
1826 | } | 1823 | } |
1827 | 1824 | ||
1828 | if (volt_without_cks >= volt_with_cks) | 1825 | if (volt_without_cks >= volt_with_cks) |
1829 | volt_offset = (uint8_t)CEILING_UCHAR((volt_without_cks - volt_with_cks + | 1826 | volt_offset = (uint8_t)(((volt_without_cks - volt_with_cks + |
1830 | sclk_table->entries[i].cks_voffset) * 100 / 625); | 1827 | sclk_table->entries[i].cks_voffset) * 100 + 624) / 625); |
1831 | 1828 | ||
1832 | data->smc_state_table.Sclk_voltageOffset[i] = volt_offset; | 1829 | data->smc_state_table.Sclk_voltageOffset[i] = volt_offset; |
1833 | } | 1830 | } |
@@ -2685,7 +2682,7 @@ static int polaris10_get_evv_voltages(struct pp_hwmgr *hwmgr) | |||
2685 | { | 2682 | { |
2686 | struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend); | 2683 | struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend); |
2687 | uint16_t vv_id; | 2684 | uint16_t vv_id; |
2688 | uint16_t vddc = 0; | 2685 | uint32_t vddc = 0; |
2689 | uint16_t i, j; | 2686 | uint16_t i, j; |
2690 | uint32_t sclk = 0; | 2687 | uint32_t sclk = 0; |
2691 | struct phm_ppt_v1_information *table_info = | 2688 | struct phm_ppt_v1_information *table_info = |
@@ -2716,8 +2713,9 @@ static int polaris10_get_evv_voltages(struct pp_hwmgr *hwmgr) | |||
2716 | continue); | 2713 | continue); |
2717 | 2714 | ||
2718 | 2715 | ||
2719 | /* need to make sure vddc is less than 2v or else, it could burn the ASIC. */ | 2716 | /* need to make sure vddc is less than 2v or else, it could burn the ASIC. |
2720 | PP_ASSERT_WITH_CODE((vddc < 2000 && vddc != 0), | 2717 | * real voltage level in unit of 0.01mv */ |
2718 | PP_ASSERT_WITH_CODE((vddc < 200000 && vddc != 0), | ||
2721 | "Invalid VDDC value", result = -EINVAL;); | 2719 | "Invalid VDDC value", result = -EINVAL;); |
2722 | 2720 | ||
2723 | /* the voltage should not be zero nor equal to leakage ID */ | 2721 | /* the voltage should not be zero nor equal to leakage ID */ |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c index bf4e18fd3872..90b35c5c10a4 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c | |||
@@ -1256,7 +1256,7 @@ int atomctrl_set_ac_timing_ai(struct pp_hwmgr *hwmgr, uint32_t memory_clock, | |||
1256 | } | 1256 | } |
1257 | 1257 | ||
1258 | int atomctrl_get_voltage_evv_on_sclk_ai(struct pp_hwmgr *hwmgr, uint8_t voltage_type, | 1258 | int atomctrl_get_voltage_evv_on_sclk_ai(struct pp_hwmgr *hwmgr, uint8_t voltage_type, |
1259 | uint32_t sclk, uint16_t virtual_voltage_Id, uint16_t *voltage) | 1259 | uint32_t sclk, uint16_t virtual_voltage_Id, uint32_t *voltage) |
1260 | { | 1260 | { |
1261 | 1261 | ||
1262 | int result; | 1262 | int result; |
@@ -1274,7 +1274,7 @@ int atomctrl_get_voltage_evv_on_sclk_ai(struct pp_hwmgr *hwmgr, uint8_t voltage_ | |||
1274 | if (0 != result) | 1274 | if (0 != result) |
1275 | return result; | 1275 | return result; |
1276 | 1276 | ||
1277 | *voltage = get_voltage_info_param_space.usVoltageLevel; | 1277 | *voltage = ((GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_3 *)(&get_voltage_info_param_space))->ulVoltageLevel; |
1278 | 1278 | ||
1279 | return result; | 1279 | return result; |
1280 | } | 1280 | } |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.h b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.h index 248c5db5f380..1e35a9625baf 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.h | |||
@@ -305,7 +305,7 @@ extern int atomctrl_get_engine_pll_dividers_ai(struct pp_hwmgr *hwmgr, uint32_t | |||
305 | extern int atomctrl_set_ac_timing_ai(struct pp_hwmgr *hwmgr, uint32_t memory_clock, | 305 | extern int atomctrl_set_ac_timing_ai(struct pp_hwmgr *hwmgr, uint32_t memory_clock, |
306 | uint8_t level); | 306 | uint8_t level); |
307 | extern int atomctrl_get_voltage_evv_on_sclk_ai(struct pp_hwmgr *hwmgr, uint8_t voltage_type, | 307 | extern int atomctrl_get_voltage_evv_on_sclk_ai(struct pp_hwmgr *hwmgr, uint8_t voltage_type, |
308 | uint32_t sclk, uint16_t virtual_voltage_Id, uint16_t *voltage); | 308 | uint32_t sclk, uint16_t virtual_voltage_Id, uint32_t *voltage); |
309 | extern int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctrl_sclk_range_table *table); | 309 | extern int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctrl_sclk_range_table *table); |
310 | 310 | ||
311 | extern int atomctrl_get_avfs_information(struct pp_hwmgr *hwmgr, struct pp_atom_ctrl__avfs_parameters *param); | 311 | extern int atomctrl_get_avfs_information(struct pp_hwmgr *hwmgr, struct pp_atom_ctrl__avfs_parameters *param); |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c index 233eb7f36c1d..5d0f655bf160 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | |||
@@ -1302,7 +1302,7 @@ static int tonga_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr, | |||
1302 | table->Smio[count] |= | 1302 | table->Smio[count] |= |
1303 | data->mvdd_voltage_table.entries[count].smio_low; | 1303 | data->mvdd_voltage_table.entries[count].smio_low; |
1304 | } | 1304 | } |
1305 | table->SmioMask2 = data->vddci_voltage_table.mask_low; | 1305 | table->SmioMask2 = data->mvdd_voltage_table.mask_low; |
1306 | 1306 | ||
1307 | CONVERT_FROM_HOST_TO_SMC_UL(table->MvddLevelCount); | 1307 | CONVERT_FROM_HOST_TO_SMC_UL(table->MvddLevelCount); |
1308 | } | 1308 | } |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c index 671fdb4d615a..dccc859f638c 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c | |||
@@ -302,7 +302,7 @@ static int init_dpm_2_parameters( | |||
302 | (((unsigned long)powerplay_table) + le16_to_cpu(powerplay_table->usPPMTableOffset)); | 302 | (((unsigned long)powerplay_table) + le16_to_cpu(powerplay_table->usPPMTableOffset)); |
303 | 303 | ||
304 | if (0 != powerplay_table->usPPMTableOffset) { | 304 | if (0 != powerplay_table->usPPMTableOffset) { |
305 | if (1 == get_platform_power_management_table(hwmgr, atom_ppm_table)) { | 305 | if (get_platform_power_management_table(hwmgr, atom_ppm_table) == 0) { |
306 | phm_cap_set(hwmgr->platform_descriptor.platformCaps, | 306 | phm_cap_set(hwmgr->platform_descriptor.platformCaps, |
307 | PHM_PlatformCaps_EnablePlatformPowerManagement); | 307 | PHM_PlatformCaps_EnablePlatformPowerManagement); |
308 | } | 308 | } |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index f313b4d8344f..85c4debf47e0 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -512,6 +512,10 @@ void intel_detect_pch(struct drm_device *dev) | |||
512 | DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n"); | 512 | DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n"); |
513 | WARN_ON(!IS_SKYLAKE(dev) && | 513 | WARN_ON(!IS_SKYLAKE(dev) && |
514 | !IS_KABYLAKE(dev)); | 514 | !IS_KABYLAKE(dev)); |
515 | } else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) { | ||
516 | dev_priv->pch_type = PCH_KBP; | ||
517 | DRM_DEBUG_KMS("Found KabyPoint PCH\n"); | ||
518 | WARN_ON(!IS_KABYLAKE(dev)); | ||
515 | } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || | 519 | } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || |
516 | (id == INTEL_PCH_P3X_DEVICE_ID_TYPE) || | 520 | (id == INTEL_PCH_P3X_DEVICE_ID_TYPE) || |
517 | ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && | 521 | ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 7c334e902266..bc3f2e6842e7 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -990,6 +990,7 @@ enum intel_pch { | |||
990 | PCH_CPT, /* Cougarpoint PCH */ | 990 | PCH_CPT, /* Cougarpoint PCH */ |
991 | PCH_LPT, /* Lynxpoint PCH */ | 991 | PCH_LPT, /* Lynxpoint PCH */ |
992 | PCH_SPT, /* Sunrisepoint PCH */ | 992 | PCH_SPT, /* Sunrisepoint PCH */ |
993 | PCH_KBP, /* Kabypoint PCH */ | ||
993 | PCH_NOP, | 994 | PCH_NOP, |
994 | }; | 995 | }; |
995 | 996 | ||
@@ -2600,6 +2601,15 @@ struct drm_i915_cmd_table { | |||
2600 | 2601 | ||
2601 | #define IS_BXT_REVID(p, since, until) (IS_BROXTON(p) && IS_REVID(p, since, until)) | 2602 | #define IS_BXT_REVID(p, since, until) (IS_BROXTON(p) && IS_REVID(p, since, until)) |
2602 | 2603 | ||
2604 | #define KBL_REVID_A0 0x0 | ||
2605 | #define KBL_REVID_B0 0x1 | ||
2606 | #define KBL_REVID_C0 0x2 | ||
2607 | #define KBL_REVID_D0 0x3 | ||
2608 | #define KBL_REVID_E0 0x4 | ||
2609 | |||
2610 | #define IS_KBL_REVID(p, since, until) \ | ||
2611 | (IS_KABYLAKE(p) && IS_REVID(p, since, until)) | ||
2612 | |||
2603 | /* | 2613 | /* |
2604 | * The genX designation typically refers to the render engine, so render | 2614 | * The genX designation typically refers to the render engine, so render |
2605 | * capability related checks should use IS_GEN, while display and other checks | 2615 | * capability related checks should use IS_GEN, while display and other checks |
@@ -2708,11 +2718,13 @@ struct drm_i915_cmd_table { | |||
2708 | #define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE 0x9c00 | 2718 | #define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE 0x9c00 |
2709 | #define INTEL_PCH_SPT_DEVICE_ID_TYPE 0xA100 | 2719 | #define INTEL_PCH_SPT_DEVICE_ID_TYPE 0xA100 |
2710 | #define INTEL_PCH_SPT_LP_DEVICE_ID_TYPE 0x9D00 | 2720 | #define INTEL_PCH_SPT_LP_DEVICE_ID_TYPE 0x9D00 |
2721 | #define INTEL_PCH_KBP_DEVICE_ID_TYPE 0xA200 | ||
2711 | #define INTEL_PCH_P2X_DEVICE_ID_TYPE 0x7100 | 2722 | #define INTEL_PCH_P2X_DEVICE_ID_TYPE 0x7100 |
2712 | #define INTEL_PCH_P3X_DEVICE_ID_TYPE 0x7000 | 2723 | #define INTEL_PCH_P3X_DEVICE_ID_TYPE 0x7000 |
2713 | #define INTEL_PCH_QEMU_DEVICE_ID_TYPE 0x2900 /* qemu q35 has 2918 */ | 2724 | #define INTEL_PCH_QEMU_DEVICE_ID_TYPE 0x2900 /* qemu q35 has 2918 */ |
2714 | 2725 | ||
2715 | #define INTEL_PCH_TYPE(dev) (__I915__(dev)->pch_type) | 2726 | #define INTEL_PCH_TYPE(dev) (__I915__(dev)->pch_type) |
2727 | #define HAS_PCH_KBP(dev) (INTEL_PCH_TYPE(dev) == PCH_KBP) | ||
2716 | #define HAS_PCH_SPT(dev) (INTEL_PCH_TYPE(dev) == PCH_SPT) | 2728 | #define HAS_PCH_SPT(dev) (INTEL_PCH_TYPE(dev) == PCH_SPT) |
2717 | #define HAS_PCH_LPT(dev) (INTEL_PCH_TYPE(dev) == PCH_LPT) | 2729 | #define HAS_PCH_LPT(dev) (INTEL_PCH_TYPE(dev) == PCH_LPT) |
2718 | #define HAS_PCH_LPT_LP(dev) (__I915__(dev)->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) | 2730 | #define HAS_PCH_LPT_LP(dev) (__I915__(dev)->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) |
diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c index 425e721aac58..66571466e9a8 100644 --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c | |||
@@ -40,7 +40,7 @@ static bool mutex_is_locked_by(struct mutex *mutex, struct task_struct *task) | |||
40 | if (!mutex_is_locked(mutex)) | 40 | if (!mutex_is_locked(mutex)) |
41 | return false; | 41 | return false; |
42 | 42 | ||
43 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES) | 43 | #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_MUTEX_SPIN_ON_OWNER) |
44 | return mutex->owner == task; | 44 | return mutex->owner == task; |
45 | #else | 45 | #else |
46 | /* Since UP may be pre-empted, we cannot assume that we own the lock */ | 46 | /* Since UP may be pre-empted, we cannot assume that we own the lock */ |
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index b7ce963fb8f8..44004e3f09e4 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c | |||
@@ -55,8 +55,10 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv, | |||
55 | return -ENODEV; | 55 | return -ENODEV; |
56 | 56 | ||
57 | /* See the comment at the drm_mm_init() call for more about this check. | 57 | /* See the comment at the drm_mm_init() call for more about this check. |
58 | * WaSkipStolenMemoryFirstPage:bdw,chv (incomplete) */ | 58 | * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete) |
59 | if (INTEL_INFO(dev_priv)->gen == 8 && start < 4096) | 59 | */ |
60 | if (start < 4096 && (IS_GEN8(dev_priv) || | ||
61 | IS_KBL_REVID(dev_priv, 0, KBL_REVID_A0))) | ||
60 | start = 4096; | 62 | start = 4096; |
61 | 63 | ||
62 | mutex_lock(&dev_priv->mm.stolen_lock); | 64 | mutex_lock(&dev_priv->mm.stolen_lock); |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 2f6fd33c07ba..aab47f7bb61b 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -2471,7 +2471,7 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl) | |||
2471 | I915_WRITE(SDEIIR, iir); | 2471 | I915_WRITE(SDEIIR, iir); |
2472 | ret = IRQ_HANDLED; | 2472 | ret = IRQ_HANDLED; |
2473 | 2473 | ||
2474 | if (HAS_PCH_SPT(dev_priv)) | 2474 | if (HAS_PCH_SPT(dev_priv) || HAS_PCH_KBP(dev_priv)) |
2475 | spt_irq_handler(dev, iir); | 2475 | spt_irq_handler(dev, iir); |
2476 | else | 2476 | else |
2477 | cpt_irq_handler(dev, iir); | 2477 | cpt_irq_handler(dev, iir); |
@@ -4661,7 +4661,7 @@ void intel_irq_init(struct drm_i915_private *dev_priv) | |||
4661 | dev->driver->disable_vblank = gen8_disable_vblank; | 4661 | dev->driver->disable_vblank = gen8_disable_vblank; |
4662 | if (IS_BROXTON(dev)) | 4662 | if (IS_BROXTON(dev)) |
4663 | dev_priv->display.hpd_irq_setup = bxt_hpd_irq_setup; | 4663 | dev_priv->display.hpd_irq_setup = bxt_hpd_irq_setup; |
4664 | else if (HAS_PCH_SPT(dev)) | 4664 | else if (HAS_PCH_SPT(dev) || HAS_PCH_KBP(dev)) |
4665 | dev_priv->display.hpd_irq_setup = spt_hpd_irq_setup; | 4665 | dev_priv->display.hpd_irq_setup = spt_hpd_irq_setup; |
4666 | else | 4666 | else |
4667 | dev_priv->display.hpd_irq_setup = ilk_hpd_irq_setup; | 4667 | dev_priv->display.hpd_irq_setup = ilk_hpd_irq_setup; |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index b407411e31ba..3fcf7dd5b6ca 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -220,6 +220,9 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) | |||
220 | #define ECOCHK_PPGTT_WT_HSW (0x2<<3) | 220 | #define ECOCHK_PPGTT_WT_HSW (0x2<<3) |
221 | #define ECOCHK_PPGTT_WB_HSW (0x3<<3) | 221 | #define ECOCHK_PPGTT_WB_HSW (0x3<<3) |
222 | 222 | ||
223 | #define GEN8_CONFIG0 _MMIO(0xD00) | ||
224 | #define GEN9_DEFAULT_FIXES (1 << 3 | 1 << 2 | 1 << 1) | ||
225 | |||
223 | #define GAC_ECO_BITS _MMIO(0x14090) | 226 | #define GAC_ECO_BITS _MMIO(0x14090) |
224 | #define ECOBITS_SNB_BIT (1<<13) | 227 | #define ECOBITS_SNB_BIT (1<<13) |
225 | #define ECOBITS_PPGTT_CACHE64B (3<<8) | 228 | #define ECOBITS_PPGTT_CACHE64B (3<<8) |
@@ -1669,6 +1672,9 @@ enum skl_disp_power_wells { | |||
1669 | 1672 | ||
1670 | #define GEN7_TLB_RD_ADDR _MMIO(0x4700) | 1673 | #define GEN7_TLB_RD_ADDR _MMIO(0x4700) |
1671 | 1674 | ||
1675 | #define GAMT_CHKN_BIT_REG _MMIO(0x4ab8) | ||
1676 | #define GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING (1<<28) | ||
1677 | |||
1672 | #if 0 | 1678 | #if 0 |
1673 | #define PRB0_TAIL _MMIO(0x2030) | 1679 | #define PRB0_TAIL _MMIO(0x2030) |
1674 | #define PRB0_HEAD _MMIO(0x2034) | 1680 | #define PRB0_HEAD _MMIO(0x2034) |
@@ -1804,6 +1810,10 @@ enum skl_disp_power_wells { | |||
1804 | #define GEN9_IZ_HASHING_MASK(slice) (0x3 << ((slice) * 2)) | 1810 | #define GEN9_IZ_HASHING_MASK(slice) (0x3 << ((slice) * 2)) |
1805 | #define GEN9_IZ_HASHING(slice, val) ((val) << ((slice) * 2)) | 1811 | #define GEN9_IZ_HASHING(slice, val) ((val) << ((slice) * 2)) |
1806 | 1812 | ||
1813 | /* chicken reg for WaConextSwitchWithConcurrentTLBInvalidate */ | ||
1814 | #define GEN9_CSFE_CHICKEN1_RCS _MMIO(0x20D4) | ||
1815 | #define GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE (1 << 2) | ||
1816 | |||
1807 | /* WaClearTdlStateAckDirtyBits */ | 1817 | /* WaClearTdlStateAckDirtyBits */ |
1808 | #define GEN8_STATE_ACK _MMIO(0x20F0) | 1818 | #define GEN8_STATE_ACK _MMIO(0x20F0) |
1809 | #define GEN9_STATE_ACK_SLICE1 _MMIO(0x20F8) | 1819 | #define GEN9_STATE_ACK_SLICE1 _MMIO(0x20F8) |
@@ -2200,6 +2210,8 @@ enum skl_disp_power_wells { | |||
2200 | #define ILK_DPFC_STATUS _MMIO(0x43210) | 2210 | #define ILK_DPFC_STATUS _MMIO(0x43210) |
2201 | #define ILK_DPFC_FENCE_YOFF _MMIO(0x43218) | 2211 | #define ILK_DPFC_FENCE_YOFF _MMIO(0x43218) |
2202 | #define ILK_DPFC_CHICKEN _MMIO(0x43224) | 2212 | #define ILK_DPFC_CHICKEN _MMIO(0x43224) |
2213 | #define ILK_DPFC_DISABLE_DUMMY0 (1<<8) | ||
2214 | #define ILK_DPFC_NUKE_ON_ANY_MODIFICATION (1<<23) | ||
2203 | #define ILK_FBC_RT_BASE _MMIO(0x2128) | 2215 | #define ILK_FBC_RT_BASE _MMIO(0x2128) |
2204 | #define ILK_FBC_RT_VALID (1<<0) | 2216 | #define ILK_FBC_RT_VALID (1<<0) |
2205 | #define SNB_FBC_FRONT_BUFFER (1<<1) | 2217 | #define SNB_FBC_FRONT_BUFFER (1<<1) |
@@ -6031,6 +6043,7 @@ enum skl_disp_power_wells { | |||
6031 | #define CHICKEN_PAR1_1 _MMIO(0x42080) | 6043 | #define CHICKEN_PAR1_1 _MMIO(0x42080) |
6032 | #define DPA_MASK_VBLANK_SRD (1 << 15) | 6044 | #define DPA_MASK_VBLANK_SRD (1 << 15) |
6033 | #define FORCE_ARB_IDLE_PLANES (1 << 14) | 6045 | #define FORCE_ARB_IDLE_PLANES (1 << 14) |
6046 | #define SKL_EDP_PSR_FIX_RDWRAP (1 << 3) | ||
6034 | 6047 | ||
6035 | #define _CHICKEN_PIPESL_1_A 0x420b0 | 6048 | #define _CHICKEN_PIPESL_1_A 0x420b0 |
6036 | #define _CHICKEN_PIPESL_1_B 0x420b4 | 6049 | #define _CHICKEN_PIPESL_1_B 0x420b4 |
@@ -6039,6 +6052,7 @@ enum skl_disp_power_wells { | |||
6039 | #define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B) | 6052 | #define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B) |
6040 | 6053 | ||
6041 | #define DISP_ARB_CTL _MMIO(0x45000) | 6054 | #define DISP_ARB_CTL _MMIO(0x45000) |
6055 | #define DISP_FBC_MEMORY_WAKE (1<<31) | ||
6042 | #define DISP_TILE_SURFACE_SWIZZLING (1<<13) | 6056 | #define DISP_TILE_SURFACE_SWIZZLING (1<<13) |
6043 | #define DISP_FBC_WM_DIS (1<<15) | 6057 | #define DISP_FBC_WM_DIS (1<<15) |
6044 | #define DISP_ARB_CTL2 _MMIO(0x45004) | 6058 | #define DISP_ARB_CTL2 _MMIO(0x45004) |
@@ -6052,6 +6066,9 @@ enum skl_disp_power_wells { | |||
6052 | #define HSW_NDE_RSTWRN_OPT _MMIO(0x46408) | 6066 | #define HSW_NDE_RSTWRN_OPT _MMIO(0x46408) |
6053 | #define RESET_PCH_HANDSHAKE_ENABLE (1<<4) | 6067 | #define RESET_PCH_HANDSHAKE_ENABLE (1<<4) |
6054 | 6068 | ||
6069 | #define GEN8_CHICKEN_DCPR_1 _MMIO(0x46430) | ||
6070 | #define MASK_WAKEMEM (1<<13) | ||
6071 | |||
6055 | #define SKL_DFSM _MMIO(0x51000) | 6072 | #define SKL_DFSM _MMIO(0x51000) |
6056 | #define SKL_DFSM_CDCLK_LIMIT_MASK (3 << 23) | 6073 | #define SKL_DFSM_CDCLK_LIMIT_MASK (3 << 23) |
6057 | #define SKL_DFSM_CDCLK_LIMIT_675 (0 << 23) | 6074 | #define SKL_DFSM_CDCLK_LIMIT_675 (0 << 23) |
@@ -6069,6 +6086,7 @@ enum skl_disp_power_wells { | |||
6069 | #define GEN9_TSG_BARRIER_ACK_DISABLE (1<<8) | 6086 | #define GEN9_TSG_BARRIER_ACK_DISABLE (1<<8) |
6070 | 6087 | ||
6071 | #define GEN9_CS_DEBUG_MODE1 _MMIO(0x20ec) | 6088 | #define GEN9_CS_DEBUG_MODE1 _MMIO(0x20ec) |
6089 | #define GEN9_CTX_PREEMPT_REG _MMIO(0x2248) | ||
6072 | #define GEN8_CS_CHICKEN1 _MMIO(0x2580) | 6090 | #define GEN8_CS_CHICKEN1 _MMIO(0x2580) |
6073 | 6091 | ||
6074 | /* GEN7 chicken */ | 6092 | /* GEN7 chicken */ |
@@ -6076,6 +6094,7 @@ enum skl_disp_power_wells { | |||
6076 | # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26)) | 6094 | # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26)) |
6077 | # define GEN9_RHWO_OPTIMIZATION_DISABLE (1<<14) | 6095 | # define GEN9_RHWO_OPTIMIZATION_DISABLE (1<<14) |
6078 | #define COMMON_SLICE_CHICKEN2 _MMIO(0x7014) | 6096 | #define COMMON_SLICE_CHICKEN2 _MMIO(0x7014) |
6097 | # define GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION (1<<8) | ||
6079 | # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE (1<<0) | 6098 | # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE (1<<0) |
6080 | 6099 | ||
6081 | #define HIZ_CHICKEN _MMIO(0x7018) | 6100 | #define HIZ_CHICKEN _MMIO(0x7018) |
@@ -6921,6 +6940,7 @@ enum skl_disp_power_wells { | |||
6921 | #define EDRAM_SETS_IDX(cap) (((cap) >> 8) & 0x3) | 6940 | #define EDRAM_SETS_IDX(cap) (((cap) >> 8) & 0x3) |
6922 | 6941 | ||
6923 | #define GEN6_UCGCTL1 _MMIO(0x9400) | 6942 | #define GEN6_UCGCTL1 _MMIO(0x9400) |
6943 | # define GEN6_GAMUNIT_CLOCK_GATE_DISABLE (1 << 22) | ||
6924 | # define GEN6_EU_TCUNIT_CLOCK_GATE_DISABLE (1 << 16) | 6944 | # define GEN6_EU_TCUNIT_CLOCK_GATE_DISABLE (1 << 16) |
6925 | # define GEN6_BLBUNIT_CLOCK_GATE_DISABLE (1 << 5) | 6945 | # define GEN6_BLBUNIT_CLOCK_GATE_DISABLE (1 << 5) |
6926 | # define GEN6_CSUNIT_CLOCK_GATE_DISABLE (1 << 7) | 6946 | # define GEN6_CSUNIT_CLOCK_GATE_DISABLE (1 << 7) |
@@ -6937,6 +6957,7 @@ enum skl_disp_power_wells { | |||
6937 | 6957 | ||
6938 | #define GEN7_UCGCTL4 _MMIO(0x940c) | 6958 | #define GEN7_UCGCTL4 _MMIO(0x940c) |
6939 | #define GEN7_L3BANK2X_CLOCK_GATE_DISABLE (1<<25) | 6959 | #define GEN7_L3BANK2X_CLOCK_GATE_DISABLE (1<<25) |
6960 | #define GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE (1<<14) | ||
6940 | 6961 | ||
6941 | #define GEN6_RCGCTL1 _MMIO(0x9410) | 6962 | #define GEN6_RCGCTL1 _MMIO(0x9410) |
6942 | #define GEN6_RCGCTL2 _MMIO(0x9414) | 6963 | #define GEN6_RCGCTL2 _MMIO(0x9414) |
diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index a34c23eceba0..2b3b428d9cd2 100644 --- a/drivers/gpu/drm/i915/intel_csr.c +++ b/drivers/gpu/drm/i915/intel_csr.c | |||
@@ -41,16 +41,22 @@ | |||
41 | * be moved to FW_FAILED. | 41 | * be moved to FW_FAILED. |
42 | */ | 42 | */ |
43 | 43 | ||
44 | #define I915_CSR_KBL "i915/kbl_dmc_ver1.bin" | ||
45 | MODULE_FIRMWARE(I915_CSR_KBL); | ||
46 | #define KBL_CSR_VERSION_REQUIRED CSR_VERSION(1, 1) | ||
47 | |||
44 | #define I915_CSR_SKL "i915/skl_dmc_ver1.bin" | 48 | #define I915_CSR_SKL "i915/skl_dmc_ver1.bin" |
49 | MODULE_FIRMWARE(I915_CSR_SKL); | ||
50 | #define SKL_CSR_VERSION_REQUIRED CSR_VERSION(1, 23) | ||
51 | |||
45 | #define I915_CSR_BXT "i915/bxt_dmc_ver1.bin" | 52 | #define I915_CSR_BXT "i915/bxt_dmc_ver1.bin" |
53 | MODULE_FIRMWARE(I915_CSR_BXT); | ||
54 | #define BXT_CSR_VERSION_REQUIRED CSR_VERSION(1, 7) | ||
46 | 55 | ||
47 | #define FIRMWARE_URL "https://01.org/linuxgraphics/intel-linux-graphics-firmwares" | 56 | #define FIRMWARE_URL "https://01.org/linuxgraphics/intel-linux-graphics-firmwares" |
48 | 57 | ||
49 | MODULE_FIRMWARE(I915_CSR_SKL); | ||
50 | MODULE_FIRMWARE(I915_CSR_BXT); | ||
51 | 58 | ||
52 | #define SKL_CSR_VERSION_REQUIRED CSR_VERSION(1, 23) | 59 | |
53 | #define BXT_CSR_VERSION_REQUIRED CSR_VERSION(1, 7) | ||
54 | 60 | ||
55 | #define CSR_MAX_FW_SIZE 0x2FFF | 61 | #define CSR_MAX_FW_SIZE 0x2FFF |
56 | #define CSR_DEFAULT_FW_OFFSET 0xFFFFFFFF | 62 | #define CSR_DEFAULT_FW_OFFSET 0xFFFFFFFF |
@@ -169,12 +175,10 @@ struct stepping_info { | |||
169 | char substepping; | 175 | char substepping; |
170 | }; | 176 | }; |
171 | 177 | ||
172 | /* | ||
173 | * Kabylake derivated from Skylake H0, so SKL H0 | ||
174 | * is the right firmware for KBL A0 (revid 0). | ||
175 | */ | ||
176 | static const struct stepping_info kbl_stepping_info[] = { | 178 | static const struct stepping_info kbl_stepping_info[] = { |
177 | {'H', '0'}, {'I', '0'} | 179 | {'A', '0'}, {'B', '0'}, {'C', '0'}, |
180 | {'D', '0'}, {'E', '0'}, {'F', '0'}, | ||
181 | {'G', '0'}, {'H', '0'}, {'I', '0'}, | ||
178 | }; | 182 | }; |
179 | 183 | ||
180 | static const struct stepping_info skl_stepping_info[] = { | 184 | static const struct stepping_info skl_stepping_info[] = { |
@@ -298,7 +302,9 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv, | |||
298 | 302 | ||
299 | csr->version = css_header->version; | 303 | csr->version = css_header->version; |
300 | 304 | ||
301 | if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) { | 305 | if (IS_KABYLAKE(dev_priv)) { |
306 | required_min_version = KBL_CSR_VERSION_REQUIRED; | ||
307 | } else if (IS_SKYLAKE(dev_priv)) { | ||
302 | required_min_version = SKL_CSR_VERSION_REQUIRED; | 308 | required_min_version = SKL_CSR_VERSION_REQUIRED; |
303 | } else if (IS_BROXTON(dev_priv)) { | 309 | } else if (IS_BROXTON(dev_priv)) { |
304 | required_min_version = BXT_CSR_VERSION_REQUIRED; | 310 | required_min_version = BXT_CSR_VERSION_REQUIRED; |
@@ -446,7 +452,9 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv) | |||
446 | if (!HAS_CSR(dev_priv)) | 452 | if (!HAS_CSR(dev_priv)) |
447 | return; | 453 | return; |
448 | 454 | ||
449 | if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) | 455 | if (IS_KABYLAKE(dev_priv)) |
456 | csr->fw_path = I915_CSR_KBL; | ||
457 | else if (IS_SKYLAKE(dev_priv)) | ||
450 | csr->fw_path = I915_CSR_SKL; | 458 | csr->fw_path = I915_CSR_SKL; |
451 | else if (IS_BROXTON(dev_priv)) | 459 | else if (IS_BROXTON(dev_priv)) |
452 | csr->fw_path = I915_CSR_BXT; | 460 | csr->fw_path = I915_CSR_BXT; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 04452cf3eae8..3074c56a643d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -11997,6 +11997,12 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc, | |||
11997 | ret = intel_color_check(crtc, crtc_state); | 11997 | ret = intel_color_check(crtc, crtc_state); |
11998 | if (ret) | 11998 | if (ret) |
11999 | return ret; | 11999 | return ret; |
12000 | |||
12001 | /* | ||
12002 | * Changing color management on Intel hardware is | ||
12003 | * handled as part of planes update. | ||
12004 | */ | ||
12005 | crtc_state->planes_changed = true; | ||
12000 | } | 12006 | } |
12001 | 12007 | ||
12002 | ret = 0; | 12008 | ret = 0; |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 40745e38d438..891107f92d9f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -4645,7 +4645,7 @@ intel_dp_detect(struct drm_connector *connector, bool force) | |||
4645 | 4645 | ||
4646 | intel_dp->detect_done = false; | 4646 | intel_dp->detect_done = false; |
4647 | 4647 | ||
4648 | if (intel_connector->detect_edid) | 4648 | if (is_edp(intel_dp) || intel_connector->detect_edid) |
4649 | return connector_status_connected; | 4649 | return connector_status_connected; |
4650 | else | 4650 | else |
4651 | return connector_status_disconnected; | 4651 | return connector_status_disconnected; |
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 42eac37de047..7f2d8415ed8b 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -1103,15 +1103,17 @@ static inline int gen8_emit_flush_coherentl3_wa(struct intel_engine_cs *engine, | |||
1103 | uint32_t *const batch, | 1103 | uint32_t *const batch, |
1104 | uint32_t index) | 1104 | uint32_t index) |
1105 | { | 1105 | { |
1106 | struct drm_i915_private *dev_priv = engine->dev->dev_private; | ||
1106 | uint32_t l3sqc4_flush = (0x40400000 | GEN8_LQSC_FLUSH_COHERENT_LINES); | 1107 | uint32_t l3sqc4_flush = (0x40400000 | GEN8_LQSC_FLUSH_COHERENT_LINES); |
1107 | 1108 | ||
1108 | /* | 1109 | /* |
1109 | * WaDisableLSQCROPERFforOCL:skl | 1110 | * WaDisableLSQCROPERFforOCL:skl,kbl |
1110 | * This WA is implemented in skl_init_clock_gating() but since | 1111 | * This WA is implemented in skl_init_clock_gating() but since |
1111 | * this batch updates GEN8_L3SQCREG4 with default value we need to | 1112 | * this batch updates GEN8_L3SQCREG4 with default value we need to |
1112 | * set this bit here to retain the WA during flush. | 1113 | * set this bit here to retain the WA during flush. |
1113 | */ | 1114 | */ |
1114 | if (IS_SKL_REVID(engine->dev, 0, SKL_REVID_E0)) | 1115 | if (IS_SKL_REVID(dev_priv, 0, SKL_REVID_E0) || |
1116 | IS_KBL_REVID(dev_priv, 0, KBL_REVID_E0)) | ||
1115 | l3sqc4_flush |= GEN8_LQSC_RO_PERF_DIS; | 1117 | l3sqc4_flush |= GEN8_LQSC_RO_PERF_DIS; |
1116 | 1118 | ||
1117 | wa_ctx_emit(batch, index, (MI_STORE_REGISTER_MEM_GEN8 | | 1119 | wa_ctx_emit(batch, index, (MI_STORE_REGISTER_MEM_GEN8 | |
@@ -1273,6 +1275,7 @@ static int gen9_init_indirectctx_bb(struct intel_engine_cs *engine, | |||
1273 | { | 1275 | { |
1274 | int ret; | 1276 | int ret; |
1275 | struct drm_device *dev = engine->dev; | 1277 | struct drm_device *dev = engine->dev; |
1278 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1276 | uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS); | 1279 | uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS); |
1277 | 1280 | ||
1278 | /* WaDisableCtxRestoreArbitration:skl,bxt */ | 1281 | /* WaDisableCtxRestoreArbitration:skl,bxt */ |
@@ -1286,6 +1289,22 @@ static int gen9_init_indirectctx_bb(struct intel_engine_cs *engine, | |||
1286 | return ret; | 1289 | return ret; |
1287 | index = ret; | 1290 | index = ret; |
1288 | 1291 | ||
1292 | /* WaClearSlmSpaceAtContextSwitch:kbl */ | ||
1293 | /* Actual scratch location is at 128 bytes offset */ | ||
1294 | if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_A0)) { | ||
1295 | uint32_t scratch_addr | ||
1296 | = engine->scratch.gtt_offset + 2*CACHELINE_BYTES; | ||
1297 | |||
1298 | wa_ctx_emit(batch, index, GFX_OP_PIPE_CONTROL(6)); | ||
1299 | wa_ctx_emit(batch, index, (PIPE_CONTROL_FLUSH_L3 | | ||
1300 | PIPE_CONTROL_GLOBAL_GTT_IVB | | ||
1301 | PIPE_CONTROL_CS_STALL | | ||
1302 | PIPE_CONTROL_QW_WRITE)); | ||
1303 | wa_ctx_emit(batch, index, scratch_addr); | ||
1304 | wa_ctx_emit(batch, index, 0); | ||
1305 | wa_ctx_emit(batch, index, 0); | ||
1306 | wa_ctx_emit(batch, index, 0); | ||
1307 | } | ||
1289 | /* Pad to end of cacheline */ | 1308 | /* Pad to end of cacheline */ |
1290 | while (index % CACHELINE_DWORDS) | 1309 | while (index % CACHELINE_DWORDS) |
1291 | wa_ctx_emit(batch, index, MI_NOOP); | 1310 | wa_ctx_emit(batch, index, MI_NOOP); |
@@ -1687,9 +1706,10 @@ static int gen8_emit_flush_render(struct drm_i915_gem_request *request, | |||
1687 | struct intel_ringbuffer *ringbuf = request->ringbuf; | 1706 | struct intel_ringbuffer *ringbuf = request->ringbuf; |
1688 | struct intel_engine_cs *engine = ringbuf->engine; | 1707 | struct intel_engine_cs *engine = ringbuf->engine; |
1689 | u32 scratch_addr = engine->scratch.gtt_offset + 2 * CACHELINE_BYTES; | 1708 | u32 scratch_addr = engine->scratch.gtt_offset + 2 * CACHELINE_BYTES; |
1690 | bool vf_flush_wa = false; | 1709 | bool vf_flush_wa = false, dc_flush_wa = false; |
1691 | u32 flags = 0; | 1710 | u32 flags = 0; |
1692 | int ret; | 1711 | int ret; |
1712 | int len; | ||
1693 | 1713 | ||
1694 | flags |= PIPE_CONTROL_CS_STALL; | 1714 | flags |= PIPE_CONTROL_CS_STALL; |
1695 | 1715 | ||
@@ -1716,9 +1736,21 @@ static int gen8_emit_flush_render(struct drm_i915_gem_request *request, | |||
1716 | */ | 1736 | */ |
1717 | if (IS_GEN9(engine->dev)) | 1737 | if (IS_GEN9(engine->dev)) |
1718 | vf_flush_wa = true; | 1738 | vf_flush_wa = true; |
1739 | |||
1740 | /* WaForGAMHang:kbl */ | ||
1741 | if (IS_KBL_REVID(request->i915, 0, KBL_REVID_B0)) | ||
1742 | dc_flush_wa = true; | ||
1719 | } | 1743 | } |
1720 | 1744 | ||
1721 | ret = intel_ring_begin(request, vf_flush_wa ? 12 : 6); | 1745 | len = 6; |
1746 | |||
1747 | if (vf_flush_wa) | ||
1748 | len += 6; | ||
1749 | |||
1750 | if (dc_flush_wa) | ||
1751 | len += 12; | ||
1752 | |||
1753 | ret = intel_ring_begin(request, len); | ||
1722 | if (ret) | 1754 | if (ret) |
1723 | return ret; | 1755 | return ret; |
1724 | 1756 | ||
@@ -1731,12 +1763,31 @@ static int gen8_emit_flush_render(struct drm_i915_gem_request *request, | |||
1731 | intel_logical_ring_emit(ringbuf, 0); | 1763 | intel_logical_ring_emit(ringbuf, 0); |
1732 | } | 1764 | } |
1733 | 1765 | ||
1766 | if (dc_flush_wa) { | ||
1767 | intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6)); | ||
1768 | intel_logical_ring_emit(ringbuf, PIPE_CONTROL_DC_FLUSH_ENABLE); | ||
1769 | intel_logical_ring_emit(ringbuf, 0); | ||
1770 | intel_logical_ring_emit(ringbuf, 0); | ||
1771 | intel_logical_ring_emit(ringbuf, 0); | ||
1772 | intel_logical_ring_emit(ringbuf, 0); | ||
1773 | } | ||
1774 | |||
1734 | intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6)); | 1775 | intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6)); |
1735 | intel_logical_ring_emit(ringbuf, flags); | 1776 | intel_logical_ring_emit(ringbuf, flags); |
1736 | intel_logical_ring_emit(ringbuf, scratch_addr); | 1777 | intel_logical_ring_emit(ringbuf, scratch_addr); |
1737 | intel_logical_ring_emit(ringbuf, 0); | 1778 | intel_logical_ring_emit(ringbuf, 0); |
1738 | intel_logical_ring_emit(ringbuf, 0); | 1779 | intel_logical_ring_emit(ringbuf, 0); |
1739 | intel_logical_ring_emit(ringbuf, 0); | 1780 | intel_logical_ring_emit(ringbuf, 0); |
1781 | |||
1782 | if (dc_flush_wa) { | ||
1783 | intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6)); | ||
1784 | intel_logical_ring_emit(ringbuf, PIPE_CONTROL_CS_STALL); | ||
1785 | intel_logical_ring_emit(ringbuf, 0); | ||
1786 | intel_logical_ring_emit(ringbuf, 0); | ||
1787 | intel_logical_ring_emit(ringbuf, 0); | ||
1788 | intel_logical_ring_emit(ringbuf, 0); | ||
1789 | } | ||
1790 | |||
1740 | intel_logical_ring_advance(ringbuf); | 1791 | intel_logical_ring_advance(ringbuf); |
1741 | 1792 | ||
1742 | return 0; | 1793 | return 0; |
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index 99e26034ae8d..16e209d326b6 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c | |||
@@ -1038,5 +1038,16 @@ intel_opregion_get_panel_type(struct drm_device *dev) | |||
1038 | return -ENODEV; | 1038 | return -ENODEV; |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | /* | ||
1042 | * FIXME On Dell XPS 13 9350 the OpRegion panel type (0) gives us | ||
1043 | * low vswing for eDP, whereas the VBT panel type (2) gives us normal | ||
1044 | * vswing instead. Low vswing results in some display flickers, so | ||
1045 | * let's simply ignore the OpRegion panel type on SKL for now. | ||
1046 | */ | ||
1047 | if (IS_SKYLAKE(dev)) { | ||
1048 | DRM_DEBUG_KMS("Ignoring OpRegion panel type (%d)\n", ret - 1); | ||
1049 | return -ENODEV; | ||
1050 | } | ||
1051 | |||
1041 | return ret - 1; | 1052 | return ret - 1; |
1042 | } | 1053 | } |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 8357d571553a..aba94099886b 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -1731,7 +1731,8 @@ intel_panel_init_backlight_funcs(struct intel_panel *panel) | |||
1731 | panel->backlight.set = bxt_set_backlight; | 1731 | panel->backlight.set = bxt_set_backlight; |
1732 | panel->backlight.get = bxt_get_backlight; | 1732 | panel->backlight.get = bxt_get_backlight; |
1733 | panel->backlight.hz_to_pwm = bxt_hz_to_pwm; | 1733 | panel->backlight.hz_to_pwm = bxt_hz_to_pwm; |
1734 | } else if (HAS_PCH_LPT(dev_priv) || HAS_PCH_SPT(dev_priv)) { | 1734 | } else if (HAS_PCH_LPT(dev_priv) || HAS_PCH_SPT(dev_priv) || |
1735 | HAS_PCH_KBP(dev_priv)) { | ||
1735 | panel->backlight.setup = lpt_setup_backlight; | 1736 | panel->backlight.setup = lpt_setup_backlight; |
1736 | panel->backlight.enable = lpt_enable_backlight; | 1737 | panel->backlight.enable = lpt_enable_backlight; |
1737 | panel->backlight.disable = lpt_disable_backlight; | 1738 | panel->backlight.disable = lpt_disable_backlight; |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index a7ef45da0a9e..2863b92c9da6 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -54,10 +54,38 @@ | |||
54 | #define INTEL_RC6p_ENABLE (1<<1) | 54 | #define INTEL_RC6p_ENABLE (1<<1) |
55 | #define INTEL_RC6pp_ENABLE (1<<2) | 55 | #define INTEL_RC6pp_ENABLE (1<<2) |
56 | 56 | ||
57 | static void gen9_init_clock_gating(struct drm_device *dev) | ||
58 | { | ||
59 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
60 | |||
61 | /* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl */ | ||
62 | I915_WRITE(CHICKEN_PAR1_1, | ||
63 | I915_READ(CHICKEN_PAR1_1) | SKL_EDP_PSR_FIX_RDWRAP); | ||
64 | |||
65 | I915_WRITE(GEN8_CONFIG0, | ||
66 | I915_READ(GEN8_CONFIG0) | GEN9_DEFAULT_FIXES); | ||
67 | |||
68 | /* WaEnableChickenDCPR:skl,bxt,kbl */ | ||
69 | I915_WRITE(GEN8_CHICKEN_DCPR_1, | ||
70 | I915_READ(GEN8_CHICKEN_DCPR_1) | MASK_WAKEMEM); | ||
71 | |||
72 | /* WaFbcTurnOffFbcWatermark:skl,bxt,kbl */ | ||
73 | /* WaFbcWakeMemOn:skl,bxt,kbl */ | ||
74 | I915_WRITE(DISP_ARB_CTL, I915_READ(DISP_ARB_CTL) | | ||
75 | DISP_FBC_WM_DIS | | ||
76 | DISP_FBC_MEMORY_WAKE); | ||
77 | |||
78 | /* WaFbcHighMemBwCorruptionAvoidance:skl,bxt,kbl */ | ||
79 | I915_WRITE(ILK_DPFC_CHICKEN, I915_READ(ILK_DPFC_CHICKEN) | | ||
80 | ILK_DPFC_DISABLE_DUMMY0); | ||
81 | } | ||
82 | |||
57 | static void bxt_init_clock_gating(struct drm_device *dev) | 83 | static void bxt_init_clock_gating(struct drm_device *dev) |
58 | { | 84 | { |
59 | struct drm_i915_private *dev_priv = dev->dev_private; | 85 | struct drm_i915_private *dev_priv = dev->dev_private; |
60 | 86 | ||
87 | gen9_init_clock_gating(dev); | ||
88 | |||
61 | /* WaDisableSDEUnitClockGating:bxt */ | 89 | /* WaDisableSDEUnitClockGating:bxt */ |
62 | I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) | | 90 | I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) | |
63 | GEN8_SDEUNIT_CLOCK_GATE_DISABLE); | 91 | GEN8_SDEUNIT_CLOCK_GATE_DISABLE); |
@@ -6698,6 +6726,38 @@ static void lpt_suspend_hw(struct drm_device *dev) | |||
6698 | } | 6726 | } |
6699 | } | 6727 | } |
6700 | 6728 | ||
6729 | static void kabylake_init_clock_gating(struct drm_device *dev) | ||
6730 | { | ||
6731 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
6732 | |||
6733 | gen9_init_clock_gating(dev); | ||
6734 | |||
6735 | /* WaDisableSDEUnitClockGating:kbl */ | ||
6736 | if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_B0)) | ||
6737 | I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) | | ||
6738 | GEN8_SDEUNIT_CLOCK_GATE_DISABLE); | ||
6739 | |||
6740 | /* WaDisableGamClockGating:kbl */ | ||
6741 | if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_B0)) | ||
6742 | I915_WRITE(GEN6_UCGCTL1, I915_READ(GEN6_UCGCTL1) | | ||
6743 | GEN6_GAMUNIT_CLOCK_GATE_DISABLE); | ||
6744 | |||
6745 | /* WaFbcNukeOnHostModify:kbl */ | ||
6746 | I915_WRITE(ILK_DPFC_CHICKEN, I915_READ(ILK_DPFC_CHICKEN) | | ||
6747 | ILK_DPFC_NUKE_ON_ANY_MODIFICATION); | ||
6748 | } | ||
6749 | |||
6750 | static void skylake_init_clock_gating(struct drm_device *dev) | ||
6751 | { | ||
6752 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
6753 | |||
6754 | gen9_init_clock_gating(dev); | ||
6755 | |||
6756 | /* WaFbcNukeOnHostModify:skl */ | ||
6757 | I915_WRITE(ILK_DPFC_CHICKEN, I915_READ(ILK_DPFC_CHICKEN) | | ||
6758 | ILK_DPFC_NUKE_ON_ANY_MODIFICATION); | ||
6759 | } | ||
6760 | |||
6701 | static void broadwell_init_clock_gating(struct drm_device *dev) | 6761 | static void broadwell_init_clock_gating(struct drm_device *dev) |
6702 | { | 6762 | { |
6703 | struct drm_i915_private *dev_priv = dev->dev_private; | 6763 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -7163,9 +7223,9 @@ static void nop_init_clock_gating(struct drm_device *dev) | |||
7163 | void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv) | 7223 | void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv) |
7164 | { | 7224 | { |
7165 | if (IS_SKYLAKE(dev_priv)) | 7225 | if (IS_SKYLAKE(dev_priv)) |
7166 | dev_priv->display.init_clock_gating = nop_init_clock_gating; | 7226 | dev_priv->display.init_clock_gating = skylake_init_clock_gating; |
7167 | else if (IS_KABYLAKE(dev_priv)) | 7227 | else if (IS_KABYLAKE(dev_priv)) |
7168 | dev_priv->display.init_clock_gating = nop_init_clock_gating; | 7228 | dev_priv->display.init_clock_gating = kabylake_init_clock_gating; |
7169 | else if (IS_BROXTON(dev_priv)) | 7229 | else if (IS_BROXTON(dev_priv)) |
7170 | dev_priv->display.init_clock_gating = bxt_init_clock_gating; | 7230 | dev_priv->display.init_clock_gating = bxt_init_clock_gating; |
7171 | else if (IS_BROADWELL(dev_priv)) | 7231 | else if (IS_BROADWELL(dev_priv)) |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 04402bb9d26b..68c5af079ef8 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -913,24 +913,26 @@ static int gen9_init_workarounds(struct intel_engine_cs *engine) | |||
913 | { | 913 | { |
914 | struct drm_device *dev = engine->dev; | 914 | struct drm_device *dev = engine->dev; |
915 | struct drm_i915_private *dev_priv = dev->dev_private; | 915 | struct drm_i915_private *dev_priv = dev->dev_private; |
916 | uint32_t tmp; | ||
917 | int ret; | 916 | int ret; |
918 | 917 | ||
919 | /* WaEnableLbsSlaRetryTimerDecrement:skl */ | 918 | /* WaConextSwitchWithConcurrentTLBInvalidate:skl,bxt,kbl */ |
919 | I915_WRITE(GEN9_CSFE_CHICKEN1_RCS, _MASKED_BIT_ENABLE(GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE)); | ||
920 | |||
921 | /* WaEnableLbsSlaRetryTimerDecrement:skl,bxt,kbl */ | ||
920 | I915_WRITE(BDW_SCRATCH1, I915_READ(BDW_SCRATCH1) | | 922 | I915_WRITE(BDW_SCRATCH1, I915_READ(BDW_SCRATCH1) | |
921 | GEN9_LBS_SLA_RETRY_TIMER_DECREMENT_ENABLE); | 923 | GEN9_LBS_SLA_RETRY_TIMER_DECREMENT_ENABLE); |
922 | 924 | ||
923 | /* WaDisableKillLogic:bxt,skl */ | 925 | /* WaDisableKillLogic:bxt,skl,kbl */ |
924 | I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | | 926 | I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | |
925 | ECOCHK_DIS_TLB); | 927 | ECOCHK_DIS_TLB); |
926 | 928 | ||
927 | /* WaClearFlowControlGpgpuContextSave:skl,bxt */ | 929 | /* WaClearFlowControlGpgpuContextSave:skl,bxt,kbl */ |
928 | /* WaDisablePartialInstShootdown:skl,bxt */ | 930 | /* WaDisablePartialInstShootdown:skl,bxt,kbl */ |
929 | WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, | 931 | WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, |
930 | FLOW_CONTROL_ENABLE | | 932 | FLOW_CONTROL_ENABLE | |
931 | PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE); | 933 | PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE); |
932 | 934 | ||
933 | /* Syncing dependencies between camera and graphics:skl,bxt */ | 935 | /* Syncing dependencies between camera and graphics:skl,bxt,kbl */ |
934 | WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3, | 936 | WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3, |
935 | GEN9_DISABLE_OCL_OOB_SUPPRESS_LOGIC); | 937 | GEN9_DISABLE_OCL_OOB_SUPPRESS_LOGIC); |
936 | 938 | ||
@@ -952,18 +954,18 @@ static int gen9_init_workarounds(struct intel_engine_cs *engine) | |||
952 | */ | 954 | */ |
953 | } | 955 | } |
954 | 956 | ||
955 | /* WaEnableYV12BugFixInHalfSliceChicken7:skl,bxt */ | 957 | /* WaEnableYV12BugFixInHalfSliceChicken7:skl,bxt,kbl */ |
956 | /* WaEnableSamplerGPGPUPreemptionSupport:skl,bxt */ | 958 | /* WaEnableSamplerGPGPUPreemptionSupport:skl,bxt,kbl */ |
957 | WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7, | 959 | WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7, |
958 | GEN9_ENABLE_YV12_BUGFIX | | 960 | GEN9_ENABLE_YV12_BUGFIX | |
959 | GEN9_ENABLE_GPGPU_PREEMPTION); | 961 | GEN9_ENABLE_GPGPU_PREEMPTION); |
960 | 962 | ||
961 | /* Wa4x4STCOptimizationDisable:skl,bxt */ | 963 | /* Wa4x4STCOptimizationDisable:skl,bxt,kbl */ |
962 | /* WaDisablePartialResolveInVc:skl,bxt */ | 964 | /* WaDisablePartialResolveInVc:skl,bxt,kbl */ |
963 | WA_SET_BIT_MASKED(CACHE_MODE_1, (GEN8_4x4_STC_OPTIMIZATION_DISABLE | | 965 | WA_SET_BIT_MASKED(CACHE_MODE_1, (GEN8_4x4_STC_OPTIMIZATION_DISABLE | |
964 | GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE)); | 966 | GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE)); |
965 | 967 | ||
966 | /* WaCcsTlbPrefetchDisable:skl,bxt */ | 968 | /* WaCcsTlbPrefetchDisable:skl,bxt,kbl */ |
967 | WA_CLR_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN5, | 969 | WA_CLR_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN5, |
968 | GEN9_CCS_TLB_PREFETCH_ENABLE); | 970 | GEN9_CCS_TLB_PREFETCH_ENABLE); |
969 | 971 | ||
@@ -973,31 +975,57 @@ static int gen9_init_workarounds(struct intel_engine_cs *engine) | |||
973 | WA_SET_BIT_MASKED(SLICE_ECO_CHICKEN0, | 975 | WA_SET_BIT_MASKED(SLICE_ECO_CHICKEN0, |
974 | PIXEL_MASK_CAMMING_DISABLE); | 976 | PIXEL_MASK_CAMMING_DISABLE); |
975 | 977 | ||
976 | /* WaForceContextSaveRestoreNonCoherent:skl,bxt */ | 978 | /* WaForceContextSaveRestoreNonCoherent:skl,bxt,kbl */ |
977 | tmp = HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT; | 979 | WA_SET_BIT_MASKED(HDC_CHICKEN0, |
978 | if (IS_SKL_REVID(dev, SKL_REVID_F0, REVID_FOREVER) || | 980 | HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT | |
979 | IS_BXT_REVID(dev, BXT_REVID_B0, REVID_FOREVER)) | 981 | HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE); |
980 | tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE; | 982 | |
981 | WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp); | 983 | /* WaForceEnableNonCoherent and WaDisableHDCInvalidation are |
984 | * both tied to WaForceContextSaveRestoreNonCoherent | ||
985 | * in some hsds for skl. We keep the tie for all gen9. The | ||
986 | * documentation is a bit hazy and so we want to get common behaviour, | ||
987 | * even though there is no clear evidence we would need both on kbl/bxt. | ||
988 | * This area has been source of system hangs so we play it safe | ||
989 | * and mimic the skl regardless of what bspec says. | ||
990 | * | ||
991 | * Use Force Non-Coherent whenever executing a 3D context. This | ||
992 | * is a workaround for a possible hang in the unlikely event | ||
993 | * a TLB invalidation occurs during a PSD flush. | ||
994 | */ | ||
982 | 995 | ||
983 | /* WaDisableSamplerPowerBypassForSOPingPong:skl,bxt */ | 996 | /* WaForceEnableNonCoherent:skl,bxt,kbl */ |
984 | if (IS_SKYLAKE(dev) || IS_BXT_REVID(dev, 0, BXT_REVID_B0)) | 997 | WA_SET_BIT_MASKED(HDC_CHICKEN0, |
998 | HDC_FORCE_NON_COHERENT); | ||
999 | |||
1000 | /* WaDisableHDCInvalidation:skl,bxt,kbl */ | ||
1001 | I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | | ||
1002 | BDW_DISABLE_HDC_INVALIDATION); | ||
1003 | |||
1004 | /* WaDisableSamplerPowerBypassForSOPingPong:skl,bxt,kbl */ | ||
1005 | if (IS_SKYLAKE(dev_priv) || | ||
1006 | IS_KABYLAKE(dev_priv) || | ||
1007 | IS_BXT_REVID(dev_priv, 0, BXT_REVID_B0)) | ||
985 | WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3, | 1008 | WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3, |
986 | GEN8_SAMPLER_POWER_BYPASS_DIS); | 1009 | GEN8_SAMPLER_POWER_BYPASS_DIS); |
987 | 1010 | ||
988 | /* WaDisableSTUnitPowerOptimization:skl,bxt */ | 1011 | /* WaDisableSTUnitPowerOptimization:skl,bxt,kbl */ |
989 | WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN2, GEN8_ST_PO_DISABLE); | 1012 | WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN2, GEN8_ST_PO_DISABLE); |
990 | 1013 | ||
991 | /* WaOCLCoherentLineFlush:skl,bxt */ | 1014 | /* WaOCLCoherentLineFlush:skl,bxt,kbl */ |
992 | I915_WRITE(GEN8_L3SQCREG4, (I915_READ(GEN8_L3SQCREG4) | | 1015 | I915_WRITE(GEN8_L3SQCREG4, (I915_READ(GEN8_L3SQCREG4) | |
993 | GEN8_LQSC_FLUSH_COHERENT_LINES)); | 1016 | GEN8_LQSC_FLUSH_COHERENT_LINES)); |
994 | 1017 | ||
995 | /* WaEnablePreemptionGranularityControlByUMD:skl,bxt */ | 1018 | /* WaVFEStateAfterPipeControlwithMediaStateClear:skl,bxt */ |
1019 | ret = wa_ring_whitelist_reg(engine, GEN9_CTX_PREEMPT_REG); | ||
1020 | if (ret) | ||
1021 | return ret; | ||
1022 | |||
1023 | /* WaEnablePreemptionGranularityControlByUMD:skl,bxt,kbl */ | ||
996 | ret= wa_ring_whitelist_reg(engine, GEN8_CS_CHICKEN1); | 1024 | ret= wa_ring_whitelist_reg(engine, GEN8_CS_CHICKEN1); |
997 | if (ret) | 1025 | if (ret) |
998 | return ret; | 1026 | return ret; |
999 | 1027 | ||
1000 | /* WaAllowUMDToModifyHDCChicken1:skl,bxt */ | 1028 | /* WaAllowUMDToModifyHDCChicken1:skl,bxt,kbl */ |
1001 | ret = wa_ring_whitelist_reg(engine, GEN8_HDC_CHICKEN1); | 1029 | ret = wa_ring_whitelist_reg(engine, GEN8_HDC_CHICKEN1); |
1002 | if (ret) | 1030 | if (ret) |
1003 | return ret; | 1031 | return ret; |
@@ -1092,22 +1120,6 @@ static int skl_init_workarounds(struct intel_engine_cs *engine) | |||
1092 | WA_SET_BIT_MASKED(HIZ_CHICKEN, | 1120 | WA_SET_BIT_MASKED(HIZ_CHICKEN, |
1093 | BDW_HIZ_POWER_COMPILER_CLOCK_GATING_DISABLE); | 1121 | BDW_HIZ_POWER_COMPILER_CLOCK_GATING_DISABLE); |
1094 | 1122 | ||
1095 | /* This is tied to WaForceContextSaveRestoreNonCoherent */ | ||
1096 | if (IS_SKL_REVID(dev, 0, REVID_FOREVER)) { | ||
1097 | /* | ||
1098 | *Use Force Non-Coherent whenever executing a 3D context. This | ||
1099 | * is a workaround for a possible hang in the unlikely event | ||
1100 | * a TLB invalidation occurs during a PSD flush. | ||
1101 | */ | ||
1102 | /* WaForceEnableNonCoherent:skl */ | ||
1103 | WA_SET_BIT_MASKED(HDC_CHICKEN0, | ||
1104 | HDC_FORCE_NON_COHERENT); | ||
1105 | |||
1106 | /* WaDisableHDCInvalidation:skl */ | ||
1107 | I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | | ||
1108 | BDW_DISABLE_HDC_INVALIDATION); | ||
1109 | } | ||
1110 | |||
1111 | /* WaBarrierPerformanceFixDisable:skl */ | 1123 | /* WaBarrierPerformanceFixDisable:skl */ |
1112 | if (IS_SKL_REVID(dev, SKL_REVID_C0, SKL_REVID_D0)) | 1124 | if (IS_SKL_REVID(dev, SKL_REVID_C0, SKL_REVID_D0)) |
1113 | WA_SET_BIT_MASKED(HDC_CHICKEN0, | 1125 | WA_SET_BIT_MASKED(HDC_CHICKEN0, |
@@ -1120,6 +1132,9 @@ static int skl_init_workarounds(struct intel_engine_cs *engine) | |||
1120 | GEN7_HALF_SLICE_CHICKEN1, | 1132 | GEN7_HALF_SLICE_CHICKEN1, |
1121 | GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE); | 1133 | GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE); |
1122 | 1134 | ||
1135 | /* WaDisableGafsUnitClkGating:skl */ | ||
1136 | WA_SET_BIT(GEN7_UCGCTL4, GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE); | ||
1137 | |||
1123 | /* WaDisableLSQCROPERFforOCL:skl */ | 1138 | /* WaDisableLSQCROPERFforOCL:skl */ |
1124 | ret = wa_ring_whitelist_reg(engine, GEN8_L3SQCREG4); | 1139 | ret = wa_ring_whitelist_reg(engine, GEN8_L3SQCREG4); |
1125 | if (ret) | 1140 | if (ret) |
@@ -1174,6 +1189,63 @@ static int bxt_init_workarounds(struct intel_engine_cs *engine) | |||
1174 | return ret; | 1189 | return ret; |
1175 | } | 1190 | } |
1176 | 1191 | ||
1192 | /* WaInsertDummyPushConstPs:bxt */ | ||
1193 | if (IS_BXT_REVID(dev_priv, 0, BXT_REVID_B0)) | ||
1194 | WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, | ||
1195 | GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION); | ||
1196 | |||
1197 | return 0; | ||
1198 | } | ||
1199 | |||
1200 | static int kbl_init_workarounds(struct intel_engine_cs *engine) | ||
1201 | { | ||
1202 | struct drm_i915_private *dev_priv = engine->dev->dev_private; | ||
1203 | int ret; | ||
1204 | |||
1205 | ret = gen9_init_workarounds(engine); | ||
1206 | if (ret) | ||
1207 | return ret; | ||
1208 | |||
1209 | /* WaEnableGapsTsvCreditFix:kbl */ | ||
1210 | I915_WRITE(GEN8_GARBCNTL, (I915_READ(GEN8_GARBCNTL) | | ||
1211 | GEN9_GAPS_TSV_CREDIT_DISABLE)); | ||
1212 | |||
1213 | /* WaDisableDynamicCreditSharing:kbl */ | ||
1214 | if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_B0)) | ||
1215 | WA_SET_BIT(GAMT_CHKN_BIT_REG, | ||
1216 | GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING); | ||
1217 | |||
1218 | /* WaDisableFenceDestinationToSLM:kbl (pre-prod) */ | ||
1219 | if (IS_KBL_REVID(dev_priv, KBL_REVID_A0, KBL_REVID_A0)) | ||
1220 | WA_SET_BIT_MASKED(HDC_CHICKEN0, | ||
1221 | HDC_FENCE_DEST_SLM_DISABLE); | ||
1222 | |||
1223 | /* GEN8_L3SQCREG4 has a dependency with WA batch so any new changes | ||
1224 | * involving this register should also be added to WA batch as required. | ||
1225 | */ | ||
1226 | if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_E0)) | ||
1227 | /* WaDisableLSQCROPERFforOCL:kbl */ | ||
1228 | I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) | | ||
1229 | GEN8_LQSC_RO_PERF_DIS); | ||
1230 | |||
1231 | /* WaInsertDummyPushConstPs:kbl */ | ||
1232 | if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_B0)) | ||
1233 | WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, | ||
1234 | GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION); | ||
1235 | |||
1236 | /* WaDisableGafsUnitClkGating:kbl */ | ||
1237 | WA_SET_BIT(GEN7_UCGCTL4, GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE); | ||
1238 | |||
1239 | /* WaDisableSbeCacheDispatchPortSharing:kbl */ | ||
1240 | WA_SET_BIT_MASKED( | ||
1241 | GEN7_HALF_SLICE_CHICKEN1, | ||
1242 | GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE); | ||
1243 | |||
1244 | /* WaDisableLSQCROPERFforOCL:kbl */ | ||
1245 | ret = wa_ring_whitelist_reg(engine, GEN8_L3SQCREG4); | ||
1246 | if (ret) | ||
1247 | return ret; | ||
1248 | |||
1177 | return 0; | 1249 | return 0; |
1178 | } | 1250 | } |
1179 | 1251 | ||
@@ -1199,6 +1271,9 @@ int init_workarounds_ring(struct intel_engine_cs *engine) | |||
1199 | if (IS_BROXTON(dev)) | 1271 | if (IS_BROXTON(dev)) |
1200 | return bxt_init_workarounds(engine); | 1272 | return bxt_init_workarounds(engine); |
1201 | 1273 | ||
1274 | if (IS_KABYLAKE(dev_priv)) | ||
1275 | return kbl_init_workarounds(engine); | ||
1276 | |||
1202 | return 0; | 1277 | return 0; |
1203 | } | 1278 | } |
1204 | 1279 | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c index 22706c0a54b5..49bd5da194e1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c | |||
@@ -40,7 +40,8 @@ static int | |||
40 | gf119_sor_dp_pattern(struct nvkm_output_dp *outp, int pattern) | 40 | gf119_sor_dp_pattern(struct nvkm_output_dp *outp, int pattern) |
41 | { | 41 | { |
42 | struct nvkm_device *device = outp->base.disp->engine.subdev.device; | 42 | struct nvkm_device *device = outp->base.disp->engine.subdev.device; |
43 | nvkm_mask(device, 0x61c110, 0x0f0f0f0f, 0x01010101 * pattern); | 43 | const u32 soff = gf119_sor_soff(outp); |
44 | nvkm_mask(device, 0x61c110 + soff, 0x0f0f0f0f, 0x01010101 * pattern); | ||
44 | return 0; | 45 | return 0; |
45 | } | 46 | } |
46 | 47 | ||
diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index 4182a21f5923..41cacecbea9a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c | |||
@@ -65,6 +65,14 @@ static void sun4i_crtc_disable(struct drm_crtc *crtc) | |||
65 | DRM_DEBUG_DRIVER("Disabling the CRTC\n"); | 65 | DRM_DEBUG_DRIVER("Disabling the CRTC\n"); |
66 | 66 | ||
67 | sun4i_tcon_disable(drv->tcon); | 67 | sun4i_tcon_disable(drv->tcon); |
68 | |||
69 | if (crtc->state->event && !crtc->state->active) { | ||
70 | spin_lock_irq(&crtc->dev->event_lock); | ||
71 | drm_crtc_send_vblank_event(crtc, crtc->state->event); | ||
72 | spin_unlock_irq(&crtc->dev->event_lock); | ||
73 | |||
74 | crtc->state->event = NULL; | ||
75 | } | ||
68 | } | 76 | } |
69 | 77 | ||
70 | static void sun4i_crtc_enable(struct drm_crtc *crtc) | 78 | static void sun4i_crtc_enable(struct drm_crtc *crtc) |
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 257d2b4f3645..937394cbc241 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c | |||
@@ -92,7 +92,7 @@ static struct drm_driver sun4i_drv_driver = { | |||
92 | /* Frame Buffer Operations */ | 92 | /* Frame Buffer Operations */ |
93 | 93 | ||
94 | /* VBlank Operations */ | 94 | /* VBlank Operations */ |
95 | .get_vblank_counter = drm_vblank_count, | 95 | .get_vblank_counter = drm_vblank_no_hw_counter, |
96 | .enable_vblank = sun4i_drv_enable_vblank, | 96 | .enable_vblank = sun4i_drv_enable_vblank, |
97 | .disable_vblank = sun4i_drv_disable_vblank, | 97 | .disable_vblank = sun4i_drv_disable_vblank, |
98 | }; | 98 | }; |
@@ -310,6 +310,7 @@ static int sun4i_drv_probe(struct platform_device *pdev) | |||
310 | 310 | ||
311 | count += sun4i_drv_add_endpoints(&pdev->dev, &match, | 311 | count += sun4i_drv_add_endpoints(&pdev->dev, &match, |
312 | pipeline); | 312 | pipeline); |
313 | of_node_put(pipeline); | ||
313 | 314 | ||
314 | DRM_DEBUG_DRIVER("Queued %d outputs on pipeline %d\n", | 315 | DRM_DEBUG_DRIVER("Queued %d outputs on pipeline %d\n", |
315 | count, i); | 316 | count, i); |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 39386f50af87..a71cf98c655f 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1034,9 +1034,9 @@ out_unlock: | |||
1034 | return ret; | 1034 | return ret; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | static bool ttm_bo_mem_compat(struct ttm_placement *placement, | 1037 | bool ttm_bo_mem_compat(struct ttm_placement *placement, |
1038 | struct ttm_mem_reg *mem, | 1038 | struct ttm_mem_reg *mem, |
1039 | uint32_t *new_flags) | 1039 | uint32_t *new_flags) |
1040 | { | 1040 | { |
1041 | int i; | 1041 | int i; |
1042 | 1042 | ||
@@ -1068,6 +1068,7 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement, | |||
1068 | 1068 | ||
1069 | return false; | 1069 | return false; |
1070 | } | 1070 | } |
1071 | EXPORT_SYMBOL(ttm_bo_mem_compat); | ||
1071 | 1072 | ||
1072 | int ttm_bo_validate(struct ttm_buffer_object *bo, | 1073 | int ttm_bo_validate(struct ttm_buffer_object *bo, |
1073 | struct ttm_placement *placement, | 1074 | struct ttm_placement *placement, |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c index 9b078a493996..0cd889015dc5 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c | |||
@@ -49,6 +49,7 @@ int vmw_dmabuf_pin_in_placement(struct vmw_private *dev_priv, | |||
49 | { | 49 | { |
50 | struct ttm_buffer_object *bo = &buf->base; | 50 | struct ttm_buffer_object *bo = &buf->base; |
51 | int ret; | 51 | int ret; |
52 | uint32_t new_flags; | ||
52 | 53 | ||
53 | ret = ttm_write_lock(&dev_priv->reservation_sem, interruptible); | 54 | ret = ttm_write_lock(&dev_priv->reservation_sem, interruptible); |
54 | if (unlikely(ret != 0)) | 55 | if (unlikely(ret != 0)) |
@@ -60,7 +61,12 @@ int vmw_dmabuf_pin_in_placement(struct vmw_private *dev_priv, | |||
60 | if (unlikely(ret != 0)) | 61 | if (unlikely(ret != 0)) |
61 | goto err; | 62 | goto err; |
62 | 63 | ||
63 | ret = ttm_bo_validate(bo, placement, interruptible, false); | 64 | if (buf->pin_count > 0) |
65 | ret = ttm_bo_mem_compat(placement, &bo->mem, | ||
66 | &new_flags) == true ? 0 : -EINVAL; | ||
67 | else | ||
68 | ret = ttm_bo_validate(bo, placement, interruptible, false); | ||
69 | |||
64 | if (!ret) | 70 | if (!ret) |
65 | vmw_bo_pin_reserved(buf, true); | 71 | vmw_bo_pin_reserved(buf, true); |
66 | 72 | ||
@@ -91,6 +97,7 @@ int vmw_dmabuf_pin_in_vram_or_gmr(struct vmw_private *dev_priv, | |||
91 | { | 97 | { |
92 | struct ttm_buffer_object *bo = &buf->base; | 98 | struct ttm_buffer_object *bo = &buf->base; |
93 | int ret; | 99 | int ret; |
100 | uint32_t new_flags; | ||
94 | 101 | ||
95 | ret = ttm_write_lock(&dev_priv->reservation_sem, interruptible); | 102 | ret = ttm_write_lock(&dev_priv->reservation_sem, interruptible); |
96 | if (unlikely(ret != 0)) | 103 | if (unlikely(ret != 0)) |
@@ -102,6 +109,12 @@ int vmw_dmabuf_pin_in_vram_or_gmr(struct vmw_private *dev_priv, | |||
102 | if (unlikely(ret != 0)) | 109 | if (unlikely(ret != 0)) |
103 | goto err; | 110 | goto err; |
104 | 111 | ||
112 | if (buf->pin_count > 0) { | ||
113 | ret = ttm_bo_mem_compat(&vmw_vram_gmr_placement, &bo->mem, | ||
114 | &new_flags) == true ? 0 : -EINVAL; | ||
115 | goto out_unreserve; | ||
116 | } | ||
117 | |||
105 | ret = ttm_bo_validate(bo, &vmw_vram_gmr_placement, interruptible, | 118 | ret = ttm_bo_validate(bo, &vmw_vram_gmr_placement, interruptible, |
106 | false); | 119 | false); |
107 | if (likely(ret == 0) || ret == -ERESTARTSYS) | 120 | if (likely(ret == 0) || ret == -ERESTARTSYS) |
@@ -161,6 +174,7 @@ int vmw_dmabuf_pin_in_start_of_vram(struct vmw_private *dev_priv, | |||
161 | struct ttm_placement placement; | 174 | struct ttm_placement placement; |
162 | struct ttm_place place; | 175 | struct ttm_place place; |
163 | int ret = 0; | 176 | int ret = 0; |
177 | uint32_t new_flags; | ||
164 | 178 | ||
165 | place = vmw_vram_placement.placement[0]; | 179 | place = vmw_vram_placement.placement[0]; |
166 | place.lpfn = bo->num_pages; | 180 | place.lpfn = bo->num_pages; |
@@ -185,10 +199,15 @@ int vmw_dmabuf_pin_in_start_of_vram(struct vmw_private *dev_priv, | |||
185 | */ | 199 | */ |
186 | if (bo->mem.mem_type == TTM_PL_VRAM && | 200 | if (bo->mem.mem_type == TTM_PL_VRAM && |
187 | bo->mem.start < bo->num_pages && | 201 | bo->mem.start < bo->num_pages && |
188 | bo->mem.start > 0) | 202 | bo->mem.start > 0 && |
203 | buf->pin_count == 0) | ||
189 | (void) ttm_bo_validate(bo, &vmw_sys_placement, false, false); | 204 | (void) ttm_bo_validate(bo, &vmw_sys_placement, false, false); |
190 | 205 | ||
191 | ret = ttm_bo_validate(bo, &placement, interruptible, false); | 206 | if (buf->pin_count > 0) |
207 | ret = ttm_bo_mem_compat(&placement, &bo->mem, | ||
208 | &new_flags) == true ? 0 : -EINVAL; | ||
209 | else | ||
210 | ret = ttm_bo_validate(bo, &placement, interruptible, false); | ||
192 | 211 | ||
193 | /* For some reason we didn't end up at the start of vram */ | 212 | /* For some reason we didn't end up at the start of vram */ |
194 | WARN_ON(ret == 0 && bo->offset != 0); | 213 | WARN_ON(ret == 0 && bo->offset != 0); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 9fcd8200d485..8d528fcf6e96 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
@@ -233,6 +233,7 @@ static int vmw_force_iommu; | |||
233 | static int vmw_restrict_iommu; | 233 | static int vmw_restrict_iommu; |
234 | static int vmw_force_coherent; | 234 | static int vmw_force_coherent; |
235 | static int vmw_restrict_dma_mask; | 235 | static int vmw_restrict_dma_mask; |
236 | static int vmw_assume_16bpp; | ||
236 | 237 | ||
237 | static int vmw_probe(struct pci_dev *, const struct pci_device_id *); | 238 | static int vmw_probe(struct pci_dev *, const struct pci_device_id *); |
238 | static void vmw_master_init(struct vmw_master *); | 239 | static void vmw_master_init(struct vmw_master *); |
@@ -249,6 +250,8 @@ MODULE_PARM_DESC(force_coherent, "Force coherent TTM pages"); | |||
249 | module_param_named(force_coherent, vmw_force_coherent, int, 0600); | 250 | module_param_named(force_coherent, vmw_force_coherent, int, 0600); |
250 | MODULE_PARM_DESC(restrict_dma_mask, "Restrict DMA mask to 44 bits with IOMMU"); | 251 | MODULE_PARM_DESC(restrict_dma_mask, "Restrict DMA mask to 44 bits with IOMMU"); |
251 | module_param_named(restrict_dma_mask, vmw_restrict_dma_mask, int, 0600); | 252 | module_param_named(restrict_dma_mask, vmw_restrict_dma_mask, int, 0600); |
253 | MODULE_PARM_DESC(assume_16bpp, "Assume 16-bpp when filtering modes"); | ||
254 | module_param_named(assume_16bpp, vmw_assume_16bpp, int, 0600); | ||
252 | 255 | ||
253 | 256 | ||
254 | static void vmw_print_capabilities(uint32_t capabilities) | 257 | static void vmw_print_capabilities(uint32_t capabilities) |
@@ -660,6 +663,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
660 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1); | 663 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1); |
661 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2); | 664 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2); |
662 | 665 | ||
666 | dev_priv->assume_16bpp = !!vmw_assume_16bpp; | ||
667 | |||
663 | dev_priv->enable_fb = enable_fbdev; | 668 | dev_priv->enable_fb = enable_fbdev; |
664 | 669 | ||
665 | vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2); | 670 | vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2); |
@@ -706,6 +711,13 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
706 | vmw_read(dev_priv, | 711 | vmw_read(dev_priv, |
707 | SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB); | 712 | SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB); |
708 | 713 | ||
714 | /* | ||
715 | * Workaround for low memory 2D VMs to compensate for the | ||
716 | * allocation taken by fbdev | ||
717 | */ | ||
718 | if (!(dev_priv->capabilities & SVGA_CAP_3D)) | ||
719 | mem_size *= 2; | ||
720 | |||
709 | dev_priv->max_mob_pages = mem_size * 1024 / PAGE_SIZE; | 721 | dev_priv->max_mob_pages = mem_size * 1024 / PAGE_SIZE; |
710 | dev_priv->prim_bb_mem = | 722 | dev_priv->prim_bb_mem = |
711 | vmw_read(dev_priv, | 723 | vmw_read(dev_priv, |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 1980e2a28265..89fb19443a3f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | |||
@@ -386,6 +386,7 @@ struct vmw_private { | |||
386 | spinlock_t hw_lock; | 386 | spinlock_t hw_lock; |
387 | spinlock_t cap_lock; | 387 | spinlock_t cap_lock; |
388 | bool has_dx; | 388 | bool has_dx; |
389 | bool assume_16bpp; | ||
389 | 390 | ||
390 | /* | 391 | /* |
391 | * VGA registers. | 392 | * VGA registers. |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 679a4cb98ee3..d2d93959b119 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | |||
@@ -517,28 +517,6 @@ static int vmw_fb_kms_framebuffer(struct fb_info *info) | |||
517 | 517 | ||
518 | par->set_fb = &vfb->base; | 518 | par->set_fb = &vfb->base; |
519 | 519 | ||
520 | if (!par->bo_ptr) { | ||
521 | /* | ||
522 | * Pin before mapping. Since we don't know in what placement | ||
523 | * to pin, call into KMS to do it for us. | ||
524 | */ | ||
525 | ret = vfb->pin(vfb); | ||
526 | if (ret) { | ||
527 | DRM_ERROR("Could not pin the fbdev framebuffer.\n"); | ||
528 | return ret; | ||
529 | } | ||
530 | |||
531 | ret = ttm_bo_kmap(&par->vmw_bo->base, 0, | ||
532 | par->vmw_bo->base.num_pages, &par->map); | ||
533 | if (ret) { | ||
534 | vfb->unpin(vfb); | ||
535 | DRM_ERROR("Could not map the fbdev framebuffer.\n"); | ||
536 | return ret; | ||
537 | } | ||
538 | |||
539 | par->bo_ptr = ttm_kmap_obj_virtual(&par->map, &par->bo_iowrite); | ||
540 | } | ||
541 | |||
542 | return 0; | 520 | return 0; |
543 | } | 521 | } |
544 | 522 | ||
@@ -601,6 +579,31 @@ static int vmw_fb_set_par(struct fb_info *info) | |||
601 | if (ret) | 579 | if (ret) |
602 | goto out_unlock; | 580 | goto out_unlock; |
603 | 581 | ||
582 | if (!par->bo_ptr) { | ||
583 | struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(set.fb); | ||
584 | |||
585 | /* | ||
586 | * Pin before mapping. Since we don't know in what placement | ||
587 | * to pin, call into KMS to do it for us. | ||
588 | */ | ||
589 | ret = vfb->pin(vfb); | ||
590 | if (ret) { | ||
591 | DRM_ERROR("Could not pin the fbdev framebuffer.\n"); | ||
592 | goto out_unlock; | ||
593 | } | ||
594 | |||
595 | ret = ttm_bo_kmap(&par->vmw_bo->base, 0, | ||
596 | par->vmw_bo->base.num_pages, &par->map); | ||
597 | if (ret) { | ||
598 | vfb->unpin(vfb); | ||
599 | DRM_ERROR("Could not map the fbdev framebuffer.\n"); | ||
600 | goto out_unlock; | ||
601 | } | ||
602 | |||
603 | par->bo_ptr = ttm_kmap_obj_virtual(&par->map, &par->bo_iowrite); | ||
604 | } | ||
605 | |||
606 | |||
604 | vmw_fb_dirty_mark(par, par->fb_x, par->fb_y, | 607 | vmw_fb_dirty_mark(par, par->fb_x, par->fb_y, |
605 | par->set_fb->width, par->set_fb->height); | 608 | par->set_fb->width, par->set_fb->height); |
606 | 609 | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 55231cce73a0..e29da45a2847 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -1553,14 +1553,10 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector, | |||
1553 | DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) | 1553 | DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) |
1554 | }; | 1554 | }; |
1555 | int i; | 1555 | int i; |
1556 | u32 assumed_bpp = 2; | 1556 | u32 assumed_bpp = 4; |
1557 | 1557 | ||
1558 | /* | 1558 | if (dev_priv->assume_16bpp) |
1559 | * If using screen objects, then assume 32-bpp because that's what the | 1559 | assumed_bpp = 2; |
1560 | * SVGA device is assuming | ||
1561 | */ | ||
1562 | if (dev_priv->active_display_unit == vmw_du_screen_object) | ||
1563 | assumed_bpp = 4; | ||
1564 | 1560 | ||
1565 | if (dev_priv->active_display_unit == vmw_du_screen_target) { | 1561 | if (dev_priv->active_display_unit == vmw_du_screen_target) { |
1566 | max_width = min(max_width, dev_priv->stdu_max_width); | 1562 | max_width = min(max_width, dev_priv->stdu_max_width); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c index f0374f9b56ca..e57a0bad7a62 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | |||
@@ -300,6 +300,9 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg, | |||
300 | break; | 300 | break; |
301 | } | 301 | } |
302 | 302 | ||
303 | if (retries == RETRIES) | ||
304 | return -EINVAL; | ||
305 | |||
303 | *msg_len = reply_len; | 306 | *msg_len = reply_len; |
304 | *msg = reply; | 307 | *msg = reply; |
305 | 308 | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 9ca818fb034c..41932a7c4f79 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | |||
@@ -399,8 +399,10 @@ static int vmw_stdu_bind_fb(struct vmw_private *dev_priv, | |||
399 | 399 | ||
400 | WARN_ON_ONCE(!stdu->defined); | 400 | WARN_ON_ONCE(!stdu->defined); |
401 | 401 | ||
402 | if (!vfb->dmabuf && new_fb->width == mode->hdisplay && | 402 | new_vfbs = (vfb->dmabuf) ? NULL : vmw_framebuffer_to_vfbs(new_fb); |
403 | new_fb->height == mode->vdisplay) | 403 | |
404 | if (new_vfbs && new_vfbs->surface->base_size.width == mode->hdisplay && | ||
405 | new_vfbs->surface->base_size.height == mode->vdisplay) | ||
404 | new_content_type = SAME_AS_DISPLAY; | 406 | new_content_type = SAME_AS_DISPLAY; |
405 | else if (vfb->dmabuf) | 407 | else if (vfb->dmabuf) |
406 | new_content_type = SEPARATE_DMA; | 408 | new_content_type = SEPARATE_DMA; |
@@ -444,7 +446,6 @@ static int vmw_stdu_bind_fb(struct vmw_private *dev_priv, | |||
444 | content_srf.mip_levels[0] = 1; | 446 | content_srf.mip_levels[0] = 1; |
445 | content_srf.multisample_count = 0; | 447 | content_srf.multisample_count = 0; |
446 | } else { | 448 | } else { |
447 | new_vfbs = vmw_framebuffer_to_vfbs(new_fb); | ||
448 | content_srf = *new_vfbs->surface; | 449 | content_srf = *new_vfbs->surface; |
449 | } | 450 | } |
450 | 451 | ||
@@ -464,7 +465,6 @@ static int vmw_stdu_bind_fb(struct vmw_private *dev_priv, | |||
464 | return ret; | 465 | return ret; |
465 | } | 466 | } |
466 | } else if (new_content_type == SAME_AS_DISPLAY) { | 467 | } else if (new_content_type == SAME_AS_DISPLAY) { |
467 | new_vfbs = vmw_framebuffer_to_vfbs(new_fb); | ||
468 | new_display_srf = vmw_surface_reference(new_vfbs->surface); | 468 | new_display_srf = vmw_surface_reference(new_vfbs->surface); |
469 | } | 469 | } |
470 | 470 | ||
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index cc6439ab3f71..041050edd809 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c | |||
@@ -1268,6 +1268,8 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap, | |||
1268 | } | 1268 | } |
1269 | } | 1269 | } |
1270 | 1270 | ||
1271 | idx = 0; | ||
1272 | |||
1271 | do { | 1273 | do { |
1272 | if (msgs[idx].len == 0) { | 1274 | if (msgs[idx].len == 0) { |
1273 | ret = -EINVAL; | 1275 | ret = -EINVAL; |
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 445398c314a3..b126dbaa47e3 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c | |||
@@ -912,7 +912,7 @@ static int tegra_i2c_probe(struct platform_device *pdev) | |||
912 | ret = tegra_i2c_init(i2c_dev); | 912 | ret = tegra_i2c_init(i2c_dev); |
913 | if (ret) { | 913 | if (ret) { |
914 | dev_err(&pdev->dev, "Failed to initialize i2c controller"); | 914 | dev_err(&pdev->dev, "Failed to initialize i2c controller"); |
915 | goto unprepare_div_clk; | 915 | goto disable_div_clk; |
916 | } | 916 | } |
917 | 917 | ||
918 | ret = devm_request_irq(&pdev->dev, i2c_dev->irq, | 918 | ret = devm_request_irq(&pdev->dev, i2c_dev->irq, |
diff --git a/drivers/i2c/i2c-boardinfo.c b/drivers/i2c/i2c-boardinfo.c index e33022e2d459..6e5fac6a5262 100644 --- a/drivers/i2c/i2c-boardinfo.c +++ b/drivers/i2c/i2c-boardinfo.c | |||
@@ -56,9 +56,7 @@ EXPORT_SYMBOL_GPL(__i2c_first_dynamic_bus_num); | |||
56 | * The board info passed can safely be __initdata, but be careful of embedded | 56 | * The board info passed can safely be __initdata, but be careful of embedded |
57 | * pointers (for platform_data, functions, etc) since that won't be copied. | 57 | * pointers (for platform_data, functions, etc) since that won't be copied. |
58 | */ | 58 | */ |
59 | int __init | 59 | int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned len) |
60 | i2c_register_board_info(int busnum, | ||
61 | struct i2c_board_info const *info, unsigned len) | ||
62 | { | 60 | { |
63 | int status; | 61 | int status; |
64 | 62 | ||
diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c index 26e7c5187a58..c6a90b4a9c62 100644 --- a/drivers/i2c/muxes/i2c-mux-reg.c +++ b/drivers/i2c/muxes/i2c-mux-reg.c | |||
@@ -145,7 +145,7 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux, | |||
145 | mux->data.idle_in_use = true; | 145 | mux->data.idle_in_use = true; |
146 | 146 | ||
147 | /* map address from "reg" if exists */ | 147 | /* map address from "reg" if exists */ |
148 | if (of_address_to_resource(np, 0, &res)) { | 148 | if (of_address_to_resource(np, 0, &res) == 0) { |
149 | mux->data.reg_size = resource_size(&res); | 149 | mux->data.reg_size = resource_size(&res); |
150 | mux->data.reg = devm_ioremap_resource(&pdev->dev, &res); | 150 | mux->data.reg = devm_ioremap_resource(&pdev->dev, &res); |
151 | if (IS_ERR(mux->data.reg)) | 151 | if (IS_ERR(mux->data.reg)) |
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index a5793c8f1590..60df4f8e81be 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c | |||
@@ -530,6 +530,7 @@ static PORT_PMA_ATTR(port_xmit_data , 12, 32, 192); | |||
530 | static PORT_PMA_ATTR(port_rcv_data , 13, 32, 224); | 530 | static PORT_PMA_ATTR(port_rcv_data , 13, 32, 224); |
531 | static PORT_PMA_ATTR(port_xmit_packets , 14, 32, 256); | 531 | static PORT_PMA_ATTR(port_xmit_packets , 14, 32, 256); |
532 | static PORT_PMA_ATTR(port_rcv_packets , 15, 32, 288); | 532 | static PORT_PMA_ATTR(port_rcv_packets , 15, 32, 288); |
533 | static PORT_PMA_ATTR(port_xmit_wait , 0, 32, 320); | ||
533 | 534 | ||
534 | /* | 535 | /* |
535 | * Counters added by extended set | 536 | * Counters added by extended set |
@@ -560,6 +561,7 @@ static struct attribute *pma_attrs[] = { | |||
560 | &port_pma_attr_port_rcv_data.attr.attr, | 561 | &port_pma_attr_port_rcv_data.attr.attr, |
561 | &port_pma_attr_port_xmit_packets.attr.attr, | 562 | &port_pma_attr_port_xmit_packets.attr.attr, |
562 | &port_pma_attr_port_rcv_packets.attr.attr, | 563 | &port_pma_attr_port_rcv_packets.attr.attr, |
564 | &port_pma_attr_port_xmit_wait.attr.attr, | ||
563 | NULL | 565 | NULL |
564 | }; | 566 | }; |
565 | 567 | ||
@@ -579,6 +581,7 @@ static struct attribute *pma_attrs_ext[] = { | |||
579 | &port_pma_attr_ext_port_xmit_data.attr.attr, | 581 | &port_pma_attr_ext_port_xmit_data.attr.attr, |
580 | &port_pma_attr_ext_port_rcv_data.attr.attr, | 582 | &port_pma_attr_ext_port_rcv_data.attr.attr, |
581 | &port_pma_attr_ext_port_xmit_packets.attr.attr, | 583 | &port_pma_attr_ext_port_xmit_packets.attr.attr, |
584 | &port_pma_attr_port_xmit_wait.attr.attr, | ||
582 | &port_pma_attr_ext_port_rcv_packets.attr.attr, | 585 | &port_pma_attr_ext_port_rcv_packets.attr.attr, |
583 | &port_pma_attr_ext_unicast_rcv_packets.attr.attr, | 586 | &port_pma_attr_ext_unicast_rcv_packets.attr.attr, |
584 | &port_pma_attr_ext_unicast_xmit_packets.attr.attr, | 587 | &port_pma_attr_ext_unicast_xmit_packets.attr.attr, |
@@ -604,6 +607,7 @@ static struct attribute *pma_attrs_noietf[] = { | |||
604 | &port_pma_attr_ext_port_rcv_data.attr.attr, | 607 | &port_pma_attr_ext_port_rcv_data.attr.attr, |
605 | &port_pma_attr_ext_port_xmit_packets.attr.attr, | 608 | &port_pma_attr_ext_port_xmit_packets.attr.attr, |
606 | &port_pma_attr_ext_port_rcv_packets.attr.attr, | 609 | &port_pma_attr_ext_port_rcv_packets.attr.attr, |
610 | &port_pma_attr_port_xmit_wait.attr.attr, | ||
607 | NULL | 611 | NULL |
608 | }; | 612 | }; |
609 | 613 | ||
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index f5de85178055..dad4d0ebbdff 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c | |||
@@ -14113,8 +14113,14 @@ static int init_asic_data(struct hfi1_devdata *dd) | |||
14113 | { | 14113 | { |
14114 | unsigned long flags; | 14114 | unsigned long flags; |
14115 | struct hfi1_devdata *tmp, *peer = NULL; | 14115 | struct hfi1_devdata *tmp, *peer = NULL; |
14116 | struct hfi1_asic_data *asic_data; | ||
14116 | int ret = 0; | 14117 | int ret = 0; |
14117 | 14118 | ||
14119 | /* pre-allocate the asic structure in case we are the first device */ | ||
14120 | asic_data = kzalloc(sizeof(*dd->asic_data), GFP_KERNEL); | ||
14121 | if (!asic_data) | ||
14122 | return -ENOMEM; | ||
14123 | |||
14118 | spin_lock_irqsave(&hfi1_devs_lock, flags); | 14124 | spin_lock_irqsave(&hfi1_devs_lock, flags); |
14119 | /* Find our peer device */ | 14125 | /* Find our peer device */ |
14120 | list_for_each_entry(tmp, &hfi1_dev_list, list) { | 14126 | list_for_each_entry(tmp, &hfi1_dev_list, list) { |
@@ -14126,18 +14132,14 @@ static int init_asic_data(struct hfi1_devdata *dd) | |||
14126 | } | 14132 | } |
14127 | 14133 | ||
14128 | if (peer) { | 14134 | if (peer) { |
14135 | /* use already allocated structure */ | ||
14129 | dd->asic_data = peer->asic_data; | 14136 | dd->asic_data = peer->asic_data; |
14137 | kfree(asic_data); | ||
14130 | } else { | 14138 | } else { |
14131 | dd->asic_data = kzalloc(sizeof(*dd->asic_data), GFP_KERNEL); | 14139 | dd->asic_data = asic_data; |
14132 | if (!dd->asic_data) { | ||
14133 | ret = -ENOMEM; | ||
14134 | goto done; | ||
14135 | } | ||
14136 | mutex_init(&dd->asic_data->asic_resource_mutex); | 14140 | mutex_init(&dd->asic_data->asic_resource_mutex); |
14137 | } | 14141 | } |
14138 | dd->asic_data->dds[dd->hfi1_id] = dd; /* self back-pointer */ | 14142 | dd->asic_data->dds[dd->hfi1_id] = dd; /* self back-pointer */ |
14139 | |||
14140 | done: | ||
14141 | spin_unlock_irqrestore(&hfi1_devs_lock, flags); | 14143 | spin_unlock_irqrestore(&hfi1_devs_lock, flags); |
14142 | return ret; | 14144 | return ret; |
14143 | } | 14145 | } |
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c index 1e503ad0bebb..be91f6fa1c87 100644 --- a/drivers/infiniband/hw/hfi1/ud.c +++ b/drivers/infiniband/hw/hfi1/ud.c | |||
@@ -678,8 +678,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) | |||
678 | u32 tlen = packet->tlen; | 678 | u32 tlen = packet->tlen; |
679 | struct rvt_qp *qp = packet->qp; | 679 | struct rvt_qp *qp = packet->qp; |
680 | bool has_grh = rcv_flags & HFI1_HAS_GRH; | 680 | bool has_grh = rcv_flags & HFI1_HAS_GRH; |
681 | bool sc4_bit = has_sc4_bit(packet); | 681 | u8 sc5 = hdr2sc((struct hfi1_message_header *)hdr, packet->rhf); |
682 | u8 sc; | ||
683 | u32 bth1; | 682 | u32 bth1; |
684 | int is_mcast; | 683 | int is_mcast; |
685 | struct ib_grh *grh = NULL; | 684 | struct ib_grh *grh = NULL; |
@@ -697,10 +696,8 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) | |||
697 | */ | 696 | */ |
698 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | 697 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); |
699 | u32 lqpn = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK; | 698 | u32 lqpn = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK; |
700 | u8 sl, sc5; | 699 | u8 sl; |
701 | 700 | ||
702 | sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf; | ||
703 | sc5 |= sc4_bit; | ||
704 | sl = ibp->sc_to_sl[sc5]; | 701 | sl = ibp->sc_to_sl[sc5]; |
705 | 702 | ||
706 | process_becn(ppd, sl, 0, lqpn, 0, IB_CC_SVCTYPE_UD); | 703 | process_becn(ppd, sl, 0, lqpn, 0, IB_CC_SVCTYPE_UD); |
@@ -717,10 +714,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) | |||
717 | 714 | ||
718 | if (!is_mcast && (opcode != IB_OPCODE_CNP) && bth1 & HFI1_FECN_SMASK) { | 715 | if (!is_mcast && (opcode != IB_OPCODE_CNP) && bth1 & HFI1_FECN_SMASK) { |
719 | u16 slid = be16_to_cpu(hdr->lrh[3]); | 716 | u16 slid = be16_to_cpu(hdr->lrh[3]); |
720 | u8 sc5; | ||
721 | |||
722 | sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf; | ||
723 | sc5 |= sc4_bit; | ||
724 | 717 | ||
725 | return_cnp(ibp, qp, src_qp, pkey, dlid, slid, sc5, grh); | 718 | return_cnp(ibp, qp, src_qp, pkey, dlid, slid, sc5, grh); |
726 | } | 719 | } |
@@ -745,10 +738,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) | |||
745 | if (qp->ibqp.qp_num > 1) { | 738 | if (qp->ibqp.qp_num > 1) { |
746 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | 739 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); |
747 | u16 slid; | 740 | u16 slid; |
748 | u8 sc5; | ||
749 | |||
750 | sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf; | ||
751 | sc5 |= sc4_bit; | ||
752 | 741 | ||
753 | slid = be16_to_cpu(hdr->lrh[3]); | 742 | slid = be16_to_cpu(hdr->lrh[3]); |
754 | if (unlikely(rcv_pkey_check(ppd, pkey, sc5, slid))) { | 743 | if (unlikely(rcv_pkey_check(ppd, pkey, sc5, slid))) { |
@@ -790,10 +779,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) | |||
790 | /* Received on QP0, and so by definition, this is an SMP */ | 779 | /* Received on QP0, and so by definition, this is an SMP */ |
791 | struct opa_smp *smp = (struct opa_smp *)data; | 780 | struct opa_smp *smp = (struct opa_smp *)data; |
792 | u16 slid = be16_to_cpu(hdr->lrh[3]); | 781 | u16 slid = be16_to_cpu(hdr->lrh[3]); |
793 | u8 sc5; | ||
794 | |||
795 | sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf; | ||
796 | sc5 |= sc4_bit; | ||
797 | 782 | ||
798 | if (opa_smp_check(ibp, pkey, sc5, qp, slid, smp)) | 783 | if (opa_smp_check(ibp, pkey, sc5, qp, slid, smp)) |
799 | goto drop; | 784 | goto drop; |
@@ -890,9 +875,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) | |||
890 | } | 875 | } |
891 | 876 | ||
892 | wc.slid = be16_to_cpu(hdr->lrh[3]); | 877 | wc.slid = be16_to_cpu(hdr->lrh[3]); |
893 | sc = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf; | 878 | wc.sl = ibp->sc_to_sl[sc5]; |
894 | sc |= sc4_bit; | ||
895 | wc.sl = ibp->sc_to_sl[sc]; | ||
896 | 879 | ||
897 | /* | 880 | /* |
898 | * Save the LMC lower bits if the destination LID is a unicast LID. | 881 | * Save the LMC lower bits if the destination LID is a unicast LID. |
diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c index c963cad92f5a..6e9081380a27 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_main.c +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c | |||
@@ -600,8 +600,7 @@ static enum i40iw_status_code i40iw_create_cqp(struct i40iw_device *iwdev) | |||
600 | cqp_init_info.scratch_array = cqp->scratch_array; | 600 | cqp_init_info.scratch_array = cqp->scratch_array; |
601 | status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info); | 601 | status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info); |
602 | if (status) { | 602 | if (status) { |
603 | i40iw_pr_err("cqp init status %d maj_err %d min_err %d\n", | 603 | i40iw_pr_err("cqp init status %d\n", status); |
604 | status, maj_err, min_err); | ||
605 | goto exit; | 604 | goto exit; |
606 | } | 605 | } |
607 | status = dev->cqp_ops->cqp_create(dev->cqp, true, &maj_err, &min_err); | 606 | status = dev->cqp_ops->cqp_create(dev->cqp, true, &maj_err, &min_err); |
diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c index 33959ed14563..283b64c942ee 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c | |||
@@ -1474,6 +1474,7 @@ static int i40iw_hw_alloc_stag(struct i40iw_device *iwdev, struct i40iw_mr *iwmr | |||
1474 | info->stag_idx = iwmr->stag >> I40IW_CQPSQ_STAG_IDX_SHIFT; | 1474 | info->stag_idx = iwmr->stag >> I40IW_CQPSQ_STAG_IDX_SHIFT; |
1475 | info->pd_id = iwpd->sc_pd.pd_id; | 1475 | info->pd_id = iwpd->sc_pd.pd_id; |
1476 | info->total_len = iwmr->length; | 1476 | info->total_len = iwmr->length; |
1477 | info->remote_access = true; | ||
1477 | cqp_info->cqp_cmd = OP_ALLOC_STAG; | 1478 | cqp_info->cqp_cmd = OP_ALLOC_STAG; |
1478 | cqp_info->post_sq = 1; | 1479 | cqp_info->post_sq = 1; |
1479 | cqp_info->in.u.alloc_stag.dev = &iwdev->sc_dev; | 1480 | cqp_info->in.u.alloc_stag.dev = &iwdev->sc_dev; |
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 3438e98c145a..a529a4535457 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
@@ -1431,6 +1431,9 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
1431 | int ep_irq_in_idx; | 1431 | int ep_irq_in_idx; |
1432 | int i, error; | 1432 | int i, error; |
1433 | 1433 | ||
1434 | if (intf->cur_altsetting->desc.bNumEndpoints != 2) | ||
1435 | return -ENODEV; | ||
1436 | |||
1434 | for (i = 0; xpad_device[i].idVendor; i++) { | 1437 | for (i = 0; xpad_device[i].idVendor; i++) { |
1435 | if ((le16_to_cpu(udev->descriptor.idVendor) == xpad_device[i].idVendor) && | 1438 | if ((le16_to_cpu(udev->descriptor.idVendor) == xpad_device[i].idVendor) && |
1436 | (le16_to_cpu(udev->descriptor.idProduct) == xpad_device[i].idProduct)) | 1439 | (le16_to_cpu(udev->descriptor.idProduct) == xpad_device[i].idProduct)) |
diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c index b368b0515c5a..253df96be427 100644 --- a/drivers/input/rmi4/rmi_bus.c +++ b/drivers/input/rmi4/rmi_bus.c | |||
@@ -157,11 +157,11 @@ static int rmi_function_match(struct device *dev, struct device_driver *drv) | |||
157 | static void rmi_function_of_probe(struct rmi_function *fn) | 157 | static void rmi_function_of_probe(struct rmi_function *fn) |
158 | { | 158 | { |
159 | char of_name[9]; | 159 | char of_name[9]; |
160 | struct device_node *node = fn->rmi_dev->xport->dev->of_node; | ||
160 | 161 | ||
161 | snprintf(of_name, sizeof(of_name), "rmi4-f%02x", | 162 | snprintf(of_name, sizeof(of_name), "rmi4-f%02x", |
162 | fn->fd.function_number); | 163 | fn->fd.function_number); |
163 | fn->dev.of_node = of_find_node_by_name( | 164 | fn->dev.of_node = of_get_child_by_name(node, of_name); |
164 | fn->rmi_dev->xport->dev->of_node, of_name); | ||
165 | } | 165 | } |
166 | #else | 166 | #else |
167 | static inline void rmi_function_of_probe(struct rmi_function *fn) | 167 | static inline void rmi_function_of_probe(struct rmi_function *fn) |
diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c index 8dd3fb5e1f94..88e91559c84e 100644 --- a/drivers/input/rmi4/rmi_f12.c +++ b/drivers/input/rmi4/rmi_f12.c | |||
@@ -66,7 +66,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12) | |||
66 | struct rmi_device *rmi_dev = fn->rmi_dev; | 66 | struct rmi_device *rmi_dev = fn->rmi_dev; |
67 | int ret; | 67 | int ret; |
68 | int offset; | 68 | int offset; |
69 | u8 buf[14]; | 69 | u8 buf[15]; |
70 | int pitch_x = 0; | 70 | int pitch_x = 0; |
71 | int pitch_y = 0; | 71 | int pitch_y = 0; |
72 | int clip_x_low = 0; | 72 | int clip_x_low = 0; |
@@ -86,9 +86,10 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12) | |||
86 | 86 | ||
87 | offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8); | 87 | offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8); |
88 | 88 | ||
89 | if (item->reg_size > 14) { | 89 | if (item->reg_size > sizeof(buf)) { |
90 | dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n", | 90 | dev_err(&fn->dev, |
91 | item->reg_size); | 91 | "F12 control8 should be no bigger than %zd bytes, not: %ld\n", |
92 | sizeof(buf), item->reg_size); | ||
92 | return -ENODEV; | 93 | return -ENODEV; |
93 | } | 94 | } |
94 | 95 | ||
diff --git a/drivers/input/touchscreen/ts4800-ts.c b/drivers/input/touchscreen/ts4800-ts.c index 3c3dd78303be..fed73eeb47b3 100644 --- a/drivers/input/touchscreen/ts4800-ts.c +++ b/drivers/input/touchscreen/ts4800-ts.c | |||
@@ -118,6 +118,13 @@ static int ts4800_parse_dt(struct platform_device *pdev, | |||
118 | return -ENODEV; | 118 | return -ENODEV; |
119 | } | 119 | } |
120 | 120 | ||
121 | ts->regmap = syscon_node_to_regmap(syscon_np); | ||
122 | of_node_put(syscon_np); | ||
123 | if (IS_ERR(ts->regmap)) { | ||
124 | dev_err(dev, "cannot get parent's regmap\n"); | ||
125 | return PTR_ERR(ts->regmap); | ||
126 | } | ||
127 | |||
121 | error = of_property_read_u32_index(np, "syscon", 1, ®); | 128 | error = of_property_read_u32_index(np, "syscon", 1, ®); |
122 | if (error < 0) { | 129 | if (error < 0) { |
123 | dev_err(dev, "no offset in syscon\n"); | 130 | dev_err(dev, "no offset in syscon\n"); |
@@ -134,12 +141,6 @@ static int ts4800_parse_dt(struct platform_device *pdev, | |||
134 | 141 | ||
135 | ts->bit = BIT(bit); | 142 | ts->bit = BIT(bit); |
136 | 143 | ||
137 | ts->regmap = syscon_node_to_regmap(syscon_np); | ||
138 | if (IS_ERR(ts->regmap)) { | ||
139 | dev_err(dev, "cannot get parent's regmap\n"); | ||
140 | return PTR_ERR(ts->regmap); | ||
141 | } | ||
142 | |||
143 | return 0; | 144 | return 0; |
144 | } | 145 | } |
145 | 146 | ||
diff --git a/drivers/input/touchscreen/tsc2004.c b/drivers/input/touchscreen/tsc2004.c index 7295c198aa08..6fe55d598fac 100644 --- a/drivers/input/touchscreen/tsc2004.c +++ b/drivers/input/touchscreen/tsc2004.c | |||
@@ -22,6 +22,11 @@ | |||
22 | #include <linux/regmap.h> | 22 | #include <linux/regmap.h> |
23 | #include "tsc200x-core.h" | 23 | #include "tsc200x-core.h" |
24 | 24 | ||
25 | static const struct input_id tsc2004_input_id = { | ||
26 | .bustype = BUS_I2C, | ||
27 | .product = 2004, | ||
28 | }; | ||
29 | |||
25 | static int tsc2004_cmd(struct device *dev, u8 cmd) | 30 | static int tsc2004_cmd(struct device *dev, u8 cmd) |
26 | { | 31 | { |
27 | u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd; | 32 | u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd; |
@@ -42,7 +47,7 @@ static int tsc2004_probe(struct i2c_client *i2c, | |||
42 | const struct i2c_device_id *id) | 47 | const struct i2c_device_id *id) |
43 | 48 | ||
44 | { | 49 | { |
45 | return tsc200x_probe(&i2c->dev, i2c->irq, BUS_I2C, | 50 | return tsc200x_probe(&i2c->dev, i2c->irq, &tsc2004_input_id, |
46 | devm_regmap_init_i2c(i2c, &tsc200x_regmap_config), | 51 | devm_regmap_init_i2c(i2c, &tsc200x_regmap_config), |
47 | tsc2004_cmd); | 52 | tsc2004_cmd); |
48 | } | 53 | } |
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index b9f593dfd2ef..f2c5f0e47f77 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c | |||
@@ -24,6 +24,11 @@ | |||
24 | #include <linux/regmap.h> | 24 | #include <linux/regmap.h> |
25 | #include "tsc200x-core.h" | 25 | #include "tsc200x-core.h" |
26 | 26 | ||
27 | static const struct input_id tsc2005_input_id = { | ||
28 | .bustype = BUS_SPI, | ||
29 | .product = 2005, | ||
30 | }; | ||
31 | |||
27 | static int tsc2005_cmd(struct device *dev, u8 cmd) | 32 | static int tsc2005_cmd(struct device *dev, u8 cmd) |
28 | { | 33 | { |
29 | u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd; | 34 | u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd; |
@@ -62,7 +67,7 @@ static int tsc2005_probe(struct spi_device *spi) | |||
62 | if (error) | 67 | if (error) |
63 | return error; | 68 | return error; |
64 | 69 | ||
65 | return tsc200x_probe(&spi->dev, spi->irq, BUS_SPI, | 70 | return tsc200x_probe(&spi->dev, spi->irq, &tsc2005_input_id, |
66 | devm_regmap_init_spi(spi, &tsc200x_regmap_config), | 71 | devm_regmap_init_spi(spi, &tsc200x_regmap_config), |
67 | tsc2005_cmd); | 72 | tsc2005_cmd); |
68 | } | 73 | } |
diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c index 15240c1ee850..dfa7f1c4f545 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c | |||
@@ -450,7 +450,7 @@ static void tsc200x_close(struct input_dev *input) | |||
450 | mutex_unlock(&ts->mutex); | 450 | mutex_unlock(&ts->mutex); |
451 | } | 451 | } |
452 | 452 | ||
453 | int tsc200x_probe(struct device *dev, int irq, __u16 bustype, | 453 | int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, |
454 | struct regmap *regmap, | 454 | struct regmap *regmap, |
455 | int (*tsc200x_cmd)(struct device *dev, u8 cmd)) | 455 | int (*tsc200x_cmd)(struct device *dev, u8 cmd)) |
456 | { | 456 | { |
@@ -547,9 +547,18 @@ int tsc200x_probe(struct device *dev, int irq, __u16 bustype, | |||
547 | snprintf(ts->phys, sizeof(ts->phys), | 547 | snprintf(ts->phys, sizeof(ts->phys), |
548 | "%s/input-ts", dev_name(dev)); | 548 | "%s/input-ts", dev_name(dev)); |
549 | 549 | ||
550 | input_dev->name = "TSC200X touchscreen"; | 550 | if (tsc_id->product == 2004) { |
551 | input_dev->name = "TSC200X touchscreen"; | ||
552 | } else { | ||
553 | input_dev->name = devm_kasprintf(dev, GFP_KERNEL, | ||
554 | "TSC%04d touchscreen", | ||
555 | tsc_id->product); | ||
556 | if (!input_dev->name) | ||
557 | return -ENOMEM; | ||
558 | } | ||
559 | |||
551 | input_dev->phys = ts->phys; | 560 | input_dev->phys = ts->phys; |
552 | input_dev->id.bustype = bustype; | 561 | input_dev->id = *tsc_id; |
553 | input_dev->dev.parent = dev; | 562 | input_dev->dev.parent = dev; |
554 | input_dev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY); | 563 | input_dev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY); |
555 | input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); | 564 | input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); |
diff --git a/drivers/input/touchscreen/tsc200x-core.h b/drivers/input/touchscreen/tsc200x-core.h index 7a482d102614..49a63a3c6840 100644 --- a/drivers/input/touchscreen/tsc200x-core.h +++ b/drivers/input/touchscreen/tsc200x-core.h | |||
@@ -70,7 +70,7 @@ | |||
70 | extern const struct regmap_config tsc200x_regmap_config; | 70 | extern const struct regmap_config tsc200x_regmap_config; |
71 | extern const struct dev_pm_ops tsc200x_pm_ops; | 71 | extern const struct dev_pm_ops tsc200x_pm_ops; |
72 | 72 | ||
73 | int tsc200x_probe(struct device *dev, int irq, __u16 bustype, | 73 | int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, |
74 | struct regmap *regmap, | 74 | struct regmap *regmap, |
75 | int (*tsc200x_cmd)(struct device *dev, u8 cmd)); | 75 | int (*tsc200x_cmd)(struct device *dev, u8 cmd)); |
76 | int tsc200x_remove(struct device *dev); | 76 | int tsc200x_remove(struct device *dev); |
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 0c9191cf324d..b6fc4bde79de 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c | |||
@@ -155,6 +155,7 @@ static void parse_multi_touch(struct w8001 *w8001) | |||
155 | bool touch = data[0] & (1 << i); | 155 | bool touch = data[0] & (1 << i); |
156 | 156 | ||
157 | input_mt_slot(dev, i); | 157 | input_mt_slot(dev, i); |
158 | input_mt_report_slot_state(dev, MT_TOOL_FINGER, touch); | ||
158 | if (touch) { | 159 | if (touch) { |
159 | x = (data[6 * i + 1] << 7) | data[6 * i + 2]; | 160 | x = (data[6 * i + 1] << 7) | data[6 * i + 2]; |
160 | y = (data[6 * i + 3] << 7) | data[6 * i + 4]; | 161 | y = (data[6 * i + 3] << 7) | data[6 * i + 4]; |
@@ -522,6 +523,8 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, | |||
522 | 0, touch.x, 0, 0); | 523 | 0, touch.x, 0, 0); |
523 | input_set_abs_params(dev, ABS_MT_POSITION_Y, | 524 | input_set_abs_params(dev, ABS_MT_POSITION_Y, |
524 | 0, touch.y, 0, 0); | 525 | 0, touch.y, 0, 0); |
526 | input_set_abs_params(dev, ABS_MT_TOOL_TYPE, | ||
527 | 0, MT_TOOL_MAX, 0, 0); | ||
525 | 528 | ||
526 | strlcat(basename, " 2FG", basename_sz); | 529 | strlcat(basename, " 2FG", basename_sz); |
527 | if (w8001->max_pen_x && w8001->max_pen_y) | 530 | if (w8001->max_pen_x && w8001->max_pen_y) |
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index d091defc3426..59741ead7e15 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -1568,13 +1568,23 @@ static int __init amd_iommu_init_pci(void) | |||
1568 | break; | 1568 | break; |
1569 | } | 1569 | } |
1570 | 1570 | ||
1571 | /* | ||
1572 | * Order is important here to make sure any unity map requirements are | ||
1573 | * fulfilled. The unity mappings are created and written to the device | ||
1574 | * table during the amd_iommu_init_api() call. | ||
1575 | * | ||
1576 | * After that we call init_device_table_dma() to make sure any | ||
1577 | * uninitialized DTE will block DMA, and in the end we flush the caches | ||
1578 | * of all IOMMUs to make sure the changes to the device table are | ||
1579 | * active. | ||
1580 | */ | ||
1581 | ret = amd_iommu_init_api(); | ||
1582 | |||
1571 | init_device_table_dma(); | 1583 | init_device_table_dma(); |
1572 | 1584 | ||
1573 | for_each_iommu(iommu) | 1585 | for_each_iommu(iommu) |
1574 | iommu_flush_all_caches(iommu); | 1586 | iommu_flush_all_caches(iommu); |
1575 | 1587 | ||
1576 | ret = amd_iommu_init_api(); | ||
1577 | |||
1578 | if (!ret) | 1588 | if (!ret) |
1579 | print_iommu_info(); | 1589 | print_iommu_info(); |
1580 | 1590 | ||
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index cfe410eedaf0..323dac9900ba 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -4602,13 +4602,13 @@ static void free_all_cpu_cached_iovas(unsigned int cpu) | |||
4602 | for (i = 0; i < g_num_of_iommus; i++) { | 4602 | for (i = 0; i < g_num_of_iommus; i++) { |
4603 | struct intel_iommu *iommu = g_iommus[i]; | 4603 | struct intel_iommu *iommu = g_iommus[i]; |
4604 | struct dmar_domain *domain; | 4604 | struct dmar_domain *domain; |
4605 | u16 did; | 4605 | int did; |
4606 | 4606 | ||
4607 | if (!iommu) | 4607 | if (!iommu) |
4608 | continue; | 4608 | continue; |
4609 | 4609 | ||
4610 | for (did = 0; did < cap_ndoms(iommu->cap); did++) { | 4610 | for (did = 0; did < cap_ndoms(iommu->cap); did++) { |
4611 | domain = get_iommu_domain(iommu, did); | 4611 | domain = get_iommu_domain(iommu, (u16)did); |
4612 | 4612 | ||
4613 | if (!domain) | 4613 | if (!domain) |
4614 | continue; | 4614 | continue; |
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 8a4adbeb2b8c..70ed1d0151b8 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c | |||
@@ -718,7 +718,7 @@ static int gic_shared_irq_domain_map(struct irq_domain *d, unsigned int virq, | |||
718 | 718 | ||
719 | spin_lock_irqsave(&gic_lock, flags); | 719 | spin_lock_irqsave(&gic_lock, flags); |
720 | gic_map_to_pin(intr, gic_cpu_pin); | 720 | gic_map_to_pin(intr, gic_cpu_pin); |
721 | gic_map_to_vpe(intr, vpe); | 721 | gic_map_to_vpe(intr, mips_cm_vp_id(vpe)); |
722 | for (i = 0; i < min(gic_vpes, NR_CPUS); i++) | 722 | for (i = 0; i < min(gic_vpes, NR_CPUS); i++) |
723 | clear_bit(intr, pcpu_masks[i].pcpu_mask); | 723 | clear_bit(intr, pcpu_masks[i].pcpu_mask); |
724 | set_bit(intr, pcpu_masks[vpe].pcpu_mask); | 724 | set_bit(intr, pcpu_masks[vpe].pcpu_mask); |
@@ -959,7 +959,7 @@ int gic_ipi_domain_match(struct irq_domain *d, struct device_node *node, | |||
959 | switch (bus_token) { | 959 | switch (bus_token) { |
960 | case DOMAIN_BUS_IPI: | 960 | case DOMAIN_BUS_IPI: |
961 | is_ipi = d->bus_token == bus_token; | 961 | is_ipi = d->bus_token == bus_token; |
962 | return to_of_node(d->fwnode) == node && is_ipi; | 962 | return (!node || to_of_node(d->fwnode) == node) && is_ipi; |
963 | break; | 963 | break; |
964 | default: | 964 | default: |
965 | return 0; | 965 | return 0; |
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index beb2841ceae5..3f1ab4986cfc 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c | |||
@@ -779,11 +779,31 @@ static const struct v4l2_dv_timings_cap adv76xx_timings_cap_digital = { | |||
779 | V4L2_DV_BT_CAP_CUSTOM) | 779 | V4L2_DV_BT_CAP_CUSTOM) |
780 | }; | 780 | }; |
781 | 781 | ||
782 | static inline const struct v4l2_dv_timings_cap * | 782 | /* |
783 | adv76xx_get_dv_timings_cap(struct v4l2_subdev *sd) | 783 | * Return the DV timings capabilities for the requested sink pad. As a special |
784 | * case, pad value -1 returns the capabilities for the currently selected input. | ||
785 | */ | ||
786 | static const struct v4l2_dv_timings_cap * | ||
787 | adv76xx_get_dv_timings_cap(struct v4l2_subdev *sd, int pad) | ||
784 | { | 788 | { |
785 | return is_digital_input(sd) ? &adv76xx_timings_cap_digital : | 789 | if (pad == -1) { |
786 | &adv7604_timings_cap_analog; | 790 | struct adv76xx_state *state = to_state(sd); |
791 | |||
792 | pad = state->selected_input; | ||
793 | } | ||
794 | |||
795 | switch (pad) { | ||
796 | case ADV76XX_PAD_HDMI_PORT_A: | ||
797 | case ADV7604_PAD_HDMI_PORT_B: | ||
798 | case ADV7604_PAD_HDMI_PORT_C: | ||
799 | case ADV7604_PAD_HDMI_PORT_D: | ||
800 | return &adv76xx_timings_cap_digital; | ||
801 | |||
802 | case ADV7604_PAD_VGA_RGB: | ||
803 | case ADV7604_PAD_VGA_COMP: | ||
804 | default: | ||
805 | return &adv7604_timings_cap_analog; | ||
806 | } | ||
787 | } | 807 | } |
788 | 808 | ||
789 | 809 | ||
@@ -1329,7 +1349,7 @@ static int stdi2dv_timings(struct v4l2_subdev *sd, | |||
1329 | const struct v4l2_bt_timings *bt = &v4l2_dv_timings_presets[i].bt; | 1349 | const struct v4l2_bt_timings *bt = &v4l2_dv_timings_presets[i].bt; |
1330 | 1350 | ||
1331 | if (!v4l2_valid_dv_timings(&v4l2_dv_timings_presets[i], | 1351 | if (!v4l2_valid_dv_timings(&v4l2_dv_timings_presets[i], |
1332 | adv76xx_get_dv_timings_cap(sd), | 1352 | adv76xx_get_dv_timings_cap(sd, -1), |
1333 | adv76xx_check_dv_timings, NULL)) | 1353 | adv76xx_check_dv_timings, NULL)) |
1334 | continue; | 1354 | continue; |
1335 | if (vtotal(bt) != stdi->lcf + 1) | 1355 | if (vtotal(bt) != stdi->lcf + 1) |
@@ -1430,18 +1450,22 @@ static int adv76xx_enum_dv_timings(struct v4l2_subdev *sd, | |||
1430 | return -EINVAL; | 1450 | return -EINVAL; |
1431 | 1451 | ||
1432 | return v4l2_enum_dv_timings_cap(timings, | 1452 | return v4l2_enum_dv_timings_cap(timings, |
1433 | adv76xx_get_dv_timings_cap(sd), adv76xx_check_dv_timings, NULL); | 1453 | adv76xx_get_dv_timings_cap(sd, timings->pad), |
1454 | adv76xx_check_dv_timings, NULL); | ||
1434 | } | 1455 | } |
1435 | 1456 | ||
1436 | static int adv76xx_dv_timings_cap(struct v4l2_subdev *sd, | 1457 | static int adv76xx_dv_timings_cap(struct v4l2_subdev *sd, |
1437 | struct v4l2_dv_timings_cap *cap) | 1458 | struct v4l2_dv_timings_cap *cap) |
1438 | { | 1459 | { |
1439 | struct adv76xx_state *state = to_state(sd); | 1460 | struct adv76xx_state *state = to_state(sd); |
1461 | unsigned int pad = cap->pad; | ||
1440 | 1462 | ||
1441 | if (cap->pad >= state->source_pad) | 1463 | if (cap->pad >= state->source_pad) |
1442 | return -EINVAL; | 1464 | return -EINVAL; |
1443 | 1465 | ||
1444 | *cap = *adv76xx_get_dv_timings_cap(sd); | 1466 | *cap = *adv76xx_get_dv_timings_cap(sd, pad); |
1467 | cap->pad = pad; | ||
1468 | |||
1445 | return 0; | 1469 | return 0; |
1446 | } | 1470 | } |
1447 | 1471 | ||
@@ -1450,9 +1474,9 @@ static int adv76xx_dv_timings_cap(struct v4l2_subdev *sd, | |||
1450 | static void adv76xx_fill_optional_dv_timings_fields(struct v4l2_subdev *sd, | 1474 | static void adv76xx_fill_optional_dv_timings_fields(struct v4l2_subdev *sd, |
1451 | struct v4l2_dv_timings *timings) | 1475 | struct v4l2_dv_timings *timings) |
1452 | { | 1476 | { |
1453 | v4l2_find_dv_timings_cap(timings, adv76xx_get_dv_timings_cap(sd), | 1477 | v4l2_find_dv_timings_cap(timings, adv76xx_get_dv_timings_cap(sd, -1), |
1454 | is_digital_input(sd) ? 250000 : 1000000, | 1478 | is_digital_input(sd) ? 250000 : 1000000, |
1455 | adv76xx_check_dv_timings, NULL); | 1479 | adv76xx_check_dv_timings, NULL); |
1456 | } | 1480 | } |
1457 | 1481 | ||
1458 | static unsigned int adv7604_read_hdmi_pixelclock(struct v4l2_subdev *sd) | 1482 | static unsigned int adv7604_read_hdmi_pixelclock(struct v4l2_subdev *sd) |
@@ -1620,7 +1644,7 @@ static int adv76xx_s_dv_timings(struct v4l2_subdev *sd, | |||
1620 | 1644 | ||
1621 | bt = &timings->bt; | 1645 | bt = &timings->bt; |
1622 | 1646 | ||
1623 | if (!v4l2_valid_dv_timings(timings, adv76xx_get_dv_timings_cap(sd), | 1647 | if (!v4l2_valid_dv_timings(timings, adv76xx_get_dv_timings_cap(sd, -1), |
1624 | adv76xx_check_dv_timings, NULL)) | 1648 | adv76xx_check_dv_timings, NULL)) |
1625 | return -ERANGE; | 1649 | return -ERANGE; |
1626 | 1650 | ||
diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 87c12930416f..92d9d4214c3a 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c | |||
@@ -1072,7 +1072,7 @@ static int airspy_probe(struct usb_interface *intf, | |||
1072 | if (ret) { | 1072 | if (ret) { |
1073 | dev_err(s->dev, "Failed to register as video device (%d)\n", | 1073 | dev_err(s->dev, "Failed to register as video device (%d)\n", |
1074 | ret); | 1074 | ret); |
1075 | goto err_unregister_v4l2_dev; | 1075 | goto err_free_controls; |
1076 | } | 1076 | } |
1077 | dev_info(s->dev, "Registered as %s\n", | 1077 | dev_info(s->dev, "Registered as %s\n", |
1078 | video_device_node_name(&s->vdev)); | 1078 | video_device_node_name(&s->vdev)); |
@@ -1081,7 +1081,6 @@ static int airspy_probe(struct usb_interface *intf, | |||
1081 | 1081 | ||
1082 | err_free_controls: | 1082 | err_free_controls: |
1083 | v4l2_ctrl_handler_free(&s->hdl); | 1083 | v4l2_ctrl_handler_free(&s->hdl); |
1084 | err_unregister_v4l2_dev: | ||
1085 | v4l2_device_unregister(&s->v4l2_dev); | 1084 | v4l2_device_unregister(&s->v4l2_dev); |
1086 | err_free_mem: | 1085 | err_free_mem: |
1087 | kfree(s); | 1086 | kfree(s); |
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 28e5be2c2eef..528390f33b53 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c | |||
@@ -2171,7 +2171,7 @@ static int v4l_cropcap(const struct v4l2_ioctl_ops *ops, | |||
2171 | * The determine_valid_ioctls() call already should ensure | 2171 | * The determine_valid_ioctls() call already should ensure |
2172 | * that this can never happen, but just in case... | 2172 | * that this can never happen, but just in case... |
2173 | */ | 2173 | */ |
2174 | if (WARN_ON(!ops->vidioc_cropcap && !ops->vidioc_cropcap)) | 2174 | if (WARN_ON(!ops->vidioc_cropcap && !ops->vidioc_g_selection)) |
2175 | return -ENOTTY; | 2175 | return -ENOTTY; |
2176 | 2176 | ||
2177 | if (ops->vidioc_cropcap) | 2177 | if (ops->vidioc_cropcap) |
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index e62fde3ac431..c5472e3c9231 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -355,8 +355,10 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( | |||
355 | goto idata_err; | 355 | goto idata_err; |
356 | } | 356 | } |
357 | 357 | ||
358 | if (!idata->buf_bytes) | 358 | if (!idata->buf_bytes) { |
359 | idata->buf = NULL; | ||
359 | return idata; | 360 | return idata; |
361 | } | ||
360 | 362 | ||
361 | idata->buf = kmalloc(idata->buf_bytes, GFP_KERNEL); | 363 | idata->buf = kmalloc(idata->buf_bytes, GFP_KERNEL); |
362 | if (!idata->buf) { | 364 | if (!idata->buf) { |
@@ -1786,8 +1788,8 @@ static void mmc_blk_packed_hdr_wrq_prep(struct mmc_queue_req *mqrq, | |||
1786 | 1788 | ||
1787 | packed_cmd_hdr = packed->cmd_hdr; | 1789 | packed_cmd_hdr = packed->cmd_hdr; |
1788 | memset(packed_cmd_hdr, 0, sizeof(packed->cmd_hdr)); | 1790 | memset(packed_cmd_hdr, 0, sizeof(packed->cmd_hdr)); |
1789 | packed_cmd_hdr[0] = (packed->nr_entries << 16) | | 1791 | packed_cmd_hdr[0] = cpu_to_le32((packed->nr_entries << 16) | |
1790 | (PACKED_CMD_WR << 8) | PACKED_CMD_VER; | 1792 | (PACKED_CMD_WR << 8) | PACKED_CMD_VER); |
1791 | hdr_blocks = mmc_large_sector(card) ? 8 : 1; | 1793 | hdr_blocks = mmc_large_sector(card) ? 8 : 1; |
1792 | 1794 | ||
1793 | /* | 1795 | /* |
@@ -1801,14 +1803,14 @@ static void mmc_blk_packed_hdr_wrq_prep(struct mmc_queue_req *mqrq, | |||
1801 | ((brq->data.blocks * brq->data.blksz) >= | 1803 | ((brq->data.blocks * brq->data.blksz) >= |
1802 | card->ext_csd.data_tag_unit_size); | 1804 | card->ext_csd.data_tag_unit_size); |
1803 | /* Argument of CMD23 */ | 1805 | /* Argument of CMD23 */ |
1804 | packed_cmd_hdr[(i * 2)] = | 1806 | packed_cmd_hdr[(i * 2)] = cpu_to_le32( |
1805 | (do_rel_wr ? MMC_CMD23_ARG_REL_WR : 0) | | 1807 | (do_rel_wr ? MMC_CMD23_ARG_REL_WR : 0) | |
1806 | (do_data_tag ? MMC_CMD23_ARG_TAG_REQ : 0) | | 1808 | (do_data_tag ? MMC_CMD23_ARG_TAG_REQ : 0) | |
1807 | blk_rq_sectors(prq); | 1809 | blk_rq_sectors(prq)); |
1808 | /* Argument of CMD18 or CMD25 */ | 1810 | /* Argument of CMD18 or CMD25 */ |
1809 | packed_cmd_hdr[((i * 2)) + 1] = | 1811 | packed_cmd_hdr[((i * 2)) + 1] = cpu_to_le32( |
1810 | mmc_card_blockaddr(card) ? | 1812 | mmc_card_blockaddr(card) ? |
1811 | blk_rq_pos(prq) : blk_rq_pos(prq) << 9; | 1813 | blk_rq_pos(prq) : blk_rq_pos(prq) << 9); |
1812 | packed->blocks += blk_rq_sectors(prq); | 1814 | packed->blocks += blk_rq_sectors(prq); |
1813 | i++; | 1815 | i++; |
1814 | } | 1816 | } |
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 86fac3e86833..c763b404510f 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c | |||
@@ -789,14 +789,16 @@ static int pxamci_probe(struct platform_device *pdev) | |||
789 | gpio_direction_output(gpio_power, | 789 | gpio_direction_output(gpio_power, |
790 | host->pdata->gpio_power_invert); | 790 | host->pdata->gpio_power_invert); |
791 | } | 791 | } |
792 | if (gpio_is_valid(gpio_ro)) | 792 | if (gpio_is_valid(gpio_ro)) { |
793 | ret = mmc_gpio_request_ro(mmc, gpio_ro); | 793 | ret = mmc_gpio_request_ro(mmc, gpio_ro); |
794 | if (ret) { | 794 | if (ret) { |
795 | dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", gpio_ro); | 795 | dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", |
796 | goto out; | 796 | gpio_ro); |
797 | } else { | 797 | goto out; |
798 | mmc->caps2 |= host->pdata->gpio_card_ro_invert ? | 798 | } else { |
799 | 0 : MMC_CAP2_RO_ACTIVE_HIGH; | 799 | mmc->caps2 |= host->pdata->gpio_card_ro_invert ? |
800 | 0 : MMC_CAP2_RO_ACTIVE_HIGH; | ||
801 | } | ||
800 | } | 802 | } |
801 | 803 | ||
802 | if (gpio_is_valid(gpio_cd)) | 804 | if (gpio_is_valid(gpio_cd)) |
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 08e158895635..a136da8df6fe 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -1657,8 +1657,11 @@ static int omap_get_dt_info(struct device *dev, struct omap_nand_info *info) | |||
1657 | 1657 | ||
1658 | /* detect availability of ELM module. Won't be present pre-OMAP4 */ | 1658 | /* detect availability of ELM module. Won't be present pre-OMAP4 */ |
1659 | info->elm_of_node = of_parse_phandle(child, "ti,elm-id", 0); | 1659 | info->elm_of_node = of_parse_phandle(child, "ti,elm-id", 0); |
1660 | if (!info->elm_of_node) | 1660 | if (!info->elm_of_node) { |
1661 | dev_dbg(dev, "ti,elm-id not in DT\n"); | 1661 | info->elm_of_node = of_parse_phandle(child, "elm_id", 0); |
1662 | if (!info->elm_of_node) | ||
1663 | dev_dbg(dev, "ti,elm-id not in DT\n"); | ||
1664 | } | ||
1662 | 1665 | ||
1663 | /* select ecc-scheme for NAND */ | 1666 | /* select ecc-scheme for NAND */ |
1664 | if (of_property_read_string(child, "ti,nand-ecc-opt", &s)) { | 1667 | if (of_property_read_string(child, "ti,nand-ecc-opt", &s)) { |
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c index db760e84119f..b8df0f5e8c25 100644 --- a/drivers/net/bonding/bond_netlink.c +++ b/drivers/net/bonding/bond_netlink.c | |||
@@ -446,7 +446,11 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev, | |||
446 | if (err < 0) | 446 | if (err < 0) |
447 | return err; | 447 | return err; |
448 | 448 | ||
449 | return register_netdevice(bond_dev); | 449 | err = register_netdevice(bond_dev); |
450 | |||
451 | netif_carrier_off(bond_dev); | ||
452 | |||
453 | return err; | ||
450 | } | 454 | } |
451 | 455 | ||
452 | static size_t bond_get_size(const struct net_device *bond_dev) | 456 | static size_t bond_get_size(const struct net_device *bond_dev) |
diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c index cd7e2e5f496b..c83ebae73d91 100644 --- a/drivers/net/ethernet/agere/et131x.c +++ b/drivers/net/ethernet/agere/et131x.c | |||
@@ -3827,7 +3827,7 @@ static void et131x_tx_timeout(struct net_device *netdev) | |||
3827 | unsigned long flags; | 3827 | unsigned long flags; |
3828 | 3828 | ||
3829 | /* If the device is closed, ignore the timeout */ | 3829 | /* If the device is closed, ignore the timeout */ |
3830 | if (~(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE)) | 3830 | if (!(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE)) |
3831 | return; | 3831 | return; |
3832 | 3832 | ||
3833 | /* Any nonrecoverable hardware error? | 3833 | /* Any nonrecoverable hardware error? |
diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index 0d3aa1d170ec..0d4ea92a0d37 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c | |||
@@ -259,6 +259,7 @@ static void nb8800_receive(struct net_device *dev, unsigned int i, | |||
259 | if (err) { | 259 | if (err) { |
260 | netdev_err(dev, "rx buffer allocation failed\n"); | 260 | netdev_err(dev, "rx buffer allocation failed\n"); |
261 | dev->stats.rx_dropped++; | 261 | dev->stats.rx_dropped++; |
262 | dev_kfree_skb(skb); | ||
262 | return; | 263 | return; |
263 | } | 264 | } |
264 | 265 | ||
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 13b072591332..c4751ece76f6 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c | |||
@@ -207,7 +207,7 @@ err_dma: | |||
207 | dma_unmap_single(dma_dev, slot->dma_addr, skb_headlen(skb), | 207 | dma_unmap_single(dma_dev, slot->dma_addr, skb_headlen(skb), |
208 | DMA_TO_DEVICE); | 208 | DMA_TO_DEVICE); |
209 | 209 | ||
210 | while (i > 0) { | 210 | while (i-- > 0) { |
211 | int index = (ring->end + i) % BGMAC_TX_RING_SLOTS; | 211 | int index = (ring->end + i) % BGMAC_TX_RING_SLOTS; |
212 | struct bgmac_slot_info *slot = &ring->slots[index]; | 212 | struct bgmac_slot_info *slot = &ring->slots[index]; |
213 | u32 ctl1 = le32_to_cpu(ring->cpu_base[index].ctl1); | 213 | u32 ctl1 = le32_to_cpu(ring->cpu_base[index].ctl1); |
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 492c06bc0406..b83e17403d6c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | |||
@@ -1692,7 +1692,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev, | |||
1692 | { | 1692 | { |
1693 | struct bnxt *bp = netdev_priv(dev); | 1693 | struct bnxt *bp = netdev_priv(dev); |
1694 | u16 start = eeprom->offset, length = eeprom->len; | 1694 | u16 start = eeprom->offset, length = eeprom->len; |
1695 | int rc; | 1695 | int rc = 0; |
1696 | 1696 | ||
1697 | memset(data, 0, eeprom->len); | 1697 | memset(data, 0, eeprom->len); |
1698 | 1698 | ||
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c index 37a39b41f335..c044667a0a25 100644 --- a/drivers/net/ethernet/ethoc.c +++ b/drivers/net/ethernet/ethoc.c | |||
@@ -857,6 +857,11 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
857 | unsigned int entry; | 857 | unsigned int entry; |
858 | void *dest; | 858 | void *dest; |
859 | 859 | ||
860 | if (skb_put_padto(skb, ETHOC_ZLEN)) { | ||
861 | dev->stats.tx_errors++; | ||
862 | goto out_no_free; | ||
863 | } | ||
864 | |||
860 | if (unlikely(skb->len > ETHOC_BUFSIZ)) { | 865 | if (unlikely(skb->len > ETHOC_BUFSIZ)) { |
861 | dev->stats.tx_errors++; | 866 | dev->stats.tx_errors++; |
862 | goto out; | 867 | goto out; |
@@ -891,6 +896,7 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
891 | skb_tx_timestamp(skb); | 896 | skb_tx_timestamp(skb); |
892 | out: | 897 | out: |
893 | dev_kfree_skb(skb); | 898 | dev_kfree_skb(skb); |
899 | out_no_free: | ||
894 | return NETDEV_TX_OK; | 900 | return NETDEV_TX_OK; |
895 | } | 901 | } |
896 | 902 | ||
@@ -1061,7 +1067,7 @@ static int ethoc_probe(struct platform_device *pdev) | |||
1061 | if (!priv->iobase) { | 1067 | if (!priv->iobase) { |
1062 | dev_err(&pdev->dev, "cannot remap I/O memory space\n"); | 1068 | dev_err(&pdev->dev, "cannot remap I/O memory space\n"); |
1063 | ret = -ENXIO; | 1069 | ret = -ENXIO; |
1064 | goto error; | 1070 | goto free; |
1065 | } | 1071 | } |
1066 | 1072 | ||
1067 | if (netdev->mem_end) { | 1073 | if (netdev->mem_end) { |
@@ -1070,7 +1076,7 @@ static int ethoc_probe(struct platform_device *pdev) | |||
1070 | if (!priv->membase) { | 1076 | if (!priv->membase) { |
1071 | dev_err(&pdev->dev, "cannot remap memory space\n"); | 1077 | dev_err(&pdev->dev, "cannot remap memory space\n"); |
1072 | ret = -ENXIO; | 1078 | ret = -ENXIO; |
1073 | goto error; | 1079 | goto free; |
1074 | } | 1080 | } |
1075 | } else { | 1081 | } else { |
1076 | /* Allocate buffer memory */ | 1082 | /* Allocate buffer memory */ |
@@ -1081,7 +1087,7 @@ static int ethoc_probe(struct platform_device *pdev) | |||
1081 | dev_err(&pdev->dev, "cannot allocate %dB buffer\n", | 1087 | dev_err(&pdev->dev, "cannot allocate %dB buffer\n", |
1082 | buffer_size); | 1088 | buffer_size); |
1083 | ret = -ENOMEM; | 1089 | ret = -ENOMEM; |
1084 | goto error; | 1090 | goto free; |
1085 | } | 1091 | } |
1086 | netdev->mem_end = netdev->mem_start + buffer_size; | 1092 | netdev->mem_end = netdev->mem_start + buffer_size; |
1087 | priv->dma_alloc = buffer_size; | 1093 | priv->dma_alloc = buffer_size; |
@@ -1095,7 +1101,7 @@ static int ethoc_probe(struct platform_device *pdev) | |||
1095 | 128, (netdev->mem_end - netdev->mem_start + 1) / ETHOC_BUFSIZ); | 1101 | 128, (netdev->mem_end - netdev->mem_start + 1) / ETHOC_BUFSIZ); |
1096 | if (num_bd < 4) { | 1102 | if (num_bd < 4) { |
1097 | ret = -ENODEV; | 1103 | ret = -ENODEV; |
1098 | goto error; | 1104 | goto free; |
1099 | } | 1105 | } |
1100 | priv->num_bd = num_bd; | 1106 | priv->num_bd = num_bd; |
1101 | /* num_tx must be a power of two */ | 1107 | /* num_tx must be a power of two */ |
@@ -1108,7 +1114,7 @@ static int ethoc_probe(struct platform_device *pdev) | |||
1108 | priv->vma = devm_kzalloc(&pdev->dev, num_bd*sizeof(void *), GFP_KERNEL); | 1114 | priv->vma = devm_kzalloc(&pdev->dev, num_bd*sizeof(void *), GFP_KERNEL); |
1109 | if (!priv->vma) { | 1115 | if (!priv->vma) { |
1110 | ret = -ENOMEM; | 1116 | ret = -ENOMEM; |
1111 | goto error; | 1117 | goto free; |
1112 | } | 1118 | } |
1113 | 1119 | ||
1114 | /* Allow the platform setup code to pass in a MAC address. */ | 1120 | /* Allow the platform setup code to pass in a MAC address. */ |
diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c index 25faa3dca9c0..f928e6f79c89 100644 --- a/drivers/net/ethernet/ezchip/nps_enet.c +++ b/drivers/net/ethernet/ezchip/nps_enet.c | |||
@@ -287,6 +287,7 @@ static void nps_enet_hw_reset(struct net_device *ndev) | |||
287 | ge_rst_value |= NPS_ENET_ENABLE << RST_GMAC_0_SHIFT; | 287 | ge_rst_value |= NPS_ENET_ENABLE << RST_GMAC_0_SHIFT; |
288 | nps_enet_reg_set(priv, NPS_ENET_REG_GE_RST, ge_rst_value); | 288 | nps_enet_reg_set(priv, NPS_ENET_REG_GE_RST, ge_rst_value); |
289 | usleep_range(10, 20); | 289 | usleep_range(10, 20); |
290 | ge_rst_value = 0; | ||
290 | nps_enet_reg_set(priv, NPS_ENET_REG_GE_RST, ge_rst_value); | 291 | nps_enet_reg_set(priv, NPS_ENET_REG_GE_RST, ge_rst_value); |
291 | 292 | ||
292 | /* Tx fifo reset sequence */ | 293 | /* Tx fifo reset sequence */ |
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index ecdb6854a898..88f3c85fb04a 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c | |||
@@ -75,6 +75,7 @@ | |||
75 | #include <linux/uaccess.h> | 75 | #include <linux/uaccess.h> |
76 | #include <asm/firmware.h> | 76 | #include <asm/firmware.h> |
77 | #include <linux/seq_file.h> | 77 | #include <linux/seq_file.h> |
78 | #include <linux/workqueue.h> | ||
78 | 79 | ||
79 | #include "ibmvnic.h" | 80 | #include "ibmvnic.h" |
80 | 81 | ||
@@ -89,6 +90,7 @@ MODULE_VERSION(IBMVNIC_DRIVER_VERSION); | |||
89 | static int ibmvnic_version = IBMVNIC_INITIAL_VERSION; | 90 | static int ibmvnic_version = IBMVNIC_INITIAL_VERSION; |
90 | static int ibmvnic_remove(struct vio_dev *); | 91 | static int ibmvnic_remove(struct vio_dev *); |
91 | static void release_sub_crqs(struct ibmvnic_adapter *); | 92 | static void release_sub_crqs(struct ibmvnic_adapter *); |
93 | static void release_sub_crqs_no_irqs(struct ibmvnic_adapter *); | ||
92 | static int ibmvnic_reset_crq(struct ibmvnic_adapter *); | 94 | static int ibmvnic_reset_crq(struct ibmvnic_adapter *); |
93 | static int ibmvnic_send_crq_init(struct ibmvnic_adapter *); | 95 | static int ibmvnic_send_crq_init(struct ibmvnic_adapter *); |
94 | static int ibmvnic_reenable_crq_queue(struct ibmvnic_adapter *); | 96 | static int ibmvnic_reenable_crq_queue(struct ibmvnic_adapter *); |
@@ -469,7 +471,8 @@ static int ibmvnic_open(struct net_device *netdev) | |||
469 | crq.logical_link_state.link_state = IBMVNIC_LOGICAL_LNK_UP; | 471 | crq.logical_link_state.link_state = IBMVNIC_LOGICAL_LNK_UP; |
470 | ibmvnic_send_crq(adapter, &crq); | 472 | ibmvnic_send_crq(adapter, &crq); |
471 | 473 | ||
472 | netif_start_queue(netdev); | 474 | netif_tx_start_all_queues(netdev); |
475 | |||
473 | return 0; | 476 | return 0; |
474 | 477 | ||
475 | bounce_map_failed: | 478 | bounce_map_failed: |
@@ -519,7 +522,7 @@ static int ibmvnic_close(struct net_device *netdev) | |||
519 | for (i = 0; i < adapter->req_rx_queues; i++) | 522 | for (i = 0; i < adapter->req_rx_queues; i++) |
520 | napi_disable(&adapter->napi[i]); | 523 | napi_disable(&adapter->napi[i]); |
521 | 524 | ||
522 | netif_stop_queue(netdev); | 525 | netif_tx_stop_all_queues(netdev); |
523 | 526 | ||
524 | if (adapter->bounce_buffer) { | 527 | if (adapter->bounce_buffer) { |
525 | if (!dma_mapping_error(dev, adapter->bounce_buffer_dma)) { | 528 | if (!dma_mapping_error(dev, adapter->bounce_buffer_dma)) { |
@@ -1212,12 +1215,6 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter | |||
1212 | goto reg_failed; | 1215 | goto reg_failed; |
1213 | } | 1216 | } |
1214 | 1217 | ||
1215 | scrq->irq = irq_create_mapping(NULL, scrq->hw_irq); | ||
1216 | if (scrq->irq == NO_IRQ) { | ||
1217 | dev_err(dev, "Error mapping irq\n"); | ||
1218 | goto map_irq_failed; | ||
1219 | } | ||
1220 | |||
1221 | scrq->adapter = adapter; | 1218 | scrq->adapter = adapter; |
1222 | scrq->size = 4 * PAGE_SIZE / sizeof(*scrq->msgs); | 1219 | scrq->size = 4 * PAGE_SIZE / sizeof(*scrq->msgs); |
1223 | scrq->cur = 0; | 1220 | scrq->cur = 0; |
@@ -1230,12 +1227,6 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter | |||
1230 | 1227 | ||
1231 | return scrq; | 1228 | return scrq; |
1232 | 1229 | ||
1233 | map_irq_failed: | ||
1234 | do { | ||
1235 | rc = plpar_hcall_norets(H_FREE_SUB_CRQ, | ||
1236 | adapter->vdev->unit_address, | ||
1237 | scrq->crq_num); | ||
1238 | } while (rc == H_BUSY || H_IS_LONG_BUSY(rc)); | ||
1239 | reg_failed: | 1230 | reg_failed: |
1240 | dma_unmap_single(dev, scrq->msg_token, 4 * PAGE_SIZE, | 1231 | dma_unmap_single(dev, scrq->msg_token, 4 * PAGE_SIZE, |
1241 | DMA_BIDIRECTIONAL); | 1232 | DMA_BIDIRECTIONAL); |
@@ -1256,6 +1247,7 @@ static void release_sub_crqs(struct ibmvnic_adapter *adapter) | |||
1256 | if (adapter->tx_scrq[i]) { | 1247 | if (adapter->tx_scrq[i]) { |
1257 | free_irq(adapter->tx_scrq[i]->irq, | 1248 | free_irq(adapter->tx_scrq[i]->irq, |
1258 | adapter->tx_scrq[i]); | 1249 | adapter->tx_scrq[i]); |
1250 | irq_dispose_mapping(adapter->tx_scrq[i]->irq); | ||
1259 | release_sub_crq_queue(adapter, | 1251 | release_sub_crq_queue(adapter, |
1260 | adapter->tx_scrq[i]); | 1252 | adapter->tx_scrq[i]); |
1261 | } | 1253 | } |
@@ -1267,6 +1259,7 @@ static void release_sub_crqs(struct ibmvnic_adapter *adapter) | |||
1267 | if (adapter->rx_scrq[i]) { | 1259 | if (adapter->rx_scrq[i]) { |
1268 | free_irq(adapter->rx_scrq[i]->irq, | 1260 | free_irq(adapter->rx_scrq[i]->irq, |
1269 | adapter->rx_scrq[i]); | 1261 | adapter->rx_scrq[i]); |
1262 | irq_dispose_mapping(adapter->rx_scrq[i]->irq); | ||
1270 | release_sub_crq_queue(adapter, | 1263 | release_sub_crq_queue(adapter, |
1271 | adapter->rx_scrq[i]); | 1264 | adapter->rx_scrq[i]); |
1272 | } | 1265 | } |
@@ -1276,6 +1269,29 @@ static void release_sub_crqs(struct ibmvnic_adapter *adapter) | |||
1276 | adapter->requested_caps = 0; | 1269 | adapter->requested_caps = 0; |
1277 | } | 1270 | } |
1278 | 1271 | ||
1272 | static void release_sub_crqs_no_irqs(struct ibmvnic_adapter *adapter) | ||
1273 | { | ||
1274 | int i; | ||
1275 | |||
1276 | if (adapter->tx_scrq) { | ||
1277 | for (i = 0; i < adapter->req_tx_queues; i++) | ||
1278 | if (adapter->tx_scrq[i]) | ||
1279 | release_sub_crq_queue(adapter, | ||
1280 | adapter->tx_scrq[i]); | ||
1281 | adapter->tx_scrq = NULL; | ||
1282 | } | ||
1283 | |||
1284 | if (adapter->rx_scrq) { | ||
1285 | for (i = 0; i < adapter->req_rx_queues; i++) | ||
1286 | if (adapter->rx_scrq[i]) | ||
1287 | release_sub_crq_queue(adapter, | ||
1288 | adapter->rx_scrq[i]); | ||
1289 | adapter->rx_scrq = NULL; | ||
1290 | } | ||
1291 | |||
1292 | adapter->requested_caps = 0; | ||
1293 | } | ||
1294 | |||
1279 | static int disable_scrq_irq(struct ibmvnic_adapter *adapter, | 1295 | static int disable_scrq_irq(struct ibmvnic_adapter *adapter, |
1280 | struct ibmvnic_sub_crq_queue *scrq) | 1296 | struct ibmvnic_sub_crq_queue *scrq) |
1281 | { | 1297 | { |
@@ -1395,6 +1411,66 @@ static irqreturn_t ibmvnic_interrupt_rx(int irq, void *instance) | |||
1395 | return IRQ_HANDLED; | 1411 | return IRQ_HANDLED; |
1396 | } | 1412 | } |
1397 | 1413 | ||
1414 | static int init_sub_crq_irqs(struct ibmvnic_adapter *adapter) | ||
1415 | { | ||
1416 | struct device *dev = &adapter->vdev->dev; | ||
1417 | struct ibmvnic_sub_crq_queue *scrq; | ||
1418 | int i = 0, j = 0; | ||
1419 | int rc = 0; | ||
1420 | |||
1421 | for (i = 0; i < adapter->req_tx_queues; i++) { | ||
1422 | scrq = adapter->tx_scrq[i]; | ||
1423 | scrq->irq = irq_create_mapping(NULL, scrq->hw_irq); | ||
1424 | |||
1425 | if (scrq->irq == NO_IRQ) { | ||
1426 | rc = -EINVAL; | ||
1427 | dev_err(dev, "Error mapping irq\n"); | ||
1428 | goto req_tx_irq_failed; | ||
1429 | } | ||
1430 | |||
1431 | rc = request_irq(scrq->irq, ibmvnic_interrupt_tx, | ||
1432 | 0, "ibmvnic_tx", scrq); | ||
1433 | |||
1434 | if (rc) { | ||
1435 | dev_err(dev, "Couldn't register tx irq 0x%x. rc=%d\n", | ||
1436 | scrq->irq, rc); | ||
1437 | irq_dispose_mapping(scrq->irq); | ||
1438 | goto req_rx_irq_failed; | ||
1439 | } | ||
1440 | } | ||
1441 | |||
1442 | for (i = 0; i < adapter->req_rx_queues; i++) { | ||
1443 | scrq = adapter->rx_scrq[i]; | ||
1444 | scrq->irq = irq_create_mapping(NULL, scrq->hw_irq); | ||
1445 | if (scrq->irq == NO_IRQ) { | ||
1446 | rc = -EINVAL; | ||
1447 | dev_err(dev, "Error mapping irq\n"); | ||
1448 | goto req_rx_irq_failed; | ||
1449 | } | ||
1450 | rc = request_irq(scrq->irq, ibmvnic_interrupt_rx, | ||
1451 | 0, "ibmvnic_rx", scrq); | ||
1452 | if (rc) { | ||
1453 | dev_err(dev, "Couldn't register rx irq 0x%x. rc=%d\n", | ||
1454 | scrq->irq, rc); | ||
1455 | irq_dispose_mapping(scrq->irq); | ||
1456 | goto req_rx_irq_failed; | ||
1457 | } | ||
1458 | } | ||
1459 | return rc; | ||
1460 | |||
1461 | req_rx_irq_failed: | ||
1462 | for (j = 0; j < i; j++) | ||
1463 | free_irq(adapter->rx_scrq[j]->irq, adapter->rx_scrq[j]); | ||
1464 | irq_dispose_mapping(adapter->rx_scrq[j]->irq); | ||
1465 | i = adapter->req_tx_queues; | ||
1466 | req_tx_irq_failed: | ||
1467 | for (j = 0; j < i; j++) | ||
1468 | free_irq(adapter->tx_scrq[j]->irq, adapter->tx_scrq[j]); | ||
1469 | irq_dispose_mapping(adapter->rx_scrq[j]->irq); | ||
1470 | release_sub_crqs_no_irqs(adapter); | ||
1471 | return rc; | ||
1472 | } | ||
1473 | |||
1398 | static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry) | 1474 | static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry) |
1399 | { | 1475 | { |
1400 | struct device *dev = &adapter->vdev->dev; | 1476 | struct device *dev = &adapter->vdev->dev; |
@@ -1403,8 +1479,7 @@ static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry) | |||
1403 | union ibmvnic_crq crq; | 1479 | union ibmvnic_crq crq; |
1404 | int total_queues; | 1480 | int total_queues; |
1405 | int more = 0; | 1481 | int more = 0; |
1406 | int i, j; | 1482 | int i; |
1407 | int rc; | ||
1408 | 1483 | ||
1409 | if (!retry) { | 1484 | if (!retry) { |
1410 | /* Sub-CRQ entries are 32 byte long */ | 1485 | /* Sub-CRQ entries are 32 byte long */ |
@@ -1483,13 +1558,6 @@ static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry) | |||
1483 | for (i = 0; i < adapter->req_tx_queues; i++) { | 1558 | for (i = 0; i < adapter->req_tx_queues; i++) { |
1484 | adapter->tx_scrq[i] = allqueues[i]; | 1559 | adapter->tx_scrq[i] = allqueues[i]; |
1485 | adapter->tx_scrq[i]->pool_index = i; | 1560 | adapter->tx_scrq[i]->pool_index = i; |
1486 | rc = request_irq(adapter->tx_scrq[i]->irq, ibmvnic_interrupt_tx, | ||
1487 | 0, "ibmvnic_tx", adapter->tx_scrq[i]); | ||
1488 | if (rc) { | ||
1489 | dev_err(dev, "Couldn't register tx irq 0x%x. rc=%d\n", | ||
1490 | adapter->tx_scrq[i]->irq, rc); | ||
1491 | goto req_tx_irq_failed; | ||
1492 | } | ||
1493 | } | 1561 | } |
1494 | 1562 | ||
1495 | adapter->rx_scrq = kcalloc(adapter->req_rx_queues, | 1563 | adapter->rx_scrq = kcalloc(adapter->req_rx_queues, |
@@ -1500,13 +1568,6 @@ static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry) | |||
1500 | for (i = 0; i < adapter->req_rx_queues; i++) { | 1568 | for (i = 0; i < adapter->req_rx_queues; i++) { |
1501 | adapter->rx_scrq[i] = allqueues[i + adapter->req_tx_queues]; | 1569 | adapter->rx_scrq[i] = allqueues[i + adapter->req_tx_queues]; |
1502 | adapter->rx_scrq[i]->scrq_num = i; | 1570 | adapter->rx_scrq[i]->scrq_num = i; |
1503 | rc = request_irq(adapter->rx_scrq[i]->irq, ibmvnic_interrupt_rx, | ||
1504 | 0, "ibmvnic_rx", adapter->rx_scrq[i]); | ||
1505 | if (rc) { | ||
1506 | dev_err(dev, "Couldn't register rx irq 0x%x. rc=%d\n", | ||
1507 | adapter->rx_scrq[i]->irq, rc); | ||
1508 | goto req_rx_irq_failed; | ||
1509 | } | ||
1510 | } | 1571 | } |
1511 | 1572 | ||
1512 | memset(&crq, 0, sizeof(crq)); | 1573 | memset(&crq, 0, sizeof(crq)); |
@@ -1559,15 +1620,6 @@ static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry) | |||
1559 | 1620 | ||
1560 | return; | 1621 | return; |
1561 | 1622 | ||
1562 | req_rx_irq_failed: | ||
1563 | for (j = 0; j < i; j++) | ||
1564 | free_irq(adapter->rx_scrq[j]->irq, adapter->rx_scrq[j]); | ||
1565 | i = adapter->req_tx_queues; | ||
1566 | req_tx_irq_failed: | ||
1567 | for (j = 0; j < i; j++) | ||
1568 | free_irq(adapter->tx_scrq[j]->irq, adapter->tx_scrq[j]); | ||
1569 | kfree(adapter->rx_scrq); | ||
1570 | adapter->rx_scrq = NULL; | ||
1571 | rx_failed: | 1623 | rx_failed: |
1572 | kfree(adapter->tx_scrq); | 1624 | kfree(adapter->tx_scrq); |
1573 | adapter->tx_scrq = NULL; | 1625 | adapter->tx_scrq = NULL; |
@@ -2348,9 +2400,9 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, | |||
2348 | *req_value, | 2400 | *req_value, |
2349 | (long int)be32_to_cpu(crq->request_capability_rsp. | 2401 | (long int)be32_to_cpu(crq->request_capability_rsp. |
2350 | number), name); | 2402 | number), name); |
2351 | release_sub_crqs(adapter); | 2403 | release_sub_crqs_no_irqs(adapter); |
2352 | *req_value = be32_to_cpu(crq->request_capability_rsp.number); | 2404 | *req_value = be32_to_cpu(crq->request_capability_rsp.number); |
2353 | complete(&adapter->init_done); | 2405 | init_sub_crqs(adapter, 1); |
2354 | return; | 2406 | return; |
2355 | default: | 2407 | default: |
2356 | dev_err(dev, "Error %d in request cap rsp\n", | 2408 | dev_err(dev, "Error %d in request cap rsp\n", |
@@ -2659,7 +2711,7 @@ static void handle_query_cap_rsp(union ibmvnic_crq *crq, | |||
2659 | 2711 | ||
2660 | out: | 2712 | out: |
2661 | if (atomic_read(&adapter->running_cap_queries) == 0) | 2713 | if (atomic_read(&adapter->running_cap_queries) == 0) |
2662 | complete(&adapter->init_done); | 2714 | init_sub_crqs(adapter, 0); |
2663 | /* We're done querying the capabilities, initialize sub-crqs */ | 2715 | /* We're done querying the capabilities, initialize sub-crqs */ |
2664 | } | 2716 | } |
2665 | 2717 | ||
@@ -3202,8 +3254,8 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, | |||
3202 | dev_info(dev, "Partner initialized\n"); | 3254 | dev_info(dev, "Partner initialized\n"); |
3203 | /* Send back a response */ | 3255 | /* Send back a response */ |
3204 | rc = ibmvnic_send_crq_init_complete(adapter); | 3256 | rc = ibmvnic_send_crq_init_complete(adapter); |
3205 | if (rc == 0) | 3257 | if (!rc) |
3206 | send_version_xchg(adapter); | 3258 | schedule_work(&adapter->vnic_crq_init); |
3207 | else | 3259 | else |
3208 | dev_err(dev, "Can't send initrsp rc=%ld\n", rc); | 3260 | dev_err(dev, "Can't send initrsp rc=%ld\n", rc); |
3209 | break; | 3261 | break; |
@@ -3555,8 +3607,63 @@ static const struct file_operations ibmvnic_dump_ops = { | |||
3555 | .release = single_release, | 3607 | .release = single_release, |
3556 | }; | 3608 | }; |
3557 | 3609 | ||
3610 | static void handle_crq_init_rsp(struct work_struct *work) | ||
3611 | { | ||
3612 | struct ibmvnic_adapter *adapter = container_of(work, | ||
3613 | struct ibmvnic_adapter, | ||
3614 | vnic_crq_init); | ||
3615 | struct device *dev = &adapter->vdev->dev; | ||
3616 | struct net_device *netdev = adapter->netdev; | ||
3617 | unsigned long timeout = msecs_to_jiffies(30000); | ||
3618 | int rc; | ||
3619 | |||
3620 | send_version_xchg(adapter); | ||
3621 | reinit_completion(&adapter->init_done); | ||
3622 | if (!wait_for_completion_timeout(&adapter->init_done, timeout)) { | ||
3623 | dev_err(dev, "Passive init timeout\n"); | ||
3624 | goto task_failed; | ||
3625 | } | ||
3626 | |||
3627 | do { | ||
3628 | if (adapter->renegotiate) { | ||
3629 | adapter->renegotiate = false; | ||
3630 | release_sub_crqs_no_irqs(adapter); | ||
3631 | send_cap_queries(adapter); | ||
3632 | |||
3633 | reinit_completion(&adapter->init_done); | ||
3634 | if (!wait_for_completion_timeout(&adapter->init_done, | ||
3635 | timeout)) { | ||
3636 | dev_err(dev, "Passive init timeout\n"); | ||
3637 | goto task_failed; | ||
3638 | } | ||
3639 | } | ||
3640 | } while (adapter->renegotiate); | ||
3641 | rc = init_sub_crq_irqs(adapter); | ||
3642 | |||
3643 | if (rc) | ||
3644 | goto task_failed; | ||
3645 | |||
3646 | netdev->real_num_tx_queues = adapter->req_tx_queues; | ||
3647 | |||
3648 | rc = register_netdev(netdev); | ||
3649 | if (rc) { | ||
3650 | dev_err(dev, | ||
3651 | "failed to register netdev rc=%d\n", rc); | ||
3652 | goto register_failed; | ||
3653 | } | ||
3654 | dev_info(dev, "ibmvnic registered\n"); | ||
3655 | |||
3656 | return; | ||
3657 | |||
3658 | register_failed: | ||
3659 | release_sub_crqs(adapter); | ||
3660 | task_failed: | ||
3661 | dev_err(dev, "Passive initialization was not successful\n"); | ||
3662 | } | ||
3663 | |||
3558 | static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) | 3664 | static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) |
3559 | { | 3665 | { |
3666 | unsigned long timeout = msecs_to_jiffies(30000); | ||
3560 | struct ibmvnic_adapter *adapter; | 3667 | struct ibmvnic_adapter *adapter; |
3561 | struct net_device *netdev; | 3668 | struct net_device *netdev; |
3562 | unsigned char *mac_addr_p; | 3669 | unsigned char *mac_addr_p; |
@@ -3593,6 +3700,8 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) | |||
3593 | netdev->ethtool_ops = &ibmvnic_ethtool_ops; | 3700 | netdev->ethtool_ops = &ibmvnic_ethtool_ops; |
3594 | SET_NETDEV_DEV(netdev, &dev->dev); | 3701 | SET_NETDEV_DEV(netdev, &dev->dev); |
3595 | 3702 | ||
3703 | INIT_WORK(&adapter->vnic_crq_init, handle_crq_init_rsp); | ||
3704 | |||
3596 | spin_lock_init(&adapter->stats_lock); | 3705 | spin_lock_init(&adapter->stats_lock); |
3597 | 3706 | ||
3598 | rc = ibmvnic_init_crq_queue(adapter); | 3707 | rc = ibmvnic_init_crq_queue(adapter); |
@@ -3635,30 +3744,26 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) | |||
3635 | ibmvnic_send_crq_init(adapter); | 3744 | ibmvnic_send_crq_init(adapter); |
3636 | 3745 | ||
3637 | init_completion(&adapter->init_done); | 3746 | init_completion(&adapter->init_done); |
3638 | wait_for_completion(&adapter->init_done); | 3747 | if (!wait_for_completion_timeout(&adapter->init_done, timeout)) |
3748 | return 0; | ||
3639 | 3749 | ||
3640 | do { | 3750 | do { |
3641 | adapter->renegotiate = false; | ||
3642 | |||
3643 | init_sub_crqs(adapter, 0); | ||
3644 | reinit_completion(&adapter->init_done); | ||
3645 | wait_for_completion(&adapter->init_done); | ||
3646 | |||
3647 | if (adapter->renegotiate) { | 3751 | if (adapter->renegotiate) { |
3648 | release_sub_crqs(adapter); | 3752 | adapter->renegotiate = false; |
3753 | release_sub_crqs_no_irqs(adapter); | ||
3649 | send_cap_queries(adapter); | 3754 | send_cap_queries(adapter); |
3650 | 3755 | ||
3651 | reinit_completion(&adapter->init_done); | 3756 | reinit_completion(&adapter->init_done); |
3652 | wait_for_completion(&adapter->init_done); | 3757 | if (!wait_for_completion_timeout(&adapter->init_done, |
3758 | timeout)) | ||
3759 | return 0; | ||
3653 | } | 3760 | } |
3654 | } while (adapter->renegotiate); | 3761 | } while (adapter->renegotiate); |
3655 | 3762 | ||
3656 | /* if init_sub_crqs is partially successful, retry */ | 3763 | rc = init_sub_crq_irqs(adapter); |
3657 | while (!adapter->tx_scrq || !adapter->rx_scrq) { | 3764 | if (rc) { |
3658 | init_sub_crqs(adapter, 1); | 3765 | dev_err(&dev->dev, "failed to initialize sub crq irqs\n"); |
3659 | 3766 | goto free_debugfs; | |
3660 | reinit_completion(&adapter->init_done); | ||
3661 | wait_for_completion(&adapter->init_done); | ||
3662 | } | 3767 | } |
3663 | 3768 | ||
3664 | netdev->real_num_tx_queues = adapter->req_tx_queues; | 3769 | netdev->real_num_tx_queues = adapter->req_tx_queues; |
@@ -3666,12 +3771,14 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) | |||
3666 | rc = register_netdev(netdev); | 3771 | rc = register_netdev(netdev); |
3667 | if (rc) { | 3772 | if (rc) { |
3668 | dev_err(&dev->dev, "failed to register netdev rc=%d\n", rc); | 3773 | dev_err(&dev->dev, "failed to register netdev rc=%d\n", rc); |
3669 | goto free_debugfs; | 3774 | goto free_sub_crqs; |
3670 | } | 3775 | } |
3671 | dev_info(&dev->dev, "ibmvnic registered\n"); | 3776 | dev_info(&dev->dev, "ibmvnic registered\n"); |
3672 | 3777 | ||
3673 | return 0; | 3778 | return 0; |
3674 | 3779 | ||
3780 | free_sub_crqs: | ||
3781 | release_sub_crqs(adapter); | ||
3675 | free_debugfs: | 3782 | free_debugfs: |
3676 | if (adapter->debugfs_dir && !IS_ERR(adapter->debugfs_dir)) | 3783 | if (adapter->debugfs_dir && !IS_ERR(adapter->debugfs_dir)) |
3677 | debugfs_remove_recursive(adapter->debugfs_dir); | 3784 | debugfs_remove_recursive(adapter->debugfs_dir); |
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h index 0b66a506a4e4..e82898fd518e 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.h +++ b/drivers/net/ethernet/ibm/ibmvnic.h | |||
@@ -1045,4 +1045,6 @@ struct ibmvnic_adapter { | |||
1045 | u64 opt_rxba_entries_per_subcrq; | 1045 | u64 opt_rxba_entries_per_subcrq; |
1046 | __be64 tx_rx_desc_req; | 1046 | __be64 tx_rx_desc_req; |
1047 | u8 map_id; | 1047 | u8 map_id; |
1048 | |||
1049 | struct work_struct vnic_crq_init; | ||
1048 | }; | 1050 | }; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 2b1140563a64..7e00cbd5ba13 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -1339,6 +1339,13 @@ struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi, | |||
1339 | if (!vsi || !macaddr) | 1339 | if (!vsi || !macaddr) |
1340 | return NULL; | 1340 | return NULL; |
1341 | 1341 | ||
1342 | /* Do not allow broadcast filter to be added since broadcast filter | ||
1343 | * is added as part of add VSI for any newly created VSI except | ||
1344 | * FDIR VSI | ||
1345 | */ | ||
1346 | if (is_broadcast_ether_addr(macaddr)) | ||
1347 | return NULL; | ||
1348 | |||
1342 | f = i40e_find_filter(vsi, macaddr, vlan, is_vf, is_netdev); | 1349 | f = i40e_find_filter(vsi, macaddr, vlan, is_vf, is_netdev); |
1343 | if (!f) { | 1350 | if (!f) { |
1344 | f = kzalloc(sizeof(*f), GFP_ATOMIC); | 1351 | f = kzalloc(sizeof(*f), GFP_ATOMIC); |
@@ -7740,10 +7747,11 @@ static int i40e_init_msix(struct i40e_pf *pf) | |||
7740 | * i40e_vsi_alloc_q_vector - Allocate memory for a single interrupt vector | 7747 | * i40e_vsi_alloc_q_vector - Allocate memory for a single interrupt vector |
7741 | * @vsi: the VSI being configured | 7748 | * @vsi: the VSI being configured |
7742 | * @v_idx: index of the vector in the vsi struct | 7749 | * @v_idx: index of the vector in the vsi struct |
7750 | * @cpu: cpu to be used on affinity_mask | ||
7743 | * | 7751 | * |
7744 | * We allocate one q_vector. If allocation fails we return -ENOMEM. | 7752 | * We allocate one q_vector. If allocation fails we return -ENOMEM. |
7745 | **/ | 7753 | **/ |
7746 | static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx) | 7754 | static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx, int cpu) |
7747 | { | 7755 | { |
7748 | struct i40e_q_vector *q_vector; | 7756 | struct i40e_q_vector *q_vector; |
7749 | 7757 | ||
@@ -7754,7 +7762,8 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx) | |||
7754 | 7762 | ||
7755 | q_vector->vsi = vsi; | 7763 | q_vector->vsi = vsi; |
7756 | q_vector->v_idx = v_idx; | 7764 | q_vector->v_idx = v_idx; |
7757 | cpumask_set_cpu(v_idx, &q_vector->affinity_mask); | 7765 | cpumask_set_cpu(cpu, &q_vector->affinity_mask); |
7766 | |||
7758 | if (vsi->netdev) | 7767 | if (vsi->netdev) |
7759 | netif_napi_add(vsi->netdev, &q_vector->napi, | 7768 | netif_napi_add(vsi->netdev, &q_vector->napi, |
7760 | i40e_napi_poll, NAPI_POLL_WEIGHT); | 7769 | i40e_napi_poll, NAPI_POLL_WEIGHT); |
@@ -7778,8 +7787,7 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx) | |||
7778 | static int i40e_vsi_alloc_q_vectors(struct i40e_vsi *vsi) | 7787 | static int i40e_vsi_alloc_q_vectors(struct i40e_vsi *vsi) |
7779 | { | 7788 | { |
7780 | struct i40e_pf *pf = vsi->back; | 7789 | struct i40e_pf *pf = vsi->back; |
7781 | int v_idx, num_q_vectors; | 7790 | int err, v_idx, num_q_vectors, current_cpu; |
7782 | int err; | ||
7783 | 7791 | ||
7784 | /* if not MSIX, give the one vector only to the LAN VSI */ | 7792 | /* if not MSIX, give the one vector only to the LAN VSI */ |
7785 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) | 7793 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) |
@@ -7789,10 +7797,15 @@ static int i40e_vsi_alloc_q_vectors(struct i40e_vsi *vsi) | |||
7789 | else | 7797 | else |
7790 | return -EINVAL; | 7798 | return -EINVAL; |
7791 | 7799 | ||
7800 | current_cpu = cpumask_first(cpu_online_mask); | ||
7801 | |||
7792 | for (v_idx = 0; v_idx < num_q_vectors; v_idx++) { | 7802 | for (v_idx = 0; v_idx < num_q_vectors; v_idx++) { |
7793 | err = i40e_vsi_alloc_q_vector(vsi, v_idx); | 7803 | err = i40e_vsi_alloc_q_vector(vsi, v_idx, current_cpu); |
7794 | if (err) | 7804 | if (err) |
7795 | goto err_out; | 7805 | goto err_out; |
7806 | current_cpu = cpumask_next(current_cpu, cpu_online_mask); | ||
7807 | if (unlikely(current_cpu >= nr_cpu_ids)) | ||
7808 | current_cpu = cpumask_first(cpu_online_mask); | ||
7796 | } | 7809 | } |
7797 | 7810 | ||
7798 | return 0; | 7811 | return 0; |
@@ -9174,6 +9187,7 @@ int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi) | |||
9174 | static int i40e_add_vsi(struct i40e_vsi *vsi) | 9187 | static int i40e_add_vsi(struct i40e_vsi *vsi) |
9175 | { | 9188 | { |
9176 | int ret = -ENODEV; | 9189 | int ret = -ENODEV; |
9190 | i40e_status aq_ret = 0; | ||
9177 | u8 laa_macaddr[ETH_ALEN]; | 9191 | u8 laa_macaddr[ETH_ALEN]; |
9178 | bool found_laa_mac_filter = false; | 9192 | bool found_laa_mac_filter = false; |
9179 | struct i40e_pf *pf = vsi->back; | 9193 | struct i40e_pf *pf = vsi->back; |
@@ -9363,6 +9377,18 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) | |||
9363 | vsi->seid = ctxt.seid; | 9377 | vsi->seid = ctxt.seid; |
9364 | vsi->id = ctxt.vsi_number; | 9378 | vsi->id = ctxt.vsi_number; |
9365 | } | 9379 | } |
9380 | /* Except FDIR VSI, for all othet VSI set the broadcast filter */ | ||
9381 | if (vsi->type != I40E_VSI_FDIR) { | ||
9382 | aq_ret = i40e_aq_set_vsi_broadcast(hw, vsi->seid, true, NULL); | ||
9383 | if (aq_ret) { | ||
9384 | ret = i40e_aq_rc_to_posix(aq_ret, | ||
9385 | hw->aq.asq_last_status); | ||
9386 | dev_info(&pf->pdev->dev, | ||
9387 | "set brdcast promisc failed, err %s, aq_err %s\n", | ||
9388 | i40e_stat_str(hw, aq_ret), | ||
9389 | i40e_aq_str(hw, hw->aq.asq_last_status)); | ||
9390 | } | ||
9391 | } | ||
9366 | 9392 | ||
9367 | spin_lock_bh(&vsi->mac_filter_list_lock); | 9393 | spin_lock_bh(&vsi->mac_filter_list_lock); |
9368 | /* If macvlan filters already exist, force them to get loaded */ | 9394 | /* If macvlan filters already exist, force them to get loaded */ |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 55f151fca1dc..a8868e1bf832 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -1280,8 +1280,8 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
1280 | union i40e_rx_desc *rx_desc) | 1280 | union i40e_rx_desc *rx_desc) |
1281 | { | 1281 | { |
1282 | struct i40e_rx_ptype_decoded decoded; | 1282 | struct i40e_rx_ptype_decoded decoded; |
1283 | bool ipv4, ipv6, tunnel = false; | ||
1284 | u32 rx_error, rx_status; | 1283 | u32 rx_error, rx_status; |
1284 | bool ipv4, ipv6; | ||
1285 | u8 ptype; | 1285 | u8 ptype; |
1286 | u64 qword; | 1286 | u64 qword; |
1287 | 1287 | ||
@@ -1336,19 +1336,23 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
1336 | if (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT)) | 1336 | if (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT)) |
1337 | return; | 1337 | return; |
1338 | 1338 | ||
1339 | /* The hardware supported by this driver does not validate outer | 1339 | /* If there is an outer header present that might contain a checksum |
1340 | * checksums for tunneled VXLAN or GENEVE frames. I don't agree | 1340 | * we need to bump the checksum level by 1 to reflect the fact that |
1341 | * with it but the specification states that you "MAY validate", it | 1341 | * we are indicating we validated the inner checksum. |
1342 | * doesn't make it a hard requirement so if we have validated the | ||
1343 | * inner checksum report CHECKSUM_UNNECESSARY. | ||
1344 | */ | 1342 | */ |
1345 | if (decoded.inner_prot & (I40E_RX_PTYPE_INNER_PROT_TCP | | 1343 | if (decoded.tunnel_type >= I40E_RX_PTYPE_TUNNEL_IP_GRENAT) |
1346 | I40E_RX_PTYPE_INNER_PROT_UDP | | 1344 | skb->csum_level = 1; |
1347 | I40E_RX_PTYPE_INNER_PROT_SCTP)) | 1345 | |
1348 | tunnel = true; | 1346 | /* Only report checksum unnecessary for TCP, UDP, or SCTP */ |
1349 | 1347 | switch (decoded.inner_prot) { | |
1350 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1348 | case I40E_RX_PTYPE_INNER_PROT_TCP: |
1351 | skb->csum_level = tunnel ? 1 : 0; | 1349 | case I40E_RX_PTYPE_INNER_PROT_UDP: |
1350 | case I40E_RX_PTYPE_INNER_PROT_SCTP: | ||
1351 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
1352 | /* fall though */ | ||
1353 | default: | ||
1354 | break; | ||
1355 | } | ||
1352 | 1356 | ||
1353 | return; | 1357 | return; |
1354 | 1358 | ||
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index be99189da925..79d99cd91b24 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c | |||
@@ -752,8 +752,8 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
752 | union i40e_rx_desc *rx_desc) | 752 | union i40e_rx_desc *rx_desc) |
753 | { | 753 | { |
754 | struct i40e_rx_ptype_decoded decoded; | 754 | struct i40e_rx_ptype_decoded decoded; |
755 | bool ipv4, ipv6, tunnel = false; | ||
756 | u32 rx_error, rx_status; | 755 | u32 rx_error, rx_status; |
756 | bool ipv4, ipv6; | ||
757 | u8 ptype; | 757 | u8 ptype; |
758 | u64 qword; | 758 | u64 qword; |
759 | 759 | ||
@@ -808,19 +808,23 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
808 | if (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT)) | 808 | if (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT)) |
809 | return; | 809 | return; |
810 | 810 | ||
811 | /* The hardware supported by this driver does not validate outer | 811 | /* If there is an outer header present that might contain a checksum |
812 | * checksums for tunneled VXLAN or GENEVE frames. I don't agree | 812 | * we need to bump the checksum level by 1 to reflect the fact that |
813 | * with it but the specification states that you "MAY validate", it | 813 | * we are indicating we validated the inner checksum. |
814 | * doesn't make it a hard requirement so if we have validated the | ||
815 | * inner checksum report CHECKSUM_UNNECESSARY. | ||
816 | */ | 814 | */ |
817 | if (decoded.inner_prot & (I40E_RX_PTYPE_INNER_PROT_TCP | | 815 | if (decoded.tunnel_type >= I40E_RX_PTYPE_TUNNEL_IP_GRENAT) |
818 | I40E_RX_PTYPE_INNER_PROT_UDP | | 816 | skb->csum_level = 1; |
819 | I40E_RX_PTYPE_INNER_PROT_SCTP)) | 817 | |
820 | tunnel = true; | 818 | /* Only report checksum unnecessary for TCP, UDP, or SCTP */ |
821 | 819 | switch (decoded.inner_prot) { | |
822 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 820 | case I40E_RX_PTYPE_INNER_PROT_TCP: |
823 | skb->csum_level = tunnel ? 1 : 0; | 821 | case I40E_RX_PTYPE_INNER_PROT_UDP: |
822 | case I40E_RX_PTYPE_INNER_PROT_SCTP: | ||
823 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
824 | /* fall though */ | ||
825 | default: | ||
826 | break; | ||
827 | } | ||
824 | 828 | ||
825 | return; | 829 | return; |
826 | 830 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 918b94baca81..fdbea54901ec 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -2887,7 +2887,7 @@ int ixgbe_poll(struct napi_struct *napi, int budget) | |||
2887 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | 2887 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) |
2888 | ixgbe_irq_enable_queues(adapter, BIT_ULL(q_vector->v_idx)); | 2888 | ixgbe_irq_enable_queues(adapter, BIT_ULL(q_vector->v_idx)); |
2889 | 2889 | ||
2890 | return 0; | 2890 | return min(work_done, budget - 1); |
2891 | } | 2891 | } |
2892 | 2892 | ||
2893 | /** | 2893 | /** |
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index d5d263bda333..f92018b13d28 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -244,7 +244,7 @@ | |||
244 | /* Various constants */ | 244 | /* Various constants */ |
245 | 245 | ||
246 | /* Coalescing */ | 246 | /* Coalescing */ |
247 | #define MVNETA_TXDONE_COAL_PKTS 1 | 247 | #define MVNETA_TXDONE_COAL_PKTS 0 /* interrupt per packet */ |
248 | #define MVNETA_RX_COAL_PKTS 32 | 248 | #define MVNETA_RX_COAL_PKTS 32 |
249 | #define MVNETA_RX_COAL_USEC 100 | 249 | #define MVNETA_RX_COAL_USEC 100 |
250 | 250 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index f32e272c83dd..bdda17d2ea0f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | |||
@@ -1042,6 +1042,8 @@ static int mlx4_en_set_ringparam(struct net_device *dev, | |||
1042 | { | 1042 | { |
1043 | struct mlx4_en_priv *priv = netdev_priv(dev); | 1043 | struct mlx4_en_priv *priv = netdev_priv(dev); |
1044 | struct mlx4_en_dev *mdev = priv->mdev; | 1044 | struct mlx4_en_dev *mdev = priv->mdev; |
1045 | struct mlx4_en_port_profile new_prof; | ||
1046 | struct mlx4_en_priv *tmp; | ||
1045 | u32 rx_size, tx_size; | 1047 | u32 rx_size, tx_size; |
1046 | int port_up = 0; | 1048 | int port_up = 0; |
1047 | int err = 0; | 1049 | int err = 0; |
@@ -1061,22 +1063,25 @@ static int mlx4_en_set_ringparam(struct net_device *dev, | |||
1061 | tx_size == priv->tx_ring[0]->size) | 1063 | tx_size == priv->tx_ring[0]->size) |
1062 | return 0; | 1064 | return 0; |
1063 | 1065 | ||
1066 | tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); | ||
1067 | if (!tmp) | ||
1068 | return -ENOMEM; | ||
1069 | |||
1064 | mutex_lock(&mdev->state_lock); | 1070 | mutex_lock(&mdev->state_lock); |
1071 | memcpy(&new_prof, priv->prof, sizeof(struct mlx4_en_port_profile)); | ||
1072 | new_prof.tx_ring_size = tx_size; | ||
1073 | new_prof.rx_ring_size = rx_size; | ||
1074 | err = mlx4_en_try_alloc_resources(priv, tmp, &new_prof); | ||
1075 | if (err) | ||
1076 | goto out; | ||
1077 | |||
1065 | if (priv->port_up) { | 1078 | if (priv->port_up) { |
1066 | port_up = 1; | 1079 | port_up = 1; |
1067 | mlx4_en_stop_port(dev, 1); | 1080 | mlx4_en_stop_port(dev, 1); |
1068 | } | 1081 | } |
1069 | 1082 | ||
1070 | mlx4_en_free_resources(priv); | 1083 | mlx4_en_safe_replace_resources(priv, tmp); |
1071 | |||
1072 | priv->prof->tx_ring_size = tx_size; | ||
1073 | priv->prof->rx_ring_size = rx_size; | ||
1074 | 1084 | ||
1075 | err = mlx4_en_alloc_resources(priv); | ||
1076 | if (err) { | ||
1077 | en_err(priv, "Failed reallocating port resources\n"); | ||
1078 | goto out; | ||
1079 | } | ||
1080 | if (port_up) { | 1085 | if (port_up) { |
1081 | err = mlx4_en_start_port(dev); | 1086 | err = mlx4_en_start_port(dev); |
1082 | if (err) | 1087 | if (err) |
@@ -1084,8 +1089,8 @@ static int mlx4_en_set_ringparam(struct net_device *dev, | |||
1084 | } | 1089 | } |
1085 | 1090 | ||
1086 | err = mlx4_en_moderation_update(priv); | 1091 | err = mlx4_en_moderation_update(priv); |
1087 | |||
1088 | out: | 1092 | out: |
1093 | kfree(tmp); | ||
1089 | mutex_unlock(&mdev->state_lock); | 1094 | mutex_unlock(&mdev->state_lock); |
1090 | return err; | 1095 | return err; |
1091 | } | 1096 | } |
@@ -1713,6 +1718,8 @@ static int mlx4_en_set_channels(struct net_device *dev, | |||
1713 | { | 1718 | { |
1714 | struct mlx4_en_priv *priv = netdev_priv(dev); | 1719 | struct mlx4_en_priv *priv = netdev_priv(dev); |
1715 | struct mlx4_en_dev *mdev = priv->mdev; | 1720 | struct mlx4_en_dev *mdev = priv->mdev; |
1721 | struct mlx4_en_port_profile new_prof; | ||
1722 | struct mlx4_en_priv *tmp; | ||
1716 | int port_up = 0; | 1723 | int port_up = 0; |
1717 | int err = 0; | 1724 | int err = 0; |
1718 | 1725 | ||
@@ -1728,23 +1735,26 @@ static int mlx4_en_set_channels(struct net_device *dev, | |||
1728 | return -EINVAL; | 1735 | return -EINVAL; |
1729 | } | 1736 | } |
1730 | 1737 | ||
1738 | tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); | ||
1739 | if (!tmp) | ||
1740 | return -ENOMEM; | ||
1741 | |||
1731 | mutex_lock(&mdev->state_lock); | 1742 | mutex_lock(&mdev->state_lock); |
1743 | memcpy(&new_prof, priv->prof, sizeof(struct mlx4_en_port_profile)); | ||
1744 | new_prof.num_tx_rings_p_up = channel->tx_count; | ||
1745 | new_prof.tx_ring_num = channel->tx_count * MLX4_EN_NUM_UP; | ||
1746 | new_prof.rx_ring_num = channel->rx_count; | ||
1747 | |||
1748 | err = mlx4_en_try_alloc_resources(priv, tmp, &new_prof); | ||
1749 | if (err) | ||
1750 | goto out; | ||
1751 | |||
1732 | if (priv->port_up) { | 1752 | if (priv->port_up) { |
1733 | port_up = 1; | 1753 | port_up = 1; |
1734 | mlx4_en_stop_port(dev, 1); | 1754 | mlx4_en_stop_port(dev, 1); |
1735 | } | 1755 | } |
1736 | 1756 | ||
1737 | mlx4_en_free_resources(priv); | 1757 | mlx4_en_safe_replace_resources(priv, tmp); |
1738 | |||
1739 | priv->num_tx_rings_p_up = channel->tx_count; | ||
1740 | priv->tx_ring_num = channel->tx_count * MLX4_EN_NUM_UP; | ||
1741 | priv->rx_ring_num = channel->rx_count; | ||
1742 | |||
1743 | err = mlx4_en_alloc_resources(priv); | ||
1744 | if (err) { | ||
1745 | en_err(priv, "Failed reallocating port resources\n"); | ||
1746 | goto out; | ||
1747 | } | ||
1748 | 1758 | ||
1749 | netif_set_real_num_tx_queues(dev, priv->tx_ring_num - | 1759 | netif_set_real_num_tx_queues(dev, priv->tx_ring_num - |
1750 | priv->xdp_ring_num); | 1760 | priv->xdp_ring_num); |
@@ -1763,8 +1773,8 @@ static int mlx4_en_set_channels(struct net_device *dev, | |||
1763 | } | 1773 | } |
1764 | 1774 | ||
1765 | err = mlx4_en_moderation_update(priv); | 1775 | err = mlx4_en_moderation_update(priv); |
1766 | |||
1767 | out: | 1776 | out: |
1777 | kfree(tmp); | ||
1768 | mutex_unlock(&mdev->state_lock); | 1778 | mutex_unlock(&mdev->state_lock); |
1769 | return err; | 1779 | return err; |
1770 | } | 1780 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 9abbba6c1475..4198e9bf89d0 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -1985,7 +1985,7 @@ static int mlx4_en_close(struct net_device *dev) | |||
1985 | return 0; | 1985 | return 0; |
1986 | } | 1986 | } |
1987 | 1987 | ||
1988 | void mlx4_en_free_resources(struct mlx4_en_priv *priv) | 1988 | static void mlx4_en_free_resources(struct mlx4_en_priv *priv) |
1989 | { | 1989 | { |
1990 | int i; | 1990 | int i; |
1991 | 1991 | ||
@@ -2010,7 +2010,7 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv) | |||
2010 | 2010 | ||
2011 | } | 2011 | } |
2012 | 2012 | ||
2013 | int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) | 2013 | static int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) |
2014 | { | 2014 | { |
2015 | struct mlx4_en_port_profile *prof = priv->prof; | 2015 | struct mlx4_en_port_profile *prof = priv->prof; |
2016 | int i; | 2016 | int i; |
@@ -2075,6 +2075,77 @@ static void mlx4_en_shutdown(struct net_device *dev) | |||
2075 | rtnl_unlock(); | 2075 | rtnl_unlock(); |
2076 | } | 2076 | } |
2077 | 2077 | ||
2078 | static int mlx4_en_copy_priv(struct mlx4_en_priv *dst, | ||
2079 | struct mlx4_en_priv *src, | ||
2080 | struct mlx4_en_port_profile *prof) | ||
2081 | { | ||
2082 | memcpy(&dst->hwtstamp_config, &prof->hwtstamp_config, | ||
2083 | sizeof(dst->hwtstamp_config)); | ||
2084 | dst->num_tx_rings_p_up = src->mdev->profile.num_tx_rings_p_up; | ||
2085 | dst->tx_ring_num = prof->tx_ring_num; | ||
2086 | dst->rx_ring_num = prof->rx_ring_num; | ||
2087 | dst->flags = prof->flags; | ||
2088 | dst->mdev = src->mdev; | ||
2089 | dst->port = src->port; | ||
2090 | dst->dev = src->dev; | ||
2091 | dst->prof = prof; | ||
2092 | dst->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) + | ||
2093 | DS_SIZE * MLX4_EN_MAX_RX_FRAGS); | ||
2094 | |||
2095 | dst->tx_ring = kzalloc(sizeof(struct mlx4_en_tx_ring *) * MAX_TX_RINGS, | ||
2096 | GFP_KERNEL); | ||
2097 | if (!dst->tx_ring) | ||
2098 | return -ENOMEM; | ||
2099 | |||
2100 | dst->tx_cq = kzalloc(sizeof(struct mlx4_en_cq *) * MAX_TX_RINGS, | ||
2101 | GFP_KERNEL); | ||
2102 | if (!dst->tx_cq) { | ||
2103 | kfree(dst->tx_ring); | ||
2104 | return -ENOMEM; | ||
2105 | } | ||
2106 | return 0; | ||
2107 | } | ||
2108 | |||
2109 | static void mlx4_en_update_priv(struct mlx4_en_priv *dst, | ||
2110 | struct mlx4_en_priv *src) | ||
2111 | { | ||
2112 | memcpy(dst->rx_ring, src->rx_ring, | ||
2113 | sizeof(struct mlx4_en_rx_ring *) * src->rx_ring_num); | ||
2114 | memcpy(dst->rx_cq, src->rx_cq, | ||
2115 | sizeof(struct mlx4_en_cq *) * src->rx_ring_num); | ||
2116 | memcpy(&dst->hwtstamp_config, &src->hwtstamp_config, | ||
2117 | sizeof(dst->hwtstamp_config)); | ||
2118 | dst->tx_ring_num = src->tx_ring_num; | ||
2119 | dst->rx_ring_num = src->rx_ring_num; | ||
2120 | dst->tx_ring = src->tx_ring; | ||
2121 | dst->tx_cq = src->tx_cq; | ||
2122 | memcpy(dst->prof, src->prof, sizeof(struct mlx4_en_port_profile)); | ||
2123 | } | ||
2124 | |||
2125 | int mlx4_en_try_alloc_resources(struct mlx4_en_priv *priv, | ||
2126 | struct mlx4_en_priv *tmp, | ||
2127 | struct mlx4_en_port_profile *prof) | ||
2128 | { | ||
2129 | mlx4_en_copy_priv(tmp, priv, prof); | ||
2130 | |||
2131 | if (mlx4_en_alloc_resources(tmp)) { | ||
2132 | en_warn(priv, | ||
2133 | "%s: Resource allocation failed, using previous configuration\n", | ||
2134 | __func__); | ||
2135 | kfree(tmp->tx_ring); | ||
2136 | kfree(tmp->tx_cq); | ||
2137 | return -ENOMEM; | ||
2138 | } | ||
2139 | return 0; | ||
2140 | } | ||
2141 | |||
2142 | void mlx4_en_safe_replace_resources(struct mlx4_en_priv *priv, | ||
2143 | struct mlx4_en_priv *tmp) | ||
2144 | { | ||
2145 | mlx4_en_free_resources(priv); | ||
2146 | mlx4_en_update_priv(priv, tmp); | ||
2147 | } | ||
2148 | |||
2078 | void mlx4_en_destroy_netdev(struct net_device *dev) | 2149 | void mlx4_en_destroy_netdev(struct net_device *dev) |
2079 | { | 2150 | { |
2080 | struct mlx4_en_priv *priv = netdev_priv(dev); | 2151 | struct mlx4_en_priv *priv = netdev_priv(dev); |
@@ -2111,6 +2182,10 @@ void mlx4_en_destroy_netdev(struct net_device *dev) | |||
2111 | mdev->upper[priv->port] = NULL; | 2182 | mdev->upper[priv->port] = NULL; |
2112 | mutex_unlock(&mdev->state_lock); | 2183 | mutex_unlock(&mdev->state_lock); |
2113 | 2184 | ||
2185 | #ifdef CONFIG_RFS_ACCEL | ||
2186 | mlx4_en_cleanup_filters(priv); | ||
2187 | #endif | ||
2188 | |||
2114 | mlx4_en_free_resources(priv); | 2189 | mlx4_en_free_resources(priv); |
2115 | 2190 | ||
2116 | kfree(priv->tx_ring); | 2191 | kfree(priv->tx_ring); |
@@ -3273,6 +3348,8 @@ int mlx4_en_reset_config(struct net_device *dev, | |||
3273 | { | 3348 | { |
3274 | struct mlx4_en_priv *priv = netdev_priv(dev); | 3349 | struct mlx4_en_priv *priv = netdev_priv(dev); |
3275 | struct mlx4_en_dev *mdev = priv->mdev; | 3350 | struct mlx4_en_dev *mdev = priv->mdev; |
3351 | struct mlx4_en_port_profile new_prof; | ||
3352 | struct mlx4_en_priv *tmp; | ||
3276 | int port_up = 0; | 3353 | int port_up = 0; |
3277 | int err = 0; | 3354 | int err = 0; |
3278 | 3355 | ||
@@ -3289,19 +3366,29 @@ int mlx4_en_reset_config(struct net_device *dev, | |||
3289 | return -EINVAL; | 3366 | return -EINVAL; |
3290 | } | 3367 | } |
3291 | 3368 | ||
3369 | tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); | ||
3370 | if (!tmp) | ||
3371 | return -ENOMEM; | ||
3372 | |||
3292 | mutex_lock(&mdev->state_lock); | 3373 | mutex_lock(&mdev->state_lock); |
3374 | |||
3375 | memcpy(&new_prof, priv->prof, sizeof(struct mlx4_en_port_profile)); | ||
3376 | memcpy(&new_prof.hwtstamp_config, &ts_config, sizeof(ts_config)); | ||
3377 | |||
3378 | err = mlx4_en_try_alloc_resources(priv, tmp, &new_prof); | ||
3379 | if (err) | ||
3380 | goto out; | ||
3381 | |||
3293 | if (priv->port_up) { | 3382 | if (priv->port_up) { |
3294 | port_up = 1; | 3383 | port_up = 1; |
3295 | mlx4_en_stop_port(dev, 1); | 3384 | mlx4_en_stop_port(dev, 1); |
3296 | } | 3385 | } |
3297 | 3386 | ||
3298 | mlx4_en_free_resources(priv); | ||
3299 | |||
3300 | en_warn(priv, "Changing device configuration rx filter(%x) rx vlan(%x)\n", | 3387 | en_warn(priv, "Changing device configuration rx filter(%x) rx vlan(%x)\n", |
3301 | ts_config.rx_filter, !!(features & NETIF_F_HW_VLAN_CTAG_RX)); | 3388 | ts_config.rx_filter, |
3389 | !!(features & NETIF_F_HW_VLAN_CTAG_RX)); | ||
3302 | 3390 | ||
3303 | priv->hwtstamp_config.tx_type = ts_config.tx_type; | 3391 | mlx4_en_safe_replace_resources(priv, tmp); |
3304 | priv->hwtstamp_config.rx_filter = ts_config.rx_filter; | ||
3305 | 3392 | ||
3306 | if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX)) { | 3393 | if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX)) { |
3307 | if (features & NETIF_F_HW_VLAN_CTAG_RX) | 3394 | if (features & NETIF_F_HW_VLAN_CTAG_RX) |
@@ -3335,11 +3422,6 @@ int mlx4_en_reset_config(struct net_device *dev, | |||
3335 | dev->features &= ~NETIF_F_HW_VLAN_CTAG_RX; | 3422 | dev->features &= ~NETIF_F_HW_VLAN_CTAG_RX; |
3336 | } | 3423 | } |
3337 | 3424 | ||
3338 | err = mlx4_en_alloc_resources(priv); | ||
3339 | if (err) { | ||
3340 | en_err(priv, "Failed reallocating port resources\n"); | ||
3341 | goto out; | ||
3342 | } | ||
3343 | if (port_up) { | 3425 | if (port_up) { |
3344 | err = mlx4_en_start_port(dev); | 3426 | err = mlx4_en_start_port(dev); |
3345 | if (err) | 3427 | if (err) |
@@ -3348,6 +3430,8 @@ int mlx4_en_reset_config(struct net_device *dev, | |||
3348 | 3430 | ||
3349 | out: | 3431 | out: |
3350 | mutex_unlock(&mdev->state_lock); | 3432 | mutex_unlock(&mdev->state_lock); |
3351 | netdev_features_change(dev); | 3433 | kfree(tmp); |
3434 | if (!err) | ||
3435 | netdev_features_change(dev); | ||
3352 | return err; | 3436 | return err; |
3353 | } | 3437 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index a02dec6fb256..2040dad8611d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -545,9 +545,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv, | |||
545 | ring->rx_info = NULL; | 545 | ring->rx_info = NULL; |
546 | kfree(ring); | 546 | kfree(ring); |
547 | *pring = NULL; | 547 | *pring = NULL; |
548 | #ifdef CONFIG_RFS_ACCEL | ||
549 | mlx4_en_cleanup_filters(priv); | ||
550 | #endif | ||
551 | } | 548 | } |
552 | 549 | ||
553 | void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, | 550 | void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 29c81d26f9f5..2c2913dcae98 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -376,12 +376,14 @@ struct mlx4_en_port_profile { | |||
376 | u32 rx_ring_num; | 376 | u32 rx_ring_num; |
377 | u32 tx_ring_size; | 377 | u32 tx_ring_size; |
378 | u32 rx_ring_size; | 378 | u32 rx_ring_size; |
379 | u8 num_tx_rings_p_up; | ||
379 | u8 rx_pause; | 380 | u8 rx_pause; |
380 | u8 rx_ppp; | 381 | u8 rx_ppp; |
381 | u8 tx_pause; | 382 | u8 tx_pause; |
382 | u8 tx_ppp; | 383 | u8 tx_ppp; |
383 | int rss_rings; | 384 | int rss_rings; |
384 | int inline_thold; | 385 | int inline_thold; |
386 | struct hwtstamp_config hwtstamp_config; | ||
385 | }; | 387 | }; |
386 | 388 | ||
387 | struct mlx4_en_profile { | 389 | struct mlx4_en_profile { |
@@ -673,8 +675,11 @@ void mlx4_en_set_stats_bitmap(struct mlx4_dev *dev, | |||
673 | u8 rx_ppp, u8 rx_pause, | 675 | u8 rx_ppp, u8 rx_pause, |
674 | u8 tx_ppp, u8 tx_pause); | 676 | u8 tx_ppp, u8 tx_pause); |
675 | 677 | ||
676 | void mlx4_en_free_resources(struct mlx4_en_priv *priv); | 678 | int mlx4_en_try_alloc_resources(struct mlx4_en_priv *priv, |
677 | int mlx4_en_alloc_resources(struct mlx4_en_priv *priv); | 679 | struct mlx4_en_priv *tmp, |
680 | struct mlx4_en_port_profile *prof); | ||
681 | void mlx4_en_safe_replace_resources(struct mlx4_en_priv *priv, | ||
682 | struct mlx4_en_priv *tmp); | ||
678 | 683 | ||
679 | int mlx4_en_create_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq, | 684 | int mlx4_en_create_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq, |
680 | int entries, int ring, enum cq_type mode, int node); | 685 | int entries, int ring, enum cq_type mode, int node); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 611ab550136e..bdcb699fe63e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
@@ -1464,6 +1464,11 @@ static int mlx5e_open_channels(struct mlx5e_priv *priv) | |||
1464 | goto err_close_channels; | 1464 | goto err_close_channels; |
1465 | } | 1465 | } |
1466 | 1466 | ||
1467 | /* FIXME: This is a W/A for tx timeout watch dog false alarm when | ||
1468 | * polling for inactive tx queues. | ||
1469 | */ | ||
1470 | netif_tx_start_all_queues(priv->netdev); | ||
1471 | |||
1467 | kfree(cparam); | 1472 | kfree(cparam); |
1468 | return 0; | 1473 | return 0; |
1469 | 1474 | ||
@@ -1483,6 +1488,12 @@ static void mlx5e_close_channels(struct mlx5e_priv *priv) | |||
1483 | { | 1488 | { |
1484 | int i; | 1489 | int i; |
1485 | 1490 | ||
1491 | /* FIXME: This is a W/A only for tx timeout watch dog false alarm when | ||
1492 | * polling for inactive tx queues. | ||
1493 | */ | ||
1494 | netif_tx_stop_all_queues(priv->netdev); | ||
1495 | netif_tx_disable(priv->netdev); | ||
1496 | |||
1486 | for (i = 0; i < priv->params.num_channels; i++) | 1497 | for (i = 0; i < priv->params.num_channels; i++) |
1487 | mlx5e_close_channel(priv->channel[i]); | 1498 | mlx5e_close_channel(priv->channel[i]); |
1488 | 1499 | ||
@@ -2774,7 +2785,7 @@ static void mlx5e_tx_timeout(struct net_device *dev) | |||
2774 | for (i = 0; i < priv->params.num_channels * priv->params.num_tc; i++) { | 2785 | for (i = 0; i < priv->params.num_channels * priv->params.num_tc; i++) { |
2775 | struct mlx5e_sq *sq = priv->txq_to_sq_map[i]; | 2786 | struct mlx5e_sq *sq = priv->txq_to_sq_map[i]; |
2776 | 2787 | ||
2777 | if (!netif_tx_queue_stopped(netdev_get_tx_queue(dev, i))) | 2788 | if (!netif_xmit_stopped(netdev_get_tx_queue(dev, i))) |
2778 | continue; | 2789 | continue; |
2779 | sched_work = true; | 2790 | sched_work = true; |
2780 | set_bit(MLX5E_SQ_STATE_TX_TIMEOUT, &sq->state); | 2791 | set_bit(MLX5E_SQ_STATE_TX_TIMEOUT, &sq->state); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/vxlan.c b/drivers/net/ethernet/mellanox/mlx5/core/vxlan.c index 05de77267d58..e25a73ed2981 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/vxlan.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/vxlan.c | |||
@@ -72,8 +72,8 @@ static int mlx5e_vxlan_core_del_port_cmd(struct mlx5_core_dev *mdev, u16 port) | |||
72 | u32 in[MLX5_ST_SZ_DW(delete_vxlan_udp_dport_in)]; | 72 | u32 in[MLX5_ST_SZ_DW(delete_vxlan_udp_dport_in)]; |
73 | u32 out[MLX5_ST_SZ_DW(delete_vxlan_udp_dport_out)]; | 73 | u32 out[MLX5_ST_SZ_DW(delete_vxlan_udp_dport_out)]; |
74 | 74 | ||
75 | memset(&in, 0, sizeof(in)); | 75 | memset(in, 0, sizeof(in)); |
76 | memset(&out, 0, sizeof(out)); | 76 | memset(out, 0, sizeof(out)); |
77 | 77 | ||
78 | MLX5_SET(delete_vxlan_udp_dport_in, in, opcode, | 78 | MLX5_SET(delete_vxlan_udp_dport_in, in, opcode, |
79 | MLX5_CMD_OP_DELETE_VXLAN_UDP_DPORT); | 79 | MLX5_CMD_OP_DELETE_VXLAN_UDP_DPORT); |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index b669b0407499..5b2a0b946f71 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h | |||
@@ -2739,7 +2739,7 @@ static inline void mlxsw_reg_ppcnt_pack(char *payload, u8 local_port, | |||
2739 | * Configures the switch priority to buffer table. | 2739 | * Configures the switch priority to buffer table. |
2740 | */ | 2740 | */ |
2741 | #define MLXSW_REG_PPTB_ID 0x500B | 2741 | #define MLXSW_REG_PPTB_ID 0x500B |
2742 | #define MLXSW_REG_PPTB_LEN 0x0C | 2742 | #define MLXSW_REG_PPTB_LEN 0x10 |
2743 | 2743 | ||
2744 | static const struct mlxsw_reg_info mlxsw_reg_pptb = { | 2744 | static const struct mlxsw_reg_info mlxsw_reg_pptb = { |
2745 | .id = MLXSW_REG_PPTB_ID, | 2745 | .id = MLXSW_REG_PPTB_ID, |
@@ -2805,6 +2805,13 @@ MLXSW_ITEM32(reg, pptb, pm_msb, 0x08, 24, 8); | |||
2805 | */ | 2805 | */ |
2806 | MLXSW_ITEM32(reg, pptb, untagged_buff, 0x08, 0, 4); | 2806 | MLXSW_ITEM32(reg, pptb, untagged_buff, 0x08, 0, 4); |
2807 | 2807 | ||
2808 | /* reg_pptb_prio_to_buff_msb | ||
2809 | * Mapping of switch priority <i+8> to one of the allocated receive port | ||
2810 | * buffers. | ||
2811 | * Access: RW | ||
2812 | */ | ||
2813 | MLXSW_ITEM_BIT_ARRAY(reg, pptb, prio_to_buff_msb, 0x0C, 0x04, 4); | ||
2814 | |||
2808 | #define MLXSW_REG_PPTB_ALL_PRIO 0xFF | 2815 | #define MLXSW_REG_PPTB_ALL_PRIO 0xFF |
2809 | 2816 | ||
2810 | static inline void mlxsw_reg_pptb_pack(char *payload, u8 local_port) | 2817 | static inline void mlxsw_reg_pptb_pack(char *payload, u8 local_port) |
@@ -2813,6 +2820,14 @@ static inline void mlxsw_reg_pptb_pack(char *payload, u8 local_port) | |||
2813 | mlxsw_reg_pptb_mm_set(payload, MLXSW_REG_PPTB_MM_UM); | 2820 | mlxsw_reg_pptb_mm_set(payload, MLXSW_REG_PPTB_MM_UM); |
2814 | mlxsw_reg_pptb_local_port_set(payload, local_port); | 2821 | mlxsw_reg_pptb_local_port_set(payload, local_port); |
2815 | mlxsw_reg_pptb_pm_set(payload, MLXSW_REG_PPTB_ALL_PRIO); | 2822 | mlxsw_reg_pptb_pm_set(payload, MLXSW_REG_PPTB_ALL_PRIO); |
2823 | mlxsw_reg_pptb_pm_msb_set(payload, MLXSW_REG_PPTB_ALL_PRIO); | ||
2824 | } | ||
2825 | |||
2826 | static inline void mlxsw_reg_pptb_prio_to_buff_pack(char *payload, u8 prio, | ||
2827 | u8 buff) | ||
2828 | { | ||
2829 | mlxsw_reg_pptb_prio_to_buff_set(payload, prio, buff); | ||
2830 | mlxsw_reg_pptb_prio_to_buff_msb_set(payload, prio, buff); | ||
2816 | } | 2831 | } |
2817 | 2832 | ||
2818 | /* PBMC - Port Buffer Management Control Register | 2833 | /* PBMC - Port Buffer Management Control Register |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 3e7920b084e8..2ba8cc404cb1 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c | |||
@@ -173,23 +173,6 @@ static int mlxsw_sp_port_admin_status_set(struct mlxsw_sp_port *mlxsw_sp_port, | |||
173 | return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(paos), paos_pl); | 173 | return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(paos), paos_pl); |
174 | } | 174 | } |
175 | 175 | ||
176 | static int mlxsw_sp_port_oper_status_get(struct mlxsw_sp_port *mlxsw_sp_port, | ||
177 | bool *p_is_up) | ||
178 | { | ||
179 | struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; | ||
180 | char paos_pl[MLXSW_REG_PAOS_LEN]; | ||
181 | u8 oper_status; | ||
182 | int err; | ||
183 | |||
184 | mlxsw_reg_paos_pack(paos_pl, mlxsw_sp_port->local_port, 0); | ||
185 | err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(paos), paos_pl); | ||
186 | if (err) | ||
187 | return err; | ||
188 | oper_status = mlxsw_reg_paos_oper_status_get(paos_pl); | ||
189 | *p_is_up = oper_status == MLXSW_PORT_ADMIN_STATUS_UP ? true : false; | ||
190 | return 0; | ||
191 | } | ||
192 | |||
193 | static int mlxsw_sp_port_dev_addr_set(struct mlxsw_sp_port *mlxsw_sp_port, | 176 | static int mlxsw_sp_port_dev_addr_set(struct mlxsw_sp_port *mlxsw_sp_port, |
194 | unsigned char *addr) | 177 | unsigned char *addr) |
195 | { | 178 | { |
@@ -1405,7 +1388,8 @@ static int mlxsw_sp_port_get_settings(struct net_device *dev, | |||
1405 | 1388 | ||
1406 | cmd->supported = mlxsw_sp_from_ptys_supported_port(eth_proto_cap) | | 1389 | cmd->supported = mlxsw_sp_from_ptys_supported_port(eth_proto_cap) | |
1407 | mlxsw_sp_from_ptys_supported_link(eth_proto_cap) | | 1390 | mlxsw_sp_from_ptys_supported_link(eth_proto_cap) | |
1408 | SUPPORTED_Pause | SUPPORTED_Asym_Pause; | 1391 | SUPPORTED_Pause | SUPPORTED_Asym_Pause | |
1392 | SUPPORTED_Autoneg; | ||
1409 | cmd->advertising = mlxsw_sp_from_ptys_advert_link(eth_proto_admin); | 1393 | cmd->advertising = mlxsw_sp_from_ptys_advert_link(eth_proto_admin); |
1410 | mlxsw_sp_from_ptys_speed_duplex(netif_carrier_ok(dev), | 1394 | mlxsw_sp_from_ptys_speed_duplex(netif_carrier_ok(dev), |
1411 | eth_proto_oper, cmd); | 1395 | eth_proto_oper, cmd); |
@@ -1464,7 +1448,6 @@ static int mlxsw_sp_port_set_settings(struct net_device *dev, | |||
1464 | u32 eth_proto_new; | 1448 | u32 eth_proto_new; |
1465 | u32 eth_proto_cap; | 1449 | u32 eth_proto_cap; |
1466 | u32 eth_proto_admin; | 1450 | u32 eth_proto_admin; |
1467 | bool is_up; | ||
1468 | int err; | 1451 | int err; |
1469 | 1452 | ||
1470 | speed = ethtool_cmd_speed(cmd); | 1453 | speed = ethtool_cmd_speed(cmd); |
@@ -1496,12 +1479,7 @@ static int mlxsw_sp_port_set_settings(struct net_device *dev, | |||
1496 | return err; | 1479 | return err; |
1497 | } | 1480 | } |
1498 | 1481 | ||
1499 | err = mlxsw_sp_port_oper_status_get(mlxsw_sp_port, &is_up); | 1482 | if (!netif_running(dev)) |
1500 | if (err) { | ||
1501 | netdev_err(dev, "Failed to get oper status"); | ||
1502 | return err; | ||
1503 | } | ||
1504 | if (!is_up) | ||
1505 | return 0; | 1483 | return 0; |
1506 | 1484 | ||
1507 | err = mlxsw_sp_port_admin_status_set(mlxsw_sp_port, false); | 1485 | err = mlxsw_sp_port_admin_status_set(mlxsw_sp_port, false); |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c index a3720a0fad7d..074cdda7b6f3 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c | |||
@@ -194,7 +194,7 @@ static int mlxsw_sp_port_pb_prio_init(struct mlxsw_sp_port *mlxsw_sp_port) | |||
194 | 194 | ||
195 | mlxsw_reg_pptb_pack(pptb_pl, mlxsw_sp_port->local_port); | 195 | mlxsw_reg_pptb_pack(pptb_pl, mlxsw_sp_port->local_port); |
196 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) | 196 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) |
197 | mlxsw_reg_pptb_prio_to_buff_set(pptb_pl, i, 0); | 197 | mlxsw_reg_pptb_prio_to_buff_pack(pptb_pl, i, 0); |
198 | return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pptb), | 198 | return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pptb), |
199 | pptb_pl); | 199 | pptb_pl); |
200 | } | 200 | } |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c index 0b323661c0b6..01cfb7512827 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c | |||
@@ -103,7 +103,8 @@ static int mlxsw_sp_port_pg_prio_map(struct mlxsw_sp_port *mlxsw_sp_port, | |||
103 | 103 | ||
104 | mlxsw_reg_pptb_pack(pptb_pl, mlxsw_sp_port->local_port); | 104 | mlxsw_reg_pptb_pack(pptb_pl, mlxsw_sp_port->local_port); |
105 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) | 105 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) |
106 | mlxsw_reg_pptb_prio_to_buff_set(pptb_pl, i, prio_tc[i]); | 106 | mlxsw_reg_pptb_prio_to_buff_pack(pptb_pl, i, prio_tc[i]); |
107 | |||
107 | return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pptb), | 108 | return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pptb), |
108 | pptb_pl); | 109 | pptb_pl); |
109 | } | 110 | } |
@@ -249,6 +250,7 @@ static int mlxsw_sp_dcbnl_ieee_setets(struct net_device *dev, | |||
249 | return err; | 250 | return err; |
250 | 251 | ||
251 | memcpy(mlxsw_sp_port->dcb.ets, ets, sizeof(*ets)); | 252 | memcpy(mlxsw_sp_port->dcb.ets, ets, sizeof(*ets)); |
253 | mlxsw_sp_port->dcb.ets->ets_cap = IEEE_8021QAZ_MAX_TCS; | ||
252 | 254 | ||
253 | return 0; | 255 | return 0; |
254 | } | 256 | } |
@@ -351,7 +353,8 @@ static int mlxsw_sp_dcbnl_ieee_setpfc(struct net_device *dev, | |||
351 | struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); | 353 | struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); |
352 | int err; | 354 | int err; |
353 | 355 | ||
354 | if (mlxsw_sp_port->link.tx_pause || mlxsw_sp_port->link.rx_pause) { | 356 | if ((mlxsw_sp_port->link.tx_pause || mlxsw_sp_port->link.rx_pause) && |
357 | pfc->pfc_en) { | ||
355 | netdev_err(dev, "PAUSE frames already enabled on port\n"); | 358 | netdev_err(dev, "PAUSE frames already enabled on port\n"); |
356 | return -EINVAL; | 359 | return -EINVAL; |
357 | } | 360 | } |
@@ -371,6 +374,7 @@ static int mlxsw_sp_dcbnl_ieee_setpfc(struct net_device *dev, | |||
371 | } | 374 | } |
372 | 375 | ||
373 | memcpy(mlxsw_sp_port->dcb.pfc, pfc, sizeof(*pfc)); | 376 | memcpy(mlxsw_sp_port->dcb.pfc, pfc, sizeof(*pfc)); |
377 | mlxsw_sp_port->dcb.pfc->pfc_cap = IEEE_8021QAZ_MAX_TCS; | ||
374 | 378 | ||
375 | return 0; | 379 | return 0; |
376 | 380 | ||
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 17953ab15000..f226db4616b7 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
@@ -2600,8 +2600,6 @@ ppp_unregister_channel(struct ppp_channel *chan) | |||
2600 | spin_lock_bh(&pn->all_channels_lock); | 2600 | spin_lock_bh(&pn->all_channels_lock); |
2601 | list_del(&pch->list); | 2601 | list_del(&pch->list); |
2602 | spin_unlock_bh(&pn->all_channels_lock); | 2602 | spin_unlock_bh(&pn->all_channels_lock); |
2603 | put_net(pch->chan_net); | ||
2604 | pch->chan_net = NULL; | ||
2605 | 2603 | ||
2606 | pch->file.dead = 1; | 2604 | pch->file.dead = 1; |
2607 | wake_up_interruptible(&pch->file.rwait); | 2605 | wake_up_interruptible(&pch->file.rwait); |
@@ -3135,6 +3133,9 @@ ppp_disconnect_channel(struct channel *pch) | |||
3135 | */ | 3133 | */ |
3136 | static void ppp_destroy_channel(struct channel *pch) | 3134 | static void ppp_destroy_channel(struct channel *pch) |
3137 | { | 3135 | { |
3136 | put_net(pch->chan_net); | ||
3137 | pch->chan_net = NULL; | ||
3138 | |||
3138 | atomic_dec(&channel_count); | 3139 | atomic_dec(&channel_count); |
3139 | 3140 | ||
3140 | if (!pch->file.dead) { | 3141 | if (!pch->file.dead) { |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 168a8e2e15c8..f41a8ad4740e 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/mdio.h> | 26 | #include <linux/mdio.h> |
27 | #include <linux/usb/cdc.h> | 27 | #include <linux/usb/cdc.h> |
28 | #include <linux/suspend.h> | 28 | #include <linux/suspend.h> |
29 | #include <linux/acpi.h> | ||
29 | 30 | ||
30 | /* Information for net-next */ | 31 | /* Information for net-next */ |
31 | #define NETNEXT_VERSION "08" | 32 | #define NETNEXT_VERSION "08" |
@@ -460,6 +461,11 @@ | |||
460 | /* SRAM_IMPEDANCE */ | 461 | /* SRAM_IMPEDANCE */ |
461 | #define RX_DRIVING_MASK 0x6000 | 462 | #define RX_DRIVING_MASK 0x6000 |
462 | 463 | ||
464 | /* MAC PASSTHRU */ | ||
465 | #define AD_MASK 0xfee0 | ||
466 | #define EFUSE 0xcfdb | ||
467 | #define PASS_THRU_MASK 0x1 | ||
468 | |||
463 | enum rtl_register_content { | 469 | enum rtl_register_content { |
464 | _1000bps = 0x10, | 470 | _1000bps = 0x10, |
465 | _100bps = 0x08, | 471 | _100bps = 0x08, |
@@ -1040,6 +1046,65 @@ out1: | |||
1040 | return ret; | 1046 | return ret; |
1041 | } | 1047 | } |
1042 | 1048 | ||
1049 | /* Devices containing RTL8153-AD can support a persistent | ||
1050 | * host system provided MAC address. | ||
1051 | * Examples of this are Dell TB15 and Dell WD15 docks | ||
1052 | */ | ||
1053 | static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa) | ||
1054 | { | ||
1055 | acpi_status status; | ||
1056 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | ||
1057 | union acpi_object *obj; | ||
1058 | int ret = -EINVAL; | ||
1059 | u32 ocp_data; | ||
1060 | unsigned char buf[6]; | ||
1061 | |||
1062 | /* test for -AD variant of RTL8153 */ | ||
1063 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0); | ||
1064 | if ((ocp_data & AD_MASK) != 0x1000) | ||
1065 | return -ENODEV; | ||
1066 | |||
1067 | /* test for MAC address pass-through bit */ | ||
1068 | ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE); | ||
1069 | if ((ocp_data & PASS_THRU_MASK) != 1) | ||
1070 | return -ENODEV; | ||
1071 | |||
1072 | /* returns _AUXMAC_#AABBCCDDEEFF# */ | ||
1073 | status = acpi_evaluate_object(NULL, "\\_SB.AMAC", NULL, &buffer); | ||
1074 | obj = (union acpi_object *)buffer.pointer; | ||
1075 | if (!ACPI_SUCCESS(status)) | ||
1076 | return -ENODEV; | ||
1077 | if (obj->type != ACPI_TYPE_BUFFER || obj->string.length != 0x17) { | ||
1078 | netif_warn(tp, probe, tp->netdev, | ||
1079 | "Invalid buffer when reading pass-thru MAC addr: " | ||
1080 | "(%d, %d)\n", | ||
1081 | obj->type, obj->string.length); | ||
1082 | goto amacout; | ||
1083 | } | ||
1084 | if (strncmp(obj->string.pointer, "_AUXMAC_#", 9) != 0 || | ||
1085 | strncmp(obj->string.pointer + 0x15, "#", 1) != 0) { | ||
1086 | netif_warn(tp, probe, tp->netdev, | ||
1087 | "Invalid header when reading pass-thru MAC addr\n"); | ||
1088 | goto amacout; | ||
1089 | } | ||
1090 | ret = hex2bin(buf, obj->string.pointer + 9, 6); | ||
1091 | if (!(ret == 0 && is_valid_ether_addr(buf))) { | ||
1092 | netif_warn(tp, probe, tp->netdev, | ||
1093 | "Invalid MAC when reading pass-thru MAC addr: " | ||
1094 | "%d, %pM\n", ret, buf); | ||
1095 | ret = -EINVAL; | ||
1096 | goto amacout; | ||
1097 | } | ||
1098 | memcpy(sa->sa_data, buf, 6); | ||
1099 | ether_addr_copy(tp->netdev->dev_addr, sa->sa_data); | ||
1100 | netif_info(tp, probe, tp->netdev, | ||
1101 | "Using pass-thru MAC addr %pM\n", sa->sa_data); | ||
1102 | |||
1103 | amacout: | ||
1104 | kfree(obj); | ||
1105 | return ret; | ||
1106 | } | ||
1107 | |||
1043 | static int set_ethernet_addr(struct r8152 *tp) | 1108 | static int set_ethernet_addr(struct r8152 *tp) |
1044 | { | 1109 | { |
1045 | struct net_device *dev = tp->netdev; | 1110 | struct net_device *dev = tp->netdev; |
@@ -1048,8 +1113,15 @@ static int set_ethernet_addr(struct r8152 *tp) | |||
1048 | 1113 | ||
1049 | if (tp->version == RTL_VER_01) | 1114 | if (tp->version == RTL_VER_01) |
1050 | ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data); | 1115 | ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data); |
1051 | else | 1116 | else { |
1052 | ret = pla_ocp_read(tp, PLA_BACKUP, 8, sa.sa_data); | 1117 | /* if this is not an RTL8153-AD, no eFuse mac pass thru set, |
1118 | * or system doesn't provide valid _SB.AMAC this will be | ||
1119 | * be expected to non-zero | ||
1120 | */ | ||
1121 | ret = vendor_mac_passthru_addr_read(tp, &sa); | ||
1122 | if (ret < 0) | ||
1123 | ret = pla_ocp_read(tp, PLA_BACKUP, 8, sa.sa_data); | ||
1124 | } | ||
1053 | 1125 | ||
1054 | if (ret < 0) { | 1126 | if (ret < 0) { |
1055 | netif_err(tp, probe, dev, "Get ether addr fail\n"); | 1127 | netif_err(tp, probe, dev, "Get ether addr fail\n"); |
@@ -2300,10 +2372,6 @@ static u32 __rtl_get_wol(struct r8152 *tp) | |||
2300 | u32 ocp_data; | 2372 | u32 ocp_data; |
2301 | u32 wolopts = 0; | 2373 | u32 wolopts = 0; |
2302 | 2374 | ||
2303 | ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CONFIG5); | ||
2304 | if (!(ocp_data & LAN_WAKE_EN)) | ||
2305 | return 0; | ||
2306 | |||
2307 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34); | 2375 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34); |
2308 | if (ocp_data & LINK_ON_WAKE_EN) | 2376 | if (ocp_data & LINK_ON_WAKE_EN) |
2309 | wolopts |= WAKE_PHY; | 2377 | wolopts |= WAKE_PHY; |
@@ -2336,15 +2404,13 @@ static void __rtl_set_wol(struct r8152 *tp, u32 wolopts) | |||
2336 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data); | 2404 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data); |
2337 | 2405 | ||
2338 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG5); | 2406 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG5); |
2339 | ocp_data &= ~(UWF_EN | BWF_EN | MWF_EN | LAN_WAKE_EN); | 2407 | ocp_data &= ~(UWF_EN | BWF_EN | MWF_EN); |
2340 | if (wolopts & WAKE_UCAST) | 2408 | if (wolopts & WAKE_UCAST) |
2341 | ocp_data |= UWF_EN; | 2409 | ocp_data |= UWF_EN; |
2342 | if (wolopts & WAKE_BCAST) | 2410 | if (wolopts & WAKE_BCAST) |
2343 | ocp_data |= BWF_EN; | 2411 | ocp_data |= BWF_EN; |
2344 | if (wolopts & WAKE_MCAST) | 2412 | if (wolopts & WAKE_MCAST) |
2345 | ocp_data |= MWF_EN; | 2413 | ocp_data |= MWF_EN; |
2346 | if (wolopts & WAKE_ANY) | ||
2347 | ocp_data |= LAN_WAKE_EN; | ||
2348 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG5, ocp_data); | 2414 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG5, ocp_data); |
2349 | 2415 | ||
2350 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML); | 2416 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML); |
@@ -4361,3 +4427,4 @@ module_usb_driver(rtl8152_driver); | |||
4361 | MODULE_AUTHOR(DRIVER_AUTHOR); | 4427 | MODULE_AUTHOR(DRIVER_AUTHOR); |
4362 | MODULE_DESCRIPTION(DRIVER_DESC); | 4428 | MODULE_DESCRIPTION(DRIVER_DESC); |
4363 | MODULE_LICENSE("GPL"); | 4429 | MODULE_LICENSE("GPL"); |
4430 | MODULE_VERSION(DRIVER_VERSION); | ||
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 1a51584a382b..d5fb55c0a9d9 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -1394,19 +1394,22 @@ static int ns_cmp(void *priv, struct list_head *a, struct list_head *b) | |||
1394 | return nsa->ns_id - nsb->ns_id; | 1394 | return nsa->ns_id - nsb->ns_id; |
1395 | } | 1395 | } |
1396 | 1396 | ||
1397 | static struct nvme_ns *nvme_find_ns(struct nvme_ctrl *ctrl, unsigned nsid) | 1397 | static struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid) |
1398 | { | 1398 | { |
1399 | struct nvme_ns *ns; | 1399 | struct nvme_ns *ns, *ret = NULL; |
1400 | |||
1401 | lockdep_assert_held(&ctrl->namespaces_mutex); | ||
1402 | 1400 | ||
1401 | mutex_lock(&ctrl->namespaces_mutex); | ||
1403 | list_for_each_entry(ns, &ctrl->namespaces, list) { | 1402 | list_for_each_entry(ns, &ctrl->namespaces, list) { |
1404 | if (ns->ns_id == nsid) | 1403 | if (ns->ns_id == nsid) { |
1405 | return ns; | 1404 | kref_get(&ns->kref); |
1405 | ret = ns; | ||
1406 | break; | ||
1407 | } | ||
1406 | if (ns->ns_id > nsid) | 1408 | if (ns->ns_id > nsid) |
1407 | break; | 1409 | break; |
1408 | } | 1410 | } |
1409 | return NULL; | 1411 | mutex_unlock(&ctrl->namespaces_mutex); |
1412 | return ret; | ||
1410 | } | 1413 | } |
1411 | 1414 | ||
1412 | static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | 1415 | static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) |
@@ -1415,8 +1418,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
1415 | struct gendisk *disk; | 1418 | struct gendisk *disk; |
1416 | int node = dev_to_node(ctrl->dev); | 1419 | int node = dev_to_node(ctrl->dev); |
1417 | 1420 | ||
1418 | lockdep_assert_held(&ctrl->namespaces_mutex); | ||
1419 | |||
1420 | ns = kzalloc_node(sizeof(*ns), GFP_KERNEL, node); | 1421 | ns = kzalloc_node(sizeof(*ns), GFP_KERNEL, node); |
1421 | if (!ns) | 1422 | if (!ns) |
1422 | return; | 1423 | return; |
@@ -1457,7 +1458,10 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
1457 | if (nvme_revalidate_disk(ns->disk)) | 1458 | if (nvme_revalidate_disk(ns->disk)) |
1458 | goto out_free_disk; | 1459 | goto out_free_disk; |
1459 | 1460 | ||
1460 | list_add_tail_rcu(&ns->list, &ctrl->namespaces); | 1461 | mutex_lock(&ctrl->namespaces_mutex); |
1462 | list_add_tail(&ns->list, &ctrl->namespaces); | ||
1463 | mutex_unlock(&ctrl->namespaces_mutex); | ||
1464 | |||
1461 | kref_get(&ctrl->kref); | 1465 | kref_get(&ctrl->kref); |
1462 | if (ns->type == NVME_NS_LIGHTNVM) | 1466 | if (ns->type == NVME_NS_LIGHTNVM) |
1463 | return; | 1467 | return; |
@@ -1480,8 +1484,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
1480 | 1484 | ||
1481 | static void nvme_ns_remove(struct nvme_ns *ns) | 1485 | static void nvme_ns_remove(struct nvme_ns *ns) |
1482 | { | 1486 | { |
1483 | lockdep_assert_held(&ns->ctrl->namespaces_mutex); | ||
1484 | |||
1485 | if (test_and_set_bit(NVME_NS_REMOVING, &ns->flags)) | 1487 | if (test_and_set_bit(NVME_NS_REMOVING, &ns->flags)) |
1486 | return; | 1488 | return; |
1487 | 1489 | ||
@@ -1494,8 +1496,11 @@ static void nvme_ns_remove(struct nvme_ns *ns) | |||
1494 | blk_mq_abort_requeue_list(ns->queue); | 1496 | blk_mq_abort_requeue_list(ns->queue); |
1495 | blk_cleanup_queue(ns->queue); | 1497 | blk_cleanup_queue(ns->queue); |
1496 | } | 1498 | } |
1499 | |||
1500 | mutex_lock(&ns->ctrl->namespaces_mutex); | ||
1497 | list_del_init(&ns->list); | 1501 | list_del_init(&ns->list); |
1498 | synchronize_rcu(); | 1502 | mutex_unlock(&ns->ctrl->namespaces_mutex); |
1503 | |||
1499 | nvme_put_ns(ns); | 1504 | nvme_put_ns(ns); |
1500 | } | 1505 | } |
1501 | 1506 | ||
@@ -1503,10 +1508,11 @@ static void nvme_validate_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
1503 | { | 1508 | { |
1504 | struct nvme_ns *ns; | 1509 | struct nvme_ns *ns; |
1505 | 1510 | ||
1506 | ns = nvme_find_ns(ctrl, nsid); | 1511 | ns = nvme_find_get_ns(ctrl, nsid); |
1507 | if (ns) { | 1512 | if (ns) { |
1508 | if (revalidate_disk(ns->disk)) | 1513 | if (revalidate_disk(ns->disk)) |
1509 | nvme_ns_remove(ns); | 1514 | nvme_ns_remove(ns); |
1515 | nvme_put_ns(ns); | ||
1510 | } else | 1516 | } else |
1511 | nvme_alloc_ns(ctrl, nsid); | 1517 | nvme_alloc_ns(ctrl, nsid); |
1512 | } | 1518 | } |
@@ -1535,9 +1541,11 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl, unsigned nn) | |||
1535 | nvme_validate_ns(ctrl, nsid); | 1541 | nvme_validate_ns(ctrl, nsid); |
1536 | 1542 | ||
1537 | while (++prev < nsid) { | 1543 | while (++prev < nsid) { |
1538 | ns = nvme_find_ns(ctrl, prev); | 1544 | ns = nvme_find_get_ns(ctrl, prev); |
1539 | if (ns) | 1545 | if (ns) { |
1540 | nvme_ns_remove(ns); | 1546 | nvme_ns_remove(ns); |
1547 | nvme_put_ns(ns); | ||
1548 | } | ||
1541 | } | 1549 | } |
1542 | } | 1550 | } |
1543 | nn -= j; | 1551 | nn -= j; |
@@ -1552,8 +1560,6 @@ static void nvme_scan_ns_sequential(struct nvme_ctrl *ctrl, unsigned nn) | |||
1552 | struct nvme_ns *ns, *next; | 1560 | struct nvme_ns *ns, *next; |
1553 | unsigned i; | 1561 | unsigned i; |
1554 | 1562 | ||
1555 | lockdep_assert_held(&ctrl->namespaces_mutex); | ||
1556 | |||
1557 | for (i = 1; i <= nn; i++) | 1563 | for (i = 1; i <= nn; i++) |
1558 | nvme_validate_ns(ctrl, i); | 1564 | nvme_validate_ns(ctrl, i); |
1559 | 1565 | ||
@@ -1576,7 +1582,6 @@ static void nvme_scan_work(struct work_struct *work) | |||
1576 | if (nvme_identify_ctrl(ctrl, &id)) | 1582 | if (nvme_identify_ctrl(ctrl, &id)) |
1577 | return; | 1583 | return; |
1578 | 1584 | ||
1579 | mutex_lock(&ctrl->namespaces_mutex); | ||
1580 | nn = le32_to_cpu(id->nn); | 1585 | nn = le32_to_cpu(id->nn); |
1581 | if (ctrl->vs >= NVME_VS(1, 1) && | 1586 | if (ctrl->vs >= NVME_VS(1, 1) && |
1582 | !(ctrl->quirks & NVME_QUIRK_IDENTIFY_CNS)) { | 1587 | !(ctrl->quirks & NVME_QUIRK_IDENTIFY_CNS)) { |
@@ -1585,6 +1590,7 @@ static void nvme_scan_work(struct work_struct *work) | |||
1585 | } | 1590 | } |
1586 | nvme_scan_ns_sequential(ctrl, nn); | 1591 | nvme_scan_ns_sequential(ctrl, nn); |
1587 | done: | 1592 | done: |
1593 | mutex_lock(&ctrl->namespaces_mutex); | ||
1588 | list_sort(NULL, &ctrl->namespaces, ns_cmp); | 1594 | list_sort(NULL, &ctrl->namespaces, ns_cmp); |
1589 | mutex_unlock(&ctrl->namespaces_mutex); | 1595 | mutex_unlock(&ctrl->namespaces_mutex); |
1590 | kfree(id); | 1596 | kfree(id); |
@@ -1604,6 +1610,11 @@ void nvme_queue_scan(struct nvme_ctrl *ctrl) | |||
1604 | } | 1610 | } |
1605 | EXPORT_SYMBOL_GPL(nvme_queue_scan); | 1611 | EXPORT_SYMBOL_GPL(nvme_queue_scan); |
1606 | 1612 | ||
1613 | /* | ||
1614 | * This function iterates the namespace list unlocked to allow recovery from | ||
1615 | * controller failure. It is up to the caller to ensure the namespace list is | ||
1616 | * not modified by scan work while this function is executing. | ||
1617 | */ | ||
1607 | void nvme_remove_namespaces(struct nvme_ctrl *ctrl) | 1618 | void nvme_remove_namespaces(struct nvme_ctrl *ctrl) |
1608 | { | 1619 | { |
1609 | struct nvme_ns *ns, *next; | 1620 | struct nvme_ns *ns, *next; |
@@ -1617,10 +1628,8 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl) | |||
1617 | if (ctrl->state == NVME_CTRL_DEAD) | 1628 | if (ctrl->state == NVME_CTRL_DEAD) |
1618 | nvme_kill_queues(ctrl); | 1629 | nvme_kill_queues(ctrl); |
1619 | 1630 | ||
1620 | mutex_lock(&ctrl->namespaces_mutex); | ||
1621 | list_for_each_entry_safe(ns, next, &ctrl->namespaces, list) | 1631 | list_for_each_entry_safe(ns, next, &ctrl->namespaces, list) |
1622 | nvme_ns_remove(ns); | 1632 | nvme_ns_remove(ns); |
1623 | mutex_unlock(&ctrl->namespaces_mutex); | ||
1624 | } | 1633 | } |
1625 | EXPORT_SYMBOL_GPL(nvme_remove_namespaces); | 1634 | EXPORT_SYMBOL_GPL(nvme_remove_namespaces); |
1626 | 1635 | ||
@@ -1791,11 +1800,8 @@ void nvme_kill_queues(struct nvme_ctrl *ctrl) | |||
1791 | { | 1800 | { |
1792 | struct nvme_ns *ns; | 1801 | struct nvme_ns *ns; |
1793 | 1802 | ||
1794 | rcu_read_lock(); | 1803 | mutex_lock(&ctrl->namespaces_mutex); |
1795 | list_for_each_entry_rcu(ns, &ctrl->namespaces, list) { | 1804 | list_for_each_entry(ns, &ctrl->namespaces, list) { |
1796 | if (!kref_get_unless_zero(&ns->kref)) | ||
1797 | continue; | ||
1798 | |||
1799 | /* | 1805 | /* |
1800 | * Revalidating a dead namespace sets capacity to 0. This will | 1806 | * Revalidating a dead namespace sets capacity to 0. This will |
1801 | * end buffered writers dirtying pages that can't be synced. | 1807 | * end buffered writers dirtying pages that can't be synced. |
@@ -1806,10 +1812,8 @@ void nvme_kill_queues(struct nvme_ctrl *ctrl) | |||
1806 | blk_set_queue_dying(ns->queue); | 1812 | blk_set_queue_dying(ns->queue); |
1807 | blk_mq_abort_requeue_list(ns->queue); | 1813 | blk_mq_abort_requeue_list(ns->queue); |
1808 | blk_mq_start_stopped_hw_queues(ns->queue, true); | 1814 | blk_mq_start_stopped_hw_queues(ns->queue, true); |
1809 | |||
1810 | nvme_put_ns(ns); | ||
1811 | } | 1815 | } |
1812 | rcu_read_unlock(); | 1816 | mutex_unlock(&ctrl->namespaces_mutex); |
1813 | } | 1817 | } |
1814 | EXPORT_SYMBOL_GPL(nvme_kill_queues); | 1818 | EXPORT_SYMBOL_GPL(nvme_kill_queues); |
1815 | 1819 | ||
@@ -1817,8 +1821,8 @@ void nvme_stop_queues(struct nvme_ctrl *ctrl) | |||
1817 | { | 1821 | { |
1818 | struct nvme_ns *ns; | 1822 | struct nvme_ns *ns; |
1819 | 1823 | ||
1820 | rcu_read_lock(); | 1824 | mutex_lock(&ctrl->namespaces_mutex); |
1821 | list_for_each_entry_rcu(ns, &ctrl->namespaces, list) { | 1825 | list_for_each_entry(ns, &ctrl->namespaces, list) { |
1822 | spin_lock_irq(ns->queue->queue_lock); | 1826 | spin_lock_irq(ns->queue->queue_lock); |
1823 | queue_flag_set(QUEUE_FLAG_STOPPED, ns->queue); | 1827 | queue_flag_set(QUEUE_FLAG_STOPPED, ns->queue); |
1824 | spin_unlock_irq(ns->queue->queue_lock); | 1828 | spin_unlock_irq(ns->queue->queue_lock); |
@@ -1826,7 +1830,7 @@ void nvme_stop_queues(struct nvme_ctrl *ctrl) | |||
1826 | blk_mq_cancel_requeue_work(ns->queue); | 1830 | blk_mq_cancel_requeue_work(ns->queue); |
1827 | blk_mq_stop_hw_queues(ns->queue); | 1831 | blk_mq_stop_hw_queues(ns->queue); |
1828 | } | 1832 | } |
1829 | rcu_read_unlock(); | 1833 | mutex_unlock(&ctrl->namespaces_mutex); |
1830 | } | 1834 | } |
1831 | EXPORT_SYMBOL_GPL(nvme_stop_queues); | 1835 | EXPORT_SYMBOL_GPL(nvme_stop_queues); |
1832 | 1836 | ||
@@ -1834,13 +1838,13 @@ void nvme_start_queues(struct nvme_ctrl *ctrl) | |||
1834 | { | 1838 | { |
1835 | struct nvme_ns *ns; | 1839 | struct nvme_ns *ns; |
1836 | 1840 | ||
1837 | rcu_read_lock(); | 1841 | mutex_lock(&ctrl->namespaces_mutex); |
1838 | list_for_each_entry_rcu(ns, &ctrl->namespaces, list) { | 1842 | list_for_each_entry(ns, &ctrl->namespaces, list) { |
1839 | queue_flag_clear_unlocked(QUEUE_FLAG_STOPPED, ns->queue); | 1843 | queue_flag_clear_unlocked(QUEUE_FLAG_STOPPED, ns->queue); |
1840 | blk_mq_start_stopped_hw_queues(ns->queue, true); | 1844 | blk_mq_start_stopped_hw_queues(ns->queue, true); |
1841 | blk_mq_kick_requeue_list(ns->queue); | 1845 | blk_mq_kick_requeue_list(ns->queue); |
1842 | } | 1846 | } |
1843 | rcu_read_unlock(); | 1847 | mutex_unlock(&ctrl->namespaces_mutex); |
1844 | } | 1848 | } |
1845 | EXPORT_SYMBOL_GPL(nvme_start_queues); | 1849 | EXPORT_SYMBOL_GPL(nvme_start_queues); |
1846 | 1850 | ||
diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c index 38a8bbe74810..83797d89c30f 100644 --- a/drivers/pps/clients/pps_parport.c +++ b/drivers/pps/clients/pps_parport.c | |||
@@ -195,7 +195,7 @@ static void parport_detach(struct parport *port) | |||
195 | struct pps_client_pp *device; | 195 | struct pps_client_pp *device; |
196 | 196 | ||
197 | /* FIXME: oooh, this is ugly! */ | 197 | /* FIXME: oooh, this is ugly! */ |
198 | if (strcmp(pardev->name, KBUILD_MODNAME)) | 198 | if (!pardev || strcmp(pardev->name, KBUILD_MODNAME)) |
199 | /* not our port */ | 199 | /* not our port */ |
200 | return; | 200 | return; |
201 | 201 | ||
diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index 526bf23dcb49..6c7fe4778793 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c | |||
@@ -152,7 +152,6 @@ static const struct regulator_ops rpm_smps_ldo_ops_fixed = { | |||
152 | .enable = rpm_reg_enable, | 152 | .enable = rpm_reg_enable, |
153 | .disable = rpm_reg_disable, | 153 | .disable = rpm_reg_disable, |
154 | .is_enabled = rpm_reg_is_enabled, | 154 | .is_enabled = rpm_reg_is_enabled, |
155 | .list_voltage = regulator_list_voltage_linear_range, | ||
156 | 155 | ||
157 | .get_voltage = rpm_reg_get_voltage, | 156 | .get_voltage = rpm_reg_get_voltage, |
158 | .set_voltage = rpm_reg_set_voltage, | 157 | .set_voltage = rpm_reg_set_voltage, |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index d6a691e27d33..d6803a9e5ab8 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -10093,6 +10093,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, | |||
10093 | ioa_cfg->intr_flag = IPR_USE_MSI; | 10093 | ioa_cfg->intr_flag = IPR_USE_MSI; |
10094 | else { | 10094 | else { |
10095 | ioa_cfg->intr_flag = IPR_USE_LSI; | 10095 | ioa_cfg->intr_flag = IPR_USE_LSI; |
10096 | ioa_cfg->clear_isr = 1; | ||
10096 | ioa_cfg->nvectors = 1; | 10097 | ioa_cfg->nvectors = 1; |
10097 | dev_info(&pdev->dev, "Cannot enable MSI.\n"); | 10098 | dev_info(&pdev->dev, "Cannot enable MSI.\n"); |
10098 | } | 10099 | } |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 5649c200d37c..a92a62dea793 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -2548,7 +2548,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, | |||
2548 | if (!vha->flags.online) | 2548 | if (!vha->flags.online) |
2549 | return; | 2549 | return; |
2550 | 2550 | ||
2551 | if (rsp->msix->cpuid != smp_processor_id()) { | 2551 | if (rsp->msix && rsp->msix->cpuid != smp_processor_id()) { |
2552 | /* if kernel does not notify qla of IRQ's CPU change, | 2552 | /* if kernel does not notify qla of IRQ's CPU change, |
2553 | * then set it here. | 2553 | * then set it here. |
2554 | */ | 2554 | */ |
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index ff41c310c900..eaccd651ccda 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c | |||
@@ -429,7 +429,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor, | |||
429 | * here, and we don't know what device it is | 429 | * here, and we don't know what device it is |
430 | * trying to work with, leave it as-is. | 430 | * trying to work with, leave it as-is. |
431 | */ | 431 | */ |
432 | vmax = 8; /* max length of vendor */ | 432 | vmax = sizeof(devinfo->vendor); |
433 | vskip = vendor; | 433 | vskip = vendor; |
434 | while (vmax > 0 && *vskip == ' ') { | 434 | while (vmax > 0 && *vskip == ' ') { |
435 | vmax--; | 435 | vmax--; |
@@ -439,7 +439,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor, | |||
439 | while (vmax > 0 && vskip[vmax - 1] == ' ') | 439 | while (vmax > 0 && vskip[vmax - 1] == ' ') |
440 | --vmax; | 440 | --vmax; |
441 | 441 | ||
442 | mmax = 16; /* max length of model */ | 442 | mmax = sizeof(devinfo->model); |
443 | mskip = model; | 443 | mskip = model; |
444 | while (mmax > 0 && *mskip == ' ') { | 444 | while (mmax > 0 && *mskip == ' ') { |
445 | mmax--; | 445 | mmax--; |
@@ -455,10 +455,12 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor, | |||
455 | * Behave like the older version of get_device_flags. | 455 | * Behave like the older version of get_device_flags. |
456 | */ | 456 | */ |
457 | if (memcmp(devinfo->vendor, vskip, vmax) || | 457 | if (memcmp(devinfo->vendor, vskip, vmax) || |
458 | devinfo->vendor[vmax]) | 458 | (vmax < sizeof(devinfo->vendor) && |
459 | devinfo->vendor[vmax])) | ||
459 | continue; | 460 | continue; |
460 | if (memcmp(devinfo->model, mskip, mmax) || | 461 | if (memcmp(devinfo->model, mskip, mmax) || |
461 | devinfo->model[mmax]) | 462 | (mmax < sizeof(devinfo->model) && |
463 | devinfo->model[mmax])) | ||
462 | continue; | 464 | continue; |
463 | return devinfo; | 465 | return devinfo; |
464 | } else { | 466 | } else { |
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index f973bfce5d08..1e93a37e27f0 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c | |||
@@ -366,34 +366,22 @@ static void to_utf8(struct vc_data *vc, uint c) | |||
366 | 366 | ||
367 | static void do_compute_shiftstate(void) | 367 | static void do_compute_shiftstate(void) |
368 | { | 368 | { |
369 | unsigned int i, j, k, sym, val; | 369 | unsigned int k, sym, val; |
370 | 370 | ||
371 | shift_state = 0; | 371 | shift_state = 0; |
372 | memset(shift_down, 0, sizeof(shift_down)); | 372 | memset(shift_down, 0, sizeof(shift_down)); |
373 | 373 | ||
374 | for (i = 0; i < ARRAY_SIZE(key_down); i++) { | 374 | for_each_set_bit(k, key_down, min(NR_KEYS, KEY_CNT)) { |
375 | 375 | sym = U(key_maps[0][k]); | |
376 | if (!key_down[i]) | 376 | if (KTYP(sym) != KT_SHIFT && KTYP(sym) != KT_SLOCK) |
377 | continue; | 377 | continue; |
378 | 378 | ||
379 | k = i * BITS_PER_LONG; | 379 | val = KVAL(sym); |
380 | 380 | if (val == KVAL(K_CAPSSHIFT)) | |
381 | for (j = 0; j < BITS_PER_LONG; j++, k++) { | 381 | val = KVAL(K_SHIFT); |
382 | |||
383 | if (!test_bit(k, key_down)) | ||
384 | continue; | ||
385 | 382 | ||
386 | sym = U(key_maps[0][k]); | 383 | shift_down[val]++; |
387 | if (KTYP(sym) != KT_SHIFT && KTYP(sym) != KT_SLOCK) | 384 | shift_state |= BIT(val); |
388 | continue; | ||
389 | |||
390 | val = KVAL(sym); | ||
391 | if (val == KVAL(K_CAPSSHIFT)) | ||
392 | val = KVAL(K_SHIFT); | ||
393 | |||
394 | shift_down[val]++; | ||
395 | shift_state |= (1 << val); | ||
396 | } | ||
397 | } | 385 | } |
398 | } | 386 | } |
399 | 387 | ||
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c index 076970a54f89..4ce10bcca18b 100644 --- a/drivers/xen/xen-acpi-processor.c +++ b/drivers/xen/xen-acpi-processor.c | |||
@@ -423,36 +423,7 @@ upload: | |||
423 | 423 | ||
424 | return 0; | 424 | return 0; |
425 | } | 425 | } |
426 | static int __init check_prereq(void) | ||
427 | { | ||
428 | struct cpuinfo_x86 *c = &cpu_data(0); | ||
429 | |||
430 | if (!xen_initial_domain()) | ||
431 | return -ENODEV; | ||
432 | |||
433 | if (!acpi_gbl_FADT.smi_command) | ||
434 | return -ENODEV; | ||
435 | |||
436 | if (c->x86_vendor == X86_VENDOR_INTEL) { | ||
437 | if (!cpu_has(c, X86_FEATURE_EST)) | ||
438 | return -ENODEV; | ||
439 | 426 | ||
440 | return 0; | ||
441 | } | ||
442 | if (c->x86_vendor == X86_VENDOR_AMD) { | ||
443 | /* Copied from powernow-k8.h, can't include ../cpufreq/powernow | ||
444 | * as we get compile warnings for the static functions. | ||
445 | */ | ||
446 | #define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007 | ||
447 | #define USE_HW_PSTATE 0x00000080 | ||
448 | u32 eax, ebx, ecx, edx; | ||
449 | cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx); | ||
450 | if ((edx & USE_HW_PSTATE) != USE_HW_PSTATE) | ||
451 | return -ENODEV; | ||
452 | return 0; | ||
453 | } | ||
454 | return -ENODEV; | ||
455 | } | ||
456 | /* acpi_perf_data is a pointer to percpu data. */ | 427 | /* acpi_perf_data is a pointer to percpu data. */ |
457 | static struct acpi_processor_performance __percpu *acpi_perf_data; | 428 | static struct acpi_processor_performance __percpu *acpi_perf_data; |
458 | 429 | ||
@@ -509,10 +480,10 @@ struct notifier_block xen_acpi_processor_resume_nb = { | |||
509 | static int __init xen_acpi_processor_init(void) | 480 | static int __init xen_acpi_processor_init(void) |
510 | { | 481 | { |
511 | unsigned int i; | 482 | unsigned int i; |
512 | int rc = check_prereq(); | 483 | int rc; |
513 | 484 | ||
514 | if (rc) | 485 | if (!xen_initial_domain()) |
515 | return rc; | 486 | return -ENODEV; |
516 | 487 | ||
517 | nr_acpi_bits = get_max_acpi_id() + 1; | 488 | nr_acpi_bits = get_max_acpi_id() + 1; |
518 | acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL); | 489 | acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL); |
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c index cacf30d14747..7487971f9f78 100644 --- a/drivers/xen/xenbus/xenbus_dev_frontend.c +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c | |||
@@ -316,11 +316,18 @@ static int xenbus_write_transaction(unsigned msg_type, | |||
316 | rc = -ENOMEM; | 316 | rc = -ENOMEM; |
317 | goto out; | 317 | goto out; |
318 | } | 318 | } |
319 | } else { | ||
320 | list_for_each_entry(trans, &u->transactions, list) | ||
321 | if (trans->handle.id == u->u.msg.tx_id) | ||
322 | break; | ||
323 | if (&trans->list == &u->transactions) | ||
324 | return -ESRCH; | ||
319 | } | 325 | } |
320 | 326 | ||
321 | reply = xenbus_dev_request_and_reply(&u->u.msg); | 327 | reply = xenbus_dev_request_and_reply(&u->u.msg); |
322 | if (IS_ERR(reply)) { | 328 | if (IS_ERR(reply)) { |
323 | kfree(trans); | 329 | if (msg_type == XS_TRANSACTION_START) |
330 | kfree(trans); | ||
324 | rc = PTR_ERR(reply); | 331 | rc = PTR_ERR(reply); |
325 | goto out; | 332 | goto out; |
326 | } | 333 | } |
@@ -333,12 +340,7 @@ static int xenbus_write_transaction(unsigned msg_type, | |||
333 | list_add(&trans->list, &u->transactions); | 340 | list_add(&trans->list, &u->transactions); |
334 | } | 341 | } |
335 | } else if (u->u.msg.type == XS_TRANSACTION_END) { | 342 | } else if (u->u.msg.type == XS_TRANSACTION_END) { |
336 | list_for_each_entry(trans, &u->transactions, list) | ||
337 | if (trans->handle.id == u->u.msg.tx_id) | ||
338 | break; | ||
339 | BUG_ON(&trans->list == &u->transactions); | ||
340 | list_del(&trans->list); | 343 | list_del(&trans->list); |
341 | |||
342 | kfree(trans); | 344 | kfree(trans); |
343 | } | 345 | } |
344 | 346 | ||
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 374b12af8812..22f7cd711c57 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c | |||
@@ -232,10 +232,10 @@ static void transaction_resume(void) | |||
232 | void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg) | 232 | void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg) |
233 | { | 233 | { |
234 | void *ret; | 234 | void *ret; |
235 | struct xsd_sockmsg req_msg = *msg; | 235 | enum xsd_sockmsg_type type = msg->type; |
236 | int err; | 236 | int err; |
237 | 237 | ||
238 | if (req_msg.type == XS_TRANSACTION_START) | 238 | if (type == XS_TRANSACTION_START) |
239 | transaction_start(); | 239 | transaction_start(); |
240 | 240 | ||
241 | mutex_lock(&xs_state.request_mutex); | 241 | mutex_lock(&xs_state.request_mutex); |
@@ -249,12 +249,8 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg) | |||
249 | 249 | ||
250 | mutex_unlock(&xs_state.request_mutex); | 250 | mutex_unlock(&xs_state.request_mutex); |
251 | 251 | ||
252 | if (IS_ERR(ret)) | ||
253 | return ret; | ||
254 | |||
255 | if ((msg->type == XS_TRANSACTION_END) || | 252 | if ((msg->type == XS_TRANSACTION_END) || |
256 | ((req_msg.type == XS_TRANSACTION_START) && | 253 | ((type == XS_TRANSACTION_START) && (msg->type == XS_ERROR))) |
257 | (msg->type == XS_ERROR))) | ||
258 | transaction_end(); | 254 | transaction_end(); |
259 | 255 | ||
260 | return ret; | 256 | return ret; |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index f4645c515262..e2e7c749925a 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -853,7 +853,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, | |||
853 | struct p9_fid *fid, *inode_fid; | 853 | struct p9_fid *fid, *inode_fid; |
854 | struct dentry *res = NULL; | 854 | struct dentry *res = NULL; |
855 | 855 | ||
856 | if (d_unhashed(dentry)) { | 856 | if (d_in_lookup(dentry)) { |
857 | res = v9fs_vfs_lookup(dir, dentry, 0); | 857 | res = v9fs_vfs_lookup(dir, dentry, 0); |
858 | if (IS_ERR(res)) | 858 | if (IS_ERR(res)) |
859 | return PTR_ERR(res); | 859 | return PTR_ERR(res); |
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index a34702c998f5..1b51eaa5e2dd 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c | |||
@@ -254,7 +254,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, | |||
254 | struct posix_acl *pacl = NULL, *dacl = NULL; | 254 | struct posix_acl *pacl = NULL, *dacl = NULL; |
255 | struct dentry *res = NULL; | 255 | struct dentry *res = NULL; |
256 | 256 | ||
257 | if (d_unhashed(dentry)) { | 257 | if (d_in_lookup(dentry)) { |
258 | res = v9fs_vfs_lookup(dir, dentry, 0); | 258 | res = v9fs_vfs_lookup(dir, dentry, 0); |
259 | if (IS_ERR(res)) | 259 | if (IS_ERR(res)) |
260 | return PTR_ERR(res); | 260 | return PTR_ERR(res); |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index ce2f5795e44b..0daaf7ceedc5 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -394,7 +394,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, | |||
394 | if ((flags & O_CREAT) && !req->r_reply_info.head->is_dentry) | 394 | if ((flags & O_CREAT) && !req->r_reply_info.head->is_dentry) |
395 | err = ceph_handle_notrace_create(dir, dentry); | 395 | err = ceph_handle_notrace_create(dir, dentry); |
396 | 396 | ||
397 | if (d_unhashed(dentry)) { | 397 | if (d_in_lookup(dentry)) { |
398 | dn = ceph_finish_lookup(req, dentry, err); | 398 | dn = ceph_finish_lookup(req, dentry, err); |
399 | if (IS_ERR(dn)) | 399 | if (IS_ERR(dn)) |
400 | err = PTR_ERR(dn); | 400 | err = PTR_ERR(dn); |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index c3eb998a99bd..fb0903fffc22 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -445,7 +445,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, | |||
445 | * Check for hashed negative dentry. We have already revalidated | 445 | * Check for hashed negative dentry. We have already revalidated |
446 | * the dentry and it is fine. No need to perform another lookup. | 446 | * the dentry and it is fine. No need to perform another lookup. |
447 | */ | 447 | */ |
448 | if (!d_unhashed(direntry)) | 448 | if (!d_in_lookup(direntry)) |
449 | return -ENOENT; | 449 | return -ENOENT; |
450 | 450 | ||
451 | res = cifs_lookup(inode, direntry, 0); | 451 | res = cifs_lookup(inode, direntry, 0); |
diff --git a/fs/configfs/file.c b/fs/configfs/file.c index 33b7ee34eda5..bbc1252a59f5 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c | |||
@@ -357,8 +357,6 @@ configfs_write_bin_file(struct file *file, const char __user *buf, | |||
357 | 357 | ||
358 | len = simple_write_to_buffer(buffer->bin_buffer, | 358 | len = simple_write_to_buffer(buffer->bin_buffer, |
359 | buffer->bin_buffer_size, ppos, buf, count); | 359 | buffer->bin_buffer_size, ppos, buf, count); |
360 | if (len > 0) | ||
361 | *ppos += len; | ||
362 | out: | 360 | out: |
363 | mutex_unlock(&buffer->mutex); | 361 | mutex_unlock(&buffer->mutex); |
364 | return len; | 362 | return len; |
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 0d8eb3455b34..e5e29f8c920b 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -45,7 +45,7 @@ | |||
45 | * ecryptfs_to_hex | 45 | * ecryptfs_to_hex |
46 | * @dst: Buffer to take hex character representation of contents of | 46 | * @dst: Buffer to take hex character representation of contents of |
47 | * src; must be at least of size (src_size * 2) | 47 | * src; must be at least of size (src_size * 2) |
48 | * @src: Buffer to be converted to a hex string respresentation | 48 | * @src: Buffer to be converted to a hex string representation |
49 | * @src_size: number of bytes to convert | 49 | * @src_size: number of bytes to convert |
50 | */ | 50 | */ |
51 | void ecryptfs_to_hex(char *dst, char *src, size_t src_size) | 51 | void ecryptfs_to_hex(char *dst, char *src, size_t src_size) |
@@ -60,7 +60,7 @@ void ecryptfs_to_hex(char *dst, char *src, size_t src_size) | |||
60 | * ecryptfs_from_hex | 60 | * ecryptfs_from_hex |
61 | * @dst: Buffer to take the bytes from src hex; must be at least of | 61 | * @dst: Buffer to take the bytes from src hex; must be at least of |
62 | * size (src_size / 2) | 62 | * size (src_size / 2) |
63 | * @src: Buffer to be converted from a hex string respresentation to raw value | 63 | * @src: Buffer to be converted from a hex string representation to raw value |
64 | * @dst_size: size of dst buffer, or number of hex characters pairs to convert | 64 | * @dst_size: size of dst buffer, or number of hex characters pairs to convert |
65 | */ | 65 | */ |
66 | void ecryptfs_from_hex(char *dst, char *src, int dst_size) | 66 | void ecryptfs_from_hex(char *dst, char *src, int dst_size) |
@@ -953,7 +953,7 @@ struct ecryptfs_cipher_code_str_map_elem { | |||
953 | }; | 953 | }; |
954 | 954 | ||
955 | /* Add support for additional ciphers by adding elements here. The | 955 | /* Add support for additional ciphers by adding elements here. The |
956 | * cipher_code is whatever OpenPGP applicatoins use to identify the | 956 | * cipher_code is whatever OpenPGP applications use to identify the |
957 | * ciphers. List in order of probability. */ | 957 | * ciphers. List in order of probability. */ |
958 | static struct ecryptfs_cipher_code_str_map_elem | 958 | static struct ecryptfs_cipher_code_str_map_elem |
959 | ecryptfs_cipher_code_str_map[] = { | 959 | ecryptfs_cipher_code_str_map[] = { |
@@ -1410,7 +1410,7 @@ int ecryptfs_read_and_validate_xattr_region(struct dentry *dentry, | |||
1410 | * | 1410 | * |
1411 | * Common entry point for reading file metadata. From here, we could | 1411 | * Common entry point for reading file metadata. From here, we could |
1412 | * retrieve the header information from the header region of the file, | 1412 | * retrieve the header information from the header region of the file, |
1413 | * the xattr region of the file, or some other repostory that is | 1413 | * the xattr region of the file, or some other repository that is |
1414 | * stored separately from the file itself. The current implementation | 1414 | * stored separately from the file itself. The current implementation |
1415 | * supports retrieving the metadata information from the file contents | 1415 | * supports retrieving the metadata information from the file contents |
1416 | * and from the xattr region. | 1416 | * and from the xattr region. |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 7000b96b783e..ca4e83750214 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -169,9 +169,22 @@ out: | |||
169 | return rc; | 169 | return rc; |
170 | } | 170 | } |
171 | 171 | ||
172 | static int ecryptfs_mmap(struct file *file, struct vm_area_struct *vma) | ||
173 | { | ||
174 | struct file *lower_file = ecryptfs_file_to_lower(file); | ||
175 | /* | ||
176 | * Don't allow mmap on top of file systems that don't support it | ||
177 | * natively. If FILESYSTEM_MAX_STACK_DEPTH > 2 or ecryptfs | ||
178 | * allows recursive mounting, this will need to be extended. | ||
179 | */ | ||
180 | if (!lower_file->f_op->mmap) | ||
181 | return -ENODEV; | ||
182 | return generic_file_mmap(file, vma); | ||
183 | } | ||
184 | |||
172 | /** | 185 | /** |
173 | * ecryptfs_open | 186 | * ecryptfs_open |
174 | * @inode: inode speciying file to open | 187 | * @inode: inode specifying file to open |
175 | * @file: Structure to return filled in | 188 | * @file: Structure to return filled in |
176 | * | 189 | * |
177 | * Opens the file specified by inode. | 190 | * Opens the file specified by inode. |
@@ -240,7 +253,7 @@ out: | |||
240 | 253 | ||
241 | /** | 254 | /** |
242 | * ecryptfs_dir_open | 255 | * ecryptfs_dir_open |
243 | * @inode: inode speciying file to open | 256 | * @inode: inode specifying file to open |
244 | * @file: Structure to return filled in | 257 | * @file: Structure to return filled in |
245 | * | 258 | * |
246 | * Opens the file specified by inode. | 259 | * Opens the file specified by inode. |
@@ -403,7 +416,7 @@ const struct file_operations ecryptfs_main_fops = { | |||
403 | #ifdef CONFIG_COMPAT | 416 | #ifdef CONFIG_COMPAT |
404 | .compat_ioctl = ecryptfs_compat_ioctl, | 417 | .compat_ioctl = ecryptfs_compat_ioctl, |
405 | #endif | 418 | #endif |
406 | .mmap = generic_file_mmap, | 419 | .mmap = ecryptfs_mmap, |
407 | .open = ecryptfs_open, | 420 | .open = ecryptfs_open, |
408 | .flush = ecryptfs_flush, | 421 | .flush = ecryptfs_flush, |
409 | .release = ecryptfs_release, | 422 | .release = ecryptfs_release, |
diff --git a/fs/ecryptfs/kthread.c b/fs/ecryptfs/kthread.c index e818f5ac7a26..866bb18efefe 100644 --- a/fs/ecryptfs/kthread.c +++ b/fs/ecryptfs/kthread.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/wait.h> | 26 | #include <linux/wait.h> |
27 | #include <linux/mount.h> | 27 | #include <linux/mount.h> |
28 | #include <linux/file.h> | ||
29 | #include "ecryptfs_kernel.h" | 28 | #include "ecryptfs_kernel.h" |
30 | 29 | ||
31 | struct ecryptfs_open_req { | 30 | struct ecryptfs_open_req { |
@@ -148,7 +147,7 @@ int ecryptfs_privileged_open(struct file **lower_file, | |||
148 | flags |= IS_RDONLY(d_inode(lower_dentry)) ? O_RDONLY : O_RDWR; | 147 | flags |= IS_RDONLY(d_inode(lower_dentry)) ? O_RDONLY : O_RDWR; |
149 | (*lower_file) = dentry_open(&req.path, flags, cred); | 148 | (*lower_file) = dentry_open(&req.path, flags, cred); |
150 | if (!IS_ERR(*lower_file)) | 149 | if (!IS_ERR(*lower_file)) |
151 | goto have_file; | 150 | goto out; |
152 | if ((flags & O_ACCMODE) == O_RDONLY) { | 151 | if ((flags & O_ACCMODE) == O_RDONLY) { |
153 | rc = PTR_ERR((*lower_file)); | 152 | rc = PTR_ERR((*lower_file)); |
154 | goto out; | 153 | goto out; |
@@ -166,16 +165,8 @@ int ecryptfs_privileged_open(struct file **lower_file, | |||
166 | mutex_unlock(&ecryptfs_kthread_ctl.mux); | 165 | mutex_unlock(&ecryptfs_kthread_ctl.mux); |
167 | wake_up(&ecryptfs_kthread_ctl.wait); | 166 | wake_up(&ecryptfs_kthread_ctl.wait); |
168 | wait_for_completion(&req.done); | 167 | wait_for_completion(&req.done); |
169 | if (IS_ERR(*lower_file)) { | 168 | if (IS_ERR(*lower_file)) |
170 | rc = PTR_ERR(*lower_file); | 169 | rc = PTR_ERR(*lower_file); |
171 | goto out; | ||
172 | } | ||
173 | have_file: | ||
174 | if ((*lower_file)->f_op->mmap == NULL) { | ||
175 | fput(*lower_file); | ||
176 | *lower_file = NULL; | ||
177 | rc = -EMEDIUMTYPE; | ||
178 | } | ||
179 | out: | 170 | out: |
180 | return rc; | 171 | return rc; |
181 | } | 172 | } |
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 1698132d0e57..612004495141 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -738,8 +738,7 @@ static void ecryptfs_free_kmem_caches(void) | |||
738 | struct ecryptfs_cache_info *info; | 738 | struct ecryptfs_cache_info *info; |
739 | 739 | ||
740 | info = &ecryptfs_cache_infos[i]; | 740 | info = &ecryptfs_cache_infos[i]; |
741 | if (*(info->cache)) | 741 | kmem_cache_destroy(*(info->cache)); |
742 | kmem_cache_destroy(*(info->cache)); | ||
743 | } | 742 | } |
744 | } | 743 | } |
745 | 744 | ||
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 989a2cef6b76..fe7e83a45eff 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -483,9 +483,9 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id) | |||
483 | goto out_free; | 483 | goto out_free; |
484 | } | 484 | } |
485 | inode->i_state |= I_WB_SWITCH; | 485 | inode->i_state |= I_WB_SWITCH; |
486 | __iget(inode); | ||
486 | spin_unlock(&inode->i_lock); | 487 | spin_unlock(&inode->i_lock); |
487 | 488 | ||
488 | ihold(inode); | ||
489 | isw->inode = inode; | 489 | isw->inode = inode; |
490 | 490 | ||
491 | atomic_inc(&isw_nr_in_flight); | 491 | atomic_inc(&isw_nr_in_flight); |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 264f07c7754e..cca7b048c07b 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -480,7 +480,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry, | |||
480 | struct fuse_conn *fc = get_fuse_conn(dir); | 480 | struct fuse_conn *fc = get_fuse_conn(dir); |
481 | struct dentry *res = NULL; | 481 | struct dentry *res = NULL; |
482 | 482 | ||
483 | if (d_unhashed(entry)) { | 483 | if (d_in_lookup(entry)) { |
484 | res = fuse_lookup(dir, entry, 0); | 484 | res = fuse_lookup(dir, entry, 0); |
485 | if (IS_ERR(res)) | 485 | if (IS_ERR(res)) |
486 | return PTR_ERR(res); | 486 | return PTR_ERR(res); |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 21dc784f66c2..9bad79fede37 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -1189,7 +1189,7 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry, | |||
1189 | struct dentry *d; | 1189 | struct dentry *d; |
1190 | bool excl = !!(flags & O_EXCL); | 1190 | bool excl = !!(flags & O_EXCL); |
1191 | 1191 | ||
1192 | if (!d_unhashed(dentry)) | 1192 | if (!d_in_lookup(dentry)) |
1193 | goto skip_lookup; | 1193 | goto skip_lookup; |
1194 | 1194 | ||
1195 | d = __gfs2_lookup(dir, dentry, file, opened); | 1195 | d = __gfs2_lookup(dir, dentry, file, opened); |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index d8015a03db4c..19d93d0cd400 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1485,11 +1485,13 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, | |||
1485 | struct file *file, unsigned open_flags, | 1485 | struct file *file, unsigned open_flags, |
1486 | umode_t mode, int *opened) | 1486 | umode_t mode, int *opened) |
1487 | { | 1487 | { |
1488 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); | ||
1488 | struct nfs_open_context *ctx; | 1489 | struct nfs_open_context *ctx; |
1489 | struct dentry *res; | 1490 | struct dentry *res; |
1490 | struct iattr attr = { .ia_valid = ATTR_OPEN }; | 1491 | struct iattr attr = { .ia_valid = ATTR_OPEN }; |
1491 | struct inode *inode; | 1492 | struct inode *inode; |
1492 | unsigned int lookup_flags = 0; | 1493 | unsigned int lookup_flags = 0; |
1494 | bool switched = false; | ||
1493 | int err; | 1495 | int err; |
1494 | 1496 | ||
1495 | /* Expect a negative dentry */ | 1497 | /* Expect a negative dentry */ |
@@ -1504,7 +1506,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, | |||
1504 | 1506 | ||
1505 | /* NFS only supports OPEN on regular files */ | 1507 | /* NFS only supports OPEN on regular files */ |
1506 | if ((open_flags & O_DIRECTORY)) { | 1508 | if ((open_flags & O_DIRECTORY)) { |
1507 | if (!d_unhashed(dentry)) { | 1509 | if (!d_in_lookup(dentry)) { |
1508 | /* | 1510 | /* |
1509 | * Hashed negative dentry with O_DIRECTORY: dentry was | 1511 | * Hashed negative dentry with O_DIRECTORY: dentry was |
1510 | * revalidated and is fine, no need to perform lookup | 1512 | * revalidated and is fine, no need to perform lookup |
@@ -1528,6 +1530,17 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, | |||
1528 | attr.ia_size = 0; | 1530 | attr.ia_size = 0; |
1529 | } | 1531 | } |
1530 | 1532 | ||
1533 | if (!(open_flags & O_CREAT) && !d_in_lookup(dentry)) { | ||
1534 | d_drop(dentry); | ||
1535 | switched = true; | ||
1536 | dentry = d_alloc_parallel(dentry->d_parent, | ||
1537 | &dentry->d_name, &wq); | ||
1538 | if (IS_ERR(dentry)) | ||
1539 | return PTR_ERR(dentry); | ||
1540 | if (unlikely(!d_in_lookup(dentry))) | ||
1541 | return finish_no_open(file, dentry); | ||
1542 | } | ||
1543 | |||
1531 | ctx = create_nfs_open_context(dentry, open_flags); | 1544 | ctx = create_nfs_open_context(dentry, open_flags); |
1532 | err = PTR_ERR(ctx); | 1545 | err = PTR_ERR(ctx); |
1533 | if (IS_ERR(ctx)) | 1546 | if (IS_ERR(ctx)) |
@@ -1563,14 +1576,23 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, | |||
1563 | trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); | 1576 | trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); |
1564 | put_nfs_open_context(ctx); | 1577 | put_nfs_open_context(ctx); |
1565 | out: | 1578 | out: |
1579 | if (unlikely(switched)) { | ||
1580 | d_lookup_done(dentry); | ||
1581 | dput(dentry); | ||
1582 | } | ||
1566 | return err; | 1583 | return err; |
1567 | 1584 | ||
1568 | no_open: | 1585 | no_open: |
1569 | res = nfs_lookup(dir, dentry, lookup_flags); | 1586 | res = nfs_lookup(dir, dentry, lookup_flags); |
1570 | err = PTR_ERR(res); | 1587 | if (switched) { |
1588 | d_lookup_done(dentry); | ||
1589 | if (!res) | ||
1590 | res = dentry; | ||
1591 | else | ||
1592 | dput(dentry); | ||
1593 | } | ||
1571 | if (IS_ERR(res)) | 1594 | if (IS_ERR(res)) |
1572 | goto out; | 1595 | return PTR_ERR(res); |
1573 | |||
1574 | return finish_no_open(file, res); | 1596 | return finish_no_open(file, res); |
1575 | } | 1597 | } |
1576 | EXPORT_SYMBOL_GPL(nfs_atomic_open); | 1598 | EXPORT_SYMBOL_GPL(nfs_atomic_open); |
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index c2a6b0894022..5c9d2d80ff70 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c | |||
@@ -505,6 +505,7 @@ static int ovl_remove_and_whiteout(struct dentry *dentry, bool is_dir) | |||
505 | struct dentry *upper; | 505 | struct dentry *upper; |
506 | struct dentry *opaquedir = NULL; | 506 | struct dentry *opaquedir = NULL; |
507 | int err; | 507 | int err; |
508 | int flags = 0; | ||
508 | 509 | ||
509 | if (WARN_ON(!workdir)) | 510 | if (WARN_ON(!workdir)) |
510 | return -EROFS; | 511 | return -EROFS; |
@@ -534,46 +535,39 @@ static int ovl_remove_and_whiteout(struct dentry *dentry, bool is_dir) | |||
534 | if (err) | 535 | if (err) |
535 | goto out_dput; | 536 | goto out_dput; |
536 | 537 | ||
537 | whiteout = ovl_whiteout(workdir, dentry); | 538 | upper = lookup_one_len(dentry->d_name.name, upperdir, |
538 | err = PTR_ERR(whiteout); | 539 | dentry->d_name.len); |
539 | if (IS_ERR(whiteout)) | 540 | err = PTR_ERR(upper); |
541 | if (IS_ERR(upper)) | ||
540 | goto out_unlock; | 542 | goto out_unlock; |
541 | 543 | ||
542 | upper = ovl_dentry_upper(dentry); | 544 | err = -ESTALE; |
543 | if (!upper) { | 545 | if ((opaquedir && upper != opaquedir) || |
544 | upper = lookup_one_len(dentry->d_name.name, upperdir, | 546 | (!opaquedir && ovl_dentry_upper(dentry) && |
545 | dentry->d_name.len); | 547 | upper != ovl_dentry_upper(dentry))) { |
546 | err = PTR_ERR(upper); | 548 | goto out_dput_upper; |
547 | if (IS_ERR(upper)) | 549 | } |
548 | goto kill_whiteout; | ||
549 | |||
550 | err = ovl_do_rename(wdir, whiteout, udir, upper, 0); | ||
551 | dput(upper); | ||
552 | if (err) | ||
553 | goto kill_whiteout; | ||
554 | } else { | ||
555 | int flags = 0; | ||
556 | 550 | ||
557 | if (opaquedir) | 551 | whiteout = ovl_whiteout(workdir, dentry); |
558 | upper = opaquedir; | 552 | err = PTR_ERR(whiteout); |
559 | err = -ESTALE; | 553 | if (IS_ERR(whiteout)) |
560 | if (upper->d_parent != upperdir) | 554 | goto out_dput_upper; |
561 | goto kill_whiteout; | ||
562 | 555 | ||
563 | if (is_dir) | 556 | if (d_is_dir(upper)) |
564 | flags |= RENAME_EXCHANGE; | 557 | flags = RENAME_EXCHANGE; |
565 | 558 | ||
566 | err = ovl_do_rename(wdir, whiteout, udir, upper, flags); | 559 | err = ovl_do_rename(wdir, whiteout, udir, upper, flags); |
567 | if (err) | 560 | if (err) |
568 | goto kill_whiteout; | 561 | goto kill_whiteout; |
562 | if (flags) | ||
563 | ovl_cleanup(wdir, upper); | ||
569 | 564 | ||
570 | if (is_dir) | ||
571 | ovl_cleanup(wdir, upper); | ||
572 | } | ||
573 | ovl_dentry_version_inc(dentry->d_parent); | 565 | ovl_dentry_version_inc(dentry->d_parent); |
574 | out_d_drop: | 566 | out_d_drop: |
575 | d_drop(dentry); | 567 | d_drop(dentry); |
576 | dput(whiteout); | 568 | dput(whiteout); |
569 | out_dput_upper: | ||
570 | dput(upper); | ||
577 | out_unlock: | 571 | out_unlock: |
578 | unlock_rename(workdir, upperdir); | 572 | unlock_rename(workdir, upperdir); |
579 | out_dput: | 573 | out_dput: |
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index c831c2e5f803..d1cdc60dd68f 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c | |||
@@ -80,6 +80,9 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr) | |||
80 | goto out_drop_write; | 80 | goto out_drop_write; |
81 | } | 81 | } |
82 | 82 | ||
83 | if (attr->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) | ||
84 | attr->ia_valid &= ~ATTR_MODE; | ||
85 | |||
83 | inode_lock(upperdentry->d_inode); | 86 | inode_lock(upperdentry->d_inode); |
84 | err = notify_change(upperdentry, attr, NULL); | 87 | err = notify_change(upperdentry, attr, NULL); |
85 | if (!err) | 88 | if (!err) |
@@ -410,12 +413,11 @@ struct inode *ovl_new_inode(struct super_block *sb, umode_t mode, | |||
410 | if (!inode) | 413 | if (!inode) |
411 | return NULL; | 414 | return NULL; |
412 | 415 | ||
413 | mode &= S_IFMT; | ||
414 | |||
415 | inode->i_ino = get_next_ino(); | 416 | inode->i_ino = get_next_ino(); |
416 | inode->i_mode = mode; | 417 | inode->i_mode = mode; |
417 | inode->i_flags |= S_NOATIME | S_NOCMTIME; | 418 | inode->i_flags |= S_NOATIME | S_NOCMTIME; |
418 | 419 | ||
420 | mode &= S_IFMT; | ||
419 | switch (mode) { | 421 | switch (mode) { |
420 | case S_IFDIR: | 422 | case S_IFDIR: |
421 | inode->i_private = oe; | 423 | inode->i_private = oe; |
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 4bd9b5ba8f42..cfbca53590d0 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h | |||
@@ -187,6 +187,7 @@ static inline void ovl_copyattr(struct inode *from, struct inode *to) | |||
187 | { | 187 | { |
188 | to->i_uid = from->i_uid; | 188 | to->i_uid = from->i_uid; |
189 | to->i_gid = from->i_gid; | 189 | to->i_gid = from->i_gid; |
190 | to->i_mode = from->i_mode; | ||
190 | } | 191 | } |
191 | 192 | ||
192 | /* dir.c */ | 193 | /* dir.c */ |
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index dbca7375deef..63a6ff2cfc68 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -1575,6 +1575,12 @@ xfs_ioc_swapext( | |||
1575 | goto out_put_tmp_file; | 1575 | goto out_put_tmp_file; |
1576 | } | 1576 | } |
1577 | 1577 | ||
1578 | if (f.file->f_op != &xfs_file_operations || | ||
1579 | tmp.file->f_op != &xfs_file_operations) { | ||
1580 | error = -EINVAL; | ||
1581 | goto out_put_tmp_file; | ||
1582 | } | ||
1583 | |||
1578 | ip = XFS_I(file_inode(f.file)); | 1584 | ip = XFS_I(file_inode(f.file)); |
1579 | tip = XFS_I(file_inode(tmp.file)); | 1585 | tip = XFS_I(file_inode(tmp.file)); |
1580 | 1586 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 797ae2ec8eee..29c691265b49 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -78,6 +78,7 @@ | |||
78 | 78 | ||
79 | /* ACPI PCI Interrupt Link (pci_link.c) */ | 79 | /* ACPI PCI Interrupt Link (pci_link.c) */ |
80 | 80 | ||
81 | int acpi_irq_penalty_init(void); | ||
81 | int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, | 82 | int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, |
82 | int *polarity, char **name); | 83 | int *polarity, char **name); |
83 | int acpi_pci_link_free_irq(acpi_handle handle); | 84 | int acpi_pci_link_free_irq(acpi_handle handle); |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 4e4c21491c41..1ff3a76c265d 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -192,7 +192,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE); | |||
192 | /* | 192 | /* |
193 | * Optionally support group module level code. | 193 | * Optionally support group module level code. |
194 | */ | 194 | */ |
195 | ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, FALSE); | 195 | ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE); |
196 | 196 | ||
197 | /* | 197 | /* |
198 | * Optionally use 32-bit FADT addresses if and when there is a conflict | 198 | * Optionally use 32-bit FADT addresses if and when there is a conflict |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 6a67ab94b553..081d0f258d4c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -542,15 +542,19 @@ | |||
542 | 542 | ||
543 | #define INIT_TEXT \ | 543 | #define INIT_TEXT \ |
544 | *(.init.text) \ | 544 | *(.init.text) \ |
545 | *(.text.startup) \ | ||
545 | MEM_DISCARD(init.text) | 546 | MEM_DISCARD(init.text) |
546 | 547 | ||
547 | #define EXIT_DATA \ | 548 | #define EXIT_DATA \ |
548 | *(.exit.data) \ | 549 | *(.exit.data) \ |
550 | *(.fini_array) \ | ||
551 | *(.dtors) \ | ||
549 | MEM_DISCARD(exit.data) \ | 552 | MEM_DISCARD(exit.data) \ |
550 | MEM_DISCARD(exit.rodata) | 553 | MEM_DISCARD(exit.rodata) |
551 | 554 | ||
552 | #define EXIT_TEXT \ | 555 | #define EXIT_TEXT \ |
553 | *(.exit.text) \ | 556 | *(.exit.text) \ |
557 | *(.text.exit) \ | ||
554 | MEM_DISCARD(exit.text) | 558 | MEM_DISCARD(exit.text) |
555 | 559 | ||
556 | #define EXIT_CALL \ | 560 | #define EXIT_CALL \ |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index c801d9028e37..4cecb0b75b9c 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -316,6 +316,20 @@ ttm_bo_reference(struct ttm_buffer_object *bo) | |||
316 | */ | 316 | */ |
317 | extern int ttm_bo_wait(struct ttm_buffer_object *bo, | 317 | extern int ttm_bo_wait(struct ttm_buffer_object *bo, |
318 | bool interruptible, bool no_wait); | 318 | bool interruptible, bool no_wait); |
319 | |||
320 | /** | ||
321 | * ttm_bo_mem_compat - Check if proposed placement is compatible with a bo | ||
322 | * | ||
323 | * @placement: Return immediately if buffer is busy. | ||
324 | * @mem: The struct ttm_mem_reg indicating the region where the bo resides | ||
325 | * @new_flags: Describes compatible placement found | ||
326 | * | ||
327 | * Returns true if the placement is compatible | ||
328 | */ | ||
329 | extern bool ttm_bo_mem_compat(struct ttm_placement *placement, | ||
330 | struct ttm_mem_reg *mem, | ||
331 | uint32_t *new_flags); | ||
332 | |||
319 | /** | 333 | /** |
320 | * ttm_bo_validate | 334 | * ttm_bo_validate |
321 | * | 335 | * |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index e6b41f42602b..3db25df396cb 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -159,6 +159,7 @@ struct bcma_host_ops { | |||
159 | #define BCMA_CORE_DEFAULT 0xFFF | 159 | #define BCMA_CORE_DEFAULT 0xFFF |
160 | 160 | ||
161 | #define BCMA_MAX_NR_CORES 16 | 161 | #define BCMA_MAX_NR_CORES 16 |
162 | #define BCMA_CORE_SIZE 0x1000 | ||
162 | 163 | ||
163 | /* Chip IDs of PCIe devices */ | 164 | /* Chip IDs of PCIe devices */ |
164 | #define BCMA_CHIP_ID_BCM4313 0x4313 | 165 | #define BCMA_CHIP_ID_BCM4313 0x4313 |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 15d816a8b755..a16439b99fd9 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -484,7 +484,11 @@ static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) | |||
484 | } | 484 | } |
485 | #endif /* CONFIG_DEBUG_SET_MODULE_RONX */ | 485 | #endif /* CONFIG_DEBUG_SET_MODULE_RONX */ |
486 | 486 | ||
487 | int sk_filter(struct sock *sk, struct sk_buff *skb); | 487 | int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap); |
488 | static inline int sk_filter(struct sock *sk, struct sk_buff *skb) | ||
489 | { | ||
490 | return sk_filter_trim_cap(sk, skb, 1); | ||
491 | } | ||
488 | 492 | ||
489 | struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err); | 493 | struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err); |
490 | void bpf_prog_free(struct bpf_prog *fp); | 494 | void bpf_prog_free(struct bpf_prog *fp); |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 419fb9e03447..f0a7a0320300 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -94,7 +94,7 @@ static inline int split_huge_page(struct page *page) | |||
94 | void deferred_split_huge_page(struct page *page); | 94 | void deferred_split_huge_page(struct page *page); |
95 | 95 | ||
96 | void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | 96 | void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, |
97 | unsigned long address, bool freeze); | 97 | unsigned long address, bool freeze, struct page *page); |
98 | 98 | ||
99 | #define split_huge_pmd(__vma, __pmd, __address) \ | 99 | #define split_huge_pmd(__vma, __pmd, __address) \ |
100 | do { \ | 100 | do { \ |
@@ -102,7 +102,7 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | |||
102 | if (pmd_trans_huge(*____pmd) \ | 102 | if (pmd_trans_huge(*____pmd) \ |
103 | || pmd_devmap(*____pmd)) \ | 103 | || pmd_devmap(*____pmd)) \ |
104 | __split_huge_pmd(__vma, __pmd, __address, \ | 104 | __split_huge_pmd(__vma, __pmd, __address, \ |
105 | false); \ | 105 | false, NULL); \ |
106 | } while (0) | 106 | } while (0) |
107 | 107 | ||
108 | 108 | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index a805474df4ab..56e6069d2452 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -97,6 +97,11 @@ enum mem_cgroup_events_target { | |||
97 | #define MEM_CGROUP_ID_SHIFT 16 | 97 | #define MEM_CGROUP_ID_SHIFT 16 |
98 | #define MEM_CGROUP_ID_MAX USHRT_MAX | 98 | #define MEM_CGROUP_ID_MAX USHRT_MAX |
99 | 99 | ||
100 | struct mem_cgroup_id { | ||
101 | int id; | ||
102 | atomic_t ref; | ||
103 | }; | ||
104 | |||
100 | struct mem_cgroup_stat_cpu { | 105 | struct mem_cgroup_stat_cpu { |
101 | long count[MEMCG_NR_STAT]; | 106 | long count[MEMCG_NR_STAT]; |
102 | unsigned long events[MEMCG_NR_EVENTS]; | 107 | unsigned long events[MEMCG_NR_EVENTS]; |
@@ -172,6 +177,9 @@ enum memcg_kmem_state { | |||
172 | struct mem_cgroup { | 177 | struct mem_cgroup { |
173 | struct cgroup_subsys_state css; | 178 | struct cgroup_subsys_state css; |
174 | 179 | ||
180 | /* Private memcg ID. Used to ID objects that outlive the cgroup */ | ||
181 | struct mem_cgroup_id id; | ||
182 | |||
175 | /* Accounted resources */ | 183 | /* Accounted resources */ |
176 | struct page_counter memory; | 184 | struct page_counter memory; |
177 | struct page_counter swap; | 185 | struct page_counter swap; |
@@ -330,22 +338,9 @@ static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg) | |||
330 | if (mem_cgroup_disabled()) | 338 | if (mem_cgroup_disabled()) |
331 | return 0; | 339 | return 0; |
332 | 340 | ||
333 | return memcg->css.id; | 341 | return memcg->id.id; |
334 | } | ||
335 | |||
336 | /** | ||
337 | * mem_cgroup_from_id - look up a memcg from an id | ||
338 | * @id: the id to look up | ||
339 | * | ||
340 | * Caller must hold rcu_read_lock() and use css_tryget() as necessary. | ||
341 | */ | ||
342 | static inline struct mem_cgroup *mem_cgroup_from_id(unsigned short id) | ||
343 | { | ||
344 | struct cgroup_subsys_state *css; | ||
345 | |||
346 | css = css_from_id(id, &memory_cgrp_subsys); | ||
347 | return mem_cgroup_from_css(css); | ||
348 | } | 342 | } |
343 | struct mem_cgroup *mem_cgroup_from_id(unsigned short id); | ||
349 | 344 | ||
350 | /** | 345 | /** |
351 | * parent_mem_cgroup - find the accounting parent of a memcg | 346 | * parent_mem_cgroup - find the accounting parent of a memcg |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index fab9a1c2a2ac..43c749b1b619 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -4209,6 +4209,13 @@ static inline void netif_keep_dst(struct net_device *dev) | |||
4209 | dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM); | 4209 | dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM); |
4210 | } | 4210 | } |
4211 | 4211 | ||
4212 | /* return true if dev can't cope with mtu frames that need vlan tag insertion */ | ||
4213 | static inline bool netif_reduces_vlan_mtu(struct net_device *dev) | ||
4214 | { | ||
4215 | /* TODO: reserve and use an additional IFF bit, if we get more users */ | ||
4216 | return dev->priv_flags & IFF_MACSEC; | ||
4217 | } | ||
4218 | |||
4212 | extern struct pernet_operations __net_initdata loopback_net_ops; | 4219 | extern struct pernet_operations __net_initdata loopback_net_ops; |
4213 | 4220 | ||
4214 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 4221 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 5b5a80cc5926..c818772d9f9d 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -43,10 +43,8 @@ struct posix_acl_entry { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | struct posix_acl { | 45 | struct posix_acl { |
46 | union { | 46 | atomic_t a_refcount; |
47 | atomic_t a_refcount; | 47 | struct rcu_head a_rcu; |
48 | struct rcu_head a_rcu; | ||
49 | }; | ||
50 | unsigned int a_count; | 48 | unsigned int a_count; |
51 | struct posix_acl_entry a_entries[0]; | 49 | struct posix_acl_entry a_entries[0]; |
52 | }; | 50 | }; |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index cb4b7e8cee81..eca6f626c16e 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -407,6 +407,7 @@ static inline __must_check | |||
407 | void **radix_tree_iter_retry(struct radix_tree_iter *iter) | 407 | void **radix_tree_iter_retry(struct radix_tree_iter *iter) |
408 | { | 408 | { |
409 | iter->next_index = iter->index; | 409 | iter->next_index = iter->index; |
410 | iter->tags = 0; | ||
410 | return NULL; | 411 | return NULL; |
411 | } | 412 | } |
412 | 413 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 49eb4f8ebac9..2b0fad83683f 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -158,7 +158,7 @@ struct anon_vma *page_get_anon_vma(struct page *page); | |||
158 | /* | 158 | /* |
159 | * rmap interfaces called when adding or removing pte of page | 159 | * rmap interfaces called when adding or removing pte of page |
160 | */ | 160 | */ |
161 | void page_move_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 161 | void page_move_anon_rmap(struct page *, struct vm_area_struct *); |
162 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, | 162 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, |
163 | unsigned long, bool); | 163 | unsigned long, bool); |
164 | void do_page_add_anon_rmap(struct page *, struct vm_area_struct *, | 164 | void do_page_add_anon_rmap(struct page *, struct vm_area_struct *, |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 5d3397f34583..092ca19fa044 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -287,6 +287,14 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb) | |||
287 | return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK; | 287 | return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK; |
288 | } | 288 | } |
289 | 289 | ||
290 | /* jiffies until ct expires, 0 if already expired */ | ||
291 | static inline unsigned long nf_ct_expires(const struct nf_conn *ct) | ||
292 | { | ||
293 | long timeout = (long)ct->timeout.expires - (long)jiffies; | ||
294 | |||
295 | return timeout > 0 ? timeout : 0; | ||
296 | } | ||
297 | |||
290 | struct kernel_param; | 298 | struct kernel_param; |
291 | 299 | ||
292 | int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); | 300 | int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); |
diff --git a/include/net/sock.h b/include/net/sock.h index 649d2a8c17fc..ff5be7e8ddea 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1576,7 +1576,13 @@ static inline void sock_put(struct sock *sk) | |||
1576 | */ | 1576 | */ |
1577 | void sock_gen_put(struct sock *sk); | 1577 | void sock_gen_put(struct sock *sk); |
1578 | 1578 | ||
1579 | int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested); | 1579 | int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested, |
1580 | unsigned int trim_cap); | ||
1581 | static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb, | ||
1582 | const int nested) | ||
1583 | { | ||
1584 | return __sk_receive_skb(sk, skb, nested, 1); | ||
1585 | } | ||
1580 | 1586 | ||
1581 | static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) | 1587 | static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) |
1582 | { | 1588 | { |
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 9023e3e3be0b..62f6a967a1b7 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -60,7 +60,7 @@ struct switchdev_attr { | |||
60 | struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */ | 60 | struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */ |
61 | u8 stp_state; /* PORT_STP_STATE */ | 61 | u8 stp_state; /* PORT_STP_STATE */ |
62 | unsigned long brport_flags; /* PORT_BRIDGE_FLAGS */ | 62 | unsigned long brport_flags; /* PORT_BRIDGE_FLAGS */ |
63 | u32 ageing_time; /* BRIDGE_AGEING_TIME */ | 63 | clock_t ageing_time; /* BRIDGE_AGEING_TIME */ |
64 | bool vlan_filtering; /* BRIDGE_VLAN_FILTERING */ | 64 | bool vlan_filtering; /* BRIDGE_VLAN_FILTERING */ |
65 | } u; | 65 | } u; |
66 | }; | 66 | }; |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 8bdae34d1f9a..ec10cfef166a 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
@@ -245,6 +245,7 @@ endif | |||
245 | header-y += hw_breakpoint.h | 245 | header-y += hw_breakpoint.h |
246 | header-y += l2tp.h | 246 | header-y += l2tp.h |
247 | header-y += libc-compat.h | 247 | header-y += libc-compat.h |
248 | header-y += lirc.h | ||
248 | header-y += limits.h | 249 | header-y += limits.h |
249 | header-y += llc.h | 250 | header-y += llc.h |
250 | header-y += loop.h | 251 | header-y += loop.h |
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 737fa32faad4..d6d071fc3c56 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h | |||
@@ -780,6 +780,7 @@ | |||
780 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | 780 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ |
781 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ | 781 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ |
782 | #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ | 782 | #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ |
783 | #define SW_PEN_INSERTED 0x0f /* set = pen inserted */ | ||
783 | #define SW_MAX 0x0f | 784 | #define SW_MAX 0x0f |
784 | #define SW_CNT (SW_MAX+1) | 785 | #define SW_CNT (SW_MAX+1) |
785 | 786 | ||
diff --git a/init/Kconfig b/init/Kconfig index f755a602d4a1..c02d89777713 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -1458,6 +1458,7 @@ config KALLSYMS_ALL | |||
1458 | 1458 | ||
1459 | config KALLSYMS_ABSOLUTE_PERCPU | 1459 | config KALLSYMS_ABSOLUTE_PERCPU |
1460 | bool | 1460 | bool |
1461 | depends on KALLSYMS | ||
1461 | default X86_64 && SMP | 1462 | default X86_64 && SMP |
1462 | 1463 | ||
1463 | config KALLSYMS_BASE_RELATIVE | 1464 | config KALLSYMS_BASE_RELATIVE |
diff --git a/kernel/cpu.c b/kernel/cpu.c index d948e44c471e..7b61887f7ccd 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -1201,6 +1201,8 @@ static struct cpuhp_step cpuhp_bp_states[] = { | |||
1201 | .teardown = takedown_cpu, | 1201 | .teardown = takedown_cpu, |
1202 | .cant_stop = true, | 1202 | .cant_stop = true, |
1203 | }, | 1203 | }, |
1204 | #else | ||
1205 | [CPUHP_BRINGUP_CPU] = { }, | ||
1204 | #endif | 1206 | #endif |
1205 | }; | 1207 | }; |
1206 | 1208 | ||
diff --git a/kernel/events/core.c b/kernel/events/core.c index b1891b6b5c1f..195e765079dd 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -1678,12 +1678,33 @@ static bool is_orphaned_event(struct perf_event *event) | |||
1678 | return event->state == PERF_EVENT_STATE_DEAD; | 1678 | return event->state == PERF_EVENT_STATE_DEAD; |
1679 | } | 1679 | } |
1680 | 1680 | ||
1681 | static inline int pmu_filter_match(struct perf_event *event) | 1681 | static inline int __pmu_filter_match(struct perf_event *event) |
1682 | { | 1682 | { |
1683 | struct pmu *pmu = event->pmu; | 1683 | struct pmu *pmu = event->pmu; |
1684 | return pmu->filter_match ? pmu->filter_match(event) : 1; | 1684 | return pmu->filter_match ? pmu->filter_match(event) : 1; |
1685 | } | 1685 | } |
1686 | 1686 | ||
1687 | /* | ||
1688 | * Check whether we should attempt to schedule an event group based on | ||
1689 | * PMU-specific filtering. An event group can consist of HW and SW events, | ||
1690 | * potentially with a SW leader, so we must check all the filters, to | ||
1691 | * determine whether a group is schedulable: | ||
1692 | */ | ||
1693 | static inline int pmu_filter_match(struct perf_event *event) | ||
1694 | { | ||
1695 | struct perf_event *child; | ||
1696 | |||
1697 | if (!__pmu_filter_match(event)) | ||
1698 | return 0; | ||
1699 | |||
1700 | list_for_each_entry(child, &event->sibling_list, group_entry) { | ||
1701 | if (!__pmu_filter_match(child)) | ||
1702 | return 0; | ||
1703 | } | ||
1704 | |||
1705 | return 1; | ||
1706 | } | ||
1707 | |||
1687 | static inline int | 1708 | static inline int |
1688 | event_filter_match(struct perf_event *event) | 1709 | event_filter_match(struct perf_event *event) |
1689 | { | 1710 | { |
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c index e25e92fb44fa..6a5c239c7669 100644 --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/vmalloc.h> | 18 | #include <linux/vmalloc.h> |
19 | #include "gcov.h" | 19 | #include "gcov.h" |
20 | 20 | ||
21 | #if __GNUC__ == 5 && __GNUC_MINOR__ >= 1 | 21 | #if (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) |
22 | #define GCOV_COUNTERS 10 | 22 | #define GCOV_COUNTERS 10 |
23 | #elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 | 23 | #elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 |
24 | #define GCOV_COUNTERS 9 | 24 | #define GCOV_COUNTERS 9 |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 51d7105f529a..97ee9ac7e97c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -5394,13 +5394,15 @@ void idle_task_exit(void) | |||
5394 | /* | 5394 | /* |
5395 | * Since this CPU is going 'away' for a while, fold any nr_active delta | 5395 | * Since this CPU is going 'away' for a while, fold any nr_active delta |
5396 | * we might have. Assumes we're called after migrate_tasks() so that the | 5396 | * we might have. Assumes we're called after migrate_tasks() so that the |
5397 | * nr_active count is stable. | 5397 | * nr_active count is stable. We need to take the teardown thread which |
5398 | * is calling this into account, so we hand in adjust = 1 to the load | ||
5399 | * calculation. | ||
5398 | * | 5400 | * |
5399 | * Also see the comment "Global load-average calculations". | 5401 | * Also see the comment "Global load-average calculations". |
5400 | */ | 5402 | */ |
5401 | static void calc_load_migrate(struct rq *rq) | 5403 | static void calc_load_migrate(struct rq *rq) |
5402 | { | 5404 | { |
5403 | long delta = calc_load_fold_active(rq); | 5405 | long delta = calc_load_fold_active(rq, 1); |
5404 | if (delta) | 5406 | if (delta) |
5405 | atomic_long_add(delta, &calc_load_tasks); | 5407 | atomic_long_add(delta, &calc_load_tasks); |
5406 | } | 5408 | } |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bdcbeea90c95..c8c5d2d48424 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -735,8 +735,6 @@ void post_init_entity_util_avg(struct sched_entity *se) | |||
735 | } | 735 | } |
736 | } | 736 | } |
737 | 737 | ||
738 | static inline unsigned long cfs_rq_runnable_load_avg(struct cfs_rq *cfs_rq); | ||
739 | static inline unsigned long cfs_rq_load_avg(struct cfs_rq *cfs_rq); | ||
740 | #else | 738 | #else |
741 | void init_entity_runnable_average(struct sched_entity *se) | 739 | void init_entity_runnable_average(struct sched_entity *se) |
742 | { | 740 | { |
@@ -2499,28 +2497,22 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
2499 | 2497 | ||
2500 | #ifdef CONFIG_FAIR_GROUP_SCHED | 2498 | #ifdef CONFIG_FAIR_GROUP_SCHED |
2501 | # ifdef CONFIG_SMP | 2499 | # ifdef CONFIG_SMP |
2502 | static inline long calc_tg_weight(struct task_group *tg, struct cfs_rq *cfs_rq) | 2500 | static long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg) |
2503 | { | 2501 | { |
2504 | long tg_weight; | 2502 | long tg_weight, load, shares; |
2505 | 2503 | ||
2506 | /* | 2504 | /* |
2507 | * Use this CPU's real-time load instead of the last load contribution | 2505 | * This really should be: cfs_rq->avg.load_avg, but instead we use |
2508 | * as the updating of the contribution is delayed, and we will use the | 2506 | * cfs_rq->load.weight, which is its upper bound. This helps ramp up |
2509 | * the real-time load to calc the share. See update_tg_load_avg(). | 2507 | * the shares for small weight interactive tasks. |
2510 | */ | 2508 | */ |
2511 | tg_weight = atomic_long_read(&tg->load_avg); | 2509 | load = scale_load_down(cfs_rq->load.weight); |
2512 | tg_weight -= cfs_rq->tg_load_avg_contrib; | ||
2513 | tg_weight += cfs_rq->load.weight; | ||
2514 | 2510 | ||
2515 | return tg_weight; | 2511 | tg_weight = atomic_long_read(&tg->load_avg); |
2516 | } | ||
2517 | |||
2518 | static long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg) | ||
2519 | { | ||
2520 | long tg_weight, load, shares; | ||
2521 | 2512 | ||
2522 | tg_weight = calc_tg_weight(tg, cfs_rq); | 2513 | /* Ensure tg_weight >= load */ |
2523 | load = cfs_rq->load.weight; | 2514 | tg_weight -= cfs_rq->tg_load_avg_contrib; |
2515 | tg_weight += load; | ||
2524 | 2516 | ||
2525 | shares = (tg->shares * load); | 2517 | shares = (tg->shares * load); |
2526 | if (tg_weight) | 2518 | if (tg_weight) |
@@ -2539,6 +2531,7 @@ static inline long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg) | |||
2539 | return tg->shares; | 2531 | return tg->shares; |
2540 | } | 2532 | } |
2541 | # endif /* CONFIG_SMP */ | 2533 | # endif /* CONFIG_SMP */ |
2534 | |||
2542 | static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, | 2535 | static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, |
2543 | unsigned long weight) | 2536 | unsigned long weight) |
2544 | { | 2537 | { |
@@ -4946,19 +4939,24 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg) | |||
4946 | return wl; | 4939 | return wl; |
4947 | 4940 | ||
4948 | for_each_sched_entity(se) { | 4941 | for_each_sched_entity(se) { |
4949 | long w, W; | 4942 | struct cfs_rq *cfs_rq = se->my_q; |
4943 | long W, w = cfs_rq_load_avg(cfs_rq); | ||
4950 | 4944 | ||
4951 | tg = se->my_q->tg; | 4945 | tg = cfs_rq->tg; |
4952 | 4946 | ||
4953 | /* | 4947 | /* |
4954 | * W = @wg + \Sum rw_j | 4948 | * W = @wg + \Sum rw_j |
4955 | */ | 4949 | */ |
4956 | W = wg + calc_tg_weight(tg, se->my_q); | 4950 | W = wg + atomic_long_read(&tg->load_avg); |
4951 | |||
4952 | /* Ensure \Sum rw_j >= rw_i */ | ||
4953 | W -= cfs_rq->tg_load_avg_contrib; | ||
4954 | W += w; | ||
4957 | 4955 | ||
4958 | /* | 4956 | /* |
4959 | * w = rw_i + @wl | 4957 | * w = rw_i + @wl |
4960 | */ | 4958 | */ |
4961 | w = cfs_rq_load_avg(se->my_q) + wl; | 4959 | w += wl; |
4962 | 4960 | ||
4963 | /* | 4961 | /* |
4964 | * wl = S * s'_i; see (2) | 4962 | * wl = S * s'_i; see (2) |
diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c index b0b93fd33af9..a2d6eb71f06b 100644 --- a/kernel/sched/loadavg.c +++ b/kernel/sched/loadavg.c | |||
@@ -78,11 +78,11 @@ void get_avenrun(unsigned long *loads, unsigned long offset, int shift) | |||
78 | loads[2] = (avenrun[2] + offset) << shift; | 78 | loads[2] = (avenrun[2] + offset) << shift; |
79 | } | 79 | } |
80 | 80 | ||
81 | long calc_load_fold_active(struct rq *this_rq) | 81 | long calc_load_fold_active(struct rq *this_rq, long adjust) |
82 | { | 82 | { |
83 | long nr_active, delta = 0; | 83 | long nr_active, delta = 0; |
84 | 84 | ||
85 | nr_active = this_rq->nr_running; | 85 | nr_active = this_rq->nr_running - adjust; |
86 | nr_active += (long)this_rq->nr_uninterruptible; | 86 | nr_active += (long)this_rq->nr_uninterruptible; |
87 | 87 | ||
88 | if (nr_active != this_rq->calc_load_active) { | 88 | if (nr_active != this_rq->calc_load_active) { |
@@ -188,7 +188,7 @@ void calc_load_enter_idle(void) | |||
188 | * We're going into NOHZ mode, if there's any pending delta, fold it | 188 | * We're going into NOHZ mode, if there's any pending delta, fold it |
189 | * into the pending idle delta. | 189 | * into the pending idle delta. |
190 | */ | 190 | */ |
191 | delta = calc_load_fold_active(this_rq); | 191 | delta = calc_load_fold_active(this_rq, 0); |
192 | if (delta) { | 192 | if (delta) { |
193 | int idx = calc_load_write_idx(); | 193 | int idx = calc_load_write_idx(); |
194 | 194 | ||
@@ -389,7 +389,7 @@ void calc_global_load_tick(struct rq *this_rq) | |||
389 | if (time_before(jiffies, this_rq->calc_load_update)) | 389 | if (time_before(jiffies, this_rq->calc_load_update)) |
390 | return; | 390 | return; |
391 | 391 | ||
392 | delta = calc_load_fold_active(this_rq); | 392 | delta = calc_load_fold_active(this_rq, 0); |
393 | if (delta) | 393 | if (delta) |
394 | atomic_long_add(delta, &calc_load_tasks); | 394 | atomic_long_add(delta, &calc_load_tasks); |
395 | 395 | ||
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 7cbeb92a1cb9..898c0d2f18fe 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
@@ -28,7 +28,7 @@ extern unsigned long calc_load_update; | |||
28 | extern atomic_long_t calc_load_tasks; | 28 | extern atomic_long_t calc_load_tasks; |
29 | 29 | ||
30 | extern void calc_global_load_tick(struct rq *this_rq); | 30 | extern void calc_global_load_tick(struct rq *this_rq); |
31 | extern long calc_load_fold_active(struct rq *this_rq); | 31 | extern long calc_load_fold_active(struct rq *this_rq, long adjust); |
32 | 32 | ||
33 | #ifdef CONFIG_SMP | 33 | #ifdef CONFIG_SMP |
34 | extern void cpu_load_update_active(struct rq *this_rq); | 34 | extern void cpu_load_update_active(struct rq *this_rq); |
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 1cafba860b08..39008d78927a 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c | |||
@@ -777,6 +777,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp) | |||
777 | timer->it.cpu.expires = 0; | 777 | timer->it.cpu.expires = 0; |
778 | sample_to_timespec(timer->it_clock, timer->it.cpu.expires, | 778 | sample_to_timespec(timer->it_clock, timer->it.cpu.expires, |
779 | &itp->it_value); | 779 | &itp->it_value); |
780 | return; | ||
780 | } else { | 781 | } else { |
781 | cpu_timer_sample_group(timer->it_clock, p, &now); | 782 | cpu_timer_sample_group(timer->it_clock, p, &now); |
782 | unlock_task_sighand(p, &flags); | 783 | unlock_task_sighand(p, &flags); |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index e1c0e996b5ae..97e7b793df35 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -4600,15 +4600,11 @@ static void restore_unbound_workers_cpumask(struct worker_pool *pool, int cpu) | |||
4600 | if (!cpumask_test_cpu(cpu, pool->attrs->cpumask)) | 4600 | if (!cpumask_test_cpu(cpu, pool->attrs->cpumask)) |
4601 | return; | 4601 | return; |
4602 | 4602 | ||
4603 | /* is @cpu the only online CPU? */ | ||
4604 | cpumask_and(&cpumask, pool->attrs->cpumask, cpu_online_mask); | 4603 | cpumask_and(&cpumask, pool->attrs->cpumask, cpu_online_mask); |
4605 | if (cpumask_weight(&cpumask) != 1) | ||
4606 | return; | ||
4607 | 4604 | ||
4608 | /* as we're called from CPU_ONLINE, the following shouldn't fail */ | 4605 | /* as we're called from CPU_ONLINE, the following shouldn't fail */ |
4609 | for_each_pool_worker(worker, pool) | 4606 | for_each_pool_worker(worker, pool) |
4610 | WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, | 4607 | WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, &cpumask) < 0); |
4611 | pool->attrs->cpumask) < 0); | ||
4612 | } | 4608 | } |
4613 | 4609 | ||
4614 | /* | 4610 | /* |
diff --git a/mm/compaction.c b/mm/compaction.c index 79bfe0e06907..7bc04778f84d 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -1009,8 +1009,6 @@ static void isolate_freepages(struct compact_control *cc) | |||
1009 | block_end_pfn = block_start_pfn, | 1009 | block_end_pfn = block_start_pfn, |
1010 | block_start_pfn -= pageblock_nr_pages, | 1010 | block_start_pfn -= pageblock_nr_pages, |
1011 | isolate_start_pfn = block_start_pfn) { | 1011 | isolate_start_pfn = block_start_pfn) { |
1012 | unsigned long isolated; | ||
1013 | |||
1014 | /* | 1012 | /* |
1015 | * This can iterate a massively long zone without finding any | 1013 | * This can iterate a massively long zone without finding any |
1016 | * suitable migration targets, so periodically check if we need | 1014 | * suitable migration targets, so periodically check if we need |
@@ -1034,36 +1032,30 @@ static void isolate_freepages(struct compact_control *cc) | |||
1034 | continue; | 1032 | continue; |
1035 | 1033 | ||
1036 | /* Found a block suitable for isolating free pages from. */ | 1034 | /* Found a block suitable for isolating free pages from. */ |
1037 | isolated = isolate_freepages_block(cc, &isolate_start_pfn, | 1035 | isolate_freepages_block(cc, &isolate_start_pfn, block_end_pfn, |
1038 | block_end_pfn, freelist, false); | 1036 | freelist, false); |
1039 | /* If isolation failed early, do not continue needlessly */ | ||
1040 | if (!isolated && isolate_start_pfn < block_end_pfn && | ||
1041 | cc->nr_migratepages > cc->nr_freepages) | ||
1042 | break; | ||
1043 | 1037 | ||
1044 | /* | 1038 | /* |
1045 | * If we isolated enough freepages, or aborted due to async | 1039 | * If we isolated enough freepages, or aborted due to lock |
1046 | * compaction being contended, terminate the loop. | 1040 | * contention, terminate. |
1047 | * Remember where the free scanner should restart next time, | ||
1048 | * which is where isolate_freepages_block() left off. | ||
1049 | * But if it scanned the whole pageblock, isolate_start_pfn | ||
1050 | * now points at block_end_pfn, which is the start of the next | ||
1051 | * pageblock. | ||
1052 | * In that case we will however want to restart at the start | ||
1053 | * of the previous pageblock. | ||
1054 | */ | 1041 | */ |
1055 | if ((cc->nr_freepages >= cc->nr_migratepages) | 1042 | if ((cc->nr_freepages >= cc->nr_migratepages) |
1056 | || cc->contended) { | 1043 | || cc->contended) { |
1057 | if (isolate_start_pfn >= block_end_pfn) | 1044 | if (isolate_start_pfn >= block_end_pfn) { |
1045 | /* | ||
1046 | * Restart at previous pageblock if more | ||
1047 | * freepages can be isolated next time. | ||
1048 | */ | ||
1058 | isolate_start_pfn = | 1049 | isolate_start_pfn = |
1059 | block_start_pfn - pageblock_nr_pages; | 1050 | block_start_pfn - pageblock_nr_pages; |
1051 | } | ||
1060 | break; | 1052 | break; |
1061 | } else { | 1053 | } else if (isolate_start_pfn < block_end_pfn) { |
1062 | /* | 1054 | /* |
1063 | * isolate_freepages_block() should not terminate | 1055 | * If isolation failed early, do not continue |
1064 | * prematurely unless contended, or isolated enough | 1056 | * needlessly. |
1065 | */ | 1057 | */ |
1066 | VM_BUG_ON(isolate_start_pfn < block_end_pfn); | 1058 | break; |
1067 | } | 1059 | } |
1068 | } | 1060 | } |
1069 | 1061 | ||
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 9ed58530f695..343a2b7e57aa 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1624,14 +1624,9 @@ int madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, | |||
1624 | if (next - addr != HPAGE_PMD_SIZE) { | 1624 | if (next - addr != HPAGE_PMD_SIZE) { |
1625 | get_page(page); | 1625 | get_page(page); |
1626 | spin_unlock(ptl); | 1626 | spin_unlock(ptl); |
1627 | if (split_huge_page(page)) { | 1627 | split_huge_page(page); |
1628 | put_page(page); | ||
1629 | unlock_page(page); | ||
1630 | goto out_unlocked; | ||
1631 | } | ||
1632 | put_page(page); | 1628 | put_page(page); |
1633 | unlock_page(page); | 1629 | unlock_page(page); |
1634 | ret = 1; | ||
1635 | goto out_unlocked; | 1630 | goto out_unlocked; |
1636 | } | 1631 | } |
1637 | 1632 | ||
@@ -2989,7 +2984,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, | |||
2989 | } | 2984 | } |
2990 | 2985 | ||
2991 | void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | 2986 | void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, |
2992 | unsigned long address, bool freeze) | 2987 | unsigned long address, bool freeze, struct page *page) |
2993 | { | 2988 | { |
2994 | spinlock_t *ptl; | 2989 | spinlock_t *ptl; |
2995 | struct mm_struct *mm = vma->vm_mm; | 2990 | struct mm_struct *mm = vma->vm_mm; |
@@ -2997,8 +2992,17 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | |||
2997 | 2992 | ||
2998 | mmu_notifier_invalidate_range_start(mm, haddr, haddr + HPAGE_PMD_SIZE); | 2993 | mmu_notifier_invalidate_range_start(mm, haddr, haddr + HPAGE_PMD_SIZE); |
2999 | ptl = pmd_lock(mm, pmd); | 2994 | ptl = pmd_lock(mm, pmd); |
2995 | |||
2996 | /* | ||
2997 | * If caller asks to setup a migration entries, we need a page to check | ||
2998 | * pmd against. Otherwise we can end up replacing wrong page. | ||
2999 | */ | ||
3000 | VM_BUG_ON(freeze && !page); | ||
3001 | if (page && page != pmd_page(*pmd)) | ||
3002 | goto out; | ||
3003 | |||
3000 | if (pmd_trans_huge(*pmd)) { | 3004 | if (pmd_trans_huge(*pmd)) { |
3001 | struct page *page = pmd_page(*pmd); | 3005 | page = pmd_page(*pmd); |
3002 | if (PageMlocked(page)) | 3006 | if (PageMlocked(page)) |
3003 | clear_page_mlock(page); | 3007 | clear_page_mlock(page); |
3004 | } else if (!pmd_devmap(*pmd)) | 3008 | } else if (!pmd_devmap(*pmd)) |
@@ -3025,24 +3029,8 @@ void split_huge_pmd_address(struct vm_area_struct *vma, unsigned long address, | |||
3025 | return; | 3029 | return; |
3026 | 3030 | ||
3027 | pmd = pmd_offset(pud, address); | 3031 | pmd = pmd_offset(pud, address); |
3028 | if (!pmd_present(*pmd) || (!pmd_trans_huge(*pmd) && !pmd_devmap(*pmd))) | ||
3029 | return; | ||
3030 | 3032 | ||
3031 | /* | 3033 | __split_huge_pmd(vma, pmd, address, freeze, page); |
3032 | * If caller asks to setup a migration entries, we need a page to check | ||
3033 | * pmd against. Otherwise we can end up replacing wrong page. | ||
3034 | */ | ||
3035 | VM_BUG_ON(freeze && !page); | ||
3036 | if (page && page != pmd_page(*pmd)) | ||
3037 | return; | ||
3038 | |||
3039 | /* | ||
3040 | * Caller holds the mmap_sem write mode or the anon_vma lock, | ||
3041 | * so a huge pmd cannot materialize from under us (khugepaged | ||
3042 | * holds both the mmap_sem write mode and the anon_vma lock | ||
3043 | * write mode). | ||
3044 | */ | ||
3045 | __split_huge_pmd(vma, pmd, address, freeze); | ||
3046 | } | 3034 | } |
3047 | 3035 | ||
3048 | void vma_adjust_trans_huge(struct vm_area_struct *vma, | 3036 | void vma_adjust_trans_huge(struct vm_area_struct *vma, |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c1f3c0be150a..addfe4accc07 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -3383,7 +3383,7 @@ retry_avoidcopy: | |||
3383 | /* If no-one else is actually using this page, avoid the copy | 3383 | /* If no-one else is actually using this page, avoid the copy |
3384 | * and just make the page writable */ | 3384 | * and just make the page writable */ |
3385 | if (page_mapcount(old_page) == 1 && PageAnon(old_page)) { | 3385 | if (page_mapcount(old_page) == 1 && PageAnon(old_page)) { |
3386 | page_move_anon_rmap(old_page, vma, address); | 3386 | page_move_anon_rmap(old_page, vma); |
3387 | set_huge_ptep_writable(vma, address, ptep); | 3387 | set_huge_ptep_writable(vma, address, ptep); |
3388 | return 0; | 3388 | return 0; |
3389 | } | 3389 | } |
diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c index 4973505a9bdd..65793f150d1f 100644 --- a/mm/kasan/quarantine.c +++ b/mm/kasan/quarantine.c | |||
@@ -238,30 +238,23 @@ static void qlist_move_cache(struct qlist_head *from, | |||
238 | struct qlist_head *to, | 238 | struct qlist_head *to, |
239 | struct kmem_cache *cache) | 239 | struct kmem_cache *cache) |
240 | { | 240 | { |
241 | struct qlist_node *prev = NULL, *curr; | 241 | struct qlist_node *curr; |
242 | 242 | ||
243 | if (unlikely(qlist_empty(from))) | 243 | if (unlikely(qlist_empty(from))) |
244 | return; | 244 | return; |
245 | 245 | ||
246 | curr = from->head; | 246 | curr = from->head; |
247 | qlist_init(from); | ||
247 | while (curr) { | 248 | while (curr) { |
248 | struct qlist_node *qlink = curr; | 249 | struct qlist_node *next = curr->next; |
249 | struct kmem_cache *obj_cache = qlink_to_cache(qlink); | 250 | struct kmem_cache *obj_cache = qlink_to_cache(curr); |
250 | 251 | ||
251 | if (obj_cache == cache) { | 252 | if (obj_cache == cache) |
252 | if (unlikely(from->head == qlink)) { | 253 | qlist_put(to, curr, obj_cache->size); |
253 | from->head = curr->next; | 254 | else |
254 | prev = curr; | 255 | qlist_put(from, curr, obj_cache->size); |
255 | } else | 256 | |
256 | prev->next = curr->next; | 257 | curr = next; |
257 | if (unlikely(from->tail == qlink)) | ||
258 | from->tail = curr->next; | ||
259 | from->bytes -= cache->size; | ||
260 | qlist_put(to, qlink, cache->size); | ||
261 | } else { | ||
262 | prev = curr; | ||
263 | } | ||
264 | curr = curr->next; | ||
265 | } | 258 | } |
266 | } | 259 | } |
267 | 260 | ||
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ac8664db3823..5339c89dff63 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4057,6 +4057,60 @@ static struct cftype mem_cgroup_legacy_files[] = { | |||
4057 | { }, /* terminate */ | 4057 | { }, /* terminate */ |
4058 | }; | 4058 | }; |
4059 | 4059 | ||
4060 | /* | ||
4061 | * Private memory cgroup IDR | ||
4062 | * | ||
4063 | * Swap-out records and page cache shadow entries need to store memcg | ||
4064 | * references in constrained space, so we maintain an ID space that is | ||
4065 | * limited to 16 bit (MEM_CGROUP_ID_MAX), limiting the total number of | ||
4066 | * memory-controlled cgroups to 64k. | ||
4067 | * | ||
4068 | * However, there usually are many references to the oflline CSS after | ||
4069 | * the cgroup has been destroyed, such as page cache or reclaimable | ||
4070 | * slab objects, that don't need to hang on to the ID. We want to keep | ||
4071 | * those dead CSS from occupying IDs, or we might quickly exhaust the | ||
4072 | * relatively small ID space and prevent the creation of new cgroups | ||
4073 | * even when there are much fewer than 64k cgroups - possibly none. | ||
4074 | * | ||
4075 | * Maintain a private 16-bit ID space for memcg, and allow the ID to | ||
4076 | * be freed and recycled when it's no longer needed, which is usually | ||
4077 | * when the CSS is offlined. | ||
4078 | * | ||
4079 | * The only exception to that are records of swapped out tmpfs/shmem | ||
4080 | * pages that need to be attributed to live ancestors on swapin. But | ||
4081 | * those references are manageable from userspace. | ||
4082 | */ | ||
4083 | |||
4084 | static DEFINE_IDR(mem_cgroup_idr); | ||
4085 | |||
4086 | static void mem_cgroup_id_get(struct mem_cgroup *memcg) | ||
4087 | { | ||
4088 | atomic_inc(&memcg->id.ref); | ||
4089 | } | ||
4090 | |||
4091 | static void mem_cgroup_id_put(struct mem_cgroup *memcg) | ||
4092 | { | ||
4093 | if (atomic_dec_and_test(&memcg->id.ref)) { | ||
4094 | idr_remove(&mem_cgroup_idr, memcg->id.id); | ||
4095 | memcg->id.id = 0; | ||
4096 | |||
4097 | /* Memcg ID pins CSS */ | ||
4098 | css_put(&memcg->css); | ||
4099 | } | ||
4100 | } | ||
4101 | |||
4102 | /** | ||
4103 | * mem_cgroup_from_id - look up a memcg from a memcg id | ||
4104 | * @id: the memcg id to look up | ||
4105 | * | ||
4106 | * Caller must hold rcu_read_lock(). | ||
4107 | */ | ||
4108 | struct mem_cgroup *mem_cgroup_from_id(unsigned short id) | ||
4109 | { | ||
4110 | WARN_ON_ONCE(!rcu_read_lock_held()); | ||
4111 | return idr_find(&mem_cgroup_idr, id); | ||
4112 | } | ||
4113 | |||
4060 | static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) | 4114 | static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) |
4061 | { | 4115 | { |
4062 | struct mem_cgroup_per_node *pn; | 4116 | struct mem_cgroup_per_node *pn; |
@@ -4116,6 +4170,12 @@ static struct mem_cgroup *mem_cgroup_alloc(void) | |||
4116 | if (!memcg) | 4170 | if (!memcg) |
4117 | return NULL; | 4171 | return NULL; |
4118 | 4172 | ||
4173 | memcg->id.id = idr_alloc(&mem_cgroup_idr, NULL, | ||
4174 | 1, MEM_CGROUP_ID_MAX, | ||
4175 | GFP_KERNEL); | ||
4176 | if (memcg->id.id < 0) | ||
4177 | goto fail; | ||
4178 | |||
4119 | memcg->stat = alloc_percpu(struct mem_cgroup_stat_cpu); | 4179 | memcg->stat = alloc_percpu(struct mem_cgroup_stat_cpu); |
4120 | if (!memcg->stat) | 4180 | if (!memcg->stat) |
4121 | goto fail; | 4181 | goto fail; |
@@ -4142,8 +4202,11 @@ static struct mem_cgroup *mem_cgroup_alloc(void) | |||
4142 | #ifdef CONFIG_CGROUP_WRITEBACK | 4202 | #ifdef CONFIG_CGROUP_WRITEBACK |
4143 | INIT_LIST_HEAD(&memcg->cgwb_list); | 4203 | INIT_LIST_HEAD(&memcg->cgwb_list); |
4144 | #endif | 4204 | #endif |
4205 | idr_replace(&mem_cgroup_idr, memcg, memcg->id.id); | ||
4145 | return memcg; | 4206 | return memcg; |
4146 | fail: | 4207 | fail: |
4208 | if (memcg->id.id > 0) | ||
4209 | idr_remove(&mem_cgroup_idr, memcg->id.id); | ||
4147 | mem_cgroup_free(memcg); | 4210 | mem_cgroup_free(memcg); |
4148 | return NULL; | 4211 | return NULL; |
4149 | } | 4212 | } |
@@ -4206,12 +4269,11 @@ fail: | |||
4206 | return ERR_PTR(-ENOMEM); | 4269 | return ERR_PTR(-ENOMEM); |
4207 | } | 4270 | } |
4208 | 4271 | ||
4209 | static int | 4272 | static int mem_cgroup_css_online(struct cgroup_subsys_state *css) |
4210 | mem_cgroup_css_online(struct cgroup_subsys_state *css) | ||
4211 | { | 4273 | { |
4212 | if (css->id > MEM_CGROUP_ID_MAX) | 4274 | /* Online state pins memcg ID, memcg ID pins CSS */ |
4213 | return -ENOSPC; | 4275 | mem_cgroup_id_get(mem_cgroup_from_css(css)); |
4214 | 4276 | css_get(css); | |
4215 | return 0; | 4277 | return 0; |
4216 | } | 4278 | } |
4217 | 4279 | ||
@@ -4234,6 +4296,8 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) | |||
4234 | 4296 | ||
4235 | memcg_offline_kmem(memcg); | 4297 | memcg_offline_kmem(memcg); |
4236 | wb_memcg_offline(memcg); | 4298 | wb_memcg_offline(memcg); |
4299 | |||
4300 | mem_cgroup_id_put(memcg); | ||
4237 | } | 4301 | } |
4238 | 4302 | ||
4239 | static void mem_cgroup_css_released(struct cgroup_subsys_state *css) | 4303 | static void mem_cgroup_css_released(struct cgroup_subsys_state *css) |
@@ -5756,6 +5820,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) | |||
5756 | if (!memcg) | 5820 | if (!memcg) |
5757 | return; | 5821 | return; |
5758 | 5822 | ||
5823 | mem_cgroup_id_get(memcg); | ||
5759 | oldid = swap_cgroup_record(entry, mem_cgroup_id(memcg)); | 5824 | oldid = swap_cgroup_record(entry, mem_cgroup_id(memcg)); |
5760 | VM_BUG_ON_PAGE(oldid, page); | 5825 | VM_BUG_ON_PAGE(oldid, page); |
5761 | mem_cgroup_swap_statistics(memcg, true); | 5826 | mem_cgroup_swap_statistics(memcg, true); |
@@ -5774,6 +5839,9 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) | |||
5774 | VM_BUG_ON(!irqs_disabled()); | 5839 | VM_BUG_ON(!irqs_disabled()); |
5775 | mem_cgroup_charge_statistics(memcg, page, false, -1); | 5840 | mem_cgroup_charge_statistics(memcg, page, false, -1); |
5776 | memcg_check_events(memcg, page); | 5841 | memcg_check_events(memcg, page); |
5842 | |||
5843 | if (!mem_cgroup_is_root(memcg)) | ||
5844 | css_put(&memcg->css); | ||
5777 | } | 5845 | } |
5778 | 5846 | ||
5779 | /* | 5847 | /* |
@@ -5804,11 +5872,11 @@ int mem_cgroup_try_charge_swap(struct page *page, swp_entry_t entry) | |||
5804 | !page_counter_try_charge(&memcg->swap, 1, &counter)) | 5872 | !page_counter_try_charge(&memcg->swap, 1, &counter)) |
5805 | return -ENOMEM; | 5873 | return -ENOMEM; |
5806 | 5874 | ||
5875 | mem_cgroup_id_get(memcg); | ||
5807 | oldid = swap_cgroup_record(entry, mem_cgroup_id(memcg)); | 5876 | oldid = swap_cgroup_record(entry, mem_cgroup_id(memcg)); |
5808 | VM_BUG_ON_PAGE(oldid, page); | 5877 | VM_BUG_ON_PAGE(oldid, page); |
5809 | mem_cgroup_swap_statistics(memcg, true); | 5878 | mem_cgroup_swap_statistics(memcg, true); |
5810 | 5879 | ||
5811 | css_get(&memcg->css); | ||
5812 | return 0; | 5880 | return 0; |
5813 | } | 5881 | } |
5814 | 5882 | ||
@@ -5837,7 +5905,7 @@ void mem_cgroup_uncharge_swap(swp_entry_t entry) | |||
5837 | page_counter_uncharge(&memcg->memsw, 1); | 5905 | page_counter_uncharge(&memcg->memsw, 1); |
5838 | } | 5906 | } |
5839 | mem_cgroup_swap_statistics(memcg, false); | 5907 | mem_cgroup_swap_statistics(memcg, false); |
5840 | css_put(&memcg->css); | 5908 | mem_cgroup_id_put(memcg); |
5841 | } | 5909 | } |
5842 | rcu_read_unlock(); | 5910 | rcu_read_unlock(); |
5843 | } | 5911 | } |
diff --git a/mm/memory.c b/mm/memory.c index cd1f29e4897e..9e046819e619 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2399,8 +2399,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2399 | * Protected against the rmap code by | 2399 | * Protected against the rmap code by |
2400 | * the page lock. | 2400 | * the page lock. |
2401 | */ | 2401 | */ |
2402 | page_move_anon_rmap(compound_head(old_page), | 2402 | page_move_anon_rmap(old_page, vma); |
2403 | vma, address); | ||
2404 | } | 2403 | } |
2405 | unlock_page(old_page); | 2404 | unlock_page(old_page); |
2406 | return wp_page_reuse(mm, vma, address, page_table, ptl, | 2405 | return wp_page_reuse(mm, vma, address, page_table, ptl, |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6903b695ebae..8b3e1341b754 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -286,7 +286,9 @@ static inline void reset_deferred_meminit(pg_data_t *pgdat) | |||
286 | /* Returns true if the struct page for the pfn is uninitialised */ | 286 | /* Returns true if the struct page for the pfn is uninitialised */ |
287 | static inline bool __meminit early_page_uninitialised(unsigned long pfn) | 287 | static inline bool __meminit early_page_uninitialised(unsigned long pfn) |
288 | { | 288 | { |
289 | if (pfn >= NODE_DATA(early_pfn_to_nid(pfn))->first_deferred_pfn) | 289 | int nid = early_pfn_to_nid(pfn); |
290 | |||
291 | if (node_online(nid) && pfn >= NODE_DATA(nid)->first_deferred_pfn) | ||
290 | return true; | 292 | return true; |
291 | 293 | ||
292 | return false; | 294 | return false; |
@@ -1273,7 +1275,7 @@ int __meminit early_pfn_to_nid(unsigned long pfn) | |||
1273 | spin_lock(&early_pfn_lock); | 1275 | spin_lock(&early_pfn_lock); |
1274 | nid = __early_pfn_to_nid(pfn, &early_pfnnid_cache); | 1276 | nid = __early_pfn_to_nid(pfn, &early_pfnnid_cache); |
1275 | if (nid < 0) | 1277 | if (nid < 0) |
1276 | nid = 0; | 1278 | nid = first_online_node; |
1277 | spin_unlock(&early_pfn_lock); | 1279 | spin_unlock(&early_pfn_lock); |
1278 | 1280 | ||
1279 | return nid; | 1281 | return nid; |
@@ -1084,23 +1084,20 @@ EXPORT_SYMBOL_GPL(page_mkclean); | |||
1084 | * page_move_anon_rmap - move a page to our anon_vma | 1084 | * page_move_anon_rmap - move a page to our anon_vma |
1085 | * @page: the page to move to our anon_vma | 1085 | * @page: the page to move to our anon_vma |
1086 | * @vma: the vma the page belongs to | 1086 | * @vma: the vma the page belongs to |
1087 | * @address: the user virtual address mapped | ||
1088 | * | 1087 | * |
1089 | * When a page belongs exclusively to one process after a COW event, | 1088 | * When a page belongs exclusively to one process after a COW event, |
1090 | * that page can be moved into the anon_vma that belongs to just that | 1089 | * that page can be moved into the anon_vma that belongs to just that |
1091 | * process, so the rmap code will not search the parent or sibling | 1090 | * process, so the rmap code will not search the parent or sibling |
1092 | * processes. | 1091 | * processes. |
1093 | */ | 1092 | */ |
1094 | void page_move_anon_rmap(struct page *page, | 1093 | void page_move_anon_rmap(struct page *page, struct vm_area_struct *vma) |
1095 | struct vm_area_struct *vma, unsigned long address) | ||
1096 | { | 1094 | { |
1097 | struct anon_vma *anon_vma = vma->anon_vma; | 1095 | struct anon_vma *anon_vma = vma->anon_vma; |
1098 | 1096 | ||
1097 | page = compound_head(page); | ||
1098 | |||
1099 | VM_BUG_ON_PAGE(!PageLocked(page), page); | 1099 | VM_BUG_ON_PAGE(!PageLocked(page), page); |
1100 | VM_BUG_ON_VMA(!anon_vma, vma); | 1100 | VM_BUG_ON_VMA(!anon_vma, vma); |
1101 | if (IS_ENABLED(CONFIG_DEBUG_VM) && PageTransHuge(page)) | ||
1102 | address &= HPAGE_PMD_MASK; | ||
1103 | VM_BUG_ON_PAGE(page->index != linear_page_index(vma, address), page); | ||
1104 | 1101 | ||
1105 | anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; | 1102 | anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; |
1106 | /* | 1103 | /* |
@@ -1427,7 +1424,8 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |||
1427 | goto out; | 1424 | goto out; |
1428 | } | 1425 | } |
1429 | 1426 | ||
1430 | pte = page_check_address(page, mm, address, &ptl, 0); | 1427 | pte = page_check_address(page, mm, address, &ptl, |
1428 | PageTransCompound(page)); | ||
1431 | if (!pte) | 1429 | if (!pte) |
1432 | goto out; | 1430 | goto out; |
1433 | 1431 | ||
diff --git a/mm/shmem.c b/mm/shmem.c index 24463b67b6ef..171dee7a131f 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -2225,9 +2225,11 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, | |||
2225 | error = shmem_getpage(inode, index, &page, SGP_FALLOC); | 2225 | error = shmem_getpage(inode, index, &page, SGP_FALLOC); |
2226 | if (error) { | 2226 | if (error) { |
2227 | /* Remove the !PageUptodate pages we added */ | 2227 | /* Remove the !PageUptodate pages we added */ |
2228 | shmem_undo_range(inode, | 2228 | if (index > start) { |
2229 | (loff_t)start << PAGE_SHIFT, | 2229 | shmem_undo_range(inode, |
2230 | ((loff_t)index << PAGE_SHIFT) - 1, true); | 2230 | (loff_t)start << PAGE_SHIFT, |
2231 | ((loff_t)index << PAGE_SHIFT) - 1, true); | ||
2232 | } | ||
2231 | goto undone; | 2233 | goto undone; |
2232 | } | 2234 | } |
2233 | 2235 | ||
diff --git a/mm/slab_common.c b/mm/slab_common.c index a65dad7fdcd1..82317abb03ed 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -526,8 +526,8 @@ void memcg_create_kmem_cache(struct mem_cgroup *memcg, | |||
526 | goto out_unlock; | 526 | goto out_unlock; |
527 | 527 | ||
528 | cgroup_name(css->cgroup, memcg_name_buf, sizeof(memcg_name_buf)); | 528 | cgroup_name(css->cgroup, memcg_name_buf, sizeof(memcg_name_buf)); |
529 | cache_name = kasprintf(GFP_KERNEL, "%s(%d:%s)", root_cache->name, | 529 | cache_name = kasprintf(GFP_KERNEL, "%s(%llu:%s)", root_cache->name, |
530 | css->id, memcg_name_buf); | 530 | css->serial_nr, memcg_name_buf); |
531 | if (!cache_name) | 531 | if (!cache_name) |
532 | goto out_unlock; | 532 | goto out_unlock; |
533 | 533 | ||
diff --git a/mm/workingset.c b/mm/workingset.c index 8a75f8d2916a..577277546d98 100644 --- a/mm/workingset.c +++ b/mm/workingset.c | |||
@@ -491,7 +491,7 @@ static int __init workingset_init(void) | |||
491 | max_order = fls_long(totalram_pages - 1); | 491 | max_order = fls_long(totalram_pages - 1); |
492 | if (max_order > timestamp_bits) | 492 | if (max_order > timestamp_bits) |
493 | bucket_order = max_order - timestamp_bits; | 493 | bucket_order = max_order - timestamp_bits; |
494 | printk("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n", | 494 | pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n", |
495 | timestamp_bits, max_order, bucket_order); | 495 | timestamp_bits, max_order, bucket_order); |
496 | 496 | ||
497 | ret = list_lru_init_key(&workingset_shadow_nodes, &shadow_nodes_key); | 497 | ret = list_lru_init_key(&workingset_shadow_nodes, &shadow_nodes_key); |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index c8f422c90856..fbfacd51aa34 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -146,10 +146,12 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb, | |||
146 | 146 | ||
147 | static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu) | 147 | static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu) |
148 | { | 148 | { |
149 | /* TODO: gotta make sure the underlying layer can handle it, | 149 | struct net_device *real_dev = vlan_dev_priv(dev)->real_dev; |
150 | * maybe an IFF_VLAN_CAPABLE flag for devices? | 150 | unsigned int max_mtu = real_dev->mtu; |
151 | */ | 151 | |
152 | if (vlan_dev_priv(dev)->real_dev->mtu < new_mtu) | 152 | if (netif_reduces_vlan_mtu(real_dev)) |
153 | max_mtu -= VLAN_HLEN; | ||
154 | if (max_mtu < new_mtu) | ||
153 | return -ERANGE; | 155 | return -ERANGE; |
154 | 156 | ||
155 | dev->mtu = new_mtu; | 157 | dev->mtu = new_mtu; |
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c index c92b52f37d38..1270207f3d7c 100644 --- a/net/8021q/vlan_netlink.c +++ b/net/8021q/vlan_netlink.c | |||
@@ -118,6 +118,7 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev, | |||
118 | { | 118 | { |
119 | struct vlan_dev_priv *vlan = vlan_dev_priv(dev); | 119 | struct vlan_dev_priv *vlan = vlan_dev_priv(dev); |
120 | struct net_device *real_dev; | 120 | struct net_device *real_dev; |
121 | unsigned int max_mtu; | ||
121 | __be16 proto; | 122 | __be16 proto; |
122 | int err; | 123 | int err; |
123 | 124 | ||
@@ -144,9 +145,11 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev, | |||
144 | if (err < 0) | 145 | if (err < 0) |
145 | return err; | 146 | return err; |
146 | 147 | ||
148 | max_mtu = netif_reduces_vlan_mtu(real_dev) ? real_dev->mtu - VLAN_HLEN : | ||
149 | real_dev->mtu; | ||
147 | if (!tb[IFLA_MTU]) | 150 | if (!tb[IFLA_MTU]) |
148 | dev->mtu = real_dev->mtu; | 151 | dev->mtu = max_mtu; |
149 | else if (dev->mtu > real_dev->mtu) | 152 | else if (dev->mtu > max_mtu) |
150 | return -EINVAL; | 153 | return -EINVAL; |
151 | 154 | ||
152 | err = vlan_changelink(dev, tb, data); | 155 | err = vlan_changelink(dev, tb, data); |
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index e4f7494fb974..ad2ffe16d29f 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -178,10 +178,21 @@ static void batadv_backbone_gw_put(struct batadv_bla_backbone_gw *backbone_gw) | |||
178 | static void batadv_claim_release(struct kref *ref) | 178 | static void batadv_claim_release(struct kref *ref) |
179 | { | 179 | { |
180 | struct batadv_bla_claim *claim; | 180 | struct batadv_bla_claim *claim; |
181 | struct batadv_bla_backbone_gw *old_backbone_gw; | ||
181 | 182 | ||
182 | claim = container_of(ref, struct batadv_bla_claim, refcount); | 183 | claim = container_of(ref, struct batadv_bla_claim, refcount); |
183 | 184 | ||
184 | batadv_backbone_gw_put(claim->backbone_gw); | 185 | spin_lock_bh(&claim->backbone_lock); |
186 | old_backbone_gw = claim->backbone_gw; | ||
187 | claim->backbone_gw = NULL; | ||
188 | spin_unlock_bh(&claim->backbone_lock); | ||
189 | |||
190 | spin_lock_bh(&old_backbone_gw->crc_lock); | ||
191 | old_backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN); | ||
192 | spin_unlock_bh(&old_backbone_gw->crc_lock); | ||
193 | |||
194 | batadv_backbone_gw_put(old_backbone_gw); | ||
195 | |||
185 | kfree_rcu(claim, rcu); | 196 | kfree_rcu(claim, rcu); |
186 | } | 197 | } |
187 | 198 | ||
@@ -419,9 +430,12 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac, | |||
419 | break; | 430 | break; |
420 | } | 431 | } |
421 | 432 | ||
422 | if (vid & BATADV_VLAN_HAS_TAG) | 433 | if (vid & BATADV_VLAN_HAS_TAG) { |
423 | skb = vlan_insert_tag(skb, htons(ETH_P_8021Q), | 434 | skb = vlan_insert_tag(skb, htons(ETH_P_8021Q), |
424 | vid & VLAN_VID_MASK); | 435 | vid & VLAN_VID_MASK); |
436 | if (!skb) | ||
437 | goto out; | ||
438 | } | ||
425 | 439 | ||
426 | skb_reset_mac_header(skb); | 440 | skb_reset_mac_header(skb); |
427 | skb->protocol = eth_type_trans(skb, soft_iface); | 441 | skb->protocol = eth_type_trans(skb, soft_iface); |
@@ -675,8 +689,10 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv, | |||
675 | const u8 *mac, const unsigned short vid, | 689 | const u8 *mac, const unsigned short vid, |
676 | struct batadv_bla_backbone_gw *backbone_gw) | 690 | struct batadv_bla_backbone_gw *backbone_gw) |
677 | { | 691 | { |
692 | struct batadv_bla_backbone_gw *old_backbone_gw; | ||
678 | struct batadv_bla_claim *claim; | 693 | struct batadv_bla_claim *claim; |
679 | struct batadv_bla_claim search_claim; | 694 | struct batadv_bla_claim search_claim; |
695 | bool remove_crc = false; | ||
680 | int hash_added; | 696 | int hash_added; |
681 | 697 | ||
682 | ether_addr_copy(search_claim.addr, mac); | 698 | ether_addr_copy(search_claim.addr, mac); |
@@ -690,8 +706,10 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv, | |||
690 | return; | 706 | return; |
691 | 707 | ||
692 | ether_addr_copy(claim->addr, mac); | 708 | ether_addr_copy(claim->addr, mac); |
709 | spin_lock_init(&claim->backbone_lock); | ||
693 | claim->vid = vid; | 710 | claim->vid = vid; |
694 | claim->lasttime = jiffies; | 711 | claim->lasttime = jiffies; |
712 | kref_get(&backbone_gw->refcount); | ||
695 | claim->backbone_gw = backbone_gw; | 713 | claim->backbone_gw = backbone_gw; |
696 | 714 | ||
697 | kref_init(&claim->refcount); | 715 | kref_init(&claim->refcount); |
@@ -719,15 +737,26 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv, | |||
719 | "bla_add_claim(): changing ownership for %pM, vid %d\n", | 737 | "bla_add_claim(): changing ownership for %pM, vid %d\n", |
720 | mac, BATADV_PRINT_VID(vid)); | 738 | mac, BATADV_PRINT_VID(vid)); |
721 | 739 | ||
722 | spin_lock_bh(&claim->backbone_gw->crc_lock); | 740 | remove_crc = true; |
723 | claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN); | ||
724 | spin_unlock_bh(&claim->backbone_gw->crc_lock); | ||
725 | batadv_backbone_gw_put(claim->backbone_gw); | ||
726 | } | 741 | } |
727 | /* set (new) backbone gw */ | 742 | |
743 | /* replace backbone_gw atomically and adjust reference counters */ | ||
744 | spin_lock_bh(&claim->backbone_lock); | ||
745 | old_backbone_gw = claim->backbone_gw; | ||
728 | kref_get(&backbone_gw->refcount); | 746 | kref_get(&backbone_gw->refcount); |
729 | claim->backbone_gw = backbone_gw; | 747 | claim->backbone_gw = backbone_gw; |
748 | spin_unlock_bh(&claim->backbone_lock); | ||
730 | 749 | ||
750 | if (remove_crc) { | ||
751 | /* remove claim address from old backbone_gw */ | ||
752 | spin_lock_bh(&old_backbone_gw->crc_lock); | ||
753 | old_backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN); | ||
754 | spin_unlock_bh(&old_backbone_gw->crc_lock); | ||
755 | } | ||
756 | |||
757 | batadv_backbone_gw_put(old_backbone_gw); | ||
758 | |||
759 | /* add claim address to new backbone_gw */ | ||
731 | spin_lock_bh(&backbone_gw->crc_lock); | 760 | spin_lock_bh(&backbone_gw->crc_lock); |
732 | backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN); | 761 | backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN); |
733 | spin_unlock_bh(&backbone_gw->crc_lock); | 762 | spin_unlock_bh(&backbone_gw->crc_lock); |
@@ -738,6 +767,26 @@ claim_free_ref: | |||
738 | } | 767 | } |
739 | 768 | ||
740 | /** | 769 | /** |
770 | * batadv_bla_claim_get_backbone_gw - Get valid reference for backbone_gw of | ||
771 | * claim | ||
772 | * @claim: claim whose backbone_gw should be returned | ||
773 | * | ||
774 | * Return: valid reference to claim::backbone_gw | ||
775 | */ | ||
776 | static struct batadv_bla_backbone_gw * | ||
777 | batadv_bla_claim_get_backbone_gw(struct batadv_bla_claim *claim) | ||
778 | { | ||
779 | struct batadv_bla_backbone_gw *backbone_gw; | ||
780 | |||
781 | spin_lock_bh(&claim->backbone_lock); | ||
782 | backbone_gw = claim->backbone_gw; | ||
783 | kref_get(&backbone_gw->refcount); | ||
784 | spin_unlock_bh(&claim->backbone_lock); | ||
785 | |||
786 | return backbone_gw; | ||
787 | } | ||
788 | |||
789 | /** | ||
741 | * batadv_bla_del_claim - delete a claim from the claim hash | 790 | * batadv_bla_del_claim - delete a claim from the claim hash |
742 | * @bat_priv: the bat priv with all the soft interface information | 791 | * @bat_priv: the bat priv with all the soft interface information |
743 | * @mac: mac address of the claim to be removed | 792 | * @mac: mac address of the claim to be removed |
@@ -761,10 +810,6 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv, | |||
761 | batadv_choose_claim, claim); | 810 | batadv_choose_claim, claim); |
762 | batadv_claim_put(claim); /* reference from the hash is gone */ | 811 | batadv_claim_put(claim); /* reference from the hash is gone */ |
763 | 812 | ||
764 | spin_lock_bh(&claim->backbone_gw->crc_lock); | ||
765 | claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN); | ||
766 | spin_unlock_bh(&claim->backbone_gw->crc_lock); | ||
767 | |||
768 | /* don't need the reference from hash_find() anymore */ | 813 | /* don't need the reference from hash_find() anymore */ |
769 | batadv_claim_put(claim); | 814 | batadv_claim_put(claim); |
770 | } | 815 | } |
@@ -1217,6 +1262,7 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv, | |||
1217 | struct batadv_hard_iface *primary_if, | 1262 | struct batadv_hard_iface *primary_if, |
1218 | int now) | 1263 | int now) |
1219 | { | 1264 | { |
1265 | struct batadv_bla_backbone_gw *backbone_gw; | ||
1220 | struct batadv_bla_claim *claim; | 1266 | struct batadv_bla_claim *claim; |
1221 | struct hlist_head *head; | 1267 | struct hlist_head *head; |
1222 | struct batadv_hashtable *hash; | 1268 | struct batadv_hashtable *hash; |
@@ -1231,14 +1277,17 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv, | |||
1231 | 1277 | ||
1232 | rcu_read_lock(); | 1278 | rcu_read_lock(); |
1233 | hlist_for_each_entry_rcu(claim, head, hash_entry) { | 1279 | hlist_for_each_entry_rcu(claim, head, hash_entry) { |
1280 | backbone_gw = batadv_bla_claim_get_backbone_gw(claim); | ||
1234 | if (now) | 1281 | if (now) |
1235 | goto purge_now; | 1282 | goto purge_now; |
1236 | if (!batadv_compare_eth(claim->backbone_gw->orig, | 1283 | |
1284 | if (!batadv_compare_eth(backbone_gw->orig, | ||
1237 | primary_if->net_dev->dev_addr)) | 1285 | primary_if->net_dev->dev_addr)) |
1238 | continue; | 1286 | goto skip; |
1287 | |||
1239 | if (!batadv_has_timed_out(claim->lasttime, | 1288 | if (!batadv_has_timed_out(claim->lasttime, |
1240 | BATADV_BLA_CLAIM_TIMEOUT)) | 1289 | BATADV_BLA_CLAIM_TIMEOUT)) |
1241 | continue; | 1290 | goto skip; |
1242 | 1291 | ||
1243 | batadv_dbg(BATADV_DBG_BLA, bat_priv, | 1292 | batadv_dbg(BATADV_DBG_BLA, bat_priv, |
1244 | "bla_purge_claims(): %pM, vid %d, time out\n", | 1293 | "bla_purge_claims(): %pM, vid %d, time out\n", |
@@ -1246,8 +1295,10 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv, | |||
1246 | 1295 | ||
1247 | purge_now: | 1296 | purge_now: |
1248 | batadv_handle_unclaim(bat_priv, primary_if, | 1297 | batadv_handle_unclaim(bat_priv, primary_if, |
1249 | claim->backbone_gw->orig, | 1298 | backbone_gw->orig, |
1250 | claim->addr, claim->vid); | 1299 | claim->addr, claim->vid); |
1300 | skip: | ||
1301 | batadv_backbone_gw_put(backbone_gw); | ||
1251 | } | 1302 | } |
1252 | rcu_read_unlock(); | 1303 | rcu_read_unlock(); |
1253 | } | 1304 | } |
@@ -1758,9 +1809,11 @@ batadv_bla_loopdetect_check(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1758 | bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, | 1809 | bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, |
1759 | unsigned short vid, bool is_bcast) | 1810 | unsigned short vid, bool is_bcast) |
1760 | { | 1811 | { |
1812 | struct batadv_bla_backbone_gw *backbone_gw; | ||
1761 | struct ethhdr *ethhdr; | 1813 | struct ethhdr *ethhdr; |
1762 | struct batadv_bla_claim search_claim, *claim = NULL; | 1814 | struct batadv_bla_claim search_claim, *claim = NULL; |
1763 | struct batadv_hard_iface *primary_if; | 1815 | struct batadv_hard_iface *primary_if; |
1816 | bool own_claim; | ||
1764 | bool ret; | 1817 | bool ret; |
1765 | 1818 | ||
1766 | ethhdr = eth_hdr(skb); | 1819 | ethhdr = eth_hdr(skb); |
@@ -1795,8 +1848,12 @@ bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1795 | } | 1848 | } |
1796 | 1849 | ||
1797 | /* if it is our own claim ... */ | 1850 | /* if it is our own claim ... */ |
1798 | if (batadv_compare_eth(claim->backbone_gw->orig, | 1851 | backbone_gw = batadv_bla_claim_get_backbone_gw(claim); |
1799 | primary_if->net_dev->dev_addr)) { | 1852 | own_claim = batadv_compare_eth(backbone_gw->orig, |
1853 | primary_if->net_dev->dev_addr); | ||
1854 | batadv_backbone_gw_put(backbone_gw); | ||
1855 | |||
1856 | if (own_claim) { | ||
1800 | /* ... allow it in any case */ | 1857 | /* ... allow it in any case */ |
1801 | claim->lasttime = jiffies; | 1858 | claim->lasttime = jiffies; |
1802 | goto allow; | 1859 | goto allow; |
@@ -1860,7 +1917,9 @@ bool batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1860 | { | 1917 | { |
1861 | struct ethhdr *ethhdr; | 1918 | struct ethhdr *ethhdr; |
1862 | struct batadv_bla_claim search_claim, *claim = NULL; | 1919 | struct batadv_bla_claim search_claim, *claim = NULL; |
1920 | struct batadv_bla_backbone_gw *backbone_gw; | ||
1863 | struct batadv_hard_iface *primary_if; | 1921 | struct batadv_hard_iface *primary_if; |
1922 | bool client_roamed; | ||
1864 | bool ret = false; | 1923 | bool ret = false; |
1865 | 1924 | ||
1866 | primary_if = batadv_primary_if_get_selected(bat_priv); | 1925 | primary_if = batadv_primary_if_get_selected(bat_priv); |
@@ -1890,8 +1949,12 @@ bool batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1890 | goto allow; | 1949 | goto allow; |
1891 | 1950 | ||
1892 | /* check if we are responsible. */ | 1951 | /* check if we are responsible. */ |
1893 | if (batadv_compare_eth(claim->backbone_gw->orig, | 1952 | backbone_gw = batadv_bla_claim_get_backbone_gw(claim); |
1894 | primary_if->net_dev->dev_addr)) { | 1953 | client_roamed = batadv_compare_eth(backbone_gw->orig, |
1954 | primary_if->net_dev->dev_addr); | ||
1955 | batadv_backbone_gw_put(backbone_gw); | ||
1956 | |||
1957 | if (client_roamed) { | ||
1895 | /* if yes, the client has roamed and we have | 1958 | /* if yes, the client has roamed and we have |
1896 | * to unclaim it. | 1959 | * to unclaim it. |
1897 | */ | 1960 | */ |
@@ -1939,6 +2002,7 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) | |||
1939 | struct net_device *net_dev = (struct net_device *)seq->private; | 2002 | struct net_device *net_dev = (struct net_device *)seq->private; |
1940 | struct batadv_priv *bat_priv = netdev_priv(net_dev); | 2003 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
1941 | struct batadv_hashtable *hash = bat_priv->bla.claim_hash; | 2004 | struct batadv_hashtable *hash = bat_priv->bla.claim_hash; |
2005 | struct batadv_bla_backbone_gw *backbone_gw; | ||
1942 | struct batadv_bla_claim *claim; | 2006 | struct batadv_bla_claim *claim; |
1943 | struct batadv_hard_iface *primary_if; | 2007 | struct batadv_hard_iface *primary_if; |
1944 | struct hlist_head *head; | 2008 | struct hlist_head *head; |
@@ -1963,17 +2027,21 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) | |||
1963 | 2027 | ||
1964 | rcu_read_lock(); | 2028 | rcu_read_lock(); |
1965 | hlist_for_each_entry_rcu(claim, head, hash_entry) { | 2029 | hlist_for_each_entry_rcu(claim, head, hash_entry) { |
1966 | is_own = batadv_compare_eth(claim->backbone_gw->orig, | 2030 | backbone_gw = batadv_bla_claim_get_backbone_gw(claim); |
2031 | |||
2032 | is_own = batadv_compare_eth(backbone_gw->orig, | ||
1967 | primary_addr); | 2033 | primary_addr); |
1968 | 2034 | ||
1969 | spin_lock_bh(&claim->backbone_gw->crc_lock); | 2035 | spin_lock_bh(&backbone_gw->crc_lock); |
1970 | backbone_crc = claim->backbone_gw->crc; | 2036 | backbone_crc = backbone_gw->crc; |
1971 | spin_unlock_bh(&claim->backbone_gw->crc_lock); | 2037 | spin_unlock_bh(&backbone_gw->crc_lock); |
1972 | seq_printf(seq, " * %pM on %5d by %pM [%c] (%#.4x)\n", | 2038 | seq_printf(seq, " * %pM on %5d by %pM [%c] (%#.4x)\n", |
1973 | claim->addr, BATADV_PRINT_VID(claim->vid), | 2039 | claim->addr, BATADV_PRINT_VID(claim->vid), |
1974 | claim->backbone_gw->orig, | 2040 | backbone_gw->orig, |
1975 | (is_own ? 'x' : ' '), | 2041 | (is_own ? 'x' : ' '), |
1976 | backbone_crc); | 2042 | backbone_crc); |
2043 | |||
2044 | batadv_backbone_gw_put(backbone_gw); | ||
1977 | } | 2045 | } |
1978 | rcu_read_unlock(); | 2046 | rcu_read_unlock(); |
1979 | } | 2047 | } |
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index fa7646532a13..b1cc8bfe11ac 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c | |||
@@ -1011,9 +1011,12 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, | |||
1011 | if (!skb_new) | 1011 | if (!skb_new) |
1012 | goto out; | 1012 | goto out; |
1013 | 1013 | ||
1014 | if (vid & BATADV_VLAN_HAS_TAG) | 1014 | if (vid & BATADV_VLAN_HAS_TAG) { |
1015 | skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q), | 1015 | skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q), |
1016 | vid & VLAN_VID_MASK); | 1016 | vid & VLAN_VID_MASK); |
1017 | if (!skb_new) | ||
1018 | goto out; | ||
1019 | } | ||
1017 | 1020 | ||
1018 | skb_reset_mac_header(skb_new); | 1021 | skb_reset_mac_header(skb_new); |
1019 | skb_new->protocol = eth_type_trans(skb_new, | 1022 | skb_new->protocol = eth_type_trans(skb_new, |
@@ -1091,9 +1094,12 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv, | |||
1091 | */ | 1094 | */ |
1092 | skb_reset_mac_header(skb_new); | 1095 | skb_reset_mac_header(skb_new); |
1093 | 1096 | ||
1094 | if (vid & BATADV_VLAN_HAS_TAG) | 1097 | if (vid & BATADV_VLAN_HAS_TAG) { |
1095 | skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q), | 1098 | skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q), |
1096 | vid & VLAN_VID_MASK); | 1099 | vid & VLAN_VID_MASK); |
1100 | if (!skb_new) | ||
1101 | goto out; | ||
1102 | } | ||
1097 | 1103 | ||
1098 | /* To preserve backwards compatibility, the node has choose the outgoing | 1104 | /* To preserve backwards compatibility, the node has choose the outgoing |
1099 | * format based on the incoming request packet type. The assumption is | 1105 | * format based on the incoming request packet type. The assumption is |
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 7d1e5421f6bc..3940b5d24421 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
@@ -785,6 +785,8 @@ static void batadv_orig_node_release(struct kref *ref) | |||
785 | struct batadv_neigh_node *neigh_node; | 785 | struct batadv_neigh_node *neigh_node; |
786 | struct batadv_orig_node *orig_node; | 786 | struct batadv_orig_node *orig_node; |
787 | struct batadv_orig_ifinfo *orig_ifinfo; | 787 | struct batadv_orig_ifinfo *orig_ifinfo; |
788 | struct batadv_orig_node_vlan *vlan; | ||
789 | struct batadv_orig_ifinfo *last_candidate; | ||
788 | 790 | ||
789 | orig_node = container_of(ref, struct batadv_orig_node, refcount); | 791 | orig_node = container_of(ref, struct batadv_orig_node, refcount); |
790 | 792 | ||
@@ -802,8 +804,21 @@ static void batadv_orig_node_release(struct kref *ref) | |||
802 | hlist_del_rcu(&orig_ifinfo->list); | 804 | hlist_del_rcu(&orig_ifinfo->list); |
803 | batadv_orig_ifinfo_put(orig_ifinfo); | 805 | batadv_orig_ifinfo_put(orig_ifinfo); |
804 | } | 806 | } |
807 | |||
808 | last_candidate = orig_node->last_bonding_candidate; | ||
809 | orig_node->last_bonding_candidate = NULL; | ||
805 | spin_unlock_bh(&orig_node->neigh_list_lock); | 810 | spin_unlock_bh(&orig_node->neigh_list_lock); |
806 | 811 | ||
812 | if (last_candidate) | ||
813 | batadv_orig_ifinfo_put(last_candidate); | ||
814 | |||
815 | spin_lock_bh(&orig_node->vlan_list_lock); | ||
816 | hlist_for_each_entry_safe(vlan, node_tmp, &orig_node->vlan_list, list) { | ||
817 | hlist_del_rcu(&vlan->list); | ||
818 | batadv_orig_node_vlan_put(vlan); | ||
819 | } | ||
820 | spin_unlock_bh(&orig_node->vlan_list_lock); | ||
821 | |||
807 | /* Free nc_nodes */ | 822 | /* Free nc_nodes */ |
808 | batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL); | 823 | batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL); |
809 | 824 | ||
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index af8e11933928..7602c001e92b 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -470,6 +470,29 @@ static int batadv_check_unicast_packet(struct batadv_priv *bat_priv, | |||
470 | } | 470 | } |
471 | 471 | ||
472 | /** | 472 | /** |
473 | * batadv_last_bonding_replace - Replace last_bonding_candidate of orig_node | ||
474 | * @orig_node: originator node whose bonding candidates should be replaced | ||
475 | * @new_candidate: new bonding candidate or NULL | ||
476 | */ | ||
477 | static void | ||
478 | batadv_last_bonding_replace(struct batadv_orig_node *orig_node, | ||
479 | struct batadv_orig_ifinfo *new_candidate) | ||
480 | { | ||
481 | struct batadv_orig_ifinfo *old_candidate; | ||
482 | |||
483 | spin_lock_bh(&orig_node->neigh_list_lock); | ||
484 | old_candidate = orig_node->last_bonding_candidate; | ||
485 | |||
486 | if (new_candidate) | ||
487 | kref_get(&new_candidate->refcount); | ||
488 | orig_node->last_bonding_candidate = new_candidate; | ||
489 | spin_unlock_bh(&orig_node->neigh_list_lock); | ||
490 | |||
491 | if (old_candidate) | ||
492 | batadv_orig_ifinfo_put(old_candidate); | ||
493 | } | ||
494 | |||
495 | /** | ||
473 | * batadv_find_router - find a suitable router for this originator | 496 | * batadv_find_router - find a suitable router for this originator |
474 | * @bat_priv: the bat priv with all the soft interface information | 497 | * @bat_priv: the bat priv with all the soft interface information |
475 | * @orig_node: the destination node | 498 | * @orig_node: the destination node |
@@ -576,10 +599,6 @@ next: | |||
576 | } | 599 | } |
577 | rcu_read_unlock(); | 600 | rcu_read_unlock(); |
578 | 601 | ||
579 | /* last_bonding_candidate is reset below, remove the old reference. */ | ||
580 | if (orig_node->last_bonding_candidate) | ||
581 | batadv_orig_ifinfo_put(orig_node->last_bonding_candidate); | ||
582 | |||
583 | /* After finding candidates, handle the three cases: | 602 | /* After finding candidates, handle the three cases: |
584 | * 1) there is a next candidate, use that | 603 | * 1) there is a next candidate, use that |
585 | * 2) there is no next candidate, use the first of the list | 604 | * 2) there is no next candidate, use the first of the list |
@@ -588,21 +607,28 @@ next: | |||
588 | if (next_candidate) { | 607 | if (next_candidate) { |
589 | batadv_neigh_node_put(router); | 608 | batadv_neigh_node_put(router); |
590 | 609 | ||
591 | /* remove references to first candidate, we don't need it. */ | 610 | kref_get(&next_candidate_router->refcount); |
592 | if (first_candidate) { | ||
593 | batadv_neigh_node_put(first_candidate_router); | ||
594 | batadv_orig_ifinfo_put(first_candidate); | ||
595 | } | ||
596 | router = next_candidate_router; | 611 | router = next_candidate_router; |
597 | orig_node->last_bonding_candidate = next_candidate; | 612 | batadv_last_bonding_replace(orig_node, next_candidate); |
598 | } else if (first_candidate) { | 613 | } else if (first_candidate) { |
599 | batadv_neigh_node_put(router); | 614 | batadv_neigh_node_put(router); |
600 | 615 | ||
601 | /* refcounting has already been done in the loop above. */ | 616 | kref_get(&first_candidate_router->refcount); |
602 | router = first_candidate_router; | 617 | router = first_candidate_router; |
603 | orig_node->last_bonding_candidate = first_candidate; | 618 | batadv_last_bonding_replace(orig_node, first_candidate); |
604 | } else { | 619 | } else { |
605 | orig_node->last_bonding_candidate = NULL; | 620 | batadv_last_bonding_replace(orig_node, NULL); |
621 | } | ||
622 | |||
623 | /* cleanup of candidates */ | ||
624 | if (first_candidate) { | ||
625 | batadv_neigh_node_put(first_candidate_router); | ||
626 | batadv_orig_ifinfo_put(first_candidate); | ||
627 | } | ||
628 | |||
629 | if (next_candidate) { | ||
630 | batadv_neigh_node_put(next_candidate_router); | ||
631 | batadv_orig_ifinfo_put(next_candidate); | ||
606 | } | 632 | } |
607 | 633 | ||
608 | return router; | 634 | return router; |
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 3a10d87b4b76..6191159484df 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c | |||
@@ -435,8 +435,8 @@ int batadv_send_skb_via_gw(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
435 | struct batadv_orig_node *orig_node; | 435 | struct batadv_orig_node *orig_node; |
436 | 436 | ||
437 | orig_node = batadv_gw_get_selected_orig(bat_priv); | 437 | orig_node = batadv_gw_get_selected_orig(bat_priv); |
438 | return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0, | 438 | return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST_4ADDR, |
439 | orig_node, vid); | 439 | BATADV_P_DATA, orig_node, vid); |
440 | } | 440 | } |
441 | 441 | ||
442 | void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet) | 442 | void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet) |
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 43db7b61f8eb..a64522c3b45d 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h | |||
@@ -331,7 +331,9 @@ struct batadv_orig_node { | |||
331 | DECLARE_BITMAP(bcast_bits, BATADV_TQ_LOCAL_WINDOW_SIZE); | 331 | DECLARE_BITMAP(bcast_bits, BATADV_TQ_LOCAL_WINDOW_SIZE); |
332 | u32 last_bcast_seqno; | 332 | u32 last_bcast_seqno; |
333 | struct hlist_head neigh_list; | 333 | struct hlist_head neigh_list; |
334 | /* neigh_list_lock protects: neigh_list and router */ | 334 | /* neigh_list_lock protects: neigh_list, ifinfo_list, |
335 | * last_bonding_candidate and router | ||
336 | */ | ||
335 | spinlock_t neigh_list_lock; | 337 | spinlock_t neigh_list_lock; |
336 | struct hlist_node hash_entry; | 338 | struct hlist_node hash_entry; |
337 | struct batadv_priv *bat_priv; | 339 | struct batadv_priv *bat_priv; |
@@ -1171,6 +1173,7 @@ struct batadv_bla_backbone_gw { | |||
1171 | * @addr: mac address of claimed non-mesh client | 1173 | * @addr: mac address of claimed non-mesh client |
1172 | * @vid: vlan id this client was detected on | 1174 | * @vid: vlan id this client was detected on |
1173 | * @backbone_gw: pointer to backbone gw claiming this client | 1175 | * @backbone_gw: pointer to backbone gw claiming this client |
1176 | * @backbone_lock: lock protecting backbone_gw pointer | ||
1174 | * @lasttime: last time we heard of claim (locals only) | 1177 | * @lasttime: last time we heard of claim (locals only) |
1175 | * @hash_entry: hlist node for batadv_priv_bla::claim_hash | 1178 | * @hash_entry: hlist node for batadv_priv_bla::claim_hash |
1176 | * @refcount: number of contexts the object is used | 1179 | * @refcount: number of contexts the object is used |
@@ -1180,6 +1183,7 @@ struct batadv_bla_claim { | |||
1180 | u8 addr[ETH_ALEN]; | 1183 | u8 addr[ETH_ALEN]; |
1181 | unsigned short vid; | 1184 | unsigned short vid; |
1182 | struct batadv_bla_backbone_gw *backbone_gw; | 1185 | struct batadv_bla_backbone_gw *backbone_gw; |
1186 | spinlock_t backbone_lock; /* protects backbone_gw */ | ||
1183 | unsigned long lasttime; | 1187 | unsigned long lasttime; |
1184 | struct hlist_node hash_entry; | 1188 | struct hlist_node hash_entry; |
1185 | struct rcu_head rcu; | 1189 | struct rcu_head rcu; |
diff --git a/net/core/filter.c b/net/core/filter.c index 6c627bc4be6e..0b521353008d 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
@@ -53,9 +53,10 @@ | |||
53 | #include <net/sock_reuseport.h> | 53 | #include <net/sock_reuseport.h> |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * sk_filter - run a packet through a socket filter | 56 | * sk_filter_trim_cap - run a packet through a socket filter |
57 | * @sk: sock associated with &sk_buff | 57 | * @sk: sock associated with &sk_buff |
58 | * @skb: buffer to filter | 58 | * @skb: buffer to filter |
59 | * @cap: limit on how short the eBPF program may trim the packet | ||
59 | * | 60 | * |
60 | * Run the eBPF program and then cut skb->data to correct size returned by | 61 | * Run the eBPF program and then cut skb->data to correct size returned by |
61 | * the program. If pkt_len is 0 we toss packet. If skb->len is smaller | 62 | * the program. If pkt_len is 0 we toss packet. If skb->len is smaller |
@@ -64,7 +65,7 @@ | |||
64 | * be accepted or -EPERM if the packet should be tossed. | 65 | * be accepted or -EPERM if the packet should be tossed. |
65 | * | 66 | * |
66 | */ | 67 | */ |
67 | int sk_filter(struct sock *sk, struct sk_buff *skb) | 68 | int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap) |
68 | { | 69 | { |
69 | int err; | 70 | int err; |
70 | struct sk_filter *filter; | 71 | struct sk_filter *filter; |
@@ -85,14 +86,13 @@ int sk_filter(struct sock *sk, struct sk_buff *skb) | |||
85 | filter = rcu_dereference(sk->sk_filter); | 86 | filter = rcu_dereference(sk->sk_filter); |
86 | if (filter) { | 87 | if (filter) { |
87 | unsigned int pkt_len = bpf_prog_run_save_cb(filter->prog, skb); | 88 | unsigned int pkt_len = bpf_prog_run_save_cb(filter->prog, skb); |
88 | 89 | err = pkt_len ? pskb_trim(skb, max(cap, pkt_len)) : -EPERM; | |
89 | err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM; | ||
90 | } | 90 | } |
91 | rcu_read_unlock(); | 91 | rcu_read_unlock(); |
92 | 92 | ||
93 | return err; | 93 | return err; |
94 | } | 94 | } |
95 | EXPORT_SYMBOL(sk_filter); | 95 | EXPORT_SYMBOL(sk_filter_trim_cap); |
96 | 96 | ||
97 | static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5) | 97 | static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5) |
98 | { | 98 | { |
diff --git a/net/core/sock.c b/net/core/sock.c index 08bf97eceeb3..25dab8b60223 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -452,11 +452,12 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
452 | } | 452 | } |
453 | EXPORT_SYMBOL(sock_queue_rcv_skb); | 453 | EXPORT_SYMBOL(sock_queue_rcv_skb); |
454 | 454 | ||
455 | int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested) | 455 | int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, |
456 | const int nested, unsigned int trim_cap) | ||
456 | { | 457 | { |
457 | int rc = NET_RX_SUCCESS; | 458 | int rc = NET_RX_SUCCESS; |
458 | 459 | ||
459 | if (sk_filter(sk, skb)) | 460 | if (sk_filter_trim_cap(sk, skb, trim_cap)) |
460 | goto discard_and_relse; | 461 | goto discard_and_relse; |
461 | 462 | ||
462 | skb->dev = NULL; | 463 | skb->dev = NULL; |
@@ -492,7 +493,7 @@ discard_and_relse: | |||
492 | kfree_skb(skb); | 493 | kfree_skb(skb); |
493 | goto out; | 494 | goto out; |
494 | } | 495 | } |
495 | EXPORT_SYMBOL(sk_receive_skb); | 496 | EXPORT_SYMBOL(__sk_receive_skb); |
496 | 497 | ||
497 | struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) | 498 | struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) |
498 | { | 499 | { |
@@ -1938,6 +1939,10 @@ int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg, | |||
1938 | sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK; | 1939 | sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK; |
1939 | sockc->tsflags |= tsflags; | 1940 | sockc->tsflags |= tsflags; |
1940 | break; | 1941 | break; |
1942 | /* SCM_RIGHTS and SCM_CREDENTIALS are semantically in SOL_UNIX. */ | ||
1943 | case SCM_RIGHTS: | ||
1944 | case SCM_CREDENTIALS: | ||
1945 | break; | ||
1941 | default: | 1946 | default: |
1942 | return -EINVAL; | 1947 | return -EINVAL; |
1943 | } | 1948 | } |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 5c7e413a3ae4..345a3aeb8c7e 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -462,7 +462,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk, | |||
462 | security_skb_classify_flow(skb, flowi4_to_flowi(&fl4)); | 462 | security_skb_classify_flow(skb, flowi4_to_flowi(&fl4)); |
463 | rt = ip_route_output_flow(net, &fl4, sk); | 463 | rt = ip_route_output_flow(net, &fl4, sk); |
464 | if (IS_ERR(rt)) { | 464 | if (IS_ERR(rt)) { |
465 | __IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES); | 465 | IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES); |
466 | return NULL; | 466 | return NULL; |
467 | } | 467 | } |
468 | 468 | ||
@@ -527,17 +527,19 @@ static void dccp_v4_ctl_send_reset(const struct sock *sk, struct sk_buff *rxskb) | |||
527 | rxiph->daddr); | 527 | rxiph->daddr); |
528 | skb_dst_set(skb, dst_clone(dst)); | 528 | skb_dst_set(skb, dst_clone(dst)); |
529 | 529 | ||
530 | local_bh_disable(); | ||
530 | bh_lock_sock(ctl_sk); | 531 | bh_lock_sock(ctl_sk); |
531 | err = ip_build_and_send_pkt(skb, ctl_sk, | 532 | err = ip_build_and_send_pkt(skb, ctl_sk, |
532 | rxiph->daddr, rxiph->saddr, NULL); | 533 | rxiph->daddr, rxiph->saddr, NULL); |
533 | bh_unlock_sock(ctl_sk); | 534 | bh_unlock_sock(ctl_sk); |
534 | 535 | ||
535 | if (net_xmit_eval(err) == 0) { | 536 | if (net_xmit_eval(err) == 0) { |
536 | DCCP_INC_STATS(DCCP_MIB_OUTSEGS); | 537 | __DCCP_INC_STATS(DCCP_MIB_OUTSEGS); |
537 | DCCP_INC_STATS(DCCP_MIB_OUTRSTS); | 538 | __DCCP_INC_STATS(DCCP_MIB_OUTRSTS); |
538 | } | 539 | } |
540 | local_bh_enable(); | ||
539 | out: | 541 | out: |
540 | dst_release(dst); | 542 | dst_release(dst); |
541 | } | 543 | } |
542 | 544 | ||
543 | static void dccp_v4_reqsk_destructor(struct request_sock *req) | 545 | static void dccp_v4_reqsk_destructor(struct request_sock *req) |
@@ -866,7 +868,7 @@ lookup: | |||
866 | goto discard_and_relse; | 868 | goto discard_and_relse; |
867 | nf_reset(skb); | 869 | nf_reset(skb); |
868 | 870 | ||
869 | return sk_receive_skb(sk, skb, 1); | 871 | return __sk_receive_skb(sk, skb, 1, dh->dccph_doff * 4); |
870 | 872 | ||
871 | no_dccp_socket: | 873 | no_dccp_socket: |
872 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) | 874 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index d176f4e66369..3ff137d9471d 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -732,7 +732,7 @@ lookup: | |||
732 | if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) | 732 | if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) |
733 | goto discard_and_relse; | 733 | goto discard_and_relse; |
734 | 734 | ||
735 | return sk_receive_skb(sk, skb, 1) ? -1 : 0; | 735 | return __sk_receive_skb(sk, skb, 1, dh->dccph_doff * 4) ? -1 : 0; |
736 | 736 | ||
737 | no_dccp_socket: | 737 | no_dccp_socket: |
738 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) | 738 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index d09173bf9500..539fa264e67d 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -479,6 +479,9 @@ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, | |||
479 | if (!rtnh_ok(rtnh, remaining)) | 479 | if (!rtnh_ok(rtnh, remaining)) |
480 | return -EINVAL; | 480 | return -EINVAL; |
481 | 481 | ||
482 | if (rtnh->rtnh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN)) | ||
483 | return -EINVAL; | ||
484 | |||
482 | nexthop_nh->nh_flags = | 485 | nexthop_nh->nh_flags = |
483 | (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; | 486 | (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; |
484 | nexthop_nh->nh_oif = rtnh->rtnh_ifindex; | 487 | nexthop_nh->nh_oif = rtnh->rtnh_ifindex; |
@@ -1003,6 +1006,9 @@ struct fib_info *fib_create_info(struct fib_config *cfg) | |||
1003 | if (fib_props[cfg->fc_type].scope > cfg->fc_scope) | 1006 | if (fib_props[cfg->fc_type].scope > cfg->fc_scope) |
1004 | goto err_inval; | 1007 | goto err_inval; |
1005 | 1008 | ||
1009 | if (cfg->fc_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN)) | ||
1010 | goto err_inval; | ||
1011 | |||
1006 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | 1012 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
1007 | if (cfg->fc_mp) { | 1013 | if (cfg->fc_mp) { |
1008 | nhs = fib_count_nexthops(cfg->fc_mp, cfg->fc_mp_len); | 1014 | nhs = fib_count_nexthops(cfg->fc_mp, cfg->fc_mp_len); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 94d4aff97523..f9f9e375d7de 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -87,7 +87,7 @@ int sysctl_tcp_adv_win_scale __read_mostly = 1; | |||
87 | EXPORT_SYMBOL(sysctl_tcp_adv_win_scale); | 87 | EXPORT_SYMBOL(sysctl_tcp_adv_win_scale); |
88 | 88 | ||
89 | /* rfc5961 challenge ack rate limiting */ | 89 | /* rfc5961 challenge ack rate limiting */ |
90 | int sysctl_tcp_challenge_ack_limit = 100; | 90 | int sysctl_tcp_challenge_ack_limit = 1000; |
91 | 91 | ||
92 | int sysctl_tcp_stdurg __read_mostly; | 92 | int sysctl_tcp_stdurg __read_mostly; |
93 | int sysctl_tcp_rfc1337 __read_mostly; | 93 | int sysctl_tcp_rfc1337 __read_mostly; |
@@ -3424,6 +3424,23 @@ static int tcp_ack_update_window(struct sock *sk, const struct sk_buff *skb, u32 | |||
3424 | return flag; | 3424 | return flag; |
3425 | } | 3425 | } |
3426 | 3426 | ||
3427 | static bool __tcp_oow_rate_limited(struct net *net, int mib_idx, | ||
3428 | u32 *last_oow_ack_time) | ||
3429 | { | ||
3430 | if (*last_oow_ack_time) { | ||
3431 | s32 elapsed = (s32)(tcp_time_stamp - *last_oow_ack_time); | ||
3432 | |||
3433 | if (0 <= elapsed && elapsed < sysctl_tcp_invalid_ratelimit) { | ||
3434 | NET_INC_STATS(net, mib_idx); | ||
3435 | return true; /* rate-limited: don't send yet! */ | ||
3436 | } | ||
3437 | } | ||
3438 | |||
3439 | *last_oow_ack_time = tcp_time_stamp; | ||
3440 | |||
3441 | return false; /* not rate-limited: go ahead, send dupack now! */ | ||
3442 | } | ||
3443 | |||
3427 | /* Return true if we're currently rate-limiting out-of-window ACKs and | 3444 | /* Return true if we're currently rate-limiting out-of-window ACKs and |
3428 | * thus shouldn't send a dupack right now. We rate-limit dupacks in | 3445 | * thus shouldn't send a dupack right now. We rate-limit dupacks in |
3429 | * response to out-of-window SYNs or ACKs to mitigate ACK loops or DoS | 3446 | * response to out-of-window SYNs or ACKs to mitigate ACK loops or DoS |
@@ -3437,21 +3454,9 @@ bool tcp_oow_rate_limited(struct net *net, const struct sk_buff *skb, | |||
3437 | /* Data packets without SYNs are not likely part of an ACK loop. */ | 3454 | /* Data packets without SYNs are not likely part of an ACK loop. */ |
3438 | if ((TCP_SKB_CB(skb)->seq != TCP_SKB_CB(skb)->end_seq) && | 3455 | if ((TCP_SKB_CB(skb)->seq != TCP_SKB_CB(skb)->end_seq) && |
3439 | !tcp_hdr(skb)->syn) | 3456 | !tcp_hdr(skb)->syn) |
3440 | goto not_rate_limited; | 3457 | return false; |
3441 | |||
3442 | if (*last_oow_ack_time) { | ||
3443 | s32 elapsed = (s32)(tcp_time_stamp - *last_oow_ack_time); | ||
3444 | |||
3445 | if (0 <= elapsed && elapsed < sysctl_tcp_invalid_ratelimit) { | ||
3446 | NET_INC_STATS(net, mib_idx); | ||
3447 | return true; /* rate-limited: don't send yet! */ | ||
3448 | } | ||
3449 | } | ||
3450 | |||
3451 | *last_oow_ack_time = tcp_time_stamp; | ||
3452 | 3458 | ||
3453 | not_rate_limited: | 3459 | return __tcp_oow_rate_limited(net, mib_idx, last_oow_ack_time); |
3454 | return false; /* not rate-limited: go ahead, send dupack now! */ | ||
3455 | } | 3460 | } |
3456 | 3461 | ||
3457 | /* RFC 5961 7 [ACK Throttling] */ | 3462 | /* RFC 5961 7 [ACK Throttling] */ |
@@ -3461,21 +3466,26 @@ static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb) | |||
3461 | static u32 challenge_timestamp; | 3466 | static u32 challenge_timestamp; |
3462 | static unsigned int challenge_count; | 3467 | static unsigned int challenge_count; |
3463 | struct tcp_sock *tp = tcp_sk(sk); | 3468 | struct tcp_sock *tp = tcp_sk(sk); |
3464 | u32 now; | 3469 | u32 count, now; |
3465 | 3470 | ||
3466 | /* First check our per-socket dupack rate limit. */ | 3471 | /* First check our per-socket dupack rate limit. */ |
3467 | if (tcp_oow_rate_limited(sock_net(sk), skb, | 3472 | if (__tcp_oow_rate_limited(sock_net(sk), |
3468 | LINUX_MIB_TCPACKSKIPPEDCHALLENGE, | 3473 | LINUX_MIB_TCPACKSKIPPEDCHALLENGE, |
3469 | &tp->last_oow_ack_time)) | 3474 | &tp->last_oow_ack_time)) |
3470 | return; | 3475 | return; |
3471 | 3476 | ||
3472 | /* Then check the check host-wide RFC 5961 rate limit. */ | 3477 | /* Then check host-wide RFC 5961 rate limit. */ |
3473 | now = jiffies / HZ; | 3478 | now = jiffies / HZ; |
3474 | if (now != challenge_timestamp) { | 3479 | if (now != challenge_timestamp) { |
3480 | u32 half = (sysctl_tcp_challenge_ack_limit + 1) >> 1; | ||
3481 | |||
3475 | challenge_timestamp = now; | 3482 | challenge_timestamp = now; |
3476 | challenge_count = 0; | 3483 | WRITE_ONCE(challenge_count, half + |
3484 | prandom_u32_max(sysctl_tcp_challenge_ack_limit)); | ||
3477 | } | 3485 | } |
3478 | if (++challenge_count <= sysctl_tcp_challenge_ack_limit) { | 3486 | count = READ_ONCE(challenge_count); |
3487 | if (count > 0) { | ||
3488 | WRITE_ONCE(challenge_count, count - 1); | ||
3479 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPCHALLENGEACK); | 3489 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPCHALLENGEACK); |
3480 | tcp_send_ack(sk); | 3490 | tcp_send_ack(sk); |
3481 | } | 3491 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index ca5e8ea29538..4aed8fc23d32 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1583,6 +1583,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1583 | 1583 | ||
1584 | if (sk_filter(sk, skb)) | 1584 | if (sk_filter(sk, skb)) |
1585 | goto drop; | 1585 | goto drop; |
1586 | if (unlikely(skb->len < sizeof(struct udphdr))) | ||
1587 | goto drop; | ||
1586 | 1588 | ||
1587 | udp_csum_pull_header(skb); | 1589 | udp_csum_pull_header(skb); |
1588 | if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) { | 1590 | if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) { |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 0a71a312d0d8..ad5292be17bd 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -620,6 +620,8 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
620 | 620 | ||
621 | if (sk_filter(sk, skb)) | 621 | if (sk_filter(sk, skb)) |
622 | goto drop; | 622 | goto drop; |
623 | if (unlikely(skb->len < sizeof(struct udphdr))) | ||
624 | goto drop; | ||
623 | 625 | ||
624 | udp_csum_pull_header(skb); | 626 | udp_csum_pull_header(skb); |
625 | if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) { | 627 | if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) { |
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index 803001a45aa1..1b07578bedf3 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c | |||
@@ -1545,7 +1545,8 @@ error: | |||
1545 | /* | 1545 | /* |
1546 | * Set up receiving multicast socket over UDP | 1546 | * Set up receiving multicast socket over UDP |
1547 | */ | 1547 | */ |
1548 | static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id) | 1548 | static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id, |
1549 | int ifindex) | ||
1549 | { | 1550 | { |
1550 | /* multicast addr */ | 1551 | /* multicast addr */ |
1551 | union ipvs_sockaddr mcast_addr; | 1552 | union ipvs_sockaddr mcast_addr; |
@@ -1566,6 +1567,7 @@ static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id) | |||
1566 | set_sock_size(sock->sk, 0, result); | 1567 | set_sock_size(sock->sk, 0, result); |
1567 | 1568 | ||
1568 | get_mcast_sockaddr(&mcast_addr, &salen, &ipvs->bcfg, id); | 1569 | get_mcast_sockaddr(&mcast_addr, &salen, &ipvs->bcfg, id); |
1570 | sock->sk->sk_bound_dev_if = ifindex; | ||
1569 | result = sock->ops->bind(sock, (struct sockaddr *)&mcast_addr, salen); | 1571 | result = sock->ops->bind(sock, (struct sockaddr *)&mcast_addr, salen); |
1570 | if (result < 0) { | 1572 | if (result < 0) { |
1571 | pr_err("Error binding to the multicast addr\n"); | 1573 | pr_err("Error binding to the multicast addr\n"); |
@@ -1868,7 +1870,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c, | |||
1868 | if (state == IP_VS_STATE_MASTER) | 1870 | if (state == IP_VS_STATE_MASTER) |
1869 | sock = make_send_sock(ipvs, id); | 1871 | sock = make_send_sock(ipvs, id); |
1870 | else | 1872 | else |
1871 | sock = make_receive_sock(ipvs, id); | 1873 | sock = make_receive_sock(ipvs, id, dev->ifindex); |
1872 | if (IS_ERR(sock)) { | 1874 | if (IS_ERR(sock)) { |
1873 | result = PTR_ERR(sock); | 1875 | result = PTR_ERR(sock); |
1874 | goto outtinfo; | 1876 | goto outtinfo; |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 153e33ffeeaa..0ad936814fa2 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -640,6 +640,7 @@ static int nf_ct_resolve_clash(struct net *net, struct sk_buff *skb, | |||
640 | 640 | ||
641 | l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); | 641 | l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); |
642 | if (l4proto->allow_clash && | 642 | if (l4proto->allow_clash && |
643 | !nfct_nat(ct) && | ||
643 | !nf_ct_is_dying(ct) && | 644 | !nf_ct_is_dying(ct) && |
644 | atomic_inc_not_zero(&ct->ct_general.use)) { | 645 | atomic_inc_not_zero(&ct->ct_general.use)) { |
645 | nf_ct_acct_merge(ct, ctinfo, (struct nf_conn *)skb->nfct); | 646 | nf_ct_acct_merge(ct, ctinfo, (struct nf_conn *)skb->nfct); |
@@ -1581,8 +1582,15 @@ void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls) | |||
1581 | unsigned int nr_slots, i; | 1582 | unsigned int nr_slots, i; |
1582 | size_t sz; | 1583 | size_t sz; |
1583 | 1584 | ||
1585 | if (*sizep > (UINT_MAX / sizeof(struct hlist_nulls_head))) | ||
1586 | return NULL; | ||
1587 | |||
1584 | BUILD_BUG_ON(sizeof(struct hlist_nulls_head) != sizeof(struct hlist_head)); | 1588 | BUILD_BUG_ON(sizeof(struct hlist_nulls_head) != sizeof(struct hlist_head)); |
1585 | nr_slots = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct hlist_nulls_head)); | 1589 | nr_slots = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct hlist_nulls_head)); |
1590 | |||
1591 | if (nr_slots > (UINT_MAX / sizeof(struct hlist_nulls_head))) | ||
1592 | return NULL; | ||
1593 | |||
1586 | sz = nr_slots * sizeof(struct hlist_nulls_head); | 1594 | sz = nr_slots * sizeof(struct hlist_nulls_head); |
1587 | hash = (void *)__get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, | 1595 | hash = (void *)__get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, |
1588 | get_order(sz)); | 1596 | get_order(sz)); |
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 18b7f8578ee0..f24bed04ccfc 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
@@ -1706,9 +1706,11 @@ struct nft_expr *nft_expr_init(const struct nft_ctx *ctx, | |||
1706 | 1706 | ||
1707 | err = nf_tables_newexpr(ctx, &info, expr); | 1707 | err = nf_tables_newexpr(ctx, &info, expr); |
1708 | if (err < 0) | 1708 | if (err < 0) |
1709 | goto err2; | 1709 | goto err3; |
1710 | 1710 | ||
1711 | return expr; | 1711 | return expr; |
1712 | err3: | ||
1713 | kfree(expr); | ||
1712 | err2: | 1714 | err2: |
1713 | module_put(info.ops->type->owner); | 1715 | module_put(info.ops->type->owner); |
1714 | err1: | 1716 | err1: |
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c index 137e308d5b24..81fbb450783e 100644 --- a/net/netfilter/nft_ct.c +++ b/net/netfilter/nft_ct.c | |||
@@ -54,7 +54,6 @@ static void nft_ct_get_eval(const struct nft_expr *expr, | |||
54 | const struct nf_conn_help *help; | 54 | const struct nf_conn_help *help; |
55 | const struct nf_conntrack_tuple *tuple; | 55 | const struct nf_conntrack_tuple *tuple; |
56 | const struct nf_conntrack_helper *helper; | 56 | const struct nf_conntrack_helper *helper; |
57 | long diff; | ||
58 | unsigned int state; | 57 | unsigned int state; |
59 | 58 | ||
60 | ct = nf_ct_get(pkt->skb, &ctinfo); | 59 | ct = nf_ct_get(pkt->skb, &ctinfo); |
@@ -94,10 +93,7 @@ static void nft_ct_get_eval(const struct nft_expr *expr, | |||
94 | return; | 93 | return; |
95 | #endif | 94 | #endif |
96 | case NFT_CT_EXPIRATION: | 95 | case NFT_CT_EXPIRATION: |
97 | diff = (long)jiffies - (long)ct->timeout.expires; | 96 | *dest = jiffies_to_msecs(nf_ct_expires(ct)); |
98 | if (diff < 0) | ||
99 | diff = 0; | ||
100 | *dest = jiffies_to_msecs(diff); | ||
101 | return; | 97 | return; |
102 | case NFT_CT_HELPER: | 98 | case NFT_CT_HELPER: |
103 | if (ct->master == NULL) | 99 | if (ct->master == NULL) |
diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c index 03e5e33b5c39..2863f3493038 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c | |||
@@ -220,7 +220,7 @@ void nft_meta_set_eval(const struct nft_expr *expr, | |||
220 | skb->pkt_type = value; | 220 | skb->pkt_type = value; |
221 | break; | 221 | break; |
222 | case NFT_META_NFTRACE: | 222 | case NFT_META_NFTRACE: |
223 | skb->nf_trace = 1; | 223 | skb->nf_trace = !!value; |
224 | break; | 224 | break; |
225 | default: | 225 | default: |
226 | WARN_ON(1); | 226 | WARN_ON(1); |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 9d92c4c46871..33a4697d5539 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1923,13 +1923,11 @@ retry: | |||
1923 | goto out_unlock; | 1923 | goto out_unlock; |
1924 | } | 1924 | } |
1925 | 1925 | ||
1926 | sockc.tsflags = 0; | 1926 | sockc.tsflags = sk->sk_tsflags; |
1927 | if (msg->msg_controllen) { | 1927 | if (msg->msg_controllen) { |
1928 | err = sock_cmsg_send(sk, msg, &sockc); | 1928 | err = sock_cmsg_send(sk, msg, &sockc); |
1929 | if (unlikely(err)) { | 1929 | if (unlikely(err)) |
1930 | err = -EINVAL; | ||
1931 | goto out_unlock; | 1930 | goto out_unlock; |
1932 | } | ||
1933 | } | 1931 | } |
1934 | 1932 | ||
1935 | skb->protocol = proto; | 1933 | skb->protocol = proto; |
@@ -2642,7 +2640,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) | |||
2642 | dev = dev_get_by_index(sock_net(&po->sk), saddr->sll_ifindex); | 2640 | dev = dev_get_by_index(sock_net(&po->sk), saddr->sll_ifindex); |
2643 | } | 2641 | } |
2644 | 2642 | ||
2645 | sockc.tsflags = 0; | 2643 | sockc.tsflags = po->sk.sk_tsflags; |
2646 | if (msg->msg_controllen) { | 2644 | if (msg->msg_controllen) { |
2647 | err = sock_cmsg_send(&po->sk, msg, &sockc); | 2645 | err = sock_cmsg_send(&po->sk, msg, &sockc); |
2648 | if (unlikely(err)) | 2646 | if (unlikely(err)) |
@@ -2845,7 +2843,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) | |||
2845 | if (unlikely(!(dev->flags & IFF_UP))) | 2843 | if (unlikely(!(dev->flags & IFF_UP))) |
2846 | goto out_unlock; | 2844 | goto out_unlock; |
2847 | 2845 | ||
2848 | sockc.tsflags = 0; | 2846 | sockc.tsflags = sk->sk_tsflags; |
2849 | sockc.mark = sk->sk_mark; | 2847 | sockc.mark = sk->sk_mark; |
2850 | if (msg->msg_controllen) { | 2848 | if (msg->msg_controllen) { |
2851 | err = sock_cmsg_send(sk, msg, &sockc); | 2849 | err = sock_cmsg_send(sk, msg, &sockc); |
diff --git a/net/rose/rose_in.c b/net/rose/rose_in.c index 79c4abcfa6b4..0a6394754e81 100644 --- a/net/rose/rose_in.c +++ b/net/rose/rose_in.c | |||
@@ -164,7 +164,8 @@ static int rose_state3_machine(struct sock *sk, struct sk_buff *skb, int framety | |||
164 | rose_frames_acked(sk, nr); | 164 | rose_frames_acked(sk, nr); |
165 | if (ns == rose->vr) { | 165 | if (ns == rose->vr) { |
166 | rose_start_idletimer(sk); | 166 | rose_start_idletimer(sk); |
167 | if (sock_queue_rcv_skb(sk, skb) == 0) { | 167 | if (sk_filter_trim_cap(sk, skb, ROSE_MIN_LEN) == 0 && |
168 | __sock_queue_rcv_skb(sk, skb) == 0) { | ||
168 | rose->vr = (rose->vr + 1) % ROSE_MODULUS; | 169 | rose->vr = (rose->vr + 1) % ROSE_MODULUS; |
169 | queued = 1; | 170 | queued = 1; |
170 | } else { | 171 | } else { |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 91982d9784b3..53dbfa187870 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -1122,8 +1122,10 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) | |||
1122 | qlen = cl->un.leaf.q->q.qlen; | 1122 | qlen = cl->un.leaf.q->q.qlen; |
1123 | qs.backlog = cl->un.leaf.q->qstats.backlog; | 1123 | qs.backlog = cl->un.leaf.q->qstats.backlog; |
1124 | } | 1124 | } |
1125 | cl->xstats.tokens = PSCHED_NS2TICKS(cl->tokens); | 1125 | cl->xstats.tokens = clamp_t(s64, PSCHED_NS2TICKS(cl->tokens), |
1126 | cl->xstats.ctokens = PSCHED_NS2TICKS(cl->ctokens); | 1126 | INT_MIN, INT_MAX); |
1127 | cl->xstats.ctokens = clamp_t(s64, PSCHED_NS2TICKS(cl->ctokens), | ||
1128 | INT_MIN, INT_MAX); | ||
1127 | 1129 | ||
1128 | if (gnet_stats_copy_basic(qdisc_root_sleeping_running(sch), | 1130 | if (gnet_stats_copy_basic(qdisc_root_sleeping_running(sch), |
1129 | d, NULL, &cl->bstats) < 0 || | 1131 | d, NULL, &cl->bstats) < 0 || |
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 8584cc48654c..4131d5a86f55 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -335,6 +335,21 @@ static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b) | |||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
337 | 337 | ||
338 | /* tipc_bearer_reset_all - reset all links on all bearers | ||
339 | */ | ||
340 | void tipc_bearer_reset_all(struct net *net) | ||
341 | { | ||
342 | struct tipc_net *tn = tipc_net(net); | ||
343 | struct tipc_bearer *b; | ||
344 | int i; | ||
345 | |||
346 | for (i = 0; i < MAX_BEARERS; i++) { | ||
347 | b = rcu_dereference_rtnl(tn->bearer_list[i]); | ||
348 | if (b) | ||
349 | tipc_reset_bearer(net, b); | ||
350 | } | ||
351 | } | ||
352 | |||
338 | /** | 353 | /** |
339 | * bearer_disable | 354 | * bearer_disable |
340 | * | 355 | * |
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 0d337c7b6fad..f1e6db5e6345 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
@@ -198,6 +198,7 @@ void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest); | |||
198 | void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest); | 198 | void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest); |
199 | struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name); | 199 | struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name); |
200 | struct tipc_media *tipc_media_find(const char *name); | 200 | struct tipc_media *tipc_media_find(const char *name); |
201 | void tipc_bearer_reset_all(struct net *net); | ||
201 | int tipc_bearer_setup(void); | 202 | int tipc_bearer_setup(void); |
202 | void tipc_bearer_cleanup(void); | 203 | void tipc_bearer_cleanup(void); |
203 | void tipc_bearer_stop(struct net *net); | 204 | void tipc_bearer_stop(struct net *net); |
diff --git a/net/tipc/link.c b/net/tipc/link.c index c1df33f878b2..877d94f34814 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -350,6 +350,8 @@ void tipc_link_remove_bc_peer(struct tipc_link *snd_l, | |||
350 | u16 ack = snd_l->snd_nxt - 1; | 350 | u16 ack = snd_l->snd_nxt - 1; |
351 | 351 | ||
352 | snd_l->ackers--; | 352 | snd_l->ackers--; |
353 | rcv_l->bc_peer_is_up = true; | ||
354 | rcv_l->state = LINK_ESTABLISHED; | ||
353 | tipc_link_bc_ack_rcv(rcv_l, ack, xmitq); | 355 | tipc_link_bc_ack_rcv(rcv_l, ack, xmitq); |
354 | tipc_link_reset(rcv_l); | 356 | tipc_link_reset(rcv_l); |
355 | rcv_l->state = LINK_RESET; | 357 | rcv_l->state = LINK_RESET; |
@@ -1582,7 +1584,12 @@ void tipc_link_bc_sync_rcv(struct tipc_link *l, struct tipc_msg *hdr, | |||
1582 | if (!msg_peer_node_is_up(hdr)) | 1584 | if (!msg_peer_node_is_up(hdr)) |
1583 | return; | 1585 | return; |
1584 | 1586 | ||
1585 | l->bc_peer_is_up = true; | 1587 | /* Open when peer ackowledges our bcast init msg (pkt #1) */ |
1588 | if (msg_ack(hdr)) | ||
1589 | l->bc_peer_is_up = true; | ||
1590 | |||
1591 | if (!l->bc_peer_is_up) | ||
1592 | return; | ||
1586 | 1593 | ||
1587 | /* Ignore if peers_snd_nxt goes beyond receive window */ | 1594 | /* Ignore if peers_snd_nxt goes beyond receive window */ |
1588 | if (more(peers_snd_nxt, l->rcv_nxt + l->window)) | 1595 | if (more(peers_snd_nxt, l->rcv_nxt + l->window)) |
diff --git a/net/tipc/node.c b/net/tipc/node.c index a3fc0a3f4077..95cc78b51532 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1297,10 +1297,6 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id | |||
1297 | 1297 | ||
1298 | rc = tipc_bcast_rcv(net, be->link, skb); | 1298 | rc = tipc_bcast_rcv(net, be->link, skb); |
1299 | 1299 | ||
1300 | /* Broadcast link reset may happen at reassembly failure */ | ||
1301 | if (rc & TIPC_LINK_DOWN_EVT) | ||
1302 | tipc_node_reset_links(n); | ||
1303 | |||
1304 | /* Broadcast ACKs are sent on a unicast link */ | 1300 | /* Broadcast ACKs are sent on a unicast link */ |
1305 | if (rc & TIPC_LINK_SND_BC_ACK) { | 1301 | if (rc & TIPC_LINK_SND_BC_ACK) { |
1306 | tipc_node_read_lock(n); | 1302 | tipc_node_read_lock(n); |
@@ -1320,6 +1316,17 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id | |||
1320 | spin_unlock_bh(&be->inputq2.lock); | 1316 | spin_unlock_bh(&be->inputq2.lock); |
1321 | tipc_sk_mcast_rcv(net, &be->arrvq, &be->inputq2); | 1317 | tipc_sk_mcast_rcv(net, &be->arrvq, &be->inputq2); |
1322 | } | 1318 | } |
1319 | |||
1320 | if (rc & TIPC_LINK_DOWN_EVT) { | ||
1321 | /* Reception reassembly failure => reset all links to peer */ | ||
1322 | if (!tipc_link_is_up(be->link)) | ||
1323 | tipc_node_reset_links(n); | ||
1324 | |||
1325 | /* Retransmission failure => reset all links to all peers */ | ||
1326 | if (!tipc_link_is_up(tipc_bc_sndlink(net))) | ||
1327 | tipc_bearer_reset_all(net); | ||
1328 | } | ||
1329 | |||
1323 | tipc_node_put(n); | 1330 | tipc_node_put(n); |
1324 | } | 1331 | } |
1325 | 1332 | ||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5782f718d567..46417f9cce68 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3568,16 +3568,16 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) | |||
3568 | params.smps_mode = NL80211_SMPS_OFF; | 3568 | params.smps_mode = NL80211_SMPS_OFF; |
3569 | } | 3569 | } |
3570 | 3570 | ||
3571 | params.pbss = nla_get_flag(info->attrs[NL80211_ATTR_PBSS]); | ||
3572 | if (params.pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ]) | ||
3573 | return -EOPNOTSUPP; | ||
3574 | |||
3571 | if (info->attrs[NL80211_ATTR_ACL_POLICY]) { | 3575 | if (info->attrs[NL80211_ATTR_ACL_POLICY]) { |
3572 | params.acl = parse_acl_data(&rdev->wiphy, info); | 3576 | params.acl = parse_acl_data(&rdev->wiphy, info); |
3573 | if (IS_ERR(params.acl)) | 3577 | if (IS_ERR(params.acl)) |
3574 | return PTR_ERR(params.acl); | 3578 | return PTR_ERR(params.acl); |
3575 | } | 3579 | } |
3576 | 3580 | ||
3577 | params.pbss = nla_get_flag(info->attrs[NL80211_ATTR_PBSS]); | ||
3578 | if (params.pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ]) | ||
3579 | return -EOPNOTSUPP; | ||
3580 | |||
3581 | wdev_lock(wdev); | 3581 | wdev_lock(wdev); |
3582 | err = rdev_start_ap(rdev, dev, ¶ms); | 3582 | err = rdev_start_ap(rdev, dev, ¶ms); |
3583 | if (!err) { | 3583 | if (!err) { |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 2443ee30ba5b..b7d1592bd5b8 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -721,6 +721,8 @@ __ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen, | |||
721 | * alignment since sizeof(struct ethhdr) is 14. | 721 | * alignment since sizeof(struct ethhdr) is 14. |
722 | */ | 722 | */ |
723 | frame = dev_alloc_skb(hlen + sizeof(struct ethhdr) + 2 + cur_len); | 723 | frame = dev_alloc_skb(hlen + sizeof(struct ethhdr) + 2 + cur_len); |
724 | if (!frame) | ||
725 | return NULL; | ||
724 | 726 | ||
725 | skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2); | 727 | skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2); |
726 | skb_copy_bits(skb, offset, skb_put(frame, cur_len), cur_len); | 728 | skb_copy_bits(skb, offset, skb_put(frame, cur_len), cur_len); |
diff --git a/scripts/gdb/linux/.gitignore b/scripts/gdb/linux/.gitignore index 52e4e61140d1..2573543842d0 100644 --- a/scripts/gdb/linux/.gitignore +++ b/scripts/gdb/linux/.gitignore | |||
@@ -1,2 +1,3 @@ | |||
1 | *.pyc | 1 | *.pyc |
2 | *.pyo | 2 | *.pyo |
3 | constants.py | ||
diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile index cd129e65d1ff..8b00031f5349 100644 --- a/scripts/gdb/linux/Makefile +++ b/scripts/gdb/linux/Makefile | |||
@@ -13,9 +13,11 @@ quiet_cmd_gen_constants_py = GEN $@ | |||
13 | $(CPP) -E -x c -P $(c_flags) $< > $@ ;\ | 13 | $(CPP) -E -x c -P $(c_flags) $< > $@ ;\ |
14 | sed -i '1,/<!-- end-c-headers -->/d;' $@ | 14 | sed -i '1,/<!-- end-c-headers -->/d;' $@ |
15 | 15 | ||
16 | $(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in | 16 | targets += constants.py |
17 | $(call if_changed,gen_constants_py) | 17 | $(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in FORCE |
18 | $(call if_changed_dep,gen_constants_py) | ||
18 | 19 | ||
19 | build_constants_py: $(obj)/constants.py | 20 | build_constants_py: $(obj)/constants.py |
21 | @: | ||
20 | 22 | ||
21 | clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) $(obj)/constants.py | 23 | clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) $(obj)/constants.py |
diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in index 07e6c2befe36..7986f4e0da12 100644 --- a/scripts/gdb/linux/constants.py.in +++ b/scripts/gdb/linux/constants.py.in | |||
@@ -14,7 +14,6 @@ | |||
14 | 14 | ||
15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
16 | #include <linux/mount.h> | 16 | #include <linux/mount.h> |
17 | #include <linux/radix-tree.h> | ||
18 | 17 | ||
19 | /* We need to stringify expanded macros so that they can be parsed */ | 18 | /* We need to stringify expanded macros so that they can be parsed */ |
20 | 19 | ||
@@ -51,9 +50,3 @@ LX_VALUE(MNT_NOEXEC) | |||
51 | LX_VALUE(MNT_NOATIME) | 50 | LX_VALUE(MNT_NOATIME) |
52 | LX_VALUE(MNT_NODIRATIME) | 51 | LX_VALUE(MNT_NODIRATIME) |
53 | LX_VALUE(MNT_RELATIME) | 52 | LX_VALUE(MNT_RELATIME) |
54 | |||
55 | /* linux/radix-tree.h */ | ||
56 | LX_VALUE(RADIX_TREE_INDIRECT_PTR) | ||
57 | LX_GDBPARSED(RADIX_TREE_HEIGHT_MASK) | ||
58 | LX_GDBPARSED(RADIX_TREE_MAP_SHIFT) | ||
59 | LX_GDBPARSED(RADIX_TREE_MAP_MASK) | ||
diff --git a/scripts/gdb/linux/radixtree.py b/scripts/gdb/linux/radixtree.py deleted file mode 100644 index 0fdef4e2971a..000000000000 --- a/scripts/gdb/linux/radixtree.py +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | # | ||
2 | # gdb helper commands and functions for Linux kernel debugging | ||
3 | # | ||
4 | # Radix Tree Parser | ||
5 | # | ||
6 | # Copyright (c) 2016 Linaro Ltd | ||
7 | # | ||
8 | # Authors: | ||
9 | # Kieran Bingham <kieran.bingham@linaro.org> | ||
10 | # | ||
11 | # This work is licensed under the terms of the GNU GPL version 2. | ||
12 | # | ||
13 | |||
14 | import gdb | ||
15 | |||
16 | from linux import utils | ||
17 | from linux import constants | ||
18 | |||
19 | radix_tree_root_type = utils.CachedType("struct radix_tree_root") | ||
20 | radix_tree_node_type = utils.CachedType("struct radix_tree_node") | ||
21 | |||
22 | |||
23 | def is_indirect_ptr(node): | ||
24 | long_type = utils.get_long_type() | ||
25 | return (node.cast(long_type) & constants.LX_RADIX_TREE_INDIRECT_PTR) | ||
26 | |||
27 | |||
28 | def indirect_to_ptr(node): | ||
29 | long_type = utils.get_long_type() | ||
30 | node_type = node.type | ||
31 | indirect_ptr = node.cast(long_type) & ~constants.LX_RADIX_TREE_INDIRECT_PTR | ||
32 | return indirect_ptr.cast(node_type) | ||
33 | |||
34 | |||
35 | def maxindex(height): | ||
36 | height = height & constants.LX_RADIX_TREE_HEIGHT_MASK | ||
37 | return gdb.parse_and_eval("height_to_maxindex["+str(height)+"]") | ||
38 | |||
39 | |||
40 | def lookup(root, index): | ||
41 | if root.type == radix_tree_root_type.get_type().pointer(): | ||
42 | root = root.dereference() | ||
43 | elif root.type != radix_tree_root_type.get_type(): | ||
44 | raise gdb.GdbError("Must be struct radix_tree_root not {}" | ||
45 | .format(root.type)) | ||
46 | |||
47 | node = root['rnode'] | ||
48 | if node is 0: | ||
49 | return None | ||
50 | |||
51 | if not (is_indirect_ptr(node)): | ||
52 | if (index > 0): | ||
53 | return None | ||
54 | return node | ||
55 | |||
56 | node = indirect_to_ptr(node) | ||
57 | |||
58 | height = node['path'] & constants.LX_RADIX_TREE_HEIGHT_MASK | ||
59 | if (index > maxindex(height)): | ||
60 | return None | ||
61 | |||
62 | shift = (height-1) * constants.LX_RADIX_TREE_MAP_SHIFT | ||
63 | |||
64 | while True: | ||
65 | new_index = (index >> shift) & constants.LX_RADIX_TREE_MAP_MASK | ||
66 | slot = node['slots'][new_index] | ||
67 | |||
68 | node = slot.cast(node.type.pointer()).dereference() | ||
69 | if node is 0: | ||
70 | return None | ||
71 | |||
72 | shift -= constants.LX_RADIX_TREE_MAP_SHIFT | ||
73 | height -= 1 | ||
74 | |||
75 | if (height <= 0): | ||
76 | break | ||
77 | |||
78 | return node | ||
79 | |||
80 | |||
81 | class LxRadixTree(gdb.Function): | ||
82 | """ Lookup and return a node from a RadixTree. | ||
83 | |||
84 | $lx_radix_tree_lookup(root_node [, index]): Return the node at the given index. | ||
85 | If index is omitted, the root node is dereferenced and returned.""" | ||
86 | |||
87 | def __init__(self): | ||
88 | super(LxRadixTree, self).__init__("lx_radix_tree_lookup") | ||
89 | |||
90 | def invoke(self, root, index=0): | ||
91 | result = lookup(root, index) | ||
92 | if result is None: | ||
93 | raise gdb.GdbError("No entry in tree at index {}".format(index)) | ||
94 | |||
95 | return result | ||
96 | |||
97 | LxRadixTree() | ||
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index 9a0f8923f67c..004b0ac7fa72 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py | |||
@@ -153,7 +153,7 @@ lx-symbols command.""" | |||
153 | saved_state['breakpoint'].enabled = saved_state['enabled'] | 153 | saved_state['breakpoint'].enabled = saved_state['enabled'] |
154 | 154 | ||
155 | def invoke(self, arg, from_tty): | 155 | def invoke(self, arg, from_tty): |
156 | self.module_paths = arg.split() | 156 | self.module_paths = [os.path.expanduser(p) for p in arg.split()] |
157 | self.module_paths.append(os.getcwd()) | 157 | self.module_paths.append(os.getcwd()) |
158 | 158 | ||
159 | # enforce update | 159 | # enforce update |
diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py index 3a80ad6eecad..6e0b0afd888a 100644 --- a/scripts/gdb/vmlinux-gdb.py +++ b/scripts/gdb/vmlinux-gdb.py | |||
@@ -31,4 +31,3 @@ else: | |||
31 | import linux.lists | 31 | import linux.lists |
32 | import linux.proc | 32 | import linux.proc |
33 | import linux.constants | 33 | import linux.constants |
34 | import linux.radixtree | ||
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 2660fbcf94d1..7798e1608f4f 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c | |||
@@ -500,34 +500,34 @@ static int apparmor_setprocattr(struct task_struct *task, char *name, | |||
500 | { | 500 | { |
501 | struct common_audit_data sa; | 501 | struct common_audit_data sa; |
502 | struct apparmor_audit_data aad = {0,}; | 502 | struct apparmor_audit_data aad = {0,}; |
503 | char *command, *args = value; | 503 | char *command, *largs = NULL, *args = value; |
504 | size_t arg_size; | 504 | size_t arg_size; |
505 | int error; | 505 | int error; |
506 | 506 | ||
507 | if (size == 0) | 507 | if (size == 0) |
508 | return -EINVAL; | 508 | return -EINVAL; |
509 | /* args points to a PAGE_SIZE buffer, AppArmor requires that | ||
510 | * the buffer must be null terminated or have size <= PAGE_SIZE -1 | ||
511 | * so that AppArmor can null terminate them | ||
512 | */ | ||
513 | if (args[size - 1] != '\0') { | ||
514 | if (size == PAGE_SIZE) | ||
515 | return -EINVAL; | ||
516 | args[size] = '\0'; | ||
517 | } | ||
518 | |||
519 | /* task can only write its own attributes */ | 509 | /* task can only write its own attributes */ |
520 | if (current != task) | 510 | if (current != task) |
521 | return -EACCES; | 511 | return -EACCES; |
522 | 512 | ||
523 | args = value; | 513 | /* AppArmor requires that the buffer must be null terminated atm */ |
514 | if (args[size - 1] != '\0') { | ||
515 | /* null terminate */ | ||
516 | largs = args = kmalloc(size + 1, GFP_KERNEL); | ||
517 | if (!args) | ||
518 | return -ENOMEM; | ||
519 | memcpy(args, value, size); | ||
520 | args[size] = '\0'; | ||
521 | } | ||
522 | |||
523 | error = -EINVAL; | ||
524 | args = strim(args); | 524 | args = strim(args); |
525 | command = strsep(&args, " "); | 525 | command = strsep(&args, " "); |
526 | if (!args) | 526 | if (!args) |
527 | return -EINVAL; | 527 | goto out; |
528 | args = skip_spaces(args); | 528 | args = skip_spaces(args); |
529 | if (!*args) | 529 | if (!*args) |
530 | return -EINVAL; | 530 | goto out; |
531 | 531 | ||
532 | arg_size = size - (args - (char *) value); | 532 | arg_size = size - (args - (char *) value); |
533 | if (strcmp(name, "current") == 0) { | 533 | if (strcmp(name, "current") == 0) { |
@@ -553,10 +553,12 @@ static int apparmor_setprocattr(struct task_struct *task, char *name, | |||
553 | goto fail; | 553 | goto fail; |
554 | } else | 554 | } else |
555 | /* only support the "current" and "exec" process attributes */ | 555 | /* only support the "current" and "exec" process attributes */ |
556 | return -EINVAL; | 556 | goto fail; |
557 | 557 | ||
558 | if (!error) | 558 | if (!error) |
559 | error = size; | 559 | error = size; |
560 | out: | ||
561 | kfree(largs); | ||
560 | return error; | 562 | return error; |
561 | 563 | ||
562 | fail: | 564 | fail: |
@@ -565,9 +567,9 @@ fail: | |||
565 | aad.profile = aa_current_profile(); | 567 | aad.profile = aa_current_profile(); |
566 | aad.op = OP_SETPROCATTR; | 568 | aad.op = OP_SETPROCATTR; |
567 | aad.info = name; | 569 | aad.info = name; |
568 | aad.error = -EINVAL; | 570 | aad.error = error = -EINVAL; |
569 | aa_audit_msg(AUDIT_APPARMOR_DENIED, &sa, NULL); | 571 | aa_audit_msg(AUDIT_APPARMOR_DENIED, &sa, NULL); |
570 | return -EINVAL; | 572 | goto out; |
571 | } | 573 | } |
572 | 574 | ||
573 | static int apparmor_task_setrlimit(struct task_struct *task, | 575 | static int apparmor_task_setrlimit(struct task_struct *task, |
diff --git a/sound/core/control.c b/sound/core/control.c index a85d45595d02..b4fe9b002512 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -160,6 +160,8 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask, | |||
160 | 160 | ||
161 | if (snd_BUG_ON(!card || !id)) | 161 | if (snd_BUG_ON(!card || !id)) |
162 | return; | 162 | return; |
163 | if (card->shutdown) | ||
164 | return; | ||
163 | read_lock(&card->ctl_files_rwlock); | 165 | read_lock(&card->ctl_files_rwlock); |
164 | #if IS_ENABLED(CONFIG_SND_MIXER_OSS) | 166 | #if IS_ENABLED(CONFIG_SND_MIXER_OSS) |
165 | card->mixer_oss_change_count++; | 167 | card->mixer_oss_change_count++; |
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 308c9ecf73db..8e980aa678d0 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -849,6 +849,14 @@ int snd_pcm_new_internal(struct snd_card *card, const char *id, int device, | |||
849 | } | 849 | } |
850 | EXPORT_SYMBOL(snd_pcm_new_internal); | 850 | EXPORT_SYMBOL(snd_pcm_new_internal); |
851 | 851 | ||
852 | static void free_chmap(struct snd_pcm_str *pstr) | ||
853 | { | ||
854 | if (pstr->chmap_kctl) { | ||
855 | snd_ctl_remove(pstr->pcm->card, pstr->chmap_kctl); | ||
856 | pstr->chmap_kctl = NULL; | ||
857 | } | ||
858 | } | ||
859 | |||
852 | static void snd_pcm_free_stream(struct snd_pcm_str * pstr) | 860 | static void snd_pcm_free_stream(struct snd_pcm_str * pstr) |
853 | { | 861 | { |
854 | struct snd_pcm_substream *substream, *substream_next; | 862 | struct snd_pcm_substream *substream, *substream_next; |
@@ -871,6 +879,7 @@ static void snd_pcm_free_stream(struct snd_pcm_str * pstr) | |||
871 | kfree(setup); | 879 | kfree(setup); |
872 | } | 880 | } |
873 | #endif | 881 | #endif |
882 | free_chmap(pstr); | ||
874 | if (pstr->substream_count) | 883 | if (pstr->substream_count) |
875 | put_device(&pstr->dev); | 884 | put_device(&pstr->dev); |
876 | } | 885 | } |
@@ -1135,10 +1144,7 @@ static int snd_pcm_dev_disconnect(struct snd_device *device) | |||
1135 | for (cidx = 0; cidx < 2; cidx++) { | 1144 | for (cidx = 0; cidx < 2; cidx++) { |
1136 | if (!pcm->internal) | 1145 | if (!pcm->internal) |
1137 | snd_unregister_device(&pcm->streams[cidx].dev); | 1146 | snd_unregister_device(&pcm->streams[cidx].dev); |
1138 | if (pcm->streams[cidx].chmap_kctl) { | 1147 | free_chmap(&pcm->streams[cidx]); |
1139 | snd_ctl_remove(pcm->card, pcm->streams[cidx].chmap_kctl); | ||
1140 | pcm->streams[cidx].chmap_kctl = NULL; | ||
1141 | } | ||
1142 | } | 1148 | } |
1143 | mutex_unlock(&pcm->open_mutex); | 1149 | mutex_unlock(&pcm->open_mutex); |
1144 | mutex_unlock(®ister_mutex); | 1150 | mutex_unlock(®ister_mutex); |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index e320c44714b1..6f8ea13323c1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1218,8 +1218,10 @@ static int azx_free(struct azx *chip) | |||
1218 | if (use_vga_switcheroo(hda)) { | 1218 | if (use_vga_switcheroo(hda)) { |
1219 | if (chip->disabled && hda->probe_continued) | 1219 | if (chip->disabled && hda->probe_continued) |
1220 | snd_hda_unlock_devices(&chip->bus); | 1220 | snd_hda_unlock_devices(&chip->bus); |
1221 | if (hda->vga_switcheroo_registered) | 1221 | if (hda->vga_switcheroo_registered) { |
1222 | vga_switcheroo_unregister_client(chip->pci); | 1222 | vga_switcheroo_unregister_client(chip->pci); |
1223 | vga_switcheroo_fini_domain_pm_ops(chip->card->dev); | ||
1224 | } | ||
1223 | } | 1225 | } |
1224 | 1226 | ||
1225 | if (bus->chip_init) { | 1227 | if (bus->chip_init) { |
@@ -2267,6 +2269,8 @@ static const struct pci_device_id azx_ids[] = { | |||
2267 | .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, | 2269 | .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, |
2268 | { PCI_DEVICE(0x1002, 0x157a), | 2270 | { PCI_DEVICE(0x1002, 0x157a), |
2269 | .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, | 2271 | .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, |
2272 | { PCI_DEVICE(0x1002, 0x15b3), | ||
2273 | .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, | ||
2270 | { PCI_DEVICE(0x1002, 0x793b), | 2274 | { PCI_DEVICE(0x1002, 0x793b), |
2271 | .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI }, | 2275 | .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI }, |
2272 | { PCI_DEVICE(0x1002, 0x7919), | 2276 | { PCI_DEVICE(0x1002, 0x7919), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 5fac786e4982..abcb5a6a1cd9 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -5738,7 +5738,6 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
5738 | {} | 5738 | {} |
5739 | }; | 5739 | }; |
5740 | #define ALC225_STANDARD_PINS \ | 5740 | #define ALC225_STANDARD_PINS \ |
5741 | {0x12, 0xb7a60130}, \ | ||
5742 | {0x21, 0x04211020} | 5741 | {0x21, 0x04211020} |
5743 | 5742 | ||
5744 | #define ALC256_STANDARD_PINS \ | 5743 | #define ALC256_STANDARD_PINS \ |
@@ -5763,10 +5762,24 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
5763 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | 5762 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
5764 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | 5763 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
5765 | ALC225_STANDARD_PINS, | 5764 | ALC225_STANDARD_PINS, |
5765 | {0x12, 0xb7a60130}, | ||
5766 | {0x14, 0x901701a0}), | 5766 | {0x14, 0x901701a0}), |
5767 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | 5767 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
5768 | ALC225_STANDARD_PINS, | 5768 | ALC225_STANDARD_PINS, |
5769 | {0x12, 0xb7a60130}, | ||
5769 | {0x14, 0x901701b0}), | 5770 | {0x14, 0x901701b0}), |
5771 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
5772 | ALC225_STANDARD_PINS, | ||
5773 | {0x12, 0xb7a60150}, | ||
5774 | {0x14, 0x901701a0}), | ||
5775 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
5776 | ALC225_STANDARD_PINS, | ||
5777 | {0x12, 0xb7a60150}, | ||
5778 | {0x14, 0x901701b0}), | ||
5779 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
5780 | ALC225_STANDARD_PINS, | ||
5781 | {0x12, 0xb7a60130}, | ||
5782 | {0x1b, 0x90170110}), | ||
5770 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, | 5783 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
5771 | {0x14, 0x90170110}, | 5784 | {0x14, 0x90170110}, |
5772 | {0x21, 0x02211020}), | 5785 | {0x21, 0x02211020}), |
diff --git a/sound/usb/card.c b/sound/usb/card.c index 69860da473ea..9e5276d6dda0 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -556,7 +556,6 @@ static int usb_audio_probe(struct usb_interface *intf, | |||
556 | goto __error; | 556 | goto __error; |
557 | } | 557 | } |
558 | chip = usb_chip[i]; | 558 | chip = usb_chip[i]; |
559 | dev_set_drvdata(&dev->dev, chip); | ||
560 | atomic_inc(&chip->active); /* avoid autopm */ | 559 | atomic_inc(&chip->active); /* avoid autopm */ |
561 | break; | 560 | break; |
562 | } | 561 | } |
@@ -582,6 +581,7 @@ static int usb_audio_probe(struct usb_interface *intf, | |||
582 | goto __error; | 581 | goto __error; |
583 | } | 582 | } |
584 | } | 583 | } |
584 | dev_set_drvdata(&dev->dev, chip); | ||
585 | 585 | ||
586 | /* | 586 | /* |
587 | * For devices with more than one control interface, we assume the | 587 | * For devices with more than one control interface, we assume the |
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index e8a1e69eb92c..25d803148f5c 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c | |||
@@ -122,10 +122,14 @@ static bool ignore_func(struct objtool_file *file, struct symbol *func) | |||
122 | 122 | ||
123 | /* check for STACK_FRAME_NON_STANDARD */ | 123 | /* check for STACK_FRAME_NON_STANDARD */ |
124 | if (file->whitelist && file->whitelist->rela) | 124 | if (file->whitelist && file->whitelist->rela) |
125 | list_for_each_entry(rela, &file->whitelist->rela->rela_list, list) | 125 | list_for_each_entry(rela, &file->whitelist->rela->rela_list, list) { |
126 | if (rela->sym->sec == func->sec && | 126 | if (rela->sym->type == STT_SECTION && |
127 | rela->sym->sec == func->sec && | ||
127 | rela->addend == func->offset) | 128 | rela->addend == func->offset) |
128 | return true; | 129 | return true; |
130 | if (rela->sym->type == STT_FUNC && rela->sym == func) | ||
131 | return true; | ||
132 | } | ||
129 | 133 | ||
130 | /* check if it has a context switching instruction */ | 134 | /* check if it has a context switching instruction */ |
131 | func_for_each_insn(file, func, insn) | 135 | func_for_each_insn(file, func, insn) |
diff --git a/tools/testing/radix-tree/tag_check.c b/tools/testing/radix-tree/tag_check.c index b7447ceb75e9..b0ac05741750 100644 --- a/tools/testing/radix-tree/tag_check.c +++ b/tools/testing/radix-tree/tag_check.c | |||
@@ -122,7 +122,7 @@ enum { | |||
122 | NODE_TAGGED = 2, | 122 | NODE_TAGGED = 2, |
123 | }; | 123 | }; |
124 | 124 | ||
125 | #define THRASH_SIZE 1000 * 1000 | 125 | #define THRASH_SIZE (1000 * 1000) |
126 | #define N 127 | 126 | #define N 127 |
127 | #define BATCH 33 | 127 | #define BATCH 33 |
128 | 128 | ||
diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index 7cf6e1769903..b9d34b37c017 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c | |||
@@ -510,10 +510,11 @@ static void slab_stats(struct slabinfo *s) | |||
510 | s->alloc_node_mismatch, (s->alloc_node_mismatch * 100) / total); | 510 | s->alloc_node_mismatch, (s->alloc_node_mismatch * 100) / total); |
511 | } | 511 | } |
512 | 512 | ||
513 | if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail) | 513 | if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail) { |
514 | printf("\nCmpxchg_double Looping\n------------------------\n"); | 514 | printf("\nCmpxchg_double Looping\n------------------------\n"); |
515 | printf("Locked Cmpxchg Double redos %lu\nUnlocked Cmpxchg Double redos %lu\n", | 515 | printf("Locked Cmpxchg Double redos %lu\nUnlocked Cmpxchg Double redos %lu\n", |
516 | s->cmpxchg_double_fail, s->cmpxchg_double_cpu_fail); | 516 | s->cmpxchg_double_fail, s->cmpxchg_double_cpu_fail); |
517 | } | ||
517 | } | 518 | } |
518 | 519 | ||
519 | static void report(struct slabinfo *s) | 520 | static void report(struct slabinfo *s) |