1 |
commit: e7624253fc20d1a3c8a401d5ded9d59708c45bfa |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 23 11:05:24 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 23 11:05:24 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e7624253 |
7 |
|
8 |
Linux patch 4.14.167 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1166_linux-4.14.167.patch | 2219 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2223 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 9d49814..89f313a 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -707,6 +707,10 @@ Patch: 1165_linux-4.14.166.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.14.166 |
23 |
|
24 |
+Patch: 1166_linux-4.14.167.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.14.167 |
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/1166_linux-4.14.167.patch b/1166_linux-4.14.167.patch |
33 |
new file mode 100644 |
34 |
index 0000000..179628e |
35 |
--- /dev/null |
36 |
+++ b/1166_linux-4.14.167.patch |
37 |
@@ -0,0 +1,2219 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 7c62b4078c1b..3e8eaabf2bcb 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 166 |
47 |
++SUBLEVEL = 167 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+diff --git a/arch/arm/boot/dts/am571x-idk.dts b/arch/arm/boot/dts/am571x-idk.dts |
52 |
+index debf9464403e..96a4df4109d7 100644 |
53 |
+--- a/arch/arm/boot/dts/am571x-idk.dts |
54 |
++++ b/arch/arm/boot/dts/am571x-idk.dts |
55 |
+@@ -93,7 +93,7 @@ |
56 |
+ |
57 |
+ &pcie1_rc { |
58 |
+ status = "okay"; |
59 |
+- gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; |
60 |
++ gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>; |
61 |
+ }; |
62 |
+ |
63 |
+ &pcie1_ep { |
64 |
+diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
65 |
+index e79f3defe002..c2ad4f97cef0 100644 |
66 |
+--- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
67 |
++++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
68 |
+@@ -56,10 +56,10 @@ |
69 |
+ |
70 |
+ pmu { |
71 |
+ compatible = "arm,armv8-pmuv3"; |
72 |
+- interrupts = <0 120 8>, |
73 |
+- <0 121 8>, |
74 |
+- <0 122 8>, |
75 |
+- <0 123 8>; |
76 |
++ interrupts = <0 170 4>, |
77 |
++ <0 171 4>, |
78 |
++ <0 172 4>, |
79 |
++ <0 173 4>; |
80 |
+ interrupt-affinity = <&cpu0>, |
81 |
+ <&cpu1>, |
82 |
+ <&cpu2>, |
83 |
+diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts |
84 |
+index fb5db5f33e8c..ce4a116382bf 100644 |
85 |
+--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts |
86 |
++++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts |
87 |
+@@ -33,11 +33,9 @@ |
88 |
+ |
89 |
+ gpio-keys-polled { |
90 |
+ compatible = "gpio-keys-polled"; |
91 |
+- #address-cells = <1>; |
92 |
+- #size-cells = <0>; |
93 |
+ poll-interval = <100>; |
94 |
+ |
95 |
+- button@0 { |
96 |
++ power-button { |
97 |
+ label = "power"; |
98 |
+ linux,code = <KEY_POWER>; |
99 |
+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; |
100 |
+diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi |
101 |
+index f165f04db0c9..13ee8ffa9bbf 100644 |
102 |
+--- a/arch/arm64/boot/dts/arm/juno-base.dtsi |
103 |
++++ b/arch/arm64/boot/dts/arm/juno-base.dtsi |
104 |
+@@ -5,7 +5,6 @@ |
105 |
+ /* |
106 |
+ * Devices shared by all Juno boards |
107 |
+ */ |
108 |
+- dma-ranges = <0 0 0 0 0x100 0>; |
109 |
+ |
110 |
+ memtimer: timer@2a810000 { |
111 |
+ compatible = "arm,armv7-timer-mem"; |
112 |
+diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S |
113 |
+index 4b3d92a37c80..39fdede523f2 100644 |
114 |
+--- a/arch/x86/boot/compressed/head_64.S |
115 |
++++ b/arch/x86/boot/compressed/head_64.S |
116 |
+@@ -227,6 +227,11 @@ ENTRY(efi32_stub_entry) |
117 |
+ leal efi32_config(%ebp), %eax |
118 |
+ movl %eax, efi_config(%ebp) |
119 |
+ |
120 |
++ /* Disable paging */ |
121 |
++ movl %cr0, %eax |
122 |
++ btrl $X86_CR0_PG_BIT, %eax |
123 |
++ movl %eax, %cr0 |
124 |
++ |
125 |
+ jmp startup_32 |
126 |
+ ENDPROC(efi32_stub_entry) |
127 |
+ #endif |
128 |
+diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c |
129 |
+index 665d0f6cd62f..3f731d7f04bf 100644 |
130 |
+--- a/arch/x86/kernel/cpu/intel_rdt.c |
131 |
++++ b/arch/x86/kernel/cpu/intel_rdt.c |
132 |
+@@ -526,7 +526,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r) |
133 |
+ if (static_branch_unlikely(&rdt_mon_enable_key)) |
134 |
+ rmdir_mondata_subdir_allrdtgrp(r, d->id); |
135 |
+ list_del(&d->list); |
136 |
+- if (is_mbm_enabled()) |
137 |
++ if (r->mon_capable && is_mbm_enabled()) |
138 |
+ cancel_delayed_work(&d->mbm_over); |
139 |
+ if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) { |
140 |
+ /* |
141 |
+diff --git a/block/blk-settings.c b/block/blk-settings.c |
142 |
+index 474b0b95fcd1..6c2faaa38cc1 100644 |
143 |
+--- a/block/blk-settings.c |
144 |
++++ b/block/blk-settings.c |
145 |
+@@ -379,7 +379,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size); |
146 |
+ * storage device can address. The default of 512 covers most |
147 |
+ * hardware. |
148 |
+ **/ |
149 |
+-void blk_queue_logical_block_size(struct request_queue *q, unsigned short size) |
150 |
++void blk_queue_logical_block_size(struct request_queue *q, unsigned int size) |
151 |
+ { |
152 |
+ q->limits.logical_block_size = size; |
153 |
+ |
154 |
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c |
155 |
+index 32ac5f551e55..e6887714fe0a 100644 |
156 |
+--- a/drivers/block/xen-blkfront.c |
157 |
++++ b/drivers/block/xen-blkfront.c |
158 |
+@@ -1115,8 +1115,8 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, |
159 |
+ if (!VDEV_IS_EXTENDED(info->vdevice)) { |
160 |
+ err = xen_translate_vdev(info->vdevice, &minor, &offset); |
161 |
+ if (err) |
162 |
+- return err; |
163 |
+- nr_parts = PARTS_PER_DISK; |
164 |
++ return err; |
165 |
++ nr_parts = PARTS_PER_DISK; |
166 |
+ } else { |
167 |
+ minor = BLKIF_MINOR_EXT(info->vdevice); |
168 |
+ nr_parts = PARTS_PER_EXT_DISK; |
169 |
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c |
170 |
+index a3f52f678211..8341a128dab1 100644 |
171 |
+--- a/drivers/clk/clk.c |
172 |
++++ b/drivers/clk/clk.c |
173 |
+@@ -2482,11 +2482,17 @@ static int __clk_core_init(struct clk_core *core) |
174 |
+ if (core->flags & CLK_IS_CRITICAL) { |
175 |
+ unsigned long flags; |
176 |
+ |
177 |
+- clk_core_prepare(core); |
178 |
++ ret = clk_core_prepare(core); |
179 |
++ if (ret) |
180 |
++ goto out; |
181 |
+ |
182 |
+ flags = clk_enable_lock(); |
183 |
+- clk_core_enable(core); |
184 |
++ ret = clk_core_enable(core); |
185 |
+ clk_enable_unlock(flags); |
186 |
++ if (ret) { |
187 |
++ clk_core_unprepare(core); |
188 |
++ goto out; |
189 |
++ } |
190 |
+ } |
191 |
+ |
192 |
+ /* |
193 |
+diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c |
194 |
+index d50125766093..c3badf634378 100644 |
195 |
+--- a/drivers/iio/industrialio-buffer.c |
196 |
++++ b/drivers/iio/industrialio-buffer.c |
197 |
+@@ -570,7 +570,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, |
198 |
+ const unsigned long *mask, bool timestamp) |
199 |
+ { |
200 |
+ unsigned bytes = 0; |
201 |
+- int length, i; |
202 |
++ int length, i, largest = 0; |
203 |
+ |
204 |
+ /* How much space will the demuxed element take? */ |
205 |
+ for_each_set_bit(i, mask, |
206 |
+@@ -578,13 +578,17 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, |
207 |
+ length = iio_storage_bytes_for_si(indio_dev, i); |
208 |
+ bytes = ALIGN(bytes, length); |
209 |
+ bytes += length; |
210 |
++ largest = max(largest, length); |
211 |
+ } |
212 |
+ |
213 |
+ if (timestamp) { |
214 |
+ length = iio_storage_bytes_for_timestamp(indio_dev); |
215 |
+ bytes = ALIGN(bytes, length); |
216 |
+ bytes += length; |
217 |
++ largest = max(largest, length); |
218 |
+ } |
219 |
++ |
220 |
++ bytes = ALIGN(bytes, largest); |
221 |
+ return bytes; |
222 |
+ } |
223 |
+ |
224 |
+diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c |
225 |
+index c5534d294773..00025569e807 100644 |
226 |
+--- a/drivers/md/dm-snap-persistent.c |
227 |
++++ b/drivers/md/dm-snap-persistent.c |
228 |
+@@ -17,7 +17,7 @@ |
229 |
+ #include "dm-bufio.h" |
230 |
+ |
231 |
+ #define DM_MSG_PREFIX "persistent snapshot" |
232 |
+-#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */ |
233 |
++#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U /* 16KB */ |
234 |
+ |
235 |
+ #define DM_PREFETCH_CHUNKS 12 |
236 |
+ |
237 |
+diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c |
238 |
+index 204adde004a3..cdafa5e0ea6d 100644 |
239 |
+--- a/drivers/md/raid0.c |
240 |
++++ b/drivers/md/raid0.c |
241 |
+@@ -94,7 +94,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) |
242 |
+ char b[BDEVNAME_SIZE]; |
243 |
+ char b2[BDEVNAME_SIZE]; |
244 |
+ struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL); |
245 |
+- unsigned short blksize = 512; |
246 |
++ unsigned blksize = 512; |
247 |
+ |
248 |
+ *private_conf = ERR_PTR(-ENOMEM); |
249 |
+ if (!conf) |
250 |
+diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c |
251 |
+index cf6ce9f600ca..f9b2e652c399 100644 |
252 |
+--- a/drivers/message/fusion/mptctl.c |
253 |
++++ b/drivers/message/fusion/mptctl.c |
254 |
+@@ -100,19 +100,19 @@ struct buflist { |
255 |
+ * Function prototypes. Called from OS entry point mptctl_ioctl. |
256 |
+ * arg contents specific to function. |
257 |
+ */ |
258 |
+-static int mptctl_fw_download(unsigned long arg); |
259 |
+-static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd); |
260 |
+-static int mptctl_gettargetinfo(unsigned long arg); |
261 |
+-static int mptctl_readtest(unsigned long arg); |
262 |
+-static int mptctl_mpt_command(unsigned long arg); |
263 |
+-static int mptctl_eventquery(unsigned long arg); |
264 |
+-static int mptctl_eventenable(unsigned long arg); |
265 |
+-static int mptctl_eventreport(unsigned long arg); |
266 |
+-static int mptctl_replace_fw(unsigned long arg); |
267 |
+- |
268 |
+-static int mptctl_do_reset(unsigned long arg); |
269 |
+-static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); |
270 |
+-static int mptctl_hp_targetinfo(unsigned long arg); |
271 |
++static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg); |
272 |
++static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); |
273 |
++static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg); |
274 |
++static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg); |
275 |
++static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg); |
276 |
++static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg); |
277 |
++static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg); |
278 |
++static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg); |
279 |
++static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg); |
280 |
++ |
281 |
++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg); |
282 |
++static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); |
283 |
++static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg); |
284 |
+ |
285 |
+ static int mptctl_probe(struct pci_dev *, const struct pci_device_id *); |
286 |
+ static void mptctl_remove(struct pci_dev *); |
287 |
+@@ -123,8 +123,8 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg); |
288 |
+ /* |
289 |
+ * Private function calls. |
290 |
+ */ |
291 |
+-static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr); |
292 |
+-static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); |
293 |
++static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfPtr); |
294 |
++static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen); |
295 |
+ static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags, |
296 |
+ struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); |
297 |
+ static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, |
298 |
+@@ -656,19 +656,19 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
299 |
+ * by TM and FW reloads. |
300 |
+ */ |
301 |
+ if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) { |
302 |
+- return mptctl_getiocinfo(arg, _IOC_SIZE(cmd)); |
303 |
++ return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd)); |
304 |
+ } else if (cmd == MPTTARGETINFO) { |
305 |
+- return mptctl_gettargetinfo(arg); |
306 |
++ return mptctl_gettargetinfo(iocp, arg); |
307 |
+ } else if (cmd == MPTTEST) { |
308 |
+- return mptctl_readtest(arg); |
309 |
++ return mptctl_readtest(iocp, arg); |
310 |
+ } else if (cmd == MPTEVENTQUERY) { |
311 |
+- return mptctl_eventquery(arg); |
312 |
++ return mptctl_eventquery(iocp, arg); |
313 |
+ } else if (cmd == MPTEVENTENABLE) { |
314 |
+- return mptctl_eventenable(arg); |
315 |
++ return mptctl_eventenable(iocp, arg); |
316 |
+ } else if (cmd == MPTEVENTREPORT) { |
317 |
+- return mptctl_eventreport(arg); |
318 |
++ return mptctl_eventreport(iocp, arg); |
319 |
+ } else if (cmd == MPTFWREPLACE) { |
320 |
+- return mptctl_replace_fw(arg); |
321 |
++ return mptctl_replace_fw(iocp, arg); |
322 |
+ } |
323 |
+ |
324 |
+ /* All of these commands require an interrupt or |
325 |
+@@ -678,15 +678,15 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
326 |
+ return ret; |
327 |
+ |
328 |
+ if (cmd == MPTFWDOWNLOAD) |
329 |
+- ret = mptctl_fw_download(arg); |
330 |
++ ret = mptctl_fw_download(iocp, arg); |
331 |
+ else if (cmd == MPTCOMMAND) |
332 |
+- ret = mptctl_mpt_command(arg); |
333 |
++ ret = mptctl_mpt_command(iocp, arg); |
334 |
+ else if (cmd == MPTHARDRESET) |
335 |
+- ret = mptctl_do_reset(arg); |
336 |
++ ret = mptctl_do_reset(iocp, arg); |
337 |
+ else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK)) |
338 |
+- ret = mptctl_hp_hostinfo(arg, _IOC_SIZE(cmd)); |
339 |
++ ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd)); |
340 |
+ else if (cmd == HP_GETTARGETINFO) |
341 |
+- ret = mptctl_hp_targetinfo(arg); |
342 |
++ ret = mptctl_hp_targetinfo(iocp, arg); |
343 |
+ else |
344 |
+ ret = -EINVAL; |
345 |
+ |
346 |
+@@ -705,11 +705,10 @@ mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
347 |
+ return ret; |
348 |
+ } |
349 |
+ |
350 |
+-static int mptctl_do_reset(unsigned long arg) |
351 |
++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg) |
352 |
+ { |
353 |
+ struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg; |
354 |
+ struct mpt_ioctl_diag_reset krinfo; |
355 |
+- MPT_ADAPTER *iocp; |
356 |
+ |
357 |
+ if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) { |
358 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - " |
359 |
+@@ -718,12 +717,6 @@ static int mptctl_do_reset(unsigned long arg) |
360 |
+ return -EFAULT; |
361 |
+ } |
362 |
+ |
363 |
+- if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { |
364 |
+- printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n", |
365 |
+- __FILE__, __LINE__, krinfo.hdr.iocnum); |
366 |
+- return -ENODEV; /* (-6) No such device or address */ |
367 |
+- } |
368 |
+- |
369 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", |
370 |
+ iocp->name)); |
371 |
+ |
372 |
+@@ -754,7 +747,7 @@ static int mptctl_do_reset(unsigned long arg) |
373 |
+ * -ENOMSG if FW upload returned bad status |
374 |
+ */ |
375 |
+ static int |
376 |
+-mptctl_fw_download(unsigned long arg) |
377 |
++mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg) |
378 |
+ { |
379 |
+ struct mpt_fw_xfer __user *ufwdl = (void __user *) arg; |
380 |
+ struct mpt_fw_xfer kfwdl; |
381 |
+@@ -766,7 +759,7 @@ mptctl_fw_download(unsigned long arg) |
382 |
+ return -EFAULT; |
383 |
+ } |
384 |
+ |
385 |
+- return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); |
386 |
++ return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen); |
387 |
+ } |
388 |
+ |
389 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
390 |
+@@ -784,11 +777,10 @@ mptctl_fw_download(unsigned long arg) |
391 |
+ * -ENOMSG if FW upload returned bad status |
392 |
+ */ |
393 |
+ static int |
394 |
+-mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
395 |
++mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen) |
396 |
+ { |
397 |
+ FWDownload_t *dlmsg; |
398 |
+ MPT_FRAME_HDR *mf; |
399 |
+- MPT_ADAPTER *iocp; |
400 |
+ FWDownloadTCSGE_t *ptsge; |
401 |
+ MptSge_t *sgl, *sgIn; |
402 |
+ char *sgOut; |
403 |
+@@ -808,17 +800,10 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
404 |
+ pFWDownloadReply_t ReplyMsg = NULL; |
405 |
+ unsigned long timeleft; |
406 |
+ |
407 |
+- if (mpt_verify_adapter(ioc, &iocp) < 0) { |
408 |
+- printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n", |
409 |
+- ioc); |
410 |
+- return -ENODEV; /* (-6) No such device or address */ |
411 |
+- } else { |
412 |
+- |
413 |
+- /* Valid device. Get a message frame and construct the FW download message. |
414 |
+- */ |
415 |
+- if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) |
416 |
+- return -EAGAIN; |
417 |
+- } |
418 |
++ /* Valid device. Get a message frame and construct the FW download message. |
419 |
++ */ |
420 |
++ if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) |
421 |
++ return -EAGAIN; |
422 |
+ |
423 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT |
424 |
+ "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); |
425 |
+@@ -826,8 +811,6 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
426 |
+ iocp->name, ufwbuf)); |
427 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", |
428 |
+ iocp->name, (int)fwlen)); |
429 |
+- dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n", |
430 |
+- iocp->name, ioc)); |
431 |
+ |
432 |
+ dlmsg = (FWDownload_t*) mf; |
433 |
+ ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; |
434 |
+@@ -1238,13 +1221,11 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE |
435 |
+ * -ENODEV if no such device/adapter |
436 |
+ */ |
437 |
+ static int |
438 |
+-mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
439 |
++mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) |
440 |
+ { |
441 |
+ struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg; |
442 |
+ struct mpt_ioctl_iocinfo *karg; |
443 |
+- MPT_ADAPTER *ioc; |
444 |
+ struct pci_dev *pdev; |
445 |
+- int iocnum; |
446 |
+ unsigned int port; |
447 |
+ int cim_rev; |
448 |
+ struct scsi_device *sdev; |
449 |
+@@ -1272,14 +1253,6 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
450 |
+ return PTR_ERR(karg); |
451 |
+ } |
452 |
+ |
453 |
+- if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || |
454 |
+- (ioc == NULL)) { |
455 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", |
456 |
+- __FILE__, __LINE__, iocnum); |
457 |
+- kfree(karg); |
458 |
+- return -ENODEV; |
459 |
+- } |
460 |
+- |
461 |
+ /* Verify the data transfer size is correct. */ |
462 |
+ if (karg->hdr.maxDataSize != data_size) { |
463 |
+ printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - " |
464 |
+@@ -1385,15 +1358,13 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
465 |
+ * -ENODEV if no such device/adapter |
466 |
+ */ |
467 |
+ static int |
468 |
+-mptctl_gettargetinfo (unsigned long arg) |
469 |
++mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg) |
470 |
+ { |
471 |
+ struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg; |
472 |
+ struct mpt_ioctl_targetinfo karg; |
473 |
+- MPT_ADAPTER *ioc; |
474 |
+ VirtDevice *vdevice; |
475 |
+ char *pmem; |
476 |
+ int *pdata; |
477 |
+- int iocnum; |
478 |
+ int numDevices = 0; |
479 |
+ int lun; |
480 |
+ int maxWordsLeft; |
481 |
+@@ -1408,13 +1379,6 @@ mptctl_gettargetinfo (unsigned long arg) |
482 |
+ return -EFAULT; |
483 |
+ } |
484 |
+ |
485 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
486 |
+- (ioc == NULL)) { |
487 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", |
488 |
+- __FILE__, __LINE__, iocnum); |
489 |
+- return -ENODEV; |
490 |
+- } |
491 |
+- |
492 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n", |
493 |
+ ioc->name)); |
494 |
+ /* Get the port number and set the maximum number of bytes |
495 |
+@@ -1510,12 +1474,10 @@ mptctl_gettargetinfo (unsigned long arg) |
496 |
+ * -ENODEV if no such device/adapter |
497 |
+ */ |
498 |
+ static int |
499 |
+-mptctl_readtest (unsigned long arg) |
500 |
++mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg) |
501 |
+ { |
502 |
+ struct mpt_ioctl_test __user *uarg = (void __user *) arg; |
503 |
+ struct mpt_ioctl_test karg; |
504 |
+- MPT_ADAPTER *ioc; |
505 |
+- int iocnum; |
506 |
+ |
507 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { |
508 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - " |
509 |
+@@ -1524,13 +1486,6 @@ mptctl_readtest (unsigned long arg) |
510 |
+ return -EFAULT; |
511 |
+ } |
512 |
+ |
513 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
514 |
+- (ioc == NULL)) { |
515 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n", |
516 |
+- __FILE__, __LINE__, iocnum); |
517 |
+- return -ENODEV; |
518 |
+- } |
519 |
+- |
520 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n", |
521 |
+ ioc->name)); |
522 |
+ /* Fill in the data and return the structure to the calling |
523 |
+@@ -1571,12 +1526,10 @@ mptctl_readtest (unsigned long arg) |
524 |
+ * -ENODEV if no such device/adapter |
525 |
+ */ |
526 |
+ static int |
527 |
+-mptctl_eventquery (unsigned long arg) |
528 |
++mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg) |
529 |
+ { |
530 |
+ struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg; |
531 |
+ struct mpt_ioctl_eventquery karg; |
532 |
+- MPT_ADAPTER *ioc; |
533 |
+- int iocnum; |
534 |
+ |
535 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { |
536 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - " |
537 |
+@@ -1585,13 +1538,6 @@ mptctl_eventquery (unsigned long arg) |
538 |
+ return -EFAULT; |
539 |
+ } |
540 |
+ |
541 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
542 |
+- (ioc == NULL)) { |
543 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n", |
544 |
+- __FILE__, __LINE__, iocnum); |
545 |
+- return -ENODEV; |
546 |
+- } |
547 |
+- |
548 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n", |
549 |
+ ioc->name)); |
550 |
+ karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; |
551 |
+@@ -1610,12 +1556,10 @@ mptctl_eventquery (unsigned long arg) |
552 |
+ |
553 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
554 |
+ static int |
555 |
+-mptctl_eventenable (unsigned long arg) |
556 |
++mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg) |
557 |
+ { |
558 |
+ struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg; |
559 |
+ struct mpt_ioctl_eventenable karg; |
560 |
+- MPT_ADAPTER *ioc; |
561 |
+- int iocnum; |
562 |
+ |
563 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { |
564 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - " |
565 |
+@@ -1624,13 +1568,6 @@ mptctl_eventenable (unsigned long arg) |
566 |
+ return -EFAULT; |
567 |
+ } |
568 |
+ |
569 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
570 |
+- (ioc == NULL)) { |
571 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n", |
572 |
+- __FILE__, __LINE__, iocnum); |
573 |
+- return -ENODEV; |
574 |
+- } |
575 |
+- |
576 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n", |
577 |
+ ioc->name)); |
578 |
+ if (ioc->events == NULL) { |
579 |
+@@ -1658,12 +1595,10 @@ mptctl_eventenable (unsigned long arg) |
580 |
+ |
581 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
582 |
+ static int |
583 |
+-mptctl_eventreport (unsigned long arg) |
584 |
++mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg) |
585 |
+ { |
586 |
+ struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg; |
587 |
+ struct mpt_ioctl_eventreport karg; |
588 |
+- MPT_ADAPTER *ioc; |
589 |
+- int iocnum; |
590 |
+ int numBytes, maxEvents, max; |
591 |
+ |
592 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { |
593 |
+@@ -1673,12 +1608,6 @@ mptctl_eventreport (unsigned long arg) |
594 |
+ return -EFAULT; |
595 |
+ } |
596 |
+ |
597 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
598 |
+- (ioc == NULL)) { |
599 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n", |
600 |
+- __FILE__, __LINE__, iocnum); |
601 |
+- return -ENODEV; |
602 |
+- } |
603 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n", |
604 |
+ ioc->name)); |
605 |
+ |
606 |
+@@ -1712,12 +1641,10 @@ mptctl_eventreport (unsigned long arg) |
607 |
+ |
608 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
609 |
+ static int |
610 |
+-mptctl_replace_fw (unsigned long arg) |
611 |
++mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg) |
612 |
+ { |
613 |
+ struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg; |
614 |
+ struct mpt_ioctl_replace_fw karg; |
615 |
+- MPT_ADAPTER *ioc; |
616 |
+- int iocnum; |
617 |
+ int newFwSize; |
618 |
+ |
619 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { |
620 |
+@@ -1727,13 +1654,6 @@ mptctl_replace_fw (unsigned long arg) |
621 |
+ return -EFAULT; |
622 |
+ } |
623 |
+ |
624 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
625 |
+- (ioc == NULL)) { |
626 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", |
627 |
+- __FILE__, __LINE__, iocnum); |
628 |
+- return -ENODEV; |
629 |
+- } |
630 |
+- |
631 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n", |
632 |
+ ioc->name)); |
633 |
+ /* If caching FW, Free the old FW image |
634 |
+@@ -1780,12 +1700,10 @@ mptctl_replace_fw (unsigned long arg) |
635 |
+ * -ENOMEM if memory allocation error |
636 |
+ */ |
637 |
+ static int |
638 |
+-mptctl_mpt_command (unsigned long arg) |
639 |
++mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg) |
640 |
+ { |
641 |
+ struct mpt_ioctl_command __user *uarg = (void __user *) arg; |
642 |
+ struct mpt_ioctl_command karg; |
643 |
+- MPT_ADAPTER *ioc; |
644 |
+- int iocnum; |
645 |
+ int rc; |
646 |
+ |
647 |
+ |
648 |
+@@ -1796,14 +1714,7 @@ mptctl_mpt_command (unsigned long arg) |
649 |
+ return -EFAULT; |
650 |
+ } |
651 |
+ |
652 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
653 |
+- (ioc == NULL)) { |
654 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", |
655 |
+- __FILE__, __LINE__, iocnum); |
656 |
+- return -ENODEV; |
657 |
+- } |
658 |
+- |
659 |
+- rc = mptctl_do_mpt_command (karg, &uarg->MF); |
660 |
++ rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF); |
661 |
+ |
662 |
+ return rc; |
663 |
+ } |
664 |
+@@ -1821,9 +1732,8 @@ mptctl_mpt_command (unsigned long arg) |
665 |
+ * -EPERM if SCSI I/O and target is untagged |
666 |
+ */ |
667 |
+ static int |
668 |
+-mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
669 |
++mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr) |
670 |
+ { |
671 |
+- MPT_ADAPTER *ioc; |
672 |
+ MPT_FRAME_HDR *mf = NULL; |
673 |
+ MPIHeader_t *hdr; |
674 |
+ char *psge; |
675 |
+@@ -1832,7 +1742,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
676 |
+ dma_addr_t dma_addr_in; |
677 |
+ dma_addr_t dma_addr_out; |
678 |
+ int sgSize = 0; /* Num SG elements */ |
679 |
+- int iocnum, flagsLength; |
680 |
++ int flagsLength; |
681 |
+ int sz, rc = 0; |
682 |
+ int msgContext; |
683 |
+ u16 req_idx; |
684 |
+@@ -1847,13 +1757,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
685 |
+ bufIn.kptr = bufOut.kptr = NULL; |
686 |
+ bufIn.len = bufOut.len = 0; |
687 |
+ |
688 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
689 |
+- (ioc == NULL)) { |
690 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", |
691 |
+- __FILE__, __LINE__, iocnum); |
692 |
+- return -ENODEV; |
693 |
+- } |
694 |
+- |
695 |
+ spin_lock_irqsave(&ioc->taskmgmt_lock, flags); |
696 |
+ if (ioc->ioc_reset_in_progress) { |
697 |
+ spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
698 |
+@@ -2418,17 +2321,15 @@ done_free_mem: |
699 |
+ * -ENOMEM if memory allocation error |
700 |
+ */ |
701 |
+ static int |
702 |
+-mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) |
703 |
++mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) |
704 |
+ { |
705 |
+ hp_host_info_t __user *uarg = (void __user *) arg; |
706 |
+- MPT_ADAPTER *ioc; |
707 |
+ struct pci_dev *pdev; |
708 |
+ char *pbuf=NULL; |
709 |
+ dma_addr_t buf_dma; |
710 |
+ hp_host_info_t karg; |
711 |
+ CONFIGPARMS cfg; |
712 |
+ ConfigPageHeader_t hdr; |
713 |
+- int iocnum; |
714 |
+ int rc, cim_rev; |
715 |
+ ToolboxIstwiReadWriteRequest_t *IstwiRWRequest; |
716 |
+ MPT_FRAME_HDR *mf = NULL; |
717 |
+@@ -2452,12 +2353,6 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) |
718 |
+ return -EFAULT; |
719 |
+ } |
720 |
+ |
721 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
722 |
+- (ioc == NULL)) { |
723 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n", |
724 |
+- __FILE__, __LINE__, iocnum); |
725 |
+- return -ENODEV; |
726 |
+- } |
727 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n", |
728 |
+ ioc->name)); |
729 |
+ |
730 |
+@@ -2670,15 +2565,13 @@ retry_wait: |
731 |
+ * -ENOMEM if memory allocation error |
732 |
+ */ |
733 |
+ static int |
734 |
+-mptctl_hp_targetinfo(unsigned long arg) |
735 |
++mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg) |
736 |
+ { |
737 |
+ hp_target_info_t __user *uarg = (void __user *) arg; |
738 |
+ SCSIDevicePage0_t *pg0_alloc; |
739 |
+ SCSIDevicePage3_t *pg3_alloc; |
740 |
+- MPT_ADAPTER *ioc; |
741 |
+ MPT_SCSI_HOST *hd = NULL; |
742 |
+ hp_target_info_t karg; |
743 |
+- int iocnum; |
744 |
+ int data_sz; |
745 |
+ dma_addr_t page_dma; |
746 |
+ CONFIGPARMS cfg; |
747 |
+@@ -2692,12 +2585,6 @@ mptctl_hp_targetinfo(unsigned long arg) |
748 |
+ return -EFAULT; |
749 |
+ } |
750 |
+ |
751 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
752 |
+- (ioc == NULL)) { |
753 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n", |
754 |
+- __FILE__, __LINE__, iocnum); |
755 |
+- return -ENODEV; |
756 |
+- } |
757 |
+ if (karg.hdr.id >= MPT_MAX_FC_DEVICES) |
758 |
+ return -EINVAL; |
759 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n", |
760 |
+@@ -2865,7 +2752,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd, |
761 |
+ kfw.fwlen = kfw32.fwlen; |
762 |
+ kfw.bufp = compat_ptr(kfw32.bufp); |
763 |
+ |
764 |
+- ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); |
765 |
++ ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen); |
766 |
+ |
767 |
+ mutex_unlock(&iocp->ioctl_cmds.mutex); |
768 |
+ |
769 |
+@@ -2919,7 +2806,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd, |
770 |
+ |
771 |
+ /* Pass new structure to do_mpt_command |
772 |
+ */ |
773 |
+- ret = mptctl_do_mpt_command (karg, &uarg->MF); |
774 |
++ ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); |
775 |
+ |
776 |
+ mutex_unlock(&iocp->ioctl_cmds.mutex); |
777 |
+ |
778 |
+diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
779 |
+index b681c07b33fb..0733745f4be6 100644 |
780 |
+--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
781 |
++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
782 |
+@@ -669,7 +669,6 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data, |
783 |
+ skb = *out_skb = napi_alloc_skb(&ring_data->napi, |
784 |
+ HNS_RX_HEAD_SIZE); |
785 |
+ if (unlikely(!skb)) { |
786 |
+- netdev_err(ndev, "alloc rx skb fail\n"); |
787 |
+ ring->stats.sw_err_cnt++; |
788 |
+ return -ENOMEM; |
789 |
+ } |
790 |
+@@ -1180,7 +1179,6 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget) |
791 |
+ container_of(napi, struct hns_nic_ring_data, napi); |
792 |
+ struct hnae_ring *ring = ring_data->ring; |
793 |
+ |
794 |
+-try_again: |
795 |
+ clean_complete += ring_data->poll_one( |
796 |
+ ring_data, budget - clean_complete, |
797 |
+ ring_data->ex_process); |
798 |
+@@ -1190,7 +1188,7 @@ try_again: |
799 |
+ napi_complete(napi); |
800 |
+ ring->q->handle->dev->ops->toggle_ring_irq(ring, 0); |
801 |
+ } else { |
802 |
+- goto try_again; |
803 |
++ return budget; |
804 |
+ } |
805 |
+ } |
806 |
+ |
807 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h |
808 |
+index efc4a1a8343a..e51b50d94074 100644 |
809 |
+--- a/drivers/net/ethernet/stmicro/stmmac/common.h |
810 |
++++ b/drivers/net/ethernet/stmicro/stmmac/common.h |
811 |
+@@ -338,9 +338,8 @@ struct dma_features { |
812 |
+ unsigned int rx_fifo_size; |
813 |
+ }; |
814 |
+ |
815 |
+-/* GMAC TX FIFO is 8K, Rx FIFO is 16K */ |
816 |
+-#define BUF_SIZE_16KiB 16384 |
817 |
+-/* RX Buffer size must be < 8191 and multiple of 4/8/16 bytes */ |
818 |
++/* RX Buffer size must be multiple of 4/8/16 bytes */ |
819 |
++#define BUF_SIZE_16KiB 16368 |
820 |
+ #define BUF_SIZE_8KiB 8188 |
821 |
+ #define BUF_SIZE_4KiB 4096 |
822 |
+ #define BUF_SIZE_2KiB 2048 |
823 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
824 |
+index e89466bd432d..81d446469a35 100644 |
825 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
826 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
827 |
+@@ -1043,7 +1043,9 @@ static int stmmac_set_bfsize(int mtu, int bufsize) |
828 |
+ { |
829 |
+ int ret = bufsize; |
830 |
+ |
831 |
+- if (mtu >= BUF_SIZE_4KiB) |
832 |
++ if (mtu >= BUF_SIZE_8KiB) |
833 |
++ ret = BUF_SIZE_16KiB; |
834 |
++ else if (mtu >= BUF_SIZE_4KiB) |
835 |
+ ret = BUF_SIZE_8KiB; |
836 |
+ else if (mtu >= BUF_SIZE_2KiB) |
837 |
+ ret = BUF_SIZE_4KiB; |
838 |
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c |
839 |
+index b19557c035f2..aa0bbffe4900 100644 |
840 |
+--- a/drivers/net/hyperv/rndis_filter.c |
841 |
++++ b/drivers/net/hyperv/rndis_filter.c |
842 |
+@@ -1331,8 +1331,6 @@ void rndis_filter_device_remove(struct hv_device *dev, |
843 |
+ /* Halt and release the rndis device */ |
844 |
+ rndis_filter_halt_device(rndis_dev); |
845 |
+ |
846 |
+- net_dev->extension = NULL; |
847 |
+- |
848 |
+ netvsc_device_remove(dev); |
849 |
+ } |
850 |
+ |
851 |
+diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c |
852 |
+index 2b977655834c..ab539136d5bf 100644 |
853 |
+--- a/drivers/net/macvlan.c |
854 |
++++ b/drivers/net/macvlan.c |
855 |
+@@ -263,7 +263,7 @@ static void macvlan_broadcast(struct sk_buff *skb, |
856 |
+ struct net_device *src, |
857 |
+ enum macvlan_mode mode) |
858 |
+ { |
859 |
+- const struct ethhdr *eth = skb_eth_hdr(skb); |
860 |
++ const struct ethhdr *eth = eth_hdr(skb); |
861 |
+ const struct macvlan_dev *vlan; |
862 |
+ struct sk_buff *nskb; |
863 |
+ unsigned int i; |
864 |
+@@ -515,10 +515,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) |
865 |
+ const struct macvlan_dev *dest; |
866 |
+ |
867 |
+ if (vlan->mode == MACVLAN_MODE_BRIDGE) { |
868 |
+- const struct ethhdr *eth = (void *)skb->data; |
869 |
++ const struct ethhdr *eth = skb_eth_hdr(skb); |
870 |
+ |
871 |
+ /* send to other bridge ports directly */ |
872 |
+ if (is_multicast_ether_addr(eth->h_dest)) { |
873 |
++ skb_reset_mac_header(skb); |
874 |
+ macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE); |
875 |
+ goto xmit_world; |
876 |
+ } |
877 |
+diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c |
878 |
+index c23f35dba718..ee7194a9e231 100644 |
879 |
+--- a/drivers/net/usb/lan78xx.c |
880 |
++++ b/drivers/net/usb/lan78xx.c |
881 |
+@@ -3612,6 +3612,7 @@ static int lan78xx_probe(struct usb_interface *intf, |
882 |
+ |
883 |
+ /* MTU range: 68 - 9000 */ |
884 |
+ netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; |
885 |
++ netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); |
886 |
+ |
887 |
+ dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0; |
888 |
+ dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1; |
889 |
+diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c |
890 |
+index 6a86a03c5e95..0083c60f5cdf 100644 |
891 |
+--- a/drivers/net/usb/r8152.c |
892 |
++++ b/drivers/net/usb/r8152.c |
893 |
+@@ -5158,6 +5158,9 @@ static int rtl8152_probe(struct usb_interface *intf, |
894 |
+ return -ENODEV; |
895 |
+ } |
896 |
+ |
897 |
++ if (intf->cur_altsetting->desc.bNumEndpoints < 3) |
898 |
++ return -ENODEV; |
899 |
++ |
900 |
+ usb_reset_device(udev); |
901 |
+ netdev = alloc_etherdev(sizeof(struct r8152)); |
902 |
+ if (!netdev) { |
903 |
+diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c |
904 |
+index 289dff262948..571a1ff8f81f 100644 |
905 |
+--- a/drivers/net/wan/fsl_ucc_hdlc.c |
906 |
++++ b/drivers/net/wan/fsl_ucc_hdlc.c |
907 |
+@@ -76,7 +76,7 @@ static struct ucc_tdm_info utdm_primary_info = { |
908 |
+ }, |
909 |
+ }; |
910 |
+ |
911 |
+-static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM]; |
912 |
++static struct ucc_tdm_info utdm_info[UCC_MAX_NUM]; |
913 |
+ |
914 |
+ static int uhdlc_init(struct ucc_hdlc_private *priv) |
915 |
+ { |
916 |
+diff --git a/drivers/net/wireless/st/cw1200/fwio.c b/drivers/net/wireless/st/cw1200/fwio.c |
917 |
+index 30e7646d04af..16be7fa82a23 100644 |
918 |
+--- a/drivers/net/wireless/st/cw1200/fwio.c |
919 |
++++ b/drivers/net/wireless/st/cw1200/fwio.c |
920 |
+@@ -323,12 +323,12 @@ int cw1200_load_firmware(struct cw1200_common *priv) |
921 |
+ goto out; |
922 |
+ } |
923 |
+ |
924 |
+- priv->hw_type = cw1200_get_hw_type(val32, &major_revision); |
925 |
+- if (priv->hw_type < 0) { |
926 |
++ ret = cw1200_get_hw_type(val32, &major_revision); |
927 |
++ if (ret < 0) { |
928 |
+ pr_err("Can't deduce hardware type.\n"); |
929 |
+- ret = -ENOTSUPP; |
930 |
+ goto out; |
931 |
+ } |
932 |
++ priv->hw_type = ret; |
933 |
+ |
934 |
+ /* Set DPLL Reg value, and read back to confirm writes work */ |
935 |
+ ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID, |
936 |
+diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c |
937 |
+index fcb57d64d97e..a2c9b3f3bc23 100644 |
938 |
+--- a/drivers/nfc/pn533/usb.c |
939 |
++++ b/drivers/nfc/pn533/usb.c |
940 |
+@@ -403,7 +403,7 @@ static int pn533_acr122_poweron_rdr(struct pn533_usb_phy *phy) |
941 |
+ cmd, sizeof(cmd), false); |
942 |
+ |
943 |
+ rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd), |
944 |
+- &transferred, 0); |
945 |
++ &transferred, 5000); |
946 |
+ kfree(buffer); |
947 |
+ if (rc || (transferred != sizeof(cmd))) { |
948 |
+ nfc_err(&phy->udev->dev, |
949 |
+diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c |
950 |
+index b818f65480c1..e232233beb8f 100644 |
951 |
+--- a/drivers/ptp/ptp_clock.c |
952 |
++++ b/drivers/ptp/ptp_clock.c |
953 |
+@@ -179,6 +179,7 @@ static void ptp_clock_release(struct device *dev) |
954 |
+ { |
955 |
+ struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev); |
956 |
+ |
957 |
++ ptp_cleanup_pin_groups(ptp); |
958 |
+ mutex_destroy(&ptp->tsevq_mux); |
959 |
+ mutex_destroy(&ptp->pincfg_mux); |
960 |
+ ida_simple_remove(&ptp_clocks_map, ptp->index); |
961 |
+@@ -315,9 +316,8 @@ int ptp_clock_unregister(struct ptp_clock *ptp) |
962 |
+ if (ptp->pps_source) |
963 |
+ pps_unregister_source(ptp->pps_source); |
964 |
+ |
965 |
+- ptp_cleanup_pin_groups(ptp); |
966 |
+- |
967 |
+ posix_clock_unregister(&ptp->clock); |
968 |
++ |
969 |
+ return 0; |
970 |
+ } |
971 |
+ EXPORT_SYMBOL(ptp_clock_unregister); |
972 |
+diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c |
973 |
+index 03c104b47f31..b832bd0ce202 100644 |
974 |
+--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c |
975 |
++++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c |
976 |
+@@ -915,12 +915,12 @@ void bnx2i_free_hba(struct bnx2i_hba *hba) |
977 |
+ INIT_LIST_HEAD(&hba->ep_ofld_list); |
978 |
+ INIT_LIST_HEAD(&hba->ep_active_list); |
979 |
+ INIT_LIST_HEAD(&hba->ep_destroy_list); |
980 |
+- pci_dev_put(hba->pcidev); |
981 |
+ |
982 |
+ if (hba->regview) { |
983 |
+ pci_iounmap(hba->pcidev, hba->regview); |
984 |
+ hba->regview = NULL; |
985 |
+ } |
986 |
++ pci_dev_put(hba->pcidev); |
987 |
+ bnx2i_free_mp_bdt(hba); |
988 |
+ bnx2i_release_free_cid_que(hba); |
989 |
+ iscsi_host_free(shost); |
990 |
+diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c |
991 |
+index 7bd376d95ed5..b02ac389e6c6 100644 |
992 |
+--- a/drivers/scsi/esas2r/esas2r_flash.c |
993 |
++++ b/drivers/scsi/esas2r/esas2r_flash.c |
994 |
+@@ -1197,6 +1197,7 @@ bool esas2r_nvram_read_direct(struct esas2r_adapter *a) |
995 |
+ if (!esas2r_read_flash_block(a, a->nvram, FLS_OFFSET_NVR, |
996 |
+ sizeof(struct esas2r_sas_nvram))) { |
997 |
+ esas2r_hdebug("NVRAM read failed, using defaults"); |
998 |
++ up(&a->nvram_semaphore); |
999 |
+ return false; |
1000 |
+ } |
1001 |
+ |
1002 |
+diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c |
1003 |
+index ba69d6112fa1..c5b89a003d2a 100644 |
1004 |
+--- a/drivers/scsi/fnic/vnic_dev.c |
1005 |
++++ b/drivers/scsi/fnic/vnic_dev.c |
1006 |
+@@ -445,26 +445,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done) |
1007 |
+ |
1008 |
+ int vnic_dev_hang_notify(struct vnic_dev *vdev) |
1009 |
+ { |
1010 |
+- u64 a0, a1; |
1011 |
++ u64 a0 = 0, a1 = 0; |
1012 |
+ int wait = 1000; |
1013 |
+ return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait); |
1014 |
+ } |
1015 |
+ |
1016 |
+ int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr) |
1017 |
+ { |
1018 |
+- u64 a0, a1; |
1019 |
++ u64 a[2] = {}; |
1020 |
+ int wait = 1000; |
1021 |
+ int err, i; |
1022 |
+ |
1023 |
+ for (i = 0; i < ETH_ALEN; i++) |
1024 |
+ mac_addr[i] = 0; |
1025 |
+ |
1026 |
+- err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait); |
1027 |
++ err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a[0], &a[1], wait); |
1028 |
+ if (err) |
1029 |
+ return err; |
1030 |
+ |
1031 |
+ for (i = 0; i < ETH_ALEN; i++) |
1032 |
+- mac_addr[i] = ((u8 *)&a0)[i]; |
1033 |
++ mac_addr[i] = ((u8 *)&a)[i]; |
1034 |
+ |
1035 |
+ return 0; |
1036 |
+ } |
1037 |
+@@ -489,30 +489,30 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast, |
1038 |
+ |
1039 |
+ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) |
1040 |
+ { |
1041 |
+- u64 a0 = 0, a1 = 0; |
1042 |
++ u64 a[2] = {}; |
1043 |
+ int wait = 1000; |
1044 |
+ int err; |
1045 |
+ int i; |
1046 |
+ |
1047 |
+ for (i = 0; i < ETH_ALEN; i++) |
1048 |
+- ((u8 *)&a0)[i] = addr[i]; |
1049 |
++ ((u8 *)&a)[i] = addr[i]; |
1050 |
+ |
1051 |
+- err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait); |
1052 |
++ err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a[0], &a[1], wait); |
1053 |
+ if (err) |
1054 |
+ pr_err("Can't add addr [%pM], %d\n", addr, err); |
1055 |
+ } |
1056 |
+ |
1057 |
+ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) |
1058 |
+ { |
1059 |
+- u64 a0 = 0, a1 = 0; |
1060 |
++ u64 a[2] = {}; |
1061 |
+ int wait = 1000; |
1062 |
+ int err; |
1063 |
+ int i; |
1064 |
+ |
1065 |
+ for (i = 0; i < ETH_ALEN; i++) |
1066 |
+- ((u8 *)&a0)[i] = addr[i]; |
1067 |
++ ((u8 *)&a)[i] = addr[i]; |
1068 |
+ |
1069 |
+- err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait); |
1070 |
++ err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a[0], &a[1], wait); |
1071 |
+ if (err) |
1072 |
+ pr_err("Can't del addr [%pM], %d\n", addr, err); |
1073 |
+ } |
1074 |
+diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c |
1075 |
+index bd2421863510..a66f7cec797c 100644 |
1076 |
+--- a/drivers/scsi/qla2xxx/qla_init.c |
1077 |
++++ b/drivers/scsi/qla2xxx/qla_init.c |
1078 |
+@@ -5145,8 +5145,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) |
1079 |
+ if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) |
1080 |
+ break; |
1081 |
+ |
1082 |
+- if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 || |
1083 |
+- (fcport->flags & FCF_LOGIN_NEEDED) == 0) |
1084 |
++ if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) |
1085 |
+ continue; |
1086 |
+ |
1087 |
+ if (fcport->scan_state == QLA_FCPORT_SCAN) { |
1088 |
+@@ -5171,7 +5170,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) |
1089 |
+ } |
1090 |
+ } |
1091 |
+ |
1092 |
+- if (fcport->scan_state == QLA_FCPORT_FOUND) |
1093 |
++ if (fcport->scan_state == QLA_FCPORT_FOUND && |
1094 |
++ (fcport->flags & FCF_LOGIN_NEEDED) != 0) |
1095 |
+ qla24xx_fcport_handle_login(vha, fcport); |
1096 |
+ } |
1097 |
+ return (rval); |
1098 |
+diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c |
1099 |
+index 7f2da56274bd..648916a9082c 100644 |
1100 |
+--- a/drivers/scsi/qla2xxx/qla_isr.c |
1101 |
++++ b/drivers/scsi/qla2xxx/qla_isr.c |
1102 |
+@@ -3519,7 +3519,7 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp) |
1103 |
+ skip_msix: |
1104 |
+ |
1105 |
+ ql_log(ql_log_info, vha, 0x0037, |
1106 |
+- "Falling back-to MSI mode -%d.\n", ret); |
1107 |
++ "Falling back-to MSI mode -- ret=%d.\n", ret); |
1108 |
+ |
1109 |
+ if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) && |
1110 |
+ !IS_QLA8001(ha) && !IS_P3P_TYPE(ha) && !IS_QLAFX00(ha) && |
1111 |
+@@ -3527,13 +3527,13 @@ skip_msix: |
1112 |
+ goto skip_msi; |
1113 |
+ |
1114 |
+ ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI); |
1115 |
+- if (!ret) { |
1116 |
++ if (ret > 0) { |
1117 |
+ ql_dbg(ql_dbg_init, vha, 0x0038, |
1118 |
+ "MSI: Enabled.\n"); |
1119 |
+ ha->flags.msi_enabled = 1; |
1120 |
+ } else |
1121 |
+ ql_log(ql_log_warn, vha, 0x0039, |
1122 |
+- "Falling back-to INTa mode -- %d.\n", ret); |
1123 |
++ "Falling back-to INTa mode -- ret=%d.\n", ret); |
1124 |
+ skip_msi: |
1125 |
+ |
1126 |
+ /* Skip INTx on ISP82xx. */ |
1127 |
+diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c |
1128 |
+index 1da04f323d38..c402fc583da3 100644 |
1129 |
+--- a/drivers/scsi/qla4xxx/ql4_mbx.c |
1130 |
++++ b/drivers/scsi/qla4xxx/ql4_mbx.c |
1131 |
+@@ -641,9 +641,6 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha) |
1132 |
+ |
1133 |
+ if (qla4xxx_get_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) != |
1134 |
+ QLA_SUCCESS) { |
1135 |
+- dma_free_coherent(&ha->pdev->dev, |
1136 |
+- sizeof(struct addr_ctrl_blk), |
1137 |
+- init_fw_cb, init_fw_cb_dma); |
1138 |
+ goto exit_init_fw_cb; |
1139 |
+ } |
1140 |
+ |
1141 |
+diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_trace.c |
1142 |
+index 617a60737590..22472d140ef7 100644 |
1143 |
+--- a/drivers/scsi/scsi_trace.c |
1144 |
++++ b/drivers/scsi/scsi_trace.c |
1145 |
+@@ -21,7 +21,7 @@ |
1146 |
+ #include <trace/events/scsi.h> |
1147 |
+ |
1148 |
+ #define SERVICE_ACTION16(cdb) (cdb[1] & 0x1f) |
1149 |
+-#define SERVICE_ACTION32(cdb) ((cdb[8] << 8) | cdb[9]) |
1150 |
++#define SERVICE_ACTION32(cdb) (get_unaligned_be16(&cdb[8])) |
1151 |
+ |
1152 |
+ static const char * |
1153 |
+ scsi_trace_misc(struct trace_seq *, unsigned char *, int); |
1154 |
+@@ -51,17 +51,12 @@ static const char * |
1155 |
+ scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len) |
1156 |
+ { |
1157 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1158 |
+- sector_t lba = 0, txlen = 0; |
1159 |
++ u32 lba, txlen; |
1160 |
+ |
1161 |
+- lba |= (cdb[2] << 24); |
1162 |
+- lba |= (cdb[3] << 16); |
1163 |
+- lba |= (cdb[4] << 8); |
1164 |
+- lba |= cdb[5]; |
1165 |
+- txlen |= (cdb[7] << 8); |
1166 |
+- txlen |= cdb[8]; |
1167 |
++ lba = get_unaligned_be32(&cdb[2]); |
1168 |
++ txlen = get_unaligned_be16(&cdb[7]); |
1169 |
+ |
1170 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1171 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1172 |
++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen, |
1173 |
+ cdb[1] >> 5); |
1174 |
+ |
1175 |
+ if (cdb[0] == WRITE_SAME) |
1176 |
+@@ -76,19 +71,12 @@ static const char * |
1177 |
+ scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len) |
1178 |
+ { |
1179 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1180 |
+- sector_t lba = 0, txlen = 0; |
1181 |
+- |
1182 |
+- lba |= (cdb[2] << 24); |
1183 |
+- lba |= (cdb[3] << 16); |
1184 |
+- lba |= (cdb[4] << 8); |
1185 |
+- lba |= cdb[5]; |
1186 |
+- txlen |= (cdb[6] << 24); |
1187 |
+- txlen |= (cdb[7] << 16); |
1188 |
+- txlen |= (cdb[8] << 8); |
1189 |
+- txlen |= cdb[9]; |
1190 |
+- |
1191 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1192 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1193 |
++ u32 lba, txlen; |
1194 |
++ |
1195 |
++ lba = get_unaligned_be32(&cdb[2]); |
1196 |
++ txlen = get_unaligned_be32(&cdb[6]); |
1197 |
++ |
1198 |
++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen, |
1199 |
+ cdb[1] >> 5); |
1200 |
+ trace_seq_putc(p, 0); |
1201 |
+ |
1202 |
+@@ -99,23 +87,13 @@ static const char * |
1203 |
+ scsi_trace_rw16(struct trace_seq *p, unsigned char *cdb, int len) |
1204 |
+ { |
1205 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1206 |
+- sector_t lba = 0, txlen = 0; |
1207 |
+- |
1208 |
+- lba |= ((u64)cdb[2] << 56); |
1209 |
+- lba |= ((u64)cdb[3] << 48); |
1210 |
+- lba |= ((u64)cdb[4] << 40); |
1211 |
+- lba |= ((u64)cdb[5] << 32); |
1212 |
+- lba |= (cdb[6] << 24); |
1213 |
+- lba |= (cdb[7] << 16); |
1214 |
+- lba |= (cdb[8] << 8); |
1215 |
+- lba |= cdb[9]; |
1216 |
+- txlen |= (cdb[10] << 24); |
1217 |
+- txlen |= (cdb[11] << 16); |
1218 |
+- txlen |= (cdb[12] << 8); |
1219 |
+- txlen |= cdb[13]; |
1220 |
+- |
1221 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1222 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1223 |
++ u64 lba; |
1224 |
++ u32 txlen; |
1225 |
++ |
1226 |
++ lba = get_unaligned_be64(&cdb[2]); |
1227 |
++ txlen = get_unaligned_be32(&cdb[10]); |
1228 |
++ |
1229 |
++ trace_seq_printf(p, "lba=%llu txlen=%u protect=%u", lba, txlen, |
1230 |
+ cdb[1] >> 5); |
1231 |
+ |
1232 |
+ if (cdb[0] == WRITE_SAME_16) |
1233 |
+@@ -130,8 +108,8 @@ static const char * |
1234 |
+ scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) |
1235 |
+ { |
1236 |
+ const char *ret = trace_seq_buffer_ptr(p), *cmd; |
1237 |
+- sector_t lba = 0, txlen = 0; |
1238 |
+- u32 ei_lbrt = 0; |
1239 |
++ u64 lba; |
1240 |
++ u32 ei_lbrt, txlen; |
1241 |
+ |
1242 |
+ switch (SERVICE_ACTION32(cdb)) { |
1243 |
+ case READ_32: |
1244 |
+@@ -151,26 +129,12 @@ scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) |
1245 |
+ goto out; |
1246 |
+ } |
1247 |
+ |
1248 |
+- lba |= ((u64)cdb[12] << 56); |
1249 |
+- lba |= ((u64)cdb[13] << 48); |
1250 |
+- lba |= ((u64)cdb[14] << 40); |
1251 |
+- lba |= ((u64)cdb[15] << 32); |
1252 |
+- lba |= (cdb[16] << 24); |
1253 |
+- lba |= (cdb[17] << 16); |
1254 |
+- lba |= (cdb[18] << 8); |
1255 |
+- lba |= cdb[19]; |
1256 |
+- ei_lbrt |= (cdb[20] << 24); |
1257 |
+- ei_lbrt |= (cdb[21] << 16); |
1258 |
+- ei_lbrt |= (cdb[22] << 8); |
1259 |
+- ei_lbrt |= cdb[23]; |
1260 |
+- txlen |= (cdb[28] << 24); |
1261 |
+- txlen |= (cdb[29] << 16); |
1262 |
+- txlen |= (cdb[30] << 8); |
1263 |
+- txlen |= cdb[31]; |
1264 |
+- |
1265 |
+- trace_seq_printf(p, "%s_32 lba=%llu txlen=%llu protect=%u ei_lbrt=%u", |
1266 |
+- cmd, (unsigned long long)lba, |
1267 |
+- (unsigned long long)txlen, cdb[10] >> 5, ei_lbrt); |
1268 |
++ lba = get_unaligned_be64(&cdb[12]); |
1269 |
++ ei_lbrt = get_unaligned_be32(&cdb[20]); |
1270 |
++ txlen = get_unaligned_be32(&cdb[28]); |
1271 |
++ |
1272 |
++ trace_seq_printf(p, "%s_32 lba=%llu txlen=%u protect=%u ei_lbrt=%u", |
1273 |
++ cmd, lba, txlen, cdb[10] >> 5, ei_lbrt); |
1274 |
+ |
1275 |
+ if (SERVICE_ACTION32(cdb) == WRITE_SAME_32) |
1276 |
+ trace_seq_printf(p, " unmap=%u", cdb[10] >> 3 & 1); |
1277 |
+@@ -185,7 +149,7 @@ static const char * |
1278 |
+ scsi_trace_unmap(struct trace_seq *p, unsigned char *cdb, int len) |
1279 |
+ { |
1280 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1281 |
+- unsigned int regions = cdb[7] << 8 | cdb[8]; |
1282 |
++ unsigned int regions = get_unaligned_be16(&cdb[7]); |
1283 |
+ |
1284 |
+ trace_seq_printf(p, "regions=%u", (regions - 8) / 16); |
1285 |
+ trace_seq_putc(p, 0); |
1286 |
+@@ -197,8 +161,8 @@ static const char * |
1287 |
+ scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len) |
1288 |
+ { |
1289 |
+ const char *ret = trace_seq_buffer_ptr(p), *cmd; |
1290 |
+- sector_t lba = 0; |
1291 |
+- u32 alloc_len = 0; |
1292 |
++ u64 lba; |
1293 |
++ u32 alloc_len; |
1294 |
+ |
1295 |
+ switch (SERVICE_ACTION16(cdb)) { |
1296 |
+ case SAI_READ_CAPACITY_16: |
1297 |
+@@ -212,21 +176,10 @@ scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len) |
1298 |
+ goto out; |
1299 |
+ } |
1300 |
+ |
1301 |
+- lba |= ((u64)cdb[2] << 56); |
1302 |
+- lba |= ((u64)cdb[3] << 48); |
1303 |
+- lba |= ((u64)cdb[4] << 40); |
1304 |
+- lba |= ((u64)cdb[5] << 32); |
1305 |
+- lba |= (cdb[6] << 24); |
1306 |
+- lba |= (cdb[7] << 16); |
1307 |
+- lba |= (cdb[8] << 8); |
1308 |
+- lba |= cdb[9]; |
1309 |
+- alloc_len |= (cdb[10] << 24); |
1310 |
+- alloc_len |= (cdb[11] << 16); |
1311 |
+- alloc_len |= (cdb[12] << 8); |
1312 |
+- alloc_len |= cdb[13]; |
1313 |
+- |
1314 |
+- trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd, |
1315 |
+- (unsigned long long)lba, alloc_len); |
1316 |
++ lba = get_unaligned_be64(&cdb[2]); |
1317 |
++ alloc_len = get_unaligned_be32(&cdb[10]); |
1318 |
++ |
1319 |
++ trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd, lba, alloc_len); |
1320 |
+ |
1321 |
+ out: |
1322 |
+ trace_seq_putc(p, 0); |
1323 |
+diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c |
1324 |
+index 508da345b73f..95aa47ac4dcd 100644 |
1325 |
+--- a/drivers/target/target_core_fabric_lib.c |
1326 |
++++ b/drivers/target/target_core_fabric_lib.c |
1327 |
+@@ -131,7 +131,7 @@ static int srp_get_pr_transport_id( |
1328 |
+ memset(buf + 8, 0, leading_zero_bytes); |
1329 |
+ rc = hex2bin(buf + 8 + leading_zero_bytes, p, count); |
1330 |
+ if (rc < 0) { |
1331 |
+- pr_debug("hex2bin failed for %s: %d\n", __func__, rc); |
1332 |
++ pr_debug("hex2bin failed for %s: %d\n", p, rc); |
1333 |
+ return rc; |
1334 |
+ } |
1335 |
+ |
1336 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
1337 |
+index 4efccf8bf99f..7d5ecf36a33c 100644 |
1338 |
+--- a/drivers/usb/core/hub.c |
1339 |
++++ b/drivers/usb/core/hub.c |
1340 |
+@@ -1164,6 +1164,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) |
1341 |
+ * PORT_OVER_CURRENT is not. So check for any of them. |
1342 |
+ */ |
1343 |
+ if (udev || (portstatus & USB_PORT_STAT_CONNECTION) || |
1344 |
++ (portchange & USB_PORT_STAT_C_CONNECTION) || |
1345 |
+ (portstatus & USB_PORT_STAT_OVERCURRENT) || |
1346 |
+ (portchange & USB_PORT_STAT_C_OVERCURRENT)) |
1347 |
+ set_bit(port1, hub->change_bits); |
1348 |
+diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c |
1349 |
+index 578596d301b8..31cd798d2dac 100644 |
1350 |
+--- a/drivers/usb/serial/ch341.c |
1351 |
++++ b/drivers/usb/serial/ch341.c |
1352 |
+@@ -592,9 +592,13 @@ static int ch341_tiocmget(struct tty_struct *tty) |
1353 |
+ static int ch341_reset_resume(struct usb_serial *serial) |
1354 |
+ { |
1355 |
+ struct usb_serial_port *port = serial->port[0]; |
1356 |
+- struct ch341_private *priv = usb_get_serial_port_data(port); |
1357 |
++ struct ch341_private *priv; |
1358 |
+ int ret; |
1359 |
+ |
1360 |
++ priv = usb_get_serial_port_data(port); |
1361 |
++ if (!priv) |
1362 |
++ return 0; |
1363 |
++ |
1364 |
+ /* reconfigure ch341 serial port after bus-reset */ |
1365 |
+ ch341_configure(serial->dev, priv); |
1366 |
+ |
1367 |
+diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c |
1368 |
+index 51b61545ccf2..3705b64ab948 100644 |
1369 |
+--- a/drivers/usb/serial/io_edgeport.c |
1370 |
++++ b/drivers/usb/serial/io_edgeport.c |
1371 |
+@@ -652,6 +652,7 @@ static void edge_interrupt_callback(struct urb *urb) |
1372 |
+ struct usb_serial_port *port; |
1373 |
+ unsigned char *data = urb->transfer_buffer; |
1374 |
+ int length = urb->actual_length; |
1375 |
++ unsigned long flags; |
1376 |
+ int bytes_avail; |
1377 |
+ int position; |
1378 |
+ int txCredits; |
1379 |
+@@ -683,7 +684,7 @@ static void edge_interrupt_callback(struct urb *urb) |
1380 |
+ if (length > 1) { |
1381 |
+ bytes_avail = data[0] | (data[1] << 8); |
1382 |
+ if (bytes_avail) { |
1383 |
+- spin_lock(&edge_serial->es_lock); |
1384 |
++ spin_lock_irqsave(&edge_serial->es_lock, flags); |
1385 |
+ edge_serial->rxBytesAvail += bytes_avail; |
1386 |
+ dev_dbg(dev, |
1387 |
+ "%s - bytes_avail=%d, rxBytesAvail=%d, read_in_progress=%d\n", |
1388 |
+@@ -706,7 +707,8 @@ static void edge_interrupt_callback(struct urb *urb) |
1389 |
+ edge_serial->read_in_progress = false; |
1390 |
+ } |
1391 |
+ } |
1392 |
+- spin_unlock(&edge_serial->es_lock); |
1393 |
++ spin_unlock_irqrestore(&edge_serial->es_lock, |
1394 |
++ flags); |
1395 |
+ } |
1396 |
+ } |
1397 |
+ /* grab the txcredits for the ports if available */ |
1398 |
+@@ -718,10 +720,12 @@ static void edge_interrupt_callback(struct urb *urb) |
1399 |
+ if (txCredits) { |
1400 |
+ port = edge_serial->serial->port[portNumber]; |
1401 |
+ edge_port = usb_get_serial_port_data(port); |
1402 |
+- if (edge_port->open) { |
1403 |
+- spin_lock(&edge_port->ep_lock); |
1404 |
++ if (edge_port && edge_port->open) { |
1405 |
++ spin_lock_irqsave(&edge_port->ep_lock, |
1406 |
++ flags); |
1407 |
+ edge_port->txCredits += txCredits; |
1408 |
+- spin_unlock(&edge_port->ep_lock); |
1409 |
++ spin_unlock_irqrestore(&edge_port->ep_lock, |
1410 |
++ flags); |
1411 |
+ dev_dbg(dev, "%s - txcredits for port%d = %d\n", |
1412 |
+ __func__, portNumber, |
1413 |
+ edge_port->txCredits); |
1414 |
+@@ -762,6 +766,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
1415 |
+ int retval; |
1416 |
+ __u16 raw_data_length; |
1417 |
+ int status = urb->status; |
1418 |
++ unsigned long flags; |
1419 |
+ |
1420 |
+ if (status) { |
1421 |
+ dev_dbg(&urb->dev->dev, "%s - nonzero read bulk status received: %d\n", |
1422 |
+@@ -781,7 +786,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
1423 |
+ |
1424 |
+ usb_serial_debug_data(dev, __func__, raw_data_length, data); |
1425 |
+ |
1426 |
+- spin_lock(&edge_serial->es_lock); |
1427 |
++ spin_lock_irqsave(&edge_serial->es_lock, flags); |
1428 |
+ |
1429 |
+ /* decrement our rxBytes available by the number that we just got */ |
1430 |
+ edge_serial->rxBytesAvail -= raw_data_length; |
1431 |
+@@ -805,7 +810,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
1432 |
+ edge_serial->read_in_progress = false; |
1433 |
+ } |
1434 |
+ |
1435 |
+- spin_unlock(&edge_serial->es_lock); |
1436 |
++ spin_unlock_irqrestore(&edge_serial->es_lock, flags); |
1437 |
+ } |
1438 |
+ |
1439 |
+ |
1440 |
+@@ -1733,7 +1738,8 @@ static void edge_break(struct tty_struct *tty, int break_state) |
1441 |
+ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
1442 |
+ unsigned char *buffer, __u16 bufferLength) |
1443 |
+ { |
1444 |
+- struct device *dev = &edge_serial->serial->dev->dev; |
1445 |
++ struct usb_serial *serial = edge_serial->serial; |
1446 |
++ struct device *dev = &serial->dev->dev; |
1447 |
+ struct usb_serial_port *port; |
1448 |
+ struct edgeport_port *edge_port; |
1449 |
+ __u16 lastBufferLength; |
1450 |
+@@ -1838,11 +1844,10 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
1451 |
+ |
1452 |
+ /* spit this data back into the tty driver if this |
1453 |
+ port is open */ |
1454 |
+- if (rxLen) { |
1455 |
+- port = edge_serial->serial->port[ |
1456 |
+- edge_serial->rxPort]; |
1457 |
++ if (rxLen && edge_serial->rxPort < serial->num_ports) { |
1458 |
++ port = serial->port[edge_serial->rxPort]; |
1459 |
+ edge_port = usb_get_serial_port_data(port); |
1460 |
+- if (edge_port->open) { |
1461 |
++ if (edge_port && edge_port->open) { |
1462 |
+ dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", |
1463 |
+ __func__, rxLen, |
1464 |
+ edge_serial->rxPort); |
1465 |
+@@ -1850,8 +1855,8 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
1466 |
+ rxLen); |
1467 |
+ edge_port->port->icount.rx += rxLen; |
1468 |
+ } |
1469 |
+- buffer += rxLen; |
1470 |
+ } |
1471 |
++ buffer += rxLen; |
1472 |
+ break; |
1473 |
+ |
1474 |
+ case EXPECT_HDR3: /* Expect 3rd byte of status header */ |
1475 |
+@@ -1886,6 +1891,8 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial, |
1476 |
+ __u8 code = edge_serial->rxStatusCode; |
1477 |
+ |
1478 |
+ /* switch the port pointer to the one being currently talked about */ |
1479 |
++ if (edge_serial->rxPort >= edge_serial->serial->num_ports) |
1480 |
++ return; |
1481 |
+ port = edge_serial->serial->port[edge_serial->rxPort]; |
1482 |
+ edge_port = usb_get_serial_port_data(port); |
1483 |
+ if (edge_port == NULL) { |
1484 |
+diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c |
1485 |
+index 2c5a53bdccd4..55a768487990 100644 |
1486 |
+--- a/drivers/usb/serial/keyspan.c |
1487 |
++++ b/drivers/usb/serial/keyspan.c |
1488 |
+@@ -1062,6 +1062,8 @@ static void usa49_glocont_callback(struct urb *urb) |
1489 |
+ for (i = 0; i < serial->num_ports; ++i) { |
1490 |
+ port = serial->port[i]; |
1491 |
+ p_priv = usb_get_serial_port_data(port); |
1492 |
++ if (!p_priv) |
1493 |
++ continue; |
1494 |
+ |
1495 |
+ if (p_priv->resend_cont) { |
1496 |
+ dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
1497 |
+@@ -1463,6 +1465,8 @@ static void usa67_glocont_callback(struct urb *urb) |
1498 |
+ for (i = 0; i < serial->num_ports; ++i) { |
1499 |
+ port = serial->port[i]; |
1500 |
+ p_priv = usb_get_serial_port_data(port); |
1501 |
++ if (!p_priv) |
1502 |
++ continue; |
1503 |
+ |
1504 |
+ if (p_priv->resend_cont) { |
1505 |
+ dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
1506 |
+diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c |
1507 |
+index 58657d64678b..c37572a8bb06 100644 |
1508 |
+--- a/drivers/usb/serial/opticon.c |
1509 |
++++ b/drivers/usb/serial/opticon.c |
1510 |
+@@ -116,7 +116,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, |
1511 |
+ retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
1512 |
+ requesttype, |
1513 |
+ USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE, |
1514 |
+- 0, 0, buffer, 1, 0); |
1515 |
++ 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT); |
1516 |
+ kfree(buffer); |
1517 |
+ |
1518 |
+ if (retval < 0) |
1519 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1520 |
+index e69e31539914..eff353de47cd 100644 |
1521 |
+--- a/drivers/usb/serial/option.c |
1522 |
++++ b/drivers/usb/serial/option.c |
1523 |
+@@ -251,6 +251,7 @@ static void option_instat_callback(struct urb *urb); |
1524 |
+ #define QUECTEL_PRODUCT_BG96 0x0296 |
1525 |
+ #define QUECTEL_PRODUCT_EP06 0x0306 |
1526 |
+ #define QUECTEL_PRODUCT_EM12 0x0512 |
1527 |
++#define QUECTEL_PRODUCT_RM500Q 0x0800 |
1528 |
+ |
1529 |
+ #define CMOTECH_VENDOR_ID 0x16d8 |
1530 |
+ #define CMOTECH_PRODUCT_6001 0x6001 |
1531 |
+@@ -1107,6 +1108,11 @@ static const struct usb_device_id option_ids[] = { |
1532 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff), |
1533 |
+ .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, |
1534 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) }, |
1535 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) }, |
1536 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, |
1537 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), |
1538 |
++ .driver_info = ZLP }, |
1539 |
++ |
1540 |
+ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, |
1541 |
+ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, |
1542 |
+ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), |
1543 |
+diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c |
1544 |
+index 60e17d1444c3..f16e0b8c1ed4 100644 |
1545 |
+--- a/drivers/usb/serial/quatech2.c |
1546 |
++++ b/drivers/usb/serial/quatech2.c |
1547 |
+@@ -867,7 +867,10 @@ static void qt2_update_msr(struct usb_serial_port *port, unsigned char *ch) |
1548 |
+ u8 newMSR = (u8) *ch; |
1549 |
+ unsigned long flags; |
1550 |
+ |
1551 |
++ /* May be called from qt2_process_read_urb() for an unbound port. */ |
1552 |
+ port_priv = usb_get_serial_port_data(port); |
1553 |
++ if (!port_priv) |
1554 |
++ return; |
1555 |
+ |
1556 |
+ spin_lock_irqsave(&port_priv->lock, flags); |
1557 |
+ port_priv->shadowMSR = newMSR; |
1558 |
+@@ -895,7 +898,10 @@ static void qt2_update_lsr(struct usb_serial_port *port, unsigned char *ch) |
1559 |
+ unsigned long flags; |
1560 |
+ u8 newLSR = (u8) *ch; |
1561 |
+ |
1562 |
++ /* May be called from qt2_process_read_urb() for an unbound port. */ |
1563 |
+ port_priv = usb_get_serial_port_data(port); |
1564 |
++ if (!port_priv) |
1565 |
++ return; |
1566 |
+ |
1567 |
+ if (newLSR & UART_LSR_BI) |
1568 |
+ newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI); |
1569 |
+diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c |
1570 |
+index 511242111403..15e05ebf37ac 100644 |
1571 |
+--- a/drivers/usb/serial/usb-serial-simple.c |
1572 |
++++ b/drivers/usb/serial/usb-serial-simple.c |
1573 |
+@@ -89,6 +89,8 @@ DEVICE(moto_modem, MOTO_IDS); |
1574 |
+ #define MOTOROLA_TETRA_IDS() \ |
1575 |
+ { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \ |
1576 |
+ { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \ |
1577 |
++ { USB_DEVICE(0x0cad, 0x9013) }, /* MTP3xxx */ \ |
1578 |
++ { USB_DEVICE(0x0cad, 0x9015) }, /* MTP85xx */ \ |
1579 |
+ { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */ |
1580 |
+ DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS); |
1581 |
+ |
1582 |
+diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c |
1583 |
+index 8115b7cccf1a..3dc3464626fb 100644 |
1584 |
+--- a/drivers/usb/serial/usb-serial.c |
1585 |
++++ b/drivers/usb/serial/usb-serial.c |
1586 |
+@@ -1332,6 +1332,9 @@ static int usb_serial_register(struct usb_serial_driver *driver) |
1587 |
+ return -EINVAL; |
1588 |
+ } |
1589 |
+ |
1590 |
++ /* Prevent individual ports from being unbound. */ |
1591 |
++ driver->driver.suppress_bind_attrs = true; |
1592 |
++ |
1593 |
+ usb_serial_operations_init(driver); |
1594 |
+ |
1595 |
+ /* Add this device to our list of devices */ |
1596 |
+diff --git a/firmware/Makefile b/firmware/Makefile |
1597 |
+index 168094a3fae7..30e6b738839e 100644 |
1598 |
+--- a/firmware/Makefile |
1599 |
++++ b/firmware/Makefile |
1600 |
+@@ -19,7 +19,7 @@ quiet_cmd_fwbin = MK_FW $@ |
1601 |
+ PROGBITS=$(if $(CONFIG_ARM),%,@)progbits; \ |
1602 |
+ echo "/* Generated by firmware/Makefile */" > $@;\ |
1603 |
+ echo " .section .rodata" >>$@;\ |
1604 |
+- echo " .p2align $${ASM_ALIGN}" >>$@;\ |
1605 |
++ echo " .p2align 4" >>$@;\ |
1606 |
+ echo "_fw_$${FWSTR}_bin:" >>$@;\ |
1607 |
+ echo " .incbin \"$(2)\"" >>$@;\ |
1608 |
+ echo "_fw_end:" >>$@;\ |
1609 |
+diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c |
1610 |
+index cb6e8cb0de94..39a00b57ff01 100644 |
1611 |
+--- a/fs/btrfs/qgroup.c |
1612 |
++++ b/fs/btrfs/qgroup.c |
1613 |
+@@ -1928,8 +1928,12 @@ btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, |
1614 |
+ u64 nr_old_roots = 0; |
1615 |
+ int ret = 0; |
1616 |
+ |
1617 |
++ /* |
1618 |
++ * If quotas get disabled meanwhile, the resouces need to be freed and |
1619 |
++ * we can't just exit here. |
1620 |
++ */ |
1621 |
+ if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) |
1622 |
+- return 0; |
1623 |
++ goto out_free; |
1624 |
+ |
1625 |
+ if (new_roots) { |
1626 |
+ if (!maybe_fs_roots(new_roots)) |
1627 |
+diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c |
1628 |
+index 29a0c0969e91..28f6daf371d3 100644 |
1629 |
+--- a/fs/reiserfs/xattr.c |
1630 |
++++ b/fs/reiserfs/xattr.c |
1631 |
+@@ -319,8 +319,12 @@ static int reiserfs_for_each_xattr(struct inode *inode, |
1632 |
+ out_dir: |
1633 |
+ dput(dir); |
1634 |
+ out: |
1635 |
+- /* -ENODATA isn't an error */ |
1636 |
+- if (err == -ENODATA) |
1637 |
++ /* |
1638 |
++ * -ENODATA: this object doesn't have any xattrs |
1639 |
++ * -EOPNOTSUPP: this file system doesn't have xattrs enabled on disk. |
1640 |
++ * Neither are errors |
1641 |
++ */ |
1642 |
++ if (err == -ENODATA || err == -EOPNOTSUPP) |
1643 |
+ err = 0; |
1644 |
+ return err; |
1645 |
+ } |
1646 |
+diff --git a/include/dt-bindings/reset/amlogic,meson8b-reset.h b/include/dt-bindings/reset/amlogic,meson8b-reset.h |
1647 |
+index 614aff2c7aff..a03e86fe2c57 100644 |
1648 |
+--- a/include/dt-bindings/reset/amlogic,meson8b-reset.h |
1649 |
++++ b/include/dt-bindings/reset/amlogic,meson8b-reset.h |
1650 |
+@@ -95,9 +95,9 @@ |
1651 |
+ #define RESET_VD_RMEM 64 |
1652 |
+ #define RESET_AUDIN 65 |
1653 |
+ #define RESET_DBLK 66 |
1654 |
+-#define RESET_PIC_DC 66 |
1655 |
+-#define RESET_PSC 66 |
1656 |
+-#define RESET_NAND 66 |
1657 |
++#define RESET_PIC_DC 67 |
1658 |
++#define RESET_PSC 68 |
1659 |
++#define RESET_NAND 69 |
1660 |
+ #define RESET_GE2D 70 |
1661 |
+ #define RESET_PARSER_REG 71 |
1662 |
+ #define RESET_PARSER_FETCH 72 |
1663 |
+diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h |
1664 |
+index 4d4af0e94059..ad940102451c 100644 |
1665 |
+--- a/include/linux/blkdev.h |
1666 |
++++ b/include/linux/blkdev.h |
1667 |
+@@ -343,6 +343,7 @@ struct queue_limits { |
1668 |
+ unsigned int max_sectors; |
1669 |
+ unsigned int max_segment_size; |
1670 |
+ unsigned int physical_block_size; |
1671 |
++ unsigned int logical_block_size; |
1672 |
+ unsigned int alignment_offset; |
1673 |
+ unsigned int io_min; |
1674 |
+ unsigned int io_opt; |
1675 |
+@@ -353,7 +354,6 @@ struct queue_limits { |
1676 |
+ unsigned int discard_granularity; |
1677 |
+ unsigned int discard_alignment; |
1678 |
+ |
1679 |
+- unsigned short logical_block_size; |
1680 |
+ unsigned short max_segments; |
1681 |
+ unsigned short max_integrity_segments; |
1682 |
+ unsigned short max_discard_segments; |
1683 |
+@@ -1178,7 +1178,7 @@ extern void blk_queue_max_write_same_sectors(struct request_queue *q, |
1684 |
+ unsigned int max_write_same_sectors); |
1685 |
+ extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q, |
1686 |
+ unsigned int max_write_same_sectors); |
1687 |
+-extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); |
1688 |
++extern void blk_queue_logical_block_size(struct request_queue *, unsigned int); |
1689 |
+ extern void blk_queue_physical_block_size(struct request_queue *, unsigned int); |
1690 |
+ extern void blk_queue_alignment_offset(struct request_queue *q, |
1691 |
+ unsigned int alignment); |
1692 |
+@@ -1436,7 +1436,7 @@ static inline unsigned int queue_max_segment_size(struct request_queue *q) |
1693 |
+ return q->limits.max_segment_size; |
1694 |
+ } |
1695 |
+ |
1696 |
+-static inline unsigned short queue_logical_block_size(struct request_queue *q) |
1697 |
++static inline unsigned queue_logical_block_size(struct request_queue *q) |
1698 |
+ { |
1699 |
+ int retval = 512; |
1700 |
+ |
1701 |
+@@ -1446,7 +1446,7 @@ static inline unsigned short queue_logical_block_size(struct request_queue *q) |
1702 |
+ return retval; |
1703 |
+ } |
1704 |
+ |
1705 |
+-static inline unsigned short bdev_logical_block_size(struct block_device *bdev) |
1706 |
++static inline unsigned int bdev_logical_block_size(struct block_device *bdev) |
1707 |
+ { |
1708 |
+ return queue_logical_block_size(bdev_get_queue(bdev)); |
1709 |
+ } |
1710 |
+diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h |
1711 |
+index 260c4aa1d976..3f6b8b9ef49d 100644 |
1712 |
+--- a/include/linux/regulator/ab8500.h |
1713 |
++++ b/include/linux/regulator/ab8500.h |
1714 |
+@@ -43,8 +43,6 @@ enum ab8505_regulator_id { |
1715 |
+ AB8505_LDO_ANAMIC2, |
1716 |
+ AB8505_LDO_AUX8, |
1717 |
+ AB8505_LDO_ANA, |
1718 |
+- AB8505_SYSCLKREQ_2, |
1719 |
+- AB8505_SYSCLKREQ_4, |
1720 |
+ AB8505_NUM_REGULATORS, |
1721 |
+ }; |
1722 |
+ |
1723 |
+diff --git a/kernel/ptrace.c b/kernel/ptrace.c |
1724 |
+index 09fb3f58a838..43a283041296 100644 |
1725 |
+--- a/kernel/ptrace.c |
1726 |
++++ b/kernel/ptrace.c |
1727 |
+@@ -258,12 +258,17 @@ static int ptrace_check_attach(struct task_struct *child, bool ignore_state) |
1728 |
+ return ret; |
1729 |
+ } |
1730 |
+ |
1731 |
+-static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode) |
1732 |
++static bool ptrace_has_cap(const struct cred *cred, struct user_namespace *ns, |
1733 |
++ unsigned int mode) |
1734 |
+ { |
1735 |
++ int ret; |
1736 |
++ |
1737 |
+ if (mode & PTRACE_MODE_NOAUDIT) |
1738 |
+- return has_ns_capability_noaudit(current, ns, CAP_SYS_PTRACE); |
1739 |
++ ret = security_capable(cred, ns, CAP_SYS_PTRACE); |
1740 |
+ else |
1741 |
+- return has_ns_capability(current, ns, CAP_SYS_PTRACE); |
1742 |
++ ret = security_capable(cred, ns, CAP_SYS_PTRACE); |
1743 |
++ |
1744 |
++ return ret == 0; |
1745 |
+ } |
1746 |
+ |
1747 |
+ /* Returns 0 on success, -errno on denial. */ |
1748 |
+@@ -315,7 +320,7 @@ static int __ptrace_may_access(struct task_struct *task, unsigned int mode) |
1749 |
+ gid_eq(caller_gid, tcred->sgid) && |
1750 |
+ gid_eq(caller_gid, tcred->gid)) |
1751 |
+ goto ok; |
1752 |
+- if (ptrace_has_cap(tcred->user_ns, mode)) |
1753 |
++ if (ptrace_has_cap(cred, tcred->user_ns, mode)) |
1754 |
+ goto ok; |
1755 |
+ rcu_read_unlock(); |
1756 |
+ return -EPERM; |
1757 |
+@@ -334,7 +339,7 @@ ok: |
1758 |
+ mm = task->mm; |
1759 |
+ if (mm && |
1760 |
+ ((get_dumpable(mm) != SUID_DUMP_USER) && |
1761 |
+- !ptrace_has_cap(mm->user_ns, mode))) |
1762 |
++ !ptrace_has_cap(cred, mm->user_ns, mode))) |
1763 |
+ return -EPERM; |
1764 |
+ |
1765 |
+ return security_ptrace_access_check(task, mode); |
1766 |
+diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c |
1767 |
+index a8fa0a896b78..3c7b400512eb 100644 |
1768 |
+--- a/kernel/time/tick-sched.c |
1769 |
++++ b/kernel/time/tick-sched.c |
1770 |
+@@ -60,8 +60,9 @@ static void tick_do_update_jiffies64(ktime_t now) |
1771 |
+ |
1772 |
+ /* |
1773 |
+ * Do a quick check without holding jiffies_lock: |
1774 |
++ * The READ_ONCE() pairs with two updates done later in this function. |
1775 |
+ */ |
1776 |
+- delta = ktime_sub(now, last_jiffies_update); |
1777 |
++ delta = ktime_sub(now, READ_ONCE(last_jiffies_update)); |
1778 |
+ if (delta < tick_period) |
1779 |
+ return; |
1780 |
+ |
1781 |
+@@ -72,8 +73,9 @@ static void tick_do_update_jiffies64(ktime_t now) |
1782 |
+ if (delta >= tick_period) { |
1783 |
+ |
1784 |
+ delta = ktime_sub(delta, tick_period); |
1785 |
+- last_jiffies_update = ktime_add(last_jiffies_update, |
1786 |
+- tick_period); |
1787 |
++ /* Pairs with the lockless read in this function. */ |
1788 |
++ WRITE_ONCE(last_jiffies_update, |
1789 |
++ ktime_add(last_jiffies_update, tick_period)); |
1790 |
+ |
1791 |
+ /* Slow path for long timeouts */ |
1792 |
+ if (unlikely(delta >= tick_period)) { |
1793 |
+@@ -81,8 +83,10 @@ static void tick_do_update_jiffies64(ktime_t now) |
1794 |
+ |
1795 |
+ ticks = ktime_divns(delta, incr); |
1796 |
+ |
1797 |
+- last_jiffies_update = ktime_add_ns(last_jiffies_update, |
1798 |
+- incr * ticks); |
1799 |
++ /* Pairs with the lockless read in this function. */ |
1800 |
++ WRITE_ONCE(last_jiffies_update, |
1801 |
++ ktime_add_ns(last_jiffies_update, |
1802 |
++ incr * ticks)); |
1803 |
+ } |
1804 |
+ do_timer(++ticks); |
1805 |
+ |
1806 |
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c |
1807 |
+index 1adc2e6c50f9..92915cc87549 100644 |
1808 |
+--- a/mm/huge_memory.c |
1809 |
++++ b/mm/huge_memory.c |
1810 |
+@@ -502,13 +502,13 @@ void prep_transhuge_page(struct page *page) |
1811 |
+ set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR); |
1812 |
+ } |
1813 |
+ |
1814 |
+-unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len, |
1815 |
++static unsigned long __thp_get_unmapped_area(struct file *filp, |
1816 |
++ unsigned long addr, unsigned long len, |
1817 |
+ loff_t off, unsigned long flags, unsigned long size) |
1818 |
+ { |
1819 |
+- unsigned long addr; |
1820 |
+ loff_t off_end = off + len; |
1821 |
+ loff_t off_align = round_up(off, size); |
1822 |
+- unsigned long len_pad; |
1823 |
++ unsigned long len_pad, ret; |
1824 |
+ |
1825 |
+ if (off_end <= off_align || (off_end - off_align) < size) |
1826 |
+ return 0; |
1827 |
+@@ -517,30 +517,40 @@ unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len, |
1828 |
+ if (len_pad < len || (off + len_pad) < off) |
1829 |
+ return 0; |
1830 |
+ |
1831 |
+- addr = current->mm->get_unmapped_area(filp, 0, len_pad, |
1832 |
++ ret = current->mm->get_unmapped_area(filp, addr, len_pad, |
1833 |
+ off >> PAGE_SHIFT, flags); |
1834 |
+- if (IS_ERR_VALUE(addr)) |
1835 |
++ |
1836 |
++ /* |
1837 |
++ * The failure might be due to length padding. The caller will retry |
1838 |
++ * without the padding. |
1839 |
++ */ |
1840 |
++ if (IS_ERR_VALUE(ret)) |
1841 |
+ return 0; |
1842 |
+ |
1843 |
+- addr += (off - addr) & (size - 1); |
1844 |
+- return addr; |
1845 |
++ /* |
1846 |
++ * Do not try to align to THP boundary if allocation at the address |
1847 |
++ * hint succeeds. |
1848 |
++ */ |
1849 |
++ if (ret == addr) |
1850 |
++ return addr; |
1851 |
++ |
1852 |
++ ret += (off - ret) & (size - 1); |
1853 |
++ return ret; |
1854 |
+ } |
1855 |
+ |
1856 |
+ unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr, |
1857 |
+ unsigned long len, unsigned long pgoff, unsigned long flags) |
1858 |
+ { |
1859 |
++ unsigned long ret; |
1860 |
+ loff_t off = (loff_t)pgoff << PAGE_SHIFT; |
1861 |
+ |
1862 |
+- if (addr) |
1863 |
+- goto out; |
1864 |
+ if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD)) |
1865 |
+ goto out; |
1866 |
+ |
1867 |
+- addr = __thp_get_unmapped_area(filp, len, off, flags, PMD_SIZE); |
1868 |
+- if (addr) |
1869 |
+- return addr; |
1870 |
+- |
1871 |
+- out: |
1872 |
++ ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE); |
1873 |
++ if (ret) |
1874 |
++ return ret; |
1875 |
++out: |
1876 |
+ return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags); |
1877 |
+ } |
1878 |
+ EXPORT_SYMBOL_GPL(thp_get_unmapped_area); |
1879 |
+diff --git a/mm/page-writeback.c b/mm/page-writeback.c |
1880 |
+index a40c075fd8f1..29f9980c13ac 100644 |
1881 |
+--- a/mm/page-writeback.c |
1882 |
++++ b/mm/page-writeback.c |
1883 |
+@@ -201,11 +201,11 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, |
1884 |
+ if (this_bw < tot_bw) { |
1885 |
+ if (min) { |
1886 |
+ min *= this_bw; |
1887 |
+- do_div(min, tot_bw); |
1888 |
++ min = div64_ul(min, tot_bw); |
1889 |
+ } |
1890 |
+ if (max < 100) { |
1891 |
+ max *= this_bw; |
1892 |
+- do_div(max, tot_bw); |
1893 |
++ max = div64_ul(max, tot_bw); |
1894 |
+ } |
1895 |
+ } |
1896 |
+ |
1897 |
+diff --git a/mm/shmem.c b/mm/shmem.c |
1898 |
+index 69106c600692..0b6db162083c 100644 |
1899 |
+--- a/mm/shmem.c |
1900 |
++++ b/mm/shmem.c |
1901 |
+@@ -2052,9 +2052,10 @@ unsigned long shmem_get_unmapped_area(struct file *file, |
1902 |
+ /* |
1903 |
+ * Our priority is to support MAP_SHARED mapped hugely; |
1904 |
+ * and support MAP_PRIVATE mapped hugely too, until it is COWed. |
1905 |
+- * But if caller specified an address hint, respect that as before. |
1906 |
++ * But if caller specified an address hint and we allocated area there |
1907 |
++ * successfully, respect that as before. |
1908 |
+ */ |
1909 |
+- if (uaddr) |
1910 |
++ if (uaddr == addr) |
1911 |
+ return addr; |
1912 |
+ |
1913 |
+ if (shmem_huge != SHMEM_HUGE_FORCE) { |
1914 |
+@@ -2088,7 +2089,7 @@ unsigned long shmem_get_unmapped_area(struct file *file, |
1915 |
+ if (inflated_len < len) |
1916 |
+ return addr; |
1917 |
+ |
1918 |
+- inflated_addr = get_area(NULL, 0, inflated_len, 0, flags); |
1919 |
++ inflated_addr = get_area(NULL, uaddr, inflated_len, 0, flags); |
1920 |
+ if (IS_ERR_VALUE(inflated_addr)) |
1921 |
+ return addr; |
1922 |
+ if (inflated_addr & ~PAGE_MASK) |
1923 |
+diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c |
1924 |
+index 8d1d0fdb157e..1519cbf70150 100644 |
1925 |
+--- a/net/batman-adv/distributed-arp-table.c |
1926 |
++++ b/net/batman-adv/distributed-arp-table.c |
1927 |
+@@ -243,6 +243,7 @@ static u32 batadv_hash_dat(const void *data, u32 size) |
1928 |
+ u32 hash = 0; |
1929 |
+ const struct batadv_dat_entry *dat = data; |
1930 |
+ const unsigned char *key; |
1931 |
++ __be16 vid; |
1932 |
+ u32 i; |
1933 |
+ |
1934 |
+ key = (const unsigned char *)&dat->ip; |
1935 |
+@@ -252,7 +253,8 @@ static u32 batadv_hash_dat(const void *data, u32 size) |
1936 |
+ hash ^= (hash >> 6); |
1937 |
+ } |
1938 |
+ |
1939 |
+- key = (const unsigned char *)&dat->vid; |
1940 |
++ vid = htons(dat->vid); |
1941 |
++ key = (__force const unsigned char *)&vid; |
1942 |
+ for (i = 0; i < sizeof(dat->vid); i++) { |
1943 |
+ hash += key[i]; |
1944 |
+ hash += (hash << 10); |
1945 |
+diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c |
1946 |
+index b8c05f1cf47d..af3a12a36d88 100644 |
1947 |
+--- a/net/dsa/tag_qca.c |
1948 |
++++ b/net/dsa/tag_qca.c |
1949 |
+@@ -41,9 +41,6 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) |
1950 |
+ struct dsa_slave_priv *p = netdev_priv(dev); |
1951 |
+ u16 *phdr, hdr; |
1952 |
+ |
1953 |
+- dev->stats.tx_packets++; |
1954 |
+- dev->stats.tx_bytes += skb->len; |
1955 |
+- |
1956 |
+ if (skb_cow_head(skb, 0) < 0) |
1957 |
+ return NULL; |
1958 |
+ |
1959 |
+diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c |
1960 |
+index e288489ae3d5..6dd727e0a72f 100644 |
1961 |
+--- a/net/ipv4/netfilter/arp_tables.c |
1962 |
++++ b/net/ipv4/netfilter/arp_tables.c |
1963 |
+@@ -506,12 +506,13 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, |
1964 |
+ return 0; |
1965 |
+ } |
1966 |
+ |
1967 |
+-static inline void cleanup_entry(struct arpt_entry *e) |
1968 |
++static void cleanup_entry(struct arpt_entry *e, struct net *net) |
1969 |
+ { |
1970 |
+ struct xt_tgdtor_param par; |
1971 |
+ struct xt_entry_target *t; |
1972 |
+ |
1973 |
+ t = arpt_get_target(e); |
1974 |
++ par.net = net; |
1975 |
+ par.target = t->u.kernel.target; |
1976 |
+ par.targinfo = t->data; |
1977 |
+ par.family = NFPROTO_ARP; |
1978 |
+@@ -601,7 +602,7 @@ static int translate_table(struct net *net, |
1979 |
+ xt_entry_foreach(iter, entry0, newinfo->size) { |
1980 |
+ if (i-- == 0) |
1981 |
+ break; |
1982 |
+- cleanup_entry(iter); |
1983 |
++ cleanup_entry(iter, net); |
1984 |
+ } |
1985 |
+ return ret; |
1986 |
+ } |
1987 |
+@@ -926,7 +927,7 @@ static int __do_replace(struct net *net, const char *name, |
1988 |
+ /* Decrease module usage counts and free resource */ |
1989 |
+ loc_cpu_old_entry = oldinfo->entries; |
1990 |
+ xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size) |
1991 |
+- cleanup_entry(iter); |
1992 |
++ cleanup_entry(iter, net); |
1993 |
+ |
1994 |
+ xt_free_table_info(oldinfo); |
1995 |
+ if (copy_to_user(counters_ptr, counters, |
1996 |
+@@ -990,7 +991,7 @@ static int do_replace(struct net *net, const void __user *user, |
1997 |
+ |
1998 |
+ free_newinfo_untrans: |
1999 |
+ xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) |
2000 |
+- cleanup_entry(iter); |
2001 |
++ cleanup_entry(iter, net); |
2002 |
+ free_newinfo: |
2003 |
+ xt_free_table_info(newinfo); |
2004 |
+ return ret; |
2005 |
+@@ -1287,7 +1288,7 @@ static int compat_do_replace(struct net *net, void __user *user, |
2006 |
+ |
2007 |
+ free_newinfo_untrans: |
2008 |
+ xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) |
2009 |
+- cleanup_entry(iter); |
2010 |
++ cleanup_entry(iter, net); |
2011 |
+ free_newinfo: |
2012 |
+ xt_free_table_info(newinfo); |
2013 |
+ return ret; |
2014 |
+@@ -1514,7 +1515,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len |
2015 |
+ return ret; |
2016 |
+ } |
2017 |
+ |
2018 |
+-static void __arpt_unregister_table(struct xt_table *table) |
2019 |
++static void __arpt_unregister_table(struct net *net, struct xt_table *table) |
2020 |
+ { |
2021 |
+ struct xt_table_info *private; |
2022 |
+ void *loc_cpu_entry; |
2023 |
+@@ -1526,7 +1527,7 @@ static void __arpt_unregister_table(struct xt_table *table) |
2024 |
+ /* Decrease module usage counts and free resources */ |
2025 |
+ loc_cpu_entry = private->entries; |
2026 |
+ xt_entry_foreach(iter, loc_cpu_entry, private->size) |
2027 |
+- cleanup_entry(iter); |
2028 |
++ cleanup_entry(iter, net); |
2029 |
+ if (private->number > private->initial_entries) |
2030 |
+ module_put(table_owner); |
2031 |
+ xt_free_table_info(private); |
2032 |
+@@ -1566,7 +1567,7 @@ int arpt_register_table(struct net *net, |
2033 |
+ |
2034 |
+ ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks)); |
2035 |
+ if (ret != 0) { |
2036 |
+- __arpt_unregister_table(new_table); |
2037 |
++ __arpt_unregister_table(net, new_table); |
2038 |
+ *res = NULL; |
2039 |
+ } |
2040 |
+ |
2041 |
+@@ -1581,7 +1582,7 @@ void arpt_unregister_table(struct net *net, struct xt_table *table, |
2042 |
+ const struct nf_hook_ops *ops) |
2043 |
+ { |
2044 |
+ nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); |
2045 |
+- __arpt_unregister_table(table); |
2046 |
++ __arpt_unregister_table(net, table); |
2047 |
+ } |
2048 |
+ |
2049 |
+ /* The built-in targets: standard (NULL) and error. */ |
2050 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
2051 |
+index d2b1c39c4223..29f3df4ddd1f 100644 |
2052 |
+--- a/net/ipv4/tcp_input.c |
2053 |
++++ b/net/ipv4/tcp_input.c |
2054 |
+@@ -932,9 +932,10 @@ static void tcp_update_reordering(struct sock *sk, const int metric, |
2055 |
+ /* This must be called before lost_out is incremented */ |
2056 |
+ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) |
2057 |
+ { |
2058 |
+- if (!tp->retransmit_skb_hint || |
2059 |
+- before(TCP_SKB_CB(skb)->seq, |
2060 |
+- TCP_SKB_CB(tp->retransmit_skb_hint)->seq)) |
2061 |
++ if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) || |
2062 |
++ (tp->retransmit_skb_hint && |
2063 |
++ before(TCP_SKB_CB(skb)->seq, |
2064 |
++ TCP_SKB_CB(tp->retransmit_skb_hint)->seq))) |
2065 |
+ tp->retransmit_skb_hint = skb; |
2066 |
+ } |
2067 |
+ |
2068 |
+diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h |
2069 |
+index 8ad2b52a0b32..b0701f6259cc 100644 |
2070 |
+--- a/net/netfilter/ipset/ip_set_bitmap_gen.h |
2071 |
++++ b/net/netfilter/ipset/ip_set_bitmap_gen.h |
2072 |
+@@ -64,9 +64,9 @@ mtype_destroy(struct ip_set *set) |
2073 |
+ if (SET_WITH_TIMEOUT(set)) |
2074 |
+ del_timer_sync(&map->gc); |
2075 |
+ |
2076 |
+- ip_set_free(map->members); |
2077 |
+ if (set->dsize && set->extensions & IPSET_EXT_DESTROY) |
2078 |
+ mtype_ext_cleanup(set); |
2079 |
++ ip_set_free(map->members); |
2080 |
+ ip_set_free(map); |
2081 |
+ |
2082 |
+ set->data = NULL; |
2083 |
+diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h |
2084 |
+index 0c06240d25af..249919bdfc64 100644 |
2085 |
+--- a/net/wireless/rdev-ops.h |
2086 |
++++ b/net/wireless/rdev-ops.h |
2087 |
+@@ -537,6 +537,10 @@ static inline int |
2088 |
+ rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) |
2089 |
+ { |
2090 |
+ int ret; |
2091 |
++ |
2092 |
++ if (!rdev->ops->set_wiphy_params) |
2093 |
++ return -EOPNOTSUPP; |
2094 |
++ |
2095 |
+ trace_rdev_set_wiphy_params(&rdev->wiphy, changed); |
2096 |
+ ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
2097 |
+ trace_rdev_return_int(&rdev->wiphy, ret); |
2098 |
+diff --git a/net/wireless/util.c b/net/wireless/util.c |
2099 |
+index 2234817f5dbb..935929b45411 100644 |
2100 |
+--- a/net/wireless/util.c |
2101 |
++++ b/net/wireless/util.c |
2102 |
+@@ -652,7 +652,7 @@ __frame_add_frag(struct sk_buff *skb, struct page *page, |
2103 |
+ struct skb_shared_info *sh = skb_shinfo(skb); |
2104 |
+ int page_offset; |
2105 |
+ |
2106 |
+- page_ref_inc(page); |
2107 |
++ get_page(page); |
2108 |
+ page_offset = ptr - page_address(page); |
2109 |
+ skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size); |
2110 |
+ } |
2111 |
+diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c |
2112 |
+index b80985fbc334..0e1feb597586 100644 |
2113 |
+--- a/sound/core/seq/seq_timer.c |
2114 |
++++ b/sound/core/seq/seq_timer.c |
2115 |
+@@ -479,15 +479,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry, |
2116 |
+ q = queueptr(idx); |
2117 |
+ if (q == NULL) |
2118 |
+ continue; |
2119 |
+- if ((tmr = q->timer) == NULL || |
2120 |
+- (ti = tmr->timeri) == NULL) { |
2121 |
+- queuefree(q); |
2122 |
+- continue; |
2123 |
+- } |
2124 |
++ mutex_lock(&q->timer_mutex); |
2125 |
++ tmr = q->timer; |
2126 |
++ if (!tmr) |
2127 |
++ goto unlock; |
2128 |
++ ti = tmr->timeri; |
2129 |
++ if (!ti) |
2130 |
++ goto unlock; |
2131 |
+ snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name); |
2132 |
+ resolution = snd_timer_resolution(ti) * tmr->ticks; |
2133 |
+ snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000); |
2134 |
+ snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base); |
2135 |
++unlock: |
2136 |
++ mutex_unlock(&q->timer_mutex); |
2137 |
+ queuefree(q); |
2138 |
+ } |
2139 |
+ } |
2140 |
+diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c |
2141 |
+index 969283737787..3633eb30dd13 100644 |
2142 |
+--- a/sound/soc/codecs/msm8916-wcd-analog.c |
2143 |
++++ b/sound/soc/codecs/msm8916-wcd-analog.c |
2144 |
+@@ -876,10 +876,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = { |
2145 |
+ |
2146 |
+ SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0, |
2147 |
+ pm8916_wcd_analog_enable_micbias_ext1, |
2148 |
+- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), |
2149 |
++ SND_SOC_DAPM_POST_PMU), |
2150 |
+ SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0, |
2151 |
+ pm8916_wcd_analog_enable_micbias_ext2, |
2152 |
+- SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), |
2153 |
++ SND_SOC_DAPM_POST_PMU), |
2154 |
+ |
2155 |
+ SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0, |
2156 |
+ pm8916_wcd_analog_enable_adc, |
2157 |
+diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c |
2158 |
+index fd4dd12b8f9d..17b26661b2f6 100644 |
2159 |
+--- a/tools/perf/builtin-report.c |
2160 |
++++ b/tools/perf/builtin-report.c |
2161 |
+@@ -742,6 +742,7 @@ int cmd_report(int argc, const char **argv) |
2162 |
+ struct stat st; |
2163 |
+ bool has_br_stack = false; |
2164 |
+ int branch_mode = -1; |
2165 |
++ int last_key = 0; |
2166 |
+ bool branch_call_mode = false; |
2167 |
+ char callchain_default_opt[] = CALLCHAIN_DEFAULT_OPT; |
2168 |
+ const char * const report_usage[] = { |
2169 |
+@@ -1048,7 +1049,8 @@ repeat: |
2170 |
+ else |
2171 |
+ use_browser = 0; |
2172 |
+ |
2173 |
+- if (setup_sorting(session->evlist) < 0) { |
2174 |
++ if ((last_key != K_SWITCH_INPUT_DATA) && |
2175 |
++ (setup_sorting(session->evlist) < 0)) { |
2176 |
+ if (sort_order) |
2177 |
+ parse_options_usage(report_usage, options, "s", 1); |
2178 |
+ if (field_order) |
2179 |
+@@ -1108,6 +1110,7 @@ repeat: |
2180 |
+ ret = __cmd_report(&report); |
2181 |
+ if (ret == K_SWITCH_INPUT_DATA) { |
2182 |
+ perf_session__delete(session); |
2183 |
++ last_key = K_SWITCH_INPUT_DATA; |
2184 |
+ goto repeat; |
2185 |
+ } else |
2186 |
+ ret = 0; |
2187 |
+diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h |
2188 |
+index b99d68943f25..595f91f46811 100644 |
2189 |
+--- a/tools/perf/util/hist.h |
2190 |
++++ b/tools/perf/util/hist.h |
2191 |
+@@ -317,10 +317,10 @@ static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format) |
2192 |
+ list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list) |
2193 |
+ |
2194 |
+ #define hists__for_each_format(hists, format) \ |
2195 |
+- perf_hpp_list__for_each_format((hists)->hpp_list, fmt) |
2196 |
++ perf_hpp_list__for_each_format((hists)->hpp_list, format) |
2197 |
+ |
2198 |
+ #define hists__for_each_sort_list(hists, format) \ |
2199 |
+- perf_hpp_list__for_each_sort_list((hists)->hpp_list, fmt) |
2200 |
++ perf_hpp_list__for_each_sort_list((hists)->hpp_list, format) |
2201 |
+ |
2202 |
+ extern struct perf_hpp_fmt perf_hpp__format[]; |
2203 |
+ |
2204 |
+diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c |
2205 |
+index 30a5e92b67bd..893193bd28c1 100644 |
2206 |
+--- a/tools/perf/util/probe-finder.c |
2207 |
++++ b/tools/perf/util/probe-finder.c |
2208 |
+@@ -615,38 +615,26 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod, |
2209 |
+ const char *function, |
2210 |
+ struct probe_trace_point *tp) |
2211 |
+ { |
2212 |
+- Dwarf_Addr eaddr, highaddr; |
2213 |
++ Dwarf_Addr eaddr; |
2214 |
+ GElf_Sym sym; |
2215 |
+ const char *symbol; |
2216 |
+ |
2217 |
+ /* Verify the address is correct */ |
2218 |
+- if (dwarf_entrypc(sp_die, &eaddr) != 0) { |
2219 |
+- pr_warning("Failed to get entry address of %s\n", |
2220 |
+- dwarf_diename(sp_die)); |
2221 |
+- return -ENOENT; |
2222 |
+- } |
2223 |
+- if (dwarf_highpc(sp_die, &highaddr) != 0) { |
2224 |
+- pr_warning("Failed to get end address of %s\n", |
2225 |
+- dwarf_diename(sp_die)); |
2226 |
+- return -ENOENT; |
2227 |
+- } |
2228 |
+- if (paddr > highaddr) { |
2229 |
+- pr_warning("Offset specified is greater than size of %s\n", |
2230 |
++ if (!dwarf_haspc(sp_die, paddr)) { |
2231 |
++ pr_warning("Specified offset is out of %s\n", |
2232 |
+ dwarf_diename(sp_die)); |
2233 |
+ return -EINVAL; |
2234 |
+ } |
2235 |
+ |
2236 |
+- symbol = dwarf_diename(sp_die); |
2237 |
++ /* Try to get actual symbol name from symtab */ |
2238 |
++ symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); |
2239 |
+ if (!symbol) { |
2240 |
+- /* Try to get the symbol name from symtab */ |
2241 |
+- symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); |
2242 |
+- if (!symbol) { |
2243 |
+- pr_warning("Failed to find symbol at 0x%lx\n", |
2244 |
+- (unsigned long)paddr); |
2245 |
+- return -ENOENT; |
2246 |
+- } |
2247 |
+- eaddr = sym.st_value; |
2248 |
++ pr_warning("Failed to find symbol at 0x%lx\n", |
2249 |
++ (unsigned long)paddr); |
2250 |
++ return -ENOENT; |
2251 |
+ } |
2252 |
++ eaddr = sym.st_value; |
2253 |
++ |
2254 |
+ tp->offset = (unsigned long)(paddr - eaddr); |
2255 |
+ tp->address = (unsigned long)paddr; |
2256 |
+ tp->symbol = strdup(symbol); |