1 |
commit: b03e33b81b2c328a49247c23313adcfd8a756c11 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 10 19:38:02 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 10 19:38:02 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b03e33b8 |
7 |
|
8 |
Linux patch 4.9.175 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1174_linux-4.9.175.patch | 728 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 732 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 15510bc..37d36ef 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -739,6 +739,10 @@ Patch: 1173_linux-4.9.174.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.174 |
23 |
|
24 |
+Patch: 1174_linux-4.9.175.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.175 |
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/1174_linux-4.9.175.patch b/1174_linux-4.9.175.patch |
33 |
new file mode 100644 |
34 |
index 0000000..826f7b0 |
35 |
--- /dev/null |
36 |
+++ b/1174_linux-4.9.175.patch |
37 |
@@ -0,0 +1,728 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index f5836837df15..e52b0579e176 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 9 |
45 |
+-SUBLEVEL = 174 |
46 |
++SUBLEVEL = 175 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Roaring Lionus |
49 |
+ |
50 |
+diff --git a/arch/arm/boot/compressed/efi-header.S b/arch/arm/boot/compressed/efi-header.S |
51 |
+index 3f7d1b74c5e0..a17ca8d78656 100644 |
52 |
+--- a/arch/arm/boot/compressed/efi-header.S |
53 |
++++ b/arch/arm/boot/compressed/efi-header.S |
54 |
+@@ -17,7 +17,8 @@ |
55 |
+ @ there. |
56 |
+ .inst 'M' | ('Z' << 8) | (0x1310 << 16) @ tstne r0, #0x4d000 |
57 |
+ #else |
58 |
+- W(mov) r0, r0 |
59 |
++ AR_CLASS( mov r0, r0 ) |
60 |
++ M_CLASS( nop.w ) |
61 |
+ #endif |
62 |
+ .endm |
63 |
+ |
64 |
+diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c |
65 |
+index 098ab775135f..a30829052a00 100644 |
66 |
+--- a/arch/x86/events/intel/core.c |
67 |
++++ b/arch/x86/events/intel/core.c |
68 |
+@@ -2867,7 +2867,7 @@ static int intel_pmu_hw_config(struct perf_event *event) |
69 |
+ return ret; |
70 |
+ |
71 |
+ if (event->attr.precise_ip) { |
72 |
+- if (!event->attr.freq) { |
73 |
++ if (!(event->attr.freq || event->attr.wakeup_events)) { |
74 |
+ event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; |
75 |
+ if (!(event->attr.sample_type & |
76 |
+ ~intel_pmu_free_running_flags(event))) |
77 |
+diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c |
78 |
+index 10332c24f961..44ef1d66caa6 100644 |
79 |
+--- a/drivers/block/virtio_blk.c |
80 |
++++ b/drivers/block/virtio_blk.c |
81 |
+@@ -392,6 +392,8 @@ static int init_vq(struct virtio_blk *vblk) |
82 |
+ if (err) |
83 |
+ num_vqs = 1; |
84 |
+ |
85 |
++ num_vqs = min_t(unsigned int, nr_cpu_ids, num_vqs); |
86 |
++ |
87 |
+ vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL); |
88 |
+ if (!vblk->vqs) |
89 |
+ return -ENOMEM; |
90 |
+diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c |
91 |
+index 863d030786e5..e7a6651ceeab 100644 |
92 |
+--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c |
93 |
++++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c |
94 |
+@@ -1473,7 +1473,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, |
95 |
+ if (IS_ERR(regmap)) |
96 |
+ ret = PTR_ERR(regmap); |
97 |
+ if (ret) { |
98 |
+- ret = PTR_ERR(regmap); |
99 |
+ dev_err(dev, |
100 |
+ "Failed to get system configuration registers: %d\n", |
101 |
+ ret); |
102 |
+@@ -1529,6 +1528,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, |
103 |
+ of_node_put(remote); |
104 |
+ |
105 |
+ hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np); |
106 |
++ of_node_put(i2c_np); |
107 |
+ if (!hdmi->ddc_adpt) { |
108 |
+ dev_err(dev, "Failed to get ddc i2c adapter by node\n"); |
109 |
+ return -EINVAL; |
110 |
+diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c |
111 |
+index e8e0fa58cb71..b08786614c1b 100644 |
112 |
+--- a/drivers/infiniband/hw/hfi1/rc.c |
113 |
++++ b/drivers/infiniband/hw/hfi1/rc.c |
114 |
+@@ -2394,7 +2394,7 @@ send_last: |
115 |
+ update_ack_queue(qp, next); |
116 |
+ } |
117 |
+ e = &qp->s_ack_queue[qp->r_head_ack_queue]; |
118 |
+- if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { |
119 |
++ if (e->rdma_sge.mr) { |
120 |
+ rvt_put_mr(e->rdma_sge.mr); |
121 |
+ e->rdma_sge.mr = NULL; |
122 |
+ } |
123 |
+@@ -2469,7 +2469,7 @@ send_last: |
124 |
+ update_ack_queue(qp, next); |
125 |
+ } |
126 |
+ e = &qp->s_ack_queue[qp->r_head_ack_queue]; |
127 |
+- if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { |
128 |
++ if (e->rdma_sge.mr) { |
129 |
+ rvt_put_mr(e->rdma_sge.mr); |
130 |
+ e->rdma_sge.mr = NULL; |
131 |
+ } |
132 |
+diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c |
133 |
+index 157e93421fb8..13bbe5795e4e 100644 |
134 |
+--- a/drivers/iommu/amd_iommu_init.c |
135 |
++++ b/drivers/iommu/amd_iommu_init.c |
136 |
+@@ -318,7 +318,7 @@ static void iommu_write_l2(struct amd_iommu *iommu, u8 address, u32 val) |
137 |
+ static void iommu_set_exclusion_range(struct amd_iommu *iommu) |
138 |
+ { |
139 |
+ u64 start = iommu->exclusion_start & PAGE_MASK; |
140 |
+- u64 limit = (start + iommu->exclusion_length) & PAGE_MASK; |
141 |
++ u64 limit = (start + iommu->exclusion_length - 1) & PAGE_MASK; |
142 |
+ u64 entry; |
143 |
+ |
144 |
+ if (!iommu->exclusion_start) |
145 |
+diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c |
146 |
+index 89a52b941ea8..894d97e4ace5 100644 |
147 |
+--- a/drivers/scsi/csiostor/csio_scsi.c |
148 |
++++ b/drivers/scsi/csiostor/csio_scsi.c |
149 |
+@@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req) |
150 |
+ } |
151 |
+ |
152 |
+ out: |
153 |
+- if (req->nsge > 0) |
154 |
++ if (req->nsge > 0) { |
155 |
+ scsi_dma_unmap(cmnd); |
156 |
++ if (req->dcopy && (host_status == DID_OK)) |
157 |
++ host_status = csio_scsi_copy_to_sgl(hw, req); |
158 |
++ } |
159 |
+ |
160 |
+ cmnd->result = (((host_status) << 16) | scsi_status); |
161 |
+ cmnd->scsi_done(cmnd); |
162 |
+diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c |
163 |
+index 7be581f7c35d..1a6f65db615e 100644 |
164 |
+--- a/drivers/scsi/libsas/sas_expander.c |
165 |
++++ b/drivers/scsi/libsas/sas_expander.c |
166 |
+@@ -47,17 +47,16 @@ static void smp_task_timedout(unsigned long _task) |
167 |
+ unsigned long flags; |
168 |
+ |
169 |
+ spin_lock_irqsave(&task->task_state_lock, flags); |
170 |
+- if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) |
171 |
++ if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) { |
172 |
+ task->task_state_flags |= SAS_TASK_STATE_ABORTED; |
173 |
++ complete(&task->slow_task->completion); |
174 |
++ } |
175 |
+ spin_unlock_irqrestore(&task->task_state_lock, flags); |
176 |
+- |
177 |
+- complete(&task->slow_task->completion); |
178 |
+ } |
179 |
+ |
180 |
+ static void smp_task_done(struct sas_task *task) |
181 |
+ { |
182 |
+- if (!del_timer(&task->slow_task->timer)) |
183 |
+- return; |
184 |
++ del_timer(&task->slow_task->timer); |
185 |
+ complete(&task->slow_task->completion); |
186 |
+ } |
187 |
+ |
188 |
+diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c |
189 |
+index 9a34afcb1c4c..5c3dfd92ea02 100644 |
190 |
+--- a/drivers/scsi/qla2xxx/qla_attr.c |
191 |
++++ b/drivers/scsi/qla2xxx/qla_attr.c |
192 |
+@@ -345,7 +345,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, |
193 |
+ } |
194 |
+ |
195 |
+ ha->optrom_region_start = start; |
196 |
+- ha->optrom_region_size = start + size; |
197 |
++ ha->optrom_region_size = size; |
198 |
+ |
199 |
+ ha->optrom_state = QLA_SREADING; |
200 |
+ ha->optrom_buffer = vmalloc(ha->optrom_region_size); |
201 |
+@@ -418,7 +418,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, |
202 |
+ } |
203 |
+ |
204 |
+ ha->optrom_region_start = start; |
205 |
+- ha->optrom_region_size = start + size; |
206 |
++ ha->optrom_region_size = size; |
207 |
+ |
208 |
+ ha->optrom_state = QLA_SWRITING; |
209 |
+ ha->optrom_buffer = vmalloc(ha->optrom_region_size); |
210 |
+diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c |
211 |
+index e85c988b7034..adea629b8065 100644 |
212 |
+--- a/drivers/staging/greybus/power_supply.c |
213 |
++++ b/drivers/staging/greybus/power_supply.c |
214 |
+@@ -521,7 +521,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy) |
215 |
+ |
216 |
+ op = gb_operation_create(connection, |
217 |
+ GB_POWER_SUPPLY_TYPE_GET_PROP_DESCRIPTORS, |
218 |
+- sizeof(req), sizeof(*resp) + props_count * |
219 |
++ sizeof(*req), sizeof(*resp) + props_count * |
220 |
+ sizeof(struct gb_power_supply_props_desc), |
221 |
+ GFP_KERNEL); |
222 |
+ if (!op) |
223 |
+diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c |
224 |
+index 1e91b803ee4e..73dc5a6c6108 100644 |
225 |
+--- a/drivers/usb/dwc3/core.c |
226 |
++++ b/drivers/usb/dwc3/core.c |
227 |
+@@ -991,7 +991,7 @@ static int dwc3_probe(struct platform_device *pdev) |
228 |
+ dwc->regs_size = resource_size(res); |
229 |
+ |
230 |
+ /* default to highest possible threshold */ |
231 |
+- lpm_nyet_threshold = 0xff; |
232 |
++ lpm_nyet_threshold = 0xf; |
233 |
+ |
234 |
+ /* default to -3.5dB de-emphasis */ |
235 |
+ tx_de_emphasis = 1; |
236 |
+diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c |
237 |
+index 972f5a5fe577..1f20fa0a67c0 100644 |
238 |
+--- a/drivers/usb/serial/f81232.c |
239 |
++++ b/drivers/usb/serial/f81232.c |
240 |
+@@ -560,9 +560,12 @@ static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port) |
241 |
+ |
242 |
+ static void f81232_close(struct usb_serial_port *port) |
243 |
+ { |
244 |
++ struct f81232_private *port_priv = usb_get_serial_port_data(port); |
245 |
++ |
246 |
+ f81232_port_disable(port); |
247 |
+ usb_serial_generic_close(port); |
248 |
+ usb_kill_urb(port->interrupt_in_urb); |
249 |
++ flush_work(&port_priv->interrupt_work); |
250 |
+ } |
251 |
+ |
252 |
+ static void f81232_dtr_rts(struct usb_serial_port *port, int on) |
253 |
+@@ -656,6 +659,40 @@ static int f81232_port_remove(struct usb_serial_port *port) |
254 |
+ return 0; |
255 |
+ } |
256 |
+ |
257 |
++static int f81232_suspend(struct usb_serial *serial, pm_message_t message) |
258 |
++{ |
259 |
++ struct usb_serial_port *port = serial->port[0]; |
260 |
++ struct f81232_private *port_priv = usb_get_serial_port_data(port); |
261 |
++ int i; |
262 |
++ |
263 |
++ for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) |
264 |
++ usb_kill_urb(port->read_urbs[i]); |
265 |
++ |
266 |
++ usb_kill_urb(port->interrupt_in_urb); |
267 |
++ |
268 |
++ if (port_priv) |
269 |
++ flush_work(&port_priv->interrupt_work); |
270 |
++ |
271 |
++ return 0; |
272 |
++} |
273 |
++ |
274 |
++static int f81232_resume(struct usb_serial *serial) |
275 |
++{ |
276 |
++ struct usb_serial_port *port = serial->port[0]; |
277 |
++ int result; |
278 |
++ |
279 |
++ if (tty_port_initialized(&port->port)) { |
280 |
++ result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); |
281 |
++ if (result) { |
282 |
++ dev_err(&port->dev, "submit interrupt urb failed: %d\n", |
283 |
++ result); |
284 |
++ return result; |
285 |
++ } |
286 |
++ } |
287 |
++ |
288 |
++ return usb_serial_generic_resume(serial); |
289 |
++} |
290 |
++ |
291 |
+ static struct usb_serial_driver f81232_device = { |
292 |
+ .driver = { |
293 |
+ .owner = THIS_MODULE, |
294 |
+@@ -679,6 +716,8 @@ static struct usb_serial_driver f81232_device = { |
295 |
+ .read_int_callback = f81232_read_int_callback, |
296 |
+ .port_probe = f81232_port_probe, |
297 |
+ .port_remove = f81232_port_remove, |
298 |
++ .suspend = f81232_suspend, |
299 |
++ .resume = f81232_resume, |
300 |
+ }; |
301 |
+ |
302 |
+ static struct usb_serial_driver * const serial_drivers[] = { |
303 |
+diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c |
304 |
+index 13f2c051dbf2..afb4b0bf47b3 100644 |
305 |
+--- a/drivers/usb/storage/scsiglue.c |
306 |
++++ b/drivers/usb/storage/scsiglue.c |
307 |
+@@ -81,6 +81,7 @@ static const char* host_info(struct Scsi_Host *host) |
308 |
+ static int slave_alloc (struct scsi_device *sdev) |
309 |
+ { |
310 |
+ struct us_data *us = host_to_us(sdev->host); |
311 |
++ int maxp; |
312 |
+ |
313 |
+ /* |
314 |
+ * Set the INQUIRY transfer length to 36. We don't use any of |
315 |
+@@ -90,20 +91,17 @@ static int slave_alloc (struct scsi_device *sdev) |
316 |
+ sdev->inquiry_len = 36; |
317 |
+ |
318 |
+ /* |
319 |
+- * USB has unusual DMA-alignment requirements: Although the |
320 |
+- * starting address of each scatter-gather element doesn't matter, |
321 |
+- * the length of each element except the last must be divisible |
322 |
+- * by the Bulk maxpacket value. There's currently no way to |
323 |
+- * express this by block-layer constraints, so we'll cop out |
324 |
+- * and simply require addresses to be aligned at 512-byte |
325 |
+- * boundaries. This is okay since most block I/O involves |
326 |
+- * hardware sectors that are multiples of 512 bytes in length, |
327 |
+- * and since host controllers up through USB 2.0 have maxpacket |
328 |
+- * values no larger than 512. |
329 |
+- * |
330 |
+- * But it doesn't suffice for Wireless USB, where Bulk maxpacket |
331 |
+- * values can be as large as 2048. To make that work properly |
332 |
+- * will require changes to the block layer. |
333 |
++ * USB has unusual scatter-gather requirements: the length of each |
334 |
++ * scatterlist element except the last must be divisible by the |
335 |
++ * Bulk maxpacket value. Fortunately this value is always a |
336 |
++ * power of 2. Inform the block layer about this requirement. |
337 |
++ */ |
338 |
++ maxp = usb_maxpacket(us->pusb_dev, us->recv_bulk_pipe, 0); |
339 |
++ blk_queue_virt_boundary(sdev->request_queue, maxp - 1); |
340 |
++ |
341 |
++ /* |
342 |
++ * Some host controllers may have alignment requirements. |
343 |
++ * We'll play it safe by requiring 512-byte alignment always. |
344 |
+ */ |
345 |
+ blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); |
346 |
+ |
347 |
+diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c |
348 |
+index 64af88977b03..97621e5bdad7 100644 |
349 |
+--- a/drivers/usb/storage/uas.c |
350 |
++++ b/drivers/usb/storage/uas.c |
351 |
+@@ -796,24 +796,33 @@ static int uas_slave_alloc(struct scsi_device *sdev) |
352 |
+ { |
353 |
+ struct uas_dev_info *devinfo = |
354 |
+ (struct uas_dev_info *)sdev->host->hostdata; |
355 |
++ int maxp; |
356 |
+ |
357 |
+ sdev->hostdata = devinfo; |
358 |
+ |
359 |
+ /* |
360 |
+- * USB has unusual DMA-alignment requirements: Although the |
361 |
+- * starting address of each scatter-gather element doesn't matter, |
362 |
+- * the length of each element except the last must be divisible |
363 |
+- * by the Bulk maxpacket value. There's currently no way to |
364 |
+- * express this by block-layer constraints, so we'll cop out |
365 |
+- * and simply require addresses to be aligned at 512-byte |
366 |
+- * boundaries. This is okay since most block I/O involves |
367 |
+- * hardware sectors that are multiples of 512 bytes in length, |
368 |
+- * and since host controllers up through USB 2.0 have maxpacket |
369 |
+- * values no larger than 512. |
370 |
++ * We have two requirements here. We must satisfy the requirements |
371 |
++ * of the physical HC and the demands of the protocol, as we |
372 |
++ * definitely want no additional memory allocation in this path |
373 |
++ * ruling out using bounce buffers. |
374 |
+ * |
375 |
+- * But it doesn't suffice for Wireless USB, where Bulk maxpacket |
376 |
+- * values can be as large as 2048. To make that work properly |
377 |
+- * will require changes to the block layer. |
378 |
++ * For a transmission on USB to continue we must never send |
379 |
++ * a package that is smaller than maxpacket. Hence the length of each |
380 |
++ * scatterlist element except the last must be divisible by the |
381 |
++ * Bulk maxpacket value. |
382 |
++ * If the HC does not ensure that through SG, |
383 |
++ * the upper layer must do that. We must assume nothing |
384 |
++ * about the capabilities off the HC, so we use the most |
385 |
++ * pessimistic requirement. |
386 |
++ */ |
387 |
++ |
388 |
++ maxp = usb_maxpacket(devinfo->udev, devinfo->data_in_pipe, 0); |
389 |
++ blk_queue_virt_boundary(sdev->request_queue, maxp - 1); |
390 |
++ |
391 |
++ /* |
392 |
++ * The protocol has no requirements on alignment in the strict sense. |
393 |
++ * Controllers may or may not have alignment restrictions. |
394 |
++ * As this is not exported, we use an extremely conservative guess. |
395 |
+ */ |
396 |
+ blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); |
397 |
+ |
398 |
+diff --git a/include/linux/kernel.h b/include/linux/kernel.h |
399 |
+index 61054f12be7c..d83fc669eeac 100644 |
400 |
+--- a/include/linux/kernel.h |
401 |
++++ b/include/linux/kernel.h |
402 |
+@@ -55,8 +55,8 @@ |
403 |
+ |
404 |
+ #define u64_to_user_ptr(x) ( \ |
405 |
+ { \ |
406 |
+- typecheck(u64, x); \ |
407 |
+- (void __user *)(uintptr_t)x; \ |
408 |
++ typecheck(u64, (x)); \ |
409 |
++ (void __user *)(uintptr_t)(x); \ |
410 |
+ } \ |
411 |
+ ) |
412 |
+ |
413 |
+diff --git a/include/linux/mm.h b/include/linux/mm.h |
414 |
+index 11a5a46ce72b..e3c8d40a18b5 100644 |
415 |
+--- a/include/linux/mm.h |
416 |
++++ b/include/linux/mm.h |
417 |
+@@ -777,6 +777,15 @@ static inline void get_page(struct page *page) |
418 |
+ get_zone_device_page(page); |
419 |
+ } |
420 |
+ |
421 |
++static inline __must_check bool try_get_page(struct page *page) |
422 |
++{ |
423 |
++ page = compound_head(page); |
424 |
++ if (WARN_ON_ONCE(page_ref_count(page) <= 0)) |
425 |
++ return false; |
426 |
++ page_ref_inc(page); |
427 |
++ return true; |
428 |
++} |
429 |
++ |
430 |
+ static inline void put_page(struct page *page) |
431 |
+ { |
432 |
+ page = compound_head(page); |
433 |
+diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h |
434 |
+index 4931787193c3..57a7dba49d29 100644 |
435 |
+--- a/include/net/bluetooth/hci_core.h |
436 |
++++ b/include/net/bluetooth/hci_core.h |
437 |
+@@ -176,6 +176,9 @@ struct adv_info { |
438 |
+ |
439 |
+ #define HCI_MAX_SHORT_NAME_LENGTH 10 |
440 |
+ |
441 |
++/* Min encryption key size to match with SMP */ |
442 |
++#define HCI_MIN_ENC_KEY_SIZE 7 |
443 |
++ |
444 |
+ /* Default LE RPA expiry time, 15 minutes */ |
445 |
+ #define HCI_DEFAULT_RPA_TIMEOUT (15 * 60) |
446 |
+ |
447 |
+diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c |
448 |
+index cf94460504bb..be7f489788e2 100644 |
449 |
+--- a/kernel/irq/manage.c |
450 |
++++ b/kernel/irq/manage.c |
451 |
+@@ -332,8 +332,10 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) |
452 |
+ desc->affinity_notify = notify; |
453 |
+ raw_spin_unlock_irqrestore(&desc->lock, flags); |
454 |
+ |
455 |
+- if (old_notify) |
456 |
++ if (old_notify) { |
457 |
++ cancel_work_sync(&old_notify->work); |
458 |
+ kref_put(&old_notify->kref, old_notify->release); |
459 |
++ } |
460 |
+ |
461 |
+ return 0; |
462 |
+ } |
463 |
+diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c |
464 |
+index 087204c733eb..c74920f318c5 100644 |
465 |
+--- a/kernel/time/timer_stats.c |
466 |
++++ b/kernel/time/timer_stats.c |
467 |
+@@ -417,7 +417,7 @@ static int __init init_tstats_procfs(void) |
468 |
+ { |
469 |
+ struct proc_dir_entry *pe; |
470 |
+ |
471 |
+- pe = proc_create("timer_stats", 0644, NULL, &tstats_fops); |
472 |
++ pe = proc_create("timer_stats", 0600, NULL, &tstats_fops); |
473 |
+ if (!pe) |
474 |
+ return -ENOMEM; |
475 |
+ return 0; |
476 |
+diff --git a/lib/ubsan.c b/lib/ubsan.c |
477 |
+index 60e108c5c173..c652b4a820cc 100644 |
478 |
+--- a/lib/ubsan.c |
479 |
++++ b/lib/ubsan.c |
480 |
+@@ -86,11 +86,13 @@ static bool is_inline_int(struct type_descriptor *type) |
481 |
+ return bits <= inline_bits; |
482 |
+ } |
483 |
+ |
484 |
+-static s_max get_signed_val(struct type_descriptor *type, unsigned long val) |
485 |
++static s_max get_signed_val(struct type_descriptor *type, void *val) |
486 |
+ { |
487 |
+ if (is_inline_int(type)) { |
488 |
+ unsigned extra_bits = sizeof(s_max)*8 - type_bit_width(type); |
489 |
+- return ((s_max)val) << extra_bits >> extra_bits; |
490 |
++ unsigned long ulong_val = (unsigned long)val; |
491 |
++ |
492 |
++ return ((s_max)ulong_val) << extra_bits >> extra_bits; |
493 |
+ } |
494 |
+ |
495 |
+ if (type_bit_width(type) == 64) |
496 |
+@@ -99,15 +101,15 @@ static s_max get_signed_val(struct type_descriptor *type, unsigned long val) |
497 |
+ return *(s_max *)val; |
498 |
+ } |
499 |
+ |
500 |
+-static bool val_is_negative(struct type_descriptor *type, unsigned long val) |
501 |
++static bool val_is_negative(struct type_descriptor *type, void *val) |
502 |
+ { |
503 |
+ return type_is_signed(type) && get_signed_val(type, val) < 0; |
504 |
+ } |
505 |
+ |
506 |
+-static u_max get_unsigned_val(struct type_descriptor *type, unsigned long val) |
507 |
++static u_max get_unsigned_val(struct type_descriptor *type, void *val) |
508 |
+ { |
509 |
+ if (is_inline_int(type)) |
510 |
+- return val; |
511 |
++ return (unsigned long)val; |
512 |
+ |
513 |
+ if (type_bit_width(type) == 64) |
514 |
+ return *(u64 *)val; |
515 |
+@@ -116,7 +118,7 @@ static u_max get_unsigned_val(struct type_descriptor *type, unsigned long val) |
516 |
+ } |
517 |
+ |
518 |
+ static void val_to_string(char *str, size_t size, struct type_descriptor *type, |
519 |
+- unsigned long value) |
520 |
++ void *value) |
521 |
+ { |
522 |
+ if (type_is_int(type)) { |
523 |
+ if (type_bit_width(type) == 128) { |
524 |
+@@ -168,8 +170,8 @@ static void ubsan_epilogue(unsigned long *flags) |
525 |
+ current->in_ubsan--; |
526 |
+ } |
527 |
+ |
528 |
+-static void handle_overflow(struct overflow_data *data, unsigned long lhs, |
529 |
+- unsigned long rhs, char op) |
530 |
++static void handle_overflow(struct overflow_data *data, void *lhs, |
531 |
++ void *rhs, char op) |
532 |
+ { |
533 |
+ |
534 |
+ struct type_descriptor *type = data->type; |
535 |
+@@ -196,8 +198,7 @@ static void handle_overflow(struct overflow_data *data, unsigned long lhs, |
536 |
+ } |
537 |
+ |
538 |
+ void __ubsan_handle_add_overflow(struct overflow_data *data, |
539 |
+- unsigned long lhs, |
540 |
+- unsigned long rhs) |
541 |
++ void *lhs, void *rhs) |
542 |
+ { |
543 |
+ |
544 |
+ handle_overflow(data, lhs, rhs, '+'); |
545 |
+@@ -205,23 +206,21 @@ void __ubsan_handle_add_overflow(struct overflow_data *data, |
546 |
+ EXPORT_SYMBOL(__ubsan_handle_add_overflow); |
547 |
+ |
548 |
+ void __ubsan_handle_sub_overflow(struct overflow_data *data, |
549 |
+- unsigned long lhs, |
550 |
+- unsigned long rhs) |
551 |
++ void *lhs, void *rhs) |
552 |
+ { |
553 |
+ handle_overflow(data, lhs, rhs, '-'); |
554 |
+ } |
555 |
+ EXPORT_SYMBOL(__ubsan_handle_sub_overflow); |
556 |
+ |
557 |
+ void __ubsan_handle_mul_overflow(struct overflow_data *data, |
558 |
+- unsigned long lhs, |
559 |
+- unsigned long rhs) |
560 |
++ void *lhs, void *rhs) |
561 |
+ { |
562 |
+ handle_overflow(data, lhs, rhs, '*'); |
563 |
+ } |
564 |
+ EXPORT_SYMBOL(__ubsan_handle_mul_overflow); |
565 |
+ |
566 |
+ void __ubsan_handle_negate_overflow(struct overflow_data *data, |
567 |
+- unsigned long old_val) |
568 |
++ void *old_val) |
569 |
+ { |
570 |
+ unsigned long flags; |
571 |
+ char old_val_str[VALUE_LENGTH]; |
572 |
+@@ -242,8 +241,7 @@ EXPORT_SYMBOL(__ubsan_handle_negate_overflow); |
573 |
+ |
574 |
+ |
575 |
+ void __ubsan_handle_divrem_overflow(struct overflow_data *data, |
576 |
+- unsigned long lhs, |
577 |
+- unsigned long rhs) |
578 |
++ void *lhs, void *rhs) |
579 |
+ { |
580 |
+ unsigned long flags; |
581 |
+ char rhs_val_str[VALUE_LENGTH]; |
582 |
+@@ -328,7 +326,7 @@ static void ubsan_type_mismatch_common(struct type_mismatch_data_common *data, |
583 |
+ } |
584 |
+ |
585 |
+ void __ubsan_handle_type_mismatch(struct type_mismatch_data *data, |
586 |
+- unsigned long ptr) |
587 |
++ void *ptr) |
588 |
+ { |
589 |
+ struct type_mismatch_data_common common_data = { |
590 |
+ .location = &data->location, |
591 |
+@@ -337,12 +335,12 @@ void __ubsan_handle_type_mismatch(struct type_mismatch_data *data, |
592 |
+ .type_check_kind = data->type_check_kind |
593 |
+ }; |
594 |
+ |
595 |
+- ubsan_type_mismatch_common(&common_data, ptr); |
596 |
++ ubsan_type_mismatch_common(&common_data, (unsigned long)ptr); |
597 |
+ } |
598 |
+ EXPORT_SYMBOL(__ubsan_handle_type_mismatch); |
599 |
+ |
600 |
+ void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data, |
601 |
+- unsigned long ptr) |
602 |
++ void *ptr) |
603 |
+ { |
604 |
+ |
605 |
+ struct type_mismatch_data_common common_data = { |
606 |
+@@ -352,7 +350,7 @@ void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data, |
607 |
+ .type_check_kind = data->type_check_kind |
608 |
+ }; |
609 |
+ |
610 |
+- ubsan_type_mismatch_common(&common_data, ptr); |
611 |
++ ubsan_type_mismatch_common(&common_data, (unsigned long)ptr); |
612 |
+ } |
613 |
+ EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1); |
614 |
+ |
615 |
+@@ -376,7 +374,7 @@ void __ubsan_handle_nonnull_return(struct nonnull_return_data *data) |
616 |
+ EXPORT_SYMBOL(__ubsan_handle_nonnull_return); |
617 |
+ |
618 |
+ void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data, |
619 |
+- unsigned long bound) |
620 |
++ void *bound) |
621 |
+ { |
622 |
+ unsigned long flags; |
623 |
+ char bound_str[VALUE_LENGTH]; |
624 |
+@@ -393,8 +391,7 @@ void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data, |
625 |
+ } |
626 |
+ EXPORT_SYMBOL(__ubsan_handle_vla_bound_not_positive); |
627 |
+ |
628 |
+-void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, |
629 |
+- unsigned long index) |
630 |
++void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, void *index) |
631 |
+ { |
632 |
+ unsigned long flags; |
633 |
+ char index_str[VALUE_LENGTH]; |
634 |
+@@ -412,7 +409,7 @@ void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, |
635 |
+ EXPORT_SYMBOL(__ubsan_handle_out_of_bounds); |
636 |
+ |
637 |
+ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data, |
638 |
+- unsigned long lhs, unsigned long rhs) |
639 |
++ void *lhs, void *rhs) |
640 |
+ { |
641 |
+ unsigned long flags; |
642 |
+ struct type_descriptor *rhs_type = data->rhs_type; |
643 |
+@@ -463,7 +460,7 @@ void __ubsan_handle_builtin_unreachable(struct unreachable_data *data) |
644 |
+ EXPORT_SYMBOL(__ubsan_handle_builtin_unreachable); |
645 |
+ |
646 |
+ void __ubsan_handle_load_invalid_value(struct invalid_value_data *data, |
647 |
+- unsigned long val) |
648 |
++ void *val) |
649 |
+ { |
650 |
+ unsigned long flags; |
651 |
+ char val_str[VALUE_LENGTH]; |
652 |
+diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c |
653 |
+index cc061495f653..fe4fb0c1fa61 100644 |
654 |
+--- a/net/bluetooth/hci_conn.c |
655 |
++++ b/net/bluetooth/hci_conn.c |
656 |
+@@ -1165,6 +1165,14 @@ int hci_conn_check_link_mode(struct hci_conn *conn) |
657 |
+ !test_bit(HCI_CONN_ENCRYPT, &conn->flags)) |
658 |
+ return 0; |
659 |
+ |
660 |
++ /* The minimum encryption key size needs to be enforced by the |
661 |
++ * host stack before establishing any L2CAP connections. The |
662 |
++ * specification in theory allows a minimum of 1, but to align |
663 |
++ * BR/EDR and LE transports, a minimum of 7 is chosen. |
664 |
++ */ |
665 |
++ if (conn->enc_key_size < HCI_MIN_ENC_KEY_SIZE) |
666 |
++ return 0; |
667 |
++ |
668 |
+ return 1; |
669 |
+ } |
670 |
+ |
671 |
+diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c |
672 |
+index 008ba439bd62..cc80c76177b6 100644 |
673 |
+--- a/net/bluetooth/hidp/sock.c |
674 |
++++ b/net/bluetooth/hidp/sock.c |
675 |
+@@ -76,6 +76,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long |
676 |
+ sockfd_put(csock); |
677 |
+ return err; |
678 |
+ } |
679 |
++ ca.name[sizeof(ca.name)-1] = 0; |
680 |
+ |
681 |
+ err = hidp_connection_add(&ca, csock, isock); |
682 |
+ if (!err && copy_to_user(argp, &ca, sizeof(ca))) |
683 |
+diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c |
684 |
+index 84f86745c30e..828bc615a190 100644 |
685 |
+--- a/sound/soc/codecs/cs4270.c |
686 |
++++ b/sound/soc/codecs/cs4270.c |
687 |
+@@ -643,6 +643,7 @@ static const struct regmap_config cs4270_regmap = { |
688 |
+ .reg_defaults = cs4270_reg_defaults, |
689 |
+ .num_reg_defaults = ARRAY_SIZE(cs4270_reg_defaults), |
690 |
+ .cache_type = REGCACHE_RBTREE, |
691 |
++ .write_flag_mask = CS4270_I2C_INCR, |
692 |
+ |
693 |
+ .readable_reg = cs4270_reg_is_readable, |
694 |
+ .volatile_reg = cs4270_reg_is_volatile, |
695 |
+diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c |
696 |
+index e45518629968..2234d0c04165 100644 |
697 |
+--- a/sound/soc/codecs/nau8810.c |
698 |
++++ b/sound/soc/codecs/nau8810.c |
699 |
+@@ -414,9 +414,9 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = { |
700 |
+ SND_SOC_DAPM_MIXER("Mono Mixer", NAU8810_REG_POWER3, |
701 |
+ NAU8810_MOUTMX_EN_SFT, 0, &nau8810_mono_mixer_controls[0], |
702 |
+ ARRAY_SIZE(nau8810_mono_mixer_controls)), |
703 |
+- SND_SOC_DAPM_DAC("DAC", "HiFi Playback", NAU8810_REG_POWER3, |
704 |
++ SND_SOC_DAPM_DAC("DAC", "Playback", NAU8810_REG_POWER3, |
705 |
+ NAU8810_DAC_EN_SFT, 0), |
706 |
+- SND_SOC_DAPM_ADC("ADC", "HiFi Capture", NAU8810_REG_POWER2, |
707 |
++ SND_SOC_DAPM_ADC("ADC", "Capture", NAU8810_REG_POWER2, |
708 |
+ NAU8810_ADC_EN_SFT, 0), |
709 |
+ SND_SOC_DAPM_PGA("SpkN Out", NAU8810_REG_POWER3, |
710 |
+ NAU8810_NSPK_EN_SFT, 0, NULL, 0), |
711 |
+diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c |
712 |
+index 28fdfc5ec544..c27e3476848a 100644 |
713 |
+--- a/sound/soc/codecs/tlv320aic32x4.c |
714 |
++++ b/sound/soc/codecs/tlv320aic32x4.c |
715 |
+@@ -316,6 +316,8 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = { |
716 |
+ SND_SOC_DAPM_INPUT("IN2_R"), |
717 |
+ SND_SOC_DAPM_INPUT("IN3_L"), |
718 |
+ SND_SOC_DAPM_INPUT("IN3_R"), |
719 |
++ SND_SOC_DAPM_INPUT("CM_L"), |
720 |
++ SND_SOC_DAPM_INPUT("CM_R"), |
721 |
+ }; |
722 |
+ |
723 |
+ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = { |
724 |
+diff --git a/sound/soc/intel/common/sst-firmware.c b/sound/soc/intel/common/sst-firmware.c |
725 |
+index 79a9fdf94d38..582b30a5118d 100644 |
726 |
+--- a/sound/soc/intel/common/sst-firmware.c |
727 |
++++ b/sound/soc/intel/common/sst-firmware.c |
728 |
+@@ -1252,11 +1252,15 @@ struct sst_dsp *sst_dsp_new(struct device *dev, |
729 |
+ goto irq_err; |
730 |
+ |
731 |
+ err = sst_dma_new(sst); |
732 |
+- if (err) |
733 |
+- dev_warn(dev, "sst_dma_new failed %d\n", err); |
734 |
++ if (err) { |
735 |
++ dev_err(dev, "sst_dma_new failed %d\n", err); |
736 |
++ goto dma_err; |
737 |
++ } |
738 |
+ |
739 |
+ return sst; |
740 |
+ |
741 |
++dma_err: |
742 |
++ free_irq(sst->irq, sst); |
743 |
+ irq_err: |
744 |
+ if (sst->ops->free) |
745 |
+ sst->ops->free(sst); |
746 |
+diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c |
747 |
+index b111ecda6439..1dbcdc99dbe3 100644 |
748 |
+--- a/sound/soc/soc-pcm.c |
749 |
++++ b/sound/soc/soc-pcm.c |
750 |
+@@ -894,10 +894,13 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, |
751 |
+ codec_params = *params; |
752 |
+ |
753 |
+ /* fixup params based on TDM slot masks */ |
754 |
+- if (codec_dai->tx_mask) |
755 |
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && |
756 |
++ codec_dai->tx_mask) |
757 |
+ soc_pcm_codec_params_fixup(&codec_params, |
758 |
+ codec_dai->tx_mask); |
759 |
+- if (codec_dai->rx_mask) |
760 |
++ |
761 |
++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && |
762 |
++ codec_dai->rx_mask) |
763 |
+ soc_pcm_codec_params_fixup(&codec_params, |
764 |
+ codec_dai->rx_mask); |
765 |
+ |