1 |
commit: f987ce0ee95bf3216844eb45c12bfdd1a543be18 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 23 11:00:14 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 23 11:00:14 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f987ce0e |
7 |
|
8 |
Linux patch 4.4.211 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1210_linux-4.4.211.patch | 2692 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2696 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 284f619..8e923ff 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -883,6 +883,10 @@ Patch: 1209_linux-4.4.210.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.4.210 |
23 |
|
24 |
+Patch: 1210_linux-4.4.211.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.4.211 |
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/1210_linux-4.4.211.patch b/1210_linux-4.4.211.patch |
33 |
new file mode 100644 |
34 |
index 0000000..fdade4d |
35 |
--- /dev/null |
36 |
+++ b/1210_linux-4.4.211.patch |
37 |
@@ -0,0 +1,2692 @@ |
38 |
+diff --git a/Documentation/ABI/testing/sysfs-bus-mei b/Documentation/ABI/testing/sysfs-bus-mei |
39 |
+index 6bd45346ac7e..3f8701e8fa24 100644 |
40 |
+--- a/Documentation/ABI/testing/sysfs-bus-mei |
41 |
++++ b/Documentation/ABI/testing/sysfs-bus-mei |
42 |
+@@ -4,7 +4,7 @@ KernelVersion: 3.10 |
43 |
+ Contact: Samuel Ortiz <sameo@×××××××××××.com> |
44 |
+ linux-mei@×××××××××××.com |
45 |
+ Description: Stores the same MODALIAS value emitted by uevent |
46 |
+- Format: mei:<mei device name>:<device uuid>: |
47 |
++ Format: mei:<mei device name>:<device uuid>:<protocol version> |
48 |
+ |
49 |
+ What: /sys/bus/mei/devices/.../name |
50 |
+ Date: May 2015 |
51 |
+diff --git a/Makefile b/Makefile |
52 |
+index c09b55163c2c..9f03733dac69 100644 |
53 |
+--- a/Makefile |
54 |
++++ b/Makefile |
55 |
+@@ -1,6 +1,6 @@ |
56 |
+ VERSION = 4 |
57 |
+ PATCHLEVEL = 4 |
58 |
+-SUBLEVEL = 210 |
59 |
++SUBLEVEL = 211 |
60 |
+ EXTRAVERSION = |
61 |
+ NAME = Blurry Fish Butt |
62 |
+ |
63 |
+diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
64 |
+index 6a37101344aa..751d8b60df1d 100644 |
65 |
+--- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
66 |
++++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
67 |
+@@ -56,10 +56,10 @@ |
68 |
+ |
69 |
+ pmu { |
70 |
+ compatible = "arm,armv8-pmuv3"; |
71 |
+- interrupts = <0 120 8>, |
72 |
+- <0 121 8>, |
73 |
+- <0 122 8>, |
74 |
+- <0 123 8>; |
75 |
++ interrupts = <0 170 4>, |
76 |
++ <0 171 4>, |
77 |
++ <0 172 4>, |
78 |
++ <0 173 4>; |
79 |
+ interrupt-affinity = <&cpu0>, |
80 |
+ <&cpu1>, |
81 |
+ <&cpu2>, |
82 |
+diff --git a/arch/hexagon/kernel/stacktrace.c b/arch/hexagon/kernel/stacktrace.c |
83 |
+index f94918b449a8..03a0e10ecdcc 100644 |
84 |
+--- a/arch/hexagon/kernel/stacktrace.c |
85 |
++++ b/arch/hexagon/kernel/stacktrace.c |
86 |
+@@ -23,8 +23,6 @@ |
87 |
+ #include <linux/thread_info.h> |
88 |
+ #include <linux/module.h> |
89 |
+ |
90 |
+-register unsigned long current_frame_pointer asm("r30"); |
91 |
+- |
92 |
+ struct stackframe { |
93 |
+ unsigned long fp; |
94 |
+ unsigned long rets; |
95 |
+@@ -42,7 +40,7 @@ void save_stack_trace(struct stack_trace *trace) |
96 |
+ |
97 |
+ low = (unsigned long)task_stack_page(current); |
98 |
+ high = low + THREAD_SIZE; |
99 |
+- fp = current_frame_pointer; |
100 |
++ fp = (unsigned long)__builtin_frame_address(0); |
101 |
+ |
102 |
+ while (fp >= low && fp <= (high - sizeof(*frame))) { |
103 |
+ frame = (struct stackframe *)fp; |
104 |
+diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S |
105 |
+index 86558a199139..b831e24f7168 100644 |
106 |
+--- a/arch/x86/boot/compressed/head_64.S |
107 |
++++ b/arch/x86/boot/compressed/head_64.S |
108 |
+@@ -225,6 +225,11 @@ ENTRY(efi32_stub_entry) |
109 |
+ leal efi32_config(%ebp), %eax |
110 |
+ movl %eax, efi_config(%ebp) |
111 |
+ |
112 |
++ /* Disable paging */ |
113 |
++ movl %cr0, %eax |
114 |
++ btrl $X86_CR0_PG_BIT, %eax |
115 |
++ movl %eax, %cr0 |
116 |
++ |
117 |
+ jmp startup_32 |
118 |
+ ENDPROC(efi32_stub_entry) |
119 |
+ #endif |
120 |
+diff --git a/block/blk-settings.c b/block/blk-settings.c |
121 |
+index c7bb666aafd1..eb96abdce29c 100644 |
122 |
+--- a/block/blk-settings.c |
123 |
++++ b/block/blk-settings.c |
124 |
+@@ -349,7 +349,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size); |
125 |
+ * storage device can address. The default of 512 covers most |
126 |
+ * hardware. |
127 |
+ **/ |
128 |
+-void blk_queue_logical_block_size(struct request_queue *q, unsigned short size) |
129 |
++void blk_queue_logical_block_size(struct request_queue *q, unsigned int size) |
130 |
+ { |
131 |
+ q->limits.logical_block_size = size; |
132 |
+ |
133 |
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c |
134 |
+index 2fee2eef988d..e1f71debdbba 100644 |
135 |
+--- a/drivers/block/xen-blkfront.c |
136 |
++++ b/drivers/block/xen-blkfront.c |
137 |
+@@ -952,8 +952,8 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, |
138 |
+ if (!VDEV_IS_EXTENDED(info->vdevice)) { |
139 |
+ err = xen_translate_vdev(info->vdevice, &minor, &offset); |
140 |
+ if (err) |
141 |
+- return err; |
142 |
+- nr_parts = PARTS_PER_DISK; |
143 |
++ return err; |
144 |
++ nr_parts = PARTS_PER_DISK; |
145 |
+ } else { |
146 |
+ minor = BLKIF_MINOR_EXT(info->vdevice); |
147 |
+ nr_parts = PARTS_PER_EXT_DISK; |
148 |
+diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c |
149 |
+index c94de13ce362..21bfedf40478 100644 |
150 |
+--- a/drivers/clk/samsung/clk-exynos5420.c |
151 |
++++ b/drivers/clk/samsung/clk-exynos5420.c |
152 |
+@@ -166,6 +166,8 @@ static unsigned long exynos5x_clk_regs[] __initdata = { |
153 |
+ GATE_BUS_CPU, |
154 |
+ GATE_SCLK_CPU, |
155 |
+ CLKOUT_CMU_CPU, |
156 |
++ APLL_CON0, |
157 |
++ KPLL_CON0, |
158 |
+ CPLL_CON0, |
159 |
+ DPLL_CON0, |
160 |
+ EPLL_CON0, |
161 |
+diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c |
162 |
+index db0801c7bb8e..503405d32d24 100644 |
163 |
+--- a/drivers/gpio/gpiolib.c |
164 |
++++ b/drivers/gpio/gpiolib.c |
165 |
+@@ -1949,8 +1949,9 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id, |
166 |
+ |
167 |
+ if (chip->ngpio <= p->chip_hwnum) { |
168 |
+ dev_err(dev, |
169 |
+- "requested GPIO %d is out of range [0..%d] for chip %s\n", |
170 |
+- idx, chip->ngpio, chip->label); |
171 |
++ "requested GPIO %u (%u) is out of range [0..%u] for chip %s\n", |
172 |
++ idx, p->chip_hwnum, chip->ngpio - 1, |
173 |
++ chip->label); |
174 |
+ return ERR_PTR(-EINVAL); |
175 |
+ } |
176 |
+ |
177 |
+diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c |
178 |
+index 627a24d3ea7c..ef9e196b54a5 100644 |
179 |
+--- a/drivers/hid/hidraw.c |
180 |
++++ b/drivers/hid/hidraw.c |
181 |
+@@ -262,13 +262,14 @@ out: |
182 |
+ static unsigned int hidraw_poll(struct file *file, poll_table *wait) |
183 |
+ { |
184 |
+ struct hidraw_list *list = file->private_data; |
185 |
++ unsigned int mask = POLLOUT | POLLWRNORM; /* hidraw is always writable */ |
186 |
+ |
187 |
+ poll_wait(file, &list->hidraw->wait, wait); |
188 |
+ if (list->head != list->tail) |
189 |
+- return POLLIN | POLLRDNORM; |
190 |
++ mask |= POLLIN | POLLRDNORM; |
191 |
+ if (!list->hidraw->exist) |
192 |
+- return POLLERR | POLLHUP; |
193 |
+- return 0; |
194 |
++ mask |= POLLERR | POLLHUP; |
195 |
++ return mask; |
196 |
+ } |
197 |
+ |
198 |
+ static int hidraw_open(struct inode *inode, struct file *file) |
199 |
+diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c |
200 |
+index ea0c860ee842..a7ba4db8cff7 100644 |
201 |
+--- a/drivers/hid/uhid.c |
202 |
++++ b/drivers/hid/uhid.c |
203 |
+@@ -769,13 +769,14 @@ unlock: |
204 |
+ static unsigned int uhid_char_poll(struct file *file, poll_table *wait) |
205 |
+ { |
206 |
+ struct uhid_device *uhid = file->private_data; |
207 |
++ unsigned int mask = POLLOUT | POLLWRNORM; /* uhid is always writable */ |
208 |
+ |
209 |
+ poll_wait(file, &uhid->waitq, wait); |
210 |
+ |
211 |
+ if (uhid->head != uhid->tail) |
212 |
+- return POLLIN | POLLRDNORM; |
213 |
++ mask |= POLLIN | POLLRDNORM; |
214 |
+ |
215 |
+- return EPOLLOUT | EPOLLWRNORM; |
216 |
++ return mask; |
217 |
+ } |
218 |
+ |
219 |
+ static const struct file_operations uhid_fops = { |
220 |
+diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c |
221 |
+index eeed374ebc6c..4ca3a4ae2743 100644 |
222 |
+--- a/drivers/iio/imu/adis16480.c |
223 |
++++ b/drivers/iio/imu/adis16480.c |
224 |
+@@ -372,12 +372,14 @@ static int adis16480_get_calibbias(struct iio_dev *indio_dev, |
225 |
+ case IIO_MAGN: |
226 |
+ case IIO_PRESSURE: |
227 |
+ ret = adis_read_reg_16(&st->adis, reg, &val16); |
228 |
+- *bias = sign_extend32(val16, 15); |
229 |
++ if (ret == 0) |
230 |
++ *bias = sign_extend32(val16, 15); |
231 |
+ break; |
232 |
+ case IIO_ANGL_VEL: |
233 |
+ case IIO_ACCEL: |
234 |
+ ret = adis_read_reg_32(&st->adis, reg, &val32); |
235 |
+- *bias = sign_extend32(val32, 31); |
236 |
++ if (ret == 0) |
237 |
++ *bias = sign_extend32(val32, 31); |
238 |
+ break; |
239 |
+ default: |
240 |
+ ret = -EINVAL; |
241 |
+diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c |
242 |
+index cb3a8623ff54..4173fe977721 100644 |
243 |
+--- a/drivers/infiniband/ulp/srpt/ib_srpt.c |
244 |
++++ b/drivers/infiniband/ulp/srpt/ib_srpt.c |
245 |
+@@ -1513,9 +1513,11 @@ static int srpt_build_cmd_rsp(struct srpt_rdma_ch *ch, |
246 |
+ struct srpt_send_ioctx *ioctx, u64 tag, |
247 |
+ int status) |
248 |
+ { |
249 |
++ struct se_cmd *cmd = &ioctx->cmd; |
250 |
+ struct srp_rsp *srp_rsp; |
251 |
+ const u8 *sense_data; |
252 |
+ int sense_data_len, max_sense_len; |
253 |
++ u32 resid = cmd->residual_count; |
254 |
+ |
255 |
+ /* |
256 |
+ * The lowest bit of all SAM-3 status codes is zero (see also |
257 |
+@@ -1537,6 +1539,28 @@ static int srpt_build_cmd_rsp(struct srpt_rdma_ch *ch, |
258 |
+ srp_rsp->tag = tag; |
259 |
+ srp_rsp->status = status; |
260 |
+ |
261 |
++ if (cmd->se_cmd_flags & SCF_UNDERFLOW_BIT) { |
262 |
++ if (cmd->data_direction == DMA_TO_DEVICE) { |
263 |
++ /* residual data from an underflow write */ |
264 |
++ srp_rsp->flags = SRP_RSP_FLAG_DOUNDER; |
265 |
++ srp_rsp->data_out_res_cnt = cpu_to_be32(resid); |
266 |
++ } else if (cmd->data_direction == DMA_FROM_DEVICE) { |
267 |
++ /* residual data from an underflow read */ |
268 |
++ srp_rsp->flags = SRP_RSP_FLAG_DIUNDER; |
269 |
++ srp_rsp->data_in_res_cnt = cpu_to_be32(resid); |
270 |
++ } |
271 |
++ } else if (cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { |
272 |
++ if (cmd->data_direction == DMA_TO_DEVICE) { |
273 |
++ /* residual data from an overflow write */ |
274 |
++ srp_rsp->flags = SRP_RSP_FLAG_DOOVER; |
275 |
++ srp_rsp->data_out_res_cnt = cpu_to_be32(resid); |
276 |
++ } else if (cmd->data_direction == DMA_FROM_DEVICE) { |
277 |
++ /* residual data from an overflow read */ |
278 |
++ srp_rsp->flags = SRP_RSP_FLAG_DIOVER; |
279 |
++ srp_rsp->data_in_res_cnt = cpu_to_be32(resid); |
280 |
++ } |
281 |
++ } |
282 |
++ |
283 |
+ if (sense_data_len) { |
284 |
+ BUILD_BUG_ON(MIN_MAX_RSP_SIZE <= sizeof(*srp_rsp)); |
285 |
+ max_sense_len = ch->max_ti_iu_len - sizeof(*srp_rsp); |
286 |
+diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c |
287 |
+index a070fa39521a..5d5066cf3bbd 100644 |
288 |
+--- a/drivers/iommu/iommu.c |
289 |
++++ b/drivers/iommu/iommu.c |
290 |
+@@ -447,6 +447,7 @@ err_put_group: |
291 |
+ mutex_unlock(&group->mutex); |
292 |
+ dev->iommu_group = NULL; |
293 |
+ kobject_put(group->devices_kobj); |
294 |
++ sysfs_remove_link(group->devices_kobj, device->name); |
295 |
+ err_free_name: |
296 |
+ kfree(device->name); |
297 |
+ err_remove_link: |
298 |
+diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c |
299 |
+index 4d3909393f2c..5c793ac11108 100644 |
300 |
+--- a/drivers/md/dm-snap-persistent.c |
301 |
++++ b/drivers/md/dm-snap-persistent.c |
302 |
+@@ -17,7 +17,7 @@ |
303 |
+ #include "dm-bufio.h" |
304 |
+ |
305 |
+ #define DM_MSG_PREFIX "persistent snapshot" |
306 |
+-#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */ |
307 |
++#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U /* 16KB */ |
308 |
+ |
309 |
+ #define DM_PREFETCH_CHUNKS 12 |
310 |
+ |
311 |
+diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c |
312 |
+index f8e5db0cb5aa..62a4fca62776 100644 |
313 |
+--- a/drivers/md/raid0.c |
314 |
++++ b/drivers/md/raid0.c |
315 |
+@@ -83,7 +83,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) |
316 |
+ char b[BDEVNAME_SIZE]; |
317 |
+ char b2[BDEVNAME_SIZE]; |
318 |
+ struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL); |
319 |
+- unsigned short blksize = 512; |
320 |
++ unsigned blksize = 512; |
321 |
+ |
322 |
+ if (!conf) |
323 |
+ return -ENOMEM; |
324 |
+diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c |
325 |
+index 667d3720154a..4b7803cec37f 100644 |
326 |
+--- a/drivers/media/platform/exynos4-is/fimc-isp-video.c |
327 |
++++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c |
328 |
+@@ -323,7 +323,7 @@ static int isp_video_release(struct file *file) |
329 |
+ ivc->streaming = 0; |
330 |
+ } |
331 |
+ |
332 |
+- vb2_fop_release(file); |
333 |
++ _vb2_fop_release(file, NULL); |
334 |
+ |
335 |
+ if (v4l2_fh_is_singular_file(file)) { |
336 |
+ fimc_pipeline_call(&ivc->ve, close); |
337 |
+diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c |
338 |
+index fd6a3b36208e..2d56cccaa474 100644 |
339 |
+--- a/drivers/media/usb/zr364xx/zr364xx.c |
340 |
++++ b/drivers/media/usb/zr364xx/zr364xx.c |
341 |
+@@ -711,7 +711,8 @@ static int zr364xx_vidioc_querycap(struct file *file, void *priv, |
342 |
+ struct zr364xx_camera *cam = video_drvdata(file); |
343 |
+ |
344 |
+ strlcpy(cap->driver, DRIVER_DESC, sizeof(cap->driver)); |
345 |
+- strlcpy(cap->card, cam->udev->product, sizeof(cap->card)); |
346 |
++ if (cam->udev->product) |
347 |
++ strlcpy(cap->card, cam->udev->product, sizeof(cap->card)); |
348 |
+ strlcpy(cap->bus_info, dev_name(&cam->udev->dev), |
349 |
+ sizeof(cap->bus_info)); |
350 |
+ cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | |
351 |
+diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c |
352 |
+index 14cf6dfc3b14..4d837bcad5db 100644 |
353 |
+--- a/drivers/message/fusion/mptctl.c |
354 |
++++ b/drivers/message/fusion/mptctl.c |
355 |
+@@ -100,19 +100,19 @@ struct buflist { |
356 |
+ * Function prototypes. Called from OS entry point mptctl_ioctl. |
357 |
+ * arg contents specific to function. |
358 |
+ */ |
359 |
+-static int mptctl_fw_download(unsigned long arg); |
360 |
+-static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd); |
361 |
+-static int mptctl_gettargetinfo(unsigned long arg); |
362 |
+-static int mptctl_readtest(unsigned long arg); |
363 |
+-static int mptctl_mpt_command(unsigned long arg); |
364 |
+-static int mptctl_eventquery(unsigned long arg); |
365 |
+-static int mptctl_eventenable(unsigned long arg); |
366 |
+-static int mptctl_eventreport(unsigned long arg); |
367 |
+-static int mptctl_replace_fw(unsigned long arg); |
368 |
+- |
369 |
+-static int mptctl_do_reset(unsigned long arg); |
370 |
+-static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); |
371 |
+-static int mptctl_hp_targetinfo(unsigned long arg); |
372 |
++static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg); |
373 |
++static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); |
374 |
++static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg); |
375 |
++static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg); |
376 |
++static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg); |
377 |
++static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg); |
378 |
++static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg); |
379 |
++static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg); |
380 |
++static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg); |
381 |
++ |
382 |
++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg); |
383 |
++static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); |
384 |
++static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg); |
385 |
+ |
386 |
+ static int mptctl_probe(struct pci_dev *, const struct pci_device_id *); |
387 |
+ static void mptctl_remove(struct pci_dev *); |
388 |
+@@ -123,8 +123,8 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg); |
389 |
+ /* |
390 |
+ * Private function calls. |
391 |
+ */ |
392 |
+-static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr); |
393 |
+-static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); |
394 |
++static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfPtr); |
395 |
++static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen); |
396 |
+ static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags, |
397 |
+ struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); |
398 |
+ static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, |
399 |
+@@ -656,19 +656,19 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
400 |
+ * by TM and FW reloads. |
401 |
+ */ |
402 |
+ if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) { |
403 |
+- return mptctl_getiocinfo(arg, _IOC_SIZE(cmd)); |
404 |
++ return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd)); |
405 |
+ } else if (cmd == MPTTARGETINFO) { |
406 |
+- return mptctl_gettargetinfo(arg); |
407 |
++ return mptctl_gettargetinfo(iocp, arg); |
408 |
+ } else if (cmd == MPTTEST) { |
409 |
+- return mptctl_readtest(arg); |
410 |
++ return mptctl_readtest(iocp, arg); |
411 |
+ } else if (cmd == MPTEVENTQUERY) { |
412 |
+- return mptctl_eventquery(arg); |
413 |
++ return mptctl_eventquery(iocp, arg); |
414 |
+ } else if (cmd == MPTEVENTENABLE) { |
415 |
+- return mptctl_eventenable(arg); |
416 |
++ return mptctl_eventenable(iocp, arg); |
417 |
+ } else if (cmd == MPTEVENTREPORT) { |
418 |
+- return mptctl_eventreport(arg); |
419 |
++ return mptctl_eventreport(iocp, arg); |
420 |
+ } else if (cmd == MPTFWREPLACE) { |
421 |
+- return mptctl_replace_fw(arg); |
422 |
++ return mptctl_replace_fw(iocp, arg); |
423 |
+ } |
424 |
+ |
425 |
+ /* All of these commands require an interrupt or |
426 |
+@@ -678,15 +678,15 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
427 |
+ return ret; |
428 |
+ |
429 |
+ if (cmd == MPTFWDOWNLOAD) |
430 |
+- ret = mptctl_fw_download(arg); |
431 |
++ ret = mptctl_fw_download(iocp, arg); |
432 |
+ else if (cmd == MPTCOMMAND) |
433 |
+- ret = mptctl_mpt_command(arg); |
434 |
++ ret = mptctl_mpt_command(iocp, arg); |
435 |
+ else if (cmd == MPTHARDRESET) |
436 |
+- ret = mptctl_do_reset(arg); |
437 |
++ ret = mptctl_do_reset(iocp, arg); |
438 |
+ else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK)) |
439 |
+- ret = mptctl_hp_hostinfo(arg, _IOC_SIZE(cmd)); |
440 |
++ ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd)); |
441 |
+ else if (cmd == HP_GETTARGETINFO) |
442 |
+- ret = mptctl_hp_targetinfo(arg); |
443 |
++ ret = mptctl_hp_targetinfo(iocp, arg); |
444 |
+ else |
445 |
+ ret = -EINVAL; |
446 |
+ |
447 |
+@@ -705,11 +705,10 @@ mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
448 |
+ return ret; |
449 |
+ } |
450 |
+ |
451 |
+-static int mptctl_do_reset(unsigned long arg) |
452 |
++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg) |
453 |
+ { |
454 |
+ struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg; |
455 |
+ struct mpt_ioctl_diag_reset krinfo; |
456 |
+- MPT_ADAPTER *iocp; |
457 |
+ |
458 |
+ if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) { |
459 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - " |
460 |
+@@ -718,12 +717,6 @@ static int mptctl_do_reset(unsigned long arg) |
461 |
+ return -EFAULT; |
462 |
+ } |
463 |
+ |
464 |
+- if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { |
465 |
+- printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n", |
466 |
+- __FILE__, __LINE__, krinfo.hdr.iocnum); |
467 |
+- return -ENODEV; /* (-6) No such device or address */ |
468 |
+- } |
469 |
+- |
470 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", |
471 |
+ iocp->name)); |
472 |
+ |
473 |
+@@ -754,7 +747,7 @@ static int mptctl_do_reset(unsigned long arg) |
474 |
+ * -ENOMSG if FW upload returned bad status |
475 |
+ */ |
476 |
+ static int |
477 |
+-mptctl_fw_download(unsigned long arg) |
478 |
++mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg) |
479 |
+ { |
480 |
+ struct mpt_fw_xfer __user *ufwdl = (void __user *) arg; |
481 |
+ struct mpt_fw_xfer kfwdl; |
482 |
+@@ -766,7 +759,7 @@ mptctl_fw_download(unsigned long arg) |
483 |
+ return -EFAULT; |
484 |
+ } |
485 |
+ |
486 |
+- return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); |
487 |
++ return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen); |
488 |
+ } |
489 |
+ |
490 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
491 |
+@@ -784,11 +777,10 @@ mptctl_fw_download(unsigned long arg) |
492 |
+ * -ENOMSG if FW upload returned bad status |
493 |
+ */ |
494 |
+ static int |
495 |
+-mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
496 |
++mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen) |
497 |
+ { |
498 |
+ FWDownload_t *dlmsg; |
499 |
+ MPT_FRAME_HDR *mf; |
500 |
+- MPT_ADAPTER *iocp; |
501 |
+ FWDownloadTCSGE_t *ptsge; |
502 |
+ MptSge_t *sgl, *sgIn; |
503 |
+ char *sgOut; |
504 |
+@@ -808,17 +800,10 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
505 |
+ pFWDownloadReply_t ReplyMsg = NULL; |
506 |
+ unsigned long timeleft; |
507 |
+ |
508 |
+- if (mpt_verify_adapter(ioc, &iocp) < 0) { |
509 |
+- printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n", |
510 |
+- ioc); |
511 |
+- return -ENODEV; /* (-6) No such device or address */ |
512 |
+- } else { |
513 |
+- |
514 |
+- /* Valid device. Get a message frame and construct the FW download message. |
515 |
+- */ |
516 |
+- if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) |
517 |
+- return -EAGAIN; |
518 |
+- } |
519 |
++ /* Valid device. Get a message frame and construct the FW download message. |
520 |
++ */ |
521 |
++ if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) |
522 |
++ return -EAGAIN; |
523 |
+ |
524 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT |
525 |
+ "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); |
526 |
+@@ -826,8 +811,6 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
527 |
+ iocp->name, ufwbuf)); |
528 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", |
529 |
+ iocp->name, (int)fwlen)); |
530 |
+- dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n", |
531 |
+- iocp->name, ioc)); |
532 |
+ |
533 |
+ dlmsg = (FWDownload_t*) mf; |
534 |
+ ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; |
535 |
+@@ -1238,13 +1221,11 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE |
536 |
+ * -ENODEV if no such device/adapter |
537 |
+ */ |
538 |
+ static int |
539 |
+-mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
540 |
++mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) |
541 |
+ { |
542 |
+ struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg; |
543 |
+ struct mpt_ioctl_iocinfo *karg; |
544 |
+- MPT_ADAPTER *ioc; |
545 |
+ struct pci_dev *pdev; |
546 |
+- int iocnum; |
547 |
+ unsigned int port; |
548 |
+ int cim_rev; |
549 |
+ struct scsi_device *sdev; |
550 |
+@@ -1272,14 +1253,6 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
551 |
+ return PTR_ERR(karg); |
552 |
+ } |
553 |
+ |
554 |
+- if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || |
555 |
+- (ioc == NULL)) { |
556 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", |
557 |
+- __FILE__, __LINE__, iocnum); |
558 |
+- kfree(karg); |
559 |
+- return -ENODEV; |
560 |
+- } |
561 |
+- |
562 |
+ /* Verify the data transfer size is correct. */ |
563 |
+ if (karg->hdr.maxDataSize != data_size) { |
564 |
+ printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - " |
565 |
+@@ -1385,15 +1358,13 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
566 |
+ * -ENODEV if no such device/adapter |
567 |
+ */ |
568 |
+ static int |
569 |
+-mptctl_gettargetinfo (unsigned long arg) |
570 |
++mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg) |
571 |
+ { |
572 |
+ struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg; |
573 |
+ struct mpt_ioctl_targetinfo karg; |
574 |
+- MPT_ADAPTER *ioc; |
575 |
+ VirtDevice *vdevice; |
576 |
+ char *pmem; |
577 |
+ int *pdata; |
578 |
+- int iocnum; |
579 |
+ int numDevices = 0; |
580 |
+ int lun; |
581 |
+ int maxWordsLeft; |
582 |
+@@ -1408,13 +1379,6 @@ mptctl_gettargetinfo (unsigned long arg) |
583 |
+ return -EFAULT; |
584 |
+ } |
585 |
+ |
586 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
587 |
+- (ioc == NULL)) { |
588 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", |
589 |
+- __FILE__, __LINE__, iocnum); |
590 |
+- return -ENODEV; |
591 |
+- } |
592 |
+- |
593 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n", |
594 |
+ ioc->name)); |
595 |
+ /* Get the port number and set the maximum number of bytes |
596 |
+@@ -1510,12 +1474,10 @@ mptctl_gettargetinfo (unsigned long arg) |
597 |
+ * -ENODEV if no such device/adapter |
598 |
+ */ |
599 |
+ static int |
600 |
+-mptctl_readtest (unsigned long arg) |
601 |
++mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg) |
602 |
+ { |
603 |
+ struct mpt_ioctl_test __user *uarg = (void __user *) arg; |
604 |
+ struct mpt_ioctl_test karg; |
605 |
+- MPT_ADAPTER *ioc; |
606 |
+- int iocnum; |
607 |
+ |
608 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { |
609 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - " |
610 |
+@@ -1524,13 +1486,6 @@ mptctl_readtest (unsigned long arg) |
611 |
+ return -EFAULT; |
612 |
+ } |
613 |
+ |
614 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
615 |
+- (ioc == NULL)) { |
616 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n", |
617 |
+- __FILE__, __LINE__, iocnum); |
618 |
+- return -ENODEV; |
619 |
+- } |
620 |
+- |
621 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n", |
622 |
+ ioc->name)); |
623 |
+ /* Fill in the data and return the structure to the calling |
624 |
+@@ -1571,12 +1526,10 @@ mptctl_readtest (unsigned long arg) |
625 |
+ * -ENODEV if no such device/adapter |
626 |
+ */ |
627 |
+ static int |
628 |
+-mptctl_eventquery (unsigned long arg) |
629 |
++mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg) |
630 |
+ { |
631 |
+ struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg; |
632 |
+ struct mpt_ioctl_eventquery karg; |
633 |
+- MPT_ADAPTER *ioc; |
634 |
+- int iocnum; |
635 |
+ |
636 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { |
637 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - " |
638 |
+@@ -1585,13 +1538,6 @@ mptctl_eventquery (unsigned long arg) |
639 |
+ return -EFAULT; |
640 |
+ } |
641 |
+ |
642 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
643 |
+- (ioc == NULL)) { |
644 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n", |
645 |
+- __FILE__, __LINE__, iocnum); |
646 |
+- return -ENODEV; |
647 |
+- } |
648 |
+- |
649 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n", |
650 |
+ ioc->name)); |
651 |
+ karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; |
652 |
+@@ -1610,12 +1556,10 @@ mptctl_eventquery (unsigned long arg) |
653 |
+ |
654 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
655 |
+ static int |
656 |
+-mptctl_eventenable (unsigned long arg) |
657 |
++mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg) |
658 |
+ { |
659 |
+ struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg; |
660 |
+ struct mpt_ioctl_eventenable karg; |
661 |
+- MPT_ADAPTER *ioc; |
662 |
+- int iocnum; |
663 |
+ |
664 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { |
665 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - " |
666 |
+@@ -1624,13 +1568,6 @@ mptctl_eventenable (unsigned long arg) |
667 |
+ return -EFAULT; |
668 |
+ } |
669 |
+ |
670 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
671 |
+- (ioc == NULL)) { |
672 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n", |
673 |
+- __FILE__, __LINE__, iocnum); |
674 |
+- return -ENODEV; |
675 |
+- } |
676 |
+- |
677 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n", |
678 |
+ ioc->name)); |
679 |
+ if (ioc->events == NULL) { |
680 |
+@@ -1658,12 +1595,10 @@ mptctl_eventenable (unsigned long arg) |
681 |
+ |
682 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
683 |
+ static int |
684 |
+-mptctl_eventreport (unsigned long arg) |
685 |
++mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg) |
686 |
+ { |
687 |
+ struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg; |
688 |
+ struct mpt_ioctl_eventreport karg; |
689 |
+- MPT_ADAPTER *ioc; |
690 |
+- int iocnum; |
691 |
+ int numBytes, maxEvents, max; |
692 |
+ |
693 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { |
694 |
+@@ -1673,12 +1608,6 @@ mptctl_eventreport (unsigned long arg) |
695 |
+ return -EFAULT; |
696 |
+ } |
697 |
+ |
698 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
699 |
+- (ioc == NULL)) { |
700 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n", |
701 |
+- __FILE__, __LINE__, iocnum); |
702 |
+- return -ENODEV; |
703 |
+- } |
704 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n", |
705 |
+ ioc->name)); |
706 |
+ |
707 |
+@@ -1712,12 +1641,10 @@ mptctl_eventreport (unsigned long arg) |
708 |
+ |
709 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
710 |
+ static int |
711 |
+-mptctl_replace_fw (unsigned long arg) |
712 |
++mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg) |
713 |
+ { |
714 |
+ struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg; |
715 |
+ struct mpt_ioctl_replace_fw karg; |
716 |
+- MPT_ADAPTER *ioc; |
717 |
+- int iocnum; |
718 |
+ int newFwSize; |
719 |
+ |
720 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { |
721 |
+@@ -1727,13 +1654,6 @@ mptctl_replace_fw (unsigned long arg) |
722 |
+ return -EFAULT; |
723 |
+ } |
724 |
+ |
725 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
726 |
+- (ioc == NULL)) { |
727 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", |
728 |
+- __FILE__, __LINE__, iocnum); |
729 |
+- return -ENODEV; |
730 |
+- } |
731 |
+- |
732 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n", |
733 |
+ ioc->name)); |
734 |
+ /* If caching FW, Free the old FW image |
735 |
+@@ -1780,12 +1700,10 @@ mptctl_replace_fw (unsigned long arg) |
736 |
+ * -ENOMEM if memory allocation error |
737 |
+ */ |
738 |
+ static int |
739 |
+-mptctl_mpt_command (unsigned long arg) |
740 |
++mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg) |
741 |
+ { |
742 |
+ struct mpt_ioctl_command __user *uarg = (void __user *) arg; |
743 |
+ struct mpt_ioctl_command karg; |
744 |
+- MPT_ADAPTER *ioc; |
745 |
+- int iocnum; |
746 |
+ int rc; |
747 |
+ |
748 |
+ |
749 |
+@@ -1796,14 +1714,7 @@ mptctl_mpt_command (unsigned long arg) |
750 |
+ return -EFAULT; |
751 |
+ } |
752 |
+ |
753 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
754 |
+- (ioc == NULL)) { |
755 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", |
756 |
+- __FILE__, __LINE__, iocnum); |
757 |
+- return -ENODEV; |
758 |
+- } |
759 |
+- |
760 |
+- rc = mptctl_do_mpt_command (karg, &uarg->MF); |
761 |
++ rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF); |
762 |
+ |
763 |
+ return rc; |
764 |
+ } |
765 |
+@@ -1821,9 +1732,8 @@ mptctl_mpt_command (unsigned long arg) |
766 |
+ * -EPERM if SCSI I/O and target is untagged |
767 |
+ */ |
768 |
+ static int |
769 |
+-mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
770 |
++mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr) |
771 |
+ { |
772 |
+- MPT_ADAPTER *ioc; |
773 |
+ MPT_FRAME_HDR *mf = NULL; |
774 |
+ MPIHeader_t *hdr; |
775 |
+ char *psge; |
776 |
+@@ -1832,7 +1742,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
777 |
+ dma_addr_t dma_addr_in; |
778 |
+ dma_addr_t dma_addr_out; |
779 |
+ int sgSize = 0; /* Num SG elements */ |
780 |
+- int iocnum, flagsLength; |
781 |
++ int flagsLength; |
782 |
+ int sz, rc = 0; |
783 |
+ int msgContext; |
784 |
+ u16 req_idx; |
785 |
+@@ -1847,13 +1757,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
786 |
+ bufIn.kptr = bufOut.kptr = NULL; |
787 |
+ bufIn.len = bufOut.len = 0; |
788 |
+ |
789 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
790 |
+- (ioc == NULL)) { |
791 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", |
792 |
+- __FILE__, __LINE__, iocnum); |
793 |
+- return -ENODEV; |
794 |
+- } |
795 |
+- |
796 |
+ spin_lock_irqsave(&ioc->taskmgmt_lock, flags); |
797 |
+ if (ioc->ioc_reset_in_progress) { |
798 |
+ spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
799 |
+@@ -2418,17 +2321,15 @@ done_free_mem: |
800 |
+ * -ENOMEM if memory allocation error |
801 |
+ */ |
802 |
+ static int |
803 |
+-mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) |
804 |
++mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) |
805 |
+ { |
806 |
+ hp_host_info_t __user *uarg = (void __user *) arg; |
807 |
+- MPT_ADAPTER *ioc; |
808 |
+ struct pci_dev *pdev; |
809 |
+ char *pbuf=NULL; |
810 |
+ dma_addr_t buf_dma; |
811 |
+ hp_host_info_t karg; |
812 |
+ CONFIGPARMS cfg; |
813 |
+ ConfigPageHeader_t hdr; |
814 |
+- int iocnum; |
815 |
+ int rc, cim_rev; |
816 |
+ ToolboxIstwiReadWriteRequest_t *IstwiRWRequest; |
817 |
+ MPT_FRAME_HDR *mf = NULL; |
818 |
+@@ -2452,12 +2353,6 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) |
819 |
+ return -EFAULT; |
820 |
+ } |
821 |
+ |
822 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
823 |
+- (ioc == NULL)) { |
824 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n", |
825 |
+- __FILE__, __LINE__, iocnum); |
826 |
+- return -ENODEV; |
827 |
+- } |
828 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n", |
829 |
+ ioc->name)); |
830 |
+ |
831 |
+@@ -2670,15 +2565,13 @@ retry_wait: |
832 |
+ * -ENOMEM if memory allocation error |
833 |
+ */ |
834 |
+ static int |
835 |
+-mptctl_hp_targetinfo(unsigned long arg) |
836 |
++mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg) |
837 |
+ { |
838 |
+ hp_target_info_t __user *uarg = (void __user *) arg; |
839 |
+ SCSIDevicePage0_t *pg0_alloc; |
840 |
+ SCSIDevicePage3_t *pg3_alloc; |
841 |
+- MPT_ADAPTER *ioc; |
842 |
+ MPT_SCSI_HOST *hd = NULL; |
843 |
+ hp_target_info_t karg; |
844 |
+- int iocnum; |
845 |
+ int data_sz; |
846 |
+ dma_addr_t page_dma; |
847 |
+ CONFIGPARMS cfg; |
848 |
+@@ -2692,12 +2585,6 @@ mptctl_hp_targetinfo(unsigned long arg) |
849 |
+ return -EFAULT; |
850 |
+ } |
851 |
+ |
852 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
853 |
+- (ioc == NULL)) { |
854 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n", |
855 |
+- __FILE__, __LINE__, iocnum); |
856 |
+- return -ENODEV; |
857 |
+- } |
858 |
+ if (karg.hdr.id >= MPT_MAX_FC_DEVICES) |
859 |
+ return -EINVAL; |
860 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n", |
861 |
+@@ -2865,7 +2752,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd, |
862 |
+ kfw.fwlen = kfw32.fwlen; |
863 |
+ kfw.bufp = compat_ptr(kfw32.bufp); |
864 |
+ |
865 |
+- ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); |
866 |
++ ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen); |
867 |
+ |
868 |
+ mutex_unlock(&iocp->ioctl_cmds.mutex); |
869 |
+ |
870 |
+@@ -2919,7 +2806,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd, |
871 |
+ |
872 |
+ /* Pass new structure to do_mpt_command |
873 |
+ */ |
874 |
+- ret = mptctl_do_mpt_command (karg, &uarg->MF); |
875 |
++ ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); |
876 |
+ |
877 |
+ mutex_unlock(&iocp->ioctl_cmds.mutex); |
878 |
+ |
879 |
+diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c |
880 |
+index eb29113e0bac..b11737f7bdca 100644 |
881 |
+--- a/drivers/misc/enclosure.c |
882 |
++++ b/drivers/misc/enclosure.c |
883 |
+@@ -419,10 +419,9 @@ int enclosure_remove_device(struct enclosure_device *edev, struct device *dev) |
884 |
+ cdev = &edev->component[i]; |
885 |
+ if (cdev->dev == dev) { |
886 |
+ enclosure_remove_links(cdev); |
887 |
+- device_del(&cdev->cdev); |
888 |
+ put_device(dev); |
889 |
+ cdev->dev = NULL; |
890 |
+- return device_add(&cdev->cdev); |
891 |
++ return 0; |
892 |
+ } |
893 |
+ } |
894 |
+ return -ENODEV; |
895 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h |
896 |
+index 803df6a32ba9..a942d2d84ed2 100644 |
897 |
+--- a/drivers/net/ethernet/stmicro/stmmac/common.h |
898 |
++++ b/drivers/net/ethernet/stmicro/stmmac/common.h |
899 |
+@@ -273,8 +273,8 @@ struct dma_features { |
900 |
+ unsigned int enh_desc; |
901 |
+ }; |
902 |
+ |
903 |
+-/* GMAC TX FIFO is 8K, Rx FIFO is 16K */ |
904 |
+-#define BUF_SIZE_16KiB 16384 |
905 |
++/* RX Buffer size must be multiple of 4/8/16 bytes */ |
906 |
++#define BUF_SIZE_16KiB 16368 |
907 |
+ #define BUF_SIZE_8KiB 8192 |
908 |
+ #define BUF_SIZE_4KiB 4096 |
909 |
+ #define BUF_SIZE_2KiB 2048 |
910 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
911 |
+index 28a6b7764044..6f695239e658 100644 |
912 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
913 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
914 |
+@@ -935,7 +935,9 @@ static int stmmac_set_bfsize(int mtu, int bufsize) |
915 |
+ { |
916 |
+ int ret = bufsize; |
917 |
+ |
918 |
+- if (mtu >= BUF_SIZE_4KiB) |
919 |
++ if (mtu >= BUF_SIZE_8KiB) |
920 |
++ ret = BUF_SIZE_16KiB; |
921 |
++ else if (mtu >= BUF_SIZE_4KiB) |
922 |
+ ret = BUF_SIZE_8KiB; |
923 |
+ else if (mtu >= BUF_SIZE_2KiB) |
924 |
+ ret = BUF_SIZE_4KiB; |
925 |
+diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c |
926 |
+index eb825ea52d6b..bd49303f7db2 100644 |
927 |
+--- a/drivers/net/macvlan.c |
928 |
++++ b/drivers/net/macvlan.c |
929 |
+@@ -233,7 +233,7 @@ static void macvlan_broadcast(struct sk_buff *skb, |
930 |
+ struct net_device *src, |
931 |
+ enum macvlan_mode mode) |
932 |
+ { |
933 |
+- const struct ethhdr *eth = skb_eth_hdr(skb); |
934 |
++ const struct ethhdr *eth = eth_hdr(skb); |
935 |
+ const struct macvlan_dev *vlan; |
936 |
+ struct sk_buff *nskb; |
937 |
+ unsigned int i; |
938 |
+@@ -476,10 +476,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) |
939 |
+ const struct macvlan_dev *dest; |
940 |
+ |
941 |
+ if (vlan->mode == MACVLAN_MODE_BRIDGE) { |
942 |
+- const struct ethhdr *eth = (void *)skb->data; |
943 |
++ const struct ethhdr *eth = skb_eth_hdr(skb); |
944 |
+ |
945 |
+ /* send to other bridge ports directly */ |
946 |
+ if (is_multicast_ether_addr(eth->h_dest)) { |
947 |
++ skb_reset_mac_header(skb); |
948 |
+ macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE); |
949 |
+ goto xmit_world; |
950 |
+ } |
951 |
+diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c |
952 |
+index 0d138bc60b18..4174b24963b9 100644 |
953 |
+--- a/drivers/net/usb/lan78xx.c |
954 |
++++ b/drivers/net/usb/lan78xx.c |
955 |
+@@ -2961,6 +2961,7 @@ static int lan78xx_probe(struct usb_interface *intf, |
956 |
+ |
957 |
+ if (netdev->mtu > (dev->hard_mtu - netdev->hard_header_len)) |
958 |
+ netdev->mtu = dev->hard_mtu - netdev->hard_header_len; |
959 |
++ netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); |
960 |
+ |
961 |
+ dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0; |
962 |
+ dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1; |
963 |
+diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c |
964 |
+index 10dd307593e8..db8b489b0513 100644 |
965 |
+--- a/drivers/net/usb/r8152.c |
966 |
++++ b/drivers/net/usb/r8152.c |
967 |
+@@ -4243,6 +4243,9 @@ static int rtl8152_probe(struct usb_interface *intf, |
968 |
+ return -ENODEV; |
969 |
+ } |
970 |
+ |
971 |
++ if (intf->cur_altsetting->desc.bNumEndpoints < 3) |
972 |
++ return -ENODEV; |
973 |
++ |
974 |
+ usb_reset_device(udev); |
975 |
+ netdev = alloc_etherdev(sizeof(struct r8152)); |
976 |
+ if (!netdev) { |
977 |
+diff --git a/drivers/net/wimax/i2400m/op-rfkill.c b/drivers/net/wimax/i2400m/op-rfkill.c |
978 |
+index b0dba35a8ad2..dc6fe93ce71f 100644 |
979 |
+--- a/drivers/net/wimax/i2400m/op-rfkill.c |
980 |
++++ b/drivers/net/wimax/i2400m/op-rfkill.c |
981 |
+@@ -147,6 +147,7 @@ error_msg_to_dev: |
982 |
+ error_alloc: |
983 |
+ d_fnend(4, dev, "(wimax_dev %p state %d) = %d\n", |
984 |
+ wimax_dev, state, result); |
985 |
++ kfree(cmd); |
986 |
+ return result; |
987 |
+ } |
988 |
+ |
989 |
+diff --git a/drivers/net/wireless/cw1200/fwio.c b/drivers/net/wireless/cw1200/fwio.c |
990 |
+index 30e7646d04af..16be7fa82a23 100644 |
991 |
+--- a/drivers/net/wireless/cw1200/fwio.c |
992 |
++++ b/drivers/net/wireless/cw1200/fwio.c |
993 |
+@@ -323,12 +323,12 @@ int cw1200_load_firmware(struct cw1200_common *priv) |
994 |
+ goto out; |
995 |
+ } |
996 |
+ |
997 |
+- priv->hw_type = cw1200_get_hw_type(val32, &major_revision); |
998 |
+- if (priv->hw_type < 0) { |
999 |
++ ret = cw1200_get_hw_type(val32, &major_revision); |
1000 |
++ if (ret < 0) { |
1001 |
+ pr_err("Can't deduce hardware type.\n"); |
1002 |
+- ret = -ENOTSUPP; |
1003 |
+ goto out; |
1004 |
+ } |
1005 |
++ priv->hw_type = ret; |
1006 |
+ |
1007 |
+ /* Set DPLL Reg value, and read back to confirm writes work */ |
1008 |
+ ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID, |
1009 |
+diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c |
1010 |
+index 043bd1c23c19..4a197a32d78c 100644 |
1011 |
+--- a/drivers/net/wireless/p54/p54usb.c |
1012 |
++++ b/drivers/net/wireless/p54/p54usb.c |
1013 |
+@@ -33,6 +33,8 @@ MODULE_ALIAS("prism54usb"); |
1014 |
+ MODULE_FIRMWARE("isl3886usb"); |
1015 |
+ MODULE_FIRMWARE("isl3887usb"); |
1016 |
+ |
1017 |
++static struct usb_driver p54u_driver; |
1018 |
++ |
1019 |
+ /* |
1020 |
+ * Note: |
1021 |
+ * |
1022 |
+@@ -921,9 +923,9 @@ static void p54u_load_firmware_cb(const struct firmware *firmware, |
1023 |
+ { |
1024 |
+ struct p54u_priv *priv = context; |
1025 |
+ struct usb_device *udev = priv->udev; |
1026 |
++ struct usb_interface *intf = priv->intf; |
1027 |
+ int err; |
1028 |
+ |
1029 |
+- complete(&priv->fw_wait_load); |
1030 |
+ if (firmware) { |
1031 |
+ priv->fw = firmware; |
1032 |
+ err = p54u_start_ops(priv); |
1033 |
+@@ -932,26 +934,22 @@ static void p54u_load_firmware_cb(const struct firmware *firmware, |
1034 |
+ dev_err(&udev->dev, "Firmware not found.\n"); |
1035 |
+ } |
1036 |
+ |
1037 |
+- if (err) { |
1038 |
+- struct device *parent = priv->udev->dev.parent; |
1039 |
+- |
1040 |
+- dev_err(&udev->dev, "failed to initialize device (%d)\n", err); |
1041 |
+- |
1042 |
+- if (parent) |
1043 |
+- device_lock(parent); |
1044 |
++ complete(&priv->fw_wait_load); |
1045 |
++ /* |
1046 |
++ * At this point p54u_disconnect may have already freed |
1047 |
++ * the "priv" context. Do not use it anymore! |
1048 |
++ */ |
1049 |
++ priv = NULL; |
1050 |
+ |
1051 |
+- device_release_driver(&udev->dev); |
1052 |
+- /* |
1053 |
+- * At this point p54u_disconnect has already freed |
1054 |
+- * the "priv" context. Do not use it anymore! |
1055 |
+- */ |
1056 |
+- priv = NULL; |
1057 |
++ if (err) { |
1058 |
++ dev_err(&intf->dev, "failed to initialize device (%d)\n", err); |
1059 |
+ |
1060 |
+- if (parent) |
1061 |
+- device_unlock(parent); |
1062 |
++ usb_lock_device(udev); |
1063 |
++ usb_driver_release_interface(&p54u_driver, intf); |
1064 |
++ usb_unlock_device(udev); |
1065 |
+ } |
1066 |
+ |
1067 |
+- usb_put_dev(udev); |
1068 |
++ usb_put_intf(intf); |
1069 |
+ } |
1070 |
+ |
1071 |
+ static int p54u_load_firmware(struct ieee80211_hw *dev, |
1072 |
+@@ -972,14 +970,14 @@ static int p54u_load_firmware(struct ieee80211_hw *dev, |
1073 |
+ dev_info(&priv->udev->dev, "Loading firmware file %s\n", |
1074 |
+ p54u_fwlist[i].fw); |
1075 |
+ |
1076 |
+- usb_get_dev(udev); |
1077 |
++ usb_get_intf(intf); |
1078 |
+ err = request_firmware_nowait(THIS_MODULE, 1, p54u_fwlist[i].fw, |
1079 |
+ device, GFP_KERNEL, priv, |
1080 |
+ p54u_load_firmware_cb); |
1081 |
+ if (err) { |
1082 |
+ dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s " |
1083 |
+ "(%d)!\n", p54u_fwlist[i].fw, err); |
1084 |
+- usb_put_dev(udev); |
1085 |
++ usb_put_intf(intf); |
1086 |
+ } |
1087 |
+ |
1088 |
+ return err; |
1089 |
+@@ -1011,8 +1009,6 @@ static int p54u_probe(struct usb_interface *intf, |
1090 |
+ skb_queue_head_init(&priv->rx_queue); |
1091 |
+ init_usb_anchor(&priv->submitted); |
1092 |
+ |
1093 |
+- usb_get_dev(udev); |
1094 |
+- |
1095 |
+ /* really lazy and simple way of figuring out if we're a 3887 */ |
1096 |
+ /* TODO: should just stick the identification in the device table */ |
1097 |
+ i = intf->altsetting->desc.bNumEndpoints; |
1098 |
+@@ -1053,10 +1049,8 @@ static int p54u_probe(struct usb_interface *intf, |
1099 |
+ priv->upload_fw = p54u_upload_firmware_net2280; |
1100 |
+ } |
1101 |
+ err = p54u_load_firmware(dev, intf); |
1102 |
+- if (err) { |
1103 |
+- usb_put_dev(udev); |
1104 |
++ if (err) |
1105 |
+ p54_free_common(dev); |
1106 |
+- } |
1107 |
+ return err; |
1108 |
+ } |
1109 |
+ |
1110 |
+@@ -1072,7 +1066,6 @@ static void p54u_disconnect(struct usb_interface *intf) |
1111 |
+ wait_for_completion(&priv->fw_wait_load); |
1112 |
+ p54_unregister_common(dev); |
1113 |
+ |
1114 |
+- usb_put_dev(interface_to_usbdev(intf)); |
1115 |
+ release_firmware(priv->fw); |
1116 |
+ p54_free_common(dev); |
1117 |
+ } |
1118 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/regd.c b/drivers/net/wireless/realtek/rtlwifi/regd.c |
1119 |
+index f67e7e5b13e1..005bd7abc247 100644 |
1120 |
+--- a/drivers/net/wireless/realtek/rtlwifi/regd.c |
1121 |
++++ b/drivers/net/wireless/realtek/rtlwifi/regd.c |
1122 |
+@@ -427,7 +427,7 @@ int rtl_regd_init(struct ieee80211_hw *hw, |
1123 |
+ struct wiphy *wiphy = hw->wiphy; |
1124 |
+ struct country_code_to_enum_rd *country = NULL; |
1125 |
+ |
1126 |
+- if (wiphy == NULL || &rtlpriv->regd == NULL) |
1127 |
++ if (!wiphy) |
1128 |
+ return -EINVAL; |
1129 |
+ |
1130 |
+ /* init country_code from efuse channel plan */ |
1131 |
+diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c |
1132 |
+index 4df992de7d07..2f40506a5821 100644 |
1133 |
+--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c |
1134 |
++++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c |
1135 |
+@@ -199,6 +199,7 @@ void rsi_mac80211_detach(struct rsi_hw *adapter) |
1136 |
+ ieee80211_stop_queues(hw); |
1137 |
+ ieee80211_unregister_hw(hw); |
1138 |
+ ieee80211_free_hw(hw); |
1139 |
++ adapter->hw = NULL; |
1140 |
+ } |
1141 |
+ |
1142 |
+ rsi_remove_dbgfs(adapter); |
1143 |
+diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c |
1144 |
+index 63b5b6838e8b..ca1d507aa532 100644 |
1145 |
+--- a/drivers/platform/x86/asus-wmi.c |
1146 |
++++ b/drivers/platform/x86/asus-wmi.c |
1147 |
+@@ -452,13 +452,7 @@ static void kbd_led_update(struct work_struct *work) |
1148 |
+ |
1149 |
+ asus = container_of(work, struct asus_wmi, kbd_led_work); |
1150 |
+ |
1151 |
+- /* |
1152 |
+- * bits 0-2: level |
1153 |
+- * bit 7: light on/off |
1154 |
+- */ |
1155 |
+- if (asus->kbd_led_wk > 0) |
1156 |
+- ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); |
1157 |
+- |
1158 |
++ ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); |
1159 |
+ asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL); |
1160 |
+ } |
1161 |
+ |
1162 |
+diff --git a/drivers/rtc/rtc-msm6242.c b/drivers/rtc/rtc-msm6242.c |
1163 |
+index c1c5c4e3b3b4..c981301efbe5 100644 |
1164 |
+--- a/drivers/rtc/rtc-msm6242.c |
1165 |
++++ b/drivers/rtc/rtc-msm6242.c |
1166 |
+@@ -132,7 +132,8 @@ static int msm6242_read_time(struct device *dev, struct rtc_time *tm) |
1167 |
+ msm6242_read(priv, MSM6242_SECOND1); |
1168 |
+ tm->tm_min = msm6242_read(priv, MSM6242_MINUTE10) * 10 + |
1169 |
+ msm6242_read(priv, MSM6242_MINUTE1); |
1170 |
+- tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10 & 3)) * 10 + |
1171 |
++ tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10) & |
1172 |
++ MSM6242_HOUR10_HR_MASK) * 10 + |
1173 |
+ msm6242_read(priv, MSM6242_HOUR1); |
1174 |
+ tm->tm_mday = msm6242_read(priv, MSM6242_DAY10) * 10 + |
1175 |
+ msm6242_read(priv, MSM6242_DAY1); |
1176 |
+diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c |
1177 |
+index 06a5c52b292f..74740ed3a7c3 100644 |
1178 |
+--- a/drivers/rtc/rtc-mt6397.c |
1179 |
++++ b/drivers/rtc/rtc-mt6397.c |
1180 |
+@@ -55,6 +55,14 @@ |
1181 |
+ |
1182 |
+ #define RTC_AL_SEC 0x0018 |
1183 |
+ |
1184 |
++#define RTC_AL_SEC_MASK 0x003f |
1185 |
++#define RTC_AL_MIN_MASK 0x003f |
1186 |
++#define RTC_AL_HOU_MASK 0x001f |
1187 |
++#define RTC_AL_DOM_MASK 0x001f |
1188 |
++#define RTC_AL_DOW_MASK 0x0007 |
1189 |
++#define RTC_AL_MTH_MASK 0x000f |
1190 |
++#define RTC_AL_YEA_MASK 0x007f |
1191 |
++ |
1192 |
+ #define RTC_PDN2 0x002e |
1193 |
+ #define RTC_PDN2_PWRON_ALARM BIT(4) |
1194 |
+ |
1195 |
+@@ -111,7 +119,7 @@ static irqreturn_t mtk_rtc_irq_handler_thread(int irq, void *data) |
1196 |
+ irqen = irqsta & ~RTC_IRQ_EN_AL; |
1197 |
+ mutex_lock(&rtc->lock); |
1198 |
+ if (regmap_write(rtc->regmap, rtc->addr_base + RTC_IRQ_EN, |
1199 |
+- irqen) < 0) |
1200 |
++ irqen) == 0) |
1201 |
+ mtk_rtc_write_trigger(rtc); |
1202 |
+ mutex_unlock(&rtc->lock); |
1203 |
+ |
1204 |
+@@ -233,12 +241,12 @@ static int mtk_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) |
1205 |
+ alm->pending = !!(pdn2 & RTC_PDN2_PWRON_ALARM); |
1206 |
+ mutex_unlock(&rtc->lock); |
1207 |
+ |
1208 |
+- tm->tm_sec = data[RTC_OFFSET_SEC]; |
1209 |
+- tm->tm_min = data[RTC_OFFSET_MIN]; |
1210 |
+- tm->tm_hour = data[RTC_OFFSET_HOUR]; |
1211 |
+- tm->tm_mday = data[RTC_OFFSET_DOM]; |
1212 |
+- tm->tm_mon = data[RTC_OFFSET_MTH]; |
1213 |
+- tm->tm_year = data[RTC_OFFSET_YEAR]; |
1214 |
++ tm->tm_sec = data[RTC_OFFSET_SEC] & RTC_AL_SEC_MASK; |
1215 |
++ tm->tm_min = data[RTC_OFFSET_MIN] & RTC_AL_MIN_MASK; |
1216 |
++ tm->tm_hour = data[RTC_OFFSET_HOUR] & RTC_AL_HOU_MASK; |
1217 |
++ tm->tm_mday = data[RTC_OFFSET_DOM] & RTC_AL_DOM_MASK; |
1218 |
++ tm->tm_mon = data[RTC_OFFSET_MTH] & RTC_AL_MTH_MASK; |
1219 |
++ tm->tm_year = data[RTC_OFFSET_YEAR] & RTC_AL_YEA_MASK; |
1220 |
+ |
1221 |
+ tm->tm_year += RTC_MIN_YEAR_OFFSET; |
1222 |
+ tm->tm_mon--; |
1223 |
+@@ -259,14 +267,25 @@ static int mtk_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) |
1224 |
+ tm->tm_year -= RTC_MIN_YEAR_OFFSET; |
1225 |
+ tm->tm_mon++; |
1226 |
+ |
1227 |
+- data[RTC_OFFSET_SEC] = tm->tm_sec; |
1228 |
+- data[RTC_OFFSET_MIN] = tm->tm_min; |
1229 |
+- data[RTC_OFFSET_HOUR] = tm->tm_hour; |
1230 |
+- data[RTC_OFFSET_DOM] = tm->tm_mday; |
1231 |
+- data[RTC_OFFSET_MTH] = tm->tm_mon; |
1232 |
+- data[RTC_OFFSET_YEAR] = tm->tm_year; |
1233 |
+- |
1234 |
+ mutex_lock(&rtc->lock); |
1235 |
++ ret = regmap_bulk_read(rtc->regmap, rtc->addr_base + RTC_AL_SEC, |
1236 |
++ data, RTC_OFFSET_COUNT); |
1237 |
++ if (ret < 0) |
1238 |
++ goto exit; |
1239 |
++ |
1240 |
++ data[RTC_OFFSET_SEC] = ((data[RTC_OFFSET_SEC] & ~(RTC_AL_SEC_MASK)) | |
1241 |
++ (tm->tm_sec & RTC_AL_SEC_MASK)); |
1242 |
++ data[RTC_OFFSET_MIN] = ((data[RTC_OFFSET_MIN] & ~(RTC_AL_MIN_MASK)) | |
1243 |
++ (tm->tm_min & RTC_AL_MIN_MASK)); |
1244 |
++ data[RTC_OFFSET_HOUR] = ((data[RTC_OFFSET_HOUR] & ~(RTC_AL_HOU_MASK)) | |
1245 |
++ (tm->tm_hour & RTC_AL_HOU_MASK)); |
1246 |
++ data[RTC_OFFSET_DOM] = ((data[RTC_OFFSET_DOM] & ~(RTC_AL_DOM_MASK)) | |
1247 |
++ (tm->tm_mday & RTC_AL_DOM_MASK)); |
1248 |
++ data[RTC_OFFSET_MTH] = ((data[RTC_OFFSET_MTH] & ~(RTC_AL_MTH_MASK)) | |
1249 |
++ (tm->tm_mon & RTC_AL_MTH_MASK)); |
1250 |
++ data[RTC_OFFSET_YEAR] = ((data[RTC_OFFSET_YEAR] & ~(RTC_AL_YEA_MASK)) | |
1251 |
++ (tm->tm_year & RTC_AL_YEA_MASK)); |
1252 |
++ |
1253 |
+ if (alm->enabled) { |
1254 |
+ ret = regmap_bulk_write(rtc->regmap, |
1255 |
+ rtc->addr_base + RTC_AL_SEC, |
1256 |
+diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c |
1257 |
+index 72894378ffcf..81de52943b01 100644 |
1258 |
+--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c |
1259 |
++++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c |
1260 |
+@@ -915,12 +915,12 @@ void bnx2i_free_hba(struct bnx2i_hba *hba) |
1261 |
+ INIT_LIST_HEAD(&hba->ep_ofld_list); |
1262 |
+ INIT_LIST_HEAD(&hba->ep_active_list); |
1263 |
+ INIT_LIST_HEAD(&hba->ep_destroy_list); |
1264 |
+- pci_dev_put(hba->pcidev); |
1265 |
+ |
1266 |
+ if (hba->regview) { |
1267 |
+ pci_iounmap(hba->pcidev, hba->regview); |
1268 |
+ hba->regview = NULL; |
1269 |
+ } |
1270 |
++ pci_dev_put(hba->pcidev); |
1271 |
+ bnx2i_free_mp_bdt(hba); |
1272 |
+ bnx2i_release_free_cid_que(hba); |
1273 |
+ iscsi_host_free(shost); |
1274 |
+diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c |
1275 |
+index 7bd376d95ed5..b02ac389e6c6 100644 |
1276 |
+--- a/drivers/scsi/esas2r/esas2r_flash.c |
1277 |
++++ b/drivers/scsi/esas2r/esas2r_flash.c |
1278 |
+@@ -1197,6 +1197,7 @@ bool esas2r_nvram_read_direct(struct esas2r_adapter *a) |
1279 |
+ if (!esas2r_read_flash_block(a, a->nvram, FLS_OFFSET_NVR, |
1280 |
+ sizeof(struct esas2r_sas_nvram))) { |
1281 |
+ esas2r_hdebug("NVRAM read failed, using defaults"); |
1282 |
++ up(&a->nvram_semaphore); |
1283 |
+ return false; |
1284 |
+ } |
1285 |
+ |
1286 |
+diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c |
1287 |
+index 9795d6f3e197..c5b89a003d2a 100644 |
1288 |
+--- a/drivers/scsi/fnic/vnic_dev.c |
1289 |
++++ b/drivers/scsi/fnic/vnic_dev.c |
1290 |
+@@ -445,26 +445,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done) |
1291 |
+ |
1292 |
+ int vnic_dev_hang_notify(struct vnic_dev *vdev) |
1293 |
+ { |
1294 |
+- u64 a0, a1; |
1295 |
++ u64 a0 = 0, a1 = 0; |
1296 |
+ int wait = 1000; |
1297 |
+ return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait); |
1298 |
+ } |
1299 |
+ |
1300 |
+ int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr) |
1301 |
+ { |
1302 |
+- u64 a0, a1; |
1303 |
++ u64 a[2] = {}; |
1304 |
+ int wait = 1000; |
1305 |
+ int err, i; |
1306 |
+ |
1307 |
+ for (i = 0; i < ETH_ALEN; i++) |
1308 |
+ mac_addr[i] = 0; |
1309 |
+ |
1310 |
+- err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait); |
1311 |
++ err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a[0], &a[1], wait); |
1312 |
+ if (err) |
1313 |
+ return err; |
1314 |
+ |
1315 |
+ for (i = 0; i < ETH_ALEN; i++) |
1316 |
+- mac_addr[i] = ((u8 *)&a0)[i]; |
1317 |
++ mac_addr[i] = ((u8 *)&a)[i]; |
1318 |
+ |
1319 |
+ return 0; |
1320 |
+ } |
1321 |
+@@ -489,38 +489,32 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast, |
1322 |
+ |
1323 |
+ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) |
1324 |
+ { |
1325 |
+- u64 a0 = 0, a1 = 0; |
1326 |
++ u64 a[2] = {}; |
1327 |
+ int wait = 1000; |
1328 |
+ int err; |
1329 |
+ int i; |
1330 |
+ |
1331 |
+ for (i = 0; i < ETH_ALEN; i++) |
1332 |
+- ((u8 *)&a0)[i] = addr[i]; |
1333 |
++ ((u8 *)&a)[i] = addr[i]; |
1334 |
+ |
1335 |
+- err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait); |
1336 |
++ err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a[0], &a[1], wait); |
1337 |
+ if (err) |
1338 |
+- printk(KERN_ERR |
1339 |
+- "Can't add addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n", |
1340 |
+- addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], |
1341 |
+- err); |
1342 |
++ pr_err("Can't add addr [%pM], %d\n", addr, err); |
1343 |
+ } |
1344 |
+ |
1345 |
+ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) |
1346 |
+ { |
1347 |
+- u64 a0 = 0, a1 = 0; |
1348 |
++ u64 a[2] = {}; |
1349 |
+ int wait = 1000; |
1350 |
+ int err; |
1351 |
+ int i; |
1352 |
+ |
1353 |
+ for (i = 0; i < ETH_ALEN; i++) |
1354 |
+- ((u8 *)&a0)[i] = addr[i]; |
1355 |
++ ((u8 *)&a)[i] = addr[i]; |
1356 |
+ |
1357 |
+- err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait); |
1358 |
++ err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a[0], &a[1], wait); |
1359 |
+ if (err) |
1360 |
+- printk(KERN_ERR |
1361 |
+- "Can't del addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n", |
1362 |
+- addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], |
1363 |
+- err); |
1364 |
++ pr_err("Can't del addr [%pM], %d\n", addr, err); |
1365 |
+ } |
1366 |
+ |
1367 |
+ int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) |
1368 |
+diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c |
1369 |
+index c291fdff1b33..ea3b77ba12a2 100644 |
1370 |
+--- a/drivers/scsi/qla4xxx/ql4_mbx.c |
1371 |
++++ b/drivers/scsi/qla4xxx/ql4_mbx.c |
1372 |
+@@ -641,9 +641,6 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha) |
1373 |
+ |
1374 |
+ if (qla4xxx_get_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) != |
1375 |
+ QLA_SUCCESS) { |
1376 |
+- dma_free_coherent(&ha->pdev->dev, |
1377 |
+- sizeof(struct addr_ctrl_blk), |
1378 |
+- init_fw_cb, init_fw_cb_dma); |
1379 |
+ goto exit_init_fw_cb; |
1380 |
+ } |
1381 |
+ |
1382 |
+diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_trace.c |
1383 |
+index 551fd0329bca..33700ce7d499 100644 |
1384 |
+--- a/drivers/scsi/scsi_trace.c |
1385 |
++++ b/drivers/scsi/scsi_trace.c |
1386 |
+@@ -17,10 +17,11 @@ |
1387 |
+ */ |
1388 |
+ #include <linux/kernel.h> |
1389 |
+ #include <linux/trace_seq.h> |
1390 |
++#include <asm/unaligned.h> |
1391 |
+ #include <trace/events/scsi.h> |
1392 |
+ |
1393 |
+ #define SERVICE_ACTION16(cdb) (cdb[1] & 0x1f) |
1394 |
+-#define SERVICE_ACTION32(cdb) ((cdb[8] << 8) | cdb[9]) |
1395 |
++#define SERVICE_ACTION32(cdb) (get_unaligned_be16(&cdb[8])) |
1396 |
+ |
1397 |
+ static const char * |
1398 |
+ scsi_trace_misc(struct trace_seq *, unsigned char *, int); |
1399 |
+@@ -50,17 +51,12 @@ static const char * |
1400 |
+ scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len) |
1401 |
+ { |
1402 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1403 |
+- sector_t lba = 0, txlen = 0; |
1404 |
++ u32 lba, txlen; |
1405 |
+ |
1406 |
+- lba |= (cdb[2] << 24); |
1407 |
+- lba |= (cdb[3] << 16); |
1408 |
+- lba |= (cdb[4] << 8); |
1409 |
+- lba |= cdb[5]; |
1410 |
+- txlen |= (cdb[7] << 8); |
1411 |
+- txlen |= cdb[8]; |
1412 |
++ lba = get_unaligned_be32(&cdb[2]); |
1413 |
++ txlen = get_unaligned_be16(&cdb[7]); |
1414 |
+ |
1415 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1416 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1417 |
++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen, |
1418 |
+ cdb[1] >> 5); |
1419 |
+ |
1420 |
+ if (cdb[0] == WRITE_SAME) |
1421 |
+@@ -75,19 +71,12 @@ static const char * |
1422 |
+ scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len) |
1423 |
+ { |
1424 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1425 |
+- sector_t lba = 0, txlen = 0; |
1426 |
+- |
1427 |
+- lba |= (cdb[2] << 24); |
1428 |
+- lba |= (cdb[3] << 16); |
1429 |
+- lba |= (cdb[4] << 8); |
1430 |
+- lba |= cdb[5]; |
1431 |
+- txlen |= (cdb[6] << 24); |
1432 |
+- txlen |= (cdb[7] << 16); |
1433 |
+- txlen |= (cdb[8] << 8); |
1434 |
+- txlen |= cdb[9]; |
1435 |
+- |
1436 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1437 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1438 |
++ u32 lba, txlen; |
1439 |
++ |
1440 |
++ lba = get_unaligned_be32(&cdb[2]); |
1441 |
++ txlen = get_unaligned_be32(&cdb[6]); |
1442 |
++ |
1443 |
++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen, |
1444 |
+ cdb[1] >> 5); |
1445 |
+ trace_seq_putc(p, 0); |
1446 |
+ |
1447 |
+@@ -98,23 +87,13 @@ static const char * |
1448 |
+ scsi_trace_rw16(struct trace_seq *p, unsigned char *cdb, int len) |
1449 |
+ { |
1450 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1451 |
+- sector_t lba = 0, txlen = 0; |
1452 |
+- |
1453 |
+- lba |= ((u64)cdb[2] << 56); |
1454 |
+- lba |= ((u64)cdb[3] << 48); |
1455 |
+- lba |= ((u64)cdb[4] << 40); |
1456 |
+- lba |= ((u64)cdb[5] << 32); |
1457 |
+- lba |= (cdb[6] << 24); |
1458 |
+- lba |= (cdb[7] << 16); |
1459 |
+- lba |= (cdb[8] << 8); |
1460 |
+- lba |= cdb[9]; |
1461 |
+- txlen |= (cdb[10] << 24); |
1462 |
+- txlen |= (cdb[11] << 16); |
1463 |
+- txlen |= (cdb[12] << 8); |
1464 |
+- txlen |= cdb[13]; |
1465 |
+- |
1466 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1467 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1468 |
++ u64 lba; |
1469 |
++ u32 txlen; |
1470 |
++ |
1471 |
++ lba = get_unaligned_be64(&cdb[2]); |
1472 |
++ txlen = get_unaligned_be32(&cdb[10]); |
1473 |
++ |
1474 |
++ trace_seq_printf(p, "lba=%llu txlen=%u protect=%u", lba, txlen, |
1475 |
+ cdb[1] >> 5); |
1476 |
+ |
1477 |
+ if (cdb[0] == WRITE_SAME_16) |
1478 |
+@@ -129,8 +108,8 @@ static const char * |
1479 |
+ scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) |
1480 |
+ { |
1481 |
+ const char *ret = trace_seq_buffer_ptr(p), *cmd; |
1482 |
+- sector_t lba = 0, txlen = 0; |
1483 |
+- u32 ei_lbrt = 0; |
1484 |
++ u64 lba; |
1485 |
++ u32 ei_lbrt, txlen; |
1486 |
+ |
1487 |
+ switch (SERVICE_ACTION32(cdb)) { |
1488 |
+ case READ_32: |
1489 |
+@@ -150,26 +129,12 @@ scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) |
1490 |
+ goto out; |
1491 |
+ } |
1492 |
+ |
1493 |
+- lba |= ((u64)cdb[12] << 56); |
1494 |
+- lba |= ((u64)cdb[13] << 48); |
1495 |
+- lba |= ((u64)cdb[14] << 40); |
1496 |
+- lba |= ((u64)cdb[15] << 32); |
1497 |
+- lba |= (cdb[16] << 24); |
1498 |
+- lba |= (cdb[17] << 16); |
1499 |
+- lba |= (cdb[18] << 8); |
1500 |
+- lba |= cdb[19]; |
1501 |
+- ei_lbrt |= (cdb[20] << 24); |
1502 |
+- ei_lbrt |= (cdb[21] << 16); |
1503 |
+- ei_lbrt |= (cdb[22] << 8); |
1504 |
+- ei_lbrt |= cdb[23]; |
1505 |
+- txlen |= (cdb[28] << 24); |
1506 |
+- txlen |= (cdb[29] << 16); |
1507 |
+- txlen |= (cdb[30] << 8); |
1508 |
+- txlen |= cdb[31]; |
1509 |
+- |
1510 |
+- trace_seq_printf(p, "%s_32 lba=%llu txlen=%llu protect=%u ei_lbrt=%u", |
1511 |
+- cmd, (unsigned long long)lba, |
1512 |
+- (unsigned long long)txlen, cdb[10] >> 5, ei_lbrt); |
1513 |
++ lba = get_unaligned_be64(&cdb[12]); |
1514 |
++ ei_lbrt = get_unaligned_be32(&cdb[20]); |
1515 |
++ txlen = get_unaligned_be32(&cdb[28]); |
1516 |
++ |
1517 |
++ trace_seq_printf(p, "%s_32 lba=%llu txlen=%u protect=%u ei_lbrt=%u", |
1518 |
++ cmd, lba, txlen, cdb[10] >> 5, ei_lbrt); |
1519 |
+ |
1520 |
+ if (SERVICE_ACTION32(cdb) == WRITE_SAME_32) |
1521 |
+ trace_seq_printf(p, " unmap=%u", cdb[10] >> 3 & 1); |
1522 |
+@@ -184,7 +149,7 @@ static const char * |
1523 |
+ scsi_trace_unmap(struct trace_seq *p, unsigned char *cdb, int len) |
1524 |
+ { |
1525 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1526 |
+- unsigned int regions = cdb[7] << 8 | cdb[8]; |
1527 |
++ unsigned int regions = get_unaligned_be16(&cdb[7]); |
1528 |
+ |
1529 |
+ trace_seq_printf(p, "regions=%u", (regions - 8) / 16); |
1530 |
+ trace_seq_putc(p, 0); |
1531 |
+@@ -196,8 +161,8 @@ static const char * |
1532 |
+ scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len) |
1533 |
+ { |
1534 |
+ const char *ret = trace_seq_buffer_ptr(p), *cmd; |
1535 |
+- sector_t lba = 0; |
1536 |
+- u32 alloc_len = 0; |
1537 |
++ u64 lba; |
1538 |
++ u32 alloc_len; |
1539 |
+ |
1540 |
+ switch (SERVICE_ACTION16(cdb)) { |
1541 |
+ case SAI_READ_CAPACITY_16: |
1542 |
+@@ -211,21 +176,10 @@ scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len) |
1543 |
+ goto out; |
1544 |
+ } |
1545 |
+ |
1546 |
+- lba |= ((u64)cdb[2] << 56); |
1547 |
+- lba |= ((u64)cdb[3] << 48); |
1548 |
+- lba |= ((u64)cdb[4] << 40); |
1549 |
+- lba |= ((u64)cdb[5] << 32); |
1550 |
+- lba |= (cdb[6] << 24); |
1551 |
+- lba |= (cdb[7] << 16); |
1552 |
+- lba |= (cdb[8] << 8); |
1553 |
+- lba |= cdb[9]; |
1554 |
+- alloc_len |= (cdb[10] << 24); |
1555 |
+- alloc_len |= (cdb[11] << 16); |
1556 |
+- alloc_len |= (cdb[12] << 8); |
1557 |
+- alloc_len |= cdb[13]; |
1558 |
+- |
1559 |
+- trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd, |
1560 |
+- (unsigned long long)lba, alloc_len); |
1561 |
++ lba = get_unaligned_be64(&cdb[2]); |
1562 |
++ alloc_len = get_unaligned_be32(&cdb[10]); |
1563 |
++ |
1564 |
++ trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd, lba, alloc_len); |
1565 |
+ |
1566 |
+ out: |
1567 |
+ trace_seq_putc(p, 0); |
1568 |
+diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c |
1569 |
+index 91b9eca75b75..cad9ef012a14 100644 |
1570 |
+--- a/drivers/scsi/sd.c |
1571 |
++++ b/drivers/scsi/sd.c |
1572 |
+@@ -1998,8 +1998,10 @@ static int sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer |
1573 |
+ u8 type; |
1574 |
+ int ret = 0; |
1575 |
+ |
1576 |
+- if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) |
1577 |
++ if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) { |
1578 |
++ sdkp->protection_type = 0; |
1579 |
+ return ret; |
1580 |
++ } |
1581 |
+ |
1582 |
+ type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ |
1583 |
+ |
1584 |
+diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c |
1585 |
+index 691c04b3e5b6..938840af9c50 100644 |
1586 |
+--- a/drivers/spi/spi-atmel.c |
1587 |
++++ b/drivers/spi/spi-atmel.c |
1588 |
+@@ -315,7 +315,6 @@ struct atmel_spi { |
1589 |
+ struct atmel_spi_dma dma; |
1590 |
+ |
1591 |
+ bool keep_cs; |
1592 |
+- bool cs_active; |
1593 |
+ |
1594 |
+ u32 fifo_size; |
1595 |
+ }; |
1596 |
+@@ -1404,11 +1403,9 @@ static int atmel_spi_one_transfer(struct spi_master *master, |
1597 |
+ &msg->transfers)) { |
1598 |
+ as->keep_cs = true; |
1599 |
+ } else { |
1600 |
+- as->cs_active = !as->cs_active; |
1601 |
+- if (as->cs_active) |
1602 |
+- cs_activate(as, msg->spi); |
1603 |
+- else |
1604 |
+- cs_deactivate(as, msg->spi); |
1605 |
++ cs_deactivate(as, msg->spi); |
1606 |
++ udelay(10); |
1607 |
++ cs_activate(as, msg->spi); |
1608 |
+ } |
1609 |
+ } |
1610 |
+ |
1611 |
+@@ -1431,7 +1428,6 @@ static int atmel_spi_transfer_one_message(struct spi_master *master, |
1612 |
+ atmel_spi_lock(as); |
1613 |
+ cs_activate(as, spi); |
1614 |
+ |
1615 |
+- as->cs_active = true; |
1616 |
+ as->keep_cs = false; |
1617 |
+ |
1618 |
+ msg->status = 0; |
1619 |
+diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c |
1620 |
+index cb6497ce4b61..6e75095af681 100644 |
1621 |
+--- a/drivers/target/target_core_fabric_lib.c |
1622 |
++++ b/drivers/target/target_core_fabric_lib.c |
1623 |
+@@ -130,7 +130,7 @@ static int srp_get_pr_transport_id( |
1624 |
+ memset(buf + 8, 0, leading_zero_bytes); |
1625 |
+ rc = hex2bin(buf + 8 + leading_zero_bytes, p, count); |
1626 |
+ if (rc < 0) { |
1627 |
+- pr_debug("hex2bin failed for %s: %d\n", __func__, rc); |
1628 |
++ pr_debug("hex2bin failed for %s: %d\n", p, rc); |
1629 |
+ return rc; |
1630 |
+ } |
1631 |
+ |
1632 |
+diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c |
1633 |
+index d607cb2eb64e..b59d0dafefab 100644 |
1634 |
+--- a/drivers/tty/serial/imx.c |
1635 |
++++ b/drivers/tty/serial/imx.c |
1636 |
+@@ -545,7 +545,7 @@ static void imx_dma_tx(struct imx_port *sport) |
1637 |
+ dev_err(dev, "DMA mapping error for TX.\n"); |
1638 |
+ return; |
1639 |
+ } |
1640 |
+- desc = dmaengine_prep_slave_sg(chan, sgl, sport->dma_tx_nents, |
1641 |
++ desc = dmaengine_prep_slave_sg(chan, sgl, ret, |
1642 |
+ DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); |
1643 |
+ if (!desc) { |
1644 |
+ dma_unmap_sg(dev, sgl, sport->dma_tx_nents, |
1645 |
+diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c |
1646 |
+index ea4ffc2ebb2f..d23f09e151f8 100644 |
1647 |
+--- a/drivers/tty/serial/pch_uart.c |
1648 |
++++ b/drivers/tty/serial/pch_uart.c |
1649 |
+@@ -251,6 +251,7 @@ struct eg20t_port { |
1650 |
+ struct dma_chan *chan_rx; |
1651 |
+ struct scatterlist *sg_tx_p; |
1652 |
+ int nent; |
1653 |
++ int orig_nent; |
1654 |
+ struct scatterlist sg_rx; |
1655 |
+ int tx_dma_use; |
1656 |
+ void *rx_buf_virt; |
1657 |
+@@ -804,9 +805,10 @@ static void pch_dma_tx_complete(void *arg) |
1658 |
+ } |
1659 |
+ xmit->tail &= UART_XMIT_SIZE - 1; |
1660 |
+ async_tx_ack(priv->desc_tx); |
1661 |
+- dma_unmap_sg(port->dev, sg, priv->nent, DMA_TO_DEVICE); |
1662 |
++ dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE); |
1663 |
+ priv->tx_dma_use = 0; |
1664 |
+ priv->nent = 0; |
1665 |
++ priv->orig_nent = 0; |
1666 |
+ kfree(priv->sg_tx_p); |
1667 |
+ pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT); |
1668 |
+ } |
1669 |
+@@ -1031,6 +1033,7 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv) |
1670 |
+ dev_err(priv->port.dev, "%s:dma_map_sg Failed\n", __func__); |
1671 |
+ return 0; |
1672 |
+ } |
1673 |
++ priv->orig_nent = num; |
1674 |
+ priv->nent = nent; |
1675 |
+ |
1676 |
+ for (i = 0; i < nent; i++, sg++) { |
1677 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
1678 |
+index 7805f3e535ec..75a07b73a82b 100644 |
1679 |
+--- a/drivers/usb/core/hub.c |
1680 |
++++ b/drivers/usb/core/hub.c |
1681 |
+@@ -1146,6 +1146,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) |
1682 |
+ * PORT_OVER_CURRENT is not. So check for any of them. |
1683 |
+ */ |
1684 |
+ if (udev || (portstatus & USB_PORT_STAT_CONNECTION) || |
1685 |
++ (portchange & USB_PORT_STAT_C_CONNECTION) || |
1686 |
+ (portstatus & USB_PORT_STAT_OVERCURRENT) || |
1687 |
+ (portchange & USB_PORT_STAT_C_OVERCURRENT)) |
1688 |
+ set_bit(port1, hub->change_bits); |
1689 |
+diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c |
1690 |
+index f73ea14e8173..e8a8c4fa944f 100644 |
1691 |
+--- a/drivers/usb/serial/ch341.c |
1692 |
++++ b/drivers/usb/serial/ch341.c |
1693 |
+@@ -555,9 +555,13 @@ static int ch341_tiocmget(struct tty_struct *tty) |
1694 |
+ static int ch341_reset_resume(struct usb_serial *serial) |
1695 |
+ { |
1696 |
+ struct usb_serial_port *port = serial->port[0]; |
1697 |
+- struct ch341_private *priv = usb_get_serial_port_data(port); |
1698 |
++ struct ch341_private *priv; |
1699 |
+ int ret; |
1700 |
+ |
1701 |
++ priv = usb_get_serial_port_data(port); |
1702 |
++ if (!priv) |
1703 |
++ return 0; |
1704 |
++ |
1705 |
+ /* reconfigure ch341 serial port after bus-reset */ |
1706 |
+ ch341_configure(serial->dev, priv); |
1707 |
+ |
1708 |
+diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c |
1709 |
+index 0de11898fee7..75c60e74438d 100644 |
1710 |
+--- a/drivers/usb/serial/io_edgeport.c |
1711 |
++++ b/drivers/usb/serial/io_edgeport.c |
1712 |
+@@ -572,6 +572,7 @@ static void edge_interrupt_callback(struct urb *urb) |
1713 |
+ struct usb_serial_port *port; |
1714 |
+ unsigned char *data = urb->transfer_buffer; |
1715 |
+ int length = urb->actual_length; |
1716 |
++ unsigned long flags; |
1717 |
+ int bytes_avail; |
1718 |
+ int position; |
1719 |
+ int txCredits; |
1720 |
+@@ -603,7 +604,7 @@ static void edge_interrupt_callback(struct urb *urb) |
1721 |
+ if (length > 1) { |
1722 |
+ bytes_avail = data[0] | (data[1] << 8); |
1723 |
+ if (bytes_avail) { |
1724 |
+- spin_lock(&edge_serial->es_lock); |
1725 |
++ spin_lock_irqsave(&edge_serial->es_lock, flags); |
1726 |
+ edge_serial->rxBytesAvail += bytes_avail; |
1727 |
+ dev_dbg(dev, |
1728 |
+ "%s - bytes_avail=%d, rxBytesAvail=%d, read_in_progress=%d\n", |
1729 |
+@@ -626,7 +627,8 @@ static void edge_interrupt_callback(struct urb *urb) |
1730 |
+ edge_serial->read_in_progress = false; |
1731 |
+ } |
1732 |
+ } |
1733 |
+- spin_unlock(&edge_serial->es_lock); |
1734 |
++ spin_unlock_irqrestore(&edge_serial->es_lock, |
1735 |
++ flags); |
1736 |
+ } |
1737 |
+ } |
1738 |
+ /* grab the txcredits for the ports if available */ |
1739 |
+@@ -638,10 +640,12 @@ static void edge_interrupt_callback(struct urb *urb) |
1740 |
+ if (txCredits) { |
1741 |
+ port = edge_serial->serial->port[portNumber]; |
1742 |
+ edge_port = usb_get_serial_port_data(port); |
1743 |
+- if (edge_port->open) { |
1744 |
+- spin_lock(&edge_port->ep_lock); |
1745 |
++ if (edge_port && edge_port->open) { |
1746 |
++ spin_lock_irqsave(&edge_port->ep_lock, |
1747 |
++ flags); |
1748 |
+ edge_port->txCredits += txCredits; |
1749 |
+- spin_unlock(&edge_port->ep_lock); |
1750 |
++ spin_unlock_irqrestore(&edge_port->ep_lock, |
1751 |
++ flags); |
1752 |
+ dev_dbg(dev, "%s - txcredits for port%d = %d\n", |
1753 |
+ __func__, portNumber, |
1754 |
+ edge_port->txCredits); |
1755 |
+@@ -682,6 +686,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
1756 |
+ int retval; |
1757 |
+ __u16 raw_data_length; |
1758 |
+ int status = urb->status; |
1759 |
++ unsigned long flags; |
1760 |
+ |
1761 |
+ if (status) { |
1762 |
+ dev_dbg(&urb->dev->dev, "%s - nonzero read bulk status received: %d\n", |
1763 |
+@@ -701,7 +706,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
1764 |
+ |
1765 |
+ usb_serial_debug_data(dev, __func__, raw_data_length, data); |
1766 |
+ |
1767 |
+- spin_lock(&edge_serial->es_lock); |
1768 |
++ spin_lock_irqsave(&edge_serial->es_lock, flags); |
1769 |
+ |
1770 |
+ /* decrement our rxBytes available by the number that we just got */ |
1771 |
+ edge_serial->rxBytesAvail -= raw_data_length; |
1772 |
+@@ -725,7 +730,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
1773 |
+ edge_serial->read_in_progress = false; |
1774 |
+ } |
1775 |
+ |
1776 |
+- spin_unlock(&edge_serial->es_lock); |
1777 |
++ spin_unlock_irqrestore(&edge_serial->es_lock, flags); |
1778 |
+ } |
1779 |
+ |
1780 |
+ |
1781 |
+@@ -1666,7 +1671,8 @@ static void edge_break(struct tty_struct *tty, int break_state) |
1782 |
+ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
1783 |
+ unsigned char *buffer, __u16 bufferLength) |
1784 |
+ { |
1785 |
+- struct device *dev = &edge_serial->serial->dev->dev; |
1786 |
++ struct usb_serial *serial = edge_serial->serial; |
1787 |
++ struct device *dev = &serial->dev->dev; |
1788 |
+ struct usb_serial_port *port; |
1789 |
+ struct edgeport_port *edge_port; |
1790 |
+ __u16 lastBufferLength; |
1791 |
+@@ -1771,11 +1777,10 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
1792 |
+ |
1793 |
+ /* spit this data back into the tty driver if this |
1794 |
+ port is open */ |
1795 |
+- if (rxLen) { |
1796 |
+- port = edge_serial->serial->port[ |
1797 |
+- edge_serial->rxPort]; |
1798 |
++ if (rxLen && edge_serial->rxPort < serial->num_ports) { |
1799 |
++ port = serial->port[edge_serial->rxPort]; |
1800 |
+ edge_port = usb_get_serial_port_data(port); |
1801 |
+- if (edge_port->open) { |
1802 |
++ if (edge_port && edge_port->open) { |
1803 |
+ dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", |
1804 |
+ __func__, rxLen, |
1805 |
+ edge_serial->rxPort); |
1806 |
+@@ -1783,8 +1788,8 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
1807 |
+ rxLen); |
1808 |
+ edge_port->port->icount.rx += rxLen; |
1809 |
+ } |
1810 |
+- buffer += rxLen; |
1811 |
+ } |
1812 |
++ buffer += rxLen; |
1813 |
+ break; |
1814 |
+ |
1815 |
+ case EXPECT_HDR3: /* Expect 3rd byte of status header */ |
1816 |
+@@ -1819,6 +1824,8 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial, |
1817 |
+ __u8 code = edge_serial->rxStatusCode; |
1818 |
+ |
1819 |
+ /* switch the port pointer to the one being currently talked about */ |
1820 |
++ if (edge_serial->rxPort >= edge_serial->serial->num_ports) |
1821 |
++ return; |
1822 |
+ port = edge_serial->serial->port[edge_serial->rxPort]; |
1823 |
+ edge_port = usb_get_serial_port_data(port); |
1824 |
+ if (edge_port == NULL) { |
1825 |
+diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c |
1826 |
+index 38112be0dbae..a79e9adf4e53 100644 |
1827 |
+--- a/drivers/usb/serial/keyspan.c |
1828 |
++++ b/drivers/usb/serial/keyspan.c |
1829 |
+@@ -565,6 +565,8 @@ static void usa49_glocont_callback(struct urb *urb) |
1830 |
+ for (i = 0; i < serial->num_ports; ++i) { |
1831 |
+ port = serial->port[i]; |
1832 |
+ p_priv = usb_get_serial_port_data(port); |
1833 |
++ if (!p_priv) |
1834 |
++ continue; |
1835 |
+ |
1836 |
+ if (p_priv->resend_cont) { |
1837 |
+ dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
1838 |
+@@ -962,6 +964,8 @@ static void usa67_glocont_callback(struct urb *urb) |
1839 |
+ for (i = 0; i < serial->num_ports; ++i) { |
1840 |
+ port = serial->port[i]; |
1841 |
+ p_priv = usb_get_serial_port_data(port); |
1842 |
++ if (!p_priv) |
1843 |
++ continue; |
1844 |
+ |
1845 |
+ if (p_priv->resend_cont) { |
1846 |
+ dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
1847 |
+diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c |
1848 |
+index 64bf258e7e00..9606dde3194c 100644 |
1849 |
+--- a/drivers/usb/serial/opticon.c |
1850 |
++++ b/drivers/usb/serial/opticon.c |
1851 |
+@@ -116,7 +116,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, |
1852 |
+ retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
1853 |
+ requesttype, |
1854 |
+ USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE, |
1855 |
+- 0, 0, buffer, 1, 0); |
1856 |
++ 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT); |
1857 |
+ kfree(buffer); |
1858 |
+ |
1859 |
+ if (retval < 0) |
1860 |
+diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c |
1861 |
+index af0c87276299..82f28192694f 100644 |
1862 |
+--- a/drivers/usb/serial/quatech2.c |
1863 |
++++ b/drivers/usb/serial/quatech2.c |
1864 |
+@@ -872,7 +872,10 @@ static void qt2_update_msr(struct usb_serial_port *port, unsigned char *ch) |
1865 |
+ u8 newMSR = (u8) *ch; |
1866 |
+ unsigned long flags; |
1867 |
+ |
1868 |
++ /* May be called from qt2_process_read_urb() for an unbound port. */ |
1869 |
+ port_priv = usb_get_serial_port_data(port); |
1870 |
++ if (!port_priv) |
1871 |
++ return; |
1872 |
+ |
1873 |
+ spin_lock_irqsave(&port_priv->lock, flags); |
1874 |
+ port_priv->shadowMSR = newMSR; |
1875 |
+@@ -900,7 +903,10 @@ static void qt2_update_lsr(struct usb_serial_port *port, unsigned char *ch) |
1876 |
+ unsigned long flags; |
1877 |
+ u8 newLSR = (u8) *ch; |
1878 |
+ |
1879 |
++ /* May be called from qt2_process_read_urb() for an unbound port. */ |
1880 |
+ port_priv = usb_get_serial_port_data(port); |
1881 |
++ if (!port_priv) |
1882 |
++ return; |
1883 |
+ |
1884 |
+ if (newLSR & UART_LSR_BI) |
1885 |
+ newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI); |
1886 |
+diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c |
1887 |
+index 511242111403..15e05ebf37ac 100644 |
1888 |
+--- a/drivers/usb/serial/usb-serial-simple.c |
1889 |
++++ b/drivers/usb/serial/usb-serial-simple.c |
1890 |
+@@ -89,6 +89,8 @@ DEVICE(moto_modem, MOTO_IDS); |
1891 |
+ #define MOTOROLA_TETRA_IDS() \ |
1892 |
+ { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \ |
1893 |
+ { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \ |
1894 |
++ { USB_DEVICE(0x0cad, 0x9013) }, /* MTP3xxx */ \ |
1895 |
++ { USB_DEVICE(0x0cad, 0x9015) }, /* MTP85xx */ \ |
1896 |
+ { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */ |
1897 |
+ DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS); |
1898 |
+ |
1899 |
+diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c |
1900 |
+index 80ba818d3a21..25bee7aba690 100644 |
1901 |
+--- a/drivers/usb/serial/usb-serial.c |
1902 |
++++ b/drivers/usb/serial/usb-serial.c |
1903 |
+@@ -1350,6 +1350,9 @@ static int usb_serial_register(struct usb_serial_driver *driver) |
1904 |
+ return -EINVAL; |
1905 |
+ } |
1906 |
+ |
1907 |
++ /* Prevent individual ports from being unbound. */ |
1908 |
++ driver->driver.suppress_bind_attrs = true; |
1909 |
++ |
1910 |
+ usb_serial_operations_init(driver); |
1911 |
+ |
1912 |
+ /* Add this device to our list of devices */ |
1913 |
+diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c |
1914 |
+index 1c789056e7e8..d6f5a74df973 100644 |
1915 |
+--- a/drivers/xen/balloon.c |
1916 |
++++ b/drivers/xen/balloon.c |
1917 |
+@@ -584,8 +584,15 @@ static void balloon_process(struct work_struct *work) |
1918 |
+ state = reserve_additional_memory(); |
1919 |
+ } |
1920 |
+ |
1921 |
+- if (credit < 0) |
1922 |
+- state = decrease_reservation(-credit, GFP_BALLOON); |
1923 |
++ if (credit < 0) { |
1924 |
++ long n_pages; |
1925 |
++ |
1926 |
++ n_pages = min(-credit, si_mem_available()); |
1927 |
++ state = decrease_reservation(n_pages, GFP_BALLOON); |
1928 |
++ if (state == BP_DONE && n_pages != -credit && |
1929 |
++ n_pages < totalreserve_pages) |
1930 |
++ state = BP_EAGAIN; |
1931 |
++ } |
1932 |
+ |
1933 |
+ state = update_schedule(state); |
1934 |
+ |
1935 |
+@@ -624,6 +631,9 @@ static int add_ballooned_pages(int nr_pages) |
1936 |
+ } |
1937 |
+ } |
1938 |
+ |
1939 |
++ if (si_mem_available() < nr_pages) |
1940 |
++ return -ENOMEM; |
1941 |
++ |
1942 |
+ st = decrease_reservation(nr_pages, GFP_USER); |
1943 |
+ if (st != BP_DONE) |
1944 |
+ return -ENOMEM; |
1945 |
+@@ -747,7 +757,7 @@ static int __init balloon_init(void) |
1946 |
+ balloon_stats.schedule_delay = 1; |
1947 |
+ balloon_stats.max_schedule_delay = 32; |
1948 |
+ balloon_stats.retry_count = 1; |
1949 |
+- balloon_stats.max_retry_count = RETRY_UNLIMITED; |
1950 |
++ balloon_stats.max_retry_count = 4; |
1951 |
+ |
1952 |
+ #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG |
1953 |
+ set_online_page_callback(&xen_online_page); |
1954 |
+diff --git a/firmware/Makefile b/firmware/Makefile |
1955 |
+index e297e1b52636..03232621cc08 100644 |
1956 |
+--- a/firmware/Makefile |
1957 |
++++ b/firmware/Makefile |
1958 |
+@@ -156,7 +156,7 @@ quiet_cmd_fwbin = MK_FW $@ |
1959 |
+ PROGBITS=$(if $(CONFIG_ARM),%,@)progbits; \ |
1960 |
+ echo "/* Generated by firmware/Makefile */" > $@;\ |
1961 |
+ echo " .section .rodata" >>$@;\ |
1962 |
+- echo " .p2align $${ASM_ALIGN}" >>$@;\ |
1963 |
++ echo " .p2align 4" >>$@;\ |
1964 |
+ echo "_fw_$${FWSTR}_bin:" >>$@;\ |
1965 |
+ echo " .incbin \"$(2)\"" >>$@;\ |
1966 |
+ echo "_fw_end:" >>$@;\ |
1967 |
+diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c |
1968 |
+index 41f1a5dd33a5..4dcce3f034f4 100644 |
1969 |
+--- a/fs/cifs/smb2file.c |
1970 |
++++ b/fs/cifs/smb2file.c |
1971 |
+@@ -69,7 +69,7 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, |
1972 |
+ goto out; |
1973 |
+ |
1974 |
+ |
1975 |
+- if (oparms->tcon->use_resilient) { |
1976 |
++ if (oparms->tcon->use_resilient) { |
1977 |
+ nr_ioctl_req.Timeout = 0; /* use server default (120 seconds) */ |
1978 |
+ nr_ioctl_req.Reserved = 0; |
1979 |
+ rc = SMB2_ioctl(xid, oparms->tcon, fid->persistent_fid, |
1980 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
1981 |
+index 3557c5717c8d..271d8d9d0598 100644 |
1982 |
+--- a/fs/ext4/inode.c |
1983 |
++++ b/fs/ext4/inode.c |
1984 |
+@@ -5189,10 +5189,25 @@ static int ext4_expand_extra_isize(struct inode *inode, |
1985 |
+ { |
1986 |
+ struct ext4_inode *raw_inode; |
1987 |
+ struct ext4_xattr_ibody_header *header; |
1988 |
++ unsigned int inode_size = EXT4_INODE_SIZE(inode->i_sb); |
1989 |
++ struct ext4_inode_info *ei = EXT4_I(inode); |
1990 |
+ |
1991 |
+ if (EXT4_I(inode)->i_extra_isize >= new_extra_isize) |
1992 |
+ return 0; |
1993 |
+ |
1994 |
++ /* this was checked at iget time, but double check for good measure */ |
1995 |
++ if ((EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > inode_size) || |
1996 |
++ (ei->i_extra_isize & 3)) { |
1997 |
++ EXT4_ERROR_INODE(inode, "bad extra_isize %u (inode size %u)", |
1998 |
++ ei->i_extra_isize, |
1999 |
++ EXT4_INODE_SIZE(inode->i_sb)); |
2000 |
++ return -EFSCORRUPTED; |
2001 |
++ } |
2002 |
++ if ((new_extra_isize < ei->i_extra_isize) || |
2003 |
++ (new_extra_isize < 4) || |
2004 |
++ (new_extra_isize > inode_size - EXT4_GOOD_OLD_INODE_SIZE)) |
2005 |
++ return -EINVAL; /* Should never happen */ |
2006 |
++ |
2007 |
+ raw_inode = ext4_raw_inode(&iloc); |
2008 |
+ |
2009 |
+ header = IHDR(inode, raw_inode); |
2010 |
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
2011 |
+index 6f00388a1471..adf02b1509ca 100644 |
2012 |
+--- a/fs/ext4/super.c |
2013 |
++++ b/fs/ext4/super.c |
2014 |
+@@ -3169,6 +3169,40 @@ int ext4_calculate_overhead(struct super_block *sb) |
2015 |
+ return 0; |
2016 |
+ } |
2017 |
+ |
2018 |
++static void ext4_clamp_want_extra_isize(struct super_block *sb) |
2019 |
++{ |
2020 |
++ struct ext4_sb_info *sbi = EXT4_SB(sb); |
2021 |
++ struct ext4_super_block *es = sbi->s_es; |
2022 |
++ unsigned def_extra_isize = sizeof(struct ext4_inode) - |
2023 |
++ EXT4_GOOD_OLD_INODE_SIZE; |
2024 |
++ |
2025 |
++ if (sbi->s_inode_size == EXT4_GOOD_OLD_INODE_SIZE) { |
2026 |
++ sbi->s_want_extra_isize = 0; |
2027 |
++ return; |
2028 |
++ } |
2029 |
++ if (sbi->s_want_extra_isize < 4) { |
2030 |
++ sbi->s_want_extra_isize = def_extra_isize; |
2031 |
++ if (ext4_has_feature_extra_isize(sb)) { |
2032 |
++ if (sbi->s_want_extra_isize < |
2033 |
++ le16_to_cpu(es->s_want_extra_isize)) |
2034 |
++ sbi->s_want_extra_isize = |
2035 |
++ le16_to_cpu(es->s_want_extra_isize); |
2036 |
++ if (sbi->s_want_extra_isize < |
2037 |
++ le16_to_cpu(es->s_min_extra_isize)) |
2038 |
++ sbi->s_want_extra_isize = |
2039 |
++ le16_to_cpu(es->s_min_extra_isize); |
2040 |
++ } |
2041 |
++ } |
2042 |
++ /* Check if enough inode space is available */ |
2043 |
++ if ((sbi->s_want_extra_isize > sbi->s_inode_size) || |
2044 |
++ (EXT4_GOOD_OLD_INODE_SIZE + sbi->s_want_extra_isize > |
2045 |
++ sbi->s_inode_size)) { |
2046 |
++ sbi->s_want_extra_isize = def_extra_isize; |
2047 |
++ ext4_msg(sb, KERN_INFO, |
2048 |
++ "required extra inode space not available"); |
2049 |
++ } |
2050 |
++} |
2051 |
++ |
2052 |
+ static void ext4_set_resv_clusters(struct super_block *sb) |
2053 |
+ { |
2054 |
+ ext4_fsblk_t resv_clusters; |
2055 |
+@@ -3991,29 +4025,7 @@ no_journal: |
2056 |
+ if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY)) |
2057 |
+ sb->s_flags |= MS_RDONLY; |
2058 |
+ |
2059 |
+- /* determine the minimum size of new large inodes, if present */ |
2060 |
+- if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { |
2061 |
+- sbi->s_want_extra_isize = sizeof(struct ext4_inode) - |
2062 |
+- EXT4_GOOD_OLD_INODE_SIZE; |
2063 |
+- if (ext4_has_feature_extra_isize(sb)) { |
2064 |
+- if (sbi->s_want_extra_isize < |
2065 |
+- le16_to_cpu(es->s_want_extra_isize)) |
2066 |
+- sbi->s_want_extra_isize = |
2067 |
+- le16_to_cpu(es->s_want_extra_isize); |
2068 |
+- if (sbi->s_want_extra_isize < |
2069 |
+- le16_to_cpu(es->s_min_extra_isize)) |
2070 |
+- sbi->s_want_extra_isize = |
2071 |
+- le16_to_cpu(es->s_min_extra_isize); |
2072 |
+- } |
2073 |
+- } |
2074 |
+- /* Check if enough inode space is available */ |
2075 |
+- if (EXT4_GOOD_OLD_INODE_SIZE + sbi->s_want_extra_isize > |
2076 |
+- sbi->s_inode_size) { |
2077 |
+- sbi->s_want_extra_isize = sizeof(struct ext4_inode) - |
2078 |
+- EXT4_GOOD_OLD_INODE_SIZE; |
2079 |
+- ext4_msg(sb, KERN_INFO, "required extra inode space not" |
2080 |
+- "available"); |
2081 |
+- } |
2082 |
++ ext4_clamp_want_extra_isize(sb); |
2083 |
+ |
2084 |
+ ext4_set_resv_clusters(sb); |
2085 |
+ |
2086 |
+@@ -4766,6 +4778,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) |
2087 |
+ goto restore_opts; |
2088 |
+ } |
2089 |
+ |
2090 |
++ ext4_clamp_want_extra_isize(sb); |
2091 |
++ |
2092 |
+ if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^ |
2093 |
+ test_opt(sb, JOURNAL_CHECKSUM)) { |
2094 |
+ ext4_msg(sb, KERN_ERR, "changing journal_checksum " |
2095 |
+diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c |
2096 |
+index 2301011428a1..bbf1634ff427 100644 |
2097 |
+--- a/fs/ocfs2/journal.c |
2098 |
++++ b/fs/ocfs2/journal.c |
2099 |
+@@ -1080,6 +1080,14 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) |
2100 |
+ |
2101 |
+ ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); |
2102 |
+ |
2103 |
++ if (replayed) { |
2104 |
++ jbd2_journal_lock_updates(journal->j_journal); |
2105 |
++ status = jbd2_journal_flush(journal->j_journal); |
2106 |
++ jbd2_journal_unlock_updates(journal->j_journal); |
2107 |
++ if (status < 0) |
2108 |
++ mlog_errno(status); |
2109 |
++ } |
2110 |
++ |
2111 |
+ status = ocfs2_journal_toggle_dirty(osb, 1, replayed); |
2112 |
+ if (status < 0) { |
2113 |
+ mlog_errno(status); |
2114 |
+diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c |
2115 |
+index df4661abadc4..83720460c5bc 100644 |
2116 |
+--- a/fs/proc/meminfo.c |
2117 |
++++ b/fs/proc/meminfo.c |
2118 |
+@@ -29,10 +29,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) |
2119 |
+ unsigned long committed; |
2120 |
+ long cached; |
2121 |
+ long available; |
2122 |
+- unsigned long pagecache; |
2123 |
+- unsigned long wmark_low = 0; |
2124 |
+ unsigned long pages[NR_LRU_LISTS]; |
2125 |
+- struct zone *zone; |
2126 |
+ int lru; |
2127 |
+ |
2128 |
+ /* |
2129 |
+@@ -51,33 +48,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) |
2130 |
+ for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++) |
2131 |
+ pages[lru] = global_page_state(NR_LRU_BASE + lru); |
2132 |
+ |
2133 |
+- for_each_zone(zone) |
2134 |
+- wmark_low += zone->watermark[WMARK_LOW]; |
2135 |
+- |
2136 |
+- /* |
2137 |
+- * Estimate the amount of memory available for userspace allocations, |
2138 |
+- * without causing swapping. |
2139 |
+- */ |
2140 |
+- available = i.freeram - totalreserve_pages; |
2141 |
+- |
2142 |
+- /* |
2143 |
+- * Not all the page cache can be freed, otherwise the system will |
2144 |
+- * start swapping. Assume at least half of the page cache, or the |
2145 |
+- * low watermark worth of cache, needs to stay. |
2146 |
+- */ |
2147 |
+- pagecache = pages[LRU_ACTIVE_FILE] + pages[LRU_INACTIVE_FILE]; |
2148 |
+- pagecache -= min(pagecache / 2, wmark_low); |
2149 |
+- available += pagecache; |
2150 |
+- |
2151 |
+- /* |
2152 |
+- * Part of the reclaimable slab consists of items that are in use, |
2153 |
+- * and cannot be freed. Cap this estimate at the low watermark. |
2154 |
+- */ |
2155 |
+- available += global_page_state(NR_SLAB_RECLAIMABLE) - |
2156 |
+- min(global_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low); |
2157 |
+- |
2158 |
+- if (available < 0) |
2159 |
+- available = 0; |
2160 |
++ available = si_mem_available(); |
2161 |
+ |
2162 |
+ /* |
2163 |
+ * Tagged format, for easy grepping and expansion. |
2164 |
+diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h |
2165 |
+index e4b945925e40..4ae5d6ecd727 100644 |
2166 |
+--- a/include/linux/blkdev.h |
2167 |
++++ b/include/linux/blkdev.h |
2168 |
+@@ -264,6 +264,7 @@ struct queue_limits { |
2169 |
+ unsigned int max_sectors; |
2170 |
+ unsigned int max_segment_size; |
2171 |
+ unsigned int physical_block_size; |
2172 |
++ unsigned int logical_block_size; |
2173 |
+ unsigned int alignment_offset; |
2174 |
+ unsigned int io_min; |
2175 |
+ unsigned int io_opt; |
2176 |
+@@ -273,7 +274,6 @@ struct queue_limits { |
2177 |
+ unsigned int discard_granularity; |
2178 |
+ unsigned int discard_alignment; |
2179 |
+ |
2180 |
+- unsigned short logical_block_size; |
2181 |
+ unsigned short max_segments; |
2182 |
+ unsigned short max_integrity_segments; |
2183 |
+ |
2184 |
+@@ -975,7 +975,7 @@ extern void blk_queue_max_discard_sectors(struct request_queue *q, |
2185 |
+ unsigned int max_discard_sectors); |
2186 |
+ extern void blk_queue_max_write_same_sectors(struct request_queue *q, |
2187 |
+ unsigned int max_write_same_sectors); |
2188 |
+-extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); |
2189 |
++extern void blk_queue_logical_block_size(struct request_queue *, unsigned int); |
2190 |
+ extern void blk_queue_physical_block_size(struct request_queue *, unsigned int); |
2191 |
+ extern void blk_queue_alignment_offset(struct request_queue *q, |
2192 |
+ unsigned int alignment); |
2193 |
+@@ -1193,7 +1193,7 @@ static inline unsigned int queue_max_segment_size(struct request_queue *q) |
2194 |
+ return q->limits.max_segment_size; |
2195 |
+ } |
2196 |
+ |
2197 |
+-static inline unsigned short queue_logical_block_size(struct request_queue *q) |
2198 |
++static inline unsigned queue_logical_block_size(struct request_queue *q) |
2199 |
+ { |
2200 |
+ int retval = 512; |
2201 |
+ |
2202 |
+@@ -1203,7 +1203,7 @@ static inline unsigned short queue_logical_block_size(struct request_queue *q) |
2203 |
+ return retval; |
2204 |
+ } |
2205 |
+ |
2206 |
+-static inline unsigned short bdev_logical_block_size(struct block_device *bdev) |
2207 |
++static inline unsigned int bdev_logical_block_size(struct block_device *bdev) |
2208 |
+ { |
2209 |
+ return queue_logical_block_size(bdev_get_queue(bdev)); |
2210 |
+ } |
2211 |
+diff --git a/include/linux/mm.h b/include/linux/mm.h |
2212 |
+index ed653ba47c46..15f81b2b87ed 100644 |
2213 |
+--- a/include/linux/mm.h |
2214 |
++++ b/include/linux/mm.h |
2215 |
+@@ -1802,6 +1802,7 @@ extern int __meminit init_per_zone_wmark_min(void); |
2216 |
+ extern void mem_init(void); |
2217 |
+ extern void __init mmap_init(void); |
2218 |
+ extern void show_mem(unsigned int flags); |
2219 |
++extern long si_mem_available(void); |
2220 |
+ extern void si_meminfo(struct sysinfo * val); |
2221 |
+ extern void si_meminfo_node(struct sysinfo *val, int nid); |
2222 |
+ |
2223 |
+diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h |
2224 |
+index d8ecefaf63ca..6b8ec40af2c4 100644 |
2225 |
+--- a/include/linux/regulator/ab8500.h |
2226 |
++++ b/include/linux/regulator/ab8500.h |
2227 |
+@@ -44,8 +44,6 @@ enum ab8505_regulator_id { |
2228 |
+ AB8505_LDO_ANAMIC2, |
2229 |
+ AB8505_LDO_AUX8, |
2230 |
+ AB8505_LDO_ANA, |
2231 |
+- AB8505_SYSCLKREQ_2, |
2232 |
+- AB8505_SYSCLKREQ_4, |
2233 |
+ AB8505_NUM_REGULATORS, |
2234 |
+ }; |
2235 |
+ |
2236 |
+diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h |
2237 |
+index c05748cc1b20..3fe53101b72a 100644 |
2238 |
+--- a/include/net/cfg80211.h |
2239 |
++++ b/include/net/cfg80211.h |
2240 |
+@@ -3855,6 +3855,17 @@ const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); |
2241 |
+ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, |
2242 |
+ const u8 *ies, int len); |
2243 |
+ |
2244 |
++/** |
2245 |
++ * cfg80211_send_layer2_update - send layer 2 update frame |
2246 |
++ * |
2247 |
++ * @dev: network device |
2248 |
++ * @addr: STA MAC address |
2249 |
++ * |
2250 |
++ * Wireless drivers can use this function to update forwarding tables in bridge |
2251 |
++ * devices upon STA association. |
2252 |
++ */ |
2253 |
++void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr); |
2254 |
++ |
2255 |
+ /** |
2256 |
+ * DOC: Regulatory enforcement infrastructure |
2257 |
+ * |
2258 |
+diff --git a/mm/page-writeback.c b/mm/page-writeback.c |
2259 |
+index d2211e42b779..698806914be7 100644 |
2260 |
+--- a/mm/page-writeback.c |
2261 |
++++ b/mm/page-writeback.c |
2262 |
+@@ -200,11 +200,11 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, |
2263 |
+ if (this_bw < tot_bw) { |
2264 |
+ if (min) { |
2265 |
+ min *= this_bw; |
2266 |
+- do_div(min, tot_bw); |
2267 |
++ min = div64_ul(min, tot_bw); |
2268 |
+ } |
2269 |
+ if (max < 100) { |
2270 |
+ max *= this_bw; |
2271 |
+- do_div(max, tot_bw); |
2272 |
++ max = div64_ul(max, tot_bw); |
2273 |
+ } |
2274 |
+ } |
2275 |
+ |
2276 |
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c |
2277 |
+index fd75e27c9b40..df589416ace6 100644 |
2278 |
+--- a/mm/page_alloc.c |
2279 |
++++ b/mm/page_alloc.c |
2280 |
+@@ -3650,6 +3650,49 @@ static inline void show_node(struct zone *zone) |
2281 |
+ printk("Node %d ", zone_to_nid(zone)); |
2282 |
+ } |
2283 |
+ |
2284 |
++long si_mem_available(void) |
2285 |
++{ |
2286 |
++ long available; |
2287 |
++ unsigned long pagecache; |
2288 |
++ unsigned long wmark_low = 0; |
2289 |
++ unsigned long pages[NR_LRU_LISTS]; |
2290 |
++ struct zone *zone; |
2291 |
++ int lru; |
2292 |
++ |
2293 |
++ for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++) |
2294 |
++ pages[lru] = global_page_state(NR_LRU_BASE + lru); |
2295 |
++ |
2296 |
++ for_each_zone(zone) |
2297 |
++ wmark_low += zone->watermark[WMARK_LOW]; |
2298 |
++ |
2299 |
++ /* |
2300 |
++ * Estimate the amount of memory available for userspace allocations, |
2301 |
++ * without causing swapping. |
2302 |
++ */ |
2303 |
++ available = global_page_state(NR_FREE_PAGES) - totalreserve_pages; |
2304 |
++ |
2305 |
++ /* |
2306 |
++ * Not all the page cache can be freed, otherwise the system will |
2307 |
++ * start swapping. Assume at least half of the page cache, or the |
2308 |
++ * low watermark worth of cache, needs to stay. |
2309 |
++ */ |
2310 |
++ pagecache = pages[LRU_ACTIVE_FILE] + pages[LRU_INACTIVE_FILE]; |
2311 |
++ pagecache -= min(pagecache / 2, wmark_low); |
2312 |
++ available += pagecache; |
2313 |
++ |
2314 |
++ /* |
2315 |
++ * Part of the reclaimable slab consists of items that are in use, |
2316 |
++ * and cannot be freed. Cap this estimate at the low watermark. |
2317 |
++ */ |
2318 |
++ available += global_page_state(NR_SLAB_RECLAIMABLE) - |
2319 |
++ min(global_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low); |
2320 |
++ |
2321 |
++ if (available < 0) |
2322 |
++ available = 0; |
2323 |
++ return available; |
2324 |
++} |
2325 |
++EXPORT_SYMBOL_GPL(si_mem_available); |
2326 |
++ |
2327 |
+ void si_meminfo(struct sysinfo *val) |
2328 |
+ { |
2329 |
+ val->totalram = totalram_pages; |
2330 |
+diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c |
2331 |
+index c2dff7c6e960..76808c5e8183 100644 |
2332 |
+--- a/net/batman-adv/distributed-arp-table.c |
2333 |
++++ b/net/batman-adv/distributed-arp-table.c |
2334 |
+@@ -226,6 +226,7 @@ static u32 batadv_hash_dat(const void *data, u32 size) |
2335 |
+ u32 hash = 0; |
2336 |
+ const struct batadv_dat_entry *dat = data; |
2337 |
+ const unsigned char *key; |
2338 |
++ __be16 vid; |
2339 |
+ u32 i; |
2340 |
+ |
2341 |
+ key = (const unsigned char *)&dat->ip; |
2342 |
+@@ -235,7 +236,8 @@ static u32 batadv_hash_dat(const void *data, u32 size) |
2343 |
+ hash ^= (hash >> 6); |
2344 |
+ } |
2345 |
+ |
2346 |
+- key = (const unsigned char *)&dat->vid; |
2347 |
++ vid = htons(dat->vid); |
2348 |
++ key = (__force const unsigned char *)&vid; |
2349 |
+ for (i = 0; i < sizeof(dat->vid); i++) { |
2350 |
+ hash += key[i]; |
2351 |
+ hash += (hash << 10); |
2352 |
+diff --git a/net/dccp/feat.c b/net/dccp/feat.c |
2353 |
+index f227f002c73d..db87d9f58019 100644 |
2354 |
+--- a/net/dccp/feat.c |
2355 |
++++ b/net/dccp/feat.c |
2356 |
+@@ -738,7 +738,12 @@ static int __feat_register_sp(struct list_head *fn, u8 feat, u8 is_local, |
2357 |
+ if (dccp_feat_clone_sp_val(&fval, sp_val, sp_len)) |
2358 |
+ return -ENOMEM; |
2359 |
+ |
2360 |
+- return dccp_feat_push_change(fn, feat, is_local, mandatory, &fval); |
2361 |
++ if (dccp_feat_push_change(fn, feat, is_local, mandatory, &fval)) { |
2362 |
++ kfree(fval.sp.vec); |
2363 |
++ return -ENOMEM; |
2364 |
++ } |
2365 |
++ |
2366 |
++ return 0; |
2367 |
+ } |
2368 |
+ |
2369 |
+ /** |
2370 |
+diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c |
2371 |
+index 943378d6e4c3..8dd239214a14 100644 |
2372 |
+--- a/net/hsr/hsr_device.c |
2373 |
++++ b/net/hsr/hsr_device.c |
2374 |
+@@ -289,6 +289,8 @@ static void send_hsr_supervision_frame(struct hsr_port *master, u8 type) |
2375 |
+ skb->dev->dev_addr, skb->len) <= 0) |
2376 |
+ goto out; |
2377 |
+ skb_reset_mac_header(skb); |
2378 |
++ skb_reset_network_header(skb); |
2379 |
++ skb_reset_transport_header(skb); |
2380 |
+ |
2381 |
+ hsr_stag = (typeof(hsr_stag)) skb_put(skb, sizeof(*hsr_stag)); |
2382 |
+ |
2383 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
2384 |
+index 1abf88aec19d..88bfd663d9a2 100644 |
2385 |
+--- a/net/ipv4/tcp_input.c |
2386 |
++++ b/net/ipv4/tcp_input.c |
2387 |
+@@ -895,9 +895,10 @@ static void tcp_update_reordering(struct sock *sk, const int metric, |
2388 |
+ /* This must be called before lost_out is incremented */ |
2389 |
+ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) |
2390 |
+ { |
2391 |
+- if (!tp->retransmit_skb_hint || |
2392 |
+- before(TCP_SKB_CB(skb)->seq, |
2393 |
+- TCP_SKB_CB(tp->retransmit_skb_hint)->seq)) |
2394 |
++ if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) || |
2395 |
++ (tp->retransmit_skb_hint && |
2396 |
++ before(TCP_SKB_CB(skb)->seq, |
2397 |
++ TCP_SKB_CB(tp->retransmit_skb_hint)->seq))) |
2398 |
+ tp->retransmit_skb_hint = skb; |
2399 |
+ |
2400 |
+ if (!tp->lost_out || |
2401 |
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c |
2402 |
+index 1999a7eaa692..cf3917c6da0a 100644 |
2403 |
+--- a/net/mac80211/cfg.c |
2404 |
++++ b/net/mac80211/cfg.c |
2405 |
+@@ -875,50 +875,6 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) |
2406 |
+ return 0; |
2407 |
+ } |
2408 |
+ |
2409 |
+-/* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */ |
2410 |
+-struct iapp_layer2_update { |
2411 |
+- u8 da[ETH_ALEN]; /* broadcast */ |
2412 |
+- u8 sa[ETH_ALEN]; /* STA addr */ |
2413 |
+- __be16 len; /* 6 */ |
2414 |
+- u8 dsap; /* 0 */ |
2415 |
+- u8 ssap; /* 0 */ |
2416 |
+- u8 control; |
2417 |
+- u8 xid_info[3]; |
2418 |
+-} __packed; |
2419 |
+- |
2420 |
+-static void ieee80211_send_layer2_update(struct sta_info *sta) |
2421 |
+-{ |
2422 |
+- struct iapp_layer2_update *msg; |
2423 |
+- struct sk_buff *skb; |
2424 |
+- |
2425 |
+- /* Send Level 2 Update Frame to update forwarding tables in layer 2 |
2426 |
+- * bridge devices */ |
2427 |
+- |
2428 |
+- skb = dev_alloc_skb(sizeof(*msg)); |
2429 |
+- if (!skb) |
2430 |
+- return; |
2431 |
+- msg = (struct iapp_layer2_update *)skb_put(skb, sizeof(*msg)); |
2432 |
+- |
2433 |
+- /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID) |
2434 |
+- * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */ |
2435 |
+- |
2436 |
+- eth_broadcast_addr(msg->da); |
2437 |
+- memcpy(msg->sa, sta->sta.addr, ETH_ALEN); |
2438 |
+- msg->len = htons(6); |
2439 |
+- msg->dsap = 0; |
2440 |
+- msg->ssap = 0x01; /* NULL LSAP, CR Bit: Response */ |
2441 |
+- msg->control = 0xaf; /* XID response lsb.1111F101. |
2442 |
+- * F=0 (no poll command; unsolicited frame) */ |
2443 |
+- msg->xid_info[0] = 0x81; /* XID format identifier */ |
2444 |
+- msg->xid_info[1] = 1; /* LLC types/classes: Type 1 LLC */ |
2445 |
+- msg->xid_info[2] = 0; /* XID sender's receive window size (RW) */ |
2446 |
+- |
2447 |
+- skb->dev = sta->sdata->dev; |
2448 |
+- skb->protocol = eth_type_trans(skb, sta->sdata->dev); |
2449 |
+- memset(skb->cb, 0, sizeof(skb->cb)); |
2450 |
+- netif_rx_ni(skb); |
2451 |
+-} |
2452 |
+- |
2453 |
+ static int sta_apply_auth_flags(struct ieee80211_local *local, |
2454 |
+ struct sta_info *sta, |
2455 |
+ u32 mask, u32 set) |
2456 |
+@@ -1194,7 +1150,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, |
2457 |
+ struct sta_info *sta; |
2458 |
+ struct ieee80211_sub_if_data *sdata; |
2459 |
+ int err; |
2460 |
+- int layer2_update; |
2461 |
+ |
2462 |
+ if (params->vlan) { |
2463 |
+ sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
2464 |
+@@ -1248,18 +1203,12 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, |
2465 |
+ test_sta_flag(sta, WLAN_STA_ASSOC)) |
2466 |
+ rate_control_rate_init(sta); |
2467 |
+ |
2468 |
+- layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN || |
2469 |
+- sdata->vif.type == NL80211_IFTYPE_AP; |
2470 |
+- |
2471 |
+ err = sta_info_insert_rcu(sta); |
2472 |
+ if (err) { |
2473 |
+ rcu_read_unlock(); |
2474 |
+ return err; |
2475 |
+ } |
2476 |
+ |
2477 |
+- if (layer2_update) |
2478 |
+- ieee80211_send_layer2_update(sta); |
2479 |
+- |
2480 |
+ rcu_read_unlock(); |
2481 |
+ |
2482 |
+ return 0; |
2483 |
+@@ -1367,7 +1316,9 @@ static int ieee80211_change_station(struct wiphy *wiphy, |
2484 |
+ atomic_inc(&sta->sdata->bss->num_mcast_sta); |
2485 |
+ } |
2486 |
+ |
2487 |
+- ieee80211_send_layer2_update(sta); |
2488 |
++ if (sta->sta_state == IEEE80211_STA_AUTHORIZED) |
2489 |
++ cfg80211_send_layer2_update(sta->sdata->dev, |
2490 |
++ sta->sta.addr); |
2491 |
+ } |
2492 |
+ |
2493 |
+ err = sta_apply_parameters(local, sta, params); |
2494 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
2495 |
+index 7e7b9ef29d8d..1cad7ca9234b 100644 |
2496 |
+--- a/net/mac80211/sta_info.c |
2497 |
++++ b/net/mac80211/sta_info.c |
2498 |
+@@ -1775,6 +1775,10 @@ int sta_info_move_state(struct sta_info *sta, |
2499 |
+ set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); |
2500 |
+ ieee80211_check_fast_xmit(sta); |
2501 |
+ } |
2502 |
++ if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN || |
2503 |
++ sta->sdata->vif.type == NL80211_IFTYPE_AP) |
2504 |
++ cfg80211_send_layer2_update(sta->sdata->dev, |
2505 |
++ sta->sta.addr); |
2506 |
+ break; |
2507 |
+ default: |
2508 |
+ break; |
2509 |
+diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h |
2510 |
+index b0bc475f641e..adc703ccd68b 100644 |
2511 |
+--- a/net/netfilter/ipset/ip_set_bitmap_gen.h |
2512 |
++++ b/net/netfilter/ipset/ip_set_bitmap_gen.h |
2513 |
+@@ -66,9 +66,9 @@ mtype_destroy(struct ip_set *set) |
2514 |
+ if (SET_WITH_TIMEOUT(set)) |
2515 |
+ del_timer_sync(&map->gc); |
2516 |
+ |
2517 |
+- ip_set_free(map->members); |
2518 |
+ if (set->dsize && set->extensions & IPSET_EXT_DESTROY) |
2519 |
+ mtype_ext_cleanup(set); |
2520 |
++ ip_set_free(map->members); |
2521 |
+ ip_set_free(map); |
2522 |
+ |
2523 |
+ set->data = NULL; |
2524 |
+diff --git a/net/socket.c b/net/socket.c |
2525 |
+index e5bb73eb36fe..15bdba4211ad 100644 |
2526 |
+--- a/net/socket.c |
2527 |
++++ b/net/socket.c |
2528 |
+@@ -3143,6 +3143,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, |
2529 |
+ case SIOCSARP: |
2530 |
+ case SIOCGARP: |
2531 |
+ case SIOCDARP: |
2532 |
++ case SIOCOUTQNSD: |
2533 |
+ case SIOCATMARK: |
2534 |
+ return sock_do_ioctl(net, sock, cmd, arg); |
2535 |
+ } |
2536 |
+diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h |
2537 |
+index c23516d0f807..b3a60c3e1934 100644 |
2538 |
+--- a/net/wireless/rdev-ops.h |
2539 |
++++ b/net/wireless/rdev-ops.h |
2540 |
+@@ -517,6 +517,10 @@ static inline int |
2541 |
+ rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) |
2542 |
+ { |
2543 |
+ int ret; |
2544 |
++ |
2545 |
++ if (!rdev->ops->set_wiphy_params) |
2546 |
++ return -EOPNOTSUPP; |
2547 |
++ |
2548 |
+ trace_rdev_set_wiphy_params(&rdev->wiphy, changed); |
2549 |
+ ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
2550 |
+ trace_rdev_return_int(&rdev->wiphy, ret); |
2551 |
+diff --git a/net/wireless/util.c b/net/wireless/util.c |
2552 |
+index 405388772fc4..156a2a6337b9 100644 |
2553 |
+--- a/net/wireless/util.c |
2554 |
++++ b/net/wireless/util.c |
2555 |
+@@ -1814,3 +1814,48 @@ EXPORT_SYMBOL(rfc1042_header); |
2556 |
+ const unsigned char bridge_tunnel_header[] __aligned(2) = |
2557 |
+ { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; |
2558 |
+ EXPORT_SYMBOL(bridge_tunnel_header); |
2559 |
++ |
2560 |
++/* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */ |
2561 |
++struct iapp_layer2_update { |
2562 |
++ u8 da[ETH_ALEN]; /* broadcast */ |
2563 |
++ u8 sa[ETH_ALEN]; /* STA addr */ |
2564 |
++ __be16 len; /* 6 */ |
2565 |
++ u8 dsap; /* 0 */ |
2566 |
++ u8 ssap; /* 0 */ |
2567 |
++ u8 control; |
2568 |
++ u8 xid_info[3]; |
2569 |
++} __packed; |
2570 |
++ |
2571 |
++void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr) |
2572 |
++{ |
2573 |
++ struct iapp_layer2_update *msg; |
2574 |
++ struct sk_buff *skb; |
2575 |
++ |
2576 |
++ /* Send Level 2 Update Frame to update forwarding tables in layer 2 |
2577 |
++ * bridge devices */ |
2578 |
++ |
2579 |
++ skb = dev_alloc_skb(sizeof(*msg)); |
2580 |
++ if (!skb) |
2581 |
++ return; |
2582 |
++ msg = (struct iapp_layer2_update *)skb_put(skb, sizeof(*msg)); |
2583 |
++ |
2584 |
++ /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID) |
2585 |
++ * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */ |
2586 |
++ |
2587 |
++ eth_broadcast_addr(msg->da); |
2588 |
++ ether_addr_copy(msg->sa, addr); |
2589 |
++ msg->len = htons(6); |
2590 |
++ msg->dsap = 0; |
2591 |
++ msg->ssap = 0x01; /* NULL LSAP, CR Bit: Response */ |
2592 |
++ msg->control = 0xaf; /* XID response lsb.1111F101. |
2593 |
++ * F=0 (no poll command; unsolicited frame) */ |
2594 |
++ msg->xid_info[0] = 0x81; /* XID format identifier */ |
2595 |
++ msg->xid_info[1] = 1; /* LLC types/classes: Type 1 LLC */ |
2596 |
++ msg->xid_info[2] = 0; /* XID sender's receive window size (RW) */ |
2597 |
++ |
2598 |
++ skb->dev = dev; |
2599 |
++ skb->protocol = eth_type_trans(skb, dev); |
2600 |
++ memset(skb->cb, 0, sizeof(skb->cb)); |
2601 |
++ netif_rx_ni(skb); |
2602 |
++} |
2603 |
++EXPORT_SYMBOL(cfg80211_send_layer2_update); |
2604 |
+diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c |
2605 |
+index 3be67560ead5..c526201fd0df 100644 |
2606 |
+--- a/sound/core/seq/seq_timer.c |
2607 |
++++ b/sound/core/seq/seq_timer.c |
2608 |
+@@ -484,15 +484,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry, |
2609 |
+ q = queueptr(idx); |
2610 |
+ if (q == NULL) |
2611 |
+ continue; |
2612 |
+- if ((tmr = q->timer) == NULL || |
2613 |
+- (ti = tmr->timeri) == NULL) { |
2614 |
+- queuefree(q); |
2615 |
+- continue; |
2616 |
+- } |
2617 |
++ mutex_lock(&q->timer_mutex); |
2618 |
++ tmr = q->timer; |
2619 |
++ if (!tmr) |
2620 |
++ goto unlock; |
2621 |
++ ti = tmr->timeri; |
2622 |
++ if (!ti) |
2623 |
++ goto unlock; |
2624 |
+ snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name); |
2625 |
+ resolution = snd_timer_resolution(ti) * tmr->ticks; |
2626 |
+ snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000); |
2627 |
+ snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base); |
2628 |
++unlock: |
2629 |
++ mutex_unlock(&q->timer_mutex); |
2630 |
+ queuefree(q); |
2631 |
+ } |
2632 |
+ } |
2633 |
+diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c |
2634 |
+index 41aa3355e920..e85ada14a8e1 100644 |
2635 |
+--- a/sound/usb/line6/pcm.c |
2636 |
++++ b/sound/usb/line6/pcm.c |
2637 |
+@@ -523,13 +523,6 @@ int line6_init_pcm(struct usb_line6 *line6, |
2638 |
+ line6pcm->volume_monitor = 255; |
2639 |
+ line6pcm->line6 = line6; |
2640 |
+ |
2641 |
+- /* Read and write buffers are sized identically, so choose minimum */ |
2642 |
+- line6pcm->max_packet_size = min( |
2643 |
+- usb_maxpacket(line6->usbdev, |
2644 |
+- usb_rcvisocpipe(line6->usbdev, ep_read), 0), |
2645 |
+- usb_maxpacket(line6->usbdev, |
2646 |
+- usb_sndisocpipe(line6->usbdev, ep_write), 1)); |
2647 |
+- |
2648 |
+ spin_lock_init(&line6pcm->out.lock); |
2649 |
+ spin_lock_init(&line6pcm->in.lock); |
2650 |
+ line6pcm->impulse_period = LINE6_IMPULSE_DEFAULT_PERIOD; |
2651 |
+@@ -539,6 +532,18 @@ int line6_init_pcm(struct usb_line6 *line6, |
2652 |
+ pcm->private_data = line6pcm; |
2653 |
+ pcm->private_free = line6_cleanup_pcm; |
2654 |
+ |
2655 |
++ /* Read and write buffers are sized identically, so choose minimum */ |
2656 |
++ line6pcm->max_packet_size = min( |
2657 |
++ usb_maxpacket(line6->usbdev, |
2658 |
++ usb_rcvisocpipe(line6->usbdev, ep_read), 0), |
2659 |
++ usb_maxpacket(line6->usbdev, |
2660 |
++ usb_sndisocpipe(line6->usbdev, ep_write), 1)); |
2661 |
++ if (!line6pcm->max_packet_size) { |
2662 |
++ dev_err(line6pcm->line6->ifcdev, |
2663 |
++ "cannot get proper max packet size\n"); |
2664 |
++ return -EINVAL; |
2665 |
++ } |
2666 |
++ |
2667 |
+ err = line6_create_audio_out_urbs(line6pcm); |
2668 |
+ if (err < 0) |
2669 |
+ return err; |
2670 |
+diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c |
2671 |
+index 5ca8836b16e7..89bb0f76e896 100644 |
2672 |
+--- a/tools/perf/util/probe-finder.c |
2673 |
++++ b/tools/perf/util/probe-finder.c |
2674 |
+@@ -597,38 +597,26 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod, |
2675 |
+ const char *function, |
2676 |
+ struct probe_trace_point *tp) |
2677 |
+ { |
2678 |
+- Dwarf_Addr eaddr, highaddr; |
2679 |
++ Dwarf_Addr eaddr; |
2680 |
+ GElf_Sym sym; |
2681 |
+ const char *symbol; |
2682 |
+ |
2683 |
+ /* Verify the address is correct */ |
2684 |
+- if (dwarf_entrypc(sp_die, &eaddr) != 0) { |
2685 |
+- pr_warning("Failed to get entry address of %s\n", |
2686 |
+- dwarf_diename(sp_die)); |
2687 |
+- return -ENOENT; |
2688 |
+- } |
2689 |
+- if (dwarf_highpc(sp_die, &highaddr) != 0) { |
2690 |
+- pr_warning("Failed to get end address of %s\n", |
2691 |
+- dwarf_diename(sp_die)); |
2692 |
+- return -ENOENT; |
2693 |
+- } |
2694 |
+- if (paddr > highaddr) { |
2695 |
+- pr_warning("Offset specified is greater than size of %s\n", |
2696 |
++ if (!dwarf_haspc(sp_die, paddr)) { |
2697 |
++ pr_warning("Specified offset is out of %s\n", |
2698 |
+ dwarf_diename(sp_die)); |
2699 |
+ return -EINVAL; |
2700 |
+ } |
2701 |
+ |
2702 |
+- symbol = dwarf_diename(sp_die); |
2703 |
++ /* Try to get actual symbol name from symtab */ |
2704 |
++ symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); |
2705 |
+ if (!symbol) { |
2706 |
+- /* Try to get the symbol name from symtab */ |
2707 |
+- symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); |
2708 |
+- if (!symbol) { |
2709 |
+- pr_warning("Failed to find symbol at 0x%lx\n", |
2710 |
+- (unsigned long)paddr); |
2711 |
+- return -ENOENT; |
2712 |
+- } |
2713 |
+- eaddr = sym.st_value; |
2714 |
++ pr_warning("Failed to find symbol at 0x%lx\n", |
2715 |
++ (unsigned long)paddr); |
2716 |
++ return -ENOENT; |
2717 |
+ } |
2718 |
++ eaddr = sym.st_value; |
2719 |
++ |
2720 |
+ tp->offset = (unsigned long)(paddr - eaddr); |
2721 |
+ tp->address = (unsigned long)paddr; |
2722 |
+ tp->symbol = strdup(symbol); |
2723 |
+diff --git a/tools/testing/selftests/rseq/settings b/tools/testing/selftests/rseq/settings |
2724 |
+new file mode 100644 |
2725 |
+index 000000000000..e7b9417537fb |
2726 |
+--- /dev/null |
2727 |
++++ b/tools/testing/selftests/rseq/settings |
2728 |
+@@ -0,0 +1 @@ |
2729 |
++timeout=0 |