Annotation of /trunk/kernel-alx/patches-4.4/0150-4.4.51-all-fixes.patch
Parent Directory | Revision Log
Revision 2886 -
(hide annotations)
(download)
Mon Mar 27 13:49:24 2017 UTC (7 years, 6 months ago) by niro
File size: 11502 byte(s)
Mon Mar 27 13:49:24 2017 UTC (7 years, 6 months ago) by niro
File size: 11502 byte(s)
linux-4.4.51
1 | niro | 2886 | diff --git a/Makefile b/Makefile |
2 | index 10993715abb8..117357188f01 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -1,6 +1,6 @@ | ||
6 | VERSION = 4 | ||
7 | PATCHLEVEL = 4 | ||
8 | -SUBLEVEL = 50 | ||
9 | +SUBLEVEL = 51 | ||
10 | EXTRAVERSION = | ||
11 | NAME = Blurry Fish Butt | ||
12 | |||
13 | diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S | ||
14 | index 8ecfd15c3a02..df73914e81c8 100644 | ||
15 | --- a/arch/arm/lib/getuser.S | ||
16 | +++ b/arch/arm/lib/getuser.S | ||
17 | @@ -67,7 +67,7 @@ ENTRY(__get_user_4) | ||
18 | ENDPROC(__get_user_4) | ||
19 | |||
20 | ENTRY(__get_user_8) | ||
21 | - check_uaccess r0, 8, r1, r2, __get_user_bad | ||
22 | + check_uaccess r0, 8, r1, r2, __get_user_bad8 | ||
23 | #ifdef CONFIG_THUMB2_KERNEL | ||
24 | 5: TUSER(ldr) r2, [r0] | ||
25 | 6: TUSER(ldr) r3, [r0, #4] | ||
26 | diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c | ||
27 | index 7cb2815e815e..a3b96d691ac9 100644 | ||
28 | --- a/drivers/gpu/drm/drm_dp_mst_topology.c | ||
29 | +++ b/drivers/gpu/drm/drm_dp_mst_topology.c | ||
30 | @@ -1812,7 +1812,7 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr) | ||
31 | mgr->payloads[i].num_slots = req_payload.num_slots; | ||
32 | } else if (mgr->payloads[i].num_slots) { | ||
33 | mgr->payloads[i].num_slots = 0; | ||
34 | - drm_dp_destroy_payload_step1(mgr, port, port->vcpi.vcpi, &mgr->payloads[i]); | ||
35 | + drm_dp_destroy_payload_step1(mgr, port, mgr->payloads[i].vcpi, &mgr->payloads[i]); | ||
36 | req_payload.payload_state = mgr->payloads[i].payload_state; | ||
37 | mgr->payloads[i].start_slot = 0; | ||
38 | } | ||
39 | diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c | ||
40 | index 04cec0da5d1e..8901228b5d5d 100644 | ||
41 | --- a/drivers/gpu/drm/radeon/radeon_cursor.c | ||
42 | +++ b/drivers/gpu/drm/radeon/radeon_cursor.c | ||
43 | @@ -205,8 +205,8 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) | ||
44 | } | ||
45 | |||
46 | if (x <= (crtc->x - w) || y <= (crtc->y - radeon_crtc->cursor_height) || | ||
47 | - x >= (crtc->x + crtc->mode.crtc_hdisplay) || | ||
48 | - y >= (crtc->y + crtc->mode.crtc_vdisplay)) | ||
49 | + x >= (crtc->x + crtc->mode.hdisplay) || | ||
50 | + y >= (crtc->y + crtc->mode.vdisplay)) | ||
51 | goto out_of_bounds; | ||
52 | |||
53 | x += xorigin; | ||
54 | diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c | ||
55 | index d15b33813021..ed1935f300a7 100644 | ||
56 | --- a/drivers/input/mouse/elan_i2c_core.c | ||
57 | +++ b/drivers/input/mouse/elan_i2c_core.c | ||
58 | @@ -1232,6 +1232,7 @@ static const struct acpi_device_id elan_acpi_id[] = { | ||
59 | { "ELAN0000", 0 }, | ||
60 | { "ELAN0100", 0 }, | ||
61 | { "ELAN0600", 0 }, | ||
62 | + { "ELAN0605", 0 }, | ||
63 | { "ELAN1000", 0 }, | ||
64 | { } | ||
65 | }; | ||
66 | diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h | ||
67 | index 6b420a55c745..c3ea03c9a1a8 100644 | ||
68 | --- a/drivers/md/bcache/bcache.h | ||
69 | +++ b/drivers/md/bcache/bcache.h | ||
70 | @@ -425,7 +425,7 @@ struct cache { | ||
71 | * until a gc finishes - otherwise we could pointlessly burn a ton of | ||
72 | * cpu | ||
73 | */ | ||
74 | - unsigned invalidate_needs_gc:1; | ||
75 | + unsigned invalidate_needs_gc; | ||
76 | |||
77 | bool discard; /* Get rid of? */ | ||
78 | |||
79 | @@ -593,8 +593,8 @@ struct cache_set { | ||
80 | |||
81 | /* Counts how many sectors bio_insert has added to the cache */ | ||
82 | atomic_t sectors_to_gc; | ||
83 | + wait_queue_head_t gc_wait; | ||
84 | |||
85 | - wait_queue_head_t moving_gc_wait; | ||
86 | struct keybuf moving_gc_keys; | ||
87 | /* Number of moving GC bios in flight */ | ||
88 | struct semaphore moving_in_flight; | ||
89 | diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c | ||
90 | index 22b9e34ceb75..5b815e64c1c9 100644 | ||
91 | --- a/drivers/md/bcache/btree.c | ||
92 | +++ b/drivers/md/bcache/btree.c | ||
93 | @@ -1762,33 +1762,34 @@ static void bch_btree_gc(struct cache_set *c) | ||
94 | bch_moving_gc(c); | ||
95 | } | ||
96 | |||
97 | -static int bch_gc_thread(void *arg) | ||
98 | +static bool gc_should_run(struct cache_set *c) | ||
99 | { | ||
100 | - struct cache_set *c = arg; | ||
101 | struct cache *ca; | ||
102 | unsigned i; | ||
103 | |||
104 | - while (1) { | ||
105 | -again: | ||
106 | - bch_btree_gc(c); | ||
107 | + for_each_cache(ca, c, i) | ||
108 | + if (ca->invalidate_needs_gc) | ||
109 | + return true; | ||
110 | |||
111 | - set_current_state(TASK_INTERRUPTIBLE); | ||
112 | - if (kthread_should_stop()) | ||
113 | - break; | ||
114 | + if (atomic_read(&c->sectors_to_gc) < 0) | ||
115 | + return true; | ||
116 | |||
117 | - mutex_lock(&c->bucket_lock); | ||
118 | + return false; | ||
119 | +} | ||
120 | |||
121 | - for_each_cache(ca, c, i) | ||
122 | - if (ca->invalidate_needs_gc) { | ||
123 | - mutex_unlock(&c->bucket_lock); | ||
124 | - set_current_state(TASK_RUNNING); | ||
125 | - goto again; | ||
126 | - } | ||
127 | +static int bch_gc_thread(void *arg) | ||
128 | +{ | ||
129 | + struct cache_set *c = arg; | ||
130 | |||
131 | - mutex_unlock(&c->bucket_lock); | ||
132 | + while (1) { | ||
133 | + wait_event_interruptible(c->gc_wait, | ||
134 | + kthread_should_stop() || gc_should_run(c)); | ||
135 | |||
136 | - try_to_freeze(); | ||
137 | - schedule(); | ||
138 | + if (kthread_should_stop()) | ||
139 | + break; | ||
140 | + | ||
141 | + set_gc_sectors(c); | ||
142 | + bch_btree_gc(c); | ||
143 | } | ||
144 | |||
145 | return 0; | ||
146 | @@ -1796,11 +1797,10 @@ again: | ||
147 | |||
148 | int bch_gc_thread_start(struct cache_set *c) | ||
149 | { | ||
150 | - c->gc_thread = kthread_create(bch_gc_thread, c, "bcache_gc"); | ||
151 | + c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); | ||
152 | if (IS_ERR(c->gc_thread)) | ||
153 | return PTR_ERR(c->gc_thread); | ||
154 | |||
155 | - set_task_state(c->gc_thread, TASK_INTERRUPTIBLE); | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h | ||
160 | index 5c391fa01bed..9b80417cd547 100644 | ||
161 | --- a/drivers/md/bcache/btree.h | ||
162 | +++ b/drivers/md/bcache/btree.h | ||
163 | @@ -260,8 +260,7 @@ void bch_initial_mark_key(struct cache_set *, int, struct bkey *); | ||
164 | |||
165 | static inline void wake_up_gc(struct cache_set *c) | ||
166 | { | ||
167 | - if (c->gc_thread) | ||
168 | - wake_up_process(c->gc_thread); | ||
169 | + wake_up(&c->gc_wait); | ||
170 | } | ||
171 | |||
172 | #define MAP_DONE 0 | ||
173 | diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c | ||
174 | index 25fa8445bb24..2410df1c2a05 100644 | ||
175 | --- a/drivers/md/bcache/request.c | ||
176 | +++ b/drivers/md/bcache/request.c | ||
177 | @@ -196,10 +196,8 @@ static void bch_data_insert_start(struct closure *cl) | ||
178 | struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); | ||
179 | struct bio *bio = op->bio, *n; | ||
180 | |||
181 | - if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0) { | ||
182 | - set_gc_sectors(op->c); | ||
183 | + if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0) | ||
184 | wake_up_gc(op->c); | ||
185 | - } | ||
186 | |||
187 | if (op->bypass) | ||
188 | return bch_data_invalidate(cl); | ||
189 | diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c | ||
190 | index 3d5c0ba13181..7b5880b8874c 100644 | ||
191 | --- a/drivers/md/bcache/super.c | ||
192 | +++ b/drivers/md/bcache/super.c | ||
193 | @@ -1489,6 +1489,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb) | ||
194 | mutex_init(&c->bucket_lock); | ||
195 | init_waitqueue_head(&c->btree_cache_wait); | ||
196 | init_waitqueue_head(&c->bucket_wait); | ||
197 | + init_waitqueue_head(&c->gc_wait); | ||
198 | sema_init(&c->uuid_write_mutex, 1); | ||
199 | |||
200 | spin_lock_init(&c->btree_gc_time.lock); | ||
201 | @@ -1547,6 +1548,7 @@ static void run_cache_set(struct cache_set *c) | ||
202 | |||
203 | for_each_cache(ca, c, i) | ||
204 | c->nbuckets += ca->sb.nbuckets; | ||
205 | + set_gc_sectors(c); | ||
206 | |||
207 | if (CACHE_SYNC(&c->sb)) { | ||
208 | LIST_HEAD(journal); | ||
209 | diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c | ||
210 | index c945e4c2fbd4..ec30a004f319 100644 | ||
211 | --- a/drivers/media/usb/siano/smsusb.c | ||
212 | +++ b/drivers/media/usb/siano/smsusb.c | ||
213 | @@ -200,22 +200,30 @@ static int smsusb_start_streaming(struct smsusb_device_t *dev) | ||
214 | static int smsusb_sendrequest(void *context, void *buffer, size_t size) | ||
215 | { | ||
216 | struct smsusb_device_t *dev = (struct smsusb_device_t *) context; | ||
217 | - struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; | ||
218 | - int dummy; | ||
219 | + struct sms_msg_hdr *phdr; | ||
220 | + int dummy, ret; | ||
221 | |||
222 | if (dev->state != SMSUSB_ACTIVE) { | ||
223 | pr_debug("Device not active yet\n"); | ||
224 | return -ENOENT; | ||
225 | } | ||
226 | |||
227 | + phdr = kmalloc(size, GFP_KERNEL); | ||
228 | + if (!phdr) | ||
229 | + return -ENOMEM; | ||
230 | + memcpy(phdr, buffer, size); | ||
231 | + | ||
232 | pr_debug("sending %s(%d) size: %d\n", | ||
233 | smscore_translate_msg(phdr->msg_type), phdr->msg_type, | ||
234 | phdr->msg_length); | ||
235 | |||
236 | smsendian_handle_tx_message((struct sms_msg_data *) phdr); | ||
237 | - smsendian_handle_message_header((struct sms_msg_hdr *)buffer); | ||
238 | - return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2), | ||
239 | - buffer, size, &dummy, 1000); | ||
240 | + smsendian_handle_message_header((struct sms_msg_hdr *)phdr); | ||
241 | + ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2), | ||
242 | + phdr, size, &dummy, 1000); | ||
243 | + | ||
244 | + kfree(phdr); | ||
245 | + return ret; | ||
246 | } | ||
247 | |||
248 | static char *smsusb1_fw_lkup[] = { | ||
249 | diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c | ||
250 | index 78187699467a..79a0c26e1419 100644 | ||
251 | --- a/drivers/mmc/core/mmc.c | ||
252 | +++ b/drivers/mmc/core/mmc.c | ||
253 | @@ -1581,10 +1581,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | ||
254 | err = mmc_select_hs400(card); | ||
255 | if (err) | ||
256 | goto free_card; | ||
257 | - } else if (mmc_card_hs(card)) { | ||
258 | + } else { | ||
259 | /* Select the desired bus width optionally */ | ||
260 | err = mmc_select_bus_width(card); | ||
261 | - if (!IS_ERR_VALUE(err)) { | ||
262 | + if (!IS_ERR_VALUE(err) && mmc_card_hs(card)) { | ||
263 | err = mmc_select_hs_ddr(card); | ||
264 | if (err) | ||
265 | goto free_card; | ||
266 | diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c | ||
267 | index 60654d524858..ecc6fb9ca92f 100644 | ||
268 | --- a/drivers/ntb/ntb_transport.c | ||
269 | +++ b/drivers/ntb/ntb_transport.c | ||
270 | @@ -1623,7 +1623,7 @@ ntb_transport_create_queue(void *data, struct device *client_dev, | ||
271 | |||
272 | node = dev_to_node(&ndev->dev); | ||
273 | |||
274 | - free_queue = ffs(nt->qp_bitmap); | ||
275 | + free_queue = ffs(nt->qp_bitmap_free); | ||
276 | if (!free_queue) | ||
277 | goto err; | ||
278 | |||
279 | @@ -2082,9 +2082,8 @@ module_init(ntb_transport_init); | ||
280 | |||
281 | static void __exit ntb_transport_exit(void) | ||
282 | { | ||
283 | - debugfs_remove_recursive(nt_debugfs_dir); | ||
284 | - | ||
285 | ntb_unregister_client(&ntb_transport_client); | ||
286 | bus_unregister(&ntb_transport_bus); | ||
287 | + debugfs_remove_recursive(nt_debugfs_dir); | ||
288 | } | ||
289 | module_exit(ntb_transport_exit); | ||
290 | diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c | ||
291 | index cf5b99e1f12b..8558e3886960 100644 | ||
292 | --- a/drivers/scsi/scsi_lib.c | ||
293 | +++ b/drivers/scsi/scsi_lib.c | ||
294 | @@ -1120,7 +1120,8 @@ int scsi_init_io(struct scsi_cmnd *cmd) | ||
295 | bool is_mq = (rq->mq_ctx != NULL); | ||
296 | int error; | ||
297 | |||
298 | - BUG_ON(!rq->nr_phys_segments); | ||
299 | + if (WARN_ON_ONCE(!rq->nr_phys_segments)) | ||
300 | + return -EINVAL; | ||
301 | |||
302 | error = scsi_init_sgtable(rq, &cmd->sdb); | ||
303 | if (error) | ||
304 | diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c | ||
305 | index a1c29b0afb22..dedcff9cabb5 100644 | ||
306 | --- a/drivers/scsi/sg.c | ||
307 | +++ b/drivers/scsi/sg.c | ||
308 | @@ -1763,6 +1763,10 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) | ||
309 | return res; | ||
310 | |||
311 | iov_iter_truncate(&i, hp->dxfer_len); | ||
312 | + if (!iov_iter_count(&i)) { | ||
313 | + kfree(iov); | ||
314 | + return -EINVAL; | ||
315 | + } | ||
316 | |||
317 | res = blk_rq_map_user_iov(q, rq, md, &i, GFP_ATOMIC); | ||
318 | kfree(iov); | ||
319 | diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c | ||
320 | index 9096d44eb221..d0cf1f010fbe 100644 | ||
321 | --- a/fs/fuse/dev.c | ||
322 | +++ b/fs/fuse/dev.c | ||
323 | @@ -418,6 +418,10 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) | ||
324 | static void queue_interrupt(struct fuse_iqueue *fiq, struct fuse_req *req) | ||
325 | { | ||
326 | spin_lock(&fiq->waitq.lock); | ||
327 | + if (test_bit(FR_FINISHED, &req->flags)) { | ||
328 | + spin_unlock(&fiq->waitq.lock); | ||
329 | + return; | ||
330 | + } | ||
331 | if (list_empty(&req->intr_entry)) { | ||
332 | list_add_tail(&req->intr_entry, &fiq->interrupts); | ||
333 | wake_up_locked(&fiq->waitq); | ||
334 | diff --git a/fs/splice.c b/fs/splice.c | ||
335 | index 0f77e9682857..8398974e1538 100644 | ||
336 | --- a/fs/splice.c | ||
337 | +++ b/fs/splice.c | ||
338 | @@ -211,6 +211,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, | ||
339 | buf->len = spd->partial[page_nr].len; | ||
340 | buf->private = spd->partial[page_nr].private; | ||
341 | buf->ops = spd->ops; | ||
342 | + buf->flags = 0; | ||
343 | if (spd->flags & SPLICE_F_GIFT) | ||
344 | buf->flags |= PIPE_BUF_FLAG_GIFT; | ||
345 | |||
346 | diff --git a/kernel/futex.c b/kernel/futex.c | ||
347 | index 9d8163afd87c..9d251dc3ec40 100644 | ||
348 | --- a/kernel/futex.c | ||
349 | +++ b/kernel/futex.c | ||
350 | @@ -3199,4 +3199,4 @@ static int __init futex_init(void) | ||
351 | |||
352 | return 0; | ||
353 | } | ||
354 | -__initcall(futex_init); | ||
355 | +core_initcall(futex_init); | ||
356 | diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c | ||
357 | index c048e34b177f..0b5613554769 100644 | ||
358 | --- a/kernel/printk/printk.c | ||
359 | +++ b/kernel/printk/printk.c | ||
360 | @@ -1436,7 +1436,7 @@ static void call_console_drivers(int level, | ||
361 | { | ||
362 | struct console *con; | ||
363 | |||
364 | - trace_console(text, len); | ||
365 | + trace_console_rcuidle(text, len); | ||
366 | |||
367 | if (level >= console_loglevel && !ignore_loglevel) | ||
368 | return; |