Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0169-5.4.70-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3637 - (show annotations) (download)
Mon Oct 24 12:40:44 2022 UTC (18 months, 1 week ago) by niro
File size: 86509 byte(s)
-add missing
1 diff --git a/Documentation/admin-guide/iostats.rst b/Documentation/admin-guide/iostats.rst
2 index 5d63b18bd6d1f..60c45c916f7d0 100644
3 --- a/Documentation/admin-guide/iostats.rst
4 +++ b/Documentation/admin-guide/iostats.rst
5 @@ -99,7 +99,7 @@ Field 10 -- # of milliseconds spent doing I/Os
6
7 Since 5.0 this field counts jiffies when at least one request was
8 started or completed. If request runs more than 2 jiffies then some
9 - I/O time will not be accounted unless there are other requests.
10 + I/O time might be not accounted in case of concurrent requests.
11
12 Field 11 -- weighted # of milliseconds spent doing I/Os
13 This field is incremented at each I/O start, I/O completion, I/O
14 @@ -133,6 +133,9 @@ are summed (possibly overflowing the unsigned long variable they are
15 summed to) and the result given to the user. There is no convenient
16 user interface for accessing the per-CPU counters themselves.
17
18 +Since 4.19 request times are measured with nanoseconds precision and
19 +truncated to milliseconds before showing in this interface.
20 +
21 Disks vs Partitions
22 -------------------
23
24 diff --git a/Documentation/devicetree/bindings/gpio/sgpio-aspeed.txt b/Documentation/devicetree/bindings/gpio/sgpio-aspeed.txt
25 index d4d83916c09dd..be329ea4794f8 100644
26 --- a/Documentation/devicetree/bindings/gpio/sgpio-aspeed.txt
27 +++ b/Documentation/devicetree/bindings/gpio/sgpio-aspeed.txt
28 @@ -20,8 +20,9 @@ Required properties:
29 - gpio-controller : Marks the device node as a GPIO controller
30 - interrupts : Interrupt specifier, see interrupt-controller/interrupts.txt
31 - interrupt-controller : Mark the GPIO controller as an interrupt-controller
32 -- ngpios : number of GPIO lines, see gpio.txt
33 - (should be multiple of 8, up to 80 pins)
34 +- ngpios : number of *hardware* GPIO lines, see gpio.txt. This will expose
35 + 2 software GPIOs per hardware GPIO: one for hardware input, one for hardware
36 + output. Up to 80 pins, must be a multiple of 8.
37 - clocks : A phandle to the APB clock for SGPM clock division
38 - bus-frequency : SGPM CLK frequency
39
40 diff --git a/Makefile b/Makefile
41 index adf3847106775..e409fd909560f 100644
42 --- a/Makefile
43 +++ b/Makefile
44 @@ -1,7 +1,7 @@
45 # SPDX-License-Identifier: GPL-2.0
46 VERSION = 5
47 PATCHLEVEL = 4
48 -SUBLEVEL = 69
49 +SUBLEVEL = 70
50 EXTRAVERSION =
51 NAME = Kleptomaniac Octopus
52
53 diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
54 index a6dd80a2c9392..ee50506d86f42 100644
55 --- a/arch/ia64/mm/init.c
56 +++ b/arch/ia64/mm/init.c
57 @@ -518,7 +518,7 @@ virtual_memmap_init(u64 start, u64 end, void *arg)
58 if (map_start < map_end)
59 memmap_init_zone((unsigned long)(map_end - map_start),
60 args->nid, args->zone, page_to_pfn(map_start),
61 - MEMMAP_EARLY, NULL);
62 + MEMINIT_EARLY, NULL);
63 return 0;
64 }
65
66 @@ -527,8 +527,8 @@ memmap_init (unsigned long size, int nid, unsigned long zone,
67 unsigned long start_pfn)
68 {
69 if (!vmem_map) {
70 - memmap_init_zone(size, nid, zone, start_pfn, MEMMAP_EARLY,
71 - NULL);
72 + memmap_init_zone(size, nid, zone, start_pfn,
73 + MEMINIT_EARLY, NULL);
74 } else {
75 struct page *start;
76 struct memmap_init_callback_data args;
77 diff --git a/block/bio.c b/block/bio.c
78 index f07739300dfe3..24704bc2ad6f1 100644
79 --- a/block/bio.c
80 +++ b/block/bio.c
81 @@ -1754,14 +1754,14 @@ defer:
82 schedule_work(&bio_dirty_work);
83 }
84
85 -void update_io_ticks(struct hd_struct *part, unsigned long now)
86 +void update_io_ticks(struct hd_struct *part, unsigned long now, bool end)
87 {
88 unsigned long stamp;
89 again:
90 stamp = READ_ONCE(part->stamp);
91 if (unlikely(stamp != now)) {
92 if (likely(cmpxchg(&part->stamp, stamp, now) == stamp)) {
93 - __part_stat_add(part, io_ticks, 1);
94 + __part_stat_add(part, io_ticks, end ? now - stamp : 1);
95 }
96 }
97 if (part->partno) {
98 @@ -1777,7 +1777,7 @@ void generic_start_io_acct(struct request_queue *q, int op,
99
100 part_stat_lock();
101
102 - update_io_ticks(part, jiffies);
103 + update_io_ticks(part, jiffies, false);
104 part_stat_inc(part, ios[sgrp]);
105 part_stat_add(part, sectors[sgrp], sectors);
106 part_inc_in_flight(q, part, op_is_write(op));
107 @@ -1795,7 +1795,7 @@ void generic_end_io_acct(struct request_queue *q, int req_op,
108
109 part_stat_lock();
110
111 - update_io_ticks(part, now);
112 + update_io_ticks(part, now, true);
113 part_stat_add(part, nsecs[sgrp], jiffies_to_nsecs(duration));
114 part_stat_add(part, time_in_queue, duration);
115 part_dec_in_flight(q, part, op_is_write(req_op));
116 diff --git a/block/blk-core.c b/block/blk-core.c
117 index ca6b677356864..81aafb601df06 100644
118 --- a/block/blk-core.c
119 +++ b/block/blk-core.c
120 @@ -1334,7 +1334,7 @@ void blk_account_io_done(struct request *req, u64 now)
121 part_stat_lock();
122 part = req->part;
123
124 - update_io_ticks(part, jiffies);
125 + update_io_ticks(part, jiffies, true);
126 part_stat_inc(part, ios[sgrp]);
127 part_stat_add(part, nsecs[sgrp], now - req->start_time_ns);
128 part_stat_add(part, time_in_queue, nsecs_to_jiffies64(now - req->start_time_ns));
129 @@ -1376,7 +1376,7 @@ void blk_account_io_start(struct request *rq, bool new_io)
130 rq->part = part;
131 }
132
133 - update_io_ticks(part, jiffies);
134 + update_io_ticks(part, jiffies, false);
135
136 part_stat_unlock();
137 }
138 diff --git a/drivers/base/node.c b/drivers/base/node.c
139 index 296546ffed6c1..9c6e6a7b93545 100644
140 --- a/drivers/base/node.c
141 +++ b/drivers/base/node.c
142 @@ -758,14 +758,36 @@ static int __ref get_nid_for_pfn(unsigned long pfn)
143 return pfn_to_nid(pfn);
144 }
145
146 +static int do_register_memory_block_under_node(int nid,
147 + struct memory_block *mem_blk)
148 +{
149 + int ret;
150 +
151 + /*
152 + * If this memory block spans multiple nodes, we only indicate
153 + * the last processed node.
154 + */
155 + mem_blk->nid = nid;
156 +
157 + ret = sysfs_create_link_nowarn(&node_devices[nid]->dev.kobj,
158 + &mem_blk->dev.kobj,
159 + kobject_name(&mem_blk->dev.kobj));
160 + if (ret)
161 + return ret;
162 +
163 + return sysfs_create_link_nowarn(&mem_blk->dev.kobj,
164 + &node_devices[nid]->dev.kobj,
165 + kobject_name(&node_devices[nid]->dev.kobj));
166 +}
167 +
168 /* register memory section under specified node if it spans that node */
169 -static int register_mem_sect_under_node(struct memory_block *mem_blk,
170 - void *arg)
171 +static int register_mem_block_under_node_early(struct memory_block *mem_blk,
172 + void *arg)
173 {
174 unsigned long memory_block_pfns = memory_block_size_bytes() / PAGE_SIZE;
175 unsigned long start_pfn = section_nr_to_pfn(mem_blk->start_section_nr);
176 unsigned long end_pfn = start_pfn + memory_block_pfns - 1;
177 - int ret, nid = *(int *)arg;
178 + int nid = *(int *)arg;
179 unsigned long pfn;
180
181 for (pfn = start_pfn; pfn <= end_pfn; pfn++) {
182 @@ -782,38 +804,33 @@ static int register_mem_sect_under_node(struct memory_block *mem_blk,
183 }
184
185 /*
186 - * We need to check if page belongs to nid only for the boot
187 - * case, during hotplug we know that all pages in the memory
188 - * block belong to the same node.
189 - */
190 - if (system_state == SYSTEM_BOOTING) {
191 - page_nid = get_nid_for_pfn(pfn);
192 - if (page_nid < 0)
193 - continue;
194 - if (page_nid != nid)
195 - continue;
196 - }
197 -
198 - /*
199 - * If this memory block spans multiple nodes, we only indicate
200 - * the last processed node.
201 + * We need to check if page belongs to nid only at the boot
202 + * case because node's ranges can be interleaved.
203 */
204 - mem_blk->nid = nid;
205 -
206 - ret = sysfs_create_link_nowarn(&node_devices[nid]->dev.kobj,
207 - &mem_blk->dev.kobj,
208 - kobject_name(&mem_blk->dev.kobj));
209 - if (ret)
210 - return ret;
211 + page_nid = get_nid_for_pfn(pfn);
212 + if (page_nid < 0)
213 + continue;
214 + if (page_nid != nid)
215 + continue;
216
217 - return sysfs_create_link_nowarn(&mem_blk->dev.kobj,
218 - &node_devices[nid]->dev.kobj,
219 - kobject_name(&node_devices[nid]->dev.kobj));
220 + return do_register_memory_block_under_node(nid, mem_blk);
221 }
222 /* mem section does not span the specified node */
223 return 0;
224 }
225
226 +/*
227 + * During hotplug we know that all pages in the memory block belong to the same
228 + * node.
229 + */
230 +static int register_mem_block_under_node_hotplug(struct memory_block *mem_blk,
231 + void *arg)
232 +{
233 + int nid = *(int *)arg;
234 +
235 + return do_register_memory_block_under_node(nid, mem_blk);
236 +}
237 +
238 /*
239 * Unregister a memory block device under the node it spans. Memory blocks
240 * with multiple nodes cannot be offlined and therefore also never be removed.
241 @@ -829,11 +846,19 @@ void unregister_memory_block_under_nodes(struct memory_block *mem_blk)
242 kobject_name(&node_devices[mem_blk->nid]->dev.kobj));
243 }
244
245 -int link_mem_sections(int nid, unsigned long start_pfn, unsigned long end_pfn)
246 +int link_mem_sections(int nid, unsigned long start_pfn, unsigned long end_pfn,
247 + enum meminit_context context)
248 {
249 + walk_memory_blocks_func_t func;
250 +
251 + if (context == MEMINIT_HOTPLUG)
252 + func = register_mem_block_under_node_hotplug;
253 + else
254 + func = register_mem_block_under_node_early;
255 +
256 return walk_memory_blocks(PFN_PHYS(start_pfn),
257 PFN_PHYS(end_pfn - start_pfn), (void *)&nid,
258 - register_mem_sect_under_node);
259 + func);
260 }
261
262 #ifdef CONFIG_HUGETLBFS
263 diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
264 index 51564fc23c639..f4086287bb71b 100644
265 --- a/drivers/clk/samsung/clk-exynos4.c
266 +++ b/drivers/clk/samsung/clk-exynos4.c
267 @@ -927,7 +927,7 @@ static const struct samsung_gate_clock exynos4210_gate_clks[] __initconst = {
268 GATE(CLK_PCIE, "pcie", "aclk133", GATE_IP_FSYS, 14, 0, 0),
269 GATE(CLK_SMMU_PCIE, "smmu_pcie", "aclk133", GATE_IP_FSYS, 18, 0, 0),
270 GATE(CLK_MODEMIF, "modemif", "aclk100", GATE_IP_PERIL, 28, 0, 0),
271 - GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, 0, 0),
272 + GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0),
273 GATE(CLK_SYSREG, "sysreg", "aclk100", E4210_GATE_IP_PERIR, 0,
274 CLK_IGNORE_UNUSED, 0),
275 GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4210_GATE_IP_PERIR, 11, 0,
276 @@ -969,7 +969,7 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = {
277 0),
278 GATE(CLK_TSADC, "tsadc", "aclk133", E4X12_GATE_BUS_FSYS1, 16, 0, 0),
279 GATE(CLK_MIPI_HSI, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0),
280 - GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0),
281 + GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0),
282 GATE(CLK_SYSREG, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1,
283 CLK_IGNORE_UNUSED, 0),
284 GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4X12_GATE_IP_PERIR, 11, 0,
285 diff --git a/drivers/clk/socfpga/clk-s10.c b/drivers/clk/socfpga/clk-s10.c
286 index 993f3a73c71e7..55d3b505b08c9 100644
287 --- a/drivers/clk/socfpga/clk-s10.c
288 +++ b/drivers/clk/socfpga/clk-s10.c
289 @@ -107,7 +107,7 @@ static const struct stratix10_perip_cnt_clock s10_main_perip_cnt_clks[] = {
290 { STRATIX10_EMAC_B_FREE_CLK, "emacb_free_clk", NULL, emacb_free_mux, ARRAY_SIZE(emacb_free_mux),
291 0, 0, 2, 0xB0, 1},
292 { STRATIX10_EMAC_PTP_FREE_CLK, "emac_ptp_free_clk", NULL, emac_ptp_free_mux,
293 - ARRAY_SIZE(emac_ptp_free_mux), 0, 0, 4, 0xB0, 2},
294 + ARRAY_SIZE(emac_ptp_free_mux), 0, 0, 2, 0xB0, 2},
295 { STRATIX10_GPIO_DB_FREE_CLK, "gpio_db_free_clk", NULL, gpio_db_free_mux,
296 ARRAY_SIZE(gpio_db_free_mux), 0, 0, 0, 0xB0, 3},
297 { STRATIX10_SDMMC_FREE_CLK, "sdmmc_free_clk", NULL, sdmmc_free_mux,
298 diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
299 index 1583f5fc992f3..80f640d9ea71c 100644
300 --- a/drivers/clk/tegra/clk-pll.c
301 +++ b/drivers/clk/tegra/clk-pll.c
302 @@ -1569,9 +1569,6 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
303 unsigned long flags = 0;
304 unsigned long input_rate;
305
306 - if (clk_pll_is_enabled(hw))
307 - return 0;
308 -
309 input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
310
311 if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
312 diff --git a/drivers/clocksource/timer-gx6605s.c b/drivers/clocksource/timer-gx6605s.c
313 index 80d0939d040b5..8d386adbe8009 100644
314 --- a/drivers/clocksource/timer-gx6605s.c
315 +++ b/drivers/clocksource/timer-gx6605s.c
316 @@ -28,6 +28,7 @@ static irqreturn_t gx6605s_timer_interrupt(int irq, void *dev)
317 void __iomem *base = timer_of_base(to_timer_of(ce));
318
319 writel_relaxed(GX6605S_STATUS_CLR, base + TIMER_STATUS);
320 + writel_relaxed(0, base + TIMER_INI);
321
322 ce->event_handler(ce);
323
324 diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
325 index 09e53c5f3b0a4..2820c59b5f071 100644
326 --- a/drivers/gpio/gpio-aspeed.c
327 +++ b/drivers/gpio/gpio-aspeed.c
328 @@ -1115,8 +1115,8 @@ static const struct aspeed_gpio_config ast2500_config =
329
330 static const struct aspeed_bank_props ast2600_bank_props[] = {
331 /* input output */
332 - {5, 0xffffffff, 0x0000ffff}, /* U/V/W/X */
333 - {6, 0xffff0000, 0x0fff0000}, /* Y/Z */
334 + {5, 0xffffffff, 0xffffff00}, /* U/V/W/X */
335 + {6, 0x0000ffff, 0x0000ffff}, /* Y/Z */
336 { },
337 };
338
339 diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c
340 index 213aedc97dc2e..9c1c4d81aa7b6 100644
341 --- a/drivers/gpio/gpio-mockup.c
342 +++ b/drivers/gpio/gpio-mockup.c
343 @@ -497,6 +497,7 @@ static int __init gpio_mockup_init(void)
344 err = platform_driver_register(&gpio_mockup_driver);
345 if (err) {
346 gpio_mockup_err("error registering platform driver\n");
347 + debugfs_remove_recursive(gpio_mockup_dbg_dir);
348 return err;
349 }
350
351 @@ -527,6 +528,7 @@ static int __init gpio_mockup_init(void)
352 gpio_mockup_err("error registering device");
353 platform_driver_unregister(&gpio_mockup_driver);
354 gpio_mockup_unregister_pdevs();
355 + debugfs_remove_recursive(gpio_mockup_dbg_dir);
356 return PTR_ERR(pdev);
357 }
358
359 diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c
360 index 006a7e6a75f21..7e70d2d06c3fe 100644
361 --- a/drivers/gpio/gpio-siox.c
362 +++ b/drivers/gpio/gpio-siox.c
363 @@ -245,6 +245,7 @@ static int gpio_siox_probe(struct siox_device *sdevice)
364 girq->chip = &ddata->ichip;
365 girq->default_type = IRQ_TYPE_NONE;
366 girq->handler = handle_level_irq;
367 + girq->threaded = true;
368
369 ret = devm_gpiochip_add_data(dev, &ddata->gchip, NULL);
370 if (ret)
371 diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
372 index d7314d39ab65b..36ea8a3bd4510 100644
373 --- a/drivers/gpio/gpio-sprd.c
374 +++ b/drivers/gpio/gpio-sprd.c
375 @@ -149,17 +149,20 @@ static int sprd_gpio_irq_set_type(struct irq_data *data,
376 sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0);
377 sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 0);
378 sprd_gpio_update(chip, offset, SPRD_GPIO_IEV, 1);
379 + sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1);
380 irq_set_handler_locked(data, handle_edge_irq);
381 break;
382 case IRQ_TYPE_EDGE_FALLING:
383 sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0);
384 sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 0);
385 sprd_gpio_update(chip, offset, SPRD_GPIO_IEV, 0);
386 + sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1);
387 irq_set_handler_locked(data, handle_edge_irq);
388 break;
389 case IRQ_TYPE_EDGE_BOTH:
390 sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0);
391 sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 1);
392 + sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1);
393 irq_set_handler_locked(data, handle_edge_irq);
394 break;
395 case IRQ_TYPE_LEVEL_HIGH:
396 diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
397 index 75b1135b383a7..daf29044d0f19 100644
398 --- a/drivers/gpio/gpio-tc3589x.c
399 +++ b/drivers/gpio/gpio-tc3589x.c
400 @@ -209,7 +209,7 @@ static void tc3589x_gpio_irq_sync_unlock(struct irq_data *d)
401 continue;
402
403 tc3589x_gpio->oldregs[i][j] = new;
404 - tc3589x_reg_write(tc3589x, regmap[i] + j * 8, new);
405 + tc3589x_reg_write(tc3589x, regmap[i] + j, new);
406 }
407 }
408
409 diff --git a/drivers/gpio/sgpio-aspeed.c b/drivers/gpio/sgpio-aspeed.c
410 index 8319812593e31..3a5dfb8ded1fb 100644
411 --- a/drivers/gpio/sgpio-aspeed.c
412 +++ b/drivers/gpio/sgpio-aspeed.c
413 @@ -17,7 +17,17 @@
414 #include <linux/spinlock.h>
415 #include <linux/string.h>
416
417 -#define MAX_NR_SGPIO 80
418 +/*
419 + * MAX_NR_HW_GPIO represents the number of actual hardware-supported GPIOs (ie,
420 + * slots within the clocked serial GPIO data). Since each HW GPIO is both an
421 + * input and an output, we provide MAX_NR_HW_GPIO * 2 lines on our gpiochip
422 + * device.
423 + *
424 + * We use SGPIO_OUTPUT_OFFSET to define the split between the inputs and
425 + * outputs; the inputs start at line 0, the outputs start at OUTPUT_OFFSET.
426 + */
427 +#define MAX_NR_HW_SGPIO 80
428 +#define SGPIO_OUTPUT_OFFSET MAX_NR_HW_SGPIO
429
430 #define ASPEED_SGPIO_CTRL 0x54
431
432 @@ -30,8 +40,8 @@ struct aspeed_sgpio {
433 struct clk *pclk;
434 spinlock_t lock;
435 void __iomem *base;
436 - uint32_t dir_in[3];
437 int irq;
438 + int n_sgpio;
439 };
440
441 struct aspeed_sgpio_bank {
442 @@ -111,31 +121,69 @@ static void __iomem *bank_reg(struct aspeed_sgpio *gpio,
443 }
444 }
445
446 -#define GPIO_BANK(x) ((x) >> 5)
447 -#define GPIO_OFFSET(x) ((x) & 0x1f)
448 +#define GPIO_BANK(x) ((x % SGPIO_OUTPUT_OFFSET) >> 5)
449 +#define GPIO_OFFSET(x) ((x % SGPIO_OUTPUT_OFFSET) & 0x1f)
450 #define GPIO_BIT(x) BIT(GPIO_OFFSET(x))
451
452 static const struct aspeed_sgpio_bank *to_bank(unsigned int offset)
453 {
454 - unsigned int bank = GPIO_BANK(offset);
455 + unsigned int bank;
456 +
457 + bank = GPIO_BANK(offset);
458
459 WARN_ON(bank >= ARRAY_SIZE(aspeed_sgpio_banks));
460 return &aspeed_sgpio_banks[bank];
461 }
462
463 +static int aspeed_sgpio_init_valid_mask(struct gpio_chip *gc,
464 + unsigned long *valid_mask, unsigned int ngpios)
465 +{
466 + struct aspeed_sgpio *sgpio = gpiochip_get_data(gc);
467 + int n = sgpio->n_sgpio;
468 + int c = SGPIO_OUTPUT_OFFSET - n;
469 +
470 + WARN_ON(ngpios < MAX_NR_HW_SGPIO * 2);
471 +
472 + /* input GPIOs in the lower range */
473 + bitmap_set(valid_mask, 0, n);
474 + bitmap_clear(valid_mask, n, c);
475 +
476 + /* output GPIOS above SGPIO_OUTPUT_OFFSET */
477 + bitmap_set(valid_mask, SGPIO_OUTPUT_OFFSET, n);
478 + bitmap_clear(valid_mask, SGPIO_OUTPUT_OFFSET + n, c);
479 +
480 + return 0;
481 +}
482 +
483 +static void aspeed_sgpio_irq_init_valid_mask(struct gpio_chip *gc,
484 + unsigned long *valid_mask, unsigned int ngpios)
485 +{
486 + struct aspeed_sgpio *sgpio = gpiochip_get_data(gc);
487 + int n = sgpio->n_sgpio;
488 +
489 + WARN_ON(ngpios < MAX_NR_HW_SGPIO * 2);
490 +
491 + /* input GPIOs in the lower range */
492 + bitmap_set(valid_mask, 0, n);
493 + bitmap_clear(valid_mask, n, ngpios - n);
494 +}
495 +
496 +static bool aspeed_sgpio_is_input(unsigned int offset)
497 +{
498 + return offset < SGPIO_OUTPUT_OFFSET;
499 +}
500 +
501 static int aspeed_sgpio_get(struct gpio_chip *gc, unsigned int offset)
502 {
503 struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
504 const struct aspeed_sgpio_bank *bank = to_bank(offset);
505 unsigned long flags;
506 enum aspeed_sgpio_reg reg;
507 - bool is_input;
508 int rc = 0;
509
510 spin_lock_irqsave(&gpio->lock, flags);
511
512 - is_input = gpio->dir_in[GPIO_BANK(offset)] & GPIO_BIT(offset);
513 - reg = is_input ? reg_val : reg_rdata;
514 + reg = aspeed_sgpio_is_input(offset) ? reg_val : reg_rdata;
515 rc = !!(ioread32(bank_reg(gpio, bank, reg)) & GPIO_BIT(offset));
516
517 spin_unlock_irqrestore(&gpio->lock, flags);
518 @@ -143,22 +191,31 @@ static int aspeed_sgpio_get(struct gpio_chip *gc, unsigned int offset)
519 return rc;
520 }
521
522 -static void sgpio_set_value(struct gpio_chip *gc, unsigned int offset, int val)
523 +static int sgpio_set_value(struct gpio_chip *gc, unsigned int offset, int val)
524 {
525 struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
526 const struct aspeed_sgpio_bank *bank = to_bank(offset);
527 - void __iomem *addr;
528 + void __iomem *addr_r, *addr_w;
529 u32 reg = 0;
530
531 - addr = bank_reg(gpio, bank, reg_val);
532 - reg = ioread32(addr);
533 + if (aspeed_sgpio_is_input(offset))
534 + return -EINVAL;
535 +
536 + /* Since this is an output, read the cached value from rdata, then
537 + * update val. */
538 + addr_r = bank_reg(gpio, bank, reg_rdata);
539 + addr_w = bank_reg(gpio, bank, reg_val);
540 +
541 + reg = ioread32(addr_r);
542
543 if (val)
544 reg |= GPIO_BIT(offset);
545 else
546 reg &= ~GPIO_BIT(offset);
547
548 - iowrite32(reg, addr);
549 + iowrite32(reg, addr_w);
550 +
551 + return 0;
552 }
553
554 static void aspeed_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
555 @@ -175,43 +232,28 @@ static void aspeed_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
556
557 static int aspeed_sgpio_dir_in(struct gpio_chip *gc, unsigned int offset)
558 {
559 - struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
560 - unsigned long flags;
561 -
562 - spin_lock_irqsave(&gpio->lock, flags);
563 - gpio->dir_in[GPIO_BANK(offset)] |= GPIO_BIT(offset);
564 - spin_unlock_irqrestore(&gpio->lock, flags);
565 -
566 - return 0;
567 + return aspeed_sgpio_is_input(offset) ? 0 : -EINVAL;
568 }
569
570 static int aspeed_sgpio_dir_out(struct gpio_chip *gc, unsigned int offset, int val)
571 {
572 struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
573 unsigned long flags;
574 + int rc;
575
576 - spin_lock_irqsave(&gpio->lock, flags);
577 -
578 - gpio->dir_in[GPIO_BANK(offset)] &= ~GPIO_BIT(offset);
579 - sgpio_set_value(gc, offset, val);
580 + /* No special action is required for setting the direction; we'll
581 + * error-out in sgpio_set_value if this isn't an output GPIO */
582
583 + spin_lock_irqsave(&gpio->lock, flags);
584 + rc = sgpio_set_value(gc, offset, val);
585 spin_unlock_irqrestore(&gpio->lock, flags);
586
587 - return 0;
588 + return rc;
589 }
590
591 static int aspeed_sgpio_get_direction(struct gpio_chip *gc, unsigned int offset)
592 {
593 - int dir_status;
594 - struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
595 - unsigned long flags;
596 -
597 - spin_lock_irqsave(&gpio->lock, flags);
598 - dir_status = gpio->dir_in[GPIO_BANK(offset)] & GPIO_BIT(offset);
599 - spin_unlock_irqrestore(&gpio->lock, flags);
600 -
601 - return dir_status;
602 -
603 + return !!aspeed_sgpio_is_input(offset);
604 }
605
606 static void irqd_to_aspeed_sgpio_data(struct irq_data *d,
607 @@ -402,6 +444,7 @@ static int aspeed_sgpio_setup_irqs(struct aspeed_sgpio *gpio,
608
609 irq = &gpio->chip.irq;
610 irq->chip = &aspeed_sgpio_irqchip;
611 + irq->init_valid_mask = aspeed_sgpio_irq_init_valid_mask;
612 irq->handler = handle_bad_irq;
613 irq->default_type = IRQ_TYPE_NONE;
614 irq->parent_handler = aspeed_sgpio_irq_handler;
615 @@ -409,17 +452,15 @@ static int aspeed_sgpio_setup_irqs(struct aspeed_sgpio *gpio,
616 irq->parents = &gpio->irq;
617 irq->num_parents = 1;
618
619 - /* set IRQ settings and Enable Interrupt */
620 + /* Apply default IRQ settings */
621 for (i = 0; i < ARRAY_SIZE(aspeed_sgpio_banks); i++) {
622 bank = &aspeed_sgpio_banks[i];
623 /* set falling or level-low irq */
624 iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type0));
625 /* trigger type is edge */
626 iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type1));
627 - /* dual edge trigger mode. */
628 - iowrite32(0xffffffff, bank_reg(gpio, bank, reg_irq_type2));
629 - /* enable irq */
630 - iowrite32(0xffffffff, bank_reg(gpio, bank, reg_irq_enable));
631 + /* single edge trigger */
632 + iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type2));
633 }
634
635 return 0;
636 @@ -452,11 +493,12 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
637 if (rc < 0) {
638 dev_err(&pdev->dev, "Could not read ngpios property\n");
639 return -EINVAL;
640 - } else if (nr_gpios > MAX_NR_SGPIO) {
641 + } else if (nr_gpios > MAX_NR_HW_SGPIO) {
642 dev_err(&pdev->dev, "Number of GPIOs exceeds the maximum of %d: %d\n",
643 - MAX_NR_SGPIO, nr_gpios);
644 + MAX_NR_HW_SGPIO, nr_gpios);
645 return -EINVAL;
646 }
647 + gpio->n_sgpio = nr_gpios;
648
649 rc = of_property_read_u32(pdev->dev.of_node, "bus-frequency", &sgpio_freq);
650 if (rc < 0) {
651 @@ -497,7 +539,8 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
652 spin_lock_init(&gpio->lock);
653
654 gpio->chip.parent = &pdev->dev;
655 - gpio->chip.ngpio = nr_gpios;
656 + gpio->chip.ngpio = MAX_NR_HW_SGPIO * 2;
657 + gpio->chip.init_valid_mask = aspeed_sgpio_init_valid_mask;
658 gpio->chip.direction_input = aspeed_sgpio_dir_in;
659 gpio->chip.direction_output = aspeed_sgpio_dir_out;
660 gpio->chip.get_direction = aspeed_sgpio_get_direction;
661 @@ -509,9 +552,6 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
662 gpio->chip.label = dev_name(&pdev->dev);
663 gpio->chip.base = -1;
664
665 - /* set all SGPIO pins as input (1). */
666 - memset(gpio->dir_in, 0xff, sizeof(gpio->dir_in));
667 -
668 aspeed_sgpio_setup_irqs(gpio, pdev);
669
670 rc = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
671 diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
672 index e0aed42d9cbda..b588e0e409e72 100644
673 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
674 +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
675 @@ -297,7 +297,7 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
676 take the current one */
677 if (active && !adev->have_disp_power_ref) {
678 adev->have_disp_power_ref = true;
679 - goto out;
680 + return ret;
681 }
682 /* if we have no active crtcs, then drop the power ref
683 we got before */
684 diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
685 index 18b4881f44814..12b99ba575017 100644
686 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
687 +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
688 @@ -396,7 +396,7 @@ static struct regmap_config sun8i_mixer_regmap_config = {
689 .reg_bits = 32,
690 .val_bits = 32,
691 .reg_stride = 4,
692 - .max_register = 0xbfffc, /* guessed */
693 + .max_register = 0xffffc, /* guessed */
694 };
695
696 static int sun8i_mixer_of_get_id(struct device_node *node)
697 diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
698 index 1213e1932ccb5..24d584a1c9a78 100644
699 --- a/drivers/i2c/busses/i2c-cpm.c
700 +++ b/drivers/i2c/busses/i2c-cpm.c
701 @@ -65,6 +65,9 @@ struct i2c_ram {
702 char res1[4]; /* Reserved */
703 ushort rpbase; /* Relocation pointer */
704 char res2[2]; /* Reserved */
705 + /* The following elements are only for CPM2 */
706 + char res3[4]; /* Reserved */
707 + uint sdmatmp; /* Internal */
708 };
709
710 #define I2COM_START 0x80
711 diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
712 index 21fdcde77883f..56e7696aa3c0f 100644
713 --- a/drivers/iio/adc/qcom-spmi-adc5.c
714 +++ b/drivers/iio/adc/qcom-spmi-adc5.c
715 @@ -786,7 +786,7 @@ static int adc5_probe(struct platform_device *pdev)
716
717 static struct platform_driver adc5_driver = {
718 .driver = {
719 - .name = "qcom-spmi-adc5.c",
720 + .name = "qcom-spmi-adc5",
721 .of_match_table = adc5_match_table,
722 },
723 .probe = adc5_probe,
724 diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
725 index 854d5e7587241..ef2fa0905208d 100644
726 --- a/drivers/input/mouse/trackpoint.c
727 +++ b/drivers/input/mouse/trackpoint.c
728 @@ -282,6 +282,8 @@ static int trackpoint_start_protocol(struct psmouse *psmouse,
729 case TP_VARIANT_ALPS:
730 case TP_VARIANT_ELAN:
731 case TP_VARIANT_NXP:
732 + case TP_VARIANT_JYT_SYNAPTICS:
733 + case TP_VARIANT_SYNAPTICS:
734 if (variant_id)
735 *variant_id = param[0];
736 if (firmware_id)
737 diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
738 index 42771b9b10a00..98f0c7729b754 100644
739 --- a/drivers/input/serio/i8042-x86ia64io.h
740 +++ b/drivers/input/serio/i8042-x86ia64io.h
741 @@ -721,6 +721,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
742 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
743 },
744 },
745 + {
746 + /* Acer Aspire 5 A515 */
747 + .matches = {
748 + DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
749 + DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
750 + },
751 + },
752 { }
753 };
754
755 diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
756 index 9c94e16fb1277..55ed857f804f7 100644
757 --- a/drivers/iommu/exynos-iommu.c
758 +++ b/drivers/iommu/exynos-iommu.c
759 @@ -1299,13 +1299,17 @@ static int exynos_iommu_of_xlate(struct device *dev,
760 return -ENODEV;
761
762 data = platform_get_drvdata(sysmmu);
763 - if (!data)
764 + if (!data) {
765 + put_device(&sysmmu->dev);
766 return -ENODEV;
767 + }
768
769 if (!owner) {
770 owner = kzalloc(sizeof(*owner), GFP_KERNEL);
771 - if (!owner)
772 + if (!owner) {
773 + put_device(&sysmmu->dev);
774 return -ENOMEM;
775 + }
776
777 INIT_LIST_HEAD(&owner->controllers);
778 mutex_init(&owner->rpm_lock);
779 diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
780 index 693ee73eb2912..ef03d6fafc5ce 100644
781 --- a/drivers/memstick/core/memstick.c
782 +++ b/drivers/memstick/core/memstick.c
783 @@ -441,6 +441,9 @@ static void memstick_check(struct work_struct *work)
784 } else if (host->card->stop)
785 host->card->stop(host->card);
786
787 + if (host->removing)
788 + goto out_power_off;
789 +
790 card = memstick_alloc_card(host);
791
792 if (!card) {
793 @@ -545,6 +548,7 @@ EXPORT_SYMBOL(memstick_add_host);
794 */
795 void memstick_remove_host(struct memstick_host *host)
796 {
797 + host->removing = 1;
798 flush_workqueue(workqueue);
799 mutex_lock(&host->lock);
800 if (host->card)
801 diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
802 index 425aa898e797a..91d0cb08238cf 100644
803 --- a/drivers/mmc/host/sdhci-pci-core.c
804 +++ b/drivers/mmc/host/sdhci-pci-core.c
805 @@ -798,7 +798,8 @@ static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
806 static bool glk_broken_cqhci(struct sdhci_pci_slot *slot)
807 {
808 return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_EMMC &&
809 - dmi_match(DMI_BIOS_VENDOR, "LENOVO");
810 + (dmi_match(DMI_BIOS_VENDOR, "LENOVO") ||
811 + dmi_match(DMI_SYS_VENDOR, "IRBIS"));
812 }
813
814 static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot)
815 diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
816 index f1a2da15dd0a6..b14d93da242f1 100644
817 --- a/drivers/net/ethernet/dec/tulip/de2104x.c
818 +++ b/drivers/net/ethernet/dec/tulip/de2104x.c
819 @@ -91,7 +91,7 @@ MODULE_PARM_DESC (rx_copybreak, "de2104x Breakpoint at which Rx packets are copi
820 #define DSL CONFIG_DE2104X_DSL
821 #endif
822
823 -#define DE_RX_RING_SIZE 64
824 +#define DE_RX_RING_SIZE 128
825 #define DE_TX_RING_SIZE 64
826 #define DE_RING_BYTES \
827 ((sizeof(struct de_desc) * DE_RX_RING_SIZE) + \
828 diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
829 index bd9c07888ebb4..6fa7a009a24a4 100644
830 --- a/drivers/net/usb/rndis_host.c
831 +++ b/drivers/net/usb/rndis_host.c
832 @@ -201,7 +201,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
833 dev_dbg(&info->control->dev,
834 "rndis response error, code %d\n", retval);
835 }
836 - msleep(20);
837 + msleep(40);
838 }
839 dev_dbg(&info->control->dev, "rndis response timeout\n");
840 return -ETIMEDOUT;
841 diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
842 index cc33441af4691..50804d0473083 100644
843 --- a/drivers/net/wan/hdlc_cisco.c
844 +++ b/drivers/net/wan/hdlc_cisco.c
845 @@ -118,6 +118,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type,
846 skb_put(skb, sizeof(struct cisco_packet));
847 skb->priority = TC_PRIO_CONTROL;
848 skb->dev = dev;
849 + skb->protocol = htons(ETH_P_HDLC);
850 skb_reset_network_header(skb);
851
852 dev_queue_xmit(skb);
853 diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
854 index 9acad651ea1f6..d6cfd51613ed8 100644
855 --- a/drivers/net/wan/hdlc_fr.c
856 +++ b/drivers/net/wan/hdlc_fr.c
857 @@ -433,6 +433,8 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev)
858 if (pvc->state.fecn) /* TX Congestion counter */
859 dev->stats.tx_compressed++;
860 skb->dev = pvc->frad;
861 + skb->protocol = htons(ETH_P_HDLC);
862 + skb_reset_network_header(skb);
863 dev_queue_xmit(skb);
864 return NETDEV_TX_OK;
865 }
866 @@ -555,6 +557,7 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
867 skb_put(skb, i);
868 skb->priority = TC_PRIO_CONTROL;
869 skb->dev = dev;
870 + skb->protocol = htons(ETH_P_HDLC);
871 skb_reset_network_header(skb);
872
873 dev_queue_xmit(skb);
874 @@ -1041,7 +1044,7 @@ static void pvc_setup(struct net_device *dev)
875 {
876 dev->type = ARPHRD_DLCI;
877 dev->flags = IFF_POINTOPOINT;
878 - dev->hard_header_len = 10;
879 + dev->hard_header_len = 0;
880 dev->addr_len = 2;
881 netif_keep_dst(dev);
882 }
883 @@ -1093,6 +1096,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
884 dev->mtu = HDLC_MAX_MTU;
885 dev->min_mtu = 68;
886 dev->max_mtu = HDLC_MAX_MTU;
887 + dev->needed_headroom = 10;
888 dev->priv_flags |= IFF_NO_QUEUE;
889 dev->ml_priv = pvc;
890
891 diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
892 index 16f33d1ffbfb9..64f8556513369 100644
893 --- a/drivers/net/wan/hdlc_ppp.c
894 +++ b/drivers/net/wan/hdlc_ppp.c
895 @@ -251,6 +251,7 @@ static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code,
896
897 skb->priority = TC_PRIO_CONTROL;
898 skb->dev = dev;
899 + skb->protocol = htons(ETH_P_HDLC);
900 skb_reset_network_header(skb);
901 skb_queue_tail(&tx_queue, skb);
902 }
903 diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
904 index 2cff914aada55..709e3de0f6af1 100644
905 --- a/drivers/net/wan/lapbether.c
906 +++ b/drivers/net/wan/lapbether.c
907 @@ -198,8 +198,6 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb)
908 struct net_device *dev;
909 int size = skb->len;
910
911 - skb->protocol = htons(ETH_P_X25);
912 -
913 ptr = skb_push(skb, 2);
914
915 *ptr++ = size % 256;
916 @@ -210,6 +208,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb)
917
918 skb->dev = dev = lapbeth->ethdev;
919
920 + skb->protocol = htons(ETH_P_DEC);
921 +
922 skb_reset_network_header(skb);
923
924 dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0);
925 diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
926 index 2cd32901d95c7..207ed6d49ad7c 100644
927 --- a/drivers/nvme/host/core.c
928 +++ b/drivers/nvme/host/core.c
929 @@ -630,7 +630,7 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req,
930 }
931
932 __rq_for_each_bio(bio, req) {
933 - u64 slba = nvme_block_nr(ns, bio->bi_iter.bi_sector);
934 + u64 slba = nvme_sect_to_lba(ns, bio->bi_iter.bi_sector);
935 u32 nlb = bio->bi_iter.bi_size >> ns->lba_shift;
936
937 if (n < segments) {
938 @@ -671,7 +671,7 @@ static inline blk_status_t nvme_setup_write_zeroes(struct nvme_ns *ns,
939 cmnd->write_zeroes.opcode = nvme_cmd_write_zeroes;
940 cmnd->write_zeroes.nsid = cpu_to_le32(ns->head->ns_id);
941 cmnd->write_zeroes.slba =
942 - cpu_to_le64(nvme_block_nr(ns, blk_rq_pos(req)));
943 + cpu_to_le64(nvme_sect_to_lba(ns, blk_rq_pos(req)));
944 cmnd->write_zeroes.length =
945 cpu_to_le16((blk_rq_bytes(req) >> ns->lba_shift) - 1);
946 cmnd->write_zeroes.control = 0;
947 @@ -695,7 +695,7 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
948
949 cmnd->rw.opcode = (rq_data_dir(req) ? nvme_cmd_write : nvme_cmd_read);
950 cmnd->rw.nsid = cpu_to_le32(ns->head->ns_id);
951 - cmnd->rw.slba = cpu_to_le64(nvme_block_nr(ns, blk_rq_pos(req)));
952 + cmnd->rw.slba = cpu_to_le64(nvme_sect_to_lba(ns, blk_rq_pos(req)));
953 cmnd->rw.length = cpu_to_le16((blk_rq_bytes(req) >> ns->lba_shift) - 1);
954
955 if (req_op(req) == REQ_OP_WRITE && ctrl->nr_streams)
956 @@ -1680,12 +1680,6 @@ static void nvme_init_integrity(struct gendisk *disk, u16 ms, u8 pi_type)
957 }
958 #endif /* CONFIG_BLK_DEV_INTEGRITY */
959
960 -static void nvme_set_chunk_size(struct nvme_ns *ns)
961 -{
962 - u32 chunk_size = (((u32)ns->noiob) << (ns->lba_shift - 9));
963 - blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(chunk_size));
964 -}
965 -
966 static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
967 {
968 struct nvme_ctrl *ctrl = ns->ctrl;
969 @@ -1719,8 +1713,7 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
970
971 static void nvme_config_write_zeroes(struct gendisk *disk, struct nvme_ns *ns)
972 {
973 - u32 max_sectors;
974 - unsigned short bs = 1 << ns->lba_shift;
975 + u64 max_blocks;
976
977 if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) ||
978 (ns->ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
979 @@ -1736,11 +1729,12 @@ static void nvme_config_write_zeroes(struct gendisk *disk, struct nvme_ns *ns)
980 * nvme_init_identify() if available.
981 */
982 if (ns->ctrl->max_hw_sectors == UINT_MAX)
983 - max_sectors = ((u32)(USHRT_MAX + 1) * bs) >> 9;
984 + max_blocks = (u64)USHRT_MAX + 1;
985 else
986 - max_sectors = ((u32)(ns->ctrl->max_hw_sectors + 1) * bs) >> 9;
987 + max_blocks = ns->ctrl->max_hw_sectors + 1;
988
989 - blk_queue_max_write_zeroes_sectors(disk->queue, max_sectors);
990 + blk_queue_max_write_zeroes_sectors(disk->queue,
991 + nvme_lba_to_sect(ns, max_blocks));
992 }
993
994 static int nvme_report_ns_ids(struct nvme_ctrl *ctrl, unsigned int nsid,
995 @@ -1774,7 +1768,7 @@ static bool nvme_ns_ids_equal(struct nvme_ns_ids *a, struct nvme_ns_ids *b)
996 static void nvme_update_disk_info(struct gendisk *disk,
997 struct nvme_ns *ns, struct nvme_id_ns *id)
998 {
999 - sector_t capacity = le64_to_cpu(id->nsze) << (ns->lba_shift - 9);
1000 + sector_t capacity = nvme_lba_to_sect(ns, le64_to_cpu(id->nsze));
1001 unsigned short bs = 1 << ns->lba_shift;
1002 u32 atomic_bs, phys_bs, io_opt;
1003
1004 @@ -1840,6 +1834,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
1005 static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
1006 {
1007 struct nvme_ns *ns = disk->private_data;
1008 + u32 iob;
1009
1010 /*
1011 * If identify namespace failed, use default 512 byte block size so
1012 @@ -1848,7 +1843,13 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
1013 ns->lba_shift = id->lbaf[id->flbas & NVME_NS_FLBAS_LBA_MASK].ds;
1014 if (ns->lba_shift == 0)
1015 ns->lba_shift = 9;
1016 - ns->noiob = le16_to_cpu(id->noiob);
1017 +
1018 + if ((ns->ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) &&
1019 + is_power_of_2(ns->ctrl->max_hw_sectors))
1020 + iob = ns->ctrl->max_hw_sectors;
1021 + else
1022 + iob = nvme_lba_to_sect(ns, le16_to_cpu(id->noiob));
1023 +
1024 ns->ms = le16_to_cpu(id->lbaf[id->flbas & NVME_NS_FLBAS_LBA_MASK].ms);
1025 ns->ext = ns->ms && (id->flbas & NVME_NS_FLBAS_META_EXT);
1026 /* the PI implementation requires metadata equal t10 pi tuple size */
1027 @@ -1857,8 +1858,8 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
1028 else
1029 ns->pi_type = 0;
1030
1031 - if (ns->noiob)
1032 - nvme_set_chunk_size(ns);
1033 + if (iob)
1034 + blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(iob));
1035 nvme_update_disk_info(disk, ns, id);
1036 #ifdef CONFIG_NVME_MULTIPATH
1037 if (ns->head->disk) {
1038 @@ -2209,9 +2210,6 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
1039 blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors);
1040 blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX));
1041 }
1042 - if ((ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) &&
1043 - is_power_of_2(ctrl->max_hw_sectors))
1044 - blk_queue_chunk_sectors(q, ctrl->max_hw_sectors);
1045 blk_queue_virt_boundary(q, ctrl->page_size - 1);
1046 if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
1047 vwc = true;
1048 @@ -2933,10 +2931,24 @@ static int nvme_dev_open(struct inode *inode, struct file *file)
1049 return -EWOULDBLOCK;
1050 }
1051
1052 + nvme_get_ctrl(ctrl);
1053 + if (!try_module_get(ctrl->ops->module))
1054 + return -EINVAL;
1055 +
1056 file->private_data = ctrl;
1057 return 0;
1058 }
1059
1060 +static int nvme_dev_release(struct inode *inode, struct file *file)
1061 +{
1062 + struct nvme_ctrl *ctrl =
1063 + container_of(inode->i_cdev, struct nvme_ctrl, cdev);
1064 +
1065 + module_put(ctrl->ops->module);
1066 + nvme_put_ctrl(ctrl);
1067 + return 0;
1068 +}
1069 +
1070 static int nvme_dev_user_cmd(struct nvme_ctrl *ctrl, void __user *argp)
1071 {
1072 struct nvme_ns *ns;
1073 @@ -2999,6 +3011,7 @@ static long nvme_dev_ioctl(struct file *file, unsigned int cmd,
1074 static const struct file_operations nvme_dev_fops = {
1075 .owner = THIS_MODULE,
1076 .open = nvme_dev_open,
1077 + .release = nvme_dev_release,
1078 .unlocked_ioctl = nvme_dev_ioctl,
1079 .compat_ioctl = nvme_dev_ioctl,
1080 };
1081 diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
1082 index da801a14cd13d..65b3dc9cd693b 100644
1083 --- a/drivers/nvme/host/fc.c
1084 +++ b/drivers/nvme/host/fc.c
1085 @@ -3319,12 +3319,14 @@ nvme_fc_create_ctrl(struct device *dev, struct nvmf_ctrl_options *opts)
1086 spin_lock_irqsave(&nvme_fc_lock, flags);
1087 list_for_each_entry(lport, &nvme_fc_lport_list, port_list) {
1088 if (lport->localport.node_name != laddr.nn ||
1089 - lport->localport.port_name != laddr.pn)
1090 + lport->localport.port_name != laddr.pn ||
1091 + lport->localport.port_state != FC_OBJSTATE_ONLINE)
1092 continue;
1093
1094 list_for_each_entry(rport, &lport->endp_list, endp_list) {
1095 if (rport->remoteport.node_name != raddr.nn ||
1096 - rport->remoteport.port_name != raddr.pn)
1097 + rport->remoteport.port_name != raddr.pn ||
1098 + rport->remoteport.port_state != FC_OBJSTATE_ONLINE)
1099 continue;
1100
1101 /* if fail to get reference fall through. Will error */
1102 diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
1103 index b7117fb09dd0f..d7132d8cb7c5d 100644
1104 --- a/drivers/nvme/host/nvme.h
1105 +++ b/drivers/nvme/host/nvme.h
1106 @@ -384,7 +384,6 @@ struct nvme_ns {
1107 #define NVME_NS_REMOVING 0
1108 #define NVME_NS_DEAD 1
1109 #define NVME_NS_ANA_PENDING 2
1110 - u16 noiob;
1111
1112 struct nvme_fault_inject fault_inject;
1113
1114 @@ -429,9 +428,20 @@ static inline int nvme_reset_subsystem(struct nvme_ctrl *ctrl)
1115 return ctrl->ops->reg_write32(ctrl, NVME_REG_NSSR, 0x4E564D65);
1116 }
1117
1118 -static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
1119 +/*
1120 + * Convert a 512B sector number to a device logical block number.
1121 + */
1122 +static inline u64 nvme_sect_to_lba(struct nvme_ns *ns, sector_t sector)
1123 +{
1124 + return sector >> (ns->lba_shift - SECTOR_SHIFT);
1125 +}
1126 +
1127 +/*
1128 + * Convert a device logical block number to a 512B sector number.
1129 + */
1130 +static inline sector_t nvme_lba_to_sect(struct nvme_ns *ns, u64 lba)
1131 {
1132 - return (sector >> (ns->lba_shift - 9));
1133 + return lba << (ns->lba_shift - SECTOR_SHIFT);
1134 }
1135
1136 static inline void nvme_end_request(struct request *req, __le16 status,
1137 diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
1138 index 75f26d2ec6429..af0b51d1d43e8 100644
1139 --- a/drivers/nvme/host/pci.c
1140 +++ b/drivers/nvme/host/pci.c
1141 @@ -941,13 +941,6 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, u16 idx)
1142 volatile struct nvme_completion *cqe = &nvmeq->cqes[idx];
1143 struct request *req;
1144
1145 - if (unlikely(cqe->command_id >= nvmeq->q_depth)) {
1146 - dev_warn(nvmeq->dev->ctrl.device,
1147 - "invalid id %d completed on queue %d\n",
1148 - cqe->command_id, le16_to_cpu(cqe->sq_id));
1149 - return;
1150 - }
1151 -
1152 /*
1153 * AEN requests are special as they don't time out and can
1154 * survive any kind of queue freeze and often don't respond to
1155 @@ -962,6 +955,13 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, u16 idx)
1156 }
1157
1158 req = blk_mq_tag_to_rq(nvme_queue_tagset(nvmeq), cqe->command_id);
1159 + if (unlikely(!req)) {
1160 + dev_warn(nvmeq->dev->ctrl.device,
1161 + "invalid id %d completed on queue %d\n",
1162 + cqe->command_id, le16_to_cpu(cqe->sq_id));
1163 + return;
1164 + }
1165 +
1166 trace_nvme_sq(req, cqe->sq_head, nvmeq->sq_tail);
1167 nvme_end_request(req, cqe->status, cqe->result);
1168 }
1169 diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c
1170 index 88a047b9fa6fa..6ef12017ff4e8 100644
1171 --- a/drivers/phy/ti/phy-am654-serdes.c
1172 +++ b/drivers/phy/ti/phy-am654-serdes.c
1173 @@ -625,8 +625,10 @@ static int serdes_am654_probe(struct platform_device *pdev)
1174 pm_runtime_enable(dev);
1175
1176 phy = devm_phy_create(dev, NULL, &ops);
1177 - if (IS_ERR(phy))
1178 - return PTR_ERR(phy);
1179 + if (IS_ERR(phy)) {
1180 + ret = PTR_ERR(phy);
1181 + goto clk_err;
1182 + }
1183
1184 phy_set_drvdata(phy, am654_phy);
1185 phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);
1186 diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
1187 index a767a05fa3a0d..48e2a6c56a83b 100644
1188 --- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
1189 +++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
1190 @@ -414,7 +414,7 @@ static struct mvebu_mpp_mode mv98dx3236_mpp_modes[] = {
1191 MPP_VAR_FUNCTION(0x1, "i2c0", "sck", V_98DX3236_PLUS)),
1192 MPP_MODE(15,
1193 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
1194 - MPP_VAR_FUNCTION(0x4, "i2c0", "sda", V_98DX3236_PLUS)),
1195 + MPP_VAR_FUNCTION(0x1, "i2c0", "sda", V_98DX3236_PLUS)),
1196 MPP_MODE(16,
1197 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
1198 MPP_VAR_FUNCTION(0x4, "dev", "oe", V_98DX3236_PLUS)),
1199 diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
1200 index f20326714b9d5..215bf6624e7c3 100644
1201 --- a/drivers/spi/spi-fsl-espi.c
1202 +++ b/drivers/spi/spi-fsl-espi.c
1203 @@ -555,13 +555,14 @@ static void fsl_espi_cpu_irq(struct fsl_espi *espi, u32 events)
1204 static irqreturn_t fsl_espi_irq(s32 irq, void *context_data)
1205 {
1206 struct fsl_espi *espi = context_data;
1207 - u32 events;
1208 + u32 events, mask;
1209
1210 spin_lock(&espi->lock);
1211
1212 /* Get interrupt events(tx/rx) */
1213 events = fsl_espi_read_reg(espi, ESPI_SPIE);
1214 - if (!events) {
1215 + mask = fsl_espi_read_reg(espi, ESPI_SPIM);
1216 + if (!(events & mask)) {
1217 spin_unlock(&espi->lock);
1218 return IRQ_NONE;
1219 }
1220 diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
1221 index b4206b0dede54..1f638759a9533 100644
1222 --- a/drivers/usb/gadget/function/f_ncm.c
1223 +++ b/drivers/usb/gadget/function/f_ncm.c
1224 @@ -1189,7 +1189,6 @@ static int ncm_unwrap_ntb(struct gether *port,
1225 const struct ndp_parser_opts *opts = ncm->parser_opts;
1226 unsigned crc_len = ncm->is_crc ? sizeof(uint32_t) : 0;
1227 int dgram_counter;
1228 - bool ndp_after_header;
1229
1230 /* dwSignature */
1231 if (get_unaligned_le32(tmp) != opts->nth_sign) {
1232 @@ -1216,7 +1215,6 @@ static int ncm_unwrap_ntb(struct gether *port,
1233 }
1234
1235 ndp_index = get_ncm(&tmp, opts->ndp_index);
1236 - ndp_after_header = false;
1237
1238 /* Run through all the NDP's in the NTB */
1239 do {
1240 @@ -1232,8 +1230,6 @@ static int ncm_unwrap_ntb(struct gether *port,
1241 ndp_index);
1242 goto err;
1243 }
1244 - if (ndp_index == opts->nth_size)
1245 - ndp_after_header = true;
1246
1247 /*
1248 * walk through NDP
1249 @@ -1312,37 +1308,13 @@ static int ncm_unwrap_ntb(struct gether *port,
1250 index2 = get_ncm(&tmp, opts->dgram_item_len);
1251 dg_len2 = get_ncm(&tmp, opts->dgram_item_len);
1252
1253 - if (index2 == 0 || dg_len2 == 0)
1254 - break;
1255 -
1256 /* wDatagramIndex[1] */
1257 - if (ndp_after_header) {
1258 - if (index2 < opts->nth_size + opts->ndp_size) {
1259 - INFO(port->func.config->cdev,
1260 - "Bad index: %#X\n", index2);
1261 - goto err;
1262 - }
1263 - } else {
1264 - if (index2 < opts->nth_size + opts->dpe_size) {
1265 - INFO(port->func.config->cdev,
1266 - "Bad index: %#X\n", index2);
1267 - goto err;
1268 - }
1269 - }
1270 if (index2 > block_len - opts->dpe_size) {
1271 INFO(port->func.config->cdev,
1272 "Bad index: %#X\n", index2);
1273 goto err;
1274 }
1275
1276 - /* wDatagramLength[1] */
1277 - if ((dg_len2 < 14 + crc_len) ||
1278 - (dg_len2 > frame_max)) {
1279 - INFO(port->func.config->cdev,
1280 - "Bad dgram length: %#X\n", dg_len);
1281 - goto err;
1282 - }
1283 -
1284 /*
1285 * Copy the data into a new skb.
1286 * This ensures the truesize is correct
1287 @@ -1359,6 +1331,8 @@ static int ncm_unwrap_ntb(struct gether *port,
1288 ndp_len -= 2 * (opts->dgram_item_len * 2);
1289
1290 dgram_counter++;
1291 + if (index2 == 0 || dg_len2 == 0)
1292 + break;
1293 } while (ndp_len > 2 * (opts->dgram_item_len * 2));
1294 } while (ndp_index);
1295
1296 diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
1297 index ca68a27b98edd..f21f5bfbb78dc 100644
1298 --- a/drivers/vhost/vsock.c
1299 +++ b/drivers/vhost/vsock.c
1300 @@ -384,6 +384,52 @@ static bool vhost_vsock_more_replies(struct vhost_vsock *vsock)
1301 return val < vq->num;
1302 }
1303
1304 +static struct virtio_transport vhost_transport = {
1305 + .transport = {
1306 + .get_local_cid = vhost_transport_get_local_cid,
1307 +
1308 + .init = virtio_transport_do_socket_init,
1309 + .destruct = virtio_transport_destruct,
1310 + .release = virtio_transport_release,
1311 + .connect = virtio_transport_connect,
1312 + .shutdown = virtio_transport_shutdown,
1313 + .cancel_pkt = vhost_transport_cancel_pkt,
1314 +
1315 + .dgram_enqueue = virtio_transport_dgram_enqueue,
1316 + .dgram_dequeue = virtio_transport_dgram_dequeue,
1317 + .dgram_bind = virtio_transport_dgram_bind,
1318 + .dgram_allow = virtio_transport_dgram_allow,
1319 +
1320 + .stream_enqueue = virtio_transport_stream_enqueue,
1321 + .stream_dequeue = virtio_transport_stream_dequeue,
1322 + .stream_has_data = virtio_transport_stream_has_data,
1323 + .stream_has_space = virtio_transport_stream_has_space,
1324 + .stream_rcvhiwat = virtio_transport_stream_rcvhiwat,
1325 + .stream_is_active = virtio_transport_stream_is_active,
1326 + .stream_allow = virtio_transport_stream_allow,
1327 +
1328 + .notify_poll_in = virtio_transport_notify_poll_in,
1329 + .notify_poll_out = virtio_transport_notify_poll_out,
1330 + .notify_recv_init = virtio_transport_notify_recv_init,
1331 + .notify_recv_pre_block = virtio_transport_notify_recv_pre_block,
1332 + .notify_recv_pre_dequeue = virtio_transport_notify_recv_pre_dequeue,
1333 + .notify_recv_post_dequeue = virtio_transport_notify_recv_post_dequeue,
1334 + .notify_send_init = virtio_transport_notify_send_init,
1335 + .notify_send_pre_block = virtio_transport_notify_send_pre_block,
1336 + .notify_send_pre_enqueue = virtio_transport_notify_send_pre_enqueue,
1337 + .notify_send_post_enqueue = virtio_transport_notify_send_post_enqueue,
1338 +
1339 + .set_buffer_size = virtio_transport_set_buffer_size,
1340 + .set_min_buffer_size = virtio_transport_set_min_buffer_size,
1341 + .set_max_buffer_size = virtio_transport_set_max_buffer_size,
1342 + .get_buffer_size = virtio_transport_get_buffer_size,
1343 + .get_min_buffer_size = virtio_transport_get_min_buffer_size,
1344 + .get_max_buffer_size = virtio_transport_get_max_buffer_size,
1345 + },
1346 +
1347 + .send_pkt = vhost_transport_send_pkt,
1348 +};
1349 +
1350 static void vhost_vsock_handle_tx_kick(struct vhost_work *work)
1351 {
1352 struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue,
1353 @@ -440,7 +486,7 @@ static void vhost_vsock_handle_tx_kick(struct vhost_work *work)
1354 if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid &&
1355 le64_to_cpu(pkt->hdr.dst_cid) ==
1356 vhost_transport_get_local_cid())
1357 - virtio_transport_recv_pkt(pkt);
1358 + virtio_transport_recv_pkt(&vhost_transport, pkt);
1359 else
1360 virtio_transport_free_pkt(pkt);
1361
1362 @@ -793,52 +839,6 @@ static struct miscdevice vhost_vsock_misc = {
1363 .fops = &vhost_vsock_fops,
1364 };
1365
1366 -static struct virtio_transport vhost_transport = {
1367 - .transport = {
1368 - .get_local_cid = vhost_transport_get_local_cid,
1369 -
1370 - .init = virtio_transport_do_socket_init,
1371 - .destruct = virtio_transport_destruct,
1372 - .release = virtio_transport_release,
1373 - .connect = virtio_transport_connect,
1374 - .shutdown = virtio_transport_shutdown,
1375 - .cancel_pkt = vhost_transport_cancel_pkt,
1376 -
1377 - .dgram_enqueue = virtio_transport_dgram_enqueue,
1378 - .dgram_dequeue = virtio_transport_dgram_dequeue,
1379 - .dgram_bind = virtio_transport_dgram_bind,
1380 - .dgram_allow = virtio_transport_dgram_allow,
1381 -
1382 - .stream_enqueue = virtio_transport_stream_enqueue,
1383 - .stream_dequeue = virtio_transport_stream_dequeue,
1384 - .stream_has_data = virtio_transport_stream_has_data,
1385 - .stream_has_space = virtio_transport_stream_has_space,
1386 - .stream_rcvhiwat = virtio_transport_stream_rcvhiwat,
1387 - .stream_is_active = virtio_transport_stream_is_active,
1388 - .stream_allow = virtio_transport_stream_allow,
1389 -
1390 - .notify_poll_in = virtio_transport_notify_poll_in,
1391 - .notify_poll_out = virtio_transport_notify_poll_out,
1392 - .notify_recv_init = virtio_transport_notify_recv_init,
1393 - .notify_recv_pre_block = virtio_transport_notify_recv_pre_block,
1394 - .notify_recv_pre_dequeue = virtio_transport_notify_recv_pre_dequeue,
1395 - .notify_recv_post_dequeue = virtio_transport_notify_recv_post_dequeue,
1396 - .notify_send_init = virtio_transport_notify_send_init,
1397 - .notify_send_pre_block = virtio_transport_notify_send_pre_block,
1398 - .notify_send_pre_enqueue = virtio_transport_notify_send_pre_enqueue,
1399 - .notify_send_post_enqueue = virtio_transport_notify_send_post_enqueue,
1400 -
1401 - .set_buffer_size = virtio_transport_set_buffer_size,
1402 - .set_min_buffer_size = virtio_transport_set_min_buffer_size,
1403 - .set_max_buffer_size = virtio_transport_set_max_buffer_size,
1404 - .get_buffer_size = virtio_transport_get_buffer_size,
1405 - .get_min_buffer_size = virtio_transport_get_min_buffer_size,
1406 - .get_max_buffer_size = virtio_transport_get_max_buffer_size,
1407 - },
1408 -
1409 - .send_pkt = vhost_transport_send_pkt,
1410 -};
1411 -
1412 static int __init vhost_vsock_init(void)
1413 {
1414 int ret;
1415 diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
1416 index 48890826b5e66..196bd241e701a 100644
1417 --- a/fs/btrfs/dev-replace.c
1418 +++ b/fs/btrfs/dev-replace.c
1419 @@ -562,6 +562,37 @@ static void btrfs_rm_dev_replace_unblocked(struct btrfs_fs_info *fs_info)
1420 wake_up(&fs_info->dev_replace.replace_wait);
1421 }
1422
1423 +/*
1424 + * When finishing the device replace, before swapping the source device with the
1425 + * target device we must update the chunk allocation state in the target device,
1426 + * as it is empty because replace works by directly copying the chunks and not
1427 + * through the normal chunk allocation path.
1428 + */
1429 +static int btrfs_set_target_alloc_state(struct btrfs_device *srcdev,
1430 + struct btrfs_device *tgtdev)
1431 +{
1432 + struct extent_state *cached_state = NULL;
1433 + u64 start = 0;
1434 + u64 found_start;
1435 + u64 found_end;
1436 + int ret = 0;
1437 +
1438 + lockdep_assert_held(&srcdev->fs_info->chunk_mutex);
1439 +
1440 + while (!find_first_extent_bit(&srcdev->alloc_state, start,
1441 + &found_start, &found_end,
1442 + CHUNK_ALLOCATED, &cached_state)) {
1443 + ret = set_extent_bits(&tgtdev->alloc_state, found_start,
1444 + found_end, CHUNK_ALLOCATED);
1445 + if (ret)
1446 + break;
1447 + start = found_end + 1;
1448 + }
1449 +
1450 + free_extent_state(cached_state);
1451 + return ret;
1452 +}
1453 +
1454 static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
1455 int scrub_ret)
1456 {
1457 @@ -636,8 +667,14 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
1458 dev_replace->time_stopped = ktime_get_real_seconds();
1459 dev_replace->item_needs_writeback = 1;
1460
1461 - /* replace old device with new one in mapping tree */
1462 + /*
1463 + * Update allocation state in the new device and replace the old device
1464 + * with the new one in the mapping tree.
1465 + */
1466 if (!scrub_ret) {
1467 + scrub_ret = btrfs_set_target_alloc_state(src_device, tgt_device);
1468 + if (scrub_ret)
1469 + goto error;
1470 btrfs_dev_replace_update_device_in_mapping_tree(fs_info,
1471 src_device,
1472 tgt_device);
1473 @@ -648,6 +685,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
1474 btrfs_dev_name(src_device),
1475 src_device->devid,
1476 rcu_str_deref(tgt_device->name), scrub_ret);
1477 +error:
1478 up_write(&dev_replace->rwsem);
1479 mutex_unlock(&fs_info->chunk_mutex);
1480 mutex_unlock(&fs_info->fs_devices->device_list_mutex);
1481 diff --git a/fs/eventpoll.c b/fs/eventpoll.c
1482 index ae1d32344f7ac..339453ac834cc 100644
1483 --- a/fs/eventpoll.c
1484 +++ b/fs/eventpoll.c
1485 @@ -218,8 +218,7 @@ struct eventpoll {
1486 struct file *file;
1487
1488 /* used to optimize loop detection check */
1489 - int visited;
1490 - struct list_head visited_list_link;
1491 + u64 gen;
1492
1493 #ifdef CONFIG_NET_RX_BUSY_POLL
1494 /* used to track busy poll napi_id */
1495 @@ -269,6 +268,8 @@ static long max_user_watches __read_mostly;
1496 */
1497 static DEFINE_MUTEX(epmutex);
1498
1499 +static u64 loop_check_gen = 0;
1500 +
1501 /* Used to check for epoll file descriptor inclusion loops */
1502 static struct nested_calls poll_loop_ncalls;
1503
1504 @@ -278,9 +279,6 @@ static struct kmem_cache *epi_cache __read_mostly;
1505 /* Slab cache used to allocate "struct eppoll_entry" */
1506 static struct kmem_cache *pwq_cache __read_mostly;
1507
1508 -/* Visited nodes during ep_loop_check(), so we can unset them when we finish */
1509 -static LIST_HEAD(visited_list);
1510 -
1511 /*
1512 * List of files with newly added links, where we may need to limit the number
1513 * of emanating paths. Protected by the epmutex.
1514 @@ -1455,7 +1453,7 @@ static int reverse_path_check(void)
1515
1516 static int ep_create_wakeup_source(struct epitem *epi)
1517 {
1518 - const char *name;
1519 + struct name_snapshot n;
1520 struct wakeup_source *ws;
1521
1522 if (!epi->ep->ws) {
1523 @@ -1464,8 +1462,9 @@ static int ep_create_wakeup_source(struct epitem *epi)
1524 return -ENOMEM;
1525 }
1526
1527 - name = epi->ffd.file->f_path.dentry->d_name.name;
1528 - ws = wakeup_source_register(NULL, name);
1529 + take_dentry_name_snapshot(&n, epi->ffd.file->f_path.dentry);
1530 + ws = wakeup_source_register(NULL, n.name.name);
1531 + release_dentry_name_snapshot(&n);
1532
1533 if (!ws)
1534 return -ENOMEM;
1535 @@ -1527,6 +1526,22 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
1536 RCU_INIT_POINTER(epi->ws, NULL);
1537 }
1538
1539 + /* Add the current item to the list of active epoll hook for this file */
1540 + spin_lock(&tfile->f_lock);
1541 + list_add_tail_rcu(&epi->fllink, &tfile->f_ep_links);
1542 + spin_unlock(&tfile->f_lock);
1543 +
1544 + /*
1545 + * Add the current item to the RB tree. All RB tree operations are
1546 + * protected by "mtx", and ep_insert() is called with "mtx" held.
1547 + */
1548 + ep_rbtree_insert(ep, epi);
1549 +
1550 + /* now check if we've created too many backpaths */
1551 + error = -EINVAL;
1552 + if (full_check && reverse_path_check())
1553 + goto error_remove_epi;
1554 +
1555 /* Initialize the poll table using the queue callback */
1556 epq.epi = epi;
1557 init_poll_funcptr(&epq.pt, ep_ptable_queue_proc);
1558 @@ -1549,22 +1564,6 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
1559 if (epi->nwait < 0)
1560 goto error_unregister;
1561
1562 - /* Add the current item to the list of active epoll hook for this file */
1563 - spin_lock(&tfile->f_lock);
1564 - list_add_tail_rcu(&epi->fllink, &tfile->f_ep_links);
1565 - spin_unlock(&tfile->f_lock);
1566 -
1567 - /*
1568 - * Add the current item to the RB tree. All RB tree operations are
1569 - * protected by "mtx", and ep_insert() is called with "mtx" held.
1570 - */
1571 - ep_rbtree_insert(ep, epi);
1572 -
1573 - /* now check if we've created too many backpaths */
1574 - error = -EINVAL;
1575 - if (full_check && reverse_path_check())
1576 - goto error_remove_epi;
1577 -
1578 /* We have to drop the new item inside our item list to keep track of it */
1579 write_lock_irq(&ep->lock);
1580
1581 @@ -1593,6 +1592,8 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
1582
1583 return 0;
1584
1585 +error_unregister:
1586 + ep_unregister_pollwait(ep, epi);
1587 error_remove_epi:
1588 spin_lock(&tfile->f_lock);
1589 list_del_rcu(&epi->fllink);
1590 @@ -1600,9 +1601,6 @@ error_remove_epi:
1591
1592 rb_erase_cached(&epi->rbn, &ep->rbr);
1593
1594 -error_unregister:
1595 - ep_unregister_pollwait(ep, epi);
1596 -
1597 /*
1598 * We need to do this because an event could have been arrived on some
1599 * allocated wait queue. Note that we don't care about the ep->ovflist
1600 @@ -1969,13 +1967,12 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
1601 struct epitem *epi;
1602
1603 mutex_lock_nested(&ep->mtx, call_nests + 1);
1604 - ep->visited = 1;
1605 - list_add(&ep->visited_list_link, &visited_list);
1606 + ep->gen = loop_check_gen;
1607 for (rbp = rb_first_cached(&ep->rbr); rbp; rbp = rb_next(rbp)) {
1608 epi = rb_entry(rbp, struct epitem, rbn);
1609 if (unlikely(is_file_epoll(epi->ffd.file))) {
1610 ep_tovisit = epi->ffd.file->private_data;
1611 - if (ep_tovisit->visited)
1612 + if (ep_tovisit->gen == loop_check_gen)
1613 continue;
1614 error = ep_call_nested(&poll_loop_ncalls,
1615 ep_loop_check_proc, epi->ffd.file,
1616 @@ -2016,18 +2013,8 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
1617 */
1618 static int ep_loop_check(struct eventpoll *ep, struct file *file)
1619 {
1620 - int ret;
1621 - struct eventpoll *ep_cur, *ep_next;
1622 -
1623 - ret = ep_call_nested(&poll_loop_ncalls,
1624 + return ep_call_nested(&poll_loop_ncalls,
1625 ep_loop_check_proc, file, ep, current);
1626 - /* clear visited list */
1627 - list_for_each_entry_safe(ep_cur, ep_next, &visited_list,
1628 - visited_list_link) {
1629 - ep_cur->visited = 0;
1630 - list_del(&ep_cur->visited_list_link);
1631 - }
1632 - return ret;
1633 }
1634
1635 static void clear_tfile_check_list(void)
1636 @@ -2189,6 +2176,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
1637 mutex_lock_nested(&ep->mtx, 0);
1638 if (op == EPOLL_CTL_ADD) {
1639 if (!list_empty(&f.file->f_ep_links) ||
1640 + ep->gen == loop_check_gen ||
1641 is_file_epoll(tf.file)) {
1642 full_check = 1;
1643 mutex_unlock(&ep->mtx);
1644 @@ -2249,6 +2237,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
1645 error_tgt_fput:
1646 if (full_check) {
1647 clear_tfile_check_list();
1648 + loop_check_gen++;
1649 mutex_unlock(&epmutex);
1650 }
1651
1652 diff --git a/fs/fuse/file.c b/fs/fuse/file.c
1653 index f8d8a8e34b808..ab4fc1255aca8 100644
1654 --- a/fs/fuse/file.c
1655 +++ b/fs/fuse/file.c
1656 @@ -3074,11 +3074,10 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
1657 ssize_t ret = 0;
1658 struct file *file = iocb->ki_filp;
1659 struct fuse_file *ff = file->private_data;
1660 - bool async_dio = ff->fc->async_dio;
1661 loff_t pos = 0;
1662 struct inode *inode;
1663 loff_t i_size;
1664 - size_t count = iov_iter_count(iter);
1665 + size_t count = iov_iter_count(iter), shortened = 0;
1666 loff_t offset = iocb->ki_pos;
1667 struct fuse_io_priv *io;
1668
1669 @@ -3086,17 +3085,9 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
1670 inode = file->f_mapping->host;
1671 i_size = i_size_read(inode);
1672
1673 - if ((iov_iter_rw(iter) == READ) && (offset > i_size))
1674 + if ((iov_iter_rw(iter) == READ) && (offset >= i_size))
1675 return 0;
1676
1677 - /* optimization for short read */
1678 - if (async_dio && iov_iter_rw(iter) != WRITE && offset + count > i_size) {
1679 - if (offset >= i_size)
1680 - return 0;
1681 - iov_iter_truncate(iter, fuse_round_up(ff->fc, i_size - offset));
1682 - count = iov_iter_count(iter);
1683 - }
1684 -
1685 io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL);
1686 if (!io)
1687 return -ENOMEM;
1688 @@ -3112,15 +3103,22 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
1689 * By default, we want to optimize all I/Os with async request
1690 * submission to the client filesystem if supported.
1691 */
1692 - io->async = async_dio;
1693 + io->async = ff->fc->async_dio;
1694 io->iocb = iocb;
1695 io->blocking = is_sync_kiocb(iocb);
1696
1697 + /* optimization for short read */
1698 + if (io->async && !io->write && offset + count > i_size) {
1699 + iov_iter_truncate(iter, fuse_round_up(ff->fc, i_size - offset));
1700 + shortened = count - iov_iter_count(iter);
1701 + count -= shortened;
1702 + }
1703 +
1704 /*
1705 * We cannot asynchronously extend the size of a file.
1706 * In such case the aio will behave exactly like sync io.
1707 */
1708 - if ((offset + count > i_size) && iov_iter_rw(iter) == WRITE)
1709 + if ((offset + count > i_size) && io->write)
1710 io->blocking = true;
1711
1712 if (io->async && io->blocking) {
1713 @@ -3138,6 +3136,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
1714 } else {
1715 ret = __fuse_direct_read(io, iter, &pos);
1716 }
1717 + iov_iter_reexpand(iter, iov_iter_count(iter) + shortened);
1718
1719 if (io->async) {
1720 bool blocking = io->blocking;
1721 diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
1722 index 05ed7be8a6345..188b17a3b19eb 100644
1723 --- a/fs/nfs/dir.c
1724 +++ b/fs/nfs/dir.c
1725 @@ -553,6 +553,9 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en
1726 xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE);
1727
1728 do {
1729 + if (entry->label)
1730 + entry->label->len = NFS4_MAXLABELLEN;
1731 +
1732 status = xdr_decode(desc, entry, &stream);
1733 if (status != 0) {
1734 if (status == -EAGAIN)
1735 diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
1736 index f780e223b1185..239c9548b1568 100644
1737 --- a/fs/xfs/xfs_iomap.c
1738 +++ b/fs/xfs/xfs_iomap.c
1739 @@ -1002,9 +1002,15 @@ xfs_file_iomap_begin(
1740 * I/O, which must be block aligned, we need to report the
1741 * newly allocated address. If the data fork has a hole, copy
1742 * the COW fork mapping to avoid allocating to the data fork.
1743 + *
1744 + * Otherwise, ensure that the imap range does not extend past
1745 + * the range allocated/found in cmap.
1746 */
1747 if (directio || imap.br_startblock == HOLESTARTBLOCK)
1748 imap = cmap;
1749 + else
1750 + xfs_trim_extent(&imap, cmap.br_startoff,
1751 + cmap.br_blockcount);
1752
1753 end_fsb = imap.br_startoff + imap.br_blockcount;
1754 length = XFS_FSB_TO_B(mp, end_fsb) - offset;
1755 diff --git a/include/linux/genhd.h b/include/linux/genhd.h
1756 index 62a2ec9f17df8..c1bf9956256f6 100644
1757 --- a/include/linux/genhd.h
1758 +++ b/include/linux/genhd.h
1759 @@ -419,7 +419,7 @@ static inline void free_part_info(struct hd_struct *part)
1760 kfree(part->info);
1761 }
1762
1763 -void update_io_ticks(struct hd_struct *part, unsigned long now);
1764 +void update_io_ticks(struct hd_struct *part, unsigned long now, bool end);
1765
1766 /* block/genhd.c */
1767 extern void device_add_disk(struct device *parent, struct gendisk *disk,
1768 diff --git a/include/linux/memstick.h b/include/linux/memstick.h
1769 index 216a713bef7f0..1198ea3d40126 100644
1770 --- a/include/linux/memstick.h
1771 +++ b/include/linux/memstick.h
1772 @@ -281,6 +281,7 @@ struct memstick_host {
1773
1774 struct memstick_dev *card;
1775 unsigned int retries;
1776 + bool removing;
1777
1778 /* Notify the host that some requests are pending. */
1779 void (*request)(struct memstick_host *host);
1780 diff --git a/include/linux/mm.h b/include/linux/mm.h
1781 index 3285dae06c030..34119f393a802 100644
1782 --- a/include/linux/mm.h
1783 +++ b/include/linux/mm.h
1784 @@ -2208,7 +2208,7 @@ static inline void zero_resv_unavail(void) {}
1785
1786 extern void set_dma_reserve(unsigned long new_dma_reserve);
1787 extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long,
1788 - enum memmap_context, struct vmem_altmap *);
1789 + enum meminit_context, struct vmem_altmap *);
1790 extern void setup_per_zone_wmarks(void);
1791 extern int __meminit init_per_zone_wmark_min(void);
1792 extern void mem_init(void);
1793 diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
1794 index 85804ba622152..a90aba3d6afb4 100644
1795 --- a/include/linux/mmzone.h
1796 +++ b/include/linux/mmzone.h
1797 @@ -822,10 +822,15 @@ bool zone_watermark_ok(struct zone *z, unsigned int order,
1798 unsigned int alloc_flags);
1799 bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
1800 unsigned long mark, int classzone_idx);
1801 -enum memmap_context {
1802 - MEMMAP_EARLY,
1803 - MEMMAP_HOTPLUG,
1804 +/*
1805 + * Memory initialization context, use to differentiate memory added by
1806 + * the platform statically or via memory hotplug interface.
1807 + */
1808 +enum meminit_context {
1809 + MEMINIT_EARLY,
1810 + MEMINIT_HOTPLUG,
1811 };
1812 +
1813 extern void init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
1814 unsigned long size);
1815
1816 diff --git a/include/linux/node.h b/include/linux/node.h
1817 index 4866f32a02d8d..014ba3ab2efd8 100644
1818 --- a/include/linux/node.h
1819 +++ b/include/linux/node.h
1820 @@ -99,11 +99,13 @@ extern struct node *node_devices[];
1821 typedef void (*node_registration_func_t)(struct node *);
1822
1823 #if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_NUMA)
1824 -extern int link_mem_sections(int nid, unsigned long start_pfn,
1825 - unsigned long end_pfn);
1826 +int link_mem_sections(int nid, unsigned long start_pfn,
1827 + unsigned long end_pfn,
1828 + enum meminit_context context);
1829 #else
1830 static inline int link_mem_sections(int nid, unsigned long start_pfn,
1831 - unsigned long end_pfn)
1832 + unsigned long end_pfn,
1833 + enum meminit_context context)
1834 {
1835 return 0;
1836 }
1837 @@ -128,7 +130,8 @@ static inline int register_one_node(int nid)
1838 if (error)
1839 return error;
1840 /* link memory sections under this node */
1841 - error = link_mem_sections(nid, start_pfn, end_pfn);
1842 + error = link_mem_sections(nid, start_pfn, end_pfn,
1843 + MEMINIT_EARLY);
1844 }
1845
1846 return error;
1847 diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h
1848 index 07875ccc7bb50..b139f76060a65 100644
1849 --- a/include/linux/virtio_vsock.h
1850 +++ b/include/linux/virtio_vsock.h
1851 @@ -150,7 +150,8 @@ virtio_transport_dgram_enqueue(struct vsock_sock *vsk,
1852
1853 void virtio_transport_destruct(struct vsock_sock *vsk);
1854
1855 -void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt);
1856 +void virtio_transport_recv_pkt(struct virtio_transport *t,
1857 + struct virtio_vsock_pkt *pkt);
1858 void virtio_transport_free_pkt(struct virtio_vsock_pkt *pkt);
1859 void virtio_transport_inc_tx_pkt(struct virtio_vsock_sock *vvs, struct virtio_vsock_pkt *pkt);
1860 u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 wanted);
1861 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
1862 index 705852c1724aa..fbba31baef53c 100644
1863 --- a/kernel/trace/ftrace.c
1864 +++ b/kernel/trace/ftrace.c
1865 @@ -6382,16 +6382,14 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,
1866 {
1867 int bit;
1868
1869 - if ((op->flags & FTRACE_OPS_FL_RCU) && !rcu_is_watching())
1870 - return;
1871 -
1872 bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX);
1873 if (bit < 0)
1874 return;
1875
1876 preempt_disable_notrace();
1877
1878 - op->func(ip, parent_ip, op, regs);
1879 + if (!(op->flags & FTRACE_OPS_FL_RCU) || rcu_is_watching())
1880 + op->func(ip, parent_ip, op, regs);
1881
1882 preempt_enable_notrace();
1883 trace_clear_recursion(bit);
1884 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
1885 index db8162b34ef64..5b2a664812b10 100644
1886 --- a/kernel/trace/trace.c
1887 +++ b/kernel/trace/trace.c
1888 @@ -3584,14 +3584,14 @@ unsigned long trace_total_entries(struct trace_array *tr)
1889
1890 static void print_lat_help_header(struct seq_file *m)
1891 {
1892 - seq_puts(m, "# _------=> CPU# \n"
1893 - "# / _-----=> irqs-off \n"
1894 - "# | / _----=> need-resched \n"
1895 - "# || / _---=> hardirq/softirq \n"
1896 - "# ||| / _--=> preempt-depth \n"
1897 - "# |||| / delay \n"
1898 - "# cmd pid ||||| time | caller \n"
1899 - "# \\ / ||||| \\ | / \n");
1900 + seq_puts(m, "# _------=> CPU# \n"
1901 + "# / _-----=> irqs-off \n"
1902 + "# | / _----=> need-resched \n"
1903 + "# || / _---=> hardirq/softirq \n"
1904 + "# ||| / _--=> preempt-depth \n"
1905 + "# |||| / delay \n"
1906 + "# cmd pid ||||| time | caller \n"
1907 + "# \\ / ||||| \\ | / \n");
1908 }
1909
1910 static void print_event_info(struct trace_buffer *buf, struct seq_file *m)
1911 @@ -3612,26 +3612,26 @@ static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m,
1912
1913 print_event_info(buf, m);
1914
1915 - seq_printf(m, "# TASK-PID %s CPU# TIMESTAMP FUNCTION\n", tgid ? "TGID " : "");
1916 - seq_printf(m, "# | | %s | | |\n", tgid ? " | " : "");
1917 + seq_printf(m, "# TASK-PID %s CPU# TIMESTAMP FUNCTION\n", tgid ? " TGID " : "");
1918 + seq_printf(m, "# | | %s | | |\n", tgid ? " | " : "");
1919 }
1920
1921 static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m,
1922 unsigned int flags)
1923 {
1924 bool tgid = flags & TRACE_ITER_RECORD_TGID;
1925 - const char *space = " ";
1926 - int prec = tgid ? 10 : 2;
1927 + const char *space = " ";
1928 + int prec = tgid ? 12 : 2;
1929
1930 print_event_info(buf, m);
1931
1932 - seq_printf(m, "# %.*s _-----=> irqs-off\n", prec, space);
1933 - seq_printf(m, "# %.*s / _----=> need-resched\n", prec, space);
1934 - seq_printf(m, "# %.*s| / _---=> hardirq/softirq\n", prec, space);
1935 - seq_printf(m, "# %.*s|| / _--=> preempt-depth\n", prec, space);
1936 - seq_printf(m, "# %.*s||| / delay\n", prec, space);
1937 - seq_printf(m, "# TASK-PID %.*sCPU# |||| TIMESTAMP FUNCTION\n", prec, " TGID ");
1938 - seq_printf(m, "# | | %.*s | |||| | |\n", prec, " | ");
1939 + seq_printf(m, "# %.*s _-----=> irqs-off\n", prec, space);
1940 + seq_printf(m, "# %.*s / _----=> need-resched\n", prec, space);
1941 + seq_printf(m, "# %.*s| / _---=> hardirq/softirq\n", prec, space);
1942 + seq_printf(m, "# %.*s|| / _--=> preempt-depth\n", prec, space);
1943 + seq_printf(m, "# %.*s||| / delay\n", prec, space);
1944 + seq_printf(m, "# TASK-PID %.*s CPU# |||| TIMESTAMP FUNCTION\n", prec, " TGID ");
1945 + seq_printf(m, "# | | %.*s | |||| | |\n", prec, " | ");
1946 }
1947
1948 void
1949 diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
1950 index d54ce252b05a8..a0a45901dc027 100644
1951 --- a/kernel/trace/trace_output.c
1952 +++ b/kernel/trace/trace_output.c
1953 @@ -482,7 +482,7 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
1954
1955 trace_find_cmdline(entry->pid, comm);
1956
1957 - trace_seq_printf(s, "%8.8s-%-5d %3d",
1958 + trace_seq_printf(s, "%8.8s-%-7d %3d",
1959 comm, entry->pid, cpu);
1960
1961 return trace_print_lat_fmt(s, entry);
1962 @@ -573,15 +573,15 @@ int trace_print_context(struct trace_iterator *iter)
1963
1964 trace_find_cmdline(entry->pid, comm);
1965
1966 - trace_seq_printf(s, "%16s-%-5d ", comm, entry->pid);
1967 + trace_seq_printf(s, "%16s-%-7d ", comm, entry->pid);
1968
1969 if (tr->trace_flags & TRACE_ITER_RECORD_TGID) {
1970 unsigned int tgid = trace_find_tgid(entry->pid);
1971
1972 if (!tgid)
1973 - trace_seq_printf(s, "(-----) ");
1974 + trace_seq_printf(s, "(-------) ");
1975 else
1976 - trace_seq_printf(s, "(%5d) ", tgid);
1977 + trace_seq_printf(s, "(%7d) ", tgid);
1978 }
1979
1980 trace_seq_printf(s, "[%03d] ", iter->cpu);
1981 @@ -624,7 +624,7 @@ int trace_print_lat_context(struct trace_iterator *iter)
1982 trace_find_cmdline(entry->pid, comm);
1983
1984 trace_seq_printf(
1985 - s, "%16s %5d %3d %d %08x %08lx ",
1986 + s, "%16s %7d %3d %d %08x %08lx ",
1987 comm, entry->pid, iter->cpu, entry->flags,
1988 entry->preempt_count, iter->idx);
1989 } else {
1990 @@ -905,7 +905,7 @@ static enum print_line_t trace_ctxwake_print(struct trace_iterator *iter,
1991 S = task_index_to_char(field->prev_state);
1992 trace_find_cmdline(field->next_pid, comm);
1993 trace_seq_printf(&iter->seq,
1994 - " %5d:%3d:%c %s [%03d] %5d:%3d:%c %s\n",
1995 + " %7d:%3d:%c %s [%03d] %7d:%3d:%c %s\n",
1996 field->prev_pid,
1997 field->prev_prio,
1998 S, delim,
1999 diff --git a/lib/random32.c b/lib/random32.c
2000 index 3d749abb9e80d..1786f78bf4c53 100644
2001 --- a/lib/random32.c
2002 +++ b/lib/random32.c
2003 @@ -48,7 +48,7 @@ static inline void prandom_state_selftest(void)
2004 }
2005 #endif
2006
2007 -DEFINE_PER_CPU(struct rnd_state, net_rand_state);
2008 +DEFINE_PER_CPU(struct rnd_state, net_rand_state) __latent_entropy;
2009
2010 /**
2011 * prandom_u32_state - seeded pseudo-random number generator.
2012 diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
2013 index 3eb0b311b4a12..308beca3ffebc 100644
2014 --- a/mm/memory_hotplug.c
2015 +++ b/mm/memory_hotplug.c
2016 @@ -725,7 +725,7 @@ void __ref move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn,
2017 * are reserved so nobody should be touching them so we should be safe
2018 */
2019 memmap_init_zone(nr_pages, nid, zone_idx(zone), start_pfn,
2020 - MEMMAP_HOTPLUG, altmap);
2021 + MEMINIT_HOTPLUG, altmap);
2022
2023 set_zone_contiguous(zone);
2024 }
2025 @@ -1082,7 +1082,8 @@ int __ref add_memory_resource(int nid, struct resource *res)
2026 }
2027
2028 /* link memory sections under this node.*/
2029 - ret = link_mem_sections(nid, PFN_DOWN(start), PFN_UP(start + size - 1));
2030 + ret = link_mem_sections(nid, PFN_DOWN(start), PFN_UP(start + size - 1),
2031 + MEMINIT_HOTPLUG);
2032 BUG_ON(ret);
2033
2034 /* create new memmap entry */
2035 diff --git a/mm/page_alloc.c b/mm/page_alloc.c
2036 index 67a9943aa595f..373ca57807589 100644
2037 --- a/mm/page_alloc.c
2038 +++ b/mm/page_alloc.c
2039 @@ -5875,7 +5875,7 @@ overlap_memmap_init(unsigned long zone, unsigned long *pfn)
2040 * done. Non-atomic initialization, single-pass.
2041 */
2042 void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
2043 - unsigned long start_pfn, enum memmap_context context,
2044 + unsigned long start_pfn, enum meminit_context context,
2045 struct vmem_altmap *altmap)
2046 {
2047 unsigned long pfn, end_pfn = start_pfn + size;
2048 @@ -5907,7 +5907,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
2049 * There can be holes in boot-time mem_map[]s handed to this
2050 * function. They do not exist on hotplugged memory.
2051 */
2052 - if (context == MEMMAP_EARLY) {
2053 + if (context == MEMINIT_EARLY) {
2054 if (!early_pfn_valid(pfn))
2055 continue;
2056 if (!early_pfn_in_nid(pfn, nid))
2057 @@ -5920,7 +5920,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
2058
2059 page = pfn_to_page(pfn);
2060 __init_single_page(page, pfn, zone, nid);
2061 - if (context == MEMMAP_HOTPLUG)
2062 + if (context == MEMINIT_HOTPLUG)
2063 __SetPageReserved(page);
2064
2065 /*
2066 @@ -6002,7 +6002,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
2067 * check here not to call set_pageblock_migratetype() against
2068 * pfn out of zone.
2069 *
2070 - * Please note that MEMMAP_HOTPLUG path doesn't clear memmap
2071 + * Please note that MEMINIT_HOTPLUG path doesn't clear memmap
2072 * because this is done early in section_activate()
2073 */
2074 if (!(pfn & (pageblock_nr_pages - 1))) {
2075 @@ -6028,7 +6028,7 @@ static void __meminit zone_init_free_lists(struct zone *zone)
2076 void __meminit __weak memmap_init(unsigned long size, int nid,
2077 unsigned long zone, unsigned long start_pfn)
2078 {
2079 - memmap_init_zone(size, nid, zone, start_pfn, MEMMAP_EARLY, NULL);
2080 + memmap_init_zone(size, nid, zone, start_pfn, MEMINIT_EARLY, NULL);
2081 }
2082
2083 static int zone_batchsize(struct zone *zone)
2084 diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
2085 index e5fb9002d3147..3ab85e1e38d82 100644
2086 --- a/net/mac80211/rx.c
2087 +++ b/net/mac80211/rx.c
2088 @@ -419,7 +419,8 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
2089 else if (status->bw == RATE_INFO_BW_5)
2090 channel_flags |= IEEE80211_CHAN_QUARTER;
2091
2092 - if (status->band == NL80211_BAND_5GHZ)
2093 + if (status->band == NL80211_BAND_5GHZ ||
2094 + status->band == NL80211_BAND_6GHZ)
2095 channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ;
2096 else if (status->encoding != RX_ENC_LEGACY)
2097 channel_flags |= IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ;
2098 diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
2099 index ccdcb9ad9ac72..aabc63dadf176 100644
2100 --- a/net/mac80211/vht.c
2101 +++ b/net/mac80211/vht.c
2102 @@ -168,10 +168,7 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
2103 /* take some capabilities as-is */
2104 cap_info = le32_to_cpu(vht_cap_ie->vht_cap_info);
2105 vht_cap->cap = cap_info;
2106 - vht_cap->cap &= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 |
2107 - IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 |
2108 - IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |
2109 - IEEE80211_VHT_CAP_RXLDPC |
2110 + vht_cap->cap &= IEEE80211_VHT_CAP_RXLDPC |
2111 IEEE80211_VHT_CAP_VHT_TXOP_PS |
2112 IEEE80211_VHT_CAP_HTC_VHT |
2113 IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK |
2114 @@ -180,6 +177,9 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
2115 IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN |
2116 IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN;
2117
2118 + vht_cap->cap |= min_t(u32, cap_info & IEEE80211_VHT_CAP_MAX_MPDU_MASK,
2119 + own_cap.cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK);
2120 +
2121 /* and some based on our own capabilities */
2122 switch (own_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
2123 case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
2124 diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
2125 index aa8adf930b3ce..b7f0d52e5f1b6 100644
2126 --- a/net/netfilter/nf_conntrack_netlink.c
2127 +++ b/net/netfilter/nf_conntrack_netlink.c
2128 @@ -1141,6 +1141,8 @@ ctnetlink_parse_tuple(const struct nlattr * const cda[],
2129 if (!tb[CTA_TUPLE_IP])
2130 return -EINVAL;
2131
2132 + if (l3num != NFPROTO_IPV4 && l3num != NFPROTO_IPV6)
2133 + return -EOPNOTSUPP;
2134 tuple->src.l3num = l3num;
2135
2136 err = ctnetlink_parse_tuple_ip(tb[CTA_TUPLE_IP], tuple);
2137 diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
2138 index 861ec9a671f9d..5905f0cddc895 100644
2139 --- a/net/vmw_vsock/virtio_transport.c
2140 +++ b/net/vmw_vsock/virtio_transport.c
2141 @@ -86,33 +86,6 @@ out_rcu:
2142 return ret;
2143 }
2144
2145 -static void virtio_transport_loopback_work(struct work_struct *work)
2146 -{
2147 - struct virtio_vsock *vsock =
2148 - container_of(work, struct virtio_vsock, loopback_work);
2149 - LIST_HEAD(pkts);
2150 -
2151 - spin_lock_bh(&vsock->loopback_list_lock);
2152 - list_splice_init(&vsock->loopback_list, &pkts);
2153 - spin_unlock_bh(&vsock->loopback_list_lock);
2154 -
2155 - mutex_lock(&vsock->rx_lock);
2156 -
2157 - if (!vsock->rx_run)
2158 - goto out;
2159 -
2160 - while (!list_empty(&pkts)) {
2161 - struct virtio_vsock_pkt *pkt;
2162 -
2163 - pkt = list_first_entry(&pkts, struct virtio_vsock_pkt, list);
2164 - list_del_init(&pkt->list);
2165 -
2166 - virtio_transport_recv_pkt(pkt);
2167 - }
2168 -out:
2169 - mutex_unlock(&vsock->rx_lock);
2170 -}
2171 -
2172 static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
2173 struct virtio_vsock_pkt *pkt)
2174 {
2175 @@ -370,59 +343,6 @@ static bool virtio_transport_more_replies(struct virtio_vsock *vsock)
2176 return val < virtqueue_get_vring_size(vq);
2177 }
2178
2179 -static void virtio_transport_rx_work(struct work_struct *work)
2180 -{
2181 - struct virtio_vsock *vsock =
2182 - container_of(work, struct virtio_vsock, rx_work);
2183 - struct virtqueue *vq;
2184 -
2185 - vq = vsock->vqs[VSOCK_VQ_RX];
2186 -
2187 - mutex_lock(&vsock->rx_lock);
2188 -
2189 - if (!vsock->rx_run)
2190 - goto out;
2191 -
2192 - do {
2193 - virtqueue_disable_cb(vq);
2194 - for (;;) {
2195 - struct virtio_vsock_pkt *pkt;
2196 - unsigned int len;
2197 -
2198 - if (!virtio_transport_more_replies(vsock)) {
2199 - /* Stop rx until the device processes already
2200 - * pending replies. Leave rx virtqueue
2201 - * callbacks disabled.
2202 - */
2203 - goto out;
2204 - }
2205 -
2206 - pkt = virtqueue_get_buf(vq, &len);
2207 - if (!pkt) {
2208 - break;
2209 - }
2210 -
2211 - vsock->rx_buf_nr--;
2212 -
2213 - /* Drop short/long packets */
2214 - if (unlikely(len < sizeof(pkt->hdr) ||
2215 - len > sizeof(pkt->hdr) + pkt->len)) {
2216 - virtio_transport_free_pkt(pkt);
2217 - continue;
2218 - }
2219 -
2220 - pkt->len = len - sizeof(pkt->hdr);
2221 - virtio_transport_deliver_tap_pkt(pkt);
2222 - virtio_transport_recv_pkt(pkt);
2223 - }
2224 - } while (!virtqueue_enable_cb(vq));
2225 -
2226 -out:
2227 - if (vsock->rx_buf_nr < vsock->rx_buf_max_nr / 2)
2228 - virtio_vsock_rx_fill(vsock);
2229 - mutex_unlock(&vsock->rx_lock);
2230 -}
2231 -
2232 /* event_lock must be held */
2233 static int virtio_vsock_event_fill_one(struct virtio_vsock *vsock,
2234 struct virtio_vsock_event *event)
2235 @@ -586,6 +506,86 @@ static struct virtio_transport virtio_transport = {
2236 .send_pkt = virtio_transport_send_pkt,
2237 };
2238
2239 +static void virtio_transport_loopback_work(struct work_struct *work)
2240 +{
2241 + struct virtio_vsock *vsock =
2242 + container_of(work, struct virtio_vsock, loopback_work);
2243 + LIST_HEAD(pkts);
2244 +
2245 + spin_lock_bh(&vsock->loopback_list_lock);
2246 + list_splice_init(&vsock->loopback_list, &pkts);
2247 + spin_unlock_bh(&vsock->loopback_list_lock);
2248 +
2249 + mutex_lock(&vsock->rx_lock);
2250 +
2251 + if (!vsock->rx_run)
2252 + goto out;
2253 +
2254 + while (!list_empty(&pkts)) {
2255 + struct virtio_vsock_pkt *pkt;
2256 +
2257 + pkt = list_first_entry(&pkts, struct virtio_vsock_pkt, list);
2258 + list_del_init(&pkt->list);
2259 +
2260 + virtio_transport_recv_pkt(&virtio_transport, pkt);
2261 + }
2262 +out:
2263 + mutex_unlock(&vsock->rx_lock);
2264 +}
2265 +
2266 +static void virtio_transport_rx_work(struct work_struct *work)
2267 +{
2268 + struct virtio_vsock *vsock =
2269 + container_of(work, struct virtio_vsock, rx_work);
2270 + struct virtqueue *vq;
2271 +
2272 + vq = vsock->vqs[VSOCK_VQ_RX];
2273 +
2274 + mutex_lock(&vsock->rx_lock);
2275 +
2276 + if (!vsock->rx_run)
2277 + goto out;
2278 +
2279 + do {
2280 + virtqueue_disable_cb(vq);
2281 + for (;;) {
2282 + struct virtio_vsock_pkt *pkt;
2283 + unsigned int len;
2284 +
2285 + if (!virtio_transport_more_replies(vsock)) {
2286 + /* Stop rx until the device processes already
2287 + * pending replies. Leave rx virtqueue
2288 + * callbacks disabled.
2289 + */
2290 + goto out;
2291 + }
2292 +
2293 + pkt = virtqueue_get_buf(vq, &len);
2294 + if (!pkt) {
2295 + break;
2296 + }
2297 +
2298 + vsock->rx_buf_nr--;
2299 +
2300 + /* Drop short/long packets */
2301 + if (unlikely(len < sizeof(pkt->hdr) ||
2302 + len > sizeof(pkt->hdr) + pkt->len)) {
2303 + virtio_transport_free_pkt(pkt);
2304 + continue;
2305 + }
2306 +
2307 + pkt->len = len - sizeof(pkt->hdr);
2308 + virtio_transport_deliver_tap_pkt(pkt);
2309 + virtio_transport_recv_pkt(&virtio_transport, pkt);
2310 + }
2311 + } while (!virtqueue_enable_cb(vq));
2312 +
2313 +out:
2314 + if (vsock->rx_buf_nr < vsock->rx_buf_max_nr / 2)
2315 + virtio_vsock_rx_fill(vsock);
2316 + mutex_unlock(&vsock->rx_lock);
2317 +}
2318 +
2319 static int virtio_vsock_probe(struct virtio_device *vdev)
2320 {
2321 vq_callback_t *callbacks[] = {
2322 diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
2323 index fb2060dffb0af..efbb521bff135 100644
2324 --- a/net/vmw_vsock/virtio_transport_common.c
2325 +++ b/net/vmw_vsock/virtio_transport_common.c
2326 @@ -696,9 +696,9 @@ static int virtio_transport_reset(struct vsock_sock *vsk,
2327 /* Normally packets are associated with a socket. There may be no socket if an
2328 * attempt was made to connect to a socket that does not exist.
2329 */
2330 -static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt)
2331 +static int virtio_transport_reset_no_sock(const struct virtio_transport *t,
2332 + struct virtio_vsock_pkt *pkt)
2333 {
2334 - const struct virtio_transport *t;
2335 struct virtio_vsock_pkt *reply;
2336 struct virtio_vsock_pkt_info info = {
2337 .op = VIRTIO_VSOCK_OP_RST,
2338 @@ -718,7 +718,6 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt)
2339 if (!reply)
2340 return -ENOMEM;
2341
2342 - t = virtio_transport_get_ops();
2343 if (!t) {
2344 virtio_transport_free_pkt(reply);
2345 return -ENOTCONN;
2346 @@ -1060,7 +1059,8 @@ static bool virtio_transport_space_update(struct sock *sk,
2347 /* We are under the virtio-vsock's vsock->rx_lock or vhost-vsock's vq->mutex
2348 * lock.
2349 */
2350 -void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt)
2351 +void virtio_transport_recv_pkt(struct virtio_transport *t,
2352 + struct virtio_vsock_pkt *pkt)
2353 {
2354 struct sockaddr_vm src, dst;
2355 struct vsock_sock *vsk;
2356 @@ -1082,7 +1082,7 @@ void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt)
2357 le32_to_cpu(pkt->hdr.fwd_cnt));
2358
2359 if (le16_to_cpu(pkt->hdr.type) != VIRTIO_VSOCK_TYPE_STREAM) {
2360 - (void)virtio_transport_reset_no_sock(pkt);
2361 + (void)virtio_transport_reset_no_sock(t, pkt);
2362 goto free_pkt;
2363 }
2364
2365 @@ -1093,7 +1093,7 @@ void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt)
2366 if (!sk) {
2367 sk = vsock_find_bound_socket(&dst);
2368 if (!sk) {
2369 - (void)virtio_transport_reset_no_sock(pkt);
2370 + (void)virtio_transport_reset_no_sock(t, pkt);
2371 goto free_pkt;
2372 }
2373 }
2374 @@ -1127,6 +1127,7 @@ void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt)
2375 virtio_transport_free_pkt(pkt);
2376 break;
2377 default:
2378 + (void)virtio_transport_reset_no_sock(t, pkt);
2379 virtio_transport_free_pkt(pkt);
2380 break;
2381 }
2382 diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
2383 index b5a5b1c548c9b..c2dac994896b4 100644
2384 --- a/scripts/dtc/Makefile
2385 +++ b/scripts/dtc/Makefile
2386 @@ -9,7 +9,7 @@ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
2387 dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
2388
2389 # Source files need to get at the userspace version of libfdt_env.h to compile
2390 -HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
2391 +HOST_EXTRACFLAGS += -I $(srctree)/$(src)/libfdt
2392
2393 ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),)
2394 ifneq ($(CHECK_DTBS),)
2395 diff --git a/tools/io_uring/io_uring-bench.c b/tools/io_uring/io_uring-bench.c
2396 index 0f257139b003e..7703f01183854 100644
2397 --- a/tools/io_uring/io_uring-bench.c
2398 +++ b/tools/io_uring/io_uring-bench.c
2399 @@ -130,7 +130,7 @@ static int io_uring_register_files(struct submitter *s)
2400 s->nr_files);
2401 }
2402
2403 -static int gettid(void)
2404 +static int lk_gettid(void)
2405 {
2406 return syscall(__NR_gettid);
2407 }
2408 @@ -281,7 +281,7 @@ static void *submitter_fn(void *data)
2409 struct io_sq_ring *ring = &s->sq_ring;
2410 int ret, prepped;
2411
2412 - printf("submitter=%d\n", gettid());
2413 + printf("submitter=%d\n", lk_gettid());
2414
2415 srand48_r(pthread_self(), &s->rand);
2416
2417 diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
2418 index d045707e7c9a4..283caeaaffc30 100644
2419 --- a/tools/lib/bpf/Makefile
2420 +++ b/tools/lib/bpf/Makefile
2421 @@ -59,7 +59,7 @@ FEATURE_USER = .libbpf
2422 FEATURE_TESTS = libelf libelf-mmap bpf reallocarray cxx
2423 FEATURE_DISPLAY = libelf bpf
2424
2425 -INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
2426 +INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi
2427 FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
2428
2429 check_feat := 1