1 |
commit: 6d6d7bd9432a24acf0f69e3aae34bc211267fc63 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 9 23:09:10 2014 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 9 23:09:10 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=6d6d7bd9 |
7 |
|
8 |
Linux patch 3.14.12 |
9 |
|
10 |
--- |
11 |
0000_README | 4 + |
12 |
1011_linux-3.14.12.patch | 3170 ++++++++++++++++++++++++++++++++++++++++++++++ |
13 |
2 files changed, 3174 insertions(+) |
14 |
|
15 |
diff --git a/0000_README b/0000_README |
16 |
index c719e74..d87d066 100644 |
17 |
--- a/0000_README |
18 |
+++ b/0000_README |
19 |
@@ -86,6 +86,10 @@ Patch: 1010_linux-3.14.11.patch |
20 |
From: http://www.kernel.org |
21 |
Desc: Linux 3.14.11 |
22 |
|
23 |
+Patch: 1011_linux-3.14.12.patch |
24 |
+From: http://www.kernel.org |
25 |
+Desc: Linux 3.14.12 |
26 |
+ |
27 |
Patch: 1500_XATTR_USER_PREFIX.patch |
28 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
29 |
Desc: Support for namespace user.pax.* on tmpfs. |
30 |
|
31 |
diff --git a/1011_linux-3.14.12.patch b/1011_linux-3.14.12.patch |
32 |
new file mode 100644 |
33 |
index 0000000..9a5c593 |
34 |
--- /dev/null |
35 |
+++ b/1011_linux-3.14.12.patch |
36 |
@@ -0,0 +1,3170 @@ |
37 |
+diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt |
38 |
+index d614a9b6a280..b602784b289f 100644 |
39 |
+--- a/Documentation/sysctl/vm.txt |
40 |
++++ b/Documentation/sysctl/vm.txt |
41 |
+@@ -681,7 +681,8 @@ The batch value of each per cpu pagelist is also updated as a result. It is |
42 |
+ set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8) |
43 |
+ |
44 |
+ The initial value is zero. Kernel does not use this value at boot time to set |
45 |
+-the high water marks for each per cpu page list. |
46 |
++the high water marks for each per cpu page list. If the user writes '0' to this |
47 |
++sysctl, it will revert to this default behavior. |
48 |
+ |
49 |
+ ============================================================== |
50 |
+ |
51 |
+diff --git a/Makefile b/Makefile |
52 |
+index f1bbec5ece95..13d8f323ae43 100644 |
53 |
+--- a/Makefile |
54 |
++++ b/Makefile |
55 |
+@@ -1,6 +1,6 @@ |
56 |
+ VERSION = 3 |
57 |
+ PATCHLEVEL = 14 |
58 |
+-SUBLEVEL = 11 |
59 |
++SUBLEVEL = 12 |
60 |
+ EXTRAVERSION = |
61 |
+ NAME = Remembering Coco |
62 |
+ |
63 |
+diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c |
64 |
+index 48094b58c88f..b12a4f9fc9d0 100644 |
65 |
+--- a/arch/arm/mach-omap2/mux.c |
66 |
++++ b/arch/arm/mach-omap2/mux.c |
67 |
+@@ -183,8 +183,10 @@ static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition, |
68 |
+ m0_entry = mux->muxnames[0]; |
69 |
+ |
70 |
+ /* First check for full name in mode0.muxmode format */ |
71 |
+- if (mode0_len && strncmp(muxname, m0_entry, mode0_len)) |
72 |
+- continue; |
73 |
++ if (mode0_len) |
74 |
++ if (strncmp(muxname, m0_entry, mode0_len) || |
75 |
++ (strlen(m0_entry) != mode0_len)) |
76 |
++ continue; |
77 |
+ |
78 |
+ /* Then check for muxmode only */ |
79 |
+ for (i = 0; i < OMAP_MUX_NR_MODES; i++) { |
80 |
+diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S |
81 |
+index 39ac630d83de..a8e4bdbbb4b8 100644 |
82 |
+--- a/arch/arm64/kernel/entry.S |
83 |
++++ b/arch/arm64/kernel/entry.S |
84 |
+@@ -275,7 +275,6 @@ el1_sp_pc: |
85 |
+ * Stack or PC alignment exception handling |
86 |
+ */ |
87 |
+ mrs x0, far_el1 |
88 |
+- mov x1, x25 |
89 |
+ mov x2, sp |
90 |
+ b do_sp_pc_abort |
91 |
+ el1_undef: |
92 |
+diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c |
93 |
+index e4193e3adc7f..0d64089d28b5 100644 |
94 |
+--- a/arch/arm64/mm/flush.c |
95 |
++++ b/arch/arm64/mm/flush.c |
96 |
+@@ -79,7 +79,8 @@ void __sync_icache_dcache(pte_t pte, unsigned long addr) |
97 |
+ return; |
98 |
+ |
99 |
+ if (!test_and_set_bit(PG_dcache_clean, &page->flags)) { |
100 |
+- __flush_dcache_area(page_address(page), PAGE_SIZE); |
101 |
++ __flush_dcache_area(page_address(page), |
102 |
++ PAGE_SIZE << compound_order(page)); |
103 |
+ __flush_icache_all(); |
104 |
+ } else if (icache_is_aivivt()) { |
105 |
+ __flush_icache_all(); |
106 |
+diff --git a/arch/unicore32/mm/alignment.c b/arch/unicore32/mm/alignment.c |
107 |
+index de7dc5fdd58b..24e836023e6c 100644 |
108 |
+--- a/arch/unicore32/mm/alignment.c |
109 |
++++ b/arch/unicore32/mm/alignment.c |
110 |
+@@ -21,6 +21,7 @@ |
111 |
+ #include <linux/sched.h> |
112 |
+ #include <linux/uaccess.h> |
113 |
+ |
114 |
++#include <asm/pgtable.h> |
115 |
+ #include <asm/tlbflush.h> |
116 |
+ #include <asm/unaligned.h> |
117 |
+ |
118 |
+diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h |
119 |
+index fdf83afbb7d9..3092300a07cd 100644 |
120 |
+--- a/arch/x86/include/asm/kvm_host.h |
121 |
++++ b/arch/x86/include/asm/kvm_host.h |
122 |
+@@ -99,7 +99,7 @@ static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level) |
123 |
+ #define KVM_REFILL_PAGES 25 |
124 |
+ #define KVM_MAX_CPUID_ENTRIES 80 |
125 |
+ #define KVM_NR_FIXED_MTRR_REGION 88 |
126 |
+-#define KVM_NR_VAR_MTRR 8 |
127 |
++#define KVM_NR_VAR_MTRR 10 |
128 |
+ |
129 |
+ #define ASYNC_PF_PER_VCPU 64 |
130 |
+ |
131 |
+@@ -462,7 +462,7 @@ struct kvm_vcpu_arch { |
132 |
+ bool nmi_injected; /* Trying to inject an NMI this entry */ |
133 |
+ |
134 |
+ struct mtrr_state_type mtrr_state; |
135 |
+- u32 pat; |
136 |
++ u64 pat; |
137 |
+ |
138 |
+ int switch_db_regs; |
139 |
+ unsigned long db[KVM_NR_DB_REGS]; |
140 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
141 |
+index ee0c3b554a38..8fbd1a772272 100644 |
142 |
+--- a/arch/x86/kvm/x86.c |
143 |
++++ b/arch/x86/kvm/x86.c |
144 |
+@@ -1866,7 +1866,7 @@ static int set_msr_hyperv_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data) |
145 |
+ if (!(data & HV_X64_MSR_TSC_REFERENCE_ENABLE)) |
146 |
+ break; |
147 |
+ gfn = data >> HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT; |
148 |
+- if (kvm_write_guest(kvm, data, |
149 |
++ if (kvm_write_guest(kvm, gfn << HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT, |
150 |
+ &tsc_ref, sizeof(tsc_ref))) |
151 |
+ return 1; |
152 |
+ mark_page_dirty(kvm, gfn); |
153 |
+diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c |
154 |
+index 4e491d9b5292..dd0dd2d4ceca 100644 |
155 |
+--- a/block/blk-cgroup.c |
156 |
++++ b/block/blk-cgroup.c |
157 |
+@@ -80,7 +80,7 @@ static struct blkcg_gq *blkg_alloc(struct blkcg *blkcg, struct request_queue *q, |
158 |
+ blkg->q = q; |
159 |
+ INIT_LIST_HEAD(&blkg->q_node); |
160 |
+ blkg->blkcg = blkcg; |
161 |
+- blkg->refcnt = 1; |
162 |
++ atomic_set(&blkg->refcnt, 1); |
163 |
+ |
164 |
+ /* root blkg uses @q->root_rl, init rl only for !root blkgs */ |
165 |
+ if (blkcg != &blkcg_root) { |
166 |
+@@ -399,11 +399,8 @@ void __blkg_release_rcu(struct rcu_head *rcu_head) |
167 |
+ |
168 |
+ /* release the blkcg and parent blkg refs this blkg has been holding */ |
169 |
+ css_put(&blkg->blkcg->css); |
170 |
+- if (blkg->parent) { |
171 |
+- spin_lock_irq(blkg->q->queue_lock); |
172 |
++ if (blkg->parent) |
173 |
+ blkg_put(blkg->parent); |
174 |
+- spin_unlock_irq(blkg->q->queue_lock); |
175 |
+- } |
176 |
+ |
177 |
+ blkg_free(blkg); |
178 |
+ } |
179 |
+diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h |
180 |
+index 86154eab9523..c135f5660702 100644 |
181 |
+--- a/block/blk-cgroup.h |
182 |
++++ b/block/blk-cgroup.h |
183 |
+@@ -18,6 +18,7 @@ |
184 |
+ #include <linux/seq_file.h> |
185 |
+ #include <linux/radix-tree.h> |
186 |
+ #include <linux/blkdev.h> |
187 |
++#include <linux/atomic.h> |
188 |
+ |
189 |
+ /* Max limits for throttle policy */ |
190 |
+ #define THROTL_IOPS_MAX UINT_MAX |
191 |
+@@ -104,7 +105,7 @@ struct blkcg_gq { |
192 |
+ struct request_list rl; |
193 |
+ |
194 |
+ /* reference count */ |
195 |
+- int refcnt; |
196 |
++ atomic_t refcnt; |
197 |
+ |
198 |
+ /* is this blkg online? protected by both blkcg and q locks */ |
199 |
+ bool online; |
200 |
+@@ -253,13 +254,12 @@ static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) |
201 |
+ * blkg_get - get a blkg reference |
202 |
+ * @blkg: blkg to get |
203 |
+ * |
204 |
+- * The caller should be holding queue_lock and an existing reference. |
205 |
++ * The caller should be holding an existing reference. |
206 |
+ */ |
207 |
+ static inline void blkg_get(struct blkcg_gq *blkg) |
208 |
+ { |
209 |
+- lockdep_assert_held(blkg->q->queue_lock); |
210 |
+- WARN_ON_ONCE(!blkg->refcnt); |
211 |
+- blkg->refcnt++; |
212 |
++ WARN_ON_ONCE(atomic_read(&blkg->refcnt) <= 0); |
213 |
++ atomic_inc(&blkg->refcnt); |
214 |
+ } |
215 |
+ |
216 |
+ void __blkg_release_rcu(struct rcu_head *rcu); |
217 |
+@@ -267,14 +267,11 @@ void __blkg_release_rcu(struct rcu_head *rcu); |
218 |
+ /** |
219 |
+ * blkg_put - put a blkg reference |
220 |
+ * @blkg: blkg to put |
221 |
+- * |
222 |
+- * The caller should be holding queue_lock. |
223 |
+ */ |
224 |
+ static inline void blkg_put(struct blkcg_gq *blkg) |
225 |
+ { |
226 |
+- lockdep_assert_held(blkg->q->queue_lock); |
227 |
+- WARN_ON_ONCE(blkg->refcnt <= 0); |
228 |
+- if (!--blkg->refcnt) |
229 |
++ WARN_ON_ONCE(atomic_read(&blkg->refcnt) <= 0); |
230 |
++ if (atomic_dec_and_test(&blkg->refcnt)) |
231 |
+ call_rcu(&blkg->rcu_head, __blkg_release_rcu); |
232 |
+ } |
233 |
+ |
234 |
+diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c |
235 |
+index 7f2d09fbb10b..7296c7f074bd 100644 |
236 |
+--- a/drivers/block/rbd.c |
237 |
++++ b/drivers/block/rbd.c |
238 |
+@@ -1366,6 +1366,14 @@ static bool obj_request_exists_test(struct rbd_obj_request *obj_request) |
239 |
+ return test_bit(OBJ_REQ_EXISTS, &obj_request->flags) != 0; |
240 |
+ } |
241 |
+ |
242 |
++static bool obj_request_overlaps_parent(struct rbd_obj_request *obj_request) |
243 |
++{ |
244 |
++ struct rbd_device *rbd_dev = obj_request->img_request->rbd_dev; |
245 |
++ |
246 |
++ return obj_request->img_offset < |
247 |
++ round_up(rbd_dev->parent_overlap, rbd_obj_bytes(&rbd_dev->header)); |
248 |
++} |
249 |
++ |
250 |
+ static void rbd_obj_request_get(struct rbd_obj_request *obj_request) |
251 |
+ { |
252 |
+ dout("%s: obj %p (was %d)\n", __func__, obj_request, |
253 |
+@@ -1382,6 +1390,13 @@ static void rbd_obj_request_put(struct rbd_obj_request *obj_request) |
254 |
+ kref_put(&obj_request->kref, rbd_obj_request_destroy); |
255 |
+ } |
256 |
+ |
257 |
++static void rbd_img_request_get(struct rbd_img_request *img_request) |
258 |
++{ |
259 |
++ dout("%s: img %p (was %d)\n", __func__, img_request, |
260 |
++ atomic_read(&img_request->kref.refcount)); |
261 |
++ kref_get(&img_request->kref); |
262 |
++} |
263 |
++ |
264 |
+ static bool img_request_child_test(struct rbd_img_request *img_request); |
265 |
+ static void rbd_parent_request_destroy(struct kref *kref); |
266 |
+ static void rbd_img_request_destroy(struct kref *kref); |
267 |
+@@ -2128,6 +2143,7 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request) |
268 |
+ img_request->next_completion = which; |
269 |
+ out: |
270 |
+ spin_unlock_irq(&img_request->completion_lock); |
271 |
++ rbd_img_request_put(img_request); |
272 |
+ |
273 |
+ if (!more) |
274 |
+ rbd_img_request_complete(img_request); |
275 |
+@@ -2225,6 +2241,7 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request, |
276 |
+ goto out_partial; |
277 |
+ obj_request->osd_req = osd_req; |
278 |
+ obj_request->callback = rbd_img_obj_callback; |
279 |
++ rbd_img_request_get(img_request); |
280 |
+ |
281 |
+ osd_req_op_extent_init(osd_req, 0, opcode, offset, length, |
282 |
+ 0, 0); |
283 |
+@@ -2647,7 +2664,7 @@ static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request) |
284 |
+ */ |
285 |
+ if (!img_request_write_test(img_request) || |
286 |
+ !img_request_layered_test(img_request) || |
287 |
+- rbd_dev->parent_overlap <= obj_request->img_offset || |
288 |
++ !obj_request_overlaps_parent(obj_request) || |
289 |
+ ((known = obj_request_known_test(obj_request)) && |
290 |
+ obj_request_exists_test(obj_request))) { |
291 |
+ |
292 |
+diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c |
293 |
+index 00f878a04d3f..0996a3a39855 100644 |
294 |
+--- a/drivers/clk/qcom/clk-rcg2.c |
295 |
++++ b/drivers/clk/qcom/clk-rcg2.c |
296 |
+@@ -55,7 +55,7 @@ static int clk_rcg2_is_enabled(struct clk_hw *hw) |
297 |
+ if (ret) |
298 |
+ return ret; |
299 |
+ |
300 |
+- return (cmd & CMD_ROOT_OFF) != 0; |
301 |
++ return (cmd & CMD_ROOT_OFF) == 0; |
302 |
+ } |
303 |
+ |
304 |
+ static u8 clk_rcg2_get_parent(struct clk_hw *hw) |
305 |
+diff --git a/drivers/clk/qcom/mmcc-msm8974.c b/drivers/clk/qcom/mmcc-msm8974.c |
306 |
+index c95774514b81..6a0ae77d1939 100644 |
307 |
+--- a/drivers/clk/qcom/mmcc-msm8974.c |
308 |
++++ b/drivers/clk/qcom/mmcc-msm8974.c |
309 |
+@@ -169,6 +169,7 @@ static struct clk_pll mmpll0 = { |
310 |
+ .config_reg = 0x0014, |
311 |
+ .mode_reg = 0x0000, |
312 |
+ .status_reg = 0x001c, |
313 |
++ .status_bit = 17, |
314 |
+ .clkr.hw.init = &(struct clk_init_data){ |
315 |
+ .name = "mmpll0", |
316 |
+ .parent_names = (const char *[]){ "xo" }, |
317 |
+@@ -192,9 +193,10 @@ static struct clk_pll mmpll1 = { |
318 |
+ .l_reg = 0x0044, |
319 |
+ .m_reg = 0x0048, |
320 |
+ .n_reg = 0x004c, |
321 |
+- .config_reg = 0x0054, |
322 |
++ .config_reg = 0x0050, |
323 |
+ .mode_reg = 0x0040, |
324 |
+ .status_reg = 0x005c, |
325 |
++ .status_bit = 17, |
326 |
+ .clkr.hw.init = &(struct clk_init_data){ |
327 |
+ .name = "mmpll1", |
328 |
+ .parent_names = (const char *[]){ "xo" }, |
329 |
+@@ -218,7 +220,7 @@ static struct clk_pll mmpll2 = { |
330 |
+ .l_reg = 0x4104, |
331 |
+ .m_reg = 0x4108, |
332 |
+ .n_reg = 0x410c, |
333 |
+- .config_reg = 0x4114, |
334 |
++ .config_reg = 0x4110, |
335 |
+ .mode_reg = 0x4100, |
336 |
+ .status_reg = 0x411c, |
337 |
+ .clkr.hw.init = &(struct clk_init_data){ |
338 |
+@@ -233,9 +235,10 @@ static struct clk_pll mmpll3 = { |
339 |
+ .l_reg = 0x0084, |
340 |
+ .m_reg = 0x0088, |
341 |
+ .n_reg = 0x008c, |
342 |
+- .config_reg = 0x0094, |
343 |
++ .config_reg = 0x0090, |
344 |
+ .mode_reg = 0x0080, |
345 |
+ .status_reg = 0x009c, |
346 |
++ .status_bit = 17, |
347 |
+ .clkr.hw.init = &(struct clk_init_data){ |
348 |
+ .name = "mmpll3", |
349 |
+ .parent_names = (const char *[]){ "xo" }, |
350 |
+@@ -2318,7 +2321,7 @@ static const struct pll_config mmpll1_config = { |
351 |
+ .vco_val = 0x0, |
352 |
+ .vco_mask = 0x3 << 20, |
353 |
+ .pre_div_val = 0x0, |
354 |
+- .pre_div_mask = 0x3 << 12, |
355 |
++ .pre_div_mask = 0x7 << 12, |
356 |
+ .post_div_val = 0x0, |
357 |
+ .post_div_mask = 0x3 << 8, |
358 |
+ .mn_ena_mask = BIT(24), |
359 |
+@@ -2332,7 +2335,7 @@ static struct pll_config mmpll3_config = { |
360 |
+ .vco_val = 0x0, |
361 |
+ .vco_mask = 0x3 << 20, |
362 |
+ .pre_div_val = 0x0, |
363 |
+- .pre_div_mask = 0x3 << 12, |
364 |
++ .pre_div_mask = 0x7 << 12, |
365 |
+ .post_div_val = 0x0, |
366 |
+ .post_div_mask = 0x3 << 8, |
367 |
+ .mn_ena_mask = BIT(24), |
368 |
+diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c |
369 |
+index de9ef4a1986d..6d98c37c87ad 100644 |
370 |
+--- a/drivers/cpufreq/intel_pstate.c |
371 |
++++ b/drivers/cpufreq/intel_pstate.c |
372 |
+@@ -200,10 +200,7 @@ static signed int pid_calc(struct _pid *pid, int32_t busy) |
373 |
+ pid->last_err = fp_error; |
374 |
+ |
375 |
+ result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm; |
376 |
+- if (result >= 0) |
377 |
+- result = result + (1 << (FRAC_BITS-1)); |
378 |
+- else |
379 |
+- result = result - (1 << (FRAC_BITS-1)); |
380 |
++ result = result + (1 << (FRAC_BITS-1)); |
381 |
+ return (signed int)fp_toint(result); |
382 |
+ } |
383 |
+ |
384 |
+diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c |
385 |
+index 19a4f0535b63..fd98bec78816 100644 |
386 |
+--- a/drivers/gpu/drm/i915/intel_panel.c |
387 |
++++ b/drivers/gpu/drm/i915/intel_panel.c |
388 |
+@@ -736,9 +736,6 @@ static void i965_enable_backlight(struct intel_connector *connector) |
389 |
+ ctl = freq << 16; |
390 |
+ I915_WRITE(BLC_PWM_CTL, ctl); |
391 |
+ |
392 |
+- /* XXX: combine this into above write? */ |
393 |
+- intel_panel_actually_set_backlight(connector, panel->backlight.level); |
394 |
+- |
395 |
+ ctl2 = BLM_PIPE(pipe); |
396 |
+ if (panel->backlight.combination_mode) |
397 |
+ ctl2 |= BLM_COMBINATION_MODE; |
398 |
+@@ -747,6 +744,8 @@ static void i965_enable_backlight(struct intel_connector *connector) |
399 |
+ I915_WRITE(BLC_PWM_CTL2, ctl2); |
400 |
+ POSTING_READ(BLC_PWM_CTL2); |
401 |
+ I915_WRITE(BLC_PWM_CTL2, ctl2 | BLM_PWM_ENABLE); |
402 |
++ |
403 |
++ intel_panel_actually_set_backlight(connector, panel->backlight.level); |
404 |
+ } |
405 |
+ |
406 |
+ static void vlv_enable_backlight(struct intel_connector *connector) |
407 |
+diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c |
408 |
+index bd1b00344dac..8e7245151b96 100644 |
409 |
+--- a/drivers/gpu/drm/i915/intel_pm.c |
410 |
++++ b/drivers/gpu/drm/i915/intel_pm.c |
411 |
+@@ -5138,10 +5138,25 @@ bool intel_display_power_enabled_sw(struct drm_device *dev, |
412 |
+ { |
413 |
+ struct drm_i915_private *dev_priv = dev->dev_private; |
414 |
+ struct i915_power_domains *power_domains; |
415 |
++ struct i915_power_well *power_well; |
416 |
++ bool is_enabled; |
417 |
++ int i; |
418 |
++ |
419 |
++ if (dev_priv->pm.suspended) |
420 |
++ return false; |
421 |
+ |
422 |
+ power_domains = &dev_priv->power_domains; |
423 |
++ is_enabled = true; |
424 |
++ for_each_power_well_rev(i, power_well, BIT(domain), power_domains) { |
425 |
++ if (power_well->always_on) |
426 |
++ continue; |
427 |
+ |
428 |
+- return power_domains->domain_use_count[domain]; |
429 |
++ if (!power_well->count) { |
430 |
++ is_enabled = false; |
431 |
++ break; |
432 |
++ } |
433 |
++ } |
434 |
++ return is_enabled; |
435 |
+ } |
436 |
+ |
437 |
+ bool intel_display_power_enabled(struct drm_device *dev, |
438 |
+diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c |
439 |
+index cbc2feeda59d..1890264cf115 100644 |
440 |
+--- a/drivers/gpu/drm/i915/intel_sdvo.c |
441 |
++++ b/drivers/gpu/drm/i915/intel_sdvo.c |
442 |
+@@ -1383,7 +1383,9 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, |
443 |
+ >> SDVO_PORT_MULTIPLY_SHIFT) + 1; |
444 |
+ } |
445 |
+ |
446 |
+- dotclock = pipe_config->port_clock / pipe_config->pixel_multiplier; |
447 |
++ dotclock = pipe_config->port_clock; |
448 |
++ if (pipe_config->pixel_multiplier) |
449 |
++ dotclock /= pipe_config->pixel_multiplier; |
450 |
+ |
451 |
+ if (HAS_PCH_SPLIT(dev)) |
452 |
+ ironlake_check_encoder_dotclock(pipe_config, dotclock); |
453 |
+diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c |
454 |
+index 7cf8b1348632..6fdf6e385bf7 100644 |
455 |
+--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c |
456 |
++++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c |
457 |
+@@ -51,6 +51,14 @@ nv04_disp_scanoutpos(struct nouveau_object *object, u32 mthd, |
458 |
+ args->htotal = nv_rd32(priv, 0x680824 + (head * 0x2000)) & 0xffff; |
459 |
+ args->hblanke = args->htotal - 1; |
460 |
+ |
461 |
++ /* |
462 |
++ * If output is vga instead of digital then vtotal/htotal is invalid |
463 |
++ * so we have to give up and trigger the timestamping fallback in the |
464 |
++ * drm core. |
465 |
++ */ |
466 |
++ if (!args->vtotal || !args->htotal) |
467 |
++ return -ENOTSUPP; |
468 |
++ |
469 |
+ args->time[0] = ktime_to_ns(ktime_get()); |
470 |
+ line = nv_rd32(priv, 0x600868 + (head * 0x2000)); |
471 |
+ args->time[1] = ktime_to_ns(ktime_get()); |
472 |
+diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c |
473 |
+index a86bd3352bf8..e69bfde37aef 100644 |
474 |
+--- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c |
475 |
++++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c |
476 |
+@@ -1318,10 +1318,12 @@ nv108_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) |
477 |
+ mmio_list(0x408010, 0x80000000, 0, 0); |
478 |
+ mmio_list(0x419004, 0x00000000, 8, 1); |
479 |
+ mmio_list(0x419008, 0x00000000, 0, 0); |
480 |
++ mmio_list(0x4064cc, 0x80000000, 0, 0); |
481 |
+ mmio_list(0x408004, 0x00000000, 8, 0); |
482 |
+ mmio_list(0x408008, 0x80000030, 0, 0); |
483 |
+ mmio_list(0x418808, 0x00000000, 8, 0); |
484 |
+ mmio_list(0x41880c, 0x80000030, 0, 0); |
485 |
++ mmio_list(0x4064c8, 0x00c20200, 0, 0); |
486 |
+ mmio_list(0x418810, 0x80000000, 12, 2); |
487 |
+ mmio_list(0x419848, 0x10000000, 12, 2); |
488 |
+ |
489 |
+diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c |
490 |
+index e8822a934c48..90d8bf8ce0dc 100644 |
491 |
+--- a/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c |
492 |
++++ b/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c |
493 |
+@@ -26,6 +26,7 @@ |
494 |
+ |
495 |
+ const struct nouveau_mc_intr |
496 |
+ nv50_mc_intr[] = { |
497 |
++ { 0x04000000, NVDEV_ENGINE_DISP }, /* DISP before FIFO, so pageflip-timestamping works! */ |
498 |
+ { 0x00000001, NVDEV_ENGINE_MPEG }, |
499 |
+ { 0x00000100, NVDEV_ENGINE_FIFO }, |
500 |
+ { 0x00001000, NVDEV_ENGINE_GR }, |
501 |
+@@ -34,7 +35,6 @@ nv50_mc_intr[] = { |
502 |
+ { 0x00020000, NVDEV_ENGINE_VP }, /* NV84- */ |
503 |
+ { 0x00100000, NVDEV_SUBDEV_TIMER }, |
504 |
+ { 0x00200000, NVDEV_SUBDEV_GPIO }, |
505 |
+- { 0x04000000, NVDEV_ENGINE_DISP }, |
506 |
+ { 0x10000000, NVDEV_SUBDEV_BUS }, |
507 |
+ { 0x80000000, NVDEV_ENGINE_SW }, |
508 |
+ { 0x0002d101, NVDEV_SUBDEV_FB }, |
509 |
+diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c b/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c |
510 |
+index f8a6f18e2d34..95b3d35388a8 100644 |
511 |
+--- a/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c |
512 |
++++ b/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c |
513 |
+@@ -26,6 +26,7 @@ |
514 |
+ |
515 |
+ static const struct nouveau_mc_intr |
516 |
+ nv98_mc_intr[] = { |
517 |
++ { 0x04000000, NVDEV_ENGINE_DISP }, /* DISP first, so pageflip timestamps work */ |
518 |
+ { 0x00000001, NVDEV_ENGINE_PPP }, |
519 |
+ { 0x00000100, NVDEV_ENGINE_FIFO }, |
520 |
+ { 0x00001000, NVDEV_ENGINE_GR }, |
521 |
+@@ -37,7 +38,6 @@ nv98_mc_intr[] = { |
522 |
+ { 0x00100000, NVDEV_SUBDEV_TIMER }, |
523 |
+ { 0x00200000, NVDEV_SUBDEV_GPIO }, |
524 |
+ { 0x00400000, NVDEV_ENGINE_COPY0 }, /* NVA3- */ |
525 |
+- { 0x04000000, NVDEV_ENGINE_DISP }, |
526 |
+ { 0x10000000, NVDEV_SUBDEV_BUS }, |
527 |
+ { 0x80000000, NVDEV_ENGINE_SW }, |
528 |
+ { 0x0042d101, NVDEV_SUBDEV_FB }, |
529 |
+diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c |
530 |
+index 34472d317097..ac7f99a15fa7 100644 |
531 |
+--- a/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c |
532 |
++++ b/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c |
533 |
+@@ -26,6 +26,7 @@ |
534 |
+ |
535 |
+ const struct nouveau_mc_intr |
536 |
+ nvc0_mc_intr[] = { |
537 |
++ { 0x04000000, NVDEV_ENGINE_DISP }, /* DISP first, so pageflip timestamps work. */ |
538 |
+ { 0x00000001, NVDEV_ENGINE_PPP }, |
539 |
+ { 0x00000020, NVDEV_ENGINE_COPY0 }, |
540 |
+ { 0x00000040, NVDEV_ENGINE_COPY1 }, |
541 |
+@@ -40,7 +41,6 @@ nvc0_mc_intr[] = { |
542 |
+ { 0x00200000, NVDEV_SUBDEV_GPIO }, |
543 |
+ { 0x01000000, NVDEV_SUBDEV_PWR }, |
544 |
+ { 0x02000000, NVDEV_SUBDEV_LTCG }, |
545 |
+- { 0x04000000, NVDEV_ENGINE_DISP }, |
546 |
+ { 0x08000000, NVDEV_SUBDEV_FB }, |
547 |
+ { 0x10000000, NVDEV_SUBDEV_BUS }, |
548 |
+ { 0x40000000, NVDEV_SUBDEV_IBUS }, |
549 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c |
550 |
+index 5524a3705224..6601690ab29c 100644 |
551 |
+--- a/drivers/gpu/drm/nouveau/nouveau_display.c |
552 |
++++ b/drivers/gpu/drm/nouveau/nouveau_display.c |
553 |
+@@ -734,6 +734,9 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
554 |
+ fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y, |
555 |
+ new_bo->bo.offset }; |
556 |
+ |
557 |
++ /* Keep vblanks on during flip, for the target crtc of this flip */ |
558 |
++ drm_vblank_get(dev, nouveau_crtc(crtc)->index); |
559 |
++ |
560 |
+ /* Emit a page flip */ |
561 |
+ if (nv_device(drm->device)->card_type >= NV_50) { |
562 |
+ ret = nv50_display_flip_next(crtc, fb, chan, swap_interval); |
563 |
+@@ -777,6 +780,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
564 |
+ return 0; |
565 |
+ |
566 |
+ fail_unreserve: |
567 |
++ drm_vblank_put(dev, nouveau_crtc(crtc)->index); |
568 |
+ ttm_bo_unreserve(&old_bo->bo); |
569 |
+ fail_unpin: |
570 |
+ mutex_unlock(&chan->cli->mutex); |
571 |
+@@ -796,6 +800,7 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, |
572 |
+ struct drm_device *dev = drm->dev; |
573 |
+ struct nouveau_page_flip_state *s; |
574 |
+ unsigned long flags; |
575 |
++ int crtcid = -1; |
576 |
+ |
577 |
+ spin_lock_irqsave(&dev->event_lock, flags); |
578 |
+ |
579 |
+@@ -806,8 +811,16 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, |
580 |
+ } |
581 |
+ |
582 |
+ s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); |
583 |
+- if (s->event) |
584 |
+- drm_send_vblank_event(dev, s->crtc, s->event); |
585 |
++ if (s->event) { |
586 |
++ /* Vblank timestamps/counts are only correct on >= NV-50 */ |
587 |
++ if (nv_device(drm->device)->card_type >= NV_50) |
588 |
++ crtcid = s->crtc; |
589 |
++ |
590 |
++ drm_send_vblank_event(dev, crtcid, s->event); |
591 |
++ } |
592 |
++ |
593 |
++ /* Give up ownership of vblank for page-flipped crtc */ |
594 |
++ drm_vblank_put(dev, s->crtc); |
595 |
+ |
596 |
+ list_del(&s->head); |
597 |
+ if (ps) |
598 |
+diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c |
599 |
+index 41a9a9cb271a..0cca5f24196a 100644 |
600 |
+--- a/drivers/gpu/drm/radeon/atombios_crtc.c |
601 |
++++ b/drivers/gpu/drm/radeon/atombios_crtc.c |
602 |
+@@ -862,14 +862,16 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc, |
603 |
+ args.v5.ucMiscInfo = 0; /* HDMI depth, etc. */ |
604 |
+ if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK)) |
605 |
+ args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_REF_DIV_SRC; |
606 |
+- switch (bpc) { |
607 |
+- case 8: |
608 |
+- default: |
609 |
+- args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_24BPP; |
610 |
+- break; |
611 |
+- case 10: |
612 |
+- args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP; |
613 |
+- break; |
614 |
++ if (encoder_mode == ATOM_ENCODER_MODE_HDMI) { |
615 |
++ switch (bpc) { |
616 |
++ case 8: |
617 |
++ default: |
618 |
++ args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_24BPP; |
619 |
++ break; |
620 |
++ case 10: |
621 |
++ args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP; |
622 |
++ break; |
623 |
++ } |
624 |
+ } |
625 |
+ args.v5.ucTransmitterID = encoder_id; |
626 |
+ args.v5.ucEncoderMode = encoder_mode; |
627 |
+@@ -884,20 +886,22 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc, |
628 |
+ args.v6.ucMiscInfo = 0; /* HDMI depth, etc. */ |
629 |
+ if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK)) |
630 |
+ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_REF_DIV_SRC; |
631 |
+- switch (bpc) { |
632 |
+- case 8: |
633 |
+- default: |
634 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_24BPP; |
635 |
+- break; |
636 |
+- case 10: |
637 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP; |
638 |
+- break; |
639 |
+- case 12: |
640 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP; |
641 |
+- break; |
642 |
+- case 16: |
643 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP; |
644 |
+- break; |
645 |
++ if (encoder_mode == ATOM_ENCODER_MODE_HDMI) { |
646 |
++ switch (bpc) { |
647 |
++ case 8: |
648 |
++ default: |
649 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_24BPP; |
650 |
++ break; |
651 |
++ case 10: |
652 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP; |
653 |
++ break; |
654 |
++ case 12: |
655 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP; |
656 |
++ break; |
657 |
++ case 16: |
658 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP; |
659 |
++ break; |
660 |
++ } |
661 |
+ } |
662 |
+ args.v6.ucTransmitterID = encoder_id; |
663 |
+ args.v6.ucEncoderMode = encoder_mode; |
664 |
+diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c |
665 |
+index 4ad7643fce5f..5727dbdeda7f 100644 |
666 |
+--- a/drivers/gpu/drm/radeon/atombios_dp.c |
667 |
++++ b/drivers/gpu/drm/radeon/atombios_dp.c |
668 |
+@@ -386,6 +386,19 @@ static int dp_get_max_dp_pix_clock(int link_rate, |
669 |
+ |
670 |
+ /***** radeon specific DP functions *****/ |
671 |
+ |
672 |
++static int radeon_dp_get_max_link_rate(struct drm_connector *connector, |
673 |
++ u8 dpcd[DP_DPCD_SIZE]) |
674 |
++{ |
675 |
++ int max_link_rate; |
676 |
++ |
677 |
++ if (radeon_connector_is_dp12_capable(connector)) |
678 |
++ max_link_rate = min(drm_dp_max_link_rate(dpcd), 540000); |
679 |
++ else |
680 |
++ max_link_rate = min(drm_dp_max_link_rate(dpcd), 270000); |
681 |
++ |
682 |
++ return max_link_rate; |
683 |
++} |
684 |
++ |
685 |
+ /* First get the min lane# when low rate is used according to pixel clock |
686 |
+ * (prefer low rate), second check max lane# supported by DP panel, |
687 |
+ * if the max lane# < low rate lane# then use max lane# instead. |
688 |
+@@ -395,7 +408,7 @@ static int radeon_dp_get_dp_lane_number(struct drm_connector *connector, |
689 |
+ int pix_clock) |
690 |
+ { |
691 |
+ int bpp = convert_bpc_to_bpp(radeon_get_monitor_bpc(connector)); |
692 |
+- int max_link_rate = drm_dp_max_link_rate(dpcd); |
693 |
++ int max_link_rate = radeon_dp_get_max_link_rate(connector, dpcd); |
694 |
+ int max_lane_num = drm_dp_max_lane_count(dpcd); |
695 |
+ int lane_num; |
696 |
+ int max_dp_pix_clock; |
697 |
+@@ -433,7 +446,7 @@ static int radeon_dp_get_dp_link_clock(struct drm_connector *connector, |
698 |
+ return 540000; |
699 |
+ } |
700 |
+ |
701 |
+- return drm_dp_max_link_rate(dpcd); |
702 |
++ return radeon_dp_get_max_link_rate(connector, dpcd); |
703 |
+ } |
704 |
+ |
705 |
+ static u8 radeon_dp_encoder_service(struct radeon_device *rdev, |
706 |
+diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c |
707 |
+index 607dc14d195e..ccca8b224d18 100644 |
708 |
+--- a/drivers/gpu/drm/radeon/atombios_encoders.c |
709 |
++++ b/drivers/gpu/drm/radeon/atombios_encoders.c |
710 |
+@@ -1898,8 +1898,11 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encoder) |
711 |
+ args.v2.ucEncodeMode = ATOM_ENCODER_MODE_CRT; |
712 |
+ else |
713 |
+ args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); |
714 |
+- } else |
715 |
++ } else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
716 |
++ args.v2.ucEncodeMode = ATOM_ENCODER_MODE_LVDS; |
717 |
++ } else { |
718 |
+ args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); |
719 |
++ } |
720 |
+ switch (radeon_encoder->encoder_id) { |
721 |
+ case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: |
722 |
+ case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: |
723 |
+diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h |
724 |
+index d1b2c71b192a..a0a9f974cdd7 100644 |
725 |
+--- a/drivers/gpu/drm/radeon/cikd.h |
726 |
++++ b/drivers/gpu/drm/radeon/cikd.h |
727 |
+@@ -1745,12 +1745,12 @@ |
728 |
+ #define EOP_TC_WB_ACTION_EN (1 << 15) /* L2 */ |
729 |
+ #define EOP_TCL1_ACTION_EN (1 << 16) |
730 |
+ #define EOP_TC_ACTION_EN (1 << 17) /* L2 */ |
731 |
++#define EOP_TCL2_VOLATILE (1 << 24) |
732 |
+ #define EOP_CACHE_POLICY(x) ((x) << 25) |
733 |
+ /* 0 - LRU |
734 |
+ * 1 - Stream |
735 |
+ * 2 - Bypass |
736 |
+ */ |
737 |
+-#define EOP_TCL2_VOLATILE (1 << 27) |
738 |
+ #define DATA_SEL(x) ((x) << 29) |
739 |
+ /* 0 - discard |
740 |
+ * 1 - send low 32bit data |
741 |
+diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c |
742 |
+index cf783fc0ef21..cf777193c85f 100644 |
743 |
+--- a/drivers/gpu/drm/radeon/cypress_dpm.c |
744 |
++++ b/drivers/gpu/drm/radeon/cypress_dpm.c |
745 |
+@@ -1551,7 +1551,7 @@ int cypress_populate_smc_voltage_tables(struct radeon_device *rdev, |
746 |
+ |
747 |
+ table->voltageMaskTable.highMask[RV770_SMC_VOLTAGEMASK_VDDCI] = 0; |
748 |
+ table->voltageMaskTable.lowMask[RV770_SMC_VOLTAGEMASK_VDDCI] = |
749 |
+- cpu_to_be32(eg_pi->vddc_voltage_table.mask_low); |
750 |
++ cpu_to_be32(eg_pi->vddci_voltage_table.mask_low); |
751 |
+ } |
752 |
+ |
753 |
+ return 0; |
754 |
+diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c |
755 |
+index ca814276b075..03f08a3cf864 100644 |
756 |
+--- a/drivers/gpu/drm/radeon/ni_dpm.c |
757 |
++++ b/drivers/gpu/drm/radeon/ni_dpm.c |
758 |
+@@ -1315,7 +1315,7 @@ static void ni_populate_smc_voltage_tables(struct radeon_device *rdev, |
759 |
+ |
760 |
+ table->voltageMaskTable.highMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = 0; |
761 |
+ table->voltageMaskTable.lowMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = |
762 |
+- cpu_to_be32(eg_pi->vddc_voltage_table.mask_low); |
763 |
++ cpu_to_be32(eg_pi->vddci_voltage_table.mask_low); |
764 |
+ } |
765 |
+ } |
766 |
+ |
767 |
+diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c |
768 |
+index 82d4f865546e..4d36b9e86275 100644 |
769 |
+--- a/drivers/gpu/drm/radeon/radeon_connectors.c |
770 |
++++ b/drivers/gpu/drm/radeon/radeon_connectors.c |
771 |
+@@ -1402,7 +1402,7 @@ bool radeon_connector_is_dp12_capable(struct drm_connector *connector) |
772 |
+ struct radeon_device *rdev = dev->dev_private; |
773 |
+ |
774 |
+ if (ASIC_IS_DCE5(rdev) && |
775 |
+- (rdev->clock.dp_extclk >= 53900) && |
776 |
++ (rdev->clock.default_dispclk >= 53900) && |
777 |
+ radeon_connector_encoder_is_hbr2(connector)) { |
778 |
+ return true; |
779 |
+ } |
780 |
+diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c |
781 |
+index 7993aec86acc..7f2d6c0d11c1 100644 |
782 |
+--- a/drivers/gpu/drm/radeon/radeon_cs.c |
783 |
++++ b/drivers/gpu/drm/radeon/radeon_cs.c |
784 |
+@@ -97,6 +97,12 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) |
785 |
+ uint32_t domain = r->write_domain ? |
786 |
+ r->write_domain : r->read_domains; |
787 |
+ |
788 |
++ if (domain & RADEON_GEM_DOMAIN_CPU) { |
789 |
++ DRM_ERROR("RADEON_GEM_DOMAIN_CPU is not valid " |
790 |
++ "for command submission\n"); |
791 |
++ return -EINVAL; |
792 |
++ } |
793 |
++ |
794 |
+ p->relocs[i].lobj.domain = domain; |
795 |
+ if (domain == RADEON_GEM_DOMAIN_VRAM) |
796 |
+ domain |= RADEON_GEM_DOMAIN_GTT; |
797 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
798 |
+index 021b5227e783..1b0f34bd3a03 100644 |
799 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
800 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
801 |
+@@ -179,7 +179,6 @@ static int vmw_fb_set_par(struct fb_info *info) |
802 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset); |
803 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres); |
804 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres); |
805 |
+- vmw_write(vmw_priv, SVGA_REG_BYTES_PER_LINE, info->fix.line_length); |
806 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); |
807 |
+ } |
808 |
+ |
809 |
+diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c |
810 |
+index ec0ae2d1686a..6866448083b2 100644 |
811 |
+--- a/drivers/gpu/vga/vga_switcheroo.c |
812 |
++++ b/drivers/gpu/vga/vga_switcheroo.c |
813 |
+@@ -623,7 +623,8 @@ static int vga_switcheroo_runtime_suspend(struct device *dev) |
814 |
+ ret = dev->bus->pm->runtime_suspend(dev); |
815 |
+ if (ret) |
816 |
+ return ret; |
817 |
+- |
818 |
++ if (vgasr_priv.handler->switchto) |
819 |
++ vgasr_priv.handler->switchto(VGA_SWITCHEROO_IGD); |
820 |
+ vga_switcheroo_power_switch(pdev, VGA_SWITCHEROO_OFF); |
821 |
+ return 0; |
822 |
+ } |
823 |
+diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c |
824 |
+index 93d26e8af3e2..bfd3f3eeabcd 100644 |
825 |
+--- a/drivers/hwmon/ina2xx.c |
826 |
++++ b/drivers/hwmon/ina2xx.c |
827 |
+@@ -148,7 +148,8 @@ static int ina2xx_get_value(struct ina2xx_data *data, u8 reg) |
828 |
+ |
829 |
+ switch (reg) { |
830 |
+ case INA2XX_SHUNT_VOLTAGE: |
831 |
+- val = DIV_ROUND_CLOSEST(data->regs[reg], |
832 |
++ /* signed register */ |
833 |
++ val = DIV_ROUND_CLOSEST((s16)data->regs[reg], |
834 |
+ data->config->shunt_div); |
835 |
+ break; |
836 |
+ case INA2XX_BUS_VOLTAGE: |
837 |
+@@ -160,8 +161,8 @@ static int ina2xx_get_value(struct ina2xx_data *data, u8 reg) |
838 |
+ val = data->regs[reg] * data->config->power_lsb; |
839 |
+ break; |
840 |
+ case INA2XX_CURRENT: |
841 |
+- /* LSB=1mA (selected). Is in mA */ |
842 |
+- val = data->regs[reg]; |
843 |
++ /* signed register, LSB=1mA (selected), in mA */ |
844 |
++ val = (s16)data->regs[reg]; |
845 |
+ break; |
846 |
+ default: |
847 |
+ /* programmer goofed */ |
848 |
+diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c |
849 |
+index 0cf5f8e06cfc..1e8e94d4db7d 100644 |
850 |
+--- a/drivers/iio/inkern.c |
851 |
++++ b/drivers/iio/inkern.c |
852 |
+@@ -183,7 +183,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, |
853 |
+ else if (name && index >= 0) { |
854 |
+ pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", |
855 |
+ np->full_name, name ? name : "", index); |
856 |
+- return chan; |
857 |
++ return NULL; |
858 |
+ } |
859 |
+ |
860 |
+ /* |
861 |
+@@ -193,8 +193,9 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, |
862 |
+ */ |
863 |
+ np = np->parent; |
864 |
+ if (np && !of_get_property(np, "io-channel-ranges", NULL)) |
865 |
+- break; |
866 |
++ return NULL; |
867 |
+ } |
868 |
++ |
869 |
+ return chan; |
870 |
+ } |
871 |
+ |
872 |
+@@ -317,6 +318,7 @@ struct iio_channel *iio_channel_get(struct device *dev, |
873 |
+ if (channel != NULL) |
874 |
+ return channel; |
875 |
+ } |
876 |
++ |
877 |
+ return iio_channel_get_sys(name, channel_name); |
878 |
+ } |
879 |
+ EXPORT_SYMBOL_GPL(iio_channel_get); |
880 |
+diff --git a/drivers/irqchip/spear-shirq.c b/drivers/irqchip/spear-shirq.c |
881 |
+index 8527743b5cef..391b9cea73ed 100644 |
882 |
+--- a/drivers/irqchip/spear-shirq.c |
883 |
++++ b/drivers/irqchip/spear-shirq.c |
884 |
+@@ -125,7 +125,7 @@ static struct spear_shirq spear320_shirq_ras2 = { |
885 |
+ }; |
886 |
+ |
887 |
+ static struct spear_shirq spear320_shirq_ras3 = { |
888 |
+- .irq_nr = 3, |
889 |
++ .irq_nr = 7, |
890 |
+ .irq_bit_off = 0, |
891 |
+ .invalid_irq = 1, |
892 |
+ .regs = { |
893 |
+diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c |
894 |
+index 94d2ac1b493e..359af3a519b5 100644 |
895 |
+--- a/drivers/md/dm-thin.c |
896 |
++++ b/drivers/md/dm-thin.c |
897 |
+@@ -2925,7 +2925,8 @@ static void set_discard_limits(struct pool_c *pt, struct queue_limits *limits) |
898 |
+ */ |
899 |
+ if (pt->adjusted_pf.discard_passdown) { |
900 |
+ data_limits = &bdev_get_queue(pt->data_dev->bdev)->limits; |
901 |
+- limits->discard_granularity = data_limits->discard_granularity; |
902 |
++ limits->discard_granularity = max(data_limits->discard_granularity, |
903 |
++ pool->sectors_per_block << SECTOR_SHIFT); |
904 |
+ } else |
905 |
+ limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT; |
906 |
+ } |
907 |
+diff --git a/drivers/md/md.c b/drivers/md/md.c |
908 |
+index 8b013f87c9d8..73aedcb639c0 100644 |
909 |
+--- a/drivers/md/md.c |
910 |
++++ b/drivers/md/md.c |
911 |
+@@ -7505,6 +7505,19 @@ void md_do_sync(struct md_thread *thread) |
912 |
+ rdev->recovery_offset < j) |
913 |
+ j = rdev->recovery_offset; |
914 |
+ rcu_read_unlock(); |
915 |
++ |
916 |
++ /* If there is a bitmap, we need to make sure all |
917 |
++ * writes that started before we added a spare |
918 |
++ * complete before we start doing a recovery. |
919 |
++ * Otherwise the write might complete and (via |
920 |
++ * bitmap_endwrite) set a bit in the bitmap after the |
921 |
++ * recovery has checked that bit and skipped that |
922 |
++ * region. |
923 |
++ */ |
924 |
++ if (mddev->bitmap) { |
925 |
++ mddev->pers->quiesce(mddev, 1); |
926 |
++ mddev->pers->quiesce(mddev, 0); |
927 |
++ } |
928 |
+ } |
929 |
+ |
930 |
+ printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev)); |
931 |
+diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c |
932 |
+index c46feda07d56..7e1866175e7b 100644 |
933 |
+--- a/drivers/mmc/host/rtsx_pci_sdmmc.c |
934 |
++++ b/drivers/mmc/host/rtsx_pci_sdmmc.c |
935 |
+@@ -246,6 +246,9 @@ static void sd_send_cmd_get_rsp(struct realtek_pci_sdmmc *host, |
936 |
+ case MMC_RSP_R1: |
937 |
+ rsp_type = SD_RSP_TYPE_R1; |
938 |
+ break; |
939 |
++ case MMC_RSP_R1 & ~MMC_RSP_CRC: |
940 |
++ rsp_type = SD_RSP_TYPE_R1 | SD_NO_CHECK_CRC7; |
941 |
++ break; |
942 |
+ case MMC_RSP_R1B: |
943 |
+ rsp_type = SD_RSP_TYPE_R1b; |
944 |
+ break; |
945 |
+diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c |
946 |
+index bcf60800c3ce..c09ab95a2219 100644 |
947 |
+--- a/drivers/mtd/nand/fsl_elbc_nand.c |
948 |
++++ b/drivers/mtd/nand/fsl_elbc_nand.c |
949 |
+@@ -724,6 +724,19 @@ static int fsl_elbc_write_page(struct mtd_info *mtd, struct nand_chip *chip, |
950 |
+ return 0; |
951 |
+ } |
952 |
+ |
953 |
++/* ECC will be calculated automatically, and errors will be detected in |
954 |
++ * waitfunc. |
955 |
++ */ |
956 |
++static int fsl_elbc_write_subpage(struct mtd_info *mtd, struct nand_chip *chip, |
957 |
++ uint32_t offset, uint32_t data_len, |
958 |
++ const uint8_t *buf, int oob_required) |
959 |
++{ |
960 |
++ fsl_elbc_write_buf(mtd, buf, mtd->writesize); |
961 |
++ fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize); |
962 |
++ |
963 |
++ return 0; |
964 |
++} |
965 |
++ |
966 |
+ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) |
967 |
+ { |
968 |
+ struct fsl_lbc_ctrl *ctrl = priv->ctrl; |
969 |
+@@ -762,6 +775,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) |
970 |
+ |
971 |
+ chip->ecc.read_page = fsl_elbc_read_page; |
972 |
+ chip->ecc.write_page = fsl_elbc_write_page; |
973 |
++ chip->ecc.write_subpage = fsl_elbc_write_subpage; |
974 |
+ |
975 |
+ /* If CS Base Register selects full hardware ECC then use it */ |
976 |
+ if ((in_be32(&lbc->bank[priv->bank].br) & BR_DECC) == |
977 |
+diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c |
978 |
+index bf642ceef681..6f55d92dc233 100644 |
979 |
+--- a/drivers/mtd/nand/omap2.c |
980 |
++++ b/drivers/mtd/nand/omap2.c |
981 |
+@@ -1451,7 +1451,7 @@ static int omap_elm_correct_data(struct mtd_info *mtd, u_char *data, |
982 |
+ |
983 |
+ /* Check if any error reported */ |
984 |
+ if (!is_error_reported) |
985 |
+- return 0; |
986 |
++ return stat; |
987 |
+ |
988 |
+ /* Decode BCH error using ELM module */ |
989 |
+ elm_decode_bch_error_page(info->elm_dev, ecc_vec, err_vec); |
990 |
+diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c |
991 |
+index 2a7a0b27ac38..51e15fd53108 100644 |
992 |
+--- a/drivers/mtd/nand/pxa3xx_nand.c |
993 |
++++ b/drivers/mtd/nand/pxa3xx_nand.c |
994 |
+@@ -128,10 +128,10 @@ |
995 |
+ |
996 |
+ /* macros for registers read/write */ |
997 |
+ #define nand_writel(info, off, val) \ |
998 |
+- __raw_writel((val), (info)->mmio_base + (off)) |
999 |
++ writel_relaxed((val), (info)->mmio_base + (off)) |
1000 |
+ |
1001 |
+ #define nand_readl(info, off) \ |
1002 |
+- __raw_readl((info)->mmio_base + (off)) |
1003 |
++ readl_relaxed((info)->mmio_base + (off)) |
1004 |
+ |
1005 |
+ /* error code and state */ |
1006 |
+ enum { |
1007 |
+diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c |
1008 |
+index 511f6eecd58b..62db510b70ea 100644 |
1009 |
+--- a/drivers/net/ethernet/allwinner/sun4i-emac.c |
1010 |
++++ b/drivers/net/ethernet/allwinner/sun4i-emac.c |
1011 |
+@@ -725,6 +725,7 @@ static int emac_open(struct net_device *dev) |
1012 |
+ |
1013 |
+ ret = emac_mdio_probe(dev); |
1014 |
+ if (ret < 0) { |
1015 |
++ free_irq(dev->irq, dev); |
1016 |
+ netdev_err(dev, "cannot probe MDIO bus\n"); |
1017 |
+ return ret; |
1018 |
+ } |
1019 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c |
1020 |
+index 7e2995ecea6f..84e41920b5ff 100644 |
1021 |
+--- a/drivers/net/ethernet/mellanox/mlx4/fw.c |
1022 |
++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c |
1023 |
+@@ -398,7 +398,7 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, |
1024 |
+ |
1025 |
+ MLX4_GET(func_cap->flags1, outbox, QUERY_FUNC_CAP_FLAGS1_OFFSET); |
1026 |
+ if (dev->caps.port_type[gen_or_port] == MLX4_PORT_TYPE_ETH) { |
1027 |
+- if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_OFFSET) { |
1028 |
++ if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_FORCE_VLAN) { |
1029 |
+ mlx4_err(dev, "VLAN is enforced on this port\n"); |
1030 |
+ err = -EPROTONOSUPPORT; |
1031 |
+ goto out; |
1032 |
+diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c |
1033 |
+index 50e5ddb12fb3..628ff628e04a 100644 |
1034 |
+--- a/drivers/net/wireless/b43/xmit.c |
1035 |
++++ b/drivers/net/wireless/b43/xmit.c |
1036 |
+@@ -810,9 +810,13 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr) |
1037 |
+ break; |
1038 |
+ case B43_PHYTYPE_G: |
1039 |
+ status.band = IEEE80211_BAND_2GHZ; |
1040 |
+- /* chanid is the radio channel cookie value as used |
1041 |
+- * to tune the radio. */ |
1042 |
+- status.freq = chanid + 2400; |
1043 |
++ /* Somewhere between 478.104 and 508.1084 firmware for G-PHY |
1044 |
++ * has been modified to be compatible with N-PHY and others. |
1045 |
++ */ |
1046 |
++ if (dev->fw.rev >= 508) |
1047 |
++ status.freq = ieee80211_channel_to_frequency(chanid, status.band); |
1048 |
++ else |
1049 |
++ status.freq = chanid + 2400; |
1050 |
+ break; |
1051 |
+ case B43_PHYTYPE_N: |
1052 |
+ case B43_PHYTYPE_LP: |
1053 |
+diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c |
1054 |
+index 82bf3c5d3cdc..2de2736eb332 100644 |
1055 |
+--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c |
1056 |
++++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c |
1057 |
+@@ -300,10 +300,10 @@ brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev, |
1058 |
+ |
1059 |
+ wrapbase = ci->c_inf[idx].wrapbase; |
1060 |
+ |
1061 |
+- /* if core is already in reset, just return */ |
1062 |
++ /* if core is already in reset, skip reset */ |
1063 |
+ regdata = brcmf_sdiod_regrl(sdiodev, wrapbase + BCMA_RESET_CTL, NULL); |
1064 |
+ if ((regdata & BCMA_RESET_CTL_RESET) != 0) |
1065 |
+- return; |
1066 |
++ goto post_reset_config; |
1067 |
+ |
1068 |
+ /* configure reset */ |
1069 |
+ brcmf_sdiod_regwl(sdiodev, wrapbase + BCMA_IOCTL, pre_resetbits | |
1070 |
+@@ -319,6 +319,7 @@ brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev, |
1071 |
+ SPINWAIT(brcmf_sdiod_regrl(sdiodev, wrapbase + BCMA_RESET_CTL, NULL) != |
1072 |
+ BCMA_RESET_CTL_RESET, 300); |
1073 |
+ |
1074 |
++post_reset_config: |
1075 |
+ /* post reset configure */ |
1076 |
+ brcmf_sdiod_regwl(sdiodev, wrapbase + BCMA_IOCTL, pre_resetbits | |
1077 |
+ BCMA_IOCTL_FGC | BCMA_IOCTL_CLK, NULL); |
1078 |
+diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c |
1079 |
+index 8d42fd9b0811..16be0c07c64a 100644 |
1080 |
+--- a/drivers/net/wireless/iwlwifi/pcie/trans.c |
1081 |
++++ b/drivers/net/wireless/iwlwifi/pcie/trans.c |
1082 |
+@@ -318,6 +318,7 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans) |
1083 |
+ { |
1084 |
+ int ret; |
1085 |
+ int t = 0; |
1086 |
++ int iter; |
1087 |
+ |
1088 |
+ IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n"); |
1089 |
+ |
1090 |
+@@ -326,18 +327,23 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans) |
1091 |
+ if (ret >= 0) |
1092 |
+ return 0; |
1093 |
+ |
1094 |
+- /* If HW is not ready, prepare the conditions to check again */ |
1095 |
+- iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, |
1096 |
+- CSR_HW_IF_CONFIG_REG_PREPARE); |
1097 |
++ for (iter = 0; iter < 10; iter++) { |
1098 |
++ /* If HW is not ready, prepare the conditions to check again */ |
1099 |
++ iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, |
1100 |
++ CSR_HW_IF_CONFIG_REG_PREPARE); |
1101 |
++ |
1102 |
++ do { |
1103 |
++ ret = iwl_pcie_set_hw_ready(trans); |
1104 |
++ if (ret >= 0) |
1105 |
++ return 0; |
1106 |
+ |
1107 |
+- do { |
1108 |
+- ret = iwl_pcie_set_hw_ready(trans); |
1109 |
+- if (ret >= 0) |
1110 |
+- return 0; |
1111 |
++ usleep_range(200, 1000); |
1112 |
++ t += 200; |
1113 |
++ } while (t < 150000); |
1114 |
++ msleep(25); |
1115 |
++ } |
1116 |
+ |
1117 |
+- usleep_range(200, 1000); |
1118 |
+- t += 200; |
1119 |
+- } while (t < 150000); |
1120 |
++ IWL_DEBUG_INFO(trans, "got NIC after %d iterations\n", iter); |
1121 |
+ |
1122 |
+ return ret; |
1123 |
+ } |
1124 |
+diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c |
1125 |
+index 2f1cd929c6f6..a511cccc9f01 100644 |
1126 |
+--- a/drivers/net/wireless/rt2x00/rt2500pci.c |
1127 |
++++ b/drivers/net/wireless/rt2x00/rt2500pci.c |
1128 |
+@@ -1681,8 +1681,13 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev) |
1129 |
+ /* |
1130 |
+ * Detect if this device has an hardware controlled radio. |
1131 |
+ */ |
1132 |
+- if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) |
1133 |
++ if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) { |
1134 |
+ __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags); |
1135 |
++ /* |
1136 |
++ * On this device RFKILL initialized during probe does not work. |
1137 |
++ */ |
1138 |
++ __set_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags); |
1139 |
++ } |
1140 |
+ |
1141 |
+ /* |
1142 |
+ * Check if the BBP tuning should be enabled. |
1143 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h |
1144 |
+index e3b885d8f7db..5d45a1a740a4 100644 |
1145 |
+--- a/drivers/net/wireless/rt2x00/rt2x00.h |
1146 |
++++ b/drivers/net/wireless/rt2x00/rt2x00.h |
1147 |
+@@ -693,6 +693,7 @@ enum rt2x00_capability_flags { |
1148 |
+ REQUIRE_SW_SEQNO, |
1149 |
+ REQUIRE_HT_TX_DESC, |
1150 |
+ REQUIRE_PS_AUTOWAKE, |
1151 |
++ REQUIRE_DELAYED_RFKILL, |
1152 |
+ |
1153 |
+ /* |
1154 |
+ * Capabilities |
1155 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c |
1156 |
+index 2bde6729f5e6..4fa43a2eeb73 100644 |
1157 |
+--- a/drivers/net/wireless/rt2x00/rt2x00dev.c |
1158 |
++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c |
1159 |
+@@ -1126,9 +1126,10 @@ static void rt2x00lib_uninitialize(struct rt2x00_dev *rt2x00dev) |
1160 |
+ return; |
1161 |
+ |
1162 |
+ /* |
1163 |
+- * Unregister extra components. |
1164 |
++ * Stop rfkill polling. |
1165 |
+ */ |
1166 |
+- rt2x00rfkill_unregister(rt2x00dev); |
1167 |
++ if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
1168 |
++ rt2x00rfkill_unregister(rt2x00dev); |
1169 |
+ |
1170 |
+ /* |
1171 |
+ * Allow the HW to uninitialize. |
1172 |
+@@ -1166,6 +1167,12 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) |
1173 |
+ |
1174 |
+ set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); |
1175 |
+ |
1176 |
++ /* |
1177 |
++ * Start rfkill polling. |
1178 |
++ */ |
1179 |
++ if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
1180 |
++ rt2x00rfkill_register(rt2x00dev); |
1181 |
++ |
1182 |
+ return 0; |
1183 |
+ } |
1184 |
+ |
1185 |
+@@ -1375,7 +1382,12 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) |
1186 |
+ rt2x00link_register(rt2x00dev); |
1187 |
+ rt2x00leds_register(rt2x00dev); |
1188 |
+ rt2x00debug_register(rt2x00dev); |
1189 |
+- rt2x00rfkill_register(rt2x00dev); |
1190 |
++ |
1191 |
++ /* |
1192 |
++ * Start rfkill polling. |
1193 |
++ */ |
1194 |
++ if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
1195 |
++ rt2x00rfkill_register(rt2x00dev); |
1196 |
+ |
1197 |
+ return 0; |
1198 |
+ |
1199 |
+@@ -1391,6 +1403,12 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) |
1200 |
+ clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); |
1201 |
+ |
1202 |
+ /* |
1203 |
++ * Stop rfkill polling. |
1204 |
++ */ |
1205 |
++ if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
1206 |
++ rt2x00rfkill_unregister(rt2x00dev); |
1207 |
++ |
1208 |
++ /* |
1209 |
+ * Disable radio. |
1210 |
+ */ |
1211 |
+ rt2x00lib_disable_radio(rt2x00dev); |
1212 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c |
1213 |
+index a87ee9b6585a..87a8ad5d2eb7 100644 |
1214 |
+--- a/drivers/net/wireless/rt2x00/rt2x00mac.c |
1215 |
++++ b/drivers/net/wireless/rt2x00/rt2x00mac.c |
1216 |
+@@ -487,6 +487,8 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
1217 |
+ crypto.cipher = rt2x00crypto_key_to_cipher(key); |
1218 |
+ if (crypto.cipher == CIPHER_NONE) |
1219 |
+ return -EOPNOTSUPP; |
1220 |
++ if (crypto.cipher == CIPHER_TKIP && rt2x00_is_usb(rt2x00dev)) |
1221 |
++ return -EOPNOTSUPP; |
1222 |
+ |
1223 |
+ crypto.cmd = cmd; |
1224 |
+ |
1225 |
+diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c |
1226 |
+index fa764406df68..c5bb0e0a36b9 100644 |
1227 |
+--- a/drivers/scsi/ibmvscsi/ibmvscsi.c |
1228 |
++++ b/drivers/scsi/ibmvscsi/ibmvscsi.c |
1229 |
+@@ -185,6 +185,11 @@ static struct viosrp_crq *crq_queue_next_crq(struct crq_queue *queue) |
1230 |
+ if (crq->valid & 0x80) { |
1231 |
+ if (++queue->cur == queue->size) |
1232 |
+ queue->cur = 0; |
1233 |
++ |
1234 |
++ /* Ensure the read of the valid bit occurs before reading any |
1235 |
++ * other bits of the CRQ entry |
1236 |
++ */ |
1237 |
++ rmb(); |
1238 |
+ } else |
1239 |
+ crq = NULL; |
1240 |
+ spin_unlock_irqrestore(&queue->lock, flags); |
1241 |
+@@ -203,6 +208,11 @@ static int ibmvscsi_send_crq(struct ibmvscsi_host_data *hostdata, |
1242 |
+ { |
1243 |
+ struct vio_dev *vdev = to_vio_dev(hostdata->dev); |
1244 |
+ |
1245 |
++ /* |
1246 |
++ * Ensure the command buffer is flushed to memory before handing it |
1247 |
++ * over to the VIOS to prevent it from fetching any stale data. |
1248 |
++ */ |
1249 |
++ mb(); |
1250 |
+ return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, word1, word2); |
1251 |
+ } |
1252 |
+ |
1253 |
+@@ -797,7 +807,8 @@ static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code) |
1254 |
+ evt->hostdata->dev); |
1255 |
+ if (evt->cmnd_done) |
1256 |
+ evt->cmnd_done(evt->cmnd); |
1257 |
+- } else if (evt->done) |
1258 |
++ } else if (evt->done && evt->crq.format != VIOSRP_MAD_FORMAT && |
1259 |
++ evt->iu.srp.login_req.opcode != SRP_LOGIN_REQ) |
1260 |
+ evt->done(evt); |
1261 |
+ free_event_struct(&evt->hostdata->pool, evt); |
1262 |
+ spin_lock_irqsave(hostdata->host->host_lock, flags); |
1263 |
+diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c |
1264 |
+index ef29636d4c9b..edb4d46fa874 100644 |
1265 |
+--- a/drivers/scsi/scsi_error.c |
1266 |
++++ b/drivers/scsi/scsi_error.c |
1267 |
+@@ -131,7 +131,7 @@ scmd_eh_abort_handler(struct work_struct *work) |
1268 |
+ "aborting command %p\n", scmd)); |
1269 |
+ rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd); |
1270 |
+ if (rtn == SUCCESS) { |
1271 |
+- scmd->result |= DID_TIME_OUT << 16; |
1272 |
++ set_host_byte(scmd, DID_TIME_OUT); |
1273 |
+ if (scsi_host_eh_past_deadline(sdev->host)) { |
1274 |
+ SCSI_LOG_ERROR_RECOVERY(3, |
1275 |
+ scmd_printk(KERN_INFO, scmd, |
1276 |
+@@ -167,7 +167,7 @@ scmd_eh_abort_handler(struct work_struct *work) |
1277 |
+ scmd_printk(KERN_WARNING, scmd, |
1278 |
+ "scmd %p terminate " |
1279 |
+ "aborted command\n", scmd)); |
1280 |
+- scmd->result |= DID_TIME_OUT << 16; |
1281 |
++ set_host_byte(scmd, DID_TIME_OUT); |
1282 |
+ scsi_finish_command(scmd); |
1283 |
+ } |
1284 |
+ } |
1285 |
+@@ -290,7 +290,7 @@ enum blk_eh_timer_return scsi_times_out(struct request *req) |
1286 |
+ if (scsi_abort_command(scmd) == SUCCESS) |
1287 |
+ return BLK_EH_NOT_HANDLED; |
1288 |
+ |
1289 |
+- scmd->result |= DID_TIME_OUT << 16; |
1290 |
++ set_host_byte(scmd, DID_TIME_OUT); |
1291 |
+ |
1292 |
+ if (unlikely(rtn == BLK_EH_NOT_HANDLED && |
1293 |
+ !scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) |
1294 |
+@@ -1773,7 +1773,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) |
1295 |
+ break; |
1296 |
+ case DID_ABORT: |
1297 |
+ if (scmd->eh_eflags & SCSI_EH_ABORT_SCHEDULED) { |
1298 |
+- scmd->result |= DID_TIME_OUT << 16; |
1299 |
++ set_host_byte(scmd, DID_TIME_OUT); |
1300 |
+ return SUCCESS; |
1301 |
+ } |
1302 |
+ case DID_NO_CONNECT: |
1303 |
+diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c |
1304 |
+index d92fe4037e94..6b349e301869 100644 |
1305 |
+--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c |
1306 |
++++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c |
1307 |
+@@ -3000,7 +3000,11 @@ sym_dequeue_from_squeue(struct sym_hcb *np, int i, int target, int lun, int task |
1308 |
+ if ((target == -1 || cp->target == target) && |
1309 |
+ (lun == -1 || cp->lun == lun) && |
1310 |
+ (task == -1 || cp->tag == task)) { |
1311 |
++#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING |
1312 |
+ sym_set_cam_status(cp->cmd, DID_SOFT_ERROR); |
1313 |
++#else |
1314 |
++ sym_set_cam_status(cp->cmd, DID_REQUEUE); |
1315 |
++#endif |
1316 |
+ sym_remque(&cp->link_ccbq); |
1317 |
+ sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq); |
1318 |
+ } |
1319 |
+diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c |
1320 |
+index db3b494e5926..8490aa411739 100644 |
1321 |
+--- a/drivers/scsi/virtio_scsi.c |
1322 |
++++ b/drivers/scsi/virtio_scsi.c |
1323 |
+@@ -273,6 +273,16 @@ static void virtscsi_req_done(struct virtqueue *vq) |
1324 |
+ virtscsi_vq_done(vscsi, req_vq, virtscsi_complete_cmd); |
1325 |
+ }; |
1326 |
+ |
1327 |
++static void virtscsi_poll_requests(struct virtio_scsi *vscsi) |
1328 |
++{ |
1329 |
++ int i, num_vqs; |
1330 |
++ |
1331 |
++ num_vqs = vscsi->num_queues; |
1332 |
++ for (i = 0; i < num_vqs; i++) |
1333 |
++ virtscsi_vq_done(vscsi, &vscsi->req_vqs[i], |
1334 |
++ virtscsi_complete_cmd); |
1335 |
++} |
1336 |
++ |
1337 |
+ static void virtscsi_complete_free(struct virtio_scsi *vscsi, void *buf) |
1338 |
+ { |
1339 |
+ struct virtio_scsi_cmd *cmd = buf; |
1340 |
+@@ -291,6 +301,8 @@ static void virtscsi_ctrl_done(struct virtqueue *vq) |
1341 |
+ virtscsi_vq_done(vscsi, &vscsi->ctrl_vq, virtscsi_complete_free); |
1342 |
+ }; |
1343 |
+ |
1344 |
++static void virtscsi_handle_event(struct work_struct *work); |
1345 |
++ |
1346 |
+ static int virtscsi_kick_event(struct virtio_scsi *vscsi, |
1347 |
+ struct virtio_scsi_event_node *event_node) |
1348 |
+ { |
1349 |
+@@ -298,6 +310,7 @@ static int virtscsi_kick_event(struct virtio_scsi *vscsi, |
1350 |
+ struct scatterlist sg; |
1351 |
+ unsigned long flags; |
1352 |
+ |
1353 |
++ INIT_WORK(&event_node->work, virtscsi_handle_event); |
1354 |
+ sg_init_one(&sg, &event_node->event, sizeof(struct virtio_scsi_event)); |
1355 |
+ |
1356 |
+ spin_lock_irqsave(&vscsi->event_vq.vq_lock, flags); |
1357 |
+@@ -415,7 +428,6 @@ static void virtscsi_complete_event(struct virtio_scsi *vscsi, void *buf) |
1358 |
+ { |
1359 |
+ struct virtio_scsi_event_node *event_node = buf; |
1360 |
+ |
1361 |
+- INIT_WORK(&event_node->work, virtscsi_handle_event); |
1362 |
+ schedule_work(&event_node->work); |
1363 |
+ } |
1364 |
+ |
1365 |
+@@ -605,6 +617,18 @@ static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) |
1366 |
+ cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) |
1367 |
+ ret = SUCCESS; |
1368 |
+ |
1369 |
++ /* |
1370 |
++ * The spec guarantees that all requests related to the TMF have |
1371 |
++ * been completed, but the callback might not have run yet if |
1372 |
++ * we're using independent interrupts (e.g. MSI). Poll the |
1373 |
++ * virtqueues once. |
1374 |
++ * |
1375 |
++ * In the abort case, sc->scsi_done will do nothing, because |
1376 |
++ * the block layer must have detected a timeout and as a result |
1377 |
++ * REQ_ATOM_COMPLETE has been set. |
1378 |
++ */ |
1379 |
++ virtscsi_poll_requests(vscsi); |
1380 |
++ |
1381 |
+ out: |
1382 |
+ mempool_free(cmd, virtscsi_cmd_pool); |
1383 |
+ return ret; |
1384 |
+diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c |
1385 |
+index 357cef2a6f4c..7194bd138762 100644 |
1386 |
+--- a/drivers/staging/iio/adc/ad7291.c |
1387 |
++++ b/drivers/staging/iio/adc/ad7291.c |
1388 |
+@@ -465,7 +465,7 @@ static int ad7291_probe(struct i2c_client *client, |
1389 |
+ struct ad7291_platform_data *pdata = client->dev.platform_data; |
1390 |
+ struct ad7291_chip_info *chip; |
1391 |
+ struct iio_dev *indio_dev; |
1392 |
+- int ret = 0; |
1393 |
++ int ret; |
1394 |
+ |
1395 |
+ indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); |
1396 |
+ if (!indio_dev) |
1397 |
+@@ -475,7 +475,7 @@ static int ad7291_probe(struct i2c_client *client, |
1398 |
+ if (pdata && pdata->use_external_ref) { |
1399 |
+ chip->reg = devm_regulator_get(&client->dev, "vref"); |
1400 |
+ if (IS_ERR(chip->reg)) |
1401 |
+- return ret; |
1402 |
++ return PTR_ERR(chip->reg); |
1403 |
+ |
1404 |
+ ret = regulator_enable(chip->reg); |
1405 |
+ if (ret) |
1406 |
+diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c |
1407 |
+index e36d1f5ca191..28ac3f3b7ec3 100644 |
1408 |
+--- a/drivers/tty/n_tty.c |
1409 |
++++ b/drivers/tty/n_tty.c |
1410 |
+@@ -1214,15 +1214,16 @@ static void n_tty_receive_parity_error(struct tty_struct *tty, unsigned char c) |
1411 |
+ { |
1412 |
+ struct n_tty_data *ldata = tty->disc_data; |
1413 |
+ |
1414 |
+- if (I_IGNPAR(tty)) |
1415 |
+- return; |
1416 |
+- if (I_PARMRK(tty)) { |
1417 |
+- put_tty_queue('\377', ldata); |
1418 |
+- put_tty_queue('\0', ldata); |
1419 |
+- put_tty_queue(c, ldata); |
1420 |
+- } else if (I_INPCK(tty)) |
1421 |
+- put_tty_queue('\0', ldata); |
1422 |
+- else |
1423 |
++ if (I_INPCK(tty)) { |
1424 |
++ if (I_IGNPAR(tty)) |
1425 |
++ return; |
1426 |
++ if (I_PARMRK(tty)) { |
1427 |
++ put_tty_queue('\377', ldata); |
1428 |
++ put_tty_queue('\0', ldata); |
1429 |
++ put_tty_queue(c, ldata); |
1430 |
++ } else |
1431 |
++ put_tty_queue('\0', ldata); |
1432 |
++ } else |
1433 |
+ put_tty_queue(c, ldata); |
1434 |
+ if (waitqueue_active(&tty->read_wait)) |
1435 |
+ wake_up_interruptible(&tty->read_wait); |
1436 |
+diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c |
1437 |
+index 29a7f632b354..612dfc720738 100644 |
1438 |
+--- a/drivers/tty/serial/8250/8250_core.c |
1439 |
++++ b/drivers/tty/serial/8250/8250_core.c |
1440 |
+@@ -2356,7 +2356,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, |
1441 |
+ port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; |
1442 |
+ if (termios->c_iflag & INPCK) |
1443 |
+ port->read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
1444 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1445 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1446 |
+ port->read_status_mask |= UART_LSR_BI; |
1447 |
+ |
1448 |
+ /* |
1449 |
+diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c |
1450 |
+index 501667e3e3f5..323376668b72 100644 |
1451 |
+--- a/drivers/tty/serial/altera_uart.c |
1452 |
++++ b/drivers/tty/serial/altera_uart.c |
1453 |
+@@ -185,6 +185,12 @@ static void altera_uart_set_termios(struct uart_port *port, |
1454 |
+ uart_update_timeout(port, termios->c_cflag, baud); |
1455 |
+ altera_uart_writel(port, baudclk, ALTERA_UART_DIVISOR_REG); |
1456 |
+ spin_unlock_irqrestore(&port->lock, flags); |
1457 |
++ |
1458 |
++ /* |
1459 |
++ * FIXME: port->read_status_mask and port->ignore_status_mask |
1460 |
++ * need to be initialized based on termios settings for |
1461 |
++ * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT |
1462 |
++ */ |
1463 |
+ } |
1464 |
+ |
1465 |
+ static void altera_uart_rx_chars(struct altera_uart *pp) |
1466 |
+diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c |
1467 |
+index 01c9e72433e1..971af1e22d0f 100644 |
1468 |
+--- a/drivers/tty/serial/amba-pl010.c |
1469 |
++++ b/drivers/tty/serial/amba-pl010.c |
1470 |
+@@ -420,7 +420,7 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios, |
1471 |
+ uap->port.read_status_mask = UART01x_RSR_OE; |
1472 |
+ if (termios->c_iflag & INPCK) |
1473 |
+ uap->port.read_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE; |
1474 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1475 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1476 |
+ uap->port.read_status_mask |= UART01x_RSR_BE; |
1477 |
+ |
1478 |
+ /* |
1479 |
+diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c |
1480 |
+index d58783d364e3..b569011ac713 100644 |
1481 |
+--- a/drivers/tty/serial/amba-pl011.c |
1482 |
++++ b/drivers/tty/serial/amba-pl011.c |
1483 |
+@@ -1744,7 +1744,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, |
1484 |
+ port->read_status_mask = UART011_DR_OE | 255; |
1485 |
+ if (termios->c_iflag & INPCK) |
1486 |
+ port->read_status_mask |= UART011_DR_FE | UART011_DR_PE; |
1487 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1488 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1489 |
+ port->read_status_mask |= UART011_DR_BE; |
1490 |
+ |
1491 |
+ /* |
1492 |
+diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c |
1493 |
+index a49f10d269b2..ce352b81e230 100644 |
1494 |
+--- a/drivers/tty/serial/atmel_serial.c |
1495 |
++++ b/drivers/tty/serial/atmel_serial.c |
1496 |
+@@ -1811,7 +1811,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, |
1497 |
+ port->read_status_mask = ATMEL_US_OVRE; |
1498 |
+ if (termios->c_iflag & INPCK) |
1499 |
+ port->read_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE); |
1500 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1501 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1502 |
+ port->read_status_mask |= ATMEL_US_RXBRK; |
1503 |
+ |
1504 |
+ if (atmel_use_pdc_rx(port)) |
1505 |
+diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c |
1506 |
+index 78e82b017b92..e0b87d507670 100644 |
1507 |
+--- a/drivers/tty/serial/bcm63xx_uart.c |
1508 |
++++ b/drivers/tty/serial/bcm63xx_uart.c |
1509 |
+@@ -565,7 +565,7 @@ static void bcm_uart_set_termios(struct uart_port *port, |
1510 |
+ port->read_status_mask |= UART_FIFO_FRAMEERR_MASK; |
1511 |
+ port->read_status_mask |= UART_FIFO_PARERR_MASK; |
1512 |
+ } |
1513 |
+- if (new->c_iflag & (BRKINT)) |
1514 |
++ if (new->c_iflag & (IGNBRK | BRKINT)) |
1515 |
+ port->read_status_mask |= UART_FIFO_BRKDET_MASK; |
1516 |
+ |
1517 |
+ port->ignore_status_mask = 0; |
1518 |
+diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c |
1519 |
+index 869ceba2ec57..ac86a20992e9 100644 |
1520 |
+--- a/drivers/tty/serial/bfin_uart.c |
1521 |
++++ b/drivers/tty/serial/bfin_uart.c |
1522 |
+@@ -833,7 +833,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, |
1523 |
+ port->read_status_mask = OE; |
1524 |
+ if (termios->c_iflag & INPCK) |
1525 |
+ port->read_status_mask |= (FE | PE); |
1526 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1527 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1528 |
+ port->read_status_mask |= BI; |
1529 |
+ |
1530 |
+ /* |
1531 |
+diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c |
1532 |
+index 2f2b2e538a54..cdbbc788230a 100644 |
1533 |
+--- a/drivers/tty/serial/dz.c |
1534 |
++++ b/drivers/tty/serial/dz.c |
1535 |
+@@ -625,7 +625,7 @@ static void dz_set_termios(struct uart_port *uport, struct ktermios *termios, |
1536 |
+ dport->port.read_status_mask = DZ_OERR; |
1537 |
+ if (termios->c_iflag & INPCK) |
1538 |
+ dport->port.read_status_mask |= DZ_FERR | DZ_PERR; |
1539 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1540 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1541 |
+ dport->port.read_status_mask |= DZ_BREAK; |
1542 |
+ |
1543 |
+ /* characters to ignore */ |
1544 |
+diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c |
1545 |
+index 0eb5b5673ede..948f17b6b497 100644 |
1546 |
+--- a/drivers/tty/serial/efm32-uart.c |
1547 |
++++ b/drivers/tty/serial/efm32-uart.c |
1548 |
+@@ -407,7 +407,7 @@ static void efm32_uart_set_termios(struct uart_port *port, |
1549 |
+ if (new->c_iflag & INPCK) |
1550 |
+ port->read_status_mask |= |
1551 |
+ UARTn_RXDATAX_FERR | UARTn_RXDATAX_PERR; |
1552 |
+- if (new->c_iflag & (BRKINT | PARMRK)) |
1553 |
++ if (new->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1554 |
+ port->read_status_mask |= SW_UARTn_RXDATAX_BERR; |
1555 |
+ |
1556 |
+ port->ignore_status_mask = 0; |
1557 |
+diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c |
1558 |
+index 8978dc9a58b7..175f123f4f09 100644 |
1559 |
+--- a/drivers/tty/serial/fsl_lpuart.c |
1560 |
++++ b/drivers/tty/serial/fsl_lpuart.c |
1561 |
+@@ -496,7 +496,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, |
1562 |
+ sport->port.read_status_mask = 0; |
1563 |
+ if (termios->c_iflag & INPCK) |
1564 |
+ sport->port.read_status_mask |= (UARTSR1_FE | UARTSR1_PE); |
1565 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1566 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1567 |
+ sport->port.read_status_mask |= UARTSR1_FE; |
1568 |
+ |
1569 |
+ /* characters to ignore */ |
1570 |
+diff --git a/drivers/tty/serial/ip22zilog.c b/drivers/tty/serial/ip22zilog.c |
1571 |
+index 1d9420548e16..1efd4c36ba0c 100644 |
1572 |
+--- a/drivers/tty/serial/ip22zilog.c |
1573 |
++++ b/drivers/tty/serial/ip22zilog.c |
1574 |
+@@ -850,7 +850,7 @@ ip22zilog_convert_to_zs(struct uart_ip22zilog_port *up, unsigned int cflag, |
1575 |
+ up->port.read_status_mask = Rx_OVR; |
1576 |
+ if (iflag & INPCK) |
1577 |
+ up->port.read_status_mask |= CRC_ERR | PAR_ERR; |
1578 |
+- if (iflag & (BRKINT | PARMRK)) |
1579 |
++ if (iflag & (IGNBRK | BRKINT | PARMRK)) |
1580 |
+ up->port.read_status_mask |= BRK_ABRT; |
1581 |
+ |
1582 |
+ up->port.ignore_status_mask = 0; |
1583 |
+diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c |
1584 |
+index 9cd9b4eba9fc..68f2c53e0b54 100644 |
1585 |
+--- a/drivers/tty/serial/m32r_sio.c |
1586 |
++++ b/drivers/tty/serial/m32r_sio.c |
1587 |
+@@ -737,7 +737,7 @@ static void m32r_sio_set_termios(struct uart_port *port, |
1588 |
+ up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; |
1589 |
+ if (termios->c_iflag & INPCK) |
1590 |
+ up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
1591 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1592 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1593 |
+ up->port.read_status_mask |= UART_LSR_BI; |
1594 |
+ |
1595 |
+ /* |
1596 |
+diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c |
1597 |
+index 8d71e4047bb3..558af637cd0c 100644 |
1598 |
+--- a/drivers/tty/serial/max310x.c |
1599 |
++++ b/drivers/tty/serial/max310x.c |
1600 |
+@@ -842,7 +842,7 @@ static void max310x_set_termios(struct uart_port *port, |
1601 |
+ if (termios->c_iflag & INPCK) |
1602 |
+ port->read_status_mask |= MAX310X_LSR_RXPAR_BIT | |
1603 |
+ MAX310X_LSR_FRERR_BIT; |
1604 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1605 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1606 |
+ port->read_status_mask |= MAX310X_LSR_RXBRK_BIT; |
1607 |
+ |
1608 |
+ /* Set status ignore mask */ |
1609 |
+diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c |
1610 |
+index 0edfaf8cd269..a6f085717f94 100644 |
1611 |
+--- a/drivers/tty/serial/mcf.c |
1612 |
++++ b/drivers/tty/serial/mcf.c |
1613 |
+@@ -248,6 +248,12 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios, |
1614 |
+ mr1 |= MCFUART_MR1_PARITYNONE; |
1615 |
+ } |
1616 |
+ |
1617 |
++ /* |
1618 |
++ * FIXME: port->read_status_mask and port->ignore_status_mask |
1619 |
++ * need to be initialized based on termios settings for |
1620 |
++ * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT |
1621 |
++ */ |
1622 |
++ |
1623 |
+ if (termios->c_cflag & CSTOPB) |
1624 |
+ mr2 |= MCFUART_MR2_STOP2; |
1625 |
+ else |
1626 |
+diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c |
1627 |
+index 52c930fac210..445799dc9846 100644 |
1628 |
+--- a/drivers/tty/serial/mfd.c |
1629 |
++++ b/drivers/tty/serial/mfd.c |
1630 |
+@@ -977,7 +977,7 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios, |
1631 |
+ up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; |
1632 |
+ if (termios->c_iflag & INPCK) |
1633 |
+ up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
1634 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1635 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1636 |
+ up->port.read_status_mask |= UART_LSR_BI; |
1637 |
+ |
1638 |
+ /* Characters to ignore */ |
1639 |
+diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c |
1640 |
+index e30a3ca3cea3..759c6a6fa74a 100644 |
1641 |
+--- a/drivers/tty/serial/mpsc.c |
1642 |
++++ b/drivers/tty/serial/mpsc.c |
1643 |
+@@ -1458,7 +1458,7 @@ static void mpsc_set_termios(struct uart_port *port, struct ktermios *termios, |
1644 |
+ pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_PE |
1645 |
+ | SDMA_DESC_CMDSTAT_FR; |
1646 |
+ |
1647 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1648 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1649 |
+ pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_BR; |
1650 |
+ |
1651 |
+ /* Characters/events to ignore */ |
1652 |
+diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c |
1653 |
+index b5d779cd3c2b..c0f2b3e5452f 100644 |
1654 |
+--- a/drivers/tty/serial/msm_serial.c |
1655 |
++++ b/drivers/tty/serial/msm_serial.c |
1656 |
+@@ -570,7 +570,7 @@ static void msm_set_termios(struct uart_port *port, struct ktermios *termios, |
1657 |
+ port->read_status_mask = 0; |
1658 |
+ if (termios->c_iflag & INPCK) |
1659 |
+ port->read_status_mask |= UART_SR_PAR_FRAME_ERR; |
1660 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1661 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1662 |
+ port->read_status_mask |= UART_SR_RX_BREAK; |
1663 |
+ |
1664 |
+ uart_update_timeout(port, termios->c_cflag, baud); |
1665 |
+diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c |
1666 |
+index aa97fd845b4d..d98f1d4a9bd3 100644 |
1667 |
+--- a/drivers/tty/serial/mxs-auart.c |
1668 |
++++ b/drivers/tty/serial/mxs-auart.c |
1669 |
+@@ -604,7 +604,7 @@ static void mxs_auart_settermios(struct uart_port *u, |
1670 |
+ |
1671 |
+ if (termios->c_iflag & INPCK) |
1672 |
+ u->read_status_mask |= AUART_STAT_PERR; |
1673 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1674 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1675 |
+ u->read_status_mask |= AUART_STAT_BERR; |
1676 |
+ |
1677 |
+ /* |
1678 |
+diff --git a/drivers/tty/serial/netx-serial.c b/drivers/tty/serial/netx-serial.c |
1679 |
+index 0a4dd70d29eb..7a6745601d4e 100644 |
1680 |
+--- a/drivers/tty/serial/netx-serial.c |
1681 |
++++ b/drivers/tty/serial/netx-serial.c |
1682 |
+@@ -419,7 +419,7 @@ netx_set_termios(struct uart_port *port, struct ktermios *termios, |
1683 |
+ } |
1684 |
+ |
1685 |
+ port->read_status_mask = 0; |
1686 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1687 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1688 |
+ port->read_status_mask |= SR_BE; |
1689 |
+ if (termios->c_iflag & INPCK) |
1690 |
+ port->read_status_mask |= SR_PE | SR_FE; |
1691 |
+diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c |
1692 |
+index e9d420ff3931..8193635103ee 100644 |
1693 |
+--- a/drivers/tty/serial/pmac_zilog.c |
1694 |
++++ b/drivers/tty/serial/pmac_zilog.c |
1695 |
+@@ -1092,7 +1092,7 @@ static void pmz_convert_to_zs(struct uart_pmac_port *uap, unsigned int cflag, |
1696 |
+ uap->port.read_status_mask = Rx_OVR; |
1697 |
+ if (iflag & INPCK) |
1698 |
+ uap->port.read_status_mask |= CRC_ERR | PAR_ERR; |
1699 |
+- if (iflag & (BRKINT | PARMRK)) |
1700 |
++ if (iflag & (IGNBRK | BRKINT | PARMRK)) |
1701 |
+ uap->port.read_status_mask |= BRK_ABRT; |
1702 |
+ |
1703 |
+ uap->port.ignore_status_mask = 0; |
1704 |
+diff --git a/drivers/tty/serial/pnx8xxx_uart.c b/drivers/tty/serial/pnx8xxx_uart.c |
1705 |
+index de6c05c63683..2ba24a45c97f 100644 |
1706 |
+--- a/drivers/tty/serial/pnx8xxx_uart.c |
1707 |
++++ b/drivers/tty/serial/pnx8xxx_uart.c |
1708 |
+@@ -477,7 +477,7 @@ pnx8xxx_set_termios(struct uart_port *port, struct ktermios *termios, |
1709 |
+ sport->port.read_status_mask |= |
1710 |
+ FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) | |
1711 |
+ FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR); |
1712 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1713 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1714 |
+ sport->port.read_status_mask |= |
1715 |
+ ISTAT_TO_SM(PNX8XXX_UART_INT_BREAK); |
1716 |
+ |
1717 |
+diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c |
1718 |
+index f9f20f383760..fc3f308cd6c1 100644 |
1719 |
+--- a/drivers/tty/serial/pxa.c |
1720 |
++++ b/drivers/tty/serial/pxa.c |
1721 |
+@@ -492,7 +492,7 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios, |
1722 |
+ up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; |
1723 |
+ if (termios->c_iflag & INPCK) |
1724 |
+ up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
1725 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1726 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1727 |
+ up->port.read_status_mask |= UART_LSR_BI; |
1728 |
+ |
1729 |
+ /* |
1730 |
+diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c |
1731 |
+index a7cdec2962dd..771f361c47ea 100644 |
1732 |
+--- a/drivers/tty/serial/sb1250-duart.c |
1733 |
++++ b/drivers/tty/serial/sb1250-duart.c |
1734 |
+@@ -596,7 +596,7 @@ static void sbd_set_termios(struct uart_port *uport, struct ktermios *termios, |
1735 |
+ if (termios->c_iflag & INPCK) |
1736 |
+ uport->read_status_mask |= M_DUART_FRM_ERR | |
1737 |
+ M_DUART_PARITY_ERR; |
1738 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1739 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1740 |
+ uport->read_status_mask |= M_DUART_RCVD_BRK; |
1741 |
+ |
1742 |
+ uport->ignore_status_mask = 0; |
1743 |
+diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c |
1744 |
+index a447f71538ef..75ea83278ba4 100644 |
1745 |
+--- a/drivers/tty/serial/sccnxp.c |
1746 |
++++ b/drivers/tty/serial/sccnxp.c |
1747 |
+@@ -667,7 +667,7 @@ static void sccnxp_set_termios(struct uart_port *port, |
1748 |
+ port->read_status_mask = SR_OVR; |
1749 |
+ if (termios->c_iflag & INPCK) |
1750 |
+ port->read_status_mask |= SR_PE | SR_FE; |
1751 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1752 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1753 |
+ port->read_status_mask |= SR_BRK; |
1754 |
+ |
1755 |
+ /* Set status ignore mask */ |
1756 |
+diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c |
1757 |
+index e1caa99e3d3b..5c79bdab985d 100644 |
1758 |
+--- a/drivers/tty/serial/serial_ks8695.c |
1759 |
++++ b/drivers/tty/serial/serial_ks8695.c |
1760 |
+@@ -437,7 +437,7 @@ static void ks8695uart_set_termios(struct uart_port *port, struct ktermios *term |
1761 |
+ port->read_status_mask = URLS_URROE; |
1762 |
+ if (termios->c_iflag & INPCK) |
1763 |
+ port->read_status_mask |= (URLS_URFE | URLS_URPE); |
1764 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1765 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1766 |
+ port->read_status_mask |= URLS_URBI; |
1767 |
+ |
1768 |
+ /* |
1769 |
+diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c |
1770 |
+index 90a080b1f9ee..cbf501da5df3 100644 |
1771 |
+--- a/drivers/tty/serial/serial_txx9.c |
1772 |
++++ b/drivers/tty/serial/serial_txx9.c |
1773 |
+@@ -702,7 +702,7 @@ serial_txx9_set_termios(struct uart_port *port, struct ktermios *termios, |
1774 |
+ TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS; |
1775 |
+ if (termios->c_iflag & INPCK) |
1776 |
+ up->port.read_status_mask |= TXX9_SIDISR_UFER | TXX9_SIDISR_UPER; |
1777 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1778 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1779 |
+ up->port.read_status_mask |= TXX9_SIDISR_UBRK; |
1780 |
+ |
1781 |
+ /* |
1782 |
+diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c |
1783 |
+index b7bfe24d4ebc..020fe220d0e9 100644 |
1784 |
+--- a/drivers/tty/serial/sirfsoc_uart.c |
1785 |
++++ b/drivers/tty/serial/sirfsoc_uart.c |
1786 |
+@@ -908,7 +908,7 @@ static void sirfsoc_uart_set_termios(struct uart_port *port, |
1787 |
+ if (termios->c_iflag & INPCK) |
1788 |
+ port->read_status_mask |= uint_en->sirfsoc_frm_err_en; |
1789 |
+ } |
1790 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1791 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1792 |
+ port->read_status_mask |= uint_en->sirfsoc_rxd_brk_en; |
1793 |
+ if (sirfport->uart_reg->uart_type == SIRF_REAL_UART) { |
1794 |
+ if (termios->c_iflag & IGNPAR) |
1795 |
+diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c |
1796 |
+index 21e6e84c0df8..0ee31755cb5a 100644 |
1797 |
+--- a/drivers/tty/serial/st-asc.c |
1798 |
++++ b/drivers/tty/serial/st-asc.c |
1799 |
+@@ -547,7 +547,7 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, |
1800 |
+ ascport->port.read_status_mask = ASC_RXBUF_DUMMY_OE; |
1801 |
+ if (termios->c_iflag & INPCK) |
1802 |
+ ascport->port.read_status_mask |= ASC_RXBUF_FE | ASC_RXBUF_PE; |
1803 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1804 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1805 |
+ ascport->port.read_status_mask |= ASC_RXBUF_DUMMY_BE; |
1806 |
+ |
1807 |
+ /* |
1808 |
+diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c |
1809 |
+index 5faa8e905e98..80a58eca785b 100644 |
1810 |
+--- a/drivers/tty/serial/sunsab.c |
1811 |
++++ b/drivers/tty/serial/sunsab.c |
1812 |
+@@ -719,7 +719,7 @@ static void sunsab_convert_to_sab(struct uart_sunsab_port *up, unsigned int cfla |
1813 |
+ if (iflag & INPCK) |
1814 |
+ up->port.read_status_mask |= (SAB82532_ISR0_PERR | |
1815 |
+ SAB82532_ISR0_FERR); |
1816 |
+- if (iflag & (BRKINT | PARMRK)) |
1817 |
++ if (iflag & (IGNBRK | BRKINT | PARMRK)) |
1818 |
+ up->port.read_status_mask |= (SAB82532_ISR1_BRK << 8); |
1819 |
+ |
1820 |
+ /* |
1821 |
+diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c |
1822 |
+index 9a0f24f83720..5326ae195e5f 100644 |
1823 |
+--- a/drivers/tty/serial/sunsu.c |
1824 |
++++ b/drivers/tty/serial/sunsu.c |
1825 |
+@@ -834,7 +834,7 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag, |
1826 |
+ up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; |
1827 |
+ if (iflag & INPCK) |
1828 |
+ up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
1829 |
+- if (iflag & (BRKINT | PARMRK)) |
1830 |
++ if (iflag & (IGNBRK | BRKINT | PARMRK)) |
1831 |
+ up->port.read_status_mask |= UART_LSR_BI; |
1832 |
+ |
1833 |
+ /* |
1834 |
+diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c |
1835 |
+index a2c40ed287d2..a85db8b87156 100644 |
1836 |
+--- a/drivers/tty/serial/sunzilog.c |
1837 |
++++ b/drivers/tty/serial/sunzilog.c |
1838 |
+@@ -915,7 +915,7 @@ sunzilog_convert_to_zs(struct uart_sunzilog_port *up, unsigned int cflag, |
1839 |
+ up->port.read_status_mask = Rx_OVR; |
1840 |
+ if (iflag & INPCK) |
1841 |
+ up->port.read_status_mask |= CRC_ERR | PAR_ERR; |
1842 |
+- if (iflag & (BRKINT | PARMRK)) |
1843 |
++ if (iflag & (IGNBRK | BRKINT | PARMRK)) |
1844 |
+ up->port.read_status_mask |= BRK_ABRT; |
1845 |
+ |
1846 |
+ up->port.ignore_status_mask = 0; |
1847 |
+diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c |
1848 |
+index d569ca58bab6..1c52074c38df 100644 |
1849 |
+--- a/drivers/tty/serial/ucc_uart.c |
1850 |
++++ b/drivers/tty/serial/ucc_uart.c |
1851 |
+@@ -936,7 +936,7 @@ static void qe_uart_set_termios(struct uart_port *port, |
1852 |
+ port->read_status_mask = BD_SC_EMPTY | BD_SC_OV; |
1853 |
+ if (termios->c_iflag & INPCK) |
1854 |
+ port->read_status_mask |= BD_SC_FR | BD_SC_PR; |
1855 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1856 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1857 |
+ port->read_status_mask |= BD_SC_BR; |
1858 |
+ |
1859 |
+ /* |
1860 |
+diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c |
1861 |
+index a63c14bc9a24..db0c8a4ab03e 100644 |
1862 |
+--- a/drivers/tty/serial/vr41xx_siu.c |
1863 |
++++ b/drivers/tty/serial/vr41xx_siu.c |
1864 |
+@@ -559,7 +559,7 @@ static void siu_set_termios(struct uart_port *port, struct ktermios *new, |
1865 |
+ port->read_status_mask = UART_LSR_THRE | UART_LSR_OE | UART_LSR_DR; |
1866 |
+ if (c_iflag & INPCK) |
1867 |
+ port->read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
1868 |
+- if (c_iflag & (BRKINT | PARMRK)) |
1869 |
++ if (c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1870 |
+ port->read_status_mask |= UART_LSR_BI; |
1871 |
+ |
1872 |
+ port->ignore_status_mask = 0; |
1873 |
+diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c |
1874 |
+index 6a169877109b..2b65bb7ffb8a 100644 |
1875 |
+--- a/drivers/tty/serial/zs.c |
1876 |
++++ b/drivers/tty/serial/zs.c |
1877 |
+@@ -923,7 +923,7 @@ static void zs_set_termios(struct uart_port *uport, struct ktermios *termios, |
1878 |
+ uport->read_status_mask = Rx_OVR; |
1879 |
+ if (termios->c_iflag & INPCK) |
1880 |
+ uport->read_status_mask |= FRM_ERR | PAR_ERR; |
1881 |
+- if (termios->c_iflag & (BRKINT | PARMRK)) |
1882 |
++ if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) |
1883 |
+ uport->read_status_mask |= Rx_BRK; |
1884 |
+ |
1885 |
+ uport->ignore_status_mask = 0; |
1886 |
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c |
1887 |
+index 4ab2cb62dfce..3314516018c6 100644 |
1888 |
+--- a/drivers/usb/chipidea/udc.c |
1889 |
++++ b/drivers/usb/chipidea/udc.c |
1890 |
+@@ -1326,6 +1326,7 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) |
1891 |
+ struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); |
1892 |
+ struct ci_hw_req *hwreq = container_of(req, struct ci_hw_req, req); |
1893 |
+ unsigned long flags; |
1894 |
++ struct td_node *node, *tmpnode; |
1895 |
+ |
1896 |
+ if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY || |
1897 |
+ hwep->ep.desc == NULL || list_empty(&hwreq->queue) || |
1898 |
+@@ -1336,6 +1337,12 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) |
1899 |
+ |
1900 |
+ hw_ep_flush(hwep->ci, hwep->num, hwep->dir); |
1901 |
+ |
1902 |
++ list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) { |
1903 |
++ dma_pool_free(hwep->td_pool, node->ptr, node->dma); |
1904 |
++ list_del(&node->td); |
1905 |
++ kfree(node); |
1906 |
++ } |
1907 |
++ |
1908 |
+ /* pop request */ |
1909 |
+ list_del_init(&hwreq->queue); |
1910 |
+ |
1911 |
+diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c |
1912 |
+index 2b4334394076..5bcf7d001259 100644 |
1913 |
+--- a/drivers/usb/gadget/f_fs.c |
1914 |
++++ b/drivers/usb/gadget/f_fs.c |
1915 |
+@@ -1227,11 +1227,13 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) |
1916 |
+ ffs->ep0req->context = ffs; |
1917 |
+ |
1918 |
+ lang = ffs->stringtabs; |
1919 |
+- for (lang = ffs->stringtabs; *lang; ++lang) { |
1920 |
+- struct usb_string *str = (*lang)->strings; |
1921 |
+- int id = first_id; |
1922 |
+- for (; str->s; ++id, ++str) |
1923 |
+- str->id = id; |
1924 |
++ if (lang) { |
1925 |
++ for (; *lang; ++lang) { |
1926 |
++ struct usb_string *str = (*lang)->strings; |
1927 |
++ int id = first_id; |
1928 |
++ for (; str->s; ++id, ++str) |
1929 |
++ str->id = id; |
1930 |
++ } |
1931 |
+ } |
1932 |
+ |
1933 |
+ ffs->gadget = cdev->gadget; |
1934 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
1935 |
+index dff9b5ead3b3..65091d9aa997 100644 |
1936 |
+--- a/drivers/usb/host/xhci-ring.c |
1937 |
++++ b/drivers/usb/host/xhci-ring.c |
1938 |
+@@ -1578,8 +1578,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, |
1939 |
+ xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code); |
1940 |
+ break; |
1941 |
+ case TRB_RESET_DEV: |
1942 |
+- WARN_ON(slot_id != TRB_TO_SLOT_ID( |
1943 |
+- le32_to_cpu(cmd_trb->generic.field[3]))); |
1944 |
++ /* SLOT_ID field in reset device cmd completion event TRB is 0. |
1945 |
++ * Use the SLOT_ID from the command TRB instead (xhci 4.6.11) |
1946 |
++ */ |
1947 |
++ slot_id = TRB_TO_SLOT_ID( |
1948 |
++ le32_to_cpu(cmd_trb->generic.field[3])); |
1949 |
+ xhci_handle_cmd_reset_dev(xhci, slot_id, event); |
1950 |
+ break; |
1951 |
+ case TRB_NEC_GET_FW: |
1952 |
+@@ -3663,7 +3666,7 @@ static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci, |
1953 |
+ return 0; |
1954 |
+ |
1955 |
+ max_burst = urb->ep->ss_ep_comp.bMaxBurst; |
1956 |
+- return roundup(total_packet_count, max_burst + 1) - 1; |
1957 |
++ return DIV_ROUND_UP(total_packet_count, max_burst + 1) - 1; |
1958 |
+ } |
1959 |
+ |
1960 |
+ /* |
1961 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
1962 |
+index cca289667cf6..ab831048e8a4 100644 |
1963 |
+--- a/drivers/usb/host/xhci.c |
1964 |
++++ b/drivers/usb/host/xhci.c |
1965 |
+@@ -928,7 +928,7 @@ int xhci_suspend(struct xhci_hcd *xhci) |
1966 |
+ */ |
1967 |
+ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
1968 |
+ { |
1969 |
+- u32 command, temp = 0; |
1970 |
++ u32 command, temp = 0, status; |
1971 |
+ struct usb_hcd *hcd = xhci_to_hcd(xhci); |
1972 |
+ struct usb_hcd *secondary_hcd; |
1973 |
+ int retval = 0; |
1974 |
+@@ -1046,8 +1046,12 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
1975 |
+ |
1976 |
+ done: |
1977 |
+ if (retval == 0) { |
1978 |
+- usb_hcd_resume_root_hub(hcd); |
1979 |
+- usb_hcd_resume_root_hub(xhci->shared_hcd); |
1980 |
++ /* Resume root hubs only when have pending events. */ |
1981 |
++ status = readl(&xhci->op_regs->status); |
1982 |
++ if (status & STS_EINT) { |
1983 |
++ usb_hcd_resume_root_hub(hcd); |
1984 |
++ usb_hcd_resume_root_hub(xhci->shared_hcd); |
1985 |
++ } |
1986 |
+ } |
1987 |
+ |
1988 |
+ /* |
1989 |
+diff --git a/drivers/usb/musb/musb_am335x.c b/drivers/usb/musb/musb_am335x.c |
1990 |
+index d2353781bd2d..1e58ed2361cc 100644 |
1991 |
+--- a/drivers/usb/musb/musb_am335x.c |
1992 |
++++ b/drivers/usb/musb/musb_am335x.c |
1993 |
+@@ -19,21 +19,6 @@ err: |
1994 |
+ return ret; |
1995 |
+ } |
1996 |
+ |
1997 |
+-static int of_remove_populated_child(struct device *dev, void *d) |
1998 |
+-{ |
1999 |
+- struct platform_device *pdev = to_platform_device(dev); |
2000 |
+- |
2001 |
+- of_device_unregister(pdev); |
2002 |
+- return 0; |
2003 |
+-} |
2004 |
+- |
2005 |
+-static int am335x_child_remove(struct platform_device *pdev) |
2006 |
+-{ |
2007 |
+- device_for_each_child(&pdev->dev, NULL, of_remove_populated_child); |
2008 |
+- pm_runtime_disable(&pdev->dev); |
2009 |
+- return 0; |
2010 |
+-} |
2011 |
+- |
2012 |
+ static const struct of_device_id am335x_child_of_match[] = { |
2013 |
+ { .compatible = "ti,am33xx-usb" }, |
2014 |
+ { }, |
2015 |
+@@ -42,13 +27,17 @@ MODULE_DEVICE_TABLE(of, am335x_child_of_match); |
2016 |
+ |
2017 |
+ static struct platform_driver am335x_child_driver = { |
2018 |
+ .probe = am335x_child_probe, |
2019 |
+- .remove = am335x_child_remove, |
2020 |
+ .driver = { |
2021 |
+ .name = "am335x-usb-childs", |
2022 |
+ .of_match_table = am335x_child_of_match, |
2023 |
+ }, |
2024 |
+ }; |
2025 |
+ |
2026 |
+-module_platform_driver(am335x_child_driver); |
2027 |
++static int __init am335x_child_init(void) |
2028 |
++{ |
2029 |
++ return platform_driver_register(&am335x_child_driver); |
2030 |
++} |
2031 |
++module_init(am335x_child_init); |
2032 |
++ |
2033 |
+ MODULE_DESCRIPTION("AM33xx child devices"); |
2034 |
+ MODULE_LICENSE("GPL v2"); |
2035 |
+diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c |
2036 |
+index f88929609bac..c2d5afc57e22 100644 |
2037 |
+--- a/drivers/usb/musb/musb_cppi41.c |
2038 |
++++ b/drivers/usb/musb/musb_cppi41.c |
2039 |
+@@ -266,7 +266,7 @@ static void cppi41_dma_callback(void *private_data) |
2040 |
+ } |
2041 |
+ list_add_tail(&cppi41_channel->tx_check, |
2042 |
+ &controller->early_tx_list); |
2043 |
+- if (!hrtimer_active(&controller->early_tx)) { |
2044 |
++ if (!hrtimer_is_queued(&controller->early_tx)) { |
2045 |
+ hrtimer_start_range_ns(&controller->early_tx, |
2046 |
+ ktime_set(0, 140 * NSEC_PER_USEC), |
2047 |
+ 40 * NSEC_PER_USEC, |
2048 |
+diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c |
2049 |
+index c2e45e632723..f202e5088461 100644 |
2050 |
+--- a/drivers/usb/musb/ux500.c |
2051 |
++++ b/drivers/usb/musb/ux500.c |
2052 |
+@@ -274,7 +274,6 @@ static int ux500_probe(struct platform_device *pdev) |
2053 |
+ musb->dev.parent = &pdev->dev; |
2054 |
+ musb->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
2055 |
+ musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask; |
2056 |
+- musb->dev.of_node = pdev->dev.of_node; |
2057 |
+ |
2058 |
+ glue->dev = &pdev->dev; |
2059 |
+ glue->musb = musb; |
2060 |
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c |
2061 |
+index edf3b124583c..115662c16dcc 100644 |
2062 |
+--- a/drivers/usb/serial/ftdi_sio.c |
2063 |
++++ b/drivers/usb/serial/ftdi_sio.c |
2064 |
+@@ -1566,14 +1566,17 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port) |
2065 |
+ struct usb_device *udev = serial->dev; |
2066 |
+ |
2067 |
+ struct usb_interface *interface = serial->interface; |
2068 |
+- struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc; |
2069 |
++ struct usb_endpoint_descriptor *ep_desc; |
2070 |
+ |
2071 |
+ unsigned num_endpoints; |
2072 |
+- int i; |
2073 |
++ unsigned i; |
2074 |
+ |
2075 |
+ num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; |
2076 |
+ dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); |
2077 |
+ |
2078 |
++ if (!num_endpoints) |
2079 |
++ return; |
2080 |
++ |
2081 |
+ /* NOTE: some customers have programmed FT232R/FT245R devices |
2082 |
+ * with an endpoint size of 0 - not good. In this case, we |
2083 |
+ * want to override the endpoint descriptor setting and use a |
2084 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
2085 |
+index 70ede84f4f6b..e25e8ca09fe2 100644 |
2086 |
+--- a/drivers/usb/serial/option.c |
2087 |
++++ b/drivers/usb/serial/option.c |
2088 |
+@@ -352,6 +352,9 @@ static void option_instat_callback(struct urb *urb); |
2089 |
+ /* Zoom */ |
2090 |
+ #define ZOOM_PRODUCT_4597 0x9607 |
2091 |
+ |
2092 |
++/* SpeedUp SU9800 usb 3g modem */ |
2093 |
++#define SPEEDUP_PRODUCT_SU9800 0x9800 |
2094 |
++ |
2095 |
+ /* Haier products */ |
2096 |
+ #define HAIER_VENDOR_ID 0x201e |
2097 |
+ #define HAIER_PRODUCT_CE100 0x2009 |
2098 |
+@@ -372,8 +375,12 @@ static void option_instat_callback(struct urb *urb); |
2099 |
+ /* Olivetti products */ |
2100 |
+ #define OLIVETTI_VENDOR_ID 0x0b3c |
2101 |
+ #define OLIVETTI_PRODUCT_OLICARD100 0xc000 |
2102 |
++#define OLIVETTI_PRODUCT_OLICARD120 0xc001 |
2103 |
++#define OLIVETTI_PRODUCT_OLICARD140 0xc002 |
2104 |
+ #define OLIVETTI_PRODUCT_OLICARD145 0xc003 |
2105 |
++#define OLIVETTI_PRODUCT_OLICARD155 0xc004 |
2106 |
+ #define OLIVETTI_PRODUCT_OLICARD200 0xc005 |
2107 |
++#define OLIVETTI_PRODUCT_OLICARD160 0xc00a |
2108 |
+ #define OLIVETTI_PRODUCT_OLICARD500 0xc00b |
2109 |
+ |
2110 |
+ /* Celot products */ |
2111 |
+@@ -1577,6 +1584,7 @@ static const struct usb_device_id option_ids[] = { |
2112 |
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
2113 |
+ .driver_info = (kernel_ulong_t)&four_g_w14_blacklist |
2114 |
+ }, |
2115 |
++ { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, |
2116 |
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, |
2117 |
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, |
2118 |
+ { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, |
2119 |
+@@ -1611,15 +1619,21 @@ static const struct usb_device_id option_ids[] = { |
2120 |
+ { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, |
2121 |
+ { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ |
2122 |
+ { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, |
2123 |
+- |
2124 |
+- { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, |
2125 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), |
2126 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
2127 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120), |
2128 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
2129 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD140), |
2130 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
2131 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, |
2132 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD155), |
2133 |
++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, |
2134 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), |
2135 |
+- .driver_info = (kernel_ulong_t)&net_intf6_blacklist |
2136 |
+- }, |
2137 |
++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, |
2138 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD160), |
2139 |
++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, |
2140 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500), |
2141 |
+- .driver_info = (kernel_ulong_t)&net_intf4_blacklist |
2142 |
+- }, |
2143 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
2144 |
+ { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ |
2145 |
+ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ |
2146 |
+ { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, |
2147 |
+diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c |
2148 |
+index 6db9ebd042a3..88fa2e70a0bb 100644 |
2149 |
+--- a/drivers/video/fb-puv3.c |
2150 |
++++ b/drivers/video/fb-puv3.c |
2151 |
+@@ -18,8 +18,10 @@ |
2152 |
+ #include <linux/fb.h> |
2153 |
+ #include <linux/init.h> |
2154 |
+ #include <linux/console.h> |
2155 |
++#include <linux/mm.h> |
2156 |
+ |
2157 |
+ #include <asm/sizes.h> |
2158 |
++#include <asm/pgtable.h> |
2159 |
+ #include <mach/hardware.h> |
2160 |
+ |
2161 |
+ /* Platform_data reserved for unifb registers. */ |
2162 |
+diff --git a/fs/aio.c b/fs/aio.c |
2163 |
+index 19e7d9530dbe..e609e15f36b9 100644 |
2164 |
+--- a/fs/aio.c |
2165 |
++++ b/fs/aio.c |
2166 |
+@@ -112,6 +112,11 @@ struct kioctx { |
2167 |
+ |
2168 |
+ struct work_struct free_work; |
2169 |
+ |
2170 |
++ /* |
2171 |
++ * signals when all in-flight requests are done |
2172 |
++ */ |
2173 |
++ struct completion *requests_done; |
2174 |
++ |
2175 |
+ struct { |
2176 |
+ /* |
2177 |
+ * This counts the number of available slots in the ringbuffer, |
2178 |
+@@ -508,6 +513,10 @@ static void free_ioctx_reqs(struct percpu_ref *ref) |
2179 |
+ { |
2180 |
+ struct kioctx *ctx = container_of(ref, struct kioctx, reqs); |
2181 |
+ |
2182 |
++ /* At this point we know that there are no any in-flight requests */ |
2183 |
++ if (ctx->requests_done) |
2184 |
++ complete(ctx->requests_done); |
2185 |
++ |
2186 |
+ INIT_WORK(&ctx->free_work, free_ioctx); |
2187 |
+ schedule_work(&ctx->free_work); |
2188 |
+ } |
2189 |
+@@ -718,7 +727,8 @@ err: |
2190 |
+ * when the processes owning a context have all exited to encourage |
2191 |
+ * the rapid destruction of the kioctx. |
2192 |
+ */ |
2193 |
+-static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx) |
2194 |
++static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx, |
2195 |
++ struct completion *requests_done) |
2196 |
+ { |
2197 |
+ if (!atomic_xchg(&ctx->dead, 1)) { |
2198 |
+ struct kioctx_table *table; |
2199 |
+@@ -747,7 +757,11 @@ static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx) |
2200 |
+ if (ctx->mmap_size) |
2201 |
+ vm_munmap(ctx->mmap_base, ctx->mmap_size); |
2202 |
+ |
2203 |
++ ctx->requests_done = requests_done; |
2204 |
+ percpu_ref_kill(&ctx->users); |
2205 |
++ } else { |
2206 |
++ if (requests_done) |
2207 |
++ complete(requests_done); |
2208 |
+ } |
2209 |
+ } |
2210 |
+ |
2211 |
+@@ -809,7 +823,7 @@ void exit_aio(struct mm_struct *mm) |
2212 |
+ */ |
2213 |
+ ctx->mmap_size = 0; |
2214 |
+ |
2215 |
+- kill_ioctx(mm, ctx); |
2216 |
++ kill_ioctx(mm, ctx, NULL); |
2217 |
+ } |
2218 |
+ } |
2219 |
+ |
2220 |
+@@ -1187,7 +1201,7 @@ SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) |
2221 |
+ if (!IS_ERR(ioctx)) { |
2222 |
+ ret = put_user(ioctx->user_id, ctxp); |
2223 |
+ if (ret) |
2224 |
+- kill_ioctx(current->mm, ioctx); |
2225 |
++ kill_ioctx(current->mm, ioctx, NULL); |
2226 |
+ percpu_ref_put(&ioctx->users); |
2227 |
+ } |
2228 |
+ |
2229 |
+@@ -1205,8 +1219,22 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) |
2230 |
+ { |
2231 |
+ struct kioctx *ioctx = lookup_ioctx(ctx); |
2232 |
+ if (likely(NULL != ioctx)) { |
2233 |
+- kill_ioctx(current->mm, ioctx); |
2234 |
++ struct completion requests_done = |
2235 |
++ COMPLETION_INITIALIZER_ONSTACK(requests_done); |
2236 |
++ |
2237 |
++ /* Pass requests_done to kill_ioctx() where it can be set |
2238 |
++ * in a thread-safe way. If we try to set it here then we have |
2239 |
++ * a race condition if two io_destroy() called simultaneously. |
2240 |
++ */ |
2241 |
++ kill_ioctx(current->mm, ioctx, &requests_done); |
2242 |
+ percpu_ref_put(&ioctx->users); |
2243 |
++ |
2244 |
++ /* Wait until all IO for the context are done. Otherwise kernel |
2245 |
++ * keep using user-space buffers even if user thinks the context |
2246 |
++ * is destroyed. |
2247 |
++ */ |
2248 |
++ wait_for_completion(&requests_done); |
2249 |
++ |
2250 |
+ return 0; |
2251 |
+ } |
2252 |
+ pr_debug("EINVAL: io_destroy: invalid context id\n"); |
2253 |
+diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c |
2254 |
+index 0227b45ef00a..15e9505aa35f 100644 |
2255 |
+--- a/fs/cifs/cifs_unicode.c |
2256 |
++++ b/fs/cifs/cifs_unicode.c |
2257 |
+@@ -290,7 +290,8 @@ int |
2258 |
+ cifsConvertToUTF16(__le16 *target, const char *source, int srclen, |
2259 |
+ const struct nls_table *cp, int mapChars) |
2260 |
+ { |
2261 |
+- int i, j, charlen; |
2262 |
++ int i, charlen; |
2263 |
++ int j = 0; |
2264 |
+ char src_char; |
2265 |
+ __le16 dst_char; |
2266 |
+ wchar_t tmp; |
2267 |
+@@ -298,12 +299,11 @@ cifsConvertToUTF16(__le16 *target, const char *source, int srclen, |
2268 |
+ if (!mapChars) |
2269 |
+ return cifs_strtoUTF16(target, source, PATH_MAX, cp); |
2270 |
+ |
2271 |
+- for (i = 0, j = 0; i < srclen; j++) { |
2272 |
++ for (i = 0; i < srclen; j++) { |
2273 |
+ src_char = source[i]; |
2274 |
+ charlen = 1; |
2275 |
+ switch (src_char) { |
2276 |
+ case 0: |
2277 |
+- put_unaligned(0, &target[j]); |
2278 |
+ goto ctoUTF16_out; |
2279 |
+ case ':': |
2280 |
+ dst_char = cpu_to_le16(UNI_COLON); |
2281 |
+@@ -350,6 +350,7 @@ cifsConvertToUTF16(__le16 *target, const char *source, int srclen, |
2282 |
+ } |
2283 |
+ |
2284 |
+ ctoUTF16_out: |
2285 |
++ put_unaligned(0, &target[j]); /* Null terminate target unicode string */ |
2286 |
+ return j; |
2287 |
+ } |
2288 |
+ |
2289 |
+diff --git a/fs/cifs/link.c b/fs/cifs/link.c |
2290 |
+index 264ece71bdb2..68559fd557fb 100644 |
2291 |
+--- a/fs/cifs/link.c |
2292 |
++++ b/fs/cifs/link.c |
2293 |
+@@ -374,7 +374,7 @@ cifs_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, |
2294 |
+ oparms.cifs_sb = cifs_sb; |
2295 |
+ oparms.desired_access = GENERIC_WRITE; |
2296 |
+ oparms.create_options = create_options; |
2297 |
+- oparms.disposition = FILE_OPEN; |
2298 |
++ oparms.disposition = FILE_CREATE; |
2299 |
+ oparms.path = path; |
2300 |
+ oparms.fid = &fid; |
2301 |
+ oparms.reconnect = false; |
2302 |
+diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c |
2303 |
+index 594009f5f523..e6574d7b6642 100644 |
2304 |
+--- a/fs/ext4/indirect.c |
2305 |
++++ b/fs/ext4/indirect.c |
2306 |
+@@ -389,7 +389,13 @@ static int ext4_alloc_branch(handle_t *handle, struct inode *inode, |
2307 |
+ return 0; |
2308 |
+ failed: |
2309 |
+ for (; i >= 0; i--) { |
2310 |
+- if (i != indirect_blks && branch[i].bh) |
2311 |
++ /* |
2312 |
++ * We want to ext4_forget() only freshly allocated indirect |
2313 |
++ * blocks. Buffer for new_blocks[i-1] is at branch[i].bh and |
2314 |
++ * buffer at branch[0].bh is indirect block / inode already |
2315 |
++ * existing before ext4_alloc_branch() was called. |
2316 |
++ */ |
2317 |
++ if (i > 0 && i != indirect_blks && branch[i].bh) |
2318 |
+ ext4_forget(handle, 1, inode, branch[i].bh, |
2319 |
+ branch[i].bh->b_blocknr); |
2320 |
+ ext4_free_blocks(handle, inode, NULL, new_blocks[i], |
2321 |
+@@ -1312,16 +1318,24 @@ static int free_hole_blocks(handle_t *handle, struct inode *inode, |
2322 |
+ blk = *i_data; |
2323 |
+ if (level > 0) { |
2324 |
+ ext4_lblk_t first2; |
2325 |
++ ext4_lblk_t count2; |
2326 |
++ |
2327 |
+ bh = sb_bread(inode->i_sb, le32_to_cpu(blk)); |
2328 |
+ if (!bh) { |
2329 |
+ EXT4_ERROR_INODE_BLOCK(inode, le32_to_cpu(blk), |
2330 |
+ "Read failure"); |
2331 |
+ return -EIO; |
2332 |
+ } |
2333 |
+- first2 = (first > offset) ? first - offset : 0; |
2334 |
++ if (first > offset) { |
2335 |
++ first2 = first - offset; |
2336 |
++ count2 = count; |
2337 |
++ } else { |
2338 |
++ first2 = 0; |
2339 |
++ count2 = count - (offset - first); |
2340 |
++ } |
2341 |
+ ret = free_hole_blocks(handle, inode, bh, |
2342 |
+ (__le32 *)bh->b_data, level - 1, |
2343 |
+- first2, count - offset, |
2344 |
++ first2, count2, |
2345 |
+ inode->i_sb->s_blocksize >> 2); |
2346 |
+ if (ret) { |
2347 |
+ brelse(bh); |
2348 |
+diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c |
2349 |
+index 9a914e892bb1..f23a6ca37504 100644 |
2350 |
+--- a/fs/nfsd/nfs4proc.c |
2351 |
++++ b/fs/nfsd/nfs4proc.c |
2352 |
+@@ -618,15 +618,6 @@ nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
2353 |
+ |
2354 |
+ switch (create->cr_type) { |
2355 |
+ case NF4LNK: |
2356 |
+- /* ugh! we have to null-terminate the linktext, or |
2357 |
+- * vfs_symlink() will choke. it is always safe to |
2358 |
+- * null-terminate by brute force, since at worst we |
2359 |
+- * will overwrite the first byte of the create namelen |
2360 |
+- * in the XDR buffer, which has already been extracted |
2361 |
+- * during XDR decode. |
2362 |
+- */ |
2363 |
+- create->cr_linkname[create->cr_linklen] = 0; |
2364 |
+- |
2365 |
+ status = nfsd_symlink(rqstp, &cstate->current_fh, |
2366 |
+ create->cr_name, create->cr_namelen, |
2367 |
+ create->cr_linkname, create->cr_linklen, |
2368 |
+diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c |
2369 |
+index bc11bf68ec7f..86573350350e 100644 |
2370 |
+--- a/fs/nfsd/nfs4xdr.c |
2371 |
++++ b/fs/nfsd/nfs4xdr.c |
2372 |
+@@ -602,7 +602,18 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create |
2373 |
+ READ_BUF(4); |
2374 |
+ READ32(create->cr_linklen); |
2375 |
+ READ_BUF(create->cr_linklen); |
2376 |
+- SAVEMEM(create->cr_linkname, create->cr_linklen); |
2377 |
++ /* |
2378 |
++ * The VFS will want a null-terminated string, and |
2379 |
++ * null-terminating in place isn't safe since this might |
2380 |
++ * end on a page boundary: |
2381 |
++ */ |
2382 |
++ create->cr_linkname = |
2383 |
++ kmalloc(create->cr_linklen + 1, GFP_KERNEL); |
2384 |
++ if (!create->cr_linkname) |
2385 |
++ return nfserr_jukebox; |
2386 |
++ memcpy(create->cr_linkname, p, create->cr_linklen); |
2387 |
++ create->cr_linkname[create->cr_linklen] = '\0'; |
2388 |
++ defer_free(argp, kfree, create->cr_linkname); |
2389 |
+ break; |
2390 |
+ case NF4BLK: |
2391 |
+ case NF4CHR: |
2392 |
+diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h |
2393 |
+index d6b01283f85c..29e9c7aa9c66 100644 |
2394 |
+--- a/include/uapi/linux/usb/functionfs.h |
2395 |
++++ b/include/uapi/linux/usb/functionfs.h |
2396 |
+@@ -27,6 +27,13 @@ struct usb_endpoint_descriptor_no_audio { |
2397 |
+ __u8 bInterval; |
2398 |
+ } __attribute__((packed)); |
2399 |
+ |
2400 |
++/* Legacy format, deprecated as of 3.14. */ |
2401 |
++struct usb_functionfs_descs_head { |
2402 |
++ __le32 magic; |
2403 |
++ __le32 length; |
2404 |
++ __le32 fs_count; |
2405 |
++ __le32 hs_count; |
2406 |
++} __attribute__((packed, deprecated)); |
2407 |
+ |
2408 |
+ /* |
2409 |
+ * All numbers must be in little endian order. |
2410 |
+diff --git a/kernel/auditsc.c b/kernel/auditsc.c |
2411 |
+index 37e621606807..619b58d3fcdf 100644 |
2412 |
+--- a/kernel/auditsc.c |
2413 |
++++ b/kernel/auditsc.c |
2414 |
+@@ -1991,7 +1991,7 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid, |
2415 |
+ if (!ab) |
2416 |
+ return; |
2417 |
+ audit_log_format(ab, "pid=%d uid=%u" |
2418 |
+- " old-auid=%u new-auid=%u old-ses=%u new-ses=%u" |
2419 |
++ " old-auid=%u auid=%u old-ses=%u ses=%u" |
2420 |
+ " res=%d", |
2421 |
+ current->pid, uid, |
2422 |
+ oldloginuid, loginuid, oldsessionid, sessionid, |
2423 |
+diff --git a/kernel/sysctl.c b/kernel/sysctl.c |
2424 |
+index aae21e842918..c1b26e176aa6 100644 |
2425 |
+--- a/kernel/sysctl.c |
2426 |
++++ b/kernel/sysctl.c |
2427 |
+@@ -139,7 +139,6 @@ static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; |
2428 |
+ /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ |
2429 |
+ static int maxolduid = 65535; |
2430 |
+ static int minolduid; |
2431 |
+-static int min_percpu_pagelist_fract = 8; |
2432 |
+ |
2433 |
+ static int ngroups_max = NGROUPS_MAX; |
2434 |
+ static const int cap_last_cap = CAP_LAST_CAP; |
2435 |
+@@ -1324,7 +1323,7 @@ static struct ctl_table vm_table[] = { |
2436 |
+ .maxlen = sizeof(percpu_pagelist_fraction), |
2437 |
+ .mode = 0644, |
2438 |
+ .proc_handler = percpu_pagelist_fraction_sysctl_handler, |
2439 |
+- .extra1 = &min_percpu_pagelist_fract, |
2440 |
++ .extra1 = &zero, |
2441 |
+ }, |
2442 |
+ #ifdef CONFIG_MMU |
2443 |
+ { |
2444 |
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
2445 |
+index f0831c22760c..fd21e601a891 100644 |
2446 |
+--- a/kernel/trace/trace.c |
2447 |
++++ b/kernel/trace/trace.c |
2448 |
+@@ -1355,7 +1355,6 @@ void tracing_start(void) |
2449 |
+ |
2450 |
+ arch_spin_unlock(&ftrace_max_lock); |
2451 |
+ |
2452 |
+- ftrace_start(); |
2453 |
+ out: |
2454 |
+ raw_spin_unlock_irqrestore(&global_trace.start_lock, flags); |
2455 |
+ } |
2456 |
+@@ -1402,7 +1401,6 @@ void tracing_stop(void) |
2457 |
+ struct ring_buffer *buffer; |
2458 |
+ unsigned long flags; |
2459 |
+ |
2460 |
+- ftrace_stop(); |
2461 |
+ raw_spin_lock_irqsave(&global_trace.start_lock, flags); |
2462 |
+ if (global_trace.stop_count++) |
2463 |
+ goto out; |
2464 |
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c |
2465 |
+index 06a9bc0a3120..30dd6265a141 100644 |
2466 |
+--- a/mm/hugetlb.c |
2467 |
++++ b/mm/hugetlb.c |
2468 |
+@@ -2338,6 +2338,31 @@ static void set_huge_ptep_writable(struct vm_area_struct *vma, |
2469 |
+ update_mmu_cache(vma, address, ptep); |
2470 |
+ } |
2471 |
+ |
2472 |
++static int is_hugetlb_entry_migration(pte_t pte) |
2473 |
++{ |
2474 |
++ swp_entry_t swp; |
2475 |
++ |
2476 |
++ if (huge_pte_none(pte) || pte_present(pte)) |
2477 |
++ return 0; |
2478 |
++ swp = pte_to_swp_entry(pte); |
2479 |
++ if (non_swap_entry(swp) && is_migration_entry(swp)) |
2480 |
++ return 1; |
2481 |
++ else |
2482 |
++ return 0; |
2483 |
++} |
2484 |
++ |
2485 |
++static int is_hugetlb_entry_hwpoisoned(pte_t pte) |
2486 |
++{ |
2487 |
++ swp_entry_t swp; |
2488 |
++ |
2489 |
++ if (huge_pte_none(pte) || pte_present(pte)) |
2490 |
++ return 0; |
2491 |
++ swp = pte_to_swp_entry(pte); |
2492 |
++ if (non_swap_entry(swp) && is_hwpoison_entry(swp)) |
2493 |
++ return 1; |
2494 |
++ else |
2495 |
++ return 0; |
2496 |
++} |
2497 |
+ |
2498 |
+ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, |
2499 |
+ struct vm_area_struct *vma) |
2500 |
+@@ -2377,10 +2402,26 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, |
2501 |
+ dst_ptl = huge_pte_lock(h, dst, dst_pte); |
2502 |
+ src_ptl = huge_pte_lockptr(h, src, src_pte); |
2503 |
+ spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); |
2504 |
+- if (!huge_pte_none(huge_ptep_get(src_pte))) { |
2505 |
++ entry = huge_ptep_get(src_pte); |
2506 |
++ if (huge_pte_none(entry)) { /* skip none entry */ |
2507 |
++ ; |
2508 |
++ } else if (unlikely(is_hugetlb_entry_migration(entry) || |
2509 |
++ is_hugetlb_entry_hwpoisoned(entry))) { |
2510 |
++ swp_entry_t swp_entry = pte_to_swp_entry(entry); |
2511 |
++ |
2512 |
++ if (is_write_migration_entry(swp_entry) && cow) { |
2513 |
++ /* |
2514 |
++ * COW mappings require pages in both |
2515 |
++ * parent and child to be set to read. |
2516 |
++ */ |
2517 |
++ make_migration_entry_read(&swp_entry); |
2518 |
++ entry = swp_entry_to_pte(swp_entry); |
2519 |
++ set_huge_pte_at(src, addr, src_pte, entry); |
2520 |
++ } |
2521 |
++ set_huge_pte_at(dst, addr, dst_pte, entry); |
2522 |
++ } else { |
2523 |
+ if (cow) |
2524 |
+ huge_ptep_set_wrprotect(src, addr, src_pte); |
2525 |
+- entry = huge_ptep_get(src_pte); |
2526 |
+ ptepage = pte_page(entry); |
2527 |
+ get_page(ptepage); |
2528 |
+ page_dup_rmap(ptepage); |
2529 |
+@@ -2396,32 +2437,6 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, |
2530 |
+ return ret; |
2531 |
+ } |
2532 |
+ |
2533 |
+-static int is_hugetlb_entry_migration(pte_t pte) |
2534 |
+-{ |
2535 |
+- swp_entry_t swp; |
2536 |
+- |
2537 |
+- if (huge_pte_none(pte) || pte_present(pte)) |
2538 |
+- return 0; |
2539 |
+- swp = pte_to_swp_entry(pte); |
2540 |
+- if (non_swap_entry(swp) && is_migration_entry(swp)) |
2541 |
+- return 1; |
2542 |
+- else |
2543 |
+- return 0; |
2544 |
+-} |
2545 |
+- |
2546 |
+-static int is_hugetlb_entry_hwpoisoned(pte_t pte) |
2547 |
+-{ |
2548 |
+- swp_entry_t swp; |
2549 |
+- |
2550 |
+- if (huge_pte_none(pte) || pte_present(pte)) |
2551 |
+- return 0; |
2552 |
+- swp = pte_to_swp_entry(pte); |
2553 |
+- if (non_swap_entry(swp) && is_hwpoison_entry(swp)) |
2554 |
+- return 1; |
2555 |
+- else |
2556 |
+- return 0; |
2557 |
+-} |
2558 |
+- |
2559 |
+ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, |
2560 |
+ unsigned long start, unsigned long end, |
2561 |
+ struct page *ref_page) |
2562 |
+diff --git a/mm/memory.c b/mm/memory.c |
2563 |
+index 49e930f9ed46..2121d8b8db56 100644 |
2564 |
+--- a/mm/memory.c |
2565 |
++++ b/mm/memory.c |
2566 |
+@@ -3756,9 +3756,6 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
2567 |
+ } |
2568 |
+ } |
2569 |
+ |
2570 |
+- /* THP should already have been handled */ |
2571 |
+- BUG_ON(pmd_numa(*pmd)); |
2572 |
+- |
2573 |
+ /* |
2574 |
+ * Use __pte_alloc instead of pte_alloc_map, because we can't |
2575 |
+ * run pte_offset_map on the pmd, if an huge pmd could |
2576 |
+diff --git a/mm/mempolicy.c b/mm/mempolicy.c |
2577 |
+index 56224d998c39..9c6288aea4f9 100644 |
2578 |
+--- a/mm/mempolicy.c |
2579 |
++++ b/mm/mempolicy.c |
2580 |
+@@ -653,19 +653,18 @@ static unsigned long change_prot_numa(struct vm_area_struct *vma, |
2581 |
+ * @nodes and @flags,) it's isolated and queued to the pagelist which is |
2582 |
+ * passed via @private.) |
2583 |
+ */ |
2584 |
+-static struct vm_area_struct * |
2585 |
++static int |
2586 |
+ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end, |
2587 |
+ const nodemask_t *nodes, unsigned long flags, void *private) |
2588 |
+ { |
2589 |
+- int err; |
2590 |
+- struct vm_area_struct *first, *vma, *prev; |
2591 |
+- |
2592 |
++ int err = 0; |
2593 |
++ struct vm_area_struct *vma, *prev; |
2594 |
+ |
2595 |
+- first = find_vma(mm, start); |
2596 |
+- if (!first) |
2597 |
+- return ERR_PTR(-EFAULT); |
2598 |
++ vma = find_vma(mm, start); |
2599 |
++ if (!vma) |
2600 |
++ return -EFAULT; |
2601 |
+ prev = NULL; |
2602 |
+- for (vma = first; vma && vma->vm_start < end; vma = vma->vm_next) { |
2603 |
++ for (; vma && vma->vm_start < end; vma = vma->vm_next) { |
2604 |
+ unsigned long endvma = vma->vm_end; |
2605 |
+ |
2606 |
+ if (endvma > end) |
2607 |
+@@ -675,9 +674,9 @@ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end, |
2608 |
+ |
2609 |
+ if (!(flags & MPOL_MF_DISCONTIG_OK)) { |
2610 |
+ if (!vma->vm_next && vma->vm_end < end) |
2611 |
+- return ERR_PTR(-EFAULT); |
2612 |
++ return -EFAULT; |
2613 |
+ if (prev && prev->vm_end < vma->vm_start) |
2614 |
+- return ERR_PTR(-EFAULT); |
2615 |
++ return -EFAULT; |
2616 |
+ } |
2617 |
+ |
2618 |
+ if (flags & MPOL_MF_LAZY) { |
2619 |
+@@ -691,15 +690,13 @@ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end, |
2620 |
+ |
2621 |
+ err = queue_pages_pgd_range(vma, start, endvma, nodes, |
2622 |
+ flags, private); |
2623 |
+- if (err) { |
2624 |
+- first = ERR_PTR(err); |
2625 |
++ if (err) |
2626 |
+ break; |
2627 |
+- } |
2628 |
+ } |
2629 |
+ next: |
2630 |
+ prev = vma; |
2631 |
+ } |
2632 |
+- return first; |
2633 |
++ return err; |
2634 |
+ } |
2635 |
+ |
2636 |
+ /* |
2637 |
+@@ -1184,16 +1181,17 @@ out: |
2638 |
+ |
2639 |
+ /* |
2640 |
+ * Allocate a new page for page migration based on vma policy. |
2641 |
+- * Start assuming that page is mapped by vma pointed to by @private. |
2642 |
++ * Start by assuming the page is mapped by the same vma as contains @start. |
2643 |
+ * Search forward from there, if not. N.B., this assumes that the |
2644 |
+ * list of pages handed to migrate_pages()--which is how we get here-- |
2645 |
+ * is in virtual address order. |
2646 |
+ */ |
2647 |
+-static struct page *new_vma_page(struct page *page, unsigned long private, int **x) |
2648 |
++static struct page *new_page(struct page *page, unsigned long start, int **x) |
2649 |
+ { |
2650 |
+- struct vm_area_struct *vma = (struct vm_area_struct *)private; |
2651 |
++ struct vm_area_struct *vma; |
2652 |
+ unsigned long uninitialized_var(address); |
2653 |
+ |
2654 |
++ vma = find_vma(current->mm, start); |
2655 |
+ while (vma) { |
2656 |
+ address = page_address_in_vma(page, vma); |
2657 |
+ if (address != -EFAULT) |
2658 |
+@@ -1223,7 +1221,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, |
2659 |
+ return -ENOSYS; |
2660 |
+ } |
2661 |
+ |
2662 |
+-static struct page *new_vma_page(struct page *page, unsigned long private, int **x) |
2663 |
++static struct page *new_page(struct page *page, unsigned long start, int **x) |
2664 |
+ { |
2665 |
+ return NULL; |
2666 |
+ } |
2667 |
+@@ -1233,7 +1231,6 @@ static long do_mbind(unsigned long start, unsigned long len, |
2668 |
+ unsigned short mode, unsigned short mode_flags, |
2669 |
+ nodemask_t *nmask, unsigned long flags) |
2670 |
+ { |
2671 |
+- struct vm_area_struct *vma; |
2672 |
+ struct mm_struct *mm = current->mm; |
2673 |
+ struct mempolicy *new; |
2674 |
+ unsigned long end; |
2675 |
+@@ -1299,11 +1296,9 @@ static long do_mbind(unsigned long start, unsigned long len, |
2676 |
+ if (err) |
2677 |
+ goto mpol_out; |
2678 |
+ |
2679 |
+- vma = queue_pages_range(mm, start, end, nmask, |
2680 |
++ err = queue_pages_range(mm, start, end, nmask, |
2681 |
+ flags | MPOL_MF_INVERT, &pagelist); |
2682 |
+- |
2683 |
+- err = PTR_ERR(vma); /* maybe ... */ |
2684 |
+- if (!IS_ERR(vma)) |
2685 |
++ if (!err) |
2686 |
+ err = mbind_range(mm, start, end, new); |
2687 |
+ |
2688 |
+ if (!err) { |
2689 |
+@@ -1311,9 +1306,8 @@ static long do_mbind(unsigned long start, unsigned long len, |
2690 |
+ |
2691 |
+ if (!list_empty(&pagelist)) { |
2692 |
+ WARN_ON_ONCE(flags & MPOL_MF_LAZY); |
2693 |
+- nr_failed = migrate_pages(&pagelist, new_vma_page, |
2694 |
+- (unsigned long)vma, |
2695 |
+- MIGRATE_SYNC, MR_MEMPOLICY_MBIND); |
2696 |
++ nr_failed = migrate_pages(&pagelist, new_page, |
2697 |
++ start, MIGRATE_SYNC, MR_MEMPOLICY_MBIND); |
2698 |
+ if (nr_failed) |
2699 |
+ putback_movable_pages(&pagelist); |
2700 |
+ } |
2701 |
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c |
2702 |
+index 4b5d4f6360d2..7e7f94755ab5 100644 |
2703 |
+--- a/mm/page_alloc.c |
2704 |
++++ b/mm/page_alloc.c |
2705 |
+@@ -69,6 +69,7 @@ |
2706 |
+ |
2707 |
+ /* prevent >1 _updater_ of zone percpu pageset ->high and ->batch fields */ |
2708 |
+ static DEFINE_MUTEX(pcp_batch_high_lock); |
2709 |
++#define MIN_PERCPU_PAGELIST_FRACTION (8) |
2710 |
+ |
2711 |
+ #ifdef CONFIG_USE_PERCPU_NUMA_NODE_ID |
2712 |
+ DEFINE_PER_CPU(int, numa_node); |
2713 |
+@@ -798,9 +799,21 @@ void __init init_cma_reserved_pageblock(struct page *page) |
2714 |
+ set_page_count(p, 0); |
2715 |
+ } while (++p, --i); |
2716 |
+ |
2717 |
+- set_page_refcounted(page); |
2718 |
+ set_pageblock_migratetype(page, MIGRATE_CMA); |
2719 |
+- __free_pages(page, pageblock_order); |
2720 |
++ |
2721 |
++ if (pageblock_order >= MAX_ORDER) { |
2722 |
++ i = pageblock_nr_pages; |
2723 |
++ p = page; |
2724 |
++ do { |
2725 |
++ set_page_refcounted(p); |
2726 |
++ __free_pages(p, MAX_ORDER - 1); |
2727 |
++ p += MAX_ORDER_NR_PAGES; |
2728 |
++ } while (i -= MAX_ORDER_NR_PAGES); |
2729 |
++ } else { |
2730 |
++ set_page_refcounted(page); |
2731 |
++ __free_pages(page, pageblock_order); |
2732 |
++ } |
2733 |
++ |
2734 |
+ adjust_managed_page_count(page, pageblock_nr_pages); |
2735 |
+ } |
2736 |
+ #endif |
2737 |
+@@ -4106,7 +4119,7 @@ static void __meminit zone_init_free_lists(struct zone *zone) |
2738 |
+ memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY) |
2739 |
+ #endif |
2740 |
+ |
2741 |
+-static int __meminit zone_batchsize(struct zone *zone) |
2742 |
++static int zone_batchsize(struct zone *zone) |
2743 |
+ { |
2744 |
+ #ifdef CONFIG_MMU |
2745 |
+ int batch; |
2746 |
+@@ -4222,8 +4235,8 @@ static void pageset_set_high(struct per_cpu_pageset *p, |
2747 |
+ pageset_update(&p->pcp, high, batch); |
2748 |
+ } |
2749 |
+ |
2750 |
+-static void __meminit pageset_set_high_and_batch(struct zone *zone, |
2751 |
+- struct per_cpu_pageset *pcp) |
2752 |
++static void pageset_set_high_and_batch(struct zone *zone, |
2753 |
++ struct per_cpu_pageset *pcp) |
2754 |
+ { |
2755 |
+ if (percpu_pagelist_fraction) |
2756 |
+ pageset_set_high(pcp, |
2757 |
+@@ -5848,23 +5861,38 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write, |
2758 |
+ void __user *buffer, size_t *length, loff_t *ppos) |
2759 |
+ { |
2760 |
+ struct zone *zone; |
2761 |
+- unsigned int cpu; |
2762 |
++ int old_percpu_pagelist_fraction; |
2763 |
+ int ret; |
2764 |
+ |
2765 |
++ mutex_lock(&pcp_batch_high_lock); |
2766 |
++ old_percpu_pagelist_fraction = percpu_pagelist_fraction; |
2767 |
++ |
2768 |
+ ret = proc_dointvec_minmax(table, write, buffer, length, ppos); |
2769 |
+- if (!write || (ret < 0)) |
2770 |
+- return ret; |
2771 |
++ if (!write || ret < 0) |
2772 |
++ goto out; |
2773 |
++ |
2774 |
++ /* Sanity checking to avoid pcp imbalance */ |
2775 |
++ if (percpu_pagelist_fraction && |
2776 |
++ percpu_pagelist_fraction < MIN_PERCPU_PAGELIST_FRACTION) { |
2777 |
++ percpu_pagelist_fraction = old_percpu_pagelist_fraction; |
2778 |
++ ret = -EINVAL; |
2779 |
++ goto out; |
2780 |
++ } |
2781 |
++ |
2782 |
++ /* No change? */ |
2783 |
++ if (percpu_pagelist_fraction == old_percpu_pagelist_fraction) |
2784 |
++ goto out; |
2785 |
+ |
2786 |
+- mutex_lock(&pcp_batch_high_lock); |
2787 |
+ for_each_populated_zone(zone) { |
2788 |
+- unsigned long high; |
2789 |
+- high = zone->managed_pages / percpu_pagelist_fraction; |
2790 |
++ unsigned int cpu; |
2791 |
++ |
2792 |
+ for_each_possible_cpu(cpu) |
2793 |
+- pageset_set_high(per_cpu_ptr(zone->pageset, cpu), |
2794 |
+- high); |
2795 |
++ pageset_set_high_and_batch(zone, |
2796 |
++ per_cpu_ptr(zone->pageset, cpu)); |
2797 |
+ } |
2798 |
++out: |
2799 |
+ mutex_unlock(&pcp_batch_high_lock); |
2800 |
+- return 0; |
2801 |
++ return ret; |
2802 |
+ } |
2803 |
+ |
2804 |
+ int hashdist = HASHDIST_DEFAULT; |
2805 |
+diff --git a/mm/slab.c b/mm/slab.c |
2806 |
+index b264214c77ea..6dd8d5f3a3ac 100644 |
2807 |
+--- a/mm/slab.c |
2808 |
++++ b/mm/slab.c |
2809 |
+@@ -375,6 +375,39 @@ static void **dbg_userword(struct kmem_cache *cachep, void *objp) |
2810 |
+ |
2811 |
+ #endif |
2812 |
+ |
2813 |
++#define OBJECT_FREE (0) |
2814 |
++#define OBJECT_ACTIVE (1) |
2815 |
++ |
2816 |
++#ifdef CONFIG_DEBUG_SLAB_LEAK |
2817 |
++ |
2818 |
++static void set_obj_status(struct page *page, int idx, int val) |
2819 |
++{ |
2820 |
++ int freelist_size; |
2821 |
++ char *status; |
2822 |
++ struct kmem_cache *cachep = page->slab_cache; |
2823 |
++ |
2824 |
++ freelist_size = cachep->num * sizeof(unsigned int); |
2825 |
++ status = (char *)page->freelist + freelist_size; |
2826 |
++ status[idx] = val; |
2827 |
++} |
2828 |
++ |
2829 |
++static inline unsigned int get_obj_status(struct page *page, int idx) |
2830 |
++{ |
2831 |
++ int freelist_size; |
2832 |
++ char *status; |
2833 |
++ struct kmem_cache *cachep = page->slab_cache; |
2834 |
++ |
2835 |
++ freelist_size = cachep->num * sizeof(unsigned int); |
2836 |
++ status = (char *)page->freelist + freelist_size; |
2837 |
++ |
2838 |
++ return status[idx]; |
2839 |
++} |
2840 |
++ |
2841 |
++#else |
2842 |
++static inline void set_obj_status(struct page *page, int idx, int val) {} |
2843 |
++ |
2844 |
++#endif |
2845 |
++ |
2846 |
+ /* |
2847 |
+ * Do not go above this order unless 0 objects fit into the slab or |
2848 |
+ * overridden on the command line. |
2849 |
+@@ -565,9 +598,18 @@ static inline struct array_cache *cpu_cache_get(struct kmem_cache *cachep) |
2850 |
+ return cachep->array[smp_processor_id()]; |
2851 |
+ } |
2852 |
+ |
2853 |
+-static size_t slab_mgmt_size(size_t nr_objs, size_t align) |
2854 |
++static size_t calculate_freelist_size(int nr_objs, size_t align) |
2855 |
+ { |
2856 |
+- return ALIGN(nr_objs * sizeof(unsigned int), align); |
2857 |
++ size_t freelist_size; |
2858 |
++ |
2859 |
++ freelist_size = nr_objs * sizeof(unsigned int); |
2860 |
++ if (IS_ENABLED(CONFIG_DEBUG_SLAB_LEAK)) |
2861 |
++ freelist_size += nr_objs * sizeof(char); |
2862 |
++ |
2863 |
++ if (align) |
2864 |
++ freelist_size = ALIGN(freelist_size, align); |
2865 |
++ |
2866 |
++ return freelist_size; |
2867 |
+ } |
2868 |
+ |
2869 |
+ /* |
2870 |
+@@ -600,6 +642,10 @@ static void cache_estimate(unsigned long gfporder, size_t buffer_size, |
2871 |
+ nr_objs = slab_size / buffer_size; |
2872 |
+ |
2873 |
+ } else { |
2874 |
++ int extra_space = 0; |
2875 |
++ |
2876 |
++ if (IS_ENABLED(CONFIG_DEBUG_SLAB_LEAK)) |
2877 |
++ extra_space = sizeof(char); |
2878 |
+ /* |
2879 |
+ * Ignore padding for the initial guess. The padding |
2880 |
+ * is at most @align-1 bytes, and @buffer_size is at |
2881 |
+@@ -608,17 +654,18 @@ static void cache_estimate(unsigned long gfporder, size_t buffer_size, |
2882 |
+ * into the memory allocation when taking the padding |
2883 |
+ * into account. |
2884 |
+ */ |
2885 |
+- nr_objs = (slab_size) / (buffer_size + sizeof(unsigned int)); |
2886 |
++ nr_objs = (slab_size) / |
2887 |
++ (buffer_size + sizeof(unsigned int) + extra_space); |
2888 |
+ |
2889 |
+ /* |
2890 |
+ * This calculated number will be either the right |
2891 |
+ * amount, or one greater than what we want. |
2892 |
+ */ |
2893 |
+- if (slab_mgmt_size(nr_objs, align) + nr_objs*buffer_size |
2894 |
+- > slab_size) |
2895 |
++ if (calculate_freelist_size(nr_objs, align) > |
2896 |
++ slab_size - nr_objs * buffer_size) |
2897 |
+ nr_objs--; |
2898 |
+ |
2899 |
+- mgmt_size = slab_mgmt_size(nr_objs, align); |
2900 |
++ mgmt_size = calculate_freelist_size(nr_objs, align); |
2901 |
+ } |
2902 |
+ *num = nr_objs; |
2903 |
+ *left_over = slab_size - nr_objs*buffer_size - mgmt_size; |
2904 |
+@@ -2011,13 +2058,16 @@ static size_t calculate_slab_order(struct kmem_cache *cachep, |
2905 |
+ continue; |
2906 |
+ |
2907 |
+ if (flags & CFLGS_OFF_SLAB) { |
2908 |
++ size_t freelist_size_per_obj = sizeof(unsigned int); |
2909 |
+ /* |
2910 |
+ * Max number of objs-per-slab for caches which |
2911 |
+ * use off-slab slabs. Needed to avoid a possible |
2912 |
+ * looping condition in cache_grow(). |
2913 |
+ */ |
2914 |
++ if (IS_ENABLED(CONFIG_DEBUG_SLAB_LEAK)) |
2915 |
++ freelist_size_per_obj += sizeof(char); |
2916 |
+ offslab_limit = size; |
2917 |
+- offslab_limit /= sizeof(unsigned int); |
2918 |
++ offslab_limit /= freelist_size_per_obj; |
2919 |
+ |
2920 |
+ if (num > offslab_limit) |
2921 |
+ break; |
2922 |
+@@ -2258,8 +2308,7 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) |
2923 |
+ if (!cachep->num) |
2924 |
+ return -E2BIG; |
2925 |
+ |
2926 |
+- freelist_size = |
2927 |
+- ALIGN(cachep->num * sizeof(unsigned int), cachep->align); |
2928 |
++ freelist_size = calculate_freelist_size(cachep->num, cachep->align); |
2929 |
+ |
2930 |
+ /* |
2931 |
+ * If the slab has been placed off-slab, and we have enough space then |
2932 |
+@@ -2272,7 +2321,7 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) |
2933 |
+ |
2934 |
+ if (flags & CFLGS_OFF_SLAB) { |
2935 |
+ /* really off slab. No need for manual alignment */ |
2936 |
+- freelist_size = cachep->num * sizeof(unsigned int); |
2937 |
++ freelist_size = calculate_freelist_size(cachep->num, 0); |
2938 |
+ |
2939 |
+ #ifdef CONFIG_PAGE_POISONING |
2940 |
+ /* If we're going to use the generic kernel_map_pages() |
2941 |
+@@ -2589,6 +2638,7 @@ static void cache_init_objs(struct kmem_cache *cachep, |
2942 |
+ if (cachep->ctor) |
2943 |
+ cachep->ctor(objp); |
2944 |
+ #endif |
2945 |
++ set_obj_status(page, i, OBJECT_FREE); |
2946 |
+ slab_freelist(page)[i] = i; |
2947 |
+ } |
2948 |
+ } |
2949 |
+@@ -2797,6 +2847,7 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp, |
2950 |
+ BUG_ON(objnr >= cachep->num); |
2951 |
+ BUG_ON(objp != index_to_obj(cachep, page, objnr)); |
2952 |
+ |
2953 |
++ set_obj_status(page, objnr, OBJECT_FREE); |
2954 |
+ if (cachep->flags & SLAB_POISON) { |
2955 |
+ #ifdef CONFIG_DEBUG_PAGEALLOC |
2956 |
+ if ((cachep->size % PAGE_SIZE)==0 && OFF_SLAB(cachep)) { |
2957 |
+@@ -2930,6 +2981,8 @@ static inline void cache_alloc_debugcheck_before(struct kmem_cache *cachep, |
2958 |
+ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep, |
2959 |
+ gfp_t flags, void *objp, unsigned long caller) |
2960 |
+ { |
2961 |
++ struct page *page; |
2962 |
++ |
2963 |
+ if (!objp) |
2964 |
+ return objp; |
2965 |
+ if (cachep->flags & SLAB_POISON) { |
2966 |
+@@ -2960,6 +3013,9 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep, |
2967 |
+ *dbg_redzone1(cachep, objp) = RED_ACTIVE; |
2968 |
+ *dbg_redzone2(cachep, objp) = RED_ACTIVE; |
2969 |
+ } |
2970 |
++ |
2971 |
++ page = virt_to_head_page(objp); |
2972 |
++ set_obj_status(page, obj_to_index(cachep, page, objp), OBJECT_ACTIVE); |
2973 |
+ objp += obj_offset(cachep); |
2974 |
+ if (cachep->ctor && cachep->flags & SLAB_POISON) |
2975 |
+ cachep->ctor(objp); |
2976 |
+@@ -4201,21 +4257,12 @@ static void handle_slab(unsigned long *n, struct kmem_cache *c, |
2977 |
+ struct page *page) |
2978 |
+ { |
2979 |
+ void *p; |
2980 |
+- int i, j; |
2981 |
++ int i; |
2982 |
+ |
2983 |
+ if (n[0] == n[1]) |
2984 |
+ return; |
2985 |
+ for (i = 0, p = page->s_mem; i < c->num; i++, p += c->size) { |
2986 |
+- bool active = true; |
2987 |
+- |
2988 |
+- for (j = page->active; j < c->num; j++) { |
2989 |
+- /* Skip freed item */ |
2990 |
+- if (slab_freelist(page)[j] == i) { |
2991 |
+- active = false; |
2992 |
+- break; |
2993 |
+- } |
2994 |
+- } |
2995 |
+- if (!active) |
2996 |
++ if (get_obj_status(page, i) != OBJECT_ACTIVE) |
2997 |
+ continue; |
2998 |
+ |
2999 |
+ if (!add_caller(n, (unsigned long)*dbg_userword(c, p))) |
3000 |
+diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c |
3001 |
+index 9a6bc9df5e81..1c6e950b9ae7 100644 |
3002 |
+--- a/net/bluetooth/hci_conn.c |
3003 |
++++ b/net/bluetooth/hci_conn.c |
3004 |
+@@ -759,7 +759,7 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) |
3005 |
+ /* If we're already encrypted set the REAUTH_PEND flag, |
3006 |
+ * otherwise set the ENCRYPT_PEND. |
3007 |
+ */ |
3008 |
+- if (conn->key_type != 0xff) |
3009 |
++ if (conn->link_mode & HCI_LM_ENCRYPT) |
3010 |
+ set_bit(HCI_CONN_REAUTH_PEND, &conn->flags); |
3011 |
+ else |
3012 |
+ set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); |
3013 |
+diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c |
3014 |
+index 66ada7794ed0..2e8c5765e5ea 100644 |
3015 |
+--- a/net/bluetooth/hci_event.c |
3016 |
++++ b/net/bluetooth/hci_event.c |
3017 |
+@@ -48,6 +48,10 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) |
3018 |
+ smp_mb__after_clear_bit(); /* wake_up_bit advises about this barrier */ |
3019 |
+ wake_up_bit(&hdev->flags, HCI_INQUIRY); |
3020 |
+ |
3021 |
++ hci_dev_lock(hdev); |
3022 |
++ hci_discovery_set_state(hdev, DISCOVERY_STOPPED); |
3023 |
++ hci_dev_unlock(hdev); |
3024 |
++ |
3025 |
+ hci_conn_check_pending(hdev); |
3026 |
+ } |
3027 |
+ |
3028 |
+@@ -3177,8 +3181,11 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev, |
3029 |
+ |
3030 |
+ /* If we're not the initiators request authorization to |
3031 |
+ * proceed from user space (mgmt_user_confirm with |
3032 |
+- * confirm_hint set to 1). */ |
3033 |
+- if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags)) { |
3034 |
++ * confirm_hint set to 1). The exception is if neither |
3035 |
++ * side had MITM in which case we do auto-accept. |
3036 |
++ */ |
3037 |
++ if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && |
3038 |
++ (loc_mitm || rem_mitm)) { |
3039 |
+ BT_DBG("Confirming auto-accept as acceptor"); |
3040 |
+ confirm_hint = 1; |
3041 |
+ goto confirm; |
3042 |
+diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c |
3043 |
+index d4b7702d900f..27ae84154586 100644 |
3044 |
+--- a/net/bluetooth/l2cap_sock.c |
3045 |
++++ b/net/bluetooth/l2cap_sock.c |
3046 |
+@@ -778,11 +778,6 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, |
3047 |
+ |
3048 |
+ /*change security for LE channels */ |
3049 |
+ if (chan->scid == L2CAP_CID_ATT) { |
3050 |
+- if (!conn->hcon->out) { |
3051 |
+- err = -EINVAL; |
3052 |
+- break; |
3053 |
+- } |
3054 |
+- |
3055 |
+ if (smp_conn_security(conn->hcon, sec.level)) |
3056 |
+ break; |
3057 |
+ sk->sk_state = BT_CONFIG; |
3058 |
+diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c |
3059 |
+index a03ca3ca91bf..f1ac2a754acc 100644 |
3060 |
+--- a/net/bluetooth/mgmt.c |
3061 |
++++ b/net/bluetooth/mgmt.c |
3062 |
+@@ -2826,8 +2826,13 @@ static int user_pairing_resp(struct sock *sk, struct hci_dev *hdev, |
3063 |
+ } |
3064 |
+ |
3065 |
+ if (addr->type == BDADDR_LE_PUBLIC || addr->type == BDADDR_LE_RANDOM) { |
3066 |
+- /* Continue with pairing via SMP */ |
3067 |
++ /* Continue with pairing via SMP. The hdev lock must be |
3068 |
++ * released as SMP may try to recquire it for crypto |
3069 |
++ * purposes. |
3070 |
++ */ |
3071 |
++ hci_dev_unlock(hdev); |
3072 |
+ err = smp_user_confirm_reply(conn, mgmt_op, passkey); |
3073 |
++ hci_dev_lock(hdev); |
3074 |
+ |
3075 |
+ if (!err) |
3076 |
+ err = cmd_complete(sk, hdev->id, mgmt_op, |
3077 |
+diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c |
3078 |
+index ebf80f3abd83..653ce5d9e6e0 100644 |
3079 |
+--- a/net/mac80211/debugfs_netdev.c |
3080 |
++++ b/net/mac80211/debugfs_netdev.c |
3081 |
+@@ -34,8 +34,7 @@ static ssize_t ieee80211_if_read( |
3082 |
+ ssize_t ret = -EINVAL; |
3083 |
+ |
3084 |
+ read_lock(&dev_base_lock); |
3085 |
+- if (sdata->dev->reg_state == NETREG_REGISTERED) |
3086 |
+- ret = (*format)(sdata, buf, sizeof(buf)); |
3087 |
++ ret = (*format)(sdata, buf, sizeof(buf)); |
3088 |
+ read_unlock(&dev_base_lock); |
3089 |
+ |
3090 |
+ if (ret >= 0) |
3091 |
+@@ -62,8 +61,7 @@ static ssize_t ieee80211_if_write( |
3092 |
+ |
3093 |
+ ret = -ENODEV; |
3094 |
+ rtnl_lock(); |
3095 |
+- if (sdata->dev->reg_state == NETREG_REGISTERED) |
3096 |
+- ret = (*write)(sdata, buf, count); |
3097 |
++ ret = (*write)(sdata, buf, count); |
3098 |
+ rtnl_unlock(); |
3099 |
+ |
3100 |
+ return ret; |
3101 |
+diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c |
3102 |
+index 2796a198728f..ea7013cb7e52 100644 |
3103 |
+--- a/net/mac80211/ibss.c |
3104 |
++++ b/net/mac80211/ibss.c |
3105 |
+@@ -1655,6 +1655,7 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, |
3106 |
+ sdata->u.ibss.control_port = params->control_port; |
3107 |
+ sdata->u.ibss.userspace_handles_dfs = params->userspace_handles_dfs; |
3108 |
+ sdata->u.ibss.basic_rates = params->basic_rates; |
3109 |
++ sdata->u.ibss.last_scan_completed = jiffies; |
3110 |
+ |
3111 |
+ /* fix basic_rates if channel does not support these rates */ |
3112 |
+ rate_flags = ieee80211_chandef_rate_flags(¶ms->chandef); |
3113 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
3114 |
+index 137a192e64bc..bedaeecdab97 100644 |
3115 |
+--- a/net/mac80211/sta_info.c |
3116 |
++++ b/net/mac80211/sta_info.c |
3117 |
+@@ -240,6 +240,7 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) |
3118 |
+ |
3119 |
+ sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); |
3120 |
+ |
3121 |
++ kfree(rcu_dereference_raw(sta->sta.rates)); |
3122 |
+ kfree(sta); |
3123 |
+ } |
3124 |
+ |
3125 |
+diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c |
3126 |
+index 52ca952b802c..23247a0d2b69 100644 |
3127 |
+--- a/net/netfilter/nf_nat_core.c |
3128 |
++++ b/net/netfilter/nf_nat_core.c |
3129 |
+@@ -517,6 +517,39 @@ static int nf_nat_proto_remove(struct nf_conn *i, void *data) |
3130 |
+ return i->status & IPS_NAT_MASK ? 1 : 0; |
3131 |
+ } |
3132 |
+ |
3133 |
++static int nf_nat_proto_clean(struct nf_conn *ct, void *data) |
3134 |
++{ |
3135 |
++ struct nf_conn_nat *nat = nfct_nat(ct); |
3136 |
++ |
3137 |
++ if (nf_nat_proto_remove(ct, data)) |
3138 |
++ return 1; |
3139 |
++ |
3140 |
++ if (!nat || !nat->ct) |
3141 |
++ return 0; |
3142 |
++ |
3143 |
++ /* This netns is being destroyed, and conntrack has nat null binding. |
3144 |
++ * Remove it from bysource hash, as the table will be freed soon. |
3145 |
++ * |
3146 |
++ * Else, when the conntrack is destoyed, nf_nat_cleanup_conntrack() |
3147 |
++ * will delete entry from already-freed table. |
3148 |
++ */ |
3149 |
++ if (!del_timer(&ct->timeout)) |
3150 |
++ return 1; |
3151 |
++ |
3152 |
++ spin_lock_bh(&nf_nat_lock); |
3153 |
++ hlist_del_rcu(&nat->bysource); |
3154 |
++ ct->status &= ~IPS_NAT_DONE_MASK; |
3155 |
++ nat->ct = NULL; |
3156 |
++ spin_unlock_bh(&nf_nat_lock); |
3157 |
++ |
3158 |
++ add_timer(&ct->timeout); |
3159 |
++ |
3160 |
++ /* don't delete conntrack. Although that would make things a lot |
3161 |
++ * simpler, we'd end up flushing all conntracks on nat rmmod. |
3162 |
++ */ |
3163 |
++ return 0; |
3164 |
++} |
3165 |
++ |
3166 |
+ static void nf_nat_l4proto_clean(u8 l3proto, u8 l4proto) |
3167 |
+ { |
3168 |
+ struct nf_nat_proto_clean clean = { |
3169 |
+@@ -787,7 +820,7 @@ static void __net_exit nf_nat_net_exit(struct net *net) |
3170 |
+ { |
3171 |
+ struct nf_nat_proto_clean clean = {}; |
3172 |
+ |
3173 |
+- nf_ct_iterate_cleanup(net, &nf_nat_proto_remove, &clean, 0, 0); |
3174 |
++ nf_ct_iterate_cleanup(net, nf_nat_proto_clean, &clean, 0, 0); |
3175 |
+ synchronize_rcu(); |
3176 |
+ nf_ct_free_hashtable(net->ct.nat_bysource, net->ct.nat_htable_size); |
3177 |
+ } |
3178 |
+diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c |
3179 |
+index ca3256d6fde3..ede4b92710aa 100644 |
3180 |
+--- a/sound/usb/pcm.c |
3181 |
++++ b/sound/usb/pcm.c |
3182 |
+@@ -1488,7 +1488,8 @@ static void retire_playback_urb(struct snd_usb_substream *subs, |
3183 |
+ * on two reads of a counter updated every ms. |
3184 |
+ */ |
3185 |
+ if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) |
3186 |
+- snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n", |
3187 |
++ dev_dbg_ratelimited(&subs->dev->dev, |
3188 |
++ "delay: estimated %d, actual %d\n", |
3189 |
+ est_delay, subs->last_delay); |
3190 |
+ |
3191 |
+ if (!subs->running) { |
3192 |
+diff --git a/tools/usb/ffs-test.c b/tools/usb/ffs-test.c |
3193 |
+index fe1e66b6ef40..a87e99f37c52 100644 |
3194 |
+--- a/tools/usb/ffs-test.c |
3195 |
++++ b/tools/usb/ffs-test.c |
3196 |
+@@ -116,8 +116,8 @@ static const struct { |
3197 |
+ .header = { |
3198 |
+ .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC), |
3199 |
+ .length = cpu_to_le32(sizeof descriptors), |
3200 |
+- .fs_count = 3, |
3201 |
+- .hs_count = 3, |
3202 |
++ .fs_count = cpu_to_le32(3), |
3203 |
++ .hs_count = cpu_to_le32(3), |
3204 |
+ }, |
3205 |
+ .fs_descs = { |
3206 |
+ .intf = { |