1 |
commit: dc5b549ce32e4bfca0b4f2aaed1bd71e10e95ade |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 1 10:11:32 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 1 10:11:32 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=dc5b549c |
7 |
|
8 |
Linux patch 5.2.18 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1017_linux-5.2.18.patch | 1940 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1944 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 200ad40..dc5ec25 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -111,6 +111,10 @@ Patch: 1016_linux-5.2.17.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 5.2.17 |
23 |
|
24 |
+Patch: 1017_linux-5.2.18.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 5.2.18 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1017_linux-5.2.18.patch b/1017_linux-5.2.18.patch |
33 |
new file mode 100644 |
34 |
index 0000000..52759a9 |
35 |
--- /dev/null |
36 |
+++ b/1017_linux-5.2.18.patch |
37 |
@@ -0,0 +1,1940 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 32226d81fbb5..440e473687eb 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 2 |
46 |
+-SUBLEVEL = 17 |
47 |
++SUBLEVEL = 18 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Bobtail Squid |
50 |
+ |
51 |
+diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h |
52 |
+index 4ed5d57f2359..48244640fc49 100644 |
53 |
+--- a/arch/powerpc/include/asm/opal.h |
54 |
++++ b/arch/powerpc/include/asm/opal.h |
55 |
+@@ -272,7 +272,7 @@ int64_t opal_xive_get_vp_info(uint64_t vp, |
56 |
+ int64_t opal_xive_set_vp_info(uint64_t vp, |
57 |
+ uint64_t flags, |
58 |
+ uint64_t report_cl_pair); |
59 |
+-int64_t opal_xive_allocate_irq(uint32_t chip_id); |
60 |
++int64_t opal_xive_allocate_irq_raw(uint32_t chip_id); |
61 |
+ int64_t opal_xive_free_irq(uint32_t girq); |
62 |
+ int64_t opal_xive_sync(uint32_t type, uint32_t id); |
63 |
+ int64_t opal_xive_dump(uint32_t type, uint32_t id); |
64 |
+diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c |
65 |
+index 36c8fa3647a2..53cf67f5ef42 100644 |
66 |
+--- a/arch/powerpc/platforms/powernv/opal-call.c |
67 |
++++ b/arch/powerpc/platforms/powernv/opal-call.c |
68 |
+@@ -257,7 +257,7 @@ OPAL_CALL(opal_xive_set_queue_info, OPAL_XIVE_SET_QUEUE_INFO); |
69 |
+ OPAL_CALL(opal_xive_donate_page, OPAL_XIVE_DONATE_PAGE); |
70 |
+ OPAL_CALL(opal_xive_alloc_vp_block, OPAL_XIVE_ALLOCATE_VP_BLOCK); |
71 |
+ OPAL_CALL(opal_xive_free_vp_block, OPAL_XIVE_FREE_VP_BLOCK); |
72 |
+-OPAL_CALL(opal_xive_allocate_irq, OPAL_XIVE_ALLOCATE_IRQ); |
73 |
++OPAL_CALL(opal_xive_allocate_irq_raw, OPAL_XIVE_ALLOCATE_IRQ); |
74 |
+ OPAL_CALL(opal_xive_free_irq, OPAL_XIVE_FREE_IRQ); |
75 |
+ OPAL_CALL(opal_xive_get_vp_info, OPAL_XIVE_GET_VP_INFO); |
76 |
+ OPAL_CALL(opal_xive_set_vp_info, OPAL_XIVE_SET_VP_INFO); |
77 |
+diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c |
78 |
+index 2f26b74f6cfa..cf156aadefe9 100644 |
79 |
+--- a/arch/powerpc/sysdev/xive/native.c |
80 |
++++ b/arch/powerpc/sysdev/xive/native.c |
81 |
+@@ -231,6 +231,17 @@ static bool xive_native_match(struct device_node *node) |
82 |
+ return of_device_is_compatible(node, "ibm,opal-xive-vc"); |
83 |
+ } |
84 |
+ |
85 |
++static s64 opal_xive_allocate_irq(u32 chip_id) |
86 |
++{ |
87 |
++ s64 irq = opal_xive_allocate_irq_raw(chip_id); |
88 |
++ |
89 |
++ /* |
90 |
++ * Old versions of skiboot can incorrectly return 0xffffffff to |
91 |
++ * indicate no space, fix it up here. |
92 |
++ */ |
93 |
++ return irq == 0xffffffff ? OPAL_RESOURCE : irq; |
94 |
++} |
95 |
++ |
96 |
+ #ifdef CONFIG_SMP |
97 |
+ static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc) |
98 |
+ { |
99 |
+diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c |
100 |
+index 9489ffc06411..4f325e47519f 100644 |
101 |
+--- a/drivers/acpi/acpi_video.c |
102 |
++++ b/drivers/acpi/acpi_video.c |
103 |
+@@ -60,6 +60,12 @@ module_param(report_key_events, int, 0644); |
104 |
+ MODULE_PARM_DESC(report_key_events, |
105 |
+ "0: none, 1: output changes, 2: brightness changes, 3: all"); |
106 |
+ |
107 |
++static int hw_changes_brightness = -1; |
108 |
++module_param(hw_changes_brightness, int, 0644); |
109 |
++MODULE_PARM_DESC(hw_changes_brightness, |
110 |
++ "Set this to 1 on buggy hw which changes the brightness itself when " |
111 |
++ "a hotkey is pressed: -1: auto, 0: normal 1: hw-changes-brightness"); |
112 |
++ |
113 |
+ /* |
114 |
+ * Whether the struct acpi_video_device_attrib::device_id_scheme bit should be |
115 |
+ * assumed even if not actually set. |
116 |
+@@ -405,6 +411,14 @@ static int video_set_report_key_events(const struct dmi_system_id *id) |
117 |
+ return 0; |
118 |
+ } |
119 |
+ |
120 |
++static int video_hw_changes_brightness( |
121 |
++ const struct dmi_system_id *d) |
122 |
++{ |
123 |
++ if (hw_changes_brightness == -1) |
124 |
++ hw_changes_brightness = 1; |
125 |
++ return 0; |
126 |
++} |
127 |
++ |
128 |
+ static const struct dmi_system_id video_dmi_table[] = { |
129 |
+ /* |
130 |
+ * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 |
131 |
+@@ -529,6 +543,21 @@ static const struct dmi_system_id video_dmi_table[] = { |
132 |
+ DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"), |
133 |
+ }, |
134 |
+ }, |
135 |
++ /* |
136 |
++ * Some machines change the brightness themselves when a brightness |
137 |
++ * hotkey gets pressed, despite us telling them not to. In this case |
138 |
++ * acpi_video_device_notify() should only call backlight_force_update( |
139 |
++ * BACKLIGHT_UPDATE_HOTKEY) and not do anything else. |
140 |
++ */ |
141 |
++ { |
142 |
++ /* https://bugzilla.kernel.org/show_bug.cgi?id=204077 */ |
143 |
++ .callback = video_hw_changes_brightness, |
144 |
++ .ident = "Packard Bell EasyNote MZ35", |
145 |
++ .matches = { |
146 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Packard Bell"), |
147 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "EasyNote MZ35"), |
148 |
++ }, |
149 |
++ }, |
150 |
+ {} |
151 |
+ }; |
152 |
+ |
153 |
+@@ -1612,6 +1641,14 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) |
154 |
+ bus = video_device->video; |
155 |
+ input = bus->input; |
156 |
+ |
157 |
++ if (hw_changes_brightness > 0) { |
158 |
++ if (video_device->backlight) |
159 |
++ backlight_force_update(video_device->backlight, |
160 |
++ BACKLIGHT_UPDATE_HOTKEY); |
161 |
++ acpi_notifier_call_chain(device, event, 0); |
162 |
++ return; |
163 |
++ } |
164 |
++ |
165 |
+ switch (event) { |
166 |
+ case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ |
167 |
+ brightness_switch_event(video_device, event); |
168 |
+diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c |
169 |
+index 208feef63de4..d04b443cad1f 100644 |
170 |
+--- a/drivers/bluetooth/btrtl.c |
171 |
++++ b/drivers/bluetooth/btrtl.c |
172 |
+@@ -637,6 +637,26 @@ int btrtl_setup_realtek(struct hci_dev *hdev) |
173 |
+ } |
174 |
+ EXPORT_SYMBOL_GPL(btrtl_setup_realtek); |
175 |
+ |
176 |
++int btrtl_shutdown_realtek(struct hci_dev *hdev) |
177 |
++{ |
178 |
++ struct sk_buff *skb; |
179 |
++ int ret; |
180 |
++ |
181 |
++ /* According to the vendor driver, BT must be reset on close to avoid |
182 |
++ * firmware crash. |
183 |
++ */ |
184 |
++ skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); |
185 |
++ if (IS_ERR(skb)) { |
186 |
++ ret = PTR_ERR(skb); |
187 |
++ bt_dev_err(hdev, "HCI reset during shutdown failed"); |
188 |
++ return ret; |
189 |
++ } |
190 |
++ kfree_skb(skb); |
191 |
++ |
192 |
++ return 0; |
193 |
++} |
194 |
++EXPORT_SYMBOL_GPL(btrtl_shutdown_realtek); |
195 |
++ |
196 |
+ static unsigned int btrtl_convert_baudrate(u32 device_baudrate) |
197 |
+ { |
198 |
+ switch (device_baudrate) { |
199 |
+diff --git a/drivers/bluetooth/btrtl.h b/drivers/bluetooth/btrtl.h |
200 |
+index f1676144fce8..10ad40c3e42c 100644 |
201 |
+--- a/drivers/bluetooth/btrtl.h |
202 |
++++ b/drivers/bluetooth/btrtl.h |
203 |
+@@ -55,6 +55,7 @@ void btrtl_free(struct btrtl_device_info *btrtl_dev); |
204 |
+ int btrtl_download_firmware(struct hci_dev *hdev, |
205 |
+ struct btrtl_device_info *btrtl_dev); |
206 |
+ int btrtl_setup_realtek(struct hci_dev *hdev); |
207 |
++int btrtl_shutdown_realtek(struct hci_dev *hdev); |
208 |
+ int btrtl_get_uart_settings(struct hci_dev *hdev, |
209 |
+ struct btrtl_device_info *btrtl_dev, |
210 |
+ unsigned int *controller_baudrate, |
211 |
+@@ -83,6 +84,11 @@ static inline int btrtl_setup_realtek(struct hci_dev *hdev) |
212 |
+ return -EOPNOTSUPP; |
213 |
+ } |
214 |
+ |
215 |
++static inline int btrtl_shutdown_realtek(struct hci_dev *hdev) |
216 |
++{ |
217 |
++ return -EOPNOTSUPP; |
218 |
++} |
219 |
++ |
220 |
+ static inline int btrtl_get_uart_settings(struct hci_dev *hdev, |
221 |
+ struct btrtl_device_info *btrtl_dev, |
222 |
+ unsigned int *controller_baudrate, |
223 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
224 |
+index 7954a7924923..aa6e2f9d4861 100644 |
225 |
+--- a/drivers/bluetooth/btusb.c |
226 |
++++ b/drivers/bluetooth/btusb.c |
227 |
+@@ -378,6 +378,9 @@ static const struct usb_device_id blacklist_table[] = { |
228 |
+ { USB_DEVICE(0x13d3, 0x3526), .driver_info = BTUSB_REALTEK }, |
229 |
+ { USB_DEVICE(0x0b05, 0x185c), .driver_info = BTUSB_REALTEK }, |
230 |
+ |
231 |
++ /* Additional Realtek 8822CE Bluetooth devices */ |
232 |
++ { USB_DEVICE(0x04ca, 0x4005), .driver_info = BTUSB_REALTEK }, |
233 |
++ |
234 |
+ /* Silicon Wave based devices */ |
235 |
+ { USB_DEVICE(0x0c10, 0x0000), .driver_info = BTUSB_SWAVE }, |
236 |
+ |
237 |
+@@ -3181,6 +3184,7 @@ static int btusb_probe(struct usb_interface *intf, |
238 |
+ #ifdef CONFIG_BT_HCIBTUSB_RTL |
239 |
+ if (id->driver_info & BTUSB_REALTEK) { |
240 |
+ hdev->setup = btrtl_setup_realtek; |
241 |
++ hdev->shutdown = btrtl_shutdown_realtek; |
242 |
+ |
243 |
+ /* Realtek devices lose their updated firmware over suspend, |
244 |
+ * but the USB hub doesn't notice any status change. |
245 |
+diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c |
246 |
+index 01ef2fab5764..1a17a606c13d 100644 |
247 |
+--- a/drivers/clk/imx/clk-imx8mm.c |
248 |
++++ b/drivers/clk/imx/clk-imx8mm.c |
249 |
+@@ -55,8 +55,8 @@ static const struct imx_pll14xx_rate_table imx8mm_pll1416x_tbl[] = { |
250 |
+ }; |
251 |
+ |
252 |
+ static const struct imx_pll14xx_rate_table imx8mm_audiopll_tbl[] = { |
253 |
+- PLL_1443X_RATE(786432000U, 655, 5, 2, 23593), |
254 |
+- PLL_1443X_RATE(722534400U, 301, 5, 1, 3670), |
255 |
++ PLL_1443X_RATE(393216000U, 262, 2, 3, 9437), |
256 |
++ PLL_1443X_RATE(361267200U, 361, 3, 3, 17511), |
257 |
+ }; |
258 |
+ |
259 |
+ static const struct imx_pll14xx_rate_table imx8mm_videopll_tbl[] = { |
260 |
+diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c |
261 |
+index f9d7d6aaf3db..b26b6975b727 100644 |
262 |
+--- a/drivers/crypto/talitos.c |
263 |
++++ b/drivers/crypto/talitos.c |
264 |
+@@ -3190,6 +3190,7 @@ static int talitos_remove(struct platform_device *ofdev) |
265 |
+ break; |
266 |
+ case CRYPTO_ALG_TYPE_AEAD: |
267 |
+ crypto_unregister_aead(&t_alg->algt.alg.aead); |
268 |
++ break; |
269 |
+ case CRYPTO_ALG_TYPE_AHASH: |
270 |
+ crypto_unregister_ahash(&t_alg->algt.alg.hash); |
271 |
+ break; |
272 |
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |
273 |
+index dc3ac66a4450..279ced1d64ed 100644 |
274 |
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |
275 |
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |
276 |
+@@ -4209,20 +4209,10 @@ static int dm_plane_atomic_check(struct drm_plane *plane, |
277 |
+ static int dm_plane_atomic_async_check(struct drm_plane *plane, |
278 |
+ struct drm_plane_state *new_plane_state) |
279 |
+ { |
280 |
+- struct drm_plane_state *old_plane_state = |
281 |
+- drm_atomic_get_old_plane_state(new_plane_state->state, plane); |
282 |
+- |
283 |
+ /* Only support async updates on cursor planes. */ |
284 |
+ if (plane->type != DRM_PLANE_TYPE_CURSOR) |
285 |
+ return -EINVAL; |
286 |
+ |
287 |
+- /* |
288 |
+- * DRM calls prepare_fb and cleanup_fb on new_plane_state for |
289 |
+- * async commits so don't allow fb changes. |
290 |
+- */ |
291 |
+- if (old_plane_state->fb != new_plane_state->fb) |
292 |
+- return -EINVAL; |
293 |
+- |
294 |
+ return 0; |
295 |
+ } |
296 |
+ |
297 |
+@@ -6798,6 +6788,26 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, |
298 |
+ if (ret) |
299 |
+ goto fail; |
300 |
+ |
301 |
++ if (state->legacy_cursor_update) { |
302 |
++ /* |
303 |
++ * This is a fast cursor update coming from the plane update |
304 |
++ * helper, check if it can be done asynchronously for better |
305 |
++ * performance. |
306 |
++ */ |
307 |
++ state->async_update = |
308 |
++ !drm_atomic_helper_async_check(dev, state); |
309 |
++ |
310 |
++ /* |
311 |
++ * Skip the remaining global validation if this is an async |
312 |
++ * update. Cursor updates can be done without affecting |
313 |
++ * state or bandwidth calcs and this avoids the performance |
314 |
++ * penalty of locking the private state object and |
315 |
++ * allocating a new dc_state. |
316 |
++ */ |
317 |
++ if (state->async_update) |
318 |
++ return 0; |
319 |
++ } |
320 |
++ |
321 |
+ /* Check scaling and underscan changes*/ |
322 |
+ /* TODO Removed scaling changes validation due to inability to commit |
323 |
+ * new stream into context w\o causing full reset. Need to |
324 |
+@@ -6850,13 +6860,29 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, |
325 |
+ ret = -EINVAL; |
326 |
+ goto fail; |
327 |
+ } |
328 |
+- } else if (state->legacy_cursor_update) { |
329 |
++ } else { |
330 |
+ /* |
331 |
+- * This is a fast cursor update coming from the plane update |
332 |
+- * helper, check if it can be done asynchronously for better |
333 |
+- * performance. |
334 |
++ * The commit is a fast update. Fast updates shouldn't change |
335 |
++ * the DC context, affect global validation, and can have their |
336 |
++ * commit work done in parallel with other commits not touching |
337 |
++ * the same resource. If we have a new DC context as part of |
338 |
++ * the DM atomic state from validation we need to free it and |
339 |
++ * retain the existing one instead. |
340 |
+ */ |
341 |
+- state->async_update = !drm_atomic_helper_async_check(dev, state); |
342 |
++ struct dm_atomic_state *new_dm_state, *old_dm_state; |
343 |
++ |
344 |
++ new_dm_state = dm_atomic_get_new_state(state); |
345 |
++ old_dm_state = dm_atomic_get_old_state(state); |
346 |
++ |
347 |
++ if (new_dm_state && old_dm_state) { |
348 |
++ if (new_dm_state->context) |
349 |
++ dc_release_state(new_dm_state->context); |
350 |
++ |
351 |
++ new_dm_state->context = old_dm_state->context; |
352 |
++ |
353 |
++ if (old_dm_state->context) |
354 |
++ dc_retain_state(old_dm_state->context); |
355 |
++ } |
356 |
+ } |
357 |
+ |
358 |
+ /* Must be success */ |
359 |
+diff --git a/drivers/gpu/drm/amd/display/dc/calcs/Makefile b/drivers/gpu/drm/amd/display/dc/calcs/Makefile |
360 |
+index 95f332ee3e7e..16614d73a5fc 100644 |
361 |
+--- a/drivers/gpu/drm/amd/display/dc/calcs/Makefile |
362 |
++++ b/drivers/gpu/drm/amd/display/dc/calcs/Makefile |
363 |
+@@ -32,6 +32,10 @@ endif |
364 |
+ |
365 |
+ calcs_ccflags := -mhard-float -msse $(cc_stack_align) |
366 |
+ |
367 |
++ifdef CONFIG_CC_IS_CLANG |
368 |
++calcs_ccflags += -msse2 |
369 |
++endif |
370 |
++ |
371 |
+ CFLAGS_dcn_calcs.o := $(calcs_ccflags) |
372 |
+ CFLAGS_dcn_calc_auto.o := $(calcs_ccflags) |
373 |
+ CFLAGS_dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare |
374 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile |
375 |
+index d97ca6528f9d..934ffe1b4b00 100644 |
376 |
+--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile |
377 |
++++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile |
378 |
+@@ -32,6 +32,10 @@ endif |
379 |
+ |
380 |
+ dml_ccflags := -mhard-float -msse $(cc_stack_align) |
381 |
+ |
382 |
++ifdef CONFIG_CC_IS_CLANG |
383 |
++dml_ccflags += -msse2 |
384 |
++endif |
385 |
++ |
386 |
+ CFLAGS_display_mode_lib.o := $(dml_ccflags) |
387 |
+ CFLAGS_display_pipe_clocks.o := $(dml_ccflags) |
388 |
+ CFLAGS_dml1_display_rq_dlg_calc.o := $(dml_ccflags) |
389 |
+diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c |
390 |
+index 54a6414c5d96..429c58ce56ce 100644 |
391 |
+--- a/drivers/gpu/drm/drm_dp_helper.c |
392 |
++++ b/drivers/gpu/drm/drm_dp_helper.c |
393 |
+@@ -1278,7 +1278,9 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { |
394 |
+ /* LG LP140WF6-SPM1 eDP panel */ |
395 |
+ { OUI(0x00, 0x22, 0xb9), DEVICE_ID('s', 'i', 'v', 'a', 'r', 'T'), false, BIT(DP_DPCD_QUIRK_CONSTANT_N) }, |
396 |
+ /* Apple panels need some additional handling to support PSR */ |
397 |
+- { OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR) } |
398 |
++ { OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR) }, |
399 |
++ /* CH7511 seems to leave SINK_COUNT zeroed */ |
400 |
++ { OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) }, |
401 |
+ }; |
402 |
+ |
403 |
+ #undef OUI |
404 |
+diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c |
405 |
+index dd427c7ff967..f13d45f40ed1 100644 |
406 |
+--- a/drivers/gpu/drm/drm_probe_helper.c |
407 |
++++ b/drivers/gpu/drm/drm_probe_helper.c |
408 |
+@@ -581,6 +581,9 @@ static void output_poll_execute(struct work_struct *work) |
409 |
+ enum drm_connector_status old_status; |
410 |
+ bool repoll = false, changed; |
411 |
+ |
412 |
++ if (!dev->mode_config.poll_enabled) |
413 |
++ return; |
414 |
++ |
415 |
+ /* Pick up any changes detected by the probe functions. */ |
416 |
+ changed = dev->mode_config.delayed_event; |
417 |
+ dev->mode_config.delayed_event = false; |
418 |
+@@ -735,7 +738,11 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init); |
419 |
+ */ |
420 |
+ void drm_kms_helper_poll_fini(struct drm_device *dev) |
421 |
+ { |
422 |
+- drm_kms_helper_poll_disable(dev); |
423 |
++ if (!dev->mode_config.poll_enabled) |
424 |
++ return; |
425 |
++ |
426 |
++ dev->mode_config.poll_enabled = false; |
427 |
++ cancel_delayed_work_sync(&dev->mode_config.output_poll_work); |
428 |
+ } |
429 |
+ EXPORT_SYMBOL(drm_kms_helper_poll_fini); |
430 |
+ |
431 |
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c |
432 |
+index 06ee23823a68..acfafc4bda0e 100644 |
433 |
+--- a/drivers/gpu/drm/nouveau/dispnv50/head.c |
434 |
++++ b/drivers/gpu/drm/nouveau/dispnv50/head.c |
435 |
+@@ -169,14 +169,34 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh, |
436 |
+ */ |
437 |
+ switch (mode) { |
438 |
+ case DRM_MODE_SCALE_CENTER: |
439 |
+- asyh->view.oW = min((u16)umode->hdisplay, asyh->view.oW); |
440 |
+- asyh->view.oH = min((u16)umode_vdisplay, asyh->view.oH); |
441 |
+- /* fall-through */ |
442 |
++ /* NOTE: This will cause scaling when the input is |
443 |
++ * larger than the output. |
444 |
++ */ |
445 |
++ asyh->view.oW = min(asyh->view.iW, asyh->view.oW); |
446 |
++ asyh->view.oH = min(asyh->view.iH, asyh->view.oH); |
447 |
++ break; |
448 |
+ case DRM_MODE_SCALE_ASPECT: |
449 |
+- if (asyh->view.oH < asyh->view.oW) { |
450 |
++ /* Determine whether the scaling should be on width or on |
451 |
++ * height. This is done by comparing the aspect ratios of the |
452 |
++ * sizes. If the output AR is larger than input AR, that means |
453 |
++ * we want to change the width (letterboxed on the |
454 |
++ * left/right), otherwise on the height (letterboxed on the |
455 |
++ * top/bottom). |
456 |
++ * |
457 |
++ * E.g. 4:3 (1.333) AR image displayed on a 16:10 (1.6) AR |
458 |
++ * screen will have letterboxes on the left/right. However a |
459 |
++ * 16:9 (1.777) AR image on that same screen will have |
460 |
++ * letterboxes on the top/bottom. |
461 |
++ * |
462 |
++ * inputAR = iW / iH; outputAR = oW / oH |
463 |
++ * outputAR > inputAR is equivalent to oW * iH > iW * oH |
464 |
++ */ |
465 |
++ if (asyh->view.oW * asyh->view.iH > asyh->view.iW * asyh->view.oH) { |
466 |
++ /* Recompute output width, i.e. left/right letterbox */ |
467 |
+ u32 r = (asyh->view.iW << 19) / asyh->view.iH; |
468 |
+ asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19; |
469 |
+ } else { |
470 |
++ /* Recompute output height, i.e. top/bottom letterbox */ |
471 |
+ u32 r = (asyh->view.iH << 19) / asyh->view.iW; |
472 |
+ asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; |
473 |
+ } |
474 |
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h |
475 |
+index 76aa474e92c1..264139be7e29 100644 |
476 |
+--- a/drivers/hid/hid-ids.h |
477 |
++++ b/drivers/hid/hid-ids.h |
478 |
+@@ -568,6 +568,7 @@ |
479 |
+ #define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A 0x0b4a |
480 |
+ #define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE 0x134a |
481 |
+ #define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A 0x094a |
482 |
++#define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0941 0x0941 |
483 |
+ #define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0641 0x0641 |
484 |
+ |
485 |
+ #define USB_VENDOR_ID_HUION 0x256c |
486 |
+diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c |
487 |
+index c8c6d0436ac9..d17e5c2e9246 100644 |
488 |
+--- a/drivers/hid/hid-lg.c |
489 |
++++ b/drivers/hid/hid-lg.c |
490 |
+@@ -818,7 +818,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) |
491 |
+ |
492 |
+ if (!buf) { |
493 |
+ ret = -ENOMEM; |
494 |
+- goto err_free; |
495 |
++ goto err_stop; |
496 |
+ } |
497 |
+ |
498 |
+ ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), |
499 |
+@@ -850,9 +850,12 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) |
500 |
+ ret = lg4ff_init(hdev); |
501 |
+ |
502 |
+ if (ret) |
503 |
+- goto err_free; |
504 |
++ goto err_stop; |
505 |
+ |
506 |
+ return 0; |
507 |
++ |
508 |
++err_stop: |
509 |
++ hid_hw_stop(hdev); |
510 |
+ err_free: |
511 |
+ kfree(drv_data); |
512 |
+ return ret; |
513 |
+@@ -863,8 +866,7 @@ static void lg_remove(struct hid_device *hdev) |
514 |
+ struct lg_drv_data *drv_data = hid_get_drvdata(hdev); |
515 |
+ if (drv_data->quirks & LG_FF4) |
516 |
+ lg4ff_deinit(hdev); |
517 |
+- else |
518 |
+- hid_hw_stop(hdev); |
519 |
++ hid_hw_stop(hdev); |
520 |
+ kfree(drv_data); |
521 |
+ } |
522 |
+ |
523 |
+diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c |
524 |
+index cefba038520c..03f0220062ca 100644 |
525 |
+--- a/drivers/hid/hid-lg4ff.c |
526 |
++++ b/drivers/hid/hid-lg4ff.c |
527 |
+@@ -1477,7 +1477,6 @@ int lg4ff_deinit(struct hid_device *hid) |
528 |
+ } |
529 |
+ } |
530 |
+ #endif |
531 |
+- hid_hw_stop(hid); |
532 |
+ drv_data->device_props = NULL; |
533 |
+ |
534 |
+ kfree(entry); |
535 |
+diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c |
536 |
+index bfcf2ee58d14..0af0fb304c0c 100644 |
537 |
+--- a/drivers/hid/hid-logitech-dj.c |
538 |
++++ b/drivers/hid/hid-logitech-dj.c |
539 |
+@@ -1732,14 +1732,14 @@ static int logi_dj_probe(struct hid_device *hdev, |
540 |
+ if (retval < 0) { |
541 |
+ hid_err(hdev, "%s: logi_dj_recv_query_paired_devices error:%d\n", |
542 |
+ __func__, retval); |
543 |
+- goto logi_dj_recv_query_paired_devices_failed; |
544 |
++ /* |
545 |
++ * This can happen with a KVM, let the probe succeed, |
546 |
++ * logi_dj_recv_queue_unknown_work will retry later. |
547 |
++ */ |
548 |
+ } |
549 |
+ } |
550 |
+ |
551 |
+- return retval; |
552 |
+- |
553 |
+-logi_dj_recv_query_paired_devices_failed: |
554 |
+- hid_hw_close(hdev); |
555 |
++ return 0; |
556 |
+ |
557 |
+ llopen_failed: |
558 |
+ switch_to_dj_mode_fail: |
559 |
+diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c |
560 |
+index 4effce12607b..424d0f775ffa 100644 |
561 |
+--- a/drivers/hid/hid-logitech-hidpp.c |
562 |
++++ b/drivers/hid/hid-logitech-hidpp.c |
563 |
+@@ -3749,28 +3749,8 @@ static const struct hid_device_id hidpp_devices[] = { |
564 |
+ |
565 |
+ { L27MHZ_DEVICE(HID_ANY_ID) }, |
566 |
+ |
567 |
+- { /* Logitech G203/Prodigy Gaming Mouse */ |
568 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC084) }, |
569 |
+- { /* Logitech G302 Gaming Mouse */ |
570 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07F) }, |
571 |
+- { /* Logitech G303 Gaming Mouse */ |
572 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC080) }, |
573 |
+- { /* Logitech G400 Gaming Mouse */ |
574 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07E) }, |
575 |
+ { /* Logitech G403 Wireless Gaming Mouse over USB */ |
576 |
+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC082) }, |
577 |
+- { /* Logitech G403 Gaming Mouse */ |
578 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC083) }, |
579 |
+- { /* Logitech G403 Hero Gaming Mouse over USB */ |
580 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC08F) }, |
581 |
+- { /* Logitech G502 Proteus Core Gaming Mouse */ |
582 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07D) }, |
583 |
+- { /* Logitech G502 Proteus Spectrum Gaming Mouse over USB */ |
584 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC332) }, |
585 |
+- { /* Logitech G502 Hero Gaming Mouse over USB */ |
586 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC08B) }, |
587 |
+- { /* Logitech G700s Gaming Mouse over USB */ |
588 |
+- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07C) }, |
589 |
+ { /* Logitech G703 Gaming Mouse over USB */ |
590 |
+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC087) }, |
591 |
+ { /* Logitech G703 Hero Gaming Mouse over USB */ |
592 |
+diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c |
593 |
+index 21544ebff855..5a3b3d974d84 100644 |
594 |
+--- a/drivers/hid/hid-prodikeys.c |
595 |
++++ b/drivers/hid/hid-prodikeys.c |
596 |
+@@ -551,10 +551,14 @@ static void pcmidi_setup_extra_keys( |
597 |
+ |
598 |
+ static int pcmidi_set_operational(struct pcmidi_snd *pm) |
599 |
+ { |
600 |
++ int rc; |
601 |
++ |
602 |
+ if (pm->ifnum != 1) |
603 |
+ return 0; /* only set up ONCE for interace 1 */ |
604 |
+ |
605 |
+- pcmidi_get_output_report(pm); |
606 |
++ rc = pcmidi_get_output_report(pm); |
607 |
++ if (rc < 0) |
608 |
++ return rc; |
609 |
+ pcmidi_submit_output_report(pm, 0xc1); |
610 |
+ return 0; |
611 |
+ } |
612 |
+@@ -683,7 +687,11 @@ static int pcmidi_snd_initialise(struct pcmidi_snd *pm) |
613 |
+ spin_lock_init(&pm->rawmidi_in_lock); |
614 |
+ |
615 |
+ init_sustain_timers(pm); |
616 |
+- pcmidi_set_operational(pm); |
617 |
++ err = pcmidi_set_operational(pm); |
618 |
++ if (err < 0) { |
619 |
++ pk_error("failed to find output report\n"); |
620 |
++ goto fail_register; |
621 |
++ } |
622 |
+ |
623 |
+ /* register it */ |
624 |
+ err = snd_card_register(card); |
625 |
+diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c |
626 |
+index 4fe2c3ab76f9..efeeac5af633 100644 |
627 |
+--- a/drivers/hid/hid-quirks.c |
628 |
++++ b/drivers/hid/hid-quirks.c |
629 |
+@@ -91,6 +91,7 @@ static const struct hid_device_id hid_quirks[] = { |
630 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A), HID_QUIRK_ALWAYS_POLL }, |
631 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, |
632 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A), HID_QUIRK_ALWAYS_POLL }, |
633 |
++ { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0941), HID_QUIRK_ALWAYS_POLL }, |
634 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0641), HID_QUIRK_ALWAYS_POLL }, |
635 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_IDEACOM, USB_DEVICE_ID_IDEACOM_IDC6680), HID_QUIRK_MULTI_INPUT }, |
636 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_INNOMEDIA, USB_DEVICE_ID_INNEX_GENESIS_ATARI), HID_QUIRK_MULTI_INPUT }, |
637 |
+diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c |
638 |
+index 49dd2d905c7f..73c0f7a95e2d 100644 |
639 |
+--- a/drivers/hid/hid-sony.c |
640 |
++++ b/drivers/hid/hid-sony.c |
641 |
+@@ -2811,7 +2811,6 @@ err_stop: |
642 |
+ sony_cancel_work_sync(sc); |
643 |
+ sony_remove_dev_list(sc); |
644 |
+ sony_release_device_id(sc); |
645 |
+- hid_hw_stop(hdev); |
646 |
+ return ret; |
647 |
+ } |
648 |
+ |
649 |
+@@ -2876,6 +2875,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) |
650 |
+ */ |
651 |
+ if (!(hdev->claimed & HID_CLAIMED_INPUT)) { |
652 |
+ hid_err(hdev, "failed to claim input\n"); |
653 |
++ hid_hw_stop(hdev); |
654 |
+ return -ENODEV; |
655 |
+ } |
656 |
+ |
657 |
+diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c |
658 |
+index 006bd6f4f653..62ef47a730b0 100644 |
659 |
+--- a/drivers/hid/hidraw.c |
660 |
++++ b/drivers/hid/hidraw.c |
661 |
+@@ -370,7 +370,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd, |
662 |
+ |
663 |
+ mutex_lock(&minors_lock); |
664 |
+ dev = hidraw_table[minor]; |
665 |
+- if (!dev) { |
666 |
++ if (!dev || !dev->exist) { |
667 |
+ ret = -ENODEV; |
668 |
+ goto out; |
669 |
+ } |
670 |
+diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c |
671 |
+index ff3fd011796e..3334f5865de7 100644 |
672 |
+--- a/drivers/md/dm-zoned-target.c |
673 |
++++ b/drivers/md/dm-zoned-target.c |
674 |
+@@ -133,8 +133,6 @@ static int dmz_submit_bio(struct dmz_target *dmz, struct dm_zone *zone, |
675 |
+ |
676 |
+ refcount_inc(&bioctx->ref); |
677 |
+ generic_make_request(clone); |
678 |
+- if (clone->bi_status == BLK_STS_IOERR) |
679 |
+- return -EIO; |
680 |
+ |
681 |
+ if (bio_op(bio) == REQ_OP_WRITE && dmz_is_seq(zone)) |
682 |
+ zone->wp_block += nr_blocks; |
683 |
+diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c |
684 |
+index c8fa5906bdf9..ed3e640eb03a 100644 |
685 |
+--- a/drivers/mtd/chips/cfi_cmdset_0002.c |
686 |
++++ b/drivers/mtd/chips/cfi_cmdset_0002.c |
687 |
+@@ -1628,29 +1628,35 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, |
688 |
+ continue; |
689 |
+ } |
690 |
+ |
691 |
+- if (time_after(jiffies, timeo) && !chip_ready(map, adr)){ |
692 |
++ /* |
693 |
++ * We check "time_after" and "!chip_good" before checking |
694 |
++ * "chip_good" to avoid the failure due to scheduling. |
695 |
++ */ |
696 |
++ if (time_after(jiffies, timeo) && !chip_good(map, adr, datum)) { |
697 |
+ xip_enable(map, chip, adr); |
698 |
+ printk(KERN_WARNING "MTD %s(): software timeout\n", __func__); |
699 |
+ xip_disable(map, chip, adr); |
700 |
++ ret = -EIO; |
701 |
+ break; |
702 |
+ } |
703 |
+ |
704 |
+- if (chip_ready(map, adr)) |
705 |
++ if (chip_good(map, adr, datum)) |
706 |
+ break; |
707 |
+ |
708 |
+ /* Latency issues. Drop the lock, wait a while and retry */ |
709 |
+ UDELAY(map, chip, adr, 1); |
710 |
+ } |
711 |
++ |
712 |
+ /* Did we succeed? */ |
713 |
+- if (!chip_good(map, adr, datum)) { |
714 |
++ if (ret) { |
715 |
+ /* reset on all failures. */ |
716 |
+ map_write(map, CMD(0xF0), chip->start); |
717 |
+ /* FIXME - should have reset delay before continuing */ |
718 |
+ |
719 |
+- if (++retry_cnt <= MAX_RETRIES) |
720 |
++ if (++retry_cnt <= MAX_RETRIES) { |
721 |
++ ret = 0; |
722 |
+ goto retry; |
723 |
+- |
724 |
+- ret = -EIO; |
725 |
++ } |
726 |
+ } |
727 |
+ xip_enable(map, chip, adr); |
728 |
+ op_done: |
729 |
+diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
730 |
+index fc5ea87bd387..fe879c07ae3c 100644 |
731 |
+--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
732 |
++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
733 |
+@@ -11,7 +11,6 @@ |
734 |
+ #include <linux/io.h> |
735 |
+ #include <linux/ip.h> |
736 |
+ #include <linux/ipv6.h> |
737 |
+-#include <linux/marvell_phy.h> |
738 |
+ #include <linux/module.h> |
739 |
+ #include <linux/phy.h> |
740 |
+ #include <linux/platform_device.h> |
741 |
+@@ -1150,13 +1149,6 @@ static void hns_nic_adjust_link(struct net_device *ndev) |
742 |
+ } |
743 |
+ } |
744 |
+ |
745 |
+-static int hns_phy_marvell_fixup(struct phy_device *phydev) |
746 |
+-{ |
747 |
+- phydev->dev_flags |= MARVELL_PHY_LED0_LINK_LED1_ACTIVE; |
748 |
+- |
749 |
+- return 0; |
750 |
+-} |
751 |
+- |
752 |
+ /** |
753 |
+ *hns_nic_init_phy - init phy |
754 |
+ *@ndev: net device |
755 |
+@@ -1182,16 +1174,6 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h) |
756 |
+ if (h->phy_if != PHY_INTERFACE_MODE_XGMII) { |
757 |
+ phy_dev->dev_flags = 0; |
758 |
+ |
759 |
+- /* register the PHY fixup (for Marvell 88E1510) */ |
760 |
+- ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, |
761 |
+- MARVELL_PHY_ID_MASK, |
762 |
+- hns_phy_marvell_fixup); |
763 |
+- /* we can live without it, so just issue a warning */ |
764 |
+- if (ret) |
765 |
+- netdev_warn(ndev, |
766 |
+- "Cannot register PHY fixup, ret=%d\n", |
767 |
+- ret); |
768 |
+- |
769 |
+ ret = phy_connect_direct(ndev, phy_dev, hns_nic_adjust_link, |
770 |
+ h->phy_if); |
771 |
+ } else { |
772 |
+@@ -2447,11 +2429,8 @@ static int hns_nic_dev_remove(struct platform_device *pdev) |
773 |
+ hns_nic_uninit_ring_data(priv); |
774 |
+ priv->ring_data = NULL; |
775 |
+ |
776 |
+- if (ndev->phydev) { |
777 |
+- phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510, |
778 |
+- MARVELL_PHY_ID_MASK); |
779 |
++ if (ndev->phydev) |
780 |
+ phy_disconnect(ndev->phydev); |
781 |
+- } |
782 |
+ |
783 |
+ if (!IS_ERR_OR_NULL(priv->ae_handle)) |
784 |
+ hnae_put_handle(priv->ae_handle); |
785 |
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c |
786 |
+index fa4bb940665c..5cb55ea671e3 100644 |
787 |
+--- a/drivers/net/ethernet/ibm/ibmvnic.c |
788 |
++++ b/drivers/net/ethernet/ibm/ibmvnic.c |
789 |
+@@ -1984,8 +1984,11 @@ static void __ibmvnic_reset(struct work_struct *work) |
790 |
+ rwi = get_next_rwi(adapter); |
791 |
+ while (rwi) { |
792 |
+ if (adapter->state == VNIC_REMOVING || |
793 |
+- adapter->state == VNIC_REMOVED) |
794 |
+- goto out; |
795 |
++ adapter->state == VNIC_REMOVED) { |
796 |
++ kfree(rwi); |
797 |
++ rc = EBUSY; |
798 |
++ break; |
799 |
++ } |
800 |
+ |
801 |
+ if (adapter->force_reset_recovery) { |
802 |
+ adapter->force_reset_recovery = false; |
803 |
+@@ -2011,7 +2014,7 @@ static void __ibmvnic_reset(struct work_struct *work) |
804 |
+ netdev_dbg(adapter->netdev, "Reset failed\n"); |
805 |
+ free_all_rwi(adapter); |
806 |
+ } |
807 |
+-out: |
808 |
++ |
809 |
+ adapter->resetting = false; |
810 |
+ if (we_lock_rtnl) |
811 |
+ rtnl_unlock(); |
812 |
+diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c |
813 |
+index 43abdfd0deed..7e171d37bcd6 100644 |
814 |
+--- a/drivers/phy/qualcomm/phy-qcom-qmp.c |
815 |
++++ b/drivers/phy/qualcomm/phy-qcom-qmp.c |
816 |
+@@ -35,7 +35,7 @@ |
817 |
+ #define PLL_READY_GATE_EN BIT(3) |
818 |
+ /* QPHY_PCS_STATUS bit */ |
819 |
+ #define PHYSTATUS BIT(6) |
820 |
+-/* QPHY_COM_PCS_READY_STATUS bit */ |
821 |
++/* QPHY_PCS_READY_STATUS & QPHY_COM_PCS_READY_STATUS bit */ |
822 |
+ #define PCS_READY BIT(0) |
823 |
+ |
824 |
+ /* QPHY_V3_DP_COM_RESET_OVRD_CTRL register bits */ |
825 |
+@@ -115,6 +115,7 @@ enum qphy_reg_layout { |
826 |
+ QPHY_SW_RESET, |
827 |
+ QPHY_START_CTRL, |
828 |
+ QPHY_PCS_READY_STATUS, |
829 |
++ QPHY_PCS_STATUS, |
830 |
+ QPHY_PCS_AUTONOMOUS_MODE_CTRL, |
831 |
+ QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR, |
832 |
+ QPHY_PCS_LFPS_RXTERM_IRQ_STATUS, |
833 |
+@@ -133,7 +134,7 @@ static const unsigned int pciephy_regs_layout[] = { |
834 |
+ [QPHY_FLL_MAN_CODE] = 0xd4, |
835 |
+ [QPHY_SW_RESET] = 0x00, |
836 |
+ [QPHY_START_CTRL] = 0x08, |
837 |
+- [QPHY_PCS_READY_STATUS] = 0x174, |
838 |
++ [QPHY_PCS_STATUS] = 0x174, |
839 |
+ }; |
840 |
+ |
841 |
+ static const unsigned int usb3phy_regs_layout[] = { |
842 |
+@@ -144,7 +145,7 @@ static const unsigned int usb3phy_regs_layout[] = { |
843 |
+ [QPHY_FLL_MAN_CODE] = 0xd0, |
844 |
+ [QPHY_SW_RESET] = 0x00, |
845 |
+ [QPHY_START_CTRL] = 0x08, |
846 |
+- [QPHY_PCS_READY_STATUS] = 0x17c, |
847 |
++ [QPHY_PCS_STATUS] = 0x17c, |
848 |
+ [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = 0x0d4, |
849 |
+ [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = 0x0d8, |
850 |
+ [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] = 0x178, |
851 |
+@@ -153,7 +154,7 @@ static const unsigned int usb3phy_regs_layout[] = { |
852 |
+ static const unsigned int qmp_v3_usb3phy_regs_layout[] = { |
853 |
+ [QPHY_SW_RESET] = 0x00, |
854 |
+ [QPHY_START_CTRL] = 0x08, |
855 |
+- [QPHY_PCS_READY_STATUS] = 0x174, |
856 |
++ [QPHY_PCS_STATUS] = 0x174, |
857 |
+ [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = 0x0d8, |
858 |
+ [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = 0x0dc, |
859 |
+ [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] = 0x170, |
860 |
+@@ -911,7 +912,6 @@ struct qmp_phy_cfg { |
861 |
+ |
862 |
+ unsigned int start_ctrl; |
863 |
+ unsigned int pwrdn_ctrl; |
864 |
+- unsigned int mask_pcs_ready; |
865 |
+ unsigned int mask_com_pcs_ready; |
866 |
+ |
867 |
+ /* true, if PHY has a separate PHY_COM control block */ |
868 |
+@@ -1074,7 +1074,6 @@ static const struct qmp_phy_cfg msm8996_pciephy_cfg = { |
869 |
+ |
870 |
+ .start_ctrl = PCS_START | PLL_READY_GATE_EN, |
871 |
+ .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, |
872 |
+- .mask_pcs_ready = PHYSTATUS, |
873 |
+ .mask_com_pcs_ready = PCS_READY, |
874 |
+ |
875 |
+ .has_phy_com_ctrl = true, |
876 |
+@@ -1106,7 +1105,6 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { |
877 |
+ |
878 |
+ .start_ctrl = SERDES_START | PCS_START, |
879 |
+ .pwrdn_ctrl = SW_PWRDN, |
880 |
+- .mask_pcs_ready = PHYSTATUS, |
881 |
+ }; |
882 |
+ |
883 |
+ /* list of resets */ |
884 |
+@@ -1136,7 +1134,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { |
885 |
+ |
886 |
+ .start_ctrl = SERDES_START | PCS_START, |
887 |
+ .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, |
888 |
+- .mask_pcs_ready = PHYSTATUS, |
889 |
+ |
890 |
+ .has_phy_com_ctrl = false, |
891 |
+ .has_lane_rst = false, |
892 |
+@@ -1167,7 +1164,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { |
893 |
+ |
894 |
+ .start_ctrl = SERDES_START | PCS_START, |
895 |
+ .pwrdn_ctrl = SW_PWRDN, |
896 |
+- .mask_pcs_ready = PHYSTATUS, |
897 |
+ |
898 |
+ .has_pwrdn_delay = true, |
899 |
+ .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, |
900 |
+@@ -1199,7 +1195,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { |
901 |
+ |
902 |
+ .start_ctrl = SERDES_START | PCS_START, |
903 |
+ .pwrdn_ctrl = SW_PWRDN, |
904 |
+- .mask_pcs_ready = PHYSTATUS, |
905 |
+ |
906 |
+ .has_pwrdn_delay = true, |
907 |
+ .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, |
908 |
+@@ -1226,7 +1221,6 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { |
909 |
+ |
910 |
+ .start_ctrl = SERDES_START, |
911 |
+ .pwrdn_ctrl = SW_PWRDN, |
912 |
+- .mask_pcs_ready = PCS_READY, |
913 |
+ |
914 |
+ .is_dual_lane_phy = true, |
915 |
+ .no_pcs_sw_reset = true, |
916 |
+@@ -1254,7 +1248,6 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { |
917 |
+ |
918 |
+ .start_ctrl = SERDES_START | PCS_START, |
919 |
+ .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, |
920 |
+- .mask_pcs_ready = PHYSTATUS, |
921 |
+ .mask_com_pcs_ready = PCS_READY, |
922 |
+ }; |
923 |
+ |
924 |
+@@ -1280,7 +1273,6 @@ static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { |
925 |
+ |
926 |
+ .start_ctrl = SERDES_START | PCS_START, |
927 |
+ .pwrdn_ctrl = SW_PWRDN, |
928 |
+- .mask_pcs_ready = PHYSTATUS, |
929 |
+ |
930 |
+ .is_dual_lane_phy = true, |
931 |
+ }; |
932 |
+@@ -1458,7 +1450,7 @@ static int qcom_qmp_phy_enable(struct phy *phy) |
933 |
+ void __iomem *pcs = qphy->pcs; |
934 |
+ void __iomem *dp_com = qmp->dp_com; |
935 |
+ void __iomem *status; |
936 |
+- unsigned int mask, val; |
937 |
++ unsigned int mask, val, ready; |
938 |
+ int ret; |
939 |
+ |
940 |
+ dev_vdbg(qmp->dev, "Initializing QMP phy\n"); |
941 |
+@@ -1546,10 +1538,17 @@ static int qcom_qmp_phy_enable(struct phy *phy) |
942 |
+ /* start SerDes and Phy-Coding-Sublayer */ |
943 |
+ qphy_setbits(pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); |
944 |
+ |
945 |
+- status = pcs + cfg->regs[QPHY_PCS_READY_STATUS]; |
946 |
+- mask = cfg->mask_pcs_ready; |
947 |
++ if (cfg->type == PHY_TYPE_UFS) { |
948 |
++ status = pcs + cfg->regs[QPHY_PCS_READY_STATUS]; |
949 |
++ mask = PCS_READY; |
950 |
++ ready = PCS_READY; |
951 |
++ } else { |
952 |
++ status = pcs + cfg->regs[QPHY_PCS_STATUS]; |
953 |
++ mask = PHYSTATUS; |
954 |
++ ready = 0; |
955 |
++ } |
956 |
+ |
957 |
+- ret = readl_poll_timeout(status, val, val & mask, 1, |
958 |
++ ret = readl_poll_timeout(status, val, (val & mask) == ready, 10, |
959 |
+ PHY_INIT_COMPLETE_TIMEOUT); |
960 |
+ if (ret) { |
961 |
+ dev_err(qmp->dev, "phy initialization timed-out\n"); |
962 |
+diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c |
963 |
+index 197d8a192721..70efa3d29825 100644 |
964 |
+--- a/drivers/platform/x86/i2c-multi-instantiate.c |
965 |
++++ b/drivers/platform/x86/i2c-multi-instantiate.c |
966 |
+@@ -92,7 +92,7 @@ static int i2c_multi_inst_probe(struct platform_device *pdev) |
967 |
+ for (i = 0; i < multi->num_clients && inst_data[i].type; i++) { |
968 |
+ memset(&board_info, 0, sizeof(board_info)); |
969 |
+ strlcpy(board_info.type, inst_data[i].type, I2C_NAME_SIZE); |
970 |
+- snprintf(name, sizeof(name), "%s-%s.%d", match->id, |
971 |
++ snprintf(name, sizeof(name), "%s-%s.%d", dev_name(dev), |
972 |
+ inst_data[i].type, i); |
973 |
+ board_info.dev_name = name; |
974 |
+ switch (inst_data[i].flags & IRQ_RESOURCE_TYPE) { |
975 |
+diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c |
976 |
+index 42de31d20616..8ae8ef526b4a 100644 |
977 |
+--- a/fs/cifs/smb2ops.c |
978 |
++++ b/fs/cifs/smb2ops.c |
979 |
+@@ -656,6 +656,15 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid) |
980 |
+ return 0; |
981 |
+ } |
982 |
+ |
983 |
++ /* |
984 |
++ * We do not hold the lock for the open because in case |
985 |
++ * SMB2_open needs to reconnect, it will end up calling |
986 |
++ * cifs_mark_open_files_invalid() which takes the lock again |
987 |
++ * thus causing a deadlock |
988 |
++ */ |
989 |
++ |
990 |
++ mutex_unlock(&tcon->crfid.fid_mutex); |
991 |
++ |
992 |
+ if (smb3_encryption_required(tcon)) |
993 |
+ flags |= CIFS_TRANSFORM_REQ; |
994 |
+ |
995 |
+@@ -677,7 +686,7 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid) |
996 |
+ |
997 |
+ rc = SMB2_open_init(tcon, &rqst[0], &oplock, &oparms, &utf16_path); |
998 |
+ if (rc) |
999 |
+- goto oshr_exit; |
1000 |
++ goto oshr_free; |
1001 |
+ smb2_set_next_command(tcon, &rqst[0]); |
1002 |
+ |
1003 |
+ memset(&qi_iov, 0, sizeof(qi_iov)); |
1004 |
+@@ -690,18 +699,10 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid) |
1005 |
+ sizeof(struct smb2_file_all_info) + |
1006 |
+ PATH_MAX * 2, 0, NULL); |
1007 |
+ if (rc) |
1008 |
+- goto oshr_exit; |
1009 |
++ goto oshr_free; |
1010 |
+ |
1011 |
+ smb2_set_related(&rqst[1]); |
1012 |
+ |
1013 |
+- /* |
1014 |
+- * We do not hold the lock for the open because in case |
1015 |
+- * SMB2_open needs to reconnect, it will end up calling |
1016 |
+- * cifs_mark_open_files_invalid() which takes the lock again |
1017 |
+- * thus causing a deadlock |
1018 |
+- */ |
1019 |
+- |
1020 |
+- mutex_unlock(&tcon->crfid.fid_mutex); |
1021 |
+ rc = compound_send_recv(xid, ses, flags, 2, rqst, |
1022 |
+ resp_buftype, rsp_iov); |
1023 |
+ mutex_lock(&tcon->crfid.fid_mutex); |
1024 |
+diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c |
1025 |
+index d0539ddad6e2..7d9fce215f46 100644 |
1026 |
+--- a/fs/f2fs/checkpoint.c |
1027 |
++++ b/fs/f2fs/checkpoint.c |
1028 |
+@@ -894,6 +894,7 @@ int f2fs_get_valid_checkpoint(struct f2fs_sb_info *sbi) |
1029 |
+ unsigned int cp_blks = 1 + __cp_payload(sbi); |
1030 |
+ block_t cp_blk_no; |
1031 |
+ int i; |
1032 |
++ int err; |
1033 |
+ |
1034 |
+ sbi->ckpt = f2fs_kzalloc(sbi, array_size(blk_size, cp_blks), |
1035 |
+ GFP_KERNEL); |
1036 |
+@@ -921,6 +922,7 @@ int f2fs_get_valid_checkpoint(struct f2fs_sb_info *sbi) |
1037 |
+ } else if (cp2) { |
1038 |
+ cur_page = cp2; |
1039 |
+ } else { |
1040 |
++ err = -EFSCORRUPTED; |
1041 |
+ goto fail_no_cp; |
1042 |
+ } |
1043 |
+ |
1044 |
+@@ -933,8 +935,10 @@ int f2fs_get_valid_checkpoint(struct f2fs_sb_info *sbi) |
1045 |
+ sbi->cur_cp_pack = 2; |
1046 |
+ |
1047 |
+ /* Sanity checking of checkpoint */ |
1048 |
+- if (f2fs_sanity_check_ckpt(sbi)) |
1049 |
++ if (f2fs_sanity_check_ckpt(sbi)) { |
1050 |
++ err = -EFSCORRUPTED; |
1051 |
+ goto free_fail_no_cp; |
1052 |
++ } |
1053 |
+ |
1054 |
+ if (cp_blks <= 1) |
1055 |
+ goto done; |
1056 |
+@@ -948,8 +952,10 @@ int f2fs_get_valid_checkpoint(struct f2fs_sb_info *sbi) |
1057 |
+ unsigned char *ckpt = (unsigned char *)sbi->ckpt; |
1058 |
+ |
1059 |
+ cur_page = f2fs_get_meta_page(sbi, cp_blk_no + i); |
1060 |
+- if (IS_ERR(cur_page)) |
1061 |
++ if (IS_ERR(cur_page)) { |
1062 |
++ err = PTR_ERR(cur_page); |
1063 |
+ goto free_fail_no_cp; |
1064 |
++ } |
1065 |
+ sit_bitmap_ptr = page_address(cur_page); |
1066 |
+ memcpy(ckpt + i * blk_size, sit_bitmap_ptr, blk_size); |
1067 |
+ f2fs_put_page(cur_page, 1); |
1068 |
+@@ -964,7 +970,7 @@ free_fail_no_cp: |
1069 |
+ f2fs_put_page(cp2, 1); |
1070 |
+ fail_no_cp: |
1071 |
+ kvfree(sbi->ckpt); |
1072 |
+- return -EINVAL; |
1073 |
++ return err; |
1074 |
+ } |
1075 |
+ |
1076 |
+ static void __add_dirty_inode(struct inode *inode, enum inode_type type) |
1077 |
+diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c |
1078 |
+index 923923603a7d..85f3879a31cb 100644 |
1079 |
+--- a/fs/f2fs/data.c |
1080 |
++++ b/fs/f2fs/data.c |
1081 |
+@@ -455,7 +455,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) |
1082 |
+ if (!f2fs_is_valid_blkaddr(fio->sbi, fio->new_blkaddr, |
1083 |
+ fio->is_por ? META_POR : (__is_meta_io(fio) ? |
1084 |
+ META_GENERIC : DATA_GENERIC_ENHANCE))) |
1085 |
+- return -EFAULT; |
1086 |
++ return -EFSCORRUPTED; |
1087 |
+ |
1088 |
+ trace_f2fs_submit_page_bio(page, fio); |
1089 |
+ f2fs_trace_ios(fio, 0); |
1090 |
+@@ -734,7 +734,7 @@ struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index, |
1091 |
+ dn.data_blkaddr = ei.blk + index - ei.fofs; |
1092 |
+ if (!f2fs_is_valid_blkaddr(F2FS_I_SB(inode), dn.data_blkaddr, |
1093 |
+ DATA_GENERIC_ENHANCE_READ)) { |
1094 |
+- err = -EFAULT; |
1095 |
++ err = -EFSCORRUPTED; |
1096 |
+ goto put_err; |
1097 |
+ } |
1098 |
+ goto got_it; |
1099 |
+@@ -754,7 +754,7 @@ struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index, |
1100 |
+ !f2fs_is_valid_blkaddr(F2FS_I_SB(inode), |
1101 |
+ dn.data_blkaddr, |
1102 |
+ DATA_GENERIC_ENHANCE)) { |
1103 |
+- err = -EFAULT; |
1104 |
++ err = -EFSCORRUPTED; |
1105 |
+ goto put_err; |
1106 |
+ } |
1107 |
+ got_it: |
1108 |
+@@ -1100,7 +1100,7 @@ next_block: |
1109 |
+ |
1110 |
+ if (__is_valid_data_blkaddr(blkaddr) && |
1111 |
+ !f2fs_is_valid_blkaddr(sbi, blkaddr, DATA_GENERIC_ENHANCE)) { |
1112 |
+- err = -EFAULT; |
1113 |
++ err = -EFSCORRUPTED; |
1114 |
+ goto sync_out; |
1115 |
+ } |
1116 |
+ |
1117 |
+@@ -1570,7 +1570,7 @@ got_it: |
1118 |
+ |
1119 |
+ if (!f2fs_is_valid_blkaddr(F2FS_I_SB(inode), block_nr, |
1120 |
+ DATA_GENERIC_ENHANCE_READ)) { |
1121 |
+- ret = -EFAULT; |
1122 |
++ ret = -EFSCORRUPTED; |
1123 |
+ goto out; |
1124 |
+ } |
1125 |
+ } else { |
1126 |
+@@ -1851,7 +1851,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio) |
1127 |
+ |
1128 |
+ if (!f2fs_is_valid_blkaddr(fio->sbi, fio->old_blkaddr, |
1129 |
+ DATA_GENERIC_ENHANCE)) |
1130 |
+- return -EFAULT; |
1131 |
++ return -EFSCORRUPTED; |
1132 |
+ |
1133 |
+ ipu_force = true; |
1134 |
+ fio->need_lock = LOCK_DONE; |
1135 |
+@@ -1878,7 +1878,7 @@ got_it: |
1136 |
+ if (__is_valid_data_blkaddr(fio->old_blkaddr) && |
1137 |
+ !f2fs_is_valid_blkaddr(fio->sbi, fio->old_blkaddr, |
1138 |
+ DATA_GENERIC_ENHANCE)) { |
1139 |
+- err = -EFAULT; |
1140 |
++ err = -EFSCORRUPTED; |
1141 |
+ goto out_writepage; |
1142 |
+ } |
1143 |
+ /* |
1144 |
+@@ -2536,7 +2536,7 @@ repeat: |
1145 |
+ } else { |
1146 |
+ if (!f2fs_is_valid_blkaddr(sbi, blkaddr, |
1147 |
+ DATA_GENERIC_ENHANCE_READ)) { |
1148 |
+- err = -EFAULT; |
1149 |
++ err = -EFSCORRUPTED; |
1150 |
+ goto fail; |
1151 |
+ } |
1152 |
+ err = f2fs_submit_page_read(inode, page, blkaddr); |
1153 |
+diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c |
1154 |
+index 59bc46017855..4be433f20930 100644 |
1155 |
+--- a/fs/f2fs/dir.c |
1156 |
++++ b/fs/f2fs/dir.c |
1157 |
+@@ -820,7 +820,7 @@ int f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d, |
1158 |
+ "%s: corrupted namelen=%d, run fsck to fix.", |
1159 |
+ __func__, le16_to_cpu(de->name_len)); |
1160 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
1161 |
+- err = -EINVAL; |
1162 |
++ err = -EFSCORRUPTED; |
1163 |
+ goto out; |
1164 |
+ } |
1165 |
+ |
1166 |
+diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h |
1167 |
+index cbdc2f88a98c..b545beb8b04e 100644 |
1168 |
+--- a/fs/f2fs/f2fs.h |
1169 |
++++ b/fs/f2fs/f2fs.h |
1170 |
+@@ -3718,4 +3718,7 @@ static inline bool is_journalled_quota(struct f2fs_sb_info *sbi) |
1171 |
+ return false; |
1172 |
+ } |
1173 |
+ |
1174 |
++#define EFSBADCRC EBADMSG /* Bad CRC detected */ |
1175 |
++#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ |
1176 |
++ |
1177 |
+ #endif /* _LINUX_F2FS_H */ |
1178 |
+diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c |
1179 |
+index 45b45f37d347..33c6e14d0c87 100644 |
1180 |
+--- a/fs/f2fs/file.c |
1181 |
++++ b/fs/f2fs/file.c |
1182 |
+@@ -1026,7 +1026,7 @@ next_dnode: |
1183 |
+ !f2fs_is_valid_blkaddr(sbi, *blkaddr, |
1184 |
+ DATA_GENERIC_ENHANCE)) { |
1185 |
+ f2fs_put_dnode(&dn); |
1186 |
+- return -EFAULT; |
1187 |
++ return -EFSCORRUPTED; |
1188 |
+ } |
1189 |
+ |
1190 |
+ if (!f2fs_is_checkpointed_data(sbi, *blkaddr)) { |
1191 |
+diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c |
1192 |
+index bb6fd5a506d3..08224776618e 100644 |
1193 |
+--- a/fs/f2fs/gc.c |
1194 |
++++ b/fs/f2fs/gc.c |
1195 |
+@@ -658,7 +658,7 @@ static int ra_data_block(struct inode *inode, pgoff_t index) |
1196 |
+ dn.data_blkaddr = ei.blk + index - ei.fofs; |
1197 |
+ if (unlikely(!f2fs_is_valid_blkaddr(sbi, dn.data_blkaddr, |
1198 |
+ DATA_GENERIC_ENHANCE_READ))) { |
1199 |
+- err = -EFAULT; |
1200 |
++ err = -EFSCORRUPTED; |
1201 |
+ goto put_page; |
1202 |
+ } |
1203 |
+ goto got_it; |
1204 |
+@@ -676,7 +676,7 @@ static int ra_data_block(struct inode *inode, pgoff_t index) |
1205 |
+ } |
1206 |
+ if (unlikely(!f2fs_is_valid_blkaddr(sbi, dn.data_blkaddr, |
1207 |
+ DATA_GENERIC_ENHANCE))) { |
1208 |
+- err = -EFAULT; |
1209 |
++ err = -EFSCORRUPTED; |
1210 |
+ goto put_page; |
1211 |
+ } |
1212 |
+ got_it: |
1213 |
+diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c |
1214 |
+index 404d2462a0fe..aa9b5b6d1b23 100644 |
1215 |
+--- a/fs/f2fs/inline.c |
1216 |
++++ b/fs/f2fs/inline.c |
1217 |
+@@ -144,7 +144,7 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page) |
1218 |
+ "%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, " |
1219 |
+ "run fsck to fix.", |
1220 |
+ __func__, dn->inode->i_ino, dn->data_blkaddr); |
1221 |
+- return -EINVAL; |
1222 |
++ return -EFSCORRUPTED; |
1223 |
+ } |
1224 |
+ |
1225 |
+ f2fs_bug_on(F2FS_P_SB(page), PageWriteback(page)); |
1226 |
+@@ -387,7 +387,7 @@ static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage, |
1227 |
+ "%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, " |
1228 |
+ "run fsck to fix.", |
1229 |
+ __func__, dir->i_ino, dn.data_blkaddr); |
1230 |
+- err = -EINVAL; |
1231 |
++ err = -EFSCORRUPTED; |
1232 |
+ goto out; |
1233 |
+ } |
1234 |
+ |
1235 |
+diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c |
1236 |
+index ccb02226dd2c..e26995975570 100644 |
1237 |
+--- a/fs/f2fs/inode.c |
1238 |
++++ b/fs/f2fs/inode.c |
1239 |
+@@ -74,7 +74,7 @@ static int __written_first_block(struct f2fs_sb_info *sbi, |
1240 |
+ if (!__is_valid_data_blkaddr(addr)) |
1241 |
+ return 1; |
1242 |
+ if (!f2fs_is_valid_blkaddr(sbi, addr, DATA_GENERIC_ENHANCE)) |
1243 |
+- return -EFAULT; |
1244 |
++ return -EFSCORRUPTED; |
1245 |
+ return 0; |
1246 |
+ } |
1247 |
+ |
1248 |
+@@ -374,7 +374,7 @@ static int do_read_inode(struct inode *inode) |
1249 |
+ |
1250 |
+ if (!sanity_check_inode(inode, node_page)) { |
1251 |
+ f2fs_put_page(node_page, 1); |
1252 |
+- return -EINVAL; |
1253 |
++ return -EFSCORRUPTED; |
1254 |
+ } |
1255 |
+ |
1256 |
+ /* check data exist */ |
1257 |
+diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c |
1258 |
+index 18a038a2a9fa..ad024b7b1d43 100644 |
1259 |
+--- a/fs/f2fs/node.c |
1260 |
++++ b/fs/f2fs/node.c |
1261 |
+@@ -37,7 +37,7 @@ int f2fs_check_nid_range(struct f2fs_sb_info *sbi, nid_t nid) |
1262 |
+ f2fs_msg(sbi->sb, KERN_WARNING, |
1263 |
+ "%s: out-of-range nid=%x, run fsck to fix.", |
1264 |
+ __func__, nid); |
1265 |
+- return -EINVAL; |
1266 |
++ return -EFSCORRUPTED; |
1267 |
+ } |
1268 |
+ return 0; |
1269 |
+ } |
1270 |
+@@ -1291,7 +1291,7 @@ static int read_node_page(struct page *page, int op_flags) |
1271 |
+ if (PageUptodate(page)) { |
1272 |
+ if (!f2fs_inode_chksum_verify(sbi, page)) { |
1273 |
+ ClearPageUptodate(page); |
1274 |
+- return -EBADMSG; |
1275 |
++ return -EFSBADCRC; |
1276 |
+ } |
1277 |
+ return LOCKED_PAGE; |
1278 |
+ } |
1279 |
+@@ -1375,7 +1375,7 @@ repeat: |
1280 |
+ } |
1281 |
+ |
1282 |
+ if (!f2fs_inode_chksum_verify(sbi, page)) { |
1283 |
+- err = -EBADMSG; |
1284 |
++ err = -EFSBADCRC; |
1285 |
+ goto out_err; |
1286 |
+ } |
1287 |
+ page_hit: |
1288 |
+diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c |
1289 |
+index e04f82b3f4fc..d728858ac95d 100644 |
1290 |
+--- a/fs/f2fs/recovery.c |
1291 |
++++ b/fs/f2fs/recovery.c |
1292 |
+@@ -557,7 +557,7 @@ retry_dn: |
1293 |
+ "Inconsistent ofs_of_node, ino:%lu, ofs:%u, %u", |
1294 |
+ inode->i_ino, ofs_of_node(dn.node_page), |
1295 |
+ ofs_of_node(page)); |
1296 |
+- err = -EFAULT; |
1297 |
++ err = -EFSCORRUPTED; |
1298 |
+ goto err; |
1299 |
+ } |
1300 |
+ |
1301 |
+@@ -569,13 +569,13 @@ retry_dn: |
1302 |
+ |
1303 |
+ if (__is_valid_data_blkaddr(src) && |
1304 |
+ !f2fs_is_valid_blkaddr(sbi, src, META_POR)) { |
1305 |
+- err = -EFAULT; |
1306 |
++ err = -EFSCORRUPTED; |
1307 |
+ goto err; |
1308 |
+ } |
1309 |
+ |
1310 |
+ if (__is_valid_data_blkaddr(dest) && |
1311 |
+ !f2fs_is_valid_blkaddr(sbi, dest, META_POR)) { |
1312 |
+- err = -EFAULT; |
1313 |
++ err = -EFSCORRUPTED; |
1314 |
+ goto err; |
1315 |
+ } |
1316 |
+ |
1317 |
+diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c |
1318 |
+index ce15fbcd7cff..eab59d6ea945 100644 |
1319 |
+--- a/fs/f2fs/segment.c |
1320 |
++++ b/fs/f2fs/segment.c |
1321 |
+@@ -2784,7 +2784,7 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) |
1322 |
+ if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) { |
1323 |
+ f2fs_msg(sbi->sb, KERN_WARNING, |
1324 |
+ "Found FS corruption, run fsck to fix."); |
1325 |
+- return -EIO; |
1326 |
++ return -EFSCORRUPTED; |
1327 |
+ } |
1328 |
+ |
1329 |
+ /* start/end segment number in main_area */ |
1330 |
+@@ -3207,7 +3207,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio) |
1331 |
+ |
1332 |
+ if (!IS_DATASEG(get_seg_entry(sbi, segno)->type)) { |
1333 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
1334 |
+- return -EFAULT; |
1335 |
++ return -EFSCORRUPTED; |
1336 |
+ } |
1337 |
+ |
1338 |
+ stat_inc_inplace_blocks(fio->sbi); |
1339 |
+@@ -3403,11 +3403,6 @@ static int read_compacted_summaries(struct f2fs_sb_info *sbi) |
1340 |
+ seg_i = CURSEG_I(sbi, i); |
1341 |
+ segno = le32_to_cpu(ckpt->cur_data_segno[i]); |
1342 |
+ blk_off = le16_to_cpu(ckpt->cur_data_blkoff[i]); |
1343 |
+- if (blk_off > ENTRIES_IN_SUM) { |
1344 |
+- f2fs_bug_on(sbi, 1); |
1345 |
+- f2fs_put_page(page, 1); |
1346 |
+- return -EFAULT; |
1347 |
+- } |
1348 |
+ seg_i->next_segno = segno; |
1349 |
+ reset_curseg(sbi, i, 0); |
1350 |
+ seg_i->alloc_type = ckpt->alloc_type[i]; |
1351 |
+@@ -4115,7 +4110,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi) |
1352 |
+ "Wrong journal entry on segno %u", |
1353 |
+ start); |
1354 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
1355 |
+- err = -EINVAL; |
1356 |
++ err = -EFSCORRUPTED; |
1357 |
+ break; |
1358 |
+ } |
1359 |
+ |
1360 |
+@@ -4156,7 +4151,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi) |
1361 |
+ "SIT is corrupted node# %u vs %u", |
1362 |
+ total_node_blocks, valid_node_count(sbi)); |
1363 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
1364 |
+- err = -EINVAL; |
1365 |
++ err = -EFSCORRUPTED; |
1366 |
+ } |
1367 |
+ |
1368 |
+ return err; |
1369 |
+@@ -4247,6 +4242,41 @@ static int build_dirty_segmap(struct f2fs_sb_info *sbi) |
1370 |
+ return init_victim_secmap(sbi); |
1371 |
+ } |
1372 |
+ |
1373 |
++static int sanity_check_curseg(struct f2fs_sb_info *sbi) |
1374 |
++{ |
1375 |
++ int i; |
1376 |
++ |
1377 |
++ /* |
1378 |
++ * In LFS/SSR curseg, .next_blkoff should point to an unused blkaddr; |
1379 |
++ * In LFS curseg, all blkaddr after .next_blkoff should be unused. |
1380 |
++ */ |
1381 |
++ for (i = 0; i < NO_CHECK_TYPE; i++) { |
1382 |
++ struct curseg_info *curseg = CURSEG_I(sbi, i); |
1383 |
++ struct seg_entry *se = get_seg_entry(sbi, curseg->segno); |
1384 |
++ unsigned int blkofs = curseg->next_blkoff; |
1385 |
++ |
1386 |
++ if (f2fs_test_bit(blkofs, se->cur_valid_map)) |
1387 |
++ goto out; |
1388 |
++ |
1389 |
++ if (curseg->alloc_type == SSR) |
1390 |
++ continue; |
1391 |
++ |
1392 |
++ for (blkofs += 1; blkofs < sbi->blocks_per_seg; blkofs++) { |
1393 |
++ if (!f2fs_test_bit(blkofs, se->cur_valid_map)) |
1394 |
++ continue; |
1395 |
++out: |
1396 |
++ f2fs_msg(sbi->sb, KERN_ERR, |
1397 |
++ "Current segment's next free block offset is " |
1398 |
++ "inconsistent with bitmap, logtype:%u, " |
1399 |
++ "segno:%u, type:%u, next_blkoff:%u, blkofs:%u", |
1400 |
++ i, curseg->segno, curseg->alloc_type, |
1401 |
++ curseg->next_blkoff, blkofs); |
1402 |
++ return -EFSCORRUPTED; |
1403 |
++ } |
1404 |
++ } |
1405 |
++ return 0; |
1406 |
++} |
1407 |
++ |
1408 |
+ /* |
1409 |
+ * Update min, max modified time for cost-benefit GC algorithm |
1410 |
+ */ |
1411 |
+@@ -4342,6 +4372,10 @@ int f2fs_build_segment_manager(struct f2fs_sb_info *sbi) |
1412 |
+ if (err) |
1413 |
+ return err; |
1414 |
+ |
1415 |
++ err = sanity_check_curseg(sbi); |
1416 |
++ if (err) |
1417 |
++ return err; |
1418 |
++ |
1419 |
+ init_min_max_mtime(sbi); |
1420 |
+ return 0; |
1421 |
+ } |
1422 |
+diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h |
1423 |
+index 429007b8036e..4bd151f2b954 100644 |
1424 |
+--- a/fs/f2fs/segment.h |
1425 |
++++ b/fs/f2fs/segment.h |
1426 |
+@@ -697,7 +697,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi, |
1427 |
+ "Mismatch valid blocks %d vs. %d", |
1428 |
+ GET_SIT_VBLOCKS(raw_sit), valid_blocks); |
1429 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
1430 |
+- return -EINVAL; |
1431 |
++ return -EFSCORRUPTED; |
1432 |
+ } |
1433 |
+ |
1434 |
+ /* check segment usage, and check boundary of a given segment number */ |
1435 |
+@@ -707,7 +707,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi, |
1436 |
+ "Wrong valid blocks %d or segno %u", |
1437 |
+ GET_SIT_VBLOCKS(raw_sit), segno); |
1438 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
1439 |
+- return -EINVAL; |
1440 |
++ return -EFSCORRUPTED; |
1441 |
+ } |
1442 |
+ return 0; |
1443 |
+ } |
1444 |
+diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c |
1445 |
+index 4b47ac994daf..973f1e818770 100644 |
1446 |
+--- a/fs/f2fs/super.c |
1447 |
++++ b/fs/f2fs/super.c |
1448 |
+@@ -2908,7 +2908,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, |
1449 |
+ f2fs_msg(sb, KERN_ERR, |
1450 |
+ "Can't find valid F2FS filesystem in %dth superblock", |
1451 |
+ block + 1); |
1452 |
+- err = -EINVAL; |
1453 |
++ err = -EFSCORRUPTED; |
1454 |
+ brelse(bh); |
1455 |
+ continue; |
1456 |
+ } |
1457 |
+diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c |
1458 |
+index e791741d193b..963242018663 100644 |
1459 |
+--- a/fs/f2fs/xattr.c |
1460 |
++++ b/fs/f2fs/xattr.c |
1461 |
+@@ -346,7 +346,7 @@ static int lookup_all_xattrs(struct inode *inode, struct page *ipage, |
1462 |
+ |
1463 |
+ *xe = __find_xattr(cur_addr, last_txattr_addr, index, len, name); |
1464 |
+ if (!*xe) { |
1465 |
+- err = -EFAULT; |
1466 |
++ err = -EFSCORRUPTED; |
1467 |
+ goto out; |
1468 |
+ } |
1469 |
+ check: |
1470 |
+@@ -622,7 +622,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, |
1471 |
+ /* find entry with wanted name. */ |
1472 |
+ here = __find_xattr(base_addr, last_base_addr, index, len, name); |
1473 |
+ if (!here) { |
1474 |
+- error = -EFAULT; |
1475 |
++ error = -EFSCORRUPTED; |
1476 |
+ goto exit; |
1477 |
+ } |
1478 |
+ |
1479 |
+diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c |
1480 |
+index 356ebd1cbe82..d6fbe487d91a 100644 |
1481 |
+--- a/fs/xfs/libxfs/xfs_bmap.c |
1482 |
++++ b/fs/xfs/libxfs/xfs_bmap.c |
1483 |
+@@ -3840,15 +3840,28 @@ xfs_bmapi_read( |
1484 |
+ XFS_STATS_INC(mp, xs_blk_mapr); |
1485 |
+ |
1486 |
+ ifp = XFS_IFORK_PTR(ip, whichfork); |
1487 |
++ if (!ifp) { |
1488 |
++ /* No CoW fork? Return a hole. */ |
1489 |
++ if (whichfork == XFS_COW_FORK) { |
1490 |
++ mval->br_startoff = bno; |
1491 |
++ mval->br_startblock = HOLESTARTBLOCK; |
1492 |
++ mval->br_blockcount = len; |
1493 |
++ mval->br_state = XFS_EXT_NORM; |
1494 |
++ *nmap = 1; |
1495 |
++ return 0; |
1496 |
++ } |
1497 |
+ |
1498 |
+- /* No CoW fork? Return a hole. */ |
1499 |
+- if (whichfork == XFS_COW_FORK && !ifp) { |
1500 |
+- mval->br_startoff = bno; |
1501 |
+- mval->br_startblock = HOLESTARTBLOCK; |
1502 |
+- mval->br_blockcount = len; |
1503 |
+- mval->br_state = XFS_EXT_NORM; |
1504 |
+- *nmap = 1; |
1505 |
+- return 0; |
1506 |
++ /* |
1507 |
++ * A missing attr ifork implies that the inode says we're in |
1508 |
++ * extents or btree format but failed to pass the inode fork |
1509 |
++ * verifier while trying to load it. Treat that as a file |
1510 |
++ * corruption too. |
1511 |
++ */ |
1512 |
++#ifdef DEBUG |
1513 |
++ xfs_alert(mp, "%s: inode %llu missing fork %d", |
1514 |
++ __func__, ip->i_ino, whichfork); |
1515 |
++#endif /* DEBUG */ |
1516 |
++ return -EFSCORRUPTED; |
1517 |
+ } |
1518 |
+ |
1519 |
+ if (!(ifp->if_flags & XFS_IFEXTENTS)) { |
1520 |
+diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h |
1521 |
+index 97ce790a5b5a..d6c89cbe127a 100644 |
1522 |
+--- a/include/drm/drm_dp_helper.h |
1523 |
++++ b/include/drm/drm_dp_helper.h |
1524 |
+@@ -1401,6 +1401,13 @@ enum drm_dp_quirk { |
1525 |
+ * driver still need to implement proper handling for such device. |
1526 |
+ */ |
1527 |
+ DP_DPCD_QUIRK_NO_PSR, |
1528 |
++ /** |
1529 |
++ * @DP_DPCD_QUIRK_NO_SINK_COUNT: |
1530 |
++ * |
1531 |
++ * The device does not set SINK_COUNT to a non-zero value. |
1532 |
++ * The driver should ignore SINK_COUNT during detection. |
1533 |
++ */ |
1534 |
++ DP_DPCD_QUIRK_NO_SINK_COUNT, |
1535 |
+ }; |
1536 |
+ |
1537 |
+ /** |
1538 |
+diff --git a/mm/z3fold.c b/mm/z3fold.c |
1539 |
+index 8374b18ebe9a..185c07eac0da 100644 |
1540 |
+--- a/mm/z3fold.c |
1541 |
++++ b/mm/z3fold.c |
1542 |
+@@ -41,7 +41,6 @@ |
1543 |
+ #include <linux/workqueue.h> |
1544 |
+ #include <linux/slab.h> |
1545 |
+ #include <linux/spinlock.h> |
1546 |
+-#include <linux/wait.h> |
1547 |
+ #include <linux/zpool.h> |
1548 |
+ |
1549 |
+ /* |
1550 |
+@@ -145,8 +144,6 @@ struct z3fold_header { |
1551 |
+ * @release_wq: workqueue for safe page release |
1552 |
+ * @work: work_struct for safe page release |
1553 |
+ * @inode: inode for z3fold pseudo filesystem |
1554 |
+- * @destroying: bool to stop migration once we start destruction |
1555 |
+- * @isolated: int to count the number of pages currently in isolation |
1556 |
+ * |
1557 |
+ * This structure is allocated at pool creation time and maintains metadata |
1558 |
+ * pertaining to a particular z3fold pool. |
1559 |
+@@ -165,11 +162,8 @@ struct z3fold_pool { |
1560 |
+ const struct zpool_ops *zpool_ops; |
1561 |
+ struct workqueue_struct *compact_wq; |
1562 |
+ struct workqueue_struct *release_wq; |
1563 |
+- struct wait_queue_head isolate_wait; |
1564 |
+ struct work_struct work; |
1565 |
+ struct inode *inode; |
1566 |
+- bool destroying; |
1567 |
+- int isolated; |
1568 |
+ }; |
1569 |
+ |
1570 |
+ /* |
1571 |
+@@ -777,7 +771,6 @@ static struct z3fold_pool *z3fold_create_pool(const char *name, gfp_t gfp, |
1572 |
+ goto out_c; |
1573 |
+ spin_lock_init(&pool->lock); |
1574 |
+ spin_lock_init(&pool->stale_lock); |
1575 |
+- init_waitqueue_head(&pool->isolate_wait); |
1576 |
+ pool->unbuddied = __alloc_percpu(sizeof(struct list_head)*NCHUNKS, 2); |
1577 |
+ if (!pool->unbuddied) |
1578 |
+ goto out_pool; |
1579 |
+@@ -817,15 +810,6 @@ out: |
1580 |
+ return NULL; |
1581 |
+ } |
1582 |
+ |
1583 |
+-static bool pool_isolated_are_drained(struct z3fold_pool *pool) |
1584 |
+-{ |
1585 |
+- bool ret; |
1586 |
+- |
1587 |
+- spin_lock(&pool->lock); |
1588 |
+- ret = pool->isolated == 0; |
1589 |
+- spin_unlock(&pool->lock); |
1590 |
+- return ret; |
1591 |
+-} |
1592 |
+ /** |
1593 |
+ * z3fold_destroy_pool() - destroys an existing z3fold pool |
1594 |
+ * @pool: the z3fold pool to be destroyed |
1595 |
+@@ -835,22 +819,6 @@ static bool pool_isolated_are_drained(struct z3fold_pool *pool) |
1596 |
+ static void z3fold_destroy_pool(struct z3fold_pool *pool) |
1597 |
+ { |
1598 |
+ kmem_cache_destroy(pool->c_handle); |
1599 |
+- /* |
1600 |
+- * We set pool-> destroying under lock to ensure that |
1601 |
+- * z3fold_page_isolate() sees any changes to destroying. This way we |
1602 |
+- * avoid the need for any memory barriers. |
1603 |
+- */ |
1604 |
+- |
1605 |
+- spin_lock(&pool->lock); |
1606 |
+- pool->destroying = true; |
1607 |
+- spin_unlock(&pool->lock); |
1608 |
+- |
1609 |
+- /* |
1610 |
+- * We need to ensure that no pages are being migrated while we destroy |
1611 |
+- * these workqueues, as migration can queue work on either of the |
1612 |
+- * workqueues. |
1613 |
+- */ |
1614 |
+- wait_event(pool->isolate_wait, !pool_isolated_are_drained(pool)); |
1615 |
+ |
1616 |
+ /* |
1617 |
+ * We need to destroy pool->compact_wq before pool->release_wq, |
1618 |
+@@ -1341,28 +1309,6 @@ static u64 z3fold_get_pool_size(struct z3fold_pool *pool) |
1619 |
+ return atomic64_read(&pool->pages_nr); |
1620 |
+ } |
1621 |
+ |
1622 |
+-/* |
1623 |
+- * z3fold_dec_isolated() expects to be called while pool->lock is held. |
1624 |
+- */ |
1625 |
+-static void z3fold_dec_isolated(struct z3fold_pool *pool) |
1626 |
+-{ |
1627 |
+- assert_spin_locked(&pool->lock); |
1628 |
+- VM_BUG_ON(pool->isolated <= 0); |
1629 |
+- pool->isolated--; |
1630 |
+- |
1631 |
+- /* |
1632 |
+- * If we have no more isolated pages, we have to see if |
1633 |
+- * z3fold_destroy_pool() is waiting for a signal. |
1634 |
+- */ |
1635 |
+- if (pool->isolated == 0 && waitqueue_active(&pool->isolate_wait)) |
1636 |
+- wake_up_all(&pool->isolate_wait); |
1637 |
+-} |
1638 |
+- |
1639 |
+-static void z3fold_inc_isolated(struct z3fold_pool *pool) |
1640 |
+-{ |
1641 |
+- pool->isolated++; |
1642 |
+-} |
1643 |
+- |
1644 |
+ static bool z3fold_page_isolate(struct page *page, isolate_mode_t mode) |
1645 |
+ { |
1646 |
+ struct z3fold_header *zhdr; |
1647 |
+@@ -1389,34 +1335,6 @@ static bool z3fold_page_isolate(struct page *page, isolate_mode_t mode) |
1648 |
+ spin_lock(&pool->lock); |
1649 |
+ if (!list_empty(&page->lru)) |
1650 |
+ list_del(&page->lru); |
1651 |
+- /* |
1652 |
+- * We need to check for destruction while holding pool->lock, as |
1653 |
+- * otherwise destruction could see 0 isolated pages, and |
1654 |
+- * proceed. |
1655 |
+- */ |
1656 |
+- if (unlikely(pool->destroying)) { |
1657 |
+- spin_unlock(&pool->lock); |
1658 |
+- /* |
1659 |
+- * If this page isn't stale, somebody else holds a |
1660 |
+- * reference to it. Let't drop our refcount so that they |
1661 |
+- * can call the release logic. |
1662 |
+- */ |
1663 |
+- if (unlikely(kref_put(&zhdr->refcount, |
1664 |
+- release_z3fold_page_locked))) { |
1665 |
+- /* |
1666 |
+- * If we get here we have kref problems, so we |
1667 |
+- * should freak out. |
1668 |
+- */ |
1669 |
+- WARN(1, "Z3fold is experiencing kref problems\n"); |
1670 |
+- z3fold_page_unlock(zhdr); |
1671 |
+- return false; |
1672 |
+- } |
1673 |
+- z3fold_page_unlock(zhdr); |
1674 |
+- return false; |
1675 |
+- } |
1676 |
+- |
1677 |
+- |
1678 |
+- z3fold_inc_isolated(pool); |
1679 |
+ spin_unlock(&pool->lock); |
1680 |
+ z3fold_page_unlock(zhdr); |
1681 |
+ return true; |
1682 |
+@@ -1485,10 +1403,6 @@ static int z3fold_page_migrate(struct address_space *mapping, struct page *newpa |
1683 |
+ |
1684 |
+ queue_work_on(new_zhdr->cpu, pool->compact_wq, &new_zhdr->work); |
1685 |
+ |
1686 |
+- spin_lock(&pool->lock); |
1687 |
+- z3fold_dec_isolated(pool); |
1688 |
+- spin_unlock(&pool->lock); |
1689 |
+- |
1690 |
+ page_mapcount_reset(page); |
1691 |
+ put_page(page); |
1692 |
+ return 0; |
1693 |
+@@ -1508,14 +1422,10 @@ static void z3fold_page_putback(struct page *page) |
1694 |
+ INIT_LIST_HEAD(&page->lru); |
1695 |
+ if (kref_put(&zhdr->refcount, release_z3fold_page_locked)) { |
1696 |
+ atomic64_dec(&pool->pages_nr); |
1697 |
+- spin_lock(&pool->lock); |
1698 |
+- z3fold_dec_isolated(pool); |
1699 |
+- spin_unlock(&pool->lock); |
1700 |
+ return; |
1701 |
+ } |
1702 |
+ spin_lock(&pool->lock); |
1703 |
+ list_add(&page->lru, &pool->lru); |
1704 |
+- z3fold_dec_isolated(pool); |
1705 |
+ spin_unlock(&pool->lock); |
1706 |
+ z3fold_page_unlock(zhdr); |
1707 |
+ } |
1708 |
+diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c |
1709 |
+index 17c50a98e7f7..9e4fcf406d9c 100644 |
1710 |
+--- a/net/bluetooth/hci_event.c |
1711 |
++++ b/net/bluetooth/hci_event.c |
1712 |
+@@ -5588,11 +5588,6 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, |
1713 |
+ return send_conn_param_neg_reply(hdev, handle, |
1714 |
+ HCI_ERROR_UNKNOWN_CONN_ID); |
1715 |
+ |
1716 |
+- if (min < hcon->le_conn_min_interval || |
1717 |
+- max > hcon->le_conn_max_interval) |
1718 |
+- return send_conn_param_neg_reply(hdev, handle, |
1719 |
+- HCI_ERROR_INVALID_LL_PARAMS); |
1720 |
+- |
1721 |
+ if (hci_check_conn_params(min, max, latency, timeout)) |
1722 |
+ return send_conn_param_neg_reply(hdev, handle, |
1723 |
+ HCI_ERROR_INVALID_LL_PARAMS); |
1724 |
+diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c |
1725 |
+index 32d2be9d6858..771e3e17bb6a 100644 |
1726 |
+--- a/net/bluetooth/l2cap_core.c |
1727 |
++++ b/net/bluetooth/l2cap_core.c |
1728 |
+@@ -5297,14 +5297,7 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, |
1729 |
+ |
1730 |
+ memset(&rsp, 0, sizeof(rsp)); |
1731 |
+ |
1732 |
+- if (min < hcon->le_conn_min_interval || |
1733 |
+- max > hcon->le_conn_max_interval) { |
1734 |
+- BT_DBG("requested connection interval exceeds current bounds."); |
1735 |
+- err = -EINVAL; |
1736 |
+- } else { |
1737 |
+- err = hci_check_conn_params(min, max, latency, to_multiplier); |
1738 |
+- } |
1739 |
+- |
1740 |
++ err = hci_check_conn_params(min, max, latency, to_multiplier); |
1741 |
+ if (err) |
1742 |
+ rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED); |
1743 |
+ else |
1744 |
+diff --git a/net/ipv4/raw_diag.c b/net/ipv4/raw_diag.c |
1745 |
+index 899e34ceb560..e35736b99300 100644 |
1746 |
+--- a/net/ipv4/raw_diag.c |
1747 |
++++ b/net/ipv4/raw_diag.c |
1748 |
+@@ -24,9 +24,6 @@ raw_get_hashinfo(const struct inet_diag_req_v2 *r) |
1749 |
+ return &raw_v6_hashinfo; |
1750 |
+ #endif |
1751 |
+ } else { |
1752 |
+- pr_warn_once("Unexpected inet family %d\n", |
1753 |
+- r->sdiag_family); |
1754 |
+- WARN_ON_ONCE(1); |
1755 |
+ return ERR_PTR(-EINVAL); |
1756 |
+ } |
1757 |
+ } |
1758 |
+diff --git a/net/netfilter/nft_socket.c b/net/netfilter/nft_socket.c |
1759 |
+index d7f3776dfd71..637ce3e8c575 100644 |
1760 |
+--- a/net/netfilter/nft_socket.c |
1761 |
++++ b/net/netfilter/nft_socket.c |
1762 |
+@@ -47,9 +47,6 @@ static void nft_socket_eval(const struct nft_expr *expr, |
1763 |
+ return; |
1764 |
+ } |
1765 |
+ |
1766 |
+- /* So that subsequent socket matching not to require other lookups. */ |
1767 |
+- skb->sk = sk; |
1768 |
+- |
1769 |
+ switch(priv->key) { |
1770 |
+ case NFT_SOCKET_TRANSPARENT: |
1771 |
+ nft_reg_store8(dest, inet_sk_transparent(sk)); |
1772 |
+@@ -66,6 +63,9 @@ static void nft_socket_eval(const struct nft_expr *expr, |
1773 |
+ WARN_ON(1); |
1774 |
+ regs->verdict.code = NFT_BREAK; |
1775 |
+ } |
1776 |
++ |
1777 |
++ if (sk != skb->sk) |
1778 |
++ sock_gen_put(sk); |
1779 |
+ } |
1780 |
+ |
1781 |
+ static const struct nla_policy nft_socket_policy[NFTA_SOCKET_MAX + 1] = { |
1782 |
+diff --git a/net/rds/bind.c b/net/rds/bind.c |
1783 |
+index 0f4398e7f2a7..93e336535d3b 100644 |
1784 |
+--- a/net/rds/bind.c |
1785 |
++++ b/net/rds/bind.c |
1786 |
+@@ -1,5 +1,5 @@ |
1787 |
+ /* |
1788 |
+- * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved. |
1789 |
++ * Copyright (c) 2006, 2019 Oracle and/or its affiliates. All rights reserved. |
1790 |
+ * |
1791 |
+ * This software is available to you under a choice of one of two |
1792 |
+ * licenses. You may choose to be licensed under the terms of the GNU |
1793 |
+@@ -239,34 +239,33 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
1794 |
+ goto out; |
1795 |
+ } |
1796 |
+ |
1797 |
+- sock_set_flag(sk, SOCK_RCU_FREE); |
1798 |
+- ret = rds_add_bound(rs, binding_addr, &port, scope_id); |
1799 |
+- if (ret) |
1800 |
+- goto out; |
1801 |
+- |
1802 |
+- if (rs->rs_transport) { /* previously bound */ |
1803 |
++ /* The transport can be set using SO_RDS_TRANSPORT option before the |
1804 |
++ * socket is bound. |
1805 |
++ */ |
1806 |
++ if (rs->rs_transport) { |
1807 |
+ trans = rs->rs_transport; |
1808 |
+- if (trans->laddr_check(sock_net(sock->sk), |
1809 |
++ if (!trans->laddr_check || |
1810 |
++ trans->laddr_check(sock_net(sock->sk), |
1811 |
+ binding_addr, scope_id) != 0) { |
1812 |
+ ret = -ENOPROTOOPT; |
1813 |
+- rds_remove_bound(rs); |
1814 |
+- } else { |
1815 |
+- ret = 0; |
1816 |
++ goto out; |
1817 |
+ } |
1818 |
+- goto out; |
1819 |
+- } |
1820 |
+- trans = rds_trans_get_preferred(sock_net(sock->sk), binding_addr, |
1821 |
+- scope_id); |
1822 |
+- if (!trans) { |
1823 |
+- ret = -EADDRNOTAVAIL; |
1824 |
+- rds_remove_bound(rs); |
1825 |
+- pr_info_ratelimited("RDS: %s could not find a transport for %pI6c, load rds_tcp or rds_rdma?\n", |
1826 |
+- __func__, binding_addr); |
1827 |
+- goto out; |
1828 |
++ } else { |
1829 |
++ trans = rds_trans_get_preferred(sock_net(sock->sk), |
1830 |
++ binding_addr, scope_id); |
1831 |
++ if (!trans) { |
1832 |
++ ret = -EADDRNOTAVAIL; |
1833 |
++ pr_info_ratelimited("RDS: %s could not find a transport for %pI6c, load rds_tcp or rds_rdma?\n", |
1834 |
++ __func__, binding_addr); |
1835 |
++ goto out; |
1836 |
++ } |
1837 |
++ rs->rs_transport = trans; |
1838 |
+ } |
1839 |
+ |
1840 |
+- rs->rs_transport = trans; |
1841 |
+- ret = 0; |
1842 |
++ sock_set_flag(sk, SOCK_RCU_FREE); |
1843 |
++ ret = rds_add_bound(rs, binding_addr, &port, scope_id); |
1844 |
++ if (ret) |
1845 |
++ rs->rs_transport = NULL; |
1846 |
+ |
1847 |
+ out: |
1848 |
+ release_sock(sk); |
1849 |
+diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c |
1850 |
+index 04faee7ccbce..1047825d9f48 100644 |
1851 |
+--- a/net/sched/sch_api.c |
1852 |
++++ b/net/sched/sch_api.c |
1853 |
+@@ -1920,6 +1920,8 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid, |
1854 |
+ cl = cops->find(q, portid); |
1855 |
+ if (!cl) |
1856 |
+ return; |
1857 |
++ if (!cops->tcf_block) |
1858 |
++ return; |
1859 |
+ block = cops->tcf_block(q, cl, NULL); |
1860 |
+ if (!block) |
1861 |
+ return; |
1862 |
+diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c |
1863 |
+index d5342687fdca..7c2fa80b20bd 100644 |
1864 |
+--- a/net/xfrm/xfrm_policy.c |
1865 |
++++ b/net/xfrm/xfrm_policy.c |
1866 |
+@@ -915,6 +915,7 @@ restart: |
1867 |
+ } else if (delta > 0) { |
1868 |
+ p = &parent->rb_right; |
1869 |
+ } else { |
1870 |
++ bool same_prefixlen = node->prefixlen == n->prefixlen; |
1871 |
+ struct xfrm_policy *tmp; |
1872 |
+ |
1873 |
+ hlist_for_each_entry(tmp, &n->hhead, bydst) { |
1874 |
+@@ -922,9 +923,11 @@ restart: |
1875 |
+ hlist_del_rcu(&tmp->bydst); |
1876 |
+ } |
1877 |
+ |
1878 |
++ node->prefixlen = prefixlen; |
1879 |
++ |
1880 |
+ xfrm_policy_inexact_list_reinsert(net, node, family); |
1881 |
+ |
1882 |
+- if (node->prefixlen == n->prefixlen) { |
1883 |
++ if (same_prefixlen) { |
1884 |
+ kfree_rcu(n, rcu); |
1885 |
+ return; |
1886 |
+ } |
1887 |
+@@ -932,7 +935,6 @@ restart: |
1888 |
+ rb_erase(*p, new); |
1889 |
+ kfree_rcu(n, rcu); |
1890 |
+ n = node; |
1891 |
+- n->prefixlen = prefixlen; |
1892 |
+ goto restart; |
1893 |
+ } |
1894 |
+ } |
1895 |
+diff --git a/sound/firewire/dice/dice-alesis.c b/sound/firewire/dice/dice-alesis.c |
1896 |
+index 218292bdace6..f5b325263b67 100644 |
1897 |
+--- a/sound/firewire/dice/dice-alesis.c |
1898 |
++++ b/sound/firewire/dice/dice-alesis.c |
1899 |
+@@ -15,7 +15,7 @@ alesis_io14_tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT] = { |
1900 |
+ |
1901 |
+ static const unsigned int |
1902 |
+ alesis_io26_tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT] = { |
1903 |
+- {10, 10, 8}, /* Tx0 = Analog + S/PDIF. */ |
1904 |
++ {10, 10, 4}, /* Tx0 = Analog + S/PDIF. */ |
1905 |
+ {16, 8, 0}, /* Tx1 = ADAT1 + ADAT2. */ |
1906 |
+ }; |
1907 |
+ |
1908 |
+diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c |
1909 |
+index 5732c31c4167..e7da1a59884a 100644 |
1910 |
+--- a/sound/pci/hda/hda_intel.c |
1911 |
++++ b/sound/pci/hda/hda_intel.c |
1912 |
+@@ -2514,8 +2514,7 @@ static const struct pci_device_id azx_ids[] = { |
1913 |
+ AZX_DCAPS_PM_RUNTIME }, |
1914 |
+ /* AMD Raven */ |
1915 |
+ { PCI_DEVICE(0x1022, 0x15e3), |
1916 |
+- .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB | |
1917 |
+- AZX_DCAPS_PM_RUNTIME }, |
1918 |
++ .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_AMD_SB }, |
1919 |
+ /* ATI HDMI */ |
1920 |
+ { PCI_DEVICE(0x1002, 0x0002), |
1921 |
+ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, |
1922 |
+diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c |
1923 |
+index e283966bdbb1..bc9dd8e6fd86 100644 |
1924 |
+--- a/sound/pci/hda/patch_analog.c |
1925 |
++++ b/sound/pci/hda/patch_analog.c |
1926 |
+@@ -357,6 +357,7 @@ static const struct hda_fixup ad1986a_fixups[] = { |
1927 |
+ |
1928 |
+ static const struct snd_pci_quirk ad1986a_fixup_tbl[] = { |
1929 |
+ SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_FIXUP_LAPTOP_IMIC), |
1930 |
++ SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9V", AD1986A_FIXUP_LAPTOP_IMIC), |
1931 |
+ SND_PCI_QUIRK(0x1043, 0x1443, "ASUS Z99He", AD1986A_FIXUP_EAPD), |
1932 |
+ SND_PCI_QUIRK(0x1043, 0x1447, "ASUS A8JN", AD1986A_FIXUP_EAPD), |
1933 |
+ SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8100, "ASUS P5", AD1986A_FIXUP_3STACK), |
1934 |
+diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c |
1935 |
+index 78858918cbc1..b6f7b13768a1 100644 |
1936 |
+--- a/sound/usb/quirks.c |
1937 |
++++ b/sound/usb/quirks.c |
1938 |
+@@ -1655,6 +1655,8 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, |
1939 |
+ case 0x152a: /* Thesycon devices */ |
1940 |
+ case 0x25ce: /* Mytek devices */ |
1941 |
+ case 0x2ab6: /* T+A devices */ |
1942 |
++ case 0x3842: /* EVGA */ |
1943 |
++ case 0xc502: /* HiBy devices */ |
1944 |
+ if (fp->dsd_raw) |
1945 |
+ return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
1946 |
+ break; |
1947 |
+diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile |
1948 |
+index 88158239622b..20f67fcf378d 100644 |
1949 |
+--- a/tools/objtool/Makefile |
1950 |
++++ b/tools/objtool/Makefile |
1951 |
+@@ -35,7 +35,7 @@ INCLUDES := -I$(srctree)/tools/include \ |
1952 |
+ -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ |
1953 |
+ -I$(srctree)/tools/objtool/arch/$(ARCH)/include |
1954 |
+ WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed |
1955 |
+-CFLAGS += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS) |
1956 |
++CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS) |
1957 |
+ LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS) |
1958 |
+ |
1959 |
+ # Allow old libelf to be used: |
1960 |
+diff --git a/tools/testing/selftests/net/xfrm_policy.sh b/tools/testing/selftests/net/xfrm_policy.sh |
1961 |
+index 5445943bf07f..7a1bf94c5bd3 100755 |
1962 |
+--- a/tools/testing/selftests/net/xfrm_policy.sh |
1963 |
++++ b/tools/testing/selftests/net/xfrm_policy.sh |
1964 |
+@@ -106,6 +106,13 @@ do_overlap() |
1965 |
+ # |
1966 |
+ # 10.0.0.0/24 and 10.0.1.0/24 nodes have been merged as 10.0.0.0/23. |
1967 |
+ ip -net $ns xfrm policy add src 10.1.0.0/24 dst 10.0.0.0/23 dir fwd priority 200 action block |
1968 |
++ |
1969 |
++ # similar to above: add policies (with partially random address), with shrinking prefixes. |
1970 |
++ for p in 29 28 27;do |
1971 |
++ for k in $(seq 1 32); do |
1972 |
++ ip -net $ns xfrm policy add src 10.253.1.$((RANDOM%255))/$p dst 10.254.1.$((RANDOM%255))/$p dir fwd priority $((200+k)) action block 2>/dev/null |
1973 |
++ done |
1974 |
++ done |
1975 |
+ } |
1976 |
+ |
1977 |
+ do_esp_policy_get_check() { |