Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.10 commit in: /
Date: Tue, 23 Feb 2021 15:16:31
Message-Id: 1614093374.a05ac93762062b3cb2a076e452987e997fd4962b.alicef@gentoo
1 commit: a05ac93762062b3cb2a076e452987e997fd4962b
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 15:16:06 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 15:16:14 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=a05ac937
7
8 Linux patch 5.10.18
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 0000_README | 4 +
13 1017_linux-5.10.18.patch | 1145 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1149 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index a45f62f..ae786d2 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -111,6 +111,10 @@ Patch: 1016_linux-5.10.17.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.10.17
23
24 +Patch: 1017_linux-5.10.18.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.10.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.10.18.patch b/1017_linux-5.10.18.patch
33 new file mode 100644
34 index 0000000..7c61ec0
35 --- /dev/null
36 +++ b/1017_linux-5.10.18.patch
37 @@ -0,0 +1,1145 @@
38 +diff --git a/Makefile b/Makefile
39 +index b740f9c933cb7..822a8e10d4325 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 10
46 +-SUBLEVEL = 17
47 ++SUBLEVEL = 18
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +diff --git a/arch/arm/xen/p2m.c b/arch/arm/xen/p2m.c
52 +index e52950a43f2ed..fd6e3aafe2724 100644
53 +--- a/arch/arm/xen/p2m.c
54 ++++ b/arch/arm/xen/p2m.c
55 +@@ -95,8 +95,10 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
56 + for (i = 0; i < count; i++) {
57 + if (map_ops[i].status)
58 + continue;
59 +- set_phys_to_machine(map_ops[i].host_addr >> XEN_PAGE_SHIFT,
60 +- map_ops[i].dev_bus_addr >> XEN_PAGE_SHIFT);
61 ++ if (unlikely(!set_phys_to_machine(map_ops[i].host_addr >> XEN_PAGE_SHIFT,
62 ++ map_ops[i].dev_bus_addr >> XEN_PAGE_SHIFT))) {
63 ++ return -ENOMEM;
64 ++ }
65 + }
66 +
67 + return 0;
68 +diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
69 +index be4151f42611f..d71942a3c65af 100644
70 +--- a/arch/x86/xen/p2m.c
71 ++++ b/arch/x86/xen/p2m.c
72 +@@ -712,7 +712,8 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
73 + unsigned long mfn, pfn;
74 +
75 + /* Do not add to override if the map failed. */
76 +- if (map_ops[i].status)
77 ++ if (map_ops[i].status != GNTST_okay ||
78 ++ (kmap_ops && kmap_ops[i].status != GNTST_okay))
79 + continue;
80 +
81 + if (map_ops[i].flags & GNTMAP_contains_pte) {
82 +@@ -750,17 +751,15 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
83 + unsigned long mfn = __pfn_to_mfn(page_to_pfn(pages[i]));
84 + unsigned long pfn = page_to_pfn(pages[i]);
85 +
86 +- if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) {
87 ++ if (mfn != INVALID_P2M_ENTRY && (mfn & FOREIGN_FRAME_BIT))
88 ++ set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
89 ++ else
90 + ret = -EINVAL;
91 +- goto out;
92 +- }
93 +-
94 +- set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
95 + }
96 + if (kunmap_ops)
97 + ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
98 +- kunmap_ops, count);
99 +-out:
100 ++ kunmap_ops, count) ?: ret;
101 ++
102 + return ret;
103 + }
104 + EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping);
105 +diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
106 +index 9ebf53903d7bf..da16121140cab 100644
107 +--- a/drivers/block/xen-blkback/blkback.c
108 ++++ b/drivers/block/xen-blkback/blkback.c
109 +@@ -794,8 +794,13 @@ again:
110 + pages[i]->persistent_gnt = persistent_gnt;
111 + } else {
112 + if (gnttab_page_cache_get(&ring->free_pages,
113 +- &pages[i]->page))
114 +- goto out_of_memory;
115 ++ &pages[i]->page)) {
116 ++ gnttab_page_cache_put(&ring->free_pages,
117 ++ pages_to_gnt,
118 ++ segs_to_map);
119 ++ ret = -ENOMEM;
120 ++ goto out;
121 ++ }
122 + addr = vaddr(pages[i]->page);
123 + pages_to_gnt[segs_to_map] = pages[i]->page;
124 + pages[i]->persistent_gnt = NULL;
125 +@@ -811,10 +816,8 @@ again:
126 + break;
127 + }
128 +
129 +- if (segs_to_map) {
130 ++ if (segs_to_map)
131 + ret = gnttab_map_refs(map, NULL, pages_to_gnt, segs_to_map);
132 +- BUG_ON(ret);
133 +- }
134 +
135 + /*
136 + * Now swizzle the MFN in our domain with the MFN from the other domain
137 +@@ -830,7 +833,7 @@ again:
138 + gnttab_page_cache_put(&ring->free_pages,
139 + &pages[seg_idx]->page, 1);
140 + pages[seg_idx]->handle = BLKBACK_INVALID_HANDLE;
141 +- ret |= 1;
142 ++ ret |= !ret;
143 + goto next;
144 + }
145 + pages[seg_idx]->handle = map[new_map_idx].handle;
146 +@@ -882,17 +885,18 @@ next:
147 + }
148 + segs_to_map = 0;
149 + last_map = map_until;
150 +- if (map_until != num)
151 ++ if (!ret && map_until != num)
152 + goto again;
153 +
154 +- return ret;
155 +-
156 +-out_of_memory:
157 +- pr_alert("%s: out of memory\n", __func__);
158 +- gnttab_page_cache_put(&ring->free_pages, pages_to_gnt, segs_to_map);
159 +- for (i = last_map; i < num; i++)
160 ++out:
161 ++ for (i = last_map; i < num; i++) {
162 ++ /* Don't zap current batch's valid persistent grants. */
163 ++ if(i >= last_map + segs_to_map)
164 ++ pages[i]->persistent_gnt = NULL;
165 + pages[i]->handle = BLKBACK_INVALID_HANDLE;
166 +- return -ENOMEM;
167 ++ }
168 ++
169 ++ return ret;
170 + }
171 +
172 + static int xen_blkbk_map_seg(struct pending_req *pending_req)
173 +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
174 +index 80468745d5c5e..9f958699141e2 100644
175 +--- a/drivers/bluetooth/btusb.c
176 ++++ b/drivers/bluetooth/btusb.c
177 +@@ -480,7 +480,6 @@ static const struct dmi_system_id btusb_needs_reset_resume_table[] = {
178 + #define BTUSB_HW_RESET_ACTIVE 12
179 + #define BTUSB_TX_WAIT_VND_EVT 13
180 + #define BTUSB_WAKEUP_DISABLE 14
181 +-#define BTUSB_USE_ALT1_FOR_WBS 15
182 +
183 + struct btusb_data {
184 + struct hci_dev *hdev;
185 +@@ -1710,15 +1709,12 @@ static void btusb_work(struct work_struct *work)
186 + new_alts = data->sco_num;
187 + }
188 + } else if (data->air_mode == HCI_NOTIFY_ENABLE_SCO_TRANSP) {
189 +- /* Check if Alt 6 is supported for Transparent audio */
190 +- if (btusb_find_altsetting(data, 6)) {
191 +- data->usb_alt6_packet_flow = true;
192 +- new_alts = 6;
193 +- } else if (test_bit(BTUSB_USE_ALT1_FOR_WBS, &data->flags)) {
194 +- new_alts = 1;
195 +- } else {
196 +- bt_dev_err(hdev, "Device does not support ALT setting 6");
197 +- }
198 ++ /* Bluetooth USB spec recommends alt 6 (63 bytes), but
199 ++ * many adapters do not support it. Alt 1 appears to
200 ++ * work for all adapters that do not have alt 6, and
201 ++ * which work with WBS at all.
202 ++ */
203 ++ new_alts = btusb_find_altsetting(data, 6) ? 6 : 1;
204 + }
205 +
206 + if (btusb_switch_alt_setting(hdev, new_alts) < 0)
207 +@@ -4149,10 +4145,6 @@ static int btusb_probe(struct usb_interface *intf,
208 + * (DEVICE_REMOTE_WAKEUP)
209 + */
210 + set_bit(BTUSB_WAKEUP_DISABLE, &data->flags);
211 +- if (btusb_find_altsetting(data, 1))
212 +- set_bit(BTUSB_USE_ALT1_FOR_WBS, &data->flags);
213 +- else
214 +- bt_dev_err(hdev, "Device does not support ALT setting 1");
215 + }
216 +
217 + if (!reset)
218 +diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
219 +index 436e17f1d0e53..bd478947b93a5 100644
220 +--- a/drivers/infiniband/ulp/isert/ib_isert.c
221 ++++ b/drivers/infiniband/ulp/isert/ib_isert.c
222 +@@ -28,6 +28,18 @@ static int isert_debug_level;
223 + module_param_named(debug_level, isert_debug_level, int, 0644);
224 + MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0 (default:0)");
225 +
226 ++static int isert_sg_tablesize_set(const char *val,
227 ++ const struct kernel_param *kp);
228 ++static const struct kernel_param_ops sg_tablesize_ops = {
229 ++ .set = isert_sg_tablesize_set,
230 ++ .get = param_get_int,
231 ++};
232 ++
233 ++static int isert_sg_tablesize = ISCSI_ISER_DEF_SG_TABLESIZE;
234 ++module_param_cb(sg_tablesize, &sg_tablesize_ops, &isert_sg_tablesize, 0644);
235 ++MODULE_PARM_DESC(sg_tablesize,
236 ++ "Number of gather/scatter entries in a single scsi command, should >= 128 (default: 256, max: 4096)");
237 ++
238 + static DEFINE_MUTEX(device_list_mutex);
239 + static LIST_HEAD(device_list);
240 + static struct workqueue_struct *isert_comp_wq;
241 +@@ -47,6 +59,19 @@ static void isert_send_done(struct ib_cq *cq, struct ib_wc *wc);
242 + static void isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc);
243 + static void isert_login_send_done(struct ib_cq *cq, struct ib_wc *wc);
244 +
245 ++static int isert_sg_tablesize_set(const char *val, const struct kernel_param *kp)
246 ++{
247 ++ int n = 0, ret;
248 ++
249 ++ ret = kstrtoint(val, 10, &n);
250 ++ if (ret != 0 || n < ISCSI_ISER_MIN_SG_TABLESIZE ||
251 ++ n > ISCSI_ISER_MAX_SG_TABLESIZE)
252 ++ return -EINVAL;
253 ++
254 ++ return param_set_int(val, kp);
255 ++}
256 ++
257 ++
258 + static inline bool
259 + isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd)
260 + {
261 +@@ -101,7 +126,7 @@ isert_create_qp(struct isert_conn *isert_conn,
262 + attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1;
263 + attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1;
264 + factor = rdma_rw_mr_factor(device->ib_device, cma_id->port_num,
265 +- ISCSI_ISER_MAX_SG_TABLESIZE);
266 ++ isert_sg_tablesize);
267 + attr.cap.max_rdma_ctxs = ISCSI_DEF_XMIT_CMDS_MAX * factor;
268 + attr.cap.max_send_sge = device->ib_device->attrs.max_send_sge;
269 + attr.cap.max_recv_sge = 1;
270 +diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
271 +index 7fee4a65e181a..6c5af13db4e0d 100644
272 +--- a/drivers/infiniband/ulp/isert/ib_isert.h
273 ++++ b/drivers/infiniband/ulp/isert/ib_isert.h
274 +@@ -65,6 +65,12 @@
275 + */
276 + #define ISER_RX_SIZE (ISCSI_DEF_MAX_RECV_SEG_LEN + 1024)
277 +
278 ++/* Default I/O size is 1MB */
279 ++#define ISCSI_ISER_DEF_SG_TABLESIZE 256
280 ++
281 ++/* Minimum I/O size is 512KB */
282 ++#define ISCSI_ISER_MIN_SG_TABLESIZE 128
283 ++
284 + /* Maximum support is 16MB I/O size */
285 + #define ISCSI_ISER_MAX_SG_TABLESIZE 4096
286 +
287 +diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
288 +index 61869636ec613..5e3339cc31c07 100644
289 +--- a/drivers/media/usb/pwc/pwc-if.c
290 ++++ b/drivers/media/usb/pwc/pwc-if.c
291 +@@ -155,16 +155,17 @@ static const struct video_device pwc_template = {
292 + /***************************************************************************/
293 + /* Private functions */
294 +
295 +-static void *pwc_alloc_urb_buffer(struct device *dev,
296 ++static void *pwc_alloc_urb_buffer(struct usb_device *dev,
297 + size_t size, dma_addr_t *dma_handle)
298 + {
299 ++ struct device *dmadev = dev->bus->sysdev;
300 + void *buffer = kmalloc(size, GFP_KERNEL);
301 +
302 + if (!buffer)
303 + return NULL;
304 +
305 +- *dma_handle = dma_map_single(dev, buffer, size, DMA_FROM_DEVICE);
306 +- if (dma_mapping_error(dev, *dma_handle)) {
307 ++ *dma_handle = dma_map_single(dmadev, buffer, size, DMA_FROM_DEVICE);
308 ++ if (dma_mapping_error(dmadev, *dma_handle)) {
309 + kfree(buffer);
310 + return NULL;
311 + }
312 +@@ -172,12 +173,14 @@ static void *pwc_alloc_urb_buffer(struct device *dev,
313 + return buffer;
314 + }
315 +
316 +-static void pwc_free_urb_buffer(struct device *dev,
317 ++static void pwc_free_urb_buffer(struct usb_device *dev,
318 + size_t size,
319 + void *buffer,
320 + dma_addr_t dma_handle)
321 + {
322 +- dma_unmap_single(dev, dma_handle, size, DMA_FROM_DEVICE);
323 ++ struct device *dmadev = dev->bus->sysdev;
324 ++
325 ++ dma_unmap_single(dmadev, dma_handle, size, DMA_FROM_DEVICE);
326 + kfree(buffer);
327 + }
328 +
329 +@@ -282,6 +285,7 @@ static void pwc_frame_complete(struct pwc_device *pdev)
330 + static void pwc_isoc_handler(struct urb *urb)
331 + {
332 + struct pwc_device *pdev = (struct pwc_device *)urb->context;
333 ++ struct device *dmadev = urb->dev->bus->sysdev;
334 + int i, fst, flen;
335 + unsigned char *iso_buf = NULL;
336 +
337 +@@ -328,7 +332,7 @@ static void pwc_isoc_handler(struct urb *urb)
338 + /* Reset ISOC error counter. We did get here, after all. */
339 + pdev->visoc_errors = 0;
340 +
341 +- dma_sync_single_for_cpu(&urb->dev->dev,
342 ++ dma_sync_single_for_cpu(dmadev,
343 + urb->transfer_dma,
344 + urb->transfer_buffer_length,
345 + DMA_FROM_DEVICE);
346 +@@ -379,7 +383,7 @@ static void pwc_isoc_handler(struct urb *urb)
347 + pdev->vlast_packet_size = flen;
348 + }
349 +
350 +- dma_sync_single_for_device(&urb->dev->dev,
351 ++ dma_sync_single_for_device(dmadev,
352 + urb->transfer_dma,
353 + urb->transfer_buffer_length,
354 + DMA_FROM_DEVICE);
355 +@@ -461,7 +465,7 @@ retry:
356 + urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint);
357 + urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
358 + urb->transfer_buffer_length = ISO_BUFFER_SIZE;
359 +- urb->transfer_buffer = pwc_alloc_urb_buffer(&udev->dev,
360 ++ urb->transfer_buffer = pwc_alloc_urb_buffer(udev,
361 + urb->transfer_buffer_length,
362 + &urb->transfer_dma);
363 + if (urb->transfer_buffer == NULL) {
364 +@@ -524,7 +528,7 @@ static void pwc_iso_free(struct pwc_device *pdev)
365 + if (urb) {
366 + PWC_DEBUG_MEMORY("Freeing URB\n");
367 + if (urb->transfer_buffer)
368 +- pwc_free_urb_buffer(&urb->dev->dev,
369 ++ pwc_free_urb_buffer(urb->dev,
370 + urb->transfer_buffer_length,
371 + urb->transfer_buffer,
372 + urb->transfer_dma);
373 +diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
374 +index 31b40fb83f6c1..c31036f57aef8 100644
375 +--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
376 ++++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
377 +@@ -2718,11 +2718,11 @@ int mt7615_mcu_rdd_cmd(struct mt7615_dev *dev,
378 + int mt7615_mcu_set_fcc5_lpn(struct mt7615_dev *dev, int val)
379 + {
380 + struct {
381 +- u16 tag;
382 +- u16 min_lpn;
383 ++ __le16 tag;
384 ++ __le16 min_lpn;
385 + } req = {
386 +- .tag = 0x1,
387 +- .min_lpn = val,
388 ++ .tag = cpu_to_le16(0x1),
389 ++ .min_lpn = cpu_to_le16(val),
390 + };
391 +
392 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
393 +@@ -2733,14 +2733,27 @@ int mt7615_mcu_set_pulse_th(struct mt7615_dev *dev,
394 + const struct mt7615_dfs_pulse *pulse)
395 + {
396 + struct {
397 +- u16 tag;
398 +- struct mt7615_dfs_pulse pulse;
399 ++ __le16 tag;
400 ++ __le32 max_width; /* us */
401 ++ __le32 max_pwr; /* dbm */
402 ++ __le32 min_pwr; /* dbm */
403 ++ __le32 min_stgr_pri; /* us */
404 ++ __le32 max_stgr_pri; /* us */
405 ++ __le32 min_cr_pri; /* us */
406 ++ __le32 max_cr_pri; /* us */
407 + } req = {
408 +- .tag = 0x3,
409 ++ .tag = cpu_to_le16(0x3),
410 ++#define __req_field(field) .field = cpu_to_le32(pulse->field)
411 ++ __req_field(max_width),
412 ++ __req_field(max_pwr),
413 ++ __req_field(min_pwr),
414 ++ __req_field(min_stgr_pri),
415 ++ __req_field(max_stgr_pri),
416 ++ __req_field(min_cr_pri),
417 ++ __req_field(max_cr_pri),
418 ++#undef __req_field
419 + };
420 +
421 +- memcpy(&req.pulse, pulse, sizeof(*pulse));
422 +-
423 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
424 + &req, sizeof(req), true);
425 + }
426 +@@ -2749,16 +2762,45 @@ int mt7615_mcu_set_radar_th(struct mt7615_dev *dev, int index,
427 + const struct mt7615_dfs_pattern *pattern)
428 + {
429 + struct {
430 +- u16 tag;
431 +- u16 radar_type;
432 +- struct mt7615_dfs_pattern pattern;
433 ++ __le16 tag;
434 ++ __le16 radar_type;
435 ++ u8 enb;
436 ++ u8 stgr;
437 ++ u8 min_crpn;
438 ++ u8 max_crpn;
439 ++ u8 min_crpr;
440 ++ u8 min_pw;
441 ++ u8 max_pw;
442 ++ __le32 min_pri;
443 ++ __le32 max_pri;
444 ++ u8 min_crbn;
445 ++ u8 max_crbn;
446 ++ u8 min_stgpn;
447 ++ u8 max_stgpn;
448 ++ u8 min_stgpr;
449 + } req = {
450 +- .tag = 0x2,
451 +- .radar_type = index,
452 ++ .tag = cpu_to_le16(0x2),
453 ++ .radar_type = cpu_to_le16(index),
454 ++#define __req_field_u8(field) .field = pattern->field
455 ++#define __req_field_u32(field) .field = cpu_to_le32(pattern->field)
456 ++ __req_field_u8(enb),
457 ++ __req_field_u8(stgr),
458 ++ __req_field_u8(min_crpn),
459 ++ __req_field_u8(max_crpn),
460 ++ __req_field_u8(min_crpr),
461 ++ __req_field_u8(min_pw),
462 ++ __req_field_u8(max_pw),
463 ++ __req_field_u32(min_pri),
464 ++ __req_field_u32(max_pri),
465 ++ __req_field_u8(min_crbn),
466 ++ __req_field_u8(max_crbn),
467 ++ __req_field_u8(min_stgpn),
468 ++ __req_field_u8(max_stgpn),
469 ++ __req_field_u8(min_stgpr),
470 ++#undef __req_field_u8
471 ++#undef __req_field_u32
472 + };
473 +
474 +- memcpy(&req.pattern, pattern, sizeof(*pattern));
475 +-
476 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
477 + &req, sizeof(req), true);
478 + }
479 +@@ -2769,9 +2811,9 @@ int mt7615_mcu_rdd_send_pattern(struct mt7615_dev *dev)
480 + u8 pulse_num;
481 + u8 rsv[3];
482 + struct {
483 +- u32 start_time;
484 +- u16 width;
485 +- s16 power;
486 ++ __le32 start_time;
487 ++ __le16 width;
488 ++ __le16 power;
489 + } pattern[32];
490 + } req = {
491 + .pulse_num = dev->radar_pattern.n_pulses,
492 +@@ -2784,10 +2826,11 @@ int mt7615_mcu_rdd_send_pattern(struct mt7615_dev *dev)
493 +
494 + /* TODO: add some noise here */
495 + for (i = 0; i < dev->radar_pattern.n_pulses; i++) {
496 +- req.pattern[i].width = dev->radar_pattern.width;
497 +- req.pattern[i].power = dev->radar_pattern.power;
498 +- req.pattern[i].start_time = start_time +
499 +- i * dev->radar_pattern.period;
500 ++ u32 ts = start_time + i * dev->radar_pattern.period;
501 ++
502 ++ req.pattern[i].width = cpu_to_le16(dev->radar_pattern.width);
503 ++ req.pattern[i].power = cpu_to_le16(dev->radar_pattern.power);
504 ++ req.pattern[i].start_time = cpu_to_le32(ts);
505 + }
506 +
507 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_PATTERN,
508 +diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
509 +index a3ccc17856615..ea71409751519 100644
510 +--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
511 ++++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
512 +@@ -2835,7 +2835,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level)
513 + struct {
514 + u8 ver;
515 + u8 pad;
516 +- u16 len;
517 ++ __le16 len;
518 + u8 level;
519 + u8 rsv[3];
520 + __le32 module_idx;
521 +@@ -3070,12 +3070,12 @@ int mt7915_mcu_rdd_cmd(struct mt7915_dev *dev,
522 + int mt7915_mcu_set_fcc5_lpn(struct mt7915_dev *dev, int val)
523 + {
524 + struct {
525 +- u32 tag;
526 +- u16 min_lpn;
527 ++ __le32 tag;
528 ++ __le16 min_lpn;
529 + u8 rsv[2];
530 + } __packed req = {
531 +- .tag = 0x1,
532 +- .min_lpn = val,
533 ++ .tag = cpu_to_le32(0x1),
534 ++ .min_lpn = cpu_to_le16(val),
535 + };
536 +
537 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
538 +@@ -3086,14 +3086,29 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev,
539 + const struct mt7915_dfs_pulse *pulse)
540 + {
541 + struct {
542 +- u32 tag;
543 +- struct mt7915_dfs_pulse pulse;
544 ++ __le32 tag;
545 ++
546 ++ __le32 max_width; /* us */
547 ++ __le32 max_pwr; /* dbm */
548 ++ __le32 min_pwr; /* dbm */
549 ++ __le32 min_stgr_pri; /* us */
550 ++ __le32 max_stgr_pri; /* us */
551 ++ __le32 min_cr_pri; /* us */
552 ++ __le32 max_cr_pri; /* us */
553 + } __packed req = {
554 +- .tag = 0x3,
555 ++ .tag = cpu_to_le32(0x3),
556 ++
557 ++#define __req_field(field) .field = cpu_to_le32(pulse->field)
558 ++ __req_field(max_width),
559 ++ __req_field(max_pwr),
560 ++ __req_field(min_pwr),
561 ++ __req_field(min_stgr_pri),
562 ++ __req_field(max_stgr_pri),
563 ++ __req_field(min_cr_pri),
564 ++ __req_field(max_cr_pri),
565 ++#undef __req_field
566 + };
567 +
568 +- memcpy(&req.pulse, pulse, sizeof(*pulse));
569 +-
570 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
571 + &req, sizeof(req), true);
572 + }
573 +@@ -3102,16 +3117,50 @@ int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index,
574 + const struct mt7915_dfs_pattern *pattern)
575 + {
576 + struct {
577 +- u32 tag;
578 +- u16 radar_type;
579 +- struct mt7915_dfs_pattern pattern;
580 ++ __le32 tag;
581 ++ __le16 radar_type;
582 ++
583 ++ u8 enb;
584 ++ u8 stgr;
585 ++ u8 min_crpn;
586 ++ u8 max_crpn;
587 ++ u8 min_crpr;
588 ++ u8 min_pw;
589 ++ u32 min_pri;
590 ++ u32 max_pri;
591 ++ u8 max_pw;
592 ++ u8 min_crbn;
593 ++ u8 max_crbn;
594 ++ u8 min_stgpn;
595 ++ u8 max_stgpn;
596 ++ u8 min_stgpr;
597 ++ u8 rsv[2];
598 ++ u32 min_stgpr_diff;
599 + } __packed req = {
600 +- .tag = 0x2,
601 +- .radar_type = index,
602 ++ .tag = cpu_to_le32(0x2),
603 ++ .radar_type = cpu_to_le16(index),
604 ++
605 ++#define __req_field_u8(field) .field = pattern->field
606 ++#define __req_field_u32(field) .field = cpu_to_le32(pattern->field)
607 ++ __req_field_u8(enb),
608 ++ __req_field_u8(stgr),
609 ++ __req_field_u8(min_crpn),
610 ++ __req_field_u8(max_crpn),
611 ++ __req_field_u8(min_crpr),
612 ++ __req_field_u8(min_pw),
613 ++ __req_field_u32(min_pri),
614 ++ __req_field_u32(max_pri),
615 ++ __req_field_u8(max_pw),
616 ++ __req_field_u8(min_crbn),
617 ++ __req_field_u8(max_crbn),
618 ++ __req_field_u8(min_stgpn),
619 ++ __req_field_u8(max_stgpn),
620 ++ __req_field_u8(min_stgpr),
621 ++ __req_field_u32(min_stgpr_diff),
622 ++#undef __req_field_u8
623 ++#undef __req_field_u32
624 + };
625 +
626 +- memcpy(&req.pattern, pattern, sizeof(*pattern));
627 +-
628 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
629 + &req, sizeof(req), true);
630 + }
631 +@@ -3342,12 +3391,12 @@ int mt7915_mcu_add_obss_spr(struct mt7915_dev *dev, struct ieee80211_vif *vif,
632 + u8 drop_tx_idx;
633 + u8 sta_idx; /* 256 sta */
634 + u8 rsv[2];
635 +- u32 val;
636 ++ __le32 val;
637 + } __packed req = {
638 + .action = MT_SPR_ENABLE,
639 + .arg_num = 1,
640 + .band_idx = mvif->band_idx,
641 +- .val = enable,
642 ++ .val = cpu_to_le32(enable),
643 + };
644 +
645 + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_SPR,
646 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
647 +index bc3421d145768..423667b837510 100644
648 +--- a/drivers/net/xen-netback/netback.c
649 ++++ b/drivers/net/xen-netback/netback.c
650 +@@ -1342,13 +1342,11 @@ int xenvif_tx_action(struct xenvif_queue *queue, int budget)
651 + return 0;
652 +
653 + gnttab_batch_copy(queue->tx_copy_ops, nr_cops);
654 +- if (nr_mops != 0) {
655 ++ if (nr_mops != 0)
656 + ret = gnttab_map_refs(queue->tx_map_ops,
657 + NULL,
658 + queue->pages_to_map,
659 + nr_mops);
660 +- BUG_ON(ret);
661 +- }
662 +
663 + work_done = xenvif_tx_submit(queue);
664 +
665 +diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
666 +index ff87cb51747d8..21cd5ac6ca8b5 100644
667 +--- a/drivers/tty/tty_io.c
668 ++++ b/drivers/tty/tty_io.c
669 +@@ -963,11 +963,14 @@ static inline ssize_t do_tty_write(
670 + if (ret <= 0)
671 + break;
672 +
673 ++ written += ret;
674 ++ if (ret > size)
675 ++ break;
676 ++
677 + /* FIXME! Have Al check this! */
678 + if (ret != size)
679 + iov_iter_revert(from, size-ret);
680 +
681 +- written += ret;
682 + count -= ret;
683 + if (!count)
684 + break;
685 +diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
686 +index 6a90fdb9cbfc6..f2ad450db5478 100644
687 +--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
688 ++++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
689 +@@ -42,6 +42,8 @@ static char *macaddr;
690 + module_param(macaddr, charp, 0);
691 + MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
692 +
693 ++u8 macaddr_buf[ETH_ALEN];
694 ++
695 + struct vdpasim_virtqueue {
696 + struct vringh vring;
697 + struct vringh_kiov iov;
698 +@@ -67,14 +69,24 @@ static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) |
699 + (1ULL << VIRTIO_F_ACCESS_PLATFORM) |
700 + (1ULL << VIRTIO_NET_F_MAC);
701 +
702 ++struct vdpasim;
703 ++
704 ++struct vdpasim_dev_attr {
705 ++ size_t config_size;
706 ++ int nvqs;
707 ++ void (*get_config)(struct vdpasim *vdpasim, void *config);
708 ++};
709 ++
710 + /* State of each vdpasim device */
711 + struct vdpasim {
712 + struct vdpa_device vdpa;
713 +- struct vdpasim_virtqueue vqs[VDPASIM_VQ_NUM];
714 ++ struct vdpasim_virtqueue *vqs;
715 + struct work_struct work;
716 ++ struct vdpasim_dev_attr dev_attr;
717 + /* spinlock to synchronize virtqueue state */
718 + spinlock_t lock;
719 +- struct virtio_net_config config;
720 ++ /* virtio config according to device type */
721 ++ void *config;
722 + struct vhost_iotlb *iommu;
723 + void *buffer;
724 + u32 status;
725 +@@ -144,7 +156,7 @@ static void vdpasim_reset(struct vdpasim *vdpasim)
726 + {
727 + int i;
728 +
729 +- for (i = 0; i < VDPASIM_VQ_NUM; i++)
730 ++ for (i = 0; i < vdpasim->dev_attr.nvqs; i++)
731 + vdpasim_vq_reset(&vdpasim->vqs[i]);
732 +
733 + spin_lock(&vdpasim->iommu_lock);
734 +@@ -345,22 +357,24 @@ static const struct dma_map_ops vdpasim_dma_ops = {
735 + static const struct vdpa_config_ops vdpasim_net_config_ops;
736 + static const struct vdpa_config_ops vdpasim_net_batch_config_ops;
737 +
738 +-static struct vdpasim *vdpasim_create(void)
739 ++static struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr)
740 + {
741 + const struct vdpa_config_ops *ops;
742 + struct vdpasim *vdpasim;
743 + struct device *dev;
744 +- int ret = -ENOMEM;
745 ++ int i, ret = -ENOMEM;
746 +
747 + if (batch_mapping)
748 + ops = &vdpasim_net_batch_config_ops;
749 + else
750 + ops = &vdpasim_net_config_ops;
751 +
752 +- vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops, VDPASIM_VQ_NUM);
753 ++ vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops,
754 ++ dev_attr->nvqs);
755 + if (!vdpasim)
756 + goto err_alloc;
757 +
758 ++ vdpasim->dev_attr = *dev_attr;
759 + INIT_WORK(&vdpasim->work, vdpasim_work);
760 + spin_lock_init(&vdpasim->lock);
761 + spin_lock_init(&vdpasim->iommu_lock);
762 +@@ -371,6 +385,15 @@ static struct vdpasim *vdpasim_create(void)
763 + goto err_iommu;
764 + set_dma_ops(dev, &vdpasim_dma_ops);
765 +
766 ++ vdpasim->config = kzalloc(dev_attr->config_size, GFP_KERNEL);
767 ++ if (!vdpasim->config)
768 ++ goto err_iommu;
769 ++
770 ++ vdpasim->vqs = kcalloc(dev_attr->nvqs, sizeof(struct vdpasim_virtqueue),
771 ++ GFP_KERNEL);
772 ++ if (!vdpasim->vqs)
773 ++ goto err_iommu;
774 ++
775 + vdpasim->iommu = vhost_iotlb_alloc(2048, 0);
776 + if (!vdpasim->iommu)
777 + goto err_iommu;
778 +@@ -380,17 +403,17 @@ static struct vdpasim *vdpasim_create(void)
779 + goto err_iommu;
780 +
781 + if (macaddr) {
782 +- mac_pton(macaddr, vdpasim->config.mac);
783 +- if (!is_valid_ether_addr(vdpasim->config.mac)) {
784 ++ mac_pton(macaddr, macaddr_buf);
785 ++ if (!is_valid_ether_addr(macaddr_buf)) {
786 + ret = -EADDRNOTAVAIL;
787 + goto err_iommu;
788 + }
789 + } else {
790 +- eth_random_addr(vdpasim->config.mac);
791 ++ eth_random_addr(macaddr_buf);
792 + }
793 +
794 +- vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu);
795 +- vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu);
796 ++ for (i = 0; i < dev_attr->nvqs; i++)
797 ++ vringh_set_iotlb(&vdpasim->vqs[i].vring, vdpasim->iommu);
798 +
799 + vdpasim->vdpa.dma_dev = dev;
800 + ret = vdpa_register_device(&vdpasim->vdpa);
801 +@@ -504,7 +527,6 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa)
802 + static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features)
803 + {
804 + struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
805 +- struct virtio_net_config *config = &vdpasim->config;
806 +
807 + /* DMA mapping must be done by driver */
808 + if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM)))
809 +@@ -512,14 +534,6 @@ static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features)
810 +
811 + vdpasim->features = features & vdpasim_features;
812 +
813 +- /* We generally only know whether guest is using the legacy interface
814 +- * here, so generally that's the earliest we can set config fields.
815 +- * Note: We actually require VIRTIO_F_ACCESS_PLATFORM above which
816 +- * implies VIRTIO_F_VERSION_1, but let's not try to be clever here.
817 +- */
818 +-
819 +- config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
820 +- config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
821 + return 0;
822 + }
823 +
824 +@@ -572,8 +586,13 @@ static void vdpasim_get_config(struct vdpa_device *vdpa, unsigned int offset,
825 + {
826 + struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
827 +
828 +- if (offset + len < sizeof(struct virtio_net_config))
829 +- memcpy(buf, (u8 *)&vdpasim->config + offset, len);
830 ++ if (offset + len > vdpasim->dev_attr.config_size)
831 ++ return;
832 ++
833 ++ if (vdpasim->dev_attr.get_config)
834 ++ vdpasim->dev_attr.get_config(vdpasim, vdpasim->config);
835 ++
836 ++ memcpy(buf, vdpasim->config + offset, len);
837 + }
838 +
839 + static void vdpasim_set_config(struct vdpa_device *vdpa, unsigned int offset,
840 +@@ -659,6 +678,8 @@ static void vdpasim_free(struct vdpa_device *vdpa)
841 + kfree(vdpasim->buffer);
842 + if (vdpasim->iommu)
843 + vhost_iotlb_free(vdpasim->iommu);
844 ++ kfree(vdpasim->vqs);
845 ++ kfree(vdpasim->config);
846 + }
847 +
848 + static const struct vdpa_config_ops vdpasim_net_config_ops = {
849 +@@ -714,9 +735,25 @@ static const struct vdpa_config_ops vdpasim_net_batch_config_ops = {
850 + .free = vdpasim_free,
851 + };
852 +
853 ++static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config)
854 ++{
855 ++ struct virtio_net_config *net_config =
856 ++ (struct virtio_net_config *)config;
857 ++
858 ++ net_config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
859 ++ net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
860 ++ memcpy(net_config->mac, macaddr_buf, ETH_ALEN);
861 ++}
862 ++
863 + static int __init vdpasim_dev_init(void)
864 + {
865 +- vdpasim_dev = vdpasim_create();
866 ++ struct vdpasim_dev_attr dev_attr = {};
867 ++
868 ++ dev_attr.nvqs = VDPASIM_VQ_NUM;
869 ++ dev_attr.config_size = sizeof(struct virtio_net_config);
870 ++ dev_attr.get_config = vdpasim_net_get_config;
871 ++
872 ++ vdpasim_dev = vdpasim_create(&dev_attr);
873 +
874 + if (!IS_ERR(vdpasim_dev))
875 + return 0;
876 +diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
877 +index a36b71286bcf8..5447c5156b2e6 100644
878 +--- a/drivers/xen/gntdev.c
879 ++++ b/drivers/xen/gntdev.c
880 +@@ -309,44 +309,47 @@ int gntdev_map_grant_pages(struct gntdev_grant_map *map)
881 + * to the kernel linear addresses of the struct pages.
882 + * These ptes are completely different from the user ptes dealt
883 + * with find_grant_ptes.
884 ++ * Note that GNTMAP_device_map isn't needed here: The
885 ++ * dev_bus_addr output field gets consumed only from ->map_ops,
886 ++ * and by not requesting it when mapping we also avoid needing
887 ++ * to mirror dev_bus_addr into ->unmap_ops (and holding an extra
888 ++ * reference to the page in the hypervisor).
889 + */
890 ++ unsigned int flags = (map->flags & ~GNTMAP_device_map) |
891 ++ GNTMAP_host_map;
892 ++
893 + for (i = 0; i < map->count; i++) {
894 + unsigned long address = (unsigned long)
895 + pfn_to_kaddr(page_to_pfn(map->pages[i]));
896 + BUG_ON(PageHighMem(map->pages[i]));
897 +
898 +- gnttab_set_map_op(&map->kmap_ops[i], address,
899 +- map->flags | GNTMAP_host_map,
900 ++ gnttab_set_map_op(&map->kmap_ops[i], address, flags,
901 + map->grants[i].ref,
902 + map->grants[i].domid);
903 + gnttab_set_unmap_op(&map->kunmap_ops[i], address,
904 +- map->flags | GNTMAP_host_map, -1);
905 ++ flags, -1);
906 + }
907 + }
908 +
909 + pr_debug("map %d+%d\n", map->index, map->count);
910 + err = gnttab_map_refs(map->map_ops, use_ptemod ? map->kmap_ops : NULL,
911 + map->pages, map->count);
912 +- if (err)
913 +- return err;
914 +
915 + for (i = 0; i < map->count; i++) {
916 +- if (map->map_ops[i].status) {
917 ++ if (map->map_ops[i].status == GNTST_okay)
918 ++ map->unmap_ops[i].handle = map->map_ops[i].handle;
919 ++ else if (!err)
920 + err = -EINVAL;
921 +- continue;
922 +- }
923 +
924 +- map->unmap_ops[i].handle = map->map_ops[i].handle;
925 +- if (use_ptemod)
926 +- map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
927 +-#ifdef CONFIG_XEN_GRANT_DMA_ALLOC
928 +- else if (map->dma_vaddr) {
929 +- unsigned long bfn;
930 ++ if (map->flags & GNTMAP_device_map)
931 ++ map->unmap_ops[i].dev_bus_addr = map->map_ops[i].dev_bus_addr;
932 +
933 +- bfn = pfn_to_bfn(page_to_pfn(map->pages[i]));
934 +- map->unmap_ops[i].dev_bus_addr = __pfn_to_phys(bfn);
935 ++ if (use_ptemod) {
936 ++ if (map->kmap_ops[i].status == GNTST_okay)
937 ++ map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
938 ++ else if (!err)
939 ++ err = -EINVAL;
940 + }
941 +-#endif
942 + }
943 + return err;
944 + }
945 +diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
946 +index 862162dca33cf..9cd4fe8ce6803 100644
947 +--- a/drivers/xen/xen-scsiback.c
948 ++++ b/drivers/xen/xen-scsiback.c
949 +@@ -386,12 +386,12 @@ static int scsiback_gnttab_data_map_batch(struct gnttab_map_grant_ref *map,
950 + return 0;
951 +
952 + err = gnttab_map_refs(map, NULL, pg, cnt);
953 +- BUG_ON(err);
954 + for (i = 0; i < cnt; i++) {
955 + if (unlikely(map[i].status != GNTST_okay)) {
956 + pr_err("invalid buffer -- could not remap it\n");
957 + map[i].handle = SCSIBACK_INVALID_HANDLE;
958 +- err = -ENOMEM;
959 ++ if (!err)
960 ++ err = -ENOMEM;
961 + } else {
962 + get_page(pg[i]);
963 + }
964 +diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
965 +index 30ea9780725ff..b6884eda9ff67 100644
966 +--- a/fs/btrfs/ctree.h
967 ++++ b/fs/btrfs/ctree.h
968 +@@ -146,9 +146,6 @@ enum {
969 + BTRFS_FS_STATE_DEV_REPLACING,
970 + /* The btrfs_fs_info created for self-tests */
971 + BTRFS_FS_STATE_DUMMY_FS_INFO,
972 +-
973 +- /* Indicate that we can't trust the free space tree for caching yet */
974 +- BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
975 + };
976 +
977 + #define BTRFS_BACKREF_REV_MAX 256
978 +@@ -562,6 +559,9 @@ enum {
979 +
980 + /* Indicate that the discard workqueue can service discards. */
981 + BTRFS_FS_DISCARD_RUNNING,
982 ++
983 ++ /* Indicate that we can't trust the free space tree for caching yet */
984 ++ BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
985 + };
986 +
987 + /*
988 +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
989 +index acc47e2ffb46b..b536d21541a9f 100644
990 +--- a/fs/btrfs/inode.c
991 ++++ b/fs/btrfs/inode.c
992 +@@ -8026,8 +8026,12 @@ ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
993 + bool relock = false;
994 + ssize_t ret;
995 +
996 +- if (check_direct_IO(fs_info, iter, offset))
997 ++ if (check_direct_IO(fs_info, iter, offset)) {
998 ++ ASSERT(current->journal_info == NULL ||
999 ++ current->journal_info == BTRFS_DIO_SYNC_STUB);
1000 ++ current->journal_info = NULL;
1001 + return 0;
1002 ++ }
1003 +
1004 + count = iov_iter_count(iter);
1005 + if (iov_iter_rw(iter) == WRITE) {
1006 +diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
1007 +index b9c937b3a1499..0b1182a3cf412 100644
1008 +--- a/include/xen/grant_table.h
1009 ++++ b/include/xen/grant_table.h
1010 +@@ -157,6 +157,7 @@ gnttab_set_map_op(struct gnttab_map_grant_ref *map, phys_addr_t addr,
1011 + map->flags = flags;
1012 + map->ref = ref;
1013 + map->dom = domid;
1014 ++ map->status = 1; /* arbitrary positive value */
1015 + }
1016 +
1017 + static inline void
1018 +diff --git a/net/bridge/br.c b/net/bridge/br.c
1019 +index 401eeb9142eb6..1b169f8e74919 100644
1020 +--- a/net/bridge/br.c
1021 ++++ b/net/bridge/br.c
1022 +@@ -43,7 +43,10 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
1023 +
1024 + if (event == NETDEV_REGISTER) {
1025 + /* register of bridge completed, add sysfs entries */
1026 +- br_sysfs_addbr(dev);
1027 ++ err = br_sysfs_addbr(dev);
1028 ++ if (err)
1029 ++ return notifier_from_errno(err);
1030 ++
1031 + return NOTIFY_DONE;
1032 + }
1033 + }
1034 +diff --git a/net/core/dev.c b/net/core/dev.c
1035 +index da85cb9398693..210d0fce58e17 100644
1036 +--- a/net/core/dev.c
1037 ++++ b/net/core/dev.c
1038 +@@ -3867,6 +3867,7 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev)
1039 + return skb;
1040 +
1041 + /* qdisc_skb_cb(skb)->pkt_len was already set by the caller. */
1042 ++ qdisc_skb_cb(skb)->mru = 0;
1043 + mini_qdisc_bstats_cpu_update(miniq, skb);
1044 +
1045 + switch (tcf_classify(skb, miniq->filter_list, &cl_res, false)) {
1046 +@@ -4950,6 +4951,7 @@ sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret,
1047 + }
1048 +
1049 + qdisc_skb_cb(skb)->pkt_len = skb->len;
1050 ++ qdisc_skb_cb(skb)->mru = 0;
1051 + skb->tc_at_ingress = 1;
1052 + mini_qdisc_bstats_cpu_update(miniq, skb);
1053 +
1054 +diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
1055 +index 967ce9ccfc0da..f56b2e331bb6b 100644
1056 +--- a/net/mptcp/protocol.c
1057 ++++ b/net/mptcp/protocol.c
1058 +@@ -1648,8 +1648,11 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk)
1059 + continue;
1060 +
1061 + /* still data outstanding at TCP level? Don't retransmit. */
1062 +- if (!tcp_write_queue_empty(ssk))
1063 ++ if (!tcp_write_queue_empty(ssk)) {
1064 ++ if (inet_csk(ssk)->icsk_ca_state >= TCP_CA_Loss)
1065 ++ continue;
1066 + return NULL;
1067 ++ }
1068 +
1069 + if (subflow->backup) {
1070 + if (!backup)
1071 +diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
1072 +index c3a664871cb5a..e8902a7e60f24 100644
1073 +--- a/net/openvswitch/actions.c
1074 ++++ b/net/openvswitch/actions.c
1075 +@@ -959,16 +959,13 @@ static int dec_ttl_exception_handler(struct datapath *dp, struct sk_buff *skb,
1076 + struct sw_flow_key *key,
1077 + const struct nlattr *attr, bool last)
1078 + {
1079 +- /* The first action is always 'OVS_DEC_TTL_ATTR_ARG'. */
1080 +- struct nlattr *dec_ttl_arg = nla_data(attr);
1081 ++ /* The first attribute is always 'OVS_DEC_TTL_ATTR_ACTION'. */
1082 ++ struct nlattr *actions = nla_data(attr);
1083 +
1084 +- if (nla_len(dec_ttl_arg)) {
1085 +- struct nlattr *actions = nla_data(dec_ttl_arg);
1086 ++ if (nla_len(actions))
1087 ++ return clone_execute(dp, skb, key, 0, nla_data(actions),
1088 ++ nla_len(actions), last, false);
1089 +
1090 +- if (actions)
1091 +- return clone_execute(dp, skb, key, 0, nla_data(actions),
1092 +- nla_len(actions), last, false);
1093 +- }
1094 + consume_skb(skb);
1095 + return 0;
1096 + }
1097 +@@ -1212,7 +1209,7 @@ static int execute_dec_ttl(struct sk_buff *skb, struct sw_flow_key *key)
1098 + return -EHOSTUNREACH;
1099 +
1100 + key->ip.ttl = --nh->hop_limit;
1101 +- } else {
1102 ++ } else if (skb->protocol == htons(ETH_P_IP)) {
1103 + struct iphdr *nh;
1104 + u8 old_ttl;
1105 +
1106 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
1107 +index 7a18ffff85514..a0121e7c98b14 100644
1108 +--- a/net/packet/af_packet.c
1109 ++++ b/net/packet/af_packet.c
1110 +@@ -4615,9 +4615,11 @@ static int __net_init packet_net_init(struct net *net)
1111 + mutex_init(&net->packet.sklist_lock);
1112 + INIT_HLIST_HEAD(&net->packet.sklist);
1113 +
1114 ++#ifdef CONFIG_PROC_FS
1115 + if (!proc_create_net("packet", 0, net->proc_net, &packet_seq_ops,
1116 + sizeof(struct seq_net_private)))
1117 + return -ENOMEM;
1118 ++#endif /* CONFIG_PROC_FS */
1119 +
1120 + return 0;
1121 + }
1122 +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
1123 +index 957aa9263ba4c..d7134c558993c 100644
1124 +--- a/net/qrtr/qrtr.c
1125 ++++ b/net/qrtr/qrtr.c
1126 +@@ -347,7 +347,7 @@ static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb,
1127 + hdr->src_port_id = cpu_to_le32(from->sq_port);
1128 + if (to->sq_port == QRTR_PORT_CTRL) {
1129 + hdr->dst_node_id = cpu_to_le32(node->nid);
1130 +- hdr->dst_port_id = cpu_to_le32(QRTR_NODE_BCAST);
1131 ++ hdr->dst_port_id = cpu_to_le32(QRTR_PORT_CTRL);
1132 + } else {
1133 + hdr->dst_node_id = cpu_to_le32(to->sq_node);
1134 + hdr->dst_port_id = cpu_to_le32(to->sq_port);
1135 +diff --git a/net/sched/Kconfig b/net/sched/Kconfig
1136 +index a3b37d88800eb..d762e89ab74f7 100644
1137 +--- a/net/sched/Kconfig
1138 ++++ b/net/sched/Kconfig
1139 +@@ -813,7 +813,7 @@ config NET_ACT_SAMPLE
1140 +
1141 + config NET_ACT_IPT
1142 + tristate "IPtables targets"
1143 +- depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
1144 ++ depends on NET_CLS_ACT && NETFILTER && NETFILTER_XTABLES
1145 + help
1146 + Say Y here to be able to invoke iptables targets after successful
1147 + classification.
1148 +@@ -912,7 +912,7 @@ config NET_ACT_BPF
1149 +
1150 + config NET_ACT_CONNMARK
1151 + tristate "Netfilter Connection Mark Retriever"
1152 +- depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
1153 ++ depends on NET_CLS_ACT && NETFILTER
1154 + depends on NF_CONNTRACK && NF_CONNTRACK_MARK
1155 + help
1156 + Say Y here to allow retrieving of conn mark
1157 +@@ -924,7 +924,7 @@ config NET_ACT_CONNMARK
1158 +
1159 + config NET_ACT_CTINFO
1160 + tristate "Netfilter Connection Mark Actions"
1161 +- depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
1162 ++ depends on NET_CLS_ACT && NETFILTER
1163 + depends on NF_CONNTRACK && NF_CONNTRACK_MARK
1164 + help
1165 + Say Y here to allow transfer of a connmark stored information.
1166 +diff --git a/net/tls/tls_proc.c b/net/tls/tls_proc.c
1167 +index 3a5dd1e072332..feeceb0e4cb48 100644
1168 +--- a/net/tls/tls_proc.c
1169 ++++ b/net/tls/tls_proc.c
1170 +@@ -37,9 +37,12 @@ static int tls_statistics_seq_show(struct seq_file *seq, void *v)
1171 +
1172 + int __net_init tls_proc_init(struct net *net)
1173 + {
1174 ++#ifdef CONFIG_PROC_FS
1175 + if (!proc_create_net_single("tls_stat", 0444, net->proc_net,
1176 + tls_statistics_seq_show, NULL))
1177 + return -ENOMEM;
1178 ++#endif /* CONFIG_PROC_FS */
1179 ++
1180 + return 0;
1181 + }
1182 +