Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0254-5.4.155-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3635 - (show annotations) (download)
Mon Oct 24 12:34:12 2022 UTC (19 months, 3 weeks ago) by niro
File size: 58144 byte(s)
-sync kernel patches
1 diff --git a/Makefile b/Makefile
2 index 3358f56a37f06..f7e2bf924463b 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 = 154
10 +SUBLEVEL = 155
11 EXTRAVERSION =
12 NAME = Kleptomaniac Octopus
13
14 diff --git a/arch/csky/kernel/ptrace.c b/arch/csky/kernel/ptrace.c
15 index 313623a19ecbf..885194720fe0b 100644
16 --- a/arch/csky/kernel/ptrace.c
17 +++ b/arch/csky/kernel/ptrace.c
18 @@ -96,7 +96,8 @@ static int gpr_set(struct task_struct *target,
19 if (ret)
20 return ret;
21
22 - regs.sr = task_pt_regs(target)->sr;
23 + /* BIT(0) of regs.sr is Condition Code/Carry bit */
24 + regs.sr = (regs.sr & BIT(0)) | (task_pt_regs(target)->sr & ~BIT(0));
25 #ifdef CONFIG_CPU_HAS_HILO
26 regs.dcsr = task_pt_regs(target)->dcsr;
27 #endif
28 diff --git a/arch/csky/kernel/signal.c b/arch/csky/kernel/signal.c
29 index 9b1b7c039ddf9..63c2bbe39d03b 100644
30 --- a/arch/csky/kernel/signal.c
31 +++ b/arch/csky/kernel/signal.c
32 @@ -52,10 +52,14 @@ static long restore_sigcontext(struct pt_regs *regs,
33 struct sigcontext __user *sc)
34 {
35 int err = 0;
36 + unsigned long sr = regs->sr;
37
38 /* sc_pt_regs is structured the same as the start of pt_regs */
39 err |= __copy_from_user(regs, &sc->sc_pt_regs, sizeof(struct pt_regs));
40
41 + /* BIT(0) of regs->sr is Condition Code/Carry bit */
42 + regs->sr = (sr & ~1) | (regs->sr & 1);
43 +
44 /* Restore the floating-point state. */
45 err |= restore_fpu_state(sc);
46
47 diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
48 index 2d4c09a77910f..d4467da279668 100644
49 --- a/arch/powerpc/sysdev/xive/common.c
50 +++ b/arch/powerpc/sysdev/xive/common.c
51 @@ -990,7 +990,8 @@ static int xive_get_irqchip_state(struct irq_data *data,
52 * interrupt to be inactive in that case.
53 */
54 *state = (pq != XIVE_ESB_INVALID) && !xd->stale_p &&
55 - (xd->saved_p || !!(pq & XIVE_ESB_VAL_P));
56 + (xd->saved_p || (!!(pq & XIVE_ESB_VAL_P) &&
57 + !irqd_irq_disabled(data)));
58 return 0;
59 default:
60 return -EINVAL;
61 diff --git a/arch/s390/lib/string.c b/arch/s390/lib/string.c
62 index 0e30e6e43b0c5..18fbbb679851d 100644
63 --- a/arch/s390/lib/string.c
64 +++ b/arch/s390/lib/string.c
65 @@ -246,14 +246,13 @@ EXPORT_SYMBOL(strcmp);
66 #ifdef __HAVE_ARCH_STRRCHR
67 char *strrchr(const char *s, int c)
68 {
69 - size_t len = __strend(s) - s;
70 -
71 - if (len)
72 - do {
73 - if (s[len] == (char) c)
74 - return (char *) s + len;
75 - } while (--len > 0);
76 - return NULL;
77 + ssize_t len = __strend(s) - s;
78 +
79 + do {
80 + if (s[len] == (char)c)
81 + return (char *)s + len;
82 + } while (--len >= 0);
83 + return NULL;
84 }
85 EXPORT_SYMBOL(strrchr);
86 #endif
87 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
88 index 8c1590432e866..c2a3ec3dd8506 100644
89 --- a/arch/x86/Kconfig
90 +++ b/arch/x86/Kconfig
91 @@ -1541,7 +1541,6 @@ config AMD_MEM_ENCRYPT
92
93 config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
94 bool "Activate AMD Secure Memory Encryption (SME) by default"
95 - default y
96 depends on AMD_MEM_ENCRYPT
97 ---help---
98 Say yes to have system memory encrypted by default if running on
99 diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
100 index 87a34b6e06a2b..130c3c7f56d4b 100644
101 --- a/arch/x86/kernel/cpu/resctrl/core.c
102 +++ b/arch/x86/kernel/cpu/resctrl/core.c
103 @@ -588,6 +588,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
104 }
105
106 if (r->mon_capable && domain_setup_mon_state(r, d)) {
107 + kfree(d->ctrl_val);
108 + kfree(d->mbps_val);
109 kfree(d);
110 return;
111 }
112 diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
113 index 7d7497b856020..311419d1d6b05 100644
114 --- a/drivers/acpi/arm64/gtdt.c
115 +++ b/drivers/acpi/arm64/gtdt.c
116 @@ -36,7 +36,7 @@ struct acpi_gtdt_descriptor {
117
118 static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
119
120 -static inline void *next_platform_timer(void *platform_timer)
121 +static inline __init void *next_platform_timer(void *platform_timer)
122 {
123 struct acpi_gtdt_header *gh = platform_timer;
124
125 diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
126 index 416cfbf2f1c29..8a963d2a951db 100644
127 --- a/drivers/ata/libahci_platform.c
128 +++ b/drivers/ata/libahci_platform.c
129 @@ -440,10 +440,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
130 hpriv->phy_regulator = devm_regulator_get(dev, "phy");
131 if (IS_ERR(hpriv->phy_regulator)) {
132 rc = PTR_ERR(hpriv->phy_regulator);
133 - if (rc == -EPROBE_DEFER)
134 - goto err_out;
135 - rc = 0;
136 - hpriv->phy_regulator = NULL;
137 + goto err_out;
138 }
139
140 if (flags & AHCI_PLATFORM_GET_RESETS) {
141 diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
142 index 4fd12b20df239..d91ba47f2fc44 100644
143 --- a/drivers/ata/pata_legacy.c
144 +++ b/drivers/ata/pata_legacy.c
145 @@ -315,7 +315,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_queued_cmd *qc,
146 iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
147
148 if (unlikely(slop)) {
149 - __le32 pad;
150 + __le32 pad = 0;
151 +
152 if (rw == READ) {
153 pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
154 memcpy(buf + buflen - slop, &pad, slop);
155 @@ -705,7 +706,8 @@ static unsigned int vlb32_data_xfer(struct ata_queued_cmd *qc,
156 ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
157
158 if (unlikely(slop)) {
159 - __le32 pad;
160 + __le32 pad = 0;
161 +
162 if (rw == WRITE) {
163 memcpy(&pad, buf + buflen - slop, slop);
164 iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
165 diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c
166 index 7f227bdcbc845..8c63447154730 100644
167 --- a/drivers/edac/armada_xp_edac.c
168 +++ b/drivers/edac/armada_xp_edac.c
169 @@ -178,7 +178,7 @@ static void axp_mc_check(struct mem_ctl_info *mci)
170 "details unavailable (multiple errors)");
171 if (cnt_dbe)
172 edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,
173 - cnt_sbe, /* error count */
174 + cnt_dbe, /* error count */
175 0, 0, 0, /* pfn, offset, syndrome */
176 -1, -1, -1, /* top, mid, low layer */
177 mci->ctl_name,
178 diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
179 index e48298687b76d..6157038114a2a 100644
180 --- a/drivers/firmware/efi/cper.c
181 +++ b/drivers/firmware/efi/cper.c
182 @@ -25,8 +25,6 @@
183 #include <acpi/ghes.h>
184 #include <ras/ras_event.h>
185
186 -static char rcd_decode_str[CPER_REC_LEN];
187 -
188 /*
189 * CPER record ID need to be unique even after reboot, because record
190 * ID is used as index for ERST storage, while CPER records from
191 @@ -299,6 +297,7 @@ const char *cper_mem_err_unpack(struct trace_seq *p,
192 struct cper_mem_err_compact *cmem)
193 {
194 const char *ret = trace_seq_buffer_ptr(p);
195 + char rcd_decode_str[CPER_REC_LEN];
196
197 if (cper_mem_err_location(cmem, rcd_decode_str))
198 trace_seq_printf(p, "%s", rcd_decode_str);
199 @@ -313,6 +312,7 @@ static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem,
200 int len)
201 {
202 struct cper_mem_err_compact cmem;
203 + char rcd_decode_str[CPER_REC_LEN];
204
205 /* Don't trust UEFI 2.1/2.2 structure with bad validation bits */
206 if (len == sizeof(struct cper_sec_mem_err_old) &&
207 diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
208 index 65fffaa222108..136b9c7f9ac95 100644
209 --- a/drivers/firmware/efi/runtime-wrappers.c
210 +++ b/drivers/firmware/efi/runtime-wrappers.c
211 @@ -414,7 +414,7 @@ static void virt_efi_reset_system(int reset_type,
212 unsigned long data_size,
213 efi_char16_t *data)
214 {
215 - if (down_interruptible(&efi_runtime_lock)) {
216 + if (down_trylock(&efi_runtime_lock)) {
217 pr_warn("failed to invoke the reset_system() runtime service:\n"
218 "could not get exclusive access to the firmware\n");
219 return;
220 diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
221 index d9193ffa17a1e..54da66d02b0e5 100644
222 --- a/drivers/gpio/gpio-pca953x.c
223 +++ b/drivers/gpio/gpio-pca953x.c
224 @@ -583,21 +583,21 @@ static int pca953x_gpio_set_pull_up_down(struct pca953x_chip *chip,
225
226 mutex_lock(&chip->i2c_lock);
227
228 - /* Disable pull-up/pull-down */
229 - ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, 0);
230 - if (ret)
231 - goto exit;
232 -
233 /* Configure pull-up/pull-down */
234 if (config == PIN_CONFIG_BIAS_PULL_UP)
235 ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, bit);
236 else if (config == PIN_CONFIG_BIAS_PULL_DOWN)
237 ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, 0);
238 + else
239 + ret = 0;
240 if (ret)
241 goto exit;
242
243 - /* Enable pull-up/pull-down */
244 - ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, bit);
245 + /* Disable/Enable pull-up/pull-down */
246 + if (config == PIN_CONFIG_BIAS_DISABLE)
247 + ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, 0);
248 + else
249 + ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, bit);
250
251 exit:
252 mutex_unlock(&chip->i2c_lock);
253 @@ -611,7 +611,9 @@ static int pca953x_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
254
255 switch (pinconf_to_config_param(config)) {
256 case PIN_CONFIG_BIAS_PULL_UP:
257 + case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
258 case PIN_CONFIG_BIAS_PULL_DOWN:
259 + case PIN_CONFIG_BIAS_DISABLE:
260 return pca953x_gpio_set_pull_up_down(chip, offset, config);
261 default:
262 return -ENOTSUPP;
263 diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
264 index 0d37ae5b310c4..a11b98e990019 100644
265 --- a/drivers/gpu/drm/msm/dsi/dsi.c
266 +++ b/drivers/gpu/drm/msm/dsi/dsi.c
267 @@ -206,8 +206,10 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
268 goto fail;
269 }
270
271 - if (!msm_dsi_manager_validate_current_config(msm_dsi->id))
272 + if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) {
273 + ret = -EINVAL;
274 goto fail;
275 + }
276
277 msm_dsi->encoder = encoder;
278
279 diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
280 index 1e7b1be25bb07..5613234823f7d 100644
281 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
282 +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
283 @@ -460,7 +460,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
284
285 return 0;
286 err:
287 - for (; i > 0; i--)
288 + while (--i >= 0)
289 clk_disable_unprepare(msm_host->bus_clks[i]);
290
291 return ret;
292 diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c
293 index 7f3dd3ffe2c9b..bbbd96f9eaa06 100644
294 --- a/drivers/gpu/drm/msm/edp/edp_ctrl.c
295 +++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c
296 @@ -1082,7 +1082,7 @@ void msm_edp_ctrl_power(struct edp_ctrl *ctrl, bool on)
297 int msm_edp_ctrl_init(struct msm_edp *edp)
298 {
299 struct edp_ctrl *ctrl = NULL;
300 - struct device *dev = &edp->pdev->dev;
301 + struct device *dev;
302 int ret;
303
304 if (!edp) {
305 @@ -1090,6 +1090,7 @@ int msm_edp_ctrl_init(struct msm_edp *edp)
306 return -EINVAL;
307 }
308
309 + dev = &edp->pdev->dev;
310 ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
311 if (!ctrl)
312 return -ENOMEM;
313 diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
314 index f152bc4eeb535..e70ccadf7541d 100644
315 --- a/drivers/gpu/drm/panel/Kconfig
316 +++ b/drivers/gpu/drm/panel/Kconfig
317 @@ -141,6 +141,7 @@ config DRM_PANEL_OLIMEX_LCD_OLINUXINO
318 depends on OF
319 depends on I2C
320 depends on BACKLIGHT_CLASS_DEVICE
321 + select CRC32
322 help
323 The panel is used with different sizes LCDs, from 480x272 to
324 1280x800, and 24 bit per pixel.
325 diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
326 index d3fc39df535dc..552baf327d0c4 100644
327 --- a/drivers/iio/adc/aspeed_adc.c
328 +++ b/drivers/iio/adc/aspeed_adc.c
329 @@ -184,6 +184,7 @@ static int aspeed_adc_probe(struct platform_device *pdev)
330
331 data = iio_priv(indio_dev);
332 data->dev = &pdev->dev;
333 + platform_set_drvdata(pdev, indio_dev);
334
335 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
336 data->base = devm_ioremap_resource(&pdev->dev, res);
337 diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
338 index 2449d91e47665..9cdb9084c64e8 100644
339 --- a/drivers/iio/adc/mt6577_auxadc.c
340 +++ b/drivers/iio/adc/mt6577_auxadc.c
341 @@ -82,6 +82,10 @@ static const struct iio_chan_spec mt6577_auxadc_iio_channels[] = {
342 MT6577_AUXADC_CHANNEL(15),
343 };
344
345 +/* For Voltage calculation */
346 +#define VOLTAGE_FULL_RANGE 1500 /* VA voltage */
347 +#define AUXADC_PRECISE 4096 /* 12 bits */
348 +
349 static int mt_auxadc_get_cali_data(int rawdata, bool enable_cali)
350 {
351 return rawdata;
352 @@ -191,6 +195,10 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
353 }
354 if (adc_dev->dev_comp->sample_data_cali)
355 *val = mt_auxadc_get_cali_data(*val, true);
356 +
357 + /* Convert adc raw data to voltage: 0 - 1500 mV */
358 + *val = *val * VOLTAGE_FULL_RANGE / AUXADC_PRECISE;
359 +
360 return IIO_VAL_INT;
361
362 default:
363 diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
364 index 1e5a936b5b6ad..4267d756cd50e 100644
365 --- a/drivers/iio/adc/ti-adc128s052.c
366 +++ b/drivers/iio/adc/ti-adc128s052.c
367 @@ -172,7 +172,13 @@ static int adc128_probe(struct spi_device *spi)
368 mutex_init(&adc->lock);
369
370 ret = iio_device_register(indio_dev);
371 + if (ret)
372 + goto err_disable_regulator;
373
374 + return 0;
375 +
376 +err_disable_regulator:
377 + regulator_disable(adc->reg);
378 return ret;
379 }
380
381 diff --git a/drivers/iio/common/ssp_sensors/ssp_spi.c b/drivers/iio/common/ssp_sensors/ssp_spi.c
382 index 7db3d5886e3ee..d98e0a04add05 100644
383 --- a/drivers/iio/common/ssp_sensors/ssp_spi.c
384 +++ b/drivers/iio/common/ssp_sensors/ssp_spi.c
385 @@ -137,7 +137,7 @@ static int ssp_print_mcu_debug(char *data_frame, int *data_index,
386 if (length > received_len - *data_index || length <= 0) {
387 ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n",
388 length, received_len);
389 - return length ? length : -EPROTO;
390 + return -EPROTO;
391 }
392
393 ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]);
394 @@ -273,6 +273,8 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
395 for (idx = 0; idx < len;) {
396 switch (dataframe[idx++]) {
397 case SSP_MSG2AP_INST_BYPASS_DATA:
398 + if (idx >= len)
399 + return -EPROTO;
400 sd = dataframe[idx++];
401 if (sd < 0 || sd >= SSP_SENSOR_MAX) {
402 dev_err(SSP_DEV,
403 @@ -282,10 +284,13 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
404
405 if (indio_devs[sd]) {
406 spd = iio_priv(indio_devs[sd]);
407 - if (spd->process_data)
408 + if (spd->process_data) {
409 + if (idx >= len)
410 + return -EPROTO;
411 spd->process_data(indio_devs[sd],
412 &dataframe[idx],
413 data->timestamp);
414 + }
415 } else {
416 dev_err(SSP_DEV, "no client for frame\n");
417 }
418 @@ -293,6 +298,8 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
419 idx += ssp_offset_map[sd];
420 break;
421 case SSP_MSG2AP_INST_DEBUG_DATA:
422 + if (idx >= len)
423 + return -EPROTO;
424 sd = ssp_print_mcu_debug(dataframe, &idx, len);
425 if (sd) {
426 dev_err(SSP_DEV,
427 diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c
428 index 3a2bb0efe50de..51c41ccf00ad9 100644
429 --- a/drivers/iio/dac/ti-dac5571.c
430 +++ b/drivers/iio/dac/ti-dac5571.c
431 @@ -352,6 +352,7 @@ static int dac5571_probe(struct i2c_client *client,
432 data->dac5571_pwrdwn = dac5571_pwrdwn_quad;
433 break;
434 default:
435 + ret = -EINVAL;
436 goto err;
437 }
438
439 diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
440 index 92004a2563ea8..5588066c83246 100644
441 --- a/drivers/iio/light/opt3001.c
442 +++ b/drivers/iio/light/opt3001.c
443 @@ -275,6 +275,8 @@ static int opt3001_get_lux(struct opt3001 *opt, int *val, int *val2)
444 ret = wait_event_timeout(opt->result_ready_queue,
445 opt->result_ready,
446 msecs_to_jiffies(OPT3001_RESULT_READY_LONG));
447 + if (ret == 0)
448 + return -ETIMEDOUT;
449 } else {
450 /* Sleep for result ready time */
451 timeout = (opt->int_time == OPT3001_INT_TIME_SHORT) ?
452 @@ -311,9 +313,7 @@ err:
453 /* Disallow IRQ to access the device while lock is active */
454 opt->ok_to_ignore_lock = false;
455
456 - if (ret == 0)
457 - return -ETIMEDOUT;
458 - else if (ret < 0)
459 + if (ret < 0)
460 return ret;
461
462 if (opt->use_irq) {
463 diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
464 index e5f1e3cf9179f..ba101afcfc27f 100644
465 --- a/drivers/input/joystick/xpad.c
466 +++ b/drivers/input/joystick/xpad.c
467 @@ -331,6 +331,7 @@ static const struct xpad_device {
468 { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
469 { 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 },
470 { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
471 + { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
472 { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },
473 { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
474 { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
475 @@ -447,6 +448,7 @@ static const struct usb_device_id xpad_table[] = {
476 XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
477 XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
478 XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
479 + XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */
480 { }
481 };
482
483 diff --git a/drivers/misc/cb710/sgbuf2.c b/drivers/misc/cb710/sgbuf2.c
484 index dfd2969e36289..d52e079bb324e 100644
485 --- a/drivers/misc/cb710/sgbuf2.c
486 +++ b/drivers/misc/cb710/sgbuf2.c
487 @@ -47,7 +47,7 @@ static inline bool needs_unaligned_copy(const void *ptr)
488 #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
489 return false;
490 #else
491 - return ((ptr - NULL) & 3) != 0;
492 + return ((uintptr_t)ptr & 3) != 0;
493 #endif
494 }
495
496 diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
497 index e56dc47540646..556133daa25e9 100644
498 --- a/drivers/misc/mei/hw-me-regs.h
499 +++ b/drivers/misc/mei/hw-me-regs.h
500 @@ -90,6 +90,7 @@
501 #define MEI_DEV_ID_CDF 0x18D3 /* Cedar Fork */
502
503 #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */
504 +#define MEI_DEV_ID_ICP_N 0x38E0 /* Ice Lake Point N */
505
506 #define MEI_DEV_ID_TGP_LP 0xA0E0 /* Tiger Lake Point LP */
507
508 diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
509 index 75ab2ffbf235f..d7233f2238651 100644
510 --- a/drivers/misc/mei/pci-me.c
511 +++ b/drivers/misc/mei/pci-me.c
512 @@ -103,6 +103,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
513 {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_H_3, MEI_ME_PCH8_CFG)},
514
515 {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)},
516 + {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_N, MEI_ME_PCH12_CFG)},
517
518 {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH12_CFG)},
519
520 diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
521 index e8e9c166185de..2d4eb2f280a12 100644
522 --- a/drivers/net/ethernet/Kconfig
523 +++ b/drivers/net/ethernet/Kconfig
524 @@ -100,6 +100,7 @@ config JME
525 config KORINA
526 tristate "Korina (IDT RC32434) Ethernet support"
527 depends on MIKROTIK_RB532
528 + select CRC32
529 ---help---
530 If you have a Mikrotik RouterBoard 500 or IDT RC32434
531 based system say Y. Otherwise say N.
532 diff --git a/drivers/net/ethernet/arc/Kconfig b/drivers/net/ethernet/arc/Kconfig
533 index 45c663d8b9aab..2cd0e45d0b6c1 100644
534 --- a/drivers/net/ethernet/arc/Kconfig
535 +++ b/drivers/net/ethernet/arc/Kconfig
536 @@ -21,6 +21,7 @@ config ARC_EMAC_CORE
537 depends on ARC || ARCH_ROCKCHIP || COMPILE_TEST
538 select MII
539 select PHYLIB
540 + select CRC32
541
542 config ARC_EMAC
543 tristate "ARC EMAC support"
544 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
545 index 24c49a84947f3..5f4f0f61c83c8 100644
546 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
547 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
548 @@ -3805,20 +3805,67 @@ static int set_feature_rx_all(struct net_device *netdev, bool enable)
549 return mlx5_set_port_fcs(mdev, !enable);
550 }
551
552 +static int mlx5e_set_rx_port_ts(struct mlx5_core_dev *mdev, bool enable)
553 +{
554 + u32 in[MLX5_ST_SZ_DW(pcmr_reg)] = {};
555 + bool supported, curr_state;
556 + int err;
557 +
558 + if (!MLX5_CAP_GEN(mdev, ports_check))
559 + return 0;
560 +
561 + err = mlx5_query_ports_check(mdev, in, sizeof(in));
562 + if (err)
563 + return err;
564 +
565 + supported = MLX5_GET(pcmr_reg, in, rx_ts_over_crc_cap);
566 + curr_state = MLX5_GET(pcmr_reg, in, rx_ts_over_crc);
567 +
568 + if (!supported || enable == curr_state)
569 + return 0;
570 +
571 + MLX5_SET(pcmr_reg, in, local_port, 1);
572 + MLX5_SET(pcmr_reg, in, rx_ts_over_crc, enable);
573 +
574 + return mlx5_set_ports_check(mdev, in, sizeof(in));
575 +}
576 +
577 static int set_feature_rx_fcs(struct net_device *netdev, bool enable)
578 {
579 struct mlx5e_priv *priv = netdev_priv(netdev);
580 + struct mlx5e_channels *chs = &priv->channels;
581 + struct mlx5_core_dev *mdev = priv->mdev;
582 int err;
583
584 mutex_lock(&priv->state_lock);
585
586 - priv->channels.params.scatter_fcs_en = enable;
587 - err = mlx5e_modify_channels_scatter_fcs(&priv->channels, enable);
588 - if (err)
589 - priv->channels.params.scatter_fcs_en = !enable;
590 + if (enable) {
591 + err = mlx5e_set_rx_port_ts(mdev, false);
592 + if (err)
593 + goto out;
594
595 - mutex_unlock(&priv->state_lock);
596 + chs->params.scatter_fcs_en = true;
597 + err = mlx5e_modify_channels_scatter_fcs(chs, true);
598 + if (err) {
599 + chs->params.scatter_fcs_en = false;
600 + mlx5e_set_rx_port_ts(mdev, true);
601 + }
602 + } else {
603 + chs->params.scatter_fcs_en = false;
604 + err = mlx5e_modify_channels_scatter_fcs(chs, false);
605 + if (err) {
606 + chs->params.scatter_fcs_en = true;
607 + goto out;
608 + }
609 + err = mlx5e_set_rx_port_ts(mdev, true);
610 + if (err) {
611 + mlx5_core_warn(mdev, "Failed to set RX port timestamp %d\n", err);
612 + err = 0;
613 + }
614 + }
615
616 +out:
617 + mutex_unlock(&priv->state_lock);
618 return err;
619 }
620
621 diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
622 index c3fc1cc4bb2b9..882ea12098b7a 100644
623 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
624 +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
625 @@ -25,16 +25,8 @@
626 #define MLXSW_THERMAL_ZONE_MAX_NAME 16
627 #define MLXSW_THERMAL_TEMP_SCORE_MAX GENMASK(31, 0)
628 #define MLXSW_THERMAL_MAX_STATE 10
629 +#define MLXSW_THERMAL_MIN_STATE 2
630 #define MLXSW_THERMAL_MAX_DUTY 255
631 -/* Minimum and maximum fan allowed speed in percent: from 20% to 100%. Values
632 - * MLXSW_THERMAL_MAX_STATE + x, where x is between 2 and 10 are used for
633 - * setting fan speed dynamic minimum. For example, if value is set to 14 (40%)
634 - * cooling levels vector will be set to 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10 to
635 - * introduce PWM speed in percent: 40, 40, 40, 40, 40, 50, 60. 70, 80, 90, 100.
636 - */
637 -#define MLXSW_THERMAL_SPEED_MIN (MLXSW_THERMAL_MAX_STATE + 2)
638 -#define MLXSW_THERMAL_SPEED_MAX (MLXSW_THERMAL_MAX_STATE * 2)
639 -#define MLXSW_THERMAL_SPEED_MIN_LEVEL 2 /* 20% */
640
641 /* External cooling devices, allowed for binding to mlxsw thermal zones. */
642 static char * const mlxsw_thermal_external_allowed_cdev[] = {
643 @@ -703,49 +695,16 @@ static int mlxsw_thermal_set_cur_state(struct thermal_cooling_device *cdev,
644 struct mlxsw_thermal *thermal = cdev->devdata;
645 struct device *dev = thermal->bus_info->dev;
646 char mfsc_pl[MLXSW_REG_MFSC_LEN];
647 - unsigned long cur_state, i;
648 int idx;
649 - u8 duty;
650 int err;
651
652 + if (state > MLXSW_THERMAL_MAX_STATE)
653 + return -EINVAL;
654 +
655 idx = mlxsw_get_cooling_device_idx(thermal, cdev);
656 if (idx < 0)
657 return idx;
658
659 - /* Verify if this request is for changing allowed fan dynamical
660 - * minimum. If it is - update cooling levels accordingly and update
661 - * state, if current state is below the newly requested minimum state.
662 - * For example, if current state is 5, and minimal state is to be
663 - * changed from 4 to 6, thermal->cooling_levels[0 to 5] will be changed
664 - * all from 4 to 6. And state 5 (thermal->cooling_levels[4]) should be
665 - * overwritten.
666 - */
667 - if (state >= MLXSW_THERMAL_SPEED_MIN &&
668 - state <= MLXSW_THERMAL_SPEED_MAX) {
669 - state -= MLXSW_THERMAL_MAX_STATE;
670 - for (i = 0; i <= MLXSW_THERMAL_MAX_STATE; i++)
671 - thermal->cooling_levels[i] = max(state, i);
672 -
673 - mlxsw_reg_mfsc_pack(mfsc_pl, idx, 0);
674 - err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfsc), mfsc_pl);
675 - if (err)
676 - return err;
677 -
678 - duty = mlxsw_reg_mfsc_pwm_duty_cycle_get(mfsc_pl);
679 - cur_state = mlxsw_duty_to_state(duty);
680 -
681 - /* If current fan state is lower than requested dynamical
682 - * minimum, increase fan speed up to dynamical minimum.
683 - */
684 - if (state < cur_state)
685 - return 0;
686 -
687 - state = cur_state;
688 - }
689 -
690 - if (state > MLXSW_THERMAL_MAX_STATE)
691 - return -EINVAL;
692 -
693 /* Normalize the state to the valid speed range. */
694 state = thermal->cooling_levels[state];
695 mlxsw_reg_mfsc_pack(mfsc_pl, idx, mlxsw_state_to_duty(state));
696 @@ -1040,8 +999,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
697
698 /* Initialize cooling levels per PWM state. */
699 for (i = 0; i < MLXSW_THERMAL_MAX_STATE; i++)
700 - thermal->cooling_levels[i] = max(MLXSW_THERMAL_SPEED_MIN_LEVEL,
701 - i);
702 + thermal->cooling_levels[i] = max(MLXSW_THERMAL_MIN_STATE, i);
703
704 thermal->polling_delay = bus_info->low_frequency ?
705 MLXSW_THERMAL_SLOW_POLL_INT :
706 diff --git a/drivers/net/ethernet/microchip/encx24j600-regmap.c b/drivers/net/ethernet/microchip/encx24j600-regmap.c
707 index 1f496fac70332..e2528633c09a1 100644
708 --- a/drivers/net/ethernet/microchip/encx24j600-regmap.c
709 +++ b/drivers/net/ethernet/microchip/encx24j600-regmap.c
710 @@ -502,13 +502,19 @@ static struct regmap_bus phymap_encx24j600 = {
711 .reg_read = regmap_encx24j600_phy_reg_read,
712 };
713
714 -void devm_regmap_init_encx24j600(struct device *dev,
715 - struct encx24j600_context *ctx)
716 +int devm_regmap_init_encx24j600(struct device *dev,
717 + struct encx24j600_context *ctx)
718 {
719 mutex_init(&ctx->mutex);
720 regcfg.lock_arg = ctx;
721 ctx->regmap = devm_regmap_init(dev, &regmap_encx24j600, ctx, &regcfg);
722 + if (IS_ERR(ctx->regmap))
723 + return PTR_ERR(ctx->regmap);
724 ctx->phymap = devm_regmap_init(dev, &phymap_encx24j600, ctx, &phycfg);
725 + if (IS_ERR(ctx->phymap))
726 + return PTR_ERR(ctx->phymap);
727 +
728 + return 0;
729 }
730 EXPORT_SYMBOL_GPL(devm_regmap_init_encx24j600);
731
732 diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
733 index c3a6edc0ddf62..6b43afc4e3246 100644
734 --- a/drivers/net/ethernet/microchip/encx24j600.c
735 +++ b/drivers/net/ethernet/microchip/encx24j600.c
736 @@ -1027,10 +1027,13 @@ static int encx24j600_spi_probe(struct spi_device *spi)
737 priv->speed = SPEED_100;
738
739 priv->ctx.spi = spi;
740 - devm_regmap_init_encx24j600(&spi->dev, &priv->ctx);
741 ndev->irq = spi->irq;
742 ndev->netdev_ops = &encx24j600_netdev_ops;
743
744 + ret = devm_regmap_init_encx24j600(&spi->dev, &priv->ctx);
745 + if (ret)
746 + goto out_free;
747 +
748 mutex_init(&priv->lock);
749
750 /* Reset device and check if it is connected */
751 diff --git a/drivers/net/ethernet/microchip/encx24j600_hw.h b/drivers/net/ethernet/microchip/encx24j600_hw.h
752 index f604a260ede79..711147a159aa9 100644
753 --- a/drivers/net/ethernet/microchip/encx24j600_hw.h
754 +++ b/drivers/net/ethernet/microchip/encx24j600_hw.h
755 @@ -15,8 +15,8 @@ struct encx24j600_context {
756 int bank;
757 };
758
759 -void devm_regmap_init_encx24j600(struct device *dev,
760 - struct encx24j600_context *ctx);
761 +int devm_regmap_init_encx24j600(struct device *dev,
762 + struct encx24j600_context *ctx);
763
764 /* Single-byte instructions */
765 #define BANK_SELECT(bank) (0xC0 | ((bank & (BANK_MASK >> BANK_SHIFT)) << 1))
766 diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
767 index e0b2bf3279053..71ab4e9c9a171 100644
768 --- a/drivers/net/ethernet/neterion/s2io.c
769 +++ b/drivers/net/ethernet/neterion/s2io.c
770 @@ -8565,7 +8565,7 @@ static void s2io_io_resume(struct pci_dev *pdev)
771 return;
772 }
773
774 - if (s2io_set_mac_addr(netdev, netdev->dev_addr) == FAILURE) {
775 + if (do_s2io_prog_unicast(netdev, netdev->dev_addr) == FAILURE) {
776 s2io_card_down(sp);
777 pr_err("Can't restore mac addr after reset.\n");
778 return;
779 diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
780 index e66002251596b..99ba3551458fc 100644
781 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
782 +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
783 @@ -912,6 +912,10 @@ static int ionic_addr_add(struct net_device *netdev, const u8 *addr)
784
785 static int ionic_addr_del(struct net_device *netdev, const u8 *addr)
786 {
787 + /* Don't delete our own address from the uc list */
788 + if (ether_addr_equal(addr, netdev->dev_addr))
789 + return 0;
790 +
791 return ionic_lif_addr(netdev_priv(netdev), addr, false);
792 }
793
794 diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
795 index 1db49424aa43c..1cbcc27602780 100644
796 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c
797 +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
798 @@ -1238,6 +1238,7 @@ static int qed_slowpath_start(struct qed_dev *cdev,
799 } else {
800 DP_NOTICE(cdev,
801 "Failed to acquire PTT for aRFS\n");
802 + rc = -EINVAL;
803 goto err;
804 }
805 }
806 diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
807 index 2bac49b49f739..fbf2deafe8ba3 100644
808 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
809 +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
810 @@ -218,11 +218,18 @@ static void dwmac1000_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space)
811 readl(ioaddr + DMA_BUS_MODE + i * 4);
812 }
813
814 -static void dwmac1000_get_hw_feature(void __iomem *ioaddr,
815 - struct dma_features *dma_cap)
816 +static int dwmac1000_get_hw_feature(void __iomem *ioaddr,
817 + struct dma_features *dma_cap)
818 {
819 u32 hw_cap = readl(ioaddr + DMA_HW_FEATURE);
820
821 + if (!hw_cap) {
822 + /* 0x00000000 is the value read on old hardware that does not
823 + * implement this register
824 + */
825 + return -EOPNOTSUPP;
826 + }
827 +
828 dma_cap->mbps_10_100 = (hw_cap & DMA_HW_FEAT_MIISEL);
829 dma_cap->mbps_1000 = (hw_cap & DMA_HW_FEAT_GMIISEL) >> 1;
830 dma_cap->half_duplex = (hw_cap & DMA_HW_FEAT_HDSEL) >> 2;
831 @@ -252,6 +259,8 @@ static void dwmac1000_get_hw_feature(void __iomem *ioaddr,
832 dma_cap->number_tx_channel = (hw_cap & DMA_HW_FEAT_TXCHCNT) >> 22;
833 /* Alternate (enhanced) DESC mode */
834 dma_cap->enh_desc = (hw_cap & DMA_HW_FEAT_ENHDESSEL) >> 24;
835 +
836 + return 0;
837 }
838
839 static void dwmac1000_rx_watchdog(void __iomem *ioaddr, u32 riwt,
840 diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
841 index 0d993f4b701c2..ae473d85b7fb8 100644
842 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
843 +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
844 @@ -336,8 +336,8 @@ static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode,
845 writel(mtl_tx_op, ioaddr + MTL_CHAN_TX_OP_MODE(channel));
846 }
847
848 -static void dwmac4_get_hw_feature(void __iomem *ioaddr,
849 - struct dma_features *dma_cap)
850 +static int dwmac4_get_hw_feature(void __iomem *ioaddr,
851 + struct dma_features *dma_cap)
852 {
853 u32 hw_cap = readl(ioaddr + GMAC_HW_FEATURE0);
854
855 @@ -400,6 +400,8 @@ static void dwmac4_get_hw_feature(void __iomem *ioaddr,
856 dma_cap->frpbs = (hw_cap & GMAC_HW_FEAT_FRPBS) >> 11;
857 dma_cap->frpsel = (hw_cap & GMAC_HW_FEAT_FRPSEL) >> 10;
858 dma_cap->dvlan = (hw_cap & GMAC_HW_FEAT_DVLAN) >> 5;
859 +
860 + return 0;
861 }
862
863 /* Enable/disable TSO feature and set MSS */
864 diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
865 index 4af7271cea561..07ef0ac725b3e 100644
866 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
867 +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
868 @@ -356,8 +356,8 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
869 return ret;
870 }
871
872 -static void dwxgmac2_get_hw_feature(void __iomem *ioaddr,
873 - struct dma_features *dma_cap)
874 +static int dwxgmac2_get_hw_feature(void __iomem *ioaddr,
875 + struct dma_features *dma_cap)
876 {
877 u32 hw_cap;
878
879 @@ -425,6 +425,8 @@ static void dwxgmac2_get_hw_feature(void __iomem *ioaddr,
880 dma_cap->frpes = (hw_cap & XGMAC_HWFEAT_FRPES) >> 11;
881 dma_cap->frpbs = (hw_cap & XGMAC_HWFEAT_FRPPB) >> 9;
882 dma_cap->frpsel = (hw_cap & XGMAC_HWFEAT_FRPSEL) >> 3;
883 +
884 + return 0;
885 }
886
887 static void dwxgmac2_rx_watchdog(void __iomem *ioaddr, u32 riwt, u32 nchan)
888 diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
889 index 9010d881b12e5..59a1d8c003721 100644
890 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
891 +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
892 @@ -196,8 +196,8 @@ struct stmmac_dma_ops {
893 int (*dma_interrupt) (void __iomem *ioaddr,
894 struct stmmac_extra_stats *x, u32 chan);
895 /* If supported then get the optional core features */
896 - void (*get_hw_feature)(void __iomem *ioaddr,
897 - struct dma_features *dma_cap);
898 + int (*get_hw_feature)(void __iomem *ioaddr,
899 + struct dma_features *dma_cap);
900 /* Program the HW RX Watchdog */
901 void (*rx_watchdog)(void __iomem *ioaddr, u32 riwt, u32 number_chan);
902 void (*set_tx_ring_len)(void __iomem *ioaddr, u32 len, u32 chan);
903 @@ -247,7 +247,7 @@ struct stmmac_dma_ops {
904 #define stmmac_dma_interrupt_status(__priv, __args...) \
905 stmmac_do_callback(__priv, dma, dma_interrupt, __args)
906 #define stmmac_get_hw_feature(__priv, __args...) \
907 - stmmac_do_void_callback(__priv, dma, get_hw_feature, __args)
908 + stmmac_do_callback(__priv, dma, get_hw_feature, __args)
909 #define stmmac_rx_watchdog(__priv, __args...) \
910 stmmac_do_void_callback(__priv, dma, rx_watchdog, __args)
911 #define stmmac_set_tx_ring_len(__priv, __args...) \
912 diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
913 index 05bdcc5917f6b..ca234d1a0e3bf 100644
914 --- a/drivers/net/usb/Kconfig
915 +++ b/drivers/net/usb/Kconfig
916 @@ -99,6 +99,10 @@ config USB_RTL8150
917 config USB_RTL8152
918 tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
919 select MII
920 + select CRC32
921 + select CRYPTO
922 + select CRYPTO_HASH
923 + select CRYPTO_SHA256
924 help
925 This option adds support for Realtek RTL8152 based USB 2.0
926 10/100 Ethernet adapters and RTL8153 based USB 3.0 10/100/1000
927 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
928 index 6da270e8c6746..c0f4324d8f7c8 100644
929 --- a/drivers/nvmem/core.c
930 +++ b/drivers/nvmem/core.c
931 @@ -954,7 +954,8 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell, void *buf)
932 *p-- = 0;
933
934 /* clear msb bits if any leftover in the last byte */
935 - *p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0);
936 + if (cell->nbits % BITS_PER_BYTE)
937 + *p &= GENMASK((cell->nbits % BITS_PER_BYTE) - 1, 0);
938 }
939
940 static int __nvmem_cell_read(struct nvmem_device *nvmem,
941 diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c
942 index acfaf64ffde68..1c3760c13f832 100644
943 --- a/drivers/platform/mellanox/mlxreg-io.c
944 +++ b/drivers/platform/mellanox/mlxreg-io.c
945 @@ -123,7 +123,7 @@ mlxreg_io_attr_store(struct device *dev, struct device_attribute *attr,
946 return -EINVAL;
947
948 /* Convert buffer to input value. */
949 - ret = kstrtou32(buf, len, &input_val);
950 + ret = kstrtou32(buf, 0, &input_val);
951 if (ret)
952 return ret;
953
954 diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
955 index d242779297ba7..ae8fa4ff05ee3 100644
956 --- a/drivers/usb/host/xhci-pci.c
957 +++ b/drivers/usb/host/xhci-pci.c
958 @@ -28,6 +28,7 @@
959 #define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73
960 #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
961 #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009
962 +#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 0x1100
963 #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400
964
965 #define PCI_VENDOR_ID_ETRON 0x1b6f
966 @@ -98,6 +99,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
967 /* Look for vendor-specific quirks */
968 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
969 (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK ||
970 + pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 ||
971 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) {
972 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
973 pdev->revision == 0x0) {
974 diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
975 index 1228b3d92db06..2c92fd19e7822 100644
976 --- a/drivers/usb/host/xhci-ring.c
977 +++ b/drivers/usb/host/xhci-ring.c
978 @@ -339,16 +339,22 @@ static void xhci_handle_stopped_cmd_ring(struct xhci_hcd *xhci,
979 /* Must be called with xhci->lock held, releases and aquires lock back */
980 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags)
981 {
982 - u64 temp_64;
983 + u32 temp_32;
984 int ret;
985
986 xhci_dbg(xhci, "Abort command ring\n");
987
988 reinit_completion(&xhci->cmd_ring_stop_completion);
989
990 - temp_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
991 - xhci_write_64(xhci, temp_64 | CMD_RING_ABORT,
992 - &xhci->op_regs->cmd_ring);
993 + /*
994 + * The control bits like command stop, abort are located in lower
995 + * dword of the command ring control register. Limit the write
996 + * to the lower dword to avoid corrupting the command ring pointer
997 + * in case if the command ring is stopped by the time upper dword
998 + * is written.
999 + */
1000 + temp_32 = readl(&xhci->op_regs->cmd_ring);
1001 + writel(temp_32 | CMD_RING_ABORT, &xhci->op_regs->cmd_ring);
1002
1003 /* Section 4.6.1.2 of xHCI 1.0 spec says software should also time the
1004 * completion of the Command Abort operation. If CRR is not negated in 5
1005 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1006 index 02a2afd130eb6..4ef7484dff8b2 100644
1007 --- a/drivers/usb/host/xhci.c
1008 +++ b/drivers/usb/host/xhci.c
1009 @@ -3173,10 +3173,13 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd,
1010 return;
1011
1012 /* Bail out if toggle is already being cleared by a endpoint reset */
1013 + spin_lock_irqsave(&xhci->lock, flags);
1014 if (ep->ep_state & EP_HARD_CLEAR_TOGGLE) {
1015 ep->ep_state &= ~EP_HARD_CLEAR_TOGGLE;
1016 + spin_unlock_irqrestore(&xhci->lock, flags);
1017 return;
1018 }
1019 + spin_unlock_irqrestore(&xhci->lock, flags);
1020 /* Only interrupt and bulk ep's use data toggle, USB2 spec 5.5.4-> */
1021 if (usb_endpoint_xfer_control(&host_ep->desc) ||
1022 usb_endpoint_xfer_isoc(&host_ep->desc))
1023 @@ -3262,8 +3265,10 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd,
1024 xhci_free_command(xhci, cfg_cmd);
1025 cleanup:
1026 xhci_free_command(xhci, stop_cmd);
1027 + spin_lock_irqsave(&xhci->lock, flags);
1028 if (ep->ep_state & EP_SOFT_CLEAR_TOGGLE)
1029 ep->ep_state &= ~EP_SOFT_CLEAR_TOGGLE;
1030 + spin_unlock_irqrestore(&xhci->lock, flags);
1031 }
1032
1033 static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
1034 diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
1035 index 89d659cef5c63..1b9ebd756f097 100644
1036 --- a/drivers/usb/musb/musb_dsps.c
1037 +++ b/drivers/usb/musb/musb_dsps.c
1038 @@ -899,11 +899,13 @@ static int dsps_probe(struct platform_device *pdev)
1039 if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL) {
1040 ret = dsps_setup_optional_vbus_irq(pdev, glue);
1041 if (ret)
1042 - goto err;
1043 + goto unregister_pdev;
1044 }
1045
1046 return 0;
1047
1048 +unregister_pdev:
1049 + platform_device_unregister(glue->musb);
1050 err:
1051 pm_runtime_disable(&pdev->dev);
1052 iounmap(glue->usbss_base);
1053 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1054 index 82016d9781460..a1e9cbe518c74 100644
1055 --- a/drivers/usb/serial/option.c
1056 +++ b/drivers/usb/serial/option.c
1057 @@ -246,11 +246,13 @@ static void option_instat_callback(struct urb *urb);
1058 /* These Quectel products use Quectel's vendor ID */
1059 #define QUECTEL_PRODUCT_EC21 0x0121
1060 #define QUECTEL_PRODUCT_EC25 0x0125
1061 +#define QUECTEL_PRODUCT_EG91 0x0191
1062 #define QUECTEL_PRODUCT_EG95 0x0195
1063 #define QUECTEL_PRODUCT_BG96 0x0296
1064 #define QUECTEL_PRODUCT_EP06 0x0306
1065 #define QUECTEL_PRODUCT_EM12 0x0512
1066 #define QUECTEL_PRODUCT_RM500Q 0x0800
1067 +#define QUECTEL_PRODUCT_EC200S_CN 0x6002
1068 #define QUECTEL_PRODUCT_EC200T 0x6026
1069
1070 #define CMOTECH_VENDOR_ID 0x16d8
1071 @@ -1111,6 +1113,9 @@ static const struct usb_device_id option_ids[] = {
1072 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0xff, 0xff),
1073 .driver_info = NUMEP2 },
1074 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0, 0) },
1075 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0xff, 0xff),
1076 + .driver_info = NUMEP2 },
1077 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0, 0) },
1078 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff),
1079 .driver_info = NUMEP2 },
1080 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) },
1081 @@ -1128,6 +1133,7 @@ static const struct usb_device_id option_ids[] = {
1082 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
1083 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
1084 .driver_info = ZLP },
1085 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
1086 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
1087
1088 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
1089 @@ -1227,6 +1233,8 @@ static const struct usb_device_id option_ids[] = {
1090 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1091 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1203, 0xff), /* Telit LE910Cx (RNDIS) */
1092 .driver_info = NCTRL(2) | RSVD(3) },
1093 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1204, 0xff), /* Telit LE910Cx (MBIM) */
1094 + .driver_info = NCTRL(0) | RSVD(1) },
1095 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
1096 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
1097 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
1098 diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
1099 index 0f60363c1bbc8..b1b9923162a04 100644
1100 --- a/drivers/usb/serial/qcserial.c
1101 +++ b/drivers/usb/serial/qcserial.c
1102 @@ -165,6 +165,7 @@ static const struct usb_device_id id_table[] = {
1103 {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */
1104 {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */
1105 {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */
1106 + {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */
1107 {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
1108 {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
1109 {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
1110 diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
1111 index 59a05f1b81054..91627e7443260 100644
1112 --- a/drivers/virtio/virtio.c
1113 +++ b/drivers/virtio/virtio.c
1114 @@ -225,6 +225,17 @@ static int virtio_dev_probe(struct device *_d)
1115 driver_features_legacy = driver_features;
1116 }
1117
1118 + /*
1119 + * Some devices detect legacy solely via F_VERSION_1. Write
1120 + * F_VERSION_1 to force LE config space accesses before FEATURES_OK for
1121 + * these when needed.
1122 + */
1123 + if (drv->validate && !virtio_legacy_is_little_endian()
1124 + && device_features & BIT_ULL(VIRTIO_F_VERSION_1)) {
1125 + dev->features = BIT_ULL(VIRTIO_F_VERSION_1);
1126 + dev->config->finalize_features(dev);
1127 + }
1128 +
1129 if (device_features & (1ULL << VIRTIO_F_VERSION_1))
1130 dev->features = driver_features & device_features;
1131 else
1132 diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
1133 index 8e6dfe76f9c9d..4ddb4ea2e4a32 100644
1134 --- a/drivers/watchdog/orion_wdt.c
1135 +++ b/drivers/watchdog/orion_wdt.c
1136 @@ -52,7 +52,7 @@
1137 #define WDT_A370_RATIO (1 << WDT_A370_RATIO_SHIFT)
1138
1139 static bool nowayout = WATCHDOG_NOWAYOUT;
1140 -static int heartbeat = -1; /* module parameter (seconds) */
1141 +static int heartbeat; /* module parameter (seconds) */
1142
1143 struct orion_watchdog;
1144
1145 diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
1146 index 5273965226534..19d2104c04629 100644
1147 --- a/fs/btrfs/extent-tree.c
1148 +++ b/fs/btrfs/extent-tree.c
1149 @@ -4596,6 +4596,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
1150 out_free_delayed:
1151 btrfs_free_delayed_extent_op(extent_op);
1152 out_free_buf:
1153 + btrfs_tree_unlock(buf);
1154 free_extent_buffer(buf);
1155 out_free_reserved:
1156 btrfs_free_reserved_extent(fs_info, ins.objectid, ins.offset, 0);
1157 diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
1158 index 8ea4b3da85d1a..9d358dafef367 100644
1159 --- a/fs/btrfs/tree-log.c
1160 +++ b/fs/btrfs/tree-log.c
1161 @@ -1160,7 +1160,10 @@ next:
1162 /* look for a conflicting sequence number */
1163 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir),
1164 ref_index, name, namelen, 0);
1165 - if (di && !IS_ERR(di)) {
1166 + if (IS_ERR(di)) {
1167 + if (PTR_ERR(di) != -ENOENT)
1168 + return PTR_ERR(di);
1169 + } else if (di) {
1170 ret = drop_one_dir_item(trans, root, path, dir, di);
1171 if (ret)
1172 return ret;
1173 @@ -1170,7 +1173,9 @@ next:
1174 /* look for a conflicting name */
1175 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir),
1176 name, namelen, 0);
1177 - if (di && !IS_ERR(di)) {
1178 + if (IS_ERR(di)) {
1179 + return PTR_ERR(di);
1180 + } else if (di) {
1181 ret = drop_one_dir_item(trans, root, path, dir, di);
1182 if (ret)
1183 return ret;
1184 @@ -1944,8 +1949,8 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
1185 struct btrfs_key log_key;
1186 struct inode *dir;
1187 u8 log_type;
1188 - int exists;
1189 - int ret = 0;
1190 + bool exists;
1191 + int ret;
1192 bool update_size = (key->type == BTRFS_DIR_INDEX_KEY);
1193 bool name_added = false;
1194
1195 @@ -1965,12 +1970,12 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
1196 name_len);
1197
1198 btrfs_dir_item_key_to_cpu(eb, di, &log_key);
1199 - exists = btrfs_lookup_inode(trans, root, path, &log_key, 0);
1200 - if (exists == 0)
1201 - exists = 1;
1202 - else
1203 - exists = 0;
1204 + ret = btrfs_lookup_inode(trans, root, path, &log_key, 0);
1205 btrfs_release_path(path);
1206 + if (ret < 0)
1207 + goto out;
1208 + exists = (ret == 0);
1209 + ret = 0;
1210
1211 if (key->type == BTRFS_DIR_ITEM_KEY) {
1212 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid,
1213 @@ -1985,7 +1990,14 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
1214 ret = -EINVAL;
1215 goto out;
1216 }
1217 - if (IS_ERR_OR_NULL(dst_di)) {
1218 +
1219 + if (dst_di == ERR_PTR(-ENOENT))
1220 + dst_di = NULL;
1221 +
1222 + if (IS_ERR(dst_di)) {
1223 + ret = PTR_ERR(dst_di);
1224 + goto out;
1225 + } else if (!dst_di) {
1226 /* we need a sequence number to insert, so we only
1227 * do inserts for the BTRFS_DIR_INDEX_KEY types
1228 */
1229 diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
1230 index ab5e92897270a..81c9eab8529b6 100644
1231 --- a/fs/overlayfs/file.c
1232 +++ b/fs/overlayfs/file.c
1233 @@ -296,48 +296,6 @@ out_unlock:
1234 return ret;
1235 }
1236
1237 -static ssize_t ovl_splice_read(struct file *in, loff_t *ppos,
1238 - struct pipe_inode_info *pipe, size_t len,
1239 - unsigned int flags)
1240 -{
1241 - ssize_t ret;
1242 - struct fd real;
1243 - const struct cred *old_cred;
1244 -
1245 - ret = ovl_real_fdget(in, &real);
1246 - if (ret)
1247 - return ret;
1248 -
1249 - old_cred = ovl_override_creds(file_inode(in)->i_sb);
1250 - ret = generic_file_splice_read(real.file, ppos, pipe, len, flags);
1251 - revert_creds(old_cred);
1252 -
1253 - ovl_file_accessed(in);
1254 - fdput(real);
1255 - return ret;
1256 -}
1257 -
1258 -static ssize_t
1259 -ovl_splice_write(struct pipe_inode_info *pipe, struct file *out,
1260 - loff_t *ppos, size_t len, unsigned int flags)
1261 -{
1262 - struct fd real;
1263 - const struct cred *old_cred;
1264 - ssize_t ret;
1265 -
1266 - ret = ovl_real_fdget(out, &real);
1267 - if (ret)
1268 - return ret;
1269 -
1270 - old_cred = ovl_override_creds(file_inode(out)->i_sb);
1271 - ret = iter_file_splice_write(pipe, real.file, ppos, len, flags);
1272 - revert_creds(old_cred);
1273 -
1274 - ovl_file_accessed(out);
1275 - fdput(real);
1276 - return ret;
1277 -}
1278 -
1279 static int ovl_fsync(struct file *file, loff_t start, loff_t end, int datasync)
1280 {
1281 struct fd real;
1282 @@ -694,8 +652,8 @@ const struct file_operations ovl_file_operations = {
1283 .fadvise = ovl_fadvise,
1284 .unlocked_ioctl = ovl_ioctl,
1285 .compat_ioctl = ovl_compat_ioctl,
1286 - .splice_read = ovl_splice_read,
1287 - .splice_write = ovl_splice_write,
1288 + .splice_read = generic_file_splice_read,
1289 + .splice_write = iter_file_splice_write,
1290
1291 .copy_file_range = ovl_copy_file_range,
1292 .remap_file_range = ovl_remap_file_range,
1293 diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
1294 index 36516fe86fe7c..641a01bc5f6f7 100644
1295 --- a/include/linux/mlx5/mlx5_ifc.h
1296 +++ b/include/linux/mlx5/mlx5_ifc.h
1297 @@ -8942,16 +8942,22 @@ struct mlx5_ifc_pcmr_reg_bits {
1298 u8 reserved_at_0[0x8];
1299 u8 local_port[0x8];
1300 u8 reserved_at_10[0x10];
1301 +
1302 u8 entropy_force_cap[0x1];
1303 u8 entropy_calc_cap[0x1];
1304 u8 entropy_gre_calc_cap[0x1];
1305 - u8 reserved_at_23[0x1b];
1306 + u8 reserved_at_23[0xf];
1307 + u8 rx_ts_over_crc_cap[0x1];
1308 + u8 reserved_at_33[0xb];
1309 u8 fcs_cap[0x1];
1310 u8 reserved_at_3f[0x1];
1311 +
1312 u8 entropy_force[0x1];
1313 u8 entropy_calc[0x1];
1314 u8 entropy_gre_calc[0x1];
1315 - u8 reserved_at_43[0x1b];
1316 + u8 reserved_at_43[0xf];
1317 + u8 rx_ts_over_crc[0x1];
1318 + u8 reserved_at_53[0xb];
1319 u8 fcs_chk[0x1];
1320 u8 reserved_at_5f[0x1];
1321 };
1322 diff --git a/net/nfc/af_nfc.c b/net/nfc/af_nfc.c
1323 index 4a9e72073564a..581358dcbdf8d 100644
1324 --- a/net/nfc/af_nfc.c
1325 +++ b/net/nfc/af_nfc.c
1326 @@ -60,6 +60,9 @@ int nfc_proto_register(const struct nfc_protocol *nfc_proto)
1327 proto_tab[nfc_proto->id] = nfc_proto;
1328 write_unlock(&proto_tab_lock);
1329
1330 + if (rc)
1331 + proto_unregister(nfc_proto->proto);
1332 +
1333 return rc;
1334 }
1335 EXPORT_SYMBOL(nfc_proto_register);
1336 diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c
1337 index e3599ed4a7a87..9c9caa307cf16 100644
1338 --- a/net/nfc/digital_core.c
1339 +++ b/net/nfc/digital_core.c
1340 @@ -277,6 +277,7 @@ int digital_tg_configure_hw(struct nfc_digital_dev *ddev, int type, int param)
1341 static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech)
1342 {
1343 struct digital_tg_mdaa_params *params;
1344 + int rc;
1345
1346 params = kzalloc(sizeof(*params), GFP_KERNEL);
1347 if (!params)
1348 @@ -291,8 +292,12 @@ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech)
1349 get_random_bytes(params->nfcid2 + 2, NFC_NFCID2_MAXSIZE - 2);
1350 params->sc = DIGITAL_SENSF_FELICA_SC;
1351
1352 - return digital_send_cmd(ddev, DIGITAL_CMD_TG_LISTEN_MDAA, NULL, params,
1353 - 500, digital_tg_recv_atr_req, NULL);
1354 + rc = digital_send_cmd(ddev, DIGITAL_CMD_TG_LISTEN_MDAA, NULL, params,
1355 + 500, digital_tg_recv_atr_req, NULL);
1356 + if (rc)
1357 + kfree(params);
1358 +
1359 + return rc;
1360 }
1361
1362 static int digital_tg_listen_md(struct nfc_digital_dev *ddev, u8 rf_tech)
1363 diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c
1364 index 84d2345c75a3f..3adf4589852af 100644
1365 --- a/net/nfc/digital_technology.c
1366 +++ b/net/nfc/digital_technology.c
1367 @@ -465,8 +465,12 @@ static int digital_in_send_sdd_req(struct nfc_digital_dev *ddev,
1368 skb_put_u8(skb, sel_cmd);
1369 skb_put_u8(skb, DIGITAL_SDD_REQ_SEL_PAR);
1370
1371 - return digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res,
1372 - target);
1373 + rc = digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res,
1374 + target);
1375 + if (rc)
1376 + kfree_skb(skb);
1377 +
1378 + return rc;
1379 }
1380
1381 static void digital_in_recv_sens_res(struct nfc_digital_dev *ddev, void *arg,
1382 diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
1383 index 8766ab5b87880..5eb3b1b7ae5e7 100644
1384 --- a/net/sched/sch_mqprio.c
1385 +++ b/net/sched/sch_mqprio.c
1386 @@ -529,22 +529,28 @@ static int mqprio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
1387 for (i = tc.offset; i < tc.offset + tc.count; i++) {
1388 struct netdev_queue *q = netdev_get_tx_queue(dev, i);
1389 struct Qdisc *qdisc = rtnl_dereference(q->qdisc);
1390 - struct gnet_stats_basic_cpu __percpu *cpu_bstats = NULL;
1391 - struct gnet_stats_queue __percpu *cpu_qstats = NULL;
1392
1393 spin_lock_bh(qdisc_lock(qdisc));
1394 +
1395 if (qdisc_is_percpu_stats(qdisc)) {
1396 - cpu_bstats = qdisc->cpu_bstats;
1397 - cpu_qstats = qdisc->cpu_qstats;
1398 + qlen = qdisc_qlen_sum(qdisc);
1399 +
1400 + __gnet_stats_copy_basic(NULL, &bstats,
1401 + qdisc->cpu_bstats,
1402 + &qdisc->bstats);
1403 + __gnet_stats_copy_queue(&qstats,
1404 + qdisc->cpu_qstats,
1405 + &qdisc->qstats,
1406 + qlen);
1407 + } else {
1408 + qlen += qdisc->q.qlen;
1409 + bstats.bytes += qdisc->bstats.bytes;
1410 + bstats.packets += qdisc->bstats.packets;
1411 + qstats.backlog += qdisc->qstats.backlog;
1412 + qstats.drops += qdisc->qstats.drops;
1413 + qstats.requeues += qdisc->qstats.requeues;
1414 + qstats.overlimits += qdisc->qstats.overlimits;
1415 }
1416 -
1417 - qlen = qdisc_qlen_sum(qdisc);
1418 - __gnet_stats_copy_basic(NULL, &sch->bstats,
1419 - cpu_bstats, &qdisc->bstats);
1420 - __gnet_stats_copy_queue(&sch->qstats,
1421 - cpu_qstats,
1422 - &qdisc->qstats,
1423 - qlen);
1424 spin_unlock_bh(qdisc_lock(qdisc));
1425 }
1426
1427 diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
1428 index 000aa62281f46..4eebe708c8e4e 100644
1429 --- a/net/sctp/sm_make_chunk.c
1430 +++ b/net/sctp/sm_make_chunk.c
1431 @@ -3659,7 +3659,7 @@ struct sctp_chunk *sctp_make_strreset_req(
1432 outlen = (sizeof(outreq) + stream_len) * out;
1433 inlen = (sizeof(inreq) + stream_len) * in;
1434
1435 - retval = sctp_make_reconf(asoc, outlen + inlen);
1436 + retval = sctp_make_reconf(asoc, SCTP_PAD4(outlen) + SCTP_PAD4(inlen));
1437 if (!retval)
1438 return NULL;
1439
1440 diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
1441 index 4f84657f55c23..f459ae883a0a6 100755
1442 --- a/scripts/recordmcount.pl
1443 +++ b/scripts/recordmcount.pl
1444 @@ -222,7 +222,7 @@ if ($arch =~ /(x86(_64)?)|(i386)/) {
1445 $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
1446 $weak_regex = "^[0-9a-fA-F]+\\s+([wW])\\s+(\\S+)";
1447 $section_regex = "Disassembly of section\\s+(\\S+):";
1448 -$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
1449 +$function_regex = "^([0-9a-fA-F]+)\\s+<([^^]*?)>:";
1450 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)\$";
1451 $section_type = '@progbits';
1452 $mcount_adjust = 0;
1453 diff --git a/sound/core/seq_device.c b/sound/core/seq_device.c
1454 index e9dbad93f9d09..c9223049551c4 100644
1455 --- a/sound/core/seq_device.c
1456 +++ b/sound/core/seq_device.c
1457 @@ -147,6 +147,8 @@ static int snd_seq_device_dev_free(struct snd_device *device)
1458 struct snd_seq_device *dev = device->device_data;
1459
1460 cancel_autoload_drivers();
1461 + if (dev->private_free)
1462 + dev->private_free(dev);
1463 put_device(&dev->dev);
1464 return 0;
1465 }
1466 @@ -174,11 +176,7 @@ static int snd_seq_device_dev_disconnect(struct snd_device *device)
1467
1468 static void snd_seq_dev_release(struct device *dev)
1469 {
1470 - struct snd_seq_device *sdev = to_seq_dev(dev);
1471 -
1472 - if (sdev->private_free)
1473 - sdev->private_free(sdev);
1474 - kfree(sdev);
1475 + kfree(to_seq_dev(dev));
1476 }
1477
1478 /*
1479 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1480 index abe371c01fba2..c4837c78a8624 100644
1481 --- a/sound/pci/hda/patch_realtek.c
1482 +++ b/sound/pci/hda/patch_realtek.c
1483 @@ -517,6 +517,8 @@ static void alc_shutup_pins(struct hda_codec *codec)
1484 struct alc_spec *spec = codec->spec;
1485
1486 switch (codec->core.vendor_id) {
1487 + case 0x10ec0236:
1488 + case 0x10ec0256:
1489 case 0x10ec0283:
1490 case 0x10ec0286:
1491 case 0x10ec0288:
1492 @@ -2539,7 +2541,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
1493 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1494 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1495 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1496 - SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1497 + SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1498 + SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
1499 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
1500 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
1501 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
1502 @@ -3521,7 +3524,8 @@ static void alc256_shutup(struct hda_codec *codec)
1503 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
1504 * when booting with headset plugged. So skip setting it for the codec alc257
1505 */
1506 - if (codec->core.vendor_id != 0x10ec0257)
1507 + if (spec->codec_variant != ALC269_TYPE_ALC257 &&
1508 + spec->codec_variant != ALC269_TYPE_ALC256)
1509 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1510
1511 if (!spec->no_shutup_pins)
1512 @@ -9688,6 +9692,9 @@ enum {
1513 ALC671_FIXUP_HP_HEADSET_MIC2,
1514 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
1515 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
1516 + ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
1517 + ALC668_FIXUP_HEADSET_MIC,
1518 + ALC668_FIXUP_MIC_DET_COEF,
1519 };
1520
1521 static const struct hda_fixup alc662_fixups[] = {
1522 @@ -10071,6 +10078,29 @@ static const struct hda_fixup alc662_fixups[] = {
1523 .chained = true,
1524 .chain_id = ALC662_FIXUP_USI_FUNC
1525 },
1526 + [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
1527 + .type = HDA_FIXUP_PINS,
1528 + .v.pins = (const struct hda_pintbl[]) {
1529 + { 0x1b, 0x04a1112c },
1530 + { }
1531 + },
1532 + .chained = true,
1533 + .chain_id = ALC668_FIXUP_HEADSET_MIC
1534 + },
1535 + [ALC668_FIXUP_HEADSET_MIC] = {
1536 + .type = HDA_FIXUP_FUNC,
1537 + .v.func = alc269_fixup_headset_mic,
1538 + .chained = true,
1539 + .chain_id = ALC668_FIXUP_MIC_DET_COEF
1540 + },
1541 + [ALC668_FIXUP_MIC_DET_COEF] = {
1542 + .type = HDA_FIXUP_VERBS,
1543 + .v.verbs = (const struct hda_verb[]) {
1544 + { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
1545 + { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
1546 + {}
1547 + },
1548 + },
1549 };
1550
1551 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
1552 @@ -10106,6 +10136,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
1553 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
1554 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
1555 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
1556 + SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
1557 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
1558 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
1559 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1560 diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
1561 index 441335abb4018..9620ae0003ce4 100644
1562 --- a/sound/usb/quirks-table.h
1563 +++ b/sound/usb/quirks-table.h
1564 @@ -125,6 +125,48 @@
1565 .bInterfaceClass = USB_CLASS_AUDIO,
1566 },
1567
1568 +/*
1569 + * Creative Technology, Ltd Live! Cam Sync HD [VF0770]
1570 + * The device advertises 8 formats, but only a rate of 48kHz is honored by the
1571 + * hardware and 24 bits give chopped audio, so only report the one working
1572 + * combination.
1573 + */
1574 +{
1575 + USB_DEVICE(0x041e, 0x4095),
1576 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
1577 + .ifnum = QUIRK_ANY_INTERFACE,
1578 + .type = QUIRK_COMPOSITE,
1579 + .data = &(const struct snd_usb_audio_quirk[]) {
1580 + {
1581 + .ifnum = 2,
1582 + .type = QUIRK_AUDIO_STANDARD_MIXER,
1583 + },
1584 + {
1585 + .ifnum = 3,
1586 + .type = QUIRK_AUDIO_FIXED_ENDPOINT,
1587 + .data = &(const struct audioformat) {
1588 + .formats = SNDRV_PCM_FMTBIT_S16_LE,
1589 + .channels = 2,
1590 + .fmt_bits = 16,
1591 + .iface = 3,
1592 + .altsetting = 4,
1593 + .altset_idx = 4,
1594 + .endpoint = 0x82,
1595 + .ep_attr = 0x05,
1596 + .rates = SNDRV_PCM_RATE_48000,
1597 + .rate_min = 48000,
1598 + .rate_max = 48000,
1599 + .nr_rates = 1,
1600 + .rate_table = (unsigned int[]) { 48000 },
1601 + },
1602 + },
1603 + {
1604 + .ifnum = -1
1605 + },
1606 + },
1607 + },
1608 +},
1609 +
1610 /*
1611 * HP Wireless Audio
1612 * When not ignored, causes instability issues for some users, forcing them to