Annotation of /trunk/kernel-alx/patches-4.9/0111-4.9.12-all-fixes.patch
Parent Directory | Revision Log
Revision 2956 -
(hide annotations)
(download)
Mon Jul 24 12:03:46 2017 UTC (7 years, 2 months ago) by niro
File size: 21015 byte(s)
Mon Jul 24 12:03:46 2017 UTC (7 years, 2 months ago) by niro
File size: 21015 byte(s)
-added patches-4.9
1 | niro | 2956 | diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst |
2 | index 44bb5a7059b3..95a23a28c595 100644 | ||
3 | --- a/Documentation/media/uapi/v4l/pixfmt-007.rst | ||
4 | +++ b/Documentation/media/uapi/v4l/pixfmt-007.rst | ||
5 | @@ -211,7 +211,13 @@ Colorspace sRGB (V4L2_COLORSPACE_SRGB) | ||
6 | The :ref:`srgb` standard defines the colorspace used by most webcams | ||
7 | and computer graphics. The default transfer function is | ||
8 | ``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is | ||
9 | -``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full range. | ||
10 | +``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited range. | ||
11 | + | ||
12 | +Note that the :ref:`sycc` standard specifies full range quantization, | ||
13 | +however all current capture hardware supported by the kernel convert | ||
14 | +R'G'B' to limited range Y'CbCr. So choosing full range as the default | ||
15 | +would break how applications interpret the quantization range. | ||
16 | + | ||
17 | The chromaticities of the primary colors and the white reference are: | ||
18 | |||
19 | |||
20 | @@ -276,7 +282,7 @@ the following ``V4L2_YCBCR_ENC_601`` encoding as defined by :ref:`sycc`: | ||
21 | |||
22 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | ||
23 | [-0.5…0.5]. This transform is identical to one defined in SMPTE | ||
24 | -170M/BT.601. The Y'CbCr quantization is full range. | ||
25 | +170M/BT.601. The Y'CbCr quantization is limited range. | ||
26 | |||
27 | |||
28 | .. _col-adobergb: | ||
29 | @@ -288,10 +294,15 @@ The :ref:`adobergb` standard defines the colorspace used by computer | ||
30 | graphics that use the AdobeRGB colorspace. This is also known as the | ||
31 | :ref:`oprgb` standard. The default transfer function is | ||
32 | ``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is | ||
33 | -``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full | ||
34 | -range. The chromaticities of the primary colors and the white reference | ||
35 | -are: | ||
36 | +``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited | ||
37 | +range. | ||
38 | + | ||
39 | +Note that the :ref:`oprgb` standard specifies full range quantization, | ||
40 | +however all current capture hardware supported by the kernel convert | ||
41 | +R'G'B' to limited range Y'CbCr. So choosing full range as the default | ||
42 | +would break how applications interpret the quantization range. | ||
43 | |||
44 | +The chromaticities of the primary colors and the white reference are: | ||
45 | |||
46 | |||
47 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| | ||
48 | @@ -344,7 +355,7 @@ the following ``V4L2_YCBCR_ENC_601`` encoding: | ||
49 | |||
50 | Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range | ||
51 | [-0.5…0.5]. This transform is identical to one defined in SMPTE | ||
52 | -170M/BT.601. The Y'CbCr quantization is full range. | ||
53 | +170M/BT.601. The Y'CbCr quantization is limited range. | ||
54 | |||
55 | |||
56 | .. _col-bt2020: | ||
57 | diff --git a/Makefile b/Makefile | ||
58 | index 18b0c5adad3b..3cd6f6fb4f20 100644 | ||
59 | --- a/Makefile | ||
60 | +++ b/Makefile | ||
61 | @@ -1,6 +1,6 @@ | ||
62 | VERSION = 4 | ||
63 | PATCHLEVEL = 9 | ||
64 | -SUBLEVEL = 11 | ||
65 | +SUBLEVEL = 12 | ||
66 | EXTRAVERSION = | ||
67 | NAME = Roaring Lionus | ||
68 | |||
69 | diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S | ||
70 | index 8ecfd15c3a02..df73914e81c8 100644 | ||
71 | --- a/arch/arm/lib/getuser.S | ||
72 | +++ b/arch/arm/lib/getuser.S | ||
73 | @@ -67,7 +67,7 @@ ENTRY(__get_user_4) | ||
74 | ENDPROC(__get_user_4) | ||
75 | |||
76 | ENTRY(__get_user_8) | ||
77 | - check_uaccess r0, 8, r1, r2, __get_user_bad | ||
78 | + check_uaccess r0, 8, r1, r2, __get_user_bad8 | ||
79 | #ifdef CONFIG_THUMB2_KERNEL | ||
80 | 5: TUSER(ldr) r2, [r0] | ||
81 | 6: TUSER(ldr) r3, [r0, #4] | ||
82 | diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c | ||
83 | index 16ada1eb7e26..d5ce34dcf4d9 100644 | ||
84 | --- a/arch/powerpc/mm/init_64.c | ||
85 | +++ b/arch/powerpc/mm/init_64.c | ||
86 | @@ -424,7 +424,8 @@ early_param("disable_radix", parse_disable_radix); | ||
87 | void __init mmu_early_init_devtree(void) | ||
88 | { | ||
89 | /* Disable radix mode based on kernel command line. */ | ||
90 | - if (disable_radix) | ||
91 | + /* We don't yet have the machinery to do radix as a guest. */ | ||
92 | + if (disable_radix || !(mfmsr() & MSR_HV)) | ||
93 | cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX; | ||
94 | |||
95 | if (early_radix_enabled()) | ||
96 | diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c | ||
97 | index aa644487749c..f59771da52ee 100644 | ||
98 | --- a/drivers/gpu/drm/drm_dp_mst_topology.c | ||
99 | +++ b/drivers/gpu/drm/drm_dp_mst_topology.c | ||
100 | @@ -1817,7 +1817,7 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr) | ||
101 | mgr->payloads[i].vcpi = req_payload.vcpi; | ||
102 | } else if (mgr->payloads[i].num_slots) { | ||
103 | mgr->payloads[i].num_slots = 0; | ||
104 | - drm_dp_destroy_payload_step1(mgr, port, port->vcpi.vcpi, &mgr->payloads[i]); | ||
105 | + drm_dp_destroy_payload_step1(mgr, port, mgr->payloads[i].vcpi, &mgr->payloads[i]); | ||
106 | req_payload.payload_state = mgr->payloads[i].payload_state; | ||
107 | mgr->payloads[i].start_slot = 0; | ||
108 | } | ||
109 | diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c | ||
110 | index fb16070b266e..4a4f9533c53b 100644 | ||
111 | --- a/drivers/gpu/drm/radeon/radeon_cursor.c | ||
112 | +++ b/drivers/gpu/drm/radeon/radeon_cursor.c | ||
113 | @@ -205,8 +205,8 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) | ||
114 | } | ||
115 | |||
116 | if (x <= (crtc->x - w) || y <= (crtc->y - radeon_crtc->cursor_height) || | ||
117 | - x >= (crtc->x + crtc->mode.crtc_hdisplay) || | ||
118 | - y >= (crtc->y + crtc->mode.crtc_vdisplay)) | ||
119 | + x >= (crtc->x + crtc->mode.hdisplay) || | ||
120 | + y >= (crtc->y + crtc->mode.vdisplay)) | ||
121 | goto out_of_bounds; | ||
122 | |||
123 | x += xorigin; | ||
124 | diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c | ||
125 | index b403fa5ecf49..809f4d4e93a0 100644 | ||
126 | --- a/drivers/i2c/busses/i2c-designware-core.c | ||
127 | +++ b/drivers/i2c/busses/i2c-designware-core.c | ||
128 | @@ -475,30 +475,28 @@ static int i2c_dw_wait_bus_not_busy(struct dw_i2c_dev *dev) | ||
129 | static void i2c_dw_xfer_init(struct dw_i2c_dev *dev) | ||
130 | { | ||
131 | struct i2c_msg *msgs = dev->msgs; | ||
132 | - u32 ic_tar = 0; | ||
133 | + u32 ic_con, ic_tar = 0; | ||
134 | |||
135 | /* Disable the adapter */ | ||
136 | __i2c_dw_enable_and_wait(dev, false); | ||
137 | |||
138 | /* if the slave address is ten bit address, enable 10BITADDR */ | ||
139 | - if (dev->dynamic_tar_update_enabled) { | ||
140 | + ic_con = dw_readl(dev, DW_IC_CON); | ||
141 | + if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) { | ||
142 | + ic_con |= DW_IC_CON_10BITADDR_MASTER; | ||
143 | /* | ||
144 | * If I2C_DYNAMIC_TAR_UPDATE is set, the 10-bit addressing | ||
145 | - * mode has to be enabled via bit 12 of IC_TAR register, | ||
146 | - * otherwise bit 4 of IC_CON is used. | ||
147 | + * mode has to be enabled via bit 12 of IC_TAR register. | ||
148 | + * We set it always as I2C_DYNAMIC_TAR_UPDATE can't be | ||
149 | + * detected from registers. | ||
150 | */ | ||
151 | - if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) | ||
152 | - ic_tar = DW_IC_TAR_10BITADDR_MASTER; | ||
153 | + ic_tar = DW_IC_TAR_10BITADDR_MASTER; | ||
154 | } else { | ||
155 | - u32 ic_con = dw_readl(dev, DW_IC_CON); | ||
156 | - | ||
157 | - if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) | ||
158 | - ic_con |= DW_IC_CON_10BITADDR_MASTER; | ||
159 | - else | ||
160 | - ic_con &= ~DW_IC_CON_10BITADDR_MASTER; | ||
161 | - dw_writel(dev, ic_con, DW_IC_CON); | ||
162 | + ic_con &= ~DW_IC_CON_10BITADDR_MASTER; | ||
163 | } | ||
164 | |||
165 | + dw_writel(dev, ic_con, DW_IC_CON); | ||
166 | + | ||
167 | /* | ||
168 | * Set the slave (target) address and enable 10-bit addressing mode | ||
169 | * if applicable. | ||
170 | @@ -923,7 +921,6 @@ int i2c_dw_probe(struct dw_i2c_dev *dev) | ||
171 | { | ||
172 | struct i2c_adapter *adap = &dev->adapter; | ||
173 | int r; | ||
174 | - u32 reg; | ||
175 | |||
176 | init_completion(&dev->cmd_complete); | ||
177 | |||
178 | @@ -931,26 +928,6 @@ int i2c_dw_probe(struct dw_i2c_dev *dev) | ||
179 | if (r) | ||
180 | return r; | ||
181 | |||
182 | - r = i2c_dw_acquire_lock(dev); | ||
183 | - if (r) | ||
184 | - return r; | ||
185 | - | ||
186 | - /* | ||
187 | - * Test if dynamic TAR update is enabled in this controller by writing | ||
188 | - * to IC_10BITADDR_MASTER field in IC_CON: when it is enabled this | ||
189 | - * field is read-only so it should not succeed | ||
190 | - */ | ||
191 | - reg = dw_readl(dev, DW_IC_CON); | ||
192 | - dw_writel(dev, reg ^ DW_IC_CON_10BITADDR_MASTER, DW_IC_CON); | ||
193 | - | ||
194 | - if ((dw_readl(dev, DW_IC_CON) & DW_IC_CON_10BITADDR_MASTER) == | ||
195 | - (reg & DW_IC_CON_10BITADDR_MASTER)) { | ||
196 | - dev->dynamic_tar_update_enabled = true; | ||
197 | - dev_dbg(dev->dev, "Dynamic TAR update enabled"); | ||
198 | - } | ||
199 | - | ||
200 | - i2c_dw_release_lock(dev); | ||
201 | - | ||
202 | snprintf(adap->name, sizeof(adap->name), | ||
203 | "Synopsys DesignWare I2C adapter"); | ||
204 | adap->retries = 3; | ||
205 | diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h | ||
206 | index 0d44d2ae7d4c..22bfbe147870 100644 | ||
207 | --- a/drivers/i2c/busses/i2c-designware-core.h | ||
208 | +++ b/drivers/i2c/busses/i2c-designware-core.h | ||
209 | @@ -117,7 +117,6 @@ struct dw_i2c_dev { | ||
210 | int (*acquire_lock)(struct dw_i2c_dev *dev); | ||
211 | void (*release_lock)(struct dw_i2c_dev *dev); | ||
212 | bool pm_runtime_disabled; | ||
213 | - bool dynamic_tar_update_enabled; | ||
214 | }; | ||
215 | |||
216 | #define ACCESS_SWAP 0x00000001 | ||
217 | diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c | ||
218 | index d15b33813021..ed1935f300a7 100644 | ||
219 | --- a/drivers/input/mouse/elan_i2c_core.c | ||
220 | +++ b/drivers/input/mouse/elan_i2c_core.c | ||
221 | @@ -1232,6 +1232,7 @@ static const struct acpi_device_id elan_acpi_id[] = { | ||
222 | { "ELAN0000", 0 }, | ||
223 | { "ELAN0100", 0 }, | ||
224 | { "ELAN0600", 0 }, | ||
225 | + { "ELAN0605", 0 }, | ||
226 | { "ELAN1000", 0 }, | ||
227 | { } | ||
228 | }; | ||
229 | diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h | ||
230 | index 6b420a55c745..c3ea03c9a1a8 100644 | ||
231 | --- a/drivers/md/bcache/bcache.h | ||
232 | +++ b/drivers/md/bcache/bcache.h | ||
233 | @@ -425,7 +425,7 @@ struct cache { | ||
234 | * until a gc finishes - otherwise we could pointlessly burn a ton of | ||
235 | * cpu | ||
236 | */ | ||
237 | - unsigned invalidate_needs_gc:1; | ||
238 | + unsigned invalidate_needs_gc; | ||
239 | |||
240 | bool discard; /* Get rid of? */ | ||
241 | |||
242 | @@ -593,8 +593,8 @@ struct cache_set { | ||
243 | |||
244 | /* Counts how many sectors bio_insert has added to the cache */ | ||
245 | atomic_t sectors_to_gc; | ||
246 | + wait_queue_head_t gc_wait; | ||
247 | |||
248 | - wait_queue_head_t moving_gc_wait; | ||
249 | struct keybuf moving_gc_keys; | ||
250 | /* Number of moving GC bios in flight */ | ||
251 | struct semaphore moving_in_flight; | ||
252 | diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c | ||
253 | index 81d3db40cd7b..2efdce07247c 100644 | ||
254 | --- a/drivers/md/bcache/btree.c | ||
255 | +++ b/drivers/md/bcache/btree.c | ||
256 | @@ -1757,32 +1757,34 @@ static void bch_btree_gc(struct cache_set *c) | ||
257 | bch_moving_gc(c); | ||
258 | } | ||
259 | |||
260 | -static int bch_gc_thread(void *arg) | ||
261 | +static bool gc_should_run(struct cache_set *c) | ||
262 | { | ||
263 | - struct cache_set *c = arg; | ||
264 | struct cache *ca; | ||
265 | unsigned i; | ||
266 | |||
267 | - while (1) { | ||
268 | -again: | ||
269 | - bch_btree_gc(c); | ||
270 | + for_each_cache(ca, c, i) | ||
271 | + if (ca->invalidate_needs_gc) | ||
272 | + return true; | ||
273 | |||
274 | - set_current_state(TASK_INTERRUPTIBLE); | ||
275 | - if (kthread_should_stop()) | ||
276 | - break; | ||
277 | + if (atomic_read(&c->sectors_to_gc) < 0) | ||
278 | + return true; | ||
279 | |||
280 | - mutex_lock(&c->bucket_lock); | ||
281 | + return false; | ||
282 | +} | ||
283 | |||
284 | - for_each_cache(ca, c, i) | ||
285 | - if (ca->invalidate_needs_gc) { | ||
286 | - mutex_unlock(&c->bucket_lock); | ||
287 | - set_current_state(TASK_RUNNING); | ||
288 | - goto again; | ||
289 | - } | ||
290 | +static int bch_gc_thread(void *arg) | ||
291 | +{ | ||
292 | + struct cache_set *c = arg; | ||
293 | |||
294 | - mutex_unlock(&c->bucket_lock); | ||
295 | + while (1) { | ||
296 | + wait_event_interruptible(c->gc_wait, | ||
297 | + kthread_should_stop() || gc_should_run(c)); | ||
298 | |||
299 | - schedule(); | ||
300 | + if (kthread_should_stop()) | ||
301 | + break; | ||
302 | + | ||
303 | + set_gc_sectors(c); | ||
304 | + bch_btree_gc(c); | ||
305 | } | ||
306 | |||
307 | return 0; | ||
308 | @@ -1790,11 +1792,10 @@ static int bch_gc_thread(void *arg) | ||
309 | |||
310 | int bch_gc_thread_start(struct cache_set *c) | ||
311 | { | ||
312 | - c->gc_thread = kthread_create(bch_gc_thread, c, "bcache_gc"); | ||
313 | + c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); | ||
314 | if (IS_ERR(c->gc_thread)) | ||
315 | return PTR_ERR(c->gc_thread); | ||
316 | |||
317 | - set_task_state(c->gc_thread, TASK_INTERRUPTIBLE); | ||
318 | return 0; | ||
319 | } | ||
320 | |||
321 | diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h | ||
322 | index 5c391fa01bed..9b80417cd547 100644 | ||
323 | --- a/drivers/md/bcache/btree.h | ||
324 | +++ b/drivers/md/bcache/btree.h | ||
325 | @@ -260,8 +260,7 @@ void bch_initial_mark_key(struct cache_set *, int, struct bkey *); | ||
326 | |||
327 | static inline void wake_up_gc(struct cache_set *c) | ||
328 | { | ||
329 | - if (c->gc_thread) | ||
330 | - wake_up_process(c->gc_thread); | ||
331 | + wake_up(&c->gc_wait); | ||
332 | } | ||
333 | |||
334 | #define MAP_DONE 0 | ||
335 | diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c | ||
336 | index 40ffe5e424b3..a37c1776f2e3 100644 | ||
337 | --- a/drivers/md/bcache/request.c | ||
338 | +++ b/drivers/md/bcache/request.c | ||
339 | @@ -196,10 +196,8 @@ static void bch_data_insert_start(struct closure *cl) | ||
340 | struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); | ||
341 | struct bio *bio = op->bio, *n; | ||
342 | |||
343 | - if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0) { | ||
344 | - set_gc_sectors(op->c); | ||
345 | + if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0) | ||
346 | wake_up_gc(op->c); | ||
347 | - } | ||
348 | |||
349 | if (op->bypass) | ||
350 | return bch_data_invalidate(cl); | ||
351 | diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c | ||
352 | index 849ad441cd76..66669c8f4161 100644 | ||
353 | --- a/drivers/md/bcache/super.c | ||
354 | +++ b/drivers/md/bcache/super.c | ||
355 | @@ -1491,6 +1491,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb) | ||
356 | mutex_init(&c->bucket_lock); | ||
357 | init_waitqueue_head(&c->btree_cache_wait); | ||
358 | init_waitqueue_head(&c->bucket_wait); | ||
359 | + init_waitqueue_head(&c->gc_wait); | ||
360 | sema_init(&c->uuid_write_mutex, 1); | ||
361 | |||
362 | spin_lock_init(&c->btree_gc_time.lock); | ||
363 | @@ -1550,6 +1551,7 @@ static void run_cache_set(struct cache_set *c) | ||
364 | |||
365 | for_each_cache(ca, c, i) | ||
366 | c->nbuckets += ca->sb.nbuckets; | ||
367 | + set_gc_sectors(c); | ||
368 | |||
369 | if (CACHE_SYNC(&c->sb)) { | ||
370 | LIST_HEAD(journal); | ||
371 | diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c | ||
372 | index c2e25876e93b..18b41b9dc2e4 100644 | ||
373 | --- a/drivers/media/usb/siano/smsusb.c | ||
374 | +++ b/drivers/media/usb/siano/smsusb.c | ||
375 | @@ -218,22 +218,30 @@ static int smsusb_start_streaming(struct smsusb_device_t *dev) | ||
376 | static int smsusb_sendrequest(void *context, void *buffer, size_t size) | ||
377 | { | ||
378 | struct smsusb_device_t *dev = (struct smsusb_device_t *) context; | ||
379 | - struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; | ||
380 | - int dummy; | ||
381 | + struct sms_msg_hdr *phdr; | ||
382 | + int dummy, ret; | ||
383 | |||
384 | if (dev->state != SMSUSB_ACTIVE) { | ||
385 | pr_debug("Device not active yet\n"); | ||
386 | return -ENOENT; | ||
387 | } | ||
388 | |||
389 | + phdr = kmalloc(size, GFP_KERNEL); | ||
390 | + if (!phdr) | ||
391 | + return -ENOMEM; | ||
392 | + memcpy(phdr, buffer, size); | ||
393 | + | ||
394 | pr_debug("sending %s(%d) size: %d\n", | ||
395 | smscore_translate_msg(phdr->msg_type), phdr->msg_type, | ||
396 | phdr->msg_length); | ||
397 | |||
398 | smsendian_handle_tx_message((struct sms_msg_data *) phdr); | ||
399 | - smsendian_handle_message_header((struct sms_msg_hdr *)buffer); | ||
400 | - return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2), | ||
401 | - buffer, size, &dummy, 1000); | ||
402 | + smsendian_handle_message_header((struct sms_msg_hdr *)phdr); | ||
403 | + ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2), | ||
404 | + phdr, size, &dummy, 1000); | ||
405 | + | ||
406 | + kfree(phdr); | ||
407 | + return ret; | ||
408 | } | ||
409 | |||
410 | static char *smsusb1_fw_lkup[] = { | ||
411 | diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c | ||
412 | index df19777068a6..f57700c4b8f0 100644 | ||
413 | --- a/drivers/mmc/core/mmc.c | ||
414 | +++ b/drivers/mmc/core/mmc.c | ||
415 | @@ -1690,10 +1690,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | ||
416 | err = mmc_select_hs400(card); | ||
417 | if (err) | ||
418 | goto free_card; | ||
419 | - } else if (mmc_card_hs(card)) { | ||
420 | + } else { | ||
421 | /* Select the desired bus width optionally */ | ||
422 | err = mmc_select_bus_width(card); | ||
423 | - if (err > 0) { | ||
424 | + if (err > 0 && mmc_card_hs(card)) { | ||
425 | err = mmc_select_hs_ddr(card); | ||
426 | if (err) | ||
427 | goto free_card; | ||
428 | diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c | ||
429 | index 4eb8adb34508..c234ee43b6ef 100644 | ||
430 | --- a/drivers/ntb/ntb_transport.c | ||
431 | +++ b/drivers/ntb/ntb_transport.c | ||
432 | @@ -1799,7 +1799,7 @@ ntb_transport_create_queue(void *data, struct device *client_dev, | ||
433 | |||
434 | node = dev_to_node(&ndev->dev); | ||
435 | |||
436 | - free_queue = ffs(nt->qp_bitmap); | ||
437 | + free_queue = ffs(nt->qp_bitmap_free); | ||
438 | if (!free_queue) | ||
439 | goto err; | ||
440 | |||
441 | @@ -2270,9 +2270,8 @@ module_init(ntb_transport_init); | ||
442 | |||
443 | static void __exit ntb_transport_exit(void) | ||
444 | { | ||
445 | - debugfs_remove_recursive(nt_debugfs_dir); | ||
446 | - | ||
447 | ntb_unregister_client(&ntb_transport_client); | ||
448 | bus_unregister(&ntb_transport_bus); | ||
449 | + debugfs_remove_recursive(nt_debugfs_dir); | ||
450 | } | ||
451 | module_exit(ntb_transport_exit); | ||
452 | diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c | ||
453 | index e75d4fdc0866..434e1d474f33 100644 | ||
454 | --- a/drivers/ntb/test/ntb_perf.c | ||
455 | +++ b/drivers/ntb/test/ntb_perf.c | ||
456 | @@ -265,6 +265,8 @@ static ssize_t perf_copy(struct pthr_ctx *pctx, char __iomem *dst, | ||
457 | if (dma_submit_error(cookie)) | ||
458 | goto err_set_unmap; | ||
459 | |||
460 | + dmaengine_unmap_put(unmap); | ||
461 | + | ||
462 | atomic_inc(&pctx->dma_sync); | ||
463 | dma_async_issue_pending(chan); | ||
464 | |||
465 | diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c | ||
466 | index 884bad5320f8..4b703492376a 100644 | ||
467 | --- a/drivers/pci/pcie/pme.c | ||
468 | +++ b/drivers/pci/pcie/pme.c | ||
469 | @@ -448,6 +448,17 @@ static int pcie_pme_resume(struct pcie_device *srv) | ||
470 | return 0; | ||
471 | } | ||
472 | |||
473 | +/** | ||
474 | + * pcie_pme_remove - Prepare PCIe PME service device for removal. | ||
475 | + * @srv - PCIe service device to remove. | ||
476 | + */ | ||
477 | +static void pcie_pme_remove(struct pcie_device *srv) | ||
478 | +{ | ||
479 | + pcie_pme_suspend(srv); | ||
480 | + free_irq(srv->irq, srv); | ||
481 | + kfree(get_service_data(srv)); | ||
482 | +} | ||
483 | + | ||
484 | static struct pcie_port_service_driver pcie_pme_driver = { | ||
485 | .name = "pcie_pme", | ||
486 | .port_type = PCI_EXP_TYPE_ROOT_PORT, | ||
487 | @@ -456,6 +467,7 @@ static struct pcie_port_service_driver pcie_pme_driver = { | ||
488 | .probe = pcie_pme_probe, | ||
489 | .suspend = pcie_pme_suspend, | ||
490 | .resume = pcie_pme_resume, | ||
491 | + .remove = pcie_pme_remove, | ||
492 | }; | ||
493 | |||
494 | /** | ||
495 | diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c | ||
496 | index 2cca9cffc63f..e64eae4392a4 100644 | ||
497 | --- a/drivers/scsi/scsi_lib.c | ||
498 | +++ b/drivers/scsi/scsi_lib.c | ||
499 | @@ -1031,7 +1031,8 @@ int scsi_init_io(struct scsi_cmnd *cmd) | ||
500 | bool is_mq = (rq->mq_ctx != NULL); | ||
501 | int error; | ||
502 | |||
503 | - BUG_ON(!rq->nr_phys_segments); | ||
504 | + if (WARN_ON_ONCE(!rq->nr_phys_segments)) | ||
505 | + return -EINVAL; | ||
506 | |||
507 | error = scsi_init_sgtable(rq, &cmd->sdb); | ||
508 | if (error) | ||
509 | diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c | ||
510 | index dbe5b4b95df0..121de0aaa6ad 100644 | ||
511 | --- a/drivers/scsi/sg.c | ||
512 | +++ b/drivers/scsi/sg.c | ||
513 | @@ -1753,6 +1753,10 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) | ||
514 | return res; | ||
515 | |||
516 | iov_iter_truncate(&i, hp->dxfer_len); | ||
517 | + if (!iov_iter_count(&i)) { | ||
518 | + kfree(iov); | ||
519 | + return -EINVAL; | ||
520 | + } | ||
521 | |||
522 | res = blk_rq_map_user_iov(q, rq, md, &i, GFP_ATOMIC); | ||
523 | kfree(iov); | ||
524 | diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c | ||
525 | index 4e06a27ed7f8..f11792672977 100644 | ||
526 | --- a/fs/fuse/dev.c | ||
527 | +++ b/fs/fuse/dev.c | ||
528 | @@ -399,6 +399,10 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) | ||
529 | static void queue_interrupt(struct fuse_iqueue *fiq, struct fuse_req *req) | ||
530 | { | ||
531 | spin_lock(&fiq->waitq.lock); | ||
532 | + if (test_bit(FR_FINISHED, &req->flags)) { | ||
533 | + spin_unlock(&fiq->waitq.lock); | ||
534 | + return; | ||
535 | + } | ||
536 | if (list_empty(&req->intr_entry)) { | ||
537 | list_add_tail(&req->intr_entry, &fiq->interrupts); | ||
538 | wake_up_locked(&fiq->waitq); | ||
539 | @@ -1372,6 +1376,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos, | ||
540 | * code can Oops if the buffer persists after module unload. | ||
541 | */ | ||
542 | bufs[page_nr].ops = &nosteal_pipe_buf_ops; | ||
543 | + bufs[page_nr].flags = 0; | ||
544 | ret = add_to_pipe(pipe, &bufs[page_nr++]); | ||
545 | if (unlikely(ret < 0)) | ||
546 | break; | ||
547 | diff --git a/fs/splice.c b/fs/splice.c | ||
548 | index 63b8f54485dc..8dd79ecfd383 100644 | ||
549 | --- a/fs/splice.c | ||
550 | +++ b/fs/splice.c | ||
551 | @@ -203,6 +203,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, | ||
552 | buf->len = spd->partial[page_nr].len; | ||
553 | buf->private = spd->partial[page_nr].private; | ||
554 | buf->ops = spd->ops; | ||
555 | + buf->flags = 0; | ||
556 | |||
557 | pipe->nrbufs++; | ||
558 | page_nr++; | ||
559 | diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h | ||
560 | index 94f123f3e04e..7f34d3c67648 100644 | ||
561 | --- a/include/uapi/linux/videodev2.h | ||
562 | +++ b/include/uapi/linux/videodev2.h | ||
563 | @@ -349,8 +349,8 @@ enum v4l2_quantization { | ||
564 | /* | ||
565 | * The default for R'G'B' quantization is always full range, except | ||
566 | * for the BT2020 colorspace. For Y'CbCr the quantization is always | ||
567 | - * limited range, except for COLORSPACE_JPEG, SRGB, ADOBERGB, | ||
568 | - * XV601 or XV709: those are full range. | ||
569 | + * limited range, except for COLORSPACE_JPEG, XV601 or XV709: those | ||
570 | + * are full range. | ||
571 | */ | ||
572 | V4L2_QUANTIZATION_DEFAULT = 0, | ||
573 | V4L2_QUANTIZATION_FULL_RANGE = 1, | ||
574 | @@ -365,8 +365,7 @@ enum v4l2_quantization { | ||
575 | #define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \ | ||
576 | (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \ | ||
577 | (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \ | ||
578 | - (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) || \ | ||
579 | - (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == V4L2_COLORSPACE_SRGB ? \ | ||
580 | + (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \ | ||
581 | V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) | ||
582 | |||
583 | enum v4l2_priority { | ||
584 | diff --git a/kernel/futex.c b/kernel/futex.c | ||
585 | index 2c4be467fecd..38b68c2735c5 100644 | ||
586 | --- a/kernel/futex.c | ||
587 | +++ b/kernel/futex.c | ||
588 | @@ -3323,4 +3323,4 @@ static int __init futex_init(void) | ||
589 | |||
590 | return 0; | ||
591 | } | ||
592 | -__initcall(futex_init); | ||
593 | +core_initcall(futex_init); | ||
594 | diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c | ||
595 | index f7a55e9ff2f7..9c5b231684d0 100644 | ||
596 | --- a/kernel/printk/printk.c | ||
597 | +++ b/kernel/printk/printk.c | ||
598 | @@ -1564,7 +1564,7 @@ static void call_console_drivers(int level, | ||
599 | { | ||
600 | struct console *con; | ||
601 | |||
602 | - trace_console(text, len); | ||
603 | + trace_console_rcuidle(text, len); | ||
604 | |||
605 | if (!console_drivers) | ||
606 | return; | ||
607 | diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c | ||
608 | index ca9fb800336b..38bc4d2208e8 100644 | ||
609 | --- a/kernel/time/timekeeping_debug.c | ||
610 | +++ b/kernel/time/timekeeping_debug.c | ||
611 | @@ -75,7 +75,7 @@ void tk_debug_account_sleep_time(struct timespec64 *t) | ||
612 | int bin = min(fls(t->tv_sec), NUM_BINS-1); | ||
613 | |||
614 | sleep_time_bin[bin]++; | ||
615 | - pr_info("Suspended for %lld.%03lu seconds\n", (s64)t->tv_sec, | ||
616 | - t->tv_nsec / NSEC_PER_MSEC); | ||
617 | + printk_deferred(KERN_INFO "Suspended for %lld.%03lu seconds\n", | ||
618 | + (s64)t->tv_sec, t->tv_nsec / NSEC_PER_MSEC); | ||
619 | } | ||
620 |