Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Wed, 30 Aug 2017 10:08:16
Message-Id: 1504087684.81b53e647edd5e728ad3940cded91a2382010bf6.mpagano@gentoo
1 commit: 81b53e647edd5e728ad3940cded91a2382010bf6
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 30 10:08:04 2017 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 30 10:08:04 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=81b53e64
7
8 Linux patch 4.4.85
9
10 0000_README | 4 +
11 1084_linux-4.4.85.patch | 1511 +++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 1515 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index ddf9728..e008a1d 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -379,6 +379,10 @@ Patch: 1083_linux-4.4.84.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.4.84
21
22 +Patch: 1084_linux-4.4.85.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.4.85
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1084_linux-4.4.85.patch b/1084_linux-4.4.85.patch
31 new file mode 100644
32 index 0000000..27aa21d
33 --- /dev/null
34 +++ b/1084_linux-4.4.85.patch
35 @@ -0,0 +1,1511 @@
36 +diff --git a/Makefile b/Makefile
37 +index 9d77ac063ec0..0f3d843f42a7 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 4
42 + PATCHLEVEL = 4
43 +-SUBLEVEL = 84
44 ++SUBLEVEL = 85
45 + EXTRAVERSION =
46 + NAME = Blurry Fish Butt
47 +
48 +diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
49 +index 210ef3e72332..0ddd7144c492 100644
50 +--- a/arch/arc/include/asm/cache.h
51 ++++ b/arch/arc/include/asm/cache.h
52 +@@ -88,7 +88,9 @@ extern int ioc_exists;
53 + #define ARC_REG_SLC_FLUSH 0x904
54 + #define ARC_REG_SLC_INVALIDATE 0x905
55 + #define ARC_REG_SLC_RGN_START 0x914
56 ++#define ARC_REG_SLC_RGN_START1 0x915
57 + #define ARC_REG_SLC_RGN_END 0x916
58 ++#define ARC_REG_SLC_RGN_END1 0x917
59 +
60 + /* Bit val in SLC_CONTROL */
61 + #define SLC_CTRL_IM 0x040
62 +diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
63 +index d81b6d7e11e7..9a84cbdd44b0 100644
64 +--- a/arch/arc/mm/cache.c
65 ++++ b/arch/arc/mm/cache.c
66 +@@ -543,6 +543,7 @@ noinline void slc_op(phys_addr_t paddr, unsigned long sz, const int op)
67 + static DEFINE_SPINLOCK(lock);
68 + unsigned long flags;
69 + unsigned int ctrl;
70 ++ phys_addr_t end;
71 +
72 + spin_lock_irqsave(&lock, flags);
73 +
74 +@@ -572,8 +573,16 @@ noinline void slc_op(phys_addr_t paddr, unsigned long sz, const int op)
75 + * END needs to be setup before START (latter triggers the operation)
76 + * END can't be same as START, so add (l2_line_sz - 1) to sz
77 + */
78 +- write_aux_reg(ARC_REG_SLC_RGN_END, (paddr + sz + l2_line_sz - 1));
79 +- write_aux_reg(ARC_REG_SLC_RGN_START, paddr);
80 ++ end = paddr + sz + l2_line_sz - 1;
81 ++ if (is_pae40_enabled())
82 ++ write_aux_reg(ARC_REG_SLC_RGN_END1, upper_32_bits(end));
83 ++
84 ++ write_aux_reg(ARC_REG_SLC_RGN_END, lower_32_bits(end));
85 ++
86 ++ if (is_pae40_enabled())
87 ++ write_aux_reg(ARC_REG_SLC_RGN_START1, upper_32_bits(paddr));
88 ++
89 ++ write_aux_reg(ARC_REG_SLC_RGN_START, lower_32_bits(paddr));
90 +
91 + while (read_aux_reg(ARC_REG_SLC_CTRL) & SLC_CTRL_BUSY);
92 +
93 +diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
94 +index eac4f3b02df9..bb81cd05f0bc 100644
95 +--- a/drivers/acpi/apei/ghes.c
96 ++++ b/drivers/acpi/apei/ghes.c
97 +@@ -1067,6 +1067,7 @@ static int ghes_remove(struct platform_device *ghes_dev)
98 + if (list_empty(&ghes_sci))
99 + unregister_acpi_hed_notifier(&ghes_notifier_sci);
100 + mutex_unlock(&ghes_list_mutex);
101 ++ synchronize_rcu();
102 + break;
103 + case ACPI_HEST_NOTIFY_NMI:
104 + ghes_nmi_remove(ghes);
105 +diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c
106 +index ccdc8db16bb8..fa2cf2dc4e33 100644
107 +--- a/drivers/acpi/ioapic.c
108 ++++ b/drivers/acpi/ioapic.c
109 +@@ -45,6 +45,12 @@ static acpi_status setup_res(struct acpi_resource *acpi_res, void *data)
110 + struct resource *res = data;
111 + struct resource_win win;
112 +
113 ++ /*
114 ++ * We might assign this to 'res' later, make sure all pointers are
115 ++ * cleared before the resource is added to the global list
116 ++ */
117 ++ memset(&win, 0, sizeof(win));
118 ++
119 + res->flags = 0;
120 + if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM) == 0)
121 + return AE_OK;
122 +diff --git a/drivers/android/binder.c b/drivers/android/binder.c
123 +index 47ddfefe2443..5531f020e561 100644
124 +--- a/drivers/android/binder.c
125 ++++ b/drivers/android/binder.c
126 +@@ -1718,8 +1718,12 @@ static void binder_transaction(struct binder_proc *proc,
127 + list_add_tail(&t->work.entry, target_list);
128 + tcomplete->type = BINDER_WORK_TRANSACTION_COMPLETE;
129 + list_add_tail(&tcomplete->entry, &thread->todo);
130 +- if (target_wait)
131 +- wake_up_interruptible(target_wait);
132 ++ if (target_wait) {
133 ++ if (reply || !(t->flags & TF_ONE_WAY))
134 ++ wake_up_interruptible_sync(target_wait);
135 ++ else
136 ++ wake_up_interruptible(target_wait);
137 ++ }
138 + return;
139 +
140 + err_get_unused_fd_failed:
141 +@@ -2865,7 +2869,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
142 + const char *failure_string;
143 + struct binder_buffer *buffer;
144 +
145 +- if (proc->tsk != current)
146 ++ if (proc->tsk != current->group_leader)
147 + return -EINVAL;
148 +
149 + if ((vma->vm_end - vma->vm_start) > SZ_4M)
150 +@@ -2966,8 +2970,8 @@ static int binder_open(struct inode *nodp, struct file *filp)
151 + proc = kzalloc(sizeof(*proc), GFP_KERNEL);
152 + if (proc == NULL)
153 + return -ENOMEM;
154 +- get_task_struct(current);
155 +- proc->tsk = current;
156 ++ get_task_struct(current->group_leader);
157 ++ proc->tsk = current->group_leader;
158 + INIT_LIST_HEAD(&proc->todo);
159 + init_waitqueue_head(&proc->wait);
160 + proc->default_priority = task_nice(current);
161 +diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
162 +index 6253775b8d9c..50d74e5ce41b 100644
163 +--- a/drivers/gpu/drm/drm_atomic.c
164 ++++ b/drivers/gpu/drm/drm_atomic.c
165 +@@ -1247,6 +1247,9 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
166 + if (config->funcs->atomic_check)
167 + ret = config->funcs->atomic_check(state->dev, state);
168 +
169 ++ if (ret)
170 ++ return ret;
171 ++
172 + if (!state->allow_modeset) {
173 + for_each_crtc_in_state(state, crtc, crtc_state, i) {
174 + if (drm_atomic_crtc_needs_modeset(crtc_state)) {
175 +@@ -1257,7 +1260,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
176 + }
177 + }
178 +
179 +- return ret;
180 ++ return 0;
181 + }
182 + EXPORT_SYMBOL(drm_atomic_check_only);
183 +
184 +diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
185 +index b205224f1a44..9147113139be 100644
186 +--- a/drivers/gpu/drm/drm_gem.c
187 ++++ b/drivers/gpu/drm/drm_gem.c
188 +@@ -715,13 +715,13 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
189 + struct drm_gem_object *obj = ptr;
190 + struct drm_device *dev = obj->dev;
191 +
192 ++ if (dev->driver->gem_close_object)
193 ++ dev->driver->gem_close_object(obj, file_priv);
194 ++
195 + if (drm_core_check_feature(dev, DRIVER_PRIME))
196 + drm_gem_remove_prime_handles(obj, file_priv);
197 + drm_vma_node_revoke(&obj->vma_node, file_priv->filp);
198 +
199 +- if (dev->driver->gem_close_object)
200 +- dev->driver->gem_close_object(obj, file_priv);
201 +-
202 + drm_gem_object_handle_unreference_unlocked(obj);
203 +
204 + return 0;
205 +diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
206 +index 9255b9c096b6..9befd624a5f0 100644
207 +--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
208 ++++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
209 +@@ -148,8 +148,8 @@ static void rcar_du_crtc_set_display_timing(struct rcar_du_crtc *rcrtc)
210 + rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? OTAR2 : OTAR, 0);
211 +
212 + /* Signal polarities */
213 +- value = ((mode->flags & DRM_MODE_FLAG_PVSYNC) ? 0 : DSMR_VSL)
214 +- | ((mode->flags & DRM_MODE_FLAG_PHSYNC) ? 0 : DSMR_HSL)
215 ++ value = ((mode->flags & DRM_MODE_FLAG_PVSYNC) ? DSMR_VSL : 0)
216 ++ | ((mode->flags & DRM_MODE_FLAG_PHSYNC) ? DSMR_HSL : 0)
217 + | DSMR_DIPM_DE | DSMR_CSPM;
218 + rcar_du_crtc_write(rcrtc, DSMR, value);
219 +
220 +@@ -171,7 +171,7 @@ static void rcar_du_crtc_set_display_timing(struct rcar_du_crtc *rcrtc)
221 + mode->crtc_vsync_start - 1);
222 + rcar_du_crtc_write(rcrtc, VCR, mode->crtc_vtotal - 1);
223 +
224 +- rcar_du_crtc_write(rcrtc, DESR, mode->htotal - mode->hsync_start);
225 ++ rcar_du_crtc_write(rcrtc, DESR, mode->htotal - mode->hsync_start - 1);
226 + rcar_du_crtc_write(rcrtc, DEWR, mode->hdisplay);
227 + }
228 +
229 +diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
230 +index 46429c4be8e5..2b75a4891dec 100644
231 +--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
232 ++++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
233 +@@ -642,13 +642,13 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu,
234 + }
235 +
236 + ret = rcar_du_encoder_init(rcdu, enc_type, output, encoder, connector);
237 +- of_node_put(encoder);
238 +- of_node_put(connector);
239 +-
240 + if (ret && ret != -EPROBE_DEFER)
241 + dev_warn(rcdu->dev,
242 +- "failed to initialize encoder %s (%d), skipping\n",
243 +- encoder->full_name, ret);
244 ++ "failed to initialize encoder %s on output %u (%d), skipping\n",
245 ++ of_node_full_name(encoder), output, ret);
246 ++
247 ++ of_node_put(encoder);
248 ++ of_node_put(connector);
249 +
250 + return ret;
251 + }
252 +diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
253 +index 85043c5bad03..873e04aa9352 100644
254 +--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
255 ++++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
256 +@@ -56,11 +56,11 @@ static int rcar_du_lvdsenc_start(struct rcar_du_lvdsenc *lvds,
257 + return ret;
258 +
259 + /* PLL clock configuration */
260 +- if (freq <= 38000)
261 ++ if (freq < 39000)
262 + pllcr = LVDPLLCR_CEEN | LVDPLLCR_COSEL | LVDPLLCR_PLLDLYCNT_38M;
263 +- else if (freq <= 60000)
264 ++ else if (freq < 61000)
265 + pllcr = LVDPLLCR_CEEN | LVDPLLCR_COSEL | LVDPLLCR_PLLDLYCNT_60M;
266 +- else if (freq <= 121000)
267 ++ else if (freq < 121000)
268 + pllcr = LVDPLLCR_CEEN | LVDPLLCR_COSEL | LVDPLLCR_PLLDLYCNT_121M;
269 + else
270 + pllcr = LVDPLLCR_PLLDLYCNT_150M;
271 +@@ -102,7 +102,7 @@ static int rcar_du_lvdsenc_start(struct rcar_du_lvdsenc *lvds,
272 + /* Turn the PLL on, wait for the startup delay, and turn the output
273 + * on.
274 + */
275 +- lvdcr0 |= LVDCR0_PLLEN;
276 ++ lvdcr0 |= LVDCR0_PLLON;
277 + rcar_lvds_write(lvds, LVDCR0, lvdcr0);
278 +
279 + usleep_range(100, 150);
280 +diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds_regs.h b/drivers/gpu/drm/rcar-du/rcar_lvds_regs.h
281 +index 77cf9289ab65..b1eafd097a79 100644
282 +--- a/drivers/gpu/drm/rcar-du/rcar_lvds_regs.h
283 ++++ b/drivers/gpu/drm/rcar-du/rcar_lvds_regs.h
284 +@@ -18,7 +18,7 @@
285 + #define LVDCR0_DMD (1 << 12)
286 + #define LVDCR0_LVMD_MASK (0xf << 8)
287 + #define LVDCR0_LVMD_SHIFT 8
288 +-#define LVDCR0_PLLEN (1 << 4)
289 ++#define LVDCR0_PLLON (1 << 4)
290 + #define LVDCR0_BEN (1 << 2)
291 + #define LVDCR0_LVEN (1 << 1)
292 + #define LVDCR0_LVRES (1 << 0)
293 +diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
294 +index 6b00061c3746..a2ae2213ef3e 100644
295 +--- a/drivers/i2c/busses/i2c-designware-platdrv.c
296 ++++ b/drivers/i2c/busses/i2c-designware-platdrv.c
297 +@@ -294,7 +294,7 @@ static void dw_i2c_plat_complete(struct device *dev)
298 + #endif
299 +
300 + #ifdef CONFIG_PM
301 +-static int dw_i2c_plat_suspend(struct device *dev)
302 ++static int dw_i2c_plat_runtime_suspend(struct device *dev)
303 + {
304 + struct platform_device *pdev = to_platform_device(dev);
305 + struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
306 +@@ -318,11 +318,21 @@ static int dw_i2c_plat_resume(struct device *dev)
307 + return 0;
308 + }
309 +
310 ++#ifdef CONFIG_PM_SLEEP
311 ++static int dw_i2c_plat_suspend(struct device *dev)
312 ++{
313 ++ pm_runtime_resume(dev);
314 ++ return dw_i2c_plat_runtime_suspend(dev);
315 ++}
316 ++#endif
317 ++
318 + static const struct dev_pm_ops dw_i2c_dev_pm_ops = {
319 + .prepare = dw_i2c_plat_prepare,
320 + .complete = dw_i2c_plat_complete,
321 + SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)
322 +- SET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL)
323 ++ SET_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend,
324 ++ dw_i2c_plat_resume,
325 ++ NULL)
326 + };
327 +
328 + #define DW_I2C_DEV_PMOPS (&dw_i2c_dev_pm_ops)
329 +diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
330 +index 0a86ef43e781..a8db38db622e 100644
331 +--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
332 ++++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
333 +@@ -36,8 +36,6 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)
334 + s32 poll_value = 0;
335 +
336 + if (state) {
337 +- if (!atomic_read(&st->user_requested_state))
338 +- return 0;
339 + if (sensor_hub_device_open(st->hsdev))
340 + return -EIO;
341 +
342 +@@ -84,6 +82,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)
343 + &report_val);
344 + }
345 +
346 ++ pr_debug("HID_SENSOR %s set power_state %d report_state %d\n",
347 ++ st->pdev->name, state_val, report_val);
348 ++
349 + sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
350 + st->power_state.index,
351 + sizeof(state_val), &state_val);
352 +@@ -107,6 +108,7 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
353 + ret = pm_runtime_get_sync(&st->pdev->dev);
354 + else {
355 + pm_runtime_mark_last_busy(&st->pdev->dev);
356 ++ pm_runtime_use_autosuspend(&st->pdev->dev);
357 + ret = pm_runtime_put_autosuspend(&st->pdev->dev);
358 + }
359 + if (ret < 0) {
360 +@@ -175,8 +177,6 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
361 + /* Default to 3 seconds, but can be changed from sysfs */
362 + pm_runtime_set_autosuspend_delay(&attrb->pdev->dev,
363 + 3000);
364 +- pm_runtime_use_autosuspend(&attrb->pdev->dev);
365 +-
366 + return ret;
367 + error_unreg_trigger:
368 + iio_trigger_unregister(trig);
369 +diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
370 +index 2485b88ee1b6..1880105cc8c4 100644
371 +--- a/drivers/iio/imu/adis16480.c
372 ++++ b/drivers/iio/imu/adis16480.c
373 +@@ -696,7 +696,7 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
374 + .gyro_max_val = IIO_RAD_TO_DEGREE(22500),
375 + .gyro_max_scale = 450,
376 + .accel_max_val = IIO_M_S_2_TO_G(12500),
377 +- .accel_max_scale = 5,
378 ++ .accel_max_scale = 10,
379 + },
380 + [ADIS16485] = {
381 + .channels = adis16485_channels,
382 +diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
383 +index 98d4e515587a..681dce15fbc8 100644
384 +--- a/drivers/input/mouse/elan_i2c_core.c
385 ++++ b/drivers/input/mouse/elan_i2c_core.c
386 +@@ -1234,6 +1234,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
387 + { "ELAN0000", 0 },
388 + { "ELAN0100", 0 },
389 + { "ELAN0600", 0 },
390 ++ { "ELAN0602", 0 },
391 + { "ELAN0605", 0 },
392 + { "ELAN0608", 0 },
393 + { "ELAN0605", 0 },
394 +diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
395 +index 354d47ecd66a..ce6ff9b301bb 100644
396 +--- a/drivers/input/mouse/trackpoint.c
397 ++++ b/drivers/input/mouse/trackpoint.c
398 +@@ -265,7 +265,8 @@ static int trackpoint_start_protocol(struct psmouse *psmouse, unsigned char *fir
399 + if (ps2_command(&psmouse->ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
400 + return -1;
401 +
402 +- if (param[0] != TP_MAGIC_IDENT)
403 ++ /* add new TP ID. */
404 ++ if (!(param[0] & TP_MAGIC_IDENT))
405 + return -1;
406 +
407 + if (firmware_id)
408 +diff --git a/drivers/input/mouse/trackpoint.h b/drivers/input/mouse/trackpoint.h
409 +index 5617ed3a7d7a..88055755f82e 100644
410 +--- a/drivers/input/mouse/trackpoint.h
411 ++++ b/drivers/input/mouse/trackpoint.h
412 +@@ -21,8 +21,9 @@
413 + #define TP_COMMAND 0xE2 /* Commands start with this */
414 +
415 + #define TP_READ_ID 0xE1 /* Sent for device identification */
416 +-#define TP_MAGIC_IDENT 0x01 /* Sent after a TP_READ_ID followed */
417 ++#define TP_MAGIC_IDENT 0x03 /* Sent after a TP_READ_ID followed */
418 + /* by the firmware ID */
419 ++ /* Firmware ID includes 0x1, 0x2, 0x3 */
420 +
421 +
422 + /*
423 +diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
424 +index a2661381ddfc..d2774197fe58 100644
425 +--- a/drivers/misc/mei/hw-me-regs.h
426 ++++ b/drivers/misc/mei/hw-me-regs.h
427 +@@ -125,6 +125,11 @@
428 + #define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */
429 + #define MEI_DEV_ID_KBP_2 0xA2BB /* Kaby Point 2 */
430 +
431 ++#define MEI_DEV_ID_LBG 0xA1BA /* Lewisburg (SPT) */
432 ++
433 ++#define MEI_DEV_ID_BXT_M 0x1A9A /* Broxton M */
434 ++#define MEI_DEV_ID_APL_I 0x5A9A /* Apollo Lake I */
435 ++
436 + /*
437 + * MEI HW Section
438 + */
439 +diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
440 +index 01e20384ac44..adab5bbb642a 100644
441 +--- a/drivers/misc/mei/pci-me.c
442 ++++ b/drivers/misc/mei/pci-me.c
443 +@@ -86,10 +86,14 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
444 + {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, mei_me_pch8_cfg)},
445 + {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, mei_me_pch8_sps_cfg)},
446 + {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, mei_me_pch8_sps_cfg)},
447 ++ {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, mei_me_pch8_cfg)},
448 +
449 + {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, mei_me_pch8_cfg)},
450 + {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_2, mei_me_pch8_cfg)},
451 +
452 ++ {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, mei_me_pch8_cfg)},
453 ++ {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, mei_me_pch8_cfg)},
454 ++
455 + /* required last entry */
456 + {0, }
457 + };
458 +diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
459 +index ecc6fb9ca92f..3bbdf60f8908 100644
460 +--- a/drivers/ntb/ntb_transport.c
461 ++++ b/drivers/ntb/ntb_transport.c
462 +@@ -599,7 +599,7 @@ static int ntb_transport_setup_qp_mw(struct ntb_transport_ctx *nt,
463 + if (!mw->virt_addr)
464 + return -ENOMEM;
465 +
466 +- if (qp_count % mw_count && mw_num + 1 < qp_count / mw_count)
467 ++ if (mw_num < qp_count % mw_count)
468 + num_qps_mw = qp_count / mw_count + 1;
469 + else
470 + num_qps_mw = qp_count / mw_count;
471 +@@ -947,7 +947,7 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt,
472 + qp->event_handler = NULL;
473 + ntb_qp_link_down_reset(qp);
474 +
475 +- if (qp_count % mw_count && mw_num + 1 < qp_count / mw_count)
476 ++ if (mw_num < qp_count % mw_count)
477 + num_qps_mw = qp_count / mw_count + 1;
478 + else
479 + num_qps_mw = qp_count / mw_count;
480 +@@ -1065,8 +1065,8 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
481 + qp_count = ilog2(qp_bitmap);
482 + if (max_num_clients && max_num_clients < qp_count)
483 + qp_count = max_num_clients;
484 +- else if (mw_count < qp_count)
485 +- qp_count = mw_count;
486 ++ else if (nt->mw_count < qp_count)
487 ++ qp_count = nt->mw_count;
488 +
489 + qp_bitmap &= BIT_ULL(qp_count) - 1;
490 +
491 +diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
492 +index 02c3feef4e36..c2d2c17550a7 100644
493 +--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
494 ++++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
495 +@@ -49,6 +49,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
496 + {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
497 + {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
498 + {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
499 ++ {USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
500 + {} /* Terminating entry */
501 + };
502 +
503 +diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
504 +index 26a3b389a265..fa8df3fef6fc 100644
505 +--- a/fs/cifs/dir.c
506 ++++ b/fs/cifs/dir.c
507 +@@ -183,15 +183,20 @@ cifs_bp_rename_retry:
508 + }
509 +
510 + /*
511 ++ * Don't allow path components longer than the server max.
512 + * Don't allow the separator character in a path component.
513 + * The VFS will not allow "/", but "\" is allowed by posix.
514 + */
515 + static int
516 +-check_name(struct dentry *direntry)
517 ++check_name(struct dentry *direntry, struct cifs_tcon *tcon)
518 + {
519 + struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb);
520 + int i;
521 +
522 ++ if (unlikely(direntry->d_name.len >
523 ++ tcon->fsAttrInfo.MaxPathNameComponentLength))
524 ++ return -ENAMETOOLONG;
525 ++
526 + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
527 + for (i = 0; i < direntry->d_name.len; i++) {
528 + if (direntry->d_name.name[i] == '\\') {
529 +@@ -489,10 +494,6 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
530 + return finish_no_open(file, res);
531 + }
532 +
533 +- rc = check_name(direntry);
534 +- if (rc)
535 +- return rc;
536 +-
537 + xid = get_xid();
538 +
539 + cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
540 +@@ -505,6 +506,11 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
541 + }
542 +
543 + tcon = tlink_tcon(tlink);
544 ++
545 ++ rc = check_name(direntry, tcon);
546 ++ if (rc)
547 ++ goto out_free_xid;
548 ++
549 + server = tcon->ses->server;
550 +
551 + if (server->ops->new_lease_key)
552 +@@ -765,7 +771,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
553 + }
554 + pTcon = tlink_tcon(tlink);
555 +
556 +- rc = check_name(direntry);
557 ++ rc = check_name(direntry, pTcon);
558 + if (rc)
559 + goto lookup_out;
560 +
561 +diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
562 +index f4afa3b1cc56..6c484ddf26a9 100644
563 +--- a/fs/cifs/smb2pdu.c
564 ++++ b/fs/cifs/smb2pdu.c
565 +@@ -2768,8 +2768,8 @@ copy_fs_info_to_kstatfs(struct smb2_fs_full_size_info *pfs_inf,
566 + kst->f_bsize = le32_to_cpu(pfs_inf->BytesPerSector) *
567 + le32_to_cpu(pfs_inf->SectorsPerAllocationUnit);
568 + kst->f_blocks = le64_to_cpu(pfs_inf->TotalAllocationUnits);
569 +- kst->f_bfree = le64_to_cpu(pfs_inf->ActualAvailableAllocationUnits);
570 +- kst->f_bavail = le64_to_cpu(pfs_inf->CallerAvailableAllocationUnits);
571 ++ kst->f_bfree = kst->f_bavail =
572 ++ le64_to_cpu(pfs_inf->CallerAvailableAllocationUnits);
573 + return;
574 + }
575 +
576 +diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
577 +index 3f68a25f2169..544672b440de 100644
578 +--- a/fs/nfsd/nfs4xdr.c
579 ++++ b/fs/nfsd/nfs4xdr.c
580 +@@ -129,7 +129,7 @@ static void next_decode_page(struct nfsd4_compoundargs *argp)
581 + argp->p = page_address(argp->pagelist[0]);
582 + argp->pagelist++;
583 + if (argp->pagelen < PAGE_SIZE) {
584 +- argp->end = argp->p + (argp->pagelen>>2);
585 ++ argp->end = argp->p + XDR_QUADLEN(argp->pagelen);
586 + argp->pagelen = 0;
587 + } else {
588 + argp->end = argp->p + (PAGE_SIZE>>2);
589 +@@ -1246,9 +1246,7 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
590 + argp->pagelen -= pages * PAGE_SIZE;
591 + len -= pages * PAGE_SIZE;
592 +
593 +- argp->p = (__be32 *)page_address(argp->pagelist[0]);
594 +- argp->pagelist++;
595 +- argp->end = argp->p + XDR_QUADLEN(PAGE_SIZE);
596 ++ next_decode_page(argp);
597 + }
598 + argp->p += XDR_QUADLEN(len);
599 +
600 +diff --git a/include/net/ip.h b/include/net/ip.h
601 +index b450d8653b30..7476bb10ff37 100644
602 +--- a/include/net/ip.h
603 ++++ b/include/net/ip.h
604 +@@ -314,7 +314,7 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
605 + !forwarding)
606 + return dst_mtu(dst);
607 +
608 +- return min(dst->dev->mtu, IP_MAX_MTU);
609 ++ return min(READ_ONCE(dst->dev->mtu), IP_MAX_MTU);
610 + }
611 +
612 + static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
613 +@@ -327,7 +327,7 @@ static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
614 + return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
615 + }
616 +
617 +- return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
618 ++ return min(READ_ONCE(skb_dst(skb)->dev->mtu), IP_MAX_MTU);
619 + }
620 +
621 + u32 ip_idents_reserve(u32 hash, int segs);
622 +diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
623 +index e5bba897d206..7a5d6a073165 100644
624 +--- a/include/net/sch_generic.h
625 ++++ b/include/net/sch_generic.h
626 +@@ -717,8 +717,11 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
627 + old = *pold;
628 + *pold = new;
629 + if (old != NULL) {
630 +- qdisc_tree_reduce_backlog(old, old->q.qlen, old->qstats.backlog);
631 ++ unsigned int qlen = old->q.qlen;
632 ++ unsigned int backlog = old->qstats.backlog;
633 ++
634 + qdisc_reset(old);
635 ++ qdisc_tree_reduce_backlog(old, qlen, backlog);
636 + }
637 + sch_tree_unlock(sch);
638 +
639 +diff --git a/kernel/events/core.c b/kernel/events/core.c
640 +index 784ab8fe8714..3697063dd09a 100644
641 +--- a/kernel/events/core.c
642 ++++ b/kernel/events/core.c
643 +@@ -8473,28 +8473,27 @@ SYSCALL_DEFINE5(perf_event_open,
644 + goto err_context;
645 +
646 + /*
647 +- * Do not allow to attach to a group in a different
648 +- * task or CPU context:
649 ++ * Make sure we're both events for the same CPU;
650 ++ * grouping events for different CPUs is broken; since
651 ++ * you can never concurrently schedule them anyhow.
652 + */
653 +- if (move_group) {
654 +- /*
655 +- * Make sure we're both on the same task, or both
656 +- * per-cpu events.
657 +- */
658 +- if (group_leader->ctx->task != ctx->task)
659 +- goto err_context;
660 ++ if (group_leader->cpu != event->cpu)
661 ++ goto err_context;
662 +
663 +- /*
664 +- * Make sure we're both events for the same CPU;
665 +- * grouping events for different CPUs is broken; since
666 +- * you can never concurrently schedule them anyhow.
667 +- */
668 +- if (group_leader->cpu != event->cpu)
669 +- goto err_context;
670 +- } else {
671 +- if (group_leader->ctx != ctx)
672 +- goto err_context;
673 +- }
674 ++ /*
675 ++ * Make sure we're both on the same task, or both
676 ++ * per-CPU events.
677 ++ */
678 ++ if (group_leader->ctx->task != ctx->task)
679 ++ goto err_context;
680 ++
681 ++ /*
682 ++ * Do not allow to attach to a group in a different task
683 ++ * or CPU context. If we're moving SW events, we'll fix
684 ++ * this up later, so allow that.
685 ++ */
686 ++ if (!move_group && group_leader->ctx != ctx)
687 ++ goto err_context;
688 +
689 + /*
690 + * Only a group leader can be exclusive or pinned
691 +diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
692 +index 6816302542b2..f0e5408499b6 100644
693 +--- a/kernel/trace/trace_events_filter.c
694 ++++ b/kernel/trace/trace_events_filter.c
695 +@@ -1979,6 +1979,10 @@ static int create_filter(struct trace_event_call *call,
696 + if (err && set_str)
697 + append_filter_err(ps, filter);
698 + }
699 ++ if (err && !set_str) {
700 ++ free_event_filter(filter);
701 ++ filter = NULL;
702 ++ }
703 + create_filter_finish(ps);
704 +
705 + *filterp = filter;
706 +diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
707 +index 1641367e54ca..69f56073b337 100644
708 +--- a/net/bluetooth/bnep/core.c
709 ++++ b/net/bluetooth/bnep/core.c
710 +@@ -484,16 +484,16 @@ static int bnep_session(void *arg)
711 + struct net_device *dev = s->dev;
712 + struct sock *sk = s->sock->sk;
713 + struct sk_buff *skb;
714 +- wait_queue_t wait;
715 ++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
716 +
717 + BT_DBG("");
718 +
719 + set_user_nice(current, -15);
720 +
721 +- init_waitqueue_entry(&wait, current);
722 + add_wait_queue(sk_sleep(sk), &wait);
723 + while (1) {
724 +- set_current_state(TASK_INTERRUPTIBLE);
725 ++ /* Ensure session->terminate is updated */
726 ++ smp_mb__before_atomic();
727 +
728 + if (atomic_read(&s->terminate))
729 + break;
730 +@@ -515,9 +515,8 @@ static int bnep_session(void *arg)
731 + break;
732 + netif_wake_queue(dev);
733 +
734 +- schedule();
735 ++ wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
736 + }
737 +- __set_current_state(TASK_RUNNING);
738 + remove_wait_queue(sk_sleep(sk), &wait);
739 +
740 + /* Cleanup session */
741 +@@ -663,7 +662,7 @@ int bnep_del_connection(struct bnep_conndel_req *req)
742 + s = __bnep_get_session(req->dst);
743 + if (s) {
744 + atomic_inc(&s->terminate);
745 +- wake_up_process(s->task);
746 ++ wake_up_interruptible(sk_sleep(s->sock->sk));
747 + } else
748 + err = -ENOENT;
749 +
750 +diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
751 +index 298ed37010e6..3a39fd523e40 100644
752 +--- a/net/bluetooth/cmtp/core.c
753 ++++ b/net/bluetooth/cmtp/core.c
754 +@@ -281,16 +281,16 @@ static int cmtp_session(void *arg)
755 + struct cmtp_session *session = arg;
756 + struct sock *sk = session->sock->sk;
757 + struct sk_buff *skb;
758 +- wait_queue_t wait;
759 ++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
760 +
761 + BT_DBG("session %p", session);
762 +
763 + set_user_nice(current, -15);
764 +
765 +- init_waitqueue_entry(&wait, current);
766 + add_wait_queue(sk_sleep(sk), &wait);
767 + while (1) {
768 +- set_current_state(TASK_INTERRUPTIBLE);
769 ++ /* Ensure session->terminate is updated */
770 ++ smp_mb__before_atomic();
771 +
772 + if (atomic_read(&session->terminate))
773 + break;
774 +@@ -307,9 +307,8 @@ static int cmtp_session(void *arg)
775 +
776 + cmtp_process_transmit(session);
777 +
778 +- schedule();
779 ++ wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
780 + }
781 +- __set_current_state(TASK_RUNNING);
782 + remove_wait_queue(sk_sleep(sk), &wait);
783 +
784 + down_write(&cmtp_session_sem);
785 +@@ -394,7 +393,7 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
786 + err = cmtp_attach_device(session);
787 + if (err < 0) {
788 + atomic_inc(&session->terminate);
789 +- wake_up_process(session->task);
790 ++ wake_up_interruptible(sk_sleep(session->sock->sk));
791 + up_write(&cmtp_session_sem);
792 + return err;
793 + }
794 +@@ -432,7 +431,11 @@ int cmtp_del_connection(struct cmtp_conndel_req *req)
795 +
796 + /* Stop session thread */
797 + atomic_inc(&session->terminate);
798 +- wake_up_process(session->task);
799 ++
800 ++ /* Ensure session->terminate is updated */
801 ++ smp_mb__after_atomic();
802 ++
803 ++ wake_up_interruptible(sk_sleep(session->sock->sk));
804 + } else
805 + err = -ENOENT;
806 +
807 +diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
808 +index 0bec4588c3c8..1fc076420d1e 100644
809 +--- a/net/bluetooth/hidp/core.c
810 ++++ b/net/bluetooth/hidp/core.c
811 +@@ -36,6 +36,7 @@
812 + #define VERSION "1.2"
813 +
814 + static DECLARE_RWSEM(hidp_session_sem);
815 ++static DECLARE_WAIT_QUEUE_HEAD(hidp_session_wq);
816 + static LIST_HEAD(hidp_session_list);
817 +
818 + static unsigned char hidp_keycode[256] = {
819 +@@ -1068,12 +1069,12 @@ static int hidp_session_start_sync(struct hidp_session *session)
820 + * Wake up session thread and notify it to stop. This is asynchronous and
821 + * returns immediately. Call this whenever a runtime error occurs and you want
822 + * the session to stop.
823 +- * Note: wake_up_process() performs any necessary memory-barriers for us.
824 ++ * Note: wake_up_interruptible() performs any necessary memory-barriers for us.
825 + */
826 + static void hidp_session_terminate(struct hidp_session *session)
827 + {
828 + atomic_inc(&session->terminate);
829 +- wake_up_process(session->task);
830 ++ wake_up_interruptible(&hidp_session_wq);
831 + }
832 +
833 + /*
834 +@@ -1180,7 +1181,9 @@ static void hidp_session_run(struct hidp_session *session)
835 + struct sock *ctrl_sk = session->ctrl_sock->sk;
836 + struct sock *intr_sk = session->intr_sock->sk;
837 + struct sk_buff *skb;
838 ++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
839 +
840 ++ add_wait_queue(&hidp_session_wq, &wait);
841 + for (;;) {
842 + /*
843 + * This thread can be woken up two ways:
844 +@@ -1188,12 +1191,10 @@ static void hidp_session_run(struct hidp_session *session)
845 + * session->terminate flag and wakes this thread up.
846 + * - Via modifying the socket state of ctrl/intr_sock. This
847 + * thread is woken up by ->sk_state_changed().
848 +- *
849 +- * Note: set_current_state() performs any necessary
850 +- * memory-barriers for us.
851 + */
852 +- set_current_state(TASK_INTERRUPTIBLE);
853 +
854 ++ /* Ensure session->terminate is updated */
855 ++ smp_mb__before_atomic();
856 + if (atomic_read(&session->terminate))
857 + break;
858 +
859 +@@ -1227,11 +1228,22 @@ static void hidp_session_run(struct hidp_session *session)
860 + hidp_process_transmit(session, &session->ctrl_transmit,
861 + session->ctrl_sock);
862 +
863 +- schedule();
864 ++ wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
865 + }
866 ++ remove_wait_queue(&hidp_session_wq, &wait);
867 +
868 + atomic_inc(&session->terminate);
869 +- set_current_state(TASK_RUNNING);
870 ++
871 ++ /* Ensure session->terminate is updated */
872 ++ smp_mb__after_atomic();
873 ++}
874 ++
875 ++static int hidp_session_wake_function(wait_queue_t *wait,
876 ++ unsigned int mode,
877 ++ int sync, void *key)
878 ++{
879 ++ wake_up_interruptible(&hidp_session_wq);
880 ++ return false;
881 + }
882 +
883 + /*
884 +@@ -1244,7 +1256,8 @@ static void hidp_session_run(struct hidp_session *session)
885 + static int hidp_session_thread(void *arg)
886 + {
887 + struct hidp_session *session = arg;
888 +- wait_queue_t ctrl_wait, intr_wait;
889 ++ DEFINE_WAIT_FUNC(ctrl_wait, hidp_session_wake_function);
890 ++ DEFINE_WAIT_FUNC(intr_wait, hidp_session_wake_function);
891 +
892 + BT_DBG("session %p", session);
893 +
894 +@@ -1254,8 +1267,6 @@ static int hidp_session_thread(void *arg)
895 + set_user_nice(current, -15);
896 + hidp_set_timer(session);
897 +
898 +- init_waitqueue_entry(&ctrl_wait, current);
899 +- init_waitqueue_entry(&intr_wait, current);
900 + add_wait_queue(sk_sleep(session->ctrl_sock->sk), &ctrl_wait);
901 + add_wait_queue(sk_sleep(session->intr_sock->sk), &intr_wait);
902 + /* This memory barrier is paired with wq_has_sleeper(). See
903 +diff --git a/net/dccp/proto.c b/net/dccp/proto.c
904 +index 9fe25bf63296..b68168fcc06a 100644
905 +--- a/net/dccp/proto.c
906 ++++ b/net/dccp/proto.c
907 +@@ -24,6 +24,7 @@
908 + #include <net/checksum.h>
909 +
910 + #include <net/inet_sock.h>
911 ++#include <net/inet_common.h>
912 + #include <net/sock.h>
913 + #include <net/xfrm.h>
914 +
915 +@@ -170,6 +171,15 @@ const char *dccp_packet_name(const int type)
916 +
917 + EXPORT_SYMBOL_GPL(dccp_packet_name);
918 +
919 ++static void dccp_sk_destruct(struct sock *sk)
920 ++{
921 ++ struct dccp_sock *dp = dccp_sk(sk);
922 ++
923 ++ ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
924 ++ dp->dccps_hc_tx_ccid = NULL;
925 ++ inet_sock_destruct(sk);
926 ++}
927 ++
928 + int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
929 + {
930 + struct dccp_sock *dp = dccp_sk(sk);
931 +@@ -179,6 +189,7 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
932 + icsk->icsk_syn_retries = sysctl_dccp_request_retries;
933 + sk->sk_state = DCCP_CLOSED;
934 + sk->sk_write_space = dccp_write_space;
935 ++ sk->sk_destruct = dccp_sk_destruct;
936 + icsk->icsk_sync_mss = dccp_sync_mss;
937 + dp->dccps_mss_cache = 536;
938 + dp->dccps_rate_last = jiffies;
939 +@@ -201,10 +212,7 @@ void dccp_destroy_sock(struct sock *sk)
940 + {
941 + struct dccp_sock *dp = dccp_sk(sk);
942 +
943 +- /*
944 +- * DCCP doesn't use sk_write_queue, just sk_send_head
945 +- * for retransmissions
946 +- */
947 ++ __skb_queue_purge(&sk->sk_write_queue);
948 + if (sk->sk_send_head != NULL) {
949 + kfree_skb(sk->sk_send_head);
950 + sk->sk_send_head = NULL;
951 +@@ -222,8 +230,7 @@ void dccp_destroy_sock(struct sock *sk)
952 + dp->dccps_hc_rx_ackvec = NULL;
953 + }
954 + ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
955 +- ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
956 +- dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;
957 ++ dp->dccps_hc_rx_ccid = NULL;
958 +
959 + /* clean up feature negotiation state */
960 + dccp_feat_list_purge(&dp->dccps_featneg);
961 +diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
962 +index b2504712259f..313e3c11a15a 100644
963 +--- a/net/ipv4/fib_semantics.c
964 ++++ b/net/ipv4/fib_semantics.c
965 +@@ -1044,15 +1044,17 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
966 + fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL);
967 + if (!fi)
968 + goto failure;
969 +- fib_info_cnt++;
970 + if (cfg->fc_mx) {
971 + fi->fib_metrics = kzalloc(sizeof(*fi->fib_metrics), GFP_KERNEL);
972 +- if (!fi->fib_metrics)
973 +- goto failure;
974 ++ if (unlikely(!fi->fib_metrics)) {
975 ++ kfree(fi);
976 ++ return ERR_PTR(err);
977 ++ }
978 + atomic_set(&fi->fib_metrics->refcnt, 1);
979 +- } else
980 ++ } else {
981 + fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics;
982 +-
983 ++ }
984 ++ fib_info_cnt++;
985 + fi->fib_net = net;
986 + fi->fib_protocol = cfg->fc_protocol;
987 + fi->fib_scope = cfg->fc_scope;
988 +diff --git a/net/ipv4/route.c b/net/ipv4/route.c
989 +index c295d882c6e0..0294f7c99c85 100644
990 +--- a/net/ipv4/route.c
991 ++++ b/net/ipv4/route.c
992 +@@ -1241,7 +1241,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
993 + if (mtu)
994 + return mtu;
995 +
996 +- mtu = dst->dev->mtu;
997 ++ mtu = READ_ONCE(dst->dev->mtu);
998 +
999 + if (unlikely(dst_metric_locked(dst, RTAX_MTU))) {
1000 + if (rt->rt_uses_gateway && mtu > 576)
1001 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
1002 +index f0dabd125c43..c4bbf704ff9c 100644
1003 +--- a/net/ipv4/tcp_input.c
1004 ++++ b/net/ipv4/tcp_input.c
1005 +@@ -3028,8 +3028,7 @@ void tcp_rearm_rto(struct sock *sk)
1006 + /* delta may not be positive if the socket is locked
1007 + * when the retrans timer fires and is rescheduled.
1008 + */
1009 +- if (delta > 0)
1010 +- rto = delta;
1011 ++ rto = max(delta, 1);
1012 + }
1013 + inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
1014 + TCP_RTO_MAX);
1015 +diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
1016 +index f60e8caea767..aad8cdf15472 100644
1017 +--- a/net/ipv6/ip6_fib.c
1018 ++++ b/net/ipv6/ip6_fib.c
1019 +@@ -892,6 +892,8 @@ add:
1020 + }
1021 + nsiblings = iter->rt6i_nsiblings;
1022 + fib6_purge_rt(iter, fn, info->nl_net);
1023 ++ if (fn->rr_ptr == iter)
1024 ++ fn->rr_ptr = NULL;
1025 + rt6_release(iter);
1026 +
1027 + if (nsiblings) {
1028 +@@ -904,6 +906,8 @@ add:
1029 + if (rt6_qualify_for_ecmp(iter)) {
1030 + *ins = iter->dst.rt6_next;
1031 + fib6_purge_rt(iter, fn, info->nl_net);
1032 ++ if (fn->rr_ptr == iter)
1033 ++ fn->rr_ptr = NULL;
1034 + rt6_release(iter);
1035 + nsiblings--;
1036 + } else {
1037 +@@ -992,7 +996,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1038 + /* Create subtree root node */
1039 + sfn = node_alloc();
1040 + if (!sfn)
1041 +- goto st_failure;
1042 ++ goto failure;
1043 +
1044 + sfn->leaf = info->nl_net->ipv6.ip6_null_entry;
1045 + atomic_inc(&info->nl_net->ipv6.ip6_null_entry->rt6i_ref);
1046 +@@ -1008,12 +1012,12 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1047 +
1048 + if (IS_ERR(sn)) {
1049 + /* If it is failed, discard just allocated
1050 +- root, and then (in st_failure) stale node
1051 ++ root, and then (in failure) stale node
1052 + in main tree.
1053 + */
1054 + node_free(sfn);
1055 + err = PTR_ERR(sn);
1056 +- goto st_failure;
1057 ++ goto failure;
1058 + }
1059 +
1060 + /* Now link new subtree to main tree */
1061 +@@ -1027,7 +1031,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1062 +
1063 + if (IS_ERR(sn)) {
1064 + err = PTR_ERR(sn);
1065 +- goto st_failure;
1066 ++ goto failure;
1067 + }
1068 + }
1069 +
1070 +@@ -1069,22 +1073,22 @@ out:
1071 + atomic_inc(&pn->leaf->rt6i_ref);
1072 + }
1073 + #endif
1074 +- if (!(rt->dst.flags & DST_NOCACHE))
1075 +- dst_free(&rt->dst);
1076 ++ goto failure;
1077 + }
1078 + return err;
1079 +
1080 +-#ifdef CONFIG_IPV6_SUBTREES
1081 +- /* Subtree creation failed, probably main tree node
1082 +- is orphan. If it is, shoot it.
1083 ++failure:
1084 ++ /* fn->leaf could be NULL if fn is an intermediate node and we
1085 ++ * failed to add the new route to it in both subtree creation
1086 ++ * failure and fib6_add_rt2node() failure case.
1087 ++ * In both cases, fib6_repair_tree() should be called to fix
1088 ++ * fn->leaf.
1089 + */
1090 +-st_failure:
1091 + if (fn && !(fn->fn_flags & (RTN_RTINFO|RTN_ROOT)))
1092 + fib6_repair_tree(info->nl_net, fn);
1093 + if (!(rt->dst.flags & DST_NOCACHE))
1094 + dst_free(&rt->dst);
1095 + return err;
1096 +-#endif
1097 + }
1098 +
1099 + /*
1100 +diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
1101 +index 8d2f7c9b491d..4a116d766c15 100644
1102 +--- a/net/irda/af_irda.c
1103 ++++ b/net/irda/af_irda.c
1104 +@@ -2227,7 +2227,7 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
1105 + {
1106 + struct sock *sk = sock->sk;
1107 + struct irda_sock *self = irda_sk(sk);
1108 +- struct irda_device_list list;
1109 ++ struct irda_device_list list = { 0 };
1110 + struct irda_device_info *discoveries;
1111 + struct irda_ias_set * ias_opt; /* IAS get/query params */
1112 + struct ias_object * ias_obj; /* Object in IAS */
1113 +diff --git a/net/key/af_key.c b/net/key/af_key.c
1114 +index 2e1050ec2cf0..94bf810ad242 100644
1115 +--- a/net/key/af_key.c
1116 ++++ b/net/key/af_key.c
1117 +@@ -228,7 +228,7 @@ static int pfkey_broadcast_one(struct sk_buff *skb, struct sk_buff **skb2,
1118 + #define BROADCAST_ONE 1
1119 + #define BROADCAST_REGISTERED 2
1120 + #define BROADCAST_PROMISC_ONLY 4
1121 +-static int pfkey_broadcast(struct sk_buff *skb,
1122 ++static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation,
1123 + int broadcast_flags, struct sock *one_sk,
1124 + struct net *net)
1125 + {
1126 +@@ -278,7 +278,7 @@ static int pfkey_broadcast(struct sk_buff *skb,
1127 + rcu_read_unlock();
1128 +
1129 + if (one_sk != NULL)
1130 +- err = pfkey_broadcast_one(skb, &skb2, GFP_KERNEL, one_sk);
1131 ++ err = pfkey_broadcast_one(skb, &skb2, allocation, one_sk);
1132 +
1133 + kfree_skb(skb2);
1134 + kfree_skb(skb);
1135 +@@ -311,7 +311,7 @@ static int pfkey_do_dump(struct pfkey_sock *pfk)
1136 + hdr = (struct sadb_msg *) pfk->dump.skb->data;
1137 + hdr->sadb_msg_seq = 0;
1138 + hdr->sadb_msg_errno = rc;
1139 +- pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE,
1140 ++ pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE,
1141 + &pfk->sk, sock_net(&pfk->sk));
1142 + pfk->dump.skb = NULL;
1143 + }
1144 +@@ -355,7 +355,7 @@ static int pfkey_error(const struct sadb_msg *orig, int err, struct sock *sk)
1145 + hdr->sadb_msg_len = (sizeof(struct sadb_msg) /
1146 + sizeof(uint64_t));
1147 +
1148 +- pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk));
1149 ++ pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ONE, sk, sock_net(sk));
1150 +
1151 + return 0;
1152 + }
1153 +@@ -1396,7 +1396,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_
1154 +
1155 + xfrm_state_put(x);
1156 +
1157 +- pfkey_broadcast(resp_skb, BROADCAST_ONE, sk, net);
1158 ++ pfkey_broadcast(resp_skb, GFP_KERNEL, BROADCAST_ONE, sk, net);
1159 +
1160 + return 0;
1161 + }
1162 +@@ -1483,7 +1483,7 @@ static int key_notify_sa(struct xfrm_state *x, const struct km_event *c)
1163 + hdr->sadb_msg_seq = c->seq;
1164 + hdr->sadb_msg_pid = c->portid;
1165 +
1166 +- pfkey_broadcast(skb, BROADCAST_ALL, NULL, xs_net(x));
1167 ++ pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xs_net(x));
1168 +
1169 + return 0;
1170 + }
1171 +@@ -1596,7 +1596,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff *skb, const struct sadb_msg
1172 + out_hdr->sadb_msg_reserved = 0;
1173 + out_hdr->sadb_msg_seq = hdr->sadb_msg_seq;
1174 + out_hdr->sadb_msg_pid = hdr->sadb_msg_pid;
1175 +- pfkey_broadcast(out_skb, BROADCAST_ONE, sk, sock_net(sk));
1176 ++ pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk));
1177 +
1178 + return 0;
1179 + }
1180 +@@ -1701,8 +1701,8 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sad
1181 + return -ENOBUFS;
1182 + }
1183 +
1184 +- pfkey_broadcast(supp_skb, BROADCAST_REGISTERED, sk, sock_net(sk));
1185 +-
1186 ++ pfkey_broadcast(supp_skb, GFP_KERNEL, BROADCAST_REGISTERED, sk,
1187 ++ sock_net(sk));
1188 + return 0;
1189 + }
1190 +
1191 +@@ -1720,7 +1720,8 @@ static int unicast_flush_resp(struct sock *sk, const struct sadb_msg *ihdr)
1192 + hdr->sadb_msg_errno = (uint8_t) 0;
1193 + hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
1194 +
1195 +- return pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk));
1196 ++ return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ONE, sk,
1197 ++ sock_net(sk));
1198 + }
1199 +
1200 + static int key_notify_sa_flush(const struct km_event *c)
1201 +@@ -1741,7 +1742,7 @@ static int key_notify_sa_flush(const struct km_event *c)
1202 + hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
1203 + hdr->sadb_msg_reserved = 0;
1204 +
1205 +- pfkey_broadcast(skb, BROADCAST_ALL, NULL, c->net);
1206 ++ pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
1207 +
1208 + return 0;
1209 + }
1210 +@@ -1798,7 +1799,7 @@ static int dump_sa(struct xfrm_state *x, int count, void *ptr)
1211 + out_hdr->sadb_msg_pid = pfk->dump.msg_portid;
1212 +
1213 + if (pfk->dump.skb)
1214 +- pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE,
1215 ++ pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE,
1216 + &pfk->sk, sock_net(&pfk->sk));
1217 + pfk->dump.skb = out_skb;
1218 +
1219 +@@ -1886,7 +1887,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, const struct sadb
1220 + new_hdr->sadb_msg_errno = 0;
1221 + }
1222 +
1223 +- pfkey_broadcast(skb, BROADCAST_ALL, NULL, sock_net(sk));
1224 ++ pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ALL, NULL, sock_net(sk));
1225 + return 0;
1226 + }
1227 +
1228 +@@ -2219,7 +2220,7 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, const struct km_ev
1229 + out_hdr->sadb_msg_errno = 0;
1230 + out_hdr->sadb_msg_seq = c->seq;
1231 + out_hdr->sadb_msg_pid = c->portid;
1232 +- pfkey_broadcast(out_skb, BROADCAST_ALL, NULL, xp_net(xp));
1233 ++ pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp));
1234 + return 0;
1235 +
1236 + }
1237 +@@ -2439,7 +2440,7 @@ static int key_pol_get_resp(struct sock *sk, struct xfrm_policy *xp, const struc
1238 + out_hdr->sadb_msg_errno = 0;
1239 + out_hdr->sadb_msg_seq = hdr->sadb_msg_seq;
1240 + out_hdr->sadb_msg_pid = hdr->sadb_msg_pid;
1241 +- pfkey_broadcast(out_skb, BROADCAST_ONE, sk, xp_net(xp));
1242 ++ pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, xp_net(xp));
1243 + err = 0;
1244 +
1245 + out:
1246 +@@ -2695,7 +2696,7 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr)
1247 + out_hdr->sadb_msg_pid = pfk->dump.msg_portid;
1248 +
1249 + if (pfk->dump.skb)
1250 +- pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE,
1251 ++ pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE,
1252 + &pfk->sk, sock_net(&pfk->sk));
1253 + pfk->dump.skb = out_skb;
1254 +
1255 +@@ -2752,7 +2753,7 @@ static int key_notify_policy_flush(const struct km_event *c)
1256 + hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC;
1257 + hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
1258 + hdr->sadb_msg_reserved = 0;
1259 +- pfkey_broadcast(skb_out, BROADCAST_ALL, NULL, c->net);
1260 ++ pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
1261 + return 0;
1262 +
1263 + }
1264 +@@ -2814,7 +2815,7 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb
1265 + void *ext_hdrs[SADB_EXT_MAX];
1266 + int err;
1267 +
1268 +- pfkey_broadcast(skb_clone(skb, GFP_KERNEL),
1269 ++ pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
1270 + BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
1271 +
1272 + memset(ext_hdrs, 0, sizeof(ext_hdrs));
1273 +@@ -3036,7 +3037,8 @@ static int key_notify_sa_expire(struct xfrm_state *x, const struct km_event *c)
1274 + out_hdr->sadb_msg_seq = 0;
1275 + out_hdr->sadb_msg_pid = 0;
1276 +
1277 +- pfkey_broadcast(out_skb, BROADCAST_REGISTERED, NULL, xs_net(x));
1278 ++ pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL,
1279 ++ xs_net(x));
1280 + return 0;
1281 + }
1282 +
1283 +@@ -3226,7 +3228,8 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
1284 + xfrm_ctx->ctx_len);
1285 + }
1286 +
1287 +- return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x));
1288 ++ return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL,
1289 ++ xs_net(x));
1290 + }
1291 +
1292 + static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
1293 +@@ -3424,7 +3427,8 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
1294 + n_port->sadb_x_nat_t_port_port = sport;
1295 + n_port->sadb_x_nat_t_port_reserved = 0;
1296 +
1297 +- return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x));
1298 ++ return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL,
1299 ++ xs_net(x));
1300 + }
1301 +
1302 + #ifdef CONFIG_NET_KEY_MIGRATE
1303 +@@ -3616,7 +3620,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1304 + }
1305 +
1306 + /* broadcast migrate message to sockets */
1307 +- pfkey_broadcast(skb, BROADCAST_ALL, NULL, &init_net);
1308 ++ pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, &init_net);
1309 +
1310 + return 0;
1311 +
1312 +diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
1313 +index 0915d448ba23..075b0d22f213 100644
1314 +--- a/net/sched/act_ipt.c
1315 ++++ b/net/sched/act_ipt.c
1316 +@@ -34,6 +34,7 @@ static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int
1317 + {
1318 + struct xt_tgchk_param par;
1319 + struct xt_target *target;
1320 ++ struct ipt_entry e = {};
1321 + int ret = 0;
1322 +
1323 + target = xt_request_find_target(AF_INET, t->u.user.name,
1324 +@@ -44,6 +45,7 @@ static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int
1325 + t->u.kernel.target = target;
1326 + memset(&par, 0, sizeof(par));
1327 + par.table = table;
1328 ++ par.entryinfo = &e;
1329 + par.target = target;
1330 + par.targinfo = t->data;
1331 + par.hook_mask = hook;
1332 +diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
1333 +index 4431e2833e45..3f2c3eed04da 100644
1334 +--- a/net/sched/sch_sfq.c
1335 ++++ b/net/sched/sch_sfq.c
1336 +@@ -434,6 +434,7 @@ congestion_drop:
1337 + qdisc_drop(head, sch);
1338 +
1339 + slot_queue_add(slot, skb);
1340 ++ qdisc_tree_reduce_backlog(sch, 0, delta);
1341 + return NET_XMIT_CN;
1342 + }
1343 +
1344 +@@ -465,8 +466,10 @@ enqueue:
1345 + /* Return Congestion Notification only if we dropped a packet
1346 + * from this flow.
1347 + */
1348 +- if (qlen != slot->qlen)
1349 ++ if (qlen != slot->qlen) {
1350 ++ qdisc_tree_reduce_backlog(sch, 0, dropped - qdisc_pkt_len(skb));
1351 + return NET_XMIT_CN;
1352 ++ }
1353 +
1354 + /* As we dropped a packet, better let upper stack know this */
1355 + qdisc_tree_reduce_backlog(sch, 1, dropped);
1356 +diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
1357 +index 7527c168e471..e33e9bd4ed5a 100644
1358 +--- a/net/sctp/ipv6.c
1359 ++++ b/net/sctp/ipv6.c
1360 +@@ -510,7 +510,9 @@ static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
1361 + {
1362 + addr->sa.sa_family = AF_INET6;
1363 + addr->v6.sin6_port = port;
1364 ++ addr->v6.sin6_flowinfo = 0;
1365 + addr->v6.sin6_addr = *saddr;
1366 ++ addr->v6.sin6_scope_id = 0;
1367 + }
1368 +
1369 + /* Compare addresses exactly.
1370 +diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
1371 +index a0c90572d0e5..f86c6555a539 100644
1372 +--- a/net/tipc/netlink_compat.c
1373 ++++ b/net/tipc/netlink_compat.c
1374 +@@ -258,13 +258,15 @@ static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
1375 + arg = nlmsg_new(0, GFP_KERNEL);
1376 + if (!arg) {
1377 + kfree_skb(msg->rep);
1378 ++ msg->rep = NULL;
1379 + return -ENOMEM;
1380 + }
1381 +
1382 + err = __tipc_nl_compat_dumpit(cmd, msg, arg);
1383 +- if (err)
1384 ++ if (err) {
1385 + kfree_skb(msg->rep);
1386 +-
1387 ++ msg->rep = NULL;
1388 ++ }
1389 + kfree_skb(arg);
1390 +
1391 + return err;
1392 +diff --git a/sound/core/control.c b/sound/core/control.c
1393 +index b4fe9b002512..bd01d492f46a 100644
1394 +--- a/sound/core/control.c
1395 ++++ b/sound/core/control.c
1396 +@@ -1126,7 +1126,7 @@ static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol,
1397 + mutex_lock(&ue->card->user_ctl_lock);
1398 + change = ue->tlv_data_size != size;
1399 + if (!change)
1400 +- change = memcmp(ue->tlv_data, new_data, size);
1401 ++ change = memcmp(ue->tlv_data, new_data, size) != 0;
1402 + kfree(ue->tlv_data);
1403 + ue->tlv_data = new_data;
1404 + ue->tlv_data_size = size;
1405 +diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
1406 +index 46f7b023f69c..ac5de4365e15 100644
1407 +--- a/sound/pci/hda/patch_conexant.c
1408 ++++ b/sound/pci/hda/patch_conexant.c
1409 +@@ -854,6 +854,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
1410 + SND_PCI_QUIRK(0x17aa, 0x390b, "Lenovo G50-80", CXT_FIXUP_STEREO_DMIC),
1411 + SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
1412 + SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
1413 ++ SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo G50-70", CXT_FIXUP_STEREO_DMIC),
1414 + SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
1415 + SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
1416 + SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
1417 +diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
1418 +index 54c33204541f..ff6fcd9f92f7 100644
1419 +--- a/sound/soc/generic/simple-card.c
1420 ++++ b/sound/soc/generic/simple-card.c
1421 +@@ -100,7 +100,7 @@ static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream,
1422 + if (ret && ret != -ENOTSUPP)
1423 + goto err;
1424 + }
1425 +-
1426 ++ return 0;
1427 + err:
1428 + return ret;
1429 + }
1430 +diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
1431 +index 2a5b3a293cd2..b123734f9fbd 100644
1432 +--- a/sound/soc/sh/rcar/adg.c
1433 ++++ b/sound/soc/sh/rcar/adg.c
1434 +@@ -437,7 +437,7 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
1435 + struct device *dev = rsnd_priv_to_dev(priv);
1436 + struct device_node *np = dev->of_node;
1437 + u32 ckr, rbgx, rbga, rbgb;
1438 +- u32 rate, req_rate, div;
1439 ++ u32 rate, req_rate = 0, div;
1440 + uint32_t count = 0;
1441 + unsigned long req_48kHz_rate, req_441kHz_rate;
1442 + int i;
1443 +diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
1444 +index deed48ef28b8..362446c36c9e 100644
1445 +--- a/sound/soc/sh/rcar/core.c
1446 ++++ b/sound/soc/sh/rcar/core.c
1447 +@@ -192,19 +192,16 @@ void rsnd_mod_interrupt(struct rsnd_mod *mod,
1448 + struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
1449 + struct rsnd_dai_stream *io;
1450 + struct rsnd_dai *rdai;
1451 +- int i, j;
1452 +-
1453 +- for_each_rsnd_dai(rdai, priv, j) {
1454 ++ int i;
1455 +
1456 +- for (i = 0; i < RSND_MOD_MAX; i++) {
1457 +- io = &rdai->playback;
1458 +- if (mod == io->mod[i])
1459 +- callback(mod, io);
1460 ++ for_each_rsnd_dai(rdai, priv, i) {
1461 ++ io = &rdai->playback;
1462 ++ if (mod == io->mod[mod->type])
1463 ++ callback(mod, io);
1464 +
1465 +- io = &rdai->capture;
1466 +- if (mod == io->mod[i])
1467 +- callback(mod, io);
1468 +- }
1469 ++ io = &rdai->capture;
1470 ++ if (mod == io->mod[mod->type])
1471 ++ callback(mod, io);
1472 + }
1473 + }
1474 +
1475 +@@ -1019,7 +1016,7 @@ static int rsnd_kctrl_put(struct snd_kcontrol *kctrl,
1476 + }
1477 + }
1478 +
1479 +- if (change)
1480 ++ if (change && cfg->update)
1481 + cfg->update(cfg->io, mod);
1482 +
1483 + return change;
1484 +diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
1485 +index 68b439ed22d7..460d29cbaaa5 100644
1486 +--- a/sound/soc/sh/rcar/src.c
1487 ++++ b/sound/soc/sh/rcar/src.c
1488 +@@ -691,13 +691,27 @@ static int _rsnd_src_stop_gen2(struct rsnd_mod *mod)
1489 + {
1490 + rsnd_src_irq_disable_gen2(mod);
1491 +
1492 +- rsnd_mod_write(mod, SRC_CTRL, 0);
1493 ++ /*
1494 ++ * stop SRC output only
1495 ++ * see rsnd_src_quit_gen2
1496 ++ */
1497 ++ rsnd_mod_write(mod, SRC_CTRL, 0x01);
1498 +
1499 + rsnd_src_error_record_gen2(mod);
1500 +
1501 + return rsnd_src_stop(mod);
1502 + }
1503 +
1504 ++static int rsnd_src_quit_gen2(struct rsnd_mod *mod,
1505 ++ struct rsnd_dai_stream *io,
1506 ++ struct rsnd_priv *priv)
1507 ++{
1508 ++ /* stop both out/in */
1509 ++ rsnd_mod_write(mod, SRC_CTRL, 0);
1510 ++
1511 ++ return 0;
1512 ++}
1513 ++
1514 + static void __rsnd_src_interrupt_gen2(struct rsnd_mod *mod,
1515 + struct rsnd_dai_stream *io)
1516 + {
1517 +@@ -971,7 +985,7 @@ static struct rsnd_mod_ops rsnd_src_gen2_ops = {
1518 + .probe = rsnd_src_probe_gen2,
1519 + .remove = rsnd_src_remove_gen2,
1520 + .init = rsnd_src_init_gen2,
1521 +- .quit = rsnd_src_quit,
1522 ++ .quit = rsnd_src_quit_gen2,
1523 + .start = rsnd_src_start_gen2,
1524 + .stop = rsnd_src_stop_gen2,
1525 + .hw_params = rsnd_src_hw_params,
1526 +diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
1527 +index 1427ec21bd7e..c62a2947ac14 100644
1528 +--- a/sound/soc/sh/rcar/ssi.c
1529 ++++ b/sound/soc/sh/rcar/ssi.c
1530 +@@ -39,6 +39,7 @@
1531 + #define SCKP (1 << 13) /* Serial Bit Clock Polarity */
1532 + #define SWSP (1 << 12) /* Serial WS Polarity */
1533 + #define SDTA (1 << 10) /* Serial Data Alignment */
1534 ++#define PDTA (1 << 9) /* Parallel Data Alignment */
1535 + #define DEL (1 << 8) /* Serial Data Delay */
1536 + #define CKDV(v) (v << 4) /* Serial Clock Division Ratio */
1537 + #define TRMD (1 << 1) /* Transmit/Receive Mode Select */
1538 +@@ -286,7 +287,7 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
1539 + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
1540 + u32 cr;
1541 +
1542 +- cr = FORCE;
1543 ++ cr = FORCE | PDTA;
1544 +
1545 + /*
1546 + * always use 32bit system word for easy clock calculation.