Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0133-5.4.34-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3514 - (show annotations) (download)
Mon May 11 14:36:40 2020 UTC (3 years, 11 months ago) by niro
File size: 73417 byte(s)
-linux-5.4.34
1 diff --git a/Makefile b/Makefile
2 index c09d5a4d2e7a..fdbc51db822a 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,7 +1,7 @@
6 # SPDX-License-Identifier: GPL-2.0
7 VERSION = 5
8 PATCHLEVEL = 4
9 -SUBLEVEL = 33
10 +SUBLEVEL = 34
11 EXTRAVERSION =
12 NAME = Kleptomaniac Octopus
13
14 diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
15 index eed78f12e79e..8bba03de51ad 100644
16 --- a/arch/arm/boot/dts/imx7-colibri.dtsi
17 +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
18 @@ -346,7 +346,7 @@
19 &iomuxc {
20 pinctrl-names = "default";
21 pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4
22 - &pinctrl_gpio7>;
23 + &pinctrl_gpio7 &pinctrl_usbc_det>;
24
25 pinctrl_gpio1: gpio1-grp {
26 fsl,pins = <
27 @@ -451,7 +451,6 @@
28
29 pinctrl_enet1: enet1grp {
30 fsl,pins = <
31 - MX7D_PAD_ENET1_CRS__GPIO7_IO14 0x14
32 MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x73
33 MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 0x73
34 MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 0x73
35 @@ -649,6 +648,12 @@
36 >;
37 };
38
39 + pinctrl_usbc_det: gpio-usbc-det {
40 + fsl,pins = <
41 + MX7D_PAD_ENET1_CRS__GPIO7_IO14 0x14
42 + >;
43 + };
44 +
45 pinctrl_usbh_reg: gpio-usbh-vbus {
46 fsl,pins = <
47 MX7D_PAD_UART3_CTS_B__GPIO4_IO7 0x14 /* SODIMM 129 USBH PEN */
48 diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
49 index 98cfe67b7db7..19b427f68dad 100644
50 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
51 +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
52 @@ -743,6 +743,7 @@
53 };
54
55 &usb3_phy0 {
56 + vbus-supply = <&reg_5v_p>;
57 status = "okay";
58 };
59
60 diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
61 index 354b11e27c07..033a48f30dbb 100644
62 --- a/arch/arm64/kernel/vdso.c
63 +++ b/arch/arm64/kernel/vdso.c
64 @@ -260,18 +260,7 @@ static int __aarch32_alloc_vdso_pages(void)
65 if (ret)
66 return ret;
67
68 - ret = aarch32_alloc_kuser_vdso_page();
69 - if (ret) {
70 - unsigned long c_vvar =
71 - (unsigned long)page_to_virt(aarch32_vdso_pages[C_VVAR]);
72 - unsigned long c_vdso =
73 - (unsigned long)page_to_virt(aarch32_vdso_pages[C_VDSO]);
74 -
75 - free_page(c_vvar);
76 - free_page(c_vdso);
77 - }
78 -
79 - return ret;
80 + return aarch32_alloc_kuser_vdso_page();
81 }
82 #else
83 static int __aarch32_alloc_vdso_pages(void)
84 diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h
85 index 209492849566..5c524d4f71cd 100644
86 --- a/arch/x86/include/asm/microcode_amd.h
87 +++ b/arch/x86/include/asm/microcode_amd.h
88 @@ -41,7 +41,7 @@ struct microcode_amd {
89 unsigned int mpb[0];
90 };
91
92 -#define PATCH_MAX_SIZE PAGE_SIZE
93 +#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
94
95 #ifdef CONFIG_MICROCODE_AMD
96 extern void __init load_ucode_amd_bsp(unsigned int family);
97 diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
98 index 89049b343c7a..d8cc5223b7ce 100644
99 --- a/arch/x86/kernel/cpu/resctrl/core.c
100 +++ b/arch/x86/kernel/cpu/resctrl/core.c
101 @@ -578,6 +578,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
102 d->id = id;
103 cpumask_set_cpu(cpu, &d->cpu_mask);
104
105 + rdt_domain_reconfigure_cdp(r);
106 +
107 if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
108 kfree(d);
109 return;
110 diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
111 index 181c992f448c..3dd13f3a8b23 100644
112 --- a/arch/x86/kernel/cpu/resctrl/internal.h
113 +++ b/arch/x86/kernel/cpu/resctrl/internal.h
114 @@ -601,5 +601,6 @@ bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d);
115 void __check_limbo(struct rdt_domain *d, bool force_free);
116 bool cbm_validate_intel(char *buf, u32 *data, struct rdt_resource *r);
117 bool cbm_validate_amd(char *buf, u32 *data, struct rdt_resource *r);
118 +void rdt_domain_reconfigure_cdp(struct rdt_resource *r);
119
120 #endif /* _ASM_X86_RESCTRL_INTERNAL_H */
121 diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
122 index 954fd048ad9b..20856d80dce3 100644
123 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
124 +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
125 @@ -1769,6 +1769,19 @@ static int set_cache_qos_cfg(int level, bool enable)
126 return 0;
127 }
128
129 +/* Restore the qos cfg state when a domain comes online */
130 +void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
131 +{
132 + if (!r->alloc_capable)
133 + return;
134 +
135 + if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA])
136 + l2_qos_cfg_update(&r->alloc_enabled);
137 +
138 + if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA])
139 + l3_qos_cfg_update(&r->alloc_enabled);
140 +}
141 +
142 /*
143 * Enable or disable the MBA software controller
144 * which helps user specify bandwidth in MBps.
145 @@ -2993,7 +3006,8 @@ static int rdtgroup_rmdir(struct kernfs_node *kn)
146 * If the rdtgroup is a mon group and parent directory
147 * is a valid "mon_groups" directory, remove the mon group.
148 */
149 - if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn) {
150 + if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn &&
151 + rdtgrp != &rdtgroup_default) {
152 if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP ||
153 rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) {
154 ret = rdtgroup_ctrl_remove(kn, rdtgrp);
155 diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
156 index ed2ecb00004f..5e6c8bfc6612 100644
157 --- a/drivers/acpi/ec.c
158 +++ b/drivers/acpi/ec.c
159 @@ -1573,6 +1573,7 @@ static int acpi_ec_add(struct acpi_device *device)
160
161 if (boot_ec && ec->command_addr == boot_ec->command_addr &&
162 ec->data_addr == boot_ec->data_addr) {
163 + boot_ec_is_ecdt = false;
164 /*
165 * Trust PNP0C09 namespace location rather than
166 * ECDT ID. But trust ECDT GPE rather than _GPE
167 @@ -1592,12 +1593,9 @@ static int acpi_ec_add(struct acpi_device *device)
168
169 if (ec == boot_ec)
170 acpi_handle_info(boot_ec->handle,
171 - "Boot %s EC initialization complete\n",
172 + "Boot %s EC used to handle transactions and events\n",
173 boot_ec_is_ecdt ? "ECDT" : "DSDT");
174
175 - acpi_handle_info(ec->handle,
176 - "EC: Used to handle transactions and events\n");
177 -
178 device->driver_data = ec;
179
180 ret = !!request_region(ec->data_addr, 1, "EC data");
181 diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
182 index 14e68f202f81..12d980aafc5f 100644
183 --- a/drivers/acpi/nfit/core.c
184 +++ b/drivers/acpi/nfit/core.c
185 @@ -360,7 +360,7 @@ static union acpi_object *acpi_label_info(acpi_handle handle)
186
187 static u8 nfit_dsm_revid(unsigned family, unsigned func)
188 {
189 - static const u8 revid_table[NVDIMM_FAMILY_MAX+1][32] = {
190 + static const u8 revid_table[NVDIMM_FAMILY_MAX+1][NVDIMM_CMD_MAX+1] = {
191 [NVDIMM_FAMILY_INTEL] = {
192 [NVDIMM_INTEL_GET_MODES] = 2,
193 [NVDIMM_INTEL_GET_FWINFO] = 2,
194 @@ -386,7 +386,7 @@ static u8 nfit_dsm_revid(unsigned family, unsigned func)
195
196 if (family > NVDIMM_FAMILY_MAX)
197 return 0;
198 - if (func > 31)
199 + if (func > NVDIMM_CMD_MAX)
200 return 0;
201 id = revid_table[family][func];
202 if (id == 0)
203 @@ -492,7 +492,8 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
204 * Check for a valid command. For ND_CMD_CALL, we also have to
205 * make sure that the DSM function is supported.
206 */
207 - if (cmd == ND_CMD_CALL && !test_bit(func, &dsm_mask))
208 + if (cmd == ND_CMD_CALL &&
209 + (func > NVDIMM_CMD_MAX || !test_bit(func, &dsm_mask)))
210 return -ENOTTY;
211 else if (!test_bit(cmd, &cmd_mask))
212 return -ENOTTY;
213 @@ -3499,7 +3500,8 @@ static int acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc,
214 if (nvdimm && cmd == ND_CMD_CALL &&
215 call_pkg->nd_family == NVDIMM_FAMILY_INTEL) {
216 func = call_pkg->nd_command;
217 - if ((1 << func) & NVDIMM_INTEL_SECURITY_CMDMASK)
218 + if (func > NVDIMM_CMD_MAX ||
219 + (1 << func) & NVDIMM_INTEL_SECURITY_CMDMASK)
220 return -EOPNOTSUPP;
221 }
222
223 diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
224 index 24241941181c..b317f4043705 100644
225 --- a/drivers/acpi/nfit/nfit.h
226 +++ b/drivers/acpi/nfit/nfit.h
227 @@ -34,6 +34,7 @@
228 | ACPI_NFIT_MEM_NOT_ARMED | ACPI_NFIT_MEM_MAP_FAILED)
229
230 #define NVDIMM_FAMILY_MAX NVDIMM_FAMILY_HYPERV
231 +#define NVDIMM_CMD_MAX 31
232
233 #define NVDIMM_STANDARD_CMDMASK \
234 (1 << ND_CMD_SMART | 1 << ND_CMD_SMART_THRESHOLD | 1 << ND_CMD_DIMM_FLAGS \
235 diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c
236 index 22aede42a336..bda92980e015 100644
237 --- a/drivers/clk/at91/clk-usb.c
238 +++ b/drivers/clk/at91/clk-usb.c
239 @@ -211,7 +211,7 @@ _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name,
240
241 usb->hw.init = &init;
242 usb->regmap = regmap;
243 - usb->usbs_mask = SAM9X5_USBS_MASK;
244 + usb->usbs_mask = usbs_mask;
245
246 hw = &usb->hw;
247 ret = clk_hw_register(NULL, &usb->hw);
248 diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
249 index 77398aefeb6d..7338a3bc71eb 100644
250 --- a/drivers/clk/at91/sam9x60.c
251 +++ b/drivers/clk/at91/sam9x60.c
252 @@ -237,9 +237,8 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
253
254 parent_names[0] = "pllack";
255 parent_names[1] = "upllck";
256 - parent_names[2] = "mainck";
257 - parent_names[3] = "mainck";
258 - hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, 4);
259 + parent_names[2] = "main_osc";
260 + hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, 3);
261 if (IS_ERR(hw))
262 goto err_free;
263
264 diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
265 index f423b5384705..630e8342d162 100644
266 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
267 +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
268 @@ -2176,6 +2176,8 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
269 {
270 int i, r;
271
272 + amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
273 + amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
274
275 for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
276 if (!adev->ip_blocks[i].status.valid)
277 diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
278 index 203ce4b1028f..e6da53e9c3f4 100644
279 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
280 +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
281 @@ -3805,9 +3805,12 @@ static int smu7_trim_single_dpm_states(struct pp_hwmgr *hwmgr,
282 {
283 uint32_t i;
284
285 + /* force the trim if mclk_switching is disabled to prevent flicker */
286 + bool force_trim = (low_limit == high_limit);
287 for (i = 0; i < dpm_table->count; i++) {
288 /*skip the trim if od is enabled*/
289 - if (!hwmgr->od_enabled && (dpm_table->dpm_levels[i].value < low_limit
290 + if ((!hwmgr->od_enabled || force_trim)
291 + && (dpm_table->dpm_levels[i].value < low_limit
292 || dpm_table->dpm_levels[i].value > high_limit))
293 dpm_table->dpm_levels[i].enabled = false;
294 else
295 diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
296 index 16dd338877d0..0c55c54372d7 100644
297 --- a/drivers/i2c/busses/i2c-designware-platdrv.c
298 +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
299 @@ -370,10 +370,16 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
300 adap->dev.of_node = pdev->dev.of_node;
301 adap->nr = -1;
302
303 - dev_pm_set_driver_flags(&pdev->dev,
304 - DPM_FLAG_SMART_PREPARE |
305 - DPM_FLAG_SMART_SUSPEND |
306 - DPM_FLAG_LEAVE_SUSPENDED);
307 + if (dev->flags & ACCESS_NO_IRQ_SUSPEND) {
308 + dev_pm_set_driver_flags(&pdev->dev,
309 + DPM_FLAG_SMART_PREPARE |
310 + DPM_FLAG_LEAVE_SUSPENDED);
311 + } else {
312 + dev_pm_set_driver_flags(&pdev->dev,
313 + DPM_FLAG_SMART_PREPARE |
314 + DPM_FLAG_SMART_SUSPEND |
315 + DPM_FLAG_LEAVE_SUSPENDED);
316 + }
317
318 /* The code below assumes runtime PM to be disabled. */
319 WARN_ON(pm_runtime_enabled(&pdev->dev));
320 diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c
321 index ef4d625d2d80..fa7488863bd0 100644
322 --- a/drivers/irqchip/irq-ti-sci-inta.c
323 +++ b/drivers/irqchip/irq-ti-sci-inta.c
324 @@ -37,6 +37,7 @@
325 #define VINT_ENABLE_SET_OFFSET 0x0
326 #define VINT_ENABLE_CLR_OFFSET 0x8
327 #define VINT_STATUS_OFFSET 0x18
328 +#define VINT_STATUS_MASKED_OFFSET 0x20
329
330 /**
331 * struct ti_sci_inta_event_desc - Description of an event coming to
332 @@ -116,7 +117,7 @@ static void ti_sci_inta_irq_handler(struct irq_desc *desc)
333 chained_irq_enter(irq_desc_get_chip(desc), desc);
334
335 val = readq_relaxed(inta->base + vint_desc->vint_id * 0x1000 +
336 - VINT_STATUS_OFFSET);
337 + VINT_STATUS_MASKED_OFFSET);
338
339 for_each_set_bit(bit, &val, MAX_EVENTS_PER_VINT) {
340 virq = irq_find_mapping(domain, vint_desc->events[bit].hwirq);
341 diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
342 index 8071c3fa3fb7..cffaf4fdd772 100644
343 --- a/drivers/net/dsa/mt7530.c
344 +++ b/drivers/net/dsa/mt7530.c
345 @@ -66,58 +66,6 @@ static const struct mt7530_mib_desc mt7530_mib[] = {
346 MIB_DESC(1, 0xb8, "RxArlDrop"),
347 };
348
349 -static int
350 -mt7623_trgmii_write(struct mt7530_priv *priv, u32 reg, u32 val)
351 -{
352 - int ret;
353 -
354 - ret = regmap_write(priv->ethernet, TRGMII_BASE(reg), val);
355 - if (ret < 0)
356 - dev_err(priv->dev,
357 - "failed to priv write register\n");
358 - return ret;
359 -}
360 -
361 -static u32
362 -mt7623_trgmii_read(struct mt7530_priv *priv, u32 reg)
363 -{
364 - int ret;
365 - u32 val;
366 -
367 - ret = regmap_read(priv->ethernet, TRGMII_BASE(reg), &val);
368 - if (ret < 0) {
369 - dev_err(priv->dev,
370 - "failed to priv read register\n");
371 - return ret;
372 - }
373 -
374 - return val;
375 -}
376 -
377 -static void
378 -mt7623_trgmii_rmw(struct mt7530_priv *priv, u32 reg,
379 - u32 mask, u32 set)
380 -{
381 - u32 val;
382 -
383 - val = mt7623_trgmii_read(priv, reg);
384 - val &= ~mask;
385 - val |= set;
386 - mt7623_trgmii_write(priv, reg, val);
387 -}
388 -
389 -static void
390 -mt7623_trgmii_set(struct mt7530_priv *priv, u32 reg, u32 val)
391 -{
392 - mt7623_trgmii_rmw(priv, reg, 0, val);
393 -}
394 -
395 -static void
396 -mt7623_trgmii_clear(struct mt7530_priv *priv, u32 reg, u32 val)
397 -{
398 - mt7623_trgmii_rmw(priv, reg, val, 0);
399 -}
400 -
401 static int
402 core_read_mmd_indirect(struct mt7530_priv *priv, int prtad, int devad)
403 {
404 @@ -530,27 +478,6 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, int mode)
405 for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
406 mt7530_rmw(priv, MT7530_TRGMII_RD(i),
407 RD_TAP_MASK, RD_TAP(16));
408 - else
409 - if (priv->id != ID_MT7621)
410 - mt7623_trgmii_set(priv, GSW_INTF_MODE,
411 - INTF_MODE_TRGMII);
412 -
413 - return 0;
414 -}
415 -
416 -static int
417 -mt7623_pad_clk_setup(struct dsa_switch *ds)
418 -{
419 - struct mt7530_priv *priv = ds->priv;
420 - int i;
421 -
422 - for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
423 - mt7623_trgmii_write(priv, GSW_TRGMII_TD_ODT(i),
424 - TD_DM_DRVP(8) | TD_DM_DRVN(8));
425 -
426 - mt7623_trgmii_set(priv, GSW_TRGMII_RCK_CTRL, RX_RST | RXC_DQSISEL);
427 - mt7623_trgmii_clear(priv, GSW_TRGMII_RCK_CTRL, RX_RST);
428 -
429 return 0;
430 }
431
432 @@ -857,8 +784,9 @@ mt7530_port_set_vlan_unaware(struct dsa_switch *ds, int port)
433 */
434 mt7530_rmw(priv, MT7530_PCR_P(port), PCR_PORT_VLAN_MASK,
435 MT7530_PORT_MATRIX_MODE);
436 - mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK,
437 - VLAN_ATTR(MT7530_VLAN_TRANSPARENT));
438 + mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK,
439 + VLAN_ATTR(MT7530_VLAN_TRANSPARENT) |
440 + PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
441
442 for (i = 0; i < MT7530_NUM_PORTS; i++) {
443 if (dsa_is_user_port(ds, i) &&
444 @@ -874,8 +802,8 @@ mt7530_port_set_vlan_unaware(struct dsa_switch *ds, int port)
445 if (all_user_ports_removed) {
446 mt7530_write(priv, MT7530_PCR_P(MT7530_CPU_PORT),
447 PCR_MATRIX(dsa_user_ports(priv->ds)));
448 - mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT),
449 - PORT_SPEC_TAG);
450 + mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT), PORT_SPEC_TAG
451 + | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
452 }
453 }
454
455 @@ -901,8 +829,9 @@ mt7530_port_set_vlan_aware(struct dsa_switch *ds, int port)
456 /* Set the port as a user port which is to be able to recognize VID
457 * from incoming packets before fetching entry within the VLAN table.
458 */
459 - mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK,
460 - VLAN_ATTR(MT7530_VLAN_USER));
461 + mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK,
462 + VLAN_ATTR(MT7530_VLAN_USER) |
463 + PVC_EG_TAG(MT7530_VLAN_EG_DISABLED));
464 }
465
466 static void
467 @@ -1255,10 +1184,6 @@ mt7530_setup(struct dsa_switch *ds)
468 dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent;
469
470 if (priv->id == ID_MT7530) {
471 - priv->ethernet = syscon_node_to_regmap(dn);
472 - if (IS_ERR(priv->ethernet))
473 - return PTR_ERR(priv->ethernet);
474 -
475 regulator_set_voltage(priv->core_pwr, 1000000, 1000000);
476 ret = regulator_enable(priv->core_pwr);
477 if (ret < 0) {
478 @@ -1332,6 +1257,10 @@ mt7530_setup(struct dsa_switch *ds)
479 mt7530_cpu_port_enable(priv, i);
480 else
481 mt7530_port_disable(ds, i);
482 +
483 + /* Enable consistent egress tag */
484 + mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK,
485 + PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
486 }
487
488 /* Setup port 5 */
489 @@ -1416,14 +1345,6 @@ static void mt7530_phylink_mac_config(struct dsa_switch *ds, int port,
490 /* Setup TX circuit incluing relevant PAD and driving */
491 mt7530_pad_clk_setup(ds, state->interface);
492
493 - if (priv->id == ID_MT7530) {
494 - /* Setup RX circuit, relevant PAD and driving on the
495 - * host which must be placed after the setup on the
496 - * device side is all finished.
497 - */
498 - mt7623_pad_clk_setup(ds);
499 - }
500 -
501 priv->p6_interface = state->interface;
502 break;
503 default:
504 diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
505 index ccb9da8cad0d..756140b7dfd5 100644
506 --- a/drivers/net/dsa/mt7530.h
507 +++ b/drivers/net/dsa/mt7530.h
508 @@ -167,9 +167,16 @@ enum mt7530_port_mode {
509 /* Register for port vlan control */
510 #define MT7530_PVC_P(x) (0x2010 + ((x) * 0x100))
511 #define PORT_SPEC_TAG BIT(5)
512 +#define PVC_EG_TAG(x) (((x) & 0x7) << 8)
513 +#define PVC_EG_TAG_MASK PVC_EG_TAG(7)
514 #define VLAN_ATTR(x) (((x) & 0x3) << 6)
515 #define VLAN_ATTR_MASK VLAN_ATTR(3)
516
517 +enum mt7530_vlan_port_eg_tag {
518 + MT7530_VLAN_EG_DISABLED = 0,
519 + MT7530_VLAN_EG_CONSISTENT = 1,
520 +};
521 +
522 enum mt7530_vlan_port_attr {
523 MT7530_VLAN_USER = 0,
524 MT7530_VLAN_TRANSPARENT = 3,
525 @@ -268,7 +275,6 @@ enum mt7530_vlan_port_attr {
526
527 /* Registers for TRGMII on the both side */
528 #define MT7530_TRGMII_RCK_CTRL 0x7a00
529 -#define GSW_TRGMII_RCK_CTRL 0x300
530 #define RX_RST BIT(31)
531 #define RXC_DQSISEL BIT(30)
532 #define DQSI1_TAP_MASK (0x7f << 8)
533 @@ -277,31 +283,24 @@ enum mt7530_vlan_port_attr {
534 #define DQSI0_TAP(x) ((x) & 0x7f)
535
536 #define MT7530_TRGMII_RCK_RTT 0x7a04
537 -#define GSW_TRGMII_RCK_RTT 0x304
538 #define DQS1_GATE BIT(31)
539 #define DQS0_GATE BIT(30)
540
541 #define MT7530_TRGMII_RD(x) (0x7a10 + (x) * 8)
542 -#define GSW_TRGMII_RD(x) (0x310 + (x) * 8)
543 #define BSLIP_EN BIT(31)
544 #define EDGE_CHK BIT(30)
545 #define RD_TAP_MASK 0x7f
546 #define RD_TAP(x) ((x) & 0x7f)
547
548 -#define GSW_TRGMII_TXCTRL 0x340
549 #define MT7530_TRGMII_TXCTRL 0x7a40
550 #define TRAIN_TXEN BIT(31)
551 #define TXC_INV BIT(30)
552 #define TX_RST BIT(28)
553
554 #define MT7530_TRGMII_TD_ODT(i) (0x7a54 + 8 * (i))
555 -#define GSW_TRGMII_TD_ODT(i) (0x354 + 8 * (i))
556 #define TD_DM_DRVP(x) ((x) & 0xf)
557 #define TD_DM_DRVN(x) (((x) & 0xf) << 4)
558
559 -#define GSW_INTF_MODE 0x390
560 -#define INTF_MODE_TRGMII BIT(1)
561 -
562 #define MT7530_TRGMII_TCK_CTRL 0x7a78
563 #define TCK_TAP(x) (((x) & 0xf) << 8)
564
565 @@ -434,7 +433,6 @@ static const char *p5_intf_modes(unsigned int p5_interface)
566 * @ds: The pointer to the dsa core structure
567 * @bus: The bus used for the device and built-in PHY
568 * @rstc: The pointer to reset control used by MCM
569 - * @ethernet: The regmap used for access TRGMII-based registers
570 * @core_pwr: The power supplied into the core
571 * @io_pwr: The power supplied into the I/O
572 * @reset: The descriptor for GPIO line tied to its reset pin
573 @@ -451,7 +449,6 @@ struct mt7530_priv {
574 struct dsa_switch *ds;
575 struct mii_bus *bus;
576 struct reset_control *rstc;
577 - struct regmap *ethernet;
578 struct regulator *core_pwr;
579 struct regulator *io_pwr;
580 struct gpio_desc *reset;
581 diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
582 index 98f8f2033154..3bd20f765120 100644
583 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
584 +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
585 @@ -514,7 +514,7 @@ static void xgbe_isr_task(unsigned long data)
586 xgbe_disable_rx_tx_ints(pdata);
587
588 /* Turn on polling */
589 - __napi_schedule_irqoff(&pdata->napi);
590 + __napi_schedule(&pdata->napi);
591 }
592 } else {
593 /* Don't clear Rx/Tx status if doing per channel DMA
594 diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
595 index 703adb96429e..997dc811382a 100644
596 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
597 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
598 @@ -65,6 +65,17 @@ u32 mtk_r32(struct mtk_eth *eth, unsigned reg)
599 return __raw_readl(eth->base + reg);
600 }
601
602 +u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned reg)
603 +{
604 + u32 val;
605 +
606 + val = mtk_r32(eth, reg);
607 + val &= ~mask;
608 + val |= set;
609 + mtk_w32(eth, val, reg);
610 + return reg;
611 +}
612 +
613 static int mtk_mdio_busy_wait(struct mtk_eth *eth)
614 {
615 unsigned long t_start = jiffies;
616 @@ -193,7 +204,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
617 struct mtk_mac *mac = container_of(config, struct mtk_mac,
618 phylink_config);
619 struct mtk_eth *eth = mac->hw;
620 - u32 mcr_cur, mcr_new, sid;
621 + u32 mcr_cur, mcr_new, sid, i;
622 int val, ge_mode, err;
623
624 /* MT76x8 has no hardware settings between for the MAC */
625 @@ -255,6 +266,17 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
626 PHY_INTERFACE_MODE_TRGMII)
627 mtk_gmac0_rgmii_adjust(mac->hw,
628 state->speed);
629 +
630 + /* mt7623_pad_clk_setup */
631 + for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
632 + mtk_w32(mac->hw,
633 + TD_DM_DRVP(8) | TD_DM_DRVN(8),
634 + TRGMII_TD_ODT(i));
635 +
636 + /* Assert/release MT7623 RXC reset */
637 + mtk_m32(mac->hw, 0, RXC_RST | RXC_DQSISEL,
638 + TRGMII_RCK_CTRL);
639 + mtk_m32(mac->hw, RXC_RST, 0, TRGMII_RCK_CTRL);
640 }
641 }
642
643 diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
644 index 76bd12cb8150..1e787f3577aa 100644
645 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
646 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
647 @@ -350,10 +350,13 @@
648 #define DQSI0(x) ((x << 0) & GENMASK(6, 0))
649 #define DQSI1(x) ((x << 8) & GENMASK(14, 8))
650 #define RXCTL_DMWTLAT(x) ((x << 16) & GENMASK(18, 16))
651 +#define RXC_RST BIT(31)
652 #define RXC_DQSISEL BIT(30)
653 #define RCK_CTRL_RGMII_1000 (RXC_DQSISEL | RXCTL_DMWTLAT(2) | DQSI1(16))
654 #define RCK_CTRL_RGMII_10_100 RXCTL_DMWTLAT(2)
655
656 +#define NUM_TRGMII_CTRL 5
657 +
658 /* TRGMII RXC control register */
659 #define TRGMII_TCK_CTRL 0x10340
660 #define TXCTL_DMWTLAT(x) ((x << 16) & GENMASK(18, 16))
661 @@ -361,6 +364,11 @@
662 #define TCK_CTRL_RGMII_1000 TXCTL_DMWTLAT(2)
663 #define TCK_CTRL_RGMII_10_100 (TXC_INV | TXCTL_DMWTLAT(2))
664
665 +/* TRGMII TX Drive Strength */
666 +#define TRGMII_TD_ODT(i) (0x10354 + 8 * (i))
667 +#define TD_DM_DRVP(x) ((x) & 0xf)
668 +#define TD_DM_DRVN(x) (((x) & 0xf) << 4)
669 +
670 /* TRGMII Interface mode register */
671 #define INTF_MODE 0x10390
672 #define TRGMII_INTF_DIS BIT(0)
673 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
674 index 381925c90d94..d63ce3feb65c 100644
675 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
676 +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
677 @@ -23,7 +23,10 @@ static int mlx5_devlink_flash_update(struct devlink *devlink,
678 if (err)
679 return err;
680
681 - return mlx5_firmware_flash(dev, fw, extack);
682 + err = mlx5_firmware_flash(dev, fw, extack);
683 + release_firmware(fw);
684 +
685 + return err;
686 }
687
688 static u8 mlx5_fw_ver_major(u32 version)
689 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
690 index 55ceabf077b2..11426f94c90c 100644
691 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
692 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
693 @@ -1035,14 +1035,15 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
694 struct mlx5e_channels *chs);
695 void mlx5e_close_channels(struct mlx5e_channels *chs);
696
697 -/* Function pointer to be used to modify WH settings while
698 +/* Function pointer to be used to modify HW or kernel settings while
699 * switching channels
700 */
701 -typedef int (*mlx5e_fp_hw_modify)(struct mlx5e_priv *priv);
702 +typedef int (*mlx5e_fp_preactivate)(struct mlx5e_priv *priv);
703 int mlx5e_safe_reopen_channels(struct mlx5e_priv *priv);
704 int mlx5e_safe_switch_channels(struct mlx5e_priv *priv,
705 struct mlx5e_channels *new_chs,
706 - mlx5e_fp_hw_modify hw_modify);
707 + mlx5e_fp_preactivate preactivate);
708 +int mlx5e_num_channels_changed(struct mlx5e_priv *priv);
709 void mlx5e_activate_priv_channels(struct mlx5e_priv *priv);
710 void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv);
711
712 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
713 index c6776f308d5e..304ddce6b087 100644
714 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
715 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
716 @@ -445,9 +445,7 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv,
717
718 if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
719 *cur_params = new_channels.params;
720 - if (!netif_is_rxfh_configured(priv->netdev))
721 - mlx5e_build_default_indir_rqt(priv->rss_params.indirection_rqt,
722 - MLX5E_INDIR_RQT_SIZE, count);
723 + mlx5e_num_channels_changed(priv);
724 goto out;
725 }
726
727 @@ -455,12 +453,8 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv,
728 if (arfs_enabled)
729 mlx5e_arfs_disable(priv);
730
731 - if (!netif_is_rxfh_configured(priv->netdev))
732 - mlx5e_build_default_indir_rqt(priv->rss_params.indirection_rqt,
733 - MLX5E_INDIR_RQT_SIZE, count);
734 -
735 /* Switch to new channels, set new parameters and close old ones */
736 - err = mlx5e_safe_switch_channels(priv, &new_channels, NULL);
737 + err = mlx5e_safe_switch_channels(priv, &new_channels, mlx5e_num_channels_changed);
738
739 if (arfs_enabled) {
740 int err2 = mlx5e_arfs_enable(priv);
741 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
742 index ee7c753e9ea0..88ea279c29bb 100644
743 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
744 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
745 @@ -2897,6 +2897,28 @@ static void mlx5e_netdev_set_tcs(struct net_device *netdev)
746 netdev_set_tc_queue(netdev, tc, nch, 0);
747 }
748
749 +static void mlx5e_update_netdev_queues(struct mlx5e_priv *priv)
750 +{
751 + int num_txqs = priv->channels.num * priv->channels.params.num_tc;
752 + int num_rxqs = priv->channels.num * priv->profile->rq_groups;
753 + struct net_device *netdev = priv->netdev;
754 +
755 + mlx5e_netdev_set_tcs(netdev);
756 + netif_set_real_num_tx_queues(netdev, num_txqs);
757 + netif_set_real_num_rx_queues(netdev, num_rxqs);
758 +}
759 +
760 +int mlx5e_num_channels_changed(struct mlx5e_priv *priv)
761 +{
762 + u16 count = priv->channels.params.num_channels;
763 +
764 + if (!netif_is_rxfh_configured(priv->netdev))
765 + mlx5e_build_default_indir_rqt(priv->rss_params.indirection_rqt,
766 + MLX5E_INDIR_RQT_SIZE, count);
767 +
768 + return 0;
769 +}
770 +
771 static void mlx5e_build_txq_maps(struct mlx5e_priv *priv)
772 {
773 int i, ch;
774 @@ -2918,13 +2940,7 @@ static void mlx5e_build_txq_maps(struct mlx5e_priv *priv)
775
776 void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)
777 {
778 - int num_txqs = priv->channels.num * priv->channels.params.num_tc;
779 - int num_rxqs = priv->channels.num * priv->profile->rq_groups;
780 - struct net_device *netdev = priv->netdev;
781 -
782 - mlx5e_netdev_set_tcs(netdev);
783 - netif_set_real_num_tx_queues(netdev, num_txqs);
784 - netif_set_real_num_rx_queues(netdev, num_rxqs);
785 + mlx5e_update_netdev_queues(priv);
786
787 mlx5e_build_txq_maps(priv);
788 mlx5e_activate_channels(&priv->channels);
789 @@ -2960,7 +2976,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv)
790
791 static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
792 struct mlx5e_channels *new_chs,
793 - mlx5e_fp_hw_modify hw_modify)
794 + mlx5e_fp_preactivate preactivate)
795 {
796 struct net_device *netdev = priv->netdev;
797 int new_num_txqs;
798 @@ -2979,9 +2995,11 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
799
800 priv->channels = *new_chs;
801
802 - /* New channels are ready to roll, modify HW settings if needed */
803 - if (hw_modify)
804 - hw_modify(priv);
805 + /* New channels are ready to roll, call the preactivate hook if needed
806 + * to modify HW settings or update kernel parameters.
807 + */
808 + if (preactivate)
809 + preactivate(priv);
810
811 priv->profile->update_rx(priv);
812 mlx5e_activate_priv_channels(priv);
813 @@ -2993,7 +3011,7 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
814
815 int mlx5e_safe_switch_channels(struct mlx5e_priv *priv,
816 struct mlx5e_channels *new_chs,
817 - mlx5e_fp_hw_modify hw_modify)
818 + mlx5e_fp_preactivate preactivate)
819 {
820 int err;
821
822 @@ -3001,7 +3019,7 @@ int mlx5e_safe_switch_channels(struct mlx5e_priv *priv,
823 if (err)
824 return err;
825
826 - mlx5e_switch_priv_channels(priv, new_chs, hw_modify);
827 + mlx5e_switch_priv_channels(priv, new_chs, preactivate);
828 return 0;
829 }
830
831 @@ -5308,9 +5326,10 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
832 max_nch = mlx5e_get_max_num_channels(priv->mdev);
833 if (priv->channels.params.num_channels > max_nch) {
834 mlx5_core_warn(priv->mdev, "MLX5E: Reducing number of channels to %d\n", max_nch);
835 + /* Reducing the number of channels - RXFH has to be reset. */
836 + priv->netdev->priv_flags &= ~IFF_RXFH_CONFIGURED;
837 priv->channels.params.num_channels = max_nch;
838 - mlx5e_build_default_indir_rqt(priv->rss_params.indirection_rqt,
839 - MLX5E_INDIR_RQT_SIZE, max_nch);
840 + mlx5e_num_channels_changed(priv);
841 }
842
843 err = profile->init_tx(priv);
844 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
845 index cd9bb7c7b341..fddf644ba349 100644
846 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
847 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
848 @@ -1814,29 +1814,30 @@ static int register_devlink_port(struct mlx5_core_dev *dev,
849 struct mlx5_eswitch_rep *rep = rpriv->rep;
850 struct netdev_phys_item_id ppid = {};
851 unsigned int dl_port_index = 0;
852 + u16 pfnum;
853
854 if (!is_devlink_port_supported(dev, rpriv))
855 return 0;
856
857 mlx5e_rep_get_port_parent_id(rpriv->netdev, &ppid);
858 + pfnum = PCI_FUNC(dev->pdev->devfn);
859
860 if (rep->vport == MLX5_VPORT_UPLINK) {
861 devlink_port_attrs_set(&rpriv->dl_port,
862 DEVLINK_PORT_FLAVOUR_PHYSICAL,
863 - PCI_FUNC(dev->pdev->devfn), false, 0,
864 + pfnum, false, 0,
865 &ppid.id[0], ppid.id_len);
866 dl_port_index = vport_to_devlink_port_index(dev, rep->vport);
867 } else if (rep->vport == MLX5_VPORT_PF) {
868 devlink_port_attrs_pci_pf_set(&rpriv->dl_port,
869 &ppid.id[0], ppid.id_len,
870 - dev->pdev->devfn);
871 + pfnum);
872 dl_port_index = rep->vport;
873 } else if (mlx5_eswitch_is_vf_vport(dev->priv.eswitch,
874 rpriv->rep->vport)) {
875 devlink_port_attrs_pci_vf_set(&rpriv->dl_port,
876 &ppid.id[0], ppid.id_len,
877 - dev->pdev->devfn,
878 - rep->vport - 1);
879 + pfnum, rep->vport - 1);
880 dl_port_index = vport_to_devlink_port_index(dev, rep->vport);
881 }
882
883 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
884 index 1f9107d83848..ec117e441425 100644
885 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
886 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
887 @@ -3181,12 +3181,13 @@ static int add_vlan_pop_action(struct mlx5e_priv *priv,
888 struct mlx5_esw_flow_attr *attr,
889 u32 *action)
890 {
891 - int nest_level = attr->parse_attr->filter_dev->lower_level;
892 struct flow_action_entry vlan_act = {
893 .id = FLOW_ACTION_VLAN_POP,
894 };
895 - int err = 0;
896 + int nest_level, err = 0;
897
898 + nest_level = attr->parse_attr->filter_dev->lower_level -
899 + priv->netdev->lower_level;
900 while (nest_level--) {
901 err = parse_tc_vlan_action(priv, &vlan_act, attr, action);
902 if (err)
903 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
904 index c07f3154437c..f63beb399837 100644
905 --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
906 +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
907 @@ -243,7 +243,7 @@ recover_from_sw_reset:
908 if (mlx5_get_nic_state(dev) == MLX5_NIC_IFC_DISABLED)
909 break;
910
911 - cond_resched();
912 + msleep(20);
913 } while (!time_after(jiffies, end));
914
915 if (mlx5_get_nic_state(dev) != MLX5_NIC_IFC_DISABLED) {
916 diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
917 index 102d637bc84a..65a3e3b5face 100644
918 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
919 +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
920 @@ -146,6 +146,8 @@ static int sun7i_gmac_probe(struct platform_device *pdev)
921 plat_dat->init = sun7i_gmac_init;
922 plat_dat->exit = sun7i_gmac_exit;
923 plat_dat->fix_mac_speed = sun7i_fix_speed;
924 + plat_dat->tx_fifo_size = 4096;
925 + plat_dat->rx_fifo_size = 16384;
926
927 ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv);
928 if (ret)
929 diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
930 index 51b64f087717..663c68ed6ef9 100644
931 --- a/drivers/net/phy/micrel.c
932 +++ b/drivers/net/phy/micrel.c
933 @@ -1154,7 +1154,7 @@ static struct phy_driver ksphy_driver[] = {
934 .driver_data = &ksz9021_type,
935 .probe = kszphy_probe,
936 .config_init = ksz9131_config_init,
937 - .read_status = ksz9031_read_status,
938 + .read_status = genphy_read_status,
939 .ack_interrupt = kszphy_ack_interrupt,
940 .config_intr = kszphy_config_intr,
941 .get_sset_count = kszphy_get_sset_count,
942 diff --git a/drivers/net/tun.c b/drivers/net/tun.c
943 index 16f5cb249ed5..6e9a59e3d822 100644
944 --- a/drivers/net/tun.c
945 +++ b/drivers/net/tun.c
946 @@ -1925,6 +1925,7 @@ drop:
947
948 skb_reset_network_header(skb);
949 skb_probe_transport_header(skb);
950 + skb_record_rx_queue(skb, tfile->queue_index);
951
952 if (skb_xdp) {
953 struct bpf_prog *xdp_prog;
954 @@ -2492,6 +2493,7 @@ build:
955 skb->protocol = eth_type_trans(skb, tun->dev);
956 skb_reset_network_header(skb);
957 skb_probe_transport_header(skb);
958 + skb_record_rx_queue(skb, tfile->queue_index);
959
960 if (skb_xdp) {
961 err = do_xdp_generic(xdp_prog, skb);
962 @@ -2503,7 +2505,6 @@ build:
963 !tfile->detached)
964 rxhash = __skb_get_hash_symmetric(skb);
965
966 - skb_record_rx_queue(skb, tfile->queue_index);
967 netif_receive_skb(skb);
968
969 /* No need for get_cpu_ptr() here since this function is
970 diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
971 index 14f562cd715c..c48c68090d76 100644
972 --- a/drivers/net/wireless/mac80211_hwsim.c
973 +++ b/drivers/net/wireless/mac80211_hwsim.c
974 @@ -3575,9 +3575,9 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
975 }
976
977 if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
978 - hwname = kasprintf(GFP_KERNEL, "%.*s",
979 - nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
980 - (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
981 + hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
982 + nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
983 + GFP_KERNEL);
984 if (!hwname)
985 return -ENOMEM;
986 param.hwname = hwname;
987 @@ -3597,9 +3597,9 @@ static int hwsim_del_radio_nl(struct sk_buff *msg, struct genl_info *info)
988 if (info->attrs[HWSIM_ATTR_RADIO_ID]) {
989 idx = nla_get_u32(info->attrs[HWSIM_ATTR_RADIO_ID]);
990 } else if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
991 - hwname = kasprintf(GFP_KERNEL, "%.*s",
992 - nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
993 - (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
994 + hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
995 + nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
996 + GFP_KERNEL);
997 if (!hwname)
998 return -ENOMEM;
999 } else
1000 diff --git a/drivers/platform/chrome/cros_ec_rpmsg.c b/drivers/platform/chrome/cros_ec_rpmsg.c
1001 index 0c3738c3244d..aa2059b33ba5 100644
1002 --- a/drivers/platform/chrome/cros_ec_rpmsg.c
1003 +++ b/drivers/platform/chrome/cros_ec_rpmsg.c
1004 @@ -42,6 +42,8 @@ struct cros_ec_rpmsg {
1005 struct completion xfer_ack;
1006 struct work_struct host_event_work;
1007 struct rpmsg_endpoint *ept;
1008 + bool has_pending_host_event;
1009 + bool probe_done;
1010 };
1011
1012 /**
1013 @@ -186,7 +188,14 @@ static int cros_ec_rpmsg_callback(struct rpmsg_device *rpdev, void *data,
1014 memcpy(ec_dev->din, resp->data, len);
1015 complete(&ec_rpmsg->xfer_ack);
1016 } else if (resp->type == HOST_EVENT_MARK) {
1017 - schedule_work(&ec_rpmsg->host_event_work);
1018 + /*
1019 + * If the host event is sent before cros_ec_register is
1020 + * finished, queue the host event.
1021 + */
1022 + if (ec_rpmsg->probe_done)
1023 + schedule_work(&ec_rpmsg->host_event_work);
1024 + else
1025 + ec_rpmsg->has_pending_host_event = true;
1026 } else {
1027 dev_warn(ec_dev->dev, "rpmsg received invalid type = %d",
1028 resp->type);
1029 @@ -249,6 +258,11 @@ static int cros_ec_rpmsg_probe(struct rpmsg_device *rpdev)
1030 return ret;
1031 }
1032
1033 + ec_rpmsg->probe_done = true;
1034 +
1035 + if (ec_rpmsg->has_pending_host_event)
1036 + schedule_work(&ec_rpmsg->host_event_work);
1037 +
1038 return 0;
1039 }
1040
1041 diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c
1042 index b07bdca3d510..590375be5214 100644
1043 --- a/drivers/pwm/pwm-pca9685.c
1044 +++ b/drivers/pwm/pwm-pca9685.c
1045 @@ -20,6 +20,7 @@
1046 #include <linux/slab.h>
1047 #include <linux/delay.h>
1048 #include <linux/pm_runtime.h>
1049 +#include <linux/bitmap.h>
1050
1051 /*
1052 * Because the PCA9685 has only one prescaler per chip, changing the period of
1053 @@ -74,6 +75,7 @@ struct pca9685 {
1054 #if IS_ENABLED(CONFIG_GPIOLIB)
1055 struct mutex lock;
1056 struct gpio_chip gpio;
1057 + DECLARE_BITMAP(pwms_inuse, PCA9685_MAXCHAN + 1);
1058 #endif
1059 };
1060
1061 @@ -83,51 +85,51 @@ static inline struct pca9685 *to_pca(struct pwm_chip *chip)
1062 }
1063
1064 #if IS_ENABLED(CONFIG_GPIOLIB)
1065 -static int pca9685_pwm_gpio_request(struct gpio_chip *gpio, unsigned int offset)
1066 +static bool pca9685_pwm_test_and_set_inuse(struct pca9685 *pca, int pwm_idx)
1067 {
1068 - struct pca9685 *pca = gpiochip_get_data(gpio);
1069 - struct pwm_device *pwm;
1070 + bool is_inuse;
1071
1072 mutex_lock(&pca->lock);
1073 -
1074 - pwm = &pca->chip.pwms[offset];
1075 -
1076 - if (pwm->flags & (PWMF_REQUESTED | PWMF_EXPORTED)) {
1077 - mutex_unlock(&pca->lock);
1078 - return -EBUSY;
1079 + if (pwm_idx >= PCA9685_MAXCHAN) {
1080 + /*
1081 + * "all LEDs" channel:
1082 + * pretend already in use if any of the PWMs are requested
1083 + */
1084 + if (!bitmap_empty(pca->pwms_inuse, PCA9685_MAXCHAN)) {
1085 + is_inuse = true;
1086 + goto out;
1087 + }
1088 + } else {
1089 + /*
1090 + * regular channel:
1091 + * pretend already in use if the "all LEDs" channel is requested
1092 + */
1093 + if (test_bit(PCA9685_MAXCHAN, pca->pwms_inuse)) {
1094 + is_inuse = true;
1095 + goto out;
1096 + }
1097 }
1098 -
1099 - pwm_set_chip_data(pwm, (void *)1);
1100 -
1101 + is_inuse = test_and_set_bit(pwm_idx, pca->pwms_inuse);
1102 +out:
1103 mutex_unlock(&pca->lock);
1104 - pm_runtime_get_sync(pca->chip.dev);
1105 - return 0;
1106 + return is_inuse;
1107 }
1108
1109 -static bool pca9685_pwm_is_gpio(struct pca9685 *pca, struct pwm_device *pwm)
1110 +static void pca9685_pwm_clear_inuse(struct pca9685 *pca, int pwm_idx)
1111 {
1112 - bool is_gpio = false;
1113 -
1114 mutex_lock(&pca->lock);
1115 + clear_bit(pwm_idx, pca->pwms_inuse);
1116 + mutex_unlock(&pca->lock);
1117 +}
1118
1119 - if (pwm->hwpwm >= PCA9685_MAXCHAN) {
1120 - unsigned int i;
1121 -
1122 - /*
1123 - * Check if any of the GPIOs are requested and in that case
1124 - * prevent using the "all LEDs" channel.
1125 - */
1126 - for (i = 0; i < pca->gpio.ngpio; i++)
1127 - if (gpiochip_is_requested(&pca->gpio, i)) {
1128 - is_gpio = true;
1129 - break;
1130 - }
1131 - } else if (pwm_get_chip_data(pwm)) {
1132 - is_gpio = true;
1133 - }
1134 +static int pca9685_pwm_gpio_request(struct gpio_chip *gpio, unsigned int offset)
1135 +{
1136 + struct pca9685 *pca = gpiochip_get_data(gpio);
1137
1138 - mutex_unlock(&pca->lock);
1139 - return is_gpio;
1140 + if (pca9685_pwm_test_and_set_inuse(pca, offset))
1141 + return -EBUSY;
1142 + pm_runtime_get_sync(pca->chip.dev);
1143 + return 0;
1144 }
1145
1146 static int pca9685_pwm_gpio_get(struct gpio_chip *gpio, unsigned int offset)
1147 @@ -162,6 +164,7 @@ static void pca9685_pwm_gpio_free(struct gpio_chip *gpio, unsigned int offset)
1148
1149 pca9685_pwm_gpio_set(gpio, offset, 0);
1150 pm_runtime_put(pca->chip.dev);
1151 + pca9685_pwm_clear_inuse(pca, offset);
1152 }
1153
1154 static int pca9685_pwm_gpio_get_direction(struct gpio_chip *chip,
1155 @@ -213,12 +216,17 @@ static int pca9685_pwm_gpio_probe(struct pca9685 *pca)
1156 return devm_gpiochip_add_data(dev, &pca->gpio, pca);
1157 }
1158 #else
1159 -static inline bool pca9685_pwm_is_gpio(struct pca9685 *pca,
1160 - struct pwm_device *pwm)
1161 +static inline bool pca9685_pwm_test_and_set_inuse(struct pca9685 *pca,
1162 + int pwm_idx)
1163 {
1164 return false;
1165 }
1166
1167 +static inline void
1168 +pca9685_pwm_clear_inuse(struct pca9685 *pca, int pwm_idx)
1169 +{
1170 +}
1171 +
1172 static inline int pca9685_pwm_gpio_probe(struct pca9685 *pca)
1173 {
1174 return 0;
1175 @@ -402,7 +410,7 @@ static int pca9685_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
1176 {
1177 struct pca9685 *pca = to_pca(chip);
1178
1179 - if (pca9685_pwm_is_gpio(pca, pwm))
1180 + if (pca9685_pwm_test_and_set_inuse(pca, pwm->hwpwm))
1181 return -EBUSY;
1182 pm_runtime_get_sync(chip->dev);
1183
1184 @@ -411,8 +419,11 @@ static int pca9685_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
1185
1186 static void pca9685_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
1187 {
1188 + struct pca9685 *pca = to_pca(chip);
1189 +
1190 pca9685_pwm_disable(chip, pwm);
1191 pm_runtime_put(chip->dev);
1192 + pca9685_pwm_clear_inuse(pca, pwm->hwpwm);
1193 }
1194
1195 static const struct pwm_ops pca9685_pwm_ops = {
1196 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
1197 index a6863b51a1d0..13ab1494c384 100644
1198 --- a/drivers/scsi/ufs/ufshcd.c
1199 +++ b/drivers/scsi/ufs/ufshcd.c
1200 @@ -1539,6 +1539,11 @@ start:
1201 */
1202 if (ufshcd_can_hibern8_during_gating(hba) &&
1203 ufshcd_is_link_hibern8(hba)) {
1204 + if (async) {
1205 + rc = -EAGAIN;
1206 + hba->clk_gating.active_reqs--;
1207 + break;
1208 + }
1209 spin_unlock_irqrestore(hba->host->host_lock, flags);
1210 flush_work(&hba->clk_gating.ungate_work);
1211 spin_lock_irqsave(hba->host->host_lock, flags);
1212 diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
1213 index d19e051f2bc2..d1ce94c608a9 100644
1214 --- a/drivers/target/iscsi/iscsi_target.c
1215 +++ b/drivers/target/iscsi/iscsi_target.c
1216 @@ -4303,30 +4303,37 @@ int iscsit_close_connection(
1217 if (!atomic_read(&sess->session_reinstatement) &&
1218 atomic_read(&sess->session_fall_back_to_erl0)) {
1219 spin_unlock_bh(&sess->conn_lock);
1220 + complete_all(&sess->session_wait_comp);
1221 iscsit_close_session(sess);
1222
1223 return 0;
1224 } else if (atomic_read(&sess->session_logout)) {
1225 pr_debug("Moving to TARG_SESS_STATE_FREE.\n");
1226 sess->session_state = TARG_SESS_STATE_FREE;
1227 - spin_unlock_bh(&sess->conn_lock);
1228
1229 - if (atomic_read(&sess->sleep_on_sess_wait_comp))
1230 - complete(&sess->session_wait_comp);
1231 + if (atomic_read(&sess->session_close)) {
1232 + spin_unlock_bh(&sess->conn_lock);
1233 + complete_all(&sess->session_wait_comp);
1234 + iscsit_close_session(sess);
1235 + } else {
1236 + spin_unlock_bh(&sess->conn_lock);
1237 + }
1238
1239 return 0;
1240 } else {
1241 pr_debug("Moving to TARG_SESS_STATE_FAILED.\n");
1242 sess->session_state = TARG_SESS_STATE_FAILED;
1243
1244 - if (!atomic_read(&sess->session_continuation)) {
1245 - spin_unlock_bh(&sess->conn_lock);
1246 + if (!atomic_read(&sess->session_continuation))
1247 iscsit_start_time2retain_handler(sess);
1248 - } else
1249 - spin_unlock_bh(&sess->conn_lock);
1250
1251 - if (atomic_read(&sess->sleep_on_sess_wait_comp))
1252 - complete(&sess->session_wait_comp);
1253 + if (atomic_read(&sess->session_close)) {
1254 + spin_unlock_bh(&sess->conn_lock);
1255 + complete_all(&sess->session_wait_comp);
1256 + iscsit_close_session(sess);
1257 + } else {
1258 + spin_unlock_bh(&sess->conn_lock);
1259 + }
1260
1261 return 0;
1262 }
1263 @@ -4432,9 +4439,9 @@ static void iscsit_logout_post_handler_closesession(
1264 complete(&conn->conn_logout_comp);
1265
1266 iscsit_dec_conn_usage_count(conn);
1267 + atomic_set(&sess->session_close, 1);
1268 iscsit_stop_session(sess, sleep, sleep);
1269 iscsit_dec_session_usage_count(sess);
1270 - iscsit_close_session(sess);
1271 }
1272
1273 static void iscsit_logout_post_handler_samecid(
1274 @@ -4569,49 +4576,6 @@ void iscsit_fail_session(struct iscsi_session *sess)
1275 sess->session_state = TARG_SESS_STATE_FAILED;
1276 }
1277
1278 -int iscsit_free_session(struct iscsi_session *sess)
1279 -{
1280 - u16 conn_count = atomic_read(&sess->nconn);
1281 - struct iscsi_conn *conn, *conn_tmp = NULL;
1282 - int is_last;
1283 -
1284 - spin_lock_bh(&sess->conn_lock);
1285 - atomic_set(&sess->sleep_on_sess_wait_comp, 1);
1286 -
1287 - list_for_each_entry_safe(conn, conn_tmp, &sess->sess_conn_list,
1288 - conn_list) {
1289 - if (conn_count == 0)
1290 - break;
1291 -
1292 - if (list_is_last(&conn->conn_list, &sess->sess_conn_list)) {
1293 - is_last = 1;
1294 - } else {
1295 - iscsit_inc_conn_usage_count(conn_tmp);
1296 - is_last = 0;
1297 - }
1298 - iscsit_inc_conn_usage_count(conn);
1299 -
1300 - spin_unlock_bh(&sess->conn_lock);
1301 - iscsit_cause_connection_reinstatement(conn, 1);
1302 - spin_lock_bh(&sess->conn_lock);
1303 -
1304 - iscsit_dec_conn_usage_count(conn);
1305 - if (is_last == 0)
1306 - iscsit_dec_conn_usage_count(conn_tmp);
1307 -
1308 - conn_count--;
1309 - }
1310 -
1311 - if (atomic_read(&sess->nconn)) {
1312 - spin_unlock_bh(&sess->conn_lock);
1313 - wait_for_completion(&sess->session_wait_comp);
1314 - } else
1315 - spin_unlock_bh(&sess->conn_lock);
1316 -
1317 - iscsit_close_session(sess);
1318 - return 0;
1319 -}
1320 -
1321 void iscsit_stop_session(
1322 struct iscsi_session *sess,
1323 int session_sleep,
1324 @@ -4622,8 +4586,6 @@ void iscsit_stop_session(
1325 int is_last;
1326
1327 spin_lock_bh(&sess->conn_lock);
1328 - if (session_sleep)
1329 - atomic_set(&sess->sleep_on_sess_wait_comp, 1);
1330
1331 if (connection_sleep) {
1332 list_for_each_entry_safe(conn, conn_tmp, &sess->sess_conn_list,
1333 @@ -4681,12 +4643,15 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force)
1334 spin_lock(&sess->conn_lock);
1335 if (atomic_read(&sess->session_fall_back_to_erl0) ||
1336 atomic_read(&sess->session_logout) ||
1337 + atomic_read(&sess->session_close) ||
1338 (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) {
1339 spin_unlock(&sess->conn_lock);
1340 continue;
1341 }
1342 + iscsit_inc_session_usage_count(sess);
1343 atomic_set(&sess->session_reinstatement, 1);
1344 atomic_set(&sess->session_fall_back_to_erl0, 1);
1345 + atomic_set(&sess->session_close, 1);
1346 spin_unlock(&sess->conn_lock);
1347
1348 list_move_tail(&se_sess->sess_list, &free_list);
1349 @@ -4696,7 +4661,9 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force)
1350 list_for_each_entry_safe(se_sess, se_sess_tmp, &free_list, sess_list) {
1351 sess = (struct iscsi_session *)se_sess->fabric_sess_ptr;
1352
1353 - iscsit_free_session(sess);
1354 + list_del_init(&se_sess->sess_list);
1355 + iscsit_stop_session(sess, 1, 1);
1356 + iscsit_dec_session_usage_count(sess);
1357 session_count++;
1358 }
1359
1360 diff --git a/drivers/target/iscsi/iscsi_target.h b/drivers/target/iscsi/iscsi_target.h
1361 index c95f56a3ce31..7409ce2a6607 100644
1362 --- a/drivers/target/iscsi/iscsi_target.h
1363 +++ b/drivers/target/iscsi/iscsi_target.h
1364 @@ -43,7 +43,6 @@ extern int iscsi_target_rx_thread(void *);
1365 extern int iscsit_close_connection(struct iscsi_conn *);
1366 extern int iscsit_close_session(struct iscsi_session *);
1367 extern void iscsit_fail_session(struct iscsi_session *);
1368 -extern int iscsit_free_session(struct iscsi_session *);
1369 extern void iscsit_stop_session(struct iscsi_session *, int, int);
1370 extern int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *, int);
1371
1372 diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
1373 index 42b369fc415e..0fa1d57b26fa 100644
1374 --- a/drivers/target/iscsi/iscsi_target_configfs.c
1375 +++ b/drivers/target/iscsi/iscsi_target_configfs.c
1376 @@ -1476,20 +1476,23 @@ static void lio_tpg_close_session(struct se_session *se_sess)
1377 spin_lock(&sess->conn_lock);
1378 if (atomic_read(&sess->session_fall_back_to_erl0) ||
1379 atomic_read(&sess->session_logout) ||
1380 + atomic_read(&sess->session_close) ||
1381 (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) {
1382 spin_unlock(&sess->conn_lock);
1383 spin_unlock_bh(&se_tpg->session_lock);
1384 return;
1385 }
1386 + iscsit_inc_session_usage_count(sess);
1387 atomic_set(&sess->session_reinstatement, 1);
1388 atomic_set(&sess->session_fall_back_to_erl0, 1);
1389 + atomic_set(&sess->session_close, 1);
1390 spin_unlock(&sess->conn_lock);
1391
1392 iscsit_stop_time2retain_timer(sess);
1393 spin_unlock_bh(&se_tpg->session_lock);
1394
1395 iscsit_stop_session(sess, 1, 1);
1396 - iscsit_close_session(sess);
1397 + iscsit_dec_session_usage_count(sess);
1398 }
1399
1400 static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg)
1401 diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
1402 index f53330813207..731ee67fe914 100644
1403 --- a/drivers/target/iscsi/iscsi_target_login.c
1404 +++ b/drivers/target/iscsi/iscsi_target_login.c
1405 @@ -156,6 +156,7 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
1406 spin_lock(&sess_p->conn_lock);
1407 if (atomic_read(&sess_p->session_fall_back_to_erl0) ||
1408 atomic_read(&sess_p->session_logout) ||
1409 + atomic_read(&sess_p->session_close) ||
1410 (sess_p->time2retain_timer_flags & ISCSI_TF_EXPIRED)) {
1411 spin_unlock(&sess_p->conn_lock);
1412 continue;
1413 @@ -166,6 +167,7 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
1414 (sess_p->sess_ops->SessionType == sessiontype))) {
1415 atomic_set(&sess_p->session_reinstatement, 1);
1416 atomic_set(&sess_p->session_fall_back_to_erl0, 1);
1417 + atomic_set(&sess_p->session_close, 1);
1418 spin_unlock(&sess_p->conn_lock);
1419 iscsit_inc_session_usage_count(sess_p);
1420 iscsit_stop_time2retain_timer(sess_p);
1421 @@ -190,7 +192,6 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
1422 if (sess->session_state == TARG_SESS_STATE_FAILED) {
1423 spin_unlock_bh(&sess->conn_lock);
1424 iscsit_dec_session_usage_count(sess);
1425 - iscsit_close_session(sess);
1426 return 0;
1427 }
1428 spin_unlock_bh(&sess->conn_lock);
1429 @@ -198,7 +199,6 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
1430 iscsit_stop_session(sess, 1, 1);
1431 iscsit_dec_session_usage_count(sess);
1432
1433 - iscsit_close_session(sess);
1434 return 0;
1435 }
1436
1437 @@ -486,6 +486,7 @@ static int iscsi_login_non_zero_tsih_s2(
1438 sess_p = (struct iscsi_session *)se_sess->fabric_sess_ptr;
1439 if (atomic_read(&sess_p->session_fall_back_to_erl0) ||
1440 atomic_read(&sess_p->session_logout) ||
1441 + atomic_read(&sess_p->session_close) ||
1442 (sess_p->time2retain_timer_flags & ISCSI_TF_EXPIRED))
1443 continue;
1444 if (!memcmp(sess_p->isid, pdu->isid, 6) &&
1445 diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
1446 index 09d6b11246c9..384f26322609 100644
1447 --- a/drivers/usb/dwc3/gadget.c
1448 +++ b/drivers/usb/dwc3/gadget.c
1449 @@ -2567,10 +2567,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
1450
1451 dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);
1452
1453 - if (stop) {
1454 + if (stop)
1455 dwc3_stop_active_transfer(dep, true, true);
1456 - dep->flags = DWC3_EP_ENABLED;
1457 - }
1458
1459 /*
1460 * WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround.
1461 diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
1462 index 04bdbbb746a4..32a09ed540a2 100644
1463 --- a/fs/btrfs/relocation.c
1464 +++ b/fs/btrfs/relocation.c
1465 @@ -561,8 +561,8 @@ static int should_ignore_root(struct btrfs_root *root)
1466 if (!reloc_root)
1467 return 0;
1468
1469 - if (btrfs_root_last_snapshot(&reloc_root->root_item) ==
1470 - root->fs_info->running_transaction->transid - 1)
1471 + if (btrfs_header_generation(reloc_root->commit_root) ==
1472 + root->fs_info->running_transaction->transid)
1473 return 0;
1474 /*
1475 * if there is reloc tree and it was created in previous
1476 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
1477 index fb0f99dc8c22..164dbfd40c52 100644
1478 --- a/fs/ext4/extents.c
1479 +++ b/fs/ext4/extents.c
1480 @@ -3549,8 +3549,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
1481 (unsigned long long)map->m_lblk, map_len);
1482
1483 sbi = EXT4_SB(inode->i_sb);
1484 - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
1485 - inode->i_sb->s_blocksize_bits;
1486 + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
1487 + >> inode->i_sb->s_blocksize_bits;
1488 if (eof_block < map->m_lblk + map_len)
1489 eof_block = map->m_lblk + map_len;
1490
1491 @@ -3805,8 +3805,8 @@ static int ext4_split_convert_extents(handle_t *handle,
1492 __func__, inode->i_ino,
1493 (unsigned long long)map->m_lblk, map->m_len);
1494
1495 - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
1496 - inode->i_sb->s_blocksize_bits;
1497 + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
1498 + >> inode->i_sb->s_blocksize_bits;
1499 if (eof_block < map->m_lblk + map->m_len)
1500 eof_block = map->m_lblk + map->m_len;
1501 /*
1502 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
1503 index 8bd806a03a90..a1eca6d30643 100644
1504 --- a/fs/ext4/super.c
1505 +++ b/fs/ext4/super.c
1506 @@ -4109,7 +4109,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
1507 if (sbi->s_inodes_per_group < sbi->s_inodes_per_block ||
1508 sbi->s_inodes_per_group > blocksize * 8) {
1509 ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n",
1510 - sbi->s_blocks_per_group);
1511 + sbi->s_inodes_per_group);
1512 goto failed_mount;
1513 }
1514 sbi->s_itb_per_group = sbi->s_inodes_per_group /
1515 @@ -4238,9 +4238,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
1516 EXT4_BLOCKS_PER_GROUP(sb) - 1);
1517 do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb));
1518 if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) {
1519 - ext4_msg(sb, KERN_WARNING, "groups count too large: %u "
1520 + ext4_msg(sb, KERN_WARNING, "groups count too large: %llu "
1521 "(block count %llu, first data block %u, "
1522 - "blocks per group %lu)", sbi->s_groups_count,
1523 + "blocks per group %lu)", blocks_count,
1524 ext4_blocks_count(es),
1525 le32_to_cpu(es->s_first_data_block),
1526 EXT4_BLOCKS_PER_GROUP(sb));
1527 diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
1528 index 754ec3c47d6f..88146008b3e3 100644
1529 --- a/fs/jbd2/commit.c
1530 +++ b/fs/jbd2/commit.c
1531 @@ -995,9 +995,10 @@ restart_loop:
1532 * journalled data) we need to unmap buffer and clear
1533 * more bits. We also need to be careful about the check
1534 * because the data page mapping can get cleared under
1535 - * out hands, which alse need not to clear more bits
1536 - * because the page and buffers will be freed and can
1537 - * never be reused once we are done with them.
1538 + * our hands. Note that if mapping == NULL, we don't
1539 + * need to make buffer unmapped because the page is
1540 + * already detached from the mapping and buffers cannot
1541 + * get reused.
1542 */
1543 mapping = READ_ONCE(bh->b_page->mapping);
1544 if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) {
1545 diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
1546 index b045cf1826fc..bb980721502d 100644
1547 --- a/fs/overlayfs/inode.c
1548 +++ b/fs/overlayfs/inode.c
1549 @@ -881,7 +881,7 @@ struct inode *ovl_get_inode(struct super_block *sb,
1550 struct dentry *lowerdentry = lowerpath ? lowerpath->dentry : NULL;
1551 bool bylower = ovl_hash_bylower(sb, upperdentry, lowerdentry,
1552 oip->index);
1553 - int fsid = bylower ? oip->lowerpath->layer->fsid : 0;
1554 + int fsid = bylower ? lowerpath->layer->fsid : 0;
1555 bool is_dir, metacopy = false;
1556 unsigned long ino = 0;
1557 int err = oip->newinode ? -EEXIST : -ENOMEM;
1558 @@ -931,6 +931,8 @@ struct inode *ovl_get_inode(struct super_block *sb,
1559 err = -ENOMEM;
1560 goto out_err;
1561 }
1562 + ino = realinode->i_ino;
1563 + fsid = lowerpath->layer->fsid;
1564 }
1565 ovl_fill_inode(inode, realinode->i_mode, realinode->i_rdev, ino, fsid);
1566 ovl_inode_init(inode, upperdentry, lowerdentry, oip->lowerdata);
1567 diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
1568 index b69c16cbbf71..2d0d91070268 100644
1569 --- a/include/net/ip6_route.h
1570 +++ b/include/net/ip6_route.h
1571 @@ -254,6 +254,7 @@ static inline bool ipv6_anycast_destination(const struct dst_entry *dst,
1572
1573 return rt->rt6i_flags & RTF_ANYCAST ||
1574 (rt->rt6i_dst.plen < 127 &&
1575 + !(rt->rt6i_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) &&
1576 ipv6_addr_equal(&rt->rt6i_dst.addr, daddr));
1577 }
1578
1579 diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h
1580 index a49d37140a64..591cd9e4692c 100644
1581 --- a/include/target/iscsi/iscsi_target_core.h
1582 +++ b/include/target/iscsi/iscsi_target_core.h
1583 @@ -676,7 +676,7 @@ struct iscsi_session {
1584 atomic_t session_logout;
1585 atomic_t session_reinstatement;
1586 atomic_t session_stop_active;
1587 - atomic_t sleep_on_sess_wait_comp;
1588 + atomic_t session_close;
1589 /* connection list */
1590 struct list_head sess_conn_list;
1591 struct list_head cr_active_list;
1592 diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
1593 index 287d77eae59b..de840de87a18 100644
1594 --- a/kernel/trace/trace_events_trigger.c
1595 +++ b/kernel/trace/trace_events_trigger.c
1596 @@ -1088,14 +1088,10 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops,
1597 struct event_trigger_data *data,
1598 struct trace_event_file *file)
1599 {
1600 - int ret = register_trigger(glob, ops, data, file);
1601 -
1602 - if (ret > 0 && tracing_alloc_snapshot_instance(file->tr) != 0) {
1603 - unregister_trigger(glob, ops, data, file);
1604 - ret = 0;
1605 - }
1606 + if (tracing_alloc_snapshot_instance(file->tr) != 0)
1607 + return 0;
1608
1609 - return ret;
1610 + return register_trigger(glob, ops, data, file);
1611 }
1612
1613 static int
1614 diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
1615 index efea4874743e..05e1cfc1e5cd 100644
1616 --- a/net/bpfilter/main.c
1617 +++ b/net/bpfilter/main.c
1618 @@ -35,7 +35,6 @@ static void loop(void)
1619 struct mbox_reply reply;
1620 int n;
1621
1622 - fprintf(debug_f, "testing the buffer\n");
1623 n = read(0, &req, sizeof(req));
1624 if (n != sizeof(req)) {
1625 fprintf(debug_f, "invalid request %d\n", n);
1626 diff --git a/net/core/dev.c b/net/core/dev.c
1627 index c19c424197e3..8ad1e8f00958 100644
1628 --- a/net/core/dev.c
1629 +++ b/net/core/dev.c
1630 @@ -3863,7 +3863,8 @@ EXPORT_SYMBOL(netdev_max_backlog);
1631
1632 int netdev_tstamp_prequeue __read_mostly = 1;
1633 int netdev_budget __read_mostly = 300;
1634 -unsigned int __read_mostly netdev_budget_usecs = 2000;
1635 +/* Must be at least 2 jiffes to guarantee 1 jiffy timeout */
1636 +unsigned int __read_mostly netdev_budget_usecs = 2 * USEC_PER_SEC / HZ;
1637 int weight_p __read_mostly = 64; /* old backlog weight */
1638 int dev_weight_rx_bias __read_mostly = 1; /* bias for backlog weight */
1639 int dev_weight_tx_bias __read_mostly = 1; /* bias for output_queue quota */
1640 diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
1641 index fae21c863b1f..55c0b2e872a5 100644
1642 --- a/net/hsr/hsr_netlink.c
1643 +++ b/net/hsr/hsr_netlink.c
1644 @@ -61,10 +61,16 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev,
1645 else
1646 multicast_spec = nla_get_u8(data[IFLA_HSR_MULTICAST_SPEC]);
1647
1648 - if (!data[IFLA_HSR_VERSION])
1649 + if (!data[IFLA_HSR_VERSION]) {
1650 hsr_version = 0;
1651 - else
1652 + } else {
1653 hsr_version = nla_get_u8(data[IFLA_HSR_VERSION]);
1654 + if (hsr_version > 1) {
1655 + NL_SET_ERR_MSG_MOD(extack,
1656 + "Only versions 0..1 are supported");
1657 + return -EINVAL;
1658 + }
1659 + }
1660
1661 return hsr_dev_finalize(dev, link, multicast_spec, hsr_version);
1662 }
1663 diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
1664 index e4632bd2026d..458dc6eb5a68 100644
1665 --- a/net/ipv4/devinet.c
1666 +++ b/net/ipv4/devinet.c
1667 @@ -614,12 +614,15 @@ struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
1668 return NULL;
1669 }
1670
1671 -static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa)
1672 +static int ip_mc_autojoin_config(struct net *net, bool join,
1673 + const struct in_ifaddr *ifa)
1674 {
1675 +#if defined(CONFIG_IP_MULTICAST)
1676 struct ip_mreqn mreq = {
1677 .imr_multiaddr.s_addr = ifa->ifa_address,
1678 .imr_ifindex = ifa->ifa_dev->dev->ifindex,
1679 };
1680 + struct sock *sk = net->ipv4.mc_autojoin_sk;
1681 int ret;
1682
1683 ASSERT_RTNL();
1684 @@ -632,6 +635,9 @@ static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa)
1685 release_sock(sk);
1686
1687 return ret;
1688 +#else
1689 + return -EOPNOTSUPP;
1690 +#endif
1691 }
1692
1693 static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh,
1694 @@ -675,7 +681,7 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh,
1695 continue;
1696
1697 if (ipv4_is_multicast(ifa->ifa_address))
1698 - ip_mc_config(net->ipv4.mc_autojoin_sk, false, ifa);
1699 + ip_mc_autojoin_config(net, false, ifa);
1700 __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).portid);
1701 return 0;
1702 }
1703 @@ -940,8 +946,7 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
1704 */
1705 set_ifa_lifetime(ifa, valid_lft, prefered_lft);
1706 if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) {
1707 - int ret = ip_mc_config(net->ipv4.mc_autojoin_sk,
1708 - true, ifa);
1709 + int ret = ip_mc_autojoin_config(net, true, ifa);
1710
1711 if (ret < 0) {
1712 inet_free_ifa(ifa);
1713 diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
1714 index f5a9bdc4980c..ebb381c3f1b9 100644
1715 --- a/net/l2tp/l2tp_netlink.c
1716 +++ b/net/l2tp/l2tp_netlink.c
1717 @@ -920,51 +920,51 @@ static const struct genl_ops l2tp_nl_ops[] = {
1718 .cmd = L2TP_CMD_TUNNEL_CREATE,
1719 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1720 .doit = l2tp_nl_cmd_tunnel_create,
1721 - .flags = GENL_ADMIN_PERM,
1722 + .flags = GENL_UNS_ADMIN_PERM,
1723 },
1724 {
1725 .cmd = L2TP_CMD_TUNNEL_DELETE,
1726 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1727 .doit = l2tp_nl_cmd_tunnel_delete,
1728 - .flags = GENL_ADMIN_PERM,
1729 + .flags = GENL_UNS_ADMIN_PERM,
1730 },
1731 {
1732 .cmd = L2TP_CMD_TUNNEL_MODIFY,
1733 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1734 .doit = l2tp_nl_cmd_tunnel_modify,
1735 - .flags = GENL_ADMIN_PERM,
1736 + .flags = GENL_UNS_ADMIN_PERM,
1737 },
1738 {
1739 .cmd = L2TP_CMD_TUNNEL_GET,
1740 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1741 .doit = l2tp_nl_cmd_tunnel_get,
1742 .dumpit = l2tp_nl_cmd_tunnel_dump,
1743 - .flags = GENL_ADMIN_PERM,
1744 + .flags = GENL_UNS_ADMIN_PERM,
1745 },
1746 {
1747 .cmd = L2TP_CMD_SESSION_CREATE,
1748 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1749 .doit = l2tp_nl_cmd_session_create,
1750 - .flags = GENL_ADMIN_PERM,
1751 + .flags = GENL_UNS_ADMIN_PERM,
1752 },
1753 {
1754 .cmd = L2TP_CMD_SESSION_DELETE,
1755 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1756 .doit = l2tp_nl_cmd_session_delete,
1757 - .flags = GENL_ADMIN_PERM,
1758 + .flags = GENL_UNS_ADMIN_PERM,
1759 },
1760 {
1761 .cmd = L2TP_CMD_SESSION_MODIFY,
1762 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1763 .doit = l2tp_nl_cmd_session_modify,
1764 - .flags = GENL_ADMIN_PERM,
1765 + .flags = GENL_UNS_ADMIN_PERM,
1766 },
1767 {
1768 .cmd = L2TP_CMD_SESSION_GET,
1769 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1770 .doit = l2tp_nl_cmd_session_get,
1771 .dumpit = l2tp_nl_cmd_session_dump,
1772 - .flags = GENL_ADMIN_PERM,
1773 + .flags = GENL_UNS_ADMIN_PERM,
1774 },
1775 };
1776
1777 diff --git a/net/mac80211/main.c b/net/mac80211/main.c
1778 index 2d05c4cfaf6d..bc4bed021066 100644
1779 --- a/net/mac80211/main.c
1780 +++ b/net/mac80211/main.c
1781 @@ -1045,7 +1045,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1782 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;
1783 if (hw->max_signal <= 0) {
1784 result = -EINVAL;
1785 - goto fail_wiphy_register;
1786 + goto fail_workqueue;
1787 }
1788 }
1789
1790 @@ -1107,7 +1107,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1791
1792 result = ieee80211_init_cipher_suites(local);
1793 if (result < 0)
1794 - goto fail_wiphy_register;
1795 + goto fail_workqueue;
1796
1797 if (!local->ops->remain_on_channel)
1798 local->hw.wiphy->max_remain_on_channel_duration = 5000;
1799 @@ -1133,10 +1133,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1800
1801 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM;
1802
1803 - result = wiphy_register(local->hw.wiphy);
1804 - if (result < 0)
1805 - goto fail_wiphy_register;
1806 -
1807 /*
1808 * We use the number of queues for feature tests (QoS, HT) internally
1809 * so restrict them appropriately.
1810 @@ -1192,9 +1188,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1811 goto fail_flows;
1812
1813 rtnl_lock();
1814 -
1815 result = ieee80211_init_rate_ctrl_alg(local,
1816 hw->rate_control_algorithm);
1817 + rtnl_unlock();
1818 if (result < 0) {
1819 wiphy_debug(local->hw.wiphy,
1820 "Failed to initialize rate control algorithm\n");
1821 @@ -1248,6 +1244,12 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1822 local->sband_allocated |= BIT(band);
1823 }
1824
1825 + result = wiphy_register(local->hw.wiphy);
1826 + if (result < 0)
1827 + goto fail_wiphy_register;
1828 +
1829 + rtnl_lock();
1830 +
1831 /* add one default STA interface if supported */
1832 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) &&
1833 !ieee80211_hw_check(hw, NO_AUTO_VIF)) {
1834 @@ -1287,17 +1289,17 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1835 #if defined(CONFIG_INET) || defined(CONFIG_IPV6)
1836 fail_ifa:
1837 #endif
1838 + wiphy_unregister(local->hw.wiphy);
1839 + fail_wiphy_register:
1840 rtnl_lock();
1841 rate_control_deinitialize(local);
1842 ieee80211_remove_interfaces(local);
1843 - fail_rate:
1844 rtnl_unlock();
1845 + fail_rate:
1846 fail_flows:
1847 ieee80211_led_exit(local);
1848 destroy_workqueue(local->workqueue);
1849 fail_workqueue:
1850 - wiphy_unregister(local->hw.wiphy);
1851 - fail_wiphy_register:
1852 if (local->wiphy_ciphers_allocated)
1853 kfree(local->hw.wiphy->cipher_suites);
1854 kfree(local->int_scan_req);
1855 @@ -1347,8 +1349,8 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
1856 skb_queue_purge(&local->skb_queue_unreliable);
1857 skb_queue_purge(&local->skb_queue_tdls_chsw);
1858
1859 - destroy_workqueue(local->workqueue);
1860 wiphy_unregister(local->hw.wiphy);
1861 + destroy_workqueue(local->workqueue);
1862 ieee80211_led_exit(local);
1863 kfree(local->int_scan_req);
1864 }
1865 diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
1866 index 3d24d45be5f4..930f48a20546 100644
1867 --- a/net/qrtr/qrtr.c
1868 +++ b/net/qrtr/qrtr.c
1869 @@ -763,20 +763,21 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
1870
1871 node = NULL;
1872 if (addr->sq_node == QRTR_NODE_BCAST) {
1873 - enqueue_fn = qrtr_bcast_enqueue;
1874 - if (addr->sq_port != QRTR_PORT_CTRL) {
1875 + if (addr->sq_port != QRTR_PORT_CTRL &&
1876 + qrtr_local_nid != QRTR_NODE_BCAST) {
1877 release_sock(sk);
1878 return -ENOTCONN;
1879 }
1880 + enqueue_fn = qrtr_bcast_enqueue;
1881 } else if (addr->sq_node == ipc->us.sq_node) {
1882 enqueue_fn = qrtr_local_enqueue;
1883 } else {
1884 - enqueue_fn = qrtr_node_enqueue;
1885 node = qrtr_node_lookup(addr->sq_node);
1886 if (!node) {
1887 release_sock(sk);
1888 return -ECONNRESET;
1889 }
1890 + enqueue_fn = qrtr_node_enqueue;
1891 }
1892
1893 plen = (len + 3) & ~3;
1894 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
1895 index dbb6a14968ef..b65180e874fb 100644
1896 --- a/net/wireless/nl80211.c
1897 +++ b/net/wireless/nl80211.c
1898 @@ -618,10 +618,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
1899 [NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
1900 .len = NL80211_HE_MAX_CAPABILITY_LEN },
1901
1902 - [NL80211_ATTR_FTM_RESPONDER] = {
1903 - .type = NLA_NESTED,
1904 - .validation_data = nl80211_ftm_responder_policy,
1905 - },
1906 + [NL80211_ATTR_FTM_RESPONDER] =
1907 + NLA_POLICY_NESTED(nl80211_ftm_responder_policy),
1908 [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
1909 [NL80211_ATTR_PEER_MEASUREMENTS] =
1910 NLA_POLICY_NESTED(nl80211_pmsr_attr_policy),
1911 diff --git a/security/keys/proc.c b/security/keys/proc.c
1912 index 415f3f1c2da0..d0cde6685627 100644
1913 --- a/security/keys/proc.c
1914 +++ b/security/keys/proc.c
1915 @@ -139,6 +139,8 @@ static void *proc_keys_next(struct seq_file *p, void *v, loff_t *_pos)
1916 n = key_serial_next(p, v);
1917 if (n)
1918 *_pos = key_node_serial(n);
1919 + else
1920 + (*_pos)++;
1921 return n;
1922 }
1923
1924 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1925 index 0fcbb6ab2d58..10c8b31f8507 100644
1926 --- a/sound/pci/hda/patch_realtek.c
1927 +++ b/sound/pci/hda/patch_realtek.c
1928 @@ -7253,6 +7253,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1929 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
1930 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
1931 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
1932 + SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
1933 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
1934 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
1935 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
1936 diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c
1937 index baef461a99f1..f883c9340eee 100644
1938 --- a/sound/soc/intel/atom/sst-atom-controls.c
1939 +++ b/sound/soc/intel/atom/sst-atom-controls.c
1940 @@ -1333,7 +1333,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute)
1941 dai->capture_widget->name);
1942 w = dai->capture_widget;
1943 snd_soc_dapm_widget_for_each_source_path(w, p) {
1944 - if (p->connected && !p->connected(w, p->sink))
1945 + if (p->connected && !p->connected(w, p->source))
1946 continue;
1947
1948 if (p->connect && p->source->power &&
1949 diff --git a/sound/soc/intel/atom/sst/sst_pci.c b/sound/soc/intel/atom/sst/sst_pci.c
1950 index d952719bc098..5862fe968083 100644
1951 --- a/sound/soc/intel/atom/sst/sst_pci.c
1952 +++ b/sound/soc/intel/atom/sst/sst_pci.c
1953 @@ -99,7 +99,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
1954 dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
1955 do_release_regions:
1956 pci_release_regions(pci);
1957 - return 0;
1958 + return ret;
1959 }
1960
1961 /*
1962 diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
1963 index d2a050bb8341..5661994e13e7 100644
1964 --- a/sound/usb/mixer.c
1965 +++ b/sound/usb/mixer.c
1966 @@ -1446,7 +1446,7 @@ error:
1967 usb_audio_err(chip,
1968 "cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",
1969 UAC_GET_CUR, validx, idx, cval->val_type);
1970 - return ret;
1971 + return filter_error(cval, ret);
1972 }
1973
1974 ucontrol->value.integer.value[0] = val;
1975 @@ -1750,11 +1750,15 @@ static void get_connector_control_name(struct usb_mixer_interface *mixer,
1976
1977 /* Build a mixer control for a UAC connector control (jack-detect) */
1978 static void build_connector_control(struct usb_mixer_interface *mixer,
1979 + const struct usbmix_name_map *imap,
1980 struct usb_audio_term *term, bool is_input)
1981 {
1982 struct snd_kcontrol *kctl;
1983 struct usb_mixer_elem_info *cval;
1984
1985 + if (check_ignored_ctl(find_map(imap, term->id, 0)))
1986 + return;
1987 +
1988 cval = kzalloc(sizeof(*cval), GFP_KERNEL);
1989 if (!cval)
1990 return;
1991 @@ -2088,8 +2092,9 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid,
1992 check_input_term(state, term_id, &iterm);
1993
1994 /* Check for jack detection. */
1995 - if (uac_v2v3_control_is_readable(bmctls, control))
1996 - build_connector_control(state->mixer, &iterm, true);
1997 + if ((iterm.type & 0xff00) != 0x0100 &&
1998 + uac_v2v3_control_is_readable(bmctls, control))
1999 + build_connector_control(state->mixer, state->map, &iterm, true);
2000
2001 return 0;
2002 }
2003 @@ -3050,13 +3055,13 @@ static int snd_usb_mixer_controls_badd(struct usb_mixer_interface *mixer,
2004 memset(&iterm, 0, sizeof(iterm));
2005 iterm.id = UAC3_BADD_IT_ID4;
2006 iterm.type = UAC_BIDIR_TERMINAL_HEADSET;
2007 - build_connector_control(mixer, &iterm, true);
2008 + build_connector_control(mixer, map->map, &iterm, true);
2009
2010 /* Output Term - Insertion control */
2011 memset(&oterm, 0, sizeof(oterm));
2012 oterm.id = UAC3_BADD_OT_ID3;
2013 oterm.type = UAC_BIDIR_TERMINAL_HEADSET;
2014 - build_connector_control(mixer, &oterm, false);
2015 + build_connector_control(mixer, map->map, &oterm, false);
2016 }
2017
2018 return 0;
2019 @@ -3085,7 +3090,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
2020 if (map->id == state.chip->usb_id) {
2021 state.map = map->map;
2022 state.selector_map = map->selector_map;
2023 - mixer->ignore_ctl_error = map->ignore_ctl_error;
2024 + mixer->ignore_ctl_error |= map->ignore_ctl_error;
2025 break;
2026 }
2027 }
2028 @@ -3128,10 +3133,11 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
2029 if (err < 0 && err != -EINVAL)
2030 return err;
2031
2032 - if (uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
2033 + if ((state.oterm.type & 0xff00) != 0x0100 &&
2034 + uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
2035 UAC2_TE_CONNECTOR)) {
2036 - build_connector_control(state.mixer, &state.oterm,
2037 - false);
2038 + build_connector_control(state.mixer, state.map,
2039 + &state.oterm, false);
2040 }
2041 } else { /* UAC_VERSION_3 */
2042 struct uac3_output_terminal_descriptor *desc = p;
2043 @@ -3153,10 +3159,11 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
2044 if (err < 0 && err != -EINVAL)
2045 return err;
2046
2047 - if (uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls),
2048 + if ((state.oterm.type & 0xff00) != 0x0100 &&
2049 + uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls),
2050 UAC3_TE_INSERTION)) {
2051 - build_connector_control(state.mixer, &state.oterm,
2052 - false);
2053 + build_connector_control(state.mixer, state.map,
2054 + &state.oterm, false);
2055 }
2056 }
2057 }
2058 diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
2059 index f6a67eecb063..3a54ca04ec4c 100644
2060 --- a/sound/usb/mixer_maps.c
2061 +++ b/sound/usb/mixer_maps.c
2062 @@ -350,9 +350,11 @@ static const struct usbmix_name_map dell_alc4020_map[] = {
2063 };
2064
2065 /* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX
2066 - * response for Input Gain Pad (id=19, control=12). Skip it.
2067 + * response for Input Gain Pad (id=19, control=12) and the connector status
2068 + * for SPDIF terminal (id=18). Skip them.
2069 */
2070 static const struct usbmix_name_map asus_rog_map[] = {
2071 + { 18, NULL }, /* OT, connector control */
2072 { 19, NULL, 12 }, /* FU, Input Gain Pad */
2073 {}
2074 };
2075 diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
2076 index 6407dff405d9..4d8db41b949a 100644
2077 --- a/tools/perf/builtin-report.c
2078 +++ b/tools/perf/builtin-report.c
2079 @@ -181,24 +181,23 @@ static int hist_iter__branch_callback(struct hist_entry_iter *iter,
2080 {
2081 struct hist_entry *he = iter->he;
2082 struct report *rep = arg;
2083 - struct branch_info *bi;
2084 + struct branch_info *bi = he->branch_info;
2085 struct perf_sample *sample = iter->sample;
2086 struct evsel *evsel = iter->evsel;
2087 int err;
2088
2089 + branch_type_count(&rep->brtype_stat, &bi->flags,
2090 + bi->from.addr, bi->to.addr);
2091 +
2092 if (!ui__has_annotation() && !rep->symbol_ipc)
2093 return 0;
2094
2095 - bi = he->branch_info;
2096 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel);
2097 if (err)
2098 goto out;
2099
2100 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel);
2101
2102 - branch_type_count(&rep->brtype_stat, &bi->flags,
2103 - bi->from.addr, bi->to.addr);
2104 -
2105 out:
2106 return err;
2107 }